"use strict";(self.searchguard_bundle_jsonpfunction=self.searchguard_bundle_jsonpfunction||[]).push([[360],{3360:(t,e,a)=>{a.r(e),a.d(e,{renderApp:()=>d});var s=a(4286),n=a(2874),i=a.n(n),r=a(3999),o=a(1319);const l={default:{title:"Logged out",subtitle:"Please login with a new token."},missingTenant:{title:"Missing Tenant",subtitle:"No tenant available for this user, please contact your system administrator."},missingRole:{title:"Missing Role",subtitle:"No roles available for this user, please contact your system administrator."},sessionExpired:{title:"Session Expired",subtitle:"Please provide a new token."},authError:{title:"Authentication failed",subtitle:"Please provide a new token."},samlConfigError:{title:"SAML configuration error",subtitle:"Something went wrong while retrieving the SAML configuration, please check your settings."},samlAuthError:{title:"SAML authentication error",subtitle:"The SAML authentication failed. Please contact your administrator."},samlLogoutSuccess:{title:"You have been logged out.",subtitle:""},anonymousAuthError:{title:"Anonymous authentication error",subtitle:"Please make sure that anonymous auth is enabled in Search Guard."},proxycacheAuthError:{title:"Authentication failed",subtitle:"Please login again"},proxycacheLogout:{title:"You have been logged out.",subtitle:""}};var u=a(2831),c=a(7116),g=a(6791),h=a(3721);function m({basePath:t="",httpClient:e}){const a=t+"/app/kibana",[n,i]=(0,s.useState)({brandImagePath:"",showBrandImage:!1,backButtonStyle:{}});(0,s.useEffect)((()=>{!async function(){try{const{data:t}=await e.get(`${u.Sw}/auth/config`),a=t.loginPage;i({showBrandImage:a.show_brand_image||!1,brandImagePath:a.brand_image||"",backButtonStyle:a.button_style?(0,c.M)(a.button_style):(0,c.M)("")})}catch(t){h.error("CustomErrorPage, fetchData",t)}}()}),[]),localStorage.clear(),sessionStorage.clear();let r=null;const m=window.location.search.trim().replace(/^(\?)/,"");m&&m.split("&").map((t=>{const e=t.split("=");"type"===e[0].toLowerCase()&&(r=e[1])}));let{title:d,subtitle:b}=l.default;return l[r]&&(d=l[r].title,b=l[r].subtitle),(0,g.jsx)(o.EuiErrorBoundary,null,(0,g.jsx)(o.EuiSpacer,{size:"xxl"}),(0,g.jsx)(o.EuiFlexGroup,{justifyContent:"spaceAround",alignItems:"center"},(0,g.jsx)(o.EuiFlexItem,{grow:!1},(0,g.jsx)(o.EuiPanel,null,(0,g.jsx)("div",{style:{margin:"auto",maxWidth:"300px"}},n.showBrandImage&&n.brandImagePath&&(0,g.jsx)(o.EuiImage,{"data-test-subj":"sg.customError.brandImage",alt:"Brand image",size:"l",url:n.brandImagePath.startsWith("/plugins")?t+n.brandImagePath:n.brandImagePath})),(0,g.jsx)(o.EuiText,{textAlign:"center","data-test-subj":"sg.customError.title"},(0,g.jsx)("h2",null,d)),(0,g.jsx)(o.EuiSpacer,{size:"xxl"}),(0,g.jsx)(o.EuiText,{textAlign:"center","data-test-subj":"sg.customError.subTitle"},(0,g.jsx)("p",null,b)),(0,g.jsx)(o.EuiSpacer,{size:"xxl"}),(0,g.jsx)(o.EuiFlexGroup,{justifyContent:"spaceAround"},(0,g.jsx)(o.EuiFlexItem,null,(0,g.jsx)(o.EuiButton,{fill:!0,href:a,"data-test-subj":"sg.customError.btn",id:"sg.custom.home",style:n.backButtonStyle},"Back to Kibana Home")))))))}function d({element:t,basePath:e,config:a,httpClient:s,theme$:n}){return i().render((0,g.jsx)(r.KibanaThemeProvider,{theme:{theme$:n}},(0,g.jsx)(m,{basePath:e,httpClient:s})),t),()=>i().unmountComponentAtNode(t)}},7116:(t,e,a)=>{a.d(e,{M:()=>n});var s=a(770);function n(t=""){return"string"!=typeof t?t:t.split(";").reduce(((t,e)=>{const[,a,n]=e.match(/(.+):(.+)/)||[];return a&&(t[(0,s.camelCase)(a.trim())]=n.trim()),t}),{})}}}]);