@opensumi/cli-engine 3.8.3-next-1747643756.0 → 3.8.3-next-1747658811.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.
@@ -31838,9 +31838,9 @@ ${m.join(`
31838
31838
  \`\`\`${m.languageId} ${m.path}
31839
31839
  ${m.content}
31840
31840
  \`\`\`
31841
- </current_opened_file>`:""}};t.DefaultChatAgentPromptProvider=p,n.__decorate([(0,r.Autowired)(o.WorkbenchEditorService),n.__metadata("design:type",o.WorkbenchEditorService)],p.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(a.IWorkspaceService),n.__metadata("design:type",Object)],p.prototype,"workspaceService",void 0),t.DefaultChatAgentPromptProvider=p=n.__decorate([(0,r.Injectable)()],p)},69820:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EPartialEdit=t.MCP_SERVER_TYPE=t.NearestCodeBlockType=void 0;var e;(function(o){o.Block="block",o.Line="line"})(e||(t.NearestCodeBlockType=e={}));var n;(function(o){o.STDIO="stdio",o.SSE="sse",o.BUILTIN="builtin"})(n||(t.MCP_SERVER_TYPE=n={}));var r;(function(o){o.accept="accept",o.discard="discard"})(r||(t.EPartialEdit=r={}))},98864:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cleanAttachedTextWrapper=t.getToolName=t.extractCodeBlocks=t.isDocumentValid=t.isDocumentTooShort=t.isDocumentTooLarge=void 0;const n=e(19413),r="```",o=10,a=g=>{try{g.getText()}catch(l){if(l instanceof RangeError)return!0}return!1};t.isDocumentTooLarge=a;const p=g=>g.getText().length<o;t.isDocumentTooShort=p;const v=g=>!((0,t.isDocumentTooLarge)(g)||(0,t.isDocumentTooShort)(g));t.isDocumentValid=v;const m=g=>{const l=g.split(`
31842
- `);let h=[],u=!1,d=0;return l.forEach((E,f)=>{if(!u&&E.trim().startsWith(r))u=!0,d=f+1;else if(u&&E.trim().startsWith(r)){u=!1;const c=f;h=l.slice(d,c)}u&&d!==f+1&&h.push(E)}),h.join(`
31843
- `)};t.extractCodeBlocks=m;const _=(g,l)=>l===n.BUILTIN_MCP_SERVER_NAME?g:`mcp_${l}_${g}`;t.getToolName=_;const s=g=>{const l=/`<attached_file>(.*)`/g,h=/`<attached_folder>(.*)`/g;return g=g.replace(l,"$1"),g=g.replace(h,"$1"),g};t.cleanAttachedTextWrapper=s},26471:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(19413),t)},15504:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentReactions=t.CommentReactionSwitcher=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),a=e(81878),p=e(25918),v=e(93899),m=e(52416),_=e(69635),s=n.__importDefault(e(38877)),g=({thread:h,comment:u,className:d})=>{const E=`${h.providerId}_${h.id}_${u.id}`,f=`${v.MenuId.CommentReactionSwitcherMenu}_${E}`,c=(0,o.useInjectable)(v.IMenuRegistry),y=(0,o.useInjectable)(v.AbstractMenuService);r.default.useEffect(()=>{const A=new o.Disposable,S=`${v.MenuId.CommentReactionSwitcherSubmenu}_${E}`;return A.addDispose(c.registerMenuItem(f,{submenu:S,label:S,iconClass:(0,o.getExternalIcon)("reactions"),group:"navigation"})),A.addDispose(c.registerMenuItems(S,u.reactions.map(D=>({command:{id:_.SwitchCommandReaction,label:D.label},extraTailArgs:[{thread:h,comment:u,reaction:D}]})))),()=>A.dispose()},[]);const b=r.default.useMemo(()=>y.createMenu(f),[]);return r.default.createElement(p.InlineActionBar,{className:d,menus:b,regroup:A=>[A,[]],type:"icon"})};t.CommentReactionSwitcher=g;const l=({thread:h,comment:u})=>{var d;const E=(0,o.useInjectable)(o.IEventBus),f=(0,o.useInjectable)(m.IIconService),c=r.default.useCallback(y=>{E.fire(new _.CommentReactionClick({thread:h,comment:u,reaction:y}))},[]);return r.default.createElement("div",{className:s.default.comment_reactions},(d=u.reactions)===null||d===void 0?void 0:d.filter(y=>y.count!==0).map(y=>r.default.createElement(a.Button,{key:y.label,onClick:()=>c(y),type:"secondary",size:"small",title:y.label,className:s.default.comment_reaction,iconClass:f.fromIcon("",y.iconPath.toString(),m.IconType.Background)},"\xA0",y.count)))};t.CommentReactions=l},54143:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsBody=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=n.__importDefault(e(43144)),a=e(84605),p=n.__importDefault(e(38877)),v=e(70154),m=({root:_,children:s})=>o.default.createPortal(s,_);t.CommentsBody=r.default.memo(({body:_})=>{const s=r.default.useRef(null),[g,l]=r.default.useState(null),h=r.default.useMemo(()=>{const u=(0,a.createMarkedRenderer)();return u.link=({href:d,title:E,text:f})=>`<a target="_blank" rel="noopener" href="${d}" title="${E||""}">${f}</a>`,u},[]);return r.default.useEffect(()=>{if(s.current){const u=s.current.attachShadow({mode:"open"});g||l(u)}},[]),r.default.createElement("div",{ref:s,className:p.default.comment_shadow_box},g&&r.default.createElement(m,{root:g},r.default.createElement("style",null,v.markdownCss),r.default.createElement("div",{dangerouslySetInnerHTML:{__html:(0,a.toMarkdownHtml)(typeof _=="string"?_:_.value,{gfm:!0,breaks:!1,pedantic:!1,renderer:h})}})))})},66480:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsFeatureRegistry=void 0;const n=e(85608),r=e(76003);let o=class{constructor(){this.config={},this.options={},this.panelTreeNodeHandlers=[],this.mentionsOptions={},this.providerFeature=new Map}registerConfig(p){this.config={...this.config,...p}}registerPanelTreeNodeHandler(p){this.panelTreeNodeHandlers.push(p)}registerPanelOptions(p){this.options={...this.options,...p}}registerFileUploadHandler(p){this.fileUploadHandler=p}registerMentionsOptions(p){this.mentionsOptions=p}registerZoneWidgetRender(p){this.zoneWidgetRender=p}getConfig(){return this.config}getCommentsPanelOptions(){return this.options}getCommentsPanelTreeNodeHandlers(){return this.panelTreeNodeHandlers}getFileUploadHandler(){return this.fileUploadHandler}getMentionsOptions(){return this.mentionsOptions}getZoneWidgetRender(){return this.zoneWidgetRender}registerProviderFeature(p,v){this.providerFeature.set(p,v)}getProviderFeature(p){return this.providerFeature.get(p)}};t.CommentsFeatureRegistry=o,t.CommentsFeatureRegistry=o=n.__decorate([(0,r.Injectable)()],o)},37357:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentItem=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(97267),a=e(41869),p=e(25918),v=e(93899),m=e(69635),_=e(15504),s=e(54143),g=e(42018),l=n.__importDefault(e(38877)),h=({timestamp:f})=>{const c=r.default.useMemo(()=>{const y=new Date(f);return(0,a.toLocalString)(y)},[f]);return r.default.createElement("span",{className:l.default.comment_item_timestamp},c)},u=(f,c)=>{const y=(0,a.useInjectable)(v.AbstractMenuService),{body:b,contextValue:A}=c,[S,D]=r.default.useState(""),I=(0,a.useInjectable)(m.ICommentsFeatureRegistry),w=r.default.useMemo(()=>I.getFileUploadHandler(),[]);r.default.useEffect(()=>{D(b)},[b]);const T=r.default.useMemo(()=>f.createScoped(),[]),R=r.default.useMemo(()=>T.createKey("commentIsEmpty",!c.body),[]),P=r.default.useMemo(()=>y.createMenu(v.MenuId.CommentsCommentContext,T),[]),O=r.default.useMemo(()=>y.createMenu(v.MenuId.CommentsCommentTitle,T),[]),M=r.default.useRef(T.createKey("comment",A));r.default.useEffect(()=>{M.current.set(A)},[A]);const k=r.default.useCallback(L=>{R.set(!L.target.value),D(L.target.value)},[]),F=r.default.useCallback(async L=>{if(w){const B=await w(S,L);D(U=>{const W=U+B;return R.set(!W),W})}},[S]);return[S,D,k,P,O,F]},d=({reply:f,thread:c})=>{var y;const{contextKeyService:b}=c,{author:A,label:S,body:D,mode:I,timestamp:w}=f,T=(y=A.iconPath)===null||y===void 0?void 0:y.toString(),[R,P,O,M,k,F]=u(b,f),L=r.default.useMemo(()=>{const B=(0,a.toMarkdownHtml)(typeof D=="string"?D:D.value);return/^\<p\>[^<>]+\<\/p\>\n$/.test(B)},[D]);return r.default.createElement("div",{className:l.default.reply_item},(0,a.isUndefined)(I)||I===m.CommentMode.Preview?r.default.createElement("div",null,L?r.default.createElement(r.default.Fragment,null,T&&r.default.createElement("img",{className:l.default.reply_item_icon,src:T,alt:A.name}),r.default.createElement("span",{className:l.default.comment_item_author_name},A.name),w&&r.default.createElement(h,{timestamp:w}),typeof S=="string"?r.default.createElement("span",{className:l.default.comment_item_label},S):S," : ",r.default.createElement("span",{className:l.default.comment_item_body},typeof D=="string"?D:D.value),f.reactions&&f.reactions.length>0&&r.default.createElement(_.CommentReactionSwitcher,{className:l.default.reply_item_title,thread:c,comment:f}),r.default.createElement(p.InlineActionBar,{separator:"inline",className:l.default.reply_item_title,menus:k,context:[{thread:c,comment:f,menuId:v.MenuId.CommentsCommentTitle}],type:"icon"})):r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:l.default.comment_item_markdown_header},r.default.createElement("div",null,T&&r.default.createElement("img",{className:l.default.reply_item_icon,src:T,alt:A.name}),r.default.createElement("span",{className:l.default.comment_item_author_name},A.name),w&&r.default.createElement(h,{timestamp:w}),typeof S=="string"?r.default.createElement("span",{className:l.default.comment_item_label},S):S," : "),r.default.createElement(p.InlineActionBar,{separator:"inline",className:l.default.reply_item_title,menus:k,context:[{thread:c,comment:f,menuId:v.MenuId.CommentsCommentTitle}],type:"icon"})),r.default.createElement(s.CommentsBody,{body:D}))):r.default.createElement("div",null,r.default.createElement(g.CommentsTextArea,{value:typeof R=="string"?R:R.value,autoFocus:!0,onChange:O,dragFiles:F}),r.default.createElement(p.InlineActionBar,{className:l.default.comment_item_reply,menus:M,context:[{thread:c,comment:f,body:R,menuId:v.MenuId.CommentsCommentContext}],type:"button",separator:"inline",afterClick:()=>{P(D)}})),f.reactions&&f.reactions.length>0&&r.default.createElement(_.CommentReactions,{thread:c,comment:f}))},E=({thread:f,commentThreadContext:c,widget:y})=>{var b,A;const[S,D]=r.default.useState(!1),[I,w]=r.default.useState(""),{contextKeyService:T}=f,R=(0,a.useAutorun)(f.readOnly),[P,...O]=(0,a.useAutorun)(f.comments),{author:M,label:k,body:F,mode:L,timestamp:B}=P,U=(0,a.isString)(M.iconPath)?M.iconPath:!((b=M.iconPath)===null||b===void 0)&&b.authority?(A=M.iconPath)===null||A===void 0?void 0:A.toString():"",[W,j,Q,G,Z,$]=u(T,P),V=(0,a.useInjectable)(m.ICommentsFeatureRegistry),H=r.default.useMemo(()=>V.getFileUploadHandler(),[]),K=r.default.useMemo(()=>T.createKey("commentIsEmpty",!0),[]);function Y(oe){K.set(!oe.target.value),w(oe.target.value)}const X=r.default.useCallback(async oe=>{if(H){const ie=await H(W,oe);w(he=>{const me=he+ie;return K.set(!me),me})}},[I]);return r.default.createElement("div",{className:l.default.comment_item},U&&r.default.createElement("img",{className:l.default.comment_item_icon,src:U,alt:M.name}),r.default.createElement("div",{className:l.default.comment_item_content},r.default.createElement("div",{className:l.default.comment_item_head},r.default.createElement("div",{className:l.default.comment_item_name},r.default.createElement("span",{className:l.default.comment_item_author_name},M.name),B&&r.default.createElement(h,{timestamp:B}),typeof k=="string"?r.default.createElement("span",{className:l.default.comment_item_label},k):k),r.default.createElement("div",{className:l.default.comment_item_actions},P.reactions&&P.reactions.length>0&&r.default.createElement(_.CommentReactionSwitcher,{thread:f,comment:P}),!R&&r.default.createElement(o.Button,{className:l.default.comment_item_reply_button,size:"small",type:"secondary",onClick:()=>D(!0)},(0,a.localize)("comments.thread.action.reply")),r.default.createElement(p.InlineActionBar,{menus:Z,context:[{thread:f,comment:P,menuId:v.MenuId.CommentsCommentTitle}],type:"button"}))),(0,a.isUndefined)(L)||L===m.CommentMode.Preview?r.default.createElement(s.CommentsBody,{body:F}):r.default.createElement("div",null,r.default.createElement(g.CommentsTextArea,{value:typeof W=="string"?W:W.value,autoFocus:!0,onChange:Q,dragFiles:$}),r.default.createElement(p.InlineActionBar,{className:l.default.comment_item_context,menus:G,context:[{thread:f,comment:P,body:W,menuId:v.MenuId.CommentsCommentContext}],separator:"inline",type:"button",afterClick:()=>{j(F)}})),P.reactions&&P.reactions.length>0&&r.default.createElement(_.CommentReactions,{thread:f,comment:P}),(O.length>0||S)&&r.default.createElement("div",{className:l.default.comment_item_reply_wrap},O.map(oe=>r.default.createElement(d,{key:oe.id,thread:f,reply:oe})),S&&r.default.createElement("div",null,r.default.createElement(g.CommentsTextArea,{autoFocus:!0,value:I,onChange:Y,placeholder:`${(0,a.localize)("comments.reply.placeholder")}...`,dragFiles:X}),r.default.createElement(p.InlineActionBar,{className:l.default.comment_item_reply,menus:c,context:[{thread:f,text:I,widget:y,menuId:v.MenuId.CommentsCommentThreadContext}],separator:"inline",type:"button",afterClick:()=>{w(""),D(!1)}})))))};t.CommentItem=E},53878:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsPanel=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),a=e(41869),p=e(69635),v=n.__importDefault(e(38877)),m=e(5167),_=e(47842),s=({viewState:g})=>{const l=(0,a.useInjectable)(_.CommentModelService),[h,u]=(0,r.useState)(),d=(0,r.useRef)(null),E=(0,a.useInjectable)(p.ICommentsFeatureRegistry),{handleTreeBlur:f}=l;(0,r.useEffect)(()=>{u(l.treeModel);const I=l.onDidUpdateTreeModel(w=>{u(w)});return()=>{I.dispose()}},[]);const c=(0,r.useCallback)(I=>{l.handleTreeHandler(I)},[l]),y=(0,r.useCallback)(I=>r.default.createElement(m.CommentNodeRendered,{item:I.item,itemType:I.itemType,decorations:l.decorations.getDecorations(I.item),defaultLeftPadding:8,onTwistierClick:l.handleTwistierClick,onClick:l.handleItemClick,leftPadding:8}),[h]),b=(0,r.useMemo)(()=>E.getCommentsPanelOptions(),[]),A=(0,r.useMemo)(()=>b.header,[b]),S=(0,r.useMemo)(()=>r.default.createElement("div",{className:v.default.panel_placeholder},b.defaultPlaceholder||(0,a.localize)("comments.panel.placeholder")),[b]),D=(0,r.useCallback)(()=>h?r.default.createElement(o.RecycleTree,{height:g.height-(A?.height||0),itemHeight:m.COMMENT_TREE_NODE_HEIGHT,onReady:c,model:h,placeholder:()=>S},y):S,[h,A,g.height]);return r.default.createElement("div",{className:v.default.comment_panel,tabIndex:-1,onBlur:f,ref:d},A?.component,D())};t.CommentsPanel=s},42018:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsTextArea=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(34801),a=e(97267),p=e(41869),v=e(69635),m=e(54143),_=n.__importDefault(e(38877)),s=e(73136),g="@",l="@[__display__](__id__)",h=(u,d)=>`@${d}`;t.CommentsTextArea=r.default.forwardRef((u,d)=>{const{focusDelay:E=0,autoFocus:f=!1,placeholder:c="",onFocus:y,onBlur:b,onChange:A,maxRows:S=10,minRows:D=2,value:I,initialHeight:w,dragFiles:T}=u,[R,P]=r.default.useState(0),O=(0,p.useInjectable)(v.ICommentsFeatureRegistry),M=r.default.useRef(null),k=r.default.useRef(null),F=r.default.useRef(null);r.default.useImperativeHandle(d,()=>M.current);const L=r.default.useCallback(async Z=>{var $;Z.stopPropagation(),Z.preventDefault();const V=($=Z.clipboardData)===null||$===void 0?void 0:$.files;V&&T&&await T(V),M.current&&(M.current.focus(),W(M.current.value))},[T]),B=r.default.useCallback(async Z=>{var $;Z.stopPropagation(),Z.preventDefault();const V=($=Z.dataTransfer)===null||$===void 0?void 0:$.files;V&&T&&await T(V),M.current&&(M.current.focus(),W(M.current.value))},[T]),U=r.default.useCallback(Z=>{Z.stopPropagation(),Z.preventDefault(),Z.dataTransfer.dropEffect="copy"},[]),W=r.default.useCallback(Z=>{const $=M.current;if($){const V=Z.toString().length;$.setSelectionRange(V,V)}},[]);r.default.useEffect(()=>{var Z;const $=M.current;if(!$)return;w&&$.style&&($.style.height=w),E&&setTimeout(()=>{$.focus({preventScroll:!0})},E),W(I);function V(H){var K,Y,X;const oe=H.target;oe&&(oe.nodeName.toUpperCase()==="TEXTAREA"&&oe.scrollHeight>oe.clientHeight||oe.nodeName.toUpperCase()==="UL"||((K=oe.parentElement)===null||K===void 0?void 0:K.nodeName.toUpperCase())==="UL"||((X=(Y=oe.parentElement)===null||Y===void 0?void 0:Y.parentElement)===null||X===void 0?void 0:X.nodeName.toUpperCase())==="UL")&&H.stopPropagation()}return(Z=k.current)===null||Z===void 0||Z.addEventListener("mousewheel",V,!0),()=>{var H;(H=k.current)===null||H===void 0||H.removeEventListener("mousewheel",V,!0)}},[]),r.default.useEffect(()=>{R===0&&(setTimeout(()=>{var Z;(Z=M.current)===null||Z===void 0||Z.focus({preventScroll:!0})},E),W(I))},[R]);const j=r.default.useMemo(()=>(0,s.getMentionBoxStyle)({minRows:D,maxRows:S}),[D,S]),Q=r.default.useMemo(()=>O.getMentionsOptions(),[O]),G=r.default.useCallback(async(Z,$)=>{if(Q.providerData){const V=await Q.providerData(Z);$(V)}else $([])},[Q]);return r.default.createElement("div",{className:_.default.textarea_container},r.default.createElement(a.Tabs,{mini:!0,value:R,onChange:Z=>P(Z),tabs:[(0,p.localize)("comments.thread.textarea.write"),(0,p.localize)("comments.thread.textarea.preview")]}),r.default.createElement("div",null,R===0?r.default.createElement("div",{ref:k},r.default.createElement(o.MentionsInput,{autoFocus:f,onPaste:L,inputRef:M,onDragOver:U,onDrop:B,ref:F,value:I,placeholder:c,onChange:A,onFocus:y,onBlur:b,style:j},r.default.createElement(o.Mention,{markup:Q.markup||l,renderSuggestion:Q.renderSuggestion,trigger:g,data:G,displayTransform:Q.displayTransform||h}))):r.default.createElement("div",{className:_.default.textarea_preview},r.default.createElement(m.CommentsBody,{body:I}))))})},49867:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsThread=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(91830),p=e(54414),v=e(28423),m=e(69635),_=e(90366);let s=class extends o.Disposable{set contextValue(l){this._contextKeyService.createKey("thread",l)}get contextValue(){return this._contextKeyService.getContextKeyValue("thread")}get onDidChangeCollapsibleState(){return this.onDidChangeCollapsibleStateEmitter.event}get onDidChange(){return this.onDidChangeEmitter.event}constructor(l,h,u,d){super(),this.uri=l,this.range=h,this.providerId=u,this.options=d,this.comments=(0,v.observableValue)(this,[]),this.label=(0,v.observableValue)(this,void 0),this.readOnly=(0,v.observableValue)(this,!1),this.isCollapsed=(0,v.observableValue)(this,!1),this.onDidChangeCollapsibleStateEmitter=new o.Emitter,this.widgets=new Map,this._id=`thread_${(0,o.uuid)()}`,this.onDidChangeEmitter=new o.Emitter,this.threadHeaderTitle=(0,v.derived)(this,A=>{const S=this.label.read(A);if(S)return S;const D=this.comments.read(A);if(D.length){const I=new Set(D.map(w=>`@${w.author.name}`));return`${(0,o.localize)("comments.participants")}: `+[...I].join(" ")}else return(0,o.localize)("comments.zone.title")}),this.toggle=A=>{if(this.comments.get().length>0){const D=this.widgets.get(A);D&&D.toggle()}else this.dispose()},this.updateComments(d.comments?d.comments.map(A=>({...A,id:(0,o.uuid)()})):[]),this.data=this.options.data,this._contextKeyService=this.registerDispose(this.globalContextKeyService.createScoped()),new a.ResourceContextKey(this._contextKeyService).set(l),this._contextKeyService.createKey("thread",d.contextValue),(0,v.transaction)(A=>{this.setReadOnly(!!d.readOnly),this.label.set(d.label,A),this.isCollapsed.set(!!this.options.isCollapsed,A)});const f=this._contextKeyService.createKey("threadsLength",this.commentsService.getThreadsByUri(l).length),c=this.comments.get(),y=this._contextKeyService.createKey("commentsLength",c.length),b=this._contextKeyService.createKey("commentThreadIsEmpty",!c.length);this._contextKeyService.createKey("commentController",u),this.addDispose((0,v.autorun)(A=>{const S=this.comments.read(A).length;y.set(S),b.set(!S)})),this.addDispose((0,v.autorun)(A=>{this.isCollapsed.read(A)?this.hideAll():this.showAll()})),this.addDispose(this.commentsService.onThreadsChanged(A=>{A.uri.isEqual(l)&&f.set(this.commentsService.getThreadsByUri(l).length)})),this.addDispose({dispose:()=>{this.updateComments([])}}),this.onDidChangeEmitter.fire()}updateComments(l){(0,v.transaction)(h=>{this.comments.set(l,h)})}getWidgetByEditor(l){return this.widgets.get(l)}get id(){return this._id}get contextKeyService(){return this._contextKeyService}setReadOnly(l){(0,v.transaction)(h=>{this.readOnly.set(l,h),this._contextKeyService.createKey("readOnly",l)})}getEditorsByUri(l){return this.editorCollectionService.listEditors().filter(h=>{var u;return(u=h.currentUri)===null||u===void 0?void 0:u.isEqual(l)})}addWidgetByEditor(l){const h=this.injector.get(_.CommentsZoneWidget,[l,this,{arrowColor:"var(--peekView-border)"}]);return this.addDispose(h.onChangeZoneWidget(()=>{const u=this.commentsService.commentsThreads.filter(f=>this.isEqual(f)),d=u.findIndex(f=>f===this),E=u.slice(d+1);for(const f of E)if(f.isShowWidget(l)){const c=f.getWidgetByEditor(l);c?.resize()}})),this.addDispose(h),this.widgets.set(l,h),l.onDispose(()=>{h.dispose(),this.widgets.delete(l)}),h}show(l){if(l){let h=this.widgets.get(l);h||(h=this.addWidgetByEditor(l)),h.show()}else this.getEditorsByUri(this.uri).forEach(u=>{var d;let E=this.widgets.get(u);E||(E=this.addWidgetByEditor(u)),!((d=u.currentUri)===null||d===void 0)&&d.isEqual(this.uri)&&E.show()})}showWidgetsIfShowed(){var l;for(const h of this.getEditorsByUri(this.uri)){let u=this.widgets.get(h);u||(u=this.addWidgetByEditor(h)),!((l=h.currentUri)===null||l===void 0)&&l.isEqual(this.uri)&&setTimeout(()=>{u?.show()},0)}}hideWidgetsByDispose(){var l;for(const[h,u]of this.widgets)!(!((l=h.currentUri)===null||l===void 0)&&l.isEqual(this.uri))&&u.dispose()}isShowWidget(l){if(l){const h=this.widgets.get(l);return h?h.isShow:!1}else{for(const[,h]of this.widgets)return h.isShow;return!1}}hide(l){if(l){const h=this.widgets.get(l);h?.hide()}else this.hideAll()}showAll(){(0,v.transaction)(l=>{this.isCollapsed.set(!1,l)});for(const[,l]of this.widgets)l.show();this.onDidChangeCollapsibleStateEmitter.fire(m.CommentThreadCollapsibleState.Expanded)}hideAll(l){var h;(0,v.transaction)(u=>{this.isCollapsed.set(!0,u)});for(const[u,d]of this.widgets)l?!(!((h=u.currentUri)===null||h===void 0)&&h.isEqual(this.uri))&&d.dispose():d.hide();this.onDidChangeCollapsibleStateEmitter.fire(m.CommentThreadCollapsibleState.Collapsed)}addComment(...l){const h=this.comments.get();(0,v.transaction)(u=>{this.comments.set([...h,...l.map(d=>({...d,id:(0,o.uuid)()}))],u)}),this.onDidChangeEmitter.fire()}removeComment(l){(0,v.transaction)(h=>{this.comments.set(this.comments.get().filter(u=>u!==l),h)}),this.onDidChangeEmitter.fire()}isEqual(l){return l.uri.isEqual(this.uri)&&l.range.startLineNumber===this.range.startLineNumber&&l.range.endLineNumber===this.range.endLineNumber}};t.CommentsThread=s,n.__decorate([(0,r.Autowired)(m.ICommentsService),n.__metadata("design:type",Object)],s.prototype,"commentsService",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],s.prototype,"globalContextKeyService",void 0),n.__decorate([(0,r.Autowired)(p.EditorCollectionService),n.__metadata("design:type",p.EditorCollectionService)],s.prototype,"editorCollectionService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],s.prototype,"injector",void 0),t.CommentsThread=s=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[o.URI,Object,String,Object])],s)},73804:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsZoneService=void 0;const n=e(85608),r=e(76003),o=e(93899),a=e(43718),p=e(69635),v=e(49867);let m=class extends a.Disposable{constructor(s){super(),this.thread=s}setCurrentCommentThread(s){this.commentService.setCurrentCommentThread(s)}get commentThreadTitle(){return this.registerDispose(this.menuService.createMenu(o.MenuId.CommentsCommentThreadTitle,this.thread.contextKeyService))}get commentThreadContext(){return this.registerDispose(this.menuService.createMenu(o.MenuId.CommentsCommentThreadContext,this.thread.contextKeyService))}};t.CommentsZoneService=m,n.__decorate([(0,r.Autowired)(o.AbstractMenuService),n.__metadata("design:type",o.AbstractMenuService)],m.prototype,"menuService",void 0),n.__decorate([(0,r.Autowired)(p.ICommentsService),n.__metadata("design:type",Object)],m.prototype,"commentService",void 0),n.__decorate([a.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],m.prototype,"commentThreadTitle",null),n.__decorate([a.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],m.prototype,"commentThreadContext",null),t.CommentsZoneService=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[v.CommentsThread])],m)},90366:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsZoneWidget=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),a=n.__importDefault(e(25873)),p=e(76003),v=e(41869),m=e(25918),_=e(93899),s=e(20303),g=e(69635),l=e(37357),h=e(42018),u=e(73804),d=n.__importDefault(e(38877)),E=({thread:c,widget:y})=>{const{contextKeyService:b}=c,A=(0,v.useAutorun)(c.comments),S=(0,v.useAutorun)(c.threadHeaderTitle),I=(0,v.useInjectable)(p.INJECTOR_TOKEN).get(u.CommentsZoneService,[c]),w=(0,v.useInjectable)(g.ICommentsFeatureRegistry),T=o.default.useMemo(()=>w.getFileUploadHandler(),[]),[R,P]=o.default.useState(""),O=o.default.useMemo(()=>b.createKey("commentIsEmpty",!R),[]),M=I.commentThreadTitle,k=I.commentThreadContext,F=o.default.useCallback(G=>{const{value:Z}=G.target;P(Z),O.set(!Z)},[]),L=o.default.useMemo(()=>{var G;return((G=w.getProviderFeature(c.providerId))===null||G===void 0?void 0:G.placeholder)||`${(0,v.localize)("comments.reply.placeholder")}...`},[]),B=o.default.useCallback(async G=>{if(T){const Z=await T(R,G);P($=>{const V=$+Z;return O.set(!V),V})}},[R]);o.default.useEffect(()=>{const G=y.onFirstDisplay(()=>{setTimeout(()=>{y.coreEditor.monacoEditor.revealLine(c.range.endLineNumber+1)},0)});return()=>{G.dispose()}},[]);const U=o.default.useCallback(()=>{I.setCurrentCommentThread(I.thread)},[]),W=o.default.useCallback(()=>{I.setCurrentCommentThread(void 0)},[]),j=o.default.useCallback(()=>{I.setCurrentCommentThread(I.thread)},[]),Q=o.default.useCallback(()=>{I.setCurrentCommentThread(void 0)},[]);return o.default.createElement("div",{tabIndex:-1,onMouseOver:U,onMouseOut:W,onFocus:j,onBlur:Q,className:(0,r.default)(c.options.threadClassName,d.default.comment_container)},o.default.createElement("div",{className:(0,r.default)(c.options.threadHeadClassName,d.default.head)},o.default.createElement("div",{className:d.default.review_title},S),o.default.createElement(m.InlineActionBar,{menus:M,context:[{thread:c,widget:y,menuId:_.MenuId.CommentsCommentThreadTitle}],separator:"inline",type:"icon"})),o.default.createElement("div",{className:d.default.comment_body},A.length>0?o.default.createElement(l.CommentItem,{widget:y,commentThreadContext:k,thread:c}):o.default.createElement("div",null,o.default.createElement(h.CommentsTextArea,{focusDelay:100,initialHeight:"auto",value:R,onChange:F,placeholder:L,dragFiles:B}),o.default.createElement("div",{className:d.default.comment_bottom_actions},o.default.createElement(m.InlineActionBar,{className:d.default.comment_reply_actions,separator:"inline",type:"button",context:[{text:R,widget:y,thread:c,menuId:_.MenuId.CommentsCommentThreadContext}],menus:k})))))};let f=class extends s.ResizeZoneWidget{_fillContainer(){}constructor(y,b,A){super(y.monacoEditor,b.range,{...A,showInHiddenAreas:!0}),this.thread=b,this._onShow=new v.Emitter,this.onShow=this._onShow.event,this._onHide=new v.Emitter,this.onHide=this._onHide.event,this._editor=y,this._isShow=!b.isCollapsed.get();const S=document.createElement("div");this._container.appendChild(S),this.observeContainer(S);const D=this.commentsFeatureRegistry.getZoneWidgetRender();this.wrapperRoot=a.default.createRoot(S),this.wrapperRoot.render(o.default.createElement(v.ConfigProvider,{value:this.appConfig},D?D(this.thread,this):o.default.createElement(E,{thread:this.thread,widget:this}))),this.addDispose({dispose:()=>{var I;(I=this.wrapperRoot)===null||I===void 0||I.unmount(),this.wrapperRoot=void 0}})}get coreEditor(){return this._editor}get isShow(){return this._isShow}show(){super.show(),this._isShow=!0,this._onShow.fire()}hide(){super.hide(),this._isShow=!1,this._onHide.fire()}toggle(){this._isShow?this.hide():this.show()}applyClass(){}applyStyle(){}};t.CommentsZoneWidget=f,n.__decorate([(0,p.Autowired)(v.AppConfig),n.__metadata("design:type",Object)],f.prototype,"appConfig",void 0),n.__decorate([(0,p.Autowired)(g.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],f.prototype,"commentsFeatureRegistry",void 0),t.CommentsZoneWidget=f=n.__decorate([(0,p.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object,Object])],f)},62604:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsBrowserContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(93899),p=e(57517),v=e(63067),m=e(69635),_=e(47842);let s=class extends o.Disposable{onStart(){this.registerCommentsFeature(),this.listenToCreateCommentsPanel(),this.commentsService.init()}get panelBadge(){const l=this.commentsService.commentsThreads.length;return l?l+"":""}registerCommands(l){l.registerCommand({id:m.CollapseId,label:"%comments.panel.action.collapse%",iconClass:(0,o.getIcon)("collapse-all")},{execute:()=>{this.commentModelService.collapsedAll()}}),l.registerCommand({id:m.CloseThreadId,label:"%comments.thread.action.close%",iconClass:(0,o.getIcon)("up")},{execute:h=>{const{thread:u,widget:d}=h;u.comments.get().length?d.isShow&&d.toggle():u.dispose()}}),l.registerCommand({id:m.SwitchCommandReaction},{execute:h=>{this.eventBus.fire(new m.CommentReactionClick(h))}})}registerMenus(l){l.registerMenuItem(a.MenuId.CommentsCommentThreadTitle,{command:m.CloseThreadId,group:"inline",order:Number.MAX_SAFE_INTEGER})}registerToolbarItems(l){l.registerItem({id:m.CollapseId,viewId:m.CommentPanelId,command:m.CollapseId,tooltip:(0,o.localize)("comments.panel.action.collapse")})}registerCommentsFeature(){this.contributions.getContributions().forEach((l,h)=>{this.addDispose(this.commentsService.registerCommentRangeProvider(`contribution_${h}`,{getCommentingRanges:u=>l.provideCommentingRanges(u)})),l.registerCommentsFeature&&l.registerCommentsFeature(this.commentsFeatureRegistry)})}listenToCreateCommentsPanel(){this.commentsFeatureRegistry.getCommentsPanelOptions().defaultShow?this.commentsService.registerCommentPanel():o.Event.once(this.commentsService.onThreadsCreated)(()=>{this.commentsService.registerCommentPanel()}),this.addDispose(o.Event.debounce(this.commentsService.onThreadsChanged,()=>{},100)(()=>{const l=this.layoutService.getTabbarHandler(m.CommentPanelId);l?.setBadge(this.panelBadge)},this))}registerEditorFeature(l){l.registerEditorFeatureContribution({contribute:h=>this.commentsService.handleOnCreateEditor(h),provideEditorOptionsForUri:async h=>(await this.commentsService.getContributionRanges(h)).length?{lineDecorationsWidth:25,lineNumbersMinChars:5}:{}})}};t.CommentsBrowserContribution=s,n.__decorate([(0,r.Autowired)(m.ICommentsService),n.__metadata("design:type",Object)],s.prototype,"commentsService",void 0),n.__decorate([(0,r.Autowired)(v.IMainLayoutService),n.__metadata("design:type",Object)],s.prototype,"layoutService",void 0),n.__decorate([(0,r.Autowired)(m.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],s.prototype,"commentsFeatureRegistry",void 0),n.__decorate([(0,r.Autowired)(m.CommentsContribution),n.__metadata("design:type",Object)],s.prototype,"contributions",void 0),n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],s.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(_.CommentModelService),n.__metadata("design:type",_.CommentModelService)],s.prototype,"commentModelService",void 0),t.CommentsBrowserContribution=s=n.__decorate([(0,o.Domain)(o.ClientAppContribution,p.BrowserEditorContribution,o.CommandContribution,o.TabBarToolbarContribution,a.MenuContribution)],s)},55011:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsService=void 0;const n=e(85608),r=n.__importDefault(e(53435)),o=n.__importDefault(e(87809)),a=e(76003),p=e(41869),v=e(57517),m=e(63067),_=e(20868),s=n.__importStar(e(20868)),g=e(62663),l=e(52416),h=n.__importStar(e(24347)),u=e(69635),d=e(53878),E=e(49867),f=e(53711);let c=class extends p.Disposable{constructor(){super(...arguments),this.decorationChangeEmitter=new p.Emitter,this.threads=new Map,this.threadsChangeEmitter=new p.Emitter,this.threadsCommentChangeEmitter=new p.Emitter,this.commentRangeProviderChangeEmitter=new p.Emitter,this.onDidChangeCurrentCommentThreadEmitter=new p.Emitter,this.threadsCreatedEmitter=new p.Emitter,this.rangeProviderMap=new Map,this.rangeOwner=new Map,this.providerDecorationCache=new p.LRUCache(1e4),this.commentRangeDecorationMap=new Map,this.shouldShowCommentsSchemes=new Set(["file","git","diff"]),this.decorationProviderDisposer=p.Disposable.NULL,this.activeThreadDecorationIds=[],this.allEditors=[],this.editorCommentingRangeSpaceReservedMap=new Map,this.editorLineDecorationsWidthMap=new Map}get commentsThreads(){return[...this.threads.values()]}get isMultiCommentsForSingleLine(){var b;return!!(!((b=this.commentsFeatureRegistry.getConfig())===null||b===void 0)&&b.isMultiCommentsForSingleLine)}get currentAuthorAvatar(){var b,A;return(A=(b=this.commentsFeatureRegistry.getConfig())===null||b===void 0?void 0:b.author)===null||A===void 0?void 0:A.avatar}get filterThreadDecoration(){var b;return(b=this.commentsFeatureRegistry.getConfig())===null||b===void 0?void 0:b.filterThreadDecoration}get onThreadsChanged(){return this.threadsChangeEmitter.event}get onThreadsCommentChange(){return this.threadsCommentChangeEmitter.event}get onThreadsCreated(){return this.threadsCreatedEmitter.event}get onCommentRangeProviderChange(){return this.commentRangeProviderChangeEmitter.event}get onDidChangeCurrentCommentThread(){return this.onDidChangeCurrentCommentThreadEmitter.event}setCurrentCommentThread(b){this.onDidChangeCurrentCommentThreadEmitter.fire(b)}createThreadDecoration(b){var A;const S=b.comments.get(),D=S.length===0?this.currentAuthorAvatar:(A=S[0].author.iconPath)===null||A===void 0?void 0:A.toString(),I=D?`${this.iconService.fromIcon("",D,l.IconType.Background)} avatar-icon`:this.iconService.fromString("$(comment)"),w={description:"comments-thread-decoration",glyphMarginClassName:D?["comment-thread",I].join(" "):["comment-range","comment-thread",I].join(" ")};return h.ModelDecorationOptions.createDynamic(w)}updateActiveThreadDecoration(b){var A;const S=this.getCurrentEditor(b?.uri);if(!S)return;(A=this.currentThreadCollapseStateListener)===null||A===void 0||A.dispose();const D=[];if(b){const I=b.range;b.isCollapsed.get()||(this.currentThreadCollapseStateListener=b.onDidChangeCollapsibleState(w=>{w===u.CommentThreadCollapsibleState.Collapsed&&this.updateActiveThreadDecoration(void 0)}),D.push({range:I,options:this.createThreadRangeActiveDecoration()}))}this.activeThreadDecorationIds=S.monacoEditor.deltaDecorations(this.activeThreadDecorationIds,D)}createDottedRangeDecoration(){const b={description:"comments-multiline-hover-decoration",linesDecorationsClassName:["comment-range","multiline-add"].join(" ")};return h.ModelDecorationOptions.createDynamic(b)}createHoverDecoration(){const b={description:"comments-hover-decoration",linesDecorationsClassName:["comment-range","line-hover","comment-add"].join(" ")};return h.ModelDecorationOptions.createDynamic(b)}createThreadRangeActiveDecoration(){const b={description:"comments-thread-range-active-decoration",isWholeLine:!1,zIndex:20,className:"comment-thread-range-current",shouldFillLineOnLineBreak:!0};return h.ModelDecorationOptions.createDynamic(b)}createThreadRangeDecoration(){const b={description:"comments-thread-range-decoration",isWholeLine:!1,zIndex:20,className:"comment-thread-range",shouldFillLineOnLineBreak:!0};return h.ModelDecorationOptions.createDynamic(b)}createCommentRangeDecoration(){const b={description:"comments-range-decoration",linesDecorationsClassName:["comment-range","comment-diff-added"].join(" ")};return h.ModelDecorationOptions.createDynamic(b)}init(){const b=this.resourceService.getSupportedSchemes();for(const A of b)this.shouldShowCommentsSchemes.add(A);this.addDispose(this.resourceService.onRegisterResourceProvider(A=>{A.scheme&&(this.shouldShowCommentsSchemes.add(A.scheme),this.registerDecorationProvider())})),this.addDispose(this.resourceService.onUnregisterResourceProvider(A=>{A.scheme&&(this.shouldShowCommentsSchemes.delete(A.scheme),this.registerDecorationProvider())})),this.registerDecorationProvider()}getCurrentEditor(b){var A;if(b){for(const S of this.allEditors)if(!((A=S.currentUri)===null||A===void 0)&&A.isEqual(b))return this.editor=S,S}return this.editor}handleOnCreateEditor(b){this.allEditors.push(b),this.editor=b;const A=new p.Disposable;let S=[],D=!1;return A.addDispose(b.monacoEditor.onMouseDown(I=>{if(I.target.type===g.monacoBrowser.editor.MouseTargetType.GUTTER_LINE_DECORATIONS&&I.target.element&&I.target.element.className.indexOf("comment-add")>-1){const{target:w}=I;if(w&&w.range){const{range:T}=w;this.startCommentRange=T,I.event.stopPropagation()}}else if(I.target.type===g.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN&&I.target.element&&I.target.element.className.indexOf("comment-thread")>-1){const{target:w}=I;if(w&&w.range){const{range:T}=w,R=this.commentsThreads.filter(P=>b.currentUri&&P.uri.isEqual(b.currentUri)&&P.range.endLineNumber===T.endLineNumber);R.length&&(R.some(O=>O.isShowWidget(b))?R.forEach(O=>O.hide(b)):R.forEach(O=>O.show(b)))}I.event.stopPropagation()}})),A.addDispose(b.monacoEditor.onMouseUp(async I=>{if(this.startCommentRange){if(D){this.renderCommentRange(b),D=!1,this.startCommentRange=null,this.endCommentRange=null;return}let w=this.startCommentRange;this.endCommentRange&&(this.endCommentRange.startLineNumber<this.startCommentRange.startLineNumber?(w.startColumn=this.endCommentRange.startColumn,w.startLineNumber=this.endCommentRange.startLineNumber):(w.endColumn=this.endCommentRange.endColumn,w.endLineNumber=this.endCommentRange.endLineNumber)),b.currentUri&&(w=await this.getValidRange(w,b.currentUri)),w&&(this.commentsThreads.some(T=>T.comments.get().length===0&&b.currentUri&&T.uri.isEqual(b.currentUri)&&T.range.startLineNumber===w.startLineNumber&&T.range.endLineNumber===w.endLineNumber)||this.createThread(b.currentUri,w).show(b),I.event.stopPropagation())}else if(I.target.type===g.monacoBrowser.editor.MouseTargetType.GUTTER_LINE_DECORATIONS&&I.target.element&&I.target.element.className.indexOf("comment-range")>-1&&I.target.element.className.indexOf("comment-thread")<0){const{target:w}=I,T=w.range;T&&(this.commentsThreads.some(R=>R.comments.get().length===0&&b.currentUri&&R.uri.isEqual(b.currentUri)&&R.range.startLineNumber===T.startLineNumber&&R.range.endLineNumber===T.endLineNumber)||this.createThread(b.currentUri,T).show(b),I.event.stopPropagation())}this.startCommentRange=null,this.endCommentRange=null})),A.addDispose(b.monacoEditor.onMouseMove(async I=>{var w,T,R;const P=b.currentUri,O=I.target.range;if(this.startCommentRange){if(!((w=I.target.element)===null||w===void 0)&&w.className||!((R=(T=I.target.element)===null||T===void 0?void 0:T.offsetParent)===null||R===void 0)&&R.className.includes("diff-hidden-lines")&&(D=!0),P&&O){let M={startLineNumber:this.startCommentRange.startLineNumber,endLineNumber:O.endLineNumber,startColumn:this.startCommentRange.startColumn,endColumn:O.endColumn};this.startCommentRange.startLineNumber>O.startLineNumber&&(M={startLineNumber:O.startLineNumber,endLineNumber:this.startCommentRange.endLineNumber,startColumn:O.startColumn,endColumn:this.startCommentRange.endColumn}),this.renderCommentRange(b,M),this.endCommentRange=O}}else if(P&&O&&await this.shouldShowHoverDecoration(P,O)){const M=[{range:(0,_.positionToRange)(O.startLineNumber),options:this.createHoverDecoration()}];S=b.monacoEditor.deltaDecorations(S,M)}})),A.addDispose(b.monacoEditor.onMouseLeave(async I=>{var w;const T=(w=I.target)===null||w===void 0?void 0:w.range,R=[];!this.startCommentRange&&T&&R.push({range:(0,_.positionToRange)(T.startLineNumber),options:this.createCommentRangeDecoration()}),S=b.monacoEditor.deltaDecorations(S,R)})),A.addDispose(this.onCommentRangeProviderChange(()=>{this.renderCommentRange(b)})),A.addDispose(p.Event.any(this.onThreadsChanged,this.onThreadsCommentChange,this.onThreadsCreated)(I=>{const w=this.getCurrentEditor(I.uri);w&&this.renderCommentRange(w),this.updateActiveThreadDecoration(void 0)})),A.addDispose(this.onDidChangeCurrentCommentThread(I=>{this.updateActiveThreadDecoration(I)})),this.tryUpdateReservedSpace(b),A.addDispose(b.monacoEditor.onDidChangeModel(()=>{this.renderCommentRange(b),this.tryUpdateReservedSpace(b)})),A}async getValidRange(b,A){if(!A)return b;const S=await this.getContributionRanges(A);if(S.length===0)return b;const D=S.find(I=>{if(b.startLineNumber>=I.startLineNumber&&b.startLineNumber<=I.endLineNumber)return!0});return D&&D.endLineNumber<b.endLineNumber?{startLineNumber:b.startLineNumber,startColumn:b.startColumn,endLineNumber:D.endLineNumber,endColumn:D.endColumn}:b}ensureCommentingRangeReservedAmount(b){const A=this.getExistingCommentEditorOptions(b),S=this.editorLineDecorationsWidthMap.get(b.getId());A.lineDecorationsWidth!==S&&b.updateOptions({lineDecorationsWidth:this.getWithCommentsLineDecorationWidth(b,A.lineDecorationsWidth)})}async tryUpdateReservedSpace(b){if(!b)return;let A=this.editorCommentingRangeSpaceReservedMap.get(b.getId())||!1;const S=b.currentUri?this.shouldShowCommentsSchemes.has(b.currentUri.scheme):!1,D=this.commentsThreads.some(w=>b.currentUri&&w.uri.isEqual(b.currentUri)&&w.comments.get().length>0),I=S||D;if(I)if(A)this.ensureCommentingRangeReservedAmount(b);else{A=!0;const{lineDecorationsWidth:w,extraEditorClassName:T}=this.getExistingCommentEditorOptions(b),R=this.getWithCommentsEditorOptions(b,T,w);this.updateEditorLayoutOptions(b,R.extraEditorClassName,R.lineDecorationsWidth)}else if(!I&&A){A=!1;const{lineDecorationsWidth:w,extraEditorClassName:T}=this.getExistingCommentEditorOptions(b),R=this.getWithoutCommentsEditorOptions(b,T,w);this.updateEditorLayoutOptions(b,R.extraEditorClassName,R.lineDecorationsWidth)}this.editorCommentingRangeSpaceReservedMap.set(b.getId(),A)}getExistingCommentEditorOptions(b){const A=b.monacoEditor.getOption(s.EditorOption.lineDecorationsWidth);let S=[];const D=b.monacoEditor.getRawOptions().extraEditorClassName;return D&&(S=D.split(" ")),{lineDecorationsWidth:A,extraEditorClassName:S}}getWithoutCommentsEditorOptions(b,A,S){let D=S;const I=A.findIndex(T=>T==="inline-comment");I>=0&&A.splice(I,1);const w=b.monacoEditor.getOptions();return w.get(s.EditorOption.folding)&&w.get(s.EditorOption.showFoldingControls)!=="never"&&(D+=11),D-=24,{extraEditorClassName:A,lineDecorationsWidth:D}}updateEditorLayoutOptions(b,A,S){b.updateOptions({extraEditorClassName:A.join(" "),lineDecorationsWidth:S})}getWithCommentsEditorOptions(b,A,S){return A.push("inline-comment"),{lineDecorationsWidth:this.getWithCommentsLineDecorationWidth(b,S),extraEditorClassName:A}}getWithCommentsLineDecorationWidth(b,A){let S=A;const D=b.monacoEditor.getOptions();return D.get(s.EditorOption.folding)&&D.get(s.EditorOption.showFoldingControls)!=="never"&&(S-=11),S+=24,this.editorLineDecorationsWidthMap.set(b.getId(),S),S}async renderCommentRange(b,A={startLineNumber:0,endLineNumber:0,startColumn:0,endColumn:0}){if(!b.currentUri)return;const S=await this.getContributionRanges(b.currentUri);if(S.length>0){const D=[];S.map(w=>{if(A.startLineNumber===0&&A.endLineNumber===0)D.push({range:w,options:this.createCommentRangeDecoration()});else if(A.startLineNumber<=w.startLineNumber&&A.endLineNumber>=w.endLineNumber)D.push({range:w,options:this.createDottedRangeDecoration()},{range:w,options:this.createThreadRangeDecoration()});else if(A.endLineNumber>=w.endLineNumber)if(A.startLineNumber<=w.endLineNumber){const T={startLineNumber:A.startLineNumber,endLineNumber:w.endLineNumber,startColumn:A.startColumn,endColumn:w.endColumn},R={startLineNumber:w.startLineNumber,endLineNumber:T.startLineNumber-1,startColumn:w.startColumn,endColumn:T.endColumn};D.push({range:R,options:this.createCommentRangeDecoration()},{range:T,options:this.createDottedRangeDecoration()},{range:T,options:this.createThreadRangeDecoration()})}else D.push({range:w,options:this.createCommentRangeDecoration()});else if(A.endLineNumber<w.endLineNumber)if(A.endLineNumber>=w.startLineNumber)if(A.startLineNumber>=w.startLineNumber){const T={startLineNumber:w.startLineNumber,startColumn:w.startColumn,endLineNumber:A.startLineNumber-1,endColumn:A.startColumn},R={startLineNumber:A.endLineNumber+1,startColumn:A.endColumn,endLineNumber:w.endLineNumber,endColumn:w.endColumn},P=A.startLineNumber!==w.startLineNumber?[{range:T,options:this.createCommentRangeDecoration()}]:[];P.push({range:A,options:this.createDottedRangeDecoration()}),P.push({range:A,options:this.createThreadRangeDecoration()}),P.push({range:R,options:this.createCommentRangeDecoration()}),D.push(...P)}else{const T={startLineNumber:w.startLineNumber,startColumn:w.startColumn,endLineNumber:A.endLineNumber,endColumn:A.endColumn},R={startLineNumber:T.endLineNumber+1,startColumn:T.endColumn,endLineNumber:w.endLineNumber,endColumn:w.endColumn};D.push({range:T,options:this.createDottedRangeDecoration()},{range:T,options:this.createThreadRangeDecoration()},{range:R,options:this.createCommentRangeDecoration()})}else D.push({range:w,options:this.createCommentRangeDecoration()})});const I=this.commentRangeDecorationMap.get(b.currentUri.toString())||[];this.commentRangeDecorationMap.set(b.currentUri.toString(),b.monacoEditor.deltaDecorations(I,D))}else this.commentRangeDecorationMap.set(b.currentUri.toString(),[])}async shouldShowHoverDecoration(b,A){return this.shouldShowCommentsSchemes.has(b.scheme)?(await this.getContributionRanges(b)).some(I=>A.startLineNumber<=I.endLineNumber):!1}createThread(b,A,S={comments:[],readOnly:!1}){const D=this.getProviderIdsByLine(A.endLineNumber)[0],I=this.injector.get(E.CommentsThread,[b,A,D,S]);return I.onDispose(()=>{this.threads.delete(I.id),this.threadsChangeEmitter.fire(I),this.decorationChangeEmitter.fire(b)}),I.onDidChange(()=>{this.threadsChangeEmitter.fire(I)}),this.threads.set(I.id,I),this.addDispose(I),this.threadsChangeEmitter.fire(I),this.threadsCreatedEmitter.fire(I),this.decorationChangeEmitter.fire(b),I}getThreadsByUri(b){return this.commentsThreads.filter(A=>A.uri.isEqual(b)).sort((A,S)=>A.range.startLineNumber-S.range.startLineNumber)}handleCommentFileNode(b){const A=[],S=[...this.threads.values()].filter(I=>I.comments.get().length),D=(0,o.default)(S,I=>I.uri);return Object.keys(D).map(I=>{var w;const T=D[I];if(T.length===0)return;const R=new p.URI(this.appConfig.workspaceDir),P=new p.URI(I),O=(w=R.relative(P))===null||w===void 0?void 0:w.toString();A.push(new f.CommentFileNode(this,T,O,P.codeUri.fsPath,this.labelService.getIcon(P),P,b))}),A}handleCommentContentNode(b){var A;const S=[];for(const D of b.threads){const I=D.comments.get(),[w]=I,T=typeof w.body=="string"?w.body:w.body.value;let R=`[Ln ${D.range.startLineNumber}]`;D.range.startLineNumber!==D.range.endLineNumber&&(R=`[Ln ${D.range.startLineNumber}-${D.range.endLineNumber}]`),S.push(new f.CommentContentNode(this,D,T,R,w.author.iconPath&&(!((A=w.author.iconPath)===null||A===void 0)&&A.authority)?this.iconService.fromIcon("",w.author.iconPath.toString(),l.IconType.Background):(0,p.getIcon)("message"),w.author,b.resource,b))}return S}handleCommentReplyNode(b){const A=[],S=b.thread,D=S.comments.get(),[I,...w]=D,T=w[w.length-1].author.name;return A.push(new f.CommentReplyNode(this,S,(0,p.formatLocalize)("comment.reply.count",w?.length||0),(0,p.formatLocalize)("comment.reply.lastReply",T),"",b.resource,b)),A}async resolveChildren(b){let A=[];if(b?f.CommentRoot.isRoot(b)?A=this.handleCommentFileNode(b):f.CommentFileNode.is(b)?A=this.handleCommentContentNode(b):f.CommentContentNode.is(b)&&(A=this.handleCommentReplyNode(b)):A.push(new f.CommentRoot(this)),A.length===1&&f.CommentRoot.isRoot(A[0]))return A;const S=this.commentsFeatureRegistry.getCommentsPanelTreeNodeHandlers();if(S.length>0)for(const D of S)A=D(A);return A}async getContributionRanges(b){const A=this.providerDecorationCache.get(b.toString());if(A)return await A.promise;const S=this.documentService.getModelReference(b,"Get Comment Range"),D=[];for(const R of this.rangeProviderMap){const[P,O]=R;D.push((async()=>{if(!S?.instance)return;const M=await O.getCommentingRanges(S.instance);return M&&M.length&&this.rangeOwner.set(P,M),M})())}const I=new p.Deferred;this.providerDecorationCache.set(b.toString(),I);const w=(await Promise.all(D)).filter(Boolean);S?.dispose();const T=(0,r.default)(w).filter(Boolean);return I.resolve(T),T}fireThreadCommentChange(b){this.threadsCommentChangeEmitter.fire(b)}registerDecorationProvider(){this.decorationProviderDisposer.dispose(),this.decorationProviderDisposer=this.editorDecorationCollectionService.registerDecorationProvider({schemes:[...this.shouldShowCommentsSchemes.values()],key:"comments",onDidDecorationChange:this.decorationChangeEmitter.event,provideEditorDecoration:b=>this.commentsThreads.map(A=>(A.uri.codeUri.path===b.codeUri.path?A.comments.get().length&&A.showWidgetsIfShowed():A.hide(),A)).filter(A=>{const S=A.uri.isEqual(b);return this.filterThreadDecoration?S&&this.filterThreadDecoration(A):S}).map(A=>({range:{startLineNumber:A.range.endLineNumber,endLineNumber:A.range.endLineNumber,startColumn:A.range.endColumn,endColumn:A.range.endColumn},options:this.createThreadDecoration(A)}))}),this.addDispose(this.decorationProviderDisposer)}registerCommentPanel(){this.layoutService.getTabbarHandler(u.CommentPanelId)||this.layoutService.collectTabbarComponent([{id:u.CommentPanelId,component:d.CommentsPanel}],{badge:this.panelBadge,containerId:u.CommentPanelId,title:(0,p.localize)("comments").toUpperCase(),hidden:!1,activateKeyBinding:"ctrlcmd+shift+c",...this.commentsFeatureRegistry.getCommentsPanelOptions()},"bottom")}get panelBadge(){const b=this.commentsThreads.length;return b?b+"":""}registerCommentRangeProvider(b,A){return this.rangeProviderMap.set(b,A),this.providerDecorationCache.clear(),this.commentRangeProviderChangeEmitter.fire(),p.Disposable.create(()=>{this.rangeProviderMap.delete(b),this.rangeOwner.delete(b),this.providerDecorationCache.clear()})}forceUpdateDecoration(){var b,A,S;const D=(b=this.workbenchEditorService.currentEditor)===null||b===void 0?void 0:b.currentUri;D&&this.decorationChangeEmitter.fire(D);const I=(S=(A=this.workbenchEditorService.currentEditorGroup)===null||A===void 0?void 0:A.diffEditor)===null||S===void 0?void 0:S.originalEditor.currentUri;I&&this.decorationChangeEmitter.fire(I)}getProviderIdsByLine(b){const A=[];if(this.rangeOwner.size===1)return[this.rangeOwner.keys().next().value];for(const S of this.rangeOwner){const[D,I]=S;I&&I.some(w=>w.startLineNumber<=b&&b<=w.endLineNumber)&&A.push(D)}return A}};t.CommentsService=c,n.__decorate([(0,a.Autowired)(a.INJECTOR_TOKEN),n.__metadata("design:type",a.Injector)],c.prototype,"injector",void 0),n.__decorate([(0,a.Autowired)(p.AppConfig),n.__metadata("design:type",Object)],c.prototype,"appConfig",void 0),n.__decorate([(0,a.Autowired)(v.IEditorDecorationCollectionService),n.__metadata("design:type",Object)],c.prototype,"editorDecorationCollectionService",void 0),n.__decorate([(0,a.Autowired)(l.IIconService),n.__metadata("design:type",Object)],c.prototype,"iconService",void 0),n.__decorate([(0,a.Autowired)(p.LabelService),n.__metadata("design:type",p.LabelService)],c.prototype,"labelService",void 0),n.__decorate([(0,a.Autowired)(u.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],c.prototype,"commentsFeatureRegistry",void 0),n.__decorate([(0,a.Autowired)(v.IEditorDocumentModelService),n.__metadata("design:type",Object)],c.prototype,"documentService",void 0),n.__decorate([(0,a.Autowired)(m.IMainLayoutService),n.__metadata("design:type",Object)],c.prototype,"layoutService",void 0),n.__decorate([(0,a.Autowired)(v.WorkbenchEditorService),n.__metadata("design:type",v.WorkbenchEditorService)],c.prototype,"workbenchEditorService",void 0),n.__decorate([(0,a.Autowired)(v.ResourceService),n.__metadata("design:type",v.ResourceService)],c.prototype,"resourceService",void 0),n.__decorate([p.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],c.prototype,"isMultiCommentsForSingleLine",null),n.__decorate([p.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],c.prototype,"currentAuthorAvatar",null),n.__decorate([p.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],c.prototype,"filterThreadDecoration",null),t.CommentsService=c=n.__decorate([(0,a.Injectable)()],c)},54230:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsModule=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(69635),p=e(66480),v=e(62604),m=e(55011),_=e(47842);let s=class extends o.BrowserModule{constructor(){super(...arguments),this.contributionProvider=a.CommentsContribution,this.providers=[{token:a.ICommentsService,useClass:m.CommentsService},{token:_.CommentModelService,useClass:_.CommentModelService},{token:a.ICommentsFeatureRegistry,useClass:p.CommentsFeatureRegistry},v.CommentsBrowserContribution]}};t.CommentsModule=s,t.CommentsModule=s=n.__decorate([(0,r.Injectable)()],s)},70154:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.markdownCss=void 0,t.markdownCss=`
31841
+ </current_opened_file>`:""}};t.DefaultChatAgentPromptProvider=p,n.__decorate([(0,r.Autowired)(o.WorkbenchEditorService),n.__metadata("design:type",o.WorkbenchEditorService)],p.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(a.IWorkspaceService),n.__metadata("design:type",Object)],p.prototype,"workspaceService",void 0),t.DefaultChatAgentPromptProvider=p=n.__decorate([(0,r.Injectable)()],p)},69820:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EPartialEdit=t.MCP_SERVER_TYPE=t.NearestCodeBlockType=void 0;var e;(function(o){o.Block="block",o.Line="line"})(e||(t.NearestCodeBlockType=e={}));var n;(function(o){o.STDIO="stdio",o.SSE="sse",o.BUILTIN="builtin"})(n||(t.MCP_SERVER_TYPE=n={}));var r;(function(o){o.accept="accept",o.discard="discard"})(r||(t.EPartialEdit=r={}))},98864:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cleanAttachedTextWrapper=t.getToolName=t.toClaudeToolName=t.extractCodeBlocks=t.isDocumentValid=t.isDocumentTooShort=t.isDocumentTooLarge=void 0;const n=e(19413),r="```",o=10,a=l=>{try{l.getText()}catch(h){if(h instanceof RangeError)return!0}return!1};t.isDocumentTooLarge=a;const p=l=>l.getText().length<o;t.isDocumentTooShort=p;const v=l=>!((0,t.isDocumentTooLarge)(l)||(0,t.isDocumentTooShort)(l));t.isDocumentValid=v;const m=l=>{const h=l.split(`
31842
+ `);let u=[],d=!1,E=0;return h.forEach((f,c)=>{if(!d&&f.trim().startsWith(r))d=!0,E=c+1;else if(d&&f.trim().startsWith(r)){d=!1;const y=c;u=h.slice(E,y)}d&&E!==c+1&&u.push(f)}),u.join(`
31843
+ `)};t.extractCodeBlocks=m;const _=l=>l.replace(/[^a-zA-Z0-9_-]/g,"").slice(0,64);t.toClaudeToolName=_;const s=(l,h)=>h===n.BUILTIN_MCP_SERVER_NAME?l:(0,t.toClaudeToolName)(`mcp_${h}_${l}`);t.getToolName=s;const g=l=>{const h=/`<attached_file>(.*)`/g,u=/`<attached_folder>(.*)`/g;return l=l.replace(h,"$1"),l=l.replace(u,"$1"),l};t.cleanAttachedTextWrapper=g},26471:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(19413),t)},15504:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentReactions=t.CommentReactionSwitcher=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),a=e(81878),p=e(25918),v=e(93899),m=e(52416),_=e(69635),s=n.__importDefault(e(38877)),g=({thread:h,comment:u,className:d})=>{const E=`${h.providerId}_${h.id}_${u.id}`,f=`${v.MenuId.CommentReactionSwitcherMenu}_${E}`,c=(0,o.useInjectable)(v.IMenuRegistry),y=(0,o.useInjectable)(v.AbstractMenuService);r.default.useEffect(()=>{const A=new o.Disposable,S=`${v.MenuId.CommentReactionSwitcherSubmenu}_${E}`;return A.addDispose(c.registerMenuItem(f,{submenu:S,label:S,iconClass:(0,o.getExternalIcon)("reactions"),group:"navigation"})),A.addDispose(c.registerMenuItems(S,u.reactions.map(D=>({command:{id:_.SwitchCommandReaction,label:D.label},extraTailArgs:[{thread:h,comment:u,reaction:D}]})))),()=>A.dispose()},[]);const b=r.default.useMemo(()=>y.createMenu(f),[]);return r.default.createElement(p.InlineActionBar,{className:d,menus:b,regroup:A=>[A,[]],type:"icon"})};t.CommentReactionSwitcher=g;const l=({thread:h,comment:u})=>{var d;const E=(0,o.useInjectable)(o.IEventBus),f=(0,o.useInjectable)(m.IIconService),c=r.default.useCallback(y=>{E.fire(new _.CommentReactionClick({thread:h,comment:u,reaction:y}))},[]);return r.default.createElement("div",{className:s.default.comment_reactions},(d=u.reactions)===null||d===void 0?void 0:d.filter(y=>y.count!==0).map(y=>r.default.createElement(a.Button,{key:y.label,onClick:()=>c(y),type:"secondary",size:"small",title:y.label,className:s.default.comment_reaction,iconClass:f.fromIcon("",y.iconPath.toString(),m.IconType.Background)},"\xA0",y.count)))};t.CommentReactions=l},54143:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsBody=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=n.__importDefault(e(43144)),a=e(84605),p=n.__importDefault(e(38877)),v=e(70154),m=({root:_,children:s})=>o.default.createPortal(s,_);t.CommentsBody=r.default.memo(({body:_})=>{const s=r.default.useRef(null),[g,l]=r.default.useState(null),h=r.default.useMemo(()=>{const u=(0,a.createMarkedRenderer)();return u.link=({href:d,title:E,text:f})=>`<a target="_blank" rel="noopener" href="${d}" title="${E||""}">${f}</a>`,u},[]);return r.default.useEffect(()=>{if(s.current){const u=s.current.attachShadow({mode:"open"});g||l(u)}},[]),r.default.createElement("div",{ref:s,className:p.default.comment_shadow_box},g&&r.default.createElement(m,{root:g},r.default.createElement("style",null,v.markdownCss),r.default.createElement("div",{dangerouslySetInnerHTML:{__html:(0,a.toMarkdownHtml)(typeof _=="string"?_:_.value,{gfm:!0,breaks:!1,pedantic:!1,renderer:h})}})))})},66480:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsFeatureRegistry=void 0;const n=e(85608),r=e(76003);let o=class{constructor(){this.config={},this.options={},this.panelTreeNodeHandlers=[],this.mentionsOptions={},this.providerFeature=new Map}registerConfig(p){this.config={...this.config,...p}}registerPanelTreeNodeHandler(p){this.panelTreeNodeHandlers.push(p)}registerPanelOptions(p){this.options={...this.options,...p}}registerFileUploadHandler(p){this.fileUploadHandler=p}registerMentionsOptions(p){this.mentionsOptions=p}registerZoneWidgetRender(p){this.zoneWidgetRender=p}getConfig(){return this.config}getCommentsPanelOptions(){return this.options}getCommentsPanelTreeNodeHandlers(){return this.panelTreeNodeHandlers}getFileUploadHandler(){return this.fileUploadHandler}getMentionsOptions(){return this.mentionsOptions}getZoneWidgetRender(){return this.zoneWidgetRender}registerProviderFeature(p,v){this.providerFeature.set(p,v)}getProviderFeature(p){return this.providerFeature.get(p)}};t.CommentsFeatureRegistry=o,t.CommentsFeatureRegistry=o=n.__decorate([(0,r.Injectable)()],o)},37357:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentItem=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(97267),a=e(41869),p=e(25918),v=e(93899),m=e(69635),_=e(15504),s=e(54143),g=e(42018),l=n.__importDefault(e(38877)),h=({timestamp:f})=>{const c=r.default.useMemo(()=>{const y=new Date(f);return(0,a.toLocalString)(y)},[f]);return r.default.createElement("span",{className:l.default.comment_item_timestamp},c)},u=(f,c)=>{const y=(0,a.useInjectable)(v.AbstractMenuService),{body:b,contextValue:A}=c,[S,D]=r.default.useState(""),I=(0,a.useInjectable)(m.ICommentsFeatureRegistry),w=r.default.useMemo(()=>I.getFileUploadHandler(),[]);r.default.useEffect(()=>{D(b)},[b]);const T=r.default.useMemo(()=>f.createScoped(),[]),R=r.default.useMemo(()=>T.createKey("commentIsEmpty",!c.body),[]),P=r.default.useMemo(()=>y.createMenu(v.MenuId.CommentsCommentContext,T),[]),O=r.default.useMemo(()=>y.createMenu(v.MenuId.CommentsCommentTitle,T),[]),M=r.default.useRef(T.createKey("comment",A));r.default.useEffect(()=>{M.current.set(A)},[A]);const k=r.default.useCallback(L=>{R.set(!L.target.value),D(L.target.value)},[]),F=r.default.useCallback(async L=>{if(w){const B=await w(S,L);D(U=>{const W=U+B;return R.set(!W),W})}},[S]);return[S,D,k,P,O,F]},d=({reply:f,thread:c})=>{var y;const{contextKeyService:b}=c,{author:A,label:S,body:D,mode:I,timestamp:w}=f,T=(y=A.iconPath)===null||y===void 0?void 0:y.toString(),[R,P,O,M,k,F]=u(b,f),L=r.default.useMemo(()=>{const B=(0,a.toMarkdownHtml)(typeof D=="string"?D:D.value);return/^\<p\>[^<>]+\<\/p\>\n$/.test(B)},[D]);return r.default.createElement("div",{className:l.default.reply_item},(0,a.isUndefined)(I)||I===m.CommentMode.Preview?r.default.createElement("div",null,L?r.default.createElement(r.default.Fragment,null,T&&r.default.createElement("img",{className:l.default.reply_item_icon,src:T,alt:A.name}),r.default.createElement("span",{className:l.default.comment_item_author_name},A.name),w&&r.default.createElement(h,{timestamp:w}),typeof S=="string"?r.default.createElement("span",{className:l.default.comment_item_label},S):S," : ",r.default.createElement("span",{className:l.default.comment_item_body},typeof D=="string"?D:D.value),f.reactions&&f.reactions.length>0&&r.default.createElement(_.CommentReactionSwitcher,{className:l.default.reply_item_title,thread:c,comment:f}),r.default.createElement(p.InlineActionBar,{separator:"inline",className:l.default.reply_item_title,menus:k,context:[{thread:c,comment:f,menuId:v.MenuId.CommentsCommentTitle}],type:"icon"})):r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:l.default.comment_item_markdown_header},r.default.createElement("div",null,T&&r.default.createElement("img",{className:l.default.reply_item_icon,src:T,alt:A.name}),r.default.createElement("span",{className:l.default.comment_item_author_name},A.name),w&&r.default.createElement(h,{timestamp:w}),typeof S=="string"?r.default.createElement("span",{className:l.default.comment_item_label},S):S," : "),r.default.createElement(p.InlineActionBar,{separator:"inline",className:l.default.reply_item_title,menus:k,context:[{thread:c,comment:f,menuId:v.MenuId.CommentsCommentTitle}],type:"icon"})),r.default.createElement(s.CommentsBody,{body:D}))):r.default.createElement("div",null,r.default.createElement(g.CommentsTextArea,{value:typeof R=="string"?R:R.value,autoFocus:!0,onChange:O,dragFiles:F}),r.default.createElement(p.InlineActionBar,{className:l.default.comment_item_reply,menus:M,context:[{thread:c,comment:f,body:R,menuId:v.MenuId.CommentsCommentContext}],type:"button",separator:"inline",afterClick:()=>{P(D)}})),f.reactions&&f.reactions.length>0&&r.default.createElement(_.CommentReactions,{thread:c,comment:f}))},E=({thread:f,commentThreadContext:c,widget:y})=>{var b,A;const[S,D]=r.default.useState(!1),[I,w]=r.default.useState(""),{contextKeyService:T}=f,R=(0,a.useAutorun)(f.readOnly),[P,...O]=(0,a.useAutorun)(f.comments),{author:M,label:k,body:F,mode:L,timestamp:B}=P,U=(0,a.isString)(M.iconPath)?M.iconPath:!((b=M.iconPath)===null||b===void 0)&&b.authority?(A=M.iconPath)===null||A===void 0?void 0:A.toString():"",[W,j,Q,G,Z,$]=u(T,P),V=(0,a.useInjectable)(m.ICommentsFeatureRegistry),H=r.default.useMemo(()=>V.getFileUploadHandler(),[]),K=r.default.useMemo(()=>T.createKey("commentIsEmpty",!0),[]);function Y(oe){K.set(!oe.target.value),w(oe.target.value)}const X=r.default.useCallback(async oe=>{if(H){const ie=await H(W,oe);w(he=>{const me=he+ie;return K.set(!me),me})}},[I]);return r.default.createElement("div",{className:l.default.comment_item},U&&r.default.createElement("img",{className:l.default.comment_item_icon,src:U,alt:M.name}),r.default.createElement("div",{className:l.default.comment_item_content},r.default.createElement("div",{className:l.default.comment_item_head},r.default.createElement("div",{className:l.default.comment_item_name},r.default.createElement("span",{className:l.default.comment_item_author_name},M.name),B&&r.default.createElement(h,{timestamp:B}),typeof k=="string"?r.default.createElement("span",{className:l.default.comment_item_label},k):k),r.default.createElement("div",{className:l.default.comment_item_actions},P.reactions&&P.reactions.length>0&&r.default.createElement(_.CommentReactionSwitcher,{thread:f,comment:P}),!R&&r.default.createElement(o.Button,{className:l.default.comment_item_reply_button,size:"small",type:"secondary",onClick:()=>D(!0)},(0,a.localize)("comments.thread.action.reply")),r.default.createElement(p.InlineActionBar,{menus:Z,context:[{thread:f,comment:P,menuId:v.MenuId.CommentsCommentTitle}],type:"button"}))),(0,a.isUndefined)(L)||L===m.CommentMode.Preview?r.default.createElement(s.CommentsBody,{body:F}):r.default.createElement("div",null,r.default.createElement(g.CommentsTextArea,{value:typeof W=="string"?W:W.value,autoFocus:!0,onChange:Q,dragFiles:$}),r.default.createElement(p.InlineActionBar,{className:l.default.comment_item_context,menus:G,context:[{thread:f,comment:P,body:W,menuId:v.MenuId.CommentsCommentContext}],separator:"inline",type:"button",afterClick:()=>{j(F)}})),P.reactions&&P.reactions.length>0&&r.default.createElement(_.CommentReactions,{thread:f,comment:P}),(O.length>0||S)&&r.default.createElement("div",{className:l.default.comment_item_reply_wrap},O.map(oe=>r.default.createElement(d,{key:oe.id,thread:f,reply:oe})),S&&r.default.createElement("div",null,r.default.createElement(g.CommentsTextArea,{autoFocus:!0,value:I,onChange:Y,placeholder:`${(0,a.localize)("comments.reply.placeholder")}...`,dragFiles:X}),r.default.createElement(p.InlineActionBar,{className:l.default.comment_item_reply,menus:c,context:[{thread:f,text:I,widget:y,menuId:v.MenuId.CommentsCommentThreadContext}],separator:"inline",type:"button",afterClick:()=>{w(""),D(!1)}})))))};t.CommentItem=E},53878:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsPanel=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),a=e(41869),p=e(69635),v=n.__importDefault(e(38877)),m=e(5167),_=e(47842),s=({viewState:g})=>{const l=(0,a.useInjectable)(_.CommentModelService),[h,u]=(0,r.useState)(),d=(0,r.useRef)(null),E=(0,a.useInjectable)(p.ICommentsFeatureRegistry),{handleTreeBlur:f}=l;(0,r.useEffect)(()=>{u(l.treeModel);const I=l.onDidUpdateTreeModel(w=>{u(w)});return()=>{I.dispose()}},[]);const c=(0,r.useCallback)(I=>{l.handleTreeHandler(I)},[l]),y=(0,r.useCallback)(I=>r.default.createElement(m.CommentNodeRendered,{item:I.item,itemType:I.itemType,decorations:l.decorations.getDecorations(I.item),defaultLeftPadding:8,onTwistierClick:l.handleTwistierClick,onClick:l.handleItemClick,leftPadding:8}),[h]),b=(0,r.useMemo)(()=>E.getCommentsPanelOptions(),[]),A=(0,r.useMemo)(()=>b.header,[b]),S=(0,r.useMemo)(()=>r.default.createElement("div",{className:v.default.panel_placeholder},b.defaultPlaceholder||(0,a.localize)("comments.panel.placeholder")),[b]),D=(0,r.useCallback)(()=>h?r.default.createElement(o.RecycleTree,{height:g.height-(A?.height||0),itemHeight:m.COMMENT_TREE_NODE_HEIGHT,onReady:c,model:h,placeholder:()=>S},y):S,[h,A,g.height]);return r.default.createElement("div",{className:v.default.comment_panel,tabIndex:-1,onBlur:f,ref:d},A?.component,D())};t.CommentsPanel=s},42018:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsTextArea=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(34801),a=e(97267),p=e(41869),v=e(69635),m=e(54143),_=n.__importDefault(e(38877)),s=e(73136),g="@",l="@[__display__](__id__)",h=(u,d)=>`@${d}`;t.CommentsTextArea=r.default.forwardRef((u,d)=>{const{focusDelay:E=0,autoFocus:f=!1,placeholder:c="",onFocus:y,onBlur:b,onChange:A,maxRows:S=10,minRows:D=2,value:I,initialHeight:w,dragFiles:T}=u,[R,P]=r.default.useState(0),O=(0,p.useInjectable)(v.ICommentsFeatureRegistry),M=r.default.useRef(null),k=r.default.useRef(null),F=r.default.useRef(null);r.default.useImperativeHandle(d,()=>M.current);const L=r.default.useCallback(async Z=>{var $;Z.stopPropagation(),Z.preventDefault();const V=($=Z.clipboardData)===null||$===void 0?void 0:$.files;V&&T&&await T(V),M.current&&(M.current.focus(),W(M.current.value))},[T]),B=r.default.useCallback(async Z=>{var $;Z.stopPropagation(),Z.preventDefault();const V=($=Z.dataTransfer)===null||$===void 0?void 0:$.files;V&&T&&await T(V),M.current&&(M.current.focus(),W(M.current.value))},[T]),U=r.default.useCallback(Z=>{Z.stopPropagation(),Z.preventDefault(),Z.dataTransfer.dropEffect="copy"},[]),W=r.default.useCallback(Z=>{const $=M.current;if($){const V=Z.toString().length;$.setSelectionRange(V,V)}},[]);r.default.useEffect(()=>{var Z;const $=M.current;if(!$)return;w&&$.style&&($.style.height=w),E&&setTimeout(()=>{$.focus({preventScroll:!0})},E),W(I);function V(H){var K,Y,X;const oe=H.target;oe&&(oe.nodeName.toUpperCase()==="TEXTAREA"&&oe.scrollHeight>oe.clientHeight||oe.nodeName.toUpperCase()==="UL"||((K=oe.parentElement)===null||K===void 0?void 0:K.nodeName.toUpperCase())==="UL"||((X=(Y=oe.parentElement)===null||Y===void 0?void 0:Y.parentElement)===null||X===void 0?void 0:X.nodeName.toUpperCase())==="UL")&&H.stopPropagation()}return(Z=k.current)===null||Z===void 0||Z.addEventListener("mousewheel",V,!0),()=>{var H;(H=k.current)===null||H===void 0||H.removeEventListener("mousewheel",V,!0)}},[]),r.default.useEffect(()=>{R===0&&(setTimeout(()=>{var Z;(Z=M.current)===null||Z===void 0||Z.focus({preventScroll:!0})},E),W(I))},[R]);const j=r.default.useMemo(()=>(0,s.getMentionBoxStyle)({minRows:D,maxRows:S}),[D,S]),Q=r.default.useMemo(()=>O.getMentionsOptions(),[O]),G=r.default.useCallback(async(Z,$)=>{if(Q.providerData){const V=await Q.providerData(Z);$(V)}else $([])},[Q]);return r.default.createElement("div",{className:_.default.textarea_container},r.default.createElement(a.Tabs,{mini:!0,value:R,onChange:Z=>P(Z),tabs:[(0,p.localize)("comments.thread.textarea.write"),(0,p.localize)("comments.thread.textarea.preview")]}),r.default.createElement("div",null,R===0?r.default.createElement("div",{ref:k},r.default.createElement(o.MentionsInput,{autoFocus:f,onPaste:L,inputRef:M,onDragOver:U,onDrop:B,ref:F,value:I,placeholder:c,onChange:A,onFocus:y,onBlur:b,style:j},r.default.createElement(o.Mention,{markup:Q.markup||l,renderSuggestion:Q.renderSuggestion,trigger:g,data:G,displayTransform:Q.displayTransform||h}))):r.default.createElement("div",{className:_.default.textarea_preview},r.default.createElement(m.CommentsBody,{body:I}))))})},49867:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsThread=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(91830),p=e(54414),v=e(28423),m=e(69635),_=e(90366);let s=class extends o.Disposable{set contextValue(l){this._contextKeyService.createKey("thread",l)}get contextValue(){return this._contextKeyService.getContextKeyValue("thread")}get onDidChangeCollapsibleState(){return this.onDidChangeCollapsibleStateEmitter.event}get onDidChange(){return this.onDidChangeEmitter.event}constructor(l,h,u,d){super(),this.uri=l,this.range=h,this.providerId=u,this.options=d,this.comments=(0,v.observableValue)(this,[]),this.label=(0,v.observableValue)(this,void 0),this.readOnly=(0,v.observableValue)(this,!1),this.isCollapsed=(0,v.observableValue)(this,!1),this.onDidChangeCollapsibleStateEmitter=new o.Emitter,this.widgets=new Map,this._id=`thread_${(0,o.uuid)()}`,this.onDidChangeEmitter=new o.Emitter,this.threadHeaderTitle=(0,v.derived)(this,A=>{const S=this.label.read(A);if(S)return S;const D=this.comments.read(A);if(D.length){const I=new Set(D.map(w=>`@${w.author.name}`));return`${(0,o.localize)("comments.participants")}: `+[...I].join(" ")}else return(0,o.localize)("comments.zone.title")}),this.toggle=A=>{if(this.comments.get().length>0){const D=this.widgets.get(A);D&&D.toggle()}else this.dispose()},this.updateComments(d.comments?d.comments.map(A=>({...A,id:(0,o.uuid)()})):[]),this.data=this.options.data,this._contextKeyService=this.registerDispose(this.globalContextKeyService.createScoped()),new a.ResourceContextKey(this._contextKeyService).set(l),this._contextKeyService.createKey("thread",d.contextValue),(0,v.transaction)(A=>{this.setReadOnly(!!d.readOnly),this.label.set(d.label,A),this.isCollapsed.set(!!this.options.isCollapsed,A)});const f=this._contextKeyService.createKey("threadsLength",this.commentsService.getThreadsByUri(l).length),c=this.comments.get(),y=this._contextKeyService.createKey("commentsLength",c.length),b=this._contextKeyService.createKey("commentThreadIsEmpty",!c.length);this._contextKeyService.createKey("commentController",u),this.addDispose((0,v.autorun)(A=>{const S=this.comments.read(A).length;y.set(S),b.set(!S)})),this.addDispose((0,v.autorun)(A=>{this.isCollapsed.read(A)?this.hideAll():this.showAll()})),this.addDispose(this.commentsService.onThreadsChanged(A=>{A.uri.isEqual(l)&&f.set(this.commentsService.getThreadsByUri(l).length)})),this.addDispose({dispose:()=>{this.updateComments([])}}),this.onDidChangeEmitter.fire()}updateComments(l){(0,v.transaction)(h=>{this.comments.set(l,h)})}getWidgetByEditor(l){return this.widgets.get(l)}get id(){return this._id}get contextKeyService(){return this._contextKeyService}setReadOnly(l){(0,v.transaction)(h=>{this.readOnly.set(l,h),this._contextKeyService.createKey("readOnly",l)})}getEditorsByUri(l){return this.editorCollectionService.listEditors().filter(h=>{var u;return(u=h.currentUri)===null||u===void 0?void 0:u.isEqual(l)})}addWidgetByEditor(l){const h=this.injector.get(_.CommentsZoneWidget,[l,this,{arrowColor:"var(--peekView-border)"}]);return this.addDispose(h.onChangeZoneWidget(()=>{const u=this.commentsService.commentsThreads.filter(f=>this.isEqual(f)),d=u.findIndex(f=>f===this),E=u.slice(d+1);for(const f of E)if(f.isShowWidget(l)){const c=f.getWidgetByEditor(l);c?.resize()}})),this.addDispose(h),this.widgets.set(l,h),l.onDispose(()=>{h.dispose(),this.widgets.delete(l)}),h}show(l){if(l){let h=this.widgets.get(l);h||(h=this.addWidgetByEditor(l)),h.show()}else this.getEditorsByUri(this.uri).forEach(u=>{var d;let E=this.widgets.get(u);E||(E=this.addWidgetByEditor(u)),!((d=u.currentUri)===null||d===void 0)&&d.isEqual(this.uri)&&E.show()})}showWidgetsIfShowed(){var l;for(const h of this.getEditorsByUri(this.uri)){let u=this.widgets.get(h);u||(u=this.addWidgetByEditor(h)),!((l=h.currentUri)===null||l===void 0)&&l.isEqual(this.uri)&&setTimeout(()=>{u?.show()},0)}}hideWidgetsByDispose(){var l;for(const[h,u]of this.widgets)!(!((l=h.currentUri)===null||l===void 0)&&l.isEqual(this.uri))&&u.dispose()}isShowWidget(l){if(l){const h=this.widgets.get(l);return h?h.isShow:!1}else{for(const[,h]of this.widgets)return h.isShow;return!1}}hide(l){if(l){const h=this.widgets.get(l);h?.hide()}else this.hideAll()}showAll(){(0,v.transaction)(l=>{this.isCollapsed.set(!1,l)});for(const[,l]of this.widgets)l.show();this.onDidChangeCollapsibleStateEmitter.fire(m.CommentThreadCollapsibleState.Expanded)}hideAll(l){var h;(0,v.transaction)(u=>{this.isCollapsed.set(!0,u)});for(const[u,d]of this.widgets)l?!(!((h=u.currentUri)===null||h===void 0)&&h.isEqual(this.uri))&&d.dispose():d.hide();this.onDidChangeCollapsibleStateEmitter.fire(m.CommentThreadCollapsibleState.Collapsed)}addComment(...l){const h=this.comments.get();(0,v.transaction)(u=>{this.comments.set([...h,...l.map(d=>({...d,id:(0,o.uuid)()}))],u)}),this.onDidChangeEmitter.fire()}removeComment(l){(0,v.transaction)(h=>{this.comments.set(this.comments.get().filter(u=>u!==l),h)}),this.onDidChangeEmitter.fire()}isEqual(l){return l.uri.isEqual(this.uri)&&l.range.startLineNumber===this.range.startLineNumber&&l.range.endLineNumber===this.range.endLineNumber}};t.CommentsThread=s,n.__decorate([(0,r.Autowired)(m.ICommentsService),n.__metadata("design:type",Object)],s.prototype,"commentsService",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],s.prototype,"globalContextKeyService",void 0),n.__decorate([(0,r.Autowired)(p.EditorCollectionService),n.__metadata("design:type",p.EditorCollectionService)],s.prototype,"editorCollectionService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],s.prototype,"injector",void 0),t.CommentsThread=s=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[o.URI,Object,String,Object])],s)},73804:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsZoneService=void 0;const n=e(85608),r=e(76003),o=e(93899),a=e(43718),p=e(69635),v=e(49867);let m=class extends a.Disposable{constructor(s){super(),this.thread=s}setCurrentCommentThread(s){this.commentService.setCurrentCommentThread(s)}get commentThreadTitle(){return this.registerDispose(this.menuService.createMenu(o.MenuId.CommentsCommentThreadTitle,this.thread.contextKeyService))}get commentThreadContext(){return this.registerDispose(this.menuService.createMenu(o.MenuId.CommentsCommentThreadContext,this.thread.contextKeyService))}};t.CommentsZoneService=m,n.__decorate([(0,r.Autowired)(o.AbstractMenuService),n.__metadata("design:type",o.AbstractMenuService)],m.prototype,"menuService",void 0),n.__decorate([(0,r.Autowired)(p.ICommentsService),n.__metadata("design:type",Object)],m.prototype,"commentService",void 0),n.__decorate([a.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],m.prototype,"commentThreadTitle",null),n.__decorate([a.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],m.prototype,"commentThreadContext",null),t.CommentsZoneService=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[v.CommentsThread])],m)},90366:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsZoneWidget=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),a=n.__importDefault(e(25873)),p=e(76003),v=e(41869),m=e(25918),_=e(93899),s=e(20303),g=e(69635),l=e(37357),h=e(42018),u=e(73804),d=n.__importDefault(e(38877)),E=({thread:c,widget:y})=>{const{contextKeyService:b}=c,A=(0,v.useAutorun)(c.comments),S=(0,v.useAutorun)(c.threadHeaderTitle),I=(0,v.useInjectable)(p.INJECTOR_TOKEN).get(u.CommentsZoneService,[c]),w=(0,v.useInjectable)(g.ICommentsFeatureRegistry),T=o.default.useMemo(()=>w.getFileUploadHandler(),[]),[R,P]=o.default.useState(""),O=o.default.useMemo(()=>b.createKey("commentIsEmpty",!R),[]),M=I.commentThreadTitle,k=I.commentThreadContext,F=o.default.useCallback(G=>{const{value:Z}=G.target;P(Z),O.set(!Z)},[]),L=o.default.useMemo(()=>{var G;return((G=w.getProviderFeature(c.providerId))===null||G===void 0?void 0:G.placeholder)||`${(0,v.localize)("comments.reply.placeholder")}...`},[]),B=o.default.useCallback(async G=>{if(T){const Z=await T(R,G);P($=>{const V=$+Z;return O.set(!V),V})}},[R]);o.default.useEffect(()=>{const G=y.onFirstDisplay(()=>{setTimeout(()=>{y.coreEditor.monacoEditor.revealLine(c.range.endLineNumber+1)},0)});return()=>{G.dispose()}},[]);const U=o.default.useCallback(()=>{I.setCurrentCommentThread(I.thread)},[]),W=o.default.useCallback(()=>{I.setCurrentCommentThread(void 0)},[]),j=o.default.useCallback(()=>{I.setCurrentCommentThread(I.thread)},[]),Q=o.default.useCallback(()=>{I.setCurrentCommentThread(void 0)},[]);return o.default.createElement("div",{tabIndex:-1,onMouseOver:U,onMouseOut:W,onFocus:j,onBlur:Q,className:(0,r.default)(c.options.threadClassName,d.default.comment_container)},o.default.createElement("div",{className:(0,r.default)(c.options.threadHeadClassName,d.default.head)},o.default.createElement("div",{className:d.default.review_title},S),o.default.createElement(m.InlineActionBar,{menus:M,context:[{thread:c,widget:y,menuId:_.MenuId.CommentsCommentThreadTitle}],separator:"inline",type:"icon"})),o.default.createElement("div",{className:d.default.comment_body},A.length>0?o.default.createElement(l.CommentItem,{widget:y,commentThreadContext:k,thread:c}):o.default.createElement("div",null,o.default.createElement(h.CommentsTextArea,{focusDelay:100,initialHeight:"auto",value:R,onChange:F,placeholder:L,dragFiles:B}),o.default.createElement("div",{className:d.default.comment_bottom_actions},o.default.createElement(m.InlineActionBar,{className:d.default.comment_reply_actions,separator:"inline",type:"button",context:[{text:R,widget:y,thread:c,menuId:_.MenuId.CommentsCommentThreadContext}],menus:k})))))};let f=class extends s.ResizeZoneWidget{_fillContainer(){}constructor(y,b,A){super(y.monacoEditor,b.range,{...A,showInHiddenAreas:!0}),this.thread=b,this._onShow=new v.Emitter,this.onShow=this._onShow.event,this._onHide=new v.Emitter,this.onHide=this._onHide.event,this._editor=y,this._isShow=!b.isCollapsed.get();const S=document.createElement("div");this._container.appendChild(S),this.observeContainer(S);const D=this.commentsFeatureRegistry.getZoneWidgetRender();this.wrapperRoot=a.default.createRoot(S),this.wrapperRoot.render(o.default.createElement(v.ConfigProvider,{value:this.appConfig},D?D(this.thread,this):o.default.createElement(E,{thread:this.thread,widget:this}))),this.addDispose({dispose:()=>{var I;(I=this.wrapperRoot)===null||I===void 0||I.unmount(),this.wrapperRoot=void 0}})}get coreEditor(){return this._editor}get isShow(){return this._isShow}show(){super.show(),this._isShow=!0,this._onShow.fire()}hide(){super.hide(),this._isShow=!1,this._onHide.fire()}toggle(){this._isShow?this.hide():this.show()}applyClass(){}applyStyle(){}};t.CommentsZoneWidget=f,n.__decorate([(0,p.Autowired)(v.AppConfig),n.__metadata("design:type",Object)],f.prototype,"appConfig",void 0),n.__decorate([(0,p.Autowired)(g.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],f.prototype,"commentsFeatureRegistry",void 0),t.CommentsZoneWidget=f=n.__decorate([(0,p.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object,Object])],f)},62604:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsBrowserContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(93899),p=e(57517),v=e(63067),m=e(69635),_=e(47842);let s=class extends o.Disposable{onStart(){this.registerCommentsFeature(),this.listenToCreateCommentsPanel(),this.commentsService.init()}get panelBadge(){const l=this.commentsService.commentsThreads.length;return l?l+"":""}registerCommands(l){l.registerCommand({id:m.CollapseId,label:"%comments.panel.action.collapse%",iconClass:(0,o.getIcon)("collapse-all")},{execute:()=>{this.commentModelService.collapsedAll()}}),l.registerCommand({id:m.CloseThreadId,label:"%comments.thread.action.close%",iconClass:(0,o.getIcon)("up")},{execute:h=>{const{thread:u,widget:d}=h;u.comments.get().length?d.isShow&&d.toggle():u.dispose()}}),l.registerCommand({id:m.SwitchCommandReaction},{execute:h=>{this.eventBus.fire(new m.CommentReactionClick(h))}})}registerMenus(l){l.registerMenuItem(a.MenuId.CommentsCommentThreadTitle,{command:m.CloseThreadId,group:"inline",order:Number.MAX_SAFE_INTEGER})}registerToolbarItems(l){l.registerItem({id:m.CollapseId,viewId:m.CommentPanelId,command:m.CollapseId,tooltip:(0,o.localize)("comments.panel.action.collapse")})}registerCommentsFeature(){this.contributions.getContributions().forEach((l,h)=>{this.addDispose(this.commentsService.registerCommentRangeProvider(`contribution_${h}`,{getCommentingRanges:u=>l.provideCommentingRanges(u)})),l.registerCommentsFeature&&l.registerCommentsFeature(this.commentsFeatureRegistry)})}listenToCreateCommentsPanel(){this.commentsFeatureRegistry.getCommentsPanelOptions().defaultShow?this.commentsService.registerCommentPanel():o.Event.once(this.commentsService.onThreadsCreated)(()=>{this.commentsService.registerCommentPanel()}),this.addDispose(o.Event.debounce(this.commentsService.onThreadsChanged,()=>{},100)(()=>{const l=this.layoutService.getTabbarHandler(m.CommentPanelId);l?.setBadge(this.panelBadge)},this))}registerEditorFeature(l){l.registerEditorFeatureContribution({contribute:h=>this.commentsService.handleOnCreateEditor(h),provideEditorOptionsForUri:async h=>(await this.commentsService.getContributionRanges(h)).length?{lineDecorationsWidth:25,lineNumbersMinChars:5}:{}})}};t.CommentsBrowserContribution=s,n.__decorate([(0,r.Autowired)(m.ICommentsService),n.__metadata("design:type",Object)],s.prototype,"commentsService",void 0),n.__decorate([(0,r.Autowired)(v.IMainLayoutService),n.__metadata("design:type",Object)],s.prototype,"layoutService",void 0),n.__decorate([(0,r.Autowired)(m.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],s.prototype,"commentsFeatureRegistry",void 0),n.__decorate([(0,r.Autowired)(m.CommentsContribution),n.__metadata("design:type",Object)],s.prototype,"contributions",void 0),n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],s.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(_.CommentModelService),n.__metadata("design:type",_.CommentModelService)],s.prototype,"commentModelService",void 0),t.CommentsBrowserContribution=s=n.__decorate([(0,o.Domain)(o.ClientAppContribution,p.BrowserEditorContribution,o.CommandContribution,o.TabBarToolbarContribution,a.MenuContribution)],s)},55011:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsService=void 0;const n=e(85608),r=n.__importDefault(e(53435)),o=n.__importDefault(e(87809)),a=e(76003),p=e(41869),v=e(57517),m=e(63067),_=e(20868),s=n.__importStar(e(20868)),g=e(62663),l=e(52416),h=n.__importStar(e(24347)),u=e(69635),d=e(53878),E=e(49867),f=e(53711);let c=class extends p.Disposable{constructor(){super(...arguments),this.decorationChangeEmitter=new p.Emitter,this.threads=new Map,this.threadsChangeEmitter=new p.Emitter,this.threadsCommentChangeEmitter=new p.Emitter,this.commentRangeProviderChangeEmitter=new p.Emitter,this.onDidChangeCurrentCommentThreadEmitter=new p.Emitter,this.threadsCreatedEmitter=new p.Emitter,this.rangeProviderMap=new Map,this.rangeOwner=new Map,this.providerDecorationCache=new p.LRUCache(1e4),this.commentRangeDecorationMap=new Map,this.shouldShowCommentsSchemes=new Set(["file","git","diff"]),this.decorationProviderDisposer=p.Disposable.NULL,this.activeThreadDecorationIds=[],this.allEditors=[],this.editorCommentingRangeSpaceReservedMap=new Map,this.editorLineDecorationsWidthMap=new Map}get commentsThreads(){return[...this.threads.values()]}get isMultiCommentsForSingleLine(){var b;return!!(!((b=this.commentsFeatureRegistry.getConfig())===null||b===void 0)&&b.isMultiCommentsForSingleLine)}get currentAuthorAvatar(){var b,A;return(A=(b=this.commentsFeatureRegistry.getConfig())===null||b===void 0?void 0:b.author)===null||A===void 0?void 0:A.avatar}get filterThreadDecoration(){var b;return(b=this.commentsFeatureRegistry.getConfig())===null||b===void 0?void 0:b.filterThreadDecoration}get onThreadsChanged(){return this.threadsChangeEmitter.event}get onThreadsCommentChange(){return this.threadsCommentChangeEmitter.event}get onThreadsCreated(){return this.threadsCreatedEmitter.event}get onCommentRangeProviderChange(){return this.commentRangeProviderChangeEmitter.event}get onDidChangeCurrentCommentThread(){return this.onDidChangeCurrentCommentThreadEmitter.event}setCurrentCommentThread(b){this.onDidChangeCurrentCommentThreadEmitter.fire(b)}createThreadDecoration(b){var A;const S=b.comments.get(),D=S.length===0?this.currentAuthorAvatar:(A=S[0].author.iconPath)===null||A===void 0?void 0:A.toString(),I=D?`${this.iconService.fromIcon("",D,l.IconType.Background)} avatar-icon`:this.iconService.fromString("$(comment)"),w={description:"comments-thread-decoration",glyphMarginClassName:D?["comment-thread",I].join(" "):["comment-range","comment-thread",I].join(" ")};return h.ModelDecorationOptions.createDynamic(w)}updateActiveThreadDecoration(b){var A;const S=this.getCurrentEditor(b?.uri);if(!S)return;(A=this.currentThreadCollapseStateListener)===null||A===void 0||A.dispose();const D=[];if(b){const I=b.range;b.isCollapsed.get()||(this.currentThreadCollapseStateListener=b.onDidChangeCollapsibleState(w=>{w===u.CommentThreadCollapsibleState.Collapsed&&this.updateActiveThreadDecoration(void 0)}),D.push({range:I,options:this.createThreadRangeActiveDecoration()}))}this.activeThreadDecorationIds=S.monacoEditor.deltaDecorations(this.activeThreadDecorationIds,D)}createDottedRangeDecoration(){const b={description:"comments-multiline-hover-decoration",linesDecorationsClassName:["comment-range","multiline-add"].join(" ")};return h.ModelDecorationOptions.createDynamic(b)}createHoverDecoration(){const b={description:"comments-hover-decoration",linesDecorationsClassName:["comment-range","line-hover","comment-add"].join(" ")};return h.ModelDecorationOptions.createDynamic(b)}createThreadRangeActiveDecoration(){const b={description:"comments-thread-range-active-decoration",isWholeLine:!1,zIndex:20,className:"comment-thread-range-current",shouldFillLineOnLineBreak:!0};return h.ModelDecorationOptions.createDynamic(b)}createThreadRangeDecoration(){const b={description:"comments-thread-range-decoration",isWholeLine:!1,zIndex:20,className:"comment-thread-range",shouldFillLineOnLineBreak:!0};return h.ModelDecorationOptions.createDynamic(b)}createCommentRangeDecoration(){const b={description:"comments-range-decoration",linesDecorationsClassName:["comment-range","comment-diff-added"].join(" ")};return h.ModelDecorationOptions.createDynamic(b)}init(){const b=this.resourceService.getSupportedSchemes();for(const A of b)this.shouldShowCommentsSchemes.add(A);this.addDispose(this.resourceService.onRegisterResourceProvider(A=>{A.scheme&&(this.shouldShowCommentsSchemes.add(A.scheme),this.registerDecorationProvider())})),this.addDispose(this.resourceService.onUnregisterResourceProvider(A=>{A.scheme&&(this.shouldShowCommentsSchemes.delete(A.scheme),this.registerDecorationProvider())})),this.registerDecorationProvider()}getCurrentEditor(b){var A;if(b){for(const S of this.allEditors)if(!((A=S.currentUri)===null||A===void 0)&&A.isEqual(b))return this.editor=S,S}return this.editor}handleOnCreateEditor(b){this.allEditors.push(b),this.editor=b;const A=new p.Disposable;let S=[],D=!1;return A.addDispose(b.monacoEditor.onMouseDown(I=>{if(I.target.type===g.monacoBrowser.editor.MouseTargetType.GUTTER_LINE_DECORATIONS&&I.target.element&&I.target.element.className.indexOf("comment-add")>-1){const{target:w}=I;if(w&&w.range){const{range:T}=w;this.startCommentRange=T,I.event.stopPropagation()}}else if(I.target.type===g.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN&&I.target.element&&I.target.element.className.indexOf("comment-thread")>-1){const{target:w}=I;if(w&&w.range){const{range:T}=w,R=this.commentsThreads.filter(P=>b.currentUri&&P.uri.isEqual(b.currentUri)&&P.range.endLineNumber===T.endLineNumber);R.length&&(R.some(O=>O.isShowWidget(b))?R.forEach(O=>O.hide(b)):R.forEach(O=>O.show(b)))}I.event.stopPropagation()}})),A.addDispose(b.monacoEditor.onMouseUp(async I=>{if(this.startCommentRange){if(D){this.renderCommentRange(b),D=!1,this.startCommentRange=null,this.endCommentRange=null;return}let w=this.startCommentRange;this.endCommentRange&&(this.endCommentRange.startLineNumber<this.startCommentRange.startLineNumber?(w.startColumn=this.endCommentRange.startColumn,w.startLineNumber=this.endCommentRange.startLineNumber):(w.endColumn=this.endCommentRange.endColumn,w.endLineNumber=this.endCommentRange.endLineNumber)),b.currentUri&&(w=await this.getValidRange(w,b.currentUri)),w&&(this.commentsThreads.some(T=>T.comments.get().length===0&&b.currentUri&&T.uri.isEqual(b.currentUri)&&T.range.startLineNumber===w.startLineNumber&&T.range.endLineNumber===w.endLineNumber)||this.createThread(b.currentUri,w).show(b),I.event.stopPropagation())}else if(I.target.type===g.monacoBrowser.editor.MouseTargetType.GUTTER_LINE_DECORATIONS&&I.target.element&&I.target.element.className.indexOf("comment-range")>-1&&I.target.element.className.indexOf("comment-thread")<0){const{target:w}=I,T=w.range;T&&(this.commentsThreads.some(R=>R.comments.get().length===0&&b.currentUri&&R.uri.isEqual(b.currentUri)&&R.range.startLineNumber===T.startLineNumber&&R.range.endLineNumber===T.endLineNumber)||this.createThread(b.currentUri,T).show(b),I.event.stopPropagation())}this.startCommentRange=null,this.endCommentRange=null})),A.addDispose(b.monacoEditor.onMouseMove(async I=>{var w,T,R;const P=b.currentUri,O=I.target.range;if(this.startCommentRange){if(!((w=I.target.element)===null||w===void 0)&&w.className||!((R=(T=I.target.element)===null||T===void 0?void 0:T.offsetParent)===null||R===void 0)&&R.className.includes("diff-hidden-lines")&&(D=!0),P&&O){let M={startLineNumber:this.startCommentRange.startLineNumber,endLineNumber:O.endLineNumber,startColumn:this.startCommentRange.startColumn,endColumn:O.endColumn};this.startCommentRange.startLineNumber>O.startLineNumber&&(M={startLineNumber:O.startLineNumber,endLineNumber:this.startCommentRange.endLineNumber,startColumn:O.startColumn,endColumn:this.startCommentRange.endColumn}),this.renderCommentRange(b,M),this.endCommentRange=O}}else if(P&&O&&await this.shouldShowHoverDecoration(P,O)){const M=[{range:(0,_.positionToRange)(O.startLineNumber),options:this.createHoverDecoration()}];S=b.monacoEditor.deltaDecorations(S,M)}})),A.addDispose(b.monacoEditor.onMouseLeave(async I=>{var w;const T=(w=I.target)===null||w===void 0?void 0:w.range,R=[];!this.startCommentRange&&T&&R.push({range:(0,_.positionToRange)(T.startLineNumber),options:this.createCommentRangeDecoration()}),S=b.monacoEditor.deltaDecorations(S,R)})),A.addDispose(this.onCommentRangeProviderChange(()=>{this.renderCommentRange(b)})),A.addDispose(p.Event.any(this.onThreadsChanged,this.onThreadsCommentChange,this.onThreadsCreated)(I=>{const w=this.getCurrentEditor(I.uri);w&&this.renderCommentRange(w),this.updateActiveThreadDecoration(void 0)})),A.addDispose(this.onDidChangeCurrentCommentThread(I=>{this.updateActiveThreadDecoration(I)})),this.tryUpdateReservedSpace(b),A.addDispose(b.monacoEditor.onDidChangeModel(()=>{this.renderCommentRange(b),this.tryUpdateReservedSpace(b)})),A}async getValidRange(b,A){if(!A)return b;const S=await this.getContributionRanges(A);if(S.length===0)return b;const D=S.find(I=>{if(b.startLineNumber>=I.startLineNumber&&b.startLineNumber<=I.endLineNumber)return!0});return D&&D.endLineNumber<b.endLineNumber?{startLineNumber:b.startLineNumber,startColumn:b.startColumn,endLineNumber:D.endLineNumber,endColumn:D.endColumn}:b}ensureCommentingRangeReservedAmount(b){const A=this.getExistingCommentEditorOptions(b),S=this.editorLineDecorationsWidthMap.get(b.getId());A.lineDecorationsWidth!==S&&b.updateOptions({lineDecorationsWidth:this.getWithCommentsLineDecorationWidth(b,A.lineDecorationsWidth)})}async tryUpdateReservedSpace(b){if(!b)return;let A=this.editorCommentingRangeSpaceReservedMap.get(b.getId())||!1;const S=b.currentUri?this.shouldShowCommentsSchemes.has(b.currentUri.scheme):!1,D=this.commentsThreads.some(w=>b.currentUri&&w.uri.isEqual(b.currentUri)&&w.comments.get().length>0),I=S||D;if(I)if(A)this.ensureCommentingRangeReservedAmount(b);else{A=!0;const{lineDecorationsWidth:w,extraEditorClassName:T}=this.getExistingCommentEditorOptions(b),R=this.getWithCommentsEditorOptions(b,T,w);this.updateEditorLayoutOptions(b,R.extraEditorClassName,R.lineDecorationsWidth)}else if(!I&&A){A=!1;const{lineDecorationsWidth:w,extraEditorClassName:T}=this.getExistingCommentEditorOptions(b),R=this.getWithoutCommentsEditorOptions(b,T,w);this.updateEditorLayoutOptions(b,R.extraEditorClassName,R.lineDecorationsWidth)}this.editorCommentingRangeSpaceReservedMap.set(b.getId(),A)}getExistingCommentEditorOptions(b){const A=b.monacoEditor.getOption(s.EditorOption.lineDecorationsWidth);let S=[];const D=b.monacoEditor.getRawOptions().extraEditorClassName;return D&&(S=D.split(" ")),{lineDecorationsWidth:A,extraEditorClassName:S}}getWithoutCommentsEditorOptions(b,A,S){let D=S;const I=A.findIndex(T=>T==="inline-comment");I>=0&&A.splice(I,1);const w=b.monacoEditor.getOptions();return w.get(s.EditorOption.folding)&&w.get(s.EditorOption.showFoldingControls)!=="never"&&(D+=11),D-=24,{extraEditorClassName:A,lineDecorationsWidth:D}}updateEditorLayoutOptions(b,A,S){b.updateOptions({extraEditorClassName:A.join(" "),lineDecorationsWidth:S})}getWithCommentsEditorOptions(b,A,S){return A.push("inline-comment"),{lineDecorationsWidth:this.getWithCommentsLineDecorationWidth(b,S),extraEditorClassName:A}}getWithCommentsLineDecorationWidth(b,A){let S=A;const D=b.monacoEditor.getOptions();return D.get(s.EditorOption.folding)&&D.get(s.EditorOption.showFoldingControls)!=="never"&&(S-=11),S+=24,this.editorLineDecorationsWidthMap.set(b.getId(),S),S}async renderCommentRange(b,A={startLineNumber:0,endLineNumber:0,startColumn:0,endColumn:0}){if(!b.currentUri)return;const S=await this.getContributionRanges(b.currentUri);if(S.length>0){const D=[];S.map(w=>{if(A.startLineNumber===0&&A.endLineNumber===0)D.push({range:w,options:this.createCommentRangeDecoration()});else if(A.startLineNumber<=w.startLineNumber&&A.endLineNumber>=w.endLineNumber)D.push({range:w,options:this.createDottedRangeDecoration()},{range:w,options:this.createThreadRangeDecoration()});else if(A.endLineNumber>=w.endLineNumber)if(A.startLineNumber<=w.endLineNumber){const T={startLineNumber:A.startLineNumber,endLineNumber:w.endLineNumber,startColumn:A.startColumn,endColumn:w.endColumn},R={startLineNumber:w.startLineNumber,endLineNumber:T.startLineNumber-1,startColumn:w.startColumn,endColumn:T.endColumn};D.push({range:R,options:this.createCommentRangeDecoration()},{range:T,options:this.createDottedRangeDecoration()},{range:T,options:this.createThreadRangeDecoration()})}else D.push({range:w,options:this.createCommentRangeDecoration()});else if(A.endLineNumber<w.endLineNumber)if(A.endLineNumber>=w.startLineNumber)if(A.startLineNumber>=w.startLineNumber){const T={startLineNumber:w.startLineNumber,startColumn:w.startColumn,endLineNumber:A.startLineNumber-1,endColumn:A.startColumn},R={startLineNumber:A.endLineNumber+1,startColumn:A.endColumn,endLineNumber:w.endLineNumber,endColumn:w.endColumn},P=A.startLineNumber!==w.startLineNumber?[{range:T,options:this.createCommentRangeDecoration()}]:[];P.push({range:A,options:this.createDottedRangeDecoration()}),P.push({range:A,options:this.createThreadRangeDecoration()}),P.push({range:R,options:this.createCommentRangeDecoration()}),D.push(...P)}else{const T={startLineNumber:w.startLineNumber,startColumn:w.startColumn,endLineNumber:A.endLineNumber,endColumn:A.endColumn},R={startLineNumber:T.endLineNumber+1,startColumn:T.endColumn,endLineNumber:w.endLineNumber,endColumn:w.endColumn};D.push({range:T,options:this.createDottedRangeDecoration()},{range:T,options:this.createThreadRangeDecoration()},{range:R,options:this.createCommentRangeDecoration()})}else D.push({range:w,options:this.createCommentRangeDecoration()})});const I=this.commentRangeDecorationMap.get(b.currentUri.toString())||[];this.commentRangeDecorationMap.set(b.currentUri.toString(),b.monacoEditor.deltaDecorations(I,D))}else this.commentRangeDecorationMap.set(b.currentUri.toString(),[])}async shouldShowHoverDecoration(b,A){return this.shouldShowCommentsSchemes.has(b.scheme)?(await this.getContributionRanges(b)).some(I=>A.startLineNumber<=I.endLineNumber):!1}createThread(b,A,S={comments:[],readOnly:!1}){const D=this.getProviderIdsByLine(A.endLineNumber)[0],I=this.injector.get(E.CommentsThread,[b,A,D,S]);return I.onDispose(()=>{this.threads.delete(I.id),this.threadsChangeEmitter.fire(I),this.decorationChangeEmitter.fire(b)}),I.onDidChange(()=>{this.threadsChangeEmitter.fire(I)}),this.threads.set(I.id,I),this.addDispose(I),this.threadsChangeEmitter.fire(I),this.threadsCreatedEmitter.fire(I),this.decorationChangeEmitter.fire(b),I}getThreadsByUri(b){return this.commentsThreads.filter(A=>A.uri.isEqual(b)).sort((A,S)=>A.range.startLineNumber-S.range.startLineNumber)}handleCommentFileNode(b){const A=[],S=[...this.threads.values()].filter(I=>I.comments.get().length),D=(0,o.default)(S,I=>I.uri);return Object.keys(D).map(I=>{var w;const T=D[I];if(T.length===0)return;const R=new p.URI(this.appConfig.workspaceDir),P=new p.URI(I),O=(w=R.relative(P))===null||w===void 0?void 0:w.toString();A.push(new f.CommentFileNode(this,T,O,P.codeUri.fsPath,this.labelService.getIcon(P),P,b))}),A}handleCommentContentNode(b){var A;const S=[];for(const D of b.threads){const I=D.comments.get(),[w]=I,T=typeof w.body=="string"?w.body:w.body.value;let R=`[Ln ${D.range.startLineNumber}]`;D.range.startLineNumber!==D.range.endLineNumber&&(R=`[Ln ${D.range.startLineNumber}-${D.range.endLineNumber}]`),S.push(new f.CommentContentNode(this,D,T,R,w.author.iconPath&&(!((A=w.author.iconPath)===null||A===void 0)&&A.authority)?this.iconService.fromIcon("",w.author.iconPath.toString(),l.IconType.Background):(0,p.getIcon)("message"),w.author,b.resource,b))}return S}handleCommentReplyNode(b){const A=[],S=b.thread,D=S.comments.get(),[I,...w]=D,T=w[w.length-1].author.name;return A.push(new f.CommentReplyNode(this,S,(0,p.formatLocalize)("comment.reply.count",w?.length||0),(0,p.formatLocalize)("comment.reply.lastReply",T),"",b.resource,b)),A}async resolveChildren(b){let A=[];if(b?f.CommentRoot.isRoot(b)?A=this.handleCommentFileNode(b):f.CommentFileNode.is(b)?A=this.handleCommentContentNode(b):f.CommentContentNode.is(b)&&(A=this.handleCommentReplyNode(b)):A.push(new f.CommentRoot(this)),A.length===1&&f.CommentRoot.isRoot(A[0]))return A;const S=this.commentsFeatureRegistry.getCommentsPanelTreeNodeHandlers();if(S.length>0)for(const D of S)A=D(A);return A}async getContributionRanges(b){const A=this.providerDecorationCache.get(b.toString());if(A)return await A.promise;const S=this.documentService.getModelReference(b,"Get Comment Range"),D=[];for(const R of this.rangeProviderMap){const[P,O]=R;D.push((async()=>{if(!S?.instance)return;const M=await O.getCommentingRanges(S.instance);return M&&M.length&&this.rangeOwner.set(P,M),M})())}const I=new p.Deferred;this.providerDecorationCache.set(b.toString(),I);const w=(await Promise.all(D)).filter(Boolean);S?.dispose();const T=(0,r.default)(w).filter(Boolean);return I.resolve(T),T}fireThreadCommentChange(b){this.threadsCommentChangeEmitter.fire(b)}registerDecorationProvider(){this.decorationProviderDisposer.dispose(),this.decorationProviderDisposer=this.editorDecorationCollectionService.registerDecorationProvider({schemes:[...this.shouldShowCommentsSchemes.values()],key:"comments",onDidDecorationChange:this.decorationChangeEmitter.event,provideEditorDecoration:b=>this.commentsThreads.map(A=>(A.uri.codeUri.path===b.codeUri.path?A.comments.get().length&&A.showWidgetsIfShowed():A.hide(),A)).filter(A=>{const S=A.uri.isEqual(b);return this.filterThreadDecoration?S&&this.filterThreadDecoration(A):S}).map(A=>({range:{startLineNumber:A.range.endLineNumber,endLineNumber:A.range.endLineNumber,startColumn:A.range.endColumn,endColumn:A.range.endColumn},options:this.createThreadDecoration(A)}))}),this.addDispose(this.decorationProviderDisposer)}registerCommentPanel(){this.layoutService.getTabbarHandler(u.CommentPanelId)||this.layoutService.collectTabbarComponent([{id:u.CommentPanelId,component:d.CommentsPanel}],{badge:this.panelBadge,containerId:u.CommentPanelId,title:(0,p.localize)("comments").toUpperCase(),hidden:!1,activateKeyBinding:"ctrlcmd+shift+c",...this.commentsFeatureRegistry.getCommentsPanelOptions()},"bottom")}get panelBadge(){const b=this.commentsThreads.length;return b?b+"":""}registerCommentRangeProvider(b,A){return this.rangeProviderMap.set(b,A),this.providerDecorationCache.clear(),this.commentRangeProviderChangeEmitter.fire(),p.Disposable.create(()=>{this.rangeProviderMap.delete(b),this.rangeOwner.delete(b),this.providerDecorationCache.clear()})}forceUpdateDecoration(){var b,A,S;const D=(b=this.workbenchEditorService.currentEditor)===null||b===void 0?void 0:b.currentUri;D&&this.decorationChangeEmitter.fire(D);const I=(S=(A=this.workbenchEditorService.currentEditorGroup)===null||A===void 0?void 0:A.diffEditor)===null||S===void 0?void 0:S.originalEditor.currentUri;I&&this.decorationChangeEmitter.fire(I)}getProviderIdsByLine(b){const A=[];if(this.rangeOwner.size===1)return[this.rangeOwner.keys().next().value];for(const S of this.rangeOwner){const[D,I]=S;I&&I.some(w=>w.startLineNumber<=b&&b<=w.endLineNumber)&&A.push(D)}return A}};t.CommentsService=c,n.__decorate([(0,a.Autowired)(a.INJECTOR_TOKEN),n.__metadata("design:type",a.Injector)],c.prototype,"injector",void 0),n.__decorate([(0,a.Autowired)(p.AppConfig),n.__metadata("design:type",Object)],c.prototype,"appConfig",void 0),n.__decorate([(0,a.Autowired)(v.IEditorDecorationCollectionService),n.__metadata("design:type",Object)],c.prototype,"editorDecorationCollectionService",void 0),n.__decorate([(0,a.Autowired)(l.IIconService),n.__metadata("design:type",Object)],c.prototype,"iconService",void 0),n.__decorate([(0,a.Autowired)(p.LabelService),n.__metadata("design:type",p.LabelService)],c.prototype,"labelService",void 0),n.__decorate([(0,a.Autowired)(u.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],c.prototype,"commentsFeatureRegistry",void 0),n.__decorate([(0,a.Autowired)(v.IEditorDocumentModelService),n.__metadata("design:type",Object)],c.prototype,"documentService",void 0),n.__decorate([(0,a.Autowired)(m.IMainLayoutService),n.__metadata("design:type",Object)],c.prototype,"layoutService",void 0),n.__decorate([(0,a.Autowired)(v.WorkbenchEditorService),n.__metadata("design:type",v.WorkbenchEditorService)],c.prototype,"workbenchEditorService",void 0),n.__decorate([(0,a.Autowired)(v.ResourceService),n.__metadata("design:type",v.ResourceService)],c.prototype,"resourceService",void 0),n.__decorate([p.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],c.prototype,"isMultiCommentsForSingleLine",null),n.__decorate([p.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],c.prototype,"currentAuthorAvatar",null),n.__decorate([p.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],c.prototype,"filterThreadDecoration",null),t.CommentsService=c=n.__decorate([(0,a.Injectable)()],c)},54230:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsModule=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(69635),p=e(66480),v=e(62604),m=e(55011),_=e(47842);let s=class extends o.BrowserModule{constructor(){super(...arguments),this.contributionProvider=a.CommentsContribution,this.providers=[{token:a.ICommentsService,useClass:m.CommentsService},{token:_.CommentModelService,useClass:_.CommentModelService},{token:a.ICommentsFeatureRegistry,useClass:p.CommentsFeatureRegistry},v.CommentsBrowserContribution]}};t.CommentsModule=s,t.CommentsModule=s=n.__decorate([(0,r.Injectable)()],s)},70154:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.markdownCss=void 0,t.markdownCss=`
31844
31844
  h1, h2, h3, h4, h5, h6, p {
31845
31845
  color: var(--foreground);
31846
31846
  word-break: break-all;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensumi/cli-engine",
3
- "version": "3.8.3-next-1747643756.0",
3
+ "version": "3.8.3-next-1747658811.0",
4
4
  "description": "Integration engine runtime for opensumi-cli and opensumi extension",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -26,14 +26,14 @@
26
26
  "dependencies": {
27
27
  "@koa/cors": "^5.0.0",
28
28
  "@opensumi/di": "^1.8.0",
29
- "@opensumi/ide-core-browser": "3.8.3-next-1747643756.0",
30
- "@opensumi/ide-core-common": "3.8.3-next-1747643756.0",
31
- "@opensumi/ide-core-node": "3.8.3-next-1747643756.0",
32
- "@opensumi/ide-express-file-server": "3.8.3-next-1747643756.0",
33
- "@opensumi/ide-extension": "3.8.3-next-1747643756.0",
34
- "@opensumi/ide-i18n": "3.8.3-next-1747643756.0",
35
- "@opensumi/ide-main-layout": "3.8.3-next-1747643756.0",
36
- "@opensumi/ide-startup": "3.8.3-next-1747643756.0",
29
+ "@opensumi/ide-core-browser": "3.8.3-next-1747658811.0",
30
+ "@opensumi/ide-core-common": "3.8.3-next-1747658811.0",
31
+ "@opensumi/ide-core-node": "3.8.3-next-1747658811.0",
32
+ "@opensumi/ide-express-file-server": "3.8.3-next-1747658811.0",
33
+ "@opensumi/ide-extension": "3.8.3-next-1747658811.0",
34
+ "@opensumi/ide-i18n": "3.8.3-next-1747658811.0",
35
+ "@opensumi/ide-main-layout": "3.8.3-next-1747658811.0",
36
+ "@opensumi/ide-startup": "3.8.3-next-1747658811.0",
37
37
  "chalk": "^4.1.2",
38
38
  "ejs": "^3.1.7",
39
39
  "ip": "^1.1.8",
@@ -72,5 +72,5 @@
72
72
  "webpack": "^5.90.0",
73
73
  "webpack-cli": "^5.1.4"
74
74
  },
75
- "gitHead": "002a7c993fdb37098a041f78fd8432fdb3146286"
75
+ "gitHead": "407b26bedd9f0a2c3d8260f9c4c604953a505487"
76
76
  }