diff --git a/.github/actions/run-backend-tests/action.yml b/.github/actions/run-backend-tests/action.yml index bde3554bb4e20..7cfa27aacccf8 100644 --- a/.github/actions/run-backend-tests/action.yml +++ b/.github/actions/run-backend-tests/action.yml @@ -210,7 +210,7 @@ runs: - name: Upload updated timing data as artifacts uses: actions/upload-artifact@v4 - if: ${{ inputs.person-on-events != 'true' && inputs.clickhouse-server-image == 'clickhouse/clickhouse-server:23.12.6.19' }} + if: ${{ inputs.person-on-events != 'true' && inputs.clickhouse-server-image == 'clickhouse/clickhouse-server:24.8.7.41' }} with: name: timing_data-${{ inputs.segment }}-${{ inputs.group }} path: .test_durations diff --git a/.github/workflows/ci-backend-update-test-timing.yml b/.github/workflows/ci-backend-update-test-timing.yml index e37df8defe9cb..39a1993119701 100644 --- a/.github/workflows/ci-backend-update-test-timing.yml +++ b/.github/workflows/ci-backend-update-test-timing.yml @@ -29,13 +29,13 @@ jobs: group: 1 token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }} python-version: '3.11.9' - clickhouse-server-image: 'clickhouse/clickhouse-server:23.12.6.19' + clickhouse-server-image: 'clickhouse/clickhouse-server:24.8.7.41' segment: 'FOSS' person-on-events: false - name: Upload updated timing data as artifacts uses: actions/upload-artifact@v4 - if: ${{ inputs.person-on-events != 'true' && inputs.clickhouse-server-image == 'clickhouse/clickhouse-server:23.12.6.19' }} + if: ${{ inputs.person-on-events != 'true' && inputs.clickhouse-server-image == 'clickhouse/clickhouse-server:24.8.7.41' }} with: name: timing_data-${{ inputs.segment }}-${{ inputs.group }} path: .test_durations diff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.yml index 3a882b030012f..943b6611006d7 100644 --- a/.github/workflows/ci-backend.yml +++ b/.github/workflows/ci-backend.yml @@ -234,7 +234,7 @@ jobs: fail-fast: false matrix: python-version: ['3.11.9'] - clickhouse-server-image: ['clickhouse/clickhouse-server:23.12.6.19'] + clickhouse-server-image: ['clickhouse/clickhouse-server:24.8.7.41'] segment: ['Core'] person-on-events: [false, true] # :NOTE: Keep concurrency and groups in sync @@ -243,19 +243,19 @@ jobs: include: - segment: 'Temporal' person-on-events: false - clickhouse-server-image: 'clickhouse/clickhouse-server:23.12.6.19' + clickhouse-server-image: 'clickhouse/clickhouse-server:24.8.7.41' python-version: '3.11.9' concurrency: 3 group: 1 - segment: 'Temporal' person-on-events: false - clickhouse-server-image: 'clickhouse/clickhouse-server:23.12.6.19' + clickhouse-server-image: 'clickhouse/clickhouse-server:24.8.7.41' python-version: '3.11.9' concurrency: 3 group: 2 - segment: 'Temporal' person-on-events: false - clickhouse-server-image: 'clickhouse/clickhouse-server:23.12.6.19' + clickhouse-server-image: 'clickhouse/clickhouse-server:24.8.7.41' python-version: '3.11.9' concurrency: 3 group: 3 @@ -326,7 +326,7 @@ jobs: strategy: fail-fast: false matrix: - clickhouse-server-image: ['clickhouse/clickhouse-server:23.12.6.19'] + clickhouse-server-image: ['clickhouse/clickhouse-server:24.8.7.41'] if: needs.changes.outputs.backend == 'true' runs-on: ubuntu-latest steps: diff --git a/.github/workflows/container-images-cd.yml b/.github/workflows/container-images-cd.yml index c4e672c560c86..e7fe1a1608b73 100644 --- a/.github/workflows/container-images-cd.yml +++ b/.github/workflows/container-images-cd.yml @@ -30,12 +30,12 @@ jobs: steps: - name: Check out - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -134,7 +134,7 @@ jobs: run: | echo "changed=$((git diff --name-only HEAD^ HEAD | grep -qE '^posthog/temporal/common|^posthog/temporal/batch_exports|^posthog/batch_exports/|^posthog/management/commands/start_temporal_worker.py$|^requirements.txt$' && echo true) || echo false)" >> $GITHUB_OUTPUT - - name: Trigger Batch Exports Temporal Worker Cloud deployment + - name: Trigger Batch Exports Sync Temporal Worker Cloud deployment if: steps.check_changes_batch_exports_temporal_worker.outputs.changed == 'true' uses: peter-evans/repository-dispatch@v3 with: @@ -155,6 +155,27 @@ jobs: "timestamp": "${{ github.event.head_commit.timestamp }}" } + - name: Trigger Batch Exports Temporal Worker Cloud deployment + if: steps.check_changes_batch_exports_temporal_worker.outputs.changed == 'true' + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ steps.deployer.outputs.token }} + repository: PostHog/charts + event-type: commit_state_update + client-payload: | + { + "values": { + "image": { + "sha": "${{ steps.build.outputs.digest }}" + } + }, + "release": "temporal-worker-batch-exports", + "commit": ${{ toJson(github.event.head_commit) }}, + "repository": ${{ toJson(github.repository) }}, + "labels": ${{ steps.labels.outputs.labels }}, + "timestamp": "${{ github.event.head_commit.timestamp }}" + } + - name: Check for changes that affect general purpose temporal worker id: check_changes_general_purpose_temporal_worker run: | diff --git a/.github/workflows/rust-docker-build.yml b/.github/workflows/rust-docker-build.yml index acdcf0b342714..1535867f572f0 100644 --- a/.github/workflows/rust-docker-build.yml +++ b/.github/workflows/rust-docker-build.yml @@ -142,10 +142,10 @@ jobs: values: image: sha: '${{ needs.build.outputs.property-defs-rs_digest }}' - # - release: cymbal - disabled until a charts in place, for now we just build - # values: - # image: - # sha: '${{ needs.build.outputs.cymbal_digest }}' + - release: cymbal + values: + image: + sha: '${{ needs.build.outputs.cymbal_digest }}' - release: hoghooks values: api_image: diff --git a/.gitignore b/.gitignore index 6f0c1be90cbae..a41dd0980a217 100644 --- a/.gitignore +++ b/.gitignore @@ -69,4 +69,10 @@ plugin-transpiler/dist *.log # pyright config (keep this until we have a standardized one) pyrightconfig.json -.temporal-worker-settings \ No newline at end of file +# Assistant Evaluation with Deepeval +.deepeval +.deepeval-cache.json +.deepeval_telemtry.txt +.temporal-worker-settings +temp_test_run_data.json +.temp-deepeval-cache.json diff --git a/.vscode/launch.json b/.vscode/launch.json index 93a654422dbe0..3aa83e0bb4e0d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -190,6 +190,23 @@ "purpose": ["debug-test"], "console": "integratedTerminal", "justMyCode": false + }, + { + "type": "node", + "request": "launch", + "name": "Jest Current File", + "program": "${workspaceFolder}/node_modules/jest/bin/jest.js", + "args": ["--detectOpenHandles", "${relativeFile}"], + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen", + "runtimeExecutable": "${env:HOME}/.nvm/versions/node/${input:pickVersion}/bin/node" + } + ], + "inputs": [ + { + "id": "pickVersion", + "type": "command", + "command": "extension.node-version" } ], "compounds": [ diff --git a/bin/copy-posthog-js b/bin/copy-posthog-js index da49d8c904668..fa386a8cfb17d 100755 --- a/bin/copy-posthog-js +++ b/bin/copy-posthog-js @@ -13,3 +13,5 @@ cp node_modules/posthog-js/dist/surveys.js* frontend/dist/ cp node_modules/posthog-js/dist/exception-autocapture.js* frontend/dist/ cp node_modules/posthog-js/dist/web-vitals.js* frontend/dist/ cp node_modules/posthog-js/dist/dead-clicks-autocapture.js* frontend/dist/ +cp node_modules/posthog-js/dist/customizations.full.js* frontend/dist/ + diff --git a/cypress/e2e/alerts.cy.ts b/cypress/e2e/alerts.cy.ts index 6f0821fa030d9..82bd6bc10f4fb 100644 --- a/cypress/e2e/alerts.cy.ts +++ b/cypress/e2e/alerts.cy.ts @@ -1,5 +1,5 @@ import { decideResponse } from '../fixtures/api/decide' -import { createInsight } from '../productAnalytics' +import { createInsight, createInsightWithBreakdown } from '../productAnalytics' describe('Alerts', () => { beforeEach(() => { @@ -115,4 +115,25 @@ describe('Alerts', () => { cy.reload() cy.contains('Alert name').should('not.exist') }) + + it('Should allow creating alerts on trends with breakdowns', () => { + createInsightWithBreakdown('insight with breakdown') + setInsightDisplayTypeAndSave('Bar chart') + + createAlert('Alert name', '10', '20', 'increases by') + cy.reload() + + // Check the alert has the same values as when it was created + cy.contains('Alerts').click() + cy.get('[data-attr=alert-list-item]').contains('Alert name').click() + cy.contains('any breakdown value').should('exist') + cy.get('[data-attr=alertForm-name]').should('have.value', 'Alert name') + cy.get('[data-attr=alertForm-lower-threshold').should('have.value', '10') + cy.get('[data-attr=alertForm-upper-threshold').should('have.value', '20') + cy.contains('Delete alert').click() + cy.wait(2000) + + cy.reload() + cy.contains('Alert name').should('not.exist') + }) }) diff --git a/cypress/e2e/persons.cy.ts b/cypress/e2e/persons.cy.ts index 0b8192a687727..ee57d75d066ac 100644 --- a/cypress/e2e/persons.cy.ts +++ b/cypress/e2e/persons.cy.ts @@ -13,7 +13,10 @@ describe('Persons', () => { it('Deleting person from list', () => { cy.get('[data-attr=persons-search]').type('hodge').type('{enter}') cy.contains('tr', 'hodge.espinoza@cubix.io').find('[data-attr=delete-person]').click() - cy.get('h3').should('have.text', 'Are you sure you want to delete "hodge.espinoza@cubix.io"?') + cy.get('.LemonModal__header h3').should( + 'have.text', + 'Are you sure you want to delete "hodge.espinoza@cubix.io"?' + ) cy.get('label').contains('I understand').click() // Acknowledge deletion cy.get('.LemonButton--secondary').contains('Delete person').click() cy.get('.Toastify__toast-body').contains('hodge.espinoza@cubix.io was removed from the project') diff --git a/cypress/e2e/surveys.cy.ts b/cypress/e2e/surveys.cy.ts index 1cccfb545fc57..604c182a51a18 100644 --- a/cypress/e2e/surveys.cy.ts +++ b/cypress/e2e/surveys.cy.ts @@ -100,7 +100,7 @@ describe('Surveys', () => { cy.get('[data-attr=prop-val]').click({ force: true }) cy.get('[data-attr=prop-val-0]').click({ force: true }) - cy.get('[data-attr="rollout-percentage"]').type('100') + cy.get('[data-attr="rollout-percentage"]').click().type('100') // save cy.get('[data-attr="save-survey"]').eq(0).click() @@ -202,7 +202,7 @@ describe('Surveys', () => { cy.get('[data-attr="prop-filter-person_properties-0"]').click() cy.get('[data-attr=prop-val]').click({ force: true }) cy.get('[data-attr=prop-val-0]').click({ force: true }) - cy.get('[data-attr="rollout-percentage"]').type('100') + cy.get('[data-attr="rollout-percentage"]').click().type('100') cy.get('[data-attr=save-survey]').first().click() diff --git a/cypress/productAnalytics/index.ts b/cypress/productAnalytics/index.ts index 0fc9972014116..5bfdeae781326 100644 --- a/cypress/productAnalytics/index.ts +++ b/cypress/productAnalytics/index.ts @@ -29,6 +29,11 @@ export const insight = { } }) }, + applyBreakdown: (): void => { + cy.contains('Add breakdown').click() + cy.contains('Browser').click() + cy.wait(1000) + }, editName: (insightName: string): void => { if (insightName) { cy.get('[data-attr="top-bar-name"] button').click() @@ -207,6 +212,17 @@ export function createInsight(insightName: string): Cypress.Chainable { }) } +export function createInsightWithBreakdown(insightName: string): Cypress.Chainable { + savedInsights.createNewInsightOfType('TRENDS') + insight.applyBreakdown() + insight.editName(insightName) + insight.save() + // return insight id from the url + return cy.url().then((url) => { + return url.split('/').at(-1) + }) +} + export function duplicateDashboardFromMenu(duplicateTiles = false): void { cy.contains('.LemonButton', 'Duplicate').click() if (duplicateTiles) { diff --git a/cypress/wait.py b/cypress/wait.py index 275800beb6bfb..ceb58b45bc539 100644 --- a/cypress/wait.py +++ b/cypress/wait.py @@ -17,8 +17,8 @@ def main(): print("PostHog is alive! Proceeding") continue else: - # recieved not 200 from PostHog, but service is up - print("Found status %d" % (r.status,)) + # received not 200 from PostHog, but service is up + print(f"Found status {r.status:d}") with open("cypress/screenshots/curl.html", "wb") as f: f.write(r.read) # type: ignore print("PostHog is still booting. Sleeping for 1 second") diff --git a/docker-compose.base.yml b/docker-compose.base.yml index f582d84197a9a..7e22d9bf3d953 100644 --- a/docker-compose.base.yml +++ b/docker-compose.base.yml @@ -79,7 +79,7 @@ services: # Note: please keep the default version in sync across # `posthog` and the `charts-clickhouse` repos # - image: ${CLICKHOUSE_SERVER_IMAGE:-clickhouse/clickhouse-server:23.12.6.19} + image: ${CLICKHOUSE_SERVER_IMAGE:-clickhouse/clickhouse-server:24.8.7.41} restart: on-failure zookeeper: diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 6eaa159d3ff01..35b8a5591c876 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -57,6 +57,7 @@ services: service: clickhouse ports: - '8123:8123' + - '8443:8443' - '9000:9000' - '9440:9440' - '9009:9009' diff --git a/docker/clickhouse/config.xml b/docker/clickhouse/config.xml index bc1c691f8b414..7126270681eac 100644 --- a/docker/clickhouse/config.xml +++ b/docker/clickhouse/config.xml @@ -5,255 +5,29 @@ You can either move the settings to the right place inside "users.xml" file or add 1 here. --> - + - - error + trace /var/log/clickhouse-server/clickhouse-server.log /var/log/clickhouse-server/clickhouse-server.err.log - 1000M 10 - - - - - - - - - - - - - - - 8123 - - 9000 - - 9004 - - 9005 - - 8443 - - 9440 - - - - - 9009 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4096 - - 3 - - - - false - - - /path/to/ssl_cert_file - /path/to/ssl_key_file - - - false - - - /path/to/ssl_ca_cert_file - - - none - - - 0 - - - -1 - -1 - - - false - - - - - + /etc/clickhouse-server/server.crt /etc/clickhouse-server/server.key - /etc/clickhouse-server/dhparam.pem none true @@ -262,28 +36,17 @@ true - + true true sslv2,sslv3 true - - RejectCertificateHandler - - - 200 @@ -359,27 +122,6 @@ --> 5368709120 - - 1000 @@ -394,124 +136,9 @@ /var/lib/clickhouse/tmp/ - - - /var/lib/clickhouse/user_files/ - - - - - - - - @@ -522,237 +149,42 @@ /var/lib/clickhouse/access/ - - default - - - - - - - - default - - - - - - - true false - ' | sed -e 's|.*>\(.*\)<.*|\1|') - wget https://github.com/ClickHouse/clickhouse-jdbc-bridge/releases/download/v$PKG_VER/clickhouse-jdbc-bridge_$PKG_VER-1_all.deb - apt install --no-install-recommends -f ./clickhouse-jdbc-bridge_$PKG_VER-1_all.deb - clickhouse-jdbc-bridge & - - * [CentOS/RHEL] - export MVN_URL=https://repo1.maven.org/maven2/ru/yandex/clickhouse/clickhouse-jdbc-bridge - export PKG_VER=$(curl -sL $MVN_URL/maven-metadata.xml | grep '' | sed -e 's|.*>\(.*\)<.*|\1|') - wget https://github.com/ClickHouse/clickhouse-jdbc-bridge/releases/download/v$PKG_VER/clickhouse-jdbc-bridge-$PKG_VER-1.noarch.rpm - yum localinstall -y clickhouse-jdbc-bridge-$PKG_VER-1.noarch.rpm - clickhouse-jdbc-bridge & - - Please refer to https://github.com/ClickHouse/clickhouse-jdbc-bridge#usage for more information. - ]]> - - - - - - - - - - - - localhost 9000 - - + + + + localhost + 9000 + + + - - - - .* - - - - zookeeper @@ -760,13 +192,6 @@ - - 01 ch1 @@ -776,71 +201,12 @@ 3600 - 3600 60 - - - - - - - - system query_log
- toYYYYMM(event_date) - - - 7500 @@ -885,23 +226,12 @@ 524288 - false + true
- - @@ -924,29 +254,13 @@ 7500 - - @@ -1019,19 +333,6 @@ 7500 - - - - - - - - - - *_function.xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - /clickhouse/task_queue/ddl - - - - - - - - - - - - - - - - - - - - - - - - @@ -1201,91 +411,4 @@ \1(???) - - - - - - - - false - - false - - - https://6f33034cfe684dd7a3ab9875e57b1c8d@o388870.ingest.sentry.io/5226277 - - - - - - - -
+ diff --git a/docker/clickhouse/users.xml b/docker/clickhouse/users.xml index ece3df0f09fbe..22a050a6c9d4e 100644 --- a/docker/clickhouse/users.xml +++ b/docker/clickhouse/users.xml @@ -9,6 +9,9 @@ 10000000000 + + 0 + "),typeof dt!="string"&&!U1(dt))if(typeof dt.toString=="function"){if(dt=dt.toString(),typeof dt!="string")throw a0("dirty is not a string, aborting")}else throw a0("toString is not a function");if(!e.isSupported)return dt;if(vr||fa(Q),e.removed=[],typeof dt=="string"&&(X=!1),X){if(dt.nodeName){let ll=Nt(dt.nodeName);if(!pe[ll]||Ki[ll])throw a0("root node is forbidden and cannot be sanitized in-place")}}else if(dt instanceof a)Le=y_(""),Fe=Le.ownerDocument.importNode(dt,!0),Fe.nodeType===1&&Fe.nodeName==="BODY"||Fe.nodeName==="HTML"?Le=Fe:Le.appendChild(Fe);else{if(!cs&&!Ni&&!tt&&dt.indexOf("<")===-1)return y&&pc?y.createHTML(dt):dt;if(Le=y_(dt),!Le)return cs?null:pc?x:""}Le&&Cr&&al(Le.firstChild);let Sr=H1(X?dt:Le);for(;Ei=Sr.nextNode();)zF(Ei)||(Ei.content instanceof s&&RK(Ei.content),UF(Ei));if(X)return dt;if(cs){if(wr)for(go=N.call(Le.ownerDocument);Le.firstChild;)go.appendChild(Le.firstChild);else go=Le;return(Qe.shadowroot||Qe.shadowrootmode)&&(go=W.call(t,go,!0)),go}let en=tt?Le.outerHTML:Le.innerHTML;return tt&&pe["!doctype"]&&Le.ownerDocument&&Le.ownerDocument.doctype&&Le.ownerDocument.doctype.name&&Js(k7,Le.ownerDocument.doctype.name)&&(en=" +`+en),Ni&&(en=Da(en,G," "),en=Da(en,V," "),en=Da(en,z," ")),y&&pc?y.createHTML(en):en},e.setConfig=function(dt){fa(dt),vr=!0},e.clearConfig=function(){Zi=null,vr=!1},e.isValidAttribute=function(dt,Q,Le){Zi||fa({});let Fe=Nt(dt),Ei=Nt(Q);return VF(Fe,Ei,Le)},e.addHook=function(dt,Q){typeof Q=="function"&&(j[dt]=j[dt]||[],r0(j[dt],Q))},e.removeHook=function(dt){if(j[dt])return b7(j[dt])},e.removeHooks=function(dt){j[dt]&&(j[dt]=[])},e.removeAllHooks=function(){j={}},e}var x7,_7,X$,Q$,J$,_s,Ea,eq,HT,UT,tq,b7,r0,Rw,FT,iq,Da,nq,oq,Js,a0,v7,BT,WT,rq,zT,aq,C7,w7,VT,y7,Mw,lq,cq,dq,hq,uq,L7,fq,gq,k7,S7,mq,pq,_l,Gse,Zse,Pw,Yse,Xse,Qse,l0,Ow,Jse,ere,Fw=J(()=>{"use strict";_();v();b();({entries:x7,setPrototypeOf:_7,isFrozen:X$,getPrototypeOf:Q$,getOwnPropertyDescriptor:J$}=Object),{freeze:_s,seal:Ea,create:eq}=Object,{apply:HT,construct:UT}=typeof Reflect<"u"&&Reflect;HT||(HT=function(e,t,i){return e.apply(t,i)});_s||(_s=function(e){return e});Ea||(Ea=function(e){return e});UT||(UT=function(e,t){return new e(...t)});tq=Nr(Array.prototype.forEach),b7=Nr(Array.prototype.pop),r0=Nr(Array.prototype.push),Rw=Nr(String.prototype.toLowerCase),FT=Nr(String.prototype.toString),iq=Nr(String.prototype.match),Da=Nr(String.prototype.replace),nq=Nr(String.prototype.indexOf),oq=Nr(String.prototype.trim),Js=Nr(RegExp.prototype.test),a0=sq(TypeError);v7=_s(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),BT=_s(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),WT=_s(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),rq=_s(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),zT=_s(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),aq=_s(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),C7=_s(["#text"]),w7=_s(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),VT=_s(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),y7=_s(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Mw=_s(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),lq=Ea(/\{\{[\w\W]*|[\w\W]*\}\}/gm),cq=Ea(/<%[\w\W]*|[\w\W]*%>/gm),dq=Ea(/\${[\w\W]*}/gm),hq=Ea(/^data-[\-\w.\u00B7-\uFFFF]/),uq=Ea(/^aria-[\-\w]+$/),L7=Ea(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),fq=Ea(/^(?:\w+script|data):/i),gq=Ea(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),k7=Ea(/^html$/i),S7=Object.freeze({__proto__:null,MUSTACHE_EXPR:lq,ERB_EXPR:cq,TMPLIT_EXPR:dq,DATA_ATTR:hq,ARIA_ATTR:uq,IS_ALLOWED_URI:L7,IS_SCRIPT_OR_DATA:fq,ATTR_WHITESPACE:gq,DOCTYPE_NAME:k7}),mq=()=>typeof window>"u"?null:window,pq=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null,o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(i=t.getAttribute(o));let s="dompurify"+(i?"#"+i:"");try{return e.createPolicy(s,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}};_l=D7(),Gse=_l.version,Zse=_l.isSupported,Pw=_l.sanitize,Yse=_l.setConfig,Xse=_l.clearConfig,Qse=_l.isValidAttribute,l0=_l.addHook,Ow=_l.removeHook,Jse=_l.removeHooks,ere=_l.removeAllHooks});function c0(n,e){return Oe.isUri(n)?xc(n.scheme,e):Dg(n,e+":")}function $T(n,...e){return e.some(t=>c0(n,t))}var Ze,_q,KT,qT,bq,Bw,Ww,I7,er=J(()=>{"use strict";_();v();b();xt();Lt();ot();sn();wc();(function(n){n.inMemory="inmemory",n.vscode="vscode",n.internal="private",n.walkThrough="walkThrough",n.walkThroughSnippet="walkThroughSnippet",n.http="http",n.https="https",n.file="file",n.mailto="mailto",n.untitled="untitled",n.data="data",n.command="command",n.vscodeRemote="vscode-remote",n.vscodeRemoteResource="vscode-remote-resource",n.vscodeManagedRemoteResource="vscode-managed-remote-resource",n.vscodeUserData="vscode-userdata",n.vscodeCustomEditor="vscode-custom-editor",n.vscodeNotebookCell="vscode-notebook-cell",n.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",n.vscodeNotebookCellOutput="vscode-notebook-cell-output",n.vscodeInteractiveInput="vscode-interactive-input",n.vscodeSettings="vscode-settings",n.vscodeWorkspaceTrust="vscode-workspace-trust",n.vscodeTerminal="vscode-terminal",n.vscodeChatCodeBlock="vscode-chat-code-block",n.vscodeChatCodeCompreBlock="vscode-chat-code-compare-block",n.vscodeChatSesssion="vscode-chat-editor",n.webviewPanel="webview-panel",n.vscodeWebview="vscode-webview",n.extension="extension",n.vscodeFileResource="vscode-file",n.tmp="tmp",n.vsls="vsls",n.vscodeSourceControl="vscode-scm",n.commentsInput="comment",n.codeSetting="code-setting"})(Ze||(Ze={}));_q="tkn",KT=class{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}get _remoteResourcesPath(){return ci.join(this._serverRootPath,Ze.vscodeRemoteResource)}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return ut(a),e}let t=e.authority,i=this._hosts[t];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i=`[${i}]`);let o=this._ports[t],s=this._connectionTokens[t],r=`path=${encodeURIComponent(e.path)}`;return typeof s=="string"&&(r+=`&${_q}=${encodeURIComponent(s)}`),Oe.from({scheme:hl?this._preferredWebSchema:Ze.vscodeRemoteResource,authority:`${i}:${o}`,path:this._remoteResourcesPath,query:r})}},qT=new KT,bq="vscode-app",Bw=class n{uriToBrowserUri(e){return e.scheme===Ze.vscodeRemote?qT.rewrite(e):e.scheme===Ze.file&&(md||m9===`${Ze.vscodeFileResource}://${n.FALLBACK_AUTHORITY}`)?e.with({scheme:Ze.vscodeFileResource,authority:e.authority||n.FALLBACK_AUTHORITY,query:null,fragment:null}):e}};Bw.FALLBACK_AUTHORITY=bq;Ww=new Bw;(function(n){let e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);n.CoopAndCoep=Object.freeze(e.get("3"));let t="vscode-coi";function i(s){let r;typeof s=="string"?r=new URL(s).searchParams:s instanceof URL?r=s.searchParams:Oe.isUri(s)&&(r=new URL(s.toString(!0)).searchParams);let a=r?.get(t);if(a)return e.get(a)}n.getHeadersFromQuery=i;function o(s,r,a){if(!globalThis.crossOriginIsolated)return;let l=r&&a?"3":a?"2":"1";s instanceof URLSearchParams?s.set(t,l):s[t]=l}n.addSearchParam=o})(I7||(I7={}))});function zw(n){return u0(n,0)}function u0(n,e){switch(typeof n){case"object":return n===null?Dc(349,e):Array.isArray(n)?Cq(n,e):wq(n,e);case"string":return Vw(n,e);case"boolean":return vq(n,e);case"number":return Dc(n,e);case"undefined":return Dc(937,e);default:return Dc(617,e)}}function Dc(n,e){return(e<<5)-e+n|0}function vq(n,e){return Dc(n?433:863,e)}function Vw(n,e){e=Dc(149417,e);for(let t=0,i=n.length;tu0(i,t),e)}function wq(n,e){return e=Dc(181387,e),Object.keys(n).sort().reduce((t,i)=>(t=Vw(i,t),u0(n[i],t)),e)}function jT(n,e,t=32){let i=t-e,o=~((1<>>i)>>>0}function T7(n,e=0,t=n.byteLength,i=0){for(let o=0;ot.toString(16).padStart(2,"0")).join(""):yq((n>>>0).toString(16),e/4)}var h0,Bg=J(()=>{"use strict";_();v();b();ot();h0=class n{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let t=e.length;if(t===0)return;let i=this._buff,o=this._buffLen,s=this._leftoverHighSurrogate,r,a;for(s!==0?(r=s,a=-1,s=0):(r=e.charCodeAt(0),a=0);;){let l=r;if(pi(r))if(a+1>>6,e[t++]=128|(i&63)>>>0):i<65536?(e[t++]=224|(i&61440)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0):(e[t++]=240|(i&1835008)>>>18,e[t++]=128|(i&258048)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),d0(this._h0)+d0(this._h1)+d0(this._h2)+d0(this._h3)+d0(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,T7(this._buff,this._buffLen),this._buffLen>56&&(this._step(),T7(this._buff));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let e=n._bigBlock32,t=this._buffDV;for(let h=0;h<64;h+=4)e.setUint32(h,t.getUint32(h,!1),!1);for(let h=64;h<320;h+=4)e.setUint32(h,jT(e.getUint32(h-12,!1)^e.getUint32(h-32,!1)^e.getUint32(h-56,!1)^e.getUint32(h-64,!1),1),!1);let i=this._h0,o=this._h1,s=this._h2,r=this._h3,a=this._h4,l,c,d;for(let h=0;h<80;h++)h<20?(l=o&s|~o&r,c=1518500249):h<40?(l=o^s^r,c=1859775393):h<60?(l=o&s|o&r|s&r,c=2400959708):(l=o^s^r,c=3395469782),d=jT(i,5)+l+a+c+e.getUint32(h*4,!1)&4294967295,a=r,r=s,s=jT(o,30),o=i,i=d;this._h0=this._h0+i&4294967295,this._h1=this._h1+o&4294967295,this._h2=this._h2+s&4294967295,this._h3=this._h3+r&4294967295,this._h4=this._h4+a&4294967295}};h0._bigBlock32=new DataView(new ArrayBuffer(320))});function Co(n){for(;n.firstChild;)n.firstChild.remove()}function $(n,e,t,i){return new ZT(n,e,t,i)}function O7(n,e){return function(t){return e(new yn(n,t))}}function xq(n){return function(e){return n(new bt(e))}}function Lq(n,e,t){return $(n,Rs&&Ag.pointerEvents?se.POINTER_DOWN:se.MOUSE_DOWN,e,t)}function m0(n,e,t){return Rg(n,e,t)}function eN(n){return ge(n).getComputedStyle(n,null)}function zg(n,e){let t=ge(n),i=t.document;if(n!==i.body)return new Ar(n.clientWidth,n.clientHeight);if(Rs&&t?.visualViewport)return new Ar(t.visualViewport.width,t.visualViewport.height);if(t?.innerWidth&&t.innerHeight)return new Ar(t.innerWidth,t.innerHeight);if(i.body&&i.body.clientWidth&&i.body.clientHeight)return new Ar(i.body.clientWidth,i.body.clientHeight);if(i.documentElement&&i.documentElement.clientWidth&&i.documentElement.clientHeight)return new Ar(i.documentElement.clientWidth,i.documentElement.clientHeight);if(e)return zg(e);throw new Error("Unable to figure out browser width and height")}function F7(n){let e=n.offsetParent,t=n.offsetTop,i=n.offsetLeft;for(;(n=n.parentNode)!==null&&n!==n.ownerDocument.body&&n!==n.ownerDocument.documentElement;){t-=n.scrollTop;let o=W7(n)?null:eN(n);o&&(i-=o.direction!=="rtl"?n.scrollLeft:-n.scrollLeft),n===e&&(i+=Qo.getBorderLeftWidth(n),t+=Qo.getBorderTopWidth(n),t+=n.offsetTop,i+=n.offsetLeft,e=n.offsetParent)}return{left:i,top:t}}function Dre(n,e,t){typeof e=="number"&&(n.style.width=`${e}px`),typeof t=="number"&&(n.style.height=`${t}px`)}function Sn(n){let e=n.getBoundingClientRect(),t=ge(n);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function Uw(n){let e=n,t=1;do{let i=eN(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function Vg(n){let e=Qo.getMarginLeft(n)+Qo.getMarginRight(n);return n.offsetWidth+e}function Kw(n){let e=Qo.getBorderLeftWidth(n)+Qo.getBorderRightWidth(n),t=Qo.getPaddingLeft(n)+Qo.getPaddingRight(n);return n.offsetWidth-e-t}function B7(n){let e=Qo.getBorderTopWidth(n)+Qo.getBorderBottomWidth(n),t=Qo.getPaddingTop(n)+Qo.getPaddingBottom(n);return n.offsetHeight-e-t}function p0(n){let e=Qo.getMarginTop(n)+Qo.getMarginBottom(n);return n.offsetHeight+e}function yi(n,e){return!!e?.contains(n)}function kq(n,e,t){for(;n&&n.nodeType===n.ELEMENT_NODE;){if(n.classList.contains(e))return n;if(t){if(typeof t=="string"){if(n.classList.contains(t))return null}else if(n===t)return null}n=n.parentNode}return null}function $w(n,e,t){return!!kq(n,e,t)}function W7(n){return n&&!!n.host&&!!n.mode}function gu(n){return!!Ec(n)}function Ec(n){for(var e;n.parentNode;){if(n===((e=n.ownerDocument)===null||e===void 0?void 0:e.body))return null;n=n.parentNode}return W7(n)?n:null}function Bi(){let n=jw().activeElement;for(;n?.shadowRoot;)n=n.shadowRoot.activeElement;return n}function _0(n){return Bi()===n}function qw(n){return yi(Bi(),n)}function jw(){var n;return Sq()<=1?gt.document:(n=Array.from(M7()).map(({window:t})=>t.document).find(t=>t.hasFocus()))!==null&&n!==void 0?n:gt.document}function z7(){var n,e;return(e=(n=jw().defaultView)===null||n===void 0?void 0:n.window)!==null&&e!==void 0?e:gt}function Ere(){return new YT}function Xi(n=gt.document.head,e,t){let i=document.createElement("style");if(i.type="text/css",i.media="screen",e?.(i),n.appendChild(i),t&&t.add(be(()=>n.removeChild(i))),n===gt.document.head){let o=new Set;tN.set(i,o);for(let{window:s,disposables:r}of M7()){if(s===gt)continue;let a=r.add(Dq(i,o,s));t?.add(a)}}return i}function Dq(n,e,t){var i,o;let s=new ae,r=n.cloneNode(!0);t.document.head.appendChild(r),s.add(be(()=>t.document.head.removeChild(r)));for(let a of H7(n))(i=r.sheet)===null||i===void 0||i.insertRule(a.cssText,(o=r.sheet)===null||o===void 0?void 0:o.cssRules.length);return s.add(Eq.observe(n,s,{childList:!0})(()=>{r.textContent=n.textContent})),e.add(r),s.add(be(()=>e.delete(r))),s}function V7(){return GT||(GT=Xi()),GT}function H7(n){var e,t;return!((e=n?.sheet)===null||e===void 0)&&e.rules?n.sheet.rules:!((t=n?.sheet)===null||t===void 0)&&t.cssRules?n.sheet.cssRules:[]}function Gw(n,e,t=V7()){var i,o;if(!(!t||!e)){(i=t.sheet)===null||i===void 0||i.insertRule(`${n} {${e}}`,0);for(let s of(o=tN.get(t))!==null&&o!==void 0?o:[])Gw(n,e,s)}}function Iq(n,e=V7()){var t,i;if(!e)return;let o=H7(e),s=[];for(let r=0;r=0;r--)(t=e.sheet)===null||t===void 0||t.deleteRule(s[r]);for(let r of(i=tN.get(e))!==null&&i!==void 0?i:[])Iq(n,r)}function Tq(n){return typeof n.selectorText=="string"}function Hg(n){return n instanceof MouseEvent||n instanceof ge(n).MouseEvent}function Ia(n){return n instanceof KeyboardEvent||n instanceof ge(n).KeyboardEvent}function U7(n){let e=n;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}function K7(n){let e=[];for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)e[t]=n.scrollTop,n=n.parentNode;return e}function $7(n,e){for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)n.scrollTop!==e[t]&&(n.scrollTop=e[t]),n=n.parentNode}function Ic(n){return new XT(n)}function q7(n,e){return n.after(e),e}function me(n,...e){if(n.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function Ug(n,e){return n.insertBefore(e,n.firstChild),e}function Wi(n,...e){n.innerText="",me(n,...e)}function j7(n,e,t,...i){let o=Nq.exec(e);if(!o)throw new Error("Bad use of emmet");let s=o[1]||"div",r;return n!==g0.HTML?r=document.createElementNS(n,s):r=document.createElement(s),o[3]&&(r.id=o[3]),o[4]&&(r.className=o[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?r[a]=l:a==="selected"?l&&r.setAttribute(a,"true"):r.setAttribute(a,l))}),r.append(...i),r}function ve(n,e,...t){return j7(g0.HTML,n,e,...t)}function Ire(n,...e){n?b0(...e):Zw(...e)}function b0(...n){for(let e of n)e.style.display="",e.removeAttribute("aria-hidden")}function Zw(...n){for(let e of n)e.style.display="none",e.setAttribute("aria-hidden","true")}function iN(n,e){let t=n.devicePixelRatio*e;return Math.max(1,Math.floor(t))/n.devicePixelRatio}function Yw(n){gt.open(n,"_blank","noopener")}function G7(n,e){let t=()=>{e(),i=rn(n,t)},i=rn(n,t);return be(()=>i.dispose())}function Mr(n){return n?`url('${Ww.uriToBrowserUri(n).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function Xw(n){return`'${n.replace(/'/g,"%27")}'`}function tr(n,e){if(n!==void 0){let t=n.match(/^\s*var\((.+)\)$/);if(t){let i=t[1].split(",",2);return i.length===2&&(e=tr(i[1].trim(),e)),`var(${i[0]}, ${e})`}return n}return e}function Z7(n,e=!1){let t=document.createElement("a");return l0("afterSanitizeAttributes",i=>{for(let o of["href","src"])if(i.hasAttribute(o)){let s=i.getAttribute(o);if(o==="href"&&s.startsWith("#"))continue;if(t.href=s,!n.includes(t.protocol.replace(/:$/,""))){if(e&&o==="src"&&t.href.startsWith("data:"))continue;i.removeAttribute(o)}}}),be(()=>{Ow("afterSanitizeAttributes")})}function kt(n,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);let o=Aq.exec(n);if(!o||!o.groups)throw new Error("Bad use of h");let s=o.groups.tag||"div",r=document.createElement(s);o.groups.id&&(r.id=o.groups.id);let a=[];if(o.groups.class)for(let c of o.groups.class.split("."))c!==""&&a.push(c);if(t.className!==void 0)for(let c of t.className.split("."))c!==""&&a.push(c);a.length>0&&(r.className=a.join(" "));let l={};if(o.groups.name&&(l[o.groups.name]=r),i)for(let c of i)c instanceof HTMLElement?r.appendChild(c):typeof c=="string"?r.append(c):"root"in c&&(Object.assign(l,c),r.appendChild(c.root));for(let[c,d]of Object.entries(t))if(c!=="className")if(c==="style")for(let[h,u]of Object.entries(d))r.style.setProperty(A7(h),typeof u=="number"?u+"px":""+u);else c==="tabIndex"?r.tabIndex=d:r.setAttribute(A7(c),d.toString());return l.root=r,l}function A7(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var Sre,ge,xre,M7,Sq,Wg,QT,Lre,fu,R7,P7,ZT,Ut,kre,N7,JT,rn,Bd,f0,Qo,Ar,tN,YT,Eq,GT,se,He,XT,Nq,g0,Y7,Tre,uu,Hw,Aq,ke=J(()=>{"use strict";_();v();b();ps();Sw();oo();Qs();Gt();xt();ye();Fw();le();er();Lt();Bg();vo();({registerWindow:Sre,getWindow:ge,getDocument:xre,getWindows:M7,getWindowsCount:Sq,getWindowId:Wg,getWindowById:QT,hasWindow:Lre,onDidRegisterWindow:fu,onWillUnregisterWindow:R7,onDidUnregisterWindow:P7}=function(){let n=new Map;n7(gt,1);let e={window:gt,disposables:new ae};n.set(gt.vscodeWindowId,e);let t=new B,i=new B,o=new B;function s(r,a){let l=typeof r=="number"?n.get(r):void 0;return l??(a?e:void 0)}return{onDidRegisterWindow:t.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:i.event,registerWindow(r){if(n.has(r.vscodeWindowId))return H.None;let a=new ae,l={window:r,disposables:a.add(new ae)};return n.set(r.vscodeWindowId,l),a.add(be(()=>{n.delete(r.vscodeWindowId),i.fire(r)})),a.add($(r,se.BEFORE_UNLOAD,()=>{o.fire(r)})),t.fire(l),a},getWindows(){return n.values()},getWindowsCount(){return n.size},getWindowId(r){return r.vscodeWindowId},hasWindow(r){return n.has(r)},getWindowById:s,getWindow(r){var a;let l=r;if(!((a=l?.ownerDocument)===null||a===void 0)&&a.defaultView)return l.ownerDocument.defaultView.window;let c=r;return c?.view?c.view.window:gt},getDocument(r){return ge(r).document}}}());ZT=class{constructor(e,t,i,o){this._node=e,this._type=t,this._handler=i,this._options=o||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};Ut=function(e,t,i,o){let s=i;return t==="click"||t==="mousedown"?s=O7(ge(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(s=xq(i)),$(e,t,s,o)},kre=function(e,t,i){let o=O7(ge(e),t);return Lq(e,o,i)};N7=class extends n0{constructor(e,t){super(e,t)}},Bd=class extends Fd{constructor(e){super(),this.defaultTarget=e&&ge(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}},f0=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){ut(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let n=new Map,e=new Map,t=new Map,i=new Map,o=s=>{var r;t.set(s,!1);let a=(r=n.get(s))!==null&&r!==void 0?r:[];for(e.set(s,a),n.set(s,[]),i.set(s,!0);a.length>0;)a.sort(f0.sort),a.shift().execute();i.set(s,!1)};rn=(s,r,a=0)=>{let l=Wg(s),c=new f0(r,a),d=n.get(l);return d||(d=[],n.set(l,d)),d.push(c),t.get(l)||(t.set(l,!0),s.requestAnimationFrame(()=>o(l))),c},JT=(s,r,a)=>{let l=Wg(s);if(i.get(l)){let c=new f0(r,a),d=e.get(l);return d||(d=[],e.set(l,d)),d.push(c),c}else return rn(s,r,a)}})();Qo=class n{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){let o=eN(e),s=o?o.getPropertyValue(t):"0";return n.convertToPixels(e,s)}static getBorderLeftWidth(e){return n.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return n.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return n.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return n.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return n.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return n.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return n.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return n.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return n.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return n.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return n.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return n.getDimension(e,"margin-bottom","marginBottom")}},Ar=class n{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new n(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof n?e:new n(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};Ar.None=new Ar(0,0);tN=new Map;YT=class{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.innerText=e:this._styleSheet=Xi(gt.document.head,t=>t.innerText=e))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}};Eq=new class{constructor(){this.mutationObservers=new Map}observe(n,e,t){let i=this.mutationObservers.get(n);i||(i=new Map,this.mutationObservers.set(n,i));let o=zw(t),s=i.get(o);if(s)s.users+=1;else{let r=new B,a=new MutationObserver(c=>r.fire(c));a.observe(n,t);let l=s={users:1,observer:a,onDidMutate:r.event};e.add(be(()=>{l.users-=1,l.users===0&&(r.dispose(),a.disconnect(),i?.delete(o),i?.size===0&&this.mutationObservers.delete(n))})),i.set(o,s)}return s.onDidMutate}},GT=null;se={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:La?"webkitAnimationStart":"animationstart",ANIMATION_END:La?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:La?"webkitAnimationIteration":"animationiteration"};He={stop:(n,e)=>(n.preventDefault(),e&&n.stopPropagation(),n)};XT=class n extends H{static hasFocusWithin(e){if(e instanceof HTMLElement){let t=Ec(e),i=t?t.activeElement:e.ownerDocument.activeElement;return yi(i,e)}else{let t=e;return yi(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new B),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new B),this.onDidBlur=this._onDidBlur.event;let t=n.hasFocusWithin(e),i=!1,o=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},s=()=>{t&&(i=!0,(e instanceof HTMLElement?ge(e):e).setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{n.hasFocusWithin(e)!==t&&(t?s():o())},this._register($(e,se.FOCUS,o,!0)),this._register($(e,se.BLUR,s,!0)),e instanceof HTMLElement&&(this._register($(e,se.FOCUS_IN,()=>this._refreshStateHandler())),this._register($(e,se.FOCUS_OUT,()=>this._refreshStateHandler())))}};Nq=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;(function(n){n.HTML="http://www.w3.org/1999/xhtml",n.SVG="http://www.w3.org/2000/svg"})(g0||(g0={}));ve.SVG=function(n,e,...t){return j7(g0.SVG,n,e,...t)};qT.setPreferredWebSchema(/^https:/.test(gt.location.href)?"https":"http");Y7=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]),Tre=Object.freeze({ALLOWED_TAGS:["a","button","blockquote","code","div","h1","h2","h3","h4","h5","h6","hr","input","label","li","p","pre","select","small","span","strong","textarea","ul","ol"],ALLOWED_ATTR:["href","data-href","data-command","target","title","name","src","alt","class","id","role","tabindex","style","data-code","width","height","align","x-dispatch","required","checked","placeholder","type","start"],RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1,RETURN_TRUSTED_TYPE:!0}),uu=class n extends B{constructor(){super(),this._subscriptions=new ae,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(ie.runAndSubscribe(fu,({window:e,disposables:t})=>this.registerListeners(e,t),{window:gt,disposables:this._subscriptions}))}registerListeners(e,t){t.add($(e,"keydown",i=>{if(i.defaultPrevented)return;let o=new bt(i);if(!(o.keyCode===6&&i.repeat)){if(i.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(i.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(i.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(i.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(o.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=i.altKey,this._keyStatus.ctrlKey=i.ctrlKey,this._keyStatus.metaKey=i.metaKey,this._keyStatus.shiftKey=i.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=i,this.fire(this._keyStatus))}},!0)),t.add($(e,"keyup",i=>{i.defaultPrevented||(!i.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!i.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!i.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!i.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=i.altKey,this._keyStatus.ctrlKey=i.ctrlKey,this._keyStatus.metaKey=i.metaKey,this._keyStatus.shiftKey=i.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=i,this.fire(this._keyStatus)))},!0)),t.add($(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add($(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add($(e.document.body,"mousemove",i=>{i.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add($(e,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return n.instance||(n.instance=new n),n.instance}dispose(){super.dispose(),this._subscriptions.dispose()}},Hw=class extends H{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register($(this.element,se.DRAG_START,e=>{var t,i;(i=(t=this.callbacks).onDragStart)===null||i===void 0||i.call(t,e)})),this.callbacks.onDrag&&this._register($(this.element,se.DRAG,e=>{var t,i;(i=(t=this.callbacks).onDrag)===null||i===void 0||i.call(t,e)})),this._register($(this.element,se.DRAG_ENTER,e=>{var t,i;this.counter++,this.dragStartTime=e.timeStamp,(i=(t=this.callbacks).onDragEnter)===null||i===void 0||i.call(t,e)})),this._register($(this.element,se.DRAG_OVER,e=>{var t,i;e.preventDefault(),(i=(t=this.callbacks).onDragOver)===null||i===void 0||i.call(t,e,e.timeStamp-this.dragStartTime)})),this._register($(this.element,se.DRAG_LEAVE,e=>{var t,i;this.counter--,this.counter===0&&(this.dragStartTime=0,(i=(t=this.callbacks).onDragLeave)===null||i===void 0||i.call(t,e))})),this._register($(this.element,se.DRAG_END,e=>{var t,i;this.counter=0,this.dragStartTime=0,(i=(t=this.callbacks).onDragEnd)===null||i===void 0||i.call(t,e)})),this._register($(this.element,se.DROP,e=>{var t,i;this.counter=0,this.dragStartTime=0,(i=(t=this.callbacks).onDrop)===null||i===void 0||i.call(t,e)}))}},Aq=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/});function Pq(n,e,t){e[Pr.DI_TARGET]===e?e[Pr.DI_DEPENDENCIES].push({id:n,index:t}):(e[Pr.DI_DEPENDENCIES]=[{id:n,index:t}],e[Pr.DI_TARGET]=e)}function De(n){if(Pr.serviceIds.has(n))return Pr.serviceIds.get(n);let e=function(t,i,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Pq(e,t,o)};return e.toString=()=>n,Pr.serviceIds.set(n,e),e}var Pr,Ye,qe=J(()=>{"use strict";_();v();b();(function(n){n.serviceIds=new Map,n.DI_TARGET="$di$target",n.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[n.DI_DEPENDENCIES]||[]}n.getServiceDependencies=e})(Pr||(Pr={}));Ye=De("instantiationService")});var Zt,Or=J(()=>{"use strict";_();v();b();qe();Zt=De("codeEditorService")});var xn,_u=J(()=>{"use strict";_();v();b();qe();xn=De("modelService")});var Wd,Jw=J(()=>{"use strict";_();v();b();qe();Wd=De("textModelService")});function zd(n){var e;return{id:n.id,label:n.label,class:n.class,enabled:(e=n.enabled)!==null&&e!==void 0?e:!0,checked:n.checked,run:async(...t)=>n.run(...t),tooltip:n.label}}var Ro,bs,zi,bl,w0,Po=J(()=>{"use strict";_();v();b();ye();le();Ge();Ro=class extends H{constructor(e,t="",i="",o=!0,s){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=o,this._actionCallback=s}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,t){this._actionCallback&&await this._actionCallback(e)}},bs=class extends H{constructor(){super(...arguments),this._onWillRun=this._register(new B),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new B),this.onDidRun=this._onDidRun.event}async run(e,t){if(!e.enabled)return;this._onWillRun.fire({action:e});let i;try{await this.runAction(e,t)}catch(o){i=o}this._onDidRun.fire({action:e,error:i})}async runAction(e,t){await e.run(t)}},zi=class n{constructor(){this.id=n.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(let i of e)i.length&&(t.length?t=[...t,new n,...i]:t=i);return t}async run(){}};zi.ID="vs.actions.separator";bl=class{get actions(){return this._actions}constructor(e,t,i,o){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=o,this._actions=i}async run(){}},w0=class n extends Ro{constructor(){super(n.ID,p("submenu.empty","(empty)"),void 0,!1)}};w0.ID="vs.actions.empty"});var dN,Xe,Ln=J(()=>{"use strict";_();v();b();$n();(function(n){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}n.isThemeColor=e})(dN||(dN={}));(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9-]+",n.iconModifierExpression="~[A-Za-z]+",n.iconNameCharacter="[A-Za-z0-9~-]";let e=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function t(u){let f=e.exec(u.id);if(!f)return t(ue.error);let[,g,m]=f,C=["codicon","codicon-"+g];return m&&C.push("codicon-modifier-"+m.substring(1)),C}n.asClassNameArray=t;function i(u){return t(u).join(" ")}n.asClassName=i;function o(u){return"."+t(u).join(".")}n.asCSSSelector=o;function s(u){return u&&typeof u=="object"&&typeof u.id=="string"&&(typeof u.color>"u"||dN.isThemeColor(u.color))}n.isThemeIcon=s;let r=new RegExp(`^\\$\\((${n.iconNameExpression}(?:${n.iconModifierExpression})?)\\)$`);function a(u){let f=r.exec(u);if(!f)return;let[,g]=f;return{id:g}}n.fromString=a;function l(u){return{id:u}}n.fromId=l;function c(u,f){let g=u.id,m=g.lastIndexOf("~");return m!==-1&&(g=g.substring(0,m)),f&&(g=`${g}~${f}`),{id:g}}n.modify=c;function d(u){let f=u.id.lastIndexOf("~");if(f!==-1)return u.id.substring(f+1)}n.getModifier=d;function h(u,f){var g,m;return u.id===f.id&&((g=u.color)===null||g===void 0?void 0:g.id)===((m=f.color)===null||m===void 0?void 0:m.id)}n.isEqual=h})(Xe||(Xe={}))});var kn,Pi,ir=J(()=>{"use strict";_();v();b();ye();js();le();kr();xi();qe();kn=De("commandService"),Pi=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new B,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,e){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:n,handler:e})}if(n.metadata&&Array.isArray(n.metadata.args)){let r=[];for(let l of n.metadata.args)r.push(l.constraint);let a=n.handler;n.handler=function(l,...c){return o9(c,r),a(l,...c)}}let{id:t}=n,i=this._commands.get(t);i||(i=new Ii,this._commands.set(t,i));let o=i.unshift(n),s=be(()=>{o();let r=this._commands.get(t);r?.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),s}registerCommandAlias(n,e){return Pi.registerCommand(n,(t,...i)=>t.get(kn).executeCommand(e,...i))}getCommand(n){let e=this._commands.get(n);if(!(!e||e.isEmpty()))return ht.first(e)}getCommands(){let n=new Map;for(let e of this._commands.keys()){let t=this.getCommand(e);t&&n.set(e,t)}return n}};Pi.registerCommand("noop",()=>{})});function hN(...n){switch(n.length){case 1:return p("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",n[0]);case 2:return p("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",n[0],n[1]);case 3:return p("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",n[0],n[1],n[2]);default:return}}var Oq,Fq,vl,Q7=J(()=>{"use strict";_();v();b();xt();Ge();Oq=p("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),Fq=p("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'."),vl=class n{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw _g(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){let t=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:t})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){let t=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:t})}else this._match(126)?this._addToken(9):this._error(hN("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(hN("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(hN("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){let t=this._start,i=this._input.substring(this._start,this._current),o={type:19,offset:this._start,lexeme:i};this._errors.push({offset:t,lexeme:i,additionalInfo:e}),this._tokens.push(o)}_string(){this.stringRe.lastIndex=this._start;let e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;let t=this._input.substring(this._start,this._current),i=n._keywords.get(t);i?this._addToken(i):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(Oq);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,t=!1,i=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(Fq);return}let s=this._input.charCodeAt(e);if(t)t=!1;else if(s===47&&!i){e++;break}else s===91?i=!0:s===92?t=!0:s===93&&(i=!1);e++}for(;e=this._input.length}};vl._regexFlags=new Set(["i","g","s","m","y","u"].map(n=>n.charCodeAt(0)));vl._keywords=new Map([["not",14],["in",13],["false",12],["true",11]])});function i3(n,e){let t=n?n.substituteConstants():void 0,i=e?e.substituteConstants():void 0;return!t&&!i?!0:!t||!i?!1:t.equals(i)}function y0(n,e){return n.cmp(e)}function dy(n,e){if(typeof n=="string"){let t=parseFloat(n);isNaN(t)||(n=t)}return typeof n=="string"||typeof n=="number"?e(n):ro.INSTANCE}function n3(n){let e=null;for(let t=0,i=n.length;te?1:0}function Cu(n,e,t,i){return nt?1:ei?1:0}function cy(n,e){if(n.type===0||e.type===1)return!0;if(n.type===9)return e.type===9?e3(n.expr,e.expr):!1;if(e.type===9){for(let t of e.expr)if(cy(n,t))return!0;return!1}if(n.type===6){if(e.type===6)return e3(e.expr,n.expr);for(let t of n.expr)if(cy(t,e))return!0;return!1}return n.equals(e)}function e3(n,e){let t=0,i=0;for(;t{"use strict";_();v();b();Lt();ot();Q7();qe();Ge();so=new Map;so.set("false",!1);so.set("true",!0);so.set("isMac",Be);so.set("isLinux",mi);so.set("isWindows",Li);so.set("isWeb",hl);so.set("isMacNative",Be&&!hl);so.set("isEdge",v9);so.set("isFirefox",_9);so.set("isChrome",xI);so.set("isSafari",b9);Bq=Object.prototype.hasOwnProperty,Wq={regexParsingWithErrorRecovery:!0},zq=p("contextkey.parser.error.emptyString","Empty context key expression"),Vq=p("contextkey.parser.error.emptyString.hint","Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),Hq=p("contextkey.parser.error.noInAfterNot","'in' after 'not'."),J7=p("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),Uq=p("contextkey.parser.error.unexpectedToken","Unexpected token"),Kq=p("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),$q=p("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),qq=p("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?"),ey=class n{constructor(e=Wq){this._config=e,this._scanner=new vl,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:zq,offset:0,lexeme:"",additionalInfo:Vq});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{let t=this._expr();if(!this._isAtEnd()){let i=this._peek(),o=i.type===17?Kq:void 0;throw this._parsingErrors.push({message:Uq,offset:i.offset,lexeme:vl.getLexeme(i),additionalInfo:o}),n._parseError}return t}catch(t){if(t!==n._parseError)throw t;return}}_expr(){return this._or()}_or(){let e=[this._and()];for(;this._matchOne(16);){let t=this._and();e.push(t)}return e.length===1?e[0]:Dt.or(...e)}_and(){let e=[this._term()];for(;this._matchOne(15);){let t=this._term();e.push(t)}return e.length===1?e[0]:Dt.and(...e)}_term(){if(this._matchOne(2)){let e=this._peek();switch(e.type){case 11:return this._advance(),ro.INSTANCE;case 12:return this._advance(),wo.INSTANCE;case 0:{this._advance();let t=this._expr();return this._consume(1,J7),t?.negate()}case 17:return this._advance(),vu.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){let e=this._peek();switch(e.type){case 11:return this._advance(),Dt.true();case 12:return this._advance(),Dt.false();case 0:{this._advance();let t=this._expr();return this._consume(1,J7),t}case 17:{let t=e.lexeme;if(this._advance(),this._matchOne(9)){let o=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),o.type!==10)throw this._errExpectedButGot("REGEX",o);let s=o.lexeme,r=s.lastIndexOf("/"),a=r===s.length-1?void 0:this._removeFlagsGY(s.substring(r+1)),l;try{l=new RegExp(s.substring(1,r),a)}catch{throw this._errExpectedButGot("REGEX",o)}return x0.create(t,l)}switch(o.type){case 10:case 19:{let s=[o.lexeme];this._advance();let r=this._peek(),a=0;for(let u=0;u=0){let c=s.slice(a+1,l),d=s[l+1]==="i"?"i":"";try{r=new RegExp(c,d)}catch{throw this._errExpectedButGot("REGEX",o)}}}if(r===null)throw this._errExpectedButGot("REGEX",o);return x0.create(t,r)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,Hq);let o=this._value();return Dt.notIn(t,o)}switch(this._peek().type){case 3:{this._advance();let o=this._value();if(this._previous().type===18)return Dt.equals(t,o);switch(o){case"true":return Dt.has(t);case"false":return Dt.not(t);default:return Dt.equals(t,o)}}case 4:{this._advance();let o=this._value();if(this._previous().type===18)return Dt.notEquals(t,o);switch(o){case"true":return Dt.not(t);case"false":return Dt.has(t);default:return Dt.notEquals(t,o)}}case 5:return this._advance(),ry.create(t,this._value());case 6:return this._advance(),ay.create(t,this._value());case 7:return this._advance(),oy.create(t,this._value());case 8:return this._advance(),sy.create(t,this._value());case 13:return this._advance(),Dt.in(t,this._value());default:return Dt.has(t)}}case 20:throw this._parsingErrors.push({message:$q,offset:e.offset,lexeme:"",additionalInfo:qq}),n._parseError;default:throw this._errExpectedButGot(`true | false | KEY + | KEY '=~' REGEX + | KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){let e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,i){let o=p("contextkey.parser.error.expectedButGot",`Expected: {0} +Received: '{1}'.`,e,vl.getLexeme(t)),s=t.offset,r=vl.getLexeme(t);return this._parsingErrors.push({message:o,offset:s,lexeme:r,additionalInfo:i}),n._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};ey._parseError=new Error;Dt=class{static false(){return ro.INSTANCE}static true(){return wo.INSTANCE}static has(e){return bu.create(e)}static equals(e,t){return S0.create(e,t)}static notEquals(e,t){return ny.create(e,t)}static regex(e,t){return x0.create(e,t)}static in(e,t){return ty.create(e,t)}static notIn(e,t){return iy.create(e,t)}static not(e){return vu.create(e)}static and(...e){return ly.create(e,null,!0)}static or(...e){return L0.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}};Dt._parser=new ey({regexParsingWithErrorRecovery:!1});ro=class{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return wo.INSTANCE}};ro.INSTANCE=new ro;wo=class{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return ro.INSTANCE}};wo.INSTANCE=new wo;bu=class n{static create(e,t=null){let i=so.get(e);return typeof i=="boolean"?i?wo.INSTANCE:ro.INSTANCE:new n(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:o3(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){let e=so.get(this.key);return typeof e=="boolean"?e?wo.INSTANCE:ro.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=vu.create(this.key,this)),this.negated}},S0=class n{static create(e,t,i=null){if(typeof t=="boolean")return t?bu.create(e,i):vu.create(e,i);let o=so.get(e);return typeof o=="boolean"?t===(o?"true":"false")?wo.INSTANCE:ro.INSTANCE:new n(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:Cu(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){let e=so.get(this.key);if(typeof e=="boolean"){let t=e?"true":"false";return this.value===t?wo.INSTANCE:ro.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ny.create(this.key,this.value,this)),this.negated}},ty=class n{static create(e,t){return new n(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:Cu(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){let t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):typeof i=="string"&&typeof t=="object"&&t!==null?Bq.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=iy.create(this.key,this.valueKey)),this.negated}},iy=class n{static create(e,t){return new n(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=ty.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}},ny=class n{static create(e,t,i=null){if(typeof t=="boolean")return t?vu.create(e,i):bu.create(e,i);let o=so.get(e);return typeof o=="boolean"?t===(o?"true":"false")?ro.INSTANCE:wo.INSTANCE:new n(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:Cu(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){let e=so.get(this.key);if(typeof e=="boolean"){let t=e?"true":"false";return this.value===t?ro.INSTANCE:wo.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=S0.create(this.key,this.value,this)),this.negated}},vu=class n{static create(e,t=null){let i=so.get(e);return typeof i=="boolean"?i?ro.INSTANCE:wo.INSTANCE:new n(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:o3(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){let e=so.get(this.key);return typeof e=="boolean"?e?ro.INSTANCE:wo.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=bu.create(this.key,this)),this.negated}};oy=class n{static create(e,t,i=null){return dy(t,o=>new n(e,o,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:Cu(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ay.create(this.key,this.value,this)),this.negated}},sy=class n{static create(e,t,i=null){return dy(t,o=>new n(e,o,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:Cu(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ry.create(this.key,this.value,this)),this.negated}},ry=class n{static create(e,t,i=null){return dy(t,o=>new n(e,o,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:Cu(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))new n(e,o,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:Cu(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=oy.create(this.key,this.value,this)),this.negated}},x0=class n{static create(e,t){return new n(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.keye.key)return 1;let t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return ti?1:0}equals(e){if(e.type===this.type){let t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){let t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){let e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=uN.create(this)),this.negated}},uN=class n{static create(e){return new n(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}};ly=class n{static create(e,t,i){return n._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=6}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,i=this.expr.length;t1;){let r=o[o.length-1];if(r.type!==9)break;o.pop();let a=o.pop(),l=o.length===0,c=L0.create(r.expr.map(d=>n.create([d,a],null,i)),null,l);c&&(o.push(c),o.sort(y0))}if(o.length===1)return o[0];if(i){for(let r=0;re.serialize()).join(" && ")}keys(){let e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){let e=[];for(let t of this.expr)e.push(t.negate());this.negated=L0.create(e,this,!0)}return this.negated}},L0=class n{static create(e,t,i){return n._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,i=this.expr.length;te.serialize()).join(" || ")}keys(){let e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){let e=[];for(let t of this.expr)e.push(t.negate());for(;e.length>1;){let t=e.shift(),i=e.shift(),o=[];for(let s of t3(t))for(let r of t3(i))o.push(ly.create([s,r],null,!1));e.unshift(n.create(o,null,!1))}this.negated=n.create(e,this,!0)}return this.negated}},xe=class n extends bu{static all(){return n._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,typeof i=="object"?n._info.push({...i,key:e}):i!==!0&&n._info.push({key:e,description:i,type:t!=null?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return S0.create(this.key,e)}};xe._info=[];rt=De("contextKeyService")});function hy(n,e){if(!n)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function $g(n,e="Unreachable"){throw new Error(e)}function fN(n){n||ut(new St("Soft Assertion Failed"))}function Fr(n){if(!n()){debugger;n(),ut(new St("Assertion Failed"))}}function qg(n,e){let t=0;for(;t{"use strict";_();v();b();xt()});var gN,Vt,Oo=J(()=>{"use strict";_();v();b();Na();xi();gN=class{constructor(){this.data=new Map}add(e,t){hy(tn(e)),hy(dn(t)),hy(!this.data.has(e),"There is already an extension with this id"),this.data.set(e,t)}as(e){return this.data.get(e)||null}},Vt=new gN});function Zq(n,e){if(n.weight1!==e.weight1)return n.weight1-e.weight1;if(n.command&&e.command){if(n.commande.command)return 1}return n.weight2-e.weight2}var mN,Cl,Gq,k0=J(()=>{"use strict";_();v();b();Mg();Lt();ir();Oo();le();kr();mN=class n{constructor(){this._coreKeybindings=new Ii,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(po===1){if(e&&e.win)return e.win}else if(po===2){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){let t=n.bindToCurrentPlatform(e),i=new ae;if(t&&t.primary){let o=i0(t.primary,po);o&&i.add(this._registerDefaultKeybinding(o,e.id,e.args,e.weight,0,e.when))}if(t&&Array.isArray(t.secondary))for(let o=0,s=t.secondary.length;o{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(Zq)),this._cachedMergedKeybindings.slice(0)}},Cl=new mN,Gq={EditorModes:"platform.keybindingsRegistry"};Vt.add(Gq.EditorModes,Cl)});function jg(n){return n.command!==void 0}function r3(n){return n.submenu!==void 0}function ece(n){let e=new ae,t=new n,{f1:i,menu:o,keybinding:s,...r}=t.desc;if(Pi.getCommand(r.id))throw new Error(`Cannot register two commands with the same id: ${r.id}`);if(e.add(Pi.registerCommand({id:r.id,handler:(a,...l)=>t.run(a,...l),metadata:r.metadata})),Array.isArray(o))for(let a of o)e.add(Fs.appendMenuItem(a.id,{command:{...r,precondition:a.precondition===null?void 0:r.precondition},...a}));else o&&e.add(Fs.appendMenuItem(o.id,{command:{...r,precondition:o.precondition===null?void 0:r.precondition},...o}));if(i&&(e.add(Fs.appendMenuItem(A.CommandPalette,{command:r,when:r.precondition})),e.add(Fs.addCommand(r))),Array.isArray(s))for(let a of s)e.add(Cl.registerKeybindingRule({...a,id:r.id,when:r.precondition?Dt.and(r.precondition,a.when):a.when}));else s&&e.add(Cl.registerKeybindingRule({...s,id:r.id,when:r.precondition?Dt.and(r.precondition,s.when):s.when}));return e}var Yq,s3,fy,A,Wr,Vd,Fs,wl,Br,gy,zr=J(()=>{"use strict";_();v();b();Po();Ln();ye();le();kr();ir();Oi();qe();k0();Yq=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},s3=function(n,e){return function(t,i){e(t,i,n)}};A=class n{constructor(e){if(n._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);n._instances.set(e,this),this.id=e}};A._instances=new Map;A.CommandPalette=new A("CommandPalette");A.DebugBreakpointsContext=new A("DebugBreakpointsContext");A.DebugCallStackContext=new A("DebugCallStackContext");A.DebugConsoleContext=new A("DebugConsoleContext");A.DebugVariablesContext=new A("DebugVariablesContext");A.NotebookVariablesContext=new A("NotebookVariablesContext");A.DebugHoverContext=new A("DebugHoverContext");A.DebugWatchContext=new A("DebugWatchContext");A.DebugToolBar=new A("DebugToolBar");A.DebugToolBarStop=new A("DebugToolBarStop");A.EditorContext=new A("EditorContext");A.SimpleEditorContext=new A("SimpleEditorContext");A.EditorContent=new A("EditorContent");A.EditorLineNumberContext=new A("EditorLineNumberContext");A.EditorContextCopy=new A("EditorContextCopy");A.EditorContextPeek=new A("EditorContextPeek");A.EditorContextShare=new A("EditorContextShare");A.EditorTitle=new A("EditorTitle");A.EditorTitleRun=new A("EditorTitleRun");A.EditorTitleContext=new A("EditorTitleContext");A.EditorTitleContextShare=new A("EditorTitleContextShare");A.EmptyEditorGroup=new A("EmptyEditorGroup");A.EmptyEditorGroupContext=new A("EmptyEditorGroupContext");A.EditorTabsBarContext=new A("EditorTabsBarContext");A.EditorTabsBarShowTabsSubmenu=new A("EditorTabsBarShowTabsSubmenu");A.EditorTabsBarShowTabsZenModeSubmenu=new A("EditorTabsBarShowTabsZenModeSubmenu");A.EditorActionsPositionSubmenu=new A("EditorActionsPositionSubmenu");A.ExplorerContext=new A("ExplorerContext");A.ExplorerContextShare=new A("ExplorerContextShare");A.ExtensionContext=new A("ExtensionContext");A.GlobalActivity=new A("GlobalActivity");A.CommandCenter=new A("CommandCenter");A.CommandCenterCenter=new A("CommandCenterCenter");A.LayoutControlMenuSubmenu=new A("LayoutControlMenuSubmenu");A.LayoutControlMenu=new A("LayoutControlMenu");A.MenubarMainMenu=new A("MenubarMainMenu");A.MenubarAppearanceMenu=new A("MenubarAppearanceMenu");A.MenubarDebugMenu=new A("MenubarDebugMenu");A.MenubarEditMenu=new A("MenubarEditMenu");A.MenubarCopy=new A("MenubarCopy");A.MenubarFileMenu=new A("MenubarFileMenu");A.MenubarGoMenu=new A("MenubarGoMenu");A.MenubarHelpMenu=new A("MenubarHelpMenu");A.MenubarLayoutMenu=new A("MenubarLayoutMenu");A.MenubarNewBreakpointMenu=new A("MenubarNewBreakpointMenu");A.PanelAlignmentMenu=new A("PanelAlignmentMenu");A.PanelPositionMenu=new A("PanelPositionMenu");A.ActivityBarPositionMenu=new A("ActivityBarPositionMenu");A.MenubarPreferencesMenu=new A("MenubarPreferencesMenu");A.MenubarRecentMenu=new A("MenubarRecentMenu");A.MenubarSelectionMenu=new A("MenubarSelectionMenu");A.MenubarShare=new A("MenubarShare");A.MenubarSwitchEditorMenu=new A("MenubarSwitchEditorMenu");A.MenubarSwitchGroupMenu=new A("MenubarSwitchGroupMenu");A.MenubarTerminalMenu=new A("MenubarTerminalMenu");A.MenubarViewMenu=new A("MenubarViewMenu");A.MenubarHomeMenu=new A("MenubarHomeMenu");A.OpenEditorsContext=new A("OpenEditorsContext");A.OpenEditorsContextShare=new A("OpenEditorsContextShare");A.ProblemsPanelContext=new A("ProblemsPanelContext");A.SCMInputBox=new A("SCMInputBox");A.SCMChangesSeparator=new A("SCMChangesSeparator");A.SCMIncomingChanges=new A("SCMIncomingChanges");A.SCMIncomingChangesContext=new A("SCMIncomingChangesContext");A.SCMIncomingChangesSetting=new A("SCMIncomingChangesSetting");A.SCMOutgoingChanges=new A("SCMOutgoingChanges");A.SCMOutgoingChangesContext=new A("SCMOutgoingChangesContext");A.SCMOutgoingChangesSetting=new A("SCMOutgoingChangesSetting");A.SCMIncomingChangesAllChangesContext=new A("SCMIncomingChangesAllChangesContext");A.SCMIncomingChangesHistoryItemContext=new A("SCMIncomingChangesHistoryItemContext");A.SCMOutgoingChangesAllChangesContext=new A("SCMOutgoingChangesAllChangesContext");A.SCMOutgoingChangesHistoryItemContext=new A("SCMOutgoingChangesHistoryItemContext");A.SCMChangeContext=new A("SCMChangeContext");A.SCMResourceContext=new A("SCMResourceContext");A.SCMResourceContextShare=new A("SCMResourceContextShare");A.SCMResourceFolderContext=new A("SCMResourceFolderContext");A.SCMResourceGroupContext=new A("SCMResourceGroupContext");A.SCMSourceControl=new A("SCMSourceControl");A.SCMSourceControlInline=new A("SCMSourceControlInline");A.SCMSourceControlTitle=new A("SCMSourceControlTitle");A.SCMTitle=new A("SCMTitle");A.SearchContext=new A("SearchContext");A.SearchActionMenu=new A("SearchActionContext");A.StatusBarWindowIndicatorMenu=new A("StatusBarWindowIndicatorMenu");A.StatusBarRemoteIndicatorMenu=new A("StatusBarRemoteIndicatorMenu");A.StickyScrollContext=new A("StickyScrollContext");A.TestItem=new A("TestItem");A.TestItemGutter=new A("TestItemGutter");A.TestMessageContext=new A("TestMessageContext");A.TestMessageContent=new A("TestMessageContent");A.TestPeekElement=new A("TestPeekElement");A.TestPeekTitle=new A("TestPeekTitle");A.TouchBarContext=new A("TouchBarContext");A.TitleBarContext=new A("TitleBarContext");A.TitleBarTitleContext=new A("TitleBarTitleContext");A.TunnelContext=new A("TunnelContext");A.TunnelPrivacy=new A("TunnelPrivacy");A.TunnelProtocol=new A("TunnelProtocol");A.TunnelPortInline=new A("TunnelInline");A.TunnelTitle=new A("TunnelTitle");A.TunnelLocalAddressInline=new A("TunnelLocalAddressInline");A.TunnelOriginInline=new A("TunnelOriginInline");A.ViewItemContext=new A("ViewItemContext");A.ViewContainerTitle=new A("ViewContainerTitle");A.ViewContainerTitleContext=new A("ViewContainerTitleContext");A.ViewTitle=new A("ViewTitle");A.ViewTitleContext=new A("ViewTitleContext");A.CommentEditorActions=new A("CommentEditorActions");A.CommentThreadTitle=new A("CommentThreadTitle");A.CommentThreadActions=new A("CommentThreadActions");A.CommentThreadAdditionalActions=new A("CommentThreadAdditionalActions");A.CommentThreadTitleContext=new A("CommentThreadTitleContext");A.CommentThreadCommentContext=new A("CommentThreadCommentContext");A.CommentTitle=new A("CommentTitle");A.CommentActions=new A("CommentActions");A.CommentsViewThreadActions=new A("CommentsViewThreadActions");A.InteractiveToolbar=new A("InteractiveToolbar");A.InteractiveCellTitle=new A("InteractiveCellTitle");A.InteractiveCellDelete=new A("InteractiveCellDelete");A.InteractiveCellExecute=new A("InteractiveCellExecute");A.InteractiveInputExecute=new A("InteractiveInputExecute");A.IssueReporter=new A("IssueReporter");A.NotebookToolbar=new A("NotebookToolbar");A.NotebookStickyScrollContext=new A("NotebookStickyScrollContext");A.NotebookCellTitle=new A("NotebookCellTitle");A.NotebookCellDelete=new A("NotebookCellDelete");A.NotebookCellInsert=new A("NotebookCellInsert");A.NotebookCellBetween=new A("NotebookCellBetween");A.NotebookCellListTop=new A("NotebookCellTop");A.NotebookCellExecute=new A("NotebookCellExecute");A.NotebookCellExecuteGoTo=new A("NotebookCellExecuteGoTo");A.NotebookCellExecutePrimary=new A("NotebookCellExecutePrimary");A.NotebookDiffCellInputTitle=new A("NotebookDiffCellInputTitle");A.NotebookDiffCellMetadataTitle=new A("NotebookDiffCellMetadataTitle");A.NotebookDiffCellOutputsTitle=new A("NotebookDiffCellOutputsTitle");A.NotebookOutputToolbar=new A("NotebookOutputToolbar");A.NotebookOutlineFilter=new A("NotebookOutlineFilter");A.NotebookOutlineActionMenu=new A("NotebookOutlineActionMenu");A.NotebookEditorLayoutConfigure=new A("NotebookEditorLayoutConfigure");A.NotebookKernelSource=new A("NotebookKernelSource");A.BulkEditTitle=new A("BulkEditTitle");A.BulkEditContext=new A("BulkEditContext");A.TimelineItemContext=new A("TimelineItemContext");A.TimelineTitle=new A("TimelineTitle");A.TimelineTitleContext=new A("TimelineTitleContext");A.TimelineFilterSubMenu=new A("TimelineFilterSubMenu");A.AccountsContext=new A("AccountsContext");A.SidebarTitle=new A("SidebarTitle");A.PanelTitle=new A("PanelTitle");A.AuxiliaryBarTitle=new A("AuxiliaryBarTitle");A.AuxiliaryBarHeader=new A("AuxiliaryBarHeader");A.TerminalInstanceContext=new A("TerminalInstanceContext");A.TerminalEditorInstanceContext=new A("TerminalEditorInstanceContext");A.TerminalNewDropdownContext=new A("TerminalNewDropdownContext");A.TerminalTabContext=new A("TerminalTabContext");A.TerminalTabEmptyAreaContext=new A("TerminalTabEmptyAreaContext");A.TerminalStickyScrollContext=new A("TerminalStickyScrollContext");A.WebviewContext=new A("WebviewContext");A.InlineCompletionsActions=new A("InlineCompletionsActions");A.InlineEditActions=new A("InlineEditActions");A.NewFile=new A("NewFile");A.MergeInput1Toolbar=new A("MergeToolbar1Toolbar");A.MergeInput2Toolbar=new A("MergeToolbar2Toolbar");A.MergeBaseToolbar=new A("MergeBaseToolbar");A.MergeInputResultToolbar=new A("MergeToolbarResultToolbar");A.InlineSuggestionToolbar=new A("InlineSuggestionToolbar");A.InlineEditToolbar=new A("InlineEditToolbar");A.ChatContext=new A("ChatContext");A.ChatCodeBlock=new A("ChatCodeblock");A.ChatCompareBlock=new A("ChatCompareBlock");A.ChatMessageTitle=new A("ChatMessageTitle");A.ChatExecute=new A("ChatExecute");A.ChatExecuteSecondary=new A("ChatExecuteSecondary");A.ChatInputSide=new A("ChatInputSide");A.AccessibleView=new A("AccessibleView");A.MultiDiffEditorFileToolbar=new A("MultiDiffEditorFileToolbar");A.DiffEditorHunkToolbar=new A("DiffEditorHunkToolbar");A.DiffEditorSelectionToolbar=new A("DiffEditorSelectionToolbar");Wr=De("menuService"),Vd=class n{static for(e){let t=this._all.get(e);return t||(t=new n(e),this._all.set(e,t)),t}static merge(e){let t=new Set;for(let i of e)i instanceof n&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}};Vd._all=new Map;Fs=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new cC({merge:Vd.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(n){return this._commands.set(n.id,n),this._onDidChangeMenu.fire(Vd.for(A.CommandPalette)),be(()=>{this._commands.delete(n.id)&&this._onDidChangeMenu.fire(Vd.for(A.CommandPalette))})}getCommand(n){return this._commands.get(n)}getCommands(){let n=new Map;return this._commands.forEach((e,t)=>n.set(t,e)),n}appendMenuItem(n,e){let t=this._menuItems.get(n);t||(t=new Ii,this._menuItems.set(n,t));let i=t.push(e);return this._onDidChangeMenu.fire(Vd.for(n)),be(()=>{i(),this._onDidChangeMenu.fire(Vd.for(n))})}appendMenuItems(n){let e=new ae;for(let{id:t,item:i}of n)e.add(this.appendMenuItem(t,i));return e}getMenuItems(n){let e;return this._menuItems.has(n)?e=[...this._menuItems.get(n)]:e=[],n===A.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(n){let e=new Set;for(let t of n)jg(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||n.push({command:t})})}},wl=class extends bl{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}},Br=fy=class{static label(e,t){return t?.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}constructor(e,t,i,o,s,r,a){var l,c;this.hideActions=o,this.menuKeybinding=s,this._commandService=a,this.id=e.id,this.label=fy.label(e,i),this.tooltip=(c=typeof e.tooltip=="string"?e.tooltip:(l=e.tooltip)===null||l===void 0?void 0:l.value)!==null&&c!==void 0?c:"",this.enabled=!e.precondition||r.contextMatchesRules(e.precondition),this.checked=void 0;let d;if(e.toggled){let h=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=r.contextMatchesRules(h.condition),this.checked&&h.tooltip&&(this.tooltip=typeof h.tooltip=="string"?h.tooltip:h.tooltip.value),this.checked&&Xe.isThemeIcon(h.icon)&&(d=h.icon),this.checked&&h.title&&(this.label=typeof h.title=="string"?h.title:h.title.value)}d||(d=Xe.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new fy(t,void 0,i,o,void 0,r,a):void 0,this._options=i,this.class=d&&Xe.asClassName(d)}run(...e){var t,i;let o=[];return!((t=this._options)===null||t===void 0)&&t.arg&&(o=[...o,this._options.arg]),!((i=this._options)===null||i===void 0)&&i.shouldForwardArgs&&(o=[...o,...e]),this._commandService.executeCommand(this.id,...o)}};Br=fy=Yq([s3(5,rt),s3(6,kn)],Br);gy=class{constructor(e){this.desc=e}}});var nr,Gg=J(()=>{"use strict";_();v();b();qe();nr=De("telemetryService")});function Xq(n){switch(n){case Dn.Trace:return"trace";case Dn.Debug:return"debug";case Dn.Info:return"info";case Dn.Warning:return"warn";case Dn.Error:return"error";case Dn.Off:return"off"}}var En,Dn,a3,my,py,_y,mce,Aa=J(()=>{"use strict";_();v();b();ye();le();Oi();qe();En=De("logService");(function(n){n[n.Off=0]="Off",n[n.Trace=1]="Trace",n[n.Debug=2]="Debug",n[n.Info=3]="Info",n[n.Warning=4]="Warning",n[n.Error=5]="Error"})(Dn||(Dn={}));a3=Dn.Info,my=class extends H{constructor(){super(...arguments),this.level=a3,this._onDidChangeLogLevel=this._register(new B),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==Dn.Off&&this.level<=e}},py=class extends my{constructor(e=a3,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(Dn.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(Dn.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(Dn.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(Dn.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(Dn.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}},_y=class extends my{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(let t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(let i of this.loggers)i.trace(e,...t)}debug(e,...t){for(let i of this.loggers)i.debug(e,...t)}info(e,...t){for(let i of this.loggers)i.info(e,...t)}warn(e,...t){for(let i of this.loggers)i.warn(e,...t)}error(e,...t){for(let i of this.loggers)i.error(e,...t)}dispose(){for(let e of this.loggers)e.dispose();super.dispose()}};mce=new xe("logLevel",Xq(Dn.Info))});function Oce(n,e){Pi.registerCommand(n,function(t,...i){let o=t.get(Ye),[s,r]=i;Ms(Oe.isUri(s)),Ms(U.isIPosition(r));let a=t.get(xn).getModel(s);if(a){let l=U.lift(r);return o.invokeFunction(e,a,l,...i.slice(2))}return t.get(Wd).createModelReference(s).then(l=>new Promise((c,d)=>{try{let h=o.invokeFunction(e,l.object.textEditorModel,U.lift(r),i.slice(2));c(h)}catch(h){d(h)}}).finally(()=>{l.dispose()}))})}function Je(n){return vs.INSTANCE.registerEditorCommand(n),n}function Fce(n){let e=new n;return vs.INSTANCE.registerEditorAction(e),e}function Bce(n){return vs.INSTANCE.registerEditorAction(n),n}function Wce(n){vs.INSTANCE.registerEditorAction(n)}function vy(n,e,t){vs.INSTANCE.registerEditorContribution(n,e,t)}function E0(n){return n.register(),n}var wu,D0,by,yl,pN,l3,c3,Hd,Qq,vs,_N,bN,d3,Ud=J(()=>{"use strict";_();v();b();Ge();sn();Or();ft();_u();Jw();zr();ir();Oi();qe();k0();Oo();Gg();xi();Aa();ke();wu=class{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this.metadata=e.metadata}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){let e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(let t of e){let i=t.kbExpr;this.precondition&&(i?i=Dt.and(i,this.precondition):i=this.precondition);let o={id:this.id,weight:t.weight,args:t.args,when:i,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};Cl.registerKeybindingRule(o)}}Pi.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){Fs.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}},D0=class extends wu{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,o){return this._implementations.push({priority:e,name:t,implementation:i,when:o}),this._implementations.sort((s,r)=>r.priority-s.priority),{dispose:()=>{for(let s=0;s{if(a.get(rt).contextMatchesRules(i??void 0))return o(a,r,t)})}runCommand(e,t){return n.runEditorCommand(e,t,this.precondition,(i,o,s)=>this.runEditorCommand(i,o,s))}},pN=class n extends yl{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function i(o){return o.menuId||(o.menuId=A.EditorContext),o.title||(o.title=e.label),o.when=Dt.and(e.precondition,o.when),o}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(n.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(nr).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}},l3=class extends pN{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((i,o)=>o[0]-i[0]),{dispose:()=>{for(let i=0;i{var r,a;let l=s.get(rt),c=s.get(En);if(!l.contextMatchesRules((r=this.desc.precondition)!==null&&r!==void 0?r:void 0)){c.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,(a=this.desc.precondition)===null||a===void 0?void 0:a.serialize());return}return this.runEditorCommand(s,o,...t)})}};(function(n){function e(r){return vs.INSTANCE.getEditorCommand(r)}n.getEditorCommand=e;function t(){return vs.INSTANCE.getEditorActions()}n.getEditorActions=t;function i(){return vs.INSTANCE.getEditorContributions()}n.getEditorContributions=i;function o(r){return vs.INSTANCE.getEditorContributions().filter(a=>r.indexOf(a.id)>=0)}n.getSomeEditorContributions=o;function s(){return vs.INSTANCE.getDiffEditorContributions()}n.getDiffEditorContributions=s})(Hd||(Hd={}));Qq={EditorCommonContributions:"editor.contributions"},vs=class{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}};vs.INSTANCE=new vs;Vt.add(Qq.EditorCommonContributions,vs.INSTANCE);_N=E0(new D0({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:A.MenubarEditMenu,group:"1_do",title:p({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:A.CommandPalette,group:"",title:p("undo","Undo"),order:1}]}));E0(new by(_N,{id:"default:undo",precondition:void 0}));bN=E0(new D0({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:A.MenubarEditMenu,group:"1_do",title:p({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:A.CommandPalette,group:"",title:p("redo","Redo"),order:1}]}));E0(new by(bN,{id:"default:redo",precondition:void 0}));d3=E0(new D0({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:A.MenubarSelectionMenu,group:"1_basic",title:p({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:A.CommandPalette,group:"",title:p("selectAll","Select All"),order:1}]}))});function N0(n,e,t){n.has(e)?n.get(e).push(t):n.set(e,[t])}var Vi,Zg,yy,yu=J(()=>{"use strict";_();v();b();(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(Vi||(Vi={}));Zg=class{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t0&&n.getLanguageId(r-1)===o;)r--;return new LN(n,o,r,s+1,n.getStartOffset(r),n.getEndOffset(s))}function Vr(n){return(n&3)!==0}var LN,Su=J(()=>{"use strict";_();v();b();LN=class{constructor(e,t,i,o,s,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=o,this.firstCharOffset=s,this._lastCharOffset=r}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}}});var Yg,m3=J(()=>{"use strict";_();v();b();yu();Yg=class n{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new Zg(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new Zg({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){let t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new Zg({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:n.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:n.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}};Yg.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> + `;Yg.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> + `});function _3(n,e){return n[e+0]<<0>>>0|n[e+1]<<8>>>0}function b3(n,e,t){n[t+0]=e&255,e=e>>>8,n[t+1]=e&255}function or(n,e){return n[e]*2**24+n[e+1]*2**16+n[e+2]*2**8+n[e+3]}function sr(n,e,t){n[t+3]=e,e=e>>>8,n[t+2]=e,e=e>>>8,n[t+1]=e,e=e>>>8,n[t]=e}function DN(n,e){return n[e]}function EN(n,e,t){n[t]=e}var p3,Dde,kN,Sy,A0=J(()=>{"use strict";_();v();b();Md();p3=typeof E<"u",Dde=new qn(()=>new Uint8Array(256)),Sy=class n{static wrap(e){return p3&&!E.isBuffer(e)&&(e=E.from(e.buffer,e.byteOffset,e.byteLength)),new n(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return p3?this.buffer.toString():(kN||(kN=new TextDecoder),kN.decode(this.buffer))}}});function v3(){return TN||(TN=new TextDecoder("UTF-16LE")),TN}function nj(){return NN||(NN=new TextDecoder("UTF-16BE")),NN}function MN(){return AN||(AN=p9()?v3():nj()),AN}function C3(n,e,t){let i=new Uint16Array(n.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?oj(n,e,t):v3().decode(i)}function oj(n,e,t){let i=[],o=0;for(let s=0;s{"use strict";_();v();b();ot();Lt();A0();Sl=class{constructor(e){this._capacity=e|0,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return this._completedStrings!==null?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()}_buildBuffer(){if(this._bufferLength===0)return"";let e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return MN().decode(e)}_flushBuffer(){let e=this._buildBuffer();this._bufferLength=0,this._completedStrings===null?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}appendCharCode(e){let t=this._capacity-this._bufferLength;t<=1&&(t===0||pi(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIICharCode(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendString(e){let t=e.length;if(this._bufferLength+t>=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i[r[0].toLowerCase(),r[1].toLowerCase()]);let t=[];for(let r=0;r{let[l,c]=r,[d,h]=a;return l===d||l===h||c===d||c===h},o=(r,a)=>{let l=Math.min(r,a),c=Math.max(r,a);for(let d=0;d0&&s.push({open:a,close:l})}return s}function w3(n,e,t,i){for(let o=0,s=e.length;o=0&&i.push(a);for(let a of r.close)a.indexOf(n)>=0&&i.push(a)}}function y3(n,e){return n.length-e.length}function Ly(n){if(n.length<=1)return n;let e=[],t=new Set;for(let i of n)t.has(i)||(e.push(i),t.add(i));return e}function aj(n,e,t,i){let o=[];o=o.concat(n),o=o.concat(e);for(let s=0,r=o.length;s{"use strict";_();v();b();ot();xu();Ke();RN=class n{constructor(e,t,i,o,s,r){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=o,this.forwardRegex=s,this.reversedRegex=r,this._openSet=n._toSet(this.open),this._closeSet=n._toSet(this.close)}isOpen(e){return this._openSet.has(e)}isClose(e){return this._closeSet.has(e)}static _toSet(e){let t=new Set;for(let i of e)t.add(i);return t}};xy=class{constructor(e,t){this._richEditBracketsBrand=void 0;let i=rj(t);this.brackets=i.map((o,s)=>new RN(e,s,o.open,o.close,aj(o.open,o.close,i,s),lj(o.open,o.close,i,s))),this.forwardRegex=cj(this.brackets),this.reversedRegex=dj(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(let o of this.brackets){for(let s of o.open)this.textIsBracket[s]=o,this.textIsOpenBracket[s]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,s.length);for(let s of o.close)this.textIsBracket[s]=o,this.textIsOpenBracket[s]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,s.length)}}};PN=function(){function n(i){let o=new Uint16Array(i.length),s=0;for(let r=i.length-1;r>=0;r--)o[s++]=i.charCodeAt(r);return MN().decode(o)}let e=null,t=null;return function(o){return e!==o&&(e=o,t=n(e)),t}}(),Jo=class{static _findPrevBracketInText(e,t,i,o){let s=i.match(e);if(!s)return null;let r=i.length-(s.index||0),a=s[0].length,l=o+r;return new P(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,o,s){let a=PN(i).substring(i.length-s,i.length-o);return this._findPrevBracketInText(e,t,a,o)}static findNextBracketInText(e,t,i,o){let s=i.match(e);if(!s)return null;let r=s.index||0,a=s[0].length;if(a===0)return null;let l=o+r;return new P(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,i,o,s){let r=i.substring(o,s);return this.findNextBracketInText(e,t,r,o)}}});var Ey,S3=J(()=>{"use strict";_();v();b();wt();Su();Dy();Ey=class{constructor(e){this._richEditBrackets=e}getElectricCharacters(){let e=[];if(this._richEditBrackets)for(let t of this._richEditBrackets.brackets)for(let i of t.close){let o=i.charAt(i.length-1);e.push(o)}return xr(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;let o=t.findTokenIndexAtOffset(i-1);if(Vr(t.getStandardTokenType(o)))return null;let s=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,a=Jo.findPrevBracketInRange(s,1,r,0,r.length);if(!a)return null;let l=r.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[l])return null;let d=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(d)?{matchOpenBracket:l}:null}}});function Iy(n){return n.global&&(n.lastIndex=0),!0}var Ty,x3=J(()=>{"use strict";_();v();b();Ty=class{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&Iy(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&Iy(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&Iy(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&Iy(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}});var Ny,L3=J(()=>{"use strict";_();v();b();xt();ot();yu();Ny=class n{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{let i=n._createOpenBracketRegExp(t[0]),o=n._createCloseBracketRegExp(t[1]);i&&o&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:o})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,o){if(e>=3)for(let s=0,r=this._regExpRules.length;sc.reg?(c.reg.lastIndex=0,c.reg.test(c.text)):!0))return a.action}if(e>=2&&i.length>0&&o.length>0)for(let s=0,r=this._brackets.length;s=2&&i.length>0){for(let s=0,r=this._brackets.length;s"u"?t:s}function E3(n){return n.replace(/[\[\]]/g,"")}var Rt,Fo=J(()=>{"use strict";_();v();b();qe();Rt=De("configurationService")});var ii,Hr=J(()=>{"use strict";_();v();b();qe();ii=De("languageService")});var Cs,My=J(()=>{"use strict";_();v();b();Cs=class{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}});function _t(n,e,t){e instanceof Cs||(e=new Cs(e,[],!!t)),I3.push([n,e])}function BN(){return I3}var I3,Ur=J(()=>{"use strict";_();v();b();My();I3=[]});var rr,M0=J(()=>{"use strict";_();v();b();rr=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"})});function uj(n){return n.length>0&&n.charAt(n.length-1)==="#"?n.substring(0,n.length-1):n}var Lu,WN,fj,Ry=J(()=>{"use strict";_();v();b();ye();Oo();Lu={JSONContribution:"base.contributions.json"};WN=class{constructor(){this._onDidChangeSchema=new B,this.schemasById={}}registerSchema(e,t){this.schemasById[uj(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}},fj=new WN;Vt.add(Lu.JSONContribution,fj)});function P0(n){let e=[];if(Tc.test(n)){let t=N3.exec(n);for(;t?.length;){let i=t[1].trim();i&&e.push(i),t=N3.exec(n)}}return xr(e)}function gj(n){switch(Array.isArray(n)?n[0]:n){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}function mj(n,e){var t,i,o,s;return n.trim()?Tc.test(n)?p("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",n):Oy.getConfigurationProperties()[n]!==void 0?p("config.property.duplicate","Cannot register '{0}'. This property is already registered.",n):!((t=e.policy)===null||t===void 0)&&t.name&&Oy.getPolicyConfigurations().get((i=e.policy)===null||i===void 0?void 0:i.name)!==void 0?p("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",n,(o=e.policy)===null||o===void 0?void 0:o.name,Oy.getPolicyConfigurations().get((s=e.policy)===null||s===void 0?void 0:s.name)):null:p("config.property.empty","Cannot register an empty property")}var ar,zN,VN,HN,UN,KN,Py,R0,T3,$N,A3,N3,ku,Tc,Oy,Du=J(()=>{"use strict";_();v();b();wt();ye();xi();Ge();Fo();Ry();Oo();ar={Configuration:"base.contributions.configuration"},zN={properties:{},patternProperties:{}},VN={properties:{},patternProperties:{}},HN={properties:{},patternProperties:{}},UN={properties:{},patternProperties:{}},KN={properties:{},patternProperties:{}},Py={properties:{},patternProperties:{}},R0="vscode://schemas/settings/resourceLanguage",T3=Vt.as(Lu.JSONContribution),$N=class{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new B,this._onDidUpdateConfiguration=new B,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:p("defaultLanguageConfigurationOverrides.title","Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},T3.registerSchema(R0,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){let i=new Set;this.doRegisterConfigurations(e,t,i),T3.registerSchema(R0,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){let t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){var i;let o=[];for(let{overrides:s,source:r}of e)for(let a in s)if(t.add(a),Tc.test(a)){let l=this.configurationDefaultsOverrides.get(a),c=(i=l?.valuesSources)!==null&&i!==void 0?i:new Map;if(r)for(let f of Object.keys(s[a]))c.set(f,r);let d={...l?.value||{},...s[a]};this.configurationDefaultsOverrides.set(a,{source:r,value:d,valuesSources:c});let h=E3(a),u={type:"object",default:d,description:p("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",h),$ref:R0,defaultDefaultValue:d,source:tn(r)?void 0:r,defaultValueSource:r};o.push(...P0(a)),this.configurationProperties[a]=u,this.defaultLanguageConfigurationOverridesNode.properties[a]=u}else{this.configurationDefaultsOverrides.set(a,{value:s[a],source:r});let l=this.configurationProperties[a];l&&(this.updatePropertyDefaultValue(a,l),this.updateSchema(a,l))}this.doRegisterOverrideIdentifiers(o)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(let t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(o=>{this.validateAndRegisterProperties(o,t,o.extensionInfo,o.restrictedProperties,void 0,i),this.configurationContributors.push(o),this.registerJSONConfiguration(o)})}validateAndRegisterProperties(e,t=!0,i,o,s=3,r){var a;s=io(e.scope)?s:e.scope;let l=e.properties;if(l)for(let d in l){let h=l[d];if(t&&mj(d,h)){delete l[d];continue}if(h.source=i,h.defaultDefaultValue=l[d].default,this.updatePropertyDefaultValue(d,h),Tc.test(d)?h.scope=void 0:(h.scope=io(h.scope)?s:h.scope,h.restricted=io(h.restricted)?!!o?.includes(d):h.restricted),l[d].hasOwnProperty("included")&&!l[d].included){this.excludedConfigurationProperties[d]=l[d],delete l[d];continue}else this.configurationProperties[d]=l[d],!((a=l[d].policy)===null||a===void 0)&&a.name&&this.policyConfigurations.set(l[d].policy.name,d);!l[d].deprecationMessage&&l[d].markdownDeprecationMessage&&(l[d].deprecationMessage=l[d].markdownDeprecationMessage),r.add(d)}let c=e.allOf;if(c)for(let d of c)this.validateAndRegisterProperties(d,t,i,o,s,r)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){let t=i=>{let o=i.properties;if(o)for(let r in o)this.updateSchema(r,o[r]);let s=i.allOf;s?.forEach(t)};t(e)}updateSchema(e,t){switch(zN.properties[e]=t,t.scope){case 1:VN.properties[e]=t;break;case 2:HN.properties[e]=t;break;case 6:UN.properties[e]=t;break;case 3:KN.properties[e]=t;break;case 4:Py.properties[e]=t;break;case 5:Py.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(let e of this.overrideIdentifiers.values()){let t=`[${e}]`,i={type:"object",description:p("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:p("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:R0};this.updatePropertyDefaultValue(t,i),zN.properties[t]=i,VN.properties[t]=i,HN.properties[t]=i,UN.properties[t]=i,KN.properties[t]=i,Py.properties[t]=i}}registerOverridePropertyPatternKey(){let e={type:"object",description:p("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:p("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:R0};zN.patternProperties[ku]=e,VN.patternProperties[ku]=e,HN.patternProperties[ku]=e,UN.patternProperties[ku]=e,KN.patternProperties[ku]=e,Py.patternProperties[ku]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){let i=this.configurationDefaultsOverrides.get(e),o=i?.value,s=i?.source;ds(o)&&(o=t.defaultDefaultValue,s=void 0),ds(o)&&(o=gj(t.type)),t.default=o,t.defaultValueSource=s}},A3="\\[([^\\]]+)\\]",N3=new RegExp(A3,"g"),ku=`^(${A3})+$`,Tc=new RegExp(ku);Oy=new $N;Vt.add(ar.Configuration,Oy)});var pj,qN,$d,In,_j,Ma=J(()=>{"use strict";_();v();b();Ge();ye();Oo();M0();Du();pj={ModesRegistry:"editor.modesRegistry"},qN=class{constructor(){this._onDidChangeLanguages=new B,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;te!==""&&t!=="")}var Fy,By,jN,GN,R3=J(()=>{"use strict";_();v();b();xT();Fy=class{constructor(e,t){this.languageId=e;let i=t.brackets?M3(t.brackets):[],o=new $_(a=>{let l=new Set;return{info:new jN(this,a,l),closing:l}}),s=new $_(a=>{let l=new Set,c=new Set;return{info:new GN(this,a,l,c),opening:l,openingColorized:c}});for(let[a,l]of i){let c=o.get(a),d=s.get(l);c.closing.add(d.info),d.opening.add(c.info)}let r=t.colorizedBracketPairs?M3(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(let[a,l]of r){let c=o.get(a),d=s.get(l);c.closing.add(d.info),d.openingColorized.add(c.info),d.opening.add(c.info)}this._openingBrackets=new Map([...o.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...s.cachedValues].map(([a,l])=>[a,l.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}};By=class{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}},jN=class extends By{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}},GN=class extends By{constructor(e,t,i,o){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=o,this.isOpeningBracket=!1}closes(e){return e.config!==this.config?!1:this.openingBrackets.has(e)}closesColorized(e){return e.config!==this.config?!1:this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}});function vj(n,e,t,i){let o=e.getLanguageConfiguration(n);if(!o){if(!i.isRegisteredLanguageId(n))return new Xg(n,{});o=new Xg(n,{})}let s=Cj(o.languageId,t),r=F3([o.underlyingConfig,s]);return new Xg(o.languageId,r)}function Cj(n,e){let t=e.getValue(YN.brackets,{overrideIdentifier:n}),i=e.getValue(YN.colorizedBracketPairs,{overrideIdentifier:n});return{brackets:O3(t),colorizedBracketPairs:O3(i)}}function O3(n){if(Array.isArray(n))return n.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function Vy(n,e,t){let i=n.getLineContent(e),o=jn(i);return o.length>t-1&&(o=o.substring(0,t-1)),o}function qd(n,e,t){n.tokenization.forceTokenization(e);let i=n.tokenization.getLineTokens(e),o=typeof t>"u"?n.getLineMaxColumn(e)-1:t-1;return Kd(i,o)}function F3(n){let e={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(let t of n)e={comments:t.comments||e.comments,brackets:t.brackets||e.brackets,wordPattern:t.wordPattern||e.wordPattern,indentationRules:t.indentationRules||e.indentationRules,onEnterRules:t.onEnterRules||e.onEnterRules,autoClosingPairs:t.autoClosingPairs||e.autoClosingPairs,surroundingPairs:t.surroundingPairs||e.surroundingPairs,autoCloseBefore:t.autoCloseBefore||e.autoCloseBefore,folding:t.folding||e.folding,colorizedBracketPairs:t.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:t.__electricCharacterSupport||e.__electricCharacterSupport};return e}var bj,P3,O0,yo,ZN,YN,XN,Wy,zy,QN,Xg,lr=J(()=>{"use strict";_();v();b();ye();le();ot();ug();yu();Su();m3();S3();x3();L3();Dy();qe();Fo();Hr();Ur();Ma();R3();bj=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},P3=function(n,e){return function(t,i){e(t,i,n)}},O0=class{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}},yo=De("languageConfigurationService"),ZN=class extends H{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new QN),this.onDidChangeEmitter=this._register(new B),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;let i=new Set(Object.values(YN));this._register(this.configurationService.onDidChangeConfiguration(o=>{let s=o.change.keys.some(a=>i.has(a)),r=o.change.overrides.filter(([a,l])=>l.some(c=>i.has(c))).map(([a])=>a);if(s)this.configurations.clear(),this.onDidChangeEmitter.fire(new O0(void 0));else for(let a of r)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new O0(a)))})),this._register(this._registry.onDidChange(o=>{this.configurations.delete(o.languageId),this.onDidChangeEmitter.fire(new O0(o.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=vj(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};ZN=bj([P3(0,Rt),P3(1,ii)],ZN);YN={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};XN=class{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){let i=new Wy(e,t,++this._order);return this._entries.push(i),this._resolved=null,be(()=>{for(let o=0;oe.configuration)))}};Wy=class{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}},zy=class{constructor(e){this.languageId=e}},QN=class extends H{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._register(this.register(In,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let o=this._entries.get(e);o||(o=new XN(e),this._entries.set(e,o));let s=o.register(t,i);return this._onDidChange.fire(new zy(e)),be(()=>{s.dispose(),this._onDidChange.fire(new zy(e))})}getLanguageConfiguration(e){let t=this._entries.get(e);return t?.getResolvedConfiguration()||null}},Xg=class n{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new Ny(this.underlyingConfig):null,this.comments=n._handleComments(this.underlyingConfig),this.characterPair=new Yg(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||T_,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new Ty(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new Fy(e,this.underlyingConfig)}getWordDefinition(){return N_(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new xy(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new Ey(this.brackets)),this._electricCharacter}onEnter(e,t,i,o){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,o):null}getAutoClosingPairs(){return new yy(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){let t=e.comments;if(!t)return null;let i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){let[o,s]=t.blockComment;i.blockCommentStartToken=o,i.blockCommentEndToken=s}return i}};_t(yo,ZN,1)});function Iu(n){return n<0?0:n>255?255:n|0}function Tu(n){return n<0?0:n>4294967295?4294967295:n|0}var F0=J(()=>{"use strict";_();v();b()});var Nc,W3,Gy=J(()=>{"use strict";_();v();b();F0();Nc=class n{constructor(e){let t=Iu(e);this._defaultValue=t,this._asciiMap=n._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){let t=new Uint8Array(256);return t.fill(e),t}set(e,t){let i=Iu(t);e>=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}},W3=class{constructor(){this._actual=new Nc(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}});function Sj(n){return Array.isArray(n)}var V3,H3,nA,Gn,oA,sA,Kr,Zy,Jg,cr=J(()=>{"use strict";_();v();b();nA=class{constructor(e,t){this.uri=e,this.value=t}};Gn=class n{constructor(e,t){if(this[V3]="ResourceMap",e instanceof n)this.map=new Map(e.map),this.toKey=t??n.defaultToKey;else if(Sj(e)){this.map=new Map,this.toKey=t??n.defaultToKey;for(let[i,o]of e)this.set(i,o)}else this.map=new Map,this.toKey=e??n.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new nA(e,t)),this}get(e){var t;return(t=this.map.get(this.toKey(e)))===null||t===void 0?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t<"u"&&(e=e.bind(t));for(let[i,o]of this.map)e(o.value,o.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(V3=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}};Gn.defaultToKey=n=>n.toString();oA=class{constructor(){this[H3]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){let i=this._map.get(e);if(i)return t!==0&&this.touch(i,t),i.value}set(e,t,i=0){let o=this._map.get(e);if(o)o.value=t,i!==0&&this.touch(o,i);else{switch(o={key:e,value:t,next:void 0,previous:void 0},i){case 0:this.addItemLast(o);break;case 1:this.addItemFirst(o);break;case 2:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let i=this._state,o=this._head;for(;o;){if(t?e.bind(t)(o.value,o.key,this):e(o.value,o.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let e=this,t=this._state,i=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){let s={value:i.key,done:!1};return i=i.next,s}else return{value:void 0,done:!0}}};return o}values(){let e=this,t=this._state,i=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){let s={value:i.value,done:!1};return i=i.next,s}else return{value:void 0,done:!0}}};return o}entries(){let e=this,t=this._state,i=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){let s={value:[i.key,i.value],done:!1};return i=i.next,s}else return{value:void 0,done:!0}}};return o}[(H3=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._tail,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.previous,i--;this._tail=t,this._size=i,t&&(t.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==1&&t!==2)){if(t===1){if(e===this._head)return;let i=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(i.previous=o,o.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===2){if(e===this._tail)return;let i=e.next,o=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=o,o.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(let[t,i]of e)this.set(t,i)}},sA=class extends oA{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},Kr=class extends sA{constructor(e,t=1){super(e,t)}trim(e){this.trimOld(e)}set(e,t){return super.set(e,t),this.checkTrim(),this}},Zy=class{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(let[t,i]of e)this.set(t,i)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){let t=this._m1.get(e);return t===void 0?!1:(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}},Jg=class{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){let i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){let i=this.map.get(e);i&&i.forEach(t)}get(e){let t=this.map.get(e);return t||new Set}}});function xl(n,e){let t=`${n}/${e.join(",")}`,i=U3.get(t);return i||(i=new rA(n,e),U3.set(t,i)),i}var rA,U3,W0=J(()=>{"use strict";_();v();b();cr();Gy();rA=class extends Nc{constructor(e,t){super(0),this._segmenter=null,this._cachedLine=null,this._cachedSegments=[],this.intlSegmenterLocales=t,this.intlSegmenterLocales.length>0?this._segmenter=new Intl.Segmenter(this.intlSegmenterLocales,{granularity:"word"}):this._segmenter=null;for(let i=0,o=e.length;it)break;i=o}return i}findNextIntlWordAtOrAfterOffset(e,t){for(let i of this._getIntlSegmenterWordsOnLine(e))if(!(i.index{"use strict";_();v();b();hs();(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(em||(em={}));(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=3]="Right"})(dr||(dr={}));(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(Nu||(Nu={}));Zd=class{get originalIndentSize(){return this._indentSizeIsTabSize?"tabSize":this.indentSize}constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,e.tabSize|0),e.indentSize==="tabSize"?(this.indentSize=this.tabSize,this._indentSizeIsTabSize=!0):(this.indentSize=Math.max(1,e.indentSize|0),this._indentSizeIsTabSize=!1),this.insertSpaces=!!e.insertSpaces,this.defaultEOL=e.defaultEOL|0,this.trimAutoWhitespace=!!e.trimAutoWhitespace,this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this._indentSizeIsTabSize===e._indentSizeIsTabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&hn(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}},Ll=class{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}};tm=class{constructor(e,t,i,o,s,r){this.identifier=e,this.range=t,this.text=i,this.forceMoveMarkers=o,this.isAutoWhitespaceEdit=s,this._isTracked=r}},Yy=class{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}},Xy=class{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}});function kj(n){if(!n||n.length===0)return!1;for(let e=0,t=n.length;e=t)break;let o=n.charCodeAt(e);if(o===110||o===114||o===87)return!0}}return!1}function Yd(n,e,t){if(!t)return new Ll(n,null);let i=[];for(let o=0,s=e.length;o0){let r=e.charCodeAt(i);if(n.get(r)!==0)return!0}return!1}function Ej(n,e,t,i,o){if(i+o===t)return!0;let s=e.charCodeAt(i+o);if(n.get(s)!==0||s===13||s===10)return!0;if(o>0){let r=e.charCodeAt(i+o-1);if(n.get(r)!==0)return!0}return!1}function Jy(n,e,t,i,o){return Dj(n,e,t,i,o)&&Ej(n,e,t,i,o)}var Lj,Ac,Qy,Au,kl,eS=J(()=>{"use strict";_();v();b();ot();W0();ft();Ke();hr();Lj=999,Ac=class{constructor(e,t,i,o){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=o}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=kj(this.searchString):e=this.searchString.indexOf(` +`)>=0;let t=null;try{t=pw(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new Yy(t,this.wordSeparators?xl(this.wordSeparators,[]):null,i?this.searchString:null)}};Qy=class{constructor(e){let t=[],i=0;for(let o=0,s=e.length;o>0);t[s]>=e?o=s-1:t[s+1]>=e?(i=s,o=s):i=s+1}return i+1}},Au=class{static findMatches(e,t,i,o,s){let r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new kl(r.wordSeparators,r.regex),o,s):this._doFindMatchesLineByLine(e,i,r,o,s):[]}static _getMultilineMatchRange(e,t,i,o,s,r){let a,l=0;o?(l=o.findLineFeedCountBeforeOffset(s),a=t+s+l):a=t+s;let c;if(o){let f=o.findLineFeedCountBeforeOffset(s+r.length)-l;c=a+r.length+f}else c=a+r.length;let d=e.getPositionAt(a),h=e.getPositionAt(c);return new P(d.lineNumber,d.column,h.lineNumber,h.column)}static _doFindMatchesMultiline(e,t,i,o,s){let r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r +`?new Qy(a):null,c=[],d=0,h;for(i.reset(0);h=i.next(a);)if(c[d++]=Yd(this._getMultilineMatchRange(e,r,a,l,h.index,h[0]),h,o),d>=s)return c;return c}static _doFindMatchesLineByLine(e,t,i,o,s){let r=[],a=0;if(t.startLineNumber===t.endLineNumber){let c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,r,o,s),r}let l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,r,o,s);for(let c=t.startLineNumber+1;c=l))return s;return s}let d=new kl(e.wordSeparators,e.regex),h;d.reset(0);do if(h=d.next(t),h&&(r[s++]=Yd(new P(i,h.index+1+o,i,h.index+1+h[0].length+o),h,a),s>=l))return s;while(h);return s}static findNextMatch(e,t,i,o){let s=t.parseSearchRequest();if(!s)return null;let r=new kl(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindNextMatchMultiline(e,i,r,o):this._doFindNextMatchLineByLine(e,i,r,o)}static _doFindNextMatchMultiline(e,t,i,o){let s=new U(t.lineNumber,1),r=e.getOffsetAt(s),a=e.getLineCount(),l=e.getValueInRange(new P(s.lineNumber,s.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r +`?new Qy(l):null;i.reset(t.column-1);let d=i.next(l);return d?Yd(this._getMultilineMatchRange(e,r,l,c,d.index,d[0]),d,o):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new U(1,1),i,o):null}static _doFindNextMatchLineByLine(e,t,i,o){let s=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),l=this._findFirstMatchInLine(i,a,r,t.column,o);if(l)return l;for(let c=1;c<=s;c++){let d=(r+c-1)%s,h=e.getLineContent(d+1),u=this._findFirstMatchInLine(i,h,d+1,1,o);if(u)return u}return null}static _findFirstMatchInLine(e,t,i,o,s){e.reset(o-1);let r=e.next(t);return r?Yd(new P(i,r.index+1,i,r.index+1+r[0].length),r,s):null}static findPreviousMatch(e,t,i,o){let s=t.parseSearchRequest();if(!s)return null;let r=new kl(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,o):this._doFindPreviousMatchLineByLine(e,i,r,o)}static _doFindPreviousMatchMultiline(e,t,i,o){let s=this._doFindMatchesMultiline(e,new P(1,1,t.lineNumber,t.column),i,o,10*Lj);if(s.length>0)return s[s.length-1];let r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new U(r,e.getLineMaxColumn(r)),i,o):null}static _doFindPreviousMatchLineByLine(e,t,i,o){let s=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),l=this._findLastMatchInLine(i,a,r,o);if(l)return l;for(let c=1;c<=s;c++){let d=(s+r-c-1)%s,h=e.getLineContent(d+1),u=this._findLastMatchInLine(i,h,d+1,o);if(u)return u}return null}static _findLastMatchInLine(e,t,i,o){let s=null,r;for(e.reset(0);r=e.next(t);)s=Yd(new P(i,r.index+1,i,r.index+1+r[0].length),r,o);return s}};kl=class{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){let t=e.length,i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(i=this._searchRegex.exec(e),!i))return null;let o=i.index,s=i[0].length;if(o===this._prevMatchStartIndex&&s===this._prevMatchLength){if(s===0){Eg(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=o,this._prevMatchLength=s,!this._wordSeparators||Jy(this._wordSeparators,e,t,o,s))return i}while(i);return null}}});var ze,nS,es=J(()=>{"use strict";_();v();b();xt();ze=class n{static addRange(e,t){let i=0;for(;it))return new n(e,t)}static ofLength(e){return new n(0,e)}static ofStartAndLength(e,t){return new n(e,e+t)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new St(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new n(this.start+e,this.endExclusive+e)}deltaStart(e){return new n(this.start+e,this.endExclusive)}deltaEnd(e){return new n(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new St(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new St(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;te.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}});function Mu(n,e){let t=Tj(n,e);if(t!==-1)return n[t]}function Tj(n,e,t=n.length-1){for(let i=t;i>=0;i--){let o=n[i];if(e(o))return i}return-1}function Mc(n,e){let t=Ru(n,e);return t===-1?void 0:n[t]}function Ru(n,e,t=0,i=n.length){let o=t,s=i;for(;o0&&(t=o)}return t}function G3(n,e){if(n.length===0)return;let t=n[0];for(let i=1;i=0&&(t=o)}return t}function Z3(n,e){return aA(n,(t,i)=>-e(t,i))}function Y3(n,e){if(n.length===0)return-1;let t=0;for(let i=1;i0&&(t=i)}return t}function $fe(n,e){for(let t of n){let i=e(t);if(i!==void 0)return i}}var nm,Dl=J(()=>{"use strict";_();v();b();nm=class n{constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(e){if(n.assertInvariants){if(this._prevFindLastPredicate){for(let i of this._array)if(this._prevFindLastPredicate(i)&&!e(i))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=e}let t=Ru(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=t+1,t===-1?void 0:this._array[t]}};nm.assertInvariants=!1});var Ne,ur,Bo=J(()=>{"use strict";_();v();b();xt();es();Ke();Dl();Ne=class n{static fromRangeInclusive(e){return new n(e.startLineNumber,e.endLineNumber+1)}static joinMany(e){if(e.length===0)return[];let t=new ur(e[0].slice());for(let i=1;it)throw new St(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),i=Ru(this._normalizedRanges,o=>o.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){let o=this._normalizedRanges[t];this._normalizedRanges[t]=o.join(e)}else{let o=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,o)}}contains(e){let t=Mc(this._normalizedRanges,i=>i.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}intersects(e){let t=Mc(this._normalizedRanges,i=>i.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;let t=[],i=0,o=0,s=null;for(;i=r.startLineNumber?s=new Ne(s.startLineNumber,Math.max(s.endLineNumberExclusive,r.endLineNumberExclusive)):(t.push(s),s=r)}return s!==null&&t.push(s),new n(t)}subtractFrom(e){let t=oS(this._normalizedRanges,r=>r.endLineNumberExclusive>=e.startLineNumber),i=Ru(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new n([e]);let o=[],s=e.startLineNumber;for(let r=t;rs&&o.push(new Ne(s,a.startLineNumber)),s=a.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let t=[],i=0,o=0;for(;it.delta(e)))}}});var ws,om=J(()=>{"use strict";_();v();b();ft();Ke();ws=class n{static betweenPositions(e,t){return e.lineNumber===t.lineNumber?new n(0,t.column-e.column):new n(t.lineNumber-e.lineNumber,t.column-1)}static ofRange(e){return n.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let t=0,i=0;for(let o of e)o===` +`?(t++,i=0):i++;return new n(t,i)}constructor(e,t){this.lineCount=e,this.columnCount=t}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}createRange(e){return this.lineCount===0?new P(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new P(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}addToPosition(e){return this.lineCount===0?new U(e.lineNumber,e.column+this.columnCount):new U(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}};ws.zero=new ws(0,0)});function Jd(n,e){let t=Math.pow(10,e);return Math.round(n*t)/t}var vt,Tl,dm,Z,gn=J(()=>{"use strict";_();v();b();vt=class{constructor(e,t,i,o=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=Jd(Math.max(Math.min(1,o),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}},Tl=class n{constructor(e,t,i,o){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Jd(Math.max(Math.min(1,t),0),3),this.l=Jd(Math.max(Math.min(1,i),0),3),this.a=Jd(Math.max(Math.min(1,o),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){let t=e.r/255,i=e.g/255,o=e.b/255,s=e.a,r=Math.max(t,i,o),a=Math.min(t,i,o),l=0,c=0,d=(a+r)/2,h=r-a;if(h>0){switch(c=Math.min(d<=.5?h/(2*d):h/(2-2*d),1),r){case t:l=(i-o)/h+(i1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){let t=e.h/360,{s:i,l:o,a:s}=e,r,a,l;if(i===0)r=a=l=o;else{let c=o<.5?o*(1+i):o+i-o*i,d=2*o-c;r=n._hue2rgb(d,c,t+1/3),a=n._hue2rgb(d,c,t),l=n._hue2rgb(d,c,t-1/3)}return new vt(Math.round(r*255),Math.round(a*255),Math.round(l*255),s)}},dm=class n{constructor(e,t,i,o){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Jd(Math.max(Math.min(1,t),0),3),this.v=Jd(Math.max(Math.min(1,i),0),3),this.a=Jd(Math.max(Math.min(1,o),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){let t=e.r/255,i=e.g/255,o=e.b/255,s=Math.max(t,i,o),r=Math.min(t,i,o),a=s-r,l=s===0?0:a/s,c;return a===0?c=0:s===t?c=((i-o)/a%6+6)%6:s===i?c=(o-t)/a+2:c=(t-i)/a+4,new n(Math.round(c*60),l,s,e.a)}static toRGBA(e){let{h:t,s:i,v:o,a:s}=e,r=o*i,a=r*(1-Math.abs(t/60%2-1)),l=o-r,[c,d,h]=[0,0,0];return t<60?(c=r,d=a):t<120?(c=a,d=r):t<180?(d=r,h=a):t<240?(d=a,h=r):t<300?(c=a,h=r):t<=360&&(c=r,h=a),c=Math.round((c+l)*255),d=Math.round((d+l)*255),h=Math.round((h+l)*255),new vt(c,d,h,s)}},Z=class n{static fromHex(e){return n.Format.CSS.parseHex(e)||n.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:Tl.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:dm.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof vt)this.rgba=e;else if(e instanceof Tl)this._hsla=e,this.rgba=Tl.toRGBA(e);else if(e instanceof dm)this._hsva=e,this.rgba=dm.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&vt.equals(this.rgba,e.rgba)&&Tl.equals(this.hsla,e.hsla)&&dm.equals(this.hsva,e.hsva)}getRelativeLuminance(){let e=n._relativeLuminanceForComponent(this.rgba.r),t=n._relativeLuminanceForComponent(this.rgba.g),i=n._relativeLuminanceForComponent(this.rgba.b),o=.2126*e+.7152*t+.0722*i;return Jd(o,4)}static _relativeLuminanceForComponent(e){let t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){let t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){let t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t{"use strict";_();v();b();qe();Tt=De("ILanguageFeaturesService")});function _S(n,e){return new Ad([new xa(0,"",n)],e)}function hm(n,e){let t=new Uint32Array(2);return t[0]=0,t[1]=(n<<0|0|0|32768|2<<24)>>>0,new yc(t,e===null?eh:e)}var eh,Y0=J(()=>{"use strict";_();v();b();Yo();eh=new class{clone(){return this}equals(n){return this===n}}});var mn,um=J(()=>{"use strict";_();v();b();mn=class{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static getClassNameFromMetadata(e){let i="mtk"+this.getForeground(e),o=this.getFontStyle(e);return o&1&&(i+=" mtki"),o&2&&(i+=" mtkb"),o&4&&(i+=" mtku"),o&8&&(i+=" mtks"),i}static getInlineStyleFromMetadata(e,t){let i=this.getForeground(e),o=this.getFontStyle(e),s=`color: ${t[i]};`;o&1&&(s+="font-style: italic;"),o&2&&(s+="font-weight: bold;");let r="";return o&4&&(r+=" underline"),o&8&&(r+=" line-through"),r&&(s+=`text-decoration:${r};`),s}static getPresentationFromMetadata(e){let t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:!!(i&1),bold:!!(i&2),underline:!!(i&4),strikethrough:!!(i&8)}}}});var Hi,SA,Pc=J(()=>{"use strict";_();v();b();um();Hi=class n{static createEmpty(e,t){let i=n.defaultTokenMetadata,o=new Uint32Array(2);return o[0]=e.length,o[1]=i,new n(o,e,t)}constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=i}equals(e){return e instanceof n?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;let o=t<<1,s=o+(i<<1);for(let r=o;r0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){let t=this._tokens[(e<<1)+1],i=mn.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){let t=this._tokens[(e<<1)+1];return mn.getTokenType(t)}getForeground(e){let t=this._tokens[(e<<1)+1];return mn.getForeground(t)}getClassName(e){let t=this._tokens[(e<<1)+1];return mn.getClassNameFromMetadata(t)}getInlineStyle(e,t){let i=this._tokens[(e<<1)+1];return mn.getInlineStyleFromMetadata(i,t)}getPresentation(e){let t=this._tokens[(e<<1)+1];return mn.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return n.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new SA(this,e,t,i)}static convertToEndOffset(e,t){let o=(e.length>>>1)-1;for(let s=0;s>>1)-1;for(;it&&(o=s)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,o="",s=new Array,r=0;for(;;){let a=tr){o+=this._text.substring(r,l.offset);let c=this._tokens[(t<<1)+1];s.push(o.length,c),r=l.offset}o+=l.text,s.push(o.length,l.tokenMetadata),i++}else break}return new n(new Uint32Array(s),o,this._languageIdCodec)}};Hi.defaultTokenMetadata=(32768|2<<24)>>>0;SA=class n{constructor(e,t,i,o){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=o,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let s=this._firstTokenIndex,r=e.getCount();s=i);s++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof n?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){let t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}});var vm,OA=J(()=>{"use strict";_();v();b();le();ye();ke();vm=class extends H{constructor(e,t){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null,t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()},i=!1,o=!1,s=()=>{if(i&&!o)try{i=!1,o=!0,t()}finally{rn(ge(this._referenceDomElement),()=>{o=!1,s()})}};this._resizeObserver=new ResizeObserver(r=>{r&&r[0]&&r[0].contentRect?e={width:r[0].contentRect.width,height:r[0].contentRect.height}:e=null,i=!0,s()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,o=0;t?(i=t.width,o=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,o=this._referenceDomElement.clientHeight),i=Math.max(5,i),o=Math.max(5,o),(this._width!==i||this._height!==o)&&(this._width=i,this._height=o,e&&this._onDidChange.fire())}}});function DS(n){return`--vscode-${n.replace(/\./g,"-")}`}function he(n){return`var(${DS(n)})`}function B8(n,e){return`var(${DS(n)}, ${e})`}function F(n,e,t,i,o){return ES.registerColor(n,e,t,i,o)}function _G(n,e){var t,i,o,s;switch(n.op){case 0:return(t=Fa(n.value,e))===null||t===void 0?void 0:t.darken(n.factor);case 1:return(i=Fa(n.value,e))===null||i===void 0?void 0:i.lighten(n.factor);case 2:return(o=Fa(n.value,e))===null||o===void 0?void 0:o.transparent(n.factor);case 3:{let r=Fa(n.background,e);return r?(s=Fa(n.value,e))===null||s===void 0?void 0:s.makeOpaque(r):Fa(n.value,e)}case 4:for(let r of n.values){let a=Fa(r,e);if(a)return a}return;case 6:return Fa(e.defines(n.if)?n.then:n.else,e);case 5:{let r=Fa(n.value,e);if(!r)return;let a=Fa(n.background,e);return a?r.isDarkerThan(a)?Z.getLighterColor(r,a,n.factor).transparent(n.transparency):Z.getDarkerColor(r,a,n.factor).transparent(n.transparency):r.transparent(n.factor*n.transparency)}default:throw $g(n)}}function Pl(n,e){return{op:0,value:n,factor:e}}function zs(n,e){return{op:1,value:n,factor:e}}function Ee(n,e){return{op:2,value:n,factor:e}}function HA(...n){return{op:4,values:n}}function W8(n,e,t){return{op:6,if:n,then:e,else:t}}function UA(n,e,t,i){return{op:5,value:n,background:e,factor:t,transparency:i}}function Fa(n,e){if(n!==null){if(typeof n=="string")return n[0]==="#"?Z.fromHex(n):e.getColor(n);if(n instanceof Z)return n;if(typeof n=="object")return _G(n,e)}}var VA,zA,ES,z8,V8,F8,jr=J(()=>{"use strict";_();v();b();Na();Gt();gn();ye();Ry();Oo();VA={ColorContribution:"base.contributions.colors"},zA=class{constructor(){this._onDidChangeSchema=new B,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,o=!1,s){let r={id:e,description:i,defaults:t,needsTransparency:o,deprecationMessage:s};this.colorsById[e]=r;let a={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return s&&(a.deprecationMessage=s),o&&(a.pattern="^#(?:(?[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$",a.patternErrorMessage="This color must be transparent or it will obscure content"),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){let i=this.colorsById[e];if(i&&i.defaults){let o=i.defaults[t.type];return Fa(o,t)}}getColorSchema(){return this.colorSchema}toString(){let e=(t,i)=>{let o=t.indexOf(".")===-1?0:1,s=i.indexOf(".")===-1?0:1;return o!==s?o-s:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` +`)}},ES=new zA;Vt.add(VA.ColorContribution,ES);z8="vscode://schemas/workbench-colors",V8=Vt.as(Lu.JSONContribution);V8.registerSchema(z8,ES.getColorSchema());F8=new di(()=>V8.notifySchemaChanged(z8),200);ES.onDidChangeSchema(()=>{F8.isScheduled()||F8.schedule()})});var at,uve,fve,gve,ih,zo,Ct,ni,mve,H8,pve,_ve,bve,vve,Cve,wve,yve,Fc=J(()=>{"use strict";_();v();b();Ge();gn();jr();at=F("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},p("foreground","Overall foreground color. This color is only used if not overridden by a component.")),uve=F("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},p("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component.")),fve=F("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},p("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component.")),gve=F("descriptionForeground",{light:"#717171",dark:Ee(at,.7),hcDark:Ee(at,.7),hcLight:Ee(at,.7)},p("descriptionForeground","Foreground color for description text providing additional information, for example for a label.")),ih=F("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},p("iconForeground","The default color for icons in the workbench.")),zo=F("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},p("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Ct=F("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},p("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),ni=F("contrastActiveBorder",{light:null,dark:null,hcDark:zo,hcLight:zo},p("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast.")),mve=F("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},p("selectionBackground","The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor.")),H8=F("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},p("textLinkForeground","Foreground color for links in text.")),pve=F("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},p("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover.")),_ve=F("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:Z.black,hcLight:"#292929"},p("textSeparatorForeground","Color for text separators.")),bve=F("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},p("textPreformatForeground","Foreground color for preformatted text segments.")),vve=F("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},p("textPreformatBackground","Background color for preformatted text segments.")),Cve=F("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},p("textBlockQuoteBackground","Background color for block quotes in text.")),wve=F("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:Z.white,hcLight:"#292929"},p("textBlockQuoteBorder","Border color for block quotes in text.")),yve=F("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:Z.black,hcLight:"#F2F2F2"},p("textCodeBlockBackground","Background color for code blocks in text."))});var Tve,ym,U8,$u,qu,ju,Gu,K8,IS=J(()=>{"use strict";_();v();b();Ge();gn();jr();Fc();Tve=F("sash.hoverBorder",{dark:zo,light:zo,hcDark:zo,hcLight:zo},p("sashActiveBorder","Border color of active sashes.")),ym=F("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:Z.black,hcLight:"#0F4A85"},p("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),U8=F("badge.foreground",{dark:Z.white,light:"#333",hcDark:Z.white,hcLight:Z.white},p("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),$u=F("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},p("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),qu=F("scrollbarSlider.background",{dark:Z.fromHex("#797979").transparent(.4),light:Z.fromHex("#646464").transparent(.4),hcDark:Ee(Ct,.6),hcLight:Ee(Ct,.4)},p("scrollbarSliderBackground","Scrollbar slider background color.")),ju=F("scrollbarSlider.hoverBackground",{dark:Z.fromHex("#646464").transparent(.7),light:Z.fromHex("#646464").transparent(.7),hcDark:Ee(Ct,.8),hcLight:Ee(Ct,.8)},p("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),Gu=F("scrollbarSlider.activeBackground",{dark:Z.fromHex("#BFBFBF").transparent(.4),light:Z.fromHex("#000000").transparent(.6),hcDark:Ct,hcLight:Ct},p("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),K8=F("progressBar.background",{dark:Z.fromHex("#0E70C0"),light:Z.fromHex("#0E70C0"),hcDark:Ct,hcLight:Ct},p("progressBarBackground","Background color of the progress bar that can show for long running operations."))});var Nn,Zu,Wve,zve,Vve,Hve,Fi,Ba,Sm,Uve,Kve,Wa,$ve,rb,An,Tm,qve,Vo,Nm,Y8,jve,Gve,xm,X8,KA,$A,Zve,Yve,za,Xve,Qve,sh,Jve,e1e,$8,t1e,Q8,i1e,nh,oh,n1e,o1e,s1e,r1e,TS,a1e,l1e,c1e,d1e,h1e,u1e,NS,AS,J8,eB,f1e,g1e,m1e,p1e,tB,iB,_1e,b1e,v1e,C1e,w1e,y1e,S1e,Va,nB,q8,x1e,L1e,oB,sB,qA,rB,k1e,aB,j8,G8,Z8,Gr,Em,Lm,D1e,km,E1e,Dm,I1e,Im,T1e,N1e,A1e,M1e,R1e,lB,cB,dB,rh=J(()=>{"use strict";_();v();b();Ge();gn();jr();Fc();IS();Nn=F("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:Z.black,hcLight:Z.white},p("editorBackground","Editor background color.")),Zu=F("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:Z.white,hcLight:at},p("editorForeground","Editor default foreground color.")),Wve=F("editorStickyScroll.background",{light:Nn,dark:Nn,hcDark:Nn,hcLight:Nn},p("editorStickyScrollBackground","Background color of sticky scroll in the editor")),zve=F("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:Z.fromHex("#0F4A85").transparent(.1)},p("editorStickyScrollHoverBackground","Background color of sticky scroll on hover in the editor")),Vve=F("editorStickyScroll.border",{dark:null,light:null,hcDark:Ct,hcLight:Ct},p("editorStickyScrollBorder","Border color of sticky scroll in the editor")),Hve=F("editorStickyScroll.shadow",{dark:$u,light:$u,hcDark:$u,hcLight:$u},p("editorStickyScrollShadow"," Shadow color of sticky scroll in the editor")),Fi=F("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:Z.white},p("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),Ba=F("editorWidget.foreground",{dark:at,light:at,hcDark:at,hcLight:at},p("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Sm=F("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Ct,hcLight:Ct},p("editorWidgetBorder","Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")),Uve=F("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},p("editorWidgetResizeBorder","Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),Kve=F("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},p("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Wa=F("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},p("editorError.foreground","Foreground color of error squigglies in the editor.")),$ve=F("editorError.border",{dark:null,light:null,hcDark:Z.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},p("errorBorder","If set, color of double underlines for errors in the editor.")),rb=F("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},p("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),An=F("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},p("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),Tm=F("editorWarning.border",{dark:null,light:null,hcDark:Z.fromHex("#FFCC00").transparent(.8),hcLight:Z.fromHex("#FFCC00").transparent(.8)},p("warningBorder","If set, color of double underlines for warnings in the editor.")),qve=F("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},p("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Vo=F("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},p("editorInfo.foreground","Foreground color of info squigglies in the editor.")),Nm=F("editorInfo.border",{dark:null,light:null,hcDark:Z.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},p("infoBorder","If set, color of double underlines for infos in the editor.")),Y8=F("editorHint.foreground",{dark:Z.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},p("editorHint.foreground","Foreground color of hint squigglies in the editor.")),jve=F("editorHint.border",{dark:null,light:null,hcDark:Z.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},p("hintBorder","If set, color of double underlines for hints in the editor.")),Gve=F("editorLink.activeForeground",{dark:"#4E94CE",light:Z.blue,hcDark:Z.cyan,hcLight:"#292929"},p("activeLinkForeground","Color of active links.")),xm=F("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},p("editorSelectionBackground","Color of the editor selection.")),X8=F("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:Z.white},p("editorSelectionForeground","Color of the selected text for high contrast.")),KA=F("editor.inactiveSelectionBackground",{light:Ee(xm,.5),dark:Ee(xm,.5),hcDark:Ee(xm,.7),hcLight:Ee(xm,.5)},p("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),$A=F("editor.selectionHighlightBackground",{light:UA(xm,Nn,.3,.6),dark:UA(xm,Nn,.3,.6),hcDark:null,hcLight:null},p("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0),Zve=F("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:ni,hcLight:ni},p("editorSelectionHighlightBorder","Border color for regions with the same content as the selection.")),Yve=F("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},p("editorFindMatch","Color of the current search match.")),za=F("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},p("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),Xve=F("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},p("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),Qve=F("editor.findMatchBorder",{light:null,dark:null,hcDark:ni,hcLight:ni},p("editorFindMatchBorder","Border color of the current search match.")),sh=F("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:ni,hcLight:ni},p("findMatchHighlightBorder","Border color of the other search matches.")),Jve=F("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:Ee(ni,.4),hcLight:Ee(ni,.4)},p("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),e1e=F("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},p("hoverHighlight","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),$8=F("editorHoverWidget.background",{light:Fi,dark:Fi,hcDark:Fi,hcLight:Fi},p("hoverBackground","Background color of the editor hover.")),t1e=F("editorHoverWidget.foreground",{light:Ba,dark:Ba,hcDark:Ba,hcLight:Ba},p("hoverForeground","Foreground color of the editor hover.")),Q8=F("editorHoverWidget.border",{light:Sm,dark:Sm,hcDark:Sm,hcLight:Sm},p("hoverBorder","Border color of the editor hover.")),i1e=F("editorHoverWidget.statusBarBackground",{dark:zs($8,.2),light:Pl($8,.05),hcDark:Fi,hcLight:Fi},p("statusBarBackground","Background color of the editor hover status bar.")),nh=F("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:Z.white,hcLight:Z.black},p("editorInlayHintForeground","Foreground color of inline hints")),oh=F("editorInlayHint.background",{dark:Ee(ym,.1),light:Ee(ym,.1),hcDark:Ee(Z.white,.1),hcLight:Ee(ym,.1)},p("editorInlayHintBackground","Background color of inline hints")),n1e=F("editorInlayHint.typeForeground",{dark:nh,light:nh,hcDark:nh,hcLight:nh},p("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),o1e=F("editorInlayHint.typeBackground",{dark:oh,light:oh,hcDark:oh,hcLight:oh},p("editorInlayHintBackgroundTypes","Background color of inline hints for types")),s1e=F("editorInlayHint.parameterForeground",{dark:nh,light:nh,hcDark:nh,hcLight:nh},p("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),r1e=F("editorInlayHint.parameterBackground",{dark:oh,light:oh,hcDark:oh,hcLight:oh},p("editorInlayHintBackgroundParameter","Background color of inline hints for parameters")),TS=F("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},p("editorLightBulbForeground","The color used for the lightbulb actions icon.")),a1e=F("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon.")),l1e=F("editorLightBulbAi.foreground",{dark:TS,light:TS,hcDark:TS,hcLight:TS},p("editorLightBulbAiForeground","The color used for the lightbulb AI icon.")),c1e=F("editor.snippetTabstopHighlightBackground",{dark:new Z(new vt(124,124,124,.3)),light:new Z(new vt(10,50,100,.2)),hcDark:new Z(new vt(124,124,124,.3)),hcLight:new Z(new vt(10,50,100,.2))},p("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop.")),d1e=F("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},p("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop.")),h1e=F("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},p("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet.")),u1e=F("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new Z(new vt(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},p("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet.")),NS=new Z(new vt(155,185,85,.2)),AS=new Z(new vt(255,0,0,.2)),J8=F("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},p("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),eB=F("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},p("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),f1e=F("diffEditor.insertedLineBackground",{dark:NS,light:NS,hcDark:null,hcLight:null},p("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),g1e=F("diffEditor.removedLineBackground",{dark:AS,light:AS,hcDark:null,hcLight:null},p("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),m1e=F("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},p("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted.")),p1e=F("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},p("diffEditorRemovedLineGutter","Background color for the margin where lines got removed.")),tB=F("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),iB=F("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content.")),_1e=F("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},p("diffEditorInsertedOutline","Outline color for the text that got inserted.")),b1e=F("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},p("diffEditorRemovedOutline","Outline color for text that got removed.")),v1e=F("diffEditor.border",{dark:null,light:null,hcDark:Ct,hcLight:Ct},p("diffEditorBorder","Border color between the two text editors.")),C1e=F("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},p("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.")),w1e=F("diffEditor.unchangedRegionBackground",{dark:"sideBar.background",light:"sideBar.background",hcDark:"sideBar.background",hcLight:"sideBar.background"},p("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor.")),y1e=F("diffEditor.unchangedRegionForeground",{dark:"foreground",light:"foreground",hcDark:"foreground",hcLight:"foreground"},p("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor.")),S1e=F("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},p("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor.")),Va=F("widget.shadow",{dark:Ee(Z.black,.36),light:Ee(Z.black,.16),hcDark:null,hcLight:null},p("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),nB=F("widget.border",{dark:null,light:null,hcDark:Ct,hcLight:Ct},p("widgetBorder","Border color of widgets such as find/replace inside the editor.")),q8=F("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},p("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse")),x1e=F("toolbar.hoverOutline",{dark:null,light:null,hcDark:ni,hcLight:ni},p("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse")),L1e=F("toolbar.activeBackground",{dark:zs(q8,.1),light:Pl(q8,.1),hcDark:null,hcLight:null},p("toolbarActiveBackground","Toolbar background when holding the mouse over actions")),oB=F("breadcrumb.foreground",{light:Ee(at,.8),dark:Ee(at,.8),hcDark:Ee(at,.8),hcLight:Ee(at,.8)},p("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),sB=F("breadcrumb.background",{light:Nn,dark:Nn,hcDark:Nn,hcLight:Nn},p("breadcrumbsBackground","Background color of breadcrumb items.")),qA=F("breadcrumb.focusForeground",{light:Pl(at,.2),dark:zs(at,.1),hcDark:zs(at,.1),hcLight:zs(at,.1)},p("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),rB=F("breadcrumb.activeSelectionForeground",{light:Pl(at,.2),dark:zs(at,.1),hcDark:zs(at,.1),hcLight:zs(at,.1)},p("breadcrumbsSelectedForeground","Color of selected breadcrumb items.")),k1e=F("breadcrumbPicker.background",{light:Fi,dark:Fi,hcDark:Fi,hcLight:Fi},p("breadcrumbsSelectedBackground","Background color of breadcrumb item picker.")),aB=.5,j8=Z.fromHex("#40C8AE").transparent(aB),G8=Z.fromHex("#40A6FF").transparent(aB),Z8=Z.fromHex("#606060").transparent(.4),Gr=.4,Em=1,Lm=F("merge.currentHeaderBackground",{dark:j8,light:j8,hcDark:null,hcLight:null},p("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),D1e=F("merge.currentContentBackground",{dark:Ee(Lm,Gr),light:Ee(Lm,Gr),hcDark:Ee(Lm,Gr),hcLight:Ee(Lm,Gr)},p("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),km=F("merge.incomingHeaderBackground",{dark:G8,light:G8,hcDark:null,hcLight:null},p("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),E1e=F("merge.incomingContentBackground",{dark:Ee(km,Gr),light:Ee(km,Gr),hcDark:Ee(km,Gr),hcLight:Ee(km,Gr)},p("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),Dm=F("merge.commonHeaderBackground",{dark:Z8,light:Z8,hcDark:null,hcLight:null},p("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),I1e=F("merge.commonContentBackground",{dark:Ee(Dm,Gr),light:Ee(Dm,Gr),hcDark:Ee(Dm,Gr),hcLight:Ee(Dm,Gr)},p("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),Im=F("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},p("mergeBorder","Border color on headers and the splitter in inline merge-conflicts.")),T1e=F("editorOverviewRuler.currentContentForeground",{dark:Ee(Lm,Em),light:Ee(Lm,Em),hcDark:Im,hcLight:Im},p("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts.")),N1e=F("editorOverviewRuler.incomingContentForeground",{dark:Ee(km,Em),light:Ee(km,Em),hcDark:Im,hcLight:Im},p("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts.")),A1e=F("editorOverviewRuler.commonContentForeground",{dark:Ee(Dm,Em),light:Ee(Dm,Em),hcDark:Im,hcLight:Im},p("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts.")),M1e=F("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},p("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),R1e=F("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},p("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),lB=F("problemsErrorIcon.foreground",{dark:Wa,light:Wa,hcDark:Wa,hcLight:Wa},p("problemsErrorIconForeground","The color used for the problems error icon.")),cB=F("problemsWarningIcon.foreground",{dark:An,light:An,hcDark:An,hcLight:An},p("problemsWarningIconForeground","The color used for the problems warning icon.")),dB=F("problemsInfoIcon.foreground",{dark:Vo,light:Vo,hcDark:Vo,hcLight:Vo},p("problemsInfoIconForeground","The color used for the problems info icon."))});var ab,U1e,jA,hB,uB,fB,gB,mB,K1e,$1e,q1e,GA=J(()=>{"use strict";_();v();b();Ge();gn();jr();rh();IS();ab=F("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},p("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),U1e=F("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},p("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),jA=F("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},p("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),hB=F("minimap.infoHighlight",{dark:Vo,light:Vo,hcDark:Nm,hcLight:Nm},p("minimapInfo","Minimap marker color for infos.")),uB=F("minimap.warningHighlight",{dark:An,light:An,hcDark:Tm,hcLight:Tm},p("overviewRuleWarning","Minimap marker color for warnings.")),fB=F("minimap.errorHighlight",{dark:new Z(new vt(255,18,18,.7)),light:new Z(new vt(255,18,18,.7)),hcDark:new Z(new vt(255,50,50,1)),hcLight:"#B5200D"},p("minimapError","Minimap marker color for errors.")),gB=F("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},p("minimapBackground","Minimap background color.")),mB=F("minimap.foregroundOpacity",{dark:Z.fromHex("#000f"),light:Z.fromHex("#000f"),hcDark:Z.fromHex("#000f"),hcLight:Z.fromHex("#000f")},p("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.')),K1e=F("minimapSlider.background",{light:Ee(qu,.5),dark:Ee(qu,.5),hcDark:Ee(qu,.5),hcLight:Ee(qu,.5)},p("minimapSliderBackground","Minimap slider background color.")),$1e=F("minimapSlider.hoverBackground",{light:Ee(ju,.5),dark:Ee(ju,.5),hcDark:Ee(ju,.5),hcLight:Ee(ju,.5)},p("minimapSliderHoverBackground","Minimap slider background color when hovering.")),q1e=F("minimapSlider.activeBackground",{light:Ee(Gu,.5),dark:Ee(Gu,.5),hcDark:Ee(Gu,.5),hcLight:Ee(Gu,.5)},p("minimapSliderActiveBackground","Minimap slider background color when clicked on."))});var tCe,iCe,nCe,oCe,sCe,rCe,aCe,lCe,pB=J(()=>{"use strict";_();v();b();Ge();jr();Fc();rh();GA();tCe=F("charts.foreground",{dark:at,light:at,hcDark:at,hcLight:at},p("chartsForeground","The foreground color used in charts.")),iCe=F("charts.lines",{dark:Ee(at,.5),light:Ee(at,.5),hcDark:Ee(at,.5),hcLight:Ee(at,.5)},p("chartsLines","The color used for horizontal lines in charts.")),nCe=F("charts.red",{dark:Wa,light:Wa,hcDark:Wa,hcLight:Wa},p("chartsRed","The red color used in chart visualizations.")),oCe=F("charts.blue",{dark:Vo,light:Vo,hcDark:Vo,hcLight:Vo},p("chartsBlue","The blue color used in chart visualizations.")),sCe=F("charts.yellow",{dark:An,light:An,hcDark:An,hcLight:An},p("chartsYellow","The yellow color used in chart visualizations.")),rCe=F("charts.orange",{dark:ab,light:ab,hcDark:ab,hcLight:ab},p("chartsOrange","The orange color used in chart visualizations.")),aCe=F("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},p("chartsGreen","The green color used in chart visualizations.")),lCe=F("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p("chartsPurple","The purple color used in chart visualizations."))});var _B,bB,vB,CB,_Ce,wB,yB,bCe,SB,xB,LB,kB,DB,EB,IB,TB,NB,Zr,AB,Ha,ah,Am,MB,Mm,RB,PB,OB,MS,FB,BB,vCe,WB,zB,CCe,VB,HB,UB,KB,ZA=J(()=>{"use strict";_();v();b();Ge();gn();jr();Fc();rh();_B=F("input.background",{dark:"#3C3C3C",light:Z.white,hcDark:Z.black,hcLight:Z.white},p("inputBoxBackground","Input box background.")),bB=F("input.foreground",{dark:at,light:at,hcDark:at,hcLight:at},p("inputBoxForeground","Input box foreground.")),vB=F("input.border",{dark:null,light:null,hcDark:Ct,hcLight:Ct},p("inputBoxBorder","Input box border.")),CB=F("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Ct,hcLight:Ct},p("inputBoxActiveOptionBorder","Border color of activated options in input fields.")),_Ce=F("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},p("inputOption.hoverBackground","Background color of activated options in input fields.")),wB=F("inputOption.activeBackground",{dark:Ee(zo,.4),light:Ee(zo,.2),hcDark:Z.transparent,hcLight:Z.transparent},p("inputOption.activeBackground","Background hover color of options in input fields.")),yB=F("inputOption.activeForeground",{dark:Z.white,light:Z.black,hcDark:at,hcLight:at},p("inputOption.activeForeground","Foreground color of activated options in input fields.")),bCe=F("input.placeholderForeground",{light:Ee(at,.5),dark:Ee(at,.5),hcDark:Ee(at,.7),hcLight:Ee(at,.7)},p("inputPlaceholderForeground","Input box foreground color for placeholder text.")),SB=F("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:Z.black,hcLight:Z.white},p("inputValidationInfoBackground","Input validation background color for information severity.")),xB=F("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:at},p("inputValidationInfoForeground","Input validation foreground color for information severity.")),LB=F("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Ct,hcLight:Ct},p("inputValidationInfoBorder","Input validation border color for information severity.")),kB=F("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:Z.black,hcLight:Z.white},p("inputValidationWarningBackground","Input validation background color for warning severity.")),DB=F("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:at},p("inputValidationWarningForeground","Input validation foreground color for warning severity.")),EB=F("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Ct,hcLight:Ct},p("inputValidationWarningBorder","Input validation border color for warning severity.")),IB=F("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:Z.black,hcLight:Z.white},p("inputValidationErrorBackground","Input validation background color for error severity.")),TB=F("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:at},p("inputValidationErrorForeground","Input validation foreground color for error severity.")),NB=F("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Ct,hcLight:Ct},p("inputValidationErrorBorder","Input validation border color for error severity.")),Zr=F("dropdown.background",{dark:"#3C3C3C",light:Z.white,hcDark:Z.black,hcLight:Z.white},p("dropdownBackground","Dropdown background.")),AB=F("dropdown.listBackground",{dark:null,light:null,hcDark:Z.black,hcLight:Z.white},p("dropdownListBackground","Dropdown list background.")),Ha=F("dropdown.foreground",{dark:"#F0F0F0",light:at,hcDark:Z.white,hcLight:at},p("dropdownForeground","Dropdown foreground.")),ah=F("dropdown.border",{dark:Zr,light:"#CECECE",hcDark:Ct,hcLight:Ct},p("dropdownBorder","Dropdown border.")),Am=F("button.foreground",{dark:Z.white,light:Z.white,hcDark:Z.white,hcLight:Z.white},p("buttonForeground","Button foreground color.")),MB=F("button.separator",{dark:Ee(Am,.4),light:Ee(Am,.4),hcDark:Ee(Am,.4),hcLight:Ee(Am,.4)},p("buttonSeparator","Button separator color.")),Mm=F("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},p("buttonBackground","Button background color.")),RB=F("button.hoverBackground",{dark:zs(Mm,.2),light:Pl(Mm,.2),hcDark:Mm,hcLight:Mm},p("buttonHoverBackground","Button background color when hovering.")),PB=F("button.border",{dark:Ct,light:Ct,hcDark:Ct,hcLight:Ct},p("buttonBorder","Button border color.")),OB=F("button.secondaryForeground",{dark:Z.white,light:Z.white,hcDark:Z.white,hcLight:at},p("buttonSecondaryForeground","Secondary button foreground color.")),MS=F("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:Z.white},p("buttonSecondaryBackground","Secondary button background color.")),FB=F("button.secondaryHoverBackground",{dark:zs(MS,.2),light:Pl(MS,.2),hcDark:null,hcLight:null},p("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),BB=F("checkbox.background",{dark:Zr,light:Zr,hcDark:Zr,hcLight:Zr},p("checkbox.background","Background color of checkbox widget.")),vCe=F("checkbox.selectBackground",{dark:Fi,light:Fi,hcDark:Fi,hcLight:Fi},p("checkbox.select.background","Background color of checkbox widget when the element it's in is selected.")),WB=F("checkbox.foreground",{dark:Ha,light:Ha,hcDark:Ha,hcLight:Ha},p("checkbox.foreground","Foreground color of checkbox widget.")),zB=F("checkbox.border",{dark:ah,light:ah,hcDark:ah,hcLight:ah},p("checkbox.border","Border color of checkbox widget.")),CCe=F("checkbox.selectBorder",{dark:ih,light:ih,hcDark:ih,hcLight:ih},p("checkbox.select.border","Border color of checkbox widget when the element it's in is selected.")),VB=F("keybindingLabel.background",{dark:new Z(new vt(128,128,128,.17)),light:new Z(new vt(221,221,221,.4)),hcDark:Z.transparent,hcLight:Z.transparent},p("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),HB=F("keybindingLabel.foreground",{dark:Z.fromHex("#CCCCCC"),light:Z.fromHex("#555555"),hcDark:Z.white,hcLight:at},p("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),UB=F("keybindingLabel.border",{dark:new Z(new vt(51,51,51,.6)),light:new Z(new vt(204,204,204,.4)),hcDark:new Z(new vt(111,195,223)),hcLight:Ct},p("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),KB=F("keybindingLabel.bottomBorder",{dark:new Z(new vt(68,68,68,.6)),light:new Z(new vt(187,187,187,.4)),hcDark:new Z(new vt(111,195,223)),hcLight:at},p("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut."))});var $B,qB,jB,GB,Yr,fr,Yu,ZB,YB,XB,QB,JB,YA,XA,e6,t6,RS,ICe,TCe,NCe,ACe,i6,n6,o6,s6,MCe,RCe,PCe,Rm,r6,a6,l6,PS=J(()=>{"use strict";_();v();b();Ge();gn();jr();Fc();rh();$B=F("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},p("listFocusBackground","List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),qB=F("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("listFocusForeground","List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),jB=F("list.focusOutline",{dark:zo,light:zo,hcDark:ni,hcLight:ni},p("listFocusOutline","List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),GB=F("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},p("listFocusAndSelectionOutline","List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),Yr=F("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:Z.fromHex("#0F4A85").transparent(.1)},p("listActiveSelectionBackground","List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),fr=F("list.activeSelectionForeground",{dark:Z.white,light:Z.white,hcDark:null,hcLight:null},p("listActiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Yu=F("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("listActiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),ZB=F("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:Z.fromHex("#0F4A85").transparent(.1)},p("listInactiveSelectionBackground","List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),YB=F("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("listInactiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),XB=F("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("listInactiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),QB=F("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},p("listInactiveFocusBackground","List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),JB=F("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},p("listInactiveFocusOutline","List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),YA=F("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:Z.white.transparent(.1),hcLight:Z.fromHex("#0F4A85").transparent(.1)},p("listHoverBackground","List/Tree background when hovering over items using the mouse.")),XA=F("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),e6=F("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},p("listDropBackground","List/Tree drag and drop background when moving items over other items when using the mouse.")),t6=F("list.dropBetweenBackground",{dark:ih,light:ih,hcDark:null,hcLight:null},p("listDropBetweenBackground","List/Tree drag and drop border color when moving items between items when using the mouse.")),RS=F("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:zo,hcLight:zo},p("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),ICe=F("list.focusHighlightForeground",{dark:RS,light:W8(Yr,RS,"#BBE7FF"),hcDark:RS,hcLight:RS},p("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.")),TCe=F("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},p("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer.")),NCe=F("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},p("listErrorForeground","Foreground color of list items containing errors.")),ACe=F("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},p("listWarningForeground","Foreground color of list items containing warnings.")),i6=F("listFilterWidget.background",{light:Pl(Fi,0),dark:zs(Fi,0),hcDark:Fi,hcLight:Fi},p("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),n6=F("listFilterWidget.outline",{dark:Z.transparent,light:Z.transparent,hcDark:"#f38518",hcLight:"#007ACC"},p("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),o6=F("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Ct,hcLight:Ct},p("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),s6=F("listFilterWidget.shadow",{dark:Va,light:Va,hcDark:Va,hcLight:Va},p("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees.")),MCe=F("list.filterMatchBackground",{dark:za,light:za,hcDark:null,hcLight:null},p("listFilterMatchHighlight","Background color of the filtered match.")),RCe=F("list.filterMatchBorder",{dark:sh,light:sh,hcDark:Ct,hcLight:ni},p("listFilterMatchHighlightBorder","Border color of the filtered match.")),PCe=F("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},p("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized.")),Rm=F("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},p("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),r6=F("tree.inactiveIndentGuidesStroke",{dark:Ee(Rm,.4),light:Ee(Rm,.4),hcDark:Ee(Rm,.4),hcLight:Ee(Rm,.4)},p("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),a6=F("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},p("tableColumnsBorder","Table border color between columns.")),l6=F("tree.tableOddRowsBackground",{dark:Ee(at,.04),light:Ee(at,.04),hcDark:null,hcLight:null},p("tableOddRowsBackgroundColor","Background color for odd table rows."))});var c6,d6,h6,u6,f6,g6,m6,p6=J(()=>{"use strict";_();v();b();Ge();jr();Fc();ZA();PS();c6=F("menu.border",{dark:null,light:null,hcDark:Ct,hcLight:Ct},p("menuBorder","Border color of menus.")),d6=F("menu.foreground",{dark:Ha,light:Ha,hcDark:Ha,hcLight:Ha},p("menuForeground","Foreground color of menu items.")),h6=F("menu.background",{dark:Zr,light:Zr,hcDark:Zr,hcLight:Zr},p("menuBackground","Background color of menu items.")),u6=F("menu.selectionForeground",{dark:fr,light:fr,hcDark:fr,hcLight:fr},p("menuSelectionForeground","Foreground color of the selected menu item in menus.")),f6=F("menu.selectionBackground",{dark:Yr,light:Yr,hcDark:Yr,hcLight:Yr},p("menuSelectionBackground","Background color of the selected menu item in menus.")),g6=F("menu.selectionBorder",{dark:null,light:null,hcDark:ni,hcLight:ni},p("menuSelectionBorder","Border color of the selected menu item in menus.")),m6=F("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Ct,hcLight:Ct},p("menuSeparatorBackground","Color of a separator menu item in menus."))});var QA,b6,v6,OS,C6,_6,lb,FS,cb,w6=J(()=>{"use strict";_();v();b();Ge();gn();jr();rh();PS();QA=F("quickInput.background",{dark:Fi,light:Fi,hcDark:Fi,hcLight:Fi},p("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),b6=F("quickInput.foreground",{dark:Ba,light:Ba,hcDark:Ba,hcLight:Ba},p("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),v6=F("quickInputTitle.background",{dark:new Z(new vt(255,255,255,.105)),light:new Z(new vt(0,0,0,.06)),hcDark:"#000000",hcLight:Z.white},p("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),OS=F("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:Z.white,hcLight:"#0F4A85"},p("pickerGroupForeground","Quick picker color for grouping labels.")),C6=F("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:Z.white,hcLight:"#0F4A85"},p("pickerGroupBorder","Quick picker color for grouping borders.")),_6=F("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,p("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),lb=F("quickInputList.focusForeground",{dark:fr,light:fr,hcDark:fr,hcLight:fr},p("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),FS=F("quickInputList.focusIconForeground",{dark:Yu,light:Yu,hcDark:Yu,hcLight:Yu},p("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),cb=F("quickInputList.focusBackground",{dark:HA(_6,Yr),light:HA(_6,Yr),hcDark:null,hcLight:null},p("quickInput.listFocusBackground","Quick picker background color for the focused item."))});var swe,rwe,awe,y6=J(()=>{"use strict";_();v();b();Ge();jr();Fc();rh();swe=F("search.resultsInfoForeground",{light:at,dark:Ee(at,.65),hcDark:at,hcLight:at},p("search.resultsInfoForeground","Color of the text in the search viewlet's completion message.")),rwe=F("searchEditor.findMatchBackground",{light:Ee(za,.66),dark:Ee(za,.66),hcDark:za,hcLight:za},p("searchEditor.queryMatch","Color of the Search Editor query matches.")),awe=F("searchEditor.findMatchBorder",{light:Ee(sh,.66),dark:Ee(sh,.66),hcDark:sh,hcLight:sh},p("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."))});var is=J(()=>{"use strict";_();v();b();jr();Fc();pB();rh();ZA();PS();p6();GA();IS();w6();y6()});function Ol(n){return n===Ss.HIGH_CONTRAST_DARK||n===Ss.HIGH_CONTRAST_LIGHT}function Qu(n){return n===Ss.DARK||n===Ss.HIGH_CONTRAST_DARK}var Ss,ch=J(()=>{"use strict";_();v();b();(function(n){n.DARK="dark",n.LIGHT="light",n.HIGH_CONTRAST_DARK="hcDark",n.HIGH_CONTRAST_LIGHT="hcLight"})(Ss||(Ss={}))});var oi,Ka=J(()=>{"use strict";_();v();b();ot();oi=class n{static _nextVisibleColumn(e,t,i){return e===9?n.nextRenderTabStop(t,i):Ys(e)||J_(e)?t+2:t+1}static visibleColumnFromColumn(e,t,i){let o=Math.min(t-1,e.length),s=e.substring(0,o),r=new lu(s),a=0;for(;!r.eol();){let l=Eg(s,o,r.offset);r.nextGraphemeLength(),a=this._nextVisibleColumn(l,a,i)}return a}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;let o=e.length,s=new lu(e),r=0,a=1;for(;!s.eol();){let l=Eg(e,o,s.offset);s.nextGraphemeLength();let c=this._nextVisibleColumn(l,r,i),d=s.offset+1;if(c>=t){let h=t-r;return c-t{"use strict";_();v();b();ye();le();qe();Oo();ch();an=De("themeService");bM={ThemingContribution:"base.contributions.theming"},_M=class{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new B}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),be(()=>{let t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}},N6=new _M;Vt.add(bM.ThemingContribution,N6);lx=class extends H{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}});var vM,CM,RLe,PLe,OLe,FLe,ea,Wl,fx,A6,gx,M6,zl,R6,cx,dx,of,P6,O6,F6,B6,W6,sf,z6,V6,H6,U6,K6,hx,BLe,$6,WLe,zLe,VLe,HLe,q6,j6,ULe,KLe,G6,$Le,qLe,jLe,ux,GLe,Z6,Y6,X6,mx,px,_x,bx,vx,Cx,Q6,J6,eW,tW,iW,nW,oW,sW,rW,aW,lW,cW,dW,ZLe,YLe,$a=J(()=>{"use strict";_();v();b();Ge();gn();is();Qi();vM=F("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},p("lineHighlight","Background color for the highlight of line at the cursor position.")),CM=F("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Ct},p("lineHighlightBorderBox","Background color for the border around the line at the cursor position.")),RLe=F("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},p("rangeHighlight","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0),PLe=F("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:ni,hcLight:ni},p("rangeHighlightBorder","Background color of the border around highlighted ranges.")),OLe=F("editor.symbolHighlightBackground",{dark:za,light:za,hcDark:null,hcLight:null},p("symbolHighlight","Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0),FLe=F("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:ni,hcLight:ni},p("symbolHighlightBorder","Background color of the border around highlighted symbols.")),ea=F("editorCursor.foreground",{dark:"#AEAFAD",light:Z.black,hcDark:Z.white,hcLight:"#0F4A85"},p("caret","Color of the editor cursor.")),Wl=F("editorCursor.background",null,p("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),fx=F("editorMultiCursor.primary.foreground",{dark:ea,light:ea,hcDark:ea,hcLight:ea},p("editorMultiCursorPrimaryForeground","Color of the primary editor cursor when multiple cursors are present.")),A6=F("editorMultiCursor.primary.background",{dark:Wl,light:Wl,hcDark:Wl,hcLight:Wl},p("editorMultiCursorPrimaryBackground","The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),gx=F("editorMultiCursor.secondary.foreground",{dark:ea,light:ea,hcDark:ea,hcLight:ea},p("editorMultiCursorSecondaryForeground","Color of secondary editor cursors when multiple cursors are present.")),M6=F("editorMultiCursor.secondary.background",{dark:Wl,light:Wl,hcDark:Wl,hcLight:Wl},p("editorMultiCursorSecondaryBackground","The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),zl=F("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},p("editorWhitespaces","Color of whitespace characters in the editor.")),R6=F("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:Z.white,hcLight:"#292929"},p("editorLineNumbers","Color of editor line numbers.")),cx=F("editorIndentGuide.background",{dark:zl,light:zl,hcDark:zl,hcLight:zl},p("editorIndentGuides","Color of the editor indentation guides."),!1,p("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),dx=F("editorIndentGuide.activeBackground",{dark:zl,light:zl,hcDark:zl,hcLight:zl},p("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,p("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),of=F("editorIndentGuide.background1",{dark:cx,light:cx,hcDark:cx,hcLight:cx},p("editorIndentGuides1","Color of the editor indentation guides (1).")),P6=F("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorIndentGuides2","Color of the editor indentation guides (2).")),O6=F("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorIndentGuides3","Color of the editor indentation guides (3).")),F6=F("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorIndentGuides4","Color of the editor indentation guides (4).")),B6=F("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorIndentGuides5","Color of the editor indentation guides (5).")),W6=F("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorIndentGuides6","Color of the editor indentation guides (6).")),sf=F("editorIndentGuide.activeBackground1",{dark:dx,light:dx,hcDark:dx,hcLight:dx},p("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),z6=F("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),V6=F("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),H6=F("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),U6=F("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),K6=F("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),hx=F("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:ni,hcLight:ni},p("editorActiveLineNumber","Color of editor active line number"),!1,p("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),BLe=F("editorLineNumber.activeForeground",{dark:hx,light:hx,hcDark:hx,hcLight:hx},p("editorActiveLineNumber","Color of editor active line number")),$6=F("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed.")),WLe=F("editorRuler.foreground",{dark:"#5A5A5A",light:Z.lightgrey,hcDark:Z.white,hcLight:"#292929"},p("editorRuler","Color of the editor rulers.")),zLe=F("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},p("editorCodeLensForeground","Foreground color of editor CodeLens")),VLe=F("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},p("editorBracketMatchBackground","Background color behind matching brackets")),HLe=F("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Ct,hcLight:Ct},p("editorBracketMatchBorder","Color for matching brackets boxes")),q6=F("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},p("editorOverviewRulerBorder","Color of the overview ruler border.")),j6=F("editorOverviewRuler.background",null,p("editorOverviewRulerBackground","Background color of the editor overview ruler.")),ULe=F("editorGutter.background",{dark:Nn,light:Nn,hcDark:Nn,hcLight:Nn},p("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),KLe=F("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:Z.fromHex("#fff").transparent(.8),hcLight:Ct},p("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor.")),G6=F("editorUnnecessaryCode.opacity",{dark:Z.fromHex("#000a"),light:Z.fromHex("#0007"),hcDark:null,hcLight:null},p("unnecessaryCodeOpacity",`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`)),$Le=F("editorGhostText.border",{dark:null,light:null,hcDark:Z.fromHex("#fff").transparent(.8),hcLight:Z.fromHex("#292929").transparent(.8)},p("editorGhostTextBorder","Border color of ghost text in the editor.")),qLe=F("editorGhostText.foreground",{dark:Z.fromHex("#ffffff56"),light:Z.fromHex("#0007"),hcDark:null,hcLight:null},p("editorGhostTextForeground","Foreground color of the ghost text in the editor.")),jLe=F("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},p("editorGhostTextBackground","Background color of the ghost text in the editor.")),ux=new Z(new vt(0,122,204,.6)),GLe=F("editorOverviewRuler.rangeHighlightForeground",{dark:ux,light:ux,hcDark:ux,hcLight:ux},p("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Z6=F("editorOverviewRuler.errorForeground",{dark:new Z(new vt(255,18,18,.7)),light:new Z(new vt(255,18,18,.7)),hcDark:new Z(new vt(255,50,50,1)),hcLight:"#B5200D"},p("overviewRuleError","Overview ruler marker color for errors.")),Y6=F("editorOverviewRuler.warningForeground",{dark:An,light:An,hcDark:Tm,hcLight:Tm},p("overviewRuleWarning","Overview ruler marker color for warnings.")),X6=F("editorOverviewRuler.infoForeground",{dark:Vo,light:Vo,hcDark:Nm,hcLight:Nm},p("overviewRuleInfo","Overview ruler marker color for infos.")),mx=F("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},p("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),px=F("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},p("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),_x=F("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},p("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),bx=F("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),vx=F("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),Cx=F("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),Q6=F("editorBracketHighlight.unexpectedBracket.foreground",{dark:new Z(new vt(255,18,18,.8)),light:new Z(new vt(255,18,18,.8)),hcDark:new Z(new vt(255,50,50,1)),hcLight:""},p("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),J6=F("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),eW=F("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),tW=F("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),iW=F("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),nW=F("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),oW=F("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),sW=F("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),rW=F("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),aW=F("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),lW=F("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),cW=F("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),dW=F("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides.")),ZLe=F("editorUnicodeHighlight.border",{dark:An,light:An,hcDark:An,hcLight:An},p("editorUnicodeHighlight.border","Border color used to highlight unicode characters.")),YLe=F("editorUnicodeHighlight.background",{dark:rb,light:rb,hcDark:rb,hcLight:rb},p("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));Lo((n,e)=>{let t=n.getColor(Nn),i=n.getColor(vM),o=i&&!i.isTransparent()?i:t;o&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${o}; }`)})});function MG(n,e,t){let i=0;for(let s=0;s{"use strict";_();v();b();ot();Ka()});var _e,wb=J(()=>{"use strict";_();v();b();Ge();Oi();(function(n){n.editorSimpleInput=new xe("editorSimpleInput",!1,!0),n.editorTextFocus=new xe("editorTextFocus",!1,p("editorTextFocus","Whether the editor text has focus (cursor is blinking)")),n.focus=new xe("editorFocus",!1,p("editorFocus","Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),n.textInputFocus=new xe("textInputFocus",!1,p("textInputFocus","Whether an editor or a rich text input has focus (cursor is blinking)")),n.readOnly=new xe("editorReadonly",!1,p("editorReadonly","Whether the editor is read-only")),n.inDiffEditor=new xe("inDiffEditor",!1,p("inDiffEditor","Whether the context is a diff editor")),n.isEmbeddedDiffEditor=new xe("isEmbeddedDiffEditor",!1,p("isEmbeddedDiffEditor","Whether the context is an embedded diff editor")),n.inMultiDiffEditor=new xe("inMultiDiffEditor",!1,p("inMultiDiffEditor","Whether the context is a multi diff editor")),n.multiDiffEditorAllCollapsed=new xe("multiDiffEditorAllCollapsed",void 0,p("multiDiffEditorAllCollapsed","Whether all files in multi diff editor are collapsed")),n.hasChanges=new xe("diffEditorHasChanges",!1,p("diffEditorHasChanges","Whether the diff editor has changes")),n.comparingMovedCode=new xe("comparingMovedCode",!1,p("comparingMovedCode","Whether a moved code block is selected for comparison")),n.accessibleDiffViewerVisible=new xe("accessibleDiffViewerVisible",!1,p("accessibleDiffViewerVisible","Whether the accessible diff viewer is visible")),n.diffEditorRenderSideBySideInlineBreakpointReached=new xe("diffEditorRenderSideBySideInlineBreakpointReached",!1,p("diffEditorRenderSideBySideInlineBreakpointReached","Whether the diff editor render side by side inline breakpoint is reached")),n.diffEditorInlineMode=new xe("diffEditorInlineMode",!1,p("diffEditorInlineMode","Whether inline mode is active")),n.diffEditorOriginalWritable=new xe("diffEditorOriginalWritable",!1,p("diffEditorOriginalWritable","Whether modified is writable in the diff editor")),n.diffEditorModifiedWritable=new xe("diffEditorModifiedWritable",!1,p("diffEditorModifiedWritable","Whether modified is writable in the diff editor")),n.diffEditorOriginalUri=new xe("diffEditorOriginalUri","",p("diffEditorOriginalUri","The uri of the original document")),n.diffEditorModifiedUri=new xe("diffEditorModifiedUri","",p("diffEditorModifiedUri","The uri of the modified document")),n.columnSelection=new xe("editorColumnSelection",!1,p("editorColumnSelection","Whether `editor.columnSelection` is enabled")),n.writable=n.readOnly.toNegated(),n.hasNonEmptySelection=new xe("editorHasSelection",!1,p("editorHasSelection","Whether the editor has text selected")),n.hasOnlyEmptySelection=n.hasNonEmptySelection.toNegated(),n.hasMultipleSelections=new xe("editorHasMultipleSelections",!1,p("editorHasMultipleSelections","Whether the editor has multiple selections")),n.hasSingleSelection=n.hasMultipleSelections.toNegated(),n.tabMovesFocus=new xe("editorTabMovesFocus",!1,p("editorTabMovesFocus","Whether `Tab` will move focus out of the editor")),n.tabDoesNotMoveFocus=n.tabMovesFocus.toNegated(),n.isInEmbeddedEditor=new xe("isInEmbeddedEditor",!1,!0),n.canUndo=new xe("canUndo",!1,!0),n.canRedo=new xe("canRedo",!1,!0),n.hoverVisible=new xe("editorHoverVisible",!1,p("editorHoverVisible","Whether the editor hover is visible")),n.hoverFocused=new xe("editorHoverFocused",!1,p("editorHoverFocused","Whether the editor hover is focused")),n.stickyScrollFocused=new xe("stickyScrollFocused",!1,p("stickyScrollFocused","Whether the sticky scroll is focused")),n.stickyScrollVisible=new xe("stickyScrollVisible",!1,p("stickyScrollVisible","Whether the sticky scroll is visible")),n.standaloneColorPickerVisible=new xe("standaloneColorPickerVisible",!1,p("standaloneColorPickerVisible","Whether the standalone color picker is visible")),n.standaloneColorPickerFocused=new xe("standaloneColorPickerFocused",!1,p("standaloneColorPickerFocused","Whether the standalone color picker is focused")),n.inCompositeEditor=new xe("inCompositeEditor",void 0,p("inCompositeEditor","Whether the editor is part of a larger editor (e.g. notebooks)")),n.notInCompositeEditor=n.inCompositeEditor.toNegated(),n.languageId=new xe("editorLangId","",p("editorLangId","The language identifier of the editor")),n.hasCompletionItemProvider=new xe("editorHasCompletionItemProvider",!1,p("editorHasCompletionItemProvider","Whether the editor has a completion item provider")),n.hasCodeActionsProvider=new xe("editorHasCodeActionsProvider",!1,p("editorHasCodeActionsProvider","Whether the editor has a code actions provider")),n.hasCodeLensProvider=new xe("editorHasCodeLensProvider",!1,p("editorHasCodeLensProvider","Whether the editor has a code lens provider")),n.hasDefinitionProvider=new xe("editorHasDefinitionProvider",!1,p("editorHasDefinitionProvider","Whether the editor has a definition provider")),n.hasDeclarationProvider=new xe("editorHasDeclarationProvider",!1,p("editorHasDeclarationProvider","Whether the editor has a declaration provider")),n.hasImplementationProvider=new xe("editorHasImplementationProvider",!1,p("editorHasImplementationProvider","Whether the editor has an implementation provider")),n.hasTypeDefinitionProvider=new xe("editorHasTypeDefinitionProvider",!1,p("editorHasTypeDefinitionProvider","Whether the editor has a type definition provider")),n.hasHoverProvider=new xe("editorHasHoverProvider",!1,p("editorHasHoverProvider","Whether the editor has a hover provider")),n.hasDocumentHighlightProvider=new xe("editorHasDocumentHighlightProvider",!1,p("editorHasDocumentHighlightProvider","Whether the editor has a document highlight provider")),n.hasDocumentSymbolProvider=new xe("editorHasDocumentSymbolProvider",!1,p("editorHasDocumentSymbolProvider","Whether the editor has a document symbol provider")),n.hasReferenceProvider=new xe("editorHasReferenceProvider",!1,p("editorHasReferenceProvider","Whether the editor has a reference provider")),n.hasRenameProvider=new xe("editorHasRenameProvider",!1,p("editorHasRenameProvider","Whether the editor has a rename provider")),n.hasSignatureHelpProvider=new xe("editorHasSignatureHelpProvider",!1,p("editorHasSignatureHelpProvider","Whether the editor has a signature help provider")),n.hasInlayHintsProvider=new xe("editorHasInlayHintsProvider",!1,p("editorHasInlayHintsProvider","Whether the editor has an inline hints provider")),n.hasDocumentFormattingProvider=new xe("editorHasDocumentFormattingProvider",!1,p("editorHasDocumentFormattingProvider","Whether the editor has a document formatting provider")),n.hasDocumentSelectionFormattingProvider=new xe("editorHasDocumentSelectionFormattingProvider",!1,p("editorHasDocumentSelectionFormattingProvider","Whether the editor has a document selection formatting provider")),n.hasMultipleDocumentFormattingProvider=new xe("editorHasMultipleDocumentFormattingProvider",!1,p("editorHasMultipleDocumentFormattingProvider","Whether the editor has multiple document formatting providers")),n.hasMultipleDocumentSelectionFormattingProvider=new xe("editorHasMultipleDocumentSelectionFormattingProvider",!1,p("editorHasMultipleDocumentSelectionFormattingProvider","Whether the editor has multiple document selection formatting providers"))})(_e||(_e={}))});var Gm,FM=J(()=>{"use strict";_();v();b();le();Gm=class extends H{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}});function CW(n,e){let t=0,i=0,o=n.length;for(;i{"use strict";_();v();b()});var Vc,ia,Hc,Kx=J(()=>{"use strict";_();v();b();(function(n){n[n.Disabled=0]="Disabled",n[n.EnabledForActive=1]="EnabledForActive",n[n.Enabled=2]="Enabled"})(Vc||(Vc={}));ia=class{constructor(e,t,i,o,s,r){if(this.visibleColumn=e,this.column=t,this.className=i,this.horizontalLine=o,this.forWrappedLinesAfterColumn=s,this.forWrappedLinesBeforeOrAtColumn=r,e!==-1==(t!==-1))throw new Error}},Hc=class{constructor(e,t){this.top=e,this.endColumn=t}}});var $x,Lb,BM=J(()=>{"use strict";_();v();b();Dl();ot();Ka();Ke();FM();wW();Kx();xt();$x=class extends Gm{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return CW(this.textModel.getLineContent(e+1),this.textModel.getOptions().tabSize)}getActiveIndentGuide(e,t,i){this.assertNotDisposed();let o=this.textModel.getLineCount();if(e<1||e>o)throw new St("Illegal value for lineNumber");let s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(s&&s.offSide),a=-2,l=-1,c=-2,d=-1,h=N=>{if(a!==-1&&(a===-2||a>N-1)){a=-1,l=-1;for(let M=N-2;M>=0;M--){let W=this._computeIndentLevel(M);if(W>=0){a=M,l=W;break}}}if(c===-2){c=-1,d=-1;for(let M=N;M=0){c=M,d=W;break}}}},u=-2,f=-1,g=-2,m=-1,C=N=>{if(u===-2){u=-1,f=-1;for(let M=N-2;M>=0;M--){let W=this._computeIndentLevel(M);if(W>=0){u=M,f=W;break}}}if(g!==-1&&(g===-2||g=0){g=M,m=W;break}}}},S=0,w=!0,y=0,x=!0,k=0,T=0;for(let N=0;w||x;N++){let M=e-N,W=e+N;N>1&&(M<1||M1&&(W>o||W>i)&&(x=!1),N>5e4&&(w=!1,x=!1);let j=-1;if(w&&M>=1){let V=this._computeIndentLevel(M-1);V>=0?(c=M-1,d=V,j=Math.ceil(V/this.textModel.getOptions().indentSize)):(h(M),j=this._getIndentLevelForWhitespaceLine(r,l,d))}let G=-1;if(x&&W<=o){let V=this._computeIndentLevel(W-1);V>=0?(u=W-1,f=V,G=Math.ceil(V/this.textModel.getOptions().indentSize)):(C(W),G=this._getIndentLevelForWhitespaceLine(r,f,m))}if(N===0){T=j;continue}if(N===1){if(W<=o&&G>=0&&T+1===G){w=!1,S=W,y=W,k=G;continue}if(M>=1&&j>=0&&j-1===T){x=!1,S=M,y=M,k=j;continue}if(S=e,y=e,k=T,k===0)return{startLineNumber:S,endLineNumber:y,indent:k}}w&&(j>=k?S=M:w=!1),x&&(G>=k?y=W:x=!1)}return{startLineNumber:S,endLineNumber:y,indent:k}}getLinesBracketGuides(e,t,i,o){var s;let r=[];for(let u=e;u<=t;u++)r.push([]);let a=!0,l=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new P(e,1,t,this.textModel.getLineMaxColumn(t))).toArray(),c;if(i&&l.length>0){let u=(e<=i.lineNumber&&i.lineNumber<=t?l:this.textModel.bracketPairs.getBracketPairsInRange(P.fromPositions(i)).toArray()).filter(f=>P.strictContainsPosition(f.range,i));c=(s=Mu(u,f=>a||f.range.startLineNumber!==f.range.endLineNumber))===null||s===void 0?void 0:s.range}let d=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,h=new Lb;for(let u of l){if(!u.closingBracketRange)continue;let f=c&&u.range.equalsRange(c);if(!f&&!o.includeInactive)continue;let g=h.getInlineClassName(u.nestingLevel,u.nestingLevelOfEqualBracketType,d)+(o.highlightActive&&f?" "+h.activeClassName:""),m=u.openingBracketRange.getStartPosition(),C=u.closingBracketRange.getStartPosition(),S=o.horizontalGuides===Vc.Enabled||o.horizontalGuides===Vc.EnabledForActive&&f;if(u.range.startLineNumber===u.range.endLineNumber){a&&S&&r[u.range.startLineNumber-e].push(new ia(-1,u.openingBracketRange.getEndPosition().column,g,new Hc(!1,C.column),-1,-1));continue}let w=this.getVisibleColumnFromPosition(C),y=this.getVisibleColumnFromPosition(u.openingBracketRange.getStartPosition()),x=Math.min(y,w,u.minVisibleColumnIndentation+1),k=!1;Ri(this.textModel.getLineContent(u.closingBracketRange.startLineNumber))=e&&y>x&&r[m.lineNumber-e].push(new ia(x,-1,g,new Hc(!1,m.column),-1,-1)),C.lineNumber<=t&&w>x&&r[C.lineNumber-e].push(new ia(x,-1,g,new Hc(!k,C.column),-1,-1)))}for(let u of r)u.sort((f,g)=>f.visibleColumn-g.visibleColumn);return r}getVisibleColumnFromPosition(e){return oi.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();let i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");let o=this.textModel.getOptions(),s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(s&&s.offSide),a=new Array(t-e+1),l=-2,c=-1,d=-2,h=-1;for(let u=e;u<=t;u++){let f=u-e,g=this._computeIndentLevel(u-1);if(g>=0){l=u-1,c=g,a[f]=Math.ceil(g/o.indentSize);continue}if(l===-2){l=-1,c=-1;for(let m=u-2;m>=0;m--){let C=this._computeIndentLevel(m);if(C>=0){l=m,c=C;break}}}if(d!==-1&&(d===-2||d=0){d=m,h=C;break}}}a[f]=this._getIndentLevelForWhitespaceLine(r,c,h)}return a}_getIndentLevelForWhitespaceLine(e,t,i){let o=this.textModel.getOptions();return t===-1||i===-1?0:t{"use strict";_();v();b();_L=class{constructor(){this.changeType=1}},Ls=class n{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",o=0;for(let s of t)i+=e.substring(o,s.column-1),o=s.column-1,i+=s.options.content;return i+=e.substring(o),i}static fromDecorations(e){let t=[];for(let i of e)i.options.before&&i.options.before.content.length>0&&t.push(new n(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new n(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((i,o)=>i.lineNumber===o.lineNumber?i.column===o.column?i.order-o.order:i.column-o.column:i.lineNumber-o.lineNumber),t}constructor(e,t,i,o,s){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=o,this.order=s}},Ab=class{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}},bL=class{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}},vL=class{constructor(e,t,i,o){this.changeType=4,this.injectedTexts=o,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}},CL=class{constructor(){this.changeType=5}},pf=class n{constructor(e,t,i,o){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=o,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;t{"use strict";_();v();b()});var Mb,JM,SL,IW=J(()=>{"use strict";_();v();b();Mb=class{constructor(e,t,i,o){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=i,this.isInvalid=o}},JM=class{constructor(e,t,i,o,s,r){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=o,this.nestingLevelOfEqualBracketType=s,this.bracketPairNode=r}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}},SL=class extends JM{constructor(e,t,i,o,s,r,a){super(e,t,i,o,s,r),this.minVisibleColumnIndentation=a}}});function TW(n,e,t,i){return n!==t?bi(t-n,i):bi(0,i-e)}function ip(n){return n===0}function bi(n,e){return n*Vs+e}function Ho(n){let e=n,t=Math.floor(e/Vs),i=e-t*Vs;return new ws(t,i)}function NW(n){return Math.floor(n/Vs)}function vi(n,e){let t=n+e;return e>=Vs&&(t=t-n%Vs),t}function AW(n,e){return n.reduce((t,i)=>vi(t,e(i)),Fn)}function eR(n,e){return n===e}function _f(n,e){let t=n,i=e;if(i-t<=0)return Fn;let s=Math.floor(t/Vs),r=Math.floor(i/Vs),a=i-r*Vs;if(s===r){let l=t-s*Vs;return bi(0,a-l)}else return bi(r-s,a)}function Kc(n,e){return n=e}function Ch(n){return bi(n.lineNumber-1,n.column-1)}function wh(n,e){let t=n,i=Math.floor(t/Vs),o=t-i*Vs,s=e,r=Math.floor(s/Vs),a=s-r*Vs;return new P(i+1,o+1,r+1,a+1)}function MW(n){let e=Tr(n);return bi(e.length-1,e[e.length-1].length)}var Fn,Vs,$c=J(()=>{"use strict";_();v();b();ot();Ke();om();Fn=0;Vs=2**26});var oa,xL,tR,Rb=J(()=>{"use strict";_();v();b();Ke();$c();oa=class n{static fromModelContentChanges(e){return e.map(i=>{let o=P.lift(i.range);return new n(Ch(o.getStartPosition()),Ch(o.getEndPosition()),MW(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${Ho(this.startOffset)}...${Ho(this.endOffset)}) -> ${Ho(this.newLength)}`}},xL=class{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>tR.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);let t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return i===null?null:_f(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?bi(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):bi(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){let t=Ho(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?bi(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):bi(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx{"use strict";_();v();b();LL=[],_n=class n{static create(e,t){if(e<=128&&t.length===0){let i=n.cache[e];return i||(i=new n(e,t),n.cache[e]=i),i}return new n(e,t)}static getEmpty(){return this.empty}constructor(e,t){this.items=e,this.additionalItems=t}add(e,t){let i=t.getKey(e),o=i>>5;if(o===0){let r=1<{"use strict";_();v();b();xt();Ka();$c();op();Pb=class{get length(){return this._length}constructor(e){this._length=e}},Ob=class n extends Pb{static create(e,t,i){let o=e.length;return t&&(o=vi(o,t.length)),i&&(o=vi(o,i.length)),new n(o,e,t,i,t?t.missingOpeningBracketIds:_n.getEmpty())}get kind(){return 2}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){let e=[];return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}constructor(e,t,i,o,s){super(e),this.openingBracket=t,this.child=i,this.closingBracket=o,this.missingOpeningBracketIds=s}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}deepClone(){return new n(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(vi(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}},Hs=class extends Pb{static create23(e,t,i,o=!1){let s=e.length,r=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(s=vi(s,t.length),r=r.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");s=vi(s,i.length),r=r.merge(i.missingOpeningBracketIds)}return o?new nR(s,e.listHeight+1,e,t,i,r):new Fb(s,e.listHeight+1,e,t,i,r)}static getEmpty(){return new oR(Fn,0,[],_n.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}constructor(e,t,i){super(e),this.listHeight=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();let e=this.childrenLength;if(e===0)return;let t=this.getChild(e-1),i=t.kind===4?t.toMutable():t;return t!==i&&this.setChild(e-1,i),i}makeFirstElementMutable(){if(this.throwIfImmutable(),this.childrenLength===0)return;let t=this.getChild(0),i=t.kind===4?t.toMutable():t;return t!==i&&this.setChild(0,i),i}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds)||this.childrenLength===0)return!1;let t=this;for(;t.kind===4;){let i=t.childrenLength;if(i===0)throw new St;t=t.getChild(i-1)}return t.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();let e=this.childrenLength,t=this.getChild(0).length,i=this.getChild(0).missingOpeningBracketIds;for(let o=1;o{"use strict";_();v();b();xt();um();zb();$c();op();Ga=class{constructor(e,t,i,o,s){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=o,this.astNode=s}},IL=class{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new sR(this.textModel,this.bracketTokens),this._offset=Fn,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return bi(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=vi(this._offset,e);let t=Ho(this._offset);this.reader.setPosition(t.lineCount,t.columnCount)}read(){let e;return this.peeked?(this.didPeek=!1,e=this.peeked):e=this.reader.read(),e&&(this._offset=vi(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}},sR=class{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}setPosition(e,t){e===this.lineIdx?(this.lineCharOffset=t,this.line!==null&&(this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))):(this.lineIdx=e,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){let s=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=s.length,s}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));let e=this.lineIdx,t=this.lineCharOffset,i=0;for(;;){let s=this.lineTokens,r=s.getCount(),a=null;if(this.lineTokenOffset1e3))break;if(i>1500)break}let o=TW(e,t,this.lineIdx,this.lineCharOffset);return new Ga(o,0,-1,_n.getEmpty(),new ja(o))}},TL=class{constructor(e,t){this.text=e,this._offset=Fn,this.idx=0;let i=t.getRegExpStr(),o=i?new RegExp(i+`| +`,"gi"):null,s=[],r,a=0,l=0,c=0,d=0,h=[];for(let g=0;g<60;g++)h.push(new Ga(bi(0,g),0,-1,_n.getEmpty(),new ja(bi(0,g))));let u=[];for(let g=0;g<60;g++)u.push(new Ga(bi(1,g),0,-1,_n.getEmpty(),new ja(bi(1,g))));if(o)for(o.lastIndex=0;(r=o.exec(e))!==null;){let g=r.index,m=r[0];if(m===` +`)a++,l=g+1;else{if(c!==g){let C;if(d===a){let S=g-c;if(S{"use strict";_();v();b();ot();zb();$c();op();rR();aR=class n{static createFromLanguage(e,t){function i(s){return t.getKey(`${s.languageId}:::${s.bracketText}`)}let o=new Map;for(let s of e.bracketsNew.openingBrackets){let r=bi(0,s.bracketText.length),a=i(s),l=_n.getEmpty().add(a,iR);o.set(s.bracketText,new Ga(r,1,a,l,Wb.create(r,s,l)))}for(let s of e.bracketsNew.closingBrackets){let r=bi(0,s.bracketText.length),a=_n.getEmpty(),l=s.getOpeningBrackets();for(let c of l)a=a.add(i(c),iR);o.set(s.bracketText,new Ga(r,2,i(l[0]),a,Wb.create(r,s,a)))}return new n(o)}constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}getRegExpStr(){if(this.isEmpty)return null;{let e=[...this.map.keys()];return e.sort(),e.reverse(),e.map(t=>JG(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){let e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(let[t,i]of this.map)if(i.kind===2&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}};NL=class{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=aR.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}});function OW(n){if(n.length===0)return null;if(n.length===1)return n[0];let e=0;function t(){if(e>=n.length)return null;let r=e,a=n[r].listHeight;for(e++;e=2?cR(r===0&&e===n.length?n:n.slice(r,e),!1):n[r]}let i=t(),o=t();if(!o)return i;for(let r=t();r;r=t())PW(i,o)<=PW(o,r)?(i=lR(i,o),o=r):o=lR(o,r);return lR(i,o)}function cR(n,e=!1){if(n.length===0)return null;if(n.length===1)return n[0];let t=n.length;for(;t>3;){let i=t>>1;for(let o=0;o=3?n[2]:null,e)}function PW(n,e){return Math.abs(n.listHeight-e.listHeight)}function lR(n,e){return n.listHeight===e.listHeight?Hs.create23(n,e,null,!1):n.listHeight>e.listHeight?eZ(n,e):tZ(e,n)}function eZ(n,e){n=n.toMutable();let t=n,i=[],o;for(;;){if(e.listHeight===t.listHeight){o=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let s=i.length-1;s>=0;s--){let r=i[s];o?r.childrenLength>=3?o=Hs.create23(r.unappendChild(),o,null,!1):(r.appendChildOfSameHeight(o),o=void 0):r.handleChildrenChanged()}return o?Hs.create23(n,o,null,!1):n}function tZ(n,e){n=n.toMutable();let t=n,i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let o=e;for(let s=i.length-1;s>=0;s--){let r=i[s];o?r.childrenLength>=3?o=Hs.create23(o,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(o),o=void 0):r.handleChildrenChanged()}return o?Hs.create23(o,n,null,!1):n}var FW=J(()=>{"use strict";_();v();b();zb()});function dR(n,e=-1){for(;;){if(e++,e>=n.childrenLength)return-1;if(n.getChild(e))return e}}function Vb(n){return n.length>0?n[n.length-1]:void 0}var AL,BW=J(()=>{"use strict";_();v();b();$c();AL=class{constructor(e){this.lastOffset=Fn,this.nextNodes=[e],this.offsets=[Fn],this.idxs=[]}readLongestNodeAt(e,t){if(Kc(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){let i=Vb(this.nextNodes);if(!i)return;let o=Vb(this.offsets);if(Kc(e,o))return;if(Kc(o,e))if(vi(o,i.length)<=e)this.nextNodeAfterCurrent();else{let s=dR(i);s!==-1?(this.nextNodes.push(i.getChild(s)),this.offsets.push(o),this.idxs.push(s)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{let s=dR(i);if(s===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(s)),this.offsets.push(o),this.idxs.push(s)}}}}nextNodeAfterCurrent(){for(;;){let e=Vb(this.offsets),t=Vb(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;let i=Vb(this.nextNodes),o=dR(i,this.idxs[this.idxs.length-1]);if(o!==-1){this.nextNodes.push(i.getChild(o)),this.offsets.push(vi(e,t.length)),this.idxs[this.idxs.length-1]=o;break}else this.idxs.pop()}}}});function uR(n,e,t,i){return new hR(n,e,t,i).parseDocument()}var hR,WW=J(()=>{"use strict";_();v();b();zb();Rb();op();$c();FW();BW();hR=class{constructor(e,t,i,o){if(this.tokenizer=e,this.createImmutableLists=o,this._itemsConstructed=0,this._itemsFromCache=0,i&&o)throw new Error("Not supported");this.oldNodeReader=i?new AL(i):void 0,this.positionMapper=new xL(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(_n.getEmpty(),0);return e||(e=Hs.getEmpty()),e}parseList(e,t){let i=[];for(;;){let s=this.tryReadChildFromCache(e);if(!s){let r=this.tokenizer.peek();if(!r||r.kind===2&&r.bracketIds.intersects(e))break;s=this.parseChild(e,t+1)}s.kind===4&&s.childrenLength===0||i.push(s)}return this.oldNodeReader?OW(i):cR(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){let t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!ip(t)){let i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),o=>t!==null&&!Kc(o.length,t)?!1:o.canBeReused(e));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;let i=this.tokenizer.read();switch(i.kind){case 2:return new EL(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new ja(i.length);let o=e.merge(i.bracketIds),s=this.parseList(o,t+1),r=this.tokenizer.peek();return r&&r.kind===2&&(r.bracketId===i.bracketId||r.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),Ob.create(i.astNode,s,r.astNode)):Ob.create(i.astNode,s,null)}default:throw new Error("unexpected")}}}});function sp(n,e){if(n.length===0)return e;if(e.length===0)return n;let t=new mo(zW(n)),i=zW(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let o=t.dequeue();function s(c){if(c===void 0){let h=t.takeWhile(u=>!0)||[];return o&&h.unshift(o),h}let d=[];for(;o&&!ip(c);){let[h,u]=o.splitAt(c);d.push(h),c=_f(h.lengthAfter,c),o=u??t.dequeue()}return ip(c)||d.push(new Hb(!1,c,c)),d}let r=[];function a(c,d,h){if(r.length>0&&eR(r[r.length-1].endOffset,c)){let u=r[r.length-1];r[r.length-1]=new oa(u.startOffset,d,vi(u.newLength,h))}else r.push({startOffset:c,endOffset:d,newLength:h})}let l=Fn;for(let c of i){let d=s(c.lengthBefore);if(c.modified){let h=AW(d,f=>f.lengthBefore),u=vi(l,h);a(l,u,c.lengthAfter),l=u}else for(let h of d){let u=l;l=vi(l,h.lengthBefore),h.modified&&a(u,l,h.lengthAfter)}}return r}function zW(n){let e=[],t=Fn;for(let i of n){let o=_f(t,i.startOffset);ip(o)||e.push(new Hb(!1,o,o));let s=_f(i.startOffset,i.endOffset);e.push(new Hb(!0,s,i.newLength)),t=i.endOffset}return e}var Hb,fR=J(()=>{"use strict";_();v();b();wt();Rb();$c();Hb=class n{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){let t=_f(e,this.lengthAfter);return eR(t,Fn)?[this,void 0]:this.modified?[new n(this.modified,this.lengthBefore,e),new n(this.modified,Fn,t)]:[new n(this.modified,e,e),new n(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${Ho(this.lengthBefore)} -> ${Ho(this.lengthAfter)}`}}});function VW(n,e,t,i){if(n.kind===4||n.kind===2){let o=[];for(let s of n.children)t=vi(e,s.length),o.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let s=o.length-1;s>=0;s--){let{nodeOffsetStart:r,nodeOffsetEnd:a}=o[s];if(Kc(r,i)){let l=VW(n.children[s],r,a,i);if(l)return l}}return null}else{if(n.kind===3)return null;if(n.kind===1){let o=wh(e,t);return{bracketInfo:n.bracketInfo,range:o}}}return null}function HW(n,e,t,i){if(n.kind===4||n.kind===2){for(let o of n.children){if(t=vi(e,o.length),Kc(i,t)){let s=HW(o,e,t,i);if(s)return s}e=t}return null}else{if(n.kind===3)return null;if(n.kind===1){let o=wh(e,t);return{bracketInfo:n.bracketInfo,range:o}}}return null}function gR(n,e,t,i,o,s,r,a,l,c,d=!1){if(r>200)return!0;e:for(;;)switch(n.kind){case 4:{let h=n.childrenLength;for(let u=0;u200)return!0;let c=!0;if(n.kind===2){let d=0;if(a){let f=a.get(n.openingBracket.text);f===void 0&&(f=0),d=f,f++,a.set(n.openingBracket.text,f)}let h=vi(e,n.openingBracket.length),u=-1;if(s.includeMinIndentation&&(u=n.computeMinIndentation(e,s.textModel)),c=s.push(new SL(wh(e,t),wh(e,h),n.closingBracket?wh(vi(h,((l=n.child)===null||l===void 0?void 0:l.length)||Fn),t):void 0,r,d,n,u)),e=h,c&&n.child){let f=n.child;if(t=vi(e,f.length),vh(e,o)&&np(t,i)&&(c=pR(f,e,t,i,o,s,r+1,a),!c))return!1}a?.set(n.openingBracket.text,d)}else{let d=e;for(let h of n.children){let u=d;if(d=vi(d,h.length),vh(u,o)&&vh(i,d)&&(c=pR(h,u,d,i,o,s,r,a),!c))return!1}}return c}var ML,mR,UW=J(()=>{"use strict";_();v();b();ye();le();IW();Rb();RW();$c();WW();op();rR();wt();fR();ML=class extends H{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new B,this.denseKeyProvider=new kL,this.brackets=new NL(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{let i=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),o=new TL(this.textModel.getValue(),i);this.initialAstWithoutTokens=uR(o,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){let e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){let t=e.map(i=>new oa(bi(i.fromLineNumber-1,0),bi(i.toLineNumber,0),bi(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){let t=oa.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){let i=sp(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=sp(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){let s=t,r=new IL(this.textModel,this.brackets);return uR(r,e,s,i)}getBracketsInRange(e,t){this.flushQueue();let i=bi(e.startLineNumber-1,e.startColumn-1),o=bi(e.endLineNumber-1,e.endColumn-1);return new ga(s=>{let r=this.initialAstWithoutTokens||this.astWithTokens;gR(r,Fn,r.length,i,o,s,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();let i=Ch(e.getStartPosition()),o=Ch(e.getEndPosition());return new ga(s=>{let r=this.initialAstWithoutTokens||this.astWithTokens,a=new mR(s,t,this.textModel);pR(r,Fn,r.length,i,o,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();let t=this.initialAstWithoutTokens||this.astWithTokens;return HW(t,Fn,t.length,Ch(e))}getFirstBracketBefore(e){this.flushQueue();let t=this.initialAstWithoutTokens||this.astWithTokens;return VW(t,Fn,t.length,Ch(e))}};mR=class{constructor(e,t,i){this.push=e,this.includeMinIndentation=t,this.textModel=i}}});function iZ(n,e){return{object:n,dispose:()=>e?.dispose()}}function _R(n){if(typeof n>"u")return()=>!0;{let e=Date.now();return()=>Date.now()-e<=n}}function RL(n){return n instanceof Za?null:n}var PL,Za,KW=J(()=>{"use strict";_();v();b();wt();ye();le();Ke();Su();Dy();UW();PL=class extends H{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new no),this.onDidChangeEmitter=new B,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(i=>{var o;(!i.languageId||!((o=this.bracketPairsTree.value)===null||o===void 0)&&o.object.didLanguageChange(i.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;(e=this.bracketPairsTree.value)===null||e===void 0||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){let e=new ae;this.bracketPairsTree.value=iZ(e.add(new ML(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!1))||ga.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!0))||ga.empty}getBracketsInRange(e,t=!1){var i;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((i=this.bracketPairsTree.value)===null||i===void 0?void 0:i.object.getBracketsInRange(e,t))||ga.empty}findMatchingBracketUp(e,t,i){let o=this.textModel.validatePosition(t),s=this.textModel.getLanguageIdAtPosition(o.lineNumber,o.column);if(this.canBuildAST){let r=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew.getClosingBracketInfo(e);if(!r)return null;let a=this.getBracketPairsInRange(P.fromPositions(t,t)).findLast(l=>r.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{let r=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(s).brackets;if(!a)return null;let l=a.textIsBracket[r];return l?RL(this._findMatchingBracketUp(l,o,_R(i))):null}}matchBracket(e,t){if(this.canBuildAST){let i=this.getBracketPairsInRange(P.fromPositions(e,e)).filter(o=>o.closingBracketRange!==void 0&&(o.openingBracketRange.containsPosition(e)||o.closingBracketRange.containsPosition(e))).findLastMaxBy(Io(o=>o.openingBracketRange.containsPosition(e)?o.openingBracketRange:o.closingBracketRange,P.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{let i=_R(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,o){let s=t.getCount(),r=t.getLanguageId(o),a=Math.max(0,e.column-1-i.maxBracketLength);for(let c=o-1;c>=0;c--){let d=t.getEndOffset(c);if(d<=a)break;if(Vr(t.getStandardTokenType(c))||t.getLanguageId(c)!==r){a=d;break}}let l=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let c=o+1;c=l)break;if(Vr(t.getStandardTokenType(c))||t.getLanguageId(c)!==r){l=d;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){let i=e.lineNumber,o=this.textModel.tokenization.getLineTokens(i),s=this.textModel.getLineContent(i),r=o.findTokenIndexAtOffset(e.column-1);if(r<0)return null;let a=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId(r)).brackets;if(a&&!Vr(o.getStandardTokenType(r))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,o,a,r),d=null;for(;;){let h=Jo.findNextBracketInRange(a.forwardRegex,i,s,l,c);if(!h)break;if(h.startColumn<=e.column&&e.column<=h.endColumn){let u=s.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),f=this._matchFoundBracket(h,a.textIsBracket[u],a.textIsOpenBracket[u],t);if(f){if(f instanceof Za)return null;d=f}}l=h.endColumn-1}if(d)return d}if(r>0&&o.getStartOffset(r)===e.column-1){let l=r-1,c=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId(l)).brackets;if(c&&!Vr(o.getStandardTokenType(l))){let{searchStartOffset:d,searchEndOffset:h}=this._establishBracketSearchOffsets(e,o,c,l),u=Jo.findPrevBracketInRange(c.reversedRegex,i,s,d,h);if(u&&u.startColumn<=e.column&&e.column<=u.endColumn){let f=s.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),g=this._matchFoundBracket(u,c.textIsBracket[f],c.textIsOpenBracket[f],t);if(g)return g instanceof Za?null:g}}}return null}_matchFoundBracket(e,t,i,o){if(!t)return null;let s=i?this._findMatchingBracketDown(t,e.getEndPosition(),o):this._findMatchingBracketUp(t,e.getStartPosition(),o);return s?s instanceof Za?s:[e,s]:null}_findMatchingBracketUp(e,t,i){let o=e.languageId,s=e.reversedRegex,r=-1,a=0,l=(c,d,h,u)=>{for(;;){if(i&&++a%100===0&&!i())return Za.INSTANCE;let f=Jo.findPrevBracketInRange(s,c,d,h,u);if(!f)break;let g=d.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(g)?r++:e.isClose(g)&&r--,r===0)return f;u=f.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){let d=this.textModel.tokenization.getLineTokens(c),h=d.getCount(),u=this.textModel.getLineContent(c),f=h-1,g=u.length,m=u.length;c===t.lineNumber&&(f=d.findTokenIndexAtOffset(t.column-1),g=t.column-1,m=t.column-1);let C=!0;for(;f>=0;f--){let S=d.getLanguageId(f)===o&&!Vr(d.getStandardTokenType(f));if(S)C?g=d.getStartOffset(f):(g=d.getStartOffset(f),m=d.getEndOffset(f));else if(C&&g!==m){let w=l(c,u,g,m);if(w)return w}C=S}if(C&&g!==m){let S=l(c,u,g,m);if(S)return S}}return null}_findMatchingBracketDown(e,t,i){let o=e.languageId,s=e.forwardRegex,r=1,a=0,l=(d,h,u,f)=>{for(;;){if(i&&++a%100===0&&!i())return Za.INSTANCE;let g=Jo.findNextBracketInRange(s,d,h,u,f);if(!g)break;let m=h.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(m)?r++:e.isClose(m)&&r--,r===0)return g;u=g.endColumn-1}return null},c=this.textModel.getLineCount();for(let d=t.lineNumber;d<=c;d++){let h=this.textModel.tokenization.getLineTokens(d),u=h.getCount(),f=this.textModel.getLineContent(d),g=0,m=0,C=0;d===t.lineNumber&&(g=h.findTokenIndexAtOffset(t.column-1),m=t.column-1,C=t.column-1);let S=!0;for(;g=1;a--){let l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),d=this.textModel.getLineContent(a),h=c-1,u=d.length,f=d.length;if(a===i.lineNumber){h=l.findTokenIndexAtOffset(i.column-1),u=i.column-1,f=i.column-1;let m=l.getLanguageId(h);o!==m&&(o=m,s=this.languageConfigurationService.getLanguageConfiguration(o).brackets,r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let g=!0;for(;h>=0;h--){let m=l.getLanguageId(h);if(o!==m){if(s&&r&&g&&u!==f){let S=Jo.findPrevBracketInRange(s.reversedRegex,a,d,u,f);if(S)return this._toFoundBracket(r,S);g=!1}o=m,s=this.languageConfigurationService.getLanguageConfiguration(o).brackets,r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew}let C=!!s&&!Vr(l.getStandardTokenType(h));if(C)g?u=l.getStartOffset(h):(u=l.getStartOffset(h),f=l.getEndOffset(h));else if(r&&s&&g&&u!==f){let S=Jo.findPrevBracketInRange(s.reversedRegex,a,d,u,f);if(S)return this._toFoundBracket(r,S)}g=C}if(r&&s&&g&&u!==f){let m=Jo.findPrevBracketInRange(s.reversedRegex,a,d,u,f);if(m)return this._toFoundBracket(r,m)}}return null}findNextBracket(e){var t;let i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getFirstBracketAfter(i))||null;let o=this.textModel.getLineCount(),s=null,r=null,a=null;for(let l=i.lineNumber;l<=o;l++){let c=this.textModel.tokenization.getLineTokens(l),d=c.getCount(),h=this.textModel.getLineContent(l),u=0,f=0,g=0;if(l===i.lineNumber){u=c.findTokenIndexAtOffset(i.column-1),f=i.column-1,g=i.column-1;let C=c.getLanguageId(u);s!==C&&(s=C,r=this.languageConfigurationService.getLanguageConfiguration(s).brackets,a=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew)}let m=!0;for(;um.closingBracketRange!==void 0&&m.range.strictContainsRange(f));return g?[g.openingBracketRange,g.closingBracketRange]:null}let o=_R(t),s=this.textModel.getLineCount(),r=new Map,a=[],l=(f,g)=>{if(!r.has(f)){let m=[];for(let C=0,S=g?g.brackets.length:0;C{for(;;){if(o&&++c%100===0&&!o())return Za.INSTANCE;let w=Jo.findNextBracketInRange(f.forwardRegex,g,m,C,S);if(!w)break;let y=m.substring(w.startColumn-1,w.endColumn-1).toLowerCase(),x=f.textIsBracket[y];if(x&&(x.isOpen(y)?a[x.index]++:x.isClose(y)&&a[x.index]--,a[x.index]===-1))return this._matchFoundBracket(w,x,!1,o);C=w.endColumn-1}return null},h=null,u=null;for(let f=i.lineNumber;f<=s;f++){let g=this.textModel.tokenization.getLineTokens(f),m=g.getCount(),C=this.textModel.getLineContent(f),S=0,w=0,y=0;if(f===i.lineNumber){S=g.findTokenIndexAtOffset(i.column-1),w=i.column-1,y=i.column-1;let k=g.getLanguageId(S);h!==k&&(h=k,u=this.languageConfigurationService.getLanguageConfiguration(h).brackets,l(h,u))}let x=!0;for(;S{"use strict";_();v();b();ye();le();Ke();$a();Qi();OL=class extends H{constructor(e){super(),this.textModel=e,this.colorProvider=new FL,this.onDidChangeEmitter=new B,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,o){return o?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(r=>({id:`bracket${r.range.toString()}-${r.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(r,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:r.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new P(1,1,this.textModel.getLineCount(),1),e,t):[]}},FL=class{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}};Lo((n,e)=>{let t=[mx,px,_x,bx,vx,Cx],i=new FL;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${n.getColor(Q6)}; }`);let o=t.map(s=>n.getColor(s)).filter(s=>!!s).filter(s=>!s.isTransparent());for(let s=0;s<30;s++){let r=o[s%o.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(s)} { color: ${r}; }`)}})});function BL(n){return n.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}function qW(n,e){return n===null||n.length===0?e:new bR(n,e).compress()}var Us,bR,vR=J(()=>{"use strict";_();v();b();A0();xu();Us=class n{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,o){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=o}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${BL(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${BL(this.oldText)}")`:`(replace@${this.oldPosition} "${BL(this.oldText)}" with "${BL(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){let o=t.length;sr(e,o,i),i+=4;for(let s=0;sn.length)return!1;if(t){if(!Dg(n,e))return!1;if(e.length===n.length)return!0;let s=e.length;return e.charAt(e.length-1)===i&&s--,n.charAt(s)===i}return e.charAt(e.length-1)!==i&&(e+=i),n.indexOf(e)===0}function GW(n){return n>=65&&n<=90||n>=97&&n<=122}function fFe(n,e=Li){return e?GW(n.charCodeAt(0))&&n.charCodeAt(1)===58:!1}var yR=J(()=>{"use strict";_();v();b();wc();Lt();ot()});function qc(n){return U_(n,!0)}var Kb,gi,wFe,yFe,XW,SFe,xFe,LFe,qb,kFe,QW,DFe,JW,EFe,SR,IFe,ZW,YW,TFe,NFe,$b,bf=J(()=>{"use strict";_();v();b();yR();er();wc();Lt();ot();sn();Kb=class{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:G_(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===Ze.file)return Ub(qc(e),qc(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(ZW(e.authority,t.authority))return Ub(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return Oe.joinPath(e,...t)}basenameOrAuthority(e){return qb(e)||e.authority}basename(e){return ci.basename(e.path)}extname(e){return ci.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===Ze.file?t=Oe.file(O9(qc(e))).path:(t=ci.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return e.scheme===Ze.file?t=Oe.file(mC(qc(e))).path:t=ci.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!ZW(e.authority,t.authority))return;if(e.scheme===Ze.file){let s=P9(qc(e),qc(t));return Li?CR(s):s}let i=e.path||"/",o=t.path||"/";if(this._ignorePathCasing(e)){let s=0;for(let r=Math.min(i.length,o.length);swR(i).length&&i[i.length-1]===t}else{let i=e.path;return i.length>1&&i.charCodeAt(i.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=ya){return YW(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=ya){let i=!1;if(e.scheme===Ze.file){let o=qc(e);i=o!==void 0&&o.length===wR(o).length&&o[o.length-1]===t}else{t="/";let o=e.path;i=o.length===1&&o.charCodeAt(o.length-1)===47}return!i&&!YW(e,t)?e.with({path:e.path+"/"}):e}},gi=new Kb(()=>!1),wFe=new Kb(n=>n.scheme===Ze.file?!mi:!0),yFe=new Kb(n=>!0),XW=gi.isEqual.bind(gi),SFe=gi.isEqualOrParent.bind(gi),xFe=gi.getComparisonKey.bind(gi),LFe=gi.basenameOrAuthority.bind(gi),qb=gi.basename.bind(gi),kFe=gi.extname.bind(gi),QW=gi.dirname.bind(gi),DFe=gi.joinPath.bind(gi),JW=gi.normalizePath.bind(gi),EFe=gi.relativePath.bind(gi),SR=gi.resolvePath.bind(gi),IFe=gi.isAbsolutePath.bind(gi),ZW=gi.isEqualAuthority.bind(gi),YW=gi.hasTrailingPathSeparator.bind(gi),TFe=gi.removeTrailingPathSeparator.bind(gi),NFe=gi.addTrailingPathSeparator.bind(gi);(function(n){n.META_DATA_LABEL="label",n.META_DATA_DESCRIPTION="description",n.META_DATA_SIZE="size",n.META_DATA_MIME="mime";function e(t){let i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(r=>{let[a,l]=r.split(":");a&&l&&i.set(a,l)});let s=t.path.substring(0,t.path.indexOf(";"));return s&&i.set(n.META_DATA_MIME,s),i}n.parseMetaData=e})($b||($b={}))});function rp(n){return n.toString()}function LR(n){return n.getEOL()===` +`?0:1}function Ul(n){return n?n instanceof WL||n instanceof xR:!1}var ks,WL,xR,zL,kR=J(()=>{"use strict";_();v();b();Ge();xt();Kn();sn();vR();A0();bf();ks=class n{static create(e,t){let i=e.getAlternativeVersionId(),o=LR(e);return new n(i,i,o,o,t,t,[])}constructor(e,t,i,o,s,r,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=o,this.beforeCursorState=s,this.afterCursorState=r,this.changes=a}append(e,t,i,o,s){t.length>0&&(this.changes=qW(this.changes,t)),this.afterEOL=i,this.afterVersionId=o,this.afterCursorState=s}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(sr(e,t?t.length:0,i),i+=4,t)for(let o of t)sr(e,o.selectionStartLineNumber,i),i+=4,sr(e,o.selectionStartColumn,i),i+=4,sr(e,o.positionLineNumber,i),i+=4,sr(e,o.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){let o=or(e,t);t+=4;for(let s=0;st.toString()).join(", ")}matchesResource(e){return(Oe.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof ks}append(e,t,i,o,s){this._data instanceof ks&&this._data.append(e,t,i,o,s)}close(){this._data instanceof ks&&(this._data=this._data.serialize())}open(){this._data instanceof ks||(this._data=ks.deserialize(this._data))}undo(){if(Oe.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof ks&&(this._data=this._data.serialize());let e=ks.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(Oe.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof ks&&(this._data=this._data.serialize());let e=ks.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof ks&&(this._data=this._data.serialize()),this._data.byteLength+168}},xR=class{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(let o of this._editStackElementsArr){let s=rp(o.resource);this._editStackElementsMap.set(s,o)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){let t=rp(e);return this._editStackElementsMap.has(t)}setModel(e){let t=rp(Oe.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;let t=rp(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,o,s){let r=rp(e.uri);this._editStackElementsMap.get(r).append(e,t,i,o,s)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(let e of this._editStackElementsArr)e.undo()}redo(){for(let e of this._editStackElementsArr)e.redo()}heapSize(e){let t=rp(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){let e=[];for(let t of this._editStackElementsArr)e.push(`${qb(t.resource)}: ${t}`);return`{${e.join(", ")}}`}};zL=class n{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){let e=this._undoRedoService.getLastElement(this._model.uri);Ul(e)&&e.close()}popStackElement(){let e=this._undoRedoService.getLastElement(this._model.uri);Ul(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){let i=this._undoRedoService.getLastElement(this._model.uri);if(Ul(i)&&i.canAppend(this._model))return i;let o=new WL(p("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(o,t),o}pushEOL(e){let t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],LR(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,o){let s=this._getOrCreateEditStackElement(e,o),r=this._model.applyEdits(t,!0),a=n._computeCursorState(i,r),l=r.map((c,d)=>({index:d,textChange:c.textChange}));return l.sort((c,d)=>c.textChange.oldPosition===d.textChange.oldPosition?c.index-d.index:c.textChange.oldPosition-d.textChange.oldPosition),s.append(this._model,l.map(c=>c.textChange),LR(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return ut(i),null}}}});function oZ(n,e,t,i,o){o.spacesDiff=0,o.looksLikeAlignment=!1;let s;for(s=0;s0&&a>0||l>0&&c>0)return;let d=Math.abs(a-c),h=Math.abs(r-l);if(d===0){o.spacesDiff=h,h>0&&0<=l-1&&l-10?o++:x>1&&s++,oZ(r,a,C,y,h),h.looksLikeAlignment&&!(t&&e===h.spacesDiff)))continue;let T=h.spacesDiff;T<=c&&d[T]++,r=C,a=y}let u=t;o!==s&&(u=o{let C=d[m];C>g&&(g=C,f=m)}),f===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(f=2)}return{insertSpaces:u,tabSize:f}}var DR,ez=J(()=>{"use strict";_();v();b();DR=class{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}});function os(n){return(n.metadata&1)>>>0}function ei(n,e){n.metadata=n.metadata&254|e<<0}function Yn(n){return(n.metadata&2)>>>1===1}function Xt(n,e){n.metadata=n.metadata&253|(e?1:0)<<1}function az(n){return(n.metadata&4)>>>2===1}function tz(n,e){n.metadata=n.metadata&251|(e?1:0)<<2}function lz(n){return(n.metadata&64)>>>6===1}function iz(n,e){n.metadata=n.metadata&191|(e?1:0)<<6}function sZ(n){return(n.metadata&24)>>>3}function nz(n,e){n.metadata=n.metadata&231|e<<3}function rZ(n){return(n.metadata&32)>>>5===1}function oz(n,e){n.metadata=n.metadata&223|(e?1:0)<<5}function aZ(n){let e=n.root,t=0;for(;e!==lt;){if(e.left!==lt&&!Yn(e.left)){e=e.left;continue}if(e.right!==lt&&!Yn(e.right)){t+=e.delta,e=e.right;continue}e.start=t+e.start,e.end=t+e.end,e.delta=0,jc(e),Xt(e,!0),Xt(e.left,!1),Xt(e.right,!1),e===e.parent.right&&(t-=e.parent.delta),e=e.parent}Xt(n.root,!1)}function ap(n,e,t,i){return nt||i===1?!1:i===2?!0:e}function lZ(n,e,t,i,o){let s=sZ(n),r=s===0||s===2,a=s===1||s===2,l=t-e,c=i,d=Math.min(l,c),h=n.start,u=!1,f=n.end,g=!1;e<=h&&f<=t&&rZ(n)&&(n.start=e,u=!0,n.end=e,g=!0);{let C=o?1:l>0?2:0;!u&&ap(h,r,e,C)&&(u=!0),!g&&ap(f,a,e,C)&&(g=!0)}if(d>0&&!o){let C=l>c?2:0;!u&&ap(h,r,e+d,C)&&(u=!0),!g&&ap(f,a,e+d,C)&&(g=!0)}{let C=o?1:0;!u&&ap(h,r,t,C)&&(n.start=e+c,u=!0),!g&&ap(f,a,t,C)&&(n.end=e+c,g=!0)}let m=c-l;u||(n.start=Math.max(0,h+m)),g||(n.end=Math.max(0,f+m)),n.start>n.end&&(n.end=n.start)}function cZ(n,e,t){let i=n.root,o=0,s=0,r=0,a=0,l=[],c=0;for(;i!==lt;){if(Yn(i)){Xt(i.left,!1),Xt(i.right,!1),i===i.parent.right&&(o-=i.parent.delta),i=i.parent;continue}if(!Yn(i.left)){if(s=o+i.maxEnd,st){Xt(i,!0);continue}if(a=o+i.end,a>=e&&(i.setCachedOffsets(r,a,0),l[c++]=i),Xt(i,!0),i.right!==lt&&!Yn(i.right)){o+=i.delta,i=i.right;continue}}return Xt(n.root,!1),l}function dZ(n,e,t,i){let o=n.root,s=0,r=0,a=0,l=i-(t-e);for(;o!==lt;){if(Yn(o)){Xt(o.left,!1),Xt(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),jc(o),o=o.parent;continue}if(!Yn(o.left)){if(r=s+o.maxEnd,rt){o.start+=l,o.end+=l,o.delta+=l,(o.delta<-1073741824||o.delta>1073741824)&&(n.requestNormalizeDelta=!0),Xt(o,!0);continue}if(Xt(o,!0),o.right!==lt&&!Yn(o.right)){s+=o.delta,o=o.right;continue}}Xt(n.root,!1)}function hZ(n,e){let t=n.root,i=[],o=0;for(;t!==lt;){if(Yn(t)){Xt(t.left,!1),Xt(t.right,!1),t=t.parent;continue}if(t.left!==lt&&!Yn(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[o++]=t),Xt(t,!0),t.right!==lt&&!Yn(t.right)){t=t.right;continue}}return Xt(n.root,!1),i}function uZ(n){let e=n.root,t=[],i=0;for(;e!==lt;){if(Yn(e)){Xt(e.left,!1),Xt(e.right,!1),e=e.parent;continue}if(e.left!==lt&&!Yn(e.left)){e=e.left;continue}if(e.right!==lt&&!Yn(e.right)){e=e.right;continue}t[i++]=e,Xt(e,!0)}return Xt(n.root,!1),t}function fZ(n,e,t,i,o){let s=n.root,r=0,a=0,l=0,c=[],d=0;for(;s!==lt;){if(Yn(s)){Xt(s.left,!1),Xt(s.right,!1),s===s.parent.right&&(r-=s.parent.delta),s=s.parent;continue}if(s.left!==lt&&!Yn(s.left)){s=s.left;continue}a=r+s.start,l=r+s.end,s.setCachedOffsets(a,l,i);let h=!0;if(e&&s.ownerId&&s.ownerId!==e&&(h=!1),t&&az(s)&&(h=!1),o&&!lz(s)&&(h=!1),h&&(c[d++]=s),Xt(s,!0),s.right!==lt&&!Yn(s.right)){r+=s.delta,s=s.right;continue}}return Xt(n.root,!1),c}function gZ(n,e,t,i,o,s,r){let a=n.root,l=0,c=0,d=0,h=0,u=[],f=0;for(;a!==lt;){if(Yn(a)){Xt(a.left,!1),Xt(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!Yn(a.left)){if(c=l+a.maxEnd,ct){Xt(a,!0);continue}if(h=l+a.end,h>=e){a.setCachedOffsets(d,h,s);let g=!0;i&&a.ownerId&&a.ownerId!==i&&(g=!1),o&&az(a)&&(g=!1),r&&!lz(a)&&(g=!1),g&&(u[f++]=a)}if(Xt(a,!0),a.right!==lt&&!Yn(a.right)){l+=a.delta,a=a.right;continue}}return Xt(n.root,!1),u}function sz(n,e){if(n.root===lt)return e.parent=lt,e.left=lt,e.right=lt,ei(e,0),n.root=e,n.root;mZ(n,e),Sh(e.parent);let t=e;for(;t!==n.root&&os(t.parent)===1;)if(t.parent===t.parent.parent.left){let i=t.parent.parent.right;os(i)===1?(ei(t.parent,0),ei(i,0),ei(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,jb(n,t)),ei(t.parent,0),ei(t.parent.parent,1),Gb(n,t.parent.parent))}else{let i=t.parent.parent.left;os(i)===1?(ei(t.parent,0),ei(i,0),ei(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,Gb(n,t)),ei(t.parent,0),ei(t.parent.parent,1),jb(n,t.parent.parent))}return ei(n.root,0),e}function mZ(n,e){let t=0,i=n.root,o=e.start,s=e.end;for(;;)if(_Z(o,s,i.start+t,i.end+t)<0)if(i.left===lt){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===lt){e.start-=t+i.delta,e.end-=t+i.delta,e.maxEnd-=t+i.delta,i.right=e;break}else t+=i.delta,i=i.right;e.parent=i,e.left=lt,e.right=lt,ei(e,1)}function rz(n,e){let t,i;if(e.left===lt?(t=e.right,i=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===lt?(t=e.left,i=e):(i=pZ(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.delta<-1073741824||i.delta>1073741824)&&(n.requestNormalizeDelta=!0)),i===n.root){n.root=t,ei(t,0),e.detach(),IR(),jc(t),n.root.parent=lt;return}let o=os(i)===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?t.parent=i.parent:(i.parent===e?t.parent=i:t.parent=i.parent,i.left=e.left,i.right=e.right,i.parent=e.parent,ei(i,os(e)),e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==lt&&(i.left.parent=i),i.right!==lt&&(i.right.parent=i)),e.detach(),o){Sh(t.parent),i!==e&&(Sh(i),Sh(i.parent)),IR();return}Sh(t),Sh(t.parent),i!==e&&(Sh(i),Sh(i.parent));let s;for(;t!==n.root&&os(t)===0;)t===t.parent.left?(s=t.parent.right,os(s)===1&&(ei(s,0),ei(t.parent,1),jb(n,t.parent),s=t.parent.right),os(s.left)===0&&os(s.right)===0?(ei(s,1),t=t.parent):(os(s.right)===0&&(ei(s.left,0),ei(s,1),Gb(n,s),s=t.parent.right),ei(s,os(t.parent)),ei(t.parent,0),ei(s.right,0),jb(n,t.parent),t=n.root)):(s=t.parent.left,os(s)===1&&(ei(s,0),ei(t.parent,1),Gb(n,t.parent),s=t.parent.left),os(s.left)===0&&os(s.right)===0?(ei(s,1),t=t.parent):(os(s.left)===0&&(ei(s.right,0),ei(s,1),jb(n,s),s=t.parent.left),ei(s,os(t.parent)),ei(t.parent,0),ei(s.left,0),Gb(n,t.parent),t=n.root));ei(t,0),IR()}function pZ(n){for(;n.left!==lt;)n=n.left;return n}function IR(){lt.parent=lt,lt.delta=0,lt.start=0,lt.end=0}function jb(n,e){let t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==lt&&(t.left.parent=e),t.parent=e.parent,e.parent===lt?n.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,jc(e),jc(t)}function Gb(n,e){let t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(n.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==lt&&(t.right.parent=e),t.parent=e.parent,e.parent===lt?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,jc(e),jc(t)}function cz(n){let e=n.end;if(n.left!==lt){let t=n.left.maxEnd;t>e&&(e=t)}if(n.right!==lt){let t=n.right.maxEnd+n.delta;t>e&&(e=t)}return e}function jc(n){n.maxEnd=cz(n)}function Sh(n){for(;n!==lt;){let e=cz(n);if(n.maxEnd===e)return;n.maxEnd=e,n=n.parent}}function _Z(n,e,t,i){return n===t?e-i:n-t}var Zb,lt,lp,dz=J(()=>{"use strict";_();v();b();Zb=class{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,ei(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,tz(this,!1),iz(this,!1),nz(this,1),oz(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,Xt(this,!1)}reset(e,t,i,o){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=o}setOptions(e){this.options=e;let t=this.options.className;tz(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),iz(this,this.options.glyphMarginClassName!==null),nz(this,this.options.stickiness),oz(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}},lt=new Zb(null,0,0);lt.parent=lt;lt.left=lt;lt.right=lt;ei(lt,0);lp=class{constructor(){this.root=lt,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,o,s,r){return this.root===lt?[]:gZ(this,e,t,i,o,s,r)}search(e,t,i,o){return this.root===lt?[]:fZ(this,e,t,i,o)}collectNodesFromOwner(e){return hZ(this,e)}collectNodesPostOrder(){return uZ(this)}insert(e){sz(this,e),this._normalizeDeltaIfNecessary()}delete(e){rz(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){let i=e,o=0;for(;e!==this.root;)e===e.parent.right&&(o+=e.parent.delta),e=e.parent;let s=i.start+o,r=i.end+o;i.setCachedOffsets(s,r,t)}acceptReplace(e,t,i,o){let s=cZ(this,e,e+t);for(let r=0,a=s.length;r{"use strict";_();v();b();cp=class{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==je)return VL(this.right);let e=this;for(;e.parent!==je&&e.parent.left!==e;)e=e.parent;return e.parent===je?je:e.parent}prev(){if(this.left!==je)return NR(this.left);let e=this;for(;e.parent!==je&&e.parent.right!==e;)e=e.parent;return e.parent===je?je:e.parent}detach(){this.parent=null,this.left=null,this.right=null}},je=new cp(null,0);je.parent=je;je.left=je;je.right=je;je.color=0});function uz(n){let e;return n[n.length-1]<65536?e=new Uint16Array(n.length):e=new Uint32Array(n.length),e.set(n,0),e}function $l(n,e=!0){let t=[0],i=1;for(let o=0,s=n.length;o126)&&(r=!1)}let a=new PR(uz(n),i,o,s,r);return n.length=0,a}var Gc,PR,Uo,ql,OR,FR,HL,BR=J(()=>{"use strict";_();v();b();ft();Ke();hr();hz();eS();Gc=65535;PR=class{constructor(e,t,i,o,s){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=o,this.isBasicASCII=s}};Uo=class{constructor(e,t,i,o,s){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=o,this.length=s}},ql=class{constructor(e,t){this.buffer=e,this.lineStarts=t}},OR=class{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==je&&e.iterate(e.root,i=>(i!==je&&this._pieces.push(i.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}},FR=class{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){let i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){let i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1,i=this._cache;for(let o=0;o=e){i[o]=null,t=!0;continue}}if(t){let o=[];for(let s of i)s!==null&&o.push(s);this._cache=o}}},HL=class{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new ql("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=je,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let o=null;for(let s=0,r=e.length;s0){e[s].lineStarts||(e[s].lineStarts=$l(e[s].buffer));let a=new Uo(s+1,{line:0,column:0},{line:e[s].lineStarts.length-1,column:e[s].buffer.length-e[s].lineStarts[e[s].lineStarts.length-1]},e[s].lineStarts.length-1,e[s].buffer.length);this._buffers.push(e[s]),o=this.rbInsertRight(o,a)}this._searchCache=new FR(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){let t=Gc,i=t-Math.floor(t/3),o=i*2,s="",r=0,a=[];if(this.iterate(this.root,l=>{let c=this.getNodeContent(l),d=c.length;if(r<=i||r+d0){let l=s.replace(/\r\n|\r|\n/g,e);a.push(new ql(l,$l(l)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new OR(this,e)}getOffsetAt(e,t){let i=0,o=this.root;for(;o!==je;)if(o.left!==je&&o.lf_left+1>=e)o=o.left;else if(o.lf_left+o.piece.lineFeedCnt+1>=e){i+=o.size_left;let s=this.getAccumulatedValue(o,e-o.lf_left-2);return i+=s+t-1}else e-=o.lf_left+o.piece.lineFeedCnt,i+=o.size_left+o.piece.length,o=o.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0,o=e;for(;t!==je;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){let s=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+s.index,s.index===0){let r=this.getOffsetAt(i+1,1),a=o-r;return new U(i+1,a+1)}return new U(i+1,s.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===je){let s=this.getOffsetAt(i+1,1),r=o-e-s;return new U(i+1,r+1)}else t=t.right;return new U(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";let i=this.nodeAt2(e.startLineNumber,e.startColumn),o=this.nodeAt2(e.endLineNumber,e.endColumn),s=this.getValueInRange2(i,o);return t?t!==this._EOL||!this._EOLNormalized?s.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?s:s.replace(/\r\n|\r|\n/g,t):s}getValueInRange2(e,t){if(e.node===t.node){let a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,c=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(c+e.remainder,c+t.remainder)}let i=e.node,o=this._buffers[i.piece.bufferIndex].buffer,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start),r=o.substring(s+e.remainder,s+i.piece.length);for(i=i.next();i!==je;){let a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){r+=a.substring(l,l+t.remainder);break}else r+=a.substr(l,i.piece.length);i=i.next()}return r}getLinesContent(){let e=[],t=0,i="",o=!1;return this.iterate(this.root,s=>{if(s===je)return!0;let r=s.piece,a=r.length;if(a===0)return!0;let l=this._buffers[r.bufferIndex].buffer,c=this._buffers[r.bufferIndex].lineStarts,d=r.start.line,h=r.end.line,u=c[d]+r.start.column;if(o&&(l.charCodeAt(u)===10&&(u++,a--),e[t++]=i,i="",o=!1,a===0))return!0;if(d===h)return!this._EOLNormalized&&l.charCodeAt(u+a-1)===13?(o=!0,i+=l.substr(u,a-1)):i+=l.substr(u,a),!0;i+=this._EOLNormalized?l.substring(u,Math.max(u,c[d+1]-this._EOLLength)):l.substring(u,c[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let f=d+1;fx+g,t.reset(0)):(w=u.buffer,y=x=>x,t.reset(g));do if(C=t.next(w),C){if(y(C.index)>=m)return d;this.positionInBuffer(e,y(C.index)-f,S);let x=this.getLineFeedCnt(e.piece.bufferIndex,s,S),k=S.line===s.line?S.column-s.column+o:S.column+1,T=k+C[0].length;if(h[d++]=Yd(new P(i+x,k,i+x,T),C,l),y(C.index)+C[0].length>=m||d>=c)return d}while(C);return d}findMatchesLineByLine(e,t,i,o){let s=[],r=0,a=new kl(t.wordSeparators,t.regex),l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];let c=this.nodeAt2(e.endLineNumber,e.endColumn);if(c===null)return[];let d=this.positionInBuffer(l.node,l.remainder),h=this.positionInBuffer(c.node,c.remainder);if(l.node===c.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,d,h,t,i,o,r,s),s;let u=e.startLineNumber,f=l.node;for(;f!==c.node;){let m=this.getLineFeedCnt(f.piece.bufferIndex,d,f.piece.end);if(m>=1){let S=this._buffers[f.piece.bufferIndex].lineStarts,w=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),y=S[d.line+m],x=u===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(f,a,u,x,d,this.positionInBuffer(f,y-w),t,i,o,r,s),r>=o)return s;u+=m}let C=u===e.startLineNumber?e.startColumn-1:0;if(u===e.endLineNumber){let S=this.getLineContent(u).substring(C,e.endColumn-1);return r=this._findMatchesInLine(t,a,S,e.endLineNumber,C,r,s,i,o),s}if(r=this._findMatchesInLine(t,a,this.getLineContent(u).substr(C),u,C,r,s,i,o),r>=o)return s;u++,l=this.nodeAt2(u,1),f=l.node,d=this.positionInBuffer(l.node,l.remainder)}if(u===e.endLineNumber){let m=u===e.startLineNumber?e.startColumn-1:0,C=this.getLineContent(u).substring(m,e.endColumn-1);return r=this._findMatchesInLine(t,a,C,e.endLineNumber,m,r,s,i,o),s}let g=u===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(c.node,a,u,g,d,h,t,i,o,r,s),s}_findMatchesInLine(e,t,i,o,s,r,a,l,c){let d=e.wordSeparators;if(!l&&e.simpleSearch){let u=e.simpleSearch,f=u.length,g=i.length,m=-f;for(;(m=i.indexOf(u,m+f))!==-1;)if((!d||Jy(d,i,g,m,f))&&(a[r++]=new Ll(new P(o,m+1+s,o,m+1+f+s),null),r>=c))return r;return r}let h;t.reset(0);do if(h=t.next(i),h&&(a[r++]=Yd(new P(o,h.index+1+s,o,h.index+1+h[0].length+s),h,l),r>=c))return r;while(h);return r}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==je){let{node:o,remainder:s,nodeStartOffset:r}=this.nodeAt(e),a=o.piece,l=a.bufferIndex,c=this.positionInBuffer(o,s);if(o.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&r+a.length===e&&t.lengthe){let d=[],h=new Uo(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,c));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(o,s)===10){let m={line:h.start.line+1,column:0};h=new Uo(h.bufferIndex,m,h.end,this.getLineFeedCnt(h.bufferIndex,m,h.end),h.length-1),t+=` +`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(o,s-1)===13){let m=this.positionInBuffer(o,s-1);this.deleteNodeTail(o,m),t="\r"+t,o.piece.length===0&&d.push(o)}else this.deleteNodeTail(o,c);else this.deleteNodeTail(o,c);let u=this.createNewPieces(t);h.length>0&&this.rbInsertRight(o,h);let f=o;for(let g=0;g=0;r--)s=this.rbInsertLeft(s,o[r]);this.validateCRLFWithPrevNode(s),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` +`);let i=this.createNewPieces(e),o=this.rbInsertRight(t,i[0]),s=o;for(let r=1;r=u)c=h+1;else break;return i?(i.line=h,i.column=l-f,null):{line:h,column:l-f}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;let o=this._buffers[e].lineStarts;if(i.line===o.length-1)return i.line-t.line;let s=o[i.line+1],r=o[i.line]+i.column;if(s>r+1)return i.line-t.line;let a=r-1;return this._buffers[e].buffer.charCodeAt(a)===13?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;tGc){let d=[];for(;e.length>Gc;){let u=e.charCodeAt(Gc-1),f;u===13||u>=55296&&u<=56319?(f=e.substring(0,Gc-1),e=e.substring(Gc-1)):(f=e.substring(0,Gc),e=e.substring(Gc));let g=$l(f);d.push(new Uo(this._buffers.length,{line:0,column:0},{line:g.length-1,column:f.length-g[g.length-1]},g.length-1,f.length)),this._buffers.push(new ql(f,g))}let h=$l(e);return d.push(new Uo(this._buffers.length,{line:0,column:0},{line:h.length-1,column:e.length-h[h.length-1]},h.length-1,e.length)),this._buffers.push(new ql(e,h)),d}let t=this._buffers[0].buffer.length,i=$l(e,!1),o=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},o=this._lastChangeBufferPos;for(let d=0;d=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){let l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this.getAccumulatedValue(i,e-i.lf_left-1),d=this._buffers[i.piece.bufferIndex].buffer,h=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return r+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:r,nodeStartLineNumber:a-(e-1-i.lf_left)}),d.substring(h+l,h+c-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){let l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this._buffers[i.piece.bufferIndex].buffer,d=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);o=c.substring(d+l,d+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,r+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==je;){let r=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){let a=this.getAccumulatedValue(i,0),l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return o+=r.substring(l,l+a-t),o}else{let a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);o+=r.substr(a,i.piece.length)}i=i.next()}return o}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==je;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){let i=e.piece,o=this.positionInBuffer(e,t),s=o.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){let r=this.getLineFeedCnt(e.piece.bufferIndex,i.start,o);if(r!==s)return{index:r,remainder:0}}return{index:s,remainder:o.column}}getAccumulatedValue(e,t){if(t<0)return 0;let i=e.piece,o=this._buffers[i.bufferIndex].lineStarts,s=i.start.line+t+1;return s>i.end.line?o[i.end.line]+i.end.column-o[i.start.line]-i.start.column:o[s]-o[i.start.line]-i.start.column}deleteNodeTail(e,t){let i=e.piece,o=i.lineFeedCnt,s=this.offsetInBuffer(i.bufferIndex,i.end),r=t,a=this.offsetInBuffer(i.bufferIndex,r),l=this.getLineFeedCnt(i.bufferIndex,i.start,r),c=l-o,d=a-s,h=i.length+d;e.piece=new Uo(i.bufferIndex,i.start,r,l,h),Kl(this,e,d,c)}deleteNodeHead(e,t){let i=e.piece,o=i.lineFeedCnt,s=this.offsetInBuffer(i.bufferIndex,i.start),r=t,a=this.getLineFeedCnt(i.bufferIndex,r,i.end),l=this.offsetInBuffer(i.bufferIndex,r),c=a-o,d=s-l,h=i.length+d;e.piece=new Uo(i.bufferIndex,r,i.end,a,h),Kl(this,e,d,c)}shrinkNode(e,t,i){let o=e.piece,s=o.start,r=o.end,a=o.length,l=o.lineFeedCnt,c=t,d=this.getLineFeedCnt(o.bufferIndex,o.start,c),h=this.offsetInBuffer(o.bufferIndex,t)-this.offsetInBuffer(o.bufferIndex,s);e.piece=new Uo(o.bufferIndex,o.start,c,d,h),Kl(this,e,h-a,d-l);let u=new Uo(o.bufferIndex,i,r,this.getLineFeedCnt(o.bufferIndex,i,r),this.offsetInBuffer(o.bufferIndex,r)-this.offsetInBuffer(o.bufferIndex,i)),f=this.rbInsertRight(e,u);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` +`);let i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),o=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;let s=$l(t,!1);for(let f=0;fe)t=t.left;else if(t.size_left+t.piece.length>=e){o+=t.size_left;let s={node:t,remainder:e-t.size_left,nodeStartOffset:o};return this._searchCache.set(s),s}else e-=t.size_left+t.piece.length,o+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,o=0;for(;i!==je;)if(i.left!==je&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){let s=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1);return o+=i.size_left,{node:i,remainder:Math.min(s+t-1,r),nodeStartOffset:o}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){let s=this.getAccumulatedValue(i,e-i.lf_left-2);if(s+t-1<=i.piece.length)return{node:i,remainder:s+t-1,nodeStartOffset:o};t-=i.piece.length-s;break}else e-=i.lf_left+i.piece.lineFeedCnt,o+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==je;){if(i.piece.lineFeedCnt>0){let s=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,s),nodeStartOffset:r}}else if(i.piece.length>=t-1){let s=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:s}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;let i=this._buffers[e.piece.bufferIndex],o=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(o)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===` +`)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===je||e.piece.lineFeedCnt===0)return!1;let t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,o=t.start.line,s=i[o]+t.start.column;return o===i.length-1||i[o+1]>s+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(s)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===je||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){let t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){let t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){let i=[],o=this._buffers[e.piece.bufferIndex].lineStarts,s;e.piece.end.column===0?s={line:e.piece.end.line-1,column:o[e.piece.end.line]-o[e.piece.end.line-1]-1}:s={line:e.piece.end.line,column:e.piece.end.column-1};let r=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new Uo(e.piece.bufferIndex,e.piece.start,s,a,r),Kl(this,e,-1,-1),e.piece.length===0&&i.push(e);let l={line:t.piece.start.line+1,column:0},c=t.piece.length-1,d=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new Uo(t.piece.bufferIndex,l,t.piece.end,d,c),Kl(this,t,-1,-1),t.piece.length===0&&i.push(t);let h=this.createNewPieces(`\r +`);this.rbInsertRight(e,h[0]);for(let u=0;u{"use strict";_();v();b();ye();ot();Ke();hr();BR();tp();vR();le();dp=class n extends H{constructor(e,t,i,o,s,r,a){super(),this._onDidChangeContent=this._register(new B),this._BOM=t,this._mightContainNonBasicASCII=!r,this._mightContainRTL=o,this._mightContainUnusualLineTerminators=s,this._pieceTree=new HL(e,i,a)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:"")}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){let i=e+t,o=this.getPositionAt(e),s=this.getPositionAt(i);return new P(o.lineNumber,o.column,s.lineNumber,s.column)}getValueInRange(e,t=0){if(e.isEmpty())return"";let i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=0){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;let i=this.getOffsetAt(e.startLineNumber,e.startColumn),o=this.getOffsetAt(e.endLineNumber,e.endColumn),s=0,r=this._getEndOfLine(t),a=this.getEOL();if(r.length!==a.length){let l=r.length-a.length,c=e.endLineNumber-e.startLineNumber;s=l*c}return o-i+s}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0,o=e.startLineNumber,s=e.endLineNumber;for(let r=o;r<=s;r++){let a=this.getLineContent(r),l=r===o?e.startColumn-1:0,c=r===s?e.endColumn-1:a.length;for(let d=l;dC.sortIndex-S.sortIndex)}this._mightContainRTL=o,this._mightContainUnusualLineTerminators=s,this._mightContainNonBasicASCII=r;let f=this._doApplyEdits(l),g=null;if(t&&h.length>0){h.sort((m,C)=>C.lineNumber-m.lineNumber),g=[];for(let m=0,C=h.length;m0&&h[m-1].lineNumber===S)continue;let w=h[m].oldContent,y=this.getLineContent(S);y.length===0||y===w||Ri(y)!==-1||g.push(S)}}return this._onDidChangeContent.fire(),new Xy(u,f,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1,i=e[0].range,o=e[e.length-1].range,s=new P(i.startLineNumber,i.startColumn,o.endLineNumber,o.endColumn),r=i.startLineNumber,a=i.startColumn,l=[];for(let f=0,g=e.length;f0&&l.push(m.text),r=C.endLineNumber,a=C.endColumn}let c=l.join(""),[d,h,u]=na(c);return{sortIndex:0,identifier:e[0].identifier,range:s,rangeOffset:this.getOffsetAt(s.startLineNumber,s.startColumn),rangeLength:this.getValueLengthInRange(s,0),text:c,eolCount:d,firstLineLength:h,lastLineLength:u,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(n._sortOpsDescending);let t=[];for(let i=0;i0){let u=l.eolCount+1;u===1?h=new P(c,d,c,d+l.firstLineLength):h=new P(c,d,c+u-1,l.lastLineLength+1)}else h=new P(c,d,c,d);i=h.endLineNumber,o=h.endColumn,t.push(h),s=l}return t}static _sortOpsAscending(e,t){let i=P.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){let i=P.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}});var zR,ev,gz=J(()=>{"use strict";_();v();b();ot();BR();WR();zR=class{constructor(e,t,i,o,s,r,a,l,c){this._chunks=e,this._bom=t,this._cr=i,this._lf=o,this._crlf=s,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=c}_getEOL(e){let t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return t===0?e===1?` +`:`\r +`:i>t/2?`\r +`:` +`}create(e){let t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&(t===`\r +`&&(this._cr>0||this._lf>0)||t===` +`&&(this._cr>0||this._crlf>0)))for(let s=0,r=i.length;s=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){let t=fz(this._tmpLineStarts,e);this.chunks.push(new ql(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=Lc(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=vw(e)))}finish(e=!0){return this._finish(),new zR(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;let e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);let t=$l(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}});function bZ(n,e){let t=[];for(let i=0;i{"use strict";_();v();b();wt();UL=class{constructor(e){this._default=e,this._store=[]}get(e){return e=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(t===0){this.insert(e,i);return}else if(i===0){this.delete(e,t);return}let o=this._store.slice(0,e),s=this._store.slice(e+t),r=bZ(i,this._default);this._store=o.concat(r,s)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;let i=[];for(let o=0;o{"use strict";_();v();b();KL=class{get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}constructor(e,t){this._startLineNumber=e,this._tokens=t}getLineTokens(e){return this._tokens[e-this._startLineNumber]}appendLineTokens(e){this._tokens.push(e)}}});var vf,VR=J(()=>{"use strict";_();v();b();pz();vf=class{constructor(){this._tokens=[]}add(e,t){if(this._tokens.length>0){let i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new KL(e,[t]))}finalize(){return this._tokens}}});function tv(n,e,t,i,o,s){let r=null;if(t)try{r=t.tokenizeEncoded(i,o,s.clone())}catch(a){ut(a)}return r||(r=hm(n.encodeLanguageId(e),s)),Hi.convertToEndOffset(r.tokens,i.length),r}var HR,$L,hp,UR,KR,qL,_z=J(()=>{"use strict";_();v();b();Gt();xt();Lt();vg();tp();Bo();es();Y0();mz();VR();Pc();HR=class{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new hp(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}},$L=class extends HR{constructor(e,t,i,o){super(e,t),this._textModel=i,this._languageIdCodec=o}updateTokensUntilLine(e,t){let i=this._textModel.getLanguageId();for(;;){let o=this.getFirstInvalidLine();if(!o||o.lineNumber>t)break;let s=this._textModel.getLineContent(o.lineNumber),r=tv(this._languageIdCodec,i,this.tokenizationSupport,s,!0,o.startState);e.add(o.lineNumber,r.tokens),this.store.setEndState(o.lineNumber,r.endState)}}getTokenTypeIfInsertingCharacter(e,t){let i=this.getStartState(e.lineNumber);if(!i)return 0;let o=this._textModel.getLanguageId(),s=this._textModel.getLineContent(e.lineNumber),r=s.substring(0,e.column-1)+t+s.substring(e.column-1),a=tv(this._languageIdCodec,o,this.tokenizationSupport,r,!0,i),l=new Hi(a.tokens,r,this._languageIdCodec);if(l.getCount()===0)return 0;let c=l.findTokenIndexAtOffset(e.column-1);return l.getStandardTokenType(c)}tokenizeLineWithEdit(e,t,i){let o=e.lineNumber,s=e.column,r=this.getStartState(o);if(!r)return null;let a=this._textModel.getLineContent(o),l=a.substring(0,s-1)+i+a.substring(s-1+t),c=this._textModel.getLanguageIdAtPosition(o,0),d=tv(this._languageIdCodec,c,this.tokenizationSupport,l,!0,r);return new Hi(d.tokens,l,this._languageIdCodec)}hasAccurateTokensForLine(e){let t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&a>=1;a--){let l=this._textModel.getLineFirstNonWhitespaceColumn(a);if(l!==0&&l0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}},KR=class{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){let t=this._ranges.findIndex(i=>i.contains(e));if(t!==-1){let i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new ze(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new ze(i.start,e):this._ranges.splice(t,1,new ze(i.start,e),new ze(e+1,i.endExclusive))}}addRange(e){ze.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let o=i;for(;!(o>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}};qL=class{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._isScheduled||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._isScheduled=!0,OT(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){let t=Date.now()+e.timeRemaining(),i=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){var t;let i=(t=this._tokenizerWithStateStore)===null||t===void 0?void 0:t.getFirstInvalidLine();return i?(this._tokenizerWithStateStore.updateTokensUntilLine(e,i.lineNumber),i.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new Ne(e,t))}}});function Gl(n){return n instanceof Uint32Array?n:new Uint32Array(n)}var jl,Zl,bz=J(()=>{"use strict";_();v();b();Pc();jl=new Uint32Array(0).buffer,Zl=class n{static deleteBeginning(e,t){return e===null||e===jl?e:n.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===jl)return e;let i=Gl(e),o=i[i.length-2];return n.delete(e,t,o)}static delete(e,t,i){if(e===null||e===jl||t===i)return e;let o=Gl(e),s=o.length>>>1;if(t===0&&o[o.length-2]===i)return jl;let r=Hi.findIndexInTokensArray(o,t),a=r>0?o[r-1<<1]:0,l=o[r<<1];if(id&&(o[c++]=g,o[c++]=o[(f<<1)+1],d=g)}if(c===o.length)return e;let u=new Uint32Array(c);return u.set(o.subarray(0,c),0),u.buffer}static append(e,t){if(t===jl)return e;if(e===jl)return t;if(e===null)return e;if(t===null)return null;let i=Gl(e),o=Gl(t),s=o.length>>>1,r=new Uint32Array(i.length+o.length);r.set(i,0);let a=i.length,l=i[i.length-2];for(let c=0;c>>1,r=Hi.findIndexInTokensArray(o,t);r>0&&o[r-1<<1]===t&&r--;for(let a=r;a>>0}var iv,Cz=J(()=>{"use strict";_();v();b();wt();ft();bz();Pc();um();iv=class n{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}get hasTokens(){return this._lineTokens.length>0}getTokens(e,t,i){let o=null;if(t1&&(s=mn.getLanguageId(o[1])!==e),!s)return jl}if(!o||o.length===0){let s=new Uint32Array(2);return s[0]=t,s[1]=vz(e),s.buffer}return o[o.length-2]=t,o.byteOffset===0&&o.byteLength===o.buffer.byteLength?o.buffer:o}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;let i=[];for(let o=0;o=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=Zl.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Zl.deleteEnding(this._lineTokens[t],e.startColumn-1);let i=e.endLineNumber-1,o=null;i=this._len)){if(t===0){this._lineTokens[o]=Zl.insert(this._lineTokens[o],e.column-1,i);return}this._lineTokens[o]=Zl.deleteEnding(this._lineTokens[o],e.column-1),this._lineTokens[o]=Zl.insert(this._lineTokens[o],e.column-1,i),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};let i=[];for(let o=0,s=e.length;o{"use strict";_();v();b();wt();Pc();jL=class n{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){let s=t[0].getRange(),r=t[t.length-1].getRange();if(!s||!r)return e;i=e.plusRange(s).plusRange(r)}let o=null;for(let s=0,r=this._pieces.length;si.endLineNumber){o=o||{index:s};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(s,1),s--,r--;continue}if(a.endLineNumberi.endLineNumber){o=o||{index:s};continue}let[l,c]=a.split(i);if(l.isEmpty()){o=o||{index:s};continue}c.isEmpty()||(this._pieces.splice(s,1,l,c),s++,r++,o=o||{index:s})}return o=o||{index:this._pieces.length},t.length>0&&(this._pieces=fd(this._pieces,o.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;let i=this._pieces;if(i.length===0)return t;let o=n._findFirstPieceWithLine(i,e),s=i[o].getLineTokens(e);if(!s)return t;let r=t.getCount(),a=s.getCount(),l=0,c=[],d=0,h=0,u=(f,g)=>{f!==h&&(h=f,c[d++]=f,c[d++]=g)};for(let f=0;f>>0,w=~S>>>0;for(;lt)o=s-1;else{for(;s>i&&e[s-1].startLineNumber<=t&&t<=e[s-1].endLineNumber;)s--;return s}}return i}acceptEdit(e,t,i,o,s){for(let r of this._pieces)r.acceptEdit(e,t,i,o,s)}}});var GL,$R,qR,yz=J(()=>{"use strict";_();v();b();wt();Gt();xt();ye();le();tp();Bo();ft();ug();Yo();FM();_z();VR();Cz();wz();GL=class n extends Gm{constructor(e,t,i,o,s,r){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=o,this._languageId=s,this._attachedViews=r,this._semanticTokens=new jL(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new B),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new B),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new B),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new $R(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(a=>{a.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(a=>{this._emitModelTokensChangedEvent(a)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(a=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(let t of e.changes){let[i,o,s]=na(t.text);this._semanticTokens.acceptEdit(t.range,i,o,s,t.text.length>0?t.text.charCodeAt(0):0)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);let t=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new St("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}hasAccurateTokensForLine(e){return this.validateLineNumber(e),this.grammarTokens.hasAccurateTokensForLine(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLineWithEdit(e,t,i){return this.grammarTokens.tokenizeLineWithEdit(e,t,i)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;let i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();let t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),o=this.getLineTokens(t.lineNumber),s=o.findTokenIndexAtOffset(t.column-1),[r,a]=n._findLanguageBoundaries(o,s),l=pd(t.column,this.getLanguageConfiguration(o.getLanguageId(s)).getWordDefinition(),i.substring(r,a),r);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(s>0&&r===t.column-1){let[c,d]=n._findLanguageBoundaries(o,s-1),h=pd(t.column,this.getLanguageConfiguration(o.getLanguageId(s-1)).getWordDefinition(),i.substring(c,d),c);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn)return h}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){let i=e.getLanguageId(t),o=0;for(let r=t;r>=0&&e.getLanguageId(r)===i;r--)o=e.getStartOffset(r);let s=e.getLineContent().length;for(let r=t,a=e.getCount();r{let r=this.getLanguageId();s.changedLanguages.indexOf(r)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(o.onDidChangeVisibleRanges(({view:s,state:r})=>{if(r){let a=this._attachedViewStates.get(s);a||(a=new qR(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(s,a)),a.handleStateChange(r)}else this._attachedViewStates.deleteAndDispose(s)}))}resetTokenization(e=!0){var t;this._tokens.flush(),(t=this._debugBackgroundTokens)===null||t===void 0||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new hp(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});let i=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];let r=Bt.get(this.getLanguageId());if(!r)return[null,null];let a;try{a=r.getInitialState()}catch(l){return ut(l),[null,null]}return[r,a]},[o,s]=i();if(o&&s?this._tokenizer=new $L(this._textModel.getLineCount(),o,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){let r={setTokens:a=>{this.setTokens(a)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===2)return;let a=2;this._backgroundTokenizationState=a,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(a,l)=>{var c;if(!this._tokenizer)return;let d=this._tokenizer.store.getFirstInvalidEndStateLineNumber();d!==null&&a>=d&&((c=this._tokenizer)===null||c===void 0||c.store.setEndState(a,l))}};o&&o.createBackgroundTokenizer&&!o.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=o.createBackgroundTokenizer(this._textModel,r)),!this._backgroundTokenizer.value&&!this._textModel.isTooLargeForTokenization()&&(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new qL(this._tokenizer,r),this._defaultBackgroundTokenizer.handleChanges()),o?.backgroundTokenizerShouldOnlyVerifyTokens&&o.createBackgroundTokenizer?(this._debugBackgroundTokens=new iv(this._languageIdCodec),this._debugBackgroundStates=new hp(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=o.createBackgroundTokenizer(this._textModel,{setTokens:a=>{var l;(l=this._debugBackgroundTokens)===null||l===void 0||l.setMultilineTokens(a,this._textModel)},backgroundTokenizationFinished(){},setEndState:(a,l)=>{var c;(c=this._debugBackgroundStates)===null||c===void 0||c.setEndState(a,l)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;(e=this._defaultBackgroundTokenizer)===null||e===void 0||e.handleChanges()}handleDidChangeContent(e){var t,i,o;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(let s of e.changes){let[r,a]=na(s.text);this._tokens.acceptEdit(s.range,r,a),(t=this._debugBackgroundTokens)===null||t===void 0||t.acceptEdit(s.range,r,a)}(i=this._debugBackgroundStates)===null||i===void 0||i.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(o=this._defaultBackgroundTokenizer)===null||o===void 0||o.handleChanges()}}setTokens(e){let{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){let e=Ne.joinMany([...this._attachedViewStates].map(([t,i])=>i.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(let t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var i,o;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);let s=new vf,{heuristicTokens:r}=this._tokenizer.tokenizeHeuristically(s,e,t),a=this.setTokens(s.finalize());if(r)for(let l of a.changes)(i=this._backgroundTokenizer.value)===null||i===void 0||i.requestTokens(l.fromLineNumber,l.toLineNumber+1);(o=this._defaultBackgroundTokenizer)===null||o===void 0||o.checkFinished()}forceTokenization(e){var t,i;let o=new vf;(t=this._tokenizer)===null||t===void 0||t.updateTokensUntilLine(o,e),this.setTokens(o.finalize()),(i=this._defaultBackgroundTokenizer)===null||i===void 0||i.checkFinished()}hasAccurateTokensForLine(e){return this._tokenizer?this._tokenizer.hasAccurateTokensForLine(e):!0}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;let i=this._textModel.getLineContent(e),o=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,i);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){let s=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,i);!o.equals(s)&&(!((t=this._debugBackgroundTokenizer.value)===null||t===void 0)&&t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return o}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return 0;let o=this._textModel.validatePosition(new U(e,t));return this.forceTokenization(o.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(o,i)}tokenizeLineWithEdit(e,t,i){if(!this._tokenizer)return null;let o=this._textModel.validatePosition(e);return this.forceTokenization(o.lineNumber),this._tokenizer.tokenizeLineWithEdit(o,t,i)}get hasTokens(){return this._tokens.hasTokens}},qR=class extends H{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new di(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Ht(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}});var up,nv,Cf,Ya,ZL=J(()=>{"use strict";_();v();b();qe();up=De("undoRedoService"),nv=class{constructor(e,t){this.resource=e,this.elements=t}},Cf=class n{constructor(){this.id=n._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};Cf._ID=0;Cf.None=new Cf;Ya=class n{constructor(){this.id=n._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};Ya._ID=0;Ya.None=new Ya});function CZ(n){let e=new ev;return e.acceptChunk(n),e.finish()}function wZ(n){let e=new ev,t;for(;typeof(t=n.read())=="string";)e.acceptChunk(t);return e.finish()}function Sz(n,e){let t;return typeof n=="string"?t=CZ(n):K3(n)?t=wZ(n):t=n,t.create(e)}function xZ(n){let e=0;for(let t of n)if(t===" "||t===" ")e++;else break;return e}function GR(n){return!!(n.options.overviewRuler&&n.options.overviewRuler.color)}function LZ(n){return!!n.after||!!n.before}function XL(n){return!!n.options.after||!!n.options.before}function Yl(n){return n.replace(/[^a-z0-9\-_]/gi," ")}function Lz(n){return n instanceof qi?n:qi.createDynamic(n)}var vZ,jR,wf,YL,yZ,SZ,ZR,ov,Zc,QL,JL,YR,XR,QR,ek,qi,xz,JR,e4,t4,i4,sv=J(()=>{"use strict";_();v();b();wt();gn();xt();ye();le();ot();sn();tp();xM();Bo();ft();Ke();Kn();I_();Hr();lr();hr();KW();$W();kR();BM();ez();dz();WR();gz();eS();yz();bh();ZL();vZ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},jR=function(n,e){return function(t,i){e(t,i,n)}};YL=0,yZ=999,SZ=1e4,ZR=class{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;let e=[],t=0,i=0;do{let o=this._source.read();if(o===null)return this._eos=!0,t===0?null:e.join("");if(o.length>0&&(e[t++]=o,i+=o.length),i>=64*1024)return e.join("")}while(!0)}},ov=()=>{throw new Error("Invalid change accessor")},Zc=wf=class extends H{static resolveOptions(e,t){if(t.detectIndentation){let i=ER(e,t.tabSize,t.insertSpaces);return new Zd({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new Zd(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return _o(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,i,o=null,s,r,a){super(),this._undoRedoService=s,this._languageService=r,this._languageConfigurationService=a,this._onWillDispose=this._register(new B),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new JR(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new B),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new B),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new B),this._eventEmitter=this._register(new e4),this._languageSelectionListener=this._register(new no),this._deltaDecorationCallCnt=0,this._attachedViews=new t4,YL++,this.id="$model"+YL,this.isForSimpleWidget=i.isForSimpleWidget,typeof o>"u"||o===null?this._associatedResource=Oe.parse("inmemory://model/"+YL):this._associatedResource=o,this._attachedEditorCount=0;let{textBuffer:l,disposable:c}=Sz(e,i.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=wf.resolveOptions(this._buffer,i);let d=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new PL(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new $x(this,this._languageConfigurationService)),this._decorationProvider=this._register(new OL(this)),this._tokenizationTextModelPart=new GL(this._languageService,this._languageConfigurationService,this,this._bracketPairs,d,this._attachedViews);let h=this._buffer.getLineCount(),u=this._buffer.getValueLengthInRange(new P(1,1,h,this._buffer.getLineLength(h)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=u>wf.LARGE_FILE_SIZE_THRESHOLD||h>wf.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=u>wf.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=u>wf._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=Cw(YL),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new QL,this._commandManager=new zL(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(d)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;let e=new dp([],"",` +`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=H.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new _h(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw Sd();let{textBuffer:t,disposable:i}=Sz(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,o,s,r,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:o}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:s,isRedoing:r,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();let i=this.getFullModelRange(),o=this.getValueLengthInRange(i),s=this.getLineCount(),r=this.getLineMaxColumn(s);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new QL,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new pf([new _L],this._versionId,!1,!1),this._createContentChanged2(new P(1,1,s,r),0,o,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();let t=e===1?`\r +`:` +`;if(this._buffer.getEOL()===t)return;let i=this.getFullModelRange(),o=this.getValueLengthInRange(i),s=this.getLineCount(),r=this.getLineMaxColumn(s);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new pf([new CL],this._versionId,!1,!1),this._createContentChanged2(new P(1,1,s,r),0,o,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){let e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,o=t.length;i0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0,i=this._buffer.getLineCount();for(let o=1;o<=i;o++){let s=this._buffer.getLineLength(o);s>=SZ?t+=s:e+=s}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();let t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,o=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,s=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new Zd({tabSize:t,indentSize:i,insertSpaces:o,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:s,bracketPairColorizationOptions:r});if(this._options.equals(a))return;let l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();let i=ER(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),yx(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){let t=this.findMatches(IT.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({range:i.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();let t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();let t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new St("Operation would exceed heap memory limits");let i=this.getFullModelRange(),o=this.getValueInRange(i,e);return t?this._buffer.getBOM()+o:o}createSnapshot(e=!1){return new ZR(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();let i=this.getFullModelRange(),o=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+o:o}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new St("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new St("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new St("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` +`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new St("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new St("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new St("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){let t=this._buffer.getLineCount(),i=e.startLineNumber,o=e.startColumn,s=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof o=="number"&&!isNaN(o)?o:1);if(s<1)s=1,r=1;else if(s>t)s=t,r=this.getLineMaxColumn(s);else if(r<=1)r=1;else{let h=this.getLineMaxColumn(s);r>=h&&(r=h)}let a=e.endLineNumber,l=e.endColumn,c=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),d=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(c<1)c=1,d=1;else if(c>t)c=t,d=this.getLineMaxColumn(c);else if(d<=1)d=1;else{let h=this.getLineMaxColumn(c);d>=h&&(d=h)}return i===s&&o===r&&a===c&&l===d&&e instanceof P&&!(e instanceof nt)?e:new P(s,r,c,d)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;let o=this._buffer.getLineCount();if(e>o)return!1;if(t===1)return!0;let s=this.getLineMaxColumn(e);if(t>s)return!1;if(i===1){let r=this._buffer.getLineCharCode(e,t-2);if(pi(r))return!1}return!0}_validatePosition(e,t,i){let o=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),s=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(o<1)return new U(1,1);if(o>r)return new U(r,this.getLineMaxColumn(r));if(s<=1)return new U(o,1);let a=this.getLineMaxColumn(o);if(s>=a)return new U(o,a);if(i===1){let l=this._buffer.getLineCharCode(o,s-2);if(pi(l))return new U(o,s-1)}return new U(o,s)}validatePosition(e){return this._assertNotDisposed(),e instanceof U&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){let i=e.startLineNumber,o=e.startColumn,s=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,o,0)||!this._isValidPosition(s,r,0))return!1;if(t===1){let a=o>1?this._buffer.getLineCharCode(i,o-2):0,l=r>1&&r<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,r-2):0,c=pi(a),d=pi(l);return!c&&!d}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof P&&!(e instanceof nt)&&this._isValidRange(e,1))return e;let i=this._validatePosition(e.startLineNumber,e.startColumn,0),o=this._validatePosition(e.endLineNumber,e.endColumn,0),s=i.lineNumber,r=i.column,a=o.lineNumber,l=o.column;{let c=r>1?this._buffer.getLineCharCode(s,r-2):0,d=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,h=pi(c),u=pi(d);return!h&&!u?new P(s,r,a,l):s===a&&r===l?new P(s,r-1,a,l-1):h&&u?new P(s,r-1,a,l+1):h?new P(s,r-1,a,l):new P(s,r,a,l+1)}return new P(s,r,a,l)}modifyPosition(e,t){this._assertNotDisposed();let i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();let e=this.getLineCount();return new P(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,o){return this._buffer.findMatchesLineByLine(e,t,i,o)}findMatches(e,t,i,o,s,r,a=yZ){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(h=>P.isIRange(h))&&(l=t.map(h=>this.validateRange(h)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((h,u)=>h.startLineNumber-u.startLineNumber||h.startColumn-u.startColumn);let c=[];c.push(l.reduce((h,u)=>P.areIntersecting(h,u)?h.plusRange(u):(c.push(h),u)));let d;if(!i&&e.indexOf(` +`)<0){let u=new Ac(e,i,o,s).parseSearchRequest();if(!u)return[];d=f=>this.findMatchesLineByLine(f,u,r,a)}else d=h=>Au.findMatches(this,new Ac(e,i,o,s),h,r,a);return c.map(d).reduce((h,u)=>h.concat(u),[])}findNextMatch(e,t,i,o,s,r){this._assertNotDisposed();let a=this.validatePosition(t);if(!i&&e.indexOf(` +`)<0){let c=new Ac(e,i,o,s).parseSearchRequest();if(!c)return null;let d=this.getLineCount(),h=new P(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),u=this.findMatchesLineByLine(h,c,r,1);return Au.findNextMatch(this,new Ac(e,i,o,s),a,r),u.length>0||(h=new P(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),u=this.findMatchesLineByLine(h,c,r,1),u.length>0)?u[0]:null}return Au.findNextMatch(this,new Ac(e,i,o,s),a,r)}findPreviousMatch(e,t,i,o,s,r){this._assertNotDisposed();let a=this.validatePosition(t);return Au.findPreviousMatch(this,new Ac(e,i,o,s),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` +`?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof tm?e:new tm(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){let t=[];for(let i=0,o=e.length;i({range:this.validateRange(a.range),text:a.text})),r=!0;if(e)for(let a=0,l=e.length;ac.endLineNumber,m=c.startLineNumber>f.endLineNumber;if(!g&&!m){d=!0;break}}if(!d){r=!1;break}}if(r)for(let a=0,l=this._trimAutoWhitespaceLines.length;ag.endLineNumber)&&!(c===g.startLineNumber&&g.startColumn===d&&g.isEmpty()&&m&&m.length>0&&m.charAt(0)===` +`)&&!(c===g.startLineNumber&&g.startColumn===1&&g.isEmpty()&&m&&m.length>0&&m.charAt(m.length-1)===` +`)){h=!1;break}}if(h){let u=new P(c,1,c,d);t.push(new tm(null,u,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,o)}_applyUndo(e,t,i,o){let s=e.map(r=>{let a=this.getPositionAt(r.newPosition),l=this.getPositionAt(r.newEnd);return{range:new P(a.lineNumber,a.column,l.lineNumber,l.column),text:r.oldText}});this._applyUndoRedoEdits(s,t,!0,!1,i,o)}_applyRedo(e,t,i,o){let s=e.map(r=>{let a=this.getPositionAt(r.oldPosition),l=this.getPositionAt(r.oldEnd);return{range:new P(a.lineNumber,a.column,l.lineNumber,l.column),text:r.newText}});this._applyUndoRedoEdits(s,t,!1,!0,i,o)}_applyUndoRedoEdits(e,t,i,o,s,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=o,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(s)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();let i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){let i=this._buffer.getLineCount(),o=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),s=this._buffer.getLineCount(),r=o.changes;if(this._trimAutoWhitespaceLines=o.trimAutoWhitespaceLineNumbers,r.length!==0){for(let c=0,d=r.length;c=0;W--){let j=f+W,G=y+W;M.takeFromEndWhile(z=>z.lineNumber>G);let V=M.takeFromEndWhile(z=>z.lineNumber===G);a.push(new Ab(j,this.getLineContent(G),V))}if(SCe.lineNumberCe.lineNumber===ce)}a.push(new vL(j+1,f+C,te,z))}l+=w}this._emitContentChangedEvent(new pf(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:r,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return o.reverseEdits===null?void 0:o.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;let i=Array.from(e).map(o=>new Ab(o,this.getLineContent(o),this._getInjectedTextInLine(o)));this._onDidChangeInjectedText.fire(new Jm(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){let i={addDecoration:(s,r)=>this._deltaDecorationsImpl(e,[],[{range:s,options:r}])[0],changeDecoration:(s,r)=>{this._changeDecorationImpl(s,r)},changeDecorationOptions:(s,r)=>{this._changeDecorationOptionsImpl(s,Lz(r))},removeDecoration:s=>{this._deltaDecorationsImpl(e,[s],[])},deltaDecorations:(s,r)=>s.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,s,r)},o=null;try{o=t(i)}catch(s){ut(s)}return i.addDecoration=ov,i.changeDecoration=ov,i.changeDecorationOptions=ov,i.removeDecoration=ov,i.deltaDecorations=ov,o}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&t.length===0)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),ut(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){let o=e?this._decorations[e]:null;if(!o)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:xz[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(o),delete this._decorations[o.id],null;let s=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),a=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);return this._decorationsTree.delete(o),o.reset(this.getVersionId(),r,a,s),o.setOptions(xz[i]),this._decorationsTree.insert(o),o.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;let t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,o=t.length;ithis.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,o=!1,s=!1){let r=this.getLineCount(),a=Math.min(r,Math.max(1,e)),l=Math.min(r,Math.max(1,t)),c=this.getLineMaxColumn(l),d=new P(a,1,l,c),h=this._getDecorationsInRange(d,i,o,s);return L_(h,this._decorationProvider.getDecorationsInRange(d,i,o)),h}getDecorationsInRange(e,t=0,i=!1,o=!1,s=!1){let r=this.validateRange(e),a=this._getDecorationsInRange(r,t,i,s);return L_(a,this._decorationProvider.getDecorationsInRange(r,t,i,o)),a}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){let t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),o=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return Ls.fromDecorations(o).filter(s=>s.lineNumber===e)}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,i,o){let s=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),r=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,s,r,t,i,o)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){let i=this._decorations[e];if(!i)return;if(i.options.after){let a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(i.options.before){let a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}let o=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),r=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),s,r,o),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.startLineNumber)}_changeDecorationOptionsImpl(e,t){let i=this._decorations[e];if(!i)return;let o=!!(i.options.overviewRuler&&i.options.overviewRuler.color),s=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){let l=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.endLineNumber)}if(i.options.before||t.before){let l=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.startLineNumber)}let r=o!==s,a=LZ(t)!==XL(i);r||a?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,o=!1){let s=this.getVersionId(),r=t.length,a=0,l=i.length,c=0;this._onDidChangeDecorations.beginDeferredEmit();try{let d=new Array(l);for(;athis._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return xZ(this.getLineContent(e))+1}};Zc._MODEL_SYNC_LIMIT=50*1024*1024;Zc.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;Zc.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;Zc.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;Zc.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:nn.tabSize,indentSize:nn.indentSize,insertSpaces:nn.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:nn.trimAutoWhitespace,largeFileOptimizations:nn.largeFileOptimizations,bracketPairColorizationOptions:nn.bracketPairColorizationOptions};Zc=wf=vZ([jR(4,up),jR(5,ii),jR(6,yo)],Zc);QL=class{constructor(){this._decorationsTree0=new lp,this._decorationsTree1=new lp,this._injectedTextDecorationsTree=new lp}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(let i of t)i.range===null&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,o,s,r){let a=e.getVersionId(),l=this._intervalSearch(t,i,o,s,a,r);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,i,o,s,r){let a=this._decorationsTree0.intervalSearch(e,t,i,o,s,r),l=this._decorationsTree1.intervalSearch(e,t,i,o,s,r),c=this._injectedTextDecorationsTree.intervalSearch(e,t,i,o,s,r);return a.concat(l).concat(c)}getInjectedTextInInterval(e,t,i,o){let s=e.getVersionId(),r=this._injectedTextDecorationsTree.intervalSearch(t,i,o,!1,s,!1);return this._ensureNodesHaveRanges(e,r).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){let i=e.getVersionId(),o=this._injectedTextDecorationsTree.search(t,!1,i,!1);return this._ensureNodesHaveRanges(e,o).filter(s=>s.options.showIfCollapsed||!s.range.isEmpty())}getAll(e,t,i,o,s){let r=e.getVersionId(),a=this._search(t,i,o,r,s);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,o,s){if(i)return this._decorationsTree1.search(e,t,o,s);{let r=this._decorationsTree0.search(e,t,o,s),a=this._decorationsTree1.search(e,t,o,s),l=this._injectedTextDecorationsTree.search(e,t,o,s);return r.concat(a).concat(l)}}collectNodesFromOwner(e){let t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),o=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(o)}collectNodesPostOrder(){let e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){XL(e)?this._injectedTextDecorationsTree.insert(e):GR(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){XL(e)?this._injectedTextDecorationsTree.delete(e):GR(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){let i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){XL(e)?this._injectedTextDecorationsTree.resolveNode(e,t):GR(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,o){this._decorationsTree0.acceptReplace(e,t,i,o),this._decorationsTree1.acceptReplace(e,t,i,o),this._injectedTextDecorationsTree.acceptReplace(e,t,i,o)}};JL=class{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}},YR=class extends JL{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:em.Center}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if(typeof e=="string")return e;let i=e?t.getColor(e.id):null;return i?i.toString():""}},XR=class{constructor(e){var t;this.position=(t=e?.position)!==null&&t!==void 0?t:dr.Center,this.persistLane=e?.persistLane}},QR=class extends JL{constructor(e){var t,i;super(e),this.position=e.position,this.sectionHeaderStyle=(t=e.sectionHeaderStyle)!==null&&t!==void 0?t:null,this.sectionHeaderText=(i=e.sectionHeaderText)!==null&&i!==void 0?i:null}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e=="string"?Z.fromHex(e):t.getColor(e.id)}},ek=class n{static from(e){return e instanceof n?e:new n(e)}constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}},qi=class n{static register(e){return new n(e)}static createDynamic(e){return new n(e)}constructor(e){var t,i,o,s,r,a;this.description=e.description,this.blockClassName=e.blockClassName?Yl(e.blockClassName):null,this.blockDoesNotCollapse=(t=e.blockDoesNotCollapse)!==null&&t!==void 0?t:null,this.blockIsAfterEnd=(i=e.blockIsAfterEnd)!==null&&i!==void 0?i:null,this.blockPadding=(o=e.blockPadding)!==null&&o!==void 0?o:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?Yl(e.className):null,this.shouldFillLineOnLineBreak=(s=e.shouldFillLineOnLineBreak)!==null&&s!==void 0?s:null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.lineNumberHoverMessage=e.lineNumberHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new YR(e.overviewRuler):null,this.minimap=e.minimap?new QR(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new XR(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?Yl(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Yl(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?Yl(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?a7(e.linesDecorationsTooltip):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Yl(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Yl(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Yl(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Yl(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Yl(e.afterContentClassName):null,this.after=e.after?ek.from(e.after):null,this.before=e.before?ek.from(e.before):null,this.hideInCommentTokens=(r=e.hideInCommentTokens)!==null&&r!==void 0?r:!1,this.hideInStringTokens=(a=e.hideInStringTokens)!==null&&a!==void 0?a:!1}};qi.EMPTY=qi.register({description:"empty"});xz=[qi.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),qi.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),qi.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),qi.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];JR=class extends H{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new B),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._affectsLineNumber=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),(e=this._affectedInjectedTextLines)===null||e===void 0||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){var t,i;this._affectsMinimap||(this._affectsMinimap=!!(!((t=e.minimap)===null||t===void 0)&&t.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!(!((i=e.overviewRuler)===null||i===void 0)&&i.color)),this._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),this._affectsLineNumber||(this._affectsLineNumber=!!e.lineNumberClassName),this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){this._deferredCnt===0?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);let e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin,affectsLineNumber:this._affectsLineNumber};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}},e4=class extends H{constructor(){super(),this._fastEmitter=this._register(new B),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new B),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;let t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}},t4=class{constructor(){this._onDidChangeVisibleRanges=new B,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){let e=new i4(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0})}},i4=class{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){let i=e.map(o=>new Ne(o.startLineNumber,o.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}});function Bn(n,e,t){return Math.min(Math.max(n,e),t)}var pv,Zk,Cp=J(()=>{"use strict";_();v();b();pv=class{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}},Zk=class{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){let t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n{"use strict";_();v();b();qe();Yk=De("environmentService")});var jZ,Uz,GZ,Xk,T4,N4,A4,Kz=J(()=>{"use strict";_();v();b();Bg();cr();Cp();I4();Ur();qe();Aa();er();jZ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Uz=function(n,e){return function(t,i){e(t,i,n)}},GZ=De("ILanguageFeatureDebounceService");(function(n){let e=new WeakMap,t=0;function i(o){let s=e.get(o);return s===void 0&&(s=++t,e.set(o,s)),s}n.of=i})(Xk||(Xk={}));T4=class{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}},N4=class{constructor(e,t,i,o,s,r){this._logService=e,this._name=t,this._registry=i,this._default=o,this._min=s,this._max=r,this._cache=new Kr(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,i)=>u0(Xk.of(i),t),0)}get(e){let t=this._key(e),i=this._cache.get(t);return i?Bn(i.value,this._min,this._max):this.default()}update(e,t){let i=this._key(e),o=this._cache.get(i);o||(o=new Zk(6),this._cache.set(i,o));let s=Bn(o.update(t),this._min,this._max);return c0(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${s}ms`),s}_overall(){let e=new pv;for(let[,t]of this._cache)e.update(t.value);return e.value}default(){let e=this._overall()|0||this._default;return Bn(e,this._min,this._max)}},A4=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){var o,s,r;let a=(o=i?.min)!==null&&o!==void 0?o:50,l=(s=i?.max)!==null&&s!==void 0?s:a**2,c=(r=i?.key)!==null&&r!==void 0?r:void 0,d=`${Xk.of(e)},${a}${c?","+c:""}`,h=this._data.get(d);return h||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),h=new T4(a*1.5)):h=new N4(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l),this._data.set(d,h)),h}_overallAverage(){let e=new pv;for(let t of this._data.values())e.update(t.default());return e.value}};A4=jZ([Uz(0,En),Uz(1,Yk)],A4);_t(GZ,A4,1)});function ra(n){let e=new Array,t,i=0,o=0;for(;(t=gY.exec(n))!==null;){o=t.index||0,i{"use strict";_();v();b();ke();Ln();gY=new RegExp(`(\\\\)?\\$\\((${Xe.iconNameExpression}(?:${Xe.iconModifierExpression})?)\\)`,"g")});function cV(n){let e=mY(n);if(e&&e.length>0)return new Uint32Array(e)}function mY(n){if(Ks=0,ec(n,j4,4352),Ks>0||(ec(n,G4,4449),Ks>0)||(ec(n,Z4,4520),Ks>0)||(ec(n,If,12593),Ks))return kh.subarray(0,Ks);if(n>=44032&&n<=55203){let e=n-44032,t=e%588,i=Math.floor(e/588),o=Math.floor(t/28),s=t%28-1;if(i=0&&(s0)return kh.subarray(0,Ks)}}function ec(n,e,t){n>=t&&n>8&&(kh[Ks++]=n>>8&255),n>>16&&(kh[Ks++]=n>>16&255))}var Ks,kh,j4,G4,Z4,If,dV=J(()=>{"use strict";_();v();b();Ks=0,kh=new Uint32Array(10);j4=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),G4=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),Z4=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),If=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108])});function mV(...n){return function(e,t){for(let i=0,o=n.length;i0?[{start:0,end:e.length}]:[]:null}function _Y(n,e){let t=e.toLowerCase().indexOf(n.toLowerCase());return t===-1?null:[{start:t,end:t+n.length}]}function bY(n,e){return Q4(n.toLowerCase(),e.toLowerCase(),0,0)}function Q4(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]===e[i]){let o=null;return(o=Q4(n,e,t+1,i+1))?o5({start:i,end:i+1},o):null}return Q4(n,e,t,i+1)}function i5(n){return 97<=n&&n<=122}function gD(n){return 65<=n&&n<=90}function n5(n){return 48<=n&&n<=57}function _V(n){return n===32||n===9||n===10||n===13}function uD(n){return _V(n)||bV.has(n)}function hV(n,e){return n===e||uD(n)&&uD(e)}function uV(n){if(Y4.has(n))return Y4.get(n);let e,t=cV(n);return t&&(e=t),Y4.set(n,e),e}function vV(n){return i5(n)||gD(n)||n5(n)}function o5(n,e){return e.length===0?e=[n]:n.end===e[0].start?e[0].start=n.start:e.unshift(n),e}function CV(n,e){for(let t=e;t0&&!vV(n.charCodeAt(t-1)))return t}return n.length}function J4(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]!==e[i].toLowerCase())return null;{let o=null,s=i+1;for(o=J4(n,e,t+1,i+1);!o&&(s=CV(e,s)).6}function wY(n){let{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:o}=n;return t>.2&&e<.8&&i>.6&&o<.2}function yY(n){let e=0,t=0,i=0,o=0;for(let s=0;s60&&(e=e.substring(0,60));let t=vY(e);if(!wY(t)){if(!CY(t))return null;e=e.toLowerCase()}let i=null,o=0;for(n=n.toLowerCase();o0&&uD(n.charCodeAt(t-1)))return t;return n.length}function s5(n,e,t=!1){if(typeof n!="string"||typeof e!="string")return null;let i=fV.get(n);i||(i=new RegExp(l7(n),"i"),fV.set(n,i));let o=i.exec(e);return o?[{start:o.index,end:o.index+o[0].length}]:t?xY(n,e):SY(n,e)}function SV(n,e){let t=yp(n,n.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?LY(t):null}function EHe(n,e,t,i,o,s){let r=Math.min(13,n.length);for(;t"u")return[];let e=[],t=n[1];for(let i=n.length-1;i>1;i--){let o=n[i]+t,s=e[e.length-1];s&&s.end===o?s.end=o+1:e.push({start:o,end:o+1})}return e}function r5(){let n=[],e=[];for(let t=0;t<=Eh;t++)e[t]=0;for(let t=0;t<=Eh;t++)n.push(e.slice(0));return n}function xV(n){let e=[];for(let t=0;t<=n;t++)e[t]=0;return e}function X4(n,e,t,i,o){function s(a,l,c=" "){for(;a.lengths(a,3)).join("|")} +`;for(let a=0;a<=t;a++)a===0?r+=" |":r+=`${e[a-1]}|`,r+=n[a].slice(0,o+1).map(l=>s(l.toString(),3)).join("|")+` +`;return r}function DY(n,e,t,i){n=n.substr(e),t=t.substr(i),console.log(X4(Dh,n,n.length,t,t.length)),console.log(X4(bv,n,n.length,t,t.length)),console.log(X4(tc,n,n.length,t,t.length))}function dD(n,e){if(e<0||e>=n.length)return!1;let t=n.codePointAt(e);switch(t){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!J_(t)}}function gV(n,e){if(e<0||e>=n.length)return!1;switch(n.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function hD(n,e,t){return e[n]!==t[n]}function EY(n,e,t,i,o,s,r=!1){for(;eEh?Eh:n.length,l=i.length>Eh?Eh:i.length;if(t>=a||s>=l||a-t>l-s||!EY(e,t,a,o,s,l,!0))return;IY(a,l,t,s,e,o);let c=1,d=1,h=t,u=s,f=[!1];for(c=1,h=t;hw,W=M?Dh[c][d-1]+(tc[c][d-1]>0?-5:0):0,j=u>w+1&&tc[c][d-1]>0,G=j?Dh[c][d-2]+(tc[c][d-2]>0?-5:0):0;if(j&&(!M||G>=W)&&(!T||G>=N))Dh[c][d]=G,bv[c][d]=3,tc[c][d]=0;else if(M&&(!T||W>=N))Dh[c][d]=W,bv[c][d]=2,tc[c][d]=0;else if(T)Dh[c][d]=N,bv[c][d]=1,tc[c][d]=tc[c-1][d-1]+1;else throw new Error("not possible")}}if(kY&&DY(n,t,i,s),!f[0]&&!r.firstMatchCanBeWeak)return;c--,d--;let g=[Dh[c][d],s],m=0,C=0;for(;c>=1;){let w=d;do{let y=bv[c][w];if(y===3)w=w-2;else if(y===2)w=w-1;else break}while(w>=1);m>1&&e[t+c-1]===o[s+d-1]&&!hD(w+s-1,i,o)&&m+1>tc[c][w]&&(w=d),w===d?m++:m=1,C||(C=w),c--,d=w-1,g.push(d)}l===a&&r.boostFullMatch&&(g[0]+=2);let S=C-a;return g[0]-=S,g}function IY(n,e,t,i,o,s){let r=n-1,a=e-1;for(;r>=t&&a>=i;)o[r]===s[a]&&(t5[r]=a,r--),a--}function TY(n,e,t,i,o,s,r,a,l,c,d){if(e[t]!==s[r])return Number.MIN_SAFE_INTEGER;let h=1,u=!1;return r===t-i?h=n[t]===o[r]?7:5:hD(r,o,s)&&(r===0||!hD(r-1,o,s))?(h=n[t]===o[r]?7:5,u=!0):dD(s,r)&&(r===0||!dD(s,r-1))?h=5:(dD(s,r-1)||gV(s,r-1))&&(h=5,u=!0),h>1&&t===i&&(d[0]=!0),u||(u=hD(r,o,s)||dD(s,r-1)||gV(s,r-1)),t===i?r>l&&(h-=u?3:5):c?h+=u?2:0:h+=u?0:1,r+1===a&&(h-=u?3:5),h}function IHe(n,e,t,i,o,s,r){return NY(n,e,t,i,o,s,!0,r)}function NY(n,e,t,i,o,s,r,a){let l=yp(n,e,t,i,o,s,a);if(l&&!r)return l;if(n.length>=3){let c=Math.min(7,n.length-1);for(let d=t+1;dl[0])&&(l=u))}}}return l}function AY(n,e){if(e+1>=n.length)return;let t=n[e],i=n[e+1];if(t!==i)return n.slice(0,e)+i+t+n.slice(e+2)}var kHe,vv,bV,Y4,SY,xY,fV,Eh,LV,t5,tc,Dh,bv,kY,Tf,fD,mD=J(()=>{"use strict";_();v();b();cr();dV();ot();kHe=pV.bind(void 0,!1),vv=pV.bind(void 0,!0);bV=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(n=>bV.add(n.charCodeAt(0)));Y4=new Map;SY=mV(vv,wV,_Y),xY=mV(vv,wV,bY),fV=new Kr(1e4);Eh=128;LV=xV(2*Eh),t5=xV(2*Eh),tc=r5(),Dh=r5(),bv=r5(),kY=!1;(function(n){n.Default=[-100,0];function e(t){return!t||t.length===2&&t[0]===-100&&t[1]===0}n.isDefault=e})(Tf||(Tf={}));fD=class{constructor(e,t){this.firstMatchCanBeWeak=e,this.boostFullMatch=t}};fD.default={boostFullMatch:!0,firstMatchCanBeWeak:!1}});function kV(n){return n.replace(RY,(e,t)=>t?e:`\\${e}`)}function DV(n){return n.replace(PY,e=>`\\${e}`)}function pD(n){return n.indexOf(MY)===-1?n:n.replace(OY,(e,t,i,o)=>i?e:t||o||"")}function EV(n){return n?n.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}function Sp(n){a5.lastIndex=0;let e="",t=[],i=0;for(;;){let o=a5.lastIndex,s=a5.exec(n),r=n.substring(o,s?.index);if(r.length>0){e+=r;for(let a=0;a{"use strict";_();v();b();mD();ot();Ln();MY="$(",l5=new RegExp(`\\$\\(${Xe.iconNameExpression}(?:${Xe.iconModifierExpression})?\\)`,"g"),RY=new RegExp(`(\\\\)?${l5.source}`,"g");PY=new RegExp(`\\\\${l5.source}`,"g");OY=new RegExp(`(\\s)?(\\\\)?${l5.source}(\\s)?`,"g");a5=new RegExp(`\\$\\(${Xe.iconNameCharacter}+\\)`,"g")});function FY(n){return ic(n)?!n.value:Array.isArray(n)?n.every(FY):!0}function ic(n){return n instanceof Cv?!0:n&&typeof n=="object"?typeof n.value=="string"&&(typeof n.isTrusted=="boolean"||typeof n.isTrusted=="object"||n.isTrusted===void 0)&&(typeof n.supportThemeIcons=="boolean"||n.supportThemeIcons===void 0):!1}function IV(n,e){return n===e?!0:!n||!e?!1:n.value===e.value&&n.isTrusted===e.isTrusted&&n.supportThemeIcons===e.supportThemeIcons&&n.supportHtml===e.supportHtml&&(n.baseUri===e.baseUri||!!n.baseUri&&!!e.baseUri&&XW(Oe.from(n.baseUri),Oe.from(e.baseUri)))}function BY(n){return n.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function WY(n,e){var t,i;let o=(i=(t=n.match(/^`+/gm))===null||t===void 0?void 0:t.reduce((r,a)=>r.length>a.length?r:a).length)!==null&&i!==void 0?i:0,s=o>=3?o+1:3;return[`${"`".repeat(s)}${e}`,n,`${"`".repeat(s)}`].join(` +`)}function wv(n){return n.replace(/"/g,""")}function bD(n){return n&&n.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function TV(n){let e=[],t=n.split("|").map(o=>o.trim());n=t[0];let i=t[1];if(i){let o=/height=(\d+)/.exec(i),s=/width=(\d+)/.exec(i),r=o?o[1]:"",a=s?s[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(r));l&&e.push(`width="${a}"`),c&&e.push(`height="${r}"`)}return{href:n,dimensions:e}}var Cv,Lp=J(()=>{"use strict";_();v();b();xt();xp();bf();ot();sn();Cv=class{constructor(e="",t=!1){var i,o,s;if(this.value=e,typeof this.value!="string")throw Sd("value");typeof t=="boolean"?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=(i=t.isTrusted)!==null&&i!==void 0?i:void 0,this.supportThemeIcons=(o=t.supportThemeIcons)!==null&&o!==void 0?o:!1,this.supportHtml=(s=t.supportHtml)!==null&&s!==void 0?s:!1)}appendText(e,t=0){return this.value+=BY(this.supportThemeIcons?kV(e):e).replace(/([ \t]+)/g,(i,o)=>" ".repeat(o.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\ +`:` + +`),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=` +${WY(t,e)} +`,this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){let i=new RegExp(gs(t),"g");return e.replace(i,(o,s)=>e.charAt(s-1)!=="\\"?`\\${o}`:o)}}});var XV,QV,JV,eH,tH,Mv,iH,MD,E5=J(()=>{"use strict";_();v();b();Ge();(function(n){n.inspectTokensAction=p("inspectTokens","Developer: Inspect Tokens")})(XV||(XV={}));(function(n){n.gotoLineActionLabel=p("gotoLineActionLabel","Go to Line/Column...")})(QV||(QV={}));(function(n){n.helpQuickAccessActionLabel=p("helpQuickAccess","Show all Quick Access Providers")})(JV||(JV={}));(function(n){n.quickCommandActionLabel=p("quickCommandActionLabel","Command Palette"),n.quickCommandHelp=p("quickCommandActionHelp","Show And Run Commands")})(eH||(eH={}));(function(n){n.quickOutlineActionLabel=p("quickOutlineActionLabel","Go to Symbol..."),n.quickOutlineByCategoryActionLabel=p("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(tH||(tH={}));(function(n){n.editorViewAccessibleLabel=p("editorViewAccessibleLabel","Editor content"),n.accessibilityHelpMessage=p("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(Mv||(Mv={}));(function(n){n.toggleHighContrast=p("toggleHighContrast","Toggle High Contrast Theme")})(iH||(iH={}));(function(n){n.bulkEditServiceSummary=p("bulkEditServiceSummary","Made {0} edits in {1} files")})(MD||(MD={}))});function uZe(n=aa){return(e,t)=>Ht(e,t,n)}function fZe(){return(n,e)=>n.equals(e)}function gZe(n,e,t){return!n||!e?n===e:t(n,e)}var aa,R5=J(()=>{"use strict";_();v();b();wt();aa=(n,e)=>n===e});function RX(n,e){var t;let i=P5.get(n);if(i)return i;let o=PX(n,e);if(o){let s=(t=fH.get(o))!==null&&t!==void 0?t:0;s++,fH.set(o,s);let r=s===1?o:`${o}#${s}`;return P5.set(n,r),r}}function PX(n,e){let t=P5.get(n);if(t)return t;let i=e.owner?FX(e.owner)+".":"",o,s=e.debugNameSource;if(s!==void 0)if(typeof s=="function"){if(o=s(),o!==void 0)return i+o}else return i+s;let r=e.referenceFn;if(r!==void 0&&(o=Pp(r),o!==void 0))return i+o;if(e.owner!==void 0){let a=OX(e.owner,n);if(a!==void 0)return i+a}}function OX(n,e){for(let t in n)if(n[t]===e)return t}function FX(n){var e;let t=mH.get(n);if(t)return t;let i=BX(n),o=(e=gH.get(i))!==null&&e!==void 0?e:0;o++,gH.set(i,o);let s=o===1?i:`${i}#${o}`;return mH.set(n,s),s}function BX(n){let e=n.constructor;return e?e.name:"Object"}function Pp(n){let e=n.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),o=i?i[1]:void 0;return o?.trim()}var zn,fH,P5,gH,mH,Fv=J(()=>{"use strict";_();v();b();zn=class{constructor(e,t,i){this.owner=e,this.debugNameSource=t,this.referenceFn=i}getDebugName(e){return RX(e,this)}},fH=new Map,P5=new WeakMap;gH=new Map,mH=new WeakMap});function _H(n){pH=n}function qs(){return pH}function WX(n){let e=new Array,t=[],i="";function o(r){if("length"in r)for(let a of r)a&&o(a);else"text"in r?(i+=`%c${r.text}`,e.push(r.style),r.data&&t.push(...r.data)):"data"in r&&t.push(...r.data)}o(n);let s=[i,...e];return s.push(...t),s}function Op(n){return Qa(n,{color:"black"})}function Bv(n){return Qa(UX(`${n}: `,10),{color:"black",bold:!0})}function Qa(n,e={color:"black"}){function t(o){return Object.entries(o).reduce((s,[r,a])=>`${s}${r}:${a};`,"")}let i={color:e.color};return e.strikeThrough&&(i["text-decoration"]="line-through"),e.bold&&(i["font-weight"]="bold"),{text:n,style:t(i)}}function Wv(n,e){switch(typeof n){case"number":return""+n;case"string":return n.length+2<=e?`"${n}"`:`"${n.substr(0,e-7)}"+...`;case"boolean":return n?"true":"false";case"undefined":return"undefined";case"object":return n===null?"null":Array.isArray(n)?zX(n,e):VX(n,e);case"symbol":return n.toString();case"function":return`[[Function${n.name?" "+n.name:""}]]`;default:return""+n}}function zX(n,e){let t="[ ",i=!0;for(let o of n){if(i||(t+=", "),t.length-5>e){t+="...";break}i=!1,t+=`${Wv(o,e-t.length)}`}return t+=" ]",t}function VX(n,e){let t="{ ",i=!0;for(let[o,s]of Object.entries(n)){if(i||(t+=", "),t.length-5>e){t+="...";break}i=!1,t+=`${o}: ${Wv(s,e-t.length)}`}return t+=" }",t}function HX(n,e){let t="";for(let i=1;i<=e;i++)t+=n;return t}function UX(n,e){for(;n.length{"use strict";_();v();b();HD=class{constructor(){this.indentation=0,this.changedObservablesSets=new WeakMap}textToConsoleArgs(e){return WX([Op(HX("| ",this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[Op(" "),Qa(Wv(e.oldValue,70),{color:"red",strikeThrough:!0}),Op(" "),Qa(Wv(e.newValue,60),{color:"green"})]:[Op(" (unchanged)")]:[Op(" "),Qa(Wv(e.newValue,60),{color:"green"}),Op(" (initial)")]}handleObservableChanged(e,t){console.log(...this.textToConsoleArgs([Bv("observable value changed"),Qa(e.debugName,{color:"BlueViolet"}),...this.formatInfo(t)]))}formatChanges(e){if(e.size!==0)return Qa(" (changed deps: "+[...e].map(t=>t.debugName).join(", ")+")",{color:"gray"})}handleDerivedCreated(e){let t=e.handleChange;this.changedObservablesSets.set(e,new Set),e.handleChange=(i,o)=>(this.changedObservablesSets.get(e).add(i),t.apply(e,[i,o]))}handleDerivedRecomputed(e,t){let i=this.changedObservablesSets.get(e);console.log(...this.textToConsoleArgs([Bv("derived recomputed"),Qa(e.debugName,{color:"BlueViolet"}),...this.formatInfo(t),this.formatChanges(i),{data:[{fn:e._computeFn}]}])),i.clear()}handleFromEventObservableTriggered(e,t){console.log(...this.textToConsoleArgs([Bv("observable from event triggered"),Qa(e.debugName,{color:"BlueViolet"}),...this.formatInfo(t),{data:[{fn:e._getValue}]}]))}handleAutorunCreated(e){let t=e.handleChange;this.changedObservablesSets.set(e,new Set),e.handleChange=(i,o)=>(this.changedObservablesSets.get(e).add(i),t.apply(e,[i,o]))}handleAutorunTriggered(e){let t=this.changedObservablesSets.get(e);console.log(...this.textToConsoleArgs([Bv("autorun"),Qa(e.debugName,{color:"BlueViolet"}),this.formatChanges(t),{data:[{fn:e._runFn}]}])),t.clear(),this.indentation++}handleAutorunFinished(e){this.indentation--}handleBeginTransaction(e){let t=e.getDebugName();t===void 0&&(t=""),console.log(...this.textToConsoleArgs([Bv("transaction"),Qa(t,{color:"BlueViolet"}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}}});function vH(n){bH=n}function CH(n){KX=n}function yH(n){wH=n}function ri(n,e){let t=new Bp(n,e);try{n(t)}finally{t.finish()}}function Wp(n){if(UD)n(UD);else{let e=new Bp(n,void 0);UD=e;try{n(e)}finally{e.finish(),UD=void 0}}}async function TZe(n,e){let t=new Bp(n,e);try{await n(t)}finally{t.finish()}}function Pf(n,e,t){n?e(n):ri(e,t)}function ct(n,e){let t;return typeof n=="string"?t=new zn(void 0,n,void 0):t=new zn(n,void 0,void 0),new Vv(t,e,aa)}function NZe(n,e){var t;return new Vv(new zn(n.owner,n.debugName,void 0),e,(t=n.equalsFn)!==null&&t!==void 0?t:aa)}function F5(n,e){let t;return typeof n=="string"?t=new zn(void 0,n,void 0):t=new zn(n,void 0,void 0),new O5(t,e,aa)}var bH,KX,wH,zv,td,UD,Bp,Vv,O5,zp=J(()=>{"use strict";_();v();b();R5();Fv();Fp();zv=class{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){let i=t===void 0?void 0:e,o=t===void 0?e:t;return wH({owner:i,debugName:()=>{let s=Pp(o);if(s!==void 0)return s;let a=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(o.toString());if(a)return`${this.debugName}.${a[2]}`;if(!i)return`${this.debugName} (mapped)`},debugReferenceFn:o},s=>o(this.read(s),s))}recomputeInitiallyAndOnChange(e,t){return e.add(bH(this,t)),this}},td=class extends zv{constructor(){super(...arguments),this.observers=new Set}addObserver(e){let t=this.observers.size;this.observers.add(e),t===0&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&this.observers.size===0&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}};Bp=class{constructor(e,t){var i;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(i=qs())===null||i===void 0||i.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():Pp(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var e;let t=this.updatingObservers;for(let i=0;i{},()=>`Setting ${this.debugName}`));try{let r=this._value;this._setValue(e),(o=qs())===null||o===void 0||o.handleObservableChanged(this,{oldValue:r,newValue:e,change:i,didChange:!0,hadValue:!0});for(let a of this.observers)t.updateObserver(a,this),a.handleChange(this,i)}finally{s&&s.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}};O5=class extends Vv{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;(e=this._value)===null||e===void 0||e.dispose()}}});function We(n,e){return e!==void 0?new Ah(new zn(n,void 0,e),e,void 0,void 0,void 0,aa):new Ah(new zn(void 0,void 0,n),n,void 0,void 0,void 0,aa)}function Vp(n,e){var t;return new Ah(new zn(n.owner,n.debugName,n.debugReferenceFn),e,void 0,void 0,n.onLastObserverRemoved,(t=n.equalsFn)!==null&&t!==void 0?t:aa)}function $X(n,e){var t;return new Ah(new zn(n.owner,n.debugName,void 0),e,n.createEmptyChangeSummary,n.handleChange,void 0,(t=n.equalityComparer)!==null&&t!==void 0?t:aa)}function pr(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);let o=new ae;return new Ah(new zn(i,void 0,t),s=>(o.clear(),t(s,o)),void 0,void 0,()=>o.dispose(),aa)}function Ja(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);let o=new ae;return new Ah(new zn(i,void 0,t),s=>{o.clear();let r=t(s);return r&&o.add(r),r},void 0,void 0,()=>o.dispose(),aa)}var Ah,Hv=J(()=>{"use strict";_();v();b();Na();R5();le();zp();Fv();Fp();yH(Vp);Ah=class extends td{get debugName(){var e;return(e=this._debugNameData.getDebugName(this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,i,o,s=void 0,r){var a,l;super(),this._debugNameData=e,this._computeFn=t,this.createChangeSummary=i,this._handleChange=o,this._handleLastObserverRemoved=s,this._equalityComparator=r,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=(a=this.createChangeSummary)===null||a===void 0?void 0:a.call(this),(l=qs())===null||l===void 0||l.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(let t of this.dependencies)t.removeObserver(this);this.dependencies.clear(),(e=this._handleLastObserverRemoved)===null||e===void 0||e.call(this)}get(){var e;if(this.observers.size===0){let t=this._computeFn(this,(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this));return this.onLastObserverRemoved(),t}else{do{if(this.state===1){for(let t of this.dependencies)if(t.reportChanges(),this.state===2)break}this.state===1&&(this.state=3),this._recomputeIfNeeded()}while(this.state!==3);return this.value}}_recomputeIfNeeded(){var e,t;if(this.state===3)return;let i=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=i;let o=this.state!==0,s=this.value;this.state=3;let r=this.changeSummary;this.changeSummary=(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this);try{this.value=this._computeFn(this,r)}finally{for(let l of this.dependenciesToBeRemoved)l.removeObserver(this);this.dependenciesToBeRemoved.clear()}let a=o&&!this._equalityComparator(s,this.value);if((t=qs())===null||t===void 0||t.handleDerivedRecomputed(this,{oldValue:s,newValue:this.value,change:void 0,didChange:a,hadValue:o}),a)for(let l of this.observers)l.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;let t=this.updateCount===1;if(this.state===3&&(this.state=1,!t))for(let i of this.observers)i.handlePossibleChange(this);if(t)for(let i of this.observers)i.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){let t=[...this.observers];for(let i of t)i.endUpdate(this)}Fr(()=>this.updateCount>=0)}handlePossibleChange(e){if(this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=1;for(let t of this.observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){let i=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:s=>s===e},this.changeSummary):!0,o=this.state===3;if(i&&(this.state===1||o)&&(this.state=2,o))for(let s of this.observers)s.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);let t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){let t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){let t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}});function pt(n){return new Hp(new zn(void 0,void 0,n),n,void 0,void 0)}function Uv(n,e){var t;return new Hp(new zn(n.owner,n.debugName,(t=n.debugReferenceFn)!==null&&t!==void 0?t:e),e,void 0,void 0)}function Mh(n,e){var t;return new Hp(new zn(n.owner,n.debugName,(t=n.debugReferenceFn)!==null&&t!==void 0?t:e),e,n.createEmptyChangeSummary,n.handleChange)}function Jn(n){let e=new ae,t=Uv({owner:void 0,debugName:void 0,debugReferenceFn:n},i=>{e.clear(),n(i,e)});return be(()=>{t.dispose(),e.dispose()})}var Hp,B5=J(()=>{"use strict";_();v();b();Na();le();Fv();Fp();Hp=class{get debugName(){var e;return(e=this._debugNameData.getDebugName(this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,i,o){var s,r;this._debugNameData=e,this._runFn=t,this.createChangeSummary=i,this._handleChange=o,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(s=this.createChangeSummary)===null||s===void 0?void 0:s.call(this),(r=qs())===null||r===void 0||r.handleAutorunCreated(this),this._runIfNeeded(),ou(this)}dispose(){this.disposed=!0;for(let e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),su(this)}_runIfNeeded(){var e,t,i;if(this.state===3)return;let o=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=o,this.state=3;let s=this.disposed;try{if(!s){(e=qs())===null||e===void 0||e.handleAutorunTriggered(this);let r=this.changeSummary;this.changeSummary=(t=this.createChangeSummary)===null||t===void 0?void 0:t.call(this),this._runFn(this,r)}}finally{s||(i=qs())===null||i===void 0||i.handleAutorunFinished(this);for(let r of this.dependenciesToBeRemoved)r.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===3&&(this.state=1),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===1){this.state=3;for(let e of this.dependencies)if(e.reportChanges(),this.state===2)break}this._runIfNeeded()}while(this.state!==3);this.updateCount--,Fr(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=1)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary))&&(this.state=2)}readObservable(e){if(this.disposed)return e.get();e.addObserver(this);let t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}};(function(n){n.Observer=Hp})(pt||(pt={}))});function Rh(n){return new W5(n)}function $t(n,e){return new Of(n,e)}function fo(n,e){return new z5(n,e)}function Kv(n){return typeof n=="string"?new KD(n):new KD(void 0,n)}function SH(n){let e=new $D(!1,void 0);return n.addObserver(e),be(()=>{n.removeObserver(e)})}function Ph(n,e){let t=new $D(!0,e);return n.addObserver(t),e?e(n.get()):n.reportChanges(),be(()=>{n.removeObserver(t)})}function rYe(n,e,t,i){let o=new qD(t,i);return Vp({debugReferenceFn:t,owner:n,onLastObserverRemoved:()=>{o.dispose(),o=new qD(t)}},r=>(o.setItems(e.read(r)),o.getItems()))}var W5,Of,z5,KD,$D,qD,xH=J(()=>{"use strict";_();v();b();ye();le();zp();Fv();Hv();Fp();W5=class extends zv{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}};Of=class n extends td{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=i=>{var o;let s=this._getValue(i),r=this.value,a=!this.hasValue||r!==s,l=!1;a&&(this.value=s,this.hasValue&&(l=!0,Pf(n.globalTransaction,c=>{var d;(d=qs())===null||d===void 0||d.handleFromEventObservableTriggered(this,{oldValue:r,newValue:s,change:void 0,didChange:a,hadValue:this.hasValue});for(let h of this.observers)c.updateObserver(h,this),h.handleChange(this,void 0)},()=>{let c=this.getDebugName();return"Event fired"+(c?`: ${c}`:"")})),this.hasValue=!0),l||(o=qs())===null||o===void 0||o.handleFromEventObservableTriggered(this,{oldValue:r,newValue:s,change:void 0,didChange:a,hadValue:this.hasValue})}}getDebugName(){return Pp(this._getValue)}get debugName(){let e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}};(function(n){n.Observer=Of;function e(t,i){let o=!1;Of.globalTransaction===void 0&&(Of.globalTransaction=t,o=!0);try{i()}finally{o&&(Of.globalTransaction=void 0)}}n.batchEventsGlobally=e})($t||($t={}));z5=class extends td{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{ri(i=>{for(let o of this.observers)i.updateObserver(o,this),o.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}};KD=class extends td{get debugName(){var e;return(e=new zn(this._owner,this._debugName,void 0).getDebugName(this))!==null&&e!==void 0?e:"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){ri(i=>{this.trigger(i,t)},()=>`Trigger signal ${this.debugName}`);return}for(let i of this.observers)e.updateObserver(i,this),i.handleChange(this,t)}get(){}};CH(SH);vH(Ph);$D=class{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter--,this._counter===0&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges())}handlePossibleChange(e){}handleChange(e,t){}};qD=class{constructor(e,t){this._map=e,this._keySelector=t,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach(e=>e.store.dispose()),this._cache.clear()}setItems(e){let t=[],i=new Set(this._cache.keys());for(let o of e){let s=this._keySelector?this._keySelector(o):o,r=this._cache.get(s);if(r)i.delete(s);else{let a=new ae;r={out:this._map(o,a),store:a},this._cache.set(s,r)}t.push(r.out)}for(let o of i)this._cache.get(o).store.dispose(),this._cache.delete(o);this._items=t}getItems(){return this._items}}});function V5(n,e,t,i){return e||(e=o=>o!=null),new Promise((o,s)=>{let r=!0,a=!1,l=n.map(d=>({isFinished:e(d),error:t?t(d):!1,state:d})),c=pt(d=>{let{isFinished:h,error:u,state:f}=l.read(d);(h||u)&&(r?a=!0:c.dispose(),u?s(u===!0?f:u):o(f))});if(i){let d=i.onCancellationRequested(()=>{c.dispose(),d.dispose(),s(new Dr)});if(i.isCancellationRequested){c.dispose(),d.dispose(),s(new Dr);return}}r=!1,a&&c.dispose()})}var LH=J(()=>{"use strict";_();v();b();B5();xt()});var qX,bn=J(()=>{"use strict";_();v();b();zp();Hv();B5();xH();LH();Fp();qX=!1;qX&&_H(new HD)});var rc,dE=J(()=>{"use strict";_();v();b();qe();rc=De("editorWorkerService")});var ls,x1=J(()=>{"use strict";_();v();b();qe();ls=De("themeService")});function A2(){return H_&&!!H_.VSCODE_DEV}function tF(n){if(A2()){let e=bJ();return e.add(n),{dispose(){e.delete(n)}}}else return{dispose(){}}}function bJ(){N2||(N2=new Set);let n=globalThis;return n.$hotReload_applyNewExports||(n.$hotReload_applyNewExports=e=>{let t={config:{mode:void 0},...e};for(let i of N2){let o=i(t);if(o)return o}}),N2}var N2,GU=J(()=>{"use strict";_();v();b();pT();A2()&&tF(({oldExports:n,newSrc:e,config:t})=>{if(t.mode==="patch-prototype")return i=>{var o,s;for(let r in i){let a=i[r];if(console.log(`[hot-reload] Patching prototype methods of '${r}'`,{exportedItem:a}),typeof a=="function"&&a.prototype){let l=n[r];if(l){for(let c of Object.getOwnPropertyNames(a.prototype)){let d=Object.getOwnPropertyDescriptor(a.prototype,c),h=Object.getOwnPropertyDescriptor(l.prototype,c);((o=d?.value)===null||o===void 0?void 0:o.toString())!==((s=h?.value)===null||s===void 0?void 0:s.toString())&&console.log(`[hot-reload] Patching prototype method '${r}.${c}'`),Object.defineProperty(l.prototype,c,d)}i[r]=l}}}return!0}})});function YU(n,e,t,i){if(n.length===0)return e;if(e.length===0)return n;let o=[],s=0,r=0;for(;sd?(o.push(l),r++):(o.push(i(a,l)),s++,r++)}for(;s`Apply decorations from ${e.debugName}`},o=>{let s=e.read(o);i.set(s)})),t.add({dispose:()=>{i.clear()}}),t}function ig(n,e){return n.appendChild(e),be(()=>{n.removeChild(e)})}function XU(n,e){return n.prepend(e),be(()=>{n.removeChild(e)})}function iF(n,e,t){let i=e.get(),o=i,s=i,r=ct("animatedValue",i),a=-1,l=300,c;t.add(Mh({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(h,u)=>(h.didChange(e)&&(u.animate=u.animate||h.change),!0)},(h,u)=>{c!==void 0&&(n.cancelAnimationFrame(c),c=void 0),o=s,i=e.read(h),a=Date.now()-(u.animate?0:l),d()}));function d(){let h=Date.now()-a;s=Math.floor(vJ(h,o,i-o,l)),h{for(let[i,o]of Object.entries(e))o&&typeof o=="object"&&"read"in o&&(o=o.read(t)),typeof o=="number"&&(o=`${o}px`),i=i.replace(/[A-Z]/g,s=>"-"+s.toLowerCase()),n.style[i]=o})}function Ts(n,e){return CJ([n],e),n}function CJ(n,e){A2()&&fo("reload",i=>tF(({oldExports:o})=>{if([...Object.values(o)].some(s=>n.includes(s)))return s=>(i(void 0),!0)})).read(e)}function m_(n,e,t,i){let o=new ae,s=[];return o.add(Jn((r,a)=>{let l=e.read(r),c=new Map,d=new Map;t&&t(!0),n.changeViewZones(h=>{for(let u of s)h.removeZone(u),i?.delete(u);s.length=0;for(let u of l){let f=h.addZone(u);u.setZoneId&&u.setZoneId(f),s.push(f),i?.add(f),c.set(u,f)}}),t&&t(!1),a.add(Mh({createEmptyChangeSummary(){return{zoneIds:[]}},handleChange(h,u){let f=d.get(h.changedObservable);return f!==void 0&&u.zoneIds.push(f),!0}},(h,u)=>{for(let f of l)f.onChange&&(d.set(f.onChange,c.get(f)),f.onChange.read(h));t&&t(!0),n.changeViewZones(f=>{for(let g of u.zoneIds)f.layoutZone(g)}),t&&t(!1)}))})),o.add({dispose(){t&&t(!0),n.changeViewZones(r=>{for(let a of s)r.removeZone(a)}),i?.clear(),t&&t(!1)}}),o}function nF(n,e){let t=Mu(e,o=>o.original.startLineNumber<=n.lineNumber);if(!t)return P.fromPositions(n);if(t.original.endLineNumberExclusive<=n.lineNumber){let o=n.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return P.fromPositions(new U(o,n.column))}if(!t.innerChanges)return P.fromPositions(new U(t.modified.startLineNumber,1));let i=Mu(t.innerChanges,o=>o.originalRange.getStartPosition().isBeforeOrEqual(n));if(!i){let o=n.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return P.fromPositions(new U(o,n.column))}if(i.originalRange.containsPosition(n))return i.modifiedRange;{let o=wJ(i.originalRange.getEndPosition(),n);return P.fromPositions(o.addToPosition(i.modifiedRange.getEndPosition()))}}function wJ(n,e){return n.lineNumber===e.lineNumber?new ws(0,e.column-n.column):new ws(e.lineNumber-n.lineNumber,e.column-1)}function mc(n,e,t){let i=n.bindTo(e);return Uv({debugName:()=>`Set Context Key "${n.key}"`},o=>{i.set(t(o))})}function QU(n,e){let t;return n.filter(i=>{let o=e(i,t);return t=i,o})}var u_,f_,Gh,M2,ZU,ca=J(()=>{"use strict";_();v();b();Dl();fs();GU();le();bn();OA();ft();Ke();om();u_=class extends H{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new vm(e,t)),this._width=ct(this,this.elementSizeObserver.getWidth()),this._height=ct(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>ri(o=>{this._width.set(this.elementSizeObserver.getWidth(),o),this._height.set(this.elementSizeObserver.getHeight(),o)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}};f_=class extends H{constructor(e,t,i){super(),this._register(new M2(e,i)),this._register(br(i,{height:t.actualHeight,top:t.actualTop}))}},Gh=class{get afterLineNumber(){return this._afterLineNumber.get()}constructor(e,t){this._afterLineNumber=e,this.heightInPx=t,this.domNode=document.createElement("div"),this._actualTop=ct(this,void 0),this._actualHeight=ct(this,void 0),this.actualTop=this._actualTop,this.actualHeight=this._actualHeight,this.showInHiddenAreas=!0,this.onChange=this._afterLineNumber,this.onDomNodeTop=i=>{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}},M2=class n{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${n._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}};M2._counter=0;ZU=class extends un{dispose(){super.dispose(!0)}}});var AJ,MJ,DF,P1,Z2,fK=J(()=>{"use strict";_();v();b();ke();Ef();$n();Lp();le();bn();Hv();Ln();xi();ca();Bo();ft();Ke();Yo();Ge();qe();AJ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},MJ=function(n,e){return function(t,i){e(t,i,n)}},P1=DF=class extends H{static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,i,o){super(),this._editors=e,this._diffModel=t,this._options=i,this._instantiationService=o,this._modifiedOutlineSource=Ja(this,l=>{let c=this._editors.modifiedModel.read(l),d=DF._breadcrumbsSourceFactory.read(l);return!c||!d?void 0:d(c,this._instantiationService)}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(l=>{if(l.reason===1)return;let c=this._diffModel.get();ri(d=>{for(let h of this._editors.original.getSelections()||[])c?.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,0,d),c?.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,0,d)})})),this._register(this._editors.modified.onDidChangeCursorPosition(l=>{if(l.reason===1)return;let c=this._diffModel.get();ri(d=>{for(let h of this._editors.modified.getSelections()||[])c?.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,0,d),c?.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,0,d)})}));let s=this._diffModel.map((l,c)=>{var d,h;let u=(d=l?.unchangedRegions.read(c))!==null&&d!==void 0?d:[];return u.length===1&&u[0].modifiedLineNumber===1&&u[0].lineCount===((h=this._editors.modifiedModel.read(c))===null||h===void 0?void 0:h.getLineCount())?[]:u});this.viewZones=pr(this,(l,c)=>{let d=this._modifiedOutlineSource.read(l);if(!d)return{origViewZones:[],modViewZones:[]};let h=[],u=[],f=this._options.renderSideBySide.read(l),g=s.read(l);for(let m of g)if(!m.shouldHideControls(l)){{let C=We(this,w=>m.getHiddenOriginalRange(w).startLineNumber-1),S=new Gh(C,24);h.push(S),c.add(new Z2(this._editors.original,S,m,m.originalUnchangedRange,!f,d,w=>this._diffModel.get().ensureModifiedLineIsVisible(w,2,void 0),this._options))}{let C=We(this,w=>m.getHiddenModifiedRange(w).startLineNumber-1),S=new Gh(C,24);u.push(S),c.add(new Z2(this._editors.modified,S,m,m.modifiedUnchangedRange,!1,d,w=>this._diffModel.get().ensureModifiedLineIsVisible(w,2,void 0),this._options))}}return{origViewZones:h,modViewZones:u}});let r={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new Cv(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(p("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Xe.asClassName(ue.fold),zIndex:10001};this._register(g_(this._editors.original,We(this,l=>{let c=s.read(l),d=c.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:r}));for(let h of c)h.shouldHideControls(l)&&d.push({range:P.fromPositions(new U(h.originalLineNumber,1)),options:a});return d}))),this._register(g_(this._editors.modified,We(this,l=>{let c=s.read(l),d=c.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:r}));for(let h of c)h.shouldHideControls(l)&&d.push({range:Ne.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:a});return d}))),this._register(pt(l=>{let c=s.read(l);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(c.map(d=>d.getHiddenOriginalRange(l).toInclusiveRange()).filter(bc)),this._editors.modified.setHiddenAreas(c.map(d=>d.getHiddenModifiedRange(l).toInclusiveRange()).filter(bc))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(l=>{var c;if(!l.event.rightButton&&l.target.position&&(!((c=l.target.element)===null||c===void 0)&&c.className.includes("fold-unchanged"))){let d=l.target.position.lineNumber,h=this._diffModel.get();if(!h)return;let u=h.unchangedRegions.get().find(f=>f.modifiedUnchangedRange.includes(d));if(!u)return;u.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(l=>{var c;if(!l.event.rightButton&&l.target.position&&(!((c=l.target.element)===null||c===void 0)&&c.className.includes("fold-unchanged"))){let d=l.target.position.lineNumber,h=this._diffModel.get();if(!h)return;let u=h.unchangedRegions.get().find(f=>f.originalUnchangedRange.includes(d));if(!u)return;u.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}}))}};P1._breadcrumbsSourceFactory=ct("breadcrumbsSourceFactory",void 0);P1=DF=AJ([MJ(3,Ye)],P1);Z2=class extends f_{constructor(e,t,i,o,s,r,a,l){let c=kt("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=o,this._hide=s,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=kt("div.diff-hidden-lines",[kt("div.top@top",{title:p("diff.hiddenLines.top","Click or drag to show more above")}),kt("div.center@content",{style:{display:"flex"}},[kt("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[ve("a",{title:p("showUnchangedRegion","Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...ra("$(unfold)"))]),kt("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),kt("div.bottom@bottom",{title:p("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root);let d=$t(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._hide?Wi(this._nodes.first):this._register(br(this._nodes.first,{width:d.map(u=>u.contentLeft)})),this._register(pt(u=>{let f=this._unchangedRegion.visibleLineCountTop.read(u)+this._unchangedRegion.visibleLineCountBottom.read(u)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!f),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(u)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(u)>0),this._nodes.top.classList.toggle("canMoveBottom",!f);let g=this._unchangedRegion.isDragged.read(u),m=this._editor.getDomNode();m&&(m.classList.toggle("draggingUnchangedRegion",!!g),g==="top"?(m.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(u)>0),m.classList.toggle("canMoveBottom",!f)):g==="bottom"?(m.classList.toggle("canMoveTop",!f),m.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(u)>0)):(m.classList.toggle("canMoveTop",!1),m.classList.toggle("canMoveBottom",!1)))}));let h=this._editor;this._register($(this._nodes.top,"mousedown",u=>{if(u.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),u.preventDefault();let f=u.clientY,g=!1,m=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);let C=ge(this._nodes.top),S=$(C,"mousemove",y=>{let k=y.clientY-f;g=g||Math.abs(k)>2;let T=Math.round(k/h.getOption(67)),N=Math.max(0,Math.min(m+T,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(N,void 0)}),w=$(C,"mouseup",y=>{g||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),S.dispose(),w.dispose()})})),this._register($(this._nodes.bottom,"mousedown",u=>{if(u.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),u.preventDefault();let f=u.clientY,g=!1,m=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);let C=ge(this._nodes.bottom),S=$(C,"mousemove",y=>{let k=y.clientY-f;g=g||Math.abs(k)>2;let T=Math.round(k/h.getOption(67)),N=Math.max(0,Math.min(m-T,this._unchangedRegion.getMaxVisibleLineCountBottom())),M=this._unchangedRegionRange.endLineNumberExclusive>h.getModel().getLineCount()?h.getContentHeight():h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(N,void 0);let W=this._unchangedRegionRange.endLineNumberExclusive>h.getModel().getLineCount()?h.getContentHeight():h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);h.setScrollTop(h.getScrollTop()+(W-M))}),w=$(C,"mouseup",y=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!g){let x=h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);let k=h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);h.setScrollTop(h.getScrollTop()+(k-x))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),S.dispose(),w.dispose()})})),this._register(pt(u=>{let f=[];if(!this._hide){let g=i.getHiddenModifiedRange(u).length,m=p("hiddenLines","{0} hidden lines",g),C=ve("span",{title:p("diff.hiddenLines.expandAll","Double click to unfold")},m);C.addEventListener("dblclick",y=>{y.button===0&&(y.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(C);let S=this._unchangedRegion.getHiddenModifiedRange(u),w=this._modifiedOutlineSource.getBreadcrumbItems(S,u);if(w.length>0){f.push(ve("span",void 0,"\xA0\xA0|\xA0\xA0"));for(let y=0;y{this._revealModifiedHiddenLine(x.startLineNumber)}}}}Wi(this._nodes.others,...f)}))}}});var BF,EK,cI,IK=J(()=>{"use strict";_();v();b();Ud();Oi();fs();kr();qe();Ur();Ge();BF=De("IEditorCancelService"),EK=new xe("cancellableOperation",!1,p("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));_t(BF,class{constructor(){this._tokens=new WeakMap}add(n,e){let t=this._tokens.get(n);t||(t=n.invokeWithinContext(o=>{let s=EK.bindTo(o.get(rt)),r=new Ii;return{key:s,tokens:r}}),this._tokens.set(n,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(n){let e=this._tokens.get(n);if(!e)return;let t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);cI=class extends un{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(BF).add(e,this))}dispose(){this._unregister(),super.dispose()}};Je(new class extends yl{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:EK})}runEditorCommand(n,e){n.get(BF).cancel(e)}})});var TK,W1,z1,NK=J(()=>{"use strict";_();v();b();ot();Ke();fs();le();IK();TK=class n{constructor(e,t){if(this.flags=t,this.flags&1){let i=e.getModel();this.modelVersionId=i?du("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=e.getPosition():this.position=null,this.flags&2?this.selection=e.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof n))return!1;let t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new n(e,this.flags))}},W1=class extends cI{constructor(e,t,i,o){super(e,o),this._listener=new ae,t&4&&this._listener.add(e.onDidChangeCursorPosition(s=>{(!i||!P.containsPosition(i,s.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(s=>{(!i||!P.containsRange(i,s.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(s=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(s=>this.cancel())),this._listener.add(e.onDidChangeModelContent(s=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}},z1=class extends un{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}});var Ote={};PK(Ote,{CancellationTokenSource:()=>yte,Emitter:()=>Ste,KeyCode:()=>xte,KeyMod:()=>Lte,MarkerSeverity:()=>Tte,MarkerTag:()=>Nte,Position:()=>kte,Range:()=>Dte,Selection:()=>Ete,SelectionDirection:()=>Ite,Token:()=>Mte,Uri:()=>Ate,editor:()=>Rte,languages:()=>Pte});_();v();b();_();v();b();wt();hs();Lt();I_();ug();Ge();var va=8,mg=class{constructor(e){this._values=e}hasChanged(e){return this._values[e]}},A_=class{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}},jt=class{constructor(e,t,i,o){this.id=e,this.name=t,this.defaultValue=i,this.schema=o}applyUpdate(e,t){return tC(e,t)}compute(e,t,i){return i}},_d=class{constructor(e,t){this.newValue=e,this.didChange=t}};function tC(n,e){if(typeof n!="object"||typeof e!="object"||!n||!e)return new _d(e,n!==e);if(Array.isArray(n)||Array.isArray(e)){let i=Array.isArray(n)&&Array.isArray(e)&&Ht(n,e);return new _d(e,!i)}let t=!1;for(let i in e)if(e.hasOwnProperty(i)){let o=tC(n[i],e[i]);o.didChange&&(n[i]=o.newValue,t=!0)}return new _d(n,t)}var iu=class{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return tC(e,t)}validate(e){return this.defaultValue}},bd=class{constructor(e,t,i,o){this.id=e,this.name=t,this.defaultValue=i,this.schema=o}applyUpdate(e,t){return tC(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}};function we(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}var yt=class extends bd{constructor(e,t,i,o=void 0){typeof o<"u"&&(o.type="boolean",o.default=i),super(e,t,i,o)}validate(e){return we(e,this.defaultValue)}};function Cd(n,e,t,i){if(typeof n>"u")return e;let o=parseInt(n,10);return isNaN(o)?e:(o=Math.max(t,o),o=Math.min(i,o),o|0)}var zt=class n extends bd{static clampedInt(e,t,i,o){return Cd(e,t,i,o)}constructor(e,t,i,o,s,r=void 0){typeof r<"u"&&(r.type="integer",r.default=i,r.minimum=o,r.maximum=s),super(e,t,i,r),this.minimum=o,this.maximum=s}validate(e){return n.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}};function S9(n,e,t,i){if(typeof n>"u")return e;let o=Gs.float(n,e);return Gs.clamp(o,t,i)}var Gs=class n extends bd{static clamp(e,t,i){return ei?i:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;let i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,o,s){typeof s<"u"&&(s.type="number",s.default=i),super(e,t,i,s),this.validationFn=o}validate(e){return this.validationFn(n.float(e,this.defaultValue))}},No=class n extends bd{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,o=void 0){typeof o<"u"&&(o.type="string",o.default=i),super(e,t,i,o)}validate(e){return n.string(e,this.defaultValue)}};function wi(n,e,t,i){return typeof n!="string"?e:i&&n in i?i[n]:t.indexOf(n)===-1?e:n}var ai=class extends bd{constructor(e,t,i,o,s=void 0){typeof s<"u"&&(s.type="string",s.enum=o,s.default=i),super(e,t,i,s),this._allowedValues=o}validate(e){return wi(e,this.defaultValue,this._allowedValues)}},fg=class extends jt{constructor(e,t,i,o,s,r,a=void 0){typeof a<"u"&&(a.type="string",a.enum=s,a.default=o),super(e,t,i,a),this._allowedValues=s,this._convert=r}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}};function XK(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}var kI=class extends jt{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[p("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached."),p("accessibilitySupport.on","Optimize for usage with a Screen Reader."),p("accessibilitySupport.off","Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:p("accessibilitySupport","Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}},DI=class extends jt{constructor(){let e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:p("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:p("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{insertSpace:we(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:we(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}};function QK(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var on;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(on||(on={}));function JK(n){switch(n){case"line":return on.Line;case"block":return on.Block;case"underline":return on.Underline;case"line-thin":return on.LineThin;case"block-outline":return on.BlockOutline;case"underline-thin":return on.UnderlineThin}}var EI=class extends iu{constructor(){super(142)}compute(e,t,i){let o=["monaco-editor"];return t.get(39)&&o.push(t.get(39)),e.extraEditorClassName&&o.push(e.extraEditorClassName),t.get(74)==="default"?o.push("mouse-default"):t.get(74)==="copy"&&o.push("mouse-copy"),t.get(111)&&o.push("showUnused"),t.get(140)&&o.push("showDeprecated"),o.join(" ")}},II=class extends yt{constructor(){super(37,"emptySelectionClipboard",!0,{description:p("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}},TI=class extends jt{constructor(){let e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:p("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[p("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),p("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),p("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:p("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[p("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),p("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),p("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:p("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:p("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:Be},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:p("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:p("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{cursorMoveOnType:we(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":wi(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":wi(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:we(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:we(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:we(t.loop,this.defaultValue.loop)}}},Zs=class n extends jt{constructor(){super(51,"fontLigatures",n.OFF,{anyOf:[{type:"boolean",description:p("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:p("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:p("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"||e.length===0?n.OFF:e==="true"?n.ON:e:e?n.ON:n.OFF}};Zs.OFF='"liga" off, "calt" off';Zs.ON='"liga" on, "calt" on';var vd=class n extends jt{constructor(){super(54,"fontVariations",n.OFF,{anyOf:[{type:"boolean",description:p("fontVariations","Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:p("fontVariationSettings","Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:p("fontVariationsGeneral","Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?n.OFF:e==="true"?n.TRANSLATE:e:e?n.TRANSLATE:n.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}};vd.OFF="normal";vd.TRANSLATE="translate";var NI=class extends iu{constructor(){super(50)}compute(e,t,i){return e.fontInfo}},AI=class extends bd{constructor(){super(52,"fontSize",Ao.fontSize,{type:"number",minimum:6,maximum:100,default:Ao.fontSize,description:p("fontSize","Controls the font size in pixels.")})}validate(e){let t=Gs.float(e,this.defaultValue);return t===0?Ao.fontSize:Gs.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}},pg=class n extends jt{constructor(){super(53,"fontWeight",Ao.fontWeight,{anyOf:[{type:"number",minimum:n.MINIMUM_VALUE,maximum:n.MAXIMUM_VALUE,errorMessage:p("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:n.SUGGESTION_VALUES}],default:Ao.fontWeight,description:p("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(zt.clampedInt(e,Ao.fontWeight,n.MINIMUM_VALUE,n.MAXIMUM_VALUE))}};pg.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];pg.MINIMUM_VALUE=1;pg.MAXIMUM_VALUE=1e3;var MI=class extends jt{constructor(){let e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[p("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),p("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),p("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:p("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:p("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:p("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:p("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:p("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:p("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:p("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:p("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:p("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:p("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:p("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,o,s,r;if(!e||typeof e!="object")return this.defaultValue;let a=e;return{multiple:wi(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:wi(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:wi(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(o=a.multipleDeclarations)!==null&&o!==void 0?o:wi(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(s=a.multipleImplementations)!==null&&s!==void 0?s:wi(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(r=a.multipleReferences)!==null&&r!==void 0?r:wi(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:No.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:No.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:No.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:No.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:No.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}},RI=class extends jt{constructor(){let e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:p("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:p("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:p("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:p("hover.hidingDelay","Controls the delay in milliseconds after which the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:p("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:we(t.enabled,this.defaultValue.enabled),delay:zt.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:we(t.sticky,this.defaultValue.sticky),hidingDelay:zt.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:we(t.above,this.defaultValue.above)}}},M_=class n extends iu{constructor(){super(145)}compute(e,t,i){return n.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){let t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight),o=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(o=Math.max(o,t-1));let s=(i+e.viewLineCount+o)/(e.pixelRatio*e.height),r=Math.floor(e.viewLineCount/s);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:o,desiredRatio:s,minimapLineCount:r}}static _computeMinimapLayout(e,t){let i=e.outerWidth,o=e.outerHeight,s=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(s*o),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:o};let r=t.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.paddingTop===r.paddingTop&&e.paddingBottom===r.paddingBottom&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,h=e.minimap.renderCharacters,u=s>=2?Math.round(e.minimap.scale*2):e.minimap.scale,f=e.minimap.maxColumn,g=e.minimap.size,m=e.minimap.side,C=e.verticalScrollbarWidth,S=e.viewLineCount,w=e.remainingWidth,y=e.isViewportWrapping,x=h?2:3,k=Math.floor(s*o),T=k/s,N=!1,M=!1,W=x*u,j=u/s,G=1;if(g==="fill"||g==="fit"){let{typicalViewportLineCount:Se,extraLinesBeforeFirstLine:pe,extraLinesBeyondLastLine:Pe,desiredRatio:Qe,minimapLineCount:Te}=n.computeContainedMinimapLineCount({viewLineCount:S,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:o,lineHeight:l,pixelRatio:s});if(S/Te>1)N=!0,M=!0,u=1,W=1,j=u/s;else{let Ki=!1,Vn=u+1;if(g==="fit"){let Gi=Math.ceil((pe+S+Pe)*W);y&&a&&w<=t.stableFitRemainingWidth?(Ki=!0,Vn=t.stableFitMaxMinimapScale):Ki=Gi>k}if(g==="fill"||Ki){N=!0;let Gi=u;W=Math.min(l*s,Math.max(1,Math.floor(1/Qe))),y&&a&&w<=t.stableFitRemainingWidth&&(Vn=t.stableFitMaxMinimapScale),u=Math.min(Vn,Math.max(1,Math.floor(W/x))),u>Gi&&(G=Math.min(2,u/Gi)),j=u/s/G,k=Math.ceil(Math.max(Se,pe+S+Pe)*W),y?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=w,t.stableFitMaxMinimapScale=u):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}let V=Math.floor(f*j),z=Math.min(V,Math.max(0,Math.floor((w-C-2)*j/(c+j)))+va),te=Math.floor(s*z),ee=te/s;te=Math.floor(te*G);let ce=h?1:2,Ce=m==="left"?0:i-z-C;return{renderMinimap:ce,minimapLeft:Ce,minimapWidth:z,minimapHeightIsEditorHeight:N,minimapIsSampling:M,minimapScale:u,minimapLineHeight:W,minimapCanvasInnerWidth:te,minimapCanvasInnerHeight:k,minimapCanvasOuterWidth:ee,minimapCanvasOuterHeight:T}}static computeLayout(e,t){let i=t.outerWidth|0,o=t.outerHeight|0,s=t.lineHeight|0,r=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,d=t.viewLineCount,h=e.get(137),u=h==="inherit"?e.get(136):h,f=u==="inherit"?e.get(132):u,g=e.get(135),m=t.isDominatedByLongLines,C=e.get(57),S=e.get(68).renderType!==0,w=e.get(69),y=e.get(105),x=e.get(84),k=e.get(73),T=e.get(103),N=T.verticalScrollbarSize,M=T.verticalHasArrows,W=T.arrowSize,j=T.horizontalScrollbarSize,G=e.get(43),V=e.get(110)!=="never",z=e.get(66);G&&V&&(z+=16);let te=0;if(S){let Ot=Math.max(r,w);te=Math.round(Ot*l)}let ee=0;C&&(ee=s*t.glyphMarginDecorationLaneCount);let ce=0,Ce=ce+ee,Se=Ce+te,pe=Se+z,Pe=i-ee-te-z,Qe=!1,Te=!1,de=-1;u==="inherit"&&m?(Qe=!0,Te=!0):f==="on"||f==="bounded"?Te=!0:f==="wordWrapColumn"&&(de=g);let Ki=n._computeMinimapLayout({outerWidth:i,outerHeight:o,lineHeight:s,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:y,paddingTop:x.top,paddingBottom:x.bottom,minimap:k,verticalScrollbarWidth:N,viewLineCount:d,remainingWidth:Pe,isViewportWrapping:Te},t.memory||new A_);Ki.renderMinimap!==0&&Ki.minimapLeft===0&&(ce+=Ki.minimapWidth,Ce+=Ki.minimapWidth,Se+=Ki.minimapWidth,pe+=Ki.minimapWidth);let Vn=Pe-Ki.minimapWidth,Gi=Math.max(1,Math.floor((Vn-N-2)/a)),Ns=M?W:0;return Te&&(de=Math.max(1,Gi),f==="bounded"&&(de=Math.min(de,g))),{width:i,height:o,glyphMarginLeft:ce,glyphMarginWidth:ee,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:Ce,lineNumbersWidth:te,decorationsLeft:Se,decorationsWidth:z,contentLeft:pe,contentWidth:Vn,minimap:Ki,viewportColumn:Gi,isWordWrapMinified:Qe,isViewportWrapping:Te,wrappingColumn:de,verticalScrollbarWidth:N,horizontalScrollbarHeight:j,overviewRuler:{top:Ns,width:N,height:o-2*Ns,right:0}}}},PI=class extends jt{constructor(){super(139,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[p("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),p("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:p("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return wi(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}},Cc;(function(n){n.Off="off",n.OnCode="onCode",n.On="on"})(Cc||(Cc={}));var OI=class extends jt{constructor(){let e={enabled:Cc.On};super(65,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",tags:["experimental"],enum:[Cc.Off,Cc.OnCode,Cc.On],default:e.enabled,enumDescriptions:[p("editor.lightbulb.enabled.off","Disable the code action menu."),p("editor.lightbulb.enabled.onCode","Show the code action menu when the cursor is on lines with code."),p("editor.lightbulb.enabled.on","Show the code action menu when the cursor is on lines with code or on empty lines.")],description:p("enabled","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:wi(e.enabled,this.defaultValue.enabled,[Cc.Off,Cc.OnCode,Cc.On])}}},FI=class extends jt{constructor(){let e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(115,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:p("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor."),tags:["experimental"]},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:p("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:p("editor.stickyScroll.defaultModel","Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:p("editor.stickyScroll.scrollWithEditor","Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:we(t.enabled,this.defaultValue.enabled),maxLineCount:zt.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:wi(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:we(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}},BI=class extends jt{constructor(){let e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(141,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:p("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[p("editor.inlayHints.on","Inlay hints are enabled"),p("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",Be?"Ctrl+Option":"Ctrl+Alt"),p("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",Be?"Ctrl+Option":"Ctrl+Alt"),p("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:p("inlayHints.fontSize","Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:p("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:p("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:wi(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:zt.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:No.string(t.fontFamily,this.defaultValue.fontFamily),padding:we(t.padding,this.defaultValue.padding)}}},WI=class extends jt{constructor(){super(66,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):zt.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?zt.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}},zI=class extends Gs{constructor(){super(67,"lineHeight",Ao.lineHeight,e=>Gs.clamp(e,0,150),{markdownDescription:p("lineHeight",`Controls the line height. + - Use 0 to automatically compute the line height from the font size. + - Values between 0 and 8 will be used as a multiplier with the font size. + - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}},VI=class extends jt{constructor(){let e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,sectionHeaderFontSize:9};super(73,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:p("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:p("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[p("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),p("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),p("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:p("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:p("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:p("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:p("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:p("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:p("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:p("minimap.showRegionSectionHeaders","Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:p("minimap.showMarkSectionHeaders","Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:p("minimap.sectionHeaderFontSize","Controls the font size of section headers in the minimap.")}})}validate(e){var t;if(!e||typeof e!="object")return this.defaultValue;let i=e;return{enabled:we(i.enabled,this.defaultValue.enabled),autohide:we(i.autohide,this.defaultValue.autohide),size:wi(i.size,this.defaultValue.size,["proportional","fill","fit"]),side:wi(i.side,this.defaultValue.side,["right","left"]),showSlider:wi(i.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:we(i.renderCharacters,this.defaultValue.renderCharacters),scale:zt.clampedInt(i.scale,1,1,3),maxColumn:zt.clampedInt(i.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:we(i.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:we(i.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),sectionHeaderFontSize:Gs.clamp((t=i.sectionHeaderFontSize)!==null&&t!==void 0?t:this.defaultValue.sectionHeaderFontSize,4,32)}}};function e$(n){return n==="ctrlCmd"?Be?"metaKey":"ctrlKey":"altKey"}var HI=class extends jt{constructor(){super(84,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:p("padding.top","Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:p("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{top:zt.clampedInt(t.top,0,0,1e3),bottom:zt.clampedInt(t.bottom,0,0,1e3)}}},UI=class extends jt{constructor(){let e={enabled:!0,cycle:!0};super(86,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:p("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:p("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:we(t.enabled,this.defaultValue.enabled),cycle:we(t.cycle,this.defaultValue.cycle)}}},KI=class extends iu{constructor(){super(143)}compute(e,t,i){return e.pixelRatio}},$I=class extends jt{constructor(){let e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[p("on","Quick suggestions show inside the suggest widget"),p("inline","Quick suggestions show as ghost text"),p("off","Quick suggestions are disabled")]}];super(89,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:p("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:p("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:p("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:p("quickSuggestions","Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the '{0}'-setting which controls if suggestions are triggered by special characters.","#editor.suggestOnTriggerCharacters#")}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){let c=e?"on":"off";return{comments:c,strings:c,other:c}}if(!e||typeof e!="object")return this.defaultValue;let{other:t,comments:i,strings:o}=e,s=["on","inline","off"],r,a,l;return typeof t=="boolean"?r=t?"on":"off":r=wi(t,this.defaultValue.other,s),typeof i=="boolean"?a=i?"on":"off":a=wi(i,this.defaultValue.comments,s),typeof o=="boolean"?l=o?"on":"off":l=wi(o,this.defaultValue.strings,s),{other:r,comments:a,strings:l}}},qI=class extends jt{constructor(){super(68,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[p("lineNumbers.off","Line numbers are not rendered."),p("lineNumbers.on","Line numbers are rendered as absolute number."),p("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),p("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:p("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,i=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:i}}};function nu(n){let e=n.get(98);return e==="editable"?n.get(91):e!=="on"}var jI=class extends jt{constructor(){let e=[],t={type:"number",description:p("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(102,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:p("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:p("rulers","Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){let t=[];for(let i of e)if(typeof i=="number")t.push({column:zt.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){let o=i;t.push({column:zt.clampedInt(o.column,0,0,1e4),color:o.color})}return t.sort((i,o)=>i.column-o.column),t}return this.defaultValue}},GI=class extends jt{constructor(){super(92,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}};function y9(n,e){if(typeof n!="string")return e;switch(n){case"hidden":return 2;case"visible":return 3;default:return 1}}var ZI=class extends jt{constructor(){let e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1,ignoreHorizontalScrollbarInContentHeight:!1};super(103,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[p("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),p("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),p("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:p("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[p("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),p("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),p("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:p("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:p("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:p("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:p("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:p("scrollbar.ignoreHorizontalScrollbarInContentHeight","When set, the horizontal scrollbar will not increase the size of the editor's content.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e,i=zt.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),o=zt.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:zt.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:y9(t.vertical,this.defaultValue.vertical),horizontal:y9(t.horizontal,this.defaultValue.horizontal),useShadows:we(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:we(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:we(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:we(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:we(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:zt.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:o,verticalSliderSize:zt.clampedInt(t.verticalSliderSize,o,0,1e3),scrollByPage:we(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:we(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}},ba="inUntrustedWorkspace",tu={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"},YI=class extends jt{constructor(){let e={nonBasicASCII:ba,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:ba,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(125,"unicodeHighlight",e,{[tu.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,ba],default:e.nonBasicASCII,description:p("unicodeHighlight.nonBasicASCII","Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[tu.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:p("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[tu.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:p("unicodeHighlight.ambiguousCharacters","Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[tu.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,ba],default:e.includeComments,description:p("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[tu.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,ba],default:e.includeStrings,description:p("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[tu.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:p("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[tu.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:p("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(hn(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},i=!0)),t.allowedLocales&&e&&(hn(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},i=!0));let o=super.applyUpdate(e,t);return i?new _d(o.newValue,!0):o}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{nonBasicASCII:gg(t.nonBasicASCII,ba,[!0,!1,ba]),invisibleCharacters:we(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:we(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:gg(t.includeComments,ba,[!0,!1,ba]),includeStrings:gg(t.includeStrings,ba,[!0,!1,ba]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!="object"||!e)return t;let i={};for(let[o,s]of Object.entries(e))s===!0&&(i[o]=!0);return i}},XI=class extends jt{constructor(){let e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1,fontFamily:"default"};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:p("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[p("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),p("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion."),p("inlineSuggest.showToolbar.never","Never show the inline suggestion toolbar.")],description:p("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:p("inlineSuggest.suppressSuggestions","Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")},"editor.inlineSuggest.fontFamily":{type:"string",default:e.fontFamily,description:p("inlineSuggest.fontFamily","Controls the font family of the inline suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:we(t.enabled,this.defaultValue.enabled),mode:wi(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:wi(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:we(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:we(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:No.string(t.fontFamily,this.defaultValue.fontFamily)}}},QI=class extends jt{constructor(){let e={enabled:!1,showToolbar:"onHover",fontFamily:"default",keepOnBlur:!1,backgroundColoring:!1};super(63,"experimentalInlineEdit",e,{"editor.experimentalInlineEdit.enabled":{type:"boolean",default:e.enabled,description:p("inlineEdit.enabled","Controls whether to show inline edits in the editor.")},"editor.experimentalInlineEdit.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[p("inlineEdit.showToolbar.always","Show the inline edit toolbar whenever an inline suggestion is shown."),p("inlineEdit.showToolbar.onHover","Show the inline edit toolbar when hovering over an inline suggestion."),p("inlineEdit.showToolbar.never","Never show the inline edit toolbar.")],description:p("inlineEdit.showToolbar","Controls when to show the inline edit toolbar.")},"editor.experimentalInlineEdit.fontFamily":{type:"string",default:e.fontFamily,description:p("inlineEdit.fontFamily","Controls the font family of the inline edit.")},"editor.experimentalInlineEdit.backgroundColoring":{type:"boolean",default:e.backgroundColoring,description:p("inlineEdit.backgroundColoring","Controls whether to color the background of inline edits.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:we(t.enabled,this.defaultValue.enabled),showToolbar:wi(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),fontFamily:No.string(t.fontFamily,this.defaultValue.fontFamily),keepOnBlur:we(t.keepOnBlur,this.defaultValue.keepOnBlur),backgroundColoring:we(t.backgroundColoring,this.defaultValue.backgroundColoring)}}},JI=class extends jt{constructor(){let e={enabled:nn.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:nn.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:p("bracketPairColorization.enabled","Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:p("bracketPairColorization.independentColorPoolPerBracketType","Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:we(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:we(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}},eT=class extends jt{constructor(){let e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[p("editor.guides.bracketPairs.true","Enables bracket pair guides."),p("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),p("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:p("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[p("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),p("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),p("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:p("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:p("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:p("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[p("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),p("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),p("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:p("editor.guides.highlightActiveIndentation","Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{bracketPairs:gg(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:gg(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:we(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:we(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:gg(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}};function gg(n,e,t){let i=t.indexOf(n);return i===-1?e:t[i]}var tT=class extends jt{constructor(){let e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(118,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[p("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),p("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:p("suggest.insertMode","Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:p("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:p("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:p("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[p("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),p("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),p("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),p("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:p("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:p("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:p("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:p("suggest.showStatusBar","Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:p("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:p("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:p("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:p("deprecated","This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.matchOnWordStartOnly","When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{insertMode:wi(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:we(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:we(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:we(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:we(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:wi(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:we(t.showIcons,this.defaultValue.showIcons),showStatusBar:we(t.showStatusBar,this.defaultValue.showStatusBar),preview:we(t.preview,this.defaultValue.preview),previewMode:wi(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:we(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:we(t.showMethods,this.defaultValue.showMethods),showFunctions:we(t.showFunctions,this.defaultValue.showFunctions),showConstructors:we(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:we(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:we(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:we(t.showFields,this.defaultValue.showFields),showVariables:we(t.showVariables,this.defaultValue.showVariables),showClasses:we(t.showClasses,this.defaultValue.showClasses),showStructs:we(t.showStructs,this.defaultValue.showStructs),showInterfaces:we(t.showInterfaces,this.defaultValue.showInterfaces),showModules:we(t.showModules,this.defaultValue.showModules),showProperties:we(t.showProperties,this.defaultValue.showProperties),showEvents:we(t.showEvents,this.defaultValue.showEvents),showOperators:we(t.showOperators,this.defaultValue.showOperators),showUnits:we(t.showUnits,this.defaultValue.showUnits),showValues:we(t.showValues,this.defaultValue.showValues),showConstants:we(t.showConstants,this.defaultValue.showConstants),showEnums:we(t.showEnums,this.defaultValue.showEnums),showEnumMembers:we(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:we(t.showKeywords,this.defaultValue.showKeywords),showWords:we(t.showWords,this.defaultValue.showWords),showColors:we(t.showColors,this.defaultValue.showColors),showFiles:we(t.showFiles,this.defaultValue.showFiles),showReferences:we(t.showReferences,this.defaultValue.showReferences),showFolders:we(t.showFolders,this.defaultValue.showFolders),showTypeParameters:we(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:we(t.showSnippets,this.defaultValue.showSnippets),showUsers:we(t.showUsers,this.defaultValue.showUsers),showIssues:we(t.showIssues,this.defaultValue.showIssues)}}},iT=class extends jt{constructor(){super(113,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:p("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:p("selectSubwords","Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:we(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:we(e.selectSubwords,this.defaultValue.selectSubwords)}}},nT=class extends jt{constructor(){let e=[];super(130,"wordSegmenterLocales",e,{anyOf:[{description:p("wordSegmenterLocales","Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"string"},{description:p("wordSegmenterLocales","Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"array",items:{type:"string"}}]})}validate(e){if(typeof e=="string"&&(e=[e]),Array.isArray(e)){let t=[];for(let i of e)if(typeof i=="string")try{Intl.Segmenter.supportedLocalesOf(i).length>0&&t.push(i)}catch{}return t}return this.defaultValue}},oT=class extends jt{constructor(){super(138,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[p("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),p("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),p("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),p("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:p("wrappingIndent","Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return t.get(2)===2?0:i}},sT=class extends iu{constructor(){super(146)}compute(e,t,i){let o=t.get(145);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:o.isWordWrapMinified,isViewportWrapping:o.isViewportWrapping,wrappingColumn:o.wrappingColumn}}},rT=class extends jt{constructor(){let e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:p("dropIntoEditor.enabled","Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:p("dropIntoEditor.showDropSelector","Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[p("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),p("dropIntoEditor.showDropSelector.never","Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:we(t.enabled,this.defaultValue.enabled),showDropSelector:wi(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}},aT=class extends jt{constructor(){let e={enabled:!0,showPasteSelector:"afterPaste"};super(85,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:p("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:p("pasteAs.showPasteSelector","Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[p("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),p("pasteAs.showPasteSelector.never","Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;let t=e;return{enabled:we(t.enabled,this.defaultValue.enabled),showPasteSelector:wi(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}},t$="Consolas, 'Courier New', monospace",i$="Menlo, Monaco, 'Courier New', monospace",n$="'Droid Sans Mono', 'monospace', monospace",Ao={fontFamily:Be?i$:mi?n$:t$,fontWeight:"normal",fontSize:Be?12:14,lineHeight:0,letterSpacing:0},wd=[];function oe(n){return wd[n.id]=n,n}var Ca={acceptSuggestionOnCommitCharacter:oe(new yt(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:p("acceptSuggestionOnCommitCharacter","Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:oe(new ai(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",p("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:p("acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:oe(new kI),accessibilityPageSize:oe(new zt(3,"accessibilityPageSize",10,1,1073741824,{description:p("accessibilityPageSize","Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),ariaLabel:oe(new No(4,"ariaLabel",p("editorViewAccessibleLabel","Editor content"))),ariaRequired:oe(new yt(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:oe(new yt(8,"screenReaderAnnounceInlineSuggestion",!0,{description:p("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:oe(new ai(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",p("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),p("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:p("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:oe(new ai(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",p("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),p("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:p("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:oe(new ai(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",p("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:p("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:oe(new ai(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",p("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:p("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:oe(new ai(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",p("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),p("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:p("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:oe(new fg(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],XK,{enumDescriptions:[p("editor.autoIndent.none","The editor will not insert indentation automatically."),p("editor.autoIndent.keep","The editor will keep the current line's indentation."),p("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),p("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),p("editor.autoIndent.full","The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:p("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:oe(new yt(13,"automaticLayout",!1)),autoSurround:oe(new ai(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[p("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),p("editor.autoSurround.quotes","Surround with quotes but not brackets."),p("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:p("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:oe(new JI),bracketPairGuides:oe(new eT),stickyTabStops:oe(new yt(116,"stickyTabStops",!1,{description:p("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:oe(new yt(17,"codeLens",!0,{description:p("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:oe(new No(18,"codeLensFontFamily","",{description:p("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:oe(new zt(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:p("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:oe(new yt(20,"colorDecorators",!0,{description:p("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:oe(new ai(148,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[p("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),p("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),p("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:p("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:oe(new zt(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:p("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:oe(new yt(22,"columnSelection",!1,{description:p("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:oe(new DI),contextmenu:oe(new yt(24,"contextmenu",!0)),copyWithSyntaxHighlighting:oe(new yt(25,"copyWithSyntaxHighlighting",!0,{description:p("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:oe(new fg(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],QK,{description:p("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:oe(new ai(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[p("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),p("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),p("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:p("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:oe(new fg(28,"cursorStyle",on.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],JK,{description:p("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:oe(new zt(29,"cursorSurroundingLines",0,0,1073741824,{description:p("cursorSurroundingLines","Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:oe(new ai(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[p("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),p("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:p("cursorSurroundingLinesStyle","Controls when `#editor.cursorSurroundingLines#` should be enforced.")})),cursorWidth:oe(new zt(31,"cursorWidth",0,0,1073741824,{markdownDescription:p("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:oe(new yt(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:oe(new yt(33,"disableMonospaceOptimizations",!1)),domReadOnly:oe(new yt(34,"domReadOnly",!1)),dragAndDrop:oe(new yt(35,"dragAndDrop",!0,{description:p("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:oe(new II),dropIntoEditor:oe(new rT),stickyScroll:oe(new FI),experimentalWhitespaceRendering:oe(new ai(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[p("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),p("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),p("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:p("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:oe(new No(39,"extraEditorClassName","")),fastScrollSensitivity:oe(new Gs(40,"fastScrollSensitivity",5,n=>n<=0?5:n,{markdownDescription:p("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:oe(new TI),fixedOverflowWidgets:oe(new yt(42,"fixedOverflowWidgets",!1)),folding:oe(new yt(43,"folding",!0,{description:p("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:oe(new ai(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[p("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),p("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:p("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:oe(new yt(45,"foldingHighlight",!0,{description:p("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:oe(new yt(46,"foldingImportsByDefault",!1,{description:p("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:oe(new zt(47,"foldingMaximumRegions",5e3,10,65e3,{description:p("foldingMaximumRegions","The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:oe(new yt(48,"unfoldOnClickAfterEndOfLine",!1,{description:p("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:oe(new No(49,"fontFamily",Ao.fontFamily,{description:p("fontFamily","Controls the font family.")})),fontInfo:oe(new NI),fontLigatures2:oe(new Zs),fontSize:oe(new AI),fontWeight:oe(new pg),fontVariations:oe(new vd),formatOnPaste:oe(new yt(55,"formatOnPaste",!1,{description:p("formatOnPaste","Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:oe(new yt(56,"formatOnType",!1,{description:p("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:oe(new yt(57,"glyphMargin",!0,{description:p("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:oe(new MI),hideCursorInOverviewRuler:oe(new yt(59,"hideCursorInOverviewRuler",!1,{description:p("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:oe(new RI),inDiffEditor:oe(new yt(61,"inDiffEditor",!1)),letterSpacing:oe(new Gs(64,"letterSpacing",Ao.letterSpacing,n=>Gs.clamp(n,-5,20),{description:p("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:oe(new OI),lineDecorationsWidth:oe(new WI),lineHeight:oe(new zI),lineNumbers:oe(new qI),lineNumbersMinChars:oe(new zt(69,"lineNumbersMinChars",5,1,300)),linkedEditing:oe(new yt(70,"linkedEditing",!1,{description:p("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:oe(new yt(71,"links",!0,{description:p("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:oe(new ai(72,"matchBrackets","always",["always","near","never"],{description:p("matchBrackets","Highlight matching brackets.")})),minimap:oe(new VI),mouseStyle:oe(new ai(74,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:oe(new Gs(75,"mouseWheelScrollSensitivity",1,n=>n===0?1:n,{markdownDescription:p("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:oe(new yt(76,"mouseWheelZoom",!1,{markdownDescription:Be?p("mouseWheelZoom.mac","Zoom the font of the editor when using mouse wheel and holding `Cmd`."):p("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:oe(new yt(77,"multiCursorMergeOverlapping",!0,{description:p("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:oe(new fg(78,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],e$,{markdownEnumDescriptions:[p("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),p("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:p({key:"multiCursorModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:oe(new ai(79,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[p("multiCursorPaste.spread","Each cursor pastes a single line of the text."),p("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:p("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:oe(new zt(80,"multiCursorLimit",1e4,1,1e5,{markdownDescription:p("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:oe(new ai(81,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[p("occurrencesHighlight.off","Does not highlight occurrences."),p("occurrencesHighlight.singleFile","Highlights occurrences only in the current file."),p("occurrencesHighlight.multiFile","Experimental: Highlights occurrences across all valid open files.")],markdownDescription:p("occurrencesHighlight","Controls whether occurrences should be highlighted across open files.")})),overviewRulerBorder:oe(new yt(82,"overviewRulerBorder",!0,{description:p("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:oe(new zt(83,"overviewRulerLanes",3,0,3)),padding:oe(new HI),pasteAs:oe(new aT),parameterHints:oe(new UI),peekWidgetDefaultFocus:oe(new ai(87,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[p("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),p("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:p("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:oe(new yt(88,"definitionLinkOpensInPeek",!1,{description:p("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:oe(new $I),quickSuggestionsDelay:oe(new zt(90,"quickSuggestionsDelay",10,0,1073741824,{description:p("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:oe(new yt(91,"readOnly",!1)),readOnlyMessage:oe(new GI),renameOnType:oe(new yt(93,"renameOnType",!1,{description:p("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:p("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:oe(new yt(94,"renderControlCharacters",!0,{description:p("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:oe(new ai(95,"renderFinalNewline",mi?"dimmed":"on",["off","on","dimmed"],{description:p("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:oe(new ai(96,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",p("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:p("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:oe(new yt(97,"renderLineHighlightOnlyWhenFocus",!1,{description:p("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:oe(new ai(98,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:oe(new ai(99,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",p("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),p("renderWhitespace.selection","Render whitespace characters only on selected text."),p("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:p("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:oe(new zt(100,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:oe(new yt(101,"roundedSelection",!0,{description:p("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:oe(new jI),scrollbar:oe(new ZI),scrollBeyondLastColumn:oe(new zt(104,"scrollBeyondLastColumn",4,0,1073741824,{description:p("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:oe(new yt(105,"scrollBeyondLastLine",!0,{description:p("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:oe(new yt(106,"scrollPredominantAxis",!0,{description:p("scrollPredominantAxis","Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:oe(new yt(107,"selectionClipboard",!0,{description:p("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:mi})),selectionHighlight:oe(new yt(108,"selectionHighlight",!0,{description:p("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:oe(new yt(109,"selectOnLineNumbers",!0)),showFoldingControls:oe(new ai(110,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[p("showFoldingControls.always","Always show the folding controls."),p("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),p("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:p("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:oe(new yt(111,"showUnused",!0,{description:p("showUnused","Controls fading out of unused code.")})),showDeprecated:oe(new yt(140,"showDeprecated",!0,{description:p("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:oe(new BI),snippetSuggestions:oe(new ai(112,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[p("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),p("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),p("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),p("snippetSuggestions.none","Do not show snippet suggestions.")],description:p("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:oe(new iT),smoothScrolling:oe(new yt(114,"smoothScrolling",!1,{description:p("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:oe(new zt(117,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:oe(new tT),inlineSuggest:oe(new XI),inlineEdit:oe(new QI),inlineCompletionsAccessibilityVerbose:oe(new yt(149,"inlineCompletionsAccessibilityVerbose",!1,{description:p("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:oe(new zt(119,"suggestFontSize",0,0,1e3,{markdownDescription:p("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:oe(new zt(120,"suggestLineHeight",0,0,1e3,{markdownDescription:p("suggestLineHeight","Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:oe(new yt(121,"suggestOnTriggerCharacters",!0,{description:p("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:oe(new ai(122,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[p("suggestSelection.first","Always select the first suggestion."),p("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),p("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:p("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:oe(new ai(123,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[p("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),p("tabCompletion.off","Disable tab completions."),p("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:p("tabCompletion","Enables tab completions.")})),tabIndex:oe(new zt(124,"tabIndex",0,-1,1073741824)),unicodeHighlight:oe(new YI),unusualLineTerminators:oe(new ai(126,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[p("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),p("unusualLineTerminators.off","Unusual line terminators are ignored."),p("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:p("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:oe(new yt(127,"useShadowDOM",!0)),useTabStops:oe(new yt(128,"useTabStops",!0,{description:p("useTabStops","Spaces and tabs are inserted and deleted in alignment with tab stops.")})),wordBreak:oe(new ai(129,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[p("wordBreak.normal","Use the default line break rule."),p("wordBreak.keepAll","Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:p("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSegmenterLocales:oe(new nT),wordSeparators:oe(new No(131,"wordSeparators",LI,{description:p("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:oe(new ai(132,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[p("wordWrap.off","Lines will never wrap."),p("wordWrap.on","Lines will wrap at the viewport width."),p({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),p({key:"wordWrap.bounded",comment:["- viewport means the edge of the visible window size.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:p({key:"wordWrap",comment:["- 'off', 'on', 'wordWrapColumn' and 'bounded' refer to values the setting can take and should not be localized.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:oe(new No(133,"wordWrapBreakAfterCharacters"," })]?|/&.,;\xA2\xB0\u2032\u2033\u2030\u2103\u3001\u3002\uFF61\uFF64\uFFE0\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF01\uFF05\u30FB\uFF65\u309D\u309E\u30FD\u30FE\u30FC\u30A1\u30A3\u30A5\u30A7\u30A9\u30C3\u30E3\u30E5\u30E7\u30EE\u30F5\u30F6\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308E\u3095\u3096\u31F0\u31F1\u31F2\u31F3\u31F4\u31F5\u31F6\u31F7\u31F8\u31F9\u31FA\u31FB\u31FC\u31FD\u31FE\u31FF\u3005\u303B\uFF67\uFF68\uFF69\uFF6A\uFF6B\uFF6C\uFF6D\uFF6E\uFF6F\uFF70\u201D\u3009\u300B\u300D\u300F\u3011\u3015\uFF09\uFF3D\uFF5D\uFF63")),wordWrapBreakBeforeCharacters:oe(new No(134,"wordWrapBreakBeforeCharacters","([{\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\uFF08\uFF3B\uFF5B\uFF62\xA3\xA5\uFF04\uFFE1\uFFE5+\uFF0B")),wordWrapColumn:oe(new zt(135,"wordWrapColumn",80,1,1073741824,{markdownDescription:p({key:"wordWrapColumn",comment:["- `editor.wordWrap` refers to a different setting and should not be localized.","- 'wordWrapColumn' and 'bounded' refer to values the different setting can take and should not be localized."]},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:oe(new ai(136,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:oe(new ai(137,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:oe(new EI),defaultColorDecorators:oe(new yt(147,"defaultColorDecorators",!1,{markdownDescription:p("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:oe(new KI),tabFocusMode:oe(new yt(144,"tabFocusMode",!1,{markdownDescription:p("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:oe(new M_),wrappingInfo:oe(new sT),wrappingIndent:oe(new oT),wrappingStrategy:oe(new PI)};_();v();b();fs();ye();z_();sn();ft();Ke();Kn();Yo();_();v();b();var yC;(function(n){n[n.Unknown=0]="Unknown",n[n.Disabled=1]="Disabled",n[n.Enabled=2]="Enabled"})(yC||(yC={}));var SC;(function(n){n[n.Invoke=1]="Invoke",n[n.Auto=2]="Auto"})(SC||(SC={}));var xC;(function(n){n[n.None=0]="None",n[n.KeepWhitespace=1]="KeepWhitespace",n[n.InsertAsSnippet=4]="InsertAsSnippet"})(xC||(xC={}));var LC;(function(n){n[n.Method=0]="Method",n[n.Function=1]="Function",n[n.Constructor=2]="Constructor",n[n.Field=3]="Field",n[n.Variable=4]="Variable",n[n.Class=5]="Class",n[n.Struct=6]="Struct",n[n.Interface=7]="Interface",n[n.Module=8]="Module",n[n.Property=9]="Property",n[n.Event=10]="Event",n[n.Operator=11]="Operator",n[n.Unit=12]="Unit",n[n.Value=13]="Value",n[n.Constant=14]="Constant",n[n.Enum=15]="Enum",n[n.EnumMember=16]="EnumMember",n[n.Keyword=17]="Keyword",n[n.Text=18]="Text",n[n.Color=19]="Color",n[n.File=20]="File",n[n.Reference=21]="Reference",n[n.Customcolor=22]="Customcolor",n[n.Folder=23]="Folder",n[n.TypeParameter=24]="TypeParameter",n[n.User=25]="User",n[n.Issue=26]="Issue",n[n.Snippet=27]="Snippet"})(LC||(LC={}));var kC;(function(n){n[n.Deprecated=1]="Deprecated"})(kC||(kC={}));var DC;(function(n){n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(DC||(DC={}));var EC;(function(n){n[n.EXACT=0]="EXACT",n[n.ABOVE=1]="ABOVE",n[n.BELOW=2]="BELOW"})(EC||(EC={}));var IC;(function(n){n[n.NotSet=0]="NotSet",n[n.ContentFlush=1]="ContentFlush",n[n.RecoverFromMarkers=2]="RecoverFromMarkers",n[n.Explicit=3]="Explicit",n[n.Paste=4]="Paste",n[n.Undo=5]="Undo",n[n.Redo=6]="Redo"})(IC||(IC={}));var TC;(function(n){n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(TC||(TC={}));var NC;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(NC||(NC={}));var AC;(function(n){n[n.None=0]="None",n[n.Keep=1]="Keep",n[n.Brackets=2]="Brackets",n[n.Advanced=3]="Advanced",n[n.Full=4]="Full"})(AC||(AC={}));var MC;(function(n){n[n.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",n[n.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",n[n.accessibilitySupport=2]="accessibilitySupport",n[n.accessibilityPageSize=3]="accessibilityPageSize",n[n.ariaLabel=4]="ariaLabel",n[n.ariaRequired=5]="ariaRequired",n[n.autoClosingBrackets=6]="autoClosingBrackets",n[n.autoClosingComments=7]="autoClosingComments",n[n.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",n[n.autoClosingDelete=9]="autoClosingDelete",n[n.autoClosingOvertype=10]="autoClosingOvertype",n[n.autoClosingQuotes=11]="autoClosingQuotes",n[n.autoIndent=12]="autoIndent",n[n.automaticLayout=13]="automaticLayout",n[n.autoSurround=14]="autoSurround",n[n.bracketPairColorization=15]="bracketPairColorization",n[n.guides=16]="guides",n[n.codeLens=17]="codeLens",n[n.codeLensFontFamily=18]="codeLensFontFamily",n[n.codeLensFontSize=19]="codeLensFontSize",n[n.colorDecorators=20]="colorDecorators",n[n.colorDecoratorsLimit=21]="colorDecoratorsLimit",n[n.columnSelection=22]="columnSelection",n[n.comments=23]="comments",n[n.contextmenu=24]="contextmenu",n[n.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",n[n.cursorBlinking=26]="cursorBlinking",n[n.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",n[n.cursorStyle=28]="cursorStyle",n[n.cursorSurroundingLines=29]="cursorSurroundingLines",n[n.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",n[n.cursorWidth=31]="cursorWidth",n[n.disableLayerHinting=32]="disableLayerHinting",n[n.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",n[n.domReadOnly=34]="domReadOnly",n[n.dragAndDrop=35]="dragAndDrop",n[n.dropIntoEditor=36]="dropIntoEditor",n[n.emptySelectionClipboard=37]="emptySelectionClipboard",n[n.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",n[n.extraEditorClassName=39]="extraEditorClassName",n[n.fastScrollSensitivity=40]="fastScrollSensitivity",n[n.find=41]="find",n[n.fixedOverflowWidgets=42]="fixedOverflowWidgets",n[n.folding=43]="folding",n[n.foldingStrategy=44]="foldingStrategy",n[n.foldingHighlight=45]="foldingHighlight",n[n.foldingImportsByDefault=46]="foldingImportsByDefault",n[n.foldingMaximumRegions=47]="foldingMaximumRegions",n[n.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",n[n.fontFamily=49]="fontFamily",n[n.fontInfo=50]="fontInfo",n[n.fontLigatures=51]="fontLigatures",n[n.fontSize=52]="fontSize",n[n.fontWeight=53]="fontWeight",n[n.fontVariations=54]="fontVariations",n[n.formatOnPaste=55]="formatOnPaste",n[n.formatOnType=56]="formatOnType",n[n.glyphMargin=57]="glyphMargin",n[n.gotoLocation=58]="gotoLocation",n[n.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",n[n.hover=60]="hover",n[n.inDiffEditor=61]="inDiffEditor",n[n.inlineSuggest=62]="inlineSuggest",n[n.inlineEdit=63]="inlineEdit",n[n.letterSpacing=64]="letterSpacing",n[n.lightbulb=65]="lightbulb",n[n.lineDecorationsWidth=66]="lineDecorationsWidth",n[n.lineHeight=67]="lineHeight",n[n.lineNumbers=68]="lineNumbers",n[n.lineNumbersMinChars=69]="lineNumbersMinChars",n[n.linkedEditing=70]="linkedEditing",n[n.links=71]="links",n[n.matchBrackets=72]="matchBrackets",n[n.minimap=73]="minimap",n[n.mouseStyle=74]="mouseStyle",n[n.mouseWheelScrollSensitivity=75]="mouseWheelScrollSensitivity",n[n.mouseWheelZoom=76]="mouseWheelZoom",n[n.multiCursorMergeOverlapping=77]="multiCursorMergeOverlapping",n[n.multiCursorModifier=78]="multiCursorModifier",n[n.multiCursorPaste=79]="multiCursorPaste",n[n.multiCursorLimit=80]="multiCursorLimit",n[n.occurrencesHighlight=81]="occurrencesHighlight",n[n.overviewRulerBorder=82]="overviewRulerBorder",n[n.overviewRulerLanes=83]="overviewRulerLanes",n[n.padding=84]="padding",n[n.pasteAs=85]="pasteAs",n[n.parameterHints=86]="parameterHints",n[n.peekWidgetDefaultFocus=87]="peekWidgetDefaultFocus",n[n.definitionLinkOpensInPeek=88]="definitionLinkOpensInPeek",n[n.quickSuggestions=89]="quickSuggestions",n[n.quickSuggestionsDelay=90]="quickSuggestionsDelay",n[n.readOnly=91]="readOnly",n[n.readOnlyMessage=92]="readOnlyMessage",n[n.renameOnType=93]="renameOnType",n[n.renderControlCharacters=94]="renderControlCharacters",n[n.renderFinalNewline=95]="renderFinalNewline",n[n.renderLineHighlight=96]="renderLineHighlight",n[n.renderLineHighlightOnlyWhenFocus=97]="renderLineHighlightOnlyWhenFocus",n[n.renderValidationDecorations=98]="renderValidationDecorations",n[n.renderWhitespace=99]="renderWhitespace",n[n.revealHorizontalRightPadding=100]="revealHorizontalRightPadding",n[n.roundedSelection=101]="roundedSelection",n[n.rulers=102]="rulers",n[n.scrollbar=103]="scrollbar",n[n.scrollBeyondLastColumn=104]="scrollBeyondLastColumn",n[n.scrollBeyondLastLine=105]="scrollBeyondLastLine",n[n.scrollPredominantAxis=106]="scrollPredominantAxis",n[n.selectionClipboard=107]="selectionClipboard",n[n.selectionHighlight=108]="selectionHighlight",n[n.selectOnLineNumbers=109]="selectOnLineNumbers",n[n.showFoldingControls=110]="showFoldingControls",n[n.showUnused=111]="showUnused",n[n.snippetSuggestions=112]="snippetSuggestions",n[n.smartSelect=113]="smartSelect",n[n.smoothScrolling=114]="smoothScrolling",n[n.stickyScroll=115]="stickyScroll",n[n.stickyTabStops=116]="stickyTabStops",n[n.stopRenderingLineAfter=117]="stopRenderingLineAfter",n[n.suggest=118]="suggest",n[n.suggestFontSize=119]="suggestFontSize",n[n.suggestLineHeight=120]="suggestLineHeight",n[n.suggestOnTriggerCharacters=121]="suggestOnTriggerCharacters",n[n.suggestSelection=122]="suggestSelection",n[n.tabCompletion=123]="tabCompletion",n[n.tabIndex=124]="tabIndex",n[n.unicodeHighlighting=125]="unicodeHighlighting",n[n.unusualLineTerminators=126]="unusualLineTerminators",n[n.useShadowDOM=127]="useShadowDOM",n[n.useTabStops=128]="useTabStops",n[n.wordBreak=129]="wordBreak",n[n.wordSegmenterLocales=130]="wordSegmenterLocales",n[n.wordSeparators=131]="wordSeparators",n[n.wordWrap=132]="wordWrap",n[n.wordWrapBreakAfterCharacters=133]="wordWrapBreakAfterCharacters",n[n.wordWrapBreakBeforeCharacters=134]="wordWrapBreakBeforeCharacters",n[n.wordWrapColumn=135]="wordWrapColumn",n[n.wordWrapOverride1=136]="wordWrapOverride1",n[n.wordWrapOverride2=137]="wordWrapOverride2",n[n.wrappingIndent=138]="wrappingIndent",n[n.wrappingStrategy=139]="wrappingStrategy",n[n.showDeprecated=140]="showDeprecated",n[n.inlayHints=141]="inlayHints",n[n.editorClassName=142]="editorClassName",n[n.pixelRatio=143]="pixelRatio",n[n.tabFocusMode=144]="tabFocusMode",n[n.layoutInfo=145]="layoutInfo",n[n.wrappingInfo=146]="wrappingInfo",n[n.defaultColorDecorators=147]="defaultColorDecorators",n[n.colorDecoratorsActivatedOn=148]="colorDecoratorsActivatedOn",n[n.inlineCompletionsAccessibilityVerbose=149]="inlineCompletionsAccessibilityVerbose"})(MC||(MC={}));var RC;(function(n){n[n.TextDefined=0]="TextDefined",n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(RC||(RC={}));var PC;(function(n){n[n.LF=0]="LF",n[n.CRLF=1]="CRLF"})(PC||(PC={}));var OC;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=3]="Right"})(OC||(OC={}));var FC;(function(n){n[n.Increase=0]="Increase",n[n.Decrease=1]="Decrease"})(FC||(FC={}));var BC;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(BC||(BC={}));var WC;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(WC||(WC={}));var zC;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(zC||(zC={}));var VC;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(VC||(VC={}));var HC;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(HC||(HC={}));var UC;(function(n){n[n.DependsOnKbLayout=-1]="DependsOnKbLayout",n[n.Unknown=0]="Unknown",n[n.Backspace=1]="Backspace",n[n.Tab=2]="Tab",n[n.Enter=3]="Enter",n[n.Shift=4]="Shift",n[n.Ctrl=5]="Ctrl",n[n.Alt=6]="Alt",n[n.PauseBreak=7]="PauseBreak",n[n.CapsLock=8]="CapsLock",n[n.Escape=9]="Escape",n[n.Space=10]="Space",n[n.PageUp=11]="PageUp",n[n.PageDown=12]="PageDown",n[n.End=13]="End",n[n.Home=14]="Home",n[n.LeftArrow=15]="LeftArrow",n[n.UpArrow=16]="UpArrow",n[n.RightArrow=17]="RightArrow",n[n.DownArrow=18]="DownArrow",n[n.Insert=19]="Insert",n[n.Delete=20]="Delete",n[n.Digit0=21]="Digit0",n[n.Digit1=22]="Digit1",n[n.Digit2=23]="Digit2",n[n.Digit3=24]="Digit3",n[n.Digit4=25]="Digit4",n[n.Digit5=26]="Digit5",n[n.Digit6=27]="Digit6",n[n.Digit7=28]="Digit7",n[n.Digit8=29]="Digit8",n[n.Digit9=30]="Digit9",n[n.KeyA=31]="KeyA",n[n.KeyB=32]="KeyB",n[n.KeyC=33]="KeyC",n[n.KeyD=34]="KeyD",n[n.KeyE=35]="KeyE",n[n.KeyF=36]="KeyF",n[n.KeyG=37]="KeyG",n[n.KeyH=38]="KeyH",n[n.KeyI=39]="KeyI",n[n.KeyJ=40]="KeyJ",n[n.KeyK=41]="KeyK",n[n.KeyL=42]="KeyL",n[n.KeyM=43]="KeyM",n[n.KeyN=44]="KeyN",n[n.KeyO=45]="KeyO",n[n.KeyP=46]="KeyP",n[n.KeyQ=47]="KeyQ",n[n.KeyR=48]="KeyR",n[n.KeyS=49]="KeyS",n[n.KeyT=50]="KeyT",n[n.KeyU=51]="KeyU",n[n.KeyV=52]="KeyV",n[n.KeyW=53]="KeyW",n[n.KeyX=54]="KeyX",n[n.KeyY=55]="KeyY",n[n.KeyZ=56]="KeyZ",n[n.Meta=57]="Meta",n[n.ContextMenu=58]="ContextMenu",n[n.F1=59]="F1",n[n.F2=60]="F2",n[n.F3=61]="F3",n[n.F4=62]="F4",n[n.F5=63]="F5",n[n.F6=64]="F6",n[n.F7=65]="F7",n[n.F8=66]="F8",n[n.F9=67]="F9",n[n.F10=68]="F10",n[n.F11=69]="F11",n[n.F12=70]="F12",n[n.F13=71]="F13",n[n.F14=72]="F14",n[n.F15=73]="F15",n[n.F16=74]="F16",n[n.F17=75]="F17",n[n.F18=76]="F18",n[n.F19=77]="F19",n[n.F20=78]="F20",n[n.F21=79]="F21",n[n.F22=80]="F22",n[n.F23=81]="F23",n[n.F24=82]="F24",n[n.NumLock=83]="NumLock",n[n.ScrollLock=84]="ScrollLock",n[n.Semicolon=85]="Semicolon",n[n.Equal=86]="Equal",n[n.Comma=87]="Comma",n[n.Minus=88]="Minus",n[n.Period=89]="Period",n[n.Slash=90]="Slash",n[n.Backquote=91]="Backquote",n[n.BracketLeft=92]="BracketLeft",n[n.Backslash=93]="Backslash",n[n.BracketRight=94]="BracketRight",n[n.Quote=95]="Quote",n[n.OEM_8=96]="OEM_8",n[n.IntlBackslash=97]="IntlBackslash",n[n.Numpad0=98]="Numpad0",n[n.Numpad1=99]="Numpad1",n[n.Numpad2=100]="Numpad2",n[n.Numpad3=101]="Numpad3",n[n.Numpad4=102]="Numpad4",n[n.Numpad5=103]="Numpad5",n[n.Numpad6=104]="Numpad6",n[n.Numpad7=105]="Numpad7",n[n.Numpad8=106]="Numpad8",n[n.Numpad9=107]="Numpad9",n[n.NumpadMultiply=108]="NumpadMultiply",n[n.NumpadAdd=109]="NumpadAdd",n[n.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",n[n.NumpadSubtract=111]="NumpadSubtract",n[n.NumpadDecimal=112]="NumpadDecimal",n[n.NumpadDivide=113]="NumpadDivide",n[n.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",n[n.ABNT_C1=115]="ABNT_C1",n[n.ABNT_C2=116]="ABNT_C2",n[n.AudioVolumeMute=117]="AudioVolumeMute",n[n.AudioVolumeUp=118]="AudioVolumeUp",n[n.AudioVolumeDown=119]="AudioVolumeDown",n[n.BrowserSearch=120]="BrowserSearch",n[n.BrowserHome=121]="BrowserHome",n[n.BrowserBack=122]="BrowserBack",n[n.BrowserForward=123]="BrowserForward",n[n.MediaTrackNext=124]="MediaTrackNext",n[n.MediaTrackPrevious=125]="MediaTrackPrevious",n[n.MediaStop=126]="MediaStop",n[n.MediaPlayPause=127]="MediaPlayPause",n[n.LaunchMediaPlayer=128]="LaunchMediaPlayer",n[n.LaunchMail=129]="LaunchMail",n[n.LaunchApp2=130]="LaunchApp2",n[n.Clear=131]="Clear",n[n.MAX_VALUE=132]="MAX_VALUE"})(UC||(UC={}));var KC;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(KC||(KC={}));var $C;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})($C||($C={}));var qC;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(qC||(qC={}));var jC;(function(n){n[n.Normal=1]="Normal",n[n.Underlined=2]="Underlined"})(jC||(jC={}));var GC;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.TEXTAREA=1]="TEXTAREA",n[n.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",n[n.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",n[n.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",n[n.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",n[n.CONTENT_TEXT=6]="CONTENT_TEXT",n[n.CONTENT_EMPTY=7]="CONTENT_EMPTY",n[n.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",n[n.CONTENT_WIDGET=9]="CONTENT_WIDGET",n[n.OVERVIEW_RULER=10]="OVERVIEW_RULER",n[n.SCROLLBAR=11]="SCROLLBAR",n[n.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",n[n.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(GC||(GC={}));var ZC;(function(n){n[n.AIGenerated=1]="AIGenerated"})(ZC||(ZC={}));var YC;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(YC||(YC={}));var XC;(function(n){n[n.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",n[n.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",n[n.TOP_CENTER=2]="TOP_CENTER"})(XC||(XC={}));var QC;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(QC||(QC={}));var JC;(function(n){n[n.Word=0]="Word",n[n.Line=1]="Line",n[n.Suggest=2]="Suggest"})(JC||(JC={}));var ew;(function(n){n[n.Left=0]="Left",n[n.Right=1]="Right",n[n.None=2]="None",n[n.LeftOfInjectedText=3]="LeftOfInjectedText",n[n.RightOfInjectedText=4]="RightOfInjectedText"})(ew||(ew={}));var tw;(function(n){n[n.Off=0]="Off",n[n.On=1]="On",n[n.Relative=2]="Relative",n[n.Interval=3]="Interval",n[n.Custom=4]="Custom"})(tw||(tw={}));var iw;(function(n){n[n.None=0]="None",n[n.Text=1]="Text",n[n.Blocks=2]="Blocks"})(iw||(iw={}));var nw;(function(n){n[n.Smooth=0]="Smooth",n[n.Immediate=1]="Immediate"})(nw||(nw={}));var ow;(function(n){n[n.Auto=1]="Auto",n[n.Hidden=2]="Hidden",n[n.Visible=3]="Visible"})(ow||(ow={}));var sw;(function(n){n[n.LTR=0]="LTR",n[n.RTL=1]="RTL"})(sw||(sw={}));var rw;(function(n){n.Off="off",n.OnCode="onCode",n.On="on"})(rw||(rw={}));var aw;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(aw||(aw={}));var lw;(function(n){n[n.File=0]="File",n[n.Module=1]="Module",n[n.Namespace=2]="Namespace",n[n.Package=3]="Package",n[n.Class=4]="Class",n[n.Method=5]="Method",n[n.Property=6]="Property",n[n.Field=7]="Field",n[n.Constructor=8]="Constructor",n[n.Enum=9]="Enum",n[n.Interface=10]="Interface",n[n.Function=11]="Function",n[n.Variable=12]="Variable",n[n.Constant=13]="Constant",n[n.String=14]="String",n[n.Number=15]="Number",n[n.Boolean=16]="Boolean",n[n.Array=17]="Array",n[n.Object=18]="Object",n[n.Key=19]="Key",n[n.Null=20]="Null",n[n.EnumMember=21]="EnumMember",n[n.Struct=22]="Struct",n[n.Event=23]="Event",n[n.Operator=24]="Operator",n[n.TypeParameter=25]="TypeParameter"})(lw||(lw={}));var cw;(function(n){n[n.Deprecated=1]="Deprecated"})(cw||(cw={}));var dw;(function(n){n[n.Hidden=0]="Hidden",n[n.Blink=1]="Blink",n[n.Smooth=2]="Smooth",n[n.Phase=3]="Phase",n[n.Expand=4]="Expand",n[n.Solid=5]="Solid"})(dw||(dw={}));var hw;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(hw||(hw={}));var uw;(function(n){n[n.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",n[n.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",n[n.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",n[n.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(uw||(uw={}));var fw;(function(n){n[n.None=0]="None",n[n.Same=1]="Same",n[n.Indent=2]="Indent",n[n.DeepIndent=3]="DeepIndent"})(fw||(fw={}));var ru=class{static chord(e,t){return N9(e,t)}};ru.CtrlCmd=2048;ru.Shift=1024;ru.Alt=512;ru.WinCtrl=256;function gw(){return{editor:void 0,languages:void 0,CancellationTokenSource:un,Emitter:B,KeyCode:UC,KeyMod:ru,Position:U,Range:P,Selection:nt,SelectionDirection:sw,MarkerSeverity:KC,MarkerTag:$C,Uri:Oe,Token:xa}}_();v();b();vo();le();ot();sn();_();v();b();ke();_();v();b();ke();ye();le();var nN=class extends H{constructor(e){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){var i;(i=this._mediaQueryList)===null||i===void 0||i.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}},oN=class extends H{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);let t=this._register(new nN(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){let t=document.createElement("canvas").getContext("2d"),i=e.devicePixelRatio||1,o=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return i/o}},sN=class{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){let t=Wg(e),i=this.mapWindowIdToPixelRatioMonitor.get(t);return i||(i=Ld(new oN(e)),this.mapWindowIdToPixelRatioMonitor.set(t,i),Ld(ie.once(P7)(({vscodeWindowId:o})=>{o===t&&(i?.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))}))),i}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}},Kg=new sN;ye();le();_();v();b();_();v();b();_();v();b();var v0=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=Ta(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Ta(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Ta(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Ta(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Ta(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Ta(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Ta(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){let t=Ta(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=Ta(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=Ta(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Ta(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Ta(n){return typeof n=="number"?`${n}px`:n}function $e(n){return new v0(n)}function Si(n,e){n instanceof v0?(n.setFontFamily(e.getMassagedFontFamily()),n.setFontWeight(e.fontWeight),n.setFontSize(e.fontSize),n.setFontFeatureSettings(e.fontFeatureSettings),n.setFontVariationSettings(e.fontVariationSettings),n.setLineHeight(e.lineHeight),n.setLetterSpacing(e.letterSpacing)):(n.style.fontFamily=e.getMassagedFontFamily(),n.style.fontWeight=e.fontWeight,n.style.fontSize=e.fontSize+"px",n.style.fontFeatureSettings=e.fontFeatureSettings,n.style.fontVariationSettings=e.fontVariationSettings,n.style.lineHeight=e.lineHeight+"px",n.style.letterSpacing=e.letterSpacing+"px")}var Qw=class{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}},rN=class n{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),e.document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){let e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";let t=document.createElement("div");Si(t,this._bareFontInfo),e.appendChild(t);let i=document.createElement("div");Si(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);let o=document.createElement("div");Si(o,this._bareFontInfo),o.style.fontStyle="italic",e.appendChild(o);let s=[];for(let r of this._requests){let a;r.type===0&&(a=t),r.type===2&&(a=i),r.type===1&&(a=o),a.appendChild(document.createElement("br"));let l=document.createElement("span");n._render(l,r),a.appendChild(l),s.push(l)}this._container=e,this._testElements=s}static _render(e,t){if(t.chr===" "){let i="\xA0";for(let o=0;o<8;o++)i+=i;e.innerText=i}else{let i=t.chr;for(let o=0;o<8;o++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){let t=this._ensureCache(e),i=t.getValues(),o=!1;for(let s of i)s.isTrusted||(o=!0,t.remove(s));o&&this._onDidChange.fire()}readFontInfo(e,t){let i=this._ensureCache(e);if(!i.has(t)){let o=this._actualReadFontInfo(e,t);(o.typicalHalfwidthCharacterWidth<=2||o.typicalFullwidthCharacterWidth<=2||o.spaceWidth<=2||o.maxDigitWidth<=2)&&(o=new pu({pixelRatio:Kg.getInstance(e).value,fontFamily:o.fontFamily,fontWeight:o.fontWeight,fontSize:o.fontSize,fontFeatureSettings:o.fontFeatureSettings,fontVariationSettings:o.fontVariationSettings,lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,isMonospace:o.isMonospace,typicalHalfwidthCharacterWidth:Math.max(o.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(o.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:o.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(o.spaceWidth,5),middotWidth:Math.max(o.middotWidth,5),wsmiddotWidth:Math.max(o.wsmiddotWidth,5),maxDigitWidth:Math.max(o.maxDigitWidth,5)},!1)),this._writeToCache(e,t,o)}return i.get(t)}_createRequest(e,t,i,o){let s=new Qw(e,t);return i.push(s),o?.push(s),s}_actualReadFontInfo(e,t){let i=[],o=[],s=this._createRequest("n",0,i,o),r=this._createRequest("\uFF4D",0,i,null),a=this._createRequest(" ",0,i,o),l=this._createRequest("0",0,i,o),c=this._createRequest("1",0,i,o),d=this._createRequest("2",0,i,o),h=this._createRequest("3",0,i,o),u=this._createRequest("4",0,i,o),f=this._createRequest("5",0,i,o),g=this._createRequest("6",0,i,o),m=this._createRequest("7",0,i,o),C=this._createRequest("8",0,i,o),S=this._createRequest("9",0,i,o),w=this._createRequest("\u2192",0,i,o),y=this._createRequest("\uFFEB",0,i,null),x=this._createRequest("\xB7",0,i,o),k=this._createRequest("\u2E31",0,i,null),T="|/-_ilm%";for(let G=0,V=T.length;G.001){M=!1;break}}let j=!0;return M&&y.width!==W&&(j=!1),y.width>w.width&&(j=!1),new pu({pixelRatio:Kg.getInstance(e).value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:M,typicalHalfwidthCharacterWidth:s.width,typicalFullwidthCharacterWidth:r.width,canUseHalfwidthRightwardsArrow:j,spaceWidth:a.width,middotWidth:x.width,wsmiddotWidth:k.width,maxDigitWidth:N},!0)}},cN=class{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){let t=e.getId();return!!this._values[t]}get(e){let t=e.getId();return this._values[t]}put(e,t){let i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){let t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}},C0=new lN;Ud();Or();_();v();b();hs();_();v();b();Gt();le();_();v();b();xt();ye();le();hs();Lt();ot();var Jq="$initialize",h3=!1;function I0(n){hl&&(h3||(h3=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(n.message))}var vN=class{constructor(e,t,i,o){this.vsWorker=e,this.req=t,this.method=i,this.args=o,this.type=0}},Cy=class{constructor(e,t,i,o){this.vsWorker=e,this.seq=t,this.res=i,this.err=o,this.type=1}},CN=class{constructor(e,t,i,o){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=o,this.type=2}},wN=class{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}},yN=class{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}},SN=class{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){let i=String(++this._lastSentReq);return new Promise((o,s)=>{this._pendingReplies[i]={resolve:o,reject:s},this._send(new vN(this._workerId,i,e,t))})}listen(e,t){let i=null,o=new B({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,o),this._send(new CN(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new yN(this._workerId,i)),i=null}});return o.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}let t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),t.reject(i);return}t.resolve(e.res)}_handleRequestMessage(e){let t=e.req;this._handler.handleMessage(e.method,e.args).then(o=>{this._send(new Cy(this._workerId,t,o,void 0))},o=>{o.detail instanceof Error&&(o.detail=cT(o.detail)),this._send(new Cy(this._workerId,t,void 0,cT(o)))})}_handleSubscribeEventMessage(e){let t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(o=>{this._send(new wN(this._workerId,t,o))});this._pendingEvents.set(t,i)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){let t=[];if(e.type===0)for(let i=0;i{this._protocol.handleMessage(d)},d=>{o?.(d)})),this._protocol=new SN({sendMessage:(d,h)=>{this._worker.postMessage(d,h)},handleMessage:(d,h)=>{if(typeof i[d]!="function")return Promise.reject(new Error("Missing method "+d+" on main thread host."));try{return Promise.resolve(i[d].apply(i,h))}catch(u){return Promise.reject(u)}},handleEvent:(d,h)=>{if(f3(d)){let u=i[d].call(i,h);if(typeof u!="function")throw new Error(`Missing dynamic event ${d} on main thread host.`);return u}if(u3(d)){let u=i[d];if(typeof u!="function")throw new Error(`Missing event ${d} on main thread host.`);return u}throw new Error(`Malformed event name ${d}`)}}),this._protocol.setWorkerId(this._worker.getId());let s=null,r=globalThis.require;typeof r<"u"&&typeof r.getConfig=="function"?s=r.getConfig():typeof globalThis.requirejs<"u"&&(s=globalThis.requirejs.s.contexts._.config);let a=dg(i);this._onModuleLoaded=this._protocol.sendMessage(Jq,[this._worker.getId(),JSON.parse(JSON.stringify(s)),t,a]);let l=(d,h)=>this._request(d,h),c=(d,h)=>this._protocol.listen(d,h);this._lazyProxy=new Promise((d,h)=>{o=h,this._onModuleLoaded.then(u=>{d(ej(u,l,c))},u=>{h(u),this._onError("Worker failed to load "+t,u)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((i,o)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(i,o)},o)})}_onError(e,t){console.error(e),console.info(t)}};function u3(n){return n[0]==="o"&&n[1]==="n"&&ml(n.charCodeAt(2))}function f3(n){return/^onDynamic/.test(n)&&ml(n.charCodeAt(9))}function ej(n,e,t){let i=r=>function(){let a=Array.prototype.slice.call(arguments,0);return e(r,a)},o=r=>function(a){return t(r,a)},s={};for(let r of n){if(f3(r)){s[r]=o(r);continue}if(u3(r)){s[r]=t(r,void 0);continue}s[r]=i(r)}return s}_();v();b();_();v();b();vo();xt();function Bs(n,e){var t;let i=globalThis.MonacoEnvironment;if(i?.createTrustedTypesPolicy)try{return i.createTrustedTypesPolicy(n,e)}catch(o){ut(o);return}try{return(t=gt.trustedTypes)===null||t===void 0?void 0:t.createPolicy(n,e)}catch(o){ut(o);return}}xt();le();var g3=Bs("defaultWorkerFactory",{createScriptURL:n=>n});function tj(n){let e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",n);if(typeof e.getWorkerUrl=="function"){let t=e.getWorkerUrl("workerMain.js",n);return new Worker(g3?g3.createScriptURL(t):t,{name:n})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function ij(n){return typeof n.then=="function"}var xN=class extends H{constructor(e,t,i,o,s){super(),this.id=t,this.label=i;let r=tj(i);ij(r)?this.worker=r:this.worker=Promise.resolve(r),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(l){o(l.data)},a.onmessageerror=s,typeof a.addEventListener=="function"&&a.addEventListener("error",s)}),this._register(be(()=>{var a;(a=this.worker)===null||a===void 0||a.then(l=>{l.onmessage=null,l.onmessageerror=null,l.removeEventListener("error",s),l.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(e,t){var i;(i=this.worker)===null||i===void 0||i.then(o=>{try{o.postMessage(e,t)}catch(s){ut(s),ut(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:s}))}})}},T0=class n{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){let o=++n.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new xN(e,o,this._label||"anonymous"+o,t,s=>{I0(s),this._webWorkerFailedBeforeError=s,i(s)})}};T0.LAST_WORKER_ID=0;Ke();lr();_();v();b();_();v();b();_();v();b();var Ra=class{constructor(e,t,i,o){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=o}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}};Bg();var Hy=class{constructor(e){this.source=e}getElements(){let e=this.source,t=new Int32Array(e.length);for(let i=0,o=e.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new Ra(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}},Eu=class n{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;let[o,s,r]=n._getElements(e),[a,l,c]=n._getElements(t);this._hasStrings=r&&c,this._originalStringElements=o,this._originalElementsOrHash=s,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){let t=e.getElements();if(n._isStringArray(t)){let i=new Int32Array(t.length);for(let o=0,s=t.length;o=e&&o>=i&&this.ElementsAreEqual(t,o);)t--,o--;if(e>t||i>o){let h;return i<=o?(jd.Assert(e===t+1,"originalStart should only be one more than originalEnd"),h=[new Ra(e,0,i,o-i+1)]):e<=t?(jd.Assert(i===o+1,"modifiedStart should only be one more than modifiedEnd"),h=[new Ra(e,t-e+1,i,0)]):(jd.Assert(e===t+1,"originalStart should only be one more than originalEnd"),jd.Assert(i===o+1,"modifiedStart should only be one more than modifiedEnd"),h=[]),h}let r=[0],a=[0],l=this.ComputeRecursionPoint(e,t,i,o,r,a,s),c=r[0],d=a[0];if(l!==null)return l;if(!s[0]){let h=this.ComputeDiffRecursive(e,c,i,d,s),u=[];return s[0]?u=[new Ra(c+1,t-(c+1)+1,d+1,o-(d+1)+1)]:u=this.ComputeDiffRecursive(c+1,t,d+1,o,s),this.ConcatenateChanges(h,u)}return[new Ra(e,t-e+1,i,o-i+1)]}WALKTRACE(e,t,i,o,s,r,a,l,c,d,h,u,f,g,m,C,S,w){let y=null,x=null,k=new Uy,T=t,N=i,M=f[0]-C[0]-o,W=-1073741824,j=this.m_forwardHistory.length-1;do{let G=M+e;G===T||G=0&&(c=this.m_forwardHistory[j],e=c[0],T=1,N=c.length-1)}while(--j>=-1);if(y=k.getReverseChanges(),w[0]){let G=f[0]+1,V=C[0]+1;if(y!==null&&y.length>0){let z=y[y.length-1];G=Math.max(G,z.getOriginalEnd()),V=Math.max(V,z.getModifiedEnd())}x=[new Ra(G,u-G+1,V,m-V+1)]}else{k=new Uy,T=r,N=a,M=f[0]-C[0]-l,W=1073741824,j=S?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{let G=M+s;G===T||G=d[G+1]?(h=d[G+1]-1,g=h-M-l,h>W&&k.MarkNextChange(),W=h+1,k.AddOriginalElement(h+1,g+1),M=G+1-s):(h=d[G-1],g=h-M-l,h>W&&k.MarkNextChange(),W=h,k.AddModifiedElement(h+1,g+1),M=G-1-s),j>=0&&(d=this.m_reverseHistory[j],s=d[0],T=1,N=d.length-1)}while(--j>=-1);x=k.getChanges()}return this.ConcatenateChanges(y,x)}ComputeRecursionPoint(e,t,i,o,s,r,a){let l=0,c=0,d=0,h=0,u=0,f=0;e--,i--,s[0]=0,r[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];let g=t-e+(o-i),m=g+1,C=new Int32Array(m),S=new Int32Array(m),w=o-i,y=t-e,x=e-i,k=t-o,N=(y-w)%2===0;C[w]=e,S[y]=t,a[0]=!1;for(let M=1;M<=g/2+1;M++){let W=0,j=0;d=this.ClipDiagonalBound(w-M,M,w,m),h=this.ClipDiagonalBound(w+M,M,w,m);for(let V=d;V<=h;V+=2){V===d||VW+j&&(W=l,j=c),!N&&Math.abs(V-y)<=M-1&&l>=S[V])return s[0]=l,r[0]=c,z<=S[V]&&1447>0&&M<=1448?this.WALKTRACE(w,d,h,x,y,u,f,k,C,S,l,t,s,c,o,r,N,a):null}let G=(W-e+(j-i)-M)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(W,G))return a[0]=!0,s[0]=W,r[0]=j,G>0&&1447>0&&M<=1448?this.WALKTRACE(w,d,h,x,y,u,f,k,C,S,l,t,s,c,o,r,N,a):(e++,i++,[new Ra(e,t-e+1,i,o-i+1)]);u=this.ClipDiagonalBound(y-M,M,y,m),f=this.ClipDiagonalBound(y+M,M,y,m);for(let V=u;V<=f;V+=2){V===u||V=S[V+1]?l=S[V+1]-1:l=S[V-1],c=l-(V-y)-k;let z=l;for(;l>e&&c>i&&this.ElementsAreEqual(l,c);)l--,c--;if(S[V]=l,N&&Math.abs(V-w)<=M&&l<=C[V])return s[0]=l,r[0]=c,z>=C[V]&&1447>0&&M<=1448?this.WALKTRACE(w,d,h,x,y,u,f,k,C,S,l,t,s,c,o,r,N,a):null}if(M<=1447){let V=new Int32Array(h-d+2);V[0]=w-d+1,Gd.Copy2(C,d,V,1,h-d+1),this.m_forwardHistory.push(V),V=new Int32Array(f-u+2),V[0]=y-u+1,Gd.Copy2(S,u,V,1,f-u+1),this.m_reverseHistory.push(V)}}return this.WALKTRACE(w,d,h,x,y,u,f,k,C,S,l,t,s,c,o,r,N,a)}PrettifyChanges(e){for(let t=0;t0,a=i.modifiedLength>0;for(;i.originalStart+i.originalLength=0;t--){let i=e[t],o=0,s=0;if(t>0){let h=e[t-1];o=h.originalStart+h.originalLength,s=h.modifiedStart+h.modifiedLength}let r=i.originalLength>0,a=i.modifiedLength>0,l=0,c=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let h=1;;h++){let u=i.originalStart-h,f=i.modifiedStart-h;if(uc&&(c=m,l=h)}i.originalStart-=l,i.modifiedStart-=l;let d=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],d)){e[t-1]=d[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,i=e.length;t0&&f>l&&(l=f,c=h,d=u)}return l>0?[c,d]:null}_contiguousSequenceScore(e,t,i){let o=0;for(let s=0;s=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){let i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){let i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,o){let s=this._OriginalRegionIsBoundary(e,t)?1:0,r=this._ModifiedRegionIsBoundary(i,o)?1:0;return s+r}ConcatenateChanges(e,t){let i=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){let o=new Array(e.length+t.length-1);return Gd.Copy(e,0,o,0,e.length-1),o[e.length-1]=i[0],Gd.Copy(t,1,o,e.length,t.length-1),o}else{let o=new Array(e.length+t.length);return Gd.Copy(e,0,o,0,e.length),Gd.Copy(t,0,o,e.length,t.length),o}}ChangesOverlap(e,t,i){if(jd.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),jd.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){let o=e.originalStart,s=e.originalLength,r=e.modifiedStart,a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(s=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new Ra(o,s,r,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,o){if(e>=0&&e=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=Tu(e),t=Tu(t),this.values[e]===t?!1:(this.values[e]=t,e-1=i.length)return!1;let s=i.length-e;return t>=s&&(t=s),t===0?!1:(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=Tu(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,o=0,s=0,r=0;for(;t<=i;)if(o=t+(i-t)/2|0,s=this.prefixSum[o],r=s-this.values[o],e=s)t=o+1;else break;return new qy(o,e-r)}},$y=class{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();let t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new qy(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=fd(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=o+i;for(let s=0;st&&(t=l),a>i&&(i=a),c>i&&(i=c)}t++,i++;let o=new eA(i,t,0);for(let s=0,r=e.length;s=this._maxCharCode?0:this._states.get(e,t)}},JN=null;function wj(){return JN===null&&(JN=new tA([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),JN}var B0=null;function yj(){if(B0===null){B0=new Nc(0);let n=` <>'"\u3001\u3002\uFF61\uFF64\uFF0C\uFF0E\uFF1A\uFF1B\u2018\u3008\u300C\u300E\u3014\uFF08\uFF3B\uFF5B\uFF62\uFF63\uFF5D\uFF3D\uFF09\u3015\u300F\u300D\u3009\u2019\uFF40\uFF5E\u2026`;for(let t=0;to);if(o>0){let a=t.charCodeAt(o-1),l=t.charCodeAt(r);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&r--}return{range:{startLineNumber:i,startColumn:o+1,endLineNumber:i,endColumn:r+2},url:t.substring(o,r+1)}}static computeLinks(e,t=wj()){let i=yj(),o=[];for(let s=1,r=e.getLineCount();s<=r;s++){let a=e.getLineContent(s),l=a.length,c=0,d=0,h=0,u=1,f=!1,g=!1,m=!1,C=!1;for(;c=0?(o+=i?1:-1,o<0?o=e.length-1:o%=e.length,e[o]):null}};Qg.INSTANCE=new Qg;vg();_();v();b();Ke();eS();ot();Na();ug();var tS=class{static computeUnicodeHighlights(e,t,i){let o=i?i.startLineNumber:1,s=i?i.endLineNumber:e.getLineCount(),r=new iS(t),a=r.getCandidateCodePoints(),l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${Ij(Array.from(a))}`,"g");let c=new kl(null,l),d=[],h=!1,u,f=0,g=0,m=0;e:for(let C=o,S=s;C<=S;C++){let w=e.getLineContent(C),y=w.length;c.reset(0);do if(u=c.next(w),u){let x=u.index,k=u.index+u[0].length;if(x>0){let W=w.charCodeAt(x-1);pi(W)&&x--}if(k+1=W){h=!0;break e}d.push(new P(C,x+1,C,k+1))}}while(u)}return{ranges:d,hasMore:h,ambiguousCharacterCount:f,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:m}}static computeUnicodeHighlightReason(e,t){let i=new iS(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{let s=e.codePointAt(0),r=i.ambiguousCharacters.getPrimaryConfusable(s),a=gl.getLocales().filter(l=>!gl.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(s));return{kind:0,confusableWith:String.fromCodePoint(r),notAmbiguousInLocales:a}}case 1:return{kind:2}}}};function Ij(n,e){return`[${gs(n.map(i=>String.fromCodePoint(i)).join(""))}]`}var iS=class{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=gl.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";let e=new Set;if(this.options.invisibleCharacters)for(let t of cu.codePoints)q3(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(let t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(let t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){let i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return 0;if(this.options.nonBasicASCII)return 1;let o=!1,s=!1;if(t)for(let r of t){let a=r.codePointAt(0),l=Ig(r);o=o||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!cu.isInvisibleCharacter(a)&&(s=!0)}return!o&&s?0:this.options.invisibleCharacters&&!q3(e)&&cu.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}};function q3(n){return n===" "||n===` +`||n===" "}_();v();b();_();v();b();_();v();b();var Xd=class{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}},im=class{constructor(e,t){this.lineRangeMapping=e,this.changes=t}};_();v();b();xt();Bo();Ke();_();v();b();Na();xt();ft();_();v();b();es();om();var sS=class{constructor(e){this.text=e,this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;tqg(e,(t,i)=>t.range.getEndPosition().isBeforeOrEqual(i.range.getStartPosition())))}apply(e){let t="",i=new U(1,1);for(let s of this.edits){let r=s.range,a=r.getStartPosition(),l=r.getEndPosition(),c=X3(i,a);c.isEmpty()||(t+=e.getValueOfRange(c)),t+=s.text,i=l}let o=X3(i,e.endPositionExclusive);return o.isEmpty()||(t+=e.getValueOfRange(o)),t}applyToString(e){let t=new lA(e);return this.apply(t)}getNewRanges(){let e=[],t=0,i=0,o=0;for(let s of this.edits){let r=ws.ofText(s.text),a=U.lift({lineNumber:s.range.startLineNumber+i,column:s.range.startColumn+(s.range.startLineNumber===t?o:0)}),l=r.createRange(a);e.push(l),i=l.endLineNumber-s.range.endLineNumber,o=l.endColumn-s.range.endColumn,t=s.range.endLineNumber}return e}},aS=class{constructor(e,t){this.range=e,this.text=t}};function X3(n,e){if(n.lineNumber===e.lineNumber&&n.column===Number.MAX_SAFE_INTEGER)return P.fromPositions(e,e);if(!n.isBeforeOrEqual(e))throw new St("start must be before end");return new P(n.lineNumber,n.column,e.lineNumber,e.column)}var z0=class{get endPositionExclusive(){return this.length.addToPosition(new U(1,1))}},lA=class extends z0{constructor(e){super(),this.value=e,this._t=new sS(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}};var So=class n{static inverse(e,t,i){let o=[],s=1,r=1;for(let l of e){let c=new n(new Ne(s,l.original.startLineNumber),new Ne(r,l.modified.startLineNumber));c.modified.isEmpty||o.push(c),s=l.original.endLineNumberExclusive,r=l.modified.endLineNumberExclusive}let a=new n(new Ne(s,t+1),new Ne(r,i+1));return a.modified.isEmpty||o.push(a),o}static clip(e,t,i){let o=[];for(let s of e){let r=s.original.intersect(t),a=s.modified.intersect(i);r&&!r.isEmpty&&a&&!a.isEmpty&&o.push(new n(r,a))}return o}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new n(this.modified,this.original)}join(e){return new n(this.original.join(e.original),this.modified.join(e.modified))}toRangeMapping(){let e=this.original.toInclusiveRange(),t=this.modified.toInclusiveRange();if(e&&t)return new ts(e,t);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new St("not a valid diff");return new ts(new P(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new P(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new ts(new P(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new P(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}},xo=class n extends So{static fromRangeMappings(e){let t=Ne.join(e.map(o=>Ne.fromRangeInclusive(o.originalRange))),i=Ne.join(e.map(o=>Ne.fromRangeInclusive(o.modifiedRange)));return new n(t,i,e)}constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){var e;return new n(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}withInnerChangesFromLineRanges(){return new n(this.original,this.modified,[this.toRangeMapping()])}},ts=class n{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new n(this.modifiedRange,this.originalRange)}toTextEdit(e){let t=e.getValueOfRange(this.modifiedRange);return new aS(this.originalRange,t)}};ot();Ke();Na();Bo();var Nj=3,lS=class{computeDiff(e,t,i){var o;let r=new dA(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[],l=null;for(let c of r.changes){let d;c.originalEndLineNumber===0?d=new Ne(c.originalStartLineNumber+1,c.originalStartLineNumber+1):d=new Ne(c.originalStartLineNumber,c.originalEndLineNumber+1);let h;c.modifiedEndLineNumber===0?h=new Ne(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):h=new Ne(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let u=new xo(d,h,(o=c.charChanges)===null||o===void 0?void 0:o.map(f=>new ts(new P(f.originalStartLineNumber,f.originalStartColumn,f.originalEndLineNumber,f.originalEndColumn),new P(f.modifiedStartLineNumber,f.modifiedStartColumn,f.modifiedEndLineNumber,f.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===u.modified.startLineNumber||l.original.endLineNumberExclusive===u.original.startLineNumber)&&(u=new xo(l.original.join(u.original),l.modified.join(u.modified),l.innerChanges&&u.innerChanges?l.innerChanges.concat(u.innerChanges):void 0),a.pop()),a.push(u),l=u}return Fr(()=>qg(a,(c,d)=>d.original.startLineNumber-c.original.endLineNumberExclusive===d.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===10?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===10?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===10?1:this._columns[e]+1)}},sm=class n{constructor(e,t,i,o,s,r,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=o,this.modifiedStartLineNumber=s,this.modifiedStartColumn=r,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,i){let o=t.getStartLineNumber(e.originalStart),s=t.getStartColumn(e.originalStart),r=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),l=i.getStartLineNumber(e.modifiedStart),c=i.getStartColumn(e.modifiedStart),d=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),h=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new n(o,s,r,a,l,c,d,h)}};function Aj(n){if(n.length<=1)return n;let e=[n[0]],t=e[0];for(let i=1,o=n.length;i0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&s()){let f=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),g=o.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&g.getElements().length>0){let m=J3(f,g,s,!0).changes;a&&(m=Aj(m)),u=[];for(let C=0,S=m.length;C1&&m>1;){let C=u.charCodeAt(g-2),S=f.charCodeAt(m-2);if(C!==S)break;g--,m--}(g>1||m>1)&&this._pushTrimWhitespaceCharChange(o,s+1,1,g,r+1,1,m)}{let g=uA(u,1),m=uA(f,1),C=u.length+1,S=f.length+1;for(;g!0;let e=Date.now();return()=>Date.now()-e{i.push(n.fromOffsetPairs(o?o.getEndExclusives():Ws.zero,s?s.getStarts():new Ws(t,(o?o.seq2Range.endExclusive-o.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new n(new ze(e.offset1,t.offset1),new ze(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new n(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new n(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new n(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new n(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new n(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){let t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(!(!t||!i))return new n(t,i)}getStarts(){return new Ws(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Ws(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}},Ws=class n{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new n(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}};Ws.zero=new Ws(0,0);Ws.max=new Ws(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);var Il=class{isValid(){return!0}};Il.instance=new Il;var dS=class{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new St("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime0&&m>0&&r.get(g-1,m-1)===3&&(w+=a.get(g-1,m-1)),w+=o?o(g,m):1):w=-1;let y=Math.max(C,S,w);if(y===w){let x=g>0&&m>0?a.get(g-1,m-1):0;a.set(g,m,x+1),r.set(g,m,3)}else y===C?(a.set(g,m,0),r.set(g,m,1)):y===S&&(a.set(g,m,0),r.set(g,m,2));s.set(g,m,y)}let l=[],c=e.length,d=t.length;function h(g,m){(g+1!==c||m+1!==d)&&l.push(new Tn(new ze(g+1,c),new ze(m+1,d))),c=g,d=m}let u=e.length-1,f=t.length-1;for(;u>=0&&f>=0;)r.get(u,f)===3?(h(u,f),u--,f--):r.get(u,f)===1?u--:f--;return h(-1,-1),l.reverse(),new El(l,!1)}};_();v();b();es();var lm=class{compute(e,t,i=Il.instance){if(e.length===0||t.length===0)return El.trivial(e,t);let o=e,s=t;function r(m,C){for(;mo.length||k>s.length)continue;let T=r(x,k);l.set(d,T);let N=x===w?c.get(d+1):c.get(d-1);if(c.set(d,T!==x?new uS(N,x,k,T-x):N),l.get(d)===o.length&&l.get(d)-d===s.length)break e}}let h=c.get(d),u=[],f=o.length,g=s.length;for(;;){let m=h?h.x+h.length:0,C=h?h.y+h.length:0;if((m!==f||C!==g)&&u.push(new Tn(new ze(m,f),new ze(C,g))),!h)break;f=h.x,g=h.y,h=h.prev}return u.reverse(),new El(u,!1)}},uS=class{constructor(e,t,i,o){this.prev=e,this.x=t,this.y=i,this.length=o}},fA=class{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if(e=-e-1,e>=this.negativeArr.length){let i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){let i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[e]=t}}},gA=class{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}};_();v();b();wt();Dl();cr();Bo();es();_();v();b();Dl();es();ft();Ke();var Qd=class{constructor(e,t,i){this.lines=e,this.considerWhitespaceChanges=i,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let o=!1;t.start>0&&t.endExclusive>=e.length&&(t=new ze(t.start-1,t.endExclusive),o=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let s=this.lineRange.start;sString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){let t=t8(e>0?this.elements[e-1]:-1),i=t8(ei<=e);return new U(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return P.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!mA(this.elements[e]))return;let t=e;for(;t>0&&mA(this.elements[t-1]);)t--;let i=e;for(;ir<=e.start))!==null&&t!==void 0?t:0,s=(i=j3(this.firstCharOffsetByLine,r=>e.endExclusive<=r))!==null&&i!==void 0?i:this.elements.length;return new ze(o,s)}};function mA(n){return n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57}var Mj={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function e8(n){return Mj[n]}function t8(n){return n===10?8:n===13?7:H0(n)?6:n>=97&&n<=122?0:n>=65&&n<=90?1:n>=48&&n<=57?2:n===-1?3:n===44||n===59?5:4}function n8(n,e,t,i,o,s){let{moves:r,excludedChanges:a}=Pj(n,e,t,s);if(!s.isValid())return[];let l=n.filter(d=>!a.has(d)),c=Oj(l,i,o,e,t,s);return L_(r,c),r=Fj(r),r=r.filter(d=>{let h=d.original.toOffsetRange().slice(e).map(f=>f.trim());return h.join(` +`).length>=15&&Rj(h,f=>f.length>=2)>=2}),r=Bj(n,r),r}function Rj(n,e){let t=0;for(let i of n)e(i)&&t++;return t}function Pj(n,e,t,i){let o=[],s=n.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new am(l.original,e,l)),r=new Set(n.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new am(l.modified,t,l))),a=new Set;for(let l of s){let c=-1,d;for(let h of r){let u=l.computeSimilarity(h);u>c&&(c=u,d=h)}if(c>.9&&d&&(r.delete(d),o.push(new So(l.range,d.range)),a.add(l.source),a.add(d.source)),!i.isValid())return{moves:o,excludedChanges:a}}return{moves:o,excludedChanges:a}}function Oj(n,e,t,i,o,s){let r=[],a=new Jg;for(let u of n)for(let f=u.original.startLineNumber;fu.modified.startLineNumber,ma));for(let u of n){let f=[];for(let g=u.modified.startLineNumber;g{for(let x of f)if(x.originalLineRange.endLineNumberExclusive+1===w.endLineNumberExclusive&&x.modifiedLineRange.endLineNumberExclusive+1===C.endLineNumberExclusive){x.originalLineRange=new Ne(x.originalLineRange.startLineNumber,w.endLineNumberExclusive),x.modifiedLineRange=new Ne(x.modifiedLineRange.startLineNumber,C.endLineNumberExclusive),S.push(x);return}let y={modifiedLineRange:C,originalLineRange:w};l.push(y),S.push(y)}),f=S}if(!s.isValid())return[]}l.sort(i9(Io(u=>u.modifiedLineRange.length,ma)));let c=new ur,d=new ur;for(let u of l){let f=u.modifiedLineRange.startLineNumber-u.originalLineRange.startLineNumber,g=c.subtractFrom(u.modifiedLineRange),m=d.subtractFrom(u.originalLineRange).getWithDelta(f),C=g.getIntersection(m);for(let S of C.ranges){if(S.length<3)continue;let w=S,y=S.delta(-f);r.push(new So(y,w)),c.addRange(w),d.addRange(y)}}r.sort(Io(u=>u.original.startLineNumber,ma));let h=new nm(n);for(let u=0;uT.original.startLineNumber<=f.original.startLineNumber),m=Mc(n,T=>T.modified.startLineNumber<=f.modified.startLineNumber),C=Math.max(f.original.startLineNumber-g.original.startLineNumber,f.modified.startLineNumber-m.modified.startLineNumber),S=h.findLastMonotonous(T=>T.original.startLineNumberT.modified.startLineNumberi.length||N>o.length||c.contains(N)||d.contains(T)||!i8(i[T-1],o[N-1],s))break}x>0&&(d.addRange(new Ne(f.original.startLineNumber-x,f.original.startLineNumber)),c.addRange(new Ne(f.modified.startLineNumber-x,f.modified.startLineNumber)));let k;for(k=0;ki.length||N>o.length||c.contains(N)||d.contains(T)||!i8(i[T-1],o[N-1],s))break}k>0&&(d.addRange(new Ne(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+k)),c.addRange(new Ne(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+k))),(x>0||k>0)&&(r[u]=new So(new Ne(f.original.startLineNumber-x,f.original.endLineNumberExclusive+k),new Ne(f.modified.startLineNumber-x,f.modified.endLineNumberExclusive+k)))}return r}function i8(n,e,t){if(n.trim()===e.trim())return!0;if(n.length>300&&e.length>300)return!1;let o=new lm().compute(new Qd([n],new ze(0,1),!1),new Qd([e],new ze(0,1),!1),t),s=0,r=Tn.invert(o.diffs,n.length);for(let d of r)d.seq1Range.forEach(h=>{H0(n.charCodeAt(h))||s++});function a(d){let h=0;for(let u=0;ue.length?n:e);return s/l>.6&&l>10}function Fj(n){if(n.length===0)return n;n.sort(Io(t=>t.original.startLineNumber,ma));let e=[n[0]];for(let t=1;t=0&&r>=0&&s+r<=2){e[e.length-1]=i.join(o);continue}e.push(o)}return e}function Bj(n,e){let t=new nm(n);return e=e.filter(i=>{let o=t.findLastMonotonous(a=>a.original.startLineNumbera.modified.startLineNumber0&&(a=a.delta(c))}o.push(a)}return i.length>0&&o.push(i[i.length-1]),o}function Wj(n,e,t){if(!n.getBoundaryScore||!e.getBoundaryScore)return t;for(let i=0;i0?t[i-1]:void 0,s=t[i],r=i+1=i.start&&n.seq2Range.start-r>=o.start&&t.isStronglyEqual(n.seq2Range.start-r,n.seq2Range.endExclusive-r)&&r<100;)r++;r--;let a=0;for(;n.seq1Range.start+ac&&(c=g,l=d)}return n.delta(l)}function r8(n,e,t){let i=[];for(let o of t){let s=i[i.length-1];if(!s){i.push(o);continue}o.seq1Range.start-s.seq1Range.endExclusive<=2||o.seq2Range.start-s.seq2Range.endExclusive<=2?i[i.length-1]=new Tn(s.seq1Range.join(o.seq1Range),s.seq2Range.join(o.seq2Range)):i.push(o)}return i}function a8(n,e,t){let i=Tn.invert(t,n.length),o=[],s=new Ws(0,0);function r(l,c){if(l.offset10;){let C=i[0];if(!(C.seq1Range.intersects(u.seq1Range)||C.seq2Range.intersects(u.seq2Range)))break;let w=n.findWordContaining(C.seq1Range.start),y=e.findWordContaining(C.seq2Range.start),x=new Tn(w,y),k=x.intersect(C);if(g+=k.seq1Range.length,m+=k.seq2Range.length,u=u.join(x),u.seq1Range.endExclusive>=C.seq1Range.endExclusive)i.shift();else break}g+m<(u.seq1Range.length+u.seq2Range.length)*2/3&&o.push(u),s=u.getEndExclusives()}for(;i.length>0;){let l=i.shift();l.seq1Range.isEmpty||(r(l.getStarts(),l),r(l.getEndExclusives().delta(-1),l))}return zj(t,o)}function zj(n,e){let t=[];for(;n.length>0||e.length>0;){let i=n[0],o=e[0],s;i&&(!o||i.seq1Range.start0&&t[t.length-1].seq1Range.endExclusive>=s.seq1Range.start?t[t.length-1]=t[t.length-1].join(s):t.push(s)}return t}function l8(n,e,t){let i=t;if(i.length===0)return i;let o=0,s;do{s=!1;let a=[i[0]];for(let l=1;l5||g.seq1Range.length+g.seq2Range.length>5)};var r=h;let c=i[l],d=a[a.length-1];h(d,c)?(s=!0,a[a.length-1]=a[a.length-1].join(c)):a.push(c)}i=a}while(o++<10&&s);return i}function c8(n,e,t){let i=t;if(i.length===0)return i;let o=0,s;do{s=!1;let l=[i[0]];for(let c=1;c5||C.length>500)return!1;let w=n.getText(C).trim();if(w.length>20||w.split(/\r\n|\r|\n/).length>1)return!1;let y=n.countLinesIn(g.seq1Range),x=g.seq1Range.length,k=e.countLinesIn(g.seq2Range),T=g.seq2Range.length,N=n.countLinesIn(m.seq1Range),M=m.seq1Range.length,W=e.countLinesIn(m.seq2Range),j=m.seq2Range.length,G=2*40+50;function V(z){return Math.min(z,G)}return Math.pow(Math.pow(V(y*40+x),1.5)+Math.pow(V(k*40+T),1.5),1.5)+Math.pow(Math.pow(V(N*40+M),1.5)+Math.pow(V(W*40+j),1.5),1.5)>(G**1.5)**1.5*1.3};var a=u;let d=i[c],h=l[l.length-1];u(h,d)?(s=!0,l[l.length-1]=l[l.length-1].join(d)):l.push(d)}i=l}while(o++<10&&s);let r=[];return YF(i,(l,c,d)=>{let h=c;function u(w){return w.length>0&&w.trim().length<=3&&c.seq1Range.length+c.seq2Range.length>100}let f=n.extendToFullLines(c.seq1Range),g=n.getText(new ze(f.start,c.seq1Range.start));u(g)&&(h=h.deltaStart(-g.length));let m=n.getText(new ze(c.seq1Range.endExclusive,f.endExclusive));u(m)&&(h=h.deltaEnd(m.length));let C=Tn.fromOffsetPairs(l?l.getEndExclusives():Ws.zero,d?d.getStarts():Ws.max),S=h.intersect(C);r.length>0&&S.getStarts().equals(r[r.length-1].getEndExclusives())?r[r.length-1]=r[r.length-1].join(S):r.push(S)}),r}_();v();b();var K0=class{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){let t=e===0?0:d8(this.lines[e-1]),i=e===this.lines.length?0:d8(this.lines[e]);return 1e3-(t+i)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` +`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}};function d8(n){let e=0;for(;ek===T))return new Xd([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new Xd([new xo(new Ne(1,e.length+1),new Ne(1,t.length+1),[new ts(new P(1,1,e.length,e[e.length-1].length+1),new P(1,1,t.length,t[t.length-1].length+1))])],[],!1);let o=i.maxComputationTimeMs===0?Il.instance:new dS(i.maxComputationTimeMs),s=!i.ignoreTrimWhitespace,r=new Map;function a(k){let T=r.get(k);return T===void 0&&(T=r.size,r.set(k,T)),T}let l=e.map(k=>a(k.trim())),c=t.map(k=>a(k.trim())),d=new K0(l,e),h=new K0(c,t),u=d.length+h.length<1700?this.dynamicProgrammingDiffing.compute(d,h,o,(k,T)=>e[k]===t[T]?t[T].length===0?.1:1+Math.log(1+t[T].length):.99):this.myersDiffingAlgorithm.compute(d,h),f=u.diffs,g=u.hitTimeout;f=U0(d,h,f),f=l8(d,h,f);let m=[],C=k=>{if(s)for(let T=0;Tk.seq1Range.start-S===k.seq2Range.start-w);let T=k.seq1Range.start-S;C(T),S=k.seq1Range.endExclusive,w=k.seq2Range.endExclusive;let N=this.refineDiff(e,t,k,o,s);N.hitTimeout&&(g=!0);for(let M of N.mappings)m.push(M)}C(e.length-S);let y=h8(m,e,t),x=[];return i.computeMoves&&(x=this.computeMoves(y,e,t,l,c,o,s)),Fr(()=>{function k(N,M){if(N.lineNumber<1||N.lineNumber>M.length)return!1;let W=M[N.lineNumber-1];return!(N.column<1||N.column>W.length+1)}function T(N,M){return!(N.startLineNumber<1||N.startLineNumber>M.length+1||N.endLineNumberExclusive<1||N.endLineNumberExclusive>M.length+1)}for(let N of y){if(!N.innerChanges)return!1;for(let M of N.innerChanges)if(!(k(M.modifiedRange.getStartPosition(),t)&&k(M.modifiedRange.getEndPosition(),t)&&k(M.originalRange.getStartPosition(),e)&&k(M.originalRange.getEndPosition(),e)))return!1;if(!T(N.modified,t)||!T(N.original,e))return!1}return!0}),new Xd(y,x,g)}computeMoves(e,t,i,o,s,r,a){return n8(e,t,i,o,s,r).map(d=>{let h=this.refineDiff(t,i,new Tn(d.original.toOffsetRange(),d.modified.toOffsetRange()),r,a),u=h8(h.mappings,t,i,!0);return new im(d,u)})}refineDiff(e,t,i,o,s){let r=new Qd(e,i.seq1Range,s),a=new Qd(t,i.seq2Range,s),l=r.length+a.length<500?this.dynamicProgrammingDiffing.compute(r,a,o):this.myersDiffingAlgorithm.compute(r,a,o),c=l.diffs;return c=U0(r,a,c),c=a8(r,a,c),c=r8(r,a,c),c=c8(r,a,c),{mappings:c.map(h=>new ts(r.translateRange(h.seq1Range),a.translateRange(h.seq2Range))),hitTimeout:l.hitTimeout}}};function h8(n,e,t,i=!1){let o=[];for(let s of ag(n.map(r=>Vj(r,e,t)),(r,a)=>r.original.overlapOrTouch(a.original)||r.modified.overlapOrTouch(a.modified))){let r=s[0],a=s[s.length-1];o.push(new xo(r.original.join(a.original),r.modified.join(a.modified),s.map(l=>l.innerChanges[0])))}return Fr(()=>!i&&o.length>0&&(o[0].modified.startLineNumber!==o[0].original.startLineNumber||t.length-o[o.length-1].modified.endLineNumberExclusive!==e.length-o[o.length-1].original.endLineNumberExclusive)?!1:qg(o,(s,r)=>r.original.startLineNumber-s.original.endLineNumberExclusive===r.modified.startLineNumber-s.modified.endLineNumberExclusive&&s.original.endLineNumberExclusive=t[n.modifiedRange.startLineNumber-1].length&&n.originalRange.startColumn-1>=e[n.originalRange.startLineNumber-1].length&&n.originalRange.startLineNumber<=n.originalRange.endLineNumber+o&&n.modifiedRange.startLineNumber<=n.modifiedRange.endLineNumber+o&&(i=1);let s=new Ne(n.originalRange.startLineNumber+i,n.originalRange.endLineNumber+1+o),r=new Ne(n.modifiedRange.startLineNumber+i,n.modifiedRange.endLineNumber+1+o);return new xo(s,r,[n])}var pA={getLegacy:()=>new lS,getDefault:()=>new cm};hs();_();v();b();gn();function g8(n){let e=[];for(let t of n){let i=Number(t);(i||i===0&&t.replace(/\s/g,"")!=="")&&e.push(i)}return e}function _A(n,e,t,i){return{red:n/255,blue:t/255,green:e/255,alpha:i}}function $0(n,e){let t=e.index,i=e[0].length;if(!t)return;let o=n.positionAt(t);return{startLineNumber:o.lineNumber,startColumn:o.column,endLineNumber:o.lineNumber,endColumn:o.column+i}}function Hj(n,e){if(!n)return;let t=Z.Format.CSS.parseHex(e);if(t)return{range:n,color:_A(t.rgba.r,t.rgba.g,t.rgba.b,t.rgba.a)}}function u8(n,e,t){if(!n||e.length!==1)return;let o=e[0].values(),s=g8(o);return{range:n,color:_A(s[0],s[1],s[2],t?s[3]:1)}}function f8(n,e,t){if(!n||e.length!==1)return;let o=e[0].values(),s=g8(o),r=new Z(new Tl(s[0],s[1]/100,s[2]/100,t?s[3]:1));return{range:n,color:_A(r.rgba.r,r.rgba.g,r.rgba.b,r.rgba.a)}}function q0(n,e){return typeof n=="string"?[...n.matchAll(e)]:n.findMatches(e)}function Uj(n){let e=[],i=q0(n,/\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|(#)([A-Fa-f0-9]{3})\b|(#)([A-Fa-f0-9]{4})\b|(#)([A-Fa-f0-9]{6})\b|(#)([A-Fa-f0-9]{8})\b/gm);if(i.length>0)for(let o of i){let s=o.filter(c=>c!==void 0),r=s[1],a=s[2];if(!a)continue;let l;if(r==="rgb"){let c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;l=u8($0(n,o),q0(a,c),!1)}else if(r==="rgba"){let c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=u8($0(n,o),q0(a,c),!0)}else if(r==="hsl"){let c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;l=f8($0(n,o),q0(a,c),!1)}else if(r==="hsla"){let c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=f8($0(n,o),q0(a,c),!0)}else r==="#"&&(l=Hj($0(n,o),r+a));l&&e.push(l)}return e}function m8(n){return!n||typeof n.getValue!="function"||typeof n.positionAt!="function"?[]:Uj(n)}_();v();b();var p8=/\bMARK:\s*(.*)$/d,Kj=/^-+|-+$/g;function _8(n,e){var t;let i=[];if(e.findRegionSectionHeaders&&(!((t=e.foldingRules)===null||t===void 0)&&t.markers)){let o=$j(n,e);i=i.concat(o)}if(e.findMarkSectionHeaders){let o=qj(n);i=i.concat(o)}return i}function $j(n,e){let t=[],i=n.getLineCount();for(let o=1;o<=i;o++){let s=n.getLineContent(o),r=s.match(e.foldingRules.markers.start);if(r){let a={startLineNumber:o,startColumn:r[0].length+1,endLineNumber:o,endColumn:s.length+1};if(a.endColumn>a.startColumn){let l={range:a,...b8(s.substring(r[0].length)),shouldBeInComments:!1};(l.text||l.hasSeparatorLine)&&t.push(l)}}}return t}function qj(n){let e=[],t=n.getLineCount();for(let i=1;i<=t;i++){let o=n.getLineContent(i);jj(o,i,e)}return e}function jj(n,e,t){p8.lastIndex=0;let i=p8.exec(n);if(i){let o=i.indices[1][0]+1,s=i.indices[1][1]+1,r={startLineNumber:e,startColumn:o,endLineNumber:e,endColumn:s};if(r.endColumn>r.startColumn){let a={range:r,...b8(i[1]),shouldBeInComments:!0};(a.text||a.hasSeparatorLine)&&t.push(a)}}}function b8(n){n=n.trim();let e=n.startsWith("-");return n=n.replace(Kj,""),{text:n,hasSeparatorLine:e}}var bA=class extends jy{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){let t=[];for(let i=0;ithis._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,o=!0;else{let s=this._lines[t-1].length+1;i<1?(i=1,o=!0):i>s&&(i=s,o=!0)}return o?{lineNumber:t,column:i}:e}},Pu=class n{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){let e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new bA(Oe.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}async computeUnicodeHighlights(e,t,i){let o=this._getModel(e);return o?tS.computeUnicodeHighlights(o,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async findSectionHeaders(e,t){let i=this._getModel(e);return i?_8(i,t):[]}async computeDiff(e,t,i,o){let s=this._getModel(e),r=this._getModel(t);return!s||!r?null:n.computeDiff(s,r,i,o)}static computeDiff(e,t,i,o){let s=o==="advanced"?pA.getDefault():pA.getLegacy(),r=e.getLinesContent(),a=t.getLinesContent(),l=s.computeDiff(r,a,i),c=l.changes.length>0?!1:this._modelsAreIdentical(e,t);function d(h){return h.map(u=>{var f;return[u.original.startLineNumber,u.original.endLineNumberExclusive,u.modified.startLineNumber,u.modified.endLineNumberExclusive,(f=u.innerChanges)===null||f===void 0?void 0:f.map(g=>[g.originalRange.startLineNumber,g.originalRange.startColumn,g.originalRange.endLineNumber,g.originalRange.endColumn,g.modifiedRange.startLineNumber,g.modifiedRange.startColumn,g.modifiedRange.endLineNumber,g.modifiedRange.endColumn])]})}return{identical:c,quitEarly:l.hitTimeout,changes:d(l.changes),moves:l.moves.map(h=>[h.lineRangeMapping.original.startLineNumber,h.lineRangeMapping.original.endLineNumberExclusive,h.lineRangeMapping.modified.startLineNumber,h.lineRangeMapping.modified.endLineNumberExclusive,d(h.changes)])}}static _modelsAreIdentical(e,t){let i=e.getLineCount(),o=t.getLineCount();if(i!==o)return!1;for(let s=1;s<=i;s++){let r=e.getLineContent(s),a=t.getLineContent(s);if(r!==a)return!1}return!0}async computeMoreMinimalEdits(e,t,i){let o=this._getModel(e);if(!o)return t;let s=[],r;t=t.slice(0).sort((l,c)=>{if(l.range&&c.range)return P.compareRangesUsingStarts(l.range,c.range);let d=l.range?0:1,h=c.range?0:1;return d-h});let a=0;for(let l=1;ln._diffLimit){s.push({range:l,text:c});continue}let u=B3(h,c,i),f=o.offsetAt(P.lift(l).getStartPosition());for(let g of u){let m=o.positionAt(f+g.originalStart),C=o.positionAt(f+g.originalStart+g.originalLength),S={text:c.substr(g.modifiedStart,g.modifiedLength),range:{startLineNumber:m.lineNumber,startColumn:m.column,endLineNumber:C.lineNumber,endColumn:C.column}};o.getValueInRange(S.range)!==S.text&&s.push(S)}}return typeof r=="number"&&s.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),s}async computeLinks(e){let t=this._getModel(e);return t?z3(t):null}async computeDefaultDocumentColors(e){let t=this._getModel(e);return t?m8(t):null}async textualSuggest(e,t,i,o){let s=new Er,r=new RegExp(i,o),a=new Set;e:for(let l of e){let c=this._getModel(l);if(c){for(let d of c.words(r))if(!(d===t||!isNaN(Number(d)))&&(a.add(d),a.size>n._suggestionsLimit))break e}}return{words:Array.from(a),duration:s.elapsed()}}async computeWordRanges(e,t,i,o){let s=this._getModel(e);if(!s)return Object.create(null);let r=new RegExp(i,o),a=Object.create(null);for(let l=t.startLineNumber;lthis._host.fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(r,t),Promise.resolve(dg(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(i){return Promise.reject(i)}}};Pu._diffLimit=1e5;Pu._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=gw());_u();_();v();b();qe();var fS=De("textResourceConfigurationService"),gS=De("textResourcePropertiesService");wt();Aa();vg();xt();Ou();Bo();vo();ke();var Gj=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},j0=function(n,e){return function(t,i){e(t,i,n)}},v8=60*1e3,C8=5*60*1e3;function Fu(n,e){let t=n.getModel(e);return!(!t||t.isTooLargeForSyncing())}var mS=class extends H{constructor(e,t,i,o,s){super(),this._modelService=e,this._workerManager=this._register(new CA(this._modelService,o)),this._logService=i,this._register(s.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(r,a)=>Fu(this._modelService,r.uri)?this._workerManager.withWorker().then(l=>l.computeLinks(r.uri)).then(l=>l&&{links:l}):Promise.resolve({links:[]})})),this._register(s.completionProvider.register("*",new vA(this._workerManager,t,this._modelService,o)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return Fu(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then(o=>o.computedUnicodeHighlights(e,t,i))}async computeDiff(e,t,i,o){let s=await this._workerManager.withWorker().then(l=>l.computeDiff(e,t,i,o));if(!s)return null;return{identical:s.identical,quitEarly:s.quitEarly,changes:a(s.changes),moves:s.moves.map(l=>new im(new So(new Ne(l[0],l[1]),new Ne(l[2],l[3])),a(l[4])))};function a(l){return l.map(c=>{var d;return new xo(new Ne(c[0],c[1]),new Ne(c[2],c[3]),(d=c[4])===null||d===void 0?void 0:d.map(h=>new ts(new P(h[0],h[1],h[2],h[3]),new P(h[4],h[5],h[6],h[7]))))})}}computeMoreMinimalEdits(e,t,i=!1){if(eu(t)){if(!Fu(this._modelService,e))return Promise.resolve(t);let o=Er.create(),s=this._workerManager.withWorker().then(r=>r.computeMoreMinimalEdits(e,t,i));return s.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),o.elapsed())),Promise.race([s,kc(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return Fu(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(o=>o.navigateValueSet(e,t,i))}canComputeWordRanges(e){return Fu(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}findSectionHeaders(e,t){return this._workerManager.withWorker().then(i=>i.findSectionHeaders(e,t))}};mS=Gj([j0(0,xn),j0(1,fS),j0(2,En),j0(3,yo),j0(4,Tt)],mS);var vA=class{constructor(e,t,i,o){this.languageConfigurationService=o,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}async provideCompletionItems(e,t){let i=this._configurationService.getValue(e.uri,t,"editor");if(i.wordBasedSuggestions==="off")return;let o=[];if(i.wordBasedSuggestions==="currentDocument")Fu(this._modelService,e.uri)&&o.push(e.uri);else for(let h of this._modelService.getModels())Fu(this._modelService,h.uri)&&(h===e?o.unshift(h.uri):(i.wordBasedSuggestions==="allDocuments"||h.getLanguageId()===e.getLanguageId())&&o.push(h.uri));if(o.length===0)return;let s=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),r=e.getWordAtPosition(t),a=r?new P(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):P.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),d=await(await this._workerManager.withWorker()).textualSuggest(o,r?.word,s);if(d)return{duration:d.duration,suggestions:d.words.map(h=>({kind:18,label:h,insertText:h,range:{insert:l,replace:a}}))}}},CA=class extends H{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new Bd).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(C8/2),gt),this._register(this._modelService.onModelRemoved(o=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>C8&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new Z0(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}},wA=class extends H{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){let o=new Fd;o.cancelAndSet(()=>this._checkStopModelSync(),Math.round(v8/2)),this._register(o)}}dispose(){for(let e in this._syncedModels)li(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(let i of e){let o=i.toString();this._syncedModels[o]||this._beginModelSync(i,t),this._syncedModels[o]&&(this._syncedModelsLastUsedTime[o]=new Date().getTime())}}_checkStopModelSync(){let e=new Date().getTime(),t=[];for(let i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>v8&&t.push(i);for(let i of t)this._stopModelSync(i)}_beginModelSync(e,t){let i=this._modelService.getModel(e);if(!i||!t&&i.isTooLargeForSyncing())return;let o=e.toString();this._proxy.acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});let s=new ae;s.add(i.onDidChangeContent(r=>{this._proxy.acceptModelChanged(o.toString(),r)})),s.add(i.onWillDispose(()=>{this._stopModelSync(o)})),s.add(be(()=>{this._proxy.acceptRemovedModel(o)})),this._syncedModels[o]=s}_stopModelSync(e){let t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],li(t)}},pS=class{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}},G0=class{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}},Z0=class extends H{constructor(e,t,i,o){super(),this.languageConfigurationService=o,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new T0(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new wy(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new G0(this)))}catch(e){I0(e),this._worker=new pS(new Pu(new G0(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(I0(e),this._worker=new pS(new Pu(new G0(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new wA(e,this._modelService,this._keepIdleModels))),this._modelManager}async _withSyncedResources(e,t=!1){return this._disposed?Promise.reject(L9()):this._getProxy().then(i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i))}computedUnicodeHighlights(e,t,i){return this._withSyncedResources([e]).then(o=>o.computeUnicodeHighlights(e.toString(),t,i))}computeDiff(e,t,i,o){return this._withSyncedResources([e,t],!0).then(s=>s.computeDiff(e.toString(),t.toString(),i,o))}computeMoreMinimalEdits(e,t,i){return this._withSyncedResources([e]).then(o=>o.computeMoreMinimalEdits(e.toString(),t,i))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(t=>t.computeDefaultDocumentColors(e.toString()))}async textualSuggest(e,t,i){let o=await this._withSyncedResources(e),s=i.source,r=i.flags;return o.textualSuggest(e.map(a=>a.toString()),t,s,r)}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{let o=this._modelService.getModel(e);if(!o)return Promise.resolve(null);let s=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),r=s.source,a=s.flags;return i.computeWordRanges(e.toString(),t,r,a)})}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then(o=>{let s=this._modelService.getModel(e);if(!s)return null;let r=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId()).getWordDefinition(),a=r.source,l=r.flags;return o.navigateValueSet(e.toString(),t,i,a,l)})}findSectionHeaders(e,t){return this._withSyncedResources([e]).then(i=>i.findSectionHeaders(e.toString(),t))}dispose(){super.dispose(),this._disposed=!0}};function w8(n,e,t){return new yA(n,e,t)}var yA=class extends Z0{constructor(e,t,i){super(e,i.keepIdleModels||!1,i.label,t),this._foreignModuleId=i.moduleId,this._foreignModuleCreateData=i.createData||null,this._foreignModuleHost=i.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(i){return Promise.reject(i)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{let t=this._foreignModuleHost?dg(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;let o=(a,l)=>e.fmr(a,l),s=(a,l)=>function(){let c=Array.prototype.slice.call(arguments,0);return l(a,c)},r={};for(let a of i)r[a]=s(a,o);return r})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}};_();v();b();var Rc={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};Yo();Hr();lr();Ma();Y0();hr();_u();_();v();b();ot();Yo();Pc();_();v();b();Ge();ot();xu();_();v();b();ot();var $r=class n{constructor(e,t,i,o){this.startColumn=e,this.endColumn=t,this.className=i,this.type=o,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){let i=e.length,o=t.length;if(i!==o)return!1;for(let s=0;s=s||(a[l++]=new n(Math.max(1,c.startColumn-o+1),Math.min(r+1,c.endColumn-o+1),c.className,c.type));return a}static filter(e,t,i,o){if(e.length===0)return[];let s=[],r=0;for(let a=0,l=e.length;at||d.isEmpty()&&(c.type===0||c.type===3))continue;let h=d.startLineNumber===t?d.startColumn:i,u=d.endLineNumber===t?d.endColumn:o;s[r++]=new n(h,u,c.inlineClassName,c.type)}return s}static _typeCompare(e,t){let i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;let i=n._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(o,0,e),this.classNames.splice(o,0,t),this.metadata.splice(o,0,i);break}this.count++}},vS=class{static normalize(e,t){if(t.length===0)return[];let i=[],o=new xA,s=0;for(let r=0,a=t.length;r1){let m=e.charCodeAt(c-2);pi(m)&&c--}if(d>1){let m=e.charCodeAt(d-2);pi(m)&&d--}let f=c-1,g=d-2;s=o.consumeLowerThan(f,s,i),o.count===0&&(s=f),o.insert(g,h,u)}return o.consumeLowerThan(1073741824,s,i),i}};_();v();b();var $i=class{constructor(e,t,i,o){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=o,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}};var fm=class{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}},qr=class{constructor(e,t,i,o,s,r,a,l,c,d,h,u,f,g,m,C,S,w,y){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=o,this.isBasicASCII=s,this.containsRTL=r,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort($r.compare),this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=u,this.stopRenderingLineAfter=m,this.renderWhitespace=C==="all"?4:C==="boundary"?1:C==="selection"?2:C==="trailing"?3:0,this.renderControlCharacters=S,this.fontLigatures=w,this.selectionsOnLine=y&&y.sort((T,N)=>T.startOffset>>16}static getCharIndex(e){return(e&65535)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,o){let s=(t<<16|i<<0)>>>0;this._data[e-1]=s,this._horizontalOffset[e-1]=o}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){let t=this.charOffsetToPartData(e-1),i=n.getPartIndex(t),o=n.getCharIndex(t);return new X0(i,o)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;let o=(e<<16|i<<0)>>>0,s=0,r=this.length-1;for(;s+1>>1,C=this._data[m];if(C===o)return m;C>o?r=m:s=m}if(s===r)return s;let a=this._data[s],l=this._data[r];if(a===o)return s;if(l===o)return r;let c=n.getPartIndex(a),d=n.getCharIndex(a),h=n.getPartIndex(l),u;c!==h?u=t:u=n.getCharIndex(l);let f=i-d,g=u-i;return f<=g?s:r}},J0=class{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}};function eb(n,e){if(n.lineContent.length===0){if(n.lineDecorations.length>0){e.appendString("");let t=0,i=0,o=0;for(let r of n.lineDecorations)(r.type===1||r.type===2)&&(e.appendString(''),r.type===1&&(o|=1,t++),r.type===2&&(o|=2,i++));e.appendString("");let s=new Q0(1,t+i);return s.setColumnInfo(1,t,0,0),new J0(s,!1,o)}return e.appendString(""),new J0(new Q0(0,0),!1,0)}return tG(Zj(n),e)}var LA=class{constructor(e,t,i,o){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=o}};function gm(n){let e=new Sl(1e4),t=eb(n,e);return new LA(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}var kA=class{constructor(e,t,i,o,s,r,a,l,c,d,h,u,f,g,m,C){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=o,this.isOverflowing=s,this.overflowingCharCount=r,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=c,this.tabSize=d,this.startVisibleColumn=h,this.containsRTL=u,this.spaceWidth=f,this.renderSpaceCharCode=g,this.renderWhitespace=m,this.renderControlCharacters=C}};function Zj(n){let e=n.lineContent,t,i,o;n.stopRenderingLineAfter!==-1&&n.stopRenderingLineAfter0){for(let a=0,l=n.lineDecorations.length;a0&&(s[r++]=new $i(i,"",0,!1));let a=i;for(let l=0,c=t.getCount();l=o){let f=e?Lc(n.substring(a,o)):!1;s[r++]=new $i(o,h,0,f);break}let u=e?Lc(n.substring(a,d)):!1;s[r++]=new $i(d,h,0,u),a=d}return s}function Xj(n,e,t){let i=0,o=[],s=0;if(t)for(let r=0,a=e.length;r=50&&(o[s++]=new $i(f+1,d,h,u),g=f+1,f=-1);g!==c&&(o[s++]=new $i(c,d,h,u))}else o[s++]=l;i=c}else for(let r=0,a=e.length;r50){let h=l.type,u=l.metadata,f=l.containsRTL,g=Math.ceil(d/50);for(let m=1;m=8234&&n<=8238||n>=8294&&n<=8297||n>=8206&&n<=8207||n===1564}function Qj(n,e){let t=[],i=new $i(0,"",0,!1),o=0;for(let s of e){let r=s.endIndex;for(;oi.endIndex&&(i=new $i(o,s.type,s.metadata,s.containsRTL),t.push(i)),i=new $i(o+1,"mtkcontrol",s.metadata,!1),t.push(i))}o>i.endIndex&&(i=new $i(r,s.type,s.metadata,s.containsRTL),t.push(i))}return t}function Jj(n,e,t,i){let o=n.continuesWithWrappedLine,s=n.fauxIndentLength,r=n.tabSize,a=n.startVisibleColumn,l=n.useMonospaceOptimizations,c=n.selectionsOnLine,d=n.renderWhitespace===1,h=n.renderWhitespace===3,u=n.renderSpaceWidth!==n.spaceWidth,f=[],g=0,m=0,C=i[m].type,S=i[m].containsRTL,w=i[m].endIndex,y=i.length,x=!1,k=Ri(e),T;k===-1?(x=!0,k=t,T=t):T=Os(e);let N=!1,M=0,W=c&&c[M],j=a%r;for(let V=s;V=W.endOffset&&(M++,W=c&&c[M]);let te;if(VT)te=!0;else if(z===9)te=!0;else if(z===32)if(d)if(N)te=!0;else{let ee=V+1V),te&&h&&(te=x||V>T),te&&S&&V>=k&&V<=T&&(te=!1),N){if(!te||!l&&j>=r){if(u){let ee=g>0?f[g-1].endIndex:s;for(let ce=ee+1;ce<=V;ce++)f[g++]=new $i(ce,"mtkw",1,!1)}else f[g++]=new $i(V,"mtkw",1,!1);j=j%r}}else(V===w||te&&V>s)&&(f[g++]=new $i(V,C,0,S),j=j%r);for(z===9?j=r:Ys(z)?j+=2:j++,N=te;V===w&&(m++,m0?e.charCodeAt(t-1):0,z=t>1?e.charCodeAt(t-2):0;V===32&&z!==32&&z!==9||(G=!0)}else G=!0;if(G)if(u){let V=g>0?f[g-1].endIndex:s;for(let z=V+1;z<=t;z++)f[g++]=new $i(z,"mtkw",1,!1)}else f[g++]=new $i(t,"mtkw",1,!1);else f[g++]=new $i(t,C,0,S);return f}function eG(n,e,t,i){i.sort($r.compare);let o=vS.normalize(n,i),s=o.length,r=0,a=[],l=0,c=0;for(let h=0,u=t.length;hc&&(c=w.startOffset,a[l++]=new $i(c,m,C,S)),w.endOffset+1<=g)c=w.endOffset+1,a[l++]=new $i(c,m+" "+w.className,C|w.metadata,S),r++;else{c=g,a[l++]=new $i(c,m+" "+w.className,C|w.metadata,S);break}}g>c&&(c=g,a[l++]=new $i(c,m,C,S))}let d=t[t.length-1].endIndex;if(r'):e.appendString("");for(let W=0,j=c.length;W=d&&(Pe+=Te)}}for(ce&&(e.appendString(' style="width:'),e.appendString(String(g*Se)),e.appendString('px"')),e.appendASCIICharCode(62);x1?e.appendCharCode(8594):e.appendCharCode(65515);for(let Te=2;Te<=Qe;Te++)e.appendCharCode(160)}else Pe=2,Qe=1,e.appendCharCode(m),e.appendCharCode(8204);T+=Pe,N+=Qe,x>=d&&(k+=Qe)}}else for(e.appendASCIICharCode(62);x=d&&(k+=Pe)}Ce?M++:M=0,x>=r&&!y&&G.isPseudoAfter()&&(y=!0,w.setColumnInfo(x+1,W,T,N)),e.appendString("")}return y||w.setColumnInfo(r+1,c.length-1,T,N),a&&(e.appendString(''),e.appendString(p("showMore","Show more ({0})",nG(l))),e.appendString("")),e.appendString(""),new J0(w,f,o)}function iG(n){return n.toString(16).toUpperCase().padStart(4,"0")}function nG(n){return n<1024?p("overflow.chars","{0} chars",n):n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/1024/1024).toFixed(1)} MB`}_();v();b();wt();ot();Ke();var tb=class{constructor(e,t,i,o){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=i|0,this.height=o|0}},CS=class{constructor(e,t){this.tabSize=e,this.data=t}},Bu=class{constructor(e,t,i,o,s,r,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=o,this.startVisibleColumn=s,this.tokens=r,this.inlineDecorations=a}},Wo=class n{constructor(e,t,i,o,s,r,a,l,c,d){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=o,this.isBasicASCII=n.isBasicASCII(i,r),this.containsRTL=n.containsRTL(i,this.isBasicASCII,s),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=d}static isBasicASCII(e,t){return t?Ig(e):!0}static containsRTL(e,t,i){return!t&&i?Lc(e):!1}},Oc=class{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}},wS=class{constructor(e,t,i,o){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=o}toInlineDecoration(e){return new Oc(new P(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}},mm=class{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}},Wu=class n{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.colort.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&Ht(e.data,t.data)}static equalsArr(e,t){return Ht(e,t,n.equals)}};_();v();b();le();Yo();Y0();_();v();b();function oG(n){return Array.isArray(n)}function x8(n){return!oG(n)}function DA(n){return typeof n=="string"}function EA(n){return!DA(n)}function th(n){return!n}function Pa(n,e){return n.ignoreCase&&e?e.toLowerCase():e}function IA(n){return n.replace(/[&<>'"_]/g,"-")}function L8(n,e){console.log(`${n.languageId}: ${e}`)}function Kt(n,e){return new Error(`${n.languageId}: ${e}`)}function Nl(n,e,t,i,o){let s=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g,r=null;return e.replace(s,function(a,l,c,d,h,u,f,g,m){return th(c)?th(d)?!th(h)&&h0;){let i=n.tokenizer[t];if(i)return i;let o=t.lastIndexOf(".");o<0?t=null:t=t.substr(0,o)}return null}function D8(n,e){let t=e;for(;t&&t.length>0;){if(n.stateNames[t])return!0;let o=t.lastIndexOf(".");o<0?t=null:t=t.substr(0,o)}return!1}Fo();var sG=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},rG=function(n,e){return function(t,i){e(t,i,n)}},TA,I8=5,zu=class{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new _m(e,t);let i=_m.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let o=this._entries[i];return o||(o=new _m(e,t),this._entries[i]=o,o)}};zu._INSTANCE=new zu(I8);var _m=class n{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}equals(e){return n._equals(this,e)}push(e){return zu.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return zu.create(this.parent,e)}},pm=class n{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new n(this.languageId,this.state)}},Al=class{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(t!==null)return new nb(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new nb(e,t);let i=_m.getStackElementId(e),o=this._entries[i];return o||(o=new nb(e,null),this._entries[i]=o,o)}};Al._INSTANCE=new Al(I8);var nb=class n{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:Al.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof n)||!this.stack.equals(e.stack)?!1:this.embeddedLanguageData===null&&e.embeddedLanguageData===null?!0:this.embeddedLanguageData===null||e.embeddedLanguageData===null?!1:this.embeddedLanguageData.equals(e.embeddedLanguageData)}},NA=class{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new xa(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,o){let s=i.languageId,r=i.state,a=Bt.get(s);if(!a)return this.enterLanguage(s),this.emit(o,""),r;let l=a.tokenize(e,t,r);if(o!==0)for(let c of l.tokens)this._tokens.push(new xa(c.offset+o,c.type,c.language));else this._tokens=this._tokens.concat(l.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,l.endState}finalize(e){return new Ad(this._tokens,e)}},AA=class n{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){let i=this._theme.match(this._currentLanguageId,t)|1024;this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){let o=e!==null?e.length:0,s=t.length,r=i!==null?i.length:0;if(o===0&&s===0&&r===0)return new Uint32Array(0);if(o===0&&s===0)return i;if(s===0&&r===0)return e;let a=new Uint32Array(o+s+r);e!==null&&a.set(e);for(let l=0;l{if(r)return;let l=!1;for(let c=0,d=a.changedLanguages.length;c{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){let e=[];for(let t in this._embeddedLanguages){let i=Bt.get(t);if(i){if(i instanceof TA){let o=i.getLoadStatus();o.loaded===!1&&e.push(o.promise)}continue}Bt.isResolved(t)||e.push(Bt.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){let e=zu.create(null,this._lexer.start);return Al.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return _S(this._languageId,i);let o=new NA,s=this._tokenize(e,t,i,o);return o.finalize(s)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return hm(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);let o=new AA(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),s=this._tokenize(e,t,i,o);return o.finalize(s)}_tokenize(e,t,i,o){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,o):this._myTokenize(e,t,i,0,o)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=ib(this._lexer,t.stack.state),!i))throw Kt(this._lexer,"tokenizer state is not defined: "+t.stack.state);let o=-1,s=!1;for(let r of i){if(!EA(r.action)||r.action.nextEmbedded!=="@pop")continue;s=!0;let a=r.resolveRegex(t.stack.state),l=a.source;if(l.substr(0,4)==="^(?:"&&l.substr(l.length-1,1)===")"){let d=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(l.substr(4,l.length-5),d)}let c=e.search(a);c===-1||c!==0&&r.matchOnlyAtLineStart||(o===-1||c0&&s.nestedLanguageTokenize(a,!1,i.embeddedLanguageData,o);let l=e.substring(r);return this._myTokenize(l,t,i,o+r,s)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,o,s){s.enterLanguage(this._languageId);let r=e.length,a=t&&this._lexer.includeLF?e+` +`:e,l=a.length,c=i.embeddedLanguageData,d=i.stack,h=0,u=null,f=!0;for(;f||h=l)break;f=!1;let W=this._lexer.tokenizer[S];if(!W&&(W=ib(this._lexer,S),!W))throw Kt(this._lexer,"tokenizer state is not defined: "+S);let j=a.substr(h);for(let G of W)if((h===0||!G.matchOnlyAtLineStart)&&(w=j.match(G.resolveRegex(S)),w)){y=w[0],x=G.action;break}}if(w||(w=[""],y=""),x||(h=this._lexer.maxStack)throw Kt(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(S)}else if(x.next==="@pop"){if(d.depth<=1)throw Kt(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(k));d=d.pop()}else if(x.next==="@popall")d=d.popall();else{let W=Nl(this._lexer,x.next,y,w,S);if(W[0]==="@"&&(W=W.substr(1)),ib(this._lexer,W))d=d.push(W);else throw Kt(this._lexer,"trying to set a next state '"+W+"' that is undefined in rule: "+this._safeRuleName(k))}}x.log&&typeof x.log=="string"&&L8(this._lexer,this._lexer.languageId+": "+Nl(this._lexer,x.log,y,w,S))}if(N===null)throw Kt(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(k));let M=W=>{let j=this._languageService.getLanguageIdByLanguageName(W)||this._languageService.getLanguageIdByMimeType(W)||W,G=this._getNestedEmbeddedLanguageData(j);if(h0)throw Kt(this._lexer,"groups cannot be nested: "+this._safeRuleName(k));if(w.length!==N.length+1)throw Kt(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(k));let W=0;for(let j=1;jn}),bm=class{static colorizeElement(e,t,i,o){o=o||{};let s=o.theme||"vs",r=o.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!r)return console.error("Mode not detected"),Promise.resolve();let a=t.getLanguageIdByMimeType(r)||r;e.setTheme(s);let l=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+s;let c=d=>{var h;let u=(h=MA?.createHTML(d))!==null&&h!==void 0?h:d;i.innerHTML=u};return this.colorize(t,l||"",a,o).then(c,d=>console.error(d))}static async colorize(e,t,i,o){let s=e.languageIdCodec,r=4;o&&typeof o.tabSize=="number"&&(r=o.tabSize),Tg(t)&&(t=t.substr(1));let a=Tr(t);if(!e.isRegisteredLanguageId(i))return T8(a,r,s);let l=await Bt.getOrCreate(i);return l?lG(a,r,l,s):T8(a,r,s)}static colorizeLine(e,t,i,o,s=4){let r=Wo.isBasicASCII(e,t),a=Wo.containsRTL(e,r,i);return gm(new qr(!1,!0,e,!1,r,a,0,o,[],s,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){let o=e.getLineContent(t);e.tokenization.forceTokenization(t);let r=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(o,e.mightContainNonBasicASCII(),e.mightContainRTL(),r,i)}};function lG(n,e,t,i){return new Promise((o,s)=>{let r=()=>{let a=cG(n,e,t,i);if(t instanceof Vu){let l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(r,s);return}}o(a)};r()})}function T8(n,e,t){let i=[],s=new Uint32Array(2);s[0]=0,s[1]=33587200;for(let r=0,a=n.length;r")}return i.join("")}function cG(n,e,t,i){let o=[],s=t.getInitialState();for(let r=0,a=n.length;r"),s=c.endState}return o.join("")}_();v();b();_();v();b();ke();var N8=2e4,Hu,yS,RA,SS,PA;function A8(n){Hu=document.createElement("div"),Hu.className="monaco-aria-container";let e=()=>{let i=document.createElement("div");return i.className="monaco-alert",i.setAttribute("role","alert"),i.setAttribute("aria-atomic","true"),Hu.appendChild(i),i};yS=e(),RA=e();let t=()=>{let i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),Hu.appendChild(i),i};SS=t(),PA=t(),n.appendChild(Hu)}function ob(n){Hu&&(yS.textContent!==n?(Co(RA),xS(yS,n)):(Co(yS),xS(RA,n)))}function Uu(n){Hu&&(SS.textContent!==n?(Co(PA),xS(SS,n)):(Co(SS),xS(PA,n)))}function xS(n,e){Co(n),e.length>N8&&(e=e.substr(0,N8)),n.textContent=e,n.style.visibility="hidden",n.style.visibility="visible"}le();Or();_();v();b();_();v();b();_();v();b();qe();var LS=De("markerDecorationsService");Ud();var dG=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},hG=function(n,e){return function(t,i){e(t,i,n)}},sb=class{constructor(e,t){}dispose(){}};sb.ID="editor.contrib.markerDecorations";sb=dG([hG(1,LS)],sb);vy(sb.ID,sb,0);ke();xt();ye();le();er();_();v();b();ps();wt();ye();le();hs();Lt();OA();_();v();b();var Cm=class n{constructor(e,t){this.key=e,this.migrate=t}apply(e){let t=n._read(e,this.key),i=s=>n._read(e,s),o=(s,r)=>n._write(e,s,r);this.migrate(t,i,o)}static _read(e,t){if(typeof e>"u")return;let i=t.indexOf(".");if(i>=0){let o=t.substring(0,i);return this._read(e[o],t.substring(i+1))}return e[t]}static _write(e,t,i){let o=t.indexOf(".");if(o>=0){let s=t.substring(0,o);e[s]=e[s]||{},this._write(e[s],t.substring(o+1),i);return}e[t]=i}};Cm.items=[];function Oa(n,e){Cm.items.push(new Cm(n,e))}function ys(n,e){Oa(n,(t,i,o)=>{if(typeof t<"u"){for(let[s,r]of e)if(t===s){o(n,r);return}}})}function R8(n){Cm.items.forEach(e=>e.apply(n))}ys("wordWrap",[[!0,"on"],[!1,"off"]]);ys("lineNumbers",[[!0,"on"],[!1,"off"]]);ys("cursorBlinking",[["visible","solid"]]);ys("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);ys("renderLineHighlight",[[!0,"line"],[!1,"none"]]);ys("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);ys("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);ys("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);ys("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);ys("autoIndent",[[!1,"advanced"],[!0,"full"]]);ys("matchBrackets",[[!0,"always"],[!1,"never"]]);ys("renderFinalNewline",[[!0,"on"],[!1,"off"]]);ys("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);ys("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]);ys("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]);Oa("autoClosingBrackets",(n,e,t)=>{n===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});Oa("renderIndentGuides",(n,e,t)=>{typeof n<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!n))});Oa("highlightActiveIndentGuide",(n,e,t)=>{typeof n<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!n))});var uG={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};Oa("suggest.filteredTypes",(n,e,t)=>{if(n&&typeof n=="object"){for(let i of Object.entries(uG))n[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});Oa("quickSuggestions",(n,e,t)=>{if(typeof n=="boolean"){let i=n?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});Oa("experimental.stickyScroll.enabled",(n,e,t)=>{typeof n=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",n))});Oa("experimental.stickyScroll.maxLineCount",(n,e,t)=>{typeof n=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",n))});Oa("codeActionsOnSave",(n,e,t)=>{if(n&&typeof n=="object"){let i=!1,o={};for(let s of Object.entries(n))typeof s[1]=="boolean"?(i=!0,o[s[0]]=s[1]?"explicit":"never"):o[s[0]]=s[1];i&&t("codeActionsOnSave",o)}});Oa("codeActionWidget.includeNearbyQuickfixes",(n,e,t)=>{typeof n=="boolean"&&(t("codeActionWidget.includeNearbyQuickfixes",void 0),typeof e("codeActionWidget.includeNearbyQuickFixes")>"u"&&t("codeActionWidget.includeNearbyQuickFixes",n))});Oa("lightbulb.enabled",(n,e,t)=>{typeof n=="boolean"&&t("lightbulb.enabled",n?void 0:"off")});_();v();b();ye();var FA=class{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new B,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}},wm=new FA;_();v();b();Oi();qe();var ao=De("accessibilityService"),P8=new xe("accessibilityModeEnabled",!1);ke();var fG=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},gG=function(n,e){return function(t,i){e(t,i,n)}},kS=class extends H{constructor(e,t,i,o,s){super(),this._accessibilityService=s,this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new B),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new A_,this.isSimpleWidget=e,this.contextMenuId=t,this._containerObserver=this._register(new vm(o,i.dimension)),this._targetWindowId=ge(o).vscodeWindowId,this._rawOptions=O8(i),this._validatedOptions=Ku.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(Rr.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(wm.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(C0.onDidChange(()=>this._recomputeOptions())),this._register(Kg.getInstance(ge(o)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){let e=this._computeOptions(),t=Ku.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){let e=this._readEnvConfiguration(),t=mu.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),o={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:wm.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return Ku.computeOptions(this._validatedOptions,o)}_readEnvConfiguration(){return{extraEditorClassName:pG(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:La||wn,pixelRatio:Kg.getInstance(QT(this._targetWindowId,!0).window).value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return C0.readFontInfo(QT(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){let t=O8(e);Ku.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=Ku.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){let t=mG(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};kS=fG([gG(4,ao)],kS);function mG(n){let e=0;for(;n;)n=Math.floor(n/10),e++;return e||1}function pG(){let n="";return!ms&&!yw&&(n+="no-user-select "),ms&&(n+="no-minimap-shadow ",n+="enable-user-select "),Be&&(n+="mac "),n}var BA=class{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}},WA=class{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}},Ku=class n{static validateOptions(e){let t=new BA;for(let i of wd){let o=i.name==="_never_"?void 0:e[i.name];t._write(i.id,i.validate(o))}return t}static computeOptions(e,t){let i=new WA;for(let o of wd)i._write(o.id,o.compute(t,i,e._read(o.id)));return i}static _deepEquals(e,t){if(typeof e!="object"||typeof t!="object"||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)?Ht(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let i in e)if(!n._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){let i=[],o=!1;for(let s of wd){let r=!n._deepEquals(e._read(s.id),t._read(s.id));i[s.id]=r,r&&(o=!0)}return o?new mg(i):null}static applyUpdate(e,t){let i=!1;for(let o of wd)if(t.hasOwnProperty(o.name)){let s=o.applyUpdate(e[o.name],t[o.name]);e[o.name]=s.newValue,i=i||s.didChange}return i}};function O8(n){let e=cl(n);return R8(e),e}Ud();Or();_();v();b();ke();_();v();b();var Ml;(function(n){let e={total:0,min:Number.MAX_VALUE,max:0},t={...e},i={...e},o={...e},s=0,r={keydown:0,input:0,render:0};function a(){S(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),r.keydown=1,queueMicrotask(l)}n.onKeyDown=a;function l(){r.keydown===1&&(performance.mark("keydown/end"),r.keydown=2)}function c(){performance.mark("input/start"),r.input=1,C()}n.onBeforeInput=c;function d(){r.input===0&&c(),queueMicrotask(h)}n.onInput=d;function h(){r.input===1&&(performance.mark("input/end"),r.input=2)}function u(){S()}n.onKeyUp=u;function f(){S()}n.onSelectionChange=f;function g(){r.keydown===2&&r.input===2&&r.render===0&&(performance.mark("render/start"),r.render=1,queueMicrotask(m),C())}n.onRenderStart=g;function m(){r.render===1&&(performance.mark("render/end"),r.render=2)}function C(){setTimeout(S)}function S(){r.keydown===2&&r.input===2&&r.render===2&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),w("keydown",e),w("input",t),w("render",i),w("inputlatency",o),s++,y())}function w(N,M){let W=performance.getEntriesByName(N)[0].duration;M.total+=W,M.min=Math.min(M.min,W),M.max=Math.max(M.max,W)}function y(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),r.keydown=0,r.input=0,r.render=0}function x(){if(s===0)return;let N={keydown:k(e),input:k(t),render:k(i),total:k(o),sampleCount:s};return T(e),T(t),T(i),T(o),s=0,N}n.getAndClearMeasurements=x;function k(N){return{average:N.total/s,max:N.max,min:N.min}}function T(N){N.total=0,N.min=Number.MAX_VALUE,N.max=0}})(Ml||(Ml={}));xt();_();v();b();_();v();b();ke();_();v();b();ke();le();var Rl=class{constructor(){this._hooks=new ae,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,o,s){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=o,this._onStopCallback=s;let r=e;try{e.setPointerCapture(t),this._hooks.add(be(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{r=ge(e)}this._hooks.add($(r,se.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add($(r,se.POINTER_UP,a=>this.stopMonitoring(!0)))}};Qs();Gt();le();is();var lh=class{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new db(this.x-e.scrollX,this.y-e.scrollY)}},db=class{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new lh(this.clientX+e.scrollX,this.clientY+e.scrollY)}},JA=class{constructor(e,t,i,o){this.x=e,this.y=t,this.width=i,this.height=o,this._editorPagePositionBrand=void 0}},eM=class{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}};function VS(n){let e=Sn(n);return new JA(e.left,e.top,e.width,e.height)}function HS(n,e,t){let i=e.width/n.offsetWidth,o=e.height/n.offsetHeight,s=(t.x-e.x)/i,r=(t.y-e.y)/o;return new eM(s,r)}var Xr=class extends yn{constructor(e,t,i){super(ge(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new lh(this.posx,this.posy),this.editorPos=VS(i),this.relativePos=HS(i,this.editorPos,this.pos)}},BS=class{constructor(e){this._editorViewDomNode=e}_create(e){return new Xr(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return $(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return $(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return $(e,se.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return $(e,se.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return $(e,se.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return $(e,"mousemove",i=>t(this._create(i)))}},WS=class{constructor(e){this._editorViewDomNode=e}_create(e){return new Xr(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return $(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return $(e,se.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return $(e,se.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return $(e,"pointermove",i=>t(this._create(i)))}},zS=class extends H{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new Rl),this._keydownListener=null}startMonitoring(e,t,i,o,s){this._keydownListener=Ut(e.ownerDocument,"keydown",r=>{r.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,r.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,r=>{o(new Xr(r,!0,this._editorViewDomNode))},r=>{this._keydownListener.dispose(),s(r)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}},tM=class n{constructor(e){this._editor=e,this._instanceId=++n._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new di(()=>this.garbageCollect(),1e3)}createClassNameRef(e){let t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){let t=this.computeUniqueKey(e),i=this._rules.get(t);if(!i){let o=this._counter++;i=new iM(t,`dyn-rule-${this._instanceId}-${o}`,gu(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(let e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}};tM._idPool=0;var iM=class{constructor(e,t,i,o){this.key=e,this.className=t,this.properties=o,this._referenceCount=0,this._styleElementDisposables=new ae,this._styleElement=Xi(i,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(let o in t){let s=t[o],r;typeof s=="object"?r=he(s.id):r=s;let a=bG(o);i+=` + ${a}: ${r};`}return i+=` +}`,i}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}};function bG(n){return n.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}_();v();b();_();v();b();le();var Qr=class extends H{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,o=e.length;i=a.left?o.width=Math.max(o.width,a.left+a.width-o.left):(t[i++]=o,o=a)}return t[i++]=o,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||e.length===0)return null;let o=[];for(let s=0,r=e.length;sl)return null;if(t=Math.min(l,Math.max(0,t)),o=Math.min(l,Math.max(0,o)),t===o&&i===s&&i===0&&!e.children[t].firstChild){let u=e.children[t].getClientRects();return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(u,r.clientRectDeltaLeft,r.clientRectScale)}t!==o&&o>0&&s===0&&(o--,s=1073741824);let c=e.children[t].firstChild,d=e.children[o].firstChild;if((!c||!d)&&(!c&&i===0&&t>0&&(c=e.children[t-1].firstChild,i=1073741824),!d&&s===0&&o>0&&(d=e.children[o-1].firstChild,s=1073741824)),!c||!d)return null;i=Math.min(c.textContent.length,Math.max(0,i)),s=Math.min(d.textContent.length,Math.max(0,s));let h=this._readClientRects(c,i,d,s,r.endNode);return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,r.clientRectDeltaLeft,r.clientRectScale)}};ch();var vG=function(){return md?!0:!(mi||wn||ms)}(),Fm=!0,ub=class{constructor(e,t){this.themeType=t;let i=e.options,o=i.get(50);i.get(38)==="off"?this.renderWhitespace=i.get(99):this.renderWhitespace="none",this.renderControlCharacters=i.get(94),this.spaceWidth=o.spaceWidth,this.middotWidth=o.middotWidth,this.wsmiddotWidth=o.wsmiddotWidth,this.useMonospaceOptimizations=o.isMonospace&&!i.get(33),this.canUseHalfwidthRightwardsArrow=o.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(67),this.stopRenderingLineAfter=i.get(117),this.fontLigatures=i.get(51)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}},Jr=class n{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=$e(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return Ol(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,o,s){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;let r=o.getViewLineRenderingData(e),a=this._options,l=$r.filter(r.inlineDecorations,e,r.minColumn,r.maxColumn),c=null;if(Ol(a.themeType)||this._options.renderWhitespace==="selection"){let f=o.selections;for(let g of f){if(g.endLineNumbere)continue;let m=g.startLineNumber===e?g.startColumn:r.minColumn,C=g.endLineNumber===e?g.endColumn:r.maxColumn;m');let h=eb(d,s);s.appendString("");let u=null;return Fm&&vG&&r.isBasicASCII&&a.useMonospaceOptimizations&&h.containsForeignElements===0&&(u=new Om(this._renderedViewLine?this._renderedViewLine.domNode:null,d,h.characterMapping)),u||(u=S6(this._renderedViewLine?this._renderedViewLine.domNode:null,d,h.characterMapping,h.containsRTL,h.containsForeignElements)),this._renderedViewLine=u,!0}layoutLine(e,t,i){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(i))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof Om:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof Om?this._renderedViewLine.monospaceAssumptionsAreValid():Fm}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof Om&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,o){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));let s=this._renderedViewLine.input.stopRenderingLineAfter;if(s!==-1&&t>s+1&&i>s+1)return new hb(!0,[new Ua(this.getWidth(o),0)]);s!==-1&&t>s+1&&(t=s+1),s!==-1&&i>s+1&&(i=s+1);let r=this._renderedViewLine.getVisibleRangesForRange(e,t,i,o);return r&&r.length>0?new hb(!1,r):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}};Jr.CLASS_NAME="view-line";var Om=class{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;let o=Math.floor(t.lineContent.length/300);if(o>0){this._keyColumnPixelOffsetCache=new Float32Array(o);for(let s=0;s=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),Fm=!1)}return Fm}toSlowRenderedLine(){return S6(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,o){let s=this._getColumnPixelOffset(e,t,o),r=this._getColumnPixelOffset(e,i,o);return[new Ua(s,r-s)]}_getColumnPixelOffset(e,t,i){if(t<=300){let c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}let o=Math.floor((t-1)/300)-1,s=(o+1)*300+1,r=-1;if(this._keyColumnPixelOffsetCache&&(r=this._keyColumnPixelOffsetCache[o],r===-1&&(r=this._actualReadPixelOffset(e,s,i),this._keyColumnPixelOffsetCache[o]=r)),r===-1){let c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}let a=this._characterMapping.getHorizontalOffset(s),l=this._characterMapping.getHorizontalOffset(t);return r+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;let o=this._characterMapping.getDomPosition(t),s=Xu.readHorizontalRanges(this._getReadingTarget(this.domNode),o.partIndex,o.charIndex,o.partIndex,o.charIndex,i);return!s||s.length===0?-1:s[0].left}getColumnOfNodeOffset(e,t){return x6(this._characterMapping,e,t)}},qS=class{constructor(e,t,i,o,s){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=s,this._cachedWidth=-1,this._pixelOffsetCache=null,!o||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let r=0,a=this._characterMapping.length;r<=a;r++)this._pixelOffsetCache[r]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e?.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,i,o){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){let s=this._readPixelOffset(this.domNode,e,t,o);if(s===-1)return null;let r=this._readPixelOffset(this.domNode,e,i,o);return r===-1?null:[new Ua(s,r-s)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,o)}_readVisibleRangesForRange(e,t,i,o,s){if(i===o){let r=this._readPixelOffset(e,t,i,s);return r===-1?null:[new Ua(r,0)]}else return this._readRawVisibleRangesForRange(e,i,o,s)}_readPixelOffset(e,t,i,o){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(o);let s=this._getReadingTarget(e);return s.firstChild?(o.markDidDomLayout(),s.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){let s=this._pixelOffsetCache[i];if(s!==-1)return s;let r=this._actualReadPixelOffset(e,t,i,o);return this._pixelOffsetCache[i]=r,r}return this._actualReadPixelOffset(e,t,i,o)}_actualReadPixelOffset(e,t,i,o){if(this._characterMapping.length===0){let l=Xu.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,o);return!l||l.length===0?-1:l[0].left}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(o);let s=this._characterMapping.getDomPosition(i),r=Xu.readHorizontalRanges(this._getReadingTarget(e),s.partIndex,s.charIndex,s.partIndex,s.charIndex,o);if(!r||r.length===0)return-1;let a=r[0].left;if(this.input.isBasicASCII){let l=this._characterMapping.getHorizontalOffset(i),c=Math.round(this.input.spaceWidth*l);if(Math.abs(c-a)<=1)return c}return a}_readRawVisibleRangesForRange(e,t,i,o){if(t===1&&i===this._characterMapping.length)return[new Ua(0,this.getWidth(o))];let s=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return Xu.readHorizontalRanges(this._getReadingTarget(e),s.partIndex,s.charIndex,r.partIndex,r.charIndex,o)}getColumnOfNodeOffset(e,t){return x6(this._characterMapping,e,t)}},oM=class extends qS{_readVisibleRangesForRange(e,t,i,o,s){let r=super._readVisibleRangesForRange(e,t,i,o,s);if(!r||r.length===0||i===o||i===1&&o===this._characterMapping.length)return r;if(!this.input.containsRTL){let a=this._readPixelOffset(e,t,o,s);if(a!==-1){let l=r[r.length-1];l.left=4&&e[0]===3&&e[3]===8}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===8}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===6}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===9}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===3}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&e[0]===5}},Bm=class n{constructor(e,t,i){this.viewModel=e.viewModel;let o=e.configuration.options;this.layoutInfo=o.get(145),this.viewDomNode=t.viewDomNode,this.lineHeight=o.get(67),this.stickyTabStops=o.get(116),this.typicalHalfwidthCharacterWidth=o.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return n.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){let i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){let o=i.verticalOffset+i.height/2,s=e.viewModel.getLineCount(),r=null,a,l=null;return i.afterLineNumber!==s&&(l=new U(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new U(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),l===null?a=r:r===null?a=l:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,Wm._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}},aM=class extends rM{get target(){return this._useHitTestTarget?this.hitTestResult.value.hitTarget:this._eventTarget}get targetPath(){return this._targetPathCacheElement!==this.target&&(this._targetPathCacheElement=this.target,this._targetPathCacheValue=Mn.collect(this.target,this._ctx.viewDomNode)),this._targetPathCacheValue}constructor(e,t,i,o,s){super(e,t,i,o),this.hitTestResult=new qn(()=>Wm.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array(0),this._ctx=e,this._eventTarget=s;let r=!!this._eventTarget;this._useHitTestTarget=!r}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset} + target: ${this.target?this.target.outerHTML:null}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&this.hitTestResult.value.hitTarget!==null&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.columnr.contentLeft+r.width)continue;let a=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(a<=s&&s<=a+r.height)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){let i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){let o=t.isInContentArea?8:5;return t.fulfillViewZone(o,i.position,i)}return null}static _hitTestTextArea(e,t){return lo.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){let i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),o=i.range.getStartPosition(),s=Math.abs(t.relativePos.x),r={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:s};if(s-=e.layoutInfo.glyphMarginLeft,s<=e.layoutInfo.glyphMarginWidth){let a=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(i.range.getStartPosition()),l=e.viewModel.glyphLanes.getLanesAtLine(a.lineNumber);return r.glyphMarginLane=l[Math.floor(s/e.lineHeight)],t.fulfillMargin(2,o,i.range,r)}return s-=e.layoutInfo.glyphMarginWidth,s<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,o,i.range,r):(s-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,o,i.range,r))}return null}static _hitTestViewLines(e,t){if(!lo.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new U(1,1),L6);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){let o=e.viewModel.getLineCount(),s=e.viewModel.getLineMaxColumn(o);return t.fulfillContentEmpty(new U(o,s),L6)}if(lo.isStrictChildOfViewLines(t.targetPath)){let o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(o)===0){let r=e.getLineWidth(o),a=sM(t.mouseContentHorizontalOffset-r);return t.fulfillContentEmpty(new U(o,1),a)}let s=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>=s){let r=sM(t.mouseContentHorizontalOffset-s),a=new U(o,e.viewModel.getLineMaxColumn(o));return t.fulfillContentEmpty(a,r)}}let i=t.hitTestResult.value;return i.type===1?n.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):t.wouldBenefitFromHitTestTargetSwitch?(t.switchToHitTestTarget(),this._createMouseTarget(e,t)):t.fulfillUnknown()}static _hitTestMinimap(e,t){if(lo.isChildOfMinimap(t.targetPath)){let i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new U(i,o))}return null}static _hitTestScrollbarSlider(e,t){if(lo.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){let i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){let o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(o);return t.fulfillScrollbar(new U(o,s))}}return null}static _hitTestScrollbar(e,t){if(lo.isChildOfScrollableElement(t.targetPath)){let i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new U(i,o))}return null}getMouseColumn(e){let t=this._context.configuration.options,i=t.get(145),o=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return n._getMouseColumn(o,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,o,s){let r=o.lineNumber,a=o.column,l=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>l){let S=sM(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(o,S)}let c=e.visibleRangeForPosition(r,a);if(!c)return t.fulfillUnknown(o);let d=c.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(o,null,{mightBeForeignElement:!!s,injectedText:s});let h=[];if(h.push({offset:c.left,column:a}),a>1){let S=e.visibleRangeForPosition(r,a-1);S&&h.push({offset:S.left,column:a-1})}let u=e.viewModel.getLineMaxColumn(r);if(aS.offset-w.offset);let f=t.pos.toClientCoordinates(ge(e.viewDomNode)),g=i.getBoundingClientRect(),m=g.left<=f.clientX&&f.clientX<=g.right,C=null;for(let S=1;Ss)){let a=Math.floor((o+s)/2),l=t.pos.y+(a-t.mouseVerticalOffset);l<=t.editorPos.y&&(l=t.editorPos.y+1),l>=t.editorPos.y+t.editorPos.height&&(l=t.editorPos.y+t.editorPos.height-1);let c=new lh(t.pos.x,l),d=this._actualDoHitTestWithCaretRangeFromPoint(e,c.toClientCoordinates(ge(e.viewDomNode)));if(d.type===1)return d}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(ge(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){let i=Ec(e.viewDomNode),o;if(i?typeof i.caretRangeFromPoint>"u"?o=yG(i,t.clientX,t.clientY):o=i.caretRangeFromPoint(t.clientX,t.clientY):o=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!o||!o.startContainer)return new Fl;let s=o.startContainer;if(s.nodeType===s.TEXT_NODE){let r=s.parentNode,a=r?r.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===Jr.CLASS_NAME?ef.createFromDOMInfo(e,r,o.startOffset):new Fl(s.parentNode)}else if(s.nodeType===s.ELEMENT_NODE){let r=s.parentNode,a=r?r.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===Jr.CLASS_NAME?ef.createFromDOMInfo(e,s,s.textContent.length):new Fl(s)}return new Fl}static _doHitTestWithCaretPositionFromPoint(e,t){let i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){let o=i.offsetNode.parentNode,s=o?o.parentNode:null,r=s?s.parentNode:null;return(r&&r.nodeType===r.ELEMENT_NODE?r.className:null)===Jr.CLASS_NAME?ef.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new Fl(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){let o=i.offsetNode.parentNode,s=o&&o.nodeType===o.ELEMENT_NODE?o.className:null,r=o?o.parentNode:null,a=r&&r.nodeType===r.ELEMENT_NODE?r.className:null;if(s===Jr.CLASS_NAME){let l=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(l)return ef.createFromDOMInfo(e,l,0)}else if(a===Jr.CLASS_NAME)return ef.createFromDOMInfo(e,i.offsetNode,0)}return new Fl(i.offsetNode)}static _snapToSoftTabBoundary(e,t){let i=t.getLineContent(e.lineNumber),{tabSize:o}=t.model.getOptions(),s=Ju.atomicPosition(i,e.column-1,o,2);return s!==-1?new U(e.lineNumber,s+1):e}static doHitTest(e,t){let i=new Fl;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(ge(e.viewDomNode)))),i.type===1){let o=e.viewModel.getInjectedTextAt(i.position),s=e.viewModel.normalizePosition(i.position,2);(o||!s.equals(i.position))&&(i=new jS(s,i.spanNode,o))}return i}};function yG(n,e,t){let i=document.createRange(),o=n.elementFromPoint(e,t);if(o!==null){for(;o&&o.firstChild&&o.firstChild.nodeType!==o.firstChild.TEXT_NODE&&o.lastChild&&o.lastChild.firstChild;)o=o.lastChild;let s=o.getBoundingClientRect(),r=ge(o),a=r.getComputedStyle(o,null).getPropertyValue("font-style"),l=r.getComputedStyle(o,null).getPropertyValue("font-variant"),c=r.getComputedStyle(o,null).getPropertyValue("font-weight"),d=r.getComputedStyle(o,null).getPropertyValue("font-size"),h=r.getComputedStyle(o,null).getPropertyValue("line-height"),u=r.getComputedStyle(o,null).getPropertyValue("font-family"),f=`${a} ${l} ${c} ${d}/${h} ${u}`,g=o.innerText,m=s.left,C=0,S;if(e>s.left+s.width)C=g.length;else{let w=ZS.getInstance();for(let y=0;y=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},It;(function(n){n.Tap="-monaco-gesturetap",n.Change="-monaco-gesturechange",n.Start="-monaco-gesturestart",n.End="-monaco-gesturesend",n.Contextmenu="-monaco-gesturecontextmenu"})(It||(It={}));var ui=class n extends H{constructor(){super(),this.dispatched=!1,this.targets=new Ii,this.ignoreTargets=new Ii,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(ie.runAndSubscribe(fu,({window:e,disposables:t})=>{t.add($(e.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),t.add($(e.document,"touchend",i=>this.onTouchEnd(e,i))),t.add($(e.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:gt,disposables:this._store}))}static addTarget(e){if(!n.isTouchDevice())return H.None;n.INSTANCE||(n.INSTANCE=Ld(new n));let t=n.INSTANCE.targets.push(e);return be(t)}static ignoreTarget(e){if(!n.isTouchDevice())return H.None;n.INSTANCE||(n.INSTANCE=Ld(new n));let t=n.INSTANCE.ignoreTargets.push(e);return be(t)}static isTouchDevice(){return"ontouchstart"in gt||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,o=e.targetTouches.length;i=n.HOLD_DELAY&&Math.abs(l.initialPageX-As(l.rollingPageX))<30&&Math.abs(l.initialPageY-As(l.rollingPageY))<30){let d=this.newGestureEvent(It.Contextmenu,l.initialTarget);d.pageX=As(l.rollingPageX),d.pageY=As(l.rollingPageY),this.dispatchEvent(d)}else if(o===1){let d=As(l.rollingPageX),h=As(l.rollingPageY),u=As(l.rollingTimestamps)-l.rollingTimestamps[0],f=d-l.rollingPageX[0],g=h-l.rollingPageY[0],m=[...this.targets].filter(C=>l.initialTarget instanceof Node&&C.contains(l.initialTarget));this.inertia(e,m,i,Math.abs(f)/u,f>0?1:-1,d,Math.abs(g)/u,g>0?1:-1,h)}this.dispatchEvent(this.newGestureEvent(It.End,l.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){let i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===It.Tap){let t=new Date().getTime(),i=0;t-this._lastSetTapCountTime>n.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===It.Change||e.type===It.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(let i of this.ignoreTargets)if(i.contains(e.initialTarget))return;let t=[];for(let i of this.targets)if(i.contains(e.initialTarget)){let o=0,s=e.initialTarget;for(;s&&s!==i;)o++,s=s.parentElement;t.push([o,i])}t.sort((i,o)=>i[0]-o[0]);for(let[i,o]of t)o.dispatchEvent(e),this.dispatched=!0}}inertia(e,t,i,o,s,r,a,l,c){this.handle=rn(e,()=>{let d=Date.now(),h=d-i,u=0,f=0,g=!0;o+=n.SCROLL_FRICTION*h,a+=n.SCROLL_FRICTION*h,o>0&&(g=!1,u=s*o*h),a>0&&(g=!1,f=l*a*h);let m=this.newGestureEvent(It.Change);m.translationX=u,m.translationY=f,t.forEach(C=>C.dispatchEvent(m)),g||this.inertia(e,t,d,o,s,r+u,a,l,c+f)})}onTouchMove(e){let t=Date.now();for(let i=0,o=e.changedTouches.length;i3&&(r.rollingPageX.shift(),r.rollingPageY.shift(),r.rollingTimestamps.shift()),r.rollingPageX.push(s.pageX),r.rollingPageY.push(s.pageY),r.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};ui.SCROLL_FRICTION=-.005;ui.HOLD_DELAY=700;ui.CLEAR_TAP_COUNT_TIME=400;SG([Yt],ui,"isTouchDevice",null);vo();le();Lt();_();v();b();ke();Qs();le();Lt();ft();Kn();_();v();b();ps();ke();Qs();_();v();b();Qs();_();v();b();ke();_();v();b();_();v();b();ke();oo();Qs();le();var co=class extends H{onclick(e,t){this._register($(e,se.CLICK,i=>t(new yn(ge(e),i))))}onmousedown(e,t){this._register($(e,se.MOUSE_DOWN,i=>t(new yn(ge(e),i))))}onmouseover(e,t){this._register($(e,se.MOUSE_OVER,i=>t(new yn(ge(e),i))))}onmouseleave(e,t){this._register($(e,se.MOUSE_LEAVE,i=>t(new yn(ge(e),i))))}onkeydown(e,t){this._register($(e,se.KEY_DOWN,i=>t(new bt(i))))}onkeyup(e,t){this._register($(e,se.KEY_UP,i=>t(new bt(i))))}oninput(e,t){this._register($(e,se.INPUT,t))}onblur(e,t){this._register($(e,se.BLUR,t))}onfocus(e,t){this._register($(e,se.FOCUS,t))}ignoreGesture(e){return ui.ignoreTarget(e)}};Gt();Ln();ke();var dh=11,YS=class extends co{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...Xe.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=dh+"px",this.domNode.style.height=dh+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new Rl),this._register(Ut(this.bgDomNode,se.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Ut(this.domNode,se.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new Bd),this._pointerdownScheduleRepeatTimer=this._register(new Xo)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,ge(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}};_();v();b();Gt();le();var XS=class extends H{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Xo)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)===null||e===void 0||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)===null||t===void 0||t.setClassName(this._invisibleClassName+(e?" fade":"")))}};Lt();var xG=140,zm=class extends co{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new XS(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Rl),this._shouldRender=!0,this.domNode=$e(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register($(this.domNode.domNode,se.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new YS(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,o){this.slider=$e(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof o=="number"&&this.slider.setHeight(o),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register($(this.slider.domNode,se.POINTER_DOWN,s=>{s.button===0&&(s.preventDefault(),this._sliderPointerDown(s))})),this.onclick(this.slider.domNode,s=>{s.leftButton&&s.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),o=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),s=this._sliderPointerPosition(e);i<=s&&s<=o?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{let s=Sn(this.domNode.domNode);t=e.pageX-s.left,i=e.pageY-s.top}let o=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(o):this._scrollbarState.getDesiredScrollPositionFromOffset(o)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),o=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>{let r=this._sliderOrthogonalPointerPosition(s),a=Math.abs(r-i);if(Li&&a>xG){this._setDesiredScrollPositionNow(o.getScrollPosition());return}let c=this._sliderPointerPosition(s)-t;this._setDesiredScrollPositionNow(o.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}};_();v();b();var hh=class n{constructor(e,t,i,o,s,r){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=o,this._scrollSize=s,this._scrollPosition=r,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new n(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){let t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){let t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,o,s){let r=Math.max(0,i-e),a=Math.max(0,r-2*t),l=o>0&&o>i;if(!l)return{computedAvailableSize:Math.round(r),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(20,Math.floor(i*a/o))),d=(a-c)/(o-i),h=s*d;return{computedAvailableSize:Math.round(r),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:d,computedSliderPosition:Math.round(h)}}_refreshComputedValues(){let e=n._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize,i=this._scrollPosition;return tthis._host.onMouseWheel(new Xs(null,1,0))}),this._createArrow({className:"scra",icon:ue.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:r,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Xs(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}};_();v();b();Qs();$n();var JS=class extends zm{constructor(e,t,i){let o=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new hh(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,o.height,o.scrollHeight,s.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){let r=(t.arrowSize-dh)/2,a=(t.verticalScrollbarSize-dh)/2;this._createArrow({className:"scra",icon:ue.scrollbarButtonUp,top:r,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Xs(null,0,1))}),this._createArrow({className:"scra",icon:ue.scrollbarButtonDown,top:void 0,left:a,bottom:r,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Xs(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}};Gt();ye();le();Lt();_();v();b();ye();le();var cM=class n{constructor(e,t,i,o,s,r,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,i=i|0,o=o|0,s=s|0,r=r|0,a=a|0),this.rawScrollLeft=o,this.rawScrollTop=a,t<0&&(t=0),o+t>i&&(o=i-t),o<0&&(o=0),s<0&&(s=0),a+s>r&&(a=r-s),a<0&&(a=0),this.width=t,this.scrollWidth=i,this.scrollLeft=o,this.height=s,this.scrollHeight=r,this.scrollTop=a}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new n(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new n(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){let i=this.width!==e.width,o=this.scrollWidth!==e.scrollWidth,s=this.scrollLeft!==e.scrollLeft,r=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:o,scrollLeftChanged:s,heightChanged:r,scrollHeightChanged:a,scrollTopChanged:l}}},gr=class extends H{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new B),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new cM(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var i;let o=this._state.withScrollDimensions(e,t);this._setState(o,!!this._smoothScrolling),(i=this._smoothScrolling)===null||i===void 0||i.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let o;t?o=new tx(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):o=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=o}else{let i=this._state.withScrollPosition(e);this._smoothScrolling=tx.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}},ex=class{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}};function lM(n,e){let t=e-n;return function(i){return n+t*DG(i)}}function LG(n,e,t){return function(i){return i2.5*i){let s,r;return e0&&Math.abs(e.deltaY)>0)return 1;let i=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(i+=.25),t){let o=Math.abs(e.deltaX),s=Math.abs(e.deltaY),r=Math.abs(t.deltaX),a=Math.abs(t.deltaY),l=Math.max(Math.min(o,r),1),c=Math.max(Math.min(s,a),1),d=Math.max(o,r),h=Math.max(s,a);d%l===0&&h%c===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};tf.INSTANCE=new tf;var fb=class extends co{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new B),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new B),e.style.overflow="hidden",this._options=IG(t),this._scrollable=i,this._register(this._scrollable.onScroll(s=>{this._onWillScroll.fire(s),this._onDidScroll(s),this._onScroll.fire(s)}));let o={onMouseWheel:s=>this._onMouseWheel(s),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new JS(this._scrollable,this._options,o)),this._horizontalScrollbar=this._register(new QS(this._scrollable,this._options,o)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=$e(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=$e(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=$e(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,s=>this._onMouseOver(s)),this.onmouseleave(this._listenOnDomNode,s=>this._onMouseLeave(s)),this._hideTimeout=this._register(new Xo),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=li(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Be&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Xs(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=li(this._mouseWheelToDispose),e)){let i=o=>{this._onMouseWheel(new Xs(o))};this._mouseWheelToDispose.push($(this._listenOnDomNode,se.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){var t;if(!((t=e.browserEvent)===null||t===void 0)&&t.defaultPrevented)return;let i=tf.INSTANCE;D6&&i.acceptStandardWheelEvent(e);let o=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+r===0?a=r=0:Math.abs(r)>=Math.abs(a)?a=0:r=0),this._options.flipAxes&&([r,a]=[a,r]);let l=!Be&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);let c=this._scrollable.getFutureScrollPosition(),d={};if(r){let h=k6*r,u=c.scrollTop-(h<0?Math.floor(h):Math.ceil(h));this._verticalScrollbar.writeScrollPosition(d,u)}if(a){let h=k6*a,u=c.scrollLeft-(h<0?Math.floor(h):Math.ceil(h));this._horizontalScrollbar.writeScrollPosition(d,u)}d=this._scrollable.validateScrollPosition(d),(c.scrollLeft!==d.scrollLeft||c.scrollTop!==d.scrollTop)&&(D6&&this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(d):this._scrollable.setScrollPositionNow(d),o=!0)}let s=o;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,o=i?" left":"",s=t?" top":"",r=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${o}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${s}${o}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),EG)}},ix=class extends fb{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;let i=new gr({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:o=>rn(ge(e),o)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}},Bl=class extends fb{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}},uh=class extends fb{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;let i=new gr({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:o=>rn(ge(e),o)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(o=>{o.scrollTopChanged&&(this._element.scrollTop=o.scrollTop),o.scrollLeftChanged&&(this._element.scrollLeft=o.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}};function IG(n){let e={lazyRender:typeof n.lazyRender<"u"?n.lazyRender:!1,className:typeof n.className<"u"?n.className:"",useShadows:typeof n.useShadows<"u"?n.useShadows:!0,handleMouseWheel:typeof n.handleMouseWheel<"u"?n.handleMouseWheel:!0,flipAxes:typeof n.flipAxes<"u"?n.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof n.consumeMouseWheelIfScrollbarIsNeeded<"u"?n.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof n.alwaysConsumeMouseWheel<"u"?n.alwaysConsumeMouseWheel:!1,scrollYToX:typeof n.scrollYToX<"u"?n.scrollYToX:!1,mouseWheelScrollSensitivity:typeof n.mouseWheelScrollSensitivity<"u"?n.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof n.fastScrollSensitivity<"u"?n.fastScrollSensitivity:5,scrollPredominantAxis:typeof n.scrollPredominantAxis<"u"?n.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof n.mouseWheelSmoothScroll<"u"?n.mouseWheelSmoothScroll:!0,arrowSize:typeof n.arrowSize<"u"?n.arrowSize:11,listenOnDomNode:typeof n.listenOnDomNode<"u"?n.listenOnDomNode:null,horizontal:typeof n.horizontal<"u"?n.horizontal:1,horizontalScrollbarSize:typeof n.horizontalScrollbarSize<"u"?n.horizontalScrollbarSize:10,horizontalSliderSize:typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:0,horizontalHasArrows:typeof n.horizontalHasArrows<"u"?n.horizontalHasArrows:!1,vertical:typeof n.vertical<"u"?n.vertical:1,verticalScrollbarSize:typeof n.verticalScrollbarSize<"u"?n.verticalScrollbarSize:10,verticalHasArrows:typeof n.verticalHasArrows<"u"?n.verticalHasArrows:!1,verticalSliderSize:typeof n.verticalSliderSize<"u"?n.verticalSliderSize:0,scrollByPage:typeof n.scrollByPage<"u"?n.scrollByPage:!1};return e.horizontalSliderSize=typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof n.verticalSliderSize<"u"?n.verticalSliderSize:e.verticalScrollbarSize,Be&&(e.className+=" mac"),e}var Vm=class extends Qr{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new Wm(this._context,i),this._mouseDownOperation=this._register(new hM(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(r,a)=>this._createMouseTarget(r,a),r=>this._getMouseColumn(r))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(145).height;let o=new BS(this.viewHelper.viewDomNode);this._register(o.onContextMenu(this.viewHelper.viewDomNode,r=>this._onContextMenu(r,!0))),this._register(o.onMouseMove(this.viewHelper.viewDomNode,r=>{this._onMouseMove(r),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=$(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new Xr(a,!1,this.viewHelper.viewDomNode))}))})),this._register(o.onMouseUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(o.onMouseLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r)));let s=0;this._register(o.onPointerDown(this.viewHelper.viewDomNode,(r,a)=>{s=a})),this._register($(this.viewHelper.viewDomNode,se.POINTER_UP,r=>{this._mouseDownOperation.onPointerUp()})),this._register(o.onMouseDown(this.viewHelper.viewDomNode,r=>this._onMouseDown(r,s))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){let e=tf.INSTANCE,t=0,i=Rr.getZoomLevel(),o=!1,s=0,r=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(76))return;let c=new Xs(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){let d=Rr.getZoomLevel(),h=c.deltaY>0?1:-1;Rr.setZoomLevel(d+h),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(i=Rr.getZoomLevel(),o=a(l),s=0),t=Date.now(),s+=c.deltaY,o&&(Rr.setZoomLevel(i+s/5),c.preventDefault(),c.stopPropagation())};this._register($(this.viewHelper.viewDomNode,se.MOUSE_WHEEL,r,{capture:!0,passive:!1}));function a(l){return Be?(l.metaKey||l.ctrlKey)&&!l.shiftKey&&!l.altKey:l.ctrlKey&&!l.metaKey&&!l.shiftKey&&!l.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(145)){let t=this._context.configuration.options.get(145).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){let o=new db(e,t).toPageCoordinates(ge(this.viewHelper.viewDomNode)),s=VS(this.viewHelper.viewDomNode);if(o.ys.y+s.height||o.xs.x+s.width)return null;let r=HS(this.viewHelper.viewDomNode,s,o);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),s,o,r,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){let o=Ec(this.viewHelper.viewDomNode);o&&(i=o.elementsFromPoint(e.posx,e.posy).find(s=>this.viewHelper.viewDomNode.contains(s)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(o||r&&a))h(),this._mouseDownOperation.start(i.type,e,t);else if(s)e.preventDefault();else if(l){let u=i.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(u.viewZoneId)&&(h(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(h(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}},hM=class extends H{constructor(e,t,i,o,s,r){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=o,this._createMouseTarget=s,this._getMouseColumn=r,this._mouseMoveMonitor=this._register(new zS(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new uM(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new nx,this._currentSelection=new nt(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);let t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===13&&(t.outsidePosition==="above"||t.outsidePosition==="below")?this._topBottomDragScrolling.start(t,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);let o=this._findMousePosition(t,!0);if(!o||!o.position)return;this._mouseState.trySetCount(t.detail,o.position),t.detail=this._mouseState.count;let s=this._context.configuration.options;if(!s.get(91)&&s.get(35)&&!s.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&o.type===6&&o.position&&this._currentSelection.containsPosition(o.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),r=>{let a=this._findMousePosition(this._lastMouseEvent,!1);Ia(r)?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:a?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(o,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){let t=e.editorPos,i=this._context.viewModel,o=this._context.viewLayout,s=this._getMouseColumn(e);if(e.posyt.y+t.height){let a=e.posy-t.y-t.height,l=o.getCurrentScrollTop()+e.relativePos.y,c=Bm.getZoneAtCoord(this._context,l);if(c){let h=this._helpPositionJumpOverViewZone(c);if(h)return Rn.createOutsideEditor(s,h,"below",a)}let d=o.getLineNumberAtVerticalOffset(l);return Rn.createOutsideEditor(s,new U(d,i.getLineMaxColumn(d)),"below",a)}let r=o.getLineNumberAtVerticalOffset(o.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){let a=e.posx-t.x-t.width;return Rn.createOutsideEditor(s,new U(r,i.getLineMaxColumn(r)),"right",a)}return null}_findMousePosition(e,t){let i=this._getPositionOutsideEditor(e);if(i)return i;let o=this._createMouseTarget(e,t);if(!o.position)return null;if(o.type===8||o.type===5){let r=this._helpPositionJumpOverViewZone(o.detail);if(r)return Rn.createViewZone(o.type,o.element,o.mouseColumn,r,o.detail)}return o}_helpPositionJumpOverViewZone(e){let t=new U(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,o=e.positionAfter;return i&&o?i.isBefore(t)?i:o:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:e.type===6&&e.detail.injectedText!==null})}},uM=class extends H{constructor(e,t,i,o){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=o,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new fM(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}},fM=class extends H{constructor(e,t,i,o,s,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=o,this._position=s,this._mouseEvent=r,this._lastTime=Date.now(),this._animationFrameDisposable=rn(ge(r.browserEvent),()=>this._execute())}dispose(){this._animationFrameDisposable.dispose(),super.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){let e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}_getScrollSpeed(){let e=this._context.configuration.options.get(67),t=this._context.configuration.options.get(145).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){let e=this._context.configuration.options.get(67),t=this._getScrollSpeed(),i=this._tick(),o=t*(i/1e3)*e,s=this._position.outsidePosition==="above"?-o:o;this._context.viewModel.viewLayout.deltaScrollNow(0,s),this._viewHelper.renderNow();let r=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?r.startLineNumber:r.endLineNumber,l;{let c=VS(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(145).horizontalScrollbarHeight,h=new lh(this._mouseEvent.pos.x,c.y+c.height-d-.1),u=HS(this._viewHelper.viewDomNode,c,h);l=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),c,h,u,null)}(!l.position||l.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?l=Rn.createOutsideEditor(this._position.mouseColumn,new U(a,1),"above",this._position.outsideDistance):l=Rn.createOutsideEditor(this._position.mouseColumn,new U(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=rn(ge(l.element),()=>this._execute())}},nx=class n{get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){let i=new Date().getTime();i-this._lastSetMouseDownCountTime>n.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}};nx.CLEAR_MOUSE_DOWN_COUNT_TIME=400;_();v();b();ps();ke();_();v();b();ye();var et=class{get event(){return this.emitter.event}constructor(e,t,i){let o=s=>this.emitter.fire(s);this.emitter=new B({onWillAddFirstListener:()=>e.addEventListener(t,o,i),onDidRemoveLastListener:()=>e.removeEventListener(t,o,i)})}dispose(){this.emitter.dispose()}};oo();Gt();ye();le();M0();ot();_();v();b();ot();Ke();var xs=!1,pn=class n{constructor(e,t,i,o,s){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=o,this.newlineCountBeforeSelection=s}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){let i=e.getValue(),o=e.getSelectionStart(),s=e.getSelectionEnd(),r;if(t){let a=i.substring(0,o),l=t.value.substring(0,t.selectionStart);a===l&&(r=t.newlineCountBeforeSelection)}return new n(i,o,s,null,r)}collapseSelection(){return this.selectionStart===this.value.length?this:new n(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,i){xs&&console.log(`writeToTextArea ${e}: ${this.toString()}`),t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,i,o,s,r,a,l,c;if(e<=this.selectionStart){let u=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition((i=(t=this.selection)===null||t===void 0?void 0:t.getStartPosition())!==null&&i!==void 0?i:null,u,-1)}if(e>=this.selectionEnd){let u=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition((s=(o=this.selection)===null||o===void 0?void 0:o.getEndPosition())!==null&&s!==void 0?s:null,u,1)}let d=this.value.substring(this.selectionStart,e);if(d.indexOf("\u2026")===-1)return this._finishDeduceEditorPosition((a=(r=this.selection)===null||r===void 0?void 0:r.getStartPosition())!==null&&a!==void 0?a:null,d,1);let h=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition((c=(l=this.selection)===null||l===void 0?void 0:l.getEndPosition())!==null&&c!==void 0?c:null,h,-1)}_finishDeduceEditorPosition(e,t,i){let o=0,s=-1;for(;(s=t.indexOf(` +`,s+1))!==-1;)o++;return[e,i*t.length,o]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};xs&&(console.log("------------------------deduceInput"),console.log(`PREVIOUS STATE: ${e.toString()}`),console.log(`CURRENT STATE: ${t.toString()}`));let o=Math.min(Y_(e.value,t.value),e.selectionStart,t.selectionStart),s=Math.min(X_(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd),r=e.value.substring(o,e.value.length-s),a=t.value.substring(o,t.value.length-s),l=e.selectionStart-o,c=e.selectionEnd-o,d=t.selectionStart-o,h=t.selectionEnd-o;if(xs&&(console.log(`AFTER DIFFING PREVIOUS STATE: <${r}>, selectionStart: ${l}, selectionEnd: ${c}`),console.log(`AFTER DIFFING CURRENT STATE: <${a}>, selectionStart: ${d}, selectionEnd: ${h}`)),d===h){let f=e.selectionStart-o;return xs&&console.log(`REMOVE PREVIOUS: ${f} chars`),{text:a,replacePrevCharCnt:f,replaceNextCharCnt:0,positionDelta:0}}let u=c-l;return{text:a,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(xs&&(console.log("------------------------deduceAndroidCompositionInput"),console.log(`PREVIOUS STATE: ${e.toString()}`),console.log(`CURRENT STATE: ${t.toString()}`)),e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};let i=Math.min(Y_(e.value,t.value),e.selectionEnd),o=Math.min(X_(e.value,t.value),e.value.length-e.selectionEnd),s=e.value.substring(i,e.value.length-o),r=t.value.substring(i,t.value.length-o),a=e.selectionStart-i,l=e.selectionEnd-i,c=t.selectionStart-i,d=t.selectionEnd-i;return xs&&(console.log(`AFTER DIFFING PREVIOUS STATE: <${s}>, selectionStart: ${a}, selectionEnd: ${l}`),console.log(`AFTER DIFFING CURRENT STATE: <${r}>, selectionStart: ${c}, selectionEnd: ${d}`)),{text:r,replacePrevCharCnt:l,replaceNextCharCnt:s.length-l,positionDelta:d-r.length}}};pn.EMPTY=new pn("",0,0,null,void 0);var ox=class n{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){let i=e*t,o=i+1,s=i+t;return new P(o,1,s+1,1)}static fromEditorSelection(e,t,i,o){let r=n._getPageOfLine(t.startLineNumber,i),a=n._getRangeForPage(r,i),l=n._getPageOfLine(t.endLineNumber,i),c=n._getRangeForPage(l,i),d=a.intersectRanges(new P(1,1,t.startLineNumber,t.startColumn));if(o&&e.getValueLengthInRange(d,1)>500){let S=e.modifyPosition(d.getEndPosition(),-500);d=P.fromPositions(S,d.getEndPosition())}let h=e.getValueInRange(d,1),u=e.getLineCount(),f=e.getLineMaxColumn(u),g=c.intersectRanges(new P(t.endLineNumber,t.endColumn,u,f));if(o&&e.getValueLengthInRange(g,1)>500){let S=e.modifyPosition(g.getStartPosition(),500);g=P.fromPositions(g.getStartPosition(),S)}let m=e.getValueInRange(g,1),C;if(r===l||r+1===l)C=e.getValueInRange(t,1);else{let S=a.intersectRanges(t),w=c.intersectRanges(t);C=e.getValueInRange(S,1)+"\u2026"+e.getValueInRange(w,1)}return o&&C.length>2*500&&(C=C.substring(0,500)+"\u2026"+C.substring(C.length-500,C.length)),new pn(h+C+m,h.length,h.length+C.length,t,d.endLineNumber-d.startLineNumber)}};Kn();Aa();var TG=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},E6=function(n,e){return function(t,i){e(t,i,n)}},gb;(function(n){n.Tap="-monaco-textarea-synthetic-tap"})(gb||(gb={}));var T6={forceCopyWithSyntaxHighlighting:!1},Hm=class{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}};Hm.INSTANCE=new Hm;var gM=class{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";let t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}},sx=class extends H{get textAreaState(){return this._textAreaState}constructor(e,t,i,o,s,r){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=o,this._accessibilityService=s,this._logService=r,this._onFocus=this._register(new B),this.onFocus=this._onFocus.event,this._onBlur=this._register(new B),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new B),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new B),this.onCut=this._onCut.event,this._onPaste=this._register(new B),this.onPaste=this._onPaste.event,this._onType=this._register(new B),this.onType=this._onType.event,this._onCompositionStart=this._register(new B),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new B),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new B),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new B),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new no),this._asyncTriggerCut=this._register(new di(()=>this._onCut.fire(),0)),this._textAreaState=pn.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(ie.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new di(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)):this._asyncFocusGainWriteScreenReaderContent.clear()})),this._hasFocus=!1,this._currentComposition=null;let a=null;this._register(this._textArea.onKeyDown(l=>{let c=new bt(l);(c.keyCode===114||this._currentComposition&&c.keyCode===1)&&c.stopPropagation(),c.equals(9)&&c.preventDefault(),a=c,this._onKeyDown.fire(c)})),this._register(this._textArea.onKeyUp(l=>{let c=new bt(l);this._onKeyUp.fire(c)})),this._register(this._textArea.onCompositionStart(l=>{xs&&console.log("[compositionstart]",l);let c=new gM;if(this._currentComposition){this._currentComposition=c;return}if(this._currentComposition=c,this._OS===2&&a&&a.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===l.data&&(a.code==="ArrowRight"||a.code==="ArrowLeft")){xs&&console.log("[compositionstart] Handling long press case on macOS + arrow key",l),c.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:l.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:l.data});return}this._onCompositionStart.fire({data:l.data})})),this._register(this._textArea.onCompositionUpdate(l=>{xs&&console.log("[compositionupdate]",l);let c=this._currentComposition;if(!c)return;if(this._browser.isAndroid){let h=pn.readFromTextArea(this._textArea,this._textAreaState),u=pn.deduceAndroidCompositionInput(this._textAreaState,h);this._textAreaState=h,this._onType.fire(u),this._onCompositionUpdate.fire(l);return}let d=c.handleCompositionUpdate(l.data);this._textAreaState=pn.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(d),this._onCompositionUpdate.fire(l)})),this._register(this._textArea.onCompositionEnd(l=>{xs&&console.log("[compositionend]",l);let c=this._currentComposition;if(!c)return;if(this._currentComposition=null,this._browser.isAndroid){let h=pn.readFromTextArea(this._textArea,this._textAreaState),u=pn.deduceAndroidCompositionInput(this._textAreaState,h);this._textAreaState=h,this._onType.fire(u),this._onCompositionEnd.fire();return}let d=c.handleCompositionUpdate(l.data);this._textAreaState=pn.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(d),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(l=>{if(xs&&console.log("[input]",l),this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;let c=pn.readFromTextArea(this._textArea,this._textAreaState),d=pn.deduceInput(this._textAreaState,c,this._OS===2);d.replacePrevCharCnt===0&&d.text.length===1&&(pi(d.text.charCodeAt(0))||d.text.charCodeAt(0)===127)||(this._textAreaState=c,(d.text!==""||d.replacePrevCharCnt!==0||d.replaceNextCharCnt!==0||d.positionDelta!==0)&&this._onType.fire(d))})),this._register(this._textArea.onCut(l=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(l),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(l=>{this._ensureClipboardGetsEditorSelection(l)})),this._register(this._textArea.onPaste(l=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),l.preventDefault(),!l.clipboardData)return;let[c,d]=I6.getTextData(l.clipboardData);c&&(d=d||Hm.INSTANCE.get(c),this._onPaste.fire({text:c,metadata:d}))})),this._register(this._textArea.onFocus(()=>{let l=this._hasFocus;this._setHasFocus(!0),this._accessibilityService.isScreenReaderOptimized()&&this._browser.isSafari&&!l&&this._hasFocus&&(this._asyncFocusGainWriteScreenReaderContent.value||(this._asyncFocusGainWriteScreenReaderContent.value=new di(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)),this._asyncFocusGainWriteScreenReaderContent.value.schedule())})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return $(this._textArea.ownerDocument,"selectionchange",t=>{if(Ml.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;let i=Date.now(),o=i-e;if(e=i,o<5)return;let s=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),s<100||!this._textAreaState.selection)return;let r=this._textArea.getValue();if(this._textAreaState.value!==r)return;let a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;let c=this._textAreaState.deduceEditorPosition(a),d=this._host.deduceModelPosition(c[0],c[1],c[2]),h=this._textAreaState.deduceEditorPosition(l),u=this._host.deduceModelPosition(h[0],h[1],h[2]),f=new nt(d.lineNumber,d.column,u.lineNumber,u.column);this._onSelectionChangeRequest.fire(f)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeNativeTextAreaContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeNativeTextAreaContent(e){!this._accessibilityService.isScreenReaderOptimized()&&e==="render"||this._currentComposition||(this._logService.trace(`writeTextAreaState(reason: ${e})`),this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent()))}_ensureClipboardGetsEditorSelection(e){let t=this._host.getDataToCopy(),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};Hm.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` +`):t.text,i),e.preventDefault(),e.clipboardData&&I6.setTextData(e.clipboardData,t.text,t.html,i)}};sx=TG([E6(4,ao),E6(5,En)],sx);var I6={getTextData(n){let e=n.getData(rr.text),t=null,i=n.getData("vscode-editor-data");if(typeof i=="string")try{t=JSON.parse(i),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&n.files.length>0?[Array.prototype.slice.call(n.files,0).map(s=>s.name).join(` +`),null]:[e,t]},setTextData(n,e,t,i){n.setData(rr.text,e),typeof t=="string"&&n.setData("text/html",t),n.setData("vscode-editor-data",JSON.stringify(i))}},rx=class extends H{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new et(this._actual,"keydown")).event,this.onKeyUp=this._register(new et(this._actual,"keyup")).event,this.onCompositionStart=this._register(new et(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new et(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new et(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new et(this._actual,"beforeinput")).event,this.onInput=this._register(new et(this._actual,"input")).event,this.onCut=this._register(new et(this._actual,"cut")).event,this.onCopy=this._register(new et(this._actual,"copy")).event,this.onPaste=this._register(new et(this._actual,"paste")).event,this.onFocus=this._register(new et(this._actual,"focus")).event,this.onBlur=this._register(new et(this._actual,"blur")).event,this._onSyntheticTap=this._register(new B),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>Ml.onKeyDown())),this._register(this.onBeforeInput(()=>Ml.onBeforeInput())),this._register(this.onInput(()=>Ml.onInput())),this._register(this.onKeyUp(()=>Ml.onKeyUp())),this._register($(this._actual,gb.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){let e=Ec(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?Bi()===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){let i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){let o=this._actual,s=null,r=Ec(o);r?s=r.activeElement:s=Bi();let a=ge(s),l=s===o,c=o.selectionStart,d=o.selectionEnd;if(l&&c===t&&d===i){wn&&a.parent!==a&&o.focus();return}if(l){this.setIgnoreSelectionChangeTime("setSelectionRange"),o.setSelectionRange(t,i),wn&&a.parent!==a&&o.focus();return}try{let h=K7(o);this.setIgnoreSelectionChangeTime("setSelectionRange"),o.focus(),o.setSelectionRange(t,i),$7(o,h)}catch{}}};var mM=class extends Vm{constructor(e,t,i){super(e,t,i),this._register(ui.addTarget(this.viewHelper.linesContentDomNode)),this._register($(this.viewHelper.linesContentDomNode,It.Tap,s=>this.onTap(s))),this._register($(this.viewHelper.linesContentDomNode,It.Change,s=>this.onChange(s))),this._register($(this.viewHelper.linesContentDomNode,It.Contextmenu,s=>this._onContextMenu(new Xr(s,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register($(this.viewHelper.linesContentDomNode,"pointerdown",s=>{let r=s.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));let o=new WS(this.viewHelper.viewDomNode);this._register(o.onPointerMove(this.viewHelper.viewDomNode,s=>this._onMouseMove(s))),this._register(o.onPointerUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(o.onPointerLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s))),this._register(o.onPointerDown(this.viewHelper.viewDomNode,(s,r)=>this._onMouseDown(s,r)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),this._lastPointerType==="pen"&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){let i=this._createMouseTarget(new Xr(e,!1,this.viewHelper.viewDomNode),!1);i.position&&this.viewController.dispatchMouse({position:i.position,mouseColumn:i.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:i.type===6&&i.detail.injectedText!==null})}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}},pM=class extends Vm{constructor(e,t,i){super(e,t,i),this._register(ui.addTarget(this.viewHelper.linesContentDomNode)),this._register($(this.viewHelper.linesContentDomNode,It.Tap,o=>this.onTap(o))),this._register($(this.viewHelper.linesContentDomNode,It.Change,o=>this.onChange(o))),this._register($(this.viewHelper.linesContentDomNode,It.Contextmenu,o=>this._onContextMenu(new Xr(o,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();let t=this._createMouseTarget(new Xr(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){let i=document.createEvent("CustomEvent");i.initEvent(gb.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}},ax=class extends H{constructor(e,t,i){super(),(Rs||C9&&J1)&&Ag.pointerEvents?this.handler=this._register(new mM(e,t,i)):gt.TouchEvent?this.handler=this._register(new pM(e,t,i)):this.handler=this._register(new Vm(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}};_();v();b();Ge();ps();Lt();ot();_();v();b();Lt();_();v();b();var ns=class extends Qr{};ft();Ke();Qi();$a();var rf=class n extends ns{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new U(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){let e=this._context.configuration.options;this._lineHeight=e.get(67);let t=e.get(68);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(95);let i=e.get(145);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){let t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){let t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new U(e,1));if(t.column!==1)return"";let i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===2){let o=Math.abs(this._lastCursorModelPosition.lineNumber-i);return o===0?''+i+"":String(o)}if(this._renderLineNumbers===3){if(this._lastCursorModelPosition.lineNumber===i||i%10===0)return String(i);let o=this._context.viewModel.getLineCount();return i===o?String(i):""}return String(i)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}let t=mi?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,s=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(c=>!!c.options.lineNumberClassName);s.sort((c,d)=>P.compareRangesUsingEnds(c.range,d.range));let r=0,a=this._context.viewModel.getLineCount(),l=[];for(let c=i;c<=o;c++){let d=c-i,h=this._getLineRenderLineNumber(c),u="";for(;r${h}`}this._renderResult=l}render(e,t){if(!this._renderResult)return"";let i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}};rf.CLASS_NAME="line-numbers";Lo((n,e)=>{let t=n.getColor(R6),i=n.getColor($6);i?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});_();v();b();var fh=class n extends hi{constructor(e){super(e);let t=this._context.configuration.options,i=t.get(145);this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=$e(document.createElement("div")),this._domNode.setClassName(n.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=$e(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(n.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){let t=this._context.configuration.options,i=t.get(145);return this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");let t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);let i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}};fh.CLASS_NAME="glyph-margin";fh.OUTER_CLASS_NAME="margin";W0();ft();Ke();Kn();_();v();b();var Bc="monaco-mouse-cursor-text";Yo();gn();_();v();b();ye();var wM=class{constructor(){this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}},af=new wM;_();v();b();qe();var fi=De("keybindingService");qe();var NG=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},hW=function(n,e){return function(t,i){e(t,i,n)}},SM=class{constructor(e,t,i,o,s){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=o,this.distanceToModelLineEnd=s,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){let t=new U(this.modelLineNumber,this.distanceToModelLineStart+1),i=new U(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}},yM=wn,wx=class extends hi{constructor(e,t,i,o,s){super(e),this._keybindingService=o,this._instantiationService=s,this._primaryCursorPosition=new U(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;let r=this._context.configuration.options,a=r.get(145);this._setAccessibilityOptions(r),this._contentLeft=a.contentLeft,this._contentWidth=a.contentWidth,this._contentHeight=a.height,this._fontInfo=r.get(50),this._lineHeight=r.get(67),this._emptySelectionClipboard=r.get(37),this._copyWithSyntaxHighlighting=r.get(25),this._visibleTextArea=null,this._selections=[new nt(1,1,1,1)],this._modelSelections=[new nt(1,1,1,1)],this._lastRenderPosition=null,this.textArea=$e(document.createElement("textarea")),Mn.write(this.textArea,7),this.textArea.setClassName(`inputarea ${Bc}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");let{tabSize:l}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${l*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(r)),this.textArea.setAttribute("aria-required",r.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(r.get(124))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",p("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",r.get(91)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=$e(document.createElement("div")),this.textAreaCover.setPosition("absolute");let c={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:u=>this._context.viewModel.getLineMaxColumn(u),getValueInRange:(u,f)=>this._context.viewModel.getValueInRange(u,f),getValueLengthInRange:(u,f)=>this._context.viewModel.getValueLengthInRange(u,f),modifyPosition:(u,f)=>this._context.viewModel.modifyPosition(u,f)},d={getDataToCopy:()=>{let u=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Li),f=this._context.viewModel.model.getEOL(),g=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),m=Array.isArray(u)?u:null,C=Array.isArray(u)?u.join(f):u,S,w=null;if(T6.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&C.length<65536){let y=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);y&&(S=y.html,w=y.mode)}return{isFromEmptySelection:g,multicursorText:m,text:C,html:S,mode:w}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){let u=this._selections[0];if(Be&&u.isEmpty()){let g=u.getStartPosition(),m=this._getWordBeforePosition(g);if(m.length===0&&(m=this._getCharacterBeforePosition(g)),m.length>0)return new pn(m,m.length,m.length,P.fromPositions(g),0)}let f=500;if(Be&&!u.isEmpty()&&c.getValueLengthInRange(u,0)0)return new pn(g,m,m,P.fromPositions(f),0)}return pn.EMPTY}return ox.fromEditorSelection(c,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(u,f,g)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(u,f,g)},h=this._register(new rx(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(sx,d,h,po,{isAndroid:NT,isChrome:Pd,isFirefox:wn,isSafari:ms})),this._register(this._textAreaInput.onKeyDown(u=>{this._viewController.emitKeyDown(u)})),this._register(this._textAreaInput.onKeyUp(u=>{this._viewController.emitKeyUp(u)})),this._register(this._textAreaInput.onPaste(u=>{let f=!1,g=null,m=null;u.metadata&&(f=this._emptySelectionClipboard&&!!u.metadata.isFromEmptySelection,g=typeof u.metadata.multicursorText<"u"?u.metadata.multicursorText:null,m=u.metadata.mode),this._viewController.paste(u.text,f,g,m)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(u=>{u.replacePrevCharCnt||u.replaceNextCharCnt||u.positionDelta?(xs&&console.log(` => compositionType: <<${u.text}>>, ${u.replacePrevCharCnt}, ${u.replaceNextCharCnt}, ${u.positionDelta}`),this._viewController.compositionType(u.text,u.replacePrevCharCnt,u.replaceNextCharCnt,u.positionDelta)):(xs&&console.log(` => type: <<${u.text}>>`),this._viewController.type(u.text))})),this._register(this._textAreaInput.onSelectionChangeRequest(u=>{this._viewController.setSelection(u)})),this._register(this._textAreaInput.onCompositionStart(u=>{let f=this.textArea.domNode,g=this._modelSelections[0],{distanceToModelLineStart:m,widthOfHiddenTextBefore:C}=(()=>{let w=f.value.substring(0,Math.min(f.selectionStart,f.selectionEnd)),y=w.lastIndexOf(` +`),x=w.substring(y+1),k=x.lastIndexOf(" "),T=x.length-k-1,N=g.getStartPosition(),M=Math.min(N.column-1,T),W=N.column-1-M,j=x.substring(0,x.length-M),{tabSize:G}=this._context.viewModel.model.getOptions(),V=AG(this.textArea.domNode.ownerDocument,j,this._fontInfo,G);return{distanceToModelLineStart:W,widthOfHiddenTextBefore:V}})(),{distanceToModelLineEnd:S}=(()=>{let w=f.value.substring(Math.max(f.selectionStart,f.selectionEnd)),y=w.indexOf(` +`),x=y===-1?w:w.substring(0,y),k=x.indexOf(" "),T=k===-1?x.length:x.length-k-1,N=g.getEndPosition(),M=Math.min(this._context.viewModel.model.getLineMaxColumn(N.lineNumber)-N.column,T);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(N.lineNumber)-N.column-M}})();this._context.viewModel.revealRange("keyboard",!0,P.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new SM(this._context,g.startLineNumber,m,C,S),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${Bc} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(u=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${Bc}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(af.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){let t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),o=xl(t,[]),s=!0,r=e.column,a=!0,l=e.column,c=0;for(;c<50&&(s||a);){if(s&&r<=1&&(s=!1),s){let d=i.charCodeAt(r-2);o.get(d)!==0?s=!1:r--}if(a&&l>i.length&&(a=!1),a){let d=i.charCodeAt(l-1);o.get(d)!==0?a=!1:l++}c++}return[i.substring(r-1,l-1),e.column-r]}_getWordBeforePosition(e){let t=this._context.viewModel.getLineContent(e.lineNumber),i=xl(this._context.configuration.options.get(131),[]),o=e.column,s=0;for(;o>1;){let r=t.charCodeAt(o-2);if(i.get(r)!==0||s>50)return t.substring(o-1,e.column-1);s++,o--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){let i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!pi(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){var t,i,o;if(e.get(2)===1){let r=(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))===null||t===void 0?void 0:t.getAriaLabel(),a=(i=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))===null||i===void 0?void 0:i.getAriaLabel(),l=(o=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))===null||o===void 0?void 0:o.getAriaLabel(),c=p("accessibilityModeOff","The editor is not accessible at this time.");return r?p("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",c,r):a?p("accessibilityOffAriaLabelNoKb","{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",c,a):l?p("accessibilityOffAriaLabelNoKbs","{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",c,l):c}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);let t=e.get(3);this._accessibilitySupport===2&&t===Ca.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;let o=e.get(145).wrappingColumn;if(o!==-1&&this._accessibilitySupport!==1){let s=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(o*s.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=yM?0:1}onConfigurationChanged(e){let t=this._context.configuration.options,i=t.get(145);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(50),this._lineHeight=t.get(67),this._emptySelectionClipboard=t.get(37),this._copyWithSyntaxHighlighting=t.get(25),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");let{tabSize:o}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${o*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("aria-required",t.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(124))),(e.hasChanged(34)||e.hasChanged(91))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeNativeTextAreaContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeNativeTextAreaContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){let e=this._context.configuration.options;!af.enabled||e.get(34)&&e.get(91)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new U(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),(t=this._visibleTextArea)===null||t===void 0||t.prepareRender(e)}render(e){this._textAreaInput.writeNativeTextAreaContent("render"),this._render()}_render(){var e;if(this._visibleTextArea){let o=this._visibleTextArea.visibleTextareaStart,s=this._visibleTextArea.visibleTextareaEnd,r=this._visibleTextArea.startPosition,a=this._visibleTextArea.endPosition;if(r&&a&&o&&s&&s.left>=this._scrollLeft&&o.left<=this._scrollLeft+this._contentWidth){let l=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,c=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart)),d=this._visibleTextArea.widthOfHiddenLineTextBefore,h=this._contentLeft+o.left-this._scrollLeft,u=s.left-o.left+1;if(hthis._contentWidth&&(u=this._contentWidth);let f=this._context.viewModel.getViewLineData(r.lineNumber),g=f.tokens.findTokenIndexAtOffset(r.column-1),m=f.tokens.findTokenIndexAtOffset(a.column-1),C=g===m,S=this._visibleTextArea.definePresentation(C?f.tokens.getPresentation(g):null);this.textArea.domNode.scrollTop=c*this._lineHeight,this.textArea.domNode.scrollLeft=d,this._doRender({lastRenderPosition:null,top:l,left:h,width:u,height:this._lineHeight,useCover:!1,color:(Bt.getColorMap()||[])[S.foreground],italic:S.italic,bold:S.bold,underline:S.underline,strikethrough:S.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}let t=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(tthis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}let i=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(i<0||i>this._contentHeight){this._renderAtTopLeft();return}if(Be||this._accessibilitySupport===2){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;let o=(e=this._textAreaInput.textAreaState.newlineCountBeforeSelection)!==null&&e!==void 0?e:this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=o*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:yM?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;do{if(i=e.indexOf(` +`,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:yM?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;let t=this.textArea,i=this.textAreaCover;Si(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?Z.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);let o=this._context.configuration.options;o.get(57)?i.setClassName("monaco-editor-background textAreaCover "+fh.OUTER_CLASS_NAME):o.get(68).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+rf.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};wx=NG([hW(3,fi),hW(4,Ye)],wx);function AG(n,e,t,i){if(e.length===0)return 0;let o=n.createElement("div");o.style.position="absolute",o.style.top="-50000px",o.style.width="50000px";let s=n.createElement("span");Si(s,t),s.style.whiteSpace="pre",s.style.tabSize=`${i*t.spaceWidth}px`,s.append(e),o.appendChild(s),n.body.appendChild(o);let r=s.offsetWidth;return n.body.removeChild(o),r}_();v();b();_();v();b();Ge();ps();xi();Ud();Or();_();v();b();_();v();b();ft();Ke();Kn();Su();Ka();xM();var RG=()=>!0,PG=()=>!1,OG=n=>n===" "||n===" ",Wc=class{static shouldRecreate(e){return e.hasChanged(145)||e.hasChanged(131)||e.hasChanged(37)||e.hasChanged(77)||e.hasChanged(79)||e.hasChanged(80)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(128)||e.hasChanged(50)||e.hasChanged(91)||e.hasChanged(130)}constructor(e,t,i,o){var s;this.languageConfigurationService=o,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;let r=i.options,a=r.get(145),l=r.get(50);this.readOnly=r.get(91),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=r.get(116),this.lineHeight=l.lineHeight,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(a.height/this.lineHeight)-2),this.useTabStops=r.get(128),this.wordSeparators=r.get(131),this.emptySelectionClipboard=r.get(37),this.copyWithSyntaxHighlighting=r.get(25),this.multiCursorMergeOverlapping=r.get(77),this.multiCursorPaste=r.get(79),this.multiCursorLimit=r.get(80),this.autoClosingBrackets=r.get(6),this.autoClosingComments=r.get(7),this.autoClosingQuotes=r.get(11),this.autoClosingDelete=r.get(9),this.autoClosingOvertype=r.get(10),this.autoSurround=r.get(14),this.autoIndent=r.get(12),this.wordSegmenterLocales=r.get(130),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();let c=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(c)for(let h of c)this.surroundingPairs[h.open]=h.close;let d=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=(s=d?.blockCommentStartToken)!==null&&s!==void 0?s:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};let t=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)===null||e===void 0?void 0:e.getElectricCharacters();if(t)for(let i of t)this._electricChars[i]=!0}return this._electricChars}onElectricCharacter(e,t,i){let o=Kd(t,i-1),s=this.languageConfigurationService.getLanguageConfiguration(o.languageId).electricCharacter;return s?s.onElectricCharacter(e,o,i-o.firstCharOffset):null}normalizeIndentation(e){return yx(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return OG;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return RG;case"never":return PG}}_getLanguageDefinedShouldAutoClose(e,t){let i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return o=>i.indexOf(o)!==-1}visibleColumnFromColumn(e,t){return oi.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){let o=oi.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),s=e.getLineMinColumn(t);if(or?r:o}},mt=class n{static fromModelState(e){return new LM(e)}static fromViewState(e){return new kM(e)}static fromModelSelection(e){let t=nt.liftSelection(e),i=new Ji(P.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return n.fromModelState(i)}static fromModelSelections(e){let t=[];for(let i=0,o=e.length;is,c=o>r,d=or||So||C0&&o--,n.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,o)}static columnSelectRight(e,t,i){let o=0,s=Math.min(i.fromViewLineNumber,i.toViewLineNumber),r=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let l=s;l<=r;l++){let c=t.getLineMaxColumn(l),d=e.visibleColumnFromColumn(t,new U(l,c));o=Math.max(o,d)}let a=i.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-ET(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){let i=t.lineNumber-1;return new U(i,e.getLineMaxColumn(i))}else return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){let o=e.getLineMinColumn(t.lineNumber),s=e.getLineContent(t.lineNumber),r=Ju.atomicPosition(s,t.column-1,i,0);if(r!==-1&&r+1>=o)return new U(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){let o=e.stickyTabStops?n.leftPositionAtomicSoftTabs(t,i,e.tabSize):n.leftPosition(t,i);return new pb(o.lineNumber,o.column,0)}static moveLeft(e,t,i,o,s){let r,a;if(i.hasSelection()&&!o)r=i.selection.startLineNumber,a=i.selection.startColumn;else{let l=i.position.delta(void 0,-(s-1)),c=t.normalizePosition(n.clipPositionColumn(l,t),0),d=n.left(e,t,c);r=d.lineNumber,a=d.column}return i.move(o,r,a,0)}static clipPositionColumn(e,t){return new U(e.lineNumber,n.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return ei?i:e}static rightPosition(e,t,i){return id?(i=d,a?o=t.getLineMaxColumn(i):o=Math.min(t.getLineMaxColumn(i),o)):o=e.columnFromVisibleColumn(t,i,c),f?s=0:s=c-oi.visibleColumnFromColumn(t.getLineContent(i),o,e.tabSize),l!==void 0){let g=new U(i,o),m=t.normalizePosition(g,l);s=s+(o-m.column),i=m.lineNumber,o=m.column}return new pb(i,o,s)}static down(e,t,i,o,s,r,a){return this.vertical(e,t,i,o,s,i+r,a,4)}static moveDown(e,t,i,o,s){let r,a;i.hasSelection()&&!o?(r=i.selection.endLineNumber,a=i.selection.endColumn):(r=i.position.lineNumber,a=i.position.column);let l=0,c;do if(c=n.down(e,t,r+l,a,i.leftoverVisibleColumns,s,!0),t.normalizePosition(new U(c.lineNumber,c.column),2).lineNumber>r)break;while(l++<10&&r+l1&&this._isBlankLine(t,s);)s--;for(;s>1&&!this._isBlankLine(t,s);)s--;return i.move(o,s,t.getLineMinColumn(s),0)}static moveToNextBlankLine(e,t,i,o){let s=t.getLineCount(),r=i.position.lineNumber;for(;r=u.length+1)return!1;let f=u.charAt(h.column-2),g=o.get(f);if(!g)return!1;if(Vl(f)){if(i==="never")return!1}else if(t==="never")return!1;let m=u.charAt(h.column-1),C=!1;for(let S of g)S.open===f&&S.close===m&&(C=!0);if(!C)return!1;if(e==="auto"){let S=!1;for(let w=0,y=a.length;w1){let s=t.getLineContent(o.lineNumber),r=Ri(s),a=r===-1?s.length+1:r+1;if(o.column<=a){let l=i.visibleColumnFromColumn(t,o),c=oi.prevIndentTabStop(l,i.indentSize),d=i.columnFromVisibleColumn(t,o.lineNumber,c);return new P(o.lineNumber,d,o.lineNumber,o.column)}}return P.fromPositions(n.getPositionAfterDeleteLeft(o,t),o)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){let i=u7(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}else if(e.lineNumber>1){let i=e.lineNumber-1;return new U(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){let o=[],s=null;i.sort((r,a)=>U.compare(r.getStartPosition(),a.getEndPosition()));for(let r=0,a=i.length;r1&&s?.endLineNumber!==c.lineNumber?(d=c.lineNumber-1,h=t.getLineMaxColumn(c.lineNumber-1),u=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber)):(d=c.lineNumber,h=1,u=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber));let g=new P(d,h,u,f);s=g,g.isEmpty()?o[r]=null:o[r]=new ho(g,"")}else o[r]=null;else o[r]=new ho(l,"")}return new Pn(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}};_();v();b();xi();_();v();b();ot();W0();ft();Ke();var uo=class n{static _createWord(e,t,i,o,s){return{start:o,end:s,wordType:t,nextCharClass:i}}static _createIntlWord(e,t){return{start:e.index,end:e.index+e.segment.length,wordType:1,nextCharClass:t}}static _findPreviousWordOnLine(e,t,i){let o=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(o,e,i)}static _doFindPreviousWordOnLine(e,t,i){let o=0,s=t.findPrevIntlWordBeforeOrAtOffset(e,i.column-2);for(let r=i.column-2;r>=0;r--){let a=e.charCodeAt(r),l=t.get(a);if(s&&r===s.index)return this._createIntlWord(s,l);if(l===0){if(o===2)return this._createWord(e,o,l,r+1,this._findEndOfWord(e,t,o,r+1));o=1}else if(l===2){if(o===1)return this._createWord(e,o,l,r+1,this._findEndOfWord(e,t,o,r+1));o=2}else if(l===1&&o!==0)return this._createWord(e,o,l,r+1,this._findEndOfWord(e,t,o,r+1))}return o!==0?this._createWord(e,o,1,0,this._findEndOfWord(e,t,o,0)):null}static _findEndOfWord(e,t,i,o){let s=t.findNextIntlWordAtOrAfterOffset(e,o),r=e.length;for(let a=o;a=0;r--){let a=e.charCodeAt(r),l=t.get(a);if(s&&r===s.index)return r;if(l===1||i===1&&l===2||i===2&&l===0)return r+1}return 0}static moveWordLeft(e,t,i,o){let s=i.lineNumber,r=i.column;r===1&&s>1&&(s=s-1,r=t.getLineMaxColumn(s));let a=n._findPreviousWordOnLine(e,t,new U(s,r));if(o===0)return new U(s,a?a.start+1:1);if(o===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=n._findPreviousWordOnLine(e,t,new U(s,a.start+1))),new U(s,a?a.start+1:1);if(o===3){for(;a&&a.wordType===2;)a=n._findPreviousWordOnLine(e,t,new U(s,a.start+1));return new U(s,a?a.start+1:1)}return a&&r<=a.end+1&&(a=n._findPreviousWordOnLine(e,t,new U(s,a.start+1))),new U(s,a?a.end+1:1)}static _moveWordPartLeft(e,t){let i=t.lineNumber,o=e.getLineMaxColumn(i);if(t.column===1)return i>1?new U(i-1,e.getLineMaxColumn(i-1)):t;let s=e.getLineContent(i);for(let r=t.column-1;r>1;r--){let a=s.charCodeAt(r-2),l=s.charCodeAt(r-1);if(a===95&&l!==95)return new U(i,r);if(a===45&&l!==45)return new U(i,r);if((au(a)||Z_(a))&&ml(l))return new U(i,r);if(ml(a)&&ml(l)&&r+1=l.start+1&&(l=n._findNextWordOnLine(e,t,new U(s,l.end+1))),l?r=l.start+1:r=t.getLineMaxColumn(s);return new U(s,r)}static _moveWordPartRight(e,t){let i=t.lineNumber,o=e.getLineMaxColumn(i);if(t.column===o)return i1?c=1:(l--,c=o.getLineMaxColumn(l)):(d&&c<=d.end+1&&(d=n._findPreviousWordOnLine(i,o,new U(l,d.start+1))),d?c=d.end+1:c>1?c=1:(l--,c=o.getLineMaxColumn(l))),new P(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;let o=new U(i.positionLineNumber,i.positionColumn),s=this._deleteInsideWordWhitespace(t,o);return s||this._deleteInsideWordDetermineDeleteRange(e,t,o)}static _charAtIsWhitespace(e,t){let i=e.charCodeAt(t);return i===32||i===9}static _deleteInsideWordWhitespace(e,t){let i=e.getLineContent(t.lineNumber),o=i.length;if(o===0)return null;let s=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,s))return null;let r=Math.min(t.column-1,o-1);if(!this._charAtIsWhitespace(i,r))return null;for(;s>0&&this._charAtIsWhitespace(i,s-1);)s--;for(;r+11?new P(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumberh.start+1<=i.column&&i.column<=h.end+1,a=(h,u)=>(h=Math.min(h,i.column),u=Math.max(u,i.column),new P(i.lineNumber,h,i.lineNumber,u)),l=h=>{let u=h.start+1,f=h.end+1,g=!1;for(;f-11&&this._charAtIsWhitespace(o,u-2);)u--;return a(u,f)},c=n._findPreviousWordOnLine(e,t,i);if(c&&r(c))return l(c);let d=n._findNextWordOnLine(e,t,i);return d&&r(d)?l(d):c&&d?a(c.end+1,d.start+1):c?a(c.start+1,c.end+1):d?a(d.start+1,d.end+1):a(1,s+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;let i=t.getPosition(),o=n._moveWordPartLeft(e,i);return new P(i.lineNumber,i.column,o.lineNumber,o.column)}static _findFirstNonWhitespaceChar(e,t){let i=e.length;for(let o=t;o=u.start+1&&(u=n._findNextWordOnLine(i,o,new U(l,u.end+1))),u?c=u.start+1:c!!e)}ft();Ke();var On=class{static addCursorDown(e,t,i){let o=[],s=0;for(let r=0,a=t.length;rc&&(d=c,h=e.model.getLineMaxColumn(d)),mt.fromModelState(new Ji(new P(r.lineNumber,1,d,h),2,0,new U(d,h),0))}let l=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumberl){let c=e.getLineCount(),d=a.lineNumber+1,h=1;return d>c&&(d=c,h=e.getLineMaxColumn(d)),mt.fromViewState(t.viewState.move(!0,d,h,0))}else{let c=t.modelState.selectionStart.getEndPosition();return mt.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,i,o){let s=e.model.validatePosition(o);return mt.fromModelState(uo.word(e.cursorConfig,e.model,t.modelState,i,s))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new mt(t.modelState,t.viewState);let i=t.viewState.position.lineNumber,o=t.viewState.position.column;return mt.fromViewState(new Ji(new P(i,o,i,o),0,0,new U(i,o),0))}static moveTo(e,t,i,o,s){if(i){if(t.modelState.selectionStartKind===1)return this.word(e,t,i,o);if(t.modelState.selectionStartKind===2)return this.line(e,t,i,o,s)}let r=e.model.validatePosition(o),a=s?e.coordinatesConverter.validateViewPosition(new U(s.lineNumber,s.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return mt.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,o,s,r){switch(i){case 0:return r===4?this._moveHalfLineLeft(e,t,o):this._moveLeft(e,t,o,s);case 1:return r===4?this._moveHalfLineRight(e,t,o):this._moveRight(e,t,o,s);case 2:return r===2?this._moveUpByViewLines(e,t,o,s):this._moveUpByModelLines(e,t,o,s);case 3:return r===2?this._moveDownByViewLines(e,t,o,s):this._moveDownByModelLines(e,t,o,s);case 4:return r===2?t.map(a=>mt.fromViewState(Ti.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,o))):t.map(a=>mt.fromModelState(Ti.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,o)));case 5:return r===2?t.map(a=>mt.fromViewState(Ti.moveToNextBlankLine(e.cursorConfig,e,a.viewState,o))):t.map(a=>mt.fromModelState(Ti.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,o)));case 6:return this._moveToViewMinColumn(e,t,o);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,o);case 8:return this._moveToViewCenterColumn(e,t,o);case 9:return this._moveToViewMaxColumn(e,t,o);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,o);default:return null}}static viewportMove(e,t,i,o,s){let r=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(r);switch(i){case 11:{let l=this._firstLineNumberInRange(e.model,a,s),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],o,l,c)]}case 13:{let l=this._lastLineNumberInRange(e.model,a,s),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],o,l,c)]}case 12:{let l=Math.round((a.startLineNumber+a.endLineNumber)/2),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],o,l,c)]}case 14:{let l=[];for(let c=0,d=t.length;ci.endLineNumber-1?r=i.endLineNumber-1:smt.fromViewState(Ti.moveLeft(e.cursorConfig,e,s.viewState,i,o)))}static _moveHalfLineLeft(e,t,i){let o=[];for(let s=0,r=t.length;smt.fromViewState(Ti.moveRight(e.cursorConfig,e,s.viewState,i,o)))}static _moveHalfLineRight(e,t,i){let o=[];for(let s=0,r=t.length;s1&&o.firstCharOffset===0){let m=qd(e,t.startLineNumber-1);m.languageId===o.languageId&&(c=m.getLineContent())}let d=s.onEnter(n,c,a,l);if(!d)return null;let h=d.indentAction,u=d.appendText,f=d.removeText||0;u?h===Vi.Indent&&(u=" "+u):h===Vi.Indent||h===Vi.IndentOutdent?u=" ":u="";let g=Vy(e,t.startLineNumber,t.startColumn);return f&&(g=g.substring(0,g.length-f)),{indentAction:h,appendText:u,removeText:f,indentation:g}}lr();var FG=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},BG=function(n,e){return function(t,i){e(t,i,n)}},Lx,DM=Object.create(null);function df(n,e){if(e<=0)return"";DM[n]||(DM[n]=["",n]);let t=DM[n];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+n;return t[e]}var mh=Lx=class{static unshiftIndent(e,t,i,o,s){let r=oi.visibleColumnFromColumn(e,t,i);if(s){let a=df(" ",o),c=oi.prevIndentTabStop(r,o)/o;return df(a,c)}else{let a=" ",c=oi.prevRenderTabStop(r,i)/i;return df(a,c)}}static shiftIndent(e,t,i,o,s){let r=oi.visibleColumnFromColumn(e,t,i);if(s){let a=df(" ",o),c=oi.nextIndentTabStop(r,o)/o;return df(a,c)}else{let a=" ",c=oi.nextRenderTabStop(r,i)/i;return df(a,c)}}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){let i=this._selection.startLineNumber,o=this._selection.endLineNumber;this._selection.endColumn===1&&i!==o&&(o=o-1);let{tabSize:s,indentSize:r,insertSpaces:a}=this._opts,l=i===o;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,d=0;for(let h=i;h<=o;h++,c=d){d=0;let u=e.getLineContent(h),f=Ri(u);if(this._opts.isUnshift&&(u.length===0||f===0)||!l&&!this._opts.isUnshift&&u.length===0)continue;if(f===-1&&(f=u.length),h>1&&oi.visibleColumnFromColumn(u,f+1,s)%r!==0&&e.tokenization.isCheapToTokenize(h-1)){let C=bb(this._opts.autoIndent,e,new P(h-1,e.getLineMaxColumn(h-1),h-1,e.getLineMaxColumn(h-1)),this._languageConfigurationService);if(C){if(d=c,C.appendText)for(let S=0,w=C.appendText.length;S1){let o,s=-1;for(o=e-1;o>=1;o--){if(n.tokenization.getLanguageIdAtPosition(o,0)!==i)return s;let r=n.getLineContent(o);if(t.shouldIgnore(r)||/^\s+$/.test(r)||r===""){s=o;continue}return o}}return-1}function vb(n,e,t,i=!0,o){if(n<4)return null;let s=o.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!s)return null;if(t<=1)return{indentation:"",action:null};for(let l=t-1;l>0&&e.getLineContent(l)==="";l--)if(l===1)return{indentation:"",action:null};let r=WG(e,t,s);if(r<0)return null;if(r<1)return{indentation:"",action:null};let a=e.getLineContent(r);if(s.shouldIncrease(a)||s.shouldIndentNextLine(a))return{indentation:jn(a),action:Vi.Indent,line:r};if(s.shouldDecrease(a))return{indentation:jn(a),action:null,line:r};{if(r===1)return{indentation:jn(e.getLineContent(r)),action:null,line:r};let l=r-1,c=s.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let d=0;for(let h=l-1;h>0;h--)if(!s.shouldIndentNextLine(e.getLineContent(h))){d=h;break}return{indentation:jn(e.getLineContent(d+1)),action:null,line:d+1}}if(i)return{indentation:jn(e.getLineContent(r)),action:null,line:r};for(let d=r;d>0;d--){let h=e.getLineContent(d);if(s.shouldIncrease(h))return{indentation:jn(h),action:Vi.Indent,line:d};if(s.shouldIndentNextLine(h)){let u=0;for(let f=d-1;f>0;f--)if(!s.shouldIndentNextLine(e.getLineContent(d))){u=f;break}return{indentation:jn(e.getLineContent(u+1)),action:null,line:u+1}}else if(s.shouldDecrease(h))return{indentation:jn(h),action:null,line:d}}return{indentation:jn(e.getLineContent(1)),action:null,line:1}}}function HEe(n,e,t,i,o,s){if(n<4)return null;let r=s.getLanguageConfiguration(t);if(!r)return null;let a=s.getLanguageConfiguration(t).indentRulesSupport;if(!a)return null;let l=vb(n,e,i,void 0,s),c=e.getLineContent(i);if(l){let d=l.line;if(d!==void 0){let h=!0;for(let u=d;u0&&s.getLanguageId(0)!==r.languageId?(l=!0,c=a.substr(0,t.startColumn-1-r.firstCharOffset)):c=s.getLineContent().substring(0,t.startColumn-1);let d;t.isEmpty()?d=a.substr(t.startColumn-1-r.firstCharOffset):d=qd(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-r.firstCharOffset);let h=o.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!h)return null;let u=c,f=jn(c),g={tokenization:{getLineTokens:w=>e.tokenization.getLineTokens(w),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(w,y)=>e.getLanguageIdAtPosition(w,y)},getLineContent:w=>w===t.startLineNumber?u:e.getLineContent(w)},m=jn(s.getLineContent()),C=vb(n,g,t.startLineNumber+1,void 0,o);if(!C){let w=l?m:f;return{beforeEnter:w,afterEnter:w}}let S=l?m:C.indentation;return C.action===Vi.Indent&&(S=i.shiftIndent(S)),h.shouldDecrease(d)&&(S=i.unshiftIndent(S)),{beforeEnter:l?m:f,afterEnter:S}}function mW(n,e,t,i,o,s){if(n<4)return null;let r=qd(e,t.startLineNumber,t.startColumn);if(r.firstCharOffset)return null;let a=s.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!a)return null;let l=r.getLineContent(),c=l.substr(0,t.startColumn-1-r.firstCharOffset),d;if(t.isEmpty()?d=l.substr(t.startColumn-1-r.firstCharOffset):d=qd(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-r.firstCharOffset),!a.shouldDecrease(c+d)&&a.shouldDecrease(c+i+d)){let h=vb(n,e,t.startLineNumber,!1,s);if(!h)return null;let u=h.indentation;return h.action!==Vi.Indent&&(u=o.unshiftIndent(u)),u}return null}function UEe(n,e,t){let i=t.getLanguageConfiguration(n.getLanguageId()).indentRulesSupport;return!i||e<1||e>n.getLineCount()?null:i.getIndentMetadata(n.getLineContent(e))}var ta=class n{static indent(e,t,i){if(t===null||i===null)return[];let o=[];for(let s=0,r=i.length;s1){let a;for(a=i-1;a>=1;a--){let d=t.getLineContent(a);if(Os(d)>=0)break}if(a<1)return null;let l=t.getLineMaxColumn(a),c=bb(e.autoIndent,t,new P(a,l,a,l),e.languageConfigurationService);c&&(s=c.indentation+c.appendText)}return o&&(o===Vi.Indent&&(s=n.shiftIndent(e,s)),o===Vi.Outdent&&(s=n.unshiftIndent(e,s)),s=e.normalizeIndentation(s)),s||null}static _replaceJumpToNextIndent(e,t,i,o){let s="",r=i.getStartPosition();if(e.insertSpaces){let a=e.visibleColumnFromColumn(t,r),l=e.indentSize,c=l-a%l;for(let d=0;dthis._compositionType(i,d,s,r,a,l));return new Pn(4,c,{shouldPushStackElementBefore:Ex(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,o,s,r){if(!t.isEmpty())return null;let a=t.getPosition(),l=Math.max(1,a.column-o),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+s),d=new P(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(d)===i&&r===0?null:new cf(d,i,0,r)}static _typeCommand(e,t,i){return i?new lf(e,t,!0):new ho(e,t,!0)}static _enter(e,t,i,o){if(e.autoIndent===0)return n._typeCommand(o,` +`,i);if(!t.tokenization.isCheapToTokenize(o.getStartPosition().lineNumber)||e.autoIndent===1){let l=t.getLineContent(o.startLineNumber),c=jn(l).substring(0,o.startColumn-1);return n._typeCommand(o,` +`+e.normalizeIndentation(c),i)}let s=bb(e.autoIndent,t,o,e.languageConfigurationService);if(s){if(s.indentAction===Vi.None)return n._typeCommand(o,` +`+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===Vi.Indent)return n._typeCommand(o,` +`+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===Vi.IndentOutdent){let l=e.normalizeIndentation(s.indentation),c=e.normalizeIndentation(s.indentation+s.appendText),d=` +`+c+` +`+l;return i?new lf(o,d,!0):new cf(o,d,-1,c.length-l.length,!0)}else if(s.indentAction===Vi.Outdent){let l=n.unshiftIndent(e,s.indentation);return n._typeCommand(o,` +`+e.normalizeIndentation(l+s.appendText),i)}}let r=t.getLineContent(o.startLineNumber),a=jn(r).substring(0,o.startColumn-1);if(e.autoIndent>=4){let l=gW(e.autoIndent,t,o,{unshiftIndent:c=>n.unshiftIndent(e,c),shiftIndent:c=>n.shiftIndent(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,o.getEndPosition()),d=o.endColumn,h=t.getLineContent(o.endLineNumber),u=Ri(h);if(u>=0?o=o.setEndPosition(o.endLineNumber,Math.max(o.endColumn,u+1)):o=o.setEndPosition(o.endLineNumber,t.getLineMaxColumn(o.endLineNumber)),i)return new lf(o,` +`+e.normalizeIndentation(l.afterEnter),!0);{let f=0;return d<=u+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),f=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new cf(o,` +`+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return n._typeCommand(o,` +`+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let o=0,s=i.length;on.shiftIndent(e,a),unshiftIndent:a=>n.unshiftIndent(e,a)},e.languageConfigurationService);if(r===null)return null;if(r!==e.normalizeIndentation(s)){let a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?n._typeCommand(new P(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+o,!1):n._typeCommand(new P(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+t.getLineContent(i.startLineNumber).substring(a-1,i.startColumn-1)+o,!1)}return null}static _isAutoClosingOvertype(e,t,i,o,s){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(s))return!1;for(let r=0,a=i.length;r2?d.charCodeAt(c.column-2):0)===92&&u)return!1;if(e.autoClosingOvertype==="auto"){let g=!1;for(let m=0,C=o.length;mt.startsWith(l.open)),a=s.some(l=>t.startsWith(l.close));return!r&&a}static _findAutoClosingPairOpen(e,t,i,o){let s=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(o);if(!s)return null;let r=null;for(let a of s)if(r===null||a.open.length>r.open.length){let l=!0;for(let c of i)if(t.getValueInRange(new P(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+o!==a.open){l=!1;break}l&&(r=a)}return r}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;let i=t.close.charAt(t.close.length-1),o=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[],s=null;for(let r of o)r.open!==t.open&&t.open.includes(r.open)&&t.close.endsWith(r.close)&&(!s||r.open.length>s.open.length)&&(s=r);return s}static _getAutoClosingPairClose(e,t,i,o,s){for(let g of i)if(!g.isEmpty())return null;let r=i.map(g=>{let m=g.getPosition();return s?{lineNumber:m.lineNumber,beforeColumn:m.column-o.length,afterColumn:m.column}:{lineNumber:m.lineNumber,beforeColumn:m.column,afterColumn:m.column}}),a=this._findAutoClosingPairOpen(e,t,r.map(g=>new U(g.lineNumber,g.beforeColumn)),o);if(!a)return null;let l,c;if(Vl(o)?(l=e.autoClosingQuotes,c=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,c=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,c=e.shouldAutoCloseBefore.bracket),l==="never")return null;let h=this._findContainedAutoClosingPair(e,a),u=h?h.close:"",f=!0;for(let g of r){let{lineNumber:m,beforeColumn:C,afterColumn:S}=g,w=t.getLineContent(m),y=w.substring(0,C-1),x=w.substring(S-1);if(x.startsWith(u)||(f=!1),x.length>0){let M=x.charAt(0);if(!n._isBeforeClosingBrace(e,x)&&!c(M))return null}if(a.open.length===1&&(o==="'"||o==='"')&&l!=="always"){let M=xl(e.wordSeparators,[]);if(y.length>0){let W=y.charCodeAt(y.length-1);if(M.get(W)===0)return null}}if(!t.tokenization.isCheapToTokenize(m))return null;t.tokenization.forceTokenization(m);let k=t.tokenization.getLineTokens(m),T=Kd(k,C-1);if(!a.shouldAutoClose(T,C-T.firstCharOffset))return null;let N=a.findNeutralCharacter();if(N){let M=t.tokenization.getTokenTypeIfInsertingCharacter(m,C,N);if(!a.isOK(M))return null}}return f?a.close.substring(0,a.close.length-u.length):a.close}static _runAutoClosingOpenCharType(e,t,i,o,s,r,a){let l=[];for(let c=0,d=o.length;cnew ho(new P(u.positionLineNumber,u.positionColumn,u.positionLineNumber,u.positionColumn+1),"",!1));return new Pn(4,h,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}let d=this._getAutoClosingPairClose(t,i,s,l,!0);return d!==null?this._runAutoClosingOpenCharType(e,t,i,s,l,!0,d):null}static typeWithInterceptors(e,t,i,o,s,r,a){if(!e&&a===` +`){let d=[];for(let h=0,u=s.length;h{let o=t.get(Zt).getFocusedCodeEditor();return o&&o.hasTextFocus()?this._runEditorCommand(t,o,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{let o=Bi();return o&&["input","textarea"].indexOf(o.tagName.toLowerCase())>=0?(this.runDOMCommand(o),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{let o=t.get(Zt).getActiveCodeEditor();return o?(o.focus(),this._runEditorCommand(t,o,i)):!1})}_runEditorCommand(e,t,i){let o=this.runEditorCommand(e,t,i);return o||!0}},ln;(function(n){class e extends _i{constructor(w){super(w),this._inSelectionMode=w.inSelectionMode}runCoreEditorCommand(w,y){if(!y.position)return;w.model.pushStackElement(),w.setCursorStates(y.source,3,[On.moveTo(w,w.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)])&&y.revealType!==2&&w.revealAllCursors(y.source,!0,!0)}}n.MoveTo=Je(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),n.MoveToSelect=Je(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends _i{runCoreEditorCommand(w,y){w.model.pushStackElement();let x=this._getColumnSelectResult(w,w.getPrimaryCursorState(),w.getCursorColumnSelectData(),y);x!==null&&(w.setCursorStates(y.source,3,x.viewStates.map(k=>mt.fromViewState(k))),w.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:x.fromLineNumber,fromViewVisualColumn:x.fromVisualColumn,toViewLineNumber:x.toLineNumber,toViewVisualColumn:x.toVisualColumn}),x.reversed?w.revealTopMostCursor(y.source):w.revealBottomMostCursor(y.source))}}n.ColumnSelect=Je(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(S,w,y,x){if(typeof x.position>"u"||typeof x.viewPosition>"u"||typeof x.mouseColumn>"u")return null;let k=S.model.validatePosition(x.position),T=S.coordinatesConverter.validateViewPosition(new U(x.viewPosition.lineNumber,x.viewPosition.column),k),N=x.doColumnSelect?y.fromViewLineNumber:T.lineNumber,M=x.doColumnSelect?y.fromViewVisualColumn:x.mouseColumn-1;return gh.columnSelect(S.cursorConfig,S,N,M,T.lineNumber,x.mouseColumn-1)}}),n.CursorColumnSelectLeft=Je(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(S,w,y,x){return gh.columnSelectLeft(S.cursorConfig,S,y)}}),n.CursorColumnSelectRight=Je(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(S,w,y,x){return gh.columnSelectRight(S.cursorConfig,S,y)}});class i extends t{constructor(w){super(w),this._isPaged=w.isPaged}_getColumnSelectResult(w,y,x,k){return gh.columnSelectUp(w.cursorConfig,w,x,this._isPaged)}}n.CursorColumnSelectUp=Je(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:3600,linux:{primary:0}}})),n.CursorColumnSelectPageUp=Je(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:3595,linux:{primary:0}}}));class o extends t{constructor(w){super(w),this._isPaged=w.isPaged}_getColumnSelectResult(w,y,x,k){return gh.columnSelectDown(w.cursorConfig,w,x,this._isPaged)}}n.CursorColumnSelectDown=Je(new o({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:3602,linux:{primary:0}}})),n.CursorColumnSelectPageDown=Je(new o({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:3596,linux:{primary:0}}}));class s extends _i{constructor(){super({id:"cursorMove",precondition:void 0,metadata:_b.metadata})}runCoreEditorCommand(w,y){let x=_b.parse(y);x&&this._runCursorMove(w,y.source,x)}_runCursorMove(w,y,x){w.model.pushStackElement(),w.setCursorStates(y,3,s._move(w,w.getCursorStates(),x)),w.revealAllCursors(y,!0)}static _move(w,y,x){let k=x.select,T=x.value;switch(x.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return On.simpleMove(w,y,x.direction,k,T,x.unit);case 11:case 13:case 12:case 14:return On.viewportMove(w,y,x.direction,k,T);default:return null}}}n.CursorMoveImpl=s,n.CursorMove=Je(new s);class r extends _i{constructor(w){super(w),this._staticArgs=w.args}runCoreEditorCommand(w,y){let x=this._staticArgs;this._staticArgs.value===-1&&(x={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:y.pageSize||w.cursorConfig.pageSize}),w.model.pushStackElement(),w.setCursorStates(y.source,3,On.simpleMove(w,w.getCursorStates(),x.direction,x.select,x.value,x.unit)),w.revealAllCursors(y.source,!0)}}n.CursorLeft=Je(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),n.CursorLeftSelect=Je(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:1039}})),n.CursorRight=Je(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),n.CursorRightSelect=Je(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:1041}})),n.CursorUp=Je(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),n.CursorUpSelect=Je(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),n.CursorPageUp=Je(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:11}})),n.CursorPageUpSelect=Je(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:1035}})),n.CursorDown=Je(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),n.CursorDownSelect=Je(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),n.CursorPageDown=Je(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:12}})),n.CursorPageDownSelect=Je(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:1036}})),n.CreateCursor=Je(new class extends _i{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(S,w){if(!w.position)return;let y;w.wholeLine?y=On.line(S,S.getPrimaryCursorState(),!1,w.position,w.viewPosition):y=On.moveTo(S,S.getPrimaryCursorState(),!1,w.position,w.viewPosition);let x=S.getCursorStates();if(x.length>1){let k=y.modelState?y.modelState.position:null,T=y.viewState?y.viewState.position:null;for(let N=0,M=x.length;NT&&(k=T);let N=new P(k,1,k,S.model.getLineMaxColumn(k)),M=0;if(y.at)switch(y.at){case Um.RawAtArgument.Top:M=3;break;case Um.RawAtArgument.Center:M=1;break;case Um.RawAtArgument.Bottom:M=4;break;default:break}let W=S.coordinatesConverter.convertModelRangeToViewRange(N);S.revealRange(w.source,!1,W,M,0)}}),n.SelectAll=new class extends yb{constructor(){super(d3)}runDOMCommand(S){wn&&(S.focus(),S.select()),S.ownerDocument.execCommand("selectAll")}runEditorCommand(S,w,y){let x=w._getViewModel();x&&this.runCoreEditorCommand(x,y)}runCoreEditorCommand(S,w){S.model.pushStackElement(),S.setCursorStates("keyboard",3,[On.selectAll(S,S.getPrimaryCursorState())])}},n.SetSelection=Je(new class extends _i{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(S,w){w.selection&&(S.model.pushStackElement(),S.setCursorStates(w.source,3,[mt.fromModelSelection(w.selection)]))}})})(ln||(ln={}));var zG=Dt.and(_e.textInputFocus,_e.columnSelection);function Km(n,e){Cl.registerKeybindingRule({id:n,primary:e,when:zG,weight:Et+1})}Km(ln.CursorColumnSelectLeft.id,1039);Km(ln.CursorColumnSelectRight.id,1041);Km(ln.CursorColumnSelectUp.id,1040);Km(ln.CursorColumnSelectPageUp.id,1035);Km(ln.CursorColumnSelectDown.id,1042);Km(ln.CursorColumnSelectPageDown.id,1036);function bW(n){return n.register(),n}var vW;(function(n){class e extends yl{runEditorCommand(i,o,s){let r=o._getViewModel();r&&this.runCoreEditingCommand(o,r,s||{})}}n.CoreEditingCommand=e,n.LineBreakInsert=Je(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:_e.writable,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,o){t.pushUndoStop(),t.executeCommands(this.id,ta.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(s=>s.modelState.selection)))}}),n.Outdent=Je(new class extends e{constructor(){super({id:"outdent",precondition:_e.writable,kbOpts:{weight:Et,kbExpr:Dt.and(_e.editorTextFocus,_e.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,o){t.pushUndoStop(),t.executeCommands(this.id,ta.outdent(i.cursorConfig,i.model,i.getCursorStates().map(s=>s.modelState.selection))),t.pushUndoStop()}}),n.Tab=Je(new class extends e{constructor(){super({id:"tab",precondition:_e.writable,kbOpts:{weight:Et,kbExpr:Dt.and(_e.editorTextFocus,_e.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,o){t.pushUndoStop(),t.executeCommands(this.id,ta.tab(i.cursorConfig,i.model,i.getCursorStates().map(s=>s.modelState.selection))),t.pushUndoStop()}}),n.DeleteLeft=Je(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,o){let[s,r]=zc.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());s&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(2)}}),n.DeleteRight=Je(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:Et,kbExpr:_e.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,o){let[s,r]=zc.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));s&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(3)}}),n.Undo=new class extends yb{constructor(){super(_N)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,i,o){if(!(!i.hasModel()||i.getOption(91)===!0))return i.getModel().undo()}},n.Redo=new class extends yb{constructor(){super(bN)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,o){if(!(!i.hasModel()||i.getOption(91)===!0))return i.getModel().redo()}}})(vW||(vW={}));var Tx=class extends wu{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){let i=e.get(Zt).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}};function hf(n,e){bW(new Tx("default:"+n,n)),bW(new Tx(n,n,e))}hf("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});hf("replacePreviousChar");hf("compositionType");hf("compositionStart");hf("compositionEnd");hf("paste");hf("cut");ft();Lt();var Nx=class{constructor(e,t,i,o){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=o}paste(e,t,i,o){this.commandDelegate.paste(e,t,i,o)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,o){this.commandDelegate.compositionType(e,t,i,o)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){ln.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){let t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):o?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){ln.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){ln.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),ln.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),ln.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){ln.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){ln.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){ln.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){ln.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){ln.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){ln.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){ln.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){ln.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){ln.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}};_();v();b();_();v();b();xt();xu();var Sb=class{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){let t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new St("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;let i=this.getStartLineNumber(),o=this.getEndLineNumber();if(to)return null;let s=0,r=0;for(let l=i;l<=o;l++){let c=l-this._rendLineNumberStart;e<=l&&l<=t&&(r===0?(s=c,r=1):r++)}if(e=o&&a<=s&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),r=!0);return r}onLinesInserted(e,t){if(this.getCount()===0)return null;let i=t-e+1,o=this.getStartLineNumber(),s=this.getEndLineNumber();if(e<=o)return this._rendLineNumberStart+=i,null;if(e>s)return null;if(i+e>s)return this._lines.splice(e-this._rendLineNumberStart,s-e+1);let r=[];for(let h=0;hi)continue;let l=Math.max(t,a.fromLineNumber),c=Math.min(i,a.toLineNumber);for(let d=l;d<=c;d++){let h=d-this._rendLineNumberStart;this._lines[h].onTokensChanged(),o=!0}}return o}},$m=class{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new Sb(()=>this._host.createVisibleLine())}_createDomNode(){let e=$e(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(145)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){let t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,o=t.length;it){let r=t,a=Math.min(i,s.rendLineNumberStart-1);r<=a&&(this._insertLinesBefore(s,r,a,o,t),s.linesLength+=a-r+1)}else if(s.rendLineNumberStart0&&(this._removeLinesBefore(s,r),s.linesLength-=r)}if(s.rendLineNumberStart=t,s.rendLineNumberStart+s.linesLength-1i){let r=Math.max(0,i-s.rendLineNumberStart+1),l=s.linesLength-1-r+1;l>0&&(this._removeLinesAfter(s,l),s.linesLength-=l)}return this._finishRendering(s,!1,o),s}_renderUntouchedLines(e,t,i,o,s){let r=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=i;l++){let c=r+l;a[l].layoutLine(c,o[c-s],this.viewportData.lineHeight)}}_insertLinesBefore(e,t,i,o,s){let r=[],a=0;for(let l=t;l<=i;l++)r[a++]=this.host.createVisibleLine();e.lines=r.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;a--){let l=e.lines[a];o[a]&&(l.setDomNode(r),r=r.previousSibling)}}_finishRenderingInvalidLines(e,t,i){let o=document.createElement("div");n._ttPolicy&&(t=n._ttPolicy.createHTML(t)),o.innerHTML=t;for(let s=0;sn});xb._sb=new Sl(1e5);var Ax=class extends hi{constructor(e){super(e),this._visibleLines=new $m(this),this.domNode=this._visibleLines.domNode;let i=this._context.configuration.options.get(50);Si(this.domNode,i),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;ei.shouldRender());for(let i=0,o=t.length;i'),s.appendString(r),s.appendString(""),!0)}layoutLine(e,t,i){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(i))}},Mx=class extends Ax{constructor(e){super(e);let i=this._context.configuration.options.get(145);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){let i=this._context.configuration.options.get(145);return this._contentWidth=i.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}},Rx=class extends Ax{constructor(e){super(e);let t=this._context.configuration.options,i=t.get(145);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Si(this.domNode,t.get(50))}onConfigurationChanged(e){let t=this._context.configuration.options;Si(this.domNode,t.get(50));let i=t.get(145);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);let t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}};_();v();b();ft();var qm=class n{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){var t;(t=this.onKeyDown)===null||t===void 0||t.call(this,e)}emitKeyUp(e){var t;(t=this.onKeyUp)===null||t===void 0||t.call(this,e)}emitContextMenu(e){var t;(t=this.onContextMenu)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;(t=this.onMouseMove)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;(t=this.onMouseLeave)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;(t=this.onMouseDown)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;(t=this.onMouseUp)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;(t=this.onMouseDrag)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;(t=this.onMouseDrop)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;(e=this.onMouseDropCanceled)===null||e===void 0||e.call(this)}emitMouseWheel(e){var t;(t=this.onMouseWheel)===null||t===void 0||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return n.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){let i={...e};return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),(i.type===5||i.type===8)&&(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new U(e.afterLineNumber,1)).lineNumber}}};_();v();b();var Px=class extends hi{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=$e(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1,i=this._context.configuration.options.get(145),o=i.contentWidth-i.verticalScrollbarWidth;this.contentWidth!==o&&(this.contentWidth=o,e=!0);let s=i.contentLeft;return this.contentLeft!==s&&(this.contentLeft=s,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){var t;let i=0,o=e.getDecorationsInViewport();for(let s of o){if(!s.options.blockClassName)continue;let r=this.blocks[i];r||(r=this.blocks[i]=$e(document.createElement("div")),this.domNode.appendChild(r));let a,l;s.options.blockIsAfterEnd?(a=e.getVerticalOffsetAfterLineNumber(s.range.endLineNumber,!1),l=e.getVerticalOffsetAfterLineNumber(s.range.endLineNumber,!0)):(a=e.getVerticalOffsetForLineNumber(s.range.startLineNumber,!0),l=s.range.isEmpty()&&!s.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(s.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(s.range.endLineNumber,!0));let[c,d,h,u]=(t=s.options.blockPadding)!==null&&t!==void 0?t:[0,0,0,0];r.setClassName("blockDecorations-block "+s.options.blockClassName),r.setLeft(this.contentLeft-u),r.setWidth(this.contentWidth+u+d),r.setTop(a-e.scrollTop-c),r.setHeight(l-a+c+h),i++}for(let s=i;s0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,o){let s=e.top,r=s,a=e.top+e.height,l=o.viewportHeight-a,c=s-i,d=r>=i,h=a,u=l>=i,f=e.left;return f+t>o.scrollLeft+o.viewportWidth&&(f=o.scrollLeft+o.viewportWidth-t),fc){let f=u-(c-o);u-=f,i-=f}if(u=S,x=f+i<=g.height-w;return this._fixedOverflowWidgets?{fitsAbove:y,aboveTop:Math.max(u,S),fitsBelow:x,belowTop:f,left:C}:{fitsAbove:y,aboveTop:a,fitsBelow:x,belowTop:l,left:m}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new ff(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,i;let o=a(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),s=((t=this._secondaryAnchor.viewPosition)===null||t===void 0?void 0:t.lineNumber)===((i=this._primaryAnchor.viewPosition)===null||i===void 0?void 0:i.lineNumber)?this._secondaryAnchor.viewPosition:null,r=a(s,this._affinity,this._lineHeight);return{primary:o,secondary:r};function a(l,c,d){if(!l)return null;let h=e.visibleRangeForPosition(l);if(!h)return null;let u=l.column===1&&c===3?0:h.left,f=e.getVerticalOffsetForLineNumber(l.lineNumber)-e.scrollTop;return new Fx(f,u,d)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;let o=this._context.configuration.options.get(50),s=t.left;return se.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&TM(this._actual.afterRender,this._actual,null);return}this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),typeof this._actual.afterRender=="function"&&TM(this._actual.afterRender,this._actual,this._renderData.position)}},uf=class{constructor(e,t){this.modelPosition=e,this.viewPosition=t}},ff=class{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}},Fx=class{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}};function TM(n,e,...t){try{return n.call(e,...t)}catch{return null}}_();v();b();$a();wt();Qi();Kn();ch();ft();var Bx=class extends ns{constructor(e){super(),this._context=e;let t=this._context.configuration.options,i=t.get(145);this._renderLineHighlight=t.get(96),this._renderLineHighlightOnlyWhenFocus=t.get(97),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new nt(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1,t=new Set;for(let s of this._selections)t.add(s.positionLineNumber);let i=Array.from(t);i.sort((s,r)=>s-r),Ht(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);let o=this._selections.every(s=>s.isEmpty());return this._selectionIsEmpty!==o&&(this._selectionIsEmpty=o,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){let t=this._context.configuration.options,i=t.get(145);return this._renderLineHighlight=t.get(96),this._renderLineHighlightOnlyWhenFocus=t.get(97),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,o=[];for(let r=t;r<=i;r++){let a=r-t;o[a]=""}if(this._wordWrap){let r=this._renderOne(e,!1);for(let a of this._cursorLineNumbers){let l=this._context.viewModel.coordinatesConverter,c=l.convertViewPositionToModelPosition(new U(a,1)).lineNumber,d=l.convertModelPositionToViewPosition(new U(c,1)).lineNumber,h=l.convertModelPositionToViewPosition(new U(c,this._context.viewModel.model.getLineMaxColumn(c))).lineNumber,u=Math.max(d,t),f=Math.min(h,i);for(let g=u;g<=f;g++){let m=g-t;o[m]=r}}}let s=this._renderOne(e,!0);for(let r of this._cursorLineNumbers){if(ri)continue;let a=r-t;o[a]=s}this._renderData=o}render(e,t){if(!this._renderData)return"";let i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}},Wx=class extends Bx{_renderOne(e,t){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}},zx=class extends Bx{_renderOne(e,t){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}};Lo((n,e)=>{let t=n.getColor(vM);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||n.defines(CM)){let i=n.getColor(CM);i&&(e.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${i}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${i}; }`),Ol(n.type)&&(e.addRule(".monaco-editor .view-overlays .current-line-exact { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }")))}});_();v();b();Ke();var Vx=class extends ns{constructor(e){super(),this._context=e;let t=this._context.configuration.options;this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){let t=e.getDecorationsInViewport(),i=[],o=0;for(let l=0,c=t.length;l{if(l.options.zIndexc.options.zIndex)return 1;let d=l.options.className,h=c.options.className;return dh?1:P.compareRangesUsingStarts(l.range,c.range)});let s=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=[];for(let l=s;l<=r;l++){let c=l-s;a[c]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){let o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let r=0,a=t.length;r',d=Math.max(l.range.startLineNumber,o),h=Math.min(l.range.endLineNumber,s);for(let u=d;u<=h;u++){let f=u-o;i[f]+=c}}}_renderNormalDecorations(e,t,i){var o;let s=e.visibleRange.startLineNumber,r=null,a=!1,l=null,c=!1;for(let d=0,h=t.length;d';a[u]+=S}}}render(e,t){if(!this._renderResult)return"";let i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}};_();v();b();ke();Qi();var Hx=class extends hi{constructor(e,t,i,o){super(e);let s=this._context.configuration.options,r=s.get(103),a=s.get(75),l=s.get(40),c=s.get(106),d={listenOnDomNode:i.domNode,className:"editor-scrollable "+mb(e.theme.type),useShadows:!1,lazyRender:!0,vertical:r.vertical,horizontal:r.horizontal,verticalHasArrows:r.verticalHasArrows,horizontalHasArrows:r.horizontalHasArrows,verticalScrollbarSize:r.verticalScrollbarSize,verticalSliderSize:r.verticalSliderSize,horizontalScrollbarSize:r.horizontalScrollbarSize,horizontalSliderSize:r.horizontalSliderSize,handleMouseWheel:r.handleMouseWheel,alwaysConsumeMouseWheel:r.alwaysConsumeMouseWheel,arrowSize:r.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:l,scrollPredominantAxis:c,scrollByPage:r.scrollByPage};this.scrollbar=this._register(new Bl(t.domNode,d,this._context.viewLayout.getScrollable())),Mn.write(this.scrollbar.getDomNode(),6),this.scrollbarDomNode=$e(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();let h=(u,f,g)=>{let m={};if(f){let C=u.scrollTop;C&&(m.scrollTop=this._context.viewLayout.getCurrentScrollTop()+C,u.scrollTop=0)}if(g){let C=u.scrollLeft;C&&(m.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+C,u.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(m,1)};this._register($(i.domNode,"scroll",u=>h(i.domNode,!0,!0))),this._register($(t.domNode,"scroll",u=>h(t.domNode,!0,!1))),this._register($(o.domNode,"scroll",u=>h(o.domNode,!0,!1))),this._register($(this.scrollbarDomNode.domNode,"scroll",u=>h(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){let e=this._context.configuration.options,t=e.get(145);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(73).side==="right"?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(103)||e.hasChanged(75)||e.hasChanged(40)){let t=this._context.configuration.options,i=t.get(103),o=t.get(75),s=t.get(40),r=t.get(106),a={vertical:i.vertical,horizontal:i.horizontal,verticalScrollbarSize:i.verticalScrollbarSize,horizontalScrollbarSize:i.horizontalScrollbarSize,scrollByPage:i.scrollByPage,handleMouseWheel:i.handleMouseWheel,mouseWheelScrollSensitivity:o,fastScrollSensitivity:s,scrollPredominantAxis:r};this.scrollbar.updateOptions(a)}return e.hasChanged(145)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+mb(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}};_();v();b();wt();ft();Ke();hr();var gf=class{constructor(e,t,i,o,s){this.startLineNumber=e,this.endLineNumber=t,this.className=i,this.tooltip=o,this._decorationToRenderBrand=void 0,this.zIndex=s??0}},AM=class{constructor(e,t,i){this.className=e,this.zIndex=t,this.tooltip=i}},MM=class{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}},jm=class extends ns{_render(e,t,i){let o=[];for(let a=e;a<=t;a++){let l=a-e;o[l]=new MM}if(i.length===0)return o;i.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.classNameo)continue;let c=Math.max(a,i),d=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new U(c,0)),h=this._context.viewModel.glyphLanes.getLanesAtLine(d.lineNumber).indexOf(s.preference.lane);t.push(new PM(c,h,s.preference.zIndex,s))}}_collectSortedGlyphRenderRequests(e){let t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((i,o)=>i.lineNumber===o.lineNumber?i.laneIndex===o.laneIndex?i.zIndex===o.zIndex?o.type===i.type?i.type===0&&o.type===0?i.className0;){let o=t.peek();if(!o)break;let s=t.takeWhile(a=>a.lineNumber===o.lineNumber&&a.laneIndex===o.laneIndex);if(!s||s.length===0)break;let r=s[0];if(r.type===0){let a=[];for(let l of s){if(l.zIndex!==r.zIndex||l.type!==r.type)break;(a.length===0||a[a.length-1]!==l.className)&&a.push(l.className)}i.push(r.accept(a.join(" ")))}else r.widget.renderInfo={lineNumber:r.lineNumber,laneIndex:r.laneIndex}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(let i of Object.values(this._widgets))i.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){let i=this._managedDomNodes.pop();i?.domNode.remove()}return}let t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(let i of Object.values(this._widgets))if(!i.renderInfo)i.domNode.setDisplay("none");else{let o=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],s=this._glyphMarginLeft+i.renderInfo.laneIndex*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(o),i.domNode.setLeft(s),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}for(let i=0;ithis._decorationGlyphsToRender.length;){let i=this._managedDomNodes.pop();i?.domNode.remove()}}},RM=class{constructor(e,t,i,o){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.className=o,this.type=0}accept(e){return new OM(this.lineNumber,this.laneIndex,e)}},PM=class{constructor(e,t,i,o){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.widget=o,this.type=1}},OM=class{constructor(e,t,i){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=i}};_();v();b();$a();Qi();ft();wt();xi();BM();Kx();var qx=class extends ns{constructor(e){super(),this._context=e,this._primaryPosition=null;let t=this._context.configuration.options,i=t.get(146),o=t.get(50);this._spaceWidth=o.spaceWidth,this._maxIndentLeft=i.wrappingColumn===-1?-1:i.wrappingColumn*o.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(16),this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options,i=t.get(146),o=t.get(50);return this._spaceWidth=o.spaceWidth,this._maxIndentLeft=i.wrappingColumn===-1?-1:i.wrappingColumn*o.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(16),!0}onCursorStateChanged(e){var t;let o=e.selections[0].getPosition();return!((t=this._primaryPosition)===null||t===void 0)&&t.equals(o)?!1:(this._primaryPosition=o,!0)}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onLanguageConfigurationChanged(e){return!0}prepareRender(e){var t,i,o,s;if(!this._bracketPairGuideOptions.indentation&&this._bracketPairGuideOptions.bracketPairs===!1){this._renderResult=null;return}let r=e.visibleRange.startLineNumber,a=e.visibleRange.endLineNumber,l=e.scrollWidth,c=this._primaryPosition,d=this.getGuidesByLine(r,Math.min(a+1,this._context.viewModel.getLineCount()),c),h=[];for(let u=r;u<=a;u++){let f=u-r,g=d[f],m="",C=(i=(t=e.visibleRangeForPosition(new U(u,1)))===null||t===void 0?void 0:t.left)!==null&&i!==void 0?i:0;for(let S of g){let w=S.column===-1?C+(S.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new U(u,S.column)).left;if(w>l||this._maxIndentLeft>0&&w>this._maxIndentLeft)break;let y=S.horizontalLine?S.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",x=S.horizontalLine?((s=(o=e.visibleRangeForPosition(new U(u,S.horizontalLine.endColumn)))===null||o===void 0?void 0:o.left)!==null&&s!==void 0?s:w+this._spaceWidth)-w:this._spaceWidth;m+=`
`}h[f]=m}this._renderResult=h}getGuidesByLine(e,t,i){let o=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?Vc.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?Vc.EnabledForActive:Vc.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,s=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null,r=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&i){let h=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);r=h.startLineNumber,a=h.endLineNumber,l=h.indent}let{indentSize:c}=this._context.viewModel.model.getOptions(),d=[];for(let h=e;h<=t;h++){let u=new Array;d.push(u);let f=o?o[h-e]:[],g=new mo(f),m=s?s[h-e]:0;for(let C=1;C<=m;C++){let S=(C-1)*c+1,w=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&r<=h&&h<=a&&C===l;u.push(...g.takeWhile(x=>x.visibleColumn!0)||[])}return d}render(e,t){if(!this._renderResult)return"";let i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}};function Zm(n){if(!(n&&n.isTransparent()))return n}Lo((n,e)=>{let t=[{bracketColor:mx,guideColor:J6,guideColorActive:sW},{bracketColor:px,guideColor:eW,guideColorActive:rW},{bracketColor:_x,guideColor:tW,guideColorActive:aW},{bracketColor:bx,guideColor:iW,guideColorActive:lW},{bracketColor:vx,guideColor:nW,guideColorActive:cW},{bracketColor:Cx,guideColor:oW,guideColorActive:dW}],i=new Lb,o=[{indentColor:of,indentColorActive:sf},{indentColor:P6,indentColorActive:z6},{indentColor:O6,indentColorActive:V6},{indentColor:F6,indentColorActive:H6},{indentColor:B6,indentColorActive:U6},{indentColor:W6,indentColorActive:K6}],s=t.map(a=>{var l,c;let d=n.getColor(a.bracketColor),h=n.getColor(a.guideColor),u=n.getColor(a.guideColorActive),f=Zm((l=Zm(h))!==null&&l!==void 0?l:d?.transparent(.3)),g=Zm((c=Zm(u))!==null&&c!==void 0?c:d);if(!(!f||!g))return{guideColor:f,guideColorActive:g}}).filter(bc),r=o.map(a=>{let l=n.getColor(a.indentColor),c=n.getColor(a.indentColorActive),d=Zm(l),h=Zm(c);if(!(!d||!h))return{indentColor:d,indentColorActive:h}}).filter(bc);if(s.length>0){for(let a=0;a<30;a++){let l=s[a%s.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${l.guideColor}; --guide-color-active: ${l.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${i.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${i.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${i.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(r.length>0){for(let a=0;a<30;a++){let l=r[a%r.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${l.indentColor}; --indent-color-active: ${l.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});_();v();b();Gt();Lt();_();v();b();var Ym=class{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;let e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}};ft();Ke();var WM=class{constructor(){this._currentVisibleRange=new P(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}},zM=class{constructor(e,t,i,o,s,r,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=o,this.startScrollTop=s,this.stopScrollTop=r,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}},VM=class{constructor(e,t,i,o,s){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=o,this.scrollType=s,this.type="selections";let r=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,c=t.length;l{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new di(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new WM,this._horizontalRevealRequest=null,this._stickyScrollEnabled=o.get(115).enabled,this._maxNumberStickyLines=o.get(115).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new Jr(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(146)&&(this._maxLineWidth=0);let t=this._context.configuration.options,i=t.get(50),o=t.get(146);return this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=o.isViewportWrapping,this._revealHorizontalRightPadding=t.get(100),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(115).enabled,this._maxNumberStickyLines=t.get(115).maxLineCount,Si(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(145)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){let e=this._context.configuration,t=new ub(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;let i=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();for(let s=i;s<=o;s++)this._visibleLines.getVisibleLine(s).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){let t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber(),o=!1;for(let s=t;s<=i;s++)o=this._visibleLines.getVisibleLine(s).onSelectionChanged()||o;return o}onDecorationsChanged(e){{let t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let o=t;o<=i;o++)this._visibleLines.getVisibleLine(o).onDecorationsChanged()}return!0}onFlushed(e){let t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){let t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(t===-1)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new zM(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new VM(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;let s=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,s),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){let t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopi)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){let i=this._getViewLineDomNode(e);if(i===null)return null;let o=this._getLineNumberFor(i);if(o===-1||o<1||o>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(o)===1)return new U(o,1);let s=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(or)return null;let a=this._visibleLines.getVisibleLine(o).getColumnOfNodeOffset(e,t),l=this._context.viewModel.getLineMinColumn(o);return ai)return-1;let o=new Ym(this.domNode.domNode,this._textRangeRestingSpot),s=this._visibleLines.getVisibleLine(e).getWidth(o);return this._updateLineWidthsSlowIfDomDidLayout(o),s}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;let i=e.endLineNumber,o=P.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!o)return null;let s=[],r=0,a=new Ym(this.domNode.domNode,this._textRangeRestingSpot),l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new U(o.startLineNumber,1)).lineNumber);let c=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let h=o.startLineNumber;h<=o.endLineNumber;h++){if(hd)continue;let u=h===o.startLineNumber?o.startColumn:1,f=h!==o.endLineNumber,g=f?this._context.viewModel.getLineMaxColumn(h):o.endColumn,m=this._visibleLines.getVisibleLine(h).getVisibleRangesForRange(h,u,g,a);if(m){if(t&&hthis._visibleLines.getEndLineNumber())return null;let o=new Ym(this.domNode.domNode,this._textRangeRestingSpot),s=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,o);return this._updateLineWidthsSlowIfDomDidLayout(o),s}visibleRangeForPosition(e){let t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new $S(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){let t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber(),o=1,s=!0;for(let r=t;r<=i;r++){let a=this._visibleLines.getVisibleLine(r);if(e&&!a.getWidthIsFast()){s=!1;continue}o=Math.max(o,a.getWidth(null))}return s&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(o),s}_checkMonospaceFontAssumptions(){let e=-1,t=-1,i=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();for(let s=i;s<=o;s++){let r=this._visibleLines.getVisibleLine(s);if(r.needsMonospaceFontCheck()){let a=r.getWidth(null);a>t&&(t=a,e=s)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let s=i;s<=o;s++)this._visibleLines.getVisibleLine(s).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){let i=this._horizontalRevealRequest;if(e.startLineNumber<=i.minLineNumber&&i.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();let o=this._computeScrollLeftToReveal(i);o&&(this._isViewportWrapping||this._ensureMaxLineWidth(o.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:o.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),mi&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){let i=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();for(let s=i;s<=o;s++)if(this._visibleLines.getVisibleLine(s).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");let t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){let t=Math.ceil(e);this._maxLineWidth0){let S=s[0].startLineNumber,w=s[0].endLineNumber;for(let y=1,x=s.length;yl){if(!d)return-1;C=h}else if(r===5||r===6)if(r===6&&a<=h&&u<=c)C=a;else{let S=Math.max(5*this._lineHeight,l*.2),w=h-S,y=u-l;C=Math.max(y,w)}else if(r===1||r===2)if(r===2&&a<=h&&u<=c)C=a;else{let S=(h+u)/2;C=Math.max(0,S-l/2)}else C=this._computeMinimumScrolling(a,c,h,u,r===3,r===4);return C}_computeScrollLeftToReveal(e){let t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(145),o=t.left,s=o+t.width-i.verticalScrollbarWidth,r=1073741824,a=0;if(e.type==="range"){let c=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!c)return null;for(let d of c.ranges)r=Math.min(r,Math.round(d.left)),a=Math.max(a,Math.round(d.left+d.width))}else for(let c of e.selections){if(c.startLineNumber!==c.endLineNumber)return null;let d=this._visibleRangesForLineRange(c.startLineNumber,c.startColumn,c.endColumn);if(!d)return null;for(let h of d.ranges)r=Math.min(r,Math.round(h.left)),a=Math.max(a,Math.round(h.left+h.width))}return e.minimalReveal||(r=Math.max(0,r-n.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-r>t.width?null:{scrollLeft:this._computeMinimumScrolling(o,s,r,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,i,o,s,r){e=e|0,t=t|0,i=i|0,o=o|0,s=!!s,r=!!r;let a=t-e;if(o-it)return Math.max(0,o-a)}else return i;return e}};kb.HORIZONTAL_EXTRA_PX=30;_();v();b();var jx=class extends jm{constructor(e){super(),this._context=e;let i=this._context.configuration.options.get(145);this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let i=this._context.configuration.options.get(145);return this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){var t,i;let o=e.getDecorationsInViewport(),s=[],r=0;for(let a=0,l=o.length;a',l=[];for(let c=t;c<=i;c++){let d=c-t,h=o[d].getDecorations(),u="";for(let f of h){let g='
';s[a]=c}this._renderResult=s}render(e,t){return this._renderResult?this._renderResult[t-e]:""}};_();v();b();ke();le();Lt();ot();Ke();_();v();b();var mr=class n{constructor(e,t,i,o){this._rgba8Brand=void 0,this.r=n._clamp(e),this.g=n._clamp(t),this.b=n._clamp(i),this.a=n._clamp(o)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:e|0}};mr.Empty=new mr(0,0,0,0);_();v();b();ye();le();Yo();var mf=class n extends H{static getInstance(){return this._INSTANCE||(this._INSTANCE=Ld(new n)),this._INSTANCE}constructor(){super(),this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(Bt.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){let e=Bt.getColorMap();if(!e){this._colors=[mr.Empty],this._backgroundIsLight=!0;return}this._colors=[mr.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}};mf._INSTANCE=null;is();Kn();_();v();b();_();v();b();_();v();b();var yW=(()=>{let n=[];for(let e=32;e<=126;e++)n.push(e);return n.push(65533),n})(),SW=(n,e)=>(n-=32,n<0||n>96?e<=2?(n+96)%96:95:n);F0();var Db=class n{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=n.soften(e,12/15),this.charDataLight=n.soften(e,50/60)}static soften(e,t){let i=new Uint8ClampedArray(e.length);for(let o=0,s=e.length;oe.width||i+g>e.height){console.warn("bad render request outside image data");return}let m=d?this.charDataLight:this.charDataNormal,C=SW(o,c),S=e.width*4,w=a.r,y=a.g,x=a.b,k=s.r-w,T=s.g-y,N=s.b-x,M=Math.max(r,l),W=e.data,j=C*u*f,G=i*S+t*4;for(let V=0;Ve.width||i+h>e.height){console.warn("bad render request outside image data");return}let u=e.width*4,f=.5*(s/255),g=r.r,m=r.g,C=r.b,S=o.r-g,w=o.g-m,y=o.b-C,x=g+S*f,k=m+w*f,T=C+y*f,N=Math.max(s,a),M=e.data,W=i*u+t*4;for(let j=0;j{let e=new Uint8ClampedArray(n.length/2);for(let t=0;t>1]=xW[n[t]]<<4|xW[n[t+1]]&15;return e},HM={1:wa(()=>LW("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:wa(()=>LW("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};F0();var Zx=class n{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return HM[e]?i=new Db(HM[e](),e):i=n.createFromSampleData(n.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){let t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=96*10,t.style.width=96*10+"px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let o=0;for(let s of yW)i.fillText(String.fromCharCode(s),o,16/2),o+=10;return i.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");let o=n._downsample(e,t);return new Db(o,t)}static _downsampleChar(e,t,i,o,s){let r=1*s,a=2*s,l=o,c=0;for(let d=0;d0){let c=255/l;for(let d=0;dZx.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=n._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=n._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){let i=e.getColor(gB);return i?new mr(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){let t=e.getColor(mB);return t?mr._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){let i=e.getColor(Zu);return i?new mr(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.sectionHeaderFontSize===e.sectionHeaderFontSize&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}},UM=class n{constructor(e,t,i,o,s,r,a,l,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=o,this.sliderTop=s,this.sliderHeight=r,this.topPaddingLineCount=a,this.startLineNumber=l,this.endLineNumber=c}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){let t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,o,s,r,a,l,c,d,h){let u=e.pixelRatio,f=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/f),m=e.lineHeight;if(e.minimapHeightIsEditorHeight){let T=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(T+=Math.max(0,s-e.lineHeight-e.paddingBottom));let N=Math.max(1,Math.floor(s*s/T)),M=Math.max(0,e.minimapHeight-N),W=M/(d-s),j=c*W,G=M>0,V=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),z=Math.floor(e.paddingTop/e.lineHeight);return new n(c,d,G,W,j,N,z,1,Math.min(a,V))}let C;if(r&&i!==a){let T=i-t+1;C=Math.floor(T*f/u)}else{let T=s/m;C=Math.floor(T*f/u)}let S=Math.floor(e.paddingTop/m),w=Math.floor(e.paddingBottom/m);if(e.scrollBeyondLastLine){let T=s/m;w=Math.max(w,T-1)}let y;if(w>0){let T=s/m;y=(S+a+w-T-1)*f/u}else y=Math.max(0,(S+a)*f/u-C);y=Math.min(e.minimapHeight-C,y);let x=y/(d-s),k=c*x;if(g>=S+a+w){let T=y>0;return new n(c,d,T,x,k,C,S,1,a)}else{let T;t>1?T=t+S:T=Math.max(1,c/m);let N,M=Math.max(1,Math.floor(T-k*u/f));Mc&&(M=Math.min(M,h.startLineNumber),N=Math.max(N,h.topPaddingLineCount)),h.scrollTop=e.paddingTop?G=(t-M+N+j)*f/u:G=c/e.paddingTop*(N+j)*f/u,new n(c,d,!0,x,G,C,N,M,W)}}},Xm=class{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}};Xm.INVALID=new Xm(-1);var Xx=class{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new Sb(()=>Xm.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;let i=this._renderedLines._get().lines;for(let o=0,s=i.length;o1){for(let S=0,w=o-1;S0&&this.minimapLines[i-1]>=e;)i--;let o=this.modelLineToMinimapLine(t)-1;for(;o+1t)return null}return[i+1,o+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),o=this.modelLineToMinimapLine(t);return e!==t&&o===i&&(o===this.minimapLines.length?i>1&&i--:o++),[i,o]}onLinesDeleted(e){let t=e.toLineNumber-e.fromLineNumber+1,i=this.minimapLines.length,o=0;for(let s=this.minimapLines.length-1;s>=0&&!(this.minimapLines[s]=0&&!(this.minimapLines[i]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(o)}_recreateLineSampling(){this._minimapSelections=null;let e=!!this._samplingState,[t,i]=Qx.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(let o of i)switch(o.type){case"deleted":this._actual.onLinesDeleted(o.deleteFromLineNumber,o.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(o.insertFromLineNumber,o.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){let o=[];for(let s=0,r=t-e+1;s{var s;return!(!((s=o.options.minimap)===null||s===void 0)&&s.sectionHeaderStyle)});if(this._samplingState){let o=[];for(let s of i){if(!s.options.minimap)continue;let r=s.range,a=this._samplingState.modelLineToMinimapLine(r.startLineNumber),l=this._samplingState.modelLineToMinimapLine(r.endLineNumber);o.push(new mm(new P(a,r.startColumn,l,r.endColumn),s.options))}return o}return i}getSectionHeaderDecorationsInViewport(e,t){let i=this.options.minimapLineHeight,s=this.options.sectionHeaderFontSize/i;return e=Math.floor(Math.max(1,e-s)),this._getMinimapDecorationsInViewport(e,t).filter(r=>{var a;return!!(!((a=r.options.minimap)===null||a===void 0)&&a.sectionHeaderStyle)})}_getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){let o=this._samplingState.minimapLines[e-1],s=this._samplingState.minimapLines[t-1];i=new P(o,1,s,this._context.viewModel.getLineMaxColumn(s))}else i=new P(e,1,t,this._context.viewModel.getLineMaxColumn(t));return this._context.viewModel.getMinimapDecorationsInRange(i)}getSectionHeaderText(e,t){var i;let o=(i=e.options.minimap)===null||i===void 0?void 0:i.sectionHeaderText;if(!o)return null;let s=this._sectionHeaderCache.get(o);if(s)return s;let r=t(o);return this._sectionHeaderCache.set(o,r),r}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new P(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}},$M=class n extends H{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(jA),this._domNode=$e(document.createElement("div")),Mn.write(this._domNode,9),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=$e(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=$e(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=$e(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=$e(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=$e(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=Ut(this._domNode.domNode,se.POINTER_DOWN,i=>{if(i.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.button===0&&this._lastRenderData){let c=Sn(this._slider.domNode),d=c.top+c.height/2;this._startSliderDragging(i,d,this._lastRenderData.renderedLayout)}return}let s=this._model.options.minimapLineHeight,r=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.offsetY,l=Math.floor(r/s)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderPointerMoveMonitor=new Rl,this._sliderPointerDownListener=Ut(this._slider.domNode,se.POINTER_DOWN,i=>{i.preventDefault(),i.stopPropagation(),i.button===0&&this._lastRenderData&&this._startSliderDragging(i,i.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=ui.addTarget(this._domNode.domNode),this._sliderTouchStartListener=$(this._domNode.domNode,It.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=$(this._domNode.domNode,It.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=Ut(this._domNode.domNode,It.End,i=>{i.preventDefault(),i.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,i){if(!e.target||!(e.target instanceof Element))return;let o=e.pageX;this._slider.toggleClassName("active",!0);let s=(r,a)=>{let l=Sn(this._domNode.domNode),c=Math.min(Math.abs(a-o),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(Li&&c>VG){this._model.setScrollTop(i.scrollTop);return}let d=r-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(d))};e.pageY!==t&&s(e.pageY,o),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>s(r.pageY,r.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){let t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){let e=["minimap"];return this._model.options.showSlider==="always"?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide&&e.push("autohide"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new KM(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return this._lastRenderData?this._lastRenderData.onLinesChanged(e,t):!1}onLinesDeleted(e,t){var i;return(i=this._lastRenderData)===null||i===void 0||i.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var i;return(i=this._lastRenderData)===null||i===void 0||i.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(jA),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===0){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");let i=UM.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(i.sliderNeeded?"block":"none"),this._slider.setTop(i.sliderTop),this._slider.setHeight(i.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(i.sliderHeight),this.renderDecorations(i),this._lastRenderData=this.renderLines(i)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;let t=this._model.getSelections();t.sort(P.compareRangesUsingStarts);let i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((u,f)=>(u.options.zIndex||0)-(f.options.zIndex||0));let{canvasInnerWidth:o,canvasInnerHeight:s}=this._model.options,r=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,o,s);let d=new eL(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,d,e,r),this._renderDecorationsLineHighlights(c,i,d,e,r);let h=new eL(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,h,e,r,l,a,o),this._renderDecorationsHighlights(c,i,h,e,r,l,a,o),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,i,o,s){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let r=0,a=0;for(let l of t){let c=o.intersectWithViewport(l);if(!c)continue;let[d,h]=c;for(let g=d;g<=h;g++)i.set(g,!0);let u=o.getYForLineNumber(d,s),f=o.getYForLineNumber(h,s);a>=u||(a>r&&e.fillRect(va,r,e.canvas.width,a-r),r=u),a=f}a>r&&e.fillRect(va,r,e.canvas.width,a-r)}_renderDecorationsLineHighlights(e,t,i,o,s){let r=new Map;for(let a=t.length-1;a>=0;a--){let l=t[a],c=l.options.minimap;if(!c||c.position!==1)continue;let d=o.intersectWithViewport(l.range);if(!d)continue;let[h,u]=d,f=c.getColor(this._theme.value);if(!f||f.isTransparent())continue;let g=r.get(f.toString());g||(g=f.transparent(.5).toString(),r.set(f.toString(),g)),e.fillStyle=g;for(let m=h;m<=u;m++){if(i.has(m))continue;i.set(m,!0);let C=o.getYForLineNumber(h,s);e.fillRect(va,C,e.canvas.width,s)}}}_renderSelectionsHighlights(e,t,i,o,s,r,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(let c of t){let d=o.intersectWithViewport(c);if(!d)continue;let[h,u]=d;for(let f=h;f<=u;f++)this.renderDecorationOnLine(e,i,c,this._selectionColor,o,f,s,s,r,a,l)}}_renderDecorationsHighlights(e,t,i,o,s,r,a,l){for(let c of t){let d=c.options.minimap;if(!d)continue;let h=o.intersectWithViewport(c.range);if(!h)continue;let[u,f]=h,g=d.getColor(this._theme.value);if(!(!g||g.isTransparent()))for(let m=u;m<=f;m++)switch(d.position){case 1:this.renderDecorationOnLine(e,i,c.range,g,o,m,s,s,r,a,l);continue;case 2:{let C=o.getYForLineNumber(m,s),S=2;this.renderDecoration(e,g,S,C,HG,s);continue}}}}renderDecorationOnLine(e,t,i,o,s,r,a,l,c,d,h){let u=s.getYForLineNumber(r,l);if(u+a<0||u>this._model.options.canvasInnerHeight)return;let{startLineNumber:f,endLineNumber:g}=i,m=f===r?i.startColumn:1,C=g===r?i.endColumn:this._model.getLineMaxColumn(r),S=this.getXOffsetForPosition(t,r,m,c,d,h),w=this.getXOffsetForPosition(t,r,C,c,d,h);this.renderDecoration(e,o,S,u,w-S,a)}getXOffsetForPosition(e,t,i,o,s,r){if(i===1)return va;if((i-1)*s>=r)return r;let l=e.get(t);if(!l){let c=this._model.getLineContent(t);l=[va];let d=va;for(let h=1;h=r){l[h]=r;break}l[h]=g,d=g}e.set(t,l)}return i-1m.range.startLineNumber-C.range.startLineNumber);let g=n._fitSectionHeader.bind(null,u,r-va);for(let m of f){let C=e.getYForLineNumber(m.range.startLineNumber,i)+o,S=C-o,w=S+2,y=this._model.getSectionHeaderText(m,g);n._renderSectionLabel(u,y,((t=m.options.minimap)===null||t===void 0?void 0:t.sectionHeaderStyle)===2,l,d,r,S,s,C,w)}}static _fitSectionHeader(e,t,i){if(!i)return i;let o="\u2026",s=e.measureText(i).width,r=e.measureText(o).width;if(s<=t||s<=r)return i;let a=i.length,l=s/i.length,c=Math.floor((t-r)/l)-1,d=Math.ceil(c/2);for(;d>0&&/\s/.test(i[d-1]);)--d;return i.substring(0,d)+o+i.substring(a-(c-d))}static _renderSectionLabel(e,t,i,o,s,r,a,l,c,d){t&&(e.fillStyle=o,e.fillRect(0,a,r,l),e.fillStyle=s,e.fillText(t,va,c)),i&&(e.beginPath(),e.moveTo(0,d),e.lineTo(r,d),e.closePath(),e.stroke())}renderLines(e){let t=e.startLineNumber,i=e.endLineNumber,o=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){let ee=this._lastRenderData._get();return new Xx(e,ee.imageData,ee.lines)}let s=this._getBuffer();if(!s)return null;let[r,a,l]=n._renderUntouchedLines(s,e.topPaddingLineCount,t,i,o,this._lastRenderData),c=this._model.getMinimapLinesRenderingData(t,i,l),d=this._model.getOptions().tabSize,h=this._model.options.defaultBackgroundColor,u=this._model.options.backgroundColor,f=this._model.options.foregroundAlpha,g=this._model.tokensColorTracker,m=g.backgroundIsLight(),C=this._model.options.renderMinimap,S=this._model.options.charRenderer(),w=this._model.options.fontScale,y=this._model.options.minimapCharWidth,k=(C===1?2:3)*w,T=o>k?Math.floor((o-k)/2):0,N=u.a/255,M=new mr(Math.round((u.r-h.r)*N+h.r),Math.round((u.g-h.g)*N+h.g),Math.round((u.b-h.b)*N+h.b),255),W=e.topPaddingLineCount*o,j=[];for(let ee=0,ce=i-t+1;ee=0&&Gw)return;let V=C.charCodeAt(k);if(V===9){let z=u-(k+T)%u;T+=z-1,x+=z*r}else if(V===32)x+=r;else{let z=Ys(V)?2:1;for(let te=0;tew)return}}}}},eL=class{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let o=0,s=this._endLineNumber-this._startLineNumber+1;othis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}};_();v();b();ke();var tL=class extends hi{constructor(e,t){super(e),this._viewDomNode=t;let o=this._context.configuration.options.get(145);this._widgets={},this._verticalScrollbarWidth=o.verticalScrollbarWidth,this._minimapWidth=o.minimap.minimapWidth,this._horizontalScrollbarHeight=o.horizontalScrollbarHeight,this._editorHeight=o.height,this._editorWidth=o.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=$e(document.createElement("div")),Mn.write(this._domNode,4),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=$e(document.createElement("div")),Mn.write(this.overflowingOverlayWidgetsDomNode,5),this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){let i=this._context.configuration.options.get(145);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}addWidget(e){let t=$e(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),e.allowEditorOverflow?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){let i=this._widgets[e.getId()];return i.preference===t?(this._updateMaxMinWidth(),!1):(i.preference=t,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){let t=e.getId();if(this._widgets.hasOwnProperty(t)){let o=this._widgets[t].domNode.domNode;delete this._widgets[t],o.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,t;let i=0,o=Object.keys(this._widgets);for(let s=0,r=o.length;s=3){let s=Math.floor(o/3),r=Math.floor(o/3),a=o-s-r,l=e,c=l+s,d=l+s+a;return[[0,l,c,l,d,l,c,l],[0,s,a,s+a,r,s+a+r,a+r,s+a+r]]}else if(i===2){let s=Math.floor(o/2),r=o-s,a=e,l=a+s;return[[0,a,a,a,l,a,a,a],[0,s,s,s,r,s+r,s+r,s+r]]}else{let s=e,r=o;return[[0,s,s,s,s,s,s,s],[0,r,r,r,r,r,r,r]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColorSingle===e.cursorColorSingle&&this.cursorColorPrimary===e.cursorColorPrimary&&this.cursorColorSecondary===e.cursorColorSecondary&&this.themeType===e.themeType&&Z.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}},iL=class extends hi{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=$e(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=Bt.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[{position:new U(1,1),color:this._settings.cursorColorSingle}]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){let t=new qM(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}_markRenderingIsNeeded(){return this._actualShouldRender=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t1&&(o=t===0?this._settings.cursorColorPrimary:this._settings.cursorColorSecondary),this._cursorPositions.push({position:e.selections[t].getPosition(),color:o})}return this._cursorPositions.sort((t,i)=>U.compare(t.position,i.position)),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return e.affectsOverviewRuler?this._markRenderingIsMaybeNeeded():!1}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return e.scrollHeightChanged?this._markRenderingIsNeeded():!1}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=0}_render(){let e=this._settings.backgroundColor;if(this._settings.overviewRulerLanes===0){this._domNode.setBackgroundColor(e?Z.Format.CSS.formatHexA(e):""),this._domNode.setDisplay("none");return}let t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(Wu.compareByRenderingProps),this._actualShouldRender===1&&!Wu.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=2),this._actualShouldRender===1&&!Ht(this._renderedCursorPositions,this._cursorPositions,(g,m)=>g.position.lineNumber===m.position.lineNumber&&g.color===m.color)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");let i=this._settings.canvasWidth,o=this._settings.canvasHeight,s=this._settings.lineHeight,r=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),l=o/a,c=6*this._settings.pixelRatio|0,d=c/2|0,h=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(h.fillStyle=Z.Format.CSS.formatHexA(e),h.fillRect(0,0,i,o)):(h.clearRect(0,0,i,o),h.fillStyle=Z.Format.CSS.formatHexA(e),h.fillRect(0,0,i,o)):h.clearRect(0,0,i,o);let u=this._settings.x,f=this._settings.w;for(let g of t){let m=g.color,C=g.data;h.fillStyle=m;let S=0,w=0,y=0;for(let x=0,k=C.length/3;xo&&(V=o-d),W=V-d,j=V+d}W>y+1||T!==S?(x!==0&&h.fillRect(u[S],w,f[S],y-w),S=T,w=W,y=j):j>y&&(y=j)}h.fillRect(u[S],w,f[S],y-w)}if(!this._settings.hideCursor){let g=2*this._settings.pixelRatio|0,m=g/2|0,C=this._settings.x[7],S=this._settings.w[7],w=-100,y=-100,x=null;for(let k=0,T=this._cursorPositions.length;ko&&(W=o-m);let j=W-m,G=j+g;j>y+1||N!==x?(k!==0&&x&&h.fillRect(C,w,S,y-w),w=j,y=G):G>y&&(y=G),x=N,h.fillStyle=N}x&&h.fillRect(C,w,S,y-w)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(h.beginPath(),h.lineWidth=1,h.strokeStyle=this._settings.borderColor,h.moveTo(0,0),h.lineTo(0,o),h.stroke(),h.moveTo(0,0),h.lineTo(i,0),h.stroke())}};_();v();b();_();v();b();var nL=class{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=i|0}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}},Eb=class{constructor(e,t,i,o){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=o,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.colori&&(m=i-C);let S=d.color,w=this._color2Id[S];w||(w=++this._lastAssignedId,this._color2Id[S]=w,this._id2Color[w]=S);let y=new nL(m-C,m+C,w);d.setColorZone(y),a.push(y)}return this._colorZonesInvalid=!1,a.sort(nL.compare),a}};var sL=class extends Qr{constructor(e,t){super(),this._context=e;let i=this._context.configuration.options;this._domNode=$e(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new oL(o=>this._context.viewLayout.getVerticalOffsetForLineNumber(o)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(67)),this._zoneManager.setPixelRatio(i.get(143)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return e.hasChanged(67)&&(this._zoneManager.setLineHeight(t.get(67)),this._render()),e.hasChanged(143)&&(this._zoneManager.setPixelRatio(t.get(143)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(this._zoneManager.getOuterHeight()===0)return!1;let e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),o=this._zoneManager.getId2Color(),s=this._domNode.domNode.getContext("2d");return s.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(s,i,o,e),!0}_renderOneLane(e,t,i,o){let s=0,r=0,a=0;for(let l of t){let c=l.colorId,d=l.from,h=l.to;c!==s?(e.fillRect(0,r,o,a-r),s=c,e.fillStyle=i[s],r=d,a=h):a>=d?a=Math.max(a,h):(e.fillRect(0,r,o,a-r),r=d,a=h)}e.fillRect(0,r,o,a-r)}};_();v();b();var rL=class extends hi{constructor(e){super(e),this.domNode=$e(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];let t=this._context.configuration.options;this._rulers=t.get(102),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return this._rulers=t.get(102),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){let e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e0;){let a=$e(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(s),this.domNode.appendChild(a),this._renderedRulers.push(a),r--}return}let i=e-t;for(;i>0;){let o=this._renderedRulers.pop();this.domNode.removeChild(o),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){let t=this._context.configuration.options.get(145);t.minimap.renderMinimap===0||t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?this._width=t.width:this._width=t.width-t.verticalScrollbarWidth}onConfigurationChanged(e){let i=this._context.configuration.options.get(103);return this._useShadows=i.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}};_();v();b();is();Qi();var jM=class{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}},GM=class{constructor(e,t){this.lineNumber=e,this.ranges=t}};function UG(n){return new jM(n)}function KG(n){return new GM(n.lineNumber,n.ranges.map(UG))}var qa=class n extends ns{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;let t=this._context.configuration.options;this._roundedSelection=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return this._roundedSelection=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){let o=this._typicalHalfwidthCharacterWidth/4,s=null,r=null;if(i&&i.length>0&&t.length>0){let a=t[0].lineNumber;if(a===e.startLineNumber)for(let c=0;!s&&c=0;c--)i[c].lineNumber===l&&(r=i[c].ranges[0]);s&&!s.startStyle&&(s=null),r&&!r.startStyle&&(r=null)}for(let a=0,l=t.length;a0){let g=t[a-1].ranges[0].left,m=t[a-1].ranges[0].left+t[a-1].ranges[0].width;lL(d-g)g&&(u.top=1),lL(h-m)'}_actualRenderOneSelection(e,t,i,o){if(o.length===0)return;let s=!!o[0].ranges[0].startStyle,r=o[0].lineNumber,a=o[o.length-1].lineNumber;for(let l=0,c=o.length;l1,c)}this._previousFrameVisibleRangesWithStyle=s,this._renderResult=t.map(([r,a])=>r+a)}render(e,t){if(!this._renderResult)return"";let i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}};qa.SELECTION_CLASS_NAME="selected-text";qa.SELECTION_TOP_LEFT="top-left-radius";qa.SELECTION_BOTTOM_LEFT="bottom-left-radius";qa.SELECTION_TOP_RIGHT="top-right-radius";qa.SELECTION_BOTTOM_RIGHT="bottom-right-radius";qa.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";qa.ROUNDED_PIECE_WIDTH=10;Lo((n,e)=>{let t=n.getColor(X8);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function lL(n){return n<0?-n:n}_();v();b();Gt();_();v();b();ke();ot();ft();Ke();var cL=class{constructor(e,t,i,o,s,r,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=o,this.height=s,this.textContent=r,this.textContentClassName=a}},Hl;(function(n){n[n.Single=0]="Single",n[n.MultiPrimary=1]="MultiPrimary",n[n.MultiSecondary=2]="MultiSecondary"})(Hl||(Hl={}));var Ib=class{constructor(e,t){this._context=e;let i=this._context.configuration.options,o=i.get(50);this._cursorStyle=i.get(28),this._lineHeight=i.get(67),this._typicalHalfwidthCharacterWidth=o.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(i.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=$e(document.createElement("div")),this._domNode.setClassName(`cursor ${Bc}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Si(this._domNode,o),this._domNode.setDisplay("none"),this._position=new U(1,1),this._pluralityClass="",this.setPlurality(t),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}setPlurality(e){switch(e){default:case Hl.Single:this._pluralityClass="";break;case Hl.MultiPrimary:this._pluralityClass="cursor-primary";break;case Hl.MultiSecondary:this._pluralityClass="cursor-secondary";break}}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){let t=this._context.configuration.options,i=t.get(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),Si(this._domNode,i),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty="none":this._domNode.domNode.style.transitionProperty="",this._position=e,!0}_getGraphemeAwarePosition(){let{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[o,s]=d7(i,t-1);return[new U(e,o+1),i.substring(o,s)]}_prepareRender(e){let t="",i="",[o,s]=this._getGraphemeAwarePosition();if(this._cursorStyle===on.Line||this._cursorStyle===on.LineThin){let u=e.visibleRangeForPosition(o);if(!u||u.outsideRenderedLine)return null;let f=ge(this._domNode.domNode),g;this._cursorStyle===on.Line?(g=iN(f,this._lineCursorWidth>0?this._lineCursorWidth:2),g>2&&(t=s,i=this._getTokenClassName(o))):g=iN(f,1);let m=u.left,C=0;g>=2&&m>=1&&(C=1,m-=C);let S=e.getVerticalOffsetForLineNumber(o.lineNumber)-e.bigNumbersDelta;return new cL(S,m,C,g,this._lineHeight,t,i)}let r=e.linesVisibleRangesForRange(new P(o.lineNumber,o.column,o.lineNumber,o.column+s.length),!1);if(!r||r.length===0)return null;let a=r[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;let l=a.ranges[0],c=s===" "?this._typicalHalfwidthCharacterWidth:l.width<1?this._typicalHalfwidthCharacterWidth:l.width;this._cursorStyle===on.Block&&(t=s,i=this._getTokenClassName(o));let d=e.getVerticalOffsetForLineNumber(o.lineNumber)-e.bigNumbersDelta,h=this._lineHeight;return(this._cursorStyle===on.Underline||this._cursorStyle===on.UnderlineThin)&&(d+=this._lineHeight-2,h=2),new cL(d,l.left,0,c,h,t,i)}_getTokenClassName(e){let t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${this._pluralityClass} ${Bc} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}};$a();Qi();ch();ke();var Tb=class n extends hi{constructor(e){super(e);let t=this._context.configuration.options;this._readOnly=t.get(91),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new Ib(this._context,Hl.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=$e(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new Xo,this._cursorFlatBlinkInterval=new Bd,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){let t=this._context.configuration.options;this._readOnly=t.get(91),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,o=this._secondaryCursors.length;it.length){let s=this._secondaryCursors.length-t.length;for(let r=0;r{for(let o=0,s=e.ranges.length;o{this._isVisible?this._hide():this._show()},n.BLINK_INTERVAL,ge(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},n.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case on.Line:e+=" cursor-line-style";break;case on.Block:e+=" cursor-block-style";break;case on.Underline:e+=" cursor-underline-style";break;case on.LineThin:e+=" cursor-line-thin-style";break;case on.BlockOutline:e+=" cursor-block-outline-style";break;case on.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;case 5:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return(this._cursorSmoothCaretAnimation==="on"||this._cursorSmoothCaretAnimation==="explicit")&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{let t=[{class:".cursor",foreground:ea,background:Wl},{class:".cursor-primary",foreground:fx,background:A6},{class:".cursor-secondary",foreground:gx,background:M6}];for(let i of t){let o=n.getColor(i.foreground);if(o){let s=n.getColor(i.background);s||(s=o.opposite()),e.addRule(`.monaco-editor .cursors-layer ${i.class} { background-color: ${o}; border-color: ${o}; color: ${s}; }`),Ol(n.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection ${i.class} { border-left: 1px solid ${s}; border-right: 1px solid ${s}; }`)}}});_();v();b();xt();ft();var ZM=()=>{throw new Error("Invalid change accessor")},dL=class extends hi{constructor(e){super(e);let t=this._context.configuration.options,i=t.get(145);this._lineHeight=t.get(67),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=$e(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=$e(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){let e=this._context.viewLayout.getWhitespaces(),t=new Map;for(let o of e)t.set(o.id,o);let i=!1;return this._context.viewModel.changeWhitespace(o=>{let s=Object.keys(this._zones);for(let r=0,a=s.length;r{let o={addZone:s=>(t=!0,this._addZone(i,s)),removeZone:s=>{s&&(t=this._removeZone(i,s)||t)},layoutZone:s=>{s&&(t=this._layoutZone(i,s)||t)}};$G(e,o),o.addZone=ZM,o.removeZone=ZM,o.layoutZone=ZM}),t}_addZone(e,t){let i=this._computeWhitespaceProps(t),s={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:$e(t.domNode),marginDomNode:t.marginDomNode?$e(t.marginDomNode):null};return this._safeCallOnComputedHeight(s.delegate,i.heightInPx),s.domNode.setPosition("absolute"),s.domNode.domNode.style.width="100%",s.domNode.setDisplay("none"),s.domNode.setAttribute("monaco-view-zone",s.whitespaceId),this.domNode.appendChild(s.domNode),s.marginDomNode&&(s.marginDomNode.setPosition("absolute"),s.marginDomNode.domNode.style.width="100%",s.marginDomNode.setDisplay("none"),s.marginDomNode.setAttribute("monaco-view-zone",s.whitespaceId),this.marginDomNode.appendChild(s.marginDomNode)),this._zones[s.whitespaceId]=s,this.setShouldRender(),s.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){let i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){let i=this._zones[t],o=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=o.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,o.afterViewLineNumber,o.heightInPx),this._safeCallOnComputedHeight(i.delegate,o.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx=="number"?e.heightInPx:typeof e.heightInLines=="number"?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx=="number"?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight=="function")try{e.onComputedHeight(t)}catch(i){ut(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){ut(i)}}prepareRender(e){}render(e){let t=e.viewportData.whitespaceViewportData,i={},o=!1;for(let r of t)this._zones[r.id].isInHiddenArea||(i[r.id]=r,o=!0);let s=Object.keys(this._zones);for(let r=0,a=s.length;ra)continue;let f=u.startLineNumber===a?u.startColumn:c.minColumn,g=u.endLineNumber===a?u.endColumn:c.maxColumn;f=j.endOffset&&(W++,j=i&&i[W]),z!==9&&z!==32||u&&!T&&V<=M)continue;if(h&&V>=N&&V<=M&&z===32){let ee=V-1>=0?a.charCodeAt(V-1):0,ce=V+1=0?a.charCodeAt(V-1):0;if(z===32&&ee!==32&&ee!==9)continue}if(i&&(!j||j.startOffset>V||j.endOffset<=V))continue;let te=e.visibleRangeForPosition(new U(t,V+1));te&&(r?(G=Math.max(G,te.left),z===9?k+=this._renderArrow(f,C,te.left):k+=``):z===9?k+=`
${x?"\uFFEB":"\u2192"}
`:k+=`
${String.fromCharCode(y)}
`)}return r?(G=Math.round(G+C),``+k+""):k}_renderArrow(e,t,i){let o=t/7,s=t,r=e/2,a=i,l={x:0,y:o/2},c={x:100/125*s,y:l.y},d={x:c.x-.2*c.x,y:c.y+.2*c.x},h={x:d.x+.1*c.x,y:d.y+.1*c.x},u={x:h.x+.35*c.x,y:h.y-.35*c.x},f={x:u.x,y:-u.y},g={x:h.x,y:-h.y},m={x:d.x,y:-d.y},C={x:c.x,y:-c.y},S={x:l.x,y:-l.y};return``}render(e,t){if(!this._renderResult)return"";let i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}},uL=class{constructor(e){let t=e.options,i=t.get(50),o=t.get(38);o==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):o==="svg"?(this.renderWhitespace=t.get(99),this.renderWithSVG=!0):(this.renderWhitespace=t.get(99),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(67),this.stopRenderingLineAfter=t.get(117)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}};ft();Ke();Kn();hr();_();v();b();Ke();var fL=class{constructor(e,t,i,o){this.selections=e,this.startLineNumber=t.startLineNumber|0,this.endLineNumber=t.endLineNumber|0,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=t.bigNumbersDelta|0,this.lineHeight=t.lineHeight|0,this.whitespaceViewportData=i,this._model=o,this.visibleRange=new P(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}};_();v();b();_();v();b();var gL=class{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}};var mL=class{constructor(e,t,i){this.configuration=e,this.theme=new gL(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}};qe();Qi();var qG=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},jG=function(n,e){return function(t,i){e(t,i,n)}},pL=class extends Qr{constructor(e,t,i,o,s,r,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new nt(1,1,1,1)],this._renderAnimationFrame=null;let l=new Nx(t,o,s,e);this._context=new mL(t,i,o),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(wx,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=$e(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=$e(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=$e(document.createElement("div")),Mn.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new Hx(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new kb(this._context,this._linesContent),this._viewZones=new dL(this._context),this._viewParts.push(this._viewZones);let c=new iL(this._context);this._viewParts.push(c);let d=new aL(this._context);this._viewParts.push(d);let h=new Mx(this._context);this._viewParts.push(h),h.addDynamicOverlay(new Wx(this._context)),h.addDynamicOverlay(new qa(this._context)),h.addDynamicOverlay(new qx(this._context)),h.addDynamicOverlay(new Vx(this._context)),h.addDynamicOverlay(new hL(this._context));let u=new Rx(this._context);this._viewParts.push(u),u.addDynamicOverlay(new zx(this._context)),u.addDynamicOverlay(new Gx(this._context)),u.addDynamicOverlay(new jx(this._context)),u.addDynamicOverlay(new rf(this._context)),this._glyphMarginWidgets=new Ux(this._context),this._viewParts.push(this._glyphMarginWidgets);let f=new fh(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(u.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new Ox(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new Tb(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new tL(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);let g=new rL(this._context);this._viewParts.push(g);let m=new Px(this._context);this._viewParts.push(m);let C=new Jx(this._context);if(this._viewParts.push(C),c){let S=this._scrollbar.getOverviewRulerLayoutInfo();S.parent.insertBefore(c.getDomNode(),S.insertBefore)}this._linesContent.appendChild(h.getDomNode()),this._linesContent.appendChild(g.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(f.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(d.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(C.getDomNode()),this._overflowGuardContainer.appendChild(m.domNode),this.domNode.appendChild(this._overflowGuardContainer),r?(r.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),r.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new ax(this._context,l,this._createPointerHandlerHelper()))}_computeGlyphMarginLanes(){let e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes,i=[],o=0;i=i.concat(e.getAllMarginDecorations().map(s=>{var r,a,l;let c=(a=(r=s.options.glyphMargin)===null||r===void 0?void 0:r.position)!==null&&a!==void 0?a:dr.Center;return o=Math.max(o,s.range.endLineNumber),{range:s.range,lane:c,persist:(l=s.options.glyphMargin)===null||l===void 0?void 0:l.persistLane}})),i=i.concat(this._glyphMarginWidgets.getWidgets().map(s=>{let r=e.validateRange(s.preference.range);return o=Math.max(o,r.endLineNumber),{range:r,lane:s.preference.lane}})),i.sort((s,r)=>P.compareRangesUsingStarts(s.range,r.range)),t.reset(o);for(let s of i)t.push(s.lane,s.range,s.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{let e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new GS(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new U(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){let t=this._context.configuration.options.get(145);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(16777216),this._linesContent.setHeight(16777216)}_getEditorClassName(){let e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(142)+" "+mb(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(let e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){if(this._store.isDisposed)throw new St;if(this._renderAnimationFrame===null){let e=this._createCoordinatedRendering();this._renderAnimationFrame=Nb.INSTANCE.scheduleCoordinatedRendering({window:ge(this.domNode.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new St;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new St;return e.renderText()},prepareRender:(t,i)=>{if(this._store.isDisposed)throw new St;return e.prepareRender(t,i)},render:(t,i)=>{if(this._store.isDisposed)throw new St;return e.render(t,i)}})}}_flushAccumulatedAndRenderNow(){let e=this._createCoordinatedRendering();ph(()=>e.prepareRenderText());let t=ph(()=>e.renderText());if(t){let[i,o]=t;ph(()=>e.prepareRender(i,o)),ph(()=>e.render(i,o))}}_getViewPartsToRender(){let e=[],t=0;for(let i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;let e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}Ml.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return null;let t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);let i=new fL(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),[e,new US(this._context.viewLayout,i,this._viewLines)]},prepareRender:(e,t)=>{for(let i of e)i.prepareRender(t)},render:(e,t)=>{for(let i of e)i.render(t),i.onDidRender()}}}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){let i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),o=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();let s=this._viewLines.visibleRangeForPosition(new U(o.lineNumber,o.column));return s?s.left:-1}getTargetAtClientPoint(e,t){let i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?qm.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new sL(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(let i of this._viewParts)i.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){var t,i,o,s,r,a,l,c;this._contentWidgets.setWidgetPosition(e.widget,(i=(t=e.position)===null||t===void 0?void 0:t.position)!==null&&i!==void 0?i:null,(s=(o=e.position)===null||o===void 0?void 0:o.secondaryPosition)!==null&&s!==void 0?s:null,(a=(r=e.position)===null||r===void 0?void 0:r.preference)!==null&&a!==void 0?a:null,(c=(l=e.position)===null||l===void 0?void 0:l.positionAffinity)!==null&&c!==void 0?c:null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){let t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){let t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};pL=qG([jG(6,Ye)],pL);function ph(n){try{return n()}catch(e){return ut(e),null}}var Nb=class{constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{let t=this._coordinatedRenderings.indexOf(e);if(t!==-1&&(this._coordinatedRenderings.splice(t,1),this._coordinatedRenderings.length===0)){for(let[i,o]of this._animationFrameRunners)o.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){let t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,JT(e,t,100))}}_onRenderScheduled(){let e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(let i of e)ph(()=>i.prepareRenderText());let t=[];for(let i=0,o=e.length;is.renderText())}for(let i=0,o=e.length;is.prepareRender(a,l))}for(let i=0,o=e.length;is.render(a,l))}}};Nb.INSTANCE=new Nb;_();v();b();ot();xi();xu();_();v();b();Na();ft();hr();var Uc=class{constructor(e,t,i,o,s){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=o,this.wrappedTextIndentLength=s}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){let t=e>0?this.breakOffsets[e-1]:0,o=this.breakOffsets[e]-t;return e>0&&(o+=this.wrappedTextIndentLength),o}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let o=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let s=0;sthis.injectionOffsets[s];s++)o0?this.breakOffsets[s-1]:0,t===0)if(e<=r)o=s-1;else if(e>l)i=s+1;else break;else if(e=l)i=s+1;else break}let a=e-r;return s>0&&(a+=this.wrappedTextIndentLength),new Qm(s,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){let o=this.outputPositionToOffsetInInputWithInjections(e,t),s=this.normalizeOffsetInInputWithInjectionsAroundInjections(o,i);if(s!==o)return this.offsetInInputWithInjectionsToOutputPosition(s,i)}if(i===0){if(e>0&&t===this.getMinOutputOffset(e))return new Qm(e-1,this.getMaxOutputOffset(e-1))}else if(i===1){let o=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){let i=this.getInjectedTextAtOffset(e);if(!i)return e;if(t===2){if(e===i.offsetInInputWithInjections+i.length&&DW(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let o=i.offsetInInputWithInjections;if(EW(this.injectionOptions[i.injectedTextIndex].cursorStops))return o;let s=i.injectedTextIndex-1;for(;s>=0&&this.injectionOffsets[s]===this.injectionOffsets[i.injectedTextIndex]&&!(DW(this.injectionOptions[s].cursorStops)||(o-=this.injectionOptions[s].content.length,EW(this.injectionOptions[s].cursorStops)));)s--;return o}}else if(t===1||t===4){let o=i.offsetInInputWithInjections+i.length,s=i.injectedTextIndex;for(;s+1=0&&this.injectionOffsets[s-1]===this.injectionOffsets[s];)o-=this.injectionOptions[s-1].content.length,s--;return o}$g(t)}getInjectedText(e,t){let i=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.getInjectedTextAtOffset(i);return o?{options:this.injectionOptions[o.injectedTextIndex]}:null}getInjectedTextAtOffset(e){let t=this.injectionOffsets,i=this.injectionOptions;if(t!==null){let o=0;for(let s=0;se)break;if(e<=l)return{injectedTextIndex:s,offsetInInputWithInjections:a,length:r};o+=r}}}};function DW(n){return n==null?!0:n===Nu.Right||n===Nu.Both}function EW(n){return n==null?!0:n===Nu.Left||n===Nu.Both}var Qm=class{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new U(e+this.outputLineIndex,this.outputOffset+1)}};bh();var YM=Bs("domLineBreaksComputer",{createHTML:n=>n}),wL=class n{static create(e){return new n(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,o,s){let r=[],a=[];return{addRequest:(l,c,d)=>{r.push(l),a.push(c)},finalize:()=>ZG(G1(this.targetWindow.deref()),r,e,t,i,o,s,a)}}};function ZG(n,e,t,i,o,s,r,a){var l;function c(j){let G=a[j];if(G){let V=Ls.applyInjectedText(e[j],G),z=G.map(ee=>ee.options),te=G.map(ee=>ee.column-1);return new Uc(te,z,[V.length],[],0)}else return null}if(o===-1){let j=[];for(let G=0,V=e.length;Gd?(V=0,z=0):te=d-Ce}let ee=G.substr(V),ce=YG(ee,z,i,te,m,f);C[j]=V,S[j]=z,w[j]=ee,y[j]=ce[0],x[j]=ce[1]}let k=m.build(),T=(l=YM?.createHTML(k))!==null&&l!==void 0?l:k;g.innerHTML=T,g.style.position="absolute",g.style.top="10000",r==="keepAll"?(g.style.wordBreak="keep-all",g.style.overflowWrap="anywhere"):(g.style.wordBreak="inherit",g.style.overflowWrap="break-word"),n.document.body.appendChild(g);let N=document.createRange(),M=Array.prototype.slice.call(g.children,0),W=[];for(let j=0;jPe.options),Se=pe.map(Pe=>Pe.column-1)):(Ce=null,Se=null),W[j]=new Uc(Se,Ce,V,ce,te)}return n.document.body.removeChild(g),W}function YG(n,e,t,i,o,s){if(s!==0){let u=String(s);o.appendString('
');let r=n.length,a=e,l=0,c=[],d=[],h=0");for(let u=0;u"),c[u]=l,d[u]=a;let f=h;h=u+1"),c[n.length]=l,d[n.length]=a,o.appendString("
"),[c,d]}function XG(n,e,t,i){if(t.length<=1)return null;let o=Array.prototype.slice.call(e.children,0),s=[];try{QM(n,o,i,0,null,t.length-1,null,s)}catch(r){return console.log(r),null}return s.length===0?null:(s.push(t.length),s)}function QM(n,e,t,i,o,s,r,a){if(i===s||(o=o||XM(n,e,t[i],t[i+1]),r=r||XM(n,e,t[s],t[s+1]),Math.abs(o[0].top-r[0].top)<=.1))return;if(i+1===s){a.push(s);return}let l=i+(s-i)/2|0,c=XM(n,e,t[l],t[l+1]);QM(n,e,t,i,o,l,c,a),QM(n,e,t,l,c,s,r,a)}function XM(n,e,t,i){return n.setStart(e[t/16384|0].firstChild,t%16384),n.setEnd(e[i/16384|0].firstChild,i%16384),n.getClientRects()}_();v();b();ke();xt();le();var yL=class extends H{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new xd),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(let o of t){if(this._pending.has(o.id)){ut(new Error(`Cannot have two contributions with the same id ${o.id}`));continue}this._pending.set(o.id,o)}this._instantiateSome(0),this._register(m0(ge(this._editor.getDomNode()),()=>{this._instantiateSome(1)})),this._register(m0(ge(this._editor.getDomNode()),()=>{this._instantiateSome(2)})),this._register(m0(ge(this._editor.getDomNode()),()=>{this._instantiateSome(3)},5e3))}saveViewState(){let e={};for(let[t,i]of this._instances)typeof i.saveViewState=="function"&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(let[t,i]of this._instances)typeof i.restoreViewState=="function"&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){var e;return m0(ge((e=this._editor)===null||e===void 0?void 0:e.getDomNode()),()=>{this._instantiateSome(1)},50)}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;let t=this._findPendingContributionsByInstantiation(e);for(let i of t)this._instantiateById(i.id)}_findPendingContributionsByInstantiation(e){let t=[];for(let[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){let t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{let i=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,i),typeof i.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){ut(i)}}}};Ka();$a();ft();Ke();Kn();_();v();b();var ep=class{constructor(e,t,i,o,s,r,a){this.id=e,this.label=t,this.alias=i,this.metadata=o,this._precondition=s,this._run=r,this._contextKeyService=a}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}};wb();lr();sv();Ou();_();v();b();ot();Gy();bh();var tk=class n{static create(e){return new n(e.get(134),e.get(133))}constructor(e,t){this.classifier=new n4(e,t)}createLineBreaksComputer(e,t,i,o,s){let r=[],a=[],l=[];return{addRequest:(c,d,h)=>{r.push(c),a.push(d),l.push(h)},finalize:()=>{let c=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,d=[];for(let h=0,u=r.length;h=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}},o4=[],s4=[];function kZ(n,e,t,i,o,s,r,a){if(o===-1)return null;let l=t.length;if(l<=1)return null;let c=a==="keepAll",d=e.breakOffsets,h=e.breakOffsetsVisibleColumn,u=Dz(t,i,o,s,r),f=o-u,g=o4,m=s4,C=0,S=0,w=0,y=o,x=d.length,k=0;if(k>=0){let T=Math.abs(h[k]-y);for(;k+1=T)break;T=N,k++}}for(;kT&&(T=S,N=w);let M=0,W=0,j=0,G=0;if(N<=y){let z=N,te=T===0?0:t.charCodeAt(T-1),ee=T===0?0:n.get(te),ce=!0;for(let Ce=T;CeS&&r4(te,ee,pe,Pe,c)&&(M=Se,W=z),z+=Qe,z>y){Se>S?(j=Se,G=z-Qe):(j=Ce+1,G=z),z-W>f&&(M=0),ce=!1;break}te=pe,ee=Pe}if(ce){C>0&&(g[C]=d[d.length-1],m[C]=h[d.length-1],C++);break}}if(M===0){let z=N,te=t.charCodeAt(T),ee=n.get(te),ce=!1;for(let Ce=T-1;Ce>=S;Ce--){let Se=Ce+1,pe=t.charCodeAt(Ce);if(pe===9){ce=!0;break}let Pe,Qe;if(Rd(pe)?(Ce--,Pe=0,Qe=2):(Pe=n.get(pe),Qe=Ys(pe)?s:1),z<=y){if(j===0&&(j=Se,G=z),z<=y-f)break;if(r4(pe,Pe,te,ee,c)){M=Se,W=z;break}}z-=Qe,te=pe,ee=Pe}if(M!==0){let Ce=f-(G-W);if(Ce<=i){let Se=t.charCodeAt(j),pe;pi(Se)?pe=2:pe=rv(Se,G,i,s),Ce-pe<0&&(M=0)}}if(ce){k--;continue}}if(M===0&&(M=j,W=G),M<=S){let z=t.charCodeAt(S);pi(z)?(M=S+2,W=w+2):(M=S+1,W=w+rv(z,w,i,s))}for(S=M,g[C]=M,w=W,m[C]=W,C++,y=W+f;k<0||k=V)break;V=z,k++}}return C===0?null:(g.length=C,m.length=C,o4=e.breakOffsets,s4=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=m,e.wrappedTextIndentLength=u,e)}function DZ(n,e,t,i,o,s,r,a){let l=Ls.applyInjectedText(e,t),c,d;if(t&&t.length>0?(c=t.map(W=>W.options),d=t.map(W=>W.column-1)):(c=null,d=null),o===-1)return c?new Uc(d,c,[l.length],[],0):null;let h=l.length;if(h<=1)return c?new Uc(d,c,[l.length],[],0):null;let u=a==="keepAll",f=Dz(l,i,o,s,r),g=o-f,m=[],C=[],S=0,w=0,y=0,x=o,k=l.charCodeAt(0),T=n.get(k),N=rv(k,0,i,s),M=1;pi(k)&&(N+=1,k=l.charCodeAt(1),T=n.get(k),M++);for(let W=M;Wx&&((w===0||N-y>g)&&(w=j,y=N-z),m[S]=w,C[S]=y,S++,x=y+g,w=0),k=G,T=V}return S===0&&(!t||t.length===0)?null:(m[S]=h,C[S]=N,new Uc(d,c,m,C,f))}function rv(n,e,t,i){return n===9?t-e%t:Ys(n)||n<32?i:1}function kz(n,e){return e-n%e}function r4(n,e,t,i,o){return t!==32&&(e===2&&i!==2||e!==1&&i===1||!o&&e===3&&i!==2||!o&&i===3&&e!==1)}function Dz(n,e,t,i,o){let s=0;if(o!==0){let r=Ri(n);if(r!==-1){for(let l=0;lt&&(s=0)}}return s}_();v();b();wt();Gt();gn();le();Lt();ot();_();v();b();xt();ot();_();v();b();wt();Dl();_();v();b();ft();Ke();Kn();var av=class n{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Ji(new P(1,1,1,1),0,0,new U(1,1),0),new Ji(new P(1,1,1,1),0,0,new U(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new mt(this.modelState,this.viewState)}readSelectionFromMarkers(e){let t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?nt.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):nt.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,o){return t.equals(i)?o:e.normalizePosition(t,2)}static _validateViewState(e,t){let i=t.position,o=t.selectionStart.getStartPosition(),s=t.selectionStart.getEndPosition(),r=e.normalizePosition(i,2),a=this._validatePositionWithCache(e,o,i,r),l=this._validatePositionWithCache(e,s,o,a);return i.equals(r)&&o.equals(a)&&s.equals(l)?t:new Ji(P.fromPositions(a,l),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+o.column-a.column,r,t.leftoverVisibleColumns+i.column-r.column)}_setState(e,t,i){if(i&&(i=n._validateViewState(e.viewModel,i)),t){let o=e.model.validateRange(t.selectionStart),s=t.selectionStart.equalsRange(o)?t.selectionStartLeftoverVisibleColumns:0,r=e.model.validatePosition(t.position),a=t.position.equals(r)?t.leftoverVisibleColumns:0;t=new Ji(o,t.selectionStartKind,s,r,a)}else{if(!i)return;let o=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),s=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new Ji(o,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,s,i.leftoverVisibleColumns)}if(i){let o=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),s=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new Ji(o,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,s,t.leftoverVisibleColumns)}else{let o=e.coordinatesConverter.convertModelPositionToViewPosition(new U(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),s=e.coordinatesConverter.convertModelPositionToViewPosition(new U(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new P(o.lineNumber,o.column,s.lineNumber,s.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new Ji(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}};ft();Ke();Kn();var lv=class{constructor(e){this.context=e,this.cursors=[new av(e)],this.lastAddedCursorIndex=0}dispose(){for(let e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(let e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(let e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(let e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){return Z3(this.cursors,Io(e=>e.viewState.position,U.compare)).viewState.position}getBottomMostViewPosition(){return G3(this.cursors,Io(e=>e.viewState.position,U.compare)).viewState.position}getSelections(){return this.cursors.map(e=>e.modelState.selection)}getViewSelections(){return this.cursors.map(e=>e.viewState.selection)}setSelections(e){this.setStates(mt.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){e!==null&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){let t=this.cursors.length-1,i=e.length;if(ti){let o=t-i;for(let s=0;s=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(this.cursors.length===1)return;let e=this.cursors.slice(0),t=[];for(let i=0,o=e.length;ii.selection,P.compareRangesUsingStarts));for(let i=0;ih&&m.index--;e.splice(h,1),t.splice(d,1),this._removeSecondaryCursor(h-1),i--}}}};_();v();b();var cv=class{constructor(e,t,i,o){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=o}};Ke();Kn();bh();_();v();b();var ik=class{constructor(){this.type=0}},nk=class{constructor(){this.type=1}},ok=class{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}},sk=class{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}},Xl=class{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin,this.affectsLineNumber=e.affectsLineNumber):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0,this.affectsLineNumber=!0)}},yf=class{constructor(){this.type=5}},rk=class{constructor(e){this.type=6,this.isFocused=e}},ak=class{constructor(){this.type=7}},Sf=class{constructor(){this.type=8}},dv=class{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}},fp=class{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}},gp=class{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}},Yc=class{constructor(e,t,i,o,s,r,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=o,this.verticalType=s,this.revealHorizontal=r,this.scrollType=a,this.type=12}},lk=class{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}},ck=class{constructor(e){this.theme=e,this.type=14}},dk=class{constructor(e){this.type=15,this.ranges=e}},hk=class{constructor(){this.type=16}},uk=class{constructor(){this.type=17}};le();_();v();b();ye();le();var fk=class extends H{constructor(){super(),this._onEvent=this._register(new B),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t0;){if(this._collector||this._isConsumingViewEventQueue)return;let e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){let e=this._viewEventQueue;this._viewEventQueue=null;let t=this._eventHandlers.slice(0);for(let i of t)i.handleEvents(e)}}},a4=class{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}},gk=class n{constructor(e,t,i,o){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=o,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new n(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}},mk=class n{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new n(this.oldHasFocus,e.hasFocus)}},pk=class n{constructor(e,t,i,o,s,r,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=o,this.scrollWidth=s,this.scrollLeft=r,this.scrollHeight=a,this.scrollTop=l,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(e){return e.kind!==this.kind?null:new n(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}},_k=class{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}},bk=class{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}},vk=class n{constructor(e,t,i,o,s,r,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=o,this.source=s,this.reason=r,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;let i=e.length,o=t.length;if(i!==o)return!1;for(let s=0;s0){let e=this._cursors.getSelections();for(let t=0;tr&&(o=o.slice(0,r),s=!0);let a=hv.from(this._model,this);return this._cursors.setStates(o),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,s)}setCursorColumnSelectData(e){this._columnSelectData=e}revealAll(e,t,i,o,s,r){let a=this._cursors.getViewPositions(),l=null,c=null;a.length>1?c=this._cursors.getViewSelections():l=P.fromPositions(a[0],a[0]),e.emitViewEvent(new Yc(t,i,l,c,o,s,r))}revealPrimary(e,t,i,o,s,r){let l=[this._cursors.getPrimaryCursor().viewState.selection];e.emitViewEvent(new Yc(t,i,null,l,o,s,r))}saveState(){let e=[],t=this._cursors.getSelections();for(let i=0,o=t.length;i0){let s=mt.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,s)&&this.revealAll(e,"modelChange",!1,0,!0,0)}else{let s=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,mt.fromModelSelections(s))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;let e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,o){this.setStates(e,t,o,mt.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){let i=[],o=[];for(let a=0,l=e.length;a0&&this._pushAutoClosedAction(i,o),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,o,s){let r=hv.from(this._model,this);if(r.equals(o))return!1;let a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new sk(l,a,i)),!o||o.cursorState.length!==r.cursorState.length||r.cursorState.some((c,d)=>!c.modelState.equals(o.cursorState[d].modelState))){let c=o?o.cursorState.map(h=>h.modelState.selection):null,d=o?o.modelVersionId:0;e.emitOutgoingEvent(new vk(c,a,d,r.modelVersionId,t||"keyboard",i,s))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;let t=[];for(let i=0,o=e.length;i=0)return null;let r=s.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!r)return null;let a=r[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;let c=l[0].open,d=s.text.length-r[2].length-1,h=s.text.lastIndexOf(c,d-1);if(h===-1)return null;t.push([h,d])}return t}executeEdits(e,t,i,o){let s=null;t==="snippet"&&(s=this._findAutoClosingPairs(i)),s&&(i[0]._isTracked=!0);let r=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,c=>{if(s)for(let h=0,u=s.length;h0&&this._pushAutoClosedAction(r,a)}_executeEdit(e,t,i,o=0){if(this.context.cursorConfig.readOnly)return;let s=hv.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){ut(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,o,s,!1)&&this.revealAll(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return Ek.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new d4(this._model,this.getSelections())}endComposition(e,t){let i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(ta.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){let o=t.length,s=0;for(;s{let c=l.getPosition();return new nt(c.lineNumber,c.column+s,c.lineNumber,c.column+s)});this.setSelections(e,r,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(ta.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,o,s))},e,r)}paste(e,t,i,o,s){this._executeEdit(()=>{this._executeEditOperation(ta.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,o||[]))},e,s,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(zc.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Pn(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new Pn(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}},hv=class n{static from(e,t){return new n(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}},l4=class{static executeCommands(e,t,i){let o={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},s=this._innerExecuteCommands(o,i);for(let r=0,a=o.trackedRanges.length;r0&&(r[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,r,c=>{let d=[];for(let f=0;ff.identifier.minor-g.identifier.minor,u=[];for(let f=0;f0?(d[f].sort(h),u[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>d[f],getTrackedSelection:g=>{let m=parseInt(g,10),C=e.model._getTrackedRange(e.trackedRanges[m]);return e.trackedRangesDirection[m]===0?new nt(C.startLineNumber,C.startColumn,C.endLineNumber,C.endColumn):new nt(C.endLineNumber,C.endColumn,C.startLineNumber,C.startColumn)}})):u[f]=e.selectionsBefore[f];return u});a||(a=e.selectionsBefore);let l=[];for(let c in s)s.hasOwnProperty(c)&&l.push(parseInt(c,10));l.sort((c,d)=>d-c);for(let c of l)a.splice(c,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{P.isEmpty(h)&&u===""||o.push({identifier:{major:t,minor:s++},range:h,text:u,forceMoveMarkers:f,isAutoWhitespaceEdit:i.insertsAutoWhitespace})},a=!1,d={addEditOperation:r,addTrackedEditOperation:(h,u,f)=>{a=!0,r(h,u,f)},trackSelection:(h,u)=>{let f=nt.liftSelection(h),g;if(f.isEmpty())if(typeof u=="boolean")u?g=2:g=3;else{let S=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===S?g=2:g=3}else g=1;let m=e.trackedRanges.length,C=e.model._setTrackedRange(null,f,g);return e.trackedRanges[m]=C,e.trackedRangesDirection[m]=f.getDirection(),m.toString()}};try{i.getEditOperations(e.model,d)}catch(h){return ut(h),{operations:[],hadTrackedEditOperation:!1}}return{operations:o,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,o)=>-P.compareRangesUsingEnds(i.range,o.range));let t={};for(let i=1;is.identifier.major?r=o.identifier.major:r=s.identifier.major,t[r.toString()]=!0;for(let a=0;a0&&i--}}return t}},c4=class{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}},d4=class n{static _capture(e,t){let i=[];for(let o of t){if(o.startLineNumber!==o.endLineNumber)return null;i.push(new c4(e.getLineContent(o.startLineNumber),o.startColumn-1,o.endColumn-1))}return i}constructor(e,t){this._original=n._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;let i=n._capture(e,t);if(!i||this._original.length!==i.length)return null;let o=[];for(let s=0,r=this._original.length;seh,tokenizeEncoded:(n,e,t)=>hm(0,t)};async function Nz(n,e,t){if(!t)return Tz(e,n.languageIdCodec,Iz);let i=await Bt.getOrCreate(t);return Tz(e,n.languageIdCodec,i||Iz)}function Az(n,e,t,i,o,s,r){let a="
",l=i,c=0,d=!0;for(let h=0,u=e.getCount();h0;)r&&d?(g+=" ",d=!1):(g+=" ",d=!0),C--;break}case 60:g+="<",d=!1;break;case 62:g+=">",d=!1;break;case 38:g+="&",d=!1;break;case 0:g+="�",d=!1;break;case 65279:case 8232:case 8233:case 133:g+="\uFFFD",d=!1;break;case 13:g+="​",d=!1;break;case 32:r&&d?(g+=" ",d=!1):(g+=" ",d=!0);break;default:g+=String.fromCharCode(m),d=!1}}if(a+=`${g}`,f>o||l>=o)break}return a+="
",a}function Tz(n,e,t){let i='
',o=Tr(n),s=t.getInitialState();for(let r=0,a=o.length;r0&&(i+="
");let c=t.tokenizeEncoded(l,!0,s);Hi.convertToEndOffset(c.tokens,l.length);let h=new Hi(c.tokens,l,e).inflate(),u=0;for(let f=0,g=h.getCount();f${hu(l.substring(u,C))}`,u=C}s=c.endState}return i+="
",i}_();v();b();ye();le();_();v();b();ot();var h4=class{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;let t=this._inserts,i=this._changes,o=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,o)}},u4=class{constructor(e,t,i,o,s){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=o,this.minWidth=s,this.prefixSum=0}},uv=class n{constructor(e,t,i,o){this._instanceId=Cw(++n.INSTANCE_COUNT),this._pendingChanges=new h4,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=o}static findInsertionIndex(e,t,i){let o=0,s=e.length;for(;o>>1;t===e[r].afterLineNumber?i{t=!0,o=o|0,s=s|0,r=r|0,a=a|0;let l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new u4(l,o,s,r,a)),l},changeOneWhitespace:(o,s,r)=>{t=!0,s=s|0,r=r|0,this._pendingChanges.change({id:o,newAfterLineNumber:s,newHeight:r})},removeWhitespace:o=>{t=!0,this._pendingChanges.remove({id:o})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(let l of e)this._insertWhitespace(l);for(let l of t)this._changeOneWhitespace(l.id,l.newAfterLineNumber,l.newHeight);for(let l of i){let c=this._findWhitespaceIndex(l.id);c!==-1&&this._removeWhitespace(c)}return}let o=new Set;for(let l of i)o.add(l.id);let s=new Map;for(let l of t)s.set(l.id,l);let r=l=>{let c=[];for(let d of l)if(!o.has(d.id)){if(s.has(d.id)){let h=s.get(d.id);d.afterLineNumber=h.newAfterLineNumber,d.height=h.newHeight}c.push(d)}return c},a=r(this._arr).concat(r(e));a.sort((l,c)=>l.afterLineNumber===c.afterLineNumber?l.ordinal-c.ordinal:l.afterLineNumber-c.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){let t=n.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){let t=this._arr;for(let i=0,o=t.length;it&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let i=0,o=this._arr.length;i=t.length||t[a+1].afterLineNumber>=e)return a;i=a+1|0}else o=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;let i=this._findLastWhitespaceBeforeLineNumber(e)+1;return i1?i=this._lineHeight*(e-1):i=0;let o=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return i+o+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;let i=this._lineHeight*e,o=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return i+o+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,i=this._arr.length;tt}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;let t=this._lineCount|0,i=this._lineHeight,o=1,s=t;for(;o=a+i)o=r+1;else{if(e>=a)return r;s=r}}return o>t?t:o}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;let i=this._lineHeight,o=this.getLineNumberAtOrAfterVerticalOffset(e)|0,s=this.getVerticalOffsetForLineNumber(o)|0,r=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(o)|0,l=this.getWhitespacesCount()|0,c,d;a===-1?(a=l,d=r+1,c=0):(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);let h=s,u=h,f=5e5,g=0;s>=f&&(g=Math.floor(s/f)*f,g=Math.floor(g/i)*i,u-=g);let m=[],C=e+(t-e)/2,S=-1;for(let k=o;k<=r;k++){if(S===-1){let T=h,N=h+i;(T<=C&&CC)&&(S=k)}for(h+=i,m[k-o]=u,u+=i;d===k;)u+=c,h+=c,a++,a>=l?d=r+1:(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(h>=t){r=k;break}}S===-1&&(S=r);let w=this.getVerticalOffsetForLineNumber(r)|0,y=o,x=r;return yt&&x--,{bigNumbersDelta:g,startLineNumber:o,endLineNumber:r,relativeVerticalOffset:m,centeredLineNumber:S,completelyVisibleStartLineNumber:y,completelyVisibleEndLineNumber:x,lineHeight:this._lineHeight}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;let t=this.getAfterLineNumberForWhitespaceIndex(e),i;t>=1?i=this._lineHeight*t:i=0;let o;return e>0?o=this.getWhitespacesAccumulatedHeight(e-1):o=0,i+o+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;let o=this.getVerticalOffsetForWhitespaceIndex(i),s=this.getHeightForWhitespaceIndex(i);if(e>=o+s)return-1;for(;t=a+l)t=r+1;else{if(e>=a)return r;i=r}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;let t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;let i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;let o=this.getHeightForWhitespaceIndex(t),s=this.getIdForWhitespaceIndex(t),r=this.getAfterLineNumberForWhitespaceIndex(t);return{id:s,afterLineNumber:r,verticalOffset:i,height:o}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;let i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),o=this.getWhitespacesCount()-1;if(i<0)return[];let s=[];for(let r=i;r<=o;r++){let a=this.getVerticalOffsetForWhitespaceIndex(r),l=this.getHeightForWhitespaceIndex(r);if(a>=t)break;s.push({id:this.getIdForWhitespaceIndex(r),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(r),verticalOffset:a,height:l})}return s}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}};uv.INSTANCE_COUNT=0;var EZ=125,xf=class{constructor(e,t,i,o){e=e|0,t=t|0,i=i|0,o=o|0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),o<0&&(o=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=o,this.scrollHeight=Math.max(i,o)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}},f4=class extends H{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new B),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new xf(0,0,0,0),this._scrollable=this._register(new gr({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;let t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);let i=t.contentWidth!==e.contentWidth,o=t.contentHeight!==e.contentHeight;(i||o)&&this._onDidContentSizeChange.fire(new gk(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}},Ik=class extends H{constructor(e,t,i){super(),this._configuration=e;let o=this._configuration.options,s=o.get(145),r=o.get(84);this._linesLayout=new uv(t,o.get(67),r.top,r.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new f4(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new xf(s.contentWidth,0,s.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(114)?EZ:0)}onConfigurationChanged(e){let t=this._configuration.options;if(e.hasChanged(67)&&this._linesLayout.setLineHeight(t.get(67)),e.hasChanged(84)){let i=t.get(84);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(145)){let i=t.get(145),o=i.contentWidth,s=i.height,r=this._scrollable.getScrollDimensions(),a=r.contentWidth;this._scrollable.setScrollDimensions(new xf(o,r.contentWidth,s,this._getContentHeight(o,s,a)))}else this._updateHeight();e.hasChanged(114)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){let o=this._configuration.options.get(103);return o.horizontal===2||e>=t?0:o.horizontalScrollbarSize}_getContentHeight(e,t,i){let o=this._configuration.options,s=this._linesLayout.getLinesTotalHeight();return o.get(105)?s+=Math.max(0,t-o.get(67)-o.get(84).bottom):o.get(103).ignoreHorizontalScrollbarInContentHeight||(s+=this._getHorizontalScrollbarHeight(e,i)),s}_updateHeight(){let e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,o=e.contentWidth;this._scrollable.setScrollDimensions(new xf(t,e.contentWidth,i,this._getContentHeight(t,i,o)))}getCurrentViewport(){let e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new tb(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){let e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new tb(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){let e=this._configuration.options,t=this._maxLineWidth,i=e.get(146),o=e.get(50),s=e.get(145);if(i.isViewportWrapping){let r=e.get(73);return t>s.contentWidth+o.typicalHalfwidthCharacterWidth&&r.enabled&&r.side==="right"?t+s.verticalScrollbarWidth:t}else{let r=e.get(104)*o.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+r+s.verticalScrollbarWidth,a,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){let e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new xf(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){let e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),o=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-o,scrollLeft:e.scrollLeft}}changeWhitespace(e){let t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){let e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){let t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){let e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){t===1?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){let i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}};_();v();b();ft();Ke();var Tk=class{constructor(e,t,i,o,s){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=o,this._coordinatesConverter=s,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){let t=e.id,i=this._decorationsCache[t];if(!i){let o=e.range,s=e.options,r;if(s.isWholeLine){let a=this._coordinatesConverter.convertModelPositionToViewPosition(new U(o.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new U(o.endLineNumber,this.model.getLineMaxColumn(o.endLineNumber)),1);r=new P(a.lineNumber,a.column,l.lineNumber,l.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(o,1);i=new mm(r,s),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=this._cachedModelDecorationsResolver!==null;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,t=!1,i=!1){let o=new P(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(o,t,i).inlineDecorations[0]}_getDecorationsInRange(e,t,i){let o=this._linesCollection.getDecorationsInRange(e,this.editorId,nu(this.configuration.options),t,i),s=e.startLineNumber,r=e.endLineNumber,a=[],l=0,c=[];for(let d=s;d<=r;d++)c[d-s]=[];for(let d=0,h=o.length;dt===1)}function NZ(n,e){return Mz(n,e.range,t=>t===2)}function Mz(n,e,t){for(let i=e.startLineNumber;i<=e.endLineNumber;i++){let o=n.tokenization.getLineTokens(i),s=i===e.startLineNumber,r=i===e.endLineNumber,a=s?o.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(o.getStandardTokenType(a)))return!1;a++}}return!0}_();v();b();wt();ft();Ke();Kx();sv();bh();_();v();b();Pc();ft();bh();function Nk(n,e){return n===null?e?mp.INSTANCE:pp.INSTANCE:new m4(n,e)}var m4=class{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){this._assertVisible();let o=i>0?this._projectionData.breakOffsets[i-1]:0,s=this._projectionData.breakOffsets[i],r;if(this._projectionData.injectionOffsets!==null){let a=this._projectionData.injectionOffsets.map((c,d)=>new Ls(0,0,c+1,this._projectionData.injectionOptions[d],0));r=Ls.applyInjectedText(e.getLineContent(t),a).substring(o,s)}else r=e.getValueInRange({startLineNumber:t,startColumn:o+1,endLineNumber:t,endColumn:s+1});return i>0&&(r=Rz(this._projectionData.wrappedTextIndentLength)+r),r}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){let o=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],o),o[0]}getViewLinesData(e,t,i,o,s,r,a){this._assertVisible();let l=this._projectionData,c=l.injectionOffsets,d=l.injectionOptions,h=null;if(c){h=[];let f=0,g=0;for(let m=0;m0?l.breakOffsets[m-1]:0,w=l.breakOffsets[m];for(;gw)break;if(S0?l.wrappedTextIndentLength:0,M=N+Math.max(x-S,0),W=N+Math.min(k-S,w-S);M!==W&&C.push(new wS(M,W,T.inlineClassName,T.inlineClassNameAffectsLetterSpacing))}}if(k<=w)f+=y,g++;else break}}}let u;c?u=e.tokenization.getLineTokens(t).withInserted(c.map((f,g)=>({offset:f,text:d[g].content,tokenMetadata:Hi.defaultTokenMetadata}))):u=e.tokenization.getLineTokens(t);for(let f=i;f0?o.wrappedTextIndentLength:0,r=i>0?o.breakOffsets[i-1]:0,a=o.breakOffsets[i],l=e.sliceAndInflate(r,a,s),c=l.getLineContent();i>0&&(c=Rz(o.wrappedTextIndentLength)+c);let d=this._projectionData.getMinOutputOffset(i)+1,h=c.length+1,u=i+1=g4.length)for(let e=1;e<=n;e++)g4[e]=AZ(e);return g4[n]}function AZ(n){return new Array(n+1).join(" ")}var Ak=class{constructor(e,t,i,o,s,r,a,l,c,d){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=o,this.fontInfo=s,this.tabSize=r,this.wrappingStrategy=a,this.wrappingColumn=l,this.wrappingIndent=c,this.wordBreak=d,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new p4(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));let i=this.model.getLinesContent(),o=this.model.getInjectedTextDecorations(this._editorId),s=i.length,r=this.createLineBreaksComputer(),a=new mo(Ls.fromDecorations(o));for(let m=0;mS.lineNumber===m+1);r.addRequest(i[m],C,t?t[m]:null)}let l=r.finalize(),c=[],d=this.hiddenAreasDecorationIds.map(m=>this.model.getDecorationRange(m)).sort(P.compareRangesUsingStarts),h=1,u=0,f=-1,g=f+1=h&&C<=u,w=Nk(l[m],!S);c[m]=w.getViewLineCount(),this.modelLineProjections[m]=w}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new $y(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){let t=e.map(u=>this.model.validateRange(u)),i=MZ(t),o=this.hiddenAreasDecorationIds.map(u=>this.model.getDecorationRange(u)).sort(P.compareRangesUsingStarts);if(i.length===o.length){let u=!1;for(let f=0;f({range:u,options:qi.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,s);let r=i,a=1,l=0,c=-1,d=c+1=a&&f<=l?this.modelLineProjections[u].isVisible()&&(this.modelLineProjections[u]=this.modelLineProjections[u].setVisible(!1),g=!0):(h=!0,this.modelLineProjections[u].isVisible()||(this.modelLineProjections[u]=this.modelLineProjections[u].setVisible(!0),g=!0)),g){let m=this.modelLineProjections[u].getViewLineCount();this.projectedModelLineLineCounts.setValue(u,m)}}return h||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.modelLineProjections.length?!1:this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,o,s){let r=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===i,c=this.wrappingIndent===o,d=this.wordBreak===s;if(r&&a&&l&&c&&d)return!1;let h=r&&a&&!l&&c&&d;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=o,this.wordBreak=s;let u=null;if(h){u=[];for(let f=0,g=this.modelLineProjections.length;f2&&!this.modelLineProjections[t-2].isVisible(),r=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,a=0,l=[],c=[];for(let d=0,h=o.length;dl?(d=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,h=d+l-1,g=h+1,m=g+(s-l)-1,c=!0):st?t:e|0}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);let o=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),s=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),r=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.guides.getActiveIndentGuide(o.lineNumber,s.lineNumber,r.lineNumber),l=this.convertModelPositionToViewPosition(a.startLineNumber,1),c=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:l.lineNumber,endLineNumber:c.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);let t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,o=t.remainder;return new Mk(i+1,o)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){let t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),o=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new U(e.modelLineNumber,o)}getModelEndPositionOfViewLine(e){let t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),o=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new U(e.modelLineNumber,o)}getViewLineInfosGroupedByModelRanges(e,t){let i=this.getViewLineInfo(e),o=this.getViewLineInfo(t),s=new Array,r=this.getModelStartPositionOfViewLine(i),a=new Array;for(let l=i.modelLineNumber;l<=o.modelLineNumber;l++){let c=this.modelLineProjections[l-1];if(c.isVisible()){let d=l===i.modelLineNumber?i.modelLineWrappedLineIdx:0,h=l===o.modelLineNumber?o.modelLineWrappedLineIdx+1:c.getViewLineCount();for(let u=d;u{if(f.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesAfterColumn).lineNumber>=d.modelLineWrappedLineIdx||f.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesBeforeOrAtColumn).lineNumberd.modelLineWrappedLineIdx)return}let m=this.convertModelPositionToViewPosition(d.modelLineNumber,f.horizontalLine.endColumn),C=this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.horizontalLine.endColumn);return C.lineNumber===d.modelLineWrappedLineIdx?new ia(f.visibleColumn,g,f.className,new Hc(f.horizontalLine.top,m.column),-1,-1):C.lineNumber!!f))}}return r}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);let i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t)),s=[],r=[],a=[],l=i.lineNumber-1,c=o.lineNumber-1,d=null;for(let g=l;g<=c;g++){let m=this.modelLineProjections[g];if(m.isVisible()){let C=m.getViewLineNumberOfModelPosition(0,g===l?i.column:1),S=m.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),w=S-C+1,y=0;w>1&&m.getViewLineMinColumn(this.model,g+1,S)===1&&(y=C===0?1:2),r.push(w),a.push(y),d===null&&(d=new U(g+1,0))}else d!==null&&(s=s.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,g)),d=null)}d!==null&&(s=s.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,o.lineNumber)),d=null);let h=t-e+1,u=new Array(h),f=0;for(let g=0,m=s.length;gt&&(g=!0,f=t-s+1),h.getViewLinesData(this.model,c+1,u,f,s-e,i,l),s+=f,g)break}return l}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);let o=this.projectedModelLineLineCounts.getIndexOf(e-1),s=o.index,r=o.remainder,a=this.modelLineProjections[s],l=a.getViewLineMinColumn(this.model,s+1,r),c=a.getViewLineMaxColumn(this.model,s+1,r);tc&&(t=c);let d=a.getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new U(s+1,d)).equals(i)?new U(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){let i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),o=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new P(i.lineNumber,i.column,o.lineNumber,o.column)}convertViewPositionToModelPosition(e,t){let i=this.getViewLineInfo(e),o=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new U(i.modelLineNumber,o))}convertViewRangeToModelRange(e){let t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new P(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,o=!1,s=!1){let r=this.model.validatePosition(new U(e,t)),a=r.lineNumber,l=r.column,c=a-1,d=!1;if(s)for(;c0&&!this.modelLineProjections[c].isVisible();)c--,d=!0;if(c===0&&!this.modelLineProjections[c].isVisible())return new U(o?0:1,1);let h=1+this.projectedModelLineLineCounts.getPrefixSum(c),u;return d?s?u=this.modelLineProjections[c].getViewPositionOfModelPosition(h,1,i):u=this.modelLineProjections[c].getViewPositionOfModelPosition(h,this.model.getLineMaxColumn(c+1),i):u=this.modelLineProjections[a-1].getViewPositionOfModelPosition(h,l,i),u}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){let i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return P.fromPositions(i)}else{let i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),o=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new P(i.lineNumber,i.column,o.lineNumber,o.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){let s=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(s,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(i===0&&!this.modelLineProjections[i].isVisible())return 1;let o=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(o,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,o,s){let r=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-r.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new P(r.lineNumber,1,a.lineNumber,a.column),t,i,o,s);let l=[],c=r.lineNumber-1,d=a.lineNumber-1,h=null;for(let m=c;m<=d;m++)if(this.modelLineProjections[m].isVisible())h===null&&(h=new U(m+1,m===c?r.column:1));else if(h!==null){let S=this.model.getLineMaxColumn(m);l=l.concat(this.model.getDecorationsInRange(new P(h.lineNumber,h.column,m,S),t,i,o)),h=null}h!==null&&(l=l.concat(this.model.getDecorationsInRange(new P(h.lineNumber,h.column,a.lineNumber,a.column),t,i,o)),h=null),l.sort((m,C)=>{let S=P.compareRangesUsingStarts(m.range,C.range);return S===0?m.idC.id?1:0:S});let u=[],f=0,g=null;for(let m of l){let C=m.id;g!==C&&(g=C,u[f++]=m)}return u}getInjectedTextAt(e){let t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){let i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){let t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}};function MZ(n){if(n.length===0)return[];let e=n.slice();e.sort(P.compareRangesUsingStarts);let t=[],i=e[0].startLineNumber,o=e[0].endLineNumber;for(let s=1,r=e.length;so+1?(t.push(new P(i,1,o,1)),i=a.startLineNumber,o=a.endLineNumber):a.endLineNumber>o&&(o=a.endLineNumber)}return t.push(new P(i,1,o,1)),t}var Mk=class{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}},Rk=class{constructor(e,t){this.modelRange=e,this.viewLines=t}},p4=class{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t,i,o){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,o)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}},Pk=class{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new _4(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,o){return!1}createLineBreaksComputer(){let e=[];return{addRequest:(t,i,o)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new fp(t,i)}onModelLinesInserted(e,t,i,o){return new gp(t,i)}onModelLineChanged(e,t,i){return[!1,new dv(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){let i=t-e+1,o=new Array(i);for(let s=0;st)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}};_();v();b();hr();var Lf=dr.Right,Ok=class{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*Lf/8))}reset(e){let t=Math.ceil((e+1)*Lf/8);this.lanes.length>>3]|=1<>>3]&1<>>3]&1<this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=b4.create(this.model),this.glyphLanes=new Ok(0),RZ&&this.model.isTooLargeForTokenization())this._lines=new Pk(this.model);else{let d=this._configuration.options,h=d.get(50),u=d.get(139),f=d.get(146),g=d.get(138),m=d.get(129);this._lines=new Ak(this._editorId,this.model,o,s,h,this.model.getOptions().tabSize,u,f.wrappingColumn,g,m)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new Dk(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new Ik(this._configuration,this.getLineCount(),r)),this._register(this.viewLayout.onDidScroll(d=>{d.scrollTopChanged&&this._handleVisibleLinesChanged(),d.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new lk(d)),this._eventDispatcher.emitOutgoingEvent(new pk(d.oldScrollWidth,d.oldScrollLeft,d.oldScrollHeight,d.oldScrollTop,d.scrollWidth,d.scrollLeft,d.scrollHeight,d.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(d=>{this._eventDispatcher.emitOutgoingEvent(d)})),this._decorations=new Tk(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(d=>{try{let h=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(h,d)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(mf.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new hk)})),this._register(this._themeService.onDidColorThemeChange(d=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new ck(d))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){let e=this.viewLayout.getLinesViewportData(),t=new P(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){let e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){let e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new rk(e)),this._eventDispatcher.emitOutgoingEvent(new mk(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new ik)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new nk)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){let e=new U(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new Bk(t,this._viewportStart.startLineDelta)}return new Bk(null,0)}_onConfigurationChanged(e,t){let i=this._captureStableViewport(),o=this._configuration.options,s=o.get(50),r=o.get(139),a=o.get(146),l=o.get(138),c=o.get(129);this._lines.setWrappingSettings(s,r,a.wrappingColumn,l,c)&&(e.emitViewEvent(new yf),e.emitViewEvent(new Sf),e.emitViewEvent(new Xl(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(91)&&(this._decorations.reset(),e.emitViewEvent(new Xl(null))),t.hasChanged(98)&&(this._decorations.reset(),e.emitViewEvent(new Xl(null))),e.emitViewEvent(new ok(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),Wc.shouldRecreate(t)&&(this.cursorConfig=new Wc(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{let i=this._eventDispatcher.beginEmitViewEvents(),o=!1,s=!1,r=e instanceof _h?e.rawContentChangedEvent.changes:e.changes,a=e instanceof _h?e.rawContentChangedEvent.versionId:null,l=this._lines.createLineBreaksComputer();for(let h of r)switch(h.changeType){case 4:{for(let u=0;u!m.ownerId||m.ownerId===this._editorId)),l.addRequest(f,g,null)}break}case 2:{let u=null;h.injectedText&&(u=h.injectedText.filter(f=>!f.ownerId||f.ownerId===this._editorId)),l.addRequest(h.detail,u,null);break}}let c=l.finalize(),d=new mo(c);for(let h of r)switch(h.changeType){case 1:{this._lines.onModelFlushed(),i.emitViewEvent(new yf),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),o=!0;break}case 3:{let u=this._lines.onModelLinesDeleted(a,h.fromLineNumber,h.toLineNumber);u!==null&&(i.emitViewEvent(u),this.viewLayout.onLinesDeleted(u.fromLineNumber,u.toLineNumber)),o=!0;break}case 4:{let u=d.takeCount(h.detail.length),f=this._lines.onModelLinesInserted(a,h.fromLineNumber,h.toLineNumber,u);f!==null&&(i.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),o=!0;break}case 2:{let u=d.dequeue(),[f,g,m,C]=this._lines.onModelLineChanged(a,h.lineNumber,u);s=f,g&&i.emitViewEvent(g),m&&(i.emitViewEvent(m),this.viewLayout.onLinesInserted(m.fromLineNumber,m.toLineNumber)),C&&(i.emitViewEvent(C),this.viewLayout.onLinesDeleted(C.fromLineNumber,C.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!o&&s&&(i.emitViewEvent(new Sf),i.emitViewEvent(new Xl(null)),this._cursor.onLineMappingChanged(i),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}let t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){let i=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(i){let o=this.coordinatesConverter.convertModelPositionToViewPosition(i.getStartPosition()),s=this.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber);this.viewLayout.setScrollPosition({scrollTop:s+this._viewportStart.startLineDelta},1)}}try{let i=this._eventDispatcher.beginEmitViewEvents();e instanceof _h&&i.emitOutgoingEvent(new xk(e.contentChangedEvent)),this._cursor.onModelContentChanged(i,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{let t=[];for(let i=0,o=e.ranges.length;i{this._eventDispatcher.emitSingleViewEvent(new ak),this.cursorConfig=new Wc(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Sk(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new Wc(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new yk(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{let t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new yf),t.emitViewEvent(new Sf),t.emitViewEvent(new Xl(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new Wc(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Lk(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new Xl(e)),this._eventDispatcher.emitOutgoingEvent(new wk(e))}))}setHiddenAreas(e,t){var i;this.hiddenAreasModel.setHiddenAreas(t,e);let o=this.hiddenAreasModel.getMergedRanges();if(o===this.previousHiddenAreas)return;this.previousHiddenAreas=o;let s=this._captureStableViewport(),r=!1;try{let a=this._eventDispatcher.beginEmitViewEvents();r=this._lines.setHiddenAreas(o),r&&(a.emitViewEvent(new yf),a.emitViewEvent(new Sf),a.emitViewEvent(new Xl(null)),this._cursor.onLineMappingChanged(a),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged());let l=(i=s.viewportStartModelPosition)===null||i===void 0?void 0:i.lineNumber;l&&o.some(d=>d.startLineNumber<=l&&l<=d.endLineNumber)||s.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),r&&this._eventDispatcher.emitOutgoingEvent(new bk)}getVisibleRangesPlusViewportAboveBelow(){let e=this._configuration.options.get(145),t=this._configuration.options.get(67),i=Math.max(20,Math.round(e.height/t)),o=this.viewLayout.getLinesViewportData(),s=Math.max(1,o.completelyVisibleStartLineNumber-i),r=Math.min(this.getLineCount(),o.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new P(s,this.getLineMinColumn(s),r,this.getLineMaxColumn(r)))}getVisibleRanges(){let e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){let t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(i.length===0)return[t];let o=[],s=0,r=t.startLineNumber,a=t.startColumn,l=t.endLineNumber,c=t.endColumn;for(let d=0,h=i.length;dl||(r"u")return this._reduceRestoreStateCompatibility(e);let t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),o=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:o}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,o){return this._lines.getViewLinesBracketGuides(e,t,i,o)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){let t=Ri(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){let t=Os(this.getLineContent(e));return t===-1?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,t){let o=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,o)}getViewLineRenderingData(e){let t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){let i=this.model.mightContainRTL(),o=this.model.mightContainNonBasicASCII(),s=this.getTabSize(),r=this._lines.getViewLineData(e);return r.inlineDecorations&&(t=[...t,...r.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new Wo(r.minColumn,r.maxColumn,r.content,r.continuesWithWrappedLine,i,o,r.tokens,t,s,r.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){let o=this._lines.getViewLinesData(e,t,i);return new CS(this.getTabSize(),o)}getAllOverviewRulerDecorations(e){let t=this.model.getOverviewRulerDecorations(this._editorId,nu(this._configuration.options)),i=new v4;for(let o of t){let s=o.options,r=s.overviewRuler;if(!r)continue;let a=r.position;if(a===0)continue;let l=r.getColor(e.value),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(o.range.startLineNumber,o.range.startColumn),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(o.range.endLineNumber,o.range.endColumn);i.accept(l,s.zIndex,c,d,a)}return i.asArray}_invalidateDecorationsColorCache(){let e=this.model.getOverviewRulerDecorations();for(let t of e){let i=t.options.overviewRuler;i?.invalidateCachedColor();let o=t.options.minimap;o?.invalidateCachedColor()}}getValueInRange(e,t){let i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){let i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){let i=this.coordinatesConverter.convertViewPositionToModelPosition(e),o=this.model.modifyPosition(i,t);return this.coordinatesConverter.convertModelPositionToViewPosition(o)}deduceModelPositionRelativeToViewPosition(e,t,i){let o=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);let r=this.model.getOffsetAt(o)+t;return this.model.getPositionAt(r)}getPlainTextToCopy(e,t,i){let o=i?`\r +`:this.model.getEOL();e=e.slice(0),e.sort(P.compareRangesUsingStarts);let s=!1,r=!1;for(let l of e)l.isEmpty()?s=!0:r=!0;if(!r){if(!t)return"";let l=e.map(d=>d.startLineNumber),c="";for(let d=0;d0&&l[d-1]===l[d]||(c+=this.model.getLineContent(l[d])+o);return c}if(s&&t){let l=[],c=0;for(let d of e){let h=d.startLineNumber;d.isEmpty()?h!==c&&l.push(this.model.getLineContent(h)):l.push(this.model.getValueInRange(d,i?2:0)),c=h}return l.length===1?l[0]:l}let a=[];for(let l of e)l.isEmpty()||a.push(this.model.getValueInRange(l,i?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){let i=this.model.getLanguageId();if(i===In||e.length!==1)return null;let o=e[0];if(o.isEmpty()){if(!t)return null;let d=o.startLineNumber;o=new P(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}let s=this._configuration.options.get(50),r=this._getColorMap(),l=/[:;\\\/<>]/.test(s.fontFamily)||s.fontFamily===Ao.fontFamily,c;return l?c=Ao.fontFamily:(c=s.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${Ao.fontFamily}`),{mode:i,html:`
`+this._getHTMLToCopy(o,r)+"
"}}_getHTMLToCopy(e,t){let i=e.startLineNumber,o=e.startColumn,s=e.endLineNumber,r=e.endColumn,a=this.getTabSize(),l="";for(let c=i;c<=s;c++){let d=this.model.tokenization.getLineTokens(c),h=d.getLineContent(),u=c===i?o-1:0,f=c===s?r-1:h.length;h===""?l+="
":l+=Az(h,d.inflate(),t,u,f,a,Li)}return l}_getColorMap(){let e=Bt.getColorMap(),t=["#000000"];if(e)for(let i=1,o=e.length;ithis._cursor.setStates(o,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector(o=>this._cursor.setSelections(o,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new Ck);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(o=>this._cursor.executeEdits(o,e,t,i))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,o,s){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,o,s))}paste(e,t,i,o){this._executeCursorEdit(s=>this._cursor.paste(s,e,t,i,o))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealAllCursors(e,t,i=!1){this._withViewEventsCollector(o=>this._cursor.revealAll(o,e,i,0,t,0))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(o=>this._cursor.revealPrimary(o,e,i,0,t,0))}revealTopMostCursor(e){let t=this._cursor.getTopMostViewPosition(),i=new P(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(o=>o.emitViewEvent(new Yc(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){let t=this._cursor.getBottomMostViewPosition(),i=new P(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(o=>o.emitViewEvent(new Yc(e,!1,i,null,0,!0,0)))}revealRange(e,t,i,o,s){this._withViewEventsCollector(r=>r.emitViewEvent(new Yc(e,!1,i,null,o,t,s)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new uk),this._eventDispatcher.emitOutgoingEvent(new _k))}_withViewEventsCollector(e){try{let t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}batchEvents(e){this._withViewEventsCollector(()=>{e()})}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}},b4=class n{static create(e){let t=e._setTrackedRange(null,new P(1,1,1,1),1);return new n(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,o,s){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=o,this._startLineDelta=s}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){let i=e.coordinatesConverter.convertViewPositionToModelPosition(new U(t,e.getLineMinColumn(t))),o=e.model._setTrackedRange(this._modelTrackedRange,new P(i.lineNumber,i.column,i.lineNumber,i.column),1),s=e.viewLayout.getVerticalOffsetForLineNumber(t),r=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=o,this._startLineDelta=r-s}invalidate(){this._isValid=!1}},v4=class{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,o,s){let r=this._asMap[e];if(r){let a=r.data,l=a[a.length-3],c=a[a.length-1];if(l===s&&c+1>=i){o>c&&(a[a.length-1]=o);return}a.push(s,i,o)}else{let a=new Wu(e,t,[s,i,o]);this._asMap[e]=a,this.asArray.push(a)}}},C4=class{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){let i=this.hiddenAreas.get(e);i&&Pz(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;let e=Array.from(this.hiddenAreas.values()).reduce((t,i)=>PZ(t,i),[]);return Pz(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}};function PZ(n,e){let t=[],i=0,o=0;for(;i=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Xc=function(n,e){return function(t,i){e(t,i,n)}},kf,Df=kf=class extends H{get isSimpleWidget(){return this._configuration.isSimpleWidget}get contextMenuId(){return this._configuration.contextMenuId}constructor(e,t,i,o,s,r,a,l,c,d,h,u){var f,g;super(),this.languageConfigurationService=h,this._deliveryQueue=I9(),this._contributions=this._register(new yL),this._onDidDispose=this._register(new B),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeModel=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onWillChangeModel=this._onWillChangeModel.event,this._onDidChangeModel=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new Xn(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new zk({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new zk({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new Xn(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new Xn(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new Xn(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new Xn(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new Xn(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new Xn(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new Xn(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new Xn(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new Xn(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new Xn(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new Xn(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new Xn(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new Xn(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new Xn(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new Xn(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new Xn(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new Xn(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),s.willCreateCodeEditor();let m={...t};this._domElement=e,this._overflowWidgetsDomNode=m.overflowWidgetsDomNode,delete m.overflowWidgetsDomNode,this._id=++FZ,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,(f=i.contextMenuId)!==null&&f!==void 0?f:i.isSimpleWidget?A.SimpleEditorContext:A.EditorContext,m,d)),this._register(this._configuration.onDidChange(w=>{this._onDidChangeConfiguration.fire(w);let y=this._configuration.options;if(w.hasChanged(145)){let x=y.get(145);this._onDidLayoutChange.fire(x)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=s,this._commandService=r,this._themeService=l,this._register(new S4(this,this._contextKeyService)),this._register(new x4(this,this._contextKeyService,u)),this._instantiationService=o.createChild(new sa([rt,this._contextKeyService])),this._modelData=null,this._focusTracker=new L4(e,this._overflowWidgetsDomNode),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let C;Array.isArray(i.contributions)?C=i.contributions:C=Hd.getEditorContributions(),this._contributions.initialize(this,C,this._instantiationService);for(let w of Hd.getEditorActions()){if(this._actions.has(w.id)){ut(new Error(`Cannot have two actions with the same id ${w.id}`));continue}let y=new ep(w.id,w.label,w.alias,w.metadata,(g=w.precondition)!==null&&g!==void 0?g:void 0,x=>this._instantiationService.invokeFunction(k=>Promise.resolve(w.runEditorCommand(k,this,x))),this._contextKeyService);this._actions.set(y.id,y)}let S=()=>!this._configuration.options.get(91)&&this._configuration.options.get(36).enabled;this._register(new Hw(this._domElement,{onDragOver:w=>{if(!S())return;let y=this.getTargetAtClientPoint(w.clientX,w.clientY);y?.position&&this.showDropIndicatorAt(y.position)},onDrop:async w=>{if(!S()||(this.removeDropIndicator(),!w.dataTransfer))return;let y=this.getTargetAtClientPoint(w.clientX,w.clientY);y?.position&&this._onDropIntoEditor.fire({position:y.position,event:w})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;(t=this._modelData)===null||t===void 0||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i,o){return new kS(e,t,i,this._domElement,o)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return Rc.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?uo.getWordAtPosition(this._modelData.model,this._configuration.options.get(131),this._configuration.options.get(130),e):null}getValue(e=null){if(!this._modelData)return"";let t=!!(e&&e.preserveBOM),i=0;return e&&e.lineEnding&&e.lineEnding===` +`?i=1:e&&e.lineEnding&&e.lineEnding===`\r +`&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){var t;let i=e;if(this._modelData===null&&i===null||this._modelData&&this._modelData.model===i)return;let o={oldModelUrl:((t=this._modelData)===null||t===void 0?void 0:t.model.uri)||null,newModelUrl:i?.uri||null};this._onWillChangeModel.fire(o);let s=this.hasTextFocus(),r=this._detachModel();this._attachModel(i),s&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(o),this._postDetachModelCleanup(r),this._contributionsDisposable=this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(let e in this._decorationTypeSubtypes){let t=this._decorationTypeSubtypes[e];for(let i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,o){let s=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,o)}getTopForLineNumber(e,t=!1){return this._modelData?kf._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?kf._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,o=!1){let s=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,o)}getBottomForLineNumber(e,t=!1){return this._modelData?kf._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var i;(i=this._modelData)===null||i===void 0||i.viewModel.setHiddenAreas(e.map(o=>P.lift(o)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;let t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return oi.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!U.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,o){if(!this._modelData)return;if(!P.isIRange(e))throw new Error("Invalid arguments");let s=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(s);this._modelData.viewModel.revealRange("api",i,r,t,o)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new P(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,o){if(!U.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new P(e.lineNumber,e.column,e.lineNumber,e.column),t,i,o)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){let i=nt.isISelection(e),o=P.isIRange(e);if(!i&&!o)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(o){let s={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(s,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;let i=new nt(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,o){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new P(e,1,t,1),i,!1,o)}revealRange(e,t=0,i=!1,o=!0){this._revealRange(e,i?1:0,o,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,o){if(!P.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(P.lift(e),t,i,o)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let o=0,s=e.length;o0&&this._modelData.viewModel.restoreCursorState(i):this._modelData.viewModel.restoreCursorState([i]),this._contributions.restoreViewState(t.contributionsState||{});let o=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(o)}}handleInitialized(){var e;(e=this._getViewModel())===null||e===void 0||e.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{let s=i;this._type(e,s.text||"");return}case"replacePreviousChar":{let s=i;this._compositionType(e,s.text||"",s.replaceCharCnt||0,0,0);return}case"compositionType":{let s=i;this._compositionType(e,s.text||"",s.replacePrevCharCnt||0,s.replaceNextCharCnt||0,s.positionDelta||0);return}case"paste":{let s=i;this._paste(e,s.text||"",s.pasteOnNewLine||!1,s.multicursorText||null,s.mode||null,s.clipboardEvent);return}case"cut":this._cut(e);return}let o=this.getAction(t);if(o){Promise.resolve(o.run(i)).then(void 0,ut);return}this._modelData&&(this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,i,o,s){this._modelData&&this._modelData.viewModel.compositionType(t,i,o,s,e)}_paste(e,t,i,o,s,r){if(!this._modelData)return;let a=this._modelData.viewModel,l=a.getSelection().getStartPosition();a.paste(t,i,o,e);let c=a.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({clipboardEvent:r,range:new P(l.lineNumber,l.column,c.lineNumber,c.column),languageId:s})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){let o=Hd.getEditorCommand(t);return o?(i=i||{},i.source=e,this._instantiationService.invokeFunction(s=>{Promise.resolve(o.runEditorCommand(s,this,i)).then(void 0,ut)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(91)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(91)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(91))return!1;let o;return i?Array.isArray(i)?o=()=>i:o=i:o=()=>null,this._modelData.viewModel.executeEdits(e,t,o),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new k4(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,nu(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,nu(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){!this._modelData||e.length===0||this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}removeDecorationsByType(e){let t=this._decorationTypeKeysToIds[e];t&&this.changeDecorations(i=>i.deltaDecorations(t,[])),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(145)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarPointerDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e,t=!1){this._configuration.observeContainer(e),t||this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){let t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id:"+e.getId()),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){let t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){let i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){let t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){let i=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(i)}}addOverlayWidget(e){let t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){let t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){let i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){let t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){let i=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(i)}}addGlyphMarginWidget(e){let t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){let t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){let i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){let t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){let i=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(i)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;let t=this._modelData.model.validatePosition(e),i=this._configuration.options,o=i.get(145),s=kf._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),r=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+o.glyphMarginWidth+o.lineNumbersWidth+o.decorationsWidth-this.getScrollLeft();return{top:s,left:r,height:i.get(67)}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.viewModel.batchEvents(()=>{this._modelData.view.render(!0,e)})}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Si(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}let t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());let i=e.onBeforeAttached(),o=new Fk(this._id,this._configuration,e,wL.create(ge(this._domElement)),tk.create(this._configuration.options),a=>rn(ge(this._domElement),a),this.languageConfigurationService,this._themeService,i);t.push(e.onWillDispose(()=>this.setModel(null))),t.push(o.onEvent(a=>{switch(a.kind){case 0:this._onDidContentSizeChange.fire(a);break;case 1:this._editorTextFocus.setValue(a.hasFocus);break;case 2:this._onDidScrollChange.fire(a);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(a.reachedMaxCursorCount){let h=this.getOption(80),u=p("cursors.maximum","The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",h);this._notificationService.prompt(Oz.Warning,u,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:p("goToSetting","Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}let l=[];for(let h=0,u=a.selections.length;h{this._paste("keyboard",s,r,a,l)},type:s=>{this._type("keyboard",s)},compositionType:(s,r,a,l)=>{this._compositionType("keyboard",s,r,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(s,r,a,l)=>{let c={text:s,pasteOnNewLine:r,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:s=>{let r={text:s};this._commandService.executeCommand("type",r)},compositionType:(s,r,a,l)=>{if(a||l){let c={text:s,replacePrevCharCnt:r,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{let c={text:s,replaceCharCnt:r};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};let i=new qm(e.coordinatesConverter);return i.onKeyDown=s=>this._onKeyDown.fire(s),i.onKeyUp=s=>this._onKeyUp.fire(s),i.onContextMenu=s=>this._onContextMenu.fire(s),i.onMouseMove=s=>this._onMouseMove.fire(s),i.onMouseLeave=s=>this._onMouseLeave.fire(s),i.onMouseDown=s=>this._onMouseDown.fire(s),i.onMouseUp=s=>this._onMouseUp.fire(s),i.onMouseDrag=s=>this._onMouseDrag.fire(s),i.onMouseDrop=s=>this._onMouseDrop.fire(s),i.onMouseDropCanceled=s=>this._onMouseDropCanceled.fire(s),i.onMouseWheel=s=>this._onMouseWheel.fire(s),[new pL(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e?.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){var e;if((e=this._contributionsDisposable)===null||e===void 0||e.dispose(),this._contributionsDisposable=void 0,!this._modelData)return null;let t=this._modelData.model,i=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),i&&this._domElement.contains(i)&&this._domElement.removeChild(i),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),t}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){let t=[{range:new P(e.lineNumber,e.column,e.lineNumber,e.column),options:kf.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};Df.dropIntoEditorDecorationOptions=qi.register({description:"workbench-dnd-target",className:"dnd-target"});Df=kf=OZ([Xc(3,Ye),Xc(4,Zt),Xc(5,kn),Xc(6,rt),Xc(7,an),Xc(8,Ko),Xc(9,ao),Xc(10,yo),Xc(11,Tt)],Df);var FZ=0,y4=class{constructor(e,t,i,o,s,r){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=o,this.listenersToRemove=s,this.attachedView=r}dispose(){li(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},zk=class extends H{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new B(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new B(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){let t=e?2:1;this._value!==t&&(this._value=t,this._value===2?this._onDidChangeToTrue.fire():this._value===1&&this._onDidChangeToFalse.fire())}},Xn=class extends B{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}},S4=class extends H{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=_e.editorSimpleInput.bindTo(t),this._editorFocus=_e.focus.bindTo(t),this._textInputFocus=_e.textInputFocus.bindTo(t),this._editorTextFocus=_e.editorTextFocus.bindTo(t),this._tabMovesFocus=_e.tabMovesFocus.bindTo(t),this._editorReadonly=_e.readOnly.bindTo(t),this._inDiffEditor=_e.inDiffEditor.bindTo(t),this._editorColumnSelection=_e.columnSelection.bindTo(t),this._hasMultipleSelections=_e.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=_e.hasNonEmptySelection.bindTo(t),this._canUndo=_e.canUndo.bindTo(t),this._canRedo=_e.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(wm.onDidChangeTabFocus(i=>this._tabMovesFocus.set(i))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){let e=this._editor.getOptions();this._tabMovesFocus.set(wm.getTabFocusMode()),this._editorReadonly.set(e.get(91)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_updateFromSelection(){let e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(t=>!t.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){let e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}},x4=class extends H{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=_e.languageId.bindTo(t),this._hasCompletionItemProvider=_e.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=_e.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=_e.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=_e.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=_e.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=_e.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=_e.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=_e.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=_e.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=_e.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=_e.hasReferenceProvider.bindTo(t),this._hasRenameProvider=_e.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=_e.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=_e.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=_e.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=_e.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=_e.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=_e.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=_e.isInEmbeddedEditor.bindTo(t);let o=()=>this._update();this._register(e.onDidChangeModel(o)),this._register(e.onDidChangeModelLanguage(o)),this._register(i.completionProvider.onDidChange(o)),this._register(i.codeActionProvider.onDidChange(o)),this._register(i.codeLensProvider.onDidChange(o)),this._register(i.definitionProvider.onDidChange(o)),this._register(i.declarationProvider.onDidChange(o)),this._register(i.implementationProvider.onDidChange(o)),this._register(i.typeDefinitionProvider.onDidChange(o)),this._register(i.hoverProvider.onDidChange(o)),this._register(i.documentHighlightProvider.onDidChange(o)),this._register(i.documentSymbolProvider.onDidChange(o)),this._register(i.referenceProvider.onDidChange(o)),this._register(i.renameProvider.onDidChange(o)),this._register(i.documentFormattingEditProvider.onDidChange(o)),this._register(i.documentRangeFormattingEditProvider.onDidChange(o)),this._register(i.signatureHelpProvider.onDidChange(o)),this._register(i.inlayHintsProvider.onDidChange(o)),o()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInEmbeddedEditor.reset()})}_update(){let e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInEmbeddedEditor.set(e.uri.scheme===Ze.walkThroughSnippet||e.uri.scheme===Ze.vscodeChatCodeBlock)})}},L4=class extends H{constructor(e,t){super(),this._onChange=this._register(new B),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register(Ic(e)),this._overflowWidgetsDomNodeHasFocus=!1,this._register(this._domFocusTracker.onDidFocus(()=>{this._hasDomElementFocus=!0,this._update()})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasDomElementFocus=!1,this._update()})),t&&(this._overflowWidgetsDomNode=this._register(Ic(t)),this._register(this._overflowWidgetsDomNode.onDidFocus(()=>{this._overflowWidgetsDomNodeHasFocus=!0,this._update()})),this._register(this._overflowWidgetsDomNode.onDidBlur(()=>{this._overflowWidgetsDomNodeHasFocus=!1,this._update()})))}_update(){let e=this._hasDomElementFocus||this._overflowWidgetsDomNodeHasFocus;this._hadFocus!==e&&(this._hadFocus=e,this._onChange.fire(void 0))}hasFocus(){var e;return(e=this._hadFocus)!==null&&e!==void 0?e:!1}},k4=class{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(o=>{this._isChangingDecorations||e.call(t,o)},i)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];let e=this._editor.getModel(),t=[];for(let i of this._decorationIds){let o=e.getDecorationRange(i);o&&t.push(o)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){this._decorationIds.length!==0&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}append(e){let t=[];try{this._isChangingDecorations=!0,this._editor.changeDecorations(i=>{t=i.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)})}finally{this._isChangingDecorations=!1}return t}},BZ=encodeURIComponent("");function w4(n){return BZ+encodeURIComponent(n.toString())+WZ}var zZ=encodeURIComponent('');function HZ(n){return zZ+encodeURIComponent(n.toString())+VZ}Lo((n,e)=>{let t=n.getColor(Wa);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${w4(t)}") repeat-x bottom left; }`);let i=n.getColor(An);i&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${w4(i)}") repeat-x bottom left; }`);let o=n.getColor(Vo);o&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${w4(o)}") repeat-x bottom left; }`);let s=n.getColor(Y8);s&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${HZ(s)}") no-repeat bottom left; }`);let r=n.getColor(G6);r&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${r.rgba.a}; }`)});_();v();b();lr();_();v();b();ke();er();_();v();b();ye();le();kr();Qi();var UZ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},KZ=function(n,e){return function(t,i){e(t,i,n)}},Vk=class extends H{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new B),this._onCodeEditorAdd=this._register(new B),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new B),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new B),this._onDiffEditorAdd=this._register(new B),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new B),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new Ii,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null,t=this.listCodeEditors();for(let i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}removeDecorationType(e){let t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(i=>i.removeDecorationsByType(e))))}setModelProperty(e,t,i){let o=e.toString(),s;this._modelProperties.has(o)?s=this._modelProperties.get(o):(s=new Map,this._modelProperties.set(o,s)),s.set(t,i)}getModelProperty(e,t){let i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}async openCodeEditor(e,t,i){for(let o of this._codeEditorOpenHandlers){let s=await o(e,t,i);if(s!==null)return s}return null}registerCodeEditorOpenHandler(e){let t=this._codeEditorOpenHandlers.unshift(e);return be(t)}};Vk=UZ([KZ(0,an)],Vk);Or();Oi();Ur();Qi();var $Z=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Fz=function(n,e){return function(t,i){e(t,i,n)}},gv=class extends Vk{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler(async(i,o,s)=>o?this.doOpenEditor(o,i):null))}_checkContextKey(){let e=!1;for(let t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){let s=t.resource.scheme;if(s===Ze.http||s===Ze.https)return Yw(t.resource.toString()),e}return null}let o=t.options?t.options.selection:null;if(o)if(typeof o.endLineNumber=="number"&&typeof o.endColumn=="number")e.setSelection(o),e.revealRangeInCenter(o,1);else{let s={lineNumber:o.startLineNumber,column:o.startColumn};e.setPosition(s),e.revealPositionInCenter(s,1)}return e}findModel(e,t){let i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};gv=$Z([Fz(0,rt),Fz(1,an)],gv);_t(Zt,gv,0);_();v();b();ke();vo();wt();ye();Or();Ur();_();v();b();qe();var ss=De("layoutService");var Bz=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Wz=function(n,e){return function(t,i){e(t,i,n)}},Hk=class{get mainContainer(){var e,t;return(t=(e=lg(this._codeEditorService.listCodeEditors()))===null||e===void 0?void 0:e.getContainerDomNode())!==null&&t!==void 0?t:gt.document.body}get activeContainer(){var e,t;let i=(e=this._codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:this._codeEditorService.getActiveCodeEditor();return(t=i?.getContainerDomNode())!==null&&t!==void 0?t:this.mainContainer}get mainContainerDimension(){return zg(this.mainContainer)}get activeContainerDimension(){return zg(this.activeContainer)}get containers(){return $1(this._codeEditorService.listCodeEditors().map(e=>e.getContainerDomNode()))}getContainer(){return this.activeContainer}whenContainerStylesLoaded(){}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())===null||e===void 0||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=ie.None,this.onDidLayoutActiveContainer=ie.None,this.onDidLayoutContainer=ie.None,this.onDidChangeActiveContainer=ie.None,this.onDidAddContainer=ie.None,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};Hk=Bz([Wz(0,Zt)],Hk);var Uk=class extends Hk{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};Uk=Bz([Wz(1,Zt)],Uk);_t(ss,Hk,1);_();v();b();xt();le();er();Ge();_();v();b();qe();var Kk=De("dialogService");Ur();ZL();var qZ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},zz=function(n,e){return function(t,i){e(t,i,n)}},_p=!1;function $k(n){return n.scheme===Ze.file?n.fsPath:n.path}var Vz=0,bp=class{constructor(e,t,i,o,s,r,a){this.id=++Vz,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=o,this.groupOrder=s,this.sourceId=r,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}},qk=class{constructor(e,t){this.resourceLabel=e,this.reason=t}},jk=class{constructor(){this.elements=new Map}createMessage(){let e=[],t=[];for(let[,o]of this.elements)(o.reason===0?e:t).push(o.resourceLabel);let i=[];return e.length>0&&i.push(p({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(p({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join(` +`)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}},D4=class{constructor(e,t,i,o,s,r,a){this.id=++Vz,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=o,this.groupOrder=s,this.sourceId=r,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new jk),this.removedResources.has(t)||this.removedResources.set(t,new qk(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new jk),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new qk(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}},Gk=class{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(let e of this._past)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(let e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){let e=[];e.push(`* ${this.strResource}:`);for(let t=0;t=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(` +`)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(let i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(let i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(let t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){let t=[];for(let i=0,o=this._past.length;i=0;i--)t.push(this._future[i].id);return new nv(e,t)}restoreSnapshot(e){let t=e.elements.length,i=!0,o=0,s=-1;for(let a=0,l=this._past.length;a=t||c.id!==e.elements[o])&&(i=!1,s=0),!i&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let r=-1;for(let a=this._future.length-1;a>=0;a--,o++){let l=this._future[a];i&&(o>=t||l.id!==e.elements[o])&&(i=!1,r=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}s!==-1&&(this._past=this._past.slice(0,s)),r!==-1&&(this._future=this._future.slice(r+1)),this.versionId++}getElements(){let e=[],t=[];for(let i of this._past)e.push(i.actual);for(let i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}},mv=class{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;tt.sourceOrder)&&(t=r,i=o)}return[t,i]}canUndo(e){if(e instanceof Ya){let[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}let t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){ut(e);for(let i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(let t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(let t of e.editStacks)t.locked=!0;return()=>{for(let t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,o,s){let r=this._acquireLocks(i),a;try{a=t()}catch(l){return r(),o.dispose(),this._onError(l,e)}return a?a.then(()=>(r(),o.dispose(),s()),l=>(r(),o.dispose(),this._onError(l,e))):(r(),o.dispose(),s())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return H.None;let t=e.actual.prepareUndoRedo();return typeof t>"u"?H.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(H.None);let i=e.actual.prepareUndoRedo();return i?aC(i)?t(i):i.then(o=>t(o)):t(H.None)}_getAffectedEditStacks(e){let t=[];for(let i of e.strResources)t.push(this._editStacks.get(i)||Hz);return new mv(t)}_tryToSplitAndUndo(e,t,i,o){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(o),new vp(this._undo(e,0,!0));for(let s of t.strResources)this.removeElements(s);return this._notificationService.warn(o),new vp}_checkWorkspaceUndo(e,t,i,o){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,p({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(o&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,p({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));let s=[];for(let a of i.editStacks)a.getClosestPastElement()!==t&&s.push(a.resourceLabel);if(s.length>0)return this._tryToSplitAndUndo(e,t,null,p({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because changes were made to {1}",t.label,s.join(", ")));let r=[];for(let a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,p({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,p({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){let o=this._getAffectedEditStacks(t),s=this._checkWorkspaceUndo(e,t,o,!1);return s?s.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,o,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(let[,t]of this._editStacks){let i=t.getClosestPastElement();if(i){if(i===e){let o=t.getSecondClosestPastElement();if(o&&o.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,i,o){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(d){d[d.All=0]="All",d[d.This=1]="This",d[d.Cancel=2]="Cancel"})(a||(a={}));let{result:l}=await this._dialogService.prompt({type:Ci.Info,message:p("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:p({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:p({key:"nok",comment:["&& denotes a mnemonic"]},"Undo this &&File"),run:()=>a.This}],cancelButton:{run:()=>a.Cancel}});if(l===a.Cancel)return;if(l===a.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);let c=this._checkWorkspaceUndo(e,t,i,!1);if(c)return c.returnValue;o=!0}let s;try{s=await this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}let r=this._checkWorkspaceUndo(e,t,i,!0);if(r)return s.dispose(),r.returnValue;for(let a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,s,()=>this._continueUndoInGroup(t.groupId,o))}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){let o=p({key:"cannotResourceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(o);return}return this._invokeResourcePrepare(t,o=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new mv([e]),o,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(let[o,s]of this._editStacks){let r=s.getClosestPastElement();r&&r.groupId===e&&(!t||r.groupOrder>t.groupOrder)&&(t=r,i=o)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;let[,i]=this._findClosestUndoElementInGroup(e);if(i)return this._undo(i,0,t)}undo(e){if(e instanceof Ya){let[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;let o=this._editStacks.get(e),s=o.getClosestPastElement();if(!s)return;if(s.groupId){let[a,l]=this._findClosestUndoElementInGroup(s.groupId);if(s!==a&&l)return this._undo(l,t,i)}if((s.sourceId!==t||s.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,s);try{return s.type===1?this._workspaceUndo(e,s,i):this._resourceUndo(o,s,i)}finally{_p&&this._print("undo")}}async _confirmAndContinueUndo(e,t,i){if((await this._dialogService.confirm({message:p("confirmDifferentSource","Would you like to undo '{0}'?",i.label),primaryButton:p({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:p("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(let[o,s]of this._editStacks){let r=s.getClosestFutureElement();r&&r.sourceId===e&&(!t||r.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,p({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because changes were made to {1}",t.label,s.join(", ")));let r=[];for(let a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,p({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,p({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){let i=this._getAffectedEditStacks(t),o=this._checkWorkspaceRedo(e,t,i,!1);return o?o.returnValue:this._executeWorkspaceRedo(e,t,i)}async _executeWorkspaceRedo(e,t,i){let o;try{o=await this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}let s=this._checkWorkspaceRedo(e,t,i,!0);if(s)return o.dispose(),s.returnValue;for(let r of i.editStacks)r.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,o,()=>this._continueRedoInGroup(t.groupId))}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){let i=p({key:"cannotResourceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(i);return}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new mv([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(let[o,s]of this._editStacks){let r=s.getClosestFutureElement();r&&r.groupId===e&&(!t||r.groupOrder0?t.charCodeAt(0):0)}acceptEdit(e,t,i,o,s){this._acceptDeleteRange(e),this._acceptInsertText(new U(e.startLineNumber,e.startColumn),t,i,o,s),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;let t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;if(i<0){let s=i-t;this._startLineNumber-=s;return}let o=this._tokens.getMaxDeltaLine();if(!(t>=o+1)){if(t<0&&i>=o+1){this._startLineNumber=0,this._tokens.clear();return}if(t<0){let s=-t;this._startLineNumber-=s,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,o,s){if(t===0&&i===0)return;let r=e.lineNumber-this._startLineNumber;if(r<0){this._startLineNumber+=t;return}let a=this._tokens.getMaxDeltaLine();r>=a+1||this._tokens.acceptInsertText(r,e.column-1,t,i,o,s)}},M4=class n{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){let t=[];for(let i=0;ie)i=o-1;else{let r=o;for(;r>t&&this._getDeltaLine(r-1)===e;)r--;let a=o;for(;ae||u===e&&g>=t)&&(ue||g===e&&C>=t){if(gs?m-=s-i:m=i;else if(f===t&&g===i)if(f===o&&m>s)m-=s-i;else{d=!0;continue}else if(fs)f=t,g=i,m=g+(m-s);else{d=!0;continue}else if(f>o){if(l===0&&!d){c=a;break}f-=l}else if(f===o&&g>=s)e&&f===0&&(g+=e,m+=e),f-=l,g-=s-i,m-=s-i;else throw new Error("Not possible!");let S=4*c;r[S]=f,r[S+1]=g,r[S+2]=m,r[S+3]=C,c++}this._tokenCount=c}acceptInsertText(e,t,i,o,s,r){let a=i===0&&o===1&&(r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122),l=this._tokens,c=this._tokenCount;for(let d=0;d=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},R4=function(n,e){return function(t,i){e(t,i,n)}},eD=class{constructor(e,t,i,o){this._legend=e,this._themeService=t,this._languageService=i,this._logService=o,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new tD}getMetadata(e,t,i){let o=this._languageService.languageIdCodec.encodeLanguageId(i),s=this._hashTable.get(e,t,o),r;if(s)r=s.metadata,this._logService.getLevel()===Dn.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${mn.getForeground(r)}, fontStyle ${mn.getFontStyle(r).toString(2)}`);else{let a=this._legend.tokenTypes[e],l=[];if(a){let c=t;for(let h=0;c>0&&h>1;c>0&&this._logService.getLevel()===Dn.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),l.push("not-in-legend"));let d=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,i);if(typeof d>"u")r=2147483647;else{if(r=0,typeof d.italic<"u"){let h=(d.italic?1:0)<<11;r|=h|1}if(typeof d.bold<"u"){let h=(d.bold?2:0)<<11;r|=h|2}if(typeof d.underline<"u"){let h=(d.underline?4:0)<<11;r|=h|4}if(typeof d.strikethrough<"u"){let h=(d.strikethrough?8:0)<<11;r|=h|8}if(d.foreground){let h=d.foreground<<15;r|=h|16}r===0&&(r=2147483647)}}else this._logService.getLevel()===Dn.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),r=2147483647,a="not-in-legend";this._hashTable.add(e,t,o,r),this._logService.getLevel()===Dn.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${l.join(" ")}): foreground ${mn.getForeground(r)}, fontStyle ${mn.getFontStyle(r).toString(2)}`)}return r}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,this._logService.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,this._logService.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,o,s){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${o} is outside the previous data (length ${s}).`))}};eD=ZZ([R4(1,an),R4(2,ii),R4(3,En)],eD);function Rze(n,e,t){let i=n.data,o=n.data.length/5|0,s=Math.max(Math.ceil(o/1024),400),r=[],a=0,l=1,c=0;for(;ad&&i[5*w]===0;)w--;if(w-1===d){let y=h;for(;y+1T)e.warnOverlappingSemanticTokens(k,T+1);else{let G=e.getMetadata(W,j,t);G!==2147483647&&(g===0&&(g=k),u[f]=k-g,u[f+1]=T,u[f+2]=M,u[f+3]=G,f+=4,m=k,C=M)}l=k,c=T,a++}f!==u.length&&(u=u.subarray(0,f));let S=Qk.create(g,u);r.push(S)}return r}var P4=class{constructor(e,t,i,o){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=o,this.next=null}},tD=class n{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=n._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){let s=this._elements;this._currentLengthIndex++,this._currentLength=n._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},O4=function(n,e){return function(t,i){e(t,i,n)}},F4=class extends H{constructor(e,t,i){super(),this._themeService=e,this._logService=t,this._languageService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new eD(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};F4=YZ([O4(0,an),O4(1,En),O4(2,ii)],F4);_t($z,F4,1);_();v();b();_();v();b();ye();le();hr();_();v();b();_();v();b();Gt();yR();cr();wc();Lt();ot();var iD="**",qz="/",nD="[/\\\\]",oD="[^/\\\\]",XZ=/\//g;function jz(n,e){switch(n){case 0:return"";case 1:return`${oD}*?`;default:return`(?:${nD}|${oD}+${nD}${e?`|${nD}${oD}+`:""})*?`}}function Gz(n,e){if(!n)return[];let t=[],i=!1,o=!1,s="";for(let r of n){switch(r){case e:if(!i&&!o){t.push(s),s="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":o=!0;break;case"]":o=!1;break}s+=r}return s&&t.push(s),t}function Jz(n){if(!n)return"";let e="",t=Gz(n,qz);if(t.every(i=>i===iD))e=".*";else{let i=!1;t.forEach((o,s)=>{if(o===iD){if(i)return;e+=jz(2,s===t.length-1)}else{let r=!1,a="",l=!1,c="";for(let d of o){if(d!=="}"&&r){a+=d;continue}if(l&&(d!=="]"||!c)){let h;d==="-"?h=d:(d==="^"||d==="!")&&!c?h="^":d===qz?h="":h=gs(d),c+=h;continue}switch(d){case"{":r=!0;continue;case"[":l=!0;continue;case"}":{let u=`(?:${Gz(a,",").map(f=>Jz(f)).join("|")})`;e+=u,r=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=oD;continue;case"*":e+=jz(1);continue;default:e+=gs(d)}}sW4(a,e)).filter(a=>a!==Ql),n),i=t.length;if(!i)return Ql;if(i===1)return t[0];let o=function(a,l){for(let c=0,d=t.length;c!!a.allBasenames);s&&(o.allBasenames=s.allBasenames);let r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(o.allPaths=r),o}function Qz(n,e,t){let i=ya===ci.sep,o=i?n:n.replace(XZ,ya),s=ya+o,r=ci.sep+n,a;return t?a=function(l,c){return typeof l=="string"&&(l===o||l.endsWith(s)||!i&&(l===n||l.endsWith(r)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===o||!i&&l===n)?e:null},a.allPaths=[(t?"*/":"./")+n],a}function aY(n){try{let e=new RegExp(`^${Jz(n)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?n:null}}catch{return Ql}}function eV(n,e,t){return!n||typeof e!="string"?!1:z4(n)(e,void 0,t)}function z4(n,e={}){if(!n)return Yz;if(typeof n=="string"||lY(n)){let t=W4(n,e);if(t===Ql)return Yz;let i=function(o,s){return!!t(o,s)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return cY(n,e)}function lY(n){let e=n;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function cY(n,e){let t=tV(Object.getOwnPropertyNames(n).map(a=>dY(a,n[a],e)).filter(a=>a!==Ql)),i=t.length;if(!i)return Ql;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];let a=function(d,h){let u;for(let f=0,g=t.length;f{for(let f of u){let g=await f;if(typeof g=="string")return g}return null})():null},l=t.find(d=>!!d.allBasenames);l&&(a.allBasenames=l.allBasenames);let c=t.reduce((d,h)=>h.allPaths?d.concat(h.allPaths):d,[]);return c.length&&(a.allPaths=c),a}let o=function(a,l,c){let d,h;for(let u=0,f=t.length;u{for(let u of h){let f=await u;if(typeof f=="string")return f}return null})():null},s=t.find(a=>!!a.allBasenames);s&&(o.allBasenames=s.allBasenames);let r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(o.allPaths=r),o}function dY(n,e,t){if(e===!1)return Ql;let i=W4(n,t);if(i===Ql)return Ql;if(typeof e=="boolean")return i;if(e){let o=e.when;if(typeof o=="string"){let s=(r,a,l,c)=>{if(!c||!i(r,a))return null;let d=o.replace("$(basename)",()=>l),h=c(d);return Nw(h)?h.then(u=>u?n:null):h?n:null};return s.requiresSiblings=!0,s}}return i}function tV(n,e){let t=n.filter(a=>!!a.basenames);if(t.length<2)return n;let i=t.reduce((a,l)=>{let c=l.basenames;return c?a.concat(c):a},[]),o;if(e){o=[];for(let a=0,l=i.length;a{let c=l.patterns;return c?a.concat(c):a},[]);let s=function(a,l){if(typeof a!="string")return null;if(!l){let d;for(d=a.length;d>0;d--){let h=a.charCodeAt(d-1);if(h===47||h===92)break}l=a.substr(d)}let c=i.indexOf(l);return c!==-1?o[c]:null};s.basenames=i,s.patterns=o,s.allBasenames=i;let r=n.filter(a=>!a.basenames);return r.push(s),r}wc();function V4(n,e,t,i,o,s){if(Array.isArray(n)){let r=0;for(let a of n){let l=V4(a,e,t,i,o,s);if(l===10)return l;l>r&&(r=l)}return r}else{if(typeof n=="string")return i?n==="*"?5:n===t?10:0:0;if(n){let{language:r,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:d}=n;if(!i&&!c)return 0;d&&o&&(e=o);let h=0;if(l)if(l===e.scheme)h=10;else if(l==="*")h=5;else return 0;if(r)if(r===t)h=10;else if(r==="*")h=Math.max(h,5);else return 0;if(d)if(d===s)h=10;else if(d==="*"&&s!==void 0)h=Math.max(h,5);else return 0;if(a){let u;if(typeof a=="string"?u=a:u={...a,base:mC(a.base)},u===e.fsPath||eV(u,e.fsPath))h=10;else return 0}return h}else return 0}}function iV(n){return typeof n=="string"?!1:Array.isArray(n)?n.every(iV):!!n.exclusive}var sD=class{constructor(e,t,i,o){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=o}equals(e){var t,i;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&((t=this.notebookUri)===null||t===void 0?void 0:t.toString())===((i=e.notebookUri)===null||i===void 0?void 0:i.toString())}},si=class n{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new B,this.onDidChange=this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),be(()=>{if(i){let o=this._entries.indexOf(i);o>=0&&(this._entries.splice(o,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);let t=[];for(let i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e){let t=[];return this._orderedForEach(e,i=>t.push(i.provider)),t}orderedGroups(e){let t=[],i,o;return this._orderedForEach(e,s=>{i&&o===s._score?i.push(s.provider):(o=s._score,i=[s.provider],t.push(i))}),t}_orderedForEach(e,t){this._updateScores(e);for(let i of this._entries)i._score>0&&t(i)}_updateScores(e){var t,i;let o=(t=this._notebookInfoResolver)===null||t===void 0?void 0:t.call(this,e.uri),s=o?new sD(e.uri,e.getLanguageId(),o.uri,o.type):new sD(e.uri,e.getLanguageId(),void 0,void 0);if(!(!((i=this._lastCandidate)===null||i===void 0)&&i.equals(s))){this._lastCandidate=s;for(let r of this._entries)if(r._score=V4(r.selector,s.uri,s.languageId,$3(e),s.notebookUri,s.notebookType),iV(r.selector)&&r._score>0){for(let a of this._entries)a._score=0;r._score=1e3;break}this._entries.sort(n._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:_v(e.selector)&&!_v(t.selector)?1:!_v(e.selector)&&_v(t.selector)?-1:e._timet._time?-1:0}};function _v(n){return typeof n=="string"?!1:Array.isArray(n)?n.some(_v):!!n.isBuiltin}Ou();Ur();var H4=class{constructor(){this.referenceProvider=new si(this._score.bind(this)),this.renameProvider=new si(this._score.bind(this)),this.newSymbolNamesProvider=new si(this._score.bind(this)),this.codeActionProvider=new si(this._score.bind(this)),this.definitionProvider=new si(this._score.bind(this)),this.typeDefinitionProvider=new si(this._score.bind(this)),this.declarationProvider=new si(this._score.bind(this)),this.implementationProvider=new si(this._score.bind(this)),this.documentSymbolProvider=new si(this._score.bind(this)),this.inlayHintsProvider=new si(this._score.bind(this)),this.colorProvider=new si(this._score.bind(this)),this.codeLensProvider=new si(this._score.bind(this)),this.documentFormattingEditProvider=new si(this._score.bind(this)),this.documentRangeFormattingEditProvider=new si(this._score.bind(this)),this.onTypeFormattingEditProvider=new si(this._score.bind(this)),this.signatureHelpProvider=new si(this._score.bind(this)),this.hoverProvider=new si(this._score.bind(this)),this.documentHighlightProvider=new si(this._score.bind(this)),this.multiDocumentHighlightProvider=new si(this._score.bind(this)),this.selectionRangeProvider=new si(this._score.bind(this)),this.foldingRangeProvider=new si(this._score.bind(this)),this.linkProvider=new si(this._score.bind(this)),this.inlineCompletionsProvider=new si(this._score.bind(this)),this.inlineEditProvider=new si(this._score.bind(this)),this.completionProvider=new si(this._score.bind(this)),this.linkedEditingRangeProvider=new si(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new si(this._score.bind(this)),this.documentSemanticTokensProvider=new si(this._score.bind(this)),this.documentDropEditProvider=new si(this._score.bind(this)),this.documentPasteEditProvider=new si(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}};_t(Tt,H4,1);_();v();b();Ur();Qi();is();_();v();b();qe();le();Fo();ke();var hY=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},nV=function(n,e){return function(t,i){e(t,i,n)}},Lh=De("hoverService"),xh=class extends H{get delay(){return this.isInstantlyHovering()?0:this._delay}constructor(e,t,i={},o,s){super(),this.placement=e,this.instantHover=t,this.overrideOptions=i,this.configurationService=o,this.hoverService=s,this.lastHoverHideTime=0,this.timeLimit=200,this.hoverDisposables=this._register(new ae),this._delay=this.configurationService.getValue("workbench.hover.delay"),this._register(this.configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))}))}showHover(e,t){let i=typeof this.overrideOptions=="function"?this.overrideOptions(e,t):this.overrideOptions;this.hoverDisposables.clear();let o=e.target instanceof HTMLElement?[e.target]:e.target.targetElements;for(let r of o)this.hoverDisposables.add(Ut(r,"keydown",a=>{a.equals(9)&&this.hoverService.hideHover()}));let s=e.content instanceof HTMLElement?void 0:e.content.toString();return this.hoverService.showHover({...e,...i,persistence:{hideOnKeyDown:!0,...i.persistence},id:s,appearance:{...e.appearance,compact:!0,skipFadeInAnimation:this.isInstantlyHovering(),...i.appearance}},t)}isInstantlyHovering(){return this.instantHover&&Date.now()-this.lastHoverHideTime{i.stopPropagation(),i.preventDefault(),t(e)}))}},K4=class extends H{constructor(e,t,i){super(),this._register($(e,se.KEY_DOWN,o=>{let s=new bt(o);i.some(r=>s.equals(r))&&(o.stopPropagation(),o.preventDefault(),t(e))}))}};_();v();b();qe();var Jl=De("openerService");function sV(n){let e,t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(n.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},n=n.with({fragment:""})),{selection:e,uri:n}}qe();_();v();b();_();v();b();ke();Fw();_();v();b();ke();function rV(n,e={}){let t=cD(e);return t.textContent=n,t}function aV(n,e={}){let t=cD(e);return lV(t,uY(n,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function cD(n){let e=n.inline?"span":"div",t=document.createElement(e);return n.className&&(t.className=n.className),t}var $4=class{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){let e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}};function lV(n,e,t,i){let o;if(e.type===2)o=document.createTextNode(e.content||"");else if(e.type===3)o=document.createElement("b");else if(e.type===4)o=document.createElement("i");else if(e.type===7&&i)o=document.createElement("code");else if(e.type===5&&t){let s=document.createElement("a");t.disposables.add(Ut(s,"click",r=>{t.callback(String(e.index),r)})),o=s}else e.type===8?o=document.createElement("br"):e.type===1&&(o=n);o&&n!==o&&n.appendChild(o),o&&Array.isArray(e.children)&&e.children.forEach(s=>{lV(o,s,t,i)})}function uY(n,e){let t={type:1,children:[]},i=0,o=t,s=[],r=new $4(n);for(;!r.eos();){let a=r.next(),l=a==="\\"&&q4(r.peek(),e)!==0;if(l&&(a=r.next()),!l&&fY(a,e)&&a===r.peek()){r.advance(),o.type===2&&(o=s.pop());let c=q4(a,e);if(o.type===c||o.type===5&&c===6)o=s.pop();else{let d={type:c,children:[]};c===5&&(d.index=i,i++),o.children.push(d),s.push(o),o=d}}else if(a===` +`)o.type===2&&(o=s.pop()),o.children.push({type:8});else if(o.type!==2){let c={type:2,content:a};o.children.push(c),s.push(o),o=c}else o.content+=a}return o.type===2&&(o=s.pop()),s.length,t}function fY(n,e){return q4(n,e)!==0}function q4(n,e){switch(n){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}oo();Qs();Ef();xt();ye();Lp();xp();_();v();b();var yv=class{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}},c5=new yv("id#");Md();le();_();v();b();var $o={};(function(){function n(e,t){t($o)}n.amd=!0,function(e,t){typeof n=="function"&&n.amd?n(["exports"],t):typeof exports=="object"&&typeof module<"u"?t(exports):(e=typeof globalThis<"u"?globalThis:e||self,t(e.marked={}))}(this,function(e){"use strict";function t(ne,X){for(var Y=0;Yne.length)&&(X=ne.length);for(var Y=0,R=new Array(X);Y=ne.length?{done:!0}:{done:!1,value:ne[R++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults=a();function l(ne){e.defaults=ne}var c=/[&<>"']/,d=/[&<>"']/g,h=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,f={"&":"&","<":"<",">":">",'"':""","'":"'"},g=function(X){return f[X]};function m(ne,X){if(X){if(c.test(ne))return ne.replace(d,g)}else if(h.test(ne))return ne.replace(u,g);return ne}var C=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function S(ne){return ne.replace(C,function(X,Y){return Y=Y.toLowerCase(),Y==="colon"?":":Y.charAt(0)==="#"?Y.charAt(1)==="x"?String.fromCharCode(parseInt(Y.substring(2),16)):String.fromCharCode(+Y.substring(1)):""})}var w=/(^|[^\[])\^/g;function y(ne,X){ne=typeof ne=="string"?ne:ne.source,X=X||"";var Y={replace:function(O,q){return q=q.source||q,q=q.replace(w,"$1"),ne=ne.replace(O,q),Y},getRegex:function(){return new RegExp(ne,X)}};return Y}var x=/[^\w:]/g,k=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function T(ne,X,Y){if(ne){var R;try{R=decodeURIComponent(S(Y)).replace(x,"").toLowerCase()}catch{return null}if(R.indexOf("javascript:")===0||R.indexOf("vbscript:")===0||R.indexOf("data:")===0)return null}X&&!k.test(Y)&&(Y=G(X,Y));try{Y=encodeURI(Y).replace(/%25/g,"%")}catch{return null}return Y}var N={},M=/^[^:]+:\/*[^/]*$/,W=/^([^:]+:)[\s\S]*$/,j=/^([^:]+:\/*[^/]*)[\s\S]*$/;function G(ne,X){N[" "+ne]||(M.test(ne)?N[" "+ne]=ne+"/":N[" "+ne]=ee(ne,"/",!0)),ne=N[" "+ne];var Y=ne.indexOf(":")===-1;return X.substring(0,2)==="//"?Y?X:ne.replace(W,"$1")+X:X.charAt(0)==="/"?Y?X:ne.replace(j,"$1")+X:ne+X}var V={exec:function(){}};function z(ne){for(var X=1,Y,R;X=0&&re[Ie]==="\\";)fe=!fe;return fe?"|":" |"}),R=Y.split(/ \|/),O=0;if(R[0].trim()||R.shift(),R.length>0&&!R[R.length-1].trim()&&R.pop(),R.length>X)R.splice(X);else for(;R.length1;)X&1&&(Y+=ne),X>>=1,ne+=ne;return Y+ne}function pe(ne,X,Y,R){var O=X.href,q=X.title?m(X.title):null,K=ne[1].replace(/\\([\[\]])/g,"$1");if(ne[0].charAt(0)!=="!"){R.state.inLink=!0;var re={type:"link",raw:Y,href:O,title:q,text:K,tokens:R.inlineTokens(K)};return R.state.inLink=!1,re}return{type:"image",raw:Y,href:O,title:q,text:m(K)}}function Pe(ne,X){var Y=ne.match(/^(\s+)(?:```)/);if(Y===null)return X;var R=Y[1];return X.split(` +`).map(function(O){var q=O.match(/^\s+/);if(q===null)return O;var K=q[0];return K.length>=R.length?O.slice(R.length):O}).join(` +`)}var Qe=function(){function ne(Y){this.options=Y||e.defaults}var X=ne.prototype;return X.space=function(R){var O=this.rules.block.newline.exec(R);if(O&&O[0].length>0)return{type:"space",raw:O[0]}},X.code=function(R){var O=this.rules.block.code.exec(R);if(O){var q=O[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:O[0],codeBlockStyle:"indented",text:this.options.pedantic?q:ee(q,` +`)}}},X.fences=function(R){var O=this.rules.block.fences.exec(R);if(O){var q=O[0],K=Pe(q,O[3]||"");return{type:"code",raw:q,lang:O[2]?O[2].trim():O[2],text:K}}},X.heading=function(R){var O=this.rules.block.heading.exec(R);if(O){var q=O[2].trim();if(/#$/.test(q)){var K=ee(q,"#");(this.options.pedantic||!K||/ $/.test(K))&&(q=K.trim())}return{type:"heading",raw:O[0],depth:O[1].length,text:q,tokens:this.lexer.inline(q)}}},X.hr=function(R){var O=this.rules.block.hr.exec(R);if(O)return{type:"hr",raw:O[0]}},X.blockquote=function(R){var O=this.rules.block.blockquote.exec(R);if(O){var q=O[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:O[0],tokens:this.lexer.blockTokens(q,[]),text:q}}},X.list=function(R){var O=this.rules.block.list.exec(R);if(O){var q,K,re,fe,Ie,Me,st,it,qt,Wt,Ue,ki,Di=O[1].trim(),yr=Di.length>1,Nt={type:"list",raw:"",ordered:yr,start:yr?+Di.slice(0,-1):"",loose:!1,items:[]};Di=yr?"\\d{1,9}\\"+Di.slice(-1):"\\"+Di,this.options.pedantic&&(Di=yr?Di:"[*+-]");for(var Zi=new RegExp("^( {0,3}"+Di+")((?:[ ][^\\n]*)?(?:\\n|$))");R&&(ki=!1,!(!(O=Zi.exec(R))||this.rules.block.hr.test(R)));){if(q=O[0],R=R.substring(q.length),it=O[2].split(` +`,1)[0],qt=R.split(` +`,1)[0],this.options.pedantic?(fe=2,Ue=it.trimLeft()):(fe=O[2].search(/[^ ]/),fe=fe>4?1:fe,Ue=it.slice(fe),fe+=O[1].length),Me=!1,!it&&/^ *$/.test(qt)&&(q+=qt+` +`,R=R.substring(qt.length+1),ki=!0),!ki)for(var Zh=new RegExp("^ {0,"+Math.min(3,fe-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),Yh=new RegExp("^ {0,"+Math.min(3,fe-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),fa=new RegExp("^ {0,"+Math.min(3,fe-1)+"}(?:```|~~~)"),ud=new RegExp("^ {0,"+Math.min(3,fe-1)+"}#");R&&(Wt=R.split(` +`,1)[0],it=Wt,this.options.pedantic&&(it=it.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(fa.test(it)||ud.test(it)||Zh.test(it)||Yh.test(R)));){if(it.search(/[^ ]/)>=fe||!it.trim())Ue+=` +`+it.slice(fe);else if(!Me)Ue+=` +`+it;else break;!Me&&!it.trim()&&(Me=!0),q+=Wt+` +`,R=R.substring(Wt.length+1)}Nt.loose||(st?Nt.loose=!0:/\n *\n *$/.test(q)&&(st=!0)),this.options.gfm&&(K=/^\[[ xX]\] /.exec(Ue),K&&(re=K[0]!=="[ ] ",Ue=Ue.replace(/^\[[ xX]\] +/,""))),Nt.items.push({type:"list_item",raw:q,task:!!K,checked:re,loose:!1,text:Ue}),Nt.raw+=q}Nt.items[Nt.items.length-1].raw=q.trimRight(),Nt.items[Nt.items.length-1].text=Ue.trimRight(),Nt.raw=Nt.raw.trimRight();var Xh=Nt.items.length;for(Ie=0;Ie1)return!0}return!1});!Nt.loose&&Qh.length&&rg&&(Nt.loose=!0,Nt.items[Ie].loose=!0)}return Nt}},X.html=function(R){var O=this.rules.block.html.exec(R);if(O){var q={type:"html",raw:O[0],pre:!this.options.sanitizer&&(O[1]==="pre"||O[1]==="script"||O[1]==="style"),text:O[0]};if(this.options.sanitize){var K=this.options.sanitizer?this.options.sanitizer(O[0]):m(O[0]);q.type="paragraph",q.text=K,q.tokens=this.lexer.inline(K)}return q}},X.def=function(R){var O=this.rules.block.def.exec(R);if(O){O[3]&&(O[3]=O[3].substring(1,O[3].length-1));var q=O[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:q,raw:O[0],href:O[2],title:O[3]}}},X.table=function(R){var O=this.rules.block.table.exec(R);if(O){var q={type:"table",header:te(O[1]).map(function(st){return{text:st}}),align:O[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:O[3]&&O[3].trim()?O[3].replace(/\n[ \t]*$/,"").split(` +`):[]};if(q.header.length===q.align.length){q.raw=O[0];var K=q.align.length,re,fe,Ie,Me;for(re=0;re/i.test(O[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(O[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(O[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:O[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(O[0]):m(O[0]):O[0]}},X.link=function(R){var O=this.rules.inline.link.exec(R);if(O){var q=O[2].trim();if(!this.options.pedantic&&/^$/.test(q))return;var K=ee(q.slice(0,-1),"\\");if((q.length-K.length)%2===0)return}else{var re=ce(O[2],"()");if(re>-1){var fe=O[0].indexOf("!")===0?5:4,Ie=fe+O[1].length+re;O[2]=O[2].substring(0,re),O[0]=O[0].substring(0,Ie).trim(),O[3]=""}}var Me=O[2],st="";if(this.options.pedantic){var it=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Me);it&&(Me=it[1],st=it[3])}else st=O[3]?O[3].slice(1,-1):"";return Me=Me.trim(),/^$/.test(q)?Me=Me.slice(1):Me=Me.slice(1,-1)),pe(O,{href:Me&&Me.replace(this.rules.inline._escapes,"$1"),title:st&&st.replace(this.rules.inline._escapes,"$1")},O[0],this.lexer)}},X.reflink=function(R,O){var q;if((q=this.rules.inline.reflink.exec(R))||(q=this.rules.inline.nolink.exec(R))){var K=(q[2]||q[1]).replace(/\s+/g," ");if(K=O[K.toLowerCase()],!K||!K.href){var re=q[0].charAt(0);return{type:"text",raw:re,text:re}}return pe(q,K,q[0],this.lexer)}},X.emStrong=function(R,O,q){q===void 0&&(q="");var K=this.rules.inline.emStrong.lDelim.exec(R);if(K&&!(K[3]&&q.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var re=K[1]||K[2]||"";if(!re||re&&(q===""||this.rules.inline.punctuation.exec(q))){var fe=K[0].length-1,Ie,Me,st=fe,it=0,qt=K[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(qt.lastIndex=0,O=O.slice(-1*R.length+fe);(K=qt.exec(O))!=null;)if(Ie=K[1]||K[2]||K[3]||K[4]||K[5]||K[6],!!Ie){if(Me=Ie.length,K[3]||K[4]){st+=Me;continue}else if((K[5]||K[6])&&fe%3&&!((fe+Me)%3)){it+=Me;continue}if(st-=Me,!(st>0)){if(Me=Math.min(Me,Me+st+it),Math.min(fe,Me)%2){var Wt=R.slice(1,fe+K.index+Me);return{type:"em",raw:R.slice(0,fe+K.index+Me+1),text:Wt,tokens:this.lexer.inlineTokens(Wt)}}var Ue=R.slice(2,fe+K.index+Me-1);return{type:"strong",raw:R.slice(0,fe+K.index+Me+1),text:Ue,tokens:this.lexer.inlineTokens(Ue)}}}}}},X.codespan=function(R){var O=this.rules.inline.code.exec(R);if(O){var q=O[2].replace(/\n/g," "),K=/[^ ]/.test(q),re=/^ /.test(q)&&/ $/.test(q);return K&&re&&(q=q.substring(1,q.length-1)),q=m(q,!0),{type:"codespan",raw:O[0],text:q}}},X.br=function(R){var O=this.rules.inline.br.exec(R);if(O)return{type:"br",raw:O[0]}},X.del=function(R){var O=this.rules.inline.del.exec(R);if(O)return{type:"del",raw:O[0],text:O[2],tokens:this.lexer.inlineTokens(O[2])}},X.autolink=function(R,O){var q=this.rules.inline.autolink.exec(R);if(q){var K,re;return q[2]==="@"?(K=m(this.options.mangle?O(q[1]):q[1]),re="mailto:"+K):(K=m(q[1]),re=K),{type:"link",raw:q[0],text:K,href:re,tokens:[{type:"text",raw:K,text:K}]}}},X.url=function(R,O){var q;if(q=this.rules.inline.url.exec(R)){var K,re;if(q[2]==="@")K=m(this.options.mangle?O(q[0]):q[0]),re="mailto:"+K;else{var fe;do fe=q[0],q[0]=this.rules.inline._backpedal.exec(q[0])[0];while(fe!==q[0]);K=m(q[0]),q[1]==="www."?re="http://"+K:re=K}return{type:"link",raw:q[0],text:K,href:re,tokens:[{type:"text",raw:K,text:K}]}}},X.inlineText=function(R,O){var q=this.rules.inline.text.exec(R);if(q){var K;return this.lexer.state.inRawBlock?K=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(q[0]):m(q[0]):q[0]:K=m(this.options.smartypants?O(q[0]):q[0]),{type:"text",raw:q[0],text:K}}},ne}(),Te={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:V,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};Te._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Te._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Te.def=y(Te.def).replace("label",Te._label).replace("title",Te._title).getRegex(),Te.bullet=/(?:[*+-]|\d{1,9}[.)])/,Te.listItemStart=y(/^( *)(bull) */).replace("bull",Te.bullet).getRegex(),Te.list=y(Te.list).replace(/bull/g,Te.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Te.def.source+")").getRegex(),Te._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Te._comment=/|$)/,Te.html=y(Te.html,"i").replace("comment",Te._comment).replace("tag",Te._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Te.paragraph=y(Te._paragraph).replace("hr",Te.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Te._tag).getRegex(),Te.blockquote=y(Te.blockquote).replace("paragraph",Te.paragraph).getRegex(),Te.normal=z({},Te),Te.gfm=z({},Te.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Te.gfm.table=y(Te.gfm.table).replace("hr",Te.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Te._tag).getRegex(),Te.gfm.paragraph=y(Te._paragraph).replace("hr",Te.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Te.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Te._tag).getRegex(),Te.pedantic=z({},Te.normal,{html:y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Te._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:V,paragraph:y(Te.normal._paragraph).replace("hr",Te.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",Te.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var de={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:V,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:V,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",de.punctuation=y(de.punctuation).replace(/punctuation/g,de._punctuation).getRegex(),de.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,de.escapedEmSt=/\\\*|\\_/g,de._comment=y(Te._comment).replace("(?:-->|$)","-->").getRegex(),de.emStrong.lDelim=y(de.emStrong.lDelim).replace(/punct/g,de._punctuation).getRegex(),de.emStrong.rDelimAst=y(de.emStrong.rDelimAst,"g").replace(/punct/g,de._punctuation).getRegex(),de.emStrong.rDelimUnd=y(de.emStrong.rDelimUnd,"g").replace(/punct/g,de._punctuation).getRegex(),de._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,de._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,de._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,de.autolink=y(de.autolink).replace("scheme",de._scheme).replace("email",de._email).getRegex(),de._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,de.tag=y(de.tag).replace("comment",de._comment).replace("attribute",de._attribute).getRegex(),de._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,de._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,de._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,de.link=y(de.link).replace("label",de._label).replace("href",de._href).replace("title",de._title).getRegex(),de.reflink=y(de.reflink).replace("label",de._label).replace("ref",Te._label).getRegex(),de.nolink=y(de.nolink).replace("ref",Te._label).getRegex(),de.reflinkSearch=y(de.reflinkSearch,"g").replace("reflink",de.reflink).replace("nolink",de.nolink).getRegex(),de.normal=z({},de),de.pedantic=z({},de.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:y(/^!?\[(label)\]\((.*?)\)/).replace("label",de._label).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",de._label).getRegex()}),de.gfm=z({},de.normal,{escape:y(de.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(R="x"+R.toString(16)),X+="&#"+R+";";return X}var Gi=function(){function ne(Y){this.tokens=[],this.tokens.links=Object.create(null),this.options=Y||e.defaults,this.options.tokenizer=this.options.tokenizer||new Qe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var R={block:Te.normal,inline:de.normal};this.options.pedantic?(R.block=Te.pedantic,R.inline=de.pedantic):this.options.gfm&&(R.block=Te.gfm,this.options.breaks?R.inline=de.breaks:R.inline=de.gfm),this.tokenizer.rules=R}ne.lex=function(R,O){var q=new ne(O);return q.lex(R)},ne.lexInline=function(R,O){var q=new ne(O);return q.inlineTokens(R)};var X=ne.prototype;return X.lex=function(R){R=R.replace(/\r\n|\r/g,` +`),this.blockTokens(R,this.tokens);for(var O;O=this.inlineQueue.shift();)this.inlineTokens(O.src,O.tokens);return this.tokens},X.blockTokens=function(R,O){var q=this;O===void 0&&(O=[]),this.options.pedantic?R=R.replace(/\t/g," ").replace(/^ +$/gm,""):R=R.replace(/^( *)(\t+)/gm,function(st,it,qt){return it+" ".repeat(qt.length)});for(var K,re,fe,Ie;R;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(st){return(K=st.call({lexer:q},R,O))?(R=R.substring(K.raw.length),O.push(K),!0):!1}))){if(K=this.tokenizer.space(R)){R=R.substring(K.raw.length),K.raw.length===1&&O.length>0?O[O.length-1].raw+=` +`:O.push(K);continue}if(K=this.tokenizer.code(R)){R=R.substring(K.raw.length),re=O[O.length-1],re&&(re.type==="paragraph"||re.type==="text")?(re.raw+=` +`+K.raw,re.text+=` +`+K.text,this.inlineQueue[this.inlineQueue.length-1].src=re.text):O.push(K);continue}if(K=this.tokenizer.fences(R)){R=R.substring(K.raw.length),O.push(K);continue}if(K=this.tokenizer.heading(R)){R=R.substring(K.raw.length),O.push(K);continue}if(K=this.tokenizer.hr(R)){R=R.substring(K.raw.length),O.push(K);continue}if(K=this.tokenizer.blockquote(R)){R=R.substring(K.raw.length),O.push(K);continue}if(K=this.tokenizer.list(R)){R=R.substring(K.raw.length),O.push(K);continue}if(K=this.tokenizer.html(R)){R=R.substring(K.raw.length),O.push(K);continue}if(K=this.tokenizer.def(R)){R=R.substring(K.raw.length),re=O[O.length-1],re&&(re.type==="paragraph"||re.type==="text")?(re.raw+=` +`+K.raw,re.text+=` +`+K.raw,this.inlineQueue[this.inlineQueue.length-1].src=re.text):this.tokens.links[K.tag]||(this.tokens.links[K.tag]={href:K.href,title:K.title});continue}if(K=this.tokenizer.table(R)){R=R.substring(K.raw.length),O.push(K);continue}if(K=this.tokenizer.lheading(R)){R=R.substring(K.raw.length),O.push(K);continue}if(fe=R,this.options.extensions&&this.options.extensions.startBlock&&function(){var st=1/0,it=R.slice(1),qt=void 0;q.options.extensions.startBlock.forEach(function(Wt){qt=Wt.call({lexer:this},it),typeof qt=="number"&&qt>=0&&(st=Math.min(st,qt))}),st<1/0&&st>=0&&(fe=R.substring(0,st+1))}(),this.state.top&&(K=this.tokenizer.paragraph(fe))){re=O[O.length-1],Ie&&re.type==="paragraph"?(re.raw+=` +`+K.raw,re.text+=` +`+K.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=re.text):O.push(K),Ie=fe.length!==R.length,R=R.substring(K.raw.length);continue}if(K=this.tokenizer.text(R)){R=R.substring(K.raw.length),re=O[O.length-1],re&&re.type==="text"?(re.raw+=` +`+K.raw,re.text+=` +`+K.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=re.text):O.push(K);continue}if(R){var Me="Infinite loop on byte: "+R.charCodeAt(0);if(this.options.silent){console.error(Me);break}else throw new Error(Me)}}return this.state.top=!0,O},X.inline=function(R,O){return O===void 0&&(O=[]),this.inlineQueue.push({src:R,tokens:O}),O},X.inlineTokens=function(R,O){var q=this;O===void 0&&(O=[]);var K,re,fe,Ie=R,Me,st,it;if(this.tokens.links){var qt=Object.keys(this.tokens.links);if(qt.length>0)for(;(Me=this.tokenizer.rules.inline.reflinkSearch.exec(Ie))!=null;)qt.includes(Me[0].slice(Me[0].lastIndexOf("[")+1,-1))&&(Ie=Ie.slice(0,Me.index)+"["+Se("a",Me[0].length-2)+"]"+Ie.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Me=this.tokenizer.rules.inline.blockSkip.exec(Ie))!=null;)Ie=Ie.slice(0,Me.index)+"["+Se("a",Me[0].length-2)+"]"+Ie.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(Me=this.tokenizer.rules.inline.escapedEmSt.exec(Ie))!=null;)Ie=Ie.slice(0,Me.index)+"++"+Ie.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;R;)if(st||(it=""),st=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Ue){return(K=Ue.call({lexer:q},R,O))?(R=R.substring(K.raw.length),O.push(K),!0):!1}))){if(K=this.tokenizer.escape(R)){R=R.substring(K.raw.length),O.push(K);continue}if(K=this.tokenizer.tag(R)){R=R.substring(K.raw.length),re=O[O.length-1],re&&K.type==="text"&&re.type==="text"?(re.raw+=K.raw,re.text+=K.text):O.push(K);continue}if(K=this.tokenizer.link(R)){R=R.substring(K.raw.length),O.push(K);continue}if(K=this.tokenizer.reflink(R,this.tokens.links)){R=R.substring(K.raw.length),re=O[O.length-1],re&&K.type==="text"&&re.type==="text"?(re.raw+=K.raw,re.text+=K.text):O.push(K);continue}if(K=this.tokenizer.emStrong(R,Ie,it)){R=R.substring(K.raw.length),O.push(K);continue}if(K=this.tokenizer.codespan(R)){R=R.substring(K.raw.length),O.push(K);continue}if(K=this.tokenizer.br(R)){R=R.substring(K.raw.length),O.push(K);continue}if(K=this.tokenizer.del(R)){R=R.substring(K.raw.length),O.push(K);continue}if(K=this.tokenizer.autolink(R,Vn)){R=R.substring(K.raw.length),O.push(K);continue}if(!this.state.inLink&&(K=this.tokenizer.url(R,Vn))){R=R.substring(K.raw.length),O.push(K);continue}if(fe=R,this.options.extensions&&this.options.extensions.startInline&&function(){var Ue=1/0,ki=R.slice(1),Di=void 0;q.options.extensions.startInline.forEach(function(yr){Di=yr.call({lexer:this},ki),typeof Di=="number"&&Di>=0&&(Ue=Math.min(Ue,Di))}),Ue<1/0&&Ue>=0&&(fe=R.substring(0,Ue+1))}(),K=this.tokenizer.inlineText(fe,Ki)){R=R.substring(K.raw.length),K.raw.slice(-1)!=="_"&&(it=K.raw.slice(-1)),st=!0,re=O[O.length-1],re&&re.type==="text"?(re.raw+=K.raw,re.text+=K.text):O.push(K);continue}if(R){var Wt="Infinite loop on byte: "+R.charCodeAt(0);if(this.options.silent){console.error(Wt);break}else throw new Error(Wt)}}return O},i(ne,null,[{key:"rules",get:function(){return{block:Te,inline:de}}}]),ne}(),Ns=function(){function ne(Y){this.options=Y||e.defaults}var X=ne.prototype;return X.code=function(R,O,q){var K=(O||"").match(/\S*/)[0];if(this.options.highlight){var re=this.options.highlight(R,K);re!=null&&re!==R&&(q=!0,R=re)}return R=R.replace(/\n$/,"")+` +`,K?'
'+(q?R:m(R,!0))+`
+`:"
"+(q?R:m(R,!0))+`
+`},X.blockquote=function(R){return`
+`+R+`
+`},X.html=function(R){return R},X.heading=function(R,O,q,K){if(this.options.headerIds){var re=this.options.headerPrefix+K.slug(q);return"'+R+" +`}return""+R+" +`},X.hr=function(){return this.options.xhtml?`
+`:`
+`},X.list=function(R,O,q){var K=O?"ol":"ul",re=O&&q!==1?' start="'+q+'"':"";return"<"+K+re+`> +`+R+" +`},X.listitem=function(R){return"
  • "+R+`
  • +`},X.checkbox=function(R){return" "},X.paragraph=function(R){return"

    "+R+`

    +`},X.table=function(R,O){return O&&(O=""+O+""),` + +`+R+` +`+O+`
    +`},X.tablerow=function(R){return` +`+R+` +`},X.tablecell=function(R,O){var q=O.header?"th":"td",K=O.align?"<"+q+' align="'+O.align+'">':"<"+q+">";return K+R+(" +`)},X.strong=function(R){return""+R+""},X.em=function(R){return""+R+""},X.codespan=function(R){return""+R+""},X.br=function(){return this.options.xhtml?"
    ":"
    "},X.del=function(R){return""+R+""},X.link=function(R,O,q){if(R=T(this.options.sanitize,this.options.baseUrl,R),R===null)return q;var K='",K},X.image=function(R,O,q){if(R=T(this.options.sanitize,this.options.baseUrl,R),R===null)return q;var K=''+q+'":">",K},X.text=function(R){return R},ne}(),Ot=function(){function ne(){}var X=ne.prototype;return X.strong=function(R){return R},X.em=function(R){return R},X.codespan=function(R){return R},X.del=function(R){return R},X.html=function(R){return R},X.text=function(R){return R},X.link=function(R,O,q){return""+q},X.image=function(R,O,q){return""+q},X.br=function(){return""},ne}(),Cn=function(){function ne(){this.seen={}}var X=ne.prototype;return X.serialize=function(R){return R.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},X.getNextSafeSlug=function(R,O){var q=R,K=0;if(this.seen.hasOwnProperty(q)){K=this.seen[R];do K++,q=R+"-"+K;while(this.seen.hasOwnProperty(q))}return O||(this.seen[R]=K,this.seen[q]=0),q},X.slug=function(R,O){O===void 0&&(O={});var q=this.serialize(R);return this.getNextSafeSlug(q,O.dryrun)},ne}(),Ni=function(){function ne(Y){this.options=Y||e.defaults,this.options.renderer=this.options.renderer||new Ns,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ot,this.slugger=new Cn}ne.parse=function(R,O){var q=new ne(O);return q.parse(R)},ne.parseInline=function(R,O){var q=new ne(O);return q.parseInline(R)};var X=ne.prototype;return X.parse=function(R,O){O===void 0&&(O=!0);var q="",K,re,fe,Ie,Me,st,it,qt,Wt,Ue,ki,Di,yr,Nt,Zi,Zh,Yh,fa,ud,Xh=R.length;for(K=0;K0&&Zi.tokens[0].type==="paragraph"?(Zi.tokens[0].text=fa+" "+Zi.tokens[0].text,Zi.tokens[0].tokens&&Zi.tokens[0].tokens.length>0&&Zi.tokens[0].tokens[0].type==="text"&&(Zi.tokens[0].tokens[0].text=fa+" "+Zi.tokens[0].tokens[0].text)):Zi.tokens.unshift({type:"text",text:fa}):Nt+=fa),Nt+=this.parse(Zi.tokens,yr),Wt+=this.renderer.listitem(Nt,Yh,Zh);q+=this.renderer.list(Wt,ki,Di);continue}case"html":{q+=this.renderer.html(Ue.text);continue}case"paragraph":{q+=this.renderer.paragraph(this.parseInline(Ue.tokens));continue}case"text":{for(Wt=Ue.tokens?this.parseInline(Ue.tokens):Ue.text;K+1"u"||ne===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ne!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ne)+", string expected");if(typeof X=="function"&&(Y=X,X=null),X=z({},tt.defaults,X||{}),Ce(X),Y){var R=X.highlight,O;try{O=Gi.lex(ne,X)}catch(Ie){return Y(Ie)}var q=function(Me){var st;if(!Me)try{X.walkTokens&&tt.walkTokens(O,X.walkTokens),st=Ni.parse(O,X)}catch(it){Me=it}return X.highlight=R,Me?Y(Me):Y(null,st)};if(!R||R.length<3||(delete X.highlight,!O.length))return q();var K=0;tt.walkTokens(O,function(Ie){Ie.type==="code"&&(K++,setTimeout(function(){R(Ie.text,Ie.lang,function(Me,st){if(Me)return q(Me);st!=null&&st!==Ie.text&&(Ie.text=st,Ie.escaped=!0),K--,K===0&&q()})},0))}),K===0&&q();return}function re(Ie){if(Ie.message+=` +Please report this to https://github.com/markedjs/marked.`,X.silent)return"

    An error occurred:

    "+m(Ie.message+"",!0)+"
    ";throw Ie}try{var fe=Gi.lex(ne,X);if(X.walkTokens){if(X.async)return Promise.all(tt.walkTokens(fe,X.walkTokens)).then(function(){return Ni.parse(fe,X)}).catch(re);tt.walkTokens(fe,X.walkTokens)}return Ni.parse(fe,X)}catch(Ie){re(Ie)}}tt.options=tt.setOptions=function(ne){return z(tt.defaults,ne),l(tt.defaults),tt},tt.getDefaults=a,tt.defaults=e.defaults,tt.use=function(){for(var ne=arguments.length,X=new Array(ne),Y=0;Y"u"||ne===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof ne!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(ne)+", string expected");X=z({},tt.defaults,X||{}),Ce(X);try{var Y=Gi.lexInline(ne,X);return X.walkTokens&&tt.walkTokens(Y,X.walkTokens),Ni.parseInline(Y,X)}catch(R){if(R.message+=` +Please report this to https://github.com/markedjs/marked.`,X.silent)return"

    An error occurred:

    "+m(R.message+"",!0)+"
    ";throw R}},tt.Parser=Ni,tt.parser=Ni.parse,tt.Renderer=Ns,tt.TextRenderer=Ot,tt.Lexer=Gi,tt.lexer=Gi.lex,tt.Tokenizer=Qe,tt.Slugger=Cn,tt.parse=tt;var vr=tt.options,Cr=tt.setOptions,cs=tt.use,wr=tt.walkTokens,pc=tt.parseInline,Hn=tt,ua=Ni.parse,uI=Gi.lex;e.Lexer=Gi,e.Parser=Ni,e.Renderer=Ns,e.Slugger=Cn,e.TextRenderer=Ot,e.Tokenizer=Qe,e.getDefaults=a,e.lexer=uI,e.marked=tt,e.options=vr,e.parse=Hn,e.parseInline=pc,e.parser=ua,e.setOptions=Cr,e.use=cs,e.walkTokens=wr,Object.defineProperty(e,"__esModule",{value:!0})})})();var eUe=$o.Lexer||exports.Lexer,tUe=$o.Parser||exports.Parser,iUe=$o.Renderer||exports.Renderer,nUe=$o.Slugger||exports.Slugger,oUe=$o.TextRenderer||exports.TextRenderer,sUe=$o.Tokenizer||exports.Tokenizer,rUe=$o.getDefaults||exports.getDefaults,aUe=$o.lexer||exports.lexer,Xa=$o.marked||exports.marked,lUe=$o.options||exports.options,cUe=$o.parse||exports.parse,dUe=$o.parseInline||exports.parseInline,hUe=$o.parser||exports.parser,uUe=$o.setOptions||exports.setOptions,fUe=$o.use||exports.use,gUe=$o.walkTokens||exports.walkTokens;_();v();b();A0();sn();function NV(n){return JSON.stringify(n,zY)}function Sv(n){let e=JSON.parse(n);return e=d5(e),e}function zY(n,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function d5(n,e=0){if(!n||e>200)return n;if(typeof n=="object"){switch(n.$mid){case 1:return Oe.revive(n);case 2:return new RegExp(n.source,n.flags);case 17:return new Date(n.source)}if(n instanceof Sy||n instanceof Uint8Array)return n;if(Array.isArray(n))for(let t=0;t{let i=[],o=[];return n&&({href:n,dimensions:i}=TV(n),o.push(`src="${wv(n)}"`)),t&&o.push(`alt="${wv(t)}"`),e&&o.push(`title="${wv(e)}"`),i.length&&(o=o.concat(i)),""},paragraph:n=>`

    ${n}

    `,link:(n,e,t)=>typeof n!="string"?"":(n===t&&(t=bD(t)),e=typeof e=="string"?wv(bD(e)):"",n=bD(n),n=n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`
    ${t}`)});function kp(n,e={},t={}){var i,o;let s=new ae,r=!1,a=cD(e),l=function(S){let w;try{w=Sv(decodeURIComponent(S))}catch{}return w?(w=Z1(w,y=>{if(n.uris&&n.uris[y])return Oe.revive(n.uris[y])}),encodeURIComponent(JSON.stringify(w))):S},c=function(S,w){let y=n.uris&&n.uris[S],x=Oe.revive(y);return w?S.startsWith(Ze.data+":")?S:(x||(x=Oe.parse(S)),Ww.uriToBrowserUri(x).toString(!0)):!x||Oe.parse(S).toString()===x.toString()?S:(x.query&&(x=x.with({query:l(x.query)})),x.toString())},d=new Xa.Renderer;d.image=h5.image,d.link=h5.link,d.paragraph=h5.paragraph;let h=[],u=[];if(e.codeBlockRendererSync?d.code=(S,w)=>{let y=c5.nextId(),x=e.codeBlockRendererSync(AV(w),S);return u.push([y,x]),`
    ${hu(S)}
    `}:e.codeBlockRenderer&&(d.code=(S,w)=>{let y=c5.nextId(),x=e.codeBlockRenderer(AV(w),S);return h.push(x.then(k=>[y,k])),`
    ${hu(S)}
    `}),e.actionHandler){let S=function(x){let k=x.target;if(!(k.tagName!=="A"&&(k=k.parentElement,!k||k.tagName!=="A")))try{let T=k.dataset.href;T&&(n.baseUri&&(T=u5(Oe.from(n.baseUri),T)),e.actionHandler.callback(T,x))}catch(T){ut(T)}finally{x.preventDefault()}},w=e.actionHandler.disposables.add(new et(a,"click")),y=e.actionHandler.disposables.add(new et(a,"auxclick"));e.actionHandler.disposables.add(ie.any(w.event,y.event)(x=>{let k=new yn(ge(a),x);!k.leftButton&&!k.middleButton||S(k)})),e.actionHandler.disposables.add($(a,"keydown",x=>{let k=new bt(x);!k.equals(10)&&!k.equals(3)||S(k)}))}n.supportHtml||(t.sanitizer=S=>(n.isTrusted?S.match(/^(]+>)|(<\/\s*span>)$/):void 0)?S:"",t.sanitize=!0,t.silent=!0),t.renderer=d;let f=(i=n.value)!==null&&i!==void 0?i:"";f.length>1e5&&(f=`${f.substr(0,1e5)}\u2026`),n.supportThemeIcons&&(f=DV(f));let g;if(e.fillInIncompleteTokens){let S={...Xa.defaults,...t},w=Xa.lexer(f,S),y=jY(w);g=Xa.parser(y,S)}else g=Xa.parse(f,t);n.supportThemeIcons&&(g=ra(g).map(w=>typeof w=="string"?w:w.outerHTML).join(""));let C=new DOMParser().parseFromString(f5(n,g),"text/html");if(C.body.querySelectorAll("img, audio, video, source").forEach(S=>{let w=S.getAttribute("src");if(w){let y=w;try{n.baseUri&&(y=u5(Oe.from(n.baseUri),y))}catch{}if(S.setAttribute("src",c(y,!0)),e.disallowRemoteImages){let x=Oe.parse(y).scheme;x!==Ze.file&&x!==Ze.data&&S.replaceWith(ve("",void 0,S.outerHTML))}}}),C.body.querySelectorAll("a").forEach(S=>{let w=S.getAttribute("href");if(S.setAttribute("href",""),!w||/^data:|javascript:/i.test(w)||/^command:/i.test(w)&&!n.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(w))S.replaceWith(...S.childNodes);else{let y=c(w,!1);n.baseUri&&(y=u5(Oe.from(n.baseUri),w)),S.dataset.href=y}}),a.innerHTML=f5(n,C.body.innerHTML),h.length>0)Promise.all(h).then(S=>{var w,y;if(r)return;let x=new Map(S),k=a.querySelectorAll("div[data-code]");for(let T of k){let N=x.get((w=T.dataset.code)!==null&&w!==void 0?w:"");N&&Wi(T,N)}(y=e.asyncRenderCallback)===null||y===void 0||y.call(e)});else if(u.length>0){let S=new Map(u),w=a.querySelectorAll("div[data-code]");for(let y of w){let x=S.get((o=y.dataset.code)!==null&&o!==void 0?o:"");x&&Wi(y,x)}}if(e.asyncRenderCallback)for(let S of a.getElementsByTagName("img")){let w=s.add($(S,"load",()=>{w.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{r=!0,s.dispose()}}}function AV(n){if(!n)return"";let e=n.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:n}function u5(n,e){return/^\w[\w\d+.-]*:/.test(e)?e:n.path.endsWith("/")?SR(n,e).toString():SR(QW(n),e).toString()}function f5(n,e){let{config:t,allowedSchemes:i}=HY(n);l0("uponSanitizeAttribute",(s,r)=>{var a;if(r.attrName==="style"||r.attrName==="class"){if(s.tagName==="SPAN"){if(r.attrName==="style"){r.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(r.attrValue);return}else if(r.attrName==="class"){r.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(r.attrValue);return}}r.keepAttr=!1;return}else if(s.tagName==="INPUT"&&((a=s.attributes.getNamedItem("type"))===null||a===void 0?void 0:a.value)==="checkbox"){if(r.attrName==="type"&&r.attrValue==="checkbox"||r.attrName==="disabled"||r.attrName==="checked"){r.keepAttr=!0;return}r.keepAttr=!1}}),l0("uponSanitizeElement",(s,r)=>{var a,l;r.tagName==="input"&&(((a=s.attributes.getNamedItem("type"))===null||a===void 0?void 0:a.value)==="checkbox"?s.setAttribute("disabled",""):(l=s.parentElement)===null||l===void 0||l.removeChild(s))});let o=Z7(i);try{return Pw(e,{...t,RETURN_TRUSTED_TYPE:!0})}finally{Ow("uponSanitizeAttribute"),o.dispose()}}var VY=["align","autoplay","alt","checked","class","controls","data-code","data-href","disabled","draggable","height","href","loop","muted","playsinline","poster","src","style","target","title","type","width","start"];function HY(n){let e=[Ze.http,Ze.https,Ze.mailto,Ze.data,Ze.file,Ze.vscodeFileResource,Ze.vscodeRemote,Ze.vscodeRemoteResource];return n.isTrusted&&e.push(Ze.command),{config:{ALLOWED_TAGS:[...Y7],ALLOWED_ATTR:VY,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function PV(n){return typeof n=="string"?n:UY(n)}function UY(n){var e;let t=(e=n.value)!==null&&e!==void 0?e:"";t.length>1e5&&(t=`${t.substr(0,1e5)}\u2026`);let i=Xa.parse(t,{renderer:$Y.value}).replace(/&(#\d+|[a-zA-Z]+);/g,o=>{var s;return(s=KY.get(o))!==null&&s!==void 0?s:o});return f5({isTrusted:!1},i).toString()}var KY=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]),$Y=new qn(()=>{let n=new Xa.Renderer;return n.code=e=>e,n.blockquote=e=>e,n.html=e=>"",n.heading=(e,t,i)=>e+` +`,n.hr=()=>"",n.list=(e,t)=>e,n.listitem=e=>e+` +`,n.paragraph=e=>e+` +`,n.table=(e,t)=>e+t+` +`,n.tablerow=e=>e,n.tablecell=(e,t)=>e+" ",n.strong=e=>e,n.em=e=>e,n.codespan=e=>e,n.br=()=>` +`,n.del=e=>e,n.image=(e,t,i)=>"",n.text=e=>e,n.link=(e,t,i)=>i,n});function g5(n){let e="";return n.forEach(t=>{e+=t.raw}),e}function qY(n){var e,t;for(let i=0;iMV(a.raw)))return JY(n)}}}}function MV(n){return!!n.match(/^[^\[]*\]\([^\)]*$/)}function jY(n){let e,t;for(e=0;e"u"&&r.match(/^\s*\|/)){let a=r.match(/(\|[^\|]+)(?=\||$)/g);a&&(i=a.length)}else if(typeof i=="number")if(r.match(/^\s*\|/)){if(s!==t.length-1)return;o=!0}else return}if(typeof i=="number"&&i>0){let s=o?t.slice(0,-1).join(` +`):e,r=!!s.match(/\|\s*$/),a=s+(r?"":"|")+` +|${" --- |".repeat(i)}`;return Xa.lexer(a)}}xt();ye();le();Hr();Ma();var nX=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},OV=function(n,e){return function(t,i){e(t,i,n)}},m5,xv=m5=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new B,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};let o=new ae,s=o.add(kp(e,{...this._getRenderOptions(e,o),...t},i));return s.element.classList.add("rendered-markdown"),{element:s.element,dispose:()=>o.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,o)=>{var s,r,a;let l;i?l=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(l=(s=this._options.editor.getModel())===null||s===void 0?void 0:s.getLanguageId()),l||(l=In);let c=await Nz(this._languageService,o,l),d=document.createElement("span");if(d.innerHTML=(a=(r=m5._ttpTokenizer)===null||r===void 0?void 0:r.createHTML(c))!==null&&a!==void 0?a:c,this._options.editor){let h=this._options.editor.getOption(50);Si(d,h)}else this._options.codeBlockFontFamily&&(d.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(d.style.fontSize=this._options.codeBlockFontSize),d},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>p5(this._openerService,i,e.isTrusted),disposables:t}}}};xv._ttpTokenizer=Bs("tokenizeToString",{createHTML(n){return n}});xv=m5=nX([OV(1,ii),OV(2,Jl)],xv);async function p5(n,e,t){try{return await n.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:oX(t)})}catch(i){return ut(i),!1}}function oX(n){return n===!0?!0:n&&Array.isArray(n.enabledCommands)?n.enabledCommands:!1}Lp();Ge();Lt();var sX=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Lv=function(n,e){return function(t,i){e(t,i,n)}},nc=ve,vD=class extends co{get _targetWindow(){return ge(this._target.targetElements[0])}get _targetDocumentElement(){return ge(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return this._hoverPosition===2?0:1}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(e,t,i,o,s,r){var a,l,c,d,h,u,f,g;super(),this._keybindingService=t,this._configurationService=i,this._openerService=o,this._instantiationService=s,this._accessibilityService=r,this._messageListeners=new ae,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._onDispose=this._register(new B),this._onRequestLayout=this._register(new B),this._linkHandler=e.linkHandler||(x=>p5(this._openerService,x,ic(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new _5(e.target),this._hoverPointer=!((a=e.appearance)===null||a===void 0)&&a.showPointer?nc("div.workbench-hover-pointer"):void 0,this._hover=this._register(new aD),this._hover.containerDomNode.classList.add("workbench-hover","fadeIn"),!((l=e.appearance)===null||l===void 0)&&l.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),!((c=e.appearance)===null||c===void 0)&&c.skipFadeInAnimation&&this._hover.containerDomNode.classList.add("skip-fade-in"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),!((d=e.position)===null||d===void 0)&&d.forcePosition&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0),this._hoverPosition=(u=(h=e.position)===null||h===void 0?void 0:h.hoverPosition)!==null&&u!==void 0?u:3,this.onmousedown(this._hover.containerDomNode,x=>x.stopPropagation()),this.onkeydown(this._hover.containerDomNode,x=>{x.equals(9)&&this.dispose()}),this._register($(this._targetWindow,"blur",()=>this.dispose()));let m=nc("div.hover-row.markdown-hover"),C=nc("div.hover-contents");if(typeof e.content=="string")C.textContent=e.content,C.style.whiteSpace="pre-wrap";else if(e.content instanceof HTMLElement)C.appendChild(e.content),C.classList.add("html-hover-contents");else{let x=e.content,k=this._instantiationService.createInstance(xv,{codeBlockFontFamily:this._configurationService.getValue("editor").fontFamily||Ao.fontFamily}),{element:T}=k.render(x,{actionHandler:{callback:N=>this._linkHandler(N),disposables:this._messageListeners},asyncRenderCallback:()=>{C.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}});C.appendChild(T)}if(m.appendChild(C),this._hover.contentsDomNode.appendChild(m),e.actions&&e.actions.length>0){let x=nc("div.hover-row.status-bar"),k=nc("div.actions");e.actions.forEach(T=>{let N=this._keybindingService.lookupKeybinding(T.commandId),M=N?N.getLabel():null;lD.render(k,{label:T.label,commandId:T.commandId,run:W=>{T.run(W),this.dispose()},iconClass:T.iconClass},M)}),x.appendChild(k),this._hover.containerDomNode.appendChild(x)}this._hoverContainer=nc("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode);let S;if(e.actions&&e.actions.length>0?S=!1:((f=e.persistence)===null||f===void 0?void 0:f.hideOnHover)===void 0?S=typeof e.content=="string"||ic(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes(""):S=e.persistence.hideOnHover,S&&(!((g=e.appearance)===null||g===void 0)&&g.showHoverHint)){let x=nc("div.hover-row.status-bar"),k=nc("div.info");k.textContent=p("hoverhint","Hold {0} key to mouse over",Be?"Option":"Alt"),x.appendChild(k),this._hover.containerDomNode.appendChild(x)}let w=[...this._target.targetElements];S||w.push(this._hoverContainer);let y=this._register(new CD(w));if(this._register(y.onMouseOut(()=>{this._isLocked||this.dispose()})),S){let x=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new CD(x)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=y}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;let e=this._hover.containerDomNode,t=this.findLastFocusableChild(this._hover.containerDomNode);if(t){let i=Ug(this._hoverContainer,nc("div")),o=me(this._hoverContainer,nc("div"));i.tabIndex=0,o.tabIndex=0,this._register($(o,"focus",s=>{e.focus(),s.preventDefault()})),this._register($(i,"focus",s=>{t.focus(),s.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t=0)return s}let o=this.findLastFocusableChild(i);if(o)return o}}render(e){var t;e.appendChild(this._hoverContainer);let o=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&oV(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(t=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||t===void 0?void 0:t.getAriaLabel());o&&Uu(o),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";let e=d=>{let h=Uw(d),u=d.getBoundingClientRect();return{top:u.top*h,bottom:u.bottom*h,right:u.right*h,left:u.left*h}},t=this._target.targetElements.map(d=>e(d)),{top:i,right:o,bottom:s,left:r}=t[0],a=o-r,l=s-i,c={top:i,right:o,bottom:s,left:r,width:a,height:l,center:{x:r+a/2,y:i+l/2}};if(this.adjustHorizontalHoverPosition(c),this.adjustVerticalHoverPosition(c),this.adjustHoverMaxHeight(c),this._hoverContainer.style.padding="",this._hoverContainer.style.margin="",this._hoverPointer){switch(this._hoverPosition){case 1:c.left+=3,c.right+=3,this._hoverContainer.style.paddingLeft="3px",this._hoverContainer.style.marginLeft="-3px";break;case 0:c.left-=3,c.right-=3,this._hoverContainer.style.paddingRight="3px",this._hoverContainer.style.marginRight="-3px";break;case 2:c.top+=3,c.bottom+=3,this._hoverContainer.style.paddingTop="3px",this._hoverContainer.style.marginTop="-3px";break;case 3:c.top-=3,c.bottom-=3,this._hoverContainer.style.paddingBottom="3px",this._hoverContainer.style.marginBottom="-3px";break}c.center.x=c.left+a/2,c.center.y=c.top+l/2}this.computeXCordinate(c),this.computeYCordinate(c),this._hoverPointer&&(this._hoverPointer.classList.remove("top"),this._hoverPointer.classList.remove("left"),this._hoverPointer.classList.remove("right"),this._hoverPointer.classList.remove("bottom"),this.setHoverPointerPosition(c)),this._hover.onContentsChanged()}computeXCordinate(e){let t=this._hover.containerDomNode.clientWidth+2;this._target.x!==void 0?this._x=this._target.x:this._hoverPosition===1?this._x=e.right:this._hoverPosition===0?this._x=e.left-t:(this._hoverPointer?this._x=e.center.x-this._hover.containerDomNode.clientWidth/2:this._x=e.left,this._x+t>=this._targetDocumentElement.clientWidth&&(this._hover.containerDomNode.classList.add("right-aligned"),this._x=Math.max(this._targetDocumentElement.clientWidth-t-2,this._targetDocumentElement.clientLeft))),this._xthis._targetWindow.innerHeight&&(this._y=e.bottom)}adjustHorizontalHoverPosition(e){if(this._target.x!==void 0)return;let t=this._hoverPointer?3:0;if(this._forcePosition){let i=t+2;this._hoverPosition===1?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-i}px`:this._hoverPosition===0&&(this._hover.containerDomNode.style.maxWidth=`${e.left-i}px`);return}this._hoverPosition===1?this._targetDocumentElement.clientWidth-e.right=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=0:this._hoverPosition=2):this._hoverPosition===0&&(e.left=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=1:this._hoverPosition=2),e.left-this._hover.containerDomNode.clientWidth-t<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=1))}adjustVerticalHoverPosition(e){if(this._target.y!==void 0||this._forcePosition)return;let t=this._hoverPointer?3:0;this._hoverPosition===3?e.top-this._hover.containerDomNode.clientHeight-t<0&&(this._hoverPosition=2):this._hoverPosition===2&&e.bottom+this._hover.containerDomNode.clientHeight+t>this._targetWindow.innerHeight&&(this._hoverPosition=3)}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight/2;if(this._forcePosition){let i=(this._hoverPointer?3:0)+2;this._hoverPosition===3?t=Math.min(t,e.top-i):this._hoverPosition===2&&(t=Math.min(t,this._targetWindow.innerHeight-e.bottom-i))}if(this._hover.containerDomNode.style.maxHeight=`${t}px`,this._hover.contentsDomNode.clientHeighte.height?this._hoverPointer.style.top=`${e.center.y-(this._y-t)-3}px`:this._hoverPointer.style.top=`${Math.round(t/2)-3}px`;break}case 3:case 2:{this._hoverPointer.classList.add(this._hoverPosition===3?"bottom":"top");let t=this._hover.containerDomNode.clientWidth,i=Math.round(t/2)-3,o=this._x+i;(oe.right)&&(i=e.center.x-this._x-3),this._hoverPointer.style.left=`${i}px`;break}}}focus(){this._hover.containerDomNode.focus()}dispose(){this._isDisposed||(this._onDispose.fire(),this._hoverContainer.remove(),this._messageListeners.dispose(),this._target.dispose(),super.dispose()),this._isDisposed=!0}};vD=sX([Lv(1,fi),Lv(2,Rt),Lv(3,Jl),Lv(4,Ye),Lv(5,ao)],vD);var CD=class extends co{get onMouseOut(){return this._onMouseOut.event}get isMouseIn(){return this._isMouseIn}constructor(e){super(),this._elements=e,this._isMouseIn=!0,this._onMouseOut=this._register(new B),this._elements.forEach(t=>this.onmouseover(t,()=>this._onTargetMouseOver(t))),this._elements.forEach(t=>this.onmouseleave(t,()=>this._onTargetMouseLeave(t)))}_onTargetMouseOver(e){this._isMouseIn=!0,this._clearEvaluateMouseStateTimeout(e)}_onTargetMouseLeave(e){this._isMouseIn=!1,this._evaluateMouseState(e)}_evaluateMouseState(e){this._clearEvaluateMouseStateTimeout(e),this._mouseTimeout=ge(e).setTimeout(()=>this._fireIfMouseOutside(),0)}_clearEvaluateMouseStateTimeout(e){this._mouseTimeout&&(ge(e).clearTimeout(this._mouseTimeout),this._mouseTimeout=void 0)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}},_5=class{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}};le();ke();oo();vo();_();v();b();_();v();b();Sw();ke();le();Lt();_();v();b();var cn;(function(n){function e(s,r){if(s.start>=r.end||r.start>=s.end)return{start:0,end:0};let a=Math.max(s.start,r.start),l=Math.min(s.end,r.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}n.intersect=e;function t(s){return s.end-s.start<=0}n.isEmpty=t;function i(s,r){return!t(e(s,r))}n.intersects=i;function o(s,r){let a=[],l={start:s.start,end:Math.min(r.start,s.end)},c={start:Math.max(r.end,s.start),end:s.end};return t(l)||a.push(l),t(c)||a.push(c),a}n.relativeComplement=o})(cn||(cn={}));function rX(n){let e=n;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var Th;(function(n){n[n.AVOID=0]="AVOID",n[n.ALIGN=1]="ALIGN"})(Th||(Th={}));function Nf(n,e,t){let i=t.mode===Th.ALIGN?t.offset:t.offset+t.size,o=t.mode===Th.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=n-i?i:e<=o?o-e:Math.max(n-e,0):e<=o?o-e:e<=n-i?i:0}var Dp=class n extends H{constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=H.None,this.toDisposeOnSetContainer=H.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=ve(".context-view"),Zw(this.view),this.setContainer(e,t),this._register(be(()=>this.setContainer(null,1)))}setContainer(e,t){var i;this.useFixedPosition=t!==1;let o=this.useShadowDOM;if(this.useShadowDOM=t===3,!(e===this.container&&o===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(i=this.shadowRootHostElement)===null||i===void 0||i.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=ve(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});let r=document.createElement("style");r.textContent=aX,this.shadowRoot.appendChild(r),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(ve("slot"))}else this.container.appendChild(this.view);let s=new ae;n.BUBBLE_UP_EVENTS.forEach(r=>{s.add(Ut(this.container,r,a=>{this.onDOMEvent(a,!1)}))}),n.BUBBLE_DOWN_EVENTS.forEach(r=>{s.add(Ut(this.container,r,a=>{this.onDOMEvent(a,!0)},!0))}),this.toDisposeOnSetContainer=s}}show(e){var t,i,o;this.isVisible()&&this.hide(),Co(this.view),this.view.className="context-view monaco-component",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex=`${2575+((t=e.layer)!==null&&t!==void 0?t:0)}`,this.view.style.position=this.useFixedPosition?"fixed":"absolute",b0(this.view),this.toDisposeOnClean=e.render(this.view)||H.None,this.delegate=e,this.doLayout(),(o=(i=this.delegate).focus)===null||o===void 0||o.call(i)}getViewElement(){return this.view}layout(){var e,t;if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(Rs&&Ag.pointerEvents)){this.hide();return}(t=(e=this.delegate)===null||e===void 0?void 0:e.layout)===null||t===void 0||t.call(e),this.doLayout()}}doLayout(){if(!this.isVisible())return;let e=this.delegate.getAnchor(),t;if(e instanceof HTMLElement){let u=Sn(e),f=Uw(e);t={top:u.top*f,left:u.left*f,width:u.width*f,height:u.height*f}}else rX(e)?t={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:t={top:e.posy,left:e.posx,width:2,height:2};let i=Vg(this.view),o=p0(this.view),s=this.delegate.anchorPosition||0,r=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0,l,c,d=z7();if(a===0){let u={offset:t.top-d.pageYOffset,size:t.height,position:s===0?0:1},f={offset:t.left,size:t.width,position:r===0?0:1,mode:Th.ALIGN};l=Nf(d.innerHeight,o,u)+d.pageYOffset,cn.intersects({start:l,end:l+o},{start:u.offset,end:u.offset+u.size})&&(f.mode=Th.AVOID),c=Nf(d.innerWidth,i,f)}else{let u={offset:t.left,size:t.width,position:r===0?0:1},f={offset:t.top,size:t.height,position:s===0?0:1,mode:Th.ALIGN};c=Nf(d.innerWidth,i,u),cn.intersects({start:c,end:c+i},{start:u.offset,end:u.offset+u.size})&&(f.mode=Th.AVOID),l=Nf(d.innerHeight,o,f)+d.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(s===0?"bottom":"top"),this.view.classList.add(r===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);let h=Sn(this.container);this.view.style.top=`${l-(this.useFixedPosition?Sn(this.view).top:h.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?Sn(this.view).left:h.left)}px`,this.view.style.width="initial"}hide(e){let t=this.delegate;this.delegate=null,t?.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),Zw(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,ge(e).document.activeElement):t&&!yi(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}};Dp.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];Dp.BUBBLE_DOWN_EVENTS=["click"];var aX=` + :host { + all: initial; /* 1st rule so subsequent properties are reset. */ + } + + .codicon[class*='codicon-'] { + font: normal normal normal 16px/1 codicon; + display: inline-block; + text-decoration: none; + text-rendering: auto; + text-align: center; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + } + + :host { + font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif; + } + + :host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; } + :host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; } + :host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; } + :host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; } + :host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; } + + :host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; } + :host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; } + :host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; } + :host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; } + :host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; } + + :host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; } + :host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; } + :host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } + :host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } + :host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; } +`;le();ke();var lX=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},cX=function(n,e){return function(t,i){e(t,i,n)}},kv=class extends H{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new Dp(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let o;t?t===this.layoutService.getContainer(ge(t))?o=1:i?o=3:o=2:o=1,this.contextView.setContainer(t??this.layoutService.activeContainer,o),this.contextView.show(e);let s={close:()=>{this.openContextView===s&&this.hideContextView()}};return this.openContextView=s,s}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};kv=lX([cX(0,ss)],kv);var wD=class extends kv{getContextViewElement(){return this.contextView.getViewElement()}};_();v();b();fs();Lp();xi();Ge();var yD=class{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){var o;if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let s;if(e===void 0||tn(e)||e instanceof HTMLElement)s=e;else if(!cg(e.markdown))s=(o=e.markdown)!==null&&o!==void 0?o:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(p("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new un;let r=this._cancellationTokenSource.token;if(s=await e.markdown(r),s===void 0&&(s=e.markdownNotSupportedFallback),this.isDisposed||r.isCancellationRequested)return}this.show(s,t,i)}show(e,t,i){let o=this._hoverWidget;if(this.hasContent(e)){let s={content:e,target:this.target,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!o},position:{hoverPosition:2},...i};this._hoverWidget=this.hoverDelegate.showHover(s,t)}o?.dispose()}hasContent(e){return e?ic(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}};Gt();var dX=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Dv=function(n,e){return function(t,i){e(t,i,n)}},b5=class extends H{constructor(e,t,i,o,s){super(),this._instantiationService=e,this._keybindingService=i,this._layoutService=o,this._accessibilityService=s,t.onDidShowContextMenu(()=>this.hideHover()),this._contextViewHandler=this._register(new kv(this._layoutService))}showHover(e,t,i){var o,s,r,a;if(FV(this._currentHoverOptions)===FV(e)||this._currentHover&&(!((s=(o=this._currentHoverOptions)===null||o===void 0?void 0:o.persistence)===null||s===void 0)&&s.sticky))return;this._currentHoverOptions=e,this._lastHoverOptions=e;let l=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),c=Bi();i||(l&&c?this._lastFocusedElementBeforeOpen=c:this._lastFocusedElementBeforeOpen=void 0);let d=new ae,h=this._instantiationService.createInstance(vD,e);if(!((r=e.persistence)===null||r===void 0)&&r.sticky&&(h.isLocked=!0),h.onDispose(()=>{var u,f;((u=this._currentHover)===null||u===void 0?void 0:u.domNode)&&qw(this._currentHover.domNode)&&((f=this._lastFocusedElementBeforeOpen)===null||f===void 0||f.focus()),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),d.dispose()},void 0,d),!e.container){let u=e.target instanceof HTMLElement?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(ge(u))}if(this._contextViewHandler.showContextView(new v5(h,t),e.container),h.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,d),!((a=e.persistence)===null||a===void 0)&&a.sticky)d.add($(ge(e.container).document,se.MOUSE_DOWN,u=>{yi(u.target,h.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(let f of e.target.targetElements)d.add($(f,se.CLICK,()=>this.hideHover()));else d.add($(e.target,se.CLICK,()=>this.hideHover()));let u=Bi();if(u){let f=ge(u).document;d.add($(u,se.KEY_DOWN,g=>{var m;return this._keyDown(g,h,!!(!((m=e.persistence)===null||m===void 0)&&m.hideOnKeyDown))})),d.add($(f,se.KEY_DOWN,g=>{var m;return this._keyDown(g,h,!!(!((m=e.persistence)===null||m===void 0)&&m.hideOnKeyDown))})),d.add($(u,se.KEY_UP,g=>this._keyUp(g,h))),d.add($(f,se.KEY_UP,g=>this._keyUp(g,h)))}}if("IntersectionObserver"in gt){let u=new IntersectionObserver(g=>this._intersectionChange(g,h),{threshold:0}),f="targetElements"in e.target?e.target.targetElements[0]:e.target;u.observe(f),d.add(be(()=>u.disconnect()))}return this._currentHover=h,h}hideHover(){var e;!((e=this._currentHover)===null||e===void 0)&&e.isLocked||!this._currentHoverOptions||this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewHandler.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}showAndFocusLastHover(){this._lastHoverOptions&&this.showHover(this._lastHoverOptions,!0,!0)}_keyDown(e,t,i){var o,s;if(e.key==="Alt"){t.isLocked=!0;return}let r=new bt(e);this._keybindingService.resolveKeyboardEvent(r).getSingleModifierDispatchChords().some(l=>!!l)||this._keybindingService.softDispatch(r,r.target).kind!==0||i&&(!(!((o=this._currentHoverOptions)===null||o===void 0)&&o.trapFocus)||e.key!=="Tab")&&(this.hideHover(),(s=this._lastFocusedElementBeforeOpen)===null||s===void 0||s.focus())}_keyUp(e,t){var i;e.key==="Alt"&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),(i=this._lastFocusedElementBeforeOpen)===null||i===void 0||i.focus()))}setupUpdatableHover(e,t,i,o){t.setAttribute("custom-hover","true"),t.title!==""&&(console.warn("HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute."),console.trace("Stack trace:",t.title),t.title="");let s,r,a=(y,x)=>{var k;let T=r!==void 0;y&&(r?.dispose(),r=void 0),x&&(s?.dispose(),s=void 0),T&&((k=e.onDidHideHover)===null||k===void 0||k.call(e),r=void 0)},l=(y,x,k)=>new Xo(async()=>{(!r||r.isDisposed)&&(r=new yD(e,k||t,y>0),await r.update(typeof i=="function"?i():i,x,o))},y),c=!1,d=$(t,se.MOUSE_DOWN,()=>{c=!0,a(!0,!0)},!0),h=$(t,se.MOUSE_UP,()=>{c=!1},!0),u=$(t,se.MOUSE_LEAVE,y=>{c=!1,a(!1,y.fromElement===t)},!0),f=y=>{if(s)return;let x=new ae,k={targetElements:[t],dispose:()=>{}};if(e.placement===void 0||e.placement==="mouse"){let T=N=>{k.x=N.x+10,N.target instanceof HTMLElement&&BV(N.target,t)!==t&&a(!0,!0)};x.add($(t,se.MOUSE_MOVE,T,!0))}s=x,!(y.target instanceof HTMLElement&&BV(y.target,t)!==t)&&x.add(l(e.delay,!1,k))},g=$(t,se.MOUSE_OVER,f,!0),m=()=>{if(c||s)return;let y={targetElements:[t],dispose:()=>{}},x=new ae,k=()=>a(!0,!0);x.add($(t,se.BLUR,k,!0)),x.add(l(e.delay,!1,y)),s=x},C,S=t.tagName.toLowerCase();return S!=="input"&&S!=="textarea"&&(C=$(t,se.FOCUS,m,!0)),{show:y=>{a(!1,!0),l(0,y)},hide:()=>{a(!0,!0)},update:async(y,x)=>{i=y,await r?.update(i,void 0,x)},dispose:()=>{g.dispose(),u.dispose(),d.dispose(),h.dispose(),C?.dispose(),a(!0,!0)}}}};b5=dX([Dv(0,Ye),Dv(1,Ds),Dv(2,fi),Dv(3,ss),Dv(4,ao)],b5);function FV(n){var e;if(n!==void 0)return(e=n?.id)!==null&&e!==void 0?e:n}var v5=class{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t,this.layer=1}render(e){return this._hover.render(e),this._focus&&this._hover.focus(),this._hover}getAnchor(){return{x:this._hover.x,y:this._hover.y}}layout(){this._hover.layout()}};function BV(n,e){for(e=e??ge(n).document.body;!n.hasAttribute("custom-hover")&&n!==e;)n=n.parentElement;return n}_t(Lh,b5,1);Lo((n,e)=>{let t=n.getColor(Q8);t&&(e.addRule(`.monaco-workbench .workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-workbench .workbench-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`))});ot();ke();oo();ye();Mg();le();Lt();sn();_();v();b();qe();sn();xi();var WV=De("IWorkspaceEditService"),Ep=class{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(Ip.is(t))return Ip.lift(t);if(SD.is(t))return SD.lift(t);throw new Error("Unsupported edit")})}},Ip=class n extends Ep{static is(e){return e instanceof n?!0:dn(e)&&Oe.isUri(e.resource)&&dn(e.textEdit)}static lift(e){return e instanceof n?e:new n(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,o){super(o),this.resource=e,this.textEdit=t,this.versionId=i}},SD=class n extends Ep{static is(e){return e instanceof n?!0:dn(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof n?e:new n(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},o){super(o),this.oldResource=e,this.newResource=t,this.options=i}};_();v();b();_();v();b();var Wn={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,renderGutterMenu:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0};I_();Ge();Du();Oo();var hX=Object.freeze({id:"editor",order:5,type:"object",title:p("editorConfigurationTitle","Editor"),scope:5}),LD={...hX,properties:{"editor.tabSize":{type:"number",default:nn.tabSize,minimum:1,markdownDescription:p("tabSize","The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:p("indentSize",'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:nn.insertSpaces,markdownDescription:p("insertSpaces","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:nn.detectIndentation,markdownDescription:p("detectIndentation","Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:nn.trimAutoWhitespace,description:p("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:nn.largeFileOptimizations,description:p("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[p("wordBasedSuggestions.off","Turn off Word Based Suggestions."),p("wordBasedSuggestions.currentDocument","Only suggest words from the active document."),p("wordBasedSuggestions.matchingDocuments","Suggest words from all open documents of the same language."),p("wordBasedSuggestions.allDocuments","Suggest words from all open documents.")],description:p("wordBasedSuggestions","Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[p("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),p("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),p("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:p("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:p("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:p("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:p("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:p("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:p("editor.experimental.asyncTokenizationVerification","Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:p("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:p("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:p("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:p("schema.colorizedBracketPairs","Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:p("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:p("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:Wn.maxComputationTime,description:p("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:Wn.maxFileSize,description:p("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:Wn.renderSideBySide,description:p("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:Wn.renderSideBySideInlineBreakpoint,description:p("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:Wn.useInlineViewWhenSpaceIsLimited,description:p("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:Wn.renderMarginRevertIcon,description:p("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:Wn.renderGutterMenu,description:p("renderGutterMenu","When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:Wn.ignoreTrimWhitespace,description:p("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:Wn.renderIndicators,description:p("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:Wn.diffCodeLens,description:p("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:Wn.diffWordWrap,markdownEnumDescriptions:[p("wordWrap.off","Lines will never wrap."),p("wordWrap.on","Lines will wrap at the viewport width."),p("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:Wn.diffAlgorithm,markdownEnumDescriptions:[p("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),p("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:Wn.hideUnchangedRegions.enabled,markdownDescription:p("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:Wn.hideUnchangedRegions.revealLineCount,markdownDescription:p("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:Wn.hideUnchangedRegions.minimumLineCount,markdownDescription:p("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:Wn.hideUnchangedRegions.contextLineCount,markdownDescription:p("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:Wn.experimental.showMoves,markdownDescription:p("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:Wn.experimental.showEmptyDecorations,description:p("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}};function uX(n){return typeof n.type<"u"||typeof n.anyOf<"u"}for(let n of wd){let e=n.schema;if(typeof e<"u")if(uX(e))LD.properties[`editor.${n.name}`]=e;else for(let t in e)Object.hasOwnProperty.call(e,t)&&(LD.properties[t]=e[t])}var xD=null;function zV(){return xD===null&&(xD=Object.create(null),Object.keys(LD.properties).forEach(n=>{xD[n]=!0})),xD}function VV(n){return zV()[`editor.${n}`]||!1}function HV(n){return zV()[`diffEditor.${n}`]||!1}var fX=Vt.as(ar.Configuration);fX.registerConfiguration(LD);_();v();b();Ke();var Af=class{static insert(e,t){return{range:new P(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}};ft();Ke();_u();Jw();ir();Fo();_();v();b();wt();cr();hs();xi();sn();Fo();Du();Oo();function kD(n){return Object.isFrozen(n)?n:s9(n)}var ko=class n{static createEmptyModel(e){return new n({},[],[],void 0,e)}constructor(e,t,i,o,s){this._contents=e,this._keys=t,this._overrides=i,this.raw=o,this.logService=s,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(!((e=this.raw)===null||e===void 0)&&e.length){let t=this.raw.map(i=>{if(i instanceof n)return i;let o=new C5("",this.logService);return o.parseRaw(i),o.configurationModel});this._rawConfiguration=t.reduce((i,o)=>o===i?o:i.merge(o),t[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?FN(this.contents,e):this.contents}inspect(e,t){let i=this;return{get value(){return kD(i.rawConfiguration.getValue(e))},get override(){return t?kD(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return kD(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){let o=[];for(let{contents:s,identifiers:r,keys:a}of i.rawConfiguration.overrides){let l=new n(s,a,[],void 0,i.logService).getValue(e);l!==void 0&&o.push({identifiers:r,value:l})}return o.length?kD(o):void 0}}}getOverrideValue(e,t){let i=this.getContentsForOverrideIdentifer(t);return i?e?FN(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,i;let o=cl(this.contents),s=cl(this.overrides),r=[...this.keys],a=!((t=this.raw)===null||t===void 0)&&t.length?[...this.raw]:[this];for(let l of e)if(a.push(...!((i=l.raw)===null||i===void 0)&&i.length?l.raw:[l]),!l.isEmpty()){this.mergeContents(o,l.contents);for(let c of l.overrides){let[d]=s.filter(h=>Ht(h.identifiers,c.identifiers));d?(this.mergeContents(d.contents,c.contents),d.keys.push(...c.keys),d.keys=xr(d.keys)):s.push(cl(c))}for(let c of l.keys)r.indexOf(c)===-1&&r.push(c)}return new n(o,r,s,a.every(l=>l instanceof n)?void 0:a,this.logService)}createOverrideConfigurationModel(e){let t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;let i={};for(let o of xr([...Object.keys(this.contents),...Object.keys(t)])){let s=this.contents[o],r=t[o];r&&(typeof s=="object"&&typeof r=="object"?(s=cl(s),this.mergeContents(s,r)):s=r),i[o]=s}return new n(i,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(let i of Object.keys(t)){if(i in e&&dn(e[i])&&dn(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=cl(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null,o=s=>{s&&(i?this.mergeContents(i,s):i=cl(s))};for(let s of this.overrides)s.identifiers.length===1&&s.identifiers[0]===e?t=s.contents:s.identifiers.includes(e)&&o(s.contents);return o(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){let t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),k3(this.contents,e),Tc.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>Ht(i.identifiers,P0(e))),1))}updateValue(e,t,i){ON(this.contents,e,t,o=>this.logService.error(o)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),Tc.test(e)&&this.overrides.push({identifiers:P0(e),keys:Object.keys(this.contents[e]),contents:Ay(this.contents[e],o=>this.logService.error(o))})}},C5=class{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||ko.createEmptyModel(this.logService)}parseRaw(e,t){this._raw=e;let{contents:i,keys:o,overrides:s,restricted:r,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new ko(i,o,s,a?[e]:void 0,this.logService),this._restrictedConfigurations=r||[]}doParseRaw(e,t){let i=Vt.as(ar.Configuration).getConfigurationProperties(),o=this.filter(e,i,!0,t);e=o.raw;let s=Ay(e,l=>this.logService.error(`Conflict in settings file ${this._name}: ${l}`)),r=Object.keys(e),a=this.toOverrides(e,l=>this.logService.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:s,keys:r,overrides:a,restricted:o.restricted,hasExcludedProperties:o.hasExcludedProperties}}filter(e,t,i,o){var s,r,a;let l=!1;if(!o?.scopes&&!o?.skipRestricted&&!(!((s=o?.exclude)===null||s===void 0)&&s.length))return{raw:e,restricted:[],hasExcludedProperties:l};let c={},d=[];for(let h in e)if(Tc.test(h)&&i){let u=this.filter(e[h],t,!1,o);c[h]=u.raw,l=l||u.hasExcludedProperties,d.push(...u.restricted)}else{let u=t[h],f=u?typeof u.scope<"u"?u.scope:3:void 0;u?.restricted&&d.push(h),!(!((r=o.exclude)===null||r===void 0)&&r.includes(h))&&(!((a=o.include)===null||a===void 0)&&a.includes(h)||(f===void 0||o.scopes===void 0||o.scopes.includes(f))&&!(o.skipRestricted&&u?.restricted))?c[h]=e[h]:l=!0}return{raw:c,restricted:d,hasExcludedProperties:l}}toOverrides(e,t){let i=[];for(let o of Object.keys(e))if(Tc.test(o)){let s={};for(let r in e[o])s[r]=e[o][r];i.push({identifiers:P0(o),keys:Object.keys(s),contents:Ay(s,t)})}return i}},w5=class{constructor(e,t,i,o,s,r,a,l,c,d,h,u,f){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=o,this.defaultConfiguration=s,this.policyConfiguration=r,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=d,this.workspaceConfiguration=h,this.folderConfigurationModel=u,this.memoryConfigurationModel=f}toInspectValue(e){return e?.value!==void 0||e?.override!==void 0||e?.overrides!==void 0?e:void 0}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.toInspectValue(this.userInspectValue)}},Ev=class n{constructor(e,t,i,o,s,r,a,l,c,d){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=o,this._remoteUserConfiguration=s,this._workspaceConfiguration=r,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this.logService=d,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new Gn,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let o;i.resource?(o=this._memoryConfigurationByResource.get(i.resource),o||(o=ko.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(i.resource,o))):o=this._memoryConfiguration,t===void 0?o.removeValue(e):o.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){let o=this.getConsolidatedConfigurationModel(e,t,i),s=this.getFolderConfigurationModelForResource(t.resource,i),r=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(let l of o.overrides)for(let c of l.identifiers)o.getOverrideValue(e,c)!==void 0&&a.add(c);return new w5(e,t,o.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,s||void 0,r)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let o=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(o=o.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(o=o.merge(this._policyConfiguration)),o}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){let o=t.getFolder(e);o&&(i=this.getFolderConsolidatedConfiguration(o.uri)||i);let s=this._memoryConfigurationByResource.get(e);s&&(i=i.merge(s))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){let i=this.getWorkspaceConsolidatedConfiguration(),o=this._folderConfigurations.get(e);o?(t=i.merge(o),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){let i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{let{contents:i,overrides:o,keys:s}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:o,keys:s}]),e},[])}}static parse(e,t){let i=this.parseConfigurationModel(e.defaults,t),o=this.parseConfigurationModel(e.policy,t),s=this.parseConfigurationModel(e.application,t),r=this.parseConfigurationModel(e.user,t),a=this.parseConfigurationModel(e.workspace,t),l=e.folders.reduce((c,d)=>(c.set(Oe.revive(d[0]),this.parseConfigurationModel(d[1],t)),c),new Gn);return new n(i,o,s,r,ko.createEmptyModel(t),a,l,ko.createEmptyModel(t),new Gn,t)}static parseConfigurationModel(e,t){return new ko(e.contents,e.keys,e.overrides,void 0,t)}},DD=class{constructor(e,t,i,o,s){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=o,this.logService=s,this._marker=` +`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(let r of e.keys)this.affectedKeys.add(r);for(let[,r]of e.overrides)for(let a of r)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(let r of this.affectedKeys)this._affectsConfigStr+=r+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=Ev.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){var i;let o=this._marker+e,s=this._affectsConfigStr.indexOf(o);if(s<0)return!1;let r=s+o.length;if(r>=this._affectsConfigStr.length)return!1;let a=this._affectsConfigStr.charCodeAt(r);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){let l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(i=this.previous)===null||i===void 0?void 0:i.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!hn(l,c)}return!0}};Oi();qe();_();v();b();Gt();xt();ye();le();Ge();_();v();b();Oi();var Iv={kind:0},gX={kind:1};function mX(n,e,t){return{kind:2,commandId:n,commandArgs:e,isBubble:t}}var ED=class n{constructor(e,t,i){var o;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(let s of e){let r=s.command;r&&r.charAt(0)!=="-"&&this._defaultBoundCommands.set(r,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=n.handleRemovals([].concat(e).concat(t));for(let s=0,r=this._keybindings.length;s"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let o=i.length-1;o>=0;o--){let s=i[o];if(s.command===t.command)continue;let r=!0;for(let a=1;a"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,o=t.length;i"u"||i.length===0)return null;if(i.length===1)return i[0];for(let o=i.length-1;o>=0;o--){let s=i[o];if(t.contextMatchesRules(s.when))return s}return i[i.length-1]}resolve(e,t,i){let o=[...t,i];this._log(`| Resolving ${o}`);let s=this._map.get(o[0]);if(s===void 0)return this._log("\\ No keybinding entries."),Iv;let r=null;if(o.length<2)r=s;else{r=[];for(let l=0,c=s.length;ld.chords.length)continue;let h=!0;for(let u=1;u=0;i--){let o=t[i];if(n._contextMatchesRules(e,o.when))return o}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}};function UV(n){return n?`${n.serialize()}`:"no when condition"}function KV(n){return n.extensionId?n.isBuiltinExtension?`built-in extension ${n.extensionId}`:`user extension ${n.extensionId}`:n.isDefault?"built-in":"user"}var pX=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/,ID=class extends H{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:ie.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,o,s){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=o,this._logService=s,this._onDidUpdateKeybindings=this._register(new B),this._currentChords=[],this._currentChordChecker=new Fd,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=Nh.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new Xo,this._currentlyDispatchingCommandId=null,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){let i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");let i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),Iv;let[o]=i.getDispatchChords();if(o===null)return this._log("\\ Keyboard event cannot be dispatched"),Iv;let s=this._contextKeyService.getContext(t),r=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(s,r,o)}_scheduleLeaveChordMode(){let e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw _g("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(p("first.chord","({0}) was pressed. Waiting for second key of chord...",t));break;default:{let i=this._currentChords.map(({label:o})=>o).join(", ");this._currentChordStatusMessage=this._notificationService.status(p("next.chord","({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),af.enabled&&af.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],af.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){let i=this.resolveKeyboardEvent(e),[o]=i.getSingleModifierDispatchChords();if(o)return this._ignoreSingleModifiers.has(o)?(this._log(`+ Ignoring single modifier ${o} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=Nh.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=Nh.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${o}.`),this._currentSingleModifier=o,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):o===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${o} ${o}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${o}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));let[s]=i.getChords();return this._ignoreSingleModifiers=new Nh(s),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){var o;let s=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let r=null,a=null;if(i){let[h]=e.getSingleModifierDispatchChords();r=h,a=h?[h]:[]}else[r]=e.getDispatchChords(),a=this._currentChords.map(({keypress:h})=>h);if(r===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),s;let l=this._contextKeyService.getContext(t),c=e.getLabel(),d=this._getResolver().resolve(l,a,r);switch(d.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",c,"[ No matching keybinding ]"),this.inChordMode){let h=this._currentChords.map(({label:u})=>u).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${h}, ${c}".`),this._notificationService.status(p("missing.chord","The key combination ({0}, {1}) is not a command.",h,c),{hideAfter:10*1e3}),this._leaveChordMode(),s=!0}return s}case 1:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),s=!0,this._expectAnotherChord(r,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),s;case 2:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${d.commandId} ]`),d.commandId===null||d.commandId===""){if(this.inChordMode){let h=this._currentChords.map(({label:u})=>u).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${h}, ${c}".`),this._notificationService.status(p("missing.chord","The key combination ({0}, {1}) is not a command.",h,c),{hideAfter:10*1e3}),this._leaveChordMode(),s=!0}}else{this.inChordMode&&this._leaveChordMode(),d.isBubble||(s=!0),this._log(`+ Invoking command ${d.commandId}.`),this._currentlyDispatchingCommandId=d.commandId;try{typeof d.commandArgs>"u"?this._commandService.executeCommand(d.commandId).then(void 0,h=>this._notificationService.warn(h)):this._commandService.executeCommand(d.commandId,d.commandArgs).then(void 0,h=>this._notificationService.warn(h))}finally{this._currentlyDispatchingCommandId=null}pX.test(d.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:d.commandId,from:"keybinding",detail:(o=e.getUserSettingsLabel())!==null&&o!==void 0?o:void 0})}return s}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}},Nh=class{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}};Nh.EMPTY=new Nh(null);k0();_();v();b();var Tv=class{constructor(e,t,i,o,s,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?TD(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=TD(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=o,this.isDefault=s,this.extensionId=r,this.isBuiltinExtension=a}};function TD(n){let e=[];for(let t=0,i=n.length;tthis._getLabel(e))}getAriaLabel(){return $V.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:qV.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return jV.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new Lw(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}};var Nv=class n extends ND{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"\u2190";case 16:return"\u2191";case 17:return"\u2192";case 18:return"\u2193"}return Ir.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Ir.toString(e.keyCode)}_getElectronAccelerator(e){return Ir.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";let t=Ir.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return n.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=Ir.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){let t=uC[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof pl)return e;let t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new pl(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){let i=TD(e.chords.map(o=>this._toKeyCodeChord(o)));return i.length>0?[new n(i,t)]:[]}};_();v();b();qe();var GV=De("labelService");_();v();b();qe();var ZV=De("progressService"),ije=Object.freeze({total(){},worked(){},done(){}}),y5=class{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}};y5.None=Object.freeze({report(){}});var Ap=De("editorProgressService");Gg();_();v();b();Ge();wc();_();v();b();ot();var S5=class{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;t--,this._valueLen--){let i=this._value.charCodeAt(t);if(!(i===47||this._splitOnBackslash&&i===92))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new n(new k5(e,t))}static forStrings(){return new n(new S5)}static forConfigKeys(){return new n(new x5)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){let i=this._iter.reset(e),o;this._root||(this._root=new Mp,this._root.segment=i.value());let s=[];for(o=this._root;;){let a=i.cmp(o.segment);if(a>0)o.left||(o.left=new Mp,o.left.segment=i.value()),s.push([-1,o]),o=o.left;else if(a<0)o.right||(o.right=new Mp,o.right.segment=i.value()),s.push([1,o]),o=o.right;else if(i.hasNext())i.next(),o.mid||(o.mid=new Mp,o.mid.segment=i.value()),s.push([0,o]),o=o.mid;else break}let r=o.value;o.value=t,o.key=e;for(let a=s.length-1;a>=0;a--){let l=s[a][1];l.updateHeight();let c=l.balanceFactor();if(c<-1||c>1){let d=s[a][0],h=s[a+1][0];if(d===1&&h===1)s[a][1]=l.rotateLeft();else if(d===-1&&h===-1)s[a][1]=l.rotateRight();else if(d===1&&h===-1)l.right=s[a+1][1]=s[a+1][1].rotateRight(),s[a][1]=l.rotateLeft();else if(d===-1&&h===1)l.left=s[a+1][1]=s[a+1][1].rotateLeft(),s[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(s[a-1][0]){case-1:s[a-1][1].left=s[a][1];break;case 1:s[a-1][1].right=s[a][1];break;case 0:s[a-1][1].mid=s[a][1];break}else this._root=s[0][1]}}return r}get(e){var t;return(t=this._getNode(e))===null||t===void 0?void 0:t.value}_getNode(e){let t=this._iter.reset(e),i=this._root;for(;i;){let o=t.cmp(i.segment);if(o>0)i=i.left;else if(o<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){let t=this._getNode(e);return!(t?.value===void 0&&t?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var i;let o=this._iter.reset(e),s=[],r=this._root;for(;r;){let a=o.cmp(r.segment);if(a>0)s.push([-1,r]),r=r.left;else if(a<0)s.push([1,r]),r=r.right;else if(o.hasNext())o.next(),s.push([0,r]),r=r.mid;else break}if(r){if(t?(r.left=void 0,r.mid=void 0,r.right=void 0,r.height=1):(r.key=void 0,r.value=void 0),!r.mid&&!r.value)if(r.left&&r.right){let a=this._min(r.right);if(a.key){let{key:l,value:c,segment:d}=a;this._delete(a.key,!1),r.key=l,r.value=c,r.segment=d}}else{let a=(i=r.left)!==null&&i!==void 0?i:r.right;if(s.length>0){let[l,c]=s[s.length-1];switch(l){case-1:c.left=a;break;case 0:c.mid=a;break;case 1:c.right=a;break}}else this._root=a}for(let a=s.length-1;a>=0;a--){let l=s[a][1];l.updateHeight();let c=l.balanceFactor();if(c>1?(l.right.balanceFactor()>=0||(l.right=l.right.rotateRight()),s[a][1]=l.rotateLeft()):c<-1&&(l.left.balanceFactor()<=0||(l.left=l.left.rotateLeft()),s[a][1]=l.rotateRight()),a>0)switch(s[a-1][0]){case-1:s[a-1][1].left=s[a][1];break;case 1:s[a-1][1].right=s[a][1];break;case 0:s[a-1][1].mid=s[a][1];break}else this._root=s[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){let t=this._iter.reset(e),i=this._root,o;for(;i;){let s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<0)i=i.right;else if(t.hasNext())t.next(),o=i.value||o,i=i.mid;else break}return i&&i.value||o}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){let i=this._iter.reset(e),o=this._root;for(;o;){let s=i.cmp(o.segment);if(s>0)o=o.left;else if(s<0)o=o.right;else if(i.hasNext())i.next(),o=o.mid;else return o.mid?this._entries(o.mid):t?o.value:void 0}}forEach(e){for(let[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){let t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}};sn();qe();var YV=De("contextService");function bX(n){let e=n;return typeof e?.id=="string"&&Oe.isUri(e.uri)}function _je(n){let e=n;return typeof e?.id=="string"&&!bX(n)&&!wX(n)}var vX={id:"ext-dev"},CX={id:"empty-window"};function bje(n,e){if(typeof n=="string"||typeof n>"u")return typeof n=="string"?{id:xg(n)}:e?vX:CX;let t=n;return t.configuration?{id:t.id,configPath:t.configuration}:t.folders.length===1?{id:t.id,uri:t.folders[0].uri}:{id:t.id}}function wX(n){let e=n;return typeof e?.id=="string"&&Oe.isUri(e.configPath)}var AD=class{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}},yX="code-workspace",vje=[{name:p("codeWorkspace","Code Workspace"),extensions:[yX]}],D5="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function Cje(n){return n.id===D5}E5();bf();Or();Aa();_();v();b();qe();var nH=De("workspaceTrustManagementService");_();v();b();ye();le();_();v();b();ye();le();ot();_();v();b();M0();er();wc();bf();ot();Ma();var Rp=[],I5=[],sH=[];function Rv(n,e=!1){SX(n,!1,e)}function SX(n,e,t){let i=xX(n,e);Rp.push(i),i.userConfigured?sH.push(i):I5.push(i),t&&!i.userConfigured&&Rp.forEach(o=>{o.mime===i.mime||o.userConfigured||(i.extension&&o.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&o.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&o.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&o.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function xX(n,e){return{id:n.id,mime:n.mime,filename:n.filename,extension:n.extension,filepattern:n.filepattern,firstline:n.firstline,userConfigured:e,filenameLowercase:n.filename?n.filename.toLowerCase():void 0,extensionLowercase:n.extension?n.extension.toLowerCase():void 0,filepatternLowercase:n.filepattern?z4(n.filepattern.toLowerCase()):void 0,filepatternOnPath:n.filepattern?n.filepattern.indexOf(ci.sep)>=0:!1}}function rH(){Rp=Rp.filter(n=>n.userConfigured),I5=[]}function aH(n,e){return LX(n,e).map(t=>t.id)}function LX(n,e){let t;if(n)switch(n.scheme){case Ze.file:t=n.fsPath;break;case Ze.data:{t=$b.parseMetaData(n).get($b.META_DATA_LABEL);break}case Ze.vscodeNotebookCell:t=void 0;break;default:t=n.path}if(!t)return[{id:"unknown",mime:rr.unknown}];t=t.toLowerCase();let i=xg(t),o=oH(t,i,sH);if(o)return[o,{id:In,mime:rr.text}];let s=oH(t,i,I5);if(s)return[s,{id:In,mime:rr.text}];if(e){let r=kX(e);if(r)return[r,{id:In,mime:rr.text}]}return[{id:"unknown",mime:rr.unknown}]}function oH(n,e,t){var i;let o,s,r;for(let a=t.length-1;a>=0;a--){let l=t[a];if(e===l.filenameLowercase){o=l;break}if(l.filepattern&&(!s||l.filepattern.length>s.filepattern.length)){let c=l.filepatternOnPath?n:e;!((i=l.filepatternLowercase)===null||i===void 0)&&i.call(l,c)&&(s=l)}l.extension&&(!r||l.extension.length>r.extension.length)&&e.endsWith(l.extensionLowercase)&&(r=l)}if(o)return o;if(s)return s;if(r)return r}function kX(n){if(Tg(n)&&(n=n.substr(1)),n.length>0)for(let e=Rp.length-1;e>=0;e--){let t=Rp[e];if(!t.firstline)continue;let i=n.match(t.firstline);if(i&&i.length>0)return t}}Ma();Du();Oo();var RD=Object.prototype.hasOwnProperty,lH="vs.editor.nullLanguage",T5=class{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(lH,0),this._register(In,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;let t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||lH}},Pv=class n extends H{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,n.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new T5,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register($d.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){n.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},rH();let e=[].concat($d.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(let t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{let i=this._languages[t];i.name&&(this._nameMap[i.name]=i.identifier),i.aliases.forEach(o=>{this._lowercaseNameMap[o.toLowerCase()]=i.identifier}),i.mimetypes.forEach(o=>{this._mimeTypesMap[o]=i.identifier})}),Vt.as(ar.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){let t=e.id,i;RD.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){let i=t.id,o=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),o=t.mimetypes[0]),o||(o=`text/x-${i}`,e.mimetypes.push(o)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(let a of t.extensions)Rv({id:i,mime:o,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(let a of t.filenames)Rv({id:i,mime:o,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(let a of t.filenamePatterns)Rv({id:i,mime:o,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{let l=new RegExp(a);c7(l)||Rv({id:i,mime:o,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(i);let s=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?s=[null]:s=t.aliases),s!==null)for(let a of s)!a||a.length===0||e.aliases.push(a);let r=s!==null&&s.length>0;if(!(r&&s[0]===null)){let a=(r?s[0]:null)||i;(r||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?RD.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){let t=e.toLowerCase();return RD.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&RD.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:aH(e,t)}};Pv.instanceCount=0;wt();Yo();Ma();var Ov=class n extends H{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new B),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new B),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new B({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,n.instanceCount++,this._registry=this._register(new Pv(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){n.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){let i=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return lg(i,null)}createById(e){return new PD(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new PD(this.onDidChange,()=>{let i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=In),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),Bt.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}};Ov.instanceCount=0;var PD=class{constructor(e,t){this._onDidChangeLanguages=e,this._selector=t,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages(()=>this._evaluate())),this._emitter||(this._emitter=new B({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;let t=this._selector();t!==this.languageId&&(this.languageId=t,(e=this._emitter)===null||e===void 0||e.fire(this.languageId))}};_();v();b();ke();Po();ye();le();_();v();b();ke();oo();_();v();b();ps();_();v();b();M0();var OD={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:rr.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};ke();_();v();b();Md();var DX=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}}),FD=DX,EX=new qn(()=>FD("mouse",!1)),IX=new qn(()=>FD("element",!1));function cH(n){FD=n}function ji(n){return n==="element"?IX.value:EX.value}function Mf(){return FD("element",!0)}_();v();b();_();v();b();ke();oo();_();v();b();var dH={showHover:()=>{},hideHover:()=>{},showAndFocusLastHover:()=>{},setupUpdatableHover:()=>null};function hH(n){dH=n}function Qn(){return dH}_();v();b();ke();oo();_();v();b();var BD=class{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(o=>o.splice(e,t,i))}};wt();Gt();gn();ye();mD();le();Cp();Lt();xi();_();v();b();var oc=class extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}};_();v();b();ke();wt();Gt();ye();le();_();v();b();function uH(n,e){let t=[];for(let i of e){if(n.start>=i.range.end)continue;if(n.ende.concat(t),[]))}var WD=class{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){let o=i.length-t,s=uH({start:0,end:e},this.groups),r=uH({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:zD(l.range,o),size:l.size})),a=i.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=NX(s,a,r),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.range.start),0)}get count(){let e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e{for(let i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){let t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}};xt();Cp();var ed=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Rf={CurrentDragAndDropData:void 0},sc={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(n){return[n]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0},Jc=class{constructor(e){this.elements=e}update(){}getData(){return this.elements}},N5=class{constructor(e){this.elements=e}update(){}getData(){return this.elements}},A5=class{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;to,e?.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e?.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e?.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}},$s=class n{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(let t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:Kw(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,o=sc){var s,r,a,l,c,d,h,u,f,g,m,C,S;if(this.virtualDelegate=t,this.domId=`list_id_${++n.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new ka(50),this.splicing=!1,this.dragOverAnimationStopDisposable=H.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=H.None,this.onDragLeaveTimeout=H.None,this.disposables=new ae,this._onDidChangeContentHeight=new B,this._onDidChangeContentWidth=new B,this.onDidChangeContentHeight=ie.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this._horizontalScrolling=!1,o.horizontalScrolling&&o.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap((s=o.paddingTop)!==null&&s!==void 0?s:0);for(let y of i)this.renderers.set(y.templateId,y);this.cache=this.disposables.add(new VD(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof o.mouseSupport=="boolean"?o.mouseSupport:!0),this._horizontalScrolling=(r=o.horizontalScrolling)!==null&&r!==void 0?r:sc.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof o.paddingBottom>"u"?0:o.paddingBottom,this.accessibilityProvider=new M5(o.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((a=o.transformOptimization)!==null&&a!==void 0?a:sc.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(ui.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new gr({forceIntegerValues:!0,smoothScrollDuration:(l=o.smoothScrolling)!==null&&l!==void 0&&l?125:0,scheduleAtNextAnimationFrame:y=>rn(ge(this.domNode),y)})),this.scrollableElement=this.disposables.add(new Bl(this.rowsContainer,{alwaysConsumeMouseWheel:(c=o.alwaysConsumeMouseWheel)!==null&&c!==void 0?c:sc.alwaysConsumeMouseWheel,horizontal:1,vertical:(d=o.verticalScrollMode)!==null&&d!==void 0?d:sc.verticalScrollMode,useShadows:(h=o.useShadows)!==null&&h!==void 0?h:sc.useShadows,mouseWheelScrollSensitivity:o.mouseWheelScrollSensitivity,fastScrollSensitivity:o.fastScrollSensitivity,scrollByPage:o.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add($(this.rowsContainer,It.Change,y=>this.onTouchChange(y))),this.disposables.add($(this.scrollableElement.getDomNode(),"scroll",y=>y.target.scrollTop=0)),this.disposables.add($(this.domNode,"dragover",y=>this.onDragOver(this.toDragEvent(y)))),this.disposables.add($(this.domNode,"drop",y=>this.onDrop(this.toDragEvent(y)))),this.disposables.add($(this.domNode,"dragleave",y=>this.onDragLeave(this.toDragEvent(y)))),this.disposables.add($(this.domNode,"dragend",y=>this.onDragEnd(y))),this.setRowLineHeight=(u=o.setRowLineHeight)!==null&&u!==void 0?u:sc.setRowLineHeight,this.setRowHeight=(f=o.setRowHeight)!==null&&f!==void 0?f:sc.setRowHeight,this.supportDynamicHeights=(g=o.supportDynamicHeights)!==null&&g!==void 0?g:sc.supportDynamicHeights,this.dnd=(m=o.dnd)!==null&&m!==void 0?m:this.disposables.add(sc.dnd),this.layout((C=o.initialSize)===null||C===void 0?void 0:C.height,(S=o.initialSize)===null||S===void 0?void 0:S.width)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t={...t??{},scrollByPage:e.scrollByPage}),e.mouseWheelScrollSensitivity!==void 0&&(t={...t??{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),e.fastScrollSensitivity!==void 0&&(t={...t??{},fastScrollSensitivity:e.fastScrollSensitivity}),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){let i=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(i,Math.max(0,this.lastRenderTop+o),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}createRangeMap(e){return new WD(e)}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){let o=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),s={start:e,end:e+t},r=cn.intersect(o,s),a=new Map;for(let k=r.end-1;k>=r.start;k--){let T=this.items[k];if(T.dragStartDisposable.dispose(),T.checkedDisposable.dispose(),T.row){let N=a.get(T.templateId);N||(N=[],a.set(T.templateId,N));let M=this.renderers.get(T.templateId);M&&M.disposeElement&&M.disposeElement(T.element,k,T.row.templateData,T.size),N.unshift(T.row)}T.row=null,T.stale=!0}let l={start:e+t,end:this.items.length},c=cn.intersect(l,o),d=cn.relativeComplement(l,o),h=i.map(k=>({id:String(this.itemId++),element:k,templateId:this.virtualDelegate.getTemplateId(k),size:this.virtualDelegate.getHeight(k),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(k),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:H.None,checkedDisposable:H.None,stale:!1})),u;e===0&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,h),u=this.items,this.items=h):(this.rangeMap.splice(e,t,h),u=this.items.splice(e,t,...h));let f=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),m=zD(c,f),C=cn.intersect(g,m);for(let k=C.start;kzD(k,f)),x=[{start:e,end:e+i.length},...w].map(k=>cn.intersect(g,k)).reverse();for(let k of x)for(let T=k.end-1;T>=k.start;T--){let N=this.items[T],M=a.get(N.templateId),W=M?.pop();this.insertItemInDOM(T,W)}for(let k of a.values())for(let T of k)this.cache.release(T);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),u.map(k=>k.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=rn(ge(this.domNode),()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(let t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(let e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){return this.getRenderRange(this.lastRenderTop,this.lastRenderHeight).start}element(e){return this.items[e].element}indexOf(e){return this.items.findIndex(t=>t.element===e)}domElement(e){let t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){let i={height:typeof e=="number"?e:B7(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),typeof t<"u"&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t=="number"?t:Kw(this.domNode)})}render(e,t,i,o,s,r=!1){let a=this.getRenderRange(t,i),l=cn.relativeComplement(a,e).reverse(),c=cn.relativeComplement(e,a);if(r){let d=cn.intersect(e,a);for(let h=d.start;h{for(let d of c)for(let h=d.start;h=d.start;h--)this.insertItemInDOM(h)}),o!==void 0&&(this.rowsContainer.style.left=`-${o}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&s!==void 0&&(this.rowsContainer.style.width=`${Math.max(s,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t){var i,o,s;let r=this.items[e];if(!r.row)if(t)r.row=t,r.stale=!0;else{let h=this.cache.alloc(r.templateId);r.row=h.row,r.stale||(r.stale=h.isReusingConnectedDomNode)}let a=this.accessibilityProvider.getRole(r.element)||"listitem";r.row.domNode.setAttribute("role",a);let l=this.accessibilityProvider.isChecked(r.element);if(typeof l=="boolean")r.row.domNode.setAttribute("aria-checked",String(!!l));else if(l){let h=u=>r.row.domNode.setAttribute("aria-checked",String(!!u));h(l.value),r.checkedDisposable=l.onDidChange(()=>h(l.value))}if(r.stale||!r.row.domNode.parentElement){let h=(s=(o=(i=this.items.at(e+1))===null||i===void 0?void 0:i.row)===null||o===void 0?void 0:o.domNode)!==null&&s!==void 0?s:null;(r.row.domNode.parentElement!==this.rowsContainer||r.row.domNode.nextElementSibling!==h)&&this.rowsContainer.insertBefore(r.row.domNode,h),r.stale=!1}this.updateItemInDOM(r,e);let c=this.renderers.get(r.templateId);if(!c)throw new Error(`No renderer found for template id ${r.templateId}`);c?.renderElement(r.element,e,r.row.templateData,r.size);let d=this.dnd.getDragURI(r.element);r.dragStartDisposable.dispose(),r.row.domNode.draggable=!!d,d&&(r.dragStartDisposable=$(r.row.domNode,"dragstart",h=>this.onDragStart(r.element,d,h))),this.horizontalScrolling&&(this.measureItemWidth(r),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=Kw(e.row.domNode);let t=ge(e.row.domNode).getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){let t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){let i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return ie.map(this.disposables.add(new et(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return ie.map(this.disposables.add(new et(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return ie.filter(ie.map(this.disposables.add(new et(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return ie.map(this.disposables.add(new et(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return ie.map(this.disposables.add(new et(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return ie.map(this.disposables.add(new et(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return ie.any(ie.map(this.disposables.add(new et(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),ie.map(this.disposables.add(new et(this.domNode,It.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return ie.map(this.disposables.add(new et(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return ie.map(this.disposables.add(new et(this.rowsContainer,It.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){let t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],o=i&&i.element;return{browserEvent:e,index:t,element:o}}toTouchEvent(e){let t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],o=i&&i.element;return{browserEvent:e,index:t,element:o}}toGestureEvent(e){let t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],o=i&&i.element;return{browserEvent:e,index:t,element:o}}toDragEvent(e){let t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],o=i&&i.element,s=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:o,sector:s}}onScroll(e){try{let t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){var o,s;if(!i.dataTransfer)return;let r=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(OD.TEXT,t),i.dataTransfer.setDragImage){let a;this.dnd.getDragLabel&&(a=this.dnd.getDragLabel(r,i)),typeof a>"u"&&(a=String(r.length));let l=ve(".monaco-drag-image");l.textContent=a;let d=(h=>{for(;h&&!h.classList.contains("monaco-workbench");)h=h.parentElement;return h||this.domNode.ownerDocument})(this.domNode);d.appendChild(l),i.dataTransfer.setDragImage(l,-10,-10),setTimeout(()=>d.removeChild(l),0)}this.domNode.classList.add("dragging"),this.currentDragData=new Jc(r),Rf.CurrentDragAndDropData=new N5(r),(s=(o=this.dnd).onDragStart)===null||s===void 0||s.call(o,this.currentDragData,i)}onDragOver(e){var t,i;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),Rf.CurrentDragAndDropData&&Rf.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(Rf.CurrentDragAndDropData)this.currentDragData=Rf.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new A5}let o=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop=typeof o=="boolean"?o:o.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof o!="boolean"&&((t=o.effect)===null||t===void 0?void 0:t.type)===0?"copy":"move";let s;typeof o!="boolean"&&o.feedback?s=o.feedback:typeof e.index>"u"?s=[-1]:s=[e.index],s=xr(s).filter(a=>a>=-1&&aa-l),s=s[0]===-1?[-1]:s;let r=typeof o!="boolean"&&o.effect&&o.effect.position?o.effect.position:"drop-target";if(MX(this.currentDragFeedback,s)&&this.currentDragFeedbackPosition===r)return!0;if(this.currentDragFeedback=s,this.currentDragFeedbackPosition=r,this.currentDragFeedbackDisposable.dispose(),s[0]===-1)this.domNode.classList.add(r),this.rowsContainer.classList.add(r),this.currentDragFeedbackDisposable=be(()=>{this.domNode.classList.remove(r),this.rowsContainer.classList.remove(r)});else{if(s.length>1&&r!=="drop-target")throw new Error("Can't use multiple feedbacks with position different than 'over'");r==="drop-target-after"&&s[0]{var a;for(let l of s){let c=this.items[l];c.dropTarget=!1,(a=c.row)===null||a===void 0||a.domNode.classList.remove(r)}})}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=s0(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((i=(t=this.dnd).onDragLeave)===null||i===void 0||i.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;let t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,Rf.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.sector,e.browserEvent))}onDragEnd(e){var t,i;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,Rf.CurrentDragAndDropData=void 0,(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=H.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){let t=F7(this.domNode).top;this.dragOverAnimationDisposable=G7(ge(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=s0(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;let t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getTargetSector(e,t){if(t===void 0)return;let i=e.offsetY/this.items[t].size,o=Math.floor(i/.25);return Bn(o,0,3)}getItemIndexFromEventTarget(e){let t=this.scrollableElement.getDomNode(),i=e;for(;i instanceof HTMLElement&&i!==this.rowsContainer&&t.contains(i);){let o=i.getAttribute("data-index");if(o){let s=Number(o);if(!isNaN(s))return s}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){let o=this.getRenderRange(e,t),s,r;e===this.elementTop(o.start)?(s=o.start,r=0):o.end-o.start>1&&(s=o.start+1,r=this.elementTop(s)-e);let a=0;for(;;){let l=this.getRenderRange(e,t),c=!1;for(let d=l.start;d=u.start;f--)this.insertItemInDOM(f);for(let u=l.start;u=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},H5=class{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){let o=this.renderedElements.findIndex(s=>s.templateData===i);if(o>=0){let s=this.renderedElements[o];this.trait.unrender(i),s.index=t}else{let s={index:t,templateData:i};this.renderedElements.push(s)}this.trait.renderIndex(t,i)}splice(e,t,i){let o=[];for(let s of this.renderedElements)s.index=e+t&&o.push({index:s.index+i-t,templateData:s.templateData});this.renderedElements=o}renderIndexes(e){for(let{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){let t=this.renderedElements.findIndex(i=>i.templateData===e);t<0||this.renderedElements.splice(t,1)}},$p=class{get name(){return this._trait}get renderer(){return new H5(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new B,this.onChange=this._onChange.event}splice(e,t,i){let o=i.length-t,s=e+t,r=[],a=0;for(;a=s;)r.push(this.sortedIndexes[a++]+o);this.renderer.splice(e,t,i.length),this._set(r,r)}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(DH),t)}_set(e,t,i){let o=this.indexes,s=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;let r=q5(s,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),o}get(){return this.indexes}contains(e){return ZF(this.sortedIndexes,e,DH)>=0}dispose(){li(this._onChange)}};Oh([Yt],$p.prototype,"renderer",null);var U5=class extends $p{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}},$v=class{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,new Array(i.length).fill(!1));let o=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(o.length===0)return this.trait.splice(e,t,new Array(i.length).fill(!1));let s=new Set(o),r=i.map(a=>s.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,r)}};function id(n){return n.tagName==="INPUT"||n.tagName==="TEXTAREA"}function Gv(n,e){return n.classList.contains(e)?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:Gv(n.parentElement,e)}function Up(n){return Gv(n,"monaco-editor")}function EH(n){return Gv(n,"monaco-custom-toggle")}function IH(n){return Gv(n,"action-item")}function qp(n){return Gv(n,"monaco-tree-sticky-row")}function jp(n){return n.classList.contains("monaco-tree-sticky-container")}function Y5(n){return n.tagName==="A"&&n.classList.contains("monaco-button")||n.tagName==="DIV"&&n.classList.contains("monaco-button-dropdown")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:Y5(n.parentElement)}var jD=class{get onKeyDown(){return ie.chain(this.disposables.add(new et(this.view.domNode,"keydown")).event,e=>e.filter(t=>!id(t.target)).map(t=>new bt(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new ae,this.multipleSelectionDisposables=new ae,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown(o=>{switch(o.keyCode){case 3:return this.onEnter(o);case 16:return this.onUpArrow(o);case 18:return this.onDownArrow(o);case 11:return this.onPageUpArrow(o);case 12:return this.onPageDownArrow(o);case 9:return this.onEscape(o);case 31:this.multipleSelectionSupport&&(Be?o.metaKey:o.ctrlKey)&&this.onCtrlA(o)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);let t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);let t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);let t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);let t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(Un(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}};Oh([Yt],jD.prototype,"onKeyDown",null);var el;(function(n){n[n.Automatic=0]="Automatic",n[n.Trigger=1]="Trigger"})(el||(el={}));var Kp;(function(n){n[n.Idle=0]="Idle",n[n.Typing=1]="Typing"})(Kp||(Kp={}));var jX=new class{mightProducePrintableCharacter(n){return n.ctrlKey||n.metaKey||n.altKey?!1:n.keyCode>=31&&n.keyCode<=56||n.keyCode>=21&&n.keyCode<=30||n.keyCode>=98&&n.keyCode<=107||n.keyCode>=85&&n.keyCode<=95}},K5=class{constructor(e,t,i,o,s){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=o,this.delegate=s,this.enabled=!1,this.state=Kp.Idle,this.mode=el.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new ae,this.disposables=new ae,this.updateOptions(e.options)}updateOptions(e){var t,i;!((t=e.typeNavigationEnabled)!==null&&t!==void 0)||t?this.enable():this.disable(),this.mode=(i=e.typeNavigationMode)!==null&&i!==void 0?i:el.Automatic}enable(){if(this.enabled)return;let e=!1,t=ie.chain(this.enabledDisposables.add(new et(this.view.domNode,"keydown")).event,s=>s.filter(r=>!id(r.target)).filter(()=>this.mode===el.Automatic||this.triggered).map(r=>new bt(r)).filter(r=>e||this.keyboardNavigationEventFilter(r)).filter(r=>this.delegate.mightProducePrintableCharacter(r)).forEach(r=>He.stop(r,!0)).map(r=>r.browserEvent.key)),i=ie.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);ie.reduce(ie.any(t,i),(s,r)=>r===null?null:(s||"")+r,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),i(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;let t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){let i=(e=this.list.options.accessibilityProvider)===null||e===void 0?void 0:e.getAriaLabel(this.list.element(t[0]));typeof i=="string"?ob(i):i&&ob(i.get())}this.previouslyFocused=-1}onInput(e){if(!e){this.state=Kp.Idle,this.triggered=!1;return}let t=this.list.getFocus(),i=t.length>0?t[0]:0,o=this.state===Kp.Idle?1:0;this.state=Kp.Typing;for(let s=0;s1&&c.length===1){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}else if(typeof l>"u"||vv(e,l)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}},$5=class{constructor(e,t){this.list=e,this.view=t,this.disposables=new ae;let i=ie.chain(this.disposables.add(new et(t.domNode,"keydown")).event,s=>s.filter(r=>!id(r.target)).map(r=>new bt(r)));ie.chain(i,s=>s.filter(r=>r.keyCode===2&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey&&!r.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;let t=this.list.getFocus();if(t.length===0)return;let i=this.view.domElement(t[0]);if(!i)return;let o=i.querySelector("[tabIndex]");if(!o||!(o instanceof HTMLElement)||o.tabIndex===-1)return;let s=ge(o).getComputedStyle(o);s.visibility==="hidden"||s.display==="none"||(e.preventDefault(),e.stopPropagation(),o.focus())}dispose(){this.disposables.dispose()}};function X5(n){return Be?n.browserEvent.metaKey:n.browserEvent.ctrlKey}function Q5(n){return n.browserEvent.shiftKey}function GX(n){return Hg(n)&&n.button===2}var kH={isSelectionSingleChangeEvent:X5,isSelectionRangeChangeEvent:Q5},qv=class{constructor(e){this.list=e,this.disposables=new ae,this._onPointer=new B,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||kH),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(ui.addTarget(e.getHTMLElement()))),ie.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||kH))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){Up(e.browserEvent.target)||Bi()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(id(e.browserEvent.target)||Up(e.browserEvent.target))return;let t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||id(e.browserEvent.target)||Up(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;let t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),GX(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(id(e.browserEvent.target)||Up(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;let t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){let t=e.index,i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(typeof i>"u"){let d=this.list.getFocus()[0];i=d??t,this.list.setAnchor(i)}let o=Math.min(i,t),s=Math.max(i,t),r=Un(o,s+1),a=this.list.getSelection(),l=YX(q5(a,[i]),i);if(l.length===0)return;let c=q5(r,XX(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){let o=this.list.getSelection(),s=o.filter(r=>r!==t);this.list.setFocus([t]),this.list.setAnchor(t),o.length===s.length?this.list.setSelection([...s,t],e.browserEvent):this.list.setSelection(s,e.browserEvent)}}dispose(){this.disposables.dispose()}},jv=class{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,i;let o=this.selectorSuffix&&`.${this.selectorSuffix}`,s=[];e.listBackground&&s.push(`.monaco-list${o} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(s.push(`.monaco-list${o}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),s.push(`.monaco-list${o}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&s.push(`.monaco-list${o}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(s.push(`.monaco-list${o}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),s.push(`.monaco-list${o}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&s.push(`.monaco-list${o}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&s.push(`.monaco-list${o}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&s.push(` + .monaco-drag-image, + .monaco-list${o}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; } + `),e.listFocusAndSelectionForeground&&s.push(` + .monaco-drag-image, + .monaco-list${o}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; } + `),e.listInactiveFocusForeground&&(s.push(`.monaco-list${o} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),s.push(`.monaco-list${o} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&s.push(`.monaco-list${o} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(s.push(`.monaco-list${o} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),s.push(`.monaco-list${o} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(s.push(`.monaco-list${o} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),s.push(`.monaco-list${o} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&s.push(`.monaco-list${o} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&s.push(`.monaco-list${o}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&s.push(`.monaco-list${o}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);let r=tr(e.listFocusAndSelectionOutline,tr(e.listSelectionOutline,(t=e.listFocusOutline)!==null&&t!==void 0?t:""));r&&s.push(`.monaco-list${o}:focus .monaco-list-row.focused.selected { outline: 1px solid ${r}; outline-offset: -1px;}`),e.listFocusOutline&&s.push(` + .monaco-drag-image, + .monaco-list${o}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } + .monaco-workbench.context-menu-visible .monaco-list${o}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } + `);let a=tr(e.listSelectionOutline,(i=e.listInactiveFocusOutline)!==null&&i!==void 0?i:"");a&&s.push(`.monaco-list${o} .monaco-list-row.focused.selected { outline: 1px dotted ${a}; outline-offset: -1px; }`),e.listSelectionOutline&&s.push(`.monaco-list${o} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&s.push(`.monaco-list${o} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&s.push(`.monaco-list${o} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&s.push(` + .monaco-list${o}.drop-target, + .monaco-list${o} .monaco-list-rows.drop-target, + .monaco-list${o} .monaco-list-row.drop-target { background-color: ${e.listDropOverBackground} !important; color: inherit !important; } + `),e.listDropBetweenBackground&&(s.push(` + .monaco-list${o} .monaco-list-rows.drop-target-before .monaco-list-row:first-child::before, + .monaco-list${o} .monaco-list-row.drop-target-before::before { + content: ""; position: absolute; top: 0px; left: 0px; width: 100%; height: 1px; + background-color: ${e.listDropBetweenBackground}; + }`),s.push(` + .monaco-list${o} .monaco-list-rows.drop-target-after .monaco-list-row:last-child::after, + .monaco-list${o} .monaco-list-row.drop-target-after::after { + content: ""; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 1px; + background-color: ${e.listDropBetweenBackground}; + }`)),e.tableColumnsBorder&&s.push(` + .monaco-table > .monaco-split-view2, + .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before, + .monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2, + .monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before { + border-color: ${e.tableColumnsBorder}; + } + + .monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2, + .monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before { + border-color: transparent; + } + `),e.tableOddRowsBackgroundColor&&s.push(` + .monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr, + .monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr, + .monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr { + background-color: ${e.tableOddRowsBackgroundColor}; + } + `),this.styleElement.textContent=s.join(` +`)}},TH={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:Z.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:Z.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:Z.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},ZX={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function YX(n,e){let t=n.indexOf(e);if(t===-1)return[];let i=[],o=t-1;for(;o>=0&&n[o]===e-(t-o);)i.push(n[o--]);for(i.reverse(),o=t;o=n.length)t.push(e[o++]);else if(o>=e.length)t.push(n[i++]);else if(n[i]===e[o]){t.push(n[i]),i++,o++;continue}else n[i]=n.length)t.push(e[o++]);else if(o>=e.length)t.push(n[i++]);else if(n[i]===e[o]){i++,o++;continue}else n[i]n-e,j5=class{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,o){let s=0;for(let r of this.renderers)r.renderElement(e,t,i[s++],o)}disposeElement(e,t,i,o){var s;let r=0;for(let a of this.renderers)(s=a.disposeElement)===null||s===void 0||s.call(a,e,t,i[r],o),r+=1}disposeTemplate(e){let t=0;for(let i of this.renderers)i.disposeTemplate(e[t++])}},G5=class{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new ae}}renderElement(e,t,i){let o=this.accessibilityProvider.getAriaLabel(e),s=o&&typeof o!="string"?o:Rh(o);i.disposables.add(pt(a=>{this.setAriaLabel(a.readObservable(s),i.container)}));let r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof r=="number"?i.container.setAttribute("aria-level",`${r}`):i.container.removeAttribute("aria-level")}setAriaLabel(e,t){e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label")}disposeElement(e,t,i,o){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}},Z5=class{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){let t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){var i,o;(o=(i=this.dnd).onDragStart)===null||o===void 0||o.call(i,e,t)}onDragOver(e,t,i,o,s){return this.dnd.onDragOver(e,t,i,o,s)}onDragLeave(e,t,i,o){var s,r;(r=(s=this.dnd).onDragLeave)===null||r===void 0||r.call(s,e,t,i,o)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}drop(e,t,i,o,s){this.dnd.drop(e,t,i,o,s)}dispose(){this.dnd.dispose()}},Do=class{get onDidChangeFocus(){return ie.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return ie.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1,t=ie.chain(this.disposables.add(new et(this.view.domNode,"keydown")).event,s=>s.map(r=>new bt(r)).filter(r=>e=r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>He.stop(r,!0)).filter(()=>!1)),i=ie.chain(this.disposables.add(new et(this.view.domNode,"keyup")).event,s=>s.forEach(()=>e=!1).map(r=>new bt(r)).filter(r=>r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>He.stop(r,!0)).map(({browserEvent:r})=>{let a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l<"u"?this.view.element(l):void 0,d=typeof l<"u"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:d,browserEvent:r}})),o=ie.chain(this.view.onContextMenu,s=>s.filter(r=>!e).map(({element:r,index:a,browserEvent:l})=>({element:r,index:a,anchor:new yn(ge(this.view.domNode),l),browserEvent:l})));return ie.any(t,i,o)}get onKeyDown(){return this.disposables.add(new et(this.view.domNode,"keydown")).event}get onDidFocus(){return ie.signal(this.disposables.add(new et(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return ie.signal(this.disposables.add(new et(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,o,s=ZX){var r,a,l,c;this.user=e,this._options=s,this.focus=new $p("focused"),this.anchor=new $p("anchor"),this.eventBufferer=new kd,this._ariaLabel="",this.disposables=new ae,this._onDidDispose=new B,this.onDidDispose=this._onDidDispose.event;let d=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(r=this._options.accessibilityProvider)===null||r===void 0?void 0:r.getWidgetRole():"list";this.selection=new U5(d!=="listbox");let h=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=s.accessibilityProvider,this.accessibilityProvider&&(h.push(new G5(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),o=o.map(f=>new j5(f.templateId,[...h,f]));let u={...s,dnd:s.dnd&&new Z5(this,s.dnd)};if(this.view=this.createListView(t,i,o,u),this.view.domNode.setAttribute("role",d),s.styleController)this.styleController=s.styleController(this.view.domId);else{let f=Xi(this.view.domNode);this.styleController=new jv(f,this.view.domId)}if(this.spliceable=new BD([new $v(this.focus,this.view,s.identityProvider),new $v(this.selection,this.view,s.identityProvider),new $v(this.anchor,this.view,s.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new $5(this,this.view)),(typeof s.keyboardSupport!="boolean"||s.keyboardSupport)&&(this.keyboardController=new jD(this,this.view,s),this.disposables.add(this.keyboardController)),s.keyboardNavigationLabelProvider){let f=s.keyboardNavigationDelegate||jX;this.typeNavigationController=new K5(this,this.view,s.keyboardNavigationLabelProvider,(c=s.keyboardNavigationEventFilter)!==null&&c!==void 0?c:()=>!0,f),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(s),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,o){return new $s(e,t,i,o)}createMouseController(e){return new qv(this)}updateOptions(e={}){var t,i;this._options={...this._options,...e},(t=this.typeNavigationController)===null||t===void 0||t.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),(i=this.keyboardController)===null||i===void 0||i.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new oc(this.user,`Invalid start index: ${e}`);if(t<0)throw new oc(this.user,`Invalid delete count: ${t}`);t===0&&i.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}indexOf(e){return this.view.indexOf(e)}indexAt(e){return this.view.indexAt(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(let i of e)if(i<0||i>=this.length)throw new oc(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new oc(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return lg(this.anchor.get(),void 0)}getAnchorElement(){let e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(let i of e)if(i<0||i>=this.length)throw new oc(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,o){if(this.length===0)return;let s=this.focus.get(),r=this.findNextIndex(s.length>0?s[0]+e:0,t,o);r>-1&&this.setFocus([r],i)}focusPrevious(e=1,t=!1,i,o){if(this.length===0)return;let s=this.focus.get(),r=this.findPreviousIndex(s.length>0?s[0]-e:0,t,o);r>-1&&this.setFocus([r],i)}async focusNextPage(e,t){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=i===0?0:i-1;let o=this.getFocus()[0];if(o!==i&&(o===void 0||i>o)){let s=this.findPreviousIndex(i,!1,t);s>-1&&o!==s?this.setFocus([s],e):this.setFocus([i],e)}else{let s=this.view.getScrollTop(),r=s+this.view.renderHeight;i>o&&(r-=this.view.elementHeight(i)),this.view.setScrollTop(r),this.view.getScrollTop()!==s&&(this.setFocus([]),await kc(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=()=>0){let o,s=i(),r=this.view.getScrollTop()+s;r===0?o=this.view.indexAt(r):o=this.view.indexAfter(r-1);let a=this.getFocus()[0];if(a!==o&&(a===void 0||a>=o)){let l=this.findNextIndex(o,!1,t);l>-1&&a!==l?this.setFocus([l],e):this.setFocus([o],e)}else{let l=r;this.view.setScrollTop(r-this.view.renderHeight-s),this.view.getScrollTop()+i()!==l&&(this.setFocus([]),await kc(0),await this.focusPreviousPage(e,t,i))}}focusLast(e,t){if(this.length===0)return;let i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(this.length===0)return;let o=this.findNextIndex(e,!1,i);o>-1&&this.setFocus([o],t)}findNextIndex(e,t=!1,i){for(let o=0;o=this.length&&!t)return-1;if(e=e%this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let o=0;othis.view.element(e))}reveal(e,t,i=0){if(e<0||e>=this.length)throw new oc(this.user,`Invalid index ${e}`);let o=this.view.getScrollTop(),s=this.view.elementTop(e),r=this.view.elementHeight(e);if(pa(t)){let a=r-this.view.renderHeight+i;this.view.setScrollTop(a*Bn(t,0,1)+s-i)}else{let a=s+r,l=o+this.view.renderHeight;s=l||(s=l&&r>=this.view.renderHeight?this.view.setScrollTop(s-i):a>=l&&this.view.setScrollTop(a-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new oc(this.user,`Invalid index ${e}`);let i=this.view.getScrollTop(),o=this.view.elementTop(e),s=this.view.elementHeight(e);if(oi+this.view.renderHeight)return null;let r=s-this.view.renderHeight+t;return Math.abs((i+t-o)/r)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(e){return this.view.getElementDomId(e)}getElementTop(e){return this.view.elementTop(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(i=>this.view.element(i)),browserEvent:t}}_onFocusChange(){let e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;let t=this.focus.get();if(t.length>0){let i;!((e=this.accessibilityProvider)===null||e===void 0)&&e.getActiveDescendantId&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){let e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}};Oh([Yt],Do.prototype,"onDidChangeFocus",null);Oh([Yt],Do.prototype,"onDidChangeSelection",null);Oh([Yt],Do.prototype,"onContextMenu",null);Oh([Yt],Do.prototype,"onKeyDown",null);Oh([Yt],Do.prototype,"onDidFocus",null);Oh([Yt],Do.prototype,"onDidBlur",null);wt();ye();z_();le();Lt();Ge();var Ff=ve,NH="selectOption.entry.template",J5=class{get templateId(){return NH}renderTemplate(e){let t=Object.create(null);return t.root=e,t.text=me(e,Ff(".option-text")),t.detail=me(e,Ff(".option-detail")),t.decoratorRight=me(e,Ff(".option-decorator-right")),t}renderElement(e,t,i){let o=i,s=e.text,r=e.detail,a=e.decoratorRight,l=e.isDisabled;o.text.textContent=s,o.detail.textContent=r||"",o.decoratorRight.innerText=a||"",l?o.root.classList.add("option-disabled"):o.root.classList.remove("option-disabled")}disposeTemplate(e){}},Bf=class n extends H{constructor(e,t,i,o,s){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=o,this.selectBoxOptions=s||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=n.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new B,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}setTitle(e){!this._hover&&e?this._hover=this._register(Qn().setupUpdatableHover(ji("mouse"),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return NH}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=ve(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=me(this.selectDropDownContainer,Ff(".select-box-details-pane"));let t=me(this.selectDropDownContainer,Ff(".select-box-dropdown-container-width-control")),i=me(t,Ff(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",me(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=Xi(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register($(this.selectDropDownContainer,se.DRAG_START,o=>{He.stop(o,!0)}))}registerListeners(){this._register(Ut(this.selectElement,"change",t=>{this.selected=t.target.selectedIndex,this._onDidSelect.fire({index:t.target.selectedIndex,selected:t.target.value}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)})),this._register($(this.selectElement,se.CLICK,t=>{He.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register($(this.selectElement,se.MOUSE_DOWN,t=>{He.stop(t)}));let e;this._register($(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register($(this.selectElement,"touchend",t=>{He.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register($(this.selectElement,se.KEY_DOWN,t=>{let i=new bt(t),o=!1;Be?(i.keyCode===18||i.keyCode===16||i.keyCode===10||i.keyCode===3)&&(o=!0):(i.keyCode===18&&i.altKey||i.keyCode===16&&i.altKey||i.keyCode===10||i.keyCode===3)&&(o=!0),o&&(this.showSelectDropDown(),He.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Ht(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((i,o)=>{this.selectElement.add(this.createOption(i.text,o,i.isDisabled)),typeof i.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)===null||e===void 0||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){let e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` +`)}styleSelectElement(){var e,t,i;let o=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",s=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",r=(i=this.styles.selectBorder)!==null&&i!==void 0?i:"";this.selectElement.style.backgroundColor=o,this.selectElement.style.color=s,this.selectElement.style.borderColor=r}styleList(){var e,t;let i=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",o=tr(this.styles.selectListBackground,i);this.selectDropDownListContainer.style.backgroundColor=o,this.selectionDetailsPane.style.backgroundColor=o;let s=(t=this.styles.focusBorder)!==null&&t!==void 0?t:"";this.selectDropDownContainer.style.outlineColor=s,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){let o=document.createElement("option");return o.value=e,o.text=e,o.disabled=!!i,o}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");let t=ge(this.selectElement),i=Sn(this.selectElement),o=ge(this.selectElement).getComputedStyle(this.selectElement),s=parseFloat(o.getPropertyValue("--dropdown-padding-top"))+parseFloat(o.getPropertyValue("--dropdown-padding-bottom")),r=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-n.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,l=this.selectElement.offsetWidth,c=this.setWidthControlElement(this.widthControlElement),d=Math.max(c,Math.round(l)).toString()+"px";this.selectDropDownContainer.style.width=d,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let h=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());let u=this._hasDetails?this._cachedMaxDetailsHeight:0,f=h+s+u,g=Math.floor((r-s-u)/this.getHeight()),m=Math.floor((a-s-u)/this.getHeight());if(e)return i.top+i.height>t.innerHeight-22||i.topg&&this.options.length>g?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(i.top+i.height>t.innerHeight-22||i.topr&&(h=g*this.getHeight())}else f>a&&(h=m*this.getHeight());return this.selectList.layout(h),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=h+s+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=h+s+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=d,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(e){let t=0;if(e){let i=0,o=0;this.options.forEach((s,r)=>{let a=s.detail?s.detail.length:0,l=s.decoratorRight?s.decoratorRight.length:0,c=s.text.length+a+l;c>o&&(i=r,o=c)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=Vg(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=me(e,Ff(".select-box-dropdown-list-container")),this.listRenderer=new J5,this.selectList=new Do("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:o=>{let s=o.text;return o.detail&&(s+=`. ${o.detail}`),o.decoratorRight&&(s+=`. ${o.decoratorRight}`),o.description&&(s+=`. ${o.description}`),s},getWidgetAriaLabel:()=>p({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>Be?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);let t=this._register(new et(this.selectDropDownListContainer,"keydown")),i=ie.chain(t.event,o=>o.filter(()=>this.selectList.length>0).map(s=>new bt(s)));this._register(ie.chain(i,o=>o.filter(s=>s.keyCode===3))(this.onEnter,this)),this._register(ie.chain(i,o=>o.filter(s=>s.keyCode===2))(this.onEnter,this)),this._register(ie.chain(i,o=>o.filter(s=>s.keyCode===9))(this.onEscape,this)),this._register(ie.chain(i,o=>o.filter(s=>s.keyCode===16))(this.onUpArrow,this)),this._register(ie.chain(i,o=>o.filter(s=>s.keyCode===18))(this.onDownArrow,this)),this._register(ie.chain(i,o=>o.filter(s=>s.keyCode===12))(this.onPageDown,this)),this._register(ie.chain(i,o=>o.filter(s=>s.keyCode===11))(this.onPageUp,this)),this._register(ie.chain(i,o=>o.filter(s=>s.keyCode===14))(this.onHome,this)),this._register(ie.chain(i,o=>o.filter(s=>s.keyCode===13))(this.onEnd,this)),this._register(ie.chain(i,o=>o.filter(s=>s.keyCode>=21&&s.keyCode<=56||s.keyCode>=85&&s.keyCode<=113))(this.onCharacter,this)),this._register($(this.selectList.getHTMLElement(),se.POINTER_UP,o=>this.onPointerUp(o))),this._register(this.selectList.onMouseOver(o=>typeof o.index<"u"&&this.selectList.setFocus([o.index]))),this._register(this.selectList.onDidChangeFocus(o=>this.onListFocus(o))),this._register($(this.selectDropDownContainer,se.FOCUS_OUT,o=>{!this._isVisible||yi(o.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;He.stop(e);let t=e.target;if(!t||t.classList.contains("slider"))return;let i=t.closest(".monaco-list-row");if(!i)return;let o=Number(i.getAttribute("data-index")),s=i.classList.contains("option-disabled");o>=0&&o{for(let r=0;rthis.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(He.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){He.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){He.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){He.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){let t=Ir.toString(e.keyCode),i=-1;for(let o=0;o{this._register($(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Ut(this.selectElement,"click",e=>{He.stop(e,!0)})),this._register(Ut(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Ut(this.selectElement,"keydown",e=>{let t=!1;Be?(e.keyCode===18||e.keyCode===16||e.keyCode===10)&&(t=!0):(e.keyCode===18&&e.altKey||e.keyCode===10||e.keyCode===3)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!Ht(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((i,o)=>{this.selectElement.add(this.createOption(i.text,o,i.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected{this.element&&this.handleActionChangeEvent(o)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new bs)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){let t=this.element=e;this._register(ui.addTarget(e));let i=this.options&&this.options.draggable;i&&(e.draggable=!0,wn&&this._register($(e,se.DRAG_START,o=>{var s;return(s=o.dataTransfer)===null||s===void 0?void 0:s.setData(OD.TEXT,this._action.label)}))),this._register($(t,It.Tap,o=>this.onClick(o,!0))),this._register($(t,se.MOUSE_DOWN,o=>{i||He.stop(o,!0),this._action.enabled&&o.button===0&&t.classList.add("active")})),Be&&this._register($(t,se.CONTEXT_MENU,o=>{o.button===0&&o.ctrlKey===!0&&this.onClick(o)})),this._register($(t,se.CLICK,o=>{He.stop(o,!0),this.options&&this.options.isMenu||this.onClick(o)})),this._register($(t,se.DBLCLICK,o=>{He.stop(o,!0)})),[se.MOUSE_UP,se.MOUSE_OUT].forEach(o=>{this._register($(t,o,s=>{He.stop(s),t.classList.remove("active")}))})}onClick(e,t=!1){var i;He.stop(e,!0);let o=io(this._context)?!((i=this.options)===null||i===void 0)&&i.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,o)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}updateTooltip(){var e,t,i;if(!this.element)return;let o=(e=this.getTooltip())!==null&&e!==void 0?e:"";if(this.updateAriaLabel(),!((t=this.options.hoverDelegate)===null||t===void 0)&&t.showNativeHover)this.element.title=o;else if(!this.customHover&&o!==""){let s=(i=this.options.hoverDelegate)!==null&&i!==void 0?i:ji("element");this.customHover=this._store.add(Qn().setupUpdatableHover(s,this.element,o))}else this.customHover&&this.customHover.update(o)}updateAriaLabel(){var e;if(this.element){let t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}},Fh=class extends qo{constructor(e,t,i){super(e,t,i),this.options=i,this.options.icon=i.icon!==void 0?i.icon:!1,this.options.label=i.label!==void 0?i.label:!0,this.cssClass=""}render(e){super.render(e),Ms(this.element);let t=document.createElement("a");if(t.classList.add("action-label"),t.setAttribute("role",this.getDefaultAriaRole()),this.label=t,this.element.appendChild(t),this.options.label&&this.options.keybinding){let i=document.createElement("span");i.classList.add("keybinding"),i.textContent=this.options.keybinding,this.element.appendChild(i)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===zi.ID?"presentation":this.options.isMenu?"menuitem":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=p({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getClass(),this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):(e=this.label)===null||e===void 0||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),(e=this.element)===null||e===void 0||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(t=this.element)===null||t===void 0||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){let t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.removeAttribute("aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}},YD=class extends qo{constructor(e,t,i,o,s,r,a){super(e,t),this.selectBox=new ZD(i,o,s,r,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;(e=this.selectBox)===null||e===void 0||e.focus()}blur(){var e;(e=this.selectBox)===null||e===void 0||e.blur()}render(e){this.selectBox.render(e)}};_();v();b();ke();_();v();b();ke();oo();Po();ye();var eP=class extends bs{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new B),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=me(e,ve(".monaco-dropdown")),this._label=me(this._element,ve(".dropdown-label"));let i=t.labelRenderer;i||(i=s=>(s.textContent=t.label||"",null));for(let s of[se.CLICK,se.MOUSE_DOWN,It.Tap])this._register($(this.element,s,r=>He.stop(r,!0)));for(let s of[se.MOUSE_DOWN,It.Tap])this._register($(this._label,s,r=>{Hg(r)&&(r.detail>1||r.button!==0)||(this.visible?this.hide():this.show())}));this._register($(this._label,se.KEY_UP,s=>{let r=new bt(s);(r.equals(3)||r.equals(10))&&(He.stop(s,!0),this.visible?this.hide():this.show())}));let o=i(this._label);o&&this._register(o),this._register(ui.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}},XD=class extends eP{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}};ye();var Bh=class extends qo{constructor(e,t,i,o=Object.create(null)){super(null,e,o),this.actionItem=null,this._onDidChangeVisibility=this._register(new B),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=o,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;let t=s=>{var r;this.element=me(s,ve("a.action-label"));let a=[];return typeof this.options.classNames=="string"?a=this.options.classNames.split(/\s+/g).filter(l=>!!l):this.options.classNames&&(a=this.options.classNames),a.find(l=>l==="icon")||a.push("codicon"),this.element.classList.add(...a),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this._action.label&&this._register(Qn().setupUpdatableHover((r=this.options.hoverDelegate)!==null&&r!==void 0?r:ji("mouse"),this.element,this._action.label)),this.element.ariaLabel=this._action.label||"",null},i=Array.isArray(this.menuActionsOrProvider),o={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new XD(e,o)),this._register(this.dropdownMenu.onDidChangeVisibility(s=>{var r;(r=this.element)===null||r===void 0||r.setAttribute("aria-expanded",`${s}`),this._onDidChangeVisibility.fire(s)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){let s=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return s.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;(e=this.dropdownMenu)===null||e===void 0||e.show()}updateEnabled(){var e,t;let i=!this.action.enabled;(e=this.actionItem)===null||e===void 0||e.classList.toggle("disabled",i),(t=this.element)===null||t===void 0||t.classList.toggle("disabled",i)}};Po();le();Lt();Ge();zr();_();v();b();function SQe(n){return n&&typeof n=="object"&&typeof n.original=="string"&&typeof n.value=="string"}function AH(n){return n?n.condition!==void 0:!1}Oi();qe();_();v();b();ye();le();xi();_();v();b();Gt();ye();le();xi();var Wf;(function(n){n[n.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",n[n.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(Wf||(Wf={}));var Gp;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(Gp||(Gp={}));var zf=class n extends H{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new ul),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=Gp.None,this.cache=new Map,this.flushDelayer=this._register(new Pg(n.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var t,i;this._onDidChangeStorage.pause();try{(t=e.changed)===null||t===void 0||t.forEach((o,s)=>this.acceptExternal(s,o)),(i=e.deleted)===null||i===void 0||i.forEach(o=>this.acceptExternal(o,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===Gp.Closed)return;let i=!1;io(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){let i=this.cache.get(e);return io(i)?t:i}getBoolean(e,t){let i=this.get(e);return io(i)?t:i==="true"}getNumber(e,t){let i=this.get(e);return io(i)?t:parseInt(i,10)}async set(e,t,i=!1){if(this.state===Gp.Closed)return;if(io(t))return this.delete(e,i);let o=dn(t)||Array.isArray(t)?NV(t):String(t);if(this.cache.get(e)!==o)return this.cache.set(e,o),this.pendingInserts.set(e,o),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()}async delete(e,t=!1){if(!(this.state===Gp.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;let e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{var t;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(t=this.whenFlushedCallbacks.pop())===null||t===void 0||t()})}async doFlush(e){return this.options.hint===Wf.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}};zf.DEFAULT_FLUSH_DELAY=100;var Zp=class{constructor(){this.onDidChangeItemsExternal=ie.None,this.items=new Map}async updateItems(e){var t,i;(t=e.insert)===null||t===void 0||t.forEach((o,s)=>this.items.set(s,o)),(i=e.delete)===null||i===void 0||i.forEach(o=>this.items.delete(o))}};qe();var QD="__$__targetStorageMarker",Vf=De("storageService"),MH;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})(MH||(MH={}));function QX(n){let e=n.get(QD);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}var JD=class n extends H{constructor(e={flushInterval:n.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new ul),this._onDidChangeTarget=this._register(new ul),this._onWillSaveState=this._register(new B),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return ie.filter(this._onDidChangeValue.event,o=>o.scope===e&&(t===void 0||o.key===t),i)}emitDidChangeValue(e,t){let{key:i,external:o}=t;if(i===QD){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:o})}get(e,t,i){var o;return(o=this.getStorage(t))===null||o===void 0?void 0:o.get(e,i)}getBoolean(e,t,i){var o;return(o=this.getStorage(t))===null||o===void 0?void 0:o.getBoolean(e,i)}getNumber(e,t,i){var o;return(o=this.getStorage(t))===null||o===void 0?void 0:o.getNumber(e,i)}store(e,t,i,o,s=!1){if(io(t)){this.remove(e,i,s);return}this.withPausedEmitters(()=>{var r;this.updateKeyTarget(e,i,o),(r=this.getStorage(i))===null||r===void 0||r.set(e,t,s)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{var o;this.updateKeyTarget(e,t,void 0),(o=this.getStorage(t))===null||o===void 0||o.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i,o=!1){var s,r;let a=this.getKeyTargets(t);typeof i=="number"?a[e]!==i&&(a[e]=i,(s=this.getStorage(t))===null||s===void 0||s.set(QD,JSON.stringify(a),o)):typeof a[e]=="number"&&(delete a[e],(r=this.getStorage(t))===null||r===void 0||r.set(QD,JSON.stringify(a),o))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){let t=this.getStorage(e);return t?QX(t):Object.create(null)}};JD.DEFAULT_FLUSH_INTERVAL=60*1e3;var eE=class extends JD{constructor(){super(),this.applicationStorage=this._register(new zf(new Zp,{hint:Wf.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new zf(new Zp,{hint:Wf.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new zf(new Zp,{hint:Wf.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}};Qi();Ln();ch();xi();is();_();v();b();is();gn();function JX(n,e){let t={...e};for(let i in n){let o=n[i];t[i]=o!==void 0?he(o):void 0}return t}var RH={keybindingLabelBackground:he(VB),keybindingLabelForeground:he(HB),keybindingLabelBorder:he(UB),keybindingLabelBottomBorder:he(KB),keybindingLabelShadow:he(Va)},PH={buttonForeground:he(Am),buttonSeparator:he(MB),buttonBackground:he(Mm),buttonHoverBackground:he(RB),buttonSecondaryForeground:he(OB),buttonSecondaryBackground:he(MS),buttonSecondaryHoverBackground:he(FB),buttonBorder:he(PB)},OH={progressBarBackground:he(K8)},tP={inputActiveOptionBorder:he(CB),inputActiveOptionForeground:he(yB),inputActiveOptionBackground:he(wB)},GQe={checkboxBackground:he(BB),checkboxBorder:he(zB),checkboxForeground:he(WB)},ZQe={dialogBackground:he(Fi),dialogForeground:he(Ba),dialogShadow:he(Va),dialogBorder:he(Ct),errorIconForeground:he(lB),warningIconForeground:he(cB),infoIconForeground:he(dB),textLinkForeground:he(H8)},iP={inputBackground:he(_B),inputForeground:he(bB),inputBorder:he(vB),inputValidationInfoBorder:he(LB),inputValidationInfoBackground:he(SB),inputValidationInfoForeground:he(xB),inputValidationWarningBorder:he(EB),inputValidationWarningBackground:he(kB),inputValidationWarningForeground:he(DB),inputValidationErrorBorder:he(NB),inputValidationErrorBackground:he(IB),inputValidationErrorForeground:he(TB)},FH={listFilterWidgetBackground:he(i6),listFilterWidgetOutline:he(n6),listFilterWidgetNoMatchesOutline:he(o6),listFilterWidgetShadow:he(s6),inputBoxStyles:iP,toggleStyles:tP},BH={badgeBackground:he(ym),badgeForeground:he(U8),badgeBorder:he(Ct)},YQe={breadcrumbsBackground:he(sB),breadcrumbsForeground:he(oB),breadcrumbsHoverForeground:he(qA),breadcrumbsFocusForeground:he(qA),breadcrumbsFocusAndSelectionForeground:he(rB)},Hf={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:he($B),listFocusForeground:he(qB),listFocusOutline:he(jB),listActiveSelectionBackground:he(Yr),listActiveSelectionForeground:he(fr),listActiveSelectionIconForeground:he(Yu),listFocusAndSelectionOutline:he(GB),listFocusAndSelectionBackground:he(Yr),listFocusAndSelectionForeground:he(fr),listInactiveSelectionBackground:he(ZB),listInactiveSelectionIconForeground:he(XB),listInactiveSelectionForeground:he(YB),listInactiveFocusBackground:he(QB),listInactiveFocusOutline:he(JB),listHoverBackground:he(YA),listHoverForeground:he(XA),listDropOverBackground:he(e6),listDropBetweenBackground:he(t6),listSelectionOutline:he(ni),listHoverOutline:he(ni),treeIndentGuidesStroke:he(Rm),treeInactiveIndentGuidesStroke:he(r6),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0,tableColumnsBorder:he(a6),tableOddRowsBackgroundColor:he(l6)};function Uf(n){return JX(n,Hf)}var WH={selectBackground:he(Zr),selectListBackground:he(AB),selectForeground:he(Ha),decoratorRightForeground:he(OS),selectBorder:he(ah),focusBorder:he(zo),listFocusBackground:he(cb),listInactiveSelectionIconForeground:he(FS),listFocusForeground:he(lb),listFocusOutline:B8(ni,Z.transparent.toString()),listHoverBackground:he(YA),listHoverForeground:he(XA),listHoverOutline:he(ni),selectListBorder:he(Sm),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropOverBackground:void 0,listDropBetweenBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},zH={shadowColor:he(Va),borderColor:he(c6),foregroundColor:he(d6),backgroundColor:he(h6),selectionForegroundColor:he(u6),selectionBackgroundColor:he(f6),selectionBorderColor:he(g6),separatorColor:he(m6),scrollbarShadow:he($u),scrollbarSliderBackground:he(qu),scrollbarSliderHoverBackground:he(ju),scrollbarSliderActiveBackground:he(Gu)};var tE=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},rs=function(n,e){return function(t,i){e(t,i,n)}};function VH(n,e,t,i){let o=n.getActions(e),s=uu.getInstance(),r=s.keyStatus.altKey||(Li||mi)&&s.keyStatus.shiftKey;UH(o,t,r,i?a=>a===i:a=>a==="navigation")}function HH(n,e,t,i,o,s){let r=n.getActions(e);UH(r,t,!1,typeof i=="string"?l=>l===i:i,o,s)}function UH(n,e,t,i=r=>r==="navigation",o=()=>!1,s=!1){let r,a;Array.isArray(e)?(r=e,a=e):(r=e.primary,a=e.secondary);let l=new Set;for(let[c,d]of n){let h;i(c)?(h=r,h.length>0&&s&&h.push(new zi)):(h=a,h.length>0&&h.push(new zi));for(let u of d){t&&(u=u instanceof Br&&u.alt?u.alt:u);let f=h.push(u);u instanceof bl&&l.add({group:c,action:u,index:f-1})}}for(let{group:c,action:d,index:h}of l){let u=i(c)?r:a,f=d.actions;o(d,c,u.length)&&u.splice(h,1,...f)}}var Zv=class extends Fh{constructor(e,t,i,o,s,r,a,l){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t?.draggable,keybinding:t?.keybinding,hoverDelegate:t?.hoverDelegate}),this._keybindingService=i,this._notificationService=o,this._contextKeyService=s,this._themeService=r,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new no),this._altKey=uu.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(e){e.preventDefault(),e.stopPropagation();try{await this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1,i=()=>{var o;let s=!!(!((o=this._menuItemAction.alt)===null||o===void 0)&&o.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);s!==this._wantsAltCommand&&(this._wantsAltCommand=s,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register($(e,"mouseleave",o=>{t=!1,i()})),this._register($(e,"mouseenter",o=>{t=!0,i()})),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;let t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),i=t&&t.getLabel(),o=this._commandAction.tooltip||this._commandAction.label,s=i?p("titleAndKb","{0} ({1})",o,i):o;if(!this._wantsAltCommand&&(!((e=this._menuItemAction.alt)===null||e===void 0)&&e.enabled)){let r=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?p("titleAndKb","{0} ({1})",r,l):r;s=p("titleAndKbAndAlt",`{0} +[{1}] {2}`,s,Np.modifierLabels[po].altKey,c)}return s}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;let{element:t,label:i}=this;if(!t||!i)return;let o=this._commandAction.checked&&AH(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(o)if(Xe.isThemeIcon(o)){let s=Xe.asClassNameArray(o);i.classList.add(...s),this._itemClassDispose.value=be(()=>{i.classList.remove(...s)})}else i.style.backgroundImage=Qu(this._themeService.getColorTheme().type)?Mr(o.dark):Mr(o.light),i.classList.add("icon"),this._itemClassDispose.value=_o(be(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};Zv=tE([rs(2,fi),rs(3,Ko),rs(4,rt),rs(5,an),rs(6,Ds),rs(7,ao)],Zv);var nP=class extends Bh{constructor(e,t,i,o,s){var r,a,l;let c={...t,menuAsChild:(r=t?.menuAsChild)!==null&&r!==void 0?r:!1,classNames:(a=t?.classNames)!==null&&a!==void 0?a:Xe.isThemeIcon(e.item.icon)?Xe.asClassName(e.item.icon):void 0,keybindingProvider:(l=t?.keybindingProvider)!==null&&l!==void 0?l:d=>i.lookupKeybinding(d.id)};super(e,{getActions:()=>e.actions},o,c),this._keybindingService=i,this._contextMenuService=o,this._themeService=s}render(e){super.render(e),Ms(this.element),e.classList.add("menu-entry");let t=this._action,{icon:i}=t.item;if(i&&!Xe.isThemeIcon(i)){this.element.classList.add("icon");let o=()=>{this.element&&(this.element.style.backgroundImage=Qu(this._themeService.getColorTheme().type)?Mr(i.dark):Mr(i.light))};o(),this._register(this._themeService.onDidColorThemeChange(()=>{o()}))}}};nP=tE([rs(2,fi),rs(3,Ds),rs(4,an)],nP);var oP=class extends qo{constructor(e,t,i,o,s,r,a,l){var c,d,h;super(null,e),this._keybindingService=i,this._notificationService=o,this._contextMenuService=s,this._menuService=r,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let u,f=t?.persistLastActionId?l.get(this._storageKey,1):void 0;f&&(u=e.actions.find(m=>f===m.id)),u||(u=e.actions[0]),this._defaultAction=this._instaService.createInstance(Zv,u,{keybinding:this._getDefaultActionKeybindingLabel(u)});let g={keybindingProvider:m=>this._keybindingService.lookupKeybinding(m.id),...t,menuAsChild:(c=t?.menuAsChild)!==null&&c!==void 0?c:!0,classNames:(d=t?.classNames)!==null&&d!==void 0?d:["codicon","codicon-chevron-down"],actionRunner:(h=t?.actionRunner)!==null&&h!==void 0?h:new bs};this._dropdown=new Bh(e,e.actions,this._contextMenuService,g),this._register(this._dropdown.actionRunner.onDidRun(m=>{m.action instanceof Br&&this.update(m.action)}))}update(e){var t;!((t=this._options)===null||t===void 0)&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(Zv,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends bs{async runAction(i,o){await i.run(void 0)}},this._container&&this._defaultAction.render(Ug(this._container,ve(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let i;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){let o=this._keybindingService.lookupKeybinding(e.id);o&&(i=`(${o.getLabel()})`)}return i}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");let t=ve(".action-container");this._defaultAction.render(me(this._container,t)),this._register($(t,se.KEY_DOWN,o=>{let s=new bt(o);s.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),s.stopPropagation())}));let i=ve(".dropdown-action-container");this._dropdown.render(me(this._container,i)),this._register($(i,se.KEY_DOWN,o=>{var s;let r=new bt(o);r.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(s=this._defaultAction.element)===null||s===void 0||s.focus(),r.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};oP=tE([rs(2,fi),rs(3,Ko),rs(4,Ds),rs(5,Wr),rs(6,Ye),rs(7,Vf)],oP);var sP=class extends YD{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===zi.ID?"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500":i.label,isDisabled:!i.enabled})),0,t,WH,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=he(ah)}runAction(e,t){let i=this.action.actions[t];i&&this.actionRunner.run(i)}};sP=tE([rs(1,Qc)],sP);function KH(n,e,t){return e instanceof Br?n.createInstance(Zv,e,t):e instanceof wl?e.item.isSelection?n.createInstance(sP,e):e.item.rememberDefaultAction?n.createInstance(oP,e,{...t,persistLastActionId:!0}):n.createInstance(nP,e,t):void 0}zr();Oi();Gg();_();v();b();ke();Qs();_();v();b();ps();ke();oo();Qs();_();v();b();ke();oo();Po();ye();le();xi();var Eo=class extends H{constructor(e,t={}){var i,o,s,r,a,l,c;super(),this._actionRunnerDisposables=this._register(new ae),this.viewItemDisposables=this._register(new xd),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new B),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new B({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new B),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new B),this.onWillRun=this._onWillRun.event,this.options=t,this._context=(i=t.context)!==null&&i!==void 0?i:null,this._orientation=(o=this.options.orientation)!==null&&o!==void 0?o:0,this._triggerKeys={keyDown:(r=(s=this.options.triggerKeys)===null||s===void 0?void 0:s.keyDown)!==null&&r!==void 0?r:!1,keys:(l=(a=this.options.triggerKeys)===null||a===void 0?void 0:a.keys)!==null&&l!==void 0?l:[3,10]},this._hoverDelegate=(c=t.hoverDelegate)!==null&&c!==void 0?c:this._register(Mf()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new bs,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(u=>this._onDidRun.fire(u))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(u=>this._onWillRun.fire(u))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar";let d,h;switch(this._orientation){case 0:d=[15],h=[17];break;case 1:d=[16],h=[18],this.domNode.className+=" vertical";break}this._register($(this.domNode,se.KEY_DOWN,u=>{let f=new bt(u),g=!0,m=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;d&&(f.equals(d[0])||f.equals(d[1]))?g=this.focusPrevious():h&&(f.equals(h[0])||f.equals(h[1]))?g=this.focusNext():f.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():f.equals(14)?g=this.focusFirst():f.equals(13)?g=this.focusLast():f.equals(2)&&m instanceof qo&&m.trapsArrowNavigation?g=this.focusNext():this.isTriggerKeyEvent(f)?this._triggerKeys.keyDown?this.doTrigger(f):this.triggerKeyDown=!0:g=!1,g&&(f.preventDefault(),f.stopPropagation())})),this._register($(this.domNode,se.KEY_UP,u=>{let f=new bt(u);this.isTriggerKeyEvent(f)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(f)),f.preventDefault(),f.stopPropagation()):(f.equals(2)||f.equals(1026)||f.equals(16)||f.equals(18)||f.equals(15)||f.equals(17))&&this.updateFocusedItem()})),this.focusTracker=this._register(Ic(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(Bi()===this.domNode||!yi(Bi(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=1?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){let t=this.viewItems.find(i=>i instanceof qo&&i.isEnabled());t instanceof qo&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof qo&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){var e,t;for(let i=0;it.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){var t;if(typeof e=="number")return(t=this.viewItems[e])===null||t===void 0?void 0:t.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let i=0;i{let r=document.createElement("li");r.className="action-item",r.setAttribute("role","presentation");let a,l={hoverDelegate:this._hoverDelegate,...t};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(s,l)),a||(a=new Fh(this.context,s,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,$(r,se.CONTEXT_MENU,c=>{He.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),this.focusable&&a instanceof qo&&this.viewItems.length===0&&a.setFocusable(!0),o===null||o<0||o>=this.actionsList.children.length?(this.actionsList.appendChild(r),this.viewItems.push(a)):(this.actionsList.insertBefore(r,this.actionsList.children[o]),this.viewItems.splice(o,0,a),o++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=li(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),Co(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return this.viewItems.length===0}focus(e){let t=!1,i;if(e===void 0?t=!0:typeof e=="number"?i=e:typeof e=="boolean"&&(t=e),t&&typeof this.focusedItem>"u"){let o=this.viewItems.findIndex(s=>s.isEnabled());this.focusedItem=o===-1?void 0:o,this.updateFocus(void 0,void 0,!0)}else i!==void 0&&(this.focusedItem=i),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;let t=this.focusedItem,i;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=t,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===zi.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;let t=this.focusedItem,i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===zi.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){var o,s;typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((o=this.viewItems[this.previouslyFocusedItem])===null||o===void 0||o.blur());let r=this.focusedItem!==void 0?this.viewItems[this.focusedItem]:void 0;if(r){let a=!0;cg(r.focus)||(a=!1),this.options.focusOnlyEnabledItems&&cg(r.isEnabled)&&!r.isEnabled()&&(a=!1),r.action.id===zi.ID&&(a=!1),a?(i||this.previouslyFocusedItem!==this.focusedItem)&&(r.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),a&&((s=r.showHover)===null||s===void 0||s.call(r))}}doTrigger(e){if(typeof this.focusedItem>"u")return;let t=this.viewItems[this.focusedItem];if(t instanceof qo){let i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=li(this.viewItems),this.getContainer().remove(),super.dispose()}};Po();Gt();$n();K_();Ln();xp();le();Lt();ot();var aP=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,rP=/(&)?(&)([^\s&])/g,iE;(function(n){n[n.Right=0]="Right",n[n.Left=1]="Left"})(iE||(iE={}));var lP;(function(n){n[n.Above=0]="Above",n[n.Below=1]="Below"})(lP||(lP={}));var Yv=class n extends Eo{constructor(e,t,i,o){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");let s=document.createElement("div");s.classList.add("monaco-menu"),s.setAttribute("role","presentation"),super(s,{orientation:1,actionViewItemProvider:c=>this.doGetActionViewItem(c,i,r),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...Be||mi?[10]:[]],keyDown:!0}}),this.menuStyles=o,this.menuElement=s,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,o),this._register(ui.addTarget(s)),this._register($(s,se.KEY_DOWN,c=>{new bt(c).equals(2)&&c.preventDefault()})),i.enableMnemonics&&this._register($(s,se.KEY_DOWN,c=>{let d=c.key.toLocaleLowerCase();if(this.mnemonics.has(d)){He.stop(c,!0);let h=this.mnemonics.get(d);if(h.length===1&&(h[0]instanceof oE&&h[0].container&&this.focusItemByElement(h[0].container),h[0].onClick(c)),h.length>1){let u=h.shift();u&&u.container&&(this.focusItemByElement(u.container),h.push(u)),this.mnemonics.set(d,h)}}})),mi&&this._register($(s,se.KEY_DOWN,c=>{let d=new bt(c);d.equals(14)||d.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),He.stop(c,!0)):(d.equals(13)||d.equals(12))&&(this.focusedItem=0,this.focusPrevious(),He.stop(c,!0))})),this._register($(this.domNode,se.MOUSE_OUT,c=>{let d=c.relatedTarget;yi(d,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),c.stopPropagation())})),this._register($(this.actionsList,se.MOUSE_OVER,c=>{let d=c.target;if(!(!d||!yi(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){let h=this.focusedItem;this.setFocusedItem(d),h!==this.focusedItem&&this.updateFocus()}}})),this._register(ui.addTarget(this.actionsList)),this._register($(this.actionsList,It.Tap,c=>{let d=c.initialTarget;if(!(!d||!yi(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){let h=this.focusedItem;this.setFocusedItem(d),h!==this.focusedItem&&this.updateFocus()}}}));let r={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new uh(s,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));let a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,o),this._register($(s,It.Change,c=>{He.stop(c,!0);let d=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:d-c.translationY})})),this._register($(a,se.MOUSE_UP,c=>{c.preventDefault()}));let l=ge(e);s.style.maxHeight=`${Math.max(10,l.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((c,d)=>{var h;return!((h=i.submenuIds)===null||h===void 0)&&h.has(c.id)?(console.warn(`Found submenu cycle: ${c.id}`),!1):!(c instanceof zi&&(d===t.length-1||d===0||t[d-1]instanceof zi))}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(c=>!(c instanceof sE)).forEach((c,d,h)=>{c.updatePositionInSet(d+1,h.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(gu(e)?this.styleSheet=Xi(e):(n.globalStyleSheet||(n.globalStyleSheet=Xi()),this.styleSheet=n.globalStyleSheet)),this.styleSheet.textContent=tQ(t,gu(e))}styleScrollElement(e,t){var i,o;let s=(i=t.foregroundColor)!==null&&i!==void 0?i:"",r=(o=t.backgroundColor)!==null&&o!==void 0?o:"",a=t.borderColor?`1px solid ${t.borderColor}`:"",l="5px",c=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=a,e.style.borderRadius=l,e.style.color=s,e.style.backgroundColor=r,e.style.boxShadow=c}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){let t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register($(this.element,se.MOUSE_UP,s=>{if(He.stop(s,!0),wn){if(new yn(ge(this.element),s).rightButton)return;this.onClick(s)}else setTimeout(()=>{this.onClick(s)},0)})),this._register($(this.element,se.CONTEXT_MENU,s=>{He.stop(s,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=me(this.element,ve("a.action-menu-item")),this._action.id===zi.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=me(this.item,ve("span.menu-item-check"+Xe.asCSSSelector(ue.menuSelection))),this.check.setAttribute("role","none"),this.label=me(this.item,ve("span.action-label")),this.options.label&&this.options.keybinding&&(me(this.item,ve("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),(e=this.item)===null||e===void 0||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){Co(this.label);let t=pD(this.action.label);if(t){let i=eQ(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));let o=aP.exec(t);if(o){t=hu(t),rP.lastIndex=0;let s=rP.exec(t);for(;s&&s[1];)s=rP.exec(t);let r=a=>a.replace(/&&/g,"&");s?this.label.append(Sc(r(t.substr(0,s.index))," "),ve("u",{"aria-hidden":"true"},s[3]),kT(r(t.substr(s.index+s[0].length))," ")):this.label.innerText=r(t).trim(),(e=this.item)===null||e===void 0||e.setAttribute("aria-keyshortcuts",(o[1]?o[1]:o[3]).toLocaleLowerCase())}else this.label.innerText=t.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;let e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){let e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,o=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",s=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=i??"",this.item.style.outline=o,this.item.style.outlineOffset=s),this.check&&(this.check.style.color=t??"")}},oE=class extends nE{constructor(e,t,i,o,s){super(e,e,o,s),this.submenuActions=t,this.parentData=i,this.submenuOptions=o,this.mysubmenu=null,this.submenuDisposables=this._register(new ae),this.mouseOver=!1,this.expandDirection=o&&o.expandDirection!==void 0?o.expandDirection:{horizontal:iE.Right,vertical:lP.Below},this.showScheduler=new di(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new di(()=>{this.element&&!yi(Bi(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=me(this.item,ve("span.submenu-indicator"+Xe.asCSSSelector(ue.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register($(this.element,se.KEY_UP,t=>{let i=new bt(t);(i.equals(17)||i.equals(3))&&(He.stop(t,!0),this.createSubmenu(!0))})),this._register($(this.element,se.KEY_DOWN,t=>{let i=new bt(t);Bi()===this.item&&(i.equals(17)||i.equals(3))&&He.stop(t,!0)})),this._register($(this.element,se.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register($(this.element,se.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register($(this.element,se.FOCUS_OUT,t=>{this.element&&!yi(Bi(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}onClick(e){He.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,o){let s={top:0,left:0};return s.left=Nf(e.width,t.width,{position:o.horizontal===iE.Right?0:1,offset:i.left,size:i.width}),s.left>=i.left&&s.left{new bt(d).equals(15)&&(He.stop(d,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add($(this.submenuContainer,se.KEY_DOWN,d=>{new bt(d).equals(15)&&He.stop(d,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&((t=this.item)===null||t===void 0||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();let t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}},sE=class extends Fh{constructor(e,t,i,o){super(e,t,i),this.menuStyles=o}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}};function eQ(n){let e=aP,t=e.exec(n);if(!t)return n;let i=!t[1];return n.replace(e,i?"$2$3":"").trim()}function $H(n){let e=_C()[n.id];return`.codicon-${n.id}:before { content: '\\${e.toString(16)}'; }`}function tQ(n,e){let t=` +.monaco-menu { + font-size: 13px; + border-radius: 5px; + min-width: 160px; +} + +${$H(ue.menuSelection)} +${$H(ue.menuSubmenu)} + +.monaco-menu .monaco-action-bar { + text-align: right; + overflow: hidden; + white-space: nowrap; +} + +.monaco-menu .monaco-action-bar .actions-container { + display: flex; + margin: 0 auto; + padding: 0; + width: 100%; + justify-content: flex-end; +} + +.monaco-menu .monaco-action-bar.vertical .actions-container { + display: inline-block; +} + +.monaco-menu .monaco-action-bar.reverse .actions-container { + flex-direction: row-reverse; +} + +.monaco-menu .monaco-action-bar .action-item { + cursor: pointer; + display: inline-block; + transition: transform 50ms ease; + position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */ +} + +.monaco-menu .monaco-action-bar .action-item.disabled { + cursor: default; +} + +.monaco-menu .monaco-action-bar .action-item .icon, +.monaco-menu .monaco-action-bar .action-item .codicon { + display: inline-block; +} + +.monaco-menu .monaco-action-bar .action-item .codicon { + display: flex; + align-items: center; +} + +.monaco-menu .monaco-action-bar .action-label { + font-size: 11px; + margin-right: 4px; +} + +.monaco-menu .monaco-action-bar .action-item.disabled .action-label, +.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover { + color: var(--vscode-disabledForeground); +} + +/* Vertical actions */ + +.monaco-menu .monaco-action-bar.vertical { + text-align: left; +} + +.monaco-menu .monaco-action-bar.vertical .action-item { + display: block; +} + +.monaco-menu .monaco-action-bar.vertical .action-label.separator { + display: block; + border-bottom: 1px solid var(--vscode-menu-separatorBackground); + padding-top: 1px; + padding: 30px; +} + +.monaco-menu .secondary-actions .monaco-action-bar .action-label { + margin-left: 6px; +} + +/* Action Items */ +.monaco-menu .monaco-action-bar .action-item.select-container { + overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */ + flex: 1; + max-width: 170px; + min-width: 60px; + display: flex; + align-items: center; + justify-content: center; + margin-right: 10px; +} + +.monaco-menu .monaco-action-bar.vertical { + margin-left: 0; + overflow: visible; +} + +.monaco-menu .monaco-action-bar.vertical .actions-container { + display: block; +} + +.monaco-menu .monaco-action-bar.vertical .action-item { + padding: 0; + transform: none; + display: flex; +} + +.monaco-menu .monaco-action-bar.vertical .action-item.active { + transform: none; +} + +.monaco-menu .monaco-action-bar.vertical .action-menu-item { + flex: 1 1 auto; + display: flex; + height: 2em; + align-items: center; + position: relative; + margin: 0 4px; + border-radius: 4px; +} + +.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding, +.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding { + opacity: unset; +} + +.monaco-menu .monaco-action-bar.vertical .action-label { + flex: 1 1 auto; + text-decoration: none; + padding: 0 1em; + background: none; + font-size: 12px; + line-height: 1; +} + +.monaco-menu .monaco-action-bar.vertical .keybinding, +.monaco-menu .monaco-action-bar.vertical .submenu-indicator { + display: inline-block; + flex: 2 1 auto; + padding: 0 1em; + text-align: right; + font-size: 12px; + line-height: 1; +} + +.monaco-menu .monaco-action-bar.vertical .submenu-indicator { + height: 100%; +} + +.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon { + font-size: 16px !important; + display: flex; + align-items: center; +} + +.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before { + margin-left: auto; + margin-right: -20px; +} + +.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding, +.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator { + opacity: 0.4; +} + +.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) { + display: inline-block; + box-sizing: border-box; + margin: 0; +} + +.monaco-menu .monaco-action-bar.vertical .action-item { + position: static; + overflow: visible; +} + +.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu { + position: absolute; +} + +.monaco-menu .monaco-action-bar.vertical .action-label.separator { + width: 100%; + height: 0px !important; + opacity: 1; +} + +.monaco-menu .monaco-action-bar.vertical .action-label.separator.text { + padding: 0.7em 1em 0.1em 1em; + font-weight: bold; + opacity: 1; +} + +.monaco-menu .monaco-action-bar.vertical .action-label:hover { + color: inherit; +} + +.monaco-menu .monaco-action-bar.vertical .menu-item-check { + position: absolute; + visibility: hidden; + width: 1em; + height: 100%; +} + +.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check { + visibility: visible; + display: flex; + align-items: center; + justify-content: center; +} + +/* Context Menu */ + +.context-view.monaco-menu-container { + outline: 0; + border: none; + animation: fadeIn 0.083s linear; + -webkit-app-region: no-drag; +} + +.context-view.monaco-menu-container :focus, +.context-view.monaco-menu-container .monaco-action-bar.vertical:focus, +.context-view.monaco-menu-container .monaco-action-bar.vertical :focus { + outline: 0; +} + +.hc-black .context-view.monaco-menu-container, +.hc-light .context-view.monaco-menu-container, +:host-context(.hc-black) .context-view.monaco-menu-container, +:host-context(.hc-light) .context-view.monaco-menu-container { + box-shadow: none; +} + +.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused, +.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused, +:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused, +:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused { + background: none; +} + +/* Vertical Action Bar Styles */ + +.monaco-menu .monaco-action-bar.vertical { + padding: 4px 0; +} + +.monaco-menu .monaco-action-bar.vertical .action-menu-item { + height: 2em; +} + +.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator), +.monaco-menu .monaco-action-bar.vertical .keybinding { + font-size: inherit; + padding: 0 2em; + max-height: 100%; +} + +.monaco-menu .monaco-action-bar.vertical .menu-item-check { + font-size: inherit; + width: 2em; +} + +.monaco-menu .monaco-action-bar.vertical .action-label.separator { + font-size: inherit; + margin: 5px 0 !important; + padding: 0; + border-radius: 0; +} + +.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator, +:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator { + margin-left: 0; + margin-right: 0; +} + +.monaco-menu .monaco-action-bar.vertical .submenu-indicator { + font-size: 60%; + padding: 0 1.8em; +} + +.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator, +:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator { + height: 100%; + mask-size: 10px 10px; + -webkit-mask-size: 10px 10px; +} + +.monaco-menu .action-item { + cursor: default; +}`;if(e){t+=` + /* Arrows */ + .monaco-scrollable-element > .scrollbar > .scra { + cursor: pointer; + font-size: 11px !important; + } + + .monaco-scrollable-element > .visible { + opacity: 1; + + /* Background rule added for IE9 - to allow clicks on dom node */ + background:rgba(0,0,0,0); + + transition: opacity 100ms linear; + } + .monaco-scrollable-element > .invisible { + opacity: 0; + pointer-events: none; + } + .monaco-scrollable-element > .invisible.fade { + transition: opacity 800ms linear; + } + + /* Scrollable Content Inset Shadow */ + .monaco-scrollable-element > .shadow { + position: absolute; + display: none; + } + .monaco-scrollable-element > .shadow.top { + display: block; + top: 0; + left: 3px; + height: 3px; + width: 100%; + } + .monaco-scrollable-element > .shadow.left { + display: block; + top: 3px; + left: 0; + height: 100%; + width: 3px; + } + .monaco-scrollable-element > .shadow.top-left-corner { + display: block; + top: 0; + left: 0; + height: 3px; + width: 3px; + } + `;let i=n.scrollbarShadow;i&&(t+=` + .monaco-scrollable-element > .shadow.top { + box-shadow: ${i} 0 6px 6px -6px inset; + } + + .monaco-scrollable-element > .shadow.left { + box-shadow: ${i} 6px 0 6px -6px inset; + } + + .monaco-scrollable-element > .shadow.top.left { + box-shadow: ${i} 6px 6px 6px -6px inset; + } + `);let o=n.scrollbarSliderBackground;o&&(t+=` + .monaco-scrollable-element > .scrollbar > .slider { + background: ${o}; + } + `);let s=n.scrollbarSliderHoverBackground;s&&(t+=` + .monaco-scrollable-element > .scrollbar > .slider:hover { + background: ${s}; + } + `);let r=n.scrollbarSliderActiveBackground;r&&(t+=` + .monaco-scrollable-element > .scrollbar > .slider.active { + background: ${r}; + } + `)}return t}Po();xt();le();var rE=class{constructor(e,t,i,o){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=o,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){let t=e.getActions();if(!t.length)return;this.focusToReturn=Bi();let i,o=e.domForShadowRoot instanceof HTMLElement?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:s=>{var r;this.lastContainer=s;let a=e.getMenuClassName?e.getMenuClassName():"";a&&(s.className+=" "+a),this.options.blockMouse&&(this.block=s.appendChild(ve(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",(r=this.blockDisposable)===null||r===void 0||r.dispose(),this.blockDisposable=$(this.block,se.MOUSE_DOWN,h=>h.stopPropagation()));let l=new ae,c=e.actionRunner||new bs;c.onWillRun(h=>this.onActionRun(h,!e.skipTelemetry),this,l),c.onDidRun(this.onDidActionRun,this,l),i=new Yv(s,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:h=>this.keybindingService.lookupKeybinding(h.id)},zH),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l);let d=ge(s);return l.add($(d,se.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add($(d,se.MOUSE_DOWN,h=>{if(h.defaultPrevented)return;let u=new yn(d,h),f=u.target;if(!u.rightButton){for(;f;){if(f===s)return;f=f.parentElement}this.contextViewService.hideContextView(!0)}})),_o(l,i)},focus:()=>{i?.focus(!!e.autoSelectFirstItem)},onHide:s=>{var r,a,l;(r=e.onHide)===null||r===void 0||r.call(e,!!s),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=null,this.lastContainer&&(Bi()===this.lastContainer||yi(Bi(),this.lastContainer))&&((l=this.focusToReturn)===null||l===void 0||l.focus()),this.lastContainer=null}},o,!!o)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!yd(e.error)&&this.notificationService.error(e.error)}};var iQ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Yp=function(n,e){return function(t,i){e(t,i,n)}},aE=class extends H{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new rE(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,o,s,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=o,this.menuService=s,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new B),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new B)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=cP.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{var i;(i=e.onHide)===null||i===void 0||i.call(e,t),this._onDidHideContextMenu.fire()}}),uu.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};aE=iQ([Yp(0,nr),Yp(1,Ko),Yp(2,Qc),Yp(3,fi),Yp(4,Wr),Yp(5,rt)],aE);var cP;(function(n){function e(i){return i&&i.menuId instanceof A}function t(i,o,s){if(!e(i))return i;let{menuId:r,menuActionOptions:a,contextKeyService:l}=i;return{...i,getActions:()=>{let c=[];if(r){let d=o.createMenu(r,l??s);VH(d,a,c),d.dispose()}return i.getActions?zi.join(i.getActions(),c):c}}}n.transform=t})(cP||(cP={}));Ur();_();v();b();ke();vo();fs();kr();cr();er();bf();sn();Or();ir();_();v();b();var Xv;(function(n){n[n.API=0]="API",n[n.USER=1]="USER"})(Xv||(Xv={}));var uP=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},lE=function(n,e){return function(t,i){e(t,i,n)}},dP=class{constructor(e){this._commandService=e}async open(e,t){if(!c0(e,Ze.command))return!1;if(!t?.allowCommands||(typeof e=="string"&&(e=Oe.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=Sv(decodeURIComponent(e.query))}catch{try{i=Sv(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};dP=uP([lE(0,kn)],dP);var hP=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=Oe.parse(e));let{selection:i,uri:o}=sV(e);return e=o,e.scheme===Ze.file&&(e=JW(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t?.fromUserGesture?Xv.USER:Xv.API,...t?.editorOptions}},this._editorService.getFocusedCodeEditor(),t?.openToSide),!0}};hP=uP([lE(0,Zt)],hP);var cE=class{constructor(e,t){this._openers=new Ii,this._validators=new Ii,this._resolvers=new Ii,this._resolvedUriTargets=new Gn(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new Ii,this._defaultExternalOpener={openExternal:async i=>($T(i,Ze.http,Ze.https)?Yw(i):gt.location.href=i,!0)},this._openers.push({open:async(i,o)=>o?.openExternal||$T(i,Ze.mailto,Ze.http,Ze.https,Ze.vsls)?(await this._doOpenExternal(i,o),!0):!1}),this._openers.push(new dP(t)),this._openers.push(new hP(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}async open(e,t){var i;let o=typeof e=="string"?Oe.parse(e):e,s=(i=this._resolvedUriTargets.get(o))!==null&&i!==void 0?i:e;for(let r of this._validators)if(!await r.shouldOpen(s,t))return!1;for(let r of this._openers)if(await r.open(e,t))return!0;return!1}async resolveExternalUri(e,t){for(let i of this._resolvers)try{let o=await i.resolveExternalUri(e,t);if(o)return this._resolvedUriTargets.has(o.resolved)||this._resolvedUriTargets.set(o.resolved,e),o}catch{}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){let i=typeof e=="string"?Oe.parse(e):e,o;try{o=(await this.resolveExternalUri(i,t)).resolved}catch{o=i}let s;if(typeof e=="string"&&i.toString()===o.toString()?s=e:s=encodeURI(o.toString(!0)),t?.allowContributedOpeners){let r=typeof t?.allowContributedOpeners=="string"?t?.allowContributedOpeners:void 0;for(let a of this._externalOpeners)if(await a.openExternal(s,{sourceUri:i,preferredOpenerId:r},Mo.None))return!0}return this._defaultExternalOpener.openExternal(s,{sourceUri:i},Mo.None)}dispose(){this._validators.clear()}};cE=uP([lE(0,Zt),lE(1,kn)],cE);dE();Hr();_();v();b();_();v();b();Ge();qe();var Es;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(Es||(Es={}));(function(n){function e(r,a){return a-r}n.compare=e;let t=Object.create(null);t[n.Error]=p("sev.error","Error"),t[n.Warning]=p("sev.warning","Warning"),t[n.Info]=p("sev.info","Info");function i(r){return t[r]||""}n.toString=i;function o(r){switch(r){case Ci.Error:return n.Error;case Ci.Warning:return n.Warning;case Ci.Info:return n.Info;case Ci.Ignore:return n.Hint}}n.fromSeverity=o;function s(r){switch(r){case n.Error:return Ci.Error;case n.Warning:return Ci.Warning;case n.Info:return Ci.Info;case n.Hint:return Ci.Ignore}}n.toSeverity=s})(Es||(Es={}));var qH;(function(n){let e="";function t(o){return i(o,!0)}n.makeKey=t;function i(o,s){let r=[e];return o.source?r.push(o.source.replace("\xA6","\\\xA6")):r.push(e),o.code?typeof o.code=="string"?r.push(o.code.replace("\xA6","\\\xA6")):r.push(o.code.value.replace("\xA6","\\\xA6")):r.push(e),o.severity!==void 0&&o.severity!==null?r.push(Es.toString(o.severity)):r.push(e),o.message&&s?r.push(o.message.replace("\xA6","\\\xA6")):r.push(e),o.startLineNumber!==void 0&&o.startLineNumber!==null?r.push(o.startLineNumber.toString()):r.push(e),o.startColumn!==void 0&&o.startColumn!==null?r.push(o.startColumn.toString()):r.push(e),o.endLineNumber!==void 0&&o.endLineNumber!==null?r.push(o.endLineNumber.toString()):r.push(e),o.endColumn!==void 0&&o.endColumn!==null?r.push(o.endColumn.toString()):r.push(e),r.push(e),r.join("\xA6")}n.makeKeyOptionalMessage=i})(qH||(qH={}));var tl=De("markerService");le();hr();Qi();$a();_u();Ke();er();ye();is();cr();_();v();b();function jH(n,e){let t=[],i=[];for(let o of n)e.has(o)||t.push(o);for(let o of e)n.has(o)||i.push(o);return{removed:t,added:i}}function GH(n,e){let t=new Set;for(let i of e)n.has(i)&&t.add(i);return t}var nQ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},ZH=function(n,e){return function(t,i){e(t,i,n)}},hE=class extends H{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new B),this._markerDecorations=new Gn,e.getModels().forEach(i=>this._onModelAdded(i)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){let i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{let i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){let t=new fP(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;let i=this._markerDecorations.get(e.uri);i&&(i.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===Ze.inMemory||e.uri.scheme===Ze.internal||e.uri.scheme===Ze.vscode)&&((t=this._markerService)===null||t===void 0||t.read({resource:e.uri}).map(o=>o.owner).forEach(o=>this._markerService.remove(o,[e.uri])))}_updateDecorations(e){let t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};hE=nQ([ZH(0,xn),ZH(1,tl)],hE);var fP=class extends H{constructor(e){super(),this.model=e,this._map=new Zy,this._register(be(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){let{added:t,removed:i}=jH(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;let o=i.map(a=>this._map.get(a)),s=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),r=this.model.deltaDecorations(o,s);for(let a of i)this._map.delete(a);for(let a=0;a=o)return i;let s=e.getWordAtPosition(i.getStartPosition());s&&(i=new P(i.startLineNumber,s.startColumn,i.endLineNumber,s.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){let o=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);o=0:!1}};_();v();b();ye();le();Lt();sv();I_();Ma();Hr();Fo();ZL();Bg();kR();er();hs();lr();var oQ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Qv=function(n,e){return function(t,i){e(t,i,n)}},Xp;function Kf(n){return n.toString()}var gP=class{constructor(e,t,i){this.model=e,this._modelEventListeners=new ae,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(o=>i(e,o)))}dispose(){this._modelEventListeners.dispose()}},sQ=mi||Be?1:2,mP=class{constructor(e,t,i,o,s,r,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=o,this.heapSize=s,this.sha1=r,this.versionId=a,this.alternativeVersionId=l}},Jv=Xp=class extends H{constructor(e,t,i,o,s){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=o,this._languageConfigurationService=s,this._onModelAdded=this._register(new B),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new B),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new B),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(r=>this._updateModelOptions(r))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var i;let o=nn.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){let f=parseInt(e.editor.tabSize,10);isNaN(f)||(o=f),o<1&&(o=1)}let s="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){let f=parseInt(e.editor.indentSize,10);isNaN(f)||(s=Math.max(f,1))}let r=nn.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(r=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let a=sQ,l=e.eol;l===`\r +`?a=2:l===` +`&&(a=1);let c=nn.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let d=nn.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(d=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let h=nn.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(h=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let u=nn.bracketPairColorizationOptions;return!((i=e.editor)===null||i===void 0)&&i.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(u={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:o,indentSize:s,insertSpaces:r,detectIndentation:d,defaultEOL:a,trimAutoWhitespace:c,largeFileOptimizations:h,bracketPairColorizationOptions:u}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);let i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:po===3||po===2?` +`:`\r +`}_shouldRestoreUndoStack(){let e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){let o=typeof e=="string"?e:e.languageId,s=this._modelCreationOptionsByLanguageAndResource[o+t];if(!s){let r=this._configurationService.getValue("editor",{overrideIdentifier:o,resource:t}),a=this._getEOL(t,o);s=Xp._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[o+t]=s}return s}_updateModelOptions(e){let t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);let i=Object.keys(this._models);for(let o=0,s=i.length;oe){let t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,o)=>i.time-o.time);t.length>0&&this._disposedModelsHeapSize>e;){let i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,o){let s=this.getCreationOptions(t,i,o),r=new Zc(e,t,s,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(Kf(i))){let c=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),h=this._getSHA1Computer(),u=h.canComputeSHA1(r)?h.computeSHA1(r)===c.sha1:!1;if(u||c.sharesUndoRedoStack){for(let f of d.past)Ul(f)&&f.matchesResource(i)&&f.setModel(r);for(let f of d.future)Ul(f)&&f.matchesResource(i)&&f.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,f=>Ul(f)&&f.matchesResource(i)),u&&(r._overwriteVersionId(c.versionId),r._overwriteAlternativeVersionId(c.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}let a=Kf(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");let l=new gP(r,c=>this._onWillDispose(c),(c,d)=>this._onDidChangeLanguage(c,d));return this._models[a]=l,l}createModel(e,t,i,o=!1){let s;return t?s=this._createModelData(e,t,i,o):s=this._createModelData(e,In,i,o),this._onModelAdded.fire(s.model),s.model}getModels(){let e=[],t=Object.keys(this._models);for(let i=0,o=t.length;i0||c.future.length>0){for(let d of c.past)Ul(d)&&d.matchesResource(e.uri)&&(s=!0,r+=d.heapSize(e.uri),d.setModel(e.uri));for(let d of c.future)Ul(d)&&d.matchesResource(e.uri)&&(s=!0,r+=d.heapSize(e.uri),d.setModel(e.uri))}}let a=Xp.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(s)if(!o&&(r>a||!l.canComputeSHA1(e))){let c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>Ul(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new mP(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),o,r,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!o){let c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){let i=t.oldLanguage,o=e.getLanguageId(),s=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(o,e.uri,e.isForSimpleWidget);Xp._setModelOptionsForModel(e,r,s),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new uE}};Jv.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;Jv=Xp=oQ([Qv(0,Rt),Qv(1,gS),Qv(2,up),Qv(3,ii),Qv(4,yo)],Jv);var uE=class n{canComputeSHA1(e){return e.getValueLength()<=n.MAX_MODEL_SIZE}computeSHA1(e){let t=new h0,i=e.createSnapshot(),o;for(;o=i.read();)t.update(o);return t.digest()}};uE.MAX_MODEL_SIZE=10*1024*1024;_();v();b();ye();Ud();Qi();fs();qe();Oi();Or();_();v();b();fs();ye();Oi();qe();_();v();b();Gt();fs();ye();le();qe();_();v();b();wt();le();Oo();var fE;(function(n){n[n.PRESERVE=0]="PRESERVE",n[n.LAST=1]="LAST"})(fE||(fE={}));var _P={Quickaccess:"workbench.contributions.quickaccess"},pP=class{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,i)=>i.prefix.length-t.prefix.length),be(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return $1([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}};Vt.add(_P.Quickaccess,new pP);_();v();b();qe();var YH={ctrlCmd:!1,alt:!1},Wh;(function(n){n[n.Blur=1]="Blur",n[n.Gesture=2]="Gesture",n[n.Other=3]="Other"})(Wh||(Wh={}));var la;(function(n){n[n.NONE=0]="NONE",n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.LAST=3]="LAST"})(la||(la={}));var bP=class{constructor(e){this.options=e}},Cit=new bP,gE=De("quickInputService");Oo();var rQ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},XH=function(n,e){return function(t,i){e(t,i,n)}},mE=class extends H{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=Vt.as(_P.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var o,s,r;let[a,l]=this.getOrInstantiateProvider(e),c=this.visibleQuickAccess,d=c?.descriptor;if(c&&l&&d===l){e!==l.prefix&&!i?.preserveValue&&(c.picker.value=e),this.adjustValueSelection(c.picker,l,i);return}if(l&&!i?.preserveValue){let S;if(c&&d&&d!==l){let w=c.value.substr(d.prefix.length);w&&(S=`${l.prefix}${w}`)}if(!S){let w=a?.defaultFilterValue;w===fE.LAST?S=this.lastAcceptedPickerValues.get(l):typeof w=="string"&&(S=`${l.prefix}${w}`)}typeof S=="string"&&(e=S)}let h=(o=c?.picker)===null||o===void 0?void 0:o.valueSelection,u=(s=c?.picker)===null||s===void 0?void 0:s.value,f=new ae,g=f.add(this.quickInputService.createQuickPick());g.value=e,this.adjustValueSelection(g,l,i),g.placeholder=l?.placeholder,g.quickNavigate=i?.quickNavigateConfiguration,g.hideInput=!!g.quickNavigate&&!c,(typeof i?.itemActivation=="number"||i?.quickNavigateConfiguration)&&(g.itemActivation=(r=i?.itemActivation)!==null&&r!==void 0?r:la.SECOND),g.contextKey=l?.contextKey,g.filterValue=S=>S.substring(l?l.prefix.length:0);let m;t&&(m=new Og,f.add(ie.once(g.onWillAccept)(S=>{S.veto(),g.hide()}))),f.add(this.registerPickerListeners(g,a,l,e,i?.providerOptions));let C=f.add(new un);if(a&&f.add(a.provide(g,C.token,i?.providerOptions)),ie.once(g.onDidHide)(()=>{g.selectedItems.length===0&&C.cancel(),f.dispose(),m?.complete(g.selectedItems.slice(0))}),g.show(),h&&u===e&&(g.valueSelection=h),t)return m?.p}adjustValueSelection(e,t,i){var o;let s;i?.preserveValue?s=[e.value.length,e.value.length]:s=[(o=t?.prefix.length)!==null&&o!==void 0?o:0,e.value.length],e.valueSelection=s}registerPickerListeners(e,t,i,o,s){let r=new ae,a=this.visibleQuickAccess={picker:e,descriptor:i,value:o};return r.add(be(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),r.add(e.onDidChangeValue(l=>{let[c]=this.getOrInstantiateProvider(l);c!==t?this.show(l,{preserveValue:!0,providerOptions:s}):a.value=l})),i&&r.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),r}getOrInstantiateProvider(e){let t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let i=this.mapProviderToDescriptor.get(t);return i||(i=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,i)),[i,t]}};mE=rQ([XH(0,gE),XH(1,Ye)],mE);is();Qi();_();v();b();ke();oo();_();v();b();Ln();ye();var nd=class extends co{constructor(e){var t;super(),this._onChange=this._register(new B),this.onChange=this._onChange.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;let i=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,i.push(...Xe.asClassNameArray(this._icon))),this._opts.actionClassName&&i.push(...this._opts.actionClassName.split(" ")),this._checked&&i.push("checked"),this.domNode=document.createElement("div"),this._hover=this._register(Qn().setupUpdatableHover((t=e.hoverDelegate)!==null&&t!==void 0?t:ji("mouse"),this.domNode,this._opts.title)),this.domNode.classList.add(...i),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,o=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),o.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,o=>{if(o.keyCode===10||o.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),o.preventDefault(),o.stopPropagation();return}this._onKeyDown.fire(o)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}};wt();Gt();$n();ye();le();Lt();Ln();Ge();_();v();b();ke();ye();oo();Ef();_();v();b();var aQ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},pE=class{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}};aQ([Yt],pE.prototype,"toString",null);var lQ=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function QH(n){let e=[],t=0,i;for(;i=lQ.exec(n);){i.index-t>0&&e.push(n.substring(t,i.index));let[,o,s,,r]=i;r?e.push({label:o,href:s,title:r}):e.push({label:o,href:s}),t=i.index+i[0].length}return t{U7(f)&&He.stop(f,!0),t.callback(s.href)},c=t.disposables.add(new et(a,se.CLICK)).event,d=t.disposables.add(new et(a,se.KEY_DOWN)).event,h=ie.chain(d,f=>f.filter(g=>{let m=new bt(g);return m.equals(10)||m.equals(3)}));t.disposables.add(ui.addTarget(a));let u=t.disposables.add(new et(a,It.Tap)).event;ie.any(c,u,h)(l,null,t.disposables),e.appendChild(a)}}Fo();_();v();b();ke();ye();Ge();qe();_();v();b();ke();_();v();b();wt();fs();ye();le();var CP=class{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:H.None}}renderElement(e,t,i,o){var s;if((s=i.disposable)===null||s===void 0||s.dispose(),!i.data)return;let r=this.modelProvider();if(r.isResolved(e))return this.renderer.renderElement(r.get(e),e,i.data,o);let a=new un,l=r.resolve(e,a.token);i.disposable={dispose:()=>a.cancel()},this.renderer.renderPlaceholder(e,i.data),l.then(c=>this.renderer.renderElement(c,e,i.data,o))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}},wP=class{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){let t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}};function hQ(n,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new wP(n,e.accessibilityProvider)}}var _E=class{constructor(e,t,i,o,s={}){let r=()=>this.model,a=o.map(l=>new CP(l,r));this.list=new Do(e,t,i,a,hQ(r,s))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return ie.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return ie.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeSelection(){return ie.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(o=>this._model.get(o)),indexes:t,browserEvent:i}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Un(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose()}};_();v();b();ke();_();v();b();ke();_();v();b();ke();Gt();ye();le();Lt();var e_=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},uQ=!1,eU;(function(n){n.North="north",n.South="south",n.East="east",n.West="west"})(eU||(eU={}));var fQ=4,gQ=new B,mQ=300,pQ=new B,e1=class{constructor(e){this.el=e,this.disposables=new ae}get onPointerMove(){return this.disposables.add(new et(ge(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new et(ge(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}};e_([Yt],e1.prototype,"onPointerMove",null);e_([Yt],e1.prototype,"onPointerUp",null);var t1=class{get onPointerMove(){return this.disposables.add(new et(this.el,It.Change)).event}get onPointerUp(){return this.disposables.add(new et(this.el,It.End)).event}constructor(e){this.el=e,this.disposables=new ae}dispose(){this.disposables.dispose()}};e_([Yt],t1.prototype,"onPointerMove",null);e_([Yt],t1.prototype,"onPointerUp",null);var Jp=class{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}};e_([Yt],Jp.prototype,"onPointerMove",null);e_([Yt],Jp.prototype,"onPointerUp",null);var tU="pointer-events-disabled",$f=class n extends H{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===0),this.el.classList.toggle("minimum",e===1),this.el.classList.toggle("maximum",e===2),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){let t=i=>{this.orthogonalStartDragHandleDisposables.clear(),i!==0&&(this._orthogonalStartDragHandle=me(this.el,ve(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(be(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new et(this._orthogonalStartDragHandle,"mouseenter")).event(()=>n.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new et(this._orthogonalStartDragHandle,"mouseleave")).event(()=>n.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){let t=i=>{this.orthogonalEndDragHandleDisposables.clear(),i!==0&&(this._orthogonalEndDragHandle=me(this.el,ve(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(be(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new et(this._orthogonalEndDragHandle,"mouseenter")).event(()=>n.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new et(this._orthogonalEndDragHandle,"mouseleave")).event(()=>n.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){super(),this.hoverDelay=mQ,this.hoverDelayer=this._register(new ka(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new B),this._onDidStart=this._register(new B),this._onDidChange=this._register(new B),this._onDidReset=this._register(new B),this._onDidEnd=this._register(new B),this.orthogonalStartSashDisposables=this._register(new ae),this.orthogonalStartDragHandleDisposables=this._register(new ae),this.orthogonalEndSashDisposables=this._register(new ae),this.orthogonalEndDragHandleDisposables=this._register(new ae),this.onDidStart=this._onDidStart.event,this.onDidChange=this._onDidChange.event,this.onDidReset=this._onDidReset.event,this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.el=me(e,ve(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),Be&&this.el.classList.add("mac");let o=this._register(new et(this.el,"mousedown")).event;this._register(o(h=>this.onPointerStart(h,new e1(e)),this));let s=this._register(new et(this.el,"dblclick")).event;this._register(s(this.onPointerDoublePress,this));let r=this._register(new et(this.el,"mouseenter")).event;this._register(r(()=>n.onMouseEnter(this)));let a=this._register(new et(this.el,"mouseleave")).event;this._register(a(()=>n.onMouseLeave(this))),this._register(ui.addTarget(this.el));let l=this._register(new et(this.el,It.Start)).event;this._register(l(h=>this.onPointerStart(h,new t1(this.el)),this));let c=this._register(new et(this.el,It.Tap)).event,d;this._register(c(h=>{if(d){clearTimeout(d),d=void 0,this.onPointerDoublePress(h);return}clearTimeout(d),d=setTimeout(()=>d=void 0,250)},this)),typeof i.size=="number"?(this.size=i.size,i.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=fQ,this._register(gQ.event(h=>{this.size=h,this.layout()}))),this._register(pQ.event(h=>this.hoverDelay=h)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,this.orientation===1?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",uQ),this.layout()}onPointerStart(e,t){He.stop(e);let i=!1;if(!e.__orthogonalSashEvent){let g=this.getOrthogonalSash(e);g&&(i=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new Jp(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new Jp(t))),!this.state)return;let o=this.el.ownerDocument.getElementsByTagName("iframe");for(let g of o)g.classList.add(tU);let s=e.pageX,r=e.pageY,a=e.altKey,l={startX:s,currentX:s,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);let c=Xi(this.el),d=()=>{let g="";i?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=Be?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=Be?"col-resize":"ew-resize",c.textContent=`* { cursor: ${g} !important; }`},h=new ae;d(),i||this.onDidEnablementChange.event(d,null,h);let u=g=>{He.stop(g,!1);let m={startX:s,currentX:g.pageX,startY:r,currentY:g.pageY,altKey:a};this._onDidChange.fire(m)},f=g=>{He.stop(g,!1),this.el.removeChild(c),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose();for(let m of o)m.classList.remove(tU)};t.onPointerMove(u,null,h),t.onPointerUp(f,null,h),h.add(t)}onPointerDoublePress(e){let t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&n.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&n.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){n.onMouseLeave(this)}layout(){if(this.orientation===0){let e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{let e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){var t;let i=(t=e.initialTarget)!==null&&t!==void 0?t:e.target;if(!(!i||!(i instanceof HTMLElement))&&i.classList.contains("orthogonal-drag-handle"))return i.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}};wt();gn();ye();le();Cp();xi();var _Q={separatorBorder:Z.transparent},bE=class{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){var i,o;if(e!==this.visible){e?(this.size=Bn(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e);try{(o=(i=this.view).setVisible)===null||o===void 0||o.call(i,e)}catch(s){console.error("Splitview: Failed to set visible view"),console.error(s)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){var e;return(e=this.view.proportionalLayout)!==null&&e!==void 0?e:!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,o){this.container=e,this.view=t,this.disposable=o,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(i){console.error("Splitview: Failed to layout view"),console.error(i)}}dispose(){this.disposable.dispose()}},yP=class extends bE{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}},SP=class extends bE{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}},od;(function(n){n[n.Idle=0]="Idle",n[n.Busy=1]="Busy"})(od||(od={}));var iU;(function(n){n.Distribute={type:"distribute"};function e(o){return{type:"split",index:o}}n.Split=e;function t(o){return{type:"auto",index:o}}n.Auto=t;function i(o){return{type:"invisible",cachedVisibleSize:o}}n.Invisible=i})(iU||(iU={}));var vE=class extends H{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(let t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(let t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){var i,o,s,r,a;super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=od.Idle,this._onDidSashChange=this._register(new B),this._onDidSashReset=this._register(new B),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=(i=t.orientation)!==null&&i!==void 0?i:0,this.inverseAltBehavior=(o=t.inverseAltBehavior)!==null&&o!==void 0?o:!1,this.proportionalLayout=(s=t.proportionalLayout)!==null&&s!==void 0?s:!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=me(this.el,ve(".sash-container")),this.viewContainer=ve(".split-view-container"),this.scrollable=this._register(new gr({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:c=>rn(ge(this.el),c)})),this.scrollableElement=this._register(new Bl(this.viewContainer,{vertical:this.orientation===0?(r=t.scrollbarVisibility)!==null&&r!==void 0?r:1:2,horizontal:this.orientation===1?(a=t.scrollbarVisibility)!==null&&a!==void 0?a:1:2},this.scrollable));let l=this._register(new et(this.viewContainer,"scroll")).event;this._register(l(c=>{let d=this.scrollableElement.getScrollPosition(),h=Math.abs(this.viewContainer.scrollLeft-d.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,u=Math.abs(this.viewContainer.scrollTop-d.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(h!==void 0||u!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:h,scrollTop:u})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(c=>{c.scrollTopChanged&&(this.viewContainer.scrollTop=c.scrollTop),c.scrollLeftChanged&&(this.viewContainer.scrollLeft=c.scrollLeft)})),me(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||_Q),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((c,d)=>{let h=ds(c.visible)||c.visible?c.size:{type:"invisible",cachedVisibleSize:c.size},u=c.view;this.doAddView(u,h,d,!0)}),this._contentSize=this.viewItems.reduce((c,d)=>c+d.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,o){this.doAddView(e,t,i,o)}layout(e,t){let i=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let o=0;for(let s=0;s0&&(r.size=Bn(Math.round(a*e/o),r.minimumSize,r.maximumSize))}}else{let o=Un(this.viewItems.length),s=o.filter(a=>this.viewItems[a].priority===1),r=o.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-i,void 0,s,r)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout&&e.visible?e.size/this._contentSize:void 0))}onSashStart({sash:e,start:t,alt:i}){for(let a of this.viewItems)a.enabled=!1;let o=this.sashItems.findIndex(a=>a.sash===e),s=_o($(this.el.ownerDocument.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),$(this.el.ownerDocument.body,"keyup",()=>r(this.sashDragState.current,!1))),r=(a,l)=>{let c=this.viewItems.map(g=>g.size),d=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(o===this.sashItems.length-1){let m=this.viewItems[o];d=(m.minimumSize-m.size)/2,h=(m.maximumSize-m.size)/2}else{let m=this.viewItems[o+1];d=(m.size-m.maximumSize)/2,h=(m.size-m.minimumSize)/2}let u,f;if(!l){let g=Un(o,-1),m=Un(o+1,this.viewItems.length),C=g.reduce((M,W)=>M+(this.viewItems[W].minimumSize-c[W]),0),S=g.reduce((M,W)=>M+(this.viewItems[W].viewMaximumSize-c[W]),0),w=m.length===0?Number.POSITIVE_INFINITY:m.reduce((M,W)=>M+(c[W]-this.viewItems[W].minimumSize),0),y=m.length===0?Number.NEGATIVE_INFINITY:m.reduce((M,W)=>M+(c[W]-this.viewItems[W].viewMaximumSize),0),x=Math.max(C,y),k=Math.min(w,S),T=this.findFirstSnapIndex(g),N=this.findFirstSnapIndex(m);if(typeof T=="number"){let M=this.viewItems[T],W=Math.floor(M.viewMinimumSize/2);u={index:T,limitDelta:M.visible?x-W:x+W,size:M.size}}if(typeof N=="number"){let M=this.viewItems[N],W=Math.floor(M.viewMinimumSize/2);f={index:N,limitDelta:M.visible?k+W:k-W,size:M.size}}}this.sashDragState={start:a,current:a,index:o,sizes:c,minDelta:d,maxDelta:h,alt:l,snapBefore:u,snapAfter:f,disposable:s}};r(t,i)}onSashChange({current:e}){let{index:t,start:i,sizes:o,alt:s,minDelta:r,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;let d=e-i,h=this.resize(t,d,o,void 0,void 0,r,a,l,c);if(s){let u=t===this.sashItems.length-1,f=this.viewItems.map(y=>y.size),g=u?t:t+1,m=this.viewItems[g],C=m.size-m.maximumSize,S=m.size-m.minimumSize,w=u?t-1:t+1;this.resize(w,-h,f,void 0,void 0,C,S)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(let t of this.viewItems)t.enabled=!0}onViewChange(e,t){let i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=Bn(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(!(e<0||e>=this.viewItems.length)){if(this.state!==od.Idle)throw new Error("Cant modify splitview");this.state=od.Busy;try{let i=Un(this.viewItems.length).filter(a=>a!==e),o=[...i.filter(a=>this.viewItems[a].priority===1),e],s=i.filter(a=>this.viewItems[a].priority===2),r=this.viewItems[e];t=Math.round(t),t=Bn(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(o,s)}finally{this.state=od.Idle}}}distributeViewSizes(){let e=[],t=0;for(let a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);let i=Math.floor(t/e.length);for(let a of e)a.size=Bn(i,a.minimumSize,a.maximumSize);let o=Un(this.viewItems.length),s=o.filter(a=>this.viewItems[a].priority===1),r=o.filter(a=>this.viewItems[a].priority===2);this.relayout(s,r)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,o){if(this.state!==od.Idle)throw new Error("Cant modify splitview");this.state=od.Busy;try{let s=ve(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(s):this.viewContainer.insertBefore(s,this.viewContainer.children.item(i));let r=e.onDidChange(u=>this.onViewChange(d,u)),a=be(()=>this.viewContainer.removeChild(s)),l=_o(r,a),c;typeof t=="number"?c=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?c=this.getViewSize(t.index)/2:t.type==="invisible"?c={cachedVisibleSize:t.cachedVisibleSize}:c=e.minimumSize);let d=this.orientation===0?new yP(s,e,c,l):new SP(s,e,c,l);if(this.viewItems.splice(i,0,d),this.viewItems.length>1){let u={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===0?new $f(this.sashContainer,{getHorizontalSashTop:M=>this.getSashPosition(M),getHorizontalSashWidth:this.getSashOrthogonalSize},{...u,orientation:1}):new $f(this.sashContainer,{getVerticalSashLeft:M=>this.getSashPosition(M),getVerticalSashHeight:this.getSashOrthogonalSize},{...u,orientation:0}),g=this.orientation===0?M=>({sash:f,start:M.startY,current:M.currentY,alt:M.altKey}):M=>({sash:f,start:M.startX,current:M.currentX,alt:M.altKey}),C=ie.map(f.onDidStart,g)(this.onSashStart,this),w=ie.map(f.onDidChange,g)(this.onSashChange,this),x=ie.map(f.onDidEnd,()=>this.sashItems.findIndex(M=>M.sash===f))(this.onSashEnd,this),k=f.onDidReset(()=>{let M=this.sashItems.findIndex(z=>z.sash===f),W=Un(M,-1),j=Un(M+1,this.viewItems.length),G=this.findFirstSnapIndex(W),V=this.findFirstSnapIndex(j);typeof G=="number"&&!this.viewItems[G].visible||typeof V=="number"&&!this.viewItems[V].visible||this._onDidSashReset.fire(M)}),T=_o(C,w,x,k,f),N={sash:f,disposable:T};this.sashItems.splice(i-1,0,N)}s.appendChild(e.element);let h;typeof t!="number"&&t.type==="split"&&(h=[t.index]),o||this.relayout([i],h),!o&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}finally{this.state=od.Idle}}relayout(e,t){let i=this.viewItems.reduce((o,s)=>o+s.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(d=>d.size),o,s,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;let d=Un(e,-1),h=Un(e+1,this.viewItems.length);if(s)for(let N of s)q1(d,N),q1(h,N);if(o)for(let N of o)x_(d,N),x_(h,N);let u=d.map(N=>this.viewItems[N]),f=d.map(N=>i[N]),g=h.map(N=>this.viewItems[N]),m=h.map(N=>i[N]),C=d.reduce((N,M)=>N+(this.viewItems[M].minimumSize-i[M]),0),S=d.reduce((N,M)=>N+(this.viewItems[M].maximumSize-i[M]),0),w=h.length===0?Number.POSITIVE_INFINITY:h.reduce((N,M)=>N+(i[M]-this.viewItems[M].minimumSize),0),y=h.length===0?Number.NEGATIVE_INFINITY:h.reduce((N,M)=>N+(i[M]-this.viewItems[M].maximumSize),0),x=Math.max(C,y,r),k=Math.min(w,S,a),T=!1;if(l){let N=this.viewItems[l.index],M=t>=l.limitDelta;T=M!==N.visible,N.setVisible(M,l.size)}if(!T&&c){let N=this.viewItems[c.index],M=ta+l.size,0),i=this.size-t,o=Un(this.viewItems.length-1,-1),s=o.filter(a=>this.viewItems[a].priority===1),r=o.filter(a=>this.viewItems[a].priority===2);for(let a of r)q1(o,a);for(let a of s)x_(o,a);typeof e=="number"&&x_(o,e);for(let a=0;i!==0&&at+i.size,0);let e=0;for(let t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===0?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this._contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this._contentSize})}updateSashEnablement(){let e=!1,t=this.viewItems.map(l=>e=l.size-l.minimumSize>0||e);e=!1;let i=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),o=[...this.viewItems].reverse();e=!1;let s=o.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;let r=o.map(l=>e=l.maximumSize-l.size>0||e).reverse(),a=0;for(let l=0;l0||this.startSnappingEnabled)?c.state=1:w&&t[l]&&(a0)return;if(!i.visible&&i.snap)return t}}areViewsDistributed(){let e,t;for(let i of this.viewItems)if(e=e===void 0?i.size:Math.min(e,i.size),t=t===void 0?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)===null||e===void 0||e.disposable.dispose(),li(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}};ye();le();var i1=class n{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=n.TemplateId,this.renderedTemplates=new Set;let o=new Map(t.map(s=>[s.templateId,s]));this.renderers=[];for(let s of e){let r=o.get(s.templateId);if(!r)throw new Error(`Table cell renderer for template id ${s.templateId} not found.`);this.renderers.push(r)}}renderTemplate(e){let t=me(e,ve(".monaco-table-tr")),i=[],o=[];for(let r=0;rthis.disposables.add(new xP(d,h))),l={size:a.reduce((d,h)=>d+h.column.weight,0),views:a.map(d=>({size:d.column.weight,view:d}))};this.splitview=this.disposables.add(new vE(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;let c=new i1(o,s,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new Do(e,this.domNode,bQ(i),[c],r)),ie.any(...a.map(d=>d.onDidLayout))(([d,h])=>c.layoutColumn(d,h),null,this.disposables),this.splitview.onDidSashReset(d=>{let h=o.reduce((f,g)=>f+g.weight,0),u=o[d].weight/h*this.cachedWidth;this.splitview.resizeView(d,u)},null,this.disposables),this.styleElement=Xi(this.domNode),this.style(TH)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){let t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { + top: ${this.virtualDelegate.headerRowHeight+1}px; + height: calc(100% - ${this.virtualDelegate.headerRowHeight}px); + }`),this.styleElement.textContent=t.join(` +`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}};n1.InstanceCount=0;_();v();b();ke();oo();_();v();b();ke();_();v();b();$n();Ge();var vQ=p("caseDescription","Match Case"),CQ=p("wordsDescription","Match Whole Word"),wQ=p("regexDescription","Use Regular Expression"),CE=class extends nd{constructor(e){var t;super({icon:ue.caseSensitive,title:vQ+e.appendTitle,isChecked:e.isChecked,hoverDelegate:(t=e.hoverDelegate)!==null&&t!==void 0?t:ji("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}},wE=class extends nd{constructor(e){var t;super({icon:ue.wholeWord,title:CQ+e.appendTitle,isChecked:e.isChecked,hoverDelegate:(t=e.hoverDelegate)!==null&&t!==void 0?t:ji("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}},yE=class extends nd{constructor(e){var t;super({icon:ue.regex,title:wQ+e.appendTitle,isChecked:e.isChecked,hoverDelegate:(t=e.hoverDelegate)!==null&&t!==void 0?t:ji("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}};_();v();b();ke();ye();_();v();b();_();v();b();var SE=class{constructor(e,t=0,i=e.length,o=t-1){this.items=e,this.start=t,this.end=i,this.index=o}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}};var xE=class{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();let e=this._elements;this._navigator=new SE(e,0,e.length,e.length)}_reduceToLimit(){let e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){let e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(let t of e)this._history.add(t)}get _elements(){let e=[];return this._history.forEach(t=>e.push(t)),e}};hs();Ge();var o1=ve;var LP=class extends co{constructor(e,t,i){var o;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new B),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(o=this.options.tooltip)!==null&&o!==void 0?o:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=me(e,o1(".monaco-inputbox.idle"));let s=this.options.flexibleHeight?"textarea":"input",r=me(this.element,o1(".ibwrapper"));if(this.input=me(r,o1(s+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=me(r,o1("div.mirror")),this.mirror.innerText="\xA0",this.scrollableElement=new ix(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),me(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));let a=this._register(new et(e.ownerDocument,"selectionchange")),l=ie.filter(a.event,()=>{let c=e.ownerDocument.getSelection();return c?.anchorNode===r});this._register(l(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new Eo(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.hover?this.hover.update(e):this.hover=this._register(Qn().setupUpdatableHover(ji("mouse"),this.input,e))}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:p0(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return _0(this.input)}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}getSelection(){var e;let t=this.input.selectionStart;if(t===null)return null;let i=(e=this.input.selectionEnd)!==null&&e!==void 0?e:t;return{start:t,end:i}}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;let e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){if(this.state==="open"&&hn(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));let i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${tr(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e?.type}stylesForType(e){let t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e,t=()=>e.style.width=Vg(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:o=>{var s,r;if(!this.message)return null;e=me(o,o1(".monaco-inputbox-container")),t();let a={inline:!0,className:"monaco-inputbox-message"},l=this.message.formatContent?aV(this.message.content,a):rV(this.message.content,a);l.classList.add(this.classForType(this.message.type));let c=this.stylesForType(this.message.type);return l.style.backgroundColor=(s=c.background)!==null&&s!==void 0?s:"",l.style.color=(r=c.foreground)!==null&&r!==void 0?r:"",l.style.border=c.border?`1px solid ${c.border}`:"",me(e,l),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===3?i=p("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?i=p("alertWarningMessage","Warning: {0}",this.message.content):i=p("alertInfoMessage","Info: {0}",this.message.content),ob(i),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;let e=this.value,i=e.charCodeAt(e.length-1)===10?" ":"";(e+i).replace(/\u000c/g,"")?this.mirror.textContent=e+i:this.mirror.innerText="\xA0",this.layout()}applyStyles(){var e,t,i;let o=this.options.inputBoxStyles,s=(e=o.inputBackground)!==null&&e!==void 0?e:"",r=(t=o.inputForeground)!==null&&t!==void 0?t:"",a=(i=o.inputBorder)!==null&&i!==void 0?i:"";this.element.style.backgroundColor=s,this.element.style.color=r,this.input.style.backgroundColor="inherit",this.input.style.color=r,this.element.style.border=`1px solid ${tr(a,"transparent")}`}layout(){if(!this.mirror)return;let e=this.cachedContentHeight;this.cachedContentHeight=p0(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){let t=this.inputElement,i=t.selectionStart,o=t.selectionEnd,s=t.value;i!==null&&o!==null&&(this.value=s.substr(0,i)+e+s.substr(o),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)===null||e===void 0||e.dispose(),super.dispose()}},LE=class extends LP{constructor(e,t,i){let o=p({key:"history.inputbox.hint.suffix.noparens",comment:['Text is the suffix of an input field placeholder coming after the action the input field performs, this will be used when the input field ends in a closing parenthesis ")", for example "Filter (e.g. text, !exclude)". The character inserted into the final string is \u21C5 to represent the up and down arrow keys.']}," or {0} for history","\u21C5"),s=p({key:"history.inputbox.hint.suffix.inparens",comment:['Text is the suffix of an input field placeholder coming after the action the input field performs, this will be used when the input field does NOT end in a closing parenthesis (eg. "Find"). The character inserted into the final string is \u21C5 to represent the up and down arrow keys.']}," ({0} for history)","\u21C5");super(e,t,i),this._onDidFocus=this._register(new B),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new B),this.onDidBlur=this._onDidBlur.event,this.history=new xE(i.history,100);let r=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(o)&&!this.placeholder.endsWith(s)&&this.history.getHistory().length){let a=this.placeholder.endsWith(")")?o:s,l=this.placeholder+a;i.showPlaceholderOnFocus&&!_0(this.input)?this.placeholder=l:this.setPlaceHolder(l)}};this.observer=new MutationObserver((a,l)=>{a.forEach(c=>{c.target.textContent||r()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>r()),this.onblur(this.input,()=>{let a=l=>{if(this.placeholder.endsWith(l)){let c=this.placeholder.slice(0,this.placeholder.length-l.length);return i.showPlaceholderOnFocus?this.placeholder=c:this.setPlaceHolder(c),!0}else return!1};a(s)||a(o)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",Uu(this.value?this.value:p("clearedInput","Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Uu(this.value))}setPlaceHolder(e){super.setPlaceHolder(e),this.setTooltip(e)}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}};ye();Ge();le();var yQ=p("defaultLabel","input"),s1=class extends co{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new no),this.additionalToggles=[],this._onDidOptionChange=this._register(new B),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new B),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new B),this._onKeyUp=this._register(new B),this._onCaseSensitiveKeyDown=this._register(new B),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new B),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||yQ,this.showCommonFindToggles=!!i.showCommonFindToggles;let o=i.appendCaseSensitiveLabel||"",s=i.appendWholeWordsLabel||"",r=i.appendRegexLabel||"",a=i.history||[],l=!!i.flexibleHeight,c=!!i.flexibleWidth,d=i.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new LE(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:i.showHistoryHint,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:d,inputBoxStyles:i.inputBoxStyles}));let h=this._register(Mf());if(this.showCommonFindToggles){this.regex=this._register(new yE({appendTitle:r,isChecked:!1,hoverDelegate:h,...i.toggleStyles})),this._register(this.regex.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(f=>{this._onRegexKeyDown.fire(f)})),this.wholeWords=this._register(new wE({appendTitle:s,isChecked:!1,hoverDelegate:h,...i.toggleStyles})),this._register(this.wholeWords.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new CE({appendTitle:o,isChecked:!1,hoverDelegate:h,...i.toggleStyles})),this._register(this.caseSensitive.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(f=>{this._onCaseSensitiveKeyDown.fire(f)}));let u=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,f=>{if(f.equals(15)||f.equals(17)||f.equals(9)){let g=u.indexOf(this.domNode.ownerDocument.activeElement);if(g>=0){let m=-1;f.equals(17)?m=(g+1)%u.length:f.equals(15)&&(g===0?m=u.length-1:m=g-1),f.equals(9)?(u[g].blur(),this.inputBox.focus()):m>=0&&u[m].focus(),He.stop(f,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(i?.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e?.appendChild(this.domNode),this._register($(this.inputBox.inputElement,"compositionstart",u=>{this.imeSessionInProgress=!0})),this._register($(this.inputBox.inputElement,"compositionend",u=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,u=>this._onKeyDown.fire(u)),this.onkeyup(this.inputBox.inputElement,u=>this._onKeyUp.fire(u)),this.oninput(this.inputBox.inputElement,u=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,u=>this._onMouseDown.fire(u))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,i;this.domNode.classList.remove("disabled"),this.inputBox.enable(),(e=this.regex)===null||e===void 0||e.enable(),(t=this.wholeWords)===null||t===void 0||t.enable(),(i=this.caseSensitive)===null||i===void 0||i.enable();for(let o of this.additionalToggles)o.enable()}disable(){var e,t,i;this.domNode.classList.add("disabled"),this.inputBox.disable(),(e=this.regex)===null||e===void 0||e.disable(),(t=this.wholeWords)===null||t===void 0||t.disable(),(i=this.caseSensitive)===null||i===void 0||i.disable();for(let o of this.additionalToggles)o.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(let t of this.additionalToggles)t.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new ae;for(let t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(i=>{this._onDidOptionChange.fire(i),!i&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,i,o,s,r,a;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=((i=(t=this.caseSensitive)===null||t===void 0?void 0:t.width())!==null&&i!==void 0?i:0)+((s=(o=this.wholeWords)===null||o===void 0?void 0:o.width())!==null&&s!==void 0?s:0)+((a=(r=this.regex)===null||r===void 0?void 0:r.width())!==null&&a!==void 0?a:0)+this.additionalToggles.reduce((l,c)=>l+c.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,t;return(t=(e=this.caseSensitive)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return(t=(e=this.wholeWords)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return(t=(e=this.regex)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)===null||e===void 0||e.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}};_();v();b();_();v();b();var as;(function(n){n[n.Expanded=0]="Expanded",n[n.Collapsed=1]="Collapsed",n[n.PreserveOrExpanded=2]="PreserveOrExpanded",n[n.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(as||(as={}));var zh;(function(n){n[n.Unknown=0]="Unknown",n[n.Twistie=1]="Twistie",n[n.Element=2]="Element",n[n.Filter=3]="Filter"})(zh||(zh={}));var eo=class extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}},qf=class{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}};wt();Gt();AT();ye();js();function r1(n){return typeof n=="object"&&"visibility"in n&&"data"in n}function jf(n){switch(n){case!0:return 1;case!1:return 0;default:return n}}function kP(n){return typeof n.collapsible=="boolean"}var kE=class{constructor(e,t,i,o={}){var s;this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new kd,this._onDidChangeCollapseState=new B,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new B,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new B,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new ka(Ew),this.collapseByDefault=typeof o.collapseByDefault>"u"?!1:o.collapseByDefault,this.allowNonCollapsibleParents=(s=o.allowNonCollapsibleParents)!==null&&s!==void 0?s:!1,this.filter=o.filter,this.autoExpandSingleChildren=typeof o.autoExpandSingleChildren>"u"?!1:o.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=ht.empty(),o={}){if(e.length===0)throw new eo(this.user,"Invalid tree location");o.diffIdentityProvider?this.spliceSmart(o.diffIdentityProvider,e,t,i,o):this.spliceSimple(e,t,i,o)}spliceSmart(e,t,i,o,s,r){var a;o===void 0&&(o=ht.empty()),r===void 0&&(r=(a=s.diffDepth)!==null&&a!==void 0?a:0);let{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,i,o,s);let c=[...o],d=t[t.length-1],h=new Eu({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,d),...c,...l.children.slice(d+i)].map(C=>e.getId(C.element).toString())}).ComputeDiff(!1);if(h.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,i,c,s);let u=t.slice(0,-1),f=(C,S,w)=>{if(r>0)for(let y=0;yw.originalStart-S.originalStart))f(g,m,g-(C.originalStart+C.originalLength)),g=C.originalStart,m=C.modifiedStart-d,this.spliceSimple([...u,g],C.originalLength,ht.slice(c,m,m+C.modifiedLength),s);f(g,m,g)}spliceSimple(e,t,i=ht.empty(),{onDidCreateNode:o,onDidDeleteNode:s,diffIdentityProvider:r}){let{parentNode:a,listIndex:l,revealed:c,visible:d}=this.getParentNodeWithListIndex(e),h=[],u=ht.map(i,k=>this.createTreeNode(k,a,a.visible?1:0,c,h,o)),f=e[e.length-1],g=0;for(let k=f;k>=0&&kr.getId(k.element).toString())):a.lastDiffIds=a.children.map(k=>r.getId(k.element).toString()):a.lastDiffIds=void 0;let y=0;for(let k of w)k.visible&&y++;if(y!==0)for(let k=f+m.length;kT+(N.visible?N.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,S-k),this.list.splice(l,k,h)}if(w.length>0&&s){let k=T=>{s(T),T.children.forEach(k)};w.forEach(k)}this._onDidSplice.fire({insertedNodes:m,deletedNodes:w});let x=a;for(;x;){if(x.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}x=x.parent}}rerender(e){if(e.length===0)throw new eo(this.user,"Invalid tree location");let{node:t,listIndex:i,revealed:o}=this.getTreeNodeWithListIndex(e);t.visible&&o&&this.list.splice(i,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){let{listIndex:t,visible:i,revealed:o}=this.getTreeNodeWithListIndex(e);return i&&o?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){let i=this.getTreeNode(e);typeof t>"u"&&(t=!i.collapsible);let o={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){let o=this.getTreeNode(e);typeof t>"u"&&(t=!o.collapsed);let s={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,s))}_setCollapseState(e,t){let{node:i,listIndex:o,revealed:s}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(i,o,s,t);if(i!==this.root&&this.autoExpandSingleChildren&&r&&!kP(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let a=-1;for(let l=0;l-1){a=-1;break}else a=l;a>-1&&this._setCollapseState([...e,a],t)}return r}_setListNodeCollapseState(e,t,i,o){let s=this._setNodeCollapseState(e,o,!1);if(!i||!e.visible||!s)return s;let r=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=r-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),s}_setNodeCollapseState(e,t,i){let o;if(e===this.root?o=!1:(kP(t)?(o=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(o=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):o=!1,o&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!kP(t)&&t.recursive)for(let s of e.children)o=this._setNodeCollapseState(s,t,!0)||o;return o}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){let e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t),this.refilterDelayer.cancel()}createTreeNode(e,t,i,o,s,r){let a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,i);a.visibility=l,o&&s.push(a);let c=e.children||ht.empty(),d=o&&l!==0&&!a.collapsed,h=0,u=1;for(let f of c){let g=this.createTreeNode(f,a,l,d,s,r);a.children.push(g),u+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=h++)}return this.allowNonCollapsibleParents||(a.collapsible=a.collapsible||a.children.length>0),a.visibleChildrenCount=h,a.visible=l===2?h>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=u):(a.renderNodeCount=0,o&&s.pop()),r?.(a),a}updateNodeAfterCollapseChange(e){let t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(let i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){let t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,o=!0){let s;if(e!==this.root){if(s=this._filterNode(e,t),s===0)return e.visible=!1,e.renderNodeCount=0,!1;o&&i.push(e)}let r=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||s!==0){let l=0;for(let c of e.children)a=this._updateNodeAfterFilterChange(c,s,i,o&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=s===2?a:s===1,e.visibility=s),e.visible?e.collapsed||(e.renderNodeCount+=i.length-r):(e.renderNodeCount=0,o&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){let i=this.filter?this.filter.filter(e.element,t):1;return typeof i=="boolean"?(e.filterData=void 0,i?1:0):r1(i)?(e.filterData=i.data,jf(i.visibility)):(e.filterData=void 0,jf(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;let[i,...o]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(o,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;let[i,...o]=e;if(i<0||i>t.children.length)throw new eo(this.user,"Invalid tree location");return this.getTreeNode(o,t.children[i])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};let{parentNode:t,listIndex:i,revealed:o,visible:s}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new eo(this.user,"Invalid tree location");let a=t.children[r];return{node:a,listIndex:i,revealed:o,visible:s&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,o=!0,s=!0){let[r,...a]=e;if(r<0||r>t.children.length)throw new eo(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}};function DP(n){return n instanceof Jc?new EP(n):n}var IP=class{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=H.None,this.disposables=new ae}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){var i,o;(o=(i=this.dnd).onDragStart)===null||o===void 0||o.call(i,DP(e),t)}onDragOver(e,t,i,o,s,r=!0){let a=this.dnd.onDragOver(DP(e),t&&t.element,i,o,s),l=this.autoExpandNode!==t;if(l&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return a;if(l&&typeof a!="boolean"&&a.autoExpand&&(this.autoExpandDisposable=s0(()=>{let f=this.modelProvider(),g=f.getNodeLocation(t);f.isCollapsed(g)&&f.setCollapsed(g,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof a=="boolean"||!a.accept||typeof a.bubble>"u"||a.feedback){if(!r){let f=typeof a=="boolean"?a:a.accept,g=typeof a=="boolean"?void 0:a.effect;return{accept:f,effect:g,feedback:[i]}}return a}if(a.bubble===1){let f=this.modelProvider(),g=f.getNodeLocation(t),m=f.getParentNodeLocation(g),C=f.getNode(m),S=m&&f.getListIndex(m);return this.onDragOver(e,C,S,o,s,!1)}let c=this.modelProvider(),d=c.getNodeLocation(t),h=c.getListIndex(d),u=c.getListRenderCount(d);return{...a,feedback:Un(h,h+u)}}drop(e,t,i,o,s){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(DP(e),t&&t.element,i,o,s)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}};function SQ(n,e){return e&&{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new IP(n,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent({...t,element:t.element})},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent({...t,element:t.element})}},accessibilityProvider:e.accessibilityProvider&&{...e.accessibilityProvider,getSetSize(t){let i=n(),o=i.getNodeLocation(t),s=i.getParentNodeLocation(o);return i.getNode(s).visibleChildrenCount},getPosInSet(t){return t.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?t=>e.accessibilityProvider.isChecked(t.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?t=>e.accessibilityProvider.getAriaLevel(t.element):t=>t.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}}}}var t_=class{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){var i,o;(o=(i=this.delegate).setDynamicHeight)===null||o===void 0||o.call(i,e.element,t)}},Gf;(function(n){n.None="none",n.OnHover="onHover",n.Always="always"})(Gf||(Gf={}));var TP=class{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new ae,this.onDidChange=ie.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}},IE=class n{constructor(e,t,i,o,s,r={}){var a;this.renderer=e,this.modelProvider=t,this.activeNodes=o,this.renderedIndentGuides=s,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=n.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=H.None,this.disposables=new ae,this.templateId=e.templateId,this.updateOptions(r),ie.map(i,l=>l.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(a=e.onDidChangeTwistieState)===null||a===void 0||a.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){let t=Bn(e.indent,0,40);if(t!==this.indent){this.indent=t;for(let[i,o]of this.renderedNodes)this.renderTreeElement(i,o)}}if(typeof e.renderIndentGuides<"u"){let t=e.renderIndentGuides!==Gf.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(let[i,o]of this.renderedNodes)this._renderIndentGuides(i,o);if(this.indentGuidesDisposable.dispose(),t){let i=new ae;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,i),this.indentGuidesDisposable=i,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){let t=me(e,ve(".monaco-tl-row")),i=me(t,ve(".monaco-tl-indent")),o=me(t,ve(".monaco-tl-twistie")),s=me(t,ve(".monaco-tl-contents")),r=this.renderer.renderTemplate(s);return{container:e,indent:i,twistie:o,indentGuidesDisposable:H.None,templateData:r}}renderElement(e,t,i,o){this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,o)}disposeElement(e,t,i,o){var s,r;i.indentGuidesDisposable.dispose(),(r=(s=this.renderer).disposeElement)===null||r===void 0||r.call(s,e,t,i.templateData,o),typeof o=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){let t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){let t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){let i=n.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${i}px`,t.indent.style.width=`${i+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...Xe.asClassNameArray(ue.treeItemExpanded));let o=!1;this.renderer.renderTwistie&&(o=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(o||t.twistie.classList.add(...Xe.asClassNameArray(ue.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(Co(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;let i=new ae,o=this.modelProvider();for(;;){let s=o.getNodeLocation(e),r=o.getParentNodeLocation(s);if(!r)break;let a=o.getNode(r),l=ve(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&l.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(l):t.indent.insertBefore(l,t.indent.firstElementChild),this.renderedIndentGuides.add(a,l),i.add(be(()=>this.renderedIndentGuides.delete(a,l))),e=a}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;let t=new Set,i=this.modelProvider();e.forEach(o=>{let s=i.getNodeLocation(o);try{let r=i.getParentNodeLocation(s);o.collapsible&&o.children.length>0&&!o.collapsed?t.add(o):r&&t.add(i.getNode(r))}catch{}}),this.activeIndentNodes.forEach(o=>{t.has(o)||this.renderedIndentGuides.forEach(o,s=>s.classList.remove("active"))}),t.forEach(o=>{this.activeIndentNodes.has(o)||this.renderedIndentGuides.forEach(o,s=>s.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),li(this.disposables)}};IE.DefaultIndent=8;var NP=class{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new ae,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let i=1;if(this._filter){let r=this._filter.filter(e,t);if(typeof r=="boolean"?i=r?1:0:r1(r)?i=jf(r.visibility):i=r,i===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:Tf.Default,visibility:i};let o=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),s=Array.isArray(o)?o:[o];for(let r of s){let a=r&&r.toString();if(typeof a>"u")return{data:Tf.Default,visibility:i};let l;if(this.tree.findMatchType===Vh.Contiguous){let c=a.toLowerCase().indexOf(this._lowercasePattern);if(c>-1){l=[Number.MAX_SAFE_INTEGER,0];for(let d=this._lowercasePattern.length;d>0;d--)l.push(c+d-1)}}else l=yp(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(l)return this._matchCount++,s.length===1?{data:l,visibility:i}:{data:{label:a,score:l},visibility:i}}return this.tree.findMode===ac.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:Tf.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){li(this.disposables)}};var ac;(function(n){n[n.Highlight=0]="Highlight",n[n.Filter=1]="Filter"})(ac||(ac={}));var Vh;(function(n){n[n.Fuzzy=0]="Fuzzy",n[n.Contiguous=1]="Contiguous"})(Vh||(Vh={}));var AP=class{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,o,s,r={}){var a,l;this.tree=e,this.view=i,this.filter=o,this.contextViewProvider=s,this.options=r,this._pattern="",this.width=0,this._onDidChangeMode=new B,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new B,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new B,this._onDidChangeOpenState=new B,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new ae,this.disposables=new ae,this._mode=(a=e.options.defaultFindMode)!==null&&a!==void 0?a:ac.Highlight,this._matchType=(l=e.options.defaultFindMatchType)!==null&&l!==void 0?l:Vh.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){var e,t,i,o;let s=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&s?!((e=this.tree.options.showNotFoundMessage)!==null&&e!==void 0)||e?(t=this.widget)===null||t===void 0||t.showMessage({type:2,content:p("not found","No elements found.")}):(i=this.widget)===null||i===void 0||i.showMessage({type:2}):(o=this.widget)===null||o===void 0||o.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!Tf.isDefault(e.filterData)}layout(e){var t;this.width=e,(t=this.widget)===null||t===void 0||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}};function xQ(n,e){return n.position===e.position&&nU(n,e)}function nU(n,e){return n.node.element===e.node.element&&n.startIndex===e.startIndex&&n.height===e.height&&n.endIndex===e.endIndex}var MP=class{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return Ht(this.stickyNodes,e.stickyNodes,xQ)}lastNodePartiallyVisible(){if(this.count===0)return!1;let e=this.stickyNodes[this.count-1];if(this.count===1)return e.position!==0;let t=this.stickyNodes[this.count-2];return t.position+t.height!==e.position}animationStateChanged(e){if(!Ht(this.stickyNodes,e.stickyNodes,nU)||this.count===0)return!1;let t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}},RP=class{constrainStickyScrollNodes(e,t,i){for(let o=0;oi||o>=t)return e.slice(0,o)}return e}},TE=class extends H{constructor(e,t,i,o,s,r={}){var a;super(),this.tree=e,this.model=t,this.view=i,this.treeDelegate=s,this.maxWidgetViewRatio=.4;let l=this.validateStickySettings(r);this.stickyScrollMaxItemCount=l.stickyScrollMaxItemCount,this.stickyScrollDelegate=(a=r.stickyScrollDelegate)!==null&&a!==void 0?a:new RP,this._widget=this._register(new PP(i.getScrollableElement(),i,e,o,s,r.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(i.onDidScroll(()=>this.update())),this._register(i.onDidChangeContentHeight(()=>this.update())),this._register(e.onDidChangeCollapseState(()=>this.update())),this.update()}get height(){return this._widget.height}getNodeAtHeight(e){let t;if(e===0?t=this.view.firstVisibleIndex:t=this.view.indexAt(e+this.view.scrollTop),!(t<0||t>=this.view.length))return this.view.element(t)}update(){let e=this.getNodeAtHeight(0);if(!e||this.tree.scrollTop===0){this._widget.setState(void 0);return}let t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){let t=[],i=e,o=0,s=this.getNextStickyNode(i,void 0,o);for(;s&&(t.push(s),o+=s.height,!(t.length<=this.stickyScrollMaxItemCount&&(i=this.getNextVisibleNode(s),!i)));)s=this.getNextStickyNode(i,s.node,o);let r=this.constrainStickyNodes(t);return r.length?new MP(r):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,i){let o=this.getAncestorUnderPrevious(e,t);if(o&&!(o===e&&(!this.nodeIsUncollapsedParent(e)||this.nodeTopAlignsWithStickyNodesBottom(e,i))))return this.createStickyScrollNode(o,i)}nodeTopAlignsWithStickyNodesBottom(e,t){let i=this.getNodeIndex(e),o=this.view.getElementTop(i),s=t;return this.view.scrollTop===o-s}createStickyScrollNode(e,t){let i=this.treeDelegate.getHeight(e),{startIndex:o,endIndex:s}=this.getNodeRange(e),r=this.calculateStickyNodePosition(s,t,i);return{node:e,position:r,height:i,startIndex:o,endIndex:s}}getAncestorUnderPrevious(e,t=void 0){let i=e,o=this.getParentNode(i);for(;o;){if(o===t)return i;i=o,o=this.getParentNode(i)}if(t===void 0)return i}calculateStickyNodePosition(e,t,i){let o=this.view.getRelativeTop(e);if(o===null&&this.view.firstVisibleIndex===e&&e+1l&&t<=l?l-i:t}constrainStickyNodes(e){if(e.length===0)return[];let t=this.view.renderHeight*this.maxWidgetViewRatio,i=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&i.position+i.height<=t)return e;let o=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!o.length)return[];let s=o[o.length-1];if(o.length>this.stickyScrollMaxItemCount||s.position+s.height>t)throw new Error("stickyScrollDelegate violates constraints");return o}getParentNode(e){let t=this.model.getNodeLocation(e),i=this.model.getParentNodeLocation(t);return i?this.model.getNode(i):void 0}nodeIsUncollapsedParent(e){let t=this.model.getNodeLocation(e);return this.model.getListRenderCount(t)>1}getNodeIndex(e){let t=this.model.getNodeLocation(e);return this.model.getListIndex(t)}getNodeRange(e){let t=this.model.getNodeLocation(e),i=this.model.getListIndex(t);if(i<0)throw new Error("Node not found in tree");let o=this.model.getListRenderCount(t),s=i+o-1;return{startIndex:i,endIndex:s}}nodePositionTopBelowWidget(e){let t=[],i=this.getParentNode(e);for(;i;)t.push(i),i=this.getParentNode(i);let o=0;for(let s=0;s0,i=!!e&&e.count>0;if(!t&&!i||t&&i&&this._previousState.equal(e))return;if(t!==i&&this.setVisible(i),!i){this._previousState=void 0,this._previousElements=[],this._previousStateDisposables.clear();return}let o=e.stickyNodes[e.count-1];if(this._previousState&&e.animationStateChanged(this._previousState))this._previousElements[this._previousState.count-1].style.top=`${o.position}px`;else{this._previousStateDisposables.clear();let s=Array(e.count);for(let r=e.count-1;r>=0;r--){let a=e.stickyNodes[r],{element:l,disposable:c}=this.createElement(a,r,e.count);s[r]=l,this._rootDomNode.appendChild(l),this._previousStateDisposables.add(c)}this.stickyScrollFocus.updateElements(s,e),this._previousElements=s}this._previousState=e,this._rootDomNode.style.height=`${o.position+o.height}px`}createElement(e,t,i){let o=e.startIndex,s=document.createElement("div");s.style.top=`${e.position}px`,this.tree.options.setRowHeight!==!1&&(s.style.height=`${e.height}px`),this.tree.options.setRowLineHeight!==!1&&(s.style.lineHeight=`${e.height}px`),s.classList.add("monaco-tree-sticky-row"),s.classList.add("monaco-list-row"),s.setAttribute("data-index",`${o}`),s.setAttribute("data-parity",o%2===0?"even":"odd"),s.setAttribute("id",this.view.getElementID(o));let r=this.setAccessibilityAttributes(s,e.node.element,t,i),a=this.treeDelegate.getTemplateId(e.node),l=this.treeRenderers.find(u=>u.templateId===a);if(!l)throw new Error(`No renderer found for template id ${a}`);let c=e.node;c===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(c=new Proxy(e.node,{}));let d=l.renderTemplate(s);l.renderElement(c,e.startIndex,d,e.height);let h=be(()=>{r.dispose(),l.disposeElement(c,e.startIndex,d,e.height),l.disposeTemplate(d),s.remove()});return{element:s,disposable:h}}setAccessibilityAttributes(e,t,i,o){var s;if(!this.accessibilityProvider)return H.None;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,i,o))),this.accessibilityProvider.getPosInSet&&e.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t,i))),this.accessibilityProvider.getRole&&e.setAttribute("role",(s=this.accessibilityProvider.getRole(t))!==null&&s!==void 0?s:"treeitem");let r=this.accessibilityProvider.getAriaLabel(t),a=r&&typeof r!="string"?r:Rh(r),l=pt(d=>{let h=d.readObservable(a);h?e.setAttribute("aria-label",h):e.removeAttribute("aria-label")});typeof r=="string"||r&&e.setAttribute("aria-label",r.get());let c=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);return typeof c=="number"&&e.setAttribute("aria-level",`${c}`),e.setAttribute("aria-selected",String(!1)),l}setVisible(e){this._rootDomNode.classList.toggle("empty",!e),e||this.stickyScrollFocus.updateElements([],void 0)}domFocus(){this.stickyScrollFocus.domFocus()}focusedLast(){return this.stickyScrollFocus.focusedLast()}dispose(){this.stickyScrollFocus.dispose(),this._previousStateDisposables.dispose(),this._rootDomNode.remove()}},OP=class extends H{get domHasFocus(){return this._domHasFocus}set domHasFocus(e){e!==this._domHasFocus&&(this._onDidChangeHasFocus.fire(e),this._domHasFocus=e)}constructor(e,t){super(),this.container=e,this.view=t,this.focusedIndex=-1,this.elements=[],this._onDidChangeHasFocus=new B,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new B,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this.container.addEventListener("focus",()=>this.onFocus()),this.container.addEventListener("blur",()=>this.onBlur()),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(i=>this.onKeyDown(i))),this._register(this.view.onMouseDown(i=>this.onMouseDown(i))),this._register(this.view.onContextMenu(i=>this.handleContextMenu(i)))}handleContextMenu(e){let t=e.browserEvent.target;if(!jp(t)&&!qp(t)){this.focusedLast()&&this.view.domFocus();return}if(!Ia(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");let r=this.state.stickyNodes.findIndex(a=>{var l;return a.node.element===((l=e.element)===null||l===void 0?void 0:l.element)});if(r===-1)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");this.container.focus(),this.setFocus(r);return}if(!this.state||this.focusedIndex<0)throw new Error("Context menu key should not be triggered when focus is not in sticky scroll widget");let o=this.state.stickyNodes[this.focusedIndex].node.element,s=this.elements[this.focusedIndex];this._onContextMenu.fire({element:o,anchor:s,browserEvent:e.browserEvent,isStickyScroll:!0})}onKeyDown(e){if(this.domHasFocus&&this.state){if(e.key==="ArrowUp")this.setFocusedElement(Math.max(0,this.focusedIndex-1)),e.preventDefault(),e.stopPropagation();else if(e.key==="ArrowDown"||e.key==="ArrowRight"){if(this.focusedIndex>=this.state.count-1){let t=this.state.stickyNodes[this.state.count-1].startIndex+1;this.view.domFocus(),this.view.setFocus([t]),this.scrollNodeUnderWidget(t,this.state)}else this.setFocusedElement(this.focusedIndex+1);e.preventDefault(),e.stopPropagation()}}}onMouseDown(e){let t=e.browserEvent.target;!jp(t)&&!qp(t)||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation())}updateElements(e,t){if(t&&t.count===0)throw new Error("Sticky scroll state must be undefined when there are no sticky nodes");if(t&&t.count!==e.length)throw new Error("Sticky scroll focus received illigel state");let i=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){let o=Bn(i,0,t.count-1);this.setFocus(o)}else this.domHasFocus&&this.view.domFocus();this.container.tabIndex=t?0:-1}setFocusedElement(e){let t=this.state;if(!t)throw new Error("Cannot set focus when state is undefined");if(this.setFocus(e),!(e1?t.stickyNodes[t.count-2]:void 0,s=this.view.getElementTop(e),r=o?o.position+o.height+i.height:i.height;this.view.scrollTop=s-r}domFocus(){if(!this.state)throw new Error("Cannot focus when state is undefined");this.container.focus()}focusedLast(){return this.state?this.view.getHTMLElement().classList.contains("sticky-scroll-focused"):!1}removeFocus(){this.focusedIndex!==-1&&(this.toggleElementFocus(this.elements[this.focusedIndex],!1),this.focusedIndex=-1)}setFocus(e){if(0>e)throw new Error("addFocus() can not remove focus");if(!this.state&&e>=0)throw new Error("Cannot set focus index when state is undefined");if(this.state&&e>=this.state.count)throw new Error("Cannot set focus index to an index that does not exist");let t=this.focusedIndex;t>=0&&this.toggleElementFocus(this.elements[t],!1),e>=0&&this.toggleElementFocus(this.elements[e],!0),this.focusedIndex=e}toggleElementFocus(e,t){this.toggleElementActiveFocus(e,t&&this.domHasFocus),this.toggleElementPassiveFocus(e,t)}toggleCurrentElementActiveFocus(e){this.focusedIndex!==-1&&this.toggleElementActiveFocus(this.elements[this.focusedIndex],e)}toggleElementActiveFocus(e,t){e.classList.toggle("focused",t)}toggleElementPassiveFocus(e,t){e.classList.toggle("passive-focused",t)}toggleStickyScrollFocused(e){this.view.getHTMLElement().classList.toggle("sticky-scroll-focused",e)}onFocus(){if(!this.state||this.elements.length===0)throw new Error("Cannot focus when state is undefined or elements are empty");this.domHasFocus=!0,this.toggleStickyScrollFocused(!0),this.toggleCurrentElementActiveFocus(!0),this.focusedIndex===-1&&this.setFocus(0)}onBlur(){this.domHasFocus=!1,this.toggleCurrentElementActiveFocus(!1)}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}};function DE(n){let e=zh.Unknown;return $w(n.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=zh.Twistie:$w(n.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=zh.Element:$w(n.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=zh.Filter),{browserEvent:n.browserEvent,element:n.element?n.element.element:null,target:e}}function LQ(n){let e=jp(n.browserEvent.target);return{element:n.element?n.element.element:null,browserEvent:n.browserEvent,anchor:n.anchor,isStickyScroll:e}}function EE(n,e){e(n),n.children.forEach(t=>EE(t,e))}var a1=class{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new B,this.onDidChange=this._onDidChange.event}set(e,t){!t?.__forceEvent&&Ht(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){let o=this;this._onDidChange.fire({get elements(){return o.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){let l=this.createNodeSet(),c=d=>l.delete(d);t.forEach(d=>EE(d,c)),this.set([...l.values()]);return}let i=new Set,o=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>EE(l,o));let s=new Map,r=l=>s.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>EE(l,r));let a=[];for(let l of this.nodes){let c=this.identityProvider.getId(l.element).toString();if(!i.has(c))a.push(l);else{let h=s.get(c);h&&h.visible&&a.push(h)}}if(this.nodes.length>0&&a.length===0){let l=this.getFirstViewElementWithTrait();l&&a.push(l)}this._set(a,!0)}createNodeSet(){let e=new Set;for(let t of this.nodes)e.add(t);return e}},FP=class extends qv{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(Y5(e.browserEvent.target)||id(e.browserEvent.target)||Up(e.browserEvent.target)||e.browserEvent.isHandledByList)return;let t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);let i=e.browserEvent.target,o=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,s=qp(e.browserEvent.target),r=!1;if(s?r=!0:typeof this.tree.expandOnlyOnTwistieClick=="function"?r=this.tree.expandOnlyOnTwistieClick(t.element):r=!!this.tree.expandOnlyOnTwistieClick,s)this.handleStickyScrollMouseEvent(e,t);else{if(r&&!o&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e)}if(t.collapsible&&(!s||o)){let a=this.tree.getNodeLocation(t),l=e.browserEvent.altKey;if(this.tree.setFocus([a]),this.tree.toggleCollapsed(a,l),o){e.browserEvent.isHandledByList=!0;return}}s||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(EH(e.browserEvent.target)||IH(e.browserEvent.target))return;let i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");let o=this.list.indexOf(t),s=this.list.getElementTop(o),r=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=s-r,this.list.domFocus(),this.list.setFocus([o]),this.list.setSelection([o])}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}onMouseDown(e){let t=e.browserEvent.target;if(!jp(t)&&!qp(t)){super.onMouseDown(e);return}}onContextMenu(e){let t=e.browserEvent.target;if(!jp(t)&&!qp(t)){super.onContextMenu(e);return}}},BP=class extends Do{constructor(e,t,i,o,s,r,a,l){super(e,t,i,o,l),this.focusTrait=s,this.selectionTrait=r,this.anchorTrait=a}createMouseController(e){return new FP(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;let o=[],s=[],r;i.forEach((a,l)=>{this.focusTrait.has(a)&&o.push(e+l),this.selectionTrait.has(a)&&s.push(e+l),this.anchorTrait.has(a)&&(r=e+l)}),o.length>0&&super.setFocus(xr([...super.getFocus(),...o])),s.length>0&&super.setSelection(xr([...super.getSelection(),...s])),typeof r=="number"&&super.setAnchor(r)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(o=>this.element(o)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(o=>this.element(o)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}},i_=class{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return ie.filter(ie.map(this.view.onMouseDblClick,DE),e=>e.target!==zh.Filter)}get onMouseOver(){return ie.map(this.view.onMouseOver,DE)}get onMouseOut(){return ie.map(this.view.onMouseOut,DE)}get onContextMenu(){var e,t;return ie.any(ie.filter(ie.map(this.view.onContextMenu,LQ),i=>!i.isStickyScroll),(t=(e=this.stickyScrollController)===null||e===void 0?void 0:e.onContextMenu)!==null&&t!==void 0?t:ie.None)}get onPointer(){return ie.map(this.view.onPointer,DE)}get onKeyDown(){return this.view.onKeyDown}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return ie.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.mode)!==null&&t!==void 0?t:ac.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.matchType)!==null&&t!==void 0?t:Vh.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,o,s={}){var r;this._user=e,this._options=s,this.eventBufferer=new kd,this.onDidChangeFindOpenState=ie.None,this.onDidChangeStickyScrollFocused=ie.None,this.disposables=new ae,this._onWillRefilter=new B,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new B,this.treeDelegate=new t_(i);let a=new B_,l=new B_,c=this.disposables.add(new TP(l.event)),d=new Jg;this.renderers=o.map(m=>new IE(m,()=>this.model,a.event,c,d,s));for(let m of this.renderers)this.disposables.add(m);let h;s.keyboardNavigationLabelProvider&&(h=new NP(this,s.keyboardNavigationLabelProvider,s.filter),s={...s,filter:h},this.disposables.add(h)),this.focus=new a1(()=>this.view.getFocusedElements()[0],s.identityProvider),this.selection=new a1(()=>this.view.getSelectedElements()[0],s.identityProvider),this.anchor=new a1(()=>this.view.getAnchorElement(),s.identityProvider),this.view=new BP(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...SQ(()=>this.model,s),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.model=this.createModel(e,this.view,s),a.input=this.model.onDidChangeCollapseState;let u=ie.forEach(this.model.onDidSplice,m=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(m),this.selection.onDidModelSplice(m)})},this.disposables);u(()=>null,null,this.disposables);let f=this.disposables.add(new B),g=this.disposables.add(new ka(0));if(this.disposables.add(ie.any(u,this.focus.onDidChange,this.selection.onDidChange)(()=>{g.trigger(()=>{let m=new Set;for(let C of this.focus.getNodes())m.add(C);for(let C of this.selection.getNodes())m.add(C);f.fire([...m.values()])})})),l.input=f.event,s.keyboardSupport!==!1){let m=ie.chain(this.view.onKeyDown,C=>C.filter(S=>!id(S.target)).map(S=>new bt(S)));ie.chain(m,C=>C.filter(S=>S.keyCode===15))(this.onLeftArrow,this,this.disposables),ie.chain(m,C=>C.filter(S=>S.keyCode===17))(this.onRightArrow,this,this.disposables),ie.chain(m,C=>C.filter(S=>S.keyCode===10))(this.onSpace,this,this.disposables)}if((!((r=s.findWidgetEnabled)!==null&&r!==void 0)||r)&&s.keyboardNavigationLabelProvider&&s.contextViewProvider){let m=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new AP(this,this.model,this.view,h,s.contextViewProvider,m),this.focusNavigationFilter=C=>this.findController.shouldAllowFocus(C),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=ie.None,this.onDidChangeFindMatchType=ie.None;s.enableStickyScroll&&(this.stickyScrollController=new TE(this,this.model,this.view,this.renderers,this.treeDelegate,s),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=Xi(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Gf.Always)}updateOptions(e={}){var t;this._options={...this._options,...e};for(let i of this.renderers)i.updateOptions(e);this.view.updateOptions(this._options),(t=this.findController)===null||t===void 0||t.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Gf.Always)}get options(){return this._options}updateStickyScroll(e){var t;!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new TE(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=ie.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),(t=this.stickyScrollController)===null||t===void 0||t.updateOptions(e)}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get ariaLabel(){return this.view.ariaLabel}set ariaLabel(e){this.view.ariaLabel=e}domFocus(){var e;!((e=this.stickyScrollController)===null||e===void 0)&&e.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}layout(e,t){var i;this.view.layout(e,t),pa(t)&&((i=this.findController)===null||i===void 0||i.layout(t))}style(e){var t,i;let o=`.${this.view.domId}`,s=[];e.treeIndentGuidesStroke&&(s.push(`.monaco-list${o}:hover .monaco-tl-indent > .indent-guide, .monaco-list${o}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),s.push(`.monaco-list${o} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`));let r=(t=e.treeStickyScrollBackground)!==null&&t!==void 0?t:e.listBackground;r&&(s.push(`.monaco-list${o} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${r}; }`),s.push(`.monaco-list${o} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${r}; }`)),e.treeStickyScrollBorder&&s.push(`.monaco-list${o} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${e.treeStickyScrollBorder}; }`),e.treeStickyScrollShadow&&s.push(`.monaco-list${o} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${e.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`),e.listFocusForeground&&(s.push(`.monaco-list${o}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),s.push(`.monaco-list${o}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));let a=tr(e.listFocusAndSelectionOutline,tr(e.listSelectionOutline,(i=e.listFocusOutline)!==null&&i!==void 0?i:""));a&&(s.push(`.monaco-list${o}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${a}; outline-offset: -1px;}`),s.push(`.monaco-list${o}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(s.push(`.monaco-list${o}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),s.push(`.monaco-list${o}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),s.push(`.monaco-workbench.context-menu-visible .monaco-list${o}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),s.push(`.monaco-workbench.context-menu-visible .monaco-list${o}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),s.push(`.monaco-workbench.context-menu-visible .monaco-list${o}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=s.join(` +`),this.view.style(e)}getParentElement(e){let t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){this.eventBufferer.bufferEvents(()=>{let i=e.map(s=>this.model.getNode(s));this.selection.set(i,t);let o=e.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setSelection(o,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{let i=e.map(s=>this.model.getNode(s));this.focus.set(i,t);let o=e.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setFocus(o,t,!0)})}focusNext(e=1,t=!1,i,o=Ia(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,o)}focusPrevious(e=1,t=!1,i,o=Ia(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,o)}focusNextPage(e,t=Ia(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=Ia(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>{var i,o;return(o=(i=this.stickyScrollController)===null||i===void 0?void 0:i.height)!==null&&o!==void 0?o:0})}focusFirst(e,t=Ia(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusFirst(e,t)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);let i=this.model.getListIndex(e);if(i!==-1)if(!this.stickyScrollController)this.view.reveal(i,t);else{let o=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,o)}}onLeftArrow(e){e.preventDefault(),e.stopPropagation();let t=this.view.getFocusedElements();if(t.length===0)return;let i=t[0],o=this.model.getNodeLocation(i);if(!this.model.setCollapsed(o,!0)){let r=this.model.getParentNodeLocation(o);if(!r)return;let a=this.model.getListIndex(r);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();let t=this.view.getFocusedElements();if(t.length===0)return;let i=t[0],o=this.model.getNodeLocation(i);if(!this.model.setCollapsed(o,!1)){if(!i.children.some(l=>l.visible))return;let[r]=this.view.getFocus(),a=r+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();let t=this.view.getFocusedElements();if(t.length===0)return;let i=t[0],o=this.model.getNodeLocation(i),s=e.browserEvent.altKey;this.model.setCollapsed(o,void 0,s)}dispose(){var e;li(this.disposables),(e=this.stickyScrollController)===null||e===void 0||e.dispose(),this.view.dispose()}};_();v();b();_();v();b();_();v();b();_();v();b();js();var Hh=class{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new kE(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(o,s){return i.sorter.compare(o.element,s.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=ht.empty(),i={}){let o=this.getElementLocation(e);this._setChildren(o,this.preserveCollapseState(t),i)}_setChildren(e,t=ht.empty(),i){let o=new Set,s=new Set,r=l=>{var c;if(l.element===null)return;let d=l;if(o.add(d.element),this.nodes.set(d.element,d),this.identityProvider){let h=this.identityProvider.getId(d.element).toString();s.add(h),this.nodesByIdentity.set(h,d)}(c=i.onDidCreateNode)===null||c===void 0||c.call(i,d)},a=l=>{var c;if(l.element===null)return;let d=l;if(o.has(d.element)||this.nodes.delete(d.element),this.identityProvider){let h=this.identityProvider.getId(d.element).toString();s.has(h)||this.nodesByIdentity.delete(h)}(c=i.onDidDeleteNode)===null||c===void 0||c.call(i,d)};this.model.splice([...e,0],Number.MAX_VALUE,t,{...i,onDidCreateNode:r,onDidDeleteNode:a})}preserveCollapseState(e=ht.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),ht.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){let r=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(r)}if(!i){let r;return typeof t.collapsed>"u"?r=void 0:t.collapsed===as.Collapsed||t.collapsed===as.PreserveOrCollapsed?r=!0:t.collapsed===as.Expanded||t.collapsed===as.PreserveOrExpanded?r=!1:r=!!t.collapsed,{...t,children:this.preserveCollapseState(t.children),collapsed:r}}let o=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible,s;return typeof t.collapsed>"u"||t.collapsed===as.PreserveOrCollapsed||t.collapsed===as.PreserveOrExpanded?s=i.collapsed:t.collapsed===as.Collapsed?s=!0:t.collapsed===as.Expanded?s=!1:s=!!t.collapsed,{...t,collapsible:o,collapsed:s,children:this.preserveCollapseState(t.children)}})}rerender(e){let t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){let t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){let t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){let t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){let t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){let i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){let t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){let o=this.getElementLocation(e);return this.model.setCollapsed(o,t,i)}expandTo(e){let t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);let t=this.nodes.get(e);if(!t)throw new eo(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new eo(this.user,"Invalid getParentNodeLocation call");let t=this.nodes.get(e);if(!t)throw new eo(this.user,`Tree element not found: ${e}`);let i=this.model.getNodeLocation(t),o=this.model.getParentNodeLocation(i);return this.model.getNode(o).element}getElementLocation(e){if(e===null)return[];let t=this.nodes.get(e);if(!t)throw new eo(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}};wt();ye();js();function NE(n){let e=[n.element],t=n.incompressible||!1;return{element:{elements:e,incompressible:t},children:ht.map(ht.from(n.children),NE),collapsible:n.collapsible,collapsed:n.collapsed}}function AE(n){let e=[n.element],t=n.incompressible||!1,i,o;for(;[o,i]=ht.consume(ht.from(n.children),2),!(o.length!==1||o[0].incompressible);)n=o[0],e.push(n.element);return{element:{elements:e,incompressible:t},children:ht.map(ht.concat(o,i),AE),collapsible:n.collapsible,collapsed:n.collapsed}}function WP(n,e=0){let t;return eWP(i,0)),e===0&&n.element.incompressible?{element:n.element.elements[e],children:t,incompressible:!0,collapsible:n.collapsible,collapsed:n.collapsed}:{element:n.element.elements[e],children:t,collapsible:n.collapsible,collapsed:n.collapsed}}function oU(n){return WP(n,0)}function sU(n,e,t){return n.element===e?{...n,children:t}:{...n,children:ht.map(ht.from(n.children),i=>sU(i,e,t))}}var kQ=n=>({getId(e){return e.elements.map(t=>n.getId(t).toString()).join("\0")}}),zP=class{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new Hh(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=ht.empty(),i){let o=i.diffIdentityProvider&&kQ(i.diffIdentityProvider);if(e===null){let g=ht.map(t,this.enabled?AE:NE);this._setChildren(null,g,{diffIdentityProvider:o,diffDepth:1/0});return}let s=this.nodes.get(e);if(!s)throw new eo(this.user,"Unknown compressed tree node");let r=this.model.getNode(s),a=this.model.getParentNodeLocation(s),l=this.model.getNode(a),c=oU(r),d=sU(c,e,t),h=(this.enabled?AE:NE)(d),u=i.diffIdentityProvider?(g,m)=>i.diffIdentityProvider.getId(g)===i.diffIdentityProvider.getId(m):void 0;if(Ht(h.element.elements,r.element.elements,u)){this._setChildren(s,h.children||ht.empty(),{diffIdentityProvider:o,diffDepth:1});return}let f=l.children.map(g=>g===r?h:g);this._setChildren(l.element,f,{diffIdentityProvider:o,diffDepth:r.depth-l.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;let i=this.model.getNode().children,o=ht.map(i,oU),s=ht.map(o,e?AE:NE);this._setChildren(null,s,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){let o=new Set,s=a=>{for(let l of a.element.elements)o.add(l),this.nodes.set(l,a.element)},r=a=>{for(let l of a.element.elements)o.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,{...i,onDidCreateNode:s,onDidDeleteNode:r})}has(e){return this.nodes.has(e)}getListIndex(e){let t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){let t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();let t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){let t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){let t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return i===null?null:i.elements[i.elements.length-1]}getFirstElementChild(e){let t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){let t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){let i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){let t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){let o=this.getCompressedNode(e);return this.model.setCollapsed(o,t,i)}expandTo(e){let t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){let t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(e===null)return null;let t=this.nodes.get(e);if(!t)throw new eo(this.user,`Tree element not found: ${e}`);return t}},DQ=n=>n[n.length-1],VP=class n{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new n(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}};function EQ(n,e){return{splice(t,i,o){e.splice(t,i,o.map(s=>n.map(s)))},updateElementHeight(t,i){e.updateElementHeight(t,i)}}}function IQ(n,e){return{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(n(t))}},sorter:e.sorter&&{compare(t,i){return e.sorter.compare(t.elements[0],i.elements[0])}},filter:e.filter&&{filter(t,i){return e.filter.filter(n(t),i)}}}}var ME=class{get onDidSplice(){return ie.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(i=>this.nodeMapper.map(i)),deletedNodes:t.map(i=>this.nodeMapper.map(i))}))}get onDidChangeCollapseState(){return ie.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return ie.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||DQ;let o=s=>this.elementMapper(s.elements);this.nodeMapper=new qf(s=>new VP(o,s)),this.model=new zP(e,EQ(this.nodeMapper,t),IQ(o,i))}setChildren(e,t=ht.empty(),i={}){this.model.setChildren(e,t,i)}isCompressionEnabled(){return this.model.isCompressionEnabled()}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){let t=this.model.getFirstElementChild(e);return t===null||typeof t>"u"?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}};js();var TQ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Zf=class extends i_{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,o,s={}){super(e,t,i,o,s),this.user=e}setChildren(e,t=ht.empty(),i){this.model.setChildren(e,t,i)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new Hh(e,t,i)}},RE=class{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t,i){this._compressedTreeNodeProvider=e,this.stickyScrollDelegate=t,this.renderer=i,this.templateId=i.templateId,i.onDidChangeTwistieState&&(this.onDidChangeTwistieState=i.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,o){let s=this.stickyScrollDelegate.getCompressedNode(e);s||(s=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),s.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,o)):(i.compressedTreeNode=s,this.renderer.renderCompressedElements(s,t,i.data,o))}disposeElement(e,t,i,o){var s,r,a,l;i.compressedTreeNode?(r=(s=this.renderer).disposeCompressedElements)===null||r===void 0||r.call(s,i.compressedTreeNode,t,i.data,o):(l=(a=this.renderer).disposeElement)===null||l===void 0||l.call(a,e,t,i.data,o)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}};TQ([Yt],RE.prototype,"compressedTreeNodeProvider",null);var HP=class{constructor(e){this.modelProvider=e,this.compressedStickyNodes=new Map}getCompressedNode(e){return this.compressedStickyNodes.get(e)}constrainStickyScrollNodes(e,t,i){if(this.compressedStickyNodes.clear(),e.length===0)return[];for(let o=0;oi||o>=t-1&&tthis,a=new HP(()=>this.model),l=o.map(c=>new RE(r,a,c));super(e,t,i,l,{...NQ(r,s),stickyScrollDelegate:a})}setChildren(e,t=ht.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new ME(e,t,i)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}};Gt();$n();Ln();xt();ye();js();le();xi();function UP(n){return{...n,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function $P(n,e){return e.parent?e.parent===n?!0:$P(n,e.parent):!1}function AQ(n,e){return n===e||$P(n,e)||$P(e,n)}var qP=class n{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new n(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}},jP=class{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,o){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,o)}renderTwistie(e,t){return e.slow?(t.classList.add(...Xe.asClassNameArray(ue.treeItemLoading)),!0):(t.classList.remove(...Xe.asClassNameArray(ue.treeItemLoading)),!1)}disposeElement(e,t,i,o){var s,r;(r=(s=this.renderer).disposeElement)===null||r===void 0||r.call(s,this.nodeMapper.map(e),t,i.templateData,o)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}};function rU(n){return{browserEvent:n.browserEvent,elements:n.elements.map(e=>e.element)}}function aU(n){return{browserEvent:n.browserEvent,element:n.element&&n.element.element,target:n.target}}var GP=class extends Jc{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}};function KP(n){return n instanceof Jc?new GP(n):n}var ZP=class{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){var i,o;(o=(i=this.dnd).onDragStart)===null||o===void 0||o.call(i,KP(e),t)}onDragOver(e,t,i,o,s,r=!0){return this.dnd.onDragOver(KP(e),t&&t.element,i,o,s)}drop(e,t,i,o,s){this.dnd.drop(KP(e),t&&t.element,i,o,s)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}dispose(){this.dnd.dispose()}};function lU(n){return n&&{...n,collapseByDefault:!0,identityProvider:n.identityProvider&&{getId(e){return n.identityProvider.getId(e.element)}},dnd:n.dnd&&new ZP(n.dnd),multipleSelectionController:n.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return n.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element})},isSelectionRangeChangeEvent(e){return n.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})}},accessibilityProvider:n.accessibilityProvider&&{...n.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:n.accessibilityProvider.getRole?e=>n.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:n.accessibilityProvider.isChecked?e=>{var t;return!!(!((t=n.accessibilityProvider)===null||t===void 0)&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return n.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return n.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:n.accessibilityProvider.getWidgetRole?()=>n.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:n.accessibilityProvider.getAriaLevel&&(e=>n.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:n.accessibilityProvider.getActiveDescendantId&&(e=>n.accessibilityProvider.getActiveDescendantId(e.element))},filter:n.filter&&{filter(e,t){return n.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:n.keyboardNavigationLabelProvider&&{...n.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(e){return n.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}},sorter:void 0,expandOnlyOnTwistieClick:typeof n.expandOnlyOnTwistieClick>"u"?void 0:typeof n.expandOnlyOnTwistieClick!="function"?n.expandOnlyOnTwistieClick:e=>n.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof n.defaultFindVisibility=="number"?n.defaultFindVisibility:typeof n.defaultFindVisibility>"u"?2:n.defaultFindVisibility(e.element)}}function YP(n,e){e(n),n.children.forEach(t=>YP(t,e))}var l1=class{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return ie.map(this.tree.onDidChangeFocus,rU)}get onDidChangeSelection(){return ie.map(this.tree.onDidChangeSelection,rU)}get onMouseDblClick(){return ie.map(this.tree.onMouseDblClick,aU)}get onPointer(){return ie.map(this.tree.onPointer,aU)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidChangeStickyScrollFocused(){return this.tree.onDidChangeStickyScrollFocused}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,o,s,r={}){this.user=e,this.dataSource=s,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new B,this._onDidChangeNodeSlowState=new B,this.nodeMapper=new qf(a=>new qP(a)),this.disposables=new ae,this.identityProvider=r.identityProvider,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.sorter=r.sorter,this.getDefaultCollapseState=a=>r.collapseByDefault?r.collapseByDefault(a)?as.PreserveOrCollapsed:as.PreserveOrExpanded:void 0,this.tree=this.createTree(e,t,i,o,r),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType,this.root=UP({element:void 0,parent:null,hasChildren:!0,defaultCollapseState:void 0}),this.identityProvider&&(this.root={...this.root,id:null}),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,i,o,s){let r=new t_(i),a=o.map(c=>new jP(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=lU(s)||{};return new Zf(e,t,r,a,l)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}async setInput(e,t){this.refreshPromises.forEach(o=>o.cancel()),this.refreshPromises.clear(),this.root.element=e;let i=t&&{viewState:t,focus:[],selection:[]};await this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)}async _updateChildren(e=this.root.element,t=!0,i=!1,o,s){if(typeof this.root.element>"u")throw new eo(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await ie.toPromise(this._onDidRender.event));let r=this.getDataNode(e);if(await this.refreshAndRenderNode(r,t,o,s),i)try{this.tree.rerender(r)}catch{}}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}let t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){let t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){let i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}async expand(e,t=!1){if(typeof this.root.element>"u")throw new eo(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await ie.toPromise(this._onDidRender.event));let i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(await this.root.refreshPromise,await ie.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;let o=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(await this.root.refreshPromise,await ie.toPromise(this._onDidRender.event)),o}setSelection(e,t){let i=e.map(o=>this.getDataNode(o));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){let i=e.map(o=>this.getDataNode(o));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(t=>t.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){let t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){let t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){let t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new eo(this.user,`Data tree node not found: ${e}`);return t}async refreshAndRenderNode(e,t,i,o){await this.refreshNode(e,t,i),!this.disposables.isDisposed&&this.render(e,i,o)}async refreshNode(e,t,i){let o;if(this.subTreeRefreshPromises.forEach((s,r)=>{!o&&AQ(r,e)&&(o=s.then(()=>this.refreshNode(e,t,i)))}),o)return o;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0,this.setChildren(e,[],t,i);return}return this.doRefreshSubTree(e,t,i)}async doRefreshSubTree(e,t,i){let o;e.refreshPromise=new Promise(s=>o=s),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{let s=await this.doRefreshNode(e,t,i);e.stale=!1,await Tw.settled(s.map(r=>this.doRefreshSubTree(r,t,i)))}finally{o()}}async doRefreshNode(e,t,i){e.hasChildren=!!this.dataSource.hasChildren(e.element);let o;if(!e.hasChildren)o=Promise.resolve(ht.empty());else{let s=this.doGetChildren(e);if(_I(s))o=Promise.resolve(s);else{let r=kc(800);r.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),o=s.finally(()=>r.cancel())}}try{let s=await o;return this.setChildren(e,s,t,i)}catch(s){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),yd(s))return[];throw s}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;let i=this.dataSource.getChildren(e.element);return _I(i)?this.processChildren(i):(t=PT(async()=>this.processChildren(await i)),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(ut))}setChildren(e,t,i,o){let s=[...t];if(e.children.length===0&&s.length===0)return[];let r=new Map,a=new Map;for(let d of e.children)r.set(d.element,d),this.identityProvider&&a.set(d.id,{node:d,collapsed:this.tree.hasElement(d)&&this.tree.isCollapsed(d)});let l=[],c=s.map(d=>{let h=!!this.dataSource.hasChildren(d);if(!this.identityProvider){let m=UP({element:d,parent:e,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return h&&m.defaultCollapseState===as.PreserveOrExpanded&&l.push(m),m}let u=this.identityProvider.getId(d).toString(),f=a.get(u);if(f){let m=f.node;return r.delete(m.element),this.nodes.delete(m.element),this.nodes.set(d,m),m.element=d,m.hasChildren=h,i?f.collapsed?(m.children.forEach(C=>YP(C,S=>this.nodes.delete(S.element))),m.children.splice(0,m.children.length),m.stale=!0):l.push(m):h&&!f.collapsed&&l.push(m),m}let g=UP({element:d,parent:e,id:u,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return o&&o.viewState.focus&&o.viewState.focus.indexOf(u)>-1&&o.focus.push(g),o&&o.viewState.selection&&o.viewState.selection.indexOf(u)>-1&&o.selection.push(g),(o&&o.viewState.expanded&&o.viewState.expanded.indexOf(u)>-1||h&&g.defaultCollapseState===as.PreserveOrExpanded)&&l.push(g),g});for(let d of r.values())YP(d,h=>this.nodes.delete(h.element));for(let d of c)this.nodes.set(d.element,d);return e.children.splice(0,e.children.length,...c),e!==this.root&&this.autoExpandSingleChildren&&c.length===1&&l.length===0&&(c[0].forceExpanded=!0,l.push(c[0])),l}render(e,t,i){let o=e.children.map(r=>this.asTreeElement(r,t)),s=i&&{...i,diffIdentityProvider:i.diffIdentityProvider&&{getId(r){return i.diffIdentityProvider.getId(r.element)}}};this.tree.setChildren(e===this.root?null:e,o,s),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:e.forceExpanded?(i=!1,e.forceExpanded=!1):i=e.defaultCollapseState,{element:e,children:e.hasChildren?ht.map(e.children,o=>this.asTreeElement(o,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}},XP=class n{get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new n(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}},QP=class{constructor(e,t,i,o){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=o,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,o){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,o)}renderCompressedElements(e,t,i,o){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,o)}renderTwistie(e,t){return e.slow?(t.classList.add(...Xe.asClassNameArray(ue.treeItemLoading)),!0):(t.classList.remove(...Xe.asClassNameArray(ue.treeItemLoading)),!1)}disposeElement(e,t,i,o){var s,r;(r=(s=this.renderer).disposeElement)===null||r===void 0||r.call(s,this.nodeMapper.map(e),t,i.templateData,o)}disposeCompressedElements(e,t,i,o){var s,r;(r=(s=this.renderer).disposeCompressedElements)===null||r===void 0||r.call(s,this.compressibleNodeMapperProvider().map(e),t,i.templateData,o)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=li(this.disposables)}};function MQ(n){let e=n&&lU(n);return e&&{...e,keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(t){return n.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}}}}var PE=class extends l1{constructor(e,t,i,o,s,r,a={}){super(e,t,i,s,r,a),this.compressionDelegate=o,this.compressibleNodeMapper=new qf(l=>new XP(l)),this.filter=a.filter}createTree(e,t,i,o,s){let r=new t_(i),a=o.map(c=>new QP(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=MQ(s)||{};return new n_(e,t,r,a,l)}asTreeElement(e,t){return{incompressible:this.compressionDelegate.isIncompressible(e.element),...super.asTreeElement(e,t)}}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t,i){if(!this.identityProvider)return super.render(e,t);let o=f=>this.identityProvider.getId(f).toString(),s=f=>{let g=new Set;for(let m of f){let C=this.tree.getCompressedTreeNode(m===this.root?null:m);if(C.element)for(let S of C.element.elements)g.add(o(S.element))}return g},r=s(this.tree.getSelection()),a=s(this.tree.getFocus());super.render(e,t,i);let l=this.getSelection(),c=!1,d=this.getFocus(),h=!1,u=f=>{let g=f.element;if(g)for(let m=0;m{let i=this.filter.filter(t,1),o=RQ(i);if(o===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return o===1})),super.processChildren(e)}};function RQ(n){return typeof n=="boolean"?n?1:0:r1(n)?jf(n.visibility):jf(n)}_();v();b();var OE=class extends i_{constructor(e,t,i,o,s,r={}){super(e,t,i,o,r),this.user=e,this.dataSource=s,this.identityProvider=r.identityProvider}createModel(e,t,i){return new Hh(e,t,i)}};ye();le();Ge();Fo();Du();Oi();_();v();b();Lt();Ge();Oi();var iat=new xe("isMac",Be,p("isMac","Whether the operating system is macOS")),nat=new xe("isLinux",mi,p("isLinux","Whether the operating system is Linux")),oat=new xe("isWindows",Li,p("isWindows","Whether the operating system is Windows")),sat=new xe("isWeb",hl,p("isWeb","Whether the platform is a web browser")),rat=new xe("isMacNative",Be&&!hl,p("isMacNative","Whether the operating system is macOS on a non-browser platform")),aat=new xe("isIOS",Rs,p("isIOS","Whether the operating system is iOS")),lat=new xe("isMobile",J1,p("isMobile","Whether the platform is a mobile web browser")),cat=new xe("isDevelopment",!1,!0),dat=new xe("productQualityType","",p("productQualityType","Quality type of VS Code")),JP="inputFocus",hat=new xe(JP,!1,p("inputFocus","Whether keyboard focus is inside an input box"));qe();Oo();var sd=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Qt=function(n,e){return function(t,i){e(t,i,n)}},ol=De("listService"),BE=class{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new ae,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,i;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)===null||t===void 0||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(i=this._lastFocusedWidget)===null||i===void 0||i.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new jv(Xi(),"").style(Hf)),this.lists.some(o=>o.widget===e))throw new Error("Cannot register the same widget multiple times");let i={widget:e,extraContextKeys:t};return this.lists.push(i),_0(e.getHTMLElement())&&this.setLastFocusedList(e),_o(e.onDidFocus(()=>this.setLastFocusedList(e)),be(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(o=>o!==i),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}},c1=new xe("listScrollAtBoundary","none"),Oat=Dt.or(c1.isEqualTo("top"),c1.isEqualTo("both")),Fat=Dt.or(c1.isEqualTo("bottom"),c1.isEqualTo("both")),pU=new xe("listFocus",!0),_U=new xe("treestickyScrollFocused",!1),qE=new xe("listSupportsMultiselect",!0),Bat=Dt.and(pU,Dt.not(JP),_U.negate()),nO=new xe("listHasSelectionOrFocus",!1),oO=new xe("listDoubleSelection",!1),sO=new xe("listMultiSelection",!1),jE=new xe("listSelectionNavigation",!1),PQ=new xe("listSupportsFind",!0),OQ=new xe("treeElementCanCollapse",!1),FQ=new xe("treeElementHasParent",!1),BQ=new xe("treeElementCanExpand",!1),WQ=new xe("treeElementHasChild",!1),zQ=new xe("treeFindOpen",!1),bU="listTypeNavigationMode",vU="listAutomaticKeyboardNavigation";function GE(n,e){let t=n.createScoped(e.getHTMLElement());return pU.bindTo(t),t}function ZE(n,e){let t=c1.bindTo(n),i=()=>{let o=e.scrollTop===0,s=e.scrollHeight-e.renderHeight-e.scrollTop<1;o&&s?t.set("both"):o?t.set("top"):s?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}var Xf="workbench.list.multiSelectModifier",FE="workbench.list.openMode",_r="workbench.list.horizontalScrolling",rO="workbench.list.defaultFindMode",aO="workbench.list.typeNavigationMode",WE="workbench.list.keyboardNavigation",il="workbench.list.scrollByPage",lO="workbench.list.defaultFindMatchType",d1="workbench.tree.indent",zE="workbench.tree.renderIndentGuides",nl="workbench.list.smoothScrolling",lc="workbench.list.mouseWheelScrollSensitivity",cc="workbench.list.fastScrollSensitivity",VE="workbench.tree.expandMode",HE="workbench.tree.enableStickyScroll",UE="workbench.tree.stickyScrollMaxItemCount";function dc(n){return n.getValue(Xf)==="alt"}var eO=class extends H{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=dc(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(Xf)&&(this.useAltAsMultipleSelectionModifier=dc(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:X5(e)}isSelectionRangeChangeEvent(e){return Q5(e)}};function YE(n,e){var t;let i=n.get(Rt),o=n.get(fi),s=new ae;return[{...e,keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return o.mightProducePrintableCharacter(a)}},smoothScrolling:!!i.getValue(nl),mouseWheelScrollSensitivity:i.getValue(lc),fastScrollSensitivity:i.getValue(cc),multipleSelectionController:(t=e.multipleSelectionController)!==null&&t!==void 0?t:s.add(new eO(i)),keyboardNavigationEventFilter:VQ(o),scrollByPage:!!i.getValue(il)},s]}var cU=class extends Do{constructor(e,t,i,o,s,r,a,l,c){let d=typeof s.horizontalScrolling<"u"?s.horizontalScrolling:!!l.getValue(_r),[h,u]=c.invokeFunction(YE,s);super(e,t,i,o,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables.add(u),this.contextKeyService=GE(r,this),this.disposables.add(ZE(this.contextKeyService,this)),this.listSupportsMultiSelect=qE.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),jE.bindTo(this.contextKeyService).set(!!s.selectionNavigation),this.listHasSelectionOrFocus=nO.bindTo(this.contextKeyService),this.listDoubleSelection=oO.bindTo(this.contextKeyService),this.listMultiSelection=sO.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=dc(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{let g=this.getSelection(),m=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(g.length>0||m.length>0),this.listMultiSelection.set(g.length>1),this.listDoubleSelection.set(g.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{let g=this.getSelection(),m=this.getFocus();this.listHasSelectionOrFocus.set(g.length>0||m.length>0)})),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(Xf)&&(this._useAltAsMultipleSelectionModifier=dc(l));let m={};if(g.affectsConfiguration(_r)&&this.horizontalScrolling===void 0){let C=!!l.getValue(_r);m={...m,horizontalScrolling:C}}if(g.affectsConfiguration(il)){let C=!!l.getValue(il);m={...m,scrollByPage:C}}if(g.affectsConfiguration(nl)){let C=!!l.getValue(nl);m={...m,smoothScrolling:C}}if(g.affectsConfiguration(lc)){let C=l.getValue(lc);m={...m,mouseWheelScrollSensitivity:C}}if(g.affectsConfiguration(cc)){let C=l.getValue(cc);m={...m,fastScrollSensitivity:C}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new KE(this,{configurationService:l,...s}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?Uf(e):Hf)}};cU=sd([Qt(5,rt),Qt(6,ol),Qt(7,Rt),Qt(8,Ye)],cU);var dU=class extends _E{constructor(e,t,i,o,s,r,a,l,c){let d=typeof s.horizontalScrolling<"u"?s.horizontalScrolling:!!l.getValue(_r),[h,u]=c.invokeFunction(YE,s);super(e,t,i,o,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables=new ae,this.disposables.add(u),this.contextKeyService=GE(r,this),this.disposables.add(ZE(this.contextKeyService,this.widget)),this.horizontalScrolling=s.horizontalScrolling,this.listSupportsMultiSelect=qE.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),jE.bindTo(this.contextKeyService).set(!!s.selectionNavigation),this._useAltAsMultipleSelectionModifier=dc(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(Xf)&&(this._useAltAsMultipleSelectionModifier=dc(l));let m={};if(g.affectsConfiguration(_r)&&this.horizontalScrolling===void 0){let C=!!l.getValue(_r);m={...m,horizontalScrolling:C}}if(g.affectsConfiguration(il)){let C=!!l.getValue(il);m={...m,scrollByPage:C}}if(g.affectsConfiguration(nl)){let C=!!l.getValue(nl);m={...m,smoothScrolling:C}}if(g.affectsConfiguration(lc)){let C=l.getValue(lc);m={...m,mouseWheelScrollSensitivity:C}}if(g.affectsConfiguration(cc)){let C=l.getValue(cc);m={...m,fastScrollSensitivity:C}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new KE(this,{configurationService:l,...s}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?Uf(e):Hf)}dispose(){this.disposables.dispose(),super.dispose()}};dU=sd([Qt(5,rt),Qt(6,ol),Qt(7,Rt),Qt(8,Ye)],dU);var hU=class extends n1{constructor(e,t,i,o,s,r,a,l,c,d){let h=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!c.getValue(_r),[u,f]=d.invokeFunction(YE,r);super(e,t,i,o,s,{keyboardSupport:!1,...u,horizontalScrolling:h}),this.disposables.add(f),this.contextKeyService=GE(a,this),this.disposables.add(ZE(this.contextKeyService,this)),this.listSupportsMultiSelect=qE.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),jE.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=nO.bindTo(this.contextKeyService),this.listDoubleSelection=oO.bindTo(this.contextKeyService),this.listMultiSelection=sO.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=dc(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{let m=this.getSelection(),C=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(m.length>0||C.length>0),this.listMultiSelection.set(m.length>1),this.listDoubleSelection.set(m.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{let m=this.getSelection(),C=this.getFocus();this.listHasSelectionOrFocus.set(m.length>0||C.length>0)})),this.disposables.add(c.onDidChangeConfiguration(m=>{m.affectsConfiguration(Xf)&&(this._useAltAsMultipleSelectionModifier=dc(c));let C={};if(m.affectsConfiguration(_r)&&this.horizontalScrolling===void 0){let S=!!c.getValue(_r);C={...C,horizontalScrolling:S}}if(m.affectsConfiguration(il)){let S=!!c.getValue(il);C={...C,scrollByPage:S}}if(m.affectsConfiguration(nl)){let S=!!c.getValue(nl);C={...C,smoothScrolling:S}}if(m.affectsConfiguration(lc)){let S=c.getValue(lc);C={...C,mouseWheelScrollSensitivity:S}}if(m.affectsConfiguration(cc)){let S=c.getValue(cc);C={...C,fastScrollSensitivity:S}}Object.keys(C).length>0&&this.updateOptions(C)})),this.navigator=new tO(this,{configurationService:c,...r}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?Uf(e):Hf)}dispose(){this.disposables.dispose(),super.dispose()}};hU=sd([Qt(6,rt),Qt(7,ol),Qt(8,Rt),Qt(9,Ye)],hU);var h1=class extends H{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new B),this.onDidOpen=this._onDidOpen.event,this._register(ie.filter(this.widget.onDidChangeSelection,o=>Ia(o.browserEvent))(o=>this.onSelectionFromKeyboard(o))),this._register(this.widget.onPointer(o=>this.onPointer(o.element,o.browserEvent))),this._register(this.widget.onMouseDblClick(o=>this.onMouseDblClick(o.element,o.browserEvent))),typeof t?.openOnSingleClick!="boolean"&&t?.configurationService?(this.openOnSingleClick=t?.configurationService.getValue(FE)!=="doubleClick",this._register(t?.configurationService.onDidChangeConfiguration(o=>{o.affectsConfiguration(FE)&&(this.openOnSingleClick=t?.configurationService.getValue(FE)!=="doubleClick")}))):this.openOnSingleClick=(i=t?.openOnSingleClick)!==null&&i!==void 0?i:!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;let t=e.browserEvent,i=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,o=typeof t.pinned=="boolean"?t.pinned:!i,s=!1;this._open(this.getSelectedElement(),i,o,s,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;let o=t.button===1,s=!0,r=o,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,s,r,a,t)}onMouseDblClick(e,t){if(!t)return;let i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;let s=!1,r=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,s,r,a,t)}_open(e,t,i,o,s){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:o,element:e,browserEvent:s})}},KE=class extends h1{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}},tO=class extends h1{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}},iO=class extends h1{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}};function VQ(n){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;let i=n.softDispatch(t,t.target);return i.kind===1?(e=!0,!1):(e=!1,i.kind===0)}}var $E=class extends Zf{constructor(e,t,i,o,s,r,a,l,c){let{options:d,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(u1,s);super(e,t,i,o,d),this.disposables.add(u),this.internals=new Yf(this,s,h,s.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};$E=sd([Qt(5,Ye),Qt(6,rt),Qt(7,ol),Qt(8,Rt)],$E);var uU=class extends n_{constructor(e,t,i,o,s,r,a,l,c){let{options:d,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(u1,s);super(e,t,i,o,d),this.disposables.add(u),this.internals=new Yf(this,s,h,s.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};uU=sd([Qt(5,Ye),Qt(6,rt),Qt(7,ol),Qt(8,Rt)],uU);var fU=class extends OE{constructor(e,t,i,o,s,r,a,l,c,d){let{options:h,getTypeNavigationMode:u,disposable:f}=a.invokeFunction(u1,r);super(e,t,i,o,s,h),this.disposables.add(f),this.internals=new Yf(this,r,u,r.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};fU=sd([Qt(6,Ye),Qt(7,rt),Qt(8,ol),Qt(9,Rt)],fU);var gU=class extends l1{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,o,s,r,a,l,c,d){let{options:h,getTypeNavigationMode:u,disposable:f}=a.invokeFunction(u1,r);super(e,t,i,o,s,h),this.disposables.add(f),this.internals=new Yf(this,r,u,r.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};gU=sd([Qt(6,Ye),Qt(7,rt),Qt(8,ol),Qt(9,Rt)],gU);var mU=class extends PE{constructor(e,t,i,o,s,r,a,l,c,d,h){let{options:u,getTypeNavigationMode:f,disposable:g}=l.invokeFunction(u1,a);super(e,t,i,o,s,r,u),this.disposables.add(g),this.internals=new Yf(this,a,f,a.overrideStyles,c,d,h),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};mU=sd([Qt(7,Ye),Qt(8,rt),Qt(9,ol),Qt(10,Rt)],mU);function CU(n){let e=n.getValue(rO);if(e==="highlight")return ac.Highlight;if(e==="filter")return ac.Filter;let t=n.getValue(WE);if(t==="simple"||t==="highlight")return ac.Highlight;if(t==="filter")return ac.Filter}function wU(n){let e=n.getValue(lO);if(e==="fuzzy")return Vh.Fuzzy;if(e==="contiguous")return Vh.Contiguous}function u1(n,e){var t;let i=n.get(Rt),o=n.get(Qc),s=n.get(rt),r=n.get(Ye),a=()=>{let f=s.getContextKeyValue(bU);if(f==="automatic")return el.Automatic;if(f==="trigger")return el.Trigger;if(s.getContextKeyValue(vU)===!1)return el.Trigger;let m=i.getValue(aO);if(m==="automatic")return el.Automatic;if(m==="trigger")return el.Trigger},l=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!i.getValue(_r),[c,d]=r.invokeFunction(YE,e),h=e.paddingBottom,u=e.renderIndentGuides!==void 0?e.renderIndentGuides:i.getValue(zE);return{getTypeNavigationMode:a,disposable:d,options:{keyboardSupport:!1,...c,indent:typeof i.getValue(d1)=="number"?i.getValue(d1):void 0,renderIndentGuides:u,smoothScrolling:!!i.getValue(nl),defaultFindMode:CU(i),defaultFindMatchType:wU(i),horizontalScrolling:l,scrollByPage:!!i.getValue(il),paddingBottom:h,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(t=e.expandOnlyOnTwistieClick)!==null&&t!==void 0?t:i.getValue(VE)==="doubleClick",contextViewProvider:o,findWidgetStyles:FH,enableStickyScroll:!!i.getValue(HE),stickyScrollMaxItemCount:Number(i.getValue(UE))}}}var Yf=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,o,s,r,a){var l;this.tree=e,this.disposables=[],this.contextKeyService=GE(s,e),this.disposables.push(ZE(this.contextKeyService,e)),this.listSupportsMultiSelect=qE.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),jE.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=PQ.bindTo(this.contextKeyService),this.listSupportFindWidget.set((l=t.findWidgetEnabled)!==null&&l!==void 0?l:!0),this.hasSelectionOrFocus=nO.bindTo(this.contextKeyService),this.hasDoubleSelection=oO.bindTo(this.contextKeyService),this.hasMultiSelection=sO.bindTo(this.contextKeyService),this.treeElementCanCollapse=OQ.bindTo(this.contextKeyService),this.treeElementHasParent=FQ.bindTo(this.contextKeyService),this.treeElementCanExpand=BQ.bindTo(this.contextKeyService),this.treeElementHasChild=WQ.bindTo(this.contextKeyService),this.treeFindOpen=zQ.bindTo(this.contextKeyService),this.treeStickyScrollFocused=_U.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=dc(a),this.updateStyleOverrides(o);let d=()=>{let u=e.getFocus()[0];if(!u)return;let f=e.getNode(u);this.treeElementCanCollapse.set(f.collapsible&&!f.collapsed),this.treeElementHasParent.set(!!e.getParentElement(u)),this.treeElementCanExpand.set(f.collapsible&&f.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(u))},h=new Set;h.add(bU),h.add(vU),this.disposables.push(this.contextKeyService,r.register(e),e.onDidChangeSelection(()=>{let u=e.getSelection(),f=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(u.length>0||f.length>0),this.hasMultiSelection.set(u.length>1),this.hasDoubleSelection.set(u.length===2)})}),e.onDidChangeFocus(()=>{let u=e.getSelection(),f=e.getFocus();this.hasSelectionOrFocus.set(u.length>0||f.length>0),d()}),e.onDidChangeCollapseState(d),e.onDidChangeModel(d),e.onDidChangeFindOpenState(u=>this.treeFindOpen.set(u)),e.onDidChangeStickyScrollFocused(u=>this.treeStickyScrollFocused.set(u)),a.onDidChangeConfiguration(u=>{let f={};if(u.affectsConfiguration(Xf)&&(this._useAltAsMultipleSelectionModifier=dc(a)),u.affectsConfiguration(d1)){let g=a.getValue(d1);f={...f,indent:g}}if(u.affectsConfiguration(zE)&&t.renderIndentGuides===void 0){let g=a.getValue(zE);f={...f,renderIndentGuides:g}}if(u.affectsConfiguration(nl)){let g=!!a.getValue(nl);f={...f,smoothScrolling:g}}if(u.affectsConfiguration(rO)||u.affectsConfiguration(WE)){let g=CU(a);f={...f,defaultFindMode:g}}if(u.affectsConfiguration(aO)||u.affectsConfiguration(WE)){let g=i();f={...f,typeNavigationMode:g}}if(u.affectsConfiguration(lO)){let g=wU(a);f={...f,defaultFindMatchType:g}}if(u.affectsConfiguration(_r)&&t.horizontalScrolling===void 0){let g=!!a.getValue(_r);f={...f,horizontalScrolling:g}}if(u.affectsConfiguration(il)){let g=!!a.getValue(il);f={...f,scrollByPage:g}}if(u.affectsConfiguration(VE)&&t.expandOnlyOnTwistieClick===void 0&&(f={...f,expandOnlyOnTwistieClick:a.getValue(VE)==="doubleClick"}),u.affectsConfiguration(HE)){let g=a.getValue(HE);f={...f,enableStickyScroll:g}}if(u.affectsConfiguration(UE)){let g=Math.max(1,a.getValue(UE));f={...f,stickyScrollMaxItemCount:g}}if(u.affectsConfiguration(lc)){let g=a.getValue(lc);f={...f,mouseWheelScrollSensitivity:g}}if(u.affectsConfiguration(cc)){let g=a.getValue(cc);f={...f,fastScrollSensitivity:g}}Object.keys(f).length>0&&e.updateOptions(f)}),this.contextKeyService.onDidChangeContext(u=>{u.affectsSome(h)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new iO(e,{configurationService:a,...t}),this.disposables.push(this.navigator)}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?Uf(e):Hf)}dispose(){this.disposables=li(this.disposables)}};Yf=sd([Qt(4,rt),Qt(5,ol),Qt(6,Rt)],Yf);var HQ=Vt.as(ar.Configuration);HQ.registerConfiguration({id:"workbench",order:7,title:p("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[Xf]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[p("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),p("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:p({key:"multiSelectModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[FE]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:p({key:"openModeModifier",comment:["`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized."]},"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[_r]:{type:"boolean",default:!1,description:p("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[il]:{type:"boolean",default:!1,description:p("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[d1]:{type:"number",default:8,minimum:4,maximum:40,description:p("tree indent setting","Controls tree indentation in pixels.")},[zE]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:p("render tree indent guides","Controls whether the tree should render indent guides.")},[nl]:{type:"boolean",default:!1,description:p("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[lc]:{type:"number",default:1,markdownDescription:p("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[cc]:{type:"number",default:5,markdownDescription:p("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[rO]:{type:"string",enum:["highlight","filter"],enumDescriptions:[p("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),p("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:p("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[WE]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[p("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),p("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),p("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:p("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:p("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[lO]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[p("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),p("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:p("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[VE]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:p("expand mode","Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[HE]:{type:"boolean",default:!0,description:p("sticky scroll","Controls whether sticky scrolling is enabled in trees.")},[UE]:{type:"number",minimum:1,default:7,markdownDescription:p("sticky scroll maximum items","Controls the number of sticky elements displayed in the tree when `#workbench.tree.enableStickyScroll#` is enabled.")},[aO]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:p("typeNavigationMode2","Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});Qi();le();oo();Lt();_();v();b();ke();_();v();b();ke();Ef();le();hs();var Uh=class n extends H{constructor(e,t){var i;super(),this.options=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=(i=t?.supportIcons)!==null&&i!==void 0?i:!1,this.domNode=me(e,ve("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",o){e||(e=""),o&&(e=n.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&hn(this.highlights,t))&&(this.text=e,this.title=i,this.highlights=t,this.render())}render(){var e,t,i,o;let s=[],r=0;for(let a of this.highlights){if(a.end===a.start)continue;if(r{o=s===`\r +`?-1:0,r+=i;for(let a of t)a.end<=r||(a.start>=r&&(a.start+=o),a.end>=r&&(a.end+=o));return i+=o,"\u23CE"})}};le();hs();xi();xp();var Qf=class{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}},f1=class extends H{constructor(e,t){var i;super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new Qf(me(e,ve(".monaco-icon-label")))),this.labelContainer=me(this.domNode.element,ve(".monaco-icon-label-container")),this.nameContainer=me(this.labelContainer,ve("span.monaco-icon-name-container")),t?.supportHighlights||t?.supportIcons?this.nameNode=this._register(new dO(this.nameContainer,!!t.supportIcons)):this.nameNode=new cO(this.nameContainer),this.hoverDelegate=(i=t?.hoverDelegate)!==null&&i!==void 0?i:ji("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){var o;let s=["monaco-icon-label"],r=["monaco-icon-label-container"],a="";if(i&&(i.extraClasses&&s.push(...i.extraClasses),i.italic&&s.push("italic"),i.strikethrough&&s.push("strikethrough"),i.disabledCommand&&r.push("disabled"),i.title&&(typeof i.title=="string"?a+=i.title:a+=e)),this.domNode.className=s.join(" "),this.domNode.element.setAttribute("aria-label",a),this.labelContainer.className=r.join(" "),this.setupHover(i?.descriptionTitle?this.labelContainer:this.element,i?.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){let l=this.getOrCreateDescriptionNode();l instanceof Uh?(l.set(t||"",i?i.descriptionMatches:void 0,void 0,i?.labelEscapeNewLines),this.setupHover(l.element,i?.descriptionTitle)):(l.textContent=t&&i?.labelEscapeNewLines?Uh.escapeNewLines(t,[]):t||"",this.setupHover(l.element,i?.descriptionTitle||""),l.empty=!t)}if(i?.suffix||this.suffixNode){let l=this.getOrCreateSuffixNode();l.textContent=(o=i?.suffix)!==null&&o!==void 0?o:""}}setupHover(e,t){let i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(this.hoverDelegate.showNativeHover){let s=function(r,a){tn(a)?r.title=pD(a):a?.markdownNotSupportedFallback?r.title=a.markdownNotSupportedFallback:r.removeAttribute("title")};var o=s;s(e,t)}else{let s=Qn().setupUpdatableHover(this.hoverDelegate,e,t);s&&this.customHovers.set(e,s)}}dispose(){super.dispose();for(let e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){let e=this._register(new Qf(q7(this.nameContainer,ve("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new Qf(me(e.element,ve("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){let t=this._register(new Qf(me(this.labelContainer,ve("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=this._register(new Uh(me(t.element,ve("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons})):this.descriptionNode=this._register(new Qf(me(t.element,ve("span.label-description"))))}return this.descriptionNode}},cO=class{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&hn(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=me(this.container,ve("a.label-name",{id:t?.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i{let s={start:i,end:i+o.length},r=t.map(a=>cn.intersect(s,a)).filter(a=>!cn.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=s.end+e.length,r})}var dO=class extends H{constructor(e,t){super(),this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&hn(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=this._register(new Uh(me(this.container,ve("a.label-name",{id:t?.domId})),{supportIcons:this.supportIcons}))),this.singleLabel.set(e,t?.matches,void 0,t?.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;let i=t?.separator||"/",o=UQ(e,i,t?.matches);for(let s=0;s{let n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:n,collatorIsNumeric:n.resolvedOptions().numeric}}),Olt=new qn(()=>({collator:new Intl.Collator(void 0,{numeric:!0})})),Flt=new qn(()=>({collator:new Intl.Collator(void 0,{numeric:!0,sensitivity:"accent"})}));function KQ(n,e,t=!1){let i=n||"",o=e||"",s=yU.value.collator.compare(i,o);return yU.value.collatorIsNumeric&&s===0&&i!==o?io.length)return 1}return 0}ot();Gt();xt();var t2=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},LU=function(n,e){return function(t,i){e(t,i,n)}},hO,sl=ve,Ui;(function(n){n[n.First=1]="First",n[n.Second=2]="Second",n[n.Last=3]="Last",n[n.Next=4]="Next",n[n.Previous=5]="Previous",n[n.NextPage=6]="NextPage",n[n.PreviousPage=7]="PreviousPage",n[n.NextSeparator=8]="NextSeparator",n[n.PreviousSeparator=9]="PreviousSeparator"})(Ui||(Ui={}));var JE=class{constructor(e,t,i){this.index=e,this.hasCheckbox=t,this._hidden=!1,this._init=new qn(()=>{var o;let s=(o=i.label)!==null&&o!==void 0?o:"",r=Sp(s).text.trim(),a=i.ariaLabel||[s,this.saneDescription,this.saneDetail].map(l=>EV(l)).filter(l=>!!l).join(", ");return{saneLabel:s,saneSortLabel:r,saneAriaLabel:a}}),this._saneDescription=i.description,this._saneTooltip=i.tooltip}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get saneDescription(){return this._saneDescription}set saneDescription(e){this._saneDescription=e}get saneDetail(){return this._saneDetail}set saneDetail(e){this._saneDetail=e}get saneTooltip(){return this._saneTooltip}set saneTooltip(e){this._saneTooltip=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}},to=class extends JE{constructor(e,t,i,o,s,r){var a,l,c;super(e,t,s),this.fireButtonTriggered=i,this._onChecked=o,this.item=s,this._separator=r,this._checked=!1,this.onChecked=t?ie.map(ie.filter(this._onChecked.event,d=>d.element===this),d=>d.checked):ie.None,this._saneDetail=s.detail,this._labelHighlights=(a=s.highlights)===null||a===void 0?void 0:a.label,this._descriptionHighlights=(l=s.highlights)===null||l===void 0?void 0:l.description,this._detailHighlights=(c=s.highlights)===null||c===void 0?void 0:c.detail}get separator(){return this._separator}set separator(e){this._separator=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({element:this,checked:e}))}get checkboxDisabled(){return!!this.item.disabled}},hc;(function(n){n[n.NONE=0]="NONE",n[n.MOUSE_HOVER=1]="MOUSE_HOVER",n[n.ACTIVE_ITEM=2]="ACTIVE_ITEM"})(hc||(hc={}));var uc=class extends JE{constructor(e,t,i){super(e,!1,i),this.fireSeparatorButtonTriggered=t,this.separator=i,this.children=new Array,this.focusInsideSeparator=hc.NONE}},uO=class{getHeight(e){return e instanceof uc?30:e.saneDetail?44:22}getTemplateId(e){return e instanceof to?g1.ID:m1.ID}},fO=class{getWidgetAriaLabel(){return p("quickInput","Quick Input")}getAriaLabel(e){var t;return!((t=e.separator)===null||t===void 0)&&t.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(!(!e.hasCheckbox||!(e instanceof to)))return{get value(){return e.checked},onDidChange:t=>e.onChecked(()=>t())}}},e2=class{constructor(e){this.hoverDelegate=e}renderTemplate(e){let t=Object.create(null);t.toDisposeElement=new ae,t.toDisposeTemplate=new ae,t.entry=me(e,sl(".quick-input-list-entry"));let i=me(t.entry,sl("label.quick-input-list-label"));t.toDisposeTemplate.add(Ut(i,se.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=me(i,sl("input.quick-input-list-checkbox")),t.checkbox.type="checkbox";let o=me(i,sl(".quick-input-list-rows")),s=me(o,sl(".quick-input-list-row")),r=me(o,sl(".quick-input-list-row"));t.label=new f1(s,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.label),t.icon=Ug(t.label.element,sl(".quick-input-list-icon"));let a=me(s,sl(".quick-input-list-entry-keybinding"));t.keybinding=new QE(a,po),t.toDisposeTemplate.add(t.keybinding);let l=me(r,sl(".quick-input-list-label-meta"));return t.detail=new f1(l,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.detail),t.separator=me(t.entry,sl(".quick-input-list-separator")),t.actionBar=new Eo(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.add(t.actionBar),t}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}disposeElement(e,t,i){i.toDisposeElement.clear(),i.actionBar.clear()}},g1=hO=class extends e2{constructor(e,t){super(e),this.themeService=t,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return hO.ID}renderTemplate(e){let t=super.renderTemplate(e);return t.toDisposeTemplate.add(Ut(t.checkbox,se.CHANGE,i=>{t.element.checked=t.checkbox.checked})),t}renderElement(e,t,i){var o,s,r;let a=e.element;i.element=a,a.element=(o=i.entry)!==null&&o!==void 0?o:void 0;let l=a.item;i.checkbox.checked=a.checked,i.toDisposeElement.add(a.onChecked(m=>i.checkbox.checked=m)),i.checkbox.disabled=a.checkboxDisabled;let{labelHighlights:c,descriptionHighlights:d,detailHighlights:h}=a;if(l.iconPath){let m=Qu(this.themeService.getColorTheme().type)?l.iconPath.dark:(s=l.iconPath.light)!==null&&s!==void 0?s:l.iconPath.dark,C=Oe.revive(m);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=Mr(C)}else i.icon.style.backgroundImage="",i.icon.className=l.iconClass?`quick-input-list-icon ${l.iconClass}`:"";let u;!a.saneTooltip&&a.saneDescription&&(u={markdown:{value:a.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:a.saneDescription});let f={matches:c||[],descriptionTitle:u,descriptionMatches:d||[],labelEscapeNewLines:!0};if(f.extraClasses=l.iconClasses,f.italic=l.italic,f.strikethrough=l.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item"),i.label.setLabel(a.saneLabel,a.saneDescription,f),i.keybinding.set(l.keybinding),a.saneDetail){let m;a.saneTooltip||(m={markdown:{value:a.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:a.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(a.saneDetail,void 0,{matches:h,title:m,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";!((r=a.separator)===null||r===void 0)&&r.label?(i.separator.textContent=a.separator.label,i.separator.style.display="",this.addItemWithSeparator(a)):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!a.separator);let g=l.buttons;g&&g.length?(i.actionBar.push(g.map((m,C)=>Qp(m,`id-${C}`,()=>a.fireButtonTriggered({button:m,item:a.item}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){this.removeItemWithSeparator(e.element),super.disposeElement(e,t,i)}isItemWithSeparatorVisible(e){return this._itemsWithSeparatorsFrequency.has(e)}addItemWithSeparator(e){this._itemsWithSeparatorsFrequency.set(e,(this._itemsWithSeparatorsFrequency.get(e)||0)+1)}removeItemWithSeparator(e){let t=this._itemsWithSeparatorsFrequency.get(e)||0;t>1?this._itemsWithSeparatorsFrequency.set(e,t-1):this._itemsWithSeparatorsFrequency.delete(e)}};g1.ID="quickpickitem";g1=hO=t2([LU(1,an)],g1);var m1=class n extends e2{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}get templateId(){return n.ID}get visibleSeparators(){return[...this._visibleSeparatorsFrequency.keys()]}isSeparatorVisible(e){return this._visibleSeparatorsFrequency.has(e)}renderElement(e,t,i){var o;let s=e.element;i.element=s,s.element=(o=i.entry)!==null&&o!==void 0?o:void 0,s.element.classList.toggle("focus-inside",!!s.focusInsideSeparator);let r=s.separator,{labelHighlights:a,descriptionHighlights:l,detailHighlights:c}=s;i.icon.style.backgroundImage="",i.icon.className="";let d;!s.saneTooltip&&s.saneDescription&&(d={markdown:{value:s.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDescription});let h={matches:a||[],descriptionTitle:d,descriptionMatches:l||[],labelEscapeNewLines:!0};if(i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(s.saneLabel,s.saneDescription,h),s.saneDetail){let f;s.saneTooltip||(f={markdown:{value:s.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(s.saneDetail,void 0,{matches:c,title:f,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";i.separator.style.display="none",i.entry.classList.add("quick-input-list-separator-border");let u=r.buttons;u&&u.length?(i.actionBar.push(u.map((f,g)=>Qp(f,`id-${g}`,()=>s.fireSeparatorButtonTriggered({button:f,separator:s.separator}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions"),this.addSeparator(s)}disposeElement(e,t,i){var o;this.removeSeparator(e.element),this.isSeparatorVisible(e.element)||(o=e.element.element)===null||o===void 0||o.classList.remove("focus-inside"),super.disposeElement(e,t,i)}addSeparator(e){this._visibleSeparatorsFrequency.set(e,(this._visibleSeparatorsFrequency.get(e)||0)+1)}removeSeparator(e){let t=this._visibleSeparatorsFrequency.get(e)||0;t>1?this._visibleSeparatorsFrequency.set(e,t-1):this._visibleSeparatorsFrequency.delete(e)}};m1.ID="quickpickseparator";var o_=class extends H{constructor(e,t,i,o,s){super(),this.parent=e,this.hoverDelegate=t,this.linkOpenerDelegate=i,this._onKeyDown=new B,this.onKeyDown=this._onKeyDown.event,this._onLeave=new B,this.onLeave=this._onLeave.event,this._onChangedAllVisibleChecked=new B,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new B,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new B,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new B,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new B,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new B,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onTriggerEmptySelectionOrFocus=new B,this._elementChecked=new B,this._inputElements=new Array,this._elementTree=new Array,this._itemElements=new Array,this._elementDisposable=this._register(new ae),this._shouldFireCheckedEvents=!0,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._container=me(this.parent,sl(".quick-input-list")),this._separatorRenderer=new m1(t),this._itemRenderer=s.createInstance(g1,t),this._tree=this._register(s.createInstance($E,"QuickInput",this._container,new uO,[this._itemRenderer,this._separatorRenderer],{accessibilityProvider:new fO,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:Gf.None,findWidgetEnabled:!1,indent:0,horizontalScrolling:!1,allowNonCollapsibleParents:!0,identityProvider:{getId:r=>{let a=r.item||r.separator;if(a===void 0)return"";if(a.id!==void 0)return a.id;let l=`label:${a.label}`;return l+=`$$description:${a.description}`,a.type!=="separator"&&(l+=`$$detail:${a.detail}`),l}},alwaysConsumeMouseWheel:!0})),this._tree.getHTMLElement().id=o,this._registerListeners()}get onDidChangeFocus(){return ie.map(ie.any(this._tree.onDidChangeFocus,this._onTriggerEmptySelectionOrFocus.event),e=>e.elements.filter(t=>t instanceof to).map(t=>t.item))}get onDidChangeSelection(){return ie.map(ie.any(this._tree.onDidChangeSelection,this._onTriggerEmptySelectionOrFocus.event),e=>({items:e.elements.filter(t=>t instanceof to).map(t=>t.item),event:e.browserEvent}))}get scrollTop(){return this._tree.scrollTop}set scrollTop(e){this._tree.scrollTop=e}get ariaLabel(){return this._tree.ariaLabel}set ariaLabel(e){this._tree.ariaLabel=e??""}set enabled(e){this._tree.getHTMLElement().style.pointerEvents=e?"":"none"}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}_registerListeners(){this._registerOnKeyDown(),this._registerOnContainerClick(),this._registerOnMouseMiddleClick(),this._registerOnElementChecked(),this._registerOnContextMenu(),this._registerHoverListeners(),this._registerSelectionChangeListener(),this._registerSeparatorActionShowingListeners()}_registerOnKeyDown(){this._register(this._tree.onKeyDown(e=>{let t=new bt(e);switch(t.keyCode){case 10:this.toggleCheckbox();break;case 31:(Be?e.metaKey:e.ctrlKey)&&this._tree.setFocus(this._itemElements);break;case 16:{let i=this._tree.getFocus();i.length===1&&i[0]===this._itemElements[0]&&this._onLeave.fire();break}case 18:{let i=this._tree.getFocus();i.length===1&&i[0]===this._itemElements[this._itemElements.length-1]&&this._onLeave.fire();break}}this._onKeyDown.fire(t)}))}_registerOnContainerClick(){this._register($(this._container,se.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()}))}_registerOnMouseMiddleClick(){this._register($(this._container,se.AUXCLICK,e=>{e.button===1&&this._onLeave.fire()}))}_registerOnElementChecked(){this._register(this._elementChecked.event(e=>this._fireCheckedEvents()))}_registerOnContextMenu(){this._register(this._tree.onContextMenu(e=>{e.element&&(e.browserEvent.preventDefault(),this._tree.setSelection([e.element]))}))}_registerHoverListeners(){let e=this._register(new Pg(this.hoverDelegate.delay));this._register(this._tree.onMouseOver(async t=>{var i;if(t.browserEvent.target instanceof HTMLAnchorElement){e.cancel();return}if(!(!(t.browserEvent.relatedTarget instanceof HTMLAnchorElement)&&yi(t.browserEvent.relatedTarget,(i=t.element)===null||i===void 0?void 0:i.element)))try{await e.trigger(async()=>{t.element instanceof to&&this.showHover(t.element)})}catch(o){if(!yd(o))throw o}})),this._register(this._tree.onMouseOut(t=>{var i;yi(t.browserEvent.relatedTarget,(i=t.element)===null||i===void 0?void 0:i.element)||e.cancel()}))}_registerSeparatorActionShowingListeners(){this._register(this._tree.onDidChangeFocus(e=>{let t=e.elements[0]?this._tree.getParentElement(e.elements[0]):null;for(let i of this._separatorRenderer.visibleSeparators){let o=i===t;!!(i.focusInsideSeparator&hc.ACTIVE_ITEM)!==o&&(o?i.focusInsideSeparator|=hc.ACTIVE_ITEM:i.focusInsideSeparator&=~hc.ACTIVE_ITEM,this._tree.rerender(i))}})),this._register(this._tree.onMouseOver(e=>{let t=e.element?this._tree.getParentElement(e.element):null;for(let i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&hc.MOUSE_HOVER)||(i.focusInsideSeparator|=hc.MOUSE_HOVER,this._tree.rerender(i))}})),this._register(this._tree.onMouseOut(e=>{let t=e.element?this._tree.getParentElement(e.element):null;for(let i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&hc.MOUSE_HOVER)&&(i.focusInsideSeparator&=~hc.MOUSE_HOVER,this._tree.rerender(i))}}))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection(e=>{let t=e.elements.filter(i=>i instanceof to);t.length!==e.elements.length&&(e.elements.length===1&&e.elements[0]instanceof uc&&(this._tree.setFocus([e.elements[0].children[0]]),this._tree.reveal(e.elements[0],0)),this._tree.setSelection(t))}))}getAllVisibleChecked(){return this._allVisibleChecked(this._itemElements,!1)}getCheckedCount(){return this._itemElements.filter(e=>e.checked).length}getVisibleCount(){return this._itemElements.filter(e=>!e.hidden).length}setAllVisibleChecked(e){try{this._shouldFireCheckedEvents=!1,this._itemElements.forEach(t=>{!t.hidden&&!t.checkboxDisabled&&(t.checked=e)})}finally{this._shouldFireCheckedEvents=!0,this._fireCheckedEvents()}}setElements(e){this._elementDisposable.clear(),this._inputElements=e;let t=this.parent.classList.contains("show-checkboxes"),i;this._itemElements=new Array,this._elementTree=e.reduce((r,a,l)=>{let c;if(a.type==="separator"){if(!a.buttons)return r;i=new uc(l,d=>this.fireSeparatorButtonTriggered(d),a),c=i}else{let d=l>0?e[l-1]:void 0,h;d&&d.type==="separator"&&!d.buttons&&(i=void 0,h=d);let u=new to(l,t,f=>this.fireButtonTriggered(f),this._elementChecked,a,h);if(this._itemElements.push(u),i)return i.children.push(u),r;c=u}return r.push(c),r},new Array);let o=new Array,s=0;for(let r of this._elementTree)r instanceof uc?(o.push({element:r,collapsible:!1,collapsed:!1,children:r.children.map(a=>({element:a,collapsible:!1,collapsed:!1}))}),s+=r.children.length+1):(o.push({element:r,collapsible:!1,collapsed:!1}),s++);this._tree.setChildren(null,o),this._onChangedVisibleCount.fire(s)}setFocusedElements(e){let t=e.map(i=>this._itemElements.find(o=>o.item===i)).filter(i=>!!i);if(this._tree.setFocus(t),e.length>0){let i=this._tree.getFocus()[0];i&&this._tree.reveal(i)}}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){let t=e.map(i=>this._itemElements.find(o=>o.item===i)).filter(i=>!!i);this._tree.setSelection(t)}getCheckedElements(){return this._itemElements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){try{this._shouldFireCheckedEvents=!1;let t=new Set;for(let i of e)t.add(i);for(let i of this._itemElements)i.checked=t.has(i.item)}finally{this._shouldFireCheckedEvents=!0,this._fireCheckedEvents()}}focus(e){var t;if(this._itemElements.length)switch(e===Ui.Second&&this._itemElements.length<2&&(e=Ui.First),e){case Ui.First:this._tree.scrollTop=0,this._tree.focusFirst(void 0,i=>i.element instanceof to);break;case Ui.Second:this._tree.scrollTop=0,this._tree.setFocus([this._itemElements[1]]);break;case Ui.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.setFocus([this._itemElements[this._itemElements.length-1]]);break;case Ui.Next:this._tree.focusNext(void 0,!0,void 0,i=>i.element instanceof to?(this._tree.reveal(i.element),!0):!1);break;case Ui.Previous:this._tree.focusPrevious(void 0,!0,void 0,i=>{if(!(i.element instanceof to))return!1;let o=this._tree.getParentElement(i.element);return o===null||o.children[0]!==i.element?this._tree.reveal(i.element):this._tree.reveal(o),!0});break;case Ui.NextPage:this._tree.focusNextPage(void 0,i=>i.element instanceof to?(this._tree.reveal(i.element),!0):!1);break;case Ui.PreviousPage:this._tree.focusPreviousPage(void 0,i=>{if(!(i.element instanceof to))return!1;let o=this._tree.getParentElement(i.element);return o===null||o.children[0]!==i.element?this._tree.reveal(i.element):this._tree.reveal(o),!0});break;case Ui.NextSeparator:{let i=!1,o=this._tree.getFocus()[0];this._tree.focusNext(void 0,!0,void 0,r=>{if(i)return!0;if(r.element instanceof uc)i=!0,this._separatorRenderer.isSeparatorVisible(r.element)?this._tree.reveal(r.element.children[0]):this._tree.reveal(r.element,0);else if(r.element instanceof to){if(r.element.separator)return this._itemRenderer.isItemWithSeparatorVisible(r.element)?this._tree.reveal(r.element):this._tree.reveal(r.element,0),!0;if(r.element===this._elementTree[0])return this._tree.reveal(r.element,0),!0}return!1});let s=this._tree.getFocus()[0];o===s&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.setFocus([this._itemElements[this._itemElements.length-1]]));break}case Ui.PreviousSeparator:{let i,o=!!(!((t=this._tree.getFocus()[0])===null||t===void 0)&&t.separator);this._tree.focusPrevious(void 0,!0,void 0,s=>{if(s.element instanceof uc)o?i||(this._separatorRenderer.isSeparatorVisible(s.element)?this._tree.reveal(s.element):this._tree.reveal(s.element,0),i=s.element.children[0]):o=!0;else if(s.element instanceof to&&!i){if(s.element.separator)this._itemRenderer.isItemWithSeparatorVisible(s.element)?this._tree.reveal(s.element):this._tree.reveal(s.element,0),i=s.element;else if(s.element===this._elementTree[0])return this._tree.reveal(s.element,0),!0}return!1}),i&&this._tree.setFocus([i]);break}}}clearFocus(){this._tree.setFocus([])}domFocus(){this._tree.domFocus()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this._tree.layout()}filter(e){if(!(this._sortByLabel||this._matchOnLabel||this._matchOnDescription||this._matchOnDetail))return this._tree.layout(),!1;let t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this._itemElements.forEach(l=>{l.labelHighlights=void 0,l.descriptionHighlights=void 0,l.detailHighlights=void 0,l.hidden=!1;let c=l.index&&this._inputElements[l.index-1];l.item&&(l.separator=c&&c.type==="separator"&&!c.buttons?c:void 0)});else{let l;this._elementTree.forEach(c=>{var d,h,u,f;let g;this.matchOnLabelMode==="fuzzy"?g=this.matchOnLabel&&(d=_D(e,Sp(c.saneLabel)))!==null&&d!==void 0?d:void 0:g=this.matchOnLabel&&(h=qQ(t,Sp(c.saneLabel)))!==null&&h!==void 0?h:void 0;let m=this.matchOnDescription&&(u=_D(e,Sp(c.saneDescription||"")))!==null&&u!==void 0?u:void 0,C=this.matchOnDetail&&(f=_D(e,Sp(c.saneDetail||"")))!==null&&f!==void 0?f:void 0;if(g||m||C?(c.labelHighlights=g,c.descriptionHighlights=m,c.detailHighlights=C,c.hidden=!1):(c.labelHighlights=void 0,c.descriptionHighlights=void 0,c.detailHighlights=void 0,c.hidden=c.item?!c.item.alwaysShow:!0),c.item?c.separator=void 0:c.separator&&(c.hidden=!0),!this.sortByLabel){let S=c.index&&this._inputElements[c.index-1];l=S&&S.type==="separator"?S:l,l&&!c.hidden&&(c.separator=l,l=void 0)}})}let i=this._elementTree.filter(l=>!l.hidden);if(this.sortByLabel&&e){let l=e.toLowerCase();i.sort((c,d)=>jQ(c,d,l))}let o,s=i.reduce((l,c,d)=>(c instanceof to?o?o.children.push(c):l.push(c):c instanceof uc&&(c.children=[],o=c,l.push(c)),l),new Array),r=new Array;for(let l of s)l instanceof uc?r.push({element:l,collapsible:!1,collapsed:!1,children:l.children.map(c=>({element:c,collapsible:!1,collapsed:!1}))}):r.push({element:l,collapsible:!1,collapsed:!1});let a=this._tree.getFocus().length;return this._tree.setChildren(null,r),a>0&&r.length===0&&this._onTriggerEmptySelectionOrFocus.fire({elements:[]}),this._tree.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(i.length),!0}toggleCheckbox(){try{this._shouldFireCheckedEvents=!1;let e=this._tree.getFocus().filter(i=>i instanceof to),t=this._allVisibleChecked(e);for(let i of e)i.checkboxDisabled||(i.checked=!t)}finally{this._shouldFireCheckedEvents=!0,this._fireCheckedEvents()}}display(e){this._container.style.display=e?"":"none"}isDisplayed(){return this._container.style.display!=="none"}style(e){this._tree.style(e)}toggleHover(){let e=this._tree.getFocus()[0];if(!e?.saneTooltip||!(e instanceof to))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}this.showHover(e);let t=new ae;t.add(this._tree.onDidChangeFocus(i=>{i.elements[0]instanceof to&&this.showHover(i.elements[0])})),this._lastHover&&t.add(this._lastHover),this._elementDisposable.add(t)}_allVisibleChecked(e,t=!0){for(let i=0,o=e.length;i{this.linkOpenerDelegate(s)},appearance:{showPointer:!0},container:this._container,position:{hoverPosition:1}},!1))}};t2([Yt],o_.prototype,"onDidChangeFocus",null);t2([Yt],o_.prototype,"onDidChangeSelection",null);o_=t2([LU(4,Ye)],o_);function qQ(n,e){let{text:t,iconOffsets:i}=e;if(!i||i.length===0)return xU(n,t);let o=Sc(t," "),s=t.length-o.length,r=xU(n,o);if(r)for(let a of r){let l=i[a.start+s]+s;a.start+=l,a.end+=l}return r}function xU(n,e){let t=e.toLowerCase().indexOf(n.toLowerCase());return t!==-1?[{start:t,end:t+n.length}]:null}function jQ(n,e,t){let i=n.labelHighlights||[],o=e.labelHighlights||[];return i.length&&!o.length?-1:!i.length&&o.length?1:i.length===0&&o.length===0?0:SU(n.saneSortLabel,e.saneSortLabel,t)}var GQ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},kU=function(n,e){return function(t,i){e(t,i,n)}},i2={iconClass:Xe.asClassName(ue.quickInputBack),tooltip:p("quickInput.back","Back"),handle:-1},p1=class n extends H{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=n.noPromptMessage,this._severity=Ci.Ignore,this.onDidTriggerButtonEmitter=this._register(new B),this.onDidHideEmitter=this._register(new B),this.onWillHideEmitter=this._register(new B),this.onDisposeEmitter=this._register(new B),this.visibleDisposables=this._register(new ae),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){let t=this._ignoreFocusOut!==e&&!Rs;this._ignoreFocusOut=e&&!Rs,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=Wh.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=Wh.Other){this.onWillHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;let i=this.getTitle();i&&this.ui.title.textContent!==i?this.ui.title.textContent=i:!i&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText="\xA0");let o=this.getDescription();if(this.ui.description1.textContent!==o&&(this.ui.description1.textContent=o),this.ui.description2.textContent!==o&&(this.ui.description2.textContent=o),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?Wi(this.ui.widget,this._widget):Wi(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new Xo,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();let r=this.buttons.filter(l=>l===i2).map((l,c)=>Qp(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.leftActionBar.push(r,{icon:!0,label:!1}),this.ui.rightActionBar.clear();let a=this.buttons.filter(l=>l!==i2).map((l,c)=>Qp(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.rightActionBar.push(a,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;let r=(t=(e=this.toggles)===null||e===void 0?void 0:e.filter(a=>a instanceof nd))!==null&&t!==void 0?t:[];this.ui.inputBox.toggles=r}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);let s=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==s&&(this._lastValidationMessage=s,Wi(this.ui.message),JH(s,this.ui.message,{callback:r=>{this.ui.linkOpenerDelegate(r)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?p("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==Ci.Ignore){let t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}};p1.noPromptMessage=p("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");var s_=class n extends p1{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new B),this.onWillAcceptEmitter=this._register(new B),this.onDidAcceptEmitter=this._register(new B),this.onDidCustomEmitter=this._register(new B),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._keepScrollPosition=!1,this._itemActivation=la.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new B),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new B),this.onDidTriggerItemButtonEmitter=this._register(new B),this.onDidTriggerSeparatorButtonEmitter=this._register(new B),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?YH:this.ui.keyMods}get valueSelection(){let e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(Ui.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18:this.quickNavigate===void 0&&(Be?e.metaKey:e.altKey)?this.ui.list.focus(Ui.NextSeparator):this.ui.list.focus(Ui.Next),this.canSelectMany&&this.ui.list.domFocus(),He.stop(e,!0);break;case 16:this.quickNavigate===void 0&&(Be?e.metaKey:e.altKey)?this.ui.list.focus(Ui.PreviousSeparator):this.ui.list.focus(Ui.Previous),this.canSelectMany&&this.ui.list.domFocus(),He.stop(e,!0);break;case 12:this.ui.list.focus(Ui.NextPage),this.canSelectMany&&this.ui.list.domFocus(),He.stop(e,!0);break;case 11:this.ui.list.focus(Ui.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),He.stop(e,!0);break;case 17:if(!this._canAcceptInBackground||!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Ui.First),He.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(Ui.Last),He.stop(e,!0));break}})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this.ui.list.onDidChangeFocus(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Ht(e,this._activeItems,(t,i)=>t===i)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&Ht(e,this._selectedItems,(i,o)=>i===o)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(Hg(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&Ht(e,this._selectedItems,(t,i)=>t===i)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return $(this.ui.container,se.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;let t=new bt(e),i=t.keyCode;this._quickNavigate.keybindings.some(r=>{let a=r.getChords();return a.length>1?!1:a[0].shiftKey&&i===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&i===6||a[0].ctrlKey&&i===5||a[0].metaKey&&i===57)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;let e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let o=this.ariaLabel;if(!o&&i.inputBox&&(o=this.placeholder||n.DEFAULT_ARIA_LABEL,this.title&&(o+=` - ${this.title}`)),this.ui.list.ariaLabel!==o&&(this.ui.list.ariaLabel=o??null),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated){this.itemsUpdated=!1;let s=this._activeItems;switch(this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case la.NONE:s.length>0&&(this._activeItems=[],this.onDidChangeActiveEmitter.fire(this._activeItems)),this._itemActivation=la.FIRST;break;case la.SECOND:this.ui.list.focus(Ui.Second),this._itemActivation=la.FIRST;break;case la.LAST:this.ui.list.focus(Ui.Last),this._itemActivation=la.FIRST;break;default:this.trySelectFirst();break}}this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Ui.First)),this.keepScrollPosition&&(this.scrollTop=e)}};s_.DEFAULT_ARIA_LABEL=p("quickInputBox.ariaLabel","Type to narrow down results.");var n2=class extends p1{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new B),this.onDidAcceptEmitter=this._register(new B),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");let e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}},o2=class extends xh{constructor(e,t){super("element",!1,i=>this.getOverrideOptions(i),e,t)}getOverrideOptions(e){var t;let i=(e.content instanceof HTMLElement?(t=e.content.textContent)!==null&&t!==void 0?t:"":typeof e.content=="string"?e.content:e.content.value).includes(` +`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:i,skipFadeInAnimation:!0}}}};o2=GQ([kU(0,Rt),kU(1,Lh)],o2);_();v();b();ke();_();v();b();ke();Fw();oo();Ef();gn();ye();Lp();le();Ln();var edt={buttonBackground:"#0E639C",buttonHoverBackground:"#006BB3",buttonSeparator:Z.white.toString(),buttonForeground:Z.white.toString(),buttonBorder:void 0,buttonSecondaryBackground:void 0,buttonSecondaryForeground:void 0,buttonSecondaryHoverBackground:void 0},Jf=class extends H{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new B),this._onDidEscape=this._register(new B),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);let i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,o=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=o||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),typeof t.title=="string"&&this.setTitle(t.title),typeof t.ariaLabel=="string"&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this._register(ui.addTarget(this._element)),[se.CLICK,It.Tap].forEach(s=>{this._register($(this._element,s,r=>{if(!this.enabled){He.stop(r);return}this._onDidClick.fire(r)}))}),this._register($(this._element,se.KEY_DOWN,s=>{let r=new bt(s),a=!1;this.enabled&&(r.equals(3)||r.equals(10))?(this._onDidClick.fire(s),a=!0):r.equals(9)&&(this._onDidEscape.fire(s),this._element.blur(),a=!0),a&&He.stop(r,!0)})),this._register($(this._element,se.MOUSE_OVER,s=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register($(this._element,se.MOUSE_OUT,s=>{this.updateBackground(!1)})),this.focusTracker=this._register(Ic(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){let t=[];for(let i of ra(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;let o=document.createElement("span");o.textContent=i,t.push(o)}else t.push(i);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){var t;if(this._label===e||ic(this._label)&&ic(e)&&IV(this._label,e))return;this._element.classList.add("monaco-text-button");let i=this.options.supportShortLabel?this._labelElement:this._element;if(ic(e)){let s=kp(e,{inline:!0});s.dispose();let r=(t=s.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(r){let a=Pw(r,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});i.innerHTML=a}else Wi(i)}else this.options.supportIcons?Wi(i,...this.getContentElements(e)):i.textContent=e;let o="";typeof this.options.title=="string"?o=this.options.title:this.options.title&&(o=PV(e)),this.setTitle(o),typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):this.options.ariaLabel&&this._element.setAttribute("aria-label",o),this._label=e}get label(){return this._label}set icon(e){this._element.classList.add(...Xe.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}setTitle(e){var t;!this._hover&&e!==""?this._hover=this._register(Qn().setupUpdatableHover((t=this.options.hoverDelegate)!==null&&t!==void 0?t:ji("mouse"),this._element,e)):this._hover&&this._hover.update(e)}};_();v();b();ke();ot();var _1=class{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=me(e,ve(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){var e,t;this.element.textContent=du(this.countFormat,this.count),this.element.title=du(this.titleFormat,this.count),this.element.style.backgroundColor=(e=this.styles.badgeBackground)!==null&&e!==void 0?e:"",this.element.style.color=(t=this.styles.badgeForeground)!==null&&t!==void 0?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}};_();v();b();ke();Gt();le();var DU="done",EU="active",gO="infinite",mO="infinite-long-running",IU="discrete",b1=class n extends H{constructor(e,t){super(),this.progressSignal=this._register(new no),this.workedVal=0,this.showDelayedScheduler=this._register(new di(()=>b0(this.element),0)),this.longRunningScheduler=this._register(new di(()=>this.infiniteLongRunning(),n.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=t?.progressBarBackground||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(EU,gO,mO,IU),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel(),this.progressSignal.clear()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(DU),this.element.classList.contains(gO)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(IU,DU,mO),this.element.classList.add(EU,gO),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(mO)}getContainer(){return this.element}};b1.LONG_RUNNING_INFINITE_THRESHOLD=1e4;fs();ye();le();Ge();_();v();b();ke();le();var ZQ=ve,s2=class extends H{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=s=>Ut(this.findInput.inputBox.inputElement,se.KEY_DOWN,s),this.onDidChange=s=>this.findInput.onDidChange(s),this.container=me(this.parent,ZQ(".quick-input-box")),this.findInput=this._register(new s1(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));let o=this.findInput.inputBox.inputElement;o.role="combobox",o.ariaHasPopup="menu",o.ariaAutoComplete="list",o.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}getSelection(){return this.findInput.inputBox.getSelection()}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===Ci.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===Ci.Info?1:e===Ci.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===Ci.Info?1:e===Ci.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}};vo();qe();var YQ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},TU=function(n,e){return function(t,i){e(t,i,n)}},pO,Is=ve,v1=pO=class extends H{get container(){return this._container}constructor(e,t,i){super(),this.options=e,this.layoutService=t,this.instantiationService=i,this.enabled=!0,this.onDidAcceptEmitter=this._register(new B),this.onDidCustomEmitter=this._register(new B),this.onDidTriggerButtonEmitter=this._register(new B),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new B),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new B),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(ie.runAndSubscribe(fu,({window:o,disposables:s})=>this.registerKeyModsListeners(o,s),{window:gt,disposables:this._store})),this._register(R7(o=>{this.ui&&ge(this.ui.container)===o&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))}))}registerKeyModsListeners(e,t){let i=o=>{this.keyMods.ctrlCmd=o.ctrlKey||o.metaKey,this.keyMods.alt=o.altKey};for(let o of[se.KEY_DOWN,se.KEY_UP,se.MOUSE_DOWN])t.add($(e,o,i,!0))}getUI(e){if(this.ui)return e&&ge(this._container)!==ge(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;let t=me(this._container,Is(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";let i=Xi(t),o=me(t,Is(".quick-input-titlebar")),s=this._register(new Eo(o,{hoverDelegate:this.options.hoverDelegate}));s.domNode.classList.add("quick-input-left-action-bar");let r=me(o,Is(".quick-input-title")),a=this._register(new Eo(o,{hoverDelegate:this.options.hoverDelegate}));a.domNode.classList.add("quick-input-right-action-bar");let l=me(t,Is(".quick-input-header")),c=me(l,Is("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",p("quickInput.checkAll","Toggle all checkboxes")),this._register(Ut(c,se.CHANGE,z=>{let te=c.checked;G.setAllVisibleChecked(te)})),this._register($(c,se.CLICK,z=>{(z.x||z.y)&&f.setFocus()}));let d=me(l,Is(".quick-input-description")),h=me(l,Is(".quick-input-and-message")),u=me(h,Is(".quick-input-filter")),f=this._register(new s2(u,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);let g=me(u,Is(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");let m=new _1(g,{countFormat:p({key:"quickInput.visibleCount",comment:["This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers."]},"{0} Results")},this.styles.countBadge),C=me(u,Is(".quick-input-count"));C.setAttribute("aria-live","polite");let S=new _1(C,{countFormat:p({key:"quickInput.countSelected",comment:["This tells the user how many items are selected in a list of items to select from. The items can be anything."]},"{0} Selected")},this.styles.countBadge),w=me(l,Is(".quick-input-action")),y=this._register(new Jf(w,this.styles.button));y.label=p("ok","OK"),this._register(y.onDidClick(z=>{this.onDidAcceptEmitter.fire()}));let x=me(l,Is(".quick-input-action")),k=this._register(new Jf(x,{...this.styles.button,supportIcons:!0}));k.label=p("custom","Custom"),this._register(k.onDidClick(z=>{this.onDidCustomEmitter.fire()}));let T=me(h,Is(`#${this.idPrefix}message.quick-input-message`)),N=this._register(new b1(t,this.styles.progressBar));N.getContainer().classList.add("quick-input-progress");let M=me(t,Is(".quick-input-html-widget"));M.tabIndex=-1;let W=me(t,Is(".quick-input-description")),j=this.idPrefix+"list",G=this._register(this.instantiationService.createInstance(o_,t,this.options.hoverDelegate,this.options.linkOpenerDelegate,j));f.setAttribute("aria-controls",j),this._register(G.onDidChangeFocus(()=>{var z;f.setAttribute("aria-activedescendant",(z=G.getActiveDescendant())!==null&&z!==void 0?z:"")})),this._register(G.onChangedAllVisibleChecked(z=>{c.checked=z})),this._register(G.onChangedVisibleCount(z=>{m.setCount(z)})),this._register(G.onChangedCheckedCount(z=>{S.setCount(z)})),this._register(G.onLeave(()=>{setTimeout(()=>{this.controller&&(f.setFocus(),this.controller instanceof s_&&this.controller.canSelectMany&&G.clearFocus())},0)}));let V=Ic(t);return this._register(V),this._register($(t,se.FOCUS,z=>{yi(z.relatedTarget,t)||(this.previousFocusElement=z.relatedTarget instanceof HTMLElement?z.relatedTarget:void 0)},!0)),this._register(V.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(Wh.Blur),this.previousFocusElement=void 0})),this._register($(t,se.FOCUS,z=>{f.setFocus()})),this._register(Ut(t,se.KEY_DOWN,z=>{if(!yi(z.target,M))switch(z.keyCode){case 3:He.stop(z,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:He.stop(z,!0),this.hide(Wh.Gesture);break;case 2:if(!z.altKey&&!z.ctrlKey&&!z.metaKey){let te=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(t.classList.contains("show-checkboxes")?te.push("input"):te.push("input[type=text]"),this.getUI().list.isDisplayed()&&te.push(".monaco-list"),this.getUI().message&&te.push(".quick-input-message a"),this.getUI().widget){if(yi(z.target,this.getUI().widget))break;te.push(".quick-input-html-widget")}let ee=t.querySelectorAll(te.join(", "));z.shiftKey&&z.target===ee[0]?(He.stop(z,!0),G.clearFocus()):!z.shiftKey&&yi(z.target,ee[ee.length-1])&&(He.stop(z,!0),ee[0].focus())}break;case 10:z.ctrlKey&&(He.stop(z,!0),this.getUI().list.toggleHover());break}})),this.ui={container:t,styleSheet:i,leftActionBar:s,titleBar:o,title:r,description1:W,description2:d,widget:M,rightActionBar:a,checkAll:c,inputContainer:h,filterContainer:u,inputBox:f,visibleCountContainer:g,visibleCount:m,countContainer:C,count:S,okContainer:w,ok:y,message:T,customButtonContainer:x,customButton:k,list:G,progressBar:N,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:z=>this.show(z),hide:()=>this.hide(),setVisibilities:z=>this.setVisibilities(z),setEnabled:z=>this.setEnabled(z),setContextKey:z=>this.options.setContextKey(z),linkOpenerDelegate:z=>this.options.linkOpenerDelegate(z)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this._container=e,me(this._container,this.ui.container))}pick(e,t={},i=Mo.None){return new Promise((o,s)=>{let r=d=>{var h;r=o,(h=t.onKeyMods)===null||h===void 0||h.call(t,a.keyMods),o(d)};if(i.isCancellationRequested){r(void 0);return}let a=this.createQuickPick(),l,c=[a,a.onDidAccept(()=>{if(a.canSelectMany)r(a.selectedItems.slice()),a.hide();else{let d=a.activeItems[0];d&&(r(d),a.hide())}}),a.onDidChangeActive(d=>{let h=d[0];h&&t.onDidFocus&&t.onDidFocus(h)}),a.onDidChangeSelection(d=>{if(!a.canSelectMany){let h=d[0];h&&(r(h),a.hide())}}),a.onDidTriggerItemButton(d=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...d,removeItem:()=>{let h=a.items.indexOf(d.item);if(h!==-1){let u=a.items.slice(),f=u.splice(h,1),g=a.activeItems.filter(C=>C!==f[0]),m=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=u,g&&(a.activeItems=g),a.keepScrollPosition=m}}})),a.onDidTriggerSeparatorButton(d=>{var h;return(h=t.onDidTriggerSeparatorButton)===null||h===void 0?void 0:h.call(t,d)}),a.onDidChangeValue(d=>{l&&!d&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{li(c),r(void 0)})];a.title=t.title,a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([d,h])=>{l=h,a.busy=!1,a.items=d,a.canSelectMany&&(a.selectedItems=d.filter(u=>u.type!=="separator"&&u.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,d=>{s(d),a.hide()})})}createQuickPick(){let e=this.getUI(!0);return new s_(e)}createInputBox(){let e=this.getUI(!0);return new n2(e)}show(e){let t=this.getUI(!0);this.onShowEmitter.fire();let i=this.controller;this.controller=e,i?.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",Wi(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(Ci.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),Wi(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;let o=this.options.backKeybindingLabel();i2.tooltip=o?p("quickInput.backWithKeybinding","Back ({0})",o):p("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}isVisible(){return!!this.ui&&this.ui.container.style.display!=="none"}setVisibilities(e){let t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(let t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(let t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t,i;let o=this.controller;if(!o)return;o.willHide(e);let s=(t=this.ui)===null||t===void 0?void 0:t.container,r=s&&!qw(s);if(this.controller=null,this.onHideEmitter.fire(),s&&(s.style.display="none"),!r){let a=this.previousFocusElement;for(;a&&!a.offsetParent;)a=(i=a.parentElement)!==null&&i!==void 0?i:void 0;a?.offsetParent?(a.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}o.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isVisible()){this.ui.container.style.top=`${this.titleBarOffset}px`;let e=this.ui.container.style,t=Math.min(this.dimension.width*.62,pO.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){let{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:o,widgetShadow:s}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=i??"",this.ui.container.style.border=o?`1px solid ${o}`:"",this.ui.container.style.boxShadow=s?`0 0 8px 2px ${s}`:"",this.ui.list.style(this.styles.list);let r=[];this.styles.pickerGroup.pickerGroupBorder&&r.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(r.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&r.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&r.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&r.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&r.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&r.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),r.push("}"));let a=r.join(` +`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}};v1.MAX_WIDTH=600;v1=pO=YQ([TU(1,ss),TU(2,Ye)],v1);Fo();ke();var XQ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},C1=function(n,e){return function(t,i){e(t,i,n)}},r2=class extends lx{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(mE))),this._quickAccess}constructor(e,t,i,o,s){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=o,this.configurationService=s,this._onShow=this._register(new B),this._onHide=this._register(new B),this.contexts=new Map}createController(e=this.layoutService,t){let i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:s=>this.setContextKey(s),linkOpenerDelegate:s=>{this.instantiationService.invokeFunction(r=>{r.get(Jl).open(s,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(o2))},o=this._register(this.instantiationService.createInstance(v1,{...i,...t}));return o.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(s=>{ge(e.activeContainer)===ge(o.container)&&o.layout(s,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{o.isVisible()||o.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(o.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(o.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),o}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new xe(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t?.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=Mo.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:he(QA),quickInputForeground:he(b6),quickInputTitleBackground:he(v6),widgetBorder:he(nB),widgetShadow:he(Va)},inputBox:iP,toggle:tP,countBadge:BH,button:PH,progressBar:OH,keybindingLabel:RH,list:Uf({listBackground:QA,listFocusBackground:cb,listFocusForeground:lb,listInactiveFocusForeground:lb,listInactiveSelectionIconForeground:FS,listInactiveFocusBackground:cb,listFocusOutline:ni,listInactiveFocusOutline:ni}),pickerGroup:{pickerGroupBorder:he(C6),pickerGroupForeground:he(OS)}}}};r2=XQ([C1(0,Ye),C1(1,rt),C1(2,an),C1(3,ss),C1(4,Rt)],r2);bg();Fo();var NU=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},eg=function(n,e){return function(t,i){e(t,i,n)}},_O=class extends r2{constructor(e,t,i,o,s,r){super(t,i,o,new Uk(e.getContainerDomNode(),s),r),this.host=void 0;let a=r_.get(e);if(a){let l=a.widget;this.host={_serviceBrand:void 0,get mainContainer(){return l.getDomNode()},getContainer(){return l.getDomNode()},whenContainerStylesLoaded(){},get containers(){return[l.getDomNode()]},get activeContainer(){return l.getDomNode()},get mainContainerDimension(){return e.getLayoutInfo()},get activeContainerDimension(){return e.getLayoutInfo()},get onDidLayoutMainContainer(){return e.onDidLayoutChange},get onDidLayoutActiveContainer(){return e.onDidLayoutChange},get onDidLayoutContainer(){return ie.map(e.onDidLayoutChange,c=>({container:l.getDomNode(),dimension:c}))},get onDidChangeActiveContainer(){return ie.None},get onDidAddContainer(){return ie.None},get mainContainerOffset(){return{top:0,quickPickTop:0}},get activeContainerOffset(){return{top:0,quickPickTop:0}},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};_O=NU([eg(1,Ye),eg(2,rt),eg(3,an),eg(4,Zt),eg(5,Rt)],_O);var a2=class{get activeService(){let e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){let i=t=this.instantiationService.createInstance(_O,e);this.mapEditorToService.set(e,t),wa(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},i=Mo.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};a2=NU([eg(0,Ye),eg(1,Zt)],a2);var r_=class n{static get(e){return e.getContribution(n.ID)}constructor(e){this.editor=e,this.widget=new l2(this.editor)}dispose(){this.widget.dispose()}};r_.ID="editor.controller.quickInput";var l2=class n{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return n.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}};l2.ID="editor.contrib.quickInputWidget";vy(r_.ID,r_,4);_();v();b();ke();ps();gn();ye();Yo();um();_();v();b();gn();var bO=class{constructor(e,t,i,o,s){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=o,this.background=s}};function QQ(n){if(!n||!Array.isArray(n))return[];let e=[],t=0;for(let i=0,o=n.length;i{let u=nJ(d.token,h.token);return u!==0?u:d.index-h.index});let t=0,i="000000",o="ffffff";for(;n.length>=1&&n[0].token==="";){let d=n.shift();d.fontStyle!==-1&&(t=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(o=d.background)}let s=new vO;for(let d of e)s.getId(d);let r=s.getId(i),a=s.getId(o),l=new CO(t,r,a),c=new wO(l);for(let d=0,h=n.length;d"u"){let o=this._match(t),s=iJ(t);i=(o.metadata|s<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}},tJ=/\b(comment|string|regex|regexp)\b/;function iJ(n){let e=n.match(tJ);if(!e)return 0;switch(e[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function nJ(n,e){return ne?1:0}var CO=class n{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new n(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),i!==0&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}},wO=class n{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(e==="")return this._mainRule;let t=e.indexOf("."),i,o;t===-1?(i=e,o=""):(i=e.substring(0,t),o=e.substring(t+1));let s=this._children.get(i);return typeof s<"u"?s.match(o):this._mainRule}insert(e,t,i,o){if(e===""){this._mainRule.acceptOverwrite(t,i,o);return}let s=e.indexOf("."),r,a;s===-1?(r=e,a=""):(r=e.substring(0,s),a=e.substring(s+1));let l=this._children.get(r);typeof l>"u"&&(l=new n(this._mainRule.clone()),this._children.set(r,l)),l.insert(a,t,i,o)}};function AU(n){let e=[];for(let t=1,i=n.length;t({format:o.format,location:o.location.toString()}))}}n.toJSONObject=e;function t(i){let o=s=>tn(s)?s:void 0;if(i&&Array.isArray(i.src)&&i.src.every(s=>tn(s.format)&&tn(s.location)))return{weight:o(i.weight),style:o(i.style),src:i.src.map(s=>({format:s.format,location:Oe.parse(s.location)}))}}n.fromJSONObject=t})(BU||(BU={}));var yO=class{constructor(){this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:p("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:p("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Xe.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,o){let s=this.iconsById[e];if(s){if(i&&!s.description){s.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;let l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=i),this._onDidChange.fire()}return s}let r={id:e,description:i,defaults:t,deprecationMessage:o};this.iconsById[e]=r;let a={$ref:"#/definitions/icons"};return o&&(a.deprecationMessage=o),i&&(a.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){let e=(s,r)=>s.id.localeCompare(r.id),t=s=>{for(;Xe.isThemeIcon(s.defaults);)s=this.iconsById[s.defaults.id];return`codicon codicon-${s?s.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");let o=Object.keys(this.iconsById).map(s=>this.iconsById[s]);for(let s of o.filter(r=>!!r.description).sort(e))i.push(`||${s.id}|${Xe.isThemeIcon(s.defaults)?s.defaults.id:s.id}|${s.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(let s of o.filter(r=>!Xe.isThemeIcon(r.defaults)).sort(e))i.push(`||${s.id}|`);return i.join(` +`)}},tg=new yO;Vt.add(oJ.IconContribution,tg);function fc(n,e,t,i){return tg.registerIcon(n,e,t,i)}function SO(){return tg}function sJ(){let n=_C();for(let e in n){let t="\\"+n[e].toString(16);tg.registerIcon(e,{fontCharacter:t})}}sJ();var zU="vscode://schemas/icons",VU=Vt.as(Lu.JSONContribution);VU.registerSchema(zU,tg.getIconSchema());var WU=new di(()=>VU.notifySchemaChanged(zU),200);tg.onDidChange(()=>{WU.isScheduled()||WU.schedule()});var iut=fc("widget-close",ue.close,p("widgetClose","Icon for the close action in widgets.")),nut=fc("goto-previous-location",ue.arrowUp,p("previousChangeIcon","Icon for goto previous editor location.")),out=fc("goto-next-location",ue.arrowDown,p("nextChangeIcon","Icon for goto next editor location.")),sut=Xe.modify(ue.sync,"spin"),rut=Xe.modify(ue.loading,"spin");function HU(n){let e=new ae,t=e.add(new B),i=SO();return e.add(i.onDidChange(()=>t.fire())),n&&e.add(n.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){let o=n?n.getProductIconTheme():new y1,s={},r=[],a=[];for(let l of i.getIcons()){let c=o.getIcon(l);if(!c)continue;let d=c.font,h=`--vscode-icon-${l.id}-font-family`,u=`--vscode-icon-${l.id}-content`;d?(s[d.id]=d.definition,a.push(`${h}: ${Xw(d.id)};`,`${u}: '${c.fontCharacter}';`),r.push(`.codicon-${l.id}:before { content: '${c.fontCharacter}'; font-family: ${Xw(d.id)}; }`)):(a.push(`${u}: '${c.fontCharacter}'; ${h}: 'codicon';`),r.push(`.codicon-${l.id}:before { content: '${c.fontCharacter}'; }`))}for(let l in s){let c=s[l],d=c.weight?`font-weight: ${c.weight};`:"",h=c.style?`font-style: ${c.style};`:"",u=c.src.map(f=>`${Mr(f.location)} format('${f.format}')`).join(", ");r.push(`@font-face { src: ${u}; font-family: ${Xw(l)};${d}${h} font-display: block; }`)}return r.push(`:root { ${a.join(" ")} }`),r.join(` +`)}}}var y1=class{getIcon(e){let t=SO(),i=e.defaults;for(;Xe.isThemeIcon(i);){let o=t.getIcon(i.id);if(!o)return;i=o.defaults}return i}};vo();var Kh="vs",S1="vs-dark",a_="hc-black",l_="hc-light",UU=Vt.as(VA.ColorContribution),rJ=Vt.as(bM.ThemingContribution),h2=class{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;let i=t.base;e.length>0?(d2(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){let e=new Map;for(let t in this.themeData.colors)e.set(t,Z.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){let t=xO(this.themeData.base);for(let i in t.colors)e.has(i)||e.set(i,Z.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){let i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=UU.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Kh:return Ss.LIGHT;case a_:return Ss.HIGH_CONTRAST_DARK;case l_:return Ss.HIGH_CONTRAST_LIGHT;default:return Ss.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){let s=xO(this.themeData.base);e=s.rules,s.encodedTokensColors&&(t=s.encodedTokensColors)}let i=this.themeData.colors["editor.foreground"],o=this.themeData.colors["editor.background"];if(i||o){let s={token:""};i&&(s.foreground=i),o&&(s.background=o),e.push(s)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=w1.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){let s=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=mn.getForeground(s),a=mn.getFontStyle(s);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}};function d2(n){return n===Kh||n===S1||n===a_||n===l_}function xO(n){switch(n){case Kh:return MU;case S1:return RU;case a_:return PU;case l_:return OU}}function c2(n){let e=xO(n);return new h2(n,e)}var u2=class extends H{constructor(){super(),this._onColorThemeChange=this._register(new B),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new B),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new y1,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Kh,c2(Kh)),this._knownThemes.set(S1,c2(S1)),this._knownThemes.set(a_,c2(a_)),this._knownThemes.set(l_,c2(l_));let e=this._register(HU(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} +${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Kh),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),TT(gt,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return gu(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=Xi(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),H.None}_registerShadowDomContainer(e){let t=Xi(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;i{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(Kh),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){let e=gt.matchMedia("(forced-colors: active)").matches;if(e!==Ol(this._theme.type)){let t;Qu(this._theme.type)?t=e?a_:S1:t=e?l_:Kh,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){let e=[],t={},i={addRule:r=>{t[r]||(e.push(r),t[r]=!0)}};rJ.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));let o=[];for(let r of UU.getColors()){let a=this._theme.getColor(r.id,!0);a&&o.push(`${DS(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${o.join(` +`)} }`);let s=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(AU(s)),this._themeCSS=e.join(` +`),this._updateCSS(),Bt.setColorMap(s),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS} +${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}};x1();_();v();b();ke();vo();ye();le();Fo();Oi();var aJ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},LO=function(n,e){return function(t,i){e(t,i,n)}},f2=class extends H{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new B,this._onDidChangeReducedMotion=new B,this._accessibilityModeEnabledContext=P8.bindTo(this._contextKeyService);let o=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("editor.accessibilitySupport")&&(o(),this._onDidChangeScreenReaderOptimized.fire()),r.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),o(),this._register(this.onDidChangeScreenReaderOptimized(()=>o()));let s=gt.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=s.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(s)}initReducedMotionListeners(e){this._register($(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));let t=()=>{let i=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("reduce-motion",i),this._layoutService.mainContainer.classList.toggle("enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){let e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){let e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};f2=aJ([LO(0,rt),LO(1,ss),LO(2,Rt)],f2);zr();_();v();b();Gt();ye();le();zr();ir();Oi();Po();wt();Ge();var p2=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},gc=function(n,e){return function(t,i){e(t,i,n)}},c_,$h,g2=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new m2(i)}createMenu(e,t,i){return new DO(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};g2=p2([gc(0,kn),gc(1,fi),gc(2,Vf)],g2);var m2=c_=class{constructor(e){this._storageService=e,this._disposables=new ae,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{let t=e.get(c_._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,c_._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{let t=e.get(c_._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){var i;return(i=this._hiddenByDefaultCache.get(`${e.id}/${t}`))!==null&&i!==void 0?i:!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){var i,o;let s=this._isHiddenByDefault(e,t),r=(o=(i=this._data[e.id])===null||i===void 0?void 0:i.includes(t))!==null&&o!==void 0?o:!1;return s?!r:r}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);let s=this._data[e.id];if(i)s?s.indexOf(t)<0&&s.push(t):this._data[e.id]=[t];else if(s){let r=s.indexOf(t);r>=0&&GF(s,r),s.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(let{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;let e=JSON.stringify(this._data);this._storageService.store(c_._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};m2._key="menu.hiddenCommands";m2=c_=p2([gc(0,Vf)],m2);var kO=$h=class{constructor(e,t,i,o,s,r){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=i,this._commandService=o,this._keybindingService=s,this._contextKeyService=r,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();let e=Fs.getMenuItems(this._id),t;e.sort($h._compareMenuItems);for(let i of e){let o=i.group||"";(!t||t[0]!==o)&&(t=[o,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeys(i)}}_collectContextKeys(e){if($h._fillInKbExprKeys(e.when,this._structureContextKeys),jg(e)){if(e.command.precondition&&$h._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){let t=e.command.toggled.condition||e.command.toggled;$h._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&Fs.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){let t=[];for(let i of this._menuGroups){let[o,s]=i,r=[];for(let a of s)if(this._contextKeyService.contextMatchesRules(a.when)){let l=jg(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);let c=lJ(this._id,l?a.command:a,this._hiddenStates);if(l){let d=EO(a.command.id,a.when,this._commandService,this._keybindingService);r.push(new Br(a.command,a.alt,e,c,d,this._contextKeyService,this._commandService))}else{let d=new $h(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._keybindingService,this._contextKeyService).createActionGroups(e),h=zi.join(...d.map(u=>u[1]));h.length>0&&r.push(new wl(a,c,h))}}r.length>0&&t.push([o,r])}return t}static _fillInKbExprKeys(e,t){if(e)for(let i of e.keys())t.add(i)}static _compareMenuItems(e,t){let i=e.group,o=t.group;if(i!==o){if(i){if(!o)return-1}else return 1;if(i==="navigation")return-1;if(o==="navigation")return 1;let a=i.localeCompare(o);if(a!==0)return a}let s=e.order||0,r=t.order||0;return sr?1:$h._compareTitles(jg(e)?e.command.title:e.title,jg(t)?t.command.title:t.title)}static _compareTitles(e,t){let i=typeof e=="string"?e:e.original,o=typeof t=="string"?t:t.original;return i.localeCompare(o)}};kO=$h=p2([gc(3,kn),gc(4,fi),gc(5,rt)],kO);var DO=class{constructor(e,t,i,o,s,r){this._disposables=new ae,this._menuInfo=new kO(e,t,i.emitEventsForSubmenuChanges,o,s,r);let a=new di(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(a),this._disposables.add(Fs.onDidChangeMenu(h=>{h.has(e)&&a.schedule()}));let l=this._disposables.add(new ae),c=h=>{let u=!1,f=!1,g=!1;for(let m of h)if(u=u||m.isStructuralChange,f=f||m.isEnablementChange,g=g||m.isToggleChange,u&&f&&g)break;return{menu:this,isStructuralChange:u,isEnablementChange:f,isToggleChange:g}},d=()=>{l.add(r.onDidChangeContext(h=>{let u=h.affectsSome(this._menuInfo.structureContextKeys),f=h.affectsSome(this._menuInfo.preconditionContextKeys),g=h.affectsSome(this._menuInfo.toggledContextKeys);(u||f||g)&&this._onDidChange.fire({menu:this,isStructuralChange:u,isEnablementChange:f,isToggleChange:g})})),l.add(t.onDidChange(h=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new wg({onWillAddFirstListener:d,onDidRemoveLastListener:l.clear.bind(l),delay:i.eventDebounceDelay,merge:c}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};DO=p2([gc(3,kn),gc(4,fi),gc(5,rt)],DO);function lJ(n,e,t){let i=r3(e)?e.submenu.id:e.id,o=typeof e.title=="string"?e.title:e.title.value,s=zd({id:`hide/${n.id}/${i}`,label:p("hide.label","Hide '{0}'",o),run(){t.updateHidden(n,i,!0)}}),r=zd({id:`toggle/${n.id}/${i}`,label:o,get checked(){return!t.isHidden(n,i)},run(){t.updateHidden(n,i,!!this.checked)}});return{hide:s,toggle:r,get isHidden(){return!r.checked}}}function EO(n,e=void 0,t,i){return zd({id:`configureKeybinding/${n}`,label:p("configure keybinding","Configure Keybinding"),run(){let s=!!!i.lookupKeybinding(n)&&e?e.serialize():void 0;t.executeCommand("workbench.action.openGlobalKeybindings",`@command:${n}`+(s?` +when:${s}`:""))}})}_();v();b();ps();ke();vo();Gt();ye();Bg();le();Aa();var cJ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},KU=function(n,e){return function(t,i){e(t,i,n)}},IO,L1=IO=class extends H{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(ms||yw)&&this.installWebKitWriteTextWorkaround(),this._register(ie.runAndSubscribe(fu,({window:i,disposables:o})=>{o.add($(i.document,"copy",()=>this.clearResources()))},{window:gt,disposables:this._store}))}installWebKitWriteTextWorkaround(){let e=()=>{let t=new Og;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(async i=>{(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)})};this._register(ie.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:i})=>{i.add($(t,"click",e)),i.add($(t,"keydown",e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.writeResources([]),t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return await navigator.clipboard.writeText(e)}catch(i){console.error(i)}this.fallbackWriteText(e)}fallbackWriteText(e){let t=jw(),i=t.activeElement,o=t.body.appendChild(ve("textarea",{"aria-hidden":!0}));o.style.height="1px",o.style.width="1px",o.style.position="absolute",o.value=e,o.focus(),o.select(),t.execCommand("copy"),i instanceof HTMLElement&&i.focus(),t.body.removeChild(o)}async readText(e){if(e)return this.mapTextToType.get(e)||"";try{return await navigator.clipboard.readText()}catch(t){console.error(t)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}async writeResources(e){e.length===0?this.clearResources():(this.resources=e,this.resourcesStateHash=await this.computeResourcesStateHash())}async readResources(){let e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResources(),this.resources}async computeResourcesStateHash(){if(this.resources.length===0)return;let e=await this.readText();return zw(e.substring(0,IO.MAX_RESOURCE_STATE_SOURCE_LENGTH))}clearResources(){this.resources=[],this.resourcesStateHash=void 0}};L1.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3;L1=IO=cJ([KU(0,ss),KU(1,En)],L1);_();v();b();qe();var d_=De("clipboardService");_();v();b();ye();js();le();hs();sn();Ge();ir();Fo();Oi();var dJ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},hJ=function(n,e){return function(t,i){e(t,i,n)}},k1="data-keybinding-context",D1=class{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return{...this._value}}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){let t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}},qh=class extends D1{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}};qh.INSTANCE=new qh;var _2=class n extends D1{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=Av.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(o=>{if(o.source===7){let s=Array.from(this._values,([r])=>r);this._values.clear(),i.fire(new v2(s))}else{let s=[];for(let r of o.affectedKeys){let a=`config.${r}`,l=this._values.findSuperstr(a);l!==void 0&&(s.push(...ht.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(s.push(a),this._values.delete(a))}i.fire(new v2(s))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(n._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);let t=e.substr(n._keyPrefix.length),i=this._configurationService.getValue(t),o;switch(typeof i){case"number":case"boolean":case"string":o=i;break;default:Array.isArray(i)?o=JSON.stringify(i):o=i}return this._values.set(e,o),o}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}};_2._keyPrefix="config.";var TO=class{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}},b2=class{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}},v2=class{constructor(e){this.keys=e}affectsSome(e){for(let t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}},NO=class{constructor(e){this.events=e}affectsSome(e){for(let t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}};function uJ(n,e){return n.allKeysContainedIn(new Set(Object.keys(e)))}var C2=class extends H{constructor(e){super(),this._onDidChangeContext=this._register(new ul({merge:t=>new NO(t)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new TO(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new AO(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");let t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;let i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new b2(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new b2(e))}getContext(e){return this._isDisposed?qh.INSTANCE:this.getContextValuesContainer(fJ(e))}dispose(){super.dispose(),this._isDisposed=!0}},w2=class extends C2{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;let t=this._register(new _2(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?qh.INSTANCE:this._contexts.get(e)||qh.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");let t=++this._lastContextId;return this._contexts.set(t,new D1(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};w2=dJ([hJ(0,Rt)],w2);var AO=class extends C2{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new no),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(k1)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${i?": "+i:""}`)}this._domNode.setAttribute(k1,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{let i=this._parent.getContextValuesContainer(this._myContextId).value;uJ(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(k1),super.dispose())}getContextValuesContainer(e){return this._isDisposed?qh.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}};function fJ(n){for(;n;){if(n.hasAttribute(k1)){let e=n.getAttribute(k1);return e?parseInt(e,10):NaN}n=n.parentElement}return 0}function gJ(n,e,t){n.get(rt).createKey(String(e),mJ(t))}function mJ(n){return Z1(n,e=>{if(typeof e=="object"&&e.$mid===1)return Oe.revive(e).toString();if(e instanceof Oe)return e.toString()})}Pi.registerCommand("_setContext",gJ);Pi.registerCommand({id:"getContextKeyInfo",handler(){return[...xe.all()].sort((n,e)=>n.key.localeCompare(e.key))},metadata:{description:p("getContextKeyInfo","A command that returns information about context keys"),args:[]}});Pi.registerCommand("_generateContextKeyInfo",function(){let n=[],e=new Set;for(let t of xe.all())e.has(t.key)||(e.add(t.key),n.push(t));n.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(n,void 0,2))});My();_();v();b();Gt();xt();le();My();_();v();b();var MO=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}},E1=class{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){let e=[];for(let t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){let i=this.lookupOrInsertNode(e),o=this.lookupOrInsertNode(t);i.outgoing.set(o.key,o),o.incoming.set(i.key,i)}removeNode(e){let t=this._hashFn(e);this._nodes.delete(t);for(let i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){let t=this._hashFn(e),i=this._nodes.get(t);return i||(i=new MO(t,e),this._nodes.set(t,i)),i}isEmpty(){return this._nodes.size===0}toString(){let e=[];for(let[t,i]of this._nodes)e.push(`${t} + (-> incoming)[${[...i.incoming.keys()].join(", ")}] + (outgoing ->)[${[...i.outgoing.keys()].join(",")}] +`);return e.join(` +`)}findCycleSlow(){for(let[e,t]of this._nodes){let i=new Set([e]),o=this._findCycle(t,i);if(o)return o}}_findCycle(e,t){for(let[i,o]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);let s=this._findCycle(o,t);if(s)return s;t.delete(i)}}};qe();kr();var pJ=!1,y2=class extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=(t=e.findCycleSlow())!==null&&t!==void 0?t:`UNABLE to detect cycle, dumping graph: +${e.toString()}`}},S2=class n{constructor(e=new sa,t=!1,i,o=pJ){var s;this._services=e,this._strict=t,this._parent=i,this._enableTracing=o,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(Ye,this),this._globalGraph=o?(s=i?._globalGraph)!==null&&s!==void 0?s:new E1(r=>r):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,li(this._children),this._children.clear();for(let e of this._servicesToMaybeDispose)aC(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e){this._throwIfDisposed();let t=new class extends n{dispose(){this._children.delete(t),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(t),t}invokeFunction(e,...t){this._throwIfDisposed();let i=rd.traceInvocation(this._enableTracing,e),o=!1;try{return e({get:r=>{if(o)throw _g("service accessor is only valid during the invocation of its target method");let a=this._getOrCreateServiceInstance(r,i);if(!a)throw new Error(`[invokeFunction] unknown service '${r}'`);return a}},...t)}finally{o=!0,i.stop()}}createInstance(e,...t){this._throwIfDisposed();let i,o;return e instanceof Cs?(i=rd.traceCreation(this._enableTracing,e.ctor),o=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=rd.traceCreation(this._enableTracing,e),o=this._createInstance(e,t,i)),i.stop(),o}_createInstance(e,t=[],i){let o=Pr.getServiceDependencies(e).sort((a,l)=>a.index-l.index),s=[];for(let a of o){let l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),s.push(l)}let r=o.length>0?o[0].index:t.length;if(t.length!==r){console.trace(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);let a=r-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,r)}return Reflect.construct(e,t.concat(s))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof Cs)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){let t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));let i=this._getServiceInstanceOrDescriptor(e);return i instanceof Cs?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){var o;let s=new E1(l=>l.id.toString()),r=0,a=[{id:e,desc:t,_trace:i}];for(;a.length;){let l=a.pop();if(s.lookupOrInsertNode(l),r++>1e3)throw new y2(s);for(let c of Pr.getServiceDependencies(l.desc.ctor)){let d=this._getServiceInstanceOrDescriptor(c.id);if(d||this._throwIfStrict(`[createInstance] ${e} depends on ${c.id} which is NOT registered.`,!0),(o=this._globalGraph)===null||o===void 0||o.insertEdge(String(l.id),String(c.id)),d instanceof Cs){let h={id:c.id,desc:d,_trace:l._trace.branch(c.id,!0)};s.insertEdge(l,h),a.push(h)}}}for(;;){let l=s.roots();if(l.length===0){if(!s.isEmpty())throw new y2(s);break}for(let{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof Cs){let h=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setCreatedServiceInstance(c.id,h)}s.removeNode(c)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],o,s){if(this._services.get(e)instanceof Cs)return this._createServiceInstance(e,t,i,o,s,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,o,s);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],o,s,r){if(o){let a=new n(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(e);let l=new Map,c=new Iw(()=>{let d=a._createInstance(t,i,s);for(let[h,u]of l){let f=d[h];if(typeof f=="function")for(let g of u)g.disposable=f.apply(d,g.listener)}return l.clear(),r.add(d),d});return new Proxy(Object.create(null),{get(d,h){if(!c.isInitialized&&typeof h=="string"&&(h.startsWith("onDid")||h.startsWith("onWill"))){let g=l.get(h);return g||(g=new Ii,l.set(h,g)),(C,S,w)=>{if(c.isInitialized)return c.value[h](C,S,w);{let y={listener:[C,S,w],disposable:void 0},x=g.push(y);return be(()=>{var T;x(),(T=y.disposable)===null||T===void 0||T.dispose()})}}}if(h in d)return d[h];let u=c.value,f=u[h];return typeof f!="function"||(f=f.bind(u),d[h]=f),f},set(d,h,u){return c.value[h]=u,!0},getPrototypeOf(d){return t.prototype}})}else{let a=this._createInstance(t,i,s);return r.add(a),a}}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}},rd=class n{static traceInvocation(e,t){return e?new n(2,t.name||new Error().stack.split(` +`).slice(3,4).join(` +`)):n._None}static traceCreation(e,t){return e?new n(1,t.name):n._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){let i=new n(3,e.toString());return this._dep.push([e,t,i]),i}stop(){let e=Date.now()-this._start;n._totals+=e;let t=!1;function i(s,r){let a=[],l=new Array(s+1).join(" ");for(let[c,d,h]of r._dep)if(d&&h){t=!0,a.push(`${l}CREATES -> ${c}`);let u=i(s+1,h);u&&a.push(u)}else a.push(`${l}uses -> ${c}`);return a.join(` +`)}let o=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${n._totals.toFixed(2)}ms)`];(e>2||t)&&n.all.add(o.join(` +`))}};rd.all=new Set;rd._None=new class extends rd{constructor(){super(0,null)}stop(){}branch(){return this}};rd._totals=0;_();v();b();wt();ye();js();cr();er();sn();var _J=new Set([Ze.inMemory,Ze.vscodeSourceControl,Ze.walkThrough,Ze.walkThroughSnippet,Ze.vscodeChatCodeBlock]),RO=class{constructor(){this._byResource=new Gn,this._byOwner=new Map}set(e,t,i){let o=this._byResource.get(e);o||(o=new Map,this._byResource.set(e,o)),o.set(t,i);let s=this._byOwner.get(t);s||(s=new Gn,this._byOwner.set(t,s)),s.set(e,i)}get(e,t){let i=this._byResource.get(e);return i?.get(t)}delete(e,t){let i=!1,o=!1,s=this._byResource.get(e);s&&(i=s.delete(t));let r=this._byOwner.get(t);if(r&&(o=r.delete(e)),i!==o)throw new Error("illegal state");return i&&o}values(e){var t,i,o,s;return typeof e=="string"?(i=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&i!==void 0?i:ht.empty():Oe.isUri(e)?(s=(o=this._byResource.get(e))===null||o===void 0?void 0:o.values())!==null&&s!==void 0?s:ht.empty():ht.map(ht.concat(...this._byOwner.values()),r=>r[1])}},PO=class{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Gn,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(let t of e){let i=this._data.get(t);i&&this._substract(i);let o=this._resourceStats(t);this._add(o),this._data.set(t,o)}}_resourceStats(e){let t={errors:0,warnings:0,infos:0,unknowns:0};if(_J.has(e.scheme))return t;for(let{severity:i}of this._service.read({resource:e}))i===Es.Error?t.errors+=1:i===Es.Warning?t.warnings+=1:i===Es.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}},x2=class n{constructor(){this._onMarkerChanged=new wg({delay:0,merge:n._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new RO,this._stats=new PO(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(let i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(XF(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{let o=[];for(let s of i){let r=n._toMarker(e,t,s);r&&o.push(r)}this._data.set(t,e,o),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:o,severity:s,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:h,relatedInformation:u,tags:f}=i;if(r)return l=l>0?l:1,c=c>0?c:1,d=d>=l?d:l,h=h>0?h:c,{resource:t,owner:e,code:o,severity:s,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:h,relatedInformation:u,tags:f}}changeAll(e,t){let i=[],o=this._data.values(e);if(o)for(let s of o){let r=ht.first(s);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(eu(t)){let s=new Gn;for(let{resource:r,marker:a}of t){let l=n._toMarker(e,r,a);if(!l)continue;let c=s.get(r);c?c.push(l):(s.set(r,[l]),i.push(r))}for(let[r,a]of s)this._data.set(r,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:o,take:s}=e;if((!s||s<0)&&(s=-1),t&&i){let r=this._data.get(i,t);if(r){let a=[];for(let l of r)if(n._accept(l,o)){let c=a.push(l);if(s>0&&c===s)break}return a}else return[]}else if(!t&&!i){let r=[];for(let a of this._data.values())for(let l of a)if(n._accept(l,o)){let c=r.push(l);if(s>0&&c===s)return r}return r}else{let r=this._data.values(i??t),a=[];for(let l of r)for(let c of l)if(n._accept(c,o)){let d=a.push(c);if(s>0&&d===s)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){let t=new Gn;for(let i of e)for(let o of i)t.set(o,!0);return Array.from(t.keys())}};_();v();b();le();Du();Oo();var L2=class extends H{get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._configurationModel=ko.createEmptyModel(this.logService)}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=ko.createEmptyModel(this.logService);let e=Vt.as(ar.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){let i=this.getConfigurationDefaultOverrides();for(let o of e){let s=i[o],r=t[o];s!==void 0?this._configurationModel.addValue(o,s):r?this._configurationModel.addValue(o,r.default):this._configurationModel.removeValue(o)}}};_();v();b();Ge();qe();var rl=De("accessibilitySignalService"),zgt=Symbol("AcknowledgeDocCommentsToken"),Re=class n{static register(e){return new n(e.fileName)}constructor(e){this.fileName=e}};Re.error=Re.register({fileName:"error.mp3"});Re.warning=Re.register({fileName:"warning.mp3"});Re.foldedArea=Re.register({fileName:"foldedAreas.mp3"});Re.break=Re.register({fileName:"break.mp3"});Re.quickFixes=Re.register({fileName:"quickFixes.mp3"});Re.taskCompleted=Re.register({fileName:"taskCompleted.mp3"});Re.taskFailed=Re.register({fileName:"taskFailed.mp3"});Re.terminalBell=Re.register({fileName:"terminalBell.mp3"});Re.diffLineInserted=Re.register({fileName:"diffLineInserted.mp3"});Re.diffLineDeleted=Re.register({fileName:"diffLineDeleted.mp3"});Re.diffLineModified=Re.register({fileName:"diffLineModified.mp3"});Re.chatRequestSent=Re.register({fileName:"chatRequestSent.mp3"});Re.chatResponseReceived1=Re.register({fileName:"chatResponseReceived1.mp3"});Re.chatResponseReceived2=Re.register({fileName:"chatResponseReceived2.mp3"});Re.chatResponseReceived3=Re.register({fileName:"chatResponseReceived3.mp3"});Re.chatResponseReceived4=Re.register({fileName:"chatResponseReceived4.mp3"});Re.clear=Re.register({fileName:"clear.mp3"});Re.save=Re.register({fileName:"save.mp3"});Re.format=Re.register({fileName:"format.mp3"});Re.voiceRecordingStarted=Re.register({fileName:"voiceRecordingStarted.mp3"});Re.voiceRecordingStopped=Re.register({fileName:"voiceRecordingStopped.mp3"});Re.progress=Re.register({fileName:"progress.mp3"});var OO=class{constructor(e){this.randomOneOf=e}},Ve=class n{constructor(e,t,i,o,s,r){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=o,this.legacyAnnouncementSettingsKey=s,this.announcementMessage=r}static register(e){let t=new OO("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new n(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage);return n._signals.add(i),i}};Ve._signals=new Set;Ve.errorAtPosition=Ve.register({name:p("accessibilitySignals.positionHasError.name","Error at Position"),sound:Re.error,announcementMessage:p("accessibility.signals.positionHasError","Error"),settingsKey:"accessibility.signals.positionHasError"});Ve.warningAtPosition=Ve.register({name:p("accessibilitySignals.positionHasWarning.name","Warning at Position"),sound:Re.warning,announcementMessage:p("accessibility.signals.positionHasWarning","Warning"),settingsKey:"accessibility.signals.positionHasWarning"});Ve.errorOnLine=Ve.register({name:p("accessibilitySignals.lineHasError.name","Error on Line"),sound:Re.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:p("accessibility.signals.lineHasError","Error on Line"),settingsKey:"accessibility.signals.lineHasError"});Ve.warningOnLine=Ve.register({name:p("accessibilitySignals.lineHasWarning.name","Warning on Line"),sound:Re.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:p("accessibility.signals.lineHasWarning","Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"});Ve.foldedArea=Ve.register({name:p("accessibilitySignals.lineHasFoldedArea.name","Folded Area on Line"),sound:Re.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:p("accessibility.signals.lineHasFoldedArea","Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"});Ve.break=Ve.register({name:p("accessibilitySignals.lineHasBreakpoint.name","Breakpoint on Line"),sound:Re.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:p("accessibility.signals.lineHasBreakpoint","Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"});Ve.inlineSuggestion=Ve.register({name:p("accessibilitySignals.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:Re.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"});Ve.terminalQuickFix=Ve.register({name:p("accessibilitySignals.terminalQuickFix.name","Terminal Quick Fix"),sound:Re.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:p("accessibility.signals.terminalQuickFix","Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"});Ve.onDebugBreak=Ve.register({name:p("accessibilitySignals.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:Re.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:p("accessibility.signals.onDebugBreak","Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"});Ve.noInlayHints=Ve.register({name:p("accessibilitySignals.noInlayHints","No Inlay Hints on Line"),sound:Re.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:p("accessibility.signals.noInlayHints","No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"});Ve.taskCompleted=Ve.register({name:p("accessibilitySignals.taskCompleted","Task Completed"),sound:Re.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:p("accessibility.signals.taskCompleted","Task Completed"),settingsKey:"accessibility.signals.taskCompleted"});Ve.taskFailed=Ve.register({name:p("accessibilitySignals.taskFailed","Task Failed"),sound:Re.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:p("accessibility.signals.taskFailed","Task Failed"),settingsKey:"accessibility.signals.taskFailed"});Ve.terminalCommandFailed=Ve.register({name:p("accessibilitySignals.terminalCommandFailed","Terminal Command Failed"),sound:Re.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:p("accessibility.signals.terminalCommandFailed","Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"});Ve.terminalBell=Ve.register({name:p("accessibilitySignals.terminalBell","Terminal Bell"),sound:Re.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:p("accessibility.signals.terminalBell","Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"});Ve.notebookCellCompleted=Ve.register({name:p("accessibilitySignals.notebookCellCompleted","Notebook Cell Completed"),sound:Re.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:p("accessibility.signals.notebookCellCompleted","Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"});Ve.notebookCellFailed=Ve.register({name:p("accessibilitySignals.notebookCellFailed","Notebook Cell Failed"),sound:Re.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:p("accessibility.signals.notebookCellFailed","Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"});Ve.diffLineInserted=Ve.register({name:p("accessibilitySignals.diffLineInserted","Diff Line Inserted"),sound:Re.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"});Ve.diffLineDeleted=Ve.register({name:p("accessibilitySignals.diffLineDeleted","Diff Line Deleted"),sound:Re.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"});Ve.diffLineModified=Ve.register({name:p("accessibilitySignals.diffLineModified","Diff Line Modified"),sound:Re.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"});Ve.chatRequestSent=Ve.register({name:p("accessibilitySignals.chatRequestSent","Chat Request Sent"),sound:Re.chatRequestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:p("accessibility.signals.chatRequestSent","Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"});Ve.chatResponseReceived=Ve.register({name:p("accessibilitySignals.chatResponseReceived","Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[Re.chatResponseReceived1,Re.chatResponseReceived2,Re.chatResponseReceived3,Re.chatResponseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"});Ve.progress=Ve.register({name:p("accessibilitySignals.progress","Progress"),sound:Re.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.chatResponseProgress",announcementMessage:p("accessibility.signals.progress","Progress"),settingsKey:"accessibility.signals.progress"});Ve.clear=Ve.register({name:p("accessibilitySignals.clear","Clear"),sound:Re.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:p("accessibility.signals.clear","Clear"),settingsKey:"accessibility.signals.clear"});Ve.save=Ve.register({name:p("accessibilitySignals.save","Save"),sound:Re.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:p("accessibility.signals.save","Save"),settingsKey:"accessibility.signals.save"});Ve.format=Ve.register({name:p("accessibilitySignals.format","Format"),sound:Re.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:p("accessibility.signals.format","Format"),settingsKey:"accessibility.signals.format"});Ve.voiceRecordingStarted=Ve.register({name:p("accessibilitySignals.voiceRecordingStarted","Voice Recording Started"),sound:Re.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"});Ve.voiceRecordingStopped=Ve.register({name:p("accessibilitySignals.voiceRecordingStopped","Voice Recording Stopped"),sound:Re.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"});_();v();b();le();Aa();var k2=class extends H{constructor(e,t=[]){super(),this.logger=new _y([e,...t]),this._register(e.onDidChangeLogLevel(i=>this.setLevel(i)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}};_();v();b();var $U=[];function Xgt(n){$U.push(n)}function qU(){return $U.slice(0)}xt();I4();vo();cr();var ad=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},vn=function(n,e){return function(t,i){e(t,i,n)}},FO=class{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new B}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}},BO=class{constructor(e){this.modelService=e}createModelReference(e){let t=this.modelService.getModel(e);return t?Promise.resolve(new rC(new FO(t))):Promise.reject(new Error("Model not found"))}};BO=ad([vn(0,xn)],BO);var D2=class n{show(){return n.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}};D2.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};var WO=class{withProgress(e,t,i){return t({report:()=>{}})}},zO=class{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}},VO=class{async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let i=e;return t&&(i=i+` + +`+t),gt.confirm(i)}async prompt(e){var t,i;let o;if(this.doConfirm(e.message,e.detail)){let r=[...(t=e.buttons)!==null&&t!==void 0?t:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&r.push(e.cancelButton),o=await((i=r[0])===null||i===void 0?void 0:i.run({checkboxChecked:!1}))}return{result:o}}async error(e,t){await this.prompt({type:Ci.Error,message:e,detail:t})}},E2=class n{info(e){return this.notify({severity:Ci.Info,message:e})}warn(e){return this.notify({severity:Ci.Warning,message:e})}error(e){return this.notify({severity:Ci.Error,message:e})}notify(e){switch(e.severity){case Ci.Error:console.error(e.message);break;case Ci.Warning:console.warn(e.message);break;default:console.log(e.message);break}return n.NO_OP}prompt(e,t,i,o){return n.NO_OP}status(e,t){return H.None}};E2.NO_OP=new Wk;var HO=class{constructor(e){this._onWillExecuteCommand=new B,this._onDidExecuteCommand=new B,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){let i=Pi.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let o=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(o)}catch(o){return Promise.reject(o)}}};HO=ad([vn(0,Ye)],HO);var jh=class extends ID{constructor(e,t,i,o,s,r){super(e,t,i,o,s),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];let a=f=>{let g=new ae;g.add($(f,se.KEY_DOWN,m=>{let C=new bt(m);this._dispatch(C,C.target)&&(C.preventDefault(),C.stopPropagation())})),g.add($(f,se.KEY_UP,m=>{let C=new bt(m);this._singleModifierDispatch(C,C.target)&&C.preventDefault()})),this._domNodeListeners.push(new UO(f,g))},l=f=>{for(let g=0;g{f.getOption(61)||a(f.getContainerDomNode())},d=f=>{f.getOption(61)||l(f.getContainerDomNode())};this._register(r.onCodeEditorAdd(c)),this._register(r.onCodeEditorRemove(d)),r.listCodeEditors().forEach(c);let h=f=>{a(f.getContainerDomNode())},u=f=>{l(f.getContainerDomNode())};this._register(r.onDiffEditorAdd(h)),this._register(r.onDiffEditorRemove(u)),r.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,o){return _o(Pi.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:o}]))}addDynamicKeybindings(e){let t=e.map(i=>{var o;return{keybinding:i0(i.keybinding,po),command:(o=i.command)!==null&&o!==void 0?o:null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),be(()=>{for(let i=0;ithis._log(i))}return this._cachedResolver}_documentHasFocus(){return gt.document.hasFocus()}_toNormalizedKeybindingItems(e,t){let i=[],o=0;for(let s of e){let r=s.when||void 0,a=s.keybinding;if(!a)i[o++]=new Tv(void 0,s.command,s.commandArgs,r,t,null,!1);else{let l=Nv.resolveKeybinding(a,po);for(let c of l)i[o++]=new Tv(c,s.command,s.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){let t=new pl(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new Nv([t],po)}};jh=ad([vn(0,rt),vn(1,kn),vn(2,nr),vn(3,Ko),vn(4,En),vn(5,Zt)],jh);var UO=class extends H{constructor(e,t){super(),this.domNode=e,this._register(t)}};function jU(n){return n&&typeof n=="object"&&(!n.overrideIdentifier||typeof n.overrideIdentifier=="string")&&(!n.resource||n.resource instanceof Oe)}var I2=class{constructor(e){this.logService=e,this._onDidChangeConfiguration=new B,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;let t=new L2(e);this._configuration=new Ev(t.reload(),ko.createEmptyModel(e),ko.createEmptyModel(e),ko.createEmptyModel(e),ko.createEmptyModel(e),ko.createEmptyModel(e),new Gn,ko.createEmptyModel(e),new Gn,e),t.dispose()}getValue(e,t){let i=typeof e=="string"?e:void 0,o=jU(e)?e:jU(t)?t:{};return this._configuration.getValue(i,o,void 0)}updateValues(e){let t={data:this._configuration.toData()},i=[];for(let o of e){let[s,r]=o;this.getValue(s)!==r&&(this._configuration.updateValue(s,r),i.push(s))}if(i.length>0){let o=new DD({keys:i,overrides:[]},t,this._configuration,void 0,this.logService);o.source=8,this._onDidChangeConfiguration.fire(o)}return Promise.resolve()}updateValue(e,t,i,o){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}};I2=ad([vn(0,En)],I2);var KO=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new B,this.configurationService.onDidChangeConfiguration(o=>{this._onDidChangeConfiguration.fire({affectedKeys:o.affectedKeys,affectsConfiguration:(s,r)=>o.affectsConfiguration(r)})})}getValue(e,t,i){let o=U.isIPosition(t)?t:null,s=o?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,r=e?this.getLanguage(e,o):void 0;return typeof s>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:r}):this.configurationService.getValue(s,{resource:e,overrideIdentifier:r})}getLanguage(e,t){let i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};KO=ad([vn(0,Rt),vn(1,xn),vn(2,ii)],KO);var $O=class{constructor(e){this.configurationService=e}getEOL(e,t){let i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&typeof i=="string"&&i!=="auto"?i:mi||Be?` +`:`\r +`}};$O=ad([vn(0,Rt)],$O);var qO=class{publicLog2(){}},T2=class n{constructor(){let e=Oe.from({scheme:n.SCHEME,authority:"model",path:"/"});this.workspace={id:D5,folders:[new AD({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===n.SCHEME?this.workspace.folders[0]:null}};T2.SCHEME="inmemory";function I1(n,e,t){if(!e||!(n instanceof I2))return;let i=[];Object.keys(e).forEach(o=>{VV(o)&&i.push([`editor.${o}`,e[o]]),t&&HV(o)&&i.push([`diffEditor.${o}`,e[o]])}),i.length>0&&n.updateValues(i)}var jO=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){let i=Array.isArray(e)?e:Ep.convert(e),o=new Map;for(let a of i){if(!(a instanceof Ip))throw new Error("bad edit - only text edits are supported");let l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let c=o.get(l);c||(c=[],o.set(l,c)),c.push(Af.replaceMove(P.lift(a.textEdit.range),a.textEdit.text))}let s=0,r=0;for(let[a,l]of o)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),r+=1,s+=l.length;return{ariaSummary:du(MD.bulkEditServiceSummary,s,r),isApplied:s>0}}};jO=ad([vn(0,xn)],jO);var GO=class{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return qb(e)}},ZO=class extends wD{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){let o=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();o&&(t=o.getContainerDomNode())}return super.showContextView(e,t,i)}};ZO=ad([vn(0,ss),vn(1,Zt)],ZO);var YO=class{constructor(){this._neverEmitter=new B,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}},XO=class extends Ov{constructor(){super()}},QO=class extends k2{constructor(){super(new py)}},JO=class extends aE{constructor(e,t,i,o,s,r){super(e,t,i,o,s,r),this.configure({blockMouse:!1})}};JO=ad([vn(0,nr),vn(1,Ko),vn(2,Qc),vn(3,fi),vn(4,Wr),vn(5,rt)],JO);var eF=class{async playSignal(e,t){}};_t(En,QO,0);_t(Rt,I2,0);_t(fS,KO,0);_t(gS,$O,0);_t(YV,T2,0);_t(GV,GO,0);_t(nr,qO,0);_t(Kk,VO,0);_t(Yk,zO,0);_t(Ko,E2,0);_t(tl,x2,0);_t(ii,XO,0);_t(ls,u2,0);_t(xn,Jv,0);_t(LS,hE,0);_t(rt,w2,0);_t(ZV,WO,0);_t(Ap,D2,0);_t(Vf,eE,0);_t(rc,mS,0);_t(WV,jO,0);_t(nH,YO,0);_t(Wd,BO,0);_t(ao,f2,0);_t(ol,BE,0);_t(kn,HO,0);_t(fi,jh,0);_t(gE,a2,0);_t(Qc,ZO,0);_t(Jl,cE,0);_t(d_,L1,0);_t(Ds,JO,0);_t(Wr,g2,0);_t(rl,eF,0);var Ae;(function(n){let e=new sa;for(let[l,c]of BN())e.set(l,c);let t=new S2(e,!0);e.set(Ye,t);function i(l){o||r({});let c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof Cs?t.invokeFunction(d=>d.get(l)):c}n.get=i;let o=!1,s=new B;function r(l){if(o)return t;o=!0;for(let[d,h]of BN())e.get(d)||e.set(d,h);for(let d in l)if(l.hasOwnProperty(d)){let h=De(d);e.get(h)instanceof Cs&&e.set(h,l[d])}let c=qU();for(let d of c)try{t.createInstance(d)}catch(h){ut(h)}return s.fire(),t}n.initialize=r;function a(l){if(o)return l();let c=new ae,d=c.add(s.event(()=>{d.dispose(),c.add(l())}));return c}n.withServices=a})(Ae||(Ae={}));x1();zr();ir();Fo();Oi();qe();Qi();E5();_u();Hr();Ma();lr();Ou();_();v();b();ke();Dl();xt();ye();le();bn();Hv();Ud();Or();_();v();b();var h_=class n{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new n(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0,o=e.getVisibleRanges();if(o.length>0){t=o[0].getStartPosition();let s=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-s}return new n(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,o,s){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=o,this._cursorPosition=s}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){let t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;let t=e.getPosition();if(!this._cursorPosition||!t)return;let i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i)}};_();v();b();ke();Po();wt();$n();le();bn();Ln();ca();Bo();es();ft();Ke();Hr();Pc();Ge();qe();var hF=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},uF=function(n,e){return function(t,i){e(t,i,n)}},yJ=fc("diff-review-insert",ue.add,p("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),SJ=fc("diff-review-remove",ue.remove,p("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),xJ=fc("diff-review-close",ue.close,p("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer.")),ld=class extends H{constructor(e,t,i,o,s,r,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=o,this._width=s,this._height=r,this._diffs=a,this._models=l,this._instantiationService=c,this._state=pr(this,(d,h)=>{let u=this._visible.read(d);if(this._parentNode.style.visibility=u?"visible":"hidden",!u)return null;let f=h.add(this._instantiationService.createInstance(oF,this._diffs,this._models,this._setVisible,this._canClose)),g=h.add(this._instantiationService.createInstance(dF,this._parentNode,f,this._width,this._height,this._models));return{model:f,view:g}}).recomputeInitiallyAndOnChange(this._store)}next(){ri(e=>{let t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){ri(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){ri(e=>{this._setVisible(!1,e)})}};ld._ttPolicy=Bs("diffReview",{createHTML:n=>n});ld=hF([uF(8,Ye)],ld);var oF=class extends H{constructor(e,t,i,o,s){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=o,this._accessibilitySignalService=s,this._groups=ct(this,[]),this._currentGroupIdx=ct(this,0),this._currentElementIdx=ct(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((r,a)=>this._groups.read(a)[r]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((r,a)=>{var l;return(l=this.currentGroup.read(a))===null||l===void 0?void 0:l.lines[r]}),this._register(pt(r=>{let a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}let l=LJ(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());ri(c=>{let d=this._models.getModifiedPosition();if(d){let h=l.findIndex(u=>d?.lineNumber{let a=this.currentElement.read(r);a?.type===jo.Deleted?this._accessibilitySignalService.playSignal(Ve.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):a?.type===jo.Added&&this._accessibilitySignalService.playSignal(Ve.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(pt(r=>{var a;let l=this.currentElement.read(r);if(l&&l.type!==jo.Header){let c=(a=l.modifiedLineNumber)!==null&&a!==void 0?a:l.diff.modified.startLineNumber;this._models.modifiedSetSelection(P.fromPositions(new U(c,1)))}}))}_goToGroupDelta(e,t){let i=this.groups.get();!i||i.length<=1||Pf(t,o=>{this._currentGroupIdx.set(ze.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),o),this._currentElementIdx.set(0,o)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){let t=this.currentGroup.get();!t||t.lines.length<=1||ri(i=>{this._currentElementIdx.set(ze.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){let t=this.currentGroup.get();if(!t)return;let i=t.lines.indexOf(e);i!==-1&&ri(o=>{this._currentElementIdx.set(i,o)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);let e=this.currentElement.get();e&&(e.type===jo.Deleted?this._models.originalReveal(P.fromPositions(new U(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==jo.Header?P.fromPositions(new U(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};oF=hF([uF(4,rl)],oF);var T1=3;function LJ(n,e,t){let i=[];for(let o of ag(n,(s,r)=>r.modified.startLineNumber-s.modified.endLineNumberExclusive<2*T1)){let s=[];s.push(new rF);let r=new Ne(Math.max(1,o[0].original.startLineNumber-T1),Math.min(o[o.length-1].original.endLineNumberExclusive+T1,e+1)),a=new Ne(Math.max(1,o[0].modified.startLineNumber-T1),Math.min(o[o.length-1].modified.endLineNumberExclusive+T1,t+1));K1(o,(d,h)=>{let u=new Ne(d?d.original.endLineNumberExclusive:r.startLineNumber,h?h.original.startLineNumber:r.endLineNumberExclusive),f=new Ne(d?d.modified.endLineNumberExclusive:a.startLineNumber,h?h.modified.startLineNumber:a.endLineNumberExclusive);u.forEach(g=>{s.push(new cF(g,f.startLineNumber+(g-u.startLineNumber)))}),h&&(h.original.forEach(g=>{s.push(new aF(h,g))}),h.modified.forEach(g=>{s.push(new lF(h,g))}))});let l=o[0].modified.join(o[o.length-1].modified),c=o[0].original.join(o[o.length-1].original);i.push(new sF(new So(l,c),s))}return i}var jo;(function(n){n[n.Header=0]="Header",n[n.Unchanged=1]="Unchanged",n[n.Deleted=2]="Deleted",n[n.Added=3]="Added"})(jo||(jo={}));var sF=class{constructor(e,t){this.range=e,this.lines=t}},rF=class{constructor(){this.type=jo.Header}},aF=class{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=jo.Deleted,this.modifiedLineNumber=void 0}},lF=class{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=jo.Added,this.originalLineNumber=void 0}},cF=class{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=jo.Unchanged}},dF=class extends H{constructor(e,t,i,o,s,r){super(),this._element=e,this._model=t,this._width=i,this._height=o,this._models=s,this._languageService=r,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";let a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new Eo(a)),this._register(pt(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new Ro("diffreview.close",p("label.close","Close"),"close-diff-review "+Xe.asClassName(xJ),!0,async()=>t.close()),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new uh(this._content,{})),Wi(this.domNode,this._scrollbar.getDomNode(),a),this._register(pt(l=>{this._height.read(l),this._width.read(l),this._scrollbar.scanDomNode()})),this._register(be(()=>{Wi(this.domNode)})),this._register(br(this.domNode,{width:this._width,height:this._height})),this._register(br(this._content,{width:this._width,height:this._height})),this._register(Jn((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(Ut(this.domNode,"keydown",l=>{(l.equals(18)||l.equals(2066)||l.equals(530))&&(l.preventDefault(),this._model.goToNextLine()),(l.equals(16)||l.equals(2064)||l.equals(528))&&(l.preventDefault(),this._model.goToPreviousLine()),(l.equals(9)||l.equals(2057)||l.equals(521)||l.equals(1033))&&(l.preventDefault(),this._model.close()),(l.equals(10)||l.equals(3))&&(l.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){let t=this._models.getOriginalOptions(),i=this._models.getModifiedOptions(),o=document.createElement("div");o.className="diff-review-table",o.setAttribute("role","list"),o.setAttribute("aria-label",p("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),Si(o,i.get(50)),Wi(this._content,o);let s=this._models.getOriginalModel(),r=this._models.getModifiedModel();if(!s||!r)return;let a=s.getOptions(),l=r.getOptions(),c=i.get(67),d=this._model.currentGroup.get();for(let h of d?.lines||[]){if(!d)break;let u;if(h.type===jo.Header){let g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");let m=d.range,C=this._model.currentGroupIndex.get(),S=this._model.groups.get().length,w=T=>T===0?p("no_lines_changed","no lines changed"):T===1?p("one_line_changed","1 line changed"):p("more_lines_changed","{0} lines changed",T),y=w(m.original.length),x=w(m.modified.length);g.setAttribute("aria-label",p({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.']},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",C+1,S,m.original.startLineNumber,y,m.modified.startLineNumber,x));let k=document.createElement("div");k.className="diff-review-cell diff-review-summary",k.appendChild(document.createTextNode(`${C+1}/${S}: @@ -${m.original.startLineNumber},${m.original.length} +${m.modified.startLineNumber},${m.modified.length} @@`)),g.appendChild(k),u=g}else u=this._createRow(h,c,this._width.get(),t,s,a,i,r,l);o.appendChild(u);let f=We(g=>this._model.currentElement.read(g)===h);e.add(pt(g=>{let m=f.read(g);u.tabIndex=m?0:-1,m&&u.focus()})),e.add($(u,"focus",()=>{this._model.goToLine(h)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,o,s,r,a,l,c){let d=o.get(145),h=d.glyphMarginWidth+d.lineNumbersWidth,u=a.get(145),f=10+u.glyphMarginWidth+u.lineNumbersWidth,g="diff-review-row",m="",C="diff-review-spacer",S=null;switch(e.type){case jo.Added:g="diff-review-row line-insert",m=" char-insert",S=yJ;break;case jo.Deleted:g="diff-review-row line-delete",m=" char-delete",S=SJ;break}let w=document.createElement("div");w.style.minWidth=i+"px",w.className=g,w.setAttribute("role","listitem"),w.ariaLevel="";let y=document.createElement("div");y.className="diff-review-cell",y.style.height=`${t}px`,w.appendChild(y);let x=document.createElement("span");x.style.width=h+"px",x.style.minWidth=h+"px",x.className="diff-review-line-number"+m,e.originalLineNumber!==void 0?x.appendChild(document.createTextNode(String(e.originalLineNumber))):x.innerText="\xA0",y.appendChild(x);let k=document.createElement("span");k.style.width=f+"px",k.style.minWidth=f+"px",k.style.paddingRight="10px",k.className="diff-review-line-number"+m,e.modifiedLineNumber!==void 0?k.appendChild(document.createTextNode(String(e.modifiedLineNumber))):k.innerText="\xA0",y.appendChild(k);let T=document.createElement("span");if(T.className=C,S){let W=document.createElement("span");W.className=Xe.asClassName(S),W.innerText="\xA0\xA0",T.appendChild(W)}else T.innerText="\xA0\xA0";y.appendChild(T);let N;if(e.modifiedLineNumber!==void 0){let W=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);ld._ttPolicy&&(W=ld._ttPolicy.createHTML(W)),y.insertAdjacentHTML("beforeend",W),N=l.getLineContent(e.modifiedLineNumber)}else{let W=this._getLineHtml(s,o,r.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);ld._ttPolicy&&(W=ld._ttPolicy.createHTML(W)),y.insertAdjacentHTML("beforeend",W),N=s.getLineContent(e.originalLineNumber)}N.length===0&&(N=p("blankLine","blank"));let M="";switch(e.type){case jo.Unchanged:e.originalLineNumber===e.modifiedLineNumber?M=p({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",N,e.originalLineNumber):M=p("equalLine","{0} original line {1} modified line {2}",N,e.originalLineNumber,e.modifiedLineNumber);break;case jo.Added:M=p("insertLine","+ {0} modified line {1}",N,e.modifiedLineNumber);break;case jo.Deleted:M=p("deleteLine","- {0} original line {1}",N,e.originalLineNumber);break}return w.setAttribute("aria-label",M),w}_getLineHtml(e,t,i,o,s){let r=e.getLineContent(o),a=t.get(50),l=Hi.createEmpty(r,s),c=Wo.isBasicASCII(r,e.mightContainNonBasicASCII()),d=Wo.containsRTL(r,c,e.mightContainRTL());return gm(new qr(a.isMonospace&&!t.get(33),a.canUseHalfwidthRightwardsArrow,r,!1,c,d,0,l,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(117),t.get(99),t.get(94),t.get(51)!==Zs.OFF,null)).html}};dF=hF([uF(5,ii)],dF);var R2=class{constructor(e){this.editors=e}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(e){this.editors.original.revealRange(e),this.editors.original.setSelection(e),this.editors.original.focus()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(e){e&&(this.editors.modified.revealRange(e),this.editors.modified.setSelection(e)),this.editors.modified.focus()}modifiedSetSelection(e){this.editors.modified.setSelection(e)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){var e;return(e=this.editors.modified.getPosition())!==null&&e!==void 0?e:void 0}};_();v();b();le();bn();_();v();b();ke();Po();wt();Dl();$n();le();bn();Ln();ca();es();Ge();var cd=class n extends H{constructor(e,t,i,o,s){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=o,this._editors=s,this._originalScrollTop=$t(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=$t(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=fo("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=ct(this,0),this._modifiedViewZonesChangedSignal=fo("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=fo("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=pr(this,(d,h)=>{var u;this._element.replaceChildren();let f=this._diffModel.read(d),g=(u=f?.diff.read(d))===null||u===void 0?void 0:u.movedTexts;if(!g||g.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(d);let m=this._originalEditorLayoutInfo.read(d),C=this._modifiedEditorLayoutInfo.read(d);if(!m||!C){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(d),this._originalViewZonesChangedSignal.read(d);let S=g.map(M=>{function W(Se,pe){let Pe=pe.getTopForLineNumber(Se.startLineNumber,!0),Qe=pe.getTopForLineNumber(Se.endLineNumberExclusive,!0);return(Pe+Qe)/2}let j=W(M.lineRangeMapping.original,this._editors.original),G=this._originalScrollTop.read(d),V=W(M.lineRangeMapping.modified,this._editors.modified),z=this._modifiedScrollTop.read(d),te=j-G,ee=V-z,ce=Math.min(j,V),Ce=Math.max(j,V);return{range:new ze(ce,Ce),from:te,to:ee,fromWithoutScroll:j,toWithoutScroll:V,move:M}});S.sort(e9(Io(M=>M.fromWithoutScroll>M.toWithoutScroll,t9),Io(M=>M.fromWithoutScroll>M.toWithoutScroll?M.fromWithoutScroll:-M.toWithoutScroll,ma)));let w=fF.compute(S.map(M=>M.range)),y=10,x=m.verticalScrollbarWidth,k=(w.getTrackCount()-1)*10+y*2,T=x+k+(C.contentLeft-n.movedCodeBlockPadding),N=0;for(let M of S){let W=w.getTrack(N),j=x+y+W*10,G=15,V=15,z=T,te=C.glyphMarginWidth+C.lineNumbersWidth,ee=18,ce=document.createElementNS("http://www.w3.org/2000/svg","rect");ce.classList.add("arrow-rectangle"),ce.setAttribute("x",`${z-te}`),ce.setAttribute("y",`${M.to-ee/2}`),ce.setAttribute("width",`${te}`),ce.setAttribute("height",`${ee}`),this._element.appendChild(ce);let Ce=document.createElementNS("http://www.w3.org/2000/svg","g"),Se=document.createElementNS("http://www.w3.org/2000/svg","path");Se.setAttribute("d",`M 0 ${M.from} L ${j} ${M.from} L ${j} ${M.to} L ${z-V} ${M.to}`),Se.setAttribute("fill","none"),Ce.appendChild(Se);let pe=document.createElementNS("http://www.w3.org/2000/svg","polygon");pe.classList.add("arrow"),h.add(pt(Pe=>{Se.classList.toggle("currentMove",M.move===f.activeMovedText.read(Pe)),pe.classList.toggle("currentMove",M.move===f.activeMovedText.read(Pe))})),pe.setAttribute("points",`${z-V},${M.to-G/2} ${z},${M.to} ${z-V},${M.to+G/2}`),Ce.appendChild(pe),this._element.appendChild(Ce),N++}this.width.set(k,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(be(()=>this._element.remove())),this._register(pt(d=>{let h=this._originalEditorLayoutInfo.read(d),u=this._modifiedEditorLayoutInfo.read(d);!h||!u||(this._element.style.left=`${h.width-h.verticalScrollbarWidth}px`,this._element.style.height=`${h.height}px`,this._element.style.width=`${h.verticalScrollbarWidth+h.contentLeft-n.movedCodeBlockPadding+this.width.read(d)}px`)})),this._register(Ph(this._state));let r=We(d=>{let h=this._diffModel.read(d),u=h?.diff.read(d);return u?u.movedTexts.map(f=>({move:f,original:new Gh(Rh(f.lineRangeMapping.original.startLineNumber-1),18),modified:new Gh(Rh(f.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(m_(this._editors.original,r.map(d=>d.map(h=>h.original)))),this._register(m_(this._editors.modified,r.map(d=>d.map(h=>h.modified)))),this._register(Jn((d,h)=>{let u=r.read(d);for(let f of u)h.add(new P2(this._editors.original,f.original,f.move,"original",this._diffModel.get())),h.add(new P2(this._editors.modified,f.modified,f.move,"modified",this._diffModel.get()))}));let a=fo("original.onDidFocusEditorWidget",d=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),l=fo("modified.onDidFocusEditorWidget",d=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),c="modified";this._register(Mh({createEmptyChangeSummary:()=>{},handleChange:(d,h)=>(d.didChange(a)&&(c="original"),d.didChange(l)&&(c="modified"),!0)},d=>{a.read(d),l.read(d);let h=this._diffModel.read(d);if(!h)return;let u=h.diff.read(d),f;if(u&&c==="original"){let g=this._editors.originalCursor.read(d);g&&(f=u.movedTexts.find(m=>m.lineRangeMapping.original.contains(g.lineNumber)))}if(u&&c==="modified"){let g=this._editors.modifiedCursor.read(d);g&&(f=u.movedTexts.find(m=>m.lineRangeMapping.modified.contains(g.lineNumber)))}f!==h.movedTextToCompare.get()&&h.movedTextToCompare.set(void 0,void 0),h.setActiveMovedText(f)}))}};cd.movedCodeBlockPadding=4;var fF=class n{static compute(e){let t=[],i=[];for(let o of e){let s=t.findIndex(r=>!r.intersectsStrict(o));s===-1&&(t.length>=6?s=Y3(t,Io(a=>a.intersectWithRangeLength(o),ma)):(s=t.length,t.push(new nS))),t[s].addRange(o),i.push(s)}return new n(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}},P2=class extends f_{constructor(e,t,i,o,s){let r=kt("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=o,this._diffModel=s,this._nodes=kt("div.diff-moved-code-block",{style:{marginRight:"4px"}},[kt("div.text-content@textContent"),kt("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);let a=$t(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(br(this._nodes.root,{paddingRight:a.map(u=>u.verticalScrollbarWidth)}));let l;i.changes.length>0?l=this._kind==="original"?p("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):p("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?p("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):p("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);let c=this._register(new Eo(this._nodes.actionBar,{highlightToggledItems:!0})),d=new Ro("",l,"",!1);c.push(d,{icon:!1,label:!0});let h=new Ro("","Compare",Xe.asClassName(ue.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(pt(u=>{let f=this._diffModel.movedTextToCompare.read(u)===i;h.checked=f})),c.push(h,{icon:!1,label:!0})}};_();v();b();$n();Ln();sv();Ge();is();var C0t=F("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},p("diffEditor.move.border","The border color for text that got moved in the diff editor.")),w0t=F("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},p("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor.")),y0t=F("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},p("diffEditor.unchangedRegionShadow","The color of the shadow around unchanged region widgets.")),kJ=fc("diff-insert",ue.add,p("diffInsertIcon","Line decoration for inserts in the diff editor.")),gF=fc("diff-remove",ue.remove,p("diffRemoveIcon","Line decoration for removals in the diff editor.")),mF=qi.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Xe.asClassName(kJ),marginClassName:"gutter-insert"}),pF=qi.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Xe.asClassName(gF),marginClassName:"gutter-delete"}),_F=qi.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),bF=qi.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),vF=qi.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),JU=qi.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),eK=qi.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),N1=qi.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),tK=qi.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),iK=qi.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});ca();var O2=class extends H{constructor(e,t,i,o){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=We(this,s=>{var r;let a=(r=this._diffModel.read(s))===null||r===void 0?void 0:r.diff.read(s);if(!a)return null;let l=this._diffModel.read(s).movedTextToCompare.read(s),c=this._options.renderIndicators.read(s),d=this._options.showEmptyDecorations.read(s),h=[],u=[];if(!l)for(let g of a.mappings)if(g.lineRangeMapping.original.isEmpty||h.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:c?pF:bF}),g.lineRangeMapping.modified.isEmpty||u.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:c?mF:_F}),g.lineRangeMapping.modified.isEmpty||g.lineRangeMapping.original.isEmpty)g.lineRangeMapping.original.isEmpty||h.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:tK}),g.lineRangeMapping.modified.isEmpty||u.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:JU});else for(let m of g.lineRangeMapping.innerChanges||[])g.lineRangeMapping.original.contains(m.originalRange.startLineNumber)&&h.push({range:m.originalRange,options:m.originalRange.isEmpty()&&d?iK:N1}),g.lineRangeMapping.modified.contains(m.modifiedRange.startLineNumber)&&u.push({range:m.modifiedRange,options:m.modifiedRange.isEmpty()&&d?eK:vF});if(l)for(let g of l.changes){let m=g.original.toInclusiveRange();m&&h.push({range:m,options:c?pF:bF});let C=g.modified.toInclusiveRange();C&&u.push({range:C,options:c?mF:_F});for(let S of g.innerChanges||[])h.push({range:S.originalRange,options:N1}),u.push({range:S.modifiedRange,options:vF})}let f=this._diffModel.read(s).activeMovedText.read(s);for(let g of a.movedTexts)h.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(g===f?" currentMove":""),blockPadding:[cd.movedCodeBlockPadding,0,cd.movedCodeBlockPadding,cd.movedCodeBlockPadding]}}),u.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(g===f?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:h,modifiedDecorations:u}}),this._register(g_(this._editors.original,this._decorations.map(s=>s?.originalDecorations||[]))),this._register(g_(this._editors.modified,this._decorations.map(s=>s?.modifiedDecorations||[])))}};_();v();b();le();bn();var F2=class extends H{constructor(e,t,i,o){super(),this._options=e,this._domNode=t,this._dimensions=i,this._sashes=o,this._sashRatio=ct(this,void 0),this.sashLeft=We(this,s=>{var r;let a=(r=this._sashRatio.read(s))!==null&&r!==void 0?r:this._options.splitViewDefaultRatio.read(s);return this._computeSashLeft(a,s)}),this._sash=this._register(new $f(this._domNode,{getVerticalSashTop:s=>0,getVerticalSashLeft:s=>this.sashLeft.get(),getVerticalSashHeight:s=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(s=>{let r=this._dimensions.width.get(),a=this._computeSashLeft((this._startSashPosition+(s.currentX-s.startX))/r,void 0);this._sashRatio.set(a/r,void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._sashRatio.set(void 0,void 0))),this._register(pt(s=>{let r=this._sashes.read(s);r&&(this._sash.orthogonalEndSash=r.bottom)})),this._register(pt(s=>{let r=this._options.enableSplitViewResizing.read(s);this._sash.state=r?3:0,this.sashLeft.read(s),this._dimensions.height.read(s),this._sash.layout()}))}_computeSashLeft(e,t){let i=this._dimensions.width.read(t),o=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),s=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):o,r=100;return i<=r*2?o:si-r?i-r:s}};_();v();b();ke();wt();Gt();$n();le();bn();Ln();xi();_();v();b();Gt();fs();le();bn();_();v();b();Ur();qe();ye();vg();Bo();dE();Gg();var nK=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},CF=function(n,e){return function(t,i){e(t,i,n)}},ng,yF=De("diffProviderFactoryService"),wF=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(B2,e)}};wF=nK([CF(0,Ye)],wF);_t(yF,wF,1);var B2=ng=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new B,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)===null||e===void 0||e.dispose()}async computeDiff(e,t,i,o){var s,r;if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,o);if(e.isDisposed()||t.isDisposed())return{changes:[],identical:!0,quitEarly:!1,moves:[]};if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new xo(new Ne(1,2),new Ne(1,t.getLineCount()+1),[new ts(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};let a=JSON.stringify([e.uri.toString(),t.uri.toString()]),l=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),c=ng.diffCache.get(a);if(c&&c.context===l)return c.result;let d=Er.create(),h=await this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),u=d.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:u,timedOut:(s=h?.quitEarly)!==null&&s!==void 0?s:!0,detectedMoves:i.computeMoves?(r=h?.moves.length)!==null&&r!==void 0?r:0:-1}),o.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!h)throw new Error("no diff result available");return ng.diffCache.size>10&&ng.diffCache.delete(ng.diffCache.keys().next().value),ng.diffCache.set(a,{result:h,context:l}),h}setOptions(e){var t;let i=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&((t=this.diffAlgorithmOnDidChangeSubscription)===null||t===void 0||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),i=!0),i&&this.onDidChangeEventEmitter.fire()}};B2.diffCache=new Map;B2=ng=nK([CF(1,rc),CF(2,nr)],B2);ca();Bo();Rb();fR();xi();wt();Na();var DJ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},EJ=function(n,e){return function(t,i){e(t,i,n)}},W2=class extends H{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i){super(),this.model=e,this._options=t,this._diffProviderFactoryService=i,this._isDiffUpToDate=ct(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=ct(this,void 0),this.diff=this._diff,this._unchangedRegions=ct(this,void 0),this.unchangedRegions=We(this,a=>{var l,c;return this._options.hideUnchangedRegions.read(a)?(c=(l=this._unchangedRegions.read(a))===null||l===void 0?void 0:l.regions)!==null&&c!==void 0?c:[]:(ri(d=>{var h;for(let u of((h=this._unchangedRegions.get())===null||h===void 0?void 0:h.regions)||[])u.collapseAll(d)}),[])}),this.movedTextToCompare=ct(this,void 0),this._activeMovedText=ct(this,void 0),this._hoveredMovedText=ct(this,void 0),this.activeMovedText=We(this,a=>{var l,c;return(c=(l=this.movedTextToCompare.read(a))!==null&&l!==void 0?l:this._hoveredMovedText.read(a))!==null&&c!==void 0?c:this._activeMovedText.read(a)}),this._cancellationTokenSource=new un,this._diffProvider=We(this,a=>{let l=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),c=fo("onDidChange",l.onDidChange);return{diffProvider:l,onChangeSignal:c}}),this._register(be(()=>this._cancellationTokenSource.cancel()));let o=Kv("contentChangedSignal"),s=this._register(new di(()=>o.trigger(void 0),200));this._register(pt(a=>{let l=this._unchangedRegions.read(a);if(!l||l.regions.some(g=>g.isDragged.read(a)))return;let c=l.originalDecorationIds.map(g=>e.original.getDecorationRange(g)).map(g=>g?Ne.fromRangeInclusive(g):void 0),d=l.modifiedDecorationIds.map(g=>e.modified.getDecorationRange(g)).map(g=>g?Ne.fromRangeInclusive(g):void 0),h=l.regions.map((g,m)=>!c[m]||!d[m]?void 0:new p_(c[m].startLineNumber,d[m].startLineNumber,c[m].length,g.visibleLineCountTop.read(a),g.visibleLineCountBottom.read(a))).filter(bc),u=[],f=!1;for(let g of ag(h,(m,C)=>m.getHiddenModifiedRange(a).endLineNumberExclusive===C.getHiddenModifiedRange(a).startLineNumber))if(g.length>1){f=!0;let m=g.reduce((S,w)=>S+w.lineCount,0),C=new p_(g[0].originalLineNumber,g[0].modifiedLineNumber,m,g[0].visibleLineCountTop.get(),g[g.length-1].visibleLineCountBottom.get());u.push(C)}else u.push(g[0]);if(f){let g=e.original.deltaDecorations(l.originalDecorationIds,u.map(C=>({range:C.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),m=e.modified.deltaDecorations(l.modifiedDecorationIds,u.map(C=>({range:C.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));ri(C=>{this._unchangedRegions.set({regions:u,originalDecorationIds:g,modifiedDecorationIds:m},C)})}}));let r=(a,l,c)=>{let d=p_.fromDiffs(a.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(c),this._options.hideUnchangedRegionsContextLineCount.read(c)),h,u=this._unchangedRegions.get();if(u){let C=u.originalDecorationIds.map(x=>e.original.getDecorationRange(x)).map(x=>x?Ne.fromRangeInclusive(x):void 0),S=u.modifiedDecorationIds.map(x=>e.modified.getDecorationRange(x)).map(x=>x?Ne.fromRangeInclusive(x):void 0),y=QU(u.regions.map((x,k)=>{if(!C[k]||!S[k])return;let T=C[k].length;return new p_(C[k].startLineNumber,S[k].startLineNumber,T,Math.min(x.visibleLineCountTop.get(),T),Math.min(x.visibleLineCountBottom.get(),T-x.visibleLineCountTop.get()))}).filter(bc),(x,k)=>!k||x.modifiedLineNumber>=k.modifiedLineNumber+k.lineCount&&x.originalLineNumber>=k.originalLineNumber+k.lineCount).map(x=>new So(x.getHiddenOriginalRange(c),x.getHiddenModifiedRange(c)));y=So.clip(y,Ne.ofLength(1,e.original.getLineCount()),Ne.ofLength(1,e.modified.getLineCount())),h=So.inverse(y,e.original.getLineCount(),e.modified.getLineCount())}let f=[];if(h)for(let C of d){let S=h.filter(w=>w.original.intersectsStrict(C.originalUnchangedRange)&&w.modified.intersectsStrict(C.modifiedUnchangedRange));f.push(...C.setVisibleRanges(S,l))}else f.push(...d);let g=e.original.deltaDecorations(u?.originalDecorationIds||[],f.map(C=>({range:C.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),m=e.modified.deltaDecorations(u?.modifiedDecorationIds||[],f.map(C=>({range:C.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:f,originalDecorationIds:g,modifiedDecorationIds:m},l)};this._register(e.modified.onDidChangeContent(a=>{if(this._diff.get()){let c=oa.fromModelContentChanges(a.changes),d=(this._lastDiff,e.original,e.modified,void 0);d&&(this._lastDiff=d,ri(h=>{this._diff.set(A1.fromDiffResult(this._lastDiff),h),r(d,h);let u=this.movedTextToCompare.get();this.movedTextToCompare.set(u?this._lastDiff.moves.find(f=>f.lineRangeMapping.modified.intersect(u.lineRangeMapping.modified)):void 0,h)}))}this._isDiffUpToDate.set(!1,void 0),s.schedule()})),this._register(e.original.onDidChangeContent(a=>{if(this._diff.get()){let c=oa.fromModelContentChanges(a.changes),d=(this._lastDiff,e.original,e.modified,void 0);d&&(this._lastDiff=d,ri(h=>{this._diff.set(A1.fromDiffResult(this._lastDiff),h),r(d,h);let u=this.movedTextToCompare.get();this.movedTextToCompare.set(u?this._lastDiff.moves.find(f=>f.lineRangeMapping.modified.intersect(u.lineRangeMapping.modified)):void 0,h)}))}this._isDiffUpToDate.set(!1,void 0),s.schedule()})),this._register(Jn(async(a,l)=>{var c,d;this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),s.cancel(),o.read(a);let h=this._diffProvider.read(a);h.onChangeSignal.read(a),Ts(cm,a),Ts(U0,a),this._isDiffUpToDate.set(!1,void 0);let u=[];l.add(e.original.onDidChangeContent(m=>{let C=oa.fromModelContentChanges(m.changes);u=sp(u,C)}));let f=[];l.add(e.modified.onDidChangeContent(m=>{let C=oa.fromModelContentChanges(m.changes);f=sp(f,C)}));let g=await h.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(a),maxComputationTimeMs:this._options.maxComputationTimeMs.read(a),computeMoves:this._options.showMoves.read(a)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||e.original.isDisposed()||e.modified.isDisposed()||(g=IJ(g,e.original,e.modified),g=(c=(e.original,e.modified,void 0))!==null&&c!==void 0?c:g,g=(d=(e.original,e.modified,void 0))!==null&&d!==void 0?d:g,ri(m=>{r(g,m),this._lastDiff=g;let C=A1.fromDiffResult(g);this._diff.set(C,m),this._isDiffUpToDate.set(!0,m);let S=this.movedTextToCompare.get();this.movedTextToCompare.set(S?this._lastDiff.moves.find(w=>w.lineRangeMapping.modified.intersect(S.lineRangeMapping.modified)):void 0,m)}))}))}ensureModifiedLineIsVisible(e,t,i){var o,s;if(((o=this.diff.get())===null||o===void 0?void 0:o.mappings.length)===0)return;let r=((s=this._unchangedRegions.get())===null||s===void 0?void 0:s.regions)||[];for(let a of r)if(a.getHiddenModifiedRange(void 0).contains(e)){a.showModifiedLine(e,t,i);return}}ensureOriginalLineIsVisible(e,t,i){var o,s;if(((o=this.diff.get())===null||o===void 0?void 0:o.mappings.length)===0)return;let r=((s=this._unchangedRegions.get())===null||s===void 0?void 0:s.regions)||[];for(let a of r)if(a.getHiddenOriginalRange(void 0).contains(e)){a.showOriginalLine(e,t,i);return}}async waitForDiff(){await V5(this.isDiffUpToDate,e=>e)}serializeState(){let e=this._unchangedRegions.get();return{collapsedRegions:e?.regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){var t;let i=(t=e.collapsedRegions)===null||t===void 0?void 0:t.map(s=>Ne.deserialize(s.range)),o=this._unchangedRegions.get();!o||!i||ri(s=>{for(let r of o.regions)for(let a of i)if(r.modifiedUnchangedRange.intersect(a)){r.setHiddenModifiedRange(a,s);break}})}};W2=DJ([EJ(2,yF)],W2);function IJ(n,e,t){return{changes:n.changes.map(i=>new xo(i.original,i.modified,i.innerChanges?i.innerChanges.map(o=>TJ(o,e,t)):void 0)),moves:n.moves,identical:n.identical,quitEarly:n.quitEarly}}function TJ(n,e,t){let i=n.originalRange,o=n.modifiedRange;return(i.endColumn!==1||o.endColumn!==1)&&i.endColumn===e.getLineMaxColumn(i.endLineNumber)&&o.endColumn===t.getLineMaxColumn(o.endLineNumber)&&i.endLineNumbernew M1(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,o){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=o}},M1=class{constructor(e){this.lineRangeMapping=e}},p_=class n{static fromDiffs(e,t,i,o,s){let r=xo.inverse(e,t,i),a=[];for(let l of r){let c=l.original.startLineNumber,d=l.modified.startLineNumber,h=l.original.length,u=c===1&&d===1,f=c+h===t+1&&d+h===i+1;(u||f)&&h>=s+o?(u&&!f&&(h-=s),f&&!u&&(c+=s,d+=s,h-=s),a.push(new n(c,d,h,0,0))):h>=s*2+o&&(c+=s,d+=s,h-=s*2,a.push(new n(c,d,h,0,0)))}return a}get originalUnchangedRange(){return Ne.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return Ne.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,o,s){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=ct(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=ct(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=We(this,l=>this.visibleLineCountTop.read(l)+this.visibleLineCountBottom.read(l)===this.lineCount&&!this.isDragged.read(l)),this.isDragged=ct(this,void 0);let r=Math.max(Math.min(o,this.lineCount),0),a=Math.max(Math.min(s,this.lineCount-o),0);fN(o===r),fN(s===a),this._visibleLineCountTop.set(r,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){let i=[],o=new ur(e.map(l=>l.modified)).subtractFrom(this.modifiedUnchangedRange),s=this.originalLineNumber,r=this.modifiedLineNumber,a=this.modifiedLineNumber+this.lineCount;if(o.ranges.length===0)this.showAll(t),i.push(this);else{let l=0;for(let c of o.ranges){let d=l===o.ranges.length-1;l++;let h=(d?a:c.endLineNumberExclusive)-r,u=new n(s,r,h,0,0);u.setHiddenModifiedRange(c,t),i.push(u),s=u.originalUnchangedRange.endLineNumberExclusive,r=u.modifiedUnchangedRange.endLineNumberExclusive}}return i}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return Ne.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return Ne.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){let i=e.startLineNumber-this.modifiedLineNumber,o=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,o,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){let i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){let i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,i){let o=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),s=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===0&&o{var C;this._contextMenuService.showContextMenu({domForShadowRoot:u&&(C=i.getDomNode())!==null&&C!==void 0?C:void 0,getAnchor:()=>({x:g,y:m}),getActions:()=>{let S=[],w=o.modified.isEmpty;return S.push(new Ro("diff.clipboard.copyDeletedContent",w?o.original.length>1?p("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):p("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):o.original.length>1?p("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):p("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,async()=>{let x=this._originalTextModel.getValueInRange(o.original.toExclusiveRange());await this._clipboardService.writeText(x)})),o.original.length>1&&S.push(new Ro("diff.clipboard.copyDeletedLineContent",w?p("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",o.original.startLineNumber+h):p("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",o.original.startLineNumber+h),void 0,!0,async()=>{let x=this._originalTextModel.getLineContent(o.original.startLineNumber+h);x===""&&(x=this._originalTextModel.getEndOfLineSequence()===0?` +`:`\r +`),await this._clipboardService.writeText(x)})),i.getOption(91)||S.push(new Ro("diff.inline.revertChange",p("diff.inline.revertChange.label","Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),S},autoSelectFirstItem:!0})};this._register(Ut(this._diffActions,"mousedown",g=>{if(!g.leftButton)return;let{top:m,height:C}=Sn(this._diffActions),S=Math.floor(d/3);g.preventDefault(),f(g.posx,m+C+S)})),this._register(i.onMouseMove(g=>{(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()?(h=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,d),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(g=>{g.event.leftButton&&(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()&&(g.event.preventDefault(),h=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,d),f(g.event.posx,g.event.posy+d))}))}_updateLightBulbPosition(e,t,i){let{top:o}=Sn(e),s=t-o,r=Math.floor(s/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;cn});function rK(n,e,t,i){Si(i,e.fontInfo);let o=t.length>0,s=new Sl(1e4),r=0,a=0,l=[];for(let u=0;u');let l=e.getLineContent(),c=Wo.isBasicASCII(l,o),d=Wo.containsRTL(l,c,s),h=eb(new qr(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,d,0,e,t,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==Zs.OFF,null),a);return a.appendString(""),h.characterMapping.getHorizontalOffset(h.characterMapping.length)}ca();Bo();ft();var NJ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},aK=function(n,e){return function(t,i){e(t,i,n)}},U2=class extends H{constructor(e,t,i,o,s,r,a,l,c,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=o,this._diffEditorWidget=s,this._canIgnoreViewZoneUpdateEvent=r,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=l,this._clipboardService=c,this._contextMenuService=d,this._originalTopPadding=ct(this,0),this._originalScrollOffset=ct(this,0),this._originalScrollOffsetAnimated=iF(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=ct(this,0),this._modifiedScrollOffset=ct(this,0),this._modifiedScrollOffsetAnimated=iF(this._targetWindow,this._modifiedScrollOffset,this._store);let h=ct("invalidateAlignmentsState",0),u=this._register(new di(()=>{h.set(h.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(y=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(y=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(y=>{(y.hasChanged(146)||y.hasChanged(67))&&u.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(y=>{(y.hasChanged(146)||y.hasChanged(67))&&u.schedule()}));let f=this._diffModel.map(y=>y?$t(y.model.original.onDidChangeTokens,()=>y.model.original.tokenization.backgroundTokenizationState===2):void 0).map((y,x)=>y?.read(x)),g=We(y=>{let x=this._diffModel.read(y),k=x?.diff.read(y);if(!x||!k)return null;h.read(y);let N=this._options.renderSideBySide.read(y);return lK(this._editors.original,this._editors.modified,k.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,N)}),m=We(y=>{var x;let k=(x=this._diffModel.read(y))===null||x===void 0?void 0:x.movedTextToCompare.read(y);if(!k)return null;h.read(y);let T=k.changes.map(N=>new M1(N));return lK(this._editors.original,this._editors.modified,T,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function C(){let y=document.createElement("div");return y.className="diagonal-fill",y}let S=this._register(new ae);this.viewZones=pr(this,(y,x)=>{var k,T,N,M,W,j,G,V;S.clear();let z=g.read(y)||[],te=[],ee=[],ce=this._modifiedTopPadding.read(y);ce>0&&ee.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:ce,showInHiddenAreas:!0,suppressMouseDown:!0});let Ce=this._originalTopPadding.read(y);Ce>0&&te.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:Ce,showInHiddenAreas:!0,suppressMouseDown:!0});let Se=this._options.renderSideBySide.read(y),pe=Se||(k=this._editors.modified._getViewModel())===null||k===void 0?void 0:k.createLineBreaksComputer();if(pe){let Ot=this._editors.original.getModel();for(let Cn of z)if(Cn.diff)for(let Ni=Cn.originalRange.startLineNumber;NiOt.getLineCount())return{orig:te,mod:ee};pe?.addRequest(Ot.getLineContent(Ni),null,null)}}let Pe=(T=pe?.finalize())!==null&&T!==void 0?T:[],Qe=0,Te=this._editors.modified.getOption(67),de=(N=this._diffModel.read(y))===null||N===void 0?void 0:N.movedTextToCompare.read(y),Ki=(W=(M=this._editors.original.getModel())===null||M===void 0?void 0:M.mightContainNonBasicASCII())!==null&&W!==void 0?W:!1,Vn=(G=(j=this._editors.original.getModel())===null||j===void 0?void 0:j.mightContainRTL())!==null&&G!==void 0?G:!1,Gi=H2.fromEditor(this._editors.modified);for(let Ot of z)if(Ot.diff&&!Se){if(!Ot.originalRange.isEmpty){f.read(y);let Ni=document.createElement("div");Ni.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");let tt=this._editors.original.getModel();if(Ot.originalRange.endLineNumberExclusive-1>tt.getLineCount())return{orig:te,mod:ee};let vr=new V2(Ot.originalRange.mapToLineArray(Hn=>tt.tokenization.getLineTokens(Hn)),Ot.originalRange.mapToLineArray(Hn=>Pe[Qe++]),Ki,Vn),Cr=[];for(let Hn of Ot.diff.innerChanges||[])Cr.push(new Oc(Hn.originalRange.delta(-(Ot.diff.original.startLineNumber-1)),N1.className,0));let cs=rK(vr,Gi,Cr,Ni),wr=document.createElement("div");if(wr.className="inline-deleted-margin-view-zone",Si(wr,Gi.fontInfo),this._options.renderIndicators.read(y))for(let Hn=0;HnG1(pc),wr,this._editors.modified,Ot.diff,this._diffEditorWidget,cs.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Hn=0;Hn1&&te.push({afterLineNumber:Ot.originalRange.startLineNumber+Hn,domNode:C(),heightInPx:(ua-1)*Te,showInHiddenAreas:!0,suppressMouseDown:!0})}ee.push({afterLineNumber:Ot.modifiedRange.startLineNumber-1,domNode:Ni,heightInPx:cs.heightInLines*Te,minWidthInPx:cs.minWidthInPx,marginDomNode:wr,setZoneId(Hn){pc=Hn},showInHiddenAreas:!0,suppressMouseDown:!0})}let Cn=document.createElement("div");Cn.className="gutter-delete",te.push({afterLineNumber:Ot.originalRange.endLineNumberExclusive-1,domNode:C(),heightInPx:Ot.modifiedHeightInPx,marginDomNode:Cn,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Cn=Ot.modifiedHeightInPx-Ot.originalHeightInPx;if(Cn>0){if(de?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(Ot.originalRange.endLineNumberExclusive-1))continue;te.push({afterLineNumber:Ot.originalRange.endLineNumberExclusive-1,domNode:C(),heightInPx:Cn,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Ni=function(){let vr=document.createElement("div");return vr.className="arrow-revert-change "+Xe.asClassName(ue.arrowRight),x.add($(vr,"mousedown",Cr=>Cr.stopPropagation())),x.add($(vr,"click",Cr=>{Cr.stopPropagation(),s.revert(Ot.diff)})),ve("div",{},vr)};var Ns=Ni;if(de?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(Ot.modifiedRange.endLineNumberExclusive-1))continue;let tt;Ot.diff&&Ot.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(y)&&(tt=Ni()),ee.push({afterLineNumber:Ot.modifiedRange.endLineNumberExclusive-1,domNode:C(),heightInPx:-Cn,marginDomNode:tt,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(let Ot of(V=m.read(y))!==null&&V!==void 0?V:[]){if(!de?.lineRangeMapping.original.intersect(Ot.originalRange)||!de?.lineRangeMapping.modified.intersect(Ot.modifiedRange))continue;let Cn=Ot.modifiedHeightInPx-Ot.originalHeightInPx;Cn>0?te.push({afterLineNumber:Ot.originalRange.endLineNumberExclusive-1,domNode:C(),heightInPx:Cn,showInHiddenAreas:!0,suppressMouseDown:!0}):ee.push({afterLineNumber:Ot.modifiedRange.endLineNumberExclusive-1,domNode:C(),heightInPx:-Cn,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:te,mod:ee}});let w=!1;this._register(this._editors.original.onDidScrollChange(y=>{y.scrollLeftChanged&&!w&&(w=!0,this._editors.modified.setScrollLeft(y.scrollLeft),w=!1)})),this._register(this._editors.modified.onDidScrollChange(y=>{y.scrollLeftChanged&&!w&&(w=!0,this._editors.original.setScrollLeft(y.scrollLeft),w=!1)})),this._originalScrollTop=$t(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=$t(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(pt(y=>{let x=this._originalScrollTop.read(y)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(y))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(y));x!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(x,1)})),this._register(pt(y=>{let x=this._modifiedScrollTop.read(y)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(y))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(y));x!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(x,1)})),this._register(pt(y=>{var x;let k=(x=this._diffModel.read(y))===null||x===void 0?void 0:x.movedTextToCompare.read(y),T=0;if(k){let N=this._editors.original.getTopForLineNumber(k.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();T=this._editors.modified.getTopForLineNumber(k.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-N}T>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(T,void 0)):T<0?(this._modifiedTopPadding.set(-T,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.get()-T,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+T,void 0,!0)}))}};U2=NJ([aK(8,d_),aK(9,Ds)],U2);function lK(n,e,t,i,o,s){let r=new mo(cK(n,i)),a=new mo(cK(e,o)),l=n.getOption(67),c=e.getOption(67),d=[],h=0,u=0;function f(m,C){for(;;){let S=r.peek(),w=a.peek();if(S&&S.lineNumber>=m&&(S=void 0),w&&w.lineNumber>=C&&(w=void 0),!S&&!w)break;let y=S?S.lineNumber-h:Number.MAX_VALUE,x=w?w.lineNumber-u:Number.MAX_VALUE;yx?(a.dequeue(),S={lineNumber:w.lineNumber-u+h,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:Ne.ofLength(S.lineNumber,1),modifiedRange:Ne.ofLength(w.lineNumber,1),originalHeightInPx:l+S.heightInPx,modifiedHeightInPx:c+w.heightInPx,diff:void 0})}}for(let m of t){let x=function(k,T){var N,M,W,j;if(kee.lineNumberee+ce.heightInPx,0))!==null&&M!==void 0?M:0,te=(j=(W=a.takeWhile(ee=>ee.lineNumberee+ce.heightInPx,0))!==null&&j!==void 0?j:0;d.push({originalRange:G,modifiedRange:V,originalHeightInPx:G.length*l+z,modifiedHeightInPx:V.length*c+te,diff:m.lineRangeMapping}),y=k,w=T};var g=x;let C=m.lineRangeMapping;f(C.original.startLineNumber,C.modified.startLineNumber);let S=!0,w=C.modified.startLineNumber,y=C.original.startLineNumber;if(s)for(let k of C.innerChanges||[]){k.originalRange.startColumn>1&&k.modifiedRange.startColumn>1&&x(k.originalRange.startLineNumber,k.modifiedRange.startLineNumber);let T=n.getModel(),N=k.originalRange.endLineNumber<=T.getLineCount()?T.getLineMaxColumn(k.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;k.originalRange.endColumn1&&i.push({lineNumber:l,heightInPx:r*(c-1)})}for(let l of n.getWhitespaces()){if(e.has(l.id))continue;let c=l.afterLineNumber===0?0:s.convertViewPositionToModelPosition(new U(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return YU(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}_();v();b();ke();le();bn();ca();_();v();b();ke();le();bn();Bo();es();var K2=class extends H{constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=$t(this._editor.onDidScrollChange,r=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(r=>r===0),this.modelAttached=$t(this._editor.onDidChangeModel,r=>this._editor.hasModel()),this.editorOnDidChangeViewZones=fo("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=fo("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=Kv("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";let o=this._domNode.appendChild(kt("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),s=new ResizeObserver(()=>{ri(r=>{this.domNodeSizeChanged.trigger(r)})});s.observe(this._domNode),this._register(be(()=>s.disconnect())),this._register(pt(r=>{o.className=this.isScrollTopZero.read(r)?"":"scroll-decoration"})),this._register(pt(r=>this.render(r)))}dispose(){super.dispose(),Wi(this._domNode)}render(e){if(!this.modelAttached.read(e))return;this.domNodeSizeChanged.read(e),this.editorOnDidChangeViewZones.read(e),this.editorOnDidContentSizeChange.read(e);let t=this.scrollTop.read(e),i=this._editor.getVisibleRanges(),o=new Set(this.views.keys()),s=ze.ofStartAndLength(0,this._domNode.clientHeight);if(!s.isEmpty)for(let r of i){let a=new Ne(r.startLineNumber,r.endLineNumber+1),l=this.itemProvider.getIntersectingGutterItems(a,e);ri(c=>{for(let d of l){if(!d.range.intersect(a))continue;o.delete(d.id);let h=this.views.get(d.id);if(h)h.item.set(d,c);else{let m=document.createElement("div");this._domNode.appendChild(m);let C=ct("item",d),S=this.itemProvider.createView(C,m);h=new SF(C,S,m),this.views.set(d.id,h)}let u=d.range.startLineNumber<=this._editor.getModel().getLineCount()?this._editor.getTopForLineNumber(d.range.startLineNumber,!0)-t:this._editor.getBottomForLineNumber(d.range.startLineNumber-1,!1)-t,g=(d.range.isEmpty?u:this._editor.getBottomForLineNumber(d.range.endLineNumberExclusive-1,!0)-t)-u;h.domNode.style.top=`${u}px`,h.domNode.style.height=`${g}px`,h.gutterItemView.layout(ze.ofStartAndLength(u,g),s)}})}for(let r of o){let a=this.views.get(r);a.gutterItemView.dispose(),this._domNode.removeChild(a.domNode),this.views.delete(r)}}},SF=class{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}};_();v();b();Po();var __=class extends bs{constructor(e){super(),this._getContext=e}runAction(e,t){let i=this._getContext();return super.runAction(e,i)}};Bo();es();Ke();_();v();b();om();var R1=class extends z0{constructor(e){super(),this._textModel=e}getValueOfRange(e){return this._textModel.getValueInRange(e)}get length(){let e=this._textModel.getLineCount(),t=this._textModel.getLineLength(e);return new ws(e-1,t)}};_();v();b();ke();Qs();_();v();b();Po();$n();Ln();ye();le();Ge();var $2=class extends H{constructor(e,t,i={orientation:0}){var o;super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new dC),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new ae),i.hoverDelegate=(o=i.hoverDelegate)!==null&&o!==void 0?o:this._register(Mf()),this.options=i,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new og(()=>{var s;return(s=this.toggleMenuActionViewItem)===null||s===void 0?void 0:s.show()},i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new Eo(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(s,r)=>{var a;if(s.id===og.ID)return this.toggleMenuActionViewItem=new Bh(s,s.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Xe.asClassNameArray((a=i.moreIcon)!==null&&a!==void 0?a:ue.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){let l=i.actionViewItemProvider(s,r);if(l)return l}if(s instanceof bl){let l=new Bh(s,s.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:s.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return l.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(l),this.disposables.add(this._onDidChangeDropdownVisibility.add(l.onDidChangeVisibility)),l}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();let i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach(o=>{this.actionBar.push(o,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(o)})})}getKeybindingLabel(e){var t,i,o;let s=this.lookupKeybindings?(i=(t=this.options).getKeyBinding)===null||i===void 0?void 0:i.call(t,e):void 0;return(o=s?.getLabel())!==null&&o!==void 0?o:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}},og=class n extends Ro{constructor(e,t){t=t||p("moreActions","More Actions..."),super(n.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}};og.ID="toolbar.toggle.more";Po();wt();xt();ye();js();le();Ge();zr();ir();Oi();Gg();var dK=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},da=function(n,e){return function(t,i){e(t,i,n)}},xF=class extends $2{constructor(e,t,i,o,s,r,a,l){super(e,s,{getKeyBinding:d=>{var h;return(h=r.lookupKeybinding(d.id))!==null&&h!==void 0?h:void 0},...t,allowContextMenu:!0,skipTelemetry:typeof t?.telemetrySource=="string"}),this._options=t,this._menuService=i,this._contextKeyService=o,this._contextMenuService=s,this._keybindingService=r,this._commandService=a,this._sessionDisposables=this._store.add(new ae);let c=t?.telemetrySource;c&&this._store.add(this.actionBar.onDidRun(d=>l.publicLog2("workbenchActionExecuted",{id:d.action.id,from:c})))}setActions(e,t=[],i){var o,s,r;this._sessionDisposables.clear();let a=e.slice(),l=t.slice(),c=[],d=0,h=[],u=!1;if(((o=this._options)===null||o===void 0?void 0:o.hiddenItemStrategy)!==-1)for(let f=0;fC?.id)),g=this._options.overflowBehavior.maxItems-f.size,m=0;for(let C=0;C=g&&(a[C]=void 0,h[C]=S))}}mI(a),mI(h),super.setActions(a,zi.join(h,l)),(c.length>0||a.length>0)&&this._sessionDisposables.add($(this.getElement(),"contextmenu",f=>{var g,m,C,S,w;let y=new yn(ge(this.getElement()),f),x=this.getItemAction(y.target);if(!x)return;y.preventDefault(),y.stopPropagation();let k=[];if(x instanceof Br&&x.menuKeybinding?k.push(x.menuKeybinding):x instanceof wl||x instanceof og||k.push(EO(x.id,void 0,this._commandService,this._keybindingService)),c.length>0){let N=!1;if(d===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){N=!0;for(let M=0;Mthis._menuService.resetHiddenStates(i)}))),T.length!==0&&this._contextMenuService.showContextMenu({getAnchor:()=>y,getActions:()=>T,menuId:(C=this._options)===null||C===void 0?void 0:C.contextMenu,menuActionOptions:{renderShortTitle:!0,...(S=this._options)===null||S===void 0?void 0:S.menuOptions},skipTelemetry:typeof((w=this._options)===null||w===void 0?void 0:w.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};xF=dK([da(2,Wr),da(3,rt),da(4,Ds),da(5,fi),da(6,kn),da(7,nr)],xF);var b_=class extends xF{constructor(e,t,i,o,s,r,a,l,c){super(e,{resetMenu:t,...i},o,s,r,a,l,c),this._onDidChangeMenuItems=this._store.add(new B),this.onDidChangeMenuItems=this._onDidChangeMenuItems.event;let d=this._store.add(o.createMenu(t,s,{emitEventsForSubmenuChanges:!0})),h=()=>{var u,f,g;let m=[],C=[];HH(d,i?.menuOptions,{primary:m,secondary:C},(u=i?.toolbarOptions)===null||u===void 0?void 0:u.primaryGroup,(f=i?.toolbarOptions)===null||f===void 0?void 0:f.shouldInlineSubmenu,(g=i?.toolbarOptions)===null||g===void 0?void 0:g.useSeparatorsInPrimaryActions),e.classList.toggle("has-no-actions",m.length===0&&C.length===0),super.setActions(m,C)};this._store.add(d.onDidChange(()=>{h(),this._onDidChangeMenuItems.fire(this)})),h()}setActions(){throw new St("This toolbar is populated from a menu.")}};b_=dK([da(3,Wr),da(4,rt),da(5,Ds),da(6,fi),da(7,kn),da(8,nr)],b_);zr();Oi();qe();var uK=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},q2=function(n,e){return function(t,i){e(t,i,n)}},LF=[],hK=35,j2=class extends H{constructor(e,t,i,o,s,r){super(),this._diffModel=t,this._editors=i,this._instantiationService=o,this._contextKeyService=s,this._menuService=r,this._menu=this._register(this._menuService.createMenu(A.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=$t(this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(a=>a.length>0),this.width=We(this,a=>this._hasActions.read(a)?hK:0),this.elements=kt("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:hK+"px"}},[]),this._currentDiff=We(this,a=>{var l;let c=this._diffModel.read(a);if(!c)return;let d=(l=c.diff.read(a))===null||l===void 0?void 0:l.mappings,h=this._editors.modifiedCursor.read(a);if(h)return d?.find(u=>u.lineRangeMapping.modified.contains(h.lineNumber))}),this._selectedDiffs=We(this,a=>{let l=this._diffModel.read(a),c=l?.diff.read(a);if(!c)return LF;let d=this._editors.modifiedSelections.read(a);if(d.every(g=>g.isEmpty()))return LF;let h=new ur(d.map(g=>Ne.fromRangeInclusive(g))),f=c.mappings.filter(g=>g.lineRangeMapping.innerChanges&&h.intersects(g.lineRangeMapping.modified)).map(g=>({mapping:g,rangeMappings:g.lineRangeMapping.innerChanges.filter(m=>d.some(C=>P.areIntersecting(m.modifiedRange,C)))}));return f.length===0||f.every(g=>g.rangeMappings.length===0)?LF:f}),this._register(XU(e,this.elements.root)),this._register($(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(br(this.elements.root,{display:this._hasActions.map(a=>a?"block":"none")})),this._register(new K2(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(a,l)=>{let c=this._diffModel.read(l);if(!c)return[];let d=c.diff.read(l);if(!d)return[];let h=this._selectedDiffs.read(l);if(h.length>0){let f=xo.fromRangeMappings(h.flatMap(g=>g.rangeMappings));return[new G2(f,!0,A.DiffEditorSelectionToolbar,void 0,c.model.original.uri,c.model.modified.uri)]}let u=this._currentDiff.read(l);return d.mappings.map(f=>new G2(f.lineRangeMapping.withInnerChangesFromLineRanges(),f.lineRangeMapping===u?.lineRangeMapping,A.DiffEditorHunkToolbar,void 0,c.model.original.uri,c.model.modified.uri))},createView:(a,l)=>this._instantiationService.createInstance(kF,a,l,this)})),this._register($(this.elements.gutter,se.MOUSE_WHEEL,a=>{this._editors.modified.getOption(103).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(a)},{passive:!1}))}computeStagedValue(e){var t;let i=(t=e.innerChanges)!==null&&t!==void 0?t:[],o=new R1(this._editors.modifiedModel.get()),s=new R1(this._editors.original.getModel());return new rS(i.map(l=>l.toTextEdit(o))).apply(s)}layout(e){this.elements.gutter.style.left=e+"px"}};j2=uK([q2(3,Ye),q2(4,rt),q2(5,Wr)],j2);var G2=class{constructor(e,t,i,o,s,r){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=o,this.originalUri=s,this.modifiedUri=r}get id(){return this.mapping.modified.toString()}get range(){var e;return(e=this.rangeOverride)!==null&&e!==void 0?e:this.mapping.modified}},kF=class extends H{constructor(e,t,i,o){super(),this._item=e,this._elements=kt("div.gutterItem",{style:{height:"20px",width:"34px"}},[kt("div.background@background",{},[]),kt("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,r=>r.showAlways),this._menuId=this._item.map(this,r=>r.menuId),this._isSmall=ct(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;let s=this._register(o.createInstance(xh,"element",!0,{position:{hoverPosition:1}}));this._register(ig(t,this._elements.root)),this._register(pt(r=>{let a=this._showAlways.read(r);this._elements.root.classList.toggle("noTransition",!0),this._elements.root.classList.toggle("showAlways",a),setTimeout(()=>{this._elements.root.classList.toggle("noTransition",!1)},0)})),this._register(Jn((r,a)=>{this._elements.buttons.replaceChildren();let l=a.add(o.createInstance(b_,this._elements.buttons,this._menuId.read(r),{orientation:1,hoverDelegate:s,toolbarOptions:{primaryGroup:c=>c.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(r)?1:3},hiddenItemStrategy:0,actionRunner:new __(()=>{let c=this._item.get(),d=c.mapping;return{mapping:d,originalWithModifiedChanges:i.computeStagedValue(d),originalUri:c.originalUri,modifiedUri:c.modifiedUri}}),menuOptions:{shouldForwardArgs:!0}}));a.add(l.onDidChangeMenuItems(()=>{this._lastItemRange&&this.layout(this._lastItemRange,this._lastViewRange)}))}))}layout(e,t){this._lastItemRange=e,this._lastViewRange=t;let i=this._elements.buttons.clientHeight;this._isSmall.set(this._item.get().mapping.original.startLineNumber===1&&e.length<30,void 0),i=this._elements.buttons.clientHeight,this._elements.root.style.top=e.start+"px",this._elements.root.style.height=e.length+"px";let o=e.length/2-i/2,s=i,r=e.start+o,a=ze.tryCreate(s,t.endExclusive-s-i),l=ze.tryCreate(e.start+s,e.endExclusive-i-s);l&&a&&l.start=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},PJ=function(n,e){return function(t,i){e(t,i,n)}},ha,dd=ha=class extends H{constructor(e,t,i,o,s,r,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=o,this._rootHeight=s,this._modifiedEditorLayoutInfo=r,this._themeService=a,this.width=ha.ENTIRE_DIFF_OVERVIEW_WIDTH;let l=$t(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),c=We(u=>{let f=l.read(u),g=f.getColor(tB)||(f.getColor(J8)||NS).transparent(2),m=f.getColor(iB)||(f.getColor(eB)||AS).transparent(2);return{insertColor:g,removeColor:m}}),d=$e(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");let h=kt("div.diffOverview",{style:{position:"absolute",top:"0px",width:ha.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(ig(h,d.domNode)),this._register(Ut(h,se.POINTER_DOWN,u=>{this._editors.modified.delegateVerticalScrollbarPointerDown(u)})),this._register($(h,se.MOUSE_WHEEL,u=>{this._editors.modified.delegateScrollFromMouseWheelEvent(u)},{passive:!1})),this._register(ig(this._rootElement,h)),this._register(Jn((u,f)=>{let g=this._diffModel.read(u),m=this._editors.original.createOverviewRuler("original diffOverviewRuler");m&&(f.add(m),f.add(ig(h,m.getDomNode())));let C=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(C&&(f.add(C),f.add(ig(h,C.getDomNode()))),!m||!C)return;let S=fo("viewZoneChanged",this._editors.original.onDidChangeViewZones),w=fo("viewZoneChanged",this._editors.modified.onDidChangeViewZones),y=fo("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),x=fo("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);f.add(pt(k=>{var T;S.read(k),w.read(k),y.read(k),x.read(k);let N=c.read(k),M=(T=g?.diff.read(k))===null||T===void 0?void 0:T.mappings;function W(V,z,te){let ee=te._getViewModel();return ee?V.filter(ce=>ce.length>0).map(ce=>{let Ce=ee.coordinatesConverter.convertModelPositionToViewPosition(new U(ce.startLineNumber,1)),Se=ee.coordinatesConverter.convertModelPositionToViewPosition(new U(ce.endLineNumberExclusive,1)),pe=Se.lineNumber-Ce.lineNumber;return new Eb(Ce.lineNumber,Se.lineNumber,pe,z.toString())}):[]}let j=W((M||[]).map(V=>V.lineRangeMapping.original),N.removeColor,this._editors.original),G=W((M||[]).map(V=>V.lineRangeMapping.modified),N.insertColor,this._editors.modified);m?.setZones(j),C?.setZones(G)})),f.add(pt(k=>{let T=this._rootHeight.read(k),N=this._rootWidth.read(k),M=this._modifiedEditorLayoutInfo.read(k);if(M){let W=ha.ENTIRE_DIFF_OVERVIEW_WIDTH-2*ha.ONE_OVERVIEW_WIDTH;m.setLayout({top:0,height:T,right:W+ha.ONE_OVERVIEW_WIDTH,width:ha.ONE_OVERVIEW_WIDTH}),C.setLayout({top:0,height:T,right:0,width:ha.ONE_OVERVIEW_WIDTH});let j=this._editors.modifiedScrollTop.read(k),G=this._editors.modifiedScrollHeight.read(k),V=this._editors.modified.getOption(103),z=new hh(V.verticalHasArrows?V.arrowSize:0,V.verticalScrollbarSize,0,M.height,G,j);d.setTop(z.getSliderPosition()),d.setHeight(z.getSliderSize())}else d.setTop(0),d.setHeight(0);h.style.height=T+"px",h.style.left=N-ha.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(ha.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}};dd.ONE_OVERVIEW_WIDTH=15;dd.ENTIRE_DIFF_OVERVIEW_WIDTH=ha.ONE_OVERVIEW_WIDTH*2;dd=ha=RJ([PJ(6,an)],dd);_();v();b();ke();Ef();$n();le();bn();Bo();Ke();hr();Ge();var EF=[],Y2=class extends H{constructor(e,t,i,o){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=o,this._selectedDiffs=We(this,s=>{let r=this._diffModel.read(s),a=r?.diff.read(s);if(!a)return EF;let l=this._editors.modifiedSelections.read(s);if(l.every(u=>u.isEmpty()))return EF;let c=new ur(l.map(u=>Ne.fromRangeInclusive(u))),h=a.mappings.filter(u=>u.lineRangeMapping.innerChanges&&c.intersects(u.lineRangeMapping.modified)).map(u=>({mapping:u,rangeMappings:u.lineRangeMapping.innerChanges.filter(f=>l.some(g=>P.areIntersecting(f.modifiedRange,g)))}));return h.length===0||h.every(u=>u.rangeMappings.length===0)?EF:h}),this._register(Jn((s,r)=>{if(!this._options.shouldRenderOldRevertArrows.read(s))return;let a=this._diffModel.read(s),l=a?.diff.read(s);if(!a||!l||a.movedTextToCompare.read(s))return;let c=[],d=this._selectedDiffs.read(s),h=new Set(d.map(u=>u.mapping));if(d.length>0){let u=this._editors.modifiedSelections.read(s),f=r.add(new O1(u[u.length-1].positionLineNumber,this._widget,d.flatMap(g=>g.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(f),c.push(f)}for(let u of l.mappings)if(!h.has(u)&&!u.lineRangeMapping.modified.isEmpty&&u.lineRangeMapping.innerChanges){let f=r.add(new O1(u.lineRangeMapping.modified.startLineNumber,this._widget,u.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(f),c.push(f)}r.add(be(()=>{for(let u of c)this._editors.modified.removeGlyphMarginWidget(u)}))}))}},O1=class n extends H{getId(){return this._id}constructor(e,t,i,o){super(),this._lineNumber=e,this._widget=t,this._diffs=i,this._revertSelection=o,this._id=`revertButton${n.counter++}`,this._domNode=kt("div.revertButton",{title:this._revertSelection?p("revertSelectedChanges","Revert Selected Changes"):p("revertChange","Revert Change")},[wp(ue.arrowRight)]).root,this._register($(this._domNode,se.MOUSE_DOWN,s=>{s.button!==2&&(s.stopPropagation(),s.preventDefault())})),this._register($(this._domNode,se.MOUSE_UP,s=>{s.stopPropagation(),s.preventDefault()})),this._register($(this._domNode,se.CLICK,s=>{this._diffs instanceof So?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),s.stopPropagation(),s.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:dr.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}};O1.counter=0;ca();ft();Ke();wb();Oi();qe();_();v();b();ye();le();bn();_();v();b();bn();function gK(n){return X2.get(n)}var X2=class n{static get(e){let t=n._map.get(e);if(!t){t=new n(e),n._map.set(e,t);let i=e.onDidDispose(()=>{n._map.delete(e),i.dispose()})}return t}constructor(e){this.editor=e,this.model=$t(this.editor.onDidChangeModel,()=>this.editor.getModel())}};X2._map=new Map;ft();Ge();qe();var OJ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},mK=function(n,e){return function(t,i){e(t,i,n)}},Q2=class extends H{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,o,s,r,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=o,this._createInnerEditor=s,this._instantiationService=r,this._keybindingService=a,this.original=this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.modifiedEditor||{})),this._onDidContentSizeChange=this._register(new B),this.modifiedScrollTop=$t(this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=$t(this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedModel=gK(this.modified).model,this.modifiedSelections=$t(this.modified.onDidChangeCursorSelection,()=>{var l;return(l=this.modified.getSelections())!==null&&l!==void 0?l:[]}),this.modifiedCursor=Vp({owner:this,equalsFn:U.equals},l=>{var c,d;return(d=(c=this.modifiedSelections.read(l)[0])===null||c===void 0?void 0:c.getPosition())!==null&&d!==void 0?d:new U(1,1)}),this.originalCursor=$t(this.original.onDidChangeCursorPosition,()=>{var l;return(l=this.original.getPosition())!==null&&l!==void 0?l:new U(1,1)}),this._argCodeEditorWidgetOptions=null,this._register(Mh({createEmptyChangeSummary:()=>({}),handleChange:(l,c)=>(l.didChange(i.editorOptions)&&Object.assign(c,l.change.changedOptions),!0)},(l,c)=>{i.editorOptions.read(l),this._options.renderSideBySide.read(l),this.modified.updateOptions(this._adjustOptionsForRightHandSide(l,c)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(l,c))}))}_createLeftHandSideEditor(e,t){let i=this._adjustOptionsForLeftHandSide(void 0,e),o=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t);return o.setContextValue("isInDiffLeftEditor",!0),o}_createRightHandSideEditor(e,t){let i=this._adjustOptionsForRightHandSide(void 0,e),o=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t);return o.setContextValue("isInDiffRightEditor",!0),o}_constructInnerEditor(e,t,i,o){let s=this._createInnerEditor(e,t,i,o);return this._register(s.onDidContentSizeChange(r=>{let a=this.original.getContentWidth()+this.modified.getContentWidth()+dd.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:r.contentHeightChanged,contentWidthChanged:r.contentWidthChanged})})),s}_adjustOptionsForLeftHandSide(e,t){let i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),i.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){let i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=Ca.revealHorizontalRightPadding.defaultValue+dd.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){let t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...t.minimap||{}},t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){var t;e||(e="");let i=p("diff-aria-navigation-tip"," use {0} to open the accessibility help.",(t=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))===null||t===void 0?void 0:t.getAriaLabel());return this._options.accessibilityVerbose.get()?e+i:e?e.replaceAll(i,""):""}};Q2=OJ([mK(5,Ye),mK(6,fi)],Q2);_();v();b();ye();le();var F1=class n extends H{constructor(){super(...arguments),this._id=++n.idCounter,this._onDidDispose=this._register(new B),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,o=!0){this._targetEditor.revealRange(e,t,i,o)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}};F1.idCounter=0;_();v();b();bn();var FJ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},BJ=function(n,e){return function(t,i){e(t,i,n)}},J2=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=ct(this,0),this._screenReaderMode=$t(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=We(this,o=>this._options.read(o).renderSideBySide&&this._diffEditorWidth.read(o)<=this._options.read(o).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=We(this,o=>this._options.read(o).renderOverviewRuler),this.renderSideBySide=We(this,o=>this._options.read(o).renderSideBySide&&!(this._options.read(o).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(o)&&!this._screenReaderMode.read(o))),this.readOnly=We(this,o=>this._options.read(o).readOnly),this.shouldRenderOldRevertArrows=We(this,o=>!(!this._options.read(o).renderMarginRevertIcon||!this.renderSideBySide.read(o)||this.readOnly.read(o)||this.shouldRenderGutterMenu.read(o))),this.shouldRenderGutterMenu=We(this,o=>this._options.read(o).renderGutterMenu),this.renderIndicators=We(this,o=>this._options.read(o).renderIndicators),this.enableSplitViewResizing=We(this,o=>this._options.read(o).enableSplitViewResizing),this.splitViewDefaultRatio=We(this,o=>this._options.read(o).splitViewDefaultRatio),this.ignoreTrimWhitespace=We(this,o=>this._options.read(o).ignoreTrimWhitespace),this.maxComputationTimeMs=We(this,o=>this._options.read(o).maxComputationTime),this.showMoves=We(this,o=>this._options.read(o).experimental.showMoves&&this.renderSideBySide.read(o)),this.isInEmbeddedEditor=We(this,o=>this._options.read(o).isInEmbeddedEditor),this.diffWordWrap=We(this,o=>this._options.read(o).diffWordWrap),this.originalEditable=We(this,o=>this._options.read(o).originalEditable),this.diffCodeLens=We(this,o=>this._options.read(o).diffCodeLens),this.accessibilityVerbose=We(this,o=>this._options.read(o).accessibilityVerbose),this.diffAlgorithm=We(this,o=>this._options.read(o).diffAlgorithm),this.showEmptyDecorations=We(this,o=>this._options.read(o).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=We(this,o=>this._options.read(o).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=We(this,o=>this._options.read(o).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=We(this,o=>this._options.read(o).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=We(this,o=>this._options.read(o).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=We(this,o=>this._options.read(o).hideUnchangedRegions.minimumLineCount);let i={...e,...pK(e,Wn)};this._options=ct(this,i)}updateOptions(e){let t=pK(e,this._options.get()),i={...this._options.get(),...e,...t};this._options.set(i,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}};J2=FJ([BJ(1,ao)],J2);function pK(n,e){var t,i,o,s,r,a,l,c;return{enableSplitViewResizing:we(n.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:S9(n.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:we(n.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:we(n.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:Cd(n.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:Cd(n.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:we(n.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:we(n.renderIndicators,e.renderIndicators),originalEditable:we(n.originalEditable,e.originalEditable),diffCodeLens:we(n.diffCodeLens,e.diffCodeLens),renderOverviewRuler:we(n.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:wi(n.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:wi(n.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:we(n.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:we((t=n.experimental)===null||t===void 0?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:we((i=n.experimental)===null||i===void 0?void 0:i.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:we((s=(o=n.hideUnchangedRegions)===null||o===void 0?void 0:o.enabled)!==null&&s!==void 0?s:(r=n.experimental)===null||r===void 0?void 0:r.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:Cd((a=n.hideUnchangedRegions)===null||a===void 0?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:Cd((l=n.hideUnchangedRegions)===null||l===void 0?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:Cd((c=n.hideUnchangedRegions)===null||c===void 0?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:we(n.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:we(n.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:Cd(n.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:we(n.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:we(n.renderGutterMenu,e.renderGutterMenu)}}var WJ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},B1=function(n,e){return function(t,i){e(t,i,n)}},v_=class extends F1{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,i,o,s,r,a,l){var c;super(),this._domElement=e,this._parentContextKeyService=o,this._parentInstantiationService=s,this._accessibilitySignalService=a,this._editorProgressService=l,this.elements=kt("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[kt("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),kt("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),kt("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=ct(this,void 0),this._shouldDisposeDiffModel=!1,this.onDidChangeModel=ie.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new sa([rt,this._contextKeyService])),this._boundarySashes=ct(this,void 0),this._accessibleDiffViewerShouldBeVisible=ct(this,!1),this._accessibleDiffViewerVisible=We(this,x=>this._options.onlyShowAccessibleDiffViewer.read(x)?!0:this._accessibleDiffViewerShouldBeVisible.read(x)),this._movedBlocksLinesPart=ct(this,void 0),this._layoutInfo=We(this,x=>{var k,T,N,M,W;let j=this._rootSizeObserver.width.read(x),G=this._rootSizeObserver.height.read(x),V=this._sash.read(x),z=this._gutter.read(x),te=(k=z?.width.read(x))!==null&&k!==void 0?k:0,ee=(N=(T=this._overviewRulerPart.read(x))===null||T===void 0?void 0:T.width)!==null&&N!==void 0?N:0,ce,Ce,Se,pe,Pe;if(!!V){let Te=V.sashLeft.read(x),de=(W=(M=this._movedBlocksLinesPart.read(x))===null||M===void 0?void 0:M.width.read(x))!==null&&W!==void 0?W:0;ce=0,Ce=Te-te-de,Pe=Te-te,Se=Te,pe=j-Se-ee}else Pe=0,ce=te,Ce=Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),Se=te+Ce,pe=j-Se-ee;return this.elements.original.style.left=ce+"px",this.elements.original.style.width=Ce+"px",this._editors.original.layout({width:Ce,height:G},!0),z?.layout(Pe),this.elements.modified.style.left=Se+"px",this.elements.modified.style.width=pe+"px",this._editors.modified.layout({width:pe,height:G},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((x,k)=>x?.diff.read(k)),this.onDidUpdateDiff=ie.fromObservableLight(this._diffValue),r.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(be(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new u_(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((c=t.automaticLayout)!==null&&c!==void 0?c:!1),this._options=this._instantiationService.createInstance(J2,t),this._register(pt(x=>{this._options.setWidth(this._rootSizeObserver.width.read(x))})),this._contextKeyService.createKey(_e.isEmbeddedDiffEditor.key,!1),this._register(mc(_e.isEmbeddedDiffEditor,this._contextKeyService,x=>this._options.isInEmbeddedEditor.read(x))),this._register(mc(_e.comparingMovedCode,this._contextKeyService,x=>{var k;return!!(!((k=this._diffModel.read(x))===null||k===void 0)&&k.movedTextToCompare.read(x))})),this._register(mc(_e.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,x=>this._options.couldShowInlineViewBecauseOfSize.read(x))),this._register(mc(_e.diffEditorInlineMode,this._contextKeyService,x=>!this._options.renderSideBySide.read(x))),this._register(mc(_e.hasChanges,this._contextKeyService,x=>{var k,T,N;return((N=(T=(k=this._diffModel.read(x))===null||k===void 0?void 0:k.diff.read(x))===null||T===void 0?void 0:T.mappings.length)!==null&&N!==void 0?N:0)>0})),this._editors=this._register(this._instantiationService.createInstance(Q2,this.elements.original,this.elements.modified,this._options,i,(x,k,T,N)=>this._createInnerEditor(x,k,T,N))),this._register(mc(_e.diffEditorOriginalWritable,this._contextKeyService,x=>this._options.originalEditable.read(x))),this._register(mc(_e.diffEditorModifiedWritable,this._contextKeyService,x=>!this._options.readOnly.read(x))),this._register(mc(_e.diffEditorOriginalUri,this._contextKeyService,x=>{var k,T;return(T=(k=this._diffModel.read(x))===null||k===void 0?void 0:k.model.original.uri.toString())!==null&&T!==void 0?T:""})),this._register(mc(_e.diffEditorModifiedUri,this._contextKeyService,x=>{var k,T;return(T=(k=this._diffModel.read(x))===null||k===void 0?void 0:k.model.modified.uri.toString())!==null&&T!==void 0?T:""})),this._overviewRulerPart=Ja(this,x=>this._options.renderOverviewRuler.read(x)?this._instantiationService.createInstance(Ts(dd,x),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(k=>k.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store),this._sash=Ja(this,x=>{let k=this._options.renderSideBySide.read(x);return this.elements.root.classList.toggle("side-by-side",k),k?new F2(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((T,N)=>{var M,W;return T-((W=(M=this._overviewRulerPart.read(N))===null||M===void 0?void 0:M.width)!==null&&W!==void 0?W:0)})},this._boundarySashes):void 0}).recomputeInitiallyAndOnChange(this._store);let d=Ja(this,x=>this._instantiationService.createInstance(Ts(P1,x),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);Ja(this,x=>this._instantiationService.createInstance(Ts(O2,x),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);let h=new Set,u=new Set,f=!1,g=Ja(this,x=>this._instantiationService.createInstance(Ts(U2,x),ge(this._domElement),this._editors,this._diffModel,this._options,this,()=>f||d.get().isUpdatingHiddenAreas,h,u)).recomputeInitiallyAndOnChange(this._store),m=We(this,x=>{let k=g.read(x).viewZones.read(x).orig,T=d.read(x).viewZones.read(x).origViewZones;return k.concat(T)}),C=We(this,x=>{let k=g.read(x).viewZones.read(x).mod,T=d.read(x).viewZones.read(x).modViewZones;return k.concat(T)});this._register(m_(this._editors.original,m,x=>{f=x},h));let S;this._register(m_(this._editors.modified,C,x=>{f=x,f?S=h_.capture(this._editors.modified):(S?.restore(this._editors.modified),S=void 0)},u)),this._accessibleDiffViewer=Ja(this,x=>this._instantiationService.createInstance(Ts(ld,x),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(k,T)=>this._accessibleDiffViewerShouldBeVisible.set(k,T),this._options.onlyShowAccessibleDiffViewer.map(k=>!k),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((k,T)=>{var N;return(N=k?.diff.read(T))===null||N===void 0?void 0:N.mappings.map(M=>M.lineRangeMapping)}),new R2(this._editors))).recomputeInitiallyAndOnChange(this._store);let w=this._accessibleDiffViewerVisible.map(x=>x?"hidden":"visible");this._register(br(this.elements.modified,{visibility:w})),this._register(br(this.elements.original,{visibility:w})),this._createDiffEditorContributions(),r.addDiffEditor(this),this._gutter=Ja(this,x=>this._options.shouldRenderGutterMenu.read(x)?this._instantiationService.createInstance(Ts(j2,x),this.elements.root,this._diffModel,this._editors):void 0),this._register(Ph(this._layoutInfo)),Ja(this,x=>new(Ts(cd,x))(this.elements.root,this._diffModel,this._layoutInfo.map(k=>k.originalEditor),this._layoutInfo.map(k=>k.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,x=>{this._movedBlocksLinesPart.set(x,void 0)}),this._register(ie.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,x=>this._handleCursorPositionChange(x,!0))),this._register(ie.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,x=>this._handleCursorPositionChange(x,!1)));let y=this._diffModel.map(this,(x,k)=>{if(x)return x.diff.read(k)===void 0&&!x.isDiffUpToDate.read(k)});this._register(Jn((x,k)=>{if(y.read(x)===!0){let T=this._editorProgressService.show(!0,1e3);k.add(be(()=>T.done()))}})),this._register(be(()=>{var x;this._shouldDisposeDiffModel&&((x=this._diffModel.get())===null||x===void 0||x.dispose())})),this._register(Jn((x,k)=>{k.add(new(Ts(Y2,x))(this._editors,this._diffModel,this._options,this))}))}_createInnerEditor(e,t,i,o){return e.createInstance(Df,t,i,o)}_createDiffEditorContributions(){let e=Hd.getDiffEditorContributions();for(let t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){ut(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return Rc.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var e;let t=this._editors.original.saveViewState(),i=this._editors.modified.saveViewState();return{original:t,modified:i,modelState:(e=this._diffModel.get())===null||e===void 0?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){let i=e;this._editors.original.restoreViewState(i.original),this._editors.modified.restoreViewState(i.modified),i.modelState&&((t=this._diffModel.get())===null||t===void 0||t.restoreSerializedState(i.modelState))}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(W2,e,this._options)}getModel(){var e,t;return(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.model)!==null&&t!==void 0?t:null}setModel(e,t){!e&&this._diffModel.get()&&this._accessibleDiffViewer.get().close();let i=e?"model"in e?{model:e,shouldDispose:!1}:{model:this.createViewModel(e),shouldDispose:!0}:void 0;this._diffModel.get()!==i?.model&&Pf(t,o=>{var s;$t.batchEventsGlobally(o,()=>{this._editors.original.setModel(i?i.model.model.original:null),this._editors.modified.setModel(i?i.model.model.modified:null)});let r=this._diffModel.get(),a=this._shouldDisposeDiffModel;this._shouldDisposeDiffModel=(s=i?.shouldDispose)!==null&&s!==void 0?s:!1,this._diffModel.set(i?.model,o),a&&r?.dispose()})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var e;let t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get();return t?zJ(t):null}revert(e){let t=this._diffModel.get();!t||!t.isDiffUpToDate.get()||this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}])}revertRangeMappings(e){let t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;let i=e.map(o=>({range:o.modifiedRange,text:t.model.original.getValueInRange(o.originalRange)}));this._editors.modified.executeEdits("diffEditor",i)}_goTo(e){this._editors.modified.setPosition(new U(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){var t,i,o,s;let r=(i=(t=this._diffModel.get())===null||t===void 0?void 0:t.diff.get())===null||i===void 0?void 0:i.mappings;if(!r||r.length===0)return;let a=this._editors.modified.getPosition().lineNumber,l;e==="next"?l=(o=r.find(c=>c.lineRangeMapping.modified.startLineNumber>a))!==null&&o!==void 0?o:r[0]:l=(s=Mu(r,c=>c.lineRangeMapping.modified.startLineNumber{var t;let i=(t=e.diff.get())===null||t===void 0?void 0:t.mappings;!i||i.length===0||this._goTo(i[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){let e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){var e,t;let i=this._editors.modified.hasWidgetFocus(),o=i?this._editors.modified:this._editors.original,s=i?this._editors.original:this._editors.modified,r,a=o.getSelection();if(a){let l=(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get())===null||t===void 0?void 0:t.mappings.map(c=>i?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){let c=nF(a.getStartPosition(),l),d=nF(a.getEndPosition(),l);r=P.plusRange(c,d)}}return{destination:s,destinationSelection:r}}switchSide(){let{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){let e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var e;let t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&ri(i=>{for(let o of t)o.collapseAll(i)})}showAllUnchangedRegions(){var e;let t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&ri(i=>{for(let o of t)o.showAll(i)})}_handleCursorPositionChange(e,t){var i,o;if(e?.reason===3){let s=(o=(i=this._diffModel.get())===null||i===void 0?void 0:i.diff.get())===null||o===void 0?void 0:o.mappings.find(r=>t?r.lineRangeMapping.modified.contains(e.position.lineNumber):r.lineRangeMapping.original.contains(e.position.lineNumber));s?.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(Ve.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):s?.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(Ve.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):s&&this._accessibilitySignalService.playSignal(Ve.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}};v_=WJ([B1(3,rt),B1(4,Ye),B1(5,Zt),B1(6,rl),B1(7,Ap)],v_);function zJ(n){return n.mappings.map(e=>{let t=e.lineRangeMapping,i,o,s,r,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,o=0,a=void 0):(i=t.original.startLineNumber,o=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(s=t.modified.startLineNumber-1,r=0,a=void 0):(s=t.modified.startLineNumber,r=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:o,modifiedStartLineNumber:s,modifiedEndLineNumber:r,charChanges:a?.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}vo();var IF=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Jt=function(n,e){return function(t,i){e(t,i,n)}},VJ=0,_K=!1;function HJ(n){if(!n){if(_K)return;_K=!0}A8(n||gt.document.body)}var eI=class extends Df{constructor(e,t,i,o,s,r,a,l,c,d,h,u,f){let g={...t};g.ariaLabel=g.ariaLabel||Mv.editorViewAccessibleLabel,g.ariaLabel=g.ariaLabel+";"+Mv.accessibilityHelpMessage,super(e,g,{},i,o,s,r,c,d,h,u,f),l instanceof jh?this._standaloneKeybindingService=l:this._standaloneKeybindingService=null,HJ(g.ariaContainerElement),cH((m,C)=>i.createInstance(xh,m,C,{})),hH(a)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;let o="DYNAMIC_"+ ++VJ,s=Dt.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(o,e,t,s),o}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),H.None;let t=e.id,i=e.label,o=Dt.and(Dt.equals("editorId",this.getId()),Dt.deserialize(e.precondition)),s=e.keybindings,r=Dt.and(o,Dt.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(f,...g)=>Promise.resolve(e.run(this,...g)),d=new ae,h=this.getId()+":"+t;if(d.add(Pi.registerCommand(h,c)),a){let f={command:{id:h,title:i},when:o,group:a,order:l};d.add(Fs.appendMenuItem(A.EditorContext,f))}if(Array.isArray(s))for(let f of s)d.add(this._standaloneKeybindingService.addDynamicKeybinding(h,f,c,r));let u=new ep(h,i,i,void 0,o,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,u),d.add(be(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof gv)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};eI=IF([Jt(2,Ye),Jt(3,Zt),Jt(4,kn),Jt(5,rt),Jt(6,Lh),Jt(7,fi),Jt(8,an),Jt(9,Ko),Jt(10,ao),Jt(11,yo),Jt(12,Tt)],eI);var tI=class extends eI{constructor(e,t,i,o,s,r,a,l,c,d,h,u,f,g,m,C){let S={...t};I1(h,S,!1);let w=c.registerEditorContainer(e);typeof S.theme=="string"&&c.setTheme(S.theme),typeof S.autoDetectHighContrast<"u"&&c.setAutoDetectHighContrast(!!S.autoDetectHighContrast);let y=S.model;delete S.model,super(e,S,i,o,s,r,a,l,c,d,u,m,C),this._configurationService=h,this._standaloneThemeService=c,this._register(w);let x;if(typeof y>"u"){let k=g.getLanguageIdByMimeType(S.language)||S.language||In;x=TF(f,g,S.value||"",k,void 0),this._ownsModel=!0}else x=y,this._ownsModel=!1;if(this._attachModel(x),x){let k={oldModelUrl:null,newModelUrl:x.uri};this._onDidChangeModel.fire(k)}}dispose(){super.dispose()}updateOptions(e){I1(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};tI=IF([Jt(2,Ye),Jt(3,Zt),Jt(4,kn),Jt(5,rt),Jt(6,Lh),Jt(7,fi),Jt(8,ls),Jt(9,Ko),Jt(10,Rt),Jt(11,ao),Jt(12,xn),Jt(13,ii),Jt(14,yo),Jt(15,Tt)],tI);var iI=class extends v_{constructor(e,t,i,o,s,r,a,l,c,d,h,u){let f={...t};I1(l,f,!0);let g=r.registerEditorContainer(e);typeof f.theme=="string"&&r.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&r.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{},o,i,s,u,d),this._configurationService=l,this._standaloneThemeService=r,this._register(g)}dispose(){super.dispose()}updateOptions(e){I1(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(eI,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};iI=IF([Jt(2,Ye),Jt(3,rt),Jt(4,Zt),Jt(5,ls),Jt(6,Ko),Jt(7,Rt),Jt(8,Ds),Jt(9,Ap),Jt(10,d_),Jt(11,rl)],iI);function TF(n,e,t,i,o){if(t=t||"",!i){let s=t.indexOf(` +`),r=t;return s!==-1&&(r=t.substring(0,s)),bK(n,t,e.createByFilepathOrFirstLine(o||null,r),o)}return bK(n,t,e.createById(i),o)}function bK(n,e,t,i){return n.createModel(e,t,i)}x1();zr();ir();Oi();_();v();b();le();bn();ca();_();v();b();ke();wt();Dl();xt();le();bn();zp();ca();es();Kn();wb();Oi();qe();_();v();b();ke();$n();le();bn();zp();zr();qe();var UJ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},KJ=function(n,e){return function(t,i){e(t,i,n)}},nI=class{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}},C_=class extends H{constructor(e,t,i,o){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=o,this._viewModel=ct(this,void 0),this._collapsed=We(this,r=>{var a;return(a=this._viewModel.read(r))===null||a===void 0?void 0:a.collapsed.read(r)}),this._editorContentHeight=ct(this,500),this.contentHeight=We(this,r=>(this._collapsed.read(r)?0:this._editorContentHeight.read(r))+this._outerEditorHeight),this._modifiedContentWidth=ct(this,0),this._modifiedWidth=ct(this,0),this._originalContentWidth=ct(this,0),this._originalWidth=ct(this,0),this.maxScroll=We(this,r=>{let a=this._modifiedContentWidth.read(r)-this._modifiedWidth.read(r),l=this._originalContentWidth.read(r)-this._originalWidth.read(r);return a>l?{maxScroll:a,width:this._modifiedWidth.read(r)}:{maxScroll:l,width:this._originalWidth.read(r)}}),this._elements=kt("div.multiDiffEntry",[kt("div.header@header",[kt("div.header-content",[kt("div.collapse-button@collapseButton"),kt("div.file-path",[kt("div.title.modified.show-file-icons@primaryPath",[]),kt("div.status.deleted@status",["R"]),kt("div.title.original.show-file-icons@secondaryPath",[])]),kt("div.actions@actions")])]),kt("div.editorParent",[kt("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(v_,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=vK(this.editor.getModifiedEditor()),this.isOriginalFocused=vK(this.editor.getOriginalEditor()),this.isFocused=We(this,r=>this.isModifedFocused.read(r)||this.isOriginalFocused.read(r)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=new ae,this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;let s=new Jf(this._elements.collapseButton,{});this._register(pt(r=>{s.element.className="",s.icon=this._collapsed.read(r)?ue.chevronRight:ue.chevronDown})),this._register(s.onDidClick(()=>{var r;(r=this._viewModel.get())===null||r===void 0||r.collapsed.set(!this._collapsed.get(),void 0)})),this._register(pt(r=>{this._elements.editor.style.display=this._collapsed.read(r)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(r=>{let a=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(a,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(r=>{let a=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(a,void 0)})),this._register(this.editor.onDidContentSizeChange(r=>{Wp(a=>{this._editorContentHeight.set(r.contentHeight,a),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),a),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),a)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(r=>{if(this._isSettingScrollTop||!r.scrollTopChanged||!this._data)return;let a=r.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(a)})),this._register(pt(r=>{var a;let l=(a=this._viewModel.read(r))===null||a===void 0?void 0:a.isActive.read(r);this._elements.root.classList.toggle("active",l)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._register(this._instantiationService.createInstance(b_,this._elements.actions,A.MultiDiffEditorFileToolbar,{actionRunner:this._register(new __(()=>{var r;return(r=this._viewModel.get())===null||r===void 0?void 0:r.modifiedUri})),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:r=>r.startsWith("navigation")},actionViewItemProvider:(r,a)=>KH(o,r,a)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){this._data=e;function t(o){return{...o,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}let i=e.viewModel.entry.value;i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{var o;this.editor.updateOptions(t((o=i.options)!==null&&o!==void 0?o:{}))})),Wp(o=>{var s,r,a,l;(s=this._resourceLabel)===null||s===void 0||s.setUri((r=e.viewModel.modifiedUri)!==null&&r!==void 0?r:e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let c=!1,d=!1,h=!1,u="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(u="R",c=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(u="A",h=!0):(u="D",d=!0),this._elements.status.classList.toggle("renamed",c),this._elements.status.classList.toggle("deleted",d),this._elements.status.classList.toggle("added",h),this._elements.status.innerText=u,(a=this._resourceLabel2)===null||a===void 0||a.setUri(c?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,o),this.editor.setModel(e.viewModel.diffEditorViewModel,o),this.editor.updateOptions(t((l=i.options)!==null&&l!==void 0?l:{}))})}render(e,t,i,o){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";let s=e.length-this._headerHeight,r=Math.max(0,Math.min(o.start-e.start,s));this._elements.header.style.transform=`translateY(${r}px)`,Wp(a=>{this.editor.layout({width:t-2*8-2*1,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=i,this.editor.getOriginalEditor().setScrollTop(i)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",r>0||i>0),this._elements.header.classList.toggle("collapsed",r===s)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};C_=UJ([KJ(3,Ye)],C_);function vK(n){return $t(e=>{let t=new ae;return t.add(n.onDidFocusEditorWidget(()=>e(!0))),t.add(n.onDidBlurEditorWidget(()=>e(!1))),t},()=>n.hasTextFocus())}_();v();b();var oI=class{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){var t;let i;if(this._unused.size===0)i=this._create(e),this._itemData.set(i,e);else{let o=[...this._unused.values()];i=(t=o.find(s=>this._itemData.get(s).getId()===e.getId()))!==null&&t!==void 0?t:o[0],this._unused.delete(i),this._itemData.set(i,e),i.setData(e)}return this._used.add(i),{object:i,dispose:()=>{this._used.delete(i),this._unused.size>5?i.dispose():this._unused.add(i)}}}dispose(){for(let e of this._used)e.dispose();for(let e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}};var $J=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},CK=function(n,e){return function(t,i){e(t,i,n)}},sI=class extends H{constructor(e,t,i,o,s,r){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=o,this._parentContextKeyService=s,this._parentInstantiationService=r,this._elements=kt("div.monaco-component.multiDiffEditor",[kt("div@content",{style:{overflow:"hidden"}}),kt("div.monaco-editor@overflowWidgetsDomNode",{})]),this._sizeObserver=this._register(new u_(this._element,void 0)),this._objectPool=this._register(new oI(l=>{let c=this._instantiationService.createInstance(C_,this._elements.content,this._elements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return c.setData(l),c})),this._scrollable=this._register(new gr({forceIntegerValues:!1,scheduleAtNextAnimationFrame:l=>rn(ge(this._element),l),smoothScrollDuration:100})),this._scrollableElement=this._register(new Bl(this._elements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this.scrollTop=$t(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=$t(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=pr(this,(l,c)=>{let d=this._viewModel.read(l);if(!d)return{items:[],getItem:g=>{throw new St}};let h=d.items.read(l),u=new Map;return{items:h.map(g=>{var m;let C=c.add(new NF(g,this._objectPool,this.scrollLeft,w=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+w})})),S=(m=this._lastDocStates)===null||m===void 0?void 0:m[C.getKey()];return S&&ri(w=>{C.setViewState(S,w)}),u.set(g,C),C}),getItem:g=>u.get(g)}}),this._viewItems=this._viewItemsInfo.map(this,l=>l.items),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(l,c)=>l.reduce((d,h)=>d+h.contentHeight.read(c)+this._spaceBetweenPx,0)),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._parentInstantiationService.createChild(new sa([rt,this._contextKeyService])),this._lastDocStates={},this._contextKeyService.createKey(_e.inMultiDiffEditor.key,!0),this._register(Jn((l,c)=>{let d=this._viewModel.read(l);if(d&&d.contextKeys)for(let[h,u]of Object.entries(d.contextKeys)){let f=this._contextKeyService.createKey(h,void 0);f.set(u),c.add(be(()=>f.reset()))}}));let a=this._parentContextKeyService.createKey(_e.multiDiffEditorAllCollapsed.key,!1);this._register(pt(l=>{let c=this._viewModel.read(l);if(c){let d=c.items.read(l).every(h=>h.collapsed.read(l));a.set(d)}})),this._register(pt(l=>{let c=this._dimension.read(l);this._sizeObserver.observe(c)})),this._elements.content.style.position="relative",this._register(pt(l=>{let c=this._sizeObserver.height.read(l);this._elements.root.style.height=`${c}px`;let d=this._totalHeight.read(l);this._elements.content.style.height=`${d}px`;let h=this._sizeObserver.width.read(l),u=h,f=this._viewItems.read(l),g=aA(f,Io(m=>m.maxScroll.read(l).maxScroll,ma));if(g){let m=g.maxScroll.read(l);u=h+m.maxScroll}this._scrollableElement.setScrollDimensions({width:h,height:c,scrollHeight:d,scrollWidth:u})})),e.replaceChildren(this._scrollableElement.getDomNode()),this._register(be(()=>{e.replaceChildren()})),this._register(this._register(pt(l=>{Wp(c=>{this.render(l)})})))}render(e){let t=this.scrollTop.read(e),i=0,o=0,s=0,r=this._sizeObserver.height.read(e),a=ze.ofStartAndLength(t,r),l=this._sizeObserver.width.read(e);for(let c of this._viewItems.read(e)){let d=c.contentHeight.read(e),h=Math.min(d,r),u=ze.ofStartAndLength(o,h),f=ze.ofStartAndLength(s,d);if(f.isBefore(a))i-=d-h,c.hide();else if(f.isAfter(a))c.hide();else{let g=Math.max(0,Math.min(a.start-f.start,d-h));i-=g;let m=ze.ofStartAndLength(t+i,r);c.render(u,g,l,m)}o+=h+this._spaceBetweenPx,s+=d+this._spaceBetweenPx}this._elements.content.style.transform=`translateY(${-(t+i)}px)`}};sI=$J([CK(4,rt),CK(5,Ye)],sI);var NF=class extends H{constructor(e,t,i,o){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=o,this._templateRef=this._register(F5(this,void 0)),this.contentHeight=We(this,s=>{var r,a,l;return(l=(a=(r=this._templateRef.read(s))===null||r===void 0?void 0:r.object.contentHeight)===null||a===void 0?void 0:a.read(s))!==null&&l!==void 0?l:this.viewModel.lastTemplateData.read(s).contentHeight}),this.maxScroll=We(this,s=>{var r,a;return(a=(r=this._templateRef.read(s))===null||r===void 0?void 0:r.object.maxScroll.read(s))!==null&&a!==void 0?a:{maxScroll:0,scrollWidth:0}}),this.template=We(this,s=>{var r;return(r=this._templateRef.read(s))===null||r===void 0?void 0:r.object}),this._isHidden=ct(this,!1),this._isFocused=We(this,s=>{var r,a;return(a=(r=this.template.read(s))===null||r===void 0?void 0:r.isFocused.read(s))!==null&&a!==void 0?a:!1}),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(pt(s=>{var r;let a=this._scrollLeft.read(s);(r=this._templateRef.read(s))===null||r===void 0||r.object.setScrollLeft(a)})),this._register(pt(s=>{let r=this._templateRef.read(s);!r||!this._isHidden.read(s)||r.object.isFocused.read(s)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){var e;return`VirtualViewItem(${(e=this.viewModel.entry.value.modified)===null||e===void 0?void 0:e.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){var i;this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);let o=this.viewModel.lastTemplateData.get(),s=(i=e.selections)===null||i===void 0?void 0:i.map(nt.liftSelection);this.viewModel.lastTemplateData.set({...o,selections:s},t);let r=this._templateRef.get();r&&s&&r.object.editor.setSelections(s)}_updateTemplateData(e){var t;let i=this._templateRef.get();i&&this.viewModel.lastTemplateData.set({contentHeight:i.object.contentHeight.get(),selections:(t=i.object.editor.getSelections())!==null&&t!==void 0?t:void 0},e)}_clear(){let e=this._templateRef.get();e&&ri(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,o){this._isHidden.set(!1,void 0);let s=this._templateRef.get();if(!s){s=this._objectPool.getUnusedObj(new nI(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(s,void 0);let r=this.viewModel.lastTemplateData.get().selections;r&&s.object.editor.setSelections(r)}s.object.render(e,i,t,o)}};qe();_();v();b();Ge();is();var zSt=F("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},p("multiDiffEditor.headerBackground","The background color of the diff editor's header")),VSt=F("multiDiffEditor.background",{dark:"editorBackground",light:"editorBackground",hcDark:"editorBackground",hcLight:"editorBackground"},p("multiDiffEditor.background","The background color of the multi file diff editor")),HSt=F("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},p("multiDiffEditor.border","The border color of the multi file diff editor"));var qJ=function(n,e,t,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(s=(o<3?r(s):o>3?r(e,t,s):r(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},jJ=function(n,e){return function(t,i){e(t,i,n)}},rI=class extends H{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=ct(this,void 0),this._viewModel=ct(this,void 0),this._widgetImpl=pr(this,(o,s)=>(Ts(C_,o),s.add(this._instantiationService.createInstance(Ts(sI,o),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._register(Ph(this._widgetImpl))}};rI=qJ([jJ(2,Ye)],rI);function GJ(n,e,t){return Ae.initialize(t||{}).createInstance(tI,n,e)}function ZJ(n){return Ae.get(Zt).onCodeEditorAdd(t=>{n(t)})}function YJ(n){return Ae.get(Zt).onDiffEditorAdd(t=>{n(t)})}function XJ(){return Ae.get(Zt).listCodeEditors()}function QJ(){return Ae.get(Zt).listDiffEditors()}function JJ(n,e,t){return Ae.initialize(t||{}).createInstance(iI,n,e)}function eee(n,e){let t=Ae.initialize(e||{});return new rI(n,{},t)}function tee(n){if(typeof n.id!="string"||typeof n.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Pi.registerCommand(n.id,n.run)}function iee(n){if(typeof n.id!="string"||typeof n.label!="string"||typeof n.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");let e=Dt.deserialize(n.precondition),t=(o,...s)=>yl.runEditorCommand(o,s,e,(r,a,l)=>Promise.resolve(n.run(a,...l))),i=new ae;if(i.add(Pi.registerCommand(n.id,t)),n.contextMenuGroupId){let o={command:{id:n.id,title:n.label},when:e,group:n.contextMenuGroupId,order:n.contextMenuOrder||0};i.add(Fs.appendMenuItem(A.EditorContext,o))}if(Array.isArray(n.keybindings)){let o=Ae.get(fi);if(!(o instanceof jh))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{let s=Dt.and(e,Dt.deserialize(n.keybindingContext));i.add(o.addDynamicKeybindings(n.keybindings.map(r=>({keybinding:r,command:n.id,when:s}))))}}return i}function nee(n){return wK([n])}function wK(n){let e=Ae.get(fi);return e instanceof jh?e.addDynamicKeybindings(n.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:Dt.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),H.None)}function oee(n,e,t){let i=Ae.get(ii),o=i.getLanguageIdByMimeType(e)||e;return TF(Ae.get(xn),i,n,o,t)}function see(n,e){let t=Ae.get(ii),i=t.getLanguageIdByMimeType(e)||e||In;n.setLanguage(t.createById(i))}function ree(n,e,t){n&&Ae.get(tl).changeOne(e,n.uri,t)}function aee(n){Ae.get(tl).changeAll(n,[])}function lee(n){return Ae.get(tl).read(n)}function cee(n){return Ae.get(tl).onMarkerChanged(n)}function dee(n){return Ae.get(xn).getModel(n)}function hee(){return Ae.get(xn).getModels()}function uee(n){return Ae.get(xn).onModelAdded(n)}function fee(n){return Ae.get(xn).onModelRemoved(n)}function gee(n){return Ae.get(xn).onModelLanguageChanged(t=>{n({model:t.model,oldLanguage:t.oldLanguageId})})}function mee(n){return w8(Ae.get(xn),Ae.get(yo),n)}function pee(n,e){let t=Ae.get(ii),i=Ae.get(ls);return bm.colorizeElement(i,t,n,e).then(()=>{i.registerEditorContainer(n)})}function _ee(n,e,t){let i=Ae.get(ii);return Ae.get(ls).registerEditorContainer(gt.document.body),bm.colorize(i,n,e,t)}function bee(n,e,t=4){return Ae.get(ls).registerEditorContainer(gt.document.body),bm.colorizeModelLine(n,e,t)}function vee(n){let e=Bt.get(n);return e||{getInitialState:()=>eh,tokenize:(t,i,o)=>_S(n,o)}}function Cee(n,e){Bt.getOrCreate(e);let t=vee(e),i=Tr(n),o=[],s=t.getInitialState();for(let r=0,a=i.length;r{var s;if(!i)return null;let r=(s=t.options)===null||s===void 0?void 0:s.selection,a;return r&&typeof r.endLineNumber=="number"&&typeof r.endColumn=="number"?a=r:r&&(a={lineNumber:r.startLineNumber,column:r.startColumn}),await n.openCodeEditor(i,t.resource,a)?i:null})}function yK(){return{create:GJ,getEditors:XJ,getDiffEditors:QJ,onDidCreateEditor:ZJ,onDidCreateDiffEditor:YJ,createDiffEditor:JJ,addCommand:tee,addEditorAction:iee,addKeybindingRule:nee,addKeybindingRules:wK,createModel:oee,setModelLanguage:see,setModelMarkers:ree,getModelMarkers:lee,removeAllMarkers:aee,onDidChangeMarkers:cee,getModels:hee,getModel:dee,onDidCreateModel:uee,onWillDisposeModel:fee,onDidChangeModelLanguage:gee,createWebWorker:mee,colorizeElement:pee,colorize:_ee,colorizeModelLine:bee,tokenize:Cee,defineTheme:wee,setTheme:yee,remeasureFonts:See,registerCommand:xee,registerLinkOpener:Lee,registerEditorOpener:kee,AccessibilitySupport:yC,ContentWidgetPositionPreference:EC,CursorChangeReason:IC,DefaultEndOfLine:TC,EditorAutoIndentStrategy:AC,EditorOption:MC,EndOfLinePreference:RC,EndOfLineSequence:PC,MinimapPosition:qC,MinimapSectionHeaderStyle:jC,MouseTargetType:GC,OverlayWidgetPositionPreference:XC,OverviewRulerLane:QC,GlyphMarginLane:OC,RenderLineNumbersType:tw,RenderMinimap:iw,ScrollbarVisibility:ow,ScrollType:nw,TextEditorCursorBlinkingStyle:dw,TextEditorCursorStyle:hw,TrackedRangeStickiness:uw,WrappingIndent:fw,InjectedTextCursorStops:WC,PositionAffinity:ew,ShowLightbulbIconMode:rw,ConfigurationChangedEvent:mg,BareFontInfo:mu,FontInfo:pu,TextModelResolvedOptions:Zd,FindMatch:Ll,ApplyUpdateResult:_d,EditorZoom:Rr,createMultiFileDiffEditor:eee,EditorType:Rc,EditorOptions:Ca}}_();v();b();gn();Ke();Yo();Hr();lr();Ma();Ou();_();v();b();function Dee(n,e){if(!e||!Array.isArray(e))return!1;for(let t of e)if(!n(t))return!1;return!0}function aI(n,e){return typeof n=="boolean"?n:e}function SK(n,e){return typeof n=="string"?n:e}function Eee(n){let e={};for(let t of n)e[t]=!0;return e}function xK(n,e=!1){e&&(n=n.map(function(i){return i.toLowerCase()}));let t=Eee(n);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function AF(n,e,t){e=e.replace(/@@/g,"");let i=0,o;do o=!1,e=e.replace(/@(\w+)/g,function(r,a){o=!0;let l="";if(typeof n[a]=="string")l=n[a];else if(n[a]&&n[a]instanceof RegExp)l=n[a].source;else throw n[a]===void 0?Kt(n,"language definition does not contain attribute '"+a+"', used at: "+e):Kt(n,"attribute reference '"+a+"' must be a string, used at: "+e);return th(l)?"":"(?:"+l+")"}),i++;while(o&&i<5);e=e.replace(/\x01/g,"@");let s=(n.ignoreCase?"i":"")+(n.unicode?"u":"");if(t&&e.match(/\$[sS](\d\d?)/g)){let a=null,l=null;return c=>(l&&a===c||(a=c,l=new RegExp(k8(n,e,c),s)),l)}return new RegExp(e,s)}function Iee(n,e,t,i){if(i<0)return n;if(i=100){i=i-100;let o=t.split(".");if(o.unshift(t),i=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=1;else if(t.bracket==="@close")i.bracket=-1;else throw Kt(n,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw Kt(n,"the next state must be a string value in rule: "+e);{let o=t.next;if(!/^(@pop|@push|@popall)$/.test(o)&&(o[0]==="@"&&(o=o.substr(1)),o.indexOf("$")<0&&!D8(n,Nl(n,o,"",[],""))))throw Kt(n,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=o}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,n.usesEmbedded=!0),i}}else if(Array.isArray(t)){let i=[];for(let o=0,s=t.length;o0&&i[0]==="^",this.name=this.name+": "+i,this.regex=AF(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=MF(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}};function PF(n,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");let t={};t.languageId=n,t.includeLF=aI(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=aI(e.ignoreCase,!1),t.unicode=aI(e.unicode,!1),t.tokenPostfix=SK(e.tokenPostfix,"."+t.languageId),t.defaultToken=SK(e.defaultToken,"source"),t.usesEmbedded=!1;let i=e;i.languageId=n,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function o(r,a,l){for(let c of l){let d=c.include;if(d){if(typeof d!="string")throw Kt(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw Kt(t,"include target '"+d+"' is not defined at: "+r);o(r+"."+d,a,e.tokenizer[d])}else{let h=new RF(r);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(h.setRegex(i,c[0]),c.length>=3)if(typeof c[1]=="string")h.setAction(i,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){let u=c[1];u.next=c[2],h.setAction(i,u)}else throw Kt(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+r);else h.setAction(i,c[1]);else{if(!c.regex)throw Kt(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+r);c.name&&typeof c.name=="string"&&(h.name=c.name),c.matchOnlyAtStart&&(h.matchOnlyAtLineStart=aI(c.matchOnlyAtLineStart,!1)),h.setRegex(i,c.regex),h.setAction(i,c.action)}a.push(h)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Kt(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(let r in e.tokenizer)if(e.tokenizer.hasOwnProperty(r)){t.start||(t.start=r);let a=e.tokenizer[r];t.tokenizer[r]=new Array,o("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw Kt(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];let s=[];for(let r of e.brackets){let a=r;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw Kt(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` + hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")s.push({token:a.token+t.tokenPostfix,open:Pa(t,a.open),close:Pa(t,a.close)});else throw Kt(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=s,t.noThrow=!0,t}x1();Fo();function Nee(n){$d.registerLanguage(n)}function Aee(){let n=[];return n=n.concat($d.getLanguages()),n}function Mee(n){return Ae.get(ii).languageIdCodec.encodeLanguageId(n)}function Ree(n,e){return Ae.withServices(()=>{let i=Ae.get(ii).onDidRequestRichLanguageFeatures(o=>{o===n&&(i.dispose(),e())});return i})}function Pee(n,e){return Ae.withServices(()=>{let i=Ae.get(ii).onDidRequestBasicLanguageFeatures(o=>{o===n&&(i.dispose(),e())});return i})}function Oee(n,e){if(!Ae.get(ii).isRegisteredLanguageId(n))throw new Error(`Cannot set configuration for unknown language ${n}`);return Ae.get(yo).register(n,e,100)}var OF=class{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return lI.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){let o=this._actual.tokenizeEncoded(e,i);return new yc(o.tokens,o.endState)}},lI=class n{constructor(e,t,i,o){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=o}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){let i=[],o=0;for(let s=0,r=e.length;s0&&s[r-1]===u)continue;let f=h.startIndex;c===0?f=0:f{let i=await Promise.resolve(e.create());return i?Fee(i)?kK(n,i):new Vu(Ae.get(ii),Ae.get(ls),n,PF(n,i),Ae.get(Rt)):null});return Bt.registerFactory(n,t)}function zee(n,e){if(!Ae.get(ii).isRegisteredLanguageId(n))throw new Error(`Cannot set tokens provider for unknown language ${n}`);return LK(e)?FF(n,{create:()=>e}):Bt.register(n,kK(n,e))}function Vee(n,e){let t=i=>new Vu(Ae.get(ii),Ae.get(ls),n,PF(n,i),Ae.get(Rt));return LK(e)?FF(n,{create:()=>e}):Bt.register(n,t(e))}function Hee(n,e){return Ae.get(Tt).referenceProvider.register(n,e)}function Uee(n,e){return Ae.get(Tt).renameProvider.register(n,e)}function Kee(n,e){return Ae.get(Tt).newSymbolNamesProvider.register(n,e)}function $ee(n,e){return Ae.get(Tt).signatureHelpProvider.register(n,e)}function qee(n,e){return Ae.get(Tt).hoverProvider.register(n,{provideHover:async(i,o,s,r)=>{let a=i.getWordAtPosition(o);return Promise.resolve(e.provideHover(i,o,s,r)).then(l=>{if(l)return!l.range&&a&&(l.range=new P(o.lineNumber,a.startColumn,o.lineNumber,a.endColumn)),l.range||(l.range=new P(o.lineNumber,o.column,o.lineNumber,o.column)),l})}})}function jee(n,e){return Ae.get(Tt).documentSymbolProvider.register(n,e)}function Gee(n,e){return Ae.get(Tt).documentHighlightProvider.register(n,e)}function Zee(n,e){return Ae.get(Tt).linkedEditingRangeProvider.register(n,e)}function Yee(n,e){return Ae.get(Tt).definitionProvider.register(n,e)}function Xee(n,e){return Ae.get(Tt).implementationProvider.register(n,e)}function Qee(n,e){return Ae.get(Tt).typeDefinitionProvider.register(n,e)}function Jee(n,e){return Ae.get(Tt).codeLensProvider.register(n,e)}function ete(n,e,t){return Ae.get(Tt).codeActionProvider.register(n,{providedCodeActionKinds:t?.providedCodeActionKinds,documentation:t?.documentation,provideCodeActions:(o,s,r,a)=>{let c=Ae.get(tl).read({resource:o.uri}).filter(d=>P.areIntersectingOrTouching(d,s));return e.provideCodeActions(o,s,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function tte(n,e){return Ae.get(Tt).documentFormattingEditProvider.register(n,e)}function ite(n,e){return Ae.get(Tt).documentRangeFormattingEditProvider.register(n,e)}function nte(n,e){return Ae.get(Tt).onTypeFormattingEditProvider.register(n,e)}function ote(n,e){return Ae.get(Tt).linkProvider.register(n,e)}function ste(n,e){return Ae.get(Tt).completionProvider.register(n,e)}function rte(n,e){return Ae.get(Tt).colorProvider.register(n,e)}function ate(n,e){return Ae.get(Tt).foldingRangeProvider.register(n,e)}function lte(n,e){return Ae.get(Tt).declarationProvider.register(n,e)}function cte(n,e){return Ae.get(Tt).selectionRangeProvider.register(n,e)}function dte(n,e){return Ae.get(Tt).documentSemanticTokensProvider.register(n,e)}function hte(n,e){return Ae.get(Tt).documentRangeSemanticTokensProvider.register(n,e)}function ute(n,e){return Ae.get(Tt).inlineCompletionsProvider.register(n,e)}function fte(n,e){return Ae.get(Tt).inlineEditProvider.register(n,e)}function gte(n,e){return Ae.get(Tt).inlayHintsProvider.register(n,e)}function DK(){return{register:Nee,getLanguages:Aee,onLanguage:Ree,onLanguageEncountered:Pee,getEncodedLanguageId:Mee,setLanguageConfiguration:Oee,setColorMap:Wee,registerTokensProviderFactory:FF,setTokensProvider:zee,setMonarchTokensProvider:Vee,registerReferenceProvider:Hee,registerRenameProvider:Uee,registerNewSymbolNameProvider:Kee,registerCompletionItemProvider:ste,registerSignatureHelpProvider:$ee,registerHoverProvider:qee,registerDocumentSymbolProvider:jee,registerDocumentHighlightProvider:Gee,registerLinkedEditingRangeProvider:Zee,registerDefinitionProvider:Yee,registerImplementationProvider:Xee,registerTypeDefinitionProvider:Qee,registerCodeLensProvider:Jee,registerCodeActionProvider:ete,registerDocumentFormattingEditProvider:tte,registerDocumentRangeFormattingEditProvider:ite,registerOnTypeFormattingEditProvider:nte,registerLinkProvider:ote,registerColorProvider:rte,registerFoldingRangeProvider:ate,registerDeclarationProvider:lte,registerSelectionRangeProvider:cte,registerDocumentSemanticTokensProvider:dte,registerDocumentRangeSemanticTokensProvider:hte,registerInlineCompletionsProvider:ute,registerInlineEditProvider:fte,registerInlayHintsProvider:gte,DocumentHighlightKind:NC,CompletionItemKind:LC,CompletionItemTag:kC,CompletionItemInsertTextRule:xC,SymbolKind:lw,SymbolTag:cw,IndentAction:BC,CompletionTriggerKind:DC,SignatureHelpTriggerKind:aw,InlayHintKind:zC,InlineCompletionTriggerKind:VC,InlineEditTriggerKind:HC,CodeActionTriggerType:SC,NewSymbolNameTag:ZC,NewSymbolNameTriggerKind:YC,PartialAcceptTriggerKind:JC,HoverVerbosityAction:FC,FoldingRangeKind:fl,SelectedSuggestionInfo:vC}}_();v();b();wt();fs();xt();js();kr();xi();sn();NK();_();v();b();function hd(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===Rc.ICodeEditor:!1}function mte(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===Rc.IDiffEditor:!1}function pte(n){return!!n&&typeof n=="object"&&typeof n.onDidChangeActiveEditor=="function"}function kLt(n){return hd(n)?n:mte(n)?n.getModifiedEditor():pte(n)&&hd(n.activeCodeEditor)?n.activeCodeEditor:null}ft();Ke();Kn();dE();Jw();_();v();b();Ke();var V1=class n{static _handleEolEdits(e,t){let i,o=[];for(let s of t)typeof s.eol=="number"&&(i=s.eol),s.range&&typeof s.text=="string"&&o.push(s);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),o}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;let i=e.getModel(),o=i.validateRange(t.range);return i.getFullModelRange().equalsRange(o)}static execute(e,t,i){i&&e.pushUndoStop();let o=h_.capture(e),s=n._handleEolEdits(e,t);s.length===1&&n._isFullModelReplaceEdit(e,s[0])?e.executeEdits("formatEditsCommand",s.map(r=>Af.replace(P.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",s.map(r=>Af.replaceMove(P.lift(r.range),r.text))),i&&e.pushUndoStop(),o.restoreRelativeVerticalPositionOfCursor(e)}};ir();_();v();b();var dI=class{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}},hI=class{constructor(e){if(this._set=new Set,e)for(let t of e)this.add(t)}add(e){this._set.add(dI.toKey(e))}has(e){return this._set.has(dI.toKey(e))}};qe();Ou();Aa();function AK(n,e,t){let i=[],o=new hI,s=n.ordered(t);for(let a of s)i.push(a),a.extensionId&&o.add(a.extensionId);let r=e.ordered(t);for(let a of r){if(a.extensionId){if(o.has(a.extensionId))continue;o.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,d){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,d)}})}return i}var sg=class n{static setFormatterSelector(e){return{dispose:n._selectors.unshift(e)}}static async select(e,t,i,o){if(e.length===0)return;let s=ht.first(n._selectors);if(s)return await s(e,t,i,o)}};sg._selectors=new Ii;async function ckt(n,e,t,i,o,s,r){let a=n.get(Ye),{documentRangeFormattingEditProvider:l}=n.get(Tt),c=hd(e)?e.getModel():e,d=l.ordered(c),h=await sg.select(d,c,i,2);h&&(o.report(h),await a.invokeFunction(_te,h,e,t,s,r))}async function _te(n,e,t,i,o,s){var r,a;let l=n.get(rc),c=n.get(En),d=n.get(rl),h,u;hd(t)?(h=t.getModel(),u=new W1(t,5,void 0,o)):(h=t,u=new z1(t,o));let f=[],g=0;for(let y of QF(i).sort(P.compareRangesUsingStarts))g>0&&P.areIntersectingOrTouching(f[g-1],y)?f[g-1]=P.fromPositions(f[g-1].getStartPosition(),y.getEndPosition()):g=f.push(y);let m=async y=>{var x,k;c.trace("[format][provideDocumentRangeFormattingEdits] (request)",(x=e.extensionId)===null||x===void 0?void 0:x.value,y);let T=await e.provideDocumentRangeFormattingEdits(h,y,h.getFormattingOptions(),u.token)||[];return c.trace("[format][provideDocumentRangeFormattingEdits] (response)",(k=e.extensionId)===null||k===void 0?void 0:k.value,T),T},C=(y,x)=>{if(!y.length||!x.length)return!1;let k=y.reduce((T,N)=>P.plusRange(T,N.range),y[0].range);if(!x.some(T=>P.intersectRanges(k,T.range)))return!1;for(let T of y)for(let N of x)if(P.intersectRanges(T.range,N.range))return!0;return!1},S=[],w=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){c.trace("[format][provideDocumentRangeFormattingEdits] (request)",(r=e.extensionId)===null||r===void 0?void 0:r.value,f);let y=await e.provideDocumentRangesFormattingEdits(h,f,h.getFormattingOptions(),u.token)||[];c.trace("[format][provideDocumentRangeFormattingEdits] (response)",(a=e.extensionId)===null||a===void 0?void 0:a.value,y),w.push(y)}else{for(let y of f){if(u.token.isCancellationRequested)return!0;w.push(await m(y))}for(let y=0;y({text:k.text,range:P.lift(k.range),forceMoveMarkers:!0})),k=>{for(let{range:T}of k)if(P.areIntersectingOrTouching(T,x))return[new nt(T.startLineNumber,T.startColumn,T.endLineNumber,T.endColumn)];return null})}return d.playSignal(Ve.format,{userGesture:s}),!0}async function dkt(n,e,t,i,o,s){let r=n.get(Ye),a=n.get(Tt),l=hd(e)?e.getModel():e,c=AK(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),d=await sg.select(c,l,t,1);d&&(i.report(d),await r.invokeFunction(bte,d,e,t,o,s))}async function bte(n,e,t,i,o,s){let r=n.get(rc),a=n.get(rl),l,c;hd(t)?(l=t.getModel(),c=new W1(t,5,void 0,o)):(l=t,c=new z1(t,o));let d;try{let h=await e.provideDocumentFormattingEdits(l,l.getFormattingOptions(),c.token);if(d=await r.computeMoreMinimalEdits(l.uri,h),c.token.isCancellationRequested)return!0}finally{c.dispose()}if(!d||d.length===0)return!1;if(hd(t))V1.execute(t,d,i!==2),i!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{let[{range:h}]=d,u=new nt(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn);l.pushEditOperations([u],d.map(f=>({text:f.text,range:P.lift(f.range),forceMoveMarkers:!0})),f=>{for(let{range:g}of f)if(P.areIntersectingOrTouching(g,u))return[new nt(g.startLineNumber,g.startColumn,g.endLineNumber,g.endColumn)];return null})}return a.playSignal(Ve.format,{userGesture:s}),!0}async function vte(n,e,t,i,o,s){let r=e.documentRangeFormattingEditProvider.ordered(t);for(let a of r){let l=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,o,s)).catch(oC);if(eu(l))return await n.computeMoreMinimalEdits(t.uri,l)}}async function Cte(n,e,t,i,o){let s=AK(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(let r of s){let a=await Promise.resolve(r.provideDocumentFormattingEdits(t,i,o)).catch(oC);if(eu(a))return await n.computeMoreMinimalEdits(t.uri,a)}}function wte(n,e,t,i,o,s,r){let a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(o)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,o,s,r)).catch(oC).then(l=>n.computeMoreMinimalEdits(t.uri,l))}Pi.registerCommand("_executeFormatRangeProvider",async function(n,...e){let[t,i,o]=e;Ms(Oe.isUri(t)),Ms(P.isIRange(i));let s=n.get(Wd),r=n.get(rc),a=n.get(Tt),l=await s.createModelReference(t);try{return vte(r,a,l.object.textEditorModel,P.lift(i),o,Mo.None)}finally{l.dispose()}});Pi.registerCommand("_executeFormatDocumentProvider",async function(n,...e){let[t,i]=e;Ms(Oe.isUri(t));let o=n.get(Wd),s=n.get(rc),r=n.get(Tt),a=await o.createModelReference(t);try{return Cte(s,r,a.object.textEditorModel,i,Mo.None)}finally{a.dispose()}});Pi.registerCommand("_executeFormatOnTypeProvider",async function(n,...e){let[t,i,o,s]=e;Ms(Oe.isUri(t)),Ms(U.isIPosition(i)),Ms(typeof o=="string");let r=n.get(Wd),a=n.get(rc),l=n.get(Tt),c=await r.createModelReference(t);try{return wte(a,l,c.object.textEditorModel,U.lift(i),o,s,Mo.None)}finally{c.dispose()}});Ca.wrappingIndent.defaultValue=0;Ca.glyphMargin.defaultValue=!1;Ca.autoIndent.defaultValue=3;Ca.overviewRulerLanes.defaultValue=2;sg.setFormatterSelector((n,e,t)=>Promise.resolve(n[0]));var Go=gw();Go.editor=yK();Go.languages=DK();var yte=Go.CancellationTokenSource,Ste=Go.Emitter,xte=Go.KeyCode,Lte=Go.KeyMod,kte=Go.Position,Dte=Go.Range,Ete=Go.Selection,Ite=Go.SelectionDirection,Tte=Go.MarkerSeverity,Nte=Go.MarkerTag,Ate=Go.Uri,Mte=Go.Token,Rte=Go.editor,Pte=Go.languages,WF=globalThis.MonacoEnvironment;(WF?.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=Go);typeof globalThis.require<"u"&&typeof globalThis.require.config=="function"&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});export{Ht as a,ZF as b,$F as c,Bte as d,$1 as e,XF as f,eu as g,xr as h,QF as i,Io as j,ma as k,i9 as l,qF as m,wt as n,tn as o,dn as p,pa as q,ds as r,bc as s,Ms as t,G1 as u,cg as v,xi as w,cl as x,WK as y,hs as z,p as A,Zte as B,Ge as C,Li as D,Be as E,mi as F,md as G,hl as H,Rs as I,eie as J,po as K,p9 as L,Lt as M,ht as N,js as O,Ii as P,kr as Q,Zs as R,Cc as S,ba as T,tu as U,Ao as V,Ca as W,ut as X,oC as Y,yd as Z,Dr as _,Sd as $,St as aa,xt as ba,wa as ca,bg as da,aC as ea,li as fa,_o as ga,be as ha,ae as ia,H as ja,no as ka,k9 as la,le as ma,Er as na,vg as oa,ie as pa,B as qa,ul as ra,ye as sa,Mo as ta,un as ua,tne as va,fs as wa,N9 as xa,z_ as ya,O9 as za,xg as Aa,ya as Ba,wc as Ca,Oe as Da,sn as Ea,U as Fa,ft as Ga,P as Ha,Ke as Ia,nt as Ja,Kn as Ka,ue as La,$n as Ma,q9 as Na,j9 as Oa,G9 as Pa,vC as Qa,Z9 as Ra,Y9 as Sa,X9 as Ta,doe as Ua,hoe as Va,CC as Wa,fl as Xa,Q9 as Ya,J9 as Za,e7 as _a,t7 as $a,Bt as ab,i7 as bb,Yo as cb,gt as db,vo as eb,qn as fb,Md as gb,r7 as hb,du as ib,gs as jb,Koe as kb,$oe as lb,Tr as mb,qoe as nb,Ri as ob,jn as pb,Os as qb,G_ as rb,DT as sb,au as tb,ml as ub,Y_ as vb,X_ as wb,pi as xb,Rd as yb,Lc as zb,Ig as Ab,joe as Bb,Goe as Cb,cu as Db,ot as Eb,wn as Fb,ps as Gb,pl as Hb,Mg as Ib,bt as Jb,oo as Kb,yn as Lb,Qs as Mb,PT as Nb,zse as Ob,ka as Pb,kc as Qb,s0 as Rb,Vse as Sb,Xo as Tb,di as Ub,Og as Vb,o0 as Wb,Hse as Xb,Gt as Yb,Ze as Zb,er as _b,zw as $b,Bg as ac,ge as bc,Co as cc,$ as dc,Ut as ec,kre as fc,m0 as gc,N7 as hc,JT as ic,eN as jc,zg as kc,Ar as lc,F7 as mc,Dre as nc,Sn as oc,Vg as pc,p0 as qc,yi as rc,Ec as sc,Bi as tc,_0 as uc,jw as vc,Ere as wc,Gw as xc,Iq as yc,se as zc,He as Ac,Ic as Bc,me as Cc,Wi as Dc,ve as Ec,Ire as Fc,b0 as Gc,Zw as Hc,uu as Ic,kt as Jc,ke as Kc,Kg as Lc,Si as Mc,Rr as Nc,Ye as Oc,De as Pc,qe as Qc,Zt as Rc,Or as Sc,xn as Tc,_u as Uc,Wd as Vc,Jw as Wc,Ro as Xc,zi as Yc,bl as Zc,zd as _c,Po as $c,Xe as ad,Ln as bd,kn as cd,Pi as dd,ir as ed,Dt as fd,S0 as gd,xe as hd,rt as id,Oi as jd,$g as kd,Na as ld,Vt as md,Oo as nd,Cl as od,k0 as pd,jg as qd,A as rd,Wr as sd,Fs as td,wl as ud,Br as vd,gy as wd,ece as xd,zr as yd,nr as zd,Gg as Ad,En as Bd,Aa as Cd,D0 as Dd,yl as Ed,pN as Fd,l3 as Gd,c3 as Hd,Oce as Id,Je as Jd,Fce as Kd,Bce as Ld,Wce as Md,vy as Nd,Ud as Od,Bs as Pd,Vi as Qd,yu as Rd,Sy as Sd,A0 as Td,Sl as Ud,xu as Vd,Rt as Wd,Fo as Xd,ii as Yd,Hr as Zd,_t as _d,Ur as $d,rr as ae,M0 as be,ar as ce,Du as de,In as ee,Ma as fe,yo as ge,lr as he,Eu as ie,W3 as je,Gy as ke,Gn as le,Kr as me,Jg as ne,cr as oe,xl as pe,W0 as qe,em as re,dr as se,Nu as te,$3 as ue,hr as ve,Ac as we,eS as xe,tS as ye,Mu as ze,oS as Ae,aA as Be,$fe as Ce,Dl as De,ws as Ee,om as Fe,rS as Ge,aS as He,vt as Ie,dm as Je,Z as Ke,gn as Le,fS as Me,Tt as Ne,Ou as Oe,Z0 as Pe,eh as Qe,_S as Re,hm as Se,Y0 as Te,mn as Ue,um as Ve,Hi as We,Pc as Xe,$r as Ye,qr as Ze,eb as _e,ob as $e,Uu as af,LS as bf,wm as cf,ao as df,P8 as ef,Rl as ff,he as gf,F as hf,Ee as if,HA as jf,at as kf,ih as lf,Ct as mf,ni as nf,Nn as of,Zu as pf,Fi as qf,Sm as rf,Wa as sf,$ve as tf,An as uf,Tm as vf,Vo as wf,Nm as xf,Gve as yf,xm as zf,$A as Af,za as Bf,sh as Cf,Jve as Df,$8 as Ef,Q8 as Ff,nh as Gf,oh as Hf,n1e as If,o1e as Jf,s1e as Kf,r1e as Lf,Va as Mf,nB as Nf,M1e as Of,R1e as Pf,ab as Qf,U1e as Rf,_B as Sf,bB as Tf,vB as Uf,CB as Vf,wB as Wf,yB as Xf,RS as Yf,ICe as Zf,lb as _f,FS as $f,cb as ag,is as bg,tM as cg,Ol as dg,Qu as eg,ch as fg,x6 as gg,oi as hg,Ka as ig,It as jg,ui as kg,co as lg,ix as mg,uh as ng,et as og,T6 as pg,Hm as qg,I6 as rg,an as sg,nf as tg,Lo as ug,Qi as vg,GLe as wg,$a as xg,fi as yg,yx as zg,xM as Ag,mt as Bg,ho as Cg,uW as Dg,Sx as Eg,Ti as Fg,uo as Gg,fW as Hg,On as Ig,bb as Jg,mh as Kg,HEe as Lg,UEe as Mg,ta as Ng,_e as Og,wb as Pg,vW as Qg,CW as Rg,wW as Sg,na as Tg,tp as Ug,Fn as Vg,vi as Wg,$c as Xg,kL as Yg,op as Zg,IL as _g,rR as $g,NL as ah,RW as bh,uR as ch,WW as dh,fFe as eh,yR as fh,qc as gh,gi as hh,XW as ih,LFe as jh,qb as kh,kFe as lh,QW as mh,DFe as nh,EFe as oh,$b as ph,bf as qh,up as rh,ZL as sh,Zc as th,ek as uh,qi as vh,sv as wh,IZ as xh,TZ as yh,NZ as zh,Ci as Ah,Oz as Bh,Ko as Ch,Df as Dh,Kk as Eh,Bn as Fh,Cp as Gh,Yk as Hh,I4 as Ih,GZ as Jh,Kz as Kh,Rze as Lh,$z as Mh,V4 as Nh,Lh as Oh,xh as Ph,Qc as Qh,Ds as Rh,aD as Sh,lD as Th,oV as Uh,U4 as Vh,K4 as Wh,Jl as Xh,ra as Yh,wp as Zh,Ef as _h,mV as $h,vv as ai,_Y as bi,bY as ci,DHe as di,EHe as ei,LY as fi,Tf as gi,fD as hi,yp as ii,IHe as ji,mD as ki,pD as li,xp as mi,Cv as ni,FY as oi,ic as pi,Lp as qi,yv as ri,c5 as si,kp as ti,xv as ui,p5 as vi,WV as wi,Ip as xi,hX as yi,Af as zi,GV as Ai,ZV as Bi,y5 as Ci,Ap as Di,Av as Ei,YV as Fi,bX as Gi,_je as Hi,bje as Ii,yX as Ji,Cje as Ki,XV as Li,QV as Mi,JV as Ni,eH as Oi,tH as Pi,iH as Qi,E5 as Ri,nH as Si,OD as Ti,ji as Ui,Mf as Vi,Qn as Wi,uZe as Xi,fZe as Yi,gZe as Zi,R5 as _i,ri as $i,TZe as aj,Pf as bj,ct as cj,NZe as dj,F5 as ej,zp as fj,We as gj,Vp as hj,$X as ij,pt as jj,Uv as kj,Mh as lj,Jn as mj,Rh as nj,$t as oj,fo as pj,Kv as qj,Ph as rj,rYe as sj,xH as tj,V5 as uj,bn as vj,Do as wj,Fh as xj,SQe as yj,Vf as zj,MH as Aj,tP as Bj,iP as Cj,BH as Dj,Hf as Ej,Uf as Fj,HH as Gj,Zv as Hj,KH as Ij,Eo as Jj,rc as Kj,dE as Lj,Es as Mj,qH as Nj,tl as Oj,_P as Pj,la as Qj,gE as Rj,nd as Sj,eU as Tj,$f as Uj,iU as Vj,vE as Wj,CE as Xj,wE as Yj,yE as Zj,LE as _j,s1 as $j,oat as ak,sat as bk,hat as ck,ol as dk,Bat as ek,OQ as fk,BQ as gk,gU as hk,Uh as ik,f1 as jk,Tlt as kk,QE as lk,Jf as mk,_1 as nk,fc as ok,iut as pk,Kh as qk,S1 as rk,a_ as sk,l_ as tk,ls as uk,x1 as vk,d_ as wk,rl as xk,Ve as yk,Xgt as zk,h_ as Ak,ZU as Bk,ca as Ck,xF as Dk,P1 as Ek,fK as Fk,v_ as Gk,TK as Hk,W1 as Ik,z1 as Jk,NK as Kk,hd as Lk,mte as Mk,kLt as Nk,V1 as Ok,ckt as Pk,dkt as Qk,wte as Rk,yte as Sk,Ste as Tk,xte as Uk,Lte as Vk,kte as Wk,Dte as Xk,Ete as Yk,Ite as Zk,Tte as _k,Nte as $k,Ate as al,Mte as bl,Rte as cl,Pte as dl,Ote as el}; diff --git a/rust/cymbal/tests/static/python_err_props.json b/rust/cymbal/tests/static/python_err_props.json new file mode 100644 index 0000000000000..df4caf67e728e --- /dev/null +++ b/rust/cymbal/tests/static/python_err_props.json @@ -0,0 +1,737 @@ +{ + "$exception_list": [ + { + "type": "ConnectionRefusedError", + "value": "[Errno 111] Connection refused", + "mechanism": { + "handled": true, + "type": "generic" + }, + "stacktrace": { + "type": "raw", + "frames": [ + { + "platform": "python", + "abs_path": "/python-runtime/urllib3/connection.py", + "context_line": " conn = connection.create_connection(", + "filename": "urllib3/connection.py", + "function": "_new_conn", + "lineno": 174, + "module": "urllib3.connection", + "pre_context": [ + "", + " if self.socket_options:", + " extra_kw[\"socket_options\"] = self.socket_options", + "", + " try:" + ], + "post_context": [ + " (self._dns_host, self.port), self.timeout, **extra_kw", + " )", + "", + " except SocketTimeout:", + " raise ConnectTimeoutError(" + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/python-runtime/urllib3/util/connection.py", + "context_line": " raise err", + "filename": "urllib3/util/connection.py", + "function": "create_connection", + "lineno": 95, + "module": "urllib3.util.connection", + "pre_context": [ + " if sock is not None:", + " sock.close()", + " sock = None", + "", + " if err is not None:" + ], + "post_context": [ + "", + " raise socket.error(\"getaddrinfo returns an empty list\")", + "", + "", + "def _set_socket_options(sock, options):" + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/python-runtime/urllib3/util/connection.py", + "context_line": " sock.connect(sa)", + "filename": "urllib3/util/connection.py", + "function": "create_connection", + "lineno": 85, + "module": "urllib3.util.connection", + "pre_context": [ + "", + " if timeout is not socket._GLOBAL_DEFAULT_TIMEOUT:", + " sock.settimeout(timeout)", + " if source_address:", + " sock.bind(source_address)" + ], + "post_context": [ + " return sock", + "", + " except socket.error as e:", + " err = e", + " if sock is not None:" + ], + "in_app": false + } + ] + } + }, + { + "type": "NewConnectionError", + "value": ": Failed to establish a new connection: [Errno 111] Connection refused", + "mechanism": { + "handled": true, + "type": "generic" + }, + "module": "urllib3.exceptions", + "stacktrace": { + "type": "raw", + "frames": [ + { + "platform": "python", + "abs_path": "/python-runtime/urllib3/connectionpool.py", + "context_line": " httplib_response = self._make_request(", + "filename": "urllib3/connectionpool.py", + "function": "urlopen", + "lineno": 715, + "module": "urllib3.connectionpool", + "pre_context": [ + " )", + " if is_new_proxy_conn and http_tunnel_required:", + " self._prepare_proxy(conn)", + "", + " # Make the request on the httplib connection object." + ], + "post_context": [ + " conn,", + " method,", + " url,", + " timeout=timeout_obj,", + " body=body," + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/python-runtime/urllib3/connectionpool.py", + "context_line": " conn.request(method, url, **httplib_request_kw)", + "filename": "urllib3/connectionpool.py", + "function": "_make_request", + "lineno": 416, + "module": "urllib3.connectionpool", + "pre_context": [ + " # urllib3.request. It also calls makefile (recv) on the socket.", + " try:", + " if chunked:", + " conn.request_chunked(method, url, **httplib_request_kw)", + " else:" + ], + "post_context": [ + "", + " # We are swallowing BrokenPipeError (errno.EPIPE) since the server is", + " # legitimately able to close the connection after sending a valid response.", + " # With this behaviour, the received response is still readable.", + " except BrokenPipeError:" + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/python-runtime/urllib3/connection.py", + "context_line": " super(HTTPConnection, self).request(method, url, body=body, headers=headers)", + "filename": "urllib3/connection.py", + "function": "request", + "lineno": 244, + "module": "urllib3.connection", + "pre_context": [ + " else:", + " # Avoid modifying the headers passed into .request()", + " headers = headers.copy()", + " if \"user-agent\" not in (six.ensure_str(k.lower()) for k in headers):", + " headers[\"User-Agent\"] = _get_default_user_agent()" + ], + "post_context": [ + "", + " def request_chunked(self, method, url, body=None, headers=None):", + " \"\"\"", + " Alternative to the common request method, which sends the", + " body with chunked encoding and not as one block" + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/usr/local/lib/python3.11/http/client.py", + "context_line": " self._send_request(method, url, body, headers, encode_chunked)", + "filename": "http/client.py", + "function": "request", + "lineno": 1298, + "module": "http.client", + "pre_context": [ + " self._send_output(message_body, encode_chunked=encode_chunked)", + "", + " def request(self, method, url, body=None, headers={}, *,", + " encode_chunked=False):", + " \"\"\"Send a complete request to the server.\"\"\"" + ], + "post_context": [ + "", + " def _send_request(self, method, url, body, headers, encode_chunked):", + " # Honor explicitly requested Host: and Accept-Encoding: headers.", + " header_names = frozenset(k.lower() for k in headers)", + " skips = {}" + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/usr/local/lib/python3.11/http/client.py", + "context_line": " self.endheaders(body, encode_chunked=encode_chunked)", + "filename": "http/client.py", + "function": "_send_request", + "lineno": 1344, + "module": "http.client", + "pre_context": [ + " self.putheader(hdr, value)", + " if isinstance(body, str):", + " # RFC 2616 Section 3.7.1 says that text default has a", + " # default charset of iso-8859-1.", + " body = _encode(body, 'body')" + ], + "post_context": [ + "", + " def getresponse(self):", + " \"\"\"Get the response from the server.", + "", + " If the HTTPConnection is in the correct state, returns an" + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/usr/local/lib/python3.11/http/client.py", + "context_line": " self._send_output(message_body, encode_chunked=encode_chunked)", + "filename": "http/client.py", + "function": "endheaders", + "lineno": 1293, + "module": "http.client", + "pre_context": [ + " \"\"\"", + " if self.__state == _CS_REQ_STARTED:", + " self.__state = _CS_REQ_SENT", + " else:", + " raise CannotSendHeader()" + ], + "post_context": [ + "", + " def request(self, method, url, body=None, headers={}, *,", + " encode_chunked=False):", + " \"\"\"Send a complete request to the server.\"\"\"", + " self._send_request(method, url, body, headers, encode_chunked)" + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/usr/local/lib/python3.11/http/client.py", + "context_line": " self.send(msg)", + "filename": "http/client.py", + "function": "_send_output", + "lineno": 1052, + "module": "http.client", + "pre_context": [ + " A message_body may be specified, to be appended to the request.", + " \"\"\"", + " self._buffer.extend((b\"\", b\"\"))", + " msg = b\"\\r\\n\".join(self._buffer)", + " del self._buffer[:]" + ], + "post_context": [ + "", + " if message_body is not None:", + "", + " # create a consistent interface to message_body", + " if hasattr(message_body, 'read'):" + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/usr/local/lib/python3.11/http/client.py", + "context_line": " self.connect()", + "filename": "http/client.py", + "function": "send", + "lineno": 990, + "module": "http.client", + "pre_context": [ + " file-like object that supports a .read() method, or an iterable object.", + " \"\"\"", + "", + " if self.sock is None:", + " if self.auto_open:" + ], + "post_context": [ + " else:", + " raise NotConnected()", + "", + " if self.debuglevel > 0:", + " print(\"send:\", repr(data))" + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/python-runtime/urllib3/connection.py", + "context_line": " conn = self._new_conn()", + "filename": "urllib3/connection.py", + "function": "connect", + "lineno": 205, + "module": "urllib3.connection", + "pre_context": [ + " self._tunnel()", + " # Mark this connection as not reusable", + " self.auto_open = 0", + "", + " def connect(self):" + ], + "post_context": [ + " self._prepare_conn(conn)", + "", + " def putrequest(self, method, url, *args, **kwargs):", + " \"\"\" \"\"\"", + " # Empty docstring because the indentation of CPython's implementation" + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/python-runtime/urllib3/connection.py", + "context_line": " raise NewConnectionError(", + "filename": "urllib3/connection.py", + "function": "_new_conn", + "lineno": 186, + "module": "urllib3.connection", + "pre_context": [ + " \"Connection to %s timed out. (connect timeout=%s)\"", + " % (self.host, self.timeout),", + " )", + "", + " except SocketError as e:" + ], + "post_context": [ + " self, \"Failed to establish a new connection: %s\" % e", + " )", + "", + " return conn", + "" + ], + "in_app": false + } + ] + } + }, + { + "type": "MaxRetryError", + "value": "HTTPConnectionPool(host='clickhouse', port=8123): Max retries exceeded with url: / (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused'))", + "mechanism": { + "handled": true, + "type": "generic" + }, + "module": "urllib3.exceptions", + "stacktrace": { + "type": "raw", + "frames": [ + { + "platform": "python", + "abs_path": "/python-runtime/requests/adapters.py", + "context_line": " resp = conn.urlopen(", + "filename": "requests/adapters.py", + "function": "send", + "lineno": 564, + "module": "requests.adapters", + "pre_context": [ + " pass", + " else:", + " timeout = TimeoutSauce(connect=timeout, read=timeout)", + "", + " try:" + ], + "post_context": [ + " method=request.method,", + " url=url,", + " body=request.body,", + " headers=request.headers,", + " redirect=False," + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/python-runtime/urllib3/connectionpool.py", + "context_line": " retries = retries.increment(", + "filename": "urllib3/connectionpool.py", + "function": "urlopen", + "lineno": 799, + "module": "urllib3.connectionpool", + "pre_context": [ + " elif isinstance(e, (SocketError, NewConnectionError)) and self.proxy:", + " e = ProxyError(\"Cannot connect to proxy.\", e)", + " elif isinstance(e, (SocketError, HTTPException)):", + " e = ProtocolError(\"Connection aborted.\", e)", + "" + ], + "post_context": [ + " method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]", + " )", + " retries.sleep()", + "", + " # Keep track of the error for the retry warning." + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/python-runtime/urllib3/util/retry.py", + "context_line": " raise MaxRetryError(_pool, url, error or ResponseError(cause))", + "filename": "urllib3/util/retry.py", + "function": "increment", + "lineno": 592, + "module": "urllib3.util.retry", + "pre_context": [ + " other=other,", + " history=history,", + " )", + "", + " if new_retry.is_exhausted():" + ], + "post_context": [ + "", + " log.debug(\"Incremented Retry for (url='%s'): %r\", url, new_retry)", + "", + " return new_retry", + "" + ], + "in_app": false + } + ] + } + }, + { + "type": "ConnectionError", + "value": "HTTPConnectionPool(host='clickhouse', port=8123): Max retries exceeded with url: / (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused'))", + "mechanism": { + "handled": true, + "type": "generic" + }, + "module": "requests.exceptions", + "stacktrace": { + "type": "raw", + "frames": [ + { + "platform": "python", + "filename": "manage.py", + "in_app": true, + "function": "" + }, + { + "platform": "python", + "filename": "manage.py", + "in_app": true, + "function": "main" + }, + { + "platform": "python", + "abs_path": "/python-runtime/django/core/management/__init__.py", + "context_line": " utility.execute()", + "filename": "django/core/management/__init__.py", + "function": "execute_from_command_line", + "lineno": 442, + "module": "django.core.management", + "pre_context": [ + "", + "", + "def execute_from_command_line(argv=None):", + " \"\"\"Run a ManagementUtility.\"\"\"", + " utility = ManagementUtility(argv)" + ], + "post_context": [], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/python-runtime/django/core/management/__init__.py", + "context_line": " self.fetch_command(subcommand).run_from_argv(self.argv)", + "filename": "django/core/management/__init__.py", + "function": "execute", + "lineno": 436, + "module": "django.core.management", + "pre_context": [ + " elif subcommand == \"version\" or self.argv[1:] == [\"--version\"]:", + " sys.stdout.write(django.get_version() + \"\\n\")", + " elif self.argv[1:] in ([\"--help\"], [\"-h\"]):", + " sys.stdout.write(self.main_help_text() + \"\\n\")", + " else:" + ], + "post_context": [ + "", + "", + "def execute_from_command_line(argv=None):", + " \"\"\"Run a ManagementUtility.\"\"\"", + " utility = ManagementUtility(argv)" + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/python-runtime/django/core/management/base.py", + "context_line": " self.execute(*args, **cmd_options)", + "filename": "django/core/management/base.py", + "function": "run_from_argv", + "lineno": 412, + "module": "django.core.management.base", + "pre_context": [ + " cmd_options = vars(options)", + " # Move positional args out of options to mimic legacy optparse", + " args = cmd_options.pop(\"args\", ())", + " handle_default_options(options)", + " try:" + ], + "post_context": [ + " except CommandError as e:", + " if options.traceback:", + " raise", + "", + " # SystemCheckError takes care of its own formatting." + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/python-runtime/django/core/management/base.py", + "context_line": " output = self.handle(*args, **options)", + "filename": "django/core/management/base.py", + "function": "execute", + "lineno": 458, + "module": "django.core.management.base", + "pre_context": [ + " self.check()", + " else:", + " self.check(tags=self.requires_system_checks)", + " if self.requires_migrations_checks:", + " self.check_migrations()" + ], + "post_context": [ + " if output:", + " if self.output_transaction:", + " connection = connections[options.get(\"database\", DEFAULT_DB_ALIAS)]", + " output = \"%s\\n%s\\n%s\" % (", + " self.style.SQL_KEYWORD(connection.ops.start_transaction_sql())," + ], + "in_app": false + }, + { + "platform": "python", + "filename": "posthog/management/commands/migrate_clickhouse.py", + "in_app": true, + "function": "handle" + }, + { + "platform": "python", + "filename": "posthog/management/commands/migrate_clickhouse.py", + "in_app": true, + "function": "migrate" + }, + { + "platform": "python", + "abs_path": "/python-runtime/infi/clickhouse_orm/database.py", + "context_line": " self.db_exists = self._is_existing_database()", + "filename": "/python-runtime/infi/clickhouse_orm/database.py", + "function": "__init__", + "lineno": 118, + "module": "infi.clickhouse_orm.database", + "pre_context": [ + " self.request_session.auth = (username, password or '')", + " self.log_statements = log_statements", + " self.randomize_replica_paths = randomize_replica_paths", + " self.settings = {}", + " self.db_exists = False # this is required before running _is_existing_database" + ], + "post_context": [ + " if readonly:", + " if not self.db_exists:", + " raise DatabaseException('Database does not exist, and cannot be created under readonly connection')", + " self.connection_readonly = self._is_connection_readonly()", + " self.readonly = True" + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/python-runtime/infi/clickhouse_orm/database.py", + "context_line": " r = self._send(\"SELECT count() FROM system.databases WHERE name = '%s'\" % self.db_name)", + "filename": "/python-runtime/infi/clickhouse_orm/database.py", + "function": "_is_existing_database", + "lineno": 440, + "module": "infi.clickhouse_orm.database", + "pre_context": [ + " # :TRICKY: Altinity cloud uses a non-numeric suffix for the version, which this removes.", + " ver = re.sub(r\"[.\\D]+$\", '', ver)", + " return tuple(int(n) for n in ver.split('.')) if as_tuple else ver", + "", + " def _is_existing_database(self):" + ], + "post_context": [ + " return r.text.strip() == '1'", + "", + " def _is_connection_readonly(self):", + " r = self._send(\"SELECT value FROM system.settings WHERE name = 'readonly'\")", + " return r.text.strip() != '0'" + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/python-runtime/infi/clickhouse_orm/database.py", + "context_line": " r = self.request_session.post(self.db_url, params=params, data=data, stream=stream, timeout=self.timeout)", + "filename": "/python-runtime/infi/clickhouse_orm/database.py", + "function": "_send", + "lineno": 391, + "module": "infi.clickhouse_orm.database", + "pre_context": [ + " if isinstance(data, str):", + " data = data.encode('utf-8')", + " if self.log_statements:", + " logger.info(data)", + " params = self._build_params(settings)" + ], + "post_context": [ + " if r.status_code != 200:", + " raise ServerError(r.text)", + " return r", + "", + " def _build_params(self, settings):" + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/python-runtime/requests/sessions.py", + "context_line": " return self.request(\"POST\", url, data=data, json=json, **kwargs)", + "filename": "requests/sessions.py", + "function": "post", + "lineno": 637, + "module": "requests.sessions", + "pre_context": [ + " :param json: (optional) json to send in the body of the :class:`Request`.", + " :param \\*\\*kwargs: Optional arguments that ``request`` takes.", + " :rtype: requests.Response", + " \"\"\"", + "" + ], + "post_context": [ + "", + " def put(self, url, data=None, **kwargs):", + " r\"\"\"Sends a PUT request. Returns :class:`Response` object.", + "", + " :param url: URL for the new :class:`Request` object." + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/python-runtime/requests/sessions.py", + "context_line": " resp = self.send(prep, **send_kwargs)", + "filename": "requests/sessions.py", + "function": "request", + "lineno": 589, + "module": "requests.sessions", + "pre_context": [ + " send_kwargs = {", + " \"timeout\": timeout,", + " \"allow_redirects\": allow_redirects,", + " }", + " send_kwargs.update(settings)" + ], + "post_context": [ + "", + " return resp", + "", + " def get(self, url, **kwargs):", + " r\"\"\"Sends a GET request. Returns :class:`Response` object." + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/python-runtime/requests/sessions.py", + "context_line": " r = adapter.send(request, **kwargs)", + "filename": "requests/sessions.py", + "function": "send", + "lineno": 703, + "module": "requests.sessions", + "pre_context": [ + "", + " # Start time (approximately) of the request", + " start = preferred_clock()", + "", + " # Send the request" + ], + "post_context": [ + "", + " # Total elapsed time of the request (approximately)", + " elapsed = preferred_clock() - start", + " r.elapsed = timedelta(seconds=elapsed)", + "" + ], + "in_app": false + }, + { + "platform": "python", + "abs_path": "/python-runtime/requests/adapters.py", + "context_line": " raise ConnectionError(e, request=request)", + "filename": "requests/adapters.py", + "function": "send", + "lineno": 597, + "module": "requests.adapters", + "pre_context": [ + "", + " if isinstance(e.reason, _SSLError):", + " # This branch is for urllib3 v1.22 and later.", + " raise SSLError(e, request=request)", + "" + ], + "post_context": [ + "", + " except ClosedPoolError as e:", + " raise ConnectionError(e, request=request)", + "", + " except _ProxyError as e:" + ], + "in_app": false + } + ] + } + } + ], + "$exception_message": "[Errno 111] Connection refused", + "$exception_type": "ConnectionRefusedError", + "$plugins_failed": [], + "$geoip_disable": true, + "$lib_version__patch": 6, + "$lib_version": "3.6.6", + "$plugins_succeeded": ["posthog-semver-flattener (12449)"], + "$exception_personURL": "https://us.i.posthog.com/project/sTMFPsFhdP1Ssg/person/python-exceptions", + "$ip": "185.140.230.43", + "$lib_version__minor": 6, + "$lib": "posthog-python", + "$lib_version__major": 3 +} diff --git a/rust/cymbal/tests/static/raw_ch_exception.json b/rust/cymbal/tests/static/raw_ch_exception.json deleted file mode 100644 index 382926b869708..0000000000000 --- a/rust/cymbal/tests/static/raw_ch_exception.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "uuid": "01925277-f069-7eb2-9236-bf86c4c3ed7d", - "event": "$exception", - "properties": "{\n \"$os\": \"Mac OS X\",\n \"$os_version\": \"10.15.7\",\n \"$browser\": \"Chrome\",\n \"$device_type\": \"Desktop\",\n \"$current_url\": \"https://us.posthog.com/project/2/feature_flags/50888\",\n \"$host\": \"us.posthog.com\",\n \"$pathname\": \"/project/2/feature_flags/50888\",\n \"$raw_user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36\",\n \"$browser_version\": 129,\n \"$browser_language\": \"en-US\",\n \"$screen_height\": 982,\n \"$screen_width\": 1512,\n \"$viewport_height\": 882,\n \"$viewport_width\": 1086,\n \"$lib\": \"web\",\n \"$lib_version\": \"1.166.0\",\n \"$insert_id\": \"xa7aywslwzwsilxn\",\n \"$time\": 1727960445.033,\n \"distinct_id\": \"UAnHBWWjwZPH8Ky85ZJ4BfYpMD45CvIVohyeJk97Wy9\",\n \"$device_id\": \"018fc4d4-4fc5-7e78-843d-f2d478a82f74\",\n \"$console_log_recording_enabled_server_side\": true,\n \"$session_recording_network_payload_capture\": {\n \"capturePerformance\": {\n \"network_timing\": true,\n \"web_vitals\": true,\n \"web_vitals_allowed_metrics\": null\n },\n \"recordBody\": true,\n \"recordHeaders\": true\n },\n \"$session_recording_canvas_recording\": {\n \"enabled\": false,\n \"fps\": null,\n \"quality\": null\n },\n \"$replay_sample_rate\": null,\n \"$replay_minimum_duration\": 2000,\n \"$initial_person_info\": {\n \"r\": \"$direct\",\n \"u\": \"https://us.posthog.com/project/84498/replay/01922131-3fc4-7c41-bc7a-fc4cd3cb5b12\"\n },\n \"$active_feature_flags\": [\n \"artificial-hog\",\n \"alerts\",\n \"hog-functions\",\n \"heatmaps-ui\",\n \"web-analytics-lcp-score\",\n \"error-tracking\"\n ],\n \"$feature/artificial-hog\": true,\n \"$feature/alerts\": true,\n \"$feature/hog-functions\": true,\n \"$feature/purchase-credits\": false,\n \"$feature/environments\": false,\n \"$feature/test-trend-juraj-1\": \"test\",\n \"$feature/onboarding-dashboard-templates\": \"control\",\n \"$feature_flag_payloads\": {\n \"changelog-notification\": \"{\\n \\\"notificationDate\\\": \\\"2024-08-26\\\", \\n \\\"markdown\\\": \\\"New this week: [React Native session replays](https://posthog.com/changelog/2024#react-native-session-replay-now-in-beta), [link Vitally to your data warehouse](https://posthog.com/changelog/2024#vitally-now-supported-as-a-warehouse-source), and [more](https://posthog.com/changelog)!\\\"\\n}\",\n \"string-payload\": \"true\",\n \"survey-test-target\": \"[1]\",\n \"product-ctas\": \"{\\\"title\\\": \\\"View pricing\\\", \\\"url\\\": \\\"pricing\\\"}\",\n \"available-plans\": \"{\\n \\\"planKeys\\\": {\\n \\\"marketing-website\\\": [\\\"123\\\", \\\"456\\\"],\\n \\\"app\\\": [\\\"789\\\", \\\"101112\\\"]\\n }\\n}\"\n },\n \"$user_id\": \"UAnHBWWjwZPH8Ky85ZJ4BfYpMD45CvIVohyeJk97Wy9\",\n \"is_demo_project\": false,\n \"$groups\": {\n \"project\": \"fc445b88-e2c4-488e-bb52-aa80cd7918c9\",\n \"organization\": \"4dc8564d-bd82-1065-2f40-97f7c50f67cf\",\n \"customer\": \"cus_IK2DWsWVn2ZM16\",\n \"instance\": \"https://us.posthog.com\"\n },\n \"realm\": \"cloud\",\n \"email_service_available\": true,\n \"slack_service_available\": true,\n \"commit_sha\": \"a71b50163b\",\n \"$autocapture_disabled_server_side\": false,\n \"$web_vitals_enabled_server_side\": true,\n \"$web_vitals_allowed_metrics\": null,\n \"$exception_capture_endpoint_suffix\": \"/e/\",\n \"$exception_capture_enabled_server_side\": true,\n \"has_billing_plan\": true,\n \"customer_deactivated\": false,\n \"current_total_amount_usd\": \"0.00\",\n \"custom_limits_usd.surveys\": 500,\n \"percentage_usage.product_analytics\": 0,\n \"current_amount_usd.product_analytics\": \"0.00\",\n \"unit_amount_usd.product_analytics\": null,\n \"usage_limit.product_analytics\": null,\n \"current_usage.product_analytics\": 13531521,\n \"projected_usage.product_analytics\": 225037109,\n \"free_allocation.product_analytics\": 0,\n \"percentage_usage.session_replay\": 0,\n \"current_amount_usd.session_replay\": \"0.00\",\n \"unit_amount_usd.session_replay\": null,\n \"usage_limit.session_replay\": null,\n \"current_usage.session_replay\": 70886,\n \"projected_usage.session_replay\": 1268192,\n \"free_allocation.session_replay\": 0,\n \"percentage_usage.feature_flags\": 0,\n \"current_amount_usd.feature_flags\": \"0.00\",\n \"unit_amount_usd.feature_flags\": null,\n \"usage_limit.feature_flags\": null,\n \"current_usage.feature_flags\": 16287759,\n \"projected_usage.feature_flags\": 461418955,\n \"free_allocation.feature_flags\": 0,\n \"percentage_usage.surveys\": 0,\n \"current_amount_usd.surveys\": \"0.00\",\n \"unit_amount_usd.surveys\": null,\n \"usage_limit.surveys\": null,\n \"current_usage.surveys\": 110,\n \"projected_usage.surveys\": 3047,\n \"free_allocation.surveys\": 0,\n \"percentage_usage.data_warehouse\": 0,\n \"current_amount_usd.data_warehouse\": \"0.00\",\n \"unit_amount_usd.data_warehouse\": null,\n \"usage_limit.data_warehouse\": null,\n \"current_usage.data_warehouse\": 109714956,\n \"projected_usage.data_warehouse\": 2121050491,\n \"free_allocation.data_warehouse\": 0,\n \"percentage_usage.integrations\": 0,\n \"current_amount_usd.integrations\": null,\n \"unit_amount_usd.integrations\": null,\n \"usage_limit.integrations\": 0,\n \"current_usage.integrations\": 0,\n \"projected_usage.integrations\": 0,\n \"free_allocation.integrations\": 0,\n \"percentage_usage.platform_and_support\": 0,\n \"current_amount_usd.platform_and_support\": null,\n \"unit_amount_usd.platform_and_support\": null,\n \"usage_limit.platform_and_support\": 0,\n \"current_usage.platform_and_support\": 0,\n \"projected_usage.platform_and_support\": 0,\n \"free_allocation.platform_and_support\": 0,\n \"billing_period_start\": {\n \"$L\": \"en\",\n \"$d\": {},\n \"$y\": 2024,\n \"$M\": 9,\n \"$D\": 2,\n \"$W\": 3,\n \"$H\": 17,\n \"$m\": 9,\n \"$s\": 56,\n \"$ms\": 0,\n \"$x\": {},\n \"$isDayjsObject\": true\n },\n \"billing_period_end\": {\n \"$L\": \"en\",\n \"$d\": {},\n \"$y\": 2024,\n \"$M\": 10,\n \"$D\": 2,\n \"$W\": 6,\n \"$H\": 16,\n \"$m\": 9,\n \"$s\": 56,\n \"$ms\": 0,\n \"$x\": {},\n \"$isDayjsObject\": true\n },\n \"$surveys_activated\": [\"0190fe51-92a0-0000-4ba3-f85f5f0ef78f\"],\n \"custom_limits_usd.data_warehouse\": 0,\n \"custom_limits_usd.feature_flags\": 0,\n \"custom_limits_usd.session_replay\": 0,\n \"custom_limits_usd.product_analytics\": 0,\n \"$referrer\": \"https://us.posthog.com/project/2/error_tracking\",\n \"$referring_domain\": \"us.posthog.com\",\n \"$exception_type\": \"Error\",\n \"$exception_message\": \"Unexpected usage\\n\\nError: Unexpected usage\\n at n.loadForeignModule (https://app-static-prod.posthog.com/static/chunk-PGUQKT6S.js:64:15003)\\n at https://app-static-prod.posthog.com/static/chunk-PGUQKT6S.js:64:25112\",\n \"$exception_stack_trace_raw\": \"[{\\\"filename\\\":\\\"https://app-static-prod.posthog.com/static/chunk-3LWGKVZR.js\\\",\\\"function\\\":\\\"r\\\",\\\"in_app\\\":true,\\\"lineno\\\":19,\\\"colno\\\":2044},{\\\"filename\\\":\\\"https://app-static-prod.posthog.com/static/chunk-PGUQKT6S.js\\\",\\\"function\\\":\\\"?\\\",\\\"in_app\\\":true,\\\"lineno\\\":3,\\\"colno\\\":12},{\\\"filename\\\":\\\"https://app-static-prod.posthog.com/static/chunk-PGUQKT6S.js\\\",\\\"function\\\":\\\"?\\\",\\\"in_app\\\":true,\\\"lineno\\\":64,\\\"colno\\\":25112},{\\\"filename\\\":\\\"https://app-static-prod.posthog.com/static/chunk-PGUQKT6S.js\\\",\\\"function\\\":\\\"n.loadForeignModule\\\",\\\"in_app\\\":true,\\\"lineno\\\":64,\\\"colno\\\":15003}]\",\n \"$exception_level\": \"error\",\n \"$exception_source\": \"https://app-static-prod.posthog.com/static/chunk-3LWGKVZR.js\",\n \"$exception_lineno\": 19,\n \"$exception_colno\": 2067,\n \"$exception_personURL\": \"https://us.posthog.com/project/sTMFPsFhdP1Ssg/person/UAnHBWWjwZPH8Ky85ZJ4BfYpMD45CvIVohyeJk97Wy9\",\n \"token\": \"sYTIHGHJKJHGFHJG\",\n \"$session_id\": \"01925255-fc87-771a-8aef-607444f71b4c\",\n \"$window_id\": \"01925273-b871-75c4-bd8f-54a978ead4f9\",\n \"$lib_custom_api_host\": \"https://internal-t.posthog.com\",\n \"$is_identified\": true,\n \"$lib_rate_limit_remaining_tokens\": 98.02,\n \"$set_once\": {\n \"$initial_os\": \"Mac OS X\",\n \"$initial_os_version\": \"10.15.7\",\n \"$initial_browser\": \"Chrome\",\n \"$initial_device_type\": \"Desktop\",\n \"$initial_current_url\": \"https://us.posthog.com/project/84498/replay/01922131-3fc4-7c41-bc7a-fc4cd3cb5b12\",\n \"$initial_pathname\": \"/project/84498/replay/01922131-3fc4-7c41-bc7a-fc4cd3cb5b12\",\n \"$initial_browser_version\": 129,\n \"$initial_referrer\": \"$direct\",\n \"$initial_referring_domain\": \"$direct\",\n \"$initial_geoip_city_name\": \"London\",\n \"$initial_geoip_city_confidence\": null,\n \"$initial_geoip_subdivision_2_name\": null,\n \"$initial_geoip_subdivision_2_code\": null,\n \"$initial_geoip_subdivision_2_confidence\": null,\n \"$initial_geoip_subdivision_1_name\": \"England\",\n \"$initial_geoip_subdivision_1_code\": \"ENG\",\n \"$initial_geoip_subdivision_1_confidence\": null,\n \"$initial_geoip_country_name\": \"United Kingdom\",\n \"$initial_geoip_country_code\": \"GB\",\n \"$initial_geoip_country_confidence\": null,\n \"$initial_geoip_continent_name\": \"Europe\",\n \"$initial_geoip_continent_code\": \"EU\",\n \"$initial_geoip_postal_code\": \"EC4R\",\n \"$initial_geoip_postal_code_confidence\": null,\n \"$initial_geoip_latitude\": 51.5088,\n \"$initial_geoip_longitude\": -0.093,\n \"$initial_geoip_accuracy_radius\": 20,\n \"$initial_geoip_time_zone\": \"Europe/London\",\n \"$initial_host\": \"us.posthog.com\"\n },\n \"$ip\": \"62.23.207.10\",\n \"$set\": {\n \"$os\": \"Mac OS X\",\n \"$os_version\": \"10.15.7\",\n \"$browser\": \"Chrome\",\n \"$device_type\": \"Desktop\",\n \"$current_url\": \"https://us.posthog.com/project/2/feature_flags/50888\",\n \"$pathname\": \"/project/2/feature_flags/50888\",\n \"$browser_version\": 129,\n \"$referrer\": \"https://us.posthog.com/project/2/error_tracking\",\n \"$referring_domain\": \"us.posthog.com\",\n \"$geoip_city_name\": \"London\",\n \"$geoip_city_confidence\": null,\n \"$geoip_subdivision_2_name\": null,\n \"$geoip_subdivision_2_code\": null,\n \"$geoip_subdivision_2_confidence\": null,\n \"$geoip_subdivision_1_name\": \"England\",\n \"$geoip_subdivision_1_code\": \"ENG\",\n \"$geoip_subdivision_1_confidence\": null,\n \"$geoip_country_name\": \"United Kingdom\",\n \"$geoip_country_code\": \"GB\",\n \"$geoip_country_confidence\": null,\n \"$geoip_continent_name\": \"Europe\",\n \"$geoip_continent_code\": \"EU\",\n \"$geoip_postal_code\": \"EC4R\",\n \"$geoip_postal_code_confidence\": null,\n \"$geoip_latitude\": 51.5088,\n \"$geoip_longitude\": -0.093,\n \"$geoip_accuracy_radius\": 20,\n \"$geoip_time_zone\": \"Europe/London\"\n },\n \"$sent_at\": \"2024-10-03T13:00:45.158000+00:00\",\n \"$geoip_city_name\": \"London\",\n \"$geoip_city_confidence\": null,\n \"$geoip_country_name\": \"United Kingdom\",\n \"$geoip_country_code\": \"GB\",\n \"$geoip_country_confidence\": null,\n \"$geoip_continent_name\": \"Europe\",\n \"$geoip_continent_code\": \"EU\",\n \"$geoip_postal_code\": \"EC4R\",\n \"$geoip_postal_code_confidence\": null,\n \"$geoip_latitude\": 51.5088,\n \"$geoip_longitude\": -0.093,\n \"$geoip_accuracy_radius\": 20,\n \"$geoip_time_zone\": \"Europe/London\",\n \"$geoip_subdivision_1_code\": \"ENG\",\n \"$geoip_subdivision_1_name\": \"England\",\n \"$geoip_subdivision_1_confidence\": null,\n \"$lib_version__major\": 1,\n \"$lib_version__minor\": 166,\n \"$lib_version__patch\": 0,\n \"$group_2\": \"fc445b88-e2c4-488e-bb52-aa80cd7918c9\",\n \"$group_0\": \"4dc8564d-bd82-1065-2f40-97f7c50f67cf\",\n \"$group_3\": \"cus_IK2DWsWVn2ZM16\",\n \"$group_1\": \"https://us.posthog.com\",\n \"$exception_fingerprint\": [\n \"Error\",\n \"Unexpected usage\\n\\nError: Unexpected usage\\n at n.loadForeignModule (https://app-static-prod.posthog.com/static/chunk-PGUQKT6S.js:64:15003)\\n at https://app-static-prod.posthog.com/static/chunk-PGUQKT6S.js:64:25112\",\n \"r\"\n ]\n }", - "timestamp": "2024-10-03T06:00:45.069000-07:00", - "team_id": 2, - "project_id": 2, - "distinct_id": "UAnHBWWjwZPH8Ky85ZJ4BfYpMD45CvIVohyeJk97Wy9", - "elements_chain": "", - "created_at": "2024-10-03T06:01:25.266000-07:00", - "person_mode": "full" -} diff --git a/rust/cymbal/tests/static/raw_ch_exception_list.json b/rust/cymbal/tests/static/raw_ch_exception_list.json index 78b961dfdbcf7..bc84058e5d461 100644 --- a/rust/cymbal/tests/static/raw_ch_exception_list.json +++ b/rust/cymbal/tests/static/raw_ch_exception_list.json @@ -1,7 +1,7 @@ { "uuid": "019295b1-519f-71a6-aacf-c97b5db73696", "event": "$exception", - "properties": "{\"$os\":\"Mac OS X\",\"$os_version\":\"10.15.7\",\"$browser\":\"Chrome\",\"$device_type\":\"Desktop\",\"$current_url\":\"https://eu.posthog.com/project/12557/feature_flags/31624\",\"$host\":\"eu.posthog.com\",\"$pathname\":\"/project/12557/feature_flags/31624\",\"$raw_user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36\",\"$browser_version\":129,\"$browser_language\":\"en-GB\",\"$screen_height\":1080,\"$screen_width\":1920,\"$viewport_height\":934,\"$viewport_width\":1920,\"$lib\":\"web\",\"$lib_version\":\"1.170.1\",\"$insert_id\":\"xjfjg606eo2x7n4x\",\"$time\":1729088278.943,\"distinct_id\":\"pQC9X9Fe7BPzJXVxpY0fx37UwFOCd1vXHzh8rjUPv1G\",\"$device_id\":\"018ccedb-d598-79bb-94e0-4751a3b956f4\",\"$console_log_recording_enabled_server_side\":true,\"$autocapture_disabled_server_side\":false,\"$web_vitals_enabled_server_side\":true,\"$exception_capture_enabled_server_side\":true,\"$exception_capture_endpoint\":\"/e/\",\"realm\":\"cloud\",\"email_service_available\":true,\"slack_service_available\":true,\"commit_sha\":\"bafa32953e\",\"$user_id\":\"pQC9X9Fe7BPzJXVxpY0fx37UwFOCd1vXHzh8rjUPv1G\",\"is_demo_project\":false,\"$groups\":{\"project\":\"018c1057-288d-0000-93bb-3bd44c845f22\",\"organization\":\"018afaa6-8b2e-0000-2311-d58d2df832ad\",\"customer\":\"cus_P5B9QmoUKLAUlx\",\"instance\":\"https://eu.posthog.com\"},\"has_billing_plan\":true,\"$referrer\":\"$direct\",\"$referring_domain\":\"$direct\",\"$session_recording_start_reason\":\"session_id_changed\",\"$exception_list\":[{\"type\":\"UnhandledRejection\",\"value\":\"Unexpected usage\",\"stacktrace\":{\"type\": \"raw\", \"frames\":[{\"filename\":\"https://app-static.eu.posthog.com/static/chunk-PGUQKT6S.js\",\"function\":\"?\",\"in_app\":true,\"lineno\":64,\"colno\":25112},{\"filename\":\"https://app-static.eu.posthog.com/static/chunk-PGUQKT6S.js\",\"function\":\"n.loadForeignModule\",\"in_app\":true,\"lineno\":64,\"colno\":15003}]},\"mechanism\":{\"handled\":false,\"synthetic\":false}}],\"$exception_level\":\"error\",\"$exception_personURL\":\"https://us.posthog.com/project/sTMFPsFhdP1Ssg/person/pQC9X9Fe7BPzJXVxpY0fx37UwFOCd1vXHzh8rjUPv1G\",\"token\":\"sTMFPsFhdP1Ssg\",\"$session_id\":\"019295b0-db2b-7e02-8010-0a1c4db680df\",\"$window_id\":\"019295b0-db2b-7e02-8010-0a1dee88e5f5\",\"$lib_custom_api_host\":\"https://internal-t.posthog.com\",\"$is_identified\":true,\"$lib_rate_limit_remaining_tokens\":97.28999999999999,\"$sent_at\":\"2024-10-16T14:17:59.543000+00:00\",\"$geoip_city_name\":\"Lisbon\",\"$geoip_city_confidence\":null,\"$geoip_country_name\":\"Portugal\",\"$geoip_country_code\":\"PT\",\"$geoip_country_confidence\":null,\"$geoip_continent_name\":\"Europe\",\"$geoip_continent_code\":\"EU\",\"$geoip_postal_code\":\"1269-001\",\"$geoip_postal_code_confidence\":null,\"$geoip_latitude\":38.731,\"$geoip_longitude\":-9.1373,\"$geoip_accuracy_radius\":100,\"$geoip_time_zone\":\"Europe/Lisbon\",\"$geoip_subdivision_1_code\":\"11\",\"$geoip_subdivision_1_name\":\"Lisbon\",\"$geoip_subdivision_1_confidence\":null,\"$lib_version__major\":1,\"$lib_version__minor\":170,\"$lib_version__patch\":1,\"$group_2\":\"018c1057-288d-0000-93bb-3bd44c845f22\",\"$group_0\":\"018afaa6-8b2e-0000-2311-d58d2df832ad\",\"$group_3\":\"cus_P5B9QmoUKLAUlx\",\"$group_1\":\"https://eu.posthog.com\"}", + "properties": "{\"$os\": \"Mac OS X\", \"$os_version\": \"10.15.7\", \"$browser\": \"Chrome\", \"$device_type\": \"Desktop\", \"$current_url\": \"https://eu.posthog.com/project/12557/feature_flags/31624\", \"$host\": \"eu.posthog.com\", \"$pathname\": \"/project/12557/feature_flags/31624\", \"$raw_user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36\", \"$browser_version\": 129, \"$browser_language\": \"en-GB\", \"$screen_height\": 1080, \"$screen_width\": 1920, \"$viewport_height\": 934, \"$viewport_width\": 1920, \"$lib\": \"web\", \"$lib_version\": \"1.170.1\", \"$insert_id\": \"xjfjg606eo2x7n4x\", \"$time\": 1729088278.943, \"distinct_id\": \"pQC9X9Fe7BPzJXVxpY0fx37UwFOCd1vXHzh8rjUPv1G\", \"$device_id\": \"018ccedb-d598-79bb-94e0-4751a3b956f4\", \"$console_log_recording_enabled_server_side\": true, \"$autocapture_disabled_server_side\": false, \"$web_vitals_enabled_server_side\": true, \"$exception_capture_enabled_server_side\": true, \"$exception_capture_endpoint\": \"/e/\", \"realm\": \"cloud\", \"email_service_available\": true, \"slack_service_available\": true, \"commit_sha\": \"bafa32953e\", \"$user_id\": \"pQC9X9Fe7BPzJXVxpY0fx37UwFOCd1vXHzh8rjUPv1G\", \"is_demo_project\": false, \"$groups\": {\"project\": \"018c1057-288d-0000-93bb-3bd44c845f22\", \"organization\": \"018afaa6-8b2e-0000-2311-d58d2df832ad\", \"customer\": \"cus_P5B9QmoUKLAUlx\", \"instance\": \"https://eu.posthog.com\"}, \"has_billing_plan\": true, \"$referrer\": \"$direct\", \"$referring_domain\": \"$direct\", \"$session_recording_start_reason\": \"session_id_changed\", \"$exception_list\": [{\"type\": \"UnhandledRejection\", \"value\": \"Unexpected usage\", \"stacktrace\": {\"type\": \"raw\", \"frames\": [{\"filename\": \"https://app-static.eu.posthog.com/static/chunk-PGUQKT6S.js\", \"function\": \"?\", \"in_app\": true, \"lineno\": 64, \"colno\": 25112, \"platform\": \"web:javascript\"}, {\"filename\": \"https://app-static.eu.posthog.com/static/chunk-PGUQKT6S.js\", \"function\": \"n.loadForeignModule\", \"in_app\": true, \"lineno\": 64, \"colno\": 15003, \"platform\": \"web:javascript\"}]}, \"mechanism\": {\"handled\": false, \"synthetic\": false}}], \"$exception_level\": \"error\", \"$exception_personURL\": \"https://us.posthog.com/project/sTMFPsFhdP1Ssg/person/pQC9X9Fe7BPzJXVxpY0fx37UwFOCd1vXHzh8rjUPv1G\", \"token\": \"sTMFPsFhdP1Ssg\", \"$session_id\": \"019295b0-db2b-7e02-8010-0a1c4db680df\", \"$window_id\": \"019295b0-db2b-7e02-8010-0a1dee88e5f5\", \"$lib_custom_api_host\": \"https://internal-t.posthog.com\", \"$is_identified\": true, \"$lib_rate_limit_remaining_tokens\": 97.28999999999999, \"$sent_at\": \"2024-10-16T14:17:59.543000+00:00\", \"$geoip_city_name\": \"Lisbon\", \"$geoip_city_confidence\": null, \"$geoip_country_name\": \"Portugal\", \"$geoip_country_code\": \"PT\", \"$geoip_country_confidence\": null, \"$geoip_continent_name\": \"Europe\", \"$geoip_continent_code\": \"EU\", \"$geoip_postal_code\": \"1269-001\", \"$geoip_postal_code_confidence\": null, \"$geoip_latitude\": 38.731, \"$geoip_longitude\": -9.1373, \"$geoip_accuracy_radius\": 100, \"$geoip_time_zone\": \"Europe/Lisbon\", \"$geoip_subdivision_1_code\": \"11\", \"$geoip_subdivision_1_name\": \"Lisbon\", \"$geoip_subdivision_1_confidence\": null, \"$lib_version__major\": 1, \"$lib_version__minor\": 170, \"$lib_version__patch\": 1, \"$group_2\": \"018c1057-288d-0000-93bb-3bd44c845f22\", \"$group_0\": \"018afaa6-8b2e-0000-2311-d58d2df832ad\", \"$group_3\": \"cus_P5B9QmoUKLAUlx\", \"$group_1\": \"https://eu.posthog.com\"}", "timestamp": "2024-10-16T07:17:59.088000-07:00", "team_id": 2, "project_id": 2, @@ -9,4 +9,4 @@ "elements_chain": "", "created_at": "2024-10-16T07:18:00.100000-07:00", "person_mode": "full" -} +} \ No newline at end of file diff --git a/rust/cymbal/tests/test_migrations/20241101134611_test_migration_for_symbol_set_saving_tests.sql b/rust/cymbal/tests/test_migrations/20241101134611_test_migration_for_symbol_set_saving_tests.sql index 88029256999b0..fc3da5157f003 100644 --- a/rust/cymbal/tests/test_migrations/20241101134611_test_migration_for_symbol_set_saving_tests.sql +++ b/rust/cymbal/tests/test_migrations/20241101134611_test_migration_for_symbol_set_saving_tests.sql @@ -5,6 +5,7 @@ CREATE TABLE posthog_errortrackingsymbolset ( created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), storage_ptr TEXT, failure_reason TEXT, + content_hash TEXT, CONSTRAINT unique_ref_per_team UNIQUE (team_id, ref) ); @@ -19,7 +20,7 @@ CREATE TABLE IF NOT EXISTS posthog_errortrackingstackframe ( symbol_set_id UUID, contents JSONB NOT NULL, resolved BOOLEAN NOT NULL, - context TEXT, + context JSONB, UNIQUE(raw_id, team_id) ); diff --git a/rust/cymbal/tests/types.rs b/rust/cymbal/tests/types.rs index 0404398a2b66b..a320b7a08f5e1 100644 --- a/rust/cymbal/tests/types.rs +++ b/rust/cymbal/tests/types.rs @@ -1,7 +1,10 @@ use std::str::FromStr; use common_types::ClickHouseEvent; -use cymbal::types::RawErrProps; +use cymbal::{ + frames::{Frame, RawFrame}, + types::{RawErrProps, Stacktrace}, +}; use serde_json::Value; #[test] @@ -24,3 +27,30 @@ fn serde_passthrough() { assert_eq!(before, after) } + +#[test] +fn python_exceptions() { + let props: RawErrProps = + serde_json::from_str(include_str!("./static/python_err_props.json")).unwrap(); + + let frames = props + .exception_list + .into_iter() + .map(|e| e.stack.unwrap()) + .flat_map(|t| { + let Stacktrace::Raw { frames } = t else { + panic!("Expected a Raw stacktrace") + }; + frames + }) + .map(|f| { + let RawFrame::Python(f) = f else { + panic!("Expected a Python frame") + }; + let f: Frame = (&f).into(); + f + }) + .collect::>(); + + assert_eq!(frames.len(), 31); +} diff --git a/rust/feature-flags/Cargo.toml b/rust/feature-flags/Cargo.toml index 4099fd8ab06fd..536c85e836a7a 100644 --- a/rust/feature-flags/Cargo.toml +++ b/rust/feature-flags/Cargo.toml @@ -40,7 +40,7 @@ common-metrics = { path = "../common/metrics" } tower = { workspace = true } derive_builder = "0.20.1" petgraph = "0.6.5" -moka = { version = "0.12.8", features = ["future"] } +moka = { workspace = true } [lints] workspace = true diff --git a/rust/feature-flags/src/api/handler.rs b/rust/feature-flags/src/api/handler.rs index 26c7527678526..0fdade8d95128 100644 --- a/rust/feature-flags/src/api/handler.rs +++ b/rust/feature-flags/src/api/handler.rs @@ -69,8 +69,8 @@ pub struct FeatureFlagEvaluationContext { team_id: i32, distinct_id: String, feature_flags: FeatureFlagList, - postgres_reader: Arc, - postgres_writer: Arc, + reader: Arc, + writer: Arc, cohort_cache: Arc, #[builder(default)] person_property_overrides: Option>, @@ -93,10 +93,10 @@ pub async fn process_request(context: RequestContext) -> Result Result Result FlagsResponse { let group_type_mapping_cache = - GroupTypeMappingCache::new(context.team_id, context.postgres_reader.clone()); + GroupTypeMappingCache::new(context.team_id, context.reader.clone()); let mut feature_flag_matcher = FeatureFlagMatcher::new( context.distinct_id, context.team_id, - context.postgres_reader, - context.postgres_writer, + context.reader, + context.writer, context.cohort_cache, Some(group_type_mapping_cache), context.groups, @@ -362,9 +362,9 @@ mod tests { #[tokio::test] async fn test_evaluate_feature_flags() { - let postgres_reader: Arc = setup_pg_reader_client(None).await; - let postgres_writer: Arc = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); + let reader: Arc = setup_pg_reader_client(None).await; + let writer: Arc = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); let flag = FeatureFlag { name: Some("Test Flag".to_string()), id: 1, @@ -402,8 +402,8 @@ mod tests { .team_id(1) .distinct_id("user123".to_string()) .feature_flags(feature_flag_list) - .postgres_reader(postgres_reader) - .postgres_writer(postgres_writer) + .reader(reader) + .writer(writer) .cohort_cache(cohort_cache) .person_property_overrides(Some(person_properties)) .build() @@ -511,9 +511,9 @@ mod tests { #[tokio::test] async fn test_evaluate_feature_flags_multiple_flags() { - let postgres_reader: Arc = setup_pg_reader_client(None).await; - let postgres_writer: Arc = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); + let reader: Arc = setup_pg_reader_client(None).await; + let writer: Arc = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); let flags = vec![ FeatureFlag { name: Some("Flag 1".to_string()), @@ -563,8 +563,8 @@ mod tests { .team_id(1) .distinct_id("user123".to_string()) .feature_flags(feature_flag_list) - .postgres_reader(postgres_reader) - .postgres_writer(postgres_writer) + .reader(reader) + .writer(writer) .cohort_cache(cohort_cache) .build() .expect("Failed to build FeatureFlagEvaluationContext"); @@ -616,12 +616,10 @@ mod tests { #[tokio::test] async fn test_evaluate_feature_flags_with_overrides() { - let postgres_reader: Arc = setup_pg_reader_client(None).await; - let postgres_writer: Arc = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader: Arc = setup_pg_reader_client(None).await; + let writer: Arc = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); let flag = FeatureFlag { name: Some("Test Flag".to_string()), @@ -665,8 +663,8 @@ mod tests { .team_id(team.id) .distinct_id("user123".to_string()) .feature_flags(feature_flag_list) - .postgres_reader(postgres_reader) - .postgres_writer(postgres_writer) + .reader(reader) + .writer(writer) .cohort_cache(cohort_cache) .group_property_overrides(Some(group_property_overrides)) .groups(Some(groups)) @@ -699,9 +697,9 @@ mod tests { #[tokio::test] async fn test_long_distinct_id() { let long_id = "a".repeat(1000); - let postgres_reader: Arc = setup_pg_reader_client(None).await; - let postgres_writer: Arc = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); + let reader: Arc = setup_pg_reader_client(None).await; + let writer: Arc = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); let flag = FeatureFlag { name: Some("Test Flag".to_string()), id: 1, @@ -729,8 +727,8 @@ mod tests { .team_id(1) .distinct_id(long_id) .feature_flags(feature_flag_list) - .postgres_reader(postgres_reader) - .postgres_writer(postgres_writer) + .reader(reader) + .writer(writer) .cohort_cache(cohort_cache) .build() .expect("Failed to build FeatureFlagEvaluationContext"); diff --git a/rust/feature-flags/src/cohort/cohort_cache_manager.rs b/rust/feature-flags/src/cohort/cohort_cache_manager.rs index 549553565930c..c545321fe2542 100644 --- a/rust/feature-flags/src/cohort/cohort_cache_manager.rs +++ b/rust/feature-flags/src/cohort/cohort_cache_manager.rs @@ -1,8 +1,14 @@ use crate::api::errors::FlagError; use crate::cohort::cohort_models::Cohort; use crate::flags::flag_matching::{PostgresReader, TeamId}; +use crate::metrics::metrics_consts::{ + COHORT_CACHE_HIT_COUNTER, COHORT_CACHE_MISS_COUNTER, DB_COHORT_ERRORS_COUNTER, + DB_COHORT_READS_COUNTER, +}; use moka::future::Cache; +use std::sync::Arc; use std::time::Duration; +use tokio::sync::Mutex; /// CohortCacheManager manages the in-memory cache of cohorts using `moka` for caching. /// @@ -12,8 +18,8 @@ use std::time::Duration; /// /// ```text /// CohortCacheManager { -/// postgres_reader: PostgresReader, -/// per_team_cohorts: Cache> { +/// reader: PostgresReader, +/// cache: Cache> { /// // Example: /// 2: [ /// Cohort { id: 1, name: "Power Users", filters: {...} }, @@ -22,35 +28,37 @@ use std::time::Duration; /// 5: [ /// Cohort { id: 3, name: "Beta Users", filters: {...} } /// ] -/// } +/// }, +/// fetch_lock: Mutex<()> // Manager-wide lock /// } /// ``` /// #[derive(Clone)] pub struct CohortCacheManager { - postgres_reader: PostgresReader, - per_team_cohort_cache: Cache>, + reader: PostgresReader, + cache: Cache>, + fetch_lock: Arc>, // Added fetch_lock } impl CohortCacheManager { pub fn new( - postgres_reader: PostgresReader, + reader: PostgresReader, max_capacity: Option, ttl_seconds: Option, ) -> Self { - // We use the size of the cohort list (i.e., the number of cohorts for a given team)as the weight of the entry - let weigher = - |_: &TeamId, value: &Vec| -> u32 { value.len().try_into().unwrap_or(u32::MAX) }; + // We use the size of the cohort list (i.e., the number of cohorts for a given team) as the weight of the entry + let weigher = |_: &TeamId, value: &Vec| -> u32 { value.len() as u32 }; let cache = Cache::builder() .time_to_live(Duration::from_secs(ttl_seconds.unwrap_or(300))) // Default to 5 minutes .weigher(weigher) - .max_capacity(max_capacity.unwrap_or(10_000)) // Default to 10,000 cohorts + .max_capacity(max_capacity.unwrap_or(100_000)) // Default to 100,000 cohorts .build(); Self { - postgres_reader, - per_team_cohort_cache: cache, + reader, + cache, + fetch_lock: Arc::new(Mutex::new(())), // Initialize the lock } } @@ -58,16 +66,57 @@ impl CohortCacheManager { /// /// If the cohorts are not present in the cache or have expired, it fetches them from the database, /// caches the result upon successful retrieval, and then returns it. - pub async fn get_cohorts_for_team(&self, team_id: TeamId) -> Result, FlagError> { - if let Some(cached_cohorts) = self.per_team_cohort_cache.get(&team_id).await { + pub async fn get_cohorts(&self, team_id: TeamId) -> Result, FlagError> { + // First check cache before acquiring lock + if let Some(cached_cohorts) = self.cache.get(&team_id).await { + common_metrics::inc( + COHORT_CACHE_HIT_COUNTER, + &[("team_id".to_string(), team_id.to_string())], + 1, + ); return Ok(cached_cohorts.clone()); } - let fetched_cohorts = Cohort::list_from_pg(self.postgres_reader.clone(), team_id).await?; - self.per_team_cohort_cache - .insert(team_id, fetched_cohorts.clone()) - .await; - Ok(fetched_cohorts) + // Acquire the lock before fetching + let _lock = self.fetch_lock.lock().await; + + // Double-check the cache after acquiring lock + if let Some(cached_cohorts) = self.cache.get(&team_id).await { + common_metrics::inc( + COHORT_CACHE_HIT_COUNTER, + &[("team_id".to_string(), team_id.to_string())], + 1, + ); + return Ok(cached_cohorts.clone()); + } + + // If we get here, we have a cache miss + common_metrics::inc( + COHORT_CACHE_MISS_COUNTER, + &[("team_id".to_string(), team_id.to_string())], + 1, + ); + + // Attempt to fetch from DB + match Cohort::list_from_pg(self.reader.clone(), team_id).await { + Ok(fetched_cohorts) => { + common_metrics::inc( + DB_COHORT_READS_COUNTER, + &[("team_id".to_string(), team_id.to_string())], + 1, + ); + self.cache.insert(team_id, fetched_cohorts.clone()).await; + Ok(fetched_cohorts) + } + Err(e) => { + common_metrics::inc( + DB_COHORT_ERRORS_COUNTER, + &[("team_id".to_string(), team_id.to_string())], + 1, + ); + Err(e) + } + } } } @@ -116,18 +165,18 @@ mod tests { Some(1), // 1-second TTL ); - let cohorts = cohort_cache.get_cohorts_for_team(team_id).await?; + let cohorts = cohort_cache.get_cohorts(team_id).await?; assert_eq!(cohorts.len(), 1); assert_eq!(cohorts[0].team_id, team_id); - let cached_cohorts = cohort_cache.per_team_cohort_cache.get(&team_id).await; + let cached_cohorts = cohort_cache.cache.get(&team_id).await; assert!(cached_cohorts.is_some()); // Wait for TTL to expire sleep(Duration::from_secs(2)).await; // Attempt to retrieve from cache again - let cached_cohorts = cohort_cache.per_team_cohort_cache.get(&team_id).await; + let cached_cohorts = cohort_cache.cache.get(&team_id).await; assert!(cached_cohorts.is_none(), "Cache entry should have expired"); Ok(()) @@ -152,11 +201,11 @@ mod tests { let team_id = team.id; inserted_team_ids.push(team_id); setup_test_cohort(writer_client.clone(), team_id, None).await?; - cohort_cache.get_cohorts_for_team(team_id).await?; + cohort_cache.get_cohorts(team_id).await?; } - cohort_cache.per_team_cohort_cache.run_pending_tasks().await; - let cache_size = cohort_cache.per_team_cohort_cache.entry_count(); + cohort_cache.cache.run_pending_tasks().await; + let cache_size = cohort_cache.cache.entry_count(); assert_eq!( cache_size, max_capacity, "Cache size should be equal to max_capacity" @@ -165,26 +214,23 @@ mod tests { let new_team = insert_new_team_in_pg(writer_client.clone(), None).await?; let new_team_id = new_team.id; setup_test_cohort(writer_client.clone(), new_team_id, None).await?; - cohort_cache.get_cohorts_for_team(new_team_id).await?; + cohort_cache.get_cohorts(new_team_id).await?; - cohort_cache.per_team_cohort_cache.run_pending_tasks().await; - let cache_size_after = cohort_cache.per_team_cohort_cache.entry_count(); + cohort_cache.cache.run_pending_tasks().await; + let cache_size_after = cohort_cache.cache.entry_count(); assert_eq!( cache_size_after, max_capacity, "Cache size should remain equal to max_capacity after eviction" ); let evicted_team_id = &inserted_team_ids[0]; - let cached_cohorts = cohort_cache - .per_team_cohort_cache - .get(evicted_team_id) - .await; + let cached_cohorts = cohort_cache.cache.get(evicted_team_id).await; assert!( cached_cohorts.is_none(), "Least recently used cache entry should have been evicted" ); - let cached_new_team = cohort_cache.per_team_cohort_cache.get(&new_team_id).await; + let cached_new_team = cohort_cache.cache.get(&new_team_id).await; assert!( cached_new_team.is_some(), "Newly added cache entry should be present" @@ -194,25 +240,21 @@ mod tests { } #[tokio::test] - async fn test_get_cohorts_for_team() -> Result<(), anyhow::Error> { + async fn test_get_cohorts() -> Result<(), anyhow::Error> { let writer_client = setup_pg_writer_client(None).await; let reader_client = setup_pg_reader_client(None).await; let team_id = setup_test_team(writer_client.clone()).await?; let _cohort = setup_test_cohort(writer_client.clone(), team_id, None).await?; let cohort_cache = CohortCacheManager::new(reader_client.clone(), None, None); - let cached_cohorts = cohort_cache.per_team_cohort_cache.get(&team_id).await; + let cached_cohorts = cohort_cache.cache.get(&team_id).await; assert!(cached_cohorts.is_none(), "Cache should initially be empty"); - let cohorts = cohort_cache.get_cohorts_for_team(team_id).await?; + let cohorts = cohort_cache.get_cohorts(team_id).await?; assert_eq!(cohorts.len(), 1); assert_eq!(cohorts[0].team_id, team_id); - let cached_cohorts = cohort_cache - .per_team_cohort_cache - .get(&team_id) - .await - .unwrap(); + let cached_cohorts = cohort_cache.cache.get(&team_id).await.unwrap(); assert_eq!(cached_cohorts.len(), 1); assert_eq!(cached_cohorts[0].team_id, team_id); diff --git a/rust/feature-flags/src/cohort/cohort_operations.rs b/rust/feature-flags/src/cohort/cohort_operations.rs index b987ae3e225ba..60afc7ca30f1c 100644 --- a/rust/feature-flags/src/cohort/cohort_operations.rs +++ b/rust/feature-flags/src/cohort/cohort_operations.rs @@ -9,39 +9,6 @@ use crate::{ }; impl Cohort { - /// Returns a cohort from postgres given a cohort_id and team_id - #[instrument(skip_all)] - pub async fn from_pg( - client: Arc, - cohort_id: i32, - team_id: i32, - ) -> Result { - let mut conn = client.get_connection().await.map_err(|e| { - tracing::error!("Failed to get database connection: {}", e); - // TODO should I model my errors more generally? Like, yes, everything behind this API is technically a FlagError, - // but I'm not sure if accessing Cohort definitions should be a FlagError (vs idk, a CohortError? A more general API error?) - FlagError::DatabaseUnavailable - })?; - - let query = "SELECT id, name, description, team_id, deleted, filters, query, version, pending_version, count, is_calculating, is_static, errors_calculating, groups, created_by_id FROM posthog_cohort WHERE id = $1 AND team_id = $2"; - let cohort = sqlx::query_as::<_, Cohort>(query) - .bind(cohort_id) - .bind(team_id) - .fetch_optional(&mut *conn) - .await - .map_err(|e| { - tracing::error!("Failed to fetch cohort from database: {}", e); - FlagError::Internal(format!("Database query error: {}", e)) - })?; - - cohort.ok_or_else(|| { - FlagError::CohortNotFound(format!( - "Cohort with id {} not found for team {}", - cohort_id, team_id - )) - }) - } - /// Returns all cohorts for a given team #[instrument(skip_all)] pub async fn list_from_pg( @@ -76,12 +43,10 @@ impl Cohort { tracing::error!("Failed to parse filters for cohort {}: {}", self.id, e); FlagError::CohortFiltersParsingError })?; - Ok(cohort_property - .properties - .to_property_filters() - .into_iter() - .filter(|f| !(f.key == "id" && f.prop_type == "cohort")) - .collect()) + + let mut props = cohort_property.properties.to_inner(); + props.retain(|f| !(f.key == "id" && f.prop_type == "cohort")); + Ok(props) } /// Extracts dependent CohortIds from the cohort's filters @@ -175,11 +140,10 @@ impl InnerCohortProperty { /// ] /// } /// ``` - pub fn to_property_filters(&self) -> Vec { + pub fn to_inner(self) -> Vec { self.values - .iter() - .flat_map(|value| &value.values) - .cloned() + .into_iter() + .flat_map(|value| value.values) .collect() } } @@ -196,46 +160,18 @@ mod tests { }; use serde_json::json; - #[tokio::test] - async fn test_cohort_from_pg() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .expect("Failed to insert team"); - - let cohort = insert_cohort_for_team_in_pg( - postgres_writer.clone(), - team.id, - None, - json!({"properties": {"type": "OR", "values": [{"type": "OR", "values": [{"key": "$initial_browser_version", "type": "person", "value": ["125"], "negation": false, "operator": "exact"}]}]}}), - false, - ) - .await - .expect("Failed to insert cohort"); - - let fetched_cohort = Cohort::from_pg(postgres_reader, cohort.id, team.id) - .await - .expect("Failed to fetch cohort"); - - assert_eq!(fetched_cohort.id, cohort.id); - assert_eq!(fetched_cohort.name, "Test Cohort"); - assert_eq!(fetched_cohort.team_id, team.id); - } - #[tokio::test] async fn test_list_from_pg() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; - let team = insert_new_team_in_pg(postgres_reader.clone(), None) + let team = insert_new_team_in_pg(reader.clone(), None) .await .expect("Failed to insert team"); // Insert multiple cohorts for the team insert_cohort_for_team_in_pg( - postgres_writer.clone(), + writer.clone(), team.id, Some("Cohort 1".to_string()), json!({"properties": {"type": "AND", "values": [{"type": "property", "values": [{"key": "age", "type": "person", "value": [30], "negation": false, "operator": "gt"}]}]}}), @@ -245,7 +181,7 @@ mod tests { .expect("Failed to insert cohort1"); insert_cohort_for_team_in_pg( - postgres_writer.clone(), + writer.clone(), team.id, Some("Cohort 2".to_string()), json!({"properties": {"type": "OR", "values": [{"type": "property", "values": [{"key": "country", "type": "person", "value": ["USA"], "negation": false, "operator": "exact"}]}]}}), @@ -254,7 +190,7 @@ mod tests { .await .expect("Failed to insert cohort2"); - let cohorts = Cohort::list_from_pg(postgres_reader, team.id) + let cohorts = Cohort::list_from_pg(reader, team.id) .await .expect("Failed to list cohorts"); @@ -292,7 +228,7 @@ mod tests { } #[test] - fn test_cohort_property_to_property_filters() { + fn test_cohort_property_to_inner() { let cohort_property = InnerCohortProperty { prop_type: CohortPropertyType::AND, values: vec![CohortValues { @@ -318,7 +254,7 @@ mod tests { }], }; - let result = cohort_property.to_property_filters(); + let result = cohort_property.to_inner(); assert_eq!(result.len(), 2); assert_eq!(result[0].key, "email"); assert_eq!(result[0].value, json!("test@example.com")); @@ -328,16 +264,16 @@ mod tests { #[tokio::test] async fn test_extract_dependencies() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; - let team = insert_new_team_in_pg(postgres_reader.clone(), None) + let team = insert_new_team_in_pg(reader.clone(), None) .await .expect("Failed to insert team"); // Insert a single cohort that is dependent on another cohort let dependent_cohort = insert_cohort_for_team_in_pg( - postgres_writer.clone(), + writer.clone(), team.id, Some("Dependent Cohort".to_string()), json!({"properties": {"type": "OR", "values": [{"type": "OR", "values": [{"key": "$browser", "type": "person", "value": ["Safari"], "negation": false, "operator": "exact"}]}]}}), @@ -348,7 +284,7 @@ mod tests { // Insert main cohort with a single dependency let main_cohort = insert_cohort_for_team_in_pg( - postgres_writer.clone(), + writer.clone(), team.id, Some("Main Cohort".to_string()), json!({"properties": {"type": "OR", "values": [{"type": "OR", "values": [{"key": "id", "type": "cohort", "value": dependent_cohort.id, "negation": false}]}]}}), @@ -357,9 +293,14 @@ mod tests { .await .expect("Failed to insert main_cohort"); - let fetched_main_cohort = Cohort::from_pg(postgres_reader.clone(), main_cohort.id, team.id) + let cohorts = Cohort::list_from_pg(reader.clone(), team.id) .await - .expect("Failed to fetch main cohort"); + .expect("Failed to fetch cohorts"); + + let fetched_main_cohort = cohorts + .into_iter() + .find(|c| c.id == main_cohort.id) + .expect("Failed to find main cohort"); println!("fetched_main_cohort: {:?}", fetched_main_cohort); diff --git a/rust/feature-flags/src/config.rs b/rust/feature-flags/src/config.rs index 2194f84ac3eff..a57567429945a 100644 --- a/rust/feature-flags/src/config.rs +++ b/rust/feature-flags/src/config.rs @@ -98,6 +98,12 @@ pub struct Config { #[envconfig(from = "TEAM_IDS_TO_TRACK", default = "all")] pub team_ids_to_track: TeamIdsToTrack, + + #[envconfig(from = "CACHE_MAX_COHORT_ENTRIES", default = "100000")] + pub cache_max_cohort_entries: u64, + + #[envconfig(from = "CACHE_TTL_SECONDS", default = "300")] + pub cache_ttl_seconds: u64, } impl Config { @@ -114,6 +120,8 @@ impl Config { maxmind_db_path: "".to_string(), enable_metrics: false, team_ids_to_track: TeamIdsToTrack::All, + cache_max_cohort_entries: 100_000, + cache_ttl_seconds: 300, } } diff --git a/rust/feature-flags/src/flags/flag_matching.rs b/rust/feature-flags/src/flags/flag_matching.rs index ea04f6fb00b0a..04b9dc67c7939 100644 --- a/rust/feature-flags/src/flags/flag_matching.rs +++ b/rust/feature-flags/src/flags/flag_matching.rs @@ -5,7 +5,11 @@ use crate::cohort::cohort_cache_manager::CohortCacheManager; use crate::cohort::cohort_models::{Cohort, CohortId}; use crate::flags::flag_match_reason::FeatureFlagMatchReason; use crate::flags::flag_models::{FeatureFlag, FeatureFlagList, FlagGroupType}; -use crate::metrics::metrics_consts::{FLAG_EVALUATION_ERROR_COUNTER, FLAG_HASH_KEY_WRITES_COUNTER}; +use crate::metrics::metrics_consts::{ + DB_GROUP_PROPERTIES_READS_COUNTER, DB_PERSON_AND_GROUP_PROPERTIES_READS_COUNTER, + DB_PERSON_PROPERTIES_READS_COUNTER, FLAG_EVALUATION_ERROR_COUNTER, + FLAG_HASH_KEY_WRITES_COUNTER, PROPERTY_CACHE_HITS_COUNTER, PROPERTY_CACHE_MISSES_COUNTER, +}; use crate::metrics::metrics_utils::parse_exception_for_prometheus_label; use crate::properties::property_matching::match_property; use crate::properties::property_models::{OperatorType, PropertyFilter}; @@ -26,6 +30,7 @@ use tokio::time::{sleep, timeout}; use tracing::{error, info}; pub type TeamId = i32; +pub type ProjectId = i32; pub type PersonId = i32; pub type GroupTypeIndex = i32; pub type PostgresReader = Arc; @@ -70,21 +75,21 @@ pub struct GroupTypeMapping { /// These mappings are ingested via the plugin server. #[derive(Clone)] pub struct GroupTypeMappingCache { - team_id: TeamId, + project_id: ProjectId, failed_to_fetch_flags: bool, group_types_to_indexes: HashMap, group_indexes_to_types: HashMap, - postgres_reader: PostgresReader, + reader: PostgresReader, } impl GroupTypeMappingCache { - pub fn new(team_id: TeamId, postgres_reader: PostgresReader) -> Self { + pub fn new(project_id: ProjectId, reader: PostgresReader) -> Self { GroupTypeMappingCache { - team_id, + project_id, failed_to_fetch_flags: false, group_types_to_indexes: HashMap::new(), group_indexes_to_types: HashMap::new(), - postgres_reader, + reader, } } @@ -99,19 +104,29 @@ impl GroupTypeMappingCache { return Ok(self.group_types_to_indexes.clone()); } - let team_id = self.team_id; let mapping = match self - .fetch_group_type_mapping(self.postgres_reader.clone(), team_id) + .fetch_group_type_mapping(self.reader.clone(), self.project_id) .await { Ok(mapping) if !mapping.is_empty() => mapping, Ok(_) => { self.failed_to_fetch_flags = true; - // TODO add the `"Failed to fetch group"` type of lable. See posthog/models/feature_flag/flag_matching.py:parse_exception_for_error_message + let reason = "no_group_type_mappings"; + inc( + FLAG_EVALUATION_ERROR_COUNTER, + &[("reason".to_string(), reason.to_string())], + 1, + ); return Err(FlagError::NoGroupTypeMappings); } Err(e) => { self.failed_to_fetch_flags = true; + let reason = parse_exception_for_prometheus_label(&e); + inc( + FLAG_EVALUATION_ERROR_COUNTER, + &[("reason".to_string(), reason.to_string())], + 1, + ); return Err(e); } }; @@ -135,26 +150,31 @@ impl GroupTypeMappingCache { self.group_indexes_to_types.clone_from(&result); Ok(result) } else { - // TODO add the `"Failed to fetch group"` type of lable. See posthog/models/feature_flag/flag_matching.py:parse_exception_for_error_message + let reason = "no_group_type_mappings"; + inc( + FLAG_EVALUATION_ERROR_COUNTER, + &[("reason".to_string(), reason.to_string())], + 1, + ); Err(FlagError::NoGroupTypeMappings) } } async fn fetch_group_type_mapping( &mut self, - postgres_reader: PostgresReader, - team_id: TeamId, + reader: PostgresReader, + project_id: ProjectId, ) -> Result, FlagError> { - let mut conn = postgres_reader.as_ref().get_connection().await?; + let mut conn = reader.as_ref().get_connection().await?; let query = r#" SELECT group_type, group_type_index FROM posthog_grouptypemapping - WHERE team_id = $1 + WHERE project_id = $1 "#; let rows = sqlx::query_as::<_, GroupTypeMapping>(query) - .bind(team_id) + .bind(project_id) .fetch_all(&mut *conn) .await?; @@ -164,7 +184,12 @@ impl GroupTypeMappingCache { .collect(); if mapping.is_empty() { - // TODO add the `"Failed to fetch group"` type of lable. See posthog/models/feature_flag/flag_matching.py:parse_exception_for_error_message + let reason = "no_group_type_mappings"; + inc( + FLAG_EVALUATION_ERROR_COUNTER, + &[("reason".to_string(), reason.to_string())], + 1, + ); Err(FlagError::NoGroupTypeMappings) } else { Ok(mapping) @@ -186,8 +211,8 @@ pub struct PropertiesCache { pub struct FeatureFlagMatcher { pub distinct_id: String, pub team_id: TeamId, - pub postgres_reader: PostgresReader, - pub postgres_writer: PostgresWriter, + pub reader: PostgresReader, + pub writer: PostgresWriter, pub cohort_cache: Arc, group_type_mapping_cache: GroupTypeMappingCache, properties_cache: PropertiesCache, @@ -200,8 +225,8 @@ impl FeatureFlagMatcher { pub fn new( distinct_id: String, team_id: TeamId, - postgres_reader: PostgresReader, - postgres_writer: PostgresWriter, + reader: PostgresReader, + writer: PostgresWriter, cohort_cache: Arc, group_type_mapping_cache: Option, groups: Option>, @@ -209,11 +234,11 @@ impl FeatureFlagMatcher { FeatureFlagMatcher { distinct_id, team_id, - postgres_reader: postgres_reader.clone(), - postgres_writer: postgres_writer.clone(), + reader: reader.clone(), + writer: writer.clone(), cohort_cache, group_type_mapping_cache: group_type_mapping_cache - .unwrap_or_else(|| GroupTypeMappingCache::new(team_id, postgres_reader.clone())), + .unwrap_or_else(|| GroupTypeMappingCache::new(team_id, reader.clone())), groups: groups.unwrap_or_default(), properties_cache: PropertiesCache::default(), } @@ -292,7 +317,7 @@ impl FeatureFlagMatcher { target_distinct_ids: Vec, ) -> (Option>, bool) { let should_write = match should_write_hash_key_override( - self.postgres_reader.clone(), + self.reader.clone(), self.team_id, self.distinct_id.clone(), hash_key.clone(), @@ -320,7 +345,7 @@ impl FeatureFlagMatcher { if should_write { if let Err(e) = set_feature_flag_hash_key_overrides( // NB: this is the only method that writes to the database, so it's the only one that should use the writer - self.postgres_writer.clone(), + self.writer.clone(), self.team_id, target_distinct_ids.clone(), hash_key.clone(), @@ -328,7 +353,6 @@ impl FeatureFlagMatcher { .await { error!("Failed to set feature flag hash key overrides: {:?}", e); - // Increment the counter for failed write let reason = parse_exception_for_prometheus_label(&e); inc( FLAG_EVALUATION_ERROR_COUNTER, @@ -340,7 +364,6 @@ impl FeatureFlagMatcher { writing_hash_key_override = true; } - // TODO I'm not sure if this is the right place to increment this counter inc( FLAG_HASH_KEY_WRITES_COUNTER, &[ @@ -354,7 +377,7 @@ impl FeatureFlagMatcher { ); match get_feature_flag_hash_key_overrides( - self.postgres_reader.clone(), + self.reader.clone(), self.team_id, target_distinct_ids, ) @@ -430,20 +453,26 @@ impl FeatureFlagMatcher { .filter_map(|flag| flag.get_group_type_index()) .collect(); - let postgres_reader = self.postgres_reader.clone(); + let reader = self.reader.clone(); let distinct_id = self.distinct_id.clone(); let team_id = self.team_id; match fetch_and_locally_cache_all_properties( &mut self.properties_cache, - postgres_reader, + reader, distinct_id, team_id, &group_type_indexes, ) .await { - Ok(_) => {} + Ok(_) => { + inc( + DB_PERSON_AND_GROUP_PROPERTIES_READS_COUNTER, + &[("team_id".to_string(), team_id.to_string())], + 1, + ); + } Err(e) => { error_while_computing_flags = true; // TODO add sentry exception tracking @@ -806,7 +835,7 @@ impl FeatureFlagMatcher { } } - /// Get group properties from cache or database. + /// Get group properties from overrides, cache or database. /// /// This function attempts to retrieve group properties either from a cache or directly from the database. /// It first checks if there are any locally computable property overrides. If so, it returns those. @@ -832,9 +861,26 @@ impl FeatureFlagMatcher { /// and updates the cache accordingly. async fn get_person_id(&mut self) -> Result { match self.properties_cache.person_id { - Some(id) => Ok(id), + Some(id) => { + inc( + PROPERTY_CACHE_HITS_COUNTER, + &[("type".to_string(), "person_id".to_string())], + 1, + ); + Ok(id) + } None => { + inc( + PROPERTY_CACHE_MISSES_COUNTER, + &[("type".to_string(), "person_id".to_string())], + 1, + ); let id = self.get_person_id_from_db().await?; + inc( + DB_PERSON_PROPERTIES_READS_COUNTER, + &[("team_id".to_string(), self.team_id.to_string())], + 1, + ); self.properties_cache.person_id = Some(id); Ok(id) } @@ -844,15 +890,15 @@ impl FeatureFlagMatcher { /// Fetches the `PersonId` from the database based on the current `distinct_id` and `team_id`. /// This method is called when the `PersonId` is not present in the properties cache. async fn get_person_id_from_db(&mut self) -> Result { - let postgres_reader = self.postgres_reader.clone(); + let reader = self.reader.clone(); let distinct_id = self.distinct_id.clone(); let team_id = self.team_id; - fetch_person_properties_from_db(postgres_reader, distinct_id, team_id) + fetch_person_properties_from_db(reader, distinct_id, team_id) .await .map(|(_, person_id)| person_id) } - /// Get person properties from cache or database. + /// Get person properties from overrides, cache or database. /// /// This function attempts to retrieve person properties either from a cache or directly from the database. /// It first checks if there are any locally computable property overrides. If so, it returns those. @@ -884,7 +930,7 @@ impl FeatureFlagMatcher { // At the start of the request, fetch all of the cohorts for the team from the cache // This method also caches any cohorts for a given team in memory for the duration of the application, so we don't need to fetch from // the database again until we restart the application. See the CohortCacheManager for more details. - let cohorts = self.cohort_cache.get_cohorts_for_team(self.team_id).await?; + let cohorts = self.cohort_cache.get_cohorts(self.team_id).await?; // Split the cohorts into static and dynamic, since the dynamic ones have property filters // and we need to evaluate them based on the target properties, whereas the static ones are @@ -898,7 +944,7 @@ impl FeatureFlagMatcher { if !static_cohorts.is_empty() { let results = evaluate_static_cohorts( - self.postgres_reader.clone(), + self.reader.clone(), person_id, static_cohorts.iter().map(|c| c.id).collect(), ) @@ -912,7 +958,7 @@ impl FeatureFlagMatcher { .get_cohort_id() .ok_or(FlagError::CohortFiltersParsingError)?; let match_result = - evaluate_dynamic_cohorts(cohort_id, target_properties, cohorts.clone())?; + evaluate_dynamic_cohorts(cohort_id, target_properties, &cohorts)?; cohort_matches.insert(cohort_id, match_result); } } @@ -997,15 +1043,32 @@ impl FeatureFlagMatcher { .group_properties .get(&group_type_index) { + inc( + PROPERTY_CACHE_HITS_COUNTER, + &[("type".to_string(), "group_properties".to_string())], + 1, + ); let mut result = HashMap::new(); result.clone_from(properties); return Ok(result); } - let postgres_reader = self.postgres_reader.clone(); + inc( + PROPERTY_CACHE_MISSES_COUNTER, + &[("type".to_string(), "group_properties".to_string())], + 1, + ); + + let reader = self.reader.clone(); let team_id = self.team_id; let db_properties = - fetch_group_properties_from_db(postgres_reader, team_id, group_type_index).await?; + fetch_group_properties_from_db(reader, team_id, group_type_index).await?; + + inc( + DB_GROUP_PROPERTIES_READS_COUNTER, + &[("team_id".to_string(), team_id.to_string())], + 1, + ); // once the properties are fetched, cache them so we don't need to fetch again in a given request self.properties_cache @@ -1025,16 +1088,33 @@ impl FeatureFlagMatcher { ) -> Result, FlagError> { // check if the properties are already cached, if so return them if let Some(properties) = &self.properties_cache.person_properties { + inc( + PROPERTY_CACHE_HITS_COUNTER, + &[("type".to_string(), "person_properties".to_string())], + 1, + ); let mut result = HashMap::new(); result.clone_from(properties); return Ok(result); } - let postgres_reader = self.postgres_reader.clone(); + inc( + PROPERTY_CACHE_MISSES_COUNTER, + &[("type".to_string(), "person_properties".to_string())], + 1, + ); + + let reader = self.reader.clone(); let distinct_id = self.distinct_id.clone(); let team_id = self.team_id; let (db_properties, person_id) = - fetch_person_properties_from_db(postgres_reader, distinct_id, team_id).await?; + fetch_person_properties_from_db(reader, distinct_id, team_id).await?; + + inc( + DB_PERSON_PROPERTIES_READS_COUNTER, + &[("team_id".to_string(), team_id.to_string())], + 1, + ); // once the properties and person ID are fetched, cache them so we don't need to fetch again in a given request self.properties_cache.person_properties = Some(db_properties.clone()); @@ -1167,11 +1247,11 @@ impl FeatureFlagMatcher { /// Evaluate static cohort filters by checking if the person is in each cohort. async fn evaluate_static_cohorts( - postgres_reader: PostgresReader, + reader: PostgresReader, person_id: i32, // Change this parameter from distinct_id to person_id cohort_ids: Vec, ) -> Result, FlagError> { - let mut conn = postgres_reader.get_connection().await?; + let mut conn = reader.get_connection().await?; let query = r#" WITH cohort_membership AS ( @@ -1210,10 +1290,9 @@ async fn evaluate_static_cohorts( fn evaluate_dynamic_cohorts( initial_cohort_id: CohortId, target_properties: &HashMap, - cohorts: Vec, + cohorts: &[Cohort], ) -> Result { - let cohort_dependency_graph = - build_cohort_dependency_graph(initial_cohort_id, cohorts.clone())?; + let cohort_dependency_graph = build_cohort_dependency_graph(initial_cohort_id, cohorts)?; // We need to sort cohorts topologically to ensure we evaluate dependencies before the cohorts that depend on them. // For example, if cohort A depends on cohort B, we need to evaluate B first to know if A matches. @@ -1318,7 +1397,7 @@ fn apply_cohort_membership_logic( /// The graph is acyclic, which is required for valid cohort dependencies. fn build_cohort_dependency_graph( initial_cohort_id: CohortId, - cohorts: Vec, + cohorts: &[Cohort], ) -> Result, FlagError> { let mut graph = DiGraph::new(); let mut node_map = HashMap::new(); @@ -1386,12 +1465,12 @@ fn build_cohort_dependency_graph( /// It updates the properties cache with the fetched properties and returns the result. async fn fetch_and_locally_cache_all_properties( properties_cache: &mut PropertiesCache, - postgres_reader: PostgresReader, + reader: PostgresReader, distinct_id: String, team_id: TeamId, group_type_indexes: &HashSet, ) -> Result<(), FlagError> { - let mut conn = postgres_reader.as_ref().get_connection().await?; + let mut conn = reader.as_ref().get_connection().await?; let query = r#" SELECT @@ -1479,11 +1558,11 @@ async fn fetch_and_locally_cache_all_properties( /// This function constructs and executes a SQL query to fetch the person properties for a specified distinct ID and team ID. /// It returns the fetched properties as a HashMap. async fn fetch_person_properties_from_db( - postgres_reader: PostgresReader, + reader: PostgresReader, distinct_id: String, team_id: TeamId, ) -> Result<(HashMap, i32), FlagError> { - let mut conn = postgres_reader.as_ref().get_connection().await?; + let mut conn = reader.as_ref().get_connection().await?; let query = r#" SELECT "posthog_person"."id" as person_id, "posthog_person"."properties" as person_properties @@ -1520,11 +1599,11 @@ async fn fetch_person_properties_from_db( /// This function constructs and executes a SQL query to fetch the group properties for a specified team ID and group type index. /// It returns the fetched properties as a HashMap. async fn fetch_group_properties_from_db( - postgres_reader: PostgresReader, + reader: PostgresReader, team_id: TeamId, group_type_index: GroupTypeIndex, ) -> Result, FlagError> { - let mut conn = postgres_reader.as_ref().get_connection().await?; + let mut conn = reader.as_ref().get_connection().await?; let query = r#" SELECT "posthog_group"."group_properties" @@ -1556,9 +1635,6 @@ fn locally_computable_property_overrides( property_filters: &[PropertyFilter], ) -> Option> { property_overrides.as_ref().and_then(|overrides| { - // TODO handle note from Neil: https://github.com/PostHog/posthog/pull/24589#discussion_r1735828561 - // TL;DR – we'll need to handle cohort properties at the DB level, i.e. we'll need to adjust the cohort query - // to account for if a given person is an element of the cohort X, Y, Z, etc let should_prefer_overrides = property_filters .iter() .all(|prop| overrides.contains_key(&prop.key) && prop.prop_type != "cohort"); @@ -1582,12 +1658,12 @@ fn all_properties_match( } async fn get_feature_flag_hash_key_overrides( - postgres_reader: PostgresReader, + reader: PostgresReader, team_id: TeamId, distinct_id_and_hash_key_override: Vec, ) -> Result, FlagError> { let mut feature_flag_hash_key_overrides = HashMap::new(); - let mut conn = postgres_reader.as_ref().get_connection().await?; + let mut conn = reader.as_ref().get_connection().await?; let person_and_distinct_id_query = r#" SELECT person_id, distinct_id @@ -1637,7 +1713,7 @@ async fn get_feature_flag_hash_key_overrides( } async fn set_feature_flag_hash_key_overrides( - postgres_writer: PostgresWriter, + writer: PostgresWriter, team_id: TeamId, distinct_ids: Vec, hash_key_override: String, @@ -1646,7 +1722,7 @@ async fn set_feature_flag_hash_key_overrides( const RETRY_DELAY: Duration = Duration::from_millis(100); for retry in 0..MAX_RETRIES { - let mut conn = postgres_writer.get_connection().await?; + let mut conn = writer.get_connection().await?; let mut transaction = conn.begin().await?; let query = r#" @@ -1713,7 +1789,7 @@ async fn set_feature_flag_hash_key_overrides( } async fn should_write_hash_key_override( - postgres_reader: PostgresReader, + reader: PostgresReader, team_id: TeamId, distinct_id: String, hash_key_override: String, @@ -1746,7 +1822,7 @@ async fn should_write_hash_key_override( for retry in 0..MAX_RETRIES { let result = timeout(QUERY_TIMEOUT, async { - let mut conn = postgres_reader.get_connection().await.map_err(|e| { + let mut conn = reader.get_connection().await.map_err(|e| { FlagError::DatabaseError(format!("Failed to acquire connection: {}", e)) })?; @@ -1842,22 +1918,22 @@ mod tests { #[tokio::test] async fn test_fetch_properties_from_pg_to_match() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) + let team = insert_new_team_in_pg(reader.clone(), None) .await .expect("Failed to insert team in pg"); let distinct_id = "user_distinct_id".to_string(); - insert_person_for_team_in_pg(postgres_reader.clone(), team.id, distinct_id.clone(), None) + insert_person_for_team_in_pg(reader.clone(), team.id, distinct_id.clone(), None) .await .expect("Failed to insert person"); let not_matching_distinct_id = "not_matching_distinct_id".to_string(); insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, not_matching_distinct_id.clone(), Some(json!({ "email": "a@x.com"})), @@ -1893,8 +1969,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( distinct_id.clone(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -1907,8 +1983,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( not_matching_distinct_id.clone(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -1921,8 +1997,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "other_distinct_id".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -1935,12 +2011,10 @@ mod tests { #[tokio::test] async fn test_person_property_overrides() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); let flag = create_test_flag( None, @@ -1975,8 +2049,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "test_user".to_string(), team.id, - postgres_reader, - postgres_writer, + reader, + writer, cohort_cache, None, None, @@ -1997,12 +2071,10 @@ mod tests { #[tokio::test] async fn test_group_property_overrides() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); let flag = create_test_flag( None, @@ -2032,8 +2104,7 @@ mod tests { None, ); - let mut group_type_mapping_cache = - GroupTypeMappingCache::new(team.id, postgres_reader.clone()); + let mut group_type_mapping_cache = GroupTypeMappingCache::new(team.id, reader.clone()); let group_types_to_indexes = [("organization".to_string(), 1)].into_iter().collect(); group_type_mapping_cache.group_types_to_indexes = group_types_to_indexes; group_type_mapping_cache.group_indexes_to_types = @@ -2052,8 +2123,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "test_user".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), Some(group_type_mapping_cache), Some(groups), @@ -2076,10 +2147,10 @@ mod tests { #[tokio::test] async fn test_get_matching_variant_with_cache() { let flag = create_test_flag_with_variants(1); - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let mut group_type_mapping_cache = GroupTypeMappingCache::new(1, postgres_reader.clone()); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let mut group_type_mapping_cache = GroupTypeMappingCache::new(1, reader.clone()); let group_types_to_indexes = [("group_type_1".to_string(), 1)].into_iter().collect(); let group_type_index_to_name = [(1, "group_type_1".to_string())].into_iter().collect(); @@ -2092,8 +2163,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "test_user".to_string(), 1, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), Some(group_type_mapping_cache), Some(groups), @@ -2108,20 +2179,18 @@ mod tests { #[tokio::test] async fn test_get_matching_variant_with_db() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); let flag = create_test_flag_with_variants(team.id); let mut matcher = FeatureFlagMatcher::new( "test_user".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -2134,9 +2203,9 @@ mod tests { #[tokio::test] async fn test_is_condition_match_empty_properties() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); let flag = create_test_flag( Some(1), None, @@ -2167,8 +2236,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "test_user".to_string(), 1, - postgres_reader, - postgres_writer, + reader, + writer, cohort_cache, None, None, @@ -2224,12 +2293,10 @@ mod tests { #[tokio::test] async fn test_overrides_avoid_db_lookups() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); let flag = create_test_flag( None, @@ -2265,8 +2332,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "test_user".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -2295,12 +2362,10 @@ mod tests { #[tokio::test] async fn test_fallback_to_db_when_overrides_insufficient() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); let flag = create_test_flag( None, @@ -2346,7 +2411,7 @@ mod tests { )])); insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, "test_user".to_string(), Some(json!({"email": "test@example.com", "age": 30})), @@ -2357,8 +2422,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "test_user".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -2381,16 +2446,14 @@ mod tests { #[tokio::test] async fn test_property_fetching_and_caching() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); let distinct_id = "test_user".to_string(); insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, distinct_id.clone(), Some(json!({"email": "test@example.com", "age": 30})), @@ -2401,8 +2464,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( distinct_id, team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -2426,16 +2489,14 @@ mod tests { #[tokio::test] async fn test_property_caching() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); let distinct_id = "test_user".to_string(); insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, distinct_id.clone(), Some(json!({"email": "test@example.com", "age": 30})), @@ -2446,8 +2507,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( distinct_id.clone(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -2479,8 +2540,8 @@ mod tests { let mut new_matcher = FeatureFlagMatcher::new( distinct_id.clone(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -2570,12 +2631,10 @@ mod tests { #[tokio::test] async fn test_concurrent_flag_evaluation() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); let flag = Arc::new(create_test_flag( None, Some(team.id), @@ -2600,15 +2659,15 @@ mod tests { let mut handles = vec![]; for i in 0..100 { let flag_clone = flag.clone(); - let postgres_reader_clone = postgres_reader.clone(); - let postgres_writer_clone = postgres_writer.clone(); + let reader_clone = reader.clone(); + let writer_clone = writer.clone(); let cohort_cache_clone = cohort_cache.clone(); handles.push(tokio::spawn(async move { let mut matcher = FeatureFlagMatcher::new( format!("test_user_{}", i), team.id, - postgres_reader_clone, - postgres_writer_clone, + reader_clone, + writer_clone, cohort_cache_clone, None, None, @@ -2629,12 +2688,10 @@ mod tests { #[tokio::test] async fn test_property_operators() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); let flag = create_test_flag( None, @@ -2675,7 +2732,7 @@ mod tests { ); insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, "test_user".to_string(), Some(json!({"email": "user@example@domain.com", "age": 30})), @@ -2686,8 +2743,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "test_user".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -2700,9 +2757,9 @@ mod tests { #[tokio::test] async fn test_empty_hashed_identifier() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); let flag = create_test_flag( Some(1), None, @@ -2724,15 +2781,8 @@ mod tests { None, ); - let mut matcher = FeatureFlagMatcher::new( - "".to_string(), - 1, - postgres_reader, - postgres_writer, - cohort_cache, - None, - None, - ); + let mut matcher = + FeatureFlagMatcher::new("".to_string(), 1, reader, writer, cohort_cache, None, None); let result = matcher.get_match(&flag, None, None).await.unwrap(); @@ -2741,9 +2791,9 @@ mod tests { #[tokio::test] async fn test_rollout_percentage() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); let mut flag = create_test_flag( Some(1), None, @@ -2768,8 +2818,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "test_user".to_string(), 1, - postgres_reader, - postgres_writer, + reader, + writer, cohort_cache, None, None, @@ -2789,9 +2839,9 @@ mod tests { #[tokio::test] async fn test_uneven_variant_distribution() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); let mut flag = create_test_flag_with_variants(1); // Adjust variant rollout percentages to be uneven @@ -2819,8 +2869,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "test_user".to_string(), 1, - postgres_reader, - postgres_writer, + reader, + writer, cohort_cache, None, None, @@ -2851,22 +2901,15 @@ mod tests { #[tokio::test] async fn test_missing_properties_in_db() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); // Insert a person without properties - insert_person_for_team_in_pg( - postgres_reader.clone(), - team.id, - "test_user".to_string(), - None, - ) - .await - .unwrap(); + insert_person_for_team_in_pg(reader.clone(), team.id, "test_user".to_string(), None) + .await + .unwrap(); let flag = create_test_flag( None, @@ -2899,8 +2942,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "test_user".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache, None, None, @@ -2913,16 +2956,14 @@ mod tests { #[tokio::test] async fn test_malformed_property_data() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); // Insert a person with malformed properties insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, "test_user".to_string(), Some(json!({"age": "not_a_number"})), @@ -2961,8 +3002,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "test_user".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache, None, None, @@ -2976,12 +3017,10 @@ mod tests { #[tokio::test] async fn test_get_match_with_insufficient_overrides() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); let flag = create_test_flag( None, @@ -3027,7 +3066,7 @@ mod tests { )])); insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, "test_user".to_string(), Some(json!({"email": "test@example.com", "age": 30})), @@ -3038,8 +3077,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "test_user".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache, None, None, @@ -3055,9 +3094,9 @@ mod tests { #[tokio::test] async fn test_evaluation_reasons() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); let flag = create_test_flag( Some(1), None, @@ -3082,8 +3121,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "test_user".to_string(), 1, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache, None, None, @@ -3100,12 +3139,10 @@ mod tests { #[tokio::test] async fn test_complex_conditions() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); let flag = create_test_flag( Some(1), @@ -3150,7 +3187,7 @@ mod tests { ); insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, "test_user".to_string(), Some(json!({"email": "user2@example.com", "age": 35})), @@ -3161,8 +3198,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "test_user".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache, None, None, @@ -3175,12 +3212,10 @@ mod tests { #[tokio::test] async fn test_super_condition_matches_boolean() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); let flag = create_test_flag( Some(1), @@ -3241,7 +3276,7 @@ mod tests { ); insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, "test_id".to_string(), Some(json!({"email": "test@posthog.com", "is_enabled": true})), @@ -3249,24 +3284,19 @@ mod tests { .await .unwrap(); - insert_person_for_team_in_pg(postgres_reader.clone(), team.id, "lil_id".to_string(), None) + insert_person_for_team_in_pg(reader.clone(), team.id, "lil_id".to_string(), None) .await .unwrap(); - insert_person_for_team_in_pg( - postgres_reader.clone(), - team.id, - "another_id".to_string(), - None, - ) - .await - .unwrap(); + insert_person_for_team_in_pg(reader.clone(), team.id, "another_id".to_string(), None) + .await + .unwrap(); let mut matcher_test_id = FeatureFlagMatcher::new( "test_id".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -3275,8 +3305,8 @@ mod tests { let mut matcher_example_id = FeatureFlagMatcher::new( "lil_id".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -3285,8 +3315,8 @@ mod tests { let mut matcher_another_id = FeatureFlagMatcher::new( "another_id".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -3312,15 +3342,13 @@ mod tests { #[tokio::test] async fn test_super_condition_matches_string() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, "test_id".to_string(), Some(json!({"email": "test@posthog.com", "is_enabled": "true"})), @@ -3389,8 +3417,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "test_id".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -3405,15 +3433,13 @@ mod tests { #[tokio::test] async fn test_super_condition_matches_and_false() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, "test_id".to_string(), Some(json!({"email": "test@posthog.com", "is_enabled": true})), @@ -3421,16 +3447,11 @@ mod tests { .await .unwrap(); - insert_person_for_team_in_pg( - postgres_reader.clone(), - team.id, - "another_id".to_string(), - None, - ) - .await - .unwrap(); + insert_person_for_team_in_pg(reader.clone(), team.id, "another_id".to_string(), None) + .await + .unwrap(); - insert_person_for_team_in_pg(postgres_reader.clone(), team.id, "lil_id".to_string(), None) + insert_person_for_team_in_pg(reader.clone(), team.id, "lil_id".to_string(), None) .await .unwrap(); @@ -3495,8 +3516,8 @@ mod tests { let mut matcher_test_id = FeatureFlagMatcher::new( "test_id".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -3505,8 +3526,8 @@ mod tests { let mut matcher_example_id = FeatureFlagMatcher::new( "lil_id".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -3515,8 +3536,8 @@ mod tests { let mut matcher_another_id = FeatureFlagMatcher::new( "another_id".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -3556,16 +3577,14 @@ mod tests { #[tokio::test] async fn test_basic_cohort_matching() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); // Insert a cohort with the condition that matches the test user's properties let cohort_row = insert_cohort_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, None, json!({ @@ -3590,7 +3609,7 @@ mod tests { // Insert a person with properties that match the cohort condition insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, "test_user".to_string(), Some(json!({"$browser_version": 126})), @@ -3630,8 +3649,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "test_user".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -3644,16 +3663,14 @@ mod tests { #[tokio::test] async fn test_not_in_cohort_matching() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); // Insert a cohort with a condition that does not match the test user's properties let cohort_row = insert_cohort_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, None, json!({ @@ -3678,7 +3695,7 @@ mod tests { // Insert a person with properties that do not match the cohort condition insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, "test_user".to_string(), Some(json!({"$browser_version": 126})), @@ -3718,8 +3735,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "test_user".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -3732,16 +3749,14 @@ mod tests { #[tokio::test] async fn test_not_in_cohort_matching_user_in_cohort() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); // Insert a cohort with a condition that matches the test user's properties let cohort_row = insert_cohort_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, None, json!({ @@ -3766,7 +3781,7 @@ mod tests { // Insert a person with properties that match the cohort condition insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, "test_user".to_string(), Some(json!({"$browser_version": 126})), @@ -3806,8 +3821,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "test_user".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -3821,16 +3836,14 @@ mod tests { #[tokio::test] async fn test_cohort_dependent_on_another_cohort() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); // Insert a base cohort let base_cohort_row = insert_cohort_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, None, json!({ @@ -3855,7 +3868,7 @@ mod tests { // Insert a dependent cohort that includes the base cohort let dependent_cohort_row = insert_cohort_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, None, json!({ @@ -3880,7 +3893,7 @@ mod tests { // Insert a person with properties that match the base cohort condition insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, "test_user".to_string(), Some(json!({"$browser_version": 126})), @@ -3920,8 +3933,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "test_user".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -3934,16 +3947,14 @@ mod tests { #[tokio::test] async fn test_in_cohort_matching_user_not_in_cohort() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); // Insert a cohort with a condition that does not match the test user's properties let cohort_row = insert_cohort_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, None, json!({ @@ -3968,7 +3979,7 @@ mod tests { // Insert a person with properties that do not match the cohort condition insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, "test_user".to_string(), Some(json!({"$browser_version": 125})), @@ -4008,8 +4019,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( "test_user".to_string(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -4023,16 +4034,14 @@ mod tests { #[tokio::test] async fn test_static_cohort_matching_user_in_cohort() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); // Insert a static cohort let cohort = insert_cohort_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, Some("Static Cohort".to_string()), json!({}), // Static cohorts don't have property filters @@ -4044,7 +4053,7 @@ mod tests { // Insert a person let distinct_id = "static_user".to_string(); insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, distinct_id.clone(), Some(json!({"email": "static@user.com"})), @@ -4053,13 +4062,12 @@ mod tests { .unwrap(); // Retrieve the person's ID - let person_id = - get_person_id_by_distinct_id(postgres_reader.clone(), team.id, &distinct_id) - .await - .unwrap(); + let person_id = get_person_id_by_distinct_id(reader.clone(), team.id, &distinct_id) + .await + .unwrap(); // Associate the person with the static cohort - add_person_to_cohort(postgres_reader.clone(), person_id, cohort.id) + add_person_to_cohort(reader.clone(), person_id, cohort.id) .await .unwrap(); @@ -4095,8 +4103,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( distinct_id.clone(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -4112,16 +4120,14 @@ mod tests { #[tokio::test] async fn test_static_cohort_matching_user_not_in_cohort() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); // Insert a static cohort let cohort = insert_cohort_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, Some("Another Static Cohort".to_string()), json!({}), // Static cohorts don't have property filters @@ -4133,7 +4139,7 @@ mod tests { // Insert a person let distinct_id = "non_static_user".to_string(); insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, distinct_id.clone(), Some(json!({"email": "nonstatic@user.com"})), @@ -4175,8 +4181,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( distinct_id.clone(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -4192,16 +4198,14 @@ mod tests { #[tokio::test] async fn test_static_cohort_not_in_matching_user_not_in_cohort() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); // Insert a static cohort let cohort = insert_cohort_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, Some("Static Cohort NotIn".to_string()), json!({}), // Static cohorts don't have property filters @@ -4213,7 +4217,7 @@ mod tests { // Insert a person let distinct_id = "not_in_static_user".to_string(); insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, distinct_id.clone(), Some(json!({"email": "notinstatic@user.com"})), @@ -4255,8 +4259,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( distinct_id.clone(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -4272,16 +4276,14 @@ mod tests { #[tokio::test] async fn test_static_cohort_not_in_matching_user_in_cohort() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); // Insert a static cohort let cohort = insert_cohort_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, Some("Static Cohort NotIn User In".to_string()), json!({}), // Static cohorts don't have property filters @@ -4293,7 +4295,7 @@ mod tests { // Insert a person let distinct_id = "in_not_in_static_user".to_string(); insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, distinct_id.clone(), Some(json!({"email": "innotinstatic@user.com"})), @@ -4302,13 +4304,12 @@ mod tests { .unwrap(); // Retrieve the person's ID - let person_id = - get_person_id_by_distinct_id(postgres_reader.clone(), team.id, &distinct_id) - .await - .unwrap(); + let person_id = get_person_id_by_distinct_id(reader.clone(), team.id, &distinct_id) + .await + .unwrap(); // Associate the person with the static cohort - add_person_to_cohort(postgres_reader.clone(), person_id, cohort.id) + add_person_to_cohort(reader.clone(), person_id, cohort.id) .await .unwrap(); @@ -4344,8 +4345,8 @@ mod tests { let mut matcher = FeatureFlagMatcher::new( distinct_id.clone(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -4361,15 +4362,13 @@ mod tests { #[tokio::test] async fn test_set_feature_flag_hash_key_overrides_success() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); let distinct_id = "user2".to_string(); // Insert person - insert_person_for_team_in_pg(postgres_reader.clone(), team.id, distinct_id.clone(), None) + insert_person_for_team_in_pg(reader.clone(), team.id, distinct_id.clone(), None) .await .unwrap(); @@ -4404,13 +4403,13 @@ mod tests { }; // Insert the feature flag into the database - insert_flag_for_team_in_pg(postgres_writer.clone(), team.id, Some(flag_row)) + insert_flag_for_team_in_pg(writer.clone(), team.id, Some(flag_row)) .await .unwrap(); // Set hash key override set_feature_flag_hash_key_overrides( - postgres_writer.clone(), + writer.clone(), team.id, vec![distinct_id.clone()], "hash_key_2".to_string(), @@ -4419,13 +4418,10 @@ mod tests { .unwrap(); // Retrieve hash key overrides - let overrides = get_feature_flag_hash_key_overrides( - postgres_reader.clone(), - team.id, - vec![distinct_id.clone()], - ) - .await - .unwrap(); + let overrides = + get_feature_flag_hash_key_overrides(reader.clone(), team.id, vec![distinct_id.clone()]) + .await + .unwrap(); assert_eq!( overrides.get("test_flag"), @@ -4436,15 +4432,13 @@ mod tests { #[tokio::test] async fn test_get_feature_flag_hash_key_overrides_success() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); let distinct_id = "user2".to_string(); // Insert person - insert_person_for_team_in_pg(postgres_reader.clone(), team.id, distinct_id.clone(), None) + insert_person_for_team_in_pg(reader.clone(), team.id, distinct_id.clone(), None) .await .unwrap(); @@ -4479,13 +4473,13 @@ mod tests { }; // Insert the feature flag into the database - insert_flag_for_team_in_pg(postgres_writer.clone(), team.id, Some(flag_row)) + insert_flag_for_team_in_pg(writer.clone(), team.id, Some(flag_row)) .await .unwrap(); // Set hash key override set_feature_flag_hash_key_overrides( - postgres_writer.clone(), + writer.clone(), team.id, vec![distinct_id.clone()], "hash_key_2".to_string(), @@ -4494,13 +4488,10 @@ mod tests { .unwrap(); // Retrieve hash key overrides - let overrides = get_feature_flag_hash_key_overrides( - postgres_reader.clone(), - team.id, - vec![distinct_id.clone()], - ) - .await - .unwrap(); + let overrides = + get_feature_flag_hash_key_overrides(reader.clone(), team.id, vec![distinct_id.clone()]) + .await + .unwrap(); assert_eq!( overrides.get("test_flag"), @@ -4511,17 +4502,15 @@ mod tests { #[tokio::test] async fn test_evaluate_feature_flags_with_experience_continuity() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); let distinct_id = "user3".to_string(); // Insert person insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, distinct_id.clone(), Some(json!({"email": "user3@example.com"})), @@ -4560,7 +4549,7 @@ mod tests { // Set hash key override set_feature_flag_hash_key_overrides( - postgres_writer.clone(), + writer.clone(), team.id, vec![distinct_id.clone()], "hash_key_continuity".to_string(), @@ -4575,8 +4564,8 @@ mod tests { let result = FeatureFlagMatcher::new( distinct_id.clone(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -4594,16 +4583,14 @@ mod tests { #[tokio::test] async fn test_evaluate_feature_flags_with_continuity_missing_override() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); let distinct_id = "user4".to_string(); insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, distinct_id.clone(), Some(json!({"email": "user4@example.com"})), @@ -4647,8 +4634,8 @@ mod tests { let result = FeatureFlagMatcher::new( distinct_id.clone(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, @@ -4666,16 +4653,14 @@ mod tests { #[tokio::test] async fn test_evaluate_all_feature_flags_mixed_continuity() { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); - let team = insert_new_team_in_pg(postgres_reader.clone(), None) - .await - .unwrap(); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); + let team = insert_new_team_in_pg(reader.clone(), None).await.unwrap(); let distinct_id = "user5".to_string(); insert_person_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, distinct_id.clone(), Some(json!({"email": "user5@example.com"})), @@ -4743,7 +4728,7 @@ mod tests { // Set hash key override for the continuity flag set_feature_flag_hash_key_overrides( - postgres_writer.clone(), + writer.clone(), team.id, vec![distinct_id.clone()], "hash_key_mixed".to_string(), @@ -4758,8 +4743,8 @@ mod tests { let result = FeatureFlagMatcher::new( distinct_id.clone(), team.id, - postgres_reader.clone(), - postgres_writer.clone(), + reader.clone(), + writer.clone(), cohort_cache.clone(), None, None, diff --git a/rust/feature-flags/src/flags/flag_operations.rs b/rust/feature-flags/src/flags/flag_operations.rs index 0bb357b7ecae9..d0d2aa65a0912 100644 --- a/rust/feature-flags/src/flags/flag_operations.rs +++ b/rust/feature-flags/src/flags/flag_operations.rs @@ -208,17 +208,17 @@ mod tests { #[tokio::test] async fn test_fetch_flags_from_pg() { - let postgres_reader = setup_pg_reader_client(None).await; + let reader = setup_pg_reader_client(None).await; - let team = insert_new_team_in_pg(postgres_reader.clone(), None) + let team = insert_new_team_in_pg(reader.clone(), None) .await .expect("Failed to insert team in pg"); - insert_flag_for_team_in_pg(postgres_reader.clone(), team.id, None) + insert_flag_for_team_in_pg(reader.clone(), team.id, None) .await .expect("Failed to insert flags"); - let flags_from_pg = FeatureFlagList::from_pg(postgres_reader.clone(), team.id) + let flags_from_pg = FeatureFlagList::from_pg(reader.clone(), team.id) .await .expect("Failed to fetch flags from pg"); @@ -347,9 +347,9 @@ mod tests { #[tokio::test] async fn test_fetch_empty_team_from_pg() { - let postgres_reader = setup_pg_reader_client(None).await; + let reader = setup_pg_reader_client(None).await; - let FeatureFlagList { flags } = FeatureFlagList::from_pg(postgres_reader.clone(), 1234) + let FeatureFlagList { flags } = FeatureFlagList::from_pg(reader.clone(), 1234) .await .expect("Failed to fetch flags from pg"); { @@ -359,9 +359,9 @@ mod tests { #[tokio::test] async fn test_fetch_nonexistent_team_from_pg() { - let postgres_reader = setup_pg_reader_client(None).await; + let reader = setup_pg_reader_client(None).await; - match FeatureFlagList::from_pg(postgres_reader.clone(), -1).await { + match FeatureFlagList::from_pg(reader.clone(), -1).await { Ok(flags) => assert_eq!(flags.flags.len(), 0), Err(err) => panic!("Expected empty result, got error: {:?}", err), } @@ -380,9 +380,9 @@ mod tests { #[tokio::test] async fn test_fetch_multiple_flags_from_pg() { - let postgres_reader = setup_pg_reader_client(None).await; + let reader = setup_pg_reader_client(None).await; - let team = insert_new_team_in_pg(postgres_reader.clone(), None) + let team = insert_new_team_in_pg(reader.clone(), None) .await .expect("Failed to insert team in pg"); @@ -412,15 +412,15 @@ mod tests { }; // Insert multiple flags for the team - insert_flag_for_team_in_pg(postgres_reader.clone(), team.id, Some(flag1)) + insert_flag_for_team_in_pg(reader.clone(), team.id, Some(flag1)) .await .expect("Failed to insert flags"); - insert_flag_for_team_in_pg(postgres_reader.clone(), team.id, Some(flag2)) + insert_flag_for_team_in_pg(reader.clone(), team.id, Some(flag2)) .await .expect("Failed to insert flags"); - let flags_from_pg = FeatureFlagList::from_pg(postgres_reader.clone(), team.id) + let flags_from_pg = FeatureFlagList::from_pg(reader.clone(), team.id) .await .expect("Failed to fetch flags from pg"); @@ -468,9 +468,9 @@ mod tests { #[tokio::test] async fn test_multivariate_flag_parsing() { let redis_client = setup_redis_client(None); - let postgres_reader = setup_pg_reader_client(None).await; + let reader = setup_pg_reader_client(None).await; - let team = insert_new_team_in_pg(postgres_reader.clone(), None) + let team = insert_new_team_in_pg(reader.clone(), None) .await .expect("Failed to insert team in pg"); @@ -521,7 +521,7 @@ mod tests { // Insert into Postgres insert_flag_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, Some(FeatureFlagRow { id: 1, @@ -548,7 +548,7 @@ mod tests { assert_eq!(redis_flag.get_variants().len(), 3); // Fetch and verify from Postgres - let pg_flags = FeatureFlagList::from_pg(postgres_reader, team.id) + let pg_flags = FeatureFlagList::from_pg(reader, team.id) .await .expect("Failed to fetch flags from Postgres"); @@ -561,9 +561,9 @@ mod tests { #[tokio::test] async fn test_multivariate_flag_with_payloads() { let redis_client = setup_redis_client(None); - let postgres_reader = setup_pg_reader_client(None).await; + let reader = setup_pg_reader_client(None).await; - let team = insert_new_team_in_pg(postgres_reader.clone(), None) + let team = insert_new_team_in_pg(reader.clone(), None) .await .expect("Failed to insert team in pg"); @@ -619,7 +619,7 @@ mod tests { // Insert into Postgres insert_flag_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, Some(FeatureFlagRow { id: 1, @@ -645,7 +645,7 @@ mod tests { assert_eq!(redis_flag.key, "multivariate_flag_with_payloads"); // Fetch and verify from Postgres - let pg_flags = FeatureFlagList::from_pg(postgres_reader, team.id) + let pg_flags = FeatureFlagList::from_pg(reader, team.id) .await .expect("Failed to fetch flags from Postgres"); @@ -704,9 +704,9 @@ mod tests { #[tokio::test] async fn test_flag_with_super_groups() { let redis_client = setup_redis_client(None); - let postgres_reader = setup_pg_reader_client(None).await; + let reader = setup_pg_reader_client(None).await; - let team = insert_new_team_in_pg(postgres_reader.clone(), None) + let team = insert_new_team_in_pg(reader.clone(), None) .await .expect("Failed to insert team in pg"); @@ -751,7 +751,7 @@ mod tests { // Insert into Postgres insert_flag_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, Some(FeatureFlagRow { id: 1, @@ -779,7 +779,7 @@ mod tests { assert_eq!(redis_flag.filters.super_groups.as_ref().unwrap().len(), 1); // Fetch and verify from Postgres - let pg_flags = FeatureFlagList::from_pg(postgres_reader, team.id) + let pg_flags = FeatureFlagList::from_pg(reader, team.id) .await .expect("Failed to fetch flags from Postgres"); @@ -793,9 +793,9 @@ mod tests { #[tokio::test] async fn test_flags_with_different_property_types() { let redis_client = setup_redis_client(None); - let postgres_reader = setup_pg_reader_client(None).await; + let reader = setup_pg_reader_client(None).await; - let team = insert_new_team_in_pg(postgres_reader.clone(), None) + let team = insert_new_team_in_pg(reader.clone(), None) .await .expect("Failed to insert team in pg"); @@ -846,7 +846,7 @@ mod tests { // Insert into Postgres insert_flag_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, Some(FeatureFlagRow { id: 1, @@ -877,7 +877,7 @@ mod tests { assert_eq!(redis_properties[2].prop_type, "event"); // Fetch and verify from Postgres - let pg_flags = FeatureFlagList::from_pg(postgres_reader, team.id) + let pg_flags = FeatureFlagList::from_pg(reader, team.id) .await .expect("Failed to fetch flags from Postgres"); @@ -894,9 +894,9 @@ mod tests { #[tokio::test] async fn test_deleted_and_inactive_flags() { let redis_client = setup_redis_client(None); - let postgres_reader = setup_pg_reader_client(None).await; + let reader = setup_pg_reader_client(None).await; - let team = insert_new_team_in_pg(postgres_reader.clone(), None) + let team = insert_new_team_in_pg(reader.clone(), None) .await .expect("Failed to insert team in pg"); @@ -931,7 +931,7 @@ mod tests { // Insert into Postgres insert_flag_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, Some(FeatureFlagRow { id: 0, @@ -948,7 +948,7 @@ mod tests { .expect("Failed to insert deleted flag in Postgres"); insert_flag_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, Some(FeatureFlagRow { id: 0, @@ -980,7 +980,7 @@ mod tests { .any(|f| f.key == "inactive_flag" && !f.active)); // Fetch and verify from Postgres - let pg_flags = FeatureFlagList::from_pg(postgres_reader, team.id) + let pg_flags = FeatureFlagList::from_pg(reader, team.id) .await .expect("Failed to fetch flags from Postgres"); @@ -998,7 +998,7 @@ mod tests { #[tokio::test] async fn test_error_handling() { let redis_client = setup_redis_client(Some("redis://localhost:6379/".to_string())); - let postgres_reader = setup_pg_reader_client(None).await; + let reader = setup_pg_reader_client(None).await; // Test Redis connection error let bad_redis_client = setup_redis_client(Some("redis://localhost:1111/".to_string())); @@ -1006,7 +1006,7 @@ mod tests { assert!(matches!(result, Err(FlagError::RedisUnavailable))); // Test malformed JSON in Redis - let team = insert_new_team_in_pg(postgres_reader.clone(), None) + let team = insert_new_team_in_pg(reader.clone(), None) .await .expect("Failed to insert team in pg"); @@ -1023,7 +1023,7 @@ mod tests { // Test database query error (using a non-existent table) let result = sqlx::query("SELECT * FROM non_existent_table") - .fetch_all(&mut *postgres_reader.get_connection().await.unwrap()) + .fetch_all(&mut *reader.get_connection().await.unwrap()) .await; assert!(result.is_err()); } @@ -1031,9 +1031,9 @@ mod tests { #[tokio::test] async fn test_concurrent_access() { let redis_client = setup_redis_client(None); - let postgres_reader = setup_pg_reader_client(None).await; + let reader = setup_pg_reader_client(None).await; - let team = insert_new_team_in_pg(postgres_reader.clone(), None) + let team = insert_new_team_in_pg(reader.clone(), None) .await .expect("Failed to insert team in pg"); @@ -1056,7 +1056,7 @@ mod tests { .expect("Failed to insert flag in Redis"); insert_flag_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, Some(FeatureFlagRow { id: 0, @@ -1075,16 +1075,14 @@ mod tests { let mut handles = vec![]; for _ in 0..10 { let redis_client = redis_client.clone(); - let postgres_reader = postgres_reader.clone(); + let reader = reader.clone(); let team_id = team.id; let handle = task::spawn(async move { let redis_flags = FeatureFlagList::from_redis(redis_client, team_id) .await .unwrap(); - let pg_flags = FeatureFlagList::from_pg(postgres_reader, team_id) - .await - .unwrap(); + let pg_flags = FeatureFlagList::from_pg(reader, team_id).await.unwrap(); (redis_flags, pg_flags) }); @@ -1104,9 +1102,9 @@ mod tests { #[ignore] async fn test_performance() { let redis_client = setup_redis_client(None); - let postgres_reader = setup_pg_reader_client(None).await; + let reader = setup_pg_reader_client(None).await; - let team = insert_new_team_in_pg(postgres_reader.clone(), None) + let team = insert_new_team_in_pg(reader.clone(), None) .await .expect("Failed to insert team in pg"); @@ -1136,7 +1134,7 @@ mod tests { for flag in flags { insert_flag_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, Some(FeatureFlagRow { id: 0, @@ -1160,7 +1158,7 @@ mod tests { let redis_duration = start.elapsed(); let start = Instant::now(); - let pg_flags = FeatureFlagList::from_pg(postgres_reader, team.id) + let pg_flags = FeatureFlagList::from_pg(reader, team.id) .await .expect("Failed to fetch flags from Postgres"); let pg_duration = start.elapsed(); @@ -1178,9 +1176,9 @@ mod tests { #[tokio::test] async fn test_edge_cases() { let redis_client = setup_redis_client(None); - let postgres_reader = setup_pg_reader_client(None).await; + let reader = setup_pg_reader_client(None).await; - let team = insert_new_team_in_pg(postgres_reader.clone(), None) + let team = insert_new_team_in_pg(reader.clone(), None) .await .expect("Failed to insert team in pg"); @@ -1225,7 +1223,7 @@ mod tests { for flag in edge_case_flags.as_array().unwrap() { insert_flag_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, Some(FeatureFlagRow { id: 0, @@ -1246,7 +1244,7 @@ mod tests { let redis_flags = FeatureFlagList::from_redis(redis_client, team.id) .await .expect("Failed to fetch flags from Redis"); - let pg_flags = FeatureFlagList::from_pg(postgres_reader, team.id) + let pg_flags = FeatureFlagList::from_pg(reader, team.id) .await .expect("Failed to fetch flags from Postgres"); @@ -1271,9 +1269,9 @@ mod tests { #[tokio::test] async fn test_consistent_behavior_from_both_clients() { let redis_client = setup_redis_client(None); - let postgres_reader = setup_pg_reader_client(None).await; + let reader = setup_pg_reader_client(None).await; - let team = insert_new_team_in_pg(postgres_reader.clone(), None) + let team = insert_new_team_in_pg(reader.clone(), None) .await .expect("Failed to insert team in pg"); @@ -1305,7 +1303,7 @@ mod tests { for flag in flags.as_array().unwrap() { insert_flag_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, Some(FeatureFlagRow { id: 0, @@ -1326,7 +1324,7 @@ mod tests { let mut redis_flags = FeatureFlagList::from_redis(redis_client, team.id) .await .expect("Failed to fetch flags from Redis"); - let mut pg_flags = FeatureFlagList::from_pg(postgres_reader, team.id) + let mut pg_flags = FeatureFlagList::from_pg(reader, team.id) .await .expect("Failed to fetch flags from Postgres"); @@ -1370,9 +1368,9 @@ mod tests { #[tokio::test] async fn test_rollout_percentage_edge_cases() { let redis_client = setup_redis_client(None); - let postgres_reader = setup_pg_reader_client(None).await; + let reader = setup_pg_reader_client(None).await; - let team = insert_new_team_in_pg(postgres_reader.clone(), None) + let team = insert_new_team_in_pg(reader.clone(), None) .await .expect("Failed to insert team in pg"); @@ -1413,7 +1411,7 @@ mod tests { for flag in flags.as_array().unwrap() { insert_flag_for_team_in_pg( - postgres_reader.clone(), + reader.clone(), team.id, Some(FeatureFlagRow { id: 0, @@ -1434,7 +1432,7 @@ mod tests { let redis_flags = FeatureFlagList::from_redis(redis_client, team.id) .await .expect("Failed to fetch flags from Redis"); - let pg_flags = FeatureFlagList::from_pg(postgres_reader, team.id) + let pg_flags = FeatureFlagList::from_pg(reader, team.id) .await .expect("Failed to fetch flags from Postgres"); diff --git a/rust/feature-flags/src/flags/flag_request.rs b/rust/feature-flags/src/flags/flag_request.rs index 89890505c6c4b..cab455e13bbbc 100644 --- a/rust/feature-flags/src/flags/flag_request.rs +++ b/rust/feature-flags/src/flags/flag_request.rs @@ -10,7 +10,11 @@ use crate::{ api::errors::FlagError, client::{database::Client as DatabaseClient, redis::Client as RedisClient}, flags::flag_models::FeatureFlagList, - metrics::metrics_consts::FLAG_CACHE_HIT_COUNTER, + metrics::metrics_consts::{ + DB_FLAG_READS_COUNTER, DB_TEAM_READS_COUNTER, FLAG_CACHE_ERRORS_COUNTER, + FLAG_CACHE_HIT_COUNTER, TEAM_CACHE_ERRORS_COUNTER, TEAM_CACHE_HIT_COUNTER, + TOKEN_VALIDATION_ERRORS_COUNTER, + }, team::team_models::Team, }; @@ -83,23 +87,50 @@ impl FlagRequest { _ => return Err(FlagError::NoTokenError), }; - match Team::from_redis(redis_client.clone(), token.clone()).await { - Ok(_) => Ok(token), + let (result, cache_hit) = match Team::from_redis(redis_client.clone(), token.clone()).await + { + Ok(_) => (Ok(token.clone()), true), Err(_) => { - // Fallback: Check PostgreSQL if not found in Redis match Team::from_pg(pg_client, token.clone()).await { Ok(team) => { + inc( + DB_TEAM_READS_COUNTER, + &[("token".to_string(), token.clone())], + 1, + ); // Token found in PostgreSQL, update Redis cache so that we can verify it from Redis next time if let Err(e) = Team::update_redis_cache(redis_client, &team).await { tracing::warn!("Failed to update Redis cache: {}", e); + inc( + TEAM_CACHE_ERRORS_COUNTER, + &[("reason".to_string(), "redis_update_failed".to_string())], + 1, + ); } - Ok(token) + (Ok(token.clone()), false) + } + Err(_) => { + inc( + TOKEN_VALIDATION_ERRORS_COUNTER, + &[("reason".to_string(), "token_not_found".to_string())], + 1, + ); + (Err(FlagError::TokenValidationError), false) } - // TODO do we need a custom error here to track the fallback - Err(_) => Err(FlagError::TokenValidationError), } } - } + }; + + inc( + TEAM_CACHE_HIT_COUNTER, + &[ + ("token".to_string(), token.clone()), + ("cache_hit".to_string(), cache_hit.to_string()), + ], + 1, + ); + + result } /// Fetches the team from the cache or the database. @@ -111,22 +142,42 @@ impl FlagRequest { redis_client: Arc, pg_client: Arc, ) -> Result { - match Team::from_redis(redis_client.clone(), token.to_owned()).await { - Ok(team) => Ok(team), - Err(_) => match Team::from_pg(pg_client, token.to_owned()).await { - Ok(team) => { - // If we have the team in postgres, but not redis, update redis so we're faster next time - // TODO: we have some counters in django for tracking these cache misses - // we should probably do the same here - if let Err(e) = Team::update_redis_cache(redis_client, &team).await { - tracing::warn!("Failed to update Redis cache: {}", e); + let (team_result, cache_hit) = + match Team::from_redis(redis_client.clone(), token.to_owned()).await { + Ok(team) => (Ok(team), true), + Err(_) => match Team::from_pg(pg_client, token.to_owned()).await { + Ok(team) => { + inc( + DB_TEAM_READS_COUNTER, + &[("token".to_string(), token.to_string())], + 1, + ); + // If we have the team in postgres, but not redis, update redis so we're faster next time + if let Err(e) = Team::update_redis_cache(redis_client, &team).await { + tracing::warn!("Failed to update Redis cache: {}", e); + inc( + TEAM_CACHE_ERRORS_COUNTER, + &[("reason".to_string(), "redis_update_failed".to_string())], + 1, + ); + } + (Ok(team), false) } - Ok(team) - } - // TODO what kind of error should we return here? - Err(e) => Err(e), - }, - } + // TODO what kind of error should we return here? + Err(e) => (Err(e), false), + }, + }; + + inc( + TEAM_CACHE_HIT_COUNTER, + &[ + ("token".to_string(), token.to_string()), + ("cache_hit".to_string(), cache_hit.to_string()), + ], + 1, + ); + + team_result } /// Extracts the distinct_id from the request. @@ -164,31 +215,37 @@ impl FlagRequest { redis_client: &Arc, pg_client: &Arc, ) -> Result { - let mut cache_hit = false; - let flags = match FeatureFlagList::from_redis(redis_client.clone(), team_id).await { - Ok(flags) => { - cache_hit = true; - Ok(flags) - } - Err(_) => match FeatureFlagList::from_pg(pg_client.clone(), team_id).await { - Ok(flags) => { - if let Err(e) = FeatureFlagList::update_flags_in_redis( - redis_client.clone(), - team_id, - &flags, - ) - .await - { - tracing::warn!("Failed to update Redis cache: {}", e); - // TODO add new metric category for this + let (flags_result, cache_hit) = + match FeatureFlagList::from_redis(redis_client.clone(), team_id).await { + Ok(flags) => (Ok(flags), true), + Err(_) => match FeatureFlagList::from_pg(pg_client.clone(), team_id).await { + Ok(flags) => { + inc( + DB_FLAG_READS_COUNTER, + &[("team_id".to_string(), team_id.to_string())], + 1, + ); + if let Err(e) = FeatureFlagList::update_flags_in_redis( + redis_client.clone(), + team_id, + &flags, + ) + .await + { + tracing::warn!("Failed to update Redis cache: {}", e); + inc( + FLAG_CACHE_ERRORS_COUNTER, + &[("reason".to_string(), "redis_update_failed".to_string())], + 1, + ); + } + (Ok(flags), false) } - Ok(flags) - } - // TODO what kind of error should we return here? This should be postgres - // I guess it can be whatever the FlagError is - Err(e) => Err(e), - }, - }; + // TODO what kind of error should we return here? This should be postgres + // I guess it can be whatever the FlagError is + Err(e) => (Err(e), false), + }, + }; inc( FLAG_CACHE_HIT_COUNTER, @@ -199,7 +256,7 @@ impl FlagRequest { 1, ); - flags + flags_result } } diff --git a/rust/feature-flags/src/metrics/metrics_consts.rs b/rust/feature-flags/src/metrics/metrics_consts.rs index 5ece796159739..477b88175eb6b 100644 --- a/rust/feature-flags/src/metrics/metrics_consts.rs +++ b/rust/feature-flags/src/metrics/metrics_consts.rs @@ -1,5 +1,26 @@ pub const FLAG_EVALUATION_ERROR_COUNTER: &str = "flag_evaluation_error_total"; pub const FLAG_CACHE_HIT_COUNTER: &str = "flag_cache_hit_total"; +pub const FLAG_CACHE_ERRORS_COUNTER: &str = "flag_cache_errors_total"; pub const FLAG_HASH_KEY_WRITES_COUNTER: &str = "flag_hash_key_writes_total"; -// TODO add metrics for failing to update redis? Does that really happen? -// maybe worth adding for rollout, since writing to redis is a critical path thing +pub const TEAM_CACHE_HIT_COUNTER: &str = "team_cache_hit_total"; +pub const TEAM_CACHE_ERRORS_COUNTER: &str = "team_cache_errors_total"; +pub const DB_TEAM_READS_COUNTER: &str = "db_team_reads_total"; +pub const TOKEN_VALIDATION_ERRORS_COUNTER: &str = "token_validation_errors_total"; +pub const DB_FLAG_READS_COUNTER: &str = "db_flag_reads_total"; +pub const DB_FLAG_ERRORS_COUNTER: &str = "db_flag_errors_total"; +pub const DB_COHORT_READS_COUNTER: &str = "db_cohort_reads_total"; +pub const DB_COHORT_WRITES_COUNTER: &str = "db_cohort_writes_total"; +pub const DB_COHORT_ERRORS_COUNTER: &str = "db_cohort_errors_total"; +pub const COHORT_CACHE_HIT_COUNTER: &str = "cohort_cache_hit_total"; +pub const COHORT_CACHE_MISS_COUNTER: &str = "cohort_cache_miss_total"; +pub const COHORT_CACHE_ERRORS_COUNTER: &str = "cohort_cache_errors_total"; +pub const GROUP_TYPE_CACHE_HIT_COUNTER: &str = "group_type_cache_hit_total"; +pub const GROUP_TYPE_CACHE_MISS_COUNTER: &str = "group_type_cache_miss_total"; +pub const GROUP_TYPE_CACHE_ERRORS_COUNTER: &str = "group_type_cache_errors_total"; +pub const FAILED_TO_FETCH_GROUP_COUNTER: &str = "failed_to_fetch_group_total"; +pub const PROPERTY_CACHE_HITS_COUNTER: &str = "property_cache_hits_total"; +pub const PROPERTY_CACHE_MISSES_COUNTER: &str = "property_cache_misses_total"; +pub const DB_PERSON_AND_GROUP_PROPERTIES_READS_COUNTER: &str = + "db_person_and_group_properties_reads_total"; +pub const DB_PERSON_PROPERTIES_READS_COUNTER: &str = "db_person_properties_reads_total"; +pub const DB_GROUP_PROPERTIES_READS_COUNTER: &str = "db_group_properties_reads_total"; diff --git a/rust/feature-flags/src/router.rs b/rust/feature-flags/src/router.rs index 46706586a07e6..107ba8ff50bb2 100644 --- a/rust/feature-flags/src/router.rs +++ b/rust/feature-flags/src/router.rs @@ -21,17 +21,17 @@ use crate::{ #[derive(Clone)] pub struct State { pub redis: Arc, - pub postgres_reader: Arc, - pub postgres_writer: Arc, - pub cohort_cache: Arc, // TODO does this need a better name than just `cohort_cache`? + pub reader: Arc, + pub writer: Arc, + pub cohort_cache_manager: Arc, pub geoip: Arc, pub team_ids_to_track: TeamIdsToTrack, } pub fn router( redis: Arc, - postgres_reader: Arc, - postgres_writer: Arc, + reader: Arc, + writer: Arc, cohort_cache: Arc, geoip: Arc, liveness: HealthRegistry, @@ -43,9 +43,9 @@ where { let state = State { redis, - postgres_reader, - postgres_writer, - cohort_cache, + reader, + writer, + cohort_cache_manager: cohort_cache, geoip, team_ids_to_track: config.team_ids_to_track.clone(), }; diff --git a/rust/feature-flags/src/server.rs b/rust/feature-flags/src/server.rs index 12a79b4f1b499..10f64960cd4f9 100644 --- a/rust/feature-flags/src/server.rs +++ b/rust/feature-flags/src/server.rs @@ -27,8 +27,7 @@ where // TODO - we should have a dedicated URL for both this and the writer – the reader will read // from the replica, and the writer will write to the main database. - let postgres_reader = match get_pool(&config.read_database_url, config.max_pg_connections).await - { + let reader = match get_pool(&config.read_database_url, config.max_pg_connections).await { Ok(client) => Arc::new(client), Err(e) => { tracing::error!("Failed to create read Postgres client: {}", e); @@ -36,7 +35,7 @@ where } }; - let postgres_writer = + let writer = // TODO - we should have a dedicated URL for both this and the reader – the reader will read // from the replica, and the writer will write to the main database. match get_pool(&config.write_database_url, config.max_pg_connections).await { @@ -55,7 +54,11 @@ where } }; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); + let cohort_cache = Arc::new(CohortCacheManager::new( + reader.clone(), + Some(config.cache_max_cohort_entries), + Some(config.cache_ttl_seconds), + )); let health = HealthRegistry::new("liveness"); @@ -68,8 +71,8 @@ where // You can decide which client to pass to the router, or pass both if needed let app = router::router( redis_client, - postgres_reader, - postgres_writer, + reader, + writer, cohort_cache, geoip_service, health, diff --git a/rust/feature-flags/src/team/team_models.rs b/rust/feature-flags/src/team/team_models.rs index 2922382561852..a063dec53b012 100644 --- a/rust/feature-flags/src/team/team_models.rs +++ b/rust/feature-flags/src/team/team_models.rs @@ -9,6 +9,12 @@ pub struct Team { pub id: i32, pub name: String, pub api_token: String, + /// Project ID. This field is not present in Redis cache before Dec 2025, but this is not a problem at all, + /// because we know all Teams created before Dec 2025 have `project_id` = `id`. To handle this case gracefully, + /// we use 0 as a fallback value in deserialization here, and handle this in `Team::from_redis`. + /// Thanks to this default-base approach, we avoid invalidating the whole cache needlessly. + #[serde(default)] + pub project_id: i64, // TODO: the following fields are used for the `/decide` response, // but they're not used for flags and they don't live in redis. // At some point I'll need to differentiate between teams in Redis and teams diff --git a/rust/feature-flags/src/team/team_operations.rs b/rust/feature-flags/src/team/team_operations.rs index 4f9b706153cef..690722462fc31 100644 --- a/rust/feature-flags/src/team/team_operations.rs +++ b/rust/feature-flags/src/team/team_operations.rs @@ -21,10 +21,14 @@ impl Team { .await?; // TODO: Consider an LRU cache for teams as well, with small TTL to skip redis/pg lookups - let team: Team = serde_json::from_str(&serialized_team).map_err(|e| { + let mut team: Team = serde_json::from_str(&serialized_team).map_err(|e| { tracing::error!("failed to parse data to team: {}", e); FlagError::RedisDataParsingError })?; + if team.project_id == 0 { + // If `project_id` is 0, this means the payload is from before December 2025, which we correct for here + team.project_id = team.id as i64; + } Ok(team) } @@ -59,7 +63,7 @@ impl Team { ) -> Result { let mut conn = client.get_connection().await?; - let query = "SELECT id, name, api_token FROM posthog_team WHERE api_token = $1"; + let query = "SELECT id, name, api_token, project_id FROM posthog_team WHERE api_token = $1"; let row = sqlx::query_as::<_, Team>(query) .bind(&token) .fetch_one(&mut *conn) @@ -95,6 +99,7 @@ mod tests { .unwrap(); assert_eq!(team_from_redis.api_token, target_token); assert_eq!(team_from_redis.id, team.id); + assert_eq!(team_from_redis.project_id, team.project_id); } #[tokio::test] @@ -120,10 +125,11 @@ mod tests { #[tokio::test] async fn test_corrupted_data_in_redis_is_handled() { // TODO: Extend this test with fallback to pg - let id = rand::thread_rng().gen_range(0..10_000_000); + let id = rand::thread_rng().gen_range(1..10_000_000); let token = random_string("phc_", 12); let team = Team { id, + project_id: i64::from(id) - 1, name: "team".to_string(), api_token: token, }; @@ -153,6 +159,32 @@ mod tests { }; } + #[tokio::test] + async fn test_fetch_team_from_before_project_id_from_redis() { + let client = setup_redis_client(None); + let target_token = "phc_123456789012".to_string(); + // A payload form before December 2025, it's missing `project_id` + let serialized_team = format!( + "{{\"id\":343,\"name\":\"team\",\"api_token\":\"{}\"}}", + target_token + ); + client + .set( + format!("{}{}", TEAM_TOKEN_CACHE_PREFIX, target_token), + serialized_team, + ) + .await + .expect("Failed to write data to redis"); + + let team_from_redis = Team::from_redis(client.clone(), target_token.clone()) + .await + .expect("Failed to fetch team from redis"); + + assert_eq!(team_from_redis.api_token, target_token); + assert_eq!(team_from_redis.id, 343); + assert_eq!(team_from_redis.project_id, 343); // Same as `id` + } + #[tokio::test] async fn test_fetch_team_from_pg() { let client = setup_pg_reader_client(None).await; diff --git a/rust/feature-flags/src/utils/test_utils.rs b/rust/feature-flags/src/utils/test_utils.rs index ad108d0802301..1c6cf2b1caafe 100644 --- a/rust/feature-flags/src/utils/test_utils.rs +++ b/rust/feature-flags/src/utils/test_utils.rs @@ -29,10 +29,11 @@ pub fn random_string(prefix: &str, length: usize) -> String { pub async fn insert_new_team_in_redis( client: Arc, ) -> Result { - let id = rand::thread_rng().gen_range(0..10_000_000); + let id = rand::thread_rng().gen_range(1..10_000_000); let token = random_string("phc_", 12); let team = Team { id, + project_id: i64::from(id) - 1, name: "team".to_string(), api_token: token, }; @@ -206,6 +207,7 @@ pub async fn insert_new_team_in_pg( let token = random_string("phc_", 12); let team = Team { id, + project_id: id as i64, name: "team".to_string(), api_token: token, }; @@ -228,8 +230,8 @@ pub async fn insert_new_team_in_pg( let res = sqlx::query( r#"INSERT INTO posthog_team (id, uuid, organization_id, project_id, api_token, name, created_at, updated_at, app_urls, anonymize_ips, completed_snippet_onboarding, ingested_event, session_recording_opt_in, is_demo, access_control, test_account_filters, timezone, data_attributes, plugins_opt_in, opt_out_capture, event_names, event_names_with_usage, event_properties, event_properties_with_usage, event_properties_numerical) VALUES - ($1, $5, $2::uuid, $1, $3, $4, '2024-06-17 14:40:51.332036+00:00', '2024-06-17', '{}', false, false, false, false, false, false, '{}', 'UTC', '["data-attr"]', false, false, '[]', '[]', '[]', '[]', '[]')"# - ).bind(team.id).bind(ORG_ID).bind(&team.api_token).bind(&team.name).bind(uuid).execute(&mut *conn).await?; + ($1, $2, $3::uuid, $4, $5, $6, '2024-06-17 14:40:51.332036+00:00', '2024-06-17', '{}', false, false, false, false, false, false, '{}', 'UTC', '["data-attr"]', false, false, '[]', '[]', '[]', '[]', '[]')"# + ).bind(team.id).bind(uuid).bind(ORG_ID).bind(team.project_id).bind(&team.api_token).bind(&team.name).execute(&mut *conn).await?; assert_eq!(res.rows_affected(), 1); // Insert group type mappings @@ -246,11 +248,12 @@ pub async fn insert_new_team_in_pg( r#"INSERT INTO posthog_grouptypemapping (group_type, group_type_index, name_singular, name_plural, team_id, project_id) VALUES - ($1, $2, NULL, NULL, $3, $3)"#, + ($1, $2, NULL, NULL, $3, $4)"#, ) .bind(group_type) .bind(group_type_index) .bind(team.id) + .bind(team.project_id) .execute(&mut *conn) .await?; assert_eq!(res.rows_affected(), 1); diff --git a/rust/feature-flags/tests/test_flag_matching_consistency.rs b/rust/feature-flags/tests/test_flag_matching_consistency.rs index c31ac2094ad68..8d61e6d5fb23e 100644 --- a/rust/feature-flags/tests/test_flag_matching_consistency.rs +++ b/rust/feature-flags/tests/test_flag_matching_consistency.rs @@ -112,24 +112,17 @@ async fn it_is_consistent_with_rollout_calculation_for_simple_flags() { ]; for (i, result) in results.iter().enumerate().take(1000) { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); let distinct_id = format!("distinct_id_{}", i); - let feature_flag_match = FeatureFlagMatcher::new( - distinct_id, - 1, - postgres_reader, - postgres_writer, - cohort_cache, - None, - None, - ) - .get_match(&flags[0], None, None) - .await - .unwrap(); + let feature_flag_match = + FeatureFlagMatcher::new(distinct_id, 1, reader, writer, cohort_cache, None, None) + .get_match(&flags[0], None, None) + .await + .unwrap(); if *result { assert_eq!( @@ -1212,23 +1205,16 @@ async fn it_is_consistent_with_rollout_calculation_for_multivariate_flags() { ]; for (i, result) in results.iter().enumerate().take(1000) { - let postgres_reader = setup_pg_reader_client(None).await; - let postgres_writer = setup_pg_writer_client(None).await; - let cohort_cache = Arc::new(CohortCacheManager::new(postgres_reader.clone(), None, None)); + let reader = setup_pg_reader_client(None).await; + let writer = setup_pg_writer_client(None).await; + let cohort_cache = Arc::new(CohortCacheManager::new(reader.clone(), None, None)); let distinct_id = format!("distinct_id_{}", i); - let feature_flag_match = FeatureFlagMatcher::new( - distinct_id, - 1, - postgres_reader, - postgres_writer, - cohort_cache, - None, - None, - ) - .get_match(&flags[0], None, None) - .await - .unwrap(); + let feature_flag_match = + FeatureFlagMatcher::new(distinct_id, 1, reader, writer, cohort_cache, None, None) + .get_match(&flags[0], None, None) + .await + .unwrap(); if let Some(variant) = &result { assert_eq!( diff --git a/tailwind.config.js b/tailwind.config.js index c6eac5bf2e52e..fe0262567e3ee 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -52,9 +52,9 @@ const config = { }, borderRadius: { none: '0', - sm: '0.25rem', // Originally 0.125rem, but we're rounder - DEFAULT: '0.375rem', // Originally 0.25rem, but we're rounder - aligned with var(--radius) - lg: '0.5rem', + sm: 'var(--radius-sm)', + DEFAULT: 'var(--radius)', + lg: 'var(--radius-lg)', full: '9999px', }, extend: {