diff options
Diffstat (limited to 'web/gui/v2/6942.99ffa6276d630cf3047e.chunk.js')
-rw-r--r-- | web/gui/v2/6942.99ffa6276d630cf3047e.chunk.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/web/gui/v2/6942.99ffa6276d630cf3047e.chunk.js b/web/gui/v2/6942.99ffa6276d630cf3047e.chunk.js new file mode 100644 index 0000000000..a3e207f215 --- /dev/null +++ b/web/gui/v2/6942.99ffa6276d630cf3047e.chunk.js @@ -0,0 +1 @@ +!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]="0346003c-e8e4-4630-a0d8-7f4f47520677",e._sentryDebugIdIdentifier="sentry-dbid-0346003c-e8e4-4630-a0d8-7f4f47520677")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"0c0a7a41a0e7ecb4870dbce38dbd7d5e0913bb7f"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[6942],{95665:function(e,t,n){n.d(t,{Z:function(){return Ue}});var r=n(87462),o=n(29439),a=n(45987),i=(n(66992),n(41539),n(33948),n(92222),n(67294)),c=n(48286),l=n(28789),u=n(69119),s=n(83894),d=n(59978),m=n(92432),f=n(46667),p=n(23109),g=(n(21249),n(57640),n(9924),n(47941),n(82526),n(57327),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(4942)),v=n(71893);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var b=(0,v.default)(d.Flex).attrs((function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){(0,g.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({position:"relative",width:{min:200},height:{min:45},column:!0,background:"dropdown",color:"text",zIndex:60,round:!0,alignItems:"end"},e)})).withConfig({displayName:"styled__PickerBox",componentId:"sc-gwjt9o-0"})([""]),y=v.default.span.withConfig({displayName:"styled__StyledTimePeriod",componentId:"sc-gwjt9o-1"})(["margin-bottom:",";cursor:pointer;width:187px;height:",";&:last-of-type{margin-bottom:0;}& > span:hover{color:",";}"],(0,d.getSizeBy)(1.5),(0,d.getSizeBy)(2),(0,d.getColor)("textLite")),w=(0,v.default)(d.Flex).attrs((function(e){return{color:e.isSelected?"primary":"text",margin:[2,6,0]}})).withConfig({displayName:"styled__StyledCustomTimePeriod",componentId:"sc-gwjt9o-2"})(["cursor:pointer;&:first-of-type{margin-top:0;}&:hover{color:",";}"],(0,d.getColor)("textLite")),E=(0,v.default)(d.Flex).attrs({alignItems:"center",border:{side:"all",color:"border"},color:"text",flexWrap:!1,height:8,justifyContent:"center",padding:[2,0],round:1,width:22}).withConfig({displayName:"styled__TimePeriodDropdownButton",componentId:"sc-gwjt9o-3"})([""]),C=(0,v.default)(d.Drop).attrs({background:"mainBackground",column:!0,overflow:{vertical:"auto"},margin:[.5,0,0],padding:[2,0],round:1}).withConfig({displayName:"styled__TimePeriodDrop",componentId:"sc-gwjt9o-4"})([""]),O=(0,v.default)(d.Icon).withConfig({displayName:"styled__DropdownIcon",componentId:"sc-gwjt9o-5"})(["fill:",";width:12px;height:12px;"],(0,d.getColor)("text")),x=v.default.input.withConfig({displayName:"styled__CustomInput",componentId:"sc-gwjt9o-6"})(["border:1px solid ",";background:",";box-sizing:border-box;border-radius:4px;color:",";height:32px;margin-left:10px;margin-right:10px;outline:none;padding:4px;width:32px;&:focus{border:1px solid ",";}"],(0,d.getColor)("border"),(0,d.getColor)("mainBackground"),(0,d.getColor)("text"),(0,d.getColor)("primary")),k=(0,v.default)(d.Drop).attrs({background:"dropdown",round:2,margin:[.5,0,0],border:{side:"all",color:"borderSecondary"},animation:!0}).withConfig({displayName:"styled__StyledDrop",componentId:"sc-gwjt9o-7"})([""]),S=(0,v.default)(d.TextInput).withConfig({displayName:"styled__StyledDateInput",componentId:"sc-gwjt9o-8"})(["width:100%;"]),Z=v.default.div.withConfig({displayName:"styled__StyledCalendar",componentId:"sc-gwjt9o-9"})(["background:",";border:0;&.react-datepicker{background:",";border:0;}.react-datepicker{&__navigation{top:8px;&-icon::before{border-color:",";}}&__month-container{height:260px;}&__header{background:",";border:0;.react-datepicker__current-month{color:",";font-weight:normal;}.react-datepicker__day-name{color:",";}}&__day{color:",";&:hover{background:",";}&--disabled{color:",";&:hover{background:inherit;}}&--keyboard-selected,&--keyboard-selected:hover{color:",";background:inherit;border-radius:inherit;}&--selected,&--selected:hover{color:",";background:",";border-radius:8px;}&--in-selecting-range,&--in-range{color:",";background:",";border-radius:0;}&--selecting-range-start,&--range-start{color:",";background:",";border-top-left-radius:8px;border-bottom-left-radius:8px;&:hover{color:",";background:",";border-radius:0;border-top-left-radius:8px;border-bottom-left-radius:8px;}}&--selecting-range-end,&--range-end{color:",";background:",";border-top-right-radius:8px;border-bottom-right-radius:8px;&:hover{color:",";background:",";border-top-right-radius:8px;border-bottom-right-radius:8px;}}}}"],(0,d.getColor)("dropdown"),(0,d.getColor)("dropdown"),(0,d.getColor)("text"),(0,d.getColor)("dropdown"),(0,d.getColor)("main"),(0,d.getColor)("textLite"),(0,d.getColor)("main"),(0,d.getColor)("elementBackground"),(0,d.getColor)("textLite"),(0,d.getColor)("main"),(0,d.getColor)("bright"),(0,d.getColor)("primary"),(0,d.getColor)("primary"),(0,d.getColor)("elementBackground"),(0,d.getColor)("bright"),(0,d.getColor)("primary"),(0,d.getColor)("bright"),(0,d.getRgbColor)(["green","netdata"],.8),(0,d.getColor)("bright"),(0,d.getColor)("primary"),(0,d.getColor)("bright"),(0,d.getRgbColor)(["green","netdata"],.8)),P=function(e){var t=e.value,n=e.period,r=e.resolution,o=e.isSelected,a=e.setTimeRange,c=e.tagging,l=(0,i.useCallback)((function(){return a(t,r)}),[t,r]);return i.createElement(y,{key:t,onClick:l,"data-ga":"date-picker::click-quick-selector::".concat(c,"::").concat(-t),"data-testid":"timePeriod-value"},i.createElement(d.Text,{color:o?"primary":"text"},n))},I=(0,i.memo)(P),j=(n(39714),n(83112),n(66528),n(29422)),D=n(99982),N=n(49546),T=n(38431),F=n(76417),M=n(936),_=60,L=3600,A=86400,B=["minutes","hours","days","months"],R={minutes:_,hours:L,days:A,months:2592e3},U=function(e,t){return Math.round(e/R[t])},z=function(e,t){var n=(0,j.Z)(new Date(0),(0,g.Z)({},t,e));return-(0,D.Z)(n)},V={startDate:"start",endDate:"finish"},H=[{period:"Last 5 minutes",value:-300,resolution:"minutes"},{period:"Last 10 minutes",value:-600,resolution:"minutes"},{period:"Last 15 minutes",value:-900,resolution:"minutes"},{period:"Last 30 minutes",value:-1800,resolution:"minutes"},{period:"Last hour",value:-3600,resolution:"hours"},{period:"Last 2 hours",value:-7200,resolution:"hours"},{period:"Last 6 hours",value:-21600,resolution:"hours"},{period:"Last 12 hours",value:-43200,resolution:"hours"},{period:"Last day",value:-A,resolution:"days"},{period:"Last 2 days",value:-2*A,resolution:"days"},{period:"Last 7 days",value:-7*A,resolution:"days"}],W=function(e,t){var n=(0,T.Z)(e,"MMMM d yyyy, H:mm")?e:(0,F.default)(e,"MMMM d yyyy, H:mm",Date.now());return(0,F.default)("".concat(n," ").concat(function(e){if(!e)return"+00:00";var t=e.toString().split("."),n=t[0]>0?"+":"-",r=Math.abs(t[0]).toString(),o="".concat(n).concat(r.padStart(2,0));return t.length>1?"".concat(o,":").concat(String(.6*t[1]).padEnd(2,0)):"".concat(o,":00")}(t)),"MMMM d yyyy, H:mm xxx",Date.now())},G=function(e){var t=e.handleTimePeriodChange,n=e.selectedDate,r=e.tagging;return i.createElement(d.Flex,{column:!0,justifyContent:"start",alignItems:"start",height:{max:"260px"},overflow:{vertical:"auto"},"data-testid":"timePeriods"},H.map((function(e){var o=e.period,a=e.value,c=e.resolution;return i.createElement(I,{key:a,value:a,period:o,resolution:c,setTimeRange:t,isSelected:n===a,tagging:r})})))},K=(n(9653),n(33161),n(12274)),Y=function(e){var t=e.customTimePeriodRef,n=e.handleTimePeriodChange,r=e.value,a=e.resolution,c=e.tagging,l=function(){return r<=0?U(-r,a):0},u=(0,i.useState)(l),s=(0,o.Z)(u,2),m=s[0],p=s[1],v=(0,f.Z)(),h=(0,o.Z)(v,4),b=h[0],y=h[1],k=h[3],S=(0,i.useRef)();(0,i.useEffect)((function(){return p(l())}),[r]);var Z=(0,i.useCallback)((function(e){return p(e.target.value)}),[]),P=(0,i.useCallback)((function(e){var t=Number(e.currentTarget.value),o=!Number.isNaN(t)&&Number.isInteger(t)&&t>0,i=(0,j.Z)(new Date(0),(0,g.Z)({},a,t));return o&&(0,K.default)(i)&&(0,D.Z)(i)<=94694400?n(z(t,a),a):p(r<=0?U(-r,a):0)}),[a,m]),I=(0,i.useCallback)((function(e){return function(){n(z(m,e),e),k()}}),[m]);return i.createElement(d.Flex,{justifyContent:"start",alignItems:"center",height:8,"data-ga":"date-picker::click-last-integer::".concat(c),"data-testid":"customTimePeriod"},i.createElement(d.Text,{"data-testid":"customTimePeriod-label"},"Last"),i.createElement(x,{value:m,onChange:Z,onBlur:P,"data-ga":"date-picker::click-last-integer::".concat(c,"::").concat(m),"data-testid":"timePeriod-timeInput"}),i.createElement(E,{"data-testid":"timePeriodDropdown-button",onClick:y,ref:S},i.createElement(d.Text,{"data-testid":"timePeriodDropdown-buttonLabel",padding:[0,4,0,0]},a),i.createElement(O,{"data-testid":"timePeriodDropdown-buttonIcon",name:"triangle_down"})),S.current&&b&&i.createElement(C,{align:{top:"bottom",left:"left"},animation:!0,close:k,"data-testid":"timePeriodDropdown",onClickOutside:k,onEsc:k,ref:t,target:S.current},B.map((function(e){return i.createElement(w,{key:e,onClick:I(e),"data-ga":"date-picker::click-last-time-".concat(e,"::").concat(c),"data-testid":"timePeriod-option"},e)}))))},J=n(313),q=n(89405),Q=n(9198),$=n.n(Q),X=(n(59061),function(e){var t=e.selected,n=e.selectsStart,r=void 0!==n&&n,o=e.selectsEnd,a=void 0!==o&&o,c=e.startDate,l=e.endDate,u=e.onChange,s=e.minDate,d=e.maxDate,m=e.dateFormat,f=void 0===m?"MM/dd/yyyy":m,p=e.open,g=void 0!==p&&p,v=e.startOpen,h=void 0!==v&&v,b=e.inline,y=void 0!==b&&b,w=e.selectsRange,E=void 0!==w&&w,C=e.monthsShown,O=void 0===C?1:C,x=e.showPopperArrow,k=void 0===x||x,S=e.calendarContainer,Z=void 0===S?null:S;return i.createElement($(),{selected:t,onChange:u,selectsStart:r,selectsEnd:a,startDate:c,endDate:l,minDate:s,maxDate:d,dateFormat:f,open:g,startOpen:h,inline:y,selectsRange:E,monthsShown:O,showPopperArrow:k,calendarContainer:Z})}),ee=function(e){var t=e.name,n=void 0===t?"":t,r=e.value,a=void 0===r?"":r,c=e.onDatesChange,u=e.onFocus,s=e.placeholderText,d=void 0===s?"":s,m=(0,q.rA)().utcOffset,f=(0,i.useState)(""),p=(0,o.Z)(f,2),g=p[0],v=p[1],h=(0,i.useCallback)((function(e){var t=e.target.value;v(t)}),[]),b=(0,i.useCallback)((function(e){if((0,K.default)(e)){var t=(0,N.default)(e,"MMMM d yyyy, H:mm");v(t)}}),[]),y=(0,i.useCallback)((function(e){var t=W(e.target.value,m);if((0,K.default)(t)&&(0,l.default)(t)>0){var n=(0,l.default)(t);c(n,(function(){return b(a)}))}else b(a)}),[a,m]);return(0,i.useEffect)((function(){return b(a)}),[a]),i.createElement(S,{type:"text",name:n,value:a?g:d,onChange:h,onBlur:y,onFocus:u,placeholder:d,"data-testid":"datePicker-input"})},te=n(19013),ne=function(){var e=(0,q.rA)(),t=e.localeTimeString,n=e.localeDateString;return(0,i.useCallback)((function(e){return"".concat(n(e,{locale:"en-us",long:!1})," ").concat(t(e,{locale:"en-us",secs:!1}))}),[t,n])},re=function(e,t){return e>0?(0,te.default)(new Date(t(e))):e||0===e?(0,te.default)(new Date(t((new Date).valueOf()+1e3*e))):null},oe=function(e){var t=ne();return(0,i.useMemo)((function(){return re(e,t)}),[e])},ae=function(e,t){return[oe(e),oe(t)]};function ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var ce=function(e){var t=e.startDate,n=e.setStartDate,a=e.endDate,c=e.setEndDate,u=e.singleDate,s=e.onDatesChange,m=e.onInputFocus,f=e.onlyDates,p=e.maxDate,v=void 0===p?new Date:p,h=e.minDate,b=void 0===h?new Date("1/1/2018"):h,y=e.isSinglePicker,w=ae(t,a),E=(0,o.Z)(w,2),C=E[0],O=E[1],x=oe(u),k=(0,q.rA)().utcOffset,S=ne(),P=(0,i.useCallback)((function(e,t){return(0,J.default)(re(e,S),O)?n(e):t()}),[a,S]),I=(0,i.useCallback)((function(e,t){return(0,J.default)(C,re(e,S))?c(e):t()}),[t,S]),j=(0,i.useCallback)((function(e){var t=Array.isArray(e)?e[0]:e,n=Array.isArray(e)?e[1]:null,r=t?W((0,N.default)(t,"MMMM d yyyy, H:mm"),k):t,o=n?W((0,N.default)(n,"MMMM d yyyy, H:mm"),k):n,a=(0,l.default)(r)||null,i=(0,l.default)(o)||null;s(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(n),!0).forEach((function(t){(0,g.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},y?{singleDate:a}:{startDate:a,endDate:i}))}),[k]);return i.createElement(d.Flex,{column:!0,justifyContent:"center",alignItems:"center",flex:!0,gap:3,"data-testid":"datePicker-wrapper"},i.createElement(X,(0,r.Z)({selected:y?x:C,onChange:j},y?{}:{startDate:C,endDate:O},{maxDate:v,minDate:b,inline:!0,selectsRange:!0,monthsShown:y?1:2,dateFormat:"MMMM d yyyy, H:mm",showPopperArrow:!1,calendarContainer:Z})),!f&&(y?i.createElement(ee,{name:"date",value:x,onDatesChange:j,placeholderText:"Select a date"}):i.createElement(d.Flex,{justifyContent:"around",alignItems:"center",width:"100%",gap:2,padding:[0,10]},i.createElement(ee,{name:"startDate",value:C,onDatesChange:P,onFocus:m,placeholderText:"Select a start date"}),i.createElement(ee,{name:"endDate",value:O,onDatesChange:I,onFocus:m,placeholderText:"Select an end date"}))))},le=function(e){var t=e.startDate,n=e.endDate,r=e.onlyDates,a=ae(t,n),c=(0,o.Z)(a,2),u=c[0],s=c[1],m=(0,i.useMemo)((function(){return function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).onlyDates?"MMMM d yyyy":"MMMM d yyyy, H:mm:ss";return{formattedStartDate:(0,N.default)(e,n),formattedEndDate:(0,N.default)(t,n)}}(u,s,{onlyDates:r})}),[u,s]),f=m.formattedStartDate,p=m.formattedEndDate,g=(0,i.useMemo)((function(){return function(e,t){return(0,M.Z)((0,l.default)(e),(0,l.default)(t))}(u,s)}),[u,s]);return i.createElement(d.Flex,{alignItems:"center",gap:2},i.createElement(d.Flex,{alignItems:"center",justifyContent:"center",gap:1.5},i.createElement(d.TextSmall,{strong:!0,whiteSpace:"nowrap"},"From"),i.createElement(d.TextSmall,{whiteSpace:"nowrap","data-testid":"periodIndication-from"},f)),i.createElement(d.Icon,{name:"arrow_left",size:"small",color:"textLite",rotate:2}),i.createElement(d.Flex,{alignItems:"center",justifyContent:"center",gap:1.5},i.createElement(d.TextSmall,{strong:!0,whiteSpace:"nowrap"},"To"),i.createElement(d.TextSmall,{whiteSpace:"nowrap","data-testid":"periodIndication-to"},p)),i.createElement(d.Flex,{alignItems:"center",justifyContent:"center",gap:2},i.createElement(d.TextSmall,{whiteSpace:"nowrap"},"/"),i.createElement(d.TextSmall,{color:"textLite",whiteSpace:"nowrap","data-testid":"periodIndication-period"},g)))},ue=n(2379),se=(n(85827),n(26699),n(3151)),de=n(33926),me=36e5,fe=864e5,pe=2592e6,ge=[{key:"years",value:31104e6,unit:"y"},{key:"months",value:pe,unit:"m"},{key:"days",value:fe,unit:"d"},{key:"hours",value:me,unit:"h"},{key:"minutes",value:6e4,unit:"min"},{key:"seconds",value:1e3,unit:"s"}],ve=["hours","minutes","seconds"],he=function(e){var t=e.placeholder,n=void 0===t?"No date":t;return i.createElement(d.TextSmall,null,n)},be=function(e){var t=e.isPlaying,n=e.startDate,r=e.endDate,o=e.isSameDate,a=e.color,c=e.onlyDates,l=e.isSinglePicker,u=(0,q.rA)(),s=u.localeTimeString,m=u.localeDateString,f=a||(t?"accent":"textFocus");return i.createElement(d.Flex,{gap:1},i.createElement(d.TextSmall,{color:a,whiteSpace:"nowrap"},m(n,{long:!1}),!c&&i.createElement(i.Fragment,null," ","\u2022"," ",i.createElement(d.TextSmall,{color:f,whiteSpace:"nowrap"},s(n,{secs:!1})))),!l&&i.createElement(i.Fragment,null,(!c||!o)&&i.createElement(d.Icon,{name:"arrow_left",color:f,size:"small",rotate:2}),i.createElement(d.TextSmall,{color:a,whiteSpace:"nowrap"},!o&&i.createElement(i.Fragment,null,m(r,{long:!1})," \u2022 "),!c&&i.createElement(d.TextSmall,{color:f,whiteSpace:"nowrap"},s(r,{secs:!1})))))},ye=function(e){var t=e.isPlaying,n=e.duration,r=e.color,o=e.fluid,a=void 0!==o&&o;return i.createElement(d.Flex,{gap:1,align:"center"},i.createElement(d.TextSmall,{color:r},"\u2022"),i.createElement(d.Flex,{width:a?"auto":5},t&&i.createElement(d.TextSmall,{color:r},"last")),i.createElement(d.TextSmall,{color:r},n))},we=n(82351),Ee=(0,v.default)(d.Flex).withConfig({displayName:"styled__Container",componentId:"sc-1s7311w-0"})(["cursor:pointer;&:hover *{color:",";fill:",";}"],(0,d.getColor)("textLite"),(0,d.getColor)("textLite")),Ce=(0,v.default)(we.Z).withConfig({displayName:"styled__StyledTooltip",componentId:"sc-1s7311w-1"})(["pointer-events:",";"],(function(e){return e.isDisabled?"none":"auto"})),Oe=["onClick","start","end","isPlaying","isPickerOpen","tagging","color","fluid","onlyDates","tooltipContent","isSinglePicker","noDateSelected"],xe=(0,i.forwardRef)((function(e,t){var n=e.onClick,c=e.start,l=e.end,u=e.isPlaying,s=e.isPickerOpen,d=e.tagging,m=e.color,f=e.fluid,p=e.onlyDates,g=e.tooltipContent,v=e.isSinglePicker,h=e.noDateSelected,b=(0,a.Z)(e,Oe),y=(0,ue.IX)(),w=(0,i.useMemo)((function(){if(h)return[];var e=function(e){return e<0?(0,j.Z)(new Date,{seconds:e}):new Date(e)}(c),t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e?new Date(e):new Date}(l),n=function(e,t){return(0,se.default)(e,t)}(e,t);return[e,t,n]}),[c,l,h]),E=(0,o.Z)(w,3),C=E[0],O=E[1],x=E[2],k=(0,i.useMemo)((function(){return h?0:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.withSeconds,r=void 0!==n&&n,o=t.withTime,a=void 0===o||o,i=r||!!e.seconds;return ge.reduce((function(t,n){var r=n.key,o=n.unit;return"seconds"!==r||i?!a&&ve.includes(r)?t:e[r]?t?"".concat(t," ").concat(e[r]).concat(o):"".concat(e[r]).concat(o):t:t}),"")}(function(e,t){return(0,de.Z)({start:e,end:t})}(C,O),{withTime:!p})}),[u,C,O,h]);return i.createElement(Ce,{content:s?function(){}:g||"Select a predefined or a custom timeframe",align:"bottom",isDisabled:!n||y,plain:!0},i.createElement(Ee,(0,r.Z)({alignItems:"center",justifyContent:"center",gap:1,height:"100%",onClick:n,padding:[0,1],ref:t,"data-ga":"date-picker::click-time::".concat(d),"data-testid":"datePicker-accessorElement"},b),v&&h?i.createElement(he,null):i.createElement(be,{isPlaying:u,endDate:O,startDate:C,isSameDate:x,color:m,onlyDates:p,isSinglePicker:v}),!p&&!v&&!h&&i.createElement(ye,{isPlaying:u,duration:k,color:m,fluid:f})))})),ke=xe,Se=n(4822),Ze=(n(32023),n(89211)),Pe=n(67622),Ie=n(37689),je=n(92517),De=(0,v.default)(d.Drop).attrs({align:{top:"bottom",left:"left"},animation:!0,background:"dropdown",column:!0,margin:[.5,0,0],overflow:{vertical:"auto"},padding:[2,0],round:1,width:80}).withConfig({displayName:"dropdown__Dropdown",componentId:"sc-pg99kg-0"})([""]),Ne=(0,v.default)(d.Flex).attrs({column:!0,padding:[2,0,0],overflow:{vertical:"auto"},height:{max:"320px"}}).withConfig({displayName:"container__Container",componentId:"sc-1gtygg6-0"})([""]),Te=(0,v.default)(d.Flex).attrs({justifyContent:"between",alignItems:"center",width:"100%",gap:2}).withConfig({displayName:"wrapper__Wrapper",componentId:"sc-1ehauu1-0"})([""]),Fe=function(e){var t=e.name,n=e.offset,r=e.utc,o=e.onSelect,a=(0,i.useCallback)((function(){return o(r,n,t)}),[r,t]);return i.createElement(Pe.Z,{round:1,onClick:a,Wrapper:Te,"data-ga":"timezone-picker::click-timezone::global-view::".concat(t)},i.createElement(d.Text,{color:"text"},t),i.createElement(d.Text,{color:"textLite",whiteSpace:"nowrap"},"UTC ",n))},Me=n(14600),_e=function(e){var t=e.value,n=e.onChange,r=e.timezoneRef,a=e.timezoneName,c=(0,i.useState)(""),l=(0,o.Z)(c,2),u=l[0],s=l[1],m=(0,Ze.Z)(),f=(0,o.Z)(m,2),p=f[0],g=f[1],v=(0,i.useRef)(),h=(0,i.useRef)();(0,i.useEffect)((function(){h.current&&p&&h.current.focus()}),[p]);var b=(0,i.useMemo)((function(){return u?Me.K.filter((function(e){var t=e.text,n=e.offset;return t.toUpperCase().includes(u.toUpperCase())||n.includes(u)})):Me.K}),[u]),y=function(){g(!1),s("")},w=(0,i.useCallback)((function(e,t,r){n(e,t,r),y()}),[]),E=(0,i.useCallback)((function(e){return s(e.target.value)}),[]);return i.createElement(je.Z,{hasBorder:!1,testId:"timezone-picker"},i.createElement(Pe.Z,{round:1,onClick:g,ref:v,Wrapper:Te,padding:[2],"data-ga":"timezone-picker::click-picker::global-view",selected:!0},i.createElement(d.Flex,{gap:1},i.createElement(d.Text,{color:"text",whiteSpace:"nowrap"},a," UTC ",t)),i.createElement(d.Icon,{name:"chevron_down",color:"text",width:"12px",height:"12px"})),v.current&&p&&i.createElement(De,{onClickOutside:y,onEsc:y,ref:r,target:v.current},i.createElement(d.Box,{padding:[0,2]},i.createElement(Ie.Z,{value:u,onChange:E,ref:h,"data-ga":"timezone-picker::click-search::global-view"})),i.createElement(Ne,null,b.map((function(e){var t=e.text,n=e.offset,r=e.utc;return i.createElement(Fe,{key:t,name:t,offset:n,utc:r[0],onSelect:w})})))))},Le=function(e){var t=e.timezoneRef,n=(0,Se.I0)(),r=(0,o.Z)(n,2),a=r[0],c=a.offset,l=a.timezoneName,u=r[1],s=(0,i.useCallback)((function(e,t,n){return u({utc:e,offset:t,timezoneName:n})}),[]);return i.createElement(_e,{timezoneRef:t,timezoneName:l,value:c,onChange:s})},Ae=(n(68216),n(79433),["mousedown","touchstart"]),Be=n(91128),Re=["onChange","isSinglePicker","values","defaultValue","tagging","isPlaying","onlyDates","accessorProps","maxDate","minDate","accessorTooltipContent"],Ue=function(e){var t=e.onChange,n=e.isSinglePicker,g=e.values,v=void 0===g?{}:g,h=v.start,y=v.end,w=v.singleDate,E=e.defaultValue,C=void 0===E?-900:E,O=e.tagging,x=void 0===O?"":O,S=e.isPlaying,Z=e.onlyDates,P=e.accessorProps,I=void 0===P?{}:P,j=e.maxDate,D=e.minDate,N=e.accessorTooltipContent,T=(0,a.Z)(e,Re),F=(0,i.useState)(w),M=(0,o.Z)(F,2),_=M[0],L=M[1],A=(0,i.useState)(h),B=(0,o.Z)(A,2),R=B[0],U=B[1],z=(0,i.useState)(h),H=(0,o.Z)(z,2),W=H[0],K=H[1],J=(0,p.Z)("resolution","minutes"),q=(0,o.Z)(J,2),Q=q[0],$=q[1],X=(0,i.useState)("startDate"),ee=(0,o.Z)(X,2),te=ee[0],ne=ee[1],re=(0,f.Z)(),oe=(0,o.Z)(re,4),ae=oe[0],ie=oe[1],ue=oe[3],se=(0,i.useRef)(),de=(0,i.useState)(null),me=(0,o.Z)(de,2),fe=me[0],pe=me[1],ge=(0,i.useState)(null),ve=(0,o.Z)(ge,2),he=ve[0],be=ve[1],ye=(0,i.useState)(null),we=(0,o.Z)(ye,2),Ee=we[0],Ce=we[1],Oe=(0,Be.Z)();!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ae,n=arguments.length>2?arguments[2]:void 0,r=(0,i.useRef)();(0,i.useEffect)((function(){var o=function(t){Array.isArray(n)?n.every((function(e){return!e||!e.contains(t.target)}))&&e():r.current&&!r.current.contains(t.target)&&e()};return t.forEach((function(e){return document.addEventListener(e,o)})),function(){t.forEach((function(e){return document.removeEventListener(e,o)}))}}),[r,e,n])}(ue,["mouseup","touchend"],[fe,he,Ee,se.current]),(0,c.Z)((function(){Oe(!!ae)}),[ae]);var xe=(0,i.useCallback)((function(e){var t=e.startDate,n=e.endDate;U(t),K(n)}),[]);(0,i.useEffect)((function(){xe({startDate:h,endDate:y})}),[h,y]);var Se=(0,i.useCallback)((function(){n?(L(w),ue()):xe({startDate:C,endDate:0})}),[n]),Ze=(0,i.useCallback)((function(e){e.target.name&&ne(e.target.name)}),[]),Pe=(0,i.useCallback)((function(e){e.stopPropagation(),ie()}),[ie]),Ie=function(){n?t(_):(t({start:R,end:W}),Oe(!1)),ue()},je=(0,i.useMemo)((function(){return function(e){return V[e]}(te)}),[te]),De=!!n||null!==R&&null!==W&&R!==W,Ne=!n&&(R===h&&W===y),Te=(0,i.useMemo)((function(){return C}),[]),Fe=R===Te,Me=(0,i.useCallback)((function(e,t){$(t),xe({startDate:e,endDate:0})}),[]),_e=function(e){var r=e.startDate,o=e.endDate,a=e.singleDate;if(n)L(a),t(a),(0,m.L)("date-picker","click-date-picker",x,String(a));else{xe(Z?{startDate:r?(0,l.default)((0,u.default)(new Date(r))):r,endDate:o?(0,l.default)((0,s.default)(new Date(o))):o}:{startDate:r,endDate:o});var i="finish"===je?o||r:r||o;(0,m.L)("date-picker","click-date-picker",x,String(i))}},Ue=(0,i.useMemo)((function(){return se.current&&ae?i.createElement(k,{backdrop:!0,target:se.current,canHideTarget:!1,align:{top:"bottom",left:"left"},onEsc:ue},i.createElement(b,(0,r.Z)({ref:be,"data-testid":"datePicker"},T),i.createElement(d.Flex,{alignItems:"center",width:"100%",padding:Z?[4]:[0,6]},!Z&&!n&&i.createElement(d.Flex,{column:!0,gap:3,margin:[0,4,0,0],padding:[6,0],border:{side:"right",color:"borderSecondary"}},i.createElement(G,{handleTimePeriodChange:Me,selectedDate:R,tagging:x}),i.createElement(Y,{handleTimePeriodChange:Me,customTimePeriodRef:pe,resolution:Q,tagging:x,value:R})),i.createElement(ce,{startDate:R,endDate:W,singleDate:_,setStartDate:U,setEndDate:K,onDatesChange:_e,onInputFocus:Ze,onlyDates:Z,maxDate:j,minDate:D,isSinglePicker:n})),i.createElement(d.Flex,{column:!0,padding:[4,6,2],width:"100%",border:{side:"top",color:"borderSecondary"}},!Z&&!n&&i.createElement(Le,{timezoneRef:Ce}),i.createElement(d.Flex,{gap:1,justifyContent:n?"end":Z?"center":De?"between":"end",width:"100%"},!Z&&!n&&De&&i.createElement(le,{startDate:R,endDate:W,onlyDates:Z}),i.createElement(d.Flex,{alignItems:"center",justifyContent:"center",gap:1},i.createElement(d.Button,{label:"Clear",flavour:"hollow",onClick:Se,disabled:Fe,"data-ga":"date-picker::click-clear::".concat(x,"-").concat(je),"data-testid":"datePicker-clear",small:!0}),i.createElement(d.Button,{label:"Apply",onClick:Ie,disabled:!De||Ne,"data-ga":"date-picker::click-apply::".concat(x,"-").concat(je),"data-testid":"datePicker-apply",small:!0})))))):null}),[R,x,Q,W,De,Fe,je,Ne,_,ae]);return i.createElement(i.Fragment,null,i.createElement(ke,(0,r.Z)({onClick:Pe,tagging:x,isPickerOpen:ae,isPlaying:S,setRangeValues:t,start:n?_:h,end:n?_:y,ref:se,onlyDates:Z,tooltipContent:N,isSinglePicker:n,noDateSelected:n&&!_},I)),Ue)}},2379:function(e,t,n){n.d(t,{Cd:function(){return s},IX:function(){return c},RT:function(){return l},o8:function(){return u}});var r=n(89250),o=n(3322),a=n(54576),i={},c=function(){var e=(0,r.bS)("/spaces/:spaceSlug/rooms/:roomSlug/alerts"),t=(0,r.bS)("/spaces/:spaceSlug/rooms/:roomSlug/alerts/:alertId"),n=(0,r.bS)("/spaces/:spaceSlug/rooms/:roomSlug/home");return e||t||n},l=function(){var e=(0,r.bS)("/spaces/:spaceSlug/rooms/:roomSlug/functions"),t=((0,o.ZQ)({extraKey:"fn"})||i).hasHistory;return e&&!t},u=function(){return(0,r.bS)("/spaces/:spaceSlug/rooms/:roomSlug/events")},s=function(){var e=u(),t=(0,a.useAttributeValue)("autofetch");return!(0,a.useAttributeValue)("paused")&&t&&!e}},92432:function(e,t,n){n.d(t,{L:function(){return r}});var r=function(e,t,n,r,o){var a,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"gaCustomEvent";if(window.envSettings.tracking){if(window.dataLayer){var c={event:i,eventCategory:e,eventAction:t,eventLabel:n,eventValue:r,eventResults:o};window.dataLayer.push(c)}window.gtag&&window.gtag("event","gaCustomEvent",{eventCategory:e,eventAction:t,eventLabel:n,eventValue:r,eventResults:o}),null!==(a=window.posthog)&&void 0!==a&&a.__loaded&&window.posthog.capture(i,{eventCategory:e,eventAction:t,eventLabel:n,eventValue:r})}}},39979:function(e,t,n){n.d(t,{Z:function(){return v}});n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(87462),o=n(4942),a=n(45987),i=n(67294),c=n(87267),l=["callback","feature","isStart","isSuccess","isFailure","eventReason","payload"];function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var d=function(e){return(0,i.forwardRef)((function(t,n){var u=t.callback,d=t.feature,m=t.isStart,f=t.isSuccess,p=t.isFailure,g=t.eventReason,v=t.payload,h=void 0===v?{}:v,b=(0,a.Z)(t,l),y=(0,c.Z)(),w=y.sendLog,E=y.isReady,C=(0,i.useCallback)((function(){var e=b[u],t=s(s(s(s(s({feature:d,isStart:m,isSuccess:f,isFailure:p,eventReason:g},h),b["data-ga"]?{dataGa:b["data-ga"]}:{}),b.dataGa?{dataGa:b.dataGa}:{}),b["data-track"]?{dataTrack:b["data-track"]}:{}),b.label?{label:b.label}:{});"function"==typeof e&&e(),w(t,!0)}),[u,w,E,h,b]),O=(0,i.useMemo)((function(){return s(s({},b),{},(0,o.Z)({},u,C))}),[b,u,C]);return i.createElement(e,(0,r.Z)({ref:n},O))}))},m=n(16294),f=["payload"];function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v=function(e){return(0,i.forwardRef)((function(t,n){var o=t.payload,c=void 0===o?{}:o,l=(0,a.Z)(t,f),u=d(e);return i.createElement(u,(0,r.Z)({},l,{ref:n,callback:"onClick",payload:g(g({},c),{},{action:m.Nw.buttonClicked})}))}))}},72437:function(e,t,n){n.d(t,{xy:function(){return o}});n(26699);var r=[];var o=function(e){if(r.includes(e))return function(){return!0};var t="true"===localStorage.getItem(e);return function(e){return e||t}}("mobileAppNotifications")()},71752:function(e,t,n){n.d(t,{T:function(){return r}});var r=function(e){return e.messages&&e.messages.length>0?e.messages[0]:void 0}},30688:function(e,t,n){n.d(t,{A:function(){return a},f:function(){return o}});var r=n(93433),o=(n(92222),n(85827),n(41539),n(25387),n(2490),n(72608),function(e,t){return{isValid:e,message:t}});function a(e){return Array.isArray(e)?function(t){return e.reduce((n=t,function(e,t){var o=t(n),a=o.isValid,i=o.message;if(a)return e;var c=e.messages,l=void 0===c?[]:c;return{isValid:a,messages:[].concat((0,r.Z)(l),[i])}}),{isValid:!0});var n}:(t=e,function(e){var n=t(e),r=n.isValid,o=n.message;return o?{isValid:r,messages:[o]}:{isValid:r}});var t}},31203:function(e,t,n){var r=n(87462),o=n(45987),a=n(66007),i=n(67294),c=n(70982),l=n(59978),u=["onClick","src","title"],s=(0,i.forwardRef)((function(e,t){var n=e.onClick,s=e.src,d=e.title,m=void 0===d?"User avatar":d,f=(0,o.Z)(e,u);return i.createElement(l.Flex,(0,r.Z)({cursor:"pointer",round:"50%","data-testid":"userAvatar",title:m,alt:m,onClick:function(e){return n&&n(e)},width:8,height:8},f,{ref:t,alignItems:"center",justifyContent:"center",background:"spaceIdle",color:"textLite",overflow:"hidden"}),s?i.createElement(l.Flex,{as:"img",src:s,alt:m,width:8,height:8}):i.createElement(c.G,{icon:a.KC,size:"lg",alt:m}))}));t.Z=s},70842:function(e,t,n){n.d(t,{Z:function(){return q}});var r=n(87462),o=n(29439),a=n(67294),i=n(59978),c=n(61152),l=n(82351),u=n(24533),s=n(71893),d=n(57387),m=n(78266),f=n(45987),p=(n(57327),n(41539),n(88449),n(2490),n(59849),n(21249),n(57640),n(9924),n(78710)),g=n(46667),v=n(36065),h=n(74059),b=n(77872),y=n(97346),w=n(14428),E=["selectedSpace","setSelectedSpace","column","showFullname"],C=s.default.div.withConfig({displayName:"spaces__Separator",componentId:"sc-19p9rsp-0"})(["height:1px;width:",";background:",";"],(0,i.getSizeBy)(3),(0,i.getColor)("border")),O=function(e){var t=e.selectedSpace,n=e.setSelectedSpace,c=e.column,u=e.showFullname,s=(0,f.Z)(e,E),d=(0,h.Iw)(),m=(0,a.useMemo)((function(){return d.filter((function(e){return!(0,p.Ly)(e)}))}),[d]),O=(0,g.Z)(),x=(0,o.Z)(O,4),k=x[0],S=x[2],Z=x[3];return a.createElement(i.Flex,(0,r.Z)({"data-testid":"workspaceBar",padding:[3,2],column:c,alignItems:"center",justifyContent:"center"},s),a.createElement(i.Flex,{column:!0,"data-testid":"workspaceBar-spaces-list",gap:4,alignItems:"center",overflow:"hidden"},a.createElement(i.Flex,{column:c,"data-testid":"workspaceBar-spacesList",gap:c?4:2,overflow:{vertical:"auto"},flexWrap:!c},m.map((function(e){return a.createElement(b.Z,{testIdPrefix:"workspaceBar-space",key:e,spaceId:e,onClick:n,active:e===(null===t||void 0===t?void 0:t.id),background:"selected",showFullname:u})}))),a.createElement(y.Z,{permission:"user:CreateSpace"},a.createElement(C,{"data-testid":"workspaceBar-separator"}),a.createElement(l.Z,{content:"Create a new Space",align:"right"},a.createElement(w.Z,{permission:"user:CreateSpace",ifForbidden:"hide",icon:"plus",onClick:S,"data-testid":"workspaceBar-addSpace-button"})))),k&&a.createElement(v.Z,{onClose:Z,onDone:n}))},x=n(56662),k=n(61458),S=n(33335),Z=n(23383),P=n(95383),I=n(73398),j=function(e){var t=e.selectedSpace,n=e.selectedRoom,r=e.setSelectedRoom,c=t.id;(0,Z.Z)(c);var u=(0,S.gI)("room:Create",c),s=(0,S.gI)("room:Read",c),d=(0,g.Z)(!1),m=(0,o.Z)(d,4),f=m[0],p=m[2],v=m[3],h=(0,a.useCallback)((function(e){e.stopPropagation(),u&&p()}),[u]),b=(0,P.WY)(c),y=(0,a.useMemo)((function(){return b.filter((function(e){return e.isMember}))}),[b]);return(0,a.useEffect)((function(){null!==y&&void 0!==y&&y.length&&(n||r(y[0]))}),[y,n]),a.createElement(a.Fragment,null,a.createElement(k.Z,{"data-testid":"workspaceRooms-menuList",disabled:!s,headerTestId:"workspaceRooms-warRooms",isOpen:!0,label:a.createElement(i.Flex,{padding:[1,0],margin:[0,0,1],flex:!0,justifyContent:"between",alignItems:"center",height:"24px"},a.createElement(i.Flex,{alignItems:"center",gap:2},a.createElement(i.Icon,{name:"space_new",color:"menuItem",width:"14px",height:"14px"}),a.createElement(i.TextSmall,{color:"menuItem"},"Select a room")),a.createElement(i.Flex,{alignItems:"center",gap:2},a.createElement(l.Z,{content:"Create a new room",align:"right"},a.createElement(w.Z,{permission:"room:Create",tiny:!0,icon:"plus",onClick:h,"data-testid":"workspaceRooms-addWarRoom-button",spaceId:c}))))},a.createElement(i.Flex,{column:!0,"data-testid":"workspaceRooms-warRoomsList",padding:[0,0,1]},y.map((function(e){var t=e.id;return a.createElement(I.Z,{key:t,id:t,hideAlerts:!0,Wrapper:i.TextSmall,isSidebar:!0,selectedId:null===n||void 0===n?void 0:n.id,onClick:function(){return r(e)}})})))),f&&a.createElement(x.U,{onClose:v,isSubmodal:!1}))},D=n(4942),N=(n(92222),n(47941),n(82526),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(33582)),T=n(13477),F=n(93017),M=n(28234),_=n(94221),L=n(49254),A=n(39469),B=n(87267);function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function U(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R(Object(n),!0).forEach((function(t){(0,D.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var z=n(39979),V=n(63346),H=(0,s.default)(i.ModalContent).attrs({width:{base:"80vw"},height:{base:"80vh",min:"80vh"}}).withConfig({displayName:"modal__ModalContent",componentId:"sc-4dwymj-0"})(["box-shadow:0 18px 28px rgba(0,0,0,0.5);"]),W=(0,z.Z)(i.Button),G=function(e){var t=e.claim,n=e.loading,r=(e.error,e.privateKey),o=e.setPrivateKey,c=e.selectedSpace,l=e.setSelectedSpace,u=e.selectedRoom,s=e.keyFilename;return c?u?a.createElement(a.Fragment,null,a.createElement(m.H,null),a.createElement(i.H3,{textAlign:"center"},'You are ready to connect your agent in "',u.name,'" of "',c.name,'"'),a.createElement(i.Text,{textAlign:"center"},"Last step is to ensure you're the admin of this agent ;)"),a.createElement(i.TextSmall,{textAlign:"center"},"We've created a file with a random key. Can you read it?"),a.createElement(d.ZP,{"data-testid":"key-filename-command",commandText:"sudo cat ".concat(s),width:"60%"},"$ sudo cat ",s),a.createElement(i.Flex,{column:!0,round:!0,background:"accent",border:"primary",padding:[2],width:"60%"},a.createElement(i.TextSmall,{color:"tooltip"},a.createElement(i.TextSmall,{strong:!0,color:"tooltip"},"Tip:")," ","Run the command and paste here the key it will give you. If the command doesn't work out of the box, locate the ",s," file, open it in your favorite text editor, and copy it to your clipboard.")),a.createElement(i.TextInput,{value:r,placeholder:"Paste private key here",onChange:function(e){return o(e.target.value)},metaShrinked:!0,containerStyles:{width:"60%"}}),a.createElement(W,{label:"Claim your agent",onClick:t,disabled:!r||n,isLoading:n,"data-ga":"claiming::claim-agent::modal",payload:{space:null===c||void 0===c?void 0:c.id,room:null===u||void 0===u?void 0:u.id,privateKey:r}})):a.createElement(a.Fragment,null,a.createElement(m.H,null),a.createElement(i.H3,{textAlign:"center"},'Select a room in "',c.name,'" for this agent'),a.createElement(i.TextBig,{color:"textDescription",textAlign:"center"},"or create a new one by hitting the [+] button.")):a.createElement(a.Fragment,null,a.createElement(m.H,null),a.createElement(i.H3,{textAlign:"center"},"Let's connect your agent"),a.createElement(i.TextBig,{color:"textDescription",textAlign:"center"},"Select the space you want this agent to join"),a.createElement(i.TextBig,{color:"textDescription",textAlign:"center"},"or create a new one by hitting the [+] button."),a.createElement(O,{column:!!c,selectedSpace:c,setSelectedSpace:l,showFullname:!0,width:"80%"}))},K=function(e){var t=e.onClose,n=e.keyFilename,r=function(e){var t,n=(0,a.useState)(),r=(0,o.Z)(n,2),i=r[0],c=r[1],l=(0,a.useState)(),s=(0,o.Z)(l,2),d=s[0],m=s[1],f=(0,a.useState)(""),p=(0,o.Z)(f,2),g=p[0],v=p[1],b=(0,N.Z)(null===i||void 0===i?void 0:i.id),y=(0,h.Q6)(),w=null===(t=window.localNetdataRegistry)||void 0===t?void 0:t.mg,E=(0,u.Lz)(w),C=(0,o.Z)(E,2),O=C[0],x=O.claiming,k=O.claimingError,S=C[1],Z=(0,T.Iy)("isAnonymous"),P=(0,F.Z)(),I=(0,o.Z)(P,2),j=I[0],D=I[1],R=(0,u.Hu)(),z=(0,L.Hu)(),V=(0,A.Hu)(),H=(0,B.Z)(),W=H.sendLog,G=H.isReady;return{claim:(0,a.useCallback)((function(){var t;g&&!x&&b&&w&&y&&!Z&&d&&(S({claiming:!0}),(0,_.c)({key:g,token:null===b||void 0===b||null===(t=b[0])||void 0===t?void 0:t.token,rooms:[d.id],url:window.envSettings.apiUrl}).then((function(t){var n=t.data;if(!n.success)return S({claiming:!1,claimingError:n.message,claimId:null}),D({message:n.message}),void W({feature:"claim-node",isFailure:!0,message:n.message});R(),z(),V(),S(U(U({claiming:!1},n),{},{claimingError:""})),e(),j({header:"Your agent got connected to Netdata",text:"You can see your agent in the room ".concat(d.name," of ").concat(i.name," space.")}),W({feature:"claim-node",isSuccess:!0})})).catch((function(e){var t,n=null===e||void 0===e||null===(t=e.response)||void 0===t?void 0:t.data,r=(0,M.r)(null===n||void 0===n?void 0:n.errorMsgKey)||(null===n||void 0===n?void 0:n.errorMessage)||"Something went wrong";S({claiming:!1,claimingError:r,claimId:null}),D({message:r}),W({feature:"claim-node",isFailure:!0,message:r})})))}),[b,g,w,y,Z,x,W,G]),selectedSpace:i,setSelectedSpace:c,selectedRoom:d,setSelectedRoom:m,loading:x,error:k,privateKey:g,setPrivateKey:v}}(t),c=r.claim,l=r.selectedSpace,s=r.setSelectedSpace,d=r.selectedRoom,m=r.setSelectedRoom,f=r.loading,p=r.error,g=r.privateKey,v=r.setPrivateKey;return a.createElement(i.Modal,{zIndex:7e3,backdropProps:{backdropBlur:!0}},a.createElement(V.ZP,{feature:"ClaimModal"},a.createElement(i.Flex,{column:!0,alignItems:"end",gap:3},a.createElement(H,{tabIndex:0},a.createElement(i.ModalHeader,{justifyContent:"between"},a.createElement(i.Flex,{gap:2,alignItems:"center"},"Connect your agent to Netdata"),a.createElement(i.ModalCloseButton,{onClose:t,testId:"claim-modal-close-button","data-ga":"claiming::close-claim-modal::local"})),a.createElement(i.ModalBody,{overflow:{vertical:"auto"},padding:[0],height:"100%",column:!1},a.createElement(i.Collapsible,{background:"sideBar",open:!!l,direction:"horizontal"},a.createElement(O,{column:!0,selectedSpace:l,setSelectedSpace:s,background:"sideBarMini",height:"100%"})),a.createElement(i.Collapsible,{background:"sideBar",open:!!l,direction:"horizontal"},a.createElement(i.Flex,{flex:!0,width:56,column:!0,overflow:{vertical:"auto"},padding:[2,0]},!!l&&a.createElement(j,{selectedSpace:l,selectedRoom:d,setSelectedRoom:m}))),a.createElement(i.Flex,{alignItems:"center",column:!0,"data-testid":"claim-modal-body",flex:!0,gap:3,justifyContent:"center",padding:[4]},a.createElement(G,{selectedSpace:l,selectedRoom:d,setSelectedSpace:s,keyFilename:n,claim:c,loading:f,error:p,privateKey:g,setPrivateKey:v})))))))},Y={unavailable:"Netdata is not available for this agent.",available:"Netdata is available. Click to claim it and gain the full benefits of Netdata!",disabled:"Netdata is available, but it is disabled, you can change the agent configuration to enable it.",banned:"The agent has been banned from cloud.",offline:"The agent tries to connect to Netdata, but it fails to do so.",online:"The agent is already connected to Netdata :)"},J=(0,z.Z)(i.Button),q=function(e){var t=(0,c.Z)("claimModal"),n=(0,o.Z)(t,4),i=n[0],s=n[2],d=n[3],m=(0,u.Lz)(),f=(0,o.Z)(m,1)[0],p=f.canBeClaimed,g=f.cloudStatus,v=f.keyFilename;return a.createElement(a.Fragment,null,a.createElement(l.Z,{plain:!0,content:Y[g],isBasic:!0},a.createElement("div",null,a.createElement(J,(0,r.Z)({label:"Connect to Netdata",onClick:s},e,{disabled:!p,"data-ga":"claiming::open-claim-modal::local"})))),i&&a.createElement(K,{onClose:d,keyFilename:v}))}},35253:function(e,t,n){n.d(t,{J:function(){return o},N:function(){return r}});var r={Community:"nightly",default:"stable",EarlyBird:"nightly"},o={nightly:{description:"Released at most once every 24 hours with fully-tested code that fixes bugs or security flaws, or introduces new features to Netdata. Every nightly release is a candidate for then becoming a stable release.",title:"Nightly"},stable:{description:"Released when a major milestone is reached. Stable releases might be a better choice for those who run Netdata in mission-critical production systems, as updates will come more infrequently.",title:"Stable"}}},16931:function(e,t,n){n.d(t,{Sn:function(){return l},U8:function(){return i},m7:function(){return c}});var r=n(67294),o=n(71893),a=n(59978),i=(0,o.default)(a.Box).attrs({border:{side:"all",color:"border"},padding:[1.75,7,1.75,3],round:!0}).withConfig({displayName:"styled__InfoBlock",componentId:"sc-1lice8m-0"})(["color:",';font-family:"Courier New",Courier,monospace;font-size:14px;letter-spacing:0.09px;line-height:18px;max-height:34px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;'],(0,a.getColor)("textLite")),c=function(e){var t=e.children;return r.createElement(a.Flex,{column:!0,gap:4},t)},l=(0,o.default)(a.Button).withConfig({displayName:"styled__StyledButton",componentId:"sc-1lice8m-1"})(["&&{width:auto;min-width:auto;height:22px;background:",";border:1px solid ",";border-radius:4px;padding:0;&:hover{background:",";& > span{span{color:",";}svg{fill:",";}}}& > span{display:flex;align-items:center;gap:6px;margin:2px 8px 2px 4px;span{color:",";}svg{fill:",";}}}"],(function(e){var t=e.active,n=e.theme;return(0,a.getColor)(t?"primary":"modalBackground")({theme:n})}),(0,a.getColor)("primary"),(0,a.getColor)("primary"),(0,a.getColor)("modalBackground"),(0,a.getColor)("modalBackground"),(function(e){var t=e.active,n=e.theme;return(0,a.getColor)(t?"modalBackground":"primary")({theme:n})}),(function(e){var t=e.active,n=e.theme;return(0,a.getColor)(t?"modalBackground":"primary")({theme:n})}))},52428:function(e,t,n){n.d(t,{J:function(){return u}});n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(4942),o=n(58206),a=n(52631),i=n(74855);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(){(0,o.Z)(e);var n=(0,i.sc)(l(l({header:"Copied",text:"Command copied to your clipboard! Please run it on your node's terminal.",icon:"gear"},t),{},{success:!0}));a.Z.success(n,{context:"copy"})}}},57387:function(e,t,n){n.d(t,{ZM:function(){return g}});n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(45987),o=n(4942),a=n(67294),i=n(71893),c=n(59978),l=n(52428),u=["children"],s=["children","confirmationText","commandText"];function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var m=(0,i.default)(c.Box).attrs((function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({color:"textDescription",background:"modalTabsBackground",border:{side:"all",color:"borderSecondary"},padding:[4,10,4,4],position:"relative",width:"100%"},e)})).withConfig({displayName:"command__StyledTerminalCommand",componentId:"sc-wnwmk3-0"})(["color:",';border-radius:2px;overflow-wrap:anywhere;white-space:pre-wrap;font-family:"Courier New",Courier,monospace;letter-spacing:0.09px;line-height:18px;font-size:14px;word-break:break-word;'],(0,c.getColor)("textDescription")),f=(0,i.default)(c.Icon).withConfig({displayName:"command__StyledIcon",componentId:"sc-wnwmk3-1"})(["display:flex;align-self:flex-end;cursor:pointer;"]),p=(0,i.default)(c.Box).attrs({color:"textDescription",border:{side:"all",color:"borderSecondary"},background:"modalTabsBackground",padding:[0,1]}).withConfig({displayName:"command__CodeText",componentId:"sc-wnwmk3-2"})(["display:inline-block;color:",';border-radius:2px;font-family:"Courier New",Courier,monospace;letter-spacing:0.09px;line-height:18px;font-size:14px;word-break:break-word;'],(0,c.getColor)("textDescription")),g=function(e){var t=e.children,n=(0,r.Z)(e,u);return a.createElement(p,n,t)};t.ZP=function(e){var t=e.children,n=e.confirmationText,o=void 0===n?"Command copied to your clipboard.":n,i=e.commandText,u=void 0===i?t:i,d=(0,r.Z)(e,s);return a.createElement(m,d,t,a.createElement(c.Box,{position:"absolute",bottom:"8px",right:"8px"},a.createElement(f,{name:"copy",size:"small",color:"primary",onClick:(0,l.J)(u||t,{text:o})})))}},70459:function(e,t,n){var r=n(29439),o=(n(41539),n(15581),n(2490),n(34514),n(54747),n(67294)),a=n(54576),i=n(4822);t.Z=function(){var e=(0,a.useChart)(),t=(0,i.I0)(),n=(0,r.Z)(t,2),c=n[0],l=c.after,u=c.before,s=c.forcePlay,d=n[1],m=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autofetchOnWindowBlur:!1};return function(){e.getNodes().forEach((function(e){return e.updateAttributes(t)}));var n=l<0?l:-Math.floor((u-l)/1e3);d({after:n,before:0,forcePlay:!!t.autofetchOnWindowBlur})}};return{play:(0,o.useCallback)(m(),[u,l,s]),forcePlay:(0,o.useCallback)(m({autofetchOnWindowBlur:!0}),[u,l,s]),pause:(0,o.useCallback)((function(){if(!(l>0)){var e=Date.now();d({after:1e3*Math.floor(e/1e3+l),before:1e3*Math.floor(e/1e3),forcePlay:!1})}}),[l,u,s])}}},92517:function(e,t,n){var r=n(71893),o=n(67294),a=n(59978),i=(0,r.default)(a.Flex).withConfig({displayName:"item__StyledFlex",componentId:"sc-1gby0f1-0"})(["&:hover{background:",";}"],(function(e){var t=e.hasHoverBackground,n=e.theme,r=e.hoverBackground,o=void 0===r?"borderSecondary":r;return t?(0,a.getColor)(o)({theme:n}):null})),c=(0,o.forwardRef)((function(e,t){var n=e.background,r=e.children,c=e.cursor,l=e.hasBorder,u=e.hasHoverBackground,s=e.onClick,d=e.padding,m=e.testId,f=e.borderColor,p=void 0===f?"selected":f,g=e.round,v=e.hoverBackground;return o.createElement(a.Flex,{alignItems:"center",border:l&&{side:"right",color:p},cursor:c,"data-testid":m,onClick:s,ref:t},o.createElement(i,{round:g,alignItems:"center",background:n,hasHoverBackground:u,margin:l?[0,3,0,0]:void 0,padding:d,hoverBackground:v},r))}));t.Z=c},27261:function(e,t,n){n(92222);var r=n(59978),o=n(67294),a="node-status-indicator";t.Z=function(e){var t=e.statusText,n=e.counter,i=e.statusColor,c=i.statusTextColor,l=i.indicatorWrapperColor,u=i.counterColor;return o.createElement(r.Flex,{alignItems:"center",gap:2},o.createElement(r.TextSmall,{"data-testid":"".concat(a,"-text-").concat(t),color:c},t),o.createElement(r.Flex,{justifyContent:"center",alignItems:"center",padding:[0,1],width:{min:7.5},height:5,background:l,round:!0},o.createElement(r.TextSmall,{"data-testid":"".concat(a,"-counter-").concat(t),color:u},n)))}},9458:function(e,t,n){var r=n(67294),o=n(59978);t.Z=function(){return r.createElement(o.Box,{as:"hr",height:3,margin:[0],sx:{borderWidth:"0px 0px 0px 1px",borderColor:"placeholder",borderStyle:"solid"}})}},6973:function(e,t,n){n.d(t,{B:function(){return r}});var r={live:{statusTextColor:"live",indicatorWrapperColor:"live",counterColor:"bright"},stale:{statusTextColor:"stale",indicatorWrapperColor:"stale",counterColor:"bright"},offline:{statusTextColor:"textLite",indicatorWrapperColor:"offline",counterColor:"bright"},unseen:{statusTextColor:"unseen",indicatorWrapperColor:"unseen",counterColor:"bright"}}},4514:function(e,t,n){n.d(t,{c:function(){return d}});n(21249),n(57640),n(9924),n(47941);var r=n(67294),o=n(71893),a=n(59978),i=n(27261),c=n(9458),l=n(6973),u=(0,o.default)(a.Flex).withConfig({displayName:"wrapper__NodesIndicatorWrapper",componentId:"sc-gy5ftg-0"})(["pointer-events:",";cursor:",";opacity:",";"],(function(e){return e.disabled?"none":"auto"}),(function(e){return e.disabled?"default":"pointer"}),(function(e){return e.disabled?"0.4":"1"})),s={live:{counter:0,statusText:"Live"},stale:{counter:0,statusText:"Stale"},offline:{counter:0,statusText:"Offline"},unseen:{counter:0,statusText:"Unseen"}},d=function(e){return r.createElement(u,e,Object.keys(s).map((function(e){return r.createElement(r.Fragment,{key:e},r.createElement(i.Z,{statusText:s[e].statusText,counter:s[e].counter,statusColor:l.B[e]}),r.createElement(c.Z,null))})))};t.Z=u},64599:function(e,t,n){var r=n(87462),o=n(67294),a=n(59978),i=n(13477),c=n(83356),l=(0,n(39979).Z)(a.Button);t.Z=function(e){var t=(0,i.Iy)("isAnonymous"),n=(0,c.Z)();return t?o.createElement(l,(0,r.Z)({label:"Sign In",isStart:!0,onClick:n,"data-ga":"click-sign-in::header",feature:"SignIn"},e)):null}},46942:function(e,t,n){n.r(t),n.d(t,{default:function(){return rt}});n(66992),n(41539),n(88674),n(78783),n(33948);var r=n(67294),o=n(2145),a=n(59978),i=n(13477),c=(n(15581),n(2490),n(34514),n(54747),n(68035)),l=n(4480),u=n(30266),s=n(74059),d=n(33335),m=n(94979),f=n(78266),p=n(29439),g=n(46667),v=n(59636),h=n(67622),b=n(61458),y=n(37518),w=n(71893),E=(0,w.default)(a.Drop).attrs({align:{top:"bottom",left:"left"},animation:!0,background:"dropdown",column:!0,margin:[2,0,0],overflow:{vertical:"auto"},padding:[2,0],round:1,width:64}).withConfig({displayName:"styled__Dropdown",componentId:"sc-1vwntsm-0"})([""]),C=(0,w.default)(a.H6).attrs({color:"text",padding:[2,4]}).withConfig({displayName:"styled__OtherRoomsHeader",componentId:"sc-1vwntsm-1"})([""]),O=n(82351),x=n(93033),k=n(14428),S=function(){var e=(0,g.Z)(),t=(0,p.Z)(e,4),n=t[0],o=t[1],i=t[3],c=(0,r.useRef)(),l=(0,y.Hm)(),u=l.slug,m=(0,s.OS)("name"),f=(0,x.Z)({roomSlug:u}),w=(0,d.gI)("room:Read"),S=(0,s.Q6)();return r.createElement(r.Fragment,null,r.createElement(a.Flex,{alignItems:"center",gap:1,"data-testid":"header-roomOptions"},r.createElement(h.Z,{ref:c,testid:"roomDropdownMenu-roomOptions",icon:"space_new",onClick:o,padding:[2],round:1,width:"auto",disabled:!w||S},l.name&&r.createElement(a.Flex,{alignItems:"center",gap:4},r.createElement(a.Text,null,l.name),r.createElement(a.Icon,{name:"chevron_down",size:"small",color:"text"}))),r.createElement(O.Z,{align:"bottom",content:"Room settings"},r.createElement(k.Z,{permission:"room:Leave","data-ga":"header::click-war-room-settings::global-view","data-testid":"header-manageWarRoom",onClick:f,icon:"gear",flavour:"borderless",neutral:!0,small:!0}))),c.current&&n&&r.createElement(E,{target:c.current,onEsc:i,onClickOutside:i},r.createElement(b.Z,{isOpen:!0,label:"ROOMS IN ".concat(m.toUpperCase()),headerTestId:"roomDropdownMenu-otherRooms",Header:C},r.createElement(a.Flex,{onClick:i,column:!0,height:{max:100},overflow:{vertical:"auto"}},r.createElement(v.Z,null)))))},Z=(n(92222),n(97945)),P=n(82902),I=(n(82526),n(41817),function(e){var t=e.description,n=e.title,o=e.testId,i=e.children;return r.createElement(a.Flex,{"data-testid":o,column:!0,gap:2},r.createElement(a.H4,{color:"textDescription"},n),r.createElement(a.Flex,{column:!0,"data-testid":o,gap:2},r.createElement(a.Text,{color:"textDescription"},t),i))}),j=function(e){var t=e.children,n=e.testId,o=e.icon,i=void 0===o?"nodes_update":o;return r.createElement(a.Flex,{"data-testid":n,padding:[6],round:1,width:"100%",background:"modalInfoBackground"},r.createElement(a.Box,{margin:[0,4,0,0]},r.createElement(a.Box,{as:a.Icon,width:10,height:10,name:i})),t)},D=function(e){var t=e.title,n=e.desciription;return r.createElement(a.Flex,{column:!0},r.createElement(a.Flex,null,r.createElement(a.Box,{margin:[0,4,0,0]},r.createElement(a.Icon,{color:"main",name:"warning_triangle_hollow"})),r.createElement(a.H3,null,t)),r.createElement(a.Box,{margin:[6,0,0,0]},n))},N= |