1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[118],{
1"./views/common/page/index.js":(e,r,n)=>{n.d(r,{sI:()=>K,T3:()=>ee,JH:()=>re,gj:()=>G,L7:()=>Y,w3:()=>B,ZP:()=>se});var t=n("../node_modules/@babel/runtime/helpers/esm/defineProperty.js"),s=n("../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),i=n("../node_modules/prop-types/index.js"),c=n.n(i),o=n("../node_modules/classnames/index.js"),a=n.n(o),l=n("./router/index.js"),u=n("./views/bricks/bricks.js"),d=n("../node_modules/@babel/runtime/helpers/esm/classCallCheck.js"),p=n("../node_modules/@babel/runtime/helpers/esm/createClass.js"),m=n("../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"),v=n("../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"),f=n("../node_modules/@babel/runtime/helpers/esm/inherits.js"),h=n("../node_modules/react/index.js"),j=n("./utils/date.js"),g=n("../node_modules/react/jsx-runtime.js");function x(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function b(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?x(Object(n),!0).forEach((function(r){(0,t.Z)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function C(e,r,n){return r=(0,v.Z)(r),(0,m.Z)(e,N()?Reflect.construct(r,n||[],(0,v.Z)(e).constructor):r.apply(e,n))}function N(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(N=function(){return!!e})()}var S=[{delimiter:1e9,symbol:"B",digits:2},{delimiter:1e6,symbol:"M",digits:1},{delimiter:1e3,symbol:"K",digits:0}];function y(e){var r=e.count,n=e.counterCachedAt,t=e.counterCacheReason,s=e.isFormatted,i="";return n?i="~".concat(r," (cached ").concat(j.ED.formatRelative(n,Date.now()),")"):s&&(i="".concat(r)),i=i.trim(),t?(0,g.jsxs)("div",{children:[i,(0,g.jsx)("hr",{}),(0,g.jsx)("small",{children:t})]}):i.trim()}var O=function(e){function r(){var e;(0,d.Z)(this,r);for(var n=arguments.length,t=new Array(n),s=0;s<n;s++)t[s]=arguments[s];return(e=C(this,r,[].concat(t))).onLoadRecordsCountClick=function(r){r.preventDefault();var n=e.props,t=n.item;(0,n.loadCountAction)(t)},e}return(0,f.Z)(r,e),(0,p.Z)(r,[{key:"renderLoadingSpinner",value:function(){return(0,g.jsx)("div",{className:"counter",children:(0,g.jsx)(u.xu,{icon:"sync",spin:!0})})}},{key:"renderErrorIcon",value:function(){var e=this.props.error;return(0,g.jsx)(u.aV,{popover:e,type:"danger",children:(0,g.jsx)("div",{className:"counter",children:(0,g.jsx)(u.xu,{icon:"exclamation-triangle",className:"text-danger"})})})}},{key:"renderCounter",value:function(){var e=this.props,r=e.count,n=e.counterCachedAt,s=e.counterCacheReason,i=e.loadCountAction,c=function(e){for(var r=0;r<S.length;r++){var n=S[r],t=n.delimiter,s=n.symbol,i=n.digits;if(e>t){var c=Number("1e".concat(i));return Math.floor(e/t*c)/c+"".concat(s,"+")}}return e}(r),o=c!==r;if(n||o){var a=(0,t.Z)({},s?"popover":"tooltip",(0,g.jsx)(y,{count:r,counterCachedAt:n,counterCacheReason:s,isFormatted:o}));return(0,g.jsx)(u.aV,b(b({className:"backendless-page-menu-counter-tooltip"},a),{},{children:(0,g.jsx)("div",{className:"counter",children:c})}))}return(0,g.jsx)("div",{className:"counter",onClick:i&&this.onLoadRecordsCountClick,children:r})}},{key:"renderLoadCountIcon",value:function(){return(0,g.jsx)(u.aV,{className:"backendless-page-menu-counter-tooltip",tooltip:"Click to load records count",children:(0,g.jsx)("div",{className:"counter",onClick:this.onLoadRecordsCountClick,children:(0,g.jsx)(u.xu,{icon:"download"})})})}},{key:"render",value:function(){var e=this.props,r=e.count,n=e.loading,t=e.error,s=e.loadCountAction;return n?this.renderLoadingSpinner():t?this.renderErrorIcon():null!=r?this.renderCounter():s?this.renderLoadCountIcon():null}}])}(h.Component);var P=n("../node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),I=n("./hooks/index.js");function w(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function E(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};
1r%2?w(Object(n),!0).forEach((function(r){(0,t.Z)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function M(e){var r=e.filter,n=e.onFilterChange,t=e.showFilterInput,s=e.setShowFilterInput;return(0,g.jsxs)("div",{className:"filter-box",children:[!t&&(0,g.jsx)(u.xu,{className:a()("activator",{"has-filter":!!r}),tooltip:r?"filter: ".concat(r):null,icon:"search",onClick:function(){return s(!0)}}),t&&(0,g.jsx)(u.Rj,{size:"full",placeholder:"type to filter...",value:r,onChange:n,onEnterPress:function(){return s(!1)},onOutsideClick:function(){return s(!1)},autoFocus:!0})]})}function R(e){var r=e.title,n=e.icon,t=e.faIcon,s=e.collapsed,i=e.filterProps;return(0,g.jsxs)("div",{className:"title",children:[(0,g.jsxs)("div",{children:[n&&(0,g.jsx)("span",{className:"icon-holder",children:n}),t&&(0,g.jsx)("span",{className:"icon-holder",children:(0,g.jsx)(u.xu,{icon:t})}),(0,g.jsx)("span",{children:r})]}),!s&&i&&(0,g.jsx)(M,E({},i))]})}function A(e){var r=e.children,n=e.elRef,t=e.collapsed,s=e.setGroupCollapsed,i=e.className,c=e.title;return(0,g.jsxs)("div",{className:a()("page-sidebar-group",i,{"collapsed-group":t}),ref:n,children:[t&&(0,g.jsx)(u.zx,{onClick:s,className:"toggle-collapse-group-button"}),c,(0,g.jsx)("div",{className:"list scroller",children:(0,g.jsx)("ul",{className:"list-inner",children:r})})]})}function Z(e){var r=e.title,n=e.icon,t=e.faIcon,s=e.className,i=e.filter,c=e.elRef,o=e.resizable,a=e.onResize,l=e.onFilterChange,d=e.minHeight,p=e.maxHeight,m=e.height,v=e.collapsed,f=e.setGroupCollapsed,h=e.children,j=e.titleComponent,x=(0,I.eJ)(!1),b=(0,P.Z)(x,2),C=b[0],N=b[1],S=(0,I.eJ)(m),y=(0,P.Z)(S,2),O=y[0],w=y[1],E=(0,I.sO)(null),M=l?{filter:i,onFilterChange:l,showFilterInput:C,setShowFilterInput:N}:null,Z=j||r&&R,k=Z&&(0,g.jsx)(Z,{title:r,icon:n,faIcon:t,collapsed:v,filterProps:M}),_=(0,g.jsx)(A,{elRef:function(e){E.current=e,c&&c(e)},className:s,collapsed:v,setGroupCollapsed:f,title:k,children:h});return o||a?(0,g.jsx)(u.ez,{axis:"y",revert:!0,height:O,minHeight:d,maxHeight:p,onChange:function(e){var r=e.height;w(r),a&&a(r)},children:_}):_}M.propTypes={filter:c().string,onFilterChange:c().func,showFilterInput:c().bool.isRequired,setShowFilterInput:c().func.isRequired},R.propTypes={title:c().node,icon:c().node,faIcon:c().string,collapsed:c().bool,filterProps:c().object},A.propTypes={children:c().node,elRef:c().func,collapsed:c().bool,setGroupCollapsed:c().func,className:c().string};var k=c().oneOfType([c().string,c().number]);Z.propTypes={title:c().node,icon:c().node,faIcon:c().string,className:c().string,filter:c().string,elRef:c().func,resizable:c().bool,onResize:c().func,onFilterChange:c().func,minHeight:k,maxHeight:k,height:k,collapsed:c().bool,setGroupCollapsed:c().func,children:c().node};var _=n("./constants/action-types/index.js"),T=function(e){return{type:_.Z.TOGGLE_SIDEBAR,options:e}},D=n("./reducers/index.js"),L=(0,h.createContext)({collapsed:!1}),H=L.Provider;const V=L;var F=1100,z=function(e){var r=(0,D.eMP)(e).sidebar;return{manualCollapsed:r.manualCollapsed,manualExpanded:r.manualExpanded}},G=function(e){var r=e.className,n=e.children,t=e.collapsable,s=e.newLayout,i=(0,I.ol)({toggleSidebar:T}),c=(0,I.v9)(z),o=c.manualExpanded,l=c.manualCollapsed,d=(0,I.eJ)(t&&l),p=(0,P.Z)(d,2),m=p[0],v=p[1],f=(0,I.eI)();(0,I.d4)((function(){window.scrollTo(0,0)}),[]);t&&(f.width>=F?(m&&!l&&v(!1),o&&i.toggleSidebar({manualExpanded:!1})):o||m||v(!0));var h=f.width<F&&o,j=m||!h&&f.width<=F;return(0,g.jsxs)("aside",{className:a()("page-sidebar",r,{"new-page-sidebar":s,"sidebar-collapsable":t,"sidebar-collapsed":m,"page-sidebar-expanded-mobile":h}),children:[(0,g.jsx)(H,{value:{collapsed:j},children:n}),t&&(0,g.jsxs)(u.zx,{onClick:function(){v(!m),f.width>=F?i.toggleSidebar({manualExpanded:!1,manualCollapsed:!m}):i.toggleSidebar({manualExpanded:m,manualCollapsed:!1})},className:"toggle-sidebar-button",children:[(0,g.jsx)(u.xu,{className:"icon-collapse",icon:m&&!h?"angle-double-right":"angle-double-left",tooltip:m&&!h?"Expand sidebar":void 0}),(0,g.jsx)("span",{className:"collapse-label",children:"Collapse sidebar"})]})]})},J=n("./utils/console-status.js"),U=new WeakMap;function Y(e){var r=e.loaded,n=e.error;return(0,g.jsx)("div",{className:"page-spinner-holder",children:(0,g.jsx)(u.$
1j,{loaded:r,error:n})})}function q(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function W(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?q(Object(n),!0).forEach((function(r){(0,t.Z)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function B(e){var r=e.className,n=e.children;return(0,g.jsx)(u.NX,{className:r,theme:"dark",withIcons:!0,children:n})}function K(e){var r=e.className,n=e.children,t=e.onClose;return(0,g.jsx)("div",{className:a()("deprecated-page-panel",r),children:(0,g.jsxs)("div",{className:"content",children:[(0,g.jsx)(u.xu,{icon:"exclamation-triangle"}),(0,g.jsx)("h3",{children:"This functionality will be going away soon..."}),(0,g.jsx)("div",{children:n}),t&&(0,g.jsx)(u.zx,{onClick:t,label:"I got it"})]})})}B.Item=function(e){return(0,g.jsx)(V.Consumer,{children:function(r){var n=r.collapsed;return(0,g.jsx)(u.H4,W(W({},e),{},{tooltip:n?e.tooltip:void 0}))}})};n("./hooks/visibility/index.js");c().string.isRequired,c().array.isRequired;var $=["children","count","showCounter","counterCachedAt","counterCacheReason","counterLoading","counterError","subEl","loadCountAction","item"];function X(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function Q(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?X(Object(n),!0).forEach((function(r){(0,t.Z)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function ee(e){var r=e.onRef,n=e.className,t=e.children,s=function(e,r){var n=(0,I.eJ)((function(){return!!e&&!U.has(e)})),t=(0,P.Z)(n,2),s=t[0],i=t[1],c=(0,I.Ye)((function(){if(!r||J.O.isSystemDev)return function(){U.set(e,0),i(!1)}}),[r]);return s?(0,g.jsx)(e,{onClose:c}):null}(e.DeprecationPanel,e.blockDeprecationPanel);return(0,g.jsxs)("div",{ref:r,className:a()("page",n,{deprecated:s}),children:[t,s]})}var re=function(e){var r=e.className,n=e.children,t=e.padded;return(0,g.jsx)("div",{className:a()("page-content scroller",r,{padded:t}),children:n})};re.SectionsMenu=function(e){var r=e.className,n=e.children;return(0,g.jsx)("nav",{className:a()("nav nav-tabs page-sections-menu",r),children:n})},re.Section=function(e){var r=e.className,n=e.children,t=e.todoNoFlex;return(0,g.jsx)("section",{className:a()("page-section",r,{"todo-no-flex":t}),children:n})},re.SectionToolbar=function(e){var r=e.className,n=e.children;return(0,g.jsx)("div",{className:a()("page-section-toolbar",r),children:n})},re.SectionContent=function(e){var r=e.className,n=e.innerClassName,t=e.children,s=e.fullSize;return s&&(t=(0,g.jsx)("div",{className:a()("page-section-content-inner",n),children:t})),(0,g.jsx)("div",{className:a()("page-section-content",r,{"full-size":s}),children:t})},re.SectionTitle=function(e){var r=e.children;return(0,g.jsx)("div",{className:"page-section-title",children:r})},G.Content=function(e){var r=e.className,n=e.children;return(0,g.jsx)("aside",{className:a()("page-sidebar-content",r),children:n})},G.Group=Z;var ne=function(){return(0,g.jsx)("i",{className:"caret-icon caret-icon-right"})};function te(e){var r=e.children,n=e.count,t=e.showCounter,i=e.counterCachedAt,c=e.counterCacheReason,o=e.counterLoading,a=e.counterError,u=e.subEl,d=e.loadCountAction,p=e.item,m=(0,s.Z)(e,$);return(0,g.jsxs)(l.OL,Q(Q({},m),{},{children:[(0,g.jsx)("span",{className:"group-item-name",children:r}),u&&(0,g.jsx)("div",{className:"group-item-sub-el",children:u}),t&&(0,g.jsx)(O,{count:n,counterCachedAt:i,counterCacheReason:c,loading:o,error:a,loadCountAction:d,item:p}),(0,g.jsx)(ne,{})]}))}G.GroupItem=function(e){var r=e.className,n=e.children;return(0,g.jsx)("li",{className:a()("page-sidebar-group-item",r),children:n})},te.propTypes={showCounter:c().bool.isRequired,loadCountAction:function(e){if(e.showCounter&&!e.loadCountAction&&null==e.count)return new Error("Please provide a loadCountAction function!")}},G.GroupNavItem=te,G.ActionsBar=function(e){var r=e.onRef,n=e.className,t=e.children;return(0,g.jsx)("div",{ref:r,className:a()("page-sidebar-action-bar",n),children:t})},G.Action=function(e){var r=e.className,n=e.icon,t=e.tooltip,s=e.children,i=e.danger,c=e.disabled,o=e.processing,l=e.active,d=e.onClick;return(0,g.jsxs)("span",{className:a()("page-sidebar-action",r,{danger:i,processing:o,disabled:c,active:l}),onClick:c?void 0:d,children:[n&&(0,g.jsx)(u.xu,{icon:n,tooltip:t}),s]})};const se=ee},
1"./views/common/rt-logging/messages.js":(e,r,n)=>{n.d(r,{yU:()=>u,ZP:()=>d});var t=n("../node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),s=n("../node_modules/classnames/index.js"),i=n.n(s),c=n("./hooks/index.js"),o=n("./views/bricks/bricks.js"),a=n("../node_modules/react/jsx-runtime.js");function l(e){var r=e.className,n=e.text,t=e.timestamp,s=e.filter,o=e.searchPattern,l=e.searchPatternRegExp,u=e.basicTimestamps,d=(0,c.Ye)((function(){return function(e,r,n){if(!r)return e;var t=new Date(r);if(!n)return"".concat(t," | ").concat(e);var s="".concat(t.getHours(),":").concat(t.getMinutes(),":").concat(t.getSeconds(),".").concat(t.getMilliseconds());return"".concat(s," | ").concat(e)}(n,t,u)}),[n,t,u]),p=(0,c.Ye)((function(){if(!o&&!l)return[{text:d,highlight:!1}];var e=l||o,r=[],n=!1,t=0;return d.replace(e,(function(e,s){return n=!0,s>t&&r.push({text:d.slice(t,s),highlight:!1}),r.push({text:e,highlight:!0}),t=s+e.length,e})),t<d.length&&r.push({text:d.slice(t),highlight:!1}),s&&!n?null:r}),[d,o,l,s]);return p?(0,a.jsx)("div",{className:i()("message",r),children:p.map((function(e,r){return e.highlight?(0,a.jsx)("mark",{children:e.text},r):(0,a.jsx)("span",{children:e.text},r)}))}):null}var u={DARK:"dark",LIGHT:"light"};function d(e){var r=e.theme,n=void 0===r?u.DARK:r,s=e.messages,d=e.wrapped,p=e.messagesListRef,m=e.onScroll,v=e.filter,f=e.search,h=e.basicTimestamps,j=e.loading,g=e.error,x=e.combineMsg,b=function(e){var r=(0,c.Ye)((function(){if(e)return new RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"gi")}),[e]),n="";try{n=(0,c.Ye)((function(){if(e)return new RegExp(e,"gi")}),[e])}catch(e){n=""}return[r,n]}(f),C=(0,t.Z)(b,2),N=C[0],S=C[1];return g?(0,a.jsx)(o.bZ,{error:g}):(0,a.jsx)("div",{className:i()("rt-logging-area",n),children:(0,a.jsxs)("div",{className:i()("logging-messages",{wrapped:d}),ref:p,onScroll:m,children:[j&&(0,a.jsx)("div",{className:"d--f ai--c jc--c padding-xs",children:(0,a.jsx)(o.$j,{small:!0})}),s.map((function(e,r){var n=e.type,t=e.timestamp,s=e.text,i=x?x(e):s;return(0,a.jsx)(l,{className:n&&n.toLowerCase(),text:i,timestamp:t,filter:v,searchPatternRegExp:S,searchPattern:N,basicTimestamps:h},e.id||r)}))]})})}},
1"./views/mcp-servers/page.js":(e,r,n)=>{n.r(r),n.d(r,{default:()=>Ve});var t=n("./router/index.js"),s=n("./views/common/page/index.js"),i=n("./constants/community.js"),c=n("./contexts/document-title.js"),o=n("./contexts/headline.js"),a=n("./hooks/index.js"),l=n("./constants/action-types/index.js"),u=n("./actions/app/bl.js"),d=function(e){return{types:l.Z.api(l.Z.LOAD_MCP_API_SERVICES),appId:e,apiCall:function(r){return r.mcpApiServices.getMcpApiServices(e)}}},p=function(e,r){return function(n){return n({types:l.Z.api(l.Z.ENABLE_MCP_API_SERVICE),appId:e,serviceId:r,apiCall:function(n){return n.mcpApiServices.enableMcpApiService(e,r)}}).then((function(){return Promise.all([n(d(e)),n((0,u.k4)(e,!0))])}))}},m=function(e,r){return function(n){return n({types:l.Z.api(l.Z.DISABLE_MCP_API_SERVICE),appId:e,serviceId:r,apiCall:function(n){return n.mcpApiServices.disableMcpApiService(e,r)}}).then((function(){return Promise.all([n(d(e)),n((0,u.k4)(e,!0))])}))}},v=n("./utils/uuid.js"),f=function(e){return{types:l.Z.api(l.Z.LOAD_REGISTERED_MCP_CLIENTS),appId:e,apiCall:function(r){return r.mcpServices.getMcpClients(e)}}},h=function(e,r,n){return{types:l.Z.api(l.Z.UPDATE_MCP_CLIENT),appId:e,serviceId:r,data:n,apiCall:function(r){return r.mcpServices.updateMcpClient(e,n)}}},j=function(e,r){return{types:l.Z.api(l.Z.UNREGISTER_MCP_CLIENT),appId:e,data:r,apiCall:function(n){return n.mcpServices.deleteMcpClient(e,r)}}},g=function(e,r){return{types:l.Z.api(l.Z.PING_MCP_CLIENT),appId:e,mcpClient:r,apiCall:function(n){return n.mcpServices.pingMcpClient(e,r,{method:"ping",jsonrpc:"2.0",id:(0,v.Zj)(),params:{}})}}},x=n("./reducers/index.js"),b=n("./ui-comments/index.js"),C=n("./views/bricks/bricks.js"),N=n("../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"),S=n("./utils/routes-manager.js"),y=n("./utils/storage.js"),O=n("../node_modules/prop-types/index.js"),P=n.n(O),I=n("../node_modules/classnames/index.js"),w=n.n(I),E=n("../node_modules/react/jsx-runtime.js");function M(e){var r=e.logo,n=e.size,t=void 0===n?"normal":n,s=e.className,i=void 0===s?"":s;return r?(0,E.jsxs)("div",{className:w()(i,"generic-logo-display size-".concat(t)),children:[r.icon&&(0,E.jsx)("div",{className:"logo-icon",style:{backgroundColor:r.color},children:(0,E.jsx)(C.xu,{icon:r.icon})}),r.url&&(0,E.jsx)(C.Ee,{className:"logo-icon",src:r.url}),!r.icon&&!r.url&&(0,E.jsx)("div",{className:"logo-letters",style:{backgroundColor:r.color},children:r.letters})]}):(0,E.jsx)("div",{className:w()(i,"generic-logo-display size-".concat(t)),children:(0,E.jsx)("div",{className:"logo-empty",children:"?"})})}M.propTypes={logo:P().shape({icon:P().string,letters:P().string,color:P().string,url:P().string}),size:P().oneOf(["small","normal","large"]),className:P().string};var R=n("./utils/file.js"),A=function(e){var r=e.appId,n=e.lang,t=e.model,s=e.mode,i=e.icon;return i&&!(0,R.dY)(i)?"/api/node-server/public/app/".concat(r,"/cloud-code/").concat(n,"/").concat(t,"/").concat(s).concat(i):i},Z=n("./views/mcp-servers/constants.js"),k=n("./global-dialogs/index.js"),_=n("../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),T=n("../node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),D=n("../node_modules/@babel/runtime/helpers/esm/defineProperty.js"),L=n("../node_modules/@babel/runtime/regenerator/index.js"),H=n.n(L),V=n("./utils/console-status.js"),F=n("../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"),z=["children","label","helpIcon","error","className"];function G(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function J(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?G(Object(n),!0).forEach((function(r){(0,D.Z)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function U(e){var r=e.children,n=e.label,t=e.helpIcon,s=e.error,i=e.className,c=(0,F.Z)(e,z);return(0,E.jsx)(C.l0.Group,J(J({label:t?(0,E.jsxs)(E.Fragment,{children:[n,(0,E.jsx)(C.aV,{popover:t,persistentPortal:!0,children:(0,E.jsx)(C.xu,{icon:"circle-question",className:"ml-1",regular:!0})})]}):n,error:s,className:i,small:!0},c),{},{children:r}))}var Y=n("../node_modules/react/index.js"),q=n("./actions/alerts.js"),W=n("./utils/validation.js"),B=function(){return function(e){var r={},n=(0,W.C1)("API service should not be empty")(e.apiService);return n&&(r.apiService=n),Object.keys(r).length>0?r:null}};var K=(0,Y.forwardRef)((function(e,r){var n=e.onHide,s=(0,a.qD)(),i=(0,a.ol)({loadServicesIfNeeded:u.qD,enableMcpApiService:p}),c=(0,a.v9)(x.Sur),o=c.loading,l=c.map,d=(0,a.eJ)(null),m=(0,T.Z)(d,2),v=m[0],f=m[1],h=function(e){var r=(0,a.eJ)({}),n=(0,T.Z)(r,2),t=n[0],s=n[1],i=(0,a.eJ)(!1),c=(0,T.Z)(i,2),o=c[0],l=c[1],u=(0,a.I4)((function(){s({}),l(!1)}),[]),d=(0,a.I4)((function(){var r=B()(e);return s(r||{}),l(!0),!r}),[e]);return(0,a.d4)((function(){if(o){var r=B()(e);s(r||{})}}),[o,e]),[t,d,u]}({apiService:v}),j=(0,T.Z)(h,3),g=j[0],b=j[1],N=j[2];(0,a.d4)((function(){i.loadServicesIfNeeded(s.id)}),[]);var y=(0,a.I4)((function(){f(null),N(),n()}),[N,n]);(0,a.aP)(r,(function(){return{create:(e=(0,_.Z)(H().mark((function e(){return H().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(b()){e.next=2;break}return e.abrupt("return");case 2:return e.abrupt("return",i.enableMcpApiService(s.id,v).then((function(){return(0,q.$
1E)("API service was enabled as MCP successfully.")})).then((function(){var e=l[v],r=null==e?void 0:e.name;r&&t.mW.replace(S.RM.toMcpServer(s.name,r))})).then(n).then(y).catch(q.iT));case 3:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)}),resetForm:y};var e}));var O=(0,a.Ye)((function(){return Object.values(l).filter((function(e){var r,n;return!(null!==(r=e.internalServiceInfo)&&void 0!==r&&r.enabledAsMCP&&null!==(n=e.serviceInfo)&&void 0!==n&&n.enabledAsMCP)})).map((function(e){return{label:e.name,value:e.id}}))}),[l]),P=(0,a.I4)((function(e){f(null==e?void 0:e.value)}),[]);return(0,E.jsx)("div",{className:"mcp-form api-service-form",children:(0,E.jsx)(U,{label:"API Service",error:g.apiService,children:(0,E.jsx)(C.Ph,{block:!0,isClearable:!0,isSearchable:!0,isLoading:o,disabled:o,value:v,placeholder:"Select API service",options:O,onChange:P})})})})),$=function(e,r){return{types:l.Z.api(l.Z.LOAD_HOSTING_MCP_SERVER_STATUS),appId:e,mcpServerName:r,apiCall:function(n){return n.hostingMcpServices.getHostingMcpServerStatus(e,r)}}},X=function(e,r){return{types:l.Z.api(l.Z.CREATE_HOSTING_MCP_SERVER),appId:e,data:r,apiCall:function(n){return n.hostingMcpServices.createHostingMcpServer(e,r)}}},Q=function(e,r,n){return function(t){return t({types:l.Z.api(l.Z.CHANGE_HOSTING_MCP_SERVER_STATE),appId:e,state:r,data:n,apiCall:function(s){return s.hostingMcpServices.changeHostingMcpServerState(e,r,n).then((function(){return t($(e,n.mcpServerName))}))}})}},ee=function(e){var r=Object.values(e||{}).reduce((function(e,r){var n,t=r.mcpServerName||(null===(n=r.serviceInfo)||void 0===n?void 0:n.serviceName);return t&&(e[t]=!0),e}),{}),n={mcpServerName:function(e){return e?r[e]?"MCP server name must be unique":void 0:"Enter MCP server name"},command:(0,W.C1)("Command should not be empty"),args:(0,W.C1)("Arguments should not be empty")};return(0,W.CN)(n)};function re(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function ne(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?re(Object(n),!0).forEach((function(r){(0,D.Z)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var te={mcpServerName:"",imageName:"",imageVersion:"",command:"",args:"",envs:[]},se=(0,Y.forwardRef)((function(e,r){var n=e.mcpServers,t=e.onHide,s=(0,a.cf)(),i=(0,a.ol)({createHostingMcpServer:X}),c=(0,a.R1)(te),o=(0,T.Z)(c,2),l=o[0],u=o[1],d=function(e,r){var n=(0,a.eJ)({}),t=(0,T.Z)(n,2),s=t[0],i=t[1],c=(0,a.eJ)(!1),o=(0,T.Z)(c,2),l=o[0],u=o[1],d=(0,a.I4)((function(){i({}),u(!1)}),[]),p=(0,a.I4)((function(){var n=ee(r)(e);return i(n||{}),u(!0),!n}),[e,r]);return(0,a.d4)((function(){if(l){var n=ee(r)(e);i(n||{})}}),[l,e,r]),[s,p,d]}(l,n),p=(0,T.Z)(d,3),m=p[0],v=p[1],f=p[2],h=(0,a.I4)((function(){u(te),f(),t()}),[f,t]);(0,a.aP)(r,(function(){return{create:(e=(0,_.Z)(H().mark((function e(){return H().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(v()){e.next=2;break}return e.abrupt("return");case 2:return e.abrupt("return",i.createHostingMcpServer(s,l).then((function(){return(0,q.$E)("MCP server created successfully")})).then(t).then(h).catch((function(e){return(0,q.iT)(e,"Failed to create MCP server")})));case 3:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)}),resetForm:h};var e}));var j=(0,a.I4)((function(e){return function(r){u((0,D.Z)({},e,r))}}),[]),g=(0,a.I4)((function(e,r,n){var t=(0,N.Z)(l.envs);t[e]=ne(ne({},t[e]),{},(0,D.Z)({},r,n)),u({envs:t})}),[l.envs]),x=(0,a.I4)((function(){u({envs:[].concat((0,N.Z)(l.envs),[{name:"",value:""}])})}),[l.envs]),b=(0,a.I4)((function(e){var r=l.envs.filter((function(r,n){return n!==e}));u({envs:r})}),[l.envs]);return(0,E.jsxs)("div",{className:"mcp-form",children:[(0,E.jsx)(U,{label:"MCP Server Name",error:m.mcpServerName,children:(0,E.jsx)(C.oi,{value:l.mcpServerName,onChange:j("mcpServerName"),placeholder:"Enter MCP server name"})}),V.O.featureToggle.mcpHostingImageName&&(0,E.jsx)(U,{label:"Image Name",error:m.imageName,children:(0,E.jsx)(C.oi,{value:l.imageName,onChange:j("imageName"),placeholder:"Enter image name"})}),V.O.featureToggle.mcpHostingImageVersion&&(0,E.jsx)(U,{label:"Image Version",error:m.imageVersion,children:(0,E.jsx)(C.oi,{value:l.imageVersion,onChange:j("imageVersion"),placeholder:"Enter image version"})}),(0,E.jsx)(U,{label:"Command",error:m.command,children:(0,E.jsx)(C.oi,{value:l.command,onChange:j("command"),placeholder:"Enter command (e.g., npx, python, uvx, node)"})}),(0,E.jsx)(U,{label:"Arguments",error:m.args,children:(0,E.jsx)(C.oi,{value:l.args,onChange:j("args"),placeholder:"Enter arguments"})}),(0,E.jsx)(U,{label:"Environment Variables",children:(0,E.jsxs)("div",{className:"envs-l
1ist",children:[l.envs.map((function(e,r){return(0,E.jsxs)("div",{className:"envs-item",children:[(0,E.jsx)(C.oi,{value:e.name,onChange:function(e){return g(r,"name",e)},placeholder:"Name"}),(0,E.jsx)(C.oi,{value:e.value,onChange:function(e){return g(r,"value",e)},placeholder:"Value"}),(0,E.jsx)(C.xu,{action:!0,icon:"remove",onClick:function(){return b(r)}})]},r)})),(0,E.jsx)(C.zx,{type:"link",onClick:x,label:"+ Add Environment Variable"})]})})]})})),ie=(0,D.Z)((0,D.Z)({},Z.nC.API_SERVICE,K),Z.nC.HOSTED,se),ce=[{value:Z.nC.API_SERVICE,label:Z.nC.API_SERVICE},{value:Z.nC.HOSTED,label:Z.nC.HOSTED,enabled:function(){return V.O.featureToggle.createHostedMcpServers}}];function oe(e){var r=e.show,n=e.onHide,t=e.mcpServers,s=(0,a.sO)(),i=(0,a.eJ)(!1),c=(0,T.Z)(i,2),o=c[0],l=c[1],u=(0,a.eJ)(Z.nC.API_SERVICE),d=(0,T.Z)(u,2),p=d[0],m=d[1],v=(0,a.Ye)((function(){return ce.filter((function(e){return!e.enabled||e.enabled()}))}),[]),f=(0,a.I4)((0,_.Z)(H().mark((function e(){return H().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l(!0),e.next=3,s.current.create();case 3:l(!1);case 4:case"end":return e.stop()}}),e)}))),[]),h=(0,a.I4)((function(){s.current.resetForm()}),[]),j=ie[p];return(0,E.jsxs)(C.u_,{show:r,onHide:h,children:[(0,E.jsx)(C.xB,{closeButton:!o,children:(0,E.jsx)(C.r6,{children:"Create MCP Server"})}),(0,E.jsx)(C.fe,{children:(0,E.jsxs)("div",{className:"create-mcp-server-modal",children:[(0,E.jsx)(U,{label:"Source",children:(0,E.jsx)(C.Ph,{block:!0,value:p,onChange:function(e){return m(null==e?void 0:e.value)},options:v,disabled:o})}),(0,E.jsx)(j,{ref:s,mcpServers:t,onHide:n})]})}),(0,E.jsxs)(C.mz,{children:[(0,E.jsx)(C.zx,{type:"default",onClick:h,label:"Cancel",disabled:o}),(0,E.jsx)(C.zx,{type:"primary",busy:o,onClick:f,label:"Create",busyLabel:"Creating..."})]})]})}function ae(e){var r=e.mcpServers,n=(0,a.I4)((function(){k.Ae.showDialog(oe,{mcpServers:r})}),[r]);return(0,E.jsx)(s.gj.Action,{icon:"plus",tooltip:"Create new MCP server",onClick:n})}function le(e){var r,n,t=e.mcpServer,i=(0,a.cf)(),c=(0,a.ol)({disableMcpApiService:m,unregisterMCPClient:j}),o=(0,a.I4)((function(){var e=t.serviceInfo,r=e.serviceId;(e.hostingProvider===Z.E_.API_SERVICE?c.disableMcpApiService(i,r):c.unregisterMCPClient(i,{serviceId:r})).then((function(){return(0,q.$E)("The MCP server was successfully deleted.")})).catch(q.iT)}),[null==t||null===(r=t.serviceInfo)||void 0===r?void 0:r.serviceId]),l=(0,a.I4)((0,_.Z)(H().mark((function e(){var r;return H().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,k.un)((0,E.jsx)(ue,{serverName:t.serviceInfo.serviceName}));case 2:r=e.sent,r.confirmed&&o();case 5:case"end":return e.stop()}}),e)}))),[null==t||null===(n=t.serviceInfo)||void 0===n?void 0:n.serviceName,o]);return(0,E.jsx)(s.gj.Action,{icon:"trash",tooltip:"Delete selected MCP server",onClick:l,disabled:!t})}function ue(e){var r=e.serverName;return(0,E.jsxs)("div",{children:["Are you sure you want to remove the server ",(0,E.jsxs)("b",{children:['"',r,'"']}),"?"]})}var de=n("./hooks/actions.js"),pe=function(e){var r=(0,x.gXT)(e),n=(0,x.Rpz)(e);return{loading:r.loading||n.loading}};function me(){var e=(0,a.cf)(),r=(0,a.v9)(pe).loading,n=(0,de.o)({loadMcpApiServices:d,loadRegisteredMCPClients:f}),t=(0,a.I4)((function(){n.loadRegisteredMCPClients(e),n.loadMcpApiServices(e)}),[]);return(0,E.jsx)(s.gj.Action,{processing:r,onClick:t,children:(0,E.jsx)(C.xu,{icon:"sync",tooltip:"Refresh MCP Servers",spin:r})})}function ve(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function fe(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?ve(Object(n),!0).forEach((function(r){(0,D.Z)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ve(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function he(e){var r=e.mcpServer,n=(0,a.I4)((function(){k.Ae.showDialog(ge,{mcpServer:r})}),[r]);return(0,E.jsx)(s.gj.Action,{icon:"cog",tooltip:"Rename MCP Server",disabled:!r||r.serviceInfo.hostingProvider===Z.E_.API_SERVICE,onClick:n})}var je=function(e){return(0,W.qC)((0,W.C1)("Server name is required"),(0,W.Tw)(e,"This server name is already used",!0))};function ge(e){var r=e.mcpServer,n=e.show,t=e.onHide,s=(0,a.cf)(),i=(0,a.ol)({updateMCPClient:h}),c=(0,a.v9)(x.JcF),o=r.serviceInfo.serviceName,l=(0,a.Ye)((function(){return c.map((function(e){return e.serviceInfo.serviceName}))}),[c]),u=je(l),d=(0,a.I4)((function(e){if(e.trim()!==o)return i.updateMCPClient(s,r.serviceInfo.serviceId,fe(fe({},r),{},{serviceInfo:fe(fe({},r.serviceInfo),{},{serviceName:e.trim()})}
1)).then((function(){return(0,q.$E)("MCP server renamed successfully")})).catch((function(e){return(0,q.iT)(e,"Failed to rename MCP server")}));t()}),[o,r,t]);return(0,E.jsx)(C.NL,{show:n,value:o,title:"Rename MCP Server",placeholder:"Enter server name",validator:u,onHide:t,onSubmit:d})}var xe=function(e){var r=(0,x.yZH)(e),n=(0,x.J8U)(e);return{mcpServers:[].concat((0,N.Z)(r),(0,N.Z)(n))}};function be(){var e=(0,a.cf)(),r=(0,t.Iy)().mcpServerName,n=(0,a.v9)(xe).mcpServers,i=y.ZP.mcpServersHeights()||{},c=(0,a.Ye)((function(){return n.find((function(e){var n;return(null===(n=e.serviceInfo)||void 0===n?void 0:n.serviceName)===r}))}),[r,n]),o=(0,a.Ye)((function(){return n.reduce((function(e,r){var n,t=null===(n=r.serviceInfo)||void 0===n?void 0:n.hostingProvider;return e[t]||(e[t]=[]),e[t].push(r),e}),{})}),[n]),l=(0,a.Ye)((function(){return Object.keys(o)}),[o]),u=(0,a.I4)((function(e,r){var n=r.height;i[e]=n,y.ZP.mcpServersHeights(i)}),[i]);return(0,E.jsxs)(s.gj,{children:[(0,E.jsxs)(s.gj.ActionsBar,{children:[(0,E.jsx)(ae,{mcpServers:n}),(0,E.jsx)(le,{mcpServer:c}),(0,E.jsx)(he,{mcpServer:c}),(0,E.jsx)(me,{})]}),(0,E.jsx)(s.gj.Content,{children:l.map((function(r,n){var t=n===l.length-1,c=(0,E.jsx)(s.gj.Group,{title:Z.nC[r],children:o[r].map((function(r){var n,t,i=null===(n=r.serviceInfo)||void 0===n?void 0:n.serviceName,c=r.serviceInfo||{},o=c.lang,a=c.model,l=c.mode,u=c.logo;"string"==typeof u?t={url:A({appId:e,lang:o,model:a,mode:l,icon:u})}:t=u;return(0,E.jsx)(s.gj.GroupNavItem,{showCounter:!1,to:S.RM.toMcpServer(null,i),subEl:(0,E.jsx)(M,{logo:t,size:"small"}),children:i},i)}))},r);return t?c:(0,E.jsx)(C.ez,{initHeight:i[r]||"50%",minHeight:150,maxHeight:"80%",onChange:function(e){return u(r,e)},children:c},r)}))})]})}var Ce=function(e){var r=(0,x.gXT)(e),n=(0,x.Rpz)(e);return{mcpClientsError:r.error,mcpClientsLoaded:r.loaded,mcpApiServicesError:n.error,mcpApiServicesLoaded:n.loaded}};function Ne(){(0,c.jr)("MCP Servers"),(0,o.Md)("MCP Servers"),(0,b.Z)({context:i.FY.MCP_SERVERS,itemId:"mcp-servers",label:"MCP Servers"});var e=(0,a.cf)(),r=(0,a.ol)({loadMcpApiServices:d,loadRegisteredMCPClients:f}),n=(0,a.v9)(Ce),l=n.mcpClientsError,u=n.mcpClientsLoaded,p=n.mcpApiServicesError,m=n.mcpApiServicesLoaded;return(0,a.d4)((function(){r.loadMcpApiServices(e),r.loadRegisteredMCPClients(e)}),[]),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(be,{}),(0,E.jsx)(s.JH,{children:(0,E.jsx)(s.JH.Section,{children:(0,E.jsx)(s.JH.SectionContent,{className:"d--f fd--c flex-1 overflow-hidden",children:(0,E.jsx)(C.$j,{error:l||p,loaded:u&&m,children:u&&m&&(0,E.jsx)(t.BW,{})})})})})]})}var Se=n("./views/common/layout/index.js"),ye=1e4,Oe=3e3,Pe={STOPPED:"start",RUNNING:"stop"};function Ie(e){var r=e.serviceInfo,n=(0,a.cf)(),t=(0,a.ol)({changeHostingMcpServerState:Q,loadHostingMcpServerStatus:$}),s=(0,a.sO)(null),i=(0,a.eJ)(!1),c=(0,T.Z)(i,2),o=c[0],l=c[1],u=(0,a.v9)(x.zyy,r.serviceName),d=(0,a.I4)((function(){t.loadHostingMcpServerStatus(n,r.serviceName)}),[r.serviceName]);(0,a.d4)((function(){d();var e=u.state===Z.LU.RUNNING?ye:Oe;return s.current=setInterval(d,e),function(){s.current&&clearInterval(s.current)}}),[d,u.state]);var p=(0,a.I4)((function(){l(!0),t.changeHostingMcpServerState(n,Pe[u.state],{mcpServerName:r.serviceName}).then((function(){return(0,q.$E)("Request has been accepted.")})).finally((function(){return l(!1)}))}),[u.state,r.serviceName]);return(0,E.jsxs)("div",{className:"mcp-server-field",children:[(0,E.jsx)("b",{children:"Status:"}),(0,E.jsx)(C.aV,{popover:u.message,children:(0,E.jsxs)("span",{className:"mcp-status",children:[(0,E.jsx)("span",{className:"status-indicator ".concat((u.state||Z.LU.UNKNOWN).toLowerCase())}),u.state||Z.LU.UNKNOWN]})}),(0,E.jsx)(C.xu,{action:!0,icon:"sync",tooltip:"Refresh Status",spin:o,onClick:d}),Pe[u.state]&&(0,E.jsx)(C.zx,{outline:!0,className:"btn-sm",type:"secondary",label:Pe[u.state],busy:o,disabled:o,onClick:p})]})}function we(e){var r=e.serviceInfo,n=(0,a.cf)(),t=(0,a.ol)({pingMcpClient:g}),s=(0,a.eJ)(!1),i=(0,T.Z)(s,2),c=i[0],o=i[1],l=r.hostingProvider===Z.E_.HOSTED,u=(0,a.I4)((function(){o(!0),t.pingMcpClient(n,r.serviceName).then((function(){return(0,q.$
1E)("Ping: OK!")})).catch(q.iT).finally((function(){return o(!1)}))}),[r.serviceName]);return(0,E.jsxs)("div",{className:"mcp-server-overview",children:[l&&(0,E.jsx)(Ie,{serviceInfo:r}),r.mcpURL&&(0,E.jsxs)("div",{className:"mcp-server-field",children:[(0,E.jsx)("b",{children:"Server URL:"}),(0,E.jsx)("a",{className:"mcp-link",href:r.mcpURL,target:"_blank",rel:"noopener noreferrer",children:r.mcpURL}),(0,E.jsx)(C.h9,{text:r.mcpURL,tooltip:"Copy URL",children:(0,E.jsx)(C.xu,{action:!0,icon:"copy"})}),l&&(0,E.jsx)(C.zx,{outline:!0,className:"btn-sm",type:"secondary",label:"ping",busy:c,disabled:c,onClick:u})]}),(0,E.jsxs)("div",{className:"mcp-server-field",children:[(0,E.jsx)("b",{children:"Description:"}),(0,E.jsx)("div",{className:"mcp-description",children:r.description})]})]})}var Ee=n("./actions/files.js"),Me=n("./views/common/rt-logging/messages.js");function Re(e){var r=e.tool,n=e.isActiveTool,t=e.onClick;return(0,E.jsxs)("div",{className:"tool-item ".concat(n?"active":""),onClick:t,children:[(0,E.jsx)("div",{className:"tool-name",children:r.name}),r.description&&(0,E.jsx)("div",{className:"tool-description mt-1",children:r.description})]})}function Ae(e){var r=e.param;return(0,E.jsxs)("div",{className:"parameter",children:[(0,E.jsx)("div",{className:"param-name mb-1",children:r.name}),(0,E.jsx)("div",{className:"param-type",children:r.type}),r.description&&(0,E.jsx)("div",{className:"param-description mt-2",children:r.description})]})}function Ze(e){var r=e.activeTab,n=e.setActiveTab,t=e.isApiService;return(0,E.jsxs)(C.ln,{activeKey:r,onSelect:n,children:[(0,E.jsx)(C.PN,{eventKey:Z.cw.TOOLS,children:Z.cw.TOOLS}),(0,E.jsx)(C.PN,{eventKey:Z.cw.RESOURCES,children:Z.cw.RESOURCES}),(0,E.jsx)(C.PN,{eventKey:Z.cw.PROMPTS,children:Z.cw.PROMPTS}),!t&&(0,E.jsx)(C.PN,{eventKey:Z.cw.LOGS,children:Z.cw.LOGS})]})}var ke=(0,D.Z)((0,D.Z)((0,D.Z)((0,D.Z)({},Z.cw.TOOLS,(function(e){var r,n=e.tools,t=void 0===n?[]:n,s=(0,a.eJ)(0),i=(0,T.Z)(s,2),c=i[0],o=i[1],l=(0,a.Ye)((function(){return null==t?void 0:t[c]}),[c,t]);return(0,E.jsxs)("div",{className:"mcp-tools-section",children:[(0,E.jsx)("div",{className:"tools-list scroller",children:t.map((function(e,r){return(0,E.jsx)(Re,{tool:e,isActiveTool:c===r,onClick:function(){return o(r)}},e.id)}))}),(0,E.jsx)("div",{className:"tool-details scroller",children:(null==t?void 0:t[c])&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:"tool-title mb-2",children:[l.name," parameters"]}),null!=l&&null!==(r=l.params)&&void 0!==r&&r.length?l.params.map((function(e,r){return(0,E.jsx)(Ae,{param:e},r)})):(0,E.jsx)("p",{children:"No parameters."})]})})]})})),Z.cw.RESOURCES,(function(){return(0,E.jsx)("div",{className:"mcp-resources-section",children:(0,E.jsx)("p",{children:"Not implemented yet!"})})})),Z.cw.PROMPTS,(function(){return(0,E.jsx)("div",{className:"mcp-prompts-section",children:(0,E.jsx)("p",{children:"Not implemented yet!"})})})),Z.cw.LOGS,(function(){var e=(0,a.cf)(),r=(0,t.Iy)().mcpServerName,n=(0,de.o)({getFileContent:Ee.LK}),s=(0,a.eJ)(""),i=(0,T.Z)(s,2),c=i[0],o=i[1],l=(0,a.eJ)(!1),u=(0,T.Z)(l,2),d=u[0],p=u[1],m=(0,a.eJ)(null),v=(0,T.Z)(m,2),f=v[0],h=v[1];(0,a.d4)((function(){r&&(p(!0),h(null),n.getFileContent(e,"/logging/mcp-server-".concat(r,".log")).then((function(e){return o(e)})).catch((function(e){return h(e.message)})),p(!1))}),[r]);var j=(0,a.Ye)((function(){return c?c.split("\n").map((function(e,r){return{id:r,text:e,timestamp:Date.now(),type:"INFO"}})):[]}),[c]);return(0,E.jsx)("div",{className:"mcp-logs-section",children:(0,E.jsx)(Me.ZP,{wrapped:!0,error:f,loading:d,messages:j})})})),_e=function(e,r){var n,t,s=r.mcpServerName,i=(0,x.yZH)(e),c=(0,x.J8U)(e),o=[].concat((0,N.Z)(i),(0,N.Z)(c)).find((function(e){return e.serviceInfo.serviceName===s})),a=null==o||null===(n=o.serviceInfo)||void 0===n?void 0:n.serviceId,l=(0,x.R0t)(e,a);return{selectedServer:o,serviceId:a,hasMissedConfigs:(null==o||null===(t=o.serviceInfo)||void 0===t?void 0:t.hostingProvider)===Z.E_.API_SERVICE&&Object.values(l||{}).some((function(e){return!e}))}};function Te(){var e=(0,a.qD)(),r=(0,t.Iy)().mcpServerName,n=(0,a.v9)(_e,{mcpServerName:r}),s=n.selectedServer,i=n.serviceId,c=n.hasMissedConfigs,o=(0,a.ol)({loadServiceConfig:u.bl}),l=(0,a.eJ)(Z.cw.TOOLS),d=(0,T.Z)(l,2),p=d[0],m=d[1];(0,a.d4)((function(){m(Z.cw.TOOLS)}),[]),(0,a.d4)((function(){i&&o.loadServiceConfig(e.id,i)}),[i]),(0,a.d4)((function(){s||t.mW.replace(S.RM.toMcpServers(e.name))}),[e.name,s]);var v=ke[p];return(0,E.jsx)(C.$j,{loaded:!!s,children:s&&(0,E.jsxs)("div",{className:"mcp-server-container",children:[(0,E.jsxs)(Se.Y,{children:[c&&(0,E.jsx)(De,{model:s.serviceInfo.model,serviceName:s.serviceInfo.serviceName}),(0,E.jsx)(we,{serviceInfo:s.serviceInfo})]}),(0,E.jsxs)(Se.Y,{className:"mcp-server-panel",children:[(0,E.jsx)(Ze,{activeTab:p,setActiveTab:m,isApiService:s.serviceInfo.hostingProvider===Z.E_.API_SERVICE}),(0,E.jsx)("div",{className:"mcp-server-content",children:(0,E.jsx)(v,{tools:s.elements})})]})]})})}function De(e){var r=e.model,n=e.serviceName;return(0,E.jsxs)(C.UW,{type:"warning",className:"d--f ai--c mb-4 text-sm",children:[(0,E.jsx)("div",{className:"fg--0 mr-3",children:(0,E.jsx)(C.xu,{icon:"triangle-exclamation",size:2})}),(0,E.jsxs)("div",{className:"fg--1",children:["The API Service for the MCP Server is not properly configured. Please go to the",(0,E.jsx)("a",{href:S.RM.toBLService(r,n),target:"_blank",children:" API Services "}),"page to set the configuration."]})]})}var Le=function(e){var r,n=(0,x.yZH)(e),t=(0,x.J8U)(e),s=[].concat((0,N.Z)(n),(0,N.Z)(t));return{mcpServers:s,firstMcpServer:null===(r=s[0])||void 0===r||null===(r=r.serviceInfo)||void 0===r?void 0:r.serviceName}};function He(){var e=(0,a.v9)(Le),r=e.mcpServers,n=e.firstMcpServer;return(0,a.d4)((function(){n&&t.mW.replace(S.RM.toMcpServer(null,n))}),[n]),r.length?null:(0,E.jsxs)("div",{className:"placeholder",children:[(0,E.jsx)(C.xu,{icon:"server",className:"margin-right-xs"}),"There are no registered MCP servers yet.",(0,E.jsxs)("span",{children:[(0,E.jsx)(C.mH,{popup:oe,tagName:"a",children:" Add one"})," now."]})]})}function Ve(){return(0,E.jsx)(s.ZP,{children:(0,E.jsx)(t.Z5,{children:(0,E.jsxs)(t.AW,{path:"/",element:(0,E.jsx)(Ne,{}),children:[(0,E.jsx)(t.AW,{index:!0,element:(0,E.jsx)(He,{})}),(0,E.jsx)(t.AW,{path:":mcpServerName",element:(0,E.jsx)(Te,{})})]})})})}}
1}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.