1import{_ as q}from"./ClassicLoading.vue_vue_type_script_setup_true_langjoDLicui.js";import{d as F,r,R as K,A as Q,B as _,c as y,f as m,b as p,a as T,J as X,m as Y,aV as Z,s as d,y as x,M as ee,e as O,h as N,j as B,t as P,g as v,w as G,F as te}from"./indexPodcastmaker.js";import{_ as ae}from"./PodcastItem.vue_vue_type_style_index_0_lang2ZB00abV.js";import{_ as ne}from"./ClassicSelect.vue_vue_type_style_index_0_langBXa_W019.js";import{_ as oe}from"./SwiperList.vue_vue_type_style_index_0_langCgjiB1cA.js";import{u as se}from"./useErrorHandlerCXt-PwtW.js";import{u as re}from"./useOrgaComputedClgBAQ8P.js";import"./ClassicSpinner.vue_vue_type_style_index_0_langDvioUxB2.js";import"./useResizePhonewe3TELZT.js";import"./PodcastImage.vue_vue_type_style_index_0_langB9xr6-lH.js";import"./ChevronDownyQYjllXB.js";import"./PodcastPlayButton.vue_vue_type_style_index_0_langDvH9bGcT.js";import"./PlayC-sZ3zKz.js";import"./ClockOutlineCfFe7fLQ.js";import"./AlertCNhPgmB_.js";import"./PlayerStoreBj1LVT22.js";import"./useImageProxyLy2zPZ0I.js";import"./AsteriskpVHyW72a.js";import"./domHelperBVfCmWpy.js";const ce=F({__name:"LiveItem",props:{fetchConference:{default:void 0,type:Object}},emits:["deleteItem","updateItem"],setup(g,{emit:l}){const e=g,h=l,t=r(void 0),u=r(void 0);K(()=>L()),Q(()=>I());function I(){clearInterval(u.value),u.value=void 0}async function L(){await c(),u.value=setInterval(()=>{a()},5e3)}async function c(){var i;if((i=e.fetchConference)!=null&&i.podcastId)try{t.value=await _.fetchData({api:0,path:"podcast/"+e.fetchConference.podcastId})}catch{h("deleteItem"),e.fetchConference.conferenceId&&await _.deleteData({api:9,path:"conference/"+e.fetchConference.conferenceId})}}async function a(){if(!e.fetchConference||e.fetchConference.status!=="PLANNED"&&e.fetchConference.status!=="PENDING"&&e.fetchConference.status!=="RECORDING"){I();return}const i=await _.fetchData({api:9,path:"conference/info/"+e.fetchConference.conferenceId});i.status!==e.fetchConference.status&&h("updateItem",{...e.fetchConference,...i})}return(i,E)=>t.value&&t.value.podcastId!==0?(p(),y(ae,{key:0,podcast:t.value,"fetch-conference":g.fetchConference},null,8,["podcast","fetch-conference"])):m("",!0)}}),ie={key:0,class:"d-flex flex-column align-items-start mt-3"},le={class:"d-flex justify-content-between flex-grow-1 mb-3 w-100 align-items-center"},ue={class:"mb-0"},fe={class:"btn btn-primary"},Ae=F({__name:"LiveList",props:{organisationId:{default:void 0,type:String},hideIfEmpty:{default:!1,type:Boolean}},setup(g){const l=g,e=r(!0),h=r(!0),t=r([]),u=r(!1),I=r(["RECORDING","PENDING","PLANNED"]),L=r(["DEBRIEFING","ERROR","PUBLISHING"]),c=r("ALL"),{t:a}=T(),{isPodcastmaker:i,isEditRights:E}=re(),{handle403:U}=se(),k=X(),b=Y(),$=Z(),j=d(()=>(b.filterOrgaId!==void 0||l.organisationId!==void 0)&&(!l.hideIfEmpty||l.hideIfEmpty&&t.value.length!==0)),f=d(()=>b.filterOrgaId?b.filterOrgaId:l.organisationId),V=d(()=>E(f.value)),H=d(()=>{var n;return k.isRoleLive&&((n=k.authOrganisation.attributes)==null?void 0:n["live.active"])==="true"}),z=d(()=>{const n=[{title:a("All lives"),value:"ALL"}];for(const o of D.value){let s="";switch(o){case"RECORDING":s=a("In live");break;case"PENDING":s=a("live upcoming");break;case"PLANNED":s=a("live in few time");break;case"DEBRIEFING":s=a("In debriefing");break;case"PUBLISHING":s=a("In the process of being published");break;case"ERROR":s=a("In error");break}n.push({title:s,value:o})}return n}),D=d(()=>V.value?I.value.concat(L.value):I.value);x(f,async()=>{await M(),w()},{immediate:!0}),x(c,()=>w());async function M(){f.value&&(u.value=await $.getOrgaLiveEnabled(f.value))}function R(){e.value=!1,h.value=!0}function J(n,o){t.value.splice(o,1,n)}async function w(){if(t.value.length=0,!f.value||!u.value){R();return}e.value=!0,h.value=!1;try{const n=await _.fetchData({api:9,path:"conference/list",parameters:{organisationId:f.value,withPodcastId:!0,status:c.value==="ALL"?D.value:c.value}});t.value=n.filter(o=>o!==null)}catch(n){U(n)}R()}function W(n){t.value.splice(n,1)}return(n,o)=>{const s=ee("router-link");return j.value?(p(),O("section",ie,[N("div",le,[N("h2",ue,P(v(a)("Live")),1),H.value&&!v(i)?(p(),y(s,{key:0,to:"/main/priv/edit/l
1ive"},{default:G(()=>[N("button",fe,P(v(a)("Launch a new live")),1)]),_:1})):m("",!0)]),t.value.length||c.value!=="ALL"?(p(),y(ne,{key:0,"text-init":c.value,"onUpdate:textInit":o[0]||(o[0]=C=>c.value=C),"id-select":"status-live-chooser-select",label:v(a)("Selection by status"),"display-label":!1,options:z.value,class:"mb-3"},null,8,["text-init","label","options"])):m("",!0),B(q,{"loading-text":e.value?v(a)("Loading lives..."):void 0,"error-text":t.value.length===0?v(a)("No live currently"):void 0},null,8,["loading-text","error-text"]),t.value.length?(p(),O(te,{key:1},[e.value?m("",!0):(p(),y(oe,{key:0,"list-object":t.value},{octopusSlide:G(({option:C,index:S})=>[B(ce,{"fetch-conference":C,onDeleteItem:A=>W(S),onUpdateItem:A=>J(A,S)},null,8,["fetch-conference","onDeleteItem","onUpdateItem"])]),_:1},8,["list-object"]))],64)):m("",!0)])):m("",!0)}}});export{Ae as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.