!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="90522262-a7a3-4ab8-8395-8f936642a94b",e._sentryDebugIdIdentifier="sentry-dbid-90522262-a7a3-4ab8-8395-8f936642a94b")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"08864407160b3973b9b88c5ae92687282b21e2f4"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[7410],{47130:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(58168),r=n(96540),a=n(10058),d=n(29217);const l=e=>function(){let{tooltipProps:t={},...n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n.tooltip||Object.keys(t).length?r.createElement(d.A,(0,o.A)({plain:!0,content:n.tooltip},t),r.createElement(a.Box,null,r.createElement(e,n))):r.createElement(e,n)}},94390:(e,t,n)=>{n.d(t,{D9:()=>i,FL:()=>o,Fn:()=>c,T_:()=>s,V6:()=>d,V8:()=>u,bM:()=>a,g7:()=>r,gh:()=>l,lp:()=>p,zy:()=>h});const o=51,r={template:{color:"success"},default:{color:"text"}},a={accepted:{label:"Accepted",color:"success",icon:"checkmark_s"},disabled:{label:"Disabled",color:["neutral","grey100"],icon:"none_selected"},failed:{label:"Failed",color:["red","red100"],icon:"warning_triangle"},orphan:{label:"Orphan",color:["neutral","grey90"],icon:"checkmark_partial_s"},incomplete:{label:"Incomplete",color:["yellow","yellow100"],icon:"incindent_manager"},running:{label:"Running",color:"success",icon:"checkmark_s"}},d={internal:{icon:"internalConfig"},stock:{icon:"stockConfig"},user:{icon:"userConfig"},discovered:{icon:"discoveredConfig"},dyncfg:{icon:"dynamicConfig"}},l={loaded:!0,value:{},hasError:!1},i="__unsaved__",c="Something went wrong",s={accepted:{label:"Accepted",color:"border",searchCondition:{status:"accepted"}},disabled:{label:"Disabled",color:"border",searchCondition:{status:"disabled"}},failed:{label:"Failed",color:"border",searchCondition:{status:"failed"}},orphan:{label:"Orphan",color:"border",searchCondition:{status:"orphan"}},incomplete:{label:"Incomplete",color:"border",searchCondition:{status:"incomplete"}},running:{label:"Running",color:"border",searchCondition:{status:"running"}}},u={internal:{label:"Internal",color:"border",searchCondition:{source_type:"internal"}},stock:{label:"Stock",color:"border",searchCondition:{source_type:"stock"}},user:{label:"User",color:"border",searchCondition:{source_type:"user"}},discovered:{label:"Discovered",color:"border",searchCondition:{source_type:"discovered"}},dyncfg:{label:"Dynamic configuration",color:"border",searchCondition:{source_type:"dyncfg"}}},p={restartRequired:{label:"Restart required",color:"border",searchCondition:{restart_required:!0}},pluginRejected:{label:"Plugin rejected",color:"border",searchCondition:{plugin_rejected:!0}}},h=["restartRequired","pluginRejected","failed","incomplete"]},8239:(e,t,n)=>{n.d(t,{Nj:()=>N,SW:()=>O,Hj:()=>B,t8:()=>j,wd:()=>S,OD:()=>U,_O:()=>Z,QH:()=>L,sh:()=>I,IP:()=>q,OU:()=>T,ZN:()=>R,SD:()=>K,EZ:()=>x,DP:()=>D,O_:()=>H,xS:()=>F,_F:()=>w});n(17333),n(98992),n(54520),n(62953);var o=n(96540),r=n(47444),a=(n(9920),n(3949),n(48408),n(26655)),d=n(37618),l=n(49286);const i=e=>({...e,attention:(0,l.bn)(e.attention)}),c={tree:a.A.get,schema:a.A.get,get:a.A.get,enable:a.A.get,disable:a.A.get,restart:a.A.get,remove:a.A.get,add:a.A.post,update:a.A.post,test:a.A.post,default:a.A.get},s=function(){let{node:e,searchParams:t={},payload:n={},...o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Object.entries(e);if(!t.length)return"";const n=new URLSearchParams;return t.forEach((e=>{let[t,o]=e;o&&n.append(t,o)})),"?".concat(n.toString())}(t),{action:l}=t,s=c[l]||c.default,u={..."tree"==l?{transform:i,...o}:{...o},...d.Ay?{baseURL:window.envSettings.agentApiUrl,...o}:{...o}},p=s==a.A.get?[u]:[n,u];return d.Ay?s("/api/v1/config".concat(r),...p):s("/api/v2/nodes/".concat(e,"/config").concat(r),...p)},u=e=>{let{node:t,path:n,id:o}=e;return s({node:t,searchParams:{action:"tree",path:n,id:o},allow401:!0})},p=e=>{let{id:t,node:n}=e;return s({node:n,searchParams:{action:"enable",id:t}})},h=e=>{let{id:t,node:n}=e;return s({node:n,searchParams:{action:"disable",id:t}})},g=(0,r.eU)({key:"newConfigurationItemAtom",default:null}),f=(0,r.eU)({key:"dyncnfModalAtom",default:null}),b=(0,r.eU)({key:"dyncnfKeyAtom",default:0}),y=(0,r.Iz)({key:"dyncnfVirtualListScrollPosition",default:0}),v=(0,r.eU)({key:"dyncnfOpenItems",default:[]}),m=(0,r.Iz)({key:"dyncnfItemTree",default:null});var _=n(81198),k=n(94390);const A=(0,r.K0)({key:"configurationsTree",get:e=>{let{node:t,path:n}=e;return e=>{let{get:o}=e;return o(b),u({node:t,path:n})}},cachePolicy_UNSTABLE:{eviction:"most-recent"}}),C=(0,r.K0)({key:"configurationsSchema",get:e=>{let{id:t,node:n}=e;return e=>{let{get:o}=e;return o(b),(e=>{let{id:t,node:n}=e;return s({node:n,searchParams:{action:"schema",id:t}})})({id:t,node:n})}},cachePolicy_UNSTABLE:{eviction:"most-recent"}}),E=(0,r.K0)({key:"configurationsData",get:e=>{let{id:t,node:n}=e;return e=>{let{get:o}=e;return o(b),(e=>{let{id:t,node:n}=e;return s({node:n,searchParams:{action:"get",id:t}})})({id:t,node:n})}},cachePolicy_UNSTABLE:{eviction:"most-recent"}}),P=(0,r.K0)({key:"virtualListScrollPositionSelector",get:e=>{let{node:t,path:n}=e;return e=>{let{get:o}=e;return o(y({node:t,path:n}))}},set:e=>{let{node:t,path:n}=e;return(e,o)=>{let{set:r}=e;r(y({node:t,path:n}),o)}},cachePolicy_UNSTABLE:{eviction:"most-recent"}}),w=e=>{let{node:t,path:n}=e;return(0,r.L4)(P({node:t,path:n}))},S=function(){var e;let{node:t,path:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const o=(0,r.xf)(A({node:t,path:n}));return{loaded:"loading"!==o.state,value:null===(e=o.contents)||void 0===e?void 0:e.data,hasError:"hasError"===o.state}},j=function(){var e,t;let{id:n,node:o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const a=(0,r.xf)(C({id:n,node:o})),d=(0,r.RH)(C({id:n,node:o})),l="hasError"===a.state;return{loaded:"loading"!==a.state,value:null===(e=a.contents)||void 0===e?void 0:e.data,hasError:l,error:(null===(t=a.contents)||void 0===t||null===(t=t.response)||void 0===t?void 0:t.data)||(l?k.Fn:null),refresh:d}},O=function(){var e,t;let{id:n,node:o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const a=(0,r.xf)(E({id:n,node:o})),d=(0,r.RH)(E({id:n,node:o})),l="hasError"===a.state;return{loaded:"loading"!==a.state,value:null===(e=a.contents)||void 0===e?void 0:e.data,hasError:l,error:(null===(t=a.contents)||void 0===t||null===(t=t.response)||void 0===t?void 0:t.data)||(l?k.Fn:null),refresh:d}},I=()=>(0,r.vc)(g),L=()=>(0,r.L4)(g),U=()=>(0,r.L4)(f),D=e=>{let{id:t,node:n}=e;return e=>(e?p:h)({id:t,node:n})},R=e=>{let{id:t,node:n}=e;return()=>(e=>{let{id:t,node:n}=e;return s({node:n,searchParams:{action:"restart",id:t}})})({id:t,node:n})},T=e=>{let{id:t,node:n}=e;return()=>(e=>{let{id:t,node:n}=e;return s({node:n,searchParams:{action:"remove",id:t}})})({id:t,node:n})},F=e=>{let{id:t,node:n}=e;return e=>(e=>{let{id:t,node:n,payload:o}=e;return s({node:n,searchParams:{action:"update",id:t},payload:o})})({id:t,node:n,payload:e})},N=e=>{let{id:t,node:n}=e;return e=>{let{name:o,...r}=e;return(e=>{let{id:t,name:n,node:o,payload:r}=e;return s({node:o,searchParams:{action:"add",name:n,id:t},payload:r})})({id:t,name:o,node:n,payload:r})}},x=e=>{let{id:t,node:n}=e;return e=>{let{payload:o}=e;return(e=>{let{id:t,node:n,payload:o}=e;return s({node:n,searchParams:{action:"test",id:t},payload:o})})({id:t,node:n,payload:o})}},B=()=>{const e=(0,r.lZ)(b),[,t]=L();return()=>{e((e=>e+1)),t(null)}},K=e=>{let{node:t,path:n}=e;const{loaded:r,value:a,hasError:d}=S({node:t,path:n});return(0,o.useCallback)((e=>{var t;if(!r||d)return null;const{tree:n}=a||{},o=(0,_.dG)(n);return o[null===(t=o[e])||void 0===t?void 0:t.template]}),[r,a,d])},q=()=>{const[e,t]=(0,r.L4)(v),n=(0,o.useCallback)((e=>{t((t=>t.filter((t=>t!=e))))}),[t]);return{openItems:e,toggle:(0,o.useCallback)(((e,o)=>{o?t((t=>[...t,e])):n(e)}),[t,n]),close:n}},H=e=>{let{node:t,id:n}=e;return(0,r.Zs)((e=>{let{set:o}=e;return async()=>{u({node:t,id:n}).then((e=>{let{data:r}=e;const{tree:a}=r||{};if(a){const e=Object.values(a)[0];if(e){const r=Object.values(e)[0]||{};console.log({entityProps:r}),o(m({node:t,id:n}),(0,l.bn)(r))}}})).catch((()=>{}))}}),[t,n])},Z=e=>{let{node:t,id:n}=e;return(0,r.vc)(m({node:t,id:n}))}},81198:(e,t,n)=>{n.d(t,{J3:()=>o,UE:()=>r,dG:()=>a,m8:()=>d});n(25440),n(17333),n(14905),n(98992),n(54520),n(8872),n(62953);const o=e=>{const t=null===e||void 0===e?void 0:e.split(":");return t?t[t.length-1]:""},r=e=>null===e||void 0===e?void 0:e.split(":").slice(0,-1).join(":"),a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(e).reduce(((e,t)=>{let[n,o]=t;return n.match(/\/[^/]+/g)?{...e,...o}:o}),{})},d=function(){const e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(e).reduce(((e,t)=>{let[n,o]=t;return{...e,[n.replace(/^\/[^/]+/,"")]:o}}),{})}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});return Object.entries(e).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:Object.entries(o).reduce(((e,t)=>{let[n,r]=t;if(["template","single"].includes(r.type)&&(e[n]={...r}),"template"==r.type){const t=Object.entries(o).filter((e=>{let[,{template:t}]=e;return t==n})).reduce(((e,t)=>{let[n,o]=t;return{...e,[n]:o}}),{});Object.keys(t).length&&(e[n].templateChildren=t)}return e}),{})}}),{})}}}]);