!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"8754b08e308d2722ff43ad1473703ef3d578ce90"};var r=(new e.Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="8322a0cc-795f-41bf-9970-da67280897b6",e._sentryDebugIdIdentifier="sentry-dbid-8322a0cc-795f-41bf-9970-da67280897b6")}catch(e){}}(),(globalThis.webpackChunkcloud_frontend=globalThis.webpackChunkcloud_frontend||[]).push([[247],{25059(e,r,t){t.d(r,{A:()=>d});var o=t(96540),l=t(882),n=t(22337),i=t(66188),a=t(56327),s=t(53450),c=t(74848);const d=e=>{let{onClose:r,provider:t,setProvider:d,setGoogleApiKey:g}=e;const u=(0,l.useTheme)(),f=(0,s.Pq)(),[p,b]=(0,o.useState)(t),[y,h]=(0,o.useState)(f.googleApiKey||""),[x,m]=(0,o.useState)(!1),S=e=>(0,a.getColor)(e)({theme:u}),v=(0,o.useCallback)(()=>{p===s.mK.google&&g(y.trim()),d(p),r()},[p,y,d,g,r]),j=p===s.mK.google&&!y.trim(),k=e=>{return{flex:1,border:`1px solid ${S(e?"primary":"borderSecondary")}`,background:e?(r="primary",t=.1,(0,a.getRgbColor)(r,t)({theme:u})):"transparent"};var r,t};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(a.Box,{position:"fixed",style:{inset:0,zIndex:9},onClick:r}),(0,c.jsxs)(a.Flex,{column:!0,padding:[3],gap:3,round:2,background:"mainBackground",border:{color:"borderSecondary"},position:"absolute",width:"280px",zIndex:10,style:{top:44,right:10,boxShadow:"0 4px 16px rgba(0,0,0,0.15)"},children:[(0,c.jsx)(a.TextMicro,{strong:!0,color:"textLite",children:"MAP PROVIDER"}),(0,c.jsxs)(a.Flex,{gap:1,children:[(0,c.jsx)(a.Button,{flavour:"borderless",small:!0,onClick:()=>b(s.mK.libre),"aria-label":"Select OpenStreetMap provider",style:k(p===s.mK.libre),children:"OpenStreetMap (Free)"}),(0,c.jsx)(a.Button,{flavour:"borderless",small:!0,onClick:()=>b(s.mK.google),"aria-label":"Select Google Maps provider",style:k(p===s.mK.google),children:"Google Maps"})]}),p===s.mK.google&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(a.TextMicro,{strong:!0,color:"textLite",children:"GOOGLE MAPS API KEY"}),(0,c.jsx)(a.TextInput,{type:x?"text":"password",value:y,onChange:e=>h(e.target.value),placeholder:"AIzaSy...","aria-label":"Google Maps API key",size:"small",iconRight:(0,c.jsx)(a.Button,{flavour:"borderless",onClick:()=>m(e=>!e),"aria-label":x?"Hide API key":"Show API key",style:{padding:2,minWidth:"auto",height:"auto"},children:(0,c.jsx)(n.gc,{icon:x?i.pS3:i.k6j,size:"sm"})})}),(0,c.jsx)(a.TextMicro,{color:"textLite",children:"Required for Google Maps. Get a key from the Google Cloud Console."})]}),(0,c.jsx)(a.Button,{onClick:v,disabled:j,"aria-label":"Save map settings",children:j?"API key required":"Save"})]})]})}},53450(e,r,t){t.d(r,{DQ:()=>i,DT:()=>u,Ez:()=>s,FU:()=>O,Ii:()=>l,KC:()=>d,Pq:()=>y,RN:()=>h,Sz:()=>x,_s:()=>S,aM:()=>n,ap:()=>I,cE:()=>j,cF:()=>v,dD:()=>m,e9:()=>A,fK:()=>C,jf:()=>K,l6:()=>w,mK:()=>p,nD:()=>a,p9:()=>g,s2:()=>c,z1:()=>k,zc:()=>f});t(33110);var o=t(81395);const l={lat:30,lng:10},n=2,i=2,a=20,s={live:"#00ab44",stale:"#c59c12",offline:"#8c8c8c",unseen:"#b3b3b3"},c={critical:"#ff4136",warning:"#ffc300"},d=10,g=12,u=18,f=40,p={libre:"libre",google:"google"},b="netdata-geomap-settings",y=()=>{try{const e=localStorage.getItem(b);if(e)return JSON.parse(e)}catch{}return{provider:p.libre,googleApiKey:""}},h=e=>{try{localStorage.setItem(b,JSON.stringify(e))}catch{}},x=()=>{const{googleApiKey:e}=y();return window.NETDATA_GOOGLE_MAPS_API_KEY||e||""},m=()=>!!x(),S=()=>{const{provider:e}=y();return e===p.google&&m()?p.google:p.libre},v=60,j=16,k=.8,A=.5,O=.2,I=1.2,K=1.8,w=300,C=e=>{const r=e?1:0;return{mixed:o.default[2][r],mostOffline:o.default[9][r]}}},32017(e){e.exports=function e(r,t){if(r===t)return!0;if(r&&t&&"object"==typeof r&&"object"==typeof t){if(r.constructor!==t.constructor)return!1;var o,l,n;if(Array.isArray(r)){if((o=r.length)!=t.length)return!1;for(l=o;0!==l--;)if(!e(r[l],t[l]))return!1;return!0}if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===t.toString();if((o=(n=Object.keys(r)).length)!==Object.keys(t).length)return!1;for(l=o;0!==l--;)if(!Object.prototype.hasOwnProperty.call(t,n[l]))return!1;for(l=o;0!==l--;){var i=n[l];if(!e(r[i],t[i]))return!1}return!0}return r!==r&&t!==t}}}]);