From 411e028f9f77ed0b50802810438907ab9fe027a6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 10:36:56 +0000 Subject: [PATCH] [web] Rebuild web interface --- htdocs/assets/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/assets/index.js b/htdocs/assets/index.js index 827f30af..f1a845ee 100644 --- a/htdocs/assets/index.js +++ b/htdocs/assets/index.js @@ -76,7 +76,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins font-size="${t.size/3}" fill="${n}"> ${t.caption} - `;return`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(s)}`},b5={name:"ControlImage",props:{caption:{default:"",type:String},url:{default:"",type:String}},emits:["click"],data(){return{font:{family:"sans-serif",weight:"bold"},size:600}},computed:{source(){return{lifecycle:{error:t=>{t.src=this.uri}},src:this.url||this.uri}},uri(){return y5({alternate:this.caption,caption:this.caption.substring(0,2),font:this.font,size:this.size})}}},v5={class:"figure has-shadow is-clickable"};function _5(t,e,n,s,i,r){const o=Qh("lazy");return O(),F("figure",v5,[ms(P("img",{onClick:e[0]||(e[0]=a=>t.$emit("click"))},null,512),[[o,r.source]])])}const jr=nt(b5,[["render",_5],["__scopeId","data-v-e43b98b9"]]),{t:Jl,locale:S5}=Gs.global,AS="NO_INDEX",E5=(t,e)=>t-e,w5=(t,e)=>t.localeCompare(e,S5.value),k5=(t,e)=>{const n=Date.parse(t),s=Date.parse(e),i=isNaN(n),r=isNaN(s);return i&&r?0:i&&1||r&&-1||n-s},C5=t=>t.map(({field:e,type:n,order:s=1})=>{switch(n){case String:return(i,r)=>w5(i[e],r[e])*s;case Number:return(i,r)=>E5(i[e],r[e])*s;case Date:return(i,r)=>k5(i[e],r[e])*s;default:return()=>0}}),T5=(t="")=>{const e=t.charAt(0);return e.match(new RegExp("\\p{Letter}","gu"))?e.toUpperCase():e.match(new RegExp("\\p{Number}","gu"))?"#":"⌘"},A5=t=>{},O5=[{difference:NaN,text:()=>Jl("grouped-list.undefined")},{difference:864e5,text:()=>Jl("grouped-list.today")},{difference:6048e5,text:()=>Jl("grouped-list.last-week")},{difference:2592e6,text:()=>Jl("grouped-list.last-month")},{difference:1/0,text:t=>t.getFullYear()}],x5=t=>{const e=new Date(t),n=new Date-e;return O5.find(s=>isNaN(n)||n{switch(e){case String:return n=>T5(n[t]);case Number:return n=>n[t];case Date:return n=>x5(n[t]);case"Digits":return n=>A5(n[t]);default:return()=>AS}};class Ct{constructor({items:e=[],total:n=0,offset:s=0,limit:i=-1}={},r={}){this.items=e,this.total=n,this.offset=s,this.limit=i,this.count=e.length,this.indices=[],this.group(r)}group({criteria:e=[],filters:n=[],index:s}={}){const i=this.items.filter(l=>n.every(c=>c(l)));this.count=i.length;const r=C5(e),o=i.sort((l,c)=>r.reduce((u,d)=>u||d(l,c),0)),a=I5(s);return this.itemsGrouped=o.reduce((l,c)=>{const u=a(c);return l.set(u,[...l.get(u)||[],c]),l},new Map),this.indices=Array.from(this.itemsGrouped.keys()),this}*generate(){for(const[e,n]of this.itemsGrouped.entries()){e!==AS&&(yield{index:e,isItem:!1,item:{},itemId:e});for(const s of n)yield{index:e,isItem:!0,item:s,itemId:s.id}}}[Symbol.iterator](){return this.generate()}}const pm={name:"ControlProgress",props:{size:{default:36,type:Number},value:{default:0,type:Number}},computed:{offset(){return 1-this.value},progress(){return`${Math.round(this.value*100)}%`}}},Ib=()=>{ap(t=>({"3ce61f74":t.offset}))},Nb=pm.setup;pm.setup=Nb?(t,e)=>(Ib(),Nb(t,e)):Ib;const N5={class:"is-flex"},P5=["width","height"],R5=["textContent"];function D5(t,e,n,s,i,r){return O(),F("div",N5,[(O(),F("svg",{width:n.size,height:n.size,viewBox:"0 0 200 200"},[e[0]||(e[0]=P("defs",null,[P("circle",{id:"circle",cx:"50%",cy:"50%",pathLength:"1",r:"90"})],-1)),e[1]||(e[1]=P("use",{href:"#circle",class:"progress-base"},null,-1)),e[2]||(e[2]=P("use",{href:"#circle",class:"progress-bar"},null,-1)),P("text",{x:"50%",y:"50%",class:"is-size-1 progress-text",textContent:et(r.progress)},null,8,R5)],8,P5))])}const L5=nt(pm,[["render",D5],["__scopeId","data-v-06c7995f"]]),M5={name:"ListItem",components:{ControlImage:jr,ControlProgress:L5},props:{icon:{default:null,type:String},image:{default:null,type:Object},index:{default:null,type:[String,Number]},isItem:{default:!0,type:Boolean},isPlayable:{default:!0,type:Boolean},isRead:{default:!1,type:Boolean},lines:{default:null,type:Array},progress:{default:null,type:Number}},emits:["open","openDetails"],methods:{open(){this.$emit("open")},openDetails(){this.$emit("openDetails")}}},$5={key:0,class:"py-5"},F5={class:"media-content"},V5=["id","textContent"],U5={class:"media-content"},H5=["textContent"],j5={key:0,class:"is-size-7 has-text-grey"},B5={key:2,class:"media-right"},W5={class:"media-right"};function G5(t,e,n,s,i,r){const o=w("mdicon"),a=w("control-image"),l=w("control-progress");return n.isItem?(O(),F("div",{key:1,class:Gt(["media is-align-items-center mb-0",{"is-clickable":n.isPlayable,"is-not-allowed":!n.isPlayable}]),onClick:e[1]||(e[1]=(...c)=>r.open&&r.open(...c))},[n.icon?(O(),yt(o,{key:0,class:"media-left icon",name:n.icon},null,8,["name"])):_t("",!0),n.image?(O(),yt(a,{key:1,url:n.image.url,caption:n.image.caption,class:"media-left is-small"},null,8,["url","caption"])):_t("",!0),P("div",U5,[(O(!0),F(it,null,de(n.lines,(c,u)=>(O(),F("div",{key:u,class:Gt({"is-size-6":u===0,"is-size-7":u!==0,"has-text-weight-bold":u!==2,"has-text-grey":(u!==0||n.isRead)&&n.isPlayable,"has-text-grey-light":!n.isPlayable}),textContent:et(c)},null,10,H5))),128)),n.isPlayable?_t("",!0):(O(),F("div",j5,[le(t.$slots,"reason",{},void 0,!0)]))]),n.progress?(O(),F("div",B5,[E(l,{value:n.progress},null,8,["value"])])):_t("",!0),P("div",W5,[P("a",{onClick:e[0]||(e[0]=Bn((...c)=>r.openDetails&&r.openDetails(...c),["prevent","stop"]))},[E(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})])])],2)):(O(),F("div",$5,[P("div",F5,[P("span",{id:`index_${n.index}`,class:"tag is-small has-text-weight-bold",textContent:et(n.index)},null,8,V5)])]))}const $s=nt(M5,[["render",G5],["__scopeId","data-v-8ec36f11"]]),K5={name:"ListProperties",components:{ControlImage:jr},props:{item:{required:!0,type:Object}}},q5=["textContent"],z5={class:"title is-6"},X5=["onClick","textContent"],Y5=["textContent"];function Z5(t,e,n,s,i,r){const o=w("control-image");return O(),F(it,null,[n.item.image?(O(),yt(o,{key:0,url:n.item.image,caption:n.item.name,class:"is-normal mb-5"},null,8,["url","caption"])):_t("",!0),t.$slots.buttons?le(t.$slots,"buttons",{key:1}):_t("",!0),(O(!0),F(it,null,de(n.item.properties?.filter(a=>a.value),a=>(O(),F("div",{key:a.key,class:"mb-3"},[P("div",{class:"is-size-7 is-uppercase",textContent:et(t.$t(a.key))},null,8,q5),P("div",z5,[a.handler?(O(),F("a",{key:0,onClick:a.handler,textContent:et(a.value)},null,8,X5)):(O(),F("span",{key:1,class:"title is-6",textContent:et(a.value)},null,8,Y5))])]))),128))],64)}const OS=nt(K5,[["render",Z5]]),J5={name:"ModalDialogPlayable",components:{ControlButton:un,ListProperties:OS,ModalDialog:rr},props:{buttons:{default:()=>[],type:Array},item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{actions(){return[{handler:this.addToQueue,icon:"playlist-plus",key:"actions.add"},{handler:this.addNextToQueue,icon:"playlist-play",key:"actions.add-next"},{handler:this.play,icon:"play",key:"actions.play"}]}},methods:{addNextToQueue(){this.$emit("close"),this.item.expression?ae.addExpression(this.item.expression,!0):ae.addUri(this.item.uris||this.item.uri,!0)},addToQueue(){this.$emit("close"),this.item.expression?ae.addExpression(this.item.expression):ae.addUri(this.item.uris||this.item.uri)},play(){this.$emit("close"),this.item.expression?ae.playExpression(this.item.expression,!1):ae.playUri(this.item.uris||this.item.uri,!1)}}},Q5={class:"buttons"};function t8(t,e,n,s,i,r){const o=w("control-button"),a=w("list-properties"),l=w("modal-dialog");return O(),yt(l,{actions:r.actions,show:n.show,title:n.item.name,onClose:e[0]||(e[0]=c=>t.$emit("close"))},{content:M(()=>[E(a,{item:n.item},cl({_:2},[n.buttons.length?{name:"buttons",fn:M(()=>[P("div",Q5,[(O(!0),F(it,null,de(n.buttons,c=>(O(),yt(o,{key:c.key,button:c},null,8,["button"]))),128))])]),key:"0"}:void 0]),1032,["item"])]),_:1},8,["actions","show","title"])}const bs=nt(J5,[["render",t8]]),e8={name:"ModalDialogTrack",components:{ModalDialogPlayable:bs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close","play-count-changed"],computed:{buttons(){return this.item.media_kind!=="podcast"?[]:this.item.play_count>0?[{handler:this.markAsNew,key:"actions.mark-as-new"}]:[{handler:this.markAsPlayed,key:"actions.mark-as-played"}]},playable(){return{name:this.item.title,properties:[{handler:this.openAlbum,key:"property.album",value:this.item.album},{handler:this.openArtist,key:"property.album-artist",value:this.item.album_artist},{key:"property.composer",value:this.item.composer},{key:"property.release-date",value:this.$formatters.toDate(this.item.date_released)},{key:"property.year",value:this.item.year},{key:"property.genre",value:this.item.genre},{key:"property.position",value:this.item.track_number>0&&[this.item.disc_number,this.item.track_number].join(" / ")},{key:"property.duration",value:this.item.length_ms>0&&this.$formatters.toTimecode(this.item.length_ms)},{key:"property.type",value:`${this.$t(`media.kind.${this.item.media_kind}`)} - ${this.$t(`data.kind.${this.item.data_kind}`)}`},{key:"property.quality",value:this.item.data_kind!=="spotify"&&this.$t("dialog.track.quality",{bitrate:this.item.bitrate,count:this.item.channels,format:this.item.type,samplerate:this.item.samplerate})},{key:"property.added-on",value:this.$formatters.toDateTime(this.item.time_added)},{key:"property.rating",value:this.$t("dialog.track.rating",{rating:Math.floor(this.item.rating/10)})},{key:"property.comment",value:this.item.comment},{key:"property.path",value:this.item.path}],uri:this.item.uri}}},methods:{markAsNew(){Tt.updateTrack(this.item.id,{play_count:"reset"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},markAsPlayed(){Tt.updateTrack(this.item.id,{play_count:"increment"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},openAlbum(){this.$emit("close"),this.item.media_kind==="podcast"?this.$router.push({name:"podcast",params:{id:this.item.album_id}}):this.item.media_kind==="audiobook"?this.$router.push({name:"audiobook-album",params:{id:this.item.album_id}}):this.item.media_kind==="music"&&this.$router.push({name:"music-album",params:{id:this.item.album_id}})},openArtist(){this.$emit("close"),this.item.media_kind==="music"||this.item.media_kind==="podcast"?this.$router.push({name:"music-artist",params:{id:this.item.album_artist_id}}):this.item.media_kind==="audiobook"&&this.$router.push({name:"audiobook-artist",params:{id:this.item.album_artist_id}})},openGenre(){this.$emit("close"),this.$router.push({name:"genre-albums",params:{name:this.item.genre},query:{mediaKind:this.item.media_kind}})}}};function n8(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{buttons:r.buttons,item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["buttons","item","show"])}const s8=nt(e8,[["render",n8]]),i8={name:"ListTracks",components:{ListItem:$s,ModalDialogTrack:s8},props:{expression:{default:"",type:String},icon:{default:null,type:String},items:{default:null,type:Object},load:{default:null,type:Function},showProgress:{default:!1,type:Boolean},uris:{default:"",type:String}},emits:["play-count-changed"],data(){return{selectedItem:{},showDetailsModal:!1}},methods:{isRead(t){return t.media_kind==="podcast"&&t.play_count>0},open(t){this.uris?ae.playUri(this.uris,!1,this.items.items.indexOf(t)):this.expression?ae.playExpression(this.expression,!1,this.items.items.indexOf(t)):ae.playUri(t.uri,!1)},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0},progress(t){return this.showProgress&&t.seek_ms>0?t.seek_ms/t.length_ms:null}}};function r8(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-track");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,icon:n.icon,"is-item":l.isItem,"is-read":r.isRead(l.item),index:l.index,lines:[l.item.title,l.item.artist,l.item.album],progress:r.progress(l.item),onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["icon","is-item","is-read","index","lines","progress","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1),onPlayCountChanged:e[1]||(e[1]=l=>t.$emit("play-count-changed"))},null,8,["item","show"])],64)}const es=nt(i8,[["render",r8]]),o8={name:"ModalDialogAlbum",components:{ModalDialog:rr,ModalDialogPlayable:bs},props:{item:{required:!0,type:Object},mediaKind:{default:"",type:String},show:Boolean},emits:["close","play-count-changed","podcast-deleted"],data(){return{showRemovePodcastModal:!1}},computed:{actions(){return[{handler:this.cancel,icon:"cancel",key:this.$t("actions.cancel")},{handler:this.removePodcast,icon:"delete",key:this.$t("actions.remove")}]},buttons(){return this.computedMediaKind==="podcast"?this.item.data_kind==="url"?[{handler:this.markAsPlayed,key:"actions.mark-as-played"},{handler:this.openRemovePodcastDialog,key:"actions.remove"}]:[{handler:this.markAsPlayed,key:"actions.mark-as-played"}]:[]},computedMediaKind(){return this.mediaKind||this.item.media_kind},playable(){return{image:this.item.artwork_url,name:this.item.name,properties:[{handler:this.openArtist,key:"property.artist",value:this.item.artist},{key:"property.release-date",value:this.$formatters.toDate(this.item.date_released)},{key:"property.year",value:this.item.year},{key:"property.tracks",value:this.item.track_count},{key:"property.duration",value:this.$formatters.toTimecode(this.item.length_ms)},{key:"property.type",value:`${this.$t(`media.kind.${this.item.media_kind}`)} - ${this.$t(`data.kind.${this.item.data_kind}`)}`},{key:"property.added-on",value:this.$formatters.toDateTime(this.item.time_added)}],uri:this.item.uri}}},methods:{cancel(){this.showRemovePodcastModal=!1},markAsPlayed(){Tt.updateAlbum(this.item.id,{play_count:"played"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},openArtist(){this.$emit("close"),this.$router.push({name:`${this.computedMediaKind}-artist`,params:{id:this.item.artist_id}})},openRemovePodcastDialog(){this.showRemovePodcastModal=!0,this.showDetailsModal=!1},removePodcast(){this.showRemovePodcastModal=!1,Tt.albumTracks(this.item.id,{limit:1}).then(t=>{Tt.trackPlaylists(t.items[0].id).then(e=>{const{id:n}=e.items.find(s=>s.type==="rss");Tt.playlistDelete(n).then(()=>{this.$emit("podcast-deleted"),this.$emit("close")})})})}}},a8=["textContent"];function l8(t,e,n,s,i,r){const o=w("modal-dialog-playable"),a=w("i18n-t"),l=w("modal-dialog");return O(),F(it,null,[E(o,{buttons:r.buttons,item:r.playable,show:n.show,onClose:e[0]||(e[0]=c=>t.$emit("close"))},null,8,["buttons","item","show"]),E(l,{actions:r.actions,show:i.showRemovePodcastModal,title:t.$t("dialog.podcast.remove.title"),onClose:e[1]||(e[1]=c=>i.showRemovePodcastModal=!1),onRemove:r.removePodcast},{content:M(()=>[E(a,{tag:"p",keypath:"dialog.podcast.remove.info",scope:"global"},{separator:M(()=>e[2]||(e[2]=[P("br",null,null,-1)])),name:M(()=>[P("b",{textContent:et(n.item.name)},null,8,a8)]),_:1})]),_:1},8,["actions","show","title","onRemove"])],64)}const vd=nt(o8,[["render",l8]]),c8={name:"PaneHero",components:{ControlButton:un},props:{content:{required:!0,type:Object}}},u8=["textContent"],d8={class:"subtitle is-6"},f8=["textContent"],h8=["textContent"],p8={class:"buttons is-centered-mobile mt-5"};function m8(t,e,n,s,i,r){const o=w("control-button");return O(),F(it,null,[P("div",{class:"title is-5",textContent:et(n.content.title)},null,8,u8),P("div",d8,[P("a",{onClick:e[0]||(e[0]=(...a)=>n.content.handler&&n.content.handler(...a)),textContent:et(n.content.subtitle)},null,8,f8)]),P("div",{class:"is-size-7 is-uppercase has-text-centered-mobile",textContent:et(n.content.count)},null,8,h8),P("div",p8,[(O(!0),F(it,null,de(n.content.actions,(a,l)=>(O(),yt(o,{key:l,button:a},null,8,["button"]))),128))])],64)}const _d=nt(c8,[["render",m8]]),g8={name:"PageAlbum",components:{ContentWithHero:bd,ControlImage:jr,ListTracks:es,ModalDialogAlbum:vd,PaneHero:_d},beforeRouteEnter(t,e,n){Promise.all([Tt.album(t.params.id),Tt.albumTracks(t.params.id)]).then(([s,i])=>{n(r=>{r.album=s,r.tracks=new Ct(i,{criteria:[{field:"disc_number",type:Number}],index:{field:"disc_number",type:Number}}),r.tracks.indices.length<2&&r.tracks.group()})})},data(){return{album:{},showDetailsModal:!1,tracks:new Ct}},computed:{heading(){return{count:this.$t("data.tracks",{count:this.album.track_count}),handler:this.openArtist,subtitle:this.album.artist,title:this.album.name,actions:[{handler:this.play,icon:"shuffle",key:"actions.shuffle"},{handler:this.openDetails,icon:"dots-horizontal"}]}}},methods:{openArtist(){this.showDetailsModal=!1,this.$router.push({name:"music-artist",params:{id:this.album.artist_id}})},openDetails(){this.showDetailsModal=!0},play(){ae.playUri(this.album.uri,!0)}}};function y8(t,e,n,s,i,r){const o=w("pane-hero"),a=w("control-image"),l=w("list-tracks"),c=w("content-with-hero"),u=w("modal-dialog-album");return O(),F(it,null,[E(c,null,{heading:M(()=>[E(o,{content:r.heading},null,8,["content"])]),image:M(()=>[E(a,{url:i.album.artwork_url,caption:i.album.name,class:"is-medium",onClick:r.openDetails},null,8,["url","caption","onClick"])]),content:M(()=>[E(l,{items:i.tracks,uris:i.album.uri},null,8,["items","uris"])]),_:1}),E(u,{item:i.album,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const b8=nt(g8,[["render",y8]]);function v8(t){return t.scrollHeight}function _8(t){return t.scrollWidth}function S8(t,e){t.scrollTop=t.scrollHeight-e+t.scrollTop}function E8(t,e){t.scrollLeft=t.scrollWidth-e+t.scrollLeft}const w8=P("div",{class:"loading"},"Loading...",-1),k8=P("div",{class:"no-more"},"No more.",-1),C8=P("div",{class:"no-results"},"No results.",-1),T8=P("div",{class:"error"},"Error.",-1),A8=Ti({__name:"VueEternalLoading",props:{load:{required:!0,type:Function},isInitial:{required:!1,type:Boolean,default:!0},position:{required:!1,type:String,default:"default"},container:{required:!1,type:Object,default:null},margin:{required:!1,type:String,default:void 0}},emits:["update:isInitial"],setup(t,{emit:e}){const n=t,s=cs();let i=cs("loading"),r=cs(n.isInitial),o=0;function a(){Vr(()=>{var g,b;n.position==="top"?S8((g=n.container)!=null?g:document.documentElement,o):n.position==="left"&&E8((b=n.container)!=null?b:document.documentElement,o)})}function l(g,b){return g===0?r.value?(u(),"no-results"):(c(),"no-more"):g!==void 0&&b!==void 0&&g{var b,S;g.isIntersecting&&(n.position==="top"?o=v8((b=n.container)!=null?b:document.documentElement):n.position==="left"&&(o=_8((S=n.container)!=null?S:document.documentElement)),m(),n.load({loaded:l,noMore:c,noResults:u,error:d},{isFirstLoad:r.value}))},{root:n.container,threshold:0,rootMargin:n.margin})}let v;return typeof IntersectionObserver<"u"&&gv(()=>{v&&m(),v=y(),_()},{flush:"post"}),Zn(()=>n.isInitial,g=>{g&&f()}),Zn(r,g=>{g||e("update:isInitial",!1)}),(g,b)=>(O(),F("div",{class:"vue-eternal-loading",ref_key:"rootRef",ref:s},[Vn(i)==="loading"?le(g.$slots,"loading",ao(co({key:0},{isFirstLoad:Vn(r)})),()=>[w8]):Vn(i)==="no-more"?le(g.$slots,"no-more",ao(co({key:1},{retry:h})),()=>[k8]):Vn(i)==="no-results"?le(g.$slots,"no-results",ao(co({key:2},{retry:h})),()=>[C8]):Vn(i)==="error"?le(g.$slots,"error",ao(co({key:3},{retry:h})),()=>[T8]):_t("",!0)],512))}}),O8={name:"LoaderListItem",components:{VueEternalLoading:A8},props:{load:{default:null,type:Function}}},x8={class:"columns is-centered"},I8={class:"column has-text-centered"};function N8(t,e,n,s,i,r){const o=w("mdicon"),a=w("vue-eternal-loading");return n.load?(O(),yt(a,{key:0,load:n.load},{loading:M(()=>[P("div",x8,[P("div",I8,[E(o,{class:"icon mdi-spin",name:"loading"})])])]),"no-more":M(()=>e[0]||(e[0]=[P("br",null,null,-1)])),"no-results":M(()=>e[1]||(e[1]=[P("br",null,null,-1)])),_:1},8,["load"])):_t("",!0)}const Sd=nt(O8,[["render",N8]]),P8={name:"ModalDialogTrackSpotify",components:{ModalDialogPlayable:bs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return this.item.artists?{name:this.item.name,properties:[{handler:this.openAlbum,key:"property.album",value:this.item.album.name},{handler:this.openArtist,key:"property.album-artist",value:this.item.artists[0]?.name},{key:"property.release-date",value:this.$formatters.toDate(this.item.album.release_date)},{key:"property.position",value:this.item.track_number>0&&[this.item.disc_number,this.item.track_number].join(" / ")},{key:"property.duration",value:this.$formatters.toTimecode(this.item.duration_ms)},{key:"property.path",value:this.item.uri}],uri:this.item.uri}:{}}},methods:{openAlbum(){this.$emit("close"),this.$router.push({name:"music-spotify-album",params:{id:this.item.album.id}})},openArtist(){this.$emit("close"),this.$router.push({name:"music-spotify-artist",params:{id:this.item.artists[0].id}})}}};function R8(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const D8=nt(P8,[["render",R8]]),L8={name:"ListTracksSpotify",components:{ListItem:$s,LoaderListItem:Sd,ModalDialogTrackSpotify:D8},props:{contextUri:{default:"",type:String},items:{required:!0,type:Object},load:{default:null,type:Function}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{open(t){t.is_playable&&ae.playUri(this.contextUri||t.uri,!1,t.position||0)},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}},M8=["textContent"],$8=["textContent"];function F8(t,e,n,s,i,r){const o=w("list-item"),a=w("loader-list-item"),l=w("modal-dialog-track-spotify");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,c=>(O(),yt(o,{key:c.id,"is-playable":c.is_playable,lines:[c.name,c.artists[0].name,c.album.name],onOpen:u=>r.open(c),onOpenDetails:u=>r.openDetails(c)},cl({_:2},[c.is_playable?void 0:{name:"reason",fn:M(()=>[e[1]||(e[1]=Ys(" (",-1)),P("span",{textContent:et(t.$t("list.spotify.not-playable-track"))},null,8,M8),c.restrictions?.reason?(O(),F("span",{key:0,textContent:et(t.$t("list.spotify.restriction-reason",{reason:c.restrictions.reason}))},null,8,$8)):_t("",!0),e[2]||(e[2]=Ys(") ",-1))]),key:"0"}]),1032,["is-playable","lines","onOpen","onOpenDetails"]))),128)),E(a,{load:n.load},null,8,["load"]),E(l,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=c=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const mm=nt(L8,[["render",F8]]),V8={name:"ModalDialogAlbumSpotify",components:{ModalDialogPlayable:bs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{image:this.item.images?.[0]?.url||"",name:this.item.name||"",properties:[{handler:this.openArtist,key:"property.artist",value:this.item?.artists?.[0]?.name},{key:"property.release-date",value:this.$formatters.toDate(this.item.release_date)},{key:"property.type",value:this.item.album_type}],uri:this.item.uri}}},methods:{openArtist(){this.$emit("close"),this.$router.push({name:"music-spotify-artist",params:{id:this.item.artists[0].id}})}}};function U8(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const xS=nt(V8,[["render",U8]]),H8={name:"PageAlbumSpotify",components:{ContentWithHero:bd,ControlImage:jr,ListTracksSpotify:mm,ModalDialogAlbumSpotify:xS,PaneHero:_d},beforeRouteEnter(t,e,n){Nn.spotify().then(({api:s,configuration:i})=>{s.albums.get(t.params.id,i.webapi_country).then(r=>{n(o=>{o.album=r})})})},setup(){return{servicesStore:Qn()}},data(){return{album:{artists:[{}],tracks:{}},showDetailsModal:!1}},computed:{heading(){return{actions:[{handler:this.play,icon:"shuffle",key:"actions.shuffle"},{handler:this.openDetails,icon:"dots-horizontal"}],count:this.$t("data.tracks",{count:this.album.tracks.total}),handler:this.openArtist,subtitle:this.album.artists[0].name,title:this.album.name}},tracks(){const{album:t}=this;return t.tracks.total?t.tracks.items.map(e=>({...e,album:t})):[]}},methods:{openArtist(){this.$router.push({name:"music-spotify-artist",params:{id:this.album.artists[0].id}})},openDetails(){this.showDetailsModal=!0},play(){this.showDetailsModal=!1,ae.playUri(this.album.uri,!0)}}};function j8(t,e,n,s,i,r){const o=w("pane-hero"),a=w("control-image"),l=w("list-tracks-spotify"),c=w("content-with-hero"),u=w("modal-dialog-album-spotify");return O(),F(it,null,[E(c,null,{heading:M(()=>[E(o,{content:r.heading},null,8,["content"])]),image:M(()=>[E(a,{url:i.album.images?.[0]?.url??"",caption:i.album.name,class:"is-medium",onClick:r.openDetails},null,8,["url","caption","onClick"])]),content:M(()=>[E(l,{items:r.tracks,"context-uri":i.album.uri},null,8,["items","context-uri"])]),_:1}),E(u,{item:i.album,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const B8=nt(H8,[["render",j8]]),W8={name:"ControlDropdown",props:{options:{required:!0,type:Array},value:{required:!0,type:[String,Number]}},emits:["update:value"],data(){return{active:!1}},computed:{option:{get(){return this.options.find(t=>t.id===this.value)}}},methods:{deactivate(){this.active=!1},select(t){this.active=!1,this.$emit("update:value",t.id)}}},G8={class:"dropdown-trigger"},K8=["textContent"],q8={id:"dropdown",class:"dropdown-menu",role:"menu"},z8={class:"dropdown-content"},X8=["onClick","textContent"];function Y8(t,e,n,s,i,r){const o=w("mdicon"),a=Qh("click-away");return ms((O(),F("div",{class:Gt(["dropdown",{"is-active":i.active}])},[P("div",G8,[P("button",{class:"button","aria-haspopup":"true","aria-controls":"dropdown",onClick:e[0]||(e[0]=l=>i.active=!i.active)},[P("span",{textContent:et(r.option.name)},null,8,K8),E(o,{class:"icon",name:"chevron-down",size:"16"})])]),P("div",q8,[P("div",z8,[(O(!0),F(it,null,de(n.options,l=>(O(),F("a",{key:l.id,class:Gt(["dropdown-item",{"is-active":n.value===l.id}]),onClick:c=>r.select(l),textContent:et(l.name)},null,10,X8))),128))])])],2)),[[a,r.deactivate]])}const Br=nt(W8,[["render",Y8]]),Z8={name:"ListAlbums",components:{ListItem:$s,ModalDialogAlbum:vd},props:{items:{required:!0,type:Object},load:{default:null,type:Function},mediaKind:{default:"",type:String}},emits:["play-count-changed","podcast-deleted"],setup(){return{settingsStore:Js()}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{image(t){return this.settingsStore.showCoverArtworkInAlbumLists?{caption:t.item.name,url:t.item.artwork_url}:null},open(t){const e=this.mediaKind||t.media_kind;e==="podcast"?this.$router.push({name:"podcast",params:{id:t.id}}):this.$router.push({name:`${e}-album`,params:{id:t.id}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0},playCountChanged(){this.$emit("play-count-changed")},podcastDeleted(){this.$emit("podcast-deleted")}}};function J8(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-album");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,"is-item":l.isItem,image:r.image(l),index:l.index,lines:[l.item.name,l.item.artist,t.$formatters.toDate(l.item.date_released)],onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["is-item","image","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,"media-kind":n.mediaKind,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1),onPlayCountChanged:r.playCountChanged,onPodcastDeleted:r.podcastDeleted},null,8,["item","media-kind","show","onPlayCountChanged","onPodcastDeleted"])],64)}const hs=nt(Z8,[["render",J8]]),Q8={name:"ListIndexButtons",props:{indices:{required:!0,type:Array}}},t6={class:"buttons is-centered mb-4"};function e6(t,e,n,s,i,r){const o=w("router-link");return O(),F("section",null,[P("nav",t6,[(O(!0),F(it,null,de(n.indices,a=>(O(),yt(o,{key:a,class:"button is-small p-2 is-index",to:{hash:`#index_${a}`,query:t.$route.query}},{default:M(()=>[Ys(et(a),1)]),_:2},1032,["to"]))),128))])])}const vs=nt(Q8,[["render",e6],["__scopeId","data-v-dc002763"]]),n6={name:"ListOptions"},s6={class:"columns"},i6={key:0,class:"column"},r6=["textContent"],o6={key:1,class:"column"},a6=["textContent"];function l6(t,e,n,s,i,r){return O(),F("div",s6,[t.$slots.filter?(O(),F("div",i6,[P("div",{class:"is-size-7 is-uppercase",textContent:et(t.$t("options.filter.title"))},null,8,r6),le(t.$slots,"filter")])):_t("",!0),t.$slots.sort?(O(),F("div",o6,[P("div",{class:"is-size-7 is-uppercase",textContent:et(t.$t("options.sort.title"))},null,8,a6),le(t.$slots,"sort")])):_t("",!0)])}const zo=nt(n6,[["render",l6]]),c6={name:"ControlTabList",props:{links:{required:!0,type:Array}}},u6={class:"section py-0 tabs-section"},d6={class:"container"},f6={class:"columns is-centered my-0"},h6={class:"column is-four-fifths py-0"},p6={class:"tabs is-centered is-small"},m6=["onClick","onKeypress"],g6=["textContent"];function y6(t,e,n,s,i,r){const o=w("mdicon"),a=w("router-link");return O(),F("section",u6,[P("div",d6,[P("div",f6,[P("div",h6,[P("div",p6,[P("ul",null,[(O(!0),F(it,null,de(n.links,l=>(O(),yt(a,{key:l.to.name,to:{name:l.to.name},custom:""},{default:M(({navigate:c,isActive:u})=>[P("li",{class:Gt({"is-active":u})},[P("a",{onClick:c,onKeypress:Xv(c,["enter"])},[l.icon?(O(),yt(o,{key:0,class:"icon is-small mx-1",name:l.icon},null,8,["name"])):_t("",!0),P("span",{class:Gt({"is-hidden-mobile":l.icon}),textContent:et(t.$t(l.key))},null,10,g6)],40,m6)],2)]),_:2},1032,["to"]))),128))])])])])])])}const gm=nt(c6,[["render",y6],["__scopeId","data-v-51d61991"]]),b6={name:"TabsMusic",components:{ControlTabList:gm},setup(){return{servicesStore:Qn()}},computed:{links(){const t=[{icon:"history",key:"page.music.tabs.history",to:{name:"music-history"}},{icon:"account-music",key:"page.music.tabs.artists",to:{name:"music-artists"}},{icon:"album",key:"page.music.tabs.albums",to:{name:"music-albums"}},{icon:"speaker",key:"page.music.tabs.genres",to:{name:"music-genres"}},{icon:"book-open-page-variant",key:"page.music.tabs.composers",to:{name:"music-composers"}}];return this.servicesStore.isSpotifyActive&&t.push({icon:"spotify",key:"page.music.tabs.spotify",to:{name:"music-spotify"}}),t}}};function v6(t,e,n,s,i,r){const o=w("control-tab-list");return O(),yt(o,{links:r.links},null,8,["links"])}const ti=nt(b6,[["render",v6]]),_6={name:"PageAlbums",components:{ContentWithHeading:ie,ControlDropdown:Br,ControlSwitch:Ur,ListAlbums:hs,ListIndexButtons:vs,ListOptions:zo,PaneTitle:re,TabsMusic:ti},beforeRouteEnter(t,e,n){Tt.albums("music").then(s=>{n(i=>{i.albumList=new Ct(s)})})},setup(){return{servicesStore:Qn(),uiStore:ts()}},data(){return{albumList:new Ct}},computed:{albums(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.albumsSort);return t.filters=[e=>!this.uiStore.hideSingles||e.track_count>2,e=>!this.uiStore.hideSpotify||e.data_kind!=="spotify"],this.albumList.group(t)},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{index:{field:"name_sort",type:String}}},{id:2,name:this.$t("options.sort.recently-added"),options:{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}}},{id:3,name:this.$t("options.sort.recently-released"),options:{criteria:[{field:"date_released",order:-1,type:Date}],index:{field:"date_released",type:Date}}},{id:4,name:this.$t("options.sort.artist-name"),options:{criteria:[{field:"artist",type:String},{field:"name_sort",type:String}],index:{field:"artist",type:String}}},{id:5,name:this.$t("options.sort.artist-date"),options:{criteria:[{field:"artist",type:String},{field:"date_released",type:Date}],index:{field:"artist",type:String}}}]},heading(){return{subtitle:[{count:this.albums.count,key:"data.albums"}],title:this.$t("page.albums.title")}}}},S6=["textContent"],E6=["textContent"],w6=["textContent"],k6=["textContent"];function C6(t,e,n,s,i,r){const o=w("tabs-music"),a=w("list-index-buttons"),l=w("control-switch"),c=w("control-dropdown"),u=w("list-options"),d=w("pane-title"),f=w("list-albums"),h=w("content-with-heading");return O(),F(it,null,[E(o),E(h,null,{options:M(()=>[E(a,{indices:r.albums.indices},null,8,["indices"]),E(u,null,{filter:M(()=>[E(l,{modelValue:s.uiStore.hideSingles,"onUpdate:modelValue":e[0]||(e[0]=p=>s.uiStore.hideSingles=p)},{label:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-singles"))},null,8,S6)]),help:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-singles-help"))},null,8,E6)]),_:1},8,["modelValue"]),s.servicesStore.isSpotifyActive?(O(),yt(l,{key:0,modelValue:s.uiStore.hideSpotify,"onUpdate:modelValue":e[1]||(e[1]=p=>s.uiStore.hideSpotify=p)},{label:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify"))},null,8,w6)]),help:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify-help"))},null,8,k6)]),_:1},8,["modelValue"])):_t("",!0)]),sort:M(()=>[E(c,{value:s.uiStore.albumsSort,"onUpdate:value":e[2]||(e[2]=p=>s.uiStore.albumsSort=p),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:M(()=>[E(d,{content:r.heading},null,8,["content"])]),content:M(()=>[E(f,{items:r.albums},null,8,["items"])]),_:1})],64)}const T6=nt(_6,[["render",C6]]),A6={name:"ModalDialogArtist",components:{ModalDialogPlayable:bs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item.name,properties:[{key:"property.albums",value:this.item.album_count},{key:"property.tracks",value:this.item.track_count},{key:"property.type",value:this.$t(`data.kind.${this.item.data_kind}`)},{key:"property.added-on",value:this.$formatters.toDateTime(this.item.time_added)}],uri:this.item.uri}}}};function O6(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const Ed=nt(A6,[["render",O6]]),x6={name:"PageArtist",components:{ContentWithHeading:ie,ControlButton:un,ControlDropdown:Br,ControlSwitch:Ur,ListAlbums:hs,ListOptions:zo,ModalDialogArtist:Ed,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Tt.artist(t.params.id),Tt.artistAlbums(t.params.id)]).then(([s,i])=>{n(r=>{r.artist=s,r.albumList=new Ct(i)})})},setup(){return{servicesStore:Qn(),uiStore:ts()}},data(){return{albumList:new Ct,artist:{},showDetailsModal:!1}},computed:{albums(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artistAlbumsSort);return t.filters=[e=>!this.uiStore.hideSpotify||e.data_kind!=="spotify"],this.albumList.group(t)},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{criteria:[{field:"name_sort",type:String}]}},{id:2,name:this.$t("options.sort.release-date"),options:{criteria:[{field:"date_released",type:Date}]}}]},heading(){return{subtitle:[{count:this.albums.count,key:"data.albums"},{count:this.trackCount,handler:this.openTracks,key:"data.tracks"}],title:this.artist.name}},trackCount(){return[...this.albums].reduce((t,e)=>t+(e?.item.track_count||0),0)}},methods:{openDetails(){this.showDetailsModal=!0},openTracks(){this.$router.push({name:"music-artist-tracks",params:{id:this.artist.id}})},play(){ae.playUri(this.albums.items.map(t=>t.uri).join(),!0)}}},I6=["textContent"],N6=["textContent"];function P6(t,e,n,s,i,r){const o=w("control-switch"),a=w("control-dropdown"),l=w("list-options"),c=w("pane-title"),u=w("control-button"),d=w("list-albums"),f=w("content-with-heading"),h=w("modal-dialog-artist");return O(),F(it,null,[E(f,null,{options:M(()=>[E(l,null,{filter:M(()=>[s.servicesStore.isSpotifyActive?(O(),yt(o,{key:0,modelValue:s.uiStore.hideSpotify,"onUpdate:modelValue":e[0]||(e[0]=p=>s.uiStore.hideSpotify=p)},{label:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify"))},null,8,I6)]),help:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify-help"))},null,8,N6)]),_:1},8,["modelValue"])):_t("",!0)]),sort:M(()=>[E(a,{value:s.uiStore.artistAlbumsSort,"onUpdate:value":e[1]||(e[1]=p=>s.uiStore.artistAlbumsSort=p),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:M(()=>[E(c,{content:r.heading},null,8,["content"])]),actions:M(()=>[E(u,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(u,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:M(()=>[E(d,{items:r.albums},null,8,["items"])]),_:1}),E(h,{item:i.artist,show:i.showDetailsModal,onClose:e[2]||(e[2]=p=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const R6=nt(x6,[["render",P6]]),D6={name:"ListAlbumsSpotify",components:{ListItem:$s,LoaderListItem:Sd,ModalDialogAlbumSpotify:xS},props:{items:{required:!0,type:Object},load:{default:null,type:Function}},setup(){return{settingsStore:Js()}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{image(t){return this.settingsStore.showCoverArtworkInAlbumLists?{caption:t.name,url:t.images?.[0]?.url??""}:null},open(t){this.$router.push({name:"music-spotify-album",params:{id:t.id}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function L6(t,e,n,s,i,r){const o=w("list-item"),a=w("loader-list-item"),l=w("modal-dialog-album-spotify");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,c=>(O(),yt(o,{key:c.id,"is-item":c.isItem,image:r.image(c),index:c.index,lines:[c.name,c.artists[0]?.name,t.$formatters.toDate(c.release_date)],onOpen:u=>r.open(c),onOpenDetails:u=>r.openDetails(c)},null,8,["is-item","image","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{load:n.load},null,8,["load"]),E(l,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=c=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const wd=nt(D6,[["render",L6]]),M6={name:"ModalDialogArtistSpotify",components:{ModalDialogPlayable:bs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{image:this.item.images?.[0]?.url||"",name:this.item.name,properties:[{key:"property.popularity",value:[this.item.popularity,this.item.followers?.total].join(" / ")},{key:"property.genres",value:this.item.genres?.join(", ")}],uri:this.item.uri}}}};function $6(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const IS=nt(M6,[["render",$6]]),ff=50,F6={name:"PageArtistSpotify",components:{ContentWithHeading:ie,ControlButton:un,ListAlbumsSpotify:wd,ModalDialogArtistSpotify:IS,PaneTitle:re},beforeRouteEnter(t,e,n){Nn.spotify().then(({api:s,configuration:i})=>{Promise.all([s.artists.get(t.params.id),s.artists.albums(t.params.id,"album,single",i.webapi_country,ff,0)]).then(([r,o])=>{n(a=>{a.artist=r,a.albums=o.items,a.total=o.total,a.offset=o.limit})})})},data(){return{albums:[],artist:{},offset:0,showDetailsModal:!1,total:0}},computed:{heading(){return{subtitle:[{count:this.total,key:"data.albums"}],title:this.artist.name}}},methods:{appendAlbums(t){this.albums=this.albums.concat(t.items),this.total=t.total,this.offset+=t.limit},load({loaded:t}){Nn.spotify().then(({api:e,configuration:n})=>{e.artists.albums(this.artist.id,"album,single",n.webapi_country,ff,this.offset).then(s=>{this.appendAlbums(s),t(s.items.length,ff)})})},openDetails(){this.showDetailsModal=!0},play(){this.showDetailsModal=!1,ae.playUri(this.artist.uri,!0)}}};function V6(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-albums-spotify"),c=w("content-with-heading"),u=w("modal-dialog-artist-spotify");return O(),F(it,null,[E(c,null,{heading:M(()=>[E(o,{content:r.heading},null,8,["content"])]),actions:M(()=>[E(a,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:M(()=>[E(l,{items:i.albums,load:r.load},null,8,["items","load"])]),_:1}),E(u,{item:i.artist,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const U6=nt(F6,[["render",V6]]),H6={name:"PageArtistTracks",components:{ContentWithHeading:ie,ControlButton:un,ControlDropdown:Br,ControlSwitch:Ur,ListIndexButtons:vs,ListOptions:zo,ListTracks:es,ModalDialogArtist:Ed,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Tt.artist(t.params.id),Tt.artistTracks(t.params.id)]).then(([s,i])=>{n(r=>{r.artist=s,r.trackList=new Ct(i)})})},setup(){return{servicesStore:Qn(),uiStore:ts()}},data(){return{artist:{},showDetailsModal:!1,trackList:new Ct}},computed:{albumCount(){return new Set([...this.tracks].filter(t=>t.isItem).map(t=>t.item.album_id)).size},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("options.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}]},heading(){return{subtitle:[{count:this.albumCount,handler:this.openArtist,key:"data.albums"},{count:this.tracks.count,key:"data.tracks"}],title:this.artist.name}},trackUris(){return this.trackList.items.map(t=>t.uri).join()},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artistTracksSort);return t.filters=[e=>!this.uiStore.hideSpotify||e.data_kind!=="spotify"],this.trackList.group(t)}},methods:{openArtist(){this.showDetailsModal=!1,this.$router.push({name:"music-artist",params:{id:this.artist.id}})},openDetails(){this.showDetailsModal=!0},play(){ae.playUri(this.trackList.items.map(t=>t.uri).join(),!0)}}},j6=["textContent"],B6=["textContent"];function W6(t,e,n,s,i,r){const o=w("list-index-buttons"),a=w("control-switch"),l=w("control-dropdown"),c=w("list-options"),u=w("pane-title"),d=w("control-button"),f=w("list-tracks"),h=w("content-with-heading"),p=w("modal-dialog-artist");return O(),F(it,null,[E(h,null,{options:M(()=>[E(o,{indices:r.tracks.indices},null,8,["indices"]),E(c,null,{filter:M(()=>[s.servicesStore.isSpotifyActive?(O(),yt(a,{key:0,modelValue:s.uiStore.hideSpotify,"onUpdate:modelValue":e[0]||(e[0]=m=>s.uiStore.hideSpotify=m)},{label:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify"))},null,8,j6)]),help:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify-help"))},null,8,B6)]),_:1},8,["modelValue"])):_t("",!0)]),sort:M(()=>[E(l,{value:s.uiStore.artistTracksSort,"onUpdate:value":e[1]||(e[1]=m=>s.uiStore.artistTracksSort=m),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:M(()=>[E(u,{content:r.heading},null,8,["content"])]),actions:M(()=>[E(d,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(d,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:M(()=>[E(f,{items:r.tracks,uris:r.trackUris},null,8,["items","uris"])]),_:1}),E(p,{item:i.artist,show:i.showDetailsModal,onClose:e[2]||(e[2]=m=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const G6=nt(H6,[["render",W6]]),K6={name:"ListArtists",components:{ListItem:$s,ModalDialogArtist:Ed},props:{items:{required:!0,type:Object},load:{default:null,type:Function}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{open(t){this.$router.push({name:`${t.media_kind}-artist`,params:{id:t.id}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function q6(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-artist");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,"is-item":l.isItem,index:l.index,lines:[l.item.name],onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["is-item","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const ym=nt(K6,[["render",q6]]),z6={name:"PageArtists",components:{ContentWithHeading:ie,ControlDropdown:Br,ControlSwitch:Ur,ListArtists:ym,ListIndexButtons:vs,ListOptions:zo,PaneTitle:re,TabsMusic:ti},beforeRouteEnter(t,e,n){Tt.artists("music").then(s=>{n(i=>{i.artistList=new Ct(s)})})},setup(){return{servicesStore:Qn(),uiStore:ts()}},data(){return{artistList:new Ct}},computed:{artists(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artistsSort);return t.filters=[e=>!this.uiStore.hideSingles||e.track_count>e.album_count*2,e=>!this.uiStore.hideSpotify||e.data_kind!=="spotify"],this.artistList.group(t)},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{index:{field:"name_sort",type:String}}},{id:2,name:this.$t("options.sort.recently-added"),options:{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}}}]},heading(){return{subtitle:[{count:this.artists.count,key:"data.artists"}],title:this.$t("page.artists.title")}}}},X6=["textContent"],Y6=["textContent"],Z6=["textContent"],J6=["textContent"];function Q6(t,e,n,s,i,r){const o=w("tabs-music"),a=w("list-index-buttons"),l=w("control-switch"),c=w("control-dropdown"),u=w("list-options"),d=w("pane-title"),f=w("list-artists"),h=w("content-with-heading");return O(),F(it,null,[E(o),E(h,null,{options:M(()=>[E(a,{indices:r.artists.indices},null,8,["indices"]),E(u,null,{filter:M(()=>[E(l,{modelValue:s.uiStore.hideSingles,"onUpdate:modelValue":e[0]||(e[0]=p=>s.uiStore.hideSingles=p)},{label:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-singles"))},null,8,X6)]),help:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-singles-help"))},null,8,Y6)]),_:1},8,["modelValue"]),s.servicesStore.isSpotifyActive?(O(),yt(l,{key:0,modelValue:s.uiStore.hideSpotify,"onUpdate:modelValue":e[1]||(e[1]=p=>s.uiStore.hideSpotify=p)},{label:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify"))},null,8,Z6)]),help:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify-help"))},null,8,J6)]),_:1},8,["modelValue"])):_t("",!0)]),sort:M(()=>[E(c,{value:s.uiStore.artistsSort,"onUpdate:value":e[2]||(e[2]=p=>s.uiStore.artistsSort=p),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:M(()=>[E(d,{content:r.heading},null,8,["content"])]),content:M(()=>[E(f,{items:r.artists},null,8,["items"])]),_:1})],64)}const tF=nt(z6,[["render",Q6]]),eF={name:"PageAudiobookAlbum",components:{ContentWithHero:bd,ControlImage:jr,ListTracks:es,ModalDialogAlbum:vd,PaneHero:_d},beforeRouteEnter(t,e,n){Promise.all([Tt.album(t.params.id),Tt.albumTracks(t.params.id)]).then(([s,i])=>{n(r=>{r.album=s,r.tracks=new Ct(i)})})},data(){return{album:{},showDetailsModal:!1,tracks:new Ct}},computed:{heading(){return{count:this.$t("data.tracks",{count:this.album.track_count}),handler:this.openArtist,subtitle:this.album.artist,title:this.album.name,actions:[{handler:this.play,icon:"play",key:"actions.play"},{handler:this.openDetails,icon:"dots-horizontal"}]}}},methods:{openArtist(){this.showDetailsModal=!1,this.$router.push({name:"audiobook-artist",params:{id:this.album.artist_id}})},openDetails(){this.showDetailsModal=!0},play(){ae.playUri(this.album.uri,!1)}}};function nF(t,e,n,s,i,r){const o=w("pane-hero"),a=w("control-image"),l=w("list-tracks"),c=w("content-with-hero"),u=w("modal-dialog-album");return O(),F(it,null,[E(c,null,{heading:M(()=>[E(o,{content:r.heading},null,8,["content"])]),image:M(()=>[E(a,{url:i.album.artwork_url,caption:i.album.name,class:"is-medium",onClick:r.openDetails},null,8,["url","caption","onClick"])]),content:M(()=>[E(l,{items:i.tracks,"show-progress":!0,uris:i.album.uri},null,8,["items","uris"])]),_:1}),E(u,{item:i.album,show:i.showDetailsModal,"media-kind":"audiobook",onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const sF=nt(eF,[["render",nF]]),iF={name:"TabsAudiobooks",components:{ControlTabList:gm},computed:{links(){return[{icon:"account-music",key:"page.audiobooks.tabs.authors",to:{name:"audiobook-artists"}},{icon:"album",key:"page.audiobooks.tabs.audiobooks",to:{name:"audiobook-albums"}},{icon:"speaker",key:"page.audiobooks.tabs.genres",to:{name:"audiobook-genres"}}]}}};function rF(t,e,n,s,i,r){const o=w("control-tab-list");return O(),yt(o,{links:r.links},null,8,["links"])}const bm=nt(iF,[["render",rF]]),oF={name:"PageAudiobookAlbums",components:{ContentWithHeading:ie,ListAlbums:hs,ListIndexButtons:vs,PaneTitle:re,TabsAudiobooks:bm},beforeRouteEnter(t,e,n){Tt.albums("audiobook").then(s=>{n(i=>{i.albums=new Ct(s,{index:{field:"name_sort",type:String}})})})},data(){return{albums:new Ct}},computed:{heading(){return{subtitle:[{count:this.albums.count,key:"data.audiobooks"}],title:this.$t("page.audiobooks.albums.title")}}}};function aF(t,e,n,s,i,r){const o=w("tabs-audiobooks"),a=w("list-index-buttons"),l=w("pane-title"),c=w("list-albums"),u=w("content-with-heading");return O(),F(it,null,[E(o),E(u,null,{options:M(()=>[E(a,{indices:i.albums.indices},null,8,["indices"])]),heading:M(()=>[E(l,{content:r.heading},null,8,["content"])]),content:M(()=>[E(c,{items:i.albums},null,8,["items"])]),_:1})],64)}const lF=nt(oF,[["render",aF]]),cF={name:"PageAudiobookArtist",components:{ContentWithHeading:ie,ControlButton:un,ListAlbums:hs,ModalDialogArtist:Ed,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Tt.artist(t.params.id),Tt.artistAlbums(t.params.id)]).then(([s,i])=>{n(r=>{r.artist=s,r.albums=new Ct(i)})})},data(){return{albums:new Ct,artist:{},showDetailsModal:!1}},computed:{heading(){return this.artist.name?{subtitle:[{count:this.artist.album_count,key:"data.audiobooks"}],title:this.artist.name}:{}}},methods:{openDetails(){this.showDetailsModal=!0},play(){ae.playUri(this.albums.items.map(t=>t.uri).join(),!1)}}};function uF(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-albums"),c=w("content-with-heading"),u=w("modal-dialog-artist");return O(),F(it,null,[E(c,null,{heading:M(()=>[E(o,{content:r.heading},null,8,["content"])]),actions:M(()=>[E(a,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"play",key:"actions.play"}},null,8,["button"])]),content:M(()=>[E(l,{items:i.albums},null,8,["items"])]),_:1}),E(u,{item:i.artist,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const dF=nt(cF,[["render",uF]]),fF={name:"PageAudiobookArtists",components:{ContentWithHeading:ie,ListArtists:ym,ListIndexButtons:vs,PaneTitle:re,TabsAudiobooks:bm},beforeRouteEnter(t,e,n){Tt.artists("audiobook").then(s=>{n(i=>{i.artists=new Ct(s,{index:{field:"name_sort",type:String}})})})},data(){return{artists:new Ct}},computed:{heading(){return{subtitle:[{count:this.artists.count,key:"data.authors"}],title:this.$t("page.audiobooks.artists.title")}}}};function hF(t,e,n,s,i,r){const o=w("tabs-audiobooks"),a=w("list-index-buttons"),l=w("pane-title"),c=w("list-artists"),u=w("content-with-heading");return O(),F(it,null,[E(o),E(u,null,{options:M(()=>[E(a,{indices:i.artists.indices},null,8,["indices"])]),heading:M(()=>[E(l,{content:r.heading},null,8,["content"])]),content:M(()=>[E(c,{items:i.artists},null,8,["items"])]),_:1})],64)}const pF=nt(fF,[["render",hF]]),mF={name:"ModalDialogGenre",components:{ModalDialogPlayable:bs},props:{item:{required:!0,type:Object},mediaKind:{required:!0,type:String},show:Boolean},emits:["close"],computed:{playable(){return{expression:`genre is "${this.item.name}" and media_kind is ${this.mediaKind}`,name:this.item.name,properties:[{key:"property.albums",value:this.item.album_count},{key:"property.tracks",value:this.item.track_count},{key:"property.duration",value:this.$formatters.toTimecode(this.item.length_ms)}]}}}};function gF(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const vm=nt(mF,[["render",gF]]),yF={name:"ListGenres",components:{ListItem:$s,ModalDialogGenre:vm},props:{items:{required:!0,type:Object},mediaKind:{required:!0,type:String}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{open(t){this.$router.push({name:"genre-albums",params:{name:t.name},query:{mediaKind:this.mediaKind}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function bF(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-genre");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,"is-item":l.isItem,index:l.index,lines:[l.item.name],onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["is-item","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,"media-kind":n.mediaKind,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1)},null,8,["item","media-kind","show"])],64)}const NS=nt(yF,[["render",bF]]),vF={name:"PageAudiobooksGenres",components:{ContentWithHeading:ie,ListGenres:NS,ListIndexButtons:vs,PaneTitle:re,TabsAudiobooks:bm},beforeRouteEnter(t,e,n){Tt.genres("audiobook").then(s=>{n(i=>{i.genres=new Ct(s,{index:{field:"name_sort",type:String}})})})},data(){return{genres:new Ct}},computed:{heading(){return{subtitle:[{count:this.genres.total,key:"data.genres"}],title:this.$t("page.genres.title")}}}};function _F(t,e,n,s,i,r){const o=w("tabs-audiobooks"),a=w("list-index-buttons"),l=w("pane-title"),c=w("list-genres"),u=w("content-with-heading");return O(),F(it,null,[E(o),E(u,null,{options:M(()=>[E(a,{indices:i.genres.indices},null,8,["indices"])]),heading:M(()=>[E(l,{content:r.heading},null,8,["content"])]),content:M(()=>[E(c,{items:i.genres,"media-kind":"audiobook"},null,8,["items"])]),_:1})],64)}const SF=nt(vF,[["render",_F]]),EF={name:"ModalDialogComposer",components:{ModalDialogPlayable:bs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{expression:`composer is "${this.item.name}" and media_kind is music`,name:this.item.name,properties:[{handler:this.openAlbums,key:"property.albums",value:this.item.album_count},{handler:this.openTracks,key:"property.tracks",value:this.item.track_count},{key:"property.duration",value:this.$formatters.toTimecode(this.item.length_ms)}]}}},methods:{openAlbums(){this.$emit("close"),this.$router.push({name:"music-composer-albums",params:{name:this.item.name}})},openTracks(){this.$emit("close"),this.$router.push({name:"music-composer-tracks",params:{name:this.item.name}})}}};function wF(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const _m=nt(EF,[["render",wF]]),kF={name:"PageComposerAlbums",components:{ContentWithHeading:ie,ControlButton:un,ListAlbums:hs,ModalDialogComposer:_m,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Tt.composer(t.params.name),Tt.composerAlbums(t.params.name)]).then(([s,i])=>{n(r=>{r.composer=s,r.albums=new Ct(i)})})},data(){return{albums:new Ct,composer:{},showDetailsModal:!1}},computed:{expression(){return`composer is "${this.composer.name}" and media_kind is music`},heading(){return this.composer.name?{subtitle:[{count:this.composer.album_count,key:"data.albums"},{count:this.composer.track_count,handler:this.openTracks,key:"data.tracks"}],title:this.composer.name}:{}}},methods:{openDetails(){this.showDetailsModal=!0},openTracks(){this.$router.push({name:"music-composer-tracks",params:{name:this.composer.name}})},play(){ae.playExpression(this.expression,!0)}}};function CF(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-albums"),c=w("content-with-heading"),u=w("modal-dialog-composer");return O(),F(it,null,[E(c,null,{heading:M(()=>[E(o,{content:r.heading},null,8,["content"])]),actions:M(()=>[E(a,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:M(()=>[E(l,{items:i.albums},null,8,["items"])]),_:1}),E(u,{item:i.composer,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const TF=nt(kF,[["render",CF]]),AF={name:"PageComposerTracks",components:{ContentWithHeading:ie,ControlButton:un,ControlDropdown:Br,ListIndexButtons:vs,ListOptions:zo,ListTracks:es,ModalDialogComposer:_m,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Tt.composer(t.params.name),Tt.composerTracks(t.params.name)]).then(([s,i])=>{n(r=>{r.composer=s,r.trackList=new Ct(i)})})},setup(){return{uiStore:ts()}},data(){return{composer:{},showDetailsModal:!1,trackList:new Ct}},computed:{expression(){return`composer is "${this.composer.name}" and media_kind is music`},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("options.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}]},heading(){return this.composer.name?{subtitle:[{count:this.composer.album_count,handler:this.openAlbums,key:"data.albums"},{count:this.composer.track_count,key:"data.tracks"}],title:this.composer.name}:{}},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.composerTracksSort);return this.trackList.group(t)}},methods:{openAlbums(){this.$router.push({name:"music-composer-albums",params:{name:this.composer.name}})},openDetails(){this.showDetailsModal=!0},play(){ae.playExpression(this.expression,!0)}}};function OF(t,e,n,s,i,r){const o=w("list-index-buttons"),a=w("control-dropdown"),l=w("list-options"),c=w("pane-title"),u=w("control-button"),d=w("list-tracks"),f=w("content-with-heading"),h=w("modal-dialog-composer");return O(),F(it,null,[E(f,null,{options:M(()=>[E(o,{indices:r.tracks.indices},null,8,["indices"]),E(l,null,{sort:M(()=>[E(a,{value:s.uiStore.composerTracksSort,"onUpdate:value":e[0]||(e[0]=p=>s.uiStore.composerTracksSort=p),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:M(()=>[E(c,{content:r.heading},null,8,["content"])]),actions:M(()=>[E(u,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(u,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:M(()=>[E(d,{items:r.tracks,expression:r.expression},null,8,["items","expression"])]),_:1}),E(h,{item:i.composer,show:i.showDetailsModal,onClose:e[1]||(e[1]=p=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const xF=nt(AF,[["render",OF]]),IF={name:"ListComposers",components:{ListItem:$s,ModalDialogComposer:_m},props:{items:{required:!0,type:Object},load:{default:null,type:Function}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{open(t){this.$router.push({name:"music-composer-albums",params:{name:t.name}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function NF(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-composer");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,"is-item":l.isItem,index:l.index,lines:[l.item.name],onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["is-item","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const PS=nt(IF,[["render",NF]]),PF={name:"PageComposers",components:{ContentWithHeading:ie,ListComposers:PS,ListIndexButtons:vs,PaneTitle:re,TabsMusic:ti},beforeRouteEnter(t,e,n){Tt.composers("music").then(s=>{n(i=>{i.composers=new Ct(s,{index:{field:"name_sort",type:String}})})})},data(){return{composers:new Ct}},computed:{heading(){return{subtitle:[{count:this.composers.total,key:"data.composers"}],title:this.$t("page.composers.title")}}}};function RF(t,e,n,s,i,r){const o=w("tabs-music"),a=w("list-index-buttons"),l=w("pane-title"),c=w("list-composers"),u=w("content-with-heading");return O(),F(it,null,[E(o),E(u,null,{options:M(()=>[E(a,{indices:i.composers.indices},null,8,["indices"])]),heading:M(()=>[E(l,{content:r.heading},null,8,["content"])]),content:M(()=>[E(c,{items:i.composers},null,8,["items"])]),_:1})],64)}const DF=nt(PF,[["render",RF]]),LF={name:"ModalDialogDirectory",components:{ModalDialogPlayable:bs},props:{item:{required:!0,type:String},show:Boolean},emits:["close"],computed:{playable(){return{expression:`path starts with "${this.item}" order by path asc`,name:this.item}}}};function MF(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const $F=nt(LF,[["render",MF]]),FF={name:"ListDirectories",components:{ListItem:$s,ModalDialogDirectory:$F},props:{items:{required:!0,type:Array}},data(){return{selectedItem:"",showDetailsModal:!1}},computed:{directories(){const t=[];let e="";return this.$route.query?.directory.split("/").slice(1,-1).forEach((n,s)=>{e=`${e}/${n}`,t.push({index:s,name:n,path:e})}),t}},methods:{open(t){const e={name:"files"};t.index!==0&&(e.query={directory:t.path}),this.$router.push(e)},openDetails(t){this.selectedItem=t.path,this.showDetailsModal=!0},openParent(){this.open(this.directories.slice(-1).pop())}}},VF={key:0,class:"media is-align-items-center mb-0"},UF={class:"media-content"},HF={class:"breadcrumb"},jF=["onClick","textContent"],BF={class:"media-right"};function WF(t,e,n,s,i,r){const o=w("mdicon"),a=w("list-item"),l=w("modal-dialog-directory");return O(),F(it,null,[t.$route.query.directory?(O(),F("div",VF,[E(o,{class:"icon media-left is-clickable",name:"chevron-left",onClick:r.openParent},null,8,["onClick"]),P("div",UF,[P("nav",HF,[P("ul",null,[(O(!0),F(it,null,de(r.directories,c=>(O(),F("li",{key:c.index},[P("a",{onClick:u=>r.open(c),textContent:et(c.name)},null,8,jF)]))),128))])])]),P("div",BF,[le(t.$slots,"actions")])])):_t("",!0),(O(!0),F(it,null,de(n.items,c=>(O(),yt(a,{key:c.path,icon:"folder",lines:[c.name],onOpen:u=>r.open(c),onOpenDetails:u=>r.openDetails(c)},null,8,["lines","onOpen","onOpenDetails"]))),128)),E(l,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=c=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const GF=nt(FF,[["render",WF]]),KF={name:"ModalDialogPlaylist",components:{ModalDialogPlayable:bs},props:{item:{required:!0,type:Object},show:Boolean,uris:{default:"",type:String}},emits:["close"],computed:{playable(){return{name:this.item.name,properties:[{key:"property.tracks",value:this.item.item_count},{key:"property.type",value:this.$t(`playlist.type.${this.item.type}`)},{key:"property.path",value:this.item.path}],uri:this.item.uri,uris:this.uris}}}};function qF(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const RS=nt(KF,[["render",qF]]),zF={name:"ListPlaylists",components:{ListItem:$s,ModalDialogPlaylist:RS},props:{items:{required:!0,type:Object},load:{default:null,type:Function}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{icon(t){return t.type==="folder"?"folder":t.type==="rss"?"rss":"music-box-multiple"},open(t){t.type==="folder"?this.$router.push({name:"playlist-folder",params:{id:t.id}}):this.$router.push({name:"playlist",params:{id:t.id}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function XF(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-playlist");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,icon:r.icon(l.item),"is-item":l.isItem,index:l.index,lines:[l.item.name],onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["icon","is-item","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const Sm=nt(zF,[["render",XF]]),YF={name:"PageFiles",components:{ContentWithHeading:ie,ControlButton:un,ListDirectories:GF,ListPlaylists:Sm,ListTracks:es,ModalDialogPlayable:bs,PaneTitle:re},beforeRouteEnter(t,e,n){n(async s=>{await s.fetchData(t)})},beforeRouteUpdate(t,e,n){this.fetchData(t).then(()=>n())},setup(){return{configurationStore:Ho()}},data(){return{directories:[],playlists:new Ct,showDetailsModal:!1,tracks:new Ct}},computed:{current(){return this.$route.query?.directory||"/"},name(){return this.current!=="/"?this.current?.slice(this.current.lastIndexOf("/")+1):this.$t("page.files.title")},playable(){return{expression:`path starts with "${this.current}" order by path asc`,name:this.current,properties:[{key:"property.folders",value:this.directories.length},{key:"property.playlists",value:this.playlists.total},{key:"property.tracks",value:this.tracks.total}]}}},methods:{async fetchData(t){if(t.query.directory){const e=await Tt.files(t.query.directory);e&&(this.directories=e.directories.map(n=>this.transform(n.path)),this.playlists=new Ct(e.playlists),this.tracks=new Ct(e.tracks))}else this.directories=this.configurationStore.directories.map(e=>this.transform(e)),this.playlists=new Ct,this.tracks=new Ct},openDetails(){this.showDetailsModal=!0},play(){ae.playExpression(this.expression,!1)},transform(t){return{name:t.slice(t.lastIndexOf("/")+1),path:t}}}};function ZF(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-directories"),c=w("list-playlists"),u=w("list-tracks"),d=w("content-with-heading"),f=w("modal-dialog-playable");return O(),F(it,null,[E(d,null,{heading:M(()=>[E(o,{content:{title:r.name}},null,8,["content"])]),actions:M(()=>[E(a,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"play",key:"actions.play"}},null,8,["button"])]),content:M(()=>[E(l,{items:i.directories},null,8,["items"]),E(c,{items:i.playlists},null,8,["items"]),E(u,{items:i.tracks,icon:"file-music-outline"},null,8,["items"])]),_:1}),E(f,{item:r.playable,show:i.showDetailsModal,onClose:e[0]||(e[0]=h=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const JF=nt(YF,[["render",ZF]]),QF={name:"PageGenreAlbums",components:{ContentWithHeading:ie,ControlButton:un,ListAlbums:hs,ListIndexButtons:vs,ModalDialogGenre:vm,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Tt.genre(t.params.name,t.query.mediaKind),Tt.genreAlbums(t.params.name,t.query.mediaKind)]).then(([s,i])=>{n(r=>{r.genre=s.items.shift(),r.albums=new Ct(i,{index:{field:"name_sort",type:String}})})})},data(){return{albums:new Ct,genre:{},mediaKind:this.$route.query.mediaKind,showDetailsModal:!1}},computed:{heading(){return this.genre.name?{subtitle:[{count:this.genre.album_count,key:"data.albums"},{count:this.genre.track_count,handler:this.openTracks,key:"data.tracks"}],title:this.genre.name}:{}}},methods:{openDetails(){this.showDetailsModal=!0},openTracks(){this.showDetailsModal=!1,this.$router.push({name:"genre-tracks",params:{name:this.genre.name},query:{mediaKind:this.mediaKind}})},play(){ae.playExpression(`genre is "${this.genre.name}" and media_kind is ${this.mediaKind}`,!0)}}};function tV(t,e,n,s,i,r){const o=w("list-index-buttons"),a=w("pane-title"),l=w("control-button"),c=w("list-albums"),u=w("content-with-heading"),d=w("modal-dialog-genre");return O(),F(it,null,[E(u,null,{options:M(()=>[E(o,{indices:i.albums.indices},null,8,["indices"])]),heading:M(()=>[E(a,{content:r.heading},null,8,["content"])]),actions:M(()=>[E(l,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(l,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:M(()=>[E(c,{items:i.albums},null,8,["items"])]),_:1}),E(d,{item:i.genre,"media-kind":i.mediaKind,show:i.showDetailsModal,onClose:e[0]||(e[0]=f=>i.showDetailsModal=!1)},null,8,["item","media-kind","show"])],64)}const eV=nt(QF,[["render",tV]]),nV={name:"PageGenreTracks",components:{ContentWithHeading:ie,ControlButton:un,ControlDropdown:Br,ListIndexButtons:vs,ListOptions:zo,ListTracks:es,ModalDialogGenre:vm,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Tt.genre(t.params.name,t.query.mediaKind),Tt.genreTracks(t.params.name,t.query.mediaKind)]).then(([s,i])=>{n(r=>{r.genre=s.items.shift(),r.trackList=new Ct(i)})})},setup(){return{uiStore:ts()}},data(){return{genre:{},mediaKind:this.$route.query.mediaKind,showDetailsModal:!1,trackList:new Ct}},computed:{expression(){return`genre is "${this.genre.name}" and media_kind is ${this.mediaKind}`},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("options.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}]},heading(){return this.genre.name?{subtitle:[{count:this.genre.album_count,handler:this.openGenre,key:"data.albums"},{count:this.genre.track_count,key:"data.tracks"}],title:this.genre.name}:{}},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.genreTracksSort);return this.trackList.group(t)}},methods:{openDetails(){this.showDetailsModal=!0},openGenre(){this.showDetailsModal=!1,this.$router.push({name:"genre-albums",params:{name:this.genre.name},query:{mediaKind:this.mediaKind}})},play(){ae.playExpression(this.expression,!0)}}};function sV(t,e,n,s,i,r){const o=w("list-index-buttons"),a=w("control-dropdown"),l=w("list-options"),c=w("pane-title"),u=w("control-button"),d=w("list-tracks"),f=w("content-with-heading"),h=w("modal-dialog-genre");return O(),F(it,null,[E(f,null,{options:M(()=>[E(o,{indices:r.tracks.indices},null,8,["indices"]),E(l,null,{sort:M(()=>[E(a,{value:s.uiStore.genreTracksSort,"onUpdate:value":e[0]||(e[0]=p=>s.uiStore.genreTracksSort=p),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:M(()=>[E(c,{content:r.heading},null,8,["content"])]),actions:M(()=>[E(u,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(u,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:M(()=>[E(d,{items:r.tracks,expression:r.expression},null,8,["items","expression"])]),_:1}),E(h,{item:i.genre,"media-kind":i.mediaKind,show:i.showDetailsModal,onClose:e[1]||(e[1]=p=>i.showDetailsModal=!1)},null,8,["item","media-kind","show"])],64)}const iV=nt(nV,[["render",sV]]),rV={name:"PageGenres",components:{ContentWithHeading:ie,ListGenres:NS,ListIndexButtons:vs,PaneTitle:re,TabsMusic:ti},beforeRouteEnter(t,e,n){Tt.genres("music").then(s=>{n(i=>{i.genres=new Ct(s,{index:{field:"name_sort",type:String}})})})},data(){return{genres:new Ct}},computed:{heading(){return{subtitle:[{count:this.genres.total,key:"data.genres"}],title:this.$t("page.genres.title")}}}};function oV(t,e,n,s,i,r){const o=w("tabs-music"),a=w("list-index-buttons"),l=w("pane-title"),c=w("list-genres"),u=w("content-with-heading");return O(),F(it,null,[E(o),E(u,null,{options:M(()=>[E(a,{indices:i.genres.indices},null,8,["indices"])]),heading:M(()=>[E(l,{content:r.heading},null,8,["content"])]),content:M(()=>[E(c,{items:i.genres,"media-kind":"music"},null,8,["items"])]),_:1})],64)}const aV=nt(rV,[["render",oV]]),lV={name:"PageMusic",components:{ContentWithHeading:ie,ListAlbums:hs,ListTracks:es,PaneTitle:re,TabsMusic:ti},beforeRouteEnter(t,e,n){Promise.all([Tt.search({expression:"time_added after 8 weeks ago and media_kind is music having track_count > 3 order by time_added desc",limit:3,type:"album"}),Tt.search({expression:"time_played after 8 weeks ago and media_kind is music order by time_played desc",limit:3,type:"track"})]).then(([{albums:s},{tracks:i}])=>{n(r=>{r.albums=new Ct(s),r.tracks=new Ct(i)})})},data(){return{albums:[],tracks:null}}};function cV(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-albums"),c=w("router-link"),u=w("content-with-heading"),d=w("list-tracks");return O(),F(it,null,[E(o),E(u,null,{heading:M(()=>[E(a,{content:{title:t.$t("page.music.recently-added.title")}},null,8,["content"])]),content:M(()=>[E(l,{items:i.albums},null,8,["items"])]),footer:M(()=>[E(c,{class:"button is-small is-rounded",to:{name:"music-recently-added"}},{default:M(()=>[Ys(et(t.$t("actions.show-more")),1)]),_:1})]),_:1}),E(u,null,{heading:M(()=>[E(a,{content:{title:t.$t("page.music.recently-played.title")}},null,8,["content"])]),content:M(()=>[E(d,{items:i.tracks},null,8,["items"])]),footer:M(()=>[E(c,{class:"button is-small is-rounded",to:{name:"music-recently-played"}},{default:M(()=>[Ys(et(t.$t("actions.show-more")),1)]),_:1})]),_:1})],64)}const uV=nt(lV,[["render",cV]]),dV={name:"PageMusicRecentlyAdded",components:{ContentWithHeading:ie,ListAlbums:hs,PaneTitle:re,TabsMusic:ti},beforeRouteEnter(t,e,n){const s=Js().recentlyAddedLimit;Tt.search({expression:"media_kind is music having track_count > 3 order by time_added desc",limit:s,type:"album"}).then(i=>{n(r=>{r.albums=new Ct(i.albums,{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}})})})},setup(){return{settingsStore:Js()}},data(){return{albums:new Ct}}};function fV(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-albums"),c=w("content-with-heading");return O(),F(it,null,[E(o),E(c,null,{heading:M(()=>[E(a,{content:{title:t.$t("page.music.recently-added.title")}},null,8,["content"])]),content:M(()=>[E(l,{items:i.albums},null,8,["items"])]),_:1})],64)}const hV=nt(dV,[["render",fV]]),pV={name:"PageMusicRecentlyPlayed",components:{ContentWithHeading:ie,ListTracks:es,PaneTitle:re,TabsMusic:ti},beforeRouteEnter(t,e,n){Tt.search({expression:"time_played after 8 weeks ago and media_kind is music order by time_played desc",limit:50,type:"track"}).then(s=>{n(i=>{i.tracks=new Ct(s.tracks)})})},data(){return{tracks:new Ct}}};function mV(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-tracks"),c=w("content-with-heading");return O(),F(it,null,[E(o),E(c,null,{heading:M(()=>[E(a,{content:{title:t.$t("page.music.recently-played.title")}},null,8,["content"])]),content:M(()=>[E(l,{items:i.tracks},null,8,["items"])]),_:1})],64)}const gV=nt(pV,[["render",mV]]),yV={name:"ModalDialogPlaylistSpotify",components:{ModalDialogPlayable:bs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item.name,properties:[{key:"property.owner",value:this.item.owner?.display_name},{key:"property.tracks",value:this.item.tracks?.total},{key:"property.path",value:this.item.uri}],uri:this.item.uri}}}};function bV(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const DS=nt(yV,[["render",bV]]),vV={name:"ListPlaylistsSpotify",components:{ListItem:$s,LoaderListItem:Sd,ModalDialogPlaylistSpotify:DS},props:{items:{required:!0,type:Object},load:{default:null,type:Function}},setup(){return{settingsStore:Js()}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{image(t){return this.settingsStore.showCoverArtworkInAlbumLists?{caption:t.name,url:t.images?.[0]?.url}:null},open(t){this.$router.push({name:"playlist-spotify",params:{id:t.id}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function _V(t,e,n,s,i,r){const o=w("list-item"),a=w("loader-list-item"),l=w("modal-dialog-playlist-spotify");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,c=>(O(),yt(o,{key:c.id,"is-item":c.isItem,image:r.image(c),index:c.index,lines:[c.name,c.owner.display_name],onOpen:u=>r.open(c),onOpenDetails:u=>r.openDetails(c)},null,8,["is-item","image","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{load:n.load},null,8,["load"]),E(l,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=c=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const Em=nt(vV,[["render",_V]]),SV={name:"PageMusicSpotify",components:{ContentWithHeading:ie,ListAlbumsSpotify:wd,ListPlaylistsSpotify:Em,PaneTitle:re,TabsMusic:ti},beforeRouteEnter(t,e,n){Nn.spotify().then(({api:s,configuration:i})=>{Promise.all([s.browse.getNewReleases(i.webapi_country,3),s.browse.getFeaturedPlaylists(i.webapi_country,null,null,3)]).then(r=>{n(o=>{o.albums=r[0].albums.items,o.playlists=r[1].playlists.items})})})},data(){return{albums:[],playlists:[]}}};function EV(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-albums-spotify"),c=w("router-link"),u=w("content-with-heading"),d=w("list-playlists-spotify");return O(),F(it,null,[E(o),E(u,null,{heading:M(()=>[E(a,{content:{title:t.$t("page.spotify.music.new-releases")}},null,8,["content"])]),content:M(()=>[E(l,{items:i.albums},null,8,["items"])]),footer:M(()=>[E(c,{to:{name:"music-spotify-new-releases"},class:"button is-small is-rounded"},{default:M(()=>[Ys(et(t.$t("actions.show-more")),1)]),_:1})]),_:1}),E(u,null,{heading:M(()=>[E(a,{content:{title:t.$t("page.spotify.music.featured-playlists")}},null,8,["content"])]),content:M(()=>[E(d,{items:i.playlists},null,8,["items"])]),footer:M(()=>[E(c,{to:{name:"music-spotify-featured-playlists"},class:"button is-small is-rounded"},{default:M(()=>[Ys(et(t.$t("actions.show-more")),1)]),_:1})]),_:1})],64)}const wV=nt(SV,[["render",EV]]),kV={name:"PageMusicSpotifyFeaturedPlaylists",components:{ContentWithHeading:ie,ListPlaylistsSpotify:Em,PaneTitle:re,TabsMusic:ti},beforeRouteEnter(t,e,n){Nn.spotify().then(({api:s,configuration:i})=>{s.browse.getFeaturedPlaylists(i.webapi_country,null,null,50).then(r=>{n(o=>{o.playlists=r.playlists.items})})})},data(){return{playlists:[]}},computed:{heading(){return{title:this.$t("page.spotify.music.featured-playlists")}}}};function CV(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-playlists-spotify"),c=w("content-with-heading");return O(),F(it,null,[E(o),E(c,null,{heading:M(()=>[E(a,{content:r.heading},null,8,["content"])]),content:M(()=>[E(l,{items:i.playlists},null,8,["items"])]),_:1})],64)}const TV=nt(kV,[["render",CV]]),AV={name:"PageMusicSpotifyNewReleases",components:{ContentWithHeading:ie,ListAlbumsSpotify:wd,PaneTitle:re,TabsMusic:ti},beforeRouteEnter(t,e,n){Nn.spotify().then(({api:s,configuration:i})=>{s.browse.getNewReleases(i.webapi_country,50).then(r=>{n(o=>{o.albums=r.albums.items})})})},data(){return{albums:[]}},computed:{heading(){return{title:this.$t("page.spotify.music.new-releases")}}}};function OV(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-albums-spotify"),c=w("content-with-heading");return O(),F(it,null,[E(o),E(c,null,{heading:M(()=>[E(a,{content:r.heading},null,8,["content"])]),content:M(()=>[E(l,{items:i.albums},null,8,["items"])]),_:1})],64)}const xV=nt(AV,[["render",OV]]),IV={name:"ModalDialogQueueItem",components:{ListProperties:OS,ModalDialog:rr},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],setup(){return{servicesStore:Qn()}},data(){return{spotifyTrack:{}}},computed:{actions(){return[{handler:this.remove,icon:"delete",key:"actions.remove"},{handler:this.play,icon:"play",key:"actions.play"}]},playable(){return{name:this.item.title,properties:[{handler:this.openAlbum,key:"property.album",value:this.item.album},{handler:this.openArtist,key:"property.album-artist",value:this.item.album_artist},{key:"property.composer",value:this.item.composer},{key:"property.year",value:this.item.year},{handler:this.openGenre,key:"property.genre",value:this.item.genre},{key:"property.position",value:this.item.track_number>0&&[this.item.disc_number,this.item.track_number].join(" / ")},{key:"property.duration",value:this.$formatters.toTimecode(this.item.length_ms)},{key:"property.path",value:this.item.path},{key:"property.type",value:`${this.$t(`media.kind.${this.item.media_kind}`)} - ${this.$t(`data.kind.${this.item.data_kind}`)}`},{key:"property.quality",value:this.item.data_kind!=="spotify"&&this.$t("dialog.track.quality",{bitrate:this.item.bitrate,count:this.item.channels,format:this.item.type,samplerate:this.item.samplerate})}],uri:this.item.uri}}},watch:{item(){return this.item?.data_kind==="spotify"?Nn.spotify().then(({api:t})=>{const e=this.item.path.slice(this.item.path.lastIndexOf(":")+1);return t.tracks.get(e).then(n=>{this.spotifyTrack=n})}):(this.spotifyTrack={},{})}},methods:{openAlbum(){this.$emit("close"),this.item.data_kind==="spotify"?this.$router.push({name:"music-spotify-album",params:{id:this.spotifyTrack.album.id}}):this.item.media_kind==="podcast"?this.$router.push({name:"podcast",params:{id:this.item.album_id}}):this.$router.push({name:`${this.item.media_kind}-album`,params:{id:this.item.album_id}})},openArtist(){this.$emit("close"),this.item.data_kind==="spotify"?this.$router.push({name:"music-spotify-artist",params:{id:this.spotifyTrack.artists[0].id}}):this.item.media_kind==="music"||this.item.media_kind==="podcast"?this.$router.push({name:"music-artist",params:{id:this.item.album_artist_id}}):this.item.media_kind==="audiobook"&&this.$router.push({name:"audiobook-artist",params:{id:this.item.album_artist_id}})},openGenre(){this.$emit("close"),this.$router.push({name:"genre-albums",params:{name:this.item.genre},query:{mediaKind:this.item.media_kind}})},play(){this.$emit("close"),en.play({item_id:this.item.id})},remove(){this.$emit("close"),ae.remove(this.item.id)}}};function NV(t,e,n,s,i,r){const o=w("list-properties"),a=w("modal-dialog");return O(),yt(a,{actions:r.actions,show:n.show,title:n.item.title,onClose:e[0]||(e[0]=l=>t.$emit("close"))},{content:M(()=>[E(o,{item:r.playable},null,8,["item"])]),_:1},8,["actions","show","title"])}const LS=nt(IV,[["render",NV]]),PV={name:"PaneLyrics",setup(){return{MIDDLE_POSITION:Math.floor(3.5),VISIBLE_VERSES:7,playerStore:Wn()}},data(){return{lastUpdateTime:0,lyrics:{synchronised:!1,verses:[]},time:0,timerId:null}},computed:{verseIndex(t,e){let n=0,s=e.length-1;for(;n<=s;){const i=Math.floor((n+s)/2),r=e[i].time,o=e[i+1]?.time;if(r<=t&&(!o||o>t))return i;rt[n+r]??{text:" "})}},watch:{"playerStore.isPlaying"(t){t?(this.lastUpdateTime=Date.now(),this.startTimer()):this.stopTimer()},"playerStore.item_progress_ms"(t){this.lastUpdateTime=Date.now(),this.playerStore.isPlaying||(this.time=t)},"playerStore.lyricsContent"(){this.lyrics=this.parseLyrics()}},mounted(){this.playerStore.initialise(),this.lastUpdateTime=Date.now(),this.lyrics=this.parseLyrics(),this.updateTime()},beforeUnmount(){this.stopTimer()},methods:{isVerseHighlighted(t){return t===this.MIDDLE_POSITION&&this.lyrics.synchronised},isWordHighlighted(t){return this.time>=t.start&&this.time\d+):(?\d+)(?:\.(?\d+))?\])?\s*(?\S.*\S)?\s*/u;return this.playerStore.lyricsContent.split(` + `;return`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(s)}`},b5={name:"ControlImage",props:{caption:{default:"",type:String},url:{default:"",type:String}},emits:["click"],data(){return{font:{family:"sans-serif",weight:"bold"},size:600}},computed:{source(){return{lifecycle:{error:t=>{t.src=this.uri}},src:this.url||this.uri}},uri(){return y5({alternate:this.caption,caption:this.caption.substring(0,2),font:this.font,size:this.size})}}},v5={class:"figure has-shadow is-clickable"};function _5(t,e,n,s,i,r){const o=Qh("lazy");return O(),F("figure",v5,[ms(P("img",{onClick:e[0]||(e[0]=a=>t.$emit("click"))},null,512),[[o,r.source]])])}const jr=nt(b5,[["render",_5],["__scopeId","data-v-e43b98b9"]]),{t:Jl,locale:S5}=Gs.global,AS="NO_INDEX",E5=(t,e)=>t-e,w5=(t,e)=>t.localeCompare(e,S5.value),k5=(t,e)=>{const n=Date.parse(t),s=Date.parse(e),i=isNaN(n),r=isNaN(s);return i&&r?0:i&&1||r&&-1||n-s},C5=t=>t.map(({field:e,type:n,order:s=1})=>{switch(n){case String:return(i,r)=>w5(i[e],r[e])*s;case Number:return(i,r)=>E5(i[e],r[e])*s;case Date:return(i,r)=>k5(i[e],r[e])*s;default:return()=>0}}),T5=(t="")=>{const e=t.charAt(0);return e.match(new RegExp("\\p{Letter}","gu"))?e.toUpperCase():e.match(new RegExp("\\p{Number}","gu"))?"#":"⌘"},A5=t=>{},O5=[{difference:NaN,text:()=>Jl("grouped-list.undefined")},{difference:864e5,text:()=>Jl("grouped-list.today")},{difference:6048e5,text:()=>Jl("grouped-list.last-week")},{difference:2592e6,text:()=>Jl("grouped-list.last-month")},{difference:1/0,text:t=>t.getFullYear()}],x5=t=>{const e=new Date(t),n=new Date-e;return O5.find(s=>isNaN(n)||n{switch(e){case String:return n=>T5(n[t]);case Number:return n=>n[t];case Date:return n=>x5(n[t]);case"Digits":return n=>A5(n[t]);default:return()=>AS}};class Ct{constructor({items:e=[],total:n=0,offset:s=0,limit:i=-1}={},r={}){this.items=e,this.total=n,this.offset=s,this.limit=i,this.count=e.length,this.indices=[],this.group(r)}group({criteria:e=[],filters:n=[],index:s}={}){const i=this.items.filter(l=>n.every(c=>c(l)));this.count=i.length;const r=C5(e),o=i.sort((l,c)=>r.reduce((u,d)=>u||d(l,c),0)),a=I5(s);return this.itemsGrouped=o.reduce((l,c)=>{const u=a(c);return l.set(u,[...l.get(u)||[],c]),l},new Map),this.indices=Array.from(this.itemsGrouped.keys()),this}*generate(){for(const[e,n]of this.itemsGrouped.entries()){e!==AS&&(yield{index:e,isItem:!1,item:{},itemId:e});for(const s of n)yield{index:e,isItem:!0,item:s,itemId:s.id}}}[Symbol.iterator](){return this.generate()}}const pm={name:"ControlProgress",props:{size:{default:36,type:Number},value:{default:0,type:Number}},computed:{offset(){return 1-this.value},progress(){return`${Math.round(this.value*100)}%`}}},Ib=()=>{ap(t=>({"3ce61f74":t.offset}))},Nb=pm.setup;pm.setup=Nb?(t,e)=>(Ib(),Nb(t,e)):Ib;const N5={class:"is-flex"},P5=["width","height"],R5=["textContent"];function D5(t,e,n,s,i,r){return O(),F("div",N5,[(O(),F("svg",{width:n.size,height:n.size,viewBox:"0 0 200 200"},[e[0]||(e[0]=P("defs",null,[P("circle",{id:"circle",cx:"50%",cy:"50%",pathLength:"1",r:"90"})],-1)),e[1]||(e[1]=P("use",{href:"#circle",class:"progress-base"},null,-1)),e[2]||(e[2]=P("use",{href:"#circle",class:"progress-bar"},null,-1)),P("text",{x:"50%",y:"50%",class:"is-size-1 progress-text",textContent:et(r.progress)},null,8,R5)],8,P5))])}const L5=nt(pm,[["render",D5],["__scopeId","data-v-06c7995f"]]),M5={name:"ListItem",components:{ControlImage:jr,ControlProgress:L5},props:{icon:{default:null,type:String},image:{default:null,type:Object},index:{default:null,type:[String,Number]},isItem:{default:!0,type:Boolean},isPlayable:{default:!0,type:Boolean},isRead:{default:!1,type:Boolean},lines:{default:null,type:Array},progress:{default:null,type:Number}},emits:["open","openDetails"],methods:{open(){this.$emit("open")},openDetails(){this.$emit("openDetails")}}},$5={key:0,class:"py-5"},F5={class:"media-content"},V5=["id","textContent"],U5={class:"media-content"},H5=["textContent"],j5={key:0,class:"is-size-7 has-text-grey"},B5={key:2,class:"media-right"},W5={class:"media-right"};function G5(t,e,n,s,i,r){const o=w("mdicon"),a=w("control-image"),l=w("control-progress");return n.isItem?(O(),F("div",{key:1,class:Gt(["media is-align-items-center mb-0",{"is-clickable":n.isPlayable,"is-not-allowed":!n.isPlayable}]),onClick:e[1]||(e[1]=(...c)=>r.open&&r.open(...c))},[n.icon?(O(),yt(o,{key:0,class:"media-left icon",name:n.icon},null,8,["name"])):_t("",!0),n.image?(O(),yt(a,{key:1,url:n.image.url,caption:n.image.caption,class:"media-left is-small"},null,8,["url","caption"])):_t("",!0),P("div",U5,[(O(!0),F(it,null,de(n.lines,(c,u)=>(O(),F("div",{key:u,class:Gt({"is-size-6":u===0,"is-size-7":u!==0,"has-text-weight-bold":u!==2,"has-text-grey":(u!==0||n.isRead)&&n.isPlayable,"has-text-grey-light":!n.isPlayable}),textContent:et(c)},null,10,H5))),128)),n.isPlayable?_t("",!0):(O(),F("div",j5,[le(t.$slots,"reason",{},void 0,!0)]))]),n.progress?(O(),F("div",B5,[E(l,{value:n.progress},null,8,["value"])])):_t("",!0),P("div",W5,[P("a",{onClick:e[0]||(e[0]=Bn((...c)=>r.openDetails&&r.openDetails(...c),["prevent","stop"]))},[E(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})])])],2)):(O(),F("div",$5,[P("div",F5,[P("span",{id:`index_${n.index}`,class:"tag is-small has-text-weight-bold",textContent:et(n.index)},null,8,V5)])]))}const $s=nt(M5,[["render",G5],["__scopeId","data-v-8ec36f11"]]),K5={name:"ListProperties",components:{ControlImage:jr},props:{item:{required:!0,type:Object}}},q5=["textContent"],z5={class:"title is-6"},X5=["onClick","textContent"],Y5=["textContent"];function Z5(t,e,n,s,i,r){const o=w("control-image");return O(),F(it,null,[n.item.image?(O(),yt(o,{key:0,url:n.item.image,caption:n.item.name,class:"is-normal mb-5"},null,8,["url","caption"])):_t("",!0),t.$slots.buttons?le(t.$slots,"buttons",{key:1}):_t("",!0),(O(!0),F(it,null,de(n.item.properties?.filter(a=>a.value),a=>(O(),F("div",{key:a.key,class:"mb-3"},[P("div",{class:"is-size-7 is-uppercase",textContent:et(t.$t(a.key))},null,8,q5),P("div",z5,[a.handler?(O(),F("a",{key:0,onClick:a.handler,textContent:et(a.value)},null,8,X5)):(O(),F("span",{key:1,class:"title is-6",textContent:et(a.value)},null,8,Y5))])]))),128))],64)}const OS=nt(K5,[["render",Z5]]),J5={name:"ModalDialogPlayable",components:{ControlButton:un,ListProperties:OS,ModalDialog:rr},props:{buttons:{default:()=>[],type:Array},item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{actions(){return[{handler:this.addToQueue,icon:"playlist-plus",key:"actions.add"},{handler:this.addNextToQueue,icon:"playlist-play",key:"actions.add-next"},{handler:this.play,icon:"play",key:"actions.play"}]}},methods:{addNextToQueue(){this.$emit("close"),this.item.expression?ae.addExpression(this.item.expression,!0):ae.addUri(this.item.uris||this.item.uri,!0)},addToQueue(){this.$emit("close"),this.item.expression?ae.addExpression(this.item.expression):ae.addUri(this.item.uris||this.item.uri)},play(){this.$emit("close"),this.item.expression?ae.playExpression(this.item.expression,!1):ae.playUri(this.item.uris||this.item.uri,!1)}}},Q5={class:"buttons"};function t8(t,e,n,s,i,r){const o=w("control-button"),a=w("list-properties"),l=w("modal-dialog");return O(),yt(l,{actions:r.actions,show:n.show,title:n.item.name,onClose:e[0]||(e[0]=c=>t.$emit("close"))},{content:M(()=>[E(a,{item:n.item},cl({_:2},[n.buttons.length?{name:"buttons",fn:M(()=>[P("div",Q5,[(O(!0),F(it,null,de(n.buttons,c=>(O(),yt(o,{key:c.key,button:c},null,8,["button"]))),128))])]),key:"0"}:void 0]),1032,["item"])]),_:1},8,["actions","show","title"])}const bs=nt(J5,[["render",t8]]),e8={name:"ModalDialogTrack",components:{ModalDialogPlayable:bs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close","play-count-changed"],computed:{buttons(){return this.item.media_kind!=="podcast"?[]:this.item.play_count>0?[{handler:this.markAsNew,key:"actions.mark-as-new"}]:[{handler:this.markAsPlayed,key:"actions.mark-as-played"}]},playable(){return{name:this.item.title,properties:[{handler:this.openAlbum,key:"property.album",value:this.item.album},{handler:this.openArtist,key:"property.album-artist",value:this.item.album_artist},{key:"property.composer",value:this.item.composer},{key:"property.release-date",value:this.$formatters.toDate(this.item.date_released)},{key:"property.year",value:this.item.year},{key:"property.genre",value:this.item.genre},{key:"property.position",value:this.item.track_number>0&&[this.item.disc_number,this.item.track_number].join(" / ")},{key:"property.duration",value:this.item.length_ms>0&&this.$formatters.toTimecode(this.item.length_ms)},{key:"property.type",value:`${this.$t(`media.kind.${this.item.media_kind}`)} - ${this.$t(`data.kind.${this.item.data_kind}`)}`},{key:"property.quality",value:this.item.data_kind!=="spotify"&&this.$t("dialog.track.quality",{bitrate:this.item.bitrate,count:this.item.channels,format:this.item.type,samplerate:this.item.samplerate})},{key:"property.added-on",value:this.$formatters.toDateTime(this.item.time_added)},{key:"property.rating",value:this.$t("dialog.track.rating",{rating:Math.floor(this.item.rating/10)})},{key:"property.comment",value:this.item.comment},{key:"property.path",value:this.item.path}],uri:this.item.uri}}},methods:{markAsNew(){Tt.updateTrack(this.item.id,{play_count:"reset"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},markAsPlayed(){Tt.updateTrack(this.item.id,{play_count:"increment"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},openAlbum(){this.$emit("close"),this.item.media_kind==="podcast"?this.$router.push({name:"podcast",params:{id:this.item.album_id}}):this.item.media_kind==="audiobook"?this.$router.push({name:"audiobook-album",params:{id:this.item.album_id}}):this.item.media_kind==="music"&&this.$router.push({name:"music-album",params:{id:this.item.album_id}})},openArtist(){this.$emit("close"),this.item.media_kind==="music"||this.item.media_kind==="podcast"?this.$router.push({name:"music-artist",params:{id:this.item.album_artist_id}}):this.item.media_kind==="audiobook"&&this.$router.push({name:"audiobook-artist",params:{id:this.item.album_artist_id}})},openGenre(){this.$emit("close"),this.$router.push({name:"genre-albums",params:{name:this.item.genre},query:{mediaKind:this.item.media_kind}})}}};function n8(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{buttons:r.buttons,item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["buttons","item","show"])}const s8=nt(e8,[["render",n8]]),i8={name:"ListTracks",components:{ListItem:$s,ModalDialogTrack:s8},props:{expression:{default:"",type:String},icon:{default:null,type:String},items:{default:null,type:Object},load:{default:null,type:Function},showProgress:{default:!1,type:Boolean},uris:{default:"",type:String}},emits:["play-count-changed"],data(){return{selectedItem:{},showDetailsModal:!1}},methods:{isRead(t){return t.media_kind==="podcast"&&t.play_count>0},open(t){this.uris?ae.playUri(this.uris,!1,this.items.items.indexOf(t)):this.expression?ae.playExpression(this.expression,!1,this.items.items.indexOf(t)):ae.playUri(t.uri,!1)},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0},progress(t){return this.showProgress&&t.seek_ms>0?t.seek_ms/t.length_ms:null}}};function r8(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-track");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,icon:n.icon,"is-item":l.isItem,"is-read":r.isRead(l.item),index:l.index,lines:[l.item.title,l.item.artist,l.item.album],progress:r.progress(l.item),onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["icon","is-item","is-read","index","lines","progress","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1),onPlayCountChanged:e[1]||(e[1]=l=>t.$emit("play-count-changed"))},null,8,["item","show"])],64)}const es=nt(i8,[["render",r8]]),o8={name:"ModalDialogAlbum",components:{ModalDialog:rr,ModalDialogPlayable:bs},props:{item:{required:!0,type:Object},mediaKind:{default:"",type:String},show:Boolean},emits:["close","play-count-changed","podcast-deleted"],data(){return{showRemovePodcastModal:!1}},computed:{actions(){return[{handler:this.cancel,icon:"cancel",key:this.$t("actions.cancel")},{handler:this.removePodcast,icon:"delete",key:this.$t("actions.remove")}]},buttons(){return this.computedMediaKind==="podcast"?this.item.data_kind==="url"?[{handler:this.markAsPlayed,key:"actions.mark-as-played"},{handler:this.openRemovePodcastDialog,key:"actions.remove"}]:[{handler:this.markAsPlayed,key:"actions.mark-as-played"}]:[]},computedMediaKind(){return this.mediaKind||this.item.media_kind},playable(){return{image:this.item.artwork_url,name:this.item.name,properties:[{handler:this.openArtist,key:"property.artist",value:this.item.artist},{key:"property.release-date",value:this.$formatters.toDate(this.item.date_released)},{key:"property.year",value:this.item.year},{key:"property.tracks",value:this.item.track_count},{key:"property.duration",value:this.$formatters.toTimecode(this.item.length_ms)},{key:"property.type",value:`${this.$t(`media.kind.${this.item.media_kind}`)} - ${this.$t(`data.kind.${this.item.data_kind}`)}`},{key:"property.added-on",value:this.$formatters.toDateTime(this.item.time_added)}],uri:this.item.uri}}},methods:{cancel(){this.showRemovePodcastModal=!1},markAsPlayed(){Tt.updateAlbum(this.item.id,{play_count:"played"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},openArtist(){this.$emit("close"),this.$router.push({name:`${this.computedMediaKind}-artist`,params:{id:this.item.artist_id}})},openRemovePodcastDialog(){this.showRemovePodcastModal=!0,this.showDetailsModal=!1},removePodcast(){this.showRemovePodcastModal=!1,Tt.albumTracks(this.item.id,{limit:1}).then(t=>{Tt.trackPlaylists(t.items[0].id).then(e=>{const{id:n}=e.items.find(s=>s.type==="rss");Tt.playlistDelete(n).then(()=>{this.$emit("podcast-deleted"),this.$emit("close")})})})}}},a8=["textContent"];function l8(t,e,n,s,i,r){const o=w("modal-dialog-playable"),a=w("i18n-t"),l=w("modal-dialog");return O(),F(it,null,[E(o,{buttons:r.buttons,item:r.playable,show:n.show,onClose:e[0]||(e[0]=c=>t.$emit("close"))},null,8,["buttons","item","show"]),E(l,{actions:r.actions,show:i.showRemovePodcastModal,title:t.$t("dialog.podcast.remove.title"),onClose:e[1]||(e[1]=c=>i.showRemovePodcastModal=!1),onRemove:r.removePodcast},{content:M(()=>[E(a,{tag:"p",keypath:"dialog.podcast.remove.info",scope:"global"},{separator:M(()=>e[2]||(e[2]=[P("br",null,null,-1)])),name:M(()=>[P("b",{textContent:et(n.item.name)},null,8,a8)]),_:1})]),_:1},8,["actions","show","title","onRemove"])],64)}const vd=nt(o8,[["render",l8]]),c8={name:"PaneHero",components:{ControlButton:un},props:{content:{required:!0,type:Object}}},u8=["textContent"],d8={class:"subtitle is-6"},f8=["textContent"],h8=["textContent"],p8={class:"buttons is-centered-mobile mt-5"};function m8(t,e,n,s,i,r){const o=w("control-button");return O(),F(it,null,[P("div",{class:"title is-5",textContent:et(n.content.title)},null,8,u8),P("div",d8,[P("a",{onClick:e[0]||(e[0]=(...a)=>n.content.handler&&n.content.handler(...a)),textContent:et(n.content.subtitle)},null,8,f8)]),P("div",{class:"is-size-7 is-uppercase has-text-centered-mobile",textContent:et(n.content.count)},null,8,h8),P("div",p8,[(O(!0),F(it,null,de(n.content.actions,(a,l)=>(O(),yt(o,{key:l,button:a},null,8,["button"]))),128))])],64)}const _d=nt(c8,[["render",m8]]),g8={name:"PageAlbum",components:{ContentWithHero:bd,ControlImage:jr,ListTracks:es,ModalDialogAlbum:vd,PaneHero:_d},beforeRouteEnter(t,e,n){Promise.all([Tt.album(t.params.id),Tt.albumTracks(t.params.id)]).then(([s,i])=>{n(r=>{r.album=s,r.tracks=new Ct(i,{criteria:[{field:"disc_number",type:Number}],index:{field:"disc_number",type:Number}}),r.tracks.indices.length<2&&r.tracks.group()})})},data(){return{album:{},showDetailsModal:!1,tracks:new Ct}},computed:{heading(){return{count:this.$t("data.tracks",{count:this.album.track_count}),handler:this.openArtist,subtitle:this.album.artist,title:this.album.name,actions:[{handler:this.play,icon:"shuffle",key:"actions.shuffle"},{handler:this.openDetails,icon:"dots-horizontal"}]}}},methods:{openArtist(){this.showDetailsModal=!1,this.$router.push({name:"music-artist",params:{id:this.album.artist_id}})},openDetails(){this.showDetailsModal=!0},play(){ae.playUri(this.album.uri,!0)}}};function y8(t,e,n,s,i,r){const o=w("pane-hero"),a=w("control-image"),l=w("list-tracks"),c=w("content-with-hero"),u=w("modal-dialog-album");return O(),F(it,null,[E(c,null,{heading:M(()=>[E(o,{content:r.heading},null,8,["content"])]),image:M(()=>[E(a,{url:i.album.artwork_url,caption:i.album.name,class:"is-medium",onClick:r.openDetails},null,8,["url","caption","onClick"])]),content:M(()=>[E(l,{items:i.tracks,uris:i.album.uri},null,8,["items","uris"])]),_:1}),E(u,{item:i.album,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const b8=nt(g8,[["render",y8]]);function v8(t){return t.scrollHeight}function _8(t){return t.scrollWidth}function S8(t,e){t.scrollTop=t.scrollHeight-e+t.scrollTop}function E8(t,e){t.scrollLeft=t.scrollWidth-e+t.scrollLeft}const w8=P("div",{class:"loading"},"Loading...",-1),k8=P("div",{class:"no-more"},"No more.",-1),C8=P("div",{class:"no-results"},"No results.",-1),T8=P("div",{class:"error"},"Error.",-1),A8=Ti({__name:"VueEternalLoading",props:{load:{required:!0,type:Function},isInitial:{required:!1,type:Boolean,default:!0},position:{required:!1,type:String,default:"default"},container:{required:!1,type:Object,default:null},margin:{required:!1,type:String,default:void 0}},emits:["update:isInitial"],setup(t,{emit:e}){const n=t,s=cs();let i=cs("loading"),r=cs(n.isInitial),o=0;function a(){Vr(()=>{var g,b;n.position==="top"?S8((g=n.container)!=null?g:document.documentElement,o):n.position==="left"&&E8((b=n.container)!=null?b:document.documentElement,o)})}function l(g,b){return g===0?r.value?(u(),"no-results"):(c(),"no-more"):g!==void 0&&b!==void 0&&g{var b,S;g.isIntersecting&&(n.position==="top"?o=v8((b=n.container)!=null?b:document.documentElement):n.position==="left"&&(o=_8((S=n.container)!=null?S:document.documentElement)),m(),n.load({loaded:l,noMore:c,noResults:u,error:d},{isFirstLoad:r.value}))},{root:n.container,threshold:0,rootMargin:n.margin})}let v;return typeof IntersectionObserver<"u"&&gv(()=>{v&&m(),v=y(),_()},{flush:"post"}),Zn(()=>n.isInitial,g=>{g&&f()}),Zn(r,g=>{g||e("update:isInitial",!1)}),(g,b)=>(O(),F("div",{class:"vue-eternal-loading",ref_key:"rootRef",ref:s},[Vn(i)==="loading"?le(g.$slots,"loading",ao(co({key:0},{isFirstLoad:Vn(r)})),()=>[w8]):Vn(i)==="no-more"?le(g.$slots,"no-more",ao(co({key:1},{retry:h})),()=>[k8]):Vn(i)==="no-results"?le(g.$slots,"no-results",ao(co({key:2},{retry:h})),()=>[C8]):Vn(i)==="error"?le(g.$slots,"error",ao(co({key:3},{retry:h})),()=>[T8]):_t("",!0)],512))}}),O8={name:"LoaderListItem",components:{VueEternalLoading:A8},props:{load:{default:null,type:Function}}},x8={class:"columns is-centered"},I8={class:"column has-text-centered"};function N8(t,e,n,s,i,r){const o=w("mdicon"),a=w("vue-eternal-loading");return n.load?(O(),yt(a,{key:0,load:n.load},{loading:M(()=>[P("div",x8,[P("div",I8,[E(o,{class:"icon mdi-spin",name:"loading"})])])]),"no-more":M(()=>e[0]||(e[0]=[P("br",null,null,-1)])),"no-results":M(()=>e[1]||(e[1]=[P("br",null,null,-1)])),_:1},8,["load"])):_t("",!0)}const Sd=nt(O8,[["render",N8]]),P8={name:"ModalDialogTrackSpotify",components:{ModalDialogPlayable:bs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return this.item.artists?{name:this.item.name,properties:[{handler:this.openAlbum,key:"property.album",value:this.item.album.name},{handler:this.openArtist,key:"property.album-artist",value:this.item.artists[0]?.name},{key:"property.release-date",value:this.$formatters.toDate(this.item.album.release_date)},{key:"property.position",value:this.item.track_number>0&&[this.item.disc_number,this.item.track_number].join(" / ")},{key:"property.duration",value:this.$formatters.toTimecode(this.item.duration_ms)},{key:"property.path",value:this.item.uri}],uri:this.item.uri}:{}}},methods:{openAlbum(){this.$emit("close"),this.$router.push({name:"music-spotify-album",params:{id:this.item.album.id}})},openArtist(){this.$emit("close"),this.$router.push({name:"music-spotify-artist",params:{id:this.item.artists[0].id}})}}};function R8(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const D8=nt(P8,[["render",R8]]),L8={name:"ListTracksSpotify",components:{ListItem:$s,LoaderListItem:Sd,ModalDialogTrackSpotify:D8},props:{contextUri:{default:"",type:String},items:{required:!0,type:Object},load:{default:null,type:Function}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{open(t){t.is_playable&&ae.playUri(this.contextUri||t.uri,!1,t.position||0)},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}},M8=["textContent"],$8=["textContent"];function F8(t,e,n,s,i,r){const o=w("list-item"),a=w("loader-list-item"),l=w("modal-dialog-track-spotify");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,c=>(O(),yt(o,{key:c.id,"is-playable":c.is_playable,lines:[c.name,c.artists[0].name,c.album.name],onOpen:u=>r.open(c),onOpenDetails:u=>r.openDetails(c)},cl({_:2},[c.is_playable?void 0:{name:"reason",fn:M(()=>[e[1]||(e[1]=Ys(" (",-1)),P("span",{textContent:et(t.$t("list.spotify.not-playable-track"))},null,8,M8),c.restrictions?.reason?(O(),F("span",{key:0,textContent:et(t.$t("list.spotify.restriction-reason",{reason:c.restrictions.reason}))},null,8,$8)):_t("",!0),e[2]||(e[2]=Ys(") ",-1))]),key:"0"}]),1032,["is-playable","lines","onOpen","onOpenDetails"]))),128)),E(a,{load:n.load},null,8,["load"]),E(l,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=c=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const mm=nt(L8,[["render",F8]]),V8={name:"ModalDialogAlbumSpotify",components:{ModalDialogPlayable:bs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{image:this.item.images?.[0]?.url||"",name:this.item.name||"",properties:[{handler:this.openArtist,key:"property.artist",value:this.item?.artists?.[0]?.name},{key:"property.release-date",value:this.$formatters.toDate(this.item.release_date)},{key:"property.type",value:this.item.album_type}],uri:this.item.uri}}},methods:{openArtist(){this.$emit("close"),this.$router.push({name:"music-spotify-artist",params:{id:this.item.artists[0].id}})}}};function U8(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const xS=nt(V8,[["render",U8]]),H8={name:"PageAlbumSpotify",components:{ContentWithHero:bd,ControlImage:jr,ListTracksSpotify:mm,ModalDialogAlbumSpotify:xS,PaneHero:_d},beforeRouteEnter(t,e,n){Nn.spotify().then(({api:s,configuration:i})=>{s.albums.get(t.params.id,i.webapi_country).then(r=>{n(o=>{o.album=r})})})},setup(){return{servicesStore:Qn()}},data(){return{album:{artists:[{}],tracks:{}},showDetailsModal:!1}},computed:{heading(){return{actions:[{handler:this.play,icon:"shuffle",key:"actions.shuffle"},{handler:this.openDetails,icon:"dots-horizontal"}],count:this.$t("data.tracks",{count:this.album.tracks.total}),handler:this.openArtist,subtitle:this.album.artists[0].name,title:this.album.name}},tracks(){const{album:t}=this;return t.tracks.total?t.tracks.items.map(e=>({...e,album:t})):[]}},methods:{openArtist(){this.$router.push({name:"music-spotify-artist",params:{id:this.album.artists[0].id}})},openDetails(){this.showDetailsModal=!0},play(){this.showDetailsModal=!1,ae.playUri(this.album.uri,!0)}}};function j8(t,e,n,s,i,r){const o=w("pane-hero"),a=w("control-image"),l=w("list-tracks-spotify"),c=w("content-with-hero"),u=w("modal-dialog-album-spotify");return O(),F(it,null,[E(c,null,{heading:M(()=>[E(o,{content:r.heading},null,8,["content"])]),image:M(()=>[E(a,{url:i.album.images?.[0]?.url??"",caption:i.album.name,class:"is-medium",onClick:r.openDetails},null,8,["url","caption","onClick"])]),content:M(()=>[E(l,{items:r.tracks,"context-uri":i.album.uri},null,8,["items","context-uri"])]),_:1}),E(u,{item:i.album,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const B8=nt(H8,[["render",j8]]),W8={name:"ControlDropdown",props:{options:{required:!0,type:Array},value:{required:!0,type:[String,Number]}},emits:["update:value"],data(){return{active:!1}},computed:{option:{get(){return this.options.find(t=>t.id===this.value)}}},methods:{deactivate(){this.active=!1},select(t){this.active=!1,this.$emit("update:value",t.id)}}},G8={class:"dropdown-trigger"},K8=["textContent"],q8={id:"dropdown",class:"dropdown-menu",role:"menu"},z8={class:"dropdown-content"},X8=["onClick","textContent"];function Y8(t,e,n,s,i,r){const o=w("mdicon"),a=Qh("click-away");return ms((O(),F("div",{class:Gt(["dropdown",{"is-active":i.active}])},[P("div",G8,[P("button",{class:"button","aria-haspopup":"true","aria-controls":"dropdown",onClick:e[0]||(e[0]=l=>i.active=!i.active)},[P("span",{textContent:et(r.option.name)},null,8,K8),E(o,{class:"icon",name:"chevron-down",size:"16"})])]),P("div",q8,[P("div",z8,[(O(!0),F(it,null,de(n.options,l=>(O(),F("a",{key:l.id,class:Gt(["dropdown-item",{"is-active":n.value===l.id}]),onClick:c=>r.select(l),textContent:et(l.name)},null,10,X8))),128))])])],2)),[[a,r.deactivate]])}const Br=nt(W8,[["render",Y8]]),Z8={name:"ListAlbums",components:{ListItem:$s,ModalDialogAlbum:vd},props:{items:{required:!0,type:Object},load:{default:null,type:Function},mediaKind:{default:"",type:String}},emits:["play-count-changed","podcast-deleted"],setup(){return{settingsStore:Js()}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{image(t){return this.settingsStore.showCoverArtworkInAlbumLists?{caption:t.item.name,url:t.item.artwork_url}:null},open(t){const e=this.mediaKind||t.media_kind;e==="podcast"?this.$router.push({name:"podcast",params:{id:t.id}}):this.$router.push({name:`${e}-album`,params:{id:t.id}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0},playCountChanged(){this.$emit("play-count-changed")},podcastDeleted(){this.$emit("podcast-deleted")}}};function J8(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-album");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,"is-item":l.isItem,image:r.image(l),index:l.index,lines:[l.item.name,l.item.artist,t.$formatters.toDate(l.item.date_released)],onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["is-item","image","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,"media-kind":n.mediaKind,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1),onPlayCountChanged:r.playCountChanged,onPodcastDeleted:r.podcastDeleted},null,8,["item","media-kind","show","onPlayCountChanged","onPodcastDeleted"])],64)}const hs=nt(Z8,[["render",J8]]),Q8={name:"ListIndexButtons",props:{indices:{required:!0,type:Array}}},t6={class:"buttons is-centered mb-4"};function e6(t,e,n,s,i,r){const o=w("router-link");return O(),F("section",null,[P("nav",t6,[(O(!0),F(it,null,de(n.indices,a=>(O(),yt(o,{key:a,class:"button is-small p-2 is-index",to:{hash:`#index_${a}`,query:t.$route.query}},{default:M(()=>[Ys(et(a),1)]),_:2},1032,["to"]))),128))])])}const vs=nt(Q8,[["render",e6],["__scopeId","data-v-dc002763"]]),n6={name:"ListOptions"},s6={class:"columns"},i6={key:0,class:"column"},r6=["textContent"],o6={key:1,class:"column"},a6=["textContent"];function l6(t,e,n,s,i,r){return O(),F("div",s6,[t.$slots.filter?(O(),F("div",i6,[P("div",{class:"is-size-7 is-uppercase",textContent:et(t.$t("options.filter.title"))},null,8,r6),le(t.$slots,"filter")])):_t("",!0),t.$slots.sort?(O(),F("div",o6,[P("div",{class:"is-size-7 is-uppercase",textContent:et(t.$t("options.sort.title"))},null,8,a6),le(t.$slots,"sort")])):_t("",!0)])}const zo=nt(n6,[["render",l6]]),c6={name:"ControlTabList",props:{links:{required:!0,type:Array}}},u6={class:"section py-0 tabs-section"},d6={class:"container"},f6={class:"columns is-centered my-0"},h6={class:"column is-four-fifths py-0"},p6={class:"tabs is-centered is-small"},m6=["onClick","onKeypress"],g6=["textContent"];function y6(t,e,n,s,i,r){const o=w("mdicon"),a=w("router-link");return O(),F("section",u6,[P("div",d6,[P("div",f6,[P("div",h6,[P("div",p6,[P("ul",null,[(O(!0),F(it,null,de(n.links,l=>(O(),yt(a,{key:l.to.name,to:{name:l.to.name},custom:""},{default:M(({navigate:c,isActive:u})=>[P("li",{class:Gt({"is-active":u})},[P("a",{onClick:c,onKeypress:Xv(c,["enter"])},[l.icon?(O(),yt(o,{key:0,class:"icon is-small mx-1",name:l.icon},null,8,["name"])):_t("",!0),P("span",{class:Gt({"is-hidden-mobile":l.icon}),textContent:et(t.$t(l.key))},null,10,g6)],40,m6)],2)]),_:2},1032,["to"]))),128))])])])])])])}const gm=nt(c6,[["render",y6],["__scopeId","data-v-51d61991"]]),b6={name:"TabsMusic",components:{ControlTabList:gm},setup(){return{servicesStore:Qn()}},computed:{links(){const t=[{icon:"history",key:"page.music.tabs.history",to:{name:"music-history"}},{icon:"account-music",key:"page.music.tabs.artists",to:{name:"music-artists"}},{icon:"album",key:"page.music.tabs.albums",to:{name:"music-albums"}},{icon:"speaker",key:"page.music.tabs.genres",to:{name:"music-genres"}},{icon:"book-open-page-variant",key:"page.music.tabs.composers",to:{name:"music-composers"}}];return this.servicesStore.isSpotifyActive&&t.push({icon:"spotify",key:"page.music.tabs.spotify",to:{name:"music-spotify"}}),t}}};function v6(t,e,n,s,i,r){const o=w("control-tab-list");return O(),yt(o,{links:r.links},null,8,["links"])}const ti=nt(b6,[["render",v6]]),_6={name:"PageAlbums",components:{ContentWithHeading:ie,ControlDropdown:Br,ControlSwitch:Ur,ListAlbums:hs,ListIndexButtons:vs,ListOptions:zo,PaneTitle:re,TabsMusic:ti},beforeRouteEnter(t,e,n){Tt.albums("music").then(s=>{n(i=>{i.albumList=new Ct(s)})})},setup(){return{servicesStore:Qn(),uiStore:ts()}},data(){return{albumList:new Ct}},computed:{albums(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.albumsSort);return t.filters=[e=>!this.uiStore.hideSingles||e.track_count>2,e=>!this.uiStore.hideSpotify||e.data_kind!=="spotify"],this.albumList.group(t)},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{index:{field:"name_sort",type:String}}},{id:2,name:this.$t("options.sort.recently-added"),options:{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}}},{id:3,name:this.$t("options.sort.recently-released"),options:{criteria:[{field:"date_released",order:-1,type:Date}],index:{field:"date_released",type:Date}}},{id:4,name:this.$t("options.sort.artist-name"),options:{criteria:[{field:"artist",type:String},{field:"name_sort",type:String}],index:{field:"artist",type:String}}},{id:5,name:this.$t("options.sort.artist-date"),options:{criteria:[{field:"artist",type:String},{field:"date_released",type:Date}],index:{field:"artist",type:String}}}]},heading(){return{subtitle:[{count:this.albums.count,key:"data.albums"}],title:this.$t("page.albums.title")}}}},S6=["textContent"],E6=["textContent"],w6=["textContent"],k6=["textContent"];function C6(t,e,n,s,i,r){const o=w("tabs-music"),a=w("list-index-buttons"),l=w("control-switch"),c=w("control-dropdown"),u=w("list-options"),d=w("pane-title"),f=w("list-albums"),h=w("content-with-heading");return O(),F(it,null,[E(o),E(h,null,{options:M(()=>[E(a,{indices:r.albums.indices},null,8,["indices"]),E(u,null,{filter:M(()=>[E(l,{modelValue:s.uiStore.hideSingles,"onUpdate:modelValue":e[0]||(e[0]=p=>s.uiStore.hideSingles=p)},{label:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-singles"))},null,8,S6)]),help:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-singles-help"))},null,8,E6)]),_:1},8,["modelValue"]),s.servicesStore.isSpotifyActive?(O(),yt(l,{key:0,modelValue:s.uiStore.hideSpotify,"onUpdate:modelValue":e[1]||(e[1]=p=>s.uiStore.hideSpotify=p)},{label:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify"))},null,8,w6)]),help:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify-help"))},null,8,k6)]),_:1},8,["modelValue"])):_t("",!0)]),sort:M(()=>[E(c,{value:s.uiStore.albumsSort,"onUpdate:value":e[2]||(e[2]=p=>s.uiStore.albumsSort=p),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:M(()=>[E(d,{content:r.heading},null,8,["content"])]),content:M(()=>[E(f,{items:r.albums},null,8,["items"])]),_:1})],64)}const T6=nt(_6,[["render",C6]]),A6={name:"ModalDialogArtist",components:{ModalDialogPlayable:bs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item.name,properties:[{key:"property.albums",value:this.item.album_count},{key:"property.tracks",value:this.item.track_count},{key:"property.type",value:this.$t(`data.kind.${this.item.data_kind}`)},{key:"property.added-on",value:this.$formatters.toDateTime(this.item.time_added)}],uri:this.item.uri}}}};function O6(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const Ed=nt(A6,[["render",O6]]),x6={name:"PageArtist",components:{ContentWithHeading:ie,ControlButton:un,ControlDropdown:Br,ControlSwitch:Ur,ListAlbums:hs,ListOptions:zo,ModalDialogArtist:Ed,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Tt.artist(t.params.id),Tt.artistAlbums(t.params.id)]).then(([s,i])=>{n(r=>{r.artist=s,r.albumList=new Ct(i)})})},setup(){return{servicesStore:Qn(),uiStore:ts()}},data(){return{albumList:new Ct,artist:{},showDetailsModal:!1}},computed:{albums(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artistAlbumsSort);return t.filters=[e=>!this.uiStore.hideSpotify||e.data_kind!=="spotify"],this.albumList.group(t)},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{criteria:[{field:"name_sort",type:String}]}},{id:2,name:this.$t("options.sort.release-date"),options:{criteria:[{field:"date_released",type:Date}]}}]},heading(){return{subtitle:[{count:this.albums.count,key:"data.albums"},{count:this.trackCount,handler:this.openTracks,key:"data.tracks"}],title:this.artist.name}},trackCount(){return[...this.albums].reduce((t,e)=>t+(e?.item.track_count||0),0)}},methods:{openDetails(){this.showDetailsModal=!0},openTracks(){this.$router.push({name:"music-artist-tracks",params:{id:this.artist.id}})},play(){ae.playUri(this.albums.items.map(t=>t.uri).join(),!0)}}},I6=["textContent"],N6=["textContent"];function P6(t,e,n,s,i,r){const o=w("control-switch"),a=w("control-dropdown"),l=w("list-options"),c=w("pane-title"),u=w("control-button"),d=w("list-albums"),f=w("content-with-heading"),h=w("modal-dialog-artist");return O(),F(it,null,[E(f,null,{options:M(()=>[E(l,null,{filter:M(()=>[s.servicesStore.isSpotifyActive?(O(),yt(o,{key:0,modelValue:s.uiStore.hideSpotify,"onUpdate:modelValue":e[0]||(e[0]=p=>s.uiStore.hideSpotify=p)},{label:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify"))},null,8,I6)]),help:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify-help"))},null,8,N6)]),_:1},8,["modelValue"])):_t("",!0)]),sort:M(()=>[E(a,{value:s.uiStore.artistAlbumsSort,"onUpdate:value":e[1]||(e[1]=p=>s.uiStore.artistAlbumsSort=p),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:M(()=>[E(c,{content:r.heading},null,8,["content"])]),actions:M(()=>[E(u,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(u,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:M(()=>[E(d,{items:r.albums},null,8,["items"])]),_:1}),E(h,{item:i.artist,show:i.showDetailsModal,onClose:e[2]||(e[2]=p=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const R6=nt(x6,[["render",P6]]),D6={name:"ListAlbumsSpotify",components:{ListItem:$s,LoaderListItem:Sd,ModalDialogAlbumSpotify:xS},props:{items:{required:!0,type:Object},load:{default:null,type:Function}},setup(){return{settingsStore:Js()}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{image(t){return this.settingsStore.showCoverArtworkInAlbumLists?{caption:t.name,url:t.images?.[0]?.url??""}:null},open(t){this.$router.push({name:"music-spotify-album",params:{id:t.id}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function L6(t,e,n,s,i,r){const o=w("list-item"),a=w("loader-list-item"),l=w("modal-dialog-album-spotify");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,c=>(O(),yt(o,{key:c.id,"is-item":c.isItem,image:r.image(c),index:c.index,lines:[c.name,c.artists[0]?.name,t.$formatters.toDate(c.release_date)],onOpen:u=>r.open(c),onOpenDetails:u=>r.openDetails(c)},null,8,["is-item","image","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{load:n.load},null,8,["load"]),E(l,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=c=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const wd=nt(D6,[["render",L6]]),M6={name:"ModalDialogArtistSpotify",components:{ModalDialogPlayable:bs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{image:this.item.images?.[0]?.url||"",name:this.item.name,properties:[{key:"property.popularity",value:[this.item.popularity,this.item.followers?.total].join(" / ")},{key:"property.genres",value:this.item.genres?.join(", ")}],uri:this.item.uri}}}};function $6(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const IS=nt(M6,[["render",$6]]),ff=50,F6={name:"PageArtistSpotify",components:{ContentWithHeading:ie,ControlButton:un,ListAlbumsSpotify:wd,ModalDialogArtistSpotify:IS,PaneTitle:re},beforeRouteEnter(t,e,n){Nn.spotify().then(({api:s,configuration:i})=>{Promise.all([s.artists.get(t.params.id),s.artists.albums(t.params.id,"album,single",i.webapi_country,ff,0)]).then(([r,o])=>{n(a=>{a.artist=r,a.albums=o.items,a.total=o.total,a.offset=o.limit})})})},data(){return{albums:[],artist:{},offset:0,showDetailsModal:!1,total:0}},computed:{heading(){return{subtitle:[{count:this.total,key:"data.albums"}],title:this.artist.name}}},methods:{appendAlbums(t){this.albums=this.albums.concat(t.items),this.total=t.total,this.offset+=t.limit},load({loaded:t}){Nn.spotify().then(({api:e,configuration:n})=>{e.artists.albums(this.artist.id,"album,single",n.webapi_country,ff,this.offset).then(s=>{this.appendAlbums(s),t(s.items.length,ff)})})},openDetails(){this.showDetailsModal=!0},play(){this.showDetailsModal=!1,ae.playUri(this.artist.uri,!0)}}};function V6(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-albums-spotify"),c=w("content-with-heading"),u=w("modal-dialog-artist-spotify");return O(),F(it,null,[E(c,null,{heading:M(()=>[E(o,{content:r.heading},null,8,["content"])]),actions:M(()=>[E(a,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:M(()=>[E(l,{items:i.albums,load:r.load},null,8,["items","load"])]),_:1}),E(u,{item:i.artist,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const U6=nt(F6,[["render",V6]]),H6={name:"PageArtistTracks",components:{ContentWithHeading:ie,ControlButton:un,ControlDropdown:Br,ControlSwitch:Ur,ListIndexButtons:vs,ListOptions:zo,ListTracks:es,ModalDialogArtist:Ed,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Tt.artist(t.params.id),Tt.artistTracks(t.params.id)]).then(([s,i])=>{n(r=>{r.artist=s,r.trackList=new Ct(i)})})},setup(){return{servicesStore:Qn(),uiStore:ts()}},data(){return{artist:{},showDetailsModal:!1,trackList:new Ct}},computed:{albumCount(){return new Set([...this.tracks].filter(t=>t.isItem).map(t=>t.item.album_id)).size},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("options.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}]},heading(){return{subtitle:[{count:this.albumCount,handler:this.openArtist,key:"data.albums"},{count:this.tracks.count,key:"data.tracks"}],title:this.artist.name}},trackUris(){return this.trackList.items.map(t=>t.uri).join()},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artistTracksSort);return t.filters=[e=>!this.uiStore.hideSpotify||e.data_kind!=="spotify"],this.trackList.group(t)}},methods:{openArtist(){this.showDetailsModal=!1,this.$router.push({name:"music-artist",params:{id:this.artist.id}})},openDetails(){this.showDetailsModal=!0},play(){ae.playUri(this.trackList.items.map(t=>t.uri).join(),!0)}}},j6=["textContent"],B6=["textContent"];function W6(t,e,n,s,i,r){const o=w("list-index-buttons"),a=w("control-switch"),l=w("control-dropdown"),c=w("list-options"),u=w("pane-title"),d=w("control-button"),f=w("list-tracks"),h=w("content-with-heading"),p=w("modal-dialog-artist");return O(),F(it,null,[E(h,null,{options:M(()=>[E(o,{indices:r.tracks.indices},null,8,["indices"]),E(c,null,{filter:M(()=>[s.servicesStore.isSpotifyActive?(O(),yt(a,{key:0,modelValue:s.uiStore.hideSpotify,"onUpdate:modelValue":e[0]||(e[0]=m=>s.uiStore.hideSpotify=m)},{label:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify"))},null,8,j6)]),help:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify-help"))},null,8,B6)]),_:1},8,["modelValue"])):_t("",!0)]),sort:M(()=>[E(l,{value:s.uiStore.artistTracksSort,"onUpdate:value":e[1]||(e[1]=m=>s.uiStore.artistTracksSort=m),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:M(()=>[E(u,{content:r.heading},null,8,["content"])]),actions:M(()=>[E(d,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(d,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:M(()=>[E(f,{items:r.tracks,uris:r.trackUris},null,8,["items","uris"])]),_:1}),E(p,{item:i.artist,show:i.showDetailsModal,onClose:e[2]||(e[2]=m=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const G6=nt(H6,[["render",W6]]),K6={name:"ListArtists",components:{ListItem:$s,ModalDialogArtist:Ed},props:{items:{required:!0,type:Object},load:{default:null,type:Function}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{open(t){this.$router.push({name:`${t.media_kind}-artist`,params:{id:t.id}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function q6(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-artist");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,"is-item":l.isItem,index:l.index,lines:[l.item.name],onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["is-item","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const ym=nt(K6,[["render",q6]]),z6={name:"PageArtists",components:{ContentWithHeading:ie,ControlDropdown:Br,ControlSwitch:Ur,ListArtists:ym,ListIndexButtons:vs,ListOptions:zo,PaneTitle:re,TabsMusic:ti},beforeRouteEnter(t,e,n){Tt.artists("music").then(s=>{n(i=>{i.artistList=new Ct(s)})})},setup(){return{servicesStore:Qn(),uiStore:ts()}},data(){return{artistList:new Ct}},computed:{artists(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artistsSort);return t.filters=[e=>!this.uiStore.hideSingles||e.track_count>e.album_count*2,e=>!this.uiStore.hideSpotify||e.data_kind!=="spotify"],this.artistList.group(t)},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{index:{field:"name_sort",type:String}}},{id:2,name:this.$t("options.sort.recently-added"),options:{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}}}]},heading(){return{subtitle:[{count:this.artists.count,key:"data.artists"}],title:this.$t("page.artists.title")}}}},X6=["textContent"],Y6=["textContent"],Z6=["textContent"],J6=["textContent"];function Q6(t,e,n,s,i,r){const o=w("tabs-music"),a=w("list-index-buttons"),l=w("control-switch"),c=w("control-dropdown"),u=w("list-options"),d=w("pane-title"),f=w("list-artists"),h=w("content-with-heading");return O(),F(it,null,[E(o),E(h,null,{options:M(()=>[E(a,{indices:r.artists.indices},null,8,["indices"]),E(u,null,{filter:M(()=>[E(l,{modelValue:s.uiStore.hideSingles,"onUpdate:modelValue":e[0]||(e[0]=p=>s.uiStore.hideSingles=p)},{label:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-singles"))},null,8,X6)]),help:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-singles-help"))},null,8,Y6)]),_:1},8,["modelValue"]),s.servicesStore.isSpotifyActive?(O(),yt(l,{key:0,modelValue:s.uiStore.hideSpotify,"onUpdate:modelValue":e[1]||(e[1]=p=>s.uiStore.hideSpotify=p)},{label:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify"))},null,8,Z6)]),help:M(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify-help"))},null,8,J6)]),_:1},8,["modelValue"])):_t("",!0)]),sort:M(()=>[E(c,{value:s.uiStore.artistsSort,"onUpdate:value":e[2]||(e[2]=p=>s.uiStore.artistsSort=p),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:M(()=>[E(d,{content:r.heading},null,8,["content"])]),content:M(()=>[E(f,{items:r.artists},null,8,["items"])]),_:1})],64)}const tF=nt(z6,[["render",Q6]]),eF={name:"PageAudiobookAlbum",components:{ContentWithHero:bd,ControlImage:jr,ListTracks:es,ModalDialogAlbum:vd,PaneHero:_d},beforeRouteEnter(t,e,n){Promise.all([Tt.album(t.params.id),Tt.albumTracks(t.params.id)]).then(([s,i])=>{n(r=>{r.album=s,r.tracks=new Ct(i)})})},data(){return{album:{},showDetailsModal:!1,tracks:new Ct}},computed:{heading(){return{count:this.$t("data.tracks",{count:this.album.track_count}),handler:this.openArtist,subtitle:this.album.artist,title:this.album.name,actions:[{handler:this.play,icon:"play",key:"actions.play"},{handler:this.openDetails,icon:"dots-horizontal"}]}}},methods:{openArtist(){this.showDetailsModal=!1,this.$router.push({name:"audiobook-artist",params:{id:this.album.artist_id}})},openDetails(){this.showDetailsModal=!0},play(){ae.playUri(this.album.uri,!1)}}};function nF(t,e,n,s,i,r){const o=w("pane-hero"),a=w("control-image"),l=w("list-tracks"),c=w("content-with-hero"),u=w("modal-dialog-album");return O(),F(it,null,[E(c,null,{heading:M(()=>[E(o,{content:r.heading},null,8,["content"])]),image:M(()=>[E(a,{url:i.album.artwork_url,caption:i.album.name,class:"is-medium",onClick:r.openDetails},null,8,["url","caption","onClick"])]),content:M(()=>[E(l,{items:i.tracks,"show-progress":!0,uris:i.album.uri},null,8,["items","uris"])]),_:1}),E(u,{item:i.album,show:i.showDetailsModal,"media-kind":"audiobook",onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const sF=nt(eF,[["render",nF]]),iF={name:"TabsAudiobooks",components:{ControlTabList:gm},computed:{links(){return[{icon:"account-music",key:"page.audiobooks.tabs.authors",to:{name:"audiobook-artists"}},{icon:"album",key:"page.audiobooks.tabs.audiobooks",to:{name:"audiobook-albums"}},{icon:"speaker",key:"page.audiobooks.tabs.genres",to:{name:"audiobook-genres"}}]}}};function rF(t,e,n,s,i,r){const o=w("control-tab-list");return O(),yt(o,{links:r.links},null,8,["links"])}const bm=nt(iF,[["render",rF]]),oF={name:"PageAudiobookAlbums",components:{ContentWithHeading:ie,ListAlbums:hs,ListIndexButtons:vs,PaneTitle:re,TabsAudiobooks:bm},beforeRouteEnter(t,e,n){Tt.albums("audiobook").then(s=>{n(i=>{i.albums=new Ct(s,{index:{field:"name_sort",type:String}})})})},data(){return{albums:new Ct}},computed:{heading(){return{subtitle:[{count:this.albums.count,key:"data.audiobooks"}],title:this.$t("page.audiobooks.albums.title")}}}};function aF(t,e,n,s,i,r){const o=w("tabs-audiobooks"),a=w("list-index-buttons"),l=w("pane-title"),c=w("list-albums"),u=w("content-with-heading");return O(),F(it,null,[E(o),E(u,null,{options:M(()=>[E(a,{indices:i.albums.indices},null,8,["indices"])]),heading:M(()=>[E(l,{content:r.heading},null,8,["content"])]),content:M(()=>[E(c,{items:i.albums},null,8,["items"])]),_:1})],64)}const lF=nt(oF,[["render",aF]]),cF={name:"PageAudiobookArtist",components:{ContentWithHeading:ie,ControlButton:un,ListAlbums:hs,ModalDialogArtist:Ed,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Tt.artist(t.params.id),Tt.artistAlbums(t.params.id)]).then(([s,i])=>{n(r=>{r.artist=s,r.albums=new Ct(i)})})},data(){return{albums:new Ct,artist:{},showDetailsModal:!1}},computed:{heading(){return this.artist.name?{subtitle:[{count:this.artist.album_count,key:"data.audiobooks"}],title:this.artist.name}:{}}},methods:{openDetails(){this.showDetailsModal=!0},play(){ae.playUri(this.albums.items.map(t=>t.uri).join(),!1)}}};function uF(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-albums"),c=w("content-with-heading"),u=w("modal-dialog-artist");return O(),F(it,null,[E(c,null,{heading:M(()=>[E(o,{content:r.heading},null,8,["content"])]),actions:M(()=>[E(a,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"play",key:"actions.play"}},null,8,["button"])]),content:M(()=>[E(l,{items:i.albums},null,8,["items"])]),_:1}),E(u,{item:i.artist,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const dF=nt(cF,[["render",uF]]),fF={name:"PageAudiobookArtists",components:{ContentWithHeading:ie,ListArtists:ym,ListIndexButtons:vs,PaneTitle:re,TabsAudiobooks:bm},beforeRouteEnter(t,e,n){Tt.artists("audiobook").then(s=>{n(i=>{i.artists=new Ct(s,{index:{field:"name_sort",type:String}})})})},data(){return{artists:new Ct}},computed:{heading(){return{subtitle:[{count:this.artists.count,key:"data.authors"}],title:this.$t("page.audiobooks.artists.title")}}}};function hF(t,e,n,s,i,r){const o=w("tabs-audiobooks"),a=w("list-index-buttons"),l=w("pane-title"),c=w("list-artists"),u=w("content-with-heading");return O(),F(it,null,[E(o),E(u,null,{options:M(()=>[E(a,{indices:i.artists.indices},null,8,["indices"])]),heading:M(()=>[E(l,{content:r.heading},null,8,["content"])]),content:M(()=>[E(c,{items:i.artists},null,8,["items"])]),_:1})],64)}const pF=nt(fF,[["render",hF]]),mF={name:"ModalDialogGenre",components:{ModalDialogPlayable:bs},props:{item:{required:!0,type:Object},mediaKind:{required:!0,type:String},show:Boolean},emits:["close"],computed:{playable(){return{expression:`genre is "${this.item.name}" and media_kind is ${this.mediaKind}`,name:this.item.name,properties:[{key:"property.albums",value:this.item.album_count},{key:"property.tracks",value:this.item.track_count},{key:"property.duration",value:this.$formatters.toTimecode(this.item.length_ms)}]}}}};function gF(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const vm=nt(mF,[["render",gF]]),yF={name:"ListGenres",components:{ListItem:$s,ModalDialogGenre:vm},props:{items:{required:!0,type:Object},mediaKind:{required:!0,type:String}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{open(t){this.$router.push({name:"genre-albums",params:{name:t.name},query:{mediaKind:this.mediaKind}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function bF(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-genre");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,"is-item":l.isItem,index:l.index,lines:[l.item.name],onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["is-item","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,"media-kind":n.mediaKind,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1)},null,8,["item","media-kind","show"])],64)}const NS=nt(yF,[["render",bF]]),vF={name:"PageAudiobooksGenres",components:{ContentWithHeading:ie,ListGenres:NS,ListIndexButtons:vs,PaneTitle:re,TabsAudiobooks:bm},beforeRouteEnter(t,e,n){Tt.genres("audiobook").then(s=>{n(i=>{i.genres=new Ct(s,{index:{field:"name_sort",type:String}})})})},data(){return{genres:new Ct}},computed:{heading(){return{subtitle:[{count:this.genres.total,key:"data.genres"}],title:this.$t("page.genres.title")}}}};function _F(t,e,n,s,i,r){const o=w("tabs-audiobooks"),a=w("list-index-buttons"),l=w("pane-title"),c=w("list-genres"),u=w("content-with-heading");return O(),F(it,null,[E(o),E(u,null,{options:M(()=>[E(a,{indices:i.genres.indices},null,8,["indices"])]),heading:M(()=>[E(l,{content:r.heading},null,8,["content"])]),content:M(()=>[E(c,{items:i.genres,"media-kind":"audiobook"},null,8,["items"])]),_:1})],64)}const SF=nt(vF,[["render",_F]]),EF={name:"ModalDialogComposer",components:{ModalDialogPlayable:bs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{expression:`composer is "${this.item.name}" and media_kind is music`,name:this.item.name,properties:[{handler:this.openAlbums,key:"property.albums",value:this.item.album_count},{handler:this.openTracks,key:"property.tracks",value:this.item.track_count},{key:"property.duration",value:this.$formatters.toTimecode(this.item.length_ms)}]}}},methods:{openAlbums(){this.$emit("close"),this.$router.push({name:"music-composer-albums",params:{name:this.item.name}})},openTracks(){this.$emit("close"),this.$router.push({name:"music-composer-tracks",params:{name:this.item.name}})}}};function wF(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const _m=nt(EF,[["render",wF]]),kF={name:"PageComposerAlbums",components:{ContentWithHeading:ie,ControlButton:un,ListAlbums:hs,ModalDialogComposer:_m,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Tt.composer(t.params.name),Tt.composerAlbums(t.params.name)]).then(([s,i])=>{n(r=>{r.composer=s,r.albums=new Ct(i)})})},data(){return{albums:new Ct,composer:{},showDetailsModal:!1}},computed:{expression(){return`composer is "${this.composer.name}" and media_kind is music`},heading(){return this.composer.name?{subtitle:[{count:this.composer.album_count,key:"data.albums"},{count:this.composer.track_count,handler:this.openTracks,key:"data.tracks"}],title:this.composer.name}:{}}},methods:{openDetails(){this.showDetailsModal=!0},openTracks(){this.$router.push({name:"music-composer-tracks",params:{name:this.composer.name}})},play(){ae.playExpression(this.expression,!0)}}};function CF(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-albums"),c=w("content-with-heading"),u=w("modal-dialog-composer");return O(),F(it,null,[E(c,null,{heading:M(()=>[E(o,{content:r.heading},null,8,["content"])]),actions:M(()=>[E(a,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:M(()=>[E(l,{items:i.albums},null,8,["items"])]),_:1}),E(u,{item:i.composer,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const TF=nt(kF,[["render",CF]]),AF={name:"PageComposerTracks",components:{ContentWithHeading:ie,ControlButton:un,ControlDropdown:Br,ListIndexButtons:vs,ListOptions:zo,ListTracks:es,ModalDialogComposer:_m,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Tt.composer(t.params.name),Tt.composerTracks(t.params.name)]).then(([s,i])=>{n(r=>{r.composer=s,r.trackList=new Ct(i)})})},setup(){return{uiStore:ts()}},data(){return{composer:{},showDetailsModal:!1,trackList:new Ct}},computed:{expression(){return`composer is "${this.composer.name}" and media_kind is music`},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("options.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}]},heading(){return this.composer.name?{subtitle:[{count:this.composer.album_count,handler:this.openAlbums,key:"data.albums"},{count:this.composer.track_count,key:"data.tracks"}],title:this.composer.name}:{}},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.composerTracksSort);return this.trackList.group(t)}},methods:{openAlbums(){this.$router.push({name:"music-composer-albums",params:{name:this.composer.name}})},openDetails(){this.showDetailsModal=!0},play(){ae.playExpression(this.expression,!0)}}};function OF(t,e,n,s,i,r){const o=w("list-index-buttons"),a=w("control-dropdown"),l=w("list-options"),c=w("pane-title"),u=w("control-button"),d=w("list-tracks"),f=w("content-with-heading"),h=w("modal-dialog-composer");return O(),F(it,null,[E(f,null,{options:M(()=>[E(o,{indices:r.tracks.indices},null,8,["indices"]),E(l,null,{sort:M(()=>[E(a,{value:s.uiStore.composerTracksSort,"onUpdate:value":e[0]||(e[0]=p=>s.uiStore.composerTracksSort=p),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:M(()=>[E(c,{content:r.heading},null,8,["content"])]),actions:M(()=>[E(u,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(u,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:M(()=>[E(d,{items:r.tracks,expression:r.expression},null,8,["items","expression"])]),_:1}),E(h,{item:i.composer,show:i.showDetailsModal,onClose:e[1]||(e[1]=p=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const xF=nt(AF,[["render",OF]]),IF={name:"ListComposers",components:{ListItem:$s,ModalDialogComposer:_m},props:{items:{required:!0,type:Object},load:{default:null,type:Function}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{open(t){this.$router.push({name:"music-composer-albums",params:{name:t.name}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function NF(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-composer");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,"is-item":l.isItem,index:l.index,lines:[l.item.name],onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["is-item","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const PS=nt(IF,[["render",NF]]),PF={name:"PageComposers",components:{ContentWithHeading:ie,ListComposers:PS,ListIndexButtons:vs,PaneTitle:re,TabsMusic:ti},beforeRouteEnter(t,e,n){Tt.composers("music").then(s=>{n(i=>{i.composers=new Ct(s,{index:{field:"name_sort",type:String}})})})},data(){return{composers:new Ct}},computed:{heading(){return{subtitle:[{count:this.composers.total,key:"data.composers"}],title:this.$t("page.composers.title")}}}};function RF(t,e,n,s,i,r){const o=w("tabs-music"),a=w("list-index-buttons"),l=w("pane-title"),c=w("list-composers"),u=w("content-with-heading");return O(),F(it,null,[E(o),E(u,null,{options:M(()=>[E(a,{indices:i.composers.indices},null,8,["indices"])]),heading:M(()=>[E(l,{content:r.heading},null,8,["content"])]),content:M(()=>[E(c,{items:i.composers},null,8,["items"])]),_:1})],64)}const DF=nt(PF,[["render",RF]]),LF={name:"ModalDialogDirectory",components:{ModalDialogPlayable:bs},props:{item:{required:!0,type:String},show:Boolean},emits:["close"],computed:{playable(){return{expression:`path starts with "${this.item}" order by path asc`,name:this.item}}}};function MF(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const $F=nt(LF,[["render",MF]]),FF={name:"ListDirectories",components:{ListItem:$s,ModalDialogDirectory:$F},props:{items:{required:!0,type:Array}},data(){return{selectedItem:"",showDetailsModal:!1}},computed:{directories(){const t=[];let e="";return this.$route.query?.directory.split("/").slice(1,-1).forEach((n,s)=>{e=`${e}/${n}`,t.push({index:s,name:n,path:e})}),t}},methods:{open(t){const e={name:"files"};t.index!==0&&(e.query={directory:t.path}),this.$router.push(e)},openDetails(t){this.selectedItem=t.path,this.showDetailsModal=!0},openParent(){this.open(this.directories.slice(-1).pop())}}},VF={key:0,class:"media is-align-items-center mb-0"},UF={class:"media-content"},HF={class:"breadcrumb"},jF=["onClick","textContent"],BF={class:"media-right"};function WF(t,e,n,s,i,r){const o=w("mdicon"),a=w("list-item"),l=w("modal-dialog-directory");return O(),F(it,null,[t.$route.query.directory?(O(),F("div",VF,[E(o,{class:"icon media-left is-clickable",name:"chevron-left",onClick:r.openParent},null,8,["onClick"]),P("div",UF,[P("nav",HF,[P("ul",null,[(O(!0),F(it,null,de(r.directories,c=>(O(),F("li",{key:c.index},[P("a",{onClick:u=>r.open(c),textContent:et(c.name)},null,8,jF)]))),128))])])]),P("div",BF,[le(t.$slots,"actions")])])):_t("",!0),(O(!0),F(it,null,de(n.items,c=>(O(),yt(a,{key:c.path,icon:"folder",lines:[c.name],onOpen:u=>r.open(c),onOpenDetails:u=>r.openDetails(c)},null,8,["lines","onOpen","onOpenDetails"]))),128)),E(l,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=c=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const GF=nt(FF,[["render",WF]]),KF={name:"ModalDialogPlaylist",components:{ModalDialogPlayable:bs},props:{item:{required:!0,type:Object},show:Boolean,uris:{default:"",type:String}},emits:["close"],computed:{playable(){return{name:this.item.name,properties:[{key:"property.tracks",value:this.item.item_count},{key:"property.type",value:this.$t(`playlist.type.${this.item.type}`)},{key:"property.path",value:this.item.path}],uri:this.item.uri,uris:this.uris}}}};function qF(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const RS=nt(KF,[["render",qF]]),zF={name:"ListPlaylists",components:{ListItem:$s,ModalDialogPlaylist:RS},props:{items:{required:!0,type:Object},load:{default:null,type:Function}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{icon(t){return t.type==="folder"?"folder":t.type==="rss"?"rss":"music-box-multiple"},open(t){t.type==="folder"?this.$router.push({name:"playlist-folder",params:{id:t.id}}):this.$router.push({name:"playlist",params:{id:t.id}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function XF(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-playlist");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,icon:r.icon(l.item),"is-item":l.isItem,index:l.index,lines:[l.item.name],onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["icon","is-item","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const Sm=nt(zF,[["render",XF]]),YF={name:"PageFiles",components:{ContentWithHeading:ie,ControlButton:un,ListDirectories:GF,ListPlaylists:Sm,ListTracks:es,ModalDialogPlayable:bs,PaneTitle:re},beforeRouteEnter(t,e,n){n(async s=>{await s.fetchData(t)})},beforeRouteUpdate(t,e,n){this.fetchData(t).then(()=>n())},setup(){return{configurationStore:Ho()}},data(){return{directories:[],playlists:new Ct,showDetailsModal:!1,tracks:new Ct}},computed:{current(){return this.$route.query?.directory||"/"},name(){return this.current!=="/"?this.current?.slice(this.current.lastIndexOf("/")+1):this.$t("page.files.title")},playable(){return{expression:`path starts with "${this.current}" order by path asc`,name:this.current,properties:[{key:"property.folders",value:this.directories.length},{key:"property.playlists",value:this.playlists.total},{key:"property.tracks",value:this.tracks.total}]}}},methods:{async fetchData(t){if(t.query.directory){const e=await Tt.files(t.query.directory);e&&(this.directories=e.directories.map(n=>this.transform(n.path)),this.playlists=new Ct(e.playlists),this.tracks=new Ct(e.tracks))}else this.directories=this.configurationStore.directories.map(e=>this.transform(e)),this.playlists=new Ct,this.tracks=new Ct},openDetails(){this.showDetailsModal=!0},play(){ae.playExpression(this.expression,!1)},transform(t){return{name:t.slice(t.lastIndexOf("/")+1),path:t}}}};function ZF(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-directories"),c=w("list-playlists"),u=w("list-tracks"),d=w("content-with-heading"),f=w("modal-dialog-playable");return O(),F(it,null,[E(d,null,{heading:M(()=>[E(o,{content:{title:r.name}},null,8,["content"])]),actions:M(()=>[E(a,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"play",key:"actions.play"}},null,8,["button"])]),content:M(()=>[E(l,{items:i.directories},null,8,["items"]),E(c,{items:i.playlists},null,8,["items"]),E(u,{items:i.tracks,icon:"file-music-outline"},null,8,["items"])]),_:1}),E(f,{item:r.playable,show:i.showDetailsModal,onClose:e[0]||(e[0]=h=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const JF=nt(YF,[["render",ZF]]),QF={name:"PageGenreAlbums",components:{ContentWithHeading:ie,ControlButton:un,ListAlbums:hs,ListIndexButtons:vs,ModalDialogGenre:vm,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Tt.genre(t.params.name,t.query.mediaKind),Tt.genreAlbums(t.params.name,t.query.mediaKind)]).then(([s,i])=>{n(r=>{r.genre=s.items.shift(),r.albums=new Ct(i,{index:{field:"name_sort",type:String}})})})},data(){return{albums:new Ct,genre:{},mediaKind:this.$route.query.mediaKind,showDetailsModal:!1}},computed:{heading(){return this.genre.name?{subtitle:[{count:this.genre.album_count,key:"data.albums"},{count:this.genre.track_count,handler:this.openTracks,key:"data.tracks"}],title:this.genre.name}:{}}},methods:{openDetails(){this.showDetailsModal=!0},openTracks(){this.showDetailsModal=!1,this.$router.push({name:"genre-tracks",params:{name:this.genre.name},query:{mediaKind:this.mediaKind}})},play(){ae.playExpression(`genre is "${this.genre.name}" and media_kind is ${this.mediaKind}`,!0)}}};function tV(t,e,n,s,i,r){const o=w("list-index-buttons"),a=w("pane-title"),l=w("control-button"),c=w("list-albums"),u=w("content-with-heading"),d=w("modal-dialog-genre");return O(),F(it,null,[E(u,null,{options:M(()=>[E(o,{indices:i.albums.indices},null,8,["indices"])]),heading:M(()=>[E(a,{content:r.heading},null,8,["content"])]),actions:M(()=>[E(l,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(l,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:M(()=>[E(c,{items:i.albums},null,8,["items"])]),_:1}),E(d,{item:i.genre,"media-kind":i.mediaKind,show:i.showDetailsModal,onClose:e[0]||(e[0]=f=>i.showDetailsModal=!1)},null,8,["item","media-kind","show"])],64)}const eV=nt(QF,[["render",tV]]),nV={name:"PageGenreTracks",components:{ContentWithHeading:ie,ControlButton:un,ControlDropdown:Br,ListIndexButtons:vs,ListOptions:zo,ListTracks:es,ModalDialogGenre:vm,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Tt.genre(t.params.name,t.query.mediaKind),Tt.genreTracks(t.params.name,t.query.mediaKind)]).then(([s,i])=>{n(r=>{r.genre=s.items.shift(),r.trackList=new Ct(i)})})},setup(){return{uiStore:ts()}},data(){return{genre:{},mediaKind:this.$route.query.mediaKind,showDetailsModal:!1,trackList:new Ct}},computed:{expression(){return`genre is "${this.genre.name}" and media_kind is ${this.mediaKind}`},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("options.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}]},heading(){return this.genre.name?{subtitle:[{count:this.genre.album_count,handler:this.openGenre,key:"data.albums"},{count:this.genre.track_count,key:"data.tracks"}],title:this.genre.name}:{}},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.genreTracksSort);return this.trackList.group(t)}},methods:{openDetails(){this.showDetailsModal=!0},openGenre(){this.showDetailsModal=!1,this.$router.push({name:"genre-albums",params:{name:this.genre.name},query:{mediaKind:this.mediaKind}})},play(){ae.playExpression(this.expression,!0)}}};function sV(t,e,n,s,i,r){const o=w("list-index-buttons"),a=w("control-dropdown"),l=w("list-options"),c=w("pane-title"),u=w("control-button"),d=w("list-tracks"),f=w("content-with-heading"),h=w("modal-dialog-genre");return O(),F(it,null,[E(f,null,{options:M(()=>[E(o,{indices:r.tracks.indices},null,8,["indices"]),E(l,null,{sort:M(()=>[E(a,{value:s.uiStore.genreTracksSort,"onUpdate:value":e[0]||(e[0]=p=>s.uiStore.genreTracksSort=p),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:M(()=>[E(c,{content:r.heading},null,8,["content"])]),actions:M(()=>[E(u,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(u,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:M(()=>[E(d,{items:r.tracks,expression:r.expression},null,8,["items","expression"])]),_:1}),E(h,{item:i.genre,"media-kind":i.mediaKind,show:i.showDetailsModal,onClose:e[1]||(e[1]=p=>i.showDetailsModal=!1)},null,8,["item","media-kind","show"])],64)}const iV=nt(nV,[["render",sV]]),rV={name:"PageGenres",components:{ContentWithHeading:ie,ListGenres:NS,ListIndexButtons:vs,PaneTitle:re,TabsMusic:ti},beforeRouteEnter(t,e,n){Tt.genres("music").then(s=>{n(i=>{i.genres=new Ct(s,{index:{field:"name_sort",type:String}})})})},data(){return{genres:new Ct}},computed:{heading(){return{subtitle:[{count:this.genres.total,key:"data.genres"}],title:this.$t("page.genres.title")}}}};function oV(t,e,n,s,i,r){const o=w("tabs-music"),a=w("list-index-buttons"),l=w("pane-title"),c=w("list-genres"),u=w("content-with-heading");return O(),F(it,null,[E(o),E(u,null,{options:M(()=>[E(a,{indices:i.genres.indices},null,8,["indices"])]),heading:M(()=>[E(l,{content:r.heading},null,8,["content"])]),content:M(()=>[E(c,{items:i.genres,"media-kind":"music"},null,8,["items"])]),_:1})],64)}const aV=nt(rV,[["render",oV]]),lV={name:"PageMusic",components:{ContentWithHeading:ie,ListAlbums:hs,ListTracks:es,PaneTitle:re,TabsMusic:ti},beforeRouteEnter(t,e,n){Promise.all([Tt.search({expression:"time_added after 8 weeks ago and media_kind is music having track_count > 3 order by time_added desc",limit:3,type:"album"}),Tt.search({expression:"time_played after 8 weeks ago and media_kind is music order by time_played desc",limit:3,type:"track"})]).then(([{albums:s},{tracks:i}])=>{n(r=>{r.albums=new Ct(s),r.tracks=new Ct(i)})})},data(){return{albums:[],tracks:null}}};function cV(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-albums"),c=w("router-link"),u=w("content-with-heading"),d=w("list-tracks");return O(),F(it,null,[E(o),E(u,null,{heading:M(()=>[E(a,{content:{title:t.$t("page.music.recently-added.title")}},null,8,["content"])]),content:M(()=>[E(l,{items:i.albums},null,8,["items"])]),footer:M(()=>[E(c,{class:"button is-small is-rounded",to:{name:"music-recently-added"}},{default:M(()=>[Ys(et(t.$t("actions.show-more")),1)]),_:1})]),_:1}),E(u,null,{heading:M(()=>[E(a,{content:{title:t.$t("page.music.recently-played.title")}},null,8,["content"])]),content:M(()=>[E(d,{items:i.tracks},null,8,["items"])]),footer:M(()=>[E(c,{class:"button is-small is-rounded",to:{name:"music-recently-played"}},{default:M(()=>[Ys(et(t.$t("actions.show-more")),1)]),_:1})]),_:1})],64)}const uV=nt(lV,[["render",cV]]),dV={name:"PageMusicRecentlyAdded",components:{ContentWithHeading:ie,ListAlbums:hs,PaneTitle:re,TabsMusic:ti},beforeRouteEnter(t,e,n){const s=Js().recentlyAddedLimit;Tt.search({expression:"media_kind is music having track_count > 3 order by time_added desc",limit:s,type:"album"}).then(i=>{n(r=>{r.albums=new Ct(i.albums,{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}})})})},setup(){return{settingsStore:Js()}},data(){return{albums:new Ct}}};function fV(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-albums"),c=w("content-with-heading");return O(),F(it,null,[E(o),E(c,null,{heading:M(()=>[E(a,{content:{title:t.$t("page.music.recently-added.title")}},null,8,["content"])]),content:M(()=>[E(l,{items:i.albums},null,8,["items"])]),_:1})],64)}const hV=nt(dV,[["render",fV]]),pV={name:"PageMusicRecentlyPlayed",components:{ContentWithHeading:ie,ListTracks:es,PaneTitle:re,TabsMusic:ti},beforeRouteEnter(t,e,n){Tt.search({expression:"time_played after 8 weeks ago and media_kind is music order by time_played desc",limit:50,type:"track"}).then(s=>{n(i=>{i.tracks=new Ct(s.tracks)})})},data(){return{tracks:new Ct}}};function mV(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-tracks"),c=w("content-with-heading");return O(),F(it,null,[E(o),E(c,null,{heading:M(()=>[E(a,{content:{title:t.$t("page.music.recently-played.title")}},null,8,["content"])]),content:M(()=>[E(l,{items:i.tracks},null,8,["items"])]),_:1})],64)}const gV=nt(pV,[["render",mV]]),yV={name:"ModalDialogPlaylistSpotify",components:{ModalDialogPlayable:bs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{image:this.item.images?.[0]?.url||"",name:this.item.name,properties:[{key:"property.owner",value:this.item.owner?.display_name},{key:"property.tracks",value:this.item.tracks?.total},{key:"property.path",value:this.item.uri}],uri:this.item.uri}}}};function bV(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const DS=nt(yV,[["render",bV]]),vV={name:"ListPlaylistsSpotify",components:{ListItem:$s,LoaderListItem:Sd,ModalDialogPlaylistSpotify:DS},props:{items:{required:!0,type:Object},load:{default:null,type:Function}},setup(){return{settingsStore:Js()}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{image(t){return this.settingsStore.showCoverArtworkInAlbumLists?{caption:t.name,url:t.images?.[0]?.url}:null},open(t){this.$router.push({name:"playlist-spotify",params:{id:t.id}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function _V(t,e,n,s,i,r){const o=w("list-item"),a=w("loader-list-item"),l=w("modal-dialog-playlist-spotify");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,c=>(O(),yt(o,{key:c.id,"is-item":c.isItem,image:r.image(c),index:c.index,lines:[c.name,c.owner.display_name],onOpen:u=>r.open(c),onOpenDetails:u=>r.openDetails(c)},null,8,["is-item","image","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{load:n.load},null,8,["load"]),E(l,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=c=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const Em=nt(vV,[["render",_V]]),SV={name:"PageMusicSpotify",components:{ContentWithHeading:ie,ListAlbumsSpotify:wd,ListPlaylistsSpotify:Em,PaneTitle:re,TabsMusic:ti},beforeRouteEnter(t,e,n){Nn.spotify().then(({api:s,configuration:i})=>{Promise.all([s.browse.getNewReleases(i.webapi_country,3),s.browse.getFeaturedPlaylists(i.webapi_country,null,null,3)]).then(r=>{n(o=>{o.albums=r[0].albums.items,o.playlists=r[1].playlists.items})})})},data(){return{albums:[],playlists:[]}}};function EV(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-albums-spotify"),c=w("router-link"),u=w("content-with-heading"),d=w("list-playlists-spotify");return O(),F(it,null,[E(o),E(u,null,{heading:M(()=>[E(a,{content:{title:t.$t("page.spotify.music.new-releases")}},null,8,["content"])]),content:M(()=>[E(l,{items:i.albums},null,8,["items"])]),footer:M(()=>[E(c,{to:{name:"music-spotify-new-releases"},class:"button is-small is-rounded"},{default:M(()=>[Ys(et(t.$t("actions.show-more")),1)]),_:1})]),_:1}),E(u,null,{heading:M(()=>[E(a,{content:{title:t.$t("page.spotify.music.featured-playlists")}},null,8,["content"])]),content:M(()=>[E(d,{items:i.playlists},null,8,["items"])]),footer:M(()=>[E(c,{to:{name:"music-spotify-featured-playlists"},class:"button is-small is-rounded"},{default:M(()=>[Ys(et(t.$t("actions.show-more")),1)]),_:1})]),_:1})],64)}const wV=nt(SV,[["render",EV]]),kV={name:"PageMusicSpotifyFeaturedPlaylists",components:{ContentWithHeading:ie,ListPlaylistsSpotify:Em,PaneTitle:re,TabsMusic:ti},beforeRouteEnter(t,e,n){Nn.spotify().then(({api:s,configuration:i})=>{s.browse.getFeaturedPlaylists(i.webapi_country,null,null,50).then(r=>{n(o=>{o.playlists=r.playlists.items})})})},data(){return{playlists:[]}},computed:{heading(){return{title:this.$t("page.spotify.music.featured-playlists")}}}};function CV(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-playlists-spotify"),c=w("content-with-heading");return O(),F(it,null,[E(o),E(c,null,{heading:M(()=>[E(a,{content:r.heading},null,8,["content"])]),content:M(()=>[E(l,{items:i.playlists},null,8,["items"])]),_:1})],64)}const TV=nt(kV,[["render",CV]]),AV={name:"PageMusicSpotifyNewReleases",components:{ContentWithHeading:ie,ListAlbumsSpotify:wd,PaneTitle:re,TabsMusic:ti},beforeRouteEnter(t,e,n){Nn.spotify().then(({api:s,configuration:i})=>{s.browse.getNewReleases(i.webapi_country,50).then(r=>{n(o=>{o.albums=r.albums.items})})})},data(){return{albums:[]}},computed:{heading(){return{title:this.$t("page.spotify.music.new-releases")}}}};function OV(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-albums-spotify"),c=w("content-with-heading");return O(),F(it,null,[E(o),E(c,null,{heading:M(()=>[E(a,{content:r.heading},null,8,["content"])]),content:M(()=>[E(l,{items:i.albums},null,8,["items"])]),_:1})],64)}const xV=nt(AV,[["render",OV]]),IV={name:"ModalDialogQueueItem",components:{ListProperties:OS,ModalDialog:rr},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],setup(){return{servicesStore:Qn()}},data(){return{spotifyTrack:{}}},computed:{actions(){return[{handler:this.remove,icon:"delete",key:"actions.remove"},{handler:this.play,icon:"play",key:"actions.play"}]},playable(){return{name:this.item.title,properties:[{handler:this.openAlbum,key:"property.album",value:this.item.album},{handler:this.openArtist,key:"property.album-artist",value:this.item.album_artist},{key:"property.composer",value:this.item.composer},{key:"property.year",value:this.item.year},{handler:this.openGenre,key:"property.genre",value:this.item.genre},{key:"property.position",value:this.item.track_number>0&&[this.item.disc_number,this.item.track_number].join(" / ")},{key:"property.duration",value:this.$formatters.toTimecode(this.item.length_ms)},{key:"property.path",value:this.item.path},{key:"property.type",value:`${this.$t(`media.kind.${this.item.media_kind}`)} - ${this.$t(`data.kind.${this.item.data_kind}`)}`},{key:"property.quality",value:this.item.data_kind!=="spotify"&&this.$t("dialog.track.quality",{bitrate:this.item.bitrate,count:this.item.channels,format:this.item.type,samplerate:this.item.samplerate})}],uri:this.item.uri}}},watch:{item(){return this.item?.data_kind==="spotify"?Nn.spotify().then(({api:t})=>{const e=this.item.path.slice(this.item.path.lastIndexOf(":")+1);return t.tracks.get(e).then(n=>{this.spotifyTrack=n})}):(this.spotifyTrack={},{})}},methods:{openAlbum(){this.$emit("close"),this.item.data_kind==="spotify"?this.$router.push({name:"music-spotify-album",params:{id:this.spotifyTrack.album.id}}):this.item.media_kind==="podcast"?this.$router.push({name:"podcast",params:{id:this.item.album_id}}):this.$router.push({name:`${this.item.media_kind}-album`,params:{id:this.item.album_id}})},openArtist(){this.$emit("close"),this.item.data_kind==="spotify"?this.$router.push({name:"music-spotify-artist",params:{id:this.spotifyTrack.artists[0].id}}):this.item.media_kind==="music"||this.item.media_kind==="podcast"?this.$router.push({name:"music-artist",params:{id:this.item.album_artist_id}}):this.item.media_kind==="audiobook"&&this.$router.push({name:"audiobook-artist",params:{id:this.item.album_artist_id}})},openGenre(){this.$emit("close"),this.$router.push({name:"genre-albums",params:{name:this.item.genre},query:{mediaKind:this.item.media_kind}})},play(){this.$emit("close"),en.play({item_id:this.item.id})},remove(){this.$emit("close"),ae.remove(this.item.id)}}};function NV(t,e,n,s,i,r){const o=w("list-properties"),a=w("modal-dialog");return O(),yt(a,{actions:r.actions,show:n.show,title:n.item.title,onClose:e[0]||(e[0]=l=>t.$emit("close"))},{content:M(()=>[E(o,{item:r.playable},null,8,["item"])]),_:1},8,["actions","show","title"])}const LS=nt(IV,[["render",NV]]),PV={name:"PaneLyrics",setup(){return{MIDDLE_POSITION:Math.floor(3.5),VISIBLE_VERSES:7,playerStore:Wn()}},data(){return{lastUpdateTime:0,lyrics:{synchronised:!1,verses:[]},time:0,timerId:null}},computed:{verseIndex(t,e){let n=0,s=e.length-1;for(;n<=s;){const i=Math.floor((n+s)/2),r=e[i].time,o=e[i+1]?.time;if(r<=t&&(!o||o>t))return i;rt[n+r]??{text:" "})}},watch:{"playerStore.isPlaying"(t){t?(this.lastUpdateTime=Date.now(),this.startTimer()):this.stopTimer()},"playerStore.item_progress_ms"(t){this.lastUpdateTime=Date.now(),this.playerStore.isPlaying||(this.time=t)},"playerStore.lyricsContent"(){this.lyrics=this.parseLyrics()}},mounted(){this.playerStore.initialise(),this.lastUpdateTime=Date.now(),this.lyrics=this.parseLyrics(),this.updateTime()},beforeUnmount(){this.stopTimer()},methods:{isVerseHighlighted(t){return t===this.MIDDLE_POSITION&&this.lyrics.synchronised},isWordHighlighted(t){return this.time>=t.start&&this.time\d+):(?\d+)(?:\.(?\d+))?\])?\s*(?\S.*\S)?\s*/u;return this.playerStore.lyricsContent.split(` `).forEach(n=>{const s=e.exec(n);if(s){const{text:i,minutes:r,seconds:o,hundredths:a}=s.groups,l=i;if(l){const c=(Number(r)*60+ +`${o}.${a??0}`)*1e3;t.synchronised=!isNaN(c),t.verses.push({text:l,time:c})}}}),t.verses.forEach((n,s,i)=>{const o=(i[s+1]?.time??n.time+3e3)-n.time,a=n.text.match(/\S+\s*/gu)||[],l=a.reduce((u,d)=>u+d.length,0);let c=n.time;n.words=a.map(u=>{const d=c,f=d+o*(u.length/l);return c=f,{end:f,start:d,text:u}})}),t},startTimer(){this.timerId||(this.timerId=setInterval(this.tick,100))},stopTimer(){this.timerId&&(clearInterval(this.timerId),this.timerId=null)},tick(){this.time=this.playerStore.item_progress_ms+Date.now()-this.lastUpdateTime},updateTime(){this.lastUpdateTime=Date.now(),this.playerStore.isPlaying?this.startTimer():this.time=this.playerStore.item_progress_ms}}},RV={key:0,class:"title is-5 my-5"},DV=["textContent"],LV=["textContent"];function MV(t,e,n,s,i,r){return O(),F("div",{class:Gt(["is-overlay",{"is-synchronised":i.lyrics.synchronised,"is-unsynchronised":!i.lyrics.synchronised}])},[(O(!0),F(it,null,de(r.visibleVerses,(o,a)=>(O(),F(it,{key:a},[r.isVerseHighlighted(a)?(O(),F("div",RV,[(O(!0),F(it,null,de(o.words,(l,c)=>(O(),F("span",{key:c,class:Gt({"is-highlighted":r.isWordHighlighted(l)}),textContent:et(l.text)},null,10,DV))),128))])):(O(),F("div",{key:1,class:"verse",textContent:et(o.text)},null,8,LV))],64))),128))],2)}const $V=nt(PV,[["render",MV],["__scopeId","data-v-8384b260"]]),Li=1e3,FV={name:"PagePlayer",components:{ControlImage:jr,ControlSlider:Ku,ModalDialogQueueItem:LS,PaneLyrics:$V},setup(){return{playerStore:Wn(),queueStore:Ms(),settingsStore:Js()}},data(){return{INTERVAL:Li,intervalId:0,isDragged:!1,selectedItem:{},showDetailsModal:!1}},computed:{composer(){if(this.settingsStore.showComposerNowPlaying){const t=this.settingsStore.showComposerForGenre;if(!t||this.track.genre&&t.toLowerCase().split(",").findIndex(e=>this.track.genre.toLowerCase().indexOf(e.trim())>=0)>=0)return this.track.composer}return null},isLive(){return this.track.length_ms===0},track(){return this.queueStore.current},trackElapsedTime(){return this.$formatters.toTimecode(this.trackProgress*Li)},trackProgress:{get(){return Math.floor(this.playerStore.item_progress_ms/Li)},set(t){this.playerStore.item_progress_ms=t*Li}},trackProgressMax(){return Number(this.isLive)||Math.floor(this.track.length_ms/Li)},trackTotalTime(){return this.$t("page.player.time",this.track.length_ms,{named:{time:this.$formatters.toTimecode(this.track.length_ms)}})}},watch:{"playerStore.state"(t){this.intervalId>0&&(window.clearTimeout(this.intervalId),this.intervalId=0),t==="play"&&(this.intervalId=window.setInterval(this.tick,Li))}},created(){this.playerStore.state==="play"&&(this.intervalId=window.setInterval(this.tick,Li))},unmounted(){this.intervalId>0&&(window.clearTimeout(this.intervalId),this.intervalId=0)},methods:{endDragging(){this.isDragged=!1},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0},seek(){this.isLive||en.seekToPosition(this.trackProgress*Li)},startDragging(){this.isDragged=!0},tick(){this.isDragged||(this.trackProgress+=1)}}},VV={class:"is-flex is-align-items-center has-text-centered px-5 is-full-height"},UV={key:0,class:"mx-auto",style:{"max-width":"32rem"}},HV={class:"is-relative"},jV={class:"is-flex is-justify-content-space-between"},BV=["textContent"],WV=["textContent"],GV=["textContent"],KV=["textContent"],qV=["textContent"],zV=["textContent"],XV=["textContent"],YV={key:1,class:"mx-auto"},ZV=["textContent"],JV=["textContent"];function QV(t,e,n,s,i,r){const o=w("control-image"),a=w("pane-lyrics"),l=w("control-slider"),c=w("modal-dialog-queue-item");return O(),F(it,null,[P("div",VV,[s.queueStore.isEmpty?(O(),F("div",YV,[P("p",{class:"title is-5",textContent:et(t.$t("page.player.title"))},null,8,ZV),P("p",{class:"subtitle",textContent:et(t.$t("page.player.info"))},null,8,JV)])):(O(),F("div",UV,[P("div",HV,[E(o,{url:r.track.artwork_url,caption:r.track.album,class:Gt(["is-big",{"is-masked":s.playerStore.showLyrics}]),onClick:e[0]||(e[0]=u=>r.openDetails(r.track))},null,8,["url","caption","class"]),s.playerStore.showLyrics?(O(),yt(a,{key:0})):_t("",!0)]),E(l,{value:r.trackProgress,"onUpdate:value":e[1]||(e[1]=u=>r.trackProgress=u),class:"mt-5",disabled:r.isLive,max:r.trackProgressMax,onChange:r.seek,onMousedown:r.startDragging,onMouseup:r.endDragging},null,8,["value","disabled","max","onChange","onMousedown","onMouseup"]),P("div",jV,[P("p",{class:"subtitle is-7",textContent:et(r.trackElapsedTime)},null,8,BV),P("p",{class:"subtitle is-7",textContent:et(r.trackTotalTime)},null,8,WV)]),P("p",{class:"title is-5",textContent:et(r.track.title)},null,8,GV),P("p",{class:"title is-6",textContent:et(r.track.artist)},null,8,KV),r.composer?(O(),F("p",{key:0,class:"subtitle is-6 has-text-grey has-text-weight-bold",textContent:et(r.composer)},null,8,qV)):_t("",!0),r.track.album?(O(),F("p",{key:1,class:"subtitle is-6",textContent:et(r.track.album)},null,8,zV)):_t("",!0),s.settingsStore.showFilepathNowPlaying?(O(),F("p",{key:2,class:"subtitle is-6 has-text-grey",textContent:et(r.track.path)},null,8,XV)):_t("",!0)]))]),E(c,{show:i.showDetailsModal,item:i.selectedItem,onClose:e[2]||(e[2]=u=>i.showDetailsModal=!1)},null,8,["show","item"])],64)}const t9=nt(FV,[["render",QV],["__scopeId","data-v-e277cccd"]]),e9={name:"PagePlaylistFolder",components:{ContentWithHeading:ie,ListPlaylists:Sm,PaneTitle:re},beforeRouteEnter(t,e,n){n(async s=>{await s.fetchData(t.params.id)})},beforeRouteUpdate(t,e,n){this.fetchData(t.params.id).then(()=>n())},setup(){return{configurationStore:Ho()}},data(){return{playlist:{},playlistList:new Ct}},computed:{heading(){return{subtitle:[{count:this.playlists.count,key:"data.playlists"}],title:this.$t("page.playlists.title",this.playlists.count,{name:this.playlist.name})}},playlists(){return this.playlistList.group({filters:[t=>t.folder||this.configurationStore.radio_playlists||t.stream_count===0||t.item_count>t.stream_count]})}},methods:{async fetchData(t){const[e,n]=await Promise.all([Tt.playlist(t),Tt.playlistFolder(t)]);this.playlist=e,this.playlistList=new Ct(n)}}};function n9(t,e,n,s,i,r){const o=w("pane-title"),a=w("list-playlists"),l=w("content-with-heading");return O(),yt(l,null,{heading:M(()=>[E(o,{content:r.heading},null,8,["content"])]),content:M(()=>[E(a,{items:r.playlists},null,8,["items"])]),_:1})}const s9=nt(e9,[["render",n9]]),i9={name:"PagePlaylistTracks",components:{ContentWithHeading:ie,ControlButton:un,ListTracks:es,ModalDialogPlaylist:RS,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Tt.playlist(t.params.id),Tt.playlistTracks(t.params.id)]).then(([s,i])=>{n(r=>{r.playlist=s,r.tracks=new Ct(i)})})},data(){return{playlist:{},showDetailsModal:!1,tracks:new Ct}},computed:{heading(){return{subtitle:[{count:this.tracks.count,key:"data.tracks"}],title:this.playlist.name}},uris(){return this.playlist.random?this.tracks.map(t=>t.uri).join():this.playlist.uri}},methods:{play(){ae.playUri(this.uris,!0)},openDetails(){this.showDetailsModal=!0}}};function r9(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-tracks"),c=w("content-with-heading"),u=w("modal-dialog-playlist");return O(),F(it,null,[E(c,null,{heading:M(()=>[E(o,{content:r.heading},null,8,["content"])]),actions:M(()=>[E(a,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"},disabled:i.tracks.count===0},null,8,["button","disabled"])]),content:M(()=>[E(l,{items:i.tracks,uris:r.uris},null,8,["items","uris"])]),_:1}),E(u,{item:i.playlist,show:i.showDetailsModal,uris:r.uris,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show","uris"])],64)}const o9=nt(i9,[["render",r9]]),hf=50,a9={name:"PagePlaylistTracksSpotify",components:{ContentWithHeading:ie,ControlButton:un,ListTracksSpotify:mm,ModalDialogPlaylistSpotify:DS,PaneTitle:re},beforeRouteEnter(t,e,n){Nn.spotify().then(({api:s,configuration:i})=>{Promise.all([s.playlists.getPlaylist(t.params.id),s.playlists.getPlaylistItems(t.params.id,i.webapi_country,null,hf,0)]).then(([r,o])=>{n(a=>{a.playlist=r,a.tracks=[],a.total=0,a.offset=0,a.appendTracks(o)})})})},data(){return{offset:0,playlist:{tracks:{}},showDetailsModal:!1,total:0,tracks:[]}},computed:{heading(){return this.playlist.name?{subtitle:[{count:this.playlist.tracks.total,key:"data.tracks"}],title:this.playlist.name}:{}}},methods:{appendTracks(t){let e=Math.max(-1,...this.tracks.map(n=>n.position).filter(n=>n));t.items.forEach(n=>{const{track:s}=n;s&&(s.is_playable&&(e+=1,s.position=e),this.tracks.push(s))}),this.total=t.total,this.offset+=t.limit},load({loaded:t}){Nn.spotify().then(({api:e,configuration:n})=>{e.playlists.getPlaylistItems(this.playlist.id,n.webapi_country,null,hf,this.offset).then(s=>{this.appendTracks(s),t(s.items.length,hf)})})},play(){this.showDetailsModal=!1,ae.playUri(this.playlist.uri,!0)},openDetails(){this.showDetailsModal=!0}}};function l9(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-tracks-spotify"),c=w("content-with-heading"),u=w("modal-dialog-playlist-spotify");return O(),F(it,null,[E(c,null,{heading:M(()=>[E(o,{content:r.heading},null,8,["content"])]),actions:M(()=>[E(a,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"},disabled:i.playlist.tracks.total===0},null,8,["button","disabled"])]),content:M(()=>[E(l,{"context-uri":i.playlist.uri,items:i.tracks,load:r.load},null,8,["context-uri","items","load"])]),_:1}),E(u,{item:i.playlist,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const c9=nt(a9,[["render",l9]]),u9={name:"PagePodcast",components:{ContentWithHero:bd,ControlImage:jr,ListTracks:es,ModalDialogAlbum:vd,PaneHero:_d},beforeRouteEnter(t,e,n){Promise.all([Tt.album(t.params.id),Tt.podcastEpisodes(t.params.id)]).then(([s,i])=>{n(r=>{r.album=s,r.tracks=new Ct(i)})})},data(){return{album:{},showDetailsModal:!1,tracks:new Ct}},computed:{heading(){return{count:this.$t("data.tracks",{count:this.album.track_count}),subtitle:"",title:this.album.name,actions:[{handler:this.play,icon:"play",key:"actions.play"},{handler:this.openDetails,icon:"dots-horizontal"}]}}},methods:{openDetails(){this.showDetailsModal=!0},play(){ae.playUri(this.album.uri,!1)},podcastDeleted(){this.$router.push({name:"podcasts"})},reloadTracks(){Tt.podcastEpisodes(this.album.id).then(t=>{this.tracks=new Ct(t)})}}};function d9(t,e,n,s,i,r){const o=w("pane-hero"),a=w("control-image"),l=w("list-tracks"),c=w("modal-dialog-album"),u=w("content-with-hero");return O(),yt(u,null,{heading:M(()=>[E(o,{content:r.heading},null,8,["content"])]),image:M(()=>[E(a,{url:i.album.artwork_url,caption:i.album.name,class:"is-medium",onClick:r.openDetails},null,8,["url","caption","onClick"])]),content:M(()=>[E(l,{items:i.tracks,"show-progress":!0,onPlayCountChanged:r.reloadTracks},null,8,["items","onPlayCountChanged"]),E(c,{item:i.album,show:i.showDetailsModal,"media-kind":"podcast",onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1),onPlayCountChanged:r.reloadTracks,onPodcastDeleted:r.podcastDeleted},null,8,["item","show","onPlayCountChanged","onPodcastDeleted"])]),_:1})}const f9=nt(u9,[["render",d9]]),h9={name:"ControlUrlField",props:{help:{default:"",type:String},icon:{required:!0,type:String},loading:{default:!1,type:Boolean},placeholder:{required:!0,type:String}},emits:["input"],data(){return{value:""}},mounted(){setTimeout(()=>{this.$refs.input.focus()},10)},methods:{validate(t){const{validity:e}=t.target,n=e.patternMismatch||e.valueMissing;this.$emit("input",this.value,n)}}},p9={class:"field"},m9={class:"control has-icons-left"},g9=["placeholder","disabled"],y9=["textContent"];function b9(t,e,n,s,i,r){const o=w("mdicon");return O(),F("div",p9,[P("div",m9,[ms(P("input",{ref:"input","onUpdate:modelValue":e[0]||(e[0]=a=>i.value=a),class:"input",type:"url",pattern:"http[s]?://.+",required:"",placeholder:n.placeholder,disabled:n.loading,onInput:e[1]||(e[1]=(...a)=>r.validate&&r.validate(...a))},null,40,g9),[[Zs,i.value]]),E(o,{class:"icon is-left",name:n.icon,size:"16"},null,8,["name"])]),n.help?(O(),F("div",{key:0,class:"help",textContent:et(n.help)},null,8,y9)):_t("",!0)])}const MS=nt(h9,[["render",b9]]),v9={name:"ModalDialogAddRss",components:{ControlUrlField:MS,ModalDialog:rr},props:{show:Boolean},emits:["close","podcast-added"],data(){return{disabled:!0,loading:!1,url:""}},computed:{actions(){return this.loading?[{icon:"web",key:"dialog.add.rss.processing"}]:[{handler:this.cancel,icon:"cancel",key:"actions.cancel"},{disabled:this.disabled,handler:this.add,icon:"playlist-plus",key:"actions.add"}]}},methods:{add(){this.loading=!0,Tt.add(this.url).then(()=>{this.$emit("podcast-added"),this.$emit("close")}).finally(()=>{this.url="",this.loading=!1})},cancel(){this.$emit("close")},onUrlChange(t,e){this.url=t,this.disabled=e}}};function _9(t,e,n,s,i,r){const o=w("control-url-field"),a=w("modal-dialog");return O(),yt(a,{actions:r.actions,show:n.show,title:t.$t("dialog.add.rss.title"),onClose:e[1]||(e[1]=l=>t.$emit("close"))},{content:M(()=>[P("form",{onSubmit:e[0]||(e[0]=Bn((...l)=>r.add&&r.add(...l),["prevent"]))},[E(o,{icon:"rss",help:t.$t("dialog.add.rss.help"),loading:i.loading,placeholder:t.$t("dialog.add.rss.placeholder"),onInput:r.onUrlChange},null,8,["help","loading","placeholder","onInput"])],32)]),_:1},8,["actions","show","title"])}const S9=nt(v9,[["render",_9]]),E9={name:"PagePodcasts",components:{ContentWithHeading:ie,ControlButton:un,ListAlbums:hs,ListTracks:es,ModalDialogAddRss:S9,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Tt.albums("podcast"),Tt.newPodcastEpisodes(),Tt.rssCount()]).then(([s,i,r])=>{n(o=>{o.albums=new Ct(s),o.episodes=new Ct(i),o.rssCount=r})})},setup(){return{libraryStore:Gu(),uiStore:ts()}},data(){return{albums:[],episodes:{items:[]},rssCount:{},showAddPodcastModal:!1}},computed:{hasRss(){return(this.rssCount.albums??0)>0},heading(){return this.albums.total?{subtitle:[{count:this.albums.count,key:"data.podcasts"}],title:this.$t("page.podcasts.title")}:{}}},methods:{markAllAsPlayed(){this.episodes.items.forEach(t=>{Tt.updateTrack(t.id,{play_count:"increment"})}),this.episodes.items={}},openAddPodcastDialog(){this.showAddPodcastModal=!0},reloadEpisodes(){Tt.newPodcastEpisodes().then(t=>{this.episodes=new Ct(t)})},reloadPodcasts(){Tt.albums("podcast").then(t=>{this.albums=new Ct(t),this.reloadEpisodes(),this.reloadRssCount()})},reloadRssCount(){Tt.rssCount().then(t=>{this.rssCount=t})},updateRss(){this.libraryStore.update_dialog_scan_kind="rss",this.uiStore.showUpdateDialog=!0}}};function w9(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-tracks"),c=w("content-with-heading"),u=w("list-albums"),d=w("modal-dialog-add-rss");return O(),F(it,null,[i.episodes.items.length>0?(O(),yt(c,{key:0},{heading:M(()=>[E(o,{content:{title:t.$t("page.podcasts.new-episodes")}},null,8,["content"])]),actions:M(()=>[E(a,{button:{handler:r.markAllAsPlayed,icon:"pencil",key:"actions.mark-all-played"}},null,8,["button"])]),content:M(()=>[E(l,{items:i.episodes,"show-progress":!0,onPlayCountChanged:r.reloadEpisodes},null,8,["items","onPlayCountChanged"])]),_:1})):_t("",!0),E(c,null,{heading:M(()=>[E(o,{content:r.heading},null,8,["content"])]),actions:M(()=>[r.hasRss?(O(),yt(a,{key:0,button:{handler:r.updateRss,icon:"refresh",key:"actions.update"}},null,8,["button"])):_t("",!0),E(a,{button:{handler:r.openAddPodcastDialog,icon:"rss",key:"actions.add"}},null,8,["button"])]),content:M(()=>[E(u,{items:i.albums,onPlayCountChanged:r.reloadEpisodes,onPodcastDeleted:r.reloadPodcasts},null,8,["items","onPlayCountChanged","onPodcastDeleted"])]),_:1}),E(d,{show:i.showAddPodcastModal,onClose:e[0]||(e[0]=f=>i.showAddPodcastModal=!1),onPodcastAdded:r.reloadPodcasts},null,8,["show","onPodcastAdded"])],64)}const k9=nt(E9,[["render",w9]]),C9={name:"ListItemQueueItem",props:{currentPosition:{required:!0,type:Number},editing:Boolean,hideReadItems:Boolean,item:{required:!0,type:Object},position:{required:!0,type:Number}},setup(){return{playerStore:Wn()}},computed:{isCurrent(){return this.item.id===this.playerStore.item_id},isNext(){return this.currentPosition<0||this.position>=this.currentPosition}},methods:{play(){en.play({item_id:this.item.id})}}},T9={key:0,class:"media-left"},A9={class:"media-content"},O9=["textContent"],x9=["textContent"],I9=["textContent"],N9={class:"media-right"};function P9(t,e,n,s,i,r){const o=w("mdicon");return r.isNext||!n.hideReadItems?(O(),F("div",{key:0,class:"media is-align-items-center is-clickable mb-0",onClick:e[0]||(e[0]=(...a)=>r.play&&r.play(...a))},[n.editing?(O(),F("div",T9,[E(o,{class:"icon has-text-grey is-movable",name:"drag-horizontal",size:"18"})])):_t("",!0),P("div",A9,[P("div",{class:Gt(["is-size-6 has-text-weight-bold",{"has-text-primary":r.isCurrent,"has-text-grey-light":!r.isNext}]),textContent:et(n.item.title)},null,10,O9),P("div",{class:Gt(["is-size-7 has-text-weight-bold",{"has-text-primary":r.isCurrent,"has-text-grey-light":!r.isNext,"has-text-grey":r.isNext&&!r.isCurrent}]),textContent:et(n.item.artist)},null,10,x9),P("div",{class:Gt(["is-size-7",{"has-text-primary":r.isCurrent,"has-text-grey-light":!r.isNext,"has-text-grey":r.isNext&&!r.isCurrent}]),textContent:et(n.item.album)},null,10,I9)]),P("div",N9,[le(t.$slots,"actions",{},void 0,!0)])])):_t("",!0)}const R9=nt(C9,[["render",P9],["__scopeId","data-v-c07b7c2b"]]),D9={name:"ModalDialogAddStream",components:{ControlUrlField:MS,ModalDialog:rr},props:{show:Boolean},emits:["close"],data(){return{disabled:!0,loading:!1,url:""}},computed:{actions(){return this.loading?[{icon:"web",key:"dialog.add.stream.processing"}]:[{handler:this.cancel,icon:"cancel",key:"actions.cancel"},{disabled:this.disabled,handler:this.add,icon:"playlist-plus",key:"actions.add"},{disabled:this.disabled,handler:this.play,icon:"play",key:"actions.play"}]}},methods:{add(){this.loading=!0,ae.addUri(this.url).then(()=>{this.$emit("close")}).finally(()=>{this.url="",this.loading=!1})},cancel(){this.$emit("close")},onUrlChange(t,e){this.url=t,this.disabled=e},play(){this.loading=!0,ae.playUri(this.url,!1).then(()=>{this.$emit("close"),this.url=""}).catch(()=>{this.loading=!1})}}};function L9(t,e,n,s,i,r){const o=w("control-url-field"),a=w("modal-dialog");return O(),yt(a,{actions:r.actions,show:n.show,title:t.$t("dialog.add.stream.title"),onClose:e[1]||(e[1]=l=>t.$emit("close"))},{content:M(()=>[P("form",{onSubmit:e[0]||(e[0]=Bn((...l)=>r.play&&r.play(...l),["prevent"]))},[E(o,{icon:"web",loading:i.loading,placeholder:t.$t("dialog.add.stream.placeholder"),onInput:r.onUrlChange},null,8,["loading","placeholder","onInput"])],32)]),_:1},8,["actions","show","title"])}const M9=nt(D9,[["render",L9]]),$9={name:"ModalDialogPlaylistSave",components:{ModalDialog:rr},props:{show:Boolean},emits:["close"],data(){return{disabled:!0,loading:!1,playlistName:""}},computed:{actions(){return this.loading?[{icon:"web",key:"dialog.playlist.save.saving"}]:[{handler:this.cancel,icon:"cancel",key:"actions.cancel"},{disabled:this.disabled,handler:this.save,icon:"download",key:"actions.save"}]}},watch:{show(){this.show&&(this.loading=!1,setTimeout(()=>{this.$refs.playlist_name_field.focus()},10))}},methods:{cancel(){this.$emit("close")},check(t){const{validity:e}=t.target;this.disabled=e.patternMismatch||e.valueMissing},save(){this.loading=!0,ae.saveToPlaylist(this.playlistName).then(()=>{this.$emit("close"),this.playlistName=""}).catch(()=>{this.loading=!1})}}},F9={class:"field"},V9={class:"control has-icons-left"},U9=["placeholder","disabled"];function H9(t,e,n,s,i,r){const o=w("mdicon"),a=w("modal-dialog");return O(),yt(a,{actions:r.actions,show:n.show,title:t.$t("dialog.playlist.save.title"),onClose:e[3]||(e[3]=l=>t.$emit("close"))},{content:M(()=>[P("form",{onSubmit:e[2]||(e[2]=Bn((...l)=>r.save&&r.save(...l),["prevent"]))},[P("div",F9,[P("div",V9,[ms(P("input",{ref:"playlist_name_field","onUpdate:modelValue":e[0]||(e[0]=l=>i.playlistName=l),class:"input",type:"text",pattern:".+",required:"",placeholder:t.$t("dialog.playlist.save.playlist-name"),disabled:i.loading,onInput:e[1]||(e[1]=(...l)=>r.check&&r.check(...l))},null,40,U9),[[Zs,i.playlistName]]),E(o,{class:"icon is-left",name:"playlist-music",size:"16"})])])],32)]),_:1},8,["actions","show","title"])}const j9=nt($9,[["render",H9]]);var wc={exports:{}};/**! * Sortable 1.14.0 * @author RubaXa