import{_ as u,eE as o,eF as p,eG as f,eH as m,M as a,O as l,eI as v,eJ as i}from"./index-Cox3ZWL0.js";var g=(function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=o.init,t.prototype["@@transducer/result"]=o.result,t.prototype["@@transducer/step"]=function(e,r){return this.f(r)?this.xf["@@transducer/step"](e,r):p(e)},t})(),y=u(function(e,r){return new g(e,r)}),$=u(f(["takeWhile"],y,function(e,r){for(var s=0,n=r.length;s<n&&e(r[s]);)s+=1;return m(0,s,r)}));const d=({projectId:t,featureStoreId:e,featureGroupId:r,upstreamLvl:s,downstreamLvl:n})=>`project/${t}/featurestores/${e}/featuregroups/${r}/provenance/links?upstreamLvls=${s}&downstreamLvls=${n}&expand=provenance_artifacts`,k=({projectId:t,featureStoreId:e,featureGroupId:r})=>d({projectId:t,featureStoreId:e,featureGroupId:r,upstreamLvl:-1,downstreamLvl:-1}),_=({projectId:t,featureStoreId:e,featureViewName:r,featureViewVersion:s})=>`project/${t}/featurestores/${e}/featureview/${r}/version/${s}/provenance/links?upstreamLvls=-1&downstreamLvls=-1&expand=provenance_artifacts`,h=({projectId:t,featureStoreId:e,featureViewName:r,featureViewVersion:s,trainingDatasetVersion:n})=>`project/${t}/featurestores/${e}/featureview/${r}/version/${s}/trainingdatasets/${n}/provenance/links?upstreamLvls=-1&downstreamLvls=-1&expand=provenance_artifacts`,L=({projectId:t,modelRegistryId:e,modelId:r})=>`project/${t}/modelregistries/${e}/models/${r}/provenance/links?upstreamLvls=-1&downstreamLvls=-1&expand=provenance_artifacts`,O=(t,e)=>{switch(e.type){case"onDemandFeaturegroupDTO":case"cachedFeaturegroupDTO":case"streamFeatureGroupDTO":return k({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("_")),s=Number(e.name.substring(e.name.lastIndexOf("_")+1));return h({projectId:t,featureStoreId:e.featurestoreId,featureViewName:r,featureViewVersion:s,trainingDatasetVersion:e.version})}case"modelDTO":return L({projectId:t,modelRegistryId:t,modelId:e.id});default:return""}},w=a.injectEndpoints({endpoints:t=>({getFromHref:t.query({query:e=>{const r=e.split(v);return{url:r.length>1?r[1]:r[0]}},providesTags:(e,r,s)=>[{id:$(n=>n!=="?",s),type:l.ProjectTags.Href}]})})}),{useGetFromHrefQuery:F}=w,x=a.injectEndpoints({endpoints:t=>({getLastCommit:t.query({query:({pId:e,fsId:r,fgId:s})=>{const n=i.stringify({offset:0,limit:1,sort_by:"committed_on:desc"});return{url:`/project/${e}/featurestores/${r}/featuregroups/${s}/commits?${n}`}},transformResponse:e=>e!=null&&e.items?e==null?void 0:e.items[0]:void 0,extraOptions:{skipError:!0}}),getFGCommits:t.query({query:({pId:e,fsId:r,fgId:s,limit:n})=>{const c=i.stringify({offset:0,limit:n,sort_by:"committed_on:desc"});return{url:`/project/${e}/featurestores/${r}/featuregroups/${s}/commits?${c}`}},transformResponse:e=>e==null?void 0:e.items,extraOptions:{skipError:!0}})})}),{useGetLastCommitQuery:H,useGetFGCommitsQuery:D}=x;export{H as a,F as b,O as g,D as u};
