"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[1374],{45397(c,r,a){a.d(r,{Dp:()=>M,Iq:()=>v,Lv:()=>O,Uu:()=>D,o6:()=>f});var y=a(86878),o=a(68143),_=a(64762),i=a(12066),u=a(15130),n=a(85618);const d=y.qR.enhanceEndpoints({endpoints:{getPlaylist:{transformResponse:async e=>(await E(e.spec),e)},createPlaylist:e=>{const l=e.query;l&&(e.query=t=>{const s=t.playlist.metadata;return s&&!s.name&&!s.generateName&&(s.generateName=u.TP.user.login?.slice(0,2)||"g"),l(t)},e.onQueryStarted=async(t,{queryFulfilled:s,dispatch:P})=>{try{await s,P((0,i.dx)((0,_.tZ)("Playlist created")))}catch(g){(0,n.H4)(g,P,"Unable to create playlist")}})},replacePlaylist:{onQueryStarted:async(e,{queryFulfilled:l,dispatch:t})=>{try{await l,t((0,i.dx)((0,_.tZ)("Playlist updated")))}catch(s){(0,n.H4)(s,t,"Unable to update playlist")}}},deletePlaylist:{onQueryStarted:async(e,{queryFulfilled:l,dispatch:t})=>{try{await l,t((0,i.dx)((0,_.tZ)("Playlist deleted")))}catch(s){(0,n.H4)(s,t,"Unable to delete playlist")}}}}});async function E(e){if(e?.items){for(const l of e.items)if(l.type==="dashboard_by_id"){l.type="dashboard_by_uid";const t=await(0,o.AI)().get(`/api/dashboards/ids/${l.value}`);t?.length&&(l.value=t[0])}}}const{useCreatePlaylistMutation:M,useDeletePlaylistMutation:v,useGetPlaylistQuery:D,useListPlaylistQuery:f,useReplacePlaylistMutation:O}=d},57304(c,r,a){a.r(r),a.d(r,{default:()=>i});var y=a(54148),o=a(45397),_=a(4590);function i(){const{uid:u=""}=(0,y.g)(),{data:n,isLoading:d}=(0,o.Uu)({name:u});return!d&&n&&_._o.start(n),null}}}]);

//# sourceMappingURL=PlaylistStartPage.f6e14f2fd0ae1aeffb90.js.map