"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var a=k(require("react")),b=k(require("prop-types")),c=require("react-i18next"),d=require("carbon-components-react"),e=require("react-router-dom"),f=k(require("classnames")),g=require("./../contexts/ApiHandler/index.js"),h=require("./../contexts/config/index.js"),i=k(require("./Overview")),j=k(require("./TestToolGraphQL"));function k(a){return a&&a.__esModule?a:{default:a}}var l=function(b){var k=b.infoSectionEntries,l=b.documentationEntries,m=b.apps,n=(0,g.useApi)(),o=n.api,p=n.apiHandler,q=(0,h.useConfig)(),r=q.options,s=(0,c.useTranslation)(),u=s.t,t=r.tryIt&&p.isTestable(o),v=function(b){var c=b.children;return a["default"].createElement("section",{className:"graphql-display__section","aria-label":"operation-display"},c)},w=(0,e.withRouter)(function(b){var c=b.history;return a["default"].createElement(d.Tabs,{className:"graphql-display__section-tabs",selected:0},a["default"].createElement(d.Tab,{id:"graphql-display__section-overview-tab",className:"graphql-display__section-overview-tab",onClick:function onClick(){return c.push("/")},label:u("overview"),title:u("overview")},a["default"].createElement("section",{className:(0,f["default"])("tab-content","overview"),"aria-label":"graphql-overview"},a["default"].createElement("div",{className:"graphql-display__section-overview-tab-contents"},a["default"].createElement(i["default"],{infoSectionEntries:k,documentationEntries:l})))),t&&a["default"].createElement(d.Tab,{id:"TryItTab",onClick:function onClick(){return c.push("/try-it")},label:u("try")}))}),x=(0,e.withRouter)(function(b){var c=b.history;return a["default"].createElement(d.Tabs,{className:"graphql-display__section-tabs",selected:1},a["default"].createElement(d.Tab,{id:"test-graphql-display__section-overview-tab",className:"graphql-display__section-overview-tab",onClick:function onClick(){return c.push("/")},label:u("overview"),title:u("overview")}),t&&a["default"].createElement(d.Tab,{id:"testTab",className:"testTab",onClick:function onClick(){return c.push("/try-it")},label:u("try"),title:u("try")},a["default"].createElement(j["default"],{api:o,options:r,apps:m})))});return a["default"].createElement(e.MemoryRouter,null,a["default"].createElement("div",{className:(0,f["default"])("apiconnect-explorer","graphql-display","main"),"aria-label":"graphqldisplay-main"},a["default"].createElement(e.Switch,null,a["default"].createElement(e.Route,{exact:!0,path:"/",component:function GraphQLOverviewContent(){return a["default"].createElement(v,null,a["default"].createElement(w,null))}}),t&&a["default"].createElement(e.Route,{exact:!0,path:"/try-it",component:function TestGraphQLContent(){return a["default"].createElement(v,null,a["default"].createElement(x,null))}}))))};l.displayName="GraphQLDisplay",l.propTypes={infoSectionEntries:b["default"].array,documentationEntries:b["default"].array,apps:b["default"].array};var m=l;exports["default"]=m;