@opensumi/cli-engine 3.8.3-next-1742291358.0 → 3.8.3-next-1742883251.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/browser.js +3 -3
- package/package.json +10 -10
package/lib/browser/browser.js
CHANGED
|
@@ -31263,7 +31263,7 @@ The user's OS is ${(0,p.getOperatingSystemName)()}. The absolute path of the use
|
|
|
31263
31263
|
`);let R=0,P=!1;for(let k=0;k<M.length;k++){const F=M[k].trim();if(typeof R>"u"&&F.match(/^\s*\|/)){const L=F.match(/(\|[^\|]+)(?=\||$)/g);L&&(R=L.length)}else if(typeof R=="number")if(F.match(/^\s*\|/)&&k===M.length-1)P=!0;else return}if(R>0){const k=P?M.slice(0,-1).join(`
|
|
31264
31264
|
`):O,F=!!k.match(/\|\s*$/),L=k+(F?"":"|")+`
|
|
31265
31265
|
|${" --- |".repeat(R)}`;return p.marked.lexer(L)}}function T(I){return I.reduce((O,M)=>O+M.raw,"")}function D(I){for(const{type:O,raw:M}of I.tokens){if(O!=="text")continue;const R=M.split(`
|
|
31266
|
-
`),P=R[R.length-1],k=[{condition:P.includes("`"),action:d},{condition:P.includes("**"),action:y},{condition:P.match(/\*\w/),action:E},{condition:P.match(/(^|\s)__\w/),action:A},{condition:P.match(/(^|\s)_\w/),action:f},{condition:P.match(/(^|\s)\[.*\]\(\w*/),action:a},{condition:P.match(/(^|\s)\[\w/),action:b}];for(const F of k)if(F.condition)return F.action(I)}}},49601:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatMentionInput=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(46541),c=e(41869),p=e(81878),v=e(43718),m=e(92323),_=e(54414),s=e(47720),g=e(72665),l=e(51500),h=e(19413),u=e(27397),d=n.__importDefault(e(6960)),E=e(96086),f=e(44692),a=y=>{const{onSend:A,disabled:S=!1}=y,[w,T]=(0,r.useState)(y.value||""),[D,I]=(0,r.useState)(y.images||[]),O=(0,c.useInjectable)(h.IChatInternalService),M=(0,c.useInjectable)(m.CommandService),R=(0,c.useInjectable)(s.FileSearchServicePath),P=(0,c.useInjectable)(c.RecentFilesManager),k=(0,c.useInjectable)(l.IWorkspaceService),F=(0,c.useInjectable)(_.WorkbenchEditorService),L=(0,c.useInjectable)(c.LabelService),B=(0,c.useInjectable)(g.IMessageService),j=(0,c.useInjectable)(v.ChatFeatureRegistryToken),W=r.default.useCallback(()=>{M.executeCommand(u.OPEN_MCP_CONFIG_COMMAND.id)},[M]);(0,r.useEffect)(()=>{y.value!==w&&T(y.value||"")},[y.value]);const U=[{id:f.MentionType.FILE,type:f.MentionType.FILE,text:"File",icon:(0,p.getIcon)("file"),getHighestLevelItems:()=>{const H=F.currentEditor,K=H?.currentUri;return K?[{id:K.codeUri.fsPath,type:f.MentionType.FILE,text:K.displayName,value:K.codeUri.fsPath,description:`(${(0,v.localize)("aiNative.chat.defaultContextFile")})`,contextId:K.codeUri.fsPath,icon:L.getIcon(K)}]:[]},getItems:async H=>{if(H){const K=(await k.roots).map(X=>new v.URI(X.uri).codeUri.fsPath.toString()),Z=await R.find(H,{rootUris:K,useGitIgnore:!0,noIgnoreParent:!0,fuzzyMatch:!0,limit:10});return Promise.all(Z.map(async X=>{var ie;const oe=new v.URI(X),le=(ie=await k.asRelativePath(oe.parent))===null||ie===void 0?void 0:ie.path;return{id:oe.codeUri.fsPath,type:f.MentionType.FILE,text:oe.displayName,value:oe.codeUri.fsPath,description:le||"",contextId:oe.codeUri.fsPath,icon:L.getIcon(oe)}}))}else{const K=await P.getMostRecentlyOpenedFiles();return Promise.all(K.map(async Z=>{var X;const ie=new v.URI(Z),oe=(X=await k.asRelativePath(ie.parent))===null||X===void 0?void 0:X.path;return{id:ie.codeUri.fsPath,type:f.MentionType.FILE,text:ie.displayName,value:ie.codeUri.fsPath,description:oe||"",contextId:ie.codeUri.fsPath,icon:L.getIcon(ie)}}))}}},{id:f.MentionType.FOLDER,type:f.MentionType.FOLDER,text:"Folder",icon:(0,p.getIcon)("folder"),getHighestLevelItems:()=>{var H,K;const Z=F.currentEditor,X=(H=Z?.currentUri)===null||H===void 0?void 0:H.parent;return X?X.toString()===((K=k.workspace)===null||K===void 0?void 0:K.uri)?[]:[{id:X.codeUri.fsPath,type:f.MentionType.FOLDER,text:X.displayName,value:X.codeUri.fsPath,description:`(${(0,v.localize)("aiNative.chat.defaultContextFolder")})`,contextId:X.codeUri.fsPath,icon:(0,p.getIcon)("folder")}]:[]},getItems:async H=>{let K=[];if(H){const Z=(await k.roots).map(ie=>new v.URI(ie.uri).codeUri.fsPath),X=await R.find(H,{rootUris:Z,useGitIgnore:!0,noIgnoreParent:!0,fuzzyMatch:!0,limit:10,onlyFolders:!0});K=await Promise.all(X.map(async ie=>{var oe;const le=new v.URI(ie);return{id:le.codeUri.fsPath,type:f.MentionType.FOLDER,text:le.displayName,value:le.codeUri.fsPath,description:((oe=await k.asRelativePath(le.parent))===null||oe===void 0?void 0:oe.path)||"",contextId:le.codeUri.fsPath,icon:(0,p.getIcon)("folder")}}))}else{const Z=await P.getMostRecentlyOpenedFiles(),X=Array.from(new Set(Z.map(ie=>new v.URI(ie).parent.codeUri.fsPath)));K=await Promise.all(X.map(async ie=>{const oe=new v.URI(ie),le=await k.asRelativePath(oe);return{id:oe.codeUri.fsPath,type:f.MentionType.FOLDER,text:oe.displayName,value:oe.codeUri.fsPath,description:le?.root?le.path:"",contextId:oe.codeUri.fsPath,icon:(0,p.getIcon)("folder")}}))}return K.filter(Z=>{var X;return Z.id!==new v.URI((X=k.workspace)===null||X===void 0?void 0:X.uri).codeUri.fsPath})}}],Q=(0,r.useMemo)(()=>({modelOptions:[{label:"QWQ 32B",value:"qwq-32b"},{label:"DeepSeek R1",value:"deepseek-r1"}],defaultModel:"deepseek-r1",buttons:[{id:"mcp-server",icon:"mcp",title:"MCP Server",onClick:W,position:f.FooterButtonPosition.LEFT},{id:"upload-image",icon:"image",title:(0,v.localize)("aiNative.chat.imageUpload"),onClick:()=>{const H=document.createElement("input");H.type="file",H.accept="image/*",H.onchange=K=>{const Z=K.target.files;Z?.length&&Y(Array.from(Z))},H.click()},position:f.FooterButtonPosition.LEFT}],showModelSelector:!0}),[W]),V=(0,r.useCallback)(()=>{O.cancelRequest()},[]),$=(0,r.useCallback)(async(H,K)=>{S||(A(H,D.map(Z=>Z.toString()),void 0,void 0,K),I(y.images||[]))},[A,D,S]),Y=(0,r.useCallback)(async H=>{const K=["image/jpeg","image/jpg","image/png","image/webp","image/gif"];if(H.filter(le=>!K.includes(le.type)).length>0){B.error("Only JPG, PNG, WebP and GIF images are supported");return}const X=j.getImageUploadProvider();if(!X){B.error("No image upload provider found");return}const ie=await Promise.all(H.map(le=>X.imageUpload(le))),oe=[...D,...ie];I(oe)},[D]),z=(0,r.useCallback)(H=>{I(D.filter((K,Z)=>Z!==H))},[D]);return r.default.createElement("div",{className:d.default.chat_input_container},D.length>0&&r.default.createElement(b,{images:D,onDelete:z}),r.default.createElement(E.MentionInput,{mentionItems:U,onSend:$,onStop:V,loading:S,labelService:L,workspaceService:k,placeholder:(0,v.localize)("aiNative.chat.input.placeholder.default"),footerConfig:Q,onImageUpload:Y}))};t.ChatMentionInput=a;const b=({images:y,onDelete:A})=>r.default.createElement("div",null,r.default.createElement("div",{className:d.default.thumbnail_container},y.map((S,w)=>r.default.createElement("div",{key:w,className:d.default.thumbnail},r.default.createElement(o.Image,{src:S.toString()}),r.default.createElement("button",{onClick:()=>A(w),className:d.default.delete_button},r.default.createElement(p.Icon,{iconClass:"codicon codicon-close"}))))))},92635:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatNotify=t.ChatReply=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(48412),p=e(91416),v=e(78569),m=e(72871),_=e(41869),s=e(81878),g=e(89195),l=e(43718),h=e(52416),u=e(90684),d=e(19413),E=e(56474),f=e(17319),a=n.__importDefault(e(6960)),b=T=>{const D=(0,_.useInjectable)(_.LabelService),I=(0,_.useInjectable)(_.CommandService),O=(L,B,j)=>{let W=D.getIcon(L,{isDirectory:B});return B&&j&&(W+=" expanded"),W},M=(0,o.useMemo)(()=>{const L=B=>{const j=typeof B.type=="number"?B.type===l.FileType.Directory:!!B.children,W=new l.URI(B.uri);return{label:B.label,iconClassName:O(W,j,j),expandable:!0,expanded:!0,children:j?(B.children||[]).map(L):null,uri:W}};return(T.treeData.children||[]).map(L)},[T.treeData]),[R,P]=(0,o.useState)(22),k=(0,o.useRef)(null),F=L=>{k.current=L;const B=()=>{let j=L.getModel().root.branchSize;j<1?j=1:j>20&&(j=20),P(j*22)};B(),L.onDidUpdate(B)};return M.length?o.default.createElement("div",{className:a.default.tree_container},o.default.createElement(p.BasicRecycleTree,{height:R,treeData:M,onContextMenu:L=>L.preventDefault(),onClick:(L,B)=>{!k.current||!B||(v.BasicCompositeTreeNode.is(B)?B.raw.iconClassName=O(B.raw.uri,!0,B.expanded):I.executeCommand(_.EDITOR_COMMANDS.OPEN_RESOURCE.id,B.raw.uri,{disableNavigate:!0,preview:!0}))},onReady:F,treeName:T.treeData.label,leaveBottomBlank:!1,baseIndent:0})):null},y=T=>{const{toolCall:D,messageId:I}=T,O=(0,_.useInjectable)(l.ChatAgentViewServiceToken),[M,R]=(0,o.useState)(null);return(0,o.useEffect)(()=>{const P=O.getChatComponent("toolCall");if(P){const{component:F,initialProps:L}=P;R(o.default.createElement(F,{...L,value:D,messageId:I}));return}R(o.default.createElement("div",null,o.default.createElement(g.Loading,null),o.default.createElement("span",{style:{marginLeft:4}},"\u6B63\u5728\u52A0\u8F7D\u7EC4\u4EF6"))),O.getChatComponentDeferred("toolCall").promise.then(({component:F,initialProps:L})=>{R(o.default.createElement(F,{...L,value:D,messageId:I}))})},[D.state]),M},A=T=>{const D=(0,_.useInjectable)(l.ChatAgentViewServiceToken),[I,O]=(0,o.useState)(null);return(0,o.useEffect)(()=>{const M=D.getChatComponent(T.component);if(M){const{component:P,initialProps:k}=M;O(o.default.createElement(P,{...k,value:T.value,messageId:T.messageId}));return}O(o.default.createElement("div",null,o.default.createElement(g.Loading,null),o.default.createElement("span",{style:{marginLeft:4}},"\u6B63\u5728\u52A0\u8F7D\u7EC4\u4EF6"))),D.getChatComponentDeferred(T.component).promise.then(({component:P,initialProps:k})=>{O(o.default.createElement(P,{...k,value:T.value}))})},[T.component,T.value]),I},S=T=>{var D,I;const{relationId:O,request:M,startTime:R=0,onRegenerate:P,onDidChange:k,onDone:F,agentId:L,command:B,history:j,msgId:W}=T,[,U]=(0,o.useReducer)(_e=>(_e+1)%1e6,0),Q=(0,_.useInjectable)(l.IAIReporter),V=(0,_.useInjectable)(h.IIconService),$=(0,_.useInjectable)(_.IContextKeyService),Y=(0,_.useInjectable)(d.IChatInternalService),z=(0,_.useInjectable)(l.ChatServiceToken),H=(0,_.useInjectable)(d.IChatAgentService),K=(0,_.useInjectable)(l.ChatRenderRegistryToken),[Z,X]=(0,o.useState)(M.response.isComplete?new Set(M.response.responseContents.map((_e,te)=>_e.kind==="reasoning"?te:-1).filter(_e=>_e!==-1)):new Set);(0,o.useEffect)(()=>{M.response.isComplete&&X(new Set(M.response.responseContents.map((_e,te)=>_e.kind==="reasoning"?te:-1).filter(_e=>_e!==-1)))},[M.response.isComplete]),(0,o.useEffect)(()=>{const _e=new _.DisposableCollection;return _e.push(M.response.onDidChange(()=>{j.updateAssistantMessage(W,{content:M.response.responseText}),M.response.isComplete&&(F&&F(),Q.end(O,{assistantMessage:M.response.responseText,replytime:Date.now()-R,success:!0,isStop:!1,command:B,agentId:L,messageId:W,sessionId:Y.sessionModel.sessionId})),(0,o.startTransition)(()=>{k?.(),U()})})),()=>_e.dispose()},[O,k,F]);const ie=(0,o.useCallback)(()=>{M.response.reset(),P?.()},[P]),oe=(0,o.useCallback)(_e=>{if(K.chatAIRoleRender){const te=K.chatAIRoleRender;return o.default.createElement(te,{content:_e.value})}return o.default.createElement(E.ChatMarkdown,{markdown:_e,fillInIncompleteTokens:!0})},[K,K.chatAIRoleRender]),le=_e=>o.default.createElement(b,{treeData:_e}),pe=_e=>o.default.createElement("div",{className:a.default.placeholder},o.default.createElement(s.Icon,{iconClass:V.fromString("$(codicon/sync~spin)")}),o.default.createElement("div",{className:a.default.placeholder_content},oe(_e))),q=o.default.useMemo(()=>M.response.responseContents.map((_e,te)=>{let ge;if(_e.kind==="asyncContent")ge=pe(new u.MarkdownString(_e.content));else if(_e.kind==="treeData")ge=le(_e.treeData);else if(_e.kind==="component")ge=o.default.createElement(A,{component:_e.component,value:_e.value,messageId:W});else if(_e.kind==="toolCall")ge=o.default.createElement(y,{toolCall:_e.content,messageId:W});else if(_e.kind==="reasoning"){const Te=te===M.response.responseContents.length-1&&!M.response.isComplete;ge=o.default.createElement("div",{className:(0,r.default)(a.default.reasoning,{[a.default.thinking]:Te})},o.default.createElement(c.Button,{size:"small",type:"secondary",className:a.default.thinking,onClick:()=>{Te||(Z.has(te)?Z.delete(te):Z.add(te),X(new Set(Z)))}},o.default.createElement(s.Icon,{iconClass:"codicon codicon-sparkle"}),(0,l.localize)("aiNative.chat.thinking"),Te?o.default.createElement(g.Loading,null):Z.has(te)?o.default.createElement(s.Icon,{iconClass:"codicon codicon-chevron-right"}):o.default.createElement(s.Icon,{iconClass:"codicon codicon-chevron-down"})),Z.has(te)?null:o.default.createElement("div",{className:a.default.reasoning_content},oe(new u.MarkdownString(_e.content))))}else ge=oe(_e.content);return o.default.createElement(o.Fragment,{key:`${_e.kind}-${te}`},ge)}),[M.response.responseContents,Z]),Ee=o.default.useMemo(()=>M.response.followups?M.response.followups.map((_e,te)=>{let ge=null;if(_e.kind==="reply"){const Te=o.default.createElement("a",{onClick:()=>{z.sendMessage({...H.parseMessage(_e.message),reportExtra:{actionSource:l.ActionSourceEnum.Chat,actionType:l.ActionTypeEnum.Followup}})}},_e.title||_e.message);ge=_e.tooltip?o.default.createElement(m.Tooltip,{title:_e.tooltip},Te):Te}else _e.when&&!$.match(_e.when)&&(ge=null),ge=o.default.createElement(c.Button,{type:"default"},_e.title);return ge&&o.default.createElement(o.Fragment,{key:te},ge)}):null,[M.response.followups]);return M.response.isComplete?o.default.createElement(f.ChatThinkingResult,{hasMessage:M.response.responseParts.length>0||M.response.responseContents.length>0||!!(!((D=M.response.errorDetails)===null||D===void 0)&&D.message),onRegenerate:ie,requestId:M.requestId},o.default.createElement("div",{className:a.default.ai_chat_response_container},!((I=M.response.errorDetails)===null||I===void 0)&&I.message?o.default.createElement("div",{className:a.default.error},o.default.createElement(s.Icon,{className:(0,s.getIcon)("close-circle")}),o.default.createElement("span",null,M.response.errorDetails.message)):o.default.createElement(o.default.Fragment,null,q,Ee?.length!==0&&o.default.createElement("div",{className:a.default.followups},Ee)))):o.default.createElement(f.ChatThinking,{message:M.response.responseText},q)};t.ChatReply=S;const w=T=>{const{chunk:D}=T,I=(0,_.useInjectable)(l.ChatRenderRegistryToken),O=o.default.useMemo(()=>{let M;if(D.kind==="component")M=o.default.createElement(A,{component:D.component,value:D.value});else{let R=o.default.createElement(E.ChatMarkdown,{markdown:D.content,fillInIncompleteTokens:!0});if(I.chatAIRoleRender){const P=I.chatAIRoleRender;R=o.default.createElement(P,{content:D.content})}M=R}return M},[D]);return o.default.createElement(f.ChatThinkingResult,{hasMessage:!0,requestId:T.requestId,showRegenerate:!1},o.default.createElement("div",{className:a.default.ai_chat_response_container},O))};t.ChatNotify=w},17319:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatThinkingResult=t.ChatThinking=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(41869),c=e(89195),p=e(68974),v=e(43718),m=e(19413),_=n.__importDefault(e(6960)),s=l=>{const{children:h,message:u,thinkingText:d}=l,E=(0,o.useInjectable)(v.ChatRenderRegistryToken),f=(0,r.useMemo)(()=>E.chatThinkingRender,[E,E.chatThinkingRender]),a=(0,r.useMemo)(()=>Array.isArray(h)?h.length===0:!h,[h]),b=(0,r.useCallback)(()=>a?f?r.default.createElement(f,{thinkingText:d}):r.default.createElement("span",{className:_.default.thinking_text},d||"Thinking..."):h,[u,h,d,f]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:_.default.content},b()),r.default.createElement("div",{className:_.default.thinking_container},r.default.createElement("div",{className:_.default.stop},!f&&r.default.createElement("span",{className:_.default.progress_bar},a&&r.default.createElement(p.Progress,{loading:!0,wrapperClassName:_.default.ai_native_progress_wrapper})))))};t.ChatThinking=s;const g=({children:l,message:h,onRegenerate:u,requestId:d,hasMessage:E=!0,showRegenerate:f})=>{const a=(0,o.useInjectable)(m.IChatInternalService),[b,y]=(0,r.useState)(a.latestRequestId),A=(0,o.useInjectable)(v.ChatRenderRegistryToken);(0,r.useEffect)(()=>{const I=a.onChangeRequestId(O=>{y(O)});return()=>I.dispose()},[a]);const S=(0,r.useMemo)(()=>A.chatThinkingResultRender,[A,A.chatThinkingResultRender]),w=(0,r.useCallback)(()=>{u&&u()},[u]),T=(0,r.useCallback)(()=>{if(typeof E=="boolean"?!E:!h?.trim()){const I=(0,v.localize)("aiNative.chat.stop.immediately");return S?r.default.createElement(S,{thinkingResult:I}):r.default.createElement("span",null,I)}return l},[h,E,l]),D=(0,r.useMemo)(()=>(0,v.isUndefined)(f)?b===d&&!!d:!!f,[b,d,f]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:_.default.content},T()),r.default.createElement("div",{className:_.default.thinking_container},r.default.createElement("div",{className:_.default.bottom_container},r.default.createElement("div",{className:_.default.reset},D?r.default.createElement(c.EnhanceIcon,{icon:"refresh",wrapperClassName:_.default.text_btn,className:_.default.transform,onClick:w,tabIndex:0,role:"button"},r.default.createElement("span",null,(0,v.localize)("aiNative.operate.afresh.title"))):null),r.default.createElement("div",{className:_.default.thumbs},r.default.createElement(c.Thumbs,{relationId:d,wrapperClassName:_.default.icon_btn})))))};t.ChatThinkingResult=g},34817:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatToolRender=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(41869),p=e(81878),v=e(89195),m=e(43718),_=e(33783),s=e(77633),g=e(25834),l=n.__importDefault(e(16796)),h=u=>{var d,E,f;const{value:a,messageId:b}=u,[y,A]=(0,o.useState)(!1),S=(0,c.useInjectable)(s.TokenMCPServerRegistry);if(!a||!a.function||!a.id)return null;const w=((d=S.getMCPTool(a.function.name))===null||d===void 0?void 0:d.label)||a.function.name,T=S.getToolComponent(a.function.name),D=R=>{switch(R){case"streaming-start":case"streaming":return{label:"Generating",icon:o.default.createElement(v.Loading,null)};case"complete":return{label:"Complete",icon:o.default.createElement(p.Icon,{iconClass:"codicon codicon-check"})};case"result":return{label:"Result Ready",icon:o.default.createElement(p.Icon,{iconClass:"codicon codicon-check-all"})};default:return{label:R||"Unknown",icon:o.default.createElement(p.Icon,{iconClass:"codicon codicon-question"})}}},I=()=>{var R;try{return a.state!=="complete"&&a.state!=="result"?{}:JSON.parse(((R=a.function)===null||R===void 0?void 0:R.arguments)||"{}")}catch{return{}}},O=()=>{A(!y)},M=D(a.state);return T&&(a.state==="complete"||a.state==="result")?o.default.createElement(T,{state:a.state,args:I(),result:a.result,index:a.index,messageId:b,toolCallId:a.id}):o.default.createElement("div",{className:l.default.chat_tool_render},o.default.createElement("div",{className:l.default.tool_header,onClick:O},o.default.createElement("div",{className:l.default.tool_name},o.default.createElement(p.Icon,{iconClass:`codicon codicon-chevron-${y?"down":"right"}`}),o.default.createElement(p.Icon,{size:"small",iconClass:(0,r.default)("codicon codicon-tools",l.default.tool_icon)}),o.default.createElement("span",{className:l.default.tool_label},w)),a.state&&o.default.createElement("div",{className:l.default.tool_state},o.default.createElement("span",{className:l.default.state_icon},M.icon))),o.default.createElement("div",{className:(0,r.default)(l.default.tool_content,{[l.default.expanded]:y})},((E=a?.function)===null||E===void 0?void 0:E.arguments)&&o.default.createElement("div",{className:l.default.tool_arguments},o.default.createElement("div",{className:l.default.section_label},(0,_.localize)("ai.native.mcp.tool.arguments"),":"),o.default.createElement(g.CodeEditorWithHighlight,{input:(f=a?.function)===null||f===void 0?void 0:f.arguments,language:"json",relationId:(0,m.uuid)(4)})),a?.result&&o.default.createElement("div",{className:l.default.tool_result},o.default.createElement("div",{className:l.default.section_label},(0,_.localize)("ai.native.mcp.tool.results"),":"),o.default.createElement(g.CodeEditorWithHighlight,{input:a.result,language:"json",relationId:(0,m.uuid)(4)}))))};t.ChatToolRender=h},29039:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SlashCustomRender=void 0;const r=e(85608).__importStar(e(14041)),o=e(41869),c=e(43718),p=e(19413),v=m=>{const{userMessage:_,relationId:s,requestId:g,renderContent:l,startTime:h,agentId:u,command:d}=m,E=(0,o.useInjectable)(p.IChatInternalService),f=(0,o.useInjectable)(c.IAIReporter);return r.useEffect(()=>{E.setLatestRequestId(g),f.end(s,{message:_,replytime:Date.now()-h,success:!0,isStop:!1,agentId:u,command:d})},[l,g,s]),r.createElement("div",null,l({userMessage:_}))};t.SlashCustomRender=v},86556:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WelcomeMessage=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(41869),c=e(81878),p=e(4246),v=e(43718),m=e(90684);e(41937);const _=e(19413),s=e(56474),g=e(17319),l=e(78048),h=n.__importDefault(e(6960)),u=()=>{var d,E;const f=(0,o.useInjectable)(v.ChatServiceToken),a=(0,o.useInjectable)(_.IChatAgentService),b=(0,o.useInjectable)(v.ChatFeatureRegistryToken),y=(0,o.useInjectable)(v.ChatRenderRegistryToken),[A,S]=r.useState([]);(0,o.useUpdateOnEvent)(b.onDidWelcomeMessageChange);const w=r.useMemo(()=>{if(!b.chatWelcomeMessageModel)return[];const{sampleQuestions:O=[]}=b.chatWelcomeMessageModel;return O.map(l.extractIcon)},[(d=b.chatWelcomeMessageModel)===null||d===void 0?void 0:d.sampleQuestions]),T=r.useMemo(()=>{if(!b.chatWelcomeMessageModel)return"";const{content:O}=b.chatWelcomeMessageModel;return O},[(E=b.chatWelcomeMessageModel)===null||E===void 0?void 0:E.content]);if(r.useEffect(()=>{const O=a.onDidChangeAgents(async()=>{const R=(await a.getAllSampleQuestions()).map(l.extractIcon);S(R)});return()=>O.dispose()},[]),!T)return r.createElement(g.ChatThinking,{thinkingText:(0,v.localize)("aiNative.chat.welcome.loading.text")});const D=r.useMemo(()=>w.concat(A),[w,A]);return r.useMemo(()=>{if(y.chatWelcomeRender){const O=y.chatWelcomeRender;return r.createElement(O,{message:T,sampleQuestions:D})}return r.createElement("div",{className:h.default.chat_welcome_head},r.createElement("div",{className:h.default.chat_container_des},(0,m.isMarkdownString)(T)?r.createElement(s.ChatMarkdown,{key:"welcome",markdown:T}):T),r.createElement("div",{className:h.default.chat_container_content},D.map((O,M)=>{const R=r.createElement("a",{className:h.default.link_item,onClick:(0,p.withPrevented)(()=>{f.sendMessage({...a.parseMessage(O.message),reportExtra:{actionType:v.ActionTypeEnum.Welcome,actionSource:v.ActionSourceEnum.Chat}})})},O.icon?r.createElement(c.Icon,{className:O.icon,style:{color:"inherit",marginRight:"4px"}}):"",r.createElement("span",null,O.title));return O.tooltip?r.createElement(c.Tooltip,{title:O.tooltip,key:M},R):r.createElement(r.Fragment,{key:M},R)})))},[y.chatWelcomeRender,T,D])};t.WelcomeMessage=u},83933:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highLightLanguageSupport=void 0,t.highLightLanguageSupport=["1c","abnf","accesslog","actionscript","ada","angelscript","apache","applescript","arcade","arduino","armasm","xml","asciidoc","aspectj","autohotkey","autoit","avrasm","awk","axapta","bash","basic","bnf","brainfuck","c-like","c","cal","capnproto","ceylon","clean","clojure","clojure-repl","cmake","coffeescript","coq","cos","cpp","crmsh","crystal","csharp","csp","css","d","markdown","dart","delphi","diff","django","dns","dockerfile","dos","dsconfig","dts","dust","ebnf","elixir","elm","ruby","erb","erlang-repl","erlang","excel","fix","flix","fortran","fsharp","gams","gauss","gcode","gherkin","glsl","gml","go","golo","gradle","groovy","haml","handlebars","haskell","haxe","hsp","htmlbars","http","hy","inform7","ini","irpf90","isbl","java","javascript","jboss-cli","json","julia","julia-repl","kotlin","lasso","latex","ldif","leaf","less","lisp","livecodeserver","livescript","llvm","lsl","lua","makefile","mathematica","matlab","maxima","mel","mercury","mipsasm","mizar","perl","mojolicious","monkey","moonscript","n1ql","nginx","nim","nix","node-repl","nsis","objectivec","ocaml","openscad","oxygene","parser3","pf","pgsql","php","php-template","plaintext","pony","powershell","processing","profile","prolog","properties","protobuf","puppet","purebasic","python","python-repl","q","qml","r","reasonml","rib","roboconf","routeros","rsl","ruleslanguage","rust","sas","scala","scheme","scilab","scss","shell","smali","smalltalk","sml","sqf","sql_more","sql","stan","stata","step21","stylus","subunit","swift","taggerscript","yaml","tap","tcl","thrift","tp","twig","typescript","vala","vbnet","vbscript","vbscript-html","verilog","vhdl","vim","x86asm","xl","xquery","zephir"]},96086:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MentionInput=t.WHITE_SPACE_TEXT=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(81878),p=e(89195),v=e(70392),m=n.__importDefault(e(97599)),_=e(80732),s=e(44692);t.WHITE_SPACE_TEXT=" ";const g=({mentionItems:l=[],onSend:h,onStop:u,loading:d=!1,mentionKeyword:E=s.MENTION_KEYWORD,onSelectionChange:f,onImageUpload:a,labelService:b,workspaceService:y,placeholder:A="Ask anything, @ to mention",footerConfig:S={buttons:[],showModelSelector:!1}})=>{const w=o.useRef(null),[T,D]=o.useState({active:!1,startPos:null,filter:"",position:{top:0,left:0},activeIndex:0,level:0,parentType:null,secondLevelFilter:"",inlineSearchActive:!1,inlineSearchStartPos:null,loading:!1}),[I,O]=o.useState(S.defaultModel||""),[M,R]=o.useState({}),[P,k]=o.useState([]),[F,L]=o.useState(-1),[B,j]=o.useState(""),[W,U]=o.useState(!1),Q=()=>T.level===0?l:T.parentType?T.loading?M[T.parentType]||[]:M[T.parentType]||[]:[],$=((Ee,_e)=>{const[te,ge]=o.useState(Ee);return o.useEffect(()=>{const Te=setTimeout(()=>{ge(Ee)},_e);return()=>{clearTimeout(Te)}},[Ee,_e]),te})(T.secondLevelFilter,300);o.useEffect(()=>{if(T.level===1&&T.parentType&&$!==void 0){const Ee=l.find(te=>te.id===T.parentType);if(!Ee)return;D(te=>({...te,loading:!0})),(async()=>{try{const te=[];if(Ee.getHighestLevelItems){const ge=Ee.getHighestLevelItems();for(const Te of ge)te.some(Pe=>Pe.id===Te.id)||te.push(Te);R(Te=>({...Te,[T.parentType]:ge}))}if(Ee.getItems)try{const ge=await Ee.getItems($),Te=[...te];for(const Pe of ge)Te.some(Ae=>Ae.id===Pe.id)||Te.push(Pe);R(Pe=>({...Pe,[T.parentType]:Te}))}catch{D(Te=>({...Te,loading:!1}))}D(ge=>({...ge,loading:!1}))}catch{D(ge=>({...ge,loading:!1}))}})()}},[$,T.level,T.parentType]);const Y=Ee=>{const _e=window.getSelection();if(!_e||!_e.rangeCount)return 0;const te=_e.getRangeAt(0),ge=te.cloneRange();return ge.selectNodeContents(Ee),ge.setEnd(te.endContainer,te.endOffset),ge.toString().length},z=()=>{W&&(U(!1),L(-1));const Ee=window.getSelection();if(!Ee||!Ee.rangeCount||!w.current)return;const _e=w.current.textContent||"",te=Y(w.current);if(_e[te-1]===E&&!T.active&&!T.inlineSearchActive&&D({active:!0,startPos:te,filter:E,position:{top:0,left:0},activeIndex:0,level:0,parentType:null,secondLevelFilter:"",inlineSearchActive:!1,inlineSearchStartPos:null,loading:!1}),T.active&&T.level===0&&T.startPos!==null)if(te<T.startPos)D(ge=>({...ge,active:!1}));else{const ge=_e.substring(T.startPos-1,te);D(Te=>({...Te,filter:ge,activeIndex:0}))}if(T.inlineSearchActive&&T.inlineSearchStartPos!==null&&T.parentType){const ge=l.find(Ae=>Ae.id===T.parentType);if(!ge)return;const Te=`@${ge.type}:`,Pe=T.inlineSearchStartPos-Te.length;if(Pe>=0&&te>Pe+Te.length){const Ae=_e.substring(Pe+Te.length,te);Ae!==T.secondLevelFilter&&D(we=>({...we,secondLevelFilter:Ae,active:!0,activeIndex:0}))}else te<=Pe&&D(Ae=>({...Ae,inlineSearchActive:!1,active:!1}))}if(w.current&&(w.current.scrollHeight>120?w.current.style.overflowY="auto":w.current.style.overflowY="hidden"),w.current){const ge=w.current.innerHTML;(ge===""||ge==="<br>"||ge==="<br/>")&&(w.current.innerHTML="")}},H=Ee=>{if(Ee.key==="Escape"&&(T.active||T.inlineSearchActive)){T.level>0?D(te=>({...te,level:0,activeIndex:0,secondLevelFilter:"",inlineSearchActive:!1})):D(te=>({...te,active:!1,inlineSearchActive:!1})),Ee.preventDefault();return}if(Ee.key===s.MENTION_KEYWORD&&!T.active&&!T.inlineSearchActive&&w.current){const te=Y(w.current);D({active:!0,startPos:te+1,filter:E,position:{top:0,left:0},activeIndex:0,level:0,parentType:null,secondLevelFilter:"",inlineSearchActive:!1,inlineSearchStartPos:null,loading:!1})}if((Ee.key==="ArrowUp"||Ee.key==="ArrowDown")&&!Ee.shiftKey&&!Ee.ctrlKey&&!Ee.metaKey&&!Ee.altKey){if(!T.active&&!T.inlineSearchActive&&w.current&&P.length>0){const te=w.current.innerHTML;if(!te||te==="<br>"||W&&F>=0&&P[P.length-1-F]===te){Ee.preventDefault(),W||(j(te),U(!0));let Te=F;Ee.key==="ArrowUp"?Te=Math.min(P.length-1,F+1):Te=Math.max(-1,F-1),L(Te),Te===-1?w.current.innerHTML=B:w.current.innerHTML=P[P.length-1-Te];const Pe=document.createRange();Pe.selectNodeContents(w.current),Pe.collapse(!1);const Ae=window.getSelection();Ae&&(Ae.removeAllRanges(),Ae.addRange(Pe));return}}}else W&&Ee.key!=="ArrowUp"&&Ee.key!=="ArrowDown"&&(U(!1),L(-1));if(Ee.key==="Enter"){if(Ee.nativeEvent.isComposing)return;if(!Ee.shiftKey&&(Ee.preventDefault(),!T.active)){le();return}}if(!T.active)return;let _e=Q();if(T.level===0&&T.filter&&T.filter.length>1){const te=T.filter.substring(1).toLowerCase();_e=_e.filter(ge=>ge.text.toLowerCase().includes(te))}_e.length!==0&&(Ee.key==="ArrowDown"?(D(te=>({...te,activeIndex:(te.activeIndex+1)%_e.length})),Ee.preventDefault()):Ee.key==="ArrowUp"?(D(te=>({...te,activeIndex:(te.activeIndex-1+_e.length)%_e.length})),Ee.preventDefault()):(Ee.key==="Enter"||Ee.key==="Tab")&&_e.length>0&&(ie(_e[T.activeIndex]),Ee.preventDefault()))},K=()=>{},Z=async Ee=>{const _e=Ee.clipboardData.items,te=[];for(let fe=0;fe<_e.length;fe++)if(_e[fe].kind==="file"&&_e[fe].type.startsWith("image/")){const xe=_e[fe].getAsFile();xe&&te.push(xe)}if(Ee.preventDefault(),te.length>0&&a){await a(te);return}const Te=Ee.clipboardData.getData("text/plain").replace(/\t/g," ").replace(/\n\s*\n/g,`
|
|
31266
|
+
`),P=R[R.length-1],k=[{condition:P.includes("`"),action:d},{condition:P.includes("**"),action:y},{condition:P.match(/\*\w/),action:E},{condition:P.match(/(^|\s)__\w/),action:A},{condition:P.match(/(^|\s)_\w/),action:f},{condition:P.match(/(^|\s)\[.*\]\(\w*/),action:a},{condition:P.match(/(^|\s)\[\w/),action:b}];for(const F of k)if(F.condition)return F.action(I)}}},49601:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatMentionInput=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(46541),c=e(41869),p=e(81878),v=e(43718),m=e(92323),_=e(54414),s=e(47720),g=e(72665),l=e(51500),h=e(19413),u=e(27397),d=n.__importDefault(e(6960)),E=e(96086),f=e(44692),a=y=>{const{onSend:A,disabled:S=!1}=y,[w,T]=(0,r.useState)(y.value||""),[D,I]=(0,r.useState)(y.images||[]),O=(0,c.useInjectable)(h.IChatInternalService),M=(0,c.useInjectable)(m.CommandService),R=(0,c.useInjectable)(s.FileSearchServicePath),P=(0,c.useInjectable)(c.RecentFilesManager),k=(0,c.useInjectable)(l.IWorkspaceService),F=(0,c.useInjectable)(_.WorkbenchEditorService),L=(0,c.useInjectable)(c.LabelService),B=(0,c.useInjectable)(g.IMessageService),j=(0,c.useInjectable)(v.ChatFeatureRegistryToken),W=r.default.useCallback(()=>{M.executeCommand(u.OPEN_MCP_CONFIG_COMMAND.id)},[M]);(0,r.useEffect)(()=>{y.value!==w&&T(y.value||"")},[y.value]);const U=[{id:f.MentionType.FILE,type:f.MentionType.FILE,text:"File",icon:(0,p.getIcon)("file"),getHighestLevelItems:()=>{const H=F.currentEditor,K=H?.currentUri;return K?[{id:K.codeUri.fsPath,type:f.MentionType.FILE,text:K.displayName,value:K.codeUri.fsPath,description:`(${(0,v.localize)("aiNative.chat.defaultContextFile")})`,contextId:K.codeUri.fsPath,icon:L.getIcon(K)}]:[]},getItems:async H=>{if(H){const K=(await k.roots).map(X=>new v.URI(X.uri).codeUri.fsPath.toString()),Z=await R.find(H,{rootUris:K,useGitIgnore:!0,noIgnoreParent:!0,fuzzyMatch:!0,limit:10});return Promise.all(Z.map(async X=>{var ie;const oe=new v.URI(X),le=(ie=await k.asRelativePath(oe.parent))===null||ie===void 0?void 0:ie.path;return{id:oe.codeUri.fsPath,type:f.MentionType.FILE,text:oe.displayName,value:oe.codeUri.fsPath,description:le||"",contextId:oe.codeUri.fsPath,icon:L.getIcon(oe)}}))}else{const K=await P.getMostRecentlyOpenedFiles();return Promise.all(K.map(async Z=>{var X;const ie=new v.URI(Z),oe=(X=await k.asRelativePath(ie.parent))===null||X===void 0?void 0:X.path;return{id:ie.codeUri.fsPath,type:f.MentionType.FILE,text:ie.displayName,value:ie.codeUri.fsPath,description:oe||"",contextId:ie.codeUri.fsPath,icon:L.getIcon(ie)}}))}}},{id:f.MentionType.FOLDER,type:f.MentionType.FOLDER,text:"Folder",icon:(0,p.getIcon)("folder"),getHighestLevelItems:()=>{var H,K;const Z=F.currentEditor,X=(H=Z?.currentUri)===null||H===void 0?void 0:H.parent;return X?X.toString()===((K=k.workspace)===null||K===void 0?void 0:K.uri)?[]:[{id:X.codeUri.fsPath,type:f.MentionType.FOLDER,text:X.displayName,value:X.codeUri.fsPath,description:`(${(0,v.localize)("aiNative.chat.defaultContextFolder")})`,contextId:X.codeUri.fsPath,icon:(0,p.getIcon)("folder")}]:[]},getItems:async H=>{let K=[];if(H){const Z=(await k.roots).map(oe=>new v.URI(oe.uri).codeUri.fsPath.toString()),X=await R.find(H,{rootUris:Z,useGitIgnore:!0,noIgnoreParent:!0,fuzzyMatch:!0,excludePatterns:["**/node_modules/**/*","**/.git/**/*"],limit:10}),ie=Array.from(new Set(X.map(oe=>new v.URI(oe).parent.toString()).filter(oe=>{var le;return oe!==((le=k.workspace)===null||le===void 0?void 0:le.uri.toString())})));return Promise.all(ie.map(async oe=>{var le;const pe=new v.URI(oe);return{id:pe.codeUri.fsPath,type:f.MentionType.FOLDER,text:pe.displayName,value:pe.codeUri.fsPath,description:((le=await k.asRelativePath(pe.parent))===null||le===void 0?void 0:le.path)||"",contextId:pe.codeUri.fsPath,icon:(0,p.getIcon)("folder")}}))}else{const Z=await P.getMostRecentlyOpenedFiles(),X=Array.from(new Set(Z.map(ie=>new v.URI(ie).parent.codeUri.fsPath)));K=await Promise.all(X.map(async ie=>{const oe=new v.URI(ie),le=await k.asRelativePath(oe);return{id:oe.codeUri.fsPath,type:f.MentionType.FOLDER,text:oe.displayName,value:oe.codeUri.fsPath,description:le?.root?le.path:"",contextId:oe.codeUri.fsPath,icon:(0,p.getIcon)("folder")}}))}return K.filter(Z=>{var X;return Z.id!==new v.URI((X=k.workspace)===null||X===void 0?void 0:X.uri).codeUri.fsPath})}}],Q=(0,r.useMemo)(()=>({modelOptions:[{label:"QWQ 32B",value:"qwq-32b"},{label:"DeepSeek R1",value:"deepseek-r1"}],defaultModel:"deepseek-r1",buttons:[{id:"mcp-server",icon:"mcp",title:"MCP Server",onClick:W,position:f.FooterButtonPosition.LEFT},{id:"upload-image",icon:"image",title:(0,v.localize)("aiNative.chat.imageUpload"),onClick:()=>{const H=document.createElement("input");H.type="file",H.accept="image/*",H.onchange=K=>{const Z=K.target.files;Z?.length&&Y(Array.from(Z))},H.click()},position:f.FooterButtonPosition.LEFT}],showModelSelector:!0}),[W]),V=(0,r.useCallback)(()=>{O.cancelRequest()},[]),$=(0,r.useCallback)(async(H,K)=>{S||(A(H,D.map(Z=>Z.toString()),void 0,void 0,K),I(y.images||[]))},[A,D,S]),Y=(0,r.useCallback)(async H=>{const K=["image/jpeg","image/jpg","image/png","image/webp","image/gif"];if(H.filter(le=>!K.includes(le.type)).length>0){B.error("Only JPG, PNG, WebP and GIF images are supported");return}const X=j.getImageUploadProvider();if(!X){B.error("No image upload provider found");return}const ie=await Promise.all(H.map(le=>X.imageUpload(le))),oe=[...D,...ie];I(oe)},[D]),z=(0,r.useCallback)(H=>{I(D.filter((K,Z)=>Z!==H))},[D]);return r.default.createElement("div",{className:d.default.chat_input_container},D.length>0&&r.default.createElement(b,{images:D,onDelete:z}),r.default.createElement(E.MentionInput,{mentionItems:U,onSend:$,onStop:V,loading:S,labelService:L,workspaceService:k,placeholder:(0,v.localize)("aiNative.chat.input.placeholder.default"),footerConfig:Q,onImageUpload:Y}))};t.ChatMentionInput=a;const b=({images:y,onDelete:A})=>r.default.createElement("div",null,r.default.createElement("div",{className:d.default.thumbnail_container},y.map((S,w)=>r.default.createElement("div",{key:w,className:d.default.thumbnail},r.default.createElement(o.Image,{src:S.toString()}),r.default.createElement("button",{onClick:()=>A(w),className:d.default.delete_button},r.default.createElement(p.Icon,{iconClass:"codicon codicon-close"}))))))},92635:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatNotify=t.ChatReply=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(48412),p=e(91416),v=e(78569),m=e(72871),_=e(41869),s=e(81878),g=e(89195),l=e(43718),h=e(52416),u=e(90684),d=e(19413),E=e(56474),f=e(17319),a=n.__importDefault(e(6960)),b=T=>{const D=(0,_.useInjectable)(_.LabelService),I=(0,_.useInjectable)(_.CommandService),O=(L,B,j)=>{let W=D.getIcon(L,{isDirectory:B});return B&&j&&(W+=" expanded"),W},M=(0,o.useMemo)(()=>{const L=B=>{const j=typeof B.type=="number"?B.type===l.FileType.Directory:!!B.children,W=new l.URI(B.uri);return{label:B.label,iconClassName:O(W,j,j),expandable:!0,expanded:!0,children:j?(B.children||[]).map(L):null,uri:W}};return(T.treeData.children||[]).map(L)},[T.treeData]),[R,P]=(0,o.useState)(22),k=(0,o.useRef)(null),F=L=>{k.current=L;const B=()=>{let j=L.getModel().root.branchSize;j<1?j=1:j>20&&(j=20),P(j*22)};B(),L.onDidUpdate(B)};return M.length?o.default.createElement("div",{className:a.default.tree_container},o.default.createElement(p.BasicRecycleTree,{height:R,treeData:M,onContextMenu:L=>L.preventDefault(),onClick:(L,B)=>{!k.current||!B||(v.BasicCompositeTreeNode.is(B)?B.raw.iconClassName=O(B.raw.uri,!0,B.expanded):I.executeCommand(_.EDITOR_COMMANDS.OPEN_RESOURCE.id,B.raw.uri,{disableNavigate:!0,preview:!0}))},onReady:F,treeName:T.treeData.label,leaveBottomBlank:!1,baseIndent:0})):null},y=T=>{const{toolCall:D,messageId:I}=T,O=(0,_.useInjectable)(l.ChatAgentViewServiceToken),[M,R]=(0,o.useState)(null);return(0,o.useEffect)(()=>{const P=O.getChatComponent("toolCall");if(P){const{component:F,initialProps:L}=P;R(o.default.createElement(F,{...L,value:D,messageId:I}));return}R(o.default.createElement("div",null,o.default.createElement(g.Loading,null),o.default.createElement("span",{style:{marginLeft:4}},"\u6B63\u5728\u52A0\u8F7D\u7EC4\u4EF6"))),O.getChatComponentDeferred("toolCall").promise.then(({component:F,initialProps:L})=>{R(o.default.createElement(F,{...L,value:D,messageId:I}))})},[D.state]),M},A=T=>{const D=(0,_.useInjectable)(l.ChatAgentViewServiceToken),[I,O]=(0,o.useState)(null);return(0,o.useEffect)(()=>{const M=D.getChatComponent(T.component);if(M){const{component:P,initialProps:k}=M;O(o.default.createElement(P,{...k,value:T.value,messageId:T.messageId}));return}O(o.default.createElement("div",null,o.default.createElement(g.Loading,null),o.default.createElement("span",{style:{marginLeft:4}},"\u6B63\u5728\u52A0\u8F7D\u7EC4\u4EF6"))),D.getChatComponentDeferred(T.component).promise.then(({component:P,initialProps:k})=>{O(o.default.createElement(P,{...k,value:T.value}))})},[T.component,T.value]),I},S=T=>{var D,I;const{relationId:O,request:M,startTime:R=0,onRegenerate:P,onDidChange:k,onDone:F,agentId:L,command:B,history:j,msgId:W}=T,[,U]=(0,o.useReducer)(_e=>(_e+1)%1e6,0),Q=(0,_.useInjectable)(l.IAIReporter),V=(0,_.useInjectable)(h.IIconService),$=(0,_.useInjectable)(_.IContextKeyService),Y=(0,_.useInjectable)(d.IChatInternalService),z=(0,_.useInjectable)(l.ChatServiceToken),H=(0,_.useInjectable)(d.IChatAgentService),K=(0,_.useInjectable)(l.ChatRenderRegistryToken),[Z,X]=(0,o.useState)(M.response.isComplete?new Set(M.response.responseContents.map((_e,te)=>_e.kind==="reasoning"?te:-1).filter(_e=>_e!==-1)):new Set);(0,o.useEffect)(()=>{M.response.isComplete&&X(new Set(M.response.responseContents.map((_e,te)=>_e.kind==="reasoning"?te:-1).filter(_e=>_e!==-1)))},[M.response.isComplete]),(0,o.useEffect)(()=>{const _e=new _.DisposableCollection;return _e.push(M.response.onDidChange(()=>{j.updateAssistantMessage(W,{content:M.response.responseText}),M.response.isComplete&&(F&&F(),Q.end(O,{assistantMessage:M.response.responseText,replytime:Date.now()-R,success:!0,isStop:!1,command:B,agentId:L,messageId:W,sessionId:Y.sessionModel.sessionId})),(0,o.startTransition)(()=>{k?.(),U()})})),()=>_e.dispose()},[O,k,F]);const ie=(0,o.useCallback)(()=>{M.response.reset(),P?.()},[P]),oe=(0,o.useCallback)(_e=>{if(K.chatAIRoleRender){const te=K.chatAIRoleRender;return o.default.createElement(te,{content:_e.value})}return o.default.createElement(E.ChatMarkdown,{markdown:_e,fillInIncompleteTokens:!0})},[K,K.chatAIRoleRender]),le=_e=>o.default.createElement(b,{treeData:_e}),pe=_e=>o.default.createElement("div",{className:a.default.placeholder},o.default.createElement(s.Icon,{iconClass:V.fromString("$(codicon/sync~spin)")}),o.default.createElement("div",{className:a.default.placeholder_content},oe(_e))),q=o.default.useMemo(()=>M.response.responseContents.map((_e,te)=>{let ge;if(_e.kind==="asyncContent")ge=pe(new u.MarkdownString(_e.content));else if(_e.kind==="treeData")ge=le(_e.treeData);else if(_e.kind==="component")ge=o.default.createElement(A,{component:_e.component,value:_e.value,messageId:W});else if(_e.kind==="toolCall")ge=o.default.createElement(y,{toolCall:_e.content,messageId:W});else if(_e.kind==="reasoning"){const Te=te===M.response.responseContents.length-1&&!M.response.isComplete;ge=o.default.createElement("div",{className:(0,r.default)(a.default.reasoning,{[a.default.thinking]:Te})},o.default.createElement(c.Button,{size:"small",type:"secondary",className:a.default.thinking,onClick:()=>{Te||(Z.has(te)?Z.delete(te):Z.add(te),X(new Set(Z)))}},o.default.createElement(s.Icon,{iconClass:"codicon codicon-sparkle"}),(0,l.localize)("aiNative.chat.thinking"),Te?o.default.createElement(g.Loading,null):Z.has(te)?o.default.createElement(s.Icon,{iconClass:"codicon codicon-chevron-right"}):o.default.createElement(s.Icon,{iconClass:"codicon codicon-chevron-down"})),Z.has(te)?null:o.default.createElement("div",{className:a.default.reasoning_content},oe(new u.MarkdownString(_e.content))))}else ge=oe(_e.content);return o.default.createElement(o.Fragment,{key:`${_e.kind}-${te}`},ge)}),[M.response.responseContents,Z]),Ee=o.default.useMemo(()=>M.response.followups?M.response.followups.map((_e,te)=>{let ge=null;if(_e.kind==="reply"){const Te=o.default.createElement("a",{onClick:()=>{z.sendMessage({...H.parseMessage(_e.message),reportExtra:{actionSource:l.ActionSourceEnum.Chat,actionType:l.ActionTypeEnum.Followup}})}},_e.title||_e.message);ge=_e.tooltip?o.default.createElement(m.Tooltip,{title:_e.tooltip},Te):Te}else _e.when&&!$.match(_e.when)&&(ge=null),ge=o.default.createElement(c.Button,{type:"default"},_e.title);return ge&&o.default.createElement(o.Fragment,{key:te},ge)}):null,[M.response.followups]);return M.response.isComplete?o.default.createElement(f.ChatThinkingResult,{hasMessage:M.response.responseParts.length>0||M.response.responseContents.length>0||!!(!((D=M.response.errorDetails)===null||D===void 0)&&D.message),onRegenerate:ie,requestId:M.requestId},o.default.createElement("div",{className:a.default.ai_chat_response_container},!((I=M.response.errorDetails)===null||I===void 0)&&I.message?o.default.createElement("div",{className:a.default.error},o.default.createElement(s.Icon,{className:(0,s.getIcon)("close-circle")}),o.default.createElement("span",null,M.response.errorDetails.message)):o.default.createElement(o.default.Fragment,null,q,Ee?.length!==0&&o.default.createElement("div",{className:a.default.followups},Ee)))):o.default.createElement(f.ChatThinking,{message:M.response.responseText},q)};t.ChatReply=S;const w=T=>{const{chunk:D}=T,I=(0,_.useInjectable)(l.ChatRenderRegistryToken),O=o.default.useMemo(()=>{let M;if(D.kind==="component")M=o.default.createElement(A,{component:D.component,value:D.value});else{let R=o.default.createElement(E.ChatMarkdown,{markdown:D.content,fillInIncompleteTokens:!0});if(I.chatAIRoleRender){const P=I.chatAIRoleRender;R=o.default.createElement(P,{content:D.content})}M=R}return M},[D]);return o.default.createElement(f.ChatThinkingResult,{hasMessage:!0,requestId:T.requestId,showRegenerate:!1},o.default.createElement("div",{className:a.default.ai_chat_response_container},O))};t.ChatNotify=w},17319:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatThinkingResult=t.ChatThinking=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(41869),c=e(89195),p=e(68974),v=e(43718),m=e(19413),_=n.__importDefault(e(6960)),s=l=>{const{children:h,message:u,thinkingText:d}=l,E=(0,o.useInjectable)(v.ChatRenderRegistryToken),f=(0,r.useMemo)(()=>E.chatThinkingRender,[E,E.chatThinkingRender]),a=(0,r.useMemo)(()=>Array.isArray(h)?h.length===0:!h,[h]),b=(0,r.useCallback)(()=>a?f?r.default.createElement(f,{thinkingText:d}):r.default.createElement("span",{className:_.default.thinking_text},d||"Thinking..."):h,[u,h,d,f]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:_.default.content},b()),r.default.createElement("div",{className:_.default.thinking_container},r.default.createElement("div",{className:_.default.stop},!f&&r.default.createElement("span",{className:_.default.progress_bar},a&&r.default.createElement(p.Progress,{loading:!0,wrapperClassName:_.default.ai_native_progress_wrapper})))))};t.ChatThinking=s;const g=({children:l,message:h,onRegenerate:u,requestId:d,hasMessage:E=!0,showRegenerate:f})=>{const a=(0,o.useInjectable)(m.IChatInternalService),[b,y]=(0,r.useState)(a.latestRequestId),A=(0,o.useInjectable)(v.ChatRenderRegistryToken);(0,r.useEffect)(()=>{const I=a.onChangeRequestId(O=>{y(O)});return()=>I.dispose()},[a]);const S=(0,r.useMemo)(()=>A.chatThinkingResultRender,[A,A.chatThinkingResultRender]),w=(0,r.useCallback)(()=>{u&&u()},[u]),T=(0,r.useCallback)(()=>{if(typeof E=="boolean"?!E:!h?.trim()){const I=(0,v.localize)("aiNative.chat.stop.immediately");return S?r.default.createElement(S,{thinkingResult:I}):r.default.createElement("span",null,I)}return l},[h,E,l]),D=(0,r.useMemo)(()=>(0,v.isUndefined)(f)?b===d&&!!d:!!f,[b,d,f]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:_.default.content},T()),r.default.createElement("div",{className:_.default.thinking_container},r.default.createElement("div",{className:_.default.bottom_container},r.default.createElement("div",{className:_.default.reset},D?r.default.createElement(c.EnhanceIcon,{icon:"refresh",wrapperClassName:_.default.text_btn,className:_.default.transform,onClick:w,tabIndex:0,role:"button"},r.default.createElement("span",null,(0,v.localize)("aiNative.operate.afresh.title"))):null),r.default.createElement("div",{className:_.default.thumbs},r.default.createElement(c.Thumbs,{relationId:d,wrapperClassName:_.default.icon_btn})))))};t.ChatThinkingResult=g},34817:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatToolRender=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(41869),p=e(81878),v=e(89195),m=e(43718),_=e(33783),s=e(77633),g=e(25834),l=n.__importDefault(e(16796)),h=u=>{var d,E,f;const{value:a,messageId:b}=u,[y,A]=(0,o.useState)(!1),S=(0,c.useInjectable)(s.TokenMCPServerRegistry);if(!a||!a.function||!a.id)return null;const w=((d=S.getMCPTool(a.function.name))===null||d===void 0?void 0:d.label)||a.function.name,T=S.getToolComponent(a.function.name),D=R=>{switch(R){case"streaming-start":case"streaming":return{label:"Generating",icon:o.default.createElement(v.Loading,null)};case"complete":return{label:"Complete",icon:o.default.createElement(p.Icon,{iconClass:"codicon codicon-check"})};case"result":return{label:"Result Ready",icon:o.default.createElement(p.Icon,{iconClass:"codicon codicon-check-all"})};default:return{label:R||"Unknown",icon:o.default.createElement(p.Icon,{iconClass:"codicon codicon-question"})}}},I=()=>{var R;try{return a.state!=="complete"&&a.state!=="result"?{}:JSON.parse(((R=a.function)===null||R===void 0?void 0:R.arguments)||"{}")}catch{return{}}},O=()=>{A(!y)},M=D(a.state);return T&&(a.state==="complete"||a.state==="result")?o.default.createElement(T,{state:a.state,args:I(),result:a.result,index:a.index,messageId:b,toolCallId:a.id}):o.default.createElement("div",{className:l.default.chat_tool_render},o.default.createElement("div",{className:l.default.tool_header,onClick:O},o.default.createElement("div",{className:l.default.tool_name},o.default.createElement(p.Icon,{iconClass:`codicon codicon-chevron-${y?"down":"right"}`}),o.default.createElement(p.Icon,{size:"small",iconClass:(0,r.default)("codicon codicon-tools",l.default.tool_icon)}),o.default.createElement("span",{className:l.default.tool_label},w)),a.state&&o.default.createElement("div",{className:l.default.tool_state},o.default.createElement("span",{className:l.default.state_icon},M.icon))),o.default.createElement("div",{className:(0,r.default)(l.default.tool_content,{[l.default.expanded]:y})},((E=a?.function)===null||E===void 0?void 0:E.arguments)&&o.default.createElement("div",{className:l.default.tool_arguments},o.default.createElement("div",{className:l.default.section_label},(0,_.localize)("ai.native.mcp.tool.arguments"),":"),o.default.createElement(g.CodeEditorWithHighlight,{input:(f=a?.function)===null||f===void 0?void 0:f.arguments,language:"json",relationId:(0,m.uuid)(4)})),a?.result&&o.default.createElement("div",{className:l.default.tool_result},o.default.createElement("div",{className:l.default.section_label},(0,_.localize)("ai.native.mcp.tool.results"),":"),o.default.createElement(g.CodeEditorWithHighlight,{input:a.result,language:"json",relationId:(0,m.uuid)(4)}))))};t.ChatToolRender=h},29039:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SlashCustomRender=void 0;const r=e(85608).__importStar(e(14041)),o=e(41869),c=e(43718),p=e(19413),v=m=>{const{userMessage:_,relationId:s,requestId:g,renderContent:l,startTime:h,agentId:u,command:d}=m,E=(0,o.useInjectable)(p.IChatInternalService),f=(0,o.useInjectable)(c.IAIReporter);return r.useEffect(()=>{E.setLatestRequestId(g),f.end(s,{message:_,replytime:Date.now()-h,success:!0,isStop:!1,agentId:u,command:d})},[l,g,s]),r.createElement("div",null,l({userMessage:_}))};t.SlashCustomRender=v},86556:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WelcomeMessage=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(41869),c=e(81878),p=e(4246),v=e(43718),m=e(90684);e(41937);const _=e(19413),s=e(56474),g=e(17319),l=e(78048),h=n.__importDefault(e(6960)),u=()=>{var d,E;const f=(0,o.useInjectable)(v.ChatServiceToken),a=(0,o.useInjectable)(_.IChatAgentService),b=(0,o.useInjectable)(v.ChatFeatureRegistryToken),y=(0,o.useInjectable)(v.ChatRenderRegistryToken),[A,S]=r.useState([]);(0,o.useUpdateOnEvent)(b.onDidWelcomeMessageChange);const w=r.useMemo(()=>{if(!b.chatWelcomeMessageModel)return[];const{sampleQuestions:O=[]}=b.chatWelcomeMessageModel;return O.map(l.extractIcon)},[(d=b.chatWelcomeMessageModel)===null||d===void 0?void 0:d.sampleQuestions]),T=r.useMemo(()=>{if(!b.chatWelcomeMessageModel)return"";const{content:O}=b.chatWelcomeMessageModel;return O},[(E=b.chatWelcomeMessageModel)===null||E===void 0?void 0:E.content]);if(r.useEffect(()=>{const O=a.onDidChangeAgents(async()=>{const R=(await a.getAllSampleQuestions()).map(l.extractIcon);S(R)});return()=>O.dispose()},[]),!T)return r.createElement(g.ChatThinking,{thinkingText:(0,v.localize)("aiNative.chat.welcome.loading.text")});const D=r.useMemo(()=>w.concat(A),[w,A]);return r.useMemo(()=>{if(y.chatWelcomeRender){const O=y.chatWelcomeRender;return r.createElement(O,{message:T,sampleQuestions:D})}return r.createElement("div",{className:h.default.chat_welcome_head},r.createElement("div",{className:h.default.chat_container_des},(0,m.isMarkdownString)(T)?r.createElement(s.ChatMarkdown,{key:"welcome",markdown:T}):T),r.createElement("div",{className:h.default.chat_container_content},D.map((O,M)=>{const R=r.createElement("a",{className:h.default.link_item,onClick:(0,p.withPrevented)(()=>{f.sendMessage({...a.parseMessage(O.message),reportExtra:{actionType:v.ActionTypeEnum.Welcome,actionSource:v.ActionSourceEnum.Chat}})})},O.icon?r.createElement(c.Icon,{className:O.icon,style:{color:"inherit",marginRight:"4px"}}):"",r.createElement("span",null,O.title));return O.tooltip?r.createElement(c.Tooltip,{title:O.tooltip,key:M},R):r.createElement(r.Fragment,{key:M},R)})))},[y.chatWelcomeRender,T,D])};t.WelcomeMessage=u},83933:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highLightLanguageSupport=void 0,t.highLightLanguageSupport=["1c","abnf","accesslog","actionscript","ada","angelscript","apache","applescript","arcade","arduino","armasm","xml","asciidoc","aspectj","autohotkey","autoit","avrasm","awk","axapta","bash","basic","bnf","brainfuck","c-like","c","cal","capnproto","ceylon","clean","clojure","clojure-repl","cmake","coffeescript","coq","cos","cpp","crmsh","crystal","csharp","csp","css","d","markdown","dart","delphi","diff","django","dns","dockerfile","dos","dsconfig","dts","dust","ebnf","elixir","elm","ruby","erb","erlang-repl","erlang","excel","fix","flix","fortran","fsharp","gams","gauss","gcode","gherkin","glsl","gml","go","golo","gradle","groovy","haml","handlebars","haskell","haxe","hsp","htmlbars","http","hy","inform7","ini","irpf90","isbl","java","javascript","jboss-cli","json","julia","julia-repl","kotlin","lasso","latex","ldif","leaf","less","lisp","livecodeserver","livescript","llvm","lsl","lua","makefile","mathematica","matlab","maxima","mel","mercury","mipsasm","mizar","perl","mojolicious","monkey","moonscript","n1ql","nginx","nim","nix","node-repl","nsis","objectivec","ocaml","openscad","oxygene","parser3","pf","pgsql","php","php-template","plaintext","pony","powershell","processing","profile","prolog","properties","protobuf","puppet","purebasic","python","python-repl","q","qml","r","reasonml","rib","roboconf","routeros","rsl","ruleslanguage","rust","sas","scala","scheme","scilab","scss","shell","smali","smalltalk","sml","sqf","sql_more","sql","stan","stata","step21","stylus","subunit","swift","taggerscript","yaml","tap","tcl","thrift","tp","twig","typescript","vala","vbnet","vbscript","vbscript-html","verilog","vhdl","vim","x86asm","xl","xquery","zephir"]},96086:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MentionInput=t.WHITE_SPACE_TEXT=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(81878),p=e(89195),v=e(70392),m=n.__importDefault(e(97599)),_=e(80732),s=e(44692);t.WHITE_SPACE_TEXT=" ";const g=({mentionItems:l=[],onSend:h,onStop:u,loading:d=!1,mentionKeyword:E=s.MENTION_KEYWORD,onSelectionChange:f,onImageUpload:a,labelService:b,workspaceService:y,placeholder:A="Ask anything, @ to mention",footerConfig:S={buttons:[],showModelSelector:!1}})=>{const w=o.useRef(null),[T,D]=o.useState({active:!1,startPos:null,filter:"",position:{top:0,left:0},activeIndex:0,level:0,parentType:null,secondLevelFilter:"",inlineSearchActive:!1,inlineSearchStartPos:null,loading:!1}),[I,O]=o.useState(S.defaultModel||""),[M,R]=o.useState({}),[P,k]=o.useState([]),[F,L]=o.useState(-1),[B,j]=o.useState(""),[W,U]=o.useState(!1),Q=()=>T.level===0?l:T.parentType?T.loading?M[T.parentType]||[]:M[T.parentType]||[]:[],$=((Ee,_e)=>{const[te,ge]=o.useState(Ee);return o.useEffect(()=>{const Te=setTimeout(()=>{ge(Ee)},_e);return()=>{clearTimeout(Te)}},[Ee,_e]),te})(T.secondLevelFilter,300);o.useEffect(()=>{if(T.level===1&&T.parentType&&$!==void 0){const Ee=l.find(te=>te.id===T.parentType);if(!Ee)return;D(te=>({...te,loading:!0})),(async()=>{try{const te=[];if(Ee.getHighestLevelItems){const ge=Ee.getHighestLevelItems();for(const Te of ge)te.some(Pe=>Pe.id===Te.id)||te.push(Te);R(Te=>({...Te,[T.parentType]:ge}))}if(Ee.getItems)try{const ge=await Ee.getItems($),Te=[...te];for(const Pe of ge)Te.some(Ae=>Ae.id===Pe.id)||Te.push(Pe);R(Pe=>({...Pe,[T.parentType]:Te}))}catch{D(Te=>({...Te,loading:!1}))}D(ge=>({...ge,loading:!1}))}catch{D(ge=>({...ge,loading:!1}))}})()}},[$,T.level,T.parentType]);const Y=Ee=>{const _e=window.getSelection();if(!_e||!_e.rangeCount)return 0;const te=_e.getRangeAt(0),ge=te.cloneRange();return ge.selectNodeContents(Ee),ge.setEnd(te.endContainer,te.endOffset),ge.toString().length},z=()=>{W&&(U(!1),L(-1));const Ee=window.getSelection();if(!Ee||!Ee.rangeCount||!w.current)return;const _e=w.current.textContent||"",te=Y(w.current);if(_e[te-1]===E&&!T.active&&!T.inlineSearchActive&&D({active:!0,startPos:te,filter:E,position:{top:0,left:0},activeIndex:0,level:0,parentType:null,secondLevelFilter:"",inlineSearchActive:!1,inlineSearchStartPos:null,loading:!1}),T.active&&T.level===0&&T.startPos!==null)if(te<T.startPos)D(ge=>({...ge,active:!1}));else{const ge=_e.substring(T.startPos-1,te);D(Te=>({...Te,filter:ge,activeIndex:0}))}if(T.inlineSearchActive&&T.inlineSearchStartPos!==null&&T.parentType){const ge=l.find(Ae=>Ae.id===T.parentType);if(!ge)return;const Te=`@${ge.type}:`,Pe=T.inlineSearchStartPos-Te.length;if(Pe>=0&&te>Pe+Te.length){const Ae=_e.substring(Pe+Te.length,te);Ae!==T.secondLevelFilter&&D(we=>({...we,secondLevelFilter:Ae,active:!0,activeIndex:0}))}else te<=Pe&&D(Ae=>({...Ae,inlineSearchActive:!1,active:!1}))}if(w.current&&(w.current.scrollHeight>120?w.current.style.overflowY="auto":w.current.style.overflowY="hidden"),w.current){const ge=w.current.innerHTML;(ge===""||ge==="<br>"||ge==="<br/>")&&(w.current.innerHTML="")}},H=Ee=>{if(Ee.key==="Escape"&&(T.active||T.inlineSearchActive)){T.level>0?D(te=>({...te,level:0,activeIndex:0,secondLevelFilter:"",inlineSearchActive:!1})):D(te=>({...te,active:!1,inlineSearchActive:!1})),Ee.preventDefault();return}if(Ee.key===s.MENTION_KEYWORD&&!T.active&&!T.inlineSearchActive&&w.current){const te=Y(w.current);D({active:!0,startPos:te+1,filter:E,position:{top:0,left:0},activeIndex:0,level:0,parentType:null,secondLevelFilter:"",inlineSearchActive:!1,inlineSearchStartPos:null,loading:!1})}if((Ee.key==="ArrowUp"||Ee.key==="ArrowDown")&&!Ee.shiftKey&&!Ee.ctrlKey&&!Ee.metaKey&&!Ee.altKey){if(!T.active&&!T.inlineSearchActive&&w.current&&P.length>0){const te=w.current.innerHTML;if(!te||te==="<br>"||W&&F>=0&&P[P.length-1-F]===te){Ee.preventDefault(),W||(j(te),U(!0));let Te=F;Ee.key==="ArrowUp"?Te=Math.min(P.length-1,F+1):Te=Math.max(-1,F-1),L(Te),Te===-1?w.current.innerHTML=B:w.current.innerHTML=P[P.length-1-Te];const Pe=document.createRange();Pe.selectNodeContents(w.current),Pe.collapse(!1);const Ae=window.getSelection();Ae&&(Ae.removeAllRanges(),Ae.addRange(Pe));return}}}else W&&Ee.key!=="ArrowUp"&&Ee.key!=="ArrowDown"&&(U(!1),L(-1));if(Ee.key==="Enter"){if(Ee.nativeEvent.isComposing)return;if(!Ee.shiftKey&&(Ee.preventDefault(),!T.active)){le();return}}if(!T.active)return;let _e=Q();if(T.level===0&&T.filter&&T.filter.length>1){const te=T.filter.substring(1).toLowerCase();_e=_e.filter(ge=>ge.text.toLowerCase().includes(te))}_e.length!==0&&(Ee.key==="ArrowDown"?(D(te=>({...te,activeIndex:(te.activeIndex+1)%_e.length})),Ee.preventDefault()):Ee.key==="ArrowUp"?(D(te=>({...te,activeIndex:(te.activeIndex-1+_e.length)%_e.length})),Ee.preventDefault()):(Ee.key==="Enter"||Ee.key==="Tab")&&_e.length>0&&(ie(_e[T.activeIndex]),Ee.preventDefault()))},K=()=>{},Z=async Ee=>{const _e=Ee.clipboardData.items,te=[];for(let fe=0;fe<_e.length;fe++)if(_e[fe].kind==="file"&&_e[fe].type.startsWith("image/")){const xe=_e[fe].getAsFile();xe&&te.push(xe)}if(Ee.preventDefault(),te.length>0&&a){await a(te);return}const Te=Ee.clipboardData.getData("text/plain").replace(/\t/g," ").replace(/\n\s*\n/g,`
|
|
31267
31267
|
|
|
31268
31268
|
`).replace(/[ \t]+$/gm,""),Pe=window.getSelection();if(!Pe||!Pe.rangeCount)return;const Ae=Pe.getRangeAt(0);Ae.deleteContents();const we=Te.split(`
|
|
31269
31269
|
`),be=document.createDocumentFragment();we.forEach((fe,xe)=>{const Re=fe.replace(/^[ ]+/g,me=>{const re=document.createElement("span");return re.innerHTML="\xA0".repeat(me.length),re.innerHTML}),Be=document.createElement("span");for(Be.innerHTML=Re;Be.firstChild;)be.appendChild(Be.firstChild);xe<we.length-1&&be.appendChild(document.createElement("br"))}),Ae.insertNode(be),Ae.setStartAfter(be),Ae.setEndAfter(be),Pe.removeAllRanges(),Pe.addRange(Ae),z()};o.useEffect(()=>{w.current&&A&&!w.current.textContent&&w.current.setAttribute("data-placeholder",A)},[A]);const X=Ee=>{var _e;T.active&&!(!((_e=document.querySelector(`.${m.default.mention_panel}`))===null||_e===void 0)&&_e.contains(Ee.target))&&D(te=>({...te,active:!1,inlineSearchActive:!1}))};o.useEffect(()=>(document.addEventListener("click",X,!0),()=>{document.removeEventListener("click",X,!0)}),[T.active]);const ie=(Ee,_e=!1)=>{var te;if(!w.current)return;if(Ee.getItems){const me=window.getSelection();if(!me||!me.rangeCount)return;if(T.level===0&&T.startPos!==null){let re,he,Oe;const Se=document.createTreeWalker(w.current,NodeFilter.SHOW_TEXT);let Fe=0,Ge;for(;Ge=Se.nextNode();){const Ke=((te=Ge.textContent)===null||te===void 0?void 0:te.length)||0;if(T.startPos-1>=Fe&&T.startPos-1<Fe+Ke){re=Ge,he=T.startPos-1-Fe;const ft=_e?T.startPos+T.filter.length-1:Y(w.current);Oe=Math.min(ft-Fe,Ke);break}Fe+=Ke}if(re){const Ke=document.createRange();Ke.setStart(re,he),Ke.setEnd(re,Oe),Ke.deleteContents();const ft=document.createTextNode(`${E}${Ee.type}:`);Ke.insertNode(ft);const ot=document.createRange();ot.setStartAfter(ft),ot.setEndAfter(ft),me.removeAllRanges(),me.addRange(ot),D(Mt=>({...Mt,active:!0,level:1,parentType:Ee.id,inlineSearchActive:!0,inlineSearchStartPos:Y(w.current),secondLevelFilter:"",activeIndex:0})),w.current.focus();return}}return}const ge=window.getSelection();if(!ge||!ge.rangeCount)return;if(T.inlineSearchActive&&T.parentType&&T.inlineSearchStartPos!==null){const me=l.find(Oe=>Oe.id===T.parentType);if(!me)return;const re=`${E}${me.type}:`,he=T.inlineSearchStartPos-re.length;if(he>=0){let lt=function(At){if(At.nodeType===3)Mt.push({node:At,start:ft,end:ft+At.textContent.length}),ft+=At.textContent.length;else if(At.nodeType===1){const rt=At.childNodes||[];for(const st of Array.from(rt))lt(st)}};const Oe=document.createElement("span");if(Oe.className=m.default.mention_tag,Oe.dataset.id=Ee.id,Oe.dataset.type=Ee.type,Oe.dataset.contextId=Ee.contextId||"",Oe.contentEditable="false",Ee.type==="file"||Ee.type==="folder"){const At=document.createElement("span");At.className=(0,r.default)(m.default.mention_icon,Ee.type==="file"?b?.getIcon(new v.URI(Ee.text)):(0,c.getIcon)("folder")),Oe.appendChild(At)}const Se=y?.workspace;let Fe=Ee.text;Se&&Ee.contextId&&(Fe=Ee.contextId.replace(new v.URI(Se.uri).codeUri.fsPath,"").slice(1));const Ge=document.createTextNode(Fe);Oe.appendChild(Ge);const Ke=document.createRange();let ft=0,ot=!1;const Mt=[];lt(w.current);for(const At of Mt){if(he>=At.start&&he<=At.end){const rt=he-At.start;Ke.setStart(At.node,rt),ot=!0}if(ot){const rt=_e?he+re.length+T.secondLevelFilter.length:Y(w.current);if(rt>=At.start&&rt<=At.end){const st=rt-At.start;Ke.setEnd(At.node,st);break}}}if(ot){Ke.deleteContents(),Ke.insertNode(Oe);const At=document.createRange();At.setStartAfter(Oe),At.setEndAfter(Oe),ge.removeAllRanges(),ge.addRange(At);const rt=document.createTextNode("\xA0");At.insertNode(rt),At.setStartAfter(rt),At.setEndAfter(rt),ge.removeAllRanges(),ge.addRange(At)}D(At=>({...At,active:!1,inlineSearchActive:!1})),w.current.focus();return}}const Te=document.createElement("span");if(Te.className=m.default.mention_tag,Te.dataset.id=Ee.id,Te.dataset.type=Ee.type,Te.dataset.contextId=Ee.contextId||"",Te.contentEditable="false",Ee.type==="file"||Ee.type==="folder"){const me=document.createElement("span");me.className=(0,r.default)(m.default.mention_icon,Ee.type==="file"?b?.getIcon(new v.URI(Ee.text)):(0,c.getIcon)("folder")),Te.appendChild(me)}const Pe=y?.workspace;let Ae=Ee.text;Pe&&Ee.contextId&&(Ae=Ee.contextId.replace(new v.URI(Pe.uri).codeUri.fsPath,"").slice(1));const we=document.createTextNode(Ae);Te.appendChild(we);let be=0,fe=!1;const xe=[];function Re(me){if(me.nodeType===3)xe.push({node:me,start:be,end:be+me.textContent.length}),be+=me.textContent.length;else if(me.nodeType===1){const re=me.childNodes;for(const he of Array.from(re))Re(he)}}Re(w.current);const Be=document.createRange();if(T.startPos!==null)for(const me of xe){if(T.startPos-1>=me.start&&T.startPos-1<=me.end){const re=T.startPos-1-me.start;Be.setStart(me.node,re),fe=!0}if(fe){const re=_e?T.startPos+T.filter.length-1:Y(w.current);if(re>=me.start&&re<=me.end){const he=re-me.start;Be.setEnd(me.node,he);break}}}if(fe){Be.deleteContents(),Be.insertNode(Te);const me=document.createRange();me.setStartAfter(Te),me.setEndAfter(Te),ge.removeAllRanges(),ge.addRange(me);const re=document.createTextNode("\xA0");me.insertNode(re),me.setStartAfter(re),me.setEndAfter(re),ge.removeAllRanges(),ge.addRange(me)}D(me=>({...me,active:!1})),w.current.focus()},oe=o.useCallback(Ee=>{O(Ee),f?.(Ee)},[I,f]),le=()=>{if(!w.current)return;const Ee=w.current.innerHTML;if(!Ee)return;const _e=document.createElement("div");_e.innerHTML=Ee,_e.querySelectorAll(`.${m.default.mention_tag}`).forEach(Te=>{var Pe;const Ae=Te.getAttribute("data-context-id");if(Ae){const we=document.createTextNode(`{{${E}${Te.getAttribute("data-type")}:${Ae}}}`);(Pe=Te.parentNode)===null||Pe===void 0||Pe.replaceChild(we,Te)}});let ge=_e.innerHTML;ge=ge.trim().replaceAll(t.WHITE_SPACE_TEXT," "),Ee&&(k(Te=>[...Te,Ee]),L(-1),U(!1)),h&&h(ge,{model:I,...S}),w.current.innerHTML="",w.current&&(w.current.style.overflowY="hidden",w.current.style.height="auto")},pe=o.useCallback(()=>{u&&u()},[u]),q=o.useCallback(Ee=>(S.buttons||[]).filter(_e=>_e.position===Ee).map(_e=>o.createElement(c.Popover,{key:_e.id,overlayClassName:m.default.popover_icon,id:`ai-chat-${_e.id}`,position:c.PopoverPosition.top,title:_e.title},o.createElement(p.EnhanceIcon,{className:(0,r.default)(_e.icon?(0,c.getIcon)(_e.icon):_e.iconClass,m.default[`${_e.id}_logo`]),tabIndex:0,role:"button",ariaLabel:_e.title,onClick:_e.onClick}))),[S.buttons]);return o.createElement("div",{className:m.default.input_container},T.active&&o.createElement("div",{className:m.default.mention_panel_container},o.createElement(_.MentionPanel,{items:Q(),activeIndex:T.activeIndex,onSelectItem:Ee=>ie(Ee,!0),position:{top:0,left:0},filter:T.level===0?T.filter:T.secondLevelFilter,visible:!0,level:T.level,loading:T.loading})),o.createElement("div",{className:m.default.editor_area},o.createElement("div",{ref:w,className:m.default.editor,contentEditable:!0,onInput:z,onKeyDown:H,onPaste:Z,onCompositionEnd:K})),o.createElement("div",{className:m.default.footer},o.createElement("div",{className:m.default.left_control},S.showModelSelector&&o.createElement(c.Select,{options:S.modelOptions||[],value:I,onChange:oe,className:m.default.model_selector,size:"small"}),q(s.FooterButtonPosition.LEFT)),o.createElement("div",{className:m.default.right_control},q(s.FooterButtonPosition.RIGHT),o.createElement(c.Popover,{overlayClassName:m.default.popover_icon,id:"ai-chat-send",position:c.PopoverPosition.top,content:d?"Stop":"Send"},d?o.createElement(p.EnhanceIcon,{wrapperClassName:m.default.stop_logo,className:(0,r.default)((0,c.getIcon)("stop"),m.default.stop_logo_icon),tabIndex:0,role:"button",ariaLabel:"Stop",onClick:pe}):o.createElement(p.EnhanceIcon,{wrapperClassName:m.default.send_logo,className:(0,r.default)((0,c.getIcon)("send-outlined"),m.default.send_logo_icon),tabIndex:0,role:"button",onClick:le,ariaLabel:"Send"})))))};t.MentionInput=g},40167:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MentionItem=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(81878),p=n.__importDefault(e(97599)),v=({item:m,isActive:_,onClick:s})=>o.createElement("div",{className:`${p.default.mention_item} ${_?p.default.active:""}`,onClick:()=>s(m)},o.createElement("div",{className:p.default.mention_item_left},o.createElement(c.Icon,{className:(0,r.default)(p.default.mention_item_icon,m.icon)}),o.createElement("span",{className:p.default.mention_item_text},m.text),o.createElement("span",{className:p.default.mention_item_description},m.description)),m.getItems&&o.createElement(c.Icon,{className:(0,r.default)(p.default.mention_item_right,(0,c.getIcon)("arrowright"))}));t.MentionItem=v},80732:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MentionPanel=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=n.__importDefault(e(97599)),c=e(40167),p=({items:v,activeIndex:m,onSelectItem:_,position:s,filter:g,visible:l,level:h,loading:u=!1})=>{const d=r.useRef(null);if(r.useEffect(()=>{if(l&&d.current){const a=d.current.querySelector(`.${o.default.mention_item}.${o.default.active}`);a&&a.scrollIntoView({block:"nearest"})}},[m,l]),!l)return null;const f=(()=>{let a=v;if(h===0){if(g&&g.length>1){const b=g.substring(1).toLowerCase();a=v.filter(y=>y.text.toLowerCase().includes(b))}}else g&&g.length>0&&(a=v.filter(b=>b.text.toLowerCase().includes(g.toLowerCase())));return a})();return h===0&&f.length===0?null:r.createElement("div",{ref:d,className:o.default.mention_panel,style:{top:s.top,left:s.left}},u&&r.createElement("div",{className:o.default.loading_bar}),v.length>0?r.createElement("ul",{className:o.default.mention_list},v.map((a,b)=>r.createElement(c.MentionItem,{key:a.id,item:a,isActive:b===m,onClick:()=>_(a,!0)}))):r.createElement("div",{className:o.default.no_results},u?"\u6B63\u5728\u641C\u7D22...":"\u65E0\u5339\u914D\u7ED3\u679C"))};t.MentionPanel=p},44692:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MENTION_KEYWORD=t.MentionType=t.FooterButtonPosition=void 0;var e;(function(r){r.LEFT="left",r.RIGHT="right"})(e||(t.FooterButtonPosition=e={}));var n;(function(r){r.FILE="file",r.FOLDER="folder",r.CODE="code"})(n||(t.MentionType=n={})),t.MENTION_KEYWORD="@"},78048:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractIcon=t.createMessageByAI=t.createMessageByUser=void 0;const n=e(41869),r="",o=m=>({...m,type:"text",className:`${m.position==="left"?"rce-ai-msg":"rce-user-msg"} ${m.className?m.className:""}`}),c=(m,_)=>o({...m,position:"right",title:r,className:_,role:1});t.createMessageByUser=c;const p=(m,_)=>o({...m,position:"left",title:"",className:_,role:2});t.createMessageByAI=p;const v=m=>{let{title:_}=m;const{message:s,tooltip:g}=m;let l=m.icon||"";if(!_)return{icon:l,title:s,message:s,tooltip:g};const h=_.match(/^\$\(([a-z.]+\/)?([a-z0-9-]+)(~[a-z]+)?\)/i);if(h){const[u,d,E,f]=h,a=d?d.slice(0,-1):n.CODICON_OWNER;l=(0,n.getExternalIcon)(E,a),f&&(l+=` ${f.slice(1)}`),_=_.slice(u.length)}return{icon:l,title:_,message:s,tooltip:g}};t.extractIcon=v},19957:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LlmContextContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(46044);let p=class{initialize(){this.llmContextService.startAutoCollection()}};t.LlmContextContribution=p,n.__decorate([(0,r.Autowired)(c.LLMContextServiceToken),n.__metadata("design:type",Object)],p.prototype,"llmContextService",void 0),t.LlmContextContribution=p=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],p)},63536:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LLMContextServiceImpl=void 0;const n=e(85608),r=e(76003),o=e(11050),c=e(25234),p=e(19083),v=e(86560),m=e(96689),_=e(82196),s=e(14951),g=e(6287),l=e(20868);let h=class extends c.WithEventBus{constructor(){super(...arguments),this.isAutoCollecting=!1,this.contextVersion=0,this.maxAttachFilesLimit=10,this.maxAttachFoldersLimit=10,this.maxViewFilesLimit=20,this.attachedFiles=[],this.attachedFolders=[],this.recentlyViewFiles=[],this.onDidContextFilesChangeEmitter=new v.Emitter,this.onDidContextFilesChangeEvent=this.onDidContextFilesChangeEmitter.event}addFileToList(d,E,f){const a=E.findIndex(b=>b.uri.toString()===d.uri.toString());a>-1&&E.splice(a,1),E.push(d),E.length>f&&E.shift()}addFolderToList(d,E,f){const a=E.findIndex(b=>b.uri.toString()===d.uri.toString());a>-1&&E.splice(a,1),E.push(d),E.length>f&&E.shift()}addFileToContext(d,E,f=!1){if(!d)return;const a={uri:d,selection:E},b=f?this.attachedFiles:this.recentlyViewFiles,y=f?this.maxAttachFilesLimit:this.maxViewFilesLimit;f&&this.docModelManager.createModelReference(d),this.addFileToList(a,b,y),this.notifyContextChange()}addFolderToContext(d){if(!d)return;const E={uri:d};this.addFolderToList(E,this.attachedFolders,this.maxAttachFoldersLimit),this.notifyContextChange()}notifyContextChange(){this.onDidContextFilesChangeEmitter.fire(this.getAllContextFiles())}cleanFileContext(){this.attachedFiles=[],this.attachedFolders=[],this.notifyContextChange()}getAllContextFiles(){return{viewed:this.recentlyViewFiles,attached:this.attachedFiles,attachedFolders:this.attachedFolders,version:this.contextVersion++}}removeFileFromContext(d,E=!1){const f=E?this.attachedFiles:this.recentlyViewFiles,a=f.findIndex(b=>b.uri.toString()===d.toString());a>-1&&f.splice(a,1),this.notifyContextChange()}startAutoCollection(){this.isAutoCollecting||(this.isAutoCollecting=!0,this.startAutoCollectionInternal())}startAutoCollectionInternal(){this.disposables.push(this.eventBus.on(m.EditorDocumentModelCreationEvent,d=>{d.payload.uri.scheme==="file"&&this.addFileToContext(d.payload.uri,void 0,!1)})),this.disposables.push(this.eventBus.on(m.EditorDocumentModelRemovalEvent,d=>{d.payload.scheme==="file"&&this.removeFileFromContext(d.payload,!1)})),this.disposables.push(this.eventBus.on(m.EditorDocumentModelSavedEvent,d=>{d.payload.scheme})),this.disposables.push(this.eventBus.on(_.EditorSelectionChangeEvent,d=>{if(d.payload.selections.length>0){const E=[d.payload.selections[0].selectionStartLineNumber,d.payload.selections[0].positionLineNumber].sort();E[0]===E[1]?this.addFileToContext(d.payload.editorUri,void 0,!1):this.addFileToContext(d.payload.editorUri,E.sort((f,a)=>f-a),!1)}}))}stopAutoCollection(){this.dispose()}async serialize(){const d=this.getAllContextFiles(),E=v.URI.file(this.appConfig.workspaceDir);return{recentlyViewFiles:this.serializeRecentlyViewFiles(d.viewed,E),attachedFiles:this.serializeAttachedFiles(d.attached,E),attachedFolders:await this.serializeAttachedFolders(d.attachedFolders,E)}}async serializeAttachedFolders(d,E){const f=Array.from(new Set(d.map(a=>a.uri.toString())));return Promise.all(f.map(async a=>{var b;const y=new v.URI(a);return`\`\`\`
|
|
@@ -31515,7 +31515,7 @@ ${a}`)}return this.keybindingsChanged.fire({affectsCommands:[E.command]}),{dispo
|
|
|
31515
31515
|
}
|
|
31516
31516
|
`}async selectDebugType(){const y=this.workbenchEditorService.currentEditor;if(!y)return;const A=y.currentDocumentModel;if(!A)return;const S=await this.debug.getDebuggersForLanguage(A.languageId);return this.quickPick.show(S.map(({label:w,type:T})=>({label:w,value:T}),{placeholder:"Select Environment"}))}async load(){await this.whenReady;const y=this.debugConfigurationStorage.get("configurations");y&&y.current&&(this.current=this.find(y.current.name,y.current.workspaceFolderUri,y.current.index))}async save(){const y={},{current:A}=this;A&&(y.current={name:A.configuration.name,workspaceFolderUri:A.workspaceFolderUri,index:A.index}),await this.debugConfigurationStorage.set("configurations",y)}canSetBreakpointsIn(y){if(!y)return!1;const A=y.getLanguageId();return!A||A==="jsonc"||A==="log"?!1:this.debugPreferences["preference.debug.allowBreakpointsEverywhere"]?!0:this.breakpointModeIdsSet.has(A)}addSupportBreakpoints(y){this.breakpointModeIdsSet.add(y)}removeSupportBreakpoints(y){this.breakpointModeIdsSet.delete(y)}registerDebugger(y){if(y.type!=="*"){if(this.getDebugger(y.type))return;this.debuggers.push(y)}}getDebugger(y){return this.debuggers.filter(A=>A.type===y).pop()}getDebuggers(){return this.debuggers.filter(y=>!!y)}getDebuggerLabel(y){const A=this.internalDebugConfigurationOverride.get(y);if(A)return A.label||y;const S=this.internalDebugConfigurationProviders.get(y);if(S)return S.label||y;const w=this.getDebugger(y);if(w)return w.label||y}getDebuggerExtraPopupHint(y){const A=this.internalDebugConfigurationOverride.get(y);if(A)return A.popupHint||void 0;const S=this.internalDebugConfigurationProviders.get(y);if(S)return S.popupHint||void 0}};t.DebugConfigurationManager=a,a.DEFAULT_UPDATE_MODEL_TIMEOUT=500,r.__decorate([(0,c.Autowired)(g.IWorkspaceService),r.__metadata("design:type",Object)],a.prototype,"workspaceService",void 0),r.__decorate([(0,c.Autowired)(v.WorkbenchEditorService),r.__metadata("design:type",v.WorkbenchEditorService)],a.prototype,"workbenchEditorService",void 0),r.__decorate([(0,c.Autowired)(u.IDebugServer),r.__metadata("design:type",Object)],a.prototype,"debug",void 0),r.__decorate([(0,c.Autowired)(s.QuickPickService),r.__metadata("design:type",Object)],a.prototype,"quickPick",void 0),r.__decorate([(0,c.Autowired)(p.IContextKeyService),r.__metadata("design:type",Object)],a.prototype,"contextKeyService",void 0),r.__decorate([(0,c.Autowired)(_.IFileServiceClient),r.__metadata("design:type",Object)],a.prototype,"filesystem",void 0),r.__decorate([(0,c.Autowired)(p.PreferenceService),r.__metadata("design:type",Object)],a.prototype,"preferences",void 0),r.__decorate([(0,c.Autowired)(p.PreferenceConfigurations),r.__metadata("design:type",p.PreferenceConfigurations)],a.prototype,"preferenceConfigurations",void 0),r.__decorate([(0,c.Autowired)(l.WorkspaceVariableContribution),r.__metadata("design:type",l.WorkspaceVariableContribution)],a.prototype,"workspaceVariables",void 0),r.__decorate([(0,c.Autowired)(p.StorageProvider),r.__metadata("design:type",Function)],a.prototype,"storageProvider",void 0),r.__decorate([(0,c.Autowired)(p.CommandService),r.__metadata("design:type",Object)],a.prototype,"commandService",void 0),r.__decorate([(0,c.Autowired)(f.DebugPreferences),r.__metadata("design:type",Object)],a.prototype,"debugPreferences",void 0),r.__decorate([(0,c.Autowired)(m.IEditorDocumentModelService),r.__metadata("design:type",Object)],a.prototype,"documentService",void 0),r.__decorate([(0,c.Autowired)(m.EditorCollectionService),r.__metadata("design:type",m.EditorCollectionService)],a.prototype,"editorCollectionService",void 0),r.__decorate([(0,c.Autowired)(p.ILoggerManagerClient),r.__metadata("design:type",Object)],a.prototype,"loggerManagerClient",void 0),t.DebugConfigurationManager=a=n=r.__decorate([(0,c.Injectable)(),r.__metadata("design:paramtypes",[])],a)},11357:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConfigurationModel=void 0;const n=e(41869),r=e(64582);class o{constructor(p,v){this.workspaceFolderUri=p,this.preferences=v,this.onDidChangeEmitter=new n.Emitter,this.onDidChange=this.onDidChangeEmitter.event,this.toDispose=new n.DisposableCollection(this.onDidChangeEmitter),this.reconcile(),this.toDispose.push(this.preferences.onPreferenceChanged(m=>{m.preferenceName==="launch"&&m.affects(p)&&this.reconcile()}))}get uri(){return this.json.uri}dispose(){this.toDispose.dispose()}get onDispose(){return this.toDispose.onDispose}get configurations(){return this.json.configurations}async reconcile(){this.json=this.parseConfigurations(),this.onDidChangeEmitter.fire(void 0)}parseConfigurations(){const p=[],{configUri:v,value:m}=this.preferences.resolve("launch",void 0,this.workspaceFolderUri);if((0,n.isDefined)(m)&&"configurations"in m&&Array.isArray(m.configurations))for(const _ of m.configurations)r.DebugConfiguration.is(_)&&p.push(_);return{uri:v,configurations:p}}}t.DebugConfigurationModel=o},59053:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugContribution=t.DebugBreakpointWidgetCommands=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(21634),p=e(68456),v=e(93899),m=e(43718),_=e(57517),s=e(14951),g=e(2156),l=e(63067),h=e(24429),u=n.__importStar(e(20868)),d=e(64582),E=e(4983),f=e(99797),a=e(85815),b=e(17280),y=e(37499),A=e(31141),S=e(40453),w=e(69946),T=e(38029),D=e(52943),I=e(78606),O=n.__importDefault(e(96547)),M=e(97319),R=e(85347),P=e(16067),k=e(20676),F=e(96090),L=e(35199),B=e(32756),j=e(18028),W=e(28875),U=e(64611),Q=/launch\.json$/;var V;(function(z){z[z.json=0]="json",z[z.editor=1]="editor"})(V||(V={}));var $;(function(z){z.ACCEPT={id:"debug.breakpointWidget.accept"},z.CLOSE={id:"debug.breakpointWidget.close"}})($||(t.DebugBreakpointWidgetCommands=$={}));let Y=class{constructor(){this.schema=A.debugPreferencesSchema,this.firstSessionStart=!0,this.openedViewSessions=new Set}get selectedBreakpoint(){const{selectedBreakpoint:H}=this.breakpointManager;return H}registerEditorComponent(H){H.registerEditorSideWidget({id:d.DEBUG_FLOATING_CLICK_WIDGET,component:a.FloatingClickWidget,displaysOnResource:K=>{const{configUri:Z}=this.preferences.resolve("launch");return Z?Z.isEqual(K.uri)&&Q.test(K.uri.toString()):!1}})}registerComponent(H){H.register("@opensumi/ide-debug",[{component:U.DebugWatchView,id:d.DEBUG_WATCH_ID,name:(0,o.localize)("debug.watch.title"),when:`${E.CONTEXT_DEBUGGERS_AVAILABLE.equalsTo(!0)} || ${E.CONTEXT_IN_DEBUG_MODE.equalsTo(!0)}`,collapsed:!1},{component:j.DebugCallStackView,id:d.DEBUG_STACK_ID,name:(0,o.localize)("debug.callStack.title"),when:`${E.CONTEXT_DEBUGGERS_AVAILABLE.equalsTo(!0)} || ${E.CONTEXT_IN_DEBUG_MODE.equalsTo(!0)}`,collapsed:!1},{component:W.DebugVariableView,id:d.DEBUG_VARIABLES_ID,name:(0,o.localize)("debug.variables.title"),when:`${E.CONTEXT_DEBUGGERS_AVAILABLE.equalsTo(!0)} || ${E.CONTEXT_IN_DEBUG_MODE.equalsTo(!0)}`,collapsed:!1},{component:R.DebugBreakpointView,id:d.DEBUG_BREAKPOINTS_ID,name:(0,o.localize)("debug.breakpoints.title"),when:`${E.CONTEXT_DEBUGGERS_AVAILABLE.equalsTo(!0)} || ${E.CONTEXT_IN_DEBUG_MODE.equalsTo(!0)}`,collapsed:!1},{component:h.WelcomeView,id:d.DEBUG_WELCOME_ID,name:"Debug Welcome",when:`${E.CONTEXT_DEBUGGERS_AVAILABLE.equalsTo(!1)} && ${E.CONTEXT_IN_DEBUG_MODE.equalsTo(!1)}`,initialProps:{viewId:d.DEBUG_WELCOME_ID}}],{iconClass:(0,o.getIcon)("debug"),priority:7,title:(0,o.localize)("debug.container.title"),containerId:d.DEBUG_CONTAINER_ID,titleComponent:k.DebugConfigurationContainerView,activateKeyBinding:"ctrlcmd+shift+d"})}async initialize(){this.fileSystem.registerProvider(d.DEBUG_SCHEME,this.shadowFileServiceProvider),this.debugEditorController.init(),this.debugProgressService.run(this.sessionManager)}onStart(){this.viewsRegistry.registerViewWelcomeContent(d.DEBUG_WELCOME_ID,{content:(0,o.formatLocalize)("welcome-view.noLaunchJson",o.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id,d.DEBUG_COMMANDS.SHOW_ALL_AUTOMATIC_DEBUG_CONFIGURATIONS.id),when:"default"}),this.sessionManager.onDidCreateDebugSession(H=>{this.debugModel.init(H)}),this.sessionManager.onDidStartDebugSession(H=>{const{internalConsoleOptions:K}=H.configuration,Z=H.configuration.openDebug||this.debugPreferences["debug.openDebug"];if(Z==="openOnSessionStart"||Z==="openOnFirstSessionStart")this.firstSessionStart&&this.openDebugView();else if(Z!=="neverOpen"){const X=H.parentSession,ie=X?.id||H.id;this.openedViewSessions.has(ie)||(this.openedViewSessions.add(ie),this.openDebugView())}(K==="openOnSessionStart"||K==="openOnFirstSessionStart"&&this.firstSessionStart)&&this.openDebugConsoleView(),this.firstSessionStart=!1,this.commandService.tryExecuteCommand("statusbar.changeBackgroundColor","var(--statusBar-debuggingBackground)"),this.commandService.tryExecuteCommand("statusbar.changeColor","var(--statusBar-debuggingForeground)")}),this.sessionManager.onDidStopDebugSession(H=>{const{openDebug:K}=H.configuration;K==="openOnDebugBreak"&&this.openDebugView()}),this.sessionManager.onDidDestroyDebugSession(()=>{this.sessionManager.sessions.length===0&&(this.commandService.tryExecuteCommand("statusbar.changeBackgroundColor","var(--statusBar-background)"),this.commandService.tryExecuteCommand("statusbar.changeColor"))}),this.configurations.whenReady.then(()=>{this.configurations.load(),this.configurations.onDidChange(()=>this.configurations.save())}),this.breakpointManager.load().then(()=>{this.breakpointManager.onDidChangeBreakpoints(()=>this.breakpointManager.save()),this.breakpointManager.onDidChangeExceptionsBreakpoints(()=>this.breakpointManager.save()),this.breakpointManager.onDidChangeMarkers(()=>this.breakpointManager.save())}),this.extensionsPointService.appendExtensionPoint(["browserViews","properties"],{extensionPoint:d.DEBUG_CONTAINER_ID,frameworkKind:["opensumi"],jsonSchema:{...c.browserViews.properties,description:(0,o.formatLocalize)("sumiContributes.browserViews.location.custom",(0,o.localize)("menu-bar.title.debug"))}})}openDebugView(){const H=this.mainlayoutService.getTabbarHandler(d.DEBUG_CONTAINER_ID);H&&!H.isVisible&&H.activate()}openDebugConsoleView(){this.debugConsole.isVisible||this.debugConsole.activate()}onDidRender(){const H=this.mainlayoutService.getTabbarHandler(d.DEBUG_CONTAINER_ID);H&&H.setTitleComponent(k.DebugConfigurationContainerView)}registerCommands(H){H.registerCommand(o.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION,{execute:(K=V.json)=>{if(K===V.editor)return this.debugConfigurationService.openLaunchEditor();this.debugConfigurationService.openConfiguration()}}),H.registerCommand(d.DEBUG_COMMANDS.REMOVE_ALL_BREAKPOINTS,{execute:()=>{this.debugBreakpointsService.removeAllBreakpoints()}}),H.registerCommand(d.DEBUG_COMMANDS.START,{execute:()=>{this.debugConfigurationService.start()}}),H.registerCommand(d.DEBUG_COMMANDS.STOP,{execute:()=>{this.debugToolbarService.doStop()}}),H.registerCommand(d.DEBUG_COMMANDS.NEXT,{execute:()=>{this.debugToolbarService.doStepIn()}}),H.registerCommand(d.DEBUG_COMMANDS.PREV,{execute:()=>{this.debugToolbarService.doStepOut()}}),H.registerCommand(d.DEBUG_COMMANDS.CONTINUE,{execute:()=>{this.debugToolbarService.doContinue()}}),H.registerCommand(d.DEBUG_COMMANDS.PAUSE,{execute:()=>{this.debugToolbarService.doPause()}}),H.registerCommand(d.DEBUG_COMMANDS.OVER,{execute:()=>{this.debugToolbarService.doStepOver()}}),H.registerCommand(d.DEBUG_COMMANDS.RESTART,{execute:()=>{this.debugToolbarService.doRestart()}}),H.registerCommand(d.DEBUG_COMMANDS.TOGGLE_BREAKPOINTS,{execute:()=>{this.debugBreakpointsService.toggleBreakpoints()}}),H.registerCommand(d.DEBUG_COMMANDS.ACTIVE_BREAKPOINTS,{execute:()=>{const{enable:K}=this.debugBreakpointsService;K.get()||this.debugBreakpointsService.toggleBreakpoints()}}),H.registerCommand(d.DEBUG_COMMANDS.DEACTIVE_BREAKPOINTS,{execute:()=>{const{enable:K}=this.debugBreakpointsService;K.get()&&this.debugBreakpointsService.toggleBreakpoints()}}),H.registerCommand(d.DEBUG_COMMANDS.EDIT_BREAKPOINT,{execute:async K=>{this.reporterService.point(d.DEBUG_REPORT_NAME===null||d.DEBUG_REPORT_NAME===void 0?void 0:d.DEBUG_REPORT_NAME.DEBUG_BREAKPOINT,"edit");const Z=this.debugEditorController.model;if(!Z)return;const{uri:X}=Z,ie=this.breakpointManager.getBreakpoint(X,K.lineNumber);ie&&(this.breakpointManager.selectedBreakpoint={breakpoint:ie,model:Z});const{selectedBreakpoint:oe}=this;if(oe){const{openBreakpointView:le}=oe.model;let pe="condition";if(oe.breakpoint){const q=oe.breakpoint.raw;q.condition?pe="condition":q.hitCondition?pe="hitCondition":q.logMessage&&(pe="logMessage")}le(K,oe.breakpoint&&oe.breakpoint.raw,pe)}},isVisible:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint}),H.registerCommand(d.DEBUG_COMMANDS.DISABLE_BREAKPOINT,{execute:async K=>{const{selectedBreakpoint:Z}=this;if(Z){const{uri:X}=Z.model,ie=this.breakpointManager.getBreakpoint(X,K.lineNumber);ie&&(ie.enabled=!1,this.breakpointManager.updateBreakpoint(ie))}},isVisible:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint&&this.selectedBreakpoint.breakpoint.enabled,isEnabled:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint&&this.selectedBreakpoint.breakpoint.enabled}),H.registerCommand(d.DEBUG_COMMANDS.ENABLE_BREAKPOINT,{execute:async K=>{const{selectedBreakpoint:Z}=this;if(Z){const{uri:X}=Z.model,ie=this.breakpointManager.getBreakpoint(X,K.lineNumber);ie&&(ie.enabled=!0,this.breakpointManager.updateBreakpoint(ie))}},isVisible:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint&&!this.selectedBreakpoint.breakpoint.enabled,isEnabled:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint&&!this.selectedBreakpoint.breakpoint.enabled}),H.registerCommand(d.DEBUG_COMMANDS.DELETE_BREAKPOINT,{execute:async K=>{const{selectedBreakpoint:Z}=this;if(Z){const{uri:X}=Z.model,ie=this.breakpointManager.getBreakpoint(X,K.lineNumber);ie&&this.breakpointManager.delBreakpoint(ie)}},isVisible:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint,isEnabled:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint}),H.registerCommand(d.DEBUG_COMMANDS.ADD_CONDITIONAL_BREAKPOINT,{execute:async K=>{const{selectedBreakpoint:Z}=this;if(Z){const{uri:X,openBreakpointView:ie,toggleBreakpoint:oe}=Z.model;oe(K);const le=this.breakpointManager.getBreakpoint(X,K.lineNumber);le&&(this.breakpointManager.selectedBreakpoint={breakpoint:le,model:Z.model}),ie(K,Z.breakpoint&&Z.breakpoint.raw,"condition")}},isVisible:()=>!!this.selectedBreakpoint&&!this.selectedBreakpoint.breakpoint,isEnabled:()=>!!this.selectedBreakpoint&&!this.selectedBreakpoint.breakpoint}),H.registerCommand(d.DEBUG_COMMANDS.ADD_LOGPOINT,{execute:async K=>{const{selectedBreakpoint:Z}=this;if(Z){const{openBreakpointView:X,toggleBreakpoint:ie,uri:oe}=Z.model;ie(K);const le=this.breakpointManager.getBreakpoint(oe,K.lineNumber);le&&(this.breakpointManager.selectedBreakpoint={breakpoint:le,model:Z.model}),X(K,Z.breakpoint&&Z.breakpoint.raw,"logMessage")}},isVisible:()=>!!this.selectedBreakpoint&&!this.selectedBreakpoint.breakpoint,isEnabled:()=>!!this.selectedBreakpoint&&!this.selectedBreakpoint.breakpoint}),H.registerCommand(d.DEBUG_COMMANDS.ADD_BREAKPOINT,{execute:async K=>{const{selectedBreakpoint:Z}=this;if(Z){const{toggleBreakpoint:X}=Z.model;X(K)}},isVisible:()=>!!this.selectedBreakpoint&&!this.selectedBreakpoint.breakpoint,isEnabled:()=>!!this.selectedBreakpoint&&!this.selectedBreakpoint.breakpoint}),H.registerCommand($.ACCEPT,{execute:()=>{const{selectedBreakpoint:K}=this;if(K){const{acceptBreakpoint:Z}=K.model;Z()}},isVisible:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint,isEnabled:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint}),H.registerCommand($.CLOSE,{execute:()=>{const{selectedBreakpoint:K}=this;if(K){const{closeBreakpointView:Z}=K.model;Z()}},isVisible:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint,isEnabled:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint}),H.registerCommand(d.DEBUG_COMMANDS.RUN_TO_CURSOR,{execute:K=>{this.debugRunToCursorService.run(K)},isEnabled:()=>this.debugContextKey.contextDebugState.get()==="Stopped"}),H.registerCommand(d.DEBUG_COMMANDS.FORCE_RUN_TO_CURSOR,{execute:K=>{this.debugRunToCursorService.run(K,!0)},isEnabled:()=>this.debugContextKey.contextDebugState.get()==="Stopped"}),H.registerCommand(d.DEBUG_COMMANDS.SHOW_ALL_AUTOMATIC_DEBUG_CONFIGURATIONS,{execute:async()=>{const K=await this.configurations.showDynamicConfigurationsTypesQuickPick();if(K)return await this.debugConfigurationService.showDynamicQuickPick(K)},isEnabled:()=>!0})}registerToolbarItems(H){H.registerItem({id:d.DEBUG_COMMANDS.REMOVE_ALL_BREAKPOINTS.id,command:d.DEBUG_COMMANDS.REMOVE_ALL_BREAKPOINTS.id,iconClass:(0,o.getIcon)("close-all"),viewId:d.DEBUG_BREAKPOINTS_ID,tooltip:(0,o.localize)("debug.breakpoint.removeAll")}),H.registerItem({id:d.DEBUG_COMMANDS.DEACTIVE_BREAKPOINTS.id,command:d.DEBUG_COMMANDS.DEACTIVE_BREAKPOINTS.id,iconClass:(0,o.getIcon)("deactivate-breakpoints"),viewId:d.DEBUG_BREAKPOINTS_ID,tooltip:(0,o.localize)("debug.breakpoint.deactive"),when:E.CONTEXT_ACTIVE_BREAKPOINTS.equalsTo(!0)}),H.registerItem({id:d.DEBUG_COMMANDS.ACTIVE_BREAKPOINTS.id,command:d.DEBUG_COMMANDS.ACTIVE_BREAKPOINTS.id,iconClass:`${(0,o.getIcon)("activate-breakpoints")} ${O.default.debug_activate_breakpoints_icon}`,viewId:d.DEBUG_BREAKPOINTS_ID,tooltip:(0,o.localize)("debug.breakpoint.active"),when:E.CONTEXT_ACTIVE_BREAKPOINTS.equalsTo(!1)})}registerSchema(H){H.registerSchema(d.launchDefaultSchemaUri,w.launchSchema,["launch.json"])}registerKeybindings(H){H.registerKeybinding({command:d.DEBUG_COMMANDS.START.id,keybinding:"f5",when:`!${E.CONTEXT_IN_DEBUG_MODE.raw}`}),H.registerKeybinding({command:d.DEBUG_COMMANDS.CONTINUE.id,keybinding:"f5",when:E.CONTEXT_IN_DEBUG_MODE.raw}),H.registerKeybinding({command:d.DEBUG_COMMANDS.STOP.id,keybinding:"shift+f5",when:E.CONTEXT_IN_DEBUG_MODE.raw}),H.registerKeybinding({command:d.DEBUG_COMMANDS.NEXT.id,keybinding:"f11",when:E.CONTEXT_IN_DEBUG_MODE.raw}),H.registerKeybinding({command:d.DEBUG_COMMANDS.PREV.id,keybinding:"shift+f11",when:E.CONTEXT_IN_DEBUG_MODE.raw}),H.registerKeybinding({command:d.DEBUG_COMMANDS.OVER.id,keybinding:"f10",when:E.CONTEXT_IN_DEBUG_MODE.raw}),H.registerKeybinding({command:d.DEBUG_COMMANDS.RESTART.id,keybinding:"shift+ctrlcmd+f5",when:E.CONTEXT_IN_DEBUG_MODE.raw}),H.registerKeybinding({command:$.ACCEPT.id,keybinding:"enter",when:E.CONTEXT_BREAKPOINT_INPUT_FOCUSED.raw}),H.registerKeybinding({command:$.CLOSE.id,keybinding:"esc",when:E.CONTEXT_BREAKPOINT_INPUT_FOCUSED.raw}),H.registerKeybinding({command:d.DEBUG_COMMANDS.EXCEPTION_WIDGET_CLOSE.id,keybinding:"esc",when:E.CONTEXT_EXCEPTION_WIDGET_VISIBLE.raw})}registerMenus(H){H.registerMenuItem(v.MenuId.DebugBreakpointsContext,{command:d.DEBUG_COMMANDS.DELETE_BREAKPOINT.id,group:"1_has_breakpoint",order:1}),H.registerMenuItem(v.MenuId.DebugBreakpointsContext,{command:d.DEBUG_COMMANDS.EDIT_BREAKPOINT.id,group:"1_has_breakpoint",order:2}),H.registerMenuItem(v.MenuId.DebugBreakpointsContext,{command:d.DEBUG_COMMANDS.DISABLE_BREAKPOINT.id,group:"1_has_breakpoint",order:3}),H.registerMenuItem(v.MenuId.DebugBreakpointsContext,{command:d.DEBUG_COMMANDS.ENABLE_BREAKPOINT.id,group:"1_has_breakpoint",order:4}),H.registerMenuItem(v.MenuId.DebugBreakpointsContext,{command:d.DEBUG_COMMANDS.ADD_BREAKPOINT.id,group:"2_has_not_breakpoint"}),H.registerMenuItem(v.MenuId.DebugBreakpointsContext,{command:d.DEBUG_COMMANDS.ADD_CONDITIONAL_BREAKPOINT.id,group:"2_has_not_breakpoint"}),H.registerMenuItem(v.MenuId.DebugBreakpointsContext,{command:d.DEBUG_COMMANDS.ADD_LOGPOINT.id,group:"2_has_not_breakpoint"}),H.registerMenuItem(v.MenuId.EditorContext,{command:{id:d.DEBUG_COMMANDS.RUN_TO_CURSOR.id,label:d.DEBUG_COMMANDS.RUN_TO_CURSOR.label||""},when:`${E.CONTEXT_IN_DEBUG_MODE.raw}`,group:"debug",order:2}),H.registerMenuItem(v.MenuId.EditorContext,{command:{id:d.DEBUG_COMMANDS.FORCE_RUN_TO_CURSOR.id,label:d.DEBUG_COMMANDS.FORCE_RUN_TO_CURSOR.label||""},when:`${E.CONTEXT_IN_DEBUG_MODE.raw}`,group:"debug",order:2}),H.registerMenuItem(v.MenuId.EditorTitle,{submenu:v.MenuId.EditorTitleRun,label:(0,o.localize)("debug.menu.title.run"),iconClass:(0,o.getIcon)("start"),group:"navigation",order:-1})}isPosition(H){return H instanceof u.Position}registerEditorFeature(H){let K;H.registerEditorFeatureContribution({contribute:Z=>(K=this.injector.get(D.DebugEditorContribution,[Z]),K.contribute(Z))}),(0,m.runWhenIdle)(()=>{K?.registerDecorationType()}),this.preferenceSettings.setEnumLabels("debug.console.filter.mode",{filter:(0,o.localize)("preference.debug.console.filter.mode.filter"),matcher:(0,o.localize)("preference.debug.console.filter.mode.matcher")})}};t.DebugContribution=Y,n.__decorate([(0,r.Autowired)(l.IMainLayoutService),n.__metadata("design:type",Object)],Y.prototype,"mainlayoutService",void 0),n.__decorate([(0,r.Autowired)(f.BreakpointManager),n.__metadata("design:type",f.BreakpointManager)],Y.prototype,"breakpointManager",void 0),n.__decorate([(0,r.Autowired)(y.DebugConfigurationManager),n.__metadata("design:type",y.DebugConfigurationManager)],Y.prototype,"configurations",void 0),n.__decorate([(0,r.Autowired)(d.IDebugModelManager),n.__metadata("design:type",Object)],Y.prototype,"debugEditorController",void 0),n.__decorate([(0,r.Autowired)(M.DebugBreakpointsService),n.__metadata("design:type",M.DebugBreakpointsService)],Y.prototype,"debugBreakpointsService",void 0),n.__decorate([(0,r.Autowired)(B.DebugViewModel),n.__metadata("design:type",B.DebugViewModel)],Y.prototype,"debugModel",void 0),n.__decorate([(0,r.Autowired)(A.DebugPreferences),n.__metadata("design:type",Object)],Y.prototype,"debugPreferences",void 0),n.__decorate([(0,r.Autowired)(L.DebugConsoleService),n.__metadata("design:type",L.DebugConsoleService)],Y.prototype,"debugConsole",void 0),n.__decorate([(0,r.Autowired)(P.DebugConfigurationService),n.__metadata("design:type",P.DebugConfigurationService)],Y.prototype,"debugConfigurationService",void 0),n.__decorate([(0,r.Autowired)(d.IDebugSessionManager),n.__metadata("design:type",T.DebugSessionManager)],Y.prototype,"sessionManager",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],Y.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(F.DebugToolbarService),n.__metadata("design:type",F.DebugToolbarService)],Y.prototype,"debugToolbarService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],Y.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],Y.prototype,"preferences",void 0),n.__decorate([(0,r.Autowired)(o.IReporterService),n.__metadata("design:type",Object)],Y.prototype,"reporterService",void 0),n.__decorate([(0,r.Autowired)(l.IViewsRegistry),n.__metadata("design:type",Object)],Y.prototype,"viewsRegistry",void 0),n.__decorate([(0,r.Autowired)(s.IShadowFileProvider),n.__metadata("design:type",Object)],Y.prototype,"shadowFileServiceProvider",void 0),n.__decorate([(0,r.Autowired)(s.IFileServiceClient),n.__metadata("design:type",g.FileServiceClient)],Y.prototype,"fileSystem",void 0),n.__decorate([(0,r.Autowired)(o.IPreferenceSettingsService),n.__metadata("design:type",Object)],Y.prototype,"preferenceSettings",void 0),n.__decorate([(0,r.Autowired)(S.DebugProgressService),n.__metadata("design:type",S.DebugProgressService)],Y.prototype,"debugProgressService",void 0),n.__decorate([(0,r.Autowired)(I.DebugRunToCursorService),n.__metadata("design:type",I.DebugRunToCursorService)],Y.prototype,"debugRunToCursorService",void 0),n.__decorate([(0,r.Autowired)(b.DebugContextKey),n.__metadata("design:type",b.DebugContextKey)],Y.prototype,"debugContextKey",void 0),n.__decorate([(0,r.Autowired)(m.IExtensionsSchemaService),n.__metadata("design:type",Object)],Y.prototype,"extensionsPointService",void 0),t.DebugContribution=Y=n.__decorate([(0,o.Domain)(o.ClientAppContribution,o.ComponentContribution,p.TabBarToolbarContribution,o.CommandContribution,o.KeybindingContribution,o.JsonSchemaContribution,o.PreferenceContribution,v.MenuContribution,_.BrowserEditorContribution)],Y)},84303:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugExceptionWidget=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=n.__importDefault(e(25873)),c=e(76003),p=e(41869),v=e(43718),m=e(20303),_=e(31324),s=e(58542);e(39889);function g({info:h,layout:u}){var d;const E=(0,p.useInjectable)(s.LinkDetector),f=(0,r.useRef)(null);return r.default.useEffect(()=>{var a;f.current&&f.current.appendChild(E.linkify(((a=h.details)===null||a===void 0?void 0:a.stackTrace)||"",!0)),u()},[h.details,(d=h.details)===null||d===void 0?void 0:d.stackTrace,f]),r.default.createElement("div",{className:"exception_widget"},r.default.createElement("div",{className:"title"},r.default.createElement("div",{className:"label"},h.id?(0,v.formatLocalize)("debug.widget.exception.thrownWithId",h.id):(0,v.localize)("debug.widget.exception.thrown"))),h.description?r.default.createElement("div",{className:"description"},h.description):null,h.details&&h.details.stackTrace?r.default.createElement("div",{className:"stack_trace",ref:f}):null)}let l=class extends m.ZoneWidget{constructor(u,d){super(u),this.exceptionInfo=d,this.create()}applyClass(){}applyStyle(){}_fillContainer(u){this.setCssClass("exception_widget_container");const d=this.editor.getOption(_.EditorOption.fontInfo);u.style.fontSize=`${d.fontSize}px`,u.style.lineHeight=`${d.lineHeight}px`,u.tabIndex=0,o.default.createRoot(u).render(r.default.createElement(p.ConfigProvider,{value:this.configContext},r.default.createElement(g,{info:this.exceptionInfo,layout:()=>this.layout(void 0)})))}layout(u){this._container.style.height="initial";const d=this.editor.getOption(_.EditorOption.lineHeight),E=Math.round(d/3),f=Math.ceil((this._container.offsetHeight+E)/d);this._relayout(f)}focus(){this._container.focus()}};t.DebugExceptionWidget=l,n.__decorate([(0,c.Autowired)(p.AppConfig),n.__metadata("design:type",Object)],l.prototype,"configContext",void 0),t.DebugExceptionWidget=l=n.__decorate([(0,c.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object])],l)},58542:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinkDetector=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(43718),p=e(54414),v=e(42933),m=n.__importDefault(e(80315)),_="\\u0000-\\u0020\\u007f-\\u009f",s=new RegExp("(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\\/\\/|data:|www\\.)[^\\s"+_+'"]{2,}[^\\s'+_+`"')}\\],:;.!?]`,"ug"),g=/(?:[a-zA-Z]:(?:(?:\\|\/)[\w\.-]*)+)/,l=/(?:(?:\~|\.)(?:(?:\\|\/)[\w\.-]*)+)/,h=new RegExp(`(${g.source}|${l.source})`),u=/((?:\~|\.)?(?:\/[\w\.-]*)+)/,d=/(?:\:([\d]+))?(?:\:([\d]+))?/,E=new RegExp(`${c.isWindows?h.source:u.source}${d.source}`,"g"),f=2e3;let a=class{linkify(y,A,S){if(A){const T=y.split(`
|
|
31517
31517
|
`);for(let O=0;O<T.length-1;O++)T[O]=T[O]+`
|
|
31518
|
-
`;T[T.length-1]||T.pop();const D=T.map(O=>this.linkify(O,!1,S));if(D.length===1)return D[0];const I=document.createElement("span");return D.forEach(O=>I.appendChild(O)),I}const w=document.createElement("span");for(const T of this.detectLinks(y))try{switch(T.kind){case"text":w.appendChild(document.createTextNode(T.value));break;case"web":w.appendChild(this.createWebLink(T.value));break;case"path":{const D=T.captures[0],I=T.captures[1]?Number(T.captures[1]):0,O=T.captures[2]?Number(T.captures[2]):0;w.appendChild(this.createPathLink(T.value,D,I,O,S));break}}}catch{w.appendChild(document.createTextNode(T.value))}return w}createWebLink(y){const A=this.createLink(y),S=c.URI.parse(y);return this.decorateLink(A,async()=>{if(S.scheme===o.Schemes.file){const w=S.toString(),T=o.OS.type()===c.OperatingSystem.Windows?c.path.win32:c.path.posix,D=c.path.normalize(T.sep===c.path.posix.sep&&c.isWindows?w.replace(/\\/g,c.path.posix.sep):w);await this.workbenchEditorService.open(c.URI.parse(D));return}this.openerService.open(y)}),A}createPathLink(y,A,S,w,T){if(A[0]==="/"&&A[1]==="/")return document.createTextNode(y);if(A[0]==="."){if(!T)return document.createTextNode(y);const O=T.toResource(A),M=this.createLink(y);return this.decorateLink(M,()=>{this.workbenchEditorService.open(c.URI.parse(O.toString()))}),M}const D=this.createLink(y);D.tabIndex=0;const I=c.URI.file(c.path.normalize(A));return this.fileServiceClient.getFileStat(I.toString()).then(O=>{!O||O&&O.isDirectory||this.decorateLink(D,()=>{this.workbenchEditorService.open(c.URI.parse(I.toString()),{range:{startColumn:w,startLineNumber:S,endLineNumber:S,endColumn:w}})})}),D}createLink(y){const A=document.createElement("a");return A.textContent=y,A}decorateLink(y,A){y.classList.add(m.default.link),y.title=(0,o.formatLocalize)("debug.console.followLink",c.isMacintosh?"Cmd":"Ctrl"),y.onmousemove=S=>{y.classList.toggle(m.default.pointer,c.isMacintosh?S.metaKey:S.ctrlKey)},y.onmouseleave=()=>y.classList.remove(m.default.pointer),y.onclick=S=>{const w=window.getSelection();!w||w.type==="Range"||(c.isMacintosh?S.metaKey:S.ctrlKey)&&(S.preventDefault(),S.stopImmediatePropagation(),A(!1))}}detectLinks(y){if(!y)return[];if(y.length>f)return[{kind:"text",value:y,captures:[]}];const A=[s,E],S=["web","path"],w=[],T=(D,I)=>{if(I>=A.length){w.push({value:D,kind:"text",captures:[]});return}const O=A[I];let M=0,R;for(O.lastIndex=0;(R=O.exec(D))!==null;){const k=D.substring(M,R.index);k&&T(k,I+1);const F=R[0];w.push({value:F,kind:S[I],captures:R.slice(1)}),M=R.index+F.length}const P=D.substring(M);P&&T(P,I+1)};return T(y,0),w}};t.LinkDetector=a,n.__decorate([(0,r.Autowired)(p.WorkbenchEditorService),n.__metadata("design:type",p.WorkbenchEditorService)],a.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],a.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(o.IOpenerService),n.__metadata("design:type",Object)],a.prototype,"openerService",void 0),t.LinkDetector=a=n.__decorate([(0,r.Injectable)({multiple:!0})],a)},61752:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugMemoryFileSystemProvider=void 0;const n=e(85608),r=n.__importDefault(e(17228)),o=e(76003),c=e(43718),p=e(64582),v=e(38029),{Path:m}=c.path;let _=class{constructor(){this.memoryFdCounter=0,this.changeEmitter=new c.Emitter,this.fdMemory=new Map,this.capabilities=1028,this.onDidChangeCapabilities=c.Event.None,this.onDidChangeFile=this.changeEmitter.event,this.emptyBuffer=this.toBuffer("")}stat(l){return Promise.resolve({type:c.FileType.File,uri:l.toString(),mtime:0,ctime:0,size:0,lastModification:0,isDirectory:!1})}async readFile(l){const h=this.parseUri(l);if(!h)return this.emptyBuffer;if(!h.offset)return this.emptyBuffer;const{session:u,memoryReference:d,offset:E}=h,f=new Uint8Array(E.toOffset-E.fromOffset),a=this.memoryFdCounter++;let b=u.getMemory(d);return E&&(b=new s(b,E)),this.fdMemory.set(a,{session:u,region:b}),await this.read(a,E.fromOffset,f,0,f.length),f}async read(l,h,u,d,E){const f=this.fdMemory.get(l);if(!f)return;const a=await f.region.read(h,E);let b=0;for(const y of a)switch(y.type){case 1:return b;case 2:return b>0?b:this.logger.error(y.error);case 0:{const A=Math.max(0,h-y.offset),S=y.data.slice(A,Math.min(y.data.byteLength,A+(E-b)));u.set(S.buffer,d+b),b+=S.byteLength;break}default:this.logger.log(y)}return b}toBuffer(l){return c.BinaryBuffer.fromString(l).buffer}parseUri(l){if(l.scheme!==p.DEBUG_MEMORY_SCHEME)return;const h=this.debugSessionManager.sessions.find(f=>f.id.toLowerCase()===l.authority.toLowerCase());if(!h)return;let u;const d=/range=([0-9]+):([0-9]+)/.exec(l.query);d&&(u={fromOffset:Number(d[1]),toOffset:Number(d[2])});const[,E]=l.path.split(m.separator);return{session:h,offset:u,readOnly:!h.capabilities.supportsWriteMemoryRequest,sessionId:l.authority,memoryReference:decodeURIComponent(E)}}readDirectory(){throw new Error("Not allowed")}createDirectory(){throw new Error("Not allowed")}rename(){throw new Error("Not allowed")}delete(){throw new Error("Not allowed")}watch(){throw new Error("Not allowed")}writeFile(){throw new Error("Method not implemented.")}};t.DebugMemoryFileSystemProvider=_,n.__decorate([(0,o.Autowired)(p.IDebugSessionManager),n.__metadata("design:type",v.DebugSessionManager)],_.prototype,"debugSessionManager",void 0),n.__decorate([(0,o.Autowired)(c.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),t.DebugMemoryFileSystemProvider=_=n.__decorate([(0,o.Injectable)()],_);class s extends c.Disposable{constructor(l,h){super(),this.parent=l,this.range=h,this.invalidateEmitter=new c.Emitter,this.onDidInvalidate=this.invalidateEmitter.event,this.width=this.range.toOffset-this.range.fromOffset,this.writable=l.writable,this.registerDispose(l),this.registerDispose(l.onDidInvalidate(u=>{const d=(0,r.default)(u.fromOffset-h.fromOffset,0,this.width),E=(0,r.default)(u.toOffset-h.fromOffset,0,this.width);E>d&&this.invalidateEmitter.fire({fromOffset:d,toOffset:E})}))}read(l,h){if(l<0)throw new RangeError(`Invalid fromOffset: ${l}`);return this.parent.read(this.range.fromOffset+l,this.range.fromOffset+Math.min(h,this.width))}write(l,h){return this.parent.write(this.range.fromOffset+l,h)}}},31141:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugPreferences=t.IDebugConfiguration=t.debugPreferencesSchema=void 0,t.createDebugPreferences=o,t.injectDebugPreferences=c;const n=e(41869);t.debugPreferencesSchema={type:"object",properties:{"debug.trace":{type:"boolean",default:!1,description:(0,n.localize)("preference.debug.trace")},"debug.debugViewLocation":{enum:["default","left","right","bottom"],default:"default",description:(0,n.localize)("preference.debug.debugViewLocation")},"debug.openDebug":{enum:["neverOpen","openOnSessionStart","openOnFirstSessionStart","openOnDebugBreak"],default:"openOnDebugBreak",description:(0,n.localize)("preference.debug.openDebug")},"debug.internalConsoleOptions":{enum:["neverOpen","openOnSessionStart","openOnFirstSessionStart"],default:"openOnFirstSessionStart",description:(0,n.localize)("preference.debug.internalConsoleOptions")},"debug.allowBreakpointsEverywhere":{type:"boolean",description:(0,n.localize)("preference.debug.allowBreakpointsEverywhere"),default:!1}}};class r{}t.IDebugConfiguration=r,t.DebugPreferences=Symbol("DebugPreferences");function o(p){return(0,n.createPreferenceProxy)(p,t.debugPreferencesSchema)}function c(p){p.addProviders({token:t.DebugPreferences,useFactory:v=>{const m=v.get(n.PreferenceService);return o(m)}}),p.addProviders({token:n.PreferenceContribution,useValue:{schema:t.debugPreferencesSchema}})}},40453:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProgressService=void 0;const r=e(85608),o=e(76003),c=e(41869),p=e(68969),v=e(43718),m=e(26296);let _=n=class{constructor(){this.toDispose=[]}async onDebugServiceStateChange(g){this.progressResolve&&(this.progressResolve(),this.progressResolve=void 0),g===m.DebugState.Initializing&&this.progressService.getIndicator(n.DEBUG_PANEL_PROGRESS_ID)&&this.progressService.withProgress({location:n.DEBUG_PANEL_PROGRESS_ID},l=>new Promise(h=>this.progressResolve=h))}run(g){let l;const h=u=>{l=new v.DisposableCollection,u&&(l?.push(u.onDidChangeState(d=>this.onDebugServiceStateChange(d))),l?.push(u.onDidProgressStart(async d=>{const E=new Promise(f=>{const a=c.Event.any(c.Event.filter(u.onDidProgressEnd,b=>b.body.progressId===d.body.progressId),u.onDidExitAdapter)(()=>{a.dispose(),f()})});this.progressService.getIndicator(n.DEBUG_PANEL_PROGRESS_ID)&&this.progressService.withProgress({location:n.DEBUG_PANEL_PROGRESS_ID},()=>E),this.progressService.withProgress({location:v.ProgressLocation.Notification,title:d.body.title,cancellable:d.body.cancellable,silent:!0,delay:500},f=>{let a=0;const b=A=>{let S;typeof A.percentage=="number"&&(S=A.percentage-a,a+=S),f.report({message:A.message,increment:S,total:typeof S=="number"?100:void 0})};d.body.message&&b(d.body);const y=u.onDidProgressUpdate(A=>{A.body.progressId===d.body.progressId&&b(A.body)});return E.then(()=>y.dispose())},()=>u.cancel(d.body.progressId))})))};this.toDispose.push(g.onDidChangeActiveDebugSession(({current:u})=>{l&&l.dispose(),h(u)})),h(g.currentSession)}};t.DebugProgressService=_,_.DEBUG_PANEL_PROGRESS_ID="debug",r.__decorate([(0,o.Autowired)(p.IProgressService),r.__metadata("design:type",Object)],_.prototype,"progressService",void 0),t.DebugProgressService=_=n=r.__decorate([(0,o.Injectable)()],_)},69946:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.launchSchema=t.DebugSchemaManager=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(64582),p=e(70159),v=e(37499),{deepClone:m}=o.objects;let _=class{async update(){const g=this.config.getDebuggers(),l={...m(t.launchSchema)},h=l.properties.configurations.items,u=g.map(d=>({attributes:Object.keys(d.configurationAttributes||{}).map(E=>d.configurationAttributes[E]),configurationSnippets:d.configurationSnippets}));for(const{attributes:d,configurationSnippets:E}of u)d&&h.oneOf&&h.oneOf.push(...d),E&&h.defaultSnippets&&h.defaultSnippets.push(...E);this.schemaRegistry.registerSchema(c.launchExtensionSchemaUri,l,["launch.json"])}};t.DebugSchemaManager=_,n.__decorate([(0,r.Autowired)(p.IDebugServer),n.__metadata("design:type",Object)],_.prototype,"debug",void 0),n.__decorate([(0,r.Autowired)(o.IJSONSchemaRegistry),n.__metadata("design:type",Object)],_.prototype,"schemaRegistry",void 0),n.__decorate([(0,r.Autowired)(v.DebugConfigurationManager),n.__metadata("design:type",v.DebugConfigurationManager)],_.prototype,"config",void 0),t.DebugSchemaManager=_=n.__decorate([(0,r.Injectable)()],_),t.launchSchema={$id:c.launchSchemaUri,type:"object",title:"Launch",required:[],default:{version:"0.2.0",configurations:[]},properties:{version:{type:"string",description:"Version of this file format.",default:"0.2.0"},configurations:{type:"array",description:"List of configurations. Add new configurations or edit existing ones by using IntelliSense.",items:{defaultSnippets:[],type:"object",oneOf:[]}}}}},90408:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugService=void 0;const n=e(85608),r=e(76003),o=e(41869);let c=class{constructor(){this.onDidDebugContributionPointChangeEmitter=new o.Emitter,this.debugContributionPointsMap=new Map}registerDebugContributionPoints(v,m){this.debugContributionPointsMap.has(v)||(this.debugContributionPointsMap.set(v,m),this.onDidDebugContributionPointChangeEmitter.fire({path:v,contributions:m}))}unregisterDebugContributionPoints(v){const m=this.debugContributionPointsMap.get(v);m&&(this.debugContributionPointsMap.delete(v),this.onDidDebugContributionPointChangeEmitter.fire({path:v,contributions:m,removed:!0}))}get debugContributionPoints(){return this.debugContributionPointsMap}get onDidDebugContributionPointChange(){return this.onDidDebugContributionPointChangeEmitter.event}};t.DebugService=c,t.DebugService=c=n.__decorate([(0,r.Injectable)()],c)},3520:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSessionConnection=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(64582),p=e(38029),v=new Set(["breakpoint","capabilities","continued","exited","initialized","loadedSource","module","output","process","stopped","terminated","thread","progressStart","progressUpdate","progressEnd","invalidated"]);let m=class{constructor(s,g,l){this.sessionId=s,this.connectionFactory=g,this.traceOutputChannel=l,this.pendingRequests=new Map,this.requestHandlers=new Map,this.onDidCustomEventEmitter=new o.Emitter,this.onDidCustomEvent=this.onDidCustomEventEmitter.event,this.toDispose=new o.DisposableCollection(this.onDidCustomEventEmitter,o.Disposable.create(()=>this.pendingRequests.clear()),o.Disposable.create(()=>this.emitters.clear())),this.allThreadsContinued=!0,this.emitters=new Map,this.connection=this.createConnection()}get disposed(){return this.toDispose.disposed}dispose(){this.toDispose.dispose()}async createConnection(){if(this.disposed)throw new Error("Connection has been already disposed.");{const s=await this.connectionFactory(this.sessionId);return s.onceClose((g,l)=>{this.fire("exited",{code:g,reason:l})}),s.onMessage(g=>this.handleMessage(g)),this.toDispose.push(o.Disposable.create(()=>{s.dispose()})),s}}async sendRequest(s,g,l,h){var u;s==="initialize"&&(this.sessionAdapterID=g.adapterID);const d=this.manager.reportTime(c.DEBUG_REPORT_NAME.DEBUG_ADAPTER_PROTOCOL_TIME,{sessionId:this.sessionId,threadId:g&&g.threadId||((u=this.manager.currentThread)===null||u===void 0?void 0:u.raw.id)}),E=await this.doSendRequest(s,g,h),f={adapterID:this.sessionAdapterID,request:l.request};if(s==="threads"&&(f.amount=E.body.threads.length),d(s,f),(s==="next"||s==="stepIn"||s==="stepOut"||s==="stepBack"||s==="reverseContinue"||s==="restartFrame")&&this.fireContinuedEvent(g.threadId),s==="continue"){const a=E;return(a&&a.body&&a.body.allThreadsContinued)!==void 0&&(this.allThreadsContinued=E.body.allThreadsContinued),this.fireContinuedEvent(g.threadId,this.allThreadsContinued),E}return E}async sendCustomRequest(s,g){var l;return(l=await this.doSendRequest(s,g))===null||l===void 0?void 0:l.body}async doSendRequest(s,g=null,l){const h=new o.Deferred,u={seq:(0,c.getSequenceId)(),type:"request",command:s};let d;return g&&(u.arguments=g),this.pendingRequests.set(u.seq,E=>{d&&d.dispose(),E.success?h.resolve(E):h.reject(E)}),l&&(d=l.onCancellationRequested(async()=>{d.dispose();const E=this.manager.getSession(this.sessionId);E&&E.capabilities.supportsCancelRequest&&E.sendRequest("cancel",{requestId:u.seq})})),await this.send(u),h.promise}async send(s){const g=await this.connection,l=JSON.stringify(s);this.traceOutputChannel&&this.traceOutputChannel.appendLine(`${this.sessionId.substring(0,8)} [UI -> adapter]: ${l}`),g.send(l)}handleMessage(s){this.traceOutputChannel&&this.traceOutputChannel.appendLine(`${this.sessionId.substring(0,8)} [adapter -> UI ]: ${s}`);const g=JSON.parse(s);g.type==="request"?this.handleRequest(g):g.type==="response"?this.handleResponse(g):g.type==="event"&&this.handleEvent(g)}handleResponse(s){const g=this.pendingRequests.get(s.request_seq);g&&(this.pendingRequests.delete(s.request_seq),g(s))}onRequest(s,g){this.requestHandlers.set(s,g)}async handleRequest(s){const g={type:"response",seq:(0,c.getSequenceId)(),command:s.command,request_seq:s.seq,success:!0},l=this.requestHandlers.get(s.command);if(l)try{g.body=await l(s)}catch(h){g.success=!1,g.message=h.message}else(0,o.getDebugLogger)().error("Unhandled request",s);await this.send(g)}handleEvent(s){"event"in s?(s.event==="continued"&&(this.allThreadsContinued=s.body.allThreadsContinued!==!1),v.has(s.event)?this.doFire(s.event,s):this.onDidCustomEventEmitter.fire(s)):this.fire("exited",s)}on(s,g){return this.disposed?o.Disposable.create(()=>{}):this.getEmitter(s).event(g)}fire(s,g){this.doFire(s,g)}doFire(s,g){this.disposed||this.getEmitter(s).fire(g)}getEmitter(s){const g=this.emitters.get(s)||this.newEmitter();return this.emitters.set(s,g),g}newEmitter(){const s=new o.Emitter;return this.toDispose.push(s),s}fireContinuedEvent(s,g=!1){this.fire("continued",{type:"event",event:"continued",body:{threadId:s,allThreadsContinued:g},seq:(0,c.getSequenceId)()})}};t.DebugSessionConnection=m,n.__decorate([(0,r.Autowired)(c.IDebugSessionManager),n.__metadata("design:type",p.DebugSessionManager)],m.prototype,"manager",void 0),t.DebugSessionConnection=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__param(1,(0,r.Optional)()),n.__param(2,(0,r.Optional)()),n.__metadata("design:paramtypes",[String,Function,Object])],m)},97186:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSessionFactory=t.DebugSessionContributionRegistryImpl=t.DebugSessionContributionRegistry=t.DebugSessionContribution=void 0;const n=e(85608),r=e(76003),o=e(41869);t.DebugSessionContribution=Symbol("DebugSessionContribution"),t.DebugSessionContributionRegistry=Symbol("DebugSessionContributionRegistry");let c=class{constructor(){this.contribs=new Map,this.init()}init(){for(const v of this.contributions.getContributions())this.contribs.set(v.debugType,v)}get(v){return this.contribs.get(v)}};t.DebugSessionContributionRegistryImpl=c,n.__decorate([(0,r.Autowired)(t.DebugSessionContribution),n.__metadata("design:type",Object)],c.prototype,"contributions",void 0),t.DebugSessionContributionRegistryImpl=c=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],c),t.DebugSessionFactory=Symbol("DebugSessionFactory")},38029:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSessionManager=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(26542),p=e(54414),v=e(72665),m=e(93950),_=e(80907),s=e(64582),g=e(79845),l=e(80712),h=e(17280),u=e(97186),d=e(5905);let E=class{fireDidChange(a){this.inDebugModeKey.set(this.inDebugMode),this.onDidChangeEmitter.fire(a)}constructor(){this._uid=(0,o.uuid)(),this._sessions=new Map,this._extraMap=new Map,this._actionIndex=0,this.onWillStartDebugSessionEmitter=new o.Emitter,this.onWillStartDebugSession=this.onWillStartDebugSessionEmitter.event,this.onWillResolveDebugConfigurationEmitter=new o.Emitter,this.onWillResolveDebugConfiguration=this.onWillResolveDebugConfigurationEmitter.event,this.onDidCreateDebugSessionEmitter=new o.Emitter,this.onDidCreateDebugSession=this.onDidCreateDebugSessionEmitter.event,this.onDidStartDebugSessionEmitter=new o.Emitter,this.onDidStartDebugSession=this.onDidStartDebugSessionEmitter.event,this.onDidStopDebugSessionEmitter=new o.Emitter,this.onDidStopDebugSession=this.onDidStopDebugSessionEmitter.event,this.onDidChangeActiveDebugSessionEmitter=new o.Emitter,this.onDidChangeActiveDebugSession=this.onDidChangeActiveDebugSessionEmitter.event,this.onDidDestroyDebugSessionEmitter=new o.Emitter,this.onDidDestroyDebugSession=this.onDidDestroyDebugSessionEmitter.event,this.onDidReceiveDebugSessionCustomEventEmitter=new o.Emitter,this.onDidReceiveDebugSessionCustomEvent=this.onDidReceiveDebugSessionCustomEventEmitter.event,this.onDidChangeEmitter=new o.Emitter,this.onDidChange=this.onDidChangeEmitter.event,this.configurationIds=new Map,this.toDisposeOnCurrentSession=new o.DisposableCollection,this.init()}init(){this.debugTypeKey=this.contextKeyService.createKey(s.CONTEXT_DEBUG_TYPE_KEY,void 0),this.inDebugModeKey=this.contextKeyService.createKey(s.CONTEXT_IN_DEBUG_MODE_KEY,this.inDebugMode),this.debugStopped=this.contextKeyService.createKey(s.CONTEXT_DEBUG_STOPPED_KEY,!1),this.modelManager.onModelChanged(a=>{const{newModelUrl:b}=a;if(b){const y=o.URI.parse(b.toString()),A=this.modelManager.model;if(this.currentSession&&this.currentThread&&A){const S=this.currentThread.frames.find(w=>{var T;return((T=w.source)===null||T===void 0?void 0:T.uri.toString())===y.toString()});S&&S!==this.currentFrame&&(this.currentThread.currentFrame=S,setTimeout(()=>{this.workbenchEditorService.currentEditor&&this.workbenchEditorService.currentEditor.monacoEditor.revealLineInCenter(S.raw.line)},0))}}})}_getExtra(a,b){if(a==null)return;const y=this._extraMap.get(a);if(y)return{traceId:y.traceId,remote:y.remote,adapterID:y.adapterID,request:y.request,...b&&y.threads.get(`${b}`)}}getExtra(a,b){return this._getExtra(a,b)}_setExtra(a,b,y){const A=this._extraMap.get(a);A&&(y?A.threads.set(b,y):A.threads.delete(b))}setExtra(a,b,y){return this._setExtra(a,b,y)}report(a,b,y){return y={traceId:this._uid,...this._getExtra(y?.sessionId,y?.threadId),...y},this.reporterService.point(a,b,y)}reportTime(a,b){const y=this.reporterService.time(a);return(A,S)=>(S={...b,...S},S={traceId:this._uid,...this._getExtra(S?.sessionId,S?.threadId),...S},y.timeEnd(A,S))}reportAction(a,b,y){var A,S,w;let T=this._getExtra(a,b);T&&(b&&!T.threadId&&(T={...T}),this._actionIndex+=1,T.action=`${y}-${this._actionIndex}`,T.filePath=(S=(A=this.currentFrame)===null||A===void 0?void 0:A.raw.source)===null||S===void 0?void 0:S.path,T.fileLineNumber=(w=this.currentFrame)===null||w===void 0?void 0:w.raw.line,this._setExtra(a,`${b??""}`,T))}async start(a){const{configuration:b}=a,y={adapterID:b.type,request:b.request==="launch"?"launch":"attach",traceId:this._uid,remote:0,threads:new Map};if((0,d.isRemoteAttach)(b)&&(y.remote=1),this.report(s.DEBUG_REPORT_NAME.DEBUG_BREAKPOINT,"number",{count:this.breakpoints.getBreakpoints().length,...y}),!a.configuration.__restart&&this.isExistedDebugSession(a)){this.messageService.error((0,o.formatLocalize)("debug.launch.existed",a.configuration.name));return}try{const A=this.reportTime(s.DEBUG_REPORT_NAME.DEBUG_SESSION_START_TIME,y);await this.fireWillStartDebugSession();const S=await this.resolveConfiguration(a);if(S){if(S.configuration.preLaunchTask){this.debugProgressService.onDebugServiceStateChange(s.DebugState.Initializing);const T=o.Uri.parse(S.workspaceFolderUri),D=await this.taskService.getTask(T,S.configuration.preLaunchTask);if(D){const I=this.reportTime(s.DEBUG_REPORT_NAME.DEBUG_PRE_LAUNCH_TASK_TIME,y),O=await this.taskService.run(D);O.exitCode!==0&&this.messageService.error(`The preLaunchTask ${S.configuration.preLaunchTask} exitCode is ${O.exitCode}`),I(T.toString(),{exitCode:O.exitCode})}this.debugProgressService.onDebugServiceStateChange(s.DebugState.Running)}}else{a.configuration.type?this.messageService.error((0,o.formatLocalize)("debug.notSupported.type",a.configuration.type)):this.messageService.error((0,o.localize)("debug.notSupported.any"));return}const w=await this.debug.createDebugSession(S);if(A(S.configuration.type,{adapterID:S.configuration.type,request:S.configuration.request,sessionId:w}),!w){this.messageService.error((0,o.formatLocalize)("debug.launch.typeNotSupported",S.configuration.type));return}return this.doStart(w,S,y)}catch(A){throw this.messageService.error((0,o.localize)("debug.launch.catchError")),A}}async fireWillStartDebugSession(){await o.WaitUntilEvent.fire(this.onWillStartDebugSessionEmitter,{})}async resolveConfiguration(a){if(s.IDebugSessionDTO.is(a))return a;const{workspaceFolderUri:b,index:y,noDebug:A,parentSession:S,repl:w,compact:T,lifecycleManagedByParent:D}=a,I=await this.resolveDebugConfiguration(a.configuration,b);I&&!("cwd"in I)&&(I.cwd="${workspaceFolder}");let O=await this.variableResolver.resolve(I,{});if(!O){O===null&&this.commandService.executeCommand(o.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id);return}if(O=await this.resolveDebugConfigurationWithSubstitutedVariables(O,b),!O){O===null&&this.commandService.executeCommand(o.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id);return}const M=O.name+b,R=this.configurationIds.has(M)?this.configurationIds.get(M)+1:0;return this.configurationIds.set(M,R),{id:R,configuration:O,workspaceFolderUri:b,index:y,noDebug:A,parentSession:S,repl:w,compact:T,lifecycleManagedByParent:D}}async resolveDebugConfiguration(a,b){return await this.fireWillResolveDebugConfiguration(a.type),this.debug.resolveDebugConfiguration(a,b)}async resolveDebugConfigurationWithSubstitutedVariables(a,b){return this.debug.resolveDebugConfigurationWithSubstitutedVariables(a,b)}async fireWillResolveDebugConfiguration(a){await o.WaitUntilEvent.fire(this.onWillResolveDebugConfigurationEmitter,{debugType:a})}async doStart(a,b,y){const A=this.sessionContributionRegistry.get(b.configuration.type);if(!A)return;const w=A.debugSessionFactory().get(a,b);this._sessions.set(a,w),this._extraMap.set(a,y),b.lifecycleManagedByParent||this.updateCurrentSession(w),this.debugTypeKey.set(w.configuration.type),this.onDidCreateDebugSessionEmitter.fire(w);let T=s.DebugState.Inactive;return w.onDidChange(()=>{var D,I;T!==w.state&&(T=w.state,T===s.DebugState.Stopped?(this.onDidStopDebugSessionEmitter.fire(w),this.debugStopped.set(!0)):this.debugStopped.set(!1)),this.debugContextKey.contextSetVariableSupported.set((D=w.capabilities.supportsSetVariable)!==null&&D!==void 0?D:!1),this.debugContextKey.contextRestartFrameSupported.set((I=w.capabilities.supportsRestartFrame)!==null&&I!==void 0?I:!1),this.debugContextKey.contextDebugState.set(s.DebugState[w.state]),this.debugContextKey.contextInDebugMode.set(T!==s.DebugState.Inactive)}),w.on("terminated",D=>{const I=D.body&&D.body.restart;I?this.doRestart(w,I):this.destroy(w.id)}),w.on("exited",()=>this.destroy(w.id)),w.start().then(()=>this.onDidStartDebugSessionEmitter.fire(w)),w.onDidCustomEvent(({event:D,body:I})=>this.onDidReceiveDebugSessionCustomEventEmitter.fire({event:D,body:I,session:w})),w}isExistedDebugSession(a){const{name:b}=a.configuration;for(const[,y]of this._sessions)if(y.configuration.name===b&&!y.terminated)return!0;return!1}async restart(a=this.currentSession){return a&&this.doRestart(a)}async doRestart(a,b){const{options:y,configuration:A}=a;return await a.restart({arguments:A})?a:(await a.terminate(!0),A.__restart=b,this.start(y))}updateCurrentSession(a){this.currentSession=a||this.sessions[this.sessions.length-1]}get inDebugMode(){return this.state>s.DebugState.Inactive}get currentThread(){const a=this.currentSession;return a&&a.currentThread}get state(){const a=this.currentSession;return a?a.state:s.DebugState.Inactive}get currentFrame(){const{currentThread:a}=this;return a&&a.currentFrame}get topFrame(){const{currentThread:a}=this;return a&&a.topFrame}getSession(a){if(a)return this._sessions.get(a)}get sessions(){return Array.from(this._sessions.values()).filter(a=>a.state>s.DebugState.Inactive)}get currentSession(){return this._currentSession}set currentSession(a){if(this._currentSession===a)return;this.toDisposeOnCurrentSession.dispose();const b=this._currentSession;this._currentSession=a,this.onDidChangeActiveDebugSessionEmitter.fire({previous:b,current:a}),a&&(this.toDisposeOnCurrentSession.push(a.onDidChange(()=>{this.currentFrame===this.topFrame&&this.open(),this.fireDidChange(a)})),this.toDisposeOnCurrentSession.push(a.onCurrentThreadChange(()=>{this.fireDidChange(a)}))),this.open(),this.fireDidChange(a)}open(){const{currentFrame:a}=this;a&&a.open()}async stopSession(a,b=!1){return a?b?a.disconnect():a.terminate():Promise.all(this.sessions.map(y=>b?y.disconnect():y.terminate()))}destroy(a){if(a){const b=this._sessions.get(a);b&&this.doDestroy(b)}else this._sessions.forEach(b=>this.doDestroy(b))}doDestroy(a){this.debug.terminateDebugSession(a.id),this.remove(a.id),a.dispose(),this.onDidDestroyDebugSessionEmitter.fire(a)}remove(a){this._sessions.delete(a);const{currentSession:b}=this;b&&b.id===a&&this.updateCurrentSession(void 0),setTimeout(()=>{this._extraMap.delete(a)})}};t.DebugSessionManager=E,n.__decorate([(0,r.Autowired)(c.LabelService),n.__metadata("design:type",c.LabelService)],E.prototype,"labelProvider",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],E.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(u.DebugSessionContributionRegistry),n.__metadata("design:type",Object)],E.prototype,"sessionContributionRegistry",void 0),n.__decorate([(0,r.Autowired)(s.IDebugServer),n.__metadata("design:type",Object)],E.prototype,"debug",void 0),n.__decorate([(0,r.Autowired)(p.WorkbenchEditorService),n.__metadata("design:type",p.WorkbenchEditorService)],E.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(v.IMessageService),n.__metadata("design:type",Object)],E.prototype,"messageService",void 0),n.__decorate([(0,r.Autowired)(_.IVariableResolverService),n.__metadata("design:type",Object)],E.prototype,"variableResolver",void 0),n.__decorate([(0,r.Autowired)(l.BreakpointManager),n.__metadata("design:type",l.BreakpointManager)],E.prototype,"breakpoints",void 0),n.__decorate([(0,r.Autowired)(s.IDebugModelManager),n.__metadata("design:type",Object)],E.prototype,"modelManager",void 0),n.__decorate([(0,r.Autowired)(m.ITaskService),n.__metadata("design:type",Object)],E.prototype,"taskService",void 0),n.__decorate([(0,r.Autowired)(o.IReporterService),n.__metadata("design:type",Object)],E.prototype,"reporterService",void 0),n.__decorate([(0,r.Autowired)(g.IDebugProgress),n.__metadata("design:type",Object)],E.prototype,"debugProgressService",void 0),n.__decorate([(0,r.Autowired)(h.DebugContextKey),n.__metadata("design:type",h.DebugContextKey)],E.prototype,"debugContextKey",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],E.prototype,"commandService",void 0),t.DebugSessionManager=E=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],E)},29539:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSession=void 0;const r=e(85608).__importDefault(e(12784)),o=e(41869),c=e(43718),p=e(64582),v=e(32385),m=e(99797),_=e(88776),s=e(7885);class g{fireDidChange(){this.onDidChangeEmitter.fire(void 0),this.onStateChange()}get capabilities(){return this._capabilities}get supportsThreadIdCorrespond(){return!!this.capabilities.supportsThreadIdCorrespond}constructor(h,u,d,E,f,a,b,y,A,S,w){this.id=h,this.options=u,this.connection=d,this.terminalService=E,this.workbenchEditorService=f,this.breakpointManager=a,this.modelManager=b,this.labelProvider=y,this.messages=A,this.fileSystem=S,this.sessionManager=w,this.onDidChangeEmitter=new o.Emitter,this.onDidChange=this.onDidChangeEmitter.event,this._onDidChangeCallStack=new o.Emitter,this.onDidChangeCallStack=this._onDidChangeCallStack.event,this._onVariableChange=new o.Emitter,this.onVariableChange=this._onVariableChange.event,this._onCurrentThreadChange=new o.Emitter,this.onCurrentThreadChange=this._onCurrentThreadChange.event,this._onDidStop=new o.Emitter,this.onDidStop=this._onDidStop.event,this._onDidContinued=new o.Emitter,this.onDidContinued=this._onDidContinued.event,this._onDidThread=new o.Emitter,this.onDidThread=this._onDidThread.event,this._onRequest=new o.Emitter,this.onRequest=this._onRequest.event,this._onDidExitAdapter=new o.Emitter,this.onDidExitAdapter=this._onDidExitAdapter.event,this._onDidProgressStart=new o.Emitter,this.onDidProgressStart=this._onDidProgressStart.event,this._onDidProgressUpdate=new o.Emitter,this.onDidProgressUpdate=this._onDidProgressUpdate.event,this._onDidProgressEnd=new o.Emitter,this.onDidProgressEnd=this._onDidProgressEnd.event,this._onDidInvalidated=new o.Emitter,this.onDidInvalidated=this._onDidInvalidated.event,this._onDidChangeState=new o.Emitter,this.onDidChangeState=this._onDidChangeState.event,this._onDidInvalidMemory=new o.Emitter,this.onDidInvalidateMemory=this._onDidInvalidMemory.event,this.toDispose=new o.DisposableCollection,this._capabilities={},this.updateDeffered=null,this.exitDeferred=new o.Deferred,this.cancellationMap=new Map,this.toDisposeOnCurrentThread=new o.DisposableCollection,this.initialized=!1,this.id2Breakpoint=new Map,this.settingBreakpoints=null,this._multipleThreadPaused=new Map,this.sources=new Map,this._threads=new Map,this.scheduleUpdateThreads=(0,r.default)(()=>this.updateThreads(void 0),100),this.pendingThreads=Promise.resolve(),this.terminated=!1,this.connection.onRequest("runInTerminal",async T=>await this.runInTerminal(T)),this.toDispose.pushAll([this.onDidChangeEmitter,this.connection,this.on("initialized",()=>{this.configure()}),this.on("breakpoint",({body:T})=>this.onUpdateBreakpoint(T)),this.on("continued",async T=>{const{body:{allThreadsContinued:D,threadId:I}}=T;if(this.handleCancellation(I),this.supportsThreadIdCorrespond){I?this._multipleThreadPaused.delete(I):D!==!1&&this._multipleThreadPaused.clear(),await this.updateCurrentThread(),this._onDidContinued.fire(T);return}if(D!==!1){this.clearThreads(),this._onDidContinued.fire(T);return}(0,c.isDefined)(I)&&this.clearThread(I),this.onStateChange(),this._onDidContinued.fire(T)}),this.on("stopped",async T=>{const{body:D}=T;this.stoppedDetails=D;const{threadId:I}=D,O=this.sessionManager.reportTime(p.DEBUG_REPORT_NAME.DEBUG_STOPPED,{sessionId:this.id,threadId:I});if(this.supportsThreadIdCorrespond===!0){if(await this.collectPausedThread(D),D.threadId&&this._multipleThreadPaused.has(D.threadId)){const R=this._multipleThreadPaused.get(D.threadId);await this.updateCurrentThread(R),await this.updateCurrentThreadFramesOnFocus()}}else this.updateDeffered=new o.Deferred,await this.updateThreads(D),await this.updateCurrentThreadFramesOnFocus(),this.updateDeffered.resolve();O("stopped");const M=this.sessionManager.getExtra(this.id,I);I&&M&&M.action&&(M.action=void 0,this.sessionManager.setExtra(this.id,`${I??""}`,M)),this.onStateChange(),this.sessionManager.currentSession=this,this._onDidStop.fire(T)}),this.on("thread",T=>{const{body:{reason:D,threadId:I}}=T;if(this.supportsThreadIdCorrespond){this.state===p.DebugState.Stopped&&this._onDidThread.fire(T);return}D==="started"?this.scheduleUpdateThreads():D==="exited"&&this.clearThread(I),this._onDidThread.fire(T)}),this.on("terminated",()=>{this.terminated=!0}),this.on("exited",T=>{this.exitDeferred.resolve(T)}),this.on("progressStart",T=>{this._onDidProgressStart.fire(T)}),this.on("progressUpdate",T=>{this._onDidProgressUpdate.fire(T)}),this.on("progressEnd",T=>{this._onDidProgressEnd.fire(T)}),this.on("memory",T=>{this._onDidInvalidMemory.fire(T)}),this.on("invalidated",async T=>{this._onDidInvalidated.fire(T),T.body.areas&&T.body.areas.length===1&&(T.body.areas[0]==="variables"||T.body.areas[0]==="watch")||(this.cancelAllRequests(),this.clearThreads(),await this.updateThreads(this.stoppedDetails)),this.fireDidChange()}),this.on("capabilities",T=>this.updateCapabilities(T.body.capabilities)),this.breakpointManager.onDidChangeBreakpoints(T=>this.runtimeUpdateBreakpoint(T)),this.breakpointManager.onDidChangeExceptionsBreakpoints(T=>{this.breakpointManager.breakpointsEnabled&&this.setExceptionBreakpoints(T)}),c.Disposable.create(()=>{this.breakpointManager.clearAllStatus(this.id)})])}getMemory(h){return new v.MemoryRegion(h,this)}get configuration(){return this.options.configuration}get parentSession(){return this.options.parentSession}get lifecycleManagedByParent(){return this.options.lifecycleManagedByParent}get compact(){return!!this.options.compact}async start(){await this.workbenchEditorService.saveAll(),await this.initialize(),await this.launchOrAttach()}async runInTerminal({arguments:{title:h,cwd:u,args:d,env:E}}){return this.doRunInTerminal({name:h,cwd:u,env:E,args:d})}async doRunInTerminal(h){var u;const d=this.terminalService.terminals.find(b=>b.name===h.name&&b.isActive);let E;const f=await this.terminalService.getDefaultShellPath(),a=(0,p.prepareCommand)(f,h.args,!1,(u=h.cwd)===null||u===void 0?void 0:u.toString(),h.env);if(d)a&&this.terminalService.sendText(d.id,a),E=await this.terminalService.getProcessId(d.id);else{const b=await this.terminalService.createTerminal(h);b.show(),a&&(this.terminalService.sendText(b.id,a),E=await this.terminalService.getProcessId(b.id))}return{processId:E}}async initialize(){const h=await this.connection.sendRequest("initialize",{clientID:"OpenSumi",clientName:"OpenSumi IDE",adapterID:this.configuration.type,locale:(0,c.getLanguageId)(),linesStartAt1:!0,columnsStartAt1:!0,pathFormat:"path",supportsVariableType:!1,supportsVariablePaging:!1,supportsRunInTerminalRequest:!0,supportsProgressReporting:!0,supportsInvalidatedEvent:!0,supportsMemoryEvent:!0,supportsMemoryReferences:!0},this.configuration);this.updateCapabilities(h.body||{}),this.onStateChange()}async launchOrAttach(){var h;if(this.parentSession&&this.parentSession.state===p.DebugState.Inactive)throw(0,o.canceled)();try{this.configuration.request==="attach"?await this.sendRequest("attach",this.configuration):await this.sendRequest("launch",this.configuration)}catch(u){throw this.fireExited(u),this.messages.error(u.message||((h=u.body)===null||h===void 0?void 0:h.error.format)||(0,o.localize)("debug.console.errorMessage")),u&&u.message}}async configure(){await this.initBreakpoints(),this.breakpointManager.setExceptionBreakpoints(this.capabilities.exceptionBreakpointFilters||[]),this.initialized=!0,this.capabilities.supportsConfigurationDoneRequest&&this.sendRequest("configurationDone",{}),this.supportsThreadIdCorrespond||await this.updateThreads(void 0)}async setExceptionBreakpoints(h){return this.sendRequest("setExceptionBreakpoints",h)}onStateChange(){const h=this.state;this.previousState!==h&&(this.previousState=h,this._onDidChangeState.fire(h))}async onUpdateBreakpoint(h){let u;this.settingBreakpoints&&await this.settingBreakpoints.promise;try{const d=h.breakpoint;switch(h.reason){case"new":if(d.source&&typeof d.line=="number"&&d.id&&!this.id2Breakpoint.has(d.id)){const E=_.DebugSource.toUri(d.source),f=m.DebugBreakpoint.create(E,{line:d.line,column:d.column});f.status.set(this.id,d),this.addBreakpoint(f)}break;case"removed":d.id&&(u=this.id2Breakpoint.get(d.id),u&&this.delBreakpoint(u));break;case"changed":d.id&&(u=this.id2Breakpoint.get(d.id),u&&(u.status.set(this.id,d),this.breakpointManager.updateBreakpoint(u,!0)));break;default:break}}finally{}}async setBreakpoints(h){const u=[];for(const d of h){const E=await this.toSource(d),f=this.breakpointManager.getBreakpoints(d).filter(a=>this.breakpointManager.breakpointsEnabled&&a.enabled);u.push(this.sendRequest("setBreakpoints",{source:E.raw,sourceModified:!1,lines:f.map(a=>a.raw.line),breakpoints:f.map(a=>a.raw)}).then(a=>(a.body.breakpoints.forEach((b,y)=>{var A,S;b.id&&this.id2Breakpoint.set(b.id,f[y]);const w=f[y];w.raw.line=(A=b.line)!==null&&A!==void 0?A:w.raw.line,w.raw.column=(S=b.column)!==null&&S!==void 0?S:w.raw.column,w.status.set(this.id,b)}),this.breakpointManager.updateBreakpoints(f,!0),this.breakpointManager.resolveBpDeffered(),Promise.resolve())).catch(a=>{if(!(a instanceof Error)){const y=a.message?`${a.message}`:"Breakpoint not valid for current debug session";f.forEach(A=>{A.status.set(this.id,{verified:!1,message:y}),this.breakpointManager.updateBreakpoint(A,!0)})}}))}return await Promise.all(u)}delBreakpoint(h){return this.breakpointManager.delBreakpoint(h)}async addBreakpoint(h,u){return u&&this.breakpointManager.setBpDeffered(),this.breakpointManager.addBreakpoint(h),this.breakpointManager.promiseBpDeffered()}async runtimeUpdateBreakpoint(h){const{affected:u,statusUpdated:d}=h;if(!d)return await this.setBreakpoints(u)}async initBreakpoints(){this.settingBreakpoints=new o.Deferred,this.id2Breakpoint.clear(),this.configuration.noDebug||await this.setBreakpoints(this.breakpointManager.affected.map(h=>o.URI.parse(h))),this.settingBreakpoints.resolve(),this.settingBreakpoints=null}get currentThread(){return this._currentThread}set currentThread(h){this.toDisposeOnCurrentThread.dispose(),this._currentThread=h,h&&this.toDisposeOnCurrentThread.push(h.onDidChanged(()=>this.fireDidChange()))}get multipleThreadPaused(){return this._multipleThreadPaused}hasInMultipleThreadPaused(h){return this._multipleThreadPaused.has(h)}clearThreads(){var h;const u=this.sessionManager.reportTime(p.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME,{sessionId:this.id,threadId:(h=this.currentThread)===null||h===void 0?void 0:h.id,threadAmount:this.threadCount});this._threads.forEach(d=>{d.clear()}),this._onDidChangeCallStack.fire(),this.collocationThread(),u("clearThreads")}clearThread(h){const u=this.sessionManager.reportTime(p.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME,{sessionId:this.id,threadId:h,threadAmount:this.threadCount}),d=this._threads.get(h);d&&(d.clear(),this._onDidChangeCallStack.fire()),this.collocationThread(),u("clearThread")}get state(){if(this.connection.disposed)return p.DebugState.Inactive;if(!this.initialized)return p.DebugState.Initializing;const h=this.currentThread;return h?h.stopped?p.DebugState.Stopped:p.DebugState.Running:this.supportsThreadIdCorrespond?p.DebugState.Running:this.stoppedThreads.next().value?p.DebugState.Stopped:p.DebugState.Running}get currentFrame(){return this.currentThread&&this.currentThread.currentFrame}async getScopes(h){const{currentFrame:u}=this;return u?u.getScopes(h):[]}get label(){return p.IDebugSessionDTO.is(this.options)&&this.options.id?this.configuration.name+" ("+(this.options.id+1)+")":this.configuration.name}get visible(){return this.state>p.DebugState.Inactive}getSource(h){const u=_.DebugSource.toUri(h).toString(),d=this.sources.get(u)||new _.DebugSource(this,this.labelProvider,this.modelManager,this.workbenchEditorService,this.fileSystem);return d.update({raw:h}),this.sources.set(u,d),d}getSourceForUri(h){return this.sources.get(h.toString())}async toSource(h){const u=this.getSourceForUri(h);return u||this.getSource(await this.toDebugSource(h))}async toDebugSource(h){if(h.scheme===_.DebugSource.SCHEME)return{name:h.path.toString(),sourceReference:Number(h.query)};const u=h.displayName;let d=h.toString();return h.scheme===c.Schemes.file&&(d=await this.fileSystem.getFsPath(d)),{name:u,path:d,adapterData:void 0,sourceReference:void 0}}get threads(){return Array.from(this._threads.values())}get threadCount(){return this._threads.size}*getThreads(h){for(const u of this.threads)h(u)&&(yield u)}get runningThreads(){return this.getThreads(h=>!h.stopped)}get stoppedThreads(){return this.getThreads(h=>h.stopped)}async rawFetchThreads(h){const u=typeof h>"u"?null:{threadId:h},d=await this.sendRequest("threads",u);return d&&d.body&&d.body.threads&&Array.isArray(d.body.threads)?Promise.resolve(d.body.threads):Promise.resolve([])}async fetchThreads(){const h=await this.rawFetchThreads(),u=this._threads,d=[];for(const E of h){const f=E.id,a=u.get(f)||new s.DebugThread(this);d.push(a),a.update({raw:E})}return Promise.resolve(d)}updateThreads(h){return this.pendingThreads=this.pendingThreads.then(async()=>{try{const u=await this.rawFetchThreads();this.doUpdateThreads(u,h)}catch{}})}doUpdateThreads(h,u){const d=this.sessionManager.reportTime(p.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME,{sessionId:this.id,threadId:u?.threadId,threadAmount:h.length}),E=[];h.forEach(f=>{if(E.push(f.id),this._threads.has(f.id)){if(f.name){const a=this._threads.get(f.id);a&&(a.raw.name=f.name)}}else{const a=new s.DebugThread(this),b={raw:f};a.update(b),this._threads.set(f.id,a)}}),this._threads.forEach(f=>{var a;const{raw:{id:b}}=f;E.indexOf(b)===-1&&this._threads.delete(b),u&&(u.allThreadsStopped||u.threadId===b)&&((a=this._threads.get(b))===null||a===void 0||a.update({stoppedDetails:u}))}),this.collocationThread(u),d("doUpdateThreads")}collocationThread(h){var u;const{currentThread:d}=this;let E=d&&d.raw.id;h&&!h.preserveFocusHint&&h.threadId&&(E=h.threadId),this.currentThread=typeof E=="number"&&this._threads.get(E)||this._threads.values().next().value,((u=this.currentThread)===null||u===void 0?void 0:u.raw.id)!==E&&this.fireDidChange()}async updateCurrentThread(h){h?(this.currentThread=h,this._onCurrentThreadChange.fire(this.currentThread)):(this.currentThread=void 0,this._onCurrentThreadChange.fire(void 0))}async collectPausedThread(h){const u=await this.rawFetchThreads(h?.threadId);if(u.length===0)return new Map;const d=h.threadId&&this._multipleThreadPaused.has(h.threadId)?this._multipleThreadPaused.get(h.threadId):new s.DebugThread(this),E={raw:u[0]};return h&&(h.allThreadsStopped||h.threadId===u[0].id)&&(E.stoppedDetails=h),d&&(d.update(E),await this.rawFetchFrames(d),this._multipleThreadPaused.set(d.raw.id,d)),this._multipleThreadPaused}async updateCurrentThreadFramesOnFocus(){await this.rawFetchFrames(this.currentThread),this._onDidChangeCallStack.fire();const h=this.workbenchEditorService.currentEditor,u=d=>{this.stoppedDetails&&!this.stoppedDetails.preserveFocusHint&&(this.currentThread.currentFrame=d)};if(this.currentThread&&!this.currentFrame){const d=this.currentThread.frames.filter(E=>E&&E.source&&E.source.raw.presentationHint!=="deemphasize");if(d.length===0)return;if(h){const E=h.monacoEditor.getModel();if(E){const f=o.URI.parse(E.uri.toString()),a=d.filter(b=>b.source.uri.toString()===f.toString());a.length>0?u(a[0]):u(d[0])}}else u(d[0])}}async rawFetchFrames(h){!h||h.frameCount||(this.capabilities.supportsDelayedStackTraceLoading?(await h.rawFetchFrames(1),await h.rawFetchFrames(19)):await h.rawFetchFrames())}async terminate(h){if(this.initialized=!0,this.cancelAllRequests(),this.lifecycleManagedByParent&&this.parentSession){await this.parentSession.terminate(h);return}!this.terminated&&this.capabilities.supportsTerminateRequest&&this.configuration.request==="launch"?(this.terminated=!0,this.sendRequest("terminate",{restart:h}),await this.exited(1e3)||await this.disconnect(h)):await this.disconnect(h)}async disconnect(h){try{this.lifecycleManagedByParent&&this.parentSession?this.parentSession.disconnect(h):this.sendRequest("disconnect",{restart:h})}catch(d){this.fireExited(d);return}finally{this._onDidExitAdapter.fire(),this.onStateChange()}const u=500;await this.exited(u)||this.fireExited(new Error(`timeout after ${u} ms`))}updateCapabilities(h){Object.assign(this._capabilities,h)}fireExited(h){this.connection.fire("exited",{reason:h})}exited(h){return Promise.race([this.exitDeferred.promise.then(()=>!0,()=>!1),new Promise(u=>{setTimeout(u,h,!1)})])}async restart(h){return this.cancelAllRequests(),this.capabilities.supportsRestartRequest?(this.terminated=!1,this.lifecycleManagedByParent&&this.parentSession?await this.parentSession.restart({arguments:this.parentSession.configuration}):await this.sendRequest("restart",h),!0):!1}dispose(){this.toDispose.dispose()}async evaluate(h,u){var d;this.updateDeffered&&await((d=this.updateDeffered)===null||d===void 0?void 0:d.promise);const E=this.currentFrame&&this.currentFrame.raw.id;return(await this.sendRequest("evaluate",{expression:h,frameId:E,context:u})).body}async variables(h,u="named"){return(await this.sendRequest("variables",{variablesReference:h,filter:u})).body}async goto(h){if(this.capabilities.supportsGotoTargetsRequest)return await this.sendRequest("goto",h)}async exceptionInfo(h){return this.capabilities.supportsExceptionInfoRequest?this.sendRequest("exceptionInfo",h):Promise.reject(new Error("exceptionInfo not supported"))}async cancel(h){return this.sendRequest("cancel",{progressId:h})}async setVariableValue(h){if(this.capabilities.supportsSetVariable){const u=await this.sendRequest("setVariable",h);return this._onVariableChange.fire(),u}}async breakpointLocations(h,u){var d;const E=await this.toSource(h),a=(((d=(await this.sendRequest("breakpointLocations",{source:E.raw,line:u})).body)===null||d===void 0?void 0:d.breakpoints)||[]).map(b=>({lineNumber:b.line,column:b.column||1}));return Object.values(a.reduce((b,y)=>({...b,[`${y.lineNumber}:${y.column}`]:y}),{}))}async sendRequest(h,u,d){var E,f,a;if(!this._capabilities.supportsTerminateRequest&&h==="terminate"||!this._capabilities.supportsCompletionsRequest&&h==="completions"||!this._capabilities.supportsTerminateThreadsRequest&&h==="terminateThreads")throw new Error(`debug: ${h} not supported`);let b;["continue","next","stepIn","stepOut","threads"].some(y=>h===y)&&this.handleCancellation((E=this.currentThread)===null||E===void 0?void 0:E.raw.id),["stackTrace","scopes","variables","completions","threads"].some(y=>h===y)&&(b=!((f=this.currentThread)===null||f===void 0)&&f.raw.id?this.getNewCancellationToken((a=this.currentThread)===null||a===void 0?void 0:a.raw.id,d):void 0);try{return await this.connection.sendRequest(h,u,this.configuration,b)}finally{this._onRequest.fire(h)}}async takeCommand(h){return new Promise(u=>{const d=this.onRequest(E=>{E===h&&(d.dispose(),u())})})}sendCustomRequest(h,u){return this.connection.sendCustomRequest(h,u)}on(h,u){return this.connection.on(h,u)}get onDidCustomEvent(){return this.connection.onDidCustomEvent}hasSeparateRepl(){return!this.parentSession||this.options.repl!=="mergeWithParent"}reportTime(h,u){return this.sessionManager.reportTime(h,u)}getNewCancellationToken(h,u){const d=new c.CancellationTokenSource(u),E=this.cancellationMap.get(h)||[];return E.push(d),this.cancellationMap.set(h,E),d.token}cancelAllRequests(){this.cancellationMap.forEach(h=>h.forEach(u=>u.cancel())),this.cancellationMap.clear()}handleCancellation(h){if(h){const u=this.cancellationMap.get(h);this.cancellationMap.delete(h),u&&u.forEach(d=>d.cancel())}else this.cancelAllRequests()}getDebugProtocolBreakpoint(h){const u=this.breakpointManager.getBreakpoints().find(d=>d.id===h);if(u){const d=u.status.get(this.id);return{id:d?.id,verified:!!d?.verified,message:d?.message,source:d?.source,line:d?.line,column:d?.column,endLine:d?.endLine,endColumn:d?.endColumn,instructionReference:d?.instructionReference,offset:d?.offset}}}currentEditor(){var h;return(h=this.getModel())===null||h===void 0?void 0:h.getEditor()}getModel(){return this.modelManager.model}async readMemory(h,u,d){return this.capabilities.supportsReadMemoryRequest?await this.sendRequest("readMemory",{count:d,memoryReference:h,offset:u}):Promise.resolve(void 0)}async writeMemory(h,u,d,E){return this.capabilities.supportsWriteMemoryRequest?await this.sendRequest("writeMemory",{memoryReference:h,offset:u,allowPartial:E,data:d}):Promise.resolve(void 0)}}t.DebugSession=g},5905:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseSnippet=t.CharWidthReader=t.DEFAULT_WORD_REGEXP=t.USUAL_WORD_SEPARATORS=void 0,t.isExtensionHostDebugging=c,t.matchAll=p,t.isRemoteAttach=v;const n=e(41869),r=e(57711),{equalsIgnoreCase:o}=n.strings;function c(g){return g.type&&o(g.type==="vslsShare"?g.adapterProxy.configuration.type:g.type,"extensionhost")}function p(g,l){let h;const u=[];for(;(h=l.exec(g))!==null;)u.push(h);return u}function v(g){if(g.request==="attach"){const l={node:"address",java:"hostName",go:"host",cppdbg:"miDebuggerServerAddress",python:"host"},{type:h}=g,u=g[l[h]];return u?!["localhost","0.0.0.0","127.0.0.1","::1"].includes(u):!0}return!1}t.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function m(g=""){let l="(-?\\d*\\.\\d\\w*)|([^";for(const h of t.USUAL_WORD_SEPARATORS)g.indexOf(h)>=0||(l+="\\"+h);return l+="\\s]+)",new RegExp(l,"g")}t.DEFAULT_WORD_REGEXP=m();class _{static getInstance(){return _._INSTANCE||(_._INSTANCE=new _),_._INSTANCE}constructor(){this._cache=new Map,this._canvas=document.createElement("canvas")}getCharWidth(l,h){const u=l+h;if(this._cache.has(u))return this._cache.get(u);const d=this._canvas.getContext("2d");d.font=h;const f=d.measureText(l).width;return this._cache.set(u,f),f}}t.CharWidthReader=_,_._INSTANCE=null;const s=g=>{const l=new RegExp(/^\^\"(.*)\"/gm),h=new r.SnippetParser;return new RegExp(/\${\d+:(.*)/).test(g)||l.test(g)?h.parse(g).toString().replace(l,"$1"):g};t.parseSnippet=s},17475:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugBreakpointWidget=t.TopStackType=void 0;const r=e(85608),o=e(76003),c=e(41869),p=e(43718),v=r.__importStar(e(20868)),m=e(64582),_=e(97319),s=e(4983),g=e(27562);var l;(function(u){u[u.exception=0]="exception",u[u.debugger=1]="debugger"})(l||(t.TopStackType=l={}));let h=n=class extends p.Disposable{constructor(){super(),this.breakpointWidgetInputFocus=s.CONTEXT_BREAKPOINT_INPUT_FOCUSED.bind(this.contextKeyService)}get position(){return this._position}get values(){var d;return(d=this.zone)===null||d===void 0?void 0:d.values}get breakpointType(){var d;return(d=this.zone)===null||d===void 0?void 0:d.breakpointType}show(d,E,f="condition"){this.dispose(),this._position=d,this.addDispose(this.zone=this.injector.get(g.DebugBreakpointZoneWidget,[this.editor,{...E},f])),this.addDispose(this.zone.onDidChangeBreakpoint(({context:a,value:b})=>{E&&(E[a]=b)})),this.addDispose(this.zone.onFocus(()=>{this.breakpointWidgetInputFocus.set(!0)})),this.addDispose(this.zone.onBlur(()=>{this.breakpointWidgetInputFocus.set(!1)})),this.addDispose(this.zone.onDispose(()=>{this._position=void 0,this.breakpointWidgetInputFocus.set(!1)})),this.zone.show(v.positionToRange(d),n.LINE_HEIGHT_NUMBER)}hide(){var d;(d=this.zone)===null||d===void 0||d.hide()}};t.DebugBreakpointWidget=h,h.LINE_HEIGHT_NUMBER=2,r.__decorate([(0,o.Autowired)(m.DebugEditor),r.__metadata("design:type",Object)],h.prototype,"editor",void 0),r.__decorate([(0,o.Autowired)(_.DebugBreakpointsService),r.__metadata("design:type",_.DebugBreakpointsService)],h.prototype,"debugBreakpointsService",void 0),r.__decorate([(0,o.Autowired)(c.IContextKeyService),r.__metadata("design:type",Object)],h.prototype,"contextKeyService",void 0),r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],h.prototype,"injector",void 0),t.DebugBreakpointWidget=h=n=r.__decorate([(0,o.Injectable)(),r.__metadata("design:paramtypes",[])],h)},27562:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugBreakpointZoneWidget=void 0;const r=e(85608),o=r.__importDefault(e(14041)),c=r.__importDefault(e(25873)),p=e(76003),v=e(97267),m=e(41869),_=e(43718),s=e(20303),g=e(52416),l=e(31324),h=e(64582),u=e(97319),d=r.__importDefault(e(55797));let E=n=class extends s.ZoneWidget{_fillContainer(a){}get values(){return{...this.contexts,[this.context]:this.input&&this.input.monacoEditor.getValue()||void 0}}get breakpointType(){return this.context}constructor(a,b={},y="condition"){super(a),this.editor=a,this.contexts=b,this.context=y,this._onDidChangeBreakpoint=new _.Emitter,this.onDidChangeBreakpoint=this._onDidChangeBreakpoint.event,this._onFocus=new _.Emitter,this.onFocus=this._onFocus.event,this._onBlur=new _.Emitter,this.onBlur=this._onBlur.event,this.inputFocusHandler=()=>{this._onFocus.fire()},this.inputBlurHandler=()=>{this._onBlur.fire()},this.selectContextHandler=A=>{this.input&&(this.contexts[this.context]=this.input.monacoEditor.getValue()||void 0),this.context=A,this.setInputMode(),this.render()},this._wrapper=document.createElement("div"),this._selection=document.createElement("div"),this._input=document.createElement("div"),this._container.appendChild(this._wrapper),this._wrapper.appendChild(this._selection),this._wrapper.appendChild(this._input),c.default.createRoot(this._input).render(o.default.createElement(o.default.Fragment,null))}hide(){this.input&&(this.input.dispose(),this.input=void 0),super.dispose()}show(a,b){super.show(a,b),this.debugBreakpointsService.createBreakpointInput(this._input).then(y=>{this.input=y;const{monacoEditor:A}=this.input;this.setInputMode(),this.addDispose(A.onDidBlurEditorWidget(()=>{this.inputBlurHandler()})),this.addDispose(A.onDidFocusEditorWidget(()=>{this.inputFocusHandler()})),this.addDispose(A.onDidChangeModelContent(S=>{if(!this.input)return;A.getValue().length===0?this.ensureRenderPlaceholder():this.clearPlaceholder();const T=A.getModel().getLineCount();this._relayout(T+1)})),this.syncPreContent()})}createDecorations(){this.input&&this.input.monacoEditor.getValue().length===0&&this.input.monacoEditor.deltaDecorations([],[{range:{startLineNumber:1,endLineNumber:0,startColumn:0,endColumn:1},options:{description:"debug-breakpoint-zone-widget",afterContentClassName:d.default.input_placeholder}}])}renderOption(a,b){return o.default.createElement(v.Option,{value:a},b)}setInputMode(){var a,b;const y=(a=this.editor.getModel())===null||a===void 0?void 0:a.getLanguageId(),A=(b=this.input)===null||b===void 0?void 0:b.monacoEditor.getModel();A&&y&&A.setLanguage(this.context==="logMessage"?"plaintext":y)}renderPlaceholder(){if(!this.input)return;this.clearPlaceholder();const a=`'${this.placeholder}' !important`;this.cssRenderDisposable=this.cssManager.addClass(n.INPUT_PLACEHOLDER_AFTER,{content:a})}ensureRenderPlaceholder(){this.input&&(this.createDecorations(),this.renderPlaceholder())}syncPreContent(){if(this.input){this.input.focus();const a=this.contexts[this.context]||"";this.input.monacoEditor.setValue(a)}}clearPlaceholder(){this.cssRenderDisposable&&(this.cssRenderDisposable.dispose(),this.cssRenderDisposable=void 0)}applyClass(){if(this._wrapper.className=d.default.debug_breakpoint_wrapper,this._selection.className=d.default.debug_breakpoint_selected,this._input.className=d.default.debug_breakpoint_input,!this.editor.getModel())return;const b=this.editor.getOption(l.EditorOption.lineHeight),y=this.editor.getOption(l.EditorOption.fontSize),A=b-y;this._input.style.marginTop=A+"px"}applyStyle(){this.syncPreContent(),c.default.createRoot(this._selection).render(o.default.createElement(v.Select,{value:this.context,selectedRenderer:()=>o.default.createElement("span",{className:"kt-select-option"},this.getContextToLocalize(this.context)),onChange:this.selectContextHandler},this.renderOption("condition",this.getContextToLocalize("condition")),this.renderOption("hitCondition",this.getContextToLocalize("hitCondition")),this.renderOption("logMessage",this.getContextToLocalize("logMessage"))))}getContextToLocalize(a){switch(a){case"logMessage":return(0,_.localize)("debug.expression.logMessage");case"hitCondition":return(0,_.localize)("debug.expression.hitCondition");default:return(0,_.localize)("debug.expression.condition")}}get placeholder(){switch(this.context){case"logMessage":return(0,_.localize)("debug.expression.log.placeholder");case"hitCondition":return(0,_.localize)("debug.expression.hit.placeholder");default:return(0,_.localize)("debug.expression.condition.placeholder")}}};t.DebugBreakpointZoneWidget=E,E.INPUT_PLACEHOLDER_AFTER=d.default.input_placeholder+"::after",r.__decorate([(0,p.Autowired)(u.DebugBreakpointsService),r.__metadata("design:type",u.DebugBreakpointsService)],E.prototype,"debugBreakpointsService",void 0),r.__decorate([(0,p.Autowired)(m.PreferenceService),r.__metadata("design:type",Object)],E.prototype,"preferenceService",void 0),r.__decorate([(0,p.Autowired)(g.ICSSStyleService),r.__metadata("design:type",Object)],E.prototype,"cssManager",void 0),t.DebugBreakpointZoneWidget=E=n=r.__decorate([(0,p.Injectable)({multiple:!0}),r.__metadata("design:paramtypes",[Object,Object,String])],E)},52943:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugEditorContribution=void 0;const r=e(85608),o=e(76003),c=e(41869),p=e(54414),v=e(51553),m=r.__importStar(e(20868)),_=e(79865),s=e(44781),g=e(38390),l=e(17280),h=e(84303),u=e(38029),d=e(16170),E=e(64582),f=e(5905),a="inlinevaluedecoration",b=100,y=150,A=500,{flatten:S}=c.arrays;class w{constructor(R,P){this.column=R,this.text=P}}function T(M,R,P=1073741824){return R.length>y&&(R=R.substr(0,y)+"..."),{range:{startLineNumber:M,endLineNumber:M,startColumn:P,endColumn:P},renderOptions:{after:{contentText:R,backgroundColor:"rgba(255, 200, 0, 0.2)",margin:"10px"},dark:{after:{color:"rgba(255, 255, 255, 0.5)"}},light:{after:{color:"rgba(0, 0, 0, 0.5)"}}}}}function D(M,R,P,k){const F=new Map;for(const j of M)if(F.set(j.name,j.value),F.size>=b)break;const L=new Map;F.forEach((j,W)=>{const U=k.get(W);if(U)for(const Q of U)R.containsPosition(new c.Position(Q,0))&&(L.has(Q)||L.set(Q,[]),L.get(Q).indexOf(W)===-1&&L.get(Q).push(W))});const B=[];return L.forEach((j,W)=>{const U=j.sort((Q,V)=>{const $=P.getLineContent(W);return $.indexOf(Q)-$.indexOf(V)}).map(Q=>`${Q} = ${F.get(Q)}`).join(", ");B.push(T(W,U))}),B}function I(M){const R=new Map;if(!M)return R;for(let P=1,k=M.getLineCount();P<=k;++P){const F=M.getLineContent(P);if(F.length>A)continue;M.tokenization.forceTokenization(P);const L=M.tokenization.getLineTokens(P);for(let B=0,j=L.getCount();B<j;B++)if(L.getStandardTokenType(B)===g.StandardTokenType.Other){f.DEFAULT_WORD_REGEXP.lastIndex=0;const U=L.getStartOffset(B),Q=L.getEndOffset(B),V=F.substring(U,Q),$=f.DEFAULT_WORD_REGEXP.exec(V);if($){const Y=$[0];R.has(Y)||R.set(Y,[]),R.get(Y).push(P)}}}return R}let O=n=class{constructor(R){this.editor=R,this.disposer=new c.Disposable,this.editorDisposer=new c.Disposable}contribute(R){return this.disposer.addDispose(this.debugSessionManager.onDidChangeActiveDebugSession(()=>{const P=this.debugSessionManager.currentSession;P&&(this.editorDisposer.addDispose(P.onDidChange(async()=>{var k,F;this.setHoverEnabled(R,P.state===E.DebugState.Running);const L=(k=P.currentThread)===null||k===void 0?void 0:k.currentFrame;L&&R.currentUri&&!((F=L.source)===null||F===void 0)&&F.uri.isEqual(R.currentUri)&&await this.toggleExceptionWidget()})),this.editorDisposer.addDispose(P.onDidExitAdapter(()=>{this.setHoverEnabled(R,!0)})),this.editorDisposer.addDispose(this.editorService.onActiveResourceChange(k=>{var F;k?.uri.toString()===((F=P.getModel())===null||F===void 0?void 0:F.uri.toString())?this.setHoverEnabled(R):this.setHoverEnabled(R,!0)})),this.disposer.addDispose([c.Event.any(P.onDidChangeCallStack,P.onDidStop)(async()=>{await this.directRunUpdateInlineValueDecorations(R)}),P.onDidExitAdapter(()=>{this.removeInlineValuesScheduler(R).schedule(),this.editorDisposer.dispose()})]),this.disposer.addDispose(P.onDidChangeState(k=>{k!==E.DebugState.Stopped&&this.toggleExceptionWidget()})),this.disposer.addDispose(P),this.registerEditorListener(R))})),this.disposer.addDispose(this.debugSessionManager.onDidDestroyDebugSession(()=>{this.closeExceptionWidget()})),this.disposer.addDispose(this.editorDisposer),this.toggleExceptionWidget(),this.disposer}registerEditorListener(R){this.editorDisposer.addDispose(R.monacoEditor.onKeyDown(async P=>{var k,F,L,B,j;if(((L=(F=(k=this.debugSessionManager.currentSession)===null||k===void 0?void 0:k.currentFrame)===null||F===void 0?void 0:F.source)===null||L===void 0?void 0:L.uri.toString())===((B=R.currentUri)===null||B===void 0?void 0:B.toString())&&P.keyCode===m.KeyCode.Alt){this.setHoverEnabled(R,!0),(j=this.debugModelManager.model)===null||j===void 0||j.getDebugHoverWidget().hide();const W=R.monacoEditor.onKeyUp(async U=>{var Q;U.keyCode===m.KeyCode.Alt&&(this.setHoverEnabled(R,!1),(Q=this.debugModelManager.model)===null||Q===void 0||Q.getDebugHoverWidget().show(),W.dispose())})}})),this.editorDisposer.addDispose(R.monacoEditor.onDidChangeModelContent(async()=>{n.MEMOIZER.clear(),await this.directRunUpdateInlineValueDecorations(R)})),this.editorDisposer.addDispose(R.monacoEditor.onDidChangeModel(async()=>{this.toggleExceptionWidget(),await this.directRunUpdateInlineValueDecorations(R)}))}registerDecorationType(){this.overrideServicesRegistry.getRegisteredService(c.ServiceNames.CODE_EDITOR_SERVICE).registerDecorationType("inline-value-decoration",a,{})}setHoverEnabled(R,P=!this.debugContextKey.contextInDebugMode.get()){R.monacoEditor.updateOptions({hover:{enabled:P}})}async directRunUpdateInlineValueDecorations(R){var P;const k=(P=this.debugSessionManager.currentSession)===null||P===void 0?void 0:P.currentFrame;k&&(n.MEMOIZER.clear(),await this.updateInlineValueDecorations(k,R))}removeInlineValuesScheduler(R){return new c.RunOnceScheduler(()=>R.monacoEditor.removeDecorationsByType(a),100)}async updateInlineValueDecorations(R,P){var k;if(!P)return;const F="{0} = {1}",L=", ",B=P.monacoEditor.getModel();if(!this.preferenceService.get("debug.inline.values")||!B||!R||B.uri.toString()!==((k=R.source)===null||k===void 0?void 0:k.uri.toString())){this.removeInlineValuesScheduler(P).isScheduled()||this.removeInlineValuesScheduler(P).schedule();return}this.removeInlineValuesScheduler(P).cancel();let j;if(_.languageFeaturesService.inlineValuesProvider.has(B)){const W=async(H,K)=>{const Z=await R.getMostSpecificScopes(R.range()),X=K?H:H.toLowerCase();for(const ie of Z){await ie.ensureLoaded();const le=(ie.children||[]).find(pe=>K?pe.name===X:pe.name.toLowerCase()===X);if(le)return le.value}},U={frameId:R.raw.id,stoppedLocation:(()=>{const H=R.range();return new s.Range(H.startLineNumber,H.startColumn+1,H.endLineNumber,H.endColumn+1)})()},Q=new c.CancellationTokenSource().token,V=P.monacoEditor.getVisibleRanges(),$=_.languageFeaturesService.inlineValuesProvider.ordered(B).reverse();j=[];const Y=new Map,z=S($.map(H=>V.map(K=>Promise.resolve(H.provideInlineValues(B,K,U,Q)).then(async Z=>{if(Z)for(const X of Z){let ie;switch(X.type){case"text":ie=X.text;break;case"variable":{let oe=X.variableName;oe||(oe=B.getLineContent(X.range.startLineNumber).substring(X.range.startColumn-1,X.range.endColumn-1));const le=await W(oe,X.caseSensitiveLookup);le&&(ie=c.strings.format(F,oe,le));break}case"expression":{let oe=X.expression;if(oe||(oe=B.getLineContent(X.range.startLineNumber).substring(X.range.startColumn-1,X.range.endColumn-1)),oe){const le=new d.DebugWatchRoot(R.thread.session),pe=new d.DebugWatchNode(R.thread.session,oe,le);await pe.evaluate(oe),pe.available&&(ie=c.strings.format(F,oe,pe.description))}break}}if(ie){const oe=X.range.startLineNumber;let le=Y.get(oe);le||(le=[],Y.set(oe,le)),le.some(pe=>pe.text===ie)||le.push(new w(X.range.startColumn,ie))}}},Z=>{(0,c.onUnexpectedExternalError)(Z)}))));await Promise.all(z),Y.forEach((H,K)=>{if(H.length>0){H=H.sort((X,ie)=>X.column-ie.column);const Z=H.map(X=>X.text).join(L);j.push(T(K,Z))}})}else{const W=await R.getMostSpecificScopes(R.range());j=(await Promise.all(W.map(async Q=>{await Q.ensureLoaded();const V=Q.children||[],$=R.range(),Y=Q.range();let z=new s.Range(0,0,$.startLineNumber,$.startColumn);return Y&&(z=z.setStartPosition(Y.startLineNumber,Y.startColumn)),D(V,z,B,I(P?.monacoEditor.getModel()))}))).reduce((Q,V)=>Q.concat(V),[])}P.monacoEditor.setDecorationsByType("inline-value-decoration",a,j)}async toggleExceptionWidget(){var R,P;const k=this.debugSessionManager.currentSession;if(!k){this.closeExceptionWidget();return}const{currentThread:F}=k;if(!F){this.closeExceptionWidget();return}const L=F.frames.find(j=>!!(j&&j.source&&j.source.available&&j.source.presentationHint!=="deemphasize"));if(!L){this.closeExceptionWidget();return}const B=(R=this.editor.currentUri)===null||R===void 0?void 0:R.isEqual((P=L.source)===null||P===void 0?void 0:P.uri);if(this.debugExceptionWidget&&!B)this.closeExceptionWidget();else if(B){const j=await F?.fetchExceptionInfo();j&&this.showExceptionWidget(j,k,L.range().startLineNumber,L.range().startColumn)}}showExceptionWidget(R,P,k,F){this.debugExceptionWidget&&this.debugExceptionWidget.dispose();const L=P?.currentEditor();this.debugExceptionWidget=this.injector.get(h.DebugExceptionWidget,[L,R]),this.debugExceptionWidget.show(m.positionToRange({lineNumber:k,column:F}),10),this.debugExceptionWidget.focus(),L?.revealRangeInCenter({startLineNumber:k,startColumn:F,endLineNumber:k,endColumn:F}),this.debugContextKey.contextExceptionWidgetVisible.set(!0)}closeExceptionWidget(){this.debugExceptionWidget&&(this.debugContextKey.contextExceptionWidgetVisible.set(!1),this.debugExceptionWidget.dispose(),this.debugExceptionWidget=void 0)}};t.DebugEditorContribution=O,O.MEMOIZER=(0,c.createMemoizer)(),r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],O.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(c.IContextKeyService),r.__metadata("design:type",Object)],O.prototype,"contextKeyService",void 0),r.__decorate([(0,o.Autowired)(E.IDebugModelManager),r.__metadata("design:type",Object)],O.prototype,"debugModelManager",void 0),r.__decorate([(0,o.Autowired)(E.IDebugSessionManager),r.__metadata("design:type",u.DebugSessionManager)],O.prototype,"debugSessionManager",void 0),r.__decorate([(0,o.Autowired)(c.PreferenceService),r.__metadata("design:type",Object)],O.prototype,"preferenceService",void 0),r.__decorate([(0,o.Autowired)(c.MonacoOverrideServiceRegistry),r.__metadata("design:type",c.MonacoOverrideServiceRegistry)],O.prototype,"overrideServicesRegistry",void 0),r.__decorate([(0,o.Autowired)(p.WorkbenchEditorService),r.__metadata("design:type",v.WorkbenchEditorServiceImpl)],O.prototype,"editorService",void 0),r.__decorate([(0,o.Autowired)(l.DebugContextKey),r.__metadata("design:type",l.DebugContextKey)],O.prototype,"debugContextKey",void 0),t.DebugEditorContribution=O=n=r.__decorate([(0,o.Injectable)(),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[Object])],O)},74257:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugExpressionProvider=void 0;const n=e(85608),r=e(76003),o=e(43718),c=n.__importStar(e(20868)),p=e(39266),{coalesce:v}=o.arrays;let m=class{async get(s,g){var l,h;let u,d;if(this.evaluatableExpressionService.hasEvaluatableExpressProvider(s)){const E=new o.CancellationTokenSource,f=this.evaluatableExpressionService.getSupportedEvaluatableExpressionProvider(s),a=new c.Position(g.startLineNumber,g.startColumn),b=f.map(A=>Promise.resolve(A.provideEvaluatableExpression(s,a,E.token)).then(S=>S,()=>{})),y=await Promise.all(b).then(v);y.length>0&&(u=(l=y[0])===null||l===void 0?void 0:l.expression,d=(h=y[0])===null||h===void 0?void 0:h.range,!u&&d&&(u=s.getLineContent(a.lineNumber).substring(d.startColumn-1,d.endColumn-1)))}else{const E=s.getLineContent(g.startLineNumber),{start:f,end:a}=this.getExactExpressionStartAndEnd(E,g.startColumn,g.endColumn);u=E.substring(f-1,a)}return u}getExactExpressionStartAndEnd(s,g,l){let h,u=0;const d=/([^()[\]{}<>\s+\-/%~#^;=|,`!]|->)+/g;let E=null;for(;E=d.exec(s);){const f=E.index+1,a=f+E[0].length;if(f<=g&&a>=l){h=E[0],u=f;break}}if(h){const f=/\w+/g;let a=null;for(;(a=f.exec(h))&&!(a.index+1+u+a[0].length>=l););a&&(h=h.substring(0,f.lastIndex))}return h?{start:u,end:u+h.length-1}:{start:0,end:0}}};t.DebugExpressionProvider=m,n.__decorate([(0,r.Autowired)(p.IEvaluatableExpressionService),n.__metadata("design:type",Object)],m.prototype,"evaluatableExpressionService",void 0),t.DebugExpressionProvider=m=n.__decorate([(0,r.Injectable)()],m)},3367:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverModel=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(98650);let m=n=class extends c.TreeModel{constructor(s){super(),this.flushDispatchChangeDelayer=new p.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this.init(s)}init(s){this.root=s,this.root.watcher.on(c.TreeNodeEvent.BranchDidUpdate,()=>{this.flushDispatchChangeDelayer.isTriggered()||this.flushDispatchChangeDelayer.cancel(),this.flushDispatchChangeDelayer.trigger(async()=>{this.dispatchChange()})})}};t.DebugHoverModel=m,m.DEFAULT_FLUSH_DELAY=100,t.DebugHoverModel=m=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[v.ExpressionContainer])],m)},23217:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverSource=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(64582),p=e(38029),v=e(98650);let m=class{constructor(){this.onDidChangeEmitter=new o.Emitter,this.onDidChange=this.onDidChangeEmitter.event}dispose(){this._expression=void 0}get expression(){return this._expression}clearEvaluate(){this.onDidChangeEmitter.fire(void 0)}async evaluate(s){const g=await this.doEvaluate(s);return this._expression=g,this.onDidChangeEmitter.fire(g),g}async doEvaluate(s){const{currentSession:g}=this.sessions;if(g){if(g.capabilities.supportsEvaluateForHovers){const l=new v.DebugHoverVariableRoot(s,g);return await l.evaluate("hover"),l.available&&l||void 0}return this.findVariable(s.split(".").map(l=>l.trim()).filter(l=>!!l))}}async findVariable(s){const{currentFrame:g}=this.sessions;if(!g)return;let l;const h=await g.getScopes();for(const u of h){const d=await this.doFindVariable(u,s);if(!l)l=d;else if(d&&d.value!==l.value)return}return l}async doFindVariable(s,g){await s.ensureLoaded();const l=s.children,h=[];if(l){for(const u of l)(u instanceof v.DebugVariableContainer||u instanceof v.DebugVariable)&&u.name===g[0]&&h.push(u);if(h.length===1)return g.length===1?h[0]:this.doFindVariable(h[0],g.slice(1))}}};t.DebugHoverSource=m,n.__decorate([(0,r.Autowired)(c.IDebugSessionManager),n.__metadata("design:type",p.DebugSessionManager)],m.prototype,"sessions",void 0),t.DebugHoverSource=m=n.__decorate([(0,r.Injectable)()],m)},85322:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverTreeModelService=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(98650),m=r.__importDefault(e(57259)),_=e(3367),s=e(23217),{Path:g}=p.path;let l=n=class{constructor(){this._changeEventDispatchQueue=[],this.selectedDecoration=new c.Decoration(m.default.mod_selected),this.focusedDecoration=new c.Decoration(m.default.mod_focused),this.loadingDecoration=new c.Decoration(m.default.mod_loading),this._selectedNodes=[],this.onDidRefreshedEmitter=new p.Emitter,this.onDidUpdateTreeModelOrVariableEmitter=new p.Emitter,this.disposableCollection=new p.DisposableCollection,this.activeNodeDecoration=(u,d=!0)=>{if(this.preContextMenuFocusedNode&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedNode),this.selectedDecoration.removeTarget(this.preContextMenuFocusedNode),this.preContextMenuFocusedNode=null),u){if(this.selectedNodes.length>0)for(const E of this.selectedDecoration.appliedTargets.keys())this.selectedDecoration.removeTarget(E);this.focusedNode&&this.focusedDecoration.removeTarget(this.focusedNode),this.selectedDecoration.addTarget(u),this.focusedDecoration.addTarget(u),this._focusedNode=u,this._selectedNodes=[u],d&&this.treeModel.dispatchChange()}},this.activeNodeFocusedDecoration=(u,d=!1)=>{this.focusedNode!==u&&(d?(this.preContextMenuFocusedNode?(this.focusedDecoration.removeTarget(this.preContextMenuFocusedNode),this.selectedDecoration.removeTarget(this.preContextMenuFocusedNode)):this.focusedNode&&this.focusedDecoration.removeTarget(this.focusedNode),this.preContextMenuFocusedNode=u):this.focusedNode&&(this.preContextMenuFocusedNode=null,this.focusedDecoration.removeTarget(this.focusedNode)),u&&(this.selectedDecoration.addTarget(u),this.focusedDecoration.addTarget(u),this._focusedNode=u,this._selectedNodes.push(u))),this.treeModel.dispatchChange()},this.enactiveNodeDecoration=()=>{this.focusedNode&&(this.focusedDecoration.removeTarget(this.focusedNode),this.treeModel.dispatchChange()),this._focusedNode=void 0},this.handleTreeBlur=()=>{this.enactiveNodeDecoration()},this.handleTwistierClick=u=>{v.ExpressionContainer.is(u)?(this.activeNodeDecoration(u,!1),this.toggleDirectory(u)):this.activeNodeDecoration(u)},this.toggleDirectory=async u=>{u.expanded?this.treeHandle.collapseNode(u):this.treeHandle.expandNode(u)},this.flushEventQueue=()=>{let u;if(!this._changeEventDispatchQueue||this._changeEventDispatchQueue.length===0)return;this._changeEventDispatchQueue.sort((E,f)=>{const a=g.pathDepth(E),b=g.pathDepth(f);return a-b});const d=[this._changeEventDispatchQueue[0]];for(const E of this._changeEventDispatchQueue)d.some(f=>E.indexOf(f)===0)||d.push(E);return u=(0,p.pSeries)(d.map(E=>async()=>{var f;const a=(f=this.treeModel.root)===null||f===void 0?void 0:f.watchEvents.get(E);return a&&typeof a.callback=="function"&&await a.callback({type:c.WatchEvent.Changed,path:E}),null})),this._changeEventDispatchQueue=[],u},this.debugHoverSource.onDidChange(async u=>{if(!u){this.onDidUpdateTreeModelOrVariableEmitter.fire({treeModel:void 0,variable:void 0});return}u instanceof v.DebugVariable?(this.dispose(),this.onDidUpdateTreeModelOrVariableEmitter.fire({variable:u})):(await this.initTreeModel(u),this.onDidUpdateTreeModelOrVariableEmitter.fire({treeModel:this.treeModel}))})}get onDidRefreshed(){return this.onDidRefreshedEmitter.event}get onDidUpdateTreeModelOrVariable(){return this.onDidUpdateTreeModelOrVariableEmitter.event}get flushEventQueuePromise(){return this.flushEventQueueDeferred&&this.flushEventQueueDeferred.promise}get treeHandle(){return this._debugHoverTreeHandle}get decorations(){return this._decorations}get treeModel(){return this._treeModel}get whenReady(){return this._whenReady}get focusedNode(){return this._focusedNode}get selectedNodes(){return this._selectedNodes}dispose(){this.disposableCollection.disposed||this.disposableCollection.dispose()}listenTreeViewChange(){var u,d;this.dispose(),this.disposableCollection.push((u=this.treeModel)===null||u===void 0?void 0:u.root.watcher.on(c.TreeNodeEvent.WillResolveChildren,E=>{this.loadingDecoration.addTarget(E)})),this.disposableCollection.push((d=this.treeModel)===null||d===void 0?void 0:d.root.watcher.on(c.TreeNodeEvent.DidResolveChildren,E=>{this.loadingDecoration.removeTarget(E)}))}async initTreeModel(u){if(u)return this._treeModel=this.injector.get(_.DebugHoverModel,[u]),this.initDecorations(u),this.listenTreeViewChange(),this._treeModel}initDecorations(u){this._decorations=new c.DecorationsManager(u),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.loadingDecoration)}removeNodeDecoration(){this.decorations&&(this.decorations.removeDecoration(this.selectedDecoration),this.decorations.removeDecoration(this.focusedDecoration))}handleTreeHandler(u){this._debugHoverTreeHandle=u}async refresh(u=this.treeModel.root){!v.ExpressionContainer.is(u)&&u.parent&&(u=u.parent),this.queueChangeEvent(u.path,()=>{this.onDidRefreshedEmitter.fire()})}queueChangeEvent(u,d){this.flushEventQueueDeferred||(this.flushEventQueueDeferred=new p.Deferred,clearTimeout(this._eventFlushTimeout),this._eventFlushTimeout=setTimeout(async()=>{var E;await this.flushEventQueue(),(E=this.flushEventQueueDeferred)===null||E===void 0||E.resolve(),this.flushEventQueueDeferred=null,d()},n.DEFAULT_FLUSH_FILE_EVENT_DELAY)),this._changeEventDispatchQueue.indexOf(u)===-1&&this._changeEventDispatchQueue.push(u)}};t.DebugHoverTreeModelService=l,l.DEFAULT_FLUSH_FILE_EVENT_DELAY=100,r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],l.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(s.DebugHoverSource),r.__metadata("design:type",s.DebugHoverSource)],l.prototype,"debugHoverSource",void 0),t.DebugHoverTreeModelService=l=n=r.__decorate([(0,o.Injectable)(),r.__metadata("design:paramtypes",[])],l)},65960:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverWidget=void 0;const r=e(85608),o=r.__importDefault(e(12784)),c=r.__importDefault(e(14041)),p=r.__importDefault(e(25873)),v=e(76003),m=e(41869),_=r.__importStar(e(20868)),s=e(62663),g=e(64582),l=e(38029),h=e(74257),u=e(23217),d=e(63940);let E=n=class{constructor(){this.toDispose=new m.DisposableCollection,this.allowEditorOverflow=!0,this.doSchedule=(0,o.default)(a=>a(),300),this.init()}init(){this.toDispose.pushAll([m.Disposable.create(()=>this.editor.removeContentWidget(this)),m.Disposable.create(()=>this.hide()),this.sessions.onDidChange(()=>{this.isEditorFrame()||this.hide()})]),this.renderView()}handleWindowWheel(a){a.stopPropagation()}getId(){return n.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.classList.add(n.ID)),this.domNode}getPosition(){var a;const b=this.options&&this.options.selection.getStartPosition(),y=b&&((a=this.editor.getModel())===null||a===void 0?void 0:a.getWordAtPosition(b));return b&&y?{position:new _.Position(b.lineNumber,y.startColumn),preference:[s.monacoBrowser.editor.ContentWidgetPositionPreference.BELOW,s.monacoBrowser.editor.ContentWidgetPositionPreference.ABOVE]}:null}dispose(){this.toDispose.dispose()}show(a){this.schedule(()=>this.doShow(a),a&&a.immediate)}hide(a){this.schedule(()=>this.doHide(),a&&a.immediate)}schedule(a,b=!0){b?(this.doSchedule.cancel(),a()):this.doSchedule(a)}isEditorFrame(){const{currentFrame:a}=this.sessions;return!!a&&!!a.source&&!!this.editor.getModel()&&this.editor.getModel().uri.toString()===a.source.uri.toString()}doHide(){window.removeEventListener("mousewheel",this.handleWindowWheel,!0),this.getDomNode().contains(document.activeElement)&&this.editor.focus(),this.hoverSource.dispose(),this.hoverSource.clearEvaluate(),this.options=void 0,this.editor.removeContentWidget(this)}layoutContentWidget(){this.editor.layoutContentWidget(this)}renderView(){p.default.createRoot(this.getDomNode()).render(c.default.createElement(m.ConfigProvider,{value:this.configContext},c.default.createElement(d.DebugHoverView,null))),this.layoutContentWidget()}async doShow(a=this.options){if(!this.isEditorFrame()||!a||this.options&&this.options.selection.equalsRange(a.selection))return;this.options=a;const b=await this.expressionProvider.get(this.editor.getModel(),a.selection);b&&(this.hoverSource.clearEvaluate(),await this.hoverSource.evaluate(b)&&(this.reporterService.point(g.DEBUG_REPORT_NAME===null||g.DEBUG_REPORT_NAME===void 0?void 0:g.DEBUG_REPORT_NAME.DEBUG_VARIABLES,"hover",b),this.editor.addContentWidget(this),window.addEventListener("mousewheel",this.handleWindowWheel,!0)))}};t.DebugHoverWidget=E,E.ID="debug-hover-widget",r.__decorate([(0,v.Autowired)(g.DebugEditor),r.__metadata("design:type",Object)],E.prototype,"editor",void 0),r.__decorate([(0,v.Autowired)(g.IDebugSessionManager),r.__metadata("design:type",l.DebugSessionManager)],E.prototype,"sessions",void 0),r.__decorate([(0,v.Autowired)(h.DebugExpressionProvider),r.__metadata("design:type",h.DebugExpressionProvider)],E.prototype,"expressionProvider",void 0),r.__decorate([(0,v.Autowired)(u.DebugHoverSource),r.__metadata("design:type",u.DebugHoverSource)],E.prototype,"hoverSource",void 0),r.__decorate([(0,v.Autowired)(m.AppConfig),r.__metadata("design:type",Object)],E.prototype,"configContext",void 0),r.__decorate([(0,v.Autowired)(m.IReporterService),r.__metadata("design:type",Object)],E.prototype,"reporterService",void 0),t.DebugHoverWidget=E=n=r.__decorate([(0,v.Injectable)(),r.__metadata("design:paramtypes",[])],E)},63940:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=e(97267),p=e(41869),v=e(1149),m=e(28875),_=e(85322),s=n.__importDefault(e(94084)),g=()=>{const l=(0,p.useInjectable)(_.DebugHoverTreeModelService),h=(0,p.useInjectable)(v.LayoutViewSizeConfig),u=250,d=420,E=4,[f,a]=o.default.useState({}),[b,y]=o.default.useState(u),A=o.default.useRef(null);o.default.useEffect(()=>(l.onDidUpdateTreeModelOrVariable(async M=>{const{treeModel:R,variable:P}=M;R&&await R.ensureReady,a({treeModel:R,variable:P})}),S(),()=>{l.removeNodeDecoration()}),[]),o.default.useEffect(()=>{let M;return y(u),f.treeModel&&(M=f.treeModel.root.watcher.on(c.TreeNodeEvent.DidChangeExpansionState,()=>{var R,P;const k=Math.max(u,(((R=f.treeModel)===null||R===void 0?void 0:R.root.branchSize)||0)*22),F=(P=A.current)===null||P===void 0?void 0:P.getBoundingClientRect();if(F){const L=F.top,B=window.innerHeight-L-h.statusBarHeight-E;y(Math.min(B,k,d))}else y(Math.min(d,k))})),()=>{M?.dispose()}},[f.treeModel]);const S=async()=>{l.treeModel&&(await l.treeModel.ensureReady,a({treeModel:l.treeModel}))},w=M=>{l.handleTreeHandler({...M,getModel:()=>f?.treeModel,hasDirectFocus:()=>A.current===document.activeElement})},T=(M,R)=>{M.stopPropagation();const{handleTwistierClick:P}=l;R&&P(R)},D=!!f.treeModel&&!!f.treeModel.root.variablesReference,I=o.default.useCallback(M=>{const R=l.decorations.getDecorations(M.item);return o.default.createElement(m.DebugVariableRenderedNode,{item:M.item,itemType:M.itemType,decorations:R,onClick:T,onTwistierClick:T,defaultLeftPadding:0,leftPadding:4})},[f.treeModel]),O=()=>D?o.default.createElement("div",{className:s.default.debug_hover_content,tabIndex:-1,ref:A},o.default.createElement(c.RecycleTree,{height:b,itemHeight:m.DEBUG_VARIABLE_TREE_NODE_HEIGHT,onReady:w,model:f.treeModel,placeholder:()=>o.default.createElement("span",null),overflow:"auto"},I)):null;return o.default.createElement("div",{className:s.default.debug_hover},f.treeModel?o.default.createElement("div",{className:(0,r.default)(s.default.debug_hover_title,D&&s.default.has_complex_value),title:f.treeModel.root.name},f.treeModel.root.name):f.variable&&o.default.createElement("div",{className:(0,r.default)(s.default.debug_hover_title,D&&s.default.has_complex_value),title:f.variable.name},f.variable.value),O())};t.DebugHoverView=g},71569:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugModelManager=void 0;const n=e(85608),r=e(76003),o=e(43718),c=e(54414),p=e(64582),v=e(99797),m=e(37499);let _=class extends o.Disposable{constructor(){super(),this.toDispose=new o.DisposableCollection,this._onMouseDown=new o.Emitter,this._onMouseMove=new o.Emitter,this._onMouseLeave=new o.Emitter,this._onMouseUp=new o.Emitter,this.onMouseDown=this._onMouseDown,this.onMouseMove=this._onMouseMove,this.onMouseLeave=this._onMouseLeave,this.onMouseUp=this._onMouseUp,this._onModelChanged=new o.Emitter,this.onModelChanged=this._onModelChanged.event,this.models=new Map}dispose(){for(const g of this.models.values())this.toDispose.pushAll(g);this.toDispose.dispose(),this.models.clear()}init(){this.editorCollection.onCodeEditorCreate(g=>this.push(g)),this.breakpointManager.onDidChangeBreakpoints(g=>{const{currentEditor:l}=this.editorService,h=l&&l.currentUri;h&&this.render(h),this.closeBreakpointIfAffected(g)})}get model(){const{currentEditor:g}=this.editorService,l=g&&g.currentUri;if(l){const h=this.models.get(l.toString());return h&&h[0]}}closeBreakpointIfAffected({affected:g,removed:l}){g.forEach(h=>{const u=this.models.get(h.toString());if(u)for(const d of u){const E=d.getBreakpointWidget(),f=E.position;if(!f)return;for(const a of l)a.raw.line===f.lineNumber&&E.dispose()}})}render(g){const l=this.models.get(g.toString());if(l)for(const h of l)h.render()}push(g){const l=g.monacoEditor;g.onRefOpen(u=>{const d=u.instance.uri.toString(),E=this.models.get(d)||[];let f=!1;if(E.length>0){for(const a of E)if(a.getEditor()._id===l._id){a.render(),f=!0;break}}if(!f){const a=u.instance.getMonacoModel(),b=this.debugModelFactory(l);E.push(b),this.models.set(d,E),a.onWillDispose(()=>{b.dispose(),this.models.delete(d)})}});const h=(u,d)=>{const E=l.getModel();if(!E)throw new Error("Not find model");this.handleMouseEvent(new o.URI(E.uri.toString()),u,d,l)};this.toDispose.push(l.onMouseMove(u=>h(p.DebugModelSupportedEventType.move,u))),this.toDispose.push(l.onMouseDown(u=>h(p.DebugModelSupportedEventType.down,u))),this.toDispose.push(l.onMouseLeave(u=>h(p.DebugModelSupportedEventType.leave,u))),this.toDispose.push(l.onContextMenu(u=>h(p.DebugModelSupportedEventType.contextMenu,u))),this.toDispose.push(l.onDidChangeModel(u=>this._onModelChanged.fire(u)))}resolve(g){const l=this.models.get(g.toString());if(l)return l}handleMouseEvent(g,l,h,u){const d=this.models.get(g.toString());if(!(!d||!this.debugConfigurationManager.canSetBreakpointsIn(d[0].getEditor().getModel()))){for(const f of d)if(f.getEditor().getId()===u.getId()){switch(l){case p.DebugModelSupportedEventType.contextMenu:f.onContextMenu(h);break;case p.DebugModelSupportedEventType.down:f.onMouseDown(h);break;case p.DebugModelSupportedEventType.leave:f.onMouseLeave(h);break;case p.DebugModelSupportedEventType.move:f.onMouseMove(h);break;default:break}break}}}};t.DebugModelManager=_,n.__decorate([(0,r.Autowired)(c.WorkbenchEditorService),n.__metadata("design:type",c.WorkbenchEditorService)],_.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(c.EditorCollectionService),n.__metadata("design:type",c.EditorCollectionService)],_.prototype,"editorCollection",void 0),n.__decorate([(0,r.Autowired)(p.DebugModelFactory),n.__metadata("design:type",Function)],_.prototype,"debugModelFactory",void 0),n.__decorate([(0,r.Autowired)(v.BreakpointManager),n.__metadata("design:type",v.BreakpointManager)],_.prototype,"breakpointManager",void 0),n.__decorate([(0,r.Autowired)(m.DebugConfigurationManager),n.__metadata("design:type",m.DebugConfigurationManager)],_.prototype,"debugConfigurationManager",void 0),t.DebugModelManager=_=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],_)},91260:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugModel=void 0;const r=e(85608),o=r.__importDefault(e(12784)),c=e(76003),p=e(41869),v=e(93899),m=e(43718),_=r.__importStar(e(20868)),s=e(62663),g=e(52416),l=e(64582),h=e(24395),u=e(26296),d=e(99797),E=e(38949),f=e(38029),a=e(97319),b=e(17475),y=e(65960),A=r.__importStar(e(26571));let S=n=class{static createContainer(D,I){return D.createChild([{token:h.DebugEditor,useValue:I},{token:y.DebugHoverWidget,useClass:y.DebugHoverWidget},{token:b.DebugBreakpointWidget,useClass:b.DebugBreakpointWidget},{token:l.IDebugModel,useClass:n}])}static createModel(D,I){return n.createContainer(D,I).get(l.IDebugModel)}get uri(){return this._uri}constructor(){this.toDispose=new m.DisposableCollection,this.frameDecorations=[],this.updatingDecorations=!1,this.breakpointDecorations=[],this.breakpointRanges=new Map,this.currentBreakpointDecorations=[],this.candidateDecorations=[],this.renderFrames=(0,o.default)((D=[])=>{var I;if(this.toDispose.disposed||((I=this.editor.getModel())===null||I===void 0?void 0:I.uri.toString())!==this._uri.toString())return;const O=this.createFrameDecorations().concat(D);this.frameDecorations=this.deltaDecorations(this.frameDecorations,O)},100),this.toggleBreakpoint=(D=this.position)=>{this.doToggleBreakpoint(D)},this.openBreakpointView=(D,I,O)=>{this.breakpointWidget.show(D,I,O)},this.closeBreakpointView=()=>{this.breakpointWidget.hide()},this.acceptBreakpoint=()=>{const{position:D,values:I}=this.breakpointWidget;if(this.reporterService.point(l.DEBUG_REPORT_NAME===null||l.DEBUG_REPORT_NAME===void 0?void 0:l.DEBUG_REPORT_NAME.DEBUG_BREAKPOINT,this.breakpointWidget.breakpointType),D&&I){const O=this.getBreakpoint(D);O?(O.raw.condition=I.condition,O.raw.hitCondition=I.hitCondition,O.raw.logMessage=I.logMessage,this.breakpointManager.updateBreakpoint(O)):this.breakpointManager.addBreakpoint(d.DebugBreakpoint.create(this._uri,{line:D.lineNumber,...I})),this.breakpointWidget.hide()}},this.hintDecorations=[],this.init()}async init(){const D=this.editor.getModel();let I;this._uri=new m.URI(D.uri.toString()),this.decorator=new E.DebugDecorator,this.toDispose.pushAll([this.breakpointWidget,this.editor.onKeyDown(()=>this.debugHoverWidget.hide({immediate:!1})),this.editor.onDidChangeModelContent(()=>this.renderFrames()),this.debugSessionManager.onDidChange(()=>this.renderFrames()),this.debugBreakpointsService.onDidFocusedBreakpoints(({range:O})=>{this.preferenceService.getValid("debug.breakpoint.editorHint",!0)&&(this.renderFrames([{options:A.FOCUS_BREAKPOINTS_STACK_FRAME_DECORATION,range:O}]),I&&clearTimeout(I),I=window.setTimeout(()=>{this.renderFrames(),clearTimeout(I)},300))}),this.editor.getModel().onDidChangeContent(()=>this.updateBreakpoints()),this.editor.onDidChangeModel(()=>{this.closeBreakpointView()})]),this.renderFrames(),this.render()}dispose(){this.toDispose.dispose()}get position(){return this._position||this.editor.getPosition()}get breakpoint(){return this.getBreakpoint()}getBreakpoint(D){return this.breakpointManager.getBreakpoint(this._uri,D?D.lineNumber:void 0)}createFrameDecorations(){var D;const I=[],{currentFrame:O,topFrame:M}=this.debugSessionManager;if(!O||!O.source||O.source.uri.toString()!==((D=this.editor.getModel())===null||D===void 0?void 0:D.uri.toString()))return I;const R=new _.Range(O.raw.line,O.raw.column,O.raw.line,1<<30),P=new _.Range(O.raw.line,O.raw.column,O.raw.line,O.raw.column+1);if(M===O)if(I.push({options:A.TOP_STACK_FRAME_MARGIN,range:P}),O.thread.stoppedDetails&&O.thread.stoppedDetails.reason==="exception")I.push({options:A.TOP_STACK_FRAME_EXCEPTION_DECORATION,range:R});else{I.push({options:A.TOP_STACK_FRAME_DECORATION,range:R});const{topFrameRange:k}=this;k&&k.startLineNumber===O.raw.line&&k.startColumn!==O.raw.column&&I.push({options:A.TOP_STACK_FRAME_INLINE_DECORATION,range:R}),this.topFrameRange=R}else I.push({options:A.FOCUSED_STACK_FRAME_MARGIN,range:P}),I.push({options:A.FOCUSED_STACK_FRAME_DECORATION,range:R});return I}deltaDecorations(D,I){this.updatingDecorations=!0;try{return this.editor.deltaDecorations(D,I)}finally{this.updatingDecorations=!1}}focusStackFrame(){this.renderFrames()}async render(){await this.renderBreakpoints(),this.renderFrames()}async renderBreakpoints(){await this.breakpointManager.whenReady,this.renderNormalBreakpoints(),this.renderCurrentBreakpoints()}renderNormalBreakpoints(){const D=this.createBreakpointDecorations();this.breakpointDecorations=this.deltaDecorations(this.breakpointDecorations,D),this.updateBreakpointRanges()}updateBreakpoints(){if(this.areBreakpointsAffected()){const D=this.createBreakpoints();this.breakpointManager.setBreakpoints(this._uri,D)}}areBreakpointsAffected(){if(this.updatingDecorations||!this.editor.getModel())return!1;for(const D of this.breakpointDecorations){const I=this.editor.getModel().getDecorationRange(D),O=this.breakpointRanges.get(D);if(!I||!I.equalsRange(O))return!0}return!1}createBreakpoints(){const{_uri:D}=this,I=new Set,O=[];for(const M of this.breakpointDecorations){const R=this.editor.getModel().getDecorationRange(M);if(R&&!I.has(R.startLineNumber)){const P=R.startLineNumber,k=this.breakpointRanges.get(M),F=k&&this.breakpointManager.getBreakpoint(D,k.startLineNumber)||{},L=d.DebugBreakpoint.create(D,{...F.raw||{},line:P},F.enabled);O.push(L),I.add(P)}}return O}createBreakpointDecorations(){return this.breakpointManager.getBreakpoints(this._uri).map(I=>this.createBreakpointDecoration(I))}createBreakpointDecoration(D){const I=D.raw.line,O=D.raw.column||0;return{range:new _.Range(I,O,I,O+1),options:{description:"breakpoint-decoration",stickiness:A.STICKINESS}}}async renderCurrentBreakpoints(){const D=this.breakpointManager.getBreakpoints(this._uri),I=this.createCurrentBreakpointDecorations(),O=this.deltaDecorations(this.currentBreakpointDecorations.map(({decorationId:P})=>P),I);this.currentBreakpointDecorations.forEach(P=>{P.inlineWidget&&P.inlineWidget.dispose()}),this.currentBreakpointDecorations=O.map((P,k)=>{const F=I[k],L=D[k],B=(L.enabled?A.BREAKPOINT_DECORATION:A.BREAKPOINT_DECORATION_DISABLED).glyphMarginClassName,j=F.options.beforeContentClassName?new w(this.editor,P,B,L,this.breakpointManager):void 0;return{breakpoint:L,decorationId:P,inlineWidget:j}});const M=await this.getCandidateBreakpoints(D),R=this.deltaDecorations(this.candidateDecorations.map(({decorationId:P})=>P),M);this.candidateDecorations.forEach(P=>{P.inlineWidget.dispose()}),this.candidateDecorations=R.map((P,k)=>{const{breakpoint:F}=M[k],L=(F?A.BREAKPOINT_DECORATION:A.BREAKPOINT_DECORATION_DISABLED).glyphMarginClassName,B=new w(this.editor,P,L,F,this.breakpointManager);return{decorationId:P,inlineWidget:B}})}async getCandidateBreakpoints(D){const I=this.editor.getModel(),O=this.debugSessionManager.currentSession;if(!I||!O?.capabilities.supportsBreakpointLocationsRequest)return[];const M=Array.from(new Set(D.map(P=>P.raw.line))),R=[];return await Promise.all(M.map(async P=>{const k=await O.breakpointLocations(this._uri,P);if(k.length<=1)return;const F=I.getLineCount();if(P>F)return;const L=I.getLineFirstNonWhitespaceColumn(P),B=I.getLineLastNonWhitespaceColumn(P);k.forEach(j=>{const W=new _.Range(j.lineNumber,j.column,j.lineNumber,j.column+1);if(j.column<=L||j.column>B)return;const U=this.currentBreakpointDecorations.find(({breakpoint:Q})=>Q.raw.line===W.startLineNumber&&Q.raw.column===W.startColumn);U?.inlineWidget||R.push({range:W,options:{description:"debug-breakpoint-placeholder",stickiness:_.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,beforeContentClassName:U?void 0:"debug-breakpoint-placeholder"},breakpoint:U?.breakpoint})})})),R}createCurrentBreakpointDecorations(){return this.breakpointManager.getBreakpoints(this._uri).filter(I=>(0,d.isDebugBreakpoint)(I)).map(I=>this.createCurrentBreakpointDecoration(I))}createCurrentBreakpointDecoration(D){const I=this.debugSessionManager.currentSession,O=D.status.get(I&&I.id||""),M=O&&O.line?O.line:D.raw.line,R=D.raw.column||0,P=this.editor.getModel(),k=P.getLineCount(),F=M>k?!1:R>P.getLineFirstNonWhitespaceColumn(M),L=new _.Range(M,R,M,R+1),{className:B,message:j}=this.decorator.getDecoration(D,!!I,this.breakpointManager.breakpointsEnabled),W=this.preferenceService.getValid("debug.breakpoint.showBreakpointsInOverviewRuler",!1);let U=null;return W&&(U={color:this.themeService.getColor({id:g.debugIconBreakpointForeground}),position:_.editor.OverviewRulerLane.Left}),{range:L,options:{description:"debug-breakpoint-placeholder",glyphMarginClassName:B,glyphMarginHoverMessage:j.map(Q=>({value:Q})),stickiness:A.STICKINESS,beforeContentClassName:F?"debug-breakpoint-placeholder":void 0,overviewRuler:U}}}updateBreakpointRanges(){this.breakpointRanges.clear();for(const D of this.breakpointDecorations){const I=this.editor.getModel().getDecorationRange(D);this.breakpointRanges.set(D,I)}}showHover(D){const I=D.target.type,O=m.isOSX?"metaKey":"ctrlKey";D.event.altKey||I===s.monacoBrowser.editor.MouseTargetType.CONTENT_WIDGET&&D.target.detail===this.debugHoverWidget.getId()&&!D.event[O]||(I===s.monacoBrowser.editor.MouseTargetType.CONTENT_TEXT?this.debugHoverWidget.show({selection:D.target.range,immediate:!1}):this.debugHoverWidget.hide({immediate:!1}))}hideHover({event:D}){const I=this.debugHoverWidget.getDomNode().getBoundingClientRect();(D.posx<I.left||D.posx>I.right||D.posy<I.top||D.posy>I.bottom)&&this.debugHoverWidget.hide({immediate:!1})}doToggleBreakpoint(D=this.position){const I=this.breakpointManager.getBreakpoints(this._uri,{lineNumber:D.lineNumber});if(I.length)for(const O of I)this.breakpointManager.delBreakpoint(O);else this.breakpointManager.addBreakpoint(d.DebugBreakpoint.create(this._uri,{line:D.lineNumber}))}get contributedContextMenu(){return this.menuService.createMenu(v.MenuId.DebugBreakpointsContext,this.contextKeyService)}onContextMenu(D){var I;if(this.marginFreeFromNonDebugDecorations((I=D.target.position)===null||I===void 0?void 0:I.lineNumber)&&D.target&&D.target.type===s.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const O=this.breakpointManager.getBreakpoint(this._uri,D.target.position.lineNumber);this.breakpointManager.selectedBreakpoint={breakpoint:O,model:this};const M=this.contributedContextMenu,R=(0,v.generateMergedCtxMenu)({menus:M});this.ctxMenuRenderer.show({anchor:D.event.browserEvent,menuNodes:R,args:[D.target.position]})}}marginFreeFromNonDebugDecorations(D){const I=this.editor.getLineDecorations(D);if(Array.isArray(I))for(const{options:O}of I){const M=O.glyphMarginClassName;if(M&&(M.includes("testing-run-glyph")||M.includes("interface-navigation-glyph")))return!1}return!0}onMouseDown(D){var I;this.marginFreeFromNonDebugDecorations((I=D.target.position)===null||I===void 0?void 0:I.lineNumber)&&(D.target&&D.target.type===s.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN&&(D.event.rightButton||(this.editor.focus(),this.toggleBreakpoint(D.target.position))),this.hintBreakpoint(D))}onMouseMove(D){var I;if(!this.marginFreeFromNonDebugDecorations((I=D.target.position)===null||I===void 0?void 0:I.lineNumber)){this.onMouseLeave(D);return}this.showHover(D),this.hintBreakpoint(D)}onMouseLeave(D){this.hideHover(D),this.deltaHintDecorations([])}hintBreakpoint(D){const I=this.createHintDecorations(D);this.deltaHintDecorations(I)}deltaHintDecorations(D){this.hintDecorations=this.deltaDecorations(this.hintDecorations,D)}createHintDecorations(D){if(D.target&&D.target.type===s.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN||D.target.type===s.monacoBrowser.editor.MouseTargetType.GUTTER_LINE_NUMBERS){const I=D.target.position.lineNumber;return this.breakpointManager.getBreakpoint(this._uri,I)?[]:[{range:new _.Range(I,1,I,1),options:A.BREAKPOINT_HINT_DECORATION}]}return[]}getBreakpoints(D,I){return this.breakpointManager.getBreakpoints(D,I)}getEditor(){return this.editor}getBreakpointWidget(){return this.breakpointWidget}getDebugHoverWidget(){return this.debugHoverWidget}};t.DebugModel=S,r.__decorate([(0,c.Autowired)(h.DebugEditor),r.__metadata("design:type",Object)],S.prototype,"editor",void 0),r.__decorate([(0,c.Autowired)(b.DebugBreakpointWidget),r.__metadata("design:type",b.DebugBreakpointWidget)],S.prototype,"breakpointWidget",void 0),r.__decorate([(0,c.Autowired)(y.DebugHoverWidget),r.__metadata("design:type",y.DebugHoverWidget)],S.prototype,"debugHoverWidget",void 0),r.__decorate([(0,c.Autowired)(u.IDebugSessionManager),r.__metadata("design:type",f.DebugSessionManager)],S.prototype,"debugSessionManager",void 0),r.__decorate([(0,c.Autowired)(a.DebugBreakpointsService),r.__metadata("design:type",a.DebugBreakpointsService)],S.prototype,"debugBreakpointsService",void 0),r.__decorate([(0,c.Autowired)(d.BreakpointManager),r.__metadata("design:type",d.BreakpointManager)],S.prototype,"breakpointManager",void 0),r.__decorate([(0,c.Autowired)(v.AbstractMenuService),r.__metadata("design:type",v.AbstractMenuService)],S.prototype,"menuService",void 0),r.__decorate([(0,c.Autowired)(p.IContextKeyService),r.__metadata("design:type",Object)],S.prototype,"contextKeyService",void 0),r.__decorate([(0,c.Autowired)(v.ICtxMenuRenderer),r.__metadata("design:type",v.ICtxMenuRenderer)],S.prototype,"ctxMenuRenderer",void 0),r.__decorate([(0,c.Autowired)(p.IReporterService),r.__metadata("design:type",Object)],S.prototype,"reporterService",void 0),r.__decorate([(0,c.Autowired)(p.PreferenceService),r.__metadata("design:type",Object)],S.prototype,"preferenceService",void 0),r.__decorate([(0,c.Autowired)(g.IThemeService),r.__metadata("design:type",Object)],S.prototype,"themeService",void 0),r.__decorate([m.memoize,r.__metadata("design:type",Object),r.__metadata("design:paramtypes",[])],S.prototype,"contributedContextMenu",null),t.DebugModel=S=n=r.__decorate([(0,c.Injectable)(),r.__metadata("design:paramtypes",[])],S);class w extends m.Disposable{constructor(D,I,O,M,R){super(),this.editor=D,this.decorationId=I,this.breakpoint=M,this.breakpointManager=R,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.range=this.editor.getModel().getDecorationRange(I),this.addDispose(this.editor.onDidChangeModelDecorations(()=>{const k=this.editor.getModel().getDecorationRange(this.decorationId);this.range&&!this.range.equalsRange(k)&&(this.range=k,this.editor.layoutContentWidget(this))})),this.addDispose(m.Disposable.create(()=>{this.editor.removeContentWidget(this)})),this.create(O),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(D){const I=document.createElement("div");I.className="inline-breakpoint-widget",D&&(0,p.addClassName)(I,D),this.domNode=I;const{EditorOption:O}=_.editor,M=()=>{const R=this.editor.getOption(O.lineHeight);I.style.height=`${R}px`,I.style.width=`${Math.ceil(.8*R)}px`,I.style.marginLeft="4px"};M(),this.addDispose(new p.DomListener(I,"click",async()=>{this.breakpoint?this.breakpointManager.delBreakpoint(this.breakpoint):this.breakpointManager.addBreakpoint(d.DebugBreakpoint.create(this.editor.getModel().uri,{line:this.range.startLineNumber,column:this.range.startColumn}))})),this.addDispose(this.editor.onDidChangeConfiguration(R=>{(R.hasChanged(O.fontSize)||R.hasChanged(O.lineHeight))&&M()}))}getId(){return(0,m.uuid)()}getDomNode(){return this.domNode}getPosition(){return this.range?(this.domNode.classList.toggle("line-start",this.range.startColumn===1),{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn-1},preference:[s.monacoBrowser.editor.ContentWidgetPositionPreference.EXACT]}):null}}r.__decorate([m.memoize,r.__metadata("design:type",Function),r.__metadata("design:paramtypes",[]),r.__metadata("design:returntype",void 0)],w.prototype,"getId",null)},78606:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugRunToCursorService=void 0;const n=e(85608),r=e(76003),o=e(54414),c=e(26296),p=e(66089),v=e(38029),m=e(97319);let _=class{constructor(){}async run(g,l=!1){const h=this.sessionManager.currentSession;if(!h||h.state!==c.DebugState.Stopped)return;const u=this.workbenchEditorService.currentEditor;if(u){if(!u.monacoEditor)return}else return;const{monacoEditor:d}=u,E=d.getPosition();if(!(d.hasModel()&&E))return;const f=h.getModel();if(!f)return;const a=!!f.getBreakpoints(g,{column:E.column,lineNumber:E.lineNumber}).length;let b,y=h.currentThread,A=[];if(!a){l&&(A=f.getBreakpoints().filter(T=>T.enabled).filter(T=>T.raw.column!==E.column&&T.raw.line!==E.lineNumber),A.forEach(T=>{this.debugBreakpointsService.toggleBreakpointEnable(T)}));const w=await this.addBreakpoints(g,E);if(!w){this.recoverStatus(A);return}w.thread&&(y=w.thread),w.breakpoint&&(b=w.breakpoint)}if(!y){this.recoverStatus(A);return}const S=y.session.onDidChangeState(()=>{const w=h.state;(w===c.DebugState.Stopped||w===c.DebugState.Inactive)&&(b&&h.delBreakpoint(b),S.dispose())});await y.continue(),this.recoverStatus(A)}async addBreakpoints(g,l){const h=this.sessionManager.currentSession;if(!h)return;let u=1;const d=h.currentFrame;d&&d.range().startLineNumber===l.lineNumber&&(u=l.column||1);const E=p.DebugBreakpoint.create(g,{line:l.lineNumber,column:u});if(await h.addBreakpoint(E,!0),!E)return{breakpoint:void 0,thread:h.currentThread};let f=h.currentThread,a=0;const b=h.threads.filter(y=>y.stopped);if(a<3&&h.currentThread&&b.includes(h.currentThread)&&(f=h.currentThread,a=3),a<2){const y=b.find(A=>A.topFrame);y&&(f=y,a=2)}return a<1&&(f=b[0],a=2),{thread:f,breakpoint:E}}recoverStatus(g){g.forEach(l=>{this.debugBreakpointsService.toggleBreakpointEnable(l)})}};t.DebugRunToCursorService=_,n.__decorate([(0,r.Autowired)(c.IDebugSessionManager),n.__metadata("design:type",v.DebugSessionManager)],_.prototype,"sessionManager",void 0),n.__decorate([(0,r.Autowired)(o.WorkbenchEditorService),n.__metadata("design:type",o.WorkbenchEditorService)],_.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(m.DebugBreakpointsService),n.__metadata("design:type",m.DebugBreakpointsService)],_.prototype,"debugBreakpointsService",void 0),t.DebugRunToCursorService=_=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],_)},26571:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BREAKPOINT_DECORATION_DISABLED=t.BREAKPOINT_DECORATION=t.BREAKPOINT_HINT_DECORATION=t.TOP_STACK_FRAME_INLINE_DECORATION=t.FOCUSED_STACK_FRAME_DECORATION=t.TOP_STACK_FRAME_EXCEPTION_DECORATION=t.FOCUS_BREAKPOINTS_STACK_FRAME_DECORATION=t.TOP_STACK_FRAME_DECORATION=t.FOCUSED_STACK_FRAME_MARGIN=t.TOP_STACK_FRAME_MARGIN=t.BREAK_PONINT_HOVER_MARGIN=t.STICKINESS=void 0;const r=e(85608).__importStar(e(20868));t.STICKINESS=r.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,t.BREAK_PONINT_HOVER_MARGIN={description:"debug-hover",glyphMarginClassName:"sumi-debug-hover",linesDecorationsClassName:"sumi-debug-hover",isWholeLine:!0},t.TOP_STACK_FRAME_MARGIN={description:"debug-top-stack-frame",glyphMarginClassName:"sumi-debug-top-stack-frame",stickiness:t.STICKINESS},t.FOCUSED_STACK_FRAME_MARGIN={description:"debug-focused-stack-frame",glyphMarginClassName:"sumi-debug-focused-stack-frame",stickiness:t.STICKINESS},t.TOP_STACK_FRAME_DECORATION={description:"debug-top-stack-frame-line",isWholeLine:!0,className:"sumi-debug-top-stack-frame-line",stickiness:t.STICKINESS},t.FOCUS_BREAKPOINTS_STACK_FRAME_DECORATION={description:"focus-breakpoints-stack-frame-line",isWholeLine:!0,className:"sumi-focus-breakpoints-stack-frame-line",stickiness:t.STICKINESS},t.TOP_STACK_FRAME_EXCEPTION_DECORATION={description:"debug-top-stack-frame-exception-line",isWholeLine:!0,className:"sumi-debug-top-stack-frame-exception-line",stickiness:t.STICKINESS},t.FOCUSED_STACK_FRAME_DECORATION={description:"debug-focused-stack-frame-line",isWholeLine:!0,className:"sumi-debug-focused-stack-frame-line",stickiness:t.STICKINESS},t.TOP_STACK_FRAME_INLINE_DECORATION={description:"debug-top-stack-frame-column",beforeContentClassName:"sumi-debug-top-stack-frame-column"},t.BREAKPOINT_HINT_DECORATION={description:"debug-breakpoint-hint",glyphMarginClassName:"sumi-debug-breakpoint-hint",stickiness:t.STICKINESS},t.BREAKPOINT_DECORATION={description:"debug-breakpoint",glyphMarginClassName:"sumi-debug-breakpoint",stickiness:t.STICKINESS},t.BREAKPOINT_DECORATION_DISABLED={description:"debug-breakpoint-disabled",glyphMarginClassName:"sumi-debug-breakpoint-disabled",stickiness:t.STICKINESS}},39266:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EvaluatableExpressionServiceImpl=t.IEvaluatableExpressionService=void 0;const n=e(85608),r=e(76003),o=e(40497),c=new o.LanguageFeatureRegistry;t.IEvaluatableExpressionService=Symbol("IEvaluatableExpressionService");let p=class{getSupportedEvaluatableExpressionProvider(m){return c.ordered(m)}registerEvaluatableExpressionProvider(m,_){return c.register(m,_)}hasEvaluatableExpressProvider(m){return c.has(m)}};t.EvaluatableExpressionServiceImpl=p,t.EvaluatableExpressionServiceImpl=p=n.__decorate([(0,r.Injectable)()],p)},75935:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(17475),t),n.__exportStar(e(65960),t),n.__exportStar(e(91260),t),n.__exportStar(e(71569),t),n.__exportStar(e(26571),t),n.__exportStar(e(74257),t)},33969:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugModule=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(91825),p=e(64582),v=e(99797),m=e(3005),_=e(37499),s=e(59053),g=e(31141),l=e(40453),h=e(90408),u=e(97186),d=e(38029),E=e(75935),f=e(23217),a=e(39266),b=e(23434),y=e(52369),A=e(44888),S=e(84784),w=e(15153),T=e(11456),D=e(37243),I=e(86752),O=e(14600);e(51377);let M=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:f.DebugHoverSource,useClass:f.DebugHoverSource},{token:E.DebugExpressionProvider,useClass:E.DebugExpressionProvider},{token:p.IDebugModelManager,useClass:E.DebugModelManager},{token:p.IDebugSessionManager,useClass:d.DebugSessionManager},{token:v.BreakpointManager,useClass:v.BreakpointManager},{token:_.DebugConfigurationManager,useClass:_.DebugConfigurationManager},{token:a.IEvaluatableExpressionService,useClass:a.EvaluatableExpressionServiceImpl},{token:c.FolderFilePreferenceProvider,useClass:b.LaunchFolderPreferenceProvider,dropdownForTag:!0,tag:"launch"},{token:p.DebugModelFactory,useFactory:P=>k=>E.DebugModel.createModel(P,k)},{token:u.DebugSessionContributionRegistry,useClass:u.DebugSessionContributionRegistryImpl},{token:p.IDebugService,useClass:h.DebugService},{token:p.ILaunchService,useClass:A.LaunchService},{token:p.IDebugProgress,useClass:l.DebugProgressService},{token:p.IDebugConsoleModelService,useClass:w.DebugConsoleModelService},y.LaunchPreferencesContribution,s.DebugContribution,T.DebugConsoleContribution,I.VariablesPanelContribution,D.DebugCallStackContribution,O.WatchPanelContribution,{token:m.DebugCallStackItemTypeKey,useFactory:P=>P.get(o.IContextKeyService).createKey("callStackItemType")}],this.contributionProvider=u.DebugSessionContribution,this.preferences=g.injectDebugPreferences,this.isOverlay=!0,this.component=S.DebugToolbarOverlayWidget}};t.DebugModule=M,t.DebugModule=M=n.__decorate([(0,r.Injectable)()],M)},39553:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(35721),t),n.__exportStar(e(20391),t)},35721:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MarkerManager=t.MarkerCollection=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(14951);class p{constructor(_,s){this.uri=_,this.kind=s,this.owner2Markers=new Map}get empty(){return!this.owner2Markers.size}getOwners(){return Array.from(this.owner2Markers.keys())}getMarkers(_){return this.owner2Markers.get(_)||[]}setMarkers(_,s){const g=this.owner2Markers.get(_);return s.length>0?this.owner2Markers.set(_,s.map(l=>this.createMarker(_,l))):this.owner2Markers.delete(_),g||[]}createMarker(_,s){return Object.freeze({uri:this.uri.toString(),kind:this.kind,owner:_,data:s})}findMarkers(_){if(_.owner)return this.owner2Markers.has(_.owner)?this.filterMarkers(_,this.owner2Markers.get(_.owner)):[];{const s=[];for(const g of this.owner2Markers.values())s.push(...this.filterMarkers(_,g));return s}}filterMarkers(_,s){return s?_.dataFilter?s.filter(g=>_.dataFilter(g.data)):s:[]}}t.MarkerCollection=p;let v=class{constructor(){this.uri2MarkerCollection=new Map,this.onDidChangeMarkersEmitter=new o.Emitter,this.init()}init(){this.fileService.onFilesChanged(_=>{const s=_.filter(({type:g})=>g===c.FileChangeType.DELETED);s.length&&this.cleanMarkers(s)})}cleanMarkers(_){for(const s of this.uri2MarkerCollection.keys()){const g=new o.URI(s);c.FileChangeEvent.isDeleted(_,g)&&this.cleanAllMarkers(g)}}get onDidChangeMarkers(){return this.onDidChangeMarkersEmitter.event}fireOnDidChangeMarkers(_){this.onDidChangeMarkersEmitter.fire(_)}setMarkers(_,s,g){const l=_.toString(),h=this.uri2MarkerCollection.get(l)||new p(_,this.getKind()),u=h.setMarkers(s,g);return h.empty?this.uri2MarkerCollection.delete(_.toString()):this.uri2MarkerCollection.set(l,h),this.fireOnDidChangeMarkers(_),u}findMarkers(_={}){if(_.uri){const g=this.uri2MarkerCollection.get(_.uri.toString());return g?g.findMarkers(_):[]}const s=[];for(const g of this.getUris())s.push(...this.uri2MarkerCollection.get(g).findMarkers(_));return s}getUris(){return this.uri2MarkerCollection.keys()}cleanAllMarkers(_){if(_)this.doCleanAllMarkers(_);else for(const s of this.getUris())this.doCleanAllMarkers(new o.URI(s))}doCleanAllMarkers(_){const s=_.toString();this.uri2MarkerCollection.get(s)!==void 0&&(this.uri2MarkerCollection.delete(s),this.fireOnDidChangeMarkers(_))}};t.MarkerManager=v,n.__decorate([(0,r.Autowired)(c.IFileServiceClient),n.__metadata("design:type",Object)],v.prototype,"fileService",void 0),t.MarkerManager=v=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],v)},20391:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},88776:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSource=t.DebugSourceData=void 0;const n=e(41869);class r{}t.DebugSourceData=r;class o extends r{constructor(p,v,m,_,s){super(),this.session=p,this.labelProvider=v,this.modelManager=m,this.workbenchEditorService=_,this.fileSystem=s}get uri(){return o.toUri(this.raw)}get available(){return!!this.raw}get presentationHint(){return this.raw.presentationHint}update(p){Object.assign(this,p)}async open(p,v){if(this.uri.scheme===o.SCHEME){const m=await this.load();await this.fileSystem.setContent({uri:this.uri.toString(),lastModification:0},m)}if(v&&v.raw){const{line:m,column:_}=v.raw,s={startLineNumber:m,startColumn:typeof _=="number"?_:0,endLineNumber:m,endColumn:1/0};await this.workbenchEditorService.open(this.uri,{...p,range:s}),v.thread.currentFrame=v;const g=this.modelManager.resolve(this.uri);if(g)for(const l of g)l.focusStackFrame()}else await this.workbenchEditorService.open(this.uri,p)}async load(){const p=this.raw,v=p.sourceReference;return(await this.session.sendRequest("source",{sourceReference:v,source:p})).body.content}get inMemory(){return this.uri.scheme===o.SCHEME}get reference(){return this.raw.sourceReference}get name(){return this.inMemory?this.raw.name||this.uri.path.base||this.uri.path.toString():this.labelProvider.getName(this.uri)}get longName(){return this.inMemory?this.name:this.labelProvider.getLongName(this.uri)}static toUri(p){if(p.sourceReference&&p.sourceReference>0)return new n.URI().withScheme(o.SCHEME).withPath(p.name).withQuery(String(p.sourceReference));if(!p.path)throw new Error("Unrecognized source type: "+JSON.stringify(p));return p.path.match(o.SCHEME_PATTERN)?new n.URI(p.path):new n.URI(n.Uri.file(p.path))}}t.DebugSource=o,o.SCHEME="debug",o.SCHEME_PATTERN=/^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/},44485:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShowMoreDebugStackFrame=t.DebugStackFrame=t.DebugStackFrameData=void 0;const n=e(41869),r=e(44781),o=e(98650);class c{}t.DebugStackFrameData=c;class p extends c{static is(_){return!!_&&"raw"in _}constructor(_,s){super(),this.thread=_,this.session=s}get id(){return this.session.id+":"+this.thread.id+":"+this.raw.id}get source(){return this._source}update(_){Object.assign(this,_),this._source=this.raw.source&&this.session.getSource(this.raw.source)}async restart(){return this.session.capabilities.supportsRestartFrame?await this.session.sendRequest("restartFrame",{frameId:this.raw.id}):Promise.reject(new Error("restartFrame not supported"))}get canRestart(){return typeof this.raw.canRestart=="boolean"?this.raw.canRestart:!0}async open(_){if(!this.source)return;const{line:s,column:g,endLine:l,endColumn:h}=this.raw;let u={startLineNumber:s,startColumn:g,endLineNumber:s,endColumn:1/0};typeof l=="number"&&(u={...u,endLineNumber:l,endColumn:typeof h=="number"?h:1/0}),this.source.open({..._,range:u})}toArgs(_){return Object.assign({},_,{frameId:this.raw.id})}getScopes(_){return this.doGetScopes(_)}async doGetScopes(_){try{return(await this.session.sendRequest("scopes",this.toArgs())).body.scopes.map(g=>new o.DebugScope(g,this.session,_))}catch{return[]}}range(){const _=this.raw;return new r.Range(_.line,_.column,_.endLine||_.line,_.endColumn||_.column)}async getMostSpecificScopes(_){const g=(await this.doGetScopes()).filter(u=>!u.getRawScope().expensive);if(!g.some(u=>!!u.range()))return g;const h=g.filter(u=>u.range()&&r.Range.containsRange(u.range(),_)).sort((u,d)=>u.range().endLineNumber-u.range().startLineNumber-(d.range().endLineNumber-d.range().startLineNumber));return h.length?h:g}}t.DebugStackFrame=p;class v{constructor(_,s,g,l,h){this.nextFrame=_,this.frames=s,this.session=g,this.origin=l,this._open=h,this.open=()=>{this._open(this)}}get name(){return(0,n.formatLocalize)("debug.stack.showMoreAndOrigin",this.frames.length,this.origin)}get id(){var _;return`${this.session.id}:showMore:${(_=this.nextFrame)===null||_===void 0?void 0:_.id}`}}t.ShowMoreDebugStackFrame=v},7885:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugThread=t.DebugThreadData=void 0;const n=e(41869),r=e(64582),o=e(44485);class c{}t.DebugThreadData=c;class p extends c{constructor(m){super(),this.session=m,this._onDidChanged=new n.Emitter,this.onDidChanged=this._onDidChanged.event,this._frames=new Map,this.pendingFetch=Promise.resolve([])}get id(){return this.session.id+":"+this.raw.id}get threadId(){return this.raw.id}get currentFrame(){return this._currentFrame}set currentFrame(m){this._currentFrame=m,this._onDidChanged.fire()}get stopped(){return!!this.stoppedDetails}update(m){Object.assign(this,m),"stoppedDetails"in m&&this.clearFrames()}clear(){this.update({raw:this.raw,stoppedDetails:void 0})}continue(){return this.session.sendRequest("continue",this.toArgs())}stepOver(){return this.session.sendRequest("next",this.toArgs())}stepIn(){return this.session.sendRequest("stepIn",this.toArgs())}stepOut(){return this.session.sendRequest("stepOut",this.toArgs())}pause(){return this.session.sendRequest("pause",this.toArgs())}terminate(){return this.session.sendRequest("terminateThreads",{threadIds:[this.raw.id]})}get frames(){return Array.from(this._frames.values())}get topFrame(){return this.frames[0]}get frameCount(){return this._frames.size}async rawFetchFrames(m=20){return this.pendingFetch=this.pendingFetch.then(async()=>{try{const _=this.frameCount,s=await this.doFetchFrames(_,m);return this.doUpdateFrames(s)}catch{return[]}})}async fetchExceptionInfo(){var m;try{if(((m=this.stoppedDetails)===null||m===void 0?void 0:m.reason)==="exception"&&this.session.capabilities.supportsExceptionInfoRequest){const _=await this.session.exceptionInfo(this.toArgs());if(_)return{id:_.body.exceptionId,description:_.body.description,breakMode:_.body.breakMode,details:_.body.details}}}catch{return}}async fetchFrames(m=20){const _=await this.rawFetchFrames(m);return this.updateCurrentFrame(),_}async doFetchFrames(m,_){try{const s=await this.session.sendRequest("stackTrace",this.toArgs({startFrame:m,levels:_}));return this.stoppedDetails&&(this.stoppedDetails.totalFrames=s.body.totalFrames),s.body.stackFrames}catch(s){return this.stoppedDetails&&(this.stoppedDetails.framesErrorMessage=s.message),[]}}doUpdateFrames(m){const _=this.session.reportTime(r.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME,{sessionId:this.session.id,threadId:this.raw.id,threadAmount:this.session.threadCount}),s=new Map(this._frames);for(const l of m){const h=l.id;if(!this._frames.has(h)){const u=new o.DebugStackFrame(this,this.session);this._frames.set(h,u),u.update({raw:l}),s.set(h,u)}}const g=[...s.values()];return _("doUpdateFrames"),g}clearFrames(){this._frames.clear(),this.updateCurrentFrame()}updateCurrentFrame(){const{currentFrame:m}=this,_=m&&m.raw.id;this.currentFrame=typeof _=="number"&&this._frames.get(_)||this._frames.values().next().value}toArgs(m){return Object.assign({},m,{threadId:this.raw.id})}}t.DebugThread=p},14190:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugWatch=t.IDebugWatchData=void 0;const r=e(85608).__importDefault(e(97331)),o=e(41869),c=e(64582),p=e(98650);t.IDebugWatchData=Symbol("IDebugWatchData");class v{constructor(_,s){this.manager=_,this.reporterService=s,this.toDispose=new o.DisposableCollection,this.fireDidChange=(0,r.default)(()=>this.onDidChangeEmitter.fire(),50),this.fireVariableChange=(0,r.default)(()=>this.onDidVariableChangeEmitter.fire(),50),this.fireExpressionChange=(0,r.default)(g=>this.onDidExExpressionChangeEmitter.fire(g),50),this._expressions=[],this.onDidChangeEmitter=new o.Emitter,this.onDidVariableChangeEmitter=new o.Emitter,this.onDidExExpressionChangeEmitter=new o.Emitter,this.whenReady=this.init()}get onDidChange(){return this.onDidChangeEmitter.event}get onDidVariableChange(){return this.onDidVariableChangeEmitter.event}get onDidExpressionChange(){return this.onDidExExpressionChangeEmitter.event}async getRoot(){const _=[],s=new p.DebugWatchRoot(this.manager.currentSession);for(const g of this._expressions){const l=new p.DebugWatchNode(this.manager.currentSession,g,s);await l.evaluate(),_.push(l)}return s.updatePresetChildren(_),this._root=s,this._root}async init(){this.toDispose.push(this.manager.onDidStopDebugSession(()=>{this.fireDidChange()})),this.toDispose.push(this.manager.onDidDestroyDebugSession(()=>{this.fireDidChange()})),this.toDispose.push(this.manager.onDidChangeActiveDebugSession(()=>{const _=this.manager.currentSession;_&&(_.onVariableChange(()=>{this.fireVariableChange()}),_.onDidChangeCallStack(()=>{this.fireVariableChange()}))}))}async clear(){this.updateWatchExpressions([]),this.fireExpressionChange([]),this.fireDidChange()}async updateWatchExpressions(_){this._expressions=_}addWatchExpression(_){this.reporterService.point(c.DEBUG_REPORT_NAME===null||c.DEBUG_REPORT_NAME===void 0?void 0:c.DEBUG_REPORT_NAME.DEBUG_WATCH,c.DEBUG_COMMANDS.ADD_WATCHER.id,{value:_}),this._expressions.indexOf(_)===-1&&(this._expressions.push(_),this.fireExpressionChange(this._expressions))}renameWatchExpression(_,s){const g=this._expressions.indexOf(_);g>=0&&this._expressions.splice(g,1,s),this.fireExpressionChange(this._expressions)}removeWatchExpression(_){const s=this._expressions.indexOf(_);s>=0&&this._expressions.splice(s,1),this.fireExpressionChange(this._expressions)}}t.DebugWatch=v},50755:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(88776),t),n.__exportStar(e(44485),t),n.__exportStar(e(7885),t),n.__exportStar(e(14190),t)},53741:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CheckboxWidget=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(14041)),c=e(97267),p=n.__importDefault(e(93089)),v=m=>{var _,s;const{disabled:g,formContext:l,id:h,label:u,hideLabel:d,onBlur:E,onChange:f,onFocus:a,readonly:b,value:y,registry:A,options:S,schema:w,uiSchema:T}=m,{readonlyAsDisabled:D=!0}=l,I=(0,r.getTemplate)("DescriptionFieldTemplate",A,S),O=({target:F})=>f(F.checked),P={onBlur:b?void 0:({target:F})=>E(h,F.checked),onFocus:b?void 0:({target:F})=>a(h,F.checked)},k=(s=(_=S.description)!==null&&_!==void 0?_:w.description)!==null&&s!==void 0?s:w.markdownDescription;return o.default.createElement("div",{className:p.default.checkbox_widget_control},!d&&o.default.createElement("label",{title:u,className:p.default.field_label},u),o.default.createElement(c.CheckBox,{checked:typeof y>"u"?!1:y,disabled:g||D&&b,id:h,name:h,onChange:b?void 0:O,...P,"aria-describedby":(0,r.ariaDescribedByIds)(h),label:k,className:p.default.checkbox}))};t.CheckboxWidget=v},93306:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnyOfField=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(14041)),c=e(97267),p=n.__importDefault(e(93089)),v=m=>{var _,s;const{disabled:g,formContext:l,idSchema:h,onBlur:u,id:d,onChange:E,onFocus:f,options:a,placeholder:b,readonly:y,registry:A,name:S,required:w,schema:T,uiOptions:D}=m,{readonlyAsDisabled:I=!0}=l,O=({target:L})=>E(L.value===""?a.emptyValue:L.value),M=({target:L})=>u(d,L.value),R=({target:L})=>f(d,L.value),P=(s=(_=a.description)!==null&&_!==void 0?_:T.description)!==null&&s!==void 0?s:T.markdownDescription,k=(0,r.getTemplate)("TitleFieldTemplate",A,D),F=(0,r.getTemplate)("DescriptionFieldTemplate",A,D);return o.default.createElement("div",{className:p.default.any_of_widget_control},S&&o.default.createElement("div",{className:p.default.object_title},o.default.createElement(k,{id:(0,r.titleId)(h),title:S,required:w,schema:T,registry:A})),P&&o.default.createElement("div",{className:p.default.object_description},o.default.createElement(F,{id:(0,r.descriptionId)(h),description:P,schema:T,registry:A})),o.default.createElement(c.Input,{disabled:g||I&&y,onBlur:y?void 0:M,onChange:y?void 0:O,onFocus:y?void 0:R,placeholder:b,autoComplete:"off"}))};t.AnyOfField=v},32475:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayField=void 0;const n=e(85608),r=e(67030),o=n.__importStar(e(14041)),c=e(43718),p=(0,r.getDefaultRegistry)().fields.ArrayField,v=m=>{const{onChange:_}=m,s=(0,o.useCallback)(g=>{Array.isArray(g)&&_(g.map(l=>(0,c.isUndefined)(l)?"":l))},[_]);return o.default.createElement(p,{...m,onChange:s})};t.ArrayField=v},59299:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectField=void 0;const n=e(85608),r=e(67030),o=n.__importStar(e(14041)),c=e(41869),p=e(43718),v=e(64582),m=(0,r.getDefaultRegistry)().fields.ObjectField,_=s=>{const g=(0,c.useInjectable)(v.ILaunchService),{idSchema:l,onChange:h}=s;return(0,o.useEffect)(()=>{const{$id:u}=l,d=new p.Disposable;return u==="root"&&d.addDispose(g.onChangeFormData(E=>h(E))),()=>d.dispose()},[l]),o.default.createElement(m,{...s})};t.ObjectField=_},66216:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TitleField=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=n.__importDefault(e(93089)),c=p=>{const{title:v}=p;return v?r.default.createElement("label",{title:v,className:o.default.field_label},v):null};t.TitleField=c},81638:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelectWidget=void 0;const n=e(85608),r=e(51632),o=n.__importStar(e(14041)),c=e(97267),p=n.__importDefault(e(93089)),v=m=>{const{schema:_,value:s,id:g,registry:l,uiOptions:h,name:u,required:d,onChange:E}=m,f=_.description,a=(0,r.getTemplate)("TitleFieldTemplate",l,h),b=(0,r.getTemplate)("DescriptionFieldTemplate",l,h),y=(0,o.useMemo)(()=>_&&_.enum?_.enum:[],[_,_.enum]);return o.default.createElement("div",{className:p.default.select_widget_control},u&&o.default.createElement("div",{className:p.default.object_title},o.default.createElement(a,{id:(0,r.titleId)(g),title:u,required:d,schema:_,registry:l})),f&&o.default.createElement("div",{className:p.default.object_description},o.default.createElement(b,{id:(0,r.descriptionId)(g),description:f,schema:_,registry:l})),o.default.createElement(c.Select,{key:g,value:s,dropdownRenderType:"absolute",onChange:E},y.map(A=>o.default.createElement(c.Option,{value:A,label:A,key:A},A))))};t.SelectWidget=v},20023:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextWidget=void 0;const n=e(85608),r=e(51632),o=n.__importStar(e(14041)),c=e(97267),p=e(64582),v=e(5905),m=n.__importDefault(e(93089)),_=s=>{const{disabled:g,formContext:l,id:h,onBlur:u,onChange:d,onFocus:E,options:f,placeholder:a,readonly:b,schema:y,value:A,registry:S,label:w,hideLabel:T,required:D,uiSchema:I,uiOptions:O}=s,{readonlyAsDisabled:M=!0}=l,R=(0,r.getTemplate)("TitleFieldTemplate",S,O),P=(0,r.getTemplate)("DescriptionFieldTemplate",S,O),k=(0,o.useMemo)(()=>typeof A!="string"?A:(0,v.parseSnippet)(A),[A]),F=({target:W})=>{d(W.value===""?f.emptyValue:W.value),u(h,W.value)},L=({target:W})=>E(h,W.value),B=(0,o.useMemo)(()=>y.type!==p.JSON_SCHEMA_TYPE.STRING&&y.type!==p.JSON_SCHEMA_TYPE.NUMBER?p.JSON_SCHEMA_TYPE.STRING:y.type,[y,y.type]),j=(0,o.useMemo)(()=>y.description||"",[y,y.description]);return o.default.createElement("div",null,!T&&w&&o.default.createElement("div",{className:m.default.object_title},o.default.createElement(R,{id:(0,r.titleId)(h),title:w,required:D,schema:y,uiSchema:I,registry:S})),j&&o.default.createElement("div",{className:m.default.object_description},o.default.createElement(P,{id:(0,r.descriptionId)(h),description:j,schema:y,uiSchema:I,registry:S})),o.default.createElement(c.Input,{disabled:g||M&&b,id:h,name:h,onBlur:b?void 0:F,onFocus:b?void 0:L,placeholder:a,type:B,value:k,className:m.default.text_widget_control,autoComplete:"off"}))};t.TextWidget=_},23434:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchFolderPreferenceProvider=void 0;const n=e(85608),r=e(76003),o=e(91825);let c=class extends o.FolderFilePreferenceProvider{parse(v){const m=super.parse(v);if(m!==void 0)return{launch:{...m}}}getPath(v){if(v==="launch")return[];if(v.startsWith("launch."))return[v.substr(7)]}};t.LaunchFolderPreferenceProvider=c,t.LaunchFolderPreferenceProvider=c=n.__decorate([(0,r.Injectable)()],c)},52369:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchPreferencesContribution=t.LaunchResourceProvider=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(64102),p=e(39496),v=e(57517),m=e(4983),_=e(10938),s=e(67858);let g=class{constructor(){this.scheme=m.LAUNCH_VIEW_SCHEME}provideResource(u){return{supportsRevive:!0,name:(0,o.localize)("menu-bar.title.debug"),icon:(0,o.getIcon)("debug"),uri:u}}provideResourceSubname(){return null}async shouldCloseResource(){return!0}};t.LaunchResourceProvider=g,t.LaunchResourceProvider=g=n.__decorate([(0,r.Injectable)()],g);let l=class{constructor(){this.schema=_.launchPreferencesSchema,this.name="launch"}registerResource(u){u.registerResourceProvider(this.prefResourceProvider)}registerEditorComponent(u){u.registerEditorComponent({component:s.LaunchViewContainer,uid:m.LAUNCH_VIEW_COMPONENT_ID,scheme:m.LAUNCH_VIEW_SCHEME}),u.registerEditorComponentResolver(m.LAUNCH_VIEW_SCHEME,(d,E,f)=>{f([{type:v.EditorOpenType.component,componentId:m.LAUNCH_VIEW_COMPONENT_ID}])})}registerMenus(u){u.registerMenuItem(p.MenuId.EditorTitle,{command:o.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id,iconClass:(0,o.getIcon)("open"),group:"navigation",when:`resourceScheme == ${m.LAUNCH_VIEW_SCHEME}`})}};t.LaunchPreferencesContribution=l,n.__decorate([(0,r.Autowired)(g),n.__metadata("design:type",g)],l.prototype,"prefResourceProvider",void 0),t.LaunchPreferencesContribution=l=n.__decorate([(0,o.Domain)(o.PreferenceContribution,o.PreferenceConfiguration,v.BrowserEditorContribution,c.MenuContribution)],l)},10938:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.launchPreferencesSchema=void 0;const n=e(64582);t.launchPreferencesSchema={type:"object",scope:"resource",properties:{launch:{$ref:n.launchSchemaUri,description:"Global debug launch configuration. Should be used as an alternative to 'launch.json' that is shared across workspaces",defaultValue:{configurations:[],compounds:[]}}}}},44888:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchService=void 0;const n=e(85608),r=n.__importStar(e(23304)),o=n.__importDefault(e(41263)),c=e(76003),p=e(41869),v=e(43718),m=e(14951),_=e(64582),s="configurations";let g=class{constructor(){this._onRawSchemaProperties=new v.Emitter,this.onRawSchemaProperties=this._onRawSchemaProperties.event,this._onChangeSchema=new v.Emitter,this.onChangeSchema=this._onChangeSchema.event,this._onChangeFormData=new v.Emitter,this.onChangeFormData=this._onChangeFormData.event}get rawSchemaProperties(){return this._rawSchemaProperties}get schema(){return this._schema}get formData(){return this._formData}async openLaunchConfiguration(){await this.commandService.executeCommand(p.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id)}setRawSchemaProperties(h){this._rawSchemaProperties=h,this._onRawSchemaProperties.fire(h)}nextNewSchema(h){this._schema=h,this._onChangeSchema.fire(h)}nextNewFormData(h,u=!0){this._formData=h,u&&this._onChangeFormData.fire(h)}addNewItem(h){if(h==="")return;const{properties:u}=this.rawSchemaProperties,d={...this.formData},E=u[h],{default:f,type:a}=E;(0,o.default)(d,h,f||this.getDefaultValue(a)),(0,o.default)(this.schema.properties,h,E),this.nextNewSchema(this.schema),this.nextNewFormData(d)}delItem(h){if(h==="")return;const{properties:u}=this.schema,d={...this.formData};delete d[h],delete u[h],this.nextNewSchema(this.schema),this.nextNewFormData(d)}getDefaultValue(h){switch(h){case _.JSON_SCHEMA_TYPE.ARRAY:return[];case _.JSON_SCHEMA_TYPE.BOOLEAN:return!1;case _.JSON_SCHEMA_TYPE.NULL:return null;case _.JSON_SCHEMA_TYPE.NUMBER:return 0;case _.JSON_SCHEMA_TYPE.OBJECT:return{};case _.JSON_SCHEMA_TYPE.STRING:default:return""}}async readResourceContent(h){try{const{content:u}=await this.fileSystem.readFile(h.toString());return u.toString()}catch{return""}}async modifyConfigurationsInResource(h,u,d){const E=await this.fileSystem.getFileStat(h.toString());if(E&&E.type===v.FileType.File){const{formData:f}=u,a=await this.readResourceContent(h),y=r.parse(a)[s];if(!y)return;Array.isArray(y)&&y.length-1>=d&&y.splice(d,1,f);const A=r.modify(a,[s],y,{isArrayInsertion:!1,formattingOptions:{tabSize:2,insertSpaces:!0,eol:`
|
|
31518
|
+
`;T[T.length-1]||T.pop();const D=T.map(O=>this.linkify(O,!1,S));if(D.length===1)return D[0];const I=document.createElement("span");return D.forEach(O=>I.appendChild(O)),I}const w=document.createElement("span");for(const T of this.detectLinks(y))try{switch(T.kind){case"text":w.appendChild(document.createTextNode(T.value));break;case"web":w.appendChild(this.createWebLink(T.value));break;case"path":{const D=T.captures[0],I=T.captures[1]?Number(T.captures[1]):0,O=T.captures[2]?Number(T.captures[2]):0;w.appendChild(this.createPathLink(T.value,D,I,O,S));break}}}catch{w.appendChild(document.createTextNode(T.value))}return w}createWebLink(y){const A=this.createLink(y),S=c.URI.parse(y);return this.decorateLink(A,async()=>{if(S.scheme===o.Schemes.file){const w=S.toString(),T=o.OS.type()===c.OperatingSystem.Windows?c.path.win32:c.path.posix,D=c.path.normalize(T.sep===c.path.posix.sep&&c.isWindows?w.replace(/\\/g,c.path.posix.sep):w);await this.workbenchEditorService.open(c.URI.parse(D));return}this.openerService.open(y)}),A}createPathLink(y,A,S,w,T){if(A[0]==="/"&&A[1]==="/")return document.createTextNode(y);if(A[0]==="."){if(!T)return document.createTextNode(y);const O=T.toResource(A),M=this.createLink(y);return this.decorateLink(M,()=>{this.workbenchEditorService.open(c.URI.parse(O.toString()))}),M}const D=this.createLink(y);D.tabIndex=0;const I=c.URI.file(c.path.normalize(A));return this.fileServiceClient.getFileStat(I.toString()).then(O=>{!O||O&&O.isDirectory||this.decorateLink(D,()=>{this.workbenchEditorService.open(c.URI.parse(I.toString()),{range:{startColumn:w,startLineNumber:S,endLineNumber:S,endColumn:w}})})}),D}createLink(y){const A=document.createElement("a");return A.textContent=y,A}decorateLink(y,A){y.classList.add(m.default.link),y.title=(0,o.formatLocalize)("debug.console.followLink",c.isMacintosh?"Cmd":"Ctrl"),y.onmousemove=S=>{y.classList.toggle(m.default.pointer,c.isMacintosh?S.metaKey:S.ctrlKey)},y.onmouseleave=()=>y.classList.remove(m.default.pointer),y.onclick=S=>{const w=window.getSelection();!w||w.type==="Range"||(c.isMacintosh?S.metaKey:S.ctrlKey)&&(S.preventDefault(),S.stopImmediatePropagation(),A(!1))}}detectLinks(y){if(!y)return[];if(y.length>f)return[{kind:"text",value:y,captures:[]}];const A=[s,E],S=["web","path"],w=[],T=(D,I)=>{if(I>=A.length){w.push({value:D,kind:"text",captures:[]});return}const O=A[I];let M=0,R;for(O.lastIndex=0;(R=O.exec(D))!==null;){const k=D.substring(M,R.index);k&&T(k,I+1);const F=R[0];w.push({value:F,kind:S[I],captures:R.slice(1)}),M=R.index+F.length}const P=D.substring(M);P&&T(P,I+1)};return T(y,0),w}};t.LinkDetector=a,n.__decorate([(0,r.Autowired)(p.WorkbenchEditorService),n.__metadata("design:type",p.WorkbenchEditorService)],a.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],a.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(o.IOpenerService),n.__metadata("design:type",Object)],a.prototype,"openerService",void 0),t.LinkDetector=a=n.__decorate([(0,r.Injectable)({multiple:!0})],a)},61752:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugMemoryFileSystemProvider=void 0;const n=e(85608),r=n.__importDefault(e(17228)),o=e(76003),c=e(43718),p=e(64582),v=e(38029),{Path:m}=c.path;let _=class{constructor(){this.memoryFdCounter=0,this.changeEmitter=new c.Emitter,this.fdMemory=new Map,this.capabilities=1028,this.onDidChangeCapabilities=c.Event.None,this.onDidChangeFile=this.changeEmitter.event,this.emptyBuffer=this.toBuffer("")}stat(l){return Promise.resolve({type:c.FileType.File,uri:l.toString(),mtime:0,ctime:0,size:0,lastModification:0,isDirectory:!1})}async readFile(l){const h=this.parseUri(l);if(!h)return this.emptyBuffer;if(!h.offset)return this.emptyBuffer;const{session:u,memoryReference:d,offset:E}=h,f=new Uint8Array(E.toOffset-E.fromOffset),a=this.memoryFdCounter++;let b=u.getMemory(d);return E&&(b=new s(b,E)),this.fdMemory.set(a,{session:u,region:b}),await this.read(a,E.fromOffset,f,0,f.length),f}async read(l,h,u,d,E){const f=this.fdMemory.get(l);if(!f)return;const a=await f.region.read(h,E);let b=0;for(const y of a)switch(y.type){case 1:return b;case 2:return b>0?b:this.logger.error(y.error);case 0:{const A=Math.max(0,h-y.offset),S=y.data.slice(A,Math.min(y.data.byteLength,A+(E-b)));u.set(S.buffer,d+b),b+=S.byteLength;break}default:this.logger.log(y)}return b}toBuffer(l){return c.BinaryBuffer.fromString(l).buffer}parseUri(l){if(l.scheme!==p.DEBUG_MEMORY_SCHEME)return;const h=this.debugSessionManager.sessions.find(f=>f.id.toLowerCase()===l.authority.toLowerCase());if(!h)return;let u;const d=/range=([0-9]+):([0-9]+)/.exec(l.query);d&&(u={fromOffset:Number(d[1]),toOffset:Number(d[2])});const[,E]=l.path.split(m.separator);return{session:h,offset:u,readOnly:!h.capabilities.supportsWriteMemoryRequest,sessionId:l.authority,memoryReference:decodeURIComponent(E)}}readDirectory(){throw new Error("Not allowed")}createDirectory(){throw new Error("Not allowed")}rename(){throw new Error("Not allowed")}delete(){throw new Error("Not allowed")}watch(){throw new Error("Not allowed")}writeFile(){throw new Error("Method not implemented.")}};t.DebugMemoryFileSystemProvider=_,n.__decorate([(0,o.Autowired)(p.IDebugSessionManager),n.__metadata("design:type",v.DebugSessionManager)],_.prototype,"debugSessionManager",void 0),n.__decorate([(0,o.Autowired)(c.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),t.DebugMemoryFileSystemProvider=_=n.__decorate([(0,o.Injectable)()],_);class s extends c.Disposable{constructor(l,h){super(),this.parent=l,this.range=h,this.invalidateEmitter=new c.Emitter,this.onDidInvalidate=this.invalidateEmitter.event,this.width=this.range.toOffset-this.range.fromOffset,this.writable=l.writable,this.registerDispose(l),this.registerDispose(l.onDidInvalidate(u=>{const d=(0,r.default)(u.fromOffset-h.fromOffset,0,this.width),E=(0,r.default)(u.toOffset-h.fromOffset,0,this.width);E>d&&this.invalidateEmitter.fire({fromOffset:d,toOffset:E})}))}read(l,h){if(l<0)throw new RangeError(`Invalid fromOffset: ${l}`);return this.parent.read(this.range.fromOffset+l,this.range.fromOffset+Math.min(h,this.width))}write(l,h){return this.parent.write(this.range.fromOffset+l,h)}}},31141:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugPreferences=t.IDebugConfiguration=t.debugPreferencesSchema=void 0,t.createDebugPreferences=o,t.injectDebugPreferences=c;const n=e(41869);t.debugPreferencesSchema={type:"object",properties:{"debug.trace":{type:"boolean",default:!1,description:(0,n.localize)("preference.debug.trace")},"debug.debugViewLocation":{enum:["default","left","right","bottom"],default:"default",description:(0,n.localize)("preference.debug.debugViewLocation")},"debug.openDebug":{enum:["neverOpen","openOnSessionStart","openOnFirstSessionStart","openOnDebugBreak"],default:"openOnDebugBreak",description:(0,n.localize)("preference.debug.openDebug")},"debug.internalConsoleOptions":{enum:["neverOpen","openOnSessionStart","openOnFirstSessionStart"],default:"openOnFirstSessionStart",description:(0,n.localize)("preference.debug.internalConsoleOptions")},"debug.allowBreakpointsEverywhere":{type:"boolean",description:(0,n.localize)("preference.debug.allowBreakpointsEverywhere"),default:!1}}};class r{}t.IDebugConfiguration=r,t.DebugPreferences=Symbol("DebugPreferences");function o(p){return(0,n.createPreferenceProxy)(p,t.debugPreferencesSchema)}function c(p){p.addProviders({token:t.DebugPreferences,useFactory:v=>{const m=v.get(n.PreferenceService);return o(m)}}),p.addProviders({token:n.PreferenceContribution,useValue:{schema:t.debugPreferencesSchema}})}},40453:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProgressService=void 0;const r=e(85608),o=e(76003),c=e(41869),p=e(68969),v=e(43718),m=e(26296);let _=n=class{constructor(){this.toDispose=[]}async onDebugServiceStateChange(g){this.progressResolve&&(this.progressResolve(),this.progressResolve=void 0),g===m.DebugState.Initializing&&this.progressService.getIndicator(n.DEBUG_PANEL_PROGRESS_ID)&&this.progressService.withProgress({location:n.DEBUG_PANEL_PROGRESS_ID},l=>new Promise(h=>this.progressResolve=h))}run(g){let l;const h=u=>{l=new v.DisposableCollection,u&&(l?.push(u.onDidChangeState(d=>this.onDebugServiceStateChange(d))),l?.push(u.onDidProgressStart(async d=>{const E=new Promise(f=>{const a=c.Event.any(c.Event.filter(u.onDidProgressEnd,b=>b.body.progressId===d.body.progressId),u.onDidExitAdapter)(()=>{a.dispose(),f()})});this.progressService.getIndicator(n.DEBUG_PANEL_PROGRESS_ID)&&this.progressService.withProgress({location:n.DEBUG_PANEL_PROGRESS_ID},()=>E),this.progressService.withProgress({location:v.ProgressLocation.Notification,title:d.body.title,cancellable:d.body.cancellable,silent:!0,delay:500},f=>{let a=0;const b=A=>{let S;typeof A.percentage=="number"&&(S=A.percentage-a,a+=S),f.report({message:A.message,increment:S,total:typeof S=="number"?100:void 0})};d.body.message&&b(d.body);const y=u.onDidProgressUpdate(A=>{A.body.progressId===d.body.progressId&&b(A.body)});return E.then(()=>y.dispose())},()=>u.cancel(d.body.progressId))})))};this.toDispose.push(g.onDidChangeActiveDebugSession(({current:u})=>{l&&l.dispose(),h(u)})),h(g.currentSession)}};t.DebugProgressService=_,_.DEBUG_PANEL_PROGRESS_ID="debug",r.__decorate([(0,o.Autowired)(p.IProgressService),r.__metadata("design:type",Object)],_.prototype,"progressService",void 0),t.DebugProgressService=_=n=r.__decorate([(0,o.Injectable)()],_)},69946:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.launchSchema=t.DebugSchemaManager=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(64582),p=e(70159),v=e(37499),{deepClone:m}=o.objects;let _=class{async update(){const g=this.config.getDebuggers(),l={...m(t.launchSchema)},h=l.properties.configurations.items,u=g.map(d=>({attributes:Object.keys(d.configurationAttributes||{}).map(E=>d.configurationAttributes[E]),configurationSnippets:d.configurationSnippets}));for(const{attributes:d,configurationSnippets:E}of u)d&&h.oneOf&&h.oneOf.push(...d),E&&h.defaultSnippets&&h.defaultSnippets.push(...E);this.schemaRegistry.registerSchema(c.launchExtensionSchemaUri,l,["launch.json"])}};t.DebugSchemaManager=_,n.__decorate([(0,r.Autowired)(p.IDebugServer),n.__metadata("design:type",Object)],_.prototype,"debug",void 0),n.__decorate([(0,r.Autowired)(o.IJSONSchemaRegistry),n.__metadata("design:type",Object)],_.prototype,"schemaRegistry",void 0),n.__decorate([(0,r.Autowired)(v.DebugConfigurationManager),n.__metadata("design:type",v.DebugConfigurationManager)],_.prototype,"config",void 0),t.DebugSchemaManager=_=n.__decorate([(0,r.Injectable)()],_),t.launchSchema={$id:c.launchSchemaUri,type:"object",title:"Launch",required:[],default:{version:"0.2.0",configurations:[]},properties:{version:{type:"string",description:"Version of this file format.",default:"0.2.0"},configurations:{type:"array",description:"List of configurations. Add new configurations or edit existing ones by using IntelliSense.",items:{defaultSnippets:[],type:"object",oneOf:[]}}}}},90408:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugService=void 0;const n=e(85608),r=e(76003),o=e(41869);let c=class{constructor(){this.onDidDebugContributionPointChangeEmitter=new o.Emitter,this.debugContributionPointsMap=new Map}registerDebugContributionPoints(v,m){this.debugContributionPointsMap.has(v)||(this.debugContributionPointsMap.set(v,m),this.onDidDebugContributionPointChangeEmitter.fire({path:v,contributions:m}))}unregisterDebugContributionPoints(v){const m=this.debugContributionPointsMap.get(v);m&&(this.debugContributionPointsMap.delete(v),this.onDidDebugContributionPointChangeEmitter.fire({path:v,contributions:m,removed:!0}))}get debugContributionPoints(){return this.debugContributionPointsMap}get onDidDebugContributionPointChange(){return this.onDidDebugContributionPointChangeEmitter.event}};t.DebugService=c,t.DebugService=c=n.__decorate([(0,r.Injectable)()],c)},3520:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSessionConnection=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(64582),p=e(38029),v=new Set(["breakpoint","capabilities","continued","exited","initialized","loadedSource","module","output","process","stopped","terminated","thread","progressStart","progressUpdate","progressEnd","invalidated"]);let m=class{constructor(s,g,l){this.sessionId=s,this.connectionFactory=g,this.traceOutputChannel=l,this.pendingRequests=new Map,this.requestHandlers=new Map,this.onDidCustomEventEmitter=new o.Emitter,this.onDidCustomEvent=this.onDidCustomEventEmitter.event,this.toDispose=new o.DisposableCollection(this.onDidCustomEventEmitter,o.Disposable.create(()=>this.pendingRequests.clear()),o.Disposable.create(()=>this.emitters.clear())),this.allThreadsContinued=!0,this.emitters=new Map,this.connection=this.createConnection()}get disposed(){return this.toDispose.disposed}dispose(){this.toDispose.dispose()}async createConnection(){if(this.disposed)throw new Error("Connection has been already disposed.");{const s=await this.connectionFactory(this.sessionId);return s.onceClose((g,l)=>{this.fire("exited",{code:g,reason:l})}),s.onMessage(g=>this.handleMessage(g)),this.toDispose.push(o.Disposable.create(()=>{s.dispose()})),s}}async sendRequest(s,g,l,h){var u;s==="initialize"&&(this.sessionAdapterID=g.adapterID);const d=this.manager.reportTime(c.DEBUG_REPORT_NAME.DEBUG_ADAPTER_PROTOCOL_TIME,{sessionId:this.sessionId,threadId:g&&g.threadId||((u=this.manager.currentThread)===null||u===void 0?void 0:u.raw.id)}),E=await this.doSendRequest(s,g,h),f={adapterID:this.sessionAdapterID,request:l.request};if(s==="threads"&&(f.amount=E.body.threads.length),d(s,f),(s==="next"||s==="stepIn"||s==="stepOut"||s==="stepBack"||s==="reverseContinue"||s==="restartFrame")&&this.fireContinuedEvent(g.threadId),s==="continue"){const a=E;return(a&&a.body&&a.body.allThreadsContinued)!==void 0&&(this.allThreadsContinued=E.body.allThreadsContinued),this.fireContinuedEvent(g.threadId,this.allThreadsContinued),E}return E}async sendCustomRequest(s,g){var l;return(l=await this.doSendRequest(s,g))===null||l===void 0?void 0:l.body}async doSendRequest(s,g=null,l){const h=new o.Deferred,u={seq:(0,c.getSequenceId)(),type:"request",command:s};let d;return g&&(u.arguments=g),this.pendingRequests.set(u.seq,E=>{d&&d.dispose(),E.success?h.resolve(E):h.reject(E)}),l&&(d=l.onCancellationRequested(async()=>{d.dispose();const E=this.manager.getSession(this.sessionId);E&&E.capabilities.supportsCancelRequest&&E.sendRequest("cancel",{requestId:u.seq})})),await this.send(u),h.promise}async send(s){const g=await this.connection,l=JSON.stringify(s);this.traceOutputChannel&&this.traceOutputChannel.appendLine(`${this.sessionId.substring(0,8)} [UI -> adapter]: ${l}`),g.send(l)}handleMessage(s){this.traceOutputChannel&&this.traceOutputChannel.appendLine(`${this.sessionId.substring(0,8)} [adapter -> UI ]: ${s}`);const g=JSON.parse(s);g.type==="request"?this.handleRequest(g):g.type==="response"?this.handleResponse(g):g.type==="event"&&this.handleEvent(g)}handleResponse(s){const g=this.pendingRequests.get(s.request_seq);g&&(this.pendingRequests.delete(s.request_seq),g(s))}onRequest(s,g){this.requestHandlers.set(s,g)}async handleRequest(s){const g={type:"response",seq:(0,c.getSequenceId)(),command:s.command,request_seq:s.seq,success:!0},l=this.requestHandlers.get(s.command);if(l)try{g.body=await l(s)}catch(h){g.success=!1,g.message=h.message}else(0,o.getDebugLogger)().error("Unhandled request",s);await this.send(g)}handleEvent(s){"event"in s?(s.event==="continued"&&(this.allThreadsContinued=s.body.allThreadsContinued!==!1),v.has(s.event)?this.doFire(s.event,s):this.onDidCustomEventEmitter.fire(s)):this.fire("exited",s)}on(s,g){return this.disposed?o.Disposable.create(()=>{}):this.getEmitter(s).event(g)}fire(s,g){this.doFire(s,g)}doFire(s,g){this.disposed||this.getEmitter(s).fire(g)}getEmitter(s){const g=this.emitters.get(s)||this.newEmitter();return this.emitters.set(s,g),g}newEmitter(){const s=new o.Emitter;return this.toDispose.push(s),s}fireContinuedEvent(s,g=!1){this.fire("continued",{type:"event",event:"continued",body:{threadId:s,allThreadsContinued:g},seq:(0,c.getSequenceId)()})}};t.DebugSessionConnection=m,n.__decorate([(0,r.Autowired)(c.IDebugSessionManager),n.__metadata("design:type",p.DebugSessionManager)],m.prototype,"manager",void 0),t.DebugSessionConnection=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__param(1,(0,r.Optional)()),n.__param(2,(0,r.Optional)()),n.__metadata("design:paramtypes",[String,Function,Object])],m)},97186:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSessionFactory=t.DebugSessionContributionRegistryImpl=t.DebugSessionContributionRegistry=t.DebugSessionContribution=void 0;const n=e(85608),r=e(76003),o=e(41869);t.DebugSessionContribution=Symbol("DebugSessionContribution"),t.DebugSessionContributionRegistry=Symbol("DebugSessionContributionRegistry");let c=class{constructor(){this.contribs=new Map,this.init()}init(){for(const v of this.contributions.getContributions())this.contribs.set(v.debugType,v)}get(v){return this.contribs.get(v)}};t.DebugSessionContributionRegistryImpl=c,n.__decorate([(0,r.Autowired)(t.DebugSessionContribution),n.__metadata("design:type",Object)],c.prototype,"contributions",void 0),t.DebugSessionContributionRegistryImpl=c=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],c),t.DebugSessionFactory=Symbol("DebugSessionFactory")},38029:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSessionManager=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(26542),p=e(54414),v=e(72665),m=e(93950),_=e(80907),s=e(64582),g=e(79845),l=e(80712),h=e(17280),u=e(97186),d=e(5905);let E=class{fireDidChange(a){this.inDebugModeKey.set(this.inDebugMode),this.onDidChangeEmitter.fire(a)}constructor(){this._uid=(0,o.uuid)(),this._sessions=new Map,this._extraMap=new Map,this._actionIndex=0,this.onWillStartDebugSessionEmitter=new o.Emitter,this.onWillStartDebugSession=this.onWillStartDebugSessionEmitter.event,this.onWillResolveDebugConfigurationEmitter=new o.Emitter,this.onWillResolveDebugConfiguration=this.onWillResolveDebugConfigurationEmitter.event,this.onDidCreateDebugSessionEmitter=new o.Emitter,this.onDidCreateDebugSession=this.onDidCreateDebugSessionEmitter.event,this.onDidStartDebugSessionEmitter=new o.Emitter,this.onDidStartDebugSession=this.onDidStartDebugSessionEmitter.event,this.onDidStopDebugSessionEmitter=new o.Emitter,this.onDidStopDebugSession=this.onDidStopDebugSessionEmitter.event,this.onDidChangeActiveDebugSessionEmitter=new o.Emitter,this.onDidChangeActiveDebugSession=this.onDidChangeActiveDebugSessionEmitter.event,this.onDidDestroyDebugSessionEmitter=new o.Emitter,this.onDidDestroyDebugSession=this.onDidDestroyDebugSessionEmitter.event,this.onDidReceiveDebugSessionCustomEventEmitter=new o.Emitter,this.onDidReceiveDebugSessionCustomEvent=this.onDidReceiveDebugSessionCustomEventEmitter.event,this.onDidChangeEmitter=new o.Emitter,this.onDidChange=this.onDidChangeEmitter.event,this.configurationIds=new Map,this.toDisposeOnCurrentSession=new o.DisposableCollection,this.init()}init(){this.debugTypeKey=this.contextKeyService.createKey(s.CONTEXT_DEBUG_TYPE_KEY,void 0),this.inDebugModeKey=this.contextKeyService.createKey(s.CONTEXT_IN_DEBUG_MODE_KEY,this.inDebugMode),this.debugStopped=this.contextKeyService.createKey(s.CONTEXT_DEBUG_STOPPED_KEY,!1),this.modelManager.onModelChanged(a=>{const{newModelUrl:b}=a;if(b){const y=o.URI.parse(b.toString()),A=this.modelManager.model;if(this.currentSession&&this.currentThread&&A){const S=this.currentThread.frames.find(w=>{var T;return((T=w.source)===null||T===void 0?void 0:T.uri.toString())===y.toString()});S&&S!==this.currentFrame&&(this.currentThread.currentFrame=S,setTimeout(()=>{this.workbenchEditorService.currentEditor&&this.workbenchEditorService.currentEditor.monacoEditor.revealLineInCenter(S.raw.line)},0))}}})}_getExtra(a,b){if(a==null)return;const y=this._extraMap.get(a);if(y)return{traceId:y.traceId,remote:y.remote,adapterID:y.adapterID,request:y.request,...b&&y.threads.get(`${b}`)}}getExtra(a,b){return this._getExtra(a,b)}_setExtra(a,b,y){const A=this._extraMap.get(a);A&&(y?A.threads.set(b,y):A.threads.delete(b))}setExtra(a,b,y){return this._setExtra(a,b,y)}report(a,b,y){return y={traceId:this._uid,...this._getExtra(y?.sessionId,y?.threadId),...y},this.reporterService.point(a,b,y)}reportTime(a,b){const y=this.reporterService.time(a);return(A,S)=>(S={...b,...S},S={traceId:this._uid,...this._getExtra(S?.sessionId,S?.threadId),...S},y.timeEnd(A,S))}reportAction(a,b,y){var A,S,w;let T=this._getExtra(a,b);T&&(b&&!T.threadId&&(T={...T}),this._actionIndex+=1,T.action=`${y}-${this._actionIndex}`,T.filePath=(S=(A=this.currentFrame)===null||A===void 0?void 0:A.raw.source)===null||S===void 0?void 0:S.path,T.fileLineNumber=(w=this.currentFrame)===null||w===void 0?void 0:w.raw.line,this._setExtra(a,`${b??""}`,T))}async start(a){const{configuration:b}=a,y={adapterID:b.type,request:b.request==="launch"?"launch":"attach",traceId:this._uid,remote:0,threads:new Map};if((0,d.isRemoteAttach)(b)&&(y.remote=1),this.report(s.DEBUG_REPORT_NAME.DEBUG_BREAKPOINT,"number",{count:this.breakpoints.getBreakpoints().length,...y}),!a.configuration.__restart&&this.isExistedDebugSession(a)){this.messageService.error((0,o.formatLocalize)("debug.launch.existed",a.configuration.name));return}try{const A=this.reportTime(s.DEBUG_REPORT_NAME.DEBUG_SESSION_START_TIME,y);await this.fireWillStartDebugSession();const S=await this.resolveConfiguration(a);if(S){if(S.configuration.preLaunchTask){this.debugProgressService.onDebugServiceStateChange(s.DebugState.Initializing);const T=o.Uri.parse(S.workspaceFolderUri),D=await this.taskService.getTask(T,S.configuration.preLaunchTask);if(D){const I=this.reportTime(s.DEBUG_REPORT_NAME.DEBUG_PRE_LAUNCH_TASK_TIME,y),O=await this.taskService.run(D);O.exitCode!==0&&this.messageService.error(`The preLaunchTask ${S.configuration.preLaunchTask} exitCode is ${O.exitCode}`),I(T.toString(),{exitCode:O.exitCode})}this.debugProgressService.onDebugServiceStateChange(s.DebugState.Running)}}else{a.configuration.type?this.messageService.error((0,o.formatLocalize)("debug.notSupported.type",a.configuration.type)):this.messageService.error((0,o.localize)("debug.notSupported.any"));return}const w=await this.debug.createDebugSession(S);if(A(S.configuration.type,{adapterID:S.configuration.type,request:S.configuration.request,sessionId:w}),!w){this.messageService.error((0,o.formatLocalize)("debug.launch.typeNotSupported",S.configuration.type));return}return this.doStart(w,S,y)}catch(A){throw this.messageService.error((0,o.localize)("debug.launch.catchError")),A}}async fireWillStartDebugSession(){await o.WaitUntilEvent.fire(this.onWillStartDebugSessionEmitter,{})}async resolveConfiguration(a){if(s.IDebugSessionDTO.is(a))return a;const{workspaceFolderUri:b,index:y,noDebug:A,parentSession:S,repl:w,compact:T,lifecycleManagedByParent:D}=a,I=await this.resolveDebugConfiguration(a.configuration,b);I&&!("cwd"in I)&&(I.cwd="${workspaceFolder}");let O=await this.variableResolver.resolve(I,{});if(!O){O===null&&this.commandService.executeCommand(o.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id);return}if(O=await this.resolveDebugConfigurationWithSubstitutedVariables(O,b),!O){O===null&&this.commandService.executeCommand(o.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id);return}const M=O.name+b,R=this.configurationIds.has(M)?this.configurationIds.get(M)+1:0;return this.configurationIds.set(M,R),{id:R,configuration:O,workspaceFolderUri:b,index:y,noDebug:A,parentSession:S,repl:w,compact:T,lifecycleManagedByParent:D}}async resolveDebugConfiguration(a,b){return await this.fireWillResolveDebugConfiguration(a.type),this.debug.resolveDebugConfiguration(a,b)}async resolveDebugConfigurationWithSubstitutedVariables(a,b){return this.debug.resolveDebugConfigurationWithSubstitutedVariables(a,b)}async fireWillResolveDebugConfiguration(a){await o.WaitUntilEvent.fire(this.onWillResolveDebugConfigurationEmitter,{debugType:a})}async doStart(a,b,y){const A=this.sessionContributionRegistry.get(b.configuration.type);if(!A)return;const w=A.debugSessionFactory().get(a,b);this._sessions.set(a,w),this._extraMap.set(a,y),b.lifecycleManagedByParent||this.updateCurrentSession(w),this.debugTypeKey.set(w.configuration.type),this.onDidCreateDebugSessionEmitter.fire(w);let T=s.DebugState.Inactive;return w.onDidChange(()=>{var D,I;T!==w.state&&(T=w.state,T===s.DebugState.Stopped?(this.onDidStopDebugSessionEmitter.fire(w),this.debugStopped.set(!0)):this.debugStopped.set(!1)),this.debugContextKey.contextSetVariableSupported.set((D=w.capabilities.supportsSetVariable)!==null&&D!==void 0?D:!1),this.debugContextKey.contextRestartFrameSupported.set((I=w.capabilities.supportsRestartFrame)!==null&&I!==void 0?I:!1),this.debugContextKey.contextDebugState.set(s.DebugState[w.state]),this.debugContextKey.contextInDebugMode.set(T!==s.DebugState.Inactive)}),w.on("terminated",D=>{const I=D.body&&D.body.restart;I?this.doRestart(w,I):this.destroy(w.id)}),w.on("exited",()=>this.destroy(w.id)),w.start().then(()=>this.onDidStartDebugSessionEmitter.fire(w)),w.onDidCustomEvent(({event:D,body:I})=>this.onDidReceiveDebugSessionCustomEventEmitter.fire({event:D,body:I,session:w})),w}isExistedDebugSession(a){const{name:b}=a.configuration;for(const[,y]of this._sessions)if(y.configuration.name===b&&!y.terminated)return!0;return!1}async restart(a=this.currentSession){return a&&this.doRestart(a)}async doRestart(a,b){const{options:y,configuration:A}=a;return await a.restart({arguments:A})?a:(await a.terminate(!0),A.__restart=b,this.start(y))}updateCurrentSession(a){this.currentSession=a||this.sessions[this.sessions.length-1]}get inDebugMode(){return this.state>s.DebugState.Inactive}get currentThread(){const a=this.currentSession;return a&&a.currentThread}get state(){const a=this.currentSession;return a?a.state:s.DebugState.Inactive}get currentFrame(){const{currentThread:a}=this;return a&&a.currentFrame}get topFrame(){const{currentThread:a}=this;return a&&a.topFrame}getSession(a){if(a)return this._sessions.get(a)}get sessions(){return Array.from(this._sessions.values()).filter(a=>a.state>s.DebugState.Inactive)}get currentSession(){return this._currentSession}set currentSession(a){if(this._currentSession===a)return;this.toDisposeOnCurrentSession.dispose();const b=this._currentSession;this._currentSession=a,this.onDidChangeActiveDebugSessionEmitter.fire({previous:b,current:a}),a&&(this.toDisposeOnCurrentSession.push(a.onDidChange(()=>{this.currentFrame===this.topFrame&&this.open(),this.fireDidChange(a)})),this.toDisposeOnCurrentSession.push(a.onCurrentThreadChange(()=>{this.fireDidChange(a)}))),this.open(),this.fireDidChange(a)}open(){const{currentFrame:a}=this;a&&a.open()}async stopSession(a,b=!1){return a?b?a.disconnect():a.terminate():Promise.all(this.sessions.map(y=>b?y.disconnect():y.terminate()))}destroy(a){if(a){const b=this._sessions.get(a);b&&this.doDestroy(b)}else this._sessions.forEach(b=>this.doDestroy(b))}doDestroy(a){this.debug.terminateDebugSession(a.id),this.remove(a.id),a.dispose(),this.onDidDestroyDebugSessionEmitter.fire(a)}remove(a){this._sessions.delete(a);const{currentSession:b}=this;b&&b.id===a&&this.updateCurrentSession(void 0),setTimeout(()=>{this._extraMap.delete(a)})}};t.DebugSessionManager=E,n.__decorate([(0,r.Autowired)(c.LabelService),n.__metadata("design:type",c.LabelService)],E.prototype,"labelProvider",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],E.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(u.DebugSessionContributionRegistry),n.__metadata("design:type",Object)],E.prototype,"sessionContributionRegistry",void 0),n.__decorate([(0,r.Autowired)(s.IDebugServer),n.__metadata("design:type",Object)],E.prototype,"debug",void 0),n.__decorate([(0,r.Autowired)(p.WorkbenchEditorService),n.__metadata("design:type",p.WorkbenchEditorService)],E.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(v.IMessageService),n.__metadata("design:type",Object)],E.prototype,"messageService",void 0),n.__decorate([(0,r.Autowired)(_.IVariableResolverService),n.__metadata("design:type",Object)],E.prototype,"variableResolver",void 0),n.__decorate([(0,r.Autowired)(l.BreakpointManager),n.__metadata("design:type",l.BreakpointManager)],E.prototype,"breakpoints",void 0),n.__decorate([(0,r.Autowired)(s.IDebugModelManager),n.__metadata("design:type",Object)],E.prototype,"modelManager",void 0),n.__decorate([(0,r.Autowired)(m.ITaskService),n.__metadata("design:type",Object)],E.prototype,"taskService",void 0),n.__decorate([(0,r.Autowired)(o.IReporterService),n.__metadata("design:type",Object)],E.prototype,"reporterService",void 0),n.__decorate([(0,r.Autowired)(g.IDebugProgress),n.__metadata("design:type",Object)],E.prototype,"debugProgressService",void 0),n.__decorate([(0,r.Autowired)(h.DebugContextKey),n.__metadata("design:type",h.DebugContextKey)],E.prototype,"debugContextKey",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],E.prototype,"commandService",void 0),t.DebugSessionManager=E=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],E)},29539:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSession=void 0;const r=e(85608).__importDefault(e(12784)),o=e(41869),c=e(43718),p=e(64582),v=e(32385),m=e(99797),_=e(88776),s=e(7885);class g{fireDidChange(){this.onDidChangeEmitter.fire(void 0),this.onStateChange()}get capabilities(){return this._capabilities}get supportsThreadIdCorrespond(){return!!this.capabilities.supportsThreadIdCorrespond}constructor(h,u,d,E,f,a,b,y,A,S,w){this.id=h,this.options=u,this.connection=d,this.terminalService=E,this.workbenchEditorService=f,this.breakpointManager=a,this.modelManager=b,this.labelProvider=y,this.messages=A,this.fileSystem=S,this.sessionManager=w,this.onDidChangeEmitter=new o.Emitter,this.onDidChange=this.onDidChangeEmitter.event,this._onDidChangeCallStack=new o.Emitter,this.onDidChangeCallStack=this._onDidChangeCallStack.event,this._onVariableChange=new o.Emitter,this.onVariableChange=this._onVariableChange.event,this._onCurrentThreadChange=new o.Emitter,this.onCurrentThreadChange=this._onCurrentThreadChange.event,this._onDidStop=new o.Emitter,this.onDidStop=this._onDidStop.event,this._onDidContinued=new o.Emitter,this.onDidContinued=this._onDidContinued.event,this._onDidThread=new o.Emitter,this.onDidThread=this._onDidThread.event,this._onRequest=new o.Emitter,this.onRequest=this._onRequest.event,this._onDidExitAdapter=new o.Emitter,this.onDidExitAdapter=this._onDidExitAdapter.event,this._onDidProgressStart=new o.Emitter,this.onDidProgressStart=this._onDidProgressStart.event,this._onDidProgressUpdate=new o.Emitter,this.onDidProgressUpdate=this._onDidProgressUpdate.event,this._onDidProgressEnd=new o.Emitter,this.onDidProgressEnd=this._onDidProgressEnd.event,this._onDidInvalidated=new o.Emitter,this.onDidInvalidated=this._onDidInvalidated.event,this._onDidChangeState=new o.Emitter,this.onDidChangeState=this._onDidChangeState.event,this._onDidInvalidMemory=new o.Emitter,this.onDidInvalidateMemory=this._onDidInvalidMemory.event,this.toDispose=new o.DisposableCollection,this._capabilities={},this.updateDeffered=null,this.exitDeferred=new o.Deferred,this.cancellationMap=new Map,this.toDisposeOnCurrentThread=new o.DisposableCollection,this.initialized=!1,this.id2Breakpoint=new Map,this.settingBreakpoints=null,this._multipleThreadPaused=new Map,this.sources=new Map,this._threads=new Map,this.scheduleUpdateThreads=(0,r.default)(()=>this.updateThreads(void 0),100),this.pendingThreads=Promise.resolve(),this.terminated=!1,this.connection.onRequest("runInTerminal",async T=>await this.runInTerminal(T)),this.toDispose.pushAll([this.onDidChangeEmitter,this.connection,this.on("initialized",()=>{this.configure()}),this.on("breakpoint",({body:T})=>this.onUpdateBreakpoint(T)),this.on("continued",async T=>{const{body:{allThreadsContinued:D,threadId:I}}=T;if(this.handleCancellation(I),this.supportsThreadIdCorrespond){I?this._multipleThreadPaused.delete(I):D!==!1&&this._multipleThreadPaused.clear(),await this.updateCurrentThread(),this._onDidContinued.fire(T);return}if(D!==!1){this.clearThreads(),this._onDidContinued.fire(T);return}(0,c.isDefined)(I)&&this.clearThread(I),this.onStateChange(),this._onDidContinued.fire(T)}),this.on("stopped",async T=>{const{body:D}=T;this.stoppedDetails=D;const{threadId:I}=D,O=this.sessionManager.reportTime(p.DEBUG_REPORT_NAME.DEBUG_STOPPED,{sessionId:this.id,threadId:I});if(this.supportsThreadIdCorrespond===!0){if(await this.collectPausedThread(D),D.threadId&&this._multipleThreadPaused.has(D.threadId)){const R=this._multipleThreadPaused.get(D.threadId);await this.updateCurrentThread(R),await this.updateCurrentThreadFramesOnFocus()}}else this.updateDeffered=new o.Deferred,await this.updateThreads(D),await this.updateCurrentThreadFramesOnFocus(),this.updateDeffered.resolve();O("stopped");const M=this.sessionManager.getExtra(this.id,I);I&&M&&M.action&&(M.action=void 0,this.sessionManager.setExtra(this.id,`${I??""}`,M)),this.onStateChange(),this.sessionManager.currentSession=this,this._onDidStop.fire(T)}),this.on("thread",T=>{const{body:{reason:D,threadId:I}}=T;if(this.supportsThreadIdCorrespond){this.state===p.DebugState.Stopped&&this._onDidThread.fire(T);return}D==="started"?this.scheduleUpdateThreads():D==="exited"&&this.clearThread(I),this._onDidThread.fire(T)}),this.on("terminated",()=>{this.terminated=!0}),this.on("exited",T=>{this.exitDeferred.resolve(T)}),this.on("progressStart",T=>{this._onDidProgressStart.fire(T)}),this.on("progressUpdate",T=>{this._onDidProgressUpdate.fire(T)}),this.on("progressEnd",T=>{this._onDidProgressEnd.fire(T)}),this.on("memory",T=>{this._onDidInvalidMemory.fire(T)}),this.on("invalidated",async T=>{this._onDidInvalidated.fire(T),T.body.areas&&T.body.areas.length===1&&(T.body.areas[0]==="variables"||T.body.areas[0]==="watch")||(this.cancelAllRequests(),this.clearThreads(),await this.updateThreads(this.stoppedDetails)),this.fireDidChange()}),this.on("capabilities",T=>this.updateCapabilities(T.body.capabilities)),this.breakpointManager.onDidChangeBreakpoints(T=>this.runtimeUpdateBreakpoint(T)),this.breakpointManager.onDidChangeExceptionsBreakpoints(T=>{this.breakpointManager.breakpointsEnabled&&this.setExceptionBreakpoints(T)}),c.Disposable.create(()=>{this.breakpointManager.clearAllStatus(this.id)})])}getMemory(h){return new v.MemoryRegion(h,this)}get configuration(){return this.options.configuration}get parentSession(){return this.options.parentSession}get lifecycleManagedByParent(){return this.options.lifecycleManagedByParent}get compact(){return!!this.options.compact}async start(){await this.workbenchEditorService.saveAll(),await this.initialize(),await this.launchOrAttach()}async runInTerminal({arguments:{title:h,cwd:u,args:d,env:E}}){return this.doRunInTerminal({name:h,cwd:u,env:E,args:d})}async doRunInTerminal(h){var u;const d=this.terminalService.terminals.find(b=>b.name===h.name&&b.isActive);let E;const f=await this.terminalService.getDefaultShellPath(),a=(0,p.prepareCommand)(f,h.args,!1,(u=h.cwd)===null||u===void 0?void 0:u.toString(),h.env);if(d)a&&this.terminalService.sendText(d.id,a),E=await this.terminalService.getProcessId(d.id);else{const b=await this.terminalService.createTerminal(h);b.show(),a&&(this.terminalService.sendText(b.id,a),E=await this.terminalService.getProcessId(b.id))}return{processId:E}}async initialize(){const h=await this.connection.sendRequest("initialize",{clientID:"OpenSumi",clientName:"OpenSumi IDE",adapterID:this.configuration.type,locale:(0,c.getLanguageId)(),linesStartAt1:!0,columnsStartAt1:!0,pathFormat:"path",supportsVariableType:!1,supportsVariablePaging:!1,supportsRunInTerminalRequest:!0,supportsProgressReporting:!0,supportsInvalidatedEvent:!0,supportsMemoryEvent:!0,supportsMemoryReferences:!0},this.configuration);this.updateCapabilities(h.body||{}),this.onStateChange()}async launchOrAttach(){var h;if(this.parentSession&&this.parentSession.state===p.DebugState.Inactive)throw(0,o.canceled)();try{this.configuration.request==="attach"?await this.sendRequest("attach",this.configuration):await this.sendRequest("launch",this.configuration)}catch(u){throw this.fireExited(u),this.messages.error(u.message||((h=u.body)===null||h===void 0?void 0:h.error.format)||(0,o.localize)("debug.console.errorMessage")),u&&u.message}}async configure(){await this.initBreakpoints(),this.breakpointManager.setExceptionBreakpoints(this.capabilities.exceptionBreakpointFilters||[]),this.initialized=!0,this.capabilities.supportsConfigurationDoneRequest&&this.sendRequest("configurationDone",{}),this.supportsThreadIdCorrespond||await this.updateThreads(void 0)}async setExceptionBreakpoints(h){return this.sendRequest("setExceptionBreakpoints",h)}onStateChange(){const h=this.state;this.previousState!==h&&(this.previousState=h,this._onDidChangeState.fire(h))}async onUpdateBreakpoint(h){let u;this.settingBreakpoints&&await this.settingBreakpoints.promise;try{const d=h.breakpoint;switch(h.reason){case"new":if(d.source&&typeof d.line=="number"&&d.id&&!this.id2Breakpoint.has(d.id)){const E=_.DebugSource.toUri(d.source),f=m.DebugBreakpoint.create(E,{line:d.line,column:d.column});f.status.set(this.id,d),this.addBreakpoint(f)}break;case"removed":d.id&&(u=this.id2Breakpoint.get(d.id),u&&this.delBreakpoint(u));break;case"changed":d.id&&(u=this.id2Breakpoint.get(d.id),u&&(u.status.set(this.id,d),this.breakpointManager.updateBreakpoint(u,!0)));break;default:break}}finally{}}async setBreakpoints(h){const u=[];for(const d of h){const E=await this.toSource(d),f=this.breakpointManager.getBreakpoints(d).filter(a=>this.breakpointManager.breakpointsEnabled&&a.enabled);u.push(this.sendRequest("setBreakpoints",{source:E.raw,sourceModified:!1,lines:f.map(a=>a.raw.line),breakpoints:f.map(a=>a.raw)}).then(a=>(a.body.breakpoints.forEach((b,y)=>{var A,S;b.id&&this.id2Breakpoint.set(b.id,f[y]);const w=f[y];w.raw.line=(A=b.line)!==null&&A!==void 0?A:w.raw.line,w.raw.column=(S=b.column)!==null&&S!==void 0?S:w.raw.column,w.status.set(this.id,b)}),this.breakpointManager.updateBreakpoints(f,!0),this.breakpointManager.resolveBpDeffered(),Promise.resolve())).catch(a=>{if(!(a instanceof Error)){const y=a.message?`${a.message}`:"Breakpoint not valid for current debug session";f.forEach(A=>{A.status.set(this.id,{verified:!1,message:y}),this.breakpointManager.updateBreakpoint(A,!0)})}}))}return await Promise.all(u)}delBreakpoint(h){return this.breakpointManager.delBreakpoint(h)}async addBreakpoint(h,u){return u&&this.breakpointManager.setBpDeffered(),this.breakpointManager.addBreakpoint(h),this.breakpointManager.promiseBpDeffered()}async runtimeUpdateBreakpoint(h){const{affected:u,statusUpdated:d}=h;if(!d)return await this.setBreakpoints(u)}async initBreakpoints(){this.settingBreakpoints=new o.Deferred,this.id2Breakpoint.clear(),this.configuration.noDebug||await this.setBreakpoints(this.breakpointManager.affected.map(h=>o.URI.parse(h))),this.settingBreakpoints.resolve(),this.settingBreakpoints=null}get currentThread(){return this._currentThread}set currentThread(h){this.toDisposeOnCurrentThread.dispose(),this._currentThread=h,h&&this.toDisposeOnCurrentThread.push(h.onDidChanged(()=>this.fireDidChange()))}get multipleThreadPaused(){return this._multipleThreadPaused}hasInMultipleThreadPaused(h){return this._multipleThreadPaused.has(h)}clearThreads(){var h;const u=this.sessionManager.reportTime(p.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME,{sessionId:this.id,threadId:(h=this.currentThread)===null||h===void 0?void 0:h.id,threadAmount:this.threadCount});this._threads.forEach(d=>{d.clear()}),this._onDidChangeCallStack.fire(),this.collocationThread(),u("clearThreads")}clearThread(h){const u=this.sessionManager.reportTime(p.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME,{sessionId:this.id,threadId:h,threadAmount:this.threadCount}),d=this._threads.get(h);d&&(d.clear(),this._onDidChangeCallStack.fire()),this.collocationThread(),u("clearThread")}get state(){if(this.connection.disposed)return p.DebugState.Inactive;if(!this.initialized)return p.DebugState.Initializing;const h=this.currentThread;return h?h.stopped?p.DebugState.Stopped:p.DebugState.Running:this.supportsThreadIdCorrespond?p.DebugState.Running:this.stoppedThreads.next().value?p.DebugState.Stopped:p.DebugState.Running}get currentFrame(){return this.currentThread&&this.currentThread.currentFrame}async getScopes(h){const{currentFrame:u}=this;return u?u.getScopes(h):[]}get label(){return p.IDebugSessionDTO.is(this.options)&&this.options.id?this.configuration.name+" ("+(this.options.id+1)+")":this.configuration.name}get visible(){return this.state>p.DebugState.Inactive}getSource(h){const u=_.DebugSource.toUri(h).toString(),d=this.sources.get(u)||new _.DebugSource(this,this.labelProvider,this.modelManager,this.workbenchEditorService,this.fileSystem);return d.update({raw:h}),this.sources.set(u,d),d}getSourceForUri(h){return this.sources.get(h.toString())}async toSource(h){const u=this.getSourceForUri(h);return u||this.getSource(await this.toDebugSource(h))}async toDebugSource(h){if(h.scheme===_.DebugSource.SCHEME)return{name:h.path.toString(),sourceReference:Number(h.query)};const u=h.displayName;let d=h.toString();return h.scheme===c.Schemes.file&&(d=await this.fileSystem.getFsPath(d)),{name:u,path:d,adapterData:void 0,sourceReference:void 0}}get threads(){return Array.from(this._threads.values())}get threadCount(){return this._threads.size}*getThreads(h){for(const u of this.threads)h(u)&&(yield u)}get runningThreads(){return this.getThreads(h=>!h.stopped)}get stoppedThreads(){return this.getThreads(h=>h.stopped)}async rawFetchThreads(h){const u=typeof h>"u"?null:{threadId:h},d=await this.sendRequest("threads",u);return d&&d.body&&d.body.threads&&Array.isArray(d.body.threads)?Promise.resolve(d.body.threads):Promise.resolve([])}async fetchThreads(){const h=await this.rawFetchThreads(),u=this._threads,d=[];for(const E of h){const f=E.id,a=u.get(f)||new s.DebugThread(this);d.push(a),a.update({raw:E})}return Promise.resolve(d)}updateThreads(h){return this.pendingThreads=this.pendingThreads.then(async()=>{try{const u=await this.rawFetchThreads();this.doUpdateThreads(u,h)}catch{}})}doUpdateThreads(h,u){const d=this.sessionManager.reportTime(p.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME,{sessionId:this.id,threadId:u?.threadId,threadAmount:h.length}),E=[];h.forEach(f=>{if(E.push(f.id),this._threads.has(f.id)){if(f.name){const a=this._threads.get(f.id);a&&(a.raw.name=f.name)}}else{const a=new s.DebugThread(this),b={raw:f};a.update(b),this._threads.set(f.id,a)}}),this._threads.forEach(f=>{var a;const{raw:{id:b}}=f;E.indexOf(b)===-1&&this._threads.delete(b),u&&(u.allThreadsStopped||u.threadId===b)&&((a=this._threads.get(b))===null||a===void 0||a.update({stoppedDetails:u}))}),this.collocationThread(u),d("doUpdateThreads")}collocationThread(h){var u;const{currentThread:d}=this;let E=d&&d.raw.id;h&&!h.preserveFocusHint&&h.threadId&&(E=h.threadId),this.currentThread=typeof E=="number"&&this._threads.get(E)||this._threads.values().next().value,((u=this.currentThread)===null||u===void 0?void 0:u.raw.id)!==E&&this.fireDidChange()}async updateCurrentThread(h){h?(this.currentThread=h,this._onCurrentThreadChange.fire(this.currentThread)):(this.currentThread=void 0,this._onCurrentThreadChange.fire(void 0))}async collectPausedThread(h){const u=await this.rawFetchThreads(h?.threadId);if(u.length===0)return new Map;const d=h.threadId&&this._multipleThreadPaused.has(h.threadId)?this._multipleThreadPaused.get(h.threadId):new s.DebugThread(this),E={raw:u[0]};return h&&(h.allThreadsStopped||h.threadId===u[0].id)&&(E.stoppedDetails=h),d&&(d.update(E),await this.rawFetchFrames(d),this._multipleThreadPaused.set(d.raw.id,d)),this._multipleThreadPaused}async updateCurrentThreadFramesOnFocus(){await this.rawFetchFrames(this.currentThread),this._onDidChangeCallStack.fire();const h=this.workbenchEditorService.currentEditor,u=d=>{this.stoppedDetails&&!this.stoppedDetails.preserveFocusHint&&(this.currentThread.currentFrame=d)};if(this.currentThread&&!this.currentFrame){const d=this.currentThread.frames.filter(E=>E&&E.source&&E.source.raw.presentationHint!=="deemphasize");if(d.length===0)return;if(h){const E=h.monacoEditor.getModel();if(E){const f=o.URI.parse(E.uri.toString()),a=d.filter(b=>b.source.uri.toString()===f.toString());a.length>0?u(a[0]):u(d[0])}}else u(d[0])}}async rawFetchFrames(h){!h||h.frameCount||(this.capabilities.supportsDelayedStackTraceLoading?(await h.rawFetchFrames(1),await h.rawFetchFrames(19)):await h.rawFetchFrames())}async terminate(h){if(this.initialized=!0,this.cancelAllRequests(),this.lifecycleManagedByParent&&this.parentSession){await this.parentSession.terminate(h);return}!this.terminated&&this.capabilities.supportsTerminateRequest&&this.configuration.request==="launch"?(this.terminated=!0,this.sendRequest("terminate",{restart:h}),await this.exited(1e3)||await this.disconnect(h)):await this.disconnect(h)}async disconnect(h){try{this.lifecycleManagedByParent&&this.parentSession?this.parentSession.disconnect(h):this.sendRequest("disconnect",{restart:h})}catch(d){this.fireExited(d);return}finally{this._onDidExitAdapter.fire(),this.onStateChange()}const u=500;await this.exited(u)||this.fireExited(new Error(`timeout after ${u} ms`))}updateCapabilities(h){Object.assign(this._capabilities,h)}fireExited(h){this.connection.fire("exited",{reason:h})}exited(h){return Promise.race([this.exitDeferred.promise.then(()=>!0,()=>!1),new Promise(u=>{setTimeout(u,h,!1)})])}async restart(h){return this.cancelAllRequests(),this.capabilities.supportsRestartRequest?(this.terminated=!1,this.lifecycleManagedByParent&&this.parentSession?await this.parentSession.restart({arguments:this.parentSession.configuration}):await this.sendRequest("restart",h),!0):!1}dispose(){this.toDispose.dispose()}async evaluate(h,u){var d;this.updateDeffered&&await((d=this.updateDeffered)===null||d===void 0?void 0:d.promise);const E=this.currentFrame&&this.currentFrame.raw.id;return(await this.sendRequest("evaluate",{expression:h,frameId:E,context:u})).body}async variables(h,u="named"){return(await this.sendRequest("variables",{variablesReference:h,filter:u})).body}async goto(h){if(this.capabilities.supportsGotoTargetsRequest)return await this.sendRequest("goto",h)}async exceptionInfo(h){return this.capabilities.supportsExceptionInfoRequest?this.sendRequest("exceptionInfo",h):Promise.reject(new Error("exceptionInfo not supported"))}async cancel(h){return this.sendRequest("cancel",{progressId:h})}async setVariableValue(h){if(this.capabilities.supportsSetVariable){const u=await this.sendRequest("setVariable",h);return this._onVariableChange.fire(),u}}async breakpointLocations(h,u){var d;const E=await this.toSource(h),a=(((d=(await this.sendRequest("breakpointLocations",{source:E.raw,line:u})).body)===null||d===void 0?void 0:d.breakpoints)||[]).map(b=>({lineNumber:b.line,column:b.column||1}));return Object.values(a.reduce((b,y)=>({...b,[`${y.lineNumber}:${y.column}`]:y}),{}))}async sendRequest(h,u,d){var E,f,a;if(!this._capabilities.supportsTerminateRequest&&h==="terminate"||!this._capabilities.supportsCompletionsRequest&&h==="completions"||!this._capabilities.supportsTerminateThreadsRequest&&h==="terminateThreads")throw new Error(`debug: ${h} not supported`);let b;["continue","next","stepIn","stepOut","threads"].some(y=>h===y)&&this.handleCancellation((E=this.currentThread)===null||E===void 0?void 0:E.raw.id),["stackTrace","scopes","variables","completions","threads"].some(y=>h===y)&&(b=!((f=this.currentThread)===null||f===void 0)&&f.raw.id?this.getNewCancellationToken((a=this.currentThread)===null||a===void 0?void 0:a.raw.id,d):void 0);try{return await this.connection.sendRequest(h,u,this.configuration,b)}finally{this._onRequest.fire(h)}}async takeCommand(h){return new Promise(u=>{const d=this.onRequest(E=>{E===h&&(d.dispose(),u())})})}sendCustomRequest(h,u){return this.connection.sendCustomRequest(h,u)}on(h,u){return this.connection.on(h,u)}get onDidCustomEvent(){return this.connection.onDidCustomEvent}hasSeparateRepl(){return!this.parentSession||this.options.repl!=="mergeWithParent"}reportTime(h,u){return this.sessionManager.reportTime(h,u)}getNewCancellationToken(h,u){const d=new c.CancellationTokenSource(u),E=this.cancellationMap.get(h)||[];return E.push(d),this.cancellationMap.set(h,E),d.token}cancelAllRequests(){this.cancellationMap.forEach(h=>h.forEach(u=>u.cancel())),this.cancellationMap.clear()}handleCancellation(h){if(h){const u=this.cancellationMap.get(h);this.cancellationMap.delete(h),u&&u.forEach(d=>d.cancel())}else this.cancelAllRequests()}getDebugProtocolBreakpoint(h){const u=this.breakpointManager.getBreakpoints().find(d=>d.id===h);if(u){const d=u.status.get(this.id);return{id:d?.id,verified:!!d?.verified,message:d?.message,source:d?.source,line:d?.line,column:d?.column,endLine:d?.endLine,endColumn:d?.endColumn,instructionReference:d?.instructionReference,offset:d?.offset}}}currentEditor(){var h;return(h=this.getModel())===null||h===void 0?void 0:h.getEditor()}getModel(){return this.modelManager.model}async readMemory(h,u,d){return this.capabilities.supportsReadMemoryRequest?await this.sendRequest("readMemory",{count:d,memoryReference:h,offset:u}):Promise.resolve(void 0)}async writeMemory(h,u,d,E){return this.capabilities.supportsWriteMemoryRequest?await this.sendRequest("writeMemory",{memoryReference:h,offset:u,allowPartial:E,data:d}):Promise.resolve(void 0)}}t.DebugSession=g},5905:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseSnippet=t.CharWidthReader=t.DEFAULT_WORD_REGEXP=t.USUAL_WORD_SEPARATORS=void 0,t.isExtensionHostDebugging=c,t.matchAll=p,t.isRemoteAttach=v;const n=e(41869),r=e(57711),{equalsIgnoreCase:o}=n.strings;function c(g){return g.type&&o(g.type==="vslsShare"?g.adapterProxy.configuration.type:g.type,"extensionhost")}function p(g,l){let h;const u=[];for(;(h=l.exec(g))!==null;)u.push(h);return u}function v(g){if(g.request==="attach"){const l={node:"address",java:"hostName",go:"host",cppdbg:"miDebuggerServerAddress",python:"host"},{type:h}=g,u=g[l[h]];return u?!["localhost","0.0.0.0","127.0.0.1","::1"].includes(u):!0}return!1}t.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function m(g=""){let l="(-?\\d*\\.\\d\\w*)|([^";for(const h of t.USUAL_WORD_SEPARATORS)g.indexOf(h)>=0||(l+="\\"+h);return l+="\\s]+)",new RegExp(l,"g")}t.DEFAULT_WORD_REGEXP=m();class _{static getInstance(){return _._INSTANCE||(_._INSTANCE=new _),_._INSTANCE}constructor(){this._cache=new Map,this._canvas=document.createElement("canvas")}getCharWidth(l,h){const u=l+h;if(this._cache.has(u))return this._cache.get(u);const d=this._canvas.getContext("2d");d.font=h;const f=d.measureText(l).width;return this._cache.set(u,f),f}}t.CharWidthReader=_,_._INSTANCE=null;const s=g=>{const l=new RegExp(/^\^\"(.*)\"/gm),h=new r.SnippetParser;return new RegExp(/\${\d+:(.*)/).test(g)||l.test(g)?h.parse(g).toString().replace(l,"$1"):g};t.parseSnippet=s},17475:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugBreakpointWidget=t.TopStackType=void 0;const r=e(85608),o=e(76003),c=e(41869),p=e(43718),v=r.__importStar(e(20868)),m=e(64582),_=e(97319),s=e(4983),g=e(27562);var l;(function(u){u[u.exception=0]="exception",u[u.debugger=1]="debugger"})(l||(t.TopStackType=l={}));let h=n=class extends p.Disposable{constructor(){super(),this.breakpointWidgetInputFocus=s.CONTEXT_BREAKPOINT_INPUT_FOCUSED.bind(this.contextKeyService)}get position(){return this._position}get values(){var d;return(d=this.zone)===null||d===void 0?void 0:d.values}get breakpointType(){var d;return(d=this.zone)===null||d===void 0?void 0:d.breakpointType}show(d,E,f="condition"){this.dispose(),this._position=d,this.addDispose(this.zone=this.injector.get(g.DebugBreakpointZoneWidget,[this.editor,{...E},f])),this.addDispose(this.zone.onDidChangeBreakpoint(({context:a,value:b})=>{E&&(E[a]=b)})),this.addDispose(this.zone.onFocus(()=>{this.breakpointWidgetInputFocus.set(!0)})),this.addDispose(this.zone.onBlur(()=>{this.breakpointWidgetInputFocus.set(!1)})),this.addDispose(this.zone.onDispose(()=>{this._position=void 0,this.breakpointWidgetInputFocus.set(!1)})),this.zone.show(v.positionToRange(d),n.LINE_HEIGHT_NUMBER)}hide(){var d;(d=this.zone)===null||d===void 0||d.hide()}};t.DebugBreakpointWidget=h,h.LINE_HEIGHT_NUMBER=2,r.__decorate([(0,o.Autowired)(m.DebugEditor),r.__metadata("design:type",Object)],h.prototype,"editor",void 0),r.__decorate([(0,o.Autowired)(_.DebugBreakpointsService),r.__metadata("design:type",_.DebugBreakpointsService)],h.prototype,"debugBreakpointsService",void 0),r.__decorate([(0,o.Autowired)(c.IContextKeyService),r.__metadata("design:type",Object)],h.prototype,"contextKeyService",void 0),r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],h.prototype,"injector",void 0),t.DebugBreakpointWidget=h=n=r.__decorate([(0,o.Injectable)(),r.__metadata("design:paramtypes",[])],h)},27562:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugBreakpointZoneWidget=void 0;const r=e(85608),o=r.__importDefault(e(14041)),c=r.__importDefault(e(25873)),p=e(76003),v=e(97267),m=e(41869),_=e(43718),s=e(20303),g=e(52416),l=e(31324),h=e(64582),u=e(97319),d=r.__importDefault(e(55797));let E=n=class extends s.ZoneWidget{_fillContainer(a){}get values(){return{...this.contexts,[this.context]:this.input&&this.input.monacoEditor.getValue()||void 0}}get breakpointType(){return this.context}constructor(a,b={},y="condition"){super(a),this.editor=a,this.contexts=b,this.context=y,this._onDidChangeBreakpoint=new _.Emitter,this.onDidChangeBreakpoint=this._onDidChangeBreakpoint.event,this._onFocus=new _.Emitter,this.onFocus=this._onFocus.event,this._onBlur=new _.Emitter,this.onBlur=this._onBlur.event,this.inputFocusHandler=()=>{this._onFocus.fire()},this.inputBlurHandler=()=>{this._onBlur.fire()},this.selectContextHandler=A=>{this.input&&(this.contexts[this.context]=this.input.monacoEditor.getValue()||void 0),this.context=A,this.setInputMode(),this.render()},this._wrapper=document.createElement("div"),this._selection=document.createElement("div"),this._input=document.createElement("div"),this._container.appendChild(this._wrapper),this._wrapper.appendChild(this._selection),this._wrapper.appendChild(this._input),c.default.createRoot(this._input).render(o.default.createElement(o.default.Fragment,null))}hide(){this.input&&(this.input.dispose(),this.input=void 0),super.dispose()}show(a,b){super.show(a,b),this.debugBreakpointsService.createBreakpointInput(this._input).then(y=>{this.input=y;const{monacoEditor:A}=this.input;this.setInputMode(),this.addDispose(A.onDidBlurEditorWidget(()=>{this.inputBlurHandler()})),this.addDispose(A.onDidFocusEditorWidget(()=>{this.inputFocusHandler()})),this.addDispose(A.onDidChangeModelContent(S=>{if(!this.input)return;A.getValue().length===0?this.ensureRenderPlaceholder():this.clearPlaceholder();const T=A.getModel().getLineCount();this._relayout(T+1)})),this.syncPreContent()})}createDecorations(){this.input&&this.input.monacoEditor.getValue().length===0&&this.input.monacoEditor.deltaDecorations([],[{range:{startLineNumber:1,endLineNumber:0,startColumn:0,endColumn:1},options:{description:"debug-breakpoint-zone-widget",afterContentClassName:d.default.input_placeholder}}])}renderOption(a,b){return o.default.createElement(v.Option,{value:a},b)}setInputMode(){var a,b;const y=(a=this.editor.getModel())===null||a===void 0?void 0:a.getLanguageId(),A=(b=this.input)===null||b===void 0?void 0:b.monacoEditor.getModel();A&&y&&A.setLanguage(this.context==="logMessage"?"plaintext":y)}renderPlaceholder(){if(!this.input)return;this.clearPlaceholder();const a=`'${this.placeholder}' !important`;this.cssRenderDisposable=this.cssManager.addClass(n.INPUT_PLACEHOLDER_AFTER,{content:a})}ensureRenderPlaceholder(){this.input&&(this.createDecorations(),this.renderPlaceholder())}syncPreContent(){if(this.input){this.input.focus();const a=this.contexts[this.context]||"";this.input.monacoEditor.setValue(a)}}clearPlaceholder(){this.cssRenderDisposable&&(this.cssRenderDisposable.dispose(),this.cssRenderDisposable=void 0)}applyClass(){if(this._wrapper.className=d.default.debug_breakpoint_wrapper,this._selection.className=d.default.debug_breakpoint_selected,this._input.className=d.default.debug_breakpoint_input,!this.editor.getModel())return;const b=this.editor.getOption(l.EditorOption.lineHeight),y=this.editor.getOption(l.EditorOption.fontSize),A=b-y;this._input.style.marginTop=A+"px"}applyStyle(){this.syncPreContent(),c.default.createRoot(this._selection).render(o.default.createElement(v.Select,{value:this.context,selectedRenderer:()=>o.default.createElement("span",{className:"kt-select-option"},this.getContextToLocalize(this.context)),onChange:this.selectContextHandler},this.renderOption("condition",this.getContextToLocalize("condition")),this.renderOption("hitCondition",this.getContextToLocalize("hitCondition")),this.renderOption("logMessage",this.getContextToLocalize("logMessage"))))}getContextToLocalize(a){switch(a){case"logMessage":return(0,_.localize)("debug.expression.logMessage");case"hitCondition":return(0,_.localize)("debug.expression.hitCondition");default:return(0,_.localize)("debug.expression.condition")}}get placeholder(){switch(this.context){case"logMessage":return(0,_.localize)("debug.expression.log.placeholder");case"hitCondition":return(0,_.localize)("debug.expression.hit.placeholder");default:return(0,_.localize)("debug.expression.condition.placeholder")}}};t.DebugBreakpointZoneWidget=E,E.INPUT_PLACEHOLDER_AFTER=d.default.input_placeholder+"::after",r.__decorate([(0,p.Autowired)(u.DebugBreakpointsService),r.__metadata("design:type",u.DebugBreakpointsService)],E.prototype,"debugBreakpointsService",void 0),r.__decorate([(0,p.Autowired)(m.PreferenceService),r.__metadata("design:type",Object)],E.prototype,"preferenceService",void 0),r.__decorate([(0,p.Autowired)(g.ICSSStyleService),r.__metadata("design:type",Object)],E.prototype,"cssManager",void 0),t.DebugBreakpointZoneWidget=E=n=r.__decorate([(0,p.Injectable)({multiple:!0}),r.__metadata("design:paramtypes",[Object,Object,String])],E)},52943:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugEditorContribution=void 0;const r=e(85608),o=e(76003),c=e(41869),p=e(54414),v=e(51553),m=r.__importStar(e(20868)),_=e(79865),s=e(44781),g=e(38390),l=e(17280),h=e(84303),u=e(38029),d=e(16170),E=e(64582),f=e(5905),a="inlinevaluedecoration",b=100,y=150,A=500,{flatten:S}=c.arrays;class w{constructor(R,P){this.column=R,this.text=P}}function T(M,R,P=1073741824){return R.length>y&&(R=R.substr(0,y)+"..."),{range:{startLineNumber:M,endLineNumber:M,startColumn:P,endColumn:P},renderOptions:{after:{contentText:R,backgroundColor:"rgba(255, 200, 0, 0.2)",margin:"10px"},dark:{after:{color:"rgba(255, 255, 255, 0.5)"}},light:{after:{color:"rgba(0, 0, 0, 0.5)"}}}}}function D(M,R,P,k){const F=new Map;for(const j of M)if(F.set(j.name,j.value),F.size>=b)break;const L=new Map;F.forEach((j,W)=>{const U=k.get(W);if(U)for(const Q of U)R.containsPosition(new c.Position(Q,0))&&(L.has(Q)||L.set(Q,[]),L.get(Q).indexOf(W)===-1&&L.get(Q).push(W))});const B=[];return L.forEach((j,W)=>{const U=j.sort((Q,V)=>{const $=P.getLineContent(W);return $.indexOf(Q)-$.indexOf(V)}).map(Q=>`${Q} = ${F.get(Q)}`).join(", ");B.push(T(W,U))}),B}function I(M){const R=new Map;if(!M)return R;for(let P=1,k=M.getLineCount();P<=k;++P){const F=M.getLineContent(P);if(F.length>A)continue;M.tokenization.forceTokenization(P);const L=M.tokenization.getLineTokens(P);for(let B=0,j=L.getCount();B<j;B++)if(L.getStandardTokenType(B)===g.StandardTokenType.Other){f.DEFAULT_WORD_REGEXP.lastIndex=0;const U=L.getStartOffset(B),Q=L.getEndOffset(B),V=F.substring(U,Q),$=f.DEFAULT_WORD_REGEXP.exec(V);if($){const Y=$[0];R.has(Y)||R.set(Y,[]),R.get(Y).push(P)}}}return R}let O=n=class{constructor(R){this.editor=R,this.disposer=new c.Disposable,this.editorDisposer=new c.Disposable}contribute(R){return this.disposer.addDispose(this.debugSessionManager.onDidChangeActiveDebugSession(()=>{const P=this.debugSessionManager.currentSession;P&&(this.editorDisposer.addDispose(P.onDidChange(async()=>{var k,F;this.setHoverEnabled(R,P.state===E.DebugState.Running);const L=(k=P.currentThread)===null||k===void 0?void 0:k.currentFrame;L&&R.currentUri&&!((F=L.source)===null||F===void 0)&&F.uri.isEqual(R.currentUri)&&await this.toggleExceptionWidget()})),this.editorDisposer.addDispose(P.onDidExitAdapter(()=>{this.setHoverEnabled(R,!0)})),this.editorDisposer.addDispose(this.editorService.onActiveResourceChange(k=>{var F;k?.uri.toString()===((F=P.getModel())===null||F===void 0?void 0:F.uri.toString())?this.setHoverEnabled(R):this.setHoverEnabled(R,!0)})),this.disposer.addDispose([c.Event.any(P.onDidChangeCallStack,P.onDidStop)(async()=>{await this.directRunUpdateInlineValueDecorations(R)}),P.onDidExitAdapter(()=>{this.removeInlineValuesScheduler(R).schedule(),this.editorDisposer.dispose()})]),this.disposer.addDispose(P.onDidChangeState(k=>{k!==E.DebugState.Stopped&&this.toggleExceptionWidget()})),this.disposer.addDispose(P),this.registerEditorListener(R))})),this.disposer.addDispose(this.debugSessionManager.onDidDestroyDebugSession(()=>{this.closeExceptionWidget()})),this.disposer.addDispose(this.editorDisposer),this.toggleExceptionWidget(),this.disposer}registerEditorListener(R){this.editorDisposer.addDispose(R.monacoEditor.onKeyDown(async P=>{var k,F,L,B,j;if(((L=(F=(k=this.debugSessionManager.currentSession)===null||k===void 0?void 0:k.currentFrame)===null||F===void 0?void 0:F.source)===null||L===void 0?void 0:L.uri.toString())===((B=R.currentUri)===null||B===void 0?void 0:B.toString())&&P.keyCode===m.KeyCode.Alt){this.setHoverEnabled(R,!0),(j=this.debugModelManager.model)===null||j===void 0||j.getDebugHoverWidget().hide();const W=R.monacoEditor.onKeyUp(async U=>{var Q;U.keyCode===m.KeyCode.Alt&&(this.setHoverEnabled(R,!1),(Q=this.debugModelManager.model)===null||Q===void 0||Q.getDebugHoverWidget().show(),W.dispose())})}})),this.editorDisposer.addDispose(R.monacoEditor.onDidChangeModelContent(async()=>{n.MEMOIZER.clear(),await this.directRunUpdateInlineValueDecorations(R)})),this.editorDisposer.addDispose(R.monacoEditor.onDidChangeModel(async()=>{this.toggleExceptionWidget(),await this.directRunUpdateInlineValueDecorations(R)}))}registerDecorationType(){this.overrideServicesRegistry.getRegisteredService(c.ServiceNames.CODE_EDITOR_SERVICE).registerDecorationType("inline-value-decoration",a,{})}setHoverEnabled(R,P=!this.debugContextKey.contextInDebugMode.get()){R.monacoEditor.updateOptions({hover:{enabled:P}})}async directRunUpdateInlineValueDecorations(R){var P;const k=(P=this.debugSessionManager.currentSession)===null||P===void 0?void 0:P.currentFrame;k&&(n.MEMOIZER.clear(),await this.updateInlineValueDecorations(k,R))}removeInlineValuesScheduler(R){return new c.RunOnceScheduler(()=>R.monacoEditor.removeDecorationsByType(a),100)}async updateInlineValueDecorations(R,P){var k;if(!P)return;const F="{0} = {1}",L=", ",B=P.monacoEditor.getModel();if(!this.preferenceService.get("debug.inline.values")||!B||!R||B.uri.toString()!==((k=R.source)===null||k===void 0?void 0:k.uri.toString())){this.removeInlineValuesScheduler(P).isScheduled()||this.removeInlineValuesScheduler(P).schedule();return}this.removeInlineValuesScheduler(P).cancel();let j;if(_.languageFeaturesService.inlineValuesProvider.has(B)){const W=async(H,K)=>{const Z=await R.getMostSpecificScopes(R.range()),X=K?H:H.toLowerCase();for(const ie of Z){await ie.ensureLoaded();const le=(ie.children||[]).find(pe=>K?pe.name===X:pe.name.toLowerCase()===X);if(le)return le.value}},U={frameId:R.raw.id,stoppedLocation:(()=>{const H=R.range();return new s.Range(H.startLineNumber,H.startColumn+1,H.endLineNumber,H.endColumn+1)})()},Q=new c.CancellationTokenSource().token,V=P.monacoEditor.getVisibleRanges(),$=_.languageFeaturesService.inlineValuesProvider.ordered(B).reverse();j=[];const Y=new Map,z=S($.map(H=>V.map(K=>Promise.resolve(H.provideInlineValues(B,K,U,Q)).then(async Z=>{if(Z)for(const X of Z){let ie;switch(X.type){case"text":ie=X.text;break;case"variable":{let oe=X.variableName;oe||(oe=B.getLineContent(X.range.startLineNumber).substring(X.range.startColumn-1,X.range.endColumn-1));const le=await W(oe,X.caseSensitiveLookup);le&&(ie=c.strings.format(F,oe,le));break}case"expression":{let oe=X.expression;if(oe||(oe=B.getLineContent(X.range.startLineNumber).substring(X.range.startColumn-1,X.range.endColumn-1)),oe){const le=new d.DebugWatchRoot(R.thread.session),pe=new d.DebugWatchNode(R.thread.session,oe,le);await pe.evaluate(oe),pe.available&&(ie=c.strings.format(F,oe,pe.description))}break}}if(ie){const oe=X.range.startLineNumber;let le=Y.get(oe);le||(le=[],Y.set(oe,le)),le.some(pe=>pe.text===ie)||le.push(new w(X.range.startColumn,ie))}}},Z=>{(0,c.onUnexpectedExternalError)(Z)}))));await Promise.all(z),Y.forEach((H,K)=>{if(H.length>0){H=H.sort((X,ie)=>X.column-ie.column);const Z=H.map(X=>X.text).join(L);j.push(T(K,Z))}})}else{const W=await R.getMostSpecificScopes(R.range());j=(await Promise.all(W.map(async Q=>{await Q.ensureLoaded();const V=Q.children||[],$=R.range(),Y=Q.range();let z=new s.Range(0,0,$.startLineNumber,$.startColumn);return Y&&(z=z.setStartPosition(Y.startLineNumber,Y.startColumn)),D(V,z,B,I(P?.monacoEditor.getModel()))}))).reduce((Q,V)=>Q.concat(V),[])}P.monacoEditor.setDecorationsByType("inline-value-decoration",a,j)}async toggleExceptionWidget(){var R,P;const k=this.debugSessionManager.currentSession;if(!k){this.closeExceptionWidget();return}const{currentThread:F}=k;if(!F){this.closeExceptionWidget();return}const L=F.frames.find(j=>!!(j&&j.source&&j.source.available&&j.source.presentationHint!=="deemphasize"));if(!L){this.closeExceptionWidget();return}const B=(R=this.editor.currentUri)===null||R===void 0?void 0:R.isEqual((P=L.source)===null||P===void 0?void 0:P.uri);if(this.debugExceptionWidget&&!B)this.closeExceptionWidget();else if(B){const j=await F?.fetchExceptionInfo();j&&this.showExceptionWidget(j,k,L.range().startLineNumber,L.range().startColumn)}}showExceptionWidget(R,P,k,F){this.debugExceptionWidget&&this.debugExceptionWidget.dispose();const L=P?.currentEditor();this.debugExceptionWidget=this.injector.get(h.DebugExceptionWidget,[L,R]),this.debugExceptionWidget.show(m.positionToRange({lineNumber:k,column:F}),10),this.debugExceptionWidget.focus(),L?.revealRangeInCenter({startLineNumber:k,startColumn:F,endLineNumber:k,endColumn:F}),this.debugContextKey.contextExceptionWidgetVisible.set(!0)}closeExceptionWidget(){this.debugExceptionWidget&&(this.debugContextKey.contextExceptionWidgetVisible.set(!1),this.debugExceptionWidget.dispose(),this.debugExceptionWidget=void 0)}};t.DebugEditorContribution=O,O.MEMOIZER=(0,c.createMemoizer)(),r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],O.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(c.IContextKeyService),r.__metadata("design:type",Object)],O.prototype,"contextKeyService",void 0),r.__decorate([(0,o.Autowired)(E.IDebugModelManager),r.__metadata("design:type",Object)],O.prototype,"debugModelManager",void 0),r.__decorate([(0,o.Autowired)(E.IDebugSessionManager),r.__metadata("design:type",u.DebugSessionManager)],O.prototype,"debugSessionManager",void 0),r.__decorate([(0,o.Autowired)(c.PreferenceService),r.__metadata("design:type",Object)],O.prototype,"preferenceService",void 0),r.__decorate([(0,o.Autowired)(c.MonacoOverrideServiceRegistry),r.__metadata("design:type",c.MonacoOverrideServiceRegistry)],O.prototype,"overrideServicesRegistry",void 0),r.__decorate([(0,o.Autowired)(p.WorkbenchEditorService),r.__metadata("design:type",v.WorkbenchEditorServiceImpl)],O.prototype,"editorService",void 0),r.__decorate([(0,o.Autowired)(l.DebugContextKey),r.__metadata("design:type",l.DebugContextKey)],O.prototype,"debugContextKey",void 0),t.DebugEditorContribution=O=n=r.__decorate([(0,o.Injectable)(),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[Object])],O)},74257:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugExpressionProvider=void 0;const n=e(85608),r=e(76003),o=e(43718),c=n.__importStar(e(20868)),p=e(39266),{coalesce:v}=o.arrays;let m=class{async get(s,g){var l,h;let u,d;if(this.evaluatableExpressionService.hasEvaluatableExpressProvider(s)){const E=new o.CancellationTokenSource,f=this.evaluatableExpressionService.getSupportedEvaluatableExpressionProvider(s),a=new c.Position(g.startLineNumber,g.startColumn),b=f.map(A=>Promise.resolve(A.provideEvaluatableExpression(s,a,E.token)).then(S=>S,()=>{})),y=await Promise.all(b).then(v);y.length>0&&(u=(l=y[0])===null||l===void 0?void 0:l.expression,d=(h=y[0])===null||h===void 0?void 0:h.range,!u&&d&&(u=s.getLineContent(a.lineNumber).substring(d.startColumn-1,d.endColumn-1)))}else{const E=s.getLineContent(g.startLineNumber),{start:f,end:a}=this.getExactExpressionStartAndEnd(E,g.startColumn,g.endColumn);u=E.substring(f-1,a)}return u}getExactExpressionStartAndEnd(s,g,l){let h,u=0;const d=/([^()[\]{}<>\s+\-/%~#^;=|,`!]|->)+/g;let E=null;for(;E=d.exec(s);){const f=E.index+1,a=f+E[0].length;if(f<=g&&a>=l){h=E[0],u=f;break}}if(h){const f=/\w+/g;let a=null;for(;(a=f.exec(h))&&!(a.index+1+u+a[0].length>=l););a&&(h=h.substring(0,f.lastIndex))}return h?{start:u,end:u+h.length-1}:{start:0,end:0}}};t.DebugExpressionProvider=m,n.__decorate([(0,r.Autowired)(p.IEvaluatableExpressionService),n.__metadata("design:type",Object)],m.prototype,"evaluatableExpressionService",void 0),t.DebugExpressionProvider=m=n.__decorate([(0,r.Injectable)()],m)},3367:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverModel=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(98650);let m=n=class extends c.TreeModel{constructor(s){super(),this.flushDispatchChangeDelayer=new p.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this.init(s)}init(s){this.root=s,this.root.watcher.on(c.TreeNodeEvent.BranchDidUpdate,()=>{this.flushDispatchChangeDelayer.isTriggered()||this.flushDispatchChangeDelayer.cancel(),this.flushDispatchChangeDelayer.trigger(async()=>{this.dispatchChange()})})}};t.DebugHoverModel=m,m.DEFAULT_FLUSH_DELAY=100,t.DebugHoverModel=m=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[v.ExpressionContainer])],m)},23217:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverSource=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(64582),p=e(38029),v=e(98650);let m=class{constructor(){this.onDidChangeEmitter=new o.Emitter,this.onDidChange=this.onDidChangeEmitter.event}dispose(){this._expression=void 0}get expression(){return this._expression}clearEvaluate(){this.onDidChangeEmitter.fire(void 0)}async evaluate(s){const g=await this.doEvaluate(s);return this._expression=g,this.onDidChangeEmitter.fire(g),g}async doEvaluate(s){const{currentSession:g}=this.sessions;if(g){if(g.capabilities.supportsEvaluateForHovers){const l=new v.DebugHoverVariableRoot(s,g);return await l.evaluate("hover"),l.available&&l||void 0}return this.findVariable(s.split(".").map(l=>l.trim()).filter(l=>!!l))}}async findVariable(s){const{currentFrame:g}=this.sessions;if(!g)return;let l;const h=await g.getScopes();for(const u of h){const d=await this.doFindVariable(u,s);if(!l)l=d;else if(d&&d.value!==l.value)return}return l}async doFindVariable(s,g){await s.ensureLoaded();const l=s.children,h=[];if(l){for(const u of l)(u instanceof v.DebugVariableContainer||u instanceof v.DebugVariable)&&u.name===g[0]&&h.push(u);if(h.length===1)return g.length===1?h[0]:this.doFindVariable(h[0],g.slice(1))}}};t.DebugHoverSource=m,n.__decorate([(0,r.Autowired)(c.IDebugSessionManager),n.__metadata("design:type",p.DebugSessionManager)],m.prototype,"sessions",void 0),t.DebugHoverSource=m=n.__decorate([(0,r.Injectable)()],m)},85322:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverTreeModelService=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(98650),m=r.__importDefault(e(57259)),_=e(3367),s=e(23217),{Path:g}=p.path;let l=n=class{constructor(){this._changeEventDispatchQueue=[],this.selectedDecoration=new c.Decoration(m.default.mod_selected),this.focusedDecoration=new c.Decoration(m.default.mod_focused),this.loadingDecoration=new c.Decoration(m.default.mod_loading),this._selectedNodes=[],this.onDidRefreshedEmitter=new p.Emitter,this.onDidUpdateTreeModelOrVariableEmitter=new p.Emitter,this.disposableCollection=new p.DisposableCollection,this.activeNodeDecoration=(u,d=!0)=>{if(this.preContextMenuFocusedNode&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedNode),this.selectedDecoration.removeTarget(this.preContextMenuFocusedNode),this.preContextMenuFocusedNode=null),u){if(this.selectedNodes.length>0)for(const E of this.selectedDecoration.appliedTargets.keys())this.selectedDecoration.removeTarget(E);this.focusedNode&&this.focusedDecoration.removeTarget(this.focusedNode),this.selectedDecoration.addTarget(u),this.focusedDecoration.addTarget(u),this._focusedNode=u,this._selectedNodes=[u],d&&this.treeModel.dispatchChange()}},this.activeNodeFocusedDecoration=(u,d=!1)=>{this.focusedNode!==u&&(d?(this.preContextMenuFocusedNode?(this.focusedDecoration.removeTarget(this.preContextMenuFocusedNode),this.selectedDecoration.removeTarget(this.preContextMenuFocusedNode)):this.focusedNode&&this.focusedDecoration.removeTarget(this.focusedNode),this.preContextMenuFocusedNode=u):this.focusedNode&&(this.preContextMenuFocusedNode=null,this.focusedDecoration.removeTarget(this.focusedNode)),u&&(this.selectedDecoration.addTarget(u),this.focusedDecoration.addTarget(u),this._focusedNode=u,this._selectedNodes.push(u))),this.treeModel.dispatchChange()},this.enactiveNodeDecoration=()=>{this.focusedNode&&(this.focusedDecoration.removeTarget(this.focusedNode),this.treeModel.dispatchChange()),this._focusedNode=void 0},this.handleTreeBlur=()=>{this.enactiveNodeDecoration()},this.handleTwistierClick=u=>{v.ExpressionContainer.is(u)?(this.activeNodeDecoration(u,!1),this.toggleDirectory(u)):this.activeNodeDecoration(u)},this.toggleDirectory=async u=>{u.expanded?this.treeHandle.collapseNode(u):this.treeHandle.expandNode(u)},this.flushEventQueue=()=>{let u;if(!this._changeEventDispatchQueue||this._changeEventDispatchQueue.length===0)return;this._changeEventDispatchQueue.sort((E,f)=>{const a=g.pathDepth(E),b=g.pathDepth(f);return a-b});const d=[this._changeEventDispatchQueue[0]];for(const E of this._changeEventDispatchQueue)d.some(f=>E.indexOf(f)===0)||d.push(E);return u=(0,p.pSeries)(d.map(E=>async()=>{var f;const a=(f=this.treeModel.root)===null||f===void 0?void 0:f.watchEvents.get(E);return a&&typeof a.callback=="function"&&await a.callback({type:c.WatchEvent.Changed,path:E}),null})),this._changeEventDispatchQueue=[],u},this.debugHoverSource.onDidChange(async u=>{if(!u){this.onDidUpdateTreeModelOrVariableEmitter.fire({treeModel:void 0,variable:void 0});return}u instanceof v.DebugVariable?(this.dispose(),this.onDidUpdateTreeModelOrVariableEmitter.fire({variable:u})):(await this.initTreeModel(u),this.onDidUpdateTreeModelOrVariableEmitter.fire({treeModel:this.treeModel}))})}get onDidRefreshed(){return this.onDidRefreshedEmitter.event}get onDidUpdateTreeModelOrVariable(){return this.onDidUpdateTreeModelOrVariableEmitter.event}get flushEventQueuePromise(){return this.flushEventQueueDeferred&&this.flushEventQueueDeferred.promise}get treeHandle(){return this._debugHoverTreeHandle}get decorations(){return this._decorations}get treeModel(){return this._treeModel}get whenReady(){return this._whenReady}get focusedNode(){return this._focusedNode}get selectedNodes(){return this._selectedNodes}dispose(){this.disposableCollection.disposed||this.disposableCollection.dispose()}listenTreeViewChange(){var u,d;this.dispose(),this.disposableCollection.push((u=this.treeModel)===null||u===void 0?void 0:u.root.watcher.on(c.TreeNodeEvent.WillResolveChildren,E=>{this.loadingDecoration.addTarget(E)})),this.disposableCollection.push((d=this.treeModel)===null||d===void 0?void 0:d.root.watcher.on(c.TreeNodeEvent.DidResolveChildren,E=>{this.loadingDecoration.removeTarget(E)}))}async initTreeModel(u){if(u)return this._treeModel=this.injector.get(_.DebugHoverModel,[u]),this.initDecorations(u),this.listenTreeViewChange(),this._treeModel}initDecorations(u){this._decorations=new c.DecorationsManager(u),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.loadingDecoration)}removeNodeDecoration(){this.decorations&&(this.decorations.removeDecoration(this.selectedDecoration),this.decorations.removeDecoration(this.focusedDecoration))}handleTreeHandler(u){this._debugHoverTreeHandle=u}async refresh(u=this.treeModel.root){!v.ExpressionContainer.is(u)&&u.parent&&(u=u.parent),this.queueChangeEvent(u.path,()=>{this.onDidRefreshedEmitter.fire()})}queueChangeEvent(u,d){this.flushEventQueueDeferred||(this.flushEventQueueDeferred=new p.Deferred,clearTimeout(this._eventFlushTimeout),this._eventFlushTimeout=setTimeout(async()=>{var E;await this.flushEventQueue(),(E=this.flushEventQueueDeferred)===null||E===void 0||E.resolve(),this.flushEventQueueDeferred=null,d()},n.DEFAULT_FLUSH_FILE_EVENT_DELAY)),this._changeEventDispatchQueue.indexOf(u)===-1&&this._changeEventDispatchQueue.push(u)}};t.DebugHoverTreeModelService=l,l.DEFAULT_FLUSH_FILE_EVENT_DELAY=100,r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],l.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(s.DebugHoverSource),r.__metadata("design:type",s.DebugHoverSource)],l.prototype,"debugHoverSource",void 0),t.DebugHoverTreeModelService=l=n=r.__decorate([(0,o.Injectable)(),r.__metadata("design:paramtypes",[])],l)},65960:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverWidget=void 0;const r=e(85608),o=r.__importDefault(e(12784)),c=r.__importDefault(e(14041)),p=r.__importDefault(e(25873)),v=e(76003),m=e(41869),_=r.__importStar(e(20868)),s=e(62663),g=e(64582),l=e(38029),h=e(74257),u=e(23217),d=e(63940);let E=n=class{constructor(){this.toDispose=new m.DisposableCollection,this.allowEditorOverflow=!0,this.doSchedule=(0,o.default)(a=>a(),300),this.init()}init(){this.toDispose.pushAll([m.Disposable.create(()=>this.editor.removeContentWidget(this)),m.Disposable.create(()=>this.hide()),this.sessions.onDidChange(()=>{this.isEditorFrame()||this.hide()})]),this.renderView()}handleWindowWheel(a){a.stopPropagation()}getId(){return n.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.classList.add(n.ID)),this.domNode}getPosition(){var a;const b=this.options&&this.options.selection.getStartPosition(),y=b&&((a=this.editor.getModel())===null||a===void 0?void 0:a.getWordAtPosition(b));return b&&y?{position:new _.Position(b.lineNumber,y.startColumn),preference:[s.monacoBrowser.editor.ContentWidgetPositionPreference.BELOW,s.monacoBrowser.editor.ContentWidgetPositionPreference.ABOVE]}:null}dispose(){this.toDispose.dispose()}show(a){this.schedule(()=>this.doShow(a),a&&a.immediate)}hide(a){this.schedule(()=>this.doHide(),a&&a.immediate)}schedule(a,b=!0){b?(this.doSchedule.cancel(),a()):this.doSchedule(a)}isEditorFrame(){const{currentFrame:a}=this.sessions;return!!a&&!!a.source&&!!this.editor.getModel()&&this.editor.getModel().uri.toString()===a.source.uri.toString()}doHide(){window.removeEventListener("mousewheel",this.handleWindowWheel,!0),this.getDomNode().contains(document.activeElement)&&this.editor.focus(),this.hoverSource.dispose(),this.hoverSource.clearEvaluate(),this.options=void 0,this.editor.removeContentWidget(this)}layoutContentWidget(){this.editor.layoutContentWidget(this)}renderView(){p.default.createRoot(this.getDomNode()).render(c.default.createElement(m.ConfigProvider,{value:this.configContext},c.default.createElement(d.DebugHoverView,null))),this.layoutContentWidget()}async doShow(a=this.options){if(!this.isEditorFrame()||!a||this.options&&this.options.selection.equalsRange(a.selection))return;this.options=a;const b=await this.expressionProvider.get(this.editor.getModel(),a.selection);b&&(this.hoverSource.clearEvaluate(),await this.hoverSource.evaluate(b)&&(this.reporterService.point(g.DEBUG_REPORT_NAME===null||g.DEBUG_REPORT_NAME===void 0?void 0:g.DEBUG_REPORT_NAME.DEBUG_VARIABLES,"hover",b),this.editor.addContentWidget(this),window.addEventListener("mousewheel",this.handleWindowWheel,!0)))}};t.DebugHoverWidget=E,E.ID="debug-hover-widget",r.__decorate([(0,v.Autowired)(g.DebugEditor),r.__metadata("design:type",Object)],E.prototype,"editor",void 0),r.__decorate([(0,v.Autowired)(g.IDebugSessionManager),r.__metadata("design:type",l.DebugSessionManager)],E.prototype,"sessions",void 0),r.__decorate([(0,v.Autowired)(h.DebugExpressionProvider),r.__metadata("design:type",h.DebugExpressionProvider)],E.prototype,"expressionProvider",void 0),r.__decorate([(0,v.Autowired)(u.DebugHoverSource),r.__metadata("design:type",u.DebugHoverSource)],E.prototype,"hoverSource",void 0),r.__decorate([(0,v.Autowired)(m.AppConfig),r.__metadata("design:type",Object)],E.prototype,"configContext",void 0),r.__decorate([(0,v.Autowired)(m.IReporterService),r.__metadata("design:type",Object)],E.prototype,"reporterService",void 0),t.DebugHoverWidget=E=n=r.__decorate([(0,v.Injectable)(),r.__metadata("design:paramtypes",[])],E)},63940:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=e(97267),p=e(41869),v=e(1149),m=e(28875),_=e(85322),s=n.__importDefault(e(94084)),g=()=>{const l=(0,p.useInjectable)(_.DebugHoverTreeModelService),h=(0,p.useInjectable)(v.LayoutViewSizeConfig),u=250,d=420,E=4,[f,a]=o.default.useState({}),[b,y]=o.default.useState(u),A=o.default.useRef(null);o.default.useEffect(()=>(l.onDidUpdateTreeModelOrVariable(async M=>{const{treeModel:R,variable:P}=M;R&&await R.ensureReady,a({treeModel:R,variable:P})}),S(),()=>{l.removeNodeDecoration()}),[]),o.default.useEffect(()=>{let M;return y(u),f.treeModel&&(M=f.treeModel.root.watcher.on(c.TreeNodeEvent.DidChangeExpansionState,()=>{var R,P;const k=Math.max(u,(((R=f.treeModel)===null||R===void 0?void 0:R.root.branchSize)||0)*22),F=(P=A.current)===null||P===void 0?void 0:P.getBoundingClientRect();if(F){const L=F.top,B=window.innerHeight-L-h.statusBarHeight-E;y(Math.min(B,k,d))}else y(Math.min(d,k))})),()=>{M?.dispose()}},[f.treeModel]);const S=async()=>{l.treeModel&&(await l.treeModel.ensureReady,a({treeModel:l.treeModel}))},w=M=>{l.handleTreeHandler({...M,getModel:()=>f?.treeModel,hasDirectFocus:()=>A.current===document.activeElement})},T=(M,R)=>{M.stopPropagation();const{handleTwistierClick:P}=l;R&&P(R)},D=!!f.treeModel&&!!f.treeModel.root.variablesReference,I=o.default.useCallback(M=>{const R=l.decorations.getDecorations(M.item);return o.default.createElement(m.DebugVariableRenderedNode,{item:M.item,itemType:M.itemType,decorations:R,onClick:T,onTwistierClick:T,defaultLeftPadding:0,leftPadding:4})},[f.treeModel]),O=()=>D?o.default.createElement("div",{className:s.default.debug_hover_content,tabIndex:-1,ref:A},o.default.createElement(c.RecycleTree,{height:b,itemHeight:m.DEBUG_VARIABLE_TREE_NODE_HEIGHT,onReady:w,model:f.treeModel,placeholder:()=>o.default.createElement("span",null),overflow:"auto"},I)):null;return o.default.createElement("div",{className:s.default.debug_hover},f.treeModel?o.default.createElement("div",{className:(0,r.default)(s.default.debug_hover_title,D&&s.default.has_complex_value),title:f.treeModel.root.name},f.treeModel.root.name):f.variable&&o.default.createElement("div",{className:(0,r.default)(s.default.debug_hover_title,D&&s.default.has_complex_value),title:f.variable.name},f.variable.value),O())};t.DebugHoverView=g},71569:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugModelManager=void 0;const n=e(85608),r=e(76003),o=e(43718),c=e(54414),p=e(64582),v=e(99797),m=e(37499);let _=class extends o.Disposable{constructor(){super(),this.toDispose=new o.DisposableCollection,this._onMouseDown=new o.Emitter,this._onMouseMove=new o.Emitter,this._onMouseLeave=new o.Emitter,this._onMouseUp=new o.Emitter,this.onMouseDown=this._onMouseDown,this.onMouseMove=this._onMouseMove,this.onMouseLeave=this._onMouseLeave,this.onMouseUp=this._onMouseUp,this._onModelChanged=new o.Emitter,this.onModelChanged=this._onModelChanged.event,this.models=new Map}dispose(){for(const g of this.models.values())this.toDispose.pushAll(g);this.toDispose.dispose(),this.models.clear()}init(){this.editorCollection.onCodeEditorCreate(g=>this.push(g)),this.breakpointManager.onDidChangeBreakpoints(g=>{const{currentEditor:l}=this.editorService,h=l&&l.currentUri;h&&this.render(h),this.closeBreakpointIfAffected(g)})}get model(){const{currentEditor:g}=this.editorService,l=g&&g.currentUri;if(l){const h=this.models.get(l.toString());return h&&h[0]}}closeBreakpointIfAffected({affected:g,removed:l}){g.forEach(h=>{const u=this.models.get(h.toString());if(u)for(const d of u){const E=d.getBreakpointWidget(),f=E.position;if(!f)return;for(const a of l)a.raw.line===f.lineNumber&&E.dispose()}})}render(g){const l=this.models.get(g.toString());if(l)for(const h of l)h.render()}push(g){const l=g.monacoEditor;g.onRefOpen(u=>{const d=u.instance.uri.toString(),E=this.models.get(d)||[];let f=!1;if(E.length>0){for(const a of E)if(a.getEditor()._id===l._id){a.render(),f=!0;break}}if(!f){const a=u.instance.getMonacoModel(),b=this.debugModelFactory(l);E.push(b),this.models.set(d,E),a.onWillDispose(()=>{b.dispose(),this.models.delete(d)})}});const h=(u,d)=>{const E=l.getModel();if(!E)throw new Error("Not find model");this.handleMouseEvent(new o.URI(E.uri.toString()),u,d,l)};this.toDispose.push(l.onMouseMove(u=>h(p.DebugModelSupportedEventType.move,u))),this.toDispose.push(l.onMouseDown(u=>h(p.DebugModelSupportedEventType.down,u))),this.toDispose.push(l.onMouseLeave(u=>h(p.DebugModelSupportedEventType.leave,u))),this.toDispose.push(l.onContextMenu(u=>h(p.DebugModelSupportedEventType.contextMenu,u))),this.toDispose.push(l.onDidChangeModel(u=>this._onModelChanged.fire(u)))}resolve(g){const l=this.models.get(g.toString());if(l)return l}handleMouseEvent(g,l,h,u){const d=this.models.get(g.toString());if(!(!d||!this.debugConfigurationManager.canSetBreakpointsIn(d[0].getEditor().getModel()))){for(const f of d)if(f.getEditor().getId()===u.getId()){switch(l){case p.DebugModelSupportedEventType.contextMenu:f.onContextMenu(h);break;case p.DebugModelSupportedEventType.down:f.onMouseDown(h);break;case p.DebugModelSupportedEventType.leave:f.onMouseLeave(h);break;case p.DebugModelSupportedEventType.move:f.onMouseMove(h);break;default:break}break}}}};t.DebugModelManager=_,n.__decorate([(0,r.Autowired)(c.WorkbenchEditorService),n.__metadata("design:type",c.WorkbenchEditorService)],_.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(c.EditorCollectionService),n.__metadata("design:type",c.EditorCollectionService)],_.prototype,"editorCollection",void 0),n.__decorate([(0,r.Autowired)(p.DebugModelFactory),n.__metadata("design:type",Function)],_.prototype,"debugModelFactory",void 0),n.__decorate([(0,r.Autowired)(v.BreakpointManager),n.__metadata("design:type",v.BreakpointManager)],_.prototype,"breakpointManager",void 0),n.__decorate([(0,r.Autowired)(m.DebugConfigurationManager),n.__metadata("design:type",m.DebugConfigurationManager)],_.prototype,"debugConfigurationManager",void 0),t.DebugModelManager=_=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],_)},91260:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugModel=void 0;const r=e(85608),o=r.__importDefault(e(12784)),c=e(76003),p=e(41869),v=e(93899),m=e(43718),_=r.__importStar(e(20868)),s=e(62663),g=e(52416),l=e(64582),h=e(24395),u=e(26296),d=e(99797),E=e(38949),f=e(38029),a=e(97319),b=e(17475),y=e(65960),A=r.__importStar(e(26571));let S=n=class{static createContainer(D,I){return D.createChild([{token:h.DebugEditor,useValue:I},{token:y.DebugHoverWidget,useClass:y.DebugHoverWidget},{token:b.DebugBreakpointWidget,useClass:b.DebugBreakpointWidget},{token:l.IDebugModel,useClass:n}])}static createModel(D,I){return n.createContainer(D,I).get(l.IDebugModel)}get uri(){return this._uri}constructor(){this.toDispose=new m.DisposableCollection,this.frameDecorations=[],this.updatingDecorations=!1,this.breakpointDecorations=[],this.breakpointRanges=new Map,this.currentBreakpointDecorations=[],this.candidateDecorations=[],this.renderFrames=(0,o.default)((D=[])=>{var I;if(this.toDispose.disposed||((I=this.editor.getModel())===null||I===void 0?void 0:I.uri.toString())!==this._uri.toString())return;const O=this.createFrameDecorations().concat(D);this.frameDecorations=this.deltaDecorations(this.frameDecorations,O)},100),this.toggleBreakpoint=(D=this.position)=>{this.doToggleBreakpoint(D)},this.openBreakpointView=(D,I,O)=>{this.breakpointWidget.show(D,I,O)},this.closeBreakpointView=()=>{this.breakpointWidget.hide()},this.acceptBreakpoint=()=>{const{position:D,values:I}=this.breakpointWidget;if(this.reporterService.point(l.DEBUG_REPORT_NAME===null||l.DEBUG_REPORT_NAME===void 0?void 0:l.DEBUG_REPORT_NAME.DEBUG_BREAKPOINT,this.breakpointWidget.breakpointType),D&&I){const O=this.getBreakpoint(D);O?(O.raw.condition=I.condition,O.raw.hitCondition=I.hitCondition,O.raw.logMessage=I.logMessage,this.breakpointManager.updateBreakpoint(O)):this.breakpointManager.addBreakpoint(d.DebugBreakpoint.create(this._uri,{line:D.lineNumber,...I})),this.breakpointWidget.hide()}},this.hintDecorations=[],this.init()}async init(){const D=this.editor.getModel();let I;this._uri=new m.URI(D.uri.toString()),this.decorator=new E.DebugDecorator,this.toDispose.pushAll([this.breakpointWidget,this.editor.onKeyDown(O=>{O.code==="Escape"&&!O.altKey&&!O.shiftKey&&!O.metaKey?this.debugHoverWidget.hide({immediate:!0}):this.debugHoverWidget.hide({immediate:!1})}),this.editor.onDidChangeModelContent(()=>this.renderFrames()),this.debugSessionManager.onDidChange(()=>this.renderFrames()),this.debugBreakpointsService.onDidFocusedBreakpoints(({range:O})=>{this.preferenceService.getValid("debug.breakpoint.editorHint",!0)&&(this.renderFrames([{options:A.FOCUS_BREAKPOINTS_STACK_FRAME_DECORATION,range:O}]),I&&clearTimeout(I),I=window.setTimeout(()=>{this.renderFrames(),clearTimeout(I)},300))}),this.editor.getModel().onDidChangeContent(()=>this.updateBreakpoints()),this.editor.onDidChangeModel(()=>{this.closeBreakpointView()})]),this.renderFrames(),this.render()}dispose(){this.toDispose.dispose()}get position(){return this._position||this.editor.getPosition()}get breakpoint(){return this.getBreakpoint()}getBreakpoint(D){return this.breakpointManager.getBreakpoint(this._uri,D?D.lineNumber:void 0)}createFrameDecorations(){var D;const I=[],{currentFrame:O,topFrame:M}=this.debugSessionManager;if(!O||!O.source||O.source.uri.toString()!==((D=this.editor.getModel())===null||D===void 0?void 0:D.uri.toString()))return I;const R=new _.Range(O.raw.line,O.raw.column,O.raw.line,1<<30),P=new _.Range(O.raw.line,O.raw.column,O.raw.line,O.raw.column+1);if(M===O)if(I.push({options:A.TOP_STACK_FRAME_MARGIN,range:P}),O.thread.stoppedDetails&&O.thread.stoppedDetails.reason==="exception")I.push({options:A.TOP_STACK_FRAME_EXCEPTION_DECORATION,range:R});else{I.push({options:A.TOP_STACK_FRAME_DECORATION,range:R});const{topFrameRange:k}=this;k&&k.startLineNumber===O.raw.line&&k.startColumn!==O.raw.column&&I.push({options:A.TOP_STACK_FRAME_INLINE_DECORATION,range:R}),this.topFrameRange=R}else I.push({options:A.FOCUSED_STACK_FRAME_MARGIN,range:P}),I.push({options:A.FOCUSED_STACK_FRAME_DECORATION,range:R});return I}deltaDecorations(D,I){this.updatingDecorations=!0;try{return this.editor.deltaDecorations(D,I)}finally{this.updatingDecorations=!1}}focusStackFrame(){this.renderFrames()}async render(){await this.renderBreakpoints(),this.renderFrames()}async renderBreakpoints(){await this.breakpointManager.whenReady,this.renderNormalBreakpoints(),this.renderCurrentBreakpoints()}renderNormalBreakpoints(){const D=this.createBreakpointDecorations();this.breakpointDecorations=this.deltaDecorations(this.breakpointDecorations,D),this.updateBreakpointRanges()}updateBreakpoints(){if(this.areBreakpointsAffected()){const D=this.createBreakpoints();this.breakpointManager.setBreakpoints(this._uri,D)}}areBreakpointsAffected(){if(this.updatingDecorations||!this.editor.getModel())return!1;for(const D of this.breakpointDecorations){const I=this.editor.getModel().getDecorationRange(D),O=this.breakpointRanges.get(D);if(!I||!I.equalsRange(O))return!0}return!1}createBreakpoints(){const{_uri:D}=this,I=new Set,O=[];for(const M of this.breakpointDecorations){const R=this.editor.getModel().getDecorationRange(M);if(R&&!I.has(R.startLineNumber)){const P=R.startLineNumber,k=this.breakpointRanges.get(M),F=k&&this.breakpointManager.getBreakpoint(D,k.startLineNumber)||{},L=d.DebugBreakpoint.create(D,{...F.raw||{},line:P},F.enabled);O.push(L),I.add(P)}}return O}createBreakpointDecorations(){return this.breakpointManager.getBreakpoints(this._uri).map(I=>this.createBreakpointDecoration(I))}createBreakpointDecoration(D){const I=D.raw.line,O=D.raw.column||0;return{range:new _.Range(I,O,I,O+1),options:{description:"breakpoint-decoration",stickiness:A.STICKINESS}}}async renderCurrentBreakpoints(){const D=this.breakpointManager.getBreakpoints(this._uri),I=this.createCurrentBreakpointDecorations(),O=this.deltaDecorations(this.currentBreakpointDecorations.map(({decorationId:P})=>P),I);this.currentBreakpointDecorations.forEach(P=>{P.inlineWidget&&P.inlineWidget.dispose()}),this.currentBreakpointDecorations=O.map((P,k)=>{const F=I[k],L=D[k],B=(L.enabled?A.BREAKPOINT_DECORATION:A.BREAKPOINT_DECORATION_DISABLED).glyphMarginClassName,j=F.options.beforeContentClassName?new w(this.editor,P,B,L,this.breakpointManager):void 0;return{breakpoint:L,decorationId:P,inlineWidget:j}});const M=await this.getCandidateBreakpoints(D),R=this.deltaDecorations(this.candidateDecorations.map(({decorationId:P})=>P),M);this.candidateDecorations.forEach(P=>{P.inlineWidget.dispose()}),this.candidateDecorations=R.map((P,k)=>{const{breakpoint:F}=M[k],L=(F?A.BREAKPOINT_DECORATION:A.BREAKPOINT_DECORATION_DISABLED).glyphMarginClassName,B=new w(this.editor,P,L,F,this.breakpointManager);return{decorationId:P,inlineWidget:B}})}async getCandidateBreakpoints(D){const I=this.editor.getModel(),O=this.debugSessionManager.currentSession;if(!I||!O?.capabilities.supportsBreakpointLocationsRequest)return[];const M=Array.from(new Set(D.map(P=>P.raw.line))),R=[];return await Promise.all(M.map(async P=>{const k=await O.breakpointLocations(this._uri,P);if(k.length<=1)return;const F=I.getLineCount();if(P>F)return;const L=I.getLineFirstNonWhitespaceColumn(P),B=I.getLineLastNonWhitespaceColumn(P);k.forEach(j=>{const W=new _.Range(j.lineNumber,j.column,j.lineNumber,j.column+1);if(j.column<=L||j.column>B)return;const U=this.currentBreakpointDecorations.find(({breakpoint:Q})=>Q.raw.line===W.startLineNumber&&Q.raw.column===W.startColumn);U?.inlineWidget||R.push({range:W,options:{description:"debug-breakpoint-placeholder",stickiness:_.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,beforeContentClassName:U?void 0:"debug-breakpoint-placeholder"},breakpoint:U?.breakpoint})})})),R}createCurrentBreakpointDecorations(){return this.breakpointManager.getBreakpoints(this._uri).filter(I=>(0,d.isDebugBreakpoint)(I)).map(I=>this.createCurrentBreakpointDecoration(I))}createCurrentBreakpointDecoration(D){const I=this.debugSessionManager.currentSession,O=D.status.get(I&&I.id||""),M=O&&O.line?O.line:D.raw.line,R=D.raw.column||0,P=this.editor.getModel(),k=P.getLineCount(),F=M>k?!1:R>P.getLineFirstNonWhitespaceColumn(M),L=new _.Range(M,R,M,R+1),{className:B,message:j}=this.decorator.getDecoration(D,!!I,this.breakpointManager.breakpointsEnabled),W=this.preferenceService.getValid("debug.breakpoint.showBreakpointsInOverviewRuler",!1);let U=null;return W&&(U={color:this.themeService.getColor({id:g.debugIconBreakpointForeground}),position:_.editor.OverviewRulerLane.Left}),{range:L,options:{description:"debug-breakpoint-placeholder",glyphMarginClassName:B,glyphMarginHoverMessage:j.map(Q=>({value:Q})),stickiness:A.STICKINESS,beforeContentClassName:F?"debug-breakpoint-placeholder":void 0,overviewRuler:U}}}updateBreakpointRanges(){this.breakpointRanges.clear();for(const D of this.breakpointDecorations){const I=this.editor.getModel().getDecorationRange(D);this.breakpointRanges.set(D,I)}}showHover(D){const I=D.target.type,O=m.isOSX?"metaKey":"ctrlKey";D.event.altKey||I===s.monacoBrowser.editor.MouseTargetType.CONTENT_WIDGET&&D.target.detail===this.debugHoverWidget.getId()&&!D.event[O]||(I===s.monacoBrowser.editor.MouseTargetType.CONTENT_TEXT?this.debugHoverWidget.show({selection:D.target.range,immediate:!1}):this.debugHoverWidget.hide({immediate:!1}))}hideHover({event:D}){const I=this.debugHoverWidget.getDomNode().getBoundingClientRect();(D.posx<I.left||D.posx>I.right||D.posy<I.top||D.posy>I.bottom)&&this.debugHoverWidget.hide({immediate:!1})}doToggleBreakpoint(D=this.position){const I=this.breakpointManager.getBreakpoints(this._uri,{lineNumber:D.lineNumber});if(I.length)for(const O of I)this.breakpointManager.delBreakpoint(O);else this.breakpointManager.addBreakpoint(d.DebugBreakpoint.create(this._uri,{line:D.lineNumber}))}get contributedContextMenu(){return this.menuService.createMenu(v.MenuId.DebugBreakpointsContext,this.contextKeyService)}onContextMenu(D){var I;if(this.marginFreeFromNonDebugDecorations((I=D.target.position)===null||I===void 0?void 0:I.lineNumber)&&D.target&&D.target.type===s.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const O=this.breakpointManager.getBreakpoint(this._uri,D.target.position.lineNumber);this.breakpointManager.selectedBreakpoint={breakpoint:O,model:this};const M=this.contributedContextMenu,R=(0,v.generateMergedCtxMenu)({menus:M});this.ctxMenuRenderer.show({anchor:D.event.browserEvent,menuNodes:R,args:[D.target.position]})}}marginFreeFromNonDebugDecorations(D){const I=this.editor.getLineDecorations(D);if(Array.isArray(I))for(const{options:O}of I){const M=O.glyphMarginClassName;if(M&&(M.includes("testing-run-glyph")||M.includes("interface-navigation-glyph")))return!1}return!0}onMouseDown(D){var I;this.marginFreeFromNonDebugDecorations((I=D.target.position)===null||I===void 0?void 0:I.lineNumber)&&(D.target&&D.target.type===s.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN&&(D.event.rightButton||(this.editor.focus(),this.toggleBreakpoint(D.target.position))),this.hintBreakpoint(D))}onMouseMove(D){var I;if(!this.marginFreeFromNonDebugDecorations((I=D.target.position)===null||I===void 0?void 0:I.lineNumber)){this.onMouseLeave(D);return}this.showHover(D),this.hintBreakpoint(D)}onMouseLeave(D){this.hideHover(D),this.deltaHintDecorations([])}hintBreakpoint(D){const I=this.createHintDecorations(D);this.deltaHintDecorations(I)}deltaHintDecorations(D){this.hintDecorations=this.deltaDecorations(this.hintDecorations,D)}createHintDecorations(D){if(D.target&&D.target.type===s.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN||D.target.type===s.monacoBrowser.editor.MouseTargetType.GUTTER_LINE_NUMBERS){const I=D.target.position.lineNumber;return this.breakpointManager.getBreakpoint(this._uri,I)?[]:[{range:new _.Range(I,1,I,1),options:A.BREAKPOINT_HINT_DECORATION}]}return[]}getBreakpoints(D,I){return this.breakpointManager.getBreakpoints(D,I)}getEditor(){return this.editor}getBreakpointWidget(){return this.breakpointWidget}getDebugHoverWidget(){return this.debugHoverWidget}};t.DebugModel=S,r.__decorate([(0,c.Autowired)(h.DebugEditor),r.__metadata("design:type",Object)],S.prototype,"editor",void 0),r.__decorate([(0,c.Autowired)(b.DebugBreakpointWidget),r.__metadata("design:type",b.DebugBreakpointWidget)],S.prototype,"breakpointWidget",void 0),r.__decorate([(0,c.Autowired)(y.DebugHoverWidget),r.__metadata("design:type",y.DebugHoverWidget)],S.prototype,"debugHoverWidget",void 0),r.__decorate([(0,c.Autowired)(u.IDebugSessionManager),r.__metadata("design:type",f.DebugSessionManager)],S.prototype,"debugSessionManager",void 0),r.__decorate([(0,c.Autowired)(a.DebugBreakpointsService),r.__metadata("design:type",a.DebugBreakpointsService)],S.prototype,"debugBreakpointsService",void 0),r.__decorate([(0,c.Autowired)(d.BreakpointManager),r.__metadata("design:type",d.BreakpointManager)],S.prototype,"breakpointManager",void 0),r.__decorate([(0,c.Autowired)(v.AbstractMenuService),r.__metadata("design:type",v.AbstractMenuService)],S.prototype,"menuService",void 0),r.__decorate([(0,c.Autowired)(p.IContextKeyService),r.__metadata("design:type",Object)],S.prototype,"contextKeyService",void 0),r.__decorate([(0,c.Autowired)(v.ICtxMenuRenderer),r.__metadata("design:type",v.ICtxMenuRenderer)],S.prototype,"ctxMenuRenderer",void 0),r.__decorate([(0,c.Autowired)(p.IReporterService),r.__metadata("design:type",Object)],S.prototype,"reporterService",void 0),r.__decorate([(0,c.Autowired)(p.PreferenceService),r.__metadata("design:type",Object)],S.prototype,"preferenceService",void 0),r.__decorate([(0,c.Autowired)(g.IThemeService),r.__metadata("design:type",Object)],S.prototype,"themeService",void 0),r.__decorate([m.memoize,r.__metadata("design:type",Object),r.__metadata("design:paramtypes",[])],S.prototype,"contributedContextMenu",null),t.DebugModel=S=n=r.__decorate([(0,c.Injectable)(),r.__metadata("design:paramtypes",[])],S);class w extends m.Disposable{constructor(D,I,O,M,R){super(),this.editor=D,this.decorationId=I,this.breakpoint=M,this.breakpointManager=R,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.range=this.editor.getModel().getDecorationRange(I),this.addDispose(this.editor.onDidChangeModelDecorations(()=>{const k=this.editor.getModel().getDecorationRange(this.decorationId);this.range&&!this.range.equalsRange(k)&&(this.range=k,this.editor.layoutContentWidget(this))})),this.addDispose(m.Disposable.create(()=>{this.editor.removeContentWidget(this)})),this.create(O),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(D){const I=document.createElement("div");I.className="inline-breakpoint-widget",D&&(0,p.addClassName)(I,D),this.domNode=I;const{EditorOption:O}=_.editor,M=()=>{const R=this.editor.getOption(O.lineHeight);I.style.height=`${R}px`,I.style.width=`${Math.ceil(.8*R)}px`,I.style.marginLeft="4px"};M(),this.addDispose(new p.DomListener(I,"click",async()=>{this.breakpoint?this.breakpointManager.delBreakpoint(this.breakpoint):this.breakpointManager.addBreakpoint(d.DebugBreakpoint.create(this.editor.getModel().uri,{line:this.range.startLineNumber,column:this.range.startColumn}))})),this.addDispose(this.editor.onDidChangeConfiguration(R=>{(R.hasChanged(O.fontSize)||R.hasChanged(O.lineHeight))&&M()}))}getId(){return(0,m.uuid)()}getDomNode(){return this.domNode}getPosition(){return this.range?(this.domNode.classList.toggle("line-start",this.range.startColumn===1),{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn-1},preference:[s.monacoBrowser.editor.ContentWidgetPositionPreference.EXACT]}):null}}r.__decorate([m.memoize,r.__metadata("design:type",Function),r.__metadata("design:paramtypes",[]),r.__metadata("design:returntype",void 0)],w.prototype,"getId",null)},78606:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugRunToCursorService=void 0;const n=e(85608),r=e(76003),o=e(54414),c=e(26296),p=e(66089),v=e(38029),m=e(97319);let _=class{constructor(){}async run(g,l=!1){const h=this.sessionManager.currentSession;if(!h||h.state!==c.DebugState.Stopped)return;const u=this.workbenchEditorService.currentEditor;if(u){if(!u.monacoEditor)return}else return;const{monacoEditor:d}=u,E=d.getPosition();if(!(d.hasModel()&&E))return;const f=h.getModel();if(!f)return;const a=!!f.getBreakpoints(g,{column:E.column,lineNumber:E.lineNumber}).length;let b,y=h.currentThread,A=[];if(!a){l&&(A=f.getBreakpoints().filter(T=>T.enabled).filter(T=>T.raw.column!==E.column&&T.raw.line!==E.lineNumber),A.forEach(T=>{this.debugBreakpointsService.toggleBreakpointEnable(T)}));const w=await this.addBreakpoints(g,E);if(!w){this.recoverStatus(A);return}w.thread&&(y=w.thread),w.breakpoint&&(b=w.breakpoint)}if(!y){this.recoverStatus(A);return}const S=y.session.onDidChangeState(()=>{const w=h.state;(w===c.DebugState.Stopped||w===c.DebugState.Inactive)&&(b&&h.delBreakpoint(b),S.dispose())});await y.continue(),this.recoverStatus(A)}async addBreakpoints(g,l){const h=this.sessionManager.currentSession;if(!h)return;let u=1;const d=h.currentFrame;d&&d.range().startLineNumber===l.lineNumber&&(u=l.column||1);const E=p.DebugBreakpoint.create(g,{line:l.lineNumber,column:u});if(await h.addBreakpoint(E,!0),!E)return{breakpoint:void 0,thread:h.currentThread};let f=h.currentThread,a=0;const b=h.threads.filter(y=>y.stopped);if(a<3&&h.currentThread&&b.includes(h.currentThread)&&(f=h.currentThread,a=3),a<2){const y=b.find(A=>A.topFrame);y&&(f=y,a=2)}return a<1&&(f=b[0],a=2),{thread:f,breakpoint:E}}recoverStatus(g){g.forEach(l=>{this.debugBreakpointsService.toggleBreakpointEnable(l)})}};t.DebugRunToCursorService=_,n.__decorate([(0,r.Autowired)(c.IDebugSessionManager),n.__metadata("design:type",v.DebugSessionManager)],_.prototype,"sessionManager",void 0),n.__decorate([(0,r.Autowired)(o.WorkbenchEditorService),n.__metadata("design:type",o.WorkbenchEditorService)],_.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(m.DebugBreakpointsService),n.__metadata("design:type",m.DebugBreakpointsService)],_.prototype,"debugBreakpointsService",void 0),t.DebugRunToCursorService=_=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],_)},26571:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BREAKPOINT_DECORATION_DISABLED=t.BREAKPOINT_DECORATION=t.BREAKPOINT_HINT_DECORATION=t.TOP_STACK_FRAME_INLINE_DECORATION=t.FOCUSED_STACK_FRAME_DECORATION=t.TOP_STACK_FRAME_EXCEPTION_DECORATION=t.FOCUS_BREAKPOINTS_STACK_FRAME_DECORATION=t.TOP_STACK_FRAME_DECORATION=t.FOCUSED_STACK_FRAME_MARGIN=t.TOP_STACK_FRAME_MARGIN=t.BREAK_PONINT_HOVER_MARGIN=t.STICKINESS=void 0;const r=e(85608).__importStar(e(20868));t.STICKINESS=r.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,t.BREAK_PONINT_HOVER_MARGIN={description:"debug-hover",glyphMarginClassName:"sumi-debug-hover",linesDecorationsClassName:"sumi-debug-hover",isWholeLine:!0},t.TOP_STACK_FRAME_MARGIN={description:"debug-top-stack-frame",glyphMarginClassName:"sumi-debug-top-stack-frame",stickiness:t.STICKINESS},t.FOCUSED_STACK_FRAME_MARGIN={description:"debug-focused-stack-frame",glyphMarginClassName:"sumi-debug-focused-stack-frame",stickiness:t.STICKINESS},t.TOP_STACK_FRAME_DECORATION={description:"debug-top-stack-frame-line",isWholeLine:!0,className:"sumi-debug-top-stack-frame-line",stickiness:t.STICKINESS},t.FOCUS_BREAKPOINTS_STACK_FRAME_DECORATION={description:"focus-breakpoints-stack-frame-line",isWholeLine:!0,className:"sumi-focus-breakpoints-stack-frame-line",stickiness:t.STICKINESS},t.TOP_STACK_FRAME_EXCEPTION_DECORATION={description:"debug-top-stack-frame-exception-line",isWholeLine:!0,className:"sumi-debug-top-stack-frame-exception-line",stickiness:t.STICKINESS},t.FOCUSED_STACK_FRAME_DECORATION={description:"debug-focused-stack-frame-line",isWholeLine:!0,className:"sumi-debug-focused-stack-frame-line",stickiness:t.STICKINESS},t.TOP_STACK_FRAME_INLINE_DECORATION={description:"debug-top-stack-frame-column",beforeContentClassName:"sumi-debug-top-stack-frame-column"},t.BREAKPOINT_HINT_DECORATION={description:"debug-breakpoint-hint",glyphMarginClassName:"sumi-debug-breakpoint-hint",stickiness:t.STICKINESS},t.BREAKPOINT_DECORATION={description:"debug-breakpoint",glyphMarginClassName:"sumi-debug-breakpoint",stickiness:t.STICKINESS},t.BREAKPOINT_DECORATION_DISABLED={description:"debug-breakpoint-disabled",glyphMarginClassName:"sumi-debug-breakpoint-disabled",stickiness:t.STICKINESS}},39266:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EvaluatableExpressionServiceImpl=t.IEvaluatableExpressionService=void 0;const n=e(85608),r=e(76003),o=e(40497),c=new o.LanguageFeatureRegistry;t.IEvaluatableExpressionService=Symbol("IEvaluatableExpressionService");let p=class{getSupportedEvaluatableExpressionProvider(m){return c.ordered(m)}registerEvaluatableExpressionProvider(m,_){return c.register(m,_)}hasEvaluatableExpressProvider(m){return c.has(m)}};t.EvaluatableExpressionServiceImpl=p,t.EvaluatableExpressionServiceImpl=p=n.__decorate([(0,r.Injectable)()],p)},75935:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(17475),t),n.__exportStar(e(65960),t),n.__exportStar(e(91260),t),n.__exportStar(e(71569),t),n.__exportStar(e(26571),t),n.__exportStar(e(74257),t)},33969:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugModule=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(91825),p=e(64582),v=e(99797),m=e(3005),_=e(37499),s=e(59053),g=e(31141),l=e(40453),h=e(90408),u=e(97186),d=e(38029),E=e(75935),f=e(23217),a=e(39266),b=e(23434),y=e(52369),A=e(44888),S=e(84784),w=e(15153),T=e(11456),D=e(37243),I=e(86752),O=e(14600);e(51377);let M=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:f.DebugHoverSource,useClass:f.DebugHoverSource},{token:E.DebugExpressionProvider,useClass:E.DebugExpressionProvider},{token:p.IDebugModelManager,useClass:E.DebugModelManager},{token:p.IDebugSessionManager,useClass:d.DebugSessionManager},{token:v.BreakpointManager,useClass:v.BreakpointManager},{token:_.DebugConfigurationManager,useClass:_.DebugConfigurationManager},{token:a.IEvaluatableExpressionService,useClass:a.EvaluatableExpressionServiceImpl},{token:c.FolderFilePreferenceProvider,useClass:b.LaunchFolderPreferenceProvider,dropdownForTag:!0,tag:"launch"},{token:p.DebugModelFactory,useFactory:P=>k=>E.DebugModel.createModel(P,k)},{token:u.DebugSessionContributionRegistry,useClass:u.DebugSessionContributionRegistryImpl},{token:p.IDebugService,useClass:h.DebugService},{token:p.ILaunchService,useClass:A.LaunchService},{token:p.IDebugProgress,useClass:l.DebugProgressService},{token:p.IDebugConsoleModelService,useClass:w.DebugConsoleModelService},y.LaunchPreferencesContribution,s.DebugContribution,T.DebugConsoleContribution,I.VariablesPanelContribution,D.DebugCallStackContribution,O.WatchPanelContribution,{token:m.DebugCallStackItemTypeKey,useFactory:P=>P.get(o.IContextKeyService).createKey("callStackItemType")}],this.contributionProvider=u.DebugSessionContribution,this.preferences=g.injectDebugPreferences,this.isOverlay=!0,this.component=S.DebugToolbarOverlayWidget}};t.DebugModule=M,t.DebugModule=M=n.__decorate([(0,r.Injectable)()],M)},39553:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(35721),t),n.__exportStar(e(20391),t)},35721:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MarkerManager=t.MarkerCollection=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(14951);class p{constructor(_,s){this.uri=_,this.kind=s,this.owner2Markers=new Map}get empty(){return!this.owner2Markers.size}getOwners(){return Array.from(this.owner2Markers.keys())}getMarkers(_){return this.owner2Markers.get(_)||[]}setMarkers(_,s){const g=this.owner2Markers.get(_);return s.length>0?this.owner2Markers.set(_,s.map(l=>this.createMarker(_,l))):this.owner2Markers.delete(_),g||[]}createMarker(_,s){return Object.freeze({uri:this.uri.toString(),kind:this.kind,owner:_,data:s})}findMarkers(_){if(_.owner)return this.owner2Markers.has(_.owner)?this.filterMarkers(_,this.owner2Markers.get(_.owner)):[];{const s=[];for(const g of this.owner2Markers.values())s.push(...this.filterMarkers(_,g));return s}}filterMarkers(_,s){return s?_.dataFilter?s.filter(g=>_.dataFilter(g.data)):s:[]}}t.MarkerCollection=p;let v=class{constructor(){this.uri2MarkerCollection=new Map,this.onDidChangeMarkersEmitter=new o.Emitter,this.init()}init(){this.fileService.onFilesChanged(_=>{const s=_.filter(({type:g})=>g===c.FileChangeType.DELETED);s.length&&this.cleanMarkers(s)})}cleanMarkers(_){for(const s of this.uri2MarkerCollection.keys()){const g=new o.URI(s);c.FileChangeEvent.isDeleted(_,g)&&this.cleanAllMarkers(g)}}get onDidChangeMarkers(){return this.onDidChangeMarkersEmitter.event}fireOnDidChangeMarkers(_){this.onDidChangeMarkersEmitter.fire(_)}setMarkers(_,s,g){const l=_.toString(),h=this.uri2MarkerCollection.get(l)||new p(_,this.getKind()),u=h.setMarkers(s,g);return h.empty?this.uri2MarkerCollection.delete(_.toString()):this.uri2MarkerCollection.set(l,h),this.fireOnDidChangeMarkers(_),u}findMarkers(_={}){if(_.uri){const g=this.uri2MarkerCollection.get(_.uri.toString());return g?g.findMarkers(_):[]}const s=[];for(const g of this.getUris())s.push(...this.uri2MarkerCollection.get(g).findMarkers(_));return s}getUris(){return this.uri2MarkerCollection.keys()}cleanAllMarkers(_){if(_)this.doCleanAllMarkers(_);else for(const s of this.getUris())this.doCleanAllMarkers(new o.URI(s))}doCleanAllMarkers(_){const s=_.toString();this.uri2MarkerCollection.get(s)!==void 0&&(this.uri2MarkerCollection.delete(s),this.fireOnDidChangeMarkers(_))}};t.MarkerManager=v,n.__decorate([(0,r.Autowired)(c.IFileServiceClient),n.__metadata("design:type",Object)],v.prototype,"fileService",void 0),t.MarkerManager=v=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],v)},20391:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},88776:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSource=t.DebugSourceData=void 0;const n=e(41869);class r{}t.DebugSourceData=r;class o extends r{constructor(p,v,m,_,s){super(),this.session=p,this.labelProvider=v,this.modelManager=m,this.workbenchEditorService=_,this.fileSystem=s}get uri(){return o.toUri(this.raw)}get available(){return!!this.raw}get presentationHint(){return this.raw.presentationHint}update(p){Object.assign(this,p)}async open(p,v){if(this.uri.scheme===o.SCHEME){const m=await this.load();await this.fileSystem.setContent({uri:this.uri.toString(),lastModification:0},m)}if(v&&v.raw){const{line:m,column:_}=v.raw,s={startLineNumber:m,startColumn:typeof _=="number"?_:0,endLineNumber:m,endColumn:1/0};await this.workbenchEditorService.open(this.uri,{...p,range:s}),v.thread.currentFrame=v;const g=this.modelManager.resolve(this.uri);if(g)for(const l of g)l.focusStackFrame()}else await this.workbenchEditorService.open(this.uri,p)}async load(){const p=this.raw,v=p.sourceReference;return(await this.session.sendRequest("source",{sourceReference:v,source:p})).body.content}get inMemory(){return this.uri.scheme===o.SCHEME}get reference(){return this.raw.sourceReference}get name(){return this.inMemory?this.raw.name||this.uri.path.base||this.uri.path.toString():this.labelProvider.getName(this.uri)}get longName(){return this.inMemory?this.name:this.labelProvider.getLongName(this.uri)}static toUri(p){if(p.sourceReference&&p.sourceReference>0)return new n.URI().withScheme(o.SCHEME).withPath(p.name).withQuery(String(p.sourceReference));if(!p.path)throw new Error("Unrecognized source type: "+JSON.stringify(p));return p.path.match(o.SCHEME_PATTERN)?new n.URI(p.path):new n.URI(n.Uri.file(p.path))}}t.DebugSource=o,o.SCHEME="debug",o.SCHEME_PATTERN=/^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/},44485:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShowMoreDebugStackFrame=t.DebugStackFrame=t.DebugStackFrameData=void 0;const n=e(41869),r=e(44781),o=e(98650);class c{}t.DebugStackFrameData=c;class p extends c{static is(_){return!!_&&"raw"in _}constructor(_,s){super(),this.thread=_,this.session=s}get id(){return this.session.id+":"+this.thread.id+":"+this.raw.id}get source(){return this._source}update(_){Object.assign(this,_),this._source=this.raw.source&&this.session.getSource(this.raw.source)}async restart(){return this.session.capabilities.supportsRestartFrame?await this.session.sendRequest("restartFrame",{frameId:this.raw.id}):Promise.reject(new Error("restartFrame not supported"))}get canRestart(){return typeof this.raw.canRestart=="boolean"?this.raw.canRestart:!0}async open(_){if(!this.source)return;const{line:s,column:g,endLine:l,endColumn:h}=this.raw;let u={startLineNumber:s,startColumn:g,endLineNumber:s,endColumn:1/0};typeof l=="number"&&(u={...u,endLineNumber:l,endColumn:typeof h=="number"?h:1/0}),this.source.open({..._,range:u})}toArgs(_){return Object.assign({},_,{frameId:this.raw.id})}getScopes(_){return this.doGetScopes(_)}async doGetScopes(_){try{return(await this.session.sendRequest("scopes",this.toArgs())).body.scopes.map(g=>new o.DebugScope(g,this.session,_))}catch{return[]}}range(){const _=this.raw;return new r.Range(_.line,_.column,_.endLine||_.line,_.endColumn||_.column)}async getMostSpecificScopes(_){const g=(await this.doGetScopes()).filter(u=>!u.getRawScope().expensive);if(!g.some(u=>!!u.range()))return g;const h=g.filter(u=>u.range()&&r.Range.containsRange(u.range(),_)).sort((u,d)=>u.range().endLineNumber-u.range().startLineNumber-(d.range().endLineNumber-d.range().startLineNumber));return h.length?h:g}}t.DebugStackFrame=p;class v{constructor(_,s,g,l,h){this.nextFrame=_,this.frames=s,this.session=g,this.origin=l,this._open=h,this.open=()=>{this._open(this)}}get name(){return(0,n.formatLocalize)("debug.stack.showMoreAndOrigin",this.frames.length,this.origin)}get id(){var _;return`${this.session.id}:showMore:${(_=this.nextFrame)===null||_===void 0?void 0:_.id}`}}t.ShowMoreDebugStackFrame=v},7885:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugThread=t.DebugThreadData=void 0;const n=e(41869),r=e(64582),o=e(44485);class c{}t.DebugThreadData=c;class p extends c{constructor(m){super(),this.session=m,this._onDidChanged=new n.Emitter,this.onDidChanged=this._onDidChanged.event,this._frames=new Map,this.pendingFetch=Promise.resolve([])}get id(){return this.session.id+":"+this.raw.id}get threadId(){return this.raw.id}get currentFrame(){return this._currentFrame}set currentFrame(m){this._currentFrame=m,this._onDidChanged.fire()}get stopped(){return!!this.stoppedDetails}update(m){Object.assign(this,m),"stoppedDetails"in m&&this.clearFrames()}clear(){this.update({raw:this.raw,stoppedDetails:void 0})}continue(){return this.session.sendRequest("continue",this.toArgs())}stepOver(){return this.session.sendRequest("next",this.toArgs())}stepIn(){return this.session.sendRequest("stepIn",this.toArgs())}stepOut(){return this.session.sendRequest("stepOut",this.toArgs())}pause(){return this.session.sendRequest("pause",this.toArgs())}terminate(){return this.session.sendRequest("terminateThreads",{threadIds:[this.raw.id]})}get frames(){return Array.from(this._frames.values())}get topFrame(){return this.frames[0]}get frameCount(){return this._frames.size}async rawFetchFrames(m=20){return this.pendingFetch=this.pendingFetch.then(async()=>{try{const _=this.frameCount,s=await this.doFetchFrames(_,m);return this.doUpdateFrames(s)}catch{return[]}})}async fetchExceptionInfo(){var m;try{if(((m=this.stoppedDetails)===null||m===void 0?void 0:m.reason)==="exception"&&this.session.capabilities.supportsExceptionInfoRequest){const _=await this.session.exceptionInfo(this.toArgs());if(_)return{id:_.body.exceptionId,description:_.body.description,breakMode:_.body.breakMode,details:_.body.details}}}catch{return}}async fetchFrames(m=20){const _=await this.rawFetchFrames(m);return this.updateCurrentFrame(),_}async doFetchFrames(m,_){try{const s=await this.session.sendRequest("stackTrace",this.toArgs({startFrame:m,levels:_}));return this.stoppedDetails&&(this.stoppedDetails.totalFrames=s.body.totalFrames),s.body.stackFrames}catch(s){return this.stoppedDetails&&(this.stoppedDetails.framesErrorMessage=s.message),[]}}doUpdateFrames(m){const _=this.session.reportTime(r.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME,{sessionId:this.session.id,threadId:this.raw.id,threadAmount:this.session.threadCount}),s=new Map(this._frames);for(const l of m){const h=l.id;if(!this._frames.has(h)){const u=new o.DebugStackFrame(this,this.session);this._frames.set(h,u),u.update({raw:l}),s.set(h,u)}}const g=[...s.values()];return _("doUpdateFrames"),g}clearFrames(){this._frames.clear(),this.updateCurrentFrame()}updateCurrentFrame(){const{currentFrame:m}=this,_=m&&m.raw.id;this.currentFrame=typeof _=="number"&&this._frames.get(_)||this._frames.values().next().value}toArgs(m){return Object.assign({},m,{threadId:this.raw.id})}}t.DebugThread=p},14190:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugWatch=t.IDebugWatchData=void 0;const r=e(85608).__importDefault(e(97331)),o=e(41869),c=e(64582),p=e(98650);t.IDebugWatchData=Symbol("IDebugWatchData");class v{constructor(_,s){this.manager=_,this.reporterService=s,this.toDispose=new o.DisposableCollection,this.fireDidChange=(0,r.default)(()=>this.onDidChangeEmitter.fire(),50),this.fireVariableChange=(0,r.default)(()=>this.onDidVariableChangeEmitter.fire(),50),this.fireExpressionChange=(0,r.default)(g=>this.onDidExExpressionChangeEmitter.fire(g),50),this._expressions=[],this.onDidChangeEmitter=new o.Emitter,this.onDidVariableChangeEmitter=new o.Emitter,this.onDidExExpressionChangeEmitter=new o.Emitter,this.whenReady=this.init()}get onDidChange(){return this.onDidChangeEmitter.event}get onDidVariableChange(){return this.onDidVariableChangeEmitter.event}get onDidExpressionChange(){return this.onDidExExpressionChangeEmitter.event}async getRoot(){const _=[],s=new p.DebugWatchRoot(this.manager.currentSession);for(const g of this._expressions){const l=new p.DebugWatchNode(this.manager.currentSession,g,s);await l.evaluate(),_.push(l)}return s.updatePresetChildren(_),this._root=s,this._root}async init(){this.toDispose.push(this.manager.onDidStopDebugSession(()=>{this.fireDidChange()})),this.toDispose.push(this.manager.onDidDestroyDebugSession(()=>{this.fireDidChange()})),this.toDispose.push(this.manager.onDidChangeActiveDebugSession(()=>{const _=this.manager.currentSession;_&&(_.onVariableChange(()=>{this.fireVariableChange()}),_.onDidChangeCallStack(()=>{this.fireVariableChange()}))}))}async clear(){this.updateWatchExpressions([]),this.fireExpressionChange([]),this.fireDidChange()}async updateWatchExpressions(_){this._expressions=_}addWatchExpression(_){this.reporterService.point(c.DEBUG_REPORT_NAME===null||c.DEBUG_REPORT_NAME===void 0?void 0:c.DEBUG_REPORT_NAME.DEBUG_WATCH,c.DEBUG_COMMANDS.ADD_WATCHER.id,{value:_}),this._expressions.indexOf(_)===-1&&(this._expressions.push(_),this.fireExpressionChange(this._expressions))}renameWatchExpression(_,s){const g=this._expressions.indexOf(_);g>=0&&this._expressions.splice(g,1,s),this.fireExpressionChange(this._expressions)}removeWatchExpression(_){const s=this._expressions.indexOf(_);s>=0&&this._expressions.splice(s,1),this.fireExpressionChange(this._expressions)}}t.DebugWatch=v},50755:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(88776),t),n.__exportStar(e(44485),t),n.__exportStar(e(7885),t),n.__exportStar(e(14190),t)},53741:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CheckboxWidget=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(14041)),c=e(97267),p=n.__importDefault(e(93089)),v=m=>{var _,s;const{disabled:g,formContext:l,id:h,label:u,hideLabel:d,onBlur:E,onChange:f,onFocus:a,readonly:b,value:y,registry:A,options:S,schema:w,uiSchema:T}=m,{readonlyAsDisabled:D=!0}=l,I=(0,r.getTemplate)("DescriptionFieldTemplate",A,S),O=({target:F})=>f(F.checked),P={onBlur:b?void 0:({target:F})=>E(h,F.checked),onFocus:b?void 0:({target:F})=>a(h,F.checked)},k=(s=(_=S.description)!==null&&_!==void 0?_:w.description)!==null&&s!==void 0?s:w.markdownDescription;return o.default.createElement("div",{className:p.default.checkbox_widget_control},!d&&o.default.createElement("label",{title:u,className:p.default.field_label},u),o.default.createElement(c.CheckBox,{checked:typeof y>"u"?!1:y,disabled:g||D&&b,id:h,name:h,onChange:b?void 0:O,...P,"aria-describedby":(0,r.ariaDescribedByIds)(h),label:k,className:p.default.checkbox}))};t.CheckboxWidget=v},93306:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnyOfField=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(14041)),c=e(97267),p=n.__importDefault(e(93089)),v=m=>{var _,s;const{disabled:g,formContext:l,idSchema:h,onBlur:u,id:d,onChange:E,onFocus:f,options:a,placeholder:b,readonly:y,registry:A,name:S,required:w,schema:T,uiOptions:D}=m,{readonlyAsDisabled:I=!0}=l,O=({target:L})=>E(L.value===""?a.emptyValue:L.value),M=({target:L})=>u(d,L.value),R=({target:L})=>f(d,L.value),P=(s=(_=a.description)!==null&&_!==void 0?_:T.description)!==null&&s!==void 0?s:T.markdownDescription,k=(0,r.getTemplate)("TitleFieldTemplate",A,D),F=(0,r.getTemplate)("DescriptionFieldTemplate",A,D);return o.default.createElement("div",{className:p.default.any_of_widget_control},S&&o.default.createElement("div",{className:p.default.object_title},o.default.createElement(k,{id:(0,r.titleId)(h),title:S,required:w,schema:T,registry:A})),P&&o.default.createElement("div",{className:p.default.object_description},o.default.createElement(F,{id:(0,r.descriptionId)(h),description:P,schema:T,registry:A})),o.default.createElement(c.Input,{disabled:g||I&&y,onBlur:y?void 0:M,onChange:y?void 0:O,onFocus:y?void 0:R,placeholder:b,autoComplete:"off"}))};t.AnyOfField=v},32475:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayField=void 0;const n=e(85608),r=e(67030),o=n.__importStar(e(14041)),c=e(43718),p=(0,r.getDefaultRegistry)().fields.ArrayField,v=m=>{const{onChange:_}=m,s=(0,o.useCallback)(g=>{Array.isArray(g)&&_(g.map(l=>(0,c.isUndefined)(l)?"":l))},[_]);return o.default.createElement(p,{...m,onChange:s})};t.ArrayField=v},59299:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectField=void 0;const n=e(85608),r=e(67030),o=n.__importStar(e(14041)),c=e(41869),p=e(43718),v=e(64582),m=(0,r.getDefaultRegistry)().fields.ObjectField,_=s=>{const g=(0,c.useInjectable)(v.ILaunchService),{idSchema:l,onChange:h}=s;return(0,o.useEffect)(()=>{const{$id:u}=l,d=new p.Disposable;return u==="root"&&d.addDispose(g.onChangeFormData(E=>h(E))),()=>d.dispose()},[l]),o.default.createElement(m,{...s})};t.ObjectField=_},66216:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TitleField=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=n.__importDefault(e(93089)),c=p=>{const{title:v}=p;return v?r.default.createElement("label",{title:v,className:o.default.field_label},v):null};t.TitleField=c},81638:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelectWidget=void 0;const n=e(85608),r=e(51632),o=n.__importStar(e(14041)),c=e(97267),p=n.__importDefault(e(93089)),v=m=>{const{schema:_,value:s,id:g,registry:l,uiOptions:h,name:u,required:d,onChange:E}=m,f=_.description,a=(0,r.getTemplate)("TitleFieldTemplate",l,h),b=(0,r.getTemplate)("DescriptionFieldTemplate",l,h),y=(0,o.useMemo)(()=>_&&_.enum?_.enum:[],[_,_.enum]);return o.default.createElement("div",{className:p.default.select_widget_control},u&&o.default.createElement("div",{className:p.default.object_title},o.default.createElement(a,{id:(0,r.titleId)(g),title:u,required:d,schema:_,registry:l})),f&&o.default.createElement("div",{className:p.default.object_description},o.default.createElement(b,{id:(0,r.descriptionId)(g),description:f,schema:_,registry:l})),o.default.createElement(c.Select,{key:g,value:s,dropdownRenderType:"absolute",onChange:E},y.map(A=>o.default.createElement(c.Option,{value:A,label:A,key:A},A))))};t.SelectWidget=v},20023:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextWidget=void 0;const n=e(85608),r=e(51632),o=n.__importStar(e(14041)),c=e(97267),p=e(64582),v=e(5905),m=n.__importDefault(e(93089)),_=s=>{const{disabled:g,formContext:l,id:h,onBlur:u,onChange:d,onFocus:E,options:f,placeholder:a,readonly:b,schema:y,value:A,registry:S,label:w,hideLabel:T,required:D,uiSchema:I,uiOptions:O}=s,{readonlyAsDisabled:M=!0}=l,R=(0,r.getTemplate)("TitleFieldTemplate",S,O),P=(0,r.getTemplate)("DescriptionFieldTemplate",S,O),k=(0,o.useMemo)(()=>typeof A!="string"?A:(0,v.parseSnippet)(A),[A]),F=({target:W})=>{d(W.value===""?f.emptyValue:W.value),u(h,W.value)},L=({target:W})=>E(h,W.value),B=(0,o.useMemo)(()=>y.type!==p.JSON_SCHEMA_TYPE.STRING&&y.type!==p.JSON_SCHEMA_TYPE.NUMBER?p.JSON_SCHEMA_TYPE.STRING:y.type,[y,y.type]),j=(0,o.useMemo)(()=>y.description||"",[y,y.description]);return o.default.createElement("div",null,!T&&w&&o.default.createElement("div",{className:m.default.object_title},o.default.createElement(R,{id:(0,r.titleId)(h),title:w,required:D,schema:y,uiSchema:I,registry:S})),j&&o.default.createElement("div",{className:m.default.object_description},o.default.createElement(P,{id:(0,r.descriptionId)(h),description:j,schema:y,uiSchema:I,registry:S})),o.default.createElement(c.Input,{disabled:g||M&&b,id:h,name:h,onBlur:b?void 0:F,onFocus:b?void 0:L,placeholder:a,type:B,value:k,className:m.default.text_widget_control,autoComplete:"off"}))};t.TextWidget=_},23434:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchFolderPreferenceProvider=void 0;const n=e(85608),r=e(76003),o=e(91825);let c=class extends o.FolderFilePreferenceProvider{parse(v){const m=super.parse(v);if(m!==void 0)return{launch:{...m}}}getPath(v){if(v==="launch")return[];if(v.startsWith("launch."))return[v.substr(7)]}};t.LaunchFolderPreferenceProvider=c,t.LaunchFolderPreferenceProvider=c=n.__decorate([(0,r.Injectable)()],c)},52369:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchPreferencesContribution=t.LaunchResourceProvider=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(64102),p=e(39496),v=e(57517),m=e(4983),_=e(10938),s=e(67858);let g=class{constructor(){this.scheme=m.LAUNCH_VIEW_SCHEME}provideResource(u){return{supportsRevive:!0,name:(0,o.localize)("menu-bar.title.debug"),icon:(0,o.getIcon)("debug"),uri:u}}provideResourceSubname(){return null}async shouldCloseResource(){return!0}};t.LaunchResourceProvider=g,t.LaunchResourceProvider=g=n.__decorate([(0,r.Injectable)()],g);let l=class{constructor(){this.schema=_.launchPreferencesSchema,this.name="launch"}registerResource(u){u.registerResourceProvider(this.prefResourceProvider)}registerEditorComponent(u){u.registerEditorComponent({component:s.LaunchViewContainer,uid:m.LAUNCH_VIEW_COMPONENT_ID,scheme:m.LAUNCH_VIEW_SCHEME}),u.registerEditorComponentResolver(m.LAUNCH_VIEW_SCHEME,(d,E,f)=>{f([{type:v.EditorOpenType.component,componentId:m.LAUNCH_VIEW_COMPONENT_ID}])})}registerMenus(u){u.registerMenuItem(p.MenuId.EditorTitle,{command:o.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id,iconClass:(0,o.getIcon)("open"),group:"navigation",when:`resourceScheme == ${m.LAUNCH_VIEW_SCHEME}`})}};t.LaunchPreferencesContribution=l,n.__decorate([(0,r.Autowired)(g),n.__metadata("design:type",g)],l.prototype,"prefResourceProvider",void 0),t.LaunchPreferencesContribution=l=n.__decorate([(0,o.Domain)(o.PreferenceContribution,o.PreferenceConfiguration,v.BrowserEditorContribution,c.MenuContribution)],l)},10938:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.launchPreferencesSchema=void 0;const n=e(64582);t.launchPreferencesSchema={type:"object",scope:"resource",properties:{launch:{$ref:n.launchSchemaUri,description:"Global debug launch configuration. Should be used as an alternative to 'launch.json' that is shared across workspaces",defaultValue:{configurations:[],compounds:[]}}}}},44888:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchService=void 0;const n=e(85608),r=n.__importStar(e(23304)),o=n.__importDefault(e(41263)),c=e(76003),p=e(41869),v=e(43718),m=e(14951),_=e(64582),s="configurations";let g=class{constructor(){this._onRawSchemaProperties=new v.Emitter,this.onRawSchemaProperties=this._onRawSchemaProperties.event,this._onChangeSchema=new v.Emitter,this.onChangeSchema=this._onChangeSchema.event,this._onChangeFormData=new v.Emitter,this.onChangeFormData=this._onChangeFormData.event}get rawSchemaProperties(){return this._rawSchemaProperties}get schema(){return this._schema}get formData(){return this._formData}async openLaunchConfiguration(){await this.commandService.executeCommand(p.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id)}setRawSchemaProperties(h){this._rawSchemaProperties=h,this._onRawSchemaProperties.fire(h)}nextNewSchema(h){this._schema=h,this._onChangeSchema.fire(h)}nextNewFormData(h,u=!0){this._formData=h,u&&this._onChangeFormData.fire(h)}addNewItem(h){if(h==="")return;const{properties:u}=this.rawSchemaProperties,d={...this.formData},E=u[h],{default:f,type:a}=E;(0,o.default)(d,h,f||this.getDefaultValue(a)),(0,o.default)(this.schema.properties,h,E),this.nextNewSchema(this.schema),this.nextNewFormData(d)}delItem(h){if(h==="")return;const{properties:u}=this.schema,d={...this.formData};delete d[h],delete u[h],this.nextNewSchema(this.schema),this.nextNewFormData(d)}getDefaultValue(h){switch(h){case _.JSON_SCHEMA_TYPE.ARRAY:return[];case _.JSON_SCHEMA_TYPE.BOOLEAN:return!1;case _.JSON_SCHEMA_TYPE.NULL:return null;case _.JSON_SCHEMA_TYPE.NUMBER:return 0;case _.JSON_SCHEMA_TYPE.OBJECT:return{};case _.JSON_SCHEMA_TYPE.STRING:default:return""}}async readResourceContent(h){try{const{content:u}=await this.fileSystem.readFile(h.toString());return u.toString()}catch{return""}}async modifyConfigurationsInResource(h,u,d){const E=await this.fileSystem.getFileStat(h.toString());if(E&&E.type===v.FileType.File){const{formData:f}=u,a=await this.readResourceContent(h),y=r.parse(a)[s];if(!y)return;Array.isArray(y)&&y.length-1>=d&&y.splice(d,1,f);const A=r.modify(a,[s],y,{isArrayInsertion:!1,formattingOptions:{tabSize:2,insertSpaces:!0,eol:`
|
|
31519
31519
|
`}}),S=r.applyEdits(a,A);await this.fileSystem.setContent(E,S)}}};t.LaunchService=g,n.__decorate([(0,c.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],g.prototype,"fileSystem",void 0),n.__decorate([(0,c.Autowired)(v.CommandService),n.__metadata("design:type",Object)],g.prototype,"commandService",void 0),t.LaunchService=g=n.__decorate([(0,c.Injectable)()],g)},67858:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchViewContainer=void 0;const n=e(85608),r=e(67030),o=n.__importDefault(e(17932)),c=n.__importDefault(e(53373)),p=n.__importDefault(e(46123)),v=n.__importDefault(e(97331)),m=n.__importStar(e(14041)),_=n.__importDefault(e(19686)),s=e(97267),g=e(41869),l=e(81878),h=e(25918),u=e(1237),d=e(85084),E=e(53670),f=e(60709),a=e(70159),b=e(37499),y=e(5905),A=e(53741),S=e(93306),w=e(32475),T=e(59299),D=e(66216),I=e(81638),O=e(20023),M=n.__importDefault(e(52402)),R=e(24650),P=e(77874),k=e(27953),F=e(44115),L=e(51773),B=e(67481),j=e(5062),W=e(74447),U=e(56551),Q=({resource:z})=>{const{uri:H}=z,K=(0,g.useInjectable)(g.IJSONSchemaRegistry),Z=(0,g.useInjectable)(b.DebugConfigurationManager),X=(0,g.useInjectable)(a.ILaunchService),ie=(0,g.useInjectable)(g.CommandService),[oe,le]=(0,m.useState)(0),[pe,q]=(0,m.useState)(),[Ee,_e]=(0,m.useState)([]);(0,m.useEffect)(()=>{const Re=new g.Disposable;return Re.addDispose(K.onDidChangeSchema(Be=>{Be===f.launchExtensionSchemaUri&&ge(K.getSchemaContributions())})),Re.addDispose(Z.onDidChange(async()=>{Te()})),ge(K.getSchemaContributions()),Te(),()=>Re.dispose()},[]);const te=(0,m.useMemo)(()=>H.withScheme(g.Schemes.file),[H]),ge=(0,m.useCallback)(Re=>{const Be=Re.schemas[f.launchExtensionSchemaUri];Be&&q(Be)},[pe]),Te=(0,m.useCallback)(()=>{const Re=Z.all;Array.isArray(Re)&&_e(Re.map(Be=>new R.ConfigurationItemsModel(Be.configuration.name,Be.configuration)))},[]),Pe=(0,m.useMemo)(()=>pe?(0,p.default)(pe,["properties","configurations","items","defaultSnippets"])||[]:[],[pe]),Ae=(0,m.useCallback)((Re,Be)=>{const{configuration:me}=Re;me&&le(Be)},[]),we=(0,m.useMemo)(()=>{if(Ee&&!(0,g.isUndefined)(oe)){const Re=Ee[oe];if(!Re)return;const{configuration:Be,description:me,label:re}=Re;return Be?{body:Be,description:me,label:re}:void 0}},[Ee,oe]),be=(0,m.useCallback)(async Re=>{const{configuration:Be}=Re;await Z.insertConfiguration(te,Be),ie.executeCommand(g.EDITOR_COMMANDS.SAVE_URI.id,te)},[Pe]),fe=(0,v.default)(async(Re,Be)=>await X.modifyConfigurationsInResource(te,Re,Be),100),xe=(0,m.useCallback)(async Re=>{const{formData:Be}=Re;!Be||(0,g.isUndefined)(oe)||fe(Re,oe)},[oe,we]);return m.default.createElement(s.ComponentContextProvider,{value:{getIcon:g.getIcon,localize:g.localize}},m.default.createElement("div",{className:M.default.launch_container},m.default.createElement(l.SplitPanel,{id:"launch-container",resizeHandleClassName:M.default.devider,className:M.default.launch_panel,direction:"left-to-right"},m.default.createElement(V,{"data-sp-defaultSize":240,"data-sp-minSize":150,inputConfigurationItems:Ee,snippetItems:Pe,onSelectedConfiguration:Ae,onAddConfigurationItems:be,currentConfigurationIndex:oe}),m.default.createElement(Y,{"data-sp-flex":1,snippetItem:we,schemaContributions:pe,onChange:xe}))))};t.LaunchViewContainer=Q;const V=({snippetItems:z,onSelectedConfiguration:H,onAddConfigurationItems:K,inputConfigurationItems:Z,currentConfigurationIndex:X})=>{const ie=(0,g.useInjectable)(a.ILaunchService),[oe,le]=m.default.useState(!1),[pe,q]=(0,m.useState)(Z);(0,m.useEffect)(()=>{if(pe.length===0&&(0,g.isUndefined)(X))return;const Pe=pe[X];Pe&&Pe.configuration&&ie.nextNewFormData(Pe.configuration,!1)},[X,pe]),(0,m.useEffect)(()=>{q([...Z])},[Z]);const Ee=(0,m.useCallback)((Pe,Ae)=>{H(Pe,Ae)},[]),_e=({data:Pe,index:Ae})=>m.default.createElement("div",{key:Ae,className:(0,c.default)(M.default.configuration_item,X===Ae?M.default.selected:""),onClick:()=>Ee(Pe,Ae)},m.default.createElement("div",{className:M.default.configuration_wrapper},m.default.createElement("span",{className:M.default.configuration_description},Pe.label))),te=(0,m.useCallback)(Pe=>{le(!1);const{label:Ae}=Pe,we=z.find(Re=>Re.label===Ae);if(!we)return;const{body:be}=we;if(!(0,g.isObject)(be))return;const fe=Object.keys(be).reduce((Re,Be)=>{const me=be[Be];return typeof me=="string"?Re[Be]=(0,y.parseSnippet)(me):Array.isArray(me)&&(Re[Be]=me.map(re=>typeof re=="string"?(0,y.parseSnippet)(re):re)),Re},be),xe=new R.ConfigurationItemsModel(we.label,fe);xe.setDescription(we.description||""),K(xe)},[pe,z]),ge=Pe=>{le(Pe)},Te=(0,m.useMemo)(()=>m.default.createElement(h.MenuActionList,{data:z.map(Pe=>new u.LabelMenuItemNode(Pe.label)),afterClick:Pe=>te(Pe)}),[z,pe]);return m.default.createElement("div",{className:M.default.launch_indexes_container},m.default.createElement(_.default,{className:M.default.configuration_items_box},({width:Pe,height:Ae})=>pe.length===0?m.default.createElement("div",{style:{width:Pe},className:M.default.not_configuration_content},(0,g.localize)("debug.action.no.configuration")):m.default.createElement(s.RecycleList,{width:Pe,height:Ae,data:pe,template:_e})),m.default.createElement("div",{className:M.default.foot_box},m.default.createElement(s.Button,{className:M.default.button,placement:"topCenter",menu:Te,moreVisible:oe,onVisibleChange:ge},(0,g.localize)("debug.action.add.configuration"))))},$=(0,r.withTheme)({widgets:{TextWidget:O.TextWidget,SelectWidget:I.SelectWidget,CheckboxWidget:A.CheckboxWidget},fields:{ObjectField:T.ObjectField}}),Y=({snippetItem:z,schemaContributions:H,onChange:K})=>{if(!z)return m.default.createElement("div",{className:M.default.no_onfiguration},(0,g.localize)("debug.action.no.configuration"));const Z=(0,g.useInjectable)(a.ILaunchService),X=(0,m.useMemo)(()=>{const le=(0,d.acquireAjv)(),q=((0,p.default)(H,["properties","configurations","items","oneOf"])||[]).find(Ee=>{const{body:_e}=z;return le.validate(Ee,_e)});if(q)return Z.setRawSchemaProperties(q),q},[z,H]),ie=(0,m.useMemo)(()=>{if(!(X&&X.properties))return;const{label:le,body:pe,description:q}=z,{properties:Ee,required:_e}=X,te=Object.keys(pe).reduce((Te,Pe)=>{const Ae=Ee[Pe];return Ae?.type===f.JSON_SCHEMA_TYPE.ARRAY&&(0,g.isUndefined)(Ae?.items)&&(Ae.items={type:f.JSON_SCHEMA_TYPE.STRING}),Array.isArray(Ae?.type)&&(Ae.type=Ae.type[0]||f.JSON_SCHEMA_TYPE.STRING),Array.isArray(Ae?.anyOf)&&(Ae.anyOf=Ae.anyOf.filter(we=>Object.keys(we).length>0)),Ae?.type===f.JSON_SCHEMA_TYPE.OBJECT&&!(0,g.isUndefined)(Ae?.additionalProperties)&&(Ae.additionalProperties={type:f.JSON_SCHEMA_TYPE.STRING}),Ae?.type===f.JSON_SCHEMA_TYPE.OBJECT&&!(0,g.isUndefined)(Ae?.properties)&&Object.keys(Ae.properties).length>6&&(Ae.properties={},Ae[E.MASSIVE_PROPERTY_FLAG]=!0),!Ae?.description&&Ae?.markdownDescription&&(Ae.description=Ae.markdownDescription),Te[Pe]=Ae,Te},{}),ge={title:le,type:f.JSON_SCHEMA_TYPE.OBJECT,required:_e,description:q,properties:te};return Z.nextNewSchema(ge),ge},[z,X]),oe=(0,m.useCallback)(le=>{if(!(X&&X.properties)||!(ie&&ie.properties))return;const{label:pe}=le;Z.addNewItem(pe)},[z,X,ie]);return m.default.createElement("div",{className:M.default.launch_schema_body_container},ie&&X&&m.default.createElement($,{formData:z.body,schema:ie,validator:o.default,fields:{AnyOfField:S.AnyOfField,OneOfField:S.AnyOfField,ArrayField:w.ArrayField},onChange:K,templates:{ArrayFieldTemplate:F.ArrayFieldTemplate,ArrayFieldItemTemplate:k.ArrayFieldItemTemplate,DescriptionFieldTemplate:j.DescriptionFieldTemplate,FieldTemplate:W.FieldTemplate,ObjectFieldTemplate:U.ObjectFieldTemplate,WrapIfAdditionalTemplate:P.WrapIfAdditionalTemplate,BaseInputTemplate:L.BaseInputTemplate,TitleFieldTemplate:D.TitleField,ButtonTemplates:{MoveUpButton:B.MoveUpButton,MoveDownButton:B.MoveDownButton,RemoveButton:B.RemoveButton,SubmitButton:le=>m.default.createElement(B.AddItemButton,{...le,onAddClick:oe}),AddButton:B.AddButton,CopyButton:B.CopyButton}}}))}},24650:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationItemsModel=void 0;const n=e(43718);class r{get uniqueID(){return this._uniqueID}get description(){return this._description}constructor(c,p){this.label=c,this.configuration=p,this._uniqueID=(0,n.uuid)(6)}setDescription(c){this._description=c}}t.ConfigurationItemsModel=r},77874:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WrapIfAdditionalTemplate=void 0;const n=e(85608),r=e(51632),o=n.__importStar(e(14041)),c=e(97267),p=e(41869),v=e(43718),m=e(64582),_=e(44888),s=n.__importDefault(e(40043)),g=l=>{const{children:h,classNames:u,style:d,disabled:E,id:f,label:a,onKeyChange:b,onDropPropertyClick:y,readonly:A,registry:S,schema:w}=l,T=(0,p.useInjectable)(_.LaunchService),{readonlyAsDisabled:D=!0}=S.formContext,{templates:I}=S,{RemoveButton:O}=I.ButtonTemplates,M=r.ADDITIONAL_PROPERTY_FLAG in w,R=m.MASSIVE_PROPERTY_FLAG in w,P=(0,r.getTemplate)("TitleFieldTemplate",S),k=(0,r.getTemplate)("DescriptionFieldTemplate",S),F=(0,o.useMemo)(()=>w.description||w.markdownDescription,[w]),L=(0,o.useCallback)(async()=>{await T.openLaunchConfiguration()},[]);if(R)return o.default.createElement("div",{className:u,style:d},a&&o.default.createElement("div",{className:s.default.object_title},o.default.createElement(P,{id:(0,r.titleId)(f),title:a,schema:w,registry:S})),F&&o.default.createElement("div",{className:s.default.object_description},o.default.createElement(k,{id:(0,r.descriptionId)(f),description:F,schema:w,registry:S})),o.default.createElement("div",{className:s.default.control_wrap},o.default.createElement("a",{onClick:L},(0,v.localize)("debug.launch.view.edit.inLaunchJson"))));if(!M)return o.default.createElement("div",{className:u,style:d},h);const B=(0,o.useCallback)(({target:j})=>b(j.value),[b]);return o.default.createElement("div",{className:u,style:d},o.default.createElement("div",{className:s.default.additional_field_template},o.default.createElement("div",{className:s.default.form_additional_container},o.default.createElement("div",{className:s.default.form_additional},o.default.createElement(c.Input,{className:s.default.form_control,defaultValue:a,value:a,placeholder:(0,v.formatLocalize)("debug.launch.view.template.input.placeholder","Key"),disabled:E||D&&A,id:`${f}-key`,name:`${f}-key`,onBlur:A?void 0:B,type:"text"})),o.default.createElement("div",{className:s.default.form_additional_children},h),o.default.createElement(O,{disabled:E||A,onClick:y(a),registry:S}))))};t.WrapIfAdditionalTemplate=g},27953:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayFieldItemTemplate=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=n.__importDefault(e(40043)),p={width:"100%"},v={width:"calc(100% / 4)"},m=_=>{const{className:s,children:g,disabled:l,hasCopy:h,hasMoveDown:u,hasMoveUp:d,hasRemove:E,hasToolbar:f,index:a,onCopyIndexClick:b,onDropIndexClick:y,onReorderClick:A,readonly:S,registry:w}=_,{CopyButton:T,MoveDownButton:D,MoveUpButton:I,RemoveButton:O}=w.templates.ButtonTemplates,M=(0,o.useMemo)(()=>b(a),[a,b]),R=(0,o.useMemo)(()=>y(a),[a,y]),P=(0,o.useMemo)(()=>A(a,a-1),[a,A]),k=(0,o.useMemo)(()=>A(a,a+1),[a,A]);return o.default.createElement("div",{key:`array-item-${a}`,className:(0,r.default)(s,c.default.array_field_item_template)},o.default.createElement("div",{className:c.default.control_field},o.default.cloneElement(g,{name:""})),f&&o.default.createElement("div",{className:c.default.toolbar},o.default.createElement("div",{style:p},(d||u)&&o.default.createElement(I,{disabled:l||S||!d,onClick:P,style:v,registry:w}),(d||u)&&o.default.createElement(D,{disabled:l||S||!u,onClick:k,style:v,registry:w}),h&&o.default.createElement(T,{disabled:l||S,onClick:M,style:v,registry:w}),E&&o.default.createElement(O,{disabled:l||S,onClick:R,style:v,registry:w}))))};t.ArrayFieldItemTemplate=m},44115:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayFieldTemplate=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(53373)),c=n.__importDefault(e(14041)),p=n.__importDefault(e(40043)),v=m=>{const{canAdd:_,className:s,disabled:g,formContext:l,idSchema:h,items:u,onAddClick:d,readonly:E,registry:f,required:a,schema:b,title:y,uiSchema:A}=m,S=(0,r.getUiOptions)(A),w=(0,r.getTemplate)("ArrayFieldDescriptionTemplate",f,S),T=(0,r.getTemplate)("ArrayFieldItemTemplate",f,S),D=(0,r.getTemplate)("ArrayFieldTitleTemplate",f,S),{ButtonTemplates:{AddButton:I}}=f.templates;return c.default.createElement("fieldset",{className:(0,o.default)(s),id:h.$id},c.default.createElement("div",{className:p.default.array_field_template},(S.title||y)&&c.default.createElement("div",{className:p.default.array_item_label},c.default.createElement(D,{idSchema:h,required:a,title:S.title||y,schema:b,uiSchema:A,registry:f})),(S.description||b.description)&&c.default.createElement("div",{className:p.default.array_item_description},c.default.createElement(w,{description:S.description||b.description,idSchema:h,schema:b,uiSchema:A,registry:f})),u&&u.map(({key:O,...M})=>c.default.createElement(T,{key:O,...M})),_&&c.default.createElement("div",{className:p.default.array_item_add},c.default.createElement(I,{disabled:g||E,onClick:d,registry:f}))))};t.ArrayFieldTemplate=v},51773:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseInputTemplate=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(14041)),c=e(97267),p={width:"100%"},v=m=>{const{disabled:_,formContext:s,id:g,onBlur:l,onChange:h,onChangeOverride:u,onFocus:d,options:E,placeholder:f,readonly:a,schema:b,value:y,type:A}=m,S=(0,r.getInputProps)(b,A,E,!1),{readonlyAsDisabled:w=!0}=s,T=R=>h(R),D=u||(({target:R})=>h(R.value===""?E.emptyValue:R.value)),I=({target:R})=>l(g,R.value),O=({target:R})=>d(g,R.value),M=o.default.createElement(c.Input,{disabled:_||w&&a,id:g,name:g,onBlur:a?void 0:I,onChange:a?void 0:D,onFocus:a?void 0:O,placeholder:f,style:p,list:b.examples?(0,r.examplesId)(g):void 0,...S,value:y,"aria-describedby":(0,r.ariaDescribedByIds)(g,!!b.examples)});return o.default.createElement(o.default.Fragment,null,M,Array.isArray(b.examples)&&o.default.createElement("datalist",{id:(0,r.examplesId)(g)},b.examples.concat(b.default&&!b.examples.includes(b.default)?[b.default]:[]).map(R=>o.default.createElement("option",{key:R,value:R}))))};t.BaseInputTemplate=v},67481:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddItemButton=t.CopyButton=t.AddButton=t.RemoveButton=t.MoveDownButton=t.MoveUpButton=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),c=e(81139),p=e(41869),v=e(25918),m=e(1237),_=e(43718),s=e(64582),g=n.__importDefault(e(40043)),l=a=>r.default.createElement(o.Button,{...a,type:"primary",icon:c.defaultIconfont.arrowup},r.default.createElement("span",{className:(0,o.getIcon)(c.defaultIconfont.arrowup)}));t.MoveUpButton=l;const h=a=>r.default.createElement(o.Button,{...a,type:"primary",icon:c.defaultIconfont.arrowdown},r.default.createElement("span",{className:(0,o.getIcon)(c.defaultIconfont.arrowdown)}));t.MoveDownButton=h;const u=a=>r.default.createElement(o.Button,{...a,type:"danger",icon:c.defaultIconfont.delete},r.default.createElement("span",{className:(0,o.getIcon)(c.defaultIconfont.delete)}));t.RemoveButton=u;const d=a=>r.default.createElement(o.Button,{...a,type:"primary",icon:c.defaultIconfont.plus},r.default.createElement("span",{className:(0,o.getIcon)(c.defaultIconfont.plus)})," ",(0,_.localize)("debug.launch.view.template.button.addItem"));t.AddButton=d;const E=a=>r.default.createElement(o.Button,{...a,type:"primary",icon:c.defaultIconfont["file-copy"]},r.default.createElement("span",{className:(0,o.getIcon)(c.defaultIconfont["file-copy"])}));t.CopyButton=E;const f=a=>{const{registry:{rootSchema:b},onAddClick:y}=a,A=(0,p.useInjectable)(s.ILaunchService),[S,w]=r.default.useState(!1),[T,D]=r.default.useState([]),{rawSchemaProperties:I}=A,O=(0,r.useCallback)(P=>w(P),[]),M=(0,r.useCallback)(P=>{w(!1),y(P)},[]),R=(0,r.useCallback)(()=>{const{properties:P}=I,{properties:k}=b;if(!P||!k)return;const F=Object.keys(P).filter(L=>!Object.hasOwn(k,L)).map(L=>new m.LabelMenuItemNode(L));D(F)},[b,I]);return(0,r.useEffect)(()=>{const P=new _.Disposable;return P.addDispose(A.onChangeSchema(()=>{requestAnimationFrame(()=>{R()})})),R(),()=>P.dispose()},[I,b]),r.default.createElement(o.Button,{type:"secondary",icon:c.defaultIconfont.plus,className:g.default.add_new_field,menu:r.default.createElement(v.MenuActionList,{afterClick:M,data:T,style:{maxHeight:600}}),moreVisible:S,onVisibleChange:O},r.default.createElement("span",{className:(0,o.getIcon)(c.defaultIconfont.plus)})," ",(0,_.localize)("debug.launch.view.template.button.submit"))};t.AddItemButton=f},5062:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DescriptionFieldTemplate=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=n.__importDefault(e(40043)),c=p=>{const{id:v,schema:m}=p,_=(0,r.useMemo)(()=>{var s;return(s=m.description)!==null&&s!==void 0?s:m.markdownDescription},[m,m.description,m.markdownDescription]);return _?r.default.createElement("span",{id:v,className:o.default.description_field_template},_):null};t.DescriptionFieldTemplate=c},74447:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FieldTemplate=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(53373)),c=n.__importDefault(e(14041)),p=v=>{const{classNames:m,style:_,children:s,id:g,schema:l,label:h,hidden:u,formContext:d,uiSchema:E,registry:f,disabled:a,onDropPropertyClick:b,onKeyChange:y,required:A,readonly:S}=v,{wrapperStyle:w}=d,T=(0,r.getUiOptions)(E),D=(0,r.getTemplate)("WrapIfAdditionalTemplate",f,T);return u?null:c.default.createElement(D,{classNames:m,style:_,disabled:a,id:g,label:h,onDropPropertyClick:b,onKeyChange:y,readonly:S,required:A,schema:l,uiSchema:E,registry:f},g==="root"?s:c.default.createElement("div",{className:(0,o.default)(m),style:w},s))};t.FieldTemplate=p},56551:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectFieldTemplate=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(53373)),c=n.__importStar(e(14041)),p=e(97267),v=e(41869),m=e(70159),_=n.__importDefault(e(40043)),s=l=>{const{schema:h,uiSchema:u,formData:d}=l,{properties:E}=h;return E?Object.keys(E).length===0?!0:Object.values(E).some(f=>f[r.ADDITIONAL_PROPERTY_FLAG])?(0,r.canExpand)(h,u,d):!1:!1},g=l=>{const{schema:h,uiSchema:u,required:d,registry:E,idSchema:f,title:a,disabled:b,readonly:y,properties:A,onAddClick:S}=l,w=(0,v.useInjectable)(m.ILaunchService),T=(0,r.getUiOptions)(u),D=(0,r.getTemplate)("TitleFieldTemplate",E,T),I=(0,r.getTemplate)("DescriptionFieldTemplate",E,T),{ButtonTemplates:{AddButton:O}}=E.templates,M=(0,c.useMemo)(()=>{var L;return(L=l.description)!==null&&L!==void 0?L:h.markdownDescription},[l.description,h]),R=(0,c.useMemo)(()=>f.$id==="root"?(0,o.default)(_.default.object_field_container,_.default.root_object_field_container):_.default.object_field_container,[f]),P=(0,c.useMemo)(()=>f.$id==="root"?(0,o.default)(_.default.property_wrapper,_.default.root_property_wrapper):_.default.property_wrapper,[f]),k=(0,c.useCallback)(L=>{const{name:B}=L;w.delItem(B)},[]),F=(0,c.useCallback)(L=>{const{rawSchemaProperties:B}=w;if(!B)return null;const j=B.required||[];return c.default.createElement("div",{key:L.name,className:P,onKeyDown:W=>{W.key===v.Key.ENTER.code&&(W.preventDefault(),W.stopPropagation())}},L.content,j.includes(L.name)||f.$id!=="root"?null:c.default.createElement("div",{className:_.default.wrapper_delete,onClick:()=>k(L)},c.default.createElement("span",{className:(0,o.default)((0,p.getIcon)("close-circle"),_.default.close_icon)})))},[A,w.rawSchemaProperties,f]);return c.default.createElement("div",{className:_.default.object_field_template},c.default.createElement("fieldset",null,c.default.createElement("div",{className:R},a&&c.default.createElement("div",{className:_.default.object_title},c.default.createElement(D,{id:(0,r.titleId)(f),title:a,required:d,schema:h,uiSchema:u,registry:E})),M&&c.default.createElement("div",{className:_.default.object_description},c.default.createElement(I,{id:(0,r.descriptionId)(f),description:M,schema:h,uiSchema:u,registry:E})),A.filter(L=>!L.hidden).map(L=>F(L))),s(l)&&c.default.createElement(O,{onClick:S(h),disabled:b||y,registry:E})))};t.ObjectFieldTemplate=g},81450:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnsiConsoleNode=t.TreeWithLinkWrapper=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=n.__importDefault(e(43144)),p=e(97267),v=e(41869),m=n.__importDefault(e(80315)),_=l=>{if(typeof l>"u")return(0,r.default)(m.default.variable_repl_text,m.default.info);switch(l){case v.MessageType.Error:return(0,r.default)(m.default.variable_repl_text,m.default.error);case v.MessageType.Warning:return(0,r.default)(m.default.variable_repl_text,m.default.warn);case v.MessageType.Info:return(0,r.default)(m.default.variable_repl_text,m.default.info);default:return(0,r.default)(m.default.variable_repl_text,m.default.info)}};class s extends o.default.Component{componentDidMount(){if(this.props.html){const h=c.default.findDOMNode(this);h?.appendChild(this.props.html)}}render(){return o.default.createElement("code",{className:this.props.className})}}t.TreeWithLinkWrapper=s;class g extends p.TreeNode{get parent(){return this._compositeTreeNode}static is(h){return!!h&&!!h.template}constructor(h,u,d,E,f,a,b){var y;super({},u),this.description=h,this._compositeTreeNode=u,this.linkDetector=d,this.ansiNode=E,this.severity=f,this.source=a,this.line=b,this.linkDetectorHTML=(y=this.ansiNode)!==null&&y!==void 0?y:this.linkDetector.linkify(this.description)}get name(){return`log_${this.id}`}get el(){return this.linkDetectorHTML}get template(){return()=>o.default.createElement(s,{className:_(this.severity),html:this.linkDetectorHTML})}}t.AnsiConsoleNode=g},98650:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverVariableRoot=t.DebugVariableRoot=t.DebugWatchRoot=t.DebugConsoleRoot=t.DebugConsoleNode=t.DebugConsoleVariableContainer=t.DebugWatchNode=t.DebugScope=t.DebugVariableContainer=t.DebugVariable=t.DebugVirtualVariable=t.ExpressionContainer=t.ExpressionNode=t.DebugConsoleTreeService=t.ExpressionTreeService=void 0;const n=e(97267),r=e(41869),o=e(43718),c=e(55121),p=e(44781),v="undefined";class m{constructor(T,D,I){this.session=T,this.source=D,this.line=I}async resolveChildren(T){var D;return A.is(T)&&!T.variablesReference&&!T.presetChildren?await((D=this.session)===null||D===void 0?void 0:D.getScopes(T))||[]:await this.doResolve(T)}async doResolve(T){const D=[];if(!T)return D;if(Array.isArray(T.presetChildren))return T.presetChildren;if(!this.session||this.session.terminated)return D;const{variablesReference:I,startOfVariables:O,indexedVariables:M,namedVariables:R}=T;if(R)return await this.fetch(D,I,"named",T),D;if(M){let P=g.BASE_CHUNK_SIZE;for(;M>P*g.BASE_CHUNK_SIZE;)P*=g.BASE_CHUNK_SIZE;if(M>P){const k=Math.ceil(M/P);for(let F=0;F<k;F++){const L=T.startOfVariables+F*P,B=Math.min(P,M-F*P);D.push(new l({session:this.session,variablesReference:T.variablesReference,namedVariables:0,indexedVariables:B,startOfVariables:L,name:`[${L}..${L+B-1}]`},T))}return D}}return await this.fetch(D,I,"indexed",T,O,M),D}async fetch(T,D,I,O,M,R){try{const P=await this.session.sendRequest("variables",{variablesReference:D,filter:I,start:M,count:R}),{variables:k}=P.body;for(const F of k)F.variablesReference?T.push(new u(this.session,F,O,this.source,this.line)):T.push(new h(this.session,F,O))}catch(P){T.push({severity:r.MessageType.Error,visible:!!P.message,message:P.message})}}sortComparator(T,D){return(0,o.isDefined)(T.variablesReference)&&(0,o.isDefined)(D.variablesReference)?T.variablesReference-D.variablesReference:T.constructor===D.constructor?T.name>D.name?1:T.name<D.name?-1:0:n.CompositeTreeNode.is(T)?1:n.CompositeTreeNode.is(D)?-1:0}}t.ExpressionTreeService=m;class _ extends m{sortComparator(T,D){return T?D?0:-1:1}}t.DebugConsoleTreeService=_;class s extends n.TreeNode{constructor(T,D){var I;super(new m(T.session,T.source,T.line),D,void 0,{name:String((I=T.session)===null||I===void 0?void 0:I.id)}),this.variablesReference=T.variablesReference||0,this.namedVariables=T.namedVariables,this.indexedVariables=T.indexedVariables,this.memoryReference=T.memoryReference,this.source=T.source,this.line=T.line}get badge(){return this.source?`${this.source.name}:${this.line}`:""}get displayName(){return this.name}}t.ExpressionNode=s;class g extends n.CompositeTreeNode{constructor(T,D,I,O){var M;super(I||new m(T.session,T.source,T.line),D,void 0,{name:O||((M=T.session)===null||M===void 0?void 0:M.id)}),this.session=T.session,this.variablesReference=T.variablesReference||0,this.namedVariables=T.namedVariables,this.indexedVariables=T.indexedVariables,this.startOfVariables=T.startOfVariables||0,this.memoryReference=T.memoryReference,this.source=T.source,this.line=T.line}get badge(){return this.source?`${this.source.name}:${this.line}`:""}get displayName(){return this.name}get path(){return this.parent?new c.Path(this.parent.path).join(String(this.id)).toString():String(this.id)}}t.ExpressionContainer=g,g.BASE_CHUNK_SIZE=100;class l extends g{constructor(T,D){super(T,D,void 0,T.name),this._name=T.name}}t.DebugVirtualVariable=l;class h extends s{constructor(T,D,I){super({session:T,variablesReference:D.variablesReference,namedVariables:D.namedVariables,indexedVariables:D.indexedVariables,memoryReference:D.memoryReference},I),this.session=T,this.variable=D}get variableMenuContext(){return this.variable.__vscodeVariableMenuContext||""}toDebugProtocolObject(){return{name:this.name,variablesReference:this.variable.variablesReference||0,value:this.value,evaluateName:this.evaluateName,memoryReference:this.memoryReference}}get name(){if(this.variable){if(this.variable.name)return this.variable.name;if(this.variable.evaluateName){const T=/\["(.+)"]/.exec(this.variable.evaluateName);if(T)return T[1];{const D=this.variable.evaluateName.split(".");return D[D.length-1]}}}return String(this.id)}get evaluateName(){var T;return((T=this.variable)===null||T===void 0?void 0:T.evaluateName)||""}get description(){return this.value||v}get value(){return this._value||this.variable.value}get variableType(){return this._type||this.variable.type}get supportSetVariable(){return!!this.session&&!!this.session.capabilities.supportsSetVariable}async setValue(T){if(!this.session||this.session.terminated)return;const{name:D,parent:I}=this,O=I.variablesReference;try{const M=await this.session.sendRequest("setVariable",{variablesReference:O,name:D,value:T});this._value=M.body.value,this._type=M.body.type,this.variablesReference=M.body.variablesReference||0,this.namedVariables=M.body.namedVariables,this.indexedVariables=M.body.indexedVariables}catch(M){throw M}}getRawScope(){let T=this.parent;for(;T!==void 0&&!(T instanceof d);)T=T?.parent;return T.getRawScope()}}t.DebugVariable=h;class u extends g{constructor(T,D,I,O,M){super({session:T,variablesReference:D.variablesReference,namedVariables:D.namedVariables,indexedVariables:D.indexedVariables,memoryReference:D.memoryReference,source:O,line:M},I,void 0,D?.name||(D.evaluateName?/\["(.+)"]/.exec(D.evaluateName)?/\["(.+)"]/.exec(D.evaluateName)[1]:D.evaluateName.split(".")[D.evaluateName.split(".").length-1]:"")),this.session=T,this.variable=D}get variableMenuContext(){return this.variable.__vscodeVariableMenuContext||""}toDebugProtocolObject(){return{name:this.name,variablesReference:this.variable.variablesReference||0,value:this.value,evaluateName:this.evaluateName,memoryReference:this.memoryReference}}get name(){if(this.variable){if(this.variable.name)return this.variable.name;if(this.variable.evaluateName){const T=/\["(.+)"]/.exec(this.variable.evaluateName);if(T)return T[1];{const D=this.variable.evaluateName.split(".");return D[D.length-1]}}}return this.variable.type||String(this.id)}get evaluateName(){var T;return((T=this.variable)===null||T===void 0?void 0:T.evaluateName)||""}get description(){return this._value||this.variable.value||v}get tooltip(){return this.variableType||this.description}get variableType(){return this._variableType||this.variable.type}get value(){return this._value||this.variable.value}get supportSetVariable(){return!!this.session&&!!this.session.capabilities.supportsSetVariable}async setValue(T){if(!this.session||this.session.terminated)return;const{name:D,parent:I}=this;if(!I)return;const O=I.variablesReference,M=await this.session.sendRequest("setVariable",{variablesReference:O,name:D,value:T});this._value=M.body.value,this._variableType=M.body.type,this.variablesReference=M.body.variablesReference||0,this.namedVariables=M.body.namedVariables,this.indexedVariables=M.body.indexedVariables}getRawScope(){let T=this.parent;for(;T!==void 0&&!(T instanceof d);)T=T?.parent;return T.getRawScope()}}t.DebugVariableContainer=u,u.BOOLEAN_REGEX=/^true|false$/i,u.STRING_REGEX=/^(['"]).*\1$/;class d extends g{constructor(T,D,I){super({session:D,variablesReference:T.variablesReference,namedVariables:T.namedVariables,indexedVariables:T.indexedVariables},I,void 0,T.name),this.raw=T,this.session=D}getRawScope(){return this.raw}range(){const T=this.getRawScope();return T.line&&T.column&&T.endLine&&T.endColumn?new p.Range(T.line,T.column,T.endLine,T.endColumn):void 0}}t.DebugScope=d;class E extends g{static is(T){return!!T&&!!T.expression}constructor(T,D,I){super({session:T},I,void 0,D),this.session=T,this.expression=D}get description(){return this._available?this._description||v:E.notAvailable}get available(){return this._available}getRawWatch(){return this.raw}async evaluate(T="watch"){if(this.session)try{this._available=!0;const{expression:D}=this,I=await this.session.evaluate(D,T);I&&(this.name=this.expression,this._description=I.result,this.variablesReference=I.variablesReference,this.namedVariables=I.namedVariables,this.indexedVariables=I.indexedVariables,this.memoryReference=I.memoryReference,this.raw=I)}catch(D){this.name=this.expression,this._description=D.message}else this.name=this.expression,this._available=!1}async getClipboardValue(){if(this.session&&this.session.capabilities.supportsValueFormattingOptions)try{const{expression:T}=this,D=await this.session.evaluate(T,"clipboard");if(D)return D.result}catch{return""}else return this._description}}t.DebugWatchNode=E,E.notAvailable=(0,r.localize)("debug.watch.notAvailable");class f extends u{static is(T){return!!T&&T.uniqueID===f.uniqueID}get uniqueID(){return f.uniqueID}get description(){return this.variable?this.variable.value:v}get tooltip(){return this.variable?this.variable.value:""}}t.DebugConsoleVariableContainer=f,f.uniqueID="DebugConsoleVariable";class a extends g{static is(T){return!!T&&!!T.expression}get available(){return this._available}constructor(T,D,I){super(T,I,void 0,D),this.options=T,this.expression=D,this._description=v}get description(){return this._description}async evaluate(T="repl"){const{expression:D}=this;if(this.session)try{if(typeof D=="string"&&D){const I=await this.session.evaluate(D,T);I&&(this.name=D,this._description=I.result,this.variablesReference=I.variablesReference,this.namedVariables=I.namedVariables,this.indexedVariables=I.indexedVariables,this.memoryReference=I.memoryReference,this._available=!0)}else if(this.options.variablesReference){const I=await this.session.variables(this.options.variablesReference);I.variables.length&&(this.name=I.variables.map(O=>O.value).join(`
|
|
31520
31520
|
`),this._description="",this._available=!0)}}catch(I){this._available=!1,this.name=D,this._description=I.message}else this._available=!1,this.name=D}}t.DebugConsoleNode=a;class b extends g{static is(T){return!!T&&!T.parent}constructor(T,D=[]){super({session:T},void 0,new _(T)),this.session=T,this.presetChildren=D}get expanded(){return!0}updatePresetChildren(T){this.presetChildren=T}}t.DebugConsoleRoot=b;class y extends g{static is(T){return!!T&&!T.parent}constructor(T,D=[]){super({session:T},void 0),this.session=T,this.presetChildren=D}get expanded(){return!0}updatePresetChildren(T){this.presetChildren=T}}t.DebugWatchRoot=y;class A extends u{static is(T){return!!T&&!T.parent}constructor(T){super(T,{},void 0),this.session=T}get expanded(){return!0}}t.DebugVariableRoot=A;class S extends g{constructor(T,D){super({session:D}),this.expression=T,this.session=D,this._value="",this._available=!1}get name(){return this._value}get available(){return this._available}async evaluate(T="repl"){if(this.session)try{const{expression:D}=this,I=await this.session.evaluate(D,T);I&&(this._value=I.result,this._available=!0,this.variablesReference=I.variablesReference,this.namedVariables=I.namedVariables,this.indexedVariables=I.indexedVariables,this.memoryReference=I.memoryReference)}catch(D){this._value=D.message,this._available=!1}else this._value="Please start a debug session to evaluate",this._available=!1}}t.DebugHoverVariableRoot=S},16170:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(98650),t),n.__exportStar(e(81450),t)},57332:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BreakpointsTreeNode=void 0;const n=e(43718),r=e(99797);class o{constructor(p,v){this.label="",this._onDescriptionChange=new n.Emitter;const{breakpoint:m}=v;this._uri=p,this.label=(0,r.isDebugBreakpoint)(m)?p.displayName:"",this.rawData=v,this.rawData.onDescriptionChange=this._onDescriptionChange.event}get breakpoint(){return this.rawData.breakpoint}get uri(){return this._uri}fireDescriptionChange(p){this.rawData.description=p,this._onDescriptionChange.fire(p)}}t.BreakpointsTreeNode=o},97319:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugBreakpointsService=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(26542),p=e(54414),v=e(57517),m=e(28423),_=e(51500),s=e(26199),g=e(64582),l=e(26296),h=e(99797),u=e(38029),d=e(32756),E=e(57332);let f=class extends o.WithEventBus{get inputEditor(){return this._inputEditor}constructor(){super(),this._onDidChangeBreakpointsTreeNode=new o.Emitter,this.onDidChangeBreakpointsTreeNode=this._onDidChangeBreakpointsTreeNode.event,this._onDidFocusedBreakpoints=new o.Emitter,this.onDidFocusedBreakpoints=this._onDidFocusedBreakpoints.event,this.treeNodeMap=new Map,this.enable=(0,m.observableValue)(this,!1),this.inDebugMode=(0,m.observableValue)(this,!1),this.toggleBreakpointEnable=b=>{if((0,h.isDebugBreakpoint)(b)){const y=this.breakpoints.getBreakpoint(o.URI.parse(b.uri),{lineNumber:b.raw.line,column:b.raw.column});y&&(y.enabled=!y.enabled,this.breakpoints.updateBreakpoint(y))}(0,h.isDebugExceptionBreakpoint)(b)&&this.breakpoints.updateExceptionBreakpoints(b.filter,!b.default)},this.init()}launchFocusedBreakpoints(b){this._onDidFocusedBreakpoints.fire(b)}async init(){await this.updateRoots(),this.workspaceService.onWorkspaceChanged(async()=>{this.updateRoots(),this.updateBreakpoints()}),this.breakpoints.onDidChangeBreakpoints(()=>{this.updateBreakpoints()}),this.breakpoints.onDidChangeExceptionsBreakpoints(()=>{this.updateBreakpoints()}),this.breakpoints.whenReady.then(()=>{this.updateBreakpoints()}),this.contextKeyService.onDidChangeContext(b=>{b.payload.affectsSome(new Set([g.CONTEXT_IN_DEBUG_MODE_KEY]))&&(0,m.transaction)(y=>{this.inDebugMode.set(this.contextKeyService.getContextKeyValue(g.CONTEXT_IN_DEBUG_MODE_KEY)||!1,y)})})}getBreakpointDecoration(b,y=!1,A=!0){return new h.DebugDecorator().getDecoration(b,y,A)}onRenameFile(b){this.removeBreakpoints(b.payload.oldUri)}onDeleteFile(b){this.removeBreakpoints(b.payload.oldUri)}removeBreakpoints(b){this.breakpoints.cleanAllMarkers(b),this.updateBreakpoints()}async updateRoots(){(0,m.transaction)(y=>{this.enable.set(this.breakpoints.breakpointsEnabled,y),this.inDebugMode.set(this.contextKeyService.getContextKeyValue(g.CONTEXT_IN_DEBUG_MODE_KEY)||!1,y)});const b=await this.workspaceService.roots;this.roots=b.map(y=>new o.URI(y.uri))}extractNodes(b){if((0,h.isDebugBreakpoint)(b))return{id:b.id,name:"",description:"",onDescriptionChange:o.Event.None,breakpoint:b};if((0,h.isDebugExceptionBreakpoint)(b))return{id:b.filter,name:b.label,onDescriptionChange:o.Event.None,description:"",breakpoint:b}}async updateBreakpoints(){await this.breakpoints.whenReady,this.treeNodeMap.clear(),[...this.breakpoints.getExceptionBreakpoints(),...this.breakpoints.getBreakpoints()].forEach(y=>{const A=this.extractNodes(y);if(A){const S=(0,h.isDebugBreakpoint)(y)?o.URI.parse(y.uri):h.EXCEPTION_BREAKPOINT_URI,w=this.treeNodeMap.get(S.toString())||[];w.push(new E.BreakpointsTreeNode(S,A)),this.treeNodeMap.set(S.toString(),w)}}),this._onDidChangeBreakpointsTreeNode.fire(this.treeNodeMap)}async getDocumentModelRef(b){const y=this.documentService.getModelReference(b);return y||this.documentService.createModelReference(b)}async refreshBreakpointsInfo(){const b=this.treeNodeMap.values(),y=Array.from(b).reduce((A,S)=>A.concat(S),[]);for await(const A of y){const{rawData:S,uri:w}=A;if((0,h.isDebugBreakpoint)(S.breakpoint)){const T=S.breakpoint.raw.line,D=await this.getDocumentModelRef(w);if(!D)return;const I=D.instance.getMonacoModel(),O=I.getLineCount();if(T>O)return;const M=I.getLineContent(T);A.fireDescriptionChange(M.trim()),D.dispose()}}}removeAllBreakpoints(){this.breakpoints.clearBreakpoints()}delBreakpoint(b){this.breakpoints.delBreakpoint(b)}toggleBreakpoints(){this.breakpoints.breakpointsEnabled=!this.breakpoints.breakpointsEnabled,(0,m.transaction)(b=>{this.enable.set(this.breakpoints.breakpointsEnabled,b)}),this.enable.get()?this.reporterService.point(g.DEBUG_REPORT_NAME===null||g.DEBUG_REPORT_NAME===void 0?void 0:g.DEBUG_REPORT_NAME.DEBUG_BREAKPOINT,"enabled"):this.reporterService.point(g.DEBUG_REPORT_NAME===null||g.DEBUG_REPORT_NAME===void 0?void 0:g.DEBUG_REPORT_NAME.DEBUG_BREAKPOINT,"unenabled")}async createBreakpointInput(b){this._inputEditor=await this.editorService.createCodeEditor(b,{...(0,p.getSimpleEditorOptions)(),lineHeight:21,scrollbar:{horizontal:"hidden",vertical:"hidden",handleMouseWheel:!1},acceptSuggestionOnEnter:"on",renderIndentGuides:!1});const A=(await this.documentService.createModelReference(new o.URI("debug/breakpoint/expression/input").withScheme(o.Schemes.walkThroughSnippet))).instance.getMonacoModel();return A.updateOptions({tabSize:2}),this._inputEditor.monacoEditor.setModel(A),Promise.resolve(this.inputEditor)}};t.DebugBreakpointsService=f,n.__decorate([(0,r.Autowired)(d.DebugViewModel),n.__metadata("design:type",d.DebugViewModel)],f.prototype,"model",void 0),n.__decorate([(0,r.Autowired)(_.IWorkspaceService),n.__metadata("design:type",Object)],f.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(h.BreakpointManager),n.__metadata("design:type",h.BreakpointManager)],f.prototype,"breakpoints",void 0),n.__decorate([(0,r.Autowired)(l.IDebugSessionManager),n.__metadata("design:type",u.DebugSessionManager)],f.prototype,"sessions",void 0),n.__decorate([(0,r.Autowired)(c.LabelService),n.__metadata("design:type",c.LabelService)],f.prototype,"labelProvider",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],f.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(o.IReporterService),n.__metadata("design:type",Object)],f.prototype,"reporterService",void 0),n.__decorate([(0,r.Autowired)(p.EditorCollectionService),n.__metadata("design:type",p.EditorCollectionService)],f.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(v.IEditorDocumentModelService),n.__metadata("design:type",Object)],f.prototype,"documentService",void 0),n.__decorate([(0,o.OnEvent)(s.WorkspaceEditDidRenameFileEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[s.WorkspaceEditDidRenameFileEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onRenameFile",null),n.__decorate([(0,o.OnEvent)(s.WorkspaceEditDidDeleteFileEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[s.WorkspaceEditDidDeleteFileEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onDeleteFile",null),t.DebugBreakpointsService=f=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],f)},85347:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BreakpointItem=t.BreakpointFileItem=t.DebugBreakpointView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(97267),p=e(41869),v=n.__importStar(e(20868)),m=e(64582),_=e(99797),s=n.__importDefault(e(96547)),g=e(97319),l=({viewState:d})=>{const E=(0,p.useInjectable)(g.DebugBreakpointsService),f=(0,o.useRef)(!1),[a,b]=(0,o.useState)([]),{enable:y,inDebugMode:A,toggleBreakpointEnable:S}=E,w=(0,p.useAutorun)(y),T=(0,p.useAutorun)(A),D=O=>{const{data:M,inDebugMode:R,breakpointEnabled:P}=O;if((0,_.isDebugBreakpoint)(M.breakpoint)){if(!(R?(0,_.isDebugBreakpoint)(M.breakpoint)&&(0,_.isRuntimeBreakpoint)(M.breakpoint):!0))return"sumi-debug-breakpoint-unverified";const{className:F}=E.getBreakpointDecoration(M.breakpoint,R,P);return F}return""},I=(0,o.useCallback)(O=>{const{roots:M}=E,R=[];O.forEach(([P,k],F)=>{var L;if(_.EXCEPTION_BREAKPOINT_URI.toString()===P)k.forEach((j,W)=>{R.push({label:"",order:F*100+W,expandable:!1,twisterPlaceholderClassName:s.default.tree_item_twister_placeholder_fill,children:[],description:o.default.createElement(t.BreakpointItem,{toggle:()=>S(j.breakpoint),data:j.rawData})})});else{const j=p.URI.parse(P),W=M.filter(V=>V.isEqualOrParent(j))[0],U=W?((L=W.relative(j))===null||L===void 0?void 0:L.toString())||"":p.URI.parse(P).displayName,Q=k.map(V=>V.breakpoint);R.push({label:U,order:F,twisterClassName:s.default.tree_item_twister,renderLabel:o.default.createElement(t.BreakpointFileItem,{label:U,breakpointItems:Q,title:j.toString()}),expandable:!0,expanded:!0,children:k.map(V=>({...V,label:"",expandable:!1,twisterClassName:s.default.tree_item_twister,twisterPlaceholderClassName:s.default.tree_item_twister_placeholder,breakpoint:V.breakpoint,iconClassName:(0,r.default)(D({data:V.rawData,inDebugMode:T,breakpointEnabled:w}),s.default.debug_breakpoints_icon),description:o.default.createElement(t.BreakpointItem,{toggle:()=>S(V.breakpoint),data:V.rawData})}))})}}),f.current||b(R)},[a]);return(0,o.useEffect)(()=>{const O=new p.Disposable;return I(Array.from(E.treeNodeMap.entries())),O.addDispose(E.onDidChangeBreakpointsTreeNode(M=>{I(Array.from(M.entries()))})),()=>{f.current=!0,O.dispose()}},[]),(0,o.useEffect)(()=>{a.length>0&&requestAnimationFrame(()=>{E.refreshBreakpointsInfo()})},[a]),o.default.createElement("div",{className:(0,r.default)(s.default.debug_breakpoints,!w&&s.default.debug_breakpoints_disabled)},o.default.createElement(c.BasicRecycleTree,{onIconClick:(O,M)=>{M.raw.breakpoint&&S(M.raw.breakpoint)},sortComparator:(O,M)=>{if(typeof O.order<"u"&&typeof M.order<"u")return O.order>M.order?1:O.order<M.order?-1:0},indent:18,baseIndent:8,treeData:a,height:d.height}))};t.DebugBreakpointView=l;const h=({label:d,title:E,breakpointItems:f})=>{const a=(0,p.useInjectable)(g.DebugBreakpointsService),b=(0,o.useMemo)(()=>f.some(T=>T.enabled),[f]),[y,A]=o.default.useState(b),S=(0,o.useCallback)(T=>{f.filter(I=>I.enabled===T).forEach(I=>{a.toggleBreakpointEnable(I)}),A(!y)},[y]),w=(0,o.useCallback)(T=>{T.stopPropagation(),f.forEach(D=>{a.delBreakpoint(D)})},[]);return o.default.createElement("div",{className:s.default.debug_breakpoints_file_item},o.default.createElement("div",{className:s.default.file_item_control},o.default.createElement(c.CheckBox,{className:(0,r.default)(s.default.debug_breakpoints_icon,s.default.file_item_checkbox),onChange:()=>S(y),checked:y}),o.default.createElement("i",{className:(0,r.default)((0,p.getIcon)("file-text"),s.default.file_item_icon,s.default.debug_breakpoints_icon)}),o.default.createElement("span",{title:E},d)),o.default.createElement("div",{className:s.default.file_item_control_right},o.default.createElement("i",{className:(0,r.default)((0,p.getIcon)("close"),s.default.close_icon),onClick:T=>w(T)})))};t.BreakpointFileItem=h;const u=({data:d,toggle:E})=>{const f=(0,_.isDebugBreakpoint)(d.breakpoint)?d.breakpoint.enabled:!!d.breakpoint.default,a=(0,p.useInjectable)(m.IDebugSessionManager),b=(0,p.useInjectable)(p.CommandService),y=(0,p.useInjectable)(g.DebugBreakpointsService),[A,S]=o.default.useState(f),[w,T]=o.default.useState(void 0),[D,I]=o.default.useState(d.description),O=(0,o.useMemo)(()=>{const L={preview:!0,focus:!0};if(!(0,_.isDebugBreakpoint)(d.breakpoint))return L;if(w)L.range={startColumn:w.column||0,endColumn:w.column||0,startLineNumber:w.line,endLineNumber:w.line};else{const{raw:B}=d.breakpoint;L.range={startColumn:B.column||0,endColumn:B.column||0,startLineNumber:B.line,endLineNumber:B.line}}return L},[w,d.breakpoint]),M=()=>{E(),S(!A)},R=async()=>{d.breakpoint.uri&&(await b.executeCommand(p.EDITOR_COMMANDS.OPEN_RESOURCE.id,new p.URI(d.breakpoint.uri),O),y.launchFocusedBreakpoints({uri:new p.URI(d.breakpoint.uri),range:O.range}))};o.default.useEffect(()=>{const L=new p.Disposable,B=()=>{if((0,_.isDebugBreakpoint)(d.breakpoint)&&(0,_.isRuntimeBreakpoint)(d.breakpoint)){const j=(0,_.getStatus)(d.breakpoint);T(j)}};return L.addDispose(a.onDidChangeActiveDebugSession(()=>B())),B(),L.addDispose(d.onDescriptionChange(I)),()=>{T(void 0),L.dispose()}},[]);const P=L=>{L.stopPropagation(),y.delBreakpoint(d.breakpoint)},k=async L=>{L.stopPropagation(),await b.executeCommand(p.EDITOR_COMMANDS.OPEN_RESOURCE.id,new p.URI(d.breakpoint.uri),O);const{range:B}=O,j=new v.Position(B?.startLineNumber||1,B?.startColumn||1);await b.executeCommand(m.DEBUG_COMMANDS.EDIT_BREAKPOINT.id,j)},F=(0,o.useMemo)(()=>D?o.default.createElement("span",{className:s.default.debug_breakpoints_description},D):(0,_.isDebugBreakpoint)(d.breakpoint)?o.default.createElement("span",{className:(0,r.default)(s.default.debug_breakpoints_description,s.default.blank)},`< ${(0,p.localize)("debug.breakpoint.blank")} >`):null,[D,d.breakpoint]);return o.default.createElement("div",{className:(0,r.default)(s.default.debug_breakpoints_item)},o.default.createElement(c.CheckBox,{className:s.default.debug_breakpoints_icon,id:d.id,onChange:M,checked:A}),o.default.createElement("div",{className:s.default.debug_breakpoints_wrapper,onClick:R},d.name&&o.default.createElement("span",{className:s.default.debug_breakpoints_name},d.name),F),(0,_.isDebugBreakpoint)(d.breakpoint)?o.default.createElement(o.default.Fragment,null,o.default.createElement("div",{className:s.default.debug_breakpoints_item_control},O.range&&o.default.createElement("i",{title:(0,p.localize)("debug.menu.edit.breakpoint"),onClick:L=>k(L),className:(0,r.default)(s.default.debug_edit_breakpoints_icon,(0,p.getExternalIcon)("edit"))}),o.default.createElement("i",{title:(0,p.localize)("debug.menu.delete.breakpoint"),onClick:L=>P(L),className:(0,r.default)(s.default.debug_remove_breakpoints_icon,(0,p.getIcon)("close"))})),o.default.createElement(c.Badge,{className:s.default.debug_breakpoints_badge},d.breakpoint.raw.line,!!d.breakpoint.raw.column&&`:${d.breakpoint.raw.column}`)):null)};t.BreakpointItem=u},16067:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConfigurationService=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(28423),p=e(51500),v=e(68810),m=e(64582),_=e(26296),s=e(37499),g=e(38029),l=e(35199),h=e(32756);let u=class{constructor(){this.currentValue=(0,c.observableValue)(this,m.DEFAULT_ADD_CONFIGURATION_KEY),this.float=(0,c.observableValue)(this,!1),this.configurationOptions=(0,c.observableValue)(this,[]),this.dynamicConfigurations=(0,c.observableValue)(this,[]),this.isMultiRootWorkspace=(0,c.observableValue)(this,!1),this.workspaceRoots=(0,c.observableValue)(this,[]),this.start=async()=>{const E=this.debugConfigurationManager.current;E?this.debugSessionManager.start(E):this.debugConfigurationManager.addConfiguration()},this.openConfiguration=()=>{const{current:E}=this.debugConfigurationManager,f=E?.workspaceFolderUri;this.debugConfigurationManager.openConfiguration(f)},this.openLaunchEditor=()=>{this.debugConfigurationManager.openLaunchEditor()},this.openDebugConsole=()=>{this.debugConsoleService.activate()},this.addConfiguration=E=>{this.debugConfigurationManager.addConfiguration(typeof E=="string"?E:void 0)},this.getLaunchUri=()=>{const E=this.workspaceVariables.getWorkspaceRootUri();return new o.URI(E.toString()).resolve(`${this.preferenceConfigurations.getPaths()[0]}/launch.json`)},this.insertConfiguration=E=>{this.debugConfigurationManager.insertConfiguration(this.getLaunchUri(),E)},this.showDynamicQuickPickToInsert=async()=>{const E=await this.debugConfigurationManager.showDynamicConfigurationsTypesQuickPick();if(E){const f=await this.debugConfigurationManager.showDynamicConfigurationsQuickPick(E);f&&this.insertConfiguration(f)}},this.getDynamicSupportTypes=async()=>await this.debugConfigurationManager.getDynamicConfigurationsSupportTypes(),this.updateConfiguration=(E,f,a)=>{this.debugConfigurationManager.current=this.debugConfigurationManager.find(E,f,a)},this.showDynamicQuickPick=async E=>{const f=await this.debugConfigurationManager.showDynamicConfigurationsQuickPick(E);f&&this.debugSessionManager.start({configuration:f,workspaceFolderUri:this.workspaceRoots.get()[0],index:-1})},this.toName=({configuration:E,workspaceFolderUri:f})=>!f||!this.workspaceService.isMultiRootWorkspaceEnabled?E.name:E.name+" ("+new o.URI(f).path.base+")",this._whenReady=this.init()}get whenReady(){return this._whenReady}async init(){await this.debugConfigurationManager.whenReady,await this.updateConfigurationOptions(),this.debugConfigurationManager.onDidChange(async()=>{this.updateConfigurationOptions()}),this.preferenceService.onPreferenceChanged(E=>{const{preferenceName:f,newValue:a}=E;f==="debug.toolbar.float"&&this.float.get()!==a&&this.updateFloat(a)}),this.eventBus.on(m.DebugConfigurationsReadyEvent,()=>{this.updateDynamicConfigurations()}),await this.updateWorkspaceState(),this.workspaceService.onWorkspaceChanged(async()=>{await this.updateWorkspaceState()}),this.updateFloat(!!this.preferenceService.get("debug.toolbar.float"))}async updateWorkspaceState(){const E=(await this.workspaceService.tryGetRoots()).map(f=>f.uri);(0,c.transaction)(f=>{this.isMultiRootWorkspace.set(this.workspaceService.isMultiRootWorkspaceOpened,f),this.workspaceRoots.set(E,f)})}async updateDynamicConfigurations(){const E=await this.debugConfigurationManager.getDynamicConfigurationsSupportTypes();(0,c.transaction)(f=>{this.dynamicConfigurations.set(E,f)})}updateFloat(E){this.float.set(E,void 0)}updateCurrentValue(E){(0,c.transaction)(f=>{this.currentValue.set(E,f)})}async updateConfigurationOptions(){(0,c.transaction)(f=>{this.configurationOptions.set(this.debugConfigurationManager.all,f)});const{current:E}=this.debugConfigurationManager;if(E){const f=this.toValue(E);this.updateCurrentValue(f)}else this.updateCurrentValue(m.DEFAULT_ADD_CONFIGURATION_KEY);this.updateDynamicConfigurations()}toValue({configuration:E,workspaceFolderUri:f,index:a}){if(!f)return E.name;if((0,o.isUndefined)(a)){const b=this.debugConfigurationManager.find(E.name,f);return b&&b.index?this.toValue(b):this.currentValue.get()}return E.name+m.DEFAULT_CONFIGURATION_NAME_SEPARATOR+f+m.DEFAULT_CONFIGURATION_INDEX_SEPARATOR+a}};t.DebugConfigurationService=u,n.__decorate([(0,r.Autowired)(p.IWorkspaceService),n.__metadata("design:type",Object)],u.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(s.DebugConfigurationManager),n.__metadata("design:type",s.DebugConfigurationManager)],u.prototype,"debugConfigurationManager",void 0),n.__decorate([(0,r.Autowired)(_.IDebugSessionManager),n.__metadata("design:type",g.DebugSessionManager)],u.prototype,"debugSessionManager",void 0),n.__decorate([(0,r.Autowired)(h.DebugViewModel),n.__metadata("design:type",h.DebugViewModel)],u.prototype,"debugViewModel",void 0),n.__decorate([(0,r.Autowired)(l.DebugConsoleService),n.__metadata("design:type",l.DebugConsoleService)],u.prototype,"debugConsoleService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],u.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(v.WorkspaceVariableContribution),n.__metadata("design:type",v.WorkspaceVariableContribution)],u.prototype,"workspaceVariables",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceConfigurations),n.__metadata("design:type",o.PreferenceConfigurations)],u.prototype,"preferenceConfigurations",void 0),n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],u.prototype,"eventBus",void 0),t.DebugConfigurationService=u=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],u)},20676:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugControllerView=t.DebugConfigurationContainerView=t.DebugActionBar=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=e(97267),p=e(41869),v=e(77331),m=e(64582),_=e(66498),s=n.__importDefault(e(90463)),g=e(16067),l=e(84784),h=o.default.memo(({currentValue:E,options:f,dynamicOptions:a,onChangeConfiguration:b,isMultiRootWorkspace:y,addConfigurationLabel:A,editConfigurationLabel:S,toValue:w,workspaceRoots:T,isElectronRenderer:D})=>{const I=o.default.useCallback(R=>R&&R.length?R.map((P,k)=>{const F=y?`${P.configuration.name} (${new p.URI(P.workspaceFolderUri).displayName})`:P.configuration.name;return D?o.default.createElement("option",{key:k,value:w(P),label:F},F):o.default.createElement(c.Option,{key:k,value:w(P),label:F},F)}):D?[o.default.createElement("option",{value:m.DEFAULT_NO_CONFIGURATION_KEY,key:m.DEFAULT_NO_CONFIGURATION_KEY,label:(0,p.localize)("debug.action.no.configuration")},(0,p.localize)("debug.action.no.configuration"))]:[o.default.createElement(c.Option,{value:m.DEFAULT_NO_CONFIGURATION_KEY,key:m.DEFAULT_NO_CONFIGURATION_KEY,label:(0,p.localize)("debug.action.no.configuration")},(0,p.localize)("debug.action.no.configuration"))],[y]),O=o.default.useCallback(()=>{if(y){let R=A;const P=T.map((F,L)=>{const B=`${A} (${new p.URI(F).displayName})`;return R.length<B.length&&(R=B),D?o.default.createElement("option",{value:`${m.DEFAULT_ADD_CONFIGURATION_KEY}${L}`,key:`${m.DEFAULT_ADD_CONFIGURATION_KEY}${L}`,label:B},B):o.default.createElement(c.Option,{value:`${m.DEFAULT_ADD_CONFIGURATION_KEY}${L}`,key:`${m.DEFAULT_ADD_CONFIGURATION_KEY}${L}`,label:B},B)});return(D?[o.default.createElement("option",{disabled:!0,key:"--",value:R.replace(/./g,"-")},R.replace(/./g,"-"))]:[o.default.createElement(c.Option,{disabled:!0,key:"--",value:"",className:s.default.select_divider_container})]).concat(P)}else{const R=A;return D?[o.default.createElement("option",{disabled:!0,key:"--",value:R.replace(/./g,"-")},R.replace(/./g,"-")),o.default.createElement("option",{value:m.DEFAULT_ADD_CONFIGURATION_KEY,key:m.DEFAULT_ADD_CONFIGURATION_KEY,label:R},R),o.default.createElement("option",{value:m.DEFAULT_EDIT_CONFIGURATION_KEY,key:m.DEFAULT_EDIT_CONFIGURATION_KEY,label:S},S)]:[o.default.createElement(c.Option,{disabled:!0,key:"--",value:R.replace(/./g,"-"),className:s.default.select_divider_container}),o.default.createElement(c.Option,{value:m.DEFAULT_ADD_CONFIGURATION_KEY,key:m.DEFAULT_ADD_CONFIGURATION_KEY,label:R},R),o.default.createElement(c.Option,{value:m.DEFAULT_EDIT_CONFIGURATION_KEY,key:m.DEFAULT_EDIT_CONFIGURATION_KEY,label:S},S)]}},[y,A]),M=o.default.useCallback(R=>{if(!y&&R&&R.length)return R.map(k=>{const F=k.label||k.type,L=`${m.DEFAULT_DYNAMIC_CONFIGURATION_KEY}${k.type}`,{popupHint:B}=k;return D?o.default.createElement("option",{key:L,value:L,label:F},F):o.default.createElement(c.Option,{key:L,value:L,label:F},B?o.default.createElement(c.Popover,{id:`debug_configuration_pop_${L}`,title:B,overlayClassName:s.default.config_popover_insert},F):F)})},[y,a]);return D?o.default.createElement(v.Select,{value:E,onChange:b,className:(0,r.default)(s.default.debug_selection,s.default.special_radius)},I(f),O(),a&&M(a)):o.default.createElement(c.Select,{value:E,onChange:b,className:(0,r.default)(s.default.debug_selection,s.default.special_radius),allowOptionsOverflow:!0},I(f),O(),a&&M(a))});t.DebugActionBar=o.default.memo(({runDebug:E,openConfiguration:f,openDebugConsole:a})=>o.default.createElement("div",{className:s.default.debug_actions},o.default.createElement(_.DebugAction,{id:"debug.action.start",icon:"start",label:(0,p.localize)("debug.action.start"),run:E}),o.default.createElement(_.DebugAction,{id:"debug.action.open.configuration",icon:"setting",label:(0,p.localize)("debug.action.open.configuration"),run:f}),o.default.createElement(_.DebugAction,{id:"debug.action.debug.console",icon:"terminal",label:(0,p.localize)("debug.action.debug.console"),run:a})));const u=()=>{const E=(0,p.useInjectable)(g.DebugConfigurationService),f=(0,p.useAutorun)(E.float);return o.default.createElement(o.default.Fragment,null,o.default.createElement(t.DebugControllerView,{className:s.default.debug_configuration_container}),!f&&o.default.createElement(l.DebugToolbarView,{float:!1,className:s.default.debug_action_bar_internal}))};t.DebugConfigurationContainerView=u;const d=E=>{const{toValue:f,openConfiguration:a,addConfiguration:b,openDebugConsole:y,updateConfiguration:A,start:S,showDynamicQuickPick:w,currentValue:T,configurationOptions:D,dynamicConfigurations:I,isMultiRootWorkspace:O,workspaceRoots:M}=(0,p.useInjectable)(g.DebugConfigurationService),R=(0,p.useAutorun)(I),P=(0,p.useAutorun)(T),k=(0,p.useAutorun)(D),F=(0,p.useAutorun)(O),L=(0,p.useAutorun)(M),B=(0,p.useInjectable)(p.AppConfig),j=(0,p.localize)("debug.action.add.configuration"),W=(0,p.localize)("debug.action.edit.configuration"),{CustomActionBar:U}=E,Q=o.default.useCallback(V=>{let $;if(typeof V=="object"?$=V.target.value:$=V,$.startsWith(m.DEFAULT_ADD_CONFIGURATION_KEY)){const Y=$.slice(m.DEFAULT_ADD_CONFIGURATION_KEY.length);b(Y?M[Y]:M[0])}else if($===m.DEFAULT_EDIT_CONFIGURATION_KEY)a();else if($.startsWith(m.DEFAULT_DYNAMIC_CONFIGURATION_KEY)){const Y=$.slice(m.DEFAULT_DYNAMIC_CONFIGURATION_KEY.length);w(Y)}else{const[Y,z]=$.split(m.DEFAULT_CONFIGURATION_NAME_SEPARATOR),[H,K]=z.split(m.DEFAULT_CONFIGURATION_INDEX_SEPARATOR);A(Y,H,+K)}},[]);return o.default.createElement("div",{className:(0,r.default)(s.default.debug_configuration_toolbar,E.className||"")},o.default.createElement(h,{currentValue:P,options:k,dynamicOptions:R,workspaceRoots:L,isMultiRootWorkspace:F,onChangeConfiguration:Q,addConfigurationLabel:j,editConfigurationLabel:W,toValue:f,isElectronRenderer:B.isElectronRenderer}),U?o.default.createElement(U,null):o.default.createElement(t.DebugActionBar,{runDebug:S,openConfiguration:a,openDebugConsole:y}))};t.DebugControllerView=d},96090:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugToolbarService=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(93899),p=e(37406),v=e(28423),m=e(64582),_=e(32756);let s=class{constructor(){this.state=(0,v.observableValue)(this,m.DebugState.Inactive),this.currentSession=(0,v.observableValue)(this,void 0),this.sessions=(0,v.observableValue)(this,[]),this.toolBarMenuMap=new Map,this.doStart=async()=>await this.model.start(),this.doRestart=async()=>{const l=this.instrumentReporter("restart"),h=await this.model.restart();return l(),h},this.doStop=async()=>{if(!this.model.currentSession)return;const l=this.instrumentReporter("stop"),h=await this.model.currentSession.terminate();return l(),h},this.doContinue=async()=>{if(!this.model.currentThread)return;const l=this.instrumentReporter("continue"),h=await this.model.currentThread.continue();return l(),h},this.doPause=async()=>{if(!this.model.currentThread)return;const l=this.instrumentReporter("pause"),h=await this.model.currentThread.pause();return l(),h},this.doStepOver=async()=>{if(!this.model.currentThread)return;const l=this.instrumentReporter("stepOver"),h=await this.model.currentThread.stepOver();return l(),h},this.doStepIn=async()=>{if(!this.model.currentThread)return;const l=this.instrumentReporter("stepIn"),h=await this.model.currentThread.stepIn();return l(),h},this.doStepOut=async()=>{if(!this.model.currentThread)return;const l=this.instrumentReporter("stepOut"),h=await this.model.currentThread.stepOut();return l(),h},this.updateCurrentSession=l=>{this.model.currentSession=l},this.model.onDidChange(()=>{this.updateToolBarMenu(),this.updateModel()})}get mainUIService(){return this.injector.get(p.IElectronMainUIService)}updateModel(){(0,v.transaction)(l=>{this.state.set(this.model.state,l),this.currentSession.set(this.model.currentSession,l),this.sessions.set(Array.from(this.model.sessions).filter(h=>h&&h.state>m.DebugState.Inactive),l)})}updateToolBarMenu(){const l=this.currentSession.get();if(l&&l.id&&!this.toolBarMenuMap.has(l.id)){const h=this.contextMenuService.createMenu({id:c.MenuId.DebugToolBar,contextKeyService:this.contextKeyService.createScoped()});l.on("terminated",()=>{this.toolBarMenuMap.delete(l.id)}),this.toolBarMenuMap.set(l.id,h)}}instrumentReporter(l){var h,u,d,E;const f=this.model.currentSession,a=(h=f.configuration)===null||h===void 0?void 0:h.type,b=this.model.currentThread,y=(u=b?.raw)===null||u===void 0?void 0:u.id;this.model.reportAction(f.id,y,l);const A={type:a,request:(E=(d=this.currentSession.get())===null||d===void 0?void 0:d.configuration)===null||E===void 0?void 0:E.request,sessionId:f.id,threadId:y};this.model.report(m.DEBUG_REPORT_NAME.DEBUG_TOOLBAR_OPERATION,l,A);const S=this.model.reportTime(m.DEBUG_REPORT_NAME.DEBUG_TOOLBAR_OPERATION_TIME,A);return()=>{S(l)}}};t.DebugToolbarService=s,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],s.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(c.AbstractContextMenuService),n.__metadata("design:type",c.AbstractContextMenuService)],s.prototype,"contextMenuService",void 0),n.__decorate([(0,r.Autowired)(_.DebugViewModel),n.__metadata("design:type",_.DebugViewModel)],s.prototype,"model",void 0),n.__decorate([(0,r.Autowired)(o.IReporterService),n.__metadata("design:type",Object)],s.prototype,"reporterService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],s.prototype,"injector",void 0),n.__decorate([o.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],s.prototype,"mainUIService",null),t.DebugToolbarService=s=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],s)},84784:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugToolbarOverlayWidget=t.DebugToolbarView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(76003),p=e(97267),v=e(41869),m=e(25918),_=e(77331),s=e(1149),g=e(28423),l=e(64582),h=e(66498),u=e(5905),d=n.__importDefault(e(90463)),E=e(16067),f=e(96090);let a=class{constructor(){this._x=(0,g.observableValue)(this,0),this._line=(0,g.observableValue)(this,0),this._enable=(0,g.observableValue)(this,!1),this.y=0,this.last=0,this.origin=0,this.state=(0,g.derived)(this,D=>({enable:this._enable.read(D),x:this._x.read(D),line:this._line.read(D)}))}setEnable(D){(0,g.transaction)(I=>{this._enable.set(D,I)})}onMouseDown(D){this.setEnable(!0),this.y=D.clientY,this.origin=D.clientX}onMouseMove(D){D.stopPropagation(),(0,g.transaction)(I=>{this._enable.get()&&(this._x.set(D.clientX-this.origin+this.last,I),this._line.set(D.clientY-this.y>10?1:0,I))})}onMouseUp(){this.setEnable(!1),this.last=this._x.get()}};a=n.__decorate([(0,c.Injectable)()],a);const b=T=>{var D;const{state:I,toolBarMenuMap:O,doStop:M,doStepIn:R,doStepOut:P,doStepOver:k,doContinue:F,doRestart:L,doPause:B,currentSession:j,sessions:W,updateCurrentSession:U}=(0,v.useInjectable)(f.DebugToolbarService),Q=(0,v.useAutorun)(I),V=(0,v.useAutorun)(j),$=(0,v.useAutorun)(W),{isElectronRenderer:Y}=(0,v.useInjectable)(v.AppConfig),z=!!V&&((D=V.configuration)===null||D===void 0?void 0:D.request)==="attach"&&!(0,u.isExtensionHostDebugging)(V.configuration),H=V&&V.id,K=(0,o.useCallback)(pe=>{if(pe&&pe.id){const q=O.get(pe.id);if(q)return o.default.createElement(m.InlineMenuBar,{menus:q})}return null},[O]),Z=(0,o.useCallback)(pe=>z?o.default.createElement(h.DebugAction,{run:M,enabled:pe!==l.DebugState.Inactive,icon:"disconnect",label:(0,v.localize)("debug.action.disattach")}):o.default.createElement(h.DebugAction,{run:M,enabled:pe!==l.DebugState.Inactive,icon:"stop",label:(0,v.localize)("debug.action.stop")}),[M]),X=(0,o.useCallback)(pe=>pe===l.DebugState.Stopped?o.default.createElement(h.DebugAction,{run:F,icon:"continue",label:(0,v.localize)("debug.action.continue")}):o.default.createElement(h.DebugAction,{run:B,enabled:Q===l.DebugState.Running,icon:"pause",label:(0,v.localize)("debug.action.pause")}),[B,F]),ie=(0,o.useCallback)(pe=>pe.map(q=>Y?o.default.createElement("option",{key:q.id,value:q.id},q.label):o.default.createElement(p.Option,{key:q.id,label:q.label,value:q.id},q.label)),[]),oe=(0,o.useCallback)(pe=>{if(pe.length>1)return o.default.createElement("div",{className:(0,r.default)(d.default.debug_selection)},Y?o.default.createElement(_.Select,{value:H,onChange:le},ie(pe)):o.default.createElement(p.Select,{className:(0,r.default)(d.default.debug_selection,d.default.special_radius),size:T.float?"small":"default",value:H,options:pe.map(q=>({label:q.label,value:q.id})),onChange:le},ie(pe)))},[H]),le=(0,o.useCallback)(pe=>{let q=pe;if(Y&&(q=pe.target.value),!!$)for(const Ee of $)Ee.id===q&&U(Ee)},[$,U]);return o.default.createElement("div",{className:(0,r.default)(d.default.debug_action_bar,T.className||"")},oe($.filter(pe=>!pe.parentSession)),o.default.createElement("div",{className:d.default.debug_actions},X(Q),o.default.createElement(h.DebugAction,{run:k,enabled:Q===l.DebugState.Stopped,icon:"step",label:(0,v.localize)("debug.action.step-over")}),o.default.createElement(h.DebugAction,{run:R,enabled:Q===l.DebugState.Stopped,icon:"step-in",label:(0,v.localize)("debug.action.step-into")}),o.default.createElement(h.DebugAction,{run:P,enabled:Q===l.DebugState.Stopped,icon:"step-out",label:(0,v.localize)("debug.action.step-out")}),o.default.createElement(h.DebugAction,{run:L,enabled:Q!==l.DebugState.Inactive,icon:"reload",label:(0,v.localize)("debug.action.restart")}),Z(Q),K(V)))};t.DebugToolbarView=b;const y="debug.toolbar.top",A="debug.toolbar.height",S=()=>{const T=(0,v.useInjectable)(v.PreferenceService),{isElectronRenderer:D}=(0,v.useInjectable)(v.AppConfig),I=(0,v.useInjectable)(s.LayoutViewSizeConfig),O=(0,v.useDesignStyles)(d.default.debug_toolbar_wrapper,"debug_toolbar_wrapper"),[M,R]=(0,o.useState)(0),P=(0,v.useInjectable)(a),k=(0,v.useAutorun)(P.state),F=(0,v.useInjectable)(f.DebugToolbarService),L=(0,v.useAutorun)(F.state);(0,o.useEffect)(()=>{const W=new v.DisposableCollection,U=T.get(y)||0;if(D){const Q=F.mainUIService;Q.isFullScreen(v.electronEnv.currentWindowId).then(V=>{R(V?U:U+I.calcOnlyTitleBarHeight())}),W.push(Q.on("fullScreenStatusChange",(V,$)=>{V===v.electronEnv.currentWindowId&&R($?U:U+I.calcOnlyTitleBarHeight())}))}else R(U);return()=>{W.dispose()}},[]);const B=T.get(A)||0,j=(0,r.default)({[O]:!0,[d.default.debug_toolbar_wrapper_electron]:D});return L?o.default.createElement("div",{style:{pointerEvents:k.enable?"all":"none"},className:d.default.debug_toolbar_container,onMouseMove:W=>P.onMouseMove(W),onMouseUp:W=>P.onMouseUp()},o.default.createElement("div",{style:{transform:`translateX(${k.x}px) translateY(${M+k.line*B}px)`,height:`${B}px`},className:j},o.default.createElement("div",{className:(0,r.default)(d.default.debug_toolbar_drag_wrapper)},o.default.createElement("div",{className:(0,r.default)((0,v.getIcon)("drag"),d.default.debug_toolbar_drag),onMouseDown:W=>P.onMouseDown(W),onMouseMove:W=>P.onMouseMove(W)})),o.default.createElement(t.DebugToolbarView,{float:!0}))):(P.setEnable(!1),null)},w=()=>{const T=(0,v.useInjectable)(E.DebugConfigurationService);return(0,v.useAutorun)(T.float)?o.default.createElement(S,null):null};t.DebugToolbarOverlayWidget=w},53378:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleFilterModel=void 0;const r=e(85608),o=e(76003),c=e(41869);let p=n=class{constructor(){this._parsedQueries=[]}set filterQuery(m){if(this._parsedQueries=[],m=m.trim(),m&&m!==""){const _=(0,c.splitGlobAware)(m,",").map(s=>s.trim()).filter(s=>!!s.length);for(const s of _)s.startsWith("!")?this._parsedQueries.push({type:"exclude",query:s.slice(1)}):this._parsedQueries.push({type:"include",query:s})}}filter(m){let _=!1,s=!1;for(const{type:g,query:l}of this._parsedQueries){if(g==="exclude"&&n.matchQuery(l,m))return!1;g==="include"&&(_=!0,n.matchQuery(l,m)&&(s=!0))}return _&&s}};t.DebugConsoleFilterModel=p,p.matchQuery=c.matchesFuzzy,t.DebugConsoleFilterModel=p=n=r.__decorate([(0,o.Injectable)({multiple:!0})],p)},1276:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleFilterService=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(5905),p=e(53378),v=e(62665),{convertSimple2RegExpPattern:m}=o.strings;let _=class{constructor(){this._onDidValueChange=new o.Emitter,this._onDidFocus=new o.Emitter,this._filterText="",this.filterModel=new p.DebugConsoleFilterModel}get onDidValueChange(){return this._onDidValueChange.event}get onDidFocus(){return this._onDidFocus.event}focusInput(){this._onDidFocus.fire()}get filterText(){return this._filterText}setFilterText(g){return this._filterText!==g&&(this._filterText=g,this.filterModel.filterQuery=this._filterText,this._onDidValueChange.fire(this._filterText)),this}filter(g){const l=v.ansiToText(g);return this._filterText===""||this.filterModel.filter(l)}findMatches(g){const l=new RegExp(m(this._filterText.toLowerCase()),"g");if(this._filterText.trim()==="")return[];const h=(0,c.matchAll)(g.toLowerCase(),l),u=this._filterText.length;return u===0?[]:h.map(E=>({startIndex:E.index!==void 0?E.index:-1,count:u})).filter(E=>E.startIndex>=0)}};t.DebugConsoleFilterService=_,t.DebugConsoleFilterService=_=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],_)},4161:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleFilterView=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=n.__importDefault(e(14041)),c=e(15857),p=e(41869),v=e(1276),m=n.__importDefault(e(80315)),_=()=>{const s=(0,p.useInjectable)(v.DebugConsoleFilterService),[g,l]=o.default.useState(""),[h,u]=o.default.useState(),d=(0,p.useDesignStyles)(m.default.debug_console_filter,"debug_console_filter"),E=(0,p.useDesignStyles)(m.default.filter_input,"filter_input"),f=(0,r.default)(y=>{l(y),s.setFilterText(y),h&&h.addToHistory(y)},400);o.default.useEffect(()=>{const y=s.onDidValueChange(A=>{l(A)});return()=>{y.dispose()}},[]);const a=y=>{u(y)},b=y=>{h&&(y.keyCode===p.Key.ARROW_UP.keyCode?h.showPreviousValue():y.keyCode===p.Key.ARROW_DOWN.keyCode&&h.showNextValue())};return o.default.useEffect(()=>{const y=s.onDidFocus(()=>{h&&h.focus()});return()=>{y.dispose()}},[h]),o.default.createElement("div",{className:d},o.default.createElement(c.HistoryInputBox,{hasClear:!0,className:E,value:g,placeholder:(0,p.localize)("debug.console.filter.placeholder"),onValueChange:f,onReady:a,onKeyDown:b}))};t.DebugConsoleFilterView=_},80390:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleTreeModel=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(98650);let m=n=class extends c.TreeModel{constructor(s){super(),this.flushDispatchChangeDelayer=new p.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this._tempScrollOffset=0,this.init(s)}get isScrollBottom(){return this._tempScrollOffset=Math.max(this.state.scrollOffset,this._tempScrollOffset),this._tempScrollOffset===this.state.scrollOffset}init(s){this.root=s,this.root.watcher.on(c.TreeNodeEvent.BranchDidUpdate,()=>{this.flushDispatchChangeDelayer.isTriggered()||this.flushDispatchChangeDelayer.cancel(),this.flushDispatchChangeDelayer.trigger(async()=>{this.dispatchChange()})})}};t.DebugConsoleTreeModel=m,m.DEFAULT_FLUSH_DELAY=100,t.DebugConsoleTreeModel=m=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[v.ExpressionContainer])],m)},75563:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleSession=void 0;const n=e(85608),r=n.__importDefault(e(97331)),o=e(76003),c=e(43718),p=e(52416),v=e(92679),m=e(58542),_=e(29539),s=e(16170),g=e(80390);let l=class{constructor(u,d){this.session=u,this.treeModel=d,this.toDispose=new c.DisposableCollection,this.fireDidChange=(0,r.default)(()=>this.onDidChangeEmitter.fire(),50),this.onDidChangeEmitter=new c.Emitter,this.init()}resolveChildren(){return(this.treeModel.root.flattenedBranch||[]).map(d=>this.treeModel.root.getTreeNodeById(d))}getLastItem(){const{flattenedBranch:u}=this.treeModel.root,d=u?.length?u[u.length-1]:void 0;return d?this.treeModel.root.getTreeNodeById(d):void 0}init(){this.toDispose.push(this.session.on("output",u=>this.logOutput(this.session,u)))}addChildSession(u){this.toDispose.push(u.on("output",d=>this.logOutput(u,d)))}get onDidChange(){return this.onDidChangeEmitter.event}clear(){this.fireDidChange()}async logOutput(u,d){var E;const f="\x1B[2J",a=d.body,{category:b,variablesReference:y,source:A,line:S}=a;if(!this.treeModel)return;const w=b==="stderr"?c.MessageType.Error:b==="stdout"?c.MessageType.Info:b==="console"?c.MessageType.Warning:c.MessageType.Info;if(b==="telemetry"){this.logger.debug(`telemetry/${d.body.output}`,d.body.data);return}if(y){const T=new s.DebugConsoleNode({session:u,variablesReference:y,source:A,line:S},"",(E=this.treeModel)===null||E===void 0?void 0:E.root);await T.evaluate(),this.treeModel.root.insertItem(T)}else if(typeof a.output=="string"){let T=a.output;T.indexOf(f)>=0&&(this.clearConsole(),await this.insertItemWithAnsi((0,c.localize)("debug.console.consoleCleare"),c.MessageType.Info),T=T.substring(T.lastIndexOf(f)+f.length));const D=this.getLastItem();D&&!D.description.endsWith(`
|
|
31521
31521
|
`)&&!D.description.endsWith(`\r
|
|
@@ -31616,7 +31616,7 @@ Tokenizing line: ${O}`);for(let W=0;W<B.tokens.length;W++){const U=B.tokens[W];j
|
|
|
31616
31616
|
|
|
31617
31617
|
`),this}appendMarkdown(s){return this.value+=s,this}appendCodeblock(s,g){return this.value+="\n```",this.value+=s,this.value+=`
|
|
31618
31618
|
`,this.value+=g,this.value+="\n```\n",this}}t.MarkdownString=p;function v(_){return _ instanceof p?!0:_&&typeof _=="object"?typeof _.value=="string"&&(typeof _.isTrusted=="boolean"||_.isTrusted===void 0)&&(typeof _.supportThemeIcons=="boolean"||_.supportThemeIcons===void 0):!1}function m(_){const s=[],g=_.split("|").map(h=>h.trim());_=g[0];const l=g[1];if(l){const h=/height=(\d+)/.exec(l),u=/width=(\d+)/.exec(l),d=h?h[1]:"",E=u?u[1]:"",f=isFinite(parseInt(E,10)),a=isFinite(parseInt(d,10));f&&s.push(`width="${E}"`),a&&s.push(`height="${d}"`)}return{href:_,dimensions:s}}},53886:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(84811),t),n.__exportStar(e(38677),t),n.__exportStar(e(32112),t),n.__exportStar(e(58063),t),n.__exportStar(e(3484),t),n.__exportStar(e(84569),t),n.__exportStar(e(92771),t),n.__exportStar(e(87330),t),n.__exportStar(e(37070),t),n.__exportStar(e(32504),t),n.__exportStar(e(78941),t),n.__exportStar(e(69403),t)},32112:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},69403:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OverviewRulerLane=void 0;var e;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(e||(t.OverviewRulerLane=e={}))},58063:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3484:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},92771:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},51418:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},73294:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},50288:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},37846:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.knownProtocols=void 0;const n=e(11431),r=e(46147);t.knownProtocols=new Map,t.knownProtocols.set(r.ExtHostAPIIdentifier.ExtHostDocuments,n.ExtensionDocumentProtocol)},35250:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectIdentifier=void 0;var e;(function(n){n.name="$ident";function r(c,p){return Object.defineProperty(c,n.name,{value:p,enumerable:!0}),c}n.mixin=r;function o(c){return c[n.name]}n.of=o})(e||(t.ObjectIdentifier=e={}))},16363:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},70858:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isLittleEndian=p,t.encodeSemanticTokensDto=v,t.decodeSemanticTokensDto=_;function e(s){for(let g=0,l=s.length;g<l;g+=4){const h=s[g+0],u=s[g+1],d=s[g+2],E=s[g+3];s[g+0]=E,s[g+1]=d,s[g+2]=u,s[g+3]=h}}function n(s){const g=new Uint8Array(s.buffer,s.byteOffset,s.length*4);return p()||e(g),g}function r(s){const g=s;if(p()||e(g),g.byteOffset%4===0)return new Uint32Array(g.buffer,g.byteOffset,g.length/4);{const l=new Uint8Array(g.byteLength);return l.set(g),new Uint32Array(l.buffer,l.byteOffset,l.length/4)}}let o=!0,c=!1;function p(){if(!c){c=!0;const s=new Uint8Array(2);s[0]=1,s[1]=2,o=new Uint16Array(s.buffer)[0]===513}return o}function v(s){const g=new Uint32Array(m(s));let l=0;if(g[l++]=s.id,s.type==="full")g[l++]=1,g[l++]=s.data.length,g.set(s.data,l),l+=s.data.length;else{g[l++]=2,g[l++]=s.deltas.length;for(const h of s.deltas)g[l++]=h.start,g[l++]=h.deleteCount,h.data?(g[l++]=h.data.length,g.set(h.data,l),l+=h.data.length):g[l++]=0}return n(g)}function m(s){let g=0;if(g+=2,s.type==="full")g+=1+s.data.length;else{g+=1,g+=3*s.deltas.length;for(const l of s.deltas)l.data&&(g+=l.data.length)}return g}function _(s){const g=r(s);let l=0;const h=g[l++];if(g[l++]===1){const f=g[l++],a=g.subarray(l,l+f);return l+=f,{id:h,type:"full",data:a}}const d=g[l++],E=[];for(let f=0;f<d;f++){const a=g[l++],b=g[l++],y=g[l++];let A;y>0&&(A=g.subarray(l,l+y),l+=y),E[f]={start:a,deleteCount:b,data:A}}return{id:h,type:"delta",deltas:E}}},29490:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},89225:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.startsWith=e,t.endsWith=n,t.isLowerAsciiLetter=r,t.isUpperAsciiLetter=o,t.equalsIgnoreCase=p,t.escapeRegExpCharacters=m,t.startsWithIgnoreCase=_;function e(s,g){if(s.length<g.length)return!1;if(s===g)return!0;for(let l=0;l<g.length;l++)if(s[l]!==g[l])return!1;return!0}function n(s,g){const l=s.length-g.length;return l>0?s.indexOf(g,l)===l:l===0?s===g:!1}function r(s){return s>=97&&s<=122}function o(s){return s>=65&&s<=90}function c(s){return r(s)||o(s)}function p(s,g){const l=s?s.length:0,h=g?g.length:0;return l!==h?!1:v(s,g)}function v(s,g,l=s.length){if(typeof s!="string"||typeof g!="string")return!1;for(let h=0;h<l;h++){const u=s.charCodeAt(h),d=g.charCodeAt(h);if(u!==d){if(c(u)&&c(d)){const E=Math.abs(u-d);if(E!==0&&E!==32)return!1}else if(String.fromCharCode(u).toLowerCase()!==String.fromCharCode(d).toLowerCase())return!1}}return!0}function m(s){return s.replace(/[-\\{}*+?|^$.[\]()#]/g,"\\$&")}function _(s,g){const l=g.length;return g.length>s.length?!1:v(s,g,l)}},54741:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskFilterDTO=void 0;var e;(function(n){function r(c){return c}n.from=r;function o(c){if(c)return Object.assign(Object.create(null),c)}n.to=o})(e||(t.TaskFilterDTO=e={}))},25535:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},54056:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestItemRootImpl=t.TestItemImpl=t.MixedTestItemController=t.InvalidTestItemError=t.DuplicateTestItemError=t.diffTestItems=t.getPrivateApiFor=t.createPrivateApiFor=void 0;const e=new WeakMap,n=(E,f)=>{const a={controllerId:f};return e.set(E,a),a};t.createPrivateApiFor=n;const r=E=>e.get(E);t.getPrivateApiFor=r;const o=(E,f,a,b)=>{let y=a;return{enumerable:!0,configurable:!1,get(){return y},set(A){var S;if(!b(y,A)){const w=y;y=A,(S=E.listener)===null||S===void 0||S.call(E,{op:3,key:f,value:A,previous:w})}}}},c=(E,f)=>E===f,p={range:(E,f)=>E===f?!0:!E||!f?!1:E.isEqual(f),label:c,description:c,sortText:c,busy:c,error:c,canResolveChildren:c,tags:(E,f)=>!(E.length!==f.length||E.some(a=>!f.find(b=>a.id===b.id)))},v=Object.keys(p),m=(E,f)=>({range:o(E,"range",void 0,p.range),label:o(E,"label",f,p.label),description:o(E,"description",void 0,p.description),sortText:o(E,"sortText",void 0,p.sortText),canResolveChildren:o(E,"canResolveChildren",!1,p.canResolveChildren),busy:o(E,"busy",!1,p.busy),error:o(E,"error",void 0,p.error),tags:o(E,"tags",[],p.tags)}),_=(E,f)=>{const a=new Map;for(const b of v){const y=p[b];y(E[b],f[b])||a.set(b,f[b])}return a};t.diffTestItems=_;class s extends Error{constructor(f){super(`Attempted to insert a duplicate test item ID ${f}`)}}t.DuplicateTestItemError=s;class g extends Error{constructor(f){super(`TestItem with ID "${f}" is invalid. Make sure to create it from the createTestItem method.`)}}t.InvalidTestItemError=g;class l extends Error{constructor(f,a,b){super(`TestItem with ID "${f}" is from controller "${a}" and cannot be added as a child of an item from controller "${b}".`)}}t.MixedTestItemController=l;const h=E=>{const f=(0,t.getPrivateApiFor)(E);let a=new Map;return{get size(){return a.size},forEach(b,y){for(const A of a.values())b.call(y,A,this)},replace(b){var y;const A=new Map,S=new Set(a.keys()),w={op:4,ops:[]};for(const T of b){if(!(T instanceof u))throw new g(T.id);const D=(0,t.getPrivateApiFor)(T).controllerId;if(D!==f.controllerId)throw new l(T.id,D,f.controllerId);if(A.has(T.id))throw new s(T.id);A.set(T.id,T),S.delete(T.id),w.ops.push({op:0,item:T})}for(const T of S.keys())w.ops.push({op:1,id:T});(y=f.listener)===null||y===void 0||y.call(f,w),a=A},add(b){var y;if(!(b instanceof u))throw new g(b.id);a.set(b.id,b),(y=f.listener)===null||y===void 0||y.call(f,{op:0,item:b})},delete(b){var y;a.delete(b)&&((y=f.listener)===null||y===void 0||y.call(f,{op:1,id:b}))},get(b){return a.get(b)},toJSON(){return Array.from(a.values())},[Symbol.iterator](){return a.values()}}};class u{constructor(f,a,b,y){if(a.includes("\0"))throw new Error(`Test IDs may not include the ${JSON.stringify(a)} symbol`);const A=(0,t.createPrivateApiFor)(this,f);Object.defineProperties(this,{id:{value:a,enumerable:!0,writable:!1},uri:{value:y,enumerable:!0,writable:!1},parent:{enumerable:!1,get(){return A.parent instanceof d?void 0:A.parent}},children:{value:h(this),enumerable:!0,writable:!1},...m(A,b)})}invalidateResults(){var f,a;(a=(f=(0,t.getPrivateApiFor)(this)).listener)===null||a===void 0||a.call(f,{op:2})}}t.TestItemImpl=u;class d extends u{constructor(f,a){super(f,f,a,void 0)}}t.TestItemRootImpl=d},82086:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4809:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},86162:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TreeviewsService=t.ITreeViewsService=t.TreeViewSelection=t.TreeViewItem=t.TreeItemCheckboxState=void 0;var e;(function(c){c[c.Unchecked=0]="Unchecked",c[c.Checked=1]="Checked"})(e||(t.TreeItemCheckboxState=e={}));class n{}t.TreeViewItem=n;var r;(function(c){function p(v){return!!v&&typeof v=="object"&&"treeViewId"in v&&"treeItemId"in v}c.is=p})(r||(t.TreeViewSelection=r={})),t.ITreeViewsService=Symbol("ITreeViewsService");class o{constructor(){this._dragOperations=new Map,this._renderedElements=new Map}removeDragOperationTransfer(p){if(p&&this._dragOperations.has(p)){const v=this._dragOperations.get(p);return this._dragOperations.delete(p),v}}addDragOperationTransfer(p,v){this._dragOperations.set(p,v)}getRenderedTreeElement(p){if(this._renderedElements.has(p))return this._renderedElements.get(p)}addRenderedTreeItemElement(p,v){this._renderedElements.set(p,v)}removeRenderedTreeItemElement(p){this._renderedElements.has(p)&&this._renderedElements.delete(p)}}t.TreeviewsService=o},64945:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43710:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=o,t.mixin=c,t.illegalArgument=p,t.isLocationArray=v,t.isDefinitionLinkArray=m,t.reviveRegExp=_,t.reviveIndentationRule=s,t.reviveOnEnterRule=g,t.reviveOnEnterRules=l,t.serializeEnterRules=h,t.serializeRegExp=u,t.serializeIndentation=d,t.serializeAutoClosingPairs=E;const r=e(85608).__importStar(e(51328));function o(f){return typeof f=="object"&&f!==null&&!Array.isArray(f)&&!(f instanceof RegExp)&&!(f instanceof Date)}function c(f,a,b=!0){return o(f)?(o(a)&&Object.keys(a).forEach(y=>{y in f?b&&(o(f[y])&&o(a[y])?c(f[y],a[y],b):f[y]=a[y]):f[y]=a[y]}),f):a}function p(f){return f?new Error(`Illegal argument: ${f}`):new Error("Illegal argument")}function v(f){return Array.isArray(f)&&f.length>0&&f[0]instanceof r.Location}function m(f){return Array.isArray(f)&&f.length>0&&f[0].hasOwnProperty("targetUri")&&f[0].hasOwnProperty("targetRange")}function _(f){if(!(typeof f>"u"||f===null))return new RegExp(f.pattern,f.flags)}function s(f){if(!(typeof f>"u"||f===null))return{increaseIndentPattern:_(f.increaseIndentPattern),decreaseIndentPattern:_(f.decreaseIndentPattern),indentNextLinePattern:_(f.indentNextLinePattern),unIndentedLinePattern:_(f.unIndentedLinePattern)}}function g(f){return{beforeText:_(f.beforeText),afterText:_(f.afterText),action:f.action,previousLineText:_(f.previousLineText)}}function l(f){if(!(typeof f>"u"||f===null))return f.map(g)}function h(f){if(!(typeof f>"u"||f===null))return f.map(a=>({action:a.action,beforeText:u(a.beforeText),afterText:u(a.afterText),previousLineText:u(a.previousLineText)}))}function u(f){if(!(typeof f>"u"||f===null))return{pattern:f.source,flags:(f.global?"g":"")+(f.ignoreCase?"i":"")+(f.multiline?"m":"")}}function d(f){if(!(typeof f>"u"||f===null))return{increaseIndentPattern:u(f.increaseIndentPattern),decreaseIndentPattern:u(f.decreaseIndentPattern),indentNextLinePattern:u(f.indentNextLinePattern),unIndentedLinePattern:u(f.unIndentedLinePattern)}}function E(f){if(f)return f.map(a=>({open:a.open,close:a.close,notIn:a.notIn?a.notIn.map(b=>r.SyntaxTokenType.toString(b)):void 0}))}},96833:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},98116:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebviewViewResolverRegistrationRemovalEvent=t.WebviewViewResolverRegistrationEvent=void 0;const n=e(43718);class r extends n.BasicEvent{}t.WebviewViewResolverRegistrationEvent=r;class o extends n.BasicEvent{}t.WebviewViewResolverRegistrationRemovalEvent=o},55467:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},92622:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationTarget=void 0,t.reviveWorkspaceEditDto=o;const n=e(43718);var r;(function(c){c[c.Global=1]="Global",c[c.Workspace=2]="Workspace",c[c.WorkspaceFolder=3]="WorkspaceFolder"})(r||(t.ConfigurationTarget=r={}));function o(c){if(c&&c.edits)for(const p of c.edits)if(typeof p.resource=="object")p.resource=n.URI.from(p.resource),p.options={openDirtyInEditor:!0},p.textEdit=p.textEdit,p.versionId=p.versionId;else{const v=p;v.newResource=p.newResource?n.URI.from(p.newResource):void 0,v.oldResource=p.oldResource?n.URI.from(p.oldResource):void 0,v.options={...v.options,showInEditor:!1}}return c}},57646:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BinaryEditorComponent=void 0;const r=e(85608).__importDefault(e(14041)),o=e(76003),c=e(41869),p=e(37406),v=e(57517),m=e(88819),_=s=>{const g=s.resource.uri.codeUri.fsPath,l=(0,c.useInjectable)(o.INJECTOR_TOKEN),h=(0,c.useInjectable)(c.AppConfig),u=(0,c.useInjectable)(v.WorkbenchEditorService),d=(0,c.useInjectable)(c.IEventBus),E=()=>{const a=u.currentResource;a&&(a.metadata={...a.metadata,skipPreventBinary:!0},d.fire(new v.ResourceOpenTypeChangedEvent(a.uri)))},f=[{label:(0,c.localize)("editor.file.prevent.stillOpen"),onClick:()=>E()}];return h.isElectronRenderer&&f.push({label:(0,c.localize)("editor.openExternal"),onClick:()=>l.get(p.IElectronMainUIService).openPath(g)}),r.default.createElement(m.PreventComponent,{description:(0,c.localize)("editor.cannotOpenBinary"),actions:f})};t.BinaryEditorComponent=_},60387:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalkThroughSnippetSchemeDocumentProvider=t.VscodeSchemeDocumentProvider=t.FileSchemeDocumentProvider=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(96405),p=e(68692),v=e(14951),m=e(80449);let _=class extends p.BaseFileSystemEditorDocumentProvider{handlesUri(h){return h.scheme===o.Schemes.file?20:-1}handlesScheme(){return!1}provideEncoding(h){return super.provideEncoding(h)}preferLanguageForUri(h){if(["settings.json"].includes(h.path.base))return"jsonc"}async saveDocumentModel(h,u,d,E,f,a=!1,b=`
|
|
31619
|
-
`,y){const A=this.hashCalculateService.calculate(d);return u.length>m.FILE_SAVE_BY_CHANGE_THRESHOLD?await this.fileSchemeDocClient.saveByChange(h.toString(),{baseMd5:A,changes:E,eol:b},f,a,y):await this.fileSchemeDocClient.saveByContent(h.toString(),{baseMd5:A,content:u},f,a,y)}async provideEditorDocumentModelContentMd5(h,u){return this.fileSchemeDocClient.getMd5(h.toString(),u)}};t.FileSchemeDocumentProvider=_,n.__decorate([(0,r.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],_.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(m.IFileSchemeDocClient),n.__metadata("design:type",Object)],_.prototype,"fileSchemeDocClient",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],_.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(c.IHashCalculateService),n.__metadata("design:type",Object)],_.prototype,"hashCalculateService",void 0),t.FileSchemeDocumentProvider=_=n.__decorate([(0,r.Injectable)()],_);let s=class{constructor(){this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event,this.listeners={}}isReadonly(h){return!0}handlesScheme(h){return h==="vscode"}async provideEditorDocumentModelContent(h,u){return this.getSchemaContent(h)}getSchemaContent(h){const u=h.toString(),d=this.jsonRegistry.getSchemaContributions().schemas[u];if(d){const E=JSON.stringify(d);if(!this.listeners[u]){const f=o.Disposable.create(()=>{this.jsonRegistry.onDidChangeSchema(a=>{a===u&&this._onDidChangeContent.fire(h)})});this.listeners[u]=f}return E}return"{}"}onDidDisposeModel(h){h.toString()&&(this.listeners[h.toString()].dispose(),delete this.listeners[h.toString()])}};t.VscodeSchemeDocumentProvider=s,n.__decorate([(0,r.Autowired)(o.ISchemaStore),n.__metadata("design:type",Object)],s.prototype,"schemaStore",void 0),n.__decorate([(0,r.Autowired)(o.IJSONSchemaRegistry),n.__metadata("design:type",Object)],s.prototype,"jsonRegistry",void 0),t.VscodeSchemeDocumentProvider=s=n.__decorate([(0,r.Injectable)()],s);let g=class{constructor(){this.documentContentMaps=new Map,this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event}handlesScheme(h){return h===o.Schemes.walkThroughSnippet}provideEditorDocumentModelContent(h,u){return this.documentContentMaps.has(h.toString())||this.documentContentMaps.set(h.toString(),""),this.documentContentMaps.get(h.toString())}isReadonly(){return!1}preferLanguageForUri(){return"plaintext"}};t.WalkThroughSnippetSchemeDocumentProvider=g,t.WalkThroughSnippetSchemeDocumentProvider=g=n.__decorate([(0,r.Injectable)()],g)},41352:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSchemeDocClientService=void 0;const n=e(85608),r=e(76003),o=e(80449);let c=class{saveByChange(v,m,_,s,g){return this.fileDocBackendService.$saveByChange(v,m,_,s,g)}saveByContent(v,m,_,s,g){return this.fileDocBackendService.$saveByContent(v,m,_,s,g)}getMd5(v,m){return this.fileDocBackendService.$getMd5(v,m)}};t.FileSchemeDocClientService=c,n.__decorate([(0,r.Autowired)(o.FileSchemeDocNodeServicePath),n.__metadata("design:type",Object)],c.prototype,"fileDocBackendService",void 0),t.FileSchemeDocClientService=c=n.__decorate([(0,r.Injectable)()],c)},17276:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystemEditorComponentContribution=t.FileSystemEditorResourceContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(26542),p=e(57517),v=e(17878),m=e(42933),_=e(57646),s=e(60387),g=e(88819),l=e(99025),h="video-preview",u="image-preview",d="external-file",E="large-file-prevent";let f=class{registerResource(y){y.registerResourceProvider(this.untitledResourceProvider)}registerEditorDocumentModelContentProvider(y){y.registerEditorDocumentModelContentProvider(this.fileSchemeDocumentProvider),y.registerEditorDocumentModelContentProvider(this.vscodeSchemeDocumentProvider),y.registerEditorDocumentModelContentProvider(this.walkThroughSnippetSchemeDocumentProvider),y.registerEditorDocumentModelContentProvider(this.untitledSchemeDocumentProvider)}};t.FileSystemEditorResourceContribution=f,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s.FileSchemeDocumentProvider)],f.prototype,"fileSchemeDocumentProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s.VscodeSchemeDocumentProvider)],f.prototype,"vscodeSchemeDocumentProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s.WalkThroughSnippetSchemeDocumentProvider)],f.prototype,"walkThroughSnippetSchemeDocumentProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",v.UntitledSchemeResourceProvider)],f.prototype,"untitledResourceProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",v.UntitledSchemeDocumentProvider)],f.prototype,"untitledSchemeDocumentProvider",void 0),t.FileSystemEditorResourceContribution=f=n.__decorate([(0,o.Domain)(p.BrowserEditorContribution)],f);let a=class{constructor(){this.cachedFileType=new o.LRUMap(200,100),this.fileServiceClient.onFilesChanged(y=>{y.forEach(A=>{this.cachedFileType.delete(A.uri.toString())})})}registerEditorComponent(y){y.registerEditorComponent({component:l.ImagePreview,uid:u,scheme:o.Schemes.file}),y.registerEditorComponent({component:l.VideoPreview,uid:h,scheme:o.Schemes.file}),y.registerEditorComponent({component:_.BinaryEditorComponent,uid:d,scheme:o.Schemes.file}),y.registerEditorComponent({component:g.LargeFilePrevent,uid:E,scheme:o.Schemes.file}),y.registerEditorComponentResolver(A=>A===o.Schemes.file||this.fileServiceClient.handlesScheme(A)?10:-1,(A,S)=>{S.length===0&&S.push({type:p.EditorOpenType.component,componentId:d})}),y.registerEditorComponentResolver(A=>A===o.Schemes.file||this.fileServiceClient.handlesScheme(A)?10:-1,async(A,S)=>{const w=await this.getFileType(A.uri.toString());switch(w){case"image":{S.push({type:p.EditorOpenType.component,componentId:u});break}case"video":{S.push({type:p.EditorOpenType.component,componentId:h});break}case"binary":case"text":{const{metadata:T,uri:D}=A,I=T||{};if(w==="binary"&&!I.skipPreventBinary)break;const O=await this.fileServiceClient.getFileStat(D.toString());await this.preference.ready;const M=this.preference.getValid("editor.largeFile",4*1024*1024*1024);O&&(O.size||0)>M&&!I.skipPreventTooLarge?S.push({type:p.EditorOpenType.component,componentId:E}):S.push({type:p.EditorOpenType.code,title:(0,o.localize)("editorOpenType.code")});break}}}),y.registerEditorComponentResolver(o.Schemes.untitled,(A,S,w)=>{w([{type:p.EditorOpenType.code,priority:"default"}])})}async getFileType(y){return this.cachedFileType.has(y)||((0,c.getLanguageIdFromMonaco)(new o.URI(y))?this.cachedFileType.set(y,"text"):this.cachedFileType.set(y,await this.getRealFileType(y))),this.cachedFileType.get(y)}async getRealFileType(y){try{return await this.fileServiceClient.getFileType(y)}catch{return"text"}}};t.FileSystemEditorComponentContribution=a,n.__decorate([(0,r.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],a.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],a.prototype,"preference",void 0),t.FileSystemEditorComponentContribution=a=n.__decorate([(0,o.Domain)(p.BrowserEditorContribution),n.__metadata("design:paramtypes",[])],a)},52568:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSchemeModule=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(80449),p=e(41352),v=e(17276);let m=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[v.FileSystemEditorResourceContribution,v.FileSystemEditorComponentContribution,{token:c.IFileSchemeDocClient,useClass:p.FileSchemeDocClientService}],this.backServices=[{servicePath:c.FileSchemeDocNodeServicePath}]}};t.FileSchemeModule=m,t.FileSchemeModule=m=n.__decorate([(0,r.Injectable)()],m)},88819:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LargeFilePrevent=t.PreventComponent=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=e(41869),p=e(81878),v=e(54414),m=e(82196),_=n.__importDefault(e(19996)),s=l=>o.default.createElement("div",{className:_.default["error-page"]},o.default.createElement("div",{className:(0,r.default)(_.default.icon,(0,c.getExternalIcon)("warning"))}),o.default.createElement("div",{className:_.default.description},l.description),o.default.createElement("div",{className:_.default["actions-wrapper"]},l.actions.map((h,u)=>o.default.createElement(p.Button,{key:u,onClick:()=>h.onClick(),className:_.default["action-button"]},h.label))));t.PreventComponent=s;const g=()=>{const l=(0,c.useInjectable)(v.WorkbenchEditorService),h=(0,c.useInjectable)(c.IEventBus),u=()=>{const d=l.currentResource;d&&(d.metadata={...d.metadata,skipPreventTooLarge:!0},h.fire(new m.ResourceOpenTypeChangedEvent(d.uri)))};return o.default.createElement(t.PreventComponent,{description:(0,c.localize)("editor.largeFile.prevent"),actions:[{label:(0,c.localize)("editor.file.prevent.stillOpen"),onClick:()=>u()}]})};t.LargeFilePrevent=g},99025:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImagePreview=t.VideoPreview=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(41869),c=e(40827),p=n.__importDefault(e(19996)),v=_=>{const s=(0,o.useInjectable)(c.StaticResourceService);return{src:r.default.useMemo(()=>s.resolveStaticResource(_.uri).toString(),[_])}};t.VideoPreview=(0,r.memo)(_=>{const{src:s}=v(_.resource);return r.default.createElement("div",{className:p.default.kt_video_preview},r.default.createElement("video",{playsInline:!0,controls:!0,className:p.default.kt_video,src:s}))});const m=_=>{const s=r.default.useRef(),g=r.default.useRef(),{src:l}=v(_.resource);return r.default.useEffect(()=>{const h=new o.Disposable;return s.current&&(s.current.src=l),()=>{h.dispose()}},[_.resource]),r.default.createElement("div",{className:p.default.kt_image_preview},r.default.createElement("div",{ref:g},r.default.createElement("img",{ref:h=>h&&(s.current=h)})))};t.ImagePreview=m},80449:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChangeType=t.FileSchemeDocNodeServicePath=t.IFileSchemeDocNodeService=t.IFileSchemeDocClient=t.FILE_SAVE_BY_CHANGE_THRESHOLD=t.FILE_ON_DISK_SCHEME=void 0,t.FILE_ON_DISK_SCHEME="fileOnDisk",t.FILE_SAVE_BY_CHANGE_THRESHOLD=1e5,t.IFileSchemeDocClient=Symbol("IFileSchemeDocClient"),t.IFileSchemeDocNodeService=Symbol("FileSchemeDocNodeService"),t.FileSchemeDocNodeServicePath="FileSchemeDocNodeService";var e;(function(n){n[n.ADDED=1]="ADDED",n[n.REMOVED=2]="REMOVED"})(e||(t.ChangeType=e={}))},15625:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IFileSearchService=t.FileSearchServicePath=void 0,t.FileSearchServicePath="FileSearchServicePath",t.IFileSearchService=Symbol("FileSearchService")},84660:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(15625),t)},47720:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(84660),t)},2156:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileServiceClient=t.BrowserFileSystemRegistryImpl=void 0;const n=e(85608),r=e(32852),o=e(76003),c=e(41869),p=e(43718),v=e(37406),m=e(8170),_=e(41682),s=e(42933),g=e(81952);let l=class{constructor(){this.providers=new Map}registerFileSystemProvider(d){const E=d.scheme;return this.providers.set(E,d),{dispose:()=>{this.providers.delete(E)}}}};t.BrowserFileSystemRegistryImpl=l,t.BrowserFileSystemRegistryImpl=l=n.__decorate([(0,o.Injectable)()],l);let h=class{get clientId(){return this.applicationService.clientId}constructor(){this.watcherWithSchemaMap=new Map,this.watcherDisposerMap=new Map,this.onFileChangedEmitter=new c.Emitter,this.onFileProviderChangedEmitter=new c.Emitter,this._onFilesChanged=new c.Emitter,this.onFilesChanged=this._onFilesChanged.event,this._onFileProviderChanged=new c.Emitter,this.onFileProviderChanged=this._onFileProviderChanged.event,this._onDidChangeFileSystemProviderRegistrations=new c.Emitter,this.onDidChangeFileSystemProviderRegistrations=this._onDidChangeFileSystemProviderRegistrations.event,this._onWillActivateFileSystemProvider=new c.Emitter,this.onWillActivateFileSystemProvider=this._onWillActivateFileSystemProvider.event,this._onDidChangeFileSystemProviderCapabilities=new c.Emitter,this.onDidChangeFileSystemProviderCapabilities=this._onDidChangeFileSystemProviderCapabilities.event,this.filesExcludesMatcherList=[],this.watcherId=0,this.toDisposable=new c.DisposableCollection,this.watchFileExcludes=[],this.watchFileExcludesMatcherList=[],this.filesExcludes=[],this.workspaceRoots=[],this._providerChanged=new Set,this.fsProviders=new Map,this.userHomeDeferred=new c.Deferred,this.options={encoding:"utf8",overwrite:!1,recursive:!0,moveToTrash:!0},this.uriWatcherMap=new Map,this.toDisposable.push(this.onDidChangeFileSystemProviderRegistrations(d=>{d.added&&d.scheme===p.Schemes.file&&this.doGetCurrentUserHome()}))}async initialize(){const d=await this.getProvider(p.Schemes.file);d.initialize&&await d.initialize(this.clientId,this.appConfig.recursiveWatcherBackend)}async doGetCurrentUserHome(){const E=(await this.getProvider(p.Schemes.file)).getCurrentUserHome();this.userHomeDeferred.resolve(E)}handlesScheme(d){return this.registry.providers.has(d)||this.fsProviders.has(d)}dispose(){return this.toDisposable.dispose()}async resolveContent(d,E){const f=this.convertUri(d),b=await(await this.getProvider(f.scheme)).readFile(f.codeUri),y=b.data||b;return{content:c.BinaryBuffer.wrap(Uint8Array.from(y)).toString(E?.encoding)}}async readFile(d){const E=this.convertUri(d),a=await(await this.getProvider(E.scheme)).readFile(E.codeUri),b=a.data||a;return{content:c.BinaryBuffer.wrap(Uint8Array.from(b))}}async readFileStream(d){const E=this.convertUri(d);return await(await this.getProvider(E.scheme)).readFileStream(E.codeUri)}async getFileStat(d,E=!0){const f=this.convertUri(d),a=await this.getProvider(f.scheme);try{const b=await a.stat(f.codeUri);if(!b)throw s.FileSystemError.FileNotFound(f.codeUri.toString(),"File not found.");return this.filterStat(b,E)}catch(b){if(s.FileSystemError.FileNotFound.is(b))return}}async setContent(d,E,f){const a=this.convertUri(d.uri),b=await this.getProvider(a.scheme),y=await b.stat(a.codeUri);if(!y)throw s.FileSystemError.FileNotFound(d.uri,"File not found.");if(y.isDirectory)throw s.FileSystemError.FileIsADirectory(d.uri,"Cannot set the content.");if(!await this.isInSync(d,y))throw this.createOutOfSyncError(d);return await b.writeFile(a.codeUri,typeof E=="string"?c.BinaryBuffer.fromString(E).buffer:E,{create:!1,overwrite:!0,encoding:f?.encoding}),await b.stat(a.codeUri)}async updateContent(d,E,f){const a=this.convertUri(d.uri),b=await this.getProvider(a.scheme),y=await b.stat(a.codeUri);if(!y)throw s.FileSystemError.FileNotFound(d.uri,"File not found.");if(y.isDirectory)throw s.FileSystemError.FileIsADirectory(d.uri,"Cannot set the content.");if(!this.checkInSync(d,y))throw this.createOutOfSyncError(d);if(E.length===0)return y;const A=await b.readFile(a.codeUri),S=this.applyContentChanges(c.BinaryBuffer.wrap(A).toString(f?.encoding),E);await b.writeFile(a.codeUri,c.BinaryBuffer.fromString(S).buffer,{create:!1,overwrite:!0,encoding:f?.encoding});const w=await b.stat(a.codeUri);if(!w)throw s.FileSystemError.FileNotFound(a.codeUri.toString(),"File not found.");return w}async createFile(d,E){const f=this.convertUri(d),a=await this.getProvider(f.scheme),b=c.BinaryBuffer.fromString(E?.content||"").buffer;let y=await a.writeFile(f.codeUri,b,{create:!0,overwrite:E&&E.overwrite||!1,encoding:E?.encoding});return y=y||await a.stat(f.codeUri),y}async createFolder(d){const E=this.convertUri(d),f=await this.getProvider(E.scheme),a=await f.createDirectory(E.codeUri);return a||await f.stat(E.codeUri)}async move(d,E,f){const a=this.convertUri(d),b=this.convertUri(E),y=await this.getProvider(a.scheme),A=await y.rename(a.codeUri,b.codeUri,{overwrite:!!(f&&f.overwrite)});return A||await y.stat(b.codeUri)}async copy(d,E,f){const a=this.convertUri(d),b=this.convertUri(E),y=await this.getProvider(a.scheme),A=await this.doGetOverwrite(f);if(!(0,s.containsExtraFileMethod)(y,"copy"))throw this.getErrorProvideNotSupport(a.scheme,"copy");const S=await y.copy(a.codeUri,b.codeUri,{overwrite:!!A});return S||await y.stat(b.codeUri)}async getFsPath(d){if(d.startsWith("file:/"))return c.FileUri.fsPath(d)}fireFilesChange(d){const E=d.changes.map(f=>({uri:f.uri,type:f.type}));this._onFilesChanged.fire(E),this.eventBus.fire(new c.FilesChangeEvent(E))}async watchFileChanges(d,E){const a=(this.appConfig.pollingWatcherDirectories||[]).some(I=>d.path.toString().startsWith(I)),b=this.convertUri(d.toString()),y=this.uriWatcherMap.get(b.toString());if(y)if(y.isDisposed())this.uriWatcherMap.delete(b.toString());else return y;const A=this.watcherId++,S=await this.getProvider(b.scheme),w=this.watcherWithSchemaMap.get(b.scheme)||[],T=await S.watch(b.codeUri,{excludes:E,pollingWatch:a});this.watcherDisposerMap.set(A,{dispose:async()=>{const I=this.uriWatcherMap.get(b.toString());await Promise.all([S.unwatch&&S.unwatch(T),I&&I.dispose()]),this.uriWatcherMap.delete(b.toString())}}),w.push(A),this.watcherWithSchemaMap.set(b.scheme,w);const D=new g.FileSystemWatcher({fileServiceClient:this,watchId:A,uri:d});return this.uriWatcherMap.set(b.toString(),D),D}async setWatchFileExcludes(d){return await(await this.getProvider(p.Schemes.file)).setWatchFileExcludes(d)}async getWatchFileExcludes(){return await(await this.getProvider(p.Schemes.file)).getWatchFileExcludes()}async setFilesExcludes(d,E){this.filesExcludes=d,this.filesExcludesMatcherList=[],E&&this.setWorkspaceRoots(E),this.updateExcludeMatcher()}async setWorkspaceRoots(d){this.workspaceRoots=d,this.updateExcludeMatcher()}async unwatchFileChanges(d){const E=this.watcherDisposerMap.get(d);if(!(!E||!E.dispose))return this.watcherDisposerMap.delete(d),E.dispose()}async delete(d,E){if(this.appConfig.isElectronRenderer&&E?.moveToTrash!==!1){const b=new c.URI(d);if(b.scheme===p.Schemes.file)return this.injector.get(v.IElectronMainUIService).moveToTrash(b.codeUri.fsPath)}const f=this.convertUri(d),a=await this.getProvider(f.scheme);await a.stat(f.codeUri),await a.delete(f.codeUri,{recursive:!0,moveToTrash:await this.doGetMoveToTrash(E)})}async getEncoding(d){return"utf8"}listCapabilities(){return _.Iterable.map(this.fsProviders,([d,E])=>({scheme:d,capabilities:E.capabilities}))}registerProvider(d,E){if(this.fsProviders.has(d))throw new Error(`The file system provider for \`${d}\` already registered`);const f=[];this.fsProviders.set(d,E),this._onDidChangeFileSystemProviderRegistrations.fire({added:!0,scheme:d,provider:E}),f.push({dispose:()=>{this._onDidChangeFileSystemProviderRegistrations.fire({added:!1,scheme:d,provider:E}),this.fsProviders.delete(d),this._providerChanged.add(d)}}),E.onDidChangeFile&&f.push(E.onDidChangeFile(b=>this.fireFilesChange({changes:b}))),this.toDisposable.push(E.onDidChangeCapabilities(()=>this._onDidChangeFileSystemProviderCapabilities.fire({provider:E,scheme:d}))),f.push({dispose:async()=>{const b=[];(this.watcherWithSchemaMap.get(d)||[]).forEach(y=>b.push(this.unwatchFileChanges(y))),await Promise.all(b)}}),this._providerChanged.add(d),this.onFileProviderChangedEmitter.fire(Array.from(this._providerChanged)),this.toDisposable.pushAll(f);const a=new c.DisposableCollection;return a.pushAll(f),this._onFileProviderChanged.fire(Array.from(this._providerChanged)),a}async access(d,E=s.FileAccess.Constants.F_OK){const f=this.convertUri(d),a=await this.getProvider(f.scheme);if(!(0,s.containsExtraFileMethod)(a,"access"))throw this.getErrorProvideNotSupport(f.scheme,"access");return await a.access(f.codeUri,E)}async getFileType(d){const E=this.convertUri(d),f=await this.getProvider(E.scheme);if(!(0,s.containsExtraFileMethod)(f,"getFileType"))throw this.getErrorProvideNotSupport(E.scheme,"getFileType");return await f.getFileType(d)}async getCurrentUserHome(){return this.userHomeDeferred.promise}getErrorProvideNotSupport(d,E){return`Scheme ${d} not support this function: ${E}.`}convertUri(d){const E=new c.URI(d);if(!E.scheme)throw new Error(`Unsupported convert Uri with non-scheme Uri: ${d}`);return E}updateExcludeMatcher(){this.filesExcludes.forEach(d=>{this.workspaceRoots.length>0?this.workspaceRoots.forEach(E=>{const a=new c.URI(E).resolve(d).path.toString();this.filesExcludesMatcherList.push((0,c.parseGlob)(a))}):this.filesExcludesMatcherList.push((0,c.parseGlob)(d))})}async shouldWaitProvider(d){const E=await this._onWillActivateFileSystemProvider.fireAndAwait({scheme:d}),{result:f}=E[0];if(f&&f.includes(d)){const a=await c.Event.toPromise(c.Event.filter(this.onFileProviderChanged,b=>b.includes(d)));if(!(0,p.isUndefined)(a))return!0}return!1}async getProvider(d){this._providerChanged.has(d)&&(await this.eventBus.fireAndAwait(new c.ExtensionActivateEvent({topic:"onFileSystem",data:d}),{timeout:3e3}),this._providerChanged.delete(d));const E=this.fsProviders.get(d);if(!E)throw new Error(`Not find ${d} provider.`);return E}async isReadonly(d){try{const E=new c.URI(d);return!!(await(await this.getProvider(E.scheme)).stat(this.convertUri(d).codeUri)).readonly}catch{return!1}}isExclude(d){const E=new c.URI(d);return this.filesExcludesMatcherList.some(f=>f(E.path.toString()))}filterStat(d,E=!0){if(d&&!this.isExclude(d.uri))return d.children&&E&&(d.children=this.filterStatChildren(d.children)),d}filterStatChildren(d){const E=[];return d.forEach(f=>{if(this.isExclude(f.uri))return!1;const a=this.filterStat(f);a&&E.push(a)}),E}applyContentChanges(d,E){let f=r.TextDocument.create("","",1,d);for(const a of E){let b=a.text;if(a.range){const y=f.offsetAt(a.range.start),A=f.offsetAt(a.range.end);b=f.getText().substr(0,y)+a.text+f.getText().substr(A)}f=r.TextDocument.create(f.uri,f.languageId,f.version,b)}return f.getText()}async isInSync(d,E){return!!this.checkInSync(d,E)}checkInSync(d,E){return E.lastModification===d.lastModification&&E.size===d.size}createOutOfSyncError(d){return s.FileSystemError.FileIsOutOfSync(d.uri)}async doGetEncoding(d){return d&&typeof d.encoding<"u"?d.encoding:this.options.encoding}async doGetOverwrite(d){return d&&typeof d.overwrite<"u"?d.overwrite:this.options.overwrite}async doGetRecursive(d){return d&&typeof d.recursive<"u"?d.recursive:this.options.recursive}async doGetMoveToTrash(d){return d&&typeof d.moveToTrash<"u"?d.moveToTrash:this.options.moveToTrash}};t.FileServiceClient=h,n.__decorate([(0,o.Autowired)(s.IBrowserFileSystemRegistry),n.__metadata("design:type",l)],h.prototype,"registry",void 0),n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],h.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(p.IEventBus),n.__metadata("design:type",Object)],h.prototype,"eventBus",void 0),n.__decorate([(0,o.Autowired)(c.AppConfig),n.__metadata("design:type",Object)],h.prototype,"appConfig",void 0),n.__decorate([(0,o.Autowired)(m.IApplicationService),n.__metadata("design:type",Object)],h.prototype,"applicationService",void 0),t.FileServiceClient=h=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],h)},69037:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileServiceContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(42933),p=e(2156);let v=class{constructor(){this._disposables=new o.DisposableStore,this._disposables.add(this.fileSystem.registerProvider(o.Schemes.file,this.diskFileServiceProvider))}async initialize(){const _=this.contributionProvider.getContributions();await Promise.all(_.map(async s=>{s.registerProvider&&await s.registerProvider(this.fileSystem)})),await Promise.all(_.map(async s=>{s.onFileServiceReady&&await s.onFileServiceReady()})),this.fileSystem.initialize&&await this.fileSystem.initialize()}dispose(){this._disposables.dispose()}};t.FileServiceContribution=v,n.__decorate([(0,r.Autowired)(c.IFileServiceClient),n.__metadata("design:type",p.FileServiceClient)],v.prototype,"fileSystem",void 0),n.__decorate([(0,r.Autowired)(c.IDiskFileProvider),n.__metadata("design:type",Object)],v.prototype,"diskFileServiceProvider",void 0),n.__decorate([(0,r.Autowired)(o.FsProviderContribution),n.__metadata("design:type",Object)],v.prototype,"contributionProvider",void 0),t.FileServiceContribution=v=n.__decorate([(0,o.Domain)(o.ClientAppContribution),n.__metadata("design:paramtypes",[])],v)},60476:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiskFsProviderClient=t.CoreFileServiceProviderClient=void 0;const n=e(85608),r=e(76003),o=e(43718),c=e(42933);class p{constructor(){this.onDidChangeFileEmitter=new o.Emitter,this.onDidChangeFile=this.onDidChangeFileEmitter.event}watch(_,s){return this.fileServiceProvider.watch(_,s)}unwatch(_){return this.fileServiceProvider.unwatch&&this.fileServiceProvider.unwatch(_)}async stat(_){return await this.fileServiceProvider.stat(_)}readDirectory(_){return this.fileServiceProvider.readDirectory(_)}createDirectory(_){return this.fileServiceProvider.createDirectory(_)}async readFile(_,s){return s&&(0,o.getDebugLogger)("fileService.fsProvider").warn("encoding option for fsProvider.readFile is deprecated"),await this.fileServiceProvider.readFile(_)}readFileStream(_){if(this.fileServiceProvider.readFileStream)return this.fileServiceProvider.readFileStream(_);throw new Error("readFileStream not supported")}writeFile(_,s,g){return this.fileServiceProvider.writeFile(_,Array.from(s),g)}delete(_,s){return this.fileServiceProvider.delete(_,s)}rename(_,s,g){return this.fileServiceProvider.rename(_,s,g)}}t.CoreFileServiceProviderClient=p,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],p.prototype,"injector",void 0);let v=class extends p{constructor(){super(...arguments),this.onDidChangeCapabilities=o.Event.None}get capabilities(){return this._capabilities||(this._capabilities=12318,o.isLinux&&(this._capabilities|=1024)),this._capabilities}async initialize(_,s){var g,l;if(!((g=this.fileServiceProvider)===null||g===void 0)&&g.initialize)try{await((l=this.fileServiceProvider)===null||l===void 0?void 0:l.initialize(_,s))}catch(h){(0,o.getDebugLogger)("fileService.fsProvider").error("initialize error",h)}}setWatchFileExcludes(_){return this.fileServiceProvider.setWatchFileExcludes(_)}getWatchFileExcludes(){return this.fileServiceProvider.getWatchFileExcludes()}onDidFilesChanged(_){const s=_.changes.map(g=>({uri:g.uri,type:g.type}));this.onDidChangeFileEmitter.fire(s)}copy(_,s,g){return this.fileServiceProvider.copy(_,s,g)}access(_,s){return this.fileServiceProvider.access(_,s)}getCurrentUserHome(){return this.fileServiceProvider.getCurrentUserHome()}getFileType(_){return this.fileServiceProvider.getFileType(_)}};t.DiskFsProviderClient=v,n.__decorate([(0,r.Autowired)(c.DiskFileServicePath),n.__metadata("design:type",Object)],v.prototype,"fileServiceProvider",void 0),n.__decorate([(0,o.debounce)(100),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Array]),n.__metadata("design:returntype",void 0)],v.prototype,"setWatchFileExcludes",null),t.DiskFsProviderClient=v=n.__decorate([(0,r.Injectable)()],v)},96708:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileServiceClientModule=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(42933),p=e(70671),v=e(2156),m=e(69037),_=e(60476),s=e(23188);let g=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:c.IFileServiceClient,useClass:v.FileServiceClient},{token:c.IBrowserFileSystemRegistry,useClass:v.BrowserFileSystemRegistryImpl},{token:c.IDiskFileProvider,useClass:_.DiskFsProviderClient},{token:c.IShadowFileProvider,useClass:s.ShadowFileSystemProvider},m.FileServiceContribution],this.backServices=[{servicePath:c.DiskFileServicePath,clientToken:c.IDiskFileProvider,protocol:p.DiskFileServiceProtocol}]}};t.FileServiceClientModule=g,t.FileServiceClientModule=g=n.__decorate([(0,r.Injectable)()],g)},23188:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShadowFileSystemProvider=void 0;const n=e(85608),r=e(76003),o=e(41869);let c=class{constructor(){this.capabilities=2048,this.onDidChangeCapabilities=o.Event.None,this.readonly=!0,this.shadowFiles=new Map,this.fileChangeEmitter=new o.Emitter,this.onDidChangeFile=this.fileChangeEmitter.event}unwatch(v){throw new Error("Method not implemented.")}readFileStream(v){throw new Error("Method not implemented.")}watch(v,m){throw new Error("Method not implemented.")}stat(v){return Promise.resolve({uri:v.toString(),lastModification:0})}readDirectory(v){throw new Error("Method not implemented.")}createDirectory(v){throw new Error("Method not implemented.")}readFile(v){return this.shadowFiles.get(v.toString())||o.BinaryBuffer.fromString("no available").buffer}writeFile(v,m,_){this.shadowFiles.set(v.toString(),m)}delete(v,m){throw new Error("Method not implemented.")}rename(v,m,_){throw new Error("Method not implemented.")}copy(v,m,_){throw new Error("Method not implemented.")}exists(v){throw new Error("Method not implemented.")}access(v,m){throw new Error("Method not implemented.")}};t.ShadowFileSystemProvider=c,t.ShadowFileSystemProvider=c=n.__decorate([(0,r.Injectable)()],c)},81952:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystemWatcher=void 0;const n=e(43718);function r(c,p){return c.filter(v=>!!v.uri.startsWith(p))}class o{constructor(p){this.toDispose=new n.DisposableCollection,this.changeEmitter=new n.Emitter,this.toDispose.push(this.changeEmitter),this.fileServiceClient=p.fileServiceClient,this.watchId=p.watchId,this.uri=p.uri,this.fileServiceClient.onFilesChanged(v=>{const m=r(v,this.uri.toString());m&&m.length>0&&this.changeEmitter.fire(m)})}get onFilesChanged(){return this.changeEmitter.event}dispose(){return Promise.all([this.toDispose.dispose(),this.fileServiceClient.unwatchFileChanges(this.watchId)])}isDisposed(){return this.toDispose.disposed}}t.FileSystemWatcher=o},91813:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EXT_LIST_TEXT=t.EXT_LIST_IMAGE=t.EXT_LIST_VIDEO=void 0,t.getFileTypeByExt=e,t.EXT_LIST_VIDEO=new Set(["mp4","webm","mkv","mov","mts","flv","avi","wmv"]),t.EXT_LIST_IMAGE=new Set(["png","gif","jpg","jpeg","svg","bmp","avif","cr2","cr3","dng","flif","heic","icns","jxl","jpm","jpx","nef","raf","rw2","tif","orf","webp","apng"]),t.EXT_LIST_TEXT=new Set(["xml"]);function e(n){let r="text";return n&&(t.EXT_LIST_IMAGE.has(n)?r="image":t.EXT_LIST_VIDEO.has(n)?r="video":t.EXT_LIST_TEXT.has(n)?r="text":r="binary"),r}},79929:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IBrowserFileSystemRegistry=t.IFileServiceClient=void 0;const n=e(43718);t.IFileServiceClient=n.IFileServiceClient,t.IBrowserFileSystemRegistry=Symbol("IBrowserFileSystemRegistry")},49818:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystemError=t.FileOperationError=t.FileSystemProviderError=t.FileSystemProviderErrorCode=t.FileAccess=t.IFileService=t.IShadowFileProvider=t.IDiskFileProvider=t.FileStat=t.FileType=void 0,t.createFileSystemProviderError=_,t.markAsFileSystemProviderError=s,t.containsExtraFileMethod=l,t.notEmpty=h,t.isErrnoException=u,t.handleError=d;const n=e(85608),r=e(43718);var o=e(31036);Object.defineProperty(t,"FileType",{enumerable:!0,get:function(){return o.FileType}}),Object.defineProperty(t,"FileStat",{enumerable:!0,get:function(){return o.FileStat}}),n.__exportStar(e(11854),t),t.IDiskFileProvider=Symbol("IDiskFileProvider"),t.IShadowFileProvider=Symbol("IShadowFileProvider"),t.IFileService=Symbol("IFileService");var c;(function(E){let f;(function(a){a.F_OK=0,a.R_OK=4,a.W_OK=2,a.X_OK=1})(f=E.Constants||(E.Constants={}))})(c||(t.FileAccess=c={}));var p;(function(E){E.FileExists="EntryExists",E.FileNotFound="EntryNotFound",E.FileNotADirectory="EntryNotADirectory",E.FileIsADirectory="EntryIsADirectory",E.FileIsOutOfSync="FileIsOutOfSync",E.FileExceedsMemoryLimit="EntryExceedsMemoryLimit",E.FileTooLarge="EntryTooLarge",E.FileWriteLocked="EntryWriteLocked",E.NoPermissions="NoPermissions",E.Unavailable="Unavailable",E.Unknown="Unknown"})(p||(t.FileSystemProviderErrorCode=p={}));class v extends Error{static declare(f,a){return Object.assign((...b)=>_(a(...b),f),{is:b=>{var y;return(y=b.stack)===null||y===void 0?void 0:y.startsWith(f)}})}constructor(f,a){super(f),this.code=a}is(f){return this.name===f.name}}t.FileSystemProviderError=v;class m extends Error{constructor(f,a,b){super(f),this.fileOperationResult=a,this.options=b}static isFileOperationError(f){return f instanceof Error&&!(0,r.isUndefinedOrNull)(f.fileOperationResult)}}t.FileOperationError=m;function _(E,f){const a=new v(E.toString(),f);return s(a,f),a}function s(E,f){return E.name=f?`${f} (FileSystemError)`:"FileSystemError",E}var g;(function(E){E.FileNotFound=v.declare(p.FileNotFound,(f,a)=>`${a?a+" ":""} '${f}' is not found.`),E.FileExists=v.declare(p.FileExists,(f,a)=>`${a?a+" ":""}'${f}' already exists.`),E.FileNotADirectory=v.declare(p.FileNotADirectory,(f,a)=>`${a?a+" ":""}'${f}' is not a directory.`),E.FileIsADirectory=v.declare(p.FileIsADirectory,(f,a)=>`${a?a+" ":""}'${f}' is a directory.`),E.FileIsOutOfSync=v.declare(p.FileIsOutOfSync,(f,a)=>`${a?a+" ":""}'${f}' is out of sync.`),E.FileExceedsMemoryLimit=v.declare(p.FileExceedsMemoryLimit,(f,a)=>`${a?a+" ":""}'${f}' is exceeds memory limit.`),E.FileTooLarge=v.declare(p.FileTooLarge,(f,a)=>`${a?a+" ":""}'${f}' is too large.`),E.FileWriteLocked=v.declare(p.FileWriteLocked,(f,a)=>`${a?a+" ":""}'${f}' is locked.`),E.FileIsNoPermissions=v.declare(p.NoPermissions,(f,a)=>`${a?a+" ":""}'${f}' is no permissions.`),E.Unavailable=v.declare(p.Unavailable,(f,a)=>`${a?a+" ":""}'${f}' is unavailable.`),E.Unknown=v.declare(p.Unknown,(f,a)=>`${a?a+" ":""}'${f}' is unkonw.`)})(g||(t.FileSystemError=g={}));function l(E,f){return(0,r.hasProperty)(E,f)&&(0,r.isFunction)(E[f])}function h(E){return E!==void 0}function u(E){return E.code!==void 0&&E.errno!==void 0}function d(E){var f,a,b,y,A;if(u(E))switch(E.code){case"EEXIST":throw g.FileExists(r.Uri.file((f=E.path)!==null&&f!==void 0?f:""));case"EPERM":case"EACCESS":throw g.FileIsNoPermissions(r.Uri.file((a=E.path)!==null&&a!==void 0?a:""));case"ENOENT":throw g.FileNotFound(r.Uri.file((b=E.path)!==null&&b!==void 0?b:""));case"ENOTDIR":throw g.FileNotADirectory(r.Uri.file((y=E.path)!==null&&y!==void 0?y:""));case"EISDIR":throw g.FileIsADirectory(r.Uri.file((A=E.path)!==null&&A!==void 0?A:""))}throw E}},42933:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(79929),t),n.__exportStar(e(49818),t),n.__exportStar(e(28217),t),n.__exportStar(e(91813),t),n.__exportStar(e(50295),t)},70671:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiskFileServiceProtocol=void 0;const n=e(26387),r=e(52890),o=e(50295);t.DiskFileServiceProtocol={name:o.DiskFileServicePath,methods:[{method:"readFile",request:[{name:"uri",type:r.UriComponentsProto}],response:{type:n.Type.binary()}}]}},50295:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileExtServicePath=t.FileWatcherServicePath=t.ShadowFileServicePath=t.DiskFileServicePath=t.FileServicePath=void 0,t.FileServicePath="FileService",t.DiskFileServicePath="DiskFileService",t.ShadowFileServicePath="ShadowFileService",t.FileWatcherServicePath="FileWatcherService",t.FileExtServicePath="FileExtServicePath"},28217:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WatcherProcessManagerProxy=t.WatcherServiceProxy=t.WATCHER_INIT_DATA_KEY=t.SUMI_WATCHER_PROCESS_SOCK_KEY=t.INsfw=void 0;const n=e(86058);var r;(function(o){let c;(function(p){p[p.CREATED=0]="CREATED",p[p.DELETED=1]="DELETED",p[p.MODIFIED=2]="MODIFIED",p[p.RENAMED=3]="RENAMED"})(c=o.actions||(o.actions={}))})(r||(t.INsfw=r={})),t.SUMI_WATCHER_PROCESS_SOCK_KEY="sumi-watcher-process-sock",t.WATCHER_INIT_DATA_KEY="sumi-watcher-init-data",t.WatcherServiceProxy=new n.ProxyIdentifier("WatcherHostServiceImpl"),t.WatcherProcessManagerProxy=new n.ProxyIdentifier("WatcherProcessManagerProxy")},14951:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(42933),t)},57942:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeDialogModel=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(26542),m=e(6250),_=e(2812),s=r.__importDefault(e(89200)),g=e(9018);let l=n=class{static createContainer(u,d){return u.createChild([{token:m.IFileDialogTreeService,useValue:d},{token:m.IFileDialogModel,useClass:n}])}static createModel(u,d){return n.createContainer(u,d).get(m.IFileDialogModel)}constructor(){this.selectedDecoration=new c.Decoration(s.default.mod_selected),this.focusedDecoration=new c.Decoration(s.default.mod_focused),this.loadingDecoration=new c.Decoration(s.default.mod_loading),this.cutDecoration=new c.Decoration(s.default.mod_cut),this._selectedFiles=[],this.disposableCollection=new p.DisposableCollection,this.onDidFocusedFileChangeEmitter=new p.Emitter,this.onDidSelectedFileChangeEmitter=new p.Emitter,this.clearFileSelectedDecoration=()=>{this._selectedFiles.forEach(u=>{this.selectedDecoration.removeTarget(u)}),this._selectedFiles=[],this.onDidSelectedFileChangeEmitter.fire([])},this.activeFileDecoration=(u,d=!0)=>{u!==this.treeModel.root&&(this.preContextMenuFocusedFile&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile),this.preContextMenuFocusedFile=null),u&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(E=>{this.selectedDecoration.removeTarget(E)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(u),this.focusedDecoration.addTarget(u),this._focusedFile=u,this._selectedFiles=[u],this.onDidFocusedFileChangeEmitter.fire(u.uri),this.onDidSelectedFileChangeEmitter.fire([u.uri]),d&&this.treeModel.dispatchChange()))},this.selectFileDecoration=(u,d=!0)=>{u!==this.treeModel.root&&(this.preContextMenuFocusedFile&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile),this.preContextMenuFocusedFile=null),u&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(E=>{this.selectedDecoration.removeTarget(E)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(u),this._selectedFiles=[u],this.onDidSelectedFileChangeEmitter.fire([u.uri]),d&&this.treeModel.dispatchChange()))},this.activeFileFocusedDecoration=(u,d=!1)=>{u!==this.treeModel.root&&(this.focusedFile!==u&&(d?(this.preContextMenuFocusedFile?(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile)):this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.preContextMenuFocusedFile=u):this.focusedFile&&(this.preContextMenuFocusedFile=null,this.focusedDecoration.removeTarget(this.focusedFile)),u&&(this.selectedDecoration.addTarget(u),this.focusedDecoration.addTarget(u),this._focusedFile=u,this._selectedFiles.push(u),this.onDidFocusedFileChangeEmitter.fire(u.uri),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(E=>E.uri)))),this.treeModel.dispatchChange())},this.activeFileSelectedDecoration=u=>{this._selectedFiles.indexOf(u)>-1||(this._selectedFiles.push(u),this.selectedDecoration.addTarget(u),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(d=>d.uri)),this.treeModel.dispatchChange())},this.activeFileDecorationByRange=(u,d)=>{for(this.clearFileSelectedDecoration(),this.preContextMenuFocusedFile=null;u<=d;u++){const E=this.treeModel.root.getTreeNodeAtIndex(u);E&&(this._selectedFiles.push(E),this.selectedDecoration.addTarget(E))}this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(E=>E.uri)),this.treeModel.dispatchChange()},this.enactiveFileDecoration=()=>{this.focusedFile&&(this.focusedDecoration.removeTarget(this.focusedFile),this.onDidFocusedFileChangeEmitter.fire(),this.treeModel.dispatchChange()),this._focusedFile=void 0},this.toggleDirectory=async u=>{u.expanded?this.fileTreeHandle.collapseNode(u):this.fileTreeHandle.expandNode(u)},this.handleTreeBlur=()=>{this.enactiveFileDecoration()},this.handleTreeFocus=()=>{},this.handleItemRangeClick=(u,d)=>{if(!this.focusedFile)this.handleItemClick(u,d);else if(this.focusedFile&&this.focusedFile!==u){const E=this.treeModel.root.getIndexAtTreeNode(u),f=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);f>E?this.activeFileDecorationByRange(E,f):f<E&&this.activeFileDecorationByRange(f,E)}},this.handleItemToggleClick=(u,d)=>{d!==c.TreeNodeType.CompositeTreeNode&&d!==c.TreeNodeType.TreeNode||(this.selectedFiles.indexOf(u)>-1?this.focusedFile===u?this.enactiveFileDecoration():this.activeFileFocusedDecoration(u):this.activeFileSelectedDecoration(u))},this.handleItemClick=(u,d)=>{this.clickTimes++,(d===c.TreeNodeType.CompositeTreeNode||d===c.TreeNodeType.TreeNode)&&this.activeFileDecoration(u),d===c.TreeNodeType.CompositeTreeNode&&this.corePreferences["workbench.list.openMode"]==="singleClick"&&this.toggleDirectory(u),this.clickTimer&&clearTimeout(this.clickTimer),this.clickTimer=setTimeout(()=>{this.clickTimes>1&&d!==c.TreeNodeType.TreeNode&&this.corePreferences["workbench.list.openMode"]==="doubleClick"&&this.toggleDirectory(u),this.clickTimes=0},200)},this.getDirectoryList=()=>this.fileTreeDialogService.getDirectoryList(),this._whenReady=this.initTreeModel()}get onDidFocusedFileChange(){return this.onDidFocusedFileChangeEmitter.event}get onDidSelectedFileChange(){return this.onDidSelectedFileChangeEmitter.event}get fileTreeHandle(){return this._fileTreeHandle}get decorations(){return this._decorations}get treeModel(){return this._treeModel}get whenReady(){return this._whenReady}get focusedFile(){return this._focusedFile}get selectedFiles(){return this._selectedFiles}async initTreeModel(){const u=(await this.fileTreeDialogService.resolveChildren())[0];this._treeModel=this.injector.get(_.FileTreeModel,[u]),this.initDecorations(u),this.disposableCollection.push(this._decorations),this.disposableCollection.push(this.labelService.onDidChange(()=>{this.treeModel.dispatchChange()})),this.disposableCollection.push(this.treeModel.root.watcher.on(c.TreeNodeEvent.WillResolveChildren,d=>{this.loadingDecoration.addTarget(d)})),this.disposableCollection.push(this.treeModel.root.watcher.on(c.TreeNodeEvent.DidResolveChildren,d=>{this.loadingDecoration.removeTarget(d)}))}async updateTreeModel(u){const d=await this.fileTreeDialogService.resolveRoot(u);if(d&&d.length>0){const E=d[0];this._treeModel=this.injector.get(_.FileTreeModel,[E]),this.clearFileSelectedDecoration(),this.initDecorations(E)}}initDecorations(u){this._decorations&&this._decorations.dispose(),this._decorations=new c.DecorationsManager(u),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.cutDecoration),this._decorations.addDecoration(this.loadingDecoration)}handleTreeHandler(u){this._fileTreeHandle=u}dispose(){this.disposableCollection.dispose()}};t.FileTreeDialogModel=l,l.FILE_TREE_SNAPSHOT_KEY="FILE_TREE_SNAPSHOT",l.DEFAULT_LOCATION_FLUSH_DELAY=500,r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],l.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(m.IFileDialogTreeService),r.__metadata("design:type",g.FileTreeDialogService)],l.prototype,"fileTreeDialogService",void 0),r.__decorate([(0,o.Autowired)(v.LabelService),r.__metadata("design:type",v.LabelService)],l.prototype,"labelService",void 0),r.__decorate([(0,o.Autowired)(p.CorePreferences),r.__metadata("design:type",Object)],l.prototype,"corePreferences",void 0),t.FileTreeDialogModel=l=n=r.__decorate([(0,o.Injectable)(),r.__metadata("design:paramtypes",[])],l)},69748:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FILE_TREE_BADGE_LIMIT=t.FILE_TREE_NODE_HEIGHT=t.FileTreeDialogNode=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=e(97267),p=e(41869),v=e(69959),m=n.__importDefault(e(89200)),_=({item:s,onClick:g,itemType:l,labelService:h,leftPadding:u=8,onTwistierClick:d,decorations:E,defaultLeftPadding:f=8,template:a})=>{const b=l===c.TreeNodeType.RenamePrompt,y=l===c.TreeNodeType.NewPrompt,A=b||y,S=(0,p.useDesignStyles)(m.default.expansion_toggle,"expansion_toggle"),w=(0,p.useDesignStyles)(m.default.file_tree_node,"file_tree_node"),T=W=>{(l===c.TreeNodeType.TreeNode||l===c.TreeNodeType.CompositeTreeNode)&&g(W,s,l)},D=W=>{(l===c.TreeNodeType.TreeNode||l===c.TreeNodeType.CompositeTreeNode)&&(d?d(W,s,l):g(W,s,l))},I=l===c.TreeNodeType.CompositeTreeNode;let O;A?y?O=`${f+(s.parent.depth+1||0)*(u||0)}px`:O=`${f+(s.target.depth||0)*(u||0)}px`:O=I?`${f+(s.depth||0)*(u||0)}px`:`${f+(s.depth||0)*(u||0)+8}px`;const M={height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`,paddingLeft:O},R=(W,U)=>{if(E&&E?.classlist.indexOf(m.default.mod_loading)>-1)return o.default.createElement(c.Loading,null);if(A&&W instanceof c.PromptHandle){let Q=!1;if(b?Q=W.target.type===c.TreeNodeType.CompositeTreeNode:Q=W.type===c.TreeNodeType.CompositeTreeNode,Q)return o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,S,(0,p.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:y||!(b&&W.target.type===c.TreeNodeType.CompositeTreeNode&&W.target.expanded)})})}else return o.default.createElement("div",{onClick:U,className:(0,r.default)(m.default.file_tree_node_segment,S,(0,p.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:!W.expanded})})},P=W=>{let U,Q;A&&W instanceof c.PromptHandle?W instanceof c.RenamePromptHandle?(U=W.target.uri.resolve(W.$.value),Q=v.Directory.is(W.target)):(U=W.parent.uri.resolve(W.$.value),Q=W.type===c.TreeNodeType.CompositeTreeNode):(U=W.uri,Q=W.filestat.isDirectory);const V=h.getIcon(U,{isDirectory:Q});return o.default.createElement("div",{className:(0,r.default)(m.default.file_icon,V,{expanded:Q&&W.expanded}),style:{height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`}})},k=W=>a?o.default.createElement(a,null):A&&W instanceof c.PromptHandle?o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_inputbox)},o.default.createElement("div",{className:(0,r.default)("input-box",m.default.file_tree_node_prompt_box)},o.default.createElement(W.ProxiedInput,{wrapperStyle:{height:t.FILE_TREE_NODE_HEIGHT,padding:"0 5px"}}))):o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_displayname)},W.name),F=()=>o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_tail)},L()),L=()=>null,B=W=>{if(I)return R(W,D);if(A)return R(W,()=>{})},j=()=>s.tooltip||s.name;return o.default.createElement("div",{key:s.id,onClick:T,title:j(),className:(0,r.default)(w,E?E.classlist:null),style:M,draggable:l===c.TreeNodeType.TreeNode||l===c.TreeNodeType.CompositeTreeNode},o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_content)},B(s),P(s),o.default.createElement("div",{className:A?m.default.file_tree_node_prompt_wrap:m.default.file_tree_node_overflow_wrap},k(s)),F()))};t.FileTreeDialogNode=_,t.FILE_TREE_NODE_HEIGHT=22,t.FILE_TREE_BADGE_LIMIT=99},68195:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileDialogContextKey=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(66e3);let p=class{initScopedContext(m){this._contextKeyService=this.globalContextKeyService.createScoped(m),this.fileDialogViewVisibleContext=c.FileDialogViewVisibleContext.bind(this._contextKeyService)}get service(){return this._contextKeyService}};t.FileDialogContextKey=p,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],p.prototype,"globalContextKeyService",void 0),t.FileDialogContextKey=p=n.__decorate([(0,r.Injectable)()],p)},9018:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeDialogService=void 0;const n=e(85608),r=e(76003),o=e(97267),c=e(41869),p=e(26542),v=e(54414),m=e(14951),_=e(72665),s=e(51500),g=e(6250),l=e(57781),h=e(97738),u=e(68195);let d=class extends o.Tree{constructor(f){super(),this._whenReady=this.resolveWorkspaceRoot(f)}get whenReady(){return this._whenReady}async resolveWorkspaceRoot(f){if(f){const a=new c.URI(f).withScheme(c.Schemes.file),b=await this.fileTreeAPI.resolveFileStat(a);b&&(this.workspaceRoot=b)}}async resolveChildren(f){if(f){if(f.uri){const{children:a}=await this.fileTreeAPI.resolveChildren(this,f.uri.toString(),f);return a}}else{this.workspaceRoot||(this.workspaceRoot=(await this.workspaceService.roots)[0]);const{children:a}=await this.fileTreeAPI.resolveChildren(this,this.workspaceRoot);return this.root=a[0],a}return[]}async resolveRoot(f){let a;/^file:\/\//.test(f)&&(a=new c.URI(f)),a=c.URI.file(f);const b=await this.fileTreeAPI.resolveFileStat(a);if(b){const{children:y}=await this.fileTreeAPI.resolveChildren(this,b);return this.root=y[0],y}}getDirectoryList(){const f=[];if(!this.root)return f;let a=new c.URI(this.workspaceRoot.uri);if(a&&a.parent)for(;a.parent;){const b=a.codeUri.fsPath;if(f.indexOf(b)>=0)break;f.push(b),a=a.parent}else f.push(a.codeUri.fsPath.toString());return f}sortComparator(f,a){return f.constructor===a.constructor?f.name.startsWith(".")&&!a.name.startsWith(".")?1:!f.name.startsWith(".")&&a.name.startsWith(".")?-1:f.name.localeCompare(a.name,"kn",{numeric:!0}):f.type===o.TreeNodeType.CompositeTreeNode?-1:a.type===o.TreeNodeType.CompositeTreeNode?1:0}initContextKey(f){f&&this.fileDialogContextKey.initScopedContext(f)}get contextKey(){return this.fileDialogContextKey}async saveAs(f){const{oldFilePath:a,newFilePath:b}=f;if(!a||!b)throw new Error("oldFilePath and newFilePath are required");await this.createFile(f);try{const y=c.URI.file(f.newFilePath),A={preview:!1,focus:!0,replace:!0,forceClose:!0,disableNavigate:!1};await this.workbenchEditorService.open(y,A),await this.fileTreeModelService.clearFileSelectedDecoration();const S=this.fileTreeService.getNodeByPathOrUri(y);S&&await this.fileTreeModelService.activeFileDecoration(S)}catch(y){throw new Error(`Failed to open saveAs file: ${y.message}`)}}async createFile(f){try{const{oldFilePath:a,newFilePath:b}=f;if(!await this.fileServiceClient.getFileStat(a))throw new Error(`Source file not found: ${a}`);const{content:A}=await this.fileServiceClient.readFile(a);await this.fileServiceClient.createFile(b,{content:A.toString(),encoding:"utf8",overwrite:!0})}catch(a){throw new Error(`Failed to create file: ${a.message}`)}}renderCustomMsg(){return null}async getDefaultFilePath(f,a){return a}dispose(){super.dispose()}};t.FileTreeDialogService=d,n.__decorate([(0,r.Autowired)(g.IFileTreeAPI),n.__metadata("design:type",Object)],d.prototype,"fileTreeAPI",void 0),n.__decorate([(0,r.Autowired)(s.IWorkspaceService),n.__metadata("design:type",Object)],d.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(p.LabelService),n.__metadata("design:type",p.LabelService)],d.prototype,"labelService",void 0),n.__decorate([(0,r.Autowired)(u.FileDialogContextKey),n.__metadata("design:type",u.FileDialogContextKey)],d.prototype,"fileDialogContextKey",void 0),n.__decorate([(0,r.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],d.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(v.WorkbenchEditorService),n.__metadata("design:type",v.WorkbenchEditorService)],d.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(_.IDialogService),n.__metadata("design:type",Object)],d.prototype,"dialogService",void 0),n.__decorate([(0,r.Autowired)(h.FileTreeModelService),n.__metadata("design:type",h.FileTreeModelService)],d.prototype,"fileTreeModelService",void 0),n.__decorate([(0,r.Autowired)(g.IFileTreeService),n.__metadata("design:type",l.FileTreeService)],d.prototype,"fileTreeService",void 0),t.FileTreeDialogService=d=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[String])],d)},51888:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileDialog=t.FILE_TREE_DIALOG_HEIGHT=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),c=e(41869),p=e(68974),v=e(72665),m=e(69748),_=n.__importDefault(e(13294));t.FILE_TREE_DIALOG_HEIGHT=22;const s=({options:g,model:l,isOpenDialog:h,fileService:u})=>{const d=(0,c.useInjectable)(v.IDialogService),E=(0,r.useRef)(null),[f,a]=(0,r.useState)(g.defaultFileName||""),[b,y]=(0,r.useState)(!1),[A,S]=(0,r.useState)(""),[w,T]=(0,r.useState)([]),D=(0,r.useRef)(g.defaultFileName||"");(0,r.useEffect)(()=>{var ie;return l&&(y(!1),R(),(ie=u.contextKey.fileDialogViewVisibleContext)===null||ie===void 0||ie.set(!0)),()=>{l.dispose()}},[l]),(0,r.useEffect)(()=>{g.defaultFileName&&(a(g.defaultFileName||""),D.current=g.defaultFileName||"")},[g]),(0,r.useEffect)(()=>{if(b){const ie=l.getDirectoryList();T(ie)}},[b]);const I=(0,r.useCallback)(()=>{const ie=l.selectedFiles.map(oe=>oe.uri.path.toString());if(D.current&&g.showNameInput&&(ie?.length===1||g.defaultUri)){const oe=ie?.length===1?ie[0]:g.defaultUri.path.toString();g?.saveAs&&u.saveAs({oldFilePath:c.path.join(oe,g?.defaultFileName||""),newFilePath:c.path.join(oe,D.current)}),d.hide([c.path.join(oe,D.current)])}else ie.length>0?d.hide(ie):A?d.hide([A]):g.defaultUri?d.hide([g.defaultUri.path.toString()]):l.treeModel&&l.treeModel.root?d.hide([l.treeModel.root.uri.path.toString()]):d.hide([]);y(!1),u.contextKey.fileDialogViewVisibleContext.set(!1)},[b,d,l,g,A]),O=async ie=>{let oe=ie.treeModel.root.uri.codeUri.fsPath;return u.getDefaultFilePath&&(oe=await u.getDefaultFilePath(ie,oe)),oe},M=(0,r.useCallback)(()=>{y(!1),d.hide(),u.contextKey.fileDialogViewVisibleContext.set(!1)},[b,d]),R=(0,r.useCallback)(async()=>{await l.whenReady,await l.treeModel.ensureReady;const ie=await O(l);S(ie),y(!0)},[l,A,b]),P=!h,k=(0,r.useCallback)(ie=>{l.handleTreeHandler({...ie,getModel:()=>l.treeModel})},[l]),F=(0,r.useCallback)((ie,oe)=>{ie.stopPropagation();const{toggleDirectory:le}=l;le(oe)},[l]),L=(0,r.useCallback)(ie=>B(ie)?!1:ie.shiftKey,[]),B=(0,r.useCallback)(ie=>{const{metaKey:oe,ctrlKey:le}=ie;return c.isMacintosh&&oe||le},[]),j=(0,r.useCallback)((ie,oe,le)=>{var pe;ie.stopPropagation();const{handleItemClick:q,handleItemToggleClick:Ee,handleItemRangeClick:_e}=l;if(!oe)return;const te=L(event),ge=B(event);if(te&&!P&&g.canSelectMany)_e(oe,le);else if(ge&&!P&&g.canSelectMany)Ee(oe,le);else if(P)le===o.TreeNodeType.CompositeTreeNode&&q(oe,le);else if(g.canSelectFiles&&le===o.TreeNodeType.TreeNode){const Te=new Set(Object.values((pe=g.filters)!==null&&pe!==void 0?pe:{}).flat().map(Pe=>`.${Pe}`));if(Te.size>0){const Pe=c.URI.parse(oe.filestat.uri).path.ext;Te.has(Pe)&&q(oe,le)}else q(oe,le)}else g.canSelectFolders&&le===o.TreeNodeType.CompositeTreeNode&&q(oe,le)},[l,P,g]),W=(0,r.useCallback)(async ie=>{y(!1),S(ie),await l.updateTreeModel(ie),y(!0)},[l,b,A]),U=(0,r.useCallback)(async ie=>{y(!1),S(ie),await l.updateTreeModel(ie),y(!0)},[l,b,A,w]),Q=(0,r.useCallback)(()=>u.renderCustomMsg?u.renderCustomMsg():null,[u.renderCustomMsg]),V=(0,r.useCallback)(ie=>r.default.createElement(m.FileTreeDialogNode,{item:ie.item,itemType:ie.itemType,labelService:l.labelService,decorations:l.decorations.getDecorations(ie.item),onClick:j,onTwistierClick:F,defaultLeftPadding:8,leftPadding:8}),[l.treeModel]),$=(0,r.useCallback)(()=>{if(b){if(l.treeModel)return r.default.createElement(o.RecycleTree,{height:300,itemHeight:t.FILE_TREE_DIALOG_HEIGHT,onReady:k,model:l.treeModel},V)}else return r.default.createElement(p.Progress,{loading:!0})},[b,l]),Y=(0,r.useMemo)(()=>u.showFilePathSearch!==!1,[u.showFilePathSearch]),z=(0,r.useCallback)(()=>{if(w.length>0)return r.default.createElement(o.Select,{onChange:W,onSearchChange:U,className:_.default.select_control,size:"large",searchPlaceholder:A,value:A,showSearch:Y},w.map((ie,oe)=>r.default.createElement(o.Option,{value:ie,key:`${oe} - ${ie}`},ie)))},[w,A]),H=(0,r.useCallback)(ie=>{const{key:oe}=c.KeyCode.createKeyCode(ie),le=ie.shiftKey||ie.metaKey||ie.altKey||ie.ctrlKey;oe&&c.Key.ENTER.keyCode===oe.keyCode&&!le&&I()},[I]);(0,r.useEffect)(()=>{var ie;return E.current&&(u.initContextKey(E.current),u.contextKey.fileDialogViewVisibleContext.set(!0),(ie=E.current)===null||ie===void 0||ie.addEventListener("keyup",H)),()=>{var oe;(oe=E.current)===null||oe===void 0||oe.removeEventListener("keyup",H)}},[]);const K=(0,r.useMemo)(()=>r.default.createElement(r.default.Fragment,null,Q(),r.default.createElement("div",{className:_.default.file_dialog_directory},z()),r.default.createElement("div",{className:_.default.file_dialog_content},$())),[z,$]),Z=(0,r.useMemo)(()=>r.default.createElement("div",{className:_.default.file_dialog_buttons},r.default.createElement(o.Button,{onClick:M,type:"ghost",className:_.default.button},(0,c.localize)("dialog.file.close")),r.default.createElement(o.Button,{onClick:I,type:"primary",className:_.default.button,disabled:P&&g.showNameInput&&f.length===0},h&&g.openLabel||(0,c.localize)("dialog.file.ok"))),[M,I,P,h,f,g]),X=(0,r.useCallback)(ie=>{a(ie.target.value),D.current=ie.target.value},[f]);return r.default.createElement("div",{className:_.default.file_dialog_wrapper,ref:E},r.default.createElement("div",{className:_.default.file_dialog_directory_title},h?g.title||(0,c.localize)("dialog.file.openLabel"):g.saveLabel||(0,c.localize)("dialog.file.saveLabel")),K,!h&&g.showNameInput&&r.default.createElement("div",{className:_.default.file_dialog_file_container},r.default.createElement("span",{className:_.default.file_dialog_file_name},(0,c.localize)("dialog.file.name"),": "),r.default.createElement(o.Input,{size:"small",value:f,autoFocus:!0,selection:{start:0,end:f.indexOf(".")||f.length},onChange:X})),Z)};t.FileDialog=s},89508:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowDialogServiceImpl=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(76003),c=e(41869),p=e(37406),v=e(14951),m=e(72665),_=e(57942),s=n.__importDefault(e(13294)),g=e(9018),l=e(51888);let h=class{constructor(){this.idx=1,this._whenReady=this.init()}async init(){this.recentGlobalStorage=await this.storageProvider(c.STORAGE_NAMESPACE.GLOBAL_RECENT_DATA);const d=await this.recentGlobalStorage.get("RECENT_DIALOG_DEFAULT_URI");if(d)this._defaultUri=new c.URI(d);else{const E=await this.fileServiceClient.getCurrentUserHome();this._defaultUri=new c.URI(E.uri)}}get defaultUri(){return this._defaultUri}get whenReady(){return this._whenReady}async updateRecentDefaultUri(d){this.recentGlobalStorage.set("RECENT_DIALOG_DEFAULT_URI",d.toString()),this._defaultUri=d}async showOpenDialog(d={}){this.dialogService.reset(),await this.whenReady;const E={canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1};if(this.appConfig.isElectronRenderer&&!this.appConfig.isRemote){const f=this.injector.get(p.IElectronMainUIService),a=[];d.canSelectFiles&&a.push("openFile"),d.canSelectFolders&&a.push("openDirectory"),d.canSelectMany&&a.push("multiSelections"),c.isMacintosh&&a.push("treatPackageAsDirectory","createDirectory");const b=d.defaultUri||this.defaultUri,y=await f.showOpenDialog(c.electronEnv.currentWindowId,{defaultPath:b.codeUri.fsPath,title:d.title,buttonLabel:d.openLabel,properties:a});if(y&&y.length>0){const A=y.map(S=>c.URI.file(S));return this.updateRecentDefaultUri(A[0].parent),A}else return}else{d.defaultUri||(d.defaultUri=this.defaultUri);let f;d.defaultUri?f=this.injector.get(g.FileTreeDialogService,[d.defaultUri.toString()]):f=this.injector.get(g.FileTreeDialogService),await f.whenReady;const a=_.FileTreeDialogModel.createModel(this.injector,f),b=await this.dialogService.open({message:r.default.createElement(l.FileDialog,{key:this.idx++,fileService:f,model:a,options:{...E,...d},isOpenDialog:!0}),type:c.MessageType.Empty,buttons:[],closable:!0,props:{className:s.default.file_dialog_wrapper}});if(this.dialogService.reset(),b&&b.length>0){const y=b.map(A=>c.URI.file(A));return this.updateRecentDefaultUri(y[0].parent),y}else return}}async showSaveDialog(d={}){if(await this.whenReady,this.appConfig.isElectronRenderer&&!this.appConfig.isRemote){const E=d.defaultUri||this.defaultUri,a=await this.injector.get(p.IElectronMainUIService).showSaveDialog(c.electronEnv.currentWindowId,{defaultPath:E.resolve(d.defaultFileName||"").codeUri.fsPath,title:d.saveLabel,message:d.saveLabel});if(a){const b=c.URI.file(a);return this.updateRecentDefaultUri(b.parent),b}else return}else{d.defaultUri||(d.defaultUri=this.defaultUri);let E;d.defaultUri?E=this.injector.get(g.FileTreeDialogService,[d.defaultUri.toString()]):E=this.injector.get(g.FileTreeDialogService),await E.whenReady;const f=_.FileTreeDialogModel.createModel(this.injector,E),a=await this.dialogService.open({message:r.default.createElement(l.FileDialog,{key:this.idx++,fileService:E,model:f,options:d,isOpenDialog:!1}),type:c.MessageType.Empty,buttons:[],closable:!0,props:{className:s.default.file_dialog_wrapper}});if(this.dialogService.reset(),a&&a.length>0){const b=c.URI.file(a[0]);return this.updateRecentDefaultUri(b.parent),b}else return}}};t.WindowDialogServiceImpl=h,n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],h.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(m.IDialogService),n.__metadata("design:type",Object)],h.prototype,"dialogService",void 0),n.__decorate([(0,o.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],h.prototype,"fileServiceClient",void 0),n.__decorate([(0,o.Autowired)(c.StorageProvider),n.__metadata("design:type",Function)],h.prototype,"storageProvider",void 0),n.__decorate([(0,o.Autowired)(c.AppConfig),n.__metadata("design:type",Object)],h.prototype,"appConfig",void 0),t.WindowDialogServiceImpl=h=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],h)},88014:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileContextKey=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(16413);let p=class{constructor(){this.explorerResourceIsFolder=c.ExplorerResourceIsFolderContext.bind(this.globalContextKeyService),this.explorerViewletVisibleContext=c.ExplorerViewletVisibleContext.bind(this.globalContextKeyService)}initScopedContext(m){this._contextKeyService=this.globalContextKeyService.createScoped(m),this.explorerFocused=c.ExplorerFocusedContext.bind(this._contextKeyService),this.explorerResourceCut=c.ExplorerResourceCut.bind(this._contextKeyService),this.filesExplorerFocused=c.FilesExplorerFocusedContext.bind(this._contextKeyService),this.filesExplorerInputFocused=c.FilesExplorerInputFocusedContext.bind(this._contextKeyService),this.filesExplorerFilteredContext=c.FilesExplorerFilteredContext.bind(this._contextKeyService),this.explorerCompressedFocusContext=c.ExplorerCompressedFocusContext.bind(this._contextKeyService),this.explorerCompressedFirstFocusContext=c.ExplorerCompressedFirstFocusContext.bind(this._contextKeyService),this.explorerCompressedLastFocusContext=c.ExplorerCompressedLastFocusContext.bind(this._contextKeyService)}get service(){return this._contextKeyService}};t.FileContextKey=p,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],p.prototype,"globalContextKeyService",void 0),t.FileContextKey=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},40439:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(16413),p=e(93899),v=e(68969),m=e(98295),_=e(41893),s=e(54414),g=e(32595),l=e(63067),h=e(58296),u=e(72665),d=e(55121),E=e(51500),f=e(6250),a=e(69959),b=e(56384),y=e(57781),A=e(97738),S=e(4446);let w=class{constructor(){this._disposables=new o.DisposableStore,this.isRendered=!1,this.deleteThrottler=new o.Throttler,this.willDeleteUris=[]}initialize(){this.workspaceService.initFileServiceExclude().then(async()=>{await this.fileTreeService.init(),this.fileTreeModelService.initTreeModel()}),this.progressService.registerProgressIndicator(g.EXPLORER_CONTAINER_ID)}async onStart(){this.viewsRegistry.registerViewWelcomeContent(f.RESOURCE_VIEW_ID,{content:(0,o.formatLocalize)("welcome-view.noFolderHelp",o.FILE_COMMANDS.OPEN_FOLDER.id),group:h.ViewContentGroups.Open,order:1}),this.mainLayoutService.collectViewComponent({id:f.RESOURCE_VIEW_ID,name:this.getWorkspaceTitle(),weight:3,priority:9,collapsed:!1,component:b.FileTree},g.EXPLORER_CONTAINER_ID),this._disposables.add(this.workspaceService.onWorkspaceLocationChanged(()=>{const D=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);D&&D.updateViewTitle(f.RESOURCE_VIEW_ID,this.getWorkspaceTitle())}))}onDidStart(){const D=this.injector.get(S.SymlinkDecorationsProvider,[this.fileTreeService]);this.decorationService.registerDecorationsProvider(D)}onDidRender(){this.isRendered=!0;const D=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);D&&(this.fileTreeModelService.whenReady.then(()=>{this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(D.isActivated())}),D.onActivate(()=>{this.fileTreeModelService.performLocationOnHandleShow(),this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(!0)}),D.onInActivate(()=>{this.fileTreeModelService.handleTreeBlur(),this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(!1)}))}getWorkspaceTitle(){let D=(0,o.localize)("file.empty.defaultTitle");const I=this.workspaceService.workspace;return I&&(D=new o.URI(I.uri).displayName,!I.isDirectory&&D.endsWith(`.${this.workspaceService.workspaceSuffixName}`)&&(D=D.slice(0,D.lastIndexOf(".")),D===E.UNTITLED_WORKSPACE))?(0,o.localize)("file.workspace.defaultTip"):D}onReconnect(){this.fileTreeService.reWatch()}revealFile(D){if(D)if(this.isRendered){const I=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);!I||!I.isVisible||I.isCollapsed(f.RESOURCE_VIEW_ID)?this.fileTreeModelService.locationOnShow(D):this.fileTreeModelService.location(D)}else this.fileTreeModelService.locationOnShow(D)}registerMenus(D){D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.NEW_FILE.id,label:(0,o.localize)("file.new")},order:1,group:"0_new"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.NEW_FOLDER.id,label:(0,o.localize)("file.folder.new")},order:2,group:"0_new"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,label:(0,o.localize)("workspace.addFolderToWorkspace")},order:1,group:"0_workspace",when:"config.workspace.supportMultiRootWorkspace"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.WORKSPACE_COMMANDS.REMOVE_WORKSPACE_FOLDER.id,label:(0,o.localize)("workspace.removeFolderFromWorkspace")},order:1,group:"0_workspace",when:"config.workspace.supportMultiRootWorkspace"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_RESOURCES.id,label:(0,o.localize)("file.open")},order:1,group:"1_open"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TO_THE_SIDE.id,label:(0,o.localize)("file.open.side")},order:2,group:"1_open"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TYPE_WITH.id,label:(0,o.localize)("file.open.type")},order:3,group:"1_open"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TERMINAL_WITH_PATH.id,label:(0,o.localize)("file.filetree.openTerminalWithPath")},when:"workbench.panel.terminal",order:4,group:"1_open"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.SEARCH_ON_FOLDER.id,label:(0,o.localize)("file.search.folder")},order:1,group:"2_search"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.DELETE_FILE.id,label:(0,o.localize)("file.delete")},order:1,group:"7_modification"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.RENAME_FILE.id,label:(0,o.localize)("file.rename")},order:3,group:"7_modification"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COMPARE_SELECTED.id,label:(0,o.localize)("file.compare")},order:2,group:"3_compare"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_FILE.id,label:(0,o.localize)("file.copy.file")},order:1,group:"5_cutcopypaste"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.CUT_FILE.id,label:(0,o.localize)("file.cut.file")},order:2,group:"5_cutcopypaste"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.PASTE_FILE.id,label:(0,o.localize)("file.paste.file")},order:3,group:"5_cutcopypaste"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_PATH.id,label:(0,o.localize)("file.copy.path")},group:"6_copypath"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_RELATIVE_PATH.id,label:(0,o.localize)("file.copy.relativepath")},group:"6_copypath"})}registerCommands(D){const I=()=>{this.fileTreeService.filterMode&&this.fileTreeService.toggleFilterMode()};D.registerCommand(o.FILE_COMMANDS.OPEN_TERMINAL_WITH_PATH,{execute:M=>{let R=M;if(!R)return;const P=this.fileTreeService.getNodeByPathOrUri(R);P&&!P.filestat.isDirectory&&(R=P.uri.parent),this.commandService.executeCommand(o.TERMINAL_COMMANDS.OPEN_WITH_PATH.id,R)}}),D.registerCommand(o.FILE_COMMANDS.SEARCH_ON_FOLDER,{execute:async M=>{var R;let P=M;if(P||(this.fileTreeModelService.focusedFile?P=this.fileTreeModelService.focusedFile.uri:this.fileTreeModelService.selectedFiles.length>0&&(P=(R=this.fileTreeModelService.selectedFiles[0])===null||R===void 0?void 0:R.uri)),!P)return;let k;if(this.fileTreeService.isMultipleWorkspace)for(const F of await this.workspaceService.roots){const L=new o.URI(F.uri);if(L.isEqualOrParent(P)){k=`./${L.relative(P).toString()}`;break}}else if(this.workspaceService.workspace){const F=new o.URI(this.workspaceService.workspace.uri);F.isEqualOrParent(P)&&(k=`./${F.relative(P).toString()}`)}this.commandService.executeCommand(o.SEARCH_COMMANDS.OPEN_SEARCH.id,{includeValue:k+"/"})},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&a.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.LOCATION,{execute:M=>{M?this.revealFile(M):this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0&&this.revealFile(this.fileTreeModelService.selectedFiles[0].uri)}}),D.registerCommand(o.FILE_COMMANDS.LOCATION_WITH_EDITOR,{execute:()=>{var M,R,P;((R=(M=this.workbenchEditorService.currentEditor)===null||M===void 0?void 0:M.currentUri)===null||R===void 0?void 0:R.scheme)===o.Schemes.file&&this.revealFile((P=this.workbenchEditorService.currentEditor)===null||P===void 0?void 0:P.currentUri)}}),D.registerCommand(o.FILE_COMMANDS.COLLAPSE_ALL,{execute:()=>{const M=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);!M||!M.isVisible||this.fileTreeModelService.collapseAll()}}),D.registerCommand(o.FILE_COMMANDS.REFRESH_ALL,{execute:async()=>{const M=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);!M||!M.isVisible||await this.fileTreeService.refresh()}}),D.registerCommand(o.FILE_COMMANDS.DELETE_FILE,{execute:(M,R)=>{if(I(),R?this.willDeleteUris=this.willDeleteUris.concat(R):this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0?this.willDeleteUris=this.willDeleteUris.concat(this.fileTreeModelService.selectedFiles.map(P=>P.uri)):this.fileTreeModelService.focusedFile&&this.willDeleteUris.push(this.fileTreeModelService.focusedFile.uri),this.willDeleteUris.length!==0)return this.deleteThrottler.queue(this.doDelete.bind(this))},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.RENAME_FILE,{execute:M=>{if(I(),!M)if(this.fileTreeModelService.contextMenuFile)M=this.fileTreeModelService.contextMenuFile.uri;else if(this.fileTreeModelService.focusedFile)M=this.fileTreeModelService.focusedFile.uri;else return;this.fileTreeModelService.renamePrompt(M)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.NEW_FILE,{execute:async M=>{var R;if(I(),M)this.fileTreeModelService.newFilePrompt(M);else if(this.fileTreeService.isCompactMode&&this.fileTreeModelService.activeUri)this.fileTreeModelService.newFilePrompt(this.fileTreeModelService.activeUri);else if(this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0)this.fileTreeModelService.newFilePrompt(this.fileTreeModelService.selectedFiles[0].uri);else{let P;this.fileTreeService.isMultipleWorkspace?P=new o.URI((await this.workspaceService.roots)[0].uri):P=new o.URI((R=this.workspaceService.workspace)===null||R===void 0?void 0:R.uri),this.fileTreeModelService.newFilePrompt(P)}}}),D.registerCommand(o.FILE_COMMANDS.NEW_FOLDER,{execute:async M=>{var R;if(I(),M)this.fileTreeModelService.newDirectoryPrompt(M);else if(this.fileTreeService.isCompactMode&&this.fileTreeModelService.activeUri)this.fileTreeModelService.newDirectoryPrompt(this.fileTreeModelService.activeUri);else if(this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0)this.fileTreeModelService.newDirectoryPrompt(this.fileTreeModelService.selectedFiles[0].uri);else{let P;this.fileTreeService.isMultipleWorkspace?P=new o.URI((await this.workspaceService.roots)[0].uri):P=new o.URI((R=this.workspaceService.workspace)===null||R===void 0?void 0:R.uri),this.fileTreeModelService.newDirectoryPrompt(P)}}}),D.registerCommand(o.FILE_COMMANDS.COMPARE_SELECTED,{execute:(M,R)=>{if(R&&R.length){const P=this.workbenchEditorService.currentEditor;P&&P.currentUri&&this.fileTreeService.compare(R[0],P.currentUri)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!a.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.OPEN_RESOURCES,{execute:M=>{this.fileTreeService.openAndFixedFile(M)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!a.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.OPEN_TO_THE_SIDE,{execute:M=>{this.fileTreeService.openToTheSide(M)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!a.Directory.is(this.fileTreeModelService.contextMenuFile)});const O=(M,R)=>{const{availableOpenTypes:P,currentOpenType:k}=this.workbenchEditorService.currentEditorGroup;if(!(P&&M&&k))return{items:[],selectIndex:-1};const F=this.preferenceService.get("workbench.editorAssociations"),L=[],B=(Q,V)=>V.type===s.EditorOpenType.code?Q.type===s.EditorOpenType.code:V.type===s.EditorOpenType.component&&Q.type===s.EditorOpenType.component?Q.componentId===V.componentId:!1,j=(Q,V)=>(Q?Q+=(0,o.localize)("file.open.type.detail.and")+V:Q=V,Q);let W,U;if(F){const Q=Object.keys(F).find(V=>(0,o.match)(V,M.path.toString().toLowerCase())||(0,o.match)(V,M.path.base.toLowerCase()));W=Q&&F[Q]}return P.forEach((Q,V)=>{var $;const Y={label:Q.title||Q.componentId||Q.type,detail:Q.title,run:z=>R(z,Q)};B(k,Q)&&(Y.description=j(Y.description,(0,o.localize)("file.open.type.detail.active")),U=V),W&&(!(($=Q.componentId)===null||$===void 0)&&$.endsWith(W))&&(Y.description=j(Y.description,(0,o.localize)("file.open.type.detail.default"))),L.push(new o.QuickOpenItem(Y))}),{items:L,selectIndex:U}};D.registerCommand(o.FILE_COMMANDS.OPEN_TYPE_WITH,{execute:M=>{const R=(L,B)=>{var j,W;return L===o.Mode.OPEN?((j=this.workbenchEditorService.currentEditorGroup)===null||j===void 0||j.changeOpenType((W=B.componentId)!==null&&W!==void 0?W:B.type),!0):!1},{items:P,selectIndex:k}=O(M,R);if(P.length===0||typeof k>"u")return;const F=L=>{this.quickOpenService.open({onType:(B,j)=>j(L)},{fuzzyMatchLabel:!0,ignoreFocusOut:!1,placeholder:(0,o.formatLocalize)("file.open.type.placeholder",M.path.base),selectIndex:()=>k})};P.push(new o.QuickOpenItem({label:(0,o.formatLocalize)("file.open.type.preference.default",`*${M.path.ext}`),showBorder:!0,run:L=>{if(L===o.Mode.OPEN){const B=(U,Q)=>{var V,$,Y;if(U===o.Mode.OPEN){const z="workbench.editorAssociations",H=this.preferenceService.resolve(z).scope,K=this.preferenceService.get(z);return this.preferenceService.set(z,{...K||{},[`*${M.path.ext}`]:(V=Q.componentId)!==null&&V!==void 0?V:Q.type},H),($=this.workbenchEditorService.currentEditorGroup)===null||$===void 0||$.changeOpenType((Y=Q.componentId)!==null&&Y!==void 0?Y:Q.type),!0}return!1},{items:j,selectIndex:W}=O(M,B);if(j.length===0||typeof W>"u")return!0;F(j)}return!1}})),F(P)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!a.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.COPY_PATH,{execute:async M=>{if(!M)return;let P=M.path.toString();if(M.scheme===s.DIFF_SCHEME){const F=M.getParsedQuery();P=new o.URI(F.modified).path.toString()}let k=decodeURIComponent(P);await this.appService.backendOS===o.OperatingSystem.Windows&&(k=k.slice(1)),await this.clipboardService.writeText(k)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile}),D.registerCommand(o.FILE_COMMANDS.COPY_RELATIVE_PATH,{execute:async M=>{if(!M)return;if(M.scheme===s.DIFF_SCHEME){const k=M.getParsedQuery();M=new o.URI(k.modified).withScheme("file")}const R=this.fileTreeService.getNodeByPathOrUri(M);if(R&&R.filestat.isInSymbolicDirectory)return await this.clipboardService.writeText(R.path.split(d.Path.separator).slice(2).join(d.Path.separator));let P;if(this.fileTreeService.isMultipleWorkspace)for(const k of await this.workspaceService.roots){if(P=new o.URI(k.uri),P.isEqual(M))return await this.clipboardService.writeText("./");if(P.isEqualOrParent(M))return await this.clipboardService.writeText(decodeURIComponent(P.relative(M).toString()))}else if(this.workspaceService.workspace)return P=new o.URI(this.workspaceService.workspace.uri),P.isEqual(M)?await this.clipboardService.writeText("./"):await this.clipboardService.writeText(decodeURIComponent(P.relative(M).toString()))},isVisible:()=>!!this.fileTreeModelService.contextMenuFile}),D.registerCommand(o.FILE_COMMANDS.COPY_FILE,{execute:(M,R)=>{if(R&&R.length)this.fileTreeModelService.copyFile(R);else{const P=this.fileTreeModelService.selectedFiles.map(k=>k.uri);P&&P.length&&this.fileTreeModelService.copyFile(P)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)||!!this.fileTreeModelService.focusedFile&&!this.fileTreeModelService.focusedFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.SELECT_CURRENT_NODE,{execute:(M,R)=>{if(R&&R.length)this.fileTreeModelService.selectChildNode(R);else{const P=this.fileTreeModelService.selectedFiles.map(k=>k.uri);P&&P.length&&this.fileTreeModelService.selectChildNode(P)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)||!!this.fileTreeModelService.focusedFile&&!this.fileTreeModelService.focusedFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.CUT_FILE,{execute:(M,R)=>{if(R&&R.length)this.fileTreeModelService.cutFile(R);else{const P=this.fileTreeModelService.selectedFiles.map(k=>k.uri);P&&P.length&&this.fileTreeModelService.cutFile(P)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)||!!this.fileTreeModelService.focusedFile&&!this.fileTreeModelService.focusedFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.PASTE_FILE,{execute:M=>{if(I(),M)this.fileTreeModelService.pasteFile(M);else if(this.fileTreeModelService.focusedFile){let R;this.fileTreeModelService.activeUri?R=this.fileTreeModelService.activeUri:R=this.fileTreeModelService.focusedFile.uri,this.fileTreeModelService.pasteFile(R)}},isEnabled:()=>this.fileTreeModelService.pasteStore&&this.fileTreeModelService.pasteStore.type!==f.PasteTypes.NONE||this.appConfig.isElectronRenderer}),D.registerCommand(o.FILE_COMMANDS.VSCODE_OPEN_FOLDER,{execute:(M,R)=>{const P=this.injector.get(o.IWindowService),k={newWindow:!0};return typeof R=="boolean"?k.newWindow=R:k.newWindow=typeof R?.forceNewWindow=="boolean"?R.forceNewWindow:!0,M?P.openWorkspace(M,k):this.commandService.executeCommand(o.FILE_COMMANDS.OPEN_FOLDER.id,k)},isVisible:()=>{const M=this.preferenceService.get("application.supportsOpenFolder");return M??!1}}),D.registerCommand(o.FILE_COMMANDS.OPEN_FOLDER,{execute:M=>{const R=this.injector.get(o.IWindowService);this.appConfig.isElectronRenderer?this.injector.get(o.IElectronNativeDialogService).showOpenDialog({title:(0,o.localize)("workspace.openDirectory"),properties:["openDirectory"]}).then(k=>{k&&k.length>0&&R.openWorkspace(o.URI.file(k[0]),M||{newWindow:!0})}):this.injector.get(u.IWindowDialogService).showOpenDialog({title:(0,o.localize)("workspace.openDirectory"),canSelectFiles:!1,canSelectFolders:!0}).then(k=>{var F;k&&k.length>0&&this.injector.get(E.IWorkspaceService).open(k[0],{preserveWindow:(F=M?.newWindow)!==null&&F!==void 0?F:!1})})},isVisible:()=>{const M=this.preferenceService.get("application.supportsOpenFolder");return M??!1}}),D.registerCommand(o.FILE_COMMANDS.OPEN_WORKSPACE,{execute:M=>{if(!this.preferenceService.get("application.supportsOpenWorkspace"))return;const P=this.injector.get(o.IWindowService);this.appConfig.isElectronRenderer?this.injector.get(o.IElectronNativeDialogService).showOpenDialog({title:(0,o.localize)("workspace.openWorkspace"),properties:["openFile"],filters:[{name:(0,o.localize)("workspace.openWorkspaceTitle"),extensions:[this.workspaceService.workspaceSuffixName]}]}).then(F=>{F&&F.length>0&&P.openWorkspace(o.URI.file(F[0]),M||{newWindow:!0})}):this.injector.get(u.IWindowDialogService).showOpenDialog({title:(0,o.localize)("workspace.openWorkspace"),canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1,filters:{workspace:[this.workspaceService.workspaceSuffixName]}}).then(F=>{var L;F&&F.length>0&&this.injector.get(E.IWorkspaceService).open(F[0],{preserveWindow:(L=M?.newWindow)!==null&&L!==void 0?L:!1})})},isVisible:()=>{const M=this.preferenceService.get("application.supportsOpenWorkspace");return M??!1}}),D.registerCommand(o.FILE_COMMANDS.REVEAL_IN_EXPLORER,{execute:M=>{var R;let P=M instanceof o.URI?M:M?.uri;const k=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);k&&!k.isVisible&&(k.activate(),setTimeout(()=>{k.setCollapsed(f.RESOURCE_VIEW_ID,!1)},200)),!P&&(!((R=this.workbenchEditorService.currentEditor)===null||R===void 0)&&R.currentUri)&&(P=this.workbenchEditorService.currentEditor.currentUri),P&&this.revealFile(o.URI.parse(P.toString()))}}),D.registerCommand(o.FILE_COMMANDS.FOCUS_FILES,{execute:()=>{const M=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);M&&M.activate()}}),D.registerCommand(o.FILE_COMMANDS.OPEN_FILE,{execute:M=>this.windowDialogService.showOpenDialog(M)}),D.registerCommand(o.FILE_COMMANDS.SAVE_FILE,{execute:M=>this.windowDialogService.showSaveDialog(M)}),D.registerCommand(o.FILE_COMMANDS.FILTER_TOGGLE,{execute:()=>this.fileTreeService.toggleFilterMode()}),D.registerCommand(o.FILE_COMMANDS.FILTER_OPEN,{execute:()=>{if(!this.fileTreeService.filterMode)return this.fileTreeService.toggleFilterMode()}}),D.registerCommand(o.FILE_COMMANDS.FILTER_CLOSE,{execute:()=>{this.fileTreeService.filterMode&&this.fileTreeService.toggleFilterMode()}}),D.registerCommand(o.FILE_COMMANDS.NEXT,{execute:()=>{this.fileTreeModelService.moveToNext()}}),D.registerCommand(o.FILE_COMMANDS.PREV,{execute:()=>{this.fileTreeModelService.moveToPrev()}}),D.registerCommand(o.FILE_COMMANDS.COLLAPSE,{execute:()=>{this.fileTreeModelService.collapseCurrentFile()}}),D.registerCommand(o.FILE_COMMANDS.EXPAND,{execute:()=>{this.fileTreeModelService.expandCurrentFile()}}),D.registerCommand(o.FILE_COMMANDS.TOGGLE_OR_OPEN,{execute:()=>{this.fileTreeModelService.toggleOrOpenCurrentFile()}}),D.registerCommand(o.WORKSPACE_COMMANDS.REMOVE_WORKSPACE_FOLDER,{execute:async(M,R)=>{if(I(),!R.length||!this.workspaceService.isMultiRootWorkspaceOpened)return;const P=await this.workspaceService.roots,k=R.filter(F=>P.find(L=>L.uri===F.toString()));k.length>0&&await this.workspaceService.removeRoots(k)},isVisible:()=>this.workspaceService.isMultiRootWorkspaceOpened&&!!this.fileTreeModelService.contextMenuFile&&!!this.workspaceService.tryGetRoots().find(M=>{var R;return M.uri===((R=this.fileTreeModelService.contextMenuFile)===null||R===void 0?void 0:R.uri.toString())})})}registerKeybindings(D){D.registerKeybinding({command:o.FILE_COMMANDS.COPY_FILE.id,keybinding:"ctrlcmd+c",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.PASTE_FILE.id,keybinding:"ctrlcmd+v",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.CUT_FILE.id,keybinding:"ctrlcmd+x",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.SELECT_CURRENT_NODE.id,keybinding:"ctrlcmd+a",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.RENAME_FILE.id,keybinding:"enter",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.DELETE_FILE.id,keybinding:"ctrlcmd+backspace",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.FILTER_OPEN.id,keybinding:"ctrlcmd+f",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.FILTER_CLOSE.id,keybinding:"esc",when:`${c.FilesExplorerFocusedContext.raw} && ${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.NEXT.id,keybinding:"down",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.PREV.id,keybinding:"up",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.EXPAND.id,keybinding:"right",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.COLLAPSE.id,keybinding:"left",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.TOGGLE_OR_OPEN.id,keybinding:"space",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`})}registerToolbarItems(D){D.registerItem({id:o.FILE_COMMANDS.LOCATION_WITH_EDITOR.id,command:o.FILE_COMMANDS.LOCATION_WITH_EDITOR.id,label:(0,o.localize)("file.location"),viewId:f.RESOURCE_VIEW_ID,when:`view == '${f.RESOURCE_VIEW_ID}' && !config.explorer.autoReveal && !${c.FilesExplorerFilteredContext.raw}`,order:0}),D.registerItem({id:o.FILE_COMMANDS.NEW_FILE.id,command:o.FILE_COMMANDS.NEW_FILE.id,label:(0,o.localize)("file.new"),viewId:f.RESOURCE_VIEW_ID,when:`view == '${f.RESOURCE_VIEW_ID}' && !${c.FilesExplorerFilteredContext.raw}`,order:1}),D.registerItem({id:o.FILE_COMMANDS.NEW_FOLDER.id,command:o.FILE_COMMANDS.NEW_FOLDER.id,label:(0,o.localize)("file.folder.new"),viewId:f.RESOURCE_VIEW_ID,when:`view == '${f.RESOURCE_VIEW_ID}' && !${c.FilesExplorerFilteredContext.raw}`,order:2}),D.registerItem({id:o.FILE_COMMANDS.FILTER_TOGGLE.id,command:o.FILE_COMMANDS.FILTER_TOGGLE.id,label:(0,o.localize)("file.filetree.filter"),viewId:f.RESOURCE_VIEW_ID,toggledWhen:`${c.FilesExplorerFilteredContext.raw}`,order:3}),D.registerItem({id:o.FILE_COMMANDS.REFRESH_ALL.id,command:o.FILE_COMMANDS.REFRESH_ALL.id,label:(0,o.localize)("file.refresh"),viewId:f.RESOURCE_VIEW_ID,when:`view == '${f.RESOURCE_VIEW_ID}' && !${c.FilesExplorerFilteredContext.raw}`,order:4}),D.registerItem({id:o.FILE_COMMANDS.COLLAPSE_ALL.id,command:o.FILE_COMMANDS.COLLAPSE_ALL.id,label:(0,o.localize)("file.collapse"),viewId:f.RESOURCE_VIEW_ID,order:5}),D.registerItem({id:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,command:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,label:(0,o.localize)("workspace.addFolderToWorkspace"),viewId:f.RESOURCE_VIEW_ID,order:0,group:"file_explore_workspace",when:"config.workspace.supportMultiRootWorkspace"})}doDelete(){const D=this.willDeleteUris.slice();return this.willDeleteUris=[],this.fileTreeModelService.deleteFileByUris(D)}dispose(){this._disposables.dispose()}};t.FileTreeContribution=w,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],w.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(f.IFileTreeService),n.__metadata("design:type",y.FileTreeService)],w.prototype,"fileTreeService",void 0),n.__decorate([(0,r.Autowired)(l.IMainLayoutService),n.__metadata("design:type",Object)],w.prototype,"mainLayoutService",void 0),n.__decorate([(0,r.Autowired)(v.IProgressService),n.__metadata("design:type",Object)],w.prototype,"progressService",void 0),n.__decorate([(0,r.Autowired)(E.IWorkspaceService),n.__metadata("design:type",Object)],w.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(A.FileTreeModelService),n.__metadata("design:type",A.FileTreeModelService)],w.prototype,"fileTreeModelService",void 0),n.__decorate([(0,r.Autowired)(_.IDecorationsService),n.__metadata("design:type",_.IDecorationsService)],w.prototype,"decorationService",void 0),n.__decorate([(0,r.Autowired)(s.WorkbenchEditorService),n.__metadata("design:type",s.WorkbenchEditorService)],w.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],w.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(u.IWindowDialogService),n.__metadata("design:type",Object)],w.prototype,"windowDialogService",void 0),n.__decorate([(0,r.Autowired)(o.IClipboardService),n.__metadata("design:type",Object)],w.prototype,"clipboardService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],w.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(o.QuickOpenService),n.__metadata("design:type",Object)],w.prototype,"quickOpenService",void 0),n.__decorate([(0,r.Autowired)(l.IViewsRegistry),n.__metadata("design:type",Object)],w.prototype,"viewsRegistry",void 0),n.__decorate([(0,r.Autowired)(o.IApplicationService),n.__metadata("design:type",Object)],w.prototype,"appService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],w.prototype,"appConfig",void 0),t.FileTreeContribution=w=n.__decorate([(0,m.Domain)(p.MenuContribution,o.CommandContribution,o.KeybindingContribution,o.TabBarToolbarContribution,o.ClientAppContribution,l.MainLayoutContribution)],w)},2812:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeModel=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(69959),m=e(93239);let _=n=class extends c.TreeModel{constructor(g){super(),this.flushDispatchChangeDelayer=new p.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this.init(g)}init(g){this.root=g,this.root.watcher.on(c.TreeNodeEvent.BranchDidUpdate,this.doDispatchChange.bind(this)),this.decorationService.onDidChange(this.doDispatchChange.bind(this))}doDispatchChange(){this.flushDispatchChangeDelayer.isTriggered()||this.flushDispatchChangeDelayer.cancel(),this.flushDispatchChangeDelayer.trigger(async()=>{this.dispatchChange()})}};t.FileTreeModel=_,_.DEFAULT_FLUSH_DELAY=100,r.__decorate([(0,o.Autowired)(m.FileTreeDecorationService),r.__metadata("design:type",m.FileTreeDecorationService)],_.prototype,"decorationService",void 0),t.FileTreeModel=_=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[v.Directory])],_)},46377:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FILE_TREE_BADGE_LIMIT=t.FILE_TREE_NODE_HEIGHT=t.FileTreeNode=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=e(97267),p=e(41869),v=e(69959),m=n.__importDefault(e(89200)),{Path:_}=p.path,s=({item:g,onClick:l,onDoubleClick:h,onContextMenu:u,dndService:d,itemType:E,decorationService:f,labelService:a,leftPadding:b=8,onTwistierClick:y,decorations:A,defaultLeftPadding:S=8,template:w,hasFolderIcons:T,hasFileIcons:D,hidesExplorerArrows:I,hasPrompt:O,iconService:M})=>{const[R,P]=o.default.useState(-1),k=E===c.TreeNodeType.RenamePrompt,F=E===c.TreeNodeType.NewPrompt,L=k||F,B=!L&&g.name.indexOf(_.separator)>=0,j=(0,p.useDesignStyles)(m.default.expansion_toggle,"expansion_toggle"),W=(0,p.useDesignStyles)(m.default.file_tree_node,"file_tree_node"),U=L?null:f.getDecoration(g.uri,v.Directory.is(g)),Q=Pe=>{(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&(B&&P(g.name.split(_.separator).length-1),l(Pe,g,E))},V=Pe=>{(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&(B&&P(g.name.split(_.separator).length-1),h(Pe,g,E))},$=Pe=>{(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&(y?y(Pe,g,E):l(Pe,g,E))},Y=o.default.useCallback(Pe=>{Pe.nativeEvent.which!==0&&(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&u(Pe,g,E)},[u,g]),z=o.default.useCallback(Pe=>{const{handleDragStart:Ae}=d;(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&Ae(Pe,g)},[d,g]),H=o.default.useCallback(Pe=>{const{handleDragLeave:Ae}=d;(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&Ae(Pe,g)},[d,g]),K=o.default.useCallback(Pe=>{const{handleDragEnter:Ae}=d;(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&Ae(Pe,g)},[d,g]),Z=o.default.useCallback(Pe=>{const{handleDrop:Ae}=d;(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&Ae(Pe,g)},[d,g]),X=o.default.useCallback(Pe=>{const{handleDragOver:Ae}=d;(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&Ae(Pe,g)},[d,g]);let ie=E===c.TreeNodeType.CompositeTreeNode,oe;L?F?(ie=g.type===c.TreeNodeType.CompositeTreeNode,oe=`${S+(g.parent.depth+1||0)*(b||0)+(ie?0:T?I?0:20:0)}px`):(ie=g.target.type===c.TreeNodeType.CompositeTreeNode,oe=`${S+(g.target.depth||0)*(b||0)+(ie?0:T?I?0:20:0)}px`):oe=`${S+(g.depth||0)*(b||0)+(ie?0:T?I?0:20:0)}px`;const le={color:U?U.color:"",height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`,paddingLeft:oe,opacity:O&&!L?".6":"1"},pe=(Pe,Ae)=>{if(A&&A?.classlist.indexOf(m.default.mod_loading)>-1)return o.default.createElement(c.Loading,null);if(L&&Pe instanceof c.PromptHandle){let we=!1;if(k?we=Pe.target.type===c.TreeNodeType.CompositeTreeNode:we=Pe.type===c.TreeNodeType.CompositeTreeNode,we)return o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,j,(0,p.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:F||!(k&&Pe.target.type===c.TreeNodeType.CompositeTreeNode&&Pe.target.expanded)})})}else return o.default.createElement("div",{onClick:Ae,className:(0,r.default)(m.default.file_tree_node_segment,j,(0,p.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:!Pe.expanded})})},q=Pe=>{let Ae,we;L&&Pe instanceof c.PromptHandle?Pe instanceof c.RenamePromptHandle?(Ae=Pe.target.uri.resolve(Pe.$.value),we=v.Directory.is(Pe.target)):(Ae=Pe.parent.uri.resolve(Pe.$.value),we=Pe.type===c.TreeNodeType.CompositeTreeNode):(Ae=Pe.uri,we=Pe.filestat.isDirectory);const be=a.getIcon(Ae,{isDirectory:we,isOpenedDirectory:we&&Pe.expanded});return we&&!T||!we&&!D?null:o.default.createElement("div",{className:(0,r.default)(m.default.file_icon,be,{expanded:we&&Pe.expanded}),style:{height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`}})},Ee=Pe=>{if(w)return o.default.createElement(w,null);if(L&&Pe instanceof c.PromptHandle)return o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_inputbox)},o.default.createElement("div",{className:(0,r.default)("input-box",m.default.file_tree_node_prompt_box)},o.default.createElement(Pe.ProxiedInput,{wrapperStyle:{height:t.FILE_TREE_NODE_HEIGHT,padding:"0 5px"}})));if(B){const Ae=Pe.displayName.split(_.separator),we=Ae.map((be,fe)=>{const xe=Ae.slice(0,fe+1).join(_.separator),Re=Fe=>{Fe.stopPropagation(),P(fe);const Ge=g.parent.uri.resolve(Ae.slice(0,fe+1).join(_.separator));l(Fe,g,E,Ge)},Be=Fe=>{Fe.stopPropagation(),P(fe);const Ge=g.parent.uri.resolve(Ae.slice(0,fe+1).join(_.separator));u(Fe,g,E,Ge)},me=Fe=>{Fe.stopPropagation(),Fe.preventDefault(),R!==fe&&(P(fe),d.handleDragOver(Fe,g))},re=Fe=>{Fe.stopPropagation(),Fe.preventDefault(),P(-1)},he=Fe=>{Fe.stopPropagation(),R!==fe&&P(fe);const Ge=g.parent.uri.resolve(Ae.slice(0,fe+1).join(_.separator));d.handleDragStart(Fe,g,Ge)},Oe=Fe=>{const Ge=g.parent.uri.resolve(Ae.slice(0,fe+1).join(_.separator));d.handleDrop(Fe,g,Ge)},Se=(0,r.default)(R===fe&&m.default.active,m.default.compact_name);return o.default.createElement("span",{key:xe},o.default.createElement("a",{className:Se,draggable:!0,onContextMenu:Be,onDragStart:he,onDragOver:me,onDragLeave:re,onDrop:Oe,onClick:Re},be),fe!==Ae.length-1?o.default.createElement("span",{className:m.default.compact_name_separator},_.separator):null)});return o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_displayname)},we)}return o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_displayname)},a.getName(Pe.uri)||Pe.displayName)},_e=()=>o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_tail)},te()),te=()=>U?o.default.createElement("div",{className:m.default.file_tree_node_status},(0,p.transformLabelWithCodicon)(U.badge.slice(),{color:"inherit"},M.fromString.bind(M))):null,ge=Pe=>{if(I)return null;if(ie)return pe(Pe,$);if(L)return pe(Pe,()=>{})},Te=()=>{let Pe=g.tooltip;return U&&U.badge&&(Pe+=` \u2022 ${U.tooltip}`),Pe};return o.default.createElement("div",{key:g.id,onClick:Q,onDoubleClick:V,onContextMenu:Y,onDragStart:z,onDragOver:X,onDragEnter:K,onDragLeave:H,onDrop:Z,title:Te(),className:(0,r.default)(W,A?A.classlist:null),style:le,draggable:E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode,"data-id":g.id},o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_content)},ge(g),q(g),o.default.createElement("div",{className:L?m.default.file_tree_node_prompt_wrap:m.default.file_tree_node_overflow_wrap},Ee(g)),_e()))};t.FileTreeNode=s,t.FILE_TREE_NODE_HEIGHT=22,t.FILE_TREE_BADGE_LIMIT=99},56384:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTree=t.FILE_TREE_FILTER_DELAY=t.FILTER_AREA_HEIGHT=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(97267),p=e(41869),v=e(68974),m=e(24429),_=e(87420),s=e(6250),g=e(46377),l=n.__importDefault(e(2613)),h=e(97738);t.FILTER_AREA_HEIGHT=30,t.FILE_TREE_FILTER_DELAY=500;const u=(0,c.RecycleTreeFilterDecorator)(c.RecycleTree),d=({viewState:f})=>{const[a,b]=(0,o.useState)(!1),[y,A]=(0,o.useState)(!0),[S,w]=(0,o.useState)(!1),[T,D]=(0,o.useState)(!1),[I,O]=(0,o.useState)(),M=(0,o.useRef)(null),R=(0,o.useRef)(new p.DisposableCollection),{height:P}=f,k=(0,p.useInjectable)(s.IFileTreeService),{iconService:F,locationToCurrentFile:L,filterMode:B,indent:j,baseIndent:W}=k,U=(0,p.useInjectable)(h.FileTreeModelService),[Q,V]=(0,o.useState)({indent:j,baseIndent:W}),[$,Y]=(0,o.useState)(B),[z,H]=(0,o.useState)(F.currentTheme||{hasFolderIcons:!0,hasFileIcons:!0,hidesExplorerArrows:!0}),K=(0,o.useCallback)(xe=>Z(xe)?!1:xe.shiftKey,[]),Z=(0,o.useCallback)(xe=>{const{metaKey:Re,ctrlKey:Be}=xe;return p.isOSX&&Re||Be},[]),X=(0,o.useCallback)((xe,Re,Be,me)=>{xe.stopPropagation();const{handleItemClick:re,handleItemToggleClick:he,handleItemRangeClick:Oe}=U;if(!Re)return;const Se=K(xe),Fe=Z(xe);Se?Oe(Re,Be):Fe?he(Re,Be):re(Re,Be,me)},[]),ie=(0,o.useCallback)((xe,Re,Be)=>{xe.stopPropagation();const{handleItemDoubleClick:me}=U;Re&&me(Re,Be)},[]),oe=(0,o.useCallback)((xe,Re)=>{xe.stopPropagation();const{toggleDirectory:Be}=U;Be(Re)},[]);(0,o.useEffect)(()=>{a&&U.onFileTreeModelChange(async xe=>{A(!0),xe&&await xe.ensureReady,O(xe),A(!1)})},[a]),(0,o.useEffect)(()=>{var xe,Re,Be;const me=new p.CancellationTokenSource;return q(me.token),(xe=R.current)===null||xe===void 0||xe.push(F.onThemeChange(re=>{H(re)})),(Re=R.current)===null||Re===void 0||Re.push(k.onTreeIndentChange(({indent:re,baseIndent:he})=>{V({indent:re,baseIndent:he})})),(Be=R.current)===null||Be===void 0||Be.push(k.onFilterModeChange(re=>{Y(re)})),()=>{var re;me.cancel(),(re=R.current)===null||re===void 0||re.dispose()}},[]);const le=(0,o.useCallback)((xe,Re)=>{let Be;if(xe&&Re)for(Be=xe.parentNode;Be;){if(Re===Be)return!0;Be=Be.parentNode}return!1},[]),pe=(0,o.useCallback)(xe=>{le(xe.relatedTarget,M.current)||!xe.relatedTarget||(w(!1),U.handleTreeBlur())},[M.current]);(0,o.useEffect)(()=>{$||(U.fileTreeHandle&&U.fileTreeHandle.clearFilter(),U.selectedFiles.length===1&&U.location(U.selectedFiles[0].uri))},[$]),(0,o.useEffect)(()=>{const xe=new p.DisposableCollection;return I&&(xe.push(U.onDidFocusedFileChange(Re=>{Re?Re.isEqual((I?.root).uri)?S||w(!S):S&&w(!S):Re||S&&w(!S)})),xe.push(U.onDidContextMenuFileChange(Re=>{Re?Re.isEqual((I?.root).uri)?S||w(!S):S&&w(!S):Re||S&&w(!S)}))),()=>{xe.dispose()}},[I,S]);const q=(0,o.useCallback)(async xe=>{var Re;if(await U.whenReady,!xe.isCancellationRequested){if(U.treeModel){if(await U.treeModel.ensureReady,O(U.treeModel),xe.isCancellationRequested)return;M.current&&k.initContextKey(M.current)}A(!1),!((Re=R.current)===null||Re===void 0)&&Re.disposed||b(!0)}},[U,R.current]),Ee=(0,o.useCallback)(xe=>{U.handleTreeHandler({...xe,getModel:()=>U.treeModel,hasDirectFocus:()=>M.current===document.activeElement})},[M.current,I]),_e=(0,o.useCallback)(()=>{const{handleItemClick:xe}=U;xe()},[]),te=(0,o.useCallback)(()=>{U.handleDblClick()},[]),ge=(0,o.useCallback)(()=>{const{handleTreeFocus:xe}=U;xe()},[]),Te=(0,o.useCallback)(xe=>{const{handleContextMenu:Re}=U;Re(xe)},[]),Pe=(0,o.useCallback)(xe=>{xe.stopPropagation(),xe.preventDefault()},[]),Ae=(0,o.useCallback)(xe=>{xe.preventDefault(),D(!0)},[]),we=(0,o.useCallback)(()=>{D(!1)},[]),be=(0,o.useCallback)(xe=>{const{handleDrop:Re}=U.dndService;D(!1),Re(xe)},[]),fe=(0,o.useCallback)((xe,Re,Be,me)=>{const{handleContextMenu:re}=U;re(xe,Re,me)},[]);return o.default.createElement("div",{className:(0,r.default)(l.default.file_tree,T&&l.default.outer_drag_over,S&&l.default.outer_active),tabIndex:-1,ref:M,onClick:_e,onDoubleClick:te,onFocus:ge,onBlur:pe,onContextMenu:Te,draggable:!0,onDragStart:Pe,onDragLeave:we,onDragOver:Ae,onDrop:be},o.default.createElement(E,{isLoading:y,isReady:a,height:P,model:I,iconTheme:z,treeIndent:Q,filterMode:$,locationToCurrentFile:L,onTreeReady:Ee,onContextMenu:fe,onItemClick:X,onItemDoubleClick:ie,onTwistierClick:oe}))};t.FileTree=d;const E=(0,o.memo)(({isReady:f,isLoading:a,height:b,model:y,filterMode:A,treeIndent:S,iconTheme:w,onTreeReady:T,onItemClick:D,onItemDoubleClick:I,onContextMenu:O,onTwistierClick:M})=>{const R=(0,p.useInjectable)(s.IFileTreeService),P=(0,p.useInjectable)(_.IIconService),{decorationService:k,labelService:F,locationToCurrentFile:L}=R,B=(0,p.useInjectable)(h.FileTreeModelService),j=(0,o.useCallback)(W=>o.default.createElement(g.FileTreeNode,{item:W.item,itemType:W.itemType,template:W.template,decorationService:k,labelService:F,iconService:P,dndService:B.dndService,decorations:B.decorations.getDecorations(W.item),onClick:D,onDoubleClick:I,onTwistierClick:M,onContextMenu:O,defaultLeftPadding:S.baseIndent,leftPadding:S.indent,hasPrompt:W.hasPrompt,hasFolderIcons:w.hasFolderIcons,hasFileIcons:w.hasFileIcons,hidesExplorerArrows:w.hidesExplorerArrows}),[y,S,w]);return f?a?o.default.createElement(v.Progress,{loading:!0}):y?o.default.createElement(u,{height:b,itemHeight:g.FILE_TREE_NODE_HEIGHT,onReady:T,model:y,filterEnabled:A,filterAfterClear:L,filterAutoFocus:!0,leaveBottomBlank:!0},j):o.default.createElement(m.WelcomeView,{viewId:s.FILE_EXPLORER_WELCOME_ID}):o.default.createElement(v.Progress,{loading:!0})});E.displayName="FileTreeView"},57781:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeService=void 0;const n=e(85608),r=e(76003),o=e(97267),c=e(41869),p=e(18193),v=e(26542),m=e(42933),_=e(52416),s=e(51500),g=e(6250),l=e(69959),h=e(88014),u=e(93239),{Path:d}=c.path;let E=class extends o.Tree{constructor(){super(...arguments),this._fileServiceWatchers=new Map,this._symbolicFiles=new Map,this._changeEventDispatchQueue=new Set,this._readyToWatch=!1,this._watchRootsQueue=[],this.effectedNodes=[],this.onWorkspaceChangeEmitter=new c.Emitter,this.onTreeIndentChangeEmitter=new c.Emitter,this.onFilterModeChangeEmitter=new c.Emitter,this.onNodeRefreshedEmitter=new c.Emitter,this._filterMode=!1,this._refreshable=!0,this.refreshEffectNode=()=>{const a=this.effectedNodes.slice(0);if(this.effectedNodes=[],a.find(y=>l.Directory.isRoot(y)))this.refresh();else for(const y of a)this.refresh(y)},this.flushEventQueue=async()=>{if(!this._changeEventDispatchQueue||this._changeEventDispatchQueue.size===0)return;const a=Array.from(this._changeEventDispatchQueue),b=this.sortPaths(a);(!this.refreshCancelToken||this.refreshCancelToken.token.isCancellationRequested)&&(this.refreshCancelToken=new c.CancellationTokenSource);const y=(0,c.pSeries)(b.map(A=>async()=>{l.Directory.is(A.node)&&await A.node.refresh(this.refreshCancelToken)}));return this._changeEventDispatchQueue.clear(),await y},this.locationToCurrentFile=()=>{this.commandService.executeCommand(c.FILE_COMMANDS.LOCATION.id)}}get onNodeRefreshed(){return this.onNodeRefreshedEmitter.event}get refreshable(){return this._refreshable}get filterMode(){return this._filterMode}get baseIndent(){return this._baseIndent}get indent(){return this._indent}get onWorkspaceChange(){return this.onWorkspaceChangeEmitter.event}get onTreeIndentChange(){return this.onTreeIndentChangeEmitter.event}get onFilterModeChange(){return this.onFilterModeChangeEmitter.event}get isCompactMode(){return this._isCompactMode}get contextKey(){return this.fileContextKey}async init(){this._roots=await this.workspaceService.roots,await this.preferenceService.ready,this._baseIndent=this.preferenceService.getValid("explorer.fileTree.baseIndent",8),this._indent=this.preferenceService.getValid("explorer.fileTree.indent",8),this._isCompactMode=this.preferenceService.getValid("explorer.compactFolders",!0),this.toDispose.push(this.workspaceService.onWorkspaceChanged(a=>{this._roots=a;const b=new c.URI(a[0].uri),y=new l.Directory(this,void 0,b,b.displayName,a[0],this.fileTreeAPI.getReadableTooltip(b));this.root=y,this.onWorkspaceChangeEmitter.fire(y),this.refresh()})),this.toDispose.push(this.workspaceService.onWorkspaceFileExcludeChanged(()=>{this.refresh()})),this.toDispose.push(c.Disposable.create(()=>{var a;(a=this._root)===null||a===void 0||a.dispose(),this._roots=null})),this.toDispose.push(this.corePreferences.onPreferenceChanged(a=>{a.preferenceName==="explorer.fileTree.baseIndent"?(this._baseIndent=a.newValue||8,this.onTreeIndentChangeEmitter.fire({indent:this.indent,baseIndent:this.baseIndent})):a.preferenceName==="explorer.fileTree.indent"?(this._indent=a.newValue||8,this.onTreeIndentChangeEmitter.fire({indent:this.indent,baseIndent:this.baseIndent})):a.preferenceName==="explorer.compactFolders"&&(this._isCompactMode=a.newValue,this.refresh())}))}initContextKey(a){this.fileContextKey.initScopedContext(a)}startWatchFileEvent(){return this._readyToWatch=!0,Promise.all(this._watchRootsQueue.map(a=>this.watchFilesChange(a)))}async resolveChildren(a){var b,y,A,S;let w=[];if(a){if(l.Directory.isRoot(a)&&this.isMultipleWorkspace){const T=await this.workspaceService.roots;for(const D of T){const I=this.fileTreeAPI.toNode(this,D,a,this.workspaceService.getWorkspaceName(new c.URI(D.uri)));this.watchFilesChange(new c.URI(D.uri)),w=w.concat(I),(I.filestat.isSymbolicLink||I.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(I.filestat.uri,I)}return w}if(a.uri){const T=await this.fileTreeAPI.resolveChildren(this,a.uri.toString(),a,this.isCompactMode&&!l.Directory.isRoot(a));w=T.children,w.forEach(I=>{(I.filestat.isSymbolicLink||I.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(I.filestat.uri,I)});const D=T.filestat;if(D&&this.isCompactMode&&!l.Directory.isRoot(a)){const I=new c.URI(D.uri),O=a.parent;if(a&&O){let M=a.name;if(a.filestat.isSymbolicLink){const R=(y=new c.URI(a.filestat.realUri).relative(I))===null||y===void 0?void 0:y.toString();R&&(M=R,M=[a.uri.displayName].concat(M.split(d.separator)).join(d.separator))}else O.filestat.isSymbolicLink?M=(A=new c.URI(O.filestat.realUri).relative(I))===null||A===void 0?void 0:A.toString():M=(S=O.uri.relative(I))===null||S===void 0?void 0:S.toString();M&&M!==a.name&&a.updateMetaData({name:M,uri:I,tooltip:this.fileTreeAPI.getReadableTooltip(I),fileStat:D})}}return w}}else if(this._roots||(this._roots=await this.workspaceService.roots),this.isMultipleWorkspace){const T=new c.URI((b=this.workspaceService.workspace)===null||b===void 0?void 0:b.uri);let D=T.displayName;D=D.slice(0,D.lastIndexOf("."));const I={...this.workspaceService.workspace,isDirectory:!0},O=new l.Directory(this,void 0,T,D,I,this.fileTreeAPI.getReadableTooltip(T));return this.root=O,[O]}else if(this._roots.length>0)return w=await(await this.fileTreeAPI.resolveChildren(this,this._roots[0])).children,w.forEach(T=>{const D=this.workspaceService.getWorkspaceName(T.uri);D&&D!==T.name&&T.updateMetaData({name:D}),(T.filestat.isSymbolicLink||T.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(T.filestat.uri,T)}),this.watchFilesChange(new c.URI(this._roots[0].uri)),this.root=w[0],w;return[]}async watchFilesChange(a){if(!this._readyToWatch){this._watchRootsQueue.push(a);return}const b=await this.fileServiceClient.watchFileChanges(a);this.toDispose.push(b),this.toDispose.push(b.onFilesChanged(y=>{this.onFilesChanged(y)})),this._fileServiceWatchers.set(a.toString(),b)}updateRefreshable(a){var b;a!==this.refreshable&&(this._refreshable=a,this._refreshable?this.doHandleQueueChange():(b=this.refreshCancelToken)===null||b===void 0||b.cancel())}isContentFile(a){return!!a&&"filestat"in a&&!a.filestat.isDirectory}isFileContentChanged(a){return a.type===m.FileChangeType.UPDATED&&this.isContentFile(this.getNodeByPathOrUri(a.uri))}getAffectedChanges(a){const b=[];for(const y of a)this.isFileContentChanged(y)||b.push(y);return b}isRootAffected(a){return this._roots?a.some(b=>b.type>m.FileChangeType.UPDATED&&this._roots&&this._roots.find(y=>b.uri.indexOf(y.uri)>=0)):!1}async onFilesChanged(a){const b=await this.getAffectedNodes(this.getAffectedChanges(a));return b.length>0?this.effectedNodes=this.effectedNodes.concat(b):!(b.length>0)&&this.isRootAffected(a)&&this.effectedNodes.push(this.root),this.refreshEffectNode()}async getFileTreeNodePathByUri(a){var b,y,A,S,w,T;if(!a)return;let D;if(this.isMultipleWorkspace){if(this._roots||(this._roots=await this.workspaceService.roots),D=(S=this._roots.find(I=>new c.URI(I.uri).isEqualOrParent(a)))===null||S===void 0?void 0:S.uri,D){const I=new c.URI(D);if(I.isEqualOrParent(a))return new d(((w=this.root)===null||w===void 0?void 0:w.path)||"/").join(I.displayName).join(((T=I.relative(a))===null||T===void 0?void 0:T.toString())||"").toString()}}else if(D=(b=this.workspaceService.workspace)===null||b===void 0?void 0:b.uri,D){const I=new c.URI(D);if(I.isEqualOrParent(a))return new d(((y=this.root)===null||y===void 0?void 0:y.path)||"").join(((A=I.relative(a))===null||A===void 0?void 0:A.toString())||"").toString()}}async moveNodeByPath(a,b,y,A,S=o.TreeNodeType.TreeNode){const w=new d(a.path).join(y).toString(),T=new d(b.path).join(A).toString();if(w&&T&&T!==w){const D=a.moveNode(w,T);return D&&l.File.is(D)&&(D.updateMetaData({uri:b.uri.resolve(A),fileStat:{...b.filestat,uri:b.uri.resolve(A).toString(),isDirectory:S!==o.TreeNodeType.TreeNode},tooltip:this.fileTreeAPI.getReadableTooltip(b.uri.resolve(A))}),l.Directory.is(D)&&this.updateChildren(D)),D}}async updateChildren(a){const b=a.children;if(!(!b||b.length===0)){for(const y of b)if(l.File.is(y)){const A=a.uri.resolve(y.uri.displayName);y.updateMetaData({uri:A,fileStat:{...y.filestat,uri:A.toString(),isDirectory:!!l.Directory.is(y)},tooltip:this.fileTreeAPI.getReadableTooltip(A)}),l.Directory.is(y)&&this.updateChildren(y)}}}async addNode(a,b,y){let A,S;const w=d.splitPath(b);if(w.length>1){let D=a.uri;for(const I of w)D=D.resolve(I);!this.isCompactMode||l.Directory.isRoot(a)?S=w[0]:y===o.TreeNodeType.CompositeTreeNode?S=b:S=w.slice(0,w.length-1).join(d.separator)}else S=b;A={uri:a.uri.resolve(S).toString(),isDirectory:y===o.TreeNodeType.CompositeTreeNode||w.length>1,isSymbolicLink:!1,lastModification:new Date().getTime()};const T=await this.fileTreeAPI.toNode(this,A,a,S);return T&&a.addNode(T),T}async deleteAffectedNodeByPath(a,b){var y,A;const S=this.getNodeByPathOrUri(a);S&&S.parent&&(this.isCompactMode&&!b?((y=S.parent.children)===null||y===void 0?void 0:y.length)===2?this.refresh((A=S.parent)===null||A===void 0?void 0:A.parent):this.refresh(S.parent):S.parent.removeNode(S.path))}async deleteAffectedNodes(a,b=[]){const y=[];for(const A of a){const S=this.getNodeByPathOrUri(A);S&&l.File.is(S)&&y.push(S)}for(const A of y)!A?.parent||this._changeEventDispatchQueue.has(A?.parent.path)||await this.deleteAffectedNodeByPath(A.path);return b.filter(A=>A.type!==m.FileChangeType.DELETED)}async getAffectedNodes(a){const b=[];for(const y of a){const A=new c.URI(y.uri),S=this.getNodeByPathOrUri(A.parent);S&&b.push(S)}return b}isFileURI(a){return/^file:\/\//.test(a)}getNodeByPathOrUri(a){var b,y,A,S;let w,T;if(typeof a!="string"?(T=a,a=a.toString()):this.isFileURI(a)?T=new c.URI(a):!this.isFileURI(a)&&typeof a=="string"&&(w=a),this.isFileURI(a)&&T){if(this._symbolicFiles.has(T?.toString()))return this._symbolicFiles.get(T.toString());let D;if(this.isMultipleWorkspace?this._roots&&(D=(y=this._roots.find(I=>new c.URI(I.uri).isEqualOrParent(T)))===null||y===void 0?void 0:y.uri):D=(b=this.workspaceService.workspace)===null||b===void 0?void 0:b.uri,this.root&&D){const I=new c.URI(D);if(I.isEqualOrParent(T)){const O=I.relative(T);O&&(this.isMultipleWorkspace?w=new d(this.root.path).join(I.displayName).join(O.toString()).toString():w=new d(this.root.path).join(O.toString()).toString())}}}if(w){const D=(A=this.root)===null||A===void 0?void 0:A.getTreeNodeByPath(w);if(!D){let I;const O=w.split(d.separator);for(;O.length>=1;){O.pop();const M=O.join(d.separator);if(I=(S=this.root)===null||S===void 0?void 0:S.getTreeNodeByPath(M),I)break}if(I&&l.Directory.is(I)){for(const M of I.children||[])if(M.path.includes(w))return M}}return D}}sortComparator(a,b){return a.constructor===b.constructor?a.name.localeCompare(b.name,"en",{numeric:!0}):a.type===o.TreeNodeType.CompositeTreeNode?-1:b.type===o.TreeNodeType.CompositeTreeNode?1:0}get contextMenuContextKeyService(){return this.fileContextKey?this.fileContextKey.service:this.contextKeyService}reWatch(){for(const[a,b]of this._fileServiceWatchers)b.dispose(),this.watchFilesChange(new c.URI(a))}get isMultipleWorkspace(){return!!this.workspaceService.workspace&&!this.workspaceService.workspace.isDirectory}getDisplayName(a){return this.workspaceService.getWorkspaceName(a)}async refresh(a=this.root){if(a)return l.Directory.is(a)||l.File.is(a)&&a.parent&&(a=a.parent),this._changeEventDispatchQueue.add(a.path),this.doHandleQueueChange()}async doHandleQueueChange(){if(this.refreshable)try{await this.flushEventQueue()}catch(a){this.logger.error("flush file change event queue error:",a)}finally{this.onNodeRefreshedEmitter.fire()}}sortPaths(a){const y=a.slice().map(S=>({node:this.getNodeByPathOrUri(S),path:S})).filter(S=>S&&!!S.node);a.length>1&&y.sort((S,w)=>{var T,D;const I=((T=S.node)===null||T===void 0?void 0:T.depth)||0,O=((D=w.node)===null||D===void 0?void 0:D.depth)||0;return I-O});const A=[];for(let S=y.length-1;S>=0;S--){const w=y[S];let T=!1;for(let D=0;D<S;D++){const I=y[D];l.Directory.is(I)&&w.node.path.startsWith(I.node.path)&&(T=!0)}T||A.push(w)}return A}openFile(a){const b=this.preferenceService.get("editor.previewMode");this.commandService.executeCommand(c.EDITOR_COMMANDS.OPEN_RESOURCE.id,a,{disableNavigate:!0,preview:b})}openAndFixedFile(a){this.commandService.executeCommand(c.EDITOR_COMMANDS.OPEN_RESOURCE.id,a,{disableNavigate:!0,preview:!1,focus:!0})}openToTheSide(a){this.commandService.executeCommand(c.EDITOR_COMMANDS.OPEN_RESOURCE.id,a,{disableNavigate:!0,split:4})}compare(a,b){this.commandService.executeCommand(c.EDITOR_COMMANDS.COMPARE.id,{original:a,modified:b})}toggleFilterMode(){var a;this._filterMode=!this.filterMode,this.onFilterModeChangeEmitter.fire(this.filterMode),(a=this.fileContextKey)===null||a===void 0||a.filesExplorerFilteredContext.set(this.filterMode),this.filterMode===!1&&this.commandService.executeCommand(c.FILE_COMMANDS.LOCATION.id)}};t.FileTreeService=E,n.__decorate([(0,r.Autowired)(g.IFileTreeAPI),n.__metadata("design:type",Object)],E.prototype,"fileTreeAPI",void 0),n.__decorate([(0,r.Autowired)(c.CommandService),n.__metadata("design:type",Object)],E.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(c.IContextKeyService),n.__metadata("design:type",Object)],E.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(s.IWorkspaceService),n.__metadata("design:type",Object)],E.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(p.CorePreferences),n.__metadata("design:type",Object)],E.prototype,"corePreferences",void 0),n.__decorate([(0,r.Autowired)(c.PreferenceService),n.__metadata("design:type",Object)],E.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(v.LabelService),n.__metadata("design:type",v.LabelService)],E.prototype,"labelService",void 0),n.__decorate([(0,r.Autowired)(u.FileTreeDecorationService),n.__metadata("design:type",u.FileTreeDecorationService)],E.prototype,"decorationService",void 0),n.__decorate([(0,r.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],E.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(_.IIconService),n.__metadata("design:type",Object)],E.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(c.ILogger),n.__metadata("design:type",Object)],E.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(h.FileContextKey),n.__metadata("design:type",h.FileContextKey)],E.prototype,"fileContextKey",void 0),t.FileTreeService=E=n.__decorate([(0,r.Injectable)()],E)},83709:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeNextModule=void 0;const n=e(85608),r=e(41869),o=e(72665),c=e(41103),p=e(6250),v=e(89508),m=e(40439),_=e(57781),s=e(88808),g=e(93239),l=e(97738),h=e(24861);let u=class extends r.BrowserModule{constructor(){super(...arguments),this.providers=[{token:p.IFileTreeAPI,useClass:s.FileTreeAPI},{token:g.FileTreeDecorationService,useClass:g.FileTreeDecorationService},{token:p.IFileTreeService,useClass:_.FileTreeService},{token:l.FileTreeModelService,useClass:l.FileTreeModelService},{token:o.IWindowDialogService,useClass:v.WindowDialogServiceImpl},m.FileTreeContribution]}};t.FileTreeNextModule=u,t.FileTreeNextModule=u=n.__decorate([(0,r.Domain)(h.name),(0,r.ModuleDependencies)([c.WorkspaceModule])],u)},88808:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeAPI=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(43718),p=e(42933),v=e(72665),m=e(26199),_=e(69959);let s=class{constructor(){this.onDidResolveChildrenEmitter=new c.Emitter,this.onDidResolveChildren=this.onDidResolveChildrenEmitter.event}async resolveChildren(l,h,u,d){var E;let f;if(!this.userhomePath){const a=await this.fileServiceClient.getCurrentUserHome();a&&(this.userhomePath=new c.URI(a.uri))}if(typeof h=="string"?f=await this.fileServiceClient.getFileStat(h):f=await this.fileServiceClient.getFileStat(h.uri),f){if(this.onDidResolveChildrenEmitter.fire(f.uri.toString()),((E=f.children)===null||E===void 0?void 0:E.length)===1&&f.children[0].isDirectory&&d)return await this.resolveChildren(l,f.children[0].uri,u,d);{const a={...f,isInSymbolicDirectory:u?.filestat.isSymbolicLink||u?.filestat.isInSymbolicDirectory};return{children:this.toNodes(l,a,u),filestat:a}}}else return{children:[],filestat:null}}async resolveNodeByPath(l,h,u){const d=await this.fileServiceClient.getFileStat(h);if(d)return this.toNode(l,d,u)}async resolveFileStat(l){return await this.fileServiceClient.getFileStat(l.toString())}toNodes(l,h,u){if(u){if(h.children)return h.children.map(d=>this.toNode(l,d,u))}else return[this.toNode(l,h,u)];return[]}toNode(l,h,u,d){var E;const f=new c.URI(h.uri),a=d||f.displayName;let b;return h.isInSymbolicDirectory=(E=u?.filestat.isSymbolicLink)!==null&&E!==void 0?E:u?.filestat.isInSymbolicDirectory,h.isDirectory?b=new _.Directory(l,u,f,a,h,this.getReadableTooltip(f)):b=new _.File(l,u,f,a,h,this.getReadableTooltip(f)),b}async mvFiles(l,h){const u=[];for(const f of l)if(f.url.isEqualOrParent(h))return;const d=l.sort((f,a)=>f.toString().length-a.toString().length),E=[];for(const f of d)E.length>0&&E.find(a=>a.url.isEqualOrParent(f.url))||E.push(f);if(this.corePreferences["explorer.confirmMove"]){const f=(0,c.localize)("file.confirm.move.ok"),a=(0,c.localize)("file.confirm.move.cancel");if(await this.dialogService.warning((0,c.formatLocalize)("file.confirm.move",`[ ${E.map(y=>y.url.displayName).join(",")} ]`,h.displayName),[a,f])!==f)return}for(const f of E){const a=await this.mv(f.url,h.resolve(f.url.displayName),f.isDirectory);a&&u.push(a)}return u}async mv(l,h,u=!1){try{await this.workspaceEditService.apply({edits:[{newResource:h,oldResource:l,options:{isDirectory:u,overwrite:!0}}]})}catch(d){return d.message}}async createFile(l,h){try{await this.workspaceEditService.apply({edits:[{newResource:l,options:{content:h}}]})}catch(u){return u.message}this.commandService.executeCommand(o.EDITOR_COMMANDS.OPEN_RESOURCE.id,l,{disableNavigate:!0,focus:!0})}async createDirectory(l){try{await this.workspaceEditService.apply({edits:[{newResource:l,options:{isDirectory:!0}}]})}catch(h){return h.message}}async delete(l){try{await this.workspaceEditService.apply({edits:[{oldResource:l,options:{}}]});return}catch(h){return h.message}}async copyFile(l,h){let u=1,d;try{d=await this.fileServiceClient.access(h.toString())}catch(E){return E.message}for(;d;){const E=h.displayName.replace(/\Wcopy\W\d+/,""),f=c.path.extname(E),b=`${c.path.basename(E,f)} copy ${u}${f}`;h=h.parent.resolve(b),u++;try{d=await this.fileServiceClient.access(h.toString())}catch{return}}try{return await this.fileServiceClient.copy(l.toString(),h.toString())}catch(E){return E.message}}getReadableTooltip(l){const h=l.toString(),u=this.userhomePath&&this.userhomePath.toString();return this.userhomePath&&this.userhomePath.isEqualOrParent(l)?decodeURIComponent(h.replace(u,"~")):decodeURIComponent(l.withScheme("").toString())}};t.FileTreeAPI=s,n.__decorate([(0,r.Autowired)(p.IFileServiceClient),n.__metadata("design:type",Object)],s.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(m.IWorkspaceEditService),n.__metadata("design:type",Object)],s.prototype,"workspaceEditService",void 0),n.__decorate([(0,r.Autowired)(c.CommandService),n.__metadata("design:type",Object)],s.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(o.CorePreferences),n.__metadata("design:type",Object)],s.prototype,"corePreferences",void 0),n.__decorate([(0,r.Autowired)(v.IDialogService),n.__metadata("design:type",Object)],s.prototype,"dialogService",void 0),t.FileTreeAPI=s=n.__decorate([(0,r.Injectable)()],s)},93239:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeDecorationService=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(41893),p=e(52416);let v=class{constructor(){this.disposeCollection=new o.DisposableCollection,this.onDidChangeEmitter=new o.Emitter,this.cacheDecorations=new Map,this.disposeCollection.pushAll([this.decorationsService.onDidChangeDecorations(_=>{var s,g,l;const h=(g=(s=_._data)===null||s===void 0?void 0:s._iter)===null||g===void 0?void 0:g._value;if(h){const u=new o.URI(h),d=this.getDecoration(u);this.cacheDecorations.has(h)?((l=this.cacheDecorations.get(h))===null||l===void 0?void 0:l.tooltip)!==d?.tooltip&&this.onDidChangeEmitter.fire():(this.cacheDecorations.set(h,d),this.onDidChangeEmitter.fire())}}),this.themeService.onThemeChange(()=>{this.onDidChangeEmitter.fire()})])}get onDidChange(){return this.onDidChangeEmitter.event}getDecoration(_,s=!1){_ instanceof o.URI&&(_=o.Uri.parse(_.toString()));const g=this.decorationsService.getDecoration(_,s);return g?{...g,color:this.themeService.getColor({id:g.color})}:{color:"",tooltip:"",badge:""}}dispose(){this.disposeCollection.dispose()}};t.FileTreeDecorationService=v,n.__decorate([(0,r.Autowired)(c.IDecorationsService),n.__metadata("design:type",c.IDecorationsService)],v.prototype,"decorationsService",void 0),n.__decorate([(0,r.Autowired)(p.IThemeService),n.__metadata("design:type",Object)],v.prototype,"themeService",void 0),t.FileTreeDecorationService=v=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],v)},30577:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DragAndDropService=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(53622),m=e(14951),_=e(72665),s=e(51500),g=e(6250),l=e(69959),h=r.__importDefault(e(89200)),u=r.__importDefault(e(2613)),d=e(57781),E=e(97738);let f=n=class extends p.WithEventBus{constructor(b){super(),this.model=b,this.toCancelNodeExpansion=new p.DisposableCollection,this.beingDraggedDec=new c.Decoration(h.default.mod_dragging),this.draggedOverDec=new c.Decoration(h.default.mod_dragover),this.beingDraggedNodes=[],this.dragOverTrigger=new p.ThrottledDelayer(n.MS_TILL_DRAGGED_OVER_EXPANDS),this.handleDragStart=(y,A,S)=>{y.stopPropagation();const w=O=>{this.handleDragEnd(O,A)};y.currentTarget.addEventListener("dragend",w,!1);let T=this.model.selectedFiles,D=!1;for(const O of T)O&&O.id===A.id&&(D=!0);D||(T=[A]),this.beingDraggedNodes=T,this.beingDraggedActiveUri=S;const I=T.find(O=>!l.Directory.is(O));if(I&&y.dataTransfer.setData("uri",I.uri.toString()),y.dataTransfer.setData("beingDraggedNodes",JSON.stringify(this.beingDraggedNodes.map(O=>O.uri.toString()))),I){const O=I;O.uri.scheme==="file"&&y.dataTransfer.setData("DownloadURL",`application/octet-stream:${O.displayName}:data:application/octet-stream;base64,${(0,p.encodeBase64)(p.BinaryBuffer.fromString(O.filestat.uri))}`)}if(T.forEach(O=>{this.beingDraggedDec.addTarget(O,c.TargetMatchMode.Self)}),y.dataTransfer){let O;T.length===1?O=S?S.displayName:typeof A.name=="string"?A.name:"":O=String(T.length);const M=document.createElement("div");M.className=u.default.file_tree_drag_image,M.textContent=O,document.body.appendChild(M),y.dataTransfer.setDragImage(M,-10,-10),setTimeout(()=>document.body.removeChild(M),0)}},this.handleDragEnter=(y,A)=>{y.stopPropagation(),y.preventDefault()},this.handleDragLeave=(y,A)=>{y.preventDefault(),y.stopPropagation(),this.toCancelNodeExpansion.dispose(),this.potentialParent&&(this.draggedOverDec.removeTarget(this.potentialParent),this.model.treeModel.dispatchChange())},this.handleDragOver=(y,A)=>{if(y.preventDefault(),y.stopPropagation(),!this.toCancelNodeExpansion.disposed||this.beingDraggedNodes.indexOf(A)>=0)return;this.draggedOverNode=A;const S=l.Directory.is(A)&&A.expanded?A:A.parent;(this.potentialParent!==S||!this.draggedOverDec.hasTarget(S))&&(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=S,this.draggedOverDec.addTarget(this.potentialParent,c.TargetMatchMode.SelfAndChildren),this.model.treeModel.dispatchChange()),this.potentialParent!==A&&l.Directory.is(A)&&(this.dragOverTrigger.trigger(async()=>{A.expanded?(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=A,this.draggedOverDec.addTarget(this.potentialParent,c.TargetMatchMode.SelfAndChildren)):(await A.setExpanded(!0),this.draggedOverNode===A&&(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=A,this.draggedOverDec.addTarget(this.potentialParent,c.TargetMatchMode.SelfAndChildren))),this.model.treeModel.dispatchChange()}),this.toCancelNodeExpansion.push(p.Disposable.create(()=>{this.dragOverTrigger.isTriggered()||this.dragOverTrigger.cancel()})))},this.handleDrop=async(y,A,S)=>{var w,T;this.eventBus.fire(new v.FileTreeDropEvent({event:y.nativeEvent,targetDir:S?S.codeUri.path:A&&A instanceof l.File?(w=A.parent)===null||w===void 0?void 0:w.uri.codeUri.path:A?A.uri.codeUri.path:new p.URI((T=this.workspaceService.workspace)===null||T===void 0?void 0:T.uri).codeUri.path}));try{y.preventDefault(),y.stopPropagation(),y.dataTransfer.dropEffect="copy";let D;const I=!!this.beingDraggedActiveUri;this.fileTreeService.isCompactMode&&S&&!A?.uri.isEqual(S)?D=null:A?D=l.Directory.is(A)?A:A.parent:D=this.root;let O;if(this.beingDraggedActiveUri){const M=this.fileTreeService.getNodeByPathOrUri(this.beingDraggedActiveUri);O=[new l.Directory(this.fileTreeService,M?.parent,this.beingDraggedActiveUri,this.beingDraggedActiveUri.displayName,{uri:this.beingDraggedActiveUri.toString(),isDirectory:!0,lastModification:new Date().getTime()},this.beingDraggedActiveUri.displayName)]}else if(O=this.beingDraggedNodes,!O||O.length===0)try{const M=JSON.parse(y.dataTransfer.getData("beingDraggedNodes"));M&&M.length!==0&&(O=M.map(R=>this.fileTreeService.getNodeByPathOrUri(new p.URI(R))).filter(Boolean),O.length||(O=await Promise.all(M.map(async R=>{const P=new p.URI(R);let k;const F=await this.filesystem.getFileStat(P.toString());return F?.isDirectory?k=new l.Directory(this.fileTreeService,this.root,P,P.displayName,{uri:P.toString(),isDirectory:!0,lastModification:new Date().getTime()},P.displayName):k=new l.File(this.fileTreeService,this.root,P,P.displayName,{uri:P.toString(),isDirectory:!0,lastModification:new Date().getTime()},P.displayName),k}))))}catch{}if(O.length>0){const M=S||D&&D.uri,R=O.filter(P=>P&&P.parent&&(this.beingDraggedActiveUri?!P.parent.uri.isEqual(M):!0));if(R.length>0){const P=await this.fileTreeAPI.mvFiles(R.map(k=>({url:k.uri,isDirectory:k.filestat.isDirectory})),M);if(P&&P.length>0)P.forEach(k=>{this.messageService.error(k)});else if(P){if(D)if(this.fileTreeService.isCompactMode&&I){for(const k of R)this.fileTreeService.refresh(k.parent);this.fileTreeService.refresh(D)}else for(const k of R){const F=D.uri.resolve(k.name);this.fileTreeService.moveNodeByPath(k.parent,D,k.name,k.name,k.type),k.updateMetaData({name:F.displayName,fileStat:{...k.filestat,uri:F.toString()},uri:F,tooltip:this.fileTreeAPI.getReadableTooltip(F)}),l.Directory.is(k)&&this.fileTreeService.refresh(k)}else if(A){if(this.fileTreeService.isCompactMode&&I)for(const k of R)this.fileTreeService.refresh(k.parent);else for(const k of R)this.fileTreeService.deleteAffectedNodeByPath(k.path);this.fileTreeService.refresh(A.parent)}}else return}}A&&this.beingDraggedDec.removeTarget(A),this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.beingDraggedNodes.forEach(M=>{this.beingDraggedDec.removeTarget(M)}),this.beingDraggedNodes=[],this.beingDraggedActiveUri=void 0,this.potentialParent=null,this.model.treeModel.dispatchChange(),this.toCancelNodeExpansion.disposed||this.toCancelNodeExpansion.dispose()}catch(D){this.logger.error(D)}},this.handleDragEnd=(y,A)=>{this.beingDraggedDec.removeTarget(A),this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.beingDraggedNodes.forEach(S=>{this.beingDraggedDec.removeTarget(S)}),this.beingDraggedNodes=[],this.beingDraggedActiveUri=void 0,this.potentialParent=null,this.model.treeModel.dispatchChange(),this.toCancelNodeExpansion.disposed||this.toCancelNodeExpansion.dispose()},this.model.decorations.addDecoration(this.beingDraggedDec),this.model.decorations.addDecoration(this.draggedOverDec)}get root(){return this.model.treeModel.root}};t.DragAndDropService=f,f.MS_TILL_DRAGGED_OVER_EXPANDS=500,r.__decorate([(0,o.Autowired)(g.IFileTreeAPI),r.__metadata("design:type",Object)],f.prototype,"fileTreeAPI",void 0),r.__decorate([(0,o.Autowired)(p.ILogger),r.__metadata("design:type",Object)],f.prototype,"logger",void 0),r.__decorate([(0,o.Autowired)(_.IMessageService),r.__metadata("design:type",Object)],f.prototype,"messageService",void 0),r.__decorate([(0,o.Autowired)(g.IFileTreeService),r.__metadata("design:type",d.FileTreeService)],f.prototype,"fileTreeService",void 0),r.__decorate([(0,o.Autowired)(m.IFileServiceClient),r.__metadata("design:type",Object)],f.prototype,"filesystem",void 0),r.__decorate([(0,o.Autowired)(s.IWorkspaceService),r.__metadata("design:type",Object)],f.prototype,"workspaceService",void 0),t.DragAndDropService=f=n=r.__decorate([(0,o.Injectable)(),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[E.FileTreeModelService])],f)},97738:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeModelService=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(91830),m=e(93899),_=e(26542),s=e(54414),g=e(14951),l=e(63067),h=e(53576),u=e(72665),d=e(6250),E=e(69959),f=e(2812),a=e(46377),b=r.__importDefault(e(89200)),y=e(57781),A=e(30577),{Path:S,isValidBasename:w}=p.path,{coalesce:T}=p.arrays,{trim:D,rtrim:I}=p.strings;let O=n=class{constructor(){this._isDisposed=!1,this._whenReady=new p.Deferred,this.selectedDecoration=new c.Decoration(b.default.mod_selected),this.focusedDecoration=new c.Decoration(b.default.mod_focused),this.contextMenuDecoration=new c.Decoration(b.default.mod_actived),this.loadingDecoration=new c.Decoration(b.default.mod_loading),this.cutDecoration=new c.Decoration(b.default.mod_cut),this._selectedFiles=[],this.disposableCollection=new p.DisposableCollection,this._isMultiSelected=!1,this.refreshedActionDelayer=new p.ThrottledDelayer(n.DEFAULT_REFRESHED_ACTION_DELAY),this.labelChangedDelayer=new p.ThrottledDelayer(n.DEFAULT_LABEL_CHANGED_DELAY),this.locationThrottler=new p.Throttler,this.onDidFocusedFileChangeEmitter=new p.Emitter,this.onDidContextMenuFileChangeEmitter=new p.Emitter,this.onDidSelectedFileChangeEmitter=new p.Emitter,this.onFileTreeModelChangeEmitter=new p.Emitter,this._initTreeModelReady=!1,this.clearFileSelectedDecoration=()=>{this.selectedDecoration.clearAppliedTarget(),this._selectedFiles=[]},this.activeFileDecoration=(R,P=!0)=>{this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),R&&(this.selectedFiles.length>0&&this.selectedDecoration.clearAppliedTarget(),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.selectedDecoration.addTarget(R),this.focusedDecoration.addTarget(R),this.focusedFile=R,this.selectedFiles=[R],P&&this.treeModel.dispatchChange())},this.selectFileDecoration=(R,P=!0)=>{R!==this.treeModel.root&&(this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),R&&(this.selectedFiles.length>0&&this.selectedDecoration.clearAppliedTarget(),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.selectedDecoration.addTarget(R),this._selectedFiles=[R],P&&this.treeModel.dispatchChange()))},this.activateFileActivedDecoration=R=>{this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),this.focusedFile&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this.contextMenuDecoration.addTarget(R),this.contextMenuFile=R,this.treeModel.dispatchChange()},this.activateFileFocusedDecoration=R=>{this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),this.focusedDecoration.addTarget(R),this.focusedFile=R,this.treeModel.dispatchChange()},this.activeFileFocusedDecoration=(R,P=!1)=>{R!==this.treeModel.root&&(this.focusedFile!==R&&(P?(this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.contextMenuFile=R):this.focusedFile&&(this.contextMenuFile=void 0,this.focusedDecoration.clearAppliedTarget()),R&&(this._selectedFiles.indexOf(R)<0&&(this.selectedDecoration.addTarget(R),this._selectedFiles.push(R),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(k=>k.uri))),this.focusedDecoration.addTarget(R),this.focusedFile=R)),this.treeModel.dispatchChange())},this.toggleFileSelectedDecoration=R=>{const P=this._selectedFiles.indexOf(R);P>-1?(this.focusedFile===R&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this._selectedFiles.splice(P,1),this.selectedDecoration.clearAppliedTarget()):(this._selectedFiles.push(R),this.selectedDecoration.addTarget(R),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.focusedFile=R,this.focusedDecoration.addTarget(R)),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(k=>k.uri)),this.treeModel.dispatchChange()},this.activeFileDecorationByRange=(R,P)=>{for(this.clearFileSelectedDecoration(),this.contextMenuFile=void 0;R<=P;R++){const k=this.treeModel.root.getTreeNodeAtIndex(R);k&&(this._selectedFiles.push(k),this.selectedDecoration.addTarget(k))}this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(k=>k.uri)),this.treeModel.dispatchChange()},this.deactivateFileDecoration=()=>{var R;this.focusedFile&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this.contextMenuFile&&this.contextMenuDecoration.removeTarget(this.contextMenuFile),(R=this.treeModel)===null||R===void 0||R.dispatchChange()},this.toggleDirectory=async R=>{R.expanded?this.fileTreeHandle.collapseNode(R):this.fileTreeHandle.expandNode(R)},this.handleDblClick=()=>{this.commandService.executeCommand(p.FILE_COMMANDS.NEW_FILE.id)},this.handleContextMenu=(R,P,k)=>{var F;R.stopPropagation(),R.preventDefault();let L,B;P?(B=P,this._isMultiSelected?this.selectedFiles.indexOf(B)>=0?L=this.selectedFiles:L=[B]:L=[B]):(L=[this.treeModel.root],B=this.treeModel.root),this.activateFileActivedDecoration(B),this.setFileTreeContextKey(B),this.fileTreeService.isCompactMode&&k?(this._activeUri=k,(F=this.contextKey)===null||F===void 0||F.explorerResourceIsFolder.set(!0)):k||(this._activeUri=null);const j=this.contextMenuService.createMenu({id:m.MenuId.ExplorerContext,contextKeyService:this.fileTreeService.contextMenuContextKeyService}),W=j.getMergedMenuNodes();j.dispose(),this.updateExplorerCompressedContextKey(B,k);const{x:U,y:Q}=R.nativeEvent;this.ctxMenuRenderer.show({anchor:{x:U,y:Q},menuNodes:W,args:k?[k,[k]]:[B.uri,L.map(V=>V.uri)]})},this.handleTreeBlur=()=>{var R,P,k;this._isDisposed||((P=(R=this.contextKey)===null||R===void 0?void 0:R.filesExplorerFocused)===null||P===void 0||P.set(!1),this.deactivateFileDecoration(),(k=this.contextKey)===null||k===void 0||k.explorerResourceIsFolder.set(!1))},this.handleTreeFocus=()=>{var R,P;(P=(R=this.contextKey)===null||R===void 0?void 0:R.filesExplorerFocused)===null||P===void 0||P.set(!0)},this.handleItemRangeClick=(R,P)=>{if(this.selectedFiles.length===1&&E.Directory.isRoot(this.selectedFiles[0])&&this.clearFileSelectedDecoration(),!this.focusedFile)this.handleItemClick(R,P);else if(this.focusedFile&&this.focusedFile!==R){this._isMultiSelected=!0;const k=this.treeModel.root.getIndexAtTreeNode(R),F=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);F>k?this.activeFileDecorationByRange(k,F):F<k&&this.activeFileDecorationByRange(F,k)}},this.handleItemToggleClick=(R,P)=>{this._isMultiSelected=!0,!(P!==c.TreeNodeType.CompositeTreeNode&&P!==c.TreeNodeType.TreeNode)&&(this.selectedFiles.length===1&&E.Directory.isRoot(this.selectedFiles[0])&&this.clearFileSelectedDecoration(),this.toggleFileSelectedDecoration(R))},this.handleItemClick=(R,P=this.fileTreeService.isMultipleWorkspace?c.TreeNodeType.TreeNode:c.TreeNodeType.CompositeTreeNode,k)=>{var F,L,B,j;if(this.treeModel&&(R||(R=this.treeModel.root),this.updateExplorerCompressedContextKey(R,k),this._isMultiSelected=!1,(P===c.TreeNodeType.CompositeTreeNode||P===c.TreeNodeType.TreeNode)&&this.activeFileDecoration(R),this.fileTreeService.isCompactMode&&k?(this._activeUri=k,(F=this.contextKey)===null||F===void 0||F.explorerResourceIsFolder.set(!0)):k||(this._activeUri=null,(L=this.contextKey)===null||L===void 0||L.explorerResourceIsFolder.set(P===c.TreeNodeType.CompositeTreeNode)),this.corePreferences["workbench.list.openMode"]==="singleClick")){if(P===c.TreeNodeType.CompositeTreeNode){if((B=this.contextKey)===null||B===void 0||B.explorerResourceIsFolder.set(!0),R===this.treeModel.root)return;this.toggleDirectory(R)}else if(P===c.TreeNodeType.TreeNode){if((j=this.contextKey)===null||j===void 0||j.explorerResourceIsFolder.set(!1),R===this.treeModel.root)return;this.fileTreeService.openFile(R.uri),this.mainlayoutService.bottomExpanded&&this.commandService.executeCommand(h.RETRACT_BOTTOM_PANEL.id)}}},this.handleItemDoubleClick=(R,P)=>{P===c.TreeNodeType.TreeNode?this.fileTreeService.openAndFixedFile(R.uri):this.corePreferences["workbench.list.openMode"]==="doubleClick"&&this.toggleDirectory(R)},this.validateFileName=(R,P)=>{var k;if(P=this.getWellFormedFileName(P),!P||P.length===0||/^\s+$/.test(P))return{message:(0,p.localize)("validate.tree.emptyFileNameError"),type:c.PROMPT_VALIDATE_TYPE.ERROR,value:P};if(P[0]==="/"||P[0]==="\\")return{message:(0,p.localize)("validate.tree.fileNameStartsWithSlashError"),type:c.PROMPT_VALIDATE_TYPE.ERROR,value:P};if(P[0]===" "||P[P.length-1]===" ")return{message:(0,p.localize)("validate.tree.fileNameFollowOrStartWithSpaceWarning"),type:c.PROMPT_VALIDATE_TYPE.WARNING,value:P};let F;if(R.target){const B=R.target;if(P===B.name)return null;F=B.parent}else F=R.parent;return F&&!(R instanceof c.RenamePromptHandle&&R.target.displayName.indexOf(S.separator)>0)&&((k=F.children)===null||k===void 0?void 0:k.find(W=>W.name===P))?{message:(0,p.formatLocalize)("validate.tree.fileNameExistsError",P),type:c.PROMPT_VALIDATE_TYPE.ERROR,value:P}:T(P.split(/[\\/]/)).some(B=>!w(B))?{message:(0,p.formatLocalize)("validate.tree.invalidFileNameError",this.trimLongName(P)),type:c.PROMPT_VALIDATE_TYPE.ERROR,value:P}:null},this.proxyPrompt=R=>{let P=!1;const k=async V=>{const $=await this.fileTreeService.getNodeByPathOrUri(V);$&&(E.Directory.is($)?this.selectFileDecoration($):this.location($.uri))},F=async V=>{var $,Y,z;if(this.validateMessage=void 0,R instanceof c.RenamePromptHandle){const H=R.target,K=R.target.displayName.split(S.separator),Z=H.name.indexOf(S.separator)>0;if(Z&&this.activeUri&&!R.target.uri.toString().includes(this.activeUri.toString()))return!1;const X=this.activeUri?K.length-R.target.uri.toString().replace(this.activeUri.toString(),"").split(S.separator).length:-1,ie=X===-1?[]:K.slice(0,X).concat(V);let oe=H.uri,le=H.parent.uri.resolve(V);if(Z&&(($=this.activeUri)===null||$===void 0?void 0:$.displayName)===V||!Z&&V===H.name)return!0;R.addAddonAfter("loading_indicator"),Z&&ie.length>0&&E.Directory.is(H.parent)&&(oe=H.parent.uri.resolve(K.slice(0,X+1).join(S.separator)),le=H.parent.uri.resolve(ie.concat().join(S.separator)));const pe=await this.fileTreeAPI.mv(oe,le,H.type===c.TreeNodeType.CompositeTreeNode);if(pe)return this.validateMessage={type:c.PROMPT_VALIDATE_TYPE.ERROR,message:pe,value:V},this.fileTreeService.updateRefreshable(!0),R.addValidateMessage(this.validateMessage),!1;if(this.fileTreeService.updateRefreshable(!1),R.removeAddonAfter(),!Z&&H.parent){const q=await this.fileTreeService.moveNodeByPath(H.parent,H.parent,H.name,V,H.type);q&&this.selectFileDecoration(q,!1),this.fileTreeService.updateRefreshable(!0)}else if(E.Directory.is(H)&&!E.Directory.isRoot(H)){H.updateMetaData({name:ie.concat(K.slice(X+1)).join(S.separator),uri:le,fileStat:{...H.filestat,uri:le.toString()},tooltip:this.fileTreeAPI.getReadableTooltip(le)}),this.treeModel.dispatchChange();let q;E.Directory.is(H.parent)&&(!((Y=H.parent.children)===null||Y===void 0)&&Y.find(Ee=>H.path.indexOf(Ee.path)>=0))?q=this.fileTreeService.refresh(H.parent):q=this.fileTreeService.refresh(H),q.then(()=>{k(le)})}R.removeAddonAfter()}else if(R instanceof c.NewPromptHandle){const H=R.parent,K=H.uri.resolve(V);let Z;if(R.addAddonAfter("loading_indicator"),this.fileTreeService.updateRefreshable(!0),R.type===c.TreeNodeType.CompositeTreeNode?Z=await this.fileTreeAPI.createDirectory(K):Z=await this.fileTreeAPI.createFile(K),R.removeAddonAfter(),Z)return this.validateMessage={type:c.PROMPT_VALIDATE_TYPE.ERROR,message:Z,value:V},this.fileTreeService.updateRefreshable(!1),R.addValidateMessage(this.validateMessage),!1;if(V.includes(S.separator)&&this.fileTreeService.refresh(H).then(()=>{k(H.uri.resolve(V))}),this.fileTreeService.isCompactMode)if(R.type===c.TreeNodeType.CompositeTreeNode)if((!H.children||H.children.length===0)&&!E.Directory.isRoot(H)){const ie=H.uri.resolve(V),oe=[H.name].concat(V).join(S.separator);H.updateMetaData({name:oe,uri:ie,fileStat:{...H.filestat,uri:ie.toString()},tooltip:this.fileTreeAPI.getReadableTooltip(ie)}),k(ie)}else await this.fileTreeService.addNode(H,V,R.type),k(H.uri.resolve(V));else await this.fileTreeService.addNode(H,V,R.type),k(H.uri.resolve(V));else await this.fileTreeService.addNode(H,V,R.type),k(H.uri.resolve(V))}return(z=this.contextKey)===null||z===void 0||z.filesExplorerInputFocused.set(!1),!0},L=async V=>{var $,Y,z,H;if(this.validateMessage&&this.validateMessage.type===c.PROMPT_VALIDATE_TYPE.ERROR)return this.validateMessage=void 0,!0;if(P)return!1;if(!V){($=this.contextKey)===null||$===void 0||$.explorerCompressedFocusContext.set(!1),(Y=this.contextKey)===null||Y===void 0||Y.explorerCompressedFirstFocusContext.set(!1),(z=this.contextKey)===null||z===void 0||z.explorerCompressedLastFocusContext.set(!1),this.fileTreeService.isCompactMode&&R instanceof c.NewPromptHandle&&this.fileTreeService.refresh(R.parent);return}return(H=this.contextKey)===null||H===void 0||H.filesExplorerInputFocused.set(!1),await F(V),!0},B=async V=>{if(P=!0,this.validateMessage&&this.validateMessage.type===c.PROMPT_VALIDATE_TYPE.ERROR)return!1;if(V.trim()===""||this.validateMessage&&this.validateMessage.type!==c.PROMPT_VALIDATE_TYPE.ERROR)return this.validateMessage=void 0,!0;const $=await F(V);return P=!1,!!$},j=async()=>{var V;(V=this.contextKey)===null||V===void 0||V.filesExplorerInputFocused.set(!0)},W=()=>{var V;this.fileTreeService.updateRefreshable(!0),(V=this.contextKey)===null||V===void 0||V.filesExplorerInputFocused.set(!1),this.contextMenuFile&&this.selectFileDecoration(this.contextMenuFile,!0)},U=()=>{var V;(V=this.contextKey)===null||V===void 0||V.filesExplorerInputFocused.set(!1),this.fileTreeService.isCompactMode&&R instanceof c.NewPromptHandle&&this.fileTreeService.refresh(R.parent)},Q=V=>{const $=this.validateFileName(R,V);$?(this.validateMessage=$,R.addValidateMessage($)):!$&&this.validateMessage&&this.validateMessage.value!==V&&(this.validateMessage=void 0,R.removeValidateMessage())};R.destroyed||(this.fileTreeService.updateRefreshable(!1),R.onChange(Q),R.onCommit(B),R.onBlur(L),R.onFocus(j),R.onDestroy(W),R.onCancel(U))},this.copyFile=async R=>{var P;this.pasteStore&&this.pasteStore.type===d.PasteTypes.CUT&&(this._pasteStore.files.forEach(F=>{F&&this.cutDecoration.removeTarget(F)}),(P=this.contextKey)===null||P===void 0||P.explorerResourceCut.set(!1)),this.treeModel.dispatchChange();const k=[];for(const F of R){const L=this.fileTreeService.getNodeByPathOrUri(F);L&&k.push(L)}this._pasteStore={files:k,type:d.PasteTypes.COPY},this.clipboardService.writeResources(R)},this.pasteFile=async R=>{var P,k;let F=!1,L=this.fileTreeService.getNodeByPathOrUri(R.toString());if(!L)return;let B=this.pasteStore,j=!1;if(!B){const W=await this.clipboardService.readResources();if(!W||!W.length)return;B={files:[],type:d.PasteTypes.COPY,crossFiles:W},j=!0}if(B){if(E.Directory.is(L)||(F=!0,L=L.parent),j){const W=(0,p.localize)("file.confirm.paste.ok"),U=(0,p.localize)("file.confirm.paste.cancel");if(await this.dialogService.warning((0,p.formatLocalize)("file.confirm.paste",`[ ${(P=B.crossFiles)===null||P===void 0?void 0:P.map(V=>V.displayName).join(",")} ]`,E.Directory.isRoot(L)?L.uri.displayName:L.displayName),[U,W])!==W)return}if(B.type===d.PasteTypes.CUT){for(const U of B.files)U&&this.cutDecoration.removeTarget(U),L.expanded||await L.setExpanded(!0);const W=await this.fileTreeAPI.mvFiles(B.crossFiles?B.crossFiles.map(U=>{var Q;return{url:U,isDirectory:((Q=this.fileTreeService.getNodeByPathOrUri(U))===null||Q===void 0?void 0:Q.filestat.isDirectory)||!1}}):B.files.map(U=>({url:U.uri,isDirectory:U.filestat.isDirectory})),L.uri);W&&W.length>0&&(W.forEach(U=>{this.messageService.error(U)}),this.fileTreeService.refresh()),(k=this.contextKey)===null||k===void 0||k.explorerResourceCut.set(!1),this.treeModel.dispatchChange(),this._pasteStore={files:[],type:d.PasteTypes.NONE,crossFiles:void 0}}else if(B.type===d.PasteTypes.COPY){const W=B.crossFiles?B.crossFiles:B.files.map(U=>U.uri);for(const U of W){L.uri.isEqual(U)&&!F&&(L=L.parent);const Q=L.uri.resolve(U.displayName);L.expanded||await L.setExpanded(!0);const V=await this.fileTreeAPI.copyFile(U,Q);if(V)if(V.uri){const $=new p.URI(V.uri),Y=await this.filesystem.getFileStat(U.toString());this.fileTreeService.addNode(L,$.displayName,Y?.isDirectory?c.TreeNodeType.CompositeTreeNode:c.TreeNodeType.TreeNode)}else this.messageService.error(`Error when copy file: ${U.toString()}, ${V}`)}}}},this.cutFile=async R=>{var P;R.length>0&&((P=this.contextKey)===null||P===void 0||P.explorerResourceCut.set(!0)),this._pasteStore&&this._pasteStore.type===d.PasteTypes.CUT&&this._pasteStore.files.forEach(F=>{this.cutDecoration.removeTarget(F)});const k=[];for(const F of R){const L=this.fileTreeService.getNodeByPathOrUri(F);L&&k.push(L)}this._pasteStore={files:k,type:d.PasteTypes.CUT};for(const F of k)F&&this.cutDecoration.addTarget(F);this.treeModel.dispatchChange()},this.location=async R=>{if(await this.whenReady,!this.fileTreeService.filterMode)return this._fileToLocation=R,this.locationThrottler.queue(this.doLocation)},this.doLocation=async()=>{if(!this._fileToLocation)return;const R=this._fileToLocation;let P;if(typeof R=="string"?P=R:P=await this.fileTreeService.getFileTreeNodePathByUri(R),P){if(!this.fileTreeHandle)return;const k=await this.fileTreeHandle.ensureVisible(P,"center",!0);k&&this.selectFileDecoration(k)}this._fileToLocation=void 0},this.locationOnShow=R=>{this._nextLocationTarget=R},this.performLocationOnHandleShow=async()=>{this._nextLocationTarget&&(await this.location(this._nextLocationTarget),this._nextLocationTarget=void 0)}}get onDidFocusedFileChange(){return this.onDidFocusedFileChangeEmitter.event}get onDidContextMenuFileChange(){return this.onDidContextMenuFileChangeEmitter.event}get onDidSelectedFileChange(){return this.onDidSelectedFileChangeEmitter.event}get onFileTreeModelChange(){return this.onFileTreeModelChangeEmitter.event}get fileTreeHandle(){return this._fileTreeHandle}get decorations(){return this._decorations}get treeModel(){return this._treeModel}get dndService(){return this._dndService}get whenReady(){return this._whenReady.promise}get focusedFile(){return this._focusedFile}set focusedFile(R){this.onDidFocusedFileChangeEmitter.fire(R?R.uri:void 0),this._focusedFile=R}get contextMenuFile(){return this._contextMenuFile}set contextMenuFile(R){this.onDidContextMenuFileChangeEmitter.fire(R?R.uri:void 0),this._contextMenuFile=R}get selectedFiles(){return this._selectedFiles}set selectedFiles(R){this.onDidSelectedFileChangeEmitter.fire(R?R.map(P=>P.uri):[]),this._selectedFiles=R}get activeUri(){return this._activeUri}get pasteStore(){return this._pasteStore}get explorerStorage(){return this._explorerStorage}get currentRelativeUriContextKey(){return this._currentRelativeUriContextKey||(this._currentRelativeUriContextKey=this.fileTreeService.contextMenuContextKeyService.createKey("filetreeContextRelativeUri","")),this._currentRelativeUriContextKey}get currentContextUriContextKey(){return this._currentContextUriContextKey||(this._currentContextUriContextKey=this.fileTreeService.contextMenuContextKeyService.createKey("filetreeContextUri","")),this._currentContextUriContextKey}get contextMenuResourceContext(){return this._contextMenuResourceContext||(this._contextMenuResourceContext=new v.ResourceContextKey(this.fileTreeService.contextMenuContextKeyService)),this._contextMenuResourceContext}get contextKey(){return this.fileTreeService.contextKey}get initTreeModelReady(){return this._initTreeModelReady}async initTreeModel(){this._initTreeModelReady=!1;const R=(await this.fileTreeService.resolveChildren())[0];if(!R){this._whenReady.resolve();return}this._treeModel=this.injector.get(f.FileTreeModel,[R]),this.initDecorations(R),this._dndService=this.injector.get(A.DragAndDropService,[this]),this.treeStateWatcher=this._treeModel.getTreeStateWatcher(!0),this.disposableCollection.push(this.fileTreeService.onNodeRefreshed(()=>{this.initTreeModelReady&&(this.refreshedActionDelayer.isTriggered()||this.refreshedActionDelayer.cancel(),this.refreshedActionDelayer.trigger(async()=>{if(this.selectedFiles.length===0){const k=this.editorService.currentEditor;k&&k.currentUri&&this.location(k.currentUri)}this.fileTreeService.isCompactMode||(this._activeUri=null)}))})),this.disposableCollection.push(this.fileTreeService.onWorkspaceChange(()=>{this.disposableCollection.dispose(),this.initTreeModel()})),this.disposableCollection.push(this.labelService.onDidChange(async()=>{this.initTreeModelReady&&(this.labelChangedDelayer.isTriggered()||this.labelChangedDelayer.cancel(),this.labelChangedDelayer.trigger(async()=>{this.fileTreeService.refresh()}))})),this.disposableCollection.push(this.treeModel.root.watcher.on(c.TreeNodeEvent.WillResolveChildren,k=>{this.loadingDecoration.addTarget(k),this.treeModel.dispatchChange()})),this.disposableCollection.push(this.treeModel.root.watcher.on(c.TreeNodeEvent.DidResolveChildren,k=>{this.loadingDecoration.clearAppliedTarget(),this.treeModel.dispatchChange()})),this._explorerStorage=await this.storageProvider(p.STORAGE_NAMESPACE.EXPLORER);const P=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY);P&&await this.loadFileTreeSnapshot(P),this.disposableCollection.push(this.treeStateWatcher.onDidChange(()=>{if(!this._initTreeModelReady)return;const k=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),F=this.treeStateWatcher.snapshot();this.explorerStorage.set(n.FILE_TREE_SNAPSHOT_KEY,{...k,...F})})),this.fileTreeService.startWatchFileEvent(),this.onFileTreeModelChangeEmitter.fire(this._treeModel),this._whenReady.resolve(),this._initTreeModelReady=!0}initDecorations(R){this._decorations=new c.DecorationsManager(R),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.contextMenuDecoration),this._decorations.addDecoration(this.cutDecoration),this._decorations.addDecoration(this.loadingDecoration)}setFileTreeContextKey(R){var P;this.currentContextUriContextKey.set(R.uri.toString()),this.currentRelativeUriContextKey.set((this.treeModel.root.uri.relative(R.uri)||"").toString()),this.contextMenuResourceContext.set(R.uri),(P=this.contextKey)===null||P===void 0||P.explorerResourceIsFolder.set(R&&R.type===c.TreeNodeType.CompositeTreeNode)}async loadFileTreeSnapshot(R){await this._treeModel.loadTreeState(R)}updateExplorerCompressedContextKey(R,P){var k,F,L,B,j,W,U,Q,V,$,Y,z,H,K,Z,X;if(R&&P){(k=this.contextKey)===null||k===void 0||k.explorerCompressedFocusContext.set(!0);const ie=new S(R.name);ie.name===P.displayName?((F=this.contextKey)===null||F===void 0||F.explorerCompressedLastFocusContext.set(!0),(L=this.contextKey)===null||L===void 0||L.explorerCompressedFirstFocusContext.set(!1)):ie.root&&ie.root.name===P.displayName?((B=this.contextKey)===null||B===void 0||B.explorerCompressedLastFocusContext.set(!1),(j=this.contextKey)===null||j===void 0||j.explorerCompressedFirstFocusContext.set(!0)):((W=this.contextKey)===null||W===void 0||W.explorerCompressedLastFocusContext.set(!1),(U=this.contextKey)===null||U===void 0||U.explorerCompressedFirstFocusContext.set(!1))}else R?R.name.indexOf(S.separator)>0?((Q=this.contextKey)===null||Q===void 0||Q.explorerCompressedFocusContext.set(!0),(V=this.contextKey)===null||V===void 0||V.explorerCompressedFirstFocusContext.set(!1),($=this.contextKey)===null||$===void 0||$.explorerCompressedLastFocusContext.set(!0)):((Y=this.contextKey)===null||Y===void 0||Y.explorerCompressedFocusContext.set(!1),(z=this.contextKey)===null||z===void 0||z.explorerCompressedFirstFocusContext.set(!1),(H=this.contextKey)===null||H===void 0||H.explorerCompressedLastFocusContext.set(!1)):((K=this.contextKey)===null||K===void 0||K.explorerCompressedFocusContext.set(!1),(Z=this.contextKey)===null||Z===void 0||Z.explorerCompressedFirstFocusContext.set(!1),(X=this.contextKey)===null||X===void 0||X.explorerCompressedLastFocusContext.set(!1))}handleTreeHandler(R){this._fileTreeHandle=R}toggleOrOpenCurrentFile(){let R;this.focusedFile?R=this.focusedFile:this.contextMenuFile&&(R=this.contextMenuFile),R&&(this.activeFileDecoration(R),E.Directory.is(R)?this.toggleDirectory(R):this.fileTreeService.openFile(R.uri))}moveToNext(){let R;if(this.focusedFile?R=this.focusedFile:this.contextMenuFile&&(R=this.contextMenuFile),!R)return;const k=this.treeModel.root.getIndexAtTreeNode(R)+1,F=this.treeModel.root.getTreeNodeAtIndex(k),L=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),B=(k+1)*a.FILE_TREE_NODE_HEIGHT-(L.scrollPosition||0),{height:j}=this.fileTreeHandle.getCurrentSize();F&&(this.activateFileFocusedDecoration(F),B>j&&this.fileTreeHandle.ensureVisible(F,"end"))}moveToPrev(){let R;if(this.focusedFile?R=this.focusedFile:this.contextMenuFile&&(R=this.contextMenuFile),!R)return;const P=this.treeModel.root.getIndexAtTreeNode(R);if(P===0)return;const k=P-1,F=this.treeModel.root.getTreeNodeAtIndex(k);if(!F)return;const L=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),B=k*a.FILE_TREE_NODE_HEIGHT;this.activateFileFocusedDecoration(F),(L.scrollPosition||0)>B&&this.fileTreeHandle.ensureVisible(F,"start")}async collapseCurrentFile(){let R;this.focusedFile?(R=this.focusedFile,this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0):this.contextMenuFile&&(R=this.contextMenuFile,this.focusedDecoration.removeTarget(this.contextMenuFile),this.contextMenuFile=void 0);const P=this.selectedFiles.indexOf(R);P>=0&&(this.selectedFiles.splice(P,1),this.selectedDecoration.removeTarget(R));let k;if(E.Directory.is(R)&&R.expanded)k=R;else if(R)E.Directory.isRoot(R.parent)?k=R:k=R.parent;else return;this.focusedFile=k,k&&k.expanded&&(await this.fileTreeHandle.collapseNode(k),this.activeFileFocusedDecoration(k,!0))}async expandCurrentFile(){let R;this.focusedFile?(R=this.focusedFile,this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0):this.contextMenuFile&&(R=this.contextMenuFile,this.focusedDecoration.removeTarget(this.contextMenuFile),this.contextMenuFile=void 0);const P=this.selectedFiles.indexOf(R);P>=0&&(this.selectedFiles.splice(P,1),this.selectedDecoration.removeTarget(R)),this.focusedFile=R,E.Directory.is(R)&&(R.expanded||await this.fileTreeHandle.expandNode(R))}async collapseAll(){await this.treeModel.root.collapsedAll();const R=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY);R&&this.explorerStorage.set(n.FILE_TREE_SNAPSHOT_KEY,{...R,expandedDirectories:{atSurface:[],buried:[]}})}async deleteFileByUris(R){var P;if(R.length===0)return;if(this.corePreferences["explorer.confirmDelete"]){const B=this.applicationService.backendOS===p.OperatingSystem.Linux,j=B?(0,p.localize)("file.confirm.delete.ok"):(0,p.localize)("file.confirm.moveToTrash.ok"),W=(0,p.localize)("file.confirm.delete.cancel"),U=10;let Q=R.slice(0,U).map($=>$.displayName).join(`
|
|
31619
|
+
`,y){const A=this.hashCalculateService.calculate(d);return u.length>m.FILE_SAVE_BY_CHANGE_THRESHOLD?await this.fileSchemeDocClient.saveByChange(h.toString(),{baseMd5:A,changes:E,eol:b},f,a,y):await this.fileSchemeDocClient.saveByContent(h.toString(),{baseMd5:A,content:u},f,a,y)}async provideEditorDocumentModelContentMd5(h,u){return this.fileSchemeDocClient.getMd5(h.toString(),u)}};t.FileSchemeDocumentProvider=_,n.__decorate([(0,r.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],_.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(m.IFileSchemeDocClient),n.__metadata("design:type",Object)],_.prototype,"fileSchemeDocClient",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],_.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(c.IHashCalculateService),n.__metadata("design:type",Object)],_.prototype,"hashCalculateService",void 0),t.FileSchemeDocumentProvider=_=n.__decorate([(0,r.Injectable)()],_);let s=class{constructor(){this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event,this.listeners={}}isReadonly(h){return!0}handlesScheme(h){return h==="vscode"}async provideEditorDocumentModelContent(h,u){return this.getSchemaContent(h)}getSchemaContent(h){const u=h.toString(),d=this.jsonRegistry.getSchemaContributions().schemas[u];if(d){const E=JSON.stringify(d);if(!this.listeners[u]){const f=o.Disposable.create(()=>{this.jsonRegistry.onDidChangeSchema(a=>{a===u&&this._onDidChangeContent.fire(h)})});this.listeners[u]=f}return E}return"{}"}onDidDisposeModel(h){h.toString()&&(this.listeners[h.toString()].dispose(),delete this.listeners[h.toString()])}};t.VscodeSchemeDocumentProvider=s,n.__decorate([(0,r.Autowired)(o.ISchemaStore),n.__metadata("design:type",Object)],s.prototype,"schemaStore",void 0),n.__decorate([(0,r.Autowired)(o.IJSONSchemaRegistry),n.__metadata("design:type",Object)],s.prototype,"jsonRegistry",void 0),t.VscodeSchemeDocumentProvider=s=n.__decorate([(0,r.Injectable)()],s);let g=class{constructor(){this.documentContentMaps=new Map,this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event}handlesScheme(h){return h===o.Schemes.walkThroughSnippet}provideEditorDocumentModelContent(h,u){return this.documentContentMaps.has(h.toString())||this.documentContentMaps.set(h.toString(),""),this.documentContentMaps.get(h.toString())}isReadonly(){return!1}preferLanguageForUri(){return"plaintext"}};t.WalkThroughSnippetSchemeDocumentProvider=g,t.WalkThroughSnippetSchemeDocumentProvider=g=n.__decorate([(0,r.Injectable)()],g)},41352:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSchemeDocClientService=void 0;const n=e(85608),r=e(76003),o=e(80449);let c=class{saveByChange(v,m,_,s,g){return this.fileDocBackendService.$saveByChange(v,m,_,s,g)}saveByContent(v,m,_,s,g){return this.fileDocBackendService.$saveByContent(v,m,_,s,g)}getMd5(v,m){return this.fileDocBackendService.$getMd5(v,m)}};t.FileSchemeDocClientService=c,n.__decorate([(0,r.Autowired)(o.FileSchemeDocNodeServicePath),n.__metadata("design:type",Object)],c.prototype,"fileDocBackendService",void 0),t.FileSchemeDocClientService=c=n.__decorate([(0,r.Injectable)()],c)},17276:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystemEditorComponentContribution=t.FileSystemEditorResourceContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(26542),p=e(57517),v=e(17878),m=e(42933),_=e(57646),s=e(60387),g=e(88819),l=e(99025),h="video-preview",u="image-preview",d="external-file",E="large-file-prevent";let f=class{registerResource(y){y.registerResourceProvider(this.untitledResourceProvider)}registerEditorDocumentModelContentProvider(y){y.registerEditorDocumentModelContentProvider(this.fileSchemeDocumentProvider),y.registerEditorDocumentModelContentProvider(this.vscodeSchemeDocumentProvider),y.registerEditorDocumentModelContentProvider(this.walkThroughSnippetSchemeDocumentProvider),y.registerEditorDocumentModelContentProvider(this.untitledSchemeDocumentProvider)}};t.FileSystemEditorResourceContribution=f,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s.FileSchemeDocumentProvider)],f.prototype,"fileSchemeDocumentProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s.VscodeSchemeDocumentProvider)],f.prototype,"vscodeSchemeDocumentProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s.WalkThroughSnippetSchemeDocumentProvider)],f.prototype,"walkThroughSnippetSchemeDocumentProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",v.UntitledSchemeResourceProvider)],f.prototype,"untitledResourceProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",v.UntitledSchemeDocumentProvider)],f.prototype,"untitledSchemeDocumentProvider",void 0),t.FileSystemEditorResourceContribution=f=n.__decorate([(0,o.Domain)(p.BrowserEditorContribution)],f);let a=class{constructor(){this.cachedFileType=new o.LRUMap(200,100),this.fileServiceClient.onFilesChanged(y=>{y.forEach(A=>{this.cachedFileType.delete(A.uri.toString())})})}registerEditorComponent(y){y.registerEditorComponent({component:l.ImagePreview,uid:u,scheme:o.Schemes.file}),y.registerEditorComponent({component:l.VideoPreview,uid:h,scheme:o.Schemes.file}),y.registerEditorComponent({component:_.BinaryEditorComponent,uid:d,scheme:o.Schemes.file}),y.registerEditorComponent({component:g.LargeFilePrevent,uid:E,scheme:o.Schemes.file}),y.registerEditorComponentResolver(A=>A===o.Schemes.file||this.fileServiceClient.handlesScheme(A)?10:-1,(A,S)=>{S.length===0&&S.push({type:p.EditorOpenType.component,componentId:d})}),y.registerEditorComponentResolver(A=>A===o.Schemes.file||this.fileServiceClient.handlesScheme(A)?10:-1,async(A,S)=>{const w=await this.getFileType(A.uri.toString());switch(w){case"image":{S.push({type:p.EditorOpenType.component,componentId:u});break}case"video":{S.push({type:p.EditorOpenType.component,componentId:h});break}case"binary":case"text":{const{metadata:T,uri:D}=A,I=T||{};if(w==="binary"&&!I.skipPreventBinary)break;const O=await this.fileServiceClient.getFileStat(D.toString());await this.preference.ready;const M=this.preference.getValid("editor.largeFile",4*1024*1024*1024);O&&(O.size||0)>M&&!I.skipPreventTooLarge?S.push({type:p.EditorOpenType.component,componentId:E}):S.push({type:p.EditorOpenType.code,title:(0,o.localize)("editorOpenType.code")});break}}}),y.registerEditorComponentResolver(o.Schemes.untitled,(A,S,w)=>{w([{type:p.EditorOpenType.code,priority:"default"}])})}async getFileType(y){return this.cachedFileType.has(y)||((0,c.getLanguageIdFromMonaco)(new o.URI(y))?this.cachedFileType.set(y,"text"):this.cachedFileType.set(y,await this.getRealFileType(y))),this.cachedFileType.get(y)}async getRealFileType(y){try{return await this.fileServiceClient.getFileType(y)}catch{return"text"}}};t.FileSystemEditorComponentContribution=a,n.__decorate([(0,r.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],a.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],a.prototype,"preference",void 0),t.FileSystemEditorComponentContribution=a=n.__decorate([(0,o.Domain)(p.BrowserEditorContribution),n.__metadata("design:paramtypes",[])],a)},52568:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSchemeModule=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(80449),p=e(41352),v=e(17276);let m=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[v.FileSystemEditorResourceContribution,v.FileSystemEditorComponentContribution,{token:c.IFileSchemeDocClient,useClass:p.FileSchemeDocClientService}],this.backServices=[{servicePath:c.FileSchemeDocNodeServicePath}]}};t.FileSchemeModule=m,t.FileSchemeModule=m=n.__decorate([(0,r.Injectable)()],m)},88819:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LargeFilePrevent=t.PreventComponent=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=e(41869),p=e(81878),v=e(54414),m=e(82196),_=n.__importDefault(e(19996)),s=l=>o.default.createElement("div",{className:_.default["error-page"]},o.default.createElement("div",{className:(0,r.default)(_.default.icon,(0,c.getExternalIcon)("warning"))}),o.default.createElement("div",{className:_.default.description},l.description),o.default.createElement("div",{className:_.default["actions-wrapper"]},l.actions.map((h,u)=>o.default.createElement(p.Button,{key:u,onClick:()=>h.onClick(),className:_.default["action-button"]},h.label))));t.PreventComponent=s;const g=()=>{const l=(0,c.useInjectable)(v.WorkbenchEditorService),h=(0,c.useInjectable)(c.IEventBus),u=()=>{const d=l.currentResource;d&&(d.metadata={...d.metadata,skipPreventTooLarge:!0},h.fire(new m.ResourceOpenTypeChangedEvent(d.uri)))};return o.default.createElement(t.PreventComponent,{description:(0,c.localize)("editor.largeFile.prevent"),actions:[{label:(0,c.localize)("editor.file.prevent.stillOpen"),onClick:()=>u()}]})};t.LargeFilePrevent=g},99025:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImagePreview=t.VideoPreview=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(41869),c=e(40827),p=n.__importDefault(e(19996)),v=_=>{const s=(0,o.useInjectable)(c.StaticResourceService);return{src:r.default.useMemo(()=>s.resolveStaticResource(_.uri).toString(),[_])}};t.VideoPreview=(0,r.memo)(_=>{const{src:s}=v(_.resource);return r.default.createElement("div",{className:p.default.kt_video_preview},r.default.createElement("video",{playsInline:!0,controls:!0,className:p.default.kt_video,src:s}))});const m=_=>{const s=r.default.useRef(),g=r.default.useRef(),{src:l}=v(_.resource);return r.default.useEffect(()=>{const h=new o.Disposable;return s.current&&(s.current.src=l),()=>{h.dispose()}},[_.resource]),r.default.createElement("div",{className:p.default.kt_image_preview},r.default.createElement("div",{ref:g},r.default.createElement("img",{ref:h=>h&&(s.current=h)})))};t.ImagePreview=m},80449:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChangeType=t.FileSchemeDocNodeServicePath=t.IFileSchemeDocNodeService=t.IFileSchemeDocClient=t.FILE_SAVE_BY_CHANGE_THRESHOLD=t.FILE_ON_DISK_SCHEME=void 0,t.FILE_ON_DISK_SCHEME="fileOnDisk",t.FILE_SAVE_BY_CHANGE_THRESHOLD=1e5,t.IFileSchemeDocClient=Symbol("IFileSchemeDocClient"),t.IFileSchemeDocNodeService=Symbol("FileSchemeDocNodeService"),t.FileSchemeDocNodeServicePath="FileSchemeDocNodeService";var e;(function(n){n[n.ADDED=1]="ADDED",n[n.REMOVED=2]="REMOVED"})(e||(t.ChangeType=e={}))},15625:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IFileSearchService=t.FileSearchServicePath=void 0,t.FileSearchServicePath="FileSearchServicePath",t.IFileSearchService=Symbol("FileSearchService")},84660:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(15625),t)},47720:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(84660),t)},2156:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileServiceClient=t.BrowserFileSystemRegistryImpl=void 0;const n=e(85608),r=e(32852),o=e(76003),c=e(41869),p=e(43718),v=e(37406),m=e(8170),_=e(41682),s=e(42933),g=e(81952);let l=class{constructor(){this.providers=new Map}registerFileSystemProvider(d){const E=d.scheme;return this.providers.set(E,d),{dispose:()=>{this.providers.delete(E)}}}};t.BrowserFileSystemRegistryImpl=l,t.BrowserFileSystemRegistryImpl=l=n.__decorate([(0,o.Injectable)()],l);let h=class{get clientId(){return this.applicationService.clientId}constructor(){this.watcherWithSchemaMap=new Map,this.watcherDisposerMap=new Map,this.onFileChangedEmitter=new c.Emitter,this.onFileProviderChangedEmitter=new c.Emitter,this._onFilesChanged=new c.Emitter,this.onFilesChanged=this._onFilesChanged.event,this._onFileProviderChanged=new c.Emitter,this.onFileProviderChanged=this._onFileProviderChanged.event,this._onDidChangeFileSystemProviderRegistrations=new c.Emitter,this.onDidChangeFileSystemProviderRegistrations=this._onDidChangeFileSystemProviderRegistrations.event,this._onWillActivateFileSystemProvider=new c.Emitter,this.onWillActivateFileSystemProvider=this._onWillActivateFileSystemProvider.event,this._onDidChangeFileSystemProviderCapabilities=new c.Emitter,this.onDidChangeFileSystemProviderCapabilities=this._onDidChangeFileSystemProviderCapabilities.event,this.filesExcludesMatcherList=[],this.watcherId=0,this.toDisposable=new c.DisposableCollection,this.watchFileExcludes=[],this.watchFileExcludesMatcherList=[],this.filesExcludes=[],this.workspaceRoots=[],this._providerChanged=new Set,this.fsProviders=new Map,this.userHomeDeferred=new c.Deferred,this.options={encoding:"utf8",overwrite:!1,recursive:!0,moveToTrash:!0},this.uriWatcherMap=new Map,this.toDisposable.push(this.onDidChangeFileSystemProviderRegistrations(d=>{d.added&&d.scheme===p.Schemes.file&&this.doGetCurrentUserHome()}))}async initialize(){const d=await this.getProvider(p.Schemes.file);d.initialize&&await d.initialize(this.clientId,this.appConfig.recursiveWatcherBackend)}async doGetCurrentUserHome(){const E=(await this.getProvider(p.Schemes.file)).getCurrentUserHome();this.userHomeDeferred.resolve(E)}handlesScheme(d){return this.registry.providers.has(d)||this.fsProviders.has(d)}dispose(){return this.toDisposable.dispose()}async resolveContent(d,E){const f=this.convertUri(d),b=await(await this.getProvider(f.scheme)).readFile(f.codeUri),y=b.data||b;return{content:c.BinaryBuffer.wrap(Uint8Array.from(y)).toString(E?.encoding)}}async readFile(d){const E=this.convertUri(d),a=await(await this.getProvider(E.scheme)).readFile(E.codeUri),b=a.data||a;return{content:c.BinaryBuffer.wrap(Uint8Array.from(b))}}async readFileStream(d){const E=this.convertUri(d);return await(await this.getProvider(E.scheme)).readFileStream(E.codeUri)}async getFileStat(d,E=!0){const f=this.convertUri(d),a=await this.getProvider(f.scheme);try{const b=await a.stat(f.codeUri);if(!b)throw s.FileSystemError.FileNotFound(f.codeUri.toString(),"File not found.");return this.filterStat(b,E)}catch(b){if(s.FileSystemError.FileNotFound.is(b))return}}async setContent(d,E,f){const a=this.convertUri(d.uri),b=await this.getProvider(a.scheme),y=await b.stat(a.codeUri);if(!y)throw s.FileSystemError.FileNotFound(d.uri,"File not found.");if(y.isDirectory)throw s.FileSystemError.FileIsADirectory(d.uri,"Cannot set the content.");if(!await this.isInSync(d,y))throw this.createOutOfSyncError(d);return await b.writeFile(a.codeUri,typeof E=="string"?c.BinaryBuffer.fromString(E).buffer:E,{create:!1,overwrite:!0,encoding:f?.encoding}),await b.stat(a.codeUri)}async updateContent(d,E,f){const a=this.convertUri(d.uri),b=await this.getProvider(a.scheme),y=await b.stat(a.codeUri);if(!y)throw s.FileSystemError.FileNotFound(d.uri,"File not found.");if(y.isDirectory)throw s.FileSystemError.FileIsADirectory(d.uri,"Cannot set the content.");if(!this.checkInSync(d,y))throw this.createOutOfSyncError(d);if(E.length===0)return y;const A=await b.readFile(a.codeUri),S=this.applyContentChanges(c.BinaryBuffer.wrap(A).toString(f?.encoding),E);await b.writeFile(a.codeUri,c.BinaryBuffer.fromString(S).buffer,{create:!1,overwrite:!0,encoding:f?.encoding});const w=await b.stat(a.codeUri);if(!w)throw s.FileSystemError.FileNotFound(a.codeUri.toString(),"File not found.");return w}async createFile(d,E){const f=this.convertUri(d),a=await this.getProvider(f.scheme),b=c.BinaryBuffer.fromString(E?.content||"").buffer;let y=await a.writeFile(f.codeUri,b,{create:!0,overwrite:E&&E.overwrite||!1,encoding:E?.encoding});return y=y||await a.stat(f.codeUri),y}async createFolder(d){const E=this.convertUri(d),f=await this.getProvider(E.scheme),a=await f.createDirectory(E.codeUri);return a||await f.stat(E.codeUri)}async move(d,E,f){const a=this.convertUri(d),b=this.convertUri(E),y=await this.getProvider(a.scheme),A=await y.rename(a.codeUri,b.codeUri,{overwrite:!!(f&&f.overwrite)});return A||await y.stat(b.codeUri)}async copy(d,E,f){const a=this.convertUri(d),b=this.convertUri(E),y=await this.getProvider(a.scheme),A=await this.doGetOverwrite(f);if(!(0,s.containsExtraFileMethod)(y,"copy"))throw this.getErrorProvideNotSupport(a.scheme,"copy");const S=await y.copy(a.codeUri,b.codeUri,{overwrite:!!A});return S||await y.stat(b.codeUri)}async getFsPath(d){if(d.startsWith("file:/"))return c.FileUri.fsPath(d)}fireFilesChange(d){const E=d.changes.map(f=>({uri:f.uri,type:f.type}));this._onFilesChanged.fire(E),this.eventBus.fire(new c.FilesChangeEvent(E))}async watchFileChanges(d,E){const a=(this.appConfig.pollingWatcherDirectories||[]).some(I=>d.path.toString().startsWith(I)),b=this.convertUri(d.toString()),y=this.uriWatcherMap.get(b.toString());if(y)if(y.isDisposed())this.uriWatcherMap.delete(b.toString());else return y;const A=this.watcherId++,S=await this.getProvider(b.scheme),w=this.watcherWithSchemaMap.get(b.scheme)||[],T=await S.watch(b.codeUri,{excludes:E,pollingWatch:a});this.watcherDisposerMap.set(A,{dispose:async()=>{const I=this.uriWatcherMap.get(b.toString());await Promise.all([S.unwatch&&S.unwatch(T),I&&I.dispose()]),this.uriWatcherMap.delete(b.toString())}}),w.push(A),this.watcherWithSchemaMap.set(b.scheme,w);const D=new g.FileSystemWatcher({fileServiceClient:this,watchId:A,uri:d});return this.uriWatcherMap.set(b.toString(),D),D}async setWatchFileExcludes(d){return await(await this.getProvider(p.Schemes.file)).setWatchFileExcludes(d)}async getWatchFileExcludes(){return await(await this.getProvider(p.Schemes.file)).getWatchFileExcludes()}async setFilesExcludes(d,E){this.filesExcludes=d,this.filesExcludesMatcherList=[],E&&this.setWorkspaceRoots(E),this.updateExcludeMatcher()}async setWorkspaceRoots(d){this.workspaceRoots=d,this.updateExcludeMatcher()}async unwatchFileChanges(d){const E=this.watcherDisposerMap.get(d);if(!(!E||!E.dispose))return this.watcherDisposerMap.delete(d),E.dispose()}async delete(d,E){if(this.appConfig.isElectronRenderer&&E?.moveToTrash!==!1){const b=new c.URI(d);if(b.scheme===p.Schemes.file)return this.injector.get(v.IElectronMainUIService).moveToTrash(b.codeUri.fsPath)}const f=this.convertUri(d),a=await this.getProvider(f.scheme);await a.stat(f.codeUri),await a.delete(f.codeUri,{recursive:!0,moveToTrash:await this.doGetMoveToTrash(E)})}async getEncoding(d){return"utf8"}listCapabilities(){return _.Iterable.map(this.fsProviders,([d,E])=>({scheme:d,capabilities:E.capabilities}))}registerProvider(d,E){if(this.fsProviders.has(d))throw new Error(`The file system provider for \`${d}\` already registered`);const f=[];this.fsProviders.set(d,E),this._onDidChangeFileSystemProviderRegistrations.fire({added:!0,scheme:d,provider:E}),f.push({dispose:()=>{this._onDidChangeFileSystemProviderRegistrations.fire({added:!1,scheme:d,provider:E}),this.fsProviders.delete(d),this._providerChanged.add(d)}}),E.onDidChangeFile&&f.push(E.onDidChangeFile(b=>this.fireFilesChange({changes:b}))),this.toDisposable.push(E.onDidChangeCapabilities(()=>this._onDidChangeFileSystemProviderCapabilities.fire({provider:E,scheme:d}))),f.push({dispose:async()=>{const b=[];(this.watcherWithSchemaMap.get(d)||[]).forEach(y=>b.push(this.unwatchFileChanges(y))),await Promise.all(b)}}),this._providerChanged.add(d),this.onFileProviderChangedEmitter.fire(Array.from(this._providerChanged)),this.toDisposable.pushAll(f);const a=new c.DisposableCollection;return a.pushAll(f),this._onFileProviderChanged.fire(Array.from(this._providerChanged)),a}async access(d,E=s.FileAccess.Constants.F_OK){const f=this.convertUri(d),a=await this.getProvider(f.scheme);if(!(0,s.containsExtraFileMethod)(a,"access"))throw this.getErrorProvideNotSupport(f.scheme,"access");return await a.access(f.codeUri,E)}async getFileType(d){const E=this.convertUri(d),f=await this.getProvider(E.scheme);if(!(0,s.containsExtraFileMethod)(f,"getFileType"))throw this.getErrorProvideNotSupport(E.scheme,"getFileType");return await f.getFileType(d)}async getCurrentUserHome(){return this.userHomeDeferred.promise}getErrorProvideNotSupport(d,E){return`Scheme ${d} not support this function: ${E}.`}convertUri(d){const E=new c.URI(d);if(!E.scheme)throw new Error(`Unsupported convert Uri with non-scheme Uri: ${d}`);return E}updateExcludeMatcher(){this.filesExcludes.forEach(d=>{this.workspaceRoots.length>0?this.workspaceRoots.forEach(E=>{const a=new c.URI(E).resolve(d).path.toString();this.filesExcludesMatcherList.push((0,c.parseGlob)(a))}):this.filesExcludesMatcherList.push((0,c.parseGlob)(d))})}async shouldWaitProvider(d){const E=await this._onWillActivateFileSystemProvider.fireAndAwait({scheme:d}),{result:f}=E[0];if(f&&f.includes(d)){const a=await c.Event.toPromise(c.Event.filter(this.onFileProviderChanged,b=>b.includes(d)));if(!(0,p.isUndefined)(a))return!0}return!1}async getProvider(d){this._providerChanged.has(d)&&(await this.eventBus.fireAndAwait(new c.ExtensionActivateEvent({topic:"onFileSystem",data:d}),{timeout:3e3}),this._providerChanged.delete(d));const E=this.fsProviders.get(d);if(!E)throw new Error(`Not find ${d} provider.`);return E}async isReadonly(d){try{const E=new c.URI(d);return!!(await(await this.getProvider(E.scheme)).stat(this.convertUri(d).codeUri)).readonly}catch{return!1}}isExclude(d){const E=new c.URI(d);return this.filesExcludesMatcherList.some(f=>f(E.path.toString()))}filterStat(d,E=!0){if(d&&!this.isExclude(d.uri))return d.children&&E&&(d.children=this.filterStatChildren(d.children)),d}filterStatChildren(d){const E=[];return d.forEach(f=>{if(this.isExclude(f.uri))return!1;const a=this.filterStat(f);a&&E.push(a)}),E}applyContentChanges(d,E){let f=r.TextDocument.create("","",1,d);for(const a of E){let b=a.text;if(a.range){const y=f.offsetAt(a.range.start),A=f.offsetAt(a.range.end);b=f.getText().substr(0,y)+a.text+f.getText().substr(A)}f=r.TextDocument.create(f.uri,f.languageId,f.version,b)}return f.getText()}async isInSync(d,E){return!!this.checkInSync(d,E)}checkInSync(d,E){return E.lastModification===d.lastModification&&E.size===d.size}createOutOfSyncError(d){return s.FileSystemError.FileIsOutOfSync(d.uri)}async doGetEncoding(d){return d&&typeof d.encoding<"u"?d.encoding:this.options.encoding}async doGetOverwrite(d){return d&&typeof d.overwrite<"u"?d.overwrite:this.options.overwrite}async doGetRecursive(d){return d&&typeof d.recursive<"u"?d.recursive:this.options.recursive}async doGetMoveToTrash(d){return d&&typeof d.moveToTrash<"u"?d.moveToTrash:this.options.moveToTrash}};t.FileServiceClient=h,n.__decorate([(0,o.Autowired)(s.IBrowserFileSystemRegistry),n.__metadata("design:type",l)],h.prototype,"registry",void 0),n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],h.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(p.IEventBus),n.__metadata("design:type",Object)],h.prototype,"eventBus",void 0),n.__decorate([(0,o.Autowired)(c.AppConfig),n.__metadata("design:type",Object)],h.prototype,"appConfig",void 0),n.__decorate([(0,o.Autowired)(m.IApplicationService),n.__metadata("design:type",Object)],h.prototype,"applicationService",void 0),t.FileServiceClient=h=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],h)},69037:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileServiceContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(42933),p=e(2156);let v=class{constructor(){this._disposables=new o.DisposableStore,this._disposables.add(this.fileSystem.registerProvider(o.Schemes.file,this.diskFileServiceProvider))}async initialize(){const _=this.contributionProvider.getContributions();await Promise.all(_.map(async s=>{s.registerProvider&&await s.registerProvider(this.fileSystem)})),await Promise.all(_.map(async s=>{s.onFileServiceReady&&await s.onFileServiceReady()})),this.fileSystem.initialize&&await this.fileSystem.initialize()}dispose(){this._disposables.dispose()}};t.FileServiceContribution=v,n.__decorate([(0,r.Autowired)(c.IFileServiceClient),n.__metadata("design:type",p.FileServiceClient)],v.prototype,"fileSystem",void 0),n.__decorate([(0,r.Autowired)(c.IDiskFileProvider),n.__metadata("design:type",Object)],v.prototype,"diskFileServiceProvider",void 0),n.__decorate([(0,r.Autowired)(o.FsProviderContribution),n.__metadata("design:type",Object)],v.prototype,"contributionProvider",void 0),t.FileServiceContribution=v=n.__decorate([(0,o.Domain)(o.ClientAppContribution),n.__metadata("design:paramtypes",[])],v)},60476:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiskFsProviderClient=t.CoreFileServiceProviderClient=void 0;const n=e(85608),r=e(76003),o=e(43718),c=e(42933);class p{constructor(){this.onDidChangeFileEmitter=new o.Emitter,this.onDidChangeFile=this.onDidChangeFileEmitter.event}watch(_,s){return this.fileServiceProvider.watch(_,s)}unwatch(_){return this.fileServiceProvider.unwatch&&this.fileServiceProvider.unwatch(_)}async stat(_){return await this.fileServiceProvider.stat(_)}readDirectory(_){return this.fileServiceProvider.readDirectory(_)}createDirectory(_){return this.fileServiceProvider.createDirectory(_)}async readFile(_,s){return s&&(0,o.getDebugLogger)("fileService.fsProvider").warn("encoding option for fsProvider.readFile is deprecated"),await this.fileServiceProvider.readFile(_)}readFileStream(_){if(this.fileServiceProvider.readFileStream)return this.fileServiceProvider.readFileStream(_);throw new Error("readFileStream not supported")}writeFile(_,s,g){return this.fileServiceProvider.writeFile(_,Array.from(s),g)}delete(_,s){return this.fileServiceProvider.delete(_,s)}rename(_,s,g){return this.fileServiceProvider.rename(_,s,g)}}t.CoreFileServiceProviderClient=p,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],p.prototype,"injector",void 0);let v=class extends p{constructor(){super(...arguments),this.onDidChangeCapabilities=o.Event.None}get capabilities(){return this._capabilities||(this._capabilities=12318,o.isLinux&&(this._capabilities|=1024)),this._capabilities}async initialize(_,s){var g,l;if(!((g=this.fileServiceProvider)===null||g===void 0)&&g.initialize)try{await((l=this.fileServiceProvider)===null||l===void 0?void 0:l.initialize(_,s))}catch(h){(0,o.getDebugLogger)("fileService.fsProvider").error("initialize error",h)}}setWatchFileExcludes(_){return this.fileServiceProvider.setWatchFileExcludes(_)}getWatchFileExcludes(){return this.fileServiceProvider.getWatchFileExcludes()}onDidFilesChanged(_){const s=_.changes.map(g=>({uri:g.uri,type:g.type}));this.onDidChangeFileEmitter.fire(s)}copy(_,s,g){return this.fileServiceProvider.copy(_,s,g)}access(_,s){return this.fileServiceProvider.access(_,s)}getCurrentUserHome(){return this.fileServiceProvider.getCurrentUserHome()}getFileType(_){return this.fileServiceProvider.getFileType(_)}};t.DiskFsProviderClient=v,n.__decorate([(0,r.Autowired)(c.DiskFileServicePath),n.__metadata("design:type",Object)],v.prototype,"fileServiceProvider",void 0),n.__decorate([(0,o.debounce)(100),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Array]),n.__metadata("design:returntype",void 0)],v.prototype,"setWatchFileExcludes",null),t.DiskFsProviderClient=v=n.__decorate([(0,r.Injectable)()],v)},96708:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileServiceClientModule=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(42933),p=e(70671),v=e(2156),m=e(69037),_=e(60476),s=e(23188);let g=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:c.IFileServiceClient,useClass:v.FileServiceClient},{token:c.IBrowserFileSystemRegistry,useClass:v.BrowserFileSystemRegistryImpl},{token:c.IDiskFileProvider,useClass:_.DiskFsProviderClient},{token:c.IShadowFileProvider,useClass:s.ShadowFileSystemProvider},m.FileServiceContribution],this.backServices=[{servicePath:c.DiskFileServicePath,clientToken:c.IDiskFileProvider,protocol:p.DiskFileServiceProtocol}]}};t.FileServiceClientModule=g,t.FileServiceClientModule=g=n.__decorate([(0,r.Injectable)()],g)},23188:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShadowFileSystemProvider=void 0;const n=e(85608),r=e(76003),o=e(41869);let c=class{constructor(){this.capabilities=2048,this.onDidChangeCapabilities=o.Event.None,this.readonly=!0,this.shadowFiles=new Map,this.fileChangeEmitter=new o.Emitter,this.onDidChangeFile=this.fileChangeEmitter.event}unwatch(v){throw new Error("Method not implemented.")}readFileStream(v){throw new Error("Method not implemented.")}watch(v,m){throw new Error("Method not implemented.")}stat(v){return Promise.resolve({uri:v.toString(),lastModification:0})}readDirectory(v){throw new Error("Method not implemented.")}createDirectory(v){throw new Error("Method not implemented.")}readFile(v){return this.shadowFiles.get(v.toString())||o.BinaryBuffer.fromString("no available").buffer}writeFile(v,m,_){this.shadowFiles.set(v.toString(),m)}delete(v,m){throw new Error("Method not implemented.")}rename(v,m,_){throw new Error("Method not implemented.")}copy(v,m,_){throw new Error("Method not implemented.")}exists(v){throw new Error("Method not implemented.")}access(v,m){throw new Error("Method not implemented.")}};t.ShadowFileSystemProvider=c,t.ShadowFileSystemProvider=c=n.__decorate([(0,r.Injectable)()],c)},81952:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystemWatcher=void 0;const n=e(43718);function r(c,p){return c.filter(v=>!!v.uri.startsWith(p))}class o{constructor(p){this.toDispose=new n.DisposableCollection,this.changeEmitter=new n.Emitter,this.toDispose.push(this.changeEmitter),this.fileServiceClient=p.fileServiceClient,this.watchId=p.watchId,this.uri=p.uri,this.fileServiceClient.onFilesChanged(v=>{const m=r(v,this.uri.toString());m&&m.length>0&&this.changeEmitter.fire(m)})}get onFilesChanged(){return this.changeEmitter.event}dispose(){return Promise.all([this.toDispose.dispose(),this.fileServiceClient.unwatchFileChanges(this.watchId)])}isDisposed(){return this.toDispose.disposed}}t.FileSystemWatcher=o},91813:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EXT_LIST_TEXT=t.EXT_LIST_IMAGE=t.EXT_LIST_VIDEO=void 0,t.getFileTypeByExt=e,t.EXT_LIST_VIDEO=new Set(["mp4","webm","mkv","mov","mts","flv","avi","wmv"]),t.EXT_LIST_IMAGE=new Set(["png","gif","jpg","jpeg","svg","bmp","avif","cr2","cr3","dng","flif","heic","icns","jxl","jpm","jpx","nef","raf","rw2","tif","orf","webp","apng"]),t.EXT_LIST_TEXT=new Set(["xml"]);function e(n){let r="text";return n&&(t.EXT_LIST_IMAGE.has(n)?r="image":t.EXT_LIST_VIDEO.has(n)?r="video":t.EXT_LIST_TEXT.has(n)?r="text":r="binary"),r}},79929:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IBrowserFileSystemRegistry=t.IFileServiceClient=void 0;const n=e(43718);t.IFileServiceClient=n.IFileServiceClient,t.IBrowserFileSystemRegistry=Symbol("IBrowserFileSystemRegistry")},49818:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystemError=t.FileOperationError=t.FileSystemProviderError=t.FileSystemProviderErrorCode=t.FileAccess=t.IFileService=t.IShadowFileProvider=t.IDiskFileProvider=t.FileStat=t.FileType=void 0,t.createFileSystemProviderError=_,t.markAsFileSystemProviderError=s,t.containsExtraFileMethod=l,t.notEmpty=h,t.isErrnoException=u,t.handleError=d;const n=e(85608),r=e(43718);var o=e(31036);Object.defineProperty(t,"FileType",{enumerable:!0,get:function(){return o.FileType}}),Object.defineProperty(t,"FileStat",{enumerable:!0,get:function(){return o.FileStat}}),n.__exportStar(e(11854),t),t.IDiskFileProvider=Symbol("IDiskFileProvider"),t.IShadowFileProvider=Symbol("IShadowFileProvider"),t.IFileService=Symbol("IFileService");var c;(function(E){let f;(function(a){a.F_OK=0,a.R_OK=4,a.W_OK=2,a.X_OK=1})(f=E.Constants||(E.Constants={}))})(c||(t.FileAccess=c={}));var p;(function(E){E.FileExists="EntryExists",E.FileNotFound="EntryNotFound",E.FileNotADirectory="EntryNotADirectory",E.FileIsADirectory="EntryIsADirectory",E.FileIsOutOfSync="FileIsOutOfSync",E.FileExceedsMemoryLimit="EntryExceedsMemoryLimit",E.FileTooLarge="EntryTooLarge",E.FileWriteLocked="EntryWriteLocked",E.NoPermissions="NoPermissions",E.Unavailable="Unavailable",E.Unknown="Unknown"})(p||(t.FileSystemProviderErrorCode=p={}));class v extends Error{static declare(f,a){return Object.assign((...b)=>_(a(...b),f),{is:b=>{var y;return(y=b.stack)===null||y===void 0?void 0:y.startsWith(f)}})}constructor(f,a){super(f),this.code=a}is(f){return this.name===f.name}}t.FileSystemProviderError=v;class m extends Error{constructor(f,a,b){super(f),this.fileOperationResult=a,this.options=b}static isFileOperationError(f){return f instanceof Error&&!(0,r.isUndefinedOrNull)(f.fileOperationResult)}}t.FileOperationError=m;function _(E,f){const a=new v(E.toString(),f);return s(a,f),a}function s(E,f){return E.name=f?`${f} (FileSystemError)`:"FileSystemError",E}var g;(function(E){E.FileNotFound=v.declare(p.FileNotFound,(f,a)=>`${a?a+" ":""} '${f}' is not found.`),E.FileExists=v.declare(p.FileExists,(f,a)=>`${a?a+" ":""}'${f}' already exists.`),E.FileNotADirectory=v.declare(p.FileNotADirectory,(f,a)=>`${a?a+" ":""}'${f}' is not a directory.`),E.FileIsADirectory=v.declare(p.FileIsADirectory,(f,a)=>`${a?a+" ":""}'${f}' is a directory.`),E.FileIsOutOfSync=v.declare(p.FileIsOutOfSync,(f,a)=>`${a?a+" ":""}'${f}' is out of sync.`),E.FileExceedsMemoryLimit=v.declare(p.FileExceedsMemoryLimit,(f,a)=>`${a?a+" ":""}'${f}' is exceeds memory limit.`),E.FileTooLarge=v.declare(p.FileTooLarge,(f,a)=>`${a?a+" ":""}'${f}' is too large.`),E.FileWriteLocked=v.declare(p.FileWriteLocked,(f,a)=>`${a?a+" ":""}'${f}' is locked.`),E.FileIsNoPermissions=v.declare(p.NoPermissions,(f,a)=>`${a?a+" ":""}'${f}' is no permissions.`),E.Unavailable=v.declare(p.Unavailable,(f,a)=>`${a?a+" ":""}'${f}' is unavailable.`),E.Unknown=v.declare(p.Unknown,(f,a)=>`${a?a+" ":""}'${f}' is unkonw.`)})(g||(t.FileSystemError=g={}));function l(E,f){return(0,r.hasProperty)(E,f)&&(0,r.isFunction)(E[f])}function h(E){return E!==void 0}function u(E){return E.code!==void 0&&E.errno!==void 0}function d(E){var f,a,b,y,A;if(u(E))switch(E.code){case"EEXIST":throw g.FileExists(r.Uri.file((f=E.path)!==null&&f!==void 0?f:""));case"EPERM":case"EACCESS":throw g.FileIsNoPermissions(r.Uri.file((a=E.path)!==null&&a!==void 0?a:""));case"ENOENT":throw g.FileNotFound(r.Uri.file((b=E.path)!==null&&b!==void 0?b:""));case"ENOTDIR":throw g.FileNotADirectory(r.Uri.file((y=E.path)!==null&&y!==void 0?y:""));case"EISDIR":throw g.FileIsADirectory(r.Uri.file((A=E.path)!==null&&A!==void 0?A:""))}throw E}},42933:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(79929),t),n.__exportStar(e(49818),t),n.__exportStar(e(28217),t),n.__exportStar(e(91813),t),n.__exportStar(e(50295),t)},70671:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiskFileServiceProtocol=void 0;const n=e(26387),r=e(52890),o=e(50295);t.DiskFileServiceProtocol={name:o.DiskFileServicePath,methods:[{method:"readFile",request:[{name:"uri",type:r.UriComponentsProto}],response:{type:n.Type.binary()}}]}},50295:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileExtServicePath=t.FileWatcherServicePath=t.ShadowFileServicePath=t.DiskFileServicePath=t.FileServicePath=void 0,t.FileServicePath="FileService",t.DiskFileServicePath="DiskFileService",t.ShadowFileServicePath="ShadowFileService",t.FileWatcherServicePath="FileWatcherService",t.FileExtServicePath="FileExtServicePath"},28217:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WatcherProcessManagerProxy=t.WatcherServiceProxy=t.WATCHER_INIT_DATA_KEY=t.SUMI_WATCHER_PROCESS_SOCK_KEY=t.INsfw=void 0;const n=e(86058);var r;(function(o){let c;(function(p){p[p.CREATED=0]="CREATED",p[p.DELETED=1]="DELETED",p[p.MODIFIED=2]="MODIFIED",p[p.RENAMED=3]="RENAMED"})(c=o.actions||(o.actions={}))})(r||(t.INsfw=r={})),t.SUMI_WATCHER_PROCESS_SOCK_KEY="sumi-watcher-process-sock",t.WATCHER_INIT_DATA_KEY="sumi-watcher-init-data",t.WatcherServiceProxy=new n.ProxyIdentifier("WatcherHostServiceImpl"),t.WatcherProcessManagerProxy=new n.ProxyIdentifier("WatcherProcessManagerProxy")},14951:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(42933),t)},57942:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeDialogModel=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(26542),m=e(6250),_=e(2812),s=r.__importDefault(e(89200)),g=e(9018);let l=n=class{static createContainer(u,d){return u.createChild([{token:m.IFileDialogTreeService,useValue:d},{token:m.IFileDialogModel,useClass:n}])}static createModel(u,d){return n.createContainer(u,d).get(m.IFileDialogModel)}constructor(){this.selectedDecoration=new c.Decoration(s.default.mod_selected),this.focusedDecoration=new c.Decoration(s.default.mod_focused),this.loadingDecoration=new c.Decoration(s.default.mod_loading),this.cutDecoration=new c.Decoration(s.default.mod_cut),this._selectedFiles=[],this.disposableCollection=new p.DisposableCollection,this.onDidFocusedFileChangeEmitter=new p.Emitter,this.onDidSelectedFileChangeEmitter=new p.Emitter,this.clearFileSelectedDecoration=()=>{this._selectedFiles.forEach(u=>{this.selectedDecoration.removeTarget(u)}),this._selectedFiles=[],this.onDidSelectedFileChangeEmitter.fire([])},this.activeFileDecoration=(u,d=!0)=>{u!==this.treeModel.root&&(this.preContextMenuFocusedFile&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile),this.preContextMenuFocusedFile=null),u&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(E=>{this.selectedDecoration.removeTarget(E)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(u),this.focusedDecoration.addTarget(u),this._focusedFile=u,this._selectedFiles=[u],this.onDidFocusedFileChangeEmitter.fire(u.uri),this.onDidSelectedFileChangeEmitter.fire([u.uri]),d&&this.treeModel.dispatchChange()))},this.selectFileDecoration=(u,d=!0)=>{u!==this.treeModel.root&&(this.preContextMenuFocusedFile&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile),this.preContextMenuFocusedFile=null),u&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(E=>{this.selectedDecoration.removeTarget(E)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(u),this._selectedFiles=[u],this.onDidSelectedFileChangeEmitter.fire([u.uri]),d&&this.treeModel.dispatchChange()))},this.activeFileFocusedDecoration=(u,d=!1)=>{u!==this.treeModel.root&&(this.focusedFile!==u&&(d?(this.preContextMenuFocusedFile?(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile)):this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.preContextMenuFocusedFile=u):this.focusedFile&&(this.preContextMenuFocusedFile=null,this.focusedDecoration.removeTarget(this.focusedFile)),u&&(this.selectedDecoration.addTarget(u),this.focusedDecoration.addTarget(u),this._focusedFile=u,this._selectedFiles.push(u),this.onDidFocusedFileChangeEmitter.fire(u.uri),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(E=>E.uri)))),this.treeModel.dispatchChange())},this.activeFileSelectedDecoration=u=>{this._selectedFiles.indexOf(u)>-1||(this._selectedFiles.push(u),this.selectedDecoration.addTarget(u),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(d=>d.uri)),this.treeModel.dispatchChange())},this.activeFileDecorationByRange=(u,d)=>{for(this.clearFileSelectedDecoration(),this.preContextMenuFocusedFile=null;u<=d;u++){const E=this.treeModel.root.getTreeNodeAtIndex(u);E&&(this._selectedFiles.push(E),this.selectedDecoration.addTarget(E))}this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(E=>E.uri)),this.treeModel.dispatchChange()},this.enactiveFileDecoration=()=>{this.focusedFile&&(this.focusedDecoration.removeTarget(this.focusedFile),this.onDidFocusedFileChangeEmitter.fire(),this.treeModel.dispatchChange()),this._focusedFile=void 0},this.toggleDirectory=async u=>{u.expanded?this.fileTreeHandle.collapseNode(u):this.fileTreeHandle.expandNode(u)},this.handleTreeBlur=()=>{this.enactiveFileDecoration()},this.handleTreeFocus=()=>{},this.handleItemRangeClick=(u,d)=>{if(!this.focusedFile)this.handleItemClick(u,d);else if(this.focusedFile&&this.focusedFile!==u){const E=this.treeModel.root.getIndexAtTreeNode(u),f=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);f>E?this.activeFileDecorationByRange(E,f):f<E&&this.activeFileDecorationByRange(f,E)}},this.handleItemToggleClick=(u,d)=>{d!==c.TreeNodeType.CompositeTreeNode&&d!==c.TreeNodeType.TreeNode||(this.selectedFiles.indexOf(u)>-1?this.focusedFile===u?this.enactiveFileDecoration():this.activeFileFocusedDecoration(u):this.activeFileSelectedDecoration(u))},this.handleItemClick=(u,d)=>{this.clickTimes++,(d===c.TreeNodeType.CompositeTreeNode||d===c.TreeNodeType.TreeNode)&&this.activeFileDecoration(u),d===c.TreeNodeType.CompositeTreeNode&&this.corePreferences["workbench.list.openMode"]==="singleClick"&&this.toggleDirectory(u),this.clickTimer&&clearTimeout(this.clickTimer),this.clickTimer=setTimeout(()=>{this.clickTimes>1&&d!==c.TreeNodeType.TreeNode&&this.corePreferences["workbench.list.openMode"]==="doubleClick"&&this.toggleDirectory(u),this.clickTimes=0},200)},this.getDirectoryList=()=>this.fileTreeDialogService.getDirectoryList(),this._whenReady=this.initTreeModel()}get onDidFocusedFileChange(){return this.onDidFocusedFileChangeEmitter.event}get onDidSelectedFileChange(){return this.onDidSelectedFileChangeEmitter.event}get fileTreeHandle(){return this._fileTreeHandle}get decorations(){return this._decorations}get treeModel(){return this._treeModel}get whenReady(){return this._whenReady}get focusedFile(){return this._focusedFile}get selectedFiles(){return this._selectedFiles}async initTreeModel(){const u=(await this.fileTreeDialogService.resolveChildren())[0];this._treeModel=this.injector.get(_.FileTreeModel,[u]),this.initDecorations(u),this.disposableCollection.push(this._decorations),this.disposableCollection.push(this.labelService.onDidChange(()=>{this.treeModel.dispatchChange()})),this.disposableCollection.push(this.treeModel.root.watcher.on(c.TreeNodeEvent.WillResolveChildren,d=>{this.loadingDecoration.addTarget(d)})),this.disposableCollection.push(this.treeModel.root.watcher.on(c.TreeNodeEvent.DidResolveChildren,d=>{this.loadingDecoration.removeTarget(d)}))}async updateTreeModel(u){const d=await this.fileTreeDialogService.resolveRoot(u);if(d&&d.length>0){const E=d[0];this._treeModel=this.injector.get(_.FileTreeModel,[E]),this.clearFileSelectedDecoration(),this.initDecorations(E)}}initDecorations(u){this._decorations&&this._decorations.dispose(),this._decorations=new c.DecorationsManager(u),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.cutDecoration),this._decorations.addDecoration(this.loadingDecoration)}handleTreeHandler(u){this._fileTreeHandle=u}dispose(){this.disposableCollection.dispose()}};t.FileTreeDialogModel=l,l.FILE_TREE_SNAPSHOT_KEY="FILE_TREE_SNAPSHOT",l.DEFAULT_LOCATION_FLUSH_DELAY=500,r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],l.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(m.IFileDialogTreeService),r.__metadata("design:type",g.FileTreeDialogService)],l.prototype,"fileTreeDialogService",void 0),r.__decorate([(0,o.Autowired)(v.LabelService),r.__metadata("design:type",v.LabelService)],l.prototype,"labelService",void 0),r.__decorate([(0,o.Autowired)(p.CorePreferences),r.__metadata("design:type",Object)],l.prototype,"corePreferences",void 0),t.FileTreeDialogModel=l=n=r.__decorate([(0,o.Injectable)(),r.__metadata("design:paramtypes",[])],l)},69748:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FILE_TREE_BADGE_LIMIT=t.FILE_TREE_NODE_HEIGHT=t.FileTreeDialogNode=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=e(97267),p=e(41869),v=e(69959),m=n.__importDefault(e(89200)),_=({item:s,onClick:g,itemType:l,labelService:h,leftPadding:u=8,onTwistierClick:d,decorations:E,defaultLeftPadding:f=8,template:a})=>{const b=l===c.TreeNodeType.RenamePrompt,y=l===c.TreeNodeType.NewPrompt,A=b||y,S=(0,p.useDesignStyles)(m.default.expansion_toggle,"expansion_toggle"),w=(0,p.useDesignStyles)(m.default.file_tree_node,"file_tree_node"),T=W=>{(l===c.TreeNodeType.TreeNode||l===c.TreeNodeType.CompositeTreeNode)&&g(W,s,l)},D=W=>{(l===c.TreeNodeType.TreeNode||l===c.TreeNodeType.CompositeTreeNode)&&(d?d(W,s,l):g(W,s,l))},I=l===c.TreeNodeType.CompositeTreeNode;let O;A?y?O=`${f+(s.parent.depth+1||0)*(u||0)}px`:O=`${f+(s.target.depth||0)*(u||0)}px`:O=I?`${f+(s.depth||0)*(u||0)}px`:`${f+(s.depth||0)*(u||0)+8}px`;const M={height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`,paddingLeft:O},R=(W,U)=>{if(E&&E?.classlist.indexOf(m.default.mod_loading)>-1)return o.default.createElement(c.Loading,null);if(A&&W instanceof c.PromptHandle){let Q=!1;if(b?Q=W.target.type===c.TreeNodeType.CompositeTreeNode:Q=W.type===c.TreeNodeType.CompositeTreeNode,Q)return o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,S,(0,p.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:y||!(b&&W.target.type===c.TreeNodeType.CompositeTreeNode&&W.target.expanded)})})}else return o.default.createElement("div",{onClick:U,className:(0,r.default)(m.default.file_tree_node_segment,S,(0,p.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:!W.expanded})})},P=W=>{let U,Q;A&&W instanceof c.PromptHandle?W instanceof c.RenamePromptHandle?(U=W.target.uri.resolve(W.$.value),Q=v.Directory.is(W.target)):(U=W.parent.uri.resolve(W.$.value),Q=W.type===c.TreeNodeType.CompositeTreeNode):(U=W.uri,Q=W.filestat.isDirectory);const V=h.getIcon(U,{isDirectory:Q});return o.default.createElement("div",{className:(0,r.default)(m.default.file_icon,V,{expanded:Q&&W.expanded}),style:{height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`}})},k=W=>a?o.default.createElement(a,null):A&&W instanceof c.PromptHandle?o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_inputbox)},o.default.createElement("div",{className:(0,r.default)("input-box",m.default.file_tree_node_prompt_box)},o.default.createElement(W.ProxiedInput,{wrapperStyle:{height:t.FILE_TREE_NODE_HEIGHT,padding:"0 5px"}}))):o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_displayname)},W.name),F=()=>o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_tail)},L()),L=()=>null,B=W=>{if(I)return R(W,D);if(A)return R(W,()=>{})},j=()=>s.tooltip||s.name;return o.default.createElement("div",{key:s.id,onClick:T,title:j(),className:(0,r.default)(w,E?E.classlist:null),style:M,draggable:l===c.TreeNodeType.TreeNode||l===c.TreeNodeType.CompositeTreeNode},o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_content)},B(s),P(s),o.default.createElement("div",{className:A?m.default.file_tree_node_prompt_wrap:m.default.file_tree_node_overflow_wrap},k(s)),F()))};t.FileTreeDialogNode=_,t.FILE_TREE_NODE_HEIGHT=22,t.FILE_TREE_BADGE_LIMIT=99},68195:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileDialogContextKey=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(66e3);let p=class{initScopedContext(m){this._contextKeyService=this.globalContextKeyService.createScoped(m),this.fileDialogViewVisibleContext=c.FileDialogViewVisibleContext.bind(this._contextKeyService)}get service(){return this._contextKeyService}};t.FileDialogContextKey=p,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],p.prototype,"globalContextKeyService",void 0),t.FileDialogContextKey=p=n.__decorate([(0,r.Injectable)()],p)},9018:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeDialogService=void 0;const n=e(85608),r=e(76003),o=e(97267),c=e(41869),p=e(26542),v=e(54414),m=e(14951),_=e(72665),s=e(51500),g=e(6250),l=e(57781),h=e(97738),u=e(68195);let d=class extends o.Tree{constructor(f){super(),this._whenReady=this.resolveWorkspaceRoot(f)}get whenReady(){return this._whenReady}async resolveWorkspaceRoot(f){if(f){const a=new c.URI(f).withScheme(c.Schemes.file),b=await this.fileTreeAPI.resolveFileStat(a);b&&(this.workspaceRoot=b)}}async resolveChildren(f){if(f){if(f.uri){const{children:a}=await this.fileTreeAPI.resolveChildren(this,f.uri.toString(),f);return a}}else{this.workspaceRoot||(this.workspaceRoot=(await this.workspaceService.roots)[0]);const{children:a}=await this.fileTreeAPI.resolveChildren(this,this.workspaceRoot);return this.root=a[0],a}return[]}async resolveRoot(f){let a;/^file:\/\//.test(f)&&(a=new c.URI(f)),a=c.URI.file(f);const b=await this.fileTreeAPI.resolveFileStat(a);if(b){const{children:y}=await this.fileTreeAPI.resolveChildren(this,b);return this.root=y[0],y}}getDirectoryList(){const f=[];if(!this.root)return f;let a=new c.URI(this.workspaceRoot.uri);if(a&&a.parent)for(;a.parent;){const b=a.codeUri.fsPath;if(f.indexOf(b)>=0)break;f.push(b),a=a.parent}else f.push(a.codeUri.fsPath.toString());return f}sortComparator(f,a){return f.constructor===a.constructor?f.name.startsWith(".")&&!a.name.startsWith(".")?1:!f.name.startsWith(".")&&a.name.startsWith(".")?-1:f.name.localeCompare(a.name,"kn",{numeric:!0}):f.type===o.TreeNodeType.CompositeTreeNode?-1:a.type===o.TreeNodeType.CompositeTreeNode?1:0}initContextKey(f){f&&this.fileDialogContextKey.initScopedContext(f)}get contextKey(){return this.fileDialogContextKey}async saveAs(f){const{oldFilePath:a,newFilePath:b}=f;if(!a||!b)throw new Error("oldFilePath and newFilePath are required");await this.createFile(f);try{const y=c.URI.file(f.newFilePath),A={preview:!1,focus:!0,replace:!0,forceClose:!0,disableNavigate:!1};await this.workbenchEditorService.open(y,A),await this.fileTreeModelService.clearFileSelectedDecoration();const S=this.fileTreeService.getNodeByPathOrUri(y);S&&await this.fileTreeModelService.activeFileDecoration(S)}catch(y){throw new Error(`Failed to open saveAs file: ${y.message}`)}}async createFile(f){try{const{oldFilePath:a,newFilePath:b}=f;if(!await this.fileServiceClient.getFileStat(a))throw new Error(`Source file not found: ${a}`);const{content:A}=await this.fileServiceClient.readFile(a);await this.fileServiceClient.createFile(b,{content:A.toString(),encoding:"utf8",overwrite:!0})}catch(a){throw new Error(`Failed to create file: ${a.message}`)}}renderCustomMsg(){return null}async getDefaultFilePath(f,a){return a}dispose(){super.dispose()}};t.FileTreeDialogService=d,n.__decorate([(0,r.Autowired)(g.IFileTreeAPI),n.__metadata("design:type",Object)],d.prototype,"fileTreeAPI",void 0),n.__decorate([(0,r.Autowired)(s.IWorkspaceService),n.__metadata("design:type",Object)],d.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(p.LabelService),n.__metadata("design:type",p.LabelService)],d.prototype,"labelService",void 0),n.__decorate([(0,r.Autowired)(u.FileDialogContextKey),n.__metadata("design:type",u.FileDialogContextKey)],d.prototype,"fileDialogContextKey",void 0),n.__decorate([(0,r.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],d.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(v.WorkbenchEditorService),n.__metadata("design:type",v.WorkbenchEditorService)],d.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(_.IDialogService),n.__metadata("design:type",Object)],d.prototype,"dialogService",void 0),n.__decorate([(0,r.Autowired)(h.FileTreeModelService),n.__metadata("design:type",h.FileTreeModelService)],d.prototype,"fileTreeModelService",void 0),n.__decorate([(0,r.Autowired)(g.IFileTreeService),n.__metadata("design:type",l.FileTreeService)],d.prototype,"fileTreeService",void 0),t.FileTreeDialogService=d=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[String])],d)},51888:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileDialog=t.FILE_TREE_DIALOG_HEIGHT=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),c=e(41869),p=e(68974),v=e(72665),m=e(69748),_=n.__importDefault(e(13294));t.FILE_TREE_DIALOG_HEIGHT=22;const s=({options:g,model:l,isOpenDialog:h,fileService:u})=>{const d=(0,c.useInjectable)(v.IDialogService),E=(0,r.useRef)(null),[f,a]=(0,r.useState)(g.defaultFileName||""),[b,y]=(0,r.useState)(!1),[A,S]=(0,r.useState)(""),[w,T]=(0,r.useState)([]),D=(0,r.useRef)(g.defaultFileName||"");(0,r.useEffect)(()=>{var ie;return l&&(y(!1),R(),(ie=u.contextKey.fileDialogViewVisibleContext)===null||ie===void 0||ie.set(!0)),()=>{l.dispose()}},[l]),(0,r.useEffect)(()=>{g.defaultFileName&&(a(g.defaultFileName||""),D.current=g.defaultFileName||"")},[g]),(0,r.useEffect)(()=>{if(b){const ie=l.getDirectoryList();T(ie)}},[b]);const I=(0,r.useCallback)(()=>{const ie=l.selectedFiles.map(oe=>oe.uri.path.toString());if(D.current&&g.showNameInput&&(ie?.length===1||g.defaultUri)){const oe=ie?.length===1?ie[0]:g.defaultUri.path.toString();g?.saveAs&&u.saveAs({oldFilePath:c.path.join(oe,g?.defaultFileName||""),newFilePath:c.path.join(oe,D.current)}),d.hide([c.path.join(oe,D.current)])}else ie.length>0?d.hide(ie):A?d.hide([A]):g.defaultUri?d.hide([g.defaultUri.path.toString()]):l.treeModel&&l.treeModel.root?d.hide([l.treeModel.root.uri.path.toString()]):d.hide([]);y(!1),u.contextKey.fileDialogViewVisibleContext.set(!1)},[b,d,l,g,A]),O=async ie=>{let oe=ie.treeModel.root.uri.codeUri.fsPath;return u.getDefaultFilePath&&(oe=await u.getDefaultFilePath(ie,oe)),oe},M=(0,r.useCallback)(()=>{y(!1),d.hide(),u.contextKey.fileDialogViewVisibleContext.set(!1)},[b,d]),R=(0,r.useCallback)(async()=>{await l.whenReady,await l.treeModel.ensureReady;const ie=await O(l);S(ie),y(!0)},[l,A,b]),P=!h,k=(0,r.useCallback)(ie=>{l.handleTreeHandler({...ie,getModel:()=>l.treeModel})},[l]),F=(0,r.useCallback)((ie,oe)=>{ie.stopPropagation();const{toggleDirectory:le}=l;le(oe)},[l]),L=(0,r.useCallback)(ie=>B(ie)?!1:ie.shiftKey,[]),B=(0,r.useCallback)(ie=>{const{metaKey:oe,ctrlKey:le}=ie;return c.isMacintosh&&oe||le},[]),j=(0,r.useCallback)((ie,oe,le)=>{var pe;ie.stopPropagation();const{handleItemClick:q,handleItemToggleClick:Ee,handleItemRangeClick:_e}=l;if(!oe)return;const te=L(event),ge=B(event);if(te&&!P&&g.canSelectMany)_e(oe,le);else if(ge&&!P&&g.canSelectMany)Ee(oe,le);else if(P)le===o.TreeNodeType.CompositeTreeNode&&q(oe,le);else if(g.canSelectFiles&&le===o.TreeNodeType.TreeNode){const Te=new Set(Object.values((pe=g.filters)!==null&&pe!==void 0?pe:{}).flat().map(Pe=>`.${Pe}`));if(Te.size>0){const Pe=c.URI.parse(oe.filestat.uri).path.ext;Te.has(Pe)&&q(oe,le)}else q(oe,le)}else g.canSelectFolders&&le===o.TreeNodeType.CompositeTreeNode&&q(oe,le)},[l,P,g]),W=(0,r.useCallback)(async ie=>{y(!1),S(ie),await l.updateTreeModel(ie),y(!0)},[l,b,A]),U=(0,r.useCallback)(async ie=>{y(!1),S(ie),await l.updateTreeModel(ie),y(!0)},[l,b,A,w]),Q=(0,r.useCallback)(()=>u.renderCustomMsg?u.renderCustomMsg():null,[u.renderCustomMsg]),V=(0,r.useCallback)(ie=>r.default.createElement(m.FileTreeDialogNode,{item:ie.item,itemType:ie.itemType,labelService:l.labelService,decorations:l.decorations.getDecorations(ie.item),onClick:j,onTwistierClick:F,defaultLeftPadding:8,leftPadding:8}),[l.treeModel]),$=(0,r.useCallback)(()=>{if(b){if(l.treeModel)return r.default.createElement(o.RecycleTree,{height:300,itemHeight:t.FILE_TREE_DIALOG_HEIGHT,onReady:k,model:l.treeModel},V)}else return r.default.createElement(p.Progress,{loading:!0})},[b,l]),Y=(0,r.useMemo)(()=>u.showFilePathSearch!==!1,[u.showFilePathSearch]),z=(0,r.useCallback)(()=>{if(w.length>0)return r.default.createElement(o.Select,{onChange:W,onSearchChange:U,className:_.default.select_control,size:"large",searchPlaceholder:A,value:A,showSearch:Y},w.map((ie,oe)=>r.default.createElement(o.Option,{value:ie,key:`${oe} - ${ie}`},ie)))},[w,A]),H=(0,r.useCallback)(ie=>{const{key:oe}=c.KeyCode.createKeyCode(ie),le=ie.shiftKey||ie.metaKey||ie.altKey||ie.ctrlKey;oe&&c.Key.ENTER.keyCode===oe.keyCode&&!le&&I()},[I]);(0,r.useEffect)(()=>{var ie;return E.current&&(u.initContextKey(E.current),u.contextKey.fileDialogViewVisibleContext.set(!0),(ie=E.current)===null||ie===void 0||ie.addEventListener("keyup",H)),()=>{var oe;(oe=E.current)===null||oe===void 0||oe.removeEventListener("keyup",H)}},[]);const K=(0,r.useMemo)(()=>r.default.createElement(r.default.Fragment,null,Q(),r.default.createElement("div",{className:_.default.file_dialog_directory},z()),r.default.createElement("div",{className:_.default.file_dialog_content},$())),[z,$]),Z=(0,r.useMemo)(()=>r.default.createElement("div",{className:_.default.file_dialog_buttons},r.default.createElement(o.Button,{onClick:M,type:"ghost",className:_.default.button},(0,c.localize)("dialog.file.close")),r.default.createElement(o.Button,{onClick:I,type:"primary",className:_.default.button,disabled:P&&g.showNameInput&&f.length===0},h&&g.openLabel||(0,c.localize)("dialog.file.ok"))),[M,I,P,h,f,g]),X=(0,r.useCallback)(ie=>{a(ie.target.value),D.current=ie.target.value},[f]);return r.default.createElement("div",{className:_.default.file_dialog_wrapper,ref:E},r.default.createElement("div",{className:_.default.file_dialog_directory_title},h?g.title||(0,c.localize)("dialog.file.openLabel"):g.saveLabel||(0,c.localize)("dialog.file.saveLabel")),K,!h&&g.showNameInput&&r.default.createElement("div",{className:_.default.file_dialog_file_container},r.default.createElement("span",{className:_.default.file_dialog_file_name},(0,c.localize)("dialog.file.name"),": "),r.default.createElement(o.Input,{size:"small",value:f,autoFocus:!0,selection:{start:0,end:f.indexOf(".")||f.length},onChange:X})),Z)};t.FileDialog=s},89508:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowDialogServiceImpl=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(76003),c=e(41869),p=e(37406),v=e(14951),m=e(72665),_=e(57942),s=n.__importDefault(e(13294)),g=e(9018),l=e(51888);let h=class{constructor(){this.idx=1,this._whenReady=this.init()}async init(){this.recentGlobalStorage=await this.storageProvider(c.STORAGE_NAMESPACE.GLOBAL_RECENT_DATA);const d=await this.recentGlobalStorage.get("RECENT_DIALOG_DEFAULT_URI");if(d)this._defaultUri=new c.URI(d);else{const E=await this.fileServiceClient.getCurrentUserHome();this._defaultUri=new c.URI(E.uri)}}get defaultUri(){return this._defaultUri}get whenReady(){return this._whenReady}async updateRecentDefaultUri(d){this.recentGlobalStorage.set("RECENT_DIALOG_DEFAULT_URI",d.toString()),this._defaultUri=d}async showOpenDialog(d={}){this.dialogService.reset(),await this.whenReady;const E={canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1};if(this.appConfig.isElectronRenderer&&!this.appConfig.isRemote){const f=this.injector.get(p.IElectronMainUIService),a=[];d.canSelectFiles&&a.push("openFile"),d.canSelectFolders&&a.push("openDirectory"),d.canSelectMany&&a.push("multiSelections"),c.isMacintosh&&a.push("treatPackageAsDirectory","createDirectory");const b=d.defaultUri||this.defaultUri,y=await f.showOpenDialog(c.electronEnv.currentWindowId,{defaultPath:b.codeUri.fsPath,title:d.title,buttonLabel:d.openLabel,properties:a});if(y&&y.length>0){const A=y.map(S=>c.URI.file(S));return this.updateRecentDefaultUri(A[0].parent),A}else return}else{d.defaultUri||(d.defaultUri=this.defaultUri);let f;d.defaultUri?f=this.injector.get(g.FileTreeDialogService,[d.defaultUri.toString()]):f=this.injector.get(g.FileTreeDialogService),await f.whenReady;const a=_.FileTreeDialogModel.createModel(this.injector,f),b=await this.dialogService.open({message:r.default.createElement(l.FileDialog,{key:this.idx++,fileService:f,model:a,options:{...E,...d},isOpenDialog:!0}),type:c.MessageType.Empty,buttons:[],closable:!0,props:{className:s.default.file_dialog_wrapper}});if(this.dialogService.reset(),b&&b.length>0){const y=b.map(A=>c.URI.file(A));return this.updateRecentDefaultUri(y[0].parent),y}else return}}async showSaveDialog(d={}){if(await this.whenReady,this.appConfig.isElectronRenderer&&!this.appConfig.isRemote){const E=d.defaultUri||this.defaultUri,a=await this.injector.get(p.IElectronMainUIService).showSaveDialog(c.electronEnv.currentWindowId,{defaultPath:E.resolve(d.defaultFileName||"").codeUri.fsPath,title:d.saveLabel,message:d.saveLabel});if(a){const b=c.URI.file(a);return this.updateRecentDefaultUri(b.parent),b}else return}else{d.defaultUri||(d.defaultUri=this.defaultUri);let E;d.defaultUri?E=this.injector.get(g.FileTreeDialogService,[d.defaultUri.toString()]):E=this.injector.get(g.FileTreeDialogService),await E.whenReady;const f=_.FileTreeDialogModel.createModel(this.injector,E),a=await this.dialogService.open({message:r.default.createElement(l.FileDialog,{key:this.idx++,fileService:E,model:f,options:d,isOpenDialog:!1}),type:c.MessageType.Empty,buttons:[],closable:!0,props:{className:s.default.file_dialog_wrapper}});if(this.dialogService.reset(),a&&a.length>0){const b=c.URI.file(a[0]);return this.updateRecentDefaultUri(b.parent),b}else return}}};t.WindowDialogServiceImpl=h,n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],h.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(m.IDialogService),n.__metadata("design:type",Object)],h.prototype,"dialogService",void 0),n.__decorate([(0,o.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],h.prototype,"fileServiceClient",void 0),n.__decorate([(0,o.Autowired)(c.StorageProvider),n.__metadata("design:type",Function)],h.prototype,"storageProvider",void 0),n.__decorate([(0,o.Autowired)(c.AppConfig),n.__metadata("design:type",Object)],h.prototype,"appConfig",void 0),t.WindowDialogServiceImpl=h=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],h)},88014:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileContextKey=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(16413);let p=class{constructor(){this.explorerResourceIsFolder=c.ExplorerResourceIsFolderContext.bind(this.globalContextKeyService),this.explorerViewletVisibleContext=c.ExplorerViewletVisibleContext.bind(this.globalContextKeyService)}initScopedContext(m){this._contextKeyService=this.globalContextKeyService.createScoped(m),this.explorerFocused=c.ExplorerFocusedContext.bind(this._contextKeyService),this.explorerResourceCut=c.ExplorerResourceCut.bind(this._contextKeyService),this.filesExplorerFocused=c.FilesExplorerFocusedContext.bind(this._contextKeyService),this.filesExplorerInputFocused=c.FilesExplorerInputFocusedContext.bind(this._contextKeyService),this.filesExplorerFilteredContext=c.FilesExplorerFilteredContext.bind(this._contextKeyService),this.explorerCompressedFocusContext=c.ExplorerCompressedFocusContext.bind(this._contextKeyService),this.explorerCompressedFirstFocusContext=c.ExplorerCompressedFirstFocusContext.bind(this._contextKeyService),this.explorerCompressedLastFocusContext=c.ExplorerCompressedLastFocusContext.bind(this._contextKeyService)}get service(){return this._contextKeyService}};t.FileContextKey=p,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],p.prototype,"globalContextKeyService",void 0),t.FileContextKey=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},40439:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(16413),p=e(93899),v=e(68969),m=e(98295),_=e(41893),s=e(54414),g=e(32595),l=e(63067),h=e(58296),u=e(72665),d=e(55121),E=e(51500),f=e(6250),a=e(69959),b=e(56384),y=e(57781),A=e(97738),S=e(4446);let w=class{constructor(){this._disposables=new o.DisposableStore,this.isRendered=!1,this.deleteThrottler=new o.Throttler,this.willDeleteUris=[]}initialize(){this.workspaceService.initFileServiceExclude().then(async()=>{await this.fileTreeService.init(),this.fileTreeModelService.initTreeModel()}),this.progressService.registerProgressIndicator(g.EXPLORER_CONTAINER_ID)}async onStart(){this.viewsRegistry.registerViewWelcomeContent(f.RESOURCE_VIEW_ID,{content:(0,o.formatLocalize)("welcome-view.noFolderHelp",o.FILE_COMMANDS.OPEN_FOLDER.id),group:h.ViewContentGroups.Open,order:1}),this.mainLayoutService.collectViewComponent({id:f.RESOURCE_VIEW_ID,name:this.getWorkspaceTitle(),weight:3,priority:9,collapsed:!1,component:b.FileTree},g.EXPLORER_CONTAINER_ID),this._disposables.add(this.workspaceService.onWorkspaceLocationChanged(()=>{const D=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);D&&D.updateViewTitle(f.RESOURCE_VIEW_ID,this.getWorkspaceTitle())}))}onDidStart(){const D=this.injector.get(S.SymlinkDecorationsProvider,[this.fileTreeService]);this.decorationService.registerDecorationsProvider(D)}onDidRender(){this.isRendered=!0;const D=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);D&&(this.fileTreeModelService.whenReady.then(()=>{this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(D.isActivated())}),D.onActivate(()=>{this.fileTreeModelService.performLocationOnHandleShow(),this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(!0)}),D.onInActivate(()=>{this.fileTreeModelService.handleTreeBlur(),this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(!1)}))}getWorkspaceTitle(){let D=(0,o.localize)("file.empty.defaultTitle");const I=this.workspaceService.workspace;return I&&(D=new o.URI(I.uri).displayName,!I.isDirectory&&D.endsWith(`.${this.workspaceService.workspaceSuffixName}`)&&(D=D.slice(0,D.lastIndexOf(".")),D===E.UNTITLED_WORKSPACE))?(0,o.localize)("file.workspace.defaultTip"):D}onReconnect(){this.fileTreeService.reWatch()}revealFile(D){if(D)if(this.isRendered){const I=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);!I||!I.isVisible||I.isCollapsed(f.RESOURCE_VIEW_ID)?this.fileTreeModelService.locationOnShow(D):this.fileTreeModelService.location(D)}else this.fileTreeModelService.locationOnShow(D)}registerMenus(D){D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.NEW_FILE.id,label:(0,o.localize)("file.new")},order:1,group:"0_new"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.NEW_FOLDER.id,label:(0,o.localize)("file.folder.new")},order:2,group:"0_new"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,label:(0,o.localize)("workspace.addFolderToWorkspace")},order:1,group:"0_workspace",when:"config.workspace.supportMultiRootWorkspace"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.WORKSPACE_COMMANDS.REMOVE_WORKSPACE_FOLDER.id,label:(0,o.localize)("workspace.removeFolderFromWorkspace")},order:1,group:"0_workspace",when:"config.workspace.supportMultiRootWorkspace"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_RESOURCES.id,label:(0,o.localize)("file.open")},order:1,group:"1_open"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TO_THE_SIDE.id,label:(0,o.localize)("file.open.side")},order:2,group:"1_open"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TYPE_WITH.id,label:(0,o.localize)("file.open.type")},order:3,group:"1_open"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TERMINAL_WITH_PATH.id,label:(0,o.localize)("file.filetree.openTerminalWithPath")},when:"workbench.panel.terminal",order:4,group:"1_open"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.SEARCH_ON_FOLDER.id,label:(0,o.localize)("file.search.folder")},order:1,group:"2_search"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.DELETE_FILE.id,label:(0,o.localize)("file.delete")},order:1,group:"7_modification"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.RENAME_FILE.id,label:(0,o.localize)("file.rename")},order:3,group:"7_modification"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COMPARE_SELECTED.id,label:(0,o.localize)("file.compare")},order:2,group:"3_compare"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_FILE.id,label:(0,o.localize)("file.copy.file")},order:1,group:"5_cutcopypaste"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.CUT_FILE.id,label:(0,o.localize)("file.cut.file")},order:2,group:"5_cutcopypaste"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.PASTE_FILE.id,label:(0,o.localize)("file.paste.file")},order:3,group:"5_cutcopypaste"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_PATH.id,label:(0,o.localize)("file.copy.path")},group:"6_copypath"}),D.registerMenuItem(p.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_RELATIVE_PATH.id,label:(0,o.localize)("file.copy.relativepath")},group:"6_copypath"})}registerCommands(D){const I=()=>{this.fileTreeService.filterMode&&this.fileTreeService.toggleFilterMode()};D.registerCommand(o.FILE_COMMANDS.OPEN_TERMINAL_WITH_PATH,{execute:M=>{let R=M;if(!R)return;const P=this.fileTreeService.getNodeByPathOrUri(R);P&&!P.filestat.isDirectory&&(R=P.uri.parent),this.commandService.executeCommand(o.TERMINAL_COMMANDS.OPEN_WITH_PATH.id,R)}}),D.registerCommand(o.FILE_COMMANDS.SEARCH_ON_FOLDER,{execute:async M=>{var R;let P=M;if(P||(this.fileTreeModelService.focusedFile?P=this.fileTreeModelService.focusedFile.uri:this.fileTreeModelService.selectedFiles.length>0&&(P=(R=this.fileTreeModelService.selectedFiles[0])===null||R===void 0?void 0:R.uri)),!P)return;let k;if(this.fileTreeService.isMultipleWorkspace)for(const F of await this.workspaceService.roots){const L=new o.URI(F.uri);if(L.isEqualOrParent(P)){k=`./${L.relative(P).toString()}`;break}}else if(this.workspaceService.workspace){const F=new o.URI(this.workspaceService.workspace.uri);F.isEqualOrParent(P)&&(k=`./${F.relative(P).toString()}`)}this.commandService.executeCommand(o.SEARCH_COMMANDS.OPEN_SEARCH.id,{includeValue:k+"/"})},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&a.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.LOCATION,{execute:M=>{M?this.revealFile(M):this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0&&this.revealFile(this.fileTreeModelService.selectedFiles[0].uri)}}),D.registerCommand(o.FILE_COMMANDS.LOCATION_WITH_EDITOR,{execute:()=>{var M,R,P;((R=(M=this.workbenchEditorService.currentEditor)===null||M===void 0?void 0:M.currentUri)===null||R===void 0?void 0:R.scheme)===o.Schemes.file&&this.revealFile((P=this.workbenchEditorService.currentEditor)===null||P===void 0?void 0:P.currentUri)}}),D.registerCommand(o.FILE_COMMANDS.COLLAPSE_ALL,{execute:()=>{const M=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);!M||!M.isVisible||this.fileTreeModelService.collapseAll()}}),D.registerCommand(o.FILE_COMMANDS.REFRESH_ALL,{execute:async()=>{const M=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);!M||!M.isVisible||await this.fileTreeService.refresh()}}),D.registerCommand(o.FILE_COMMANDS.DELETE_FILE,{execute:(M,R)=>{if(I(),R?this.willDeleteUris=this.willDeleteUris.concat(R):this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0?this.willDeleteUris=this.willDeleteUris.concat(this.fileTreeModelService.selectedFiles.map(P=>P.uri)):this.fileTreeModelService.focusedFile&&this.willDeleteUris.push(this.fileTreeModelService.focusedFile.uri),this.willDeleteUris.length!==0)return this.deleteThrottler.queue(this.doDelete.bind(this))},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.RENAME_FILE,{execute:M=>{if(I(),!M)if(this.fileTreeModelService.contextMenuFile)M=this.fileTreeModelService.contextMenuFile.uri;else if(this.fileTreeModelService.focusedFile)M=this.fileTreeModelService.focusedFile.uri;else return;this.fileTreeModelService.renamePrompt(M)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.NEW_FILE,{execute:async M=>{var R;if(I(),M)this.fileTreeModelService.newFilePrompt(M);else if(this.fileTreeService.isCompactMode&&this.fileTreeModelService.activeUri)this.fileTreeModelService.newFilePrompt(this.fileTreeModelService.activeUri);else if(this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0)this.fileTreeModelService.newFilePrompt(this.fileTreeModelService.selectedFiles[0].uri);else{let P;this.fileTreeService.isMultipleWorkspace?P=new o.URI((await this.workspaceService.roots)[0].uri):P=new o.URI((R=this.workspaceService.workspace)===null||R===void 0?void 0:R.uri),this.fileTreeModelService.newFilePrompt(P)}}}),D.registerCommand(o.FILE_COMMANDS.NEW_FOLDER,{execute:async M=>{var R;if(I(),M)this.fileTreeModelService.newDirectoryPrompt(M);else if(this.fileTreeService.isCompactMode&&this.fileTreeModelService.activeUri)this.fileTreeModelService.newDirectoryPrompt(this.fileTreeModelService.activeUri);else if(this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0)this.fileTreeModelService.newDirectoryPrompt(this.fileTreeModelService.selectedFiles[0].uri);else{let P;this.fileTreeService.isMultipleWorkspace?P=new o.URI((await this.workspaceService.roots)[0].uri):P=new o.URI((R=this.workspaceService.workspace)===null||R===void 0?void 0:R.uri),this.fileTreeModelService.newDirectoryPrompt(P)}}}),D.registerCommand(o.FILE_COMMANDS.COMPARE_SELECTED,{execute:(M,R)=>{if(R&&R.length){const P=this.workbenchEditorService.currentEditor;P&&P.currentUri&&this.fileTreeService.compare(R[0],P.currentUri)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!a.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.OPEN_RESOURCES,{execute:M=>{this.fileTreeService.openAndFixedFile(M)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!a.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.OPEN_TO_THE_SIDE,{execute:M=>{this.fileTreeService.openToTheSide(M)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!a.Directory.is(this.fileTreeModelService.contextMenuFile)});const O=(M,R)=>{const{availableOpenTypes:P,currentOpenType:k}=this.workbenchEditorService.currentEditorGroup;if(!(P&&M&&k))return{items:[],selectIndex:-1};const F=this.preferenceService.get("workbench.editorAssociations"),L=[],B=(Q,V)=>V.type===s.EditorOpenType.code?Q.type===s.EditorOpenType.code:V.type===s.EditorOpenType.component&&Q.type===s.EditorOpenType.component?Q.componentId===V.componentId:!1,j=(Q,V)=>(Q?Q+=(0,o.localize)("file.open.type.detail.and")+V:Q=V,Q);let W,U;if(F){const Q=Object.keys(F).find(V=>(0,o.match)(V,M.path.toString().toLowerCase())||(0,o.match)(V,M.path.base.toLowerCase()));W=Q&&F[Q]}return P.forEach((Q,V)=>{var $;const Y={label:Q.title||Q.componentId||Q.type,detail:Q.title,run:z=>R(z,Q)};B(k,Q)&&(Y.description=j(Y.description,(0,o.localize)("file.open.type.detail.active")),U=V),W&&(!(($=Q.componentId)===null||$===void 0)&&$.endsWith(W))&&(Y.description=j(Y.description,(0,o.localize)("file.open.type.detail.default"))),L.push(new o.QuickOpenItem(Y))}),{items:L,selectIndex:U}};D.registerCommand(o.FILE_COMMANDS.OPEN_TYPE_WITH,{execute:M=>{const R=(L,B)=>{var j,W;return L===o.Mode.OPEN?((j=this.workbenchEditorService.currentEditorGroup)===null||j===void 0||j.changeOpenType((W=B.componentId)!==null&&W!==void 0?W:B.type),!0):!1},{items:P,selectIndex:k}=O(M,R);if(P.length===0||typeof k>"u")return;const F=L=>{this.quickOpenService.open({onType:(B,j)=>j(L)},{fuzzyMatchLabel:!0,ignoreFocusOut:!1,placeholder:(0,o.formatLocalize)("file.open.type.placeholder",M.path.base),selectIndex:()=>k})};P.push(new o.QuickOpenItem({label:(0,o.formatLocalize)("file.open.type.preference.default",`*${M.path.ext}`),showBorder:!0,run:L=>{if(L===o.Mode.OPEN){const B=(U,Q)=>{var V,$,Y;if(U===o.Mode.OPEN){const z="workbench.editorAssociations",H=this.preferenceService.resolve(z).scope,K=this.preferenceService.get(z);return this.preferenceService.set(z,{...K||{},[`*${M.path.ext}`]:(V=Q.componentId)!==null&&V!==void 0?V:Q.type},H),($=this.workbenchEditorService.currentEditorGroup)===null||$===void 0||$.changeOpenType((Y=Q.componentId)!==null&&Y!==void 0?Y:Q.type),!0}return!1},{items:j,selectIndex:W}=O(M,B);if(j.length===0||typeof W>"u")return!0;F(j)}return!1}})),F(P)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!a.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.COPY_PATH,{execute:async M=>{if(!M)return;let P=M.path.toString();if(M.scheme===s.DIFF_SCHEME){const F=M.getParsedQuery();P=new o.URI(F.modified).path.toString()}let k=decodeURIComponent(P);await this.appService.backendOS===o.OperatingSystem.Windows&&(k=k.slice(1)),await this.clipboardService.writeText(k)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile}),D.registerCommand(o.FILE_COMMANDS.COPY_RELATIVE_PATH,{execute:async M=>{if(!M)return;if(M.scheme===s.DIFF_SCHEME){const k=M.getParsedQuery();M=new o.URI(k.modified).withScheme("file")}const R=this.fileTreeService.getNodeByPathOrUri(M);if(R&&R.filestat.isInSymbolicDirectory)return await this.clipboardService.writeText(R.path.split(d.Path.separator).slice(2).join(d.Path.separator));let P;if(this.fileTreeService.isMultipleWorkspace)for(const k of await this.workspaceService.roots){if(P=new o.URI(k.uri),P.isEqual(M))return await this.clipboardService.writeText("./");if(P.isEqualOrParent(M))return await this.clipboardService.writeText(decodeURIComponent(P.relative(M).toString()))}else if(this.workspaceService.workspace)return P=new o.URI(this.workspaceService.workspace.uri),P.isEqual(M)?await this.clipboardService.writeText("./"):await this.clipboardService.writeText(decodeURIComponent(P.relative(M).toString()))},isVisible:()=>!!this.fileTreeModelService.contextMenuFile}),D.registerCommand(o.FILE_COMMANDS.COPY_FILE,{execute:(M,R)=>{if(R&&R.length)this.fileTreeModelService.copyFile(R);else{const P=this.fileTreeModelService.selectedFiles.map(k=>k.uri);P&&P.length&&this.fileTreeModelService.copyFile(P)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)||!!this.fileTreeModelService.focusedFile&&!this.fileTreeModelService.focusedFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.SELECT_CURRENT_NODE,{execute:(M,R)=>{if(R&&R.length)this.fileTreeModelService.selectChildNode(R);else{const P=this.fileTreeModelService.selectedFiles.map(k=>k.uri);P&&P.length&&this.fileTreeModelService.selectChildNode(P)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)||!!this.fileTreeModelService.focusedFile&&!this.fileTreeModelService.focusedFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.CUT_FILE,{execute:(M,R)=>{if(R&&R.length)this.fileTreeModelService.cutFile(R);else{const P=this.fileTreeModelService.selectedFiles.map(k=>k.uri);P&&P.length&&this.fileTreeModelService.cutFile(P)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)||!!this.fileTreeModelService.focusedFile&&!this.fileTreeModelService.focusedFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.PASTE_FILE,{execute:M=>{if(I(),M)this.fileTreeModelService.pasteFile(M);else if(this.fileTreeModelService.focusedFile){let R;this.fileTreeModelService.activeUri?R=this.fileTreeModelService.activeUri:R=this.fileTreeModelService.focusedFile.uri,this.fileTreeModelService.pasteFile(R)}},isEnabled:()=>this.fileTreeModelService.pasteStore&&this.fileTreeModelService.pasteStore.type!==f.PasteTypes.NONE||this.appConfig.isElectronRenderer}),D.registerCommand(o.FILE_COMMANDS.VSCODE_OPEN_FOLDER,{execute:(M,R)=>{const P=this.injector.get(o.IWindowService),k={newWindow:!0};return typeof R=="boolean"?k.newWindow=R:k.newWindow=typeof R?.forceNewWindow=="boolean"?R.forceNewWindow:!0,M?P.openWorkspace(M,k):this.commandService.executeCommand(o.FILE_COMMANDS.OPEN_FOLDER.id,k)},isVisible:()=>{const M=this.preferenceService.get("application.supportsOpenFolder");return M??!1}}),D.registerCommand(o.FILE_COMMANDS.OPEN_FOLDER,{execute:M=>{const R=this.injector.get(o.IWindowService);this.appConfig.isElectronRenderer?this.injector.get(o.IElectronNativeDialogService).showOpenDialog({title:(0,o.localize)("workspace.openDirectory"),properties:["openDirectory"]}).then(k=>{k&&k.length>0&&R.openWorkspace(o.URI.file(k[0]),M||{newWindow:!0})}):this.injector.get(u.IWindowDialogService).showOpenDialog({title:(0,o.localize)("workspace.openDirectory"),canSelectFiles:!1,canSelectFolders:!0}).then(k=>{var F;k&&k.length>0&&this.injector.get(E.IWorkspaceService).open(k[0],{preserveWindow:(F=M?.newWindow)!==null&&F!==void 0?F:!1})})},isVisible:()=>{const M=this.preferenceService.get("application.supportsOpenFolder");return M??!1}}),D.registerCommand(o.FILE_COMMANDS.OPEN_WORKSPACE,{execute:M=>{if(!this.preferenceService.get("application.supportsOpenWorkspace"))return;const P=this.injector.get(o.IWindowService);this.appConfig.isElectronRenderer?this.injector.get(o.IElectronNativeDialogService).showOpenDialog({title:(0,o.localize)("workspace.openWorkspace"),properties:["openFile"],filters:[{name:(0,o.localize)("workspace.openWorkspaceTitle"),extensions:[this.workspaceService.workspaceSuffixName]}]}).then(F=>{F&&F.length>0&&P.openWorkspace(o.URI.file(F[0]),M||{newWindow:!0})}):this.injector.get(u.IWindowDialogService).showOpenDialog({title:(0,o.localize)("workspace.openWorkspace"),canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1,filters:{workspace:[this.workspaceService.workspaceSuffixName]}}).then(F=>{var L;F&&F.length>0&&this.injector.get(E.IWorkspaceService).open(F[0],{preserveWindow:(L=M?.newWindow)!==null&&L!==void 0?L:!1})})},isVisible:()=>{const M=this.preferenceService.get("application.supportsOpenWorkspace");return M??!1}}),D.registerCommand(o.FILE_COMMANDS.REVEAL_IN_EXPLORER,{execute:M=>{var R;let P=M instanceof o.URI?M:M?.uri;const k=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);k&&!k.isVisible&&(k.activate(),setTimeout(()=>{k.setCollapsed(f.RESOURCE_VIEW_ID,!1)},200)),!P&&(!((R=this.workbenchEditorService.currentEditor)===null||R===void 0)&&R.currentUri)&&(P=this.workbenchEditorService.currentEditor.currentUri),P&&this.revealFile(o.URI.parse(P.toString()))}}),D.registerCommand(o.FILE_COMMANDS.FOCUS_FILES,{execute:()=>{const M=this.mainLayoutService.getTabbarHandler(g.EXPLORER_CONTAINER_ID);M&&M.activate()}}),D.registerCommand(o.FILE_COMMANDS.OPEN_FILE,{execute:M=>this.windowDialogService.showOpenDialog(M)}),D.registerCommand(o.FILE_COMMANDS.SAVE_FILE,{execute:M=>this.windowDialogService.showSaveDialog(M)}),D.registerCommand(o.FILE_COMMANDS.FILTER_TOGGLE,{execute:()=>this.fileTreeService.toggleFilterMode()}),D.registerCommand(o.FILE_COMMANDS.FILTER_OPEN,{execute:()=>{if(!this.fileTreeService.filterMode)return this.fileTreeService.toggleFilterMode()}}),D.registerCommand(o.FILE_COMMANDS.FILTER_CLOSE,{execute:()=>{this.fileTreeService.filterMode&&this.fileTreeService.toggleFilterMode()}}),D.registerCommand(o.FILE_COMMANDS.NEXT,{execute:()=>{this.fileTreeModelService.moveToNext()}}),D.registerCommand(o.FILE_COMMANDS.PREV,{execute:()=>{this.fileTreeModelService.moveToPrev()}}),D.registerCommand(o.FILE_COMMANDS.COLLAPSE,{execute:()=>{this.fileTreeModelService.collapseCurrentFile()}}),D.registerCommand(o.FILE_COMMANDS.EXPAND,{execute:()=>{this.fileTreeModelService.expandCurrentFile()}}),D.registerCommand(o.FILE_COMMANDS.TOGGLE_OR_OPEN,{execute:()=>{this.fileTreeModelService.toggleOrOpenCurrentFile()}}),D.registerCommand(o.WORKSPACE_COMMANDS.REMOVE_WORKSPACE_FOLDER,{execute:async(M,R)=>{if(I(),!R.length||!this.workspaceService.isMultiRootWorkspaceOpened)return;const P=await this.workspaceService.roots,k=R.filter(F=>P.find(L=>L.uri===F.toString()));k.length>0&&await this.workspaceService.removeRoots(k)},isVisible:()=>this.workspaceService.isMultiRootWorkspaceOpened&&!!this.fileTreeModelService.contextMenuFile&&!!this.workspaceService.tryGetRoots().find(M=>{var R;return M.uri===((R=this.fileTreeModelService.contextMenuFile)===null||R===void 0?void 0:R.uri.toString())})})}registerKeybindings(D){D.registerKeybinding({command:o.FILE_COMMANDS.COPY_FILE.id,keybinding:"ctrlcmd+c",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.PASTE_FILE.id,keybinding:"ctrlcmd+v",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.CUT_FILE.id,keybinding:"ctrlcmd+x",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.SELECT_CURRENT_NODE.id,keybinding:"ctrlcmd+a",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.RENAME_FILE.id,keybinding:"enter",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.DELETE_FILE.id,keybinding:"ctrlcmd+backspace",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.FILTER_OPEN.id,keybinding:"ctrlcmd+f",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.FILTER_CLOSE.id,keybinding:"esc",when:`${c.FilesExplorerFocusedContext.raw} && ${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.NEXT.id,keybinding:"down",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.PREV.id,keybinding:"up",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.EXPAND.id,keybinding:"right",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.COLLAPSE.id,keybinding:"left",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.TOGGLE_OR_OPEN.id,keybinding:"space",when:`${c.FilesExplorerFocusedContext.raw} && !${c.FilesExplorerInputFocusedContext.raw} && !${c.FilesExplorerFilteredContext.raw}`})}registerToolbarItems(D){D.registerItem({id:o.FILE_COMMANDS.LOCATION_WITH_EDITOR.id,command:o.FILE_COMMANDS.LOCATION_WITH_EDITOR.id,label:(0,o.localize)("file.location"),viewId:f.RESOURCE_VIEW_ID,when:`view == '${f.RESOURCE_VIEW_ID}' && !config.explorer.autoReveal && !${c.FilesExplorerFilteredContext.raw}`,order:0}),D.registerItem({id:o.FILE_COMMANDS.NEW_FILE.id,command:o.FILE_COMMANDS.NEW_FILE.id,label:(0,o.localize)("file.new"),viewId:f.RESOURCE_VIEW_ID,when:`view == '${f.RESOURCE_VIEW_ID}' && !${c.FilesExplorerFilteredContext.raw}`,order:1}),D.registerItem({id:o.FILE_COMMANDS.NEW_FOLDER.id,command:o.FILE_COMMANDS.NEW_FOLDER.id,label:(0,o.localize)("file.folder.new"),viewId:f.RESOURCE_VIEW_ID,when:`view == '${f.RESOURCE_VIEW_ID}' && !${c.FilesExplorerFilteredContext.raw}`,order:2}),D.registerItem({id:o.FILE_COMMANDS.FILTER_TOGGLE.id,command:o.FILE_COMMANDS.FILTER_TOGGLE.id,label:(0,o.localize)("file.filetree.filter"),viewId:f.RESOURCE_VIEW_ID,toggledWhen:`${c.FilesExplorerFilteredContext.raw}`,order:3}),D.registerItem({id:o.FILE_COMMANDS.REFRESH_ALL.id,command:o.FILE_COMMANDS.REFRESH_ALL.id,label:(0,o.localize)("file.refresh"),viewId:f.RESOURCE_VIEW_ID,when:`view == '${f.RESOURCE_VIEW_ID}' && !${c.FilesExplorerFilteredContext.raw}`,order:4}),D.registerItem({id:o.FILE_COMMANDS.COLLAPSE_ALL.id,command:o.FILE_COMMANDS.COLLAPSE_ALL.id,label:(0,o.localize)("file.collapse"),viewId:f.RESOURCE_VIEW_ID,order:5}),D.registerItem({id:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,command:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,label:(0,o.localize)("workspace.addFolderToWorkspace"),viewId:f.RESOURCE_VIEW_ID,order:0,group:"file_explore_workspace",when:"config.workspace.supportMultiRootWorkspace"})}doDelete(){const D=this.willDeleteUris.slice();return this.willDeleteUris=[],this.fileTreeModelService.deleteFileByUris(D)}dispose(){this._disposables.dispose()}};t.FileTreeContribution=w,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],w.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(f.IFileTreeService),n.__metadata("design:type",y.FileTreeService)],w.prototype,"fileTreeService",void 0),n.__decorate([(0,r.Autowired)(l.IMainLayoutService),n.__metadata("design:type",Object)],w.prototype,"mainLayoutService",void 0),n.__decorate([(0,r.Autowired)(v.IProgressService),n.__metadata("design:type",Object)],w.prototype,"progressService",void 0),n.__decorate([(0,r.Autowired)(E.IWorkspaceService),n.__metadata("design:type",Object)],w.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(A.FileTreeModelService),n.__metadata("design:type",A.FileTreeModelService)],w.prototype,"fileTreeModelService",void 0),n.__decorate([(0,r.Autowired)(_.IDecorationsService),n.__metadata("design:type",_.IDecorationsService)],w.prototype,"decorationService",void 0),n.__decorate([(0,r.Autowired)(s.WorkbenchEditorService),n.__metadata("design:type",s.WorkbenchEditorService)],w.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],w.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(u.IWindowDialogService),n.__metadata("design:type",Object)],w.prototype,"windowDialogService",void 0),n.__decorate([(0,r.Autowired)(o.IClipboardService),n.__metadata("design:type",Object)],w.prototype,"clipboardService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],w.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(o.QuickOpenService),n.__metadata("design:type",Object)],w.prototype,"quickOpenService",void 0),n.__decorate([(0,r.Autowired)(l.IViewsRegistry),n.__metadata("design:type",Object)],w.prototype,"viewsRegistry",void 0),n.__decorate([(0,r.Autowired)(o.IApplicationService),n.__metadata("design:type",Object)],w.prototype,"appService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],w.prototype,"appConfig",void 0),t.FileTreeContribution=w=n.__decorate([(0,m.Domain)(p.MenuContribution,o.CommandContribution,o.KeybindingContribution,o.TabBarToolbarContribution,o.ClientAppContribution,l.MainLayoutContribution)],w)},2812:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeModel=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(69959),m=e(93239);let _=n=class extends c.TreeModel{constructor(g){super(),this.flushDispatchChangeDelayer=new p.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this.init(g)}init(g){this.root=g,this.root.watcher.on(c.TreeNodeEvent.BranchDidUpdate,this.doDispatchChange.bind(this)),this.decorationService.onDidChange(this.doDispatchChange.bind(this))}doDispatchChange(){this.flushDispatchChangeDelayer.isTriggered()||this.flushDispatchChangeDelayer.cancel(),this.flushDispatchChangeDelayer.trigger(async()=>{this.dispatchChange()})}};t.FileTreeModel=_,_.DEFAULT_FLUSH_DELAY=100,r.__decorate([(0,o.Autowired)(m.FileTreeDecorationService),r.__metadata("design:type",m.FileTreeDecorationService)],_.prototype,"decorationService",void 0),t.FileTreeModel=_=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[v.Directory])],_)},46377:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FILE_TREE_BADGE_LIMIT=t.FILE_TREE_NODE_HEIGHT=t.FileTreeNode=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=e(97267),p=e(41869),v=e(69959),m=n.__importDefault(e(89200)),{Path:_}=p.path,s=({item:g,onClick:l,onDoubleClick:h,onContextMenu:u,dndService:d,itemType:E,decorationService:f,labelService:a,leftPadding:b=8,onTwistierClick:y,decorations:A,defaultLeftPadding:S=8,template:w,hasFolderIcons:T,hasFileIcons:D,hidesExplorerArrows:I,hasPrompt:O,iconService:M})=>{const[R,P]=o.default.useState(-1),k=E===c.TreeNodeType.RenamePrompt,F=E===c.TreeNodeType.NewPrompt,L=k||F,B=!L&&g.name.indexOf(_.separator)>=0,j=(0,p.useDesignStyles)(m.default.expansion_toggle,"expansion_toggle"),W=(0,p.useDesignStyles)(m.default.file_tree_node,"file_tree_node"),U=L?null:f.getDecoration(g.uri,v.Directory.is(g)),Q=Pe=>{(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&(B&&P(g.name.split(_.separator).length-1),l(Pe,g,E))},V=Pe=>{(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&(B&&P(g.name.split(_.separator).length-1),h(Pe,g,E))},$=Pe=>{(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&(y?y(Pe,g,E):l(Pe,g,E))},Y=o.default.useCallback(Pe=>{Pe.nativeEvent.which!==0&&(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&u(Pe,g,E)},[u,g]),z=o.default.useCallback(Pe=>{const{handleDragStart:Ae}=d;(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&Ae(Pe,g)},[d,g]),H=o.default.useCallback(Pe=>{const{handleDragLeave:Ae}=d;(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&Ae(Pe,g)},[d,g]),K=o.default.useCallback(Pe=>{const{handleDragEnter:Ae}=d;(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&Ae(Pe,g)},[d,g]),Z=o.default.useCallback(Pe=>{const{handleDrop:Ae}=d;(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&Ae(Pe,g)},[d,g]),X=o.default.useCallback(Pe=>{const{handleDragOver:Ae}=d;(E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode)&&Ae(Pe,g)},[d,g]);let ie=E===c.TreeNodeType.CompositeTreeNode,oe;L?F?(ie=g.type===c.TreeNodeType.CompositeTreeNode,oe=`${S+(g.parent.depth+1||0)*(b||0)+(ie?0:T?I?0:20:0)}px`):(ie=g.target.type===c.TreeNodeType.CompositeTreeNode,oe=`${S+(g.target.depth||0)*(b||0)+(ie?0:T?I?0:20:0)}px`):oe=`${S+(g.depth||0)*(b||0)+(ie?0:T?I?0:20:0)}px`;const le={color:U?U.color:"",height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`,paddingLeft:oe,opacity:O&&!L?".6":"1"},pe=(Pe,Ae)=>{if(A&&A?.classlist.indexOf(m.default.mod_loading)>-1)return o.default.createElement(c.Loading,null);if(L&&Pe instanceof c.PromptHandle){let we=!1;if(k?we=Pe.target.type===c.TreeNodeType.CompositeTreeNode:we=Pe.type===c.TreeNodeType.CompositeTreeNode,we)return o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,j,(0,p.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:F||!(k&&Pe.target.type===c.TreeNodeType.CompositeTreeNode&&Pe.target.expanded)})})}else return o.default.createElement("div",{onClick:Ae,className:(0,r.default)(m.default.file_tree_node_segment,j,(0,p.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:!Pe.expanded})})},q=Pe=>{let Ae,we;L&&Pe instanceof c.PromptHandle?Pe instanceof c.RenamePromptHandle?(Ae=Pe.target.uri.resolve(Pe.$.value),we=v.Directory.is(Pe.target)):(Ae=Pe.parent.uri.resolve(Pe.$.value),we=Pe.type===c.TreeNodeType.CompositeTreeNode):(Ae=Pe.uri,we=Pe.filestat.isDirectory);const be=a.getIcon(Ae,{isDirectory:we,isOpenedDirectory:we&&Pe.expanded});return we&&!T||!we&&!D?null:o.default.createElement("div",{className:(0,r.default)(m.default.file_icon,be,{expanded:we&&Pe.expanded}),style:{height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`}})},Ee=Pe=>{if(w)return o.default.createElement(w,null);if(L&&Pe instanceof c.PromptHandle)return o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_inputbox)},o.default.createElement("div",{className:(0,r.default)("input-box",m.default.file_tree_node_prompt_box)},o.default.createElement(Pe.ProxiedInput,{wrapperStyle:{height:t.FILE_TREE_NODE_HEIGHT,padding:"0 5px"}})));if(B){const Ae=Pe.displayName.split(_.separator),we=Ae.map((be,fe)=>{const xe=Ae.slice(0,fe+1).join(_.separator),Re=Fe=>{Fe.stopPropagation(),P(fe);const Ge=g.parent.uri.resolve(Ae.slice(0,fe+1).join(_.separator));l(Fe,g,E,Ge)},Be=Fe=>{Fe.stopPropagation(),P(fe);const Ge=g.parent.uri.resolve(Ae.slice(0,fe+1).join(_.separator));u(Fe,g,E,Ge)},me=Fe=>{Fe.stopPropagation(),Fe.preventDefault(),R!==fe&&(P(fe),d.handleDragOver(Fe,g))},re=Fe=>{Fe.stopPropagation(),Fe.preventDefault(),P(-1)},he=Fe=>{Fe.stopPropagation(),R!==fe&&P(fe);const Ge=g.parent.uri.resolve(Ae.slice(0,fe+1).join(_.separator));d.handleDragStart(Fe,g,Ge)},Oe=Fe=>{const Ge=g.parent.uri.resolve(Ae.slice(0,fe+1).join(_.separator));d.handleDrop(Fe,g,Ge)},Se=(0,r.default)(R===fe&&m.default.active,m.default.compact_name);return o.default.createElement("span",{key:xe},o.default.createElement("a",{className:Se,draggable:!0,onContextMenu:Be,onDragStart:he,onDragOver:me,onDragLeave:re,onDrop:Oe,onClick:Re},be),fe!==Ae.length-1?o.default.createElement("span",{className:m.default.compact_name_separator},_.separator):null)});return o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_displayname)},we)}return o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_displayname)},a.getName(Pe.uri)||Pe.displayName)},_e=()=>o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_segment,m.default.file_tree_node_tail)},te()),te=()=>U?o.default.createElement("div",{className:m.default.file_tree_node_status},(0,p.transformLabelWithCodicon)(U.badge.slice(),{color:"inherit"},M.fromString.bind(M))):null,ge=Pe=>{if(I)return null;if(ie)return pe(Pe,$);if(L)return pe(Pe,()=>{})},Te=()=>{let Pe=g.tooltip;return U&&U.badge&&(Pe+=` \u2022 ${U.tooltip}`),Pe};return o.default.createElement("div",{key:g.id,onClick:Q,onDoubleClick:V,onContextMenu:Y,onDragStart:z,onDragOver:X,onDragEnter:K,onDragLeave:H,onDrop:Z,title:Te(),className:(0,r.default)(W,A?A.classlist:null),style:le,draggable:E===c.TreeNodeType.TreeNode||E===c.TreeNodeType.CompositeTreeNode,"data-id":g.id},o.default.createElement("div",{className:(0,r.default)(m.default.file_tree_node_content)},ge(g),q(g),o.default.createElement("div",{className:L?m.default.file_tree_node_prompt_wrap:m.default.file_tree_node_overflow_wrap},Ee(g)),_e()))};t.FileTreeNode=s,t.FILE_TREE_NODE_HEIGHT=22,t.FILE_TREE_BADGE_LIMIT=99},56384:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTree=t.FILE_TREE_FILTER_DELAY=t.FILTER_AREA_HEIGHT=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(97267),p=e(41869),v=e(68974),m=e(24429),_=e(87420),s=e(6250),g=e(46377),l=n.__importDefault(e(2613)),h=e(97738);t.FILTER_AREA_HEIGHT=30,t.FILE_TREE_FILTER_DELAY=500;const u=(0,c.RecycleTreeFilterDecorator)(c.RecycleTree),d=({viewState:f})=>{const[a,b]=(0,o.useState)(!1),[y,A]=(0,o.useState)(!0),[S,w]=(0,o.useState)(!1),[T,D]=(0,o.useState)(!1),[I,O]=(0,o.useState)(),M=(0,o.useRef)(null),R=(0,o.useRef)(new p.DisposableCollection),{height:P}=f,k=(0,p.useInjectable)(s.IFileTreeService),{iconService:F,locationToCurrentFile:L,filterMode:B,indent:j,baseIndent:W}=k,U=(0,p.useInjectable)(h.FileTreeModelService),[Q,V]=(0,o.useState)({indent:j,baseIndent:W}),[$,Y]=(0,o.useState)(B),[z,H]=(0,o.useState)(F.currentTheme||{hasFolderIcons:!0,hasFileIcons:!0,hidesExplorerArrows:!0}),K=(0,o.useCallback)(xe=>Z(xe)?!1:xe.shiftKey,[]),Z=(0,o.useCallback)(xe=>{const{metaKey:Re,ctrlKey:Be}=xe;return p.isOSX&&Re||Be},[]),X=(0,o.useCallback)((xe,Re,Be,me)=>{xe.stopPropagation();const{handleItemClick:re,handleItemToggleClick:he,handleItemRangeClick:Oe}=U;if(!Re)return;const Se=K(xe),Fe=Z(xe);Se?Oe(Re,Be):Fe?he(Re,Be):re(Re,Be,me)},[]),ie=(0,o.useCallback)((xe,Re,Be)=>{xe.stopPropagation();const{handleItemDoubleClick:me}=U;Re&&me(Re,Be)},[]),oe=(0,o.useCallback)((xe,Re)=>{xe.stopPropagation();const{toggleDirectory:Be}=U;Be(Re)},[]);(0,o.useEffect)(()=>{a&&U.onFileTreeModelChange(async xe=>{A(!0),xe&&(await xe.ensureReady,M.current&&k.initContextKey(M.current)),O(xe),A(!1)})},[a,M.current,k]),(0,o.useEffect)(()=>{var xe,Re,Be;const me=new p.CancellationTokenSource;return q(me.token),(xe=R.current)===null||xe===void 0||xe.push(F.onThemeChange(re=>{H(re)})),(Re=R.current)===null||Re===void 0||Re.push(k.onTreeIndentChange(({indent:re,baseIndent:he})=>{V({indent:re,baseIndent:he})})),(Be=R.current)===null||Be===void 0||Be.push(k.onFilterModeChange(re=>{Y(re)})),()=>{var re;me.cancel(),(re=R.current)===null||re===void 0||re.dispose()}},[]);const le=(0,o.useCallback)((xe,Re)=>{let Be;if(xe&&Re)for(Be=xe.parentNode;Be;){if(Re===Be)return!0;Be=Be.parentNode}return!1},[]),pe=(0,o.useCallback)(xe=>{le(xe.relatedTarget,M.current)||!xe.relatedTarget||(w(!1),U.handleTreeBlur())},[M.current]);(0,o.useEffect)(()=>{$||(U.fileTreeHandle&&U.fileTreeHandle.clearFilter(),U.selectedFiles.length===1&&U.location(U.selectedFiles[0].uri))},[$]),(0,o.useEffect)(()=>{const xe=new p.DisposableCollection;return I&&(xe.push(U.onDidFocusedFileChange(Re=>{Re?Re.isEqual((I?.root).uri)?S||w(!S):S&&w(!S):Re||S&&w(!S)})),xe.push(U.onDidContextMenuFileChange(Re=>{Re?Re.isEqual((I?.root).uri)?S||w(!S):S&&w(!S):Re||S&&w(!S)}))),()=>{xe.dispose()}},[I,S]);const q=(0,o.useCallback)(async xe=>{var Re;if(await U.whenReady,!xe.isCancellationRequested){if(U.treeModel){if(await U.treeModel.ensureReady,O(U.treeModel),xe.isCancellationRequested)return;M.current&&k.initContextKey(M.current)}A(!1),!((Re=R.current)===null||Re===void 0)&&Re.disposed||b(!0)}},[U,R.current]),Ee=(0,o.useCallback)(xe=>{U.handleTreeHandler({...xe,getModel:()=>U.treeModel,hasDirectFocus:()=>M.current===document.activeElement})},[M.current,I]),_e=(0,o.useCallback)(()=>{const{handleItemClick:xe}=U;xe()},[]),te=(0,o.useCallback)(()=>{U.handleDblClick()},[]),ge=(0,o.useCallback)(()=>{const{handleTreeFocus:xe}=U;xe()},[]),Te=(0,o.useCallback)(xe=>{const{handleContextMenu:Re}=U;Re(xe)},[]),Pe=(0,o.useCallback)(xe=>{xe.stopPropagation(),xe.preventDefault()},[]),Ae=(0,o.useCallback)(xe=>{xe.preventDefault(),D(!0)},[]),we=(0,o.useCallback)(()=>{D(!1)},[]),be=(0,o.useCallback)(xe=>{const{handleDrop:Re}=U.dndService;D(!1),Re(xe)},[]),fe=(0,o.useCallback)((xe,Re,Be,me)=>{const{handleContextMenu:re}=U;re(xe,Re,me)},[]);return o.default.createElement("div",{className:(0,r.default)(l.default.file_tree,T&&l.default.outer_drag_over,S&&l.default.outer_active),tabIndex:-1,ref:M,onClick:_e,onDoubleClick:te,onFocus:ge,onBlur:pe,onContextMenu:Te,draggable:!0,onDragStart:Pe,onDragLeave:we,onDragOver:Ae,onDrop:be},o.default.createElement(E,{isLoading:y,isReady:a,height:P,model:I,iconTheme:z,treeIndent:Q,filterMode:$,locationToCurrentFile:L,onTreeReady:Ee,onContextMenu:fe,onItemClick:X,onItemDoubleClick:ie,onTwistierClick:oe}))};t.FileTree=d;const E=(0,o.memo)(({isReady:f,isLoading:a,height:b,model:y,filterMode:A,treeIndent:S,iconTheme:w,onTreeReady:T,onItemClick:D,onItemDoubleClick:I,onContextMenu:O,onTwistierClick:M})=>{const R=(0,p.useInjectable)(s.IFileTreeService),P=(0,p.useInjectable)(_.IIconService),{decorationService:k,labelService:F,locationToCurrentFile:L}=R,B=(0,p.useInjectable)(h.FileTreeModelService),j=(0,o.useCallback)(W=>o.default.createElement(g.FileTreeNode,{item:W.item,itemType:W.itemType,template:W.template,decorationService:k,labelService:F,iconService:P,dndService:B.dndService,decorations:B.decorations.getDecorations(W.item),onClick:D,onDoubleClick:I,onTwistierClick:M,onContextMenu:O,defaultLeftPadding:S.baseIndent,leftPadding:S.indent,hasPrompt:W.hasPrompt,hasFolderIcons:w.hasFolderIcons,hasFileIcons:w.hasFileIcons,hidesExplorerArrows:w.hidesExplorerArrows}),[y,S,w]);return f?a?o.default.createElement(v.Progress,{loading:!0}):y?o.default.createElement(u,{height:b,itemHeight:g.FILE_TREE_NODE_HEIGHT,onReady:T,model:y,filterEnabled:A,filterAfterClear:L,filterAutoFocus:!0,leaveBottomBlank:!0},j):o.default.createElement(m.WelcomeView,{viewId:s.FILE_EXPLORER_WELCOME_ID}):o.default.createElement(v.Progress,{loading:!0})});E.displayName="FileTreeView"},57781:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeService=void 0;const n=e(85608),r=e(76003),o=e(97267),c=e(41869),p=e(18193),v=e(26542),m=e(42933),_=e(52416),s=e(51500),g=e(6250),l=e(69959),h=e(88014),u=e(93239),{Path:d}=c.path;let E=class extends o.Tree{constructor(){super(...arguments),this._fileServiceWatchers=new Map,this._symbolicFiles=new Map,this._changeEventDispatchQueue=new Set,this._readyToWatch=!1,this._watchRootsQueue=[],this.effectedNodes=[],this.onWorkspaceChangeEmitter=new c.Emitter,this.onTreeIndentChangeEmitter=new c.Emitter,this.onFilterModeChangeEmitter=new c.Emitter,this.onNodeRefreshedEmitter=new c.Emitter,this._filterMode=!1,this._refreshable=!0,this.refreshEffectNode=()=>{const a=this.effectedNodes.slice(0);if(this.effectedNodes=[],a.find(y=>l.Directory.isRoot(y)))this.refresh();else for(const y of a)this.refresh(y)},this.flushEventQueue=async()=>{if(!this._changeEventDispatchQueue||this._changeEventDispatchQueue.size===0)return;const a=Array.from(this._changeEventDispatchQueue),b=this.sortPaths(a);(!this.refreshCancelToken||this.refreshCancelToken.token.isCancellationRequested)&&(this.refreshCancelToken=new c.CancellationTokenSource);const y=(0,c.pSeries)(b.map(A=>async()=>{l.Directory.is(A.node)&&await A.node.refresh(this.refreshCancelToken)}));return this._changeEventDispatchQueue.clear(),await y},this.locationToCurrentFile=()=>{this.commandService.executeCommand(c.FILE_COMMANDS.LOCATION.id)}}get onNodeRefreshed(){return this.onNodeRefreshedEmitter.event}get refreshable(){return this._refreshable}get filterMode(){return this._filterMode}get baseIndent(){return this._baseIndent}get indent(){return this._indent}get onWorkspaceChange(){return this.onWorkspaceChangeEmitter.event}get onTreeIndentChange(){return this.onTreeIndentChangeEmitter.event}get onFilterModeChange(){return this.onFilterModeChangeEmitter.event}get isCompactMode(){return this._isCompactMode}get contextKey(){return this.fileContextKey}async init(){this._roots=await this.workspaceService.roots,await this.preferenceService.ready,this._baseIndent=this.preferenceService.getValid("explorer.fileTree.baseIndent",8),this._indent=this.preferenceService.getValid("explorer.fileTree.indent",8),this._isCompactMode=this.preferenceService.getValid("explorer.compactFolders",!0),this.toDispose.push(this.workspaceService.onWorkspaceChanged(a=>{this._roots=a;const b=new c.URI(a[0].uri),y=new l.Directory(this,void 0,b,b.displayName,a[0],this.fileTreeAPI.getReadableTooltip(b));this.root=y,this.onWorkspaceChangeEmitter.fire(y),this.refresh()})),this.toDispose.push(this.workspaceService.onWorkspaceFileExcludeChanged(()=>{this.refresh()})),this.toDispose.push(c.Disposable.create(()=>{var a;(a=this._root)===null||a===void 0||a.dispose(),this._roots=null})),this.toDispose.push(this.corePreferences.onPreferenceChanged(a=>{a.preferenceName==="explorer.fileTree.baseIndent"?(this._baseIndent=a.newValue||8,this.onTreeIndentChangeEmitter.fire({indent:this.indent,baseIndent:this.baseIndent})):a.preferenceName==="explorer.fileTree.indent"?(this._indent=a.newValue||8,this.onTreeIndentChangeEmitter.fire({indent:this.indent,baseIndent:this.baseIndent})):a.preferenceName==="explorer.compactFolders"&&(this._isCompactMode=a.newValue,this.refresh())}))}initContextKey(a){this.fileContextKey.initScopedContext(a)}startWatchFileEvent(){return this._readyToWatch=!0,Promise.all(this._watchRootsQueue.map(a=>this.watchFilesChange(a)))}async resolveChildren(a){var b,y,A,S;let w=[];if(a){if(l.Directory.isRoot(a)&&this.isMultipleWorkspace){const T=await this.workspaceService.roots;for(const D of T){const I=this.fileTreeAPI.toNode(this,D,a,this.workspaceService.getWorkspaceName(new c.URI(D.uri)));this.watchFilesChange(new c.URI(D.uri)),w=w.concat(I),(I.filestat.isSymbolicLink||I.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(I.filestat.uri,I)}return w}if(a.uri){const T=await this.fileTreeAPI.resolveChildren(this,a.uri.toString(),a,this.isCompactMode&&!l.Directory.isRoot(a));w=T.children,w.forEach(I=>{(I.filestat.isSymbolicLink||I.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(I.filestat.uri,I)});const D=T.filestat;if(D&&this.isCompactMode&&!l.Directory.isRoot(a)){const I=new c.URI(D.uri),O=a.parent;if(a&&O){let M=a.name;if(a.filestat.isSymbolicLink){const R=(y=new c.URI(a.filestat.realUri).relative(I))===null||y===void 0?void 0:y.toString();R&&(M=R,M=[a.uri.displayName].concat(M.split(d.separator)).join(d.separator))}else O.filestat.isSymbolicLink?M=(A=new c.URI(O.filestat.realUri).relative(I))===null||A===void 0?void 0:A.toString():M=(S=O.uri.relative(I))===null||S===void 0?void 0:S.toString();M&&M!==a.name&&a.updateMetaData({name:M,uri:I,tooltip:this.fileTreeAPI.getReadableTooltip(I),fileStat:D})}}return w}}else if(this._roots||(this._roots=await this.workspaceService.roots),this.isMultipleWorkspace){const T=new c.URI((b=this.workspaceService.workspace)===null||b===void 0?void 0:b.uri);let D=T.displayName;D=D.slice(0,D.lastIndexOf("."));const I={...this.workspaceService.workspace,isDirectory:!0},O=new l.Directory(this,void 0,T,D,I,this.fileTreeAPI.getReadableTooltip(T));return this.root=O,[O]}else if(this._roots.length>0)return w=await(await this.fileTreeAPI.resolveChildren(this,this._roots[0])).children,w.forEach(T=>{const D=this.workspaceService.getWorkspaceName(T.uri);D&&D!==T.name&&T.updateMetaData({name:D}),(T.filestat.isSymbolicLink||T.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(T.filestat.uri,T)}),this.watchFilesChange(new c.URI(this._roots[0].uri)),this.root=w[0],w;return[]}async watchFilesChange(a){if(!this._readyToWatch){this._watchRootsQueue.push(a);return}const b=await this.fileServiceClient.watchFileChanges(a);this.toDispose.push(b),this.toDispose.push(b.onFilesChanged(y=>{this.onFilesChanged(y)})),this._fileServiceWatchers.set(a.toString(),b)}updateRefreshable(a){var b;a!==this.refreshable&&(this._refreshable=a,this._refreshable?this.doHandleQueueChange():(b=this.refreshCancelToken)===null||b===void 0||b.cancel())}isContentFile(a){return!!a&&"filestat"in a&&!a.filestat.isDirectory}isFileContentChanged(a){return a.type===m.FileChangeType.UPDATED&&this.isContentFile(this.getNodeByPathOrUri(a.uri))}getAffectedChanges(a){const b=[];for(const y of a)this.isFileContentChanged(y)||b.push(y);return b}isRootAffected(a){return this._roots?a.some(b=>b.type>m.FileChangeType.UPDATED&&this._roots&&this._roots.find(y=>b.uri.indexOf(y.uri)>=0)):!1}async onFilesChanged(a){const b=await this.getAffectedNodes(this.getAffectedChanges(a));return b.length>0?this.effectedNodes=this.effectedNodes.concat(b):!(b.length>0)&&this.isRootAffected(a)&&this.effectedNodes.push(this.root),this.refreshEffectNode()}async getFileTreeNodePathByUri(a){var b,y,A,S,w,T;if(!a)return;let D;if(this.isMultipleWorkspace){if(this._roots||(this._roots=await this.workspaceService.roots),D=(S=this._roots.find(I=>new c.URI(I.uri).isEqualOrParent(a)))===null||S===void 0?void 0:S.uri,D){const I=new c.URI(D);if(I.isEqualOrParent(a))return new d(((w=this.root)===null||w===void 0?void 0:w.path)||"/").join(I.displayName).join(((T=I.relative(a))===null||T===void 0?void 0:T.toString())||"").toString()}}else if(D=(b=this.workspaceService.workspace)===null||b===void 0?void 0:b.uri,D){const I=new c.URI(D);if(I.isEqualOrParent(a))return new d(((y=this.root)===null||y===void 0?void 0:y.path)||"").join(((A=I.relative(a))===null||A===void 0?void 0:A.toString())||"").toString()}}async moveNodeByPath(a,b,y,A,S=o.TreeNodeType.TreeNode){const w=new d(a.path).join(y).toString(),T=new d(b.path).join(A).toString();if(w&&T&&T!==w){const D=a.moveNode(w,T);return D&&l.File.is(D)&&(D.updateMetaData({uri:b.uri.resolve(A),fileStat:{...b.filestat,uri:b.uri.resolve(A).toString(),isDirectory:S!==o.TreeNodeType.TreeNode},tooltip:this.fileTreeAPI.getReadableTooltip(b.uri.resolve(A))}),l.Directory.is(D)&&this.updateChildren(D)),D}}async updateChildren(a){const b=a.children;if(!(!b||b.length===0)){for(const y of b)if(l.File.is(y)){const A=a.uri.resolve(y.uri.displayName);y.updateMetaData({uri:A,fileStat:{...y.filestat,uri:A.toString(),isDirectory:!!l.Directory.is(y)},tooltip:this.fileTreeAPI.getReadableTooltip(A)}),l.Directory.is(y)&&this.updateChildren(y)}}}async addNode(a,b,y){let A,S;const w=d.splitPath(b);if(w.length>1){let D=a.uri;for(const I of w)D=D.resolve(I);!this.isCompactMode||l.Directory.isRoot(a)?S=w[0]:y===o.TreeNodeType.CompositeTreeNode?S=b:S=w.slice(0,w.length-1).join(d.separator)}else S=b;A={uri:a.uri.resolve(S).toString(),isDirectory:y===o.TreeNodeType.CompositeTreeNode||w.length>1,isSymbolicLink:!1,lastModification:new Date().getTime()};const T=await this.fileTreeAPI.toNode(this,A,a,S);return T&&a.addNode(T),T}async deleteAffectedNodeByPath(a,b){var y,A;const S=this.getNodeByPathOrUri(a);S&&S.parent&&(this.isCompactMode&&!b?((y=S.parent.children)===null||y===void 0?void 0:y.length)===2?this.refresh((A=S.parent)===null||A===void 0?void 0:A.parent):this.refresh(S.parent):S.parent.removeNode(S.path))}async deleteAffectedNodes(a,b=[]){const y=[];for(const A of a){const S=this.getNodeByPathOrUri(A);S&&l.File.is(S)&&y.push(S)}for(const A of y)!A?.parent||this._changeEventDispatchQueue.has(A?.parent.path)||await this.deleteAffectedNodeByPath(A.path);return b.filter(A=>A.type!==m.FileChangeType.DELETED)}async getAffectedNodes(a){const b=[];for(const y of a){const A=new c.URI(y.uri),S=this.getNodeByPathOrUri(A.parent);S&&b.push(S)}return b}isFileURI(a){return/^file:\/\//.test(a)}getNodeByPathOrUri(a){var b,y,A,S;let w,T;if(typeof a!="string"?(T=a,a=a.toString()):this.isFileURI(a)?T=new c.URI(a):!this.isFileURI(a)&&typeof a=="string"&&(w=a),this.isFileURI(a)&&T){if(this._symbolicFiles.has(T?.toString()))return this._symbolicFiles.get(T.toString());let D;if(this.isMultipleWorkspace?this._roots&&(D=(y=this._roots.find(I=>new c.URI(I.uri).isEqualOrParent(T)))===null||y===void 0?void 0:y.uri):D=(b=this.workspaceService.workspace)===null||b===void 0?void 0:b.uri,this.root&&D){const I=new c.URI(D);if(I.isEqualOrParent(T)){const O=I.relative(T);O&&(this.isMultipleWorkspace?w=new d(this.root.path).join(I.displayName).join(O.toString()).toString():w=new d(this.root.path).join(O.toString()).toString())}}}if(w){const D=(A=this.root)===null||A===void 0?void 0:A.getTreeNodeByPath(w);if(!D){let I;const O=w.split(d.separator);for(;O.length>=1;){O.pop();const M=O.join(d.separator);if(I=(S=this.root)===null||S===void 0?void 0:S.getTreeNodeByPath(M),I)break}if(I&&l.Directory.is(I)){for(const M of I.children||[])if(M.path.includes(w))return M}}return D}}sortComparator(a,b){return a.constructor===b.constructor?a.name.localeCompare(b.name,"en",{numeric:!0}):a.type===o.TreeNodeType.CompositeTreeNode?-1:b.type===o.TreeNodeType.CompositeTreeNode?1:0}get contextMenuContextKeyService(){return this.fileContextKey?this.fileContextKey.service:this.contextKeyService}reWatch(){for(const[a,b]of this._fileServiceWatchers)b.dispose(),this.watchFilesChange(new c.URI(a))}get isMultipleWorkspace(){return!!this.workspaceService.workspace&&!this.workspaceService.workspace.isDirectory}getDisplayName(a){return this.workspaceService.getWorkspaceName(a)}async refresh(a=this.root){if(a)return l.Directory.is(a)||l.File.is(a)&&a.parent&&(a=a.parent),this._changeEventDispatchQueue.add(a.path),this.doHandleQueueChange()}async doHandleQueueChange(){if(this.refreshable)try{await this.flushEventQueue()}catch(a){this.logger.error("flush file change event queue error:",a)}finally{this.onNodeRefreshedEmitter.fire()}}sortPaths(a){const y=a.slice().map(S=>({node:this.getNodeByPathOrUri(S),path:S})).filter(S=>S&&!!S.node);a.length>1&&y.sort((S,w)=>{var T,D;const I=((T=S.node)===null||T===void 0?void 0:T.depth)||0,O=((D=w.node)===null||D===void 0?void 0:D.depth)||0;return I-O});const A=[];for(let S=y.length-1;S>=0;S--){const w=y[S];let T=!1;for(let D=0;D<S;D++){const I=y[D];l.Directory.is(I)&&w.node.path.startsWith(I.node.path)&&(T=!0)}T||A.push(w)}return A}openFile(a){const b=this.preferenceService.get("editor.previewMode");this.commandService.executeCommand(c.EDITOR_COMMANDS.OPEN_RESOURCE.id,a,{disableNavigate:!0,preview:b})}openAndFixedFile(a){this.commandService.executeCommand(c.EDITOR_COMMANDS.OPEN_RESOURCE.id,a,{disableNavigate:!0,preview:!1,focus:!0})}openToTheSide(a){this.commandService.executeCommand(c.EDITOR_COMMANDS.OPEN_RESOURCE.id,a,{disableNavigate:!0,split:4})}compare(a,b){this.commandService.executeCommand(c.EDITOR_COMMANDS.COMPARE.id,{original:a,modified:b})}toggleFilterMode(){var a;this._filterMode=!this.filterMode,this.onFilterModeChangeEmitter.fire(this.filterMode),(a=this.fileContextKey)===null||a===void 0||a.filesExplorerFilteredContext.set(this.filterMode),this.filterMode===!1&&this.commandService.executeCommand(c.FILE_COMMANDS.LOCATION.id)}};t.FileTreeService=E,n.__decorate([(0,r.Autowired)(g.IFileTreeAPI),n.__metadata("design:type",Object)],E.prototype,"fileTreeAPI",void 0),n.__decorate([(0,r.Autowired)(c.CommandService),n.__metadata("design:type",Object)],E.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(c.IContextKeyService),n.__metadata("design:type",Object)],E.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(s.IWorkspaceService),n.__metadata("design:type",Object)],E.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(p.CorePreferences),n.__metadata("design:type",Object)],E.prototype,"corePreferences",void 0),n.__decorate([(0,r.Autowired)(c.PreferenceService),n.__metadata("design:type",Object)],E.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(v.LabelService),n.__metadata("design:type",v.LabelService)],E.prototype,"labelService",void 0),n.__decorate([(0,r.Autowired)(u.FileTreeDecorationService),n.__metadata("design:type",u.FileTreeDecorationService)],E.prototype,"decorationService",void 0),n.__decorate([(0,r.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],E.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(_.IIconService),n.__metadata("design:type",Object)],E.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(c.ILogger),n.__metadata("design:type",Object)],E.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(h.FileContextKey),n.__metadata("design:type",h.FileContextKey)],E.prototype,"fileContextKey",void 0),t.FileTreeService=E=n.__decorate([(0,r.Injectable)()],E)},83709:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeNextModule=void 0;const n=e(85608),r=e(41869),o=e(72665),c=e(41103),p=e(6250),v=e(89508),m=e(40439),_=e(57781),s=e(88808),g=e(93239),l=e(97738),h=e(24861);let u=class extends r.BrowserModule{constructor(){super(...arguments),this.providers=[{token:p.IFileTreeAPI,useClass:s.FileTreeAPI},{token:g.FileTreeDecorationService,useClass:g.FileTreeDecorationService},{token:p.IFileTreeService,useClass:_.FileTreeService},{token:l.FileTreeModelService,useClass:l.FileTreeModelService},{token:o.IWindowDialogService,useClass:v.WindowDialogServiceImpl},m.FileTreeContribution]}};t.FileTreeNextModule=u,t.FileTreeNextModule=u=n.__decorate([(0,r.Domain)(h.name),(0,r.ModuleDependencies)([c.WorkspaceModule])],u)},88808:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeAPI=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(43718),p=e(42933),v=e(72665),m=e(26199),_=e(69959);let s=class{constructor(){this.onDidResolveChildrenEmitter=new c.Emitter,this.onDidResolveChildren=this.onDidResolveChildrenEmitter.event}async resolveChildren(l,h,u,d){var E;let f;if(!this.userhomePath){const a=await this.fileServiceClient.getCurrentUserHome();a&&(this.userhomePath=new c.URI(a.uri))}if(typeof h=="string"?f=await this.fileServiceClient.getFileStat(h):f=await this.fileServiceClient.getFileStat(h.uri),f){if(this.onDidResolveChildrenEmitter.fire(f.uri.toString()),((E=f.children)===null||E===void 0?void 0:E.length)===1&&f.children[0].isDirectory&&d)return await this.resolveChildren(l,f.children[0].uri,u,d);{const a={...f,isInSymbolicDirectory:u?.filestat.isSymbolicLink||u?.filestat.isInSymbolicDirectory};return{children:this.toNodes(l,a,u),filestat:a}}}else return{children:[],filestat:null}}async resolveNodeByPath(l,h,u){const d=await this.fileServiceClient.getFileStat(h);if(d)return this.toNode(l,d,u)}async resolveFileStat(l){return await this.fileServiceClient.getFileStat(l.toString())}toNodes(l,h,u){if(u){if(h.children)return h.children.map(d=>this.toNode(l,d,u))}else return[this.toNode(l,h,u)];return[]}toNode(l,h,u,d){var E;const f=new c.URI(h.uri),a=d||f.displayName;let b;return h.isInSymbolicDirectory=(E=u?.filestat.isSymbolicLink)!==null&&E!==void 0?E:u?.filestat.isInSymbolicDirectory,h.isDirectory?b=new _.Directory(l,u,f,a,h,this.getReadableTooltip(f)):b=new _.File(l,u,f,a,h,this.getReadableTooltip(f)),b}async mvFiles(l,h){const u=[];for(const f of l)if(f.url.isEqualOrParent(h))return;const d=l.sort((f,a)=>f.toString().length-a.toString().length),E=[];for(const f of d)E.length>0&&E.find(a=>a.url.isEqualOrParent(f.url))||E.push(f);if(this.corePreferences["explorer.confirmMove"]){const f=(0,c.localize)("file.confirm.move.ok"),a=(0,c.localize)("file.confirm.move.cancel");if(await this.dialogService.warning((0,c.formatLocalize)("file.confirm.move",`[ ${E.map(y=>y.url.displayName).join(",")} ]`,h.displayName),[a,f])!==f)return}for(const f of E){const a=await this.mv(f.url,h.resolve(f.url.displayName),f.isDirectory);a&&u.push(a)}return u}async mv(l,h,u=!1){try{await this.workspaceEditService.apply({edits:[{newResource:h,oldResource:l,options:{isDirectory:u,overwrite:!0}}]})}catch(d){return d.message}}async createFile(l,h){try{await this.workspaceEditService.apply({edits:[{newResource:l,options:{content:h}}]})}catch(u){return u.message}this.commandService.executeCommand(o.EDITOR_COMMANDS.OPEN_RESOURCE.id,l,{disableNavigate:!0,focus:!0})}async createDirectory(l){try{await this.workspaceEditService.apply({edits:[{newResource:l,options:{isDirectory:!0}}]})}catch(h){return h.message}}async delete(l){try{await this.workspaceEditService.apply({edits:[{oldResource:l,options:{}}]});return}catch(h){return h.message}}async copyFile(l,h){let u=1,d;try{d=await this.fileServiceClient.access(h.toString())}catch(E){return E.message}for(;d;){const E=h.displayName.replace(/\Wcopy\W\d+/,""),f=c.path.extname(E),b=`${c.path.basename(E,f)} copy ${u}${f}`;h=h.parent.resolve(b),u++;try{d=await this.fileServiceClient.access(h.toString())}catch{return}}try{return await this.fileServiceClient.copy(l.toString(),h.toString())}catch(E){return E.message}}getReadableTooltip(l){const h=l.toString(),u=this.userhomePath&&this.userhomePath.toString();return this.userhomePath&&this.userhomePath.isEqualOrParent(l)?decodeURIComponent(h.replace(u,"~")):decodeURIComponent(l.withScheme("").toString())}};t.FileTreeAPI=s,n.__decorate([(0,r.Autowired)(p.IFileServiceClient),n.__metadata("design:type",Object)],s.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(m.IWorkspaceEditService),n.__metadata("design:type",Object)],s.prototype,"workspaceEditService",void 0),n.__decorate([(0,r.Autowired)(c.CommandService),n.__metadata("design:type",Object)],s.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(o.CorePreferences),n.__metadata("design:type",Object)],s.prototype,"corePreferences",void 0),n.__decorate([(0,r.Autowired)(v.IDialogService),n.__metadata("design:type",Object)],s.prototype,"dialogService",void 0),t.FileTreeAPI=s=n.__decorate([(0,r.Injectable)()],s)},93239:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeDecorationService=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(41893),p=e(52416);let v=class{constructor(){this.disposeCollection=new o.DisposableCollection,this.onDidChangeEmitter=new o.Emitter,this.cacheDecorations=new Map,this.disposeCollection.pushAll([this.decorationsService.onDidChangeDecorations(_=>{var s,g,l;const h=(g=(s=_._data)===null||s===void 0?void 0:s._iter)===null||g===void 0?void 0:g._value;if(h){const u=new o.URI(h),d=this.getDecoration(u);this.cacheDecorations.has(h)?((l=this.cacheDecorations.get(h))===null||l===void 0?void 0:l.tooltip)!==d?.tooltip&&this.onDidChangeEmitter.fire():(this.cacheDecorations.set(h,d),this.onDidChangeEmitter.fire())}}),this.themeService.onThemeChange(()=>{this.onDidChangeEmitter.fire()})])}get onDidChange(){return this.onDidChangeEmitter.event}getDecoration(_,s=!1){_ instanceof o.URI&&(_=o.Uri.parse(_.toString()));const g=this.decorationsService.getDecoration(_,s);return g?{...g,color:this.themeService.getColor({id:g.color})}:{color:"",tooltip:"",badge:""}}dispose(){this.disposeCollection.dispose()}};t.FileTreeDecorationService=v,n.__decorate([(0,r.Autowired)(c.IDecorationsService),n.__metadata("design:type",c.IDecorationsService)],v.prototype,"decorationsService",void 0),n.__decorate([(0,r.Autowired)(p.IThemeService),n.__metadata("design:type",Object)],v.prototype,"themeService",void 0),t.FileTreeDecorationService=v=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],v)},30577:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DragAndDropService=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(53622),m=e(14951),_=e(72665),s=e(51500),g=e(6250),l=e(69959),h=r.__importDefault(e(89200)),u=r.__importDefault(e(2613)),d=e(57781),E=e(97738);let f=n=class extends p.WithEventBus{constructor(b){super(),this.model=b,this.toCancelNodeExpansion=new p.DisposableCollection,this.beingDraggedDec=new c.Decoration(h.default.mod_dragging),this.draggedOverDec=new c.Decoration(h.default.mod_dragover),this.beingDraggedNodes=[],this.dragOverTrigger=new p.ThrottledDelayer(n.MS_TILL_DRAGGED_OVER_EXPANDS),this.handleDragStart=(y,A,S)=>{y.stopPropagation();const w=O=>{this.handleDragEnd(O,A)};y.currentTarget.addEventListener("dragend",w,!1);let T=this.model.selectedFiles,D=!1;for(const O of T)O&&O.id===A.id&&(D=!0);D||(T=[A]),this.beingDraggedNodes=T,this.beingDraggedActiveUri=S;const I=T.find(O=>!l.Directory.is(O));if(I&&y.dataTransfer.setData("uri",I.uri.toString()),y.dataTransfer.setData("beingDraggedNodes",JSON.stringify(this.beingDraggedNodes.map(O=>O.uri.toString()))),I){const O=I;O.uri.scheme==="file"&&y.dataTransfer.setData("DownloadURL",`application/octet-stream:${O.displayName}:data:application/octet-stream;base64,${(0,p.encodeBase64)(p.BinaryBuffer.fromString(O.filestat.uri))}`)}if(T.forEach(O=>{this.beingDraggedDec.addTarget(O,c.TargetMatchMode.Self)}),y.dataTransfer){let O;T.length===1?O=S?S.displayName:typeof A.name=="string"?A.name:"":O=String(T.length);const M=document.createElement("div");M.className=u.default.file_tree_drag_image,M.textContent=O,document.body.appendChild(M),y.dataTransfer.setDragImage(M,-10,-10),setTimeout(()=>document.body.removeChild(M),0)}},this.handleDragEnter=(y,A)=>{y.stopPropagation(),y.preventDefault()},this.handleDragLeave=(y,A)=>{y.preventDefault(),y.stopPropagation(),this.toCancelNodeExpansion.dispose(),this.potentialParent&&(this.draggedOverDec.removeTarget(this.potentialParent),this.model.treeModel.dispatchChange())},this.handleDragOver=(y,A)=>{if(y.preventDefault(),y.stopPropagation(),!this.toCancelNodeExpansion.disposed||this.beingDraggedNodes.indexOf(A)>=0)return;this.draggedOverNode=A;const S=l.Directory.is(A)&&A.expanded?A:A.parent;(this.potentialParent!==S||!this.draggedOverDec.hasTarget(S))&&(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=S,this.draggedOverDec.addTarget(this.potentialParent,c.TargetMatchMode.SelfAndChildren),this.model.treeModel.dispatchChange()),this.potentialParent!==A&&l.Directory.is(A)&&(this.dragOverTrigger.trigger(async()=>{A.expanded?(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=A,this.draggedOverDec.addTarget(this.potentialParent,c.TargetMatchMode.SelfAndChildren)):(await A.setExpanded(!0),this.draggedOverNode===A&&(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=A,this.draggedOverDec.addTarget(this.potentialParent,c.TargetMatchMode.SelfAndChildren))),this.model.treeModel.dispatchChange()}),this.toCancelNodeExpansion.push(p.Disposable.create(()=>{this.dragOverTrigger.isTriggered()||this.dragOverTrigger.cancel()})))},this.handleDrop=async(y,A,S)=>{var w,T;this.eventBus.fire(new v.FileTreeDropEvent({event:y.nativeEvent,targetDir:S?S.codeUri.path:A&&A instanceof l.File?(w=A.parent)===null||w===void 0?void 0:w.uri.codeUri.path:A?A.uri.codeUri.path:new p.URI((T=this.workspaceService.workspace)===null||T===void 0?void 0:T.uri).codeUri.path}));try{y.preventDefault(),y.stopPropagation(),y.dataTransfer.dropEffect="copy";let D;const I=!!this.beingDraggedActiveUri;this.fileTreeService.isCompactMode&&S&&!A?.uri.isEqual(S)?D=null:A?D=l.Directory.is(A)?A:A.parent:D=this.root;let O;if(this.beingDraggedActiveUri){const M=this.fileTreeService.getNodeByPathOrUri(this.beingDraggedActiveUri);O=[new l.Directory(this.fileTreeService,M?.parent,this.beingDraggedActiveUri,this.beingDraggedActiveUri.displayName,{uri:this.beingDraggedActiveUri.toString(),isDirectory:!0,lastModification:new Date().getTime()},this.beingDraggedActiveUri.displayName)]}else if(O=this.beingDraggedNodes,!O||O.length===0)try{const M=JSON.parse(y.dataTransfer.getData("beingDraggedNodes"));M&&M.length!==0&&(O=M.map(R=>this.fileTreeService.getNodeByPathOrUri(new p.URI(R))).filter(Boolean),O.length||(O=await Promise.all(M.map(async R=>{const P=new p.URI(R);let k;const F=await this.filesystem.getFileStat(P.toString());return F?.isDirectory?k=new l.Directory(this.fileTreeService,this.root,P,P.displayName,{uri:P.toString(),isDirectory:!0,lastModification:new Date().getTime()},P.displayName):k=new l.File(this.fileTreeService,this.root,P,P.displayName,{uri:P.toString(),isDirectory:!0,lastModification:new Date().getTime()},P.displayName),k}))))}catch{}if(O.length>0){const M=S||D&&D.uri,R=O.filter(P=>P&&P.parent&&(this.beingDraggedActiveUri?!P.parent.uri.isEqual(M):!0));if(R.length>0){const P=await this.fileTreeAPI.mvFiles(R.map(k=>({url:k.uri,isDirectory:k.filestat.isDirectory})),M);if(P&&P.length>0)P.forEach(k=>{this.messageService.error(k)});else if(P){if(D)if(this.fileTreeService.isCompactMode&&I){for(const k of R)this.fileTreeService.refresh(k.parent);this.fileTreeService.refresh(D)}else for(const k of R){const F=D.uri.resolve(k.name);this.fileTreeService.moveNodeByPath(k.parent,D,k.name,k.name,k.type),k.updateMetaData({name:F.displayName,fileStat:{...k.filestat,uri:F.toString()},uri:F,tooltip:this.fileTreeAPI.getReadableTooltip(F)}),l.Directory.is(k)&&this.fileTreeService.refresh(k)}else if(A){if(this.fileTreeService.isCompactMode&&I)for(const k of R)this.fileTreeService.refresh(k.parent);else for(const k of R)this.fileTreeService.deleteAffectedNodeByPath(k.path);this.fileTreeService.refresh(A.parent)}}else return}}A&&this.beingDraggedDec.removeTarget(A),this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.beingDraggedNodes.forEach(M=>{this.beingDraggedDec.removeTarget(M)}),this.beingDraggedNodes=[],this.beingDraggedActiveUri=void 0,this.potentialParent=null,this.model.treeModel.dispatchChange(),this.toCancelNodeExpansion.disposed||this.toCancelNodeExpansion.dispose()}catch(D){this.logger.error(D)}},this.handleDragEnd=(y,A)=>{this.beingDraggedDec.removeTarget(A),this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.beingDraggedNodes.forEach(S=>{this.beingDraggedDec.removeTarget(S)}),this.beingDraggedNodes=[],this.beingDraggedActiveUri=void 0,this.potentialParent=null,this.model.treeModel.dispatchChange(),this.toCancelNodeExpansion.disposed||this.toCancelNodeExpansion.dispose()},this.model.decorations.addDecoration(this.beingDraggedDec),this.model.decorations.addDecoration(this.draggedOverDec)}get root(){return this.model.treeModel.root}};t.DragAndDropService=f,f.MS_TILL_DRAGGED_OVER_EXPANDS=500,r.__decorate([(0,o.Autowired)(g.IFileTreeAPI),r.__metadata("design:type",Object)],f.prototype,"fileTreeAPI",void 0),r.__decorate([(0,o.Autowired)(p.ILogger),r.__metadata("design:type",Object)],f.prototype,"logger",void 0),r.__decorate([(0,o.Autowired)(_.IMessageService),r.__metadata("design:type",Object)],f.prototype,"messageService",void 0),r.__decorate([(0,o.Autowired)(g.IFileTreeService),r.__metadata("design:type",d.FileTreeService)],f.prototype,"fileTreeService",void 0),r.__decorate([(0,o.Autowired)(m.IFileServiceClient),r.__metadata("design:type",Object)],f.prototype,"filesystem",void 0),r.__decorate([(0,o.Autowired)(s.IWorkspaceService),r.__metadata("design:type",Object)],f.prototype,"workspaceService",void 0),t.DragAndDropService=f=n=r.__decorate([(0,o.Injectable)(),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[E.FileTreeModelService])],f)},97738:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeModelService=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(91830),m=e(93899),_=e(26542),s=e(54414),g=e(14951),l=e(63067),h=e(53576),u=e(72665),d=e(6250),E=e(69959),f=e(2812),a=e(46377),b=r.__importDefault(e(89200)),y=e(57781),A=e(30577),{Path:S,isValidBasename:w}=p.path,{coalesce:T}=p.arrays,{trim:D,rtrim:I}=p.strings;let O=n=class{constructor(){this._isDisposed=!1,this._whenReady=new p.Deferred,this.selectedDecoration=new c.Decoration(b.default.mod_selected),this.focusedDecoration=new c.Decoration(b.default.mod_focused),this.contextMenuDecoration=new c.Decoration(b.default.mod_actived),this.loadingDecoration=new c.Decoration(b.default.mod_loading),this.cutDecoration=new c.Decoration(b.default.mod_cut),this._selectedFiles=[],this.disposableCollection=new p.DisposableCollection,this._isMultiSelected=!1,this.refreshedActionDelayer=new p.ThrottledDelayer(n.DEFAULT_REFRESHED_ACTION_DELAY),this.labelChangedDelayer=new p.ThrottledDelayer(n.DEFAULT_LABEL_CHANGED_DELAY),this.locationThrottler=new p.Throttler,this.onDidFocusedFileChangeEmitter=new p.Emitter,this.onDidContextMenuFileChangeEmitter=new p.Emitter,this.onDidSelectedFileChangeEmitter=new p.Emitter,this.onFileTreeModelChangeEmitter=new p.Emitter,this._initTreeModelReady=!1,this.clearFileSelectedDecoration=()=>{this.selectedDecoration.clearAppliedTarget(),this._selectedFiles=[]},this.activeFileDecoration=(R,P=!0)=>{this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),R&&(this.selectedFiles.length>0&&this.selectedDecoration.clearAppliedTarget(),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.selectedDecoration.addTarget(R),this.focusedDecoration.addTarget(R),this.focusedFile=R,this.selectedFiles=[R],P&&this.treeModel.dispatchChange())},this.selectFileDecoration=(R,P=!0)=>{R!==this.treeModel.root&&(this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),R&&(this.selectedFiles.length>0&&this.selectedDecoration.clearAppliedTarget(),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.selectedDecoration.addTarget(R),this._selectedFiles=[R],P&&this.treeModel.dispatchChange()))},this.activateFileActivedDecoration=R=>{this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),this.focusedFile&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this.contextMenuDecoration.addTarget(R),this.contextMenuFile=R,this.treeModel.dispatchChange()},this.activateFileFocusedDecoration=R=>{this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),this.focusedDecoration.addTarget(R),this.focusedFile=R,this.treeModel.dispatchChange()},this.activeFileFocusedDecoration=(R,P=!1)=>{R!==this.treeModel.root&&(this.focusedFile!==R&&(P?(this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.contextMenuFile=R):this.focusedFile&&(this.contextMenuFile=void 0,this.focusedDecoration.clearAppliedTarget()),R&&(this._selectedFiles.indexOf(R)<0&&(this.selectedDecoration.addTarget(R),this._selectedFiles.push(R),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(k=>k.uri))),this.focusedDecoration.addTarget(R),this.focusedFile=R)),this.treeModel.dispatchChange())},this.toggleFileSelectedDecoration=R=>{const P=this._selectedFiles.indexOf(R);P>-1?(this.focusedFile===R&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this._selectedFiles.splice(P,1),this.selectedDecoration.clearAppliedTarget()):(this._selectedFiles.push(R),this.selectedDecoration.addTarget(R),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.focusedFile=R,this.focusedDecoration.addTarget(R)),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(k=>k.uri)),this.treeModel.dispatchChange()},this.activeFileDecorationByRange=(R,P)=>{for(this.clearFileSelectedDecoration(),this.contextMenuFile=void 0;R<=P;R++){const k=this.treeModel.root.getTreeNodeAtIndex(R);k&&(this._selectedFiles.push(k),this.selectedDecoration.addTarget(k))}this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(k=>k.uri)),this.treeModel.dispatchChange()},this.deactivateFileDecoration=()=>{var R;this.focusedFile&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this.contextMenuFile&&this.contextMenuDecoration.removeTarget(this.contextMenuFile),(R=this.treeModel)===null||R===void 0||R.dispatchChange()},this.toggleDirectory=async R=>{R.expanded?this.fileTreeHandle.collapseNode(R):this.fileTreeHandle.expandNode(R)},this.handleDblClick=()=>{this.commandService.executeCommand(p.FILE_COMMANDS.NEW_FILE.id)},this.handleContextMenu=(R,P,k)=>{var F;R.stopPropagation(),R.preventDefault();let L,B;P?(B=P,this._isMultiSelected?this.selectedFiles.indexOf(B)>=0?L=this.selectedFiles:L=[B]:L=[B]):(L=[this.treeModel.root],B=this.treeModel.root),this.activateFileActivedDecoration(B),this.setFileTreeContextKey(B),this.fileTreeService.isCompactMode&&k?(this._activeUri=k,(F=this.contextKey)===null||F===void 0||F.explorerResourceIsFolder.set(!0)):k||(this._activeUri=null);const j=this.contextMenuService.createMenu({id:m.MenuId.ExplorerContext,contextKeyService:this.fileTreeService.contextMenuContextKeyService}),W=j.getMergedMenuNodes();j.dispose(),this.updateExplorerCompressedContextKey(B,k);const{x:U,y:Q}=R.nativeEvent;this.ctxMenuRenderer.show({anchor:{x:U,y:Q},menuNodes:W,args:k?[k,[k]]:[B.uri,L.map(V=>V.uri)]})},this.handleTreeBlur=()=>{var R,P,k;this._isDisposed||((P=(R=this.contextKey)===null||R===void 0?void 0:R.filesExplorerFocused)===null||P===void 0||P.set(!1),this.deactivateFileDecoration(),(k=this.contextKey)===null||k===void 0||k.explorerResourceIsFolder.set(!1))},this.handleTreeFocus=()=>{var R,P;(P=(R=this.contextKey)===null||R===void 0?void 0:R.filesExplorerFocused)===null||P===void 0||P.set(!0)},this.handleItemRangeClick=(R,P)=>{if(this.selectedFiles.length===1&&E.Directory.isRoot(this.selectedFiles[0])&&this.clearFileSelectedDecoration(),!this.focusedFile)this.handleItemClick(R,P);else if(this.focusedFile&&this.focusedFile!==R){this._isMultiSelected=!0;const k=this.treeModel.root.getIndexAtTreeNode(R),F=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);F>k?this.activeFileDecorationByRange(k,F):F<k&&this.activeFileDecorationByRange(F,k)}},this.handleItemToggleClick=(R,P)=>{this._isMultiSelected=!0,!(P!==c.TreeNodeType.CompositeTreeNode&&P!==c.TreeNodeType.TreeNode)&&(this.selectedFiles.length===1&&E.Directory.isRoot(this.selectedFiles[0])&&this.clearFileSelectedDecoration(),this.toggleFileSelectedDecoration(R))},this.handleItemClick=(R,P=this.fileTreeService.isMultipleWorkspace?c.TreeNodeType.TreeNode:c.TreeNodeType.CompositeTreeNode,k)=>{var F,L,B,j;if(this.treeModel&&(R||(R=this.treeModel.root),this.updateExplorerCompressedContextKey(R,k),this._isMultiSelected=!1,(P===c.TreeNodeType.CompositeTreeNode||P===c.TreeNodeType.TreeNode)&&this.activeFileDecoration(R),this.fileTreeService.isCompactMode&&k?(this._activeUri=k,(F=this.contextKey)===null||F===void 0||F.explorerResourceIsFolder.set(!0)):k||(this._activeUri=null,(L=this.contextKey)===null||L===void 0||L.explorerResourceIsFolder.set(P===c.TreeNodeType.CompositeTreeNode)),this.corePreferences["workbench.list.openMode"]==="singleClick")){if(P===c.TreeNodeType.CompositeTreeNode){if((B=this.contextKey)===null||B===void 0||B.explorerResourceIsFolder.set(!0),R===this.treeModel.root)return;this.toggleDirectory(R)}else if(P===c.TreeNodeType.TreeNode){if((j=this.contextKey)===null||j===void 0||j.explorerResourceIsFolder.set(!1),R===this.treeModel.root)return;this.fileTreeService.openFile(R.uri),this.mainlayoutService.bottomExpanded&&this.commandService.executeCommand(h.RETRACT_BOTTOM_PANEL.id)}}},this.handleItemDoubleClick=(R,P)=>{P===c.TreeNodeType.TreeNode?this.fileTreeService.openAndFixedFile(R.uri):this.corePreferences["workbench.list.openMode"]==="doubleClick"&&this.toggleDirectory(R)},this.validateFileName=(R,P)=>{var k;if(P=this.getWellFormedFileName(P),!P||P.length===0||/^\s+$/.test(P))return{message:(0,p.localize)("validate.tree.emptyFileNameError"),type:c.PROMPT_VALIDATE_TYPE.ERROR,value:P};if(P[0]==="/"||P[0]==="\\")return{message:(0,p.localize)("validate.tree.fileNameStartsWithSlashError"),type:c.PROMPT_VALIDATE_TYPE.ERROR,value:P};if(P[0]===" "||P[P.length-1]===" ")return{message:(0,p.localize)("validate.tree.fileNameFollowOrStartWithSpaceWarning"),type:c.PROMPT_VALIDATE_TYPE.WARNING,value:P};let F;if(R.target){const B=R.target;if(P===B.name)return null;F=B.parent}else F=R.parent;return F&&!(R instanceof c.RenamePromptHandle&&R.target.displayName.indexOf(S.separator)>0)&&((k=F.children)===null||k===void 0?void 0:k.find(W=>W.name===P))?{message:(0,p.formatLocalize)("validate.tree.fileNameExistsError",P),type:c.PROMPT_VALIDATE_TYPE.ERROR,value:P}:T(P.split(/[\\/]/)).some(B=>!w(B))?{message:(0,p.formatLocalize)("validate.tree.invalidFileNameError",this.trimLongName(P)),type:c.PROMPT_VALIDATE_TYPE.ERROR,value:P}:null},this.proxyPrompt=R=>{let P=!1;const k=async V=>{const $=await this.fileTreeService.getNodeByPathOrUri(V);$&&(E.Directory.is($)?this.selectFileDecoration($):this.location($.uri))},F=async V=>{var $,Y,z;if(this.validateMessage=void 0,R instanceof c.RenamePromptHandle){const H=R.target,K=R.target.displayName.split(S.separator),Z=H.name.indexOf(S.separator)>0;if(Z&&this.activeUri&&!R.target.uri.toString().includes(this.activeUri.toString()))return!1;const X=this.activeUri?K.length-R.target.uri.toString().replace(this.activeUri.toString(),"").split(S.separator).length:-1,ie=X===-1?[]:K.slice(0,X).concat(V);let oe=H.uri,le=H.parent.uri.resolve(V);if(Z&&(($=this.activeUri)===null||$===void 0?void 0:$.displayName)===V||!Z&&V===H.name)return!0;R.addAddonAfter("loading_indicator"),Z&&ie.length>0&&E.Directory.is(H.parent)&&(oe=H.parent.uri.resolve(K.slice(0,X+1).join(S.separator)),le=H.parent.uri.resolve(ie.concat().join(S.separator)));const pe=await this.fileTreeAPI.mv(oe,le,H.type===c.TreeNodeType.CompositeTreeNode);if(pe)return this.validateMessage={type:c.PROMPT_VALIDATE_TYPE.ERROR,message:pe,value:V},this.fileTreeService.updateRefreshable(!0),R.addValidateMessage(this.validateMessage),!1;if(this.fileTreeService.updateRefreshable(!1),R.removeAddonAfter(),!Z&&H.parent){const q=await this.fileTreeService.moveNodeByPath(H.parent,H.parent,H.name,V,H.type);q&&this.selectFileDecoration(q,!1),this.fileTreeService.updateRefreshable(!0)}else if(E.Directory.is(H)&&!E.Directory.isRoot(H)){H.updateMetaData({name:ie.concat(K.slice(X+1)).join(S.separator),uri:le,fileStat:{...H.filestat,uri:le.toString()},tooltip:this.fileTreeAPI.getReadableTooltip(le)}),this.treeModel.dispatchChange();let q;E.Directory.is(H.parent)&&(!((Y=H.parent.children)===null||Y===void 0)&&Y.find(Ee=>H.path.indexOf(Ee.path)>=0))?q=this.fileTreeService.refresh(H.parent):q=this.fileTreeService.refresh(H),q.then(()=>{k(le)})}R.removeAddonAfter()}else if(R instanceof c.NewPromptHandle){const H=R.parent,K=H.uri.resolve(V);let Z;if(R.addAddonAfter("loading_indicator"),this.fileTreeService.updateRefreshable(!0),R.type===c.TreeNodeType.CompositeTreeNode?Z=await this.fileTreeAPI.createDirectory(K):Z=await this.fileTreeAPI.createFile(K),R.removeAddonAfter(),Z)return this.validateMessage={type:c.PROMPT_VALIDATE_TYPE.ERROR,message:Z,value:V},this.fileTreeService.updateRefreshable(!1),R.addValidateMessage(this.validateMessage),!1;if(V.includes(S.separator)&&this.fileTreeService.refresh(H).then(()=>{k(H.uri.resolve(V))}),this.fileTreeService.isCompactMode)if(R.type===c.TreeNodeType.CompositeTreeNode)if((!H.children||H.children.length===0)&&!E.Directory.isRoot(H)){const ie=H.uri.resolve(V),oe=[H.name].concat(V).join(S.separator);H.updateMetaData({name:oe,uri:ie,fileStat:{...H.filestat,uri:ie.toString()},tooltip:this.fileTreeAPI.getReadableTooltip(ie)}),k(ie)}else await this.fileTreeService.addNode(H,V,R.type),k(H.uri.resolve(V));else await this.fileTreeService.addNode(H,V,R.type),k(H.uri.resolve(V));else await this.fileTreeService.addNode(H,V,R.type),k(H.uri.resolve(V))}return(z=this.contextKey)===null||z===void 0||z.filesExplorerInputFocused.set(!1),!0},L=async V=>{var $,Y,z,H;if(this.validateMessage&&this.validateMessage.type===c.PROMPT_VALIDATE_TYPE.ERROR)return this.validateMessage=void 0,!0;if(P)return!1;if(!V){($=this.contextKey)===null||$===void 0||$.explorerCompressedFocusContext.set(!1),(Y=this.contextKey)===null||Y===void 0||Y.explorerCompressedFirstFocusContext.set(!1),(z=this.contextKey)===null||z===void 0||z.explorerCompressedLastFocusContext.set(!1),this.fileTreeService.isCompactMode&&R instanceof c.NewPromptHandle&&this.fileTreeService.refresh(R.parent);return}return(H=this.contextKey)===null||H===void 0||H.filesExplorerInputFocused.set(!1),await F(V),!0},B=async V=>{if(P=!0,this.validateMessage&&this.validateMessage.type===c.PROMPT_VALIDATE_TYPE.ERROR)return!1;if(V.trim()===""||this.validateMessage&&this.validateMessage.type!==c.PROMPT_VALIDATE_TYPE.ERROR)return this.validateMessage=void 0,!0;const $=await F(V);return P=!1,!!$},j=async()=>{var V;(V=this.contextKey)===null||V===void 0||V.filesExplorerInputFocused.set(!0)},W=()=>{var V;this.fileTreeService.updateRefreshable(!0),(V=this.contextKey)===null||V===void 0||V.filesExplorerInputFocused.set(!1),this.contextMenuFile&&this.selectFileDecoration(this.contextMenuFile,!0)},U=()=>{var V;(V=this.contextKey)===null||V===void 0||V.filesExplorerInputFocused.set(!1),this.fileTreeService.isCompactMode&&R instanceof c.NewPromptHandle&&this.fileTreeService.refresh(R.parent)},Q=V=>{const $=this.validateFileName(R,V);$?(this.validateMessage=$,R.addValidateMessage($)):!$&&this.validateMessage&&this.validateMessage.value!==V&&(this.validateMessage=void 0,R.removeValidateMessage())};R.destroyed||(this.fileTreeService.updateRefreshable(!1),R.onChange(Q),R.onCommit(B),R.onBlur(L),R.onFocus(j),R.onDestroy(W),R.onCancel(U))},this.copyFile=async R=>{var P;this.pasteStore&&this.pasteStore.type===d.PasteTypes.CUT&&(this._pasteStore.files.forEach(F=>{F&&this.cutDecoration.removeTarget(F)}),(P=this.contextKey)===null||P===void 0||P.explorerResourceCut.set(!1)),this.treeModel.dispatchChange();const k=[];for(const F of R){const L=this.fileTreeService.getNodeByPathOrUri(F);L&&k.push(L)}this._pasteStore={files:k,type:d.PasteTypes.COPY},this.clipboardService.writeResources(R)},this.pasteFile=async R=>{var P,k;let F=!1,L=this.fileTreeService.getNodeByPathOrUri(R.toString());if(!L)return;let B=this.pasteStore,j=!1;if(!B){const W=await this.clipboardService.readResources();if(!W||!W.length)return;B={files:[],type:d.PasteTypes.COPY,crossFiles:W},j=!0}if(B){if(E.Directory.is(L)||(F=!0,L=L.parent),j){const W=(0,p.localize)("file.confirm.paste.ok"),U=(0,p.localize)("file.confirm.paste.cancel");if(await this.dialogService.warning((0,p.formatLocalize)("file.confirm.paste",`[ ${(P=B.crossFiles)===null||P===void 0?void 0:P.map(V=>V.displayName).join(",")} ]`,E.Directory.isRoot(L)?L.uri.displayName:L.displayName),[U,W])!==W)return}if(B.type===d.PasteTypes.CUT){for(const U of B.files)U&&this.cutDecoration.removeTarget(U),L.expanded||await L.setExpanded(!0);const W=await this.fileTreeAPI.mvFiles(B.crossFiles?B.crossFiles.map(U=>{var Q;return{url:U,isDirectory:((Q=this.fileTreeService.getNodeByPathOrUri(U))===null||Q===void 0?void 0:Q.filestat.isDirectory)||!1}}):B.files.map(U=>({url:U.uri,isDirectory:U.filestat.isDirectory})),L.uri);W&&W.length>0&&(W.forEach(U=>{this.messageService.error(U)}),this.fileTreeService.refresh()),(k=this.contextKey)===null||k===void 0||k.explorerResourceCut.set(!1),this.treeModel.dispatchChange(),this._pasteStore={files:[],type:d.PasteTypes.NONE,crossFiles:void 0}}else if(B.type===d.PasteTypes.COPY){const W=B.crossFiles?B.crossFiles:B.files.map(U=>U.uri);for(const U of W){L.uri.isEqual(U)&&!F&&(L=L.parent);const Q=L.uri.resolve(U.displayName);L.expanded||await L.setExpanded(!0);const V=await this.fileTreeAPI.copyFile(U,Q);if(V)if(V.uri){const $=new p.URI(V.uri),Y=await this.filesystem.getFileStat(U.toString());this.fileTreeService.addNode(L,$.displayName,Y?.isDirectory?c.TreeNodeType.CompositeTreeNode:c.TreeNodeType.TreeNode)}else this.messageService.error(`Error when copy file: ${U.toString()}, ${V}`)}}}},this.cutFile=async R=>{var P;R.length>0&&((P=this.contextKey)===null||P===void 0||P.explorerResourceCut.set(!0)),this._pasteStore&&this._pasteStore.type===d.PasteTypes.CUT&&this._pasteStore.files.forEach(F=>{this.cutDecoration.removeTarget(F)});const k=[];for(const F of R){const L=this.fileTreeService.getNodeByPathOrUri(F);L&&k.push(L)}this._pasteStore={files:k,type:d.PasteTypes.CUT};for(const F of k)F&&this.cutDecoration.addTarget(F);this.treeModel.dispatchChange()},this.location=async R=>{if(await this.whenReady,!this.fileTreeService.filterMode)return this._fileToLocation=R,this.locationThrottler.queue(this.doLocation)},this.doLocation=async()=>{if(!this._fileToLocation)return;const R=this._fileToLocation;let P;if(typeof R=="string"?P=R:P=await this.fileTreeService.getFileTreeNodePathByUri(R),P){if(!this.fileTreeHandle)return;const k=await this.fileTreeHandle.ensureVisible(P,"center",!0);k&&this.selectFileDecoration(k)}this._fileToLocation=void 0},this.locationOnShow=R=>{this._nextLocationTarget=R},this.performLocationOnHandleShow=async()=>{this._nextLocationTarget&&(await this.location(this._nextLocationTarget),this._nextLocationTarget=void 0)}}get onDidFocusedFileChange(){return this.onDidFocusedFileChangeEmitter.event}get onDidContextMenuFileChange(){return this.onDidContextMenuFileChangeEmitter.event}get onDidSelectedFileChange(){return this.onDidSelectedFileChangeEmitter.event}get onFileTreeModelChange(){return this.onFileTreeModelChangeEmitter.event}get fileTreeHandle(){return this._fileTreeHandle}get decorations(){return this._decorations}get treeModel(){return this._treeModel}get dndService(){return this._dndService}get whenReady(){return this._whenReady.promise}get focusedFile(){return this._focusedFile}set focusedFile(R){this.onDidFocusedFileChangeEmitter.fire(R?R.uri:void 0),this._focusedFile=R}get contextMenuFile(){return this._contextMenuFile}set contextMenuFile(R){this.onDidContextMenuFileChangeEmitter.fire(R?R.uri:void 0),this._contextMenuFile=R}get selectedFiles(){return this._selectedFiles}set selectedFiles(R){this.onDidSelectedFileChangeEmitter.fire(R?R.map(P=>P.uri):[]),this._selectedFiles=R}get activeUri(){return this._activeUri}get pasteStore(){return this._pasteStore}get explorerStorage(){return this._explorerStorage}get currentRelativeUriContextKey(){return this._currentRelativeUriContextKey||(this._currentRelativeUriContextKey=this.fileTreeService.contextMenuContextKeyService.createKey("filetreeContextRelativeUri","")),this._currentRelativeUriContextKey}get currentContextUriContextKey(){return this._currentContextUriContextKey||(this._currentContextUriContextKey=this.fileTreeService.contextMenuContextKeyService.createKey("filetreeContextUri","")),this._currentContextUriContextKey}get contextMenuResourceContext(){return this._contextMenuResourceContext||(this._contextMenuResourceContext=new v.ResourceContextKey(this.fileTreeService.contextMenuContextKeyService)),this._contextMenuResourceContext}get contextKey(){return this.fileTreeService.contextKey}get initTreeModelReady(){return this._initTreeModelReady}async initTreeModel(){this._initTreeModelReady=!1;const R=(await this.fileTreeService.resolveChildren())[0];if(!R){this._whenReady.resolve();return}this._treeModel=this.injector.get(f.FileTreeModel,[R]),this.initDecorations(R),this._dndService=this.injector.get(A.DragAndDropService,[this]),this.treeStateWatcher=this._treeModel.getTreeStateWatcher(!0),this.disposableCollection.push(this.fileTreeService.onNodeRefreshed(()=>{this.initTreeModelReady&&(this.refreshedActionDelayer.isTriggered()||this.refreshedActionDelayer.cancel(),this.refreshedActionDelayer.trigger(async()=>{if(this.selectedFiles.length===0){const k=this.editorService.currentEditor;k&&k.currentUri&&this.location(k.currentUri)}this.fileTreeService.isCompactMode||(this._activeUri=null)}))})),this.disposableCollection.push(this.fileTreeService.onWorkspaceChange(()=>{this.disposableCollection.dispose(),this.initTreeModel()})),this.disposableCollection.push(this.labelService.onDidChange(async()=>{this.initTreeModelReady&&(this.labelChangedDelayer.isTriggered()||this.labelChangedDelayer.cancel(),this.labelChangedDelayer.trigger(async()=>{this.fileTreeService.refresh()}))})),this.disposableCollection.push(this.treeModel.root.watcher.on(c.TreeNodeEvent.WillResolveChildren,k=>{this.loadingDecoration.addTarget(k),this.treeModel.dispatchChange()})),this.disposableCollection.push(this.treeModel.root.watcher.on(c.TreeNodeEvent.DidResolveChildren,k=>{this.loadingDecoration.clearAppliedTarget(),this.treeModel.dispatchChange()})),this._explorerStorage=await this.storageProvider(p.STORAGE_NAMESPACE.EXPLORER);const P=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY);P&&await this.loadFileTreeSnapshot(P),this.disposableCollection.push(this.treeStateWatcher.onDidChange(()=>{if(!this._initTreeModelReady)return;const k=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),F=this.treeStateWatcher.snapshot();this.explorerStorage.set(n.FILE_TREE_SNAPSHOT_KEY,{...k,...F})})),this.fileTreeService.startWatchFileEvent(),this.onFileTreeModelChangeEmitter.fire(this._treeModel),this._whenReady.resolve(),this._initTreeModelReady=!0}initDecorations(R){this._decorations=new c.DecorationsManager(R),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.contextMenuDecoration),this._decorations.addDecoration(this.cutDecoration),this._decorations.addDecoration(this.loadingDecoration)}setFileTreeContextKey(R){var P;this.currentContextUriContextKey.set(R.uri.toString()),this.currentRelativeUriContextKey.set((this.treeModel.root.uri.relative(R.uri)||"").toString()),this.contextMenuResourceContext.set(R.uri),(P=this.contextKey)===null||P===void 0||P.explorerResourceIsFolder.set(R&&R.type===c.TreeNodeType.CompositeTreeNode)}async loadFileTreeSnapshot(R){await this._treeModel.loadTreeState(R)}updateExplorerCompressedContextKey(R,P){var k,F,L,B,j,W,U,Q,V,$,Y,z,H,K,Z,X;if(R&&P){(k=this.contextKey)===null||k===void 0||k.explorerCompressedFocusContext.set(!0);const ie=new S(R.name);ie.name===P.displayName?((F=this.contextKey)===null||F===void 0||F.explorerCompressedLastFocusContext.set(!0),(L=this.contextKey)===null||L===void 0||L.explorerCompressedFirstFocusContext.set(!1)):ie.root&&ie.root.name===P.displayName?((B=this.contextKey)===null||B===void 0||B.explorerCompressedLastFocusContext.set(!1),(j=this.contextKey)===null||j===void 0||j.explorerCompressedFirstFocusContext.set(!0)):((W=this.contextKey)===null||W===void 0||W.explorerCompressedLastFocusContext.set(!1),(U=this.contextKey)===null||U===void 0||U.explorerCompressedFirstFocusContext.set(!1))}else R?R.name.indexOf(S.separator)>0?((Q=this.contextKey)===null||Q===void 0||Q.explorerCompressedFocusContext.set(!0),(V=this.contextKey)===null||V===void 0||V.explorerCompressedFirstFocusContext.set(!1),($=this.contextKey)===null||$===void 0||$.explorerCompressedLastFocusContext.set(!0)):((Y=this.contextKey)===null||Y===void 0||Y.explorerCompressedFocusContext.set(!1),(z=this.contextKey)===null||z===void 0||z.explorerCompressedFirstFocusContext.set(!1),(H=this.contextKey)===null||H===void 0||H.explorerCompressedLastFocusContext.set(!1)):((K=this.contextKey)===null||K===void 0||K.explorerCompressedFocusContext.set(!1),(Z=this.contextKey)===null||Z===void 0||Z.explorerCompressedFirstFocusContext.set(!1),(X=this.contextKey)===null||X===void 0||X.explorerCompressedLastFocusContext.set(!1))}handleTreeHandler(R){this._fileTreeHandle=R}toggleOrOpenCurrentFile(){let R;this.focusedFile?R=this.focusedFile:this.contextMenuFile&&(R=this.contextMenuFile),R&&(this.activeFileDecoration(R),E.Directory.is(R)?this.toggleDirectory(R):this.fileTreeService.openFile(R.uri))}moveToNext(){let R;if(this.focusedFile?R=this.focusedFile:this.contextMenuFile&&(R=this.contextMenuFile),!R)return;const k=this.treeModel.root.getIndexAtTreeNode(R)+1,F=this.treeModel.root.getTreeNodeAtIndex(k),L=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),B=(k+1)*a.FILE_TREE_NODE_HEIGHT-(L.scrollPosition||0),{height:j}=this.fileTreeHandle.getCurrentSize();F&&(this.activateFileFocusedDecoration(F),B>j&&this.fileTreeHandle.ensureVisible(F,"end"))}moveToPrev(){let R;if(this.focusedFile?R=this.focusedFile:this.contextMenuFile&&(R=this.contextMenuFile),!R)return;const P=this.treeModel.root.getIndexAtTreeNode(R);if(P===0)return;const k=P-1,F=this.treeModel.root.getTreeNodeAtIndex(k);if(!F)return;const L=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),B=k*a.FILE_TREE_NODE_HEIGHT;this.activateFileFocusedDecoration(F),(L.scrollPosition||0)>B&&this.fileTreeHandle.ensureVisible(F,"start")}async collapseCurrentFile(){let R;this.focusedFile?(R=this.focusedFile,this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0):this.contextMenuFile&&(R=this.contextMenuFile,this.focusedDecoration.removeTarget(this.contextMenuFile),this.contextMenuFile=void 0);const P=this.selectedFiles.indexOf(R);P>=0&&(this.selectedFiles.splice(P,1),this.selectedDecoration.removeTarget(R));let k;if(E.Directory.is(R)&&R.expanded)k=R;else if(R)E.Directory.isRoot(R.parent)?k=R:k=R.parent;else return;this.focusedFile=k,k&&k.expanded&&(await this.fileTreeHandle.collapseNode(k),this.activeFileFocusedDecoration(k,!0))}async expandCurrentFile(){let R;this.focusedFile?(R=this.focusedFile,this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0):this.contextMenuFile&&(R=this.contextMenuFile,this.focusedDecoration.removeTarget(this.contextMenuFile),this.contextMenuFile=void 0);const P=this.selectedFiles.indexOf(R);P>=0&&(this.selectedFiles.splice(P,1),this.selectedDecoration.removeTarget(R)),this.focusedFile=R,E.Directory.is(R)&&(R.expanded||await this.fileTreeHandle.expandNode(R))}async collapseAll(){await this.treeModel.root.collapsedAll();const R=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY);R&&this.explorerStorage.set(n.FILE_TREE_SNAPSHOT_KEY,{...R,expandedDirectories:{atSurface:[],buried:[]}})}async deleteFileByUris(R){var P;if(R.length===0)return;if(this.corePreferences["explorer.confirmDelete"]){const B=this.applicationService.backendOS===p.OperatingSystem.Linux,j=B?(0,p.localize)("file.confirm.delete.ok"):(0,p.localize)("file.confirm.moveToTrash.ok"),W=(0,p.localize)("file.confirm.delete.cancel"),U=10;let Q=R.slice(0,U).map($=>$.displayName).join(`
|
|
31620
31620
|
`);if(R.length>U&&(Q+=`
|
|
31621
31621
|
...`),B||(Q+=`
|
|
31622
31622
|
|