@opensumi/cli-engine 3.5.1-next-1733450080.0 → 3.5.1-next-1733458435.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.
@@ -28225,7 +28225,7 @@ Tokenizing line: ${R}`);for(let W=0;W<B.tokens.length;W++){const V=B.tokens[W];F
28225
28225
 
28226
28226
  `),this}appendMarkdown(d){return this.value+=d,this}appendCodeblock(d,h){return this.value+="\n```",this.value+=d,this.value+=`
28227
28227
  `,this.value+=h,this.value+="\n```\n",this}}e.MarkdownString=b;function g(E){return E instanceof b?!0:E&&typeof E=="object"?typeof E.value=="string"&&(typeof E.isTrusted=="boolean"||E.isTrusted===void 0)&&(typeof E.supportThemeIcons=="boolean"||E.supportThemeIcons===void 0):!1}function _(E){const d=[],h=E.split("|").map(r=>r.trim());E=h[0];const c=h[1];if(c){const r=/height=(\d+)/.exec(c),l=/width=(\d+)/.exec(c),a=r?r[1]:"",u=l?l[1]:"",m=isFinite(parseInt(u,10)),f=isFinite(parseInt(a,10));m&&d.push(`width="${u}"`),f&&d.push(`height="${a}"`)}return{href:E,dimensions:d}}},53886:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=t(85608);n.__exportStar(t(84811),e),n.__exportStar(t(38677),e),n.__exportStar(t(32112),e),n.__exportStar(t(58063),e),n.__exportStar(t(3484),e),n.__exportStar(t(84569),e),n.__exportStar(t(92771),e),n.__exportStar(t(87330),e)},32112:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},58063:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3484:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},92771:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},51418:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},73294:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},50288:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},37846:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.knownProtocols=void 0;const n=t(11431),s=t(46147);e.knownProtocols=new Map,e.knownProtocols.set(s.ExtHostAPIIdentifier.ExtHostDocuments,n.ExtensionDocumentProtocol)},35250:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ObjectIdentifier=void 0;var t;(function(n){n.name="$ident";function s(p,b){return Object.defineProperty(p,n.name,{value:b,enumerable:!0}),p}n.mixin=s;function o(p){return p[n.name]}n.of=o})(t||(e.ObjectIdentifier=t={}))},16363:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},70858:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isLittleEndian=b,e.encodeSemanticTokensDto=g,e.decodeSemanticTokensDto=E;function t(d){for(let h=0,c=d.length;h<c;h+=4){const r=d[h+0],l=d[h+1],a=d[h+2],u=d[h+3];d[h+0]=u,d[h+1]=a,d[h+2]=l,d[h+3]=r}}function n(d){const h=new Uint8Array(d.buffer,d.byteOffset,d.length*4);return b()||t(h),h}function s(d){const h=d;if(b()||t(h),h.byteOffset%4===0)return new Uint32Array(h.buffer,h.byteOffset,h.length/4);{const c=new Uint8Array(h.byteLength);return c.set(h),new Uint32Array(c.buffer,c.byteOffset,c.length/4)}}let o=!0,p=!1;function b(){if(!p){p=!0;const d=new Uint8Array(2);d[0]=1,d[1]=2,o=new Uint16Array(d.buffer)[0]===513}return o}function g(d){const h=new Uint32Array(_(d));let c=0;if(h[c++]=d.id,d.type==="full")h[c++]=1,h[c++]=d.data.length,h.set(d.data,c),c+=d.data.length;else{h[c++]=2,h[c++]=d.deltas.length;for(const r of d.deltas)h[c++]=r.start,h[c++]=r.deleteCount,r.data?(h[c++]=r.data.length,h.set(r.data,c),c+=r.data.length):h[c++]=0}return n(h)}function _(d){let h=0;if(h+=2,d.type==="full")h+=1+d.data.length;else{h+=1,h+=3*d.deltas.length;for(const c of d.deltas)c.data&&(h+=c.data.length)}return h}function E(d){const h=s(d);let c=0;const r=h[c++];if(h[c++]===1){const m=h[c++],f=h.subarray(c,c+m);return c+=m,{id:r,type:"full",data:f}}const a=h[c++],u=[];for(let m=0;m<a;m++){const f=h[c++],v=h[c++],y=h[c++];let S;y>0&&(S=h.subarray(c,c+y),c+=y),u[m]={start:f,deleteCount:v,data:S}}return{id:r,type:"delta",deltas:u}}},29490:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},89225:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.startsWith=t,e.endsWith=n,e.isLowerAsciiLetter=s,e.isUpperAsciiLetter=o,e.equalsIgnoreCase=b,e.escapeRegExpCharacters=_,e.startsWithIgnoreCase=E;function t(d,h){if(d.length<h.length)return!1;if(d===h)return!0;for(let c=0;c<h.length;c++)if(d[c]!==h[c])return!1;return!0}function n(d,h){const c=d.length-h.length;return c>0?d.indexOf(h,c)===c:c===0?d===h:!1}function s(d){return d>=97&&d<=122}function o(d){return d>=65&&d<=90}function p(d){return s(d)||o(d)}function b(d,h){const c=d?d.length:0,r=h?h.length:0;return c!==r?!1:g(d,h)}function g(d,h,c=d.length){if(typeof d!="string"||typeof h!="string")return!1;for(let r=0;r<c;r++){const l=d.charCodeAt(r),a=h.charCodeAt(r);if(l!==a){if(p(l)&&p(a)){const u=Math.abs(l-a);if(u!==0&&u!==32)return!1}else if(String.fromCharCode(l).toLowerCase()!==String.fromCharCode(a).toLowerCase())return!1}}return!0}function _(d){return d.replace(/[-\\{}*+?|^$.[\]()#]/g,"\\$&")}function E(d,h){const c=h.length;return h.length>d.length?!1:g(d,h,c)}},54741:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TaskFilterDTO=void 0;var t;(function(n){function s(p){return p}n.from=s;function o(p){if(p)return Object.assign(Object.create(null),p)}n.to=o})(t||(e.TaskFilterDTO=t={}))},25535:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},54056:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TestItemRootImpl=e.TestItemImpl=e.MixedTestItemController=e.InvalidTestItemError=e.DuplicateTestItemError=e.diffTestItems=e.getPrivateApiFor=e.createPrivateApiFor=void 0;const t=new WeakMap,n=(u,m)=>{const f={controllerId:m};return t.set(u,f),f};e.createPrivateApiFor=n;const s=u=>t.get(u);e.getPrivateApiFor=s;const o=(u,m,f,v)=>{let y=f;return{enumerable:!0,configurable:!1,get(){return y},set(S){var A;if(!v(y,S)){const T=y;y=S,(A=u.listener)===null||A===void 0||A.call(u,{op:3,key:m,value:S,previous:T})}}}},p=(u,m)=>u===m,b={range:(u,m)=>u===m?!0:!u||!m?!1:u.isEqual(m),label:p,description:p,sortText:p,busy:p,error:p,canResolveChildren:p,tags:(u,m)=>!(u.length!==m.length||u.some(f=>!m.find(v=>f.id===v.id)))},g=Object.keys(b),_=(u,m)=>({range:o(u,"range",void 0,b.range),label:o(u,"label",m,b.label),description:o(u,"description",void 0,b.description),sortText:o(u,"sortText",void 0,b.sortText),canResolveChildren:o(u,"canResolveChildren",!1,b.canResolveChildren),busy:o(u,"busy",!1,b.busy),error:o(u,"error",void 0,b.error),tags:o(u,"tags",[],b.tags)}),E=(u,m)=>{const f=new Map;for(const v of g){const y=b[v];y(u[v],m[v])||f.set(v,m[v])}return f};e.diffTestItems=E;class d extends Error{constructor(m){super(`Attempted to insert a duplicate test item ID ${m}`)}}e.DuplicateTestItemError=d;class h extends Error{constructor(m){super(`TestItem with ID "${m}" is invalid. Make sure to create it from the createTestItem method.`)}}e.InvalidTestItemError=h;class c extends Error{constructor(m,f,v){super(`TestItem with ID "${m}" is from controller "${f}" and cannot be added as a child of an item from controller "${v}".`)}}e.MixedTestItemController=c;const r=u=>{const m=(0,e.getPrivateApiFor)(u);let f=new Map;return{get size(){return f.size},forEach(v,y){for(const S of f.values())v.call(y,S,this)},replace(v){var y;const S=new Map,A=new Set(f.keys()),T={op:4,ops:[]};for(const D of v){if(!(D instanceof l))throw new h(D.id);const w=(0,e.getPrivateApiFor)(D).controllerId;if(w!==m.controllerId)throw new c(D.id,w,m.controllerId);if(S.has(D.id))throw new d(D.id);S.set(D.id,D),A.delete(D.id),T.ops.push({op:0,item:D})}for(const D of A.keys())T.ops.push({op:1,id:D});(y=m.listener)===null||y===void 0||y.call(m,T),f=S},add(v){var y;if(!(v instanceof l))throw new h(v.id);f.set(v.id,v),(y=m.listener)===null||y===void 0||y.call(m,{op:0,item:v})},delete(v){var y;f.delete(v)&&((y=m.listener)===null||y===void 0||y.call(m,{op:1,id:v}))},get(v){return f.get(v)},toJSON(){return Array.from(f.values())},[Symbol.iterator](){return f.values()}}};class l{constructor(m,f,v,y){if(f.includes("\0"))throw new Error(`Test IDs may not include the ${JSON.stringify(f)} symbol`);const S=(0,e.createPrivateApiFor)(this,m);Object.defineProperties(this,{id:{value:f,enumerable:!0,writable:!1},uri:{value:y,enumerable:!0,writable:!1},parent:{enumerable:!1,get(){return S.parent instanceof a?void 0:S.parent}},children:{value:r(this),enumerable:!0,writable:!1},..._(S,v)})}invalidateResults(){var m,f;(f=(m=(0,e.getPrivateApiFor)(this)).listener)===null||f===void 0||f.call(m,{op:2})}}e.TestItemImpl=l;class a extends l{constructor(m,f){super(m,m,f,void 0)}}e.TestItemRootImpl=a},82086:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4809:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},86162:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TreeviewsService=e.ITreeViewsService=e.TreeViewSelection=e.TreeViewItem=void 0;class t{}e.TreeViewItem=t;var n;(function(o){function p(b){return!!b&&typeof b=="object"&&"treeViewId"in b&&"treeItemId"in b}o.is=p})(n||(e.TreeViewSelection=n={})),e.ITreeViewsService=Symbol("ITreeViewsService");class s{constructor(){this._dragOperations=new Map,this._renderedElements=new Map}removeDragOperationTransfer(p){if(p&&this._dragOperations.has(p)){const b=this._dragOperations.get(p);return this._dragOperations.delete(p),b}}addDragOperationTransfer(p,b){this._dragOperations.set(p,b)}getRenderedTreeElement(p){if(this._renderedElements.has(p))return this._renderedElements.get(p)}addRenderedTreeItemElement(p,b){this._renderedElements.set(p,b)}removeRenderedTreeItemElement(p){this._renderedElements.has(p)&&this._renderedElements.delete(p)}}e.TreeviewsService=s},64945:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},43710:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isObject=o,e.mixin=p,e.illegalArgument=b,e.isLocationArray=g,e.isDefinitionLinkArray=_,e.reviveRegExp=E,e.reviveIndentationRule=d,e.reviveOnEnterRule=h,e.reviveOnEnterRules=c,e.serializeEnterRules=r,e.serializeRegExp=l,e.serializeIndentation=a,e.serializeAutoClosingPairs=u;const s=t(85608).__importStar(t(51328));function o(m){return typeof m=="object"&&m!==null&&!Array.isArray(m)&&!(m instanceof RegExp)&&!(m instanceof Date)}function p(m,f,v=!0){return o(m)?(o(f)&&Object.keys(f).forEach(y=>{y in m?v&&(o(m[y])&&o(f[y])?p(m[y],f[y],v):m[y]=f[y]):m[y]=f[y]}),m):f}function b(m){return m?new Error(`Illegal argument: ${m}`):new Error("Illegal argument")}function g(m){return Array.isArray(m)&&m.length>0&&m[0]instanceof s.Location}function _(m){return Array.isArray(m)&&m.length>0&&m[0].hasOwnProperty("targetUri")&&m[0].hasOwnProperty("targetRange")}function E(m){if(!(typeof m>"u"||m===null))return new RegExp(m.pattern,m.flags)}function d(m){if(!(typeof m>"u"||m===null))return{increaseIndentPattern:E(m.increaseIndentPattern),decreaseIndentPattern:E(m.decreaseIndentPattern),indentNextLinePattern:E(m.indentNextLinePattern),unIndentedLinePattern:E(m.unIndentedLinePattern)}}function h(m){return{beforeText:E(m.beforeText),afterText:E(m.afterText),action:m.action,previousLineText:E(m.previousLineText)}}function c(m){if(!(typeof m>"u"||m===null))return m.map(h)}function r(m){if(!(typeof m>"u"||m===null))return m.map(f=>({action:f.action,beforeText:l(f.beforeText),afterText:l(f.afterText),previousLineText:l(f.previousLineText)}))}function l(m){if(!(typeof m>"u"||m===null))return{pattern:m.source,flags:(m.global?"g":"")+(m.ignoreCase?"i":"")+(m.multiline?"m":"")}}function a(m){if(!(typeof m>"u"||m===null))return{increaseIndentPattern:l(m.increaseIndentPattern),decreaseIndentPattern:l(m.decreaseIndentPattern),indentNextLinePattern:l(m.indentNextLinePattern),unIndentedLinePattern:l(m.unIndentedLinePattern)}}function u(m){if(m)return m.map(f=>({open:f.open,close:f.close,notIn:f.notIn?f.notIn.map(v=>s.SyntaxTokenType.toString(v)):void 0}))}},96833:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},98116:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebviewViewResolverRegistrationRemovalEvent=e.WebviewViewResolverRegistrationEvent=void 0;const n=t(43718);class s extends n.BasicEvent{}e.WebviewViewResolverRegistrationEvent=s;class o extends n.BasicEvent{}e.WebviewViewResolverRegistrationRemovalEvent=o},55467:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},92622:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationTarget=void 0,e.reviveWorkspaceEditDto=o;const n=t(43718);var s;(function(p){p[p.Global=1]="Global",p[p.Workspace=2]="Workspace",p[p.WorkspaceFolder=3]="WorkspaceFolder"})(s||(e.ConfigurationTarget=s={}));function o(p){if(p&&p.edits)for(const b of p.edits)if(typeof b.resource=="object")b.resource=n.URI.from(b.resource),b.options={openDirtyInEditor:!0},b.textEdit=b.textEdit,b.versionId=b.versionId;else{const g=b;g.newResource=b.newResource?n.URI.from(b.newResource):void 0,g.oldResource=b.oldResource?n.URI.from(b.oldResource):void 0,g.options={...g.options,showInEditor:!1}}return p}},57646:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BinaryEditorComponent=void 0;const s=t(85608).__importDefault(t(14041)),o=t(76003),p=t(41869),b=t(37406),g=t(57517),_=t(88819),E=d=>{const h=d.resource.uri.codeUri.fsPath,c=(0,p.useInjectable)(o.INJECTOR_TOKEN),r=(0,p.useInjectable)(p.AppConfig),l=(0,p.useInjectable)(g.WorkbenchEditorService),a=(0,p.useInjectable)(p.IEventBus),u=()=>{const f=l.currentResource;f&&(f.metadata={...f.metadata,skipPreventBinary:!0},a.fire(new g.ResourceOpenTypeChangedEvent(f.uri)))},m=[{label:(0,p.localize)("editor.file.prevent.stillOpen"),onClick:()=>u()}];return r.isElectronRenderer&&m.push({label:(0,p.localize)("editor.openExternal"),onClick:()=>c.get(b.IElectronMainUIService).openPath(h)}),s.default.createElement(_.PreventComponent,{description:(0,p.localize)("editor.cannotOpenBinary"),actions:m})};e.BinaryEditorComponent=E},60387:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WalkThroughSnippetSchemeDocumentProvider=e.VscodeSchemeDocumentProvider=e.FileSchemeDocumentProvider=void 0;const n=t(85608),s=t(76003),o=t(41869),p=t(96405),b=t(68692),g=t(14951),_=t(80449);let E=class extends b.BaseFileSystemEditorDocumentProvider{handlesUri(r){return r.scheme===o.Schemes.file?20:-1}handlesScheme(){return!1}provideEncoding(r){return super.provideEncoding(r)}preferLanguageForUri(r){if(["settings.json"].includes(r.path.base))return"jsonc"}async saveDocumentModel(r,l,a,u,m,f=!1,v=`
28228
- `,y){const S=this.hashCalculateService.calculate(a);return l.length>_.FILE_SAVE_BY_CHANGE_THRESHOLD?await this.fileSchemeDocClient.saveByChange(r.toString(),{baseMd5:S,changes:u,eol:v},m,f,y):await this.fileSchemeDocClient.saveByContent(r.toString(),{baseMd5:S,content:l},m,f,y)}async provideEditorDocumentModelContentMd5(r,l){return this.fileSchemeDocClient.getMd5(r.toString(),l)}};e.FileSchemeDocumentProvider=E,n.__decorate([(0,s.Autowired)(g.IFileServiceClient),n.__metadata("design:type",Object)],E.prototype,"fileServiceClient",void 0),n.__decorate([(0,s.Autowired)(_.IFileSchemeDocClient),n.__metadata("design:type",Object)],E.prototype,"fileSchemeDocClient",void 0),n.__decorate([(0,s.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],E.prototype,"preferenceService",void 0),n.__decorate([(0,s.Autowired)(p.IHashCalculateService),n.__metadata("design:type",Object)],E.prototype,"hashCalculateService",void 0),e.FileSchemeDocumentProvider=E=n.__decorate([(0,s.Injectable)()],E);let d=class{constructor(){this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event,this.listeners={}}isReadonly(r){return!0}handlesScheme(r){return r==="vscode"}async provideEditorDocumentModelContent(r,l){return this.getSchemaContent(r)}getSchemaContent(r){const l=r.toString(),a=this.jsonRegistry.getSchemaContributions().schemas[l];if(a){const u=JSON.stringify(a);if(!this.listeners[l]){const m=o.Disposable.create(()=>{this.jsonRegistry.onDidChangeSchema(f=>{f===l&&this._onDidChangeContent.fire(r)})});this.listeners[l]=m}return u}return"{}"}onDidDisposeModel(r){r.toString()&&(this.listeners[r.toString()].dispose(),delete this.listeners[r.toString()])}};e.VscodeSchemeDocumentProvider=d,n.__decorate([(0,s.Autowired)(o.ISchemaStore),n.__metadata("design:type",Object)],d.prototype,"schemaStore",void 0),n.__decorate([(0,s.Autowired)(o.IJSONSchemaRegistry),n.__metadata("design:type",Object)],d.prototype,"jsonRegistry",void 0),e.VscodeSchemeDocumentProvider=d=n.__decorate([(0,s.Injectable)()],d);let h=class{constructor(){this.documentContentMaps=new Map,this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event}handlesScheme(r){return r===o.Schemes.walkThroughSnippet}provideEditorDocumentModelContent(r,l){return this.documentContentMaps.has(r.toString())||this.documentContentMaps.set(r.toString(),""),this.documentContentMaps.get(r.toString())}isReadonly(){return!1}preferLanguageForUri(){return"plaintext"}};e.WalkThroughSnippetSchemeDocumentProvider=h,e.WalkThroughSnippetSchemeDocumentProvider=h=n.__decorate([(0,s.Injectable)()],h)},41352:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileSchemeDocClientService=void 0;const n=t(85608),s=t(76003),o=t(80449);let p=class{saveByChange(g,_,E,d,h){return this.fileDocBackendService.$saveByChange(g,_,E,d,h)}saveByContent(g,_,E,d,h){return this.fileDocBackendService.$saveByContent(g,_,E,d,h)}getMd5(g,_){return this.fileDocBackendService.$getMd5(g,_)}};e.FileSchemeDocClientService=p,n.__decorate([(0,s.Autowired)(o.FileSchemeDocNodeServicePath),n.__metadata("design:type",Object)],p.prototype,"fileDocBackendService",void 0),e.FileSchemeDocClientService=p=n.__decorate([(0,s.Injectable)()],p)},17276:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileSystemEditorComponentContribution=e.FileSystemEditorResourceContribution=void 0;const n=t(85608),s=t(76003),o=t(41869),p=t(26542),b=t(57517),g=t(17878),_=t(42933),E=t(57646),d=t(60387),h=t(88819),c=t(99025),r="video-preview",l="image-preview",a="external-file",u="large-file-prevent";let m=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)}};e.FileSystemEditorResourceContribution=m,n.__decorate([(0,s.Autowired)(),n.__metadata("design:type",d.FileSchemeDocumentProvider)],m.prototype,"fileSchemeDocumentProvider",void 0),n.__decorate([(0,s.Autowired)(),n.__metadata("design:type",d.VscodeSchemeDocumentProvider)],m.prototype,"vscodeSchemeDocumentProvider",void 0),n.__decorate([(0,s.Autowired)(),n.__metadata("design:type",d.WalkThroughSnippetSchemeDocumentProvider)],m.prototype,"walkThroughSnippetSchemeDocumentProvider",void 0),n.__decorate([(0,s.Autowired)(),n.__metadata("design:type",g.UntitledSchemeResourceProvider)],m.prototype,"untitledResourceProvider",void 0),n.__decorate([(0,s.Autowired)(),n.__metadata("design:type",g.UntitledSchemeDocumentProvider)],m.prototype,"untitledSchemeDocumentProvider",void 0),e.FileSystemEditorResourceContribution=m=n.__decorate([(0,o.Domain)(b.BrowserEditorContribution)],m);let f=class{constructor(){this.cachedFileType=new o.LRUMap(200,100),this.fileServiceClient.onFilesChanged(y=>{y.forEach(S=>{this.cachedFileType.delete(S.uri.toString())})})}registerEditorComponent(y){y.registerEditorComponent({component:c.ImagePreview,uid:l,scheme:o.Schemes.file}),y.registerEditorComponent({component:c.VideoPreview,uid:r,scheme:o.Schemes.file}),y.registerEditorComponent({component:E.BinaryEditorComponent,uid:a,scheme:o.Schemes.file}),y.registerEditorComponent({component:h.LargeFilePrevent,uid:u,scheme:o.Schemes.file}),y.registerEditorComponentResolver(S=>S===o.Schemes.file||this.fileServiceClient.handlesScheme(S)?10:-1,(S,A)=>{A.length===0&&A.push({type:b.EditorOpenType.component,componentId:a})}),y.registerEditorComponentResolver(S=>S===o.Schemes.file||this.fileServiceClient.handlesScheme(S)?10:-1,async(S,A)=>{const T=await this.getFileType(S.uri.toString());switch(T){case"image":{A.push({type:b.EditorOpenType.component,componentId:l});break}case"video":{A.push({type:b.EditorOpenType.component,componentId:r});break}case"binary":case"text":{const{metadata:D,uri:w}=S,I=D||{};if(T==="binary"&&!I.skipPreventBinary)break;const R=await this.fileServiceClient.getFileStat(w.toString());await this.preference.ready;const M=this.preference.getValid("editor.largeFile",4*1024*1024*1024);R&&(R.size||0)>M&&!I.skipPreventTooLarge?A.push({type:b.EditorOpenType.component,componentId:u}):A.push({type:b.EditorOpenType.code,title:(0,o.localize)("editorOpenType.code")});break}}}),y.registerEditorComponentResolver(o.Schemes.untitled,(S,A,T)=>{T([{type:b.EditorOpenType.code,priority:"default"}])})}async getFileType(y){return this.cachedFileType.has(y)||((0,p.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"}}};e.FileSystemEditorComponentContribution=f,n.__decorate([(0,s.Autowired)(_.IFileServiceClient),n.__metadata("design:type",Object)],f.prototype,"fileServiceClient",void 0),n.__decorate([(0,s.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],f.prototype,"preference",void 0),e.FileSystemEditorComponentContribution=f=n.__decorate([(0,o.Domain)(b.BrowserEditorContribution),n.__metadata("design:paramtypes",[])],f)},52568:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileSchemeModule=void 0;const n=t(85608),s=t(76003),o=t(41869),p=t(80449),b=t(41352),g=t(17276);let _=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[g.FileSystemEditorResourceContribution,g.FileSystemEditorComponentContribution,{token:p.IFileSchemeDocClient,useClass:b.FileSchemeDocClientService}],this.backServices=[{servicePath:p.FileSchemeDocNodeServicePath}]}};e.FileSchemeModule=_,e.FileSchemeModule=_=n.__decorate([(0,s.Injectable)()],_)},88819:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LargeFilePrevent=e.PreventComponent=void 0;const n=t(85608),s=n.__importDefault(t(53373)),o=n.__importDefault(t(14041)),p=t(41869),b=t(81878),g=t(54414),_=t(82196),E=n.__importDefault(t(19996)),d=c=>o.default.createElement("div",{className:E.default["error-page"]},o.default.createElement("div",{className:(0,s.default)(E.default.icon,(0,p.getExternalIcon)("warning"))}),o.default.createElement("div",{className:E.default.description},c.description),o.default.createElement("div",{className:E.default["actions-wrapper"]},c.actions.map((r,l)=>o.default.createElement(b.Button,{key:l,onClick:()=>r.onClick(),className:E.default["action-button"]},r.label))));e.PreventComponent=d;const h=()=>{const c=(0,p.useInjectable)(g.WorkbenchEditorService),r=(0,p.useInjectable)(p.IEventBus),l=()=>{const a=c.currentResource;a&&(a.metadata={...a.metadata,skipPreventTooLarge:!0},r.fire(new _.ResourceOpenTypeChangedEvent(a.uri)))};return o.default.createElement(e.PreventComponent,{description:(0,p.localize)("editor.largeFile.prevent"),actions:[{label:(0,p.localize)("editor.file.prevent.stillOpen"),onClick:()=>l()}]})};e.LargeFilePrevent=h},99025:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ImagePreview=e.VideoPreview=void 0;const n=t(85608),s=n.__importDefault(t(14041)),o=t(41869),p=t(40827),b=n.__importDefault(t(19996)),g=d=>{const h=(0,o.useInjectable)(p.StaticResourceService);return{src:s.default.useMemo(()=>h.resolveStaticResource(d.uri).toString(),[d])}},_=d=>{const{src:h}=g(d.resource);return s.default.createElement("div",{className:b.default.kt_video_preview},s.default.createElement("video",{autoPlay:!0,controls:!0,className:b.default.kt_video,src:h}))};e.VideoPreview=_;const E=d=>{const h=s.default.useRef(),c=s.default.useRef(),{src:r}=g(d.resource);return s.default.useEffect(()=>{const l=new o.Disposable;return h.current&&(h.current.src=r),()=>{l.dispose()}},[d.resource]),s.default.createElement("div",{className:b.default.kt_image_preview},s.default.createElement("div",{ref:c},s.default.createElement("img",{ref:l=>l&&(h.current=l)})))};e.ImagePreview=E},80449:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChangeType=e.FileSchemeDocNodeServicePath=e.IFileSchemeDocNodeService=e.IFileSchemeDocClient=e.FILE_SAVE_BY_CHANGE_THRESHOLD=e.FILE_ON_DISK_SCHEME=void 0,e.FILE_ON_DISK_SCHEME="fileOnDisk",e.FILE_SAVE_BY_CHANGE_THRESHOLD=1e5,e.IFileSchemeDocClient=Symbol("IFileSchemeDocClient"),e.IFileSchemeDocNodeService=Symbol("FileSchemeDocNodeService"),e.FileSchemeDocNodeServicePath="FileSchemeDocNodeService";var t;(function(n){n[n.ADDED=1]="ADDED",n[n.REMOVED=2]="REMOVED"})(t||(e.ChangeType=t={}))},15625:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IFileSearchService=e.FileSearchServicePath=void 0,e.FileSearchServicePath="FileSearchServicePath",e.IFileSearchService=Symbol("FileSearchService")},84660:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),t(85608).__exportStar(t(15625),e)},2156:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileServiceClient=e.BrowserFileSystemRegistryImpl=void 0;const n=t(85608),s=t(32852),o=t(76003),p=t(41869),b=t(43718),g=t(37406),_=t(41682),E=t(42933),d=t(81952);let h=class{constructor(){this.providers=new Map}registerFileSystemProvider(l){const a=l.scheme;return this.providers.set(a,l),{dispose:()=>{this.providers.delete(a)}}}};e.BrowserFileSystemRegistryImpl=h,e.BrowserFileSystemRegistryImpl=h=n.__decorate([(0,o.Injectable)()],h);let c=class{constructor(){this.watcherWithSchemaMap=new Map,this.watcherDisposerMap=new Map,this.onFileChangedEmitter=new p.Emitter,this.onFileProviderChangedEmitter=new p.Emitter,this._onFilesChanged=new p.Emitter,this.onFilesChanged=this._onFilesChanged.event,this._onFileProviderChanged=new p.Emitter,this.onFileProviderChanged=this._onFileProviderChanged.event,this._onDidChangeFileSystemProviderRegistrations=new p.Emitter,this.onDidChangeFileSystemProviderRegistrations=this._onDidChangeFileSystemProviderRegistrations.event,this._onWillActivateFileSystemProvider=new p.Emitter,this.onWillActivateFileSystemProvider=this._onWillActivateFileSystemProvider.event,this._onDidChangeFileSystemProviderCapabilities=new p.Emitter,this.onDidChangeFileSystemProviderCapabilities=this._onDidChangeFileSystemProviderCapabilities.event,this.filesExcludesMatcherList=[],this.watcherId=0,this.toDisposable=new p.DisposableCollection,this.watchFileExcludes=[],this.watchFileExcludesMatcherList=[],this.filesExcludes=[],this.workspaceRoots=[],this._providerChanged=new Set,this.fsProviders=new Map,this.userHomeDeferred=new p.Deferred,this.options={encoding:"utf8",overwrite:!1,recursive:!0,moveToTrash:!0},this.uriWatcherMap=new Map,this.toDisposable.push(this.onDidChangeFileSystemProviderRegistrations(l=>{l.added&&l.scheme===b.Schemes.file&&this.doGetCurrentUserHome()}))}async doGetCurrentUserHome(){const a=(await this.getProvider(b.Schemes.file)).getCurrentUserHome();this.userHomeDeferred.resolve(a)}handlesScheme(l){return this.registry.providers.has(l)||this.fsProviders.has(l)}dispose(){return this.toDisposable.dispose()}async resolveContent(l,a){const u=this.convertUri(l),f=await(await this.getProvider(u.scheme)).readFile(u.codeUri),v=f.data||f;return{content:p.BinaryBuffer.wrap(Uint8Array.from(v)).toString(a?.encoding)}}async readFile(l){const a=this.convertUri(l),m=await(await this.getProvider(a.scheme)).readFile(a.codeUri),f=m.data||m;return{content:p.BinaryBuffer.wrap(Uint8Array.from(f))}}async readFileStream(l){const a=this.convertUri(l);return await(await this.getProvider(a.scheme)).readFileStream(a.codeUri)}async getFileStat(l,a=!0){const u=this.convertUri(l),m=await this.getProvider(u.scheme);try{const f=await m.stat(u.codeUri);if(!f)throw E.FileSystemError.FileNotFound(u.codeUri.toString(),"File not found.");return this.filterStat(f,a)}catch(f){if(E.FileSystemError.FileNotFound.is(f))return}}async setContent(l,a,u){const m=this.convertUri(l.uri),f=await this.getProvider(m.scheme),v=await f.stat(m.codeUri);if(!v)throw E.FileSystemError.FileNotFound(l.uri,"File not found.");if(v.isDirectory)throw E.FileSystemError.FileIsADirectory(l.uri,"Cannot set the content.");if(!await this.isInSync(l,v))throw this.createOutOfSyncError(l);return await f.writeFile(m.codeUri,typeof a=="string"?p.BinaryBuffer.fromString(a).buffer:a,{create:!1,overwrite:!0,encoding:u?.encoding}),await f.stat(m.codeUri)}async updateContent(l,a,u){const m=this.convertUri(l.uri),f=await this.getProvider(m.scheme),v=await f.stat(m.codeUri);if(!v)throw E.FileSystemError.FileNotFound(l.uri,"File not found.");if(v.isDirectory)throw E.FileSystemError.FileIsADirectory(l.uri,"Cannot set the content.");if(!this.checkInSync(l,v))throw this.createOutOfSyncError(l);if(a.length===0)return v;const y=await f.readFile(m.codeUri),S=this.applyContentChanges(p.BinaryBuffer.wrap(y).toString(u?.encoding),a);await f.writeFile(m.codeUri,p.BinaryBuffer.fromString(S).buffer,{create:!1,overwrite:!0,encoding:u?.encoding});const A=await f.stat(m.codeUri);if(!A)throw E.FileSystemError.FileNotFound(m.codeUri.toString(),"File not found.");return A}async createFile(l,a){const u=this.convertUri(l),m=await this.getProvider(u.scheme),f=p.BinaryBuffer.fromString(a?.content||"").buffer;let v=await m.writeFile(u.codeUri,f,{create:!0,overwrite:a&&a.overwrite||!1,encoding:a?.encoding});return v=v||await m.stat(u.codeUri),v}async createFolder(l){const a=this.convertUri(l),u=await this.getProvider(a.scheme),m=await u.createDirectory(a.codeUri);return m||await u.stat(a.codeUri)}async move(l,a,u){const m=this.convertUri(l),f=this.convertUri(a),v=await this.getProvider(m.scheme),y=await v.rename(m.codeUri,f.codeUri,{overwrite:!!(u&&u.overwrite)});return y||await v.stat(f.codeUri)}async copy(l,a,u){const m=this.convertUri(l),f=this.convertUri(a),v=await this.getProvider(m.scheme),y=await this.doGetOverwrite(u);if(!(0,E.containsExtraFileMethod)(v,"copy"))throw this.getErrorProvideNotSupport(m.scheme,"copy");const S=await v.copy(m.codeUri,f.codeUri,{overwrite:!!y});return S||await v.stat(f.codeUri)}async getFsPath(l){if(l.startsWith("file:/"))return p.FileUri.fsPath(l)}fireFilesChange(l){const a=l.changes.map(u=>({uri:u.uri,type:u.type}));this._onFilesChanged.fire(a),this.eventBus.fire(new p.FilesChangeEvent(a))}async watchFileChanges(l,a){const m=(this.appConfig.unRecursiveDirectories||[]).some(w=>l.toString().startsWith(w)),f=this.convertUri(l.toString()),v=this.uriWatcherMap.get(f.toString());if(v)if(v.isDisposed())this.uriWatcherMap.delete(f.toString());else return v;const y=this.watcherId++,S=await this.getProvider(f.scheme),A=this.watcherWithSchemaMap.get(f.scheme)||[],T=await S.watch(f.codeUri,{excludes:a,recursive:!m});this.watcherDisposerMap.set(y,{dispose:async()=>{const w=this.uriWatcherMap.get(f.toString());await Promise.all([S.unwatch&&S.unwatch(T),w&&w.dispose()]),this.uriWatcherMap.delete(f.toString())}}),A.push(y),this.watcherWithSchemaMap.set(f.scheme,A);const D=new d.FileSystemWatcher({fileServiceClient:this,watchId:y,uri:l});return this.uriWatcherMap.set(f.toString(),D),D}async setWatchFileExcludes(l){return await(await this.getProvider(b.Schemes.file)).setWatchFileExcludes(l)}async getWatchFileExcludes(){return await(await this.getProvider(b.Schemes.file)).getWatchFileExcludes()}async setFilesExcludes(l,a){this.filesExcludes=l,this.filesExcludesMatcherList=[],a&&this.setWorkspaceRoots(a),this.updateExcludeMatcher()}async setWorkspaceRoots(l){this.workspaceRoots=l,this.updateExcludeMatcher()}async unwatchFileChanges(l){const a=this.watcherDisposerMap.get(l);if(!(!a||!a.dispose))return this.watcherDisposerMap.delete(l),a.dispose()}async delete(l,a){if(this.appConfig.isElectronRenderer&&a?.moveToTrash!==!1){const f=new p.URI(l);if(f.scheme===b.Schemes.file)return this.injector.get(g.IElectronMainUIService).moveToTrash(f.codeUri.fsPath)}const u=this.convertUri(l),m=await this.getProvider(u.scheme);await m.stat(u.codeUri),await m.delete(u.codeUri,{recursive:!0,moveToTrash:await this.doGetMoveToTrash(a)})}async getEncoding(l){return"utf8"}listCapabilities(){return _.Iterable.map(this.fsProviders,([l,a])=>({scheme:l,capabilities:a.capabilities}))}registerProvider(l,a){if(this.fsProviders.has(l))throw new Error(`The file system provider for \`${l}\` already registered`);const u=[];this.fsProviders.set(l,a),this._onDidChangeFileSystemProviderRegistrations.fire({added:!0,scheme:l,provider:a}),u.push({dispose:()=>{this._onDidChangeFileSystemProviderRegistrations.fire({added:!1,scheme:l,provider:a}),this.fsProviders.delete(l),this._providerChanged.add(l)}}),a.onDidChangeFile&&u.push(a.onDidChangeFile(f=>this.fireFilesChange({changes:f}))),this.toDisposable.push(a.onDidChangeCapabilities(()=>this._onDidChangeFileSystemProviderCapabilities.fire({provider:a,scheme:l}))),u.push({dispose:async()=>{const f=[];(this.watcherWithSchemaMap.get(l)||[]).forEach(v=>f.push(this.unwatchFileChanges(v))),await Promise.all(f)}}),this._providerChanged.add(l),this.onFileProviderChangedEmitter.fire(Array.from(this._providerChanged)),this.toDisposable.pushAll(u);const m=new p.DisposableCollection;return m.pushAll(u),this._onFileProviderChanged.fire(Array.from(this._providerChanged)),m}async access(l,a=E.FileAccess.Constants.F_OK){const u=this.convertUri(l),m=await this.getProvider(u.scheme);if(!(0,E.containsExtraFileMethod)(m,"access"))throw this.getErrorProvideNotSupport(u.scheme,"access");return await m.access(u.codeUri,a)}async getFileType(l){const a=this.convertUri(l),u=await this.getProvider(a.scheme);if(!(0,E.containsExtraFileMethod)(u,"getFileType"))throw this.getErrorProvideNotSupport(a.scheme,"getFileType");return await u.getFileType(l)}async getCurrentUserHome(){return this.userHomeDeferred.promise}getErrorProvideNotSupport(l,a){return`Scheme ${l} not support this function: ${a}.`}convertUri(l){const a=new p.URI(l);if(!a.scheme)throw new Error(`Unsupported convert Uri with non-scheme Uri: ${l}`);return a}updateExcludeMatcher(){this.filesExcludes.forEach(l=>{this.workspaceRoots.length>0?this.workspaceRoots.forEach(a=>{const m=new p.URI(a).resolve(l).path.toString();this.filesExcludesMatcherList.push((0,p.parseGlob)(m))}):this.filesExcludesMatcherList.push((0,p.parseGlob)(l))})}async shouldWaitProvider(l){const a=await this._onWillActivateFileSystemProvider.fireAndAwait({scheme:l}),{result:u}=a[0];if(u&&u.includes(l)){const m=await p.Event.toPromise(p.Event.filter(this.onFileProviderChanged,f=>f.includes(l)));if(!(0,b.isUndefined)(m))return!0}return!1}async getProvider(l){this._providerChanged.has(l)&&(await this.eventBus.fireAndAwait(new p.ExtensionActivateEvent({topic:"onFileSystem",data:l}),{timeout:3e3}),this._providerChanged.delete(l));const a=this.fsProviders.get(l);if(!a)throw new Error(`Not find ${l} provider.`);return a}async isReadonly(l){try{const a=new p.URI(l);return!!(await(await this.getProvider(a.scheme)).stat(this.convertUri(l).codeUri)).readonly}catch{return!1}}isExclude(l){const a=new p.URI(l);return this.filesExcludesMatcherList.some(u=>u(a.path.toString()))}filterStat(l,a=!0){if(l&&!this.isExclude(l.uri))return l.children&&a&&(l.children=this.filterStatChildren(l.children)),l}filterStatChildren(l){const a=[];return l.forEach(u=>{if(this.isExclude(u.uri))return!1;const m=this.filterStat(u);m&&a.push(m)}),a}applyContentChanges(l,a){let u=s.TextDocument.create("","",1,l);for(const m of a){let f=m.text;if(m.range){const v=u.offsetAt(m.range.start),y=u.offsetAt(m.range.end);f=u.getText().substr(0,v)+m.text+u.getText().substr(y)}u=s.TextDocument.create(u.uri,u.languageId,u.version,f)}return u.getText()}async isInSync(l,a){return!!this.checkInSync(l,a)}checkInSync(l,a){return a.lastModification===l.lastModification&&a.size===l.size}createOutOfSyncError(l){return E.FileSystemError.FileIsOutOfSync(l.uri)}async doGetEncoding(l){return l&&typeof l.encoding<"u"?l.encoding:this.options.encoding}async doGetOverwrite(l){return l&&typeof l.overwrite<"u"?l.overwrite:this.options.overwrite}async doGetRecursive(l){return l&&typeof l.recursive<"u"?l.recursive:this.options.recursive}async doGetMoveToTrash(l){return l&&typeof l.moveToTrash<"u"?l.moveToTrash:this.options.moveToTrash}};e.FileServiceClient=c,n.__decorate([(0,o.Autowired)(E.IBrowserFileSystemRegistry),n.__metadata("design:type",h)],c.prototype,"registry",void 0),n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],c.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(b.IEventBus),n.__metadata("design:type",Object)],c.prototype,"eventBus",void 0),n.__decorate([(0,o.Autowired)(p.AppConfig),n.__metadata("design:type",Object)],c.prototype,"appConfig",void 0),e.FileServiceClient=c=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],c)},69037:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileServiceContribution=void 0;const n=t(85608),s=t(76003),o=t(41869),p=t(42933),b=t(2156);let g=class{constructor(){this._disposables=new o.DisposableStore,this._disposables.add(this.fileSystem.registerProvider(o.Schemes.file,this.diskFileServiceProvider))}async initialize(){const E=this.contributionProvider.getContributions();await Promise.all(E.map(async d=>{d.registerProvider&&await d.registerProvider(this.fileSystem)})),await Promise.all(E.map(async d=>{d.onFileServiceReady&&await d.onFileServiceReady()}))}dispose(){this._disposables.dispose()}};e.FileServiceContribution=g,n.__decorate([(0,s.Autowired)(p.IFileServiceClient),n.__metadata("design:type",b.FileServiceClient)],g.prototype,"fileSystem",void 0),n.__decorate([(0,s.Autowired)(p.IDiskFileProvider),n.__metadata("design:type",Object)],g.prototype,"diskFileServiceProvider",void 0),n.__decorate([(0,s.Autowired)(o.FsProviderContribution),n.__metadata("design:type",Object)],g.prototype,"contributionProvider",void 0),e.FileServiceContribution=g=n.__decorate([(0,o.Domain)(o.ClientAppContribution),n.__metadata("design:paramtypes",[])],g)},60476:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DiskFsProviderClient=e.CoreFileServiceProviderClient=void 0;const n=t(85608),s=t(76003),o=t(43718),p=t(42933);class b{constructor(){this.onDidChangeFileEmitter=new o.Emitter,this.onDidChangeFile=this.onDidChangeFileEmitter.event}watch(E,d){return this.fileServiceProvider.watch(E,d)}unwatch(E){return this.fileServiceProvider.unwatch&&this.fileServiceProvider.unwatch(E)}async stat(E){return await this.fileServiceProvider.stat(E)}readDirectory(E){return this.fileServiceProvider.readDirectory(E)}createDirectory(E){return this.fileServiceProvider.createDirectory(E)}async readFile(E,d){return d&&(0,o.getDebugLogger)("fileService.fsProvider").warn("encoding option for fsProvider.readFile is deprecated"),await this.fileServiceProvider.readFile(E)}readFileStream(E){if(this.fileServiceProvider.readFileStream)return this.fileServiceProvider.readFileStream(E);throw new Error("readFileStream not supported")}writeFile(E,d,h){return this.fileServiceProvider.writeFile(E,Array.from(d),h)}delete(E,d){return this.fileServiceProvider.delete(E,d)}rename(E,d,h){return this.fileServiceProvider.rename(E,d,h)}}e.CoreFileServiceProviderClient=b,n.__decorate([(0,s.Autowired)(s.INJECTOR_TOKEN),n.__metadata("design:type",s.Injector)],b.prototype,"injector",void 0);let g=class extends b{constructor(){super(...arguments),this.onDidChangeCapabilities=o.Event.None}get capabilities(){return this._capabilities||(this._capabilities=12318,o.isLinux&&(this._capabilities|=1024)),this._capabilities}setWatchFileExcludes(E){return this.fileServiceProvider.setWatchFileExcludes(E)}getWatchFileExcludes(){return this.fileServiceProvider.getWatchFileExcludes()}onDidFilesChanged(E){const d=E.changes.map(h=>({uri:h.uri,type:h.type}));this.onDidChangeFileEmitter.fire(d)}copy(E,d,h){return this.fileServiceProvider.copy(E,d,h)}access(E,d){return this.fileServiceProvider.access(E,d)}getCurrentUserHome(){return this.fileServiceProvider.getCurrentUserHome()}getFileType(E){return this.fileServiceProvider.getFileType(E)}};e.DiskFsProviderClient=g,n.__decorate([(0,s.Autowired)(p.DiskFileServicePath),n.__metadata("design:type",Object)],g.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)],g.prototype,"setWatchFileExcludes",null),e.DiskFsProviderClient=g=n.__decorate([(0,s.Injectable)()],g)},96708:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileServiceClientModule=void 0;const n=t(85608),s=t(76003),o=t(41869),p=t(42933),b=t(70671),g=t(2156),_=t(69037),E=t(60476),d=t(23188);let h=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:p.IFileServiceClient,useClass:g.FileServiceClient},{token:p.IBrowserFileSystemRegistry,useClass:g.BrowserFileSystemRegistryImpl},{token:p.IDiskFileProvider,useClass:E.DiskFsProviderClient},{token:p.IShadowFileProvider,useClass:d.ShadowFileSystemProvider},_.FileServiceContribution],this.backServices=[{servicePath:p.DiskFileServicePath,clientToken:p.IDiskFileProvider,protocol:b.DiskFileServiceProtocol}]}};e.FileServiceClientModule=h,e.FileServiceClientModule=h=n.__decorate([(0,s.Injectable)()],h)},23188:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShadowFileSystemProvider=void 0;const n=t(85608),s=t(76003),o=t(41869);let p=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(g){throw new Error("Method not implemented.")}readFileStream(g){throw new Error("Method not implemented.")}watch(g,_){throw new Error("Method not implemented.")}stat(g){return Promise.resolve({uri:g.toString(),lastModification:0})}readDirectory(g){throw new Error("Method not implemented.")}createDirectory(g){throw new Error("Method not implemented.")}readFile(g){return this.shadowFiles.get(g.toString())||o.BinaryBuffer.fromString("no available").buffer}writeFile(g,_,E){this.shadowFiles.set(g.toString(),_)}delete(g,_){throw new Error("Method not implemented.")}rename(g,_,E){throw new Error("Method not implemented.")}copy(g,_,E){throw new Error("Method not implemented.")}exists(g){throw new Error("Method not implemented.")}access(g,_){throw new Error("Method not implemented.")}};e.ShadowFileSystemProvider=p,e.ShadowFileSystemProvider=p=n.__decorate([(0,s.Injectable)()],p)},81952:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileSystemWatcher=void 0;const n=t(43718);function s(p,b){return p.filter(g=>!!g.uri.startsWith(b))}class o{constructor(b){this.toDispose=new n.DisposableCollection,this.changeEmitter=new n.Emitter,this.toDispose.push(this.changeEmitter),this.fileServiceClient=b.fileServiceClient,this.watchId=b.watchId,this.uri=b.uri,this.fileServiceClient.onFilesChanged(g=>{const _=s(g,this.uri.toString());_&&_.length>0&&this.changeEmitter.fire(_)})}get onFilesChanged(){return this.changeEmitter.event}dispose(){return Promise.all([this.toDispose.dispose(),this.fileServiceClient.unwatchFileChanges(this.watchId)])}isDisposed(){return this.toDispose.disposed}}e.FileSystemWatcher=o},91813:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EXT_LIST_TEXT=e.EXT_LIST_IMAGE=e.EXT_LIST_VIDEO=void 0,e.getFileTypeByExt=t,e.EXT_LIST_VIDEO=new Set(["mp4","webm","mkv","mov","mts","flv","avi","wmv"]),e.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"]),e.EXT_LIST_TEXT=new Set(["xml"]);function t(n){let s="text";return n&&(e.EXT_LIST_IMAGE.has(n)?s="image":e.EXT_LIST_VIDEO.has(n)?s="video":e.EXT_LIST_TEXT.has(n)?s="text":s="binary"),s}},79929:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IBrowserFileSystemRegistry=e.IFileServiceClient=void 0;const n=t(43718);e.IFileServiceClient=n.IFileServiceClient,e.IBrowserFileSystemRegistry=Symbol("IBrowserFileSystemRegistry")},49818:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileSystemError=e.FileOperationError=e.FileSystemProviderError=e.FileSystemProviderErrorCode=e.FileAccess=e.IFileService=e.IShadowFileProvider=e.IDiskFileProvider=e.FileStat=e.FileType=void 0,e.createFileSystemProviderError=E,e.markAsFileSystemProviderError=d,e.containsExtraFileMethod=c,e.notEmpty=r,e.isErrnoException=l,e.handleError=a;const n=t(85608),s=t(43718);var o=t(31036);Object.defineProperty(e,"FileType",{enumerable:!0,get:function(){return o.FileType}}),Object.defineProperty(e,"FileStat",{enumerable:!0,get:function(){return o.FileStat}}),n.__exportStar(t(11854),e),e.IDiskFileProvider=Symbol("IDiskFileProvider"),e.IShadowFileProvider=Symbol("IShadowFileProvider"),e.IFileService=Symbol("IFileService");var p;(function(u){let m;(function(f){f.F_OK=0,f.R_OK=4,f.W_OK=2,f.X_OK=1})(m=u.Constants||(u.Constants={}))})(p||(e.FileAccess=p={}));var b;(function(u){u.FileExists="EntryExists",u.FileNotFound="EntryNotFound",u.FileNotADirectory="EntryNotADirectory",u.FileIsADirectory="EntryIsADirectory",u.FileIsOutOfSync="FileIsOutOfSync",u.FileExceedsMemoryLimit="EntryExceedsMemoryLimit",u.FileTooLarge="EntryTooLarge",u.FileWriteLocked="EntryWriteLocked",u.NoPermissions="NoPermissions",u.Unavailable="Unavailable",u.Unknown="Unknown"})(b||(e.FileSystemProviderErrorCode=b={}));class g extends Error{static declare(m,f){return Object.assign((...v)=>E(f(...v),m),{is:v=>{var y;return(y=v.stack)===null||y===void 0?void 0:y.startsWith(m)}})}constructor(m,f){super(m),this.code=f}is(m){return this.name===m.name}}e.FileSystemProviderError=g;class _ extends Error{constructor(m,f,v){super(m),this.fileOperationResult=f,this.options=v}static isFileOperationError(m){return m instanceof Error&&!(0,s.isUndefinedOrNull)(m.fileOperationResult)}}e.FileOperationError=_;function E(u,m){const f=new g(u.toString(),m);return d(f,m),f}function d(u,m){return u.name=m?`${m} (FileSystemError)`:"FileSystemError",u}var h;(function(u){u.FileNotFound=g.declare(b.FileNotFound,(m,f)=>`${f?f+" ":""} '${m}' is not found.`),u.FileExists=g.declare(b.FileExists,(m,f)=>`${f?f+" ":""}'${m}' already exists.`),u.FileNotADirectory=g.declare(b.FileNotADirectory,(m,f)=>`${f?f+" ":""}'${m}' is not a directory.`),u.FileIsADirectory=g.declare(b.FileIsADirectory,(m,f)=>`${f?f+" ":""}'${m}' is a directory.`),u.FileIsOutOfSync=g.declare(b.FileIsOutOfSync,(m,f)=>`${f?f+" ":""}'${m}' is out of sync.`),u.FileExceedsMemoryLimit=g.declare(b.FileExceedsMemoryLimit,(m,f)=>`${f?f+" ":""}'${m}' is exceeds memory limit.`),u.FileTooLarge=g.declare(b.FileTooLarge,(m,f)=>`${f?f+" ":""}'${m}' is too large.`),u.FileWriteLocked=g.declare(b.FileWriteLocked,(m,f)=>`${f?f+" ":""}'${m}' is locked.`),u.FileIsNoPermissions=g.declare(b.NoPermissions,(m,f)=>`${f?f+" ":""}'${m}' is no permissions.`),u.Unavailable=g.declare(b.Unavailable,(m,f)=>`${f?f+" ":""}'${m}' is unavailable.`),u.Unknown=g.declare(b.Unknown,(m,f)=>`${f?f+" ":""}'${m}' is unkonw.`)})(h||(e.FileSystemError=h={}));function c(u,m){return(0,s.hasProperty)(u,m)&&(0,s.isFunction)(u[m])}function r(u){return u!==void 0}function l(u){return u.code!==void 0&&u.errno!==void 0}function a(u){var m,f,v,y,S;if(l(u))switch(u.code){case"EEXIST":throw h.FileExists(s.Uri.file((m=u.path)!==null&&m!==void 0?m:""));case"EPERM":case"EACCESS":throw h.FileIsNoPermissions(s.Uri.file((f=u.path)!==null&&f!==void 0?f:""));case"ENOENT":throw h.FileNotFound(s.Uri.file((v=u.path)!==null&&v!==void 0?v:""));case"ENOTDIR":throw h.FileNotADirectory(s.Uri.file((y=u.path)!==null&&y!==void 0?y:""));case"EISDIR":throw h.FileIsADirectory(s.Uri.file((S=u.path)!==null&&S!==void 0?S:""))}throw u}},42933:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=t(85608);n.__exportStar(t(79929),e),n.__exportStar(t(49818),e),n.__exportStar(t(28217),e),n.__exportStar(t(91813),e),n.__exportStar(t(50295),e)},70671:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DiskFileServiceProtocol=void 0;const n=t(26387),s=t(52890),o=t(50295);e.DiskFileServiceProtocol={name:o.DiskFileServicePath,methods:[{method:"readFile",request:[{name:"uri",type:s.UriComponentsProto}],response:{type:n.Type.binary()}}]}},50295:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileExtServicePath=e.FileWatcherServicePath=e.ShadowFileServicePath=e.DiskFileServicePath=e.FileServicePath=void 0,e.FileServicePath="FileService",e.DiskFileServicePath="DiskFileService",e.ShadowFileServicePath="ShadowFileService",e.FileWatcherServicePath="FileWatcherService",e.FileExtServicePath="FileExtServicePath"},28217:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.INsfw=void 0;var t;(function(n){let s;(function(o){o[o.CREATED=0]="CREATED",o[o.DELETED=1]="DELETED",o[o.MODIFIED=2]="MODIFIED",o[o.RENAMED=3]="RENAMED"})(s=n.actions||(n.actions={}))})(t||(e.INsfw=t={}))},14951:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),t(85608).__exportStar(t(42933),e)},57942:(x,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeDialogModel=void 0;const s=t(85608),o=t(76003),p=t(97267),b=t(41869),g=t(26542),_=t(6250),E=t(2812),d=s.__importDefault(t(89200)),h=t(9018);let c=n=class{static createContainer(l,a){return l.createChild([{token:_.IFileDialogTreeService,useValue:a},{token:_.IFileDialogModel,useClass:n}])}static createModel(l,a){return n.createContainer(l,a).get(_.IFileDialogModel)}constructor(){this.selectedDecoration=new p.Decoration(d.default.mod_selected),this.focusedDecoration=new p.Decoration(d.default.mod_focused),this.loadingDecoration=new p.Decoration(d.default.mod_loading),this.cutDecoration=new p.Decoration(d.default.mod_cut),this._selectedFiles=[],this.disposableCollection=new b.DisposableCollection,this.onDidFocusedFileChangeEmitter=new b.Emitter,this.onDidSelectedFileChangeEmitter=new b.Emitter,this.clearFileSelectedDecoration=()=>{this._selectedFiles.forEach(l=>{this.selectedDecoration.removeTarget(l)}),this._selectedFiles=[],this.onDidSelectedFileChangeEmitter.fire([])},this.activeFileDecoration=(l,a=!0)=>{l!==this.treeModel.root&&(this.preContextMenuFocusedFile&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile),this.preContextMenuFocusedFile=null),l&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(u=>{this.selectedDecoration.removeTarget(u)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(l),this.focusedDecoration.addTarget(l),this._focusedFile=l,this._selectedFiles=[l],this.onDidFocusedFileChangeEmitter.fire(l.uri),this.onDidSelectedFileChangeEmitter.fire([l.uri]),a&&this.treeModel.dispatchChange()))},this.selectFileDecoration=(l,a=!0)=>{l!==this.treeModel.root&&(this.preContextMenuFocusedFile&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile),this.preContextMenuFocusedFile=null),l&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(u=>{this.selectedDecoration.removeTarget(u)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(l),this._selectedFiles=[l],this.onDidSelectedFileChangeEmitter.fire([l.uri]),a&&this.treeModel.dispatchChange()))},this.activeFileFocusedDecoration=(l,a=!1)=>{l!==this.treeModel.root&&(this.focusedFile!==l&&(a?(this.preContextMenuFocusedFile?(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile)):this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.preContextMenuFocusedFile=l):this.focusedFile&&(this.preContextMenuFocusedFile=null,this.focusedDecoration.removeTarget(this.focusedFile)),l&&(this.selectedDecoration.addTarget(l),this.focusedDecoration.addTarget(l),this._focusedFile=l,this._selectedFiles.push(l),this.onDidFocusedFileChangeEmitter.fire(l.uri),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(u=>u.uri)))),this.treeModel.dispatchChange())},this.activeFileSelectedDecoration=l=>{this._selectedFiles.indexOf(l)>-1||(this._selectedFiles.push(l),this.selectedDecoration.addTarget(l),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(a=>a.uri)),this.treeModel.dispatchChange())},this.activeFileDecorationByRange=(l,a)=>{for(this.clearFileSelectedDecoration(),this.preContextMenuFocusedFile=null;l<=a;l++){const u=this.treeModel.root.getTreeNodeAtIndex(l);u&&(this._selectedFiles.push(u),this.selectedDecoration.addTarget(u))}this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(u=>u.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 l=>{l.expanded?this.fileTreeHandle.collapseNode(l):this.fileTreeHandle.expandNode(l)},this.handleTreeBlur=()=>{this.enactiveFileDecoration()},this.handleTreeFocus=()=>{},this.handleItemRangeClick=(l,a)=>{if(!this.focusedFile)this.handleItemClick(l,a);else if(this.focusedFile&&this.focusedFile!==l){const u=this.treeModel.root.getIndexAtTreeNode(l),m=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);m>u?this.activeFileDecorationByRange(u,m):m<u&&this.activeFileDecorationByRange(m,u)}},this.handleItemToggleClick=(l,a)=>{a!==p.TreeNodeType.CompositeTreeNode&&a!==p.TreeNodeType.TreeNode||(this.selectedFiles.indexOf(l)>-1?this.focusedFile===l?this.enactiveFileDecoration():this.activeFileFocusedDecoration(l):this.activeFileSelectedDecoration(l))},this.handleItemClick=(l,a)=>{this.clickTimes++,(a===p.TreeNodeType.CompositeTreeNode||a===p.TreeNodeType.TreeNode)&&this.activeFileDecoration(l),a===p.TreeNodeType.CompositeTreeNode&&this.corePreferences["workbench.list.openMode"]==="singleClick"&&this.toggleDirectory(l),this.clickTimer&&clearTimeout(this.clickTimer),this.clickTimer=setTimeout(()=>{this.clickTimes>1&&a!==p.TreeNodeType.TreeNode&&this.corePreferences["workbench.list.openMode"]==="doubleClick"&&this.toggleDirectory(l),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 l=(await this.fileTreeDialogService.resolveChildren())[0];this._treeModel=this.injector.get(E.FileTreeModel,[l]),this.initDecorations(l),this.disposableCollection.push(this._decorations),this.disposableCollection.push(this.labelService.onDidChange(()=>{this.treeModel.dispatchChange()})),this.disposableCollection.push(this.treeModel.root.watcher.on(p.TreeNodeEvent.WillResolveChildren,a=>{this.loadingDecoration.addTarget(a)})),this.disposableCollection.push(this.treeModel.root.watcher.on(p.TreeNodeEvent.DidResolveChildren,a=>{this.loadingDecoration.removeTarget(a)}))}async updateTreeModel(l){const a=await this.fileTreeDialogService.resolveRoot(l);if(a&&a.length>0){const u=a[0];this._treeModel=this.injector.get(E.FileTreeModel,[u]),this.clearFileSelectedDecoration(),this.initDecorations(u)}}initDecorations(l){this._decorations&&this._decorations.dispose(),this._decorations=new p.DecorationsManager(l),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.cutDecoration),this._decorations.addDecoration(this.loadingDecoration)}handleTreeHandler(l){this._fileTreeHandle=l}dispose(){this.disposableCollection.dispose()}};e.FileTreeDialogModel=c,c.FILE_TREE_SNAPSHOT_KEY="FILE_TREE_SNAPSHOT",c.DEFAULT_LOCATION_FLUSH_DELAY=500,s.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),s.__metadata("design:type",o.Injector)],c.prototype,"injector",void 0),s.__decorate([(0,o.Autowired)(_.IFileDialogTreeService),s.__metadata("design:type",h.FileTreeDialogService)],c.prototype,"fileTreeDialogService",void 0),s.__decorate([(0,o.Autowired)(g.LabelService),s.__metadata("design:type",g.LabelService)],c.prototype,"labelService",void 0),s.__decorate([(0,o.Autowired)(b.CorePreferences),s.__metadata("design:type",Object)],c.prototype,"corePreferences",void 0),e.FileTreeDialogModel=c=n=s.__decorate([(0,o.Injectable)(),s.__metadata("design:paramtypes",[])],c)},69748:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FILE_TREE_BADGE_LIMIT=e.FILE_TREE_NODE_HEIGHT=e.FileTreeDialogNode=void 0;const n=t(85608),s=n.__importDefault(t(53373)),o=n.__importDefault(t(14041)),p=t(97267),b=t(41869),g=t(69959),_=n.__importDefault(t(89200)),E=({item:d,onClick:h,itemType:c,labelService:r,leftPadding:l=8,onTwistierClick:a,decorations:u,defaultLeftPadding:m=8,template:f})=>{const v=c===p.TreeNodeType.RenamePrompt,y=c===p.TreeNodeType.NewPrompt,S=v||y,A=(0,b.useDesignStyles)(_.default.expansion_toggle,"expansion_toggle"),T=(0,b.useDesignStyles)(_.default.file_tree_node,"file_tree_node"),D=W=>{(c===p.TreeNodeType.TreeNode||c===p.TreeNodeType.CompositeTreeNode)&&h(W,d,c)},w=W=>{(c===p.TreeNodeType.TreeNode||c===p.TreeNodeType.CompositeTreeNode)&&(a?a(W,d,c):h(W,d,c))},I=c===p.TreeNodeType.CompositeTreeNode;let R;S?y?R=`${m+(d.parent.depth+1||0)*(l||0)}px`:R=`${m+(d.target.depth||0)*(l||0)}px`:R=I?`${m+(d.depth||0)*(l||0)}px`:`${m+(d.depth||0)*(l||0)+8}px`;const M={height:e.FILE_TREE_NODE_HEIGHT,lineHeight:`${e.FILE_TREE_NODE_HEIGHT}px`,paddingLeft:R},O=(W,V)=>{if(u&&u?.classlist.indexOf(_.default.mod_loading)>-1)return o.default.createElement(p.Loading,null);if(S&&W instanceof p.PromptHandle){let H=!1;if(v?H=W.target.type===p.TreeNodeType.CompositeTreeNode:H=W.type===p.TreeNodeType.CompositeTreeNode,H)return o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_segment,A,(0,b.getIcon)("arrow-right"),{[`${_.default.mod_collapsed}`]:y||!(v&&W.target.type===p.TreeNodeType.CompositeTreeNode&&W.target.expanded)})})}else return o.default.createElement("div",{onClick:V,className:(0,s.default)(_.default.file_tree_node_segment,A,(0,b.getIcon)("arrow-right"),{[`${_.default.mod_collapsed}`]:!W.expanded})})},P=W=>{let V,H;S&&W instanceof p.PromptHandle?W instanceof p.RenamePromptHandle?(V=W.target.uri.resolve(W.$.value),H=g.Directory.is(W.target)):(V=W.parent.uri.resolve(W.$.value),H=W.type===p.TreeNodeType.CompositeTreeNode):(V=W.uri,H=W.filestat.isDirectory);const K=r.getIcon(V,{isDirectory:H});return o.default.createElement("div",{className:(0,s.default)(_.default.file_icon,K,{expanded:H&&W.expanded}),style:{height:e.FILE_TREE_NODE_HEIGHT,lineHeight:`${e.FILE_TREE_NODE_HEIGHT}px`}})},L=W=>f?o.default.createElement(f,null):S&&W instanceof p.PromptHandle?o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_segment,_.default.file_tree_node_inputbox)},o.default.createElement("div",{className:(0,s.default)("input-box",_.default.file_tree_node_prompt_box)},o.default.createElement(W.ProxiedInput,{wrapperStyle:{height:e.FILE_TREE_NODE_HEIGHT,padding:"0 5px"}}))):o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_segment,_.default.file_tree_node_displayname)},W.name),N=()=>o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_segment,_.default.file_tree_node_tail)},k()),k=()=>null,B=W=>{if(I)return O(W,w);if(S)return O(W,()=>{})},F=()=>d.tooltip||d.name;return o.default.createElement("div",{key:d.id,onClick:D,title:F(),className:(0,s.default)(T,u?u.classlist:null),style:M,draggable:c===p.TreeNodeType.TreeNode||c===p.TreeNodeType.CompositeTreeNode},o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_content)},B(d),P(d),o.default.createElement("div",{className:S?_.default.file_tree_node_prompt_wrap:_.default.file_tree_node_overflow_wrap},L(d)),N()))};e.FileTreeDialogNode=E,e.FILE_TREE_NODE_HEIGHT=22,e.FILE_TREE_BADGE_LIMIT=99},9018:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeDialogService=void 0;const n=t(85608),s=t(76003),o=t(97267),p=t(41869),b=t(26542),g=t(51500),_=t(6250);let E=class extends o.Tree{constructor(h){super(),this._whenReady=this.resolveWorkspaceRoot(h)}get whenReady(){return this._whenReady}async resolveWorkspaceRoot(h){if(h){const c=new p.URI(h).withScheme(p.Schemes.file),r=await this.fileTreeAPI.resolveFileStat(c);r&&(this.workspaceRoot=r)}}async resolveChildren(h){if(h){if(h.uri){const{children:c}=await this.fileTreeAPI.resolveChildren(this,h.uri.toString(),h);return c}}else{this.workspaceRoot||(this.workspaceRoot=(await this.workspaceService.roots)[0]);const{children:c}=await this.fileTreeAPI.resolveChildren(this,this.workspaceRoot);return this.root=c[0],c}return[]}async resolveRoot(h){let c;/^file:\/\//.test(h)&&(c=new p.URI(h)),c=p.URI.file(h);const r=await this.fileTreeAPI.resolveFileStat(c);if(r){const{children:l}=await this.fileTreeAPI.resolveChildren(this,r);return this.root=l[0],l}}getDirectoryList(){const h=[];if(!this.root)return h;let c=new p.URI(this.workspaceRoot.uri);if(c&&c.parent)for(;c.parent;){const r=c.codeUri.fsPath;if(h.indexOf(r)>=0)break;h.push(r),c=c.parent}else h.push(c.codeUri.fsPath.toString());return h}sortComparator(h,c){return h.constructor===c.constructor?h.name.startsWith(".")&&!c.name.startsWith(".")?1:!h.name.startsWith(".")&&c.name.startsWith(".")?-1:h.name.localeCompare(c.name,"kn",{numeric:!0}):h.type===o.TreeNodeType.CompositeTreeNode?-1:c.type===o.TreeNodeType.CompositeTreeNode?1:0}dispose(){super.dispose()}};e.FileTreeDialogService=E,n.__decorate([(0,s.Autowired)(_.IFileTreeAPI),n.__metadata("design:type",Object)],E.prototype,"fileTreeAPI",void 0),n.__decorate([(0,s.Autowired)(g.IWorkspaceService),n.__metadata("design:type",Object)],E.prototype,"workspaceService",void 0),n.__decorate([(0,s.Autowired)(b.LabelService),n.__metadata("design:type",b.LabelService)],E.prototype,"labelService",void 0),e.FileTreeDialogService=E=n.__decorate([(0,s.Injectable)({multiple:!0}),n.__param(0,(0,s.Optional)()),n.__metadata("design:paramtypes",[String])],E)},51888:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileDialog=e.FILE_TREE_DIALOG_HEIGHT=void 0;const n=t(85608),s=n.__importStar(t(14041)),o=t(97267),p=t(41869),b=t(68974),g=t(72665),_=t(69748),E=n.__importDefault(t(13294));e.FILE_TREE_DIALOG_HEIGHT=22;const d=({options:h,model:c,isOpenDialog:r})=>{const l=(0,p.useInjectable)(g.IDialogService),a=(0,s.useRef)(null),[u,m]=(0,s.useState)(""),[f,v]=(0,s.useState)(!1),[y,S]=(0,s.useState)(""),[A,T]=(0,s.useState)([]);(0,s.useEffect)(()=>(c&&(v(!1),I()),()=>{c.dispose()}),[c]),(0,s.useEffect)(()=>{h.defaultFileName&&m(h.defaultFileName)},[h]),(0,s.useEffect)(()=>{if(f){const V=c.getDirectoryList();T(V)}},[f]);const D=(0,s.useCallback)(()=>{const V=c.selectedFiles.map(H=>H.uri.path.toString());if(u&&h.showNameInput&&(V?.length===1||h.defaultUri)){const H=V?.length===1?V[0]:h.defaultUri.path.toString();l.hide([p.path.join(H,u)])}else V.length>0?l.hide(V):h.defaultUri?l.hide([h.defaultUri.path.toString()]):c.treeModel&&c.treeModel.root?l.hide([c.treeModel.root.uri.path.toString()]):l.hide([]);v(!1)},[f,l,c,u,h]),w=(0,s.useCallback)(()=>{v(!1),l.hide()},[f,l]),I=(0,s.useCallback)(async()=>{await c.whenReady,await c.treeModel.ensureReady,S(c.treeModel.root.uri.codeUri.fsPath),v(!0)},[c,y,f]),R=!r,M=(0,s.useCallback)(V=>{c.handleTreeHandler({...V,getModel:()=>c.treeModel,hasDirectFocus:()=>a.current===document.activeElement})},[c]),O=(0,s.useCallback)((V,H)=>{V.stopPropagation();const{toggleDirectory:K}=c;K(H)},[c]),P=(0,s.useCallback)(V=>L(V)?!1:V.shiftKey,[]),L=(0,s.useCallback)(V=>{const{metaKey:H,ctrlKey:K}=V;return p.isMacintosh&&H||K},[]),N=(0,s.useCallback)((V,H,K)=>{var z;V.stopPropagation();const{handleItemClick:G,handleItemToggleClick:j,handleItemRangeClick:U}=c;if(!H)return;const $=P(event),Y=L(event);if($&&!R&&h.canSelectMany)U(H,K);else if(Y&&!R&&h.canSelectMany)j(H,K);else if(R)K===o.TreeNodeType.CompositeTreeNode&&G(H,K);else if(h.canSelectFiles&&K===o.TreeNodeType.TreeNode){const Q=new Set(Object.values((z=h.filters)!==null&&z!==void 0?z:{}).flat().map(ee=>`.${ee}`));if(Q.size>0){const ee=p.URI.parse(H.filestat.uri).path.ext;Q.has(ee)&&G(H,K)}else G(H,K)}else h.canSelectFolders&&K===o.TreeNodeType.CompositeTreeNode&&G(H,K)},[c,R,h]),k=(0,s.useCallback)(async V=>{v(!1),S(V),await c.updateTreeModel(V),v(!0)},[c,f,y]),B=(0,s.useCallback)(V=>s.default.createElement(_.FileTreeDialogNode,{item:V.item,itemType:V.itemType,labelService:c.labelService,decorations:c.decorations.getDecorations(V.item),onClick:N,onTwistierClick:O,defaultLeftPadding:8,leftPadding:8}),[c.treeModel]),F=(0,s.useCallback)(()=>{if(f){if(c.treeModel)return s.default.createElement(o.RecycleTree,{height:300,itemHeight:e.FILE_TREE_DIALOG_HEIGHT,onReady:M,model:c.treeModel},B)}else return s.default.createElement(b.Progress,{loading:!0})},[f,c]),W=(0,s.useCallback)(()=>{if(A.length>0)return s.default.createElement(o.Select,{onChange:k,className:E.default.select_control,size:"small",value:y},A.map((V,H)=>s.default.createElement(o.Option,{value:V,key:`${H} - ${V}`},V)))},[A,y]);return r?s.default.createElement("div",{className:E.default.file_dialog_wrapper},s.default.createElement("div",{className:E.default.file_dialog_directory_title},h.title||(0,p.localize)("dialog.file.openLabel")),s.default.createElement("div",{className:E.default.file_dialog_directory},W()),s.default.createElement("div",{className:E.default.file_dialog_content,ref:a},F()),s.default.createElement("div",{className:E.default.file_dialog_buttons},s.default.createElement(o.Button,{onClick:()=>w(),type:"secondary",className:E.default.button},(0,p.localize)("dialog.file.close")),s.default.createElement(o.Button,{onClick:()=>D(),type:"primary",className:E.default.button},h.openLabel||(0,p.localize)("dialog.file.ok")))):s.default.createElement("div",{className:E.default.file_dialog_wrapper},s.default.createElement("div",{className:E.default.file_dialog_directory_title},h.saveLabel||(0,p.localize)("dialog.file.saveLabel")),s.default.createElement("div",{className:E.default.file_dialog_directory},W()),s.default.createElement("div",{className:E.default.file_dialog_content},F()),h.showNameInput&&s.default.createElement("div",{className:E.default.file_dialog_file_container},s.default.createElement("span",{className:E.default.file_dialog_file_name},(0,p.localize)("dialog.file.name"),": "),s.default.createElement(o.Input,{size:"small",value:u,autoFocus:!0,selection:{start:0,end:u.indexOf(".")||u.length},onChange:V=>m(V.target.value)})),s.default.createElement("div",{className:E.default.file_dialog_buttons},s.default.createElement(o.Button,{onClick:()=>w(),type:"secondary",className:E.default.button},(0,p.localize)("dialog.file.close")),s.default.createElement(o.Button,{onClick:()=>D(),type:"primary",className:E.default.button,disabled:!!(h.showNameInput&&u.length===0)},(0,p.localize)("dialog.file.ok"))))};e.FileDialog=d},89508:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WindowDialogServiceImpl=void 0;const n=t(85608),s=n.__importDefault(t(14041)),o=t(76003),p=t(41869),b=t(37406),g=t(14951),_=t(72665),E=t(57942),d=n.__importDefault(t(13294)),h=t(9018),c=t(51888);let r=class{constructor(){this._whenReady=this.init()}async init(){this.recentGlobalStorage=await this.storageProvider(p.STORAGE_NAMESPACE.GLOBAL_RECENT_DATA);const a=await this.recentGlobalStorage.get("RECENT_DIALOG_DEFAULT_URI");if(a)this._defaultUri=new p.URI(a);else{const u=await this.fileServiceClient.getCurrentUserHome();this._defaultUri=new p.URI(u.uri)}}get defaultUri(){return this._defaultUri}get whenReady(){return this._whenReady}async updateRecentDefaultUri(a){this.recentGlobalStorage.set("RECENT_DIALOG_DEFAULT_URI",a.toString()),this._defaultUri=a}async showOpenDialog(a={}){await this.whenReady;const u={canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1};if(this.appConfig.isElectronRenderer&&!this.appConfig.isRemote){const m=this.injector.get(b.IElectronMainUIService),f=[];a.canSelectFiles&&f.push("openFile"),a.canSelectFolders&&f.push("openDirectory"),a.canSelectMany&&f.push("multiSelections"),p.isMacintosh&&f.push("treatPackageAsDirectory","createDirectory");const v=a.defaultUri||this.defaultUri,y=await m.showOpenDialog(p.electronEnv.currentWindowId,{defaultPath:v.codeUri.fsPath,title:a.title,buttonLabel:a.openLabel,properties:f});if(y&&y.length>0){const S=y.map(A=>p.URI.file(A));return this.updateRecentDefaultUri(S[0].parent),S}else return}else{a.defaultUri||(a.defaultUri=this.defaultUri);let m;a.defaultUri?m=this.injector.get(h.FileTreeDialogService,[a.defaultUri.toString()]):m=this.injector.get(h.FileTreeDialogService),await m.whenReady;const f=E.FileTreeDialogModel.createModel(this.injector,m),v=await this.dialogService.open({message:s.default.createElement(c.FileDialog,{model:f,options:{...u,...a},isOpenDialog:!0}),type:p.MessageType.Empty,buttons:[],closable:!0,props:{className:d.default.file_dialog_wrapper}});if(this.dialogService.reset(),v&&v.length>0){const y=v.map(S=>p.URI.file(S));return this.updateRecentDefaultUri(y[0].parent),y}else return}}async showSaveDialog(a={}){if(await this.whenReady,this.appConfig.isElectronRenderer&&!this.appConfig.isRemote){const u=a.defaultUri||this.defaultUri,f=await this.injector.get(b.IElectronMainUIService).showSaveDialog(p.electronEnv.currentWindowId,{defaultPath:u.resolve(a.defaultFileName||"").codeUri.fsPath,title:a.saveLabel,message:a.saveLabel});if(f){const v=p.URI.file(f);return this.updateRecentDefaultUri(v.parent),v}else return}else{a.defaultUri||(a.defaultUri=this.defaultUri);let u;a.defaultUri?u=this.injector.get(h.FileTreeDialogService,[a.defaultUri.toString()]):u=this.injector.get(h.FileTreeDialogService),await u.whenReady;const m=E.FileTreeDialogModel.createModel(this.injector,u),f=await this.dialogService.open({message:s.default.createElement(c.FileDialog,{model:m,options:a,isOpenDialog:!1}),type:p.MessageType.Empty,buttons:[],closable:!0,props:{className:d.default.file_dialog_wrapper}});if(this.dialogService.reset(),f&&f.length>0){const v=p.URI.file(f[0]);return this.updateRecentDefaultUri(v.parent),v}else return}}};e.WindowDialogServiceImpl=r,n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],r.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(_.IDialogService),n.__metadata("design:type",Object)],r.prototype,"dialogService",void 0),n.__decorate([(0,o.Autowired)(g.IFileServiceClient),n.__metadata("design:type",Object)],r.prototype,"fileServiceClient",void 0),n.__decorate([(0,o.Autowired)(p.StorageProvider),n.__metadata("design:type",Function)],r.prototype,"storageProvider",void 0),n.__decorate([(0,o.Autowired)(p.AppConfig),n.__metadata("design:type",Object)],r.prototype,"appConfig",void 0),e.WindowDialogServiceImpl=r=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],r)},88014:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileContextKey=void 0;const n=t(85608),s=t(76003),o=t(41869),p=t(16413);let b=class{constructor(){this.explorerResourceIsFolder=p.ExplorerResourceIsFolderContext.bind(this.globalContextKeyService),this.explorerViewletVisibleContext=p.ExplorerViewletVisibleContext.bind(this.globalContextKeyService)}initScopedContext(_){this._contextKeyService=this.globalContextKeyService.createScoped(_),this.explorerFocused=p.ExplorerFocusedContext.bind(this._contextKeyService),this.explorerResourceCut=p.ExplorerResourceCut.bind(this._contextKeyService),this.filesExplorerFocused=p.FilesExplorerFocusedContext.bind(this._contextKeyService),this.filesExplorerInputFocused=p.FilesExplorerInputFocusedContext.bind(this._contextKeyService),this.filesExplorerFilteredContext=p.FilesExplorerFilteredContext.bind(this._contextKeyService),this.explorerCompressedFocusContext=p.ExplorerCompressedFocusContext.bind(this._contextKeyService),this.explorerCompressedFirstFocusContext=p.ExplorerCompressedFirstFocusContext.bind(this._contextKeyService),this.explorerCompressedLastFocusContext=p.ExplorerCompressedLastFocusContext.bind(this._contextKeyService)}get service(){return this._contextKeyService}};e.FileContextKey=b,n.__decorate([(0,s.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],b.prototype,"globalContextKeyService",void 0),e.FileContextKey=b=n.__decorate([(0,s.Injectable)(),n.__metadata("design:paramtypes",[])],b)},40439:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeContribution=void 0;const n=t(85608),s=t(76003),o=t(41869),p=t(16413),b=t(93899),g=t(68969),_=t(98295),E=t(41893),d=t(54414),h=t(32595),c=t(63067),r=t(58296),l=t(72665),a=t(51500),u=t(6250),m=t(69959),f=t(56384),v=t(57781),y=t(97738),S=t(4446);let A=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(h.EXPLORER_CONTAINER_ID)}async onStart(){this.viewsRegistry.registerViewWelcomeContent(u.RESOURCE_VIEW_ID,{content:(0,o.formatLocalize)("welcome-view.noFolderHelp",o.FILE_COMMANDS.OPEN_FOLDER.id),group:r.ViewContentGroups.Open,order:1}),this.mainLayoutService.collectViewComponent({id:u.RESOURCE_VIEW_ID,name:this.getWorkspaceTitle(),weight:3,priority:9,collapsed:!1,component:f.FileTree},h.EXPLORER_CONTAINER_ID),this._disposables.add(this.workspaceService.onWorkspaceLocationChanged(()=>{const D=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);D&&D.updateViewTitle(u.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(h.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 w=this.workspaceService.workspace;return w&&(D=new o.URI(w.uri).displayName,!w.isDirectory&&D.endsWith(`.${this.workspaceService.workspaceSuffixName}`)&&(D=D.slice(0,D.lastIndexOf(".")),D===a.UNTITLED_WORKSPACE))?(0,o.localize)("file.workspace.defaultTip"):D}onReconnect(){this.fileTreeService.reWatch()}revealFile(D){if(D)if(this.isRendered){const w=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);!w||!w.isVisible||w.isCollapsed(u.RESOURCE_VIEW_ID)?this.fileTreeModelService.locationOnShow(D):this.fileTreeModelService.location(D)}else this.fileTreeModelService.locationOnShow(D)}registerMenus(D){D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.NEW_FILE.id,label:(0,o.localize)("file.new")},order:1,group:"0_new"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.NEW_FOLDER.id,label:(0,o.localize)("file.folder.new")},order:2,group:"0_new"}),D.registerMenuItem(b.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(b.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(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_RESOURCES.id,label:(0,o.localize)("file.open")},order:1,group:"1_open"}),D.registerMenuItem(b.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(b.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(b.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(b.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(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.DELETE_FILE.id,label:(0,o.localize)("file.delete")},order:1,group:"7_modification"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.RENAME_FILE.id,label:(0,o.localize)("file.rename")},order:3,group:"7_modification"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COMPARE_SELECTED.id,label:(0,o.localize)("file.compare")},order:2,group:"3_compare"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_FILE.id,label:(0,o.localize)("file.copy.file")},order:1,group:"5_cutcopypaste"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.CUT_FILE.id,label:(0,o.localize)("file.cut.file")},order:2,group:"5_cutcopypaste"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.PASTE_FILE.id,label:(0,o.localize)("file.paste.file")},order:3,group:"5_cutcopypaste"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_PATH.id,label:(0,o.localize)("file.copy.path")},group:"6_copypath"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_RELATIVE_PATH.id,label:(0,o.localize)("file.copy.relativepath")},group:"6_copypath"})}registerCommands(D){const w=()=>{this.fileTreeService.filterMode&&this.fileTreeService.toggleFilterMode()};D.registerCommand(o.FILE_COMMANDS.OPEN_TERMINAL_WITH_PATH,{execute:R=>{let M=R;if(!M)return;const O=this.fileTreeService.getNodeByPathOrUri(M);O&&!O.filestat.isDirectory&&(M=O.uri.parent),this.commandService.executeCommand(o.TERMINAL_COMMANDS.OPEN_WITH_PATH.id,M)}}),D.registerCommand(o.FILE_COMMANDS.SEARCH_ON_FOLDER,{execute:async R=>{var M;let O=R;if(O||(this.fileTreeModelService.focusedFile?O=this.fileTreeModelService.focusedFile.uri:this.fileTreeModelService.selectedFiles.length>0&&(O=(M=this.fileTreeModelService.selectedFiles[0])===null||M===void 0?void 0:M.uri)),!O)return;let P;if(this.fileTreeService.isMultipleWorkspace)for(const L of await this.workspaceService.roots){const N=new o.URI(L.uri);if(N.isEqualOrParent(O)){P=`./${N.relative(O).toString()}`;break}}else if(this.workspaceService.workspace){const L=new o.URI(this.workspaceService.workspace.uri);L.isEqualOrParent(O)&&(P=`./${L.relative(O).toString()}`)}this.commandService.executeCommand(o.SEARCH_COMMANDS.OPEN_SEARCH.id,{includeValue:P+"/"})},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&m.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.LOCATION,{execute:R=>{R?this.revealFile(R):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 R,M,O;((M=(R=this.workbenchEditorService.currentEditor)===null||R===void 0?void 0:R.currentUri)===null||M===void 0?void 0:M.scheme)===o.Schemes.file&&this.revealFile((O=this.workbenchEditorService.currentEditor)===null||O===void 0?void 0:O.currentUri)}}),D.registerCommand(o.FILE_COMMANDS.COLLAPSE_ALL,{execute:()=>{const R=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);!R||!R.isVisible||this.fileTreeModelService.collapseAll()}}),D.registerCommand(o.FILE_COMMANDS.REFRESH_ALL,{execute:async()=>{const R=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);!R||!R.isVisible||await this.fileTreeService.refresh()}}),D.registerCommand(o.FILE_COMMANDS.DELETE_FILE,{execute:(R,M)=>{if(w(),M?this.willDeleteUris=this.willDeleteUris.concat(M):this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0?this.willDeleteUris=this.willDeleteUris.concat(this.fileTreeModelService.selectedFiles.map(O=>O.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:R=>{if(w(),!R)if(this.fileTreeModelService.contextMenuFile)R=this.fileTreeModelService.contextMenuFile.uri;else if(this.fileTreeModelService.focusedFile)R=this.fileTreeModelService.focusedFile.uri;else return;this.fileTreeModelService.renamePrompt(R)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.NEW_FILE,{execute:async R=>{var M;if(w(),R)this.fileTreeModelService.newFilePrompt(R);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 O;this.fileTreeService.isMultipleWorkspace?O=new o.URI((await this.workspaceService.roots)[0].uri):O=new o.URI((M=this.workspaceService.workspace)===null||M===void 0?void 0:M.uri),this.fileTreeModelService.newFilePrompt(O)}}}),D.registerCommand(o.FILE_COMMANDS.NEW_FOLDER,{execute:async R=>{var M;if(w(),R)this.fileTreeModelService.newDirectoryPrompt(R);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 O;this.fileTreeService.isMultipleWorkspace?O=new o.URI((await this.workspaceService.roots)[0].uri):O=new o.URI((M=this.workspaceService.workspace)===null||M===void 0?void 0:M.uri),this.fileTreeModelService.newDirectoryPrompt(O)}}}),D.registerCommand(o.FILE_COMMANDS.COMPARE_SELECTED,{execute:(R,M)=>{if(M&&M.length){const O=this.workbenchEditorService.currentEditor;O&&O.currentUri&&this.fileTreeService.compare(M[0],O.currentUri)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!m.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.OPEN_RESOURCES,{execute:R=>{this.fileTreeService.openAndFixedFile(R)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!m.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.OPEN_TO_THE_SIDE,{execute:R=>{this.fileTreeService.openToTheSide(R)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!m.Directory.is(this.fileTreeModelService.contextMenuFile)});const I=(R,M)=>{const{availableOpenTypes:O,currentOpenType:P}=this.workbenchEditorService.currentEditorGroup;if(!(O&&R&&P))return{items:[],selectIndex:-1};const L=this.preferenceService.get("workbench.editorAssociations"),N=[],k=(V,H)=>H.type===d.EditorOpenType.code?V.type===d.EditorOpenType.code:H.type===d.EditorOpenType.component&&V.type===d.EditorOpenType.component?V.componentId===H.componentId:!1,B=(V,H)=>(V?V+=(0,o.localize)("file.open.type.detail.and")+H:V=H,V);let F,W;if(L){const V=Object.keys(L).find(H=>(0,o.match)(H,R.path.toString().toLowerCase())||(0,o.match)(H,R.path.base.toLowerCase()));F=V&&L[V]}return O.forEach((V,H)=>{var K;const z={label:V.title||V.componentId||V.type,detail:V.title,run:G=>M(G,V)};k(P,V)&&(z.description=B(z.description,(0,o.localize)("file.open.type.detail.active")),W=H),F&&(!((K=V.componentId)===null||K===void 0)&&K.endsWith(F))&&(z.description=B(z.description,(0,o.localize)("file.open.type.detail.default"))),N.push(new o.QuickOpenItem(z))}),{items:N,selectIndex:W}};D.registerCommand(o.FILE_COMMANDS.OPEN_TYPE_WITH,{execute:R=>{const M=(N,k)=>{var B,F;return N===o.Mode.OPEN?((B=this.workbenchEditorService.currentEditorGroup)===null||B===void 0||B.changeOpenType((F=k.componentId)!==null&&F!==void 0?F:k.type),!0):!1},{items:O,selectIndex:P}=I(R,M);if(O.length===0||typeof P>"u")return;const L=N=>{this.quickOpenService.open({onType:(k,B)=>B(N)},{fuzzyMatchLabel:!0,ignoreFocusOut:!1,placeholder:(0,o.formatLocalize)("file.open.type.placeholder",R.path.base),selectIndex:()=>P})};O.push(new o.QuickOpenItem({label:(0,o.formatLocalize)("file.open.type.preference.default",`*${R.path.ext}`),showBorder:!0,run:N=>{if(N===o.Mode.OPEN){const k=(W,V)=>{var H,K,z;if(W===o.Mode.OPEN){const G="workbench.editorAssociations",j=this.preferenceService.resolve(G).scope,U=this.preferenceService.get(G);return this.preferenceService.set(G,{...U||{},[`*${R.path.ext}`]:(H=V.componentId)!==null&&H!==void 0?H:V.type},j),(K=this.workbenchEditorService.currentEditorGroup)===null||K===void 0||K.changeOpenType((z=V.componentId)!==null&&z!==void 0?z:V.type),!0}return!1},{items:B,selectIndex:F}=I(R,k);if(B.length===0||typeof F>"u")return!0;L(B)}return!1}})),L(O)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!m.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.COPY_PATH,{execute:async R=>{if(!R)return;let O=R.path.toString();if(R.scheme===d.DIFF_SCHEME){const L=R.getParsedQuery();O=new o.URI(L.modified).path.toString()}let P=decodeURIComponent(O);await this.appService.backendOS===o.OperatingSystem.Windows&&(P=P.slice(1)),await this.clipboardService.writeText(P)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile}),D.registerCommand(o.FILE_COMMANDS.COPY_RELATIVE_PATH,{execute:async R=>{if(!R)return;if(R.scheme===d.DIFF_SCHEME){const O=R.getParsedQuery();R=new o.URI(O.modified).withScheme("file")}let M;if(this.fileTreeService.isMultipleWorkspace)for(const O of await this.workspaceService.roots){if(M=new o.URI(O.uri),M.isEqual(R))return await this.clipboardService.writeText("./");if(M.isEqualOrParent(R))return await this.clipboardService.writeText(decodeURIComponent(M.relative(R).toString()))}else if(this.workspaceService.workspace)return M=new o.URI(this.workspaceService.workspace.uri),M.isEqual(R)?await this.clipboardService.writeText("./"):await this.clipboardService.writeText(decodeURIComponent(M.relative(R).toString()))},isVisible:()=>!!this.fileTreeModelService.contextMenuFile}),D.registerCommand(o.FILE_COMMANDS.COPY_FILE,{execute:(R,M)=>{if(M&&M.length)this.fileTreeModelService.copyFile(M);else{const O=this.fileTreeModelService.selectedFiles.map(P=>P.uri);O&&O.length&&this.fileTreeModelService.copyFile(O)}},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:(R,M)=>{if(M&&M.length)this.fileTreeModelService.selectChildNode(M);else{const O=this.fileTreeModelService.selectedFiles.map(P=>P.uri);O&&O.length&&this.fileTreeModelService.selectChildNode(O)}},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:(R,M)=>{if(M&&M.length)this.fileTreeModelService.cutFile(M);else{const O=this.fileTreeModelService.selectedFiles.map(P=>P.uri);O&&O.length&&this.fileTreeModelService.cutFile(O)}},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:R=>{if(w(),R)this.fileTreeModelService.pasteFile(R);else if(this.fileTreeModelService.focusedFile){let M;this.fileTreeModelService.activeUri?M=this.fileTreeModelService.activeUri:M=this.fileTreeModelService.focusedFile.uri,this.fileTreeModelService.pasteFile(M)}},isEnabled:()=>this.fileTreeModelService.pasteStore&&this.fileTreeModelService.pasteStore.type!==u.PasteTypes.NONE||this.appConfig.isElectronRenderer}),D.registerCommand(o.FILE_COMMANDS.VSCODE_OPEN_FOLDER,{execute:(R,M)=>{const O=this.injector.get(o.IWindowService),P={newWindow:!0};return typeof M=="boolean"?P.newWindow=M:P.newWindow=typeof M?.forceNewWindow=="boolean"?M.forceNewWindow:!0,R?O.openWorkspace(R,P):this.commandService.executeCommand(o.FILE_COMMANDS.OPEN_FOLDER.id,P)},isVisible:()=>{const R=this.preferenceService.get("application.supportsOpenFolder");return R??!1}}),D.registerCommand(o.FILE_COMMANDS.OPEN_FOLDER,{execute:R=>{const M=this.injector.get(o.IWindowService);this.appConfig.isElectronRenderer?this.injector.get(o.IElectronNativeDialogService).showOpenDialog({title:(0,o.localize)("workspace.openDirectory"),properties:["openDirectory"]}).then(P=>{P&&P.length>0&&M.openWorkspace(o.URI.file(P[0]),R||{newWindow:!0})}):this.injector.get(l.IWindowDialogService).showOpenDialog({title:(0,o.localize)("workspace.openDirectory"),canSelectFiles:!1,canSelectFolders:!0}).then(P=>{var L;P&&P.length>0&&this.injector.get(a.IWorkspaceService).open(P[0],{preserveWindow:(L=R?.newWindow)!==null&&L!==void 0?L:!1})})},isVisible:()=>{const R=this.preferenceService.get("application.supportsOpenFolder");return R??!1}}),D.registerCommand(o.FILE_COMMANDS.OPEN_WORKSPACE,{execute:R=>{if(!this.preferenceService.get("application.supportsOpenWorkspace"))return;const O=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(L=>{L&&L.length>0&&O.openWorkspace(o.URI.file(L[0]),R||{newWindow:!0})}):this.injector.get(l.IWindowDialogService).showOpenDialog({title:(0,o.localize)("workspace.openWorkspace"),canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1,filters:{workspace:[this.workspaceService.workspaceSuffixName]}}).then(L=>{var N;L&&L.length>0&&this.injector.get(a.IWorkspaceService).open(L[0],{preserveWindow:(N=R?.newWindow)!==null&&N!==void 0?N:!1})})},isVisible:()=>{const R=this.preferenceService.get("application.supportsOpenWorkspace");return R??!1}}),D.registerCommand(o.FILE_COMMANDS.REVEAL_IN_EXPLORER,{execute:R=>{var M;let O=R instanceof o.URI?R:R?.uri;const P=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);P&&!P.isVisible&&P.activate(),P&&P.isCollapsed(u.RESOURCE_VIEW_ID)&&P?.setCollapsed(u.RESOURCE_VIEW_ID,!1),!O&&(!((M=this.workbenchEditorService.currentEditor)===null||M===void 0)&&M.currentUri)&&(O=this.workbenchEditorService.currentEditor.currentUri),O&&this.revealFile(o.URI.parse(O.toString()))}}),D.registerCommand(o.FILE_COMMANDS.FOCUS_FILES,{execute:()=>{const R=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);R&&R.activate()}}),D.registerCommand(o.FILE_COMMANDS.OPEN_FILE,{execute:R=>this.windowDialogService.showOpenDialog(R)}),D.registerCommand(o.FILE_COMMANDS.SAVE_FILE,{execute:R=>this.windowDialogService.showSaveDialog(R)}),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(R,M)=>{if(w(),!M.length||!this.workspaceService.isMultiRootWorkspaceOpened)return;const O=await this.workspaceService.roots,P=M.filter(L=>O.find(N=>N.uri===L.toString()));P.length>0&&await this.workspaceService.removeRoots(P)},isVisible:()=>this.workspaceService.isMultiRootWorkspaceOpened&&!!this.fileTreeModelService.contextMenuFile&&!!this.workspaceService.tryGetRoots().find(R=>{var M;return R.uri===((M=this.fileTreeModelService.contextMenuFile)===null||M===void 0?void 0:M.uri.toString())})})}registerKeybindings(D){D.registerKeybinding({command:o.FILE_COMMANDS.COPY_FILE.id,keybinding:"ctrlcmd+c",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.PASTE_FILE.id,keybinding:"ctrlcmd+v",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.CUT_FILE.id,keybinding:"ctrlcmd+x",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.SELECT_CURRENT_NODE.id,keybinding:"ctrlcmd+a",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.RENAME_FILE.id,keybinding:"enter",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.DELETE_FILE.id,keybinding:"ctrlcmd+backspace",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.FILTER_OPEN.id,keybinding:"ctrlcmd+f",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.FILTER_CLOSE.id,keybinding:"esc",when:`${p.FilesExplorerFocusedContext.raw} && ${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.NEXT.id,keybinding:"down",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.PREV.id,keybinding:"up",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.EXPAND.id,keybinding:"right",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.COLLAPSE.id,keybinding:"left",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.TOGGLE_OR_OPEN.id,keybinding:"space",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.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:u.RESOURCE_VIEW_ID,when:`view == '${u.RESOURCE_VIEW_ID}' && !config.explorer.autoReveal && !${p.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:u.RESOURCE_VIEW_ID,when:`view == '${u.RESOURCE_VIEW_ID}' && !${p.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:u.RESOURCE_VIEW_ID,when:`view == '${u.RESOURCE_VIEW_ID}' && !${p.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:u.RESOURCE_VIEW_ID,toggledWhen:`${p.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:u.RESOURCE_VIEW_ID,when:`view == '${u.RESOURCE_VIEW_ID}' && !${p.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:u.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:u.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()}};e.FileTreeContribution=A,n.__decorate([(0,s.Autowired)(s.INJECTOR_TOKEN),n.__metadata("design:type",s.Injector)],A.prototype,"injector",void 0),n.__decorate([(0,s.Autowired)(u.IFileTreeService),n.__metadata("design:type",v.FileTreeService)],A.prototype,"fileTreeService",void 0),n.__decorate([(0,s.Autowired)(c.IMainLayoutService),n.__metadata("design:type",Object)],A.prototype,"mainLayoutService",void 0),n.__decorate([(0,s.Autowired)(g.IProgressService),n.__metadata("design:type",Object)],A.prototype,"progressService",void 0),n.__decorate([(0,s.Autowired)(a.IWorkspaceService),n.__metadata("design:type",Object)],A.prototype,"workspaceService",void 0),n.__decorate([(0,s.Autowired)(y.FileTreeModelService),n.__metadata("design:type",y.FileTreeModelService)],A.prototype,"fileTreeModelService",void 0),n.__decorate([(0,s.Autowired)(E.IDecorationsService),n.__metadata("design:type",E.IDecorationsService)],A.prototype,"decorationService",void 0),n.__decorate([(0,s.Autowired)(d.WorkbenchEditorService),n.__metadata("design:type",d.WorkbenchEditorService)],A.prototype,"workbenchEditorService",void 0),n.__decorate([(0,s.Autowired)(o.CommandService),n.__metadata("design:type",Object)],A.prototype,"commandService",void 0),n.__decorate([(0,s.Autowired)(l.IWindowDialogService),n.__metadata("design:type",Object)],A.prototype,"windowDialogService",void 0),n.__decorate([(0,s.Autowired)(o.IClipboardService),n.__metadata("design:type",Object)],A.prototype,"clipboardService",void 0),n.__decorate([(0,s.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],A.prototype,"preferenceService",void 0),n.__decorate([(0,s.Autowired)(o.QuickOpenService),n.__metadata("design:type",Object)],A.prototype,"quickOpenService",void 0),n.__decorate([(0,s.Autowired)(c.IViewsRegistry),n.__metadata("design:type",Object)],A.prototype,"viewsRegistry",void 0),n.__decorate([(0,s.Autowired)(o.IApplicationService),n.__metadata("design:type",Object)],A.prototype,"appService",void 0),n.__decorate([(0,s.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],A.prototype,"appConfig",void 0),e.FileTreeContribution=A=n.__decorate([(0,_.Domain)(b.MenuContribution,o.CommandContribution,o.KeybindingContribution,o.TabBarToolbarContribution,o.ClientAppContribution,c.MainLayoutContribution)],A)},2812:(x,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeModel=void 0;const s=t(85608),o=t(76003),p=t(97267),b=t(41869),g=t(69959),_=t(93239);let E=n=class extends p.TreeModel{constructor(h){super(),this.flushDispatchChangeDelayer=new b.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this.init(h)}init(h){this.root=h,this.root.watcher.on(p.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()})}};e.FileTreeModel=E,E.DEFAULT_FLUSH_DELAY=100,s.__decorate([(0,o.Autowired)(_.FileTreeDecorationService),s.__metadata("design:type",_.FileTreeDecorationService)],E.prototype,"decorationService",void 0),e.FileTreeModel=E=n=s.__decorate([(0,o.Injectable)({multiple:!0}),s.__param(0,(0,o.Optional)()),s.__metadata("design:paramtypes",[g.Directory])],E)},46377:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FILE_TREE_BADGE_LIMIT=e.FILE_TREE_NODE_HEIGHT=e.FileTreeNode=void 0;const n=t(85608),s=n.__importDefault(t(53373)),o=n.__importDefault(t(14041)),p=t(97267),b=t(41869),g=t(69959),_=n.__importDefault(t(89200)),{Path:E}=b.path,d=({item:h,onClick:c,onDoubleClick:r,onContextMenu:l,dndService:a,itemType:u,decorationService:m,labelService:f,leftPadding:v=8,onTwistierClick:y,decorations:S,defaultLeftPadding:A=8,template:T,hasFolderIcons:D,hasFileIcons:w,hidesExplorerArrows:I,hasPrompt:R,iconService:M})=>{const[O,P]=o.default.useState(-1),L=u===p.TreeNodeType.RenamePrompt,N=u===p.TreeNodeType.NewPrompt,k=L||N,B=!k&&h.name.indexOf(E.separator)>=0,F=(0,b.useDesignStyles)(_.default.expansion_toggle,"expansion_toggle"),W=(0,b.useDesignStyles)(_.default.file_tree_node,"file_tree_node"),V=k?null:m.getDecoration(h.uri,g.Directory.is(h)),H=ge=>{(u===p.TreeNodeType.TreeNode||u===p.TreeNodeType.CompositeTreeNode)&&(B&&P(h.name.split(E.separator).length-1),c(ge,h,u))},K=ge=>{(u===p.TreeNodeType.TreeNode||u===p.TreeNodeType.CompositeTreeNode)&&(B&&P(h.name.split(E.separator).length-1),r(ge,h,u))},z=ge=>{(u===p.TreeNodeType.TreeNode||u===p.TreeNodeType.CompositeTreeNode)&&(y?y(ge,h,u):c(ge,h,u))},G=o.default.useCallback(ge=>{ge.nativeEvent.which!==0&&(u===p.TreeNodeType.TreeNode||u===p.TreeNodeType.CompositeTreeNode)&&l(ge,h,u)},[l,h]),j=o.default.useCallback(ge=>{const{handleDragStart:te}=a;(u===p.TreeNodeType.TreeNode||u===p.TreeNodeType.CompositeTreeNode)&&te(ge,h)},[a,h]),U=o.default.useCallback(ge=>{const{handleDragLeave:te}=a;(u===p.TreeNodeType.TreeNode||u===p.TreeNodeType.CompositeTreeNode)&&te(ge,h)},[a,h]),$=o.default.useCallback(ge=>{const{handleDragEnter:te}=a;(u===p.TreeNodeType.TreeNode||u===p.TreeNodeType.CompositeTreeNode)&&te(ge,h)},[a,h]),Y=o.default.useCallback(ge=>{const{handleDrop:te}=a;(u===p.TreeNodeType.TreeNode||u===p.TreeNodeType.CompositeTreeNode)&&te(ge,h)},[a,h]),Q=o.default.useCallback(ge=>{const{handleDragOver:te}=a;(u===p.TreeNodeType.TreeNode||u===p.TreeNodeType.CompositeTreeNode)&&te(ge,h)},[a,h]);let ee=u===p.TreeNodeType.CompositeTreeNode,re;k?N?(ee=h.type===p.TreeNodeType.CompositeTreeNode,re=`${A+(h.parent.depth+1||0)*(v||0)+(ee?0:D?I?0:20:0)}px`):(ee=h.target.type===p.TreeNodeType.CompositeTreeNode,re=`${A+(h.target.depth||0)*(v||0)+(ee?0:D?I?0:20:0)}px`):re=`${A+(h.depth||0)*(v||0)+(ee?0:D?I?0:20:0)}px`;const ae={color:V?V.color:"",height:e.FILE_TREE_NODE_HEIGHT,lineHeight:`${e.FILE_TREE_NODE_HEIGHT}px`,paddingLeft:re,opacity:R&&!k?".6":"1"},de=(ge,te)=>{if(S&&S?.classlist.indexOf(_.default.mod_loading)>-1)return o.default.createElement(p.Loading,null);if(k&&ge instanceof p.PromptHandle){let X=!1;if(L?X=ge.target.type===p.TreeNodeType.CompositeTreeNode:X=ge.type===p.TreeNodeType.CompositeTreeNode,X)return o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_segment,F,(0,b.getIcon)("arrow-right"),{[`${_.default.mod_collapsed}`]:N||!(L&&ge.target.type===p.TreeNodeType.CompositeTreeNode&&ge.target.expanded)})})}else return o.default.createElement("div",{onClick:te,className:(0,s.default)(_.default.file_tree_node_segment,F,(0,b.getIcon)("arrow-right"),{[`${_.default.mod_collapsed}`]:!ge.expanded})})},q=ge=>{let te,X;k&&ge instanceof p.PromptHandle?ge instanceof p.RenamePromptHandle?(te=ge.target.uri.resolve(ge.$.value),X=g.Directory.is(ge.target)):(te=ge.parent.uri.resolve(ge.$.value),X=ge.type===p.TreeNodeType.CompositeTreeNode):(te=ge.uri,X=ge.filestat.isDirectory);const oe=f.getIcon(te,{isDirectory:X,isOpenedDirectory:X&&ge.expanded});return X&&!D||!X&&!w?null:o.default.createElement("div",{className:(0,s.default)(_.default.file_icon,oe,{expanded:X&&ge.expanded}),style:{height:e.FILE_TREE_NODE_HEIGHT,lineHeight:`${e.FILE_TREE_NODE_HEIGHT}px`}})},_e=ge=>{if(T)return o.default.createElement(T,null);if(k&&ge instanceof p.PromptHandle)return o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_segment,_.default.file_tree_node_inputbox)},o.default.createElement("div",{className:(0,s.default)("input-box",_.default.file_tree_node_prompt_box)},o.default.createElement(ge.ProxiedInput,{wrapperStyle:{height:e.FILE_TREE_NODE_HEIGHT,padding:"0 5px"}})));if(B){const te=ge.displayName.split(E.separator),X=te.map((oe,se)=>{const he=te.slice(0,se+1).join(E.separator),ue=Ae=>{Ae.stopPropagation(),P(se);const Ie=h.parent.uri.resolve(te.slice(0,se+1).join(E.separator));c(Ae,h,u,Ie)},ve=Ae=>{Ae.stopPropagation(),P(se);const Ie=h.parent.uri.resolve(te.slice(0,se+1).join(E.separator));l(Ae,h,u,Ie)},ne=Ae=>{Ae.stopPropagation(),Ae.preventDefault(),O!==se&&(P(se),a.handleDragOver(Ae,h))},fe=Ae=>{Ae.stopPropagation(),Ae.preventDefault(),P(-1)},Ce=Ae=>{Ae.stopPropagation(),O!==se&&P(se);const Ie=h.parent.uri.resolve(te.slice(0,se+1).join(E.separator));a.handleDragStart(Ae,h,Ie)},be=Ae=>{Ae.stopPropagation();const Ie=h.parent.uri.resolve(te.slice(0,se+1).join(E.separator));a.handleDrop(Ae,h,Ie)},Se=(0,s.default)(O===se&&_.default.active,_.default.compact_name);return o.default.createElement("span",{key:he},o.default.createElement("a",{className:Se,draggable:!0,onContextMenu:ve,onDragStart:Ce,onDragOver:ne,onDragLeave:fe,onDrop:be,onClick:ue},oe),se!==te.length-1?o.default.createElement("span",{className:_.default.compact_name_separator},E.separator):null)});return o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_segment,_.default.file_tree_node_displayname)},X)}return o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_segment,_.default.file_tree_node_displayname)},f.getName(ge.uri)||ge.displayName)},pe=()=>o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_segment,_.default.file_tree_node_tail)},J()),J=()=>V?o.default.createElement("div",{className:_.default.file_tree_node_status},(0,b.transformLabelWithCodicon)(V.badge.slice(),{color:"inherit"},M.fromString.bind(M))):null,le=ge=>{if(I)return null;if(ee)return de(ge,z);if(k)return de(ge,()=>{})},ie=()=>{let ge=h.tooltip;return V&&V.badge&&(ge+=` \u2022 ${V.tooltip}`),ge};return o.default.createElement("div",{key:h.id,onClick:H,onDoubleClick:K,onContextMenu:G,onDragStart:j,onDragOver:Q,onDragEnter:$,onDragLeave:U,onDrop:Y,title:ie(),className:(0,s.default)(W,S?S.classlist:null),style:ae,draggable:u===p.TreeNodeType.TreeNode||u===p.TreeNodeType.CompositeTreeNode,"data-id":h.id},o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_content)},le(h),q(h),o.default.createElement("div",{className:k?_.default.file_tree_node_prompt_wrap:_.default.file_tree_node_overflow_wrap},_e(h)),pe()))};e.FileTreeNode=d,e.FILE_TREE_NODE_HEIGHT=22,e.FILE_TREE_BADGE_LIMIT=99},56384:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTree=e.FILE_TREE_FILTER_DELAY=e.FILTER_AREA_HEIGHT=void 0;const n=t(85608),s=n.__importDefault(t(53373)),o=n.__importStar(t(14041)),p=t(97267),b=t(41869),g=t(68974),_=t(24429),E=t(87420),d=t(6250),h=t(46377),c=n.__importDefault(t(2613)),r=t(97738);e.FILTER_AREA_HEIGHT=30,e.FILE_TREE_FILTER_DELAY=500;const l=(0,p.RecycleTreeFilterDecorator)(p.RecycleTree),a=({viewState:m})=>{const[f,v]=(0,o.useState)(!1),[y,S]=(0,o.useState)(!0),[A,T]=(0,o.useState)(!1),[D,w]=(0,o.useState)(!1),[I,R]=(0,o.useState)(),M=(0,o.useRef)(null),O=(0,o.useRef)(new b.DisposableCollection),{height:P}=m,L=(0,b.useInjectable)(d.IFileTreeService),{iconService:N,locationToCurrentFile:k,filterMode:B,indent:F,baseIndent:W}=L,V=(0,b.useInjectable)(r.FileTreeModelService),[H,K]=(0,o.useState)({indent:F,baseIndent:W}),[z,G]=(0,o.useState)(B),[j,U]=(0,o.useState)(N.currentTheme||{hasFolderIcons:!0,hasFileIcons:!0,hidesExplorerArrows:!0}),$=(0,o.useCallback)(he=>Y(he)?!1:he.shiftKey,[]),Y=(0,o.useCallback)(he=>{const{metaKey:ue,ctrlKey:ve}=he;return b.isOSX&&ue||ve},[]),Q=(0,o.useCallback)((he,ue,ve,ne)=>{he.stopPropagation();const{handleItemClick:fe,handleItemToggleClick:Ce,handleItemRangeClick:be}=V;if(!ue)return;const Se=$(he),Ae=Y(he);Se?be(ue,ve):Ae?Ce(ue,ve):fe(ue,ve,ne)},[]),ee=(0,o.useCallback)((he,ue,ve)=>{he.stopPropagation();const{handleItemDoubleClick:ne}=V;ue&&ne(ue,ve)},[]),re=(0,o.useCallback)((he,ue)=>{he.stopPropagation();const{toggleDirectory:ve}=V;ve(ue)},[]);(0,o.useEffect)(()=>{f&&V.onFileTreeModelChange(async he=>{S(!0),he&&await he.ensureReady,R(he),S(!1)})},[f]),(0,o.useEffect)(()=>{var he,ue,ve;const ne=new b.CancellationTokenSource;return q(ne.token),(he=O.current)===null||he===void 0||he.push(N.onThemeChange(fe=>{U(fe)})),(ue=O.current)===null||ue===void 0||ue.push(L.onTreeIndentChange(({indent:fe,baseIndent:Ce})=>{K({indent:fe,baseIndent:Ce})})),(ve=O.current)===null||ve===void 0||ve.push(L.onFilterModeChange(fe=>{G(fe)})),()=>{var fe;ne.cancel(),(fe=O.current)===null||fe===void 0||fe.dispose()}},[]);const ae=(0,o.useCallback)((he,ue)=>{let ve;if(he&&ue)for(ve=he.parentNode;ve;){if(ue===ve)return!0;ve=ve.parentNode}return!1},[]),de=(0,o.useCallback)(he=>{ae(he.relatedTarget,M.current)||!he.relatedTarget||(T(!1),V.handleTreeBlur())},[M.current]);(0,o.useEffect)(()=>{z||(V.fileTreeHandle&&V.fileTreeHandle.clearFilter(),V.selectedFiles.length===1&&V.location(V.selectedFiles[0].uri))},[z]),(0,o.useEffect)(()=>{const he=new b.DisposableCollection;return I&&(he.push(V.onDidFocusedFileChange(ue=>{ue?ue.isEqual((I?.root).uri)?A||T(!A):A&&T(!A):ue||A&&T(!A)})),he.push(V.onDidContextMenuFileChange(ue=>{ue?ue.isEqual((I?.root).uri)?A||T(!A):A&&T(!A):ue||A&&T(!A)}))),()=>{he.dispose()}},[I,A]);const q=(0,o.useCallback)(async he=>{var ue;if(await V.whenReady,!he.isCancellationRequested){if(V.treeModel){if(await V.treeModel.ensureReady,R(V.treeModel),he.isCancellationRequested)return;M.current&&L.initContextKey(M.current)}S(!1),!((ue=O.current)===null||ue===void 0)&&ue.disposed||v(!0)}},[V,O.current]),_e=(0,o.useCallback)(he=>{V.handleTreeHandler({...he,getModel:()=>V.treeModel,hasDirectFocus:()=>M.current===document.activeElement})},[M.current,I]),pe=(0,o.useCallback)(()=>{const{handleItemClick:he}=V;he()},[]),J=(0,o.useCallback)(()=>{V.handleDblClick()},[]),le=(0,o.useCallback)(()=>{const{handleTreeFocus:he}=V;he()},[]),ie=(0,o.useCallback)(he=>{const{handleContextMenu:ue}=V;ue(he)},[]),ge=(0,o.useCallback)(he=>{he.stopPropagation(),he.preventDefault()},[]),te=(0,o.useCallback)(he=>{he.preventDefault(),w(!0)},[]),X=(0,o.useCallback)(()=>{w(!1)},[]),oe=(0,o.useCallback)(he=>{const{handleDrop:ue}=V.dndService;w(!1),ue(he)},[]),se=(0,o.useCallback)((he,ue,ve,ne)=>{const{handleContextMenu:fe}=V;fe(he,ue,ne)},[]);return o.default.createElement("div",{className:(0,s.default)(c.default.file_tree,D&&c.default.outer_drag_over,A&&c.default.outer_active),tabIndex:-1,ref:M,onClick:pe,onDoubleClick:J,onFocus:le,onBlur:de,onContextMenu:ie,draggable:!0,onDragStart:ge,onDragLeave:X,onDragOver:te,onDrop:oe},o.default.createElement(u,{isLoading:y,isReady:f,height:P,model:I,iconTheme:j,treeIndent:H,filterMode:z,locationToCurrentFile:k,onTreeReady:_e,onContextMenu:se,onItemClick:Q,onItemDoubleClick:ee,onTwistierClick:re}))};e.FileTree=a;const u=(0,o.memo)(({isReady:m,isLoading:f,height:v,model:y,filterMode:S,treeIndent:A,iconTheme:T,onTreeReady:D,onItemClick:w,onItemDoubleClick:I,onContextMenu:R,onTwistierClick:M})=>{const O=(0,b.useInjectable)(d.IFileTreeService),P=(0,b.useInjectable)(E.IIconService),{decorationService:L,labelService:N,locationToCurrentFile:k}=O,B=(0,b.useInjectable)(r.FileTreeModelService),F=(0,o.useCallback)(W=>o.default.createElement(h.FileTreeNode,{item:W.item,itemType:W.itemType,template:W.template,decorationService:L,labelService:N,iconService:P,dndService:B.dndService,decorations:B.decorations.getDecorations(W.item),onClick:w,onDoubleClick:I,onTwistierClick:M,onContextMenu:R,defaultLeftPadding:A.baseIndent,leftPadding:A.indent,hasPrompt:W.hasPrompt,hasFolderIcons:T.hasFolderIcons,hasFileIcons:T.hasFileIcons,hidesExplorerArrows:T.hidesExplorerArrows}),[y,A,T]);return m?f?o.default.createElement(g.Progress,{loading:!0}):y?o.default.createElement(l,{height:v,itemHeight:h.FILE_TREE_NODE_HEIGHT,onReady:D,model:y,filterEnabled:S,filterAfterClear:k,filterAutoFocus:!0,leaveBottomBlank:!0},F):o.default.createElement(_.WelcomeView,{viewId:d.FILE_EXPLORER_WELCOME_ID}):o.default.createElement(g.Progress,{loading:!0})});u.displayName="FileTreeView"},57781:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeService=void 0;const n=t(85608),s=t(76003),o=t(97267),p=t(41869),b=t(18193),g=t(26542),_=t(42933),E=t(52416),d=t(51500),h=t(6250),c=t(69959),r=t(88014),l=t(93239),{Path:a}=p.path;let u=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 p.Emitter,this.onTreeIndentChangeEmitter=new p.Emitter,this.onFilterModeChangeEmitter=new p.Emitter,this.onNodeRefreshedEmitter=new p.Emitter,this._filterMode=!1,this._refreshable=!0,this.refreshEffectNode=()=>{const f=this.effectedNodes.slice(0);if(this.effectedNodes=[],f.find(y=>c.Directory.isRoot(y)))this.refresh();else for(const y of f)this.refresh(y)},this.flushEventQueue=async()=>{if(!this._changeEventDispatchQueue||this._changeEventDispatchQueue.size===0)return;const f=Array.from(this._changeEventDispatchQueue),v=this.sortPaths(f);(!this.refreshCancelToken||this.refreshCancelToken.token.isCancellationRequested)&&(this.refreshCancelToken=new p.CancellationTokenSource);const y=(0,p.pSeries)(v.map(S=>async()=>{c.Directory.is(S.node)&&await S.node.refresh(this.refreshCancelToken)}));return this._changeEventDispatchQueue.clear(),await y},this.locationToCurrentFile=()=>{this.commandService.executeCommand(p.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(f=>{this._roots=f;const v=new p.URI(f[0].uri),y=new c.Directory(this,void 0,v,v.displayName,f[0],this.fileTreeAPI.getReadableTooltip(v));this.root=y,this.onWorkspaceChangeEmitter.fire(y),this.refresh()})),this.toDispose.push(this.workspaceService.onWorkspaceFileExcludeChanged(()=>{this.refresh()})),this.toDispose.push(p.Disposable.create(()=>{var f;(f=this._root)===null||f===void 0||f.dispose(),this._roots=null})),this.toDispose.push(this.corePreferences.onPreferenceChanged(f=>{f.preferenceName==="explorer.fileTree.baseIndent"?(this._baseIndent=f.newValue||8,this.onTreeIndentChangeEmitter.fire({indent:this.indent,baseIndent:this.baseIndent})):f.preferenceName==="explorer.fileTree.indent"?(this._indent=f.newValue||8,this.onTreeIndentChangeEmitter.fire({indent:this.indent,baseIndent:this.baseIndent})):f.preferenceName==="explorer.compactFolders"&&(this._isCompactMode=f.newValue,this.refresh())}))}initContextKey(f){this.fileContextKey.initScopedContext(f)}startWatchFileEvent(){return this._readyToWatch=!0,Promise.all(this._watchRootsQueue.map(f=>this.watchFilesChange(f)))}async resolveChildren(f){var v,y,S,A;let T=[];if(f){if(c.Directory.isRoot(f)&&this.isMultipleWorkspace){const D=await this.workspaceService.roots;for(const w of D){const I=this.fileTreeAPI.toNode(this,w,f,this.workspaceService.getWorkspaceName(new p.URI(w.uri)));this.watchFilesChange(new p.URI(w.uri)),T=T.concat(I),(I.filestat.isSymbolicLink||I.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(I.filestat.uri,I)}return T}if(f.uri){const D=await this.fileTreeAPI.resolveChildren(this,f.uri.toString(),f,this.isCompactMode&&!c.Directory.isRoot(f));T=D.children,T.forEach(I=>{(I.filestat.isSymbolicLink||I.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(I.filestat.uri,I)});const w=D.filestat;if(w&&this.isCompactMode&&!c.Directory.isRoot(f)){const I=new p.URI(w.uri),R=f.parent;if(f&&R){let M=f.name;if(f.filestat.isSymbolicLink){const O=(y=new p.URI(f.filestat.realUri).relative(I))===null||y===void 0?void 0:y.toString();O&&(M=O,M=[f.uri.displayName].concat(M.split(a.separator)).join(a.separator))}else R.filestat.isSymbolicLink?M=(S=new p.URI(R.filestat.realUri).relative(I))===null||S===void 0?void 0:S.toString():M=(A=R.uri.relative(I))===null||A===void 0?void 0:A.toString();M&&M!==f.name&&f.updateMetaData({name:M,uri:I,tooltip:this.fileTreeAPI.getReadableTooltip(I),fileStat:w})}}return T}}else if(this._roots||(this._roots=await this.workspaceService.roots),this.isMultipleWorkspace){const D=new p.URI((v=this.workspaceService.workspace)===null||v===void 0?void 0:v.uri);let w=D.displayName;w=w.slice(0,w.lastIndexOf("."));const I={...this.workspaceService.workspace,isDirectory:!0},R=new c.Directory(this,void 0,D,w,I,this.fileTreeAPI.getReadableTooltip(D));return this.root=R,[R]}else if(this._roots.length>0)return T=await(await this.fileTreeAPI.resolveChildren(this,this._roots[0])).children,T.forEach(D=>{const w=this.workspaceService.getWorkspaceName(D.uri);w&&w!==D.name&&D.updateMetaData({name:w}),(D.filestat.isSymbolicLink||D.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(D.filestat.uri,D)}),this.watchFilesChange(new p.URI(this._roots[0].uri)),this.root=T[0],T;return[]}async watchFilesChange(f){if(!this._readyToWatch){this._watchRootsQueue.push(f);return}const v=await this.fileServiceClient.watchFileChanges(f);this.toDispose.push(v),this.toDispose.push(v.onFilesChanged(y=>{this.onFilesChanged(y)})),this._fileServiceWatchers.set(f.toString(),v)}updateRefreshable(f){var v;f!==this.refreshable&&(this._refreshable=f,this._refreshable?this.doHandleQueueChange():(v=this.refreshCancelToken)===null||v===void 0||v.cancel())}isContentFile(f){return!!f&&"filestat"in f&&!f.filestat.isDirectory}isFileContentChanged(f){return f.type===_.FileChangeType.UPDATED&&this.isContentFile(this.getNodeByPathOrUri(f.uri))}getAffectedChanges(f){const v=[];for(const y of f)this.isFileContentChanged(y)||v.push(y);return v}isRootAffected(f){return this._roots?f.some(v=>v.type>_.FileChangeType.UPDATED&&this._roots&&this._roots.find(y=>v.uri.indexOf(y.uri)>=0)):!1}async onFilesChanged(f){const v=await this.getAffectedNodes(this.getAffectedChanges(f));return v.length>0?this.effectedNodes=this.effectedNodes.concat(v):!(v.length>0)&&this.isRootAffected(f)&&this.effectedNodes.push(this.root),this.refreshEffectNode()}async getFileTreeNodePathByUri(f){var v,y,S,A,T,D;if(!f)return;let w;if(this.isMultipleWorkspace){if(this._roots||(this._roots=await this.workspaceService.roots),w=(A=this._roots.find(I=>new p.URI(I.uri).isEqualOrParent(f)))===null||A===void 0?void 0:A.uri,w){const I=new p.URI(w);if(I.isEqualOrParent(f))return new a(((T=this.root)===null||T===void 0?void 0:T.path)||"/").join(I.displayName).join(((D=I.relative(f))===null||D===void 0?void 0:D.toString())||"").toString()}}else if(w=(v=this.workspaceService.workspace)===null||v===void 0?void 0:v.uri,w){const I=new p.URI(w);if(I.isEqualOrParent(f))return new a(((y=this.root)===null||y===void 0?void 0:y.path)||"").join(((S=I.relative(f))===null||S===void 0?void 0:S.toString())||"").toString()}}async moveNodeByPath(f,v,y,S,A=o.TreeNodeType.TreeNode){const T=new a(f.path).join(y).toString(),D=new a(v.path).join(S).toString();if(T&&D&&D!==T){const w=f.moveNode(T,D);return w&&c.File.is(w)&&(w.updateMetaData({uri:v.uri.resolve(S),fileStat:{...v.filestat,uri:v.uri.resolve(S).toString(),isDirectory:A!==o.TreeNodeType.TreeNode},tooltip:this.fileTreeAPI.getReadableTooltip(v.uri.resolve(S))}),c.Directory.is(w)&&this.updateChildren(w)),w}}async updateChildren(f){const v=f.children;if(!(!v||v.length===0)){for(const y of v)if(c.File.is(y)){const S=f.uri.resolve(y.uri.displayName);y.updateMetaData({uri:S,fileStat:{...y.filestat,uri:S.toString(),isDirectory:!!c.Directory.is(y)},tooltip:this.fileTreeAPI.getReadableTooltip(S)}),c.Directory.is(y)&&this.updateChildren(y)}}}async addNode(f,v,y){let S,A;const T=a.splitPath(v);if(T.length>1){let w=f.uri;for(const I of T)w=w.resolve(I);!this.isCompactMode||c.Directory.isRoot(f)?A=T[0]:y===o.TreeNodeType.CompositeTreeNode?A=v:A=T.slice(0,T.length-1).join(a.separator)}else A=v;S={uri:f.uri.resolve(A).toString(),isDirectory:y===o.TreeNodeType.CompositeTreeNode||T.length>1,isSymbolicLink:!1,lastModification:new Date().getTime()};const D=await this.fileTreeAPI.toNode(this,S,f,A);return D&&f.addNode(D),D}async deleteAffectedNodeByPath(f,v){var y,S;const A=this.getNodeByPathOrUri(f);A&&A.parent&&(this.isCompactMode&&!v?((y=A.parent.children)===null||y===void 0?void 0:y.length)===2?this.refresh((S=A.parent)===null||S===void 0?void 0:S.parent):this.refresh(A.parent):A.parent.removeNode(A.path))}async deleteAffectedNodes(f,v=[]){const y=[];for(const S of f){const A=this.getNodeByPathOrUri(S);A&&c.File.is(A)&&y.push(A)}for(const S of y)!S?.parent||this._changeEventDispatchQueue.has(S?.parent.path)||await this.deleteAffectedNodeByPath(S.path);return v.filter(S=>S.type!==_.FileChangeType.DELETED)}async getAffectedNodes(f){const v=[];for(const y of f){const S=new p.URI(y.uri),A=this.getNodeByPathOrUri(S.parent);A&&v.push(A)}return v}isFileURI(f){return/^file:\/\//.test(f)}getNodeByPathOrUri(f){var v,y,S,A;let T,D;if(typeof f!="string"?(D=f,f=f.toString()):this.isFileURI(f)?D=new p.URI(f):!this.isFileURI(f)&&typeof f=="string"&&(T=f),this.isFileURI(f)&&D){if(this._symbolicFiles.has(D?.toString()))return this._symbolicFiles.get(D.toString());let w;if(this.isMultipleWorkspace?this._roots&&(w=(y=this._roots.find(I=>new p.URI(I.uri).isEqualOrParent(D)))===null||y===void 0?void 0:y.uri):w=(v=this.workspaceService.workspace)===null||v===void 0?void 0:v.uri,this.root&&w){const I=new p.URI(w);if(I.isEqualOrParent(D)){const R=I.relative(D);R&&(T=new a(this.root.path).join(R.toString()).toString())}}}if(T){const w=(S=this.root)===null||S===void 0?void 0:S.getTreeNodeByPath(T);if(!w){let I;const R=T.split(a.separator);for(;R.length>=1;){R.pop();const M=R.join(a.separator);if(I=(A=this.root)===null||A===void 0?void 0:A.getTreeNodeByPath(M),I)break}if(I&&c.Directory.is(I)){for(const M of I.children||[])if(M.path.includes(T))return M}}return w}}sortComparator(f,v){return f.constructor===v.constructor?f.name.localeCompare(v.name,"en",{numeric:!0}):f.type===o.TreeNodeType.CompositeTreeNode?-1:v.type===o.TreeNodeType.CompositeTreeNode?1:0}get contextMenuContextKeyService(){return this.fileContextKey?this.fileContextKey.service:this.contextKeyService}reWatch(){for(const[f,v]of this._fileServiceWatchers)v.dispose(),this.watchFilesChange(new p.URI(f))}get isMultipleWorkspace(){return!!this.workspaceService.workspace&&!this.workspaceService.workspace.isDirectory}getDisplayName(f){return this.workspaceService.getWorkspaceName(f)}async refresh(f=this.root){if(f)return c.Directory.is(f)||c.File.is(f)&&f.parent&&(f=f.parent),this._changeEventDispatchQueue.add(f.path),this.doHandleQueueChange()}async doHandleQueueChange(){if(this.refreshable)try{await this.flushEventQueue()}catch(f){this.logger.error("flush file change event queue error:",f)}finally{this.onNodeRefreshedEmitter.fire()}}sortPaths(f){const y=f.slice().map(A=>({node:this.getNodeByPathOrUri(A),path:A})).filter(A=>A&&!!A.node);f.length>1&&y.sort((A,T)=>{var D,w;const I=((D=A.node)===null||D===void 0?void 0:D.depth)||0,R=((w=T.node)===null||w===void 0?void 0:w.depth)||0;return I-R});const S=[];for(let A=y.length-1;A>=0;A--){const T=y[A];let D=!1;for(let w=0;w<A;w++){const I=y[w];c.Directory.is(I)&&T.node.path.startsWith(I.node.path)&&(D=!0)}D||S.push(T)}return S}openFile(f){const v=this.preferenceService.get("editor.previewMode");this.commandService.executeCommand(p.EDITOR_COMMANDS.OPEN_RESOURCE.id,f,{disableNavigate:!0,preview:v})}openAndFixedFile(f){this.commandService.executeCommand(p.EDITOR_COMMANDS.OPEN_RESOURCE.id,f,{disableNavigate:!0,preview:!1,focus:!0})}openToTheSide(f){this.commandService.executeCommand(p.EDITOR_COMMANDS.OPEN_RESOURCE.id,f,{disableNavigate:!0,split:4})}compare(f,v){this.commandService.executeCommand(p.EDITOR_COMMANDS.COMPARE.id,{original:f,modified:v})}toggleFilterMode(){var f;this._filterMode=!this.filterMode,this.onFilterModeChangeEmitter.fire(this.filterMode),(f=this.fileContextKey)===null||f===void 0||f.filesExplorerFilteredContext.set(this.filterMode),this.filterMode===!1&&this.commandService.executeCommand(p.FILE_COMMANDS.LOCATION.id)}};e.FileTreeService=u,n.__decorate([(0,s.Autowired)(h.IFileTreeAPI),n.__metadata("design:type",Object)],u.prototype,"fileTreeAPI",void 0),n.__decorate([(0,s.Autowired)(p.CommandService),n.__metadata("design:type",Object)],u.prototype,"commandService",void 0),n.__decorate([(0,s.Autowired)(p.IContextKeyService),n.__metadata("design:type",Object)],u.prototype,"contextKeyService",void 0),n.__decorate([(0,s.Autowired)(d.IWorkspaceService),n.__metadata("design:type",Object)],u.prototype,"workspaceService",void 0),n.__decorate([(0,s.Autowired)(b.CorePreferences),n.__metadata("design:type",Object)],u.prototype,"corePreferences",void 0),n.__decorate([(0,s.Autowired)(p.PreferenceService),n.__metadata("design:type",Object)],u.prototype,"preferenceService",void 0),n.__decorate([(0,s.Autowired)(g.LabelService),n.__metadata("design:type",g.LabelService)],u.prototype,"labelService",void 0),n.__decorate([(0,s.Autowired)(l.FileTreeDecorationService),n.__metadata("design:type",l.FileTreeDecorationService)],u.prototype,"decorationService",void 0),n.__decorate([(0,s.Autowired)(_.IFileServiceClient),n.__metadata("design:type",Object)],u.prototype,"fileServiceClient",void 0),n.__decorate([(0,s.Autowired)(E.IIconService),n.__metadata("design:type",Object)],u.prototype,"iconService",void 0),n.__decorate([(0,s.Autowired)(p.ILogger),n.__metadata("design:type",Object)],u.prototype,"logger",void 0),n.__decorate([(0,s.Autowired)(r.FileContextKey),n.__metadata("design:type",r.FileContextKey)],u.prototype,"fileContextKey",void 0),e.FileTreeService=u=n.__decorate([(0,s.Injectable)()],u)},83709:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeNextModule=void 0;const n=t(85608),s=t(41869),o=t(72665),p=t(41103),b=t(6250),g=t(89508),_=t(40439),E=t(57781),d=t(88808),h=t(93239),c=t(97738),r=t(24861);let l=class extends s.BrowserModule{constructor(){super(...arguments),this.providers=[{token:b.IFileTreeAPI,useClass:d.FileTreeAPI},{token:h.FileTreeDecorationService,useClass:h.FileTreeDecorationService},{token:b.IFileTreeService,useClass:E.FileTreeService},{token:c.FileTreeModelService,useClass:c.FileTreeModelService},{token:o.IWindowDialogService,useClass:g.WindowDialogServiceImpl},_.FileTreeContribution]}};e.FileTreeNextModule=l,e.FileTreeNextModule=l=n.__decorate([(0,s.Domain)(r.name),(0,s.ModuleDependencies)([p.WorkspaceModule])],l)},88808:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeAPI=void 0;const n=t(85608),s=t(76003),o=t(41869),p=t(43718),b=t(42933),g=t(72665),_=t(26199),E=t(69959);let d=class{constructor(){this.cacheFileStat=new Map}async resolveChildren(c,r,l,a){var u;let m;if(!this.userhomePath){const f=await this.fileServiceClient.getCurrentUserHome();f&&(this.userhomePath=new p.URI(f.uri))}if(typeof r=="string"?m=await this.fileServiceClient.getFileStat(r):m=await this.fileServiceClient.getFileStat(r.uri),m){if(((u=m.children)===null||u===void 0?void 0:u.length)===1&&m.children[0].isDirectory&&a)return await this.resolveChildren(c,m.children[0].uri,l,a);{const f={...m,isInSymbolicDirectory:l?.filestat.isSymbolicLink||l?.filestat.isInSymbolicDirectory};return{children:this.toNodes(c,f,l),filestat:f}}}else return{children:[],filestat:null}}async resolveNodeByPath(c,r,l){const a=await this.fileServiceClient.getFileStat(r);if(a)return this.toNode(c,a,l)}async resolveFileStat(c){return await this.fileServiceClient.getFileStat(c.toString())}toNodes(c,r,l){if(l){if(r.children)return r.children.map(a=>this.toNode(c,a,l))}else return[this.toNode(c,r,l)];return[]}toNode(c,r,l,a){var u;const m=new p.URI(r.uri),f=a||m.displayName;let v;return r.isInSymbolicDirectory=(u=l?.filestat.isSymbolicLink)!==null&&u!==void 0?u:l?.filestat.isInSymbolicDirectory,r.isDirectory?v=new E.Directory(c,l,m,f,r,this.getReadableTooltip(m)):v=new E.File(c,l,m,f,r,this.getReadableTooltip(m)),v}async mvFiles(c,r){const l=[];for(const m of c)if(m.url.isEqualOrParent(r))return;const a=c.sort((m,f)=>m.toString().length-f.toString().length),u=[];for(const m of a)u.length>0&&u.find(f=>f.url.isEqualOrParent(m.url))||u.push(m);if(this.corePreferences["explorer.confirmMove"]){const m=(0,p.localize)("file.confirm.move.ok"),f=(0,p.localize)("file.confirm.move.cancel");if(await this.dialogService.warning((0,p.formatLocalize)("file.confirm.move",`[ ${u.map(y=>y.url.displayName).join(",")} ]`,r.displayName),[f,m])!==m)return}for(const m of u){const f=await this.mv(m.url,r.resolve(m.url.displayName),m.isDirectory);f&&l.push(f)}return l}async mv(c,r,l=!1){try{await this.workspaceEditService.apply({edits:[{newResource:r,oldResource:c,options:{isDirectory:l,overwrite:!0}}]})}catch(a){return a.message}}async createFile(c,r){try{await this.workspaceEditService.apply({edits:[{newResource:c,options:{content:r}}]})}catch(l){return l.message}this.commandService.executeCommand(o.EDITOR_COMMANDS.OPEN_RESOURCE.id,c,{disableNavigate:!0,focus:!0})}async createDirectory(c){try{await this.workspaceEditService.apply({edits:[{newResource:c,options:{isDirectory:!0}}]})}catch(r){return r.message}}async delete(c){try{await this.workspaceEditService.apply({edits:[{oldResource:c,options:{}}]});return}catch(r){return r.message}}async copyFile(c,r){let l=1,a;try{a=await this.fileServiceClient.access(r.toString())}catch(u){return u.message}for(;a;){const u=r.displayName.replace(/\Wcopy\W\d+/,""),m=p.path.extname(u),v=`${p.path.basename(u,m)} copy ${l}${m}`;r=r.parent.resolve(v),l++;try{a=await this.fileServiceClient.access(r.toString())}catch{return}}try{return await this.fileServiceClient.copy(c.toString(),r.toString())}catch(u){return u.message}}getReadableTooltip(c){const r=c.toString(),l=this.userhomePath&&this.userhomePath.toString();return this.userhomePath&&this.userhomePath.isEqualOrParent(c)?decodeURIComponent(r.replace(l,"~")):decodeURIComponent(c.withScheme("").toString())}};e.FileTreeAPI=d,n.__decorate([(0,s.Autowired)(b.IFileServiceClient),n.__metadata("design:type",Object)],d.prototype,"fileServiceClient",void 0),n.__decorate([(0,s.Autowired)(_.IWorkspaceEditService),n.__metadata("design:type",Object)],d.prototype,"workspaceEditService",void 0),n.__decorate([(0,s.Autowired)(p.CommandService),n.__metadata("design:type",Object)],d.prototype,"commandService",void 0),n.__decorate([(0,s.Autowired)(o.CorePreferences),n.__metadata("design:type",Object)],d.prototype,"corePreferences",void 0),n.__decorate([(0,s.Autowired)(g.IDialogService),n.__metadata("design:type",Object)],d.prototype,"dialogService",void 0),e.FileTreeAPI=d=n.__decorate([(0,s.Injectable)()],d)},93239:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeDecorationService=void 0;const n=t(85608),s=t(76003),o=t(41869),p=t(41893),b=t(52416);let g=class{constructor(){this.disposeCollection=new o.DisposableCollection,this.onDidChangeEmitter=new o.Emitter,this.cacheDecorations=new Map,this.disposeCollection.pushAll([this.decorationsService.onDidChangeDecorations(E=>{var d,h,c;const r=(h=(d=E._data)===null||d===void 0?void 0:d._iter)===null||h===void 0?void 0:h._value;if(r){const l=new o.URI(r),a=this.getDecoration(l);this.cacheDecorations.has(r)?((c=this.cacheDecorations.get(r))===null||c===void 0?void 0:c.tooltip)!==a?.tooltip&&this.onDidChangeEmitter.fire():(this.cacheDecorations.set(r,a),this.onDidChangeEmitter.fire())}}),this.themeService.onThemeChange(()=>{this.onDidChangeEmitter.fire()})])}get onDidChange(){return this.onDidChangeEmitter.event}getDecoration(E,d=!1){E instanceof o.URI&&(E=o.Uri.parse(E.toString()));const h=this.decorationsService.getDecoration(E,d);return h?{...h,color:this.themeService.getColor({id:h.color})}:{color:"",tooltip:"",badge:""}}dispose(){this.disposeCollection.dispose()}};e.FileTreeDecorationService=g,n.__decorate([(0,s.Autowired)(p.IDecorationsService),n.__metadata("design:type",p.IDecorationsService)],g.prototype,"decorationsService",void 0),n.__decorate([(0,s.Autowired)(b.IThemeService),n.__metadata("design:type",Object)],g.prototype,"themeService",void 0),e.FileTreeDecorationService=g=n.__decorate([(0,s.Injectable)(),n.__metadata("design:paramtypes",[])],g)},30577:(x,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.DragAndDropService=void 0;const s=t(85608),o=t(76003),p=t(97267),b=t(41869),g=t(53622),_=t(14951),E=t(72665),d=t(6250),h=t(69959),c=s.__importDefault(t(89200)),r=s.__importDefault(t(2613)),l=t(57781),a=t(97738);let u=n=class extends b.WithEventBus{constructor(f){super(),this.model=f,this.toCancelNodeExpansion=new b.DisposableCollection,this.beingDraggedDec=new p.Decoration(c.default.mod_dragging),this.draggedOverDec=new p.Decoration(c.default.mod_dragover),this.beingDraggedNodes=[],this.dragOverTrigger=new b.ThrottledDelayer(n.MS_TILL_DRAGGED_OVER_EXPANDS),this.handleDragStart=(v,y,S)=>{v.stopPropagation();const A=I=>{this.handleDragEnd(I,y)};v.currentTarget.addEventListener("dragend",A,!1);let T=this.model.selectedFiles,D=!1;for(const I of T)I&&I.id===y.id&&(D=!0);D||(T=[y]),this.beingDraggedNodes=T,this.beingDraggedActiveUri=S;const w=T.find(I=>!h.Directory.is(I));if(w&&v.dataTransfer.setData("uri",w.uri.toString()),v.dataTransfer.setData("beingDraggedNodes",JSON.stringify(this.beingDraggedNodes.map(I=>I.uri.toString()))),w){const I=w;I.uri.scheme==="file"&&v.dataTransfer.setData("DownloadURL",`application/octet-stream:${I.displayName}:data:application/octet-stream;base64,${(0,b.encodeBase64)(b.BinaryBuffer.fromString(I.filestat.uri))}`)}if(T.forEach(I=>{this.beingDraggedDec.addTarget(I,p.TargetMatchMode.Self)}),v.dataTransfer){let I;T.length===1?I=S?S.displayName:typeof y.name=="string"?y.name:"":I=String(T.length);const R=document.createElement("div");R.className=r.default.file_tree_drag_image,R.textContent=I,document.body.appendChild(R),v.dataTransfer.setDragImage(R,-10,-10),setTimeout(()=>document.body.removeChild(R),0)}},this.handleDragEnter=(v,y)=>{v.stopPropagation(),v.preventDefault()},this.handleDragLeave=(v,y)=>{v.preventDefault(),v.stopPropagation(),this.toCancelNodeExpansion.dispose(),this.potentialParent&&(this.draggedOverDec.removeTarget(this.potentialParent),this.model.treeModel.dispatchChange())},this.handleDragOver=(v,y)=>{if(v.preventDefault(),v.stopPropagation(),!this.toCancelNodeExpansion.disposed||this.beingDraggedNodes.indexOf(y)>=0)return;this.draggedOverNode=y;const S=h.Directory.is(y)&&y.expanded?y:y.parent;(this.potentialParent!==S||!this.draggedOverDec.hasTarget(S))&&(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=S,this.draggedOverDec.addTarget(this.potentialParent,p.TargetMatchMode.SelfAndChildren),this.model.treeModel.dispatchChange()),this.potentialParent!==y&&h.Directory.is(y)&&(this.dragOverTrigger.trigger(async()=>{y.expanded?(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=y,this.draggedOverDec.addTarget(this.potentialParent,p.TargetMatchMode.SelfAndChildren)):(await y.setExpanded(!0),this.draggedOverNode===y&&(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=y,this.draggedOverDec.addTarget(this.potentialParent,p.TargetMatchMode.SelfAndChildren))),this.model.treeModel.dispatchChange()}),this.toCancelNodeExpansion.push(b.Disposable.create(()=>{this.dragOverTrigger.isTriggered()||this.dragOverTrigger.cancel()})))},this.handleDrop=async(v,y,S)=>{var A;this.eventBus.fire(new g.FileTreeDropEvent({event:v.nativeEvent,targetDir:S?S.codeUri.path:y&&y instanceof h.File?(A=y.parent)===null||A===void 0?void 0:A.uri.codeUri.path:y?.uri.codeUri.path}));try{v.preventDefault(),v.stopPropagation(),v.dataTransfer.dropEffect="copy";let T;const D=!!this.beingDraggedActiveUri;this.fileTreeService.isCompactMode&&S&&!y?.uri.isEqual(S)?T=null:y?T=h.Directory.is(y)?y:y.parent:T=this.root;let w;if(this.beingDraggedActiveUri){const I=this.fileTreeService.getNodeByPathOrUri(this.beingDraggedActiveUri);w=[new h.Directory(this.fileTreeService,I?.parent,this.beingDraggedActiveUri,this.beingDraggedActiveUri.displayName,{uri:this.beingDraggedActiveUri.toString(),isDirectory:!0,lastModification:new Date().getTime()},this.beingDraggedActiveUri.displayName)]}else if(w=this.beingDraggedNodes,!w||w.length===0)try{const I=JSON.parse(v.dataTransfer.getData("beingDraggedNodes"));I&&I.length!==0&&(w=I.map(R=>this.fileTreeService.getNodeByPathOrUri(new b.URI(R))).filter(Boolean),w.length||(w=await Promise.all(I.map(async R=>{const M=new b.URI(R);let O;const P=await this.filesystem.getFileStat(M.toString());return P?.isDirectory?O=new h.Directory(this.fileTreeService,this.root,M,M.displayName,{uri:M.toString(),isDirectory:!0,lastModification:new Date().getTime()},M.displayName):O=new h.File(this.fileTreeService,this.root,M,M.displayName,{uri:M.toString(),isDirectory:!0,lastModification:new Date().getTime()},M.displayName),O}))))}catch{}if(w.length>0){const I=S||T&&T.uri,R=w.filter(M=>M&&M.parent&&(this.beingDraggedActiveUri?!M.parent.uri.isEqual(I):!0));if(R.length>0){const M=await this.fileTreeAPI.mvFiles(R.map(O=>({url:O.uri,isDirectory:O.filestat.isDirectory})),I);if(M&&M.length>0)M.forEach(O=>{this.messageService.error(O)});else if(M){if(T)if(this.fileTreeService.isCompactMode&&D){for(const O of R)this.fileTreeService.refresh(O.parent);this.fileTreeService.refresh(T)}else for(const O of R){const P=T.uri.resolve(O.name);this.fileTreeService.moveNodeByPath(O.parent,T,O.name,O.name,O.type),O.updateMetaData({name:P.displayName,fileStat:{...O.filestat,uri:P.toString()},uri:P,tooltip:this.fileTreeAPI.getReadableTooltip(P)}),h.Directory.is(O)&&this.fileTreeService.refresh(O)}else if(y){if(this.fileTreeService.isCompactMode&&D)for(const O of R)this.fileTreeService.refresh(O.parent);else for(const O of R)this.fileTreeService.deleteAffectedNodeByPath(O.path);this.fileTreeService.refresh(y.parent)}}else return}}y&&this.beingDraggedDec.removeTarget(y),this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.beingDraggedNodes.forEach(I=>{this.beingDraggedDec.removeTarget(I)}),this.beingDraggedNodes=[],this.beingDraggedActiveUri=void 0,this.potentialParent=null,this.model.treeModel.dispatchChange(),this.toCancelNodeExpansion.disposed||this.toCancelNodeExpansion.dispose()}catch(T){this.logger.error(T)}},this.handleDragEnd=(v,y)=>{this.beingDraggedDec.removeTarget(y),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}};e.DragAndDropService=u,u.MS_TILL_DRAGGED_OVER_EXPANDS=500,s.__decorate([(0,o.Autowired)(d.IFileTreeAPI),s.__metadata("design:type",Object)],u.prototype,"fileTreeAPI",void 0),s.__decorate([(0,o.Autowired)(b.ILogger),s.__metadata("design:type",Object)],u.prototype,"logger",void 0),s.__decorate([(0,o.Autowired)(E.IMessageService),s.__metadata("design:type",Object)],u.prototype,"messageService",void 0),s.__decorate([(0,o.Autowired)(d.IFileTreeService),s.__metadata("design:type",l.FileTreeService)],u.prototype,"fileTreeService",void 0),s.__decorate([(0,o.Autowired)(_.IFileServiceClient),s.__metadata("design:type",Object)],u.prototype,"filesystem",void 0),e.DragAndDropService=u=n=s.__decorate([(0,o.Injectable)(),s.__param(0,(0,o.Optional)()),s.__metadata("design:paramtypes",[a.FileTreeModelService])],u)},97738:(x,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeModelService=void 0;const s=t(85608),o=t(76003),p=t(97267),b=t(41869),g=t(91830),_=t(93899),E=t(26542),d=t(54414),h=t(14951),c=t(63067),r=t(53576),l=t(72665),a=t(6250),u=t(69959),m=t(2812),f=t(46377),v=s.__importDefault(t(89200)),y=t(57781),S=t(30577),{Path:A,isValidBasename:T}=b.path,{coalesce:D}=b.arrays,{trim:w,rtrim:I}=b.strings;let R=n=class{constructor(){this._isDisposed=!1,this._whenReady=new b.Deferred,this.selectedDecoration=new p.Decoration(v.default.mod_selected),this.focusedDecoration=new p.Decoration(v.default.mod_focused),this.contextMenuDecoration=new p.Decoration(v.default.mod_actived),this.loadingDecoration=new p.Decoration(v.default.mod_loading),this.cutDecoration=new p.Decoration(v.default.mod_cut),this._selectedFiles=[],this.disposableCollection=new b.DisposableCollection,this._isMultiSelected=!1,this.refreshedActionDelayer=new b.ThrottledDelayer(n.DEFAULT_REFRESHED_ACTION_DELAY),this.labelChangedDelayer=new b.ThrottledDelayer(n.DEFAULT_LABEL_CHANGED_DELAY),this.locationThrottler=new b.Throttler,this.onDidFocusedFileChangeEmitter=new b.Emitter,this.onDidContextMenuFileChangeEmitter=new b.Emitter,this.onDidSelectedFileChangeEmitter=new b.Emitter,this.onFileTreeModelChangeEmitter=new b.Emitter,this._initTreeModelReady=!1,this.clearFileSelectedDecoration=()=>{this.selectedDecoration.clearAppliedTarget(),this._selectedFiles=[]},this.activeFileDecoration=(O,P=!0)=>{this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),O&&(this.selectedFiles.length>0&&this.selectedDecoration.clearAppliedTarget(),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.selectedDecoration.addTarget(O),this.focusedDecoration.addTarget(O),this.focusedFile=O,this.selectedFiles=[O],P&&this.treeModel.dispatchChange())},this.selectFileDecoration=(O,P=!0)=>{O!==this.treeModel.root&&(this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),O&&(this.selectedFiles.length>0&&this.selectedDecoration.clearAppliedTarget(),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.selectedDecoration.addTarget(O),this._selectedFiles=[O],P&&this.treeModel.dispatchChange()))},this.activateFileActivedDecoration=O=>{this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),this.focusedFile&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this.contextMenuDecoration.addTarget(O),this.contextMenuFile=O,this.treeModel.dispatchChange()},this.activateFileFocusedDecoration=O=>{this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),this.focusedDecoration.addTarget(O),this.focusedFile=O,this.treeModel.dispatchChange()},this.activeFileFocusedDecoration=(O,P=!1)=>{O!==this.treeModel.root&&(this.focusedFile!==O&&(P?(this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.contextMenuFile=O):this.focusedFile&&(this.contextMenuFile=void 0,this.focusedDecoration.clearAppliedTarget()),O&&(this._selectedFiles.indexOf(O)<0&&(this.selectedDecoration.addTarget(O),this._selectedFiles.push(O),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(L=>L.uri))),this.focusedDecoration.addTarget(O),this.focusedFile=O)),this.treeModel.dispatchChange())},this.toggleFileSelectedDecoration=O=>{const P=this._selectedFiles.indexOf(O);P>-1?(this.focusedFile===O&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this._selectedFiles.splice(P,1),this.selectedDecoration.clearAppliedTarget()):(this._selectedFiles.push(O),this.selectedDecoration.addTarget(O),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.focusedFile=O,this.focusedDecoration.addTarget(O)),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(L=>L.uri)),this.treeModel.dispatchChange()},this.activeFileDecorationByRange=(O,P)=>{for(this.clearFileSelectedDecoration(),this.contextMenuFile=void 0;O<=P;O++){const L=this.treeModel.root.getTreeNodeAtIndex(O);L&&(this._selectedFiles.push(L),this.selectedDecoration.addTarget(L))}this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(L=>L.uri)),this.treeModel.dispatchChange()},this.deactivateFileDecoration=()=>{var O;this.focusedFile&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this.contextMenuFile&&this.contextMenuDecoration.removeTarget(this.contextMenuFile),(O=this.treeModel)===null||O===void 0||O.dispatchChange()},this.toggleDirectory=async O=>{O.expanded?this.fileTreeHandle.collapseNode(O):this.fileTreeHandle.expandNode(O)},this.handleDblClick=()=>{this.commandService.executeCommand(b.FILE_COMMANDS.NEW_FILE.id)},this.handleContextMenu=(O,P,L)=>{var N;O.stopPropagation(),O.preventDefault();let k,B;P?(B=P,this._isMultiSelected?this.selectedFiles.indexOf(B)>=0?k=this.selectedFiles:k=[B]:k=[B]):(k=[this.treeModel.root],B=this.treeModel.root),this.activateFileActivedDecoration(B),this.setFileTreeContextKey(B),this.fileTreeService.isCompactMode&&L?(this._activeUri=L,(N=this.contextKey)===null||N===void 0||N.explorerResourceIsFolder.set(!0)):L||(this._activeUri=null);const F=this.contextMenuService.createMenu({id:_.MenuId.ExplorerContext,contextKeyService:this.fileTreeService.contextMenuContextKeyService}),W=F.getMergedMenuNodes();F.dispose(),this.updateExplorerCompressedContextKey(B,L);const{x:V,y:H}=O.nativeEvent;this.ctxMenuRenderer.show({anchor:{x:V,y:H},menuNodes:W,args:L?[L,[L]]:[B.uri,k.map(K=>K.uri)]})},this.handleTreeBlur=()=>{var O,P,L;this._isDisposed||((P=(O=this.contextKey)===null||O===void 0?void 0:O.filesExplorerFocused)===null||P===void 0||P.set(!1),this.deactivateFileDecoration(),(L=this.contextKey)===null||L===void 0||L.explorerResourceIsFolder.set(!1))},this.handleTreeFocus=()=>{var O,P;(P=(O=this.contextKey)===null||O===void 0?void 0:O.filesExplorerFocused)===null||P===void 0||P.set(!0)},this.handleItemRangeClick=(O,P)=>{if(!this.focusedFile)this.handleItemClick(O,P);else if(this.focusedFile&&this.focusedFile!==O){this._isMultiSelected=!0;const L=this.treeModel.root.getIndexAtTreeNode(O),N=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);N>L?this.activeFileDecorationByRange(L,N):N<L&&this.activeFileDecorationByRange(N,L)}},this.handleItemToggleClick=(O,P)=>{this._isMultiSelected=!0,!(P!==p.TreeNodeType.CompositeTreeNode&&P!==p.TreeNodeType.TreeNode)&&this.toggleFileSelectedDecoration(O)},this.handleItemClick=(O,P=this.fileTreeService.isMultipleWorkspace?p.TreeNodeType.TreeNode:p.TreeNodeType.CompositeTreeNode,L)=>{var N,k,B,F;if(this.treeModel&&(O||(O=this.treeModel.root),this.updateExplorerCompressedContextKey(O,L),this._isMultiSelected=!1,(P===p.TreeNodeType.CompositeTreeNode||P===p.TreeNodeType.TreeNode)&&this.activeFileDecoration(O),this.fileTreeService.isCompactMode&&L?(this._activeUri=L,(N=this.contextKey)===null||N===void 0||N.explorerResourceIsFolder.set(!0)):L||(this._activeUri=null,(k=this.contextKey)===null||k===void 0||k.explorerResourceIsFolder.set(P===p.TreeNodeType.CompositeTreeNode)),this.corePreferences["workbench.list.openMode"]==="singleClick")){if(P===p.TreeNodeType.CompositeTreeNode){if((B=this.contextKey)===null||B===void 0||B.explorerResourceIsFolder.set(!0),O===this.treeModel.root)return;this.toggleDirectory(O)}else if(P===p.TreeNodeType.TreeNode){if((F=this.contextKey)===null||F===void 0||F.explorerResourceIsFolder.set(!1),O===this.treeModel.root)return;this.fileTreeService.openFile(O.uri),this.mainlayoutService.bottomExpanded&&this.commandService.executeCommand(r.RETRACT_BOTTOM_PANEL.id)}}},this.handleItemDoubleClick=(O,P)=>{P===p.TreeNodeType.TreeNode?this.fileTreeService.openAndFixedFile(O.uri):this.corePreferences["workbench.list.openMode"]==="doubleClick"&&this.toggleDirectory(O)},this.validateFileName=(O,P)=>{var L;if(P=this.getWellFormedFileName(P),!P||P.length===0||/^\s+$/.test(P))return{message:(0,b.localize)("validate.tree.emptyFileNameError"),type:p.PROMPT_VALIDATE_TYPE.ERROR,value:P};if(P[0]==="/"||P[0]==="\\")return{message:(0,b.localize)("validate.tree.fileNameStartsWithSlashError"),type:p.PROMPT_VALIDATE_TYPE.ERROR,value:P};if(P[0]===" "||P[P.length-1]===" ")return{message:(0,b.localize)("validate.tree.fileNameFollowOrStartWithSpaceWarning"),type:p.PROMPT_VALIDATE_TYPE.WARNING,value:P};let N;if(O.target){const B=O.target;if(P===B.name)return null;N=B.parent}else N=O.parent;return N&&!(O instanceof p.RenamePromptHandle&&O.target.displayName.indexOf(A.separator)>0)&&((L=N.children)===null||L===void 0?void 0:L.find(W=>W.name===P))?{message:(0,b.formatLocalize)("validate.tree.fileNameExistsError",P),type:p.PROMPT_VALIDATE_TYPE.ERROR,value:P}:D(P.split(/[\\/]/)).some(B=>!T(B))?{message:(0,b.formatLocalize)("validate.tree.invalidFileNameError",this.trimLongName(P)),type:p.PROMPT_VALIDATE_TYPE.ERROR,value:P}:null},this.proxyPrompt=O=>{let P=!1;const L=async K=>{const z=await this.fileTreeService.getNodeByPathOrUri(K);z&&(u.Directory.is(z)?this.selectFileDecoration(z):this.location(z.uri))},N=async K=>{var z,G,j;if(this.validateMessage=void 0,O instanceof p.RenamePromptHandle){const U=O.target,$=O.target.displayName.split(A.separator),Y=U.name.indexOf(A.separator)>0;if(Y&&this.activeUri&&!O.target.uri.toString().includes(this.activeUri.toString()))return!1;const Q=this.activeUri?$.length-O.target.uri.toString().replace(this.activeUri.toString(),"").split(A.separator).length:-1,ee=Q===-1?[]:$.slice(0,Q).concat(K);let re=U.uri,ae=U.parent.uri.resolve(K);if(Y&&((z=this.activeUri)===null||z===void 0?void 0:z.displayName)===K||!Y&&K===U.name)return!0;O.addAddonAfter("loading_indicator"),Y&&ee.length>0&&u.Directory.is(U.parent)&&(re=U.parent.uri.resolve($.slice(0,Q+1).join(A.separator)),ae=U.parent.uri.resolve(ee.concat().join(A.separator)));const de=await this.fileTreeAPI.mv(re,ae,U.type===p.TreeNodeType.CompositeTreeNode);if(de)return this.validateMessage={type:p.PROMPT_VALIDATE_TYPE.ERROR,message:de,value:K},this.fileTreeService.updateRefreshable(!0),O.addValidateMessage(this.validateMessage),!1;if(this.fileTreeService.updateRefreshable(!1),O.removeAddonAfter(),!Y&&U.parent){const q=await this.fileTreeService.moveNodeByPath(U.parent,U.parent,U.name,K,U.type);q&&this.selectFileDecoration(q,!1),this.fileTreeService.updateRefreshable(!0)}else if(u.Directory.is(U)&&!u.Directory.isRoot(U)){U.updateMetaData({name:ee.concat($.slice(Q+1)).join(A.separator),uri:ae,fileStat:{...U.filestat,uri:ae.toString()},tooltip:this.fileTreeAPI.getReadableTooltip(ae)}),this.treeModel.dispatchChange();let q;u.Directory.is(U.parent)&&(!((G=U.parent.children)===null||G===void 0)&&G.find(_e=>U.path.indexOf(_e.path)>=0))?q=this.fileTreeService.refresh(U.parent):q=this.fileTreeService.refresh(U),q.then(()=>{L(ae)})}O.removeAddonAfter()}else if(O instanceof p.NewPromptHandle){const U=O.parent,$=U.uri.resolve(K);let Y;if(O.addAddonAfter("loading_indicator"),this.fileTreeService.updateRefreshable(!0),O.type===p.TreeNodeType.CompositeTreeNode?Y=await this.fileTreeAPI.createDirectory($):Y=await this.fileTreeAPI.createFile($),O.removeAddonAfter(),Y)return this.validateMessage={type:p.PROMPT_VALIDATE_TYPE.ERROR,message:Y,value:K},this.fileTreeService.updateRefreshable(!1),O.addValidateMessage(this.validateMessage),!1;if(K.includes(A.separator)&&this.fileTreeService.refresh(U).then(()=>{L(U.uri.resolve(K))}),this.fileTreeService.isCompactMode)if(O.type===p.TreeNodeType.CompositeTreeNode)if((!U.children||U.children.length===0)&&!u.Directory.isRoot(U)){const ee=U.uri.resolve(K),re=[U.name].concat(K).join(A.separator);U.updateMetaData({name:re,uri:ee,fileStat:{...U.filestat,uri:ee.toString()},tooltip:this.fileTreeAPI.getReadableTooltip(ee)}),L(ee)}else await this.fileTreeService.addNode(U,K,O.type),L(U.uri.resolve(K));else await this.fileTreeService.addNode(U,K,O.type),L(U.uri.resolve(K));else await this.fileTreeService.addNode(U,K,O.type),L(U.uri.resolve(K))}return(j=this.contextKey)===null||j===void 0||j.filesExplorerInputFocused.set(!1),!0},k=async K=>{var z,G,j,U;if(this.validateMessage&&this.validateMessage.type===p.PROMPT_VALIDATE_TYPE.ERROR)return this.validateMessage=void 0,!0;if(P)return!1;if(!K){(z=this.contextKey)===null||z===void 0||z.explorerCompressedFocusContext.set(!1),(G=this.contextKey)===null||G===void 0||G.explorerCompressedFirstFocusContext.set(!1),(j=this.contextKey)===null||j===void 0||j.explorerCompressedLastFocusContext.set(!1),this.fileTreeService.isCompactMode&&O instanceof p.NewPromptHandle&&this.fileTreeService.refresh(O.parent);return}return(U=this.contextKey)===null||U===void 0||U.filesExplorerInputFocused.set(!1),await N(K),!0},B=async K=>{if(P=!0,this.validateMessage&&this.validateMessage.type===p.PROMPT_VALIDATE_TYPE.ERROR)return!1;if(K.trim()===""||this.validateMessage&&this.validateMessage.type!==p.PROMPT_VALIDATE_TYPE.ERROR)return this.validateMessage=void 0,!0;const z=await N(K);return P=!1,!!z},F=async()=>{var K;(K=this.contextKey)===null||K===void 0||K.filesExplorerInputFocused.set(!0)},W=()=>{var K;this.fileTreeService.updateRefreshable(!0),(K=this.contextKey)===null||K===void 0||K.filesExplorerInputFocused.set(!1),this.contextMenuFile&&this.selectFileDecoration(this.contextMenuFile,!0)},V=()=>{var K;(K=this.contextKey)===null||K===void 0||K.filesExplorerInputFocused.set(!1),this.fileTreeService.isCompactMode&&O instanceof p.NewPromptHandle&&this.fileTreeService.refresh(O.parent)},H=K=>{const z=this.validateFileName(O,K);z?(this.validateMessage=z,O.addValidateMessage(z)):!z&&this.validateMessage&&this.validateMessage.value!==K&&(this.validateMessage=void 0,O.removeValidateMessage())};O.destroyed||(this.fileTreeService.updateRefreshable(!1),O.onChange(H),O.onCommit(B),O.onBlur(k),O.onFocus(F),O.onDestroy(W),O.onCancel(V))},this.copyFile=async O=>{var P;this.pasteStore&&this.pasteStore.type===a.PasteTypes.CUT&&(this._pasteStore.files.forEach(N=>{N&&this.cutDecoration.removeTarget(N)}),(P=this.contextKey)===null||P===void 0||P.explorerResourceCut.set(!1)),this.treeModel.dispatchChange();const L=[];for(const N of O){const k=this.fileTreeService.getNodeByPathOrUri(N);k&&L.push(k)}this._pasteStore={files:L,type:a.PasteTypes.COPY},this.clipboardService.writeResources(O)},this.pasteFile=async O=>{var P,L;let N=!1,k=this.fileTreeService.getNodeByPathOrUri(O.toString());if(!k)return;let B=this.pasteStore,F=!1;if(!B){const W=await this.clipboardService.readResources();if(!W||!W.length)return;B={files:[],type:a.PasteTypes.COPY,crossFiles:W},F=!0}if(B){if(u.Directory.is(k)||(N=!0,k=k.parent),F){const W=(0,b.localize)("file.confirm.paste.ok"),V=(0,b.localize)("file.confirm.paste.cancel");if(await this.dialogService.warning((0,b.formatLocalize)("file.confirm.paste",`[ ${(P=B.crossFiles)===null||P===void 0?void 0:P.map(K=>K.displayName).join(",")} ]`,u.Directory.isRoot(k)?k.uri.displayName:k.displayName),[V,W])!==W)return}if(B.type===a.PasteTypes.CUT){for(const V of B.files)V&&this.cutDecoration.removeTarget(V),k.expanded||await k.setExpanded(!0);const W=await this.fileTreeAPI.mvFiles(B.crossFiles?B.crossFiles.map(V=>{var H;return{url:V,isDirectory:((H=this.fileTreeService.getNodeByPathOrUri(V))===null||H===void 0?void 0:H.filestat.isDirectory)||!1}}):B.files.map(V=>({url:V.uri,isDirectory:V.filestat.isDirectory})),k.uri);W&&W.length>0&&(W.forEach(V=>{this.messageService.error(V)}),this.fileTreeService.refresh()),(L=this.contextKey)===null||L===void 0||L.explorerResourceCut.set(!1),this.treeModel.dispatchChange(),this._pasteStore={files:[],type:a.PasteTypes.NONE,crossFiles:void 0}}else if(B.type===a.PasteTypes.COPY){const W=B.crossFiles?B.crossFiles:B.files.map(V=>V.uri);for(const V of W){k.uri.isEqual(V)&&!N&&(k=k.parent);const H=k.uri.resolve(V.displayName);k.expanded||await k.setExpanded(!0);const K=await this.fileTreeAPI.copyFile(V,H);if(K)if(K.uri){const z=new b.URI(K.uri),G=await this.filesystem.getFileStat(V.toString());this.fileTreeService.addNode(k,z.displayName,G?.isDirectory?p.TreeNodeType.CompositeTreeNode:p.TreeNodeType.TreeNode)}else this.messageService.error(`Error when copy file: ${V.toString()}, ${K}`)}}}},this.cutFile=async O=>{var P;O.length>0&&((P=this.contextKey)===null||P===void 0||P.explorerResourceCut.set(!0)),this._pasteStore&&this._pasteStore.type===a.PasteTypes.CUT&&this._pasteStore.files.forEach(N=>{this.cutDecoration.removeTarget(N)});const L=[];for(const N of O){const k=this.fileTreeService.getNodeByPathOrUri(N);k&&L.push(k)}this._pasteStore={files:L,type:a.PasteTypes.CUT};for(const N of L)N&&this.cutDecoration.addTarget(N);this.treeModel.dispatchChange()},this.location=async O=>{if(await this.whenReady,!this.fileTreeService.filterMode)return this._fileToLocation=O,this.locationThrottler.queue(this.doLocation)},this.doLocation=async()=>{if(!this._fileToLocation)return;const O=this._fileToLocation;let P;if(typeof O=="string"?P=O:P=await this.fileTreeService.getFileTreeNodePathByUri(O),P){if(!this.fileTreeHandle)return;const L=await this.fileTreeHandle.ensureVisible(P,"center",!0);L&&this.selectFileDecoration(L)}this._fileToLocation=void 0},this.locationOnShow=O=>{this._nextLocationTarget=O},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(O){this.onDidFocusedFileChangeEmitter.fire(O?O.uri:void 0),this._focusedFile=O}get contextMenuFile(){return this._contextMenuFile}set contextMenuFile(O){this.onDidContextMenuFileChangeEmitter.fire(O?O.uri:void 0),this._contextMenuFile=O}get selectedFiles(){return this._selectedFiles}set selectedFiles(O){this.onDidSelectedFileChangeEmitter.fire(O?O.map(P=>P.uri):[]),this._selectedFiles=O}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 g.ResourceContextKey(this.fileTreeService.contextMenuContextKeyService)),this._contextMenuResourceContext}get contextKey(){return this.fileTreeService.contextKey}get initTreeModelReady(){return this._initTreeModelReady}async initTreeModel(){this._initTreeModelReady=!1;const O=(await this.fileTreeService.resolveChildren())[0];if(!O){this._whenReady.resolve();return}this._treeModel=this.injector.get(m.FileTreeModel,[O]),this.initDecorations(O),this._dndService=this.injector.get(S.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 L=this.editorService.currentEditor;L&&L.currentUri&&this.location(L.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(p.TreeNodeEvent.WillResolveChildren,L=>{this.loadingDecoration.addTarget(L),this.treeModel.dispatchChange()})),this.disposableCollection.push(this.treeModel.root.watcher.on(p.TreeNodeEvent.DidResolveChildren,L=>{this.loadingDecoration.clearAppliedTarget(),this.treeModel.dispatchChange()})),this._explorerStorage=await this.storageProvider(b.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 L=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),N=this.treeStateWatcher.snapshot();this.explorerStorage.set(n.FILE_TREE_SNAPSHOT_KEY,{...L,...N})})),this.fileTreeService.startWatchFileEvent(),this.onFileTreeModelChangeEmitter.fire(this._treeModel),this._whenReady.resolve(),this._initTreeModelReady=!0}initDecorations(O){this._decorations=new p.DecorationsManager(O),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(O){var P;this.currentContextUriContextKey.set(O.uri.toString()),this.currentRelativeUriContextKey.set((this.treeModel.root.uri.relative(O.uri)||"").toString()),this.contextMenuResourceContext.set(O.uri),(P=this.contextKey)===null||P===void 0||P.explorerResourceIsFolder.set(O&&O.type===p.TreeNodeType.CompositeTreeNode)}async loadFileTreeSnapshot(O){await this._treeModel.loadTreeState(O)}updateExplorerCompressedContextKey(O,P){var L,N,k,B,F,W,V,H,K,z,G,j,U,$,Y,Q;if(O&&P){(L=this.contextKey)===null||L===void 0||L.explorerCompressedFocusContext.set(!0);const ee=new A(O.name);ee.name===P.displayName?((N=this.contextKey)===null||N===void 0||N.explorerCompressedLastFocusContext.set(!0),(k=this.contextKey)===null||k===void 0||k.explorerCompressedFirstFocusContext.set(!1)):ee.root&&ee.root.name===P.displayName?((B=this.contextKey)===null||B===void 0||B.explorerCompressedLastFocusContext.set(!1),(F=this.contextKey)===null||F===void 0||F.explorerCompressedFirstFocusContext.set(!0)):((W=this.contextKey)===null||W===void 0||W.explorerCompressedLastFocusContext.set(!1),(V=this.contextKey)===null||V===void 0||V.explorerCompressedFirstFocusContext.set(!1))}else O?O.name.indexOf(A.separator)>0?((H=this.contextKey)===null||H===void 0||H.explorerCompressedFocusContext.set(!0),(K=this.contextKey)===null||K===void 0||K.explorerCompressedFirstFocusContext.set(!1),(z=this.contextKey)===null||z===void 0||z.explorerCompressedLastFocusContext.set(!0)):((G=this.contextKey)===null||G===void 0||G.explorerCompressedFocusContext.set(!1),(j=this.contextKey)===null||j===void 0||j.explorerCompressedFirstFocusContext.set(!1),(U=this.contextKey)===null||U===void 0||U.explorerCompressedLastFocusContext.set(!1)):(($=this.contextKey)===null||$===void 0||$.explorerCompressedFocusContext.set(!1),(Y=this.contextKey)===null||Y===void 0||Y.explorerCompressedFirstFocusContext.set(!1),(Q=this.contextKey)===null||Q===void 0||Q.explorerCompressedLastFocusContext.set(!1))}handleTreeHandler(O){this._fileTreeHandle=O}toggleOrOpenCurrentFile(){let O;this.focusedFile?O=this.focusedFile:this.contextMenuFile&&(O=this.contextMenuFile),O&&(this.activeFileDecoration(O),u.Directory.is(O)?this.toggleDirectory(O):this.fileTreeService.openFile(O.uri))}moveToNext(){let O;if(this.focusedFile?O=this.focusedFile:this.contextMenuFile&&(O=this.contextMenuFile),!O)return;const L=this.treeModel.root.getIndexAtTreeNode(O)+1,N=this.treeModel.root.getTreeNodeAtIndex(L),k=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),B=(L+1)*f.FILE_TREE_NODE_HEIGHT-(k.scrollPosition||0),{height:F}=this.fileTreeHandle.getCurrentSize();N&&(this.activateFileFocusedDecoration(N),B>F&&this.fileTreeHandle.ensureVisible(N,"end"))}moveToPrev(){let O;if(this.focusedFile?O=this.focusedFile:this.contextMenuFile&&(O=this.contextMenuFile),!O)return;const P=this.treeModel.root.getIndexAtTreeNode(O);if(P===0)return;const L=P-1,N=this.treeModel.root.getTreeNodeAtIndex(L);if(!N)return;const k=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),B=L*f.FILE_TREE_NODE_HEIGHT;this.activateFileFocusedDecoration(N),(k.scrollPosition||0)>B&&this.fileTreeHandle.ensureVisible(N,"start")}async collapseCurrentFile(){let O;this.focusedFile?(O=this.focusedFile,this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0):this.contextMenuFile&&(O=this.contextMenuFile,this.focusedDecoration.removeTarget(this.contextMenuFile),this.contextMenuFile=void 0);const P=this.selectedFiles.indexOf(O);P>=0&&(this.selectedFiles.splice(P,1),this.selectedDecoration.removeTarget(O));let L;if(u.Directory.is(O)&&O.expanded)L=O;else if(O)u.Directory.isRoot(O.parent)?L=O:L=O.parent;else return;this.focusedFile=L,L&&L.expanded&&(await this.fileTreeHandle.collapseNode(L),this.activeFileFocusedDecoration(L,!0))}async expandCurrentFile(){let O;this.focusedFile?(O=this.focusedFile,this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0):this.contextMenuFile&&(O=this.contextMenuFile,this.focusedDecoration.removeTarget(this.contextMenuFile),this.contextMenuFile=void 0);const P=this.selectedFiles.indexOf(O);P>=0&&(this.selectedFiles.splice(P,1),this.selectedDecoration.removeTarget(O)),this.focusedFile=O,u.Directory.is(O)&&(O.expanded||await this.fileTreeHandle.expandNode(O))}async collapseAll(){await this.treeModel.root.collapsedAll();const O=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY);O&&this.explorerStorage.set(n.FILE_TREE_SNAPSHOT_KEY,{...O,expandedDirectories:{atSurface:[],buried:[]}})}async deleteFileByUris(O){var P;if(O.length===0)return;if(this.corePreferences["explorer.confirmDelete"]){const B=(0,b.localize)("file.confirm.delete.ok"),F=(0,b.localize)("file.confirm.delete.cancel"),W=`[ ${O.slice(0,5).map(H=>H.displayName).join(",")}${O.length>5?" ...":""} ]`;if(await this.dialogService.warning((0,b.formatLocalize)("file.confirm.delete",W),[F,B])!==B)return}const L=this.fileTreeService.sortPaths(O);let N;if(this.treeModel.root.branchSize===O.length)N=void 0;else if(this.selectedFiles.length&&!L.find(B=>B.path.toString()===this.selectedFiles[0].uri.toString()))N=this.selectedFiles[0];else{const B=(P=L[L.length-1])===null||P===void 0?void 0:P.node;if(!B)N=void 0;else{let W=this.treeModel.root.getIndexAtTreeNode(B)+1;if(W>=this.treeModel.root.branchSize){const V=L[0].node;W=this.treeModel.root.getIndexAtTreeNode(V)-1}N=this.treeModel.root.getTreeNodeAtIndex(W)}}const k=[];L.forEach(B=>{this.loadingDecoration.addTarget(B.node),k.push(this.deleteFile(B.node,B.path).then(F=>(this.loadingDecoration.removeTarget(B.node),F)))}),this.treeModel.dispatchChange(),await Promise.all(k),N&&this.activeFileDecoration(N)}async deleteFile(O,P){const L=typeof P=="string"?new b.URI(P):P,N=await this.fileTreeAPI.delete(L);return N?(this.messageService.error(N),!1):((B=>{var F,W,V;B.uri.isEqual(L)?this.fileTreeService.deleteAffectedNodeByPath(B.path):this.fileTreeService.refresh(O.parent),this.loadingDecoration.removeTarget(B),(F=this.contextKey)===null||F===void 0||F.explorerCompressedFocusContext.set(!1),(W=this.contextKey)===null||W===void 0||W.explorerCompressedFirstFocusContext.set(!1),(V=this.contextKey)===null||V===void 0||V.explorerCompressedLastFocusContext.set(!1)})(O),!0)}getWellFormedFileName(O){return O&&(O=w(O," "),O=I(O,"."),O=I(O,"/"),O=I(O,"\\"),O)}trimLongName(O){return O&&O.length>255?`${O.substr(0,255)}...`:O}async getPromptTarget(O,P){let L;if(O.isEqual(this.treeModel.root.uri))L=await this.fileTreeService.getNodeByPathOrUri(O);else if(this.focusedFile)L=this.focusedFile;else if(this.contextMenuFile)L=this.contextMenuFile;else if(this.selectedFiles.length>0){const k=this.selectedFiles[this.selectedFiles.length-1];if(this.treeModel.root.isItemVisibleAtSurface(k))L=k;else{const B=await this.fileTreeService.getFileTreeNodePathByUri(O);L=await this.treeModel.root.loadTreeNodeByPath(B)}}else L=await this.fileTreeService.getNodeByPathOrUri(O);L||(L=this.treeModel.root);const N=A.splitPath(L.name);if(u.Directory.isRoot(L))return L;if(L.name!==O.displayName&&N[N.length-1]!==O.displayName&&P){const k=O.relative(L.uri).toString(),B=L.name.replace(`${A.separator}${k}`,""),F=L.parent.uri.resolve(B),W=k.split(A.separator)[0];if(!B)return;if(L.children)for(const V of L.children)this.fileTreeService.deleteAffectedNodeByPath(V.path,!0);L.updateMetaData({name:B?.toString(),uri:F,tooltip:this.fileTreeAPI.getReadableTooltip(F),fileStat:{...L.filestat,uri:F.toString()}}),this.fileTreeService.addNode(L,W,p.TreeNodeType.CompositeTreeNode)}return L}async newFilePrompt(O){const P=await this.getPromptTarget(O,!0);P&&this.proxyPrompt(await this.fileTreeHandle.promptNewTreeNode(P))}async newDirectoryPrompt(O){const P=await this.getPromptTarget(O,!0);P&&this.proxyPrompt(await this.fileTreeHandle.promptNewCompositeTreeNode(P))}async renamePrompt(O){const P=await this.getPromptTarget(O);P&&this.proxyPrompt(await this.fileTreeHandle.promptRename(P,O.displayName))}selectChildNode(O){var P;for(const L of O){const N=this.fileTreeService.getNodeByPathOrUri(L);if(N){const k=u.Directory.isRoot(N)?N.children:(P=N.parent)===null||P===void 0?void 0:P.children;if(k){const B=k[0],F=k[k.length-1],W=this.treeModel.root.getIndexAtTreeNode(B),V=this.treeModel.root.getIndexAtTreeNode(F);this.activeFileDecorationByRange(W,V)}}}}dispose(){this._isDisposed=!0}};e.FileTreeModelService=R,R.FILE_TREE_SNAPSHOT_KEY="FILE_TREE_SNAPSHOT",R.DEFAULT_REFRESHED_ACTION_DELAY=500,R.DEFAULT_LOCATION_FLUSH_DELAY=200,R.DEFAULT_LABEL_CHANGED_DELAY=500,s.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),s.__metadata("design:type",o.Injector)],R.prototype,"injector",void 0),s.__decorate([(0,o.Autowired)(a.IFileTreeService),s.__metadata("design:type",y.FileTreeService)],R.prototype,"fileTreeService",void 0),s.__decorate([(0,o.Autowired)(b.CorePreferences),s.__metadata("design:type",Object)],R.prototype,"corePreferences",void 0),s.__decorate([(0,o.Autowired)(_.ICtxMenuRenderer),s.__metadata("design:type",_.ICtxMenuRenderer)],R.prototype,"ctxMenuRenderer",void 0),s.__decorate([(0,o.Autowired)(_.AbstractContextMenuService),s.__metadata("design:type",_.AbstractContextMenuService)],R.prototype,"contextMenuService",void 0),s.__decorate([(0,o.Autowired)(a.IFileTreeAPI),s.__metadata("design:type",Object)],R.prototype,"fileTreeAPI",void 0),s.__decorate([(0,o.Autowired)(h.IFileServiceClient),s.__metadata("design:type",Object)],R.prototype,"filesystem",void 0),s.__decorate([(0,o.Autowired)(b.StorageProvider),s.__metadata("design:type",Function)],R.prototype,"storageProvider",void 0),s.__decorate([(0,o.Autowired)(l.IDialogService),s.__metadata("design:type",Object)],R.prototype,"dialogService",void 0),s.__decorate([(0,o.Autowired)(E.LabelService),s.__metadata("design:type",E.LabelService)],R.prototype,"labelService",void 0),s.__decorate([(0,o.Autowired)(l.IMessageService),s.__metadata("design:type",Object)],R.prototype,"messageService",void 0),s.__decorate([(0,o.Autowired)(d.WorkbenchEditorService),s.__metadata("design:type",d.WorkbenchEditorService)],R.prototype,"editorService",void 0),s.__decorate([(0,o.Autowired)(b.CommandService),s.__metadata("design:type",Object)],R.prototype,"commandService",void 0),s.__decorate([(0,o.Autowired)(c.IMainLayoutService),s.__metadata("design:type",Object)],R.prototype,"mainlayoutService",void 0),s.__decorate([(0,o.Autowired)(b.IClipboardService),s.__metadata("design:type",Object)],R.prototype,"clipboardService",void 0),e.FileTreeModelService=R=n=s.__decorate([(0,o.Injectable)()],R)},4446:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SymlinkDecorationsProvider=void 0;const n=t(85608),s=t(76003),o=t(41869),p=t(57781);let b=class{constructor(_){this.fileTreeService=_,this.label="symbollink",this.onDidChangeEmitter=new o.Emitter}get onDidChange(){return this.onDidChangeEmitter.event}provideDecorations(_){const E=this.fileTreeService.getNodeByPathOrUri(_.toString());if(E&&E.filestat&&E.filestat.isSymbolicLink)return{letter:"\u2937",source:E.filestat.uri,color:"gitDecoration.ignoredResourceForeground",tooltip:(0,o.localize)("file.tooltip.symbolicLink"),weight:-1,bubble:!E.filestat.isDirectory}}};e.SymlinkDecorationsProvider=b,e.SymlinkDecorationsProvider=b=n.__decorate([n.__param(0,(0,s.Optional)()),n.__metadata("design:paramtypes",[p.FileTreeService])],b)},69959:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.File=e.Directory=void 0;const n=t(97267),s=t(41869);class o extends n.CompositeTreeNode{static is(g){return n.CompositeTreeNode.is(g)}constructor(g,_,E=new s.URI(""),d="",h={children:[],isDirectory:!0,uri:"",lastModification:0},c){super(g,_,void 0,{name:d}),this.uri=E,this.filestat=h,this.tooltip=c,_||(this.isExpanded=!0)}get displayName(){return this.name}updateName(g){this.name!==g&&(n.TreeNode.removeTreeNode(this.id,this.path),this.name=g,n.TreeNode.setTreeNode(this.id,this.path,this))}updateURI(g){this.uri=g}updateFileStat(g){this.filestat=g}updateToolTip(g){this.tooltip=g}updateMetaData(g){const{fileStat:_,tooltip:E,name:d,uri:h}=g;d&&this.updateName(d),_&&this.updateFileStat(_),h&&this.updateURI(h),E&&this.updateToolTip(E)}}e.Directory=o;class p extends n.TreeNode{static is(g){return n.TreeNode.is(g)}constructor(g,_,E=new s.URI(""),d="",h={children:[],isDirectory:!1,uri:"",lastModification:0},c){super(g,_,void 0,{name:d}),this.uri=E,this.filestat=h,this.tooltip=c}get displayName(){return this.name}updateName(g){this.name!==g&&(n.TreeNode.removeTreeNode(this.id,this.path),this.name=g,n.TreeNode.setTreeNode(this.id,this.path,this))}updateURI(g){this.uri=g}updateFileStat(g){this.filestat=g}updateToolTip(g){this.tooltip=g}updateMetaData(g){const{fileStat:_,tooltip:E,name:d,uri:h}=g;d&&this.updateName(d),_&&this.updateFileStat(_),h&&this.updateURI(h),E&&this.updateToolTip(E)}}e.File=p},6250:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RESOURCE_VIEW_ID=e.IFileDialogTreeService=e.IFileDialogModel=e.PasteTypes=e.FileStatNode=e.FileTreeExpandedStatusUpdateEvent=e.IFileTreeService=e.IFileTreeAPI=e.FILE_EXPLORER_WELCOME_ID=void 0;const n=t(43718);e.FILE_EXPLORER_WELCOME_ID="file-explorer",e.IFileTreeAPI=Symbol("IFileTreeAPI"),e.IFileTreeService=Symbol("IFileTreeService");class s extends n.BasicEvent{}e.FileTreeExpandedStatusUpdateEvent=s;var o;(function(b){function g(d){return!!d&&"filestat"in d}b.is=g;function _(d){return!!d&&"filestat"in d&&!d.fileStat.isDirectory}b.isContentFile=_;function E(d){if(g(d))return d.filestat.uri}b.getUri=E})(o||(e.FileStatNode=o={}));var p;(function(b){b[b.NONE=0]="NONE",b[b.COPY=1]="COPY",b[b.CUT=2]="CUT"})(p||(e.PasteTypes=p={})),e.IFileDialogModel=Symbol("IFileDialogModel"),e.IFileDialogTreeService=Symbol("IFileDialogTreeService"),e.RESOURCE_VIEW_ID="file-explorer"},87518:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=t(85608);n.__exportStar(t(6250),e),n.__exportStar(t(83709),e)},67240:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.browserViews=void 0,e.browserViews={"sumiContributes.contributes":"Declare all contributions of the OpenSumi Extension.","sumiContributes.common.command":'The command to execute. The command must be declared in "contributes.command" (except built-in commands)',"sumiContributes.common.when":"This condition must be true to display this item","sumiContributes.common.group":"The group this item belongs to","sumiContributes.browserViews":"Provide a custom view to the editor","sumiContributes.browserViews.left":"Provide a view in the left activity bar container","sumiContributes.browserViews.right":"Provide a view in the right activity bar container","sumiContributes.browserViews.bottom":"Provides a view in the bottom tab bar container (no icon will be rendered, so a title is required)","sumiContributes.browserViews.location.custom":'Provide a view to the "{0}" container',"sumiContributes.browserViews.view.id":"View id, browser/index needs to export a component with the same name as this id","sumiContributes.browserViews.view.icon":"Icon name, reference: [icon](https://opensumi.github.io/core/)","sumiContributes.browserViews.view.iconPath":"local icon relative path","sumiContributes.browserViews.view.title":"View title (will be displayed when type is bottom)","sumiContributes.browserViews.view.titleComponentId":"The id of the custom view title component, the characteristics are exactly the same as the normal browserView","sumiContributes.browserViews.view.expanded":"Do you need to expand to full screen, which will cover up the editor area","sumiContributes.browserMain":"Declare the extension browser entry (the path to the compiled code file relative to the extension directory)","sumiContributes.nodeMain":"Declare the extension node entry (the path to the compiled code file relative to the extension directory)","sumiContributes.workerMain":"Declare the extension workser entry (the path to the compiled code file relative to the extension directory)","sumiContributes.viewsProxies":'Declare the component id that needs to be bound to the componentProxy call, which is the same as the export name. For example, after declaring ["component"], the xxxx function of the component component of the browser layer can be called at the node layer through **`context.componentProxy.component.xxxx`**',"sumiContributes.toolbar":"Toolbar is located on the right side of the menu bar at the top of the IDE by default, and can also be displayed as a separate column","sumiContributes.toolbar.actions":"Used to describe the elements on the Toolbar, currently only supports `button` and `select`, we call it action, in some cases it needs to be used with the Toolbar API","sumiContributes.toolbar.actions.id":"unique identifier","sumiContributes.toolbar.actions.weight":"Order weight, the larger the value, the higher the ranking","sumiContributes.toolbar.actions.preferredPosition":`Register the position of this action, if strictPosition exists, this option has no effect
28228
+ `,y){const S=this.hashCalculateService.calculate(a);return l.length>_.FILE_SAVE_BY_CHANGE_THRESHOLD?await this.fileSchemeDocClient.saveByChange(r.toString(),{baseMd5:S,changes:u,eol:v},m,f,y):await this.fileSchemeDocClient.saveByContent(r.toString(),{baseMd5:S,content:l},m,f,y)}async provideEditorDocumentModelContentMd5(r,l){return this.fileSchemeDocClient.getMd5(r.toString(),l)}};e.FileSchemeDocumentProvider=E,n.__decorate([(0,s.Autowired)(g.IFileServiceClient),n.__metadata("design:type",Object)],E.prototype,"fileServiceClient",void 0),n.__decorate([(0,s.Autowired)(_.IFileSchemeDocClient),n.__metadata("design:type",Object)],E.prototype,"fileSchemeDocClient",void 0),n.__decorate([(0,s.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],E.prototype,"preferenceService",void 0),n.__decorate([(0,s.Autowired)(p.IHashCalculateService),n.__metadata("design:type",Object)],E.prototype,"hashCalculateService",void 0),e.FileSchemeDocumentProvider=E=n.__decorate([(0,s.Injectable)()],E);let d=class{constructor(){this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event,this.listeners={}}isReadonly(r){return!0}handlesScheme(r){return r==="vscode"}async provideEditorDocumentModelContent(r,l){return this.getSchemaContent(r)}getSchemaContent(r){const l=r.toString(),a=this.jsonRegistry.getSchemaContributions().schemas[l];if(a){const u=JSON.stringify(a);if(!this.listeners[l]){const m=o.Disposable.create(()=>{this.jsonRegistry.onDidChangeSchema(f=>{f===l&&this._onDidChangeContent.fire(r)})});this.listeners[l]=m}return u}return"{}"}onDidDisposeModel(r){r.toString()&&(this.listeners[r.toString()].dispose(),delete this.listeners[r.toString()])}};e.VscodeSchemeDocumentProvider=d,n.__decorate([(0,s.Autowired)(o.ISchemaStore),n.__metadata("design:type",Object)],d.prototype,"schemaStore",void 0),n.__decorate([(0,s.Autowired)(o.IJSONSchemaRegistry),n.__metadata("design:type",Object)],d.prototype,"jsonRegistry",void 0),e.VscodeSchemeDocumentProvider=d=n.__decorate([(0,s.Injectable)()],d);let h=class{constructor(){this.documentContentMaps=new Map,this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event}handlesScheme(r){return r===o.Schemes.walkThroughSnippet}provideEditorDocumentModelContent(r,l){return this.documentContentMaps.has(r.toString())||this.documentContentMaps.set(r.toString(),""),this.documentContentMaps.get(r.toString())}isReadonly(){return!1}preferLanguageForUri(){return"plaintext"}};e.WalkThroughSnippetSchemeDocumentProvider=h,e.WalkThroughSnippetSchemeDocumentProvider=h=n.__decorate([(0,s.Injectable)()],h)},41352:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileSchemeDocClientService=void 0;const n=t(85608),s=t(76003),o=t(80449);let p=class{saveByChange(g,_,E,d,h){return this.fileDocBackendService.$saveByChange(g,_,E,d,h)}saveByContent(g,_,E,d,h){return this.fileDocBackendService.$saveByContent(g,_,E,d,h)}getMd5(g,_){return this.fileDocBackendService.$getMd5(g,_)}};e.FileSchemeDocClientService=p,n.__decorate([(0,s.Autowired)(o.FileSchemeDocNodeServicePath),n.__metadata("design:type",Object)],p.prototype,"fileDocBackendService",void 0),e.FileSchemeDocClientService=p=n.__decorate([(0,s.Injectable)()],p)},17276:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileSystemEditorComponentContribution=e.FileSystemEditorResourceContribution=void 0;const n=t(85608),s=t(76003),o=t(41869),p=t(26542),b=t(57517),g=t(17878),_=t(42933),E=t(57646),d=t(60387),h=t(88819),c=t(99025),r="video-preview",l="image-preview",a="external-file",u="large-file-prevent";let m=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)}};e.FileSystemEditorResourceContribution=m,n.__decorate([(0,s.Autowired)(),n.__metadata("design:type",d.FileSchemeDocumentProvider)],m.prototype,"fileSchemeDocumentProvider",void 0),n.__decorate([(0,s.Autowired)(),n.__metadata("design:type",d.VscodeSchemeDocumentProvider)],m.prototype,"vscodeSchemeDocumentProvider",void 0),n.__decorate([(0,s.Autowired)(),n.__metadata("design:type",d.WalkThroughSnippetSchemeDocumentProvider)],m.prototype,"walkThroughSnippetSchemeDocumentProvider",void 0),n.__decorate([(0,s.Autowired)(),n.__metadata("design:type",g.UntitledSchemeResourceProvider)],m.prototype,"untitledResourceProvider",void 0),n.__decorate([(0,s.Autowired)(),n.__metadata("design:type",g.UntitledSchemeDocumentProvider)],m.prototype,"untitledSchemeDocumentProvider",void 0),e.FileSystemEditorResourceContribution=m=n.__decorate([(0,o.Domain)(b.BrowserEditorContribution)],m);let f=class{constructor(){this.cachedFileType=new o.LRUMap(200,100),this.fileServiceClient.onFilesChanged(y=>{y.forEach(S=>{this.cachedFileType.delete(S.uri.toString())})})}registerEditorComponent(y){y.registerEditorComponent({component:c.ImagePreview,uid:l,scheme:o.Schemes.file}),y.registerEditorComponent({component:c.VideoPreview,uid:r,scheme:o.Schemes.file}),y.registerEditorComponent({component:E.BinaryEditorComponent,uid:a,scheme:o.Schemes.file}),y.registerEditorComponent({component:h.LargeFilePrevent,uid:u,scheme:o.Schemes.file}),y.registerEditorComponentResolver(S=>S===o.Schemes.file||this.fileServiceClient.handlesScheme(S)?10:-1,(S,A)=>{A.length===0&&A.push({type:b.EditorOpenType.component,componentId:a})}),y.registerEditorComponentResolver(S=>S===o.Schemes.file||this.fileServiceClient.handlesScheme(S)?10:-1,async(S,A)=>{const T=await this.getFileType(S.uri.toString());switch(T){case"image":{A.push({type:b.EditorOpenType.component,componentId:l});break}case"video":{A.push({type:b.EditorOpenType.component,componentId:r});break}case"binary":case"text":{const{metadata:D,uri:w}=S,I=D||{};if(T==="binary"&&!I.skipPreventBinary)break;const R=await this.fileServiceClient.getFileStat(w.toString());await this.preference.ready;const M=this.preference.getValid("editor.largeFile",4*1024*1024*1024);R&&(R.size||0)>M&&!I.skipPreventTooLarge?A.push({type:b.EditorOpenType.component,componentId:u}):A.push({type:b.EditorOpenType.code,title:(0,o.localize)("editorOpenType.code")});break}}}),y.registerEditorComponentResolver(o.Schemes.untitled,(S,A,T)=>{T([{type:b.EditorOpenType.code,priority:"default"}])})}async getFileType(y){return this.cachedFileType.has(y)||((0,p.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"}}};e.FileSystemEditorComponentContribution=f,n.__decorate([(0,s.Autowired)(_.IFileServiceClient),n.__metadata("design:type",Object)],f.prototype,"fileServiceClient",void 0),n.__decorate([(0,s.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],f.prototype,"preference",void 0),e.FileSystemEditorComponentContribution=f=n.__decorate([(0,o.Domain)(b.BrowserEditorContribution),n.__metadata("design:paramtypes",[])],f)},52568:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileSchemeModule=void 0;const n=t(85608),s=t(76003),o=t(41869),p=t(80449),b=t(41352),g=t(17276);let _=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[g.FileSystemEditorResourceContribution,g.FileSystemEditorComponentContribution,{token:p.IFileSchemeDocClient,useClass:b.FileSchemeDocClientService}],this.backServices=[{servicePath:p.FileSchemeDocNodeServicePath}]}};e.FileSchemeModule=_,e.FileSchemeModule=_=n.__decorate([(0,s.Injectable)()],_)},88819:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LargeFilePrevent=e.PreventComponent=void 0;const n=t(85608),s=n.__importDefault(t(53373)),o=n.__importDefault(t(14041)),p=t(41869),b=t(81878),g=t(54414),_=t(82196),E=n.__importDefault(t(19996)),d=c=>o.default.createElement("div",{className:E.default["error-page"]},o.default.createElement("div",{className:(0,s.default)(E.default.icon,(0,p.getExternalIcon)("warning"))}),o.default.createElement("div",{className:E.default.description},c.description),o.default.createElement("div",{className:E.default["actions-wrapper"]},c.actions.map((r,l)=>o.default.createElement(b.Button,{key:l,onClick:()=>r.onClick(),className:E.default["action-button"]},r.label))));e.PreventComponent=d;const h=()=>{const c=(0,p.useInjectable)(g.WorkbenchEditorService),r=(0,p.useInjectable)(p.IEventBus),l=()=>{const a=c.currentResource;a&&(a.metadata={...a.metadata,skipPreventTooLarge:!0},r.fire(new _.ResourceOpenTypeChangedEvent(a.uri)))};return o.default.createElement(e.PreventComponent,{description:(0,p.localize)("editor.largeFile.prevent"),actions:[{label:(0,p.localize)("editor.file.prevent.stillOpen"),onClick:()=>l()}]})};e.LargeFilePrevent=h},99025:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ImagePreview=e.VideoPreview=void 0;const n=t(85608),s=n.__importDefault(t(14041)),o=t(41869),p=t(40827),b=n.__importDefault(t(19996)),g=d=>{const h=(0,o.useInjectable)(p.StaticResourceService);return{src:s.default.useMemo(()=>h.resolveStaticResource(d.uri).toString(),[d])}},_=d=>{const{src:h}=g(d.resource);return s.default.createElement("div",{className:b.default.kt_video_preview},s.default.createElement("video",{autoPlay:!0,controls:!0,className:b.default.kt_video,src:h}))};e.VideoPreview=_;const E=d=>{const h=s.default.useRef(),c=s.default.useRef(),{src:r}=g(d.resource);return s.default.useEffect(()=>{const l=new o.Disposable;return h.current&&(h.current.src=r),()=>{l.dispose()}},[d.resource]),s.default.createElement("div",{className:b.default.kt_image_preview},s.default.createElement("div",{ref:c},s.default.createElement("img",{ref:l=>l&&(h.current=l)})))};e.ImagePreview=E},80449:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChangeType=e.FileSchemeDocNodeServicePath=e.IFileSchemeDocNodeService=e.IFileSchemeDocClient=e.FILE_SAVE_BY_CHANGE_THRESHOLD=e.FILE_ON_DISK_SCHEME=void 0,e.FILE_ON_DISK_SCHEME="fileOnDisk",e.FILE_SAVE_BY_CHANGE_THRESHOLD=1e5,e.IFileSchemeDocClient=Symbol("IFileSchemeDocClient"),e.IFileSchemeDocNodeService=Symbol("FileSchemeDocNodeService"),e.FileSchemeDocNodeServicePath="FileSchemeDocNodeService";var t;(function(n){n[n.ADDED=1]="ADDED",n[n.REMOVED=2]="REMOVED"})(t||(e.ChangeType=t={}))},15625:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IFileSearchService=e.FileSearchServicePath=void 0,e.FileSearchServicePath="FileSearchServicePath",e.IFileSearchService=Symbol("FileSearchService")},84660:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),t(85608).__exportStar(t(15625),e)},2156:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileServiceClient=e.BrowserFileSystemRegistryImpl=void 0;const n=t(85608),s=t(32852),o=t(76003),p=t(41869),b=t(43718),g=t(37406),_=t(41682),E=t(42933),d=t(81952);let h=class{constructor(){this.providers=new Map}registerFileSystemProvider(l){const a=l.scheme;return this.providers.set(a,l),{dispose:()=>{this.providers.delete(a)}}}};e.BrowserFileSystemRegistryImpl=h,e.BrowserFileSystemRegistryImpl=h=n.__decorate([(0,o.Injectable)()],h);let c=class{constructor(){this.watcherWithSchemaMap=new Map,this.watcherDisposerMap=new Map,this.onFileChangedEmitter=new p.Emitter,this.onFileProviderChangedEmitter=new p.Emitter,this._onFilesChanged=new p.Emitter,this.onFilesChanged=this._onFilesChanged.event,this._onFileProviderChanged=new p.Emitter,this.onFileProviderChanged=this._onFileProviderChanged.event,this._onDidChangeFileSystemProviderRegistrations=new p.Emitter,this.onDidChangeFileSystemProviderRegistrations=this._onDidChangeFileSystemProviderRegistrations.event,this._onWillActivateFileSystemProvider=new p.Emitter,this.onWillActivateFileSystemProvider=this._onWillActivateFileSystemProvider.event,this._onDidChangeFileSystemProviderCapabilities=new p.Emitter,this.onDidChangeFileSystemProviderCapabilities=this._onDidChangeFileSystemProviderCapabilities.event,this.filesExcludesMatcherList=[],this.watcherId=0,this.toDisposable=new p.DisposableCollection,this.watchFileExcludes=[],this.watchFileExcludesMatcherList=[],this.filesExcludes=[],this.workspaceRoots=[],this._providerChanged=new Set,this.fsProviders=new Map,this.userHomeDeferred=new p.Deferred,this.options={encoding:"utf8",overwrite:!1,recursive:!0,moveToTrash:!0},this.uriWatcherMap=new Map,this.toDisposable.push(this.onDidChangeFileSystemProviderRegistrations(l=>{l.added&&l.scheme===b.Schemes.file&&this.doGetCurrentUserHome()}))}async doGetCurrentUserHome(){const a=(await this.getProvider(b.Schemes.file)).getCurrentUserHome();this.userHomeDeferred.resolve(a)}handlesScheme(l){return this.registry.providers.has(l)||this.fsProviders.has(l)}dispose(){return this.toDisposable.dispose()}async resolveContent(l,a){const u=this.convertUri(l),f=await(await this.getProvider(u.scheme)).readFile(u.codeUri),v=f.data||f;return{content:p.BinaryBuffer.wrap(Uint8Array.from(v)).toString(a?.encoding)}}async readFile(l){const a=this.convertUri(l),m=await(await this.getProvider(a.scheme)).readFile(a.codeUri),f=m.data||m;return{content:p.BinaryBuffer.wrap(Uint8Array.from(f))}}async readFileStream(l){const a=this.convertUri(l);return await(await this.getProvider(a.scheme)).readFileStream(a.codeUri)}async getFileStat(l,a=!0){const u=this.convertUri(l),m=await this.getProvider(u.scheme);try{const f=await m.stat(u.codeUri);if(!f)throw E.FileSystemError.FileNotFound(u.codeUri.toString(),"File not found.");return this.filterStat(f,a)}catch(f){if(E.FileSystemError.FileNotFound.is(f))return}}async setContent(l,a,u){const m=this.convertUri(l.uri),f=await this.getProvider(m.scheme),v=await f.stat(m.codeUri);if(!v)throw E.FileSystemError.FileNotFound(l.uri,"File not found.");if(v.isDirectory)throw E.FileSystemError.FileIsADirectory(l.uri,"Cannot set the content.");if(!await this.isInSync(l,v))throw this.createOutOfSyncError(l);return await f.writeFile(m.codeUri,typeof a=="string"?p.BinaryBuffer.fromString(a).buffer:a,{create:!1,overwrite:!0,encoding:u?.encoding}),await f.stat(m.codeUri)}async updateContent(l,a,u){const m=this.convertUri(l.uri),f=await this.getProvider(m.scheme),v=await f.stat(m.codeUri);if(!v)throw E.FileSystemError.FileNotFound(l.uri,"File not found.");if(v.isDirectory)throw E.FileSystemError.FileIsADirectory(l.uri,"Cannot set the content.");if(!this.checkInSync(l,v))throw this.createOutOfSyncError(l);if(a.length===0)return v;const y=await f.readFile(m.codeUri),S=this.applyContentChanges(p.BinaryBuffer.wrap(y).toString(u?.encoding),a);await f.writeFile(m.codeUri,p.BinaryBuffer.fromString(S).buffer,{create:!1,overwrite:!0,encoding:u?.encoding});const A=await f.stat(m.codeUri);if(!A)throw E.FileSystemError.FileNotFound(m.codeUri.toString(),"File not found.");return A}async createFile(l,a){const u=this.convertUri(l),m=await this.getProvider(u.scheme),f=p.BinaryBuffer.fromString(a?.content||"").buffer;let v=await m.writeFile(u.codeUri,f,{create:!0,overwrite:a&&a.overwrite||!1,encoding:a?.encoding});return v=v||await m.stat(u.codeUri),v}async createFolder(l){const a=this.convertUri(l),u=await this.getProvider(a.scheme),m=await u.createDirectory(a.codeUri);return m||await u.stat(a.codeUri)}async move(l,a,u){const m=this.convertUri(l),f=this.convertUri(a),v=await this.getProvider(m.scheme),y=await v.rename(m.codeUri,f.codeUri,{overwrite:!!(u&&u.overwrite)});return y||await v.stat(f.codeUri)}async copy(l,a,u){const m=this.convertUri(l),f=this.convertUri(a),v=await this.getProvider(m.scheme),y=await this.doGetOverwrite(u);if(!(0,E.containsExtraFileMethod)(v,"copy"))throw this.getErrorProvideNotSupport(m.scheme,"copy");const S=await v.copy(m.codeUri,f.codeUri,{overwrite:!!y});return S||await v.stat(f.codeUri)}async getFsPath(l){if(l.startsWith("file:/"))return p.FileUri.fsPath(l)}fireFilesChange(l){const a=l.changes.map(u=>({uri:u.uri,type:u.type}));this._onFilesChanged.fire(a),this.eventBus.fire(new p.FilesChangeEvent(a))}async watchFileChanges(l,a){const m=(this.appConfig.unRecursiveDirectories||[]).some(w=>l.path.toString().startsWith(w)),f=this.convertUri(l.toString()),v=this.uriWatcherMap.get(f.toString());if(v)if(v.isDisposed())this.uriWatcherMap.delete(f.toString());else return v;const y=this.watcherId++,S=await this.getProvider(f.scheme),A=this.watcherWithSchemaMap.get(f.scheme)||[],T=await S.watch(f.codeUri,{excludes:a,recursive:!m});this.watcherDisposerMap.set(y,{dispose:async()=>{const w=this.uriWatcherMap.get(f.toString());await Promise.all([S.unwatch&&S.unwatch(T),w&&w.dispose()]),this.uriWatcherMap.delete(f.toString())}}),A.push(y),this.watcherWithSchemaMap.set(f.scheme,A);const D=new d.FileSystemWatcher({fileServiceClient:this,watchId:y,uri:l});return this.uriWatcherMap.set(f.toString(),D),D}async setWatchFileExcludes(l){return await(await this.getProvider(b.Schemes.file)).setWatchFileExcludes(l)}async getWatchFileExcludes(){return await(await this.getProvider(b.Schemes.file)).getWatchFileExcludes()}async setFilesExcludes(l,a){this.filesExcludes=l,this.filesExcludesMatcherList=[],a&&this.setWorkspaceRoots(a),this.updateExcludeMatcher()}async setWorkspaceRoots(l){this.workspaceRoots=l,this.updateExcludeMatcher()}async unwatchFileChanges(l){const a=this.watcherDisposerMap.get(l);if(!(!a||!a.dispose))return this.watcherDisposerMap.delete(l),a.dispose()}async delete(l,a){if(this.appConfig.isElectronRenderer&&a?.moveToTrash!==!1){const f=new p.URI(l);if(f.scheme===b.Schemes.file)return this.injector.get(g.IElectronMainUIService).moveToTrash(f.codeUri.fsPath)}const u=this.convertUri(l),m=await this.getProvider(u.scheme);await m.stat(u.codeUri),await m.delete(u.codeUri,{recursive:!0,moveToTrash:await this.doGetMoveToTrash(a)})}async getEncoding(l){return"utf8"}listCapabilities(){return _.Iterable.map(this.fsProviders,([l,a])=>({scheme:l,capabilities:a.capabilities}))}registerProvider(l,a){if(this.fsProviders.has(l))throw new Error(`The file system provider for \`${l}\` already registered`);const u=[];this.fsProviders.set(l,a),this._onDidChangeFileSystemProviderRegistrations.fire({added:!0,scheme:l,provider:a}),u.push({dispose:()=>{this._onDidChangeFileSystemProviderRegistrations.fire({added:!1,scheme:l,provider:a}),this.fsProviders.delete(l),this._providerChanged.add(l)}}),a.onDidChangeFile&&u.push(a.onDidChangeFile(f=>this.fireFilesChange({changes:f}))),this.toDisposable.push(a.onDidChangeCapabilities(()=>this._onDidChangeFileSystemProviderCapabilities.fire({provider:a,scheme:l}))),u.push({dispose:async()=>{const f=[];(this.watcherWithSchemaMap.get(l)||[]).forEach(v=>f.push(this.unwatchFileChanges(v))),await Promise.all(f)}}),this._providerChanged.add(l),this.onFileProviderChangedEmitter.fire(Array.from(this._providerChanged)),this.toDisposable.pushAll(u);const m=new p.DisposableCollection;return m.pushAll(u),this._onFileProviderChanged.fire(Array.from(this._providerChanged)),m}async access(l,a=E.FileAccess.Constants.F_OK){const u=this.convertUri(l),m=await this.getProvider(u.scheme);if(!(0,E.containsExtraFileMethod)(m,"access"))throw this.getErrorProvideNotSupport(u.scheme,"access");return await m.access(u.codeUri,a)}async getFileType(l){const a=this.convertUri(l),u=await this.getProvider(a.scheme);if(!(0,E.containsExtraFileMethod)(u,"getFileType"))throw this.getErrorProvideNotSupport(a.scheme,"getFileType");return await u.getFileType(l)}async getCurrentUserHome(){return this.userHomeDeferred.promise}getErrorProvideNotSupport(l,a){return`Scheme ${l} not support this function: ${a}.`}convertUri(l){const a=new p.URI(l);if(!a.scheme)throw new Error(`Unsupported convert Uri with non-scheme Uri: ${l}`);return a}updateExcludeMatcher(){this.filesExcludes.forEach(l=>{this.workspaceRoots.length>0?this.workspaceRoots.forEach(a=>{const m=new p.URI(a).resolve(l).path.toString();this.filesExcludesMatcherList.push((0,p.parseGlob)(m))}):this.filesExcludesMatcherList.push((0,p.parseGlob)(l))})}async shouldWaitProvider(l){const a=await this._onWillActivateFileSystemProvider.fireAndAwait({scheme:l}),{result:u}=a[0];if(u&&u.includes(l)){const m=await p.Event.toPromise(p.Event.filter(this.onFileProviderChanged,f=>f.includes(l)));if(!(0,b.isUndefined)(m))return!0}return!1}async getProvider(l){this._providerChanged.has(l)&&(await this.eventBus.fireAndAwait(new p.ExtensionActivateEvent({topic:"onFileSystem",data:l}),{timeout:3e3}),this._providerChanged.delete(l));const a=this.fsProviders.get(l);if(!a)throw new Error(`Not find ${l} provider.`);return a}async isReadonly(l){try{const a=new p.URI(l);return!!(await(await this.getProvider(a.scheme)).stat(this.convertUri(l).codeUri)).readonly}catch{return!1}}isExclude(l){const a=new p.URI(l);return this.filesExcludesMatcherList.some(u=>u(a.path.toString()))}filterStat(l,a=!0){if(l&&!this.isExclude(l.uri))return l.children&&a&&(l.children=this.filterStatChildren(l.children)),l}filterStatChildren(l){const a=[];return l.forEach(u=>{if(this.isExclude(u.uri))return!1;const m=this.filterStat(u);m&&a.push(m)}),a}applyContentChanges(l,a){let u=s.TextDocument.create("","",1,l);for(const m of a){let f=m.text;if(m.range){const v=u.offsetAt(m.range.start),y=u.offsetAt(m.range.end);f=u.getText().substr(0,v)+m.text+u.getText().substr(y)}u=s.TextDocument.create(u.uri,u.languageId,u.version,f)}return u.getText()}async isInSync(l,a){return!!this.checkInSync(l,a)}checkInSync(l,a){return a.lastModification===l.lastModification&&a.size===l.size}createOutOfSyncError(l){return E.FileSystemError.FileIsOutOfSync(l.uri)}async doGetEncoding(l){return l&&typeof l.encoding<"u"?l.encoding:this.options.encoding}async doGetOverwrite(l){return l&&typeof l.overwrite<"u"?l.overwrite:this.options.overwrite}async doGetRecursive(l){return l&&typeof l.recursive<"u"?l.recursive:this.options.recursive}async doGetMoveToTrash(l){return l&&typeof l.moveToTrash<"u"?l.moveToTrash:this.options.moveToTrash}};e.FileServiceClient=c,n.__decorate([(0,o.Autowired)(E.IBrowserFileSystemRegistry),n.__metadata("design:type",h)],c.prototype,"registry",void 0),n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],c.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(b.IEventBus),n.__metadata("design:type",Object)],c.prototype,"eventBus",void 0),n.__decorate([(0,o.Autowired)(p.AppConfig),n.__metadata("design:type",Object)],c.prototype,"appConfig",void 0),e.FileServiceClient=c=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],c)},69037:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileServiceContribution=void 0;const n=t(85608),s=t(76003),o=t(41869),p=t(42933),b=t(2156);let g=class{constructor(){this._disposables=new o.DisposableStore,this._disposables.add(this.fileSystem.registerProvider(o.Schemes.file,this.diskFileServiceProvider))}async initialize(){const E=this.contributionProvider.getContributions();await Promise.all(E.map(async d=>{d.registerProvider&&await d.registerProvider(this.fileSystem)})),await Promise.all(E.map(async d=>{d.onFileServiceReady&&await d.onFileServiceReady()}))}dispose(){this._disposables.dispose()}};e.FileServiceContribution=g,n.__decorate([(0,s.Autowired)(p.IFileServiceClient),n.__metadata("design:type",b.FileServiceClient)],g.prototype,"fileSystem",void 0),n.__decorate([(0,s.Autowired)(p.IDiskFileProvider),n.__metadata("design:type",Object)],g.prototype,"diskFileServiceProvider",void 0),n.__decorate([(0,s.Autowired)(o.FsProviderContribution),n.__metadata("design:type",Object)],g.prototype,"contributionProvider",void 0),e.FileServiceContribution=g=n.__decorate([(0,o.Domain)(o.ClientAppContribution),n.__metadata("design:paramtypes",[])],g)},60476:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DiskFsProviderClient=e.CoreFileServiceProviderClient=void 0;const n=t(85608),s=t(76003),o=t(43718),p=t(42933);class b{constructor(){this.onDidChangeFileEmitter=new o.Emitter,this.onDidChangeFile=this.onDidChangeFileEmitter.event}watch(E,d){return this.fileServiceProvider.watch(E,d)}unwatch(E){return this.fileServiceProvider.unwatch&&this.fileServiceProvider.unwatch(E)}async stat(E){return await this.fileServiceProvider.stat(E)}readDirectory(E){return this.fileServiceProvider.readDirectory(E)}createDirectory(E){return this.fileServiceProvider.createDirectory(E)}async readFile(E,d){return d&&(0,o.getDebugLogger)("fileService.fsProvider").warn("encoding option for fsProvider.readFile is deprecated"),await this.fileServiceProvider.readFile(E)}readFileStream(E){if(this.fileServiceProvider.readFileStream)return this.fileServiceProvider.readFileStream(E);throw new Error("readFileStream not supported")}writeFile(E,d,h){return this.fileServiceProvider.writeFile(E,Array.from(d),h)}delete(E,d){return this.fileServiceProvider.delete(E,d)}rename(E,d,h){return this.fileServiceProvider.rename(E,d,h)}}e.CoreFileServiceProviderClient=b,n.__decorate([(0,s.Autowired)(s.INJECTOR_TOKEN),n.__metadata("design:type",s.Injector)],b.prototype,"injector",void 0);let g=class extends b{constructor(){super(...arguments),this.onDidChangeCapabilities=o.Event.None}get capabilities(){return this._capabilities||(this._capabilities=12318,o.isLinux&&(this._capabilities|=1024)),this._capabilities}setWatchFileExcludes(E){return this.fileServiceProvider.setWatchFileExcludes(E)}getWatchFileExcludes(){return this.fileServiceProvider.getWatchFileExcludes()}onDidFilesChanged(E){const d=E.changes.map(h=>({uri:h.uri,type:h.type}));this.onDidChangeFileEmitter.fire(d)}copy(E,d,h){return this.fileServiceProvider.copy(E,d,h)}access(E,d){return this.fileServiceProvider.access(E,d)}getCurrentUserHome(){return this.fileServiceProvider.getCurrentUserHome()}getFileType(E){return this.fileServiceProvider.getFileType(E)}};e.DiskFsProviderClient=g,n.__decorate([(0,s.Autowired)(p.DiskFileServicePath),n.__metadata("design:type",Object)],g.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)],g.prototype,"setWatchFileExcludes",null),e.DiskFsProviderClient=g=n.__decorate([(0,s.Injectable)()],g)},96708:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileServiceClientModule=void 0;const n=t(85608),s=t(76003),o=t(41869),p=t(42933),b=t(70671),g=t(2156),_=t(69037),E=t(60476),d=t(23188);let h=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:p.IFileServiceClient,useClass:g.FileServiceClient},{token:p.IBrowserFileSystemRegistry,useClass:g.BrowserFileSystemRegistryImpl},{token:p.IDiskFileProvider,useClass:E.DiskFsProviderClient},{token:p.IShadowFileProvider,useClass:d.ShadowFileSystemProvider},_.FileServiceContribution],this.backServices=[{servicePath:p.DiskFileServicePath,clientToken:p.IDiskFileProvider,protocol:b.DiskFileServiceProtocol}]}};e.FileServiceClientModule=h,e.FileServiceClientModule=h=n.__decorate([(0,s.Injectable)()],h)},23188:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShadowFileSystemProvider=void 0;const n=t(85608),s=t(76003),o=t(41869);let p=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(g){throw new Error("Method not implemented.")}readFileStream(g){throw new Error("Method not implemented.")}watch(g,_){throw new Error("Method not implemented.")}stat(g){return Promise.resolve({uri:g.toString(),lastModification:0})}readDirectory(g){throw new Error("Method not implemented.")}createDirectory(g){throw new Error("Method not implemented.")}readFile(g){return this.shadowFiles.get(g.toString())||o.BinaryBuffer.fromString("no available").buffer}writeFile(g,_,E){this.shadowFiles.set(g.toString(),_)}delete(g,_){throw new Error("Method not implemented.")}rename(g,_,E){throw new Error("Method not implemented.")}copy(g,_,E){throw new Error("Method not implemented.")}exists(g){throw new Error("Method not implemented.")}access(g,_){throw new Error("Method not implemented.")}};e.ShadowFileSystemProvider=p,e.ShadowFileSystemProvider=p=n.__decorate([(0,s.Injectable)()],p)},81952:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileSystemWatcher=void 0;const n=t(43718);function s(p,b){return p.filter(g=>!!g.uri.startsWith(b))}class o{constructor(b){this.toDispose=new n.DisposableCollection,this.changeEmitter=new n.Emitter,this.toDispose.push(this.changeEmitter),this.fileServiceClient=b.fileServiceClient,this.watchId=b.watchId,this.uri=b.uri,this.fileServiceClient.onFilesChanged(g=>{const _=s(g,this.uri.toString());_&&_.length>0&&this.changeEmitter.fire(_)})}get onFilesChanged(){return this.changeEmitter.event}dispose(){return Promise.all([this.toDispose.dispose(),this.fileServiceClient.unwatchFileChanges(this.watchId)])}isDisposed(){return this.toDispose.disposed}}e.FileSystemWatcher=o},91813:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EXT_LIST_TEXT=e.EXT_LIST_IMAGE=e.EXT_LIST_VIDEO=void 0,e.getFileTypeByExt=t,e.EXT_LIST_VIDEO=new Set(["mp4","webm","mkv","mov","mts","flv","avi","wmv"]),e.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"]),e.EXT_LIST_TEXT=new Set(["xml"]);function t(n){let s="text";return n&&(e.EXT_LIST_IMAGE.has(n)?s="image":e.EXT_LIST_VIDEO.has(n)?s="video":e.EXT_LIST_TEXT.has(n)?s="text":s="binary"),s}},79929:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IBrowserFileSystemRegistry=e.IFileServiceClient=void 0;const n=t(43718);e.IFileServiceClient=n.IFileServiceClient,e.IBrowserFileSystemRegistry=Symbol("IBrowserFileSystemRegistry")},49818:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileSystemError=e.FileOperationError=e.FileSystemProviderError=e.FileSystemProviderErrorCode=e.FileAccess=e.IFileService=e.IShadowFileProvider=e.IDiskFileProvider=e.FileStat=e.FileType=void 0,e.createFileSystemProviderError=E,e.markAsFileSystemProviderError=d,e.containsExtraFileMethod=c,e.notEmpty=r,e.isErrnoException=l,e.handleError=a;const n=t(85608),s=t(43718);var o=t(31036);Object.defineProperty(e,"FileType",{enumerable:!0,get:function(){return o.FileType}}),Object.defineProperty(e,"FileStat",{enumerable:!0,get:function(){return o.FileStat}}),n.__exportStar(t(11854),e),e.IDiskFileProvider=Symbol("IDiskFileProvider"),e.IShadowFileProvider=Symbol("IShadowFileProvider"),e.IFileService=Symbol("IFileService");var p;(function(u){let m;(function(f){f.F_OK=0,f.R_OK=4,f.W_OK=2,f.X_OK=1})(m=u.Constants||(u.Constants={}))})(p||(e.FileAccess=p={}));var b;(function(u){u.FileExists="EntryExists",u.FileNotFound="EntryNotFound",u.FileNotADirectory="EntryNotADirectory",u.FileIsADirectory="EntryIsADirectory",u.FileIsOutOfSync="FileIsOutOfSync",u.FileExceedsMemoryLimit="EntryExceedsMemoryLimit",u.FileTooLarge="EntryTooLarge",u.FileWriteLocked="EntryWriteLocked",u.NoPermissions="NoPermissions",u.Unavailable="Unavailable",u.Unknown="Unknown"})(b||(e.FileSystemProviderErrorCode=b={}));class g extends Error{static declare(m,f){return Object.assign((...v)=>E(f(...v),m),{is:v=>{var y;return(y=v.stack)===null||y===void 0?void 0:y.startsWith(m)}})}constructor(m,f){super(m),this.code=f}is(m){return this.name===m.name}}e.FileSystemProviderError=g;class _ extends Error{constructor(m,f,v){super(m),this.fileOperationResult=f,this.options=v}static isFileOperationError(m){return m instanceof Error&&!(0,s.isUndefinedOrNull)(m.fileOperationResult)}}e.FileOperationError=_;function E(u,m){const f=new g(u.toString(),m);return d(f,m),f}function d(u,m){return u.name=m?`${m} (FileSystemError)`:"FileSystemError",u}var h;(function(u){u.FileNotFound=g.declare(b.FileNotFound,(m,f)=>`${f?f+" ":""} '${m}' is not found.`),u.FileExists=g.declare(b.FileExists,(m,f)=>`${f?f+" ":""}'${m}' already exists.`),u.FileNotADirectory=g.declare(b.FileNotADirectory,(m,f)=>`${f?f+" ":""}'${m}' is not a directory.`),u.FileIsADirectory=g.declare(b.FileIsADirectory,(m,f)=>`${f?f+" ":""}'${m}' is a directory.`),u.FileIsOutOfSync=g.declare(b.FileIsOutOfSync,(m,f)=>`${f?f+" ":""}'${m}' is out of sync.`),u.FileExceedsMemoryLimit=g.declare(b.FileExceedsMemoryLimit,(m,f)=>`${f?f+" ":""}'${m}' is exceeds memory limit.`),u.FileTooLarge=g.declare(b.FileTooLarge,(m,f)=>`${f?f+" ":""}'${m}' is too large.`),u.FileWriteLocked=g.declare(b.FileWriteLocked,(m,f)=>`${f?f+" ":""}'${m}' is locked.`),u.FileIsNoPermissions=g.declare(b.NoPermissions,(m,f)=>`${f?f+" ":""}'${m}' is no permissions.`),u.Unavailable=g.declare(b.Unavailable,(m,f)=>`${f?f+" ":""}'${m}' is unavailable.`),u.Unknown=g.declare(b.Unknown,(m,f)=>`${f?f+" ":""}'${m}' is unkonw.`)})(h||(e.FileSystemError=h={}));function c(u,m){return(0,s.hasProperty)(u,m)&&(0,s.isFunction)(u[m])}function r(u){return u!==void 0}function l(u){return u.code!==void 0&&u.errno!==void 0}function a(u){var m,f,v,y,S;if(l(u))switch(u.code){case"EEXIST":throw h.FileExists(s.Uri.file((m=u.path)!==null&&m!==void 0?m:""));case"EPERM":case"EACCESS":throw h.FileIsNoPermissions(s.Uri.file((f=u.path)!==null&&f!==void 0?f:""));case"ENOENT":throw h.FileNotFound(s.Uri.file((v=u.path)!==null&&v!==void 0?v:""));case"ENOTDIR":throw h.FileNotADirectory(s.Uri.file((y=u.path)!==null&&y!==void 0?y:""));case"EISDIR":throw h.FileIsADirectory(s.Uri.file((S=u.path)!==null&&S!==void 0?S:""))}throw u}},42933:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=t(85608);n.__exportStar(t(79929),e),n.__exportStar(t(49818),e),n.__exportStar(t(28217),e),n.__exportStar(t(91813),e),n.__exportStar(t(50295),e)},70671:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DiskFileServiceProtocol=void 0;const n=t(26387),s=t(52890),o=t(50295);e.DiskFileServiceProtocol={name:o.DiskFileServicePath,methods:[{method:"readFile",request:[{name:"uri",type:s.UriComponentsProto}],response:{type:n.Type.binary()}}]}},50295:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileExtServicePath=e.FileWatcherServicePath=e.ShadowFileServicePath=e.DiskFileServicePath=e.FileServicePath=void 0,e.FileServicePath="FileService",e.DiskFileServicePath="DiskFileService",e.ShadowFileServicePath="ShadowFileService",e.FileWatcherServicePath="FileWatcherService",e.FileExtServicePath="FileExtServicePath"},28217:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.INsfw=void 0;var t;(function(n){let s;(function(o){o[o.CREATED=0]="CREATED",o[o.DELETED=1]="DELETED",o[o.MODIFIED=2]="MODIFIED",o[o.RENAMED=3]="RENAMED"})(s=n.actions||(n.actions={}))})(t||(e.INsfw=t={}))},14951:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),t(85608).__exportStar(t(42933),e)},57942:(x,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeDialogModel=void 0;const s=t(85608),o=t(76003),p=t(97267),b=t(41869),g=t(26542),_=t(6250),E=t(2812),d=s.__importDefault(t(89200)),h=t(9018);let c=n=class{static createContainer(l,a){return l.createChild([{token:_.IFileDialogTreeService,useValue:a},{token:_.IFileDialogModel,useClass:n}])}static createModel(l,a){return n.createContainer(l,a).get(_.IFileDialogModel)}constructor(){this.selectedDecoration=new p.Decoration(d.default.mod_selected),this.focusedDecoration=new p.Decoration(d.default.mod_focused),this.loadingDecoration=new p.Decoration(d.default.mod_loading),this.cutDecoration=new p.Decoration(d.default.mod_cut),this._selectedFiles=[],this.disposableCollection=new b.DisposableCollection,this.onDidFocusedFileChangeEmitter=new b.Emitter,this.onDidSelectedFileChangeEmitter=new b.Emitter,this.clearFileSelectedDecoration=()=>{this._selectedFiles.forEach(l=>{this.selectedDecoration.removeTarget(l)}),this._selectedFiles=[],this.onDidSelectedFileChangeEmitter.fire([])},this.activeFileDecoration=(l,a=!0)=>{l!==this.treeModel.root&&(this.preContextMenuFocusedFile&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile),this.preContextMenuFocusedFile=null),l&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(u=>{this.selectedDecoration.removeTarget(u)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(l),this.focusedDecoration.addTarget(l),this._focusedFile=l,this._selectedFiles=[l],this.onDidFocusedFileChangeEmitter.fire(l.uri),this.onDidSelectedFileChangeEmitter.fire([l.uri]),a&&this.treeModel.dispatchChange()))},this.selectFileDecoration=(l,a=!0)=>{l!==this.treeModel.root&&(this.preContextMenuFocusedFile&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile),this.preContextMenuFocusedFile=null),l&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(u=>{this.selectedDecoration.removeTarget(u)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(l),this._selectedFiles=[l],this.onDidSelectedFileChangeEmitter.fire([l.uri]),a&&this.treeModel.dispatchChange()))},this.activeFileFocusedDecoration=(l,a=!1)=>{l!==this.treeModel.root&&(this.focusedFile!==l&&(a?(this.preContextMenuFocusedFile?(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile)):this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.preContextMenuFocusedFile=l):this.focusedFile&&(this.preContextMenuFocusedFile=null,this.focusedDecoration.removeTarget(this.focusedFile)),l&&(this.selectedDecoration.addTarget(l),this.focusedDecoration.addTarget(l),this._focusedFile=l,this._selectedFiles.push(l),this.onDidFocusedFileChangeEmitter.fire(l.uri),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(u=>u.uri)))),this.treeModel.dispatchChange())},this.activeFileSelectedDecoration=l=>{this._selectedFiles.indexOf(l)>-1||(this._selectedFiles.push(l),this.selectedDecoration.addTarget(l),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(a=>a.uri)),this.treeModel.dispatchChange())},this.activeFileDecorationByRange=(l,a)=>{for(this.clearFileSelectedDecoration(),this.preContextMenuFocusedFile=null;l<=a;l++){const u=this.treeModel.root.getTreeNodeAtIndex(l);u&&(this._selectedFiles.push(u),this.selectedDecoration.addTarget(u))}this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(u=>u.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 l=>{l.expanded?this.fileTreeHandle.collapseNode(l):this.fileTreeHandle.expandNode(l)},this.handleTreeBlur=()=>{this.enactiveFileDecoration()},this.handleTreeFocus=()=>{},this.handleItemRangeClick=(l,a)=>{if(!this.focusedFile)this.handleItemClick(l,a);else if(this.focusedFile&&this.focusedFile!==l){const u=this.treeModel.root.getIndexAtTreeNode(l),m=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);m>u?this.activeFileDecorationByRange(u,m):m<u&&this.activeFileDecorationByRange(m,u)}},this.handleItemToggleClick=(l,a)=>{a!==p.TreeNodeType.CompositeTreeNode&&a!==p.TreeNodeType.TreeNode||(this.selectedFiles.indexOf(l)>-1?this.focusedFile===l?this.enactiveFileDecoration():this.activeFileFocusedDecoration(l):this.activeFileSelectedDecoration(l))},this.handleItemClick=(l,a)=>{this.clickTimes++,(a===p.TreeNodeType.CompositeTreeNode||a===p.TreeNodeType.TreeNode)&&this.activeFileDecoration(l),a===p.TreeNodeType.CompositeTreeNode&&this.corePreferences["workbench.list.openMode"]==="singleClick"&&this.toggleDirectory(l),this.clickTimer&&clearTimeout(this.clickTimer),this.clickTimer=setTimeout(()=>{this.clickTimes>1&&a!==p.TreeNodeType.TreeNode&&this.corePreferences["workbench.list.openMode"]==="doubleClick"&&this.toggleDirectory(l),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 l=(await this.fileTreeDialogService.resolveChildren())[0];this._treeModel=this.injector.get(E.FileTreeModel,[l]),this.initDecorations(l),this.disposableCollection.push(this._decorations),this.disposableCollection.push(this.labelService.onDidChange(()=>{this.treeModel.dispatchChange()})),this.disposableCollection.push(this.treeModel.root.watcher.on(p.TreeNodeEvent.WillResolveChildren,a=>{this.loadingDecoration.addTarget(a)})),this.disposableCollection.push(this.treeModel.root.watcher.on(p.TreeNodeEvent.DidResolveChildren,a=>{this.loadingDecoration.removeTarget(a)}))}async updateTreeModel(l){const a=await this.fileTreeDialogService.resolveRoot(l);if(a&&a.length>0){const u=a[0];this._treeModel=this.injector.get(E.FileTreeModel,[u]),this.clearFileSelectedDecoration(),this.initDecorations(u)}}initDecorations(l){this._decorations&&this._decorations.dispose(),this._decorations=new p.DecorationsManager(l),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.cutDecoration),this._decorations.addDecoration(this.loadingDecoration)}handleTreeHandler(l){this._fileTreeHandle=l}dispose(){this.disposableCollection.dispose()}};e.FileTreeDialogModel=c,c.FILE_TREE_SNAPSHOT_KEY="FILE_TREE_SNAPSHOT",c.DEFAULT_LOCATION_FLUSH_DELAY=500,s.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),s.__metadata("design:type",o.Injector)],c.prototype,"injector",void 0),s.__decorate([(0,o.Autowired)(_.IFileDialogTreeService),s.__metadata("design:type",h.FileTreeDialogService)],c.prototype,"fileTreeDialogService",void 0),s.__decorate([(0,o.Autowired)(g.LabelService),s.__metadata("design:type",g.LabelService)],c.prototype,"labelService",void 0),s.__decorate([(0,o.Autowired)(b.CorePreferences),s.__metadata("design:type",Object)],c.prototype,"corePreferences",void 0),e.FileTreeDialogModel=c=n=s.__decorate([(0,o.Injectable)(),s.__metadata("design:paramtypes",[])],c)},69748:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FILE_TREE_BADGE_LIMIT=e.FILE_TREE_NODE_HEIGHT=e.FileTreeDialogNode=void 0;const n=t(85608),s=n.__importDefault(t(53373)),o=n.__importDefault(t(14041)),p=t(97267),b=t(41869),g=t(69959),_=n.__importDefault(t(89200)),E=({item:d,onClick:h,itemType:c,labelService:r,leftPadding:l=8,onTwistierClick:a,decorations:u,defaultLeftPadding:m=8,template:f})=>{const v=c===p.TreeNodeType.RenamePrompt,y=c===p.TreeNodeType.NewPrompt,S=v||y,A=(0,b.useDesignStyles)(_.default.expansion_toggle,"expansion_toggle"),T=(0,b.useDesignStyles)(_.default.file_tree_node,"file_tree_node"),D=W=>{(c===p.TreeNodeType.TreeNode||c===p.TreeNodeType.CompositeTreeNode)&&h(W,d,c)},w=W=>{(c===p.TreeNodeType.TreeNode||c===p.TreeNodeType.CompositeTreeNode)&&(a?a(W,d,c):h(W,d,c))},I=c===p.TreeNodeType.CompositeTreeNode;let R;S?y?R=`${m+(d.parent.depth+1||0)*(l||0)}px`:R=`${m+(d.target.depth||0)*(l||0)}px`:R=I?`${m+(d.depth||0)*(l||0)}px`:`${m+(d.depth||0)*(l||0)+8}px`;const M={height:e.FILE_TREE_NODE_HEIGHT,lineHeight:`${e.FILE_TREE_NODE_HEIGHT}px`,paddingLeft:R},O=(W,V)=>{if(u&&u?.classlist.indexOf(_.default.mod_loading)>-1)return o.default.createElement(p.Loading,null);if(S&&W instanceof p.PromptHandle){let H=!1;if(v?H=W.target.type===p.TreeNodeType.CompositeTreeNode:H=W.type===p.TreeNodeType.CompositeTreeNode,H)return o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_segment,A,(0,b.getIcon)("arrow-right"),{[`${_.default.mod_collapsed}`]:y||!(v&&W.target.type===p.TreeNodeType.CompositeTreeNode&&W.target.expanded)})})}else return o.default.createElement("div",{onClick:V,className:(0,s.default)(_.default.file_tree_node_segment,A,(0,b.getIcon)("arrow-right"),{[`${_.default.mod_collapsed}`]:!W.expanded})})},P=W=>{let V,H;S&&W instanceof p.PromptHandle?W instanceof p.RenamePromptHandle?(V=W.target.uri.resolve(W.$.value),H=g.Directory.is(W.target)):(V=W.parent.uri.resolve(W.$.value),H=W.type===p.TreeNodeType.CompositeTreeNode):(V=W.uri,H=W.filestat.isDirectory);const K=r.getIcon(V,{isDirectory:H});return o.default.createElement("div",{className:(0,s.default)(_.default.file_icon,K,{expanded:H&&W.expanded}),style:{height:e.FILE_TREE_NODE_HEIGHT,lineHeight:`${e.FILE_TREE_NODE_HEIGHT}px`}})},L=W=>f?o.default.createElement(f,null):S&&W instanceof p.PromptHandle?o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_segment,_.default.file_tree_node_inputbox)},o.default.createElement("div",{className:(0,s.default)("input-box",_.default.file_tree_node_prompt_box)},o.default.createElement(W.ProxiedInput,{wrapperStyle:{height:e.FILE_TREE_NODE_HEIGHT,padding:"0 5px"}}))):o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_segment,_.default.file_tree_node_displayname)},W.name),N=()=>o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_segment,_.default.file_tree_node_tail)},k()),k=()=>null,B=W=>{if(I)return O(W,w);if(S)return O(W,()=>{})},F=()=>d.tooltip||d.name;return o.default.createElement("div",{key:d.id,onClick:D,title:F(),className:(0,s.default)(T,u?u.classlist:null),style:M,draggable:c===p.TreeNodeType.TreeNode||c===p.TreeNodeType.CompositeTreeNode},o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_content)},B(d),P(d),o.default.createElement("div",{className:S?_.default.file_tree_node_prompt_wrap:_.default.file_tree_node_overflow_wrap},L(d)),N()))};e.FileTreeDialogNode=E,e.FILE_TREE_NODE_HEIGHT=22,e.FILE_TREE_BADGE_LIMIT=99},9018:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeDialogService=void 0;const n=t(85608),s=t(76003),o=t(97267),p=t(41869),b=t(26542),g=t(51500),_=t(6250);let E=class extends o.Tree{constructor(h){super(),this._whenReady=this.resolveWorkspaceRoot(h)}get whenReady(){return this._whenReady}async resolveWorkspaceRoot(h){if(h){const c=new p.URI(h).withScheme(p.Schemes.file),r=await this.fileTreeAPI.resolveFileStat(c);r&&(this.workspaceRoot=r)}}async resolveChildren(h){if(h){if(h.uri){const{children:c}=await this.fileTreeAPI.resolveChildren(this,h.uri.toString(),h);return c}}else{this.workspaceRoot||(this.workspaceRoot=(await this.workspaceService.roots)[0]);const{children:c}=await this.fileTreeAPI.resolveChildren(this,this.workspaceRoot);return this.root=c[0],c}return[]}async resolveRoot(h){let c;/^file:\/\//.test(h)&&(c=new p.URI(h)),c=p.URI.file(h);const r=await this.fileTreeAPI.resolveFileStat(c);if(r){const{children:l}=await this.fileTreeAPI.resolveChildren(this,r);return this.root=l[0],l}}getDirectoryList(){const h=[];if(!this.root)return h;let c=new p.URI(this.workspaceRoot.uri);if(c&&c.parent)for(;c.parent;){const r=c.codeUri.fsPath;if(h.indexOf(r)>=0)break;h.push(r),c=c.parent}else h.push(c.codeUri.fsPath.toString());return h}sortComparator(h,c){return h.constructor===c.constructor?h.name.startsWith(".")&&!c.name.startsWith(".")?1:!h.name.startsWith(".")&&c.name.startsWith(".")?-1:h.name.localeCompare(c.name,"kn",{numeric:!0}):h.type===o.TreeNodeType.CompositeTreeNode?-1:c.type===o.TreeNodeType.CompositeTreeNode?1:0}dispose(){super.dispose()}};e.FileTreeDialogService=E,n.__decorate([(0,s.Autowired)(_.IFileTreeAPI),n.__metadata("design:type",Object)],E.prototype,"fileTreeAPI",void 0),n.__decorate([(0,s.Autowired)(g.IWorkspaceService),n.__metadata("design:type",Object)],E.prototype,"workspaceService",void 0),n.__decorate([(0,s.Autowired)(b.LabelService),n.__metadata("design:type",b.LabelService)],E.prototype,"labelService",void 0),e.FileTreeDialogService=E=n.__decorate([(0,s.Injectable)({multiple:!0}),n.__param(0,(0,s.Optional)()),n.__metadata("design:paramtypes",[String])],E)},51888:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileDialog=e.FILE_TREE_DIALOG_HEIGHT=void 0;const n=t(85608),s=n.__importStar(t(14041)),o=t(97267),p=t(41869),b=t(68974),g=t(72665),_=t(69748),E=n.__importDefault(t(13294));e.FILE_TREE_DIALOG_HEIGHT=22;const d=({options:h,model:c,isOpenDialog:r})=>{const l=(0,p.useInjectable)(g.IDialogService),a=(0,s.useRef)(null),[u,m]=(0,s.useState)(""),[f,v]=(0,s.useState)(!1),[y,S]=(0,s.useState)(""),[A,T]=(0,s.useState)([]);(0,s.useEffect)(()=>(c&&(v(!1),I()),()=>{c.dispose()}),[c]),(0,s.useEffect)(()=>{h.defaultFileName&&m(h.defaultFileName)},[h]),(0,s.useEffect)(()=>{if(f){const V=c.getDirectoryList();T(V)}},[f]);const D=(0,s.useCallback)(()=>{const V=c.selectedFiles.map(H=>H.uri.path.toString());if(u&&h.showNameInput&&(V?.length===1||h.defaultUri)){const H=V?.length===1?V[0]:h.defaultUri.path.toString();l.hide([p.path.join(H,u)])}else V.length>0?l.hide(V):h.defaultUri?l.hide([h.defaultUri.path.toString()]):c.treeModel&&c.treeModel.root?l.hide([c.treeModel.root.uri.path.toString()]):l.hide([]);v(!1)},[f,l,c,u,h]),w=(0,s.useCallback)(()=>{v(!1),l.hide()},[f,l]),I=(0,s.useCallback)(async()=>{await c.whenReady,await c.treeModel.ensureReady,S(c.treeModel.root.uri.codeUri.fsPath),v(!0)},[c,y,f]),R=!r,M=(0,s.useCallback)(V=>{c.handleTreeHandler({...V,getModel:()=>c.treeModel,hasDirectFocus:()=>a.current===document.activeElement})},[c]),O=(0,s.useCallback)((V,H)=>{V.stopPropagation();const{toggleDirectory:K}=c;K(H)},[c]),P=(0,s.useCallback)(V=>L(V)?!1:V.shiftKey,[]),L=(0,s.useCallback)(V=>{const{metaKey:H,ctrlKey:K}=V;return p.isMacintosh&&H||K},[]),N=(0,s.useCallback)((V,H,K)=>{var z;V.stopPropagation();const{handleItemClick:G,handleItemToggleClick:j,handleItemRangeClick:U}=c;if(!H)return;const $=P(event),Y=L(event);if($&&!R&&h.canSelectMany)U(H,K);else if(Y&&!R&&h.canSelectMany)j(H,K);else if(R)K===o.TreeNodeType.CompositeTreeNode&&G(H,K);else if(h.canSelectFiles&&K===o.TreeNodeType.TreeNode){const Q=new Set(Object.values((z=h.filters)!==null&&z!==void 0?z:{}).flat().map(ee=>`.${ee}`));if(Q.size>0){const ee=p.URI.parse(H.filestat.uri).path.ext;Q.has(ee)&&G(H,K)}else G(H,K)}else h.canSelectFolders&&K===o.TreeNodeType.CompositeTreeNode&&G(H,K)},[c,R,h]),k=(0,s.useCallback)(async V=>{v(!1),S(V),await c.updateTreeModel(V),v(!0)},[c,f,y]),B=(0,s.useCallback)(V=>s.default.createElement(_.FileTreeDialogNode,{item:V.item,itemType:V.itemType,labelService:c.labelService,decorations:c.decorations.getDecorations(V.item),onClick:N,onTwistierClick:O,defaultLeftPadding:8,leftPadding:8}),[c.treeModel]),F=(0,s.useCallback)(()=>{if(f){if(c.treeModel)return s.default.createElement(o.RecycleTree,{height:300,itemHeight:e.FILE_TREE_DIALOG_HEIGHT,onReady:M,model:c.treeModel},B)}else return s.default.createElement(b.Progress,{loading:!0})},[f,c]),W=(0,s.useCallback)(()=>{if(A.length>0)return s.default.createElement(o.Select,{onChange:k,className:E.default.select_control,size:"small",value:y},A.map((V,H)=>s.default.createElement(o.Option,{value:V,key:`${H} - ${V}`},V)))},[A,y]);return r?s.default.createElement("div",{className:E.default.file_dialog_wrapper},s.default.createElement("div",{className:E.default.file_dialog_directory_title},h.title||(0,p.localize)("dialog.file.openLabel")),s.default.createElement("div",{className:E.default.file_dialog_directory},W()),s.default.createElement("div",{className:E.default.file_dialog_content,ref:a},F()),s.default.createElement("div",{className:E.default.file_dialog_buttons},s.default.createElement(o.Button,{onClick:()=>w(),type:"secondary",className:E.default.button},(0,p.localize)("dialog.file.close")),s.default.createElement(o.Button,{onClick:()=>D(),type:"primary",className:E.default.button},h.openLabel||(0,p.localize)("dialog.file.ok")))):s.default.createElement("div",{className:E.default.file_dialog_wrapper},s.default.createElement("div",{className:E.default.file_dialog_directory_title},h.saveLabel||(0,p.localize)("dialog.file.saveLabel")),s.default.createElement("div",{className:E.default.file_dialog_directory},W()),s.default.createElement("div",{className:E.default.file_dialog_content},F()),h.showNameInput&&s.default.createElement("div",{className:E.default.file_dialog_file_container},s.default.createElement("span",{className:E.default.file_dialog_file_name},(0,p.localize)("dialog.file.name"),": "),s.default.createElement(o.Input,{size:"small",value:u,autoFocus:!0,selection:{start:0,end:u.indexOf(".")||u.length},onChange:V=>m(V.target.value)})),s.default.createElement("div",{className:E.default.file_dialog_buttons},s.default.createElement(o.Button,{onClick:()=>w(),type:"secondary",className:E.default.button},(0,p.localize)("dialog.file.close")),s.default.createElement(o.Button,{onClick:()=>D(),type:"primary",className:E.default.button,disabled:!!(h.showNameInput&&u.length===0)},(0,p.localize)("dialog.file.ok"))))};e.FileDialog=d},89508:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WindowDialogServiceImpl=void 0;const n=t(85608),s=n.__importDefault(t(14041)),o=t(76003),p=t(41869),b=t(37406),g=t(14951),_=t(72665),E=t(57942),d=n.__importDefault(t(13294)),h=t(9018),c=t(51888);let r=class{constructor(){this._whenReady=this.init()}async init(){this.recentGlobalStorage=await this.storageProvider(p.STORAGE_NAMESPACE.GLOBAL_RECENT_DATA);const a=await this.recentGlobalStorage.get("RECENT_DIALOG_DEFAULT_URI");if(a)this._defaultUri=new p.URI(a);else{const u=await this.fileServiceClient.getCurrentUserHome();this._defaultUri=new p.URI(u.uri)}}get defaultUri(){return this._defaultUri}get whenReady(){return this._whenReady}async updateRecentDefaultUri(a){this.recentGlobalStorage.set("RECENT_DIALOG_DEFAULT_URI",a.toString()),this._defaultUri=a}async showOpenDialog(a={}){await this.whenReady;const u={canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1};if(this.appConfig.isElectronRenderer&&!this.appConfig.isRemote){const m=this.injector.get(b.IElectronMainUIService),f=[];a.canSelectFiles&&f.push("openFile"),a.canSelectFolders&&f.push("openDirectory"),a.canSelectMany&&f.push("multiSelections"),p.isMacintosh&&f.push("treatPackageAsDirectory","createDirectory");const v=a.defaultUri||this.defaultUri,y=await m.showOpenDialog(p.electronEnv.currentWindowId,{defaultPath:v.codeUri.fsPath,title:a.title,buttonLabel:a.openLabel,properties:f});if(y&&y.length>0){const S=y.map(A=>p.URI.file(A));return this.updateRecentDefaultUri(S[0].parent),S}else return}else{a.defaultUri||(a.defaultUri=this.defaultUri);let m;a.defaultUri?m=this.injector.get(h.FileTreeDialogService,[a.defaultUri.toString()]):m=this.injector.get(h.FileTreeDialogService),await m.whenReady;const f=E.FileTreeDialogModel.createModel(this.injector,m),v=await this.dialogService.open({message:s.default.createElement(c.FileDialog,{model:f,options:{...u,...a},isOpenDialog:!0}),type:p.MessageType.Empty,buttons:[],closable:!0,props:{className:d.default.file_dialog_wrapper}});if(this.dialogService.reset(),v&&v.length>0){const y=v.map(S=>p.URI.file(S));return this.updateRecentDefaultUri(y[0].parent),y}else return}}async showSaveDialog(a={}){if(await this.whenReady,this.appConfig.isElectronRenderer&&!this.appConfig.isRemote){const u=a.defaultUri||this.defaultUri,f=await this.injector.get(b.IElectronMainUIService).showSaveDialog(p.electronEnv.currentWindowId,{defaultPath:u.resolve(a.defaultFileName||"").codeUri.fsPath,title:a.saveLabel,message:a.saveLabel});if(f){const v=p.URI.file(f);return this.updateRecentDefaultUri(v.parent),v}else return}else{a.defaultUri||(a.defaultUri=this.defaultUri);let u;a.defaultUri?u=this.injector.get(h.FileTreeDialogService,[a.defaultUri.toString()]):u=this.injector.get(h.FileTreeDialogService),await u.whenReady;const m=E.FileTreeDialogModel.createModel(this.injector,u),f=await this.dialogService.open({message:s.default.createElement(c.FileDialog,{model:m,options:a,isOpenDialog:!1}),type:p.MessageType.Empty,buttons:[],closable:!0,props:{className:d.default.file_dialog_wrapper}});if(this.dialogService.reset(),f&&f.length>0){const v=p.URI.file(f[0]);return this.updateRecentDefaultUri(v.parent),v}else return}}};e.WindowDialogServiceImpl=r,n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],r.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(_.IDialogService),n.__metadata("design:type",Object)],r.prototype,"dialogService",void 0),n.__decorate([(0,o.Autowired)(g.IFileServiceClient),n.__metadata("design:type",Object)],r.prototype,"fileServiceClient",void 0),n.__decorate([(0,o.Autowired)(p.StorageProvider),n.__metadata("design:type",Function)],r.prototype,"storageProvider",void 0),n.__decorate([(0,o.Autowired)(p.AppConfig),n.__metadata("design:type",Object)],r.prototype,"appConfig",void 0),e.WindowDialogServiceImpl=r=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],r)},88014:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileContextKey=void 0;const n=t(85608),s=t(76003),o=t(41869),p=t(16413);let b=class{constructor(){this.explorerResourceIsFolder=p.ExplorerResourceIsFolderContext.bind(this.globalContextKeyService),this.explorerViewletVisibleContext=p.ExplorerViewletVisibleContext.bind(this.globalContextKeyService)}initScopedContext(_){this._contextKeyService=this.globalContextKeyService.createScoped(_),this.explorerFocused=p.ExplorerFocusedContext.bind(this._contextKeyService),this.explorerResourceCut=p.ExplorerResourceCut.bind(this._contextKeyService),this.filesExplorerFocused=p.FilesExplorerFocusedContext.bind(this._contextKeyService),this.filesExplorerInputFocused=p.FilesExplorerInputFocusedContext.bind(this._contextKeyService),this.filesExplorerFilteredContext=p.FilesExplorerFilteredContext.bind(this._contextKeyService),this.explorerCompressedFocusContext=p.ExplorerCompressedFocusContext.bind(this._contextKeyService),this.explorerCompressedFirstFocusContext=p.ExplorerCompressedFirstFocusContext.bind(this._contextKeyService),this.explorerCompressedLastFocusContext=p.ExplorerCompressedLastFocusContext.bind(this._contextKeyService)}get service(){return this._contextKeyService}};e.FileContextKey=b,n.__decorate([(0,s.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],b.prototype,"globalContextKeyService",void 0),e.FileContextKey=b=n.__decorate([(0,s.Injectable)(),n.__metadata("design:paramtypes",[])],b)},40439:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeContribution=void 0;const n=t(85608),s=t(76003),o=t(41869),p=t(16413),b=t(93899),g=t(68969),_=t(98295),E=t(41893),d=t(54414),h=t(32595),c=t(63067),r=t(58296),l=t(72665),a=t(51500),u=t(6250),m=t(69959),f=t(56384),v=t(57781),y=t(97738),S=t(4446);let A=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(h.EXPLORER_CONTAINER_ID)}async onStart(){this.viewsRegistry.registerViewWelcomeContent(u.RESOURCE_VIEW_ID,{content:(0,o.formatLocalize)("welcome-view.noFolderHelp",o.FILE_COMMANDS.OPEN_FOLDER.id),group:r.ViewContentGroups.Open,order:1}),this.mainLayoutService.collectViewComponent({id:u.RESOURCE_VIEW_ID,name:this.getWorkspaceTitle(),weight:3,priority:9,collapsed:!1,component:f.FileTree},h.EXPLORER_CONTAINER_ID),this._disposables.add(this.workspaceService.onWorkspaceLocationChanged(()=>{const D=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);D&&D.updateViewTitle(u.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(h.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 w=this.workspaceService.workspace;return w&&(D=new o.URI(w.uri).displayName,!w.isDirectory&&D.endsWith(`.${this.workspaceService.workspaceSuffixName}`)&&(D=D.slice(0,D.lastIndexOf(".")),D===a.UNTITLED_WORKSPACE))?(0,o.localize)("file.workspace.defaultTip"):D}onReconnect(){this.fileTreeService.reWatch()}revealFile(D){if(D)if(this.isRendered){const w=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);!w||!w.isVisible||w.isCollapsed(u.RESOURCE_VIEW_ID)?this.fileTreeModelService.locationOnShow(D):this.fileTreeModelService.location(D)}else this.fileTreeModelService.locationOnShow(D)}registerMenus(D){D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.NEW_FILE.id,label:(0,o.localize)("file.new")},order:1,group:"0_new"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.NEW_FOLDER.id,label:(0,o.localize)("file.folder.new")},order:2,group:"0_new"}),D.registerMenuItem(b.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(b.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(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_RESOURCES.id,label:(0,o.localize)("file.open")},order:1,group:"1_open"}),D.registerMenuItem(b.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(b.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(b.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(b.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(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.DELETE_FILE.id,label:(0,o.localize)("file.delete")},order:1,group:"7_modification"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.RENAME_FILE.id,label:(0,o.localize)("file.rename")},order:3,group:"7_modification"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COMPARE_SELECTED.id,label:(0,o.localize)("file.compare")},order:2,group:"3_compare"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_FILE.id,label:(0,o.localize)("file.copy.file")},order:1,group:"5_cutcopypaste"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.CUT_FILE.id,label:(0,o.localize)("file.cut.file")},order:2,group:"5_cutcopypaste"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.PASTE_FILE.id,label:(0,o.localize)("file.paste.file")},order:3,group:"5_cutcopypaste"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_PATH.id,label:(0,o.localize)("file.copy.path")},group:"6_copypath"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_RELATIVE_PATH.id,label:(0,o.localize)("file.copy.relativepath")},group:"6_copypath"})}registerCommands(D){const w=()=>{this.fileTreeService.filterMode&&this.fileTreeService.toggleFilterMode()};D.registerCommand(o.FILE_COMMANDS.OPEN_TERMINAL_WITH_PATH,{execute:R=>{let M=R;if(!M)return;const O=this.fileTreeService.getNodeByPathOrUri(M);O&&!O.filestat.isDirectory&&(M=O.uri.parent),this.commandService.executeCommand(o.TERMINAL_COMMANDS.OPEN_WITH_PATH.id,M)}}),D.registerCommand(o.FILE_COMMANDS.SEARCH_ON_FOLDER,{execute:async R=>{var M;let O=R;if(O||(this.fileTreeModelService.focusedFile?O=this.fileTreeModelService.focusedFile.uri:this.fileTreeModelService.selectedFiles.length>0&&(O=(M=this.fileTreeModelService.selectedFiles[0])===null||M===void 0?void 0:M.uri)),!O)return;let P;if(this.fileTreeService.isMultipleWorkspace)for(const L of await this.workspaceService.roots){const N=new o.URI(L.uri);if(N.isEqualOrParent(O)){P=`./${N.relative(O).toString()}`;break}}else if(this.workspaceService.workspace){const L=new o.URI(this.workspaceService.workspace.uri);L.isEqualOrParent(O)&&(P=`./${L.relative(O).toString()}`)}this.commandService.executeCommand(o.SEARCH_COMMANDS.OPEN_SEARCH.id,{includeValue:P+"/"})},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&m.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.LOCATION,{execute:R=>{R?this.revealFile(R):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 R,M,O;((M=(R=this.workbenchEditorService.currentEditor)===null||R===void 0?void 0:R.currentUri)===null||M===void 0?void 0:M.scheme)===o.Schemes.file&&this.revealFile((O=this.workbenchEditorService.currentEditor)===null||O===void 0?void 0:O.currentUri)}}),D.registerCommand(o.FILE_COMMANDS.COLLAPSE_ALL,{execute:()=>{const R=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);!R||!R.isVisible||this.fileTreeModelService.collapseAll()}}),D.registerCommand(o.FILE_COMMANDS.REFRESH_ALL,{execute:async()=>{const R=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);!R||!R.isVisible||await this.fileTreeService.refresh()}}),D.registerCommand(o.FILE_COMMANDS.DELETE_FILE,{execute:(R,M)=>{if(w(),M?this.willDeleteUris=this.willDeleteUris.concat(M):this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0?this.willDeleteUris=this.willDeleteUris.concat(this.fileTreeModelService.selectedFiles.map(O=>O.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:R=>{if(w(),!R)if(this.fileTreeModelService.contextMenuFile)R=this.fileTreeModelService.contextMenuFile.uri;else if(this.fileTreeModelService.focusedFile)R=this.fileTreeModelService.focusedFile.uri;else return;this.fileTreeModelService.renamePrompt(R)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.NEW_FILE,{execute:async R=>{var M;if(w(),R)this.fileTreeModelService.newFilePrompt(R);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 O;this.fileTreeService.isMultipleWorkspace?O=new o.URI((await this.workspaceService.roots)[0].uri):O=new o.URI((M=this.workspaceService.workspace)===null||M===void 0?void 0:M.uri),this.fileTreeModelService.newFilePrompt(O)}}}),D.registerCommand(o.FILE_COMMANDS.NEW_FOLDER,{execute:async R=>{var M;if(w(),R)this.fileTreeModelService.newDirectoryPrompt(R);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 O;this.fileTreeService.isMultipleWorkspace?O=new o.URI((await this.workspaceService.roots)[0].uri):O=new o.URI((M=this.workspaceService.workspace)===null||M===void 0?void 0:M.uri),this.fileTreeModelService.newDirectoryPrompt(O)}}}),D.registerCommand(o.FILE_COMMANDS.COMPARE_SELECTED,{execute:(R,M)=>{if(M&&M.length){const O=this.workbenchEditorService.currentEditor;O&&O.currentUri&&this.fileTreeService.compare(M[0],O.currentUri)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!m.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.OPEN_RESOURCES,{execute:R=>{this.fileTreeService.openAndFixedFile(R)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!m.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.OPEN_TO_THE_SIDE,{execute:R=>{this.fileTreeService.openToTheSide(R)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!m.Directory.is(this.fileTreeModelService.contextMenuFile)});const I=(R,M)=>{const{availableOpenTypes:O,currentOpenType:P}=this.workbenchEditorService.currentEditorGroup;if(!(O&&R&&P))return{items:[],selectIndex:-1};const L=this.preferenceService.get("workbench.editorAssociations"),N=[],k=(V,H)=>H.type===d.EditorOpenType.code?V.type===d.EditorOpenType.code:H.type===d.EditorOpenType.component&&V.type===d.EditorOpenType.component?V.componentId===H.componentId:!1,B=(V,H)=>(V?V+=(0,o.localize)("file.open.type.detail.and")+H:V=H,V);let F,W;if(L){const V=Object.keys(L).find(H=>(0,o.match)(H,R.path.toString().toLowerCase())||(0,o.match)(H,R.path.base.toLowerCase()));F=V&&L[V]}return O.forEach((V,H)=>{var K;const z={label:V.title||V.componentId||V.type,detail:V.title,run:G=>M(G,V)};k(P,V)&&(z.description=B(z.description,(0,o.localize)("file.open.type.detail.active")),W=H),F&&(!((K=V.componentId)===null||K===void 0)&&K.endsWith(F))&&(z.description=B(z.description,(0,o.localize)("file.open.type.detail.default"))),N.push(new o.QuickOpenItem(z))}),{items:N,selectIndex:W}};D.registerCommand(o.FILE_COMMANDS.OPEN_TYPE_WITH,{execute:R=>{const M=(N,k)=>{var B,F;return N===o.Mode.OPEN?((B=this.workbenchEditorService.currentEditorGroup)===null||B===void 0||B.changeOpenType((F=k.componentId)!==null&&F!==void 0?F:k.type),!0):!1},{items:O,selectIndex:P}=I(R,M);if(O.length===0||typeof P>"u")return;const L=N=>{this.quickOpenService.open({onType:(k,B)=>B(N)},{fuzzyMatchLabel:!0,ignoreFocusOut:!1,placeholder:(0,o.formatLocalize)("file.open.type.placeholder",R.path.base),selectIndex:()=>P})};O.push(new o.QuickOpenItem({label:(0,o.formatLocalize)("file.open.type.preference.default",`*${R.path.ext}`),showBorder:!0,run:N=>{if(N===o.Mode.OPEN){const k=(W,V)=>{var H,K,z;if(W===o.Mode.OPEN){const G="workbench.editorAssociations",j=this.preferenceService.resolve(G).scope,U=this.preferenceService.get(G);return this.preferenceService.set(G,{...U||{},[`*${R.path.ext}`]:(H=V.componentId)!==null&&H!==void 0?H:V.type},j),(K=this.workbenchEditorService.currentEditorGroup)===null||K===void 0||K.changeOpenType((z=V.componentId)!==null&&z!==void 0?z:V.type),!0}return!1},{items:B,selectIndex:F}=I(R,k);if(B.length===0||typeof F>"u")return!0;L(B)}return!1}})),L(O)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!m.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.COPY_PATH,{execute:async R=>{if(!R)return;let O=R.path.toString();if(R.scheme===d.DIFF_SCHEME){const L=R.getParsedQuery();O=new o.URI(L.modified).path.toString()}let P=decodeURIComponent(O);await this.appService.backendOS===o.OperatingSystem.Windows&&(P=P.slice(1)),await this.clipboardService.writeText(P)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile}),D.registerCommand(o.FILE_COMMANDS.COPY_RELATIVE_PATH,{execute:async R=>{if(!R)return;if(R.scheme===d.DIFF_SCHEME){const O=R.getParsedQuery();R=new o.URI(O.modified).withScheme("file")}let M;if(this.fileTreeService.isMultipleWorkspace)for(const O of await this.workspaceService.roots){if(M=new o.URI(O.uri),M.isEqual(R))return await this.clipboardService.writeText("./");if(M.isEqualOrParent(R))return await this.clipboardService.writeText(decodeURIComponent(M.relative(R).toString()))}else if(this.workspaceService.workspace)return M=new o.URI(this.workspaceService.workspace.uri),M.isEqual(R)?await this.clipboardService.writeText("./"):await this.clipboardService.writeText(decodeURIComponent(M.relative(R).toString()))},isVisible:()=>!!this.fileTreeModelService.contextMenuFile}),D.registerCommand(o.FILE_COMMANDS.COPY_FILE,{execute:(R,M)=>{if(M&&M.length)this.fileTreeModelService.copyFile(M);else{const O=this.fileTreeModelService.selectedFiles.map(P=>P.uri);O&&O.length&&this.fileTreeModelService.copyFile(O)}},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:(R,M)=>{if(M&&M.length)this.fileTreeModelService.selectChildNode(M);else{const O=this.fileTreeModelService.selectedFiles.map(P=>P.uri);O&&O.length&&this.fileTreeModelService.selectChildNode(O)}},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:(R,M)=>{if(M&&M.length)this.fileTreeModelService.cutFile(M);else{const O=this.fileTreeModelService.selectedFiles.map(P=>P.uri);O&&O.length&&this.fileTreeModelService.cutFile(O)}},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:R=>{if(w(),R)this.fileTreeModelService.pasteFile(R);else if(this.fileTreeModelService.focusedFile){let M;this.fileTreeModelService.activeUri?M=this.fileTreeModelService.activeUri:M=this.fileTreeModelService.focusedFile.uri,this.fileTreeModelService.pasteFile(M)}},isEnabled:()=>this.fileTreeModelService.pasteStore&&this.fileTreeModelService.pasteStore.type!==u.PasteTypes.NONE||this.appConfig.isElectronRenderer}),D.registerCommand(o.FILE_COMMANDS.VSCODE_OPEN_FOLDER,{execute:(R,M)=>{const O=this.injector.get(o.IWindowService),P={newWindow:!0};return typeof M=="boolean"?P.newWindow=M:P.newWindow=typeof M?.forceNewWindow=="boolean"?M.forceNewWindow:!0,R?O.openWorkspace(R,P):this.commandService.executeCommand(o.FILE_COMMANDS.OPEN_FOLDER.id,P)},isVisible:()=>{const R=this.preferenceService.get("application.supportsOpenFolder");return R??!1}}),D.registerCommand(o.FILE_COMMANDS.OPEN_FOLDER,{execute:R=>{const M=this.injector.get(o.IWindowService);this.appConfig.isElectronRenderer?this.injector.get(o.IElectronNativeDialogService).showOpenDialog({title:(0,o.localize)("workspace.openDirectory"),properties:["openDirectory"]}).then(P=>{P&&P.length>0&&M.openWorkspace(o.URI.file(P[0]),R||{newWindow:!0})}):this.injector.get(l.IWindowDialogService).showOpenDialog({title:(0,o.localize)("workspace.openDirectory"),canSelectFiles:!1,canSelectFolders:!0}).then(P=>{var L;P&&P.length>0&&this.injector.get(a.IWorkspaceService).open(P[0],{preserveWindow:(L=R?.newWindow)!==null&&L!==void 0?L:!1})})},isVisible:()=>{const R=this.preferenceService.get("application.supportsOpenFolder");return R??!1}}),D.registerCommand(o.FILE_COMMANDS.OPEN_WORKSPACE,{execute:R=>{if(!this.preferenceService.get("application.supportsOpenWorkspace"))return;const O=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(L=>{L&&L.length>0&&O.openWorkspace(o.URI.file(L[0]),R||{newWindow:!0})}):this.injector.get(l.IWindowDialogService).showOpenDialog({title:(0,o.localize)("workspace.openWorkspace"),canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1,filters:{workspace:[this.workspaceService.workspaceSuffixName]}}).then(L=>{var N;L&&L.length>0&&this.injector.get(a.IWorkspaceService).open(L[0],{preserveWindow:(N=R?.newWindow)!==null&&N!==void 0?N:!1})})},isVisible:()=>{const R=this.preferenceService.get("application.supportsOpenWorkspace");return R??!1}}),D.registerCommand(o.FILE_COMMANDS.REVEAL_IN_EXPLORER,{execute:R=>{var M;let O=R instanceof o.URI?R:R?.uri;const P=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);P&&!P.isVisible&&P.activate(),P&&P.isCollapsed(u.RESOURCE_VIEW_ID)&&P?.setCollapsed(u.RESOURCE_VIEW_ID,!1),!O&&(!((M=this.workbenchEditorService.currentEditor)===null||M===void 0)&&M.currentUri)&&(O=this.workbenchEditorService.currentEditor.currentUri),O&&this.revealFile(o.URI.parse(O.toString()))}}),D.registerCommand(o.FILE_COMMANDS.FOCUS_FILES,{execute:()=>{const R=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);R&&R.activate()}}),D.registerCommand(o.FILE_COMMANDS.OPEN_FILE,{execute:R=>this.windowDialogService.showOpenDialog(R)}),D.registerCommand(o.FILE_COMMANDS.SAVE_FILE,{execute:R=>this.windowDialogService.showSaveDialog(R)}),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(R,M)=>{if(w(),!M.length||!this.workspaceService.isMultiRootWorkspaceOpened)return;const O=await this.workspaceService.roots,P=M.filter(L=>O.find(N=>N.uri===L.toString()));P.length>0&&await this.workspaceService.removeRoots(P)},isVisible:()=>this.workspaceService.isMultiRootWorkspaceOpened&&!!this.fileTreeModelService.contextMenuFile&&!!this.workspaceService.tryGetRoots().find(R=>{var M;return R.uri===((M=this.fileTreeModelService.contextMenuFile)===null||M===void 0?void 0:M.uri.toString())})})}registerKeybindings(D){D.registerKeybinding({command:o.FILE_COMMANDS.COPY_FILE.id,keybinding:"ctrlcmd+c",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.PASTE_FILE.id,keybinding:"ctrlcmd+v",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.CUT_FILE.id,keybinding:"ctrlcmd+x",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.SELECT_CURRENT_NODE.id,keybinding:"ctrlcmd+a",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.RENAME_FILE.id,keybinding:"enter",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.DELETE_FILE.id,keybinding:"ctrlcmd+backspace",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.FILTER_OPEN.id,keybinding:"ctrlcmd+f",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.FILTER_CLOSE.id,keybinding:"esc",when:`${p.FilesExplorerFocusedContext.raw} && ${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.NEXT.id,keybinding:"down",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.PREV.id,keybinding:"up",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.EXPAND.id,keybinding:"right",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.COLLAPSE.id,keybinding:"left",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.TOGGLE_OR_OPEN.id,keybinding:"space",when:`${p.FilesExplorerFocusedContext.raw} && !${p.FilesExplorerInputFocusedContext.raw} && !${p.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:u.RESOURCE_VIEW_ID,when:`view == '${u.RESOURCE_VIEW_ID}' && !config.explorer.autoReveal && !${p.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:u.RESOURCE_VIEW_ID,when:`view == '${u.RESOURCE_VIEW_ID}' && !${p.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:u.RESOURCE_VIEW_ID,when:`view == '${u.RESOURCE_VIEW_ID}' && !${p.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:u.RESOURCE_VIEW_ID,toggledWhen:`${p.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:u.RESOURCE_VIEW_ID,when:`view == '${u.RESOURCE_VIEW_ID}' && !${p.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:u.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:u.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()}};e.FileTreeContribution=A,n.__decorate([(0,s.Autowired)(s.INJECTOR_TOKEN),n.__metadata("design:type",s.Injector)],A.prototype,"injector",void 0),n.__decorate([(0,s.Autowired)(u.IFileTreeService),n.__metadata("design:type",v.FileTreeService)],A.prototype,"fileTreeService",void 0),n.__decorate([(0,s.Autowired)(c.IMainLayoutService),n.__metadata("design:type",Object)],A.prototype,"mainLayoutService",void 0),n.__decorate([(0,s.Autowired)(g.IProgressService),n.__metadata("design:type",Object)],A.prototype,"progressService",void 0),n.__decorate([(0,s.Autowired)(a.IWorkspaceService),n.__metadata("design:type",Object)],A.prototype,"workspaceService",void 0),n.__decorate([(0,s.Autowired)(y.FileTreeModelService),n.__metadata("design:type",y.FileTreeModelService)],A.prototype,"fileTreeModelService",void 0),n.__decorate([(0,s.Autowired)(E.IDecorationsService),n.__metadata("design:type",E.IDecorationsService)],A.prototype,"decorationService",void 0),n.__decorate([(0,s.Autowired)(d.WorkbenchEditorService),n.__metadata("design:type",d.WorkbenchEditorService)],A.prototype,"workbenchEditorService",void 0),n.__decorate([(0,s.Autowired)(o.CommandService),n.__metadata("design:type",Object)],A.prototype,"commandService",void 0),n.__decorate([(0,s.Autowired)(l.IWindowDialogService),n.__metadata("design:type",Object)],A.prototype,"windowDialogService",void 0),n.__decorate([(0,s.Autowired)(o.IClipboardService),n.__metadata("design:type",Object)],A.prototype,"clipboardService",void 0),n.__decorate([(0,s.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],A.prototype,"preferenceService",void 0),n.__decorate([(0,s.Autowired)(o.QuickOpenService),n.__metadata("design:type",Object)],A.prototype,"quickOpenService",void 0),n.__decorate([(0,s.Autowired)(c.IViewsRegistry),n.__metadata("design:type",Object)],A.prototype,"viewsRegistry",void 0),n.__decorate([(0,s.Autowired)(o.IApplicationService),n.__metadata("design:type",Object)],A.prototype,"appService",void 0),n.__decorate([(0,s.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],A.prototype,"appConfig",void 0),e.FileTreeContribution=A=n.__decorate([(0,_.Domain)(b.MenuContribution,o.CommandContribution,o.KeybindingContribution,o.TabBarToolbarContribution,o.ClientAppContribution,c.MainLayoutContribution)],A)},2812:(x,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeModel=void 0;const s=t(85608),o=t(76003),p=t(97267),b=t(41869),g=t(69959),_=t(93239);let E=n=class extends p.TreeModel{constructor(h){super(),this.flushDispatchChangeDelayer=new b.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this.init(h)}init(h){this.root=h,this.root.watcher.on(p.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()})}};e.FileTreeModel=E,E.DEFAULT_FLUSH_DELAY=100,s.__decorate([(0,o.Autowired)(_.FileTreeDecorationService),s.__metadata("design:type",_.FileTreeDecorationService)],E.prototype,"decorationService",void 0),e.FileTreeModel=E=n=s.__decorate([(0,o.Injectable)({multiple:!0}),s.__param(0,(0,o.Optional)()),s.__metadata("design:paramtypes",[g.Directory])],E)},46377:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FILE_TREE_BADGE_LIMIT=e.FILE_TREE_NODE_HEIGHT=e.FileTreeNode=void 0;const n=t(85608),s=n.__importDefault(t(53373)),o=n.__importDefault(t(14041)),p=t(97267),b=t(41869),g=t(69959),_=n.__importDefault(t(89200)),{Path:E}=b.path,d=({item:h,onClick:c,onDoubleClick:r,onContextMenu:l,dndService:a,itemType:u,decorationService:m,labelService:f,leftPadding:v=8,onTwistierClick:y,decorations:S,defaultLeftPadding:A=8,template:T,hasFolderIcons:D,hasFileIcons:w,hidesExplorerArrows:I,hasPrompt:R,iconService:M})=>{const[O,P]=o.default.useState(-1),L=u===p.TreeNodeType.RenamePrompt,N=u===p.TreeNodeType.NewPrompt,k=L||N,B=!k&&h.name.indexOf(E.separator)>=0,F=(0,b.useDesignStyles)(_.default.expansion_toggle,"expansion_toggle"),W=(0,b.useDesignStyles)(_.default.file_tree_node,"file_tree_node"),V=k?null:m.getDecoration(h.uri,g.Directory.is(h)),H=ge=>{(u===p.TreeNodeType.TreeNode||u===p.TreeNodeType.CompositeTreeNode)&&(B&&P(h.name.split(E.separator).length-1),c(ge,h,u))},K=ge=>{(u===p.TreeNodeType.TreeNode||u===p.TreeNodeType.CompositeTreeNode)&&(B&&P(h.name.split(E.separator).length-1),r(ge,h,u))},z=ge=>{(u===p.TreeNodeType.TreeNode||u===p.TreeNodeType.CompositeTreeNode)&&(y?y(ge,h,u):c(ge,h,u))},G=o.default.useCallback(ge=>{ge.nativeEvent.which!==0&&(u===p.TreeNodeType.TreeNode||u===p.TreeNodeType.CompositeTreeNode)&&l(ge,h,u)},[l,h]),j=o.default.useCallback(ge=>{const{handleDragStart:te}=a;(u===p.TreeNodeType.TreeNode||u===p.TreeNodeType.CompositeTreeNode)&&te(ge,h)},[a,h]),U=o.default.useCallback(ge=>{const{handleDragLeave:te}=a;(u===p.TreeNodeType.TreeNode||u===p.TreeNodeType.CompositeTreeNode)&&te(ge,h)},[a,h]),$=o.default.useCallback(ge=>{const{handleDragEnter:te}=a;(u===p.TreeNodeType.TreeNode||u===p.TreeNodeType.CompositeTreeNode)&&te(ge,h)},[a,h]),Y=o.default.useCallback(ge=>{const{handleDrop:te}=a;(u===p.TreeNodeType.TreeNode||u===p.TreeNodeType.CompositeTreeNode)&&te(ge,h)},[a,h]),Q=o.default.useCallback(ge=>{const{handleDragOver:te}=a;(u===p.TreeNodeType.TreeNode||u===p.TreeNodeType.CompositeTreeNode)&&te(ge,h)},[a,h]);let ee=u===p.TreeNodeType.CompositeTreeNode,re;k?N?(ee=h.type===p.TreeNodeType.CompositeTreeNode,re=`${A+(h.parent.depth+1||0)*(v||0)+(ee?0:D?I?0:20:0)}px`):(ee=h.target.type===p.TreeNodeType.CompositeTreeNode,re=`${A+(h.target.depth||0)*(v||0)+(ee?0:D?I?0:20:0)}px`):re=`${A+(h.depth||0)*(v||0)+(ee?0:D?I?0:20:0)}px`;const ae={color:V?V.color:"",height:e.FILE_TREE_NODE_HEIGHT,lineHeight:`${e.FILE_TREE_NODE_HEIGHT}px`,paddingLeft:re,opacity:R&&!k?".6":"1"},de=(ge,te)=>{if(S&&S?.classlist.indexOf(_.default.mod_loading)>-1)return o.default.createElement(p.Loading,null);if(k&&ge instanceof p.PromptHandle){let X=!1;if(L?X=ge.target.type===p.TreeNodeType.CompositeTreeNode:X=ge.type===p.TreeNodeType.CompositeTreeNode,X)return o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_segment,F,(0,b.getIcon)("arrow-right"),{[`${_.default.mod_collapsed}`]:N||!(L&&ge.target.type===p.TreeNodeType.CompositeTreeNode&&ge.target.expanded)})})}else return o.default.createElement("div",{onClick:te,className:(0,s.default)(_.default.file_tree_node_segment,F,(0,b.getIcon)("arrow-right"),{[`${_.default.mod_collapsed}`]:!ge.expanded})})},q=ge=>{let te,X;k&&ge instanceof p.PromptHandle?ge instanceof p.RenamePromptHandle?(te=ge.target.uri.resolve(ge.$.value),X=g.Directory.is(ge.target)):(te=ge.parent.uri.resolve(ge.$.value),X=ge.type===p.TreeNodeType.CompositeTreeNode):(te=ge.uri,X=ge.filestat.isDirectory);const oe=f.getIcon(te,{isDirectory:X,isOpenedDirectory:X&&ge.expanded});return X&&!D||!X&&!w?null:o.default.createElement("div",{className:(0,s.default)(_.default.file_icon,oe,{expanded:X&&ge.expanded}),style:{height:e.FILE_TREE_NODE_HEIGHT,lineHeight:`${e.FILE_TREE_NODE_HEIGHT}px`}})},_e=ge=>{if(T)return o.default.createElement(T,null);if(k&&ge instanceof p.PromptHandle)return o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_segment,_.default.file_tree_node_inputbox)},o.default.createElement("div",{className:(0,s.default)("input-box",_.default.file_tree_node_prompt_box)},o.default.createElement(ge.ProxiedInput,{wrapperStyle:{height:e.FILE_TREE_NODE_HEIGHT,padding:"0 5px"}})));if(B){const te=ge.displayName.split(E.separator),X=te.map((oe,se)=>{const he=te.slice(0,se+1).join(E.separator),ue=Ae=>{Ae.stopPropagation(),P(se);const Ie=h.parent.uri.resolve(te.slice(0,se+1).join(E.separator));c(Ae,h,u,Ie)},ve=Ae=>{Ae.stopPropagation(),P(se);const Ie=h.parent.uri.resolve(te.slice(0,se+1).join(E.separator));l(Ae,h,u,Ie)},ne=Ae=>{Ae.stopPropagation(),Ae.preventDefault(),O!==se&&(P(se),a.handleDragOver(Ae,h))},fe=Ae=>{Ae.stopPropagation(),Ae.preventDefault(),P(-1)},Ce=Ae=>{Ae.stopPropagation(),O!==se&&P(se);const Ie=h.parent.uri.resolve(te.slice(0,se+1).join(E.separator));a.handleDragStart(Ae,h,Ie)},be=Ae=>{Ae.stopPropagation();const Ie=h.parent.uri.resolve(te.slice(0,se+1).join(E.separator));a.handleDrop(Ae,h,Ie)},Se=(0,s.default)(O===se&&_.default.active,_.default.compact_name);return o.default.createElement("span",{key:he},o.default.createElement("a",{className:Se,draggable:!0,onContextMenu:ve,onDragStart:Ce,onDragOver:ne,onDragLeave:fe,onDrop:be,onClick:ue},oe),se!==te.length-1?o.default.createElement("span",{className:_.default.compact_name_separator},E.separator):null)});return o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_segment,_.default.file_tree_node_displayname)},X)}return o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_segment,_.default.file_tree_node_displayname)},f.getName(ge.uri)||ge.displayName)},pe=()=>o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_segment,_.default.file_tree_node_tail)},J()),J=()=>V?o.default.createElement("div",{className:_.default.file_tree_node_status},(0,b.transformLabelWithCodicon)(V.badge.slice(),{color:"inherit"},M.fromString.bind(M))):null,le=ge=>{if(I)return null;if(ee)return de(ge,z);if(k)return de(ge,()=>{})},ie=()=>{let ge=h.tooltip;return V&&V.badge&&(ge+=` \u2022 ${V.tooltip}`),ge};return o.default.createElement("div",{key:h.id,onClick:H,onDoubleClick:K,onContextMenu:G,onDragStart:j,onDragOver:Q,onDragEnter:$,onDragLeave:U,onDrop:Y,title:ie(),className:(0,s.default)(W,S?S.classlist:null),style:ae,draggable:u===p.TreeNodeType.TreeNode||u===p.TreeNodeType.CompositeTreeNode,"data-id":h.id},o.default.createElement("div",{className:(0,s.default)(_.default.file_tree_node_content)},le(h),q(h),o.default.createElement("div",{className:k?_.default.file_tree_node_prompt_wrap:_.default.file_tree_node_overflow_wrap},_e(h)),pe()))};e.FileTreeNode=d,e.FILE_TREE_NODE_HEIGHT=22,e.FILE_TREE_BADGE_LIMIT=99},56384:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTree=e.FILE_TREE_FILTER_DELAY=e.FILTER_AREA_HEIGHT=void 0;const n=t(85608),s=n.__importDefault(t(53373)),o=n.__importStar(t(14041)),p=t(97267),b=t(41869),g=t(68974),_=t(24429),E=t(87420),d=t(6250),h=t(46377),c=n.__importDefault(t(2613)),r=t(97738);e.FILTER_AREA_HEIGHT=30,e.FILE_TREE_FILTER_DELAY=500;const l=(0,p.RecycleTreeFilterDecorator)(p.RecycleTree),a=({viewState:m})=>{const[f,v]=(0,o.useState)(!1),[y,S]=(0,o.useState)(!0),[A,T]=(0,o.useState)(!1),[D,w]=(0,o.useState)(!1),[I,R]=(0,o.useState)(),M=(0,o.useRef)(null),O=(0,o.useRef)(new b.DisposableCollection),{height:P}=m,L=(0,b.useInjectable)(d.IFileTreeService),{iconService:N,locationToCurrentFile:k,filterMode:B,indent:F,baseIndent:W}=L,V=(0,b.useInjectable)(r.FileTreeModelService),[H,K]=(0,o.useState)({indent:F,baseIndent:W}),[z,G]=(0,o.useState)(B),[j,U]=(0,o.useState)(N.currentTheme||{hasFolderIcons:!0,hasFileIcons:!0,hidesExplorerArrows:!0}),$=(0,o.useCallback)(he=>Y(he)?!1:he.shiftKey,[]),Y=(0,o.useCallback)(he=>{const{metaKey:ue,ctrlKey:ve}=he;return b.isOSX&&ue||ve},[]),Q=(0,o.useCallback)((he,ue,ve,ne)=>{he.stopPropagation();const{handleItemClick:fe,handleItemToggleClick:Ce,handleItemRangeClick:be}=V;if(!ue)return;const Se=$(he),Ae=Y(he);Se?be(ue,ve):Ae?Ce(ue,ve):fe(ue,ve,ne)},[]),ee=(0,o.useCallback)((he,ue,ve)=>{he.stopPropagation();const{handleItemDoubleClick:ne}=V;ue&&ne(ue,ve)},[]),re=(0,o.useCallback)((he,ue)=>{he.stopPropagation();const{toggleDirectory:ve}=V;ve(ue)},[]);(0,o.useEffect)(()=>{f&&V.onFileTreeModelChange(async he=>{S(!0),he&&await he.ensureReady,R(he),S(!1)})},[f]),(0,o.useEffect)(()=>{var he,ue,ve;const ne=new b.CancellationTokenSource;return q(ne.token),(he=O.current)===null||he===void 0||he.push(N.onThemeChange(fe=>{U(fe)})),(ue=O.current)===null||ue===void 0||ue.push(L.onTreeIndentChange(({indent:fe,baseIndent:Ce})=>{K({indent:fe,baseIndent:Ce})})),(ve=O.current)===null||ve===void 0||ve.push(L.onFilterModeChange(fe=>{G(fe)})),()=>{var fe;ne.cancel(),(fe=O.current)===null||fe===void 0||fe.dispose()}},[]);const ae=(0,o.useCallback)((he,ue)=>{let ve;if(he&&ue)for(ve=he.parentNode;ve;){if(ue===ve)return!0;ve=ve.parentNode}return!1},[]),de=(0,o.useCallback)(he=>{ae(he.relatedTarget,M.current)||!he.relatedTarget||(T(!1),V.handleTreeBlur())},[M.current]);(0,o.useEffect)(()=>{z||(V.fileTreeHandle&&V.fileTreeHandle.clearFilter(),V.selectedFiles.length===1&&V.location(V.selectedFiles[0].uri))},[z]),(0,o.useEffect)(()=>{const he=new b.DisposableCollection;return I&&(he.push(V.onDidFocusedFileChange(ue=>{ue?ue.isEqual((I?.root).uri)?A||T(!A):A&&T(!A):ue||A&&T(!A)})),he.push(V.onDidContextMenuFileChange(ue=>{ue?ue.isEqual((I?.root).uri)?A||T(!A):A&&T(!A):ue||A&&T(!A)}))),()=>{he.dispose()}},[I,A]);const q=(0,o.useCallback)(async he=>{var ue;if(await V.whenReady,!he.isCancellationRequested){if(V.treeModel){if(await V.treeModel.ensureReady,R(V.treeModel),he.isCancellationRequested)return;M.current&&L.initContextKey(M.current)}S(!1),!((ue=O.current)===null||ue===void 0)&&ue.disposed||v(!0)}},[V,O.current]),_e=(0,o.useCallback)(he=>{V.handleTreeHandler({...he,getModel:()=>V.treeModel,hasDirectFocus:()=>M.current===document.activeElement})},[M.current,I]),pe=(0,o.useCallback)(()=>{const{handleItemClick:he}=V;he()},[]),J=(0,o.useCallback)(()=>{V.handleDblClick()},[]),le=(0,o.useCallback)(()=>{const{handleTreeFocus:he}=V;he()},[]),ie=(0,o.useCallback)(he=>{const{handleContextMenu:ue}=V;ue(he)},[]),ge=(0,o.useCallback)(he=>{he.stopPropagation(),he.preventDefault()},[]),te=(0,o.useCallback)(he=>{he.preventDefault(),w(!0)},[]),X=(0,o.useCallback)(()=>{w(!1)},[]),oe=(0,o.useCallback)(he=>{const{handleDrop:ue}=V.dndService;w(!1),ue(he)},[]),se=(0,o.useCallback)((he,ue,ve,ne)=>{const{handleContextMenu:fe}=V;fe(he,ue,ne)},[]);return o.default.createElement("div",{className:(0,s.default)(c.default.file_tree,D&&c.default.outer_drag_over,A&&c.default.outer_active),tabIndex:-1,ref:M,onClick:pe,onDoubleClick:J,onFocus:le,onBlur:de,onContextMenu:ie,draggable:!0,onDragStart:ge,onDragLeave:X,onDragOver:te,onDrop:oe},o.default.createElement(u,{isLoading:y,isReady:f,height:P,model:I,iconTheme:j,treeIndent:H,filterMode:z,locationToCurrentFile:k,onTreeReady:_e,onContextMenu:se,onItemClick:Q,onItemDoubleClick:ee,onTwistierClick:re}))};e.FileTree=a;const u=(0,o.memo)(({isReady:m,isLoading:f,height:v,model:y,filterMode:S,treeIndent:A,iconTheme:T,onTreeReady:D,onItemClick:w,onItemDoubleClick:I,onContextMenu:R,onTwistierClick:M})=>{const O=(0,b.useInjectable)(d.IFileTreeService),P=(0,b.useInjectable)(E.IIconService),{decorationService:L,labelService:N,locationToCurrentFile:k}=O,B=(0,b.useInjectable)(r.FileTreeModelService),F=(0,o.useCallback)(W=>o.default.createElement(h.FileTreeNode,{item:W.item,itemType:W.itemType,template:W.template,decorationService:L,labelService:N,iconService:P,dndService:B.dndService,decorations:B.decorations.getDecorations(W.item),onClick:w,onDoubleClick:I,onTwistierClick:M,onContextMenu:R,defaultLeftPadding:A.baseIndent,leftPadding:A.indent,hasPrompt:W.hasPrompt,hasFolderIcons:T.hasFolderIcons,hasFileIcons:T.hasFileIcons,hidesExplorerArrows:T.hidesExplorerArrows}),[y,A,T]);return m?f?o.default.createElement(g.Progress,{loading:!0}):y?o.default.createElement(l,{height:v,itemHeight:h.FILE_TREE_NODE_HEIGHT,onReady:D,model:y,filterEnabled:S,filterAfterClear:k,filterAutoFocus:!0,leaveBottomBlank:!0},F):o.default.createElement(_.WelcomeView,{viewId:d.FILE_EXPLORER_WELCOME_ID}):o.default.createElement(g.Progress,{loading:!0})});u.displayName="FileTreeView"},57781:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeService=void 0;const n=t(85608),s=t(76003),o=t(97267),p=t(41869),b=t(18193),g=t(26542),_=t(42933),E=t(52416),d=t(51500),h=t(6250),c=t(69959),r=t(88014),l=t(93239),{Path:a}=p.path;let u=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 p.Emitter,this.onTreeIndentChangeEmitter=new p.Emitter,this.onFilterModeChangeEmitter=new p.Emitter,this.onNodeRefreshedEmitter=new p.Emitter,this._filterMode=!1,this._refreshable=!0,this.refreshEffectNode=()=>{const f=this.effectedNodes.slice(0);if(this.effectedNodes=[],f.find(y=>c.Directory.isRoot(y)))this.refresh();else for(const y of f)this.refresh(y)},this.flushEventQueue=async()=>{if(!this._changeEventDispatchQueue||this._changeEventDispatchQueue.size===0)return;const f=Array.from(this._changeEventDispatchQueue),v=this.sortPaths(f);(!this.refreshCancelToken||this.refreshCancelToken.token.isCancellationRequested)&&(this.refreshCancelToken=new p.CancellationTokenSource);const y=(0,p.pSeries)(v.map(S=>async()=>{c.Directory.is(S.node)&&await S.node.refresh(this.refreshCancelToken)}));return this._changeEventDispatchQueue.clear(),await y},this.locationToCurrentFile=()=>{this.commandService.executeCommand(p.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(f=>{this._roots=f;const v=new p.URI(f[0].uri),y=new c.Directory(this,void 0,v,v.displayName,f[0],this.fileTreeAPI.getReadableTooltip(v));this.root=y,this.onWorkspaceChangeEmitter.fire(y),this.refresh()})),this.toDispose.push(this.workspaceService.onWorkspaceFileExcludeChanged(()=>{this.refresh()})),this.toDispose.push(p.Disposable.create(()=>{var f;(f=this._root)===null||f===void 0||f.dispose(),this._roots=null})),this.toDispose.push(this.corePreferences.onPreferenceChanged(f=>{f.preferenceName==="explorer.fileTree.baseIndent"?(this._baseIndent=f.newValue||8,this.onTreeIndentChangeEmitter.fire({indent:this.indent,baseIndent:this.baseIndent})):f.preferenceName==="explorer.fileTree.indent"?(this._indent=f.newValue||8,this.onTreeIndentChangeEmitter.fire({indent:this.indent,baseIndent:this.baseIndent})):f.preferenceName==="explorer.compactFolders"&&(this._isCompactMode=f.newValue,this.refresh())}))}initContextKey(f){this.fileContextKey.initScopedContext(f)}startWatchFileEvent(){return this._readyToWatch=!0,Promise.all(this._watchRootsQueue.map(f=>this.watchFilesChange(f)))}async resolveChildren(f){var v,y,S,A;let T=[];if(f){if(c.Directory.isRoot(f)&&this.isMultipleWorkspace){const D=await this.workspaceService.roots;for(const w of D){const I=this.fileTreeAPI.toNode(this,w,f,this.workspaceService.getWorkspaceName(new p.URI(w.uri)));this.watchFilesChange(new p.URI(w.uri)),T=T.concat(I),(I.filestat.isSymbolicLink||I.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(I.filestat.uri,I)}return T}if(f.uri){const D=await this.fileTreeAPI.resolveChildren(this,f.uri.toString(),f,this.isCompactMode&&!c.Directory.isRoot(f));T=D.children,T.forEach(I=>{(I.filestat.isSymbolicLink||I.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(I.filestat.uri,I)});const w=D.filestat;if(w&&this.isCompactMode&&!c.Directory.isRoot(f)){const I=new p.URI(w.uri),R=f.parent;if(f&&R){let M=f.name;if(f.filestat.isSymbolicLink){const O=(y=new p.URI(f.filestat.realUri).relative(I))===null||y===void 0?void 0:y.toString();O&&(M=O,M=[f.uri.displayName].concat(M.split(a.separator)).join(a.separator))}else R.filestat.isSymbolicLink?M=(S=new p.URI(R.filestat.realUri).relative(I))===null||S===void 0?void 0:S.toString():M=(A=R.uri.relative(I))===null||A===void 0?void 0:A.toString();M&&M!==f.name&&f.updateMetaData({name:M,uri:I,tooltip:this.fileTreeAPI.getReadableTooltip(I),fileStat:w})}}return T}}else if(this._roots||(this._roots=await this.workspaceService.roots),this.isMultipleWorkspace){const D=new p.URI((v=this.workspaceService.workspace)===null||v===void 0?void 0:v.uri);let w=D.displayName;w=w.slice(0,w.lastIndexOf("."));const I={...this.workspaceService.workspace,isDirectory:!0},R=new c.Directory(this,void 0,D,w,I,this.fileTreeAPI.getReadableTooltip(D));return this.root=R,[R]}else if(this._roots.length>0)return T=await(await this.fileTreeAPI.resolveChildren(this,this._roots[0])).children,T.forEach(D=>{const w=this.workspaceService.getWorkspaceName(D.uri);w&&w!==D.name&&D.updateMetaData({name:w}),(D.filestat.isSymbolicLink||D.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(D.filestat.uri,D)}),this.watchFilesChange(new p.URI(this._roots[0].uri)),this.root=T[0],T;return[]}async watchFilesChange(f){if(!this._readyToWatch){this._watchRootsQueue.push(f);return}const v=await this.fileServiceClient.watchFileChanges(f);this.toDispose.push(v),this.toDispose.push(v.onFilesChanged(y=>{this.onFilesChanged(y)})),this._fileServiceWatchers.set(f.toString(),v)}updateRefreshable(f){var v;f!==this.refreshable&&(this._refreshable=f,this._refreshable?this.doHandleQueueChange():(v=this.refreshCancelToken)===null||v===void 0||v.cancel())}isContentFile(f){return!!f&&"filestat"in f&&!f.filestat.isDirectory}isFileContentChanged(f){return f.type===_.FileChangeType.UPDATED&&this.isContentFile(this.getNodeByPathOrUri(f.uri))}getAffectedChanges(f){const v=[];for(const y of f)this.isFileContentChanged(y)||v.push(y);return v}isRootAffected(f){return this._roots?f.some(v=>v.type>_.FileChangeType.UPDATED&&this._roots&&this._roots.find(y=>v.uri.indexOf(y.uri)>=0)):!1}async onFilesChanged(f){const v=await this.getAffectedNodes(this.getAffectedChanges(f));return v.length>0?this.effectedNodes=this.effectedNodes.concat(v):!(v.length>0)&&this.isRootAffected(f)&&this.effectedNodes.push(this.root),this.refreshEffectNode()}async getFileTreeNodePathByUri(f){var v,y,S,A,T,D;if(!f)return;let w;if(this.isMultipleWorkspace){if(this._roots||(this._roots=await this.workspaceService.roots),w=(A=this._roots.find(I=>new p.URI(I.uri).isEqualOrParent(f)))===null||A===void 0?void 0:A.uri,w){const I=new p.URI(w);if(I.isEqualOrParent(f))return new a(((T=this.root)===null||T===void 0?void 0:T.path)||"/").join(I.displayName).join(((D=I.relative(f))===null||D===void 0?void 0:D.toString())||"").toString()}}else if(w=(v=this.workspaceService.workspace)===null||v===void 0?void 0:v.uri,w){const I=new p.URI(w);if(I.isEqualOrParent(f))return new a(((y=this.root)===null||y===void 0?void 0:y.path)||"").join(((S=I.relative(f))===null||S===void 0?void 0:S.toString())||"").toString()}}async moveNodeByPath(f,v,y,S,A=o.TreeNodeType.TreeNode){const T=new a(f.path).join(y).toString(),D=new a(v.path).join(S).toString();if(T&&D&&D!==T){const w=f.moveNode(T,D);return w&&c.File.is(w)&&(w.updateMetaData({uri:v.uri.resolve(S),fileStat:{...v.filestat,uri:v.uri.resolve(S).toString(),isDirectory:A!==o.TreeNodeType.TreeNode},tooltip:this.fileTreeAPI.getReadableTooltip(v.uri.resolve(S))}),c.Directory.is(w)&&this.updateChildren(w)),w}}async updateChildren(f){const v=f.children;if(!(!v||v.length===0)){for(const y of v)if(c.File.is(y)){const S=f.uri.resolve(y.uri.displayName);y.updateMetaData({uri:S,fileStat:{...y.filestat,uri:S.toString(),isDirectory:!!c.Directory.is(y)},tooltip:this.fileTreeAPI.getReadableTooltip(S)}),c.Directory.is(y)&&this.updateChildren(y)}}}async addNode(f,v,y){let S,A;const T=a.splitPath(v);if(T.length>1){let w=f.uri;for(const I of T)w=w.resolve(I);!this.isCompactMode||c.Directory.isRoot(f)?A=T[0]:y===o.TreeNodeType.CompositeTreeNode?A=v:A=T.slice(0,T.length-1).join(a.separator)}else A=v;S={uri:f.uri.resolve(A).toString(),isDirectory:y===o.TreeNodeType.CompositeTreeNode||T.length>1,isSymbolicLink:!1,lastModification:new Date().getTime()};const D=await this.fileTreeAPI.toNode(this,S,f,A);return D&&f.addNode(D),D}async deleteAffectedNodeByPath(f,v){var y,S;const A=this.getNodeByPathOrUri(f);A&&A.parent&&(this.isCompactMode&&!v?((y=A.parent.children)===null||y===void 0?void 0:y.length)===2?this.refresh((S=A.parent)===null||S===void 0?void 0:S.parent):this.refresh(A.parent):A.parent.removeNode(A.path))}async deleteAffectedNodes(f,v=[]){const y=[];for(const S of f){const A=this.getNodeByPathOrUri(S);A&&c.File.is(A)&&y.push(A)}for(const S of y)!S?.parent||this._changeEventDispatchQueue.has(S?.parent.path)||await this.deleteAffectedNodeByPath(S.path);return v.filter(S=>S.type!==_.FileChangeType.DELETED)}async getAffectedNodes(f){const v=[];for(const y of f){const S=new p.URI(y.uri),A=this.getNodeByPathOrUri(S.parent);A&&v.push(A)}return v}isFileURI(f){return/^file:\/\//.test(f)}getNodeByPathOrUri(f){var v,y,S,A;let T,D;if(typeof f!="string"?(D=f,f=f.toString()):this.isFileURI(f)?D=new p.URI(f):!this.isFileURI(f)&&typeof f=="string"&&(T=f),this.isFileURI(f)&&D){if(this._symbolicFiles.has(D?.toString()))return this._symbolicFiles.get(D.toString());let w;if(this.isMultipleWorkspace?this._roots&&(w=(y=this._roots.find(I=>new p.URI(I.uri).isEqualOrParent(D)))===null||y===void 0?void 0:y.uri):w=(v=this.workspaceService.workspace)===null||v===void 0?void 0:v.uri,this.root&&w){const I=new p.URI(w);if(I.isEqualOrParent(D)){const R=I.relative(D);R&&(T=new a(this.root.path).join(R.toString()).toString())}}}if(T){const w=(S=this.root)===null||S===void 0?void 0:S.getTreeNodeByPath(T);if(!w){let I;const R=T.split(a.separator);for(;R.length>=1;){R.pop();const M=R.join(a.separator);if(I=(A=this.root)===null||A===void 0?void 0:A.getTreeNodeByPath(M),I)break}if(I&&c.Directory.is(I)){for(const M of I.children||[])if(M.path.includes(T))return M}}return w}}sortComparator(f,v){return f.constructor===v.constructor?f.name.localeCompare(v.name,"en",{numeric:!0}):f.type===o.TreeNodeType.CompositeTreeNode?-1:v.type===o.TreeNodeType.CompositeTreeNode?1:0}get contextMenuContextKeyService(){return this.fileContextKey?this.fileContextKey.service:this.contextKeyService}reWatch(){for(const[f,v]of this._fileServiceWatchers)v.dispose(),this.watchFilesChange(new p.URI(f))}get isMultipleWorkspace(){return!!this.workspaceService.workspace&&!this.workspaceService.workspace.isDirectory}getDisplayName(f){return this.workspaceService.getWorkspaceName(f)}async refresh(f=this.root){if(f)return c.Directory.is(f)||c.File.is(f)&&f.parent&&(f=f.parent),this._changeEventDispatchQueue.add(f.path),this.doHandleQueueChange()}async doHandleQueueChange(){if(this.refreshable)try{await this.flushEventQueue()}catch(f){this.logger.error("flush file change event queue error:",f)}finally{this.onNodeRefreshedEmitter.fire()}}sortPaths(f){const y=f.slice().map(A=>({node:this.getNodeByPathOrUri(A),path:A})).filter(A=>A&&!!A.node);f.length>1&&y.sort((A,T)=>{var D,w;const I=((D=A.node)===null||D===void 0?void 0:D.depth)||0,R=((w=T.node)===null||w===void 0?void 0:w.depth)||0;return I-R});const S=[];for(let A=y.length-1;A>=0;A--){const T=y[A];let D=!1;for(let w=0;w<A;w++){const I=y[w];c.Directory.is(I)&&T.node.path.startsWith(I.node.path)&&(D=!0)}D||S.push(T)}return S}openFile(f){const v=this.preferenceService.get("editor.previewMode");this.commandService.executeCommand(p.EDITOR_COMMANDS.OPEN_RESOURCE.id,f,{disableNavigate:!0,preview:v})}openAndFixedFile(f){this.commandService.executeCommand(p.EDITOR_COMMANDS.OPEN_RESOURCE.id,f,{disableNavigate:!0,preview:!1,focus:!0})}openToTheSide(f){this.commandService.executeCommand(p.EDITOR_COMMANDS.OPEN_RESOURCE.id,f,{disableNavigate:!0,split:4})}compare(f,v){this.commandService.executeCommand(p.EDITOR_COMMANDS.COMPARE.id,{original:f,modified:v})}toggleFilterMode(){var f;this._filterMode=!this.filterMode,this.onFilterModeChangeEmitter.fire(this.filterMode),(f=this.fileContextKey)===null||f===void 0||f.filesExplorerFilteredContext.set(this.filterMode),this.filterMode===!1&&this.commandService.executeCommand(p.FILE_COMMANDS.LOCATION.id)}};e.FileTreeService=u,n.__decorate([(0,s.Autowired)(h.IFileTreeAPI),n.__metadata("design:type",Object)],u.prototype,"fileTreeAPI",void 0),n.__decorate([(0,s.Autowired)(p.CommandService),n.__metadata("design:type",Object)],u.prototype,"commandService",void 0),n.__decorate([(0,s.Autowired)(p.IContextKeyService),n.__metadata("design:type",Object)],u.prototype,"contextKeyService",void 0),n.__decorate([(0,s.Autowired)(d.IWorkspaceService),n.__metadata("design:type",Object)],u.prototype,"workspaceService",void 0),n.__decorate([(0,s.Autowired)(b.CorePreferences),n.__metadata("design:type",Object)],u.prototype,"corePreferences",void 0),n.__decorate([(0,s.Autowired)(p.PreferenceService),n.__metadata("design:type",Object)],u.prototype,"preferenceService",void 0),n.__decorate([(0,s.Autowired)(g.LabelService),n.__metadata("design:type",g.LabelService)],u.prototype,"labelService",void 0),n.__decorate([(0,s.Autowired)(l.FileTreeDecorationService),n.__metadata("design:type",l.FileTreeDecorationService)],u.prototype,"decorationService",void 0),n.__decorate([(0,s.Autowired)(_.IFileServiceClient),n.__metadata("design:type",Object)],u.prototype,"fileServiceClient",void 0),n.__decorate([(0,s.Autowired)(E.IIconService),n.__metadata("design:type",Object)],u.prototype,"iconService",void 0),n.__decorate([(0,s.Autowired)(p.ILogger),n.__metadata("design:type",Object)],u.prototype,"logger",void 0),n.__decorate([(0,s.Autowired)(r.FileContextKey),n.__metadata("design:type",r.FileContextKey)],u.prototype,"fileContextKey",void 0),e.FileTreeService=u=n.__decorate([(0,s.Injectable)()],u)},83709:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeNextModule=void 0;const n=t(85608),s=t(41869),o=t(72665),p=t(41103),b=t(6250),g=t(89508),_=t(40439),E=t(57781),d=t(88808),h=t(93239),c=t(97738),r=t(24861);let l=class extends s.BrowserModule{constructor(){super(...arguments),this.providers=[{token:b.IFileTreeAPI,useClass:d.FileTreeAPI},{token:h.FileTreeDecorationService,useClass:h.FileTreeDecorationService},{token:b.IFileTreeService,useClass:E.FileTreeService},{token:c.FileTreeModelService,useClass:c.FileTreeModelService},{token:o.IWindowDialogService,useClass:g.WindowDialogServiceImpl},_.FileTreeContribution]}};e.FileTreeNextModule=l,e.FileTreeNextModule=l=n.__decorate([(0,s.Domain)(r.name),(0,s.ModuleDependencies)([p.WorkspaceModule])],l)},88808:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeAPI=void 0;const n=t(85608),s=t(76003),o=t(41869),p=t(43718),b=t(42933),g=t(72665),_=t(26199),E=t(69959);let d=class{constructor(){this.cacheFileStat=new Map}async resolveChildren(c,r,l,a){var u;let m;if(!this.userhomePath){const f=await this.fileServiceClient.getCurrentUserHome();f&&(this.userhomePath=new p.URI(f.uri))}if(typeof r=="string"?m=await this.fileServiceClient.getFileStat(r):m=await this.fileServiceClient.getFileStat(r.uri),m){if(((u=m.children)===null||u===void 0?void 0:u.length)===1&&m.children[0].isDirectory&&a)return await this.resolveChildren(c,m.children[0].uri,l,a);{const f={...m,isInSymbolicDirectory:l?.filestat.isSymbolicLink||l?.filestat.isInSymbolicDirectory};return{children:this.toNodes(c,f,l),filestat:f}}}else return{children:[],filestat:null}}async resolveNodeByPath(c,r,l){const a=await this.fileServiceClient.getFileStat(r);if(a)return this.toNode(c,a,l)}async resolveFileStat(c){return await this.fileServiceClient.getFileStat(c.toString())}toNodes(c,r,l){if(l){if(r.children)return r.children.map(a=>this.toNode(c,a,l))}else return[this.toNode(c,r,l)];return[]}toNode(c,r,l,a){var u;const m=new p.URI(r.uri),f=a||m.displayName;let v;return r.isInSymbolicDirectory=(u=l?.filestat.isSymbolicLink)!==null&&u!==void 0?u:l?.filestat.isInSymbolicDirectory,r.isDirectory?v=new E.Directory(c,l,m,f,r,this.getReadableTooltip(m)):v=new E.File(c,l,m,f,r,this.getReadableTooltip(m)),v}async mvFiles(c,r){const l=[];for(const m of c)if(m.url.isEqualOrParent(r))return;const a=c.sort((m,f)=>m.toString().length-f.toString().length),u=[];for(const m of a)u.length>0&&u.find(f=>f.url.isEqualOrParent(m.url))||u.push(m);if(this.corePreferences["explorer.confirmMove"]){const m=(0,p.localize)("file.confirm.move.ok"),f=(0,p.localize)("file.confirm.move.cancel");if(await this.dialogService.warning((0,p.formatLocalize)("file.confirm.move",`[ ${u.map(y=>y.url.displayName).join(",")} ]`,r.displayName),[f,m])!==m)return}for(const m of u){const f=await this.mv(m.url,r.resolve(m.url.displayName),m.isDirectory);f&&l.push(f)}return l}async mv(c,r,l=!1){try{await this.workspaceEditService.apply({edits:[{newResource:r,oldResource:c,options:{isDirectory:l,overwrite:!0}}]})}catch(a){return a.message}}async createFile(c,r){try{await this.workspaceEditService.apply({edits:[{newResource:c,options:{content:r}}]})}catch(l){return l.message}this.commandService.executeCommand(o.EDITOR_COMMANDS.OPEN_RESOURCE.id,c,{disableNavigate:!0,focus:!0})}async createDirectory(c){try{await this.workspaceEditService.apply({edits:[{newResource:c,options:{isDirectory:!0}}]})}catch(r){return r.message}}async delete(c){try{await this.workspaceEditService.apply({edits:[{oldResource:c,options:{}}]});return}catch(r){return r.message}}async copyFile(c,r){let l=1,a;try{a=await this.fileServiceClient.access(r.toString())}catch(u){return u.message}for(;a;){const u=r.displayName.replace(/\Wcopy\W\d+/,""),m=p.path.extname(u),v=`${p.path.basename(u,m)} copy ${l}${m}`;r=r.parent.resolve(v),l++;try{a=await this.fileServiceClient.access(r.toString())}catch{return}}try{return await this.fileServiceClient.copy(c.toString(),r.toString())}catch(u){return u.message}}getReadableTooltip(c){const r=c.toString(),l=this.userhomePath&&this.userhomePath.toString();return this.userhomePath&&this.userhomePath.isEqualOrParent(c)?decodeURIComponent(r.replace(l,"~")):decodeURIComponent(c.withScheme("").toString())}};e.FileTreeAPI=d,n.__decorate([(0,s.Autowired)(b.IFileServiceClient),n.__metadata("design:type",Object)],d.prototype,"fileServiceClient",void 0),n.__decorate([(0,s.Autowired)(_.IWorkspaceEditService),n.__metadata("design:type",Object)],d.prototype,"workspaceEditService",void 0),n.__decorate([(0,s.Autowired)(p.CommandService),n.__metadata("design:type",Object)],d.prototype,"commandService",void 0),n.__decorate([(0,s.Autowired)(o.CorePreferences),n.__metadata("design:type",Object)],d.prototype,"corePreferences",void 0),n.__decorate([(0,s.Autowired)(g.IDialogService),n.__metadata("design:type",Object)],d.prototype,"dialogService",void 0),e.FileTreeAPI=d=n.__decorate([(0,s.Injectable)()],d)},93239:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeDecorationService=void 0;const n=t(85608),s=t(76003),o=t(41869),p=t(41893),b=t(52416);let g=class{constructor(){this.disposeCollection=new o.DisposableCollection,this.onDidChangeEmitter=new o.Emitter,this.cacheDecorations=new Map,this.disposeCollection.pushAll([this.decorationsService.onDidChangeDecorations(E=>{var d,h,c;const r=(h=(d=E._data)===null||d===void 0?void 0:d._iter)===null||h===void 0?void 0:h._value;if(r){const l=new o.URI(r),a=this.getDecoration(l);this.cacheDecorations.has(r)?((c=this.cacheDecorations.get(r))===null||c===void 0?void 0:c.tooltip)!==a?.tooltip&&this.onDidChangeEmitter.fire():(this.cacheDecorations.set(r,a),this.onDidChangeEmitter.fire())}}),this.themeService.onThemeChange(()=>{this.onDidChangeEmitter.fire()})])}get onDidChange(){return this.onDidChangeEmitter.event}getDecoration(E,d=!1){E instanceof o.URI&&(E=o.Uri.parse(E.toString()));const h=this.decorationsService.getDecoration(E,d);return h?{...h,color:this.themeService.getColor({id:h.color})}:{color:"",tooltip:"",badge:""}}dispose(){this.disposeCollection.dispose()}};e.FileTreeDecorationService=g,n.__decorate([(0,s.Autowired)(p.IDecorationsService),n.__metadata("design:type",p.IDecorationsService)],g.prototype,"decorationsService",void 0),n.__decorate([(0,s.Autowired)(b.IThemeService),n.__metadata("design:type",Object)],g.prototype,"themeService",void 0),e.FileTreeDecorationService=g=n.__decorate([(0,s.Injectable)(),n.__metadata("design:paramtypes",[])],g)},30577:(x,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.DragAndDropService=void 0;const s=t(85608),o=t(76003),p=t(97267),b=t(41869),g=t(53622),_=t(14951),E=t(72665),d=t(6250),h=t(69959),c=s.__importDefault(t(89200)),r=s.__importDefault(t(2613)),l=t(57781),a=t(97738);let u=n=class extends b.WithEventBus{constructor(f){super(),this.model=f,this.toCancelNodeExpansion=new b.DisposableCollection,this.beingDraggedDec=new p.Decoration(c.default.mod_dragging),this.draggedOverDec=new p.Decoration(c.default.mod_dragover),this.beingDraggedNodes=[],this.dragOverTrigger=new b.ThrottledDelayer(n.MS_TILL_DRAGGED_OVER_EXPANDS),this.handleDragStart=(v,y,S)=>{v.stopPropagation();const A=I=>{this.handleDragEnd(I,y)};v.currentTarget.addEventListener("dragend",A,!1);let T=this.model.selectedFiles,D=!1;for(const I of T)I&&I.id===y.id&&(D=!0);D||(T=[y]),this.beingDraggedNodes=T,this.beingDraggedActiveUri=S;const w=T.find(I=>!h.Directory.is(I));if(w&&v.dataTransfer.setData("uri",w.uri.toString()),v.dataTransfer.setData("beingDraggedNodes",JSON.stringify(this.beingDraggedNodes.map(I=>I.uri.toString()))),w){const I=w;I.uri.scheme==="file"&&v.dataTransfer.setData("DownloadURL",`application/octet-stream:${I.displayName}:data:application/octet-stream;base64,${(0,b.encodeBase64)(b.BinaryBuffer.fromString(I.filestat.uri))}`)}if(T.forEach(I=>{this.beingDraggedDec.addTarget(I,p.TargetMatchMode.Self)}),v.dataTransfer){let I;T.length===1?I=S?S.displayName:typeof y.name=="string"?y.name:"":I=String(T.length);const R=document.createElement("div");R.className=r.default.file_tree_drag_image,R.textContent=I,document.body.appendChild(R),v.dataTransfer.setDragImage(R,-10,-10),setTimeout(()=>document.body.removeChild(R),0)}},this.handleDragEnter=(v,y)=>{v.stopPropagation(),v.preventDefault()},this.handleDragLeave=(v,y)=>{v.preventDefault(),v.stopPropagation(),this.toCancelNodeExpansion.dispose(),this.potentialParent&&(this.draggedOverDec.removeTarget(this.potentialParent),this.model.treeModel.dispatchChange())},this.handleDragOver=(v,y)=>{if(v.preventDefault(),v.stopPropagation(),!this.toCancelNodeExpansion.disposed||this.beingDraggedNodes.indexOf(y)>=0)return;this.draggedOverNode=y;const S=h.Directory.is(y)&&y.expanded?y:y.parent;(this.potentialParent!==S||!this.draggedOverDec.hasTarget(S))&&(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=S,this.draggedOverDec.addTarget(this.potentialParent,p.TargetMatchMode.SelfAndChildren),this.model.treeModel.dispatchChange()),this.potentialParent!==y&&h.Directory.is(y)&&(this.dragOverTrigger.trigger(async()=>{y.expanded?(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=y,this.draggedOverDec.addTarget(this.potentialParent,p.TargetMatchMode.SelfAndChildren)):(await y.setExpanded(!0),this.draggedOverNode===y&&(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=y,this.draggedOverDec.addTarget(this.potentialParent,p.TargetMatchMode.SelfAndChildren))),this.model.treeModel.dispatchChange()}),this.toCancelNodeExpansion.push(b.Disposable.create(()=>{this.dragOverTrigger.isTriggered()||this.dragOverTrigger.cancel()})))},this.handleDrop=async(v,y,S)=>{var A;this.eventBus.fire(new g.FileTreeDropEvent({event:v.nativeEvent,targetDir:S?S.codeUri.path:y&&y instanceof h.File?(A=y.parent)===null||A===void 0?void 0:A.uri.codeUri.path:y?.uri.codeUri.path}));try{v.preventDefault(),v.stopPropagation(),v.dataTransfer.dropEffect="copy";let T;const D=!!this.beingDraggedActiveUri;this.fileTreeService.isCompactMode&&S&&!y?.uri.isEqual(S)?T=null:y?T=h.Directory.is(y)?y:y.parent:T=this.root;let w;if(this.beingDraggedActiveUri){const I=this.fileTreeService.getNodeByPathOrUri(this.beingDraggedActiveUri);w=[new h.Directory(this.fileTreeService,I?.parent,this.beingDraggedActiveUri,this.beingDraggedActiveUri.displayName,{uri:this.beingDraggedActiveUri.toString(),isDirectory:!0,lastModification:new Date().getTime()},this.beingDraggedActiveUri.displayName)]}else if(w=this.beingDraggedNodes,!w||w.length===0)try{const I=JSON.parse(v.dataTransfer.getData("beingDraggedNodes"));I&&I.length!==0&&(w=I.map(R=>this.fileTreeService.getNodeByPathOrUri(new b.URI(R))).filter(Boolean),w.length||(w=await Promise.all(I.map(async R=>{const M=new b.URI(R);let O;const P=await this.filesystem.getFileStat(M.toString());return P?.isDirectory?O=new h.Directory(this.fileTreeService,this.root,M,M.displayName,{uri:M.toString(),isDirectory:!0,lastModification:new Date().getTime()},M.displayName):O=new h.File(this.fileTreeService,this.root,M,M.displayName,{uri:M.toString(),isDirectory:!0,lastModification:new Date().getTime()},M.displayName),O}))))}catch{}if(w.length>0){const I=S||T&&T.uri,R=w.filter(M=>M&&M.parent&&(this.beingDraggedActiveUri?!M.parent.uri.isEqual(I):!0));if(R.length>0){const M=await this.fileTreeAPI.mvFiles(R.map(O=>({url:O.uri,isDirectory:O.filestat.isDirectory})),I);if(M&&M.length>0)M.forEach(O=>{this.messageService.error(O)});else if(M){if(T)if(this.fileTreeService.isCompactMode&&D){for(const O of R)this.fileTreeService.refresh(O.parent);this.fileTreeService.refresh(T)}else for(const O of R){const P=T.uri.resolve(O.name);this.fileTreeService.moveNodeByPath(O.parent,T,O.name,O.name,O.type),O.updateMetaData({name:P.displayName,fileStat:{...O.filestat,uri:P.toString()},uri:P,tooltip:this.fileTreeAPI.getReadableTooltip(P)}),h.Directory.is(O)&&this.fileTreeService.refresh(O)}else if(y){if(this.fileTreeService.isCompactMode&&D)for(const O of R)this.fileTreeService.refresh(O.parent);else for(const O of R)this.fileTreeService.deleteAffectedNodeByPath(O.path);this.fileTreeService.refresh(y.parent)}}else return}}y&&this.beingDraggedDec.removeTarget(y),this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.beingDraggedNodes.forEach(I=>{this.beingDraggedDec.removeTarget(I)}),this.beingDraggedNodes=[],this.beingDraggedActiveUri=void 0,this.potentialParent=null,this.model.treeModel.dispatchChange(),this.toCancelNodeExpansion.disposed||this.toCancelNodeExpansion.dispose()}catch(T){this.logger.error(T)}},this.handleDragEnd=(v,y)=>{this.beingDraggedDec.removeTarget(y),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}};e.DragAndDropService=u,u.MS_TILL_DRAGGED_OVER_EXPANDS=500,s.__decorate([(0,o.Autowired)(d.IFileTreeAPI),s.__metadata("design:type",Object)],u.prototype,"fileTreeAPI",void 0),s.__decorate([(0,o.Autowired)(b.ILogger),s.__metadata("design:type",Object)],u.prototype,"logger",void 0),s.__decorate([(0,o.Autowired)(E.IMessageService),s.__metadata("design:type",Object)],u.prototype,"messageService",void 0),s.__decorate([(0,o.Autowired)(d.IFileTreeService),s.__metadata("design:type",l.FileTreeService)],u.prototype,"fileTreeService",void 0),s.__decorate([(0,o.Autowired)(_.IFileServiceClient),s.__metadata("design:type",Object)],u.prototype,"filesystem",void 0),e.DragAndDropService=u=n=s.__decorate([(0,o.Injectable)(),s.__param(0,(0,o.Optional)()),s.__metadata("design:paramtypes",[a.FileTreeModelService])],u)},97738:(x,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeModelService=void 0;const s=t(85608),o=t(76003),p=t(97267),b=t(41869),g=t(91830),_=t(93899),E=t(26542),d=t(54414),h=t(14951),c=t(63067),r=t(53576),l=t(72665),a=t(6250),u=t(69959),m=t(2812),f=t(46377),v=s.__importDefault(t(89200)),y=t(57781),S=t(30577),{Path:A,isValidBasename:T}=b.path,{coalesce:D}=b.arrays,{trim:w,rtrim:I}=b.strings;let R=n=class{constructor(){this._isDisposed=!1,this._whenReady=new b.Deferred,this.selectedDecoration=new p.Decoration(v.default.mod_selected),this.focusedDecoration=new p.Decoration(v.default.mod_focused),this.contextMenuDecoration=new p.Decoration(v.default.mod_actived),this.loadingDecoration=new p.Decoration(v.default.mod_loading),this.cutDecoration=new p.Decoration(v.default.mod_cut),this._selectedFiles=[],this.disposableCollection=new b.DisposableCollection,this._isMultiSelected=!1,this.refreshedActionDelayer=new b.ThrottledDelayer(n.DEFAULT_REFRESHED_ACTION_DELAY),this.labelChangedDelayer=new b.ThrottledDelayer(n.DEFAULT_LABEL_CHANGED_DELAY),this.locationThrottler=new b.Throttler,this.onDidFocusedFileChangeEmitter=new b.Emitter,this.onDidContextMenuFileChangeEmitter=new b.Emitter,this.onDidSelectedFileChangeEmitter=new b.Emitter,this.onFileTreeModelChangeEmitter=new b.Emitter,this._initTreeModelReady=!1,this.clearFileSelectedDecoration=()=>{this.selectedDecoration.clearAppliedTarget(),this._selectedFiles=[]},this.activeFileDecoration=(O,P=!0)=>{this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),O&&(this.selectedFiles.length>0&&this.selectedDecoration.clearAppliedTarget(),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.selectedDecoration.addTarget(O),this.focusedDecoration.addTarget(O),this.focusedFile=O,this.selectedFiles=[O],P&&this.treeModel.dispatchChange())},this.selectFileDecoration=(O,P=!0)=>{O!==this.treeModel.root&&(this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),O&&(this.selectedFiles.length>0&&this.selectedDecoration.clearAppliedTarget(),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.selectedDecoration.addTarget(O),this._selectedFiles=[O],P&&this.treeModel.dispatchChange()))},this.activateFileActivedDecoration=O=>{this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),this.focusedFile&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this.contextMenuDecoration.addTarget(O),this.contextMenuFile=O,this.treeModel.dispatchChange()},this.activateFileFocusedDecoration=O=>{this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),this.focusedDecoration.addTarget(O),this.focusedFile=O,this.treeModel.dispatchChange()},this.activeFileFocusedDecoration=(O,P=!1)=>{O!==this.treeModel.root&&(this.focusedFile!==O&&(P?(this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.contextMenuFile=O):this.focusedFile&&(this.contextMenuFile=void 0,this.focusedDecoration.clearAppliedTarget()),O&&(this._selectedFiles.indexOf(O)<0&&(this.selectedDecoration.addTarget(O),this._selectedFiles.push(O),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(L=>L.uri))),this.focusedDecoration.addTarget(O),this.focusedFile=O)),this.treeModel.dispatchChange())},this.toggleFileSelectedDecoration=O=>{const P=this._selectedFiles.indexOf(O);P>-1?(this.focusedFile===O&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this._selectedFiles.splice(P,1),this.selectedDecoration.clearAppliedTarget()):(this._selectedFiles.push(O),this.selectedDecoration.addTarget(O),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.focusedFile=O,this.focusedDecoration.addTarget(O)),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(L=>L.uri)),this.treeModel.dispatchChange()},this.activeFileDecorationByRange=(O,P)=>{for(this.clearFileSelectedDecoration(),this.contextMenuFile=void 0;O<=P;O++){const L=this.treeModel.root.getTreeNodeAtIndex(O);L&&(this._selectedFiles.push(L),this.selectedDecoration.addTarget(L))}this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(L=>L.uri)),this.treeModel.dispatchChange()},this.deactivateFileDecoration=()=>{var O;this.focusedFile&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this.contextMenuFile&&this.contextMenuDecoration.removeTarget(this.contextMenuFile),(O=this.treeModel)===null||O===void 0||O.dispatchChange()},this.toggleDirectory=async O=>{O.expanded?this.fileTreeHandle.collapseNode(O):this.fileTreeHandle.expandNode(O)},this.handleDblClick=()=>{this.commandService.executeCommand(b.FILE_COMMANDS.NEW_FILE.id)},this.handleContextMenu=(O,P,L)=>{var N;O.stopPropagation(),O.preventDefault();let k,B;P?(B=P,this._isMultiSelected?this.selectedFiles.indexOf(B)>=0?k=this.selectedFiles:k=[B]:k=[B]):(k=[this.treeModel.root],B=this.treeModel.root),this.activateFileActivedDecoration(B),this.setFileTreeContextKey(B),this.fileTreeService.isCompactMode&&L?(this._activeUri=L,(N=this.contextKey)===null||N===void 0||N.explorerResourceIsFolder.set(!0)):L||(this._activeUri=null);const F=this.contextMenuService.createMenu({id:_.MenuId.ExplorerContext,contextKeyService:this.fileTreeService.contextMenuContextKeyService}),W=F.getMergedMenuNodes();F.dispose(),this.updateExplorerCompressedContextKey(B,L);const{x:V,y:H}=O.nativeEvent;this.ctxMenuRenderer.show({anchor:{x:V,y:H},menuNodes:W,args:L?[L,[L]]:[B.uri,k.map(K=>K.uri)]})},this.handleTreeBlur=()=>{var O,P,L;this._isDisposed||((P=(O=this.contextKey)===null||O===void 0?void 0:O.filesExplorerFocused)===null||P===void 0||P.set(!1),this.deactivateFileDecoration(),(L=this.contextKey)===null||L===void 0||L.explorerResourceIsFolder.set(!1))},this.handleTreeFocus=()=>{var O,P;(P=(O=this.contextKey)===null||O===void 0?void 0:O.filesExplorerFocused)===null||P===void 0||P.set(!0)},this.handleItemRangeClick=(O,P)=>{if(!this.focusedFile)this.handleItemClick(O,P);else if(this.focusedFile&&this.focusedFile!==O){this._isMultiSelected=!0;const L=this.treeModel.root.getIndexAtTreeNode(O),N=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);N>L?this.activeFileDecorationByRange(L,N):N<L&&this.activeFileDecorationByRange(N,L)}},this.handleItemToggleClick=(O,P)=>{this._isMultiSelected=!0,!(P!==p.TreeNodeType.CompositeTreeNode&&P!==p.TreeNodeType.TreeNode)&&this.toggleFileSelectedDecoration(O)},this.handleItemClick=(O,P=this.fileTreeService.isMultipleWorkspace?p.TreeNodeType.TreeNode:p.TreeNodeType.CompositeTreeNode,L)=>{var N,k,B,F;if(this.treeModel&&(O||(O=this.treeModel.root),this.updateExplorerCompressedContextKey(O,L),this._isMultiSelected=!1,(P===p.TreeNodeType.CompositeTreeNode||P===p.TreeNodeType.TreeNode)&&this.activeFileDecoration(O),this.fileTreeService.isCompactMode&&L?(this._activeUri=L,(N=this.contextKey)===null||N===void 0||N.explorerResourceIsFolder.set(!0)):L||(this._activeUri=null,(k=this.contextKey)===null||k===void 0||k.explorerResourceIsFolder.set(P===p.TreeNodeType.CompositeTreeNode)),this.corePreferences["workbench.list.openMode"]==="singleClick")){if(P===p.TreeNodeType.CompositeTreeNode){if((B=this.contextKey)===null||B===void 0||B.explorerResourceIsFolder.set(!0),O===this.treeModel.root)return;this.toggleDirectory(O)}else if(P===p.TreeNodeType.TreeNode){if((F=this.contextKey)===null||F===void 0||F.explorerResourceIsFolder.set(!1),O===this.treeModel.root)return;this.fileTreeService.openFile(O.uri),this.mainlayoutService.bottomExpanded&&this.commandService.executeCommand(r.RETRACT_BOTTOM_PANEL.id)}}},this.handleItemDoubleClick=(O,P)=>{P===p.TreeNodeType.TreeNode?this.fileTreeService.openAndFixedFile(O.uri):this.corePreferences["workbench.list.openMode"]==="doubleClick"&&this.toggleDirectory(O)},this.validateFileName=(O,P)=>{var L;if(P=this.getWellFormedFileName(P),!P||P.length===0||/^\s+$/.test(P))return{message:(0,b.localize)("validate.tree.emptyFileNameError"),type:p.PROMPT_VALIDATE_TYPE.ERROR,value:P};if(P[0]==="/"||P[0]==="\\")return{message:(0,b.localize)("validate.tree.fileNameStartsWithSlashError"),type:p.PROMPT_VALIDATE_TYPE.ERROR,value:P};if(P[0]===" "||P[P.length-1]===" ")return{message:(0,b.localize)("validate.tree.fileNameFollowOrStartWithSpaceWarning"),type:p.PROMPT_VALIDATE_TYPE.WARNING,value:P};let N;if(O.target){const B=O.target;if(P===B.name)return null;N=B.parent}else N=O.parent;return N&&!(O instanceof p.RenamePromptHandle&&O.target.displayName.indexOf(A.separator)>0)&&((L=N.children)===null||L===void 0?void 0:L.find(W=>W.name===P))?{message:(0,b.formatLocalize)("validate.tree.fileNameExistsError",P),type:p.PROMPT_VALIDATE_TYPE.ERROR,value:P}:D(P.split(/[\\/]/)).some(B=>!T(B))?{message:(0,b.formatLocalize)("validate.tree.invalidFileNameError",this.trimLongName(P)),type:p.PROMPT_VALIDATE_TYPE.ERROR,value:P}:null},this.proxyPrompt=O=>{let P=!1;const L=async K=>{const z=await this.fileTreeService.getNodeByPathOrUri(K);z&&(u.Directory.is(z)?this.selectFileDecoration(z):this.location(z.uri))},N=async K=>{var z,G,j;if(this.validateMessage=void 0,O instanceof p.RenamePromptHandle){const U=O.target,$=O.target.displayName.split(A.separator),Y=U.name.indexOf(A.separator)>0;if(Y&&this.activeUri&&!O.target.uri.toString().includes(this.activeUri.toString()))return!1;const Q=this.activeUri?$.length-O.target.uri.toString().replace(this.activeUri.toString(),"").split(A.separator).length:-1,ee=Q===-1?[]:$.slice(0,Q).concat(K);let re=U.uri,ae=U.parent.uri.resolve(K);if(Y&&((z=this.activeUri)===null||z===void 0?void 0:z.displayName)===K||!Y&&K===U.name)return!0;O.addAddonAfter("loading_indicator"),Y&&ee.length>0&&u.Directory.is(U.parent)&&(re=U.parent.uri.resolve($.slice(0,Q+1).join(A.separator)),ae=U.parent.uri.resolve(ee.concat().join(A.separator)));const de=await this.fileTreeAPI.mv(re,ae,U.type===p.TreeNodeType.CompositeTreeNode);if(de)return this.validateMessage={type:p.PROMPT_VALIDATE_TYPE.ERROR,message:de,value:K},this.fileTreeService.updateRefreshable(!0),O.addValidateMessage(this.validateMessage),!1;if(this.fileTreeService.updateRefreshable(!1),O.removeAddonAfter(),!Y&&U.parent){const q=await this.fileTreeService.moveNodeByPath(U.parent,U.parent,U.name,K,U.type);q&&this.selectFileDecoration(q,!1),this.fileTreeService.updateRefreshable(!0)}else if(u.Directory.is(U)&&!u.Directory.isRoot(U)){U.updateMetaData({name:ee.concat($.slice(Q+1)).join(A.separator),uri:ae,fileStat:{...U.filestat,uri:ae.toString()},tooltip:this.fileTreeAPI.getReadableTooltip(ae)}),this.treeModel.dispatchChange();let q;u.Directory.is(U.parent)&&(!((G=U.parent.children)===null||G===void 0)&&G.find(_e=>U.path.indexOf(_e.path)>=0))?q=this.fileTreeService.refresh(U.parent):q=this.fileTreeService.refresh(U),q.then(()=>{L(ae)})}O.removeAddonAfter()}else if(O instanceof p.NewPromptHandle){const U=O.parent,$=U.uri.resolve(K);let Y;if(O.addAddonAfter("loading_indicator"),this.fileTreeService.updateRefreshable(!0),O.type===p.TreeNodeType.CompositeTreeNode?Y=await this.fileTreeAPI.createDirectory($):Y=await this.fileTreeAPI.createFile($),O.removeAddonAfter(),Y)return this.validateMessage={type:p.PROMPT_VALIDATE_TYPE.ERROR,message:Y,value:K},this.fileTreeService.updateRefreshable(!1),O.addValidateMessage(this.validateMessage),!1;if(K.includes(A.separator)&&this.fileTreeService.refresh(U).then(()=>{L(U.uri.resolve(K))}),this.fileTreeService.isCompactMode)if(O.type===p.TreeNodeType.CompositeTreeNode)if((!U.children||U.children.length===0)&&!u.Directory.isRoot(U)){const ee=U.uri.resolve(K),re=[U.name].concat(K).join(A.separator);U.updateMetaData({name:re,uri:ee,fileStat:{...U.filestat,uri:ee.toString()},tooltip:this.fileTreeAPI.getReadableTooltip(ee)}),L(ee)}else await this.fileTreeService.addNode(U,K,O.type),L(U.uri.resolve(K));else await this.fileTreeService.addNode(U,K,O.type),L(U.uri.resolve(K));else await this.fileTreeService.addNode(U,K,O.type),L(U.uri.resolve(K))}return(j=this.contextKey)===null||j===void 0||j.filesExplorerInputFocused.set(!1),!0},k=async K=>{var z,G,j,U;if(this.validateMessage&&this.validateMessage.type===p.PROMPT_VALIDATE_TYPE.ERROR)return this.validateMessage=void 0,!0;if(P)return!1;if(!K){(z=this.contextKey)===null||z===void 0||z.explorerCompressedFocusContext.set(!1),(G=this.contextKey)===null||G===void 0||G.explorerCompressedFirstFocusContext.set(!1),(j=this.contextKey)===null||j===void 0||j.explorerCompressedLastFocusContext.set(!1),this.fileTreeService.isCompactMode&&O instanceof p.NewPromptHandle&&this.fileTreeService.refresh(O.parent);return}return(U=this.contextKey)===null||U===void 0||U.filesExplorerInputFocused.set(!1),await N(K),!0},B=async K=>{if(P=!0,this.validateMessage&&this.validateMessage.type===p.PROMPT_VALIDATE_TYPE.ERROR)return!1;if(K.trim()===""||this.validateMessage&&this.validateMessage.type!==p.PROMPT_VALIDATE_TYPE.ERROR)return this.validateMessage=void 0,!0;const z=await N(K);return P=!1,!!z},F=async()=>{var K;(K=this.contextKey)===null||K===void 0||K.filesExplorerInputFocused.set(!0)},W=()=>{var K;this.fileTreeService.updateRefreshable(!0),(K=this.contextKey)===null||K===void 0||K.filesExplorerInputFocused.set(!1),this.contextMenuFile&&this.selectFileDecoration(this.contextMenuFile,!0)},V=()=>{var K;(K=this.contextKey)===null||K===void 0||K.filesExplorerInputFocused.set(!1),this.fileTreeService.isCompactMode&&O instanceof p.NewPromptHandle&&this.fileTreeService.refresh(O.parent)},H=K=>{const z=this.validateFileName(O,K);z?(this.validateMessage=z,O.addValidateMessage(z)):!z&&this.validateMessage&&this.validateMessage.value!==K&&(this.validateMessage=void 0,O.removeValidateMessage())};O.destroyed||(this.fileTreeService.updateRefreshable(!1),O.onChange(H),O.onCommit(B),O.onBlur(k),O.onFocus(F),O.onDestroy(W),O.onCancel(V))},this.copyFile=async O=>{var P;this.pasteStore&&this.pasteStore.type===a.PasteTypes.CUT&&(this._pasteStore.files.forEach(N=>{N&&this.cutDecoration.removeTarget(N)}),(P=this.contextKey)===null||P===void 0||P.explorerResourceCut.set(!1)),this.treeModel.dispatchChange();const L=[];for(const N of O){const k=this.fileTreeService.getNodeByPathOrUri(N);k&&L.push(k)}this._pasteStore={files:L,type:a.PasteTypes.COPY},this.clipboardService.writeResources(O)},this.pasteFile=async O=>{var P,L;let N=!1,k=this.fileTreeService.getNodeByPathOrUri(O.toString());if(!k)return;let B=this.pasteStore,F=!1;if(!B){const W=await this.clipboardService.readResources();if(!W||!W.length)return;B={files:[],type:a.PasteTypes.COPY,crossFiles:W},F=!0}if(B){if(u.Directory.is(k)||(N=!0,k=k.parent),F){const W=(0,b.localize)("file.confirm.paste.ok"),V=(0,b.localize)("file.confirm.paste.cancel");if(await this.dialogService.warning((0,b.formatLocalize)("file.confirm.paste",`[ ${(P=B.crossFiles)===null||P===void 0?void 0:P.map(K=>K.displayName).join(",")} ]`,u.Directory.isRoot(k)?k.uri.displayName:k.displayName),[V,W])!==W)return}if(B.type===a.PasteTypes.CUT){for(const V of B.files)V&&this.cutDecoration.removeTarget(V),k.expanded||await k.setExpanded(!0);const W=await this.fileTreeAPI.mvFiles(B.crossFiles?B.crossFiles.map(V=>{var H;return{url:V,isDirectory:((H=this.fileTreeService.getNodeByPathOrUri(V))===null||H===void 0?void 0:H.filestat.isDirectory)||!1}}):B.files.map(V=>({url:V.uri,isDirectory:V.filestat.isDirectory})),k.uri);W&&W.length>0&&(W.forEach(V=>{this.messageService.error(V)}),this.fileTreeService.refresh()),(L=this.contextKey)===null||L===void 0||L.explorerResourceCut.set(!1),this.treeModel.dispatchChange(),this._pasteStore={files:[],type:a.PasteTypes.NONE,crossFiles:void 0}}else if(B.type===a.PasteTypes.COPY){const W=B.crossFiles?B.crossFiles:B.files.map(V=>V.uri);for(const V of W){k.uri.isEqual(V)&&!N&&(k=k.parent);const H=k.uri.resolve(V.displayName);k.expanded||await k.setExpanded(!0);const K=await this.fileTreeAPI.copyFile(V,H);if(K)if(K.uri){const z=new b.URI(K.uri),G=await this.filesystem.getFileStat(V.toString());this.fileTreeService.addNode(k,z.displayName,G?.isDirectory?p.TreeNodeType.CompositeTreeNode:p.TreeNodeType.TreeNode)}else this.messageService.error(`Error when copy file: ${V.toString()}, ${K}`)}}}},this.cutFile=async O=>{var P;O.length>0&&((P=this.contextKey)===null||P===void 0||P.explorerResourceCut.set(!0)),this._pasteStore&&this._pasteStore.type===a.PasteTypes.CUT&&this._pasteStore.files.forEach(N=>{this.cutDecoration.removeTarget(N)});const L=[];for(const N of O){const k=this.fileTreeService.getNodeByPathOrUri(N);k&&L.push(k)}this._pasteStore={files:L,type:a.PasteTypes.CUT};for(const N of L)N&&this.cutDecoration.addTarget(N);this.treeModel.dispatchChange()},this.location=async O=>{if(await this.whenReady,!this.fileTreeService.filterMode)return this._fileToLocation=O,this.locationThrottler.queue(this.doLocation)},this.doLocation=async()=>{if(!this._fileToLocation)return;const O=this._fileToLocation;let P;if(typeof O=="string"?P=O:P=await this.fileTreeService.getFileTreeNodePathByUri(O),P){if(!this.fileTreeHandle)return;const L=await this.fileTreeHandle.ensureVisible(P,"center",!0);L&&this.selectFileDecoration(L)}this._fileToLocation=void 0},this.locationOnShow=O=>{this._nextLocationTarget=O},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(O){this.onDidFocusedFileChangeEmitter.fire(O?O.uri:void 0),this._focusedFile=O}get contextMenuFile(){return this._contextMenuFile}set contextMenuFile(O){this.onDidContextMenuFileChangeEmitter.fire(O?O.uri:void 0),this._contextMenuFile=O}get selectedFiles(){return this._selectedFiles}set selectedFiles(O){this.onDidSelectedFileChangeEmitter.fire(O?O.map(P=>P.uri):[]),this._selectedFiles=O}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 g.ResourceContextKey(this.fileTreeService.contextMenuContextKeyService)),this._contextMenuResourceContext}get contextKey(){return this.fileTreeService.contextKey}get initTreeModelReady(){return this._initTreeModelReady}async initTreeModel(){this._initTreeModelReady=!1;const O=(await this.fileTreeService.resolveChildren())[0];if(!O){this._whenReady.resolve();return}this._treeModel=this.injector.get(m.FileTreeModel,[O]),this.initDecorations(O),this._dndService=this.injector.get(S.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 L=this.editorService.currentEditor;L&&L.currentUri&&this.location(L.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(p.TreeNodeEvent.WillResolveChildren,L=>{this.loadingDecoration.addTarget(L),this.treeModel.dispatchChange()})),this.disposableCollection.push(this.treeModel.root.watcher.on(p.TreeNodeEvent.DidResolveChildren,L=>{this.loadingDecoration.clearAppliedTarget(),this.treeModel.dispatchChange()})),this._explorerStorage=await this.storageProvider(b.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 L=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),N=this.treeStateWatcher.snapshot();this.explorerStorage.set(n.FILE_TREE_SNAPSHOT_KEY,{...L,...N})})),this.fileTreeService.startWatchFileEvent(),this.onFileTreeModelChangeEmitter.fire(this._treeModel),this._whenReady.resolve(),this._initTreeModelReady=!0}initDecorations(O){this._decorations=new p.DecorationsManager(O),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(O){var P;this.currentContextUriContextKey.set(O.uri.toString()),this.currentRelativeUriContextKey.set((this.treeModel.root.uri.relative(O.uri)||"").toString()),this.contextMenuResourceContext.set(O.uri),(P=this.contextKey)===null||P===void 0||P.explorerResourceIsFolder.set(O&&O.type===p.TreeNodeType.CompositeTreeNode)}async loadFileTreeSnapshot(O){await this._treeModel.loadTreeState(O)}updateExplorerCompressedContextKey(O,P){var L,N,k,B,F,W,V,H,K,z,G,j,U,$,Y,Q;if(O&&P){(L=this.contextKey)===null||L===void 0||L.explorerCompressedFocusContext.set(!0);const ee=new A(O.name);ee.name===P.displayName?((N=this.contextKey)===null||N===void 0||N.explorerCompressedLastFocusContext.set(!0),(k=this.contextKey)===null||k===void 0||k.explorerCompressedFirstFocusContext.set(!1)):ee.root&&ee.root.name===P.displayName?((B=this.contextKey)===null||B===void 0||B.explorerCompressedLastFocusContext.set(!1),(F=this.contextKey)===null||F===void 0||F.explorerCompressedFirstFocusContext.set(!0)):((W=this.contextKey)===null||W===void 0||W.explorerCompressedLastFocusContext.set(!1),(V=this.contextKey)===null||V===void 0||V.explorerCompressedFirstFocusContext.set(!1))}else O?O.name.indexOf(A.separator)>0?((H=this.contextKey)===null||H===void 0||H.explorerCompressedFocusContext.set(!0),(K=this.contextKey)===null||K===void 0||K.explorerCompressedFirstFocusContext.set(!1),(z=this.contextKey)===null||z===void 0||z.explorerCompressedLastFocusContext.set(!0)):((G=this.contextKey)===null||G===void 0||G.explorerCompressedFocusContext.set(!1),(j=this.contextKey)===null||j===void 0||j.explorerCompressedFirstFocusContext.set(!1),(U=this.contextKey)===null||U===void 0||U.explorerCompressedLastFocusContext.set(!1)):(($=this.contextKey)===null||$===void 0||$.explorerCompressedFocusContext.set(!1),(Y=this.contextKey)===null||Y===void 0||Y.explorerCompressedFirstFocusContext.set(!1),(Q=this.contextKey)===null||Q===void 0||Q.explorerCompressedLastFocusContext.set(!1))}handleTreeHandler(O){this._fileTreeHandle=O}toggleOrOpenCurrentFile(){let O;this.focusedFile?O=this.focusedFile:this.contextMenuFile&&(O=this.contextMenuFile),O&&(this.activeFileDecoration(O),u.Directory.is(O)?this.toggleDirectory(O):this.fileTreeService.openFile(O.uri))}moveToNext(){let O;if(this.focusedFile?O=this.focusedFile:this.contextMenuFile&&(O=this.contextMenuFile),!O)return;const L=this.treeModel.root.getIndexAtTreeNode(O)+1,N=this.treeModel.root.getTreeNodeAtIndex(L),k=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),B=(L+1)*f.FILE_TREE_NODE_HEIGHT-(k.scrollPosition||0),{height:F}=this.fileTreeHandle.getCurrentSize();N&&(this.activateFileFocusedDecoration(N),B>F&&this.fileTreeHandle.ensureVisible(N,"end"))}moveToPrev(){let O;if(this.focusedFile?O=this.focusedFile:this.contextMenuFile&&(O=this.contextMenuFile),!O)return;const P=this.treeModel.root.getIndexAtTreeNode(O);if(P===0)return;const L=P-1,N=this.treeModel.root.getTreeNodeAtIndex(L);if(!N)return;const k=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),B=L*f.FILE_TREE_NODE_HEIGHT;this.activateFileFocusedDecoration(N),(k.scrollPosition||0)>B&&this.fileTreeHandle.ensureVisible(N,"start")}async collapseCurrentFile(){let O;this.focusedFile?(O=this.focusedFile,this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0):this.contextMenuFile&&(O=this.contextMenuFile,this.focusedDecoration.removeTarget(this.contextMenuFile),this.contextMenuFile=void 0);const P=this.selectedFiles.indexOf(O);P>=0&&(this.selectedFiles.splice(P,1),this.selectedDecoration.removeTarget(O));let L;if(u.Directory.is(O)&&O.expanded)L=O;else if(O)u.Directory.isRoot(O.parent)?L=O:L=O.parent;else return;this.focusedFile=L,L&&L.expanded&&(await this.fileTreeHandle.collapseNode(L),this.activeFileFocusedDecoration(L,!0))}async expandCurrentFile(){let O;this.focusedFile?(O=this.focusedFile,this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0):this.contextMenuFile&&(O=this.contextMenuFile,this.focusedDecoration.removeTarget(this.contextMenuFile),this.contextMenuFile=void 0);const P=this.selectedFiles.indexOf(O);P>=0&&(this.selectedFiles.splice(P,1),this.selectedDecoration.removeTarget(O)),this.focusedFile=O,u.Directory.is(O)&&(O.expanded||await this.fileTreeHandle.expandNode(O))}async collapseAll(){await this.treeModel.root.collapsedAll();const O=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY);O&&this.explorerStorage.set(n.FILE_TREE_SNAPSHOT_KEY,{...O,expandedDirectories:{atSurface:[],buried:[]}})}async deleteFileByUris(O){var P;if(O.length===0)return;if(this.corePreferences["explorer.confirmDelete"]){const B=(0,b.localize)("file.confirm.delete.ok"),F=(0,b.localize)("file.confirm.delete.cancel"),W=`[ ${O.slice(0,5).map(H=>H.displayName).join(",")}${O.length>5?" ...":""} ]`;if(await this.dialogService.warning((0,b.formatLocalize)("file.confirm.delete",W),[F,B])!==B)return}const L=this.fileTreeService.sortPaths(O);let N;if(this.treeModel.root.branchSize===O.length)N=void 0;else if(this.selectedFiles.length&&!L.find(B=>B.path.toString()===this.selectedFiles[0].uri.toString()))N=this.selectedFiles[0];else{const B=(P=L[L.length-1])===null||P===void 0?void 0:P.node;if(!B)N=void 0;else{let W=this.treeModel.root.getIndexAtTreeNode(B)+1;if(W>=this.treeModel.root.branchSize){const V=L[0].node;W=this.treeModel.root.getIndexAtTreeNode(V)-1}N=this.treeModel.root.getTreeNodeAtIndex(W)}}const k=[];L.forEach(B=>{this.loadingDecoration.addTarget(B.node),k.push(this.deleteFile(B.node,B.path).then(F=>(this.loadingDecoration.removeTarget(B.node),F)))}),this.treeModel.dispatchChange(),await Promise.all(k),N&&this.activeFileDecoration(N)}async deleteFile(O,P){const L=typeof P=="string"?new b.URI(P):P,N=await this.fileTreeAPI.delete(L);return N?(this.messageService.error(N),!1):((B=>{var F,W,V;B.uri.isEqual(L)?this.fileTreeService.deleteAffectedNodeByPath(B.path):this.fileTreeService.refresh(O.parent),this.loadingDecoration.removeTarget(B),(F=this.contextKey)===null||F===void 0||F.explorerCompressedFocusContext.set(!1),(W=this.contextKey)===null||W===void 0||W.explorerCompressedFirstFocusContext.set(!1),(V=this.contextKey)===null||V===void 0||V.explorerCompressedLastFocusContext.set(!1)})(O),!0)}getWellFormedFileName(O){return O&&(O=w(O," "),O=I(O,"."),O=I(O,"/"),O=I(O,"\\"),O)}trimLongName(O){return O&&O.length>255?`${O.substr(0,255)}...`:O}async getPromptTarget(O,P){let L;if(O.isEqual(this.treeModel.root.uri))L=await this.fileTreeService.getNodeByPathOrUri(O);else if(this.focusedFile)L=this.focusedFile;else if(this.contextMenuFile)L=this.contextMenuFile;else if(this.selectedFiles.length>0){const k=this.selectedFiles[this.selectedFiles.length-1];if(this.treeModel.root.isItemVisibleAtSurface(k))L=k;else{const B=await this.fileTreeService.getFileTreeNodePathByUri(O);L=await this.treeModel.root.loadTreeNodeByPath(B)}}else L=await this.fileTreeService.getNodeByPathOrUri(O);L||(L=this.treeModel.root);const N=A.splitPath(L.name);if(u.Directory.isRoot(L))return L;if(L.name!==O.displayName&&N[N.length-1]!==O.displayName&&P){const k=O.relative(L.uri).toString(),B=L.name.replace(`${A.separator}${k}`,""),F=L.parent.uri.resolve(B),W=k.split(A.separator)[0];if(!B)return;if(L.children)for(const V of L.children)this.fileTreeService.deleteAffectedNodeByPath(V.path,!0);L.updateMetaData({name:B?.toString(),uri:F,tooltip:this.fileTreeAPI.getReadableTooltip(F),fileStat:{...L.filestat,uri:F.toString()}}),this.fileTreeService.addNode(L,W,p.TreeNodeType.CompositeTreeNode)}return L}async newFilePrompt(O){const P=await this.getPromptTarget(O,!0);P&&this.proxyPrompt(await this.fileTreeHandle.promptNewTreeNode(P))}async newDirectoryPrompt(O){const P=await this.getPromptTarget(O,!0);P&&this.proxyPrompt(await this.fileTreeHandle.promptNewCompositeTreeNode(P))}async renamePrompt(O){const P=await this.getPromptTarget(O);P&&this.proxyPrompt(await this.fileTreeHandle.promptRename(P,O.displayName))}selectChildNode(O){var P;for(const L of O){const N=this.fileTreeService.getNodeByPathOrUri(L);if(N){const k=u.Directory.isRoot(N)?N.children:(P=N.parent)===null||P===void 0?void 0:P.children;if(k){const B=k[0],F=k[k.length-1],W=this.treeModel.root.getIndexAtTreeNode(B),V=this.treeModel.root.getIndexAtTreeNode(F);this.activeFileDecorationByRange(W,V)}}}}dispose(){this._isDisposed=!0}};e.FileTreeModelService=R,R.FILE_TREE_SNAPSHOT_KEY="FILE_TREE_SNAPSHOT",R.DEFAULT_REFRESHED_ACTION_DELAY=500,R.DEFAULT_LOCATION_FLUSH_DELAY=200,R.DEFAULT_LABEL_CHANGED_DELAY=500,s.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),s.__metadata("design:type",o.Injector)],R.prototype,"injector",void 0),s.__decorate([(0,o.Autowired)(a.IFileTreeService),s.__metadata("design:type",y.FileTreeService)],R.prototype,"fileTreeService",void 0),s.__decorate([(0,o.Autowired)(b.CorePreferences),s.__metadata("design:type",Object)],R.prototype,"corePreferences",void 0),s.__decorate([(0,o.Autowired)(_.ICtxMenuRenderer),s.__metadata("design:type",_.ICtxMenuRenderer)],R.prototype,"ctxMenuRenderer",void 0),s.__decorate([(0,o.Autowired)(_.AbstractContextMenuService),s.__metadata("design:type",_.AbstractContextMenuService)],R.prototype,"contextMenuService",void 0),s.__decorate([(0,o.Autowired)(a.IFileTreeAPI),s.__metadata("design:type",Object)],R.prototype,"fileTreeAPI",void 0),s.__decorate([(0,o.Autowired)(h.IFileServiceClient),s.__metadata("design:type",Object)],R.prototype,"filesystem",void 0),s.__decorate([(0,o.Autowired)(b.StorageProvider),s.__metadata("design:type",Function)],R.prototype,"storageProvider",void 0),s.__decorate([(0,o.Autowired)(l.IDialogService),s.__metadata("design:type",Object)],R.prototype,"dialogService",void 0),s.__decorate([(0,o.Autowired)(E.LabelService),s.__metadata("design:type",E.LabelService)],R.prototype,"labelService",void 0),s.__decorate([(0,o.Autowired)(l.IMessageService),s.__metadata("design:type",Object)],R.prototype,"messageService",void 0),s.__decorate([(0,o.Autowired)(d.WorkbenchEditorService),s.__metadata("design:type",d.WorkbenchEditorService)],R.prototype,"editorService",void 0),s.__decorate([(0,o.Autowired)(b.CommandService),s.__metadata("design:type",Object)],R.prototype,"commandService",void 0),s.__decorate([(0,o.Autowired)(c.IMainLayoutService),s.__metadata("design:type",Object)],R.prototype,"mainlayoutService",void 0),s.__decorate([(0,o.Autowired)(b.IClipboardService),s.__metadata("design:type",Object)],R.prototype,"clipboardService",void 0),e.FileTreeModelService=R=n=s.__decorate([(0,o.Injectable)()],R)},4446:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SymlinkDecorationsProvider=void 0;const n=t(85608),s=t(76003),o=t(41869),p=t(57781);let b=class{constructor(_){this.fileTreeService=_,this.label="symbollink",this.onDidChangeEmitter=new o.Emitter}get onDidChange(){return this.onDidChangeEmitter.event}provideDecorations(_){const E=this.fileTreeService.getNodeByPathOrUri(_.toString());if(E&&E.filestat&&E.filestat.isSymbolicLink)return{letter:"\u2937",source:E.filestat.uri,color:"gitDecoration.ignoredResourceForeground",tooltip:(0,o.localize)("file.tooltip.symbolicLink"),weight:-1,bubble:!E.filestat.isDirectory}}};e.SymlinkDecorationsProvider=b,e.SymlinkDecorationsProvider=b=n.__decorate([n.__param(0,(0,s.Optional)()),n.__metadata("design:paramtypes",[p.FileTreeService])],b)},69959:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.File=e.Directory=void 0;const n=t(97267),s=t(41869);class o extends n.CompositeTreeNode{static is(g){return n.CompositeTreeNode.is(g)}constructor(g,_,E=new s.URI(""),d="",h={children:[],isDirectory:!0,uri:"",lastModification:0},c){super(g,_,void 0,{name:d}),this.uri=E,this.filestat=h,this.tooltip=c,_||(this.isExpanded=!0)}get displayName(){return this.name}updateName(g){this.name!==g&&(n.TreeNode.removeTreeNode(this.id,this.path),this.name=g,n.TreeNode.setTreeNode(this.id,this.path,this))}updateURI(g){this.uri=g}updateFileStat(g){this.filestat=g}updateToolTip(g){this.tooltip=g}updateMetaData(g){const{fileStat:_,tooltip:E,name:d,uri:h}=g;d&&this.updateName(d),_&&this.updateFileStat(_),h&&this.updateURI(h),E&&this.updateToolTip(E)}}e.Directory=o;class p extends n.TreeNode{static is(g){return n.TreeNode.is(g)}constructor(g,_,E=new s.URI(""),d="",h={children:[],isDirectory:!1,uri:"",lastModification:0},c){super(g,_,void 0,{name:d}),this.uri=E,this.filestat=h,this.tooltip=c}get displayName(){return this.name}updateName(g){this.name!==g&&(n.TreeNode.removeTreeNode(this.id,this.path),this.name=g,n.TreeNode.setTreeNode(this.id,this.path,this))}updateURI(g){this.uri=g}updateFileStat(g){this.filestat=g}updateToolTip(g){this.tooltip=g}updateMetaData(g){const{fileStat:_,tooltip:E,name:d,uri:h}=g;d&&this.updateName(d),_&&this.updateFileStat(_),h&&this.updateURI(h),E&&this.updateToolTip(E)}}e.File=p},6250:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RESOURCE_VIEW_ID=e.IFileDialogTreeService=e.IFileDialogModel=e.PasteTypes=e.FileStatNode=e.FileTreeExpandedStatusUpdateEvent=e.IFileTreeService=e.IFileTreeAPI=e.FILE_EXPLORER_WELCOME_ID=void 0;const n=t(43718);e.FILE_EXPLORER_WELCOME_ID="file-explorer",e.IFileTreeAPI=Symbol("IFileTreeAPI"),e.IFileTreeService=Symbol("IFileTreeService");class s extends n.BasicEvent{}e.FileTreeExpandedStatusUpdateEvent=s;var o;(function(b){function g(d){return!!d&&"filestat"in d}b.is=g;function _(d){return!!d&&"filestat"in d&&!d.fileStat.isDirectory}b.isContentFile=_;function E(d){if(g(d))return d.filestat.uri}b.getUri=E})(o||(e.FileStatNode=o={}));var p;(function(b){b[b.NONE=0]="NONE",b[b.COPY=1]="COPY",b[b.CUT=2]="CUT"})(p||(e.PasteTypes=p={})),e.IFileDialogModel=Symbol("IFileDialogModel"),e.IFileDialogTreeService=Symbol("IFileDialogTreeService"),e.RESOURCE_VIEW_ID="file-explorer"},87518:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=t(85608);n.__exportStar(t(6250),e),n.__exportStar(t(83709),e)},67240:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.browserViews=void 0,e.browserViews={"sumiContributes.contributes":"Declare all contributions of the OpenSumi Extension.","sumiContributes.common.command":'The command to execute. The command must be declared in "contributes.command" (except built-in commands)',"sumiContributes.common.when":"This condition must be true to display this item","sumiContributes.common.group":"The group this item belongs to","sumiContributes.browserViews":"Provide a custom view to the editor","sumiContributes.browserViews.left":"Provide a view in the left activity bar container","sumiContributes.browserViews.right":"Provide a view in the right activity bar container","sumiContributes.browserViews.bottom":"Provides a view in the bottom tab bar container (no icon will be rendered, so a title is required)","sumiContributes.browserViews.location.custom":'Provide a view to the "{0}" container',"sumiContributes.browserViews.view.id":"View id, browser/index needs to export a component with the same name as this id","sumiContributes.browserViews.view.icon":"Icon name, reference: [icon](https://opensumi.github.io/core/)","sumiContributes.browserViews.view.iconPath":"local icon relative path","sumiContributes.browserViews.view.title":"View title (will be displayed when type is bottom)","sumiContributes.browserViews.view.titleComponentId":"The id of the custom view title component, the characteristics are exactly the same as the normal browserView","sumiContributes.browserViews.view.expanded":"Do you need to expand to full screen, which will cover up the editor area","sumiContributes.browserMain":"Declare the extension browser entry (the path to the compiled code file relative to the extension directory)","sumiContributes.nodeMain":"Declare the extension node entry (the path to the compiled code file relative to the extension directory)","sumiContributes.workerMain":"Declare the extension workser entry (the path to the compiled code file relative to the extension directory)","sumiContributes.viewsProxies":'Declare the component id that needs to be bound to the componentProxy call, which is the same as the export name. For example, after declaring ["component"], the xxxx function of the component component of the browser layer can be called at the node layer through **`context.componentProxy.component.xxxx`**',"sumiContributes.toolbar":"Toolbar is located on the right side of the menu bar at the top of the IDE by default, and can also be displayed as a separate column","sumiContributes.toolbar.actions":"Used to describe the elements on the Toolbar, currently only supports `button` and `select`, we call it action, in some cases it needs to be used with the Toolbar API","sumiContributes.toolbar.actions.id":"unique identifier","sumiContributes.toolbar.actions.weight":"Order weight, the larger the value, the higher the ranking","sumiContributes.toolbar.actions.preferredPosition":`Register the position of this action, if strictPosition exists, this option has no effect
28229
28229
  rule:
28230
28230
  Note: Each location has two groups _head _tail by default, representing the first and last group
28231
28231
  1. If a group value is provided, and the group is not _head and _tail
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensumi/cli-engine",
3
- "version": "3.5.1-next-1733450080.0",
3
+ "version": "3.5.1-next-1733458435.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.5.1-next-1733450080.0",
30
- "@opensumi/ide-core-common": "3.5.1-next-1733450080.0",
31
- "@opensumi/ide-core-node": "3.5.1-next-1733450080.0",
32
- "@opensumi/ide-express-file-server": "3.5.1-next-1733450080.0",
33
- "@opensumi/ide-extension": "3.5.1-next-1733450080.0",
34
- "@opensumi/ide-i18n": "3.5.1-next-1733450080.0",
35
- "@opensumi/ide-main-layout": "3.5.1-next-1733450080.0",
36
- "@opensumi/ide-startup": "3.5.1-next-1733450080.0",
29
+ "@opensumi/ide-core-browser": "3.5.1-next-1733458435.0",
30
+ "@opensumi/ide-core-common": "3.5.1-next-1733458435.0",
31
+ "@opensumi/ide-core-node": "3.5.1-next-1733458435.0",
32
+ "@opensumi/ide-express-file-server": "3.5.1-next-1733458435.0",
33
+ "@opensumi/ide-extension": "3.5.1-next-1733458435.0",
34
+ "@opensumi/ide-i18n": "3.5.1-next-1733458435.0",
35
+ "@opensumi/ide-main-layout": "3.5.1-next-1733458435.0",
36
+ "@opensumi/ide-startup": "3.5.1-next-1733458435.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": "2bb6c3cd531bf64c59eb296c7f265a740d56d943"
75
+ "gitHead": "d84eb98d1766e7ef613747ecb661df8c93ebb444"
76
76
  }