/*! Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. * Licensed under the Elastic License 2.0; you may not use this file except in compliance with the Elastic License 2.0. */ (window.apm_bundle_jsonpfunction=window.apm_bundle_jsonpfunction||[]).push([[27],{1042:function(e,r,i){"use strict";i.r(r),i.d(r,"APMLocatorPayloadValidator",(function(){return c})),i.d(r,"getPathForServiceDetail",(function(){return v}));var n=i(35),s=i(84),t=i(141),o=i(142),a=i(478);const c=n.union([n.type({serviceName:n[void 0]}),n.intersection([n.type({serviceName:n.string}),n.partial({serviceOverviewTab:n.keyof({traces:null,metrics:null,logs:null,errors:null})}),n.type({query:o.a})])]);function v(e,{from:r,to:i,isComparisonEnabledByDefault:n,defaultEnvironment:o}){const v=c.decode(e);if(!Object(s.isRight)(v))throw new Error(t.PathReporter.report(v).join("\n"));const u={kuery:"",serviceGroup:"",comparisonEnabled:n,rangeFrom:r,rangeTo:i,environment:o};if(!e.serviceName)return a.a.link("/services",{query:u});const l={logs:"/services/{serviceName}/logs",metrics:"/services/{serviceName}/metrics",traces:"/services/{serviceName}/transactions",errors:"/services/{serviceName}/errors",default:"/services/{serviceName}/overview"}[e.serviceOverviewTab||"default"],m={...u,...e.query};return a.a.link(l,{path:{serviceName:e.serviceName},query:m})}}}]);