@opensumi/cli-engine 3.8.3-next-1745295840.0 → 3.8.3-next-1745307078.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/browser.js +1 -1
- package/package.json +10 -10
package/lib/browser/browser.js
CHANGED
|
@@ -31630,7 +31630,7 @@ Tokenizing line: ${O}`);for(let W=0;W<B.tokens.length;W++){const U=B.tokens[W];j
|
|
|
31630
31630
|
|
|
31631
31631
|
`),this}appendMarkdown(s){return this.value+=s,this}appendCodeblock(s,g){return this.value+="\n```",this.value+=s,this.value+=`
|
|
31632
31632
|
`,this.value+=g,this.value+="\n```\n",this}}t.MarkdownString=p;function v(_){return _ instanceof p?!0:_&&typeof _=="object"?typeof _.value=="string"&&(typeof _.isTrusted=="boolean"||_.isTrusted===void 0)&&(typeof _.supportThemeIcons=="boolean"||_.supportThemeIcons===void 0):!1}function m(_){const s=[],g=_.split("|").map(h=>h.trim());_=g[0];const a=g[1];if(a){const h=/height=(\d+)/.exec(a),u=/width=(\d+)/.exec(a),d=h?h[1]:"",E=u?u[1]:"",f=isFinite(parseInt(E,10)),l=isFinite(parseInt(d,10));f&&s.push(`width="${E}"`),l&&s.push(`height="${d}"`)}return{href:_,dimensions:s}}},53886:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(84811),t),n.__exportStar(e(38677),t),n.__exportStar(e(32112),t),n.__exportStar(e(58063),t),n.__exportStar(e(3484),t),n.__exportStar(e(84569),t),n.__exportStar(e(92771),t),n.__exportStar(e(87330),t),n.__exportStar(e(37070),t),n.__exportStar(e(32504),t),n.__exportStar(e(78941),t),n.__exportStar(e(69403),t)},32112:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},69403:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OverviewRulerLane=void 0;var e;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(e||(t.OverviewRulerLane=e={}))},58063:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3484:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},92771:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},51418:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},73294:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},50288:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},37846:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.knownProtocols=void 0;const n=e(11431),r=e(46147);t.knownProtocols=new Map,t.knownProtocols.set(r.ExtHostAPIIdentifier.ExtHostDocuments,n.ExtensionDocumentProtocol)},35250:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectIdentifier=void 0;var e;(function(n){n.name="$ident";function r(c,p){return Object.defineProperty(c,n.name,{value:p,enumerable:!0}),c}n.mixin=r;function o(c){return c[n.name]}n.of=o})(e||(t.ObjectIdentifier=e={}))},16363:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},70858:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isLittleEndian=p,t.encodeSemanticTokensDto=v,t.decodeSemanticTokensDto=_;function e(s){for(let g=0,a=s.length;g<a;g+=4){const h=s[g+0],u=s[g+1],d=s[g+2],E=s[g+3];s[g+0]=E,s[g+1]=d,s[g+2]=u,s[g+3]=h}}function n(s){const g=new Uint8Array(s.buffer,s.byteOffset,s.length*4);return p()||e(g),g}function r(s){const g=s;if(p()||e(g),g.byteOffset%4===0)return new Uint32Array(g.buffer,g.byteOffset,g.length/4);{const a=new Uint8Array(g.byteLength);return a.set(g),new Uint32Array(a.buffer,a.byteOffset,a.length/4)}}let o=!0,c=!1;function p(){if(!c){c=!0;const s=new Uint8Array(2);s[0]=1,s[1]=2,o=new Uint16Array(s.buffer)[0]===513}return o}function v(s){const g=new Uint32Array(m(s));let a=0;if(g[a++]=s.id,s.type==="full")g[a++]=1,g[a++]=s.data.length,g.set(s.data,a),a+=s.data.length;else{g[a++]=2,g[a++]=s.deltas.length;for(const h of s.deltas)g[a++]=h.start,g[a++]=h.deleteCount,h.data?(g[a++]=h.data.length,g.set(h.data,a),a+=h.data.length):g[a++]=0}return n(g)}function m(s){let g=0;if(g+=2,s.type==="full")g+=1+s.data.length;else{g+=1,g+=3*s.deltas.length;for(const a of s.deltas)a.data&&(g+=a.data.length)}return g}function _(s){const g=r(s);let a=0;const h=g[a++];if(g[a++]===1){const f=g[a++],l=g.subarray(a,a+f);return a+=f,{id:h,type:"full",data:l}}const d=g[a++],E=[];for(let f=0;f<d;f++){const l=g[a++],b=g[a++],y=g[a++];let A;y>0&&(A=g.subarray(a,a+y),a+=y),E[f]={start:l,deleteCount:b,data:A}}return{id:h,type:"delta",deltas:E}}},29490:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},89225:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.startsWith=e,t.endsWith=n,t.isLowerAsciiLetter=r,t.isUpperAsciiLetter=o,t.equalsIgnoreCase=p,t.escapeRegExpCharacters=m,t.startsWithIgnoreCase=_;function e(s,g){if(s.length<g.length)return!1;if(s===g)return!0;for(let a=0;a<g.length;a++)if(s[a]!==g[a])return!1;return!0}function n(s,g){const a=s.length-g.length;return a>0?s.indexOf(g,a)===a:a===0?s===g:!1}function r(s){return s>=97&&s<=122}function o(s){return s>=65&&s<=90}function c(s){return r(s)||o(s)}function p(s,g){const a=s?s.length:0,h=g?g.length:0;return a!==h?!1:v(s,g)}function v(s,g,a=s.length){if(typeof s!="string"||typeof g!="string")return!1;for(let h=0;h<a;h++){const u=s.charCodeAt(h),d=g.charCodeAt(h);if(u!==d){if(c(u)&&c(d)){const E=Math.abs(u-d);if(E!==0&&E!==32)return!1}else if(String.fromCharCode(u).toLowerCase()!==String.fromCharCode(d).toLowerCase())return!1}}return!0}function m(s){return s.replace(/[-\\{}*+?|^$.[\]()#]/g,"\\$&")}function _(s,g){const a=g.length;return g.length>s.length?!1:v(s,g,a)}},54741:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskFilterDTO=void 0;var e;(function(n){function r(c){return c}n.from=r;function o(c){if(c)return Object.assign(Object.create(null),c)}n.to=o})(e||(t.TaskFilterDTO=e={}))},25535:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},54056:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestItemRootImpl=t.TestItemImpl=t.MixedTestItemController=t.InvalidTestItemError=t.DuplicateTestItemError=t.diffTestItems=t.getPrivateApiFor=t.createPrivateApiFor=void 0;const e=new WeakMap,n=(E,f)=>{const l={controllerId:f};return e.set(E,l),l};t.createPrivateApiFor=n;const r=E=>e.get(E);t.getPrivateApiFor=r;const o=(E,f,l,b)=>{let y=l;return{enumerable:!0,configurable:!1,get(){return y},set(A){var S;if(!b(y,A)){const w=y;y=A,(S=E.listener)===null||S===void 0||S.call(E,{op:3,key:f,value:A,previous:w})}}}},c=(E,f)=>E===f,p={range:(E,f)=>E===f?!0:!E||!f?!1:E.isEqual(f),label:c,description:c,sortText:c,busy:c,error:c,canResolveChildren:c,tags:(E,f)=>!(E.length!==f.length||E.some(l=>!f.find(b=>l.id===b.id)))},v=Object.keys(p),m=(E,f)=>({range:o(E,"range",void 0,p.range),label:o(E,"label",f,p.label),description:o(E,"description",void 0,p.description),sortText:o(E,"sortText",void 0,p.sortText),canResolveChildren:o(E,"canResolveChildren",!1,p.canResolveChildren),busy:o(E,"busy",!1,p.busy),error:o(E,"error",void 0,p.error),tags:o(E,"tags",[],p.tags)}),_=(E,f)=>{const l=new Map;for(const b of v){const y=p[b];y(E[b],f[b])||l.set(b,f[b])}return l};t.diffTestItems=_;class s extends Error{constructor(f){super(`Attempted to insert a duplicate test item ID ${f}`)}}t.DuplicateTestItemError=s;class g extends Error{constructor(f){super(`TestItem with ID "${f}" is invalid. Make sure to create it from the createTestItem method.`)}}t.InvalidTestItemError=g;class a extends Error{constructor(f,l,b){super(`TestItem with ID "${f}" is from controller "${l}" and cannot be added as a child of an item from controller "${b}".`)}}t.MixedTestItemController=a;const h=E=>{const f=(0,t.getPrivateApiFor)(E);let l=new Map;return{get size(){return l.size},forEach(b,y){for(const A of l.values())b.call(y,A,this)},replace(b){var y;const A=new Map,S=new Set(l.keys()),w={op:4,ops:[]};for(const T of b){if(!(T instanceof u))throw new g(T.id);const D=(0,t.getPrivateApiFor)(T).controllerId;if(D!==f.controllerId)throw new a(T.id,D,f.controllerId);if(A.has(T.id))throw new s(T.id);A.set(T.id,T),S.delete(T.id),w.ops.push({op:0,item:T})}for(const T of S.keys())w.ops.push({op:1,id:T});(y=f.listener)===null||y===void 0||y.call(f,w),l=A},add(b){var y;if(!(b instanceof u))throw new g(b.id);l.set(b.id,b),(y=f.listener)===null||y===void 0||y.call(f,{op:0,item:b})},delete(b){var y;l.delete(b)&&((y=f.listener)===null||y===void 0||y.call(f,{op:1,id:b}))},get(b){return l.get(b)},toJSON(){return Array.from(l.values())},[Symbol.iterator](){return l.values()}}};class u{constructor(f,l,b,y){if(l.includes("\0"))throw new Error(`Test IDs may not include the ${JSON.stringify(l)} symbol`);const A=(0,t.createPrivateApiFor)(this,f);Object.defineProperties(this,{id:{value:l,enumerable:!0,writable:!1},uri:{value:y,enumerable:!0,writable:!1},parent:{enumerable:!1,get(){return A.parent instanceof d?void 0:A.parent}},children:{value:h(this),enumerable:!0,writable:!1},...m(A,b)})}invalidateResults(){var f,l;(l=(f=(0,t.getPrivateApiFor)(this)).listener)===null||l===void 0||l.call(f,{op:2})}}t.TestItemImpl=u;class d extends u{constructor(f,l){super(f,f,l,void 0)}}t.TestItemRootImpl=d},82086:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4809:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},86162:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TreeviewsService=t.ITreeViewsService=t.TreeViewSelection=t.TreeViewItem=t.TreeItemCheckboxState=void 0;var e;(function(c){c[c.Unchecked=0]="Unchecked",c[c.Checked=1]="Checked"})(e||(t.TreeItemCheckboxState=e={}));class n{}t.TreeViewItem=n;var r;(function(c){function p(v){return!!v&&typeof v=="object"&&"treeViewId"in v&&"treeItemId"in v}c.is=p})(r||(t.TreeViewSelection=r={})),t.ITreeViewsService=Symbol("ITreeViewsService");class o{constructor(){this._dragOperations=new Map,this._renderedElements=new Map}removeDragOperationTransfer(p){if(p&&this._dragOperations.has(p)){const v=this._dragOperations.get(p);return this._dragOperations.delete(p),v}}addDragOperationTransfer(p,v){this._dragOperations.set(p,v)}getRenderedTreeElement(p){if(this._renderedElements.has(p))return this._renderedElements.get(p)}addRenderedTreeItemElement(p,v){this._renderedElements.set(p,v)}removeRenderedTreeItemElement(p){this._renderedElements.has(p)&&this._renderedElements.delete(p)}}t.TreeviewsService=o},64945:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43710:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=o,t.mixin=c,t.illegalArgument=p,t.isLocationArray=v,t.isDefinitionLinkArray=m,t.reviveRegExp=_,t.reviveIndentationRule=s,t.reviveOnEnterRule=g,t.reviveOnEnterRules=a,t.serializeEnterRules=h,t.serializeRegExp=u,t.serializeIndentation=d,t.serializeAutoClosingPairs=E;const r=e(85608).__importStar(e(51328));function o(f){return typeof f=="object"&&f!==null&&!Array.isArray(f)&&!(f instanceof RegExp)&&!(f instanceof Date)}function c(f,l,b=!0){return o(f)?(o(l)&&Object.keys(l).forEach(y=>{y in f?b&&(o(f[y])&&o(l[y])?c(f[y],l[y],b):f[y]=l[y]):f[y]=l[y]}),f):l}function p(f){return f?new Error(`Illegal argument: ${f}`):new Error("Illegal argument")}function v(f){return Array.isArray(f)&&f.length>0&&f[0]instanceof r.Location}function m(f){return Array.isArray(f)&&f.length>0&&f[0].hasOwnProperty("targetUri")&&f[0].hasOwnProperty("targetRange")}function _(f){if(!(typeof f>"u"||f===null))return new RegExp(f.pattern,f.flags)}function s(f){if(!(typeof f>"u"||f===null))return{increaseIndentPattern:_(f.increaseIndentPattern),decreaseIndentPattern:_(f.decreaseIndentPattern),indentNextLinePattern:_(f.indentNextLinePattern),unIndentedLinePattern:_(f.unIndentedLinePattern)}}function g(f){return{beforeText:_(f.beforeText),afterText:_(f.afterText),action:f.action,previousLineText:_(f.previousLineText)}}function a(f){if(!(typeof f>"u"||f===null))return f.map(g)}function h(f){if(!(typeof f>"u"||f===null))return f.map(l=>({action:l.action,beforeText:u(l.beforeText),afterText:u(l.afterText),previousLineText:u(l.previousLineText)}))}function u(f){if(!(typeof f>"u"||f===null))return{pattern:f.source,flags:(f.global?"g":"")+(f.ignoreCase?"i":"")+(f.multiline?"m":"")}}function d(f){if(!(typeof f>"u"||f===null))return{increaseIndentPattern:u(f.increaseIndentPattern),decreaseIndentPattern:u(f.decreaseIndentPattern),indentNextLinePattern:u(f.indentNextLinePattern),unIndentedLinePattern:u(f.unIndentedLinePattern)}}function E(f){if(f)return f.map(l=>({open:l.open,close:l.close,notIn:l.notIn?l.notIn.map(b=>r.SyntaxTokenType.toString(b)):void 0}))}},96833:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},98116:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebviewViewResolverRegistrationRemovalEvent=t.WebviewViewResolverRegistrationEvent=void 0;const n=e(43718);class r extends n.BasicEvent{}t.WebviewViewResolverRegistrationEvent=r;class o extends n.BasicEvent{}t.WebviewViewResolverRegistrationRemovalEvent=o},55467:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},92622:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationTarget=void 0,t.reviveWorkspaceEditDto=o;const n=e(43718);var r;(function(c){c[c.Global=1]="Global",c[c.Workspace=2]="Workspace",c[c.WorkspaceFolder=3]="WorkspaceFolder"})(r||(t.ConfigurationTarget=r={}));function o(c){if(c&&c.edits)for(const p of c.edits)if(typeof p.resource=="object")p.resource=n.URI.from(p.resource),p.options={openDirtyInEditor:!0},p.textEdit=p.textEdit,p.versionId=p.versionId;else{const v=p;v.newResource=p.newResource?n.URI.from(p.newResource):void 0,v.oldResource=p.oldResource?n.URI.from(p.oldResource):void 0,v.options={...v.options,showInEditor:!1}}return c}},57646:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BinaryEditorComponent=void 0;const r=e(85608).__importDefault(e(14041)),o=e(76003),c=e(41869),p=e(37406),v=e(57517),m=e(88819),_=s=>{const g=s.resource.uri.codeUri.fsPath,a=(0,c.useInjectable)(o.INJECTOR_TOKEN),h=(0,c.useInjectable)(c.AppConfig),u=(0,c.useInjectable)(v.WorkbenchEditorService),d=(0,c.useInjectable)(c.IEventBus),E=()=>{const l=u.currentResource;l&&(l.metadata={...l.metadata,skipPreventBinary:!0},d.fire(new v.ResourceOpenTypeChangedEvent(l.uri)))},f=[{label:(0,c.localize)("editor.file.prevent.stillOpen"),onClick:()=>E()}];return h.isElectronRenderer&&f.push({label:(0,c.localize)("editor.openExternal"),onClick:()=>a.get(p.IElectronMainUIService).openPath(g)}),r.default.createElement(m.PreventComponent,{description:(0,c.localize)("editor.cannotOpenBinary"),actions:f})};t.BinaryEditorComponent=_},60387:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalkThroughSnippetSchemeDocumentProvider=t.VscodeSchemeDocumentProvider=t.FileSchemeDocumentProvider=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(96405),p=e(68692),v=e(14951),m=e(80449);let _=class extends p.BaseFileSystemEditorDocumentProvider{handlesUri(h){return h.scheme===o.Schemes.file?20:-1}handlesScheme(){return!1}provideEncoding(h){return super.provideEncoding(h)}preferLanguageForUri(h){if(["settings.json"].includes(h.path.base))return"jsonc"}async saveDocumentModel(h,u,d,E,f,l=!1,b=`
|
|
31633
|
-
`,y){const A=this.hashCalculateService.calculate(d);return u.length>m.FILE_SAVE_BY_CHANGE_THRESHOLD?await this.fileSchemeDocClient.saveByChange(h.toString(),{baseMd5:A,changes:E,eol:b},f,l,y):await this.fileSchemeDocClient.saveByContent(h.toString(),{baseMd5:A,content:u},f,l,y)}async provideEditorDocumentModelContentMd5(h,u){return this.fileSchemeDocClient.getMd5(h.toString(),u)}};t.FileSchemeDocumentProvider=_,n.__decorate([(0,r.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],_.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(m.IFileSchemeDocClient),n.__metadata("design:type",Object)],_.prototype,"fileSchemeDocClient",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],_.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(c.IHashCalculateService),n.__metadata("design:type",Object)],_.prototype,"hashCalculateService",void 0),t.FileSchemeDocumentProvider=_=n.__decorate([(0,r.Injectable)()],_);let s=class{constructor(){this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event,this.listeners={}}isReadonly(h){return!0}handlesScheme(h){return h==="vscode"}async provideEditorDocumentModelContent(h,u){return this.getSchemaContent(h)}getSchemaContent(h){const u=h.toString(),d=this.jsonRegistry.getSchemaContributions().schemas[u];if(d){const E=JSON.stringify(d);if(!this.listeners[u]){const f=o.Disposable.create(()=>{this.jsonRegistry.onDidChangeSchema(l=>{l===u&&this._onDidChangeContent.fire(h)})});this.listeners[u]=f}return E}return"{}"}onDidDisposeModel(h){h.toString()&&(this.listeners[h.toString()].dispose(),delete this.listeners[h.toString()])}};t.VscodeSchemeDocumentProvider=s,n.__decorate([(0,r.Autowired)(o.ISchemaStore),n.__metadata("design:type",Object)],s.prototype,"schemaStore",void 0),n.__decorate([(0,r.Autowired)(o.IJSONSchemaRegistry),n.__metadata("design:type",Object)],s.prototype,"jsonRegistry",void 0),t.VscodeSchemeDocumentProvider=s=n.__decorate([(0,r.Injectable)()],s);let g=class{constructor(){this.documentContentMaps=new Map,this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event}handlesScheme(h){return h===o.Schemes.walkThroughSnippet}provideEditorDocumentModelContent(h,u){return this.documentContentMaps.has(h.toString())||this.documentContentMaps.set(h.toString(),""),this.documentContentMaps.get(h.toString())}isReadonly(){return!1}preferLanguageForUri(){return"plaintext"}};t.WalkThroughSnippetSchemeDocumentProvider=g,t.WalkThroughSnippetSchemeDocumentProvider=g=n.__decorate([(0,r.Injectable)()],g)},41352:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSchemeDocClientService=void 0;const n=e(85608),r=e(76003),o=e(80449);let c=class{saveByChange(v,m,_,s,g){return this.fileDocBackendService.$saveByChange(v,m,_,s,g)}saveByContent(v,m,_,s,g){return this.fileDocBackendService.$saveByContent(v,m,_,s,g)}getMd5(v,m){return this.fileDocBackendService.$getMd5(v,m)}};t.FileSchemeDocClientService=c,n.__decorate([(0,r.Autowired)(o.FileSchemeDocNodeServicePath),n.__metadata("design:type",Object)],c.prototype,"fileDocBackendService",void 0),t.FileSchemeDocClientService=c=n.__decorate([(0,r.Injectable)()],c)},17276:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystemEditorComponentContribution=t.FileSystemEditorResourceContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(26542),p=e(57517),v=e(17878),m=e(42933),_=e(57646),s=e(60387),g=e(88819),a=e(99025),h="video-preview",u="image-preview",d="external-file",E="large-file-prevent";let f=class{registerResource(y){y.registerResourceProvider(this.untitledResourceProvider)}registerEditorDocumentModelContentProvider(y){y.registerEditorDocumentModelContentProvider(this.fileSchemeDocumentProvider),y.registerEditorDocumentModelContentProvider(this.vscodeSchemeDocumentProvider),y.registerEditorDocumentModelContentProvider(this.walkThroughSnippetSchemeDocumentProvider),y.registerEditorDocumentModelContentProvider(this.untitledSchemeDocumentProvider)}};t.FileSystemEditorResourceContribution=f,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s.FileSchemeDocumentProvider)],f.prototype,"fileSchemeDocumentProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s.VscodeSchemeDocumentProvider)],f.prototype,"vscodeSchemeDocumentProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s.WalkThroughSnippetSchemeDocumentProvider)],f.prototype,"walkThroughSnippetSchemeDocumentProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",v.UntitledSchemeResourceProvider)],f.prototype,"untitledResourceProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",v.UntitledSchemeDocumentProvider)],f.prototype,"untitledSchemeDocumentProvider",void 0),t.FileSystemEditorResourceContribution=f=n.__decorate([(0,o.Domain)(p.BrowserEditorContribution)],f);let l=class{constructor(){this.cachedFileType=new o.LRUMap(200,100),this.fileServiceClient.onFilesChanged(y=>{y.forEach(A=>{this.cachedFileType.delete(A.uri.toString())})})}registerEditorComponent(y){y.registerEditorComponent({component:a.ImagePreview,uid:u,scheme:o.Schemes.file}),y.registerEditorComponent({component:a.VideoPreview,uid:h,scheme:o.Schemes.file}),y.registerEditorComponent({component:_.BinaryEditorComponent,uid:d,scheme:o.Schemes.file}),y.registerEditorComponent({component:g.LargeFilePrevent,uid:E,scheme:o.Schemes.file}),y.registerEditorComponentResolver(A=>A===o.Schemes.file||this.fileServiceClient.handlesScheme(A)?10:-1,(A,S)=>{S.length===0&&S.push({type:p.EditorOpenType.component,componentId:d})}),y.registerEditorComponentResolver(A=>A===o.Schemes.file||this.fileServiceClient.handlesScheme(A)?10:-1,async(A,S)=>{const w=await this.getFileType(A.uri.toString());switch(w){case"image":{S.push({type:p.EditorOpenType.component,componentId:u});break}case"video":{S.push({type:p.EditorOpenType.component,componentId:h});break}case"binary":case"text":{const{metadata:T,uri:D}=A,I=T||{};if(w==="binary"&&!I.skipPreventBinary)break;const O=await this.fileServiceClient.getFileStat(D.toString());await this.preference.ready;const M=this.preference.getValid("editor.largeFile",4*1024*1024*1024);O&&(O.size||0)>M&&!I.skipPreventTooLarge?S.push({type:p.EditorOpenType.component,componentId:E}):S.push({type:p.EditorOpenType.code,title:(0,o.localize)("editorOpenType.code")});break}}}),y.registerEditorComponentResolver(o.Schemes.untitled,(A,S,w)=>{w([{type:p.EditorOpenType.code,priority:"default"}])})}async getFileType(y){return this.cachedFileType.has(y)||((0,c.getLanguageIdFromMonaco)(new o.URI(y))?this.cachedFileType.set(y,"text"):this.cachedFileType.set(y,await this.getRealFileType(y))),this.cachedFileType.get(y)}async getRealFileType(y){try{return await this.fileServiceClient.getFileType(y)}catch{return"text"}}};t.FileSystemEditorComponentContribution=l,n.__decorate([(0,r.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],l.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],l.prototype,"preference",void 0),t.FileSystemEditorComponentContribution=l=n.__decorate([(0,o.Domain)(p.BrowserEditorContribution),n.__metadata("design:paramtypes",[])],l)},52568:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSchemeModule=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(80449),p=e(41352),v=e(17276);let m=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[v.FileSystemEditorResourceContribution,v.FileSystemEditorComponentContribution,{token:c.IFileSchemeDocClient,useClass:p.FileSchemeDocClientService}],this.backServices=[{servicePath:c.FileSchemeDocNodeServicePath}]}};t.FileSchemeModule=m,t.FileSchemeModule=m=n.__decorate([(0,r.Injectable)()],m)},88819:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LargeFilePrevent=t.PreventComponent=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=e(41869),p=e(81878),v=e(54414),m=e(82196),_=n.__importDefault(e(19996)),s=a=>o.default.createElement("div",{className:_.default["error-page"]},o.default.createElement("div",{className:(0,r.default)(_.default.icon,(0,c.getExternalIcon)("warning"))}),o.default.createElement("div",{className:_.default.description},a.description),o.default.createElement("div",{className:_.default["actions-wrapper"]},a.actions.map((h,u)=>o.default.createElement(p.Button,{key:u,onClick:()=>h.onClick(),className:_.default["action-button"]},h.label))));t.PreventComponent=s;const g=()=>{const a=(0,c.useInjectable)(v.WorkbenchEditorService),h=(0,c.useInjectable)(c.IEventBus),u=()=>{const d=a.currentResource;d&&(d.metadata={...d.metadata,skipPreventTooLarge:!0},h.fire(new m.ResourceOpenTypeChangedEvent(d.uri)))};return o.default.createElement(t.PreventComponent,{description:(0,c.localize)("editor.largeFile.prevent"),actions:[{label:(0,c.localize)("editor.file.prevent.stillOpen"),onClick:()=>u()}]})};t.LargeFilePrevent=g},99025:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImagePreview=t.VideoPreview=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(41869),c=e(40827),p=n.__importDefault(e(19996)),v=_=>{const s=(0,o.useInjectable)(c.StaticResourceService);return{src:r.default.useMemo(()=>s.resolveStaticResource(_.uri).toString(),[_])}};t.VideoPreview=(0,r.memo)(_=>{const{src:s}=v(_.resource);return r.default.createElement("div",{className:p.default.kt_video_preview},r.default.createElement("video",{playsInline:!0,controls:!0,className:p.default.kt_video,src:s}))});const m=_=>{const s=r.default.useRef(),g=r.default.useRef(),{src:a}=v(_.resource);return r.default.useEffect(()=>{const h=new o.Disposable;return s.current&&(s.current.src=a),()=>{h.dispose()}},[_.resource]),r.default.createElement("div",{className:p.default.kt_image_preview},r.default.createElement("div",{ref:g},r.default.createElement("img",{ref:h=>h&&(s.current=h)})))};t.ImagePreview=m},80449:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChangeType=t.FileSchemeDocNodeServicePath=t.IFileSchemeDocNodeService=t.IFileSchemeDocClient=t.FILE_SAVE_BY_CHANGE_THRESHOLD=t.FILE_ON_DISK_SCHEME=void 0,t.FILE_ON_DISK_SCHEME="fileOnDisk",t.FILE_SAVE_BY_CHANGE_THRESHOLD=1e5,t.IFileSchemeDocClient=Symbol("IFileSchemeDocClient"),t.IFileSchemeDocNodeService=Symbol("FileSchemeDocNodeService"),t.FileSchemeDocNodeServicePath="FileSchemeDocNodeService";var e;(function(n){n[n.ADDED=1]="ADDED",n[n.REMOVED=2]="REMOVED"})(e||(t.ChangeType=e={}))},15625:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IFileSearchService=t.FileSearchServicePath=void 0,t.FileSearchServicePath="FileSearchServicePath",t.IFileSearchService=Symbol("FileSearchService")},84660:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(15625),t)},47720:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(84660),t)},2156:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileServiceClient=t.BrowserFileSystemRegistryImpl=void 0;const n=e(85608),r=e(32852),o=e(76003),c=e(41869),p=e(43718),v=e(37406),m=e(8170),_=e(41682),s=e(42933),g=e(81952);let a=class{constructor(){this.providers=new Map}registerFileSystemProvider(d){const E=d.scheme;return this.providers.set(E,d),{dispose:()=>{this.providers.delete(E)}}}};t.BrowserFileSystemRegistryImpl=a,t.BrowserFileSystemRegistryImpl=a=n.__decorate([(0,o.Injectable)()],a);let h=class{get clientId(){return this.applicationService.clientId}constructor(){this.watcherWithSchemaMap=new Map,this.watcherDisposerMap=new Map,this.onFileChangedEmitter=new c.Emitter,this.onFileProviderChangedEmitter=new c.Emitter,this._onFilesChanged=new c.Emitter,this.onFilesChanged=this._onFilesChanged.event,this._onFileProviderChanged=new c.Emitter,this.onFileProviderChanged=this._onFileProviderChanged.event,this._onDidChangeFileSystemProviderRegistrations=new c.Emitter,this.onDidChangeFileSystemProviderRegistrations=this._onDidChangeFileSystemProviderRegistrations.event,this._onWillActivateFileSystemProvider=new c.Emitter,this.onWillActivateFileSystemProvider=this._onWillActivateFileSystemProvider.event,this._onDidChangeFileSystemProviderCapabilities=new c.Emitter,this.onDidChangeFileSystemProviderCapabilities=this._onDidChangeFileSystemProviderCapabilities.event,this.filesExcludesMatcherList=[],this.watcherId=0,this.toDisposable=new c.DisposableCollection,this.watchFileExcludes=[],this.watchFileExcludesMatcherList=[],this.filesExcludes=[],this.workspaceRoots=[],this._providerChanged=new Set,this.fsProviders=new Map,this.userHomeDeferred=new c.Deferred,this.options={encoding:"utf8",overwrite:!1,recursive:!0,moveToTrash:!0},this.uriWatcherMap=new Map,this.toDisposable.push(this.onDidChangeFileSystemProviderRegistrations(d=>{d.added&&d.scheme===p.Schemes.file&&this.doGetCurrentUserHome()}))}async initialize(){const d=await this.getProvider(p.Schemes.file);d.initialize&&await d.initialize(this.clientId,this.appConfig.recursiveWatcherBackend)}async doGetCurrentUserHome(){const E=(await this.getProvider(p.Schemes.file)).getCurrentUserHome();this.userHomeDeferred.resolve(E)}handlesScheme(d){return this.registry.providers.has(d)||this.fsProviders.has(d)}dispose(){return this.toDisposable.dispose()}async resolveContent(d,E){const f=this.convertUri(d),b=await(await this.getProvider(f.scheme)).readFile(f.codeUri),y=b.data||b;return{content:c.BinaryBuffer.wrap(Uint8Array.from(y)).toString(E?.encoding)}}async readFile(d){const E=this.convertUri(d),l=await(await this.getProvider(E.scheme)).readFile(E.codeUri),b=l.data||l;return{content:c.BinaryBuffer.wrap(Uint8Array.from(b))}}async readFileStream(d){const E=this.convertUri(d);return await(await this.getProvider(E.scheme)).readFileStream(E.codeUri)}async getFileStat(d,E=!0){const f=this.convertUri(d),l=await this.getProvider(f.scheme);try{const b=await l.stat(f.codeUri);if(!b)throw s.FileSystemError.FileNotFound(f.codeUri.toString(),"File not found.");return this.filterStat(b,E)}catch(b){if(s.FileSystemError.FileNotFound.is(b))return}}async setContent(d,E,f){const l=this.convertUri(d.uri),b=await this.getProvider(l.scheme),y=await b.stat(l.codeUri);if(!y)throw s.FileSystemError.FileNotFound(d.uri,"File not found.");if(y.isDirectory)throw s.FileSystemError.FileIsADirectory(d.uri,"Cannot set the content.");if(!await this.isInSync(d,y))throw this.createOutOfSyncError(d);return await b.writeFile(l.codeUri,typeof E=="string"?c.BinaryBuffer.fromString(E).buffer:E,{create:!1,overwrite:!0,encoding:f?.encoding}),await b.stat(l.codeUri)}async updateContent(d,E,f){const l=this.convertUri(d.uri),b=await this.getProvider(l.scheme),y=await b.stat(l.codeUri);if(!y)throw s.FileSystemError.FileNotFound(d.uri,"File not found.");if(y.isDirectory)throw s.FileSystemError.FileIsADirectory(d.uri,"Cannot set the content.");if(!this.checkInSync(d,y))throw this.createOutOfSyncError(d);if(E.length===0)return y;const A=await b.readFile(l.codeUri),S=this.applyContentChanges(c.BinaryBuffer.wrap(A).toString(f?.encoding),E);await b.writeFile(l.codeUri,c.BinaryBuffer.fromString(S).buffer,{create:!1,overwrite:!0,encoding:f?.encoding});const w=await b.stat(l.codeUri);if(!w)throw s.FileSystemError.FileNotFound(l.codeUri.toString(),"File not found.");return w}async createFile(d,E){const f=this.convertUri(d),l=await this.getProvider(f.scheme),b=c.BinaryBuffer.fromString(E?.content||"").buffer;let y=await l.writeFile(f.codeUri,b,{create:!0,overwrite:E&&E.overwrite||!1,encoding:E?.encoding});return y=y||await l.stat(f.codeUri),y}async createFolder(d){const E=this.convertUri(d),f=await this.getProvider(E.scheme),l=await f.createDirectory(E.codeUri);return l||await f.stat(E.codeUri)}async move(d,E,f){const l=this.convertUri(d),b=this.convertUri(E),y=await this.getProvider(l.scheme),A=await y.rename(l.codeUri,b.codeUri,{overwrite:!!(f&&f.overwrite)});return A||await y.stat(b.codeUri)}async copy(d,E,f){const l=this.convertUri(d),b=this.convertUri(E),y=await this.getProvider(l.scheme),A=await this.doGetOverwrite(f);if(!(0,s.containsExtraFileMethod)(y,"copy"))throw this.getErrorProvideNotSupport(l.scheme,"copy");const S=await y.copy(l.codeUri,b.codeUri,{overwrite:!!A});return S||await y.stat(b.codeUri)}async getFsPath(d){if(d.startsWith("file:/"))return c.FileUri.fsPath(d)}fireFilesChange(d){const E=d.changes.map(f=>({uri:f.uri,type:f.type}));this._onFilesChanged.fire(E),this.eventBus.fire(new c.FilesChangeEvent(E))}async watchFileChanges(d,E){const l=(this.appConfig.pollingWatcherDirectories||[]).some(I=>d.path.toString().startsWith(I)),b=this.convertUri(d.toString());let y=0;const A=await this.getProvider(b.scheme),S=this.watcherWithSchemaMap.get(b.scheme)||[];let w;this.uriWatcherMap.has(b.toString())&&(w=this.uriWatcherMap.get(b.toString()),w.dispose()),w?y=w.watchId:y=this.watcherId++;const T=await A.watch(b.codeUri,{excludes:E,pollingWatch:l});this.watcherDisposerMap.set(y,{dispose:async()=>{const I=this.uriWatcherMap.get(b.toString());await Promise.all([A.unwatch&&A.unwatch(T),I&&I.dispose()]),this.uriWatcherMap.delete(b.toString())}}),S.push(y),this.watcherWithSchemaMap.set(b.scheme,S);const D=new g.FileSystemWatcher({fileServiceClient:this,watchId:y,uri:d});return this.uriWatcherMap.set(b.toString(),D),D}async setWatchFileExcludes(d){return await(await this.getProvider(p.Schemes.file)).setWatchFileExcludes(d)}async getWatchFileExcludes(){return await(await this.getProvider(p.Schemes.file)).getWatchFileExcludes()}async setFilesExcludes(d,E){this.filesExcludes=d,this.filesExcludesMatcherList=[],E&&this.setWorkspaceRoots(E),this.updateExcludeMatcher()}async setWorkspaceRoots(d){this.workspaceRoots=d,this.updateExcludeMatcher()}async unwatchFileChanges(d){const E=this.watcherDisposerMap.get(d);if(!(!E||!E.dispose))return this.watcherDisposerMap.delete(d),E.dispose()}async delete(d,E){if(this.appConfig.isElectronRenderer&&E?.moveToTrash!==!1){const b=new c.URI(d);if(b.scheme===p.Schemes.file)return this.injector.get(v.IElectronMainUIService).moveToTrash(b.codeUri.fsPath)}const f=this.convertUri(d),l=await this.getProvider(f.scheme);await l.stat(f.codeUri),await l.delete(f.codeUri,{recursive:!0,moveToTrash:await this.doGetMoveToTrash(E)})}async getEncoding(d){return"utf8"}listCapabilities(){return _.Iterable.map(this.fsProviders,([d,E])=>({scheme:d,capabilities:E.capabilities}))}registerProvider(d,E){if(this.fsProviders.has(d))throw new Error(`The file system provider for \`${d}\` already registered`);const f=[];this.fsProviders.set(d,E),this._onDidChangeFileSystemProviderRegistrations.fire({added:!0,scheme:d,provider:E}),f.push({dispose:()=>{this._onDidChangeFileSystemProviderRegistrations.fire({added:!1,scheme:d,provider:E}),this.fsProviders.delete(d),this._providerChanged.add(d)}}),E.onDidChangeFile&&f.push(E.onDidChangeFile(b=>this.fireFilesChange({changes:b}))),this.toDisposable.push(E.onDidChangeCapabilities(()=>this._onDidChangeFileSystemProviderCapabilities.fire({provider:E,scheme:d}))),f.push({dispose:async()=>{const b=[];(this.watcherWithSchemaMap.get(d)||[]).forEach(y=>b.push(this.unwatchFileChanges(y))),await Promise.all(b)}}),this._providerChanged.add(d),this.onFileProviderChangedEmitter.fire(Array.from(this._providerChanged)),this.toDisposable.pushAll(f);const l=new c.DisposableCollection;return l.pushAll(f),this._onFileProviderChanged.fire(Array.from(this._providerChanged)),l}async access(d,E=s.FileAccess.Constants.F_OK){const f=this.convertUri(d),l=await this.getProvider(f.scheme);if(!(0,s.containsExtraFileMethod)(l,"access")){if(E===s.FileAccess.Constants.F_OK)try{return!!await l.stat(f.codeUri)}catch{return!1}throw this.getErrorProvideNotSupport(f.scheme,"access")}return await l.access(f.codeUri,E)}async getFileType(d){const E=this.convertUri(d),f=await this.getProvider(E.scheme);if(!(0,s.containsExtraFileMethod)(f,"getFileType"))throw this.getErrorProvideNotSupport(E.scheme,"getFileType");return await f.getFileType(d)}async getCurrentUserHome(){return this.userHomeDeferred.promise}getErrorProvideNotSupport(d,E){return`Scheme ${d} not support this function: ${E}.`}convertUri(d){const E=new c.URI(d);if(!E.scheme)throw new Error(`Unsupported convert Uri with non-scheme Uri: ${d}`);return E}updateExcludeMatcher(){this.filesExcludes.forEach(d=>{this.workspaceRoots.length>0?this.workspaceRoots.forEach(E=>{const l=new c.URI(E).resolve(d).path.toString();this.filesExcludesMatcherList.push((0,c.parseGlob)(l))}):this.filesExcludesMatcherList.push((0,c.parseGlob)(d))})}async shouldWaitProvider(d){const E=await this._onWillActivateFileSystemProvider.fireAndAwait({scheme:d}),{result:f}=E[0];if(f&&f.includes(d)){const l=await c.Event.toPromise(c.Event.filter(this.onFileProviderChanged,b=>b.includes(d)));if(!(0,p.isUndefined)(l))return!0}return!1}async getProvider(d){this._providerChanged.has(d)&&(await this.eventBus.fireAndAwait(new c.ExtensionActivateEvent({topic:"onFileSystem",data:d}),{timeout:3e3}),this._providerChanged.delete(d));const E=this.fsProviders.get(d);if(!E)throw new Error(`Not find ${d} provider.`);return E}async isReadonly(d){try{const E=new c.URI(d);return!!(await(await this.getProvider(E.scheme)).stat(this.convertUri(d).codeUri)).readonly}catch{return!1}}isExclude(d){const E=new c.URI(d);return this.filesExcludesMatcherList.some(f=>f(E.path.toString()))}filterStat(d,E=!0){if(d&&!this.isExclude(d.uri))return d.children&&E&&(d.children=this.filterStatChildren(d.children)),d}filterStatChildren(d){const E=[];return d.forEach(f=>{if(this.isExclude(f.uri))return!1;const l=this.filterStat(f);l&&E.push(l)}),E}applyContentChanges(d,E){let f=r.TextDocument.create("","",1,d);for(const l of E){let b=l.text;if(l.range){const y=f.offsetAt(l.range.start),A=f.offsetAt(l.range.end);b=f.getText().substr(0,y)+l.text+f.getText().substr(A)}f=r.TextDocument.create(f.uri,f.languageId,f.version,b)}return f.getText()}async isInSync(d,E){return!!this.checkInSync(d,E)}checkInSync(d,E){return E.lastModification===d.lastModification&&E.size===d.size}createOutOfSyncError(d){return s.FileSystemError.FileIsOutOfSync(d.uri)}async doGetEncoding(d){return d&&typeof d.encoding<"u"?d.encoding:this.options.encoding}async doGetOverwrite(d){return d&&typeof d.overwrite<"u"?d.overwrite:this.options.overwrite}async doGetRecursive(d){return d&&typeof d.recursive<"u"?d.recursive:this.options.recursive}async doGetMoveToTrash(d){return d&&typeof d.moveToTrash<"u"?d.moveToTrash:this.options.moveToTrash}async reconnect(){var d;const E=await this.getProvider(p.Schemes.file);E.initialize&&await E.initialize(this.clientId,this.appConfig.recursiveWatcherBackend);const f=Array.from(this.uriWatcherMap.keys());for(const l of f)try{const b=new c.URI(l);this.uriWatcherMap.get(l)&&await this.watchFileChanges(b)}catch(b){(d=this.logger)===null||d===void 0||d.error("Error reconnecting watcher for:",l,b)}}};t.FileServiceClient=h,n.__decorate([(0,o.Autowired)(s.IBrowserFileSystemRegistry),n.__metadata("design:type",a)],h.prototype,"registry",void 0),n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],h.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(p.IEventBus),n.__metadata("design:type",Object)],h.prototype,"eventBus",void 0),n.__decorate([(0,o.Autowired)(c.AppConfig),n.__metadata("design:type",Object)],h.prototype,"appConfig",void 0),n.__decorate([(0,o.Autowired)(m.IApplicationService),n.__metadata("design:type",Object)],h.prototype,"applicationService",void 0),n.__decorate([(0,o.Autowired)(p.ILogger),n.__metadata("design:type",Object)],h.prototype,"logger",void 0),t.FileServiceClient=h=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],h)},69037:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileServiceContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(42933),p=e(2156);let v=class{constructor(){this._disposables=new o.DisposableStore,this._disposables.add(this.fileSystem.registerProvider(o.Schemes.file,this.diskFileServiceProvider))}async initialize(){const _=this.contributionProvider.getContributions();await Promise.all(_.map(async s=>{s.registerProvider&&await s.registerProvider(this.fileSystem)})),await Promise.all(_.map(async s=>{s.onFileServiceReady&&await s.onFileServiceReady()})),this.fileSystem.initialize&&await this.fileSystem.initialize()}onReconnect(){this.fileServiceClient.reconnect().catch(_=>this.logger.error("Failed to reconnect watchers:",_))}dispose(){this._disposables.dispose()}};t.FileServiceContribution=v,n.__decorate([(0,r.Autowired)(c.IFileServiceClient),n.__metadata("design:type",p.FileServiceClient)],v.prototype,"fileSystem",void 0),n.__decorate([(0,r.Autowired)(c.IDiskFileProvider),n.__metadata("design:type",Object)],v.prototype,"diskFileServiceProvider",void 0),n.__decorate([(0,r.Autowired)(o.FsProviderContribution),n.__metadata("design:type",Object)],v.prototype,"contributionProvider",void 0),n.__decorate([(0,r.Autowired)(c.IFileServiceClient),n.__metadata("design:type",Object)],v.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],v.prototype,"logger",void 0),t.FileServiceContribution=v=n.__decorate([(0,o.Domain)(o.ClientAppContribution),n.__metadata("design:paramtypes",[])],v)},60476:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiskFsProviderClient=t.CoreFileServiceProviderClient=void 0;const n=e(85608),r=e(76003),o=e(43718),c=e(42933);class p{constructor(){this.onDidChangeFileEmitter=new o.Emitter,this.onDidChangeFile=this.onDidChangeFileEmitter.event}watch(_,s){return this.fileServiceProvider.watch(_,s)}unwatch(_){return this.fileServiceProvider.unwatch&&this.fileServiceProvider.unwatch(_)}async stat(_){return await this.fileServiceProvider.stat(_)}readDirectory(_){return this.fileServiceProvider.readDirectory(_)}createDirectory(_){return this.fileServiceProvider.createDirectory(_)}async readFile(_,s){return s&&(0,o.getDebugLogger)("fileService.fsProvider").warn("encoding option for fsProvider.readFile is deprecated"),await this.fileServiceProvider.readFile(_)}readFileStream(_){if(this.fileServiceProvider.readFileStream)return this.fileServiceProvider.readFileStream(_);throw new Error("readFileStream not supported")}writeFile(_,s,g){return this.fileServiceProvider.writeFile(_,Array.from(s),g)}delete(_,s){return this.fileServiceProvider.delete(_,s)}rename(_,s,g){return this.fileServiceProvider.rename(_,s,g)}}t.CoreFileServiceProviderClient=p,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],p.prototype,"injector",void 0);let v=class extends p{constructor(){super(...arguments),this.onDidChangeCapabilities=o.Event.None}get capabilities(){return this._capabilities||(this._capabilities=12318,o.isLinux&&(this._capabilities|=1024)),this._capabilities}async initialize(_,s){var g,a;if(!((g=this.fileServiceProvider)===null||g===void 0)&&g.initialize)try{await((a=this.fileServiceProvider)===null||a===void 0?void 0:a.initialize(_,s))}catch(h){(0,o.getDebugLogger)("fileService.fsProvider").error("initialize error",h)}}setWatchFileExcludes(_){return this.fileServiceProvider.setWatchFileExcludes(_)}getWatchFileExcludes(){return this.fileServiceProvider.getWatchFileExcludes()}onDidFilesChanged(_){const s=_.changes.map(g=>({uri:g.uri,type:g.type}));this.onDidChangeFileEmitter.fire(s)}copy(_,s,g){return this.fileServiceProvider.copy(_,s,g)}access(_,s){return this.fileServiceProvider.access(_,s)}getCurrentUserHome(){return this.fileServiceProvider.getCurrentUserHome()}getFileType(_){return this.fileServiceProvider.getFileType(_)}};t.DiskFsProviderClient=v,n.__decorate([(0,r.Autowired)(c.DiskFileServicePath),n.__metadata("design:type",Object)],v.prototype,"fileServiceProvider",void 0),n.__decorate([(0,o.debounce)(100),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Array]),n.__metadata("design:returntype",void 0)],v.prototype,"setWatchFileExcludes",null),t.DiskFsProviderClient=v=n.__decorate([(0,r.Injectable)()],v)},96708:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileServiceClientModule=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(42933),p=e(70671),v=e(2156),m=e(69037),_=e(60476),s=e(23188);let g=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:c.IFileServiceClient,useClass:v.FileServiceClient},{token:c.IBrowserFileSystemRegistry,useClass:v.BrowserFileSystemRegistryImpl},{token:c.IDiskFileProvider,useClass:_.DiskFsProviderClient},{token:c.IShadowFileProvider,useClass:s.ShadowFileSystemProvider},m.FileServiceContribution],this.backServices=[{servicePath:c.DiskFileServicePath,clientToken:c.IDiskFileProvider,protocol:p.DiskFileServiceProtocol}]}};t.FileServiceClientModule=g,t.FileServiceClientModule=g=n.__decorate([(0,r.Injectable)()],g)},23188:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShadowFileSystemProvider=void 0;const n=e(85608),r=e(76003),o=e(41869);let c=class{constructor(){this.capabilities=2048,this.onDidChangeCapabilities=o.Event.None,this.readonly=!0,this.shadowFiles=new Map,this.fileChangeEmitter=new o.Emitter,this.onDidChangeFile=this.fileChangeEmitter.event}unwatch(v){throw new Error("Method not implemented.")}readFileStream(v){throw new Error("Method not implemented.")}watch(v,m){throw new Error("Method not implemented.")}stat(v){return Promise.resolve({uri:v.toString(),lastModification:0})}readDirectory(v){throw new Error("Method not implemented.")}createDirectory(v){throw new Error("Method not implemented.")}readFile(v){return this.shadowFiles.get(v.toString())||o.BinaryBuffer.fromString("no available").buffer}writeFile(v,m,_){this.shadowFiles.set(v.toString(),m)}delete(v,m){throw new Error("Method not implemented.")}rename(v,m,_){throw new Error("Method not implemented.")}copy(v,m,_){throw new Error("Method not implemented.")}exists(v){throw new Error("Method not implemented.")}access(v,m){throw new Error("Method not implemented.")}};t.ShadowFileSystemProvider=c,t.ShadowFileSystemProvider=c=n.__decorate([(0,r.Injectable)()],c)},81952:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystemWatcher=void 0;const n=e(43718);function r(c,p){return c.filter(v=>!!v.uri.startsWith(p))}class o{constructor(p){this.toDispose=new n.DisposableCollection,this.changeEmitter=new n.Emitter,this.toDispose.push(this.changeEmitter),this.fileServiceClient=p.fileServiceClient,this.watchId=p.watchId,this.uri=p.uri,this.fileServiceClient.onFilesChanged(v=>{const m=r(v,this.uri.toString());m&&m.length>0&&this.changeEmitter.fire(m)})}get onFilesChanged(){return this.changeEmitter.event}dispose(){return Promise.all([this.toDispose.dispose(),this.fileServiceClient.unwatchFileChanges(this.watchId)])}isDisposed(){return this.toDispose.disposed}}t.FileSystemWatcher=o},91813:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EXT_LIST_TEXT=t.EXT_LIST_IMAGE=t.EXT_LIST_VIDEO=void 0,t.getFileTypeByExt=e,t.EXT_LIST_VIDEO=new Set(["mp4","webm","mkv","mov","mts","flv","avi","wmv"]),t.EXT_LIST_IMAGE=new Set(["png","gif","jpg","jpeg","svg","bmp","avif","cr2","cr3","dng","flif","heic","icns","jxl","jpm","jpx","nef","raf","rw2","tif","orf","webp","apng"]),t.EXT_LIST_TEXT=new Set(["xml"]);function e(n){let r="text";return n&&(t.EXT_LIST_IMAGE.has(n)?r="image":t.EXT_LIST_VIDEO.has(n)?r="video":t.EXT_LIST_TEXT.has(n)?r="text":r="binary"),r}},79929:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IBrowserFileSystemRegistry=t.IFileServiceClient=void 0;const n=e(43718);t.IFileServiceClient=n.IFileServiceClient,t.IBrowserFileSystemRegistry=Symbol("IBrowserFileSystemRegistry")},49818:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystemError=t.FileOperationError=t.FileSystemProviderError=t.FileSystemProviderErrorCode=t.FileAccess=t.IFileService=t.IShadowFileProvider=t.IDiskFileProvider=t.FileStat=t.FileType=void 0,t.createFileSystemProviderError=_,t.markAsFileSystemProviderError=s,t.containsExtraFileMethod=a,t.notEmpty=h,t.isErrnoException=u,t.handleError=d;const n=e(85608),r=e(43718);var o=e(31036);Object.defineProperty(t,"FileType",{enumerable:!0,get:function(){return o.FileType}}),Object.defineProperty(t,"FileStat",{enumerable:!0,get:function(){return o.FileStat}}),n.__exportStar(e(11854),t),t.IDiskFileProvider=Symbol("IDiskFileProvider"),t.IShadowFileProvider=Symbol("IShadowFileProvider"),t.IFileService=Symbol("IFileService");var c;(function(E){let f;(function(l){l.F_OK=0,l.R_OK=4,l.W_OK=2,l.X_OK=1})(f=E.Constants||(E.Constants={}))})(c||(t.FileAccess=c={}));var p;(function(E){E.FileExists="EntryExists",E.FileNotFound="EntryNotFound",E.FileNotADirectory="EntryNotADirectory",E.FileIsADirectory="EntryIsADirectory",E.FileIsOutOfSync="FileIsOutOfSync",E.FileExceedsMemoryLimit="EntryExceedsMemoryLimit",E.FileTooLarge="EntryTooLarge",E.FileWriteLocked="EntryWriteLocked",E.NoPermissions="NoPermissions",E.Unavailable="Unavailable",E.Unknown="Unknown"})(p||(t.FileSystemProviderErrorCode=p={}));class v extends Error{static declare(f,l){return Object.assign((...b)=>_(l(...b),f),{is:b=>{var y;return(y=b.stack)===null||y===void 0?void 0:y.startsWith(f)}})}constructor(f,l){super(f),this.code=l}is(f){return this.name===f.name}}t.FileSystemProviderError=v;class m extends Error{constructor(f,l,b){super(f),this.fileOperationResult=l,this.options=b}static isFileOperationError(f){return f instanceof Error&&!(0,r.isUndefinedOrNull)(f.fileOperationResult)}}t.FileOperationError=m;function _(E,f){const l=new v(E.toString(),f);return s(l,f),l}function s(E,f){return E.name=f?`${f} (FileSystemError)`:"FileSystemError",E}var g;(function(E){E.FileNotFound=v.declare(p.FileNotFound,(f,l)=>`${l?l+" ":""} '${f}' is not found.`),E.FileExists=v.declare(p.FileExists,(f,l)=>`${l?l+" ":""}'${f}' already exists.`),E.FileNotADirectory=v.declare(p.FileNotADirectory,(f,l)=>`${l?l+" ":""}'${f}' is not a directory.`),E.FileIsADirectory=v.declare(p.FileIsADirectory,(f,l)=>`${l?l+" ":""}'${f}' is a directory.`),E.FileIsOutOfSync=v.declare(p.FileIsOutOfSync,(f,l)=>`${l?l+" ":""}'${f}' is out of sync.`),E.FileExceedsMemoryLimit=v.declare(p.FileExceedsMemoryLimit,(f,l)=>`${l?l+" ":""}'${f}' is exceeds memory limit.`),E.FileTooLarge=v.declare(p.FileTooLarge,(f,l)=>`${l?l+" ":""}'${f}' is too large.`),E.FileWriteLocked=v.declare(p.FileWriteLocked,(f,l)=>`${l?l+" ":""}'${f}' is locked.`),E.FileIsNoPermissions=v.declare(p.NoPermissions,(f,l)=>`${l?l+" ":""}'${f}' is no permissions.`),E.Unavailable=v.declare(p.Unavailable,(f,l)=>`${l?l+" ":""}'${f}' is unavailable.`),E.Unknown=v.declare(p.Unknown,(f,l)=>`${l?l+" ":""}'${f}' is unkonw.`)})(g||(t.FileSystemError=g={}));function a(E,f){return(0,r.hasProperty)(E,f)&&(0,r.isFunction)(E[f])}function h(E){return E!==void 0}function u(E){return E.code!==void 0&&E.errno!==void 0}function d(E){var f,l,b,y,A;if(u(E))switch(E.code){case"EEXIST":throw g.FileExists(r.Uri.file((f=E.path)!==null&&f!==void 0?f:""));case"EPERM":case"EACCESS":throw g.FileIsNoPermissions(r.Uri.file((l=E.path)!==null&&l!==void 0?l:""));case"ENOENT":throw g.FileNotFound(r.Uri.file((b=E.path)!==null&&b!==void 0?b:""));case"ENOTDIR":throw g.FileNotADirectory(r.Uri.file((y=E.path)!==null&&y!==void 0?y:""));case"EISDIR":throw g.FileIsADirectory(r.Uri.file((A=E.path)!==null&&A!==void 0?A:""))}throw E}},42933:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(79929),t),n.__exportStar(e(49818),t),n.__exportStar(e(28217),t),n.__exportStar(e(91813),t),n.__exportStar(e(50295),t)},70671:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiskFileServiceProtocol=void 0;const n=e(26387),r=e(52890),o=e(50295);t.DiskFileServiceProtocol={name:o.DiskFileServicePath,methods:[{method:"readFile",request:[{name:"uri",type:r.UriComponentsProto}],response:{type:n.Type.binary()}}]}},50295:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileExtServicePath=t.FileWatcherServicePath=t.ShadowFileServicePath=t.DiskFileServicePath=t.FileServicePath=void 0,t.FileServicePath="FileService",t.DiskFileServicePath="DiskFileService",t.ShadowFileServicePath="ShadowFileService",t.FileWatcherServicePath="FileWatcherService",t.FileExtServicePath="FileExtServicePath"},28217:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WatcherProcessManagerProxy=t.WatcherServiceProxy=t.WATCHER_INIT_DATA_KEY=t.SUMI_WATCHER_PROCESS_SOCK_KEY=t.INsfw=void 0;const n=e(86058);var r;(function(o){let c;(function(p){p[p.CREATED=0]="CREATED",p[p.DELETED=1]="DELETED",p[p.MODIFIED=2]="MODIFIED",p[p.RENAMED=3]="RENAMED"})(c=o.actions||(o.actions={}))})(r||(t.INsfw=r={})),t.SUMI_WATCHER_PROCESS_SOCK_KEY="sumi-watcher-process-sock",t.WATCHER_INIT_DATA_KEY="sumi-watcher-init-data",t.WatcherServiceProxy=new n.ProxyIdentifier("WatcherHostServiceImpl"),t.WatcherProcessManagerProxy=new n.ProxyIdentifier("WatcherProcessManagerProxy")},14951:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(42933),t)},57942:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeDialogModel=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(26542),m=e(6250),_=e(2812),s=r.__importDefault(e(89200)),g=e(9018);let a=n=class{static createContainer(u,d){return u.createChild([{token:m.IFileDialogTreeService,useValue:d},{token:m.IFileDialogModel,useClass:n}])}static createModel(u,d){return n.createContainer(u,d).get(m.IFileDialogModel)}constructor(){this.selectedDecoration=new c.Decoration(s.default.mod_selected),this.focusedDecoration=new c.Decoration(s.default.mod_focused),this.loadingDecoration=new c.Decoration(s.default.mod_loading),this.cutDecoration=new c.Decoration(s.default.mod_cut),this._selectedFiles=[],this.disposableCollection=new p.DisposableCollection,this.onDidFocusedFileChangeEmitter=new p.Emitter,this.onDidSelectedFileChangeEmitter=new p.Emitter,this.clearFileSelectedDecoration=()=>{this._selectedFiles.forEach(u=>{this.selectedDecoration.removeTarget(u)}),this._selectedFiles=[],this.onDidSelectedFileChangeEmitter.fire([])},this.activeFileDecoration=(u,d=!0)=>{u!==this.treeModel.root&&(this.preContextMenuFocusedFile&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile),this.preContextMenuFocusedFile=null),u&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(E=>{this.selectedDecoration.removeTarget(E)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(u),this.focusedDecoration.addTarget(u),this._focusedFile=u,this._selectedFiles=[u],this.onDidFocusedFileChangeEmitter.fire(u.uri),this.onDidSelectedFileChangeEmitter.fire([u.uri]),d&&this.treeModel.dispatchChange()))},this.selectFileDecoration=(u,d=!0)=>{u!==this.treeModel.root&&(this.preContextMenuFocusedFile&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile),this.preContextMenuFocusedFile=null),u&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(E=>{this.selectedDecoration.removeTarget(E)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(u),this._selectedFiles=[u],this.onDidSelectedFileChangeEmitter.fire([u.uri]),d&&this.treeModel.dispatchChange()))},this.activeFileFocusedDecoration=(u,d=!1)=>{u!==this.treeModel.root&&(this.focusedFile!==u&&(d?(this.preContextMenuFocusedFile?(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile)):this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.preContextMenuFocusedFile=u):this.focusedFile&&(this.preContextMenuFocusedFile=null,this.focusedDecoration.removeTarget(this.focusedFile)),u&&(this.selectedDecoration.addTarget(u),this.focusedDecoration.addTarget(u),this._focusedFile=u,this._selectedFiles.push(u),this.onDidFocusedFileChangeEmitter.fire(u.uri),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(E=>E.uri)))),this.treeModel.dispatchChange())},this.activeFileSelectedDecoration=u=>{this._selectedFiles.indexOf(u)>-1||(this._selectedFiles.push(u),this.selectedDecoration.addTarget(u),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(d=>d.uri)),this.treeModel.dispatchChange())},this.activeFileDecorationByRange=(u,d)=>{for(this.clearFileSelectedDecoration(),this.preContextMenuFocusedFile=null;u<=d;u++){const E=this.treeModel.root.getTreeNodeAtIndex(u);E&&(this._selectedFiles.push(E),this.selectedDecoration.addTarget(E))}this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(E=>E.uri)),this.treeModel.dispatchChange()},this.enactiveFileDecoration=()=>{this.focusedFile&&(this.focusedDecoration.removeTarget(this.focusedFile),this.onDidFocusedFileChangeEmitter.fire(),this.treeModel.dispatchChange()),this._focusedFile=void 0},this.toggleDirectory=async u=>{u.expanded?this.fileTreeHandle.collapseNode(u):this.fileTreeHandle.expandNode(u)},this.handleTreeBlur=()=>{this.enactiveFileDecoration()},this.handleTreeFocus=()=>{},this.handleItemRangeClick=(u,d)=>{if(!this.focusedFile)this.handleItemClick(u,d);else if(this.focusedFile&&this.focusedFile!==u){const E=this.treeModel.root.getIndexAtTreeNode(u),f=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);f>E?this.activeFileDecorationByRange(E,f):f<E&&this.activeFileDecorationByRange(f,E)}},this.handleItemToggleClick=(u,d)=>{d!==c.TreeNodeType.CompositeTreeNode&&d!==c.TreeNodeType.TreeNode||(this.selectedFiles.indexOf(u)>-1?this.focusedFile===u?this.enactiveFileDecoration():this.activeFileFocusedDecoration(u):this.activeFileSelectedDecoration(u))},this.handleItemClick=(u,d)=>{this.clickTimes++,(d===c.TreeNodeType.CompositeTreeNode||d===c.TreeNodeType.TreeNode)&&this.activeFileDecoration(u),d===c.TreeNodeType.CompositeTreeNode&&this.corePreferences["workbench.list.openMode"]==="singleClick"&&this.toggleDirectory(u),this.clickTimer&&clearTimeout(this.clickTimer),this.clickTimer=setTimeout(()=>{this.clickTimes>1&&d!==c.TreeNodeType.TreeNode&&this.corePreferences["workbench.list.openMode"]==="doubleClick"&&this.toggleDirectory(u),this.clickTimes=0},200)},this.getDirectoryList=()=>this.fileTreeDialogService.getDirectoryList(),this._whenReady=this.initTreeModel()}get onDidFocusedFileChange(){return this.onDidFocusedFileChangeEmitter.event}get onDidSelectedFileChange(){return this.onDidSelectedFileChangeEmitter.event}get fileTreeHandle(){return this._fileTreeHandle}get decorations(){return this._decorations}get treeModel(){return this._treeModel}get whenReady(){return this._whenReady}get focusedFile(){return this._focusedFile}get selectedFiles(){return this._selectedFiles}async initTreeModel(){const u=(await this.fileTreeDialogService.resolveChildren())[0];this._treeModel=this.injector.get(_.FileTreeModel,[u]),this.initDecorations(u),this.disposableCollection.push(this._decorations),this.disposableCollection.push(this.labelService.onDidChange(()=>{this.treeModel.dispatchChange()})),this.disposableCollection.push(this.treeModel.root.watcher.on(c.TreeNodeEvent.WillResolveChildren,d=>{this.loadingDecoration.addTarget(d)})),this.disposableCollection.push(this.treeModel.root.watcher.on(c.TreeNodeEvent.DidResolveChildren,d=>{this.loadingDecoration.removeTarget(d)}))}async updateTreeModel(u){const d=await this.fileTreeDialogService.resolveRoot(u);if(d&&d.length>0){const E=d[0];this._treeModel=this.injector.get(_.FileTreeModel,[E]),this.clearFileSelectedDecoration(),this.initDecorations(E)}}initDecorations(u){this._decorations&&this._decorations.dispose(),this._decorations=new c.DecorationsManager(u),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.cutDecoration),this._decorations.addDecoration(this.loadingDecoration)}handleTreeHandler(u){this._fileTreeHandle=u}dispose(){this.disposableCollection.dispose()}};t.FileTreeDialogModel=a,a.FILE_TREE_SNAPSHOT_KEY="FILE_TREE_SNAPSHOT",a.DEFAULT_LOCATION_FLUSH_DELAY=500,r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],a.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(m.IFileDialogTreeService),r.__metadata("design:type",g.FileTreeDialogService)],a.prototype,"fileTreeDialogService",void 0),r.__decorate([(0,o.Autowired)(v.LabelService),r.__metadata("design:type",v.LabelService)],a.prototype,"labelService",void 0),r.__decorate([(0,o.Autowired)(p.CorePreferences),r.__metadata("design:type",Object)],a.prototype,"corePreferences",void 0),t.FileTreeDialogModel=a=n=r.__decorate([(0,o.Injectable)(),r.__metadata("design:paramtypes",[])],a)},69748:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FILE_TREE_BADGE_LIMIT=t.FILE_TREE_NODE_HEIGHT=t.FileTreeDialogNode=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=e(97267),p=e(41869),v=e(69959),m=n.__importDefault(e(89200)),_=({item:s,onClick:g,itemType:a,labelService:h,leftPadding:u=8,onTwistierClick:d,decorations:E,defaultLeftPadding:f=8,template:l})=>{const b=a===c.TreeNodeType.RenamePrompt,y=a===c.TreeNodeType.NewPrompt,A=b||y,S=(0,p.useDesignStyles)(m.default.expansion_toggle,"expansion_toggle"),w=(0,p.useDesignStyles)(m.default.file_tree_node,"file_tree_node"),T=W=>{(a===c.TreeNodeType.TreeNode||a===c.TreeNodeType.CompositeTreeNode)&&g(W,s,a)},D=W=>{(a===c.TreeNodeType.TreeNode||a===c.TreeNodeType.CompositeTreeNode)&&(d?d(W,s,a):g(W,s,a))},I=a===c.TreeNodeType.CompositeTreeNode;let O;A?y?O=`${f+(s.parent.depth+1||0)*(u||0)}px`:O=`${f+(s.target.depth||0)*(u||0)}px`:O=I?`${f+(s.depth||0)*(u||0)}px`:`${f+(s.depth||0)*(u||0)+8}px`;const M={height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`,paddingLeft:O},R=(W,U)=>{if(E&&E?.classlist.indexOf(m.default.mod_loading)>-1)return o.default.createElement(c.Loading,null);if(A&&W instanceof c.PromptHandle){let Q=!1;if(b?Q=W.target.type===c.TreeNodeType.CompositeTreeNode:Q=W.type===c.TreeNodeType.CompositeTreeNode,Q)return o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,S,(0,p.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:y||!(b&&W.target.type===c.TreeNodeType.CompositeTreeNode&&W.target.expanded)})})}else return o.default.createElement("div",{onClick:U,className:(0,r.default)(m.default.file_tree_node_segment,S,(0,p.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:!W.expanded})})},P=W=>{let U,Q;A&&W instanceof c.PromptHandle?W instanceof c.RenamePromptHandle?(U=W.target.uri.resolve(W.$.value),Q=v.Directory.is(W.target)):(U=W.parent.uri.resolve(W.$.value),Q=W.type===c.TreeNodeType.CompositeTreeNode):(U=W.uri,Q=W.filestat.isDirectory);const V=h.getIcon(U,{isDirectory:Q});return o.default.createElement("div",{className:(0,r.default)(m.default.file_icon,V,{expanded:Q&&W.expanded}),style:{height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`}})},k=W=>l?o.default.createElement(l,null):A&&W instanceof c.PromptHandle?o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_inputbox)},o.default.createElement("div",{className:(0,r.default)("input-box",m.default.file_tree_node_prompt_box)},o.default.createElement(W.ProxiedInput,{wrapperStyle:{height:t.FILE_TREE_NODE_HEIGHT,padding:"0 5px"}}))):o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_displayname)},W.name),F=()=>o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_tail)},L()),L=()=>null,B=W=>{if(I)return R(W,D);if(A)return R(W,()=>{})},j=()=>s.tooltip||s.name;return o.default.createElement("div",{key:s.id,onClick:T,title:j(),className:(0,r.default)(w,E?E.classlist:null),style:M,draggable:a===c.TreeNodeType.TreeNode||a===c.TreeNodeType.CompositeTreeNode},o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_content)},B(s),P(s),o.default.createElement("div",{className:A?m.default.file_tree_node_prompt_wrap:m.default.file_tree_node_overflow_wrap},k(s)),F()))};t.FileTreeDialogNode=_,t.FILE_TREE_NODE_HEIGHT=22,t.FILE_TREE_BADGE_LIMIT=99},68195:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileDialogContextKey=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(66e3);let p=class{initScopedContext(m){this._contextKeyService=this.globalContextKeyService.createScoped(m),this.fileDialogViewVisibleContext=c.FileDialogViewVisibleContext.bind(this._contextKeyService)}get service(){return this._contextKeyService}};t.FileDialogContextKey=p,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],p.prototype,"globalContextKeyService",void 0),t.FileDialogContextKey=p=n.__decorate([(0,r.Injectable)()],p)},9018:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeDialogService=void 0;const n=e(85608),r=e(76003),o=e(97267),c=e(41869),p=e(26542),v=e(54414),m=e(14951),_=e(72665),s=e(51500),g=e(6250),a=e(57781),h=e(97738),u=e(68195);let d=class extends o.Tree{constructor(f){super(),this._whenReady=this.resolveWorkspaceRoot(f)}get whenReady(){return this._whenReady}async resolveWorkspaceRoot(f){if(f){const l=new c.URI(f).withScheme(c.Schemes.file),b=await this.fileTreeAPI.resolveFileStat(l);b&&(this.workspaceRoot=b)}}async resolveChildren(f){if(f){if(f.uri){const{children:l}=await this.fileTreeAPI.resolveChildren(this,f.uri.toString(),f);return l}}else{this.workspaceRoot||(this.workspaceRoot=(await this.workspaceService.roots)[0]);const{children:l}=await this.fileTreeAPI.resolveChildren(this,this.workspaceRoot);return this.root=l[0],l}return[]}async resolveRoot(f){let l;/^file:\/\//.test(f)&&(l=new c.URI(f)),l=c.URI.file(f);const b=await this.fileTreeAPI.resolveFileStat(l);if(b){const{children:y}=await this.fileTreeAPI.resolveChildren(this,b);return this.root=y[0],y}}getDirectoryList(){const f=[];if(!this.root)return f;let l=new c.URI(this.workspaceRoot.uri);if(l&&l.parent)for(;l.parent;){const b=l.codeUri.fsPath;if(f.indexOf(b)>=0)break;f.push(b),l=l.parent}else f.push(l.codeUri.fsPath.toString());return f}sortComparator(f,l){return f.constructor===l.constructor?f.name.startsWith(".")&&!l.name.startsWith(".")?1:!f.name.startsWith(".")&&l.name.startsWith(".")?-1:f.name.localeCompare(l.name,"kn",{numeric:!0}):f.type===o.TreeNodeType.CompositeTreeNode?-1:l.type===o.TreeNodeType.CompositeTreeNode?1:0}initContextKey(f){f&&this.fileDialogContextKey.initScopedContext(f)}get contextKey(){return this.fileDialogContextKey}async saveAs(f){const{oldFilePath:l,newFilePath:b}=f;if(!l||!b)throw new Error("oldFilePath and newFilePath are required");await this.createFile(f);try{const y=c.URI.file(f.newFilePath),A={preview:!1,focus:!0,replace:!0,forceClose:!0,disableNavigate:!1};await this.workbenchEditorService.open(y,A),await this.fileTreeModelService.clearFileSelectedDecoration();const S=this.fileTreeService.getNodeByPathOrUri(y);S&&await this.fileTreeModelService.activeFileDecoration(S)}catch(y){throw new Error(`Failed to open saveAs file: ${y.message}`)}}async createFile(f){try{const{oldFilePath:l,newFilePath:b}=f;if(!await this.fileServiceClient.getFileStat(l))throw new Error(`Source file not found: ${l}`);const{content:A}=await this.fileServiceClient.readFile(l);await this.fileServiceClient.createFile(b,{content:A.toString(),encoding:"utf8",overwrite:!0})}catch(l){throw new Error(`Failed to create file: ${l.message}`)}}renderCustomMsg(){return null}async getDefaultFilePath(f,l){return l}dispose(){super.dispose()}};t.FileTreeDialogService=d,n.__decorate([(0,r.Autowired)(g.IFileTreeAPI),n.__metadata("design:type",Object)],d.prototype,"fileTreeAPI",void 0),n.__decorate([(0,r.Autowired)(s.IWorkspaceService),n.__metadata("design:type",Object)],d.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(p.LabelService),n.__metadata("design:type",p.LabelService)],d.prototype,"labelService",void 0),n.__decorate([(0,r.Autowired)(u.FileDialogContextKey),n.__metadata("design:type",u.FileDialogContextKey)],d.prototype,"fileDialogContextKey",void 0),n.__decorate([(0,r.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],d.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(v.WorkbenchEditorService),n.__metadata("design:type",v.WorkbenchEditorService)],d.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(_.IDialogService),n.__metadata("design:type",Object)],d.prototype,"dialogService",void 0),n.__decorate([(0,r.Autowired)(h.FileTreeModelService),n.__metadata("design:type",h.FileTreeModelService)],d.prototype,"fileTreeModelService",void 0),n.__decorate([(0,r.Autowired)(g.IFileTreeService),n.__metadata("design:type",a.FileTreeService)],d.prototype,"fileTreeService",void 0),t.FileTreeDialogService=d=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[String])],d)},51888:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileDialog=t.FILE_TREE_DIALOG_HEIGHT=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),c=e(41869),p=e(68974),v=e(72665),m=e(69748),_=n.__importDefault(e(13294));t.FILE_TREE_DIALOG_HEIGHT=22;const s=({options:g,model:a,isOpenDialog:h,fileService:u})=>{const d=(0,c.useInjectable)(v.IDialogService),E=(0,r.useRef)(null),[f,l]=(0,r.useState)(g.defaultFileName||""),[b,y]=(0,r.useState)(!1),[A,S]=(0,r.useState)(""),[w,T]=(0,r.useState)([]),D=(0,r.useRef)(g.defaultFileName||"");(0,r.useEffect)(()=>{var ie;return a&&(y(!1),R(),(ie=u.contextKey.fileDialogViewVisibleContext)===null||ie===void 0||ie.set(!0)),()=>{a.dispose()}},[a]),(0,r.useEffect)(()=>{g.defaultFileName&&(l(g.defaultFileName||""),D.current=g.defaultFileName||"")},[g]),(0,r.useEffect)(()=>{if(b){const ie=a.getDirectoryList();T(ie)}},[b]);const I=(0,r.useCallback)(()=>{const ie=a.selectedFiles.map(oe=>oe.uri.path.toString());if(D.current&&g.showNameInput&&(ie?.length===1||g.defaultUri)){const oe=ie?.length===1?ie[0]:g.defaultUri.path.toString();g?.saveAs&&u.saveAs({oldFilePath:c.path.join(oe,g?.defaultFileName||""),newFilePath:c.path.join(oe,D.current)}),d.hide([c.path.join(oe,D.current)])}else ie.length>0?d.hide(ie):A?d.hide([A]):g.defaultUri?d.hide([g.defaultUri.path.toString()]):a.treeModel&&a.treeModel.root?d.hide([a.treeModel.root.uri.path.toString()]):d.hide([]);y(!1),u.contextKey.fileDialogViewVisibleContext.set(!1)},[b,d,a,g,A]),O=async ie=>{let oe=ie.treeModel.root.uri.codeUri.fsPath;return u.getDefaultFilePath&&(oe=await u.getDefaultFilePath(ie,oe)),oe},M=(0,r.useCallback)(()=>{y(!1),d.hide(),u.contextKey.fileDialogViewVisibleContext.set(!1)},[b,d]),R=(0,r.useCallback)(async()=>{await a.whenReady,await a.treeModel.ensureReady;const ie=await O(a);S(ie),y(!0)},[a,A,b]),P=!h,k=(0,r.useCallback)(ie=>{a.handleTreeHandler({...ie,getModel:()=>a.treeModel})},[a]),F=(0,r.useCallback)((ie,oe)=>{ie.stopPropagation();const{toggleDirectory:le}=a;le(oe)},[a]),L=(0,r.useCallback)(ie=>B(ie)?!1:ie.shiftKey,[]),B=(0,r.useCallback)(ie=>{const{metaKey:oe,ctrlKey:le}=ie;return c.isMacintosh&&oe||le},[]),j=(0,r.useCallback)((ie,oe,le)=>{var pe;ie.stopPropagation();const{handleItemClick:q,handleItemToggleClick:Ee,handleItemRangeClick:_e}=a;if(!oe)return;const ne=L(event),ge=B(event);if(ne&&!P&&g.canSelectMany)_e(oe,le);else if(ge&&!P&&g.canSelectMany)Ee(oe,le);else if(P)le===o.TreeNodeType.CompositeTreeNode&&q(oe,le);else if(g.canSelectFiles&&le===o.TreeNodeType.TreeNode){const we=new Set(Object.values((pe=g.filters)!==null&&pe!==void 0?pe:{}).flat().map(Pe=>`.${Pe}`));if(we.size>0){const Pe=c.URI.parse(oe.filestat.uri).path.ext;we.has(Pe)&&q(oe,le)}else q(oe,le)}else g.canSelectFolders&&le===o.TreeNodeType.CompositeTreeNode&&q(oe,le)},[a,P,g]),W=(0,r.useCallback)(async ie=>{y(!1),S(ie),await a.updateTreeModel(ie),y(!0)},[a,b,A]),U=(0,r.useCallback)(async ie=>{y(!1),S(ie),await a.updateTreeModel(ie),y(!0)},[a,b,A,w]),Q=(0,r.useCallback)(()=>u.renderCustomMsg?u.renderCustomMsg():null,[u.renderCustomMsg]),V=(0,r.useCallback)(ie=>r.default.createElement(m.FileTreeDialogNode,{item:ie.item,itemType:ie.itemType,labelService:a.labelService,decorations:a.decorations.getDecorations(ie.item),onClick:j,onTwistierClick:F,defaultLeftPadding:8,leftPadding:8}),[a.treeModel]),$=(0,r.useCallback)(()=>{if(b){if(a.treeModel)return r.default.createElement(o.RecycleTree,{height:300,itemHeight:t.FILE_TREE_DIALOG_HEIGHT,onReady:k,model:a.treeModel},V)}else return r.default.createElement(p.Progress,{loading:!0})},[b,a]),Y=(0,r.useMemo)(()=>u.showFilePathSearch!==!1,[u.showFilePathSearch]),H=(0,r.useCallback)(()=>{if(w.length>0)return r.default.createElement(o.Select,{onChange:W,onSearchChange:U,className:_.default.select_control,size:"large",searchPlaceholder:A,value:A,showSearch:Y},w.map((ie,oe)=>r.default.createElement(o.Option,{value:ie,key:`${oe} - ${ie}`},ie)))},[w,A]),z=(0,r.useCallback)(ie=>{const{key:oe}=c.KeyCode.createKeyCode(ie),le=ie.shiftKey||ie.metaKey||ie.altKey||ie.ctrlKey;oe&&c.Key.ENTER.keyCode===oe.keyCode&&!le&&I()},[I]);(0,r.useEffect)(()=>{var ie;return E.current&&(u.initContextKey(E.current),u.contextKey.fileDialogViewVisibleContext.set(!0),(ie=E.current)===null||ie===void 0||ie.addEventListener("keyup",z)),()=>{var oe;(oe=E.current)===null||oe===void 0||oe.removeEventListener("keyup",z)}},[]);const K=(0,r.useMemo)(()=>r.default.createElement(r.default.Fragment,null,Q(),r.default.createElement("div",{className:_.default.file_dialog_directory},H()),r.default.createElement("div",{className:_.default.file_dialog_content},$())),[H,$]),Z=(0,r.useMemo)(()=>r.default.createElement("div",{className:_.default.file_dialog_buttons},r.default.createElement(o.Button,{onClick:M,type:"ghost",className:_.default.button},(0,c.localize)("dialog.file.close")),r.default.createElement(o.Button,{onClick:I,type:"primary",className:_.default.button,disabled:P&&g.showNameInput&&f.length===0},h&&g.openLabel||(0,c.localize)("dialog.file.ok"))),[M,I,P,h,f,g]),X=(0,r.useCallback)(ie=>{l(ie.target.value),D.current=ie.target.value},[f]);return r.default.createElement("div",{className:_.default.file_dialog_wrapper,ref:E},r.default.createElement("div",{className:_.default.file_dialog_directory_title},h?g.title||(0,c.localize)("dialog.file.openLabel"):g.saveLabel||(0,c.localize)("dialog.file.saveLabel")),K,!h&&g.showNameInput&&r.default.createElement("div",{className:_.default.file_dialog_file_container},r.default.createElement("span",{className:_.default.file_dialog_file_name},(0,c.localize)("dialog.file.name"),": "),r.default.createElement(o.Input,{size:"small",value:f,autoFocus:!0,selection:{start:0,end:f.indexOf(".")||f.length},onChange:X})),Z)};t.FileDialog=s},89508:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowDialogServiceImpl=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(76003),c=e(41869),p=e(37406),v=e(14951),m=e(72665),_=e(57942),s=n.__importDefault(e(13294)),g=e(9018),a=e(51888);let h=class{constructor(){this.idx=1,this._whenReady=this.init()}async init(){this.recentGlobalStorage=await this.storageProvider(c.STORAGE_NAMESPACE.GLOBAL_RECENT_DATA);const d=await this.recentGlobalStorage.get("RECENT_DIALOG_DEFAULT_URI");if(d)this._defaultUri=new c.URI(d);else{const E=await this.fileServiceClient.getCurrentUserHome();this._defaultUri=new c.URI(E.uri)}}get defaultUri(){return this._defaultUri}get whenReady(){return this._whenReady}async updateRecentDefaultUri(d){this.recentGlobalStorage.set("RECENT_DIALOG_DEFAULT_URI",d.toString()),this._defaultUri=d}async showOpenDialog(d={}){this.dialogService.reset(),await this.whenReady;const E={canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1};if(this.appConfig.isElectronRenderer&&!this.appConfig.isRemote){const f=this.injector.get(p.IElectronMainUIService),l=[];d.canSelectFiles&&l.push("openFile"),d.canSelectFolders&&l.push("openDirectory"),d.canSelectMany&&l.push("multiSelections"),c.isMacintosh&&l.push("treatPackageAsDirectory","createDirectory");const b=d.defaultUri||this.defaultUri,y=await f.showOpenDialog(c.electronEnv.currentWindowId,{defaultPath:b.codeUri.fsPath,title:d.title,buttonLabel:d.openLabel,properties:l});if(y&&y.length>0){const A=y.map(S=>c.URI.file(S));return this.updateRecentDefaultUri(A[0].parent),A}else return}else{d.defaultUri||(d.defaultUri=this.defaultUri);let f;d.defaultUri?f=this.injector.get(g.FileTreeDialogService,[d.defaultUri.toString()]):f=this.injector.get(g.FileTreeDialogService),await f.whenReady;const l=_.FileTreeDialogModel.createModel(this.injector,f),b=await this.dialogService.open({message:r.default.createElement(a.FileDialog,{key:this.idx++,fileService:f,model:l,options:{...E,...d},isOpenDialog:!0}),type:c.MessageType.Empty,buttons:[],closable:!0,props:{className:s.default.file_dialog_wrapper}});if(this.dialogService.reset(),b&&b.length>0){const y=b.map(A=>c.URI.file(A));return this.updateRecentDefaultUri(y[0].parent),y}else return}}async showSaveDialog(d={}){if(await this.whenReady,this.appConfig.isElectronRenderer&&!this.appConfig.isRemote){const E=d.defaultUri||this.defaultUri,l=await this.injector.get(p.IElectronMainUIService).showSaveDialog(c.electronEnv.currentWindowId,{defaultPath:E.resolve(d.defaultFileName||"").codeUri.fsPath,title:d.saveLabel,message:d.saveLabel});if(l){const b=c.URI.file(l);return this.updateRecentDefaultUri(b.parent),b}else return}else{d.defaultUri||(d.defaultUri=this.defaultUri);let E;d.defaultUri?E=this.injector.get(g.FileTreeDialogService,[d.defaultUri.toString()]):E=this.injector.get(g.FileTreeDialogService),await E.whenReady;const f=_.FileTreeDialogModel.createModel(this.injector,E),l=await this.dialogService.open({message:r.default.createElement(a.FileDialog,{key:this.idx++,fileService:E,model:f,options:d,isOpenDialog:!1}),type:c.MessageType.Empty,buttons:[],closable:!0,props:{className:s.default.file_dialog_wrapper}});if(this.dialogService.reset(),l&&l.length>0){const b=c.URI.file(l[0]);return this.updateRecentDefaultUri(b.parent),b}else return}}};t.WindowDialogServiceImpl=h,n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],h.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(m.IDialogService),n.__metadata("design:type",Object)],h.prototype,"dialogService",void 0),n.__decorate([(0,o.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],h.prototype,"fileServiceClient",void 0),n.__decorate([(0,o.Autowired)(c.StorageProvider),n.__metadata("design:type",Function)],h.prototype,"storageProvider",void 0),n.__decorate([(0,o.Autowired)(c.AppConfig),n.__metadata("design:type",Object)],h.prototype,"appConfig",void 0),t.WindowDialogServiceImpl=h=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],h)},88014:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileContextKey=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(16413);let p=class{constructor(){this.explorerResourceIsFolder=c.ExplorerResourceIsFolderContext.bind(this.globalContextKeyService),this.explorerViewletVisibleContext=c.ExplorerViewletVisibleContext.bind(this.globalContextKeyService)}initScopedContext(m){this._contextKeyService=this.globalContextKeyService.createScoped(m),this.explorerFocused=c.ExplorerFocusedContext.bind(this._contextKeyService),this.explorerResourceCut=c.ExplorerResourceCut.bind(this._contextKeyService),this.filesExplorerFocused=c.FilesExplorerFocusedContext.bind(this._contextKeyService),this.filesExplorerInputFocused=c.FilesExplorerInputFocusedContext.bind(this._contextKeyService),this.filesExplorerFilteredContext=c.FilesExplorerFilteredContext.bind(this._contextKeyService),this.explorerCompressedFocusContext=c.ExplorerCompressedFocusContext.bind(this._contextKeyService),this.explorerCompressedFirstFocusContext=c.ExplorerCompressedFirstFocusContext.bind(this._contextKeyService),this.explorerCompressedLastFocusContext=c.ExplorerCompressedLastFocusContext.bind(this._contextKeyService)}get service(){return this._contextKeyService}};t.FileContextKey=p,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],p.prototype,"globalContextKeyService",void 0),t.FileContextKey=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},40439:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(16413),p=e(93899),v=e(68969),m=e(98295),_=e(41893),s=e(54414),g=e(32595),a=e(63067),h=e(58296),u=e(72665),d=e(55121),E=e(51500),f=e(6250),l=e(69959),b=e(56384),y=e(57781),A=e(97738),S=e(4446);let w=class{constructor(){this._disposables=new o.DisposableStore,this.isRendered=!1,this.deleteThrottler=new o.Throttler,this.willDeleteUris=[]}initialize(){this.workspaceService.initFileServiceExclude().then(async()=>{await this.fileTreeService.init(),this.fileTreeModelService.initTreeModel()}),this.progressService.registerProgressIndicator(g.EXPLORER_CONTAINER_ID)}async onStart(){this.viewsRegistry.registerViewWelcomeContent(f.RESOURCE_VIEW_ID,{content:(0,o.formatLocalize)("welcome-view.noFolderHelp",o.FILE_COMMANDS.OPEN_FOLDER.id),group:h.ViewContentGroups.Open,order:1}),this.mainLayoutService.collectViewComponent({id:f.RESOURCE_VIEW_ID,name:this.getWorkspaceTitle(),weight:3,priority:9,collapsed:!1,component:b.FileTree},g.EXPLORER_CONTAINER_ID),this._disposables.add(this.workspaceService.onWorkspaceLocationChanged(()=>{const D=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);D&&D.updateViewTitle(f.RESOURCE_VIEW_ID,this.getWorkspaceTitle())}))}onDidStart(){const D=this.injector.get(S.SymlinkDecorationsProvider,[this.fileTreeService]);this.decorationService.registerDecorationsProvider(D)}onDidRender(){this.isRendered=!0;const D=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);D&&(this.fileTreeModelService.whenReady.then(()=>{this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(D.isActivated())}),D.onActivate(()=>{this.fileTreeModelService.performLocationOnHandleShow(),this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(!0)}),D.onInActivate(()=>{this.fileTreeModelService.handleTreeBlur(),this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(!1)}))}getWorkspaceTitle(){let D=(0,o.localize)("file.empty.defaultTitle");const I=this.workspaceService.workspace;return I&&(D=new o.URI(I.uri).displayName,!I.isDirectory&&D.endsWith(`.${this.workspaceService.workspaceSuffixName}`)&&(D=D.slice(0,D.lastIndexOf(".")),D===E.UNTITLED_WORKSPACE))?(0,o.localize)("file.workspace.defaultTip"):D}revealFile(D){if(D)if(this.isRendered){const I=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);!I||!I.isVisible||I.isCollapsed(f.RESOURCE_VIEW_ID)?this.fileTreeModelService.locationOnShow(D):this.fileTreeModelService.location(D)}else this.fileTreeModelService.locationOnShow(D)}registerMenus(D){D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.NEW_FILE.id,label:(0,o.localize)("file.new")},order:1,group:"0_new"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.NEW_FOLDER.id,label:(0,o.localize)("file.folder.new")},order:2,group:"0_new"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,label:(0,o.localize)("workspace.addFolderToWorkspace")},order:1,group:"0_workspace",when:"config.workspace.supportMultiRootWorkspace"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.WORKSPACE_COMMANDS.REMOVE_WORKSPACE_FOLDER.id,label:(0,o.localize)("workspace.removeFolderFromWorkspace")},order:1,group:"0_workspace",when:"config.workspace.supportMultiRootWorkspace"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_RESOURCES.id,label:(0,o.localize)("file.open")},order:1,group:"1_open"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TO_THE_SIDE.id,label:(0,o.localize)("file.open.side")},order:2,group:"1_open"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TYPE_WITH.id,label:(0,o.localize)("file.open.type")},order:3,group:"1_open"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TERMINAL_WITH_PATH.id,label:(0,o.localize)("file.filetree.openTerminalWithPath")},when:"workbench.panel.terminal",order:4,group:"1_open"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.SEARCH_ON_FOLDER.id,label:(0,o.localize)("file.search.folder")},order:1,group:"2_search"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.DELETE_FILE.id,label:(0,o.localize)("file.delete")},order:1,group:"7_modification"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.RENAME_FILE.id,label:(0,o.localize)("file.rename")},order:3,group:"7_modification"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COMPARE_SELECTED.id,label:(0,o.localize)("file.compare")},order:2,group:"3_compare"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_FILE.id,label:(0,o.localize)("file.copy.file")},order:1,group:"5_cutcopypaste"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.CUT_FILE.id,label:(0,o.localize)("file.cut.file")},order:2,group:"5_cutcopypaste"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.PASTE_FILE.id,label:(0,o.localize)("file.paste.file")},order:3,group:"5_cutcopypaste"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_PATH.id,label:(0,o.localize)("file.copy.path")},group:"6_copypath"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_RELATIVE_PATH.id,label:(0,o.localize)("file.copy.relativepath")},group:"6_copypath"})}registerCommands(D){const I=()=>{this.fileTreeService.filterMode&&this.fileTreeService.toggleFilterMode()};D.registerCommand(o.FILE_COMMANDS.OPEN_TERMINAL_WITH_PATH,{execute:M=>{let R=M;if(!R)return;const P=this.fileTreeService.getNodeByPathOrUri(R);P&&!P.filestat.isDirectory&&(R=P.uri.parent),this.commandService.executeCommand(o.TERMINAL_COMMANDS.OPEN_WITH_PATH.id,R)}}),D.registerCommand(o.FILE_COMMANDS.SEARCH_ON_FOLDER,{execute:async M=>{var R;let P=M;if(P||(this.fileTreeModelService.focusedFile?P=this.fileTreeModelService.focusedFile.uri:this.fileTreeModelService.selectedFiles.length>0&&(P=(R=this.fileTreeModelService.selectedFiles[0])===null||R===void 0?void 0:R.uri)),!P)return;let k;if(this.fileTreeService.isMultipleWorkspace)for(const F of await this.workspaceService.roots){const L=new o.URI(F.uri);if(L.isEqualOrParent(P)){k=`./${L.relative(P).toString()}`;break}}else if(this.workspaceService.workspace){const F=new o.URI(this.workspaceService.workspace.uri);F.isEqualOrParent(P)&&(k=`./${F.relative(P).toString()}`)}this.commandService.executeCommand(o.SEARCH_COMMANDS.OPEN_SEARCH.id,{includeValue:k+"/"})},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&l.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.LOCATION,{execute:M=>{M?this.revealFile(M):this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0&&this.revealFile(this.fileTreeModelService.selectedFiles[0].uri)}}),D.registerCommand(o.FILE_COMMANDS.LOCATION_WITH_EDITOR,{execute:()=>{var M,R,P;((R=(M=this.workbenchEditorService.currentEditor)===null||M===void 0?void 0:M.currentUri)===null||R===void 0?void 0:R.scheme)===o.Schemes.file&&this.revealFile((P=this.workbenchEditorService.currentEditor)===null||P===void 0?void 0:P.currentUri)}}),D.registerCommand(o.FILE_COMMANDS.COLLAPSE_ALL,{execute:()=>{const M=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);!M||!M.isVisible||this.fileTreeModelService.collapseAll()}}),D.registerCommand(o.FILE_COMMANDS.REFRESH_ALL,{execute:async()=>{const M=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);!M||!M.isVisible||await this.fileTreeService.refresh()}}),D.registerCommand(o.FILE_COMMANDS.DELETE_FILE,{execute:(M,R)=>{if(I(),R?this.willDeleteUris=this.willDeleteUris.concat(R):this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0?this.willDeleteUris=this.willDeleteUris.concat(this.fileTreeModelService.selectedFiles.map(P=>P.uri)):this.fileTreeModelService.focusedFile&&this.willDeleteUris.push(this.fileTreeModelService.focusedFile.uri),this.willDeleteUris.length!==0)return this.deleteThrottler.queue(this.doDelete.bind(this))},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.RENAME_FILE,{execute:M=>{if(I(),!M)if(this.fileTreeModelService.contextMenuFile)M=this.fileTreeModelService.contextMenuFile.uri;else if(this.fileTreeModelService.focusedFile)M=this.fileTreeModelService.focusedFile.uri;else return;this.fileTreeModelService.renamePrompt(M)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.NEW_FILE,{execute:async M=>{var R;if(I(),M)this.fileTreeModelService.newFilePrompt(M);else if(this.fileTreeService.isCompactMode&&this.fileTreeModelService.activeUri)this.fileTreeModelService.newFilePrompt(this.fileTreeModelService.activeUri);else if(this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0)this.fileTreeModelService.newFilePrompt(this.fileTreeModelService.selectedFiles[0].uri);else{let P;this.fileTreeService.isMultipleWorkspace?P=new o.URI((await this.workspaceService.roots)[0].uri):P=new o.URI((R=this.workspaceService.workspace)===null||R===void 0?void 0:R.uri),this.fileTreeModelService.newFilePrompt(P)}}}),D.registerCommand(o.FILE_COMMANDS.NEW_FOLDER,{execute:async M=>{var R;if(I(),M)this.fileTreeModelService.newDirectoryPrompt(M);else if(this.fileTreeService.isCompactMode&&this.fileTreeModelService.activeUri)this.fileTreeModelService.newDirectoryPrompt(this.fileTreeModelService.activeUri);else if(this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0)this.fileTreeModelService.newDirectoryPrompt(this.fileTreeModelService.selectedFiles[0].uri);else{let P;this.fileTreeService.isMultipleWorkspace?P=new o.URI((await this.workspaceService.roots)[0].uri):P=new o.URI((R=this.workspaceService.workspace)===null||R===void 0?void 0:R.uri),this.fileTreeModelService.newDirectoryPrompt(P)}}}),D.registerCommand(o.FILE_COMMANDS.COMPARE_SELECTED,{execute:(M,R)=>{if(R&&R.length){const P=this.workbenchEditorService.currentEditor;P&&P.currentUri&&this.fileTreeService.compare(R[0],P.currentUri)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!l.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.OPEN_RESOURCES,{execute:M=>{this.fileTreeService.openAndFixedFile(M)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!l.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.OPEN_TO_THE_SIDE,{execute:M=>{this.fileTreeService.openToTheSide(M)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!l.Directory.is(this.fileTreeModelService.contextMenuFile)});const O=(M,R)=>{const{availableOpenTypes:P,currentOpenType:k}=this.workbenchEditorService.currentEditorGroup;if(!(P&&M&&k))return{items:[],selectIndex:-1};const F=this.preferenceService.get("workbench.editorAssociations"),L=[],B=(Q,V)=>V.type===s.EditorOpenType.code?Q.type===s.EditorOpenType.code:V.type===s.EditorOpenType.component&&Q.type===s.EditorOpenType.component?Q.componentId===V.componentId:!1,j=(Q,V)=>(Q?Q+=(0,o.localize)("file.open.type.detail.and")+V:Q=V,Q);let W,U;if(F){const Q=Object.keys(F).find(V=>(0,o.match)(V,M.path.toString().toLowerCase())||(0,o.match)(V,M.path.base.toLowerCase()));W=Q&&F[Q]}return P.forEach((Q,V)=>{var $;const Y={label:Q.title||Q.componentId||Q.type,detail:Q.title,run:H=>R(H,Q)};B(k,Q)&&(Y.description=j(Y.description,(0,o.localize)("file.open.type.detail.active")),U=V),W&&(!(($=Q.componentId)===null||$===void 0)&&$.endsWith(W))&&(Y.description=j(Y.description,(0,o.localize)("file.open.type.detail.default"))),L.push(new o.QuickOpenItem(Y))}),{items:L,selectIndex:U}};D.registerCommand(o.FILE_COMMANDS.OPEN_TYPE_WITH,{execute:M=>{const R=(L,B)=>{var j,W;return L===o.Mode.OPEN?((j=this.workbenchEditorService.currentEditorGroup)===null||j===void 0||j.changeOpenType((W=B.componentId)!==null&&W!==void 0?W:B.type),!0):!1},{items:P,selectIndex:k}=O(M,R);if(P.length===0||typeof k>"u")return;const F=L=>{this.quickOpenService.open({onType:(B,j)=>j(L)},{fuzzyMatchLabel:!0,ignoreFocusOut:!1,placeholder:(0,o.formatLocalize)("file.open.type.placeholder",M.path.base),selectIndex:()=>k})};P.push(new o.QuickOpenItem({label:(0,o.formatLocalize)("file.open.type.preference.default",`*${M.path.ext}`),showBorder:!0,run:L=>{if(L===o.Mode.OPEN){const B=(U,Q)=>{var V,$,Y;if(U===o.Mode.OPEN){const H="workbench.editorAssociations",z=this.preferenceService.resolve(H).scope,K=this.preferenceService.get(H);return this.preferenceService.set(H,{...K||{},[`*${M.path.ext}`]:(V=Q.componentId)!==null&&V!==void 0?V:Q.type},z),($=this.workbenchEditorService.currentEditorGroup)===null||$===void 0||$.changeOpenType((Y=Q.componentId)!==null&&Y!==void 0?Y:Q.type),!0}return!1},{items:j,selectIndex:W}=O(M,B);if(j.length===0||typeof W>"u")return!0;F(j)}return!1}})),F(P)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!l.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.COPY_PATH,{execute:async M=>{if(!M)return;let P=M.path.toString();if(M.scheme===s.DIFF_SCHEME){const F=M.getParsedQuery();P=new o.URI(F.modified).path.toString()}let k=decodeURIComponent(P);await this.appService.backendOS===o.OperatingSystem.Windows&&(k=k.slice(1)),await this.clipboardService.writeText(k)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile}),D.registerCommand(o.FILE_COMMANDS.COPY_RELATIVE_PATH,{execute:async M=>{if(!M)return;if(M.scheme===s.DIFF_SCHEME){const k=M.getParsedQuery();M=new o.URI(k.modified).withScheme("file")}const R=this.fileTreeService.getNodeByPathOrUri(M);if(R&&R.filestat.isInSymbolicDirectory)return await this.clipboardService.writeText(R.path.split(d.Path.separator).slice(2).join(d.Path.separator));let P;if(this.fileTreeService.isMultipleWorkspace)for(const k of await this.workspaceService.roots){if(P=new o.URI(k.uri),P.isEqual(M))return await this.clipboardService.writeText("./");if(P.isEqualOrParent(M))return await this.clipboardService.writeText(decodeURIComponent(P.relative(M).toString()))}else if(this.workspaceService.workspace)return P=new o.URI(this.workspaceService.workspace.uri),P.isEqual(M)?await this.clipboardService.writeText("./"):await this.clipboardService.writeText(decodeURIComponent(P.relative(M).toString()))},isVisible:()=>!!this.fileTreeModelService.contextMenuFile}),D.registerCommand(o.FILE_COMMANDS.COPY_FILE,{execute:(M,R)=>{if(R&&R.length)this.fileTreeModelService.copyFile(R);else{const P=this.fileTreeModelService.selectedFiles.map(k=>k.uri);P&&P.length&&this.fileTreeModelService.copyFile(P)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)||!!this.fileTreeModelService.focusedFile&&!this.fileTreeModelService.focusedFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.SELECT_CURRENT_NODE,{execute:(M,R)=>{if(R&&R.length)this.fileTreeModelService.selectChildNode(R);else{const P=this.fileTreeModelService.selectedFiles.map(k=>k.uri);P&&P.length&&this.fileTreeModelService.selectChildNode(P)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)||!!this.fileTreeModelService.focusedFile&&!this.fileTreeModelService.focusedFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.CUT_FILE,{execute:(M,R)=>{if(R&&R.length)this.fileTreeModelService.cutFile(R);else{const P=this.fileTreeModelService.selectedFiles.map(k=>k.uri);P&&P.length&&this.fileTreeModelService.cutFile(P)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)||!!this.fileTreeModelService.focusedFile&&!this.fileTreeModelService.focusedFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.PASTE_FILE,{execute:M=>{if(I(),M)this.fileTreeModelService.pasteFile(M);else if(this.fileTreeModelService.focusedFile){let R;this.fileTreeModelService.activeUri?R=this.fileTreeModelService.activeUri:R=this.fileTreeModelService.focusedFile.uri,this.fileTreeModelService.pasteFile(R)}},isEnabled:()=>this.fileTreeModelService.pasteStore&&this.fileTreeModelService.pasteStore.type!==f.PasteTypes.NONE||this.appConfig.isElectronRenderer}),D.registerCommand(o.FILE_COMMANDS.VSCODE_OPEN_FOLDER,{execute:(M,R)=>{const P=this.injector.get(o.IWindowService),k={newWindow:!0};return typeof R=="boolean"?k.newWindow=R:k.newWindow=typeof R?.forceNewWindow=="boolean"?R.forceNewWindow:!0,M?P.openWorkspace(M,k):this.commandService.executeCommand(o.FILE_COMMANDS.OPEN_FOLDER.id,k)},isVisible:()=>{const M=this.preferenceService.get("application.supportsOpenFolder");return M??!1}}),D.registerCommand(o.FILE_COMMANDS.OPEN_FOLDER,{execute:M=>{const R=this.injector.get(o.IWindowService);this.appConfig.isElectronRenderer?this.injector.get(o.IElectronNativeDialogService).showOpenDialog({title:(0,o.localize)("workspace.openDirectory"),properties:["openDirectory"]}).then(k=>{k&&k.length>0&&R.openWorkspace(o.URI.file(k[0]),M||{newWindow:!0})}):this.injector.get(u.IWindowDialogService).showOpenDialog({title:(0,o.localize)("workspace.openDirectory"),canSelectFiles:!1,canSelectFolders:!0}).then(k=>{var F;k&&k.length>0&&this.injector.get(E.IWorkspaceService).open(k[0],{preserveWindow:(F=M?.newWindow)!==null&&F!==void 0?F:!1})})},isVisible:()=>{const M=this.preferenceService.get("application.supportsOpenFolder");return M??!1}}),D.registerCommand(o.FILE_COMMANDS.OPEN_WORKSPACE,{execute:M=>{if(!this.preferenceService.get("application.supportsOpenWorkspace"))return;const P=this.injector.get(o.IWindowService);this.appConfig.isElectronRenderer?this.injector.get(o.IElectronNativeDialogService).showOpenDialog({title:(0,o.localize)("workspace.openWorkspace"),properties:["openFile"],filters:[{name:(0,o.localize)("workspace.openWorkspaceTitle"),extensions:[this.workspaceService.workspaceSuffixName]}]}).then(F=>{F&&F.length>0&&P.openWorkspace(o.URI.file(F[0]),M||{newWindow:!0})}):this.injector.get(u.IWindowDialogService).showOpenDialog({title:(0,o.localize)("workspace.openWorkspace"),canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1,filters:{workspace:[this.workspaceService.workspaceSuffixName]}}).then(F=>{var L;F&&F.length>0&&this.injector.get(E.IWorkspaceService).open(F[0],{preserveWindow:(L=M?.newWindow)!==null&&L!==void 0?L:!1})})},isVisible:()=>{const M=this.preferenceService.get("application.supportsOpenWorkspace");return M??!1}}),D.registerCommand(o.FILE_COMMANDS.REVEAL_IN_EXPLORER,{execute:M=>{var R;let P=M instanceof o.URI?M:M?.uri;const k=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);k&&!k.isVisible&&(k.activate(),setTimeout(()=>{k.setCollapsed(f.RESOURCE_VIEW_ID,!1)},200)),!P&&(!((R=this.workbenchEditorService.currentEditor)===null||R===void 0)&&R.currentUri)&&(P=this.workbenchEditorService.currentEditor.currentUri),P&&this.revealFile(o.URI.parse(P.toString()))}}),D.registerCommand(o.FILE_COMMANDS.FOCUS_FILES,{execute:()=>{const M=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);M&&M.activate()}}),D.registerCommand(o.FILE_COMMANDS.OPEN_FILE,{execute:M=>this.windowDialogService.showOpenDialog(M)}),D.registerCommand(o.FILE_COMMANDS.SAVE_FILE,{execute:M=>this.windowDialogService.showSaveDialog(M)}),D.registerCommand(o.FILE_COMMANDS.FILTER_TOGGLE,{execute:()=>this.fileTreeService.toggleFilterMode()}),D.registerCommand(o.FILE_COMMANDS.FILTER_OPEN,{execute:()=>{if(!this.fileTreeService.filterMode)return this.fileTreeService.toggleFilterMode()}}),D.registerCommand(o.FILE_COMMANDS.FILTER_CLOSE,{execute:()=>{this.fileTreeService.filterMode&&this.fileTreeService.toggleFilterMode()}}),D.registerCommand(o.FILE_COMMANDS.NEXT,{execute:()=>{this.fileTreeModelService.moveToNext()}}),D.registerCommand(o.FILE_COMMANDS.PREV,{execute:()=>{this.fileTreeModelService.moveToPrev()}}),D.registerCommand(o.FILE_COMMANDS.COLLAPSE,{execute:()=>{this.fileTreeModelService.collapseCurrentFile()}}),D.registerCommand(o.FILE_COMMANDS.EXPAND,{execute:()=>{this.fileTreeModelService.expandCurrentFile()}}),D.registerCommand(o.FILE_COMMANDS.TOGGLE_OR_OPEN,{execute:()=>{this.fileTreeModelService.toggleOrOpenCurrentFile()}}),D.registerCommand(o.WORKSPACE_COMMANDS.REMOVE_WORKSPACE_FOLDER,{execute:async(M,R)=>{if(I(),!R.length||!this.workspaceService.isMultiRootWorkspaceOpened)return;const P=await this.workspaceService.roots,k=R.filter(F=>P.find(L=>L.uri===F.toString()));k.length>0&&await this.workspaceService.removeRoots(k)},isVisible:()=>this.workspaceService.isMultiRootWorkspaceOpened&&!!this.fileTreeModelService.contextMenuFile&&!!this.workspaceService.tryGetRoots().find(M=>{var R;return M.uri===((R=this.fileTreeModelService.contextMenuFile)===null||R===void 0?void 0:R.uri.toString())})})}registerKeybindings(D){D.registerKeybinding({command:o.FILE_COMMANDS.COPY_FILE.id,keybinding:"ctrlcmd+c",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.PASTE_FILE.id,keybinding:"ctrlcmd+v",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.CUT_FILE.id,keybinding:"ctrlcmd+x",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.SELECT_CURRENT_NODE.id,keybinding:"ctrlcmd+a",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.RENAME_FILE.id,keybinding:"enter",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.DELETE_FILE.id,keybinding:"ctrlcmd+backspace",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.FILTER_OPEN.id,keybinding:"ctrlcmd+f",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.FILTER_CLOSE.id,keybinding:"esc",when:`${c.FilesExplorerFocusedContext.raw} && ${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.NEXT.id,keybinding:"down",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.PREV.id,keybinding:"up",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.EXPAND.id,keybinding:"right",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.COLLAPSE.id,keybinding:"left",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.TOGGLE_OR_OPEN.id,keybinding:"space",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`})}registerToolbarItems(D){D.registerItem({id:o.FILE_COMMANDS.LOCATION_WITH_EDITOR.id,command:o.FILE_COMMANDS.LOCATION_WITH_EDITOR.id,label:(0,o.localize)("file.location"),viewId:f.RESOURCE_VIEW_ID,when:`view == '${f.RESOURCE_VIEW_ID}' && !config.explorer.autoReveal && !${c.FilesExplorerFilteredContext.raw}`,order:0}),D.registerItem({id:o.FILE_COMMANDS.NEW_FILE.id,command:o.FILE_COMMANDS.NEW_FILE.id,label:(0,o.localize)("file.new"),viewId:f.RESOURCE_VIEW_ID,when:`view == '${f.RESOURCE_VIEW_ID}' && !${c.FilesExplorerFilteredContext.raw}`,order:1}),D.registerItem({id:o.FILE_COMMANDS.NEW_FOLDER.id,command:o.FILE_COMMANDS.NEW_FOLDER.id,label:(0,o.localize)("file.folder.new"),viewId:f.RESOURCE_VIEW_ID,when:`view == '${f.RESOURCE_VIEW_ID}' && !${c.FilesExplorerFilteredContext.raw}`,order:2}),D.registerItem({id:o.FILE_COMMANDS.FILTER_TOGGLE.id,command:o.FILE_COMMANDS.FILTER_TOGGLE.id,label:(0,o.localize)("file.filetree.filter"),viewId:f.RESOURCE_VIEW_ID,toggledWhen:`${c.FilesExplorerFilteredContext.raw}`,order:3}),D.registerItem({id:o.FILE_COMMANDS.REFRESH_ALL.id,command:o.FILE_COMMANDS.REFRESH_ALL.id,label:(0,o.localize)("file.refresh"),viewId:f.RESOURCE_VIEW_ID,when:`view == '${f.RESOURCE_VIEW_ID}' && !${c.FilesExplorerFilteredContext.raw}`,order:4}),D.registerItem({id:o.FILE_COMMANDS.COLLAPSE_ALL.id,command:o.FILE_COMMANDS.COLLAPSE_ALL.id,label:(0,o.localize)("file.collapse"),viewId:f.RESOURCE_VIEW_ID,order:5}),D.registerItem({id:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,command:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,label:(0,o.localize)("workspace.addFolderToWorkspace"),viewId:f.RESOURCE_VIEW_ID,order:0,group:"file_explore_workspace",when:"config.workspace.supportMultiRootWorkspace"})}doDelete(){const D=this.willDeleteUris.slice();return this.willDeleteUris=[],this.fileTreeModelService.deleteFileByUris(D)}dispose(){this._disposables.dispose()}};t.FileTreeContribution=w,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],w.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(f.IFileTreeService),n.__metadata("design:type",y.FileTreeService)],w.prototype,"fileTreeService",void 0),n.__decorate([(0,r.Autowired)(a.IMainLayoutService),n.__metadata("design:type",Object)],w.prototype,"mainLayoutService",void 0),n.__decorate([(0,r.Autowired)(v.IProgressService),n.__metadata("design:type",Object)],w.prototype,"progressService",void 0),n.__decorate([(0,r.Autowired)(E.IWorkspaceService),n.__metadata("design:type",Object)],w.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(A.FileTreeModelService),n.__metadata("design:type",A.FileTreeModelService)],w.prototype,"fileTreeModelService",void 0),n.__decorate([(0,r.Autowired)(_.IDecorationsService),n.__metadata("design:type",_.IDecorationsService)],w.prototype,"decorationService",void 0),n.__decorate([(0,r.Autowired)(s.WorkbenchEditorService),n.__metadata("design:type",s.WorkbenchEditorService)],w.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],w.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(u.IWindowDialogService),n.__metadata("design:type",Object)],w.prototype,"windowDialogService",void 0),n.__decorate([(0,r.Autowired)(o.IClipboardService),n.__metadata("design:type",Object)],w.prototype,"clipboardService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],w.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(o.QuickOpenService),n.__metadata("design:type",Object)],w.prototype,"quickOpenService",void 0),n.__decorate([(0,r.Autowired)(a.IViewsRegistry),n.__metadata("design:type",Object)],w.prototype,"viewsRegistry",void 0),n.__decorate([(0,r.Autowired)(o.IApplicationService),n.__metadata("design:type",Object)],w.prototype,"appService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],w.prototype,"appConfig",void 0),t.FileTreeContribution=w=n.__decorate([(0,m.Domain)(p.MenuContribution,o.CommandContribution,o.KeybindingContribution,o.TabBarToolbarContribution,o.ClientAppContribution,a.MainLayoutContribution)],w)},2812:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeModel=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(69959),m=e(93239);let _=n=class extends c.TreeModel{constructor(g){super(),this.flushDispatchChangeDelayer=new p.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this.init(g)}init(g){this.root=g,this.root.watcher.on(c.TreeNodeEvent.BranchDidUpdate,this.doDispatchChange.bind(this)),this.decorationService.onDidChange(this.doDispatchChange.bind(this))}doDispatchChange(){this.flushDispatchChangeDelayer.isTriggered()||this.flushDispatchChangeDelayer.cancel(),this.flushDispatchChangeDelayer.trigger(async()=>{this.dispatchChange()})}};t.FileTreeModel=_,_.DEFAULT_FLUSH_DELAY=100,r.__decorate([(0,o.Autowired)(m.FileTreeDecorationService),r.__metadata("design:type",m.FileTreeDecorationService)],_.prototype,"decorationService",void 0),t.FileTreeModel=_=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[v.Directory])],_)},46377:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FILE_TREE_BADGE_LIMIT=t.FILE_TREE_NODE_HEIGHT=t.FileTreeNode=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=e(97267),p=e(41869),v=e(69959),m=n.__importDefault(e(89200)),{Path:_}=p.path,s=({item:g,onClick:a,onDoubleClick:h,onContextMenu:u,dndService:d,itemType:E,decorationService:f,labelService:l,leftPadding:b=8,onTwistierClick:y,decorations:A,defaultLeftPadding:S=8,template:w,hasFolderIcons:T,hasFileIcons:D,hidesExplorerArrows:I,hasPrompt:O,iconService:M})=>{const[R,P]=o.default.useState(-1),k=E===c.TreeNodeType.RenamePrompt,F=E===c.TreeNodeType.NewPrompt,L=k||F,B=!L&&g.name.indexOf(_.separator)>=0,j=(0,p.useDesignStyles)(m.default.expansion_toggle,"expansion_toggle"),W=(0,p.useDesignStyles)(m.default.file_tree_node,"file_tree_node"),U=L?null:f.getDecoration(g.uri,v.Directory.is(g)),Q=Pe=>{(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&(B&&P(g.name.split(_.separator).length-1),a(Pe,g,E))},V=Pe=>{(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&(B&&P(g.name.split(_.separator).length-1),h(Pe,g,E))},$=Pe=>{(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&(y?y(Pe,g,E):a(Pe,g,E))},Y=o.default.useCallback(Pe=>{Pe.nativeEvent.which!==0&&(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&u(Pe,g,E)},[u,g]),H=o.default.useCallback(Pe=>{const{handleDragStart:Ae}=d;(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&Ae(Pe,g)},[d,g]),z=o.default.useCallback(Pe=>{const{handleDragLeave:Ae}=d;(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&Ae(Pe,g)},[d,g]),K=o.default.useCallback(Pe=>{const{handleDragEnter:Ae}=d;(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&Ae(Pe,g)},[d,g]),Z=o.default.useCallback(Pe=>{const{handleDrop:Ae}=d;(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&Ae(Pe,g)},[d,g]),X=o.default.useCallback(Pe=>{const{handleDragOver:Ae}=d;(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&Ae(Pe,g)},[d,g]);let ie=E===c.TreeNodeType.CompositeTreeNode,oe;L?F?(ie=g.type===c.TreeNodeType.CompositeTreeNode,oe=`${S+(g.parent.depth+1||0)*(b||0)+(ie?0:T?I?0:20:0)}px`):(ie=g.target.type===c.TreeNodeType.CompositeTreeNode,oe=`${S+(g.target.depth||0)*(b||0)+(ie?0:T?I?0:20:0)}px`):oe=`${S+(g.depth||0)*(b||0)+(ie?0:T?I?0:20:0)}px`;const le={color:U?U.color:"",height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`,paddingLeft:oe,opacity:O&&!L?".6":"1"},pe=(Pe,Ae)=>{if(A&&A?.classlist.indexOf(m.default.mod_loading)>-1)return o.default.createElement(c.Loading,null);if(L&&Pe instanceof c.PromptHandle){let Te=!1;if(k?Te=Pe.target.type===c.TreeNodeType.CompositeTreeNode:Te=Pe.type===c.TreeNodeType.CompositeTreeNode,Te)return o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,j,(0,p.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:F||!(k&&Pe.target.type===c.TreeNodeType.CompositeTreeNode&&Pe.target.expanded)})})}else return o.default.createElement("div",{onClick:Ae,className:(0,r.default)(m.default.file_tree_node_segment,j,(0,p.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:!Pe.expanded})})},q=Pe=>{let Ae,Te;L&&Pe instanceof c.PromptHandle?Pe instanceof c.RenamePromptHandle?(Ae=Pe.target.uri.resolve(Pe.$.value),Te=v.Directory.is(Pe.target)):(Ae=Pe.parent.uri.resolve(Pe.$.value),Te=Pe.type===c.TreeNodeType.CompositeTreeNode):(Ae=Pe.uri,Te=Pe.filestat.isDirectory);const be=l.getIcon(Ae,{isDirectory:Te,isOpenedDirectory:Te&&Pe.expanded});return Te&&!T||!Te&&!D?null:o.default.createElement("div",{className:(0,r.default)(m.default.file_icon,be,{expanded:Te&&Pe.expanded}),style:{height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`}})},Ee=Pe=>{if(w)return o.default.createElement(w,null);if(L&&Pe instanceof c.PromptHandle)return o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_inputbox)},o.default.createElement("div",{className:(0,r.default)("input-box",m.default.file_tree_node_prompt_box)},o.default.createElement(Pe.ProxiedInput,{wrapperStyle:{height:t.FILE_TREE_NODE_HEIGHT,padding:"0 5px"}})));if(B){const Ae=Pe.displayName.split(_.separator),Te=Ae.map((be,me)=>{const xe=Ae.slice(0,me+1).join(_.separator),Re=Fe=>{Fe.stopPropagation(),P(me);const Ge=g.parent.uri.resolve(Ae.slice(0,me+1).join(_.separator));a(Fe,g,E,Ge)},Ne=Fe=>{Fe.stopPropagation(),P(me);const Ge=g.parent.uri.resolve(Ae.slice(0,me+1).join(_.separator));u(Fe,g,E,Ge)},fe=Fe=>{Fe.stopPropagation(),Fe.preventDefault(),R!==me&&(P(me),d.handleDragOver(Fe,g))},re=Fe=>{Fe.stopPropagation(),Fe.preventDefault(),P(-1)},he=Fe=>{Fe.stopPropagation(),R!==me&&P(me);const Ge=g.parent.uri.resolve(Ae.slice(0,me+1).join(_.separator));d.handleDragStart(Fe,g,Ge)},Oe=Fe=>{const Ge=g.parent.uri.resolve(Ae.slice(0,me+1).join(_.separator));d.handleDrop(Fe,g,Ge)},De=(0,r.default)(R===me&&m.default.active,m.default.compact_name);return o.default.createElement("span",{key:xe},o.default.createElement("a",{className:De,draggable:!0,onContextMenu:Ne,onDragStart:he,onDragOver:fe,onDragLeave:re,onDrop:Oe,onClick:Re},be),me!==Ae.length-1?o.default.createElement("span",{className:m.default.compact_name_separator},_.separator):null)});return o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_displayname)},Te)}return o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_displayname)},l.getName(Pe.uri)||Pe.displayName)},_e=()=>o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_tail)},ne()),ne=()=>U?o.default.createElement("div",{className:m.default.file_tree_node_status},(0,p.transformLabelWithCodicon)(U.badge.slice(),{color:"inherit"},M.fromString.bind(M))):null,ge=Pe=>{if(I)return null;if(ie)return pe(Pe,$);if(L)return pe(Pe,()=>{})},we=()=>{let Pe=g.tooltip;return U&&U.badge&&(Pe+=` \u2022 ${U.tooltip}`),Pe};return o.default.createElement("div",{key:g.id,onClick:Q,onDoubleClick:V,onContextMenu:Y,onDragStart:H,onDragOver:X,onDragEnter:K,onDragLeave:z,onDrop:Z,title:we(),className:(0,r.default)(W,A?A.classlist:null),style:le,draggable:E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode,"data-id":g.id},o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_content)},ge(g),q(g),o.default.createElement("div",{className:L?m.default.file_tree_node_prompt_wrap:m.default.file_tree_node_overflow_wrap},Ee(g)),_e()))};t.FileTreeNode=s,t.FILE_TREE_NODE_HEIGHT=22,t.FILE_TREE_BADGE_LIMIT=99},56384:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTree=t.FILE_TREE_FILTER_DELAY=t.FILTER_AREA_HEIGHT=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(97267),p=e(41869),v=e(68974),m=e(24429),_=e(87420),s=e(6250),g=e(46377),a=n.__importDefault(e(2613)),h=e(97738);t.FILTER_AREA_HEIGHT=30,t.FILE_TREE_FILTER_DELAY=500;const u=(0,c.RecycleTreeFilterDecorator)(c.RecycleTree),d=({viewState:f})=>{const[l,b]=(0,o.useState)(!1),[y,A]=(0,o.useState)(!0),[S,w]=(0,o.useState)(!1),[T,D]=(0,o.useState)(!1),[I,O]=(0,o.useState)(),M=(0,o.useRef)(null),R=(0,o.useRef)(new p.DisposableCollection),{height:P}=f,k=(0,p.useInjectable)(s.IFileTreeService),{iconService:F,locationToCurrentFile:L,filterMode:B,indent:j,baseIndent:W}=k,U=(0,p.useInjectable)(h.FileTreeModelService),[Q,V]=(0,o.useState)({indent:j,baseIndent:W}),[$,Y]=(0,o.useState)(B),[H,z]=(0,o.useState)(F.currentTheme||{hasFolderIcons:!0,hasFileIcons:!0,hidesExplorerArrows:!0}),K=(0,o.useCallback)(xe=>Z(xe)?!1:xe.shiftKey,[]),Z=(0,o.useCallback)(xe=>{const{metaKey:Re,ctrlKey:Ne}=xe;return p.isOSX&&Re||Ne},[]),X=(0,o.useCallback)((xe,Re,Ne,fe)=>{xe.stopPropagation();const{handleItemClick:re,handleItemToggleClick:he,handleItemRangeClick:Oe}=U;if(!Re)return;const De=K(xe),Fe=Z(xe);De?Oe(Re,Ne):Fe?he(Re,Ne):re(Re,Ne,fe)},[]),ie=(0,o.useCallback)((xe,Re,Ne)=>{xe.stopPropagation();const{handleItemDoubleClick:fe}=U;Re&&fe(Re,Ne)},[]),oe=(0,o.useCallback)((xe,Re)=>{xe.stopPropagation();const{toggleDirectory:Ne}=U;Ne(Re)},[]);(0,o.useEffect)(()=>{l&&U.onFileTreeModelChange(async xe=>{A(!0),xe&&(await xe.ensureReady,M.current&&k.initContextKey(M.current)),O(xe),A(!1)})},[l,M.current,k]),(0,o.useEffect)(()=>{var xe,Re,Ne;const fe=new p.CancellationTokenSource;return q(fe.token),(xe=R.current)===null||xe===void 0||xe.push(F.onThemeChange(re=>{z(re)})),(Re=R.current)===null||Re===void 0||Re.push(k.onTreeIndentChange(({indent:re,baseIndent:he})=>{V({indent:re,baseIndent:he})})),(Ne=R.current)===null||Ne===void 0||Ne.push(k.onFilterModeChange(re=>{Y(re)})),()=>{var re;fe.cancel(),(re=R.current)===null||re===void 0||re.dispose()}},[]);const le=(0,o.useCallback)((xe,Re)=>{let Ne;if(xe&&Re)for(Ne=xe.parentNode;Ne;){if(Re===Ne)return!0;Ne=Ne.parentNode}return!1},[]),pe=(0,o.useCallback)(xe=>{le(xe.relatedTarget,M.current)||!xe.relatedTarget||(w(!1),U.handleTreeBlur())},[M.current]);(0,o.useEffect)(()=>{$||(U.fileTreeHandle&&U.fileTreeHandle.clearFilter(),U.selectedFiles.length===1&&U.location(U.selectedFiles[0].uri))},[$]),(0,o.useEffect)(()=>{const xe=new p.DisposableCollection;return I&&(xe.push(U.onDidFocusedFileChange(Re=>{Re?Re.isEqual((I?.root).uri)?S||w(!S):S&&w(!S):Re||S&&w(!S)})),xe.push(U.onDidContextMenuFileChange(Re=>{Re?Re.isEqual((I?.root).uri)?S||w(!S):S&&w(!S):Re||S&&w(!S)}))),()=>{xe.dispose()}},[I,S]);const q=(0,o.useCallback)(async xe=>{var Re;if(await U.whenReady,!xe.isCancellationRequested){if(U.treeModel){if(await U.treeModel.ensureReady,O(U.treeModel),xe.isCancellationRequested)return;M.current&&k.initContextKey(M.current)}A(!1),!((Re=R.current)===null||Re===void 0)&&Re.disposed||b(!0)}},[U,R.current]),Ee=(0,o.useCallback)(xe=>{U.handleTreeHandler({...xe,getModel:()=>U.treeModel,hasDirectFocus:()=>M.current===document.activeElement})},[M.current,I]),_e=(0,o.useCallback)(()=>{const{handleItemClick:xe}=U;xe()},[]),ne=(0,o.useCallback)(()=>{U.handleDblClick()},[]),ge=(0,o.useCallback)(()=>{const{handleTreeFocus:xe}=U;xe()},[]),we=(0,o.useCallback)(xe=>{const{handleContextMenu:Re}=U;Re(xe)},[]),Pe=(0,o.useCallback)(xe=>{xe.stopPropagation(),xe.preventDefault()},[]),Ae=(0,o.useCallback)(xe=>{xe.preventDefault(),D(!0)},[]),Te=(0,o.useCallback)(()=>{D(!1)},[]),be=(0,o.useCallback)(xe=>{const{handleDrop:Re}=U.dndService;D(!1),Re(xe)},[]),me=(0,o.useCallback)((xe,Re,Ne,fe)=>{const{handleContextMenu:re}=U;re(xe,Re,fe)},[]);return o.default.createElement("div",{className:(0,r.default)(a.default.file_tree,T&&a.default.outer_drag_over,S&&a.default.outer_active),tabIndex:-1,ref:M,onClick:_e,onDoubleClick:ne,onFocus:ge,onBlur:pe,onContextMenu:we,draggable:!0,onDragStart:Pe,onDragLeave:Te,onDragOver:Ae,onDrop:be},o.default.createElement(E,{isLoading:y,isReady:l,height:P,model:I,iconTheme:H,treeIndent:Q,filterMode:$,locationToCurrentFile:L,onTreeReady:Ee,onContextMenu:me,onItemClick:X,onItemDoubleClick:ie,onTwistierClick:oe}))};t.FileTree=d;const E=(0,o.memo)(({isReady:f,isLoading:l,height:b,model:y,filterMode:A,treeIndent:S,iconTheme:w,onTreeReady:T,onItemClick:D,onItemDoubleClick:I,onContextMenu:O,onTwistierClick:M})=>{const R=(0,p.useInjectable)(s.IFileTreeService),P=(0,p.useInjectable)(_.IIconService),{decorationService:k,labelService:F,locationToCurrentFile:L}=R,B=(0,p.useInjectable)(h.FileTreeModelService),j=(0,o.useCallback)(W=>o.default.createElement(g.FileTreeNode,{item:W.item,itemType:W.itemType,template:W.template,decorationService:k,labelService:F,iconService:P,dndService:B.dndService,decorations:B.decorations.getDecorations(W.item),onClick:D,onDoubleClick:I,onTwistierClick:M,onContextMenu:O,defaultLeftPadding:S.baseIndent,leftPadding:S.indent,hasPrompt:W.hasPrompt,hasFolderIcons:w.hasFolderIcons,hasFileIcons:w.hasFileIcons,hidesExplorerArrows:w.hidesExplorerArrows}),[y,S,w]);return f?l?o.default.createElement(v.Progress,{loading:!0}):y?o.default.createElement(u,{height:b,itemHeight:g.FILE_TREE_NODE_HEIGHT,onReady:T,model:y,filterEnabled:A,filterAfterClear:L,filterAutoFocus:!0,leaveBottomBlank:!0},j):o.default.createElement(m.WelcomeView,{viewId:s.FILE_EXPLORER_WELCOME_ID}):o.default.createElement(v.Progress,{loading:!0})});E.displayName="FileTreeView"},57781:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeService=void 0;const n=e(85608),r=e(76003),o=e(97267),c=e(41869),p=e(18193),v=e(26542),m=e(42933),_=e(52416),s=e(51500),g=e(6250),a=e(69959),h=e(88014),u=e(93239),{Path:d}=c.path;let E=class extends o.Tree{constructor(){super(...arguments),this._fileServiceWatchers=new Map,this._symbolicFiles=new Map,this._changeEventDispatchQueue=new Set,this._readyToWatch=!1,this._watchRootsQueue=[],this.effectedNodes=[],this.onWorkspaceChangeEmitter=new c.Emitter,this.onTreeIndentChangeEmitter=new c.Emitter,this.onFilterModeChangeEmitter=new c.Emitter,this.onNodeRefreshedEmitter=new c.Emitter,this._filterMode=!1,this._refreshable=!0,this.refreshEffectNode=()=>{const l=this.effectedNodes.slice(0);if(this.effectedNodes=[],l.find(y=>a.Directory.isRoot(y)))this.refresh();else for(const y of l)this.refresh(y)},this.flushEventQueue=async()=>{if(!this._changeEventDispatchQueue||this._changeEventDispatchQueue.size===0)return;const l=Array.from(this._changeEventDispatchQueue),b=this.sortPaths(l);(!this.refreshCancelToken||this.refreshCancelToken.token.isCancellationRequested)&&(this.refreshCancelToken=new c.CancellationTokenSource);const y=(0,c.pSeries)(b.map(A=>async()=>{a.Directory.is(A.node)&&await A.node.refresh(this.refreshCancelToken)}));return this._changeEventDispatchQueue.clear(),await y},this.locationToCurrentFile=()=>{this.commandService.executeCommand(c.FILE_COMMANDS.LOCATION.id)}}get onNodeRefreshed(){return this.onNodeRefreshedEmitter.event}get refreshable(){return this._refreshable}get filterMode(){return this._filterMode}get baseIndent(){return this._baseIndent}get indent(){return this._indent}get onWorkspaceChange(){return this.onWorkspaceChangeEmitter.event}get onTreeIndentChange(){return this.onTreeIndentChangeEmitter.event}get onFilterModeChange(){return this.onFilterModeChangeEmitter.event}get isCompactMode(){return this._isCompactMode}get contextKey(){return this.fileContextKey}async init(){this._roots=await this.workspaceService.roots,await this.preferenceService.ready,this._baseIndent=this.preferenceService.getValid("explorer.fileTree.baseIndent",8),this._indent=this.preferenceService.getValid("explorer.fileTree.indent",8),this._isCompactMode=this.preferenceService.getValid("explorer.compactFolders",!0),this.toDispose.push(this.workspaceService.onWorkspaceChanged(l=>{this._roots=l;const b=new c.URI(l[0].uri),y=new a.Directory(this,void 0,b,b.displayName,l[0],this.fileTreeAPI.getReadableTooltip(b));this.root=y,this.onWorkspaceChangeEmitter.fire(y),this.refresh()})),this.toDispose.push(this.workspaceService.onWorkspaceFileExcludeChanged(()=>{this.refresh()})),this.toDispose.push(c.Disposable.create(()=>{var l;(l=this._root)===null||l===void 0||l.dispose(),this._roots=null})),this.toDispose.push(this.corePreferences.onPreferenceChanged(l=>{l.preferenceName==="explorer.fileTree.baseIndent"?(this._baseIndent=l.newValue||8,this.onTreeIndentChangeEmitter.fire({indent:this.indent,baseIndent:this.baseIndent})):l.preferenceName==="explorer.fileTree.indent"?(this._indent=l.newValue||8,this.onTreeIndentChangeEmitter.fire({indent:this.indent,baseIndent:this.baseIndent})):l.preferenceName==="explorer.compactFolders"&&(this._isCompactMode=l.newValue,this.refresh())}))}initContextKey(l){this.fileContextKey.initScopedContext(l)}startWatchFileEvent(){return this._readyToWatch=!0,Promise.all(this._watchRootsQueue.map(l=>this.watchFilesChange(l)))}async resolveChildren(l){var b,y,A,S;let w=[];if(l){if(a.Directory.isRoot(l)&&this.isMultipleWorkspace){const T=await this.workspaceService.roots;for(const D of T){const I=this.fileTreeAPI.toNode(this,D,l,this.workspaceService.getWorkspaceName(new c.URI(D.uri)));this.watchFilesChange(new c.URI(D.uri)),w=w.concat(I),(I.filestat.isSymbolicLink||I.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(I.filestat.uri,I)}return w}if(l.uri){const T=await this.fileTreeAPI.resolveChildren(this,l.uri.toString(),l,this.isCompactMode&&!a.Directory.isRoot(l));w=T.children,w.forEach(I=>{(I.filestat.isSymbolicLink||I.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(I.filestat.uri,I)});const D=T.filestat;if(D&&this.isCompactMode&&!a.Directory.isRoot(l)){const I=new c.URI(D.uri),O=l.parent;if(l&&O){let M=l.name;if(l.filestat.isSymbolicLink){const R=(y=new c.URI(l.filestat.realUri).relative(I))===null||y===void 0?void 0:y.toString();R&&(M=R,M=[l.uri.displayName].concat(M.split(d.separator)).join(d.separator))}else O.filestat.isSymbolicLink?M=(A=new c.URI(O.filestat.realUri).relative(I))===null||A===void 0?void 0:A.toString():M=(S=O.uri.relative(I))===null||S===void 0?void 0:S.toString();M&&M!==l.name&&l.updateMetaData({name:M,uri:I,tooltip:this.fileTreeAPI.getReadableTooltip(I),fileStat:D})}}return w}}else if(this._roots||(this._roots=await this.workspaceService.roots),this.isMultipleWorkspace){const T=new c.URI((b=this.workspaceService.workspace)===null||b===void 0?void 0:b.uri);let D=T.displayName;D=D.slice(0,D.lastIndexOf("."));const I={...this.workspaceService.workspace,isDirectory:!0},O=new a.Directory(this,void 0,T,D,I,this.fileTreeAPI.getReadableTooltip(T));return this.root=O,[O]}else if(this._roots.length>0)return w=await(await this.fileTreeAPI.resolveChildren(this,this._roots[0])).children,w.forEach(T=>{const D=this.workspaceService.getWorkspaceName(T.uri);D&&D!==T.name&&T.updateMetaData({name:D}),(T.filestat.isSymbolicLink||T.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(T.filestat.uri,T)}),this.watchFilesChange(new c.URI(this._roots[0].uri)),this.root=w[0],w;return[]}async watchFilesChange(l){if(!this._readyToWatch){this._watchRootsQueue.push(l);return}const b=await this.fileServiceClient.watchFileChanges(l);this.toDispose.push(b),this.toDispose.push(b.onFilesChanged(y=>{this.onFilesChanged(y)})),this._fileServiceWatchers.set(l.toString(),b)}updateRefreshable(l){var b;l!==this.refreshable&&(this._refreshable=l,this._refreshable?this.doHandleQueueChange():(b=this.refreshCancelToken)===null||b===void 0||b.cancel())}isContentFile(l){return!!l&&"filestat"in l&&!l.filestat.isDirectory}isFileContentChanged(l){return l.type===m.FileChangeType.UPDATED&&this.isContentFile(this.getNodeByPathOrUri(l.uri))}getAffectedChanges(l){const b=[];for(const y of l)this.isFileContentChanged(y)||b.push(y);return b}isRootAffected(l){return this._roots?l.some(b=>b.type>m.FileChangeType.UPDATED&&this._roots&&this._roots.find(y=>b.uri.indexOf(y.uri)>=0)):!1}async onFilesChanged(l){const b=await this.getAffectedNodes(this.getAffectedChanges(l));return b.length>0?this.effectedNodes=this.effectedNodes.concat(b):!(b.length>0)&&this.isRootAffected(l)&&this.effectedNodes.push(this.root),this.refreshEffectNode()}async getFileTreeNodePathByUri(l){var b,y,A,S,w,T;if(!l)return;let D;if(this.isMultipleWorkspace){if(this._roots||(this._roots=await this.workspaceService.roots),D=(S=this._roots.find(I=>new c.URI(I.uri).isEqualOrParent(l)))===null||S===void 0?void 0:S.uri,D){const I=new c.URI(D);if(I.isEqualOrParent(l))return new d(((w=this.root)===null||w===void 0?void 0:w.path)||"/").join(I.displayName).join(((T=I.relative(l))===null||T===void 0?void 0:T.toString())||"").toString()}}else if(D=(b=this.workspaceService.workspace)===null||b===void 0?void 0:b.uri,D){const I=new c.URI(D);if(I.isEqualOrParent(l))return new d(((y=this.root)===null||y===void 0?void 0:y.path)||"").join(((A=I.relative(l))===null||A===void 0?void 0:A.toString())||"").toString()}}async moveNodeByPath(l,b,y,A,S=o.TreeNodeType.TreeNode){const w=new d(l.path).join(y).toString(),T=new d(b.path).join(A).toString();if(w&&T&&T!==w){const D=l.moveNode(w,T);return D&&a.File.is(D)&&(D.updateMetaData({uri:b.uri.resolve(A),fileStat:{...b.filestat,uri:b.uri.resolve(A).toString(),isDirectory:S!==o.TreeNodeType.TreeNode},tooltip:this.fileTreeAPI.getReadableTooltip(b.uri.resolve(A))}),a.Directory.is(D)&&this.updateChildren(D)),D}}async updateChildren(l){const b=l.children;if(!(!b||b.length===0)){for(const y of b)if(a.File.is(y)){const A=l.uri.resolve(y.uri.displayName);y.updateMetaData({uri:A,fileStat:{...y.filestat,uri:A.toString(),isDirectory:!!a.Directory.is(y)},tooltip:this.fileTreeAPI.getReadableTooltip(A)}),a.Directory.is(y)&&this.updateChildren(y)}}}async addNode(l,b,y){let A,S;const w=d.splitPath(b);if(w.length>1){let D=l.uri;for(const I of w)D=D.resolve(I);!this.isCompactMode||a.Directory.isRoot(l)?S=w[0]:y===o.TreeNodeType.CompositeTreeNode?S=b:S=w.slice(0,w.length-1).join(d.separator)}else S=b;A={uri:l.uri.resolve(S).toString(),isDirectory:y===o.TreeNodeType.CompositeTreeNode||w.length>1,isSymbolicLink:!1,lastModification:new Date().getTime()};const T=await this.fileTreeAPI.toNode(this,A,l,S);return T&&l.addNode(T),T}async deleteAffectedNodeByPath(l,b){var y,A;const S=this.getNodeByPathOrUri(l);S&&S.parent&&(this.isCompactMode&&!b?((y=S.parent.children)===null||y===void 0?void 0:y.length)===2?this.refresh((A=S.parent)===null||A===void 0?void 0:A.parent):this.refresh(S.parent):S.parent.removeNode(S.path))}async deleteAffectedNodes(l,b=[]){const y=[];for(const A of l){const S=this.getNodeByPathOrUri(A);S&&a.File.is(S)&&y.push(S)}for(const A of y)!A?.parent||this._changeEventDispatchQueue.has(A?.parent.path)||await this.deleteAffectedNodeByPath(A.path);return b.filter(A=>A.type!==m.FileChangeType.DELETED)}async getAffectedNodes(l){const b=[];for(const y of l){const A=new c.URI(y.uri),S=this.getNodeByPathOrUri(A.parent);S&&b.push(S)}return b}isFileURI(l){return/^file:\/\//.test(l)}getNodeByPathOrUri(l){var b,y,A,S;let w,T;if(typeof l!="string"?(T=l,l=l.toString()):this.isFileURI(l)?T=new c.URI(l):!this.isFileURI(l)&&typeof l=="string"&&(w=l),this.isFileURI(l)&&T){if(this._symbolicFiles.has(T?.toString()))return this._symbolicFiles.get(T.toString());let D;if(this.isMultipleWorkspace?this._roots&&(D=(y=this._roots.find(I=>new c.URI(I.uri).isEqualOrParent(T)))===null||y===void 0?void 0:y.uri):D=(b=this.workspaceService.workspace)===null||b===void 0?void 0:b.uri,this.root&&D){const I=new c.URI(D);if(I.isEqualOrParent(T)){const O=I.relative(T);O&&(this.isMultipleWorkspace?w=new d(this.root.path).join(I.displayName).join(O.toString()).toString():w=new d(this.root.path).join(O.toString()).toString())}}}if(w){const D=(A=this.root)===null||A===void 0?void 0:A.getTreeNodeByPath(w);if(!D){let I;const O=w.split(d.separator);for(;O.length>=1;){O.pop();const M=O.join(d.separator);if(I=(S=this.root)===null||S===void 0?void 0:S.getTreeNodeByPath(M),I)break}if(I&&a.Directory.is(I)){for(const M of I.children||[])if(M.path.includes(w))return M}}return D}}sortComparator(l,b){return l.constructor===b.constructor?l.name.localeCompare(b.name,"en",{numeric:!0}):l.type===o.TreeNodeType.CompositeTreeNode?-1:b.type===o.TreeNodeType.CompositeTreeNode?1:0}get contextMenuContextKeyService(){return this.fileContextKey?this.fileContextKey.service:this.contextKeyService}get isMultipleWorkspace(){return!!this.workspaceService.workspace&&!this.workspaceService.workspace.isDirectory}getDisplayName(l){return this.workspaceService.getWorkspaceName(l)}async refresh(l=this.root){if(l)return a.Directory.is(l)||a.File.is(l)&&l.parent&&(l=l.parent),this._changeEventDispatchQueue.add(l.path),this.doHandleQueueChange()}async doHandleQueueChange(){if(this.refreshable)try{await this.flushEventQueue()}catch(l){this.logger.error("flush file change event queue error:",l)}finally{this.onNodeRefreshedEmitter.fire()}}sortPaths(l){const y=l.slice().map(S=>({node:this.getNodeByPathOrUri(S),path:S})).filter(S=>S&&!!S.node);l.length>1&&y.sort((S,w)=>{var T,D;const I=((T=S.node)===null||T===void 0?void 0:T.depth)||0,O=((D=w.node)===null||D===void 0?void 0:D.depth)||0;return I-O});const A=[];for(let S=y.length-1;S>=0;S--){const w=y[S];let T=!1;for(let D=0;D<S;D++){const I=y[D];a.Directory.is(I)&&w.node.path.startsWith(I.node.path)&&(T=!0)}T||A.push(w)}return A}openFile(l){const b=this.preferenceService.get("editor.previewMode");this.commandService.executeCommand(c.EDITOR_COMMANDS.OPEN_RESOURCE.id,l,{disableNavigate:!0,preview:b})}openAndFixedFile(l){this.commandService.executeCommand(c.EDITOR_COMMANDS.OPEN_RESOURCE.id,l,{disableNavigate:!0,preview:!1,focus:!0})}openToTheSide(l){this.commandService.executeCommand(c.EDITOR_COMMANDS.OPEN_RESOURCE.id,l,{disableNavigate:!0,split:4})}compare(l,b){this.commandService.executeCommand(c.EDITOR_COMMANDS.COMPARE.id,{original:l,modified:b})}toggleFilterMode(){var l;this._filterMode=!this.filterMode,this.onFilterModeChangeEmitter.fire(this.filterMode),(l=this.fileContextKey)===null||l===void 0||l.filesExplorerFilteredContext.set(this.filterMode),this.filterMode===!1&&this.commandService.executeCommand(c.FILE_COMMANDS.LOCATION.id)}};t.FileTreeService=E,n.__decorate([(0,r.Autowired)(g.IFileTreeAPI),n.__metadata("design:type",Object)],E.prototype,"fileTreeAPI",void 0),n.__decorate([(0,r.Autowired)(c.CommandService),n.__metadata("design:type",Object)],E.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(c.IContextKeyService),n.__metadata("design:type",Object)],E.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(s.IWorkspaceService),n.__metadata("design:type",Object)],E.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(p.CorePreferences),n.__metadata("design:type",Object)],E.prototype,"corePreferences",void 0),n.__decorate([(0,r.Autowired)(c.PreferenceService),n.__metadata("design:type",Object)],E.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(v.LabelService),n.__metadata("design:type",v.LabelService)],E.prototype,"labelService",void 0),n.__decorate([(0,r.Autowired)(u.FileTreeDecorationService),n.__metadata("design:type",u.FileTreeDecorationService)],E.prototype,"decorationService",void 0),n.__decorate([(0,r.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],E.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(_.IIconService),n.__metadata("design:type",Object)],E.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(c.ILogger),n.__metadata("design:type",Object)],E.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(h.FileContextKey),n.__metadata("design:type",h.FileContextKey)],E.prototype,"fileContextKey",void 0),t.FileTreeService=E=n.__decorate([(0,r.Injectable)()],E)},83709:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeNextModule=void 0;const n=e(85608),r=e(41869),o=e(72665),c=e(41103),p=e(6250),v=e(89508),m=e(40439),_=e(57781),s=e(88808),g=e(93239),a=e(97738),h=e(24861);let u=class extends r.BrowserModule{constructor(){super(...arguments),this.providers=[{token:p.IFileTreeAPI,useClass:s.FileTreeAPI},{token:g.FileTreeDecorationService,useClass:g.FileTreeDecorationService},{token:p.IFileTreeService,useClass:_.FileTreeService},{token:a.FileTreeModelService,useClass:a.FileTreeModelService},{token:o.IWindowDialogService,useClass:v.WindowDialogServiceImpl},m.FileTreeContribution]}};t.FileTreeNextModule=u,t.FileTreeNextModule=u=n.__decorate([(0,r.Domain)(h.name),(0,r.ModuleDependencies)([c.WorkspaceModule])],u)},88808:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeAPI=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(43718),p=e(42933),v=e(72665),m=e(26199),_=e(69959);let s=class{constructor(){this.onDidResolveChildrenEmitter=new c.Emitter,this.onDidResolveChildren=this.onDidResolveChildrenEmitter.event}async resolveChildren(a,h,u,d){var E;let f;if(!this.userhomePath){const l=await this.fileServiceClient.getCurrentUserHome();l&&(this.userhomePath=new c.URI(l.uri))}if(typeof h=="string"?f=await this.fileServiceClient.getFileStat(h):f=await this.fileServiceClient.getFileStat(h.uri),f){if(this.onDidResolveChildrenEmitter.fire(f.uri.toString()),((E=f.children)===null||E===void 0?void 0:E.length)===1&&f.children[0].isDirectory&&d)return await this.resolveChildren(a,f.children[0].uri,u,d);{const l={...f,isInSymbolicDirectory:u?.filestat.isSymbolicLink||u?.filestat.isInSymbolicDirectory};return{children:this.toNodes(a,l,u),filestat:l}}}else return{children:[],filestat:null}}async resolveNodeByPath(a,h,u){const d=await this.fileServiceClient.getFileStat(h);if(d)return this.toNode(a,d,u)}async resolveFileStat(a){return await this.fileServiceClient.getFileStat(a.toString())}toNodes(a,h,u){if(u){if(h.children)return h.children.map(d=>this.toNode(a,d,u))}else return[this.toNode(a,h,u)];return[]}toNode(a,h,u,d){var E;const f=new c.URI(h.uri),l=d||f.displayName;let b;return h.isInSymbolicDirectory=(E=u?.filestat.isSymbolicLink)!==null&&E!==void 0?E:u?.filestat.isInSymbolicDirectory,h.isDirectory?b=new _.Directory(a,u,f,l,h,this.getReadableTooltip(f)):b=new _.File(a,u,f,l,h,this.getReadableTooltip(f)),b}async mvFiles(a,h){const u=[];for(const f of a)if(f.url.isEqualOrParent(h))return;const d=a.sort((f,l)=>f.toString().length-l.toString().length),E=[];for(const f of d)E.length>0&&E.find(l=>l.url.isEqualOrParent(f.url))||E.push(f);if(this.corePreferences["explorer.confirmMove"]){const f=(0,c.localize)("file.confirm.move.ok"),l=(0,c.localize)("file.confirm.move.cancel");if(await this.dialogService.warning((0,c.formatLocalize)("file.confirm.move",`[ ${E.map(y=>y.url.displayName).join(",")} ]`,h.displayName),[l,f])!==f)return}for(const f of E){const l=await this.mv(f.url,h.resolve(f.url.displayName),f.isDirectory);l&&u.push(l)}return u}async mv(a,h,u=!1){try{await this.workspaceEditService.apply({edits:[{newResource:h,oldResource:a,options:{isDirectory:u,overwrite:!0}}]})}catch(d){return d.message}}async createFile(a,h){try{await this.workspaceEditService.apply({edits:[{newResource:a,options:{content:h}}]})}catch(u){return u.message}this.commandService.executeCommand(o.EDITOR_COMMANDS.OPEN_RESOURCE.id,a,{disableNavigate:!0,focus:!0})}async createDirectory(a){try{await this.workspaceEditService.apply({edits:[{newResource:a,options:{isDirectory:!0}}]})}catch(h){return h.message}}async delete(a){try{await this.workspaceEditService.apply({edits:[{oldResource:a,options:{}}]});return}catch(h){return h.message}}async copyFile(a,h){let u=1,d;try{d=await this.fileServiceClient.access(h.toString())}catch(E){return E.message}for(;d;){const E=h.displayName.replace(/\Wcopy\W\d+/,""),f=c.path.extname(E),b=`${c.path.basename(E,f)} copy ${u}${f}`;h=h.parent.resolve(b),u++;try{d=await this.fileServiceClient.access(h.toString())}catch{return}}try{return await this.fileServiceClient.copy(a.toString(),h.toString())}catch(E){return E.message}}getReadableTooltip(a){const h=a.toString(),u=this.userhomePath&&this.userhomePath.toString();return this.userhomePath&&this.userhomePath.isEqualOrParent(a)?decodeURIComponent(h.replace(u,"~")):decodeURIComponent(a.withScheme("").toString())}};t.FileTreeAPI=s,n.__decorate([(0,r.Autowired)(p.IFileServiceClient),n.__metadata("design:type",Object)],s.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(m.IWorkspaceEditService),n.__metadata("design:type",Object)],s.prototype,"workspaceEditService",void 0),n.__decorate([(0,r.Autowired)(c.CommandService),n.__metadata("design:type",Object)],s.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(o.CorePreferences),n.__metadata("design:type",Object)],s.prototype,"corePreferences",void 0),n.__decorate([(0,r.Autowired)(v.IDialogService),n.__metadata("design:type",Object)],s.prototype,"dialogService",void 0),t.FileTreeAPI=s=n.__decorate([(0,r.Injectable)()],s)},93239:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeDecorationService=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(41893),p=e(52416);let v=class{constructor(){this.disposeCollection=new o.DisposableCollection,this.onDidChangeEmitter=new o.Emitter,this.cacheDecorations=new Map,this.disposeCollection.pushAll([this.decorationsService.onDidChangeDecorations(_=>{var s,g,a;const h=(g=(s=_._data)===null||s===void 0?void 0:s._iter)===null||g===void 0?void 0:g._value;if(h){const u=new o.URI(h),d=this.getDecoration(u);this.cacheDecorations.has(h)?((a=this.cacheDecorations.get(h))===null||a===void 0?void 0:a.tooltip)!==d?.tooltip&&this.onDidChangeEmitter.fire():(this.cacheDecorations.set(h,d),this.onDidChangeEmitter.fire())}}),this.themeService.onThemeChange(()=>{this.onDidChangeEmitter.fire()})])}get onDidChange(){return this.onDidChangeEmitter.event}getDecoration(_,s=!1){_ instanceof o.URI&&(_=o.Uri.parse(_.toString()));const g=this.decorationsService.getDecoration(_,s);return g?{...g,color:this.themeService.getColor({id:g.color})}:{color:"",tooltip:"",badge:""}}dispose(){this.disposeCollection.dispose()}};t.FileTreeDecorationService=v,n.__decorate([(0,r.Autowired)(c.IDecorationsService),n.__metadata("design:type",c.IDecorationsService)],v.prototype,"decorationsService",void 0),n.__decorate([(0,r.Autowired)(p.IThemeService),n.__metadata("design:type",Object)],v.prototype,"themeService",void 0),t.FileTreeDecorationService=v=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],v)},30577:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DragAndDropService=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(53622),m=e(14951),_=e(72665),s=e(51500),g=e(6250),a=e(69959),h=r.__importDefault(e(89200)),u=r.__importDefault(e(2613)),d=e(57781),E=e(97738);let f=n=class extends p.WithEventBus{constructor(b){super(),this.model=b,this.toCancelNodeExpansion=new p.DisposableCollection,this.beingDraggedDec=new c.Decoration(h.default.mod_dragging),this.draggedOverDec=new c.Decoration(h.default.mod_dragover),this.beingDraggedNodes=[],this.dragOverTrigger=new p.ThrottledDelayer(n.MS_TILL_DRAGGED_OVER_EXPANDS),this.handleDragStart=(y,A,S)=>{y.stopPropagation();const w=O=>{this.handleDragEnd(O,A)};y.currentTarget.addEventListener("dragend",w,!1);let T=this.model.selectedFiles,D=!1;for(const O of T)O&&O.id===A.id&&(D=!0);D||(T=[A]),this.beingDraggedNodes=T,this.beingDraggedActiveUri=S;const I=T.find(O=>!a.Directory.is(O));if(I&&y.dataTransfer.setData("uri",I.uri.toString()),y.dataTransfer.setData("beingDraggedNodes",JSON.stringify(this.beingDraggedNodes.map(O=>O.uri.toString()))),I){const O=I;O.uri.scheme==="file"&&y.dataTransfer.setData("DownloadURL",`application/octet-stream:${O.displayName}:data:application/octet-stream;base64,${(0,p.encodeBase64)(p.BinaryBuffer.fromString(O.filestat.uri))}`)}if(T.forEach(O=>{this.beingDraggedDec.addTarget(O,c.TargetMatchMode.Self)}),y.dataTransfer){let O;T.length===1?O=S?S.displayName:typeof A.name=="string"?A.name:"":O=String(T.length);const M=document.createElement("div");M.className=u.default.file_tree_drag_image,M.textContent=O,document.body.appendChild(M),y.dataTransfer.setDragImage(M,-10,-10),setTimeout(()=>document.body.removeChild(M),0)}},this.handleDragEnter=(y,A)=>{y.stopPropagation(),y.preventDefault()},this.handleDragLeave=(y,A)=>{y.preventDefault(),y.stopPropagation(),this.toCancelNodeExpansion.dispose(),this.potentialParent&&(this.draggedOverDec.removeTarget(this.potentialParent),this.model.treeModel.dispatchChange())},this.handleDragOver=(y,A)=>{if(y.preventDefault(),y.stopPropagation(),!this.toCancelNodeExpansion.disposed||this.beingDraggedNodes.indexOf(A)>=0)return;this.draggedOverNode=A;const S=a.Directory.is(A)&&A.expanded?A:A.parent;(this.potentialParent!==S||!this.draggedOverDec.hasTarget(S))&&(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=S,this.draggedOverDec.addTarget(this.potentialParent,c.TargetMatchMode.SelfAndChildren),this.model.treeModel.dispatchChange()),this.potentialParent!==A&&a.Directory.is(A)&&(this.dragOverTrigger.trigger(async()=>{A.expanded?(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=A,this.draggedOverDec.addTarget(this.potentialParent,c.TargetMatchMode.SelfAndChildren)):(await A.setExpanded(!0),this.draggedOverNode===A&&(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=A,this.draggedOverDec.addTarget(this.potentialParent,c.TargetMatchMode.SelfAndChildren))),this.model.treeModel.dispatchChange()}),this.toCancelNodeExpansion.push(p.Disposable.create(()=>{this.dragOverTrigger.isTriggered()||this.dragOverTrigger.cancel()})))},this.handleDrop=async(y,A,S)=>{var w,T;this.eventBus.fire(new v.FileTreeDropEvent({event:y.nativeEvent,targetDir:S?S.codeUri.path:A&&A instanceof a.File?(w=A.parent)===null||w===void 0?void 0:w.uri.codeUri.path:A?A.uri.codeUri.path:new p.URI((T=this.workspaceService.workspace)===null||T===void 0?void 0:T.uri).codeUri.path}));try{y.preventDefault(),y.stopPropagation(),y.dataTransfer.dropEffect="copy";let D;const I=!!this.beingDraggedActiveUri;this.fileTreeService.isCompactMode&&S&&!A?.uri.isEqual(S)?D=null:A?D=a.Directory.is(A)?A:A.parent:D=this.root;let O;if(this.beingDraggedActiveUri){const M=this.fileTreeService.getNodeByPathOrUri(this.beingDraggedActiveUri);O=[new a.Directory(this.fileTreeService,M?.parent,this.beingDraggedActiveUri,this.beingDraggedActiveUri.displayName,{uri:this.beingDraggedActiveUri.toString(),isDirectory:!0,lastModification:new Date().getTime()},this.beingDraggedActiveUri.displayName)]}else if(O=this.beingDraggedNodes,!O||O.length===0)try{const M=JSON.parse(y.dataTransfer.getData("beingDraggedNodes"));M&&M.length!==0&&(O=M.map(R=>this.fileTreeService.getNodeByPathOrUri(new p.URI(R))).filter(Boolean),O.length||(O=await Promise.all(M.map(async R=>{const P=new p.URI(R);let k;const F=await this.filesystem.getFileStat(P.toString());return F?.isDirectory?k=new a.Directory(this.fileTreeService,this.root,P,P.displayName,{uri:P.toString(),isDirectory:!0,lastModification:new Date().getTime()},P.displayName):k=new a.File(this.fileTreeService,this.root,P,P.displayName,{uri:P.toString(),isDirectory:!0,lastModification:new Date().getTime()},P.displayName),k}))))}catch{}if(O.length>0){const M=S||D&&D.uri,R=O.filter(P=>P&&P.parent&&(this.beingDraggedActiveUri?!P.parent.uri.isEqual(M):!0));if(R.length>0){const P=await this.fileTreeAPI.mvFiles(R.map(k=>({url:k.uri,isDirectory:k.filestat.isDirectory})),M);if(P&&P.length>0)P.forEach(k=>{this.messageService.error(k)});else if(P){if(D)if(this.fileTreeService.isCompactMode&&I){for(const k of R)this.fileTreeService.refresh(k.parent);this.fileTreeService.refresh(D)}else for(const k of R){const F=D.uri.resolve(k.name);this.fileTreeService.moveNodeByPath(k.parent,D,k.name,k.name,k.type),k.updateMetaData({name:F.displayName,fileStat:{...k.filestat,uri:F.toString()},uri:F,tooltip:this.fileTreeAPI.getReadableTooltip(F)}),a.Directory.is(k)&&this.fileTreeService.refresh(k)}else if(A){if(this.fileTreeService.isCompactMode&&I)for(const k of R)this.fileTreeService.refresh(k.parent);else for(const k of R)this.fileTreeService.deleteAffectedNodeByPath(k.path);this.fileTreeService.refresh(A.parent)}}else return}}A&&this.beingDraggedDec.removeTarget(A),this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.beingDraggedNodes.forEach(M=>{this.beingDraggedDec.removeTarget(M)}),this.beingDraggedNodes=[],this.beingDraggedActiveUri=void 0,this.potentialParent=null,this.model.treeModel.dispatchChange(),this.toCancelNodeExpansion.disposed||this.toCancelNodeExpansion.dispose()}catch(D){this.logger.error(D)}},this.handleDragEnd=(y,A)=>{this.beingDraggedDec.removeTarget(A),this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.beingDraggedNodes.forEach(S=>{this.beingDraggedDec.removeTarget(S)}),this.beingDraggedNodes=[],this.beingDraggedActiveUri=void 0,this.potentialParent=null,this.model.treeModel.dispatchChange(),this.toCancelNodeExpansion.disposed||this.toCancelNodeExpansion.dispose()},this.model.decorations.addDecoration(this.beingDraggedDec),this.model.decorations.addDecoration(this.draggedOverDec)}get root(){return this.model.treeModel.root}};t.DragAndDropService=f,f.MS_TILL_DRAGGED_OVER_EXPANDS=500,r.__decorate([(0,o.Autowired)(g.IFileTreeAPI),r.__metadata("design:type",Object)],f.prototype,"fileTreeAPI",void 0),r.__decorate([(0,o.Autowired)(p.ILogger),r.__metadata("design:type",Object)],f.prototype,"logger",void 0),r.__decorate([(0,o.Autowired)(_.IMessageService),r.__metadata("design:type",Object)],f.prototype,"messageService",void 0),r.__decorate([(0,o.Autowired)(g.IFileTreeService),r.__metadata("design:type",d.FileTreeService)],f.prototype,"fileTreeService",void 0),r.__decorate([(0,o.Autowired)(m.IFileServiceClient),r.__metadata("design:type",Object)],f.prototype,"filesystem",void 0),r.__decorate([(0,o.Autowired)(s.IWorkspaceService),r.__metadata("design:type",Object)],f.prototype,"workspaceService",void 0),t.DragAndDropService=f=n=r.__decorate([(0,o.Injectable)(),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[E.FileTreeModelService])],f)},97738:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeModelService=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(91830),m=e(93899),_=e(26542),s=e(54414),g=e(14951),a=e(63067),h=e(53576),u=e(72665),d=e(6250),E=e(69959),f=e(2812),l=e(46377),b=r.__importDefault(e(89200)),y=e(57781),A=e(30577),{Path:S,isValidBasename:w}=p.path,{coalesce:T}=p.arrays,{trim:D,rtrim:I}=p.strings;let O=n=class{constructor(){this._isDisposed=!1,this._whenReady=new p.Deferred,this.selectedDecoration=new c.Decoration(b.default.mod_selected),this.focusedDecoration=new c.Decoration(b.default.mod_focused),this.contextMenuDecoration=new c.Decoration(b.default.mod_actived),this.loadingDecoration=new c.Decoration(b.default.mod_loading),this.cutDecoration=new c.Decoration(b.default.mod_cut),this._selectedFiles=[],this.disposableCollection=new p.DisposableCollection,this._isMultiSelected=!1,this.refreshedActionDelayer=new p.ThrottledDelayer(n.DEFAULT_REFRESHED_ACTION_DELAY),this.labelChangedDelayer=new p.ThrottledDelayer(n.DEFAULT_LABEL_CHANGED_DELAY),this.locationThrottler=new p.Throttler,this.onDidFocusedFileChangeEmitter=new p.Emitter,this.onDidContextMenuFileChangeEmitter=new p.Emitter,this.onDidSelectedFileChangeEmitter=new p.Emitter,this.onFileTreeModelChangeEmitter=new p.Emitter,this._initTreeModelReady=!1,this.clearFileSelectedDecoration=()=>{this.selectedDecoration.clearAppliedTarget(),this._selectedFiles=[]},this.activeFileDecoration=(R,P=!0)=>{this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),R&&(this.selectedFiles.length>0&&this.selectedDecoration.clearAppliedTarget(),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.selectedDecoration.addTarget(R),this.focusedDecoration.addTarget(R),this.focusedFile=R,this.selectedFiles=[R],P&&this.treeModel.dispatchChange())},this.selectFileDecoration=(R,P=!0)=>{R!==this.treeModel.root&&(this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),R&&(this.selectedFiles.length>0&&this.selectedDecoration.clearAppliedTarget(),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.selectedDecoration.addTarget(R),this._selectedFiles=[R],P&&this.treeModel.dispatchChange()))},this.activateFileActivedDecoration=R=>{this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),this.focusedFile&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this.contextMenuDecoration.addTarget(R),this.contextMenuFile=R,this.treeModel.dispatchChange()},this.activateFileFocusedDecoration=R=>{this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),this.focusedDecoration.addTarget(R),this.focusedFile=R,this.treeModel.dispatchChange()},this.activeFileFocusedDecoration=(R,P=!1)=>{R!==this.treeModel.root&&(this.focusedFile!==R&&(P?(this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.contextMenuFile=R):this.focusedFile&&(this.contextMenuFile=void 0,this.focusedDecoration.clearAppliedTarget()),R&&(this._selectedFiles.indexOf(R)<0&&(this.selectedDecoration.addTarget(R),this._selectedFiles.push(R),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(k=>k.uri))),this.focusedDecoration.addTarget(R),this.focusedFile=R)),this.treeModel.dispatchChange())},this.toggleFileSelectedDecoration=R=>{const P=this._selectedFiles.indexOf(R);P>-1?(this.focusedFile===R&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this._selectedFiles.splice(P,1),this.selectedDecoration.clearAppliedTarget()):(this._selectedFiles.push(R),this.selectedDecoration.addTarget(R),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.focusedFile=R,this.focusedDecoration.addTarget(R)),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(k=>k.uri)),this.treeModel.dispatchChange()},this.activeFileDecorationByRange=(R,P)=>{for(this.clearFileSelectedDecoration(),this.contextMenuFile=void 0;R<=P;R++){const k=this.treeModel.root.getTreeNodeAtIndex(R);k&&(this._selectedFiles.push(k),this.selectedDecoration.addTarget(k))}this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(k=>k.uri)),this.treeModel.dispatchChange()},this.deactivateFileDecoration=()=>{var R;this.focusedFile&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this.contextMenuFile&&this.contextMenuDecoration.removeTarget(this.contextMenuFile),(R=this.treeModel)===null||R===void 0||R.dispatchChange()},this.toggleDirectory=async R=>{R.expanded?this.fileTreeHandle.collapseNode(R):this.fileTreeHandle.expandNode(R)},this.handleDblClick=()=>{this.commandService.executeCommand(p.FILE_COMMANDS.NEW_FILE.id)},this.handleContextMenu=(R,P,k)=>{var F;R.stopPropagation(),R.preventDefault();let L,B;P?(B=P,this._isMultiSelected?this.selectedFiles.indexOf(B)>=0?L=this.selectedFiles:L=[B]:L=[B]):(L=[this.treeModel.root],B=this.treeModel.root),this.activateFileActivedDecoration(B),this.setFileTreeContextKey(B),this.fileTreeService.isCompactMode&&k?(this._activeUri=k,(F=this.contextKey)===null||F===void 0||F.explorerResourceIsFolder.set(!0)):k||(this._activeUri=null);const j=this.contextMenuService.createMenu({id:m.MenuId.ExplorerContext,contextKeyService:this.fileTreeService.contextMenuContextKeyService}),W=j.getMergedMenuNodes();j.dispose(),this.updateExplorerCompressedContextKey(B,k);const{x:U,y:Q}=R.nativeEvent;this.ctxMenuRenderer.show({anchor:{x:U,y:Q},menuNodes:W,args:k?[k,[k]]:[B.uri,L.map(V=>V.uri)]})},this.handleTreeBlur=()=>{var R,P,k;this._isDisposed||((P=(R=this.contextKey)===null||R===void 0?void 0:R.filesExplorerFocused)===null||P===void 0||P.set(!1),this.deactivateFileDecoration(),(k=this.contextKey)===null||k===void 0||k.explorerResourceIsFolder.set(!1))},this.handleTreeFocus=()=>{var R,P;(P=(R=this.contextKey)===null||R===void 0?void 0:R.filesExplorerFocused)===null||P===void 0||P.set(!0)},this.handleItemRangeClick=(R,P)=>{if(this.selectedFiles.length===1&&E.Directory.isRoot(this.selectedFiles[0])&&this.clearFileSelectedDecoration(),!this.focusedFile)this.handleItemClick(R,P);else if(this.focusedFile&&this.focusedFile!==R){this._isMultiSelected=!0;const k=this.treeModel.root.getIndexAtTreeNode(R),F=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);F>k?this.activeFileDecorationByRange(k,F):F<k&&this.activeFileDecorationByRange(F,k)}},this.handleItemToggleClick=(R,P)=>{this._isMultiSelected=!0,!(P!==c.TreeNodeType.CompositeTreeNode&&P!==c.TreeNodeType.TreeNode)&&(this.selectedFiles.length===1&&E.Directory.isRoot(this.selectedFiles[0])&&this.clearFileSelectedDecoration(),this.toggleFileSelectedDecoration(R))},this.handleItemClick=(R,P=this.fileTreeService.isMultipleWorkspace?c.TreeNodeType.TreeNode:c.TreeNodeType.CompositeTreeNode,k)=>{var F,L,B,j;if(this.treeModel&&(R||(R=this.treeModel.root),this.updateExplorerCompressedContextKey(R,k),this._isMultiSelected=!1,(P===c.TreeNodeType.CompositeTreeNode||P===c.TreeNodeType.TreeNode)&&this.activeFileDecoration(R),this.fileTreeService.isCompactMode&&k?(this._activeUri=k,(F=this.contextKey)===null||F===void 0||F.explorerResourceIsFolder.set(!0)):k||(this._activeUri=null,(L=this.contextKey)===null||L===void 0||L.explorerResourceIsFolder.set(P===c.TreeNodeType.CompositeTreeNode)),this.corePreferences["workbench.list.openMode"]==="singleClick")){if(P===c.TreeNodeType.CompositeTreeNode){if((B=this.contextKey)===null||B===void 0||B.explorerResourceIsFolder.set(!0),R===this.treeModel.root)return;this.toggleDirectory(R)}else if(P===c.TreeNodeType.TreeNode){if((j=this.contextKey)===null||j===void 0||j.explorerResourceIsFolder.set(!1),R===this.treeModel.root)return;this.fileTreeService.openFile(R.uri),this.mainlayoutService.bottomExpanded&&this.commandService.executeCommand(h.RETRACT_BOTTOM_PANEL.id)}}},this.handleItemDoubleClick=(R,P)=>{P===c.TreeNodeType.TreeNode?this.fileTreeService.openAndFixedFile(R.uri):this.corePreferences["workbench.list.openMode"]==="doubleClick"&&this.toggleDirectory(R)},this.validateFileName=(R,P)=>{var k;if(P=this.getWellFormedFileName(P),!P||P.length===0||/^\s+$/.test(P))return{message:(0,p.localize)("validate.tree.emptyFileNameError"),type:c.PROMPT_VALIDATE_TYPE.ERROR,value:P};if(P[0]==="/"||P[0]==="\\")return{message:(0,p.localize)("validate.tree.fileNameStartsWithSlashError"),type:c.PROMPT_VALIDATE_TYPE.ERROR,value:P};if(P[0]===" "||P[P.length-1]===" ")return{message:(0,p.localize)("validate.tree.fileNameFollowOrStartWithSpaceWarning"),type:c.PROMPT_VALIDATE_TYPE.WARNING,value:P};let F;if(R.target){const B=R.target;if(P===B.name)return null;F=B.parent}else F=R.parent;return F&&!(R instanceof c.RenamePromptHandle&&R.target.displayName.indexOf(S.separator)>0)&&((k=F.children)===null||k===void 0?void 0:k.find(W=>W.name===P))?{message:(0,p.formatLocalize)("validate.tree.fileNameExistsError",P),type:c.PROMPT_VALIDATE_TYPE.ERROR,value:P}:T(P.split(/[\\/]/)).some(B=>!w(B))?{message:(0,p.formatLocalize)("validate.tree.invalidFileNameError",this.trimLongName(P)),type:c.PROMPT_VALIDATE_TYPE.ERROR,value:P}:null},this.proxyPrompt=R=>{let P=!1;const k=async V=>{const $=await this.fileTreeService.getNodeByPathOrUri(V);$&&(E.Directory.is($)?this.selectFileDecoration($):this.location($.uri))},F=async V=>{var $,Y,H;if(this.validateMessage=void 0,R instanceof c.RenamePromptHandle){const z=R.target,K=R.target.displayName.split(S.separator),Z=z.name.indexOf(S.separator)>0;if(Z&&this.activeUri&&!R.target.uri.toString().includes(this.activeUri.toString()))return!1;const X=this.activeUri?K.length-R.target.uri.toString().replace(this.activeUri.toString(),"").split(S.separator).length:-1,ie=X===-1?[]:K.slice(0,X).concat(V);let oe=z.uri,le=z.parent.uri.resolve(V);if(Z&&(($=this.activeUri)===null||$===void 0?void 0:$.displayName)===V||!Z&&V===z.name)return!0;R.addAddonAfter("loading_indicator"),Z&&ie.length>0&&E.Directory.is(z.parent)&&(oe=z.parent.uri.resolve(K.slice(0,X+1).join(S.separator)),le=z.parent.uri.resolve(ie.concat().join(S.separator)));const pe=await this.fileTreeAPI.mv(oe,le,z.type===c.TreeNodeType.CompositeTreeNode);if(pe)return this.validateMessage={type:c.PROMPT_VALIDATE_TYPE.ERROR,message:pe,value:V},this.fileTreeService.updateRefreshable(!0),R.addValidateMessage(this.validateMessage),!1;if(this.fileTreeService.updateRefreshable(!1),R.removeAddonAfter(),!Z&&z.parent){const q=await this.fileTreeService.moveNodeByPath(z.parent,z.parent,z.name,V,z.type);q&&this.selectFileDecoration(q,!1),this.fileTreeService.updateRefreshable(!0)}else if(E.Directory.is(z)&&!E.Directory.isRoot(z)){z.updateMetaData({name:ie.concat(K.slice(X+1)).join(S.separator),uri:le,fileStat:{...z.filestat,uri:le.toString()},tooltip:this.fileTreeAPI.getReadableTooltip(le)}),this.treeModel.dispatchChange();let q;E.Directory.is(z.parent)&&(!((Y=z.parent.children)===null||Y===void 0)&&Y.find(Ee=>z.path.indexOf(Ee.path)>=0))?q=this.fileTreeService.refresh(z.parent):q=this.fileTreeService.refresh(z),q.then(()=>{k(le)})}R.removeAddonAfter()}else if(R instanceof c.NewPromptHandle){const z=R.parent,K=z.uri.resolve(V);let Z;if(R.addAddonAfter("loading_indicator"),this.fileTreeService.updateRefreshable(!0),R.type===c.TreeNodeType.CompositeTreeNode?Z=await this.fileTreeAPI.createDirectory(K):Z=await this.fileTreeAPI.createFile(K),R.removeAddonAfter(),Z)return this.validateMessage={type:c.PROMPT_VALIDATE_TYPE.ERROR,message:Z,value:V},this.fileTreeService.updateRefreshable(!1),R.addValidateMessage(this.validateMessage),!1;if(V.includes(S.separator)&&this.fileTreeService.refresh(z).then(()=>{k(z.uri.resolve(V))}),this.fileTreeService.isCompactMode)if(R.type===c.TreeNodeType.CompositeTreeNode)if((!z.children||z.children.length===0)&&!E.Directory.isRoot(z)){const ie=z.uri.resolve(V),oe=[z.name].concat(V).join(S.separator);z.updateMetaData({name:oe,uri:ie,fileStat:{...z.filestat,uri:ie.toString()},tooltip:this.fileTreeAPI.getReadableTooltip(ie)}),k(ie)}else await this.fileTreeService.addNode(z,V,R.type),k(z.uri.resolve(V));else await this.fileTreeService.addNode(z,V,R.type),k(z.uri.resolve(V));else await this.fileTreeService.addNode(z,V,R.type),k(z.uri.resolve(V))}return(H=this.contextKey)===null||H===void 0||H.filesExplorerInputFocused.set(!1),!0},L=async V=>{var $,Y,H,z;if(this.validateMessage&&this.validateMessage.type===c.PROMPT_VALIDATE_TYPE.ERROR)return this.validateMessage=void 0,!0;if(P)return!1;if(!V){($=this.contextKey)===null||$===void 0||$.explorerCompressedFocusContext.set(!1),(Y=this.contextKey)===null||Y===void 0||Y.explorerCompressedFirstFocusContext.set(!1),(H=this.contextKey)===null||H===void 0||H.explorerCompressedLastFocusContext.set(!1),this.fileTreeService.isCompactMode&&R instanceof c.NewPromptHandle&&this.fileTreeService.refresh(R.parent);return}return(z=this.contextKey)===null||z===void 0||z.filesExplorerInputFocused.set(!1),await F(V),!0},B=async V=>{if(P=!0,this.validateMessage&&this.validateMessage.type===c.PROMPT_VALIDATE_TYPE.ERROR)return!1;if(V.trim()===""||this.validateMessage&&this.validateMessage.type!==c.PROMPT_VALIDATE_TYPE.ERROR)return this.validateMessage=void 0,!0;const $=await F(V);return P=!1,!!$},j=async()=>{var V;(V=this.contextKey)===null||V===void 0||V.filesExplorerInputFocused.set(!0)},W=()=>{var V;this.fileTreeService.updateRefreshable(!0),(V=this.contextKey)===null||V===void 0||V.filesExplorerInputFocused.set(!1),this.contextMenuFile&&this.selectFileDecoration(this.contextMenuFile,!0)},U=()=>{var V;(V=this.contextKey)===null||V===void 0||V.filesExplorerInputFocused.set(!1),this.fileTreeService.isCompactMode&&R instanceof c.NewPromptHandle&&this.fileTreeService.refresh(R.parent)},Q=V=>{const $=this.validateFileName(R,V);$?(this.validateMessage=$,R.addValidateMessage($)):!$&&this.validateMessage&&this.validateMessage.value!==V&&(this.validateMessage=void 0,R.removeValidateMessage())};R.destroyed||(this.fileTreeService.updateRefreshable(!1),R.onChange(Q),R.onCommit(B),R.onBlur(L),R.onFocus(j),R.onDestroy(W),R.onCancel(U))},this.copyFile=async R=>{var P;this.pasteStore&&this.pasteStore.type===d.PasteTypes.CUT&&(this._pasteStore.files.forEach(F=>{F&&this.cutDecoration.removeTarget(F)}),(P=this.contextKey)===null||P===void 0||P.explorerResourceCut.set(!1)),this.treeModel.dispatchChange();const k=[];for(const F of R){const L=this.fileTreeService.getNodeByPathOrUri(F);L&&k.push(L)}this._pasteStore={files:k,type:d.PasteTypes.COPY},this.clipboardService.writeResources(R)},this.pasteFile=async R=>{var P,k;let F=!1,L=this.fileTreeService.getNodeByPathOrUri(R.toString());if(!L)return;let B=this.pasteStore,j=!1;if(!B){const W=await this.clipboardService.readResources();if(!W||!W.length)return;B={files:[],type:d.PasteTypes.COPY,crossFiles:W},j=!0}if(B){if(E.Directory.is(L)||(F=!0,L=L.parent),j){const W=(0,p.localize)("file.confirm.paste.ok"),U=(0,p.localize)("file.confirm.paste.cancel");if(await this.dialogService.warning((0,p.formatLocalize)("file.confirm.paste",`[ ${(P=B.crossFiles)===null||P===void 0?void 0:P.map(V=>V.displayName).join(",")} ]`,E.Directory.isRoot(L)?L.uri.displayName:L.displayName),[U,W])!==W)return}if(B.type===d.PasteTypes.CUT){for(const U of B.files)U&&this.cutDecoration.removeTarget(U),L.expanded||await L.setExpanded(!0);const W=await this.fileTreeAPI.mvFiles(B.crossFiles?B.crossFiles.map(U=>{var Q;return{url:U,isDirectory:((Q=this.fileTreeService.getNodeByPathOrUri(U))===null||Q===void 0?void 0:Q.filestat.isDirectory)||!1}}):B.files.map(U=>({url:U.uri,isDirectory:U.filestat.isDirectory})),L.uri);W&&W.length>0&&(W.forEach(U=>{this.messageService.error(U)}),this.fileTreeService.refresh()),(k=this.contextKey)===null||k===void 0||k.explorerResourceCut.set(!1),this.treeModel.dispatchChange(),this._pasteStore={files:[],type:d.PasteTypes.NONE,crossFiles:void 0}}else if(B.type===d.PasteTypes.COPY){const W=B.crossFiles?B.crossFiles:B.files.map(U=>U.uri);for(const U of W){L.uri.isEqual(U)&&!F&&(L=L.parent);const Q=L.uri.resolve(U.displayName);L.expanded||await L.setExpanded(!0);const V=await this.fileTreeAPI.copyFile(U,Q);if(V)if(V.uri){const $=new p.URI(V.uri),Y=await this.filesystem.getFileStat(U.toString());this.fileTreeService.addNode(L,$.displayName,Y?.isDirectory?c.TreeNodeType.CompositeTreeNode:c.TreeNodeType.TreeNode)}else this.messageService.error(`Error when copy file: ${U.toString()}, ${V}`)}}}},this.cutFile=async R=>{var P;R.length>0&&((P=this.contextKey)===null||P===void 0||P.explorerResourceCut.set(!0)),this._pasteStore&&this._pasteStore.type===d.PasteTypes.CUT&&this._pasteStore.files.forEach(F=>{this.cutDecoration.removeTarget(F)});const k=[];for(const F of R){const L=this.fileTreeService.getNodeByPathOrUri(F);L&&k.push(L)}this._pasteStore={files:k,type:d.PasteTypes.CUT};for(const F of k)F&&this.cutDecoration.addTarget(F);this.treeModel.dispatchChange()},this.location=async R=>{if(await this.whenReady,!this.fileTreeService.filterMode)return this._fileToLocation=R,this.locationThrottler.queue(this.doLocation)},this.doLocation=async()=>{if(!this._fileToLocation)return;const R=this._fileToLocation;let P;if(typeof R=="string"?P=R:P=await this.fileTreeService.getFileTreeNodePathByUri(R),P){if(!this.fileTreeHandle)return;const k=await this.fileTreeHandle.ensureVisible(P,"center",!0);k&&this.selectFileDecoration(k)}this._fileToLocation=void 0},this.locationOnShow=R=>{this._nextLocationTarget=R},this.performLocationOnHandleShow=async()=>{this._nextLocationTarget&&(await this.location(this._nextLocationTarget),this._nextLocationTarget=void 0)}}get onDidFocusedFileChange(){return this.onDidFocusedFileChangeEmitter.event}get onDidContextMenuFileChange(){return this.onDidContextMenuFileChangeEmitter.event}get onDidSelectedFileChange(){return this.onDidSelectedFileChangeEmitter.event}get onFileTreeModelChange(){return this.onFileTreeModelChangeEmitter.event}get fileTreeHandle(){return this._fileTreeHandle}get decorations(){return this._decorations}get treeModel(){return this._treeModel}get dndService(){return this._dndService}get whenReady(){return this._whenReady.promise}get focusedFile(){return this._focusedFile}set focusedFile(R){this.onDidFocusedFileChangeEmitter.fire(R?R.uri:void 0),this._focusedFile=R}get contextMenuFile(){return this._contextMenuFile}set contextMenuFile(R){this.onDidContextMenuFileChangeEmitter.fire(R?R.uri:void 0),this._contextMenuFile=R}get selectedFiles(){return this._selectedFiles}set selectedFiles(R){this.onDidSelectedFileChangeEmitter.fire(R?R.map(P=>P.uri):[]),this._selectedFiles=R}get activeUri(){return this._activeUri}get pasteStore(){return this._pasteStore}get explorerStorage(){return this._explorerStorage}get currentRelativeUriContextKey(){return this._currentRelativeUriContextKey||(this._currentRelativeUriContextKey=this.fileTreeService.contextMenuContextKeyService.createKey("filetreeContextRelativeUri","")),this._currentRelativeUriContextKey}get currentContextUriContextKey(){return this._currentContextUriContextKey||(this._currentContextUriContextKey=this.fileTreeService.contextMenuContextKeyService.createKey("filetreeContextUri","")),this._currentContextUriContextKey}get contextMenuResourceContext(){return this._contextMenuResourceContext||(this._contextMenuResourceContext=new v.ResourceContextKey(this.fileTreeService.contextMenuContextKeyService)),this._contextMenuResourceContext}get contextKey(){return this.fileTreeService.contextKey}get initTreeModelReady(){return this._initTreeModelReady}async initTreeModel(){this._initTreeModelReady=!1;const R=(await this.fileTreeService.resolveChildren())[0];if(!R){this._whenReady.resolve();return}this._treeModel=this.injector.get(f.FileTreeModel,[R]),this.initDecorations(R),this._dndService=this.injector.get(A.DragAndDropService,[this]),this.treeStateWatcher=this._treeModel.getTreeStateWatcher(!0),this.disposableCollection.push(this.fileTreeService.onNodeRefreshed(()=>{this.initTreeModelReady&&(this.refreshedActionDelayer.isTriggered()||this.refreshedActionDelayer.cancel(),this.refreshedActionDelayer.trigger(async()=>{if(this.selectedFiles.length===0){const k=this.editorService.currentEditor;k&&k.currentUri&&this.location(k.currentUri)}this.fileTreeService.isCompactMode||(this._activeUri=null)}))})),this.disposableCollection.push(this.fileTreeService.onWorkspaceChange(()=>{this.disposableCollection.dispose(),this.initTreeModel()})),this.disposableCollection.push(this.labelService.onDidChange(async()=>{this.initTreeModelReady&&(this.labelChangedDelayer.isTriggered()||this.labelChangedDelayer.cancel(),this.labelChangedDelayer.trigger(async()=>{this.fileTreeService.refresh()}))})),this.disposableCollection.push(this.treeModel.root.watcher.on(c.TreeNodeEvent.WillResolveChildren,k=>{this.loadingDecoration.addTarget(k),this.treeModel.dispatchChange()})),this.disposableCollection.push(this.treeModel.root.watcher.on(c.TreeNodeEvent.DidResolveChildren,k=>{this.loadingDecoration.clearAppliedTarget(),this.treeModel.dispatchChange()})),this._explorerStorage=await this.storageProvider(p.STORAGE_NAMESPACE.EXPLORER);const P=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY);P&&await this.loadFileTreeSnapshot(P),this.disposableCollection.push(this.treeStateWatcher.onDidChange(()=>{if(!this._initTreeModelReady)return;const k=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),F=this.treeStateWatcher.snapshot();this.explorerStorage.set(n.FILE_TREE_SNAPSHOT_KEY,{...k,...F})})),this.fileTreeService.startWatchFileEvent(),this.onFileTreeModelChangeEmitter.fire(this._treeModel),this._whenReady.resolve(),this._initTreeModelReady=!0}initDecorations(R){this._decorations=new c.DecorationsManager(R),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.contextMenuDecoration),this._decorations.addDecoration(this.cutDecoration),this._decorations.addDecoration(this.loadingDecoration)}setFileTreeContextKey(R){var P;this.currentContextUriContextKey.set(R.uri.toString()),this.currentRelativeUriContextKey.set((this.treeModel.root.uri.relative(R.uri)||"").toString()),this.contextMenuResourceContext.set(R.uri),(P=this.contextKey)===null||P===void 0||P.explorerResourceIsFolder.set(R&&R.type===c.TreeNodeType.CompositeTreeNode)}async loadFileTreeSnapshot(R){await this._treeModel.loadTreeState(R)}updateExplorerCompressedContextKey(R,P){var k,F,L,B,j,W,U,Q,V,$,Y,H,z,K,Z,X;if(R&&P){(k=this.contextKey)===null||k===void 0||k.explorerCompressedFocusContext.set(!0);const ie=new S(R.name);ie.name===P.displayName?((F=this.contextKey)===null||F===void 0||F.explorerCompressedLastFocusContext.set(!0),(L=this.contextKey)===null||L===void 0||L.explorerCompressedFirstFocusContext.set(!1)):ie.root&&ie.root.name===P.displayName?((B=this.contextKey)===null||B===void 0||B.explorerCompressedLastFocusContext.set(!1),(j=this.contextKey)===null||j===void 0||j.explorerCompressedFirstFocusContext.set(!0)):((W=this.contextKey)===null||W===void 0||W.explorerCompressedLastFocusContext.set(!1),(U=this.contextKey)===null||U===void 0||U.explorerCompressedFirstFocusContext.set(!1))}else R?R.name.indexOf(S.separator)>0?((Q=this.contextKey)===null||Q===void 0||Q.explorerCompressedFocusContext.set(!0),(V=this.contextKey)===null||V===void 0||V.explorerCompressedFirstFocusContext.set(!1),($=this.contextKey)===null||$===void 0||$.explorerCompressedLastFocusContext.set(!0)):((Y=this.contextKey)===null||Y===void 0||Y.explorerCompressedFocusContext.set(!1),(H=this.contextKey)===null||H===void 0||H.explorerCompressedFirstFocusContext.set(!1),(z=this.contextKey)===null||z===void 0||z.explorerCompressedLastFocusContext.set(!1)):((K=this.contextKey)===null||K===void 0||K.explorerCompressedFocusContext.set(!1),(Z=this.contextKey)===null||Z===void 0||Z.explorerCompressedFirstFocusContext.set(!1),(X=this.contextKey)===null||X===void 0||X.explorerCompressedLastFocusContext.set(!1))}handleTreeHandler(R){this._fileTreeHandle=R}toggleOrOpenCurrentFile(){let R;this.focusedFile?R=this.focusedFile:this.contextMenuFile&&(R=this.contextMenuFile),R&&(this.activeFileDecoration(R),E.Directory.is(R)?this.toggleDirectory(R):this.fileTreeService.openFile(R.uri))}moveToNext(){let R;if(this.focusedFile?R=this.focusedFile:this.contextMenuFile&&(R=this.contextMenuFile),!R)return;const k=this.treeModel.root.getIndexAtTreeNode(R)+1,F=this.treeModel.root.getTreeNodeAtIndex(k),L=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),B=(k+1)*l.FILE_TREE_NODE_HEIGHT-(L.scrollPosition||0),{height:j}=this.fileTreeHandle.getCurrentSize();F&&(this.activateFileFocusedDecoration(F),B>j&&this.fileTreeHandle.ensureVisible(F,"end"))}moveToPrev(){let R;if(this.focusedFile?R=this.focusedFile:this.contextMenuFile&&(R=this.contextMenuFile),!R)return;const P=this.treeModel.root.getIndexAtTreeNode(R);if(P===0)return;const k=P-1,F=this.treeModel.root.getTreeNodeAtIndex(k);if(!F)return;const L=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),B=k*l.FILE_TREE_NODE_HEIGHT;this.activateFileFocusedDecoration(F),(L.scrollPosition||0)>B&&this.fileTreeHandle.ensureVisible(F,"start")}async collapseCurrentFile(){let R;this.focusedFile?(R=this.focusedFile,this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0):this.contextMenuFile&&(R=this.contextMenuFile,this.focusedDecoration.removeTarget(this.contextMenuFile),this.contextMenuFile=void 0);const P=this.selectedFiles.indexOf(R);P>=0&&(this.selectedFiles.splice(P,1),this.selectedDecoration.removeTarget(R));let k;if(E.Directory.is(R)&&R.expanded)k=R;else if(R)E.Directory.isRoot(R.parent)?k=R:k=R.parent;else return;this.focusedFile=k,k&&k.expanded&&(await this.fileTreeHandle.collapseNode(k),this.activeFileFocusedDecoration(k,!0))}async expandCurrentFile(){let R;this.focusedFile?(R=this.focusedFile,this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0):this.contextMenuFile&&(R=this.contextMenuFile,this.focusedDecoration.removeTarget(this.contextMenuFile),this.contextMenuFile=void 0);const P=this.selectedFiles.indexOf(R);P>=0&&(this.selectedFiles.splice(P,1),this.selectedDecoration.removeTarget(R)),this.focusedFile=R,E.Directory.is(R)&&(R.expanded||await this.fileTreeHandle.expandNode(R))}async collapseAll(){await this.treeModel.root.collapsedAll();const R=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY);R&&this.explorerStorage.set(n.FILE_TREE_SNAPSHOT_KEY,{...R,expandedDirectories:{atSurface:[],buried:[]}})}async deleteFileByUris(R){var P;if(R.length===0)return;if(this.corePreferences["explorer.confirmDelete"]){const B=this.applicationService.backendOS===p.OperatingSystem.Linux,j=B?(0,p.localize)("file.confirm.delete.ok"):(0,p.localize)("file.confirm.moveToTrash.ok"),W=(0,p.localize)("file.confirm.delete.cancel"),U=10;let Q=R.slice(0,U).map($=>$.displayName).join(`
|
|
31633
|
+
`,y){const A=this.hashCalculateService.calculate(d);return u.length>m.FILE_SAVE_BY_CHANGE_THRESHOLD?await this.fileSchemeDocClient.saveByChange(h.toString(),{baseMd5:A,changes:E,eol:b},f,l,y):await this.fileSchemeDocClient.saveByContent(h.toString(),{baseMd5:A,content:u},f,l,y)}async provideEditorDocumentModelContentMd5(h,u){return this.fileSchemeDocClient.getMd5(h.toString(),u)}};t.FileSchemeDocumentProvider=_,n.__decorate([(0,r.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],_.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(m.IFileSchemeDocClient),n.__metadata("design:type",Object)],_.prototype,"fileSchemeDocClient",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],_.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(c.IHashCalculateService),n.__metadata("design:type",Object)],_.prototype,"hashCalculateService",void 0),t.FileSchemeDocumentProvider=_=n.__decorate([(0,r.Injectable)()],_);let s=class{constructor(){this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event,this.listeners={}}isReadonly(h){return!0}handlesScheme(h){return h==="vscode"}async provideEditorDocumentModelContent(h,u){return this.getSchemaContent(h)}getSchemaContent(h){const u=h.toString(),d=this.jsonRegistry.getSchemaContributions().schemas[u];if(d){const E=JSON.stringify(d);if(!this.listeners[u]){const f=o.Disposable.create(()=>{this.jsonRegistry.onDidChangeSchema(l=>{l===u&&this._onDidChangeContent.fire(h)})});this.listeners[u]=f}return E}return"{}"}onDidDisposeModel(h){h.toString()&&(this.listeners[h.toString()].dispose(),delete this.listeners[h.toString()])}};t.VscodeSchemeDocumentProvider=s,n.__decorate([(0,r.Autowired)(o.ISchemaStore),n.__metadata("design:type",Object)],s.prototype,"schemaStore",void 0),n.__decorate([(0,r.Autowired)(o.IJSONSchemaRegistry),n.__metadata("design:type",Object)],s.prototype,"jsonRegistry",void 0),t.VscodeSchemeDocumentProvider=s=n.__decorate([(0,r.Injectable)()],s);let g=class{constructor(){this.documentContentMaps=new Map,this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event}handlesScheme(h){return h===o.Schemes.walkThroughSnippet}provideEditorDocumentModelContent(h,u){return this.documentContentMaps.has(h.toString())||this.documentContentMaps.set(h.toString(),""),this.documentContentMaps.get(h.toString())}isReadonly(){return!1}preferLanguageForUri(){return"plaintext"}};t.WalkThroughSnippetSchemeDocumentProvider=g,t.WalkThroughSnippetSchemeDocumentProvider=g=n.__decorate([(0,r.Injectable)()],g)},41352:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSchemeDocClientService=void 0;const n=e(85608),r=e(76003),o=e(80449);let c=class{saveByChange(v,m,_,s,g){return this.fileDocBackendService.$saveByChange(v,m,_,s,g)}saveByContent(v,m,_,s,g){return this.fileDocBackendService.$saveByContent(v,m,_,s,g)}getMd5(v,m){return this.fileDocBackendService.$getMd5(v,m)}};t.FileSchemeDocClientService=c,n.__decorate([(0,r.Autowired)(o.FileSchemeDocNodeServicePath),n.__metadata("design:type",Object)],c.prototype,"fileDocBackendService",void 0),t.FileSchemeDocClientService=c=n.__decorate([(0,r.Injectable)()],c)},17276:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystemEditorComponentContribution=t.FileSystemEditorResourceContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(26542),p=e(57517),v=e(17878),m=e(42933),_=e(57646),s=e(60387),g=e(88819),a=e(99025),h="video-preview",u="image-preview",d="external-file",E="large-file-prevent";let f=class{registerResource(y){y.registerResourceProvider(this.untitledResourceProvider)}registerEditorDocumentModelContentProvider(y){y.registerEditorDocumentModelContentProvider(this.fileSchemeDocumentProvider),y.registerEditorDocumentModelContentProvider(this.vscodeSchemeDocumentProvider),y.registerEditorDocumentModelContentProvider(this.walkThroughSnippetSchemeDocumentProvider),y.registerEditorDocumentModelContentProvider(this.untitledSchemeDocumentProvider)}};t.FileSystemEditorResourceContribution=f,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s.FileSchemeDocumentProvider)],f.prototype,"fileSchemeDocumentProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s.VscodeSchemeDocumentProvider)],f.prototype,"vscodeSchemeDocumentProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s.WalkThroughSnippetSchemeDocumentProvider)],f.prototype,"walkThroughSnippetSchemeDocumentProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",v.UntitledSchemeResourceProvider)],f.prototype,"untitledResourceProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",v.UntitledSchemeDocumentProvider)],f.prototype,"untitledSchemeDocumentProvider",void 0),t.FileSystemEditorResourceContribution=f=n.__decorate([(0,o.Domain)(p.BrowserEditorContribution)],f);let l=class{constructor(){this.cachedFileType=new o.LRUMap(200,100),this.fileServiceClient.onFilesChanged(y=>{y.forEach(A=>{this.cachedFileType.delete(A.uri.toString())})})}registerEditorComponent(y){y.registerEditorComponent({component:a.ImagePreview,uid:u,scheme:o.Schemes.file}),y.registerEditorComponent({component:a.VideoPreview,uid:h,scheme:o.Schemes.file}),y.registerEditorComponent({component:_.BinaryEditorComponent,uid:d,scheme:o.Schemes.file}),y.registerEditorComponent({component:g.LargeFilePrevent,uid:E,scheme:o.Schemes.file}),y.registerEditorComponentResolver(A=>A===o.Schemes.file||this.fileServiceClient.handlesScheme(A)?10:-1,(A,S)=>{S.length===0&&S.push({type:p.EditorOpenType.component,componentId:d})}),y.registerEditorComponentResolver(A=>A===o.Schemes.file||this.fileServiceClient.handlesScheme(A)?10:-1,async(A,S)=>{const w=await this.getFileType(A.uri.toString());switch(w){case"image":{S.push({type:p.EditorOpenType.component,componentId:u});break}case"video":{S.push({type:p.EditorOpenType.component,componentId:h});break}case"binary":case"text":{const{metadata:T,uri:D}=A,I=T||{};if(w==="binary"&&!I.skipPreventBinary)break;const O=await this.fileServiceClient.getFileStat(D.toString());await this.preference.ready;const M=this.preference.getValid("editor.largeFile",4*1024*1024*1024);O&&(O.size||0)>M&&!I.skipPreventTooLarge?S.push({type:p.EditorOpenType.component,componentId:E}):S.push({type:p.EditorOpenType.code,title:(0,o.localize)("editorOpenType.code")});break}}}),y.registerEditorComponentResolver(o.Schemes.untitled,(A,S,w)=>{w([{type:p.EditorOpenType.code,priority:"default"}])})}async getFileType(y){return this.cachedFileType.has(y)||((0,c.getLanguageIdFromMonaco)(new o.URI(y))?this.cachedFileType.set(y,"text"):this.cachedFileType.set(y,await this.getRealFileType(y))),this.cachedFileType.get(y)}async getRealFileType(y){try{return await this.fileServiceClient.getFileType(y)}catch{return"text"}}};t.FileSystemEditorComponentContribution=l,n.__decorate([(0,r.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],l.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],l.prototype,"preference",void 0),t.FileSystemEditorComponentContribution=l=n.__decorate([(0,o.Domain)(p.BrowserEditorContribution),n.__metadata("design:paramtypes",[])],l)},52568:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSchemeModule=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(80449),p=e(41352),v=e(17276);let m=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[v.FileSystemEditorResourceContribution,v.FileSystemEditorComponentContribution,{token:c.IFileSchemeDocClient,useClass:p.FileSchemeDocClientService}],this.backServices=[{servicePath:c.FileSchemeDocNodeServicePath}]}};t.FileSchemeModule=m,t.FileSchemeModule=m=n.__decorate([(0,r.Injectable)()],m)},88819:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LargeFilePrevent=t.PreventComponent=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=e(41869),p=e(81878),v=e(54414),m=e(82196),_=n.__importDefault(e(19996)),s=a=>o.default.createElement("div",{className:_.default["error-page"]},o.default.createElement("div",{className:(0,r.default)(_.default.icon,(0,c.getExternalIcon)("warning"))}),o.default.createElement("div",{className:_.default.description},a.description),o.default.createElement("div",{className:_.default["actions-wrapper"]},a.actions.map((h,u)=>o.default.createElement(p.Button,{key:u,onClick:()=>h.onClick(),className:_.default["action-button"]},h.label))));t.PreventComponent=s;const g=()=>{const a=(0,c.useInjectable)(v.WorkbenchEditorService),h=(0,c.useInjectable)(c.IEventBus),u=()=>{const d=a.currentResource;d&&(d.metadata={...d.metadata,skipPreventTooLarge:!0},h.fire(new m.ResourceOpenTypeChangedEvent(d.uri)))};return o.default.createElement(t.PreventComponent,{description:(0,c.localize)("editor.largeFile.prevent"),actions:[{label:(0,c.localize)("editor.file.prevent.stillOpen"),onClick:()=>u()}]})};t.LargeFilePrevent=g},99025:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImagePreview=t.VideoPreview=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(41869),c=e(40827),p=n.__importDefault(e(19996)),v=_=>{const s=(0,o.useInjectable)(c.StaticResourceService);return{src:r.default.useMemo(()=>s.resolveStaticResource(_.uri).toString(),[_])}};t.VideoPreview=(0,r.memo)(_=>{const{src:s}=v(_.resource);return r.default.createElement("div",{className:p.default.kt_video_preview},r.default.createElement("video",{playsInline:!0,controls:!0,className:p.default.kt_video,src:s}))});const m=_=>{const s=r.default.useRef(),g=r.default.useRef(),{src:a}=v(_.resource);return r.default.useEffect(()=>{const h=new o.Disposable;return s.current&&(s.current.src=a),()=>{h.dispose()}},[_.resource]),r.default.createElement("div",{className:p.default.kt_image_preview},r.default.createElement("div",{ref:g},r.default.createElement("img",{ref:h=>h&&(s.current=h)})))};t.ImagePreview=m},80449:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChangeType=t.FileSchemeDocNodeServicePath=t.IFileSchemeDocNodeService=t.IFileSchemeDocClient=t.FILE_SAVE_BY_CHANGE_THRESHOLD=t.FILE_ON_DISK_SCHEME=void 0,t.FILE_ON_DISK_SCHEME="fileOnDisk",t.FILE_SAVE_BY_CHANGE_THRESHOLD=1e5,t.IFileSchemeDocClient=Symbol("IFileSchemeDocClient"),t.IFileSchemeDocNodeService=Symbol("FileSchemeDocNodeService"),t.FileSchemeDocNodeServicePath="FileSchemeDocNodeService";var e;(function(n){n[n.ADDED=1]="ADDED",n[n.REMOVED=2]="REMOVED"})(e||(t.ChangeType=e={}))},15625:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IFileSearchService=t.FileSearchServicePath=void 0,t.FileSearchServicePath="FileSearchServicePath",t.IFileSearchService=Symbol("FileSearchService")},84660:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(15625),t)},47720:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(84660),t)},2156:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileServiceClient=t.BrowserFileSystemRegistryImpl=void 0;const n=e(85608),r=e(32852),o=e(76003),c=e(41869),p=e(43718),v=e(37406),m=e(8170),_=e(41682),s=e(42933),g=e(81952);let a=class{constructor(){this.providers=new Map}registerFileSystemProvider(d){const E=d.scheme;return this.providers.set(E,d),{dispose:()=>{this.providers.delete(E)}}}};t.BrowserFileSystemRegistryImpl=a,t.BrowserFileSystemRegistryImpl=a=n.__decorate([(0,o.Injectable)()],a);let h=class{get clientId(){return this.applicationService.clientId}constructor(){this.watcherWithSchemaMap=new Map,this.watcherDisposerMap=new Map,this.onFileChangedEmitter=new c.Emitter,this.onFileProviderChangedEmitter=new c.Emitter,this._onFilesChanged=new c.Emitter,this.onFilesChanged=this._onFilesChanged.event,this._onFileProviderChanged=new c.Emitter,this.onFileProviderChanged=this._onFileProviderChanged.event,this._onDidChangeFileSystemProviderRegistrations=new c.Emitter,this.onDidChangeFileSystemProviderRegistrations=this._onDidChangeFileSystemProviderRegistrations.event,this._onWillActivateFileSystemProvider=new c.Emitter,this.onWillActivateFileSystemProvider=this._onWillActivateFileSystemProvider.event,this._onDidChangeFileSystemProviderCapabilities=new c.Emitter,this.onDidChangeFileSystemProviderCapabilities=this._onDidChangeFileSystemProviderCapabilities.event,this.filesExcludesMatcherList=[],this.watcherId=0,this.toDisposable=new c.DisposableCollection,this.watchFileExcludes=[],this.watchFileExcludesMatcherList=[],this.filesExcludes=[],this.workspaceRoots=[],this._providerChanged=new Set,this.fsProviders=new Map,this.userHomeDeferred=new c.Deferred,this.options={encoding:"utf8",overwrite:!1,recursive:!0,moveToTrash:!0},this.uriWatcherMap=new Map,this.toDisposable.push(this.onDidChangeFileSystemProviderRegistrations(d=>{d.added&&d.scheme===p.Schemes.file&&this.doGetCurrentUserHome()}))}async initialize(){const d=await this.getProvider(p.Schemes.file);d.initialize&&await d.initialize(this.clientId,this.appConfig.recursiveWatcherBackend)}async doGetCurrentUserHome(){const E=(await this.getProvider(p.Schemes.file)).getCurrentUserHome();this.userHomeDeferred.resolve(E)}handlesScheme(d){return this.registry.providers.has(d)||this.fsProviders.has(d)}dispose(){return this.toDisposable.dispose()}async resolveContent(d,E){const f=this.convertUri(d),b=await(await this.getProvider(f.scheme)).readFile(f.codeUri),y=b.data||b;return{content:c.BinaryBuffer.wrap(Uint8Array.from(y)).toString(E?.encoding)}}async readFile(d){const E=this.convertUri(d),l=await(await this.getProvider(E.scheme)).readFile(E.codeUri),b=l.data||l;return{content:c.BinaryBuffer.wrap(Uint8Array.from(b))}}async readFileStream(d){const E=this.convertUri(d);return await(await this.getProvider(E.scheme)).readFileStream(E.codeUri)}async getFileStat(d,E=!0){const f=this.convertUri(d),l=await this.getProvider(f.scheme);try{const b=await l.stat(f.codeUri);if(!b)throw s.FileSystemError.FileNotFound(f.codeUri.toString(),"File not found.");return this.filterStat(b,E)}catch(b){if(s.FileSystemError.FileNotFound.is(b))return}}async setContent(d,E,f){const l=this.convertUri(d.uri),b=await this.getProvider(l.scheme),y=await b.stat(l.codeUri);if(!y)throw s.FileSystemError.FileNotFound(d.uri,"File not found.");if(y.isDirectory)throw s.FileSystemError.FileIsADirectory(d.uri,"Cannot set the content.");if(!await this.isInSync(d,y))throw this.createOutOfSyncError(d);return await b.writeFile(l.codeUri,typeof E=="string"?c.BinaryBuffer.fromString(E).buffer:E,{create:!1,overwrite:!0,encoding:f?.encoding}),await b.stat(l.codeUri)}async updateContent(d,E,f){const l=this.convertUri(d.uri),b=await this.getProvider(l.scheme),y=await b.stat(l.codeUri);if(!y)throw s.FileSystemError.FileNotFound(d.uri,"File not found.");if(y.isDirectory)throw s.FileSystemError.FileIsADirectory(d.uri,"Cannot set the content.");if(!this.checkInSync(d,y))throw this.createOutOfSyncError(d);if(E.length===0)return y;const A=await b.readFile(l.codeUri),S=this.applyContentChanges(c.BinaryBuffer.wrap(A).toString(f?.encoding),E);await b.writeFile(l.codeUri,c.BinaryBuffer.fromString(S).buffer,{create:!1,overwrite:!0,encoding:f?.encoding});const w=await b.stat(l.codeUri);if(!w)throw s.FileSystemError.FileNotFound(l.codeUri.toString(),"File not found.");return w}async createFile(d,E){const f=this.convertUri(d),l=await this.getProvider(f.scheme),b=c.BinaryBuffer.fromString(E?.content||"").buffer;let y=await l.writeFile(f.codeUri,b,{create:!0,overwrite:E&&E.overwrite||!1,encoding:E?.encoding});return y=y||await l.stat(f.codeUri),y}async createFolder(d){const E=this.convertUri(d),f=await this.getProvider(E.scheme),l=await f.createDirectory(E.codeUri);return l||await f.stat(E.codeUri)}async move(d,E,f){const l=this.convertUri(d),b=this.convertUri(E),y=await this.getProvider(l.scheme),A=await y.rename(l.codeUri,b.codeUri,{overwrite:!!(f&&f.overwrite)});return A||await y.stat(b.codeUri)}async copy(d,E,f){const l=this.convertUri(d),b=this.convertUri(E),y=await this.getProvider(l.scheme),A=await this.doGetOverwrite(f);if(!(0,s.containsExtraFileMethod)(y,"copy"))throw this.getErrorProvideNotSupport(l.scheme,"copy");const S=await y.copy(l.codeUri,b.codeUri,{overwrite:!!A});return S||await y.stat(b.codeUri)}async getFsPath(d){if(d.startsWith("file:/"))return c.FileUri.fsPath(d)}fireFilesChange(d){const E=d.changes.map(f=>({uri:f.uri,type:f.type}));this._onFilesChanged.fire(E),this.eventBus.fire(new c.FilesChangeEvent(E))}async watchFileChanges(d,E){const l=(this.appConfig.pollingWatcherDirectories||[]).some(I=>d.path.toString().startsWith(I)),b=this.convertUri(d.toString());let y=0;const A=await this.getProvider(b.scheme),S=this.watcherWithSchemaMap.get(b.scheme)||[];let w;if(this.uriWatcherMap.has(b.toString())){const I=this.uriWatcherMap.get(b.toString());w=I?.watcher,w&&await w.dispose()}w?y=w.watchId:y=this.watcherId++;const T=await A.watch(b.codeUri,{excludes:E,pollingWatch:l});this.watcherDisposerMap.set(y,{dispose:async()=>{const I=this.uriWatcherMap.get(b.toString()),O=I?.watcher;await Promise.all([A.unwatch&&A.unwatch(T),O&&O.dispose()]),this.uriWatcherMap.delete(b.toString())}}),S.push(y),this.watcherWithSchemaMap.set(b.scheme,S);const D=new g.FileSystemWatcher({fileServiceClient:this,watchId:y,uri:d});return this.uriWatcherMap.set(b.toString(),{watcher:D,excludes:E}),D}async setWatchFileExcludes(d){return await(await this.getProvider(p.Schemes.file)).setWatchFileExcludes(d)}async getWatchFileExcludes(){return await(await this.getProvider(p.Schemes.file)).getWatchFileExcludes()}async setFilesExcludes(d,E){this.filesExcludes=d,this.filesExcludesMatcherList=[],E&&this.setWorkspaceRoots(E),this.updateExcludeMatcher()}async setWorkspaceRoots(d){this.workspaceRoots=d,this.updateExcludeMatcher()}async unwatchFileChanges(d){const E=this.watcherDisposerMap.get(d);if(!(!E||!E.dispose))return this.watcherDisposerMap.delete(d),E.dispose()}async delete(d,E){if(this.appConfig.isElectronRenderer&&E?.moveToTrash!==!1){const b=new c.URI(d);if(b.scheme===p.Schemes.file)return this.injector.get(v.IElectronMainUIService).moveToTrash(b.codeUri.fsPath)}const f=this.convertUri(d),l=await this.getProvider(f.scheme);await l.stat(f.codeUri),await l.delete(f.codeUri,{recursive:!0,moveToTrash:await this.doGetMoveToTrash(E)})}async getEncoding(d){return"utf8"}listCapabilities(){return _.Iterable.map(this.fsProviders,([d,E])=>({scheme:d,capabilities:E.capabilities}))}registerProvider(d,E){if(this.fsProviders.has(d))throw new Error(`The file system provider for \`${d}\` already registered`);const f=[];this.fsProviders.set(d,E),this._onDidChangeFileSystemProviderRegistrations.fire({added:!0,scheme:d,provider:E}),f.push({dispose:()=>{this._onDidChangeFileSystemProviderRegistrations.fire({added:!1,scheme:d,provider:E}),this.fsProviders.delete(d),this._providerChanged.add(d)}}),E.onDidChangeFile&&f.push(E.onDidChangeFile(b=>this.fireFilesChange({changes:b}))),this.toDisposable.push(E.onDidChangeCapabilities(()=>this._onDidChangeFileSystemProviderCapabilities.fire({provider:E,scheme:d}))),f.push({dispose:async()=>{const b=[];(this.watcherWithSchemaMap.get(d)||[]).forEach(y=>b.push(this.unwatchFileChanges(y))),await Promise.all(b)}}),this._providerChanged.add(d),this.onFileProviderChangedEmitter.fire(Array.from(this._providerChanged)),this.toDisposable.pushAll(f);const l=new c.DisposableCollection;return l.pushAll(f),this._onFileProviderChanged.fire(Array.from(this._providerChanged)),l}async access(d,E=s.FileAccess.Constants.F_OK){const f=this.convertUri(d),l=await this.getProvider(f.scheme);if(!(0,s.containsExtraFileMethod)(l,"access")){if(E===s.FileAccess.Constants.F_OK)try{return!!await l.stat(f.codeUri)}catch{return!1}throw this.getErrorProvideNotSupport(f.scheme,"access")}return await l.access(f.codeUri,E)}async getFileType(d){const E=this.convertUri(d),f=await this.getProvider(E.scheme);if(!(0,s.containsExtraFileMethod)(f,"getFileType"))throw this.getErrorProvideNotSupport(E.scheme,"getFileType");return await f.getFileType(d)}async getCurrentUserHome(){return this.userHomeDeferred.promise}getErrorProvideNotSupport(d,E){return`Scheme ${d} not support this function: ${E}.`}convertUri(d){const E=new c.URI(d);if(!E.scheme)throw new Error(`Unsupported convert Uri with non-scheme Uri: ${d}`);return E}updateExcludeMatcher(){this.filesExcludes.forEach(d=>{this.workspaceRoots.length>0?this.workspaceRoots.forEach(E=>{const l=new c.URI(E).resolve(d).path.toString();this.filesExcludesMatcherList.push((0,c.parseGlob)(l))}):this.filesExcludesMatcherList.push((0,c.parseGlob)(d))})}async shouldWaitProvider(d){const E=await this._onWillActivateFileSystemProvider.fireAndAwait({scheme:d}),{result:f}=E[0];if(f&&f.includes(d)){const l=await c.Event.toPromise(c.Event.filter(this.onFileProviderChanged,b=>b.includes(d)));if(!(0,p.isUndefined)(l))return!0}return!1}async getProvider(d){this._providerChanged.has(d)&&(await this.eventBus.fireAndAwait(new c.ExtensionActivateEvent({topic:"onFileSystem",data:d}),{timeout:3e3}),this._providerChanged.delete(d));const E=this.fsProviders.get(d);if(!E)throw new Error(`Not find ${d} provider.`);return E}async isReadonly(d){try{const E=new c.URI(d);return!!(await(await this.getProvider(E.scheme)).stat(this.convertUri(d).codeUri)).readonly}catch{return!1}}isExclude(d){const E=new c.URI(d);return this.filesExcludesMatcherList.some(f=>f(E.path.toString()))}filterStat(d,E=!0){if(d&&!this.isExclude(d.uri))return d.children&&E&&(d.children=this.filterStatChildren(d.children)),d}filterStatChildren(d){const E=[];return d.forEach(f=>{if(this.isExclude(f.uri))return!1;const l=this.filterStat(f);l&&E.push(l)}),E}applyContentChanges(d,E){let f=r.TextDocument.create("","",1,d);for(const l of E){let b=l.text;if(l.range){const y=f.offsetAt(l.range.start),A=f.offsetAt(l.range.end);b=f.getText().substr(0,y)+l.text+f.getText().substr(A)}f=r.TextDocument.create(f.uri,f.languageId,f.version,b)}return f.getText()}async isInSync(d,E){return!!this.checkInSync(d,E)}checkInSync(d,E){return E.lastModification===d.lastModification&&E.size===d.size}createOutOfSyncError(d){return s.FileSystemError.FileIsOutOfSync(d.uri)}async doGetEncoding(d){return d&&typeof d.encoding<"u"?d.encoding:this.options.encoding}async doGetOverwrite(d){return d&&typeof d.overwrite<"u"?d.overwrite:this.options.overwrite}async doGetRecursive(d){return d&&typeof d.recursive<"u"?d.recursive:this.options.recursive}async doGetMoveToTrash(d){return d&&typeof d.moveToTrash<"u"?d.moveToTrash:this.options.moveToTrash}async reconnect(){const d=await this.getProvider(p.Schemes.file);d.initialize&&await d.initialize(this.clientId,this.appConfig.recursiveWatcherBackend);const f=Array.from(this.uriWatcherMap.keys()).map(async l=>{var b;try{const y=new c.URI(l),A=this.uriWatcherMap.get(l);A?.watcher&&await this.watchFileChanges(y,A.excludes)}catch(y){(b=this.logger)===null||b===void 0||b.error("Error reconnecting watcher for:",l,y)}});await Promise.allSettled(f)}};t.FileServiceClient=h,n.__decorate([(0,o.Autowired)(s.IBrowserFileSystemRegistry),n.__metadata("design:type",a)],h.prototype,"registry",void 0),n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],h.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(p.IEventBus),n.__metadata("design:type",Object)],h.prototype,"eventBus",void 0),n.__decorate([(0,o.Autowired)(c.AppConfig),n.__metadata("design:type",Object)],h.prototype,"appConfig",void 0),n.__decorate([(0,o.Autowired)(m.IApplicationService),n.__metadata("design:type",Object)],h.prototype,"applicationService",void 0),n.__decorate([(0,o.Autowired)(p.ILogger),n.__metadata("design:type",Object)],h.prototype,"logger",void 0),t.FileServiceClient=h=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],h)},69037:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileServiceContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(42933),p=e(2156);let v=class{constructor(){this._disposables=new o.DisposableStore,this._disposables.add(this.fileSystem.registerProvider(o.Schemes.file,this.diskFileServiceProvider))}async initialize(){const _=this.contributionProvider.getContributions();await Promise.all(_.map(async s=>{s.registerProvider&&await s.registerProvider(this.fileSystem)})),await Promise.all(_.map(async s=>{s.onFileServiceReady&&await s.onFileServiceReady()})),this.fileSystem.initialize&&await this.fileSystem.initialize()}onReconnect(){this.fileServiceClient.reconnect().catch(_=>this.logger.error("Failed to reconnect watchers:",_))}dispose(){this._disposables.dispose()}};t.FileServiceContribution=v,n.__decorate([(0,r.Autowired)(c.IFileServiceClient),n.__metadata("design:type",p.FileServiceClient)],v.prototype,"fileSystem",void 0),n.__decorate([(0,r.Autowired)(c.IDiskFileProvider),n.__metadata("design:type",Object)],v.prototype,"diskFileServiceProvider",void 0),n.__decorate([(0,r.Autowired)(o.FsProviderContribution),n.__metadata("design:type",Object)],v.prototype,"contributionProvider",void 0),n.__decorate([(0,r.Autowired)(c.IFileServiceClient),n.__metadata("design:type",Object)],v.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],v.prototype,"logger",void 0),t.FileServiceContribution=v=n.__decorate([(0,o.Domain)(o.ClientAppContribution),n.__metadata("design:paramtypes",[])],v)},60476:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiskFsProviderClient=t.CoreFileServiceProviderClient=void 0;const n=e(85608),r=e(76003),o=e(43718),c=e(42933);class p{constructor(){this.onDidChangeFileEmitter=new o.Emitter,this.onDidChangeFile=this.onDidChangeFileEmitter.event}watch(_,s){return this.fileServiceProvider.watch(_,s)}unwatch(_){return this.fileServiceProvider.unwatch&&this.fileServiceProvider.unwatch(_)}async stat(_){return await this.fileServiceProvider.stat(_)}readDirectory(_){return this.fileServiceProvider.readDirectory(_)}createDirectory(_){return this.fileServiceProvider.createDirectory(_)}async readFile(_,s){return s&&(0,o.getDebugLogger)("fileService.fsProvider").warn("encoding option for fsProvider.readFile is deprecated"),await this.fileServiceProvider.readFile(_)}readFileStream(_){if(this.fileServiceProvider.readFileStream)return this.fileServiceProvider.readFileStream(_);throw new Error("readFileStream not supported")}writeFile(_,s,g){return this.fileServiceProvider.writeFile(_,Array.from(s),g)}delete(_,s){return this.fileServiceProvider.delete(_,s)}rename(_,s,g){return this.fileServiceProvider.rename(_,s,g)}}t.CoreFileServiceProviderClient=p,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],p.prototype,"injector",void 0);let v=class extends p{constructor(){super(...arguments),this.onDidChangeCapabilities=o.Event.None}get capabilities(){return this._capabilities||(this._capabilities=12318,o.isLinux&&(this._capabilities|=1024)),this._capabilities}async initialize(_,s){var g,a;if(!((g=this.fileServiceProvider)===null||g===void 0)&&g.initialize)try{await((a=this.fileServiceProvider)===null||a===void 0?void 0:a.initialize(_,s))}catch(h){(0,o.getDebugLogger)("fileService.fsProvider").error("initialize error",h)}}setWatchFileExcludes(_){return this.fileServiceProvider.setWatchFileExcludes(_)}getWatchFileExcludes(){return this.fileServiceProvider.getWatchFileExcludes()}onDidFilesChanged(_){const s=_.changes.map(g=>({uri:g.uri,type:g.type}));this.onDidChangeFileEmitter.fire(s)}copy(_,s,g){return this.fileServiceProvider.copy(_,s,g)}access(_,s){return this.fileServiceProvider.access(_,s)}getCurrentUserHome(){return this.fileServiceProvider.getCurrentUserHome()}getFileType(_){return this.fileServiceProvider.getFileType(_)}};t.DiskFsProviderClient=v,n.__decorate([(0,r.Autowired)(c.DiskFileServicePath),n.__metadata("design:type",Object)],v.prototype,"fileServiceProvider",void 0),n.__decorate([(0,o.debounce)(100),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Array]),n.__metadata("design:returntype",void 0)],v.prototype,"setWatchFileExcludes",null),t.DiskFsProviderClient=v=n.__decorate([(0,r.Injectable)()],v)},96708:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileServiceClientModule=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(42933),p=e(70671),v=e(2156),m=e(69037),_=e(60476),s=e(23188);let g=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:c.IFileServiceClient,useClass:v.FileServiceClient},{token:c.IBrowserFileSystemRegistry,useClass:v.BrowserFileSystemRegistryImpl},{token:c.IDiskFileProvider,useClass:_.DiskFsProviderClient},{token:c.IShadowFileProvider,useClass:s.ShadowFileSystemProvider},m.FileServiceContribution],this.backServices=[{servicePath:c.DiskFileServicePath,clientToken:c.IDiskFileProvider,protocol:p.DiskFileServiceProtocol}]}};t.FileServiceClientModule=g,t.FileServiceClientModule=g=n.__decorate([(0,r.Injectable)()],g)},23188:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShadowFileSystemProvider=void 0;const n=e(85608),r=e(76003),o=e(41869);let c=class{constructor(){this.capabilities=2048,this.onDidChangeCapabilities=o.Event.None,this.readonly=!0,this.shadowFiles=new Map,this.fileChangeEmitter=new o.Emitter,this.onDidChangeFile=this.fileChangeEmitter.event}unwatch(v){throw new Error("Method not implemented.")}readFileStream(v){throw new Error("Method not implemented.")}watch(v,m){throw new Error("Method not implemented.")}stat(v){return Promise.resolve({uri:v.toString(),lastModification:0})}readDirectory(v){throw new Error("Method not implemented.")}createDirectory(v){throw new Error("Method not implemented.")}readFile(v){return this.shadowFiles.get(v.toString())||o.BinaryBuffer.fromString("no available").buffer}writeFile(v,m,_){this.shadowFiles.set(v.toString(),m)}delete(v,m){throw new Error("Method not implemented.")}rename(v,m,_){throw new Error("Method not implemented.")}copy(v,m,_){throw new Error("Method not implemented.")}exists(v){throw new Error("Method not implemented.")}access(v,m){throw new Error("Method not implemented.")}};t.ShadowFileSystemProvider=c,t.ShadowFileSystemProvider=c=n.__decorate([(0,r.Injectable)()],c)},81952:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystemWatcher=void 0;const n=e(43718);function r(c,p){return c.filter(v=>!!v.uri.startsWith(p))}class o{constructor(p){this.toDispose=new n.DisposableCollection,this.changeEmitter=new n.Emitter,this.toDispose.push(this.changeEmitter),this.fileServiceClient=p.fileServiceClient,this.watchId=p.watchId,this.uri=p.uri,this.fileServiceClient.onFilesChanged(v=>{const m=r(v,this.uri.toString());m&&m.length>0&&this.changeEmitter.fire(m)})}get onFilesChanged(){return this.changeEmitter.event}dispose(){return Promise.all([this.toDispose.dispose(),this.fileServiceClient.unwatchFileChanges(this.watchId)])}isDisposed(){return this.toDispose.disposed}}t.FileSystemWatcher=o},91813:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EXT_LIST_TEXT=t.EXT_LIST_IMAGE=t.EXT_LIST_VIDEO=void 0,t.getFileTypeByExt=e,t.EXT_LIST_VIDEO=new Set(["mp4","webm","mkv","mov","mts","flv","avi","wmv"]),t.EXT_LIST_IMAGE=new Set(["png","gif","jpg","jpeg","svg","bmp","avif","cr2","cr3","dng","flif","heic","icns","jxl","jpm","jpx","nef","raf","rw2","tif","orf","webp","apng"]),t.EXT_LIST_TEXT=new Set(["xml"]);function e(n){let r="text";return n&&(t.EXT_LIST_IMAGE.has(n)?r="image":t.EXT_LIST_VIDEO.has(n)?r="video":t.EXT_LIST_TEXT.has(n)?r="text":r="binary"),r}},79929:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IBrowserFileSystemRegistry=t.IFileServiceClient=void 0;const n=e(43718);t.IFileServiceClient=n.IFileServiceClient,t.IBrowserFileSystemRegistry=Symbol("IBrowserFileSystemRegistry")},49818:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystemError=t.FileOperationError=t.FileSystemProviderError=t.FileSystemProviderErrorCode=t.FileAccess=t.IFileService=t.IShadowFileProvider=t.IDiskFileProvider=t.FileStat=t.FileType=void 0,t.createFileSystemProviderError=_,t.markAsFileSystemProviderError=s,t.containsExtraFileMethod=a,t.notEmpty=h,t.isErrnoException=u,t.handleError=d;const n=e(85608),r=e(43718);var o=e(31036);Object.defineProperty(t,"FileType",{enumerable:!0,get:function(){return o.FileType}}),Object.defineProperty(t,"FileStat",{enumerable:!0,get:function(){return o.FileStat}}),n.__exportStar(e(11854),t),t.IDiskFileProvider=Symbol("IDiskFileProvider"),t.IShadowFileProvider=Symbol("IShadowFileProvider"),t.IFileService=Symbol("IFileService");var c;(function(E){let f;(function(l){l.F_OK=0,l.R_OK=4,l.W_OK=2,l.X_OK=1})(f=E.Constants||(E.Constants={}))})(c||(t.FileAccess=c={}));var p;(function(E){E.FileExists="EntryExists",E.FileNotFound="EntryNotFound",E.FileNotADirectory="EntryNotADirectory",E.FileIsADirectory="EntryIsADirectory",E.FileIsOutOfSync="FileIsOutOfSync",E.FileExceedsMemoryLimit="EntryExceedsMemoryLimit",E.FileTooLarge="EntryTooLarge",E.FileWriteLocked="EntryWriteLocked",E.NoPermissions="NoPermissions",E.Unavailable="Unavailable",E.Unknown="Unknown"})(p||(t.FileSystemProviderErrorCode=p={}));class v extends Error{static declare(f,l){return Object.assign((...b)=>_(l(...b),f),{is:b=>{var y;return(y=b.stack)===null||y===void 0?void 0:y.startsWith(f)}})}constructor(f,l){super(f),this.code=l}is(f){return this.name===f.name}}t.FileSystemProviderError=v;class m extends Error{constructor(f,l,b){super(f),this.fileOperationResult=l,this.options=b}static isFileOperationError(f){return f instanceof Error&&!(0,r.isUndefinedOrNull)(f.fileOperationResult)}}t.FileOperationError=m;function _(E,f){const l=new v(E.toString(),f);return s(l,f),l}function s(E,f){return E.name=f?`${f} (FileSystemError)`:"FileSystemError",E}var g;(function(E){E.FileNotFound=v.declare(p.FileNotFound,(f,l)=>`${l?l+" ":""} '${f}' is not found.`),E.FileExists=v.declare(p.FileExists,(f,l)=>`${l?l+" ":""}'${f}' already exists.`),E.FileNotADirectory=v.declare(p.FileNotADirectory,(f,l)=>`${l?l+" ":""}'${f}' is not a directory.`),E.FileIsADirectory=v.declare(p.FileIsADirectory,(f,l)=>`${l?l+" ":""}'${f}' is a directory.`),E.FileIsOutOfSync=v.declare(p.FileIsOutOfSync,(f,l)=>`${l?l+" ":""}'${f}' is out of sync.`),E.FileExceedsMemoryLimit=v.declare(p.FileExceedsMemoryLimit,(f,l)=>`${l?l+" ":""}'${f}' is exceeds memory limit.`),E.FileTooLarge=v.declare(p.FileTooLarge,(f,l)=>`${l?l+" ":""}'${f}' is too large.`),E.FileWriteLocked=v.declare(p.FileWriteLocked,(f,l)=>`${l?l+" ":""}'${f}' is locked.`),E.FileIsNoPermissions=v.declare(p.NoPermissions,(f,l)=>`${l?l+" ":""}'${f}' is no permissions.`),E.Unavailable=v.declare(p.Unavailable,(f,l)=>`${l?l+" ":""}'${f}' is unavailable.`),E.Unknown=v.declare(p.Unknown,(f,l)=>`${l?l+" ":""}'${f}' is unkonw.`)})(g||(t.FileSystemError=g={}));function a(E,f){return(0,r.hasProperty)(E,f)&&(0,r.isFunction)(E[f])}function h(E){return E!==void 0}function u(E){return E.code!==void 0&&E.errno!==void 0}function d(E){var f,l,b,y,A;if(u(E))switch(E.code){case"EEXIST":throw g.FileExists(r.Uri.file((f=E.path)!==null&&f!==void 0?f:""));case"EPERM":case"EACCESS":throw g.FileIsNoPermissions(r.Uri.file((l=E.path)!==null&&l!==void 0?l:""));case"ENOENT":throw g.FileNotFound(r.Uri.file((b=E.path)!==null&&b!==void 0?b:""));case"ENOTDIR":throw g.FileNotADirectory(r.Uri.file((y=E.path)!==null&&y!==void 0?y:""));case"EISDIR":throw g.FileIsADirectory(r.Uri.file((A=E.path)!==null&&A!==void 0?A:""))}throw E}},42933:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(79929),t),n.__exportStar(e(49818),t),n.__exportStar(e(28217),t),n.__exportStar(e(91813),t),n.__exportStar(e(50295),t)},70671:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiskFileServiceProtocol=void 0;const n=e(26387),r=e(52890),o=e(50295);t.DiskFileServiceProtocol={name:o.DiskFileServicePath,methods:[{method:"readFile",request:[{name:"uri",type:r.UriComponentsProto}],response:{type:n.Type.binary()}}]}},50295:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileExtServicePath=t.FileWatcherServicePath=t.ShadowFileServicePath=t.DiskFileServicePath=t.FileServicePath=void 0,t.FileServicePath="FileService",t.DiskFileServicePath="DiskFileService",t.ShadowFileServicePath="ShadowFileService",t.FileWatcherServicePath="FileWatcherService",t.FileExtServicePath="FileExtServicePath"},28217:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WatcherProcessManagerProxy=t.WatcherServiceProxy=t.WATCHER_INIT_DATA_KEY=t.SUMI_WATCHER_PROCESS_SOCK_KEY=t.INsfw=void 0;const n=e(86058);var r;(function(o){let c;(function(p){p[p.CREATED=0]="CREATED",p[p.DELETED=1]="DELETED",p[p.MODIFIED=2]="MODIFIED",p[p.RENAMED=3]="RENAMED"})(c=o.actions||(o.actions={}))})(r||(t.INsfw=r={})),t.SUMI_WATCHER_PROCESS_SOCK_KEY="sumi-watcher-process-sock",t.WATCHER_INIT_DATA_KEY="sumi-watcher-init-data",t.WatcherServiceProxy=new n.ProxyIdentifier("WatcherHostServiceImpl"),t.WatcherProcessManagerProxy=new n.ProxyIdentifier("WatcherProcessManagerProxy")},14951:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(42933),t)},57942:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeDialogModel=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(26542),m=e(6250),_=e(2812),s=r.__importDefault(e(89200)),g=e(9018);let a=n=class{static createContainer(u,d){return u.createChild([{token:m.IFileDialogTreeService,useValue:d},{token:m.IFileDialogModel,useClass:n}])}static createModel(u,d){return n.createContainer(u,d).get(m.IFileDialogModel)}constructor(){this.selectedDecoration=new c.Decoration(s.default.mod_selected),this.focusedDecoration=new c.Decoration(s.default.mod_focused),this.loadingDecoration=new c.Decoration(s.default.mod_loading),this.cutDecoration=new c.Decoration(s.default.mod_cut),this._selectedFiles=[],this.disposableCollection=new p.DisposableCollection,this.onDidFocusedFileChangeEmitter=new p.Emitter,this.onDidSelectedFileChangeEmitter=new p.Emitter,this.clearFileSelectedDecoration=()=>{this._selectedFiles.forEach(u=>{this.selectedDecoration.removeTarget(u)}),this._selectedFiles=[],this.onDidSelectedFileChangeEmitter.fire([])},this.activeFileDecoration=(u,d=!0)=>{u!==this.treeModel.root&&(this.preContextMenuFocusedFile&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile),this.preContextMenuFocusedFile=null),u&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(E=>{this.selectedDecoration.removeTarget(E)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(u),this.focusedDecoration.addTarget(u),this._focusedFile=u,this._selectedFiles=[u],this.onDidFocusedFileChangeEmitter.fire(u.uri),this.onDidSelectedFileChangeEmitter.fire([u.uri]),d&&this.treeModel.dispatchChange()))},this.selectFileDecoration=(u,d=!0)=>{u!==this.treeModel.root&&(this.preContextMenuFocusedFile&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile),this.preContextMenuFocusedFile=null),u&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(E=>{this.selectedDecoration.removeTarget(E)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(u),this._selectedFiles=[u],this.onDidSelectedFileChangeEmitter.fire([u.uri]),d&&this.treeModel.dispatchChange()))},this.activeFileFocusedDecoration=(u,d=!1)=>{u!==this.treeModel.root&&(this.focusedFile!==u&&(d?(this.preContextMenuFocusedFile?(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile)):this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.preContextMenuFocusedFile=u):this.focusedFile&&(this.preContextMenuFocusedFile=null,this.focusedDecoration.removeTarget(this.focusedFile)),u&&(this.selectedDecoration.addTarget(u),this.focusedDecoration.addTarget(u),this._focusedFile=u,this._selectedFiles.push(u),this.onDidFocusedFileChangeEmitter.fire(u.uri),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(E=>E.uri)))),this.treeModel.dispatchChange())},this.activeFileSelectedDecoration=u=>{this._selectedFiles.indexOf(u)>-1||(this._selectedFiles.push(u),this.selectedDecoration.addTarget(u),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(d=>d.uri)),this.treeModel.dispatchChange())},this.activeFileDecorationByRange=(u,d)=>{for(this.clearFileSelectedDecoration(),this.preContextMenuFocusedFile=null;u<=d;u++){const E=this.treeModel.root.getTreeNodeAtIndex(u);E&&(this._selectedFiles.push(E),this.selectedDecoration.addTarget(E))}this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(E=>E.uri)),this.treeModel.dispatchChange()},this.enactiveFileDecoration=()=>{this.focusedFile&&(this.focusedDecoration.removeTarget(this.focusedFile),this.onDidFocusedFileChangeEmitter.fire(),this.treeModel.dispatchChange()),this._focusedFile=void 0},this.toggleDirectory=async u=>{u.expanded?this.fileTreeHandle.collapseNode(u):this.fileTreeHandle.expandNode(u)},this.handleTreeBlur=()=>{this.enactiveFileDecoration()},this.handleTreeFocus=()=>{},this.handleItemRangeClick=(u,d)=>{if(!this.focusedFile)this.handleItemClick(u,d);else if(this.focusedFile&&this.focusedFile!==u){const E=this.treeModel.root.getIndexAtTreeNode(u),f=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);f>E?this.activeFileDecorationByRange(E,f):f<E&&this.activeFileDecorationByRange(f,E)}},this.handleItemToggleClick=(u,d)=>{d!==c.TreeNodeType.CompositeTreeNode&&d!==c.TreeNodeType.TreeNode||(this.selectedFiles.indexOf(u)>-1?this.focusedFile===u?this.enactiveFileDecoration():this.activeFileFocusedDecoration(u):this.activeFileSelectedDecoration(u))},this.handleItemClick=(u,d)=>{this.clickTimes++,(d===c.TreeNodeType.CompositeTreeNode||d===c.TreeNodeType.TreeNode)&&this.activeFileDecoration(u),d===c.TreeNodeType.CompositeTreeNode&&this.corePreferences["workbench.list.openMode"]==="singleClick"&&this.toggleDirectory(u),this.clickTimer&&clearTimeout(this.clickTimer),this.clickTimer=setTimeout(()=>{this.clickTimes>1&&d!==c.TreeNodeType.TreeNode&&this.corePreferences["workbench.list.openMode"]==="doubleClick"&&this.toggleDirectory(u),this.clickTimes=0},200)},this.getDirectoryList=()=>this.fileTreeDialogService.getDirectoryList(),this._whenReady=this.initTreeModel()}get onDidFocusedFileChange(){return this.onDidFocusedFileChangeEmitter.event}get onDidSelectedFileChange(){return this.onDidSelectedFileChangeEmitter.event}get fileTreeHandle(){return this._fileTreeHandle}get decorations(){return this._decorations}get treeModel(){return this._treeModel}get whenReady(){return this._whenReady}get focusedFile(){return this._focusedFile}get selectedFiles(){return this._selectedFiles}async initTreeModel(){const u=(await this.fileTreeDialogService.resolveChildren())[0];this._treeModel=this.injector.get(_.FileTreeModel,[u]),this.initDecorations(u),this.disposableCollection.push(this._decorations),this.disposableCollection.push(this.labelService.onDidChange(()=>{this.treeModel.dispatchChange()})),this.disposableCollection.push(this.treeModel.root.watcher.on(c.TreeNodeEvent.WillResolveChildren,d=>{this.loadingDecoration.addTarget(d)})),this.disposableCollection.push(this.treeModel.root.watcher.on(c.TreeNodeEvent.DidResolveChildren,d=>{this.loadingDecoration.removeTarget(d)}))}async updateTreeModel(u){const d=await this.fileTreeDialogService.resolveRoot(u);if(d&&d.length>0){const E=d[0];this._treeModel=this.injector.get(_.FileTreeModel,[E]),this.clearFileSelectedDecoration(),this.initDecorations(E)}}initDecorations(u){this._decorations&&this._decorations.dispose(),this._decorations=new c.DecorationsManager(u),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.cutDecoration),this._decorations.addDecoration(this.loadingDecoration)}handleTreeHandler(u){this._fileTreeHandle=u}dispose(){this.disposableCollection.dispose()}};t.FileTreeDialogModel=a,a.FILE_TREE_SNAPSHOT_KEY="FILE_TREE_SNAPSHOT",a.DEFAULT_LOCATION_FLUSH_DELAY=500,r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],a.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(m.IFileDialogTreeService),r.__metadata("design:type",g.FileTreeDialogService)],a.prototype,"fileTreeDialogService",void 0),r.__decorate([(0,o.Autowired)(v.LabelService),r.__metadata("design:type",v.LabelService)],a.prototype,"labelService",void 0),r.__decorate([(0,o.Autowired)(p.CorePreferences),r.__metadata("design:type",Object)],a.prototype,"corePreferences",void 0),t.FileTreeDialogModel=a=n=r.__decorate([(0,o.Injectable)(),r.__metadata("design:paramtypes",[])],a)},69748:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FILE_TREE_BADGE_LIMIT=t.FILE_TREE_NODE_HEIGHT=t.FileTreeDialogNode=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=e(97267),p=e(41869),v=e(69959),m=n.__importDefault(e(89200)),_=({item:s,onClick:g,itemType:a,labelService:h,leftPadding:u=8,onTwistierClick:d,decorations:E,defaultLeftPadding:f=8,template:l})=>{const b=a===c.TreeNodeType.RenamePrompt,y=a===c.TreeNodeType.NewPrompt,A=b||y,S=(0,p.useDesignStyles)(m.default.expansion_toggle,"expansion_toggle"),w=(0,p.useDesignStyles)(m.default.file_tree_node,"file_tree_node"),T=W=>{(a===c.TreeNodeType.TreeNode||a===c.TreeNodeType.CompositeTreeNode)&&g(W,s,a)},D=W=>{(a===c.TreeNodeType.TreeNode||a===c.TreeNodeType.CompositeTreeNode)&&(d?d(W,s,a):g(W,s,a))},I=a===c.TreeNodeType.CompositeTreeNode;let O;A?y?O=`${f+(s.parent.depth+1||0)*(u||0)}px`:O=`${f+(s.target.depth||0)*(u||0)}px`:O=I?`${f+(s.depth||0)*(u||0)}px`:`${f+(s.depth||0)*(u||0)+8}px`;const M={height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`,paddingLeft:O},R=(W,U)=>{if(E&&E?.classlist.indexOf(m.default.mod_loading)>-1)return o.default.createElement(c.Loading,null);if(A&&W instanceof c.PromptHandle){let Q=!1;if(b?Q=W.target.type===c.TreeNodeType.CompositeTreeNode:Q=W.type===c.TreeNodeType.CompositeTreeNode,Q)return o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,S,(0,p.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:y||!(b&&W.target.type===c.TreeNodeType.CompositeTreeNode&&W.target.expanded)})})}else return o.default.createElement("div",{onClick:U,className:(0,r.default)(m.default.file_tree_node_segment,S,(0,p.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:!W.expanded})})},P=W=>{let U,Q;A&&W instanceof c.PromptHandle?W instanceof c.RenamePromptHandle?(U=W.target.uri.resolve(W.$.value),Q=v.Directory.is(W.target)):(U=W.parent.uri.resolve(W.$.value),Q=W.type===c.TreeNodeType.CompositeTreeNode):(U=W.uri,Q=W.filestat.isDirectory);const V=h.getIcon(U,{isDirectory:Q});return o.default.createElement("div",{className:(0,r.default)(m.default.file_icon,V,{expanded:Q&&W.expanded}),style:{height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`}})},k=W=>l?o.default.createElement(l,null):A&&W instanceof c.PromptHandle?o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_inputbox)},o.default.createElement("div",{className:(0,r.default)("input-box",m.default.file_tree_node_prompt_box)},o.default.createElement(W.ProxiedInput,{wrapperStyle:{height:t.FILE_TREE_NODE_HEIGHT,padding:"0 5px"}}))):o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_displayname)},W.name),F=()=>o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_tail)},L()),L=()=>null,B=W=>{if(I)return R(W,D);if(A)return R(W,()=>{})},j=()=>s.tooltip||s.name;return o.default.createElement("div",{key:s.id,onClick:T,title:j(),className:(0,r.default)(w,E?E.classlist:null),style:M,draggable:a===c.TreeNodeType.TreeNode||a===c.TreeNodeType.CompositeTreeNode},o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_content)},B(s),P(s),o.default.createElement("div",{className:A?m.default.file_tree_node_prompt_wrap:m.default.file_tree_node_overflow_wrap},k(s)),F()))};t.FileTreeDialogNode=_,t.FILE_TREE_NODE_HEIGHT=22,t.FILE_TREE_BADGE_LIMIT=99},68195:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileDialogContextKey=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(66e3);let p=class{initScopedContext(m){this._contextKeyService=this.globalContextKeyService.createScoped(m),this.fileDialogViewVisibleContext=c.FileDialogViewVisibleContext.bind(this._contextKeyService)}get service(){return this._contextKeyService}};t.FileDialogContextKey=p,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],p.prototype,"globalContextKeyService",void 0),t.FileDialogContextKey=p=n.__decorate([(0,r.Injectable)()],p)},9018:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeDialogService=void 0;const n=e(85608),r=e(76003),o=e(97267),c=e(41869),p=e(26542),v=e(54414),m=e(14951),_=e(72665),s=e(51500),g=e(6250),a=e(57781),h=e(97738),u=e(68195);let d=class extends o.Tree{constructor(f){super(),this._whenReady=this.resolveWorkspaceRoot(f)}get whenReady(){return this._whenReady}async resolveWorkspaceRoot(f){if(f){const l=new c.URI(f).withScheme(c.Schemes.file),b=await this.fileTreeAPI.resolveFileStat(l);b&&(this.workspaceRoot=b)}}async resolveChildren(f){if(f){if(f.uri){const{children:l}=await this.fileTreeAPI.resolveChildren(this,f.uri.toString(),f);return l}}else{this.workspaceRoot||(this.workspaceRoot=(await this.workspaceService.roots)[0]);const{children:l}=await this.fileTreeAPI.resolveChildren(this,this.workspaceRoot);return this.root=l[0],l}return[]}async resolveRoot(f){let l;/^file:\/\//.test(f)&&(l=new c.URI(f)),l=c.URI.file(f);const b=await this.fileTreeAPI.resolveFileStat(l);if(b){const{children:y}=await this.fileTreeAPI.resolveChildren(this,b);return this.root=y[0],y}}getDirectoryList(){const f=[];if(!this.root)return f;let l=new c.URI(this.workspaceRoot.uri);if(l&&l.parent)for(;l.parent;){const b=l.codeUri.fsPath;if(f.indexOf(b)>=0)break;f.push(b),l=l.parent}else f.push(l.codeUri.fsPath.toString());return f}sortComparator(f,l){return f.constructor===l.constructor?f.name.startsWith(".")&&!l.name.startsWith(".")?1:!f.name.startsWith(".")&&l.name.startsWith(".")?-1:f.name.localeCompare(l.name,"kn",{numeric:!0}):f.type===o.TreeNodeType.CompositeTreeNode?-1:l.type===o.TreeNodeType.CompositeTreeNode?1:0}initContextKey(f){f&&this.fileDialogContextKey.initScopedContext(f)}get contextKey(){return this.fileDialogContextKey}async saveAs(f){const{oldFilePath:l,newFilePath:b}=f;if(!l||!b)throw new Error("oldFilePath and newFilePath are required");await this.createFile(f);try{const y=c.URI.file(f.newFilePath),A={preview:!1,focus:!0,replace:!0,forceClose:!0,disableNavigate:!1};await this.workbenchEditorService.open(y,A),await this.fileTreeModelService.clearFileSelectedDecoration();const S=this.fileTreeService.getNodeByPathOrUri(y);S&&await this.fileTreeModelService.activeFileDecoration(S)}catch(y){throw new Error(`Failed to open saveAs file: ${y.message}`)}}async createFile(f){try{const{oldFilePath:l,newFilePath:b}=f;if(!await this.fileServiceClient.getFileStat(l))throw new Error(`Source file not found: ${l}`);const{content:A}=await this.fileServiceClient.readFile(l);await this.fileServiceClient.createFile(b,{content:A.toString(),encoding:"utf8",overwrite:!0})}catch(l){throw new Error(`Failed to create file: ${l.message}`)}}renderCustomMsg(){return null}async getDefaultFilePath(f,l){return l}dispose(){super.dispose()}};t.FileTreeDialogService=d,n.__decorate([(0,r.Autowired)(g.IFileTreeAPI),n.__metadata("design:type",Object)],d.prototype,"fileTreeAPI",void 0),n.__decorate([(0,r.Autowired)(s.IWorkspaceService),n.__metadata("design:type",Object)],d.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(p.LabelService),n.__metadata("design:type",p.LabelService)],d.prototype,"labelService",void 0),n.__decorate([(0,r.Autowired)(u.FileDialogContextKey),n.__metadata("design:type",u.FileDialogContextKey)],d.prototype,"fileDialogContextKey",void 0),n.__decorate([(0,r.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],d.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(v.WorkbenchEditorService),n.__metadata("design:type",v.WorkbenchEditorService)],d.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(_.IDialogService),n.__metadata("design:type",Object)],d.prototype,"dialogService",void 0),n.__decorate([(0,r.Autowired)(h.FileTreeModelService),n.__metadata("design:type",h.FileTreeModelService)],d.prototype,"fileTreeModelService",void 0),n.__decorate([(0,r.Autowired)(g.IFileTreeService),n.__metadata("design:type",a.FileTreeService)],d.prototype,"fileTreeService",void 0),t.FileTreeDialogService=d=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[String])],d)},51888:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileDialog=t.FILE_TREE_DIALOG_HEIGHT=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),c=e(41869),p=e(68974),v=e(72665),m=e(69748),_=n.__importDefault(e(13294));t.FILE_TREE_DIALOG_HEIGHT=22;const s=({options:g,model:a,isOpenDialog:h,fileService:u})=>{const d=(0,c.useInjectable)(v.IDialogService),E=(0,r.useRef)(null),[f,l]=(0,r.useState)(g.defaultFileName||""),[b,y]=(0,r.useState)(!1),[A,S]=(0,r.useState)(""),[w,T]=(0,r.useState)([]),D=(0,r.useRef)(g.defaultFileName||"");(0,r.useEffect)(()=>{var ie;return a&&(y(!1),R(),(ie=u.contextKey.fileDialogViewVisibleContext)===null||ie===void 0||ie.set(!0)),()=>{a.dispose()}},[a]),(0,r.useEffect)(()=>{g.defaultFileName&&(l(g.defaultFileName||""),D.current=g.defaultFileName||"")},[g]),(0,r.useEffect)(()=>{if(b){const ie=a.getDirectoryList();T(ie)}},[b]);const I=(0,r.useCallback)(()=>{const ie=a.selectedFiles.map(oe=>oe.uri.path.toString());if(D.current&&g.showNameInput&&(ie?.length===1||g.defaultUri)){const oe=ie?.length===1?ie[0]:g.defaultUri.path.toString();g?.saveAs&&u.saveAs({oldFilePath:c.path.join(oe,g?.defaultFileName||""),newFilePath:c.path.join(oe,D.current)}),d.hide([c.path.join(oe,D.current)])}else ie.length>0?d.hide(ie):A?d.hide([A]):g.defaultUri?d.hide([g.defaultUri.path.toString()]):a.treeModel&&a.treeModel.root?d.hide([a.treeModel.root.uri.path.toString()]):d.hide([]);y(!1),u.contextKey.fileDialogViewVisibleContext.set(!1)},[b,d,a,g,A]),O=async ie=>{let oe=ie.treeModel.root.uri.codeUri.fsPath;return u.getDefaultFilePath&&(oe=await u.getDefaultFilePath(ie,oe)),oe},M=(0,r.useCallback)(()=>{y(!1),d.hide(),u.contextKey.fileDialogViewVisibleContext.set(!1)},[b,d]),R=(0,r.useCallback)(async()=>{await a.whenReady,await a.treeModel.ensureReady;const ie=await O(a);S(ie),y(!0)},[a,A,b]),P=!h,k=(0,r.useCallback)(ie=>{a.handleTreeHandler({...ie,getModel:()=>a.treeModel})},[a]),F=(0,r.useCallback)((ie,oe)=>{ie.stopPropagation();const{toggleDirectory:le}=a;le(oe)},[a]),L=(0,r.useCallback)(ie=>B(ie)?!1:ie.shiftKey,[]),B=(0,r.useCallback)(ie=>{const{metaKey:oe,ctrlKey:le}=ie;return c.isMacintosh&&oe||le},[]),j=(0,r.useCallback)((ie,oe,le)=>{var pe;ie.stopPropagation();const{handleItemClick:q,handleItemToggleClick:Ee,handleItemRangeClick:_e}=a;if(!oe)return;const ne=L(event),ge=B(event);if(ne&&!P&&g.canSelectMany)_e(oe,le);else if(ge&&!P&&g.canSelectMany)Ee(oe,le);else if(P)le===o.TreeNodeType.CompositeTreeNode&&q(oe,le);else if(g.canSelectFiles&&le===o.TreeNodeType.TreeNode){const we=new Set(Object.values((pe=g.filters)!==null&&pe!==void 0?pe:{}).flat().map(Pe=>`.${Pe}`));if(we.size>0){const Pe=c.URI.parse(oe.filestat.uri).path.ext;we.has(Pe)&&q(oe,le)}else q(oe,le)}else g.canSelectFolders&&le===o.TreeNodeType.CompositeTreeNode&&q(oe,le)},[a,P,g]),W=(0,r.useCallback)(async ie=>{y(!1),S(ie),await a.updateTreeModel(ie),y(!0)},[a,b,A]),U=(0,r.useCallback)(async ie=>{y(!1),S(ie),await a.updateTreeModel(ie),y(!0)},[a,b,A,w]),Q=(0,r.useCallback)(()=>u.renderCustomMsg?u.renderCustomMsg():null,[u.renderCustomMsg]),V=(0,r.useCallback)(ie=>r.default.createElement(m.FileTreeDialogNode,{item:ie.item,itemType:ie.itemType,labelService:a.labelService,decorations:a.decorations.getDecorations(ie.item),onClick:j,onTwistierClick:F,defaultLeftPadding:8,leftPadding:8}),[a.treeModel]),$=(0,r.useCallback)(()=>{if(b){if(a.treeModel)return r.default.createElement(o.RecycleTree,{height:300,itemHeight:t.FILE_TREE_DIALOG_HEIGHT,onReady:k,model:a.treeModel},V)}else return r.default.createElement(p.Progress,{loading:!0})},[b,a]),Y=(0,r.useMemo)(()=>u.showFilePathSearch!==!1,[u.showFilePathSearch]),H=(0,r.useCallback)(()=>{if(w.length>0)return r.default.createElement(o.Select,{onChange:W,onSearchChange:U,className:_.default.select_control,size:"large",searchPlaceholder:A,value:A,showSearch:Y},w.map((ie,oe)=>r.default.createElement(o.Option,{value:ie,key:`${oe} - ${ie}`},ie)))},[w,A]),z=(0,r.useCallback)(ie=>{const{key:oe}=c.KeyCode.createKeyCode(ie),le=ie.shiftKey||ie.metaKey||ie.altKey||ie.ctrlKey;oe&&c.Key.ENTER.keyCode===oe.keyCode&&!le&&I()},[I]);(0,r.useEffect)(()=>{var ie;return E.current&&(u.initContextKey(E.current),u.contextKey.fileDialogViewVisibleContext.set(!0),(ie=E.current)===null||ie===void 0||ie.addEventListener("keyup",z)),()=>{var oe;(oe=E.current)===null||oe===void 0||oe.removeEventListener("keyup",z)}},[]);const K=(0,r.useMemo)(()=>r.default.createElement(r.default.Fragment,null,Q(),r.default.createElement("div",{className:_.default.file_dialog_directory},H()),r.default.createElement("div",{className:_.default.file_dialog_content},$())),[H,$]),Z=(0,r.useMemo)(()=>r.default.createElement("div",{className:_.default.file_dialog_buttons},r.default.createElement(o.Button,{onClick:M,type:"ghost",className:_.default.button},(0,c.localize)("dialog.file.close")),r.default.createElement(o.Button,{onClick:I,type:"primary",className:_.default.button,disabled:P&&g.showNameInput&&f.length===0},h&&g.openLabel||(0,c.localize)("dialog.file.ok"))),[M,I,P,h,f,g]),X=(0,r.useCallback)(ie=>{l(ie.target.value),D.current=ie.target.value},[f]);return r.default.createElement("div",{className:_.default.file_dialog_wrapper,ref:E},r.default.createElement("div",{className:_.default.file_dialog_directory_title},h?g.title||(0,c.localize)("dialog.file.openLabel"):g.saveLabel||(0,c.localize)("dialog.file.saveLabel")),K,!h&&g.showNameInput&&r.default.createElement("div",{className:_.default.file_dialog_file_container},r.default.createElement("span",{className:_.default.file_dialog_file_name},(0,c.localize)("dialog.file.name"),": "),r.default.createElement(o.Input,{size:"small",value:f,autoFocus:!0,selection:{start:0,end:f.indexOf(".")||f.length},onChange:X})),Z)};t.FileDialog=s},89508:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowDialogServiceImpl=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(76003),c=e(41869),p=e(37406),v=e(14951),m=e(72665),_=e(57942),s=n.__importDefault(e(13294)),g=e(9018),a=e(51888);let h=class{constructor(){this.idx=1,this._whenReady=this.init()}async init(){this.recentGlobalStorage=await this.storageProvider(c.STORAGE_NAMESPACE.GLOBAL_RECENT_DATA);const d=await this.recentGlobalStorage.get("RECENT_DIALOG_DEFAULT_URI");if(d)this._defaultUri=new c.URI(d);else{const E=await this.fileServiceClient.getCurrentUserHome();this._defaultUri=new c.URI(E.uri)}}get defaultUri(){return this._defaultUri}get whenReady(){return this._whenReady}async updateRecentDefaultUri(d){this.recentGlobalStorage.set("RECENT_DIALOG_DEFAULT_URI",d.toString()),this._defaultUri=d}async showOpenDialog(d={}){this.dialogService.reset(),await this.whenReady;const E={canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1};if(this.appConfig.isElectronRenderer&&!this.appConfig.isRemote){const f=this.injector.get(p.IElectronMainUIService),l=[];d.canSelectFiles&&l.push("openFile"),d.canSelectFolders&&l.push("openDirectory"),d.canSelectMany&&l.push("multiSelections"),c.isMacintosh&&l.push("treatPackageAsDirectory","createDirectory");const b=d.defaultUri||this.defaultUri,y=await f.showOpenDialog(c.electronEnv.currentWindowId,{defaultPath:b.codeUri.fsPath,title:d.title,buttonLabel:d.openLabel,properties:l});if(y&&y.length>0){const A=y.map(S=>c.URI.file(S));return this.updateRecentDefaultUri(A[0].parent),A}else return}else{d.defaultUri||(d.defaultUri=this.defaultUri);let f;d.defaultUri?f=this.injector.get(g.FileTreeDialogService,[d.defaultUri.toString()]):f=this.injector.get(g.FileTreeDialogService),await f.whenReady;const l=_.FileTreeDialogModel.createModel(this.injector,f),b=await this.dialogService.open({message:r.default.createElement(a.FileDialog,{key:this.idx++,fileService:f,model:l,options:{...E,...d},isOpenDialog:!0}),type:c.MessageType.Empty,buttons:[],closable:!0,props:{className:s.default.file_dialog_wrapper}});if(this.dialogService.reset(),b&&b.length>0){const y=b.map(A=>c.URI.file(A));return this.updateRecentDefaultUri(y[0].parent),y}else return}}async showSaveDialog(d={}){if(await this.whenReady,this.appConfig.isElectronRenderer&&!this.appConfig.isRemote){const E=d.defaultUri||this.defaultUri,l=await this.injector.get(p.IElectronMainUIService).showSaveDialog(c.electronEnv.currentWindowId,{defaultPath:E.resolve(d.defaultFileName||"").codeUri.fsPath,title:d.saveLabel,message:d.saveLabel});if(l){const b=c.URI.file(l);return this.updateRecentDefaultUri(b.parent),b}else return}else{d.defaultUri||(d.defaultUri=this.defaultUri);let E;d.defaultUri?E=this.injector.get(g.FileTreeDialogService,[d.defaultUri.toString()]):E=this.injector.get(g.FileTreeDialogService),await E.whenReady;const f=_.FileTreeDialogModel.createModel(this.injector,E),l=await this.dialogService.open({message:r.default.createElement(a.FileDialog,{key:this.idx++,fileService:E,model:f,options:d,isOpenDialog:!1}),type:c.MessageType.Empty,buttons:[],closable:!0,props:{className:s.default.file_dialog_wrapper}});if(this.dialogService.reset(),l&&l.length>0){const b=c.URI.file(l[0]);return this.updateRecentDefaultUri(b.parent),b}else return}}};t.WindowDialogServiceImpl=h,n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],h.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(m.IDialogService),n.__metadata("design:type",Object)],h.prototype,"dialogService",void 0),n.__decorate([(0,o.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],h.prototype,"fileServiceClient",void 0),n.__decorate([(0,o.Autowired)(c.StorageProvider),n.__metadata("design:type",Function)],h.prototype,"storageProvider",void 0),n.__decorate([(0,o.Autowired)(c.AppConfig),n.__metadata("design:type",Object)],h.prototype,"appConfig",void 0),t.WindowDialogServiceImpl=h=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],h)},88014:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileContextKey=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(16413);let p=class{constructor(){this.explorerResourceIsFolder=c.ExplorerResourceIsFolderContext.bind(this.globalContextKeyService),this.explorerViewletVisibleContext=c.ExplorerViewletVisibleContext.bind(this.globalContextKeyService)}initScopedContext(m){this._contextKeyService=this.globalContextKeyService.createScoped(m),this.explorerFocused=c.ExplorerFocusedContext.bind(this._contextKeyService),this.explorerResourceCut=c.ExplorerResourceCut.bind(this._contextKeyService),this.filesExplorerFocused=c.FilesExplorerFocusedContext.bind(this._contextKeyService),this.filesExplorerInputFocused=c.FilesExplorerInputFocusedContext.bind(this._contextKeyService),this.filesExplorerFilteredContext=c.FilesExplorerFilteredContext.bind(this._contextKeyService),this.explorerCompressedFocusContext=c.ExplorerCompressedFocusContext.bind(this._contextKeyService),this.explorerCompressedFirstFocusContext=c.ExplorerCompressedFirstFocusContext.bind(this._contextKeyService),this.explorerCompressedLastFocusContext=c.ExplorerCompressedLastFocusContext.bind(this._contextKeyService)}get service(){return this._contextKeyService}};t.FileContextKey=p,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],p.prototype,"globalContextKeyService",void 0),t.FileContextKey=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},40439:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(16413),p=e(93899),v=e(68969),m=e(98295),_=e(41893),s=e(54414),g=e(32595),a=e(63067),h=e(58296),u=e(72665),d=e(55121),E=e(51500),f=e(6250),l=e(69959),b=e(56384),y=e(57781),A=e(97738),S=e(4446);let w=class{constructor(){this._disposables=new o.DisposableStore,this.isRendered=!1,this.deleteThrottler=new o.Throttler,this.willDeleteUris=[]}initialize(){this.workspaceService.initFileServiceExclude().then(async()=>{await this.fileTreeService.init(),this.fileTreeModelService.initTreeModel()}),this.progressService.registerProgressIndicator(g.EXPLORER_CONTAINER_ID)}async onStart(){this.viewsRegistry.registerViewWelcomeContent(f.RESOURCE_VIEW_ID,{content:(0,o.formatLocalize)("welcome-view.noFolderHelp",o.FILE_COMMANDS.OPEN_FOLDER.id),group:h.ViewContentGroups.Open,order:1}),this.mainLayoutService.collectViewComponent({id:f.RESOURCE_VIEW_ID,name:this.getWorkspaceTitle(),weight:3,priority:9,collapsed:!1,component:b.FileTree},g.EXPLORER_CONTAINER_ID),this._disposables.add(this.workspaceService.onWorkspaceLocationChanged(()=>{const D=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);D&&D.updateViewTitle(f.RESOURCE_VIEW_ID,this.getWorkspaceTitle())}))}onDidStart(){const D=this.injector.get(S.SymlinkDecorationsProvider,[this.fileTreeService]);this.decorationService.registerDecorationsProvider(D)}onDidRender(){this.isRendered=!0;const D=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);D&&(this.fileTreeModelService.whenReady.then(()=>{this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(D.isActivated())}),D.onActivate(()=>{this.fileTreeModelService.performLocationOnHandleShow(),this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(!0)}),D.onInActivate(()=>{this.fileTreeModelService.handleTreeBlur(),this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(!1)}))}getWorkspaceTitle(){let D=(0,o.localize)("file.empty.defaultTitle");const I=this.workspaceService.workspace;return I&&(D=new o.URI(I.uri).displayName,!I.isDirectory&&D.endsWith(`.${this.workspaceService.workspaceSuffixName}`)&&(D=D.slice(0,D.lastIndexOf(".")),D===E.UNTITLED_WORKSPACE))?(0,o.localize)("file.workspace.defaultTip"):D}revealFile(D){if(D)if(this.isRendered){const I=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);!I||!I.isVisible||I.isCollapsed(f.RESOURCE_VIEW_ID)?this.fileTreeModelService.locationOnShow(D):this.fileTreeModelService.location(D)}else this.fileTreeModelService.locationOnShow(D)}registerMenus(D){D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.NEW_FILE.id,label:(0,o.localize)("file.new")},order:1,group:"0_new"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.NEW_FOLDER.id,label:(0,o.localize)("file.folder.new")},order:2,group:"0_new"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,label:(0,o.localize)("workspace.addFolderToWorkspace")},order:1,group:"0_workspace",when:"config.workspace.supportMultiRootWorkspace"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.WORKSPACE_COMMANDS.REMOVE_WORKSPACE_FOLDER.id,label:(0,o.localize)("workspace.removeFolderFromWorkspace")},order:1,group:"0_workspace",when:"config.workspace.supportMultiRootWorkspace"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_RESOURCES.id,label:(0,o.localize)("file.open")},order:1,group:"1_open"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TO_THE_SIDE.id,label:(0,o.localize)("file.open.side")},order:2,group:"1_open"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TYPE_WITH.id,label:(0,o.localize)("file.open.type")},order:3,group:"1_open"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TERMINAL_WITH_PATH.id,label:(0,o.localize)("file.filetree.openTerminalWithPath")},when:"workbench.panel.terminal",order:4,group:"1_open"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.SEARCH_ON_FOLDER.id,label:(0,o.localize)("file.search.folder")},order:1,group:"2_search"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.DELETE_FILE.id,label:(0,o.localize)("file.delete")},order:1,group:"7_modification"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.RENAME_FILE.id,label:(0,o.localize)("file.rename")},order:3,group:"7_modification"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COMPARE_SELECTED.id,label:(0,o.localize)("file.compare")},order:2,group:"3_compare"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_FILE.id,label:(0,o.localize)("file.copy.file")},order:1,group:"5_cutcopypaste"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.CUT_FILE.id,label:(0,o.localize)("file.cut.file")},order:2,group:"5_cutcopypaste"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.PASTE_FILE.id,label:(0,o.localize)("file.paste.file")},order:3,group:"5_cutcopypaste"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_PATH.id,label:(0,o.localize)("file.copy.path")},group:"6_copypath"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_RELATIVE_PATH.id,label:(0,o.localize)("file.copy.relativepath")},group:"6_copypath"})}registerCommands(D){const I=()=>{this.fileTreeService.filterMode&&this.fileTreeService.toggleFilterMode()};D.registerCommand(o.FILE_COMMANDS.OPEN_TERMINAL_WITH_PATH,{execute:M=>{let R=M;if(!R)return;const P=this.fileTreeService.getNodeByPathOrUri(R);P&&!P.filestat.isDirectory&&(R=P.uri.parent),this.commandService.executeCommand(o.TERMINAL_COMMANDS.OPEN_WITH_PATH.id,R)}}),D.registerCommand(o.FILE_COMMANDS.SEARCH_ON_FOLDER,{execute:async M=>{var R;let P=M;if(P||(this.fileTreeModelService.focusedFile?P=this.fileTreeModelService.focusedFile.uri:this.fileTreeModelService.selectedFiles.length>0&&(P=(R=this.fileTreeModelService.selectedFiles[0])===null||R===void 0?void 0:R.uri)),!P)return;let k;if(this.fileTreeService.isMultipleWorkspace)for(const F of await this.workspaceService.roots){const L=new o.URI(F.uri);if(L.isEqualOrParent(P)){k=`./${L.relative(P).toString()}`;break}}else if(this.workspaceService.workspace){const F=new o.URI(this.workspaceService.workspace.uri);F.isEqualOrParent(P)&&(k=`./${F.relative(P).toString()}`)}this.commandService.executeCommand(o.SEARCH_COMMANDS.OPEN_SEARCH.id,{includeValue:k+"/"})},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&l.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.LOCATION,{execute:M=>{M?this.revealFile(M):this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0&&this.revealFile(this.fileTreeModelService.selectedFiles[0].uri)}}),D.registerCommand(o.FILE_COMMANDS.LOCATION_WITH_EDITOR,{execute:()=>{var M,R,P;((R=(M=this.workbenchEditorService.currentEditor)===null||M===void 0?void 0:M.currentUri)===null||R===void 0?void 0:R.scheme)===o.Schemes.file&&this.revealFile((P=this.workbenchEditorService.currentEditor)===null||P===void 0?void 0:P.currentUri)}}),D.registerCommand(o.FILE_COMMANDS.COLLAPSE_ALL,{execute:()=>{const M=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);!M||!M.isVisible||this.fileTreeModelService.collapseAll()}}),D.registerCommand(o.FILE_COMMANDS.REFRESH_ALL,{execute:async()=>{const M=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);!M||!M.isVisible||await this.fileTreeService.refresh()}}),D.registerCommand(o.FILE_COMMANDS.DELETE_FILE,{execute:(M,R)=>{if(I(),R?this.willDeleteUris=this.willDeleteUris.concat(R):this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0?this.willDeleteUris=this.willDeleteUris.concat(this.fileTreeModelService.selectedFiles.map(P=>P.uri)):this.fileTreeModelService.focusedFile&&this.willDeleteUris.push(this.fileTreeModelService.focusedFile.uri),this.willDeleteUris.length!==0)return this.deleteThrottler.queue(this.doDelete.bind(this))},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.RENAME_FILE,{execute:M=>{if(I(),!M)if(this.fileTreeModelService.contextMenuFile)M=this.fileTreeModelService.contextMenuFile.uri;else if(this.fileTreeModelService.focusedFile)M=this.fileTreeModelService.focusedFile.uri;else return;this.fileTreeModelService.renamePrompt(M)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.NEW_FILE,{execute:async M=>{var R;if(I(),M)this.fileTreeModelService.newFilePrompt(M);else if(this.fileTreeService.isCompactMode&&this.fileTreeModelService.activeUri)this.fileTreeModelService.newFilePrompt(this.fileTreeModelService.activeUri);else if(this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0)this.fileTreeModelService.newFilePrompt(this.fileTreeModelService.selectedFiles[0].uri);else{let P;this.fileTreeService.isMultipleWorkspace?P=new o.URI((await this.workspaceService.roots)[0].uri):P=new o.URI((R=this.workspaceService.workspace)===null||R===void 0?void 0:R.uri),this.fileTreeModelService.newFilePrompt(P)}}}),D.registerCommand(o.FILE_COMMANDS.NEW_FOLDER,{execute:async M=>{var R;if(I(),M)this.fileTreeModelService.newDirectoryPrompt(M);else if(this.fileTreeService.isCompactMode&&this.fileTreeModelService.activeUri)this.fileTreeModelService.newDirectoryPrompt(this.fileTreeModelService.activeUri);else if(this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0)this.fileTreeModelService.newDirectoryPrompt(this.fileTreeModelService.selectedFiles[0].uri);else{let P;this.fileTreeService.isMultipleWorkspace?P=new o.URI((await this.workspaceService.roots)[0].uri):P=new o.URI((R=this.workspaceService.workspace)===null||R===void 0?void 0:R.uri),this.fileTreeModelService.newDirectoryPrompt(P)}}}),D.registerCommand(o.FILE_COMMANDS.COMPARE_SELECTED,{execute:(M,R)=>{if(R&&R.length){const P=this.workbenchEditorService.currentEditor;P&&P.currentUri&&this.fileTreeService.compare(R[0],P.currentUri)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!l.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.OPEN_RESOURCES,{execute:M=>{this.fileTreeService.openAndFixedFile(M)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!l.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.OPEN_TO_THE_SIDE,{execute:M=>{this.fileTreeService.openToTheSide(M)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!l.Directory.is(this.fileTreeModelService.contextMenuFile)});const O=(M,R)=>{const{availableOpenTypes:P,currentOpenType:k}=this.workbenchEditorService.currentEditorGroup;if(!(P&&M&&k))return{items:[],selectIndex:-1};const F=this.preferenceService.get("workbench.editorAssociations"),L=[],B=(Q,V)=>V.type===s.EditorOpenType.code?Q.type===s.EditorOpenType.code:V.type===s.EditorOpenType.component&&Q.type===s.EditorOpenType.component?Q.componentId===V.componentId:!1,j=(Q,V)=>(Q?Q+=(0,o.localize)("file.open.type.detail.and")+V:Q=V,Q);let W,U;if(F){const Q=Object.keys(F).find(V=>(0,o.match)(V,M.path.toString().toLowerCase())||(0,o.match)(V,M.path.base.toLowerCase()));W=Q&&F[Q]}return P.forEach((Q,V)=>{var $;const Y={label:Q.title||Q.componentId||Q.type,detail:Q.title,run:H=>R(H,Q)};B(k,Q)&&(Y.description=j(Y.description,(0,o.localize)("file.open.type.detail.active")),U=V),W&&(!(($=Q.componentId)===null||$===void 0)&&$.endsWith(W))&&(Y.description=j(Y.description,(0,o.localize)("file.open.type.detail.default"))),L.push(new o.QuickOpenItem(Y))}),{items:L,selectIndex:U}};D.registerCommand(o.FILE_COMMANDS.OPEN_TYPE_WITH,{execute:M=>{const R=(L,B)=>{var j,W;return L===o.Mode.OPEN?((j=this.workbenchEditorService.currentEditorGroup)===null||j===void 0||j.changeOpenType((W=B.componentId)!==null&&W!==void 0?W:B.type),!0):!1},{items:P,selectIndex:k}=O(M,R);if(P.length===0||typeof k>"u")return;const F=L=>{this.quickOpenService.open({onType:(B,j)=>j(L)},{fuzzyMatchLabel:!0,ignoreFocusOut:!1,placeholder:(0,o.formatLocalize)("file.open.type.placeholder",M.path.base),selectIndex:()=>k})};P.push(new o.QuickOpenItem({label:(0,o.formatLocalize)("file.open.type.preference.default",`*${M.path.ext}`),showBorder:!0,run:L=>{if(L===o.Mode.OPEN){const B=(U,Q)=>{var V,$,Y;if(U===o.Mode.OPEN){const H="workbench.editorAssociations",z=this.preferenceService.resolve(H).scope,K=this.preferenceService.get(H);return this.preferenceService.set(H,{...K||{},[`*${M.path.ext}`]:(V=Q.componentId)!==null&&V!==void 0?V:Q.type},z),($=this.workbenchEditorService.currentEditorGroup)===null||$===void 0||$.changeOpenType((Y=Q.componentId)!==null&&Y!==void 0?Y:Q.type),!0}return!1},{items:j,selectIndex:W}=O(M,B);if(j.length===0||typeof W>"u")return!0;F(j)}return!1}})),F(P)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!l.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.COPY_PATH,{execute:async M=>{if(!M)return;let P=M.path.toString();if(M.scheme===s.DIFF_SCHEME){const F=M.getParsedQuery();P=new o.URI(F.modified).path.toString()}let k=decodeURIComponent(P);await this.appService.backendOS===o.OperatingSystem.Windows&&(k=k.slice(1)),await this.clipboardService.writeText(k)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile}),D.registerCommand(o.FILE_COMMANDS.COPY_RELATIVE_PATH,{execute:async M=>{if(!M)return;if(M.scheme===s.DIFF_SCHEME){const k=M.getParsedQuery();M=new o.URI(k.modified).withScheme("file")}const R=this.fileTreeService.getNodeByPathOrUri(M);if(R&&R.filestat.isInSymbolicDirectory)return await this.clipboardService.writeText(R.path.split(d.Path.separator).slice(2).join(d.Path.separator));let P;if(this.fileTreeService.isMultipleWorkspace)for(const k of await this.workspaceService.roots){if(P=new o.URI(k.uri),P.isEqual(M))return await this.clipboardService.writeText("./");if(P.isEqualOrParent(M))return await this.clipboardService.writeText(decodeURIComponent(P.relative(M).toString()))}else if(this.workspaceService.workspace)return P=new o.URI(this.workspaceService.workspace.uri),P.isEqual(M)?await this.clipboardService.writeText("./"):await this.clipboardService.writeText(decodeURIComponent(P.relative(M).toString()))},isVisible:()=>!!this.fileTreeModelService.contextMenuFile}),D.registerCommand(o.FILE_COMMANDS.COPY_FILE,{execute:(M,R)=>{if(R&&R.length)this.fileTreeModelService.copyFile(R);else{const P=this.fileTreeModelService.selectedFiles.map(k=>k.uri);P&&P.length&&this.fileTreeModelService.copyFile(P)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)||!!this.fileTreeModelService.focusedFile&&!this.fileTreeModelService.focusedFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.SELECT_CURRENT_NODE,{execute:(M,R)=>{if(R&&R.length)this.fileTreeModelService.selectChildNode(R);else{const P=this.fileTreeModelService.selectedFiles.map(k=>k.uri);P&&P.length&&this.fileTreeModelService.selectChildNode(P)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)||!!this.fileTreeModelService.focusedFile&&!this.fileTreeModelService.focusedFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.CUT_FILE,{execute:(M,R)=>{if(R&&R.length)this.fileTreeModelService.cutFile(R);else{const P=this.fileTreeModelService.selectedFiles.map(k=>k.uri);P&&P.length&&this.fileTreeModelService.cutFile(P)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)||!!this.fileTreeModelService.focusedFile&&!this.fileTreeModelService.focusedFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.PASTE_FILE,{execute:M=>{if(I(),M)this.fileTreeModelService.pasteFile(M);else if(this.fileTreeModelService.focusedFile){let R;this.fileTreeModelService.activeUri?R=this.fileTreeModelService.activeUri:R=this.fileTreeModelService.focusedFile.uri,this.fileTreeModelService.pasteFile(R)}},isEnabled:()=>this.fileTreeModelService.pasteStore&&this.fileTreeModelService.pasteStore.type!==f.PasteTypes.NONE||this.appConfig.isElectronRenderer}),D.registerCommand(o.FILE_COMMANDS.VSCODE_OPEN_FOLDER,{execute:(M,R)=>{const P=this.injector.get(o.IWindowService),k={newWindow:!0};return typeof R=="boolean"?k.newWindow=R:k.newWindow=typeof R?.forceNewWindow=="boolean"?R.forceNewWindow:!0,M?P.openWorkspace(M,k):this.commandService.executeCommand(o.FILE_COMMANDS.OPEN_FOLDER.id,k)},isVisible:()=>{const M=this.preferenceService.get("application.supportsOpenFolder");return M??!1}}),D.registerCommand(o.FILE_COMMANDS.OPEN_FOLDER,{execute:M=>{const R=this.injector.get(o.IWindowService);this.appConfig.isElectronRenderer?this.injector.get(o.IElectronNativeDialogService).showOpenDialog({title:(0,o.localize)("workspace.openDirectory"),properties:["openDirectory"]}).then(k=>{k&&k.length>0&&R.openWorkspace(o.URI.file(k[0]),M||{newWindow:!0})}):this.injector.get(u.IWindowDialogService).showOpenDialog({title:(0,o.localize)("workspace.openDirectory"),canSelectFiles:!1,canSelectFolders:!0}).then(k=>{var F;k&&k.length>0&&this.injector.get(E.IWorkspaceService).open(k[0],{preserveWindow:(F=M?.newWindow)!==null&&F!==void 0?F:!1})})},isVisible:()=>{const M=this.preferenceService.get("application.supportsOpenFolder");return M??!1}}),D.registerCommand(o.FILE_COMMANDS.OPEN_WORKSPACE,{execute:M=>{if(!this.preferenceService.get("application.supportsOpenWorkspace"))return;const P=this.injector.get(o.IWindowService);this.appConfig.isElectronRenderer?this.injector.get(o.IElectronNativeDialogService).showOpenDialog({title:(0,o.localize)("workspace.openWorkspace"),properties:["openFile"],filters:[{name:(0,o.localize)("workspace.openWorkspaceTitle"),extensions:[this.workspaceService.workspaceSuffixName]}]}).then(F=>{F&&F.length>0&&P.openWorkspace(o.URI.file(F[0]),M||{newWindow:!0})}):this.injector.get(u.IWindowDialogService).showOpenDialog({title:(0,o.localize)("workspace.openWorkspace"),canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1,filters:{workspace:[this.workspaceService.workspaceSuffixName]}}).then(F=>{var L;F&&F.length>0&&this.injector.get(E.IWorkspaceService).open(F[0],{preserveWindow:(L=M?.newWindow)!==null&&L!==void 0?L:!1})})},isVisible:()=>{const M=this.preferenceService.get("application.supportsOpenWorkspace");return M??!1}}),D.registerCommand(o.FILE_COMMANDS.REVEAL_IN_EXPLORER,{execute:M=>{var R;let P=M instanceof o.URI?M:M?.uri;const k=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);k&&!k.isVisible&&(k.activate(),setTimeout(()=>{k.setCollapsed(f.RESOURCE_VIEW_ID,!1)},200)),!P&&(!((R=this.workbenchEditorService.currentEditor)===null||R===void 0)&&R.currentUri)&&(P=this.workbenchEditorService.currentEditor.currentUri),P&&this.revealFile(o.URI.parse(P.toString()))}}),D.registerCommand(o.FILE_COMMANDS.FOCUS_FILES,{execute:()=>{const M=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);M&&M.activate()}}),D.registerCommand(o.FILE_COMMANDS.OPEN_FILE,{execute:M=>this.windowDialogService.showOpenDialog(M)}),D.registerCommand(o.FILE_COMMANDS.SAVE_FILE,{execute:M=>this.windowDialogService.showSaveDialog(M)}),D.registerCommand(o.FILE_COMMANDS.FILTER_TOGGLE,{execute:()=>this.fileTreeService.toggleFilterMode()}),D.registerCommand(o.FILE_COMMANDS.FILTER_OPEN,{execute:()=>{if(!this.fileTreeService.filterMode)return this.fileTreeService.toggleFilterMode()}}),D.registerCommand(o.FILE_COMMANDS.FILTER_CLOSE,{execute:()=>{this.fileTreeService.filterMode&&this.fileTreeService.toggleFilterMode()}}),D.registerCommand(o.FILE_COMMANDS.NEXT,{execute:()=>{this.fileTreeModelService.moveToNext()}}),D.registerCommand(o.FILE_COMMANDS.PREV,{execute:()=>{this.fileTreeModelService.moveToPrev()}}),D.registerCommand(o.FILE_COMMANDS.COLLAPSE,{execute:()=>{this.fileTreeModelService.collapseCurrentFile()}}),D.registerCommand(o.FILE_COMMANDS.EXPAND,{execute:()=>{this.fileTreeModelService.expandCurrentFile()}}),D.registerCommand(o.FILE_COMMANDS.TOGGLE_OR_OPEN,{execute:()=>{this.fileTreeModelService.toggleOrOpenCurrentFile()}}),D.registerCommand(o.WORKSPACE_COMMANDS.REMOVE_WORKSPACE_FOLDER,{execute:async(M,R)=>{if(I(),!R.length||!this.workspaceService.isMultiRootWorkspaceOpened)return;const P=await this.workspaceService.roots,k=R.filter(F=>P.find(L=>L.uri===F.toString()));k.length>0&&await this.workspaceService.removeRoots(k)},isVisible:()=>this.workspaceService.isMultiRootWorkspaceOpened&&!!this.fileTreeModelService.contextMenuFile&&!!this.workspaceService.tryGetRoots().find(M=>{var R;return M.uri===((R=this.fileTreeModelService.contextMenuFile)===null||R===void 0?void 0:R.uri.toString())})})}registerKeybindings(D){D.registerKeybinding({command:o.FILE_COMMANDS.COPY_FILE.id,keybinding:"ctrlcmd+c",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.PASTE_FILE.id,keybinding:"ctrlcmd+v",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.CUT_FILE.id,keybinding:"ctrlcmd+x",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.SELECT_CURRENT_NODE.id,keybinding:"ctrlcmd+a",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.RENAME_FILE.id,keybinding:"enter",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.DELETE_FILE.id,keybinding:"ctrlcmd+backspace",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.FILTER_OPEN.id,keybinding:"ctrlcmd+f",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.FILTER_CLOSE.id,keybinding:"esc",when:`${c.FilesExplorerFocusedContext.raw} && ${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.NEXT.id,keybinding:"down",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.PREV.id,keybinding:"up",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.EXPAND.id,keybinding:"right",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.COLLAPSE.id,keybinding:"left",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.TOGGLE_OR_OPEN.id,keybinding:"space",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`})}registerToolbarItems(D){D.registerItem({id:o.FILE_COMMANDS.LOCATION_WITH_EDITOR.id,command:o.FILE_COMMANDS.LOCATION_WITH_EDITOR.id,label:(0,o.localize)("file.location"),viewId:f.RESOURCE_VIEW_ID,when:`view == '${f.RESOURCE_VIEW_ID}' && !config.explorer.autoReveal && !${c.FilesExplorerFilteredContext.raw}`,order:0}),D.registerItem({id:o.FILE_COMMANDS.NEW_FILE.id,command:o.FILE_COMMANDS.NEW_FILE.id,label:(0,o.localize)("file.new"),viewId:f.RESOURCE_VIEW_ID,when:`view == '${f.RESOURCE_VIEW_ID}' && !${c.FilesExplorerFilteredContext.raw}`,order:1}),D.registerItem({id:o.FILE_COMMANDS.NEW_FOLDER.id,command:o.FILE_COMMANDS.NEW_FOLDER.id,label:(0,o.localize)("file.folder.new"),viewId:f.RESOURCE_VIEW_ID,when:`view == '${f.RESOURCE_VIEW_ID}' && !${c.FilesExplorerFilteredContext.raw}`,order:2}),D.registerItem({id:o.FILE_COMMANDS.FILTER_TOGGLE.id,command:o.FILE_COMMANDS.FILTER_TOGGLE.id,label:(0,o.localize)("file.filetree.filter"),viewId:f.RESOURCE_VIEW_ID,toggledWhen:`${c.FilesExplorerFilteredContext.raw}`,order:3}),D.registerItem({id:o.FILE_COMMANDS.REFRESH_ALL.id,command:o.FILE_COMMANDS.REFRESH_ALL.id,label:(0,o.localize)("file.refresh"),viewId:f.RESOURCE_VIEW_ID,when:`view == '${f.RESOURCE_VIEW_ID}' && !${c.FilesExplorerFilteredContext.raw}`,order:4}),D.registerItem({id:o.FILE_COMMANDS.COLLAPSE_ALL.id,command:o.FILE_COMMANDS.COLLAPSE_ALL.id,label:(0,o.localize)("file.collapse"),viewId:f.RESOURCE_VIEW_ID,order:5}),D.registerItem({id:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,command:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,label:(0,o.localize)("workspace.addFolderToWorkspace"),viewId:f.RESOURCE_VIEW_ID,order:0,group:"file_explore_workspace",when:"config.workspace.supportMultiRootWorkspace"})}doDelete(){const D=this.willDeleteUris.slice();return this.willDeleteUris=[],this.fileTreeModelService.deleteFileByUris(D)}dispose(){this._disposables.dispose()}};t.FileTreeContribution=w,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],w.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(f.IFileTreeService),n.__metadata("design:type",y.FileTreeService)],w.prototype,"fileTreeService",void 0),n.__decorate([(0,r.Autowired)(a.IMainLayoutService),n.__metadata("design:type",Object)],w.prototype,"mainLayoutService",void 0),n.__decorate([(0,r.Autowired)(v.IProgressService),n.__metadata("design:type",Object)],w.prototype,"progressService",void 0),n.__decorate([(0,r.Autowired)(E.IWorkspaceService),n.__metadata("design:type",Object)],w.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(A.FileTreeModelService),n.__metadata("design:type",A.FileTreeModelService)],w.prototype,"fileTreeModelService",void 0),n.__decorate([(0,r.Autowired)(_.IDecorationsService),n.__metadata("design:type",_.IDecorationsService)],w.prototype,"decorationService",void 0),n.__decorate([(0,r.Autowired)(s.WorkbenchEditorService),n.__metadata("design:type",s.WorkbenchEditorService)],w.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],w.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(u.IWindowDialogService),n.__metadata("design:type",Object)],w.prototype,"windowDialogService",void 0),n.__decorate([(0,r.Autowired)(o.IClipboardService),n.__metadata("design:type",Object)],w.prototype,"clipboardService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],w.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(o.QuickOpenService),n.__metadata("design:type",Object)],w.prototype,"quickOpenService",void 0),n.__decorate([(0,r.Autowired)(a.IViewsRegistry),n.__metadata("design:type",Object)],w.prototype,"viewsRegistry",void 0),n.__decorate([(0,r.Autowired)(o.IApplicationService),n.__metadata("design:type",Object)],w.prototype,"appService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],w.prototype,"appConfig",void 0),t.FileTreeContribution=w=n.__decorate([(0,m.Domain)(p.MenuContribution,o.CommandContribution,o.KeybindingContribution,o.TabBarToolbarContribution,o.ClientAppContribution,a.MainLayoutContribution)],w)},2812:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeModel=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(69959),m=e(93239);let _=n=class extends c.TreeModel{constructor(g){super(),this.flushDispatchChangeDelayer=new p.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this.init(g)}init(g){this.root=g,this.root.watcher.on(c.TreeNodeEvent.BranchDidUpdate,this.doDispatchChange.bind(this)),this.decorationService.onDidChange(this.doDispatchChange.bind(this))}doDispatchChange(){this.flushDispatchChangeDelayer.isTriggered()||this.flushDispatchChangeDelayer.cancel(),this.flushDispatchChangeDelayer.trigger(async()=>{this.dispatchChange()})}};t.FileTreeModel=_,_.DEFAULT_FLUSH_DELAY=100,r.__decorate([(0,o.Autowired)(m.FileTreeDecorationService),r.__metadata("design:type",m.FileTreeDecorationService)],_.prototype,"decorationService",void 0),t.FileTreeModel=_=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[v.Directory])],_)},46377:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FILE_TREE_BADGE_LIMIT=t.FILE_TREE_NODE_HEIGHT=t.FileTreeNode=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=e(97267),p=e(41869),v=e(69959),m=n.__importDefault(e(89200)),{Path:_}=p.path,s=({item:g,onClick:a,onDoubleClick:h,onContextMenu:u,dndService:d,itemType:E,decorationService:f,labelService:l,leftPadding:b=8,onTwistierClick:y,decorations:A,defaultLeftPadding:S=8,template:w,hasFolderIcons:T,hasFileIcons:D,hidesExplorerArrows:I,hasPrompt:O,iconService:M})=>{const[R,P]=o.default.useState(-1),k=E===c.TreeNodeType.RenamePrompt,F=E===c.TreeNodeType.NewPrompt,L=k||F,B=!L&&g.name.indexOf(_.separator)>=0,j=(0,p.useDesignStyles)(m.default.expansion_toggle,"expansion_toggle"),W=(0,p.useDesignStyles)(m.default.file_tree_node,"file_tree_node"),U=L?null:f.getDecoration(g.uri,v.Directory.is(g)),Q=Pe=>{(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&(B&&P(g.name.split(_.separator).length-1),a(Pe,g,E))},V=Pe=>{(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&(B&&P(g.name.split(_.separator).length-1),h(Pe,g,E))},$=Pe=>{(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&(y?y(Pe,g,E):a(Pe,g,E))},Y=o.default.useCallback(Pe=>{Pe.nativeEvent.which!==0&&(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&u(Pe,g,E)},[u,g]),H=o.default.useCallback(Pe=>{const{handleDragStart:Ae}=d;(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&Ae(Pe,g)},[d,g]),z=o.default.useCallback(Pe=>{const{handleDragLeave:Ae}=d;(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&Ae(Pe,g)},[d,g]),K=o.default.useCallback(Pe=>{const{handleDragEnter:Ae}=d;(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&Ae(Pe,g)},[d,g]),Z=o.default.useCallback(Pe=>{const{handleDrop:Ae}=d;(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&Ae(Pe,g)},[d,g]),X=o.default.useCallback(Pe=>{const{handleDragOver:Ae}=d;(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&Ae(Pe,g)},[d,g]);let ie=E===c.TreeNodeType.CompositeTreeNode,oe;L?F?(ie=g.type===c.TreeNodeType.CompositeTreeNode,oe=`${S+(g.parent.depth+1||0)*(b||0)+(ie?0:T?I?0:20:0)}px`):(ie=g.target.type===c.TreeNodeType.CompositeTreeNode,oe=`${S+(g.target.depth||0)*(b||0)+(ie?0:T?I?0:20:0)}px`):oe=`${S+(g.depth||0)*(b||0)+(ie?0:T?I?0:20:0)}px`;const le={color:U?U.color:"",height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`,paddingLeft:oe,opacity:O&&!L?".6":"1"},pe=(Pe,Ae)=>{if(A&&A?.classlist.indexOf(m.default.mod_loading)>-1)return o.default.createElement(c.Loading,null);if(L&&Pe instanceof c.PromptHandle){let Te=!1;if(k?Te=Pe.target.type===c.TreeNodeType.CompositeTreeNode:Te=Pe.type===c.TreeNodeType.CompositeTreeNode,Te)return o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,j,(0,p.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:F||!(k&&Pe.target.type===c.TreeNodeType.CompositeTreeNode&&Pe.target.expanded)})})}else return o.default.createElement("div",{onClick:Ae,className:(0,r.default)(m.default.file_tree_node_segment,j,(0,p.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:!Pe.expanded})})},q=Pe=>{let Ae,Te;L&&Pe instanceof c.PromptHandle?Pe instanceof c.RenamePromptHandle?(Ae=Pe.target.uri.resolve(Pe.$.value),Te=v.Directory.is(Pe.target)):(Ae=Pe.parent.uri.resolve(Pe.$.value),Te=Pe.type===c.TreeNodeType.CompositeTreeNode):(Ae=Pe.uri,Te=Pe.filestat.isDirectory);const be=l.getIcon(Ae,{isDirectory:Te,isOpenedDirectory:Te&&Pe.expanded});return Te&&!T||!Te&&!D?null:o.default.createElement("div",{className:(0,r.default)(m.default.file_icon,be,{expanded:Te&&Pe.expanded}),style:{height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`}})},Ee=Pe=>{if(w)return o.default.createElement(w,null);if(L&&Pe instanceof c.PromptHandle)return o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_inputbox)},o.default.createElement("div",{className:(0,r.default)("input-box",m.default.file_tree_node_prompt_box)},o.default.createElement(Pe.ProxiedInput,{wrapperStyle:{height:t.FILE_TREE_NODE_HEIGHT,padding:"0 5px"}})));if(B){const Ae=Pe.displayName.split(_.separator),Te=Ae.map((be,me)=>{const xe=Ae.slice(0,me+1).join(_.separator),Re=Fe=>{Fe.stopPropagation(),P(me);const Ge=g.parent.uri.resolve(Ae.slice(0,me+1).join(_.separator));a(Fe,g,E,Ge)},Ne=Fe=>{Fe.stopPropagation(),P(me);const Ge=g.parent.uri.resolve(Ae.slice(0,me+1).join(_.separator));u(Fe,g,E,Ge)},fe=Fe=>{Fe.stopPropagation(),Fe.preventDefault(),R!==me&&(P(me),d.handleDragOver(Fe,g))},re=Fe=>{Fe.stopPropagation(),Fe.preventDefault(),P(-1)},he=Fe=>{Fe.stopPropagation(),R!==me&&P(me);const Ge=g.parent.uri.resolve(Ae.slice(0,me+1).join(_.separator));d.handleDragStart(Fe,g,Ge)},Oe=Fe=>{const Ge=g.parent.uri.resolve(Ae.slice(0,me+1).join(_.separator));d.handleDrop(Fe,g,Ge)},De=(0,r.default)(R===me&&m.default.active,m.default.compact_name);return o.default.createElement("span",{key:xe},o.default.createElement("a",{className:De,draggable:!0,onContextMenu:Ne,onDragStart:he,onDragOver:fe,onDragLeave:re,onDrop:Oe,onClick:Re},be),me!==Ae.length-1?o.default.createElement("span",{className:m.default.compact_name_separator},_.separator):null)});return o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_displayname)},Te)}return o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_displayname)},l.getName(Pe.uri)||Pe.displayName)},_e=()=>o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_tail)},ne()),ne=()=>U?o.default.createElement("div",{className:m.default.file_tree_node_status},(0,p.transformLabelWithCodicon)(U.badge.slice(),{color:"inherit"},M.fromString.bind(M))):null,ge=Pe=>{if(I)return null;if(ie)return pe(Pe,$);if(L)return pe(Pe,()=>{})},we=()=>{let Pe=g.tooltip;return U&&U.badge&&(Pe+=` \u2022 ${U.tooltip}`),Pe};return o.default.createElement("div",{key:g.id,onClick:Q,onDoubleClick:V,onContextMenu:Y,onDragStart:H,onDragOver:X,onDragEnter:K,onDragLeave:z,onDrop:Z,title:we(),className:(0,r.default)(W,A?A.classlist:null),style:le,draggable:E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode,"data-id":g.id},o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_content)},ge(g),q(g),o.default.createElement("div",{className:L?m.default.file_tree_node_prompt_wrap:m.default.file_tree_node_overflow_wrap},Ee(g)),_e()))};t.FileTreeNode=s,t.FILE_TREE_NODE_HEIGHT=22,t.FILE_TREE_BADGE_LIMIT=99},56384:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTree=t.FILE_TREE_FILTER_DELAY=t.FILTER_AREA_HEIGHT=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(97267),p=e(41869),v=e(68974),m=e(24429),_=e(87420),s=e(6250),g=e(46377),a=n.__importDefault(e(2613)),h=e(97738);t.FILTER_AREA_HEIGHT=30,t.FILE_TREE_FILTER_DELAY=500;const u=(0,c.RecycleTreeFilterDecorator)(c.RecycleTree),d=({viewState:f})=>{const[l,b]=(0,o.useState)(!1),[y,A]=(0,o.useState)(!0),[S,w]=(0,o.useState)(!1),[T,D]=(0,o.useState)(!1),[I,O]=(0,o.useState)(),M=(0,o.useRef)(null),R=(0,o.useRef)(new p.DisposableCollection),{height:P}=f,k=(0,p.useInjectable)(s.IFileTreeService),{iconService:F,locationToCurrentFile:L,filterMode:B,indent:j,baseIndent:W}=k,U=(0,p.useInjectable)(h.FileTreeModelService),[Q,V]=(0,o.useState)({indent:j,baseIndent:W}),[$,Y]=(0,o.useState)(B),[H,z]=(0,o.useState)(F.currentTheme||{hasFolderIcons:!0,hasFileIcons:!0,hidesExplorerArrows:!0}),K=(0,o.useCallback)(xe=>Z(xe)?!1:xe.shiftKey,[]),Z=(0,o.useCallback)(xe=>{const{metaKey:Re,ctrlKey:Ne}=xe;return p.isOSX&&Re||Ne},[]),X=(0,o.useCallback)((xe,Re,Ne,fe)=>{xe.stopPropagation();const{handleItemClick:re,handleItemToggleClick:he,handleItemRangeClick:Oe}=U;if(!Re)return;const De=K(xe),Fe=Z(xe);De?Oe(Re,Ne):Fe?he(Re,Ne):re(Re,Ne,fe)},[]),ie=(0,o.useCallback)((xe,Re,Ne)=>{xe.stopPropagation();const{handleItemDoubleClick:fe}=U;Re&&fe(Re,Ne)},[]),oe=(0,o.useCallback)((xe,Re)=>{xe.stopPropagation();const{toggleDirectory:Ne}=U;Ne(Re)},[]);(0,o.useEffect)(()=>{l&&U.onFileTreeModelChange(async xe=>{A(!0),xe&&(await xe.ensureReady,M.current&&k.initContextKey(M.current)),O(xe),A(!1)})},[l,M.current,k]),(0,o.useEffect)(()=>{var xe,Re,Ne;const fe=new p.CancellationTokenSource;return q(fe.token),(xe=R.current)===null||xe===void 0||xe.push(F.onThemeChange(re=>{z(re)})),(Re=R.current)===null||Re===void 0||Re.push(k.onTreeIndentChange(({indent:re,baseIndent:he})=>{V({indent:re,baseIndent:he})})),(Ne=R.current)===null||Ne===void 0||Ne.push(k.onFilterModeChange(re=>{Y(re)})),()=>{var re;fe.cancel(),(re=R.current)===null||re===void 0||re.dispose()}},[]);const le=(0,o.useCallback)((xe,Re)=>{let Ne;if(xe&&Re)for(Ne=xe.parentNode;Ne;){if(Re===Ne)return!0;Ne=Ne.parentNode}return!1},[]),pe=(0,o.useCallback)(xe=>{le(xe.relatedTarget,M.current)||!xe.relatedTarget||(w(!1),U.handleTreeBlur())},[M.current]);(0,o.useEffect)(()=>{$||(U.fileTreeHandle&&U.fileTreeHandle.clearFilter(),U.selectedFiles.length===1&&U.location(U.selectedFiles[0].uri))},[$]),(0,o.useEffect)(()=>{const xe=new p.DisposableCollection;return I&&(xe.push(U.onDidFocusedFileChange(Re=>{Re?Re.isEqual((I?.root).uri)?S||w(!S):S&&w(!S):Re||S&&w(!S)})),xe.push(U.onDidContextMenuFileChange(Re=>{Re?Re.isEqual((I?.root).uri)?S||w(!S):S&&w(!S):Re||S&&w(!S)}))),()=>{xe.dispose()}},[I,S]);const q=(0,o.useCallback)(async xe=>{var Re;if(await U.whenReady,!xe.isCancellationRequested){if(U.treeModel){if(await U.treeModel.ensureReady,O(U.treeModel),xe.isCancellationRequested)return;M.current&&k.initContextKey(M.current)}A(!1),!((Re=R.current)===null||Re===void 0)&&Re.disposed||b(!0)}},[U,R.current]),Ee=(0,o.useCallback)(xe=>{U.handleTreeHandler({...xe,getModel:()=>U.treeModel,hasDirectFocus:()=>M.current===document.activeElement})},[M.current,I]),_e=(0,o.useCallback)(()=>{const{handleItemClick:xe}=U;xe()},[]),ne=(0,o.useCallback)(()=>{U.handleDblClick()},[]),ge=(0,o.useCallback)(()=>{const{handleTreeFocus:xe}=U;xe()},[]),we=(0,o.useCallback)(xe=>{const{handleContextMenu:Re}=U;Re(xe)},[]),Pe=(0,o.useCallback)(xe=>{xe.stopPropagation(),xe.preventDefault()},[]),Ae=(0,o.useCallback)(xe=>{xe.preventDefault(),D(!0)},[]),Te=(0,o.useCallback)(()=>{D(!1)},[]),be=(0,o.useCallback)(xe=>{const{handleDrop:Re}=U.dndService;D(!1),Re(xe)},[]),me=(0,o.useCallback)((xe,Re,Ne,fe)=>{const{handleContextMenu:re}=U;re(xe,Re,fe)},[]);return o.default.createElement("div",{className:(0,r.default)(a.default.file_tree,T&&a.default.outer_drag_over,S&&a.default.outer_active),tabIndex:-1,ref:M,onClick:_e,onDoubleClick:ne,onFocus:ge,onBlur:pe,onContextMenu:we,draggable:!0,onDragStart:Pe,onDragLeave:Te,onDragOver:Ae,onDrop:be},o.default.createElement(E,{isLoading:y,isReady:l,height:P,model:I,iconTheme:H,treeIndent:Q,filterMode:$,locationToCurrentFile:L,onTreeReady:Ee,onContextMenu:me,onItemClick:X,onItemDoubleClick:ie,onTwistierClick:oe}))};t.FileTree=d;const E=(0,o.memo)(({isReady:f,isLoading:l,height:b,model:y,filterMode:A,treeIndent:S,iconTheme:w,onTreeReady:T,onItemClick:D,onItemDoubleClick:I,onContextMenu:O,onTwistierClick:M})=>{const R=(0,p.useInjectable)(s.IFileTreeService),P=(0,p.useInjectable)(_.IIconService),{decorationService:k,labelService:F,locationToCurrentFile:L}=R,B=(0,p.useInjectable)(h.FileTreeModelService),j=(0,o.useCallback)(W=>o.default.createElement(g.FileTreeNode,{item:W.item,itemType:W.itemType,template:W.template,decorationService:k,labelService:F,iconService:P,dndService:B.dndService,decorations:B.decorations.getDecorations(W.item),onClick:D,onDoubleClick:I,onTwistierClick:M,onContextMenu:O,defaultLeftPadding:S.baseIndent,leftPadding:S.indent,hasPrompt:W.hasPrompt,hasFolderIcons:w.hasFolderIcons,hasFileIcons:w.hasFileIcons,hidesExplorerArrows:w.hidesExplorerArrows}),[y,S,w]);return f?l?o.default.createElement(v.Progress,{loading:!0}):y?o.default.createElement(u,{height:b,itemHeight:g.FILE_TREE_NODE_HEIGHT,onReady:T,model:y,filterEnabled:A,filterAfterClear:L,filterAutoFocus:!0,leaveBottomBlank:!0},j):o.default.createElement(m.WelcomeView,{viewId:s.FILE_EXPLORER_WELCOME_ID}):o.default.createElement(v.Progress,{loading:!0})});E.displayName="FileTreeView"},57781:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeService=void 0;const n=e(85608),r=e(76003),o=e(97267),c=e(41869),p=e(18193),v=e(26542),m=e(42933),_=e(52416),s=e(51500),g=e(6250),a=e(69959),h=e(88014),u=e(93239),{Path:d}=c.path;let E=class extends o.Tree{constructor(){super(...arguments),this._fileServiceWatchers=new Map,this._symbolicFiles=new Map,this._changeEventDispatchQueue=new Set,this._readyToWatch=!1,this._watchRootsQueue=[],this.effectedNodes=[],this.onWorkspaceChangeEmitter=new c.Emitter,this.onTreeIndentChangeEmitter=new c.Emitter,this.onFilterModeChangeEmitter=new c.Emitter,this.onNodeRefreshedEmitter=new c.Emitter,this._filterMode=!1,this._refreshable=!0,this.refreshEffectNode=()=>{const l=this.effectedNodes.slice(0);if(this.effectedNodes=[],l.find(y=>a.Directory.isRoot(y)))this.refresh();else for(const y of l)this.refresh(y)},this.flushEventQueue=async()=>{if(!this._changeEventDispatchQueue||this._changeEventDispatchQueue.size===0)return;const l=Array.from(this._changeEventDispatchQueue),b=this.sortPaths(l);(!this.refreshCancelToken||this.refreshCancelToken.token.isCancellationRequested)&&(this.refreshCancelToken=new c.CancellationTokenSource);const y=(0,c.pSeries)(b.map(A=>async()=>{a.Directory.is(A.node)&&await A.node.refresh(this.refreshCancelToken)}));return this._changeEventDispatchQueue.clear(),await y},this.locationToCurrentFile=()=>{this.commandService.executeCommand(c.FILE_COMMANDS.LOCATION.id)}}get onNodeRefreshed(){return this.onNodeRefreshedEmitter.event}get refreshable(){return this._refreshable}get filterMode(){return this._filterMode}get baseIndent(){return this._baseIndent}get indent(){return this._indent}get onWorkspaceChange(){return this.onWorkspaceChangeEmitter.event}get onTreeIndentChange(){return this.onTreeIndentChangeEmitter.event}get onFilterModeChange(){return this.onFilterModeChangeEmitter.event}get isCompactMode(){return this._isCompactMode}get contextKey(){return this.fileContextKey}async init(){this._roots=await this.workspaceService.roots,await this.preferenceService.ready,this._baseIndent=this.preferenceService.getValid("explorer.fileTree.baseIndent",8),this._indent=this.preferenceService.getValid("explorer.fileTree.indent",8),this._isCompactMode=this.preferenceService.getValid("explorer.compactFolders",!0),this.toDispose.push(this.workspaceService.onWorkspaceChanged(l=>{this._roots=l;const b=new c.URI(l[0].uri),y=new a.Directory(this,void 0,b,b.displayName,l[0],this.fileTreeAPI.getReadableTooltip(b));this.root=y,this.onWorkspaceChangeEmitter.fire(y),this.refresh()})),this.toDispose.push(this.workspaceService.onWorkspaceFileExcludeChanged(()=>{this.refresh()})),this.toDispose.push(c.Disposable.create(()=>{var l;(l=this._root)===null||l===void 0||l.dispose(),this._roots=null})),this.toDispose.push(this.corePreferences.onPreferenceChanged(l=>{l.preferenceName==="explorer.fileTree.baseIndent"?(this._baseIndent=l.newValue||8,this.onTreeIndentChangeEmitter.fire({indent:this.indent,baseIndent:this.baseIndent})):l.preferenceName==="explorer.fileTree.indent"?(this._indent=l.newValue||8,this.onTreeIndentChangeEmitter.fire({indent:this.indent,baseIndent:this.baseIndent})):l.preferenceName==="explorer.compactFolders"&&(this._isCompactMode=l.newValue,this.refresh())}))}initContextKey(l){this.fileContextKey.initScopedContext(l)}startWatchFileEvent(){return this._readyToWatch=!0,Promise.all(this._watchRootsQueue.map(l=>this.watchFilesChange(l)))}async resolveChildren(l){var b,y,A,S;let w=[];if(l){if(a.Directory.isRoot(l)&&this.isMultipleWorkspace){const T=await this.workspaceService.roots;for(const D of T){const I=this.fileTreeAPI.toNode(this,D,l,this.workspaceService.getWorkspaceName(new c.URI(D.uri)));this.watchFilesChange(new c.URI(D.uri)),w=w.concat(I),(I.filestat.isSymbolicLink||I.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(I.filestat.uri,I)}return w}if(l.uri){const T=await this.fileTreeAPI.resolveChildren(this,l.uri.toString(),l,this.isCompactMode&&!a.Directory.isRoot(l));w=T.children,w.forEach(I=>{(I.filestat.isSymbolicLink||I.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(I.filestat.uri,I)});const D=T.filestat;if(D&&this.isCompactMode&&!a.Directory.isRoot(l)){const I=new c.URI(D.uri),O=l.parent;if(l&&O){let M=l.name;if(l.filestat.isSymbolicLink){const R=(y=new c.URI(l.filestat.realUri).relative(I))===null||y===void 0?void 0:y.toString();R&&(M=R,M=[l.uri.displayName].concat(M.split(d.separator)).join(d.separator))}else O.filestat.isSymbolicLink?M=(A=new c.URI(O.filestat.realUri).relative(I))===null||A===void 0?void 0:A.toString():M=(S=O.uri.relative(I))===null||S===void 0?void 0:S.toString();M&&M!==l.name&&l.updateMetaData({name:M,uri:I,tooltip:this.fileTreeAPI.getReadableTooltip(I),fileStat:D})}}return w}}else if(this._roots||(this._roots=await this.workspaceService.roots),this.isMultipleWorkspace){const T=new c.URI((b=this.workspaceService.workspace)===null||b===void 0?void 0:b.uri);let D=T.displayName;D=D.slice(0,D.lastIndexOf("."));const I={...this.workspaceService.workspace,isDirectory:!0},O=new a.Directory(this,void 0,T,D,I,this.fileTreeAPI.getReadableTooltip(T));return this.root=O,[O]}else if(this._roots.length>0)return w=await(await this.fileTreeAPI.resolveChildren(this,this._roots[0])).children,w.forEach(T=>{const D=this.workspaceService.getWorkspaceName(T.uri);D&&D!==T.name&&T.updateMetaData({name:D}),(T.filestat.isSymbolicLink||T.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(T.filestat.uri,T)}),this.watchFilesChange(new c.URI(this._roots[0].uri)),this.root=w[0],w;return[]}async watchFilesChange(l){if(!this._readyToWatch){this._watchRootsQueue.push(l);return}const b=await this.fileServiceClient.watchFileChanges(l);this.toDispose.push(b),this.toDispose.push(b.onFilesChanged(y=>{this.onFilesChanged(y)})),this._fileServiceWatchers.set(l.toString(),b)}updateRefreshable(l){var b;l!==this.refreshable&&(this._refreshable=l,this._refreshable?this.doHandleQueueChange():(b=this.refreshCancelToken)===null||b===void 0||b.cancel())}isContentFile(l){return!!l&&"filestat"in l&&!l.filestat.isDirectory}isFileContentChanged(l){return l.type===m.FileChangeType.UPDATED&&this.isContentFile(this.getNodeByPathOrUri(l.uri))}getAffectedChanges(l){const b=[];for(const y of l)this.isFileContentChanged(y)||b.push(y);return b}isRootAffected(l){return this._roots?l.some(b=>b.type>m.FileChangeType.UPDATED&&this._roots&&this._roots.find(y=>b.uri.indexOf(y.uri)>=0)):!1}async onFilesChanged(l){const b=await this.getAffectedNodes(this.getAffectedChanges(l));return b.length>0?this.effectedNodes=this.effectedNodes.concat(b):!(b.length>0)&&this.isRootAffected(l)&&this.effectedNodes.push(this.root),this.refreshEffectNode()}async getFileTreeNodePathByUri(l){var b,y,A,S,w,T;if(!l)return;let D;if(this.isMultipleWorkspace){if(this._roots||(this._roots=await this.workspaceService.roots),D=(S=this._roots.find(I=>new c.URI(I.uri).isEqualOrParent(l)))===null||S===void 0?void 0:S.uri,D){const I=new c.URI(D);if(I.isEqualOrParent(l))return new d(((w=this.root)===null||w===void 0?void 0:w.path)||"/").join(I.displayName).join(((T=I.relative(l))===null||T===void 0?void 0:T.toString())||"").toString()}}else if(D=(b=this.workspaceService.workspace)===null||b===void 0?void 0:b.uri,D){const I=new c.URI(D);if(I.isEqualOrParent(l))return new d(((y=this.root)===null||y===void 0?void 0:y.path)||"").join(((A=I.relative(l))===null||A===void 0?void 0:A.toString())||"").toString()}}async moveNodeByPath(l,b,y,A,S=o.TreeNodeType.TreeNode){const w=new d(l.path).join(y).toString(),T=new d(b.path).join(A).toString();if(w&&T&&T!==w){const D=l.moveNode(w,T);return D&&a.File.is(D)&&(D.updateMetaData({uri:b.uri.resolve(A),fileStat:{...b.filestat,uri:b.uri.resolve(A).toString(),isDirectory:S!==o.TreeNodeType.TreeNode},tooltip:this.fileTreeAPI.getReadableTooltip(b.uri.resolve(A))}),a.Directory.is(D)&&this.updateChildren(D)),D}}async updateChildren(l){const b=l.children;if(!(!b||b.length===0)){for(const y of b)if(a.File.is(y)){const A=l.uri.resolve(y.uri.displayName);y.updateMetaData({uri:A,fileStat:{...y.filestat,uri:A.toString(),isDirectory:!!a.Directory.is(y)},tooltip:this.fileTreeAPI.getReadableTooltip(A)}),a.Directory.is(y)&&this.updateChildren(y)}}}async addNode(l,b,y){let A,S;const w=d.splitPath(b);if(w.length>1){let D=l.uri;for(const I of w)D=D.resolve(I);!this.isCompactMode||a.Directory.isRoot(l)?S=w[0]:y===o.TreeNodeType.CompositeTreeNode?S=b:S=w.slice(0,w.length-1).join(d.separator)}else S=b;A={uri:l.uri.resolve(S).toString(),isDirectory:y===o.TreeNodeType.CompositeTreeNode||w.length>1,isSymbolicLink:!1,lastModification:new Date().getTime()};const T=await this.fileTreeAPI.toNode(this,A,l,S);return T&&l.addNode(T),T}async deleteAffectedNodeByPath(l,b){var y,A;const S=this.getNodeByPathOrUri(l);S&&S.parent&&(this.isCompactMode&&!b?((y=S.parent.children)===null||y===void 0?void 0:y.length)===2?this.refresh((A=S.parent)===null||A===void 0?void 0:A.parent):this.refresh(S.parent):S.parent.removeNode(S.path))}async deleteAffectedNodes(l,b=[]){const y=[];for(const A of l){const S=this.getNodeByPathOrUri(A);S&&a.File.is(S)&&y.push(S)}for(const A of y)!A?.parent||this._changeEventDispatchQueue.has(A?.parent.path)||await this.deleteAffectedNodeByPath(A.path);return b.filter(A=>A.type!==m.FileChangeType.DELETED)}async getAffectedNodes(l){const b=[];for(const y of l){const A=new c.URI(y.uri),S=this.getNodeByPathOrUri(A.parent);S&&b.push(S)}return b}isFileURI(l){return/^file:\/\//.test(l)}getNodeByPathOrUri(l){var b,y,A,S;let w,T;if(typeof l!="string"?(T=l,l=l.toString()):this.isFileURI(l)?T=new c.URI(l):!this.isFileURI(l)&&typeof l=="string"&&(w=l),this.isFileURI(l)&&T){if(this._symbolicFiles.has(T?.toString()))return this._symbolicFiles.get(T.toString());let D;if(this.isMultipleWorkspace?this._roots&&(D=(y=this._roots.find(I=>new c.URI(I.uri).isEqualOrParent(T)))===null||y===void 0?void 0:y.uri):D=(b=this.workspaceService.workspace)===null||b===void 0?void 0:b.uri,this.root&&D){const I=new c.URI(D);if(I.isEqualOrParent(T)){const O=I.relative(T);O&&(this.isMultipleWorkspace?w=new d(this.root.path).join(I.displayName).join(O.toString()).toString():w=new d(this.root.path).join(O.toString()).toString())}}}if(w){const D=(A=this.root)===null||A===void 0?void 0:A.getTreeNodeByPath(w);if(!D){let I;const O=w.split(d.separator);for(;O.length>=1;){O.pop();const M=O.join(d.separator);if(I=(S=this.root)===null||S===void 0?void 0:S.getTreeNodeByPath(M),I)break}if(I&&a.Directory.is(I)){for(const M of I.children||[])if(M.path.includes(w))return M}}return D}}sortComparator(l,b){return l.constructor===b.constructor?l.name.localeCompare(b.name,"en",{numeric:!0}):l.type===o.TreeNodeType.CompositeTreeNode?-1:b.type===o.TreeNodeType.CompositeTreeNode?1:0}get contextMenuContextKeyService(){return this.fileContextKey?this.fileContextKey.service:this.contextKeyService}get isMultipleWorkspace(){return!!this.workspaceService.workspace&&!this.workspaceService.workspace.isDirectory}getDisplayName(l){return this.workspaceService.getWorkspaceName(l)}async refresh(l=this.root){if(l)return a.Directory.is(l)||a.File.is(l)&&l.parent&&(l=l.parent),this._changeEventDispatchQueue.add(l.path),this.doHandleQueueChange()}async doHandleQueueChange(){if(this.refreshable)try{await this.flushEventQueue()}catch(l){this.logger.error("flush file change event queue error:",l)}finally{this.onNodeRefreshedEmitter.fire()}}sortPaths(l){const y=l.slice().map(S=>({node:this.getNodeByPathOrUri(S),path:S})).filter(S=>S&&!!S.node);l.length>1&&y.sort((S,w)=>{var T,D;const I=((T=S.node)===null||T===void 0?void 0:T.depth)||0,O=((D=w.node)===null||D===void 0?void 0:D.depth)||0;return I-O});const A=[];for(let S=y.length-1;S>=0;S--){const w=y[S];let T=!1;for(let D=0;D<S;D++){const I=y[D];a.Directory.is(I)&&w.node.path.startsWith(I.node.path)&&(T=!0)}T||A.push(w)}return A}openFile(l){const b=this.preferenceService.get("editor.previewMode");this.commandService.executeCommand(c.EDITOR_COMMANDS.OPEN_RESOURCE.id,l,{disableNavigate:!0,preview:b})}openAndFixedFile(l){this.commandService.executeCommand(c.EDITOR_COMMANDS.OPEN_RESOURCE.id,l,{disableNavigate:!0,preview:!1,focus:!0})}openToTheSide(l){this.commandService.executeCommand(c.EDITOR_COMMANDS.OPEN_RESOURCE.id,l,{disableNavigate:!0,split:4})}compare(l,b){this.commandService.executeCommand(c.EDITOR_COMMANDS.COMPARE.id,{original:l,modified:b})}toggleFilterMode(){var l;this._filterMode=!this.filterMode,this.onFilterModeChangeEmitter.fire(this.filterMode),(l=this.fileContextKey)===null||l===void 0||l.filesExplorerFilteredContext.set(this.filterMode),this.filterMode===!1&&this.commandService.executeCommand(c.FILE_COMMANDS.LOCATION.id)}};t.FileTreeService=E,n.__decorate([(0,r.Autowired)(g.IFileTreeAPI),n.__metadata("design:type",Object)],E.prototype,"fileTreeAPI",void 0),n.__decorate([(0,r.Autowired)(c.CommandService),n.__metadata("design:type",Object)],E.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(c.IContextKeyService),n.__metadata("design:type",Object)],E.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(s.IWorkspaceService),n.__metadata("design:type",Object)],E.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(p.CorePreferences),n.__metadata("design:type",Object)],E.prototype,"corePreferences",void 0),n.__decorate([(0,r.Autowired)(c.PreferenceService),n.__metadata("design:type",Object)],E.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(v.LabelService),n.__metadata("design:type",v.LabelService)],E.prototype,"labelService",void 0),n.__decorate([(0,r.Autowired)(u.FileTreeDecorationService),n.__metadata("design:type",u.FileTreeDecorationService)],E.prototype,"decorationService",void 0),n.__decorate([(0,r.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],E.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(_.IIconService),n.__metadata("design:type",Object)],E.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(c.ILogger),n.__metadata("design:type",Object)],E.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(h.FileContextKey),n.__metadata("design:type",h.FileContextKey)],E.prototype,"fileContextKey",void 0),t.FileTreeService=E=n.__decorate([(0,r.Injectable)()],E)},83709:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeNextModule=void 0;const n=e(85608),r=e(41869),o=e(72665),c=e(41103),p=e(6250),v=e(89508),m=e(40439),_=e(57781),s=e(88808),g=e(93239),a=e(97738),h=e(24861);let u=class extends r.BrowserModule{constructor(){super(...arguments),this.providers=[{token:p.IFileTreeAPI,useClass:s.FileTreeAPI},{token:g.FileTreeDecorationService,useClass:g.FileTreeDecorationService},{token:p.IFileTreeService,useClass:_.FileTreeService},{token:a.FileTreeModelService,useClass:a.FileTreeModelService},{token:o.IWindowDialogService,useClass:v.WindowDialogServiceImpl},m.FileTreeContribution]}};t.FileTreeNextModule=u,t.FileTreeNextModule=u=n.__decorate([(0,r.Domain)(h.name),(0,r.ModuleDependencies)([c.WorkspaceModule])],u)},88808:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeAPI=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(43718),p=e(42933),v=e(72665),m=e(26199),_=e(69959);let s=class{constructor(){this.onDidResolveChildrenEmitter=new c.Emitter,this.onDidResolveChildren=this.onDidResolveChildrenEmitter.event}async resolveChildren(a,h,u,d){var E;let f;if(!this.userhomePath){const l=await this.fileServiceClient.getCurrentUserHome();l&&(this.userhomePath=new c.URI(l.uri))}if(typeof h=="string"?f=await this.fileServiceClient.getFileStat(h):f=await this.fileServiceClient.getFileStat(h.uri),f){if(this.onDidResolveChildrenEmitter.fire(f.uri.toString()),((E=f.children)===null||E===void 0?void 0:E.length)===1&&f.children[0].isDirectory&&d)return await this.resolveChildren(a,f.children[0].uri,u,d);{const l={...f,isInSymbolicDirectory:u?.filestat.isSymbolicLink||u?.filestat.isInSymbolicDirectory};return{children:this.toNodes(a,l,u),filestat:l}}}else return{children:[],filestat:null}}async resolveNodeByPath(a,h,u){const d=await this.fileServiceClient.getFileStat(h);if(d)return this.toNode(a,d,u)}async resolveFileStat(a){return await this.fileServiceClient.getFileStat(a.toString())}toNodes(a,h,u){if(u){if(h.children)return h.children.map(d=>this.toNode(a,d,u))}else return[this.toNode(a,h,u)];return[]}toNode(a,h,u,d){var E;const f=new c.URI(h.uri),l=d||f.displayName;let b;return h.isInSymbolicDirectory=(E=u?.filestat.isSymbolicLink)!==null&&E!==void 0?E:u?.filestat.isInSymbolicDirectory,h.isDirectory?b=new _.Directory(a,u,f,l,h,this.getReadableTooltip(f)):b=new _.File(a,u,f,l,h,this.getReadableTooltip(f)),b}async mvFiles(a,h){const u=[];for(const f of a)if(f.url.isEqualOrParent(h))return;const d=a.sort((f,l)=>f.toString().length-l.toString().length),E=[];for(const f of d)E.length>0&&E.find(l=>l.url.isEqualOrParent(f.url))||E.push(f);if(this.corePreferences["explorer.confirmMove"]){const f=(0,c.localize)("file.confirm.move.ok"),l=(0,c.localize)("file.confirm.move.cancel");if(await this.dialogService.warning((0,c.formatLocalize)("file.confirm.move",`[ ${E.map(y=>y.url.displayName).join(",")} ]`,h.displayName),[l,f])!==f)return}for(const f of E){const l=await this.mv(f.url,h.resolve(f.url.displayName),f.isDirectory);l&&u.push(l)}return u}async mv(a,h,u=!1){try{await this.workspaceEditService.apply({edits:[{newResource:h,oldResource:a,options:{isDirectory:u,overwrite:!0}}]})}catch(d){return d.message}}async createFile(a,h){try{await this.workspaceEditService.apply({edits:[{newResource:a,options:{content:h}}]})}catch(u){return u.message}this.commandService.executeCommand(o.EDITOR_COMMANDS.OPEN_RESOURCE.id,a,{disableNavigate:!0,focus:!0})}async createDirectory(a){try{await this.workspaceEditService.apply({edits:[{newResource:a,options:{isDirectory:!0}}]})}catch(h){return h.message}}async delete(a){try{await this.workspaceEditService.apply({edits:[{oldResource:a,options:{}}]});return}catch(h){return h.message}}async copyFile(a,h){let u=1,d;try{d=await this.fileServiceClient.access(h.toString())}catch(E){return E.message}for(;d;){const E=h.displayName.replace(/\Wcopy\W\d+/,""),f=c.path.extname(E),b=`${c.path.basename(E,f)} copy ${u}${f}`;h=h.parent.resolve(b),u++;try{d=await this.fileServiceClient.access(h.toString())}catch{return}}try{return await this.fileServiceClient.copy(a.toString(),h.toString())}catch(E){return E.message}}getReadableTooltip(a){const h=a.toString(),u=this.userhomePath&&this.userhomePath.toString();return this.userhomePath&&this.userhomePath.isEqualOrParent(a)?decodeURIComponent(h.replace(u,"~")):decodeURIComponent(a.withScheme("").toString())}};t.FileTreeAPI=s,n.__decorate([(0,r.Autowired)(p.IFileServiceClient),n.__metadata("design:type",Object)],s.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(m.IWorkspaceEditService),n.__metadata("design:type",Object)],s.prototype,"workspaceEditService",void 0),n.__decorate([(0,r.Autowired)(c.CommandService),n.__metadata("design:type",Object)],s.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(o.CorePreferences),n.__metadata("design:type",Object)],s.prototype,"corePreferences",void 0),n.__decorate([(0,r.Autowired)(v.IDialogService),n.__metadata("design:type",Object)],s.prototype,"dialogService",void 0),t.FileTreeAPI=s=n.__decorate([(0,r.Injectable)()],s)},93239:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeDecorationService=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(41893),p=e(52416);let v=class{constructor(){this.disposeCollection=new o.DisposableCollection,this.onDidChangeEmitter=new o.Emitter,this.cacheDecorations=new Map,this.disposeCollection.pushAll([this.decorationsService.onDidChangeDecorations(_=>{var s,g,a;const h=(g=(s=_._data)===null||s===void 0?void 0:s._iter)===null||g===void 0?void 0:g._value;if(h){const u=new o.URI(h),d=this.getDecoration(u);this.cacheDecorations.has(h)?((a=this.cacheDecorations.get(h))===null||a===void 0?void 0:a.tooltip)!==d?.tooltip&&this.onDidChangeEmitter.fire():(this.cacheDecorations.set(h,d),this.onDidChangeEmitter.fire())}}),this.themeService.onThemeChange(()=>{this.onDidChangeEmitter.fire()})])}get onDidChange(){return this.onDidChangeEmitter.event}getDecoration(_,s=!1){_ instanceof o.URI&&(_=o.Uri.parse(_.toString()));const g=this.decorationsService.getDecoration(_,s);return g?{...g,color:this.themeService.getColor({id:g.color})}:{color:"",tooltip:"",badge:""}}dispose(){this.disposeCollection.dispose()}};t.FileTreeDecorationService=v,n.__decorate([(0,r.Autowired)(c.IDecorationsService),n.__metadata("design:type",c.IDecorationsService)],v.prototype,"decorationsService",void 0),n.__decorate([(0,r.Autowired)(p.IThemeService),n.__metadata("design:type",Object)],v.prototype,"themeService",void 0),t.FileTreeDecorationService=v=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],v)},30577:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DragAndDropService=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(53622),m=e(14951),_=e(72665),s=e(51500),g=e(6250),a=e(69959),h=r.__importDefault(e(89200)),u=r.__importDefault(e(2613)),d=e(57781),E=e(97738);let f=n=class extends p.WithEventBus{constructor(b){super(),this.model=b,this.toCancelNodeExpansion=new p.DisposableCollection,this.beingDraggedDec=new c.Decoration(h.default.mod_dragging),this.draggedOverDec=new c.Decoration(h.default.mod_dragover),this.beingDraggedNodes=[],this.dragOverTrigger=new p.ThrottledDelayer(n.MS_TILL_DRAGGED_OVER_EXPANDS),this.handleDragStart=(y,A,S)=>{y.stopPropagation();const w=O=>{this.handleDragEnd(O,A)};y.currentTarget.addEventListener("dragend",w,!1);let T=this.model.selectedFiles,D=!1;for(const O of T)O&&O.id===A.id&&(D=!0);D||(T=[A]),this.beingDraggedNodes=T,this.beingDraggedActiveUri=S;const I=T.find(O=>!a.Directory.is(O));if(I&&y.dataTransfer.setData("uri",I.uri.toString()),y.dataTransfer.setData("beingDraggedNodes",JSON.stringify(this.beingDraggedNodes.map(O=>O.uri.toString()))),I){const O=I;O.uri.scheme==="file"&&y.dataTransfer.setData("DownloadURL",`application/octet-stream:${O.displayName}:data:application/octet-stream;base64,${(0,p.encodeBase64)(p.BinaryBuffer.fromString(O.filestat.uri))}`)}if(T.forEach(O=>{this.beingDraggedDec.addTarget(O,c.TargetMatchMode.Self)}),y.dataTransfer){let O;T.length===1?O=S?S.displayName:typeof A.name=="string"?A.name:"":O=String(T.length);const M=document.createElement("div");M.className=u.default.file_tree_drag_image,M.textContent=O,document.body.appendChild(M),y.dataTransfer.setDragImage(M,-10,-10),setTimeout(()=>document.body.removeChild(M),0)}},this.handleDragEnter=(y,A)=>{y.stopPropagation(),y.preventDefault()},this.handleDragLeave=(y,A)=>{y.preventDefault(),y.stopPropagation(),this.toCancelNodeExpansion.dispose(),this.potentialParent&&(this.draggedOverDec.removeTarget(this.potentialParent),this.model.treeModel.dispatchChange())},this.handleDragOver=(y,A)=>{if(y.preventDefault(),y.stopPropagation(),!this.toCancelNodeExpansion.disposed||this.beingDraggedNodes.indexOf(A)>=0)return;this.draggedOverNode=A;const S=a.Directory.is(A)&&A.expanded?A:A.parent;(this.potentialParent!==S||!this.draggedOverDec.hasTarget(S))&&(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=S,this.draggedOverDec.addTarget(this.potentialParent,c.TargetMatchMode.SelfAndChildren),this.model.treeModel.dispatchChange()),this.potentialParent!==A&&a.Directory.is(A)&&(this.dragOverTrigger.trigger(async()=>{A.expanded?(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=A,this.draggedOverDec.addTarget(this.potentialParent,c.TargetMatchMode.SelfAndChildren)):(await A.setExpanded(!0),this.draggedOverNode===A&&(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=A,this.draggedOverDec.addTarget(this.potentialParent,c.TargetMatchMode.SelfAndChildren))),this.model.treeModel.dispatchChange()}),this.toCancelNodeExpansion.push(p.Disposable.create(()=>{this.dragOverTrigger.isTriggered()||this.dragOverTrigger.cancel()})))},this.handleDrop=async(y,A,S)=>{var w,T;this.eventBus.fire(new v.FileTreeDropEvent({event:y.nativeEvent,targetDir:S?S.codeUri.path:A&&A instanceof a.File?(w=A.parent)===null||w===void 0?void 0:w.uri.codeUri.path:A?A.uri.codeUri.path:new p.URI((T=this.workspaceService.workspace)===null||T===void 0?void 0:T.uri).codeUri.path}));try{y.preventDefault(),y.stopPropagation(),y.dataTransfer.dropEffect="copy";let D;const I=!!this.beingDraggedActiveUri;this.fileTreeService.isCompactMode&&S&&!A?.uri.isEqual(S)?D=null:A?D=a.Directory.is(A)?A:A.parent:D=this.root;let O;if(this.beingDraggedActiveUri){const M=this.fileTreeService.getNodeByPathOrUri(this.beingDraggedActiveUri);O=[new a.Directory(this.fileTreeService,M?.parent,this.beingDraggedActiveUri,this.beingDraggedActiveUri.displayName,{uri:this.beingDraggedActiveUri.toString(),isDirectory:!0,lastModification:new Date().getTime()},this.beingDraggedActiveUri.displayName)]}else if(O=this.beingDraggedNodes,!O||O.length===0)try{const M=JSON.parse(y.dataTransfer.getData("beingDraggedNodes"));M&&M.length!==0&&(O=M.map(R=>this.fileTreeService.getNodeByPathOrUri(new p.URI(R))).filter(Boolean),O.length||(O=await Promise.all(M.map(async R=>{const P=new p.URI(R);let k;const F=await this.filesystem.getFileStat(P.toString());return F?.isDirectory?k=new a.Directory(this.fileTreeService,this.root,P,P.displayName,{uri:P.toString(),isDirectory:!0,lastModification:new Date().getTime()},P.displayName):k=new a.File(this.fileTreeService,this.root,P,P.displayName,{uri:P.toString(),isDirectory:!0,lastModification:new Date().getTime()},P.displayName),k}))))}catch{}if(O.length>0){const M=S||D&&D.uri,R=O.filter(P=>P&&P.parent&&(this.beingDraggedActiveUri?!P.parent.uri.isEqual(M):!0));if(R.length>0){const P=await this.fileTreeAPI.mvFiles(R.map(k=>({url:k.uri,isDirectory:k.filestat.isDirectory})),M);if(P&&P.length>0)P.forEach(k=>{this.messageService.error(k)});else if(P){if(D)if(this.fileTreeService.isCompactMode&&I){for(const k of R)this.fileTreeService.refresh(k.parent);this.fileTreeService.refresh(D)}else for(const k of R){const F=D.uri.resolve(k.name);this.fileTreeService.moveNodeByPath(k.parent,D,k.name,k.name,k.type),k.updateMetaData({name:F.displayName,fileStat:{...k.filestat,uri:F.toString()},uri:F,tooltip:this.fileTreeAPI.getReadableTooltip(F)}),a.Directory.is(k)&&this.fileTreeService.refresh(k)}else if(A){if(this.fileTreeService.isCompactMode&&I)for(const k of R)this.fileTreeService.refresh(k.parent);else for(const k of R)this.fileTreeService.deleteAffectedNodeByPath(k.path);this.fileTreeService.refresh(A.parent)}}else return}}A&&this.beingDraggedDec.removeTarget(A),this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.beingDraggedNodes.forEach(M=>{this.beingDraggedDec.removeTarget(M)}),this.beingDraggedNodes=[],this.beingDraggedActiveUri=void 0,this.potentialParent=null,this.model.treeModel.dispatchChange(),this.toCancelNodeExpansion.disposed||this.toCancelNodeExpansion.dispose()}catch(D){this.logger.error(D)}},this.handleDragEnd=(y,A)=>{this.beingDraggedDec.removeTarget(A),this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.beingDraggedNodes.forEach(S=>{this.beingDraggedDec.removeTarget(S)}),this.beingDraggedNodes=[],this.beingDraggedActiveUri=void 0,this.potentialParent=null,this.model.treeModel.dispatchChange(),this.toCancelNodeExpansion.disposed||this.toCancelNodeExpansion.dispose()},this.model.decorations.addDecoration(this.beingDraggedDec),this.model.decorations.addDecoration(this.draggedOverDec)}get root(){return this.model.treeModel.root}};t.DragAndDropService=f,f.MS_TILL_DRAGGED_OVER_EXPANDS=500,r.__decorate([(0,o.Autowired)(g.IFileTreeAPI),r.__metadata("design:type",Object)],f.prototype,"fileTreeAPI",void 0),r.__decorate([(0,o.Autowired)(p.ILogger),r.__metadata("design:type",Object)],f.prototype,"logger",void 0),r.__decorate([(0,o.Autowired)(_.IMessageService),r.__metadata("design:type",Object)],f.prototype,"messageService",void 0),r.__decorate([(0,o.Autowired)(g.IFileTreeService),r.__metadata("design:type",d.FileTreeService)],f.prototype,"fileTreeService",void 0),r.__decorate([(0,o.Autowired)(m.IFileServiceClient),r.__metadata("design:type",Object)],f.prototype,"filesystem",void 0),r.__decorate([(0,o.Autowired)(s.IWorkspaceService),r.__metadata("design:type",Object)],f.prototype,"workspaceService",void 0),t.DragAndDropService=f=n=r.__decorate([(0,o.Injectable)(),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[E.FileTreeModelService])],f)},97738:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeModelService=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(91830),m=e(93899),_=e(26542),s=e(54414),g=e(14951),a=e(63067),h=e(53576),u=e(72665),d=e(6250),E=e(69959),f=e(2812),l=e(46377),b=r.__importDefault(e(89200)),y=e(57781),A=e(30577),{Path:S,isValidBasename:w}=p.path,{coalesce:T}=p.arrays,{trim:D,rtrim:I}=p.strings;let O=n=class{constructor(){this._isDisposed=!1,this._whenReady=new p.Deferred,this.selectedDecoration=new c.Decoration(b.default.mod_selected),this.focusedDecoration=new c.Decoration(b.default.mod_focused),this.contextMenuDecoration=new c.Decoration(b.default.mod_actived),this.loadingDecoration=new c.Decoration(b.default.mod_loading),this.cutDecoration=new c.Decoration(b.default.mod_cut),this._selectedFiles=[],this.disposableCollection=new p.DisposableCollection,this._isMultiSelected=!1,this.refreshedActionDelayer=new p.ThrottledDelayer(n.DEFAULT_REFRESHED_ACTION_DELAY),this.labelChangedDelayer=new p.ThrottledDelayer(n.DEFAULT_LABEL_CHANGED_DELAY),this.locationThrottler=new p.Throttler,this.onDidFocusedFileChangeEmitter=new p.Emitter,this.onDidContextMenuFileChangeEmitter=new p.Emitter,this.onDidSelectedFileChangeEmitter=new p.Emitter,this.onFileTreeModelChangeEmitter=new p.Emitter,this._initTreeModelReady=!1,this.clearFileSelectedDecoration=()=>{this.selectedDecoration.clearAppliedTarget(),this._selectedFiles=[]},this.activeFileDecoration=(R,P=!0)=>{this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),R&&(this.selectedFiles.length>0&&this.selectedDecoration.clearAppliedTarget(),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.selectedDecoration.addTarget(R),this.focusedDecoration.addTarget(R),this.focusedFile=R,this.selectedFiles=[R],P&&this.treeModel.dispatchChange())},this.selectFileDecoration=(R,P=!0)=>{R!==this.treeModel.root&&(this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),R&&(this.selectedFiles.length>0&&this.selectedDecoration.clearAppliedTarget(),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.selectedDecoration.addTarget(R),this._selectedFiles=[R],P&&this.treeModel.dispatchChange()))},this.activateFileActivedDecoration=R=>{this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),this.focusedFile&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this.contextMenuDecoration.addTarget(R),this.contextMenuFile=R,this.treeModel.dispatchChange()},this.activateFileFocusedDecoration=R=>{this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),this.focusedDecoration.addTarget(R),this.focusedFile=R,this.treeModel.dispatchChange()},this.activeFileFocusedDecoration=(R,P=!1)=>{R!==this.treeModel.root&&(this.focusedFile!==R&&(P?(this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.contextMenuFile=R):this.focusedFile&&(this.contextMenuFile=void 0,this.focusedDecoration.clearAppliedTarget()),R&&(this._selectedFiles.indexOf(R)<0&&(this.selectedDecoration.addTarget(R),this._selectedFiles.push(R),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(k=>k.uri))),this.focusedDecoration.addTarget(R),this.focusedFile=R)),this.treeModel.dispatchChange())},this.toggleFileSelectedDecoration=R=>{const P=this._selectedFiles.indexOf(R);P>-1?(this.focusedFile===R&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this._selectedFiles.splice(P,1),this.selectedDecoration.clearAppliedTarget()):(this._selectedFiles.push(R),this.selectedDecoration.addTarget(R),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.focusedFile=R,this.focusedDecoration.addTarget(R)),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(k=>k.uri)),this.treeModel.dispatchChange()},this.activeFileDecorationByRange=(R,P)=>{for(this.clearFileSelectedDecoration(),this.contextMenuFile=void 0;R<=P;R++){const k=this.treeModel.root.getTreeNodeAtIndex(R);k&&(this._selectedFiles.push(k),this.selectedDecoration.addTarget(k))}this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(k=>k.uri)),this.treeModel.dispatchChange()},this.deactivateFileDecoration=()=>{var R;this.focusedFile&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this.contextMenuFile&&this.contextMenuDecoration.removeTarget(this.contextMenuFile),(R=this.treeModel)===null||R===void 0||R.dispatchChange()},this.toggleDirectory=async R=>{R.expanded?this.fileTreeHandle.collapseNode(R):this.fileTreeHandle.expandNode(R)},this.handleDblClick=()=>{this.commandService.executeCommand(p.FILE_COMMANDS.NEW_FILE.id)},this.handleContextMenu=(R,P,k)=>{var F;R.stopPropagation(),R.preventDefault();let L,B;P?(B=P,this._isMultiSelected?this.selectedFiles.indexOf(B)>=0?L=this.selectedFiles:L=[B]:L=[B]):(L=[this.treeModel.root],B=this.treeModel.root),this.activateFileActivedDecoration(B),this.setFileTreeContextKey(B),this.fileTreeService.isCompactMode&&k?(this._activeUri=k,(F=this.contextKey)===null||F===void 0||F.explorerResourceIsFolder.set(!0)):k||(this._activeUri=null);const j=this.contextMenuService.createMenu({id:m.MenuId.ExplorerContext,contextKeyService:this.fileTreeService.contextMenuContextKeyService}),W=j.getMergedMenuNodes();j.dispose(),this.updateExplorerCompressedContextKey(B,k);const{x:U,y:Q}=R.nativeEvent;this.ctxMenuRenderer.show({anchor:{x:U,y:Q},menuNodes:W,args:k?[k,[k]]:[B.uri,L.map(V=>V.uri)]})},this.handleTreeBlur=()=>{var R,P,k;this._isDisposed||((P=(R=this.contextKey)===null||R===void 0?void 0:R.filesExplorerFocused)===null||P===void 0||P.set(!1),this.deactivateFileDecoration(),(k=this.contextKey)===null||k===void 0||k.explorerResourceIsFolder.set(!1))},this.handleTreeFocus=()=>{var R,P;(P=(R=this.contextKey)===null||R===void 0?void 0:R.filesExplorerFocused)===null||P===void 0||P.set(!0)},this.handleItemRangeClick=(R,P)=>{if(this.selectedFiles.length===1&&E.Directory.isRoot(this.selectedFiles[0])&&this.clearFileSelectedDecoration(),!this.focusedFile)this.handleItemClick(R,P);else if(this.focusedFile&&this.focusedFile!==R){this._isMultiSelected=!0;const k=this.treeModel.root.getIndexAtTreeNode(R),F=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);F>k?this.activeFileDecorationByRange(k,F):F<k&&this.activeFileDecorationByRange(F,k)}},this.handleItemToggleClick=(R,P)=>{this._isMultiSelected=!0,!(P!==c.TreeNodeType.CompositeTreeNode&&P!==c.TreeNodeType.TreeNode)&&(this.selectedFiles.length===1&&E.Directory.isRoot(this.selectedFiles[0])&&this.clearFileSelectedDecoration(),this.toggleFileSelectedDecoration(R))},this.handleItemClick=(R,P=this.fileTreeService.isMultipleWorkspace?c.TreeNodeType.TreeNode:c.TreeNodeType.CompositeTreeNode,k)=>{var F,L,B,j;if(this.treeModel&&(R||(R=this.treeModel.root),this.updateExplorerCompressedContextKey(R,k),this._isMultiSelected=!1,(P===c.TreeNodeType.CompositeTreeNode||P===c.TreeNodeType.TreeNode)&&this.activeFileDecoration(R),this.fileTreeService.isCompactMode&&k?(this._activeUri=k,(F=this.contextKey)===null||F===void 0||F.explorerResourceIsFolder.set(!0)):k||(this._activeUri=null,(L=this.contextKey)===null||L===void 0||L.explorerResourceIsFolder.set(P===c.TreeNodeType.CompositeTreeNode)),this.corePreferences["workbench.list.openMode"]==="singleClick")){if(P===c.TreeNodeType.CompositeTreeNode){if((B=this.contextKey)===null||B===void 0||B.explorerResourceIsFolder.set(!0),R===this.treeModel.root)return;this.toggleDirectory(R)}else if(P===c.TreeNodeType.TreeNode){if((j=this.contextKey)===null||j===void 0||j.explorerResourceIsFolder.set(!1),R===this.treeModel.root)return;this.fileTreeService.openFile(R.uri),this.mainlayoutService.bottomExpanded&&this.commandService.executeCommand(h.RETRACT_BOTTOM_PANEL.id)}}},this.handleItemDoubleClick=(R,P)=>{P===c.TreeNodeType.TreeNode?this.fileTreeService.openAndFixedFile(R.uri):this.corePreferences["workbench.list.openMode"]==="doubleClick"&&this.toggleDirectory(R)},this.validateFileName=(R,P)=>{var k;if(P=this.getWellFormedFileName(P),!P||P.length===0||/^\s+$/.test(P))return{message:(0,p.localize)("validate.tree.emptyFileNameError"),type:c.PROMPT_VALIDATE_TYPE.ERROR,value:P};if(P[0]==="/"||P[0]==="\\")return{message:(0,p.localize)("validate.tree.fileNameStartsWithSlashError"),type:c.PROMPT_VALIDATE_TYPE.ERROR,value:P};if(P[0]===" "||P[P.length-1]===" ")return{message:(0,p.localize)("validate.tree.fileNameFollowOrStartWithSpaceWarning"),type:c.PROMPT_VALIDATE_TYPE.WARNING,value:P};let F;if(R.target){const B=R.target;if(P===B.name)return null;F=B.parent}else F=R.parent;return F&&!(R instanceof c.RenamePromptHandle&&R.target.displayName.indexOf(S.separator)>0)&&((k=F.children)===null||k===void 0?void 0:k.find(W=>W.name===P))?{message:(0,p.formatLocalize)("validate.tree.fileNameExistsError",P),type:c.PROMPT_VALIDATE_TYPE.ERROR,value:P}:T(P.split(/[\\/]/)).some(B=>!w(B))?{message:(0,p.formatLocalize)("validate.tree.invalidFileNameError",this.trimLongName(P)),type:c.PROMPT_VALIDATE_TYPE.ERROR,value:P}:null},this.proxyPrompt=R=>{let P=!1;const k=async V=>{const $=await this.fileTreeService.getNodeByPathOrUri(V);$&&(E.Directory.is($)?this.selectFileDecoration($):this.location($.uri))},F=async V=>{var $,Y,H;if(this.validateMessage=void 0,R instanceof c.RenamePromptHandle){const z=R.target,K=R.target.displayName.split(S.separator),Z=z.name.indexOf(S.separator)>0;if(Z&&this.activeUri&&!R.target.uri.toString().includes(this.activeUri.toString()))return!1;const X=this.activeUri?K.length-R.target.uri.toString().replace(this.activeUri.toString(),"").split(S.separator).length:-1,ie=X===-1?[]:K.slice(0,X).concat(V);let oe=z.uri,le=z.parent.uri.resolve(V);if(Z&&(($=this.activeUri)===null||$===void 0?void 0:$.displayName)===V||!Z&&V===z.name)return!0;R.addAddonAfter("loading_indicator"),Z&&ie.length>0&&E.Directory.is(z.parent)&&(oe=z.parent.uri.resolve(K.slice(0,X+1).join(S.separator)),le=z.parent.uri.resolve(ie.concat().join(S.separator)));const pe=await this.fileTreeAPI.mv(oe,le,z.type===c.TreeNodeType.CompositeTreeNode);if(pe)return this.validateMessage={type:c.PROMPT_VALIDATE_TYPE.ERROR,message:pe,value:V},this.fileTreeService.updateRefreshable(!0),R.addValidateMessage(this.validateMessage),!1;if(this.fileTreeService.updateRefreshable(!1),R.removeAddonAfter(),!Z&&z.parent){const q=await this.fileTreeService.moveNodeByPath(z.parent,z.parent,z.name,V,z.type);q&&this.selectFileDecoration(q,!1),this.fileTreeService.updateRefreshable(!0)}else if(E.Directory.is(z)&&!E.Directory.isRoot(z)){z.updateMetaData({name:ie.concat(K.slice(X+1)).join(S.separator),uri:le,fileStat:{...z.filestat,uri:le.toString()},tooltip:this.fileTreeAPI.getReadableTooltip(le)}),this.treeModel.dispatchChange();let q;E.Directory.is(z.parent)&&(!((Y=z.parent.children)===null||Y===void 0)&&Y.find(Ee=>z.path.indexOf(Ee.path)>=0))?q=this.fileTreeService.refresh(z.parent):q=this.fileTreeService.refresh(z),q.then(()=>{k(le)})}R.removeAddonAfter()}else if(R instanceof c.NewPromptHandle){const z=R.parent,K=z.uri.resolve(V);let Z;if(R.addAddonAfter("loading_indicator"),this.fileTreeService.updateRefreshable(!0),R.type===c.TreeNodeType.CompositeTreeNode?Z=await this.fileTreeAPI.createDirectory(K):Z=await this.fileTreeAPI.createFile(K),R.removeAddonAfter(),Z)return this.validateMessage={type:c.PROMPT_VALIDATE_TYPE.ERROR,message:Z,value:V},this.fileTreeService.updateRefreshable(!1),R.addValidateMessage(this.validateMessage),!1;if(V.includes(S.separator)&&this.fileTreeService.refresh(z).then(()=>{k(z.uri.resolve(V))}),this.fileTreeService.isCompactMode)if(R.type===c.TreeNodeType.CompositeTreeNode)if((!z.children||z.children.length===0)&&!E.Directory.isRoot(z)){const ie=z.uri.resolve(V),oe=[z.name].concat(V).join(S.separator);z.updateMetaData({name:oe,uri:ie,fileStat:{...z.filestat,uri:ie.toString()},tooltip:this.fileTreeAPI.getReadableTooltip(ie)}),k(ie)}else await this.fileTreeService.addNode(z,V,R.type),k(z.uri.resolve(V));else await this.fileTreeService.addNode(z,V,R.type),k(z.uri.resolve(V));else await this.fileTreeService.addNode(z,V,R.type),k(z.uri.resolve(V))}return(H=this.contextKey)===null||H===void 0||H.filesExplorerInputFocused.set(!1),!0},L=async V=>{var $,Y,H,z;if(this.validateMessage&&this.validateMessage.type===c.PROMPT_VALIDATE_TYPE.ERROR)return this.validateMessage=void 0,!0;if(P)return!1;if(!V){($=this.contextKey)===null||$===void 0||$.explorerCompressedFocusContext.set(!1),(Y=this.contextKey)===null||Y===void 0||Y.explorerCompressedFirstFocusContext.set(!1),(H=this.contextKey)===null||H===void 0||H.explorerCompressedLastFocusContext.set(!1),this.fileTreeService.isCompactMode&&R instanceof c.NewPromptHandle&&this.fileTreeService.refresh(R.parent);return}return(z=this.contextKey)===null||z===void 0||z.filesExplorerInputFocused.set(!1),await F(V),!0},B=async V=>{if(P=!0,this.validateMessage&&this.validateMessage.type===c.PROMPT_VALIDATE_TYPE.ERROR)return!1;if(V.trim()===""||this.validateMessage&&this.validateMessage.type!==c.PROMPT_VALIDATE_TYPE.ERROR)return this.validateMessage=void 0,!0;const $=await F(V);return P=!1,!!$},j=async()=>{var V;(V=this.contextKey)===null||V===void 0||V.filesExplorerInputFocused.set(!0)},W=()=>{var V;this.fileTreeService.updateRefreshable(!0),(V=this.contextKey)===null||V===void 0||V.filesExplorerInputFocused.set(!1),this.contextMenuFile&&this.selectFileDecoration(this.contextMenuFile,!0)},U=()=>{var V;(V=this.contextKey)===null||V===void 0||V.filesExplorerInputFocused.set(!1),this.fileTreeService.isCompactMode&&R instanceof c.NewPromptHandle&&this.fileTreeService.refresh(R.parent)},Q=V=>{const $=this.validateFileName(R,V);$?(this.validateMessage=$,R.addValidateMessage($)):!$&&this.validateMessage&&this.validateMessage.value!==V&&(this.validateMessage=void 0,R.removeValidateMessage())};R.destroyed||(this.fileTreeService.updateRefreshable(!1),R.onChange(Q),R.onCommit(B),R.onBlur(L),R.onFocus(j),R.onDestroy(W),R.onCancel(U))},this.copyFile=async R=>{var P;this.pasteStore&&this.pasteStore.type===d.PasteTypes.CUT&&(this._pasteStore.files.forEach(F=>{F&&this.cutDecoration.removeTarget(F)}),(P=this.contextKey)===null||P===void 0||P.explorerResourceCut.set(!1)),this.treeModel.dispatchChange();const k=[];for(const F of R){const L=this.fileTreeService.getNodeByPathOrUri(F);L&&k.push(L)}this._pasteStore={files:k,type:d.PasteTypes.COPY},this.clipboardService.writeResources(R)},this.pasteFile=async R=>{var P,k;let F=!1,L=this.fileTreeService.getNodeByPathOrUri(R.toString());if(!L)return;let B=this.pasteStore,j=!1;if(!B){const W=await this.clipboardService.readResources();if(!W||!W.length)return;B={files:[],type:d.PasteTypes.COPY,crossFiles:W},j=!0}if(B){if(E.Directory.is(L)||(F=!0,L=L.parent),j){const W=(0,p.localize)("file.confirm.paste.ok"),U=(0,p.localize)("file.confirm.paste.cancel");if(await this.dialogService.warning((0,p.formatLocalize)("file.confirm.paste",`[ ${(P=B.crossFiles)===null||P===void 0?void 0:P.map(V=>V.displayName).join(",")} ]`,E.Directory.isRoot(L)?L.uri.displayName:L.displayName),[U,W])!==W)return}if(B.type===d.PasteTypes.CUT){for(const U of B.files)U&&this.cutDecoration.removeTarget(U),L.expanded||await L.setExpanded(!0);const W=await this.fileTreeAPI.mvFiles(B.crossFiles?B.crossFiles.map(U=>{var Q;return{url:U,isDirectory:((Q=this.fileTreeService.getNodeByPathOrUri(U))===null||Q===void 0?void 0:Q.filestat.isDirectory)||!1}}):B.files.map(U=>({url:U.uri,isDirectory:U.filestat.isDirectory})),L.uri);W&&W.length>0&&(W.forEach(U=>{this.messageService.error(U)}),this.fileTreeService.refresh()),(k=this.contextKey)===null||k===void 0||k.explorerResourceCut.set(!1),this.treeModel.dispatchChange(),this._pasteStore={files:[],type:d.PasteTypes.NONE,crossFiles:void 0}}else if(B.type===d.PasteTypes.COPY){const W=B.crossFiles?B.crossFiles:B.files.map(U=>U.uri);for(const U of W){L.uri.isEqual(U)&&!F&&(L=L.parent);const Q=L.uri.resolve(U.displayName);L.expanded||await L.setExpanded(!0);const V=await this.fileTreeAPI.copyFile(U,Q);if(V)if(V.uri){const $=new p.URI(V.uri),Y=await this.filesystem.getFileStat(U.toString());this.fileTreeService.addNode(L,$.displayName,Y?.isDirectory?c.TreeNodeType.CompositeTreeNode:c.TreeNodeType.TreeNode)}else this.messageService.error(`Error when copy file: ${U.toString()}, ${V}`)}}}},this.cutFile=async R=>{var P;R.length>0&&((P=this.contextKey)===null||P===void 0||P.explorerResourceCut.set(!0)),this._pasteStore&&this._pasteStore.type===d.PasteTypes.CUT&&this._pasteStore.files.forEach(F=>{this.cutDecoration.removeTarget(F)});const k=[];for(const F of R){const L=this.fileTreeService.getNodeByPathOrUri(F);L&&k.push(L)}this._pasteStore={files:k,type:d.PasteTypes.CUT};for(const F of k)F&&this.cutDecoration.addTarget(F);this.treeModel.dispatchChange()},this.location=async R=>{if(await this.whenReady,!this.fileTreeService.filterMode)return this._fileToLocation=R,this.locationThrottler.queue(this.doLocation)},this.doLocation=async()=>{if(!this._fileToLocation)return;const R=this._fileToLocation;let P;if(typeof R=="string"?P=R:P=await this.fileTreeService.getFileTreeNodePathByUri(R),P){if(!this.fileTreeHandle)return;const k=await this.fileTreeHandle.ensureVisible(P,"center",!0);k&&this.selectFileDecoration(k)}this._fileToLocation=void 0},this.locationOnShow=R=>{this._nextLocationTarget=R},this.performLocationOnHandleShow=async()=>{this._nextLocationTarget&&(await this.location(this._nextLocationTarget),this._nextLocationTarget=void 0)}}get onDidFocusedFileChange(){return this.onDidFocusedFileChangeEmitter.event}get onDidContextMenuFileChange(){return this.onDidContextMenuFileChangeEmitter.event}get onDidSelectedFileChange(){return this.onDidSelectedFileChangeEmitter.event}get onFileTreeModelChange(){return this.onFileTreeModelChangeEmitter.event}get fileTreeHandle(){return this._fileTreeHandle}get decorations(){return this._decorations}get treeModel(){return this._treeModel}get dndService(){return this._dndService}get whenReady(){return this._whenReady.promise}get focusedFile(){return this._focusedFile}set focusedFile(R){this.onDidFocusedFileChangeEmitter.fire(R?R.uri:void 0),this._focusedFile=R}get contextMenuFile(){return this._contextMenuFile}set contextMenuFile(R){this.onDidContextMenuFileChangeEmitter.fire(R?R.uri:void 0),this._contextMenuFile=R}get selectedFiles(){return this._selectedFiles}set selectedFiles(R){this.onDidSelectedFileChangeEmitter.fire(R?R.map(P=>P.uri):[]),this._selectedFiles=R}get activeUri(){return this._activeUri}get pasteStore(){return this._pasteStore}get explorerStorage(){return this._explorerStorage}get currentRelativeUriContextKey(){return this._currentRelativeUriContextKey||(this._currentRelativeUriContextKey=this.fileTreeService.contextMenuContextKeyService.createKey("filetreeContextRelativeUri","")),this._currentRelativeUriContextKey}get currentContextUriContextKey(){return this._currentContextUriContextKey||(this._currentContextUriContextKey=this.fileTreeService.contextMenuContextKeyService.createKey("filetreeContextUri","")),this._currentContextUriContextKey}get contextMenuResourceContext(){return this._contextMenuResourceContext||(this._contextMenuResourceContext=new v.ResourceContextKey(this.fileTreeService.contextMenuContextKeyService)),this._contextMenuResourceContext}get contextKey(){return this.fileTreeService.contextKey}get initTreeModelReady(){return this._initTreeModelReady}async initTreeModel(){this._initTreeModelReady=!1;const R=(await this.fileTreeService.resolveChildren())[0];if(!R){this._whenReady.resolve();return}this._treeModel=this.injector.get(f.FileTreeModel,[R]),this.initDecorations(R),this._dndService=this.injector.get(A.DragAndDropService,[this]),this.treeStateWatcher=this._treeModel.getTreeStateWatcher(!0),this.disposableCollection.push(this.fileTreeService.onNodeRefreshed(()=>{this.initTreeModelReady&&(this.refreshedActionDelayer.isTriggered()||this.refreshedActionDelayer.cancel(),this.refreshedActionDelayer.trigger(async()=>{if(this.selectedFiles.length===0){const k=this.editorService.currentEditor;k&&k.currentUri&&this.location(k.currentUri)}this.fileTreeService.isCompactMode||(this._activeUri=null)}))})),this.disposableCollection.push(this.fileTreeService.onWorkspaceChange(()=>{this.disposableCollection.dispose(),this.initTreeModel()})),this.disposableCollection.push(this.labelService.onDidChange(async()=>{this.initTreeModelReady&&(this.labelChangedDelayer.isTriggered()||this.labelChangedDelayer.cancel(),this.labelChangedDelayer.trigger(async()=>{this.fileTreeService.refresh()}))})),this.disposableCollection.push(this.treeModel.root.watcher.on(c.TreeNodeEvent.WillResolveChildren,k=>{this.loadingDecoration.addTarget(k),this.treeModel.dispatchChange()})),this.disposableCollection.push(this.treeModel.root.watcher.on(c.TreeNodeEvent.DidResolveChildren,k=>{this.loadingDecoration.clearAppliedTarget(),this.treeModel.dispatchChange()})),this._explorerStorage=await this.storageProvider(p.STORAGE_NAMESPACE.EXPLORER);const P=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY);P&&await this.loadFileTreeSnapshot(P),this.disposableCollection.push(this.treeStateWatcher.onDidChange(()=>{if(!this._initTreeModelReady)return;const k=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),F=this.treeStateWatcher.snapshot();this.explorerStorage.set(n.FILE_TREE_SNAPSHOT_KEY,{...k,...F})})),this.fileTreeService.startWatchFileEvent(),this.onFileTreeModelChangeEmitter.fire(this._treeModel),this._whenReady.resolve(),this._initTreeModelReady=!0}initDecorations(R){this._decorations=new c.DecorationsManager(R),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.contextMenuDecoration),this._decorations.addDecoration(this.cutDecoration),this._decorations.addDecoration(this.loadingDecoration)}setFileTreeContextKey(R){var P;this.currentContextUriContextKey.set(R.uri.toString()),this.currentRelativeUriContextKey.set((this.treeModel.root.uri.relative(R.uri)||"").toString()),this.contextMenuResourceContext.set(R.uri),(P=this.contextKey)===null||P===void 0||P.explorerResourceIsFolder.set(R&&R.type===c.TreeNodeType.CompositeTreeNode)}async loadFileTreeSnapshot(R){await this._treeModel.loadTreeState(R)}updateExplorerCompressedContextKey(R,P){var k,F,L,B,j,W,U,Q,V,$,Y,H,z,K,Z,X;if(R&&P){(k=this.contextKey)===null||k===void 0||k.explorerCompressedFocusContext.set(!0);const ie=new S(R.name);ie.name===P.displayName?((F=this.contextKey)===null||F===void 0||F.explorerCompressedLastFocusContext.set(!0),(L=this.contextKey)===null||L===void 0||L.explorerCompressedFirstFocusContext.set(!1)):ie.root&&ie.root.name===P.displayName?((B=this.contextKey)===null||B===void 0||B.explorerCompressedLastFocusContext.set(!1),(j=this.contextKey)===null||j===void 0||j.explorerCompressedFirstFocusContext.set(!0)):((W=this.contextKey)===null||W===void 0||W.explorerCompressedLastFocusContext.set(!1),(U=this.contextKey)===null||U===void 0||U.explorerCompressedFirstFocusContext.set(!1))}else R?R.name.indexOf(S.separator)>0?((Q=this.contextKey)===null||Q===void 0||Q.explorerCompressedFocusContext.set(!0),(V=this.contextKey)===null||V===void 0||V.explorerCompressedFirstFocusContext.set(!1),($=this.contextKey)===null||$===void 0||$.explorerCompressedLastFocusContext.set(!0)):((Y=this.contextKey)===null||Y===void 0||Y.explorerCompressedFocusContext.set(!1),(H=this.contextKey)===null||H===void 0||H.explorerCompressedFirstFocusContext.set(!1),(z=this.contextKey)===null||z===void 0||z.explorerCompressedLastFocusContext.set(!1)):((K=this.contextKey)===null||K===void 0||K.explorerCompressedFocusContext.set(!1),(Z=this.contextKey)===null||Z===void 0||Z.explorerCompressedFirstFocusContext.set(!1),(X=this.contextKey)===null||X===void 0||X.explorerCompressedLastFocusContext.set(!1))}handleTreeHandler(R){this._fileTreeHandle=R}toggleOrOpenCurrentFile(){let R;this.focusedFile?R=this.focusedFile:this.contextMenuFile&&(R=this.contextMenuFile),R&&(this.activeFileDecoration(R),E.Directory.is(R)?this.toggleDirectory(R):this.fileTreeService.openFile(R.uri))}moveToNext(){let R;if(this.focusedFile?R=this.focusedFile:this.contextMenuFile&&(R=this.contextMenuFile),!R)return;const k=this.treeModel.root.getIndexAtTreeNode(R)+1,F=this.treeModel.root.getTreeNodeAtIndex(k),L=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),B=(k+1)*l.FILE_TREE_NODE_HEIGHT-(L.scrollPosition||0),{height:j}=this.fileTreeHandle.getCurrentSize();F&&(this.activateFileFocusedDecoration(F),B>j&&this.fileTreeHandle.ensureVisible(F,"end"))}moveToPrev(){let R;if(this.focusedFile?R=this.focusedFile:this.contextMenuFile&&(R=this.contextMenuFile),!R)return;const P=this.treeModel.root.getIndexAtTreeNode(R);if(P===0)return;const k=P-1,F=this.treeModel.root.getTreeNodeAtIndex(k);if(!F)return;const L=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),B=k*l.FILE_TREE_NODE_HEIGHT;this.activateFileFocusedDecoration(F),(L.scrollPosition||0)>B&&this.fileTreeHandle.ensureVisible(F,"start")}async collapseCurrentFile(){let R;this.focusedFile?(R=this.focusedFile,this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0):this.contextMenuFile&&(R=this.contextMenuFile,this.focusedDecoration.removeTarget(this.contextMenuFile),this.contextMenuFile=void 0);const P=this.selectedFiles.indexOf(R);P>=0&&(this.selectedFiles.splice(P,1),this.selectedDecoration.removeTarget(R));let k;if(E.Directory.is(R)&&R.expanded)k=R;else if(R)E.Directory.isRoot(R.parent)?k=R:k=R.parent;else return;this.focusedFile=k,k&&k.expanded&&(await this.fileTreeHandle.collapseNode(k),this.activeFileFocusedDecoration(k,!0))}async expandCurrentFile(){let R;this.focusedFile?(R=this.focusedFile,this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0):this.contextMenuFile&&(R=this.contextMenuFile,this.focusedDecoration.removeTarget(this.contextMenuFile),this.contextMenuFile=void 0);const P=this.selectedFiles.indexOf(R);P>=0&&(this.selectedFiles.splice(P,1),this.selectedDecoration.removeTarget(R)),this.focusedFile=R,E.Directory.is(R)&&(R.expanded||await this.fileTreeHandle.expandNode(R))}async collapseAll(){await this.treeModel.root.collapsedAll();const R=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY);R&&this.explorerStorage.set(n.FILE_TREE_SNAPSHOT_KEY,{...R,expandedDirectories:{atSurface:[],buried:[]}})}async deleteFileByUris(R){var P;if(R.length===0)return;if(this.corePreferences["explorer.confirmDelete"]){const B=this.applicationService.backendOS===p.OperatingSystem.Linux,j=B?(0,p.localize)("file.confirm.delete.ok"):(0,p.localize)("file.confirm.moveToTrash.ok"),W=(0,p.localize)("file.confirm.delete.cancel"),U=10;let Q=R.slice(0,U).map($=>$.displayName).join(`
|
|
31634
31634
|
`);if(R.length>U&&(Q+=`
|
|
31635
31635
|
...`),B||(Q+=`
|
|
31636
31636
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensumi/cli-engine",
|
|
3
|
-
"version": "3.8.3-next-
|
|
3
|
+
"version": "3.8.3-next-1745307078.0",
|
|
4
4
|
"description": "Integration engine runtime for opensumi-cli and opensumi extension",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@koa/cors": "^5.0.0",
|
|
28
28
|
"@opensumi/di": "^1.8.0",
|
|
29
|
-
"@opensumi/ide-core-browser": "3.8.3-next-
|
|
30
|
-
"@opensumi/ide-core-common": "3.8.3-next-
|
|
31
|
-
"@opensumi/ide-core-node": "3.8.3-next-
|
|
32
|
-
"@opensumi/ide-express-file-server": "3.8.3-next-
|
|
33
|
-
"@opensumi/ide-extension": "3.8.3-next-
|
|
34
|
-
"@opensumi/ide-i18n": "3.8.3-next-
|
|
35
|
-
"@opensumi/ide-main-layout": "3.8.3-next-
|
|
36
|
-
"@opensumi/ide-startup": "3.8.3-next-
|
|
29
|
+
"@opensumi/ide-core-browser": "3.8.3-next-1745307078.0",
|
|
30
|
+
"@opensumi/ide-core-common": "3.8.3-next-1745307078.0",
|
|
31
|
+
"@opensumi/ide-core-node": "3.8.3-next-1745307078.0",
|
|
32
|
+
"@opensumi/ide-express-file-server": "3.8.3-next-1745307078.0",
|
|
33
|
+
"@opensumi/ide-extension": "3.8.3-next-1745307078.0",
|
|
34
|
+
"@opensumi/ide-i18n": "3.8.3-next-1745307078.0",
|
|
35
|
+
"@opensumi/ide-main-layout": "3.8.3-next-1745307078.0",
|
|
36
|
+
"@opensumi/ide-startup": "3.8.3-next-1745307078.0",
|
|
37
37
|
"chalk": "^4.1.2",
|
|
38
38
|
"ejs": "^3.1.7",
|
|
39
39
|
"ip": "^1.1.8",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"webpack": "^5.90.0",
|
|
73
73
|
"webpack-cli": "^5.1.4"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "6be07dd80cb89b402ca94fff0b476ba87c603f58"
|
|
76
76
|
}
|