import{_ as o,cn as a,cR as i,cq as u,a6 as c,a7 as l,a4 as p,cS as f}from"./index-BKr2rJhV.js";var v=(function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=a.init,t.prototype["@@transducer/result"]=a.result,t.prototype["@@transducer/step"]=function(e,r){return this.f(r)?this.xf["@@transducer/step"](e,r):i(e)},t})(),d=o(function(e,r){return new v(e,r)}),m=o(u(["takeWhile"],d,function(e,r){for(var n=0,s=r.length;n<s&&e(r[n]);)n+=1;return c(0,n,r)}));const g=l.injectEndpoints({endpoints:t=>({getFromHref:t.query({query:e=>{const r=e.split(f);return{url:r.length>1?r[1]:r[0]}},providesTags:((e,r,n)=>[{id:m(s=>s!=="?",n),type:p.ProjectTags.Href}])})})}),{useGetFromHrefQuery:T,endpoints:x}=g,k=({projectId:t,featureStoreId:e,featureGroupId:r,upstreamLvl:n,downstreamLvl:s})=>`project/${t}/featurestores/${e}/featuregroups/${r}/provenance/links?upstreamLvls=${n}&downstreamLvls=${s}&expand=provenance_artifacts`,h=({projectId:t,featureStoreId:e,featureGroupId:r})=>k({projectId:t,featureStoreId:e,featureGroupId:r,upstreamLvl:-1,downstreamLvl:-1}),$=({projectId:t,featureStoreId:e,featureViewName:r,featureViewVersion:n})=>`project/${t}/featurestores/${e}/featureview/${r}/version/${n}/provenance/links?upstreamLvls=-1&downstreamLvls=-1&expand=provenance_artifacts`,w=({projectId:t,featureStoreId:e,featureViewName:r,featureViewVersion:n,trainingDatasetVersion:s})=>`project/${t}/featurestores/${e}/featureview/${r}/version/${n}/trainingdatasets/${s}/provenance/links?upstreamLvls=-1&downstreamLvls=-1&expand=provenance_artifacts`,_=({projectId:t,modelRegistryId:e,modelId:r})=>`project/${t}/modelregistries/${e}/models/${r}/provenance/links?upstreamLvls=-1&downstreamLvls=-1&expand=provenance_artifacts`,y=(t,e)=>{switch(e.type){case"onDemandFeaturegroupDTO":case"cachedFeaturegroupDTO":case"streamFeatureGroupDTO":return h({projectId:t,featureStoreId:e.featurestoreId,featureGroupId:e.id});case"featureViewDTO":return $({projectId:t,featureStoreId:e.featurestoreId,featureViewName:e.name,featureViewVersion:e.version});case"trainingDatasetDTO":{const r=e.name.substring(0,e.name.lastIndexOf("_")),n=Number(e.name.substring(e.name.lastIndexOf("_")+1));return w({projectId:t,featureStoreId:e.featurestoreId,featureViewName:r,featureViewVersion:n,trainingDatasetVersion:e.version})}case"modelDTO":return _({projectId:t,modelRegistryId:t,modelId:e.id});default:return""}};export{y as g,T as u};
