diff --git a/htdocs/assets/index.js b/htdocs/assets/index.js index da481a22..ca43720d 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="${OM(e)>.5?"#000000":"#FFFFFF"}"> ${t.caption} - `;return`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(n)}`},IM={name:"ControlImage",props:{album:{default:"",type:String},artist:{default:"",type:String},url:{default:"",type:String}},emits:["click"],data(){return{font:{family:"sans-serif",weight:"bold"},lifecycle:{error:t=>{t.src=this.dataURI()}},size:600}},methods:{dataURI(){return xM({alternate:`${this.artist} - ${this.album}`,caption:(this.album||this.artist||"").substring(0,2),font:this.font,size:this.size})}}},NM={class:"figure has-shadow"};function PM(t,e,n,s,i,r){const o=Hh("lazy");return O(),$("figure",NM,[xn(S("img",{onClick:e[0]||(e[0]=a=>t.$emit("click"))},null,512),[[o,{src:n.url,lifecycle:i.lifecycle}]])])}const tr=it(IM,[["render",PM],["__scopeId","data-v-92383b31"]]),{t:Ml,locale:RM}=Du.global,uS="NO_INDEX",LM=(t,e)=>t-e,DM=(t,e)=>t.localeCompare(e,RM.value),$M=(t,e)=>new Date(t)-new Date(e)||(t?e?0:1:-1),MM=t=>t.map(({field:e,type:n,order:s=1})=>{switch(n){case String:return(i,r)=>DM(i[e],r[e])*s;case Number:return(i,r)=>LM(i[e],r[e])*s;case Date:return(i,r)=>$M(i[e],r[e])*s;default:return()=>0}}),FM=(t="")=>{const e=t.charAt(0);return e.match(new RegExp("\\p{Letter}","gu"))?e.toUpperCase():e.match(new RegExp("\\p{Number}","gu"))?"#":"⌘"},VM=t=>{},HM=[{difference:NaN,text:()=>Ml("grouped-list.undefined")},{difference:864e5,text:()=>Ml("grouped-list.today")},{difference:6048e5,text:()=>Ml("grouped-list.last-week")},{difference:2592e6,text:()=>Ml("grouped-list.last-month")},{difference:1/0,text:t=>t.getFullYear()}],UM=t=>{var s;const e=new Date(t),n=new Date-e;return(s=HM.find(i=>isNaN(n)||n{switch(e){case String:return n=>FM(n[t]);case Number:return n=>n[t];case Date:return n=>UM(n[t]);case"Digits":return n=>VM(n[t]);default:return()=>uS}};class Tt{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=MM(e),o=i.sort((l,c)=>r.reduce((u,d)=>u||d(l,c),0)),a=jM(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!==uS&&(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 BM={name:"ListProperties",components:{ControlImage:tr},props:{item:{required:!0,type:Object}}},WM={class:"title is-4"},qM=["textContent"],GM=["textContent"],zM=["textContent"],KM={class:"title is-6"},XM=["onClick","textContent"],YM=["textContent"];function ZM(t,e,n,s,i,r){var a;const o=C("control-image");return O(),$(ht,null,[S("div",WM,[n.item.handler?(O(),$("a",{key:0,onClick:e[0]||(e[0]=(...l)=>n.item.handler&&n.item.handler(...l)),textContent:j(n.item.name)},null,8,qM)):(O(),$("span",{key:1,textContent:j(n.item.name)},null,8,GM))]),n.item.image?(O(),vt(o,{key:0,url:n.item.image,artist:n.item.artist,album:n.item.name,class:"is-normal mb-5"},null,8,["url","artist","album"])):bt("",!0),t.$slots.buttons?be(t.$slots,"buttons",{key:1}):bt("",!0),(O(!0),$(ht,null,ce((a=n.item.properties)==null?void 0:a.filter(l=>l.value),l=>(O(),$("div",{key:l.key,class:"mb-3"},[S("div",{class:"is-size-7 is-uppercase",textContent:j(t.$t(l.key))},null,8,zM),S("div",KM,[l.handler?(O(),$("a",{key:0,onClick:l.handler,textContent:j(l.value)},null,8,XM)):(O(),$("span",{key:1,class:"title is-6",textContent:j(l.value)},null,8,YM))])]))),128))],64)}const dS=it(BM,[["render",ZM]]),JM={name:"ModalDialogPlayable",components:{ControlButton:Qe,ListProperties:dS,ModalDialog:gi},props:{buttons:{default:()=>[],type:Array},item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{actions(){return[{key:"dialog.playable.add",handler:this.queue_add,icon:"playlist-plus"},{key:"dialog.playable.add-next",handler:this.queue_add_next,icon:"playlist-play"},{key:"dialog.playable.play",handler:this.play,icon:"play"}]}},methods:{play(){this.$emit("close"),this.item.expression?tt.player_play_expression(this.item.expression,!1):tt.player_play_uri(this.item.uris||this.item.uri,!1)},queue_add(){this.$emit("close"),this.item.expression?tt.queue_expression_add(this.item.expression):tt.queue_add(this.item.uris||this.item.uri)},queue_add_next(){this.$emit("close"),this.item.expression?tt.queue_expression_add_next(this.item.expression):tt.queue_add_next(this.item.uris||this.item.uri)}}},QM={class:"buttons"};function t8(t,e,n,s,i,r){const o=C("control-button"),a=C("list-properties"),l=C("modal-dialog");return O(),vt(l,{actions:r.actions,show:n.show,onClose:e[0]||(e[0]=c=>t.$emit("close"))},{content:D(()=>[E(a,{item:n.item},Za({_:2},[n.buttons.length?{name:"buttons",fn:D(()=>[S("div",QM,[(O(!0),$(ht,null,ce(n.buttons,c=>(O(),vt(o,{key:c.key,button:c},null,8,["button"]))),128))])]),key:"0"}:void 0]),1032,["item"])]),_:1},8,["actions","show"])}const xs=it(JM,[["render",t8]]),e8={name:"ModalDialogTrack",components:{ModalDialogPlayable:xs},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?[{key:"dialog.track.mark-as-new",handler:this.mark_new}]:[{key:"dialog.track.mark-as-played",handler:this.mark_played}]},playable(){return{name:this.item.title,uri:this.item.uri,properties:[{key:"property.album",value:this.item.album,handler:this.open_album},{key:"property.album-artist",value:this.item.album_artist,handler:this.open_artist},{key:"property.composer",value:this.item.composer},{key:"property.release-date",value:this.$filters.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.disc_number,this.item.track_number].join(" / ")},{key:"property.duration",value:this.$filters.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-value",{format:this.item.type,bitrate:this.item.bitrate,channels:this.$t("count.channels",this.item.channels),samplerate:this.item.samplerate})},{key:"property.added-on",value:this.$filters.toDateTime(this.item.time_added)},{key:"property.rating",value:this.$t("dialog.track.rating-value",{rating:Math.floor(this.item.rating/10)})},{key:"property.comment",value:this.item.comment},{key:"property.path",value:this.item.path}]}}},methods:{mark_new(){tt.library_track_update(this.item.id,{play_count:"reset"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},mark_played(){tt.library_track_update(this.item.id,{play_count:"increment"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},open_album(){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:"audiobooks-album",params:{id:this.item.album_id}}):this.item.media_kind==="music"&&this.$router.push({name:"music-album",params:{id:this.item.album_id}})},open_artist(){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:"audiobooks-artist",params:{id:this.item.album_artist_id}})},open_genre(){this.$emit("close"),this.$router.push({name:"genre-albums",params:{name:this.item.genre},query:{media_kind:this.item.media_kind}})}}};function n8(t,e,n,s,i,r){const o=C("modal-dialog-playable");return O(),vt(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=it(e8,[["render",n8]]),i8={name:"ListTracks",components:{ModalDialogTrack:s8},props:{expression:{default:"",type:String},items:{required:!0,type:Object},show_icon:Boolean,show_progress:Boolean,uris:{default:"",type:String}},emits:["play-count-changed"],data(){return{selected_item:{},show_details_modal:!1}},methods:{open_dialog(t){this.selected_item=t,this.show_details_modal=!0},play(t){this.uris?tt.player_play_uri(this.uris,!1,this.items.items.indexOf(t)):this.expression?tt.player_play_expression(this.expression,!1,this.items.items.indexOf(t)):tt.player_play_uri(t.uri,!1)}}},r8={key:0,class:"py-5"},o8=["id","textContent"],a8=["onClick"],l8={class:"media-content"},c8=["textContent"],u8=["textContent"],d8=["textContent"],f8=["max","value"],h8={class:"media-right"},p8=["onClick"];function m8(t,e,n,s,i,r){const o=C("mdicon"),a=C("modal-dialog-track");return O(),$(ht,null,[(O(!0),$(ht,null,ce(n.items,l=>(O(),$(ht,{key:l.itemId},[l.isItem?(O(),$("div",{key:1,class:qt(["media is-align-items-center is-clickable mb-0",{"with-progress":n.show_progress}]),onClick:c=>r.play(l.item)},[n.show_icon?(O(),vt(o,{key:0,class:"media-left icon",name:"file-music-outline"})):bt("",!0),S("div",l8,[S("div",{class:qt(["is-size-6 has-text-weight-bold",{"has-text-grey":l.item.media_kind==="podcast"&&l.item.play_count>0}]),textContent:j(l.item.title)},null,10,c8),S("div",{class:"is-size-7 has-text-weight-bold has-text-grey",textContent:j(l.item.artist)},null,8,u8),S("div",{class:"is-size-7 has-text-grey",textContent:j(l.item.album)},null,8,d8),n.show_progress&&l.item.seek_ms>0?(O(),$("progress",{key:0,class:"progress is-dark",max:l.item.length_ms,value:l.item.seek_ms},null,8,f8)):bt("",!0)]),S("div",h8,[S("a",{onClick:Ie(c=>r.open_dialog(l.item),["prevent","stop"])},[E(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,p8)])],10,a8)):(O(),$("div",r8,[S("span",{id:`index_${l.index}`,class:"tag is-small has-text-weight-bold",textContent:j(l.index)},null,8,o8)]))],64))),128)),(O(),vt(fs,{to:"#app"},[E(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1),onPlayCountChanged:e[1]||(e[1]=l=>t.$emit("play-count-changed"))},null,8,["item","show"])]))],64)}const Hn=it(i8,[["render",m8],["__scopeId","data-v-44ebdd0b"]]),g8={name:"ModalDialogAlbum",components:{ModalDialogPlayable:xs},props:{item:{required:!0,type:Object},media_kind:{default:"",type:String},show:Boolean},emits:["close","remove-podcast","play-count-changed"],computed:{buttons(){return this.media_kind_resolved==="podcast"?this.item.data_kind==="url"?[{key:"dialog.album.mark-as-played",handler:this.mark_played},{key:"dialog.album.remove-podcast",handler:this.remove_podcast}]:[{key:"dialog.album.mark-as-played",handler:this.mark_played}]:[]},media_kind_resolved(){return this.media_kind||this.item.media_kind},playable(){return{name:this.item.name,handler:this.open,image:this.item.artwork_url,uri:this.item.uri,properties:[{key:"property.artist",value:this.item.artist,handler:this.open_artist},{key:"property.release-date",value:this.$filters.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.$filters.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.$filters.toDateTime(this.item.time_added)}]}}},methods:{mark_played(){tt.library_album_track_update(this.item.id,{play_count:"played"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},open(){this.$emit("close"),this.media_kind_resolved==="podcast"?this.$router.push({name:"podcast",params:{id:this.item.id}}):this.media_kind_resolved==="audiobook"?this.$router.push({name:"audiobooks-album",params:{id:this.item.id}}):this.$router.push({name:"music-album",params:{id:this.item.id}})},open_artist(){this.$emit("close"),this.media_kind_resolved==="audiobook"?this.$router.push({name:"audiobooks-artist",params:{id:this.item.artist_id}}):this.$router.push({name:"music-artist",params:{id:this.item.artist_id}})},remove_podcast(){this.$emit("remove-podcast")}}};function b8(t,e,n,s,i,r){const o=C("modal-dialog-playable");return O(),vt(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 dd=it(g8,[["render",b8]]),ty={load(t){return Promise.all([tt.library_album(t.params.id),tt.library_album_tracks(t.params.id)])},set(t,e){t.album=e[0].data,t.tracks=new Tt(e[1].data,{criteria:[{field:"disc_number",type:Number}],index:{field:"disc_number",type:Number}}),t.tracks.indices.length<2&&t.tracks.group()}},y8={name:"PageAlbum",components:{ContentWithHero:ud,ControlButton:Qe,ControlImage:tr,ListTracks:Hn,ModalDialogAlbum:dd},beforeRouteEnter(t,e,n){ty.load(t).then(s=>{n(i=>ty.set(i,s))})},data(){return{album:{},show_details_modal:!1,tracks:new Tt}},methods:{open_artist(){this.show_details_modal=!1,this.$router.push({name:"music-artist",params:{id:this.album.artist_id}})},play(){tt.player_play_uri(this.album.uri,!0)},showDetails(){this.show_details_modal=!0}}},_8=["textContent"],v8={class:"subtitle is-6"},S8=["textContent"],E8=["textContent"],w8={class:"buttons is-centered-mobile mt-5"};function k8(t,e,n,s,i,r){const o=C("control-button"),a=C("control-image"),l=C("list-tracks"),c=C("modal-dialog-album"),u=C("content-with-hero");return O(),$("div",null,[E(u,null,{"heading-left":D(()=>[S("div",{class:"title is-5",textContent:j(i.album.name)},null,8,_8),S("div",v8,[S("a",{onClick:e[0]||(e[0]=(...d)=>r.open_artist&&r.open_artist(...d)),textContent:j(i.album.artist)},null,8,S8)]),S("div",{class:"is-size-7 is-uppercase has-text-centered-mobile",textContent:j(t.$t("count.tracks",{count:i.album.track_count}))},null,8,E8),S("div",w8,[E(o,{button:{handler:r.play,icon:"shuffle",key:"page.album.shuffle"}},null,8,["button"]),E(o,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"])])]),"heading-right":D(()=>[E(a,{url:i.album.artwork_url,artist:i.album.artist,album:i.album.name,class:"is-clickable is-medium",onClick:r.showDetails},null,8,["url","artist","album","onClick"])]),content:D(()=>[E(l,{items:i.tracks,uris:i.album.uri},null,8,["items","uris"]),E(c,{item:i.album,show:i.show_details_modal,onClose:e[1]||(e[1]=d=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const C8=it(y8,[["render",k8]]),T8={name:"ModalDialogTrackSpotify",components:{ModalDialogPlayable:xs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t;return this.item.artists?{name:this.item.name,uri:this.item.uri,properties:[{key:"property.album",value:this.item.album.name,handler:this.open_album},{key:"property.album-artist",value:(t=this.item.artists[0])==null?void 0:t.name,handler:this.open_artist},{key:"property.release-date",value:this.$filters.toDate(this.item.album.release_date)},{key:"property.position",value:[this.item.disc_number,this.item.track_number].join(" / ")},{key:"property.duration",value:this.$filters.toTimecode(this.item.duration_ms)},{key:"property.path",value:this.item.uri}]}:{}}},methods:{open_album(){this.$emit("close"),this.$router.push({name:"music-spotify-album",params:{id:this.item.album.id}})},open_artist(){this.$emit("close"),this.$router.push({name:"music-spotify-artist",params:{id:this.item.artists[0].id}})}}};function A8(t,e,n,s,i,r){const o=C("modal-dialog-playable");return O(),vt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const O8=it(T8,[["render",A8]]),x8={name:"ListTracksSpotify",components:{ModalDialogTrackSpotify:O8},props:{context_uri:{default:"",type:String},items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open_dialog(t){this.selected_item=t,this.show_details_modal=!0},play(t){t.is_playable&&tt.player_play_uri(this.context_uri||t.uri,!1,t.position||0)}}},I8=["onClick"],N8=["textContent"],P8=["textContent"],R8=["textContent"],L8={key:0,class:"is-size-7 has-text-grey"},D8=["textContent"],$8=["textContent"],M8={class:"media-right"},F8=["onClick"];function V8(t,e,n,s,i,r){const o=C("mdicon"),a=C("modal-dialog-track-spotify");return O(),$(ht,null,[(O(!0),$(ht,null,ce(n.items,l=>{var c;return O(),$("div",{key:l.id,class:"media is-align-items-center mb-0"},[S("div",{class:qt(["media-content",{"is-clickable":l.is_playable,"is-not-allowed":!l.is_playable}]),onClick:u=>r.play(l)},[S("div",{class:qt(["is-size-6 has-text-weight-bold",{"has-text-grey-light":!l.is_playable}]),textContent:j(l.name)},null,10,N8),S("div",{class:qt(["is-size-7 has-text-weight-bold",{"has-text-grey":l.is_playable,"has-text-grey-light":!l.is_playable}]),textContent:j(l.artists[0].name)},null,10,P8),S("div",{class:"is-size-7 has-text-grey",textContent:j(l.album.name)},null,8,R8),l.is_playable?bt("",!0):(O(),$("div",L8,[e[1]||(e[1]=js(" (")),S("span",{textContent:j(t.$t("list.spotify.not-playable-track"))},null,8,D8),(c=l.restrictions)!=null&&c.reason?(O(),$("span",{key:0,textContent:j(t.$t("list.spotify.restriction-reason",{reason:l.restrictions.reason}))},null,8,$8)):bt("",!0),e[2]||(e[2]=js(") "))]))],10,I8),S("div",M8,[S("a",{onClick:Ie(u=>r.open_dialog(l),["prevent","stop"])},[E(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,F8)])])}),128)),(O(),vt(fs,{to:"#app"},[E(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const Kc=it(x8,[["render",V8],["__scopeId","data-v-f2f903a5"]]),H8={name:"ModalDialogAlbumSpotify",components:{ModalDialogPlayable:xs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t,e,n,s,i,r;return{name:this.item.name||"",image:((n=(e=(t=this.item)==null?void 0:t.images)==null?void 0:e[0])==null?void 0:n.url)||"",handler:this.open,uri:this.item.uri,properties:[{key:"property.artist",value:(r=(i=(s=this.item)==null?void 0:s.artists)==null?void 0:i[0])==null?void 0:r.name,handler:this.open_artist},{key:"property.release-date",value:this.$filters.toDate(this.item.release_date)},{key:"property.type",value:this.item.album_type}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"music-spotify-album",params:{id:this.item.id}})},open_artist(){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=C("modal-dialog-playable");return O(),vt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const fS=it(H8,[["render",U8]]);var Jd={exports:{}},ey;function j8(){return ey||(ey=1,function(t){var e=function(){var n="https://api.spotify.com/v1",s=null,i=null,r=function(f,h){return f.abort=h,f},o=function(f,h){var p;if(i!==null){var m=i.defer();f(function(y){m.resolve(y)},function(y){m.reject(y)}),p=m.promise}else window.Promise&&(p=new window.Promise(f));return p?new r(p,h):null},a=function(){var f=Array.prototype.slice.call(arguments),h=f[0],p=f.slice(1);return h=h||{},p.forEach(function(m){for(var y in m)m.hasOwnProperty(y)&&(h[y]=m[y])}),h},l=function(f,h){var p="";for(var m in h)if(h.hasOwnProperty(m)){var y=h[m];p+=encodeURIComponent(m)+"="+encodeURIComponent(y)+"&"}return p.length>0&&(p=p.substring(0,p.length-1),f=f+"?"+p),f},c=function(f,h){var p=new XMLHttpRequest,m=function(y,b){function v(k){y&&y(k),h&&h(null,k)}function g(){b&&b(p),h&&h(p,null)}var _=f.type||"GET";if(p.open(_,l(f.url,f.params)),s&&p.setRequestHeader("Authorization","Bearer "+s),p.onreadystatechange=function(){if(p.readyState===4){var k=null;try{k=p.responseText?JSON.parse(p.responseText):""}catch(N){console.error(N)}p.status>=200&&p.status<300?v(k):g()}},_==="GET")p.send(null);else{var w=null;f.postData&&(f.contentType==="image/jpeg"?(w=f.postData,p.setRequestHeader("Content-Type",f.contentType)):(w=JSON.stringify(f.postData),p.setRequestHeader("Content-Type","application/json"))),p.send(w)}};return h?(m(),null):o(m,function(){p.abort()})},u=function(f,h,p,m){var y={},b=null;typeof h=="object"?(y=h,b=p):typeof h=="function"&&(b=h);var v=f.type||"GET";return v!=="GET"&&f.postData&&!m?f.postData=a(f.postData,y):f.params=a(f.params,y),c(f,b)},d=function(){};return d.prototype={constructor:e},d.prototype.getGeneric=function(f,h){var p={url:f};return u(p,h)},d.prototype.getMe=function(f,h){var p={url:n+"/me"};return u(p,f,h)},d.prototype.getMySavedTracks=function(f,h){var p={url:n+"/me/tracks"};return u(p,f,h)},d.prototype.addToMySavedTracks=function(f,h,p){var m={url:n+"/me/tracks",type:"PUT",postData:f};return u(m,h,p)},d.prototype.removeFromMySavedTracks=function(f,h,p){var m={url:n+"/me/tracks",type:"DELETE",postData:f};return u(m,h,p)},d.prototype.containsMySavedTracks=function(f,h,p){var m={url:n+"/me/tracks/contains",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getMySavedAlbums=function(f,h){var p={url:n+"/me/albums"};return u(p,f,h)},d.prototype.addToMySavedAlbums=function(f,h,p){var m={url:n+"/me/albums",type:"PUT",postData:f};return u(m,h,p)},d.prototype.removeFromMySavedAlbums=function(f,h,p){var m={url:n+"/me/albums",type:"DELETE",postData:f};return u(m,h,p)},d.prototype.containsMySavedAlbums=function(f,h,p){var m={url:n+"/me/albums/contains",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getMyTopArtists=function(f,h){var p={url:n+"/me/top/artists"};return u(p,f,h)},d.prototype.getMyTopTracks=function(f,h){var p={url:n+"/me/top/tracks"};return u(p,f,h)},d.prototype.getMyRecentlyPlayedTracks=function(f,h){var p={url:n+"/me/player/recently-played"};return u(p,f,h)},d.prototype.followUsers=function(f,h){var p={url:n+"/me/following/",type:"PUT",params:{ids:f.join(","),type:"user"}};return u(p,h)},d.prototype.followArtists=function(f,h){var p={url:n+"/me/following/",type:"PUT",params:{ids:f.join(","),type:"artist"}};return u(p,h)},d.prototype.followPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f+"/followers",type:"PUT",postData:{}};return u(m,h,p)},d.prototype.unfollowUsers=function(f,h){var p={url:n+"/me/following/",type:"DELETE",params:{ids:f.join(","),type:"user"}};return u(p,h)},d.prototype.unfollowArtists=function(f,h){var p={url:n+"/me/following/",type:"DELETE",params:{ids:f.join(","),type:"artist"}};return u(p,h)},d.prototype.unfollowPlaylist=function(f,h){var p={url:n+"/playlists/"+f+"/followers",type:"DELETE"};return u(p,h)},d.prototype.isFollowingUsers=function(f,h){var p={url:n+"/me/following/contains",type:"GET",params:{ids:f.join(","),type:"user"}};return u(p,h)},d.prototype.isFollowingArtists=function(f,h){var p={url:n+"/me/following/contains",type:"GET",params:{ids:f.join(","),type:"artist"}};return u(p,h)},d.prototype.areFollowingPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f+"/followers/contains",type:"GET",params:{ids:h.join(",")}};return u(m,p)},d.prototype.getFollowedArtists=function(f,h){var p={url:n+"/me/following",type:"GET",params:{type:"artist"}};return u(p,f,h)},d.prototype.getUser=function(f,h,p){var m={url:n+"/users/"+encodeURIComponent(f)};return u(m,h,p)},d.prototype.getUserPlaylists=function(f,h,p){var m;return typeof f=="string"?m={url:n+"/users/"+encodeURIComponent(f)+"/playlists"}:(m={url:n+"/me/playlists"},p=h,h=f),u(m,h,p)},d.prototype.getPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f};return u(m,h,p)},d.prototype.getPlaylistTracks=function(f,h,p){var m={url:n+"/playlists/"+f+"/tracks"};return u(m,h,p)},d.prototype.getPlaylistCoverImage=function(f,h){var p={url:n+"/playlists/"+f+"/images"};return u(p,h)},d.prototype.createPlaylist=function(f,h,p){var m={url:n+"/users/"+encodeURIComponent(f)+"/playlists",type:"POST",postData:h};return u(m,h,p)},d.prototype.changePlaylistDetails=function(f,h,p){var m={url:n+"/playlists/"+f,type:"PUT",postData:h};return u(m,h,p)},d.prototype.addTracksToPlaylist=function(f,h,p,m){var y={url:n+"/playlists/"+f+"/tracks",type:"POST",postData:{uris:h}};return u(y,p,m,!0)},d.prototype.replaceTracksInPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f+"/tracks",type:"PUT",postData:{uris:h}};return u(m,{},p)},d.prototype.reorderTracksInPlaylist=function(f,h,p,m,y){var b={url:n+"/playlists/"+f+"/tracks",type:"PUT",postData:{range_start:h,insert_before:p}};return u(b,m,y)},d.prototype.removeTracksFromPlaylist=function(f,h,p){var m=h.map(function(b){return typeof b=="string"?{uri:b}:b}),y={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{tracks:m}};return u(y,{},p)},d.prototype.removeTracksFromPlaylistWithSnapshotId=function(f,h,p,m){var y=h.map(function(v){return typeof v=="string"?{uri:v}:v}),b={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{tracks:y,snapshot_id:p}};return u(b,{},m)},d.prototype.removeTracksFromPlaylistInPositions=function(f,h,p,m){var y={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{positions:h,snapshot_id:p}};return u(y,{},m)},d.prototype.uploadCustomPlaylistCoverImage=function(f,h,p){var m={url:n+"/playlists/"+f+"/images",type:"PUT",postData:h.replace(/^data:image\/jpeg;base64,/,""),contentType:"image/jpeg"};return u(m,{},p)},d.prototype.getAlbum=function(f,h,p){var m={url:n+"/albums/"+f};return u(m,h,p)},d.prototype.getAlbumTracks=function(f,h,p){var m={url:n+"/albums/"+f+"/tracks"};return u(m,h,p)},d.prototype.getAlbums=function(f,h,p){var m={url:n+"/albums/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getTrack=function(f,h,p){var m={};return m.url=n+"/tracks/"+f,u(m,h,p)},d.prototype.getTracks=function(f,h,p){var m={url:n+"/tracks/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getArtist=function(f,h,p){var m={url:n+"/artists/"+f};return u(m,h,p)},d.prototype.getArtists=function(f,h,p){var m={url:n+"/artists/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getArtistAlbums=function(f,h,p){var m={url:n+"/artists/"+f+"/albums"};return u(m,h,p)},d.prototype.getArtistTopTracks=function(f,h,p,m){var y={url:n+"/artists/"+f+"/top-tracks",params:{country:h}};return u(y,p,m)},d.prototype.getArtistRelatedArtists=function(f,h,p){var m={url:n+"/artists/"+f+"/related-artists"};return u(m,h,p)},d.prototype.getFeaturedPlaylists=function(f,h){var p={url:n+"/browse/featured-playlists"};return u(p,f,h)},d.prototype.getNewReleases=function(f,h){var p={url:n+"/browse/new-releases"};return u(p,f,h)},d.prototype.getCategories=function(f,h){var p={url:n+"/browse/categories"};return u(p,f,h)},d.prototype.getCategory=function(f,h,p){var m={url:n+"/browse/categories/"+f};return u(m,h,p)},d.prototype.getCategoryPlaylists=function(f,h,p){var m={url:n+"/browse/categories/"+f+"/playlists"};return u(m,h,p)},d.prototype.search=function(f,h,p,m){var y={url:n+"/search/",params:{q:f,type:h.join(",")}};return u(y,p,m)},d.prototype.searchAlbums=function(f,h,p){return this.search(f,["album"],h,p)},d.prototype.searchArtists=function(f,h,p){return this.search(f,["artist"],h,p)},d.prototype.searchTracks=function(f,h,p){return this.search(f,["track"],h,p)},d.prototype.searchPlaylists=function(f,h,p){return this.search(f,["playlist"],h,p)},d.prototype.searchShows=function(f,h,p){return this.search(f,["show"],h,p)},d.prototype.searchEpisodes=function(f,h,p){return this.search(f,["episode"],h,p)},d.prototype.getAudioFeaturesForTrack=function(f,h){var p={};return p.url=n+"/audio-features/"+f,u(p,{},h)},d.prototype.getAudioFeaturesForTracks=function(f,h){var p={url:n+"/audio-features",params:{ids:f}};return u(p,{},h)},d.prototype.getAudioAnalysisForTrack=function(f,h){var p={};return p.url=n+"/audio-analysis/"+f,u(p,{},h)},d.prototype.getRecommendations=function(f,h){var p={url:n+"/recommendations"};return u(p,f,h)},d.prototype.getAvailableGenreSeeds=function(f){var h={url:n+"/recommendations/available-genre-seeds"};return u(h,{},f)},d.prototype.getMyDevices=function(f){var h={url:n+"/me/player/devices"};return u(h,{},f)},d.prototype.getMyCurrentPlaybackState=function(f,h){var p={url:n+"/me/player"};return u(p,f,h)},d.prototype.getMyCurrentPlayingTrack=function(f,h){var p={url:n+"/me/player/currently-playing"};return u(p,f,h)},d.prototype.transferMyPlayback=function(f,h,p){var m=h||{};m.device_ids=f;var y={type:"PUT",url:n+"/me/player",postData:m};return u(y,h,p)},d.prototype.play=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={};["context_uri","uris","offset","position_ms"].forEach(function(v){v in f&&(m[v]=f[v])});var y={type:"PUT",url:n+"/me/player/play",params:p,postData:m},b=typeof f=="function"?f:{};return u(y,b,h)},d.prototype.queue=function(f,h,p){h=h||{};var m="device_id"in h?{uri:f,device_id:h.device_id}:{uri:f},y={type:"POST",url:n+"/me/player/queue",params:m};return u(y,h,p)},d.prototype.pause=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={type:"PUT",url:n+"/me/player/pause",params:p};return u(m,f,h)},d.prototype.skipToNext=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={type:"POST",url:n+"/me/player/next",params:p};return u(m,f,h)},d.prototype.skipToPrevious=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={type:"POST",url:n+"/me/player/previous",params:p};return u(m,f,h)},d.prototype.seek=function(f,h,p){h=h||{};var m={position_ms:f};"device_id"in h&&(m.device_id=h.device_id);var y={type:"PUT",url:n+"/me/player/seek",params:m};return u(y,h,p)},d.prototype.setRepeat=function(f,h,p){h=h||{};var m={state:f};"device_id"in h&&(m.device_id=h.device_id);var y={type:"PUT",url:n+"/me/player/repeat",params:m};return u(y,h,p)},d.prototype.setVolume=function(f,h,p){h=h||{};var m={volume_percent:f};"device_id"in h&&(m.device_id=h.device_id);var y={type:"PUT",url:n+"/me/player/volume",params:m};return u(y,h,p)},d.prototype.setShuffle=function(f,h,p){h=h||{};var m={state:f};"device_id"in h&&(m.device_id=h.device_id);var y={type:"PUT",url:n+"/me/player/shuffle",params:m};return u(y,h,p)},d.prototype.getShow=function(f,h,p){var m={};return m.url=n+"/shows/"+f,u(m,h,p)},d.prototype.getShows=function(f,h,p){var m={url:n+"/shows/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getMySavedShows=function(f,h){var p={url:n+"/me/shows"};return u(p,f,h)},d.prototype.addToMySavedShows=function(f,h,p){var m={url:n+"/me/shows",type:"PUT",postData:f};return u(m,h,p)},d.prototype.removeFromMySavedShows=function(f,h,p){var m={url:n+"/me/shows",type:"DELETE",postData:f};return u(m,h,p)},d.prototype.containsMySavedShows=function(f,h,p){var m={url:n+"/me/shows/contains",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getShowEpisodes=function(f,h,p){var m={url:n+"/shows/"+f+"/episodes"};return u(m,h,p)},d.prototype.getEpisode=function(f,h,p){var m={};return m.url=n+"/episodes/"+f,u(m,h,p)},d.prototype.getEpisodes=function(f,h,p){var m={url:n+"/episodes/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getAccessToken=function(){return s},d.prototype.setAccessToken=function(f){s=f},d.prototype.setPromiseImplementation=function(f){var h=!1;try{var p=new f(function(m){m()});typeof p.then=="function"&&typeof p.catch=="function"&&(h=!0)}catch(m){console.error(m)}if(h)i=f;else throw new Error("Unsupported implementation of Promises/A+")},d}();t.exports=e}(Jd)),Jd.exports}var B8=j8();const Ws=Vu(B8),ny={load(t){const e=new Ws;return e.setAccessToken(je().spotify.webapi_token),e.getAlbum(t.params.id,{market:je().spotify.webapi_country})},set(t,e){t.album=e}},W8={name:"PageAlbumSpotify",components:{ContentWithHero:ud,ControlButton:Qe,ControlImage:tr,ListTracksSpotify:Kc,ModalDialogAlbumSpotify:fS},beforeRouteEnter(t,e,n){ny.load(t).then(s=>{n(i=>ny.set(i,s))})},setup(){return{servicesStore:je()}},data(){return{album:{artists:[{}],tracks:{}},show_details_modal:!1}},computed:{tracks(){const{album:t}=this;return t.tracks.total?t.tracks.items.map(e=>({...e,album:t})):{}}},methods:{open_artist(){this.$router.push({name:"music-spotify-artist",params:{id:this.album.artists[0].id}})},play(){this.show_details_modal=!1,tt.player_play_uri(this.album.uri,!0)},showDetails(){this.show_details_modal=!0}}},q8=["textContent"],G8={class:"subtitle is-6"},z8=["textContent"],K8=["textContent"],X8={class:"buttons is-centered-mobile mt-5"};function Y8(t,e,n,s,i,r){const o=C("control-button"),a=C("control-image"),l=C("list-tracks-spotify"),c=C("modal-dialog-album-spotify"),u=C("content-with-hero");return O(),$("div",null,[E(u,null,{"heading-left":D(()=>[S("div",{class:"title is-5",textContent:j(i.album.name)},null,8,q8),S("div",G8,[S("a",{onClick:e[0]||(e[0]=(...d)=>r.open_artist&&r.open_artist(...d)),textContent:j(i.album.artists[0].name)},null,8,z8)]),S("div",{class:"is-size-7 is-uppercase has-text-centered-mobile",textContent:j(t.$t("count.tracks",{count:i.album.tracks.total}))},null,8,K8),S("div",X8,[E(o,{button:{handler:r.play,icon:"shuffle",key:"page.spotify.album.shuffle"}},null,8,["button"]),E(o,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"])])]),"heading-right":D(()=>{var d,f;return[E(a,{url:((f=(d=i.album.images)==null?void 0:d[0])==null?void 0:f.url)??"",artist:i.album.artists[0].name,album:i.album.name,class:"is-clickable is-medium",onClick:r.showDetails},null,8,["url","artist","album","onClick"])]}),content:D(()=>[E(l,{items:r.tracks,context_uri:i.album.uri},null,8,["items","context_uri"]),E(c,{item:i.album,show:i.show_details_modal,onClose:e[1]||(e[1]=d=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const Z8=it(W8,[["render",Y8]]),J8={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)}}},Q8={class:"dropdown-trigger"},t5=["textContent"],e5={id:"dropdown",class:"dropdown-menu",role:"menu"},n5={class:"dropdown-content"},s5=["onClick","textContent"];function i5(t,e,n,s,i,r){const o=C("mdicon"),a=Hh("click-away");return xn((O(),$("div",{class:qt(["dropdown",{"is-active":i.active}])},[S("div",Q8,[S("button",{class:"button","aria-haspopup":"true","aria-controls":"dropdown",onClick:e[0]||(e[0]=l=>i.active=!i.active)},[S("span",{textContent:j(r.option.name)},null,8,t5),E(o,{class:"icon",name:"chevron-down",size:"16"})])]),S("div",e5,[S("div",n5,[(O(!0),$(ht,null,ce(n.options,l=>(O(),$("a",{key:l.id,class:qt(["dropdown-item",{"is-active":n.value===l.id}]),onClick:c=>r.select(l),textContent:j(l.name)},null,10,s5))),128))])])],2)),[[a,r.deactivate]])}const Dr=it(J8,[["render",i5]]),r5={name:"IndexButtonList",props:{indices:{required:!0,type:Array}}},o5={class:"buttons is-centered mb-4"};function a5(t,e,n,s,i,r){const o=C("router-link");return O(),$("section",null,[S("nav",o5,[(O(!0),$(ht,null,ce(n.indices,a=>(O(),vt(o,{key:a,class:"button px-2 is-small is-square",to:{hash:`#index_${a}`,query:t.$route.query}},{default:D(()=>[js(j(a),1)]),_:2},1032,["to"]))),128))])])}const Is=it(r5,[["render",a5],["__scopeId","data-v-f15ebd8e"]]),l5={name:"ListAlbums",components:{ControlImage:tr,ModalDialog:gi,ModalDialogAlbum:dd},props:{items:{required:!0,type:Object},media_kind:{default:"",type:String}},emits:["play-count-changed","podcast-deleted"],setup(){return{settingsStore:bi()}},data(){return{rss_playlist_to_remove:{},selected_item:{},show_details_modal:!1,show_remove_podcast_modal:!1}},computed:{actions(){return[{key:"page.podcast.cancel",handler:"cancel",icon:"cancel"},{key:"page.podcast.remove",handler:"remove",icon:"delete"}]},media_kind_resolved(){return this.media_kind||this.selected_item.media_kind}},methods:{open(t){this.selected_item=t,this.media_kind_resolved==="podcast"?this.$router.push({name:"podcast",params:{id:t.id}}):this.media_kind_resolved==="audiobook"?this.$router.push({name:"audiobooks-album",params:{id:t.id}}):this.$router.push({name:"music-album",params:{id:t.id}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0},open_remove_podcast_dialog(){tt.library_album_tracks(this.selected_item.id,{limit:1}).then(({data:t})=>{tt.library_track_playlists(t.items[0].id).then(({data:e})=>{[this.rss_playlist_to_remove]=e.items.filter(n=>n.type==="rss"),this.show_remove_podcast_modal=!0,this.show_details_modal=!1})})},play_count_changed(){this.$emit("play-count-changed")},remove_podcast(){this.show_remove_podcast_modal=!1,tt.library_playlist_delete(this.rss_playlist_to_remove.id).then(()=>{this.$emit("podcast-deleted")})}}},c5={key:0,class:"py-5"},u5=["id","textContent"],d5=["onClick"],f5={class:"media-content"},h5=["textContent"],p5=["textContent"],m5=["textContent"],g5={class:"media-right"},b5=["onClick"],y5=["textContent"];function _5(t,e,n,s,i,r){const o=C("control-image"),a=C("mdicon"),l=C("modal-dialog-album"),c=C("i18n-t"),u=C("modal-dialog");return O(),$(ht,null,[(O(!0),$(ht,null,ce(n.items,d=>(O(),$(ht,{key:d.itemId},[d.isItem?(O(),$("div",{key:1,class:"media is-align-items-center is-clickable mb-0",onClick:f=>r.open(d.item)},[s.settingsStore.show_cover_artwork_in_album_lists?(O(),vt(o,{key:0,url:d.item.artwork_url,artist:d.item.artist,album:d.item.name,class:"media-left is-small"},null,8,["url","artist","album"])):bt("",!0),S("div",f5,[S("div",{class:"is-size-6 has-text-weight-bold",textContent:j(d.item.name)},null,8,h5),S("div",{class:"is-size-7 has-text-grey has-text-weight-bold",textContent:j(d.item.artist)},null,8,p5),d.item.date_released&&d.item.media_kind==="music"?(O(),$("div",{key:0,class:"is-size-7 has-text-grey",textContent:j(t.$filters.toDate(d.item.date_released))},null,8,m5)):bt("",!0)]),S("div",g5,[S("a",{onClick:Ie(f=>r.open_dialog(d.item),["prevent","stop"])},[E(a,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,b5)])],8,d5)):(O(),$("div",c5,[S("span",{id:`index_${d.index}`,class:"tag is-small has-text-weight-bold",textContent:j(d.index)},null,8,u5)]))],64))),128)),(O(),vt(fs,{to:"#app"},[E(l,{item:i.selected_item,media_kind:n.media_kind,show:i.show_details_modal,onClose:e[0]||(e[0]=d=>i.show_details_modal=!1),onRemovePodcast:e[1]||(e[1]=d=>r.open_remove_podcast_dialog()),onPlayCountChanged:e[2]||(e[2]=d=>r.play_count_changed())},null,8,["item","media_kind","show"]),E(u,{actions:r.actions,show:i.show_remove_podcast_modal,title:t.$t("page.podcast.remove-podcast"),onCancel:e[3]||(e[3]=d=>i.show_remove_podcast_modal=!1),onRemove:r.remove_podcast},{content:D(()=>[E(c,{keypath:"list.albums.info",tag:"p",scope:"global"},{separator:D(()=>e[4]||(e[4]=[S("br",null,null,-1)])),name:D(()=>[S("b",{textContent:j(i.rss_playlist_to_remove.name)},null,8,y5)]),_:1})]),_:1},8,["actions","show","title","onRemove"])]))],64)}const Gn=it(l5,[["render",_5]]),v5={name:"ControlTabList",props:{links:{required:!0,type:Array}}},S5={class:"section py-0 tabs-section"},E5={class:"container"},w5={class:"columns is-centered my-0"},k5={class:"column is-four-fifths py-0"},C5={class:"tabs is-centered is-small"},T5=["onClick","onKeypress"],A5=["textContent"];function O5(t,e,n,s,i,r){const o=C("mdicon"),a=C("router-link");return O(),$("section",S5,[S("div",E5,[S("div",w5,[S("div",k5,[S("div",C5,[S("ul",null,[(O(!0),$(ht,null,ce(n.links,l=>(O(),vt(a,{key:l.to.name,to:{name:l.to.name},custom:""},{default:D(({navigate:c,isActive:u})=>[S("li",{class:qt({"is-active":u})},[S("a",{onClick:c,onKeypress:qv(c,["enter"])},[l.icon?(O(),vt(o,{key:0,class:"icon is-small",name:l.icon},null,8,["name"])):bt("",!0),S("span",{class:qt({"is-hidden-mobile":l.icon}),textContent:j(t.$t(l.key))},null,10,A5)],40,T5)],2)]),_:2},1032,["to"]))),128))])])])])])])}const Yp=it(v5,[["render",O5],["__scopeId","data-v-5c0ac09b"]]),x5={name:"TabsMusic",components:{ControlTabList:Yp},setup(){return{servicesStore:je()}},computed:{links(){const t=[{to:{name:"music-history"},icon:"history",key:"page.music.tabs.history"},{to:{name:"music-artists"},icon:"account-music",key:"page.music.tabs.artists"},{to:{name:"music-albums"},icon:"album",key:"page.music.tabs.albums"},{to:{name:"music-genres"},icon:"speaker",key:"page.music.tabs.genres"},{to:{name:"music-composers"},icon:"book-open-page-variant",key:"page.music.tabs.composers"}];return this.servicesStore.spotify.webapi_token_valid&&t.push({to:{name:"music-spotify"},icon:"spotify",key:"page.music.tabs.spotify"}),t}}};function I5(t,e,n,s,i,r){const o=C("control-tab-list");return O(),vt(o,{links:r.links},null,8,["links"])}const qs=it(x5,[["render",I5]]),sy={load(t){return tt.library_albums("music")},set(t,e){t.albums_list=new Tt(e.data)}},N5={name:"PageAlbums",components:{ContentWithHeading:ne,ControlDropdown:Dr,ControlSwitch:Rr,HeadingTitle:se,IndexButtonList:Is,ListAlbums:Gn,TabsMusic:qs},beforeRouteEnter(t,e,n){sy.load(t).then(s=>{n(i=>sy.set(i,s))})},setup(){return{uiStore:Un(),servicesStore:je()}},data(){return{albums_list:new Tt,groupings:[{id:1,name:this.$t("page.albums.sort.name"),options:{index:{field:"name_sort",type:String}}},{id:2,name:this.$t("page.albums.sort.recently-added"),options:{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}}},{id:3,name:this.$t("page.albums.sort.recently-released"),options:{criteria:[{field:"date_released",order:-1,type:Date}],index:{field:"date_released",type:Date}}},{id:4,name:this.$t("page.albums.sort.artist-name"),options:{criteria:[{field:"artist",type:String},{field:"name_sort",type:String}],index:{field:"artist",type:String}}},{id:5,name:this.$t("page.albums.sort.artist-date"),options:{criteria:[{field:"artist",type:String},{field:"date_released",type:Date}],index:{field:"artist",type:String}}}]}},computed:{albums(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.albums_sort);return t.filters=[e=>!this.uiStore.hide_singles||e.track_count>2,e=>!this.uiStore.hide_spotify||e.data_kind!=="spotify"],this.albums_list.group(t)},heading(){return{title:this.$t("page.albums.title"),subtitle:[{key:"count.albums",count:this.albums.count}]}},spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid}}},P5={class:"columns"},R5={class:"column"},L5=["textContent"],D5=["textContent"],$5=["textContent"],M5=["textContent"],F5=["textContent"],V5={class:"column"},H5=["textContent"];function U5(t,e,n,s,i,r){const o=C("tabs-music"),a=C("index-button-list"),l=C("control-switch"),c=C("control-dropdown"),u=C("heading-title"),d=C("list-albums"),f=C("content-with-heading");return O(),$("div",null,[E(o),E(f,null,{options:D(()=>[E(a,{indices:r.albums.indices},null,8,["indices"]),S("div",P5,[S("div",R5,[S("div",{class:"is-size-7 is-uppercase",textContent:j(t.$t("page.albums.filter"))},null,8,L5),E(l,{modelValue:s.uiStore.hide_singles,"onUpdate:modelValue":e[0]||(e[0]=h=>s.uiStore.hide_singles=h)},{label:D(()=>[S("span",{textContent:j(t.$t("page.albums.hide-singles"))},null,8,D5)]),help:D(()=>[S("span",{textContent:j(t.$t("page.albums.hide-singles-help"))},null,8,$5)]),_:1},8,["modelValue"]),r.spotify_enabled?(O(),vt(l,{key:0,modelValue:s.uiStore.hide_spotify,"onUpdate:modelValue":e[1]||(e[1]=h=>s.uiStore.hide_spotify=h)},{label:D(()=>[S("span",{textContent:j(t.$t("page.albums.hide-spotify"))},null,8,M5)]),help:D(()=>[S("span",{textContent:j(t.$t("page.albums.hide-spotify-help"))},null,8,F5)]),_:1},8,["modelValue"])):bt("",!0)]),S("div",V5,[S("div",{class:"is-size-7 is-uppercase",textContent:j(t.$t("page.albums.sort.title"))},null,8,H5),E(c,{value:s.uiStore.albums_sort,"onUpdate:value":e[2]||(e[2]=h=>s.uiStore.albums_sort=h),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[E(u,{content:r.heading},null,8,["content"])]),content:D(()=>[E(d,{items:r.albums},null,8,["items"])]),_:1})])}const j5=it(N5,[["render",U5]]),B5={name:"ModalDialogArtist",components:{ModalDialogPlayable:xs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item.name,handler:this.open,uri:this.item.uri,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.$filters.toDateTime(this.item.time_added)}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"music-artist",params:{id:this.item.id}})}}};function W5(t,e,n,s,i,r){const o=C("modal-dialog-playable");return O(),vt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const fd=it(B5,[["render",W5]]),iy={load(t){return Promise.all([tt.library_artist(t.params.id),tt.library_artist_albums(t.params.id)])},set(t,e){t.artist=e[0].data,t.albums_list=new Tt(e[1].data)}},q5={name:"PageArtist",components:{ContentWithHeading:ne,ControlButton:Qe,ControlDropdown:Dr,ControlSwitch:Rr,HeadingTitle:se,ListAlbums:Gn,ModalDialogArtist:fd},beforeRouteEnter(t,e,n){iy.load(t).then(s=>{n(i=>iy.set(i,s))})},setup(){return{servicesStore:je(),uiStore:Un()}},data(){return{albums_list:new Tt,artist:{},groupings:[{id:1,name:this.$t("page.artist.sort.name"),options:{criteria:[{field:"name_sort",type:String}]}},{id:2,name:this.$t("page.artist.sort.release-date"),options:{criteria:[{field:"date_released",type:Date}]}}],show_details_modal:!1}},computed:{albums(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artist_albums_sort);return t.filters=[e=>!this.uiStore.hide_spotify||e.data_kind!=="spotify"],this.albums_list.group(t)},heading(){return{title:this.artist.name,subtitle:[{key:"count.albums",count:this.albums.count},{handler:this.open_tracks,key:"count.tracks",count:this.track_count}]}},spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid},track_count(){return[...this.albums].reduce((t,e)=>t+(e.isItem?e.item.track_count:0),0)}},methods:{open_tracks(){this.$router.push({name:"music-artist-tracks",params:{id:this.artist.id}})},play(){tt.player_play_uri(this.albums.items.map(t=>t.uri).join(),!0)},showDetails(){this.show_details_modal=!0}}},G5={class:"columns"},z5={class:"column"},K5=["textContent"],X5=["textContent"],Y5=["textContent"],Z5={class:"column"},J5=["textContent"];function Q5(t,e,n,s,i,r){const o=C("control-switch"),a=C("control-dropdown"),l=C("heading-title"),c=C("control-button"),u=C("list-albums"),d=C("modal-dialog-artist"),f=C("content-with-heading");return O(),$("div",null,[E(f,null,{options:D(()=>[S("div",G5,[S("div",z5,[S("div",{class:"is-size-7 is-uppercase",textContent:j(t.$t("page.artist.filter"))},null,8,K5),r.spotify_enabled?(O(),vt(o,{key:0,modelValue:s.uiStore.hide_spotify,"onUpdate:modelValue":e[0]||(e[0]=h=>s.uiStore.hide_spotify=h)},{label:D(()=>[S("span",{textContent:j(t.$t("page.artist.hide-spotify"))},null,8,X5)]),help:D(()=>[S("span",{textContent:j(t.$t("page.artist.hide-spotify-help"))},null,8,Y5)]),_:1},8,["modelValue"])):bt("",!0)]),S("div",Z5,[S("div",{class:"is-size-7 is-uppercase",textContent:j(t.$t("page.artist.sort.title"))},null,8,J5),E(a,{value:s.uiStore.artist_albums_sort,"onUpdate:value":e[1]||(e[1]=h=>s.uiStore.artist_albums_sort=h),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[E(l,{content:r.heading},null,8,["content"])]),"heading-right":D(()=>[E(c,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"]),E(c,{button:{handler:r.play,icon:"shuffle",key:"page.artist.shuffle"}},null,8,["button"])]),content:D(()=>[E(u,{items:r.albums},null,8,["items"]),E(d,{item:i.artist,show:i.show_details_modal,onClose:e[2]||(e[2]=h=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const t6=it(q5,[["render",Q5]]),e6={name:"ListAlbumsSpotify",components:{ControlImage:tr,ModalDialogAlbumSpotify:fS},props:{items:{required:!0,type:Object}},setup(){return{settingsStore:bi()}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(t){this.$router.push({name:"music-spotify-album",params:{id:t.id}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},n6=["onClick"],s6={class:"media-content"},i6=["textContent"],r6=["textContent"],o6=["textContent"],a6={class:"media-right"},l6=["onClick"];function c6(t,e,n,s,i,r){const o=C("control-image"),a=C("mdicon"),l=C("modal-dialog-album-spotify");return O(),$(ht,null,[(O(!0),$(ht,null,ce(n.items,c=>{var u,d,f;return O(),$("div",{key:c.id,class:"media is-align-items-center is-clickable mb-0",onClick:h=>r.open(c)},[s.settingsStore.show_cover_artwork_in_album_lists?(O(),vt(o,{key:0,url:((d=(u=c.images)==null?void 0:u[0])==null?void 0:d.url)??"",artist:c.artist,album:c.name,class:"media-left is-small"},null,8,["url","artist","album"])):bt("",!0),S("div",s6,[S("div",{class:"is-size-6 has-text-weight-bold",textContent:j(c.name)},null,8,i6),S("div",{class:"is-size-7 has-text-weight-bold has-text-grey",textContent:j((f=c.artists[0])==null?void 0:f.name)},null,8,r6),S("div",{class:"is-size-7 has-text-grey",textContent:j(t.$filters.toDate(c.release_date))},null,8,o6)]),S("div",a6,[S("a",{onClick:Ie(h=>r.open_dialog(c),["prevent","stop"])},[E(a,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,l6)])],8,n6)}),128)),(O(),vt(fs,{to:"#app"},[E(l,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=c=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const qa=it(e6,[["render",c6]]),u6={name:"ModalDialogArtistSpotify",components:{ModalDialogPlayable:xs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t,e;return{name:this.item.name,handler:this.open,uri:this.item.uri,properties:[{key:"property.popularity",value:[this.item.popularity,(t=this.item.followers)==null?void 0:t.total].join(" / ")},{key:"property.genres",value:(e=this.item.genres)==null?void 0:e.join(", ")}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"music-spotify-artist",params:{id:this.item.id}})}}};function d6(t,e,n,s,i,r){const o=C("modal-dialog-playable");return O(),vt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const hS=it(u6,[["render",d6]]);function f6(t){return t.scrollHeight}function h6(t){return t.scrollWidth}function p6(t,e){t.scrollTop=t.scrollHeight-e+t.scrollTop}function m6(t,e){t.scrollLeft=t.scrollWidth-e+t.scrollLeft}const g6=S("div",{class:"loading"},"Loading...",-1),b6=S("div",{class:"no-more"},"No more.",-1),y6=S("div",{class:"no-results"},"No results.",-1),_6=S("div",{class:"error"},"Error.",-1),Zp=pi({__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=rs();let i=rs("loading"),r=rs(n.isInitial),o=0;function a(){Pr(()=>{var g,_;n.position==="top"?p6((g=n.container)!=null?g:document.documentElement,o):n.position==="left"&&m6((_=n.container)!=null?_:document.documentElement,o)})}function l(g,_){return g===0?r.value?(u(),"no-results"):(c(),"no-more"):g!==void 0&&_!==void 0&&g<_?(c(),"no-more"):(r.value=!1,a(),y(),"loading")}function c(){r.value=!1,p("no-more"),a()}function u(){r.value=!1,p("no-results"),a()}function d(){r.value=!1,p("error"),a()}function f(){r.value=!0,p("loading"),y()}function h(){p("loading"),y()}function p(g){i.value=g}function m(){s.value&&v.unobserve(s.value)}function y(){s.value&&v.observe(s.value)}function b(){return new IntersectionObserver(([g])=>{var _,w;g.isIntersecting&&(n.position==="top"?o=f6((_=n.container)!=null?_:document.documentElement):n.position==="left"&&(o=h6((w=n.container)!=null?w: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"&&fv(()=>{v&&m(),v=b(),y()},{flush:"post"}),Kn(()=>n.isInitial,g=>{g&&f()}),Kn(r,g=>{g||e("update:isInitial",!1)}),(g,_)=>(O(),$("div",{class:"vue-eternal-loading",ref_key:"rootRef",ref:s},[Mn(i)==="loading"?be(g.$slots,"loading",eo(so({key:0},{isFirstLoad:Mn(r)})),()=>[g6]):Mn(i)==="no-more"?be(g.$slots,"no-more",eo(so({key:1},{retry:h})),()=>[b6]):Mn(i)==="no-results"?be(g.$slots,"no-results",eo(so({key:2},{retry:h})),()=>[y6]):Mn(i)==="error"?be(g.$slots,"error",eo(so({key:3},{retry:h})),()=>[_6]):bt("",!0)],512))}}),hh=50,ry={load(t){const e=new Ws;return e.setAccessToken(je().spotify.webapi_token),Promise.all([e.getArtist(t.params.id),e.getArtistAlbums(t.params.id,{include_groups:"album,single",limit:hh,market:je().spotify.webapi_country,offset:0})])},set(t,e){t.artist=e.shift(),t.albums=[],t.total=0,t.offset=0,t.append_albums(e.shift())}},v6={name:"PageArtistSpotify",components:{ContentWithHeading:ne,ControlButton:Qe,HeadingTitle:se,ListAlbumsSpotify:qa,ModalDialogArtistSpotify:hS,VueEternalLoading:Zp},beforeRouteEnter(t,e,n){ry.load(t).then(s=>{n(i=>ry.set(i,s))})},setup(){return{servicesStore:je()}},data(){return{albums:[],artist:{},offset:0,show_details_modal:!1,total:0}},computed:{heading(){return{title:this.$t("artist.name"),subtitle:[{key:"count.albums",count:this.total}]}}},methods:{append_albums(t){this.albums=this.albums.concat(t.items),this.total=t.total,this.offset+=t.limit},load_next({loaded:t}){const e=new Ws;e.setAccessToken(this.servicesStore.spotify.webapi_token),e.getArtistAlbums(this.artist.id,{include_groups:"album,single",limit:hh,offset:this.offset}).then(n=>{this.append_albums(n),t(n.items.length,hh)})},play(){this.show_album_details_modal=!1,tt.player_play_uri(this.artist.uri,!0)},showDetails(){this.show_details_modal=!0}}},S6={class:"columns is-centered"},E6={class:"column has-text-centered"};function w6(t,e,n,s,i,r){const o=C("heading-title"),a=C("control-button"),l=C("list-albums-spotify"),c=C("mdicon"),u=C("vue-eternal-loading"),d=C("modal-dialog-artist-spotify"),f=C("content-with-heading");return O(),$("div",null,[E(f,null,{"heading-left":D(()=>[E(o,{content:r.heading},null,8,["content"])]),"heading-right":D(()=>[E(a,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"shuffle",key:"page.spotify.artist.shuffle"}},null,8,["button"])]),content:D(()=>[E(l,{items:i.albums},null,8,["items"]),i.offset[S("div",S6,[S("div",E6,[E(c,{class:"icon mdi-spin",name:"loading"})])])]),"no-more":D(()=>e[1]||(e[1]=[S("br",null,null,-1)])),"no-results":D(()=>e[2]||(e[2]=[S("br",null,null,-1)])),_:1},8,["load"])):bt("",!0),E(d,{item:i.artist,show:i.show_details_modal,onClose:e[0]||(e[0]=h=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const k6=it(v6,[["render",w6]]),oy={load(t){return Promise.all([tt.library_artist(t.params.id),tt.library_artist_tracks(t.params.id)])},set(t,e){t.artist=e[0].data,t.tracks_list=new Tt(e[1].data.tracks)}},C6={name:"PageArtistTracks",components:{ContentWithHeading:ne,ControlButton:Qe,ControlDropdown:Dr,ControlSwitch:Rr,HeadingTitle:se,IndexButtonList:Is,ListTracks:Hn,ModalDialogArtist:fd},beforeRouteEnter(t,e,n){oy.load(t).then(s=>{n(i=>oy.set(i,s))})},setup(){return{servicesStore:je(),uiStore:Un()}},data(){return{artist:{},groupings:[{id:1,name:this.$t("page.artist.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("page.artist.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}],show_details_modal:!1,tracks_list:new Tt}},computed:{album_count(){return new Set([...this.tracks].filter(t=>t.isItem).map(t=>t.item.album_id)).size},heading(){return{title:this.artist.name,subtitle:[{handler:this.openArtist,key:"count.albums",count:this.album_count},{key:"count.tracks",count:this.tracks.count}]}},spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid},track_uris(){return this.tracks_list.items.map(t=>t.uri).join()},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artist_tracks_sort);return t.filters=[e=>!this.uiStore.hide_spotify||e.data_kind!=="spotify"],this.tracks_list.group(t)}},methods:{openArtist(){this.show_details_modal=!1,this.$router.push({name:"music-artist",params:{id:this.artist.id}})},play(){tt.player_play_uri(this.tracks_list.items.map(t=>t.uri).join(),!0)},showDetails(){this.show_details_modal=!0}}},T6={class:"columns"},A6={class:"column"},O6=["textContent"],x6=["textContent"],I6=["textContent"],N6={class:"column"},P6=["textContent"];function R6(t,e,n,s,i,r){const o=C("index-button-list"),a=C("control-switch"),l=C("control-dropdown"),c=C("heading-title"),u=C("control-button"),d=C("list-tracks"),f=C("modal-dialog-artist"),h=C("content-with-heading");return O(),$("div",null,[E(h,null,{options:D(()=>[E(o,{indices:r.tracks.indices},null,8,["indices"]),S("div",T6,[S("div",A6,[S("p",{class:"is-size-7 is-uppercase",textContent:j(t.$t("page.artist.filter"))},null,8,O6),r.spotify_enabled?(O(),vt(a,{key:0,modelValue:s.uiStore.hide_spotify,"onUpdate:modelValue":e[0]||(e[0]=p=>s.uiStore.hide_spotify=p)},{label:D(()=>[S("span",{textContent:j(t.$t("page.artist.hide-spotify"))},null,8,x6)]),help:D(()=>[S("span",{textContent:j(t.$t("page.artist.hide-spotify-help"))},null,8,I6)]),_:1},8,["modelValue"])):bt("",!0)]),S("div",N6,[S("p",{class:"is-size-7 is-uppercase",textContent:j(t.$t("page.artist.sort.title"))},null,8,P6),E(l,{value:s.uiStore.artist_tracks_sort,"onUpdate:value":e[1]||(e[1]=p=>s.uiStore.artist_tracks_sort=p),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[E(c,{content:r.heading},null,8,["content"])]),"heading-right":D(()=>[E(u,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"]),E(u,{button:{handler:r.play,icon:"shuffle",key:"page.artist.shuffle"}},null,8,["button"])]),content:D(()=>[E(d,{items:r.tracks,uris:r.track_uris},null,8,["items","uris"]),E(f,{item:i.artist,show:i.show_details_modal,onClose:e[2]||(e[2]=p=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const L6=it(C6,[["render",R6]]),D6={name:"ListArtists",components:{ModalDialogArtist:fd},props:{items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(t){this.selected_item=t;const e=t.media_kind==="audiobook"?"audiobooks-artist":"music-artist";this.$router.push({name:e,params:{id:t.id}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},$6={key:0,class:"py-5"},M6=["id","textContent"],F6=["onClick"],V6={class:"media-content"},H6=["textContent"],U6={class:"media-right"},j6=["onClick"];function B6(t,e,n,s,i,r){const o=C("mdicon"),a=C("modal-dialog-artist");return O(),$(ht,null,[(O(!0),$(ht,null,ce(n.items,l=>(O(),$(ht,{key:l.itemId},[l.isItem?(O(),$("div",{key:1,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l.item)},[S("div",V6,[S("p",{class:"title is-6",textContent:j(l.item.name)},null,8,H6)]),S("div",U6,[S("a",{onClick:Ie(c=>r.open_dialog(l.item),["prevent","stop"])},[E(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,j6)])],8,F6)):(O(),$("div",$6,[S("span",{id:`index_${l.index}`,class:"tag is-small has-text-weight-bold",textContent:j(l.index)},null,8,M6)]))],64))),128)),(O(),vt(fs,{to:"#app"},[E(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const Xc=it(D6,[["render",B6]]),ay={load(t){return tt.library_artists("music")},set(t,e){t.artists_list=new Tt(e.data)}},W6={name:"PageArtists",components:{ContentWithHeading:ne,ControlDropdown:Dr,ControlSwitch:Rr,HeadingTitle:se,IndexButtonList:Is,ListArtists:Xc,TabsMusic:qs},beforeRouteEnter(t,e,n){ay.load(t).then(s=>{n(i=>ay.set(i,s))})},setup(){return{servicesStore:je(),uiStore:Un()}},data(){return{artists_list:new Tt,groupings:[{id:1,name:this.$t("page.artists.sort.name"),options:{index:{field:"name_sort",type:String}}},{id:2,name:this.$t("page.artists.sort.recently-added"),options:{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}}}]}},computed:{artists(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artists_sort);return t.filters=[e=>!this.uiStore.hide_singles||e.track_count>e.album_count*2,e=>!this.uiStore.hide_spotify||e.data_kind!=="spotify"],this.artists_list.group(t)},heading(){return{title:this.$t("page.artists.title"),subtitle:[{key:"count.artists",count:this.artists.count}]}},spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid}}},q6={class:"columns"},G6={class:"column"},z6=["textContent"],K6=["textContent"],X6=["textContent"],Y6={key:0,class:"field"},Z6=["textContent"],J6=["textContent"],Q6={class:"column"},tF=["textContent"];function eF(t,e,n,s,i,r){const o=C("tabs-music"),a=C("index-button-list"),l=C("control-switch"),c=C("control-dropdown"),u=C("heading-title"),d=C("list-artists"),f=C("content-with-heading");return O(),$("div",null,[E(o),E(f,null,{options:D(()=>[E(a,{indices:r.artists.indices},null,8,["indices"]),S("div",q6,[S("div",G6,[S("div",{class:"is-size-7 is-uppercase",textContent:j(t.$t("page.artists.filter"))},null,8,z6),E(l,{modelValue:s.uiStore.hide_singles,"onUpdate:modelValue":e[0]||(e[0]=h=>s.uiStore.hide_singles=h)},{label:D(()=>[S("span",{textContent:j(t.$t("page.artists.hide-singles"))},null,8,K6)]),help:D(()=>[S("span",{textContent:j(t.$t("page.artists.hide-singles-help"))},null,8,X6)]),_:1},8,["modelValue"]),r.spotify_enabled?(O(),$("div",Y6,[E(l,{modelValue:s.uiStore.hide_spotify,"onUpdate:modelValue":e[1]||(e[1]=h=>s.uiStore.hide_spotify=h)},{label:D(()=>[S("span",{textContent:j(t.$t("page.artists.hide-spotify"))},null,8,Z6)]),help:D(()=>[S("span",{textContent:j(t.$t("page.artists.hide-spotify-help"))},null,8,J6)]),_:1},8,["modelValue"])])):bt("",!0)]),S("div",Q6,[S("div",{class:"is-size-7 is-uppercase",textContent:j(t.$t("page.artists.sort.title"))},null,8,tF),E(c,{value:s.uiStore.artists_sort,"onUpdate:value":e[2]||(e[2]=h=>s.uiStore.artists_sort=h),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[E(u,{content:r.heading},null,8,["content"])]),content:D(()=>[E(d,{items:r.artists},null,8,["items"])]),_:1})])}const nF=it(W6,[["render",eF]]),ly={load(t){return Promise.all([tt.library_album(t.params.id),tt.library_album_tracks(t.params.id)])},set(t,e){t.album=e[0].data,t.tracks=new Tt(e[1].data)}},sF={name:"PageAudiobooksAlbum",components:{ContentWithHero:ud,ControlButton:Qe,ControlImage:tr,ListTracks:Hn,ModalDialogAlbum:dd},beforeRouteEnter(t,e,n){ly.load(t).then(s=>{n(i=>ly.set(i,s))})},data(){return{album:{},show_details_modal:!1,tracks:new Tt}},methods:{openArtist(){this.show_details_modal=!1,this.$router.push({name:"audiobooks-artist",params:{id:this.album.artist_id}})},play(){tt.player_play_uri(this.album.uri,!1)},showDetails(){this.show_details_modal=!0}}},iF=["textContent"],rF={class:"subtitle is-6"},oF=["textContent"],aF=["textContent"],lF={class:"buttons is-centered-mobile mt-5"};function cF(t,e,n,s,i,r){const o=C("control-button"),a=C("control-image"),l=C("list-tracks"),c=C("modal-dialog-album"),u=C("content-with-hero");return O(),$("div",null,[E(u,null,{"heading-left":D(()=>[S("div",{class:"title is-5",textContent:j(i.album.name)},null,8,iF),S("div",rF,[S("a",{onClick:e[0]||(e[0]=(...d)=>r.openArtist&&r.openArtist(...d)),textContent:j(i.album.artist)},null,8,oF)]),S("div",{class:"is-size-7 is-uppercase has-text-centered-mobile",textContent:j(t.$t("count.tracks",{count:i.album.track_count}))},null,8,aF),S("div",lF,[E(o,{button:{handler:r.play,icon:"play",key:"page.audiobooks.album.play"}},null,8,["button"]),E(o,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"])])]),"heading-right":D(()=>[E(a,{url:i.album.artwork_url,artist:i.album.artist,album:i.album.name,class:"is-clickable is-medium",onClick:r.showDetails},null,8,["url","artist","album","onClick"])]),content:D(()=>[E(l,{items:i.tracks,show_progress:!0,uris:i.album.uri},null,8,["items","uris"]),E(c,{item:i.album,show:i.show_details_modal,media_kind:"audiobook",onClose:e[1]||(e[1]=d=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const uF=it(sF,[["render",cF]]),dF={name:"TabsAudiobooks",components:{ControlTabList:Yp},computed:{links(){return[{to:{name:"audiobooks-artists"},icon:"account-music",key:"page.audiobooks.tabs.authors"},{to:{name:"audiobooks-albums"},icon:"album",key:"page.audiobooks.tabs.audiobooks"},{to:{name:"audiobooks-genres"},icon:"speaker",key:"page.audiobooks.tabs.genres"}]}}};function fF(t,e,n,s,i,r){const o=C("control-tab-list");return O(),vt(o,{links:r.links},null,8,["links"])}const Jp=it(dF,[["render",fF]]),cy={load(t){return tt.library_albums("audiobook")},set(t,e){t.albums=new Tt(e.data,{index:{field:"name_sort",type:String}})}},hF={name:"PageAudiobooksAlbums",components:{ContentWithHeading:ne,IndexButtonList:Is,ListAlbums:Gn,TabsAudiobooks:Jp,HeadingTitle:se},beforeRouteEnter(t,e,n){cy.load(t).then(s=>{n(i=>cy.set(i,s))})},data(){return{albums:new Tt}},computed:{heading(){return{title:this.$t("page.audiobooks.albums.title"),subtitle:[{key:"count.audiobooks",count:this.albums.count}]}}}};function pF(t,e,n,s,i,r){const o=C("tabs-audiobooks"),a=C("index-button-list"),l=C("heading-title"),c=C("list-albums"),u=C("content-with-heading");return O(),$("div",null,[E(o),E(u,null,{options:D(()=>[E(a,{indices:i.albums.indices},null,8,["indices"])]),"heading-left":D(()=>[E(l,{content:r.heading},null,8,["content"])]),content:D(()=>[E(c,{items:i.albums},null,8,["items"])]),_:1})])}const mF=it(hF,[["render",pF]]),uy={load(t){return Promise.all([tt.library_artist(t.params.id),tt.library_artist_albums(t.params.id)])},set(t,e){t.artist=e[0].data,t.albums=new Tt(e[1].data)}},gF={name:"PageAudiobooksArtist",components:{ContentWithHeading:ne,ControlButton:Qe,HeadingTitle:se,ListAlbums:Gn,ModalDialogArtist:fd},beforeRouteEnter(t,e,n){uy.load(t).then(s=>{n(i=>uy.set(i,s))})},data(){return{albums:new Tt,artist:{},show_details_modal:!1}},computed:{heading(){return this.artist.name?{title:this.artist.name,subtitle:[{key:"count.audiobooks",count:this.artist.album_count}]}:{}}},methods:{play(){tt.player_play_uri(this.albums.items.map(t=>t.uri).join(),!1)},showDetails(){this.show_details_modal=!0}}};function bF(t,e,n,s,i,r){const o=C("heading-title"),a=C("control-button"),l=C("list-albums"),c=C("modal-dialog-artist"),u=C("content-with-heading");return O(),$("div",null,[E(u,null,{"heading-left":D(()=>[E(o,{content:r.heading},null,8,["content"])]),"heading-right":D(()=>[E(a,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"play",key:"page.audiobooks.artist.play"}},null,8,["button"])]),content:D(()=>[E(l,{items:i.albums},null,8,["items"]),E(c,{item:i.artist,show:i.show_details_modal,onClose:e[0]||(e[0]=d=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const yF=it(gF,[["render",bF]]),dy={load(t){return tt.library_artists("audiobook")},set(t,e){t.artists=new Tt(e.data,{index:{field:"name_sort",type:String}})}},_F={name:"PageAudiobooksArtists",components:{ContentWithHeading:ne,HeadingTitle:se,IndexButtonList:Is,ListArtists:Xc,TabsAudiobooks:Jp},beforeRouteEnter(t,e,n){dy.load(t).then(s=>{n(i=>dy.set(i,s))})},data(){return{artists:new Tt}},computed:{heading(){return{title:this.$t("page.audiobooks.artists.title"),subtitle:[{key:"count.authors",count:this.artists.count}]}}}};function vF(t,e,n,s,i,r){const o=C("tabs-audiobooks"),a=C("index-button-list"),l=C("heading-title"),c=C("list-artists"),u=C("content-with-heading");return O(),$("div",null,[E(o),E(u,null,{options:D(()=>[E(a,{indices:i.artists.indices},null,8,["indices"])]),"heading-left":D(()=>[E(l,{content:r.heading},null,8,["content"])]),content:D(()=>[E(c,{items:i.artists},null,8,["items"])]),_:1})])}const SF=it(_F,[["render",vF]]),EF={name:"ModalDialogGenre",components:{ModalDialogPlayable:xs},props:{item:{required:!0,type:Object},media_kind:{required:!0,type:String},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item.name,handler:this.open,expression:`genre is "${this.item.name}" and media_kind is ${this.media_kind}`,properties:[{key:"property.albums",value:this.item.album_count},{key:"property.tracks",value:this.item.track_count},{key:"property.duration",value:this.$filters.toTimecode(this.item.length_ms)}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"genre-albums",params:{name:this.item.name},query:{media_kind:this.media_kind}})}}};function wF(t,e,n,s,i,r){const o=C("modal-dialog-playable");return O(),vt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const Qp=it(EF,[["render",wF]]),kF={name:"ListGenres",components:{ModalDialogGenre:Qp},props:{items:{required:!0,type:Object},media_kind:{required:!0,type:String}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(t){this.$router.push({name:"genre-albums",params:{name:t.name},query:{media_kind:this.media_kind}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},CF={key:0,class:"py-5"},TF={class:"media-content"},AF=["id","textContent"],OF=["onClick"],xF={class:"media-content"},IF=["textContent"],NF={class:"media-right"},PF=["onClick"];function RF(t,e,n,s,i,r){const o=C("mdicon"),a=C("modal-dialog-genre");return O(),$(ht,null,[(O(!0),$(ht,null,ce(n.items,l=>(O(),$(ht,{key:l.itemId},[l.isItem?(O(),$("div",{key:1,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l.item)},[S("div",xF,[S("p",{class:"title is-6",textContent:j(l.item.name)},null,8,IF)]),S("div",NF,[S("a",{onClick:Ie(c=>r.open_dialog(l.item),["prevent","stop"])},[E(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,PF)])],8,OF)):(O(),$("div",CF,[S("div",TF,[S("span",{id:`index_${l.index}`,class:"tag is-small has-text-weight-bold",textContent:j(l.index)},null,8,AF)])]))],64))),128)),(O(),vt(fs,{to:"#app"},[E(a,{item:i.selected_item,media_kind:n.media_kind,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","media_kind","show"])]))],64)}const pS=it(kF,[["render",RF]]),fy={load(t){return tt.library_genres("audiobook")},set(t,e){t.genres=new Tt(e.data.genres,{index:{field:"name_sort",type:String}})}},LF={name:"PageAudiobooksGenres",components:{ContentWithHeading:ne,HeadingTitle:se,IndexButtonList:Is,ListGenres:pS,TabsAudiobooks:Jp},beforeRouteEnter(t,e,n){fy.load(t).then(s=>{n(i=>fy.set(i,s))})},data(){return{genres:new Tt}},computed:{heading(){return{title:this.$t("page.genres.title"),subtitle:[{key:"count.genres",count:this.genres.total}]}}}};function DF(t,e,n,s,i,r){const o=C("tabs-audiobooks"),a=C("index-button-list"),l=C("heading-title"),c=C("list-genres"),u=C("content-with-heading");return O(),$("div",null,[E(o),E(u,null,{options:D(()=>[E(a,{indices:i.genres.indices},null,8,["indices"])]),"heading-left":D(()=>[E(l,{content:r.heading},null,8,["content"])]),content:D(()=>[E(c,{items:i.genres,media_kind:"audiobook"},null,8,["items"])]),_:1})])}const $F=it(LF,[["render",DF]]),MF={name:"ModalDialogComposer",components:{ModalDialogPlayable:xs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item.name,handler:this.open_albums,expression:`composer is "${this.item.name}" and media_kind is music`,properties:[{key:"property.albums",value:this.item.album_count,handler:this.open_albums},{key:"property.tracks",value:this.item.track_count,handler:this.open_tracks},{key:"property.duration",value:this.$filters.toTimecode(this.item.length_ms)}]}}},methods:{open_albums(){this.$emit("close"),this.$router.push({name:"music-composer-albums",params:{name:this.item.name}})},open_tracks(){this.$emit("close"),this.$router.push({name:"music-composer-tracks",params:{name:this.item.name}})}}};function FF(t,e,n,s,i,r){const o=C("modal-dialog-playable");return O(),vt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const tm=it(MF,[["render",FF]]),hy={load(t){return Promise.all([tt.library_composer(t.params.name),tt.library_composer_albums(t.params.name)])},set(t,e){t.composer=e[0].data,t.albums=new Tt(e[1].data.albums)}},VF={name:"PageComposerAlbums",components:{ContentWithHeading:ne,ControlButton:Qe,HeadingTitle:se,ListAlbums:Gn,ModalDialogComposer:tm},beforeRouteEnter(t,e,n){hy.load(t).then(s=>{n(i=>hy.set(i,s))})},data(){return{albums:new Tt,composer:{},show_details_modal:!1}},computed:{expression(){return`composer is "${this.composer.name}" and media_kind is music`},heading(){return{title:this.composer.name,subtitle:[{key:"count.albums",count:this.composer.album_count},{handler:this.open_tracks,key:"count.tracks",count:this.composer.track_count}]}}},methods:{open_tracks(){this.$router.push({name:"music-composer-tracks",params:{name:this.composer.name}})},play(){tt.player_play_expression(this.expression,!0)},showDetails(){this.show_details_modal=!0}}};function HF(t,e,n,s,i,r){const o=C("heading-title"),a=C("control-button"),l=C("list-albums"),c=C("modal-dialog-composer"),u=C("content-with-heading");return O(),$("div",null,[E(u,null,{"heading-left":D(()=>[E(o,{content:r.heading},null,8,["content"])]),"heading-right":D(()=>[E(a,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"shuffle",key:"page.composer.shuffle"}},null,8,["button"])]),content:D(()=>[E(l,{items:i.albums},null,8,["items"]),E(c,{item:i.composer,show:i.show_details_modal,onClose:e[0]||(e[0]=d=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const UF=it(VF,[["render",HF]]),py={load(t){return Promise.all([tt.library_composer(t.params.name),tt.library_composer_tracks(t.params.name)])},set(t,e){t.composer=e[0].data,t.tracks_list=new Tt(e[1].data.tracks)}},jF={name:"PageComposerTracks",components:{ContentWithHeading:ne,ControlButton:Qe,ControlDropdown:Dr,HeadingTitle:se,IndexButtonList:Is,ListTracks:Hn,ModalDialogComposer:tm},beforeRouteEnter(t,e,n){py.load(t).then(s=>{n(i=>py.set(i,s))})},setup(){return{uiStore:Un()}},data(){return{composer:{},groupings:[{id:1,name:this.$t("page.composer.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("page.composer.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}],show_details_modal:!1,tracks_list:new Tt}},computed:{expression(){return`composer is "${this.composer.name}" and media_kind is music`},heading(){return{title:this.composer.name,subtitle:[{handler:this.open_albums,key:"count.albums",count:this.composer.album_count},{key:"count.tracks",count:composer.track_count}]}},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.composer_tracks_sort);return this.tracks_list.group(t)}},methods:{open_albums(){this.$router.push({name:"music-composer-albums",params:{name:this.composer.name}})},play(){tt.player_play_expression(this.expression,!0)},showDetails(){this.show_details_modal=!0}}},BF={class:"columns"},WF={class:"column"},qF=["textContent"];function GF(t,e,n,s,i,r){const o=C("index-button-list"),a=C("control-dropdown"),l=C("heading-title"),c=C("control-button"),u=C("list-tracks"),d=C("modal-dialog-composer"),f=C("content-with-heading");return O(),$("div",null,[E(f,null,{options:D(()=>[E(o,{indices:r.tracks.indices},null,8,["indices"]),S("div",BF,[S("div",WF,[S("div",{class:"is-size-7 is-uppercase",textContent:j(t.$t("page.artist.sort.title"))},null,8,qF),E(a,{value:s.uiStore.composer_tracks_sort,"onUpdate:value":e[0]||(e[0]=h=>s.uiStore.composer_tracks_sort=h),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[E(l,{content:r.heading},null,8,["content"])]),"heading-right":D(()=>[E(c,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"]),E(c,{button:{handler:r.play,icon:"shuffle",key:"page.composer.shuffle"}},null,8,["button"])]),content:D(()=>[E(u,{items:r.tracks,expression:r.expression},null,8,["items","expression"]),E(d,{item:i.composer,show:i.show_details_modal,onClose:e[1]||(e[1]=h=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const zF=it(jF,[["render",GF]]),KF={name:"ListComposers",components:{ModalDialogComposer:tm},props:{items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(t){this.selected_item=t,this.$router.push({name:"music-composer-albums",params:{name:t.name}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},XF={key:0,class:"py-5"},YF={class:"media-content"},ZF=["id","textContent"],JF=["onClick"],QF={class:"media-content"},tV=["textContent"],eV={class:"media-right"},nV=["onClick"];function sV(t,e,n,s,i,r){const o=C("mdicon"),a=C("modal-dialog-composer");return O(),$(ht,null,[(O(!0),$(ht,null,ce(n.items,l=>(O(),$(ht,{key:l.itemId},[l.isItem?(O(),$("div",{key:1,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l.item)},[S("div",QF,[S("p",{class:"title is-6",textContent:j(l.item.name)},null,8,tV)]),S("div",eV,[S("a",{onClick:Ie(c=>r.open_dialog(l.item),["prevent","stop"])},[E(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,nV)])],8,JF)):(O(),$("div",XF,[S("div",YF,[S("span",{id:`index_${l.index}`,class:"tag is-small has-text-weight-bold",textContent:j(l.index)},null,8,ZF)])]))],64))),128)),(O(),vt(fs,{to:"#app"},[E(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const ph=it(KF,[["render",sV]]),my={load(t){return tt.library_composers("music")},set(t,e){t.composers=new Tt(e.data,{index:{field:"name_sort",type:String}})}},iV={name:"PageComposers",components:{ContentWithHeading:ne,HeadingTitle:se,IndexButtonList:Is,ListComposers:ph,TabsMusic:qs},beforeRouteEnter(t,e,n){my.load(t).then(s=>{n(i=>my.set(i,s))})},data(){return{composers:new Tt}},computed:{heading(){return{title:this.$t("page.composers.title"),subtitle:[{key:"count.composers",count:this.composers.total}]}}}};function rV(t,e,n,s,i,r){const o=C("tabs-music"),a=C("index-button-list"),l=C("heading-title"),c=C("list-composers"),u=C("content-with-heading");return O(),$("div",null,[E(o),E(u,null,{options:D(()=>[E(a,{indices:i.composers.indices},null,8,["indices"])]),"heading-left":D(()=>[E(l,{content:r.heading},null,8,["content"])]),content:D(()=>[E(c,{items:i.composers},null,8,["items"])]),_:1})])}const oV=it(iV,[["render",rV]]),aV={name:"ModalDialogDirectory",components:{ModalDialogPlayable:xs},props:{item:{required:!0,type:String},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item,expression:`path starts with "${this.item}" order by path asc`}}}};function lV(t,e,n,s,i,r){const o=C("modal-dialog-playable");return O(),vt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const mS=it(aV,[["render",lV]]),cV={name:"ListDirectories",components:{ModalDialogDirectory:mS},props:{items:{required:!0,type:Array}},data(){return{selected_item:"",show_details_modal:!1}},computed:{directories(){var n;const t=[];let e="";return(n=this.$route.query)==null||n.directory.split("/").slice(1,-1).forEach((s,i)=>{e=`${e}/${s}`,t.push({index:i,name:s,path:e})}),t}},methods:{open(t){const e={name:"files"};t.index!==0&&(e.query={directory:t.path}),this.$router.push(e)},open_dialog(t){this.selected_item=t.path,this.show_details_modal=!0},open_parent(){this.open(this.directories.slice(-1).pop())}}},uV={key:0,class:"media is-align-items-center mb-0"},dV={class:"media-content"},fV={class:"breadcrumb"},hV=["onClick"],pV=["textContent"],mV={class:"media-right"},gV=["onClick"],bV={class:"media-content"},yV=["textContent"],_V={class:"media-right"},vV=["onClick"];function SV(t,e,n,s,i,r){const o=C("mdicon"),a=C("modal-dialog-directory");return O(),$(ht,null,[t.$route.query.directory?(O(),$("div",uV,[E(o,{class:"icon media-left is-clickable",name:"chevron-left",onClick:r.open_parent},null,8,["onClick"]),S("div",dV,[S("nav",fV,[S("ul",null,[(O(!0),$(ht,null,ce(r.directories,l=>(O(),$("li",{key:l.index},[S("a",{onClick:c=>r.open(l)},[S("span",{textContent:j(l.name)},null,8,pV)],8,hV)]))),128))])])]),S("div",mV,[be(t.$slots,"actions")])])):bt("",!0),(O(!0),$(ht,null,ce(n.items,l=>(O(),$("div",{key:l.path,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l)},[E(o,{class:"media-left icon",name:"folder"}),S("div",bV,[S("p",{class:"title is-6",textContent:j(l.name)},null,8,yV)]),S("div",_V,[S("a",{onClick:Ie(c=>r.open_dialog(l),["prevent","stop"])},[E(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,vV)])],8,gV))),128)),(O(),vt(fs,{to:"#app"},[E(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const EV=it(cV,[["render",SV]]),wV={name:"ModalDialogPlaylist",components:{ModalDialogPlayable:xs},props:{item:{required:!0,type:Object},show:Boolean,uris:{default:"",type:String}},emits:["close"],computed:{playable(){return{name:this.item.name,handler:this.open,uri:this.item.uri,uris:this.uris,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}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"playlist",params:{id:this.item.id}})}}};function kV(t,e,n,s,i,r){const o=C("modal-dialog-playable");return O(),vt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const gS=it(wV,[["render",kV]]),CV={name:"ListPlaylists",components:{ModalDialogPlaylist:gS},props:{items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!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}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},TV=["onClick"],AV={class:"media-content"},OV=["textContent"],xV={class:"media-right"},IV=["onClick"];function NV(t,e,n,s,i,r){const o=C("mdicon"),a=C("modal-dialog-playlist");return O(),$(ht,null,[(O(!0),$(ht,null,ce(n.items,l=>(O(),$("div",{key:l.itemId,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l.item)},[E(o,{class:"media-left icon",name:r.icon(l.item)},null,8,["name"]),S("div",AV,[S("p",{class:"title is-6",textContent:j(l.item.name)},null,8,OV)]),S("div",xV,[S("a",{onClick:Ie(c=>r.open_dialog(l.item),["prevent","stop"])},[E(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,IV)])],8,TV))),128)),(O(),vt(fs,{to:"#app"},[E(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const Yc=it(CV,[["render",NV]]),Fl={load(t){return t.query.directory?tt.library_files(t.query.directory):Promise.resolve()},set(t,e){e?t.directories=e.data.directories.map(n=>t.transform(n.path)):Cr().directories?t.directories=Cr().directories.map(n=>t.transform(n)):tt.config().then(n=>{t.directories=n.data.directories.map(s=>t.transform(s))}),t.playlists=new Tt(e==null?void 0:e.data.playlists),t.tracks=new Tt(e==null?void 0:e.data.tracks)}},PV={name:"PageFiles",components:{ContentWithHeading:ne,ControlButton:Qe,HeadingTitle:se,ListDirectories:EV,ListPlaylists:Yc,ListTracks:Hn,ModalDialogDirectory:mS},beforeRouteEnter(t,e,n){Fl.load(t).then(s=>{n(i=>Fl.set(i,s))})},beforeRouteUpdate(t,e,n){Fl.load(t).then(s=>{Fl.set(this,s),n()})},setup(){return{configurationStore:Cr()}},data(){return{directories:[],playlists:new Tt,show_details_modal:!1,tracks:new Tt}},computed:{current(){var t;return((t=this.$route.query)==null?void 0:t.directory)||"/"},expression(){return`path starts with "${this.current}" order by path asc`},name(){var t;return this.current!=="/"?(t=this.current)==null?void 0:t.slice(this.current.lastIndexOf("/")+1):this.$t("page.files.title")}},methods:{play(){tt.player_play_expression(this.expression,!1)},showDetails(){this.show_details_modal=!0},transform(t){return{name:t.slice(t.lastIndexOf("/")+1),path:t}}}};function RV(t,e,n,s,i,r){const o=C("heading-title"),a=C("control-button"),l=C("list-directories"),c=C("list-playlists"),u=C("list-tracks"),d=C("modal-dialog-directory"),f=C("content-with-heading");return O(),$("div",null,[E(f,null,{"heading-left":D(()=>[E(o,{content:{title:r.name}},null,8,["content"])]),"heading-right":D(()=>[E(a,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"play",key:"page.files.play"}},null,8,["button"])]),content:D(()=>[E(l,{items:i.directories},null,8,["items"]),E(c,{items:i.playlists},null,8,["items"]),E(u,{expression:r.expression,items:i.tracks,show_icon:!0},null,8,["expression","items"]),E(d,{item:r.current,show:i.show_details_modal,onClose:e[0]||(e[0]=h=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const LV=it(PV,[["render",RV]]),gy={load(t){return Promise.all([tt.library_genre(t.params.name,t.query.media_kind),tt.library_genre_albums(t.params.name,t.query.media_kind)])},set(t,e){t.genre=e[0].data.genres.items.shift(),t.albums=new Tt(e[1].data.albums,{index:{field:"name_sort",type:String}})}},DV={name:"PageGenreAlbums",components:{ContentWithHeading:ne,ControlButton:Qe,HeadingTitle:se,IndexButtonList:Is,ListAlbums:Gn,ModalDialogGenre:Qp},beforeRouteEnter(t,e,n){gy.load(t).then(s=>{n(i=>gy.set(i,s))})},data(){return{albums:new Tt,genre:{},media_kind:this.$route.query.media_kind,show_details_modal:!1}},computed:{heading(){return{title:this.genre.name,subtitle:[{key:"count.albums",count:this.genre.album_count},{handler:this.open_tracks,key:"count.tracks",count:this.genre.track_count}]}}},methods:{open_tracks(){this.show_details_modal=!1,this.$router.push({name:"genre-tracks",params:{name:this.genre.name},query:{media_kind:this.media_kind}})},play(){tt.player_play_expression(`genre is "${this.genre.name}" and media_kind is ${this.media_kind}`,!0)},showDetails(){this.show_details_modal=!0}}};function $V(t,e,n,s,i,r){const o=C("index-button-list"),a=C("heading-title"),l=C("control-button"),c=C("list-albums"),u=C("modal-dialog-genre"),d=C("content-with-heading");return O(),$("div",null,[E(d,null,{options:D(()=>[E(o,{indices:i.albums.indices},null,8,["indices"])]),"heading-left":D(()=>[E(a,{content:r.heading},null,8,["content"])]),"heading-right":D(()=>[E(l,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"]),E(l,{button:{handler:r.play,icon:"shuffle",key:"page.genre.shuffle"}},null,8,["button"])]),content:D(()=>[E(c,{items:i.albums},null,8,["items"]),E(u,{item:i.genre,media_kind:i.media_kind,show:i.show_details_modal,onClose:e[0]||(e[0]=f=>i.show_details_modal=!1)},null,8,["item","media_kind","show"])]),_:1})])}const MV=it(DV,[["render",$V]]),by={load(t){return Promise.all([tt.library_genre(t.params.name,t.query.media_kind),tt.library_genre_tracks(t.params.name,t.query.media_kind)])},set(t,e){t.genre=e[0].data.genres.items.shift(),t.tracks_list=new Tt(e[1].data.tracks)}},FV={name:"PageGenreTracks",components:{ContentWithHeading:ne,ControlButton:Qe,ControlDropdown:Dr,HeadingTitle:se,IndexButtonList:Is,ListTracks:Hn,ModalDialogGenre:Qp},beforeRouteEnter(t,e,n){by.load(t).then(s=>{n(i=>by.set(i,s))})},setup(){return{uiStore:Un()}},data(){return{genre:{},groupings:[{id:1,name:this.$t("page.genre.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("page.genre.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}],media_kind:this.$route.query.media_kind,show_details_modal:!1,tracks_list:new Tt}},computed:{expression(){return`genre is "${this.genre.name}" and media_kind is ${this.media_kind}`},heading(){return{title:this.genre.name,subtitle:[{handler:this.openGenre,key:"count.albums",count:this.genre.album_count},{key:"count.tracks",count:this.genre.track_count}]}},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.genre_tracks_sort);return this.tracks_list.group(t)}},methods:{openGenre(){this.show_details_modal=!1,this.$router.push({name:"genre-albums",params:{name:this.genre.name},query:{media_kind:this.media_kind}})},play(){tt.player_play_expression(this.expression,!0)},showDetails(){this.show_details_modal=!0}}},VV={class:"columns"},HV={class:"column"},UV=["textContent"];function jV(t,e,n,s,i,r){const o=C("index-button-list"),a=C("control-dropdown"),l=C("heading-title"),c=C("control-button"),u=C("list-tracks"),d=C("modal-dialog-genre"),f=C("content-with-heading");return O(),$("div",null,[E(f,null,{options:D(()=>[E(o,{indices:r.tracks.indices},null,8,["indices"]),S("div",VV,[S("div",HV,[S("div",{class:"is-size-7 is-uppercase",textContent:j(t.$t("page.genre.sort.title"))},null,8,UV),E(a,{value:s.uiStore.genre_tracks_sort,"onUpdate:value":e[0]||(e[0]=h=>s.uiStore.genre_tracks_sort=h),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[E(l,{content:r.heading},null,8,["content"])]),"heading-right":D(()=>[E(c,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"]),E(c,{button:{handler:r.play,icon:"shuffle",key:"page.genre.shuffle"}},null,8,["button"])]),content:D(()=>[E(u,{items:r.tracks,expression:r.expression},null,8,["items","expression"]),E(d,{item:i.genre,media_kind:i.media_kind,show:i.show_details_modal,onClose:e[1]||(e[1]=h=>i.show_details_modal=!1)},null,8,["item","media_kind","show"])]),_:1})])}const BV=it(FV,[["render",jV]]),yy={load(t){return tt.library_genres("music")},set(t,e){t.genres=new Tt(e.data.genres,{index:{field:"name_sort",type:String}})}},WV={name:"PageGenres",components:{ContentWithHeading:ne,HeadingTitle:se,IndexButtonList:Is,ListGenres:pS,TabsMusic:qs},beforeRouteEnter(t,e,n){yy.load(t).then(s=>{n(i=>yy.set(i,s))})},data(){return{genres:new Tt}},computed:{heading(){return{title:this.$t("page.genres.title"),subtitle:[{key:"count.genres",count:this.genres.total}]}}}};function qV(t,e,n,s,i,r){const o=C("tabs-music"),a=C("index-button-list"),l=C("heading-title"),c=C("list-genres"),u=C("content-with-heading");return O(),$("div",null,[E(o),E(u,null,{options:D(()=>[E(a,{indices:i.genres.indices},null,8,["indices"])]),"heading-left":D(()=>[E(l,{content:r.heading},null,8,["content"])]),content:D(()=>[E(c,{items:i.genres,media_kind:"music"},null,8,["items"])]),_:1})])}const GV=it(WV,[["render",qV]]),_y={load(t){return 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"})])},set(t,e){t.albums=new Tt(e[0].data.albums),t.tracks=new Tt(e[1].data.tracks)}},zV={name:"PageMusic",components:{ContentWithHeading:ne,HeadingTitle:se,ListAlbums:Gn,ListTracks:Hn,TabsMusic:qs},beforeRouteEnter(t,e,n){_y.load(t).then(s=>{n(i=>_y.set(i,s))})},data(){return{albums:[],tracks:{items:[]},selected_track:{}}}};function KV(t,e,n,s,i,r){const o=C("tabs-music"),a=C("heading-title"),l=C("list-albums"),c=C("router-link"),u=C("content-with-heading"),d=C("list-tracks");return O(),$("div",null,[E(o),E(u,null,{"heading-left":D(()=>[E(a,{content:{title:t.$t("page.music.recently-added.title")}},null,8,["content"])]),content:D(()=>[E(l,{items:i.albums},null,8,["items"])]),footer:D(()=>[E(c,{class:"button is-small is-rounded",to:{name:"music-recently-added"}},{default:D(()=>[js(j(t.$t("page.music.show-more")),1)]),_:1})]),_:1}),E(u,null,{"heading-left":D(()=>[E(a,{content:{title:t.$t("page.music.recently-played.title")}},null,8,["content"])]),content:D(()=>[E(d,{items:i.tracks},null,8,["items"])]),footer:D(()=>[E(c,{class:"button is-small is-rounded",to:{name:"music-recently-played"}},{default:D(()=>[js(j(t.$t("page.music.show-more")),1)]),_:1})]),_:1})])}const XV=it(zV,[["render",KV]]),vy={load(t){const e=bi().recently_added_limit;return tt.search({expression:"media_kind is music having track_count > 3 order by time_added desc",limit:e,type:"album"})},set(t,e){t.albums=new Tt(e.data.albums,{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}})}},YV={name:"PageMusicRecentlyAdded",components:{ContentWithHeading:ne,HeadingTitle:se,ListAlbums:Gn,TabsMusic:qs},beforeRouteEnter(t,e,n){vy.load(t).then(s=>{n(i=>vy.set(i,s))})},setup(){return{settingsStore:bi()}},data(){return{albums:new Tt}}};function ZV(t,e,n,s,i,r){const o=C("tabs-music"),a=C("heading-title"),l=C("list-albums"),c=C("content-with-heading");return O(),$("div",null,[E(o),E(c,null,{"heading-left":D(()=>[E(a,{content:{title:t.$t("page.music.recently-added.title")}},null,8,["content"])]),content:D(()=>[E(l,{items:i.albums},null,8,["items"])]),_:1})])}const JV=it(YV,[["render",ZV]]),Sy={load(t){return tt.search({expression:"time_played after 8 weeks ago and media_kind is music order by time_played desc",limit:50,type:"track"})},set(t,e){t.tracks=new Tt(e.data.tracks)}},QV={name:"PageMusicRecentlyPlayed",components:{ContentWithHeading:ne,HeadingTitle:se,ListTracks:Hn,TabsMusic:qs},beforeRouteEnter(t,e,n){Sy.load(t).then(s=>{n(i=>Sy.set(i,s))})},data(){return{tracks:{}}}};function t7(t,e,n,s,i,r){const o=C("tabs-music"),a=C("heading-title"),l=C("list-tracks"),c=C("content-with-heading");return O(),$("div",null,[E(o),E(c,null,{"heading-left":D(()=>[E(a,{content:{title:t.$t("page.music.recently-played.title")}},null,8,["content"])]),content:D(()=>[E(l,{items:i.tracks},null,8,["items"])]),_:1})])}const e7=it(QV,[["render",t7]]),n7={name:"ModalDialogPlaylistSpotify",components:{ModalDialogPlayable:xs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t,e;return{name:this.item.name,handler:this.open,uri:this.item.uri,properties:[{key:"property.owner",value:(t=this.item.owner)==null?void 0:t.display_name},{key:"property.tracks",value:(e=this.item.tracks)==null?void 0:e.total},{key:"property.path",value:this.item.uri}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"playlist-spotify",params:{id:this.item.id}})}}};function s7(t,e,n,s,i,r){const o=C("modal-dialog-playable");return O(),vt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const bS=it(n7,[["render",s7]]),i7={name:"ListPlaylistsSpotify",components:{ModalDialogPlaylistSpotify:bS},props:{items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(t){this.$router.push({name:"playlist-spotify",params:{id:t.id}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},r7=["onClick"],o7={class:"media-content"},a7=["textContent"],l7=["textContent"],c7={class:"media-right"},u7=["onClick"];function d7(t,e,n,s,i,r){const o=C("mdicon"),a=C("modal-dialog-playlist-spotify");return O(),$(ht,null,[(O(!0),$(ht,null,ce(n.items,l=>(O(),$("div",{key:l.id,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l)},[S("div",o7,[S("div",{class:"is-size-6 has-text-weight-bold",textContent:j(l.name)},null,8,a7),S("div",{class:"is-size-7 has-text-weight-bold has-text-grey",textContent:j(l.owner.display_name)},null,8,l7)]),S("div",c7,[S("a",{onClick:Ie(c=>r.open_dialog(l),["prevent","stop"])},[E(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,u7)])],8,r7))),128)),(O(),vt(fs,{to:"#app"},[E(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const Zc=it(i7,[["render",d7]]),Ey={load(t){return tt.spotify().then(({data:e})=>{const n=new Ws;return n.setAccessToken(e.webapi_token),Promise.all([n.getNewReleases({country:e.webapi_country,limit:3}),n.getFeaturedPlaylists({country:e.webapi_country,limit:3})])})},set(t,e){t.albums=e[0].albums.items,t.playlists=e[1].playlists.items}},f7={name:"PageMusicSpotify",components:{ContentWithHeading:ne,HeadingTitle:se,ListAlbumsSpotify:qa,ListPlaylistsSpotify:Zc,TabsMusic:qs},beforeRouteEnter(t,e,n){Ey.load(t).then(s=>{n(i=>Ey.set(i,s))})},data(){return{playlists:[],albums:[]}}};function h7(t,e,n,s,i,r){const o=C("tabs-music"),a=C("heading-title"),l=C("list-albums-spotify"),c=C("router-link"),u=C("content-with-heading"),d=C("list-playlists-spotify");return O(),$("div",null,[E(o),E(u,null,{"heading-left":D(()=>[E(a,{content:{title:t.$t("page.spotify.music.new-releases")}},null,8,["content"])]),content:D(()=>[E(l,{items:i.albums},null,8,["items"])]),footer:D(()=>[E(c,{to:{name:"music-spotify-new-releases"},class:"button is-small is-rounded"},{default:D(()=>[js(j(t.$t("page.spotify.music.show-more")),1)]),_:1})]),_:1}),E(u,null,{"heading-left":D(()=>[E(a,{content:{title:t.$t("page.spotify.music.featured-playlists")}},null,8,["content"])]),content:D(()=>[E(d,{items:i.playlists},null,8,["items"])]),footer:D(()=>[E(c,{to:{name:"music-spotify-featured-playlists"},class:"button is-small is-rounded"},{default:D(()=>[js(j(t.$t("page.spotify.music.show-more")),1)]),_:1})]),_:1})])}const p7=it(f7,[["render",h7]]),wy={load(t){return tt.spotify().then(({data:e})=>{const n=new Ws;return n.setAccessToken(e.webapi_token),n.getFeaturedPlaylists({country:e.webapi_country,limit:50})})},set(t,e){t.playlists=e.playlists.items}},m7={name:"PageMusicSpotifyFeaturedPlaylists",components:{ContentWithHeading:ne,HeadingTitle:se,ListPlaylistsSpotify:Zc,TabsMusic:qs},beforeRouteEnter(t,e,n){wy.load(t).then(s=>{n(i=>wy.set(i,s))})},data(){return{playlists:[]}},computed:{heading(){return{title:this.$t("page.spotify.music.featured-playlists")}}}};function g7(t,e,n,s,i,r){const o=C("tabs-music"),a=C("heading-title"),l=C("list-playlists-spotify"),c=C("content-with-heading");return O(),$("div",null,[E(o),E(c,null,{"heading-left":D(()=>[E(a,{content:r.heading},null,8,["content"])]),content:D(()=>[E(l,{items:i.playlists},null,8,["items"])]),_:1})])}const b7=it(m7,[["render",g7]]),ky={load(t){return tt.spotify().then(({data:e})=>{const n=new Ws;return n.setAccessToken(e.webapi_token),n.getNewReleases({country:e.webapi_country,limit:50})})},set(t,e){t.albums=e.albums.items}},y7={name:"PageMusicSpotifyNewReleases",components:{ContentWithHeading:ne,HeadingTitle:se,ListAlbumsSpotify:qa,TabsMusic:qs},beforeRouteEnter(t,e,n){ky.load(t).then(s=>{n(i=>ky.set(i,s))})},data(){return{albums:[]}},computed:{heading(){return{title:this.$t("page.spotify.music.new-releases")}}}};function _7(t,e,n,s,i,r){const o=C("tabs-music"),a=C("heading-title"),l=C("list-albums-spotify"),c=C("content-with-heading");return O(),$("div",null,[E(o),E(c,null,{"heading-left":D(()=>[E(a,{content:r.heading},null,8,["content"])]),content:D(()=>[E(l,{items:i.albums},null,8,["items"])]),_:1})])}const v7=it(y7,[["render",_7]]),S7={name:"LyricsPane",setup(){return{lyricsStore:Fu(),playerStore:Jn()}},data(){return this.lastIndex=-1,this.scrollingTimer=null,this.lastItemId=-1,{autoScrolling:!0}},computed:{is_playing(){return this.playerStore.state==="play"},lyrics(){const t=this.lyricsStore.content,e=[];if(t.length>0){const n=/\[(?\d+):(?\d+)(?:\.(?\d+))?\] ?(?.*)/u;t.split(` + `;return`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(n)}`},IM={name:"ControlImage",props:{album:{default:"",type:String},artist:{default:"",type:String},url:{default:"",type:String}},emits:["click"],data(){return{font:{family:"sans-serif",weight:"bold"},lifecycle:{error:t=>{t.src=this.dataURI()}},size:600}},methods:{dataURI(){return xM({alternate:`${this.artist} - ${this.album}`,caption:(this.album||this.artist||"").substring(0,2),font:this.font,size:this.size})}}},NM={class:"figure has-shadow"};function PM(t,e,n,s,i,r){const o=Hh("lazy");return O(),$("figure",NM,[xn(S("img",{onClick:e[0]||(e[0]=a=>t.$emit("click"))},null,512),[[o,{src:n.url,lifecycle:i.lifecycle}]])])}const tr=it(IM,[["render",PM],["__scopeId","data-v-92383b31"]]),{t:Ml,locale:RM}=Du.global,uS="NO_INDEX",LM=(t,e)=>t-e,DM=(t,e)=>t.localeCompare(e,RM.value),$M=(t,e)=>new Date(t)-new Date(e)||(t?e?0:1:-1),MM=t=>t.map(({field:e,type:n,order:s=1})=>{switch(n){case String:return(i,r)=>DM(i[e],r[e])*s;case Number:return(i,r)=>LM(i[e],r[e])*s;case Date:return(i,r)=>$M(i[e],r[e])*s;default:return()=>0}}),FM=(t="")=>{const e=t.charAt(0);return e.match(new RegExp("\\p{Letter}","gu"))?e.toUpperCase():e.match(new RegExp("\\p{Number}","gu"))?"#":"⌘"},VM=t=>{},HM=[{difference:NaN,text:()=>Ml("grouped-list.undefined")},{difference:864e5,text:()=>Ml("grouped-list.today")},{difference:6048e5,text:()=>Ml("grouped-list.last-week")},{difference:2592e6,text:()=>Ml("grouped-list.last-month")},{difference:1/0,text:t=>t.getFullYear()}],UM=t=>{var s;const e=new Date(t),n=new Date-e;return(s=HM.find(i=>isNaN(n)||n{switch(e){case String:return n=>FM(n[t]);case Number:return n=>n[t];case Date:return n=>UM(n[t]);case"Digits":return n=>VM(n[t]);default:return()=>uS}};class Tt{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=MM(e),o=i.sort((l,c)=>r.reduce((u,d)=>u||d(l,c),0)),a=jM(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!==uS&&(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 BM={name:"ListProperties",components:{ControlImage:tr},props:{item:{required:!0,type:Object}}},WM={class:"title is-4"},qM=["textContent"],GM=["textContent"],zM=["textContent"],KM={class:"title is-6"},XM=["onClick","textContent"],YM=["textContent"];function ZM(t,e,n,s,i,r){var a;const o=C("control-image");return O(),$(ht,null,[S("div",WM,[n.item.handler?(O(),$("a",{key:0,onClick:e[0]||(e[0]=(...l)=>n.item.handler&&n.item.handler(...l)),textContent:j(n.item.name)},null,8,qM)):(O(),$("span",{key:1,textContent:j(n.item.name)},null,8,GM))]),n.item.image?(O(),vt(o,{key:0,url:n.item.image,artist:n.item.artist,album:n.item.name,class:"is-normal mb-5"},null,8,["url","artist","album"])):bt("",!0),t.$slots.buttons?be(t.$slots,"buttons",{key:1}):bt("",!0),(O(!0),$(ht,null,ce((a=n.item.properties)==null?void 0:a.filter(l=>l.value),l=>(O(),$("div",{key:l.key,class:"mb-3"},[S("div",{class:"is-size-7 is-uppercase",textContent:j(t.$t(l.key))},null,8,zM),S("div",KM,[l.handler?(O(),$("a",{key:0,onClick:l.handler,textContent:j(l.value)},null,8,XM)):(O(),$("span",{key:1,class:"title is-6",textContent:j(l.value)},null,8,YM))])]))),128))],64)}const dS=it(BM,[["render",ZM]]),JM={name:"ModalDialogPlayable",components:{ControlButton:Qe,ListProperties:dS,ModalDialog:gi},props:{buttons:{default:()=>[],type:Array},item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{actions(){return[{key:"dialog.playable.add",handler:this.queue_add,icon:"playlist-plus"},{key:"dialog.playable.add-next",handler:this.queue_add_next,icon:"playlist-play"},{key:"dialog.playable.play",handler:this.play,icon:"play"}]}},methods:{play(){this.$emit("close"),this.item.expression?tt.player_play_expression(this.item.expression,!1):tt.player_play_uri(this.item.uris||this.item.uri,!1)},queue_add(){this.$emit("close"),this.item.expression?tt.queue_expression_add(this.item.expression):tt.queue_add(this.item.uris||this.item.uri)},queue_add_next(){this.$emit("close"),this.item.expression?tt.queue_expression_add_next(this.item.expression):tt.queue_add_next(this.item.uris||this.item.uri)}}},QM={class:"buttons"};function t8(t,e,n,s,i,r){const o=C("control-button"),a=C("list-properties"),l=C("modal-dialog");return O(),vt(l,{actions:r.actions,show:n.show,onClose:e[0]||(e[0]=c=>t.$emit("close"))},{content:D(()=>[E(a,{item:n.item},Za({_:2},[n.buttons.length?{name:"buttons",fn:D(()=>[S("div",QM,[(O(!0),$(ht,null,ce(n.buttons,c=>(O(),vt(o,{key:c.key,button:c},null,8,["button"]))),128))])]),key:"0"}:void 0]),1032,["item"])]),_:1},8,["actions","show"])}const xs=it(JM,[["render",t8]]),e8={name:"ModalDialogTrack",components:{ModalDialogPlayable:xs},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?[{key:"dialog.track.mark-as-new",handler:this.mark_new}]:[{key:"dialog.track.mark-as-played",handler:this.mark_played}]},playable(){return{name:this.item.title,uri:this.item.uri,properties:[{key:"property.album",value:this.item.album,handler:this.open_album},{key:"property.album-artist",value:this.item.album_artist,handler:this.open_artist},{key:"property.composer",value:this.item.composer},{key:"property.release-date",value:this.$filters.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.$filters.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-value",{format:this.item.type,bitrate:this.item.bitrate,channels:this.$t("count.channels",this.item.channels),samplerate:this.item.samplerate})},{key:"property.added-on",value:this.$filters.toDateTime(this.item.time_added)},{key:"property.rating",value:this.$t("dialog.track.rating-value",{rating:Math.floor(this.item.rating/10)})},{key:"property.comment",value:this.item.comment},{key:"property.path",value:this.item.path}]}}},methods:{mark_new(){tt.library_track_update(this.item.id,{play_count:"reset"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},mark_played(){tt.library_track_update(this.item.id,{play_count:"increment"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},open_album(){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:"audiobooks-album",params:{id:this.item.album_id}}):this.item.media_kind==="music"&&this.$router.push({name:"music-album",params:{id:this.item.album_id}})},open_artist(){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:"audiobooks-artist",params:{id:this.item.album_artist_id}})},open_genre(){this.$emit("close"),this.$router.push({name:"genre-albums",params:{name:this.item.genre},query:{media_kind:this.item.media_kind}})}}};function n8(t,e,n,s,i,r){const o=C("modal-dialog-playable");return O(),vt(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=it(e8,[["render",n8]]),i8={name:"ListTracks",components:{ModalDialogTrack:s8},props:{expression:{default:"",type:String},items:{required:!0,type:Object},show_icon:Boolean,show_progress:Boolean,uris:{default:"",type:String}},emits:["play-count-changed"],data(){return{selected_item:{},show_details_modal:!1}},methods:{open_dialog(t){this.selected_item=t,this.show_details_modal=!0},play(t){this.uris?tt.player_play_uri(this.uris,!1,this.items.items.indexOf(t)):this.expression?tt.player_play_expression(this.expression,!1,this.items.items.indexOf(t)):tt.player_play_uri(t.uri,!1)}}},r8={key:0,class:"py-5"},o8=["id","textContent"],a8=["onClick"],l8={class:"media-content"},c8=["textContent"],u8=["textContent"],d8=["textContent"],f8=["max","value"],h8={class:"media-right"},p8=["onClick"];function m8(t,e,n,s,i,r){const o=C("mdicon"),a=C("modal-dialog-track");return O(),$(ht,null,[(O(!0),$(ht,null,ce(n.items,l=>(O(),$(ht,{key:l.itemId},[l.isItem?(O(),$("div",{key:1,class:qt(["media is-align-items-center is-clickable mb-0",{"with-progress":n.show_progress}]),onClick:c=>r.play(l.item)},[n.show_icon?(O(),vt(o,{key:0,class:"media-left icon",name:"file-music-outline"})):bt("",!0),S("div",l8,[S("div",{class:qt(["is-size-6 has-text-weight-bold",{"has-text-grey":l.item.media_kind==="podcast"&&l.item.play_count>0}]),textContent:j(l.item.title)},null,10,c8),S("div",{class:"is-size-7 has-text-weight-bold has-text-grey",textContent:j(l.item.artist)},null,8,u8),S("div",{class:"is-size-7 has-text-grey",textContent:j(l.item.album)},null,8,d8),n.show_progress&&l.item.seek_ms>0?(O(),$("progress",{key:0,class:"progress is-dark",max:l.item.length_ms,value:l.item.seek_ms},null,8,f8)):bt("",!0)]),S("div",h8,[S("a",{onClick:Ie(c=>r.open_dialog(l.item),["prevent","stop"])},[E(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,p8)])],10,a8)):(O(),$("div",r8,[S("span",{id:`index_${l.index}`,class:"tag is-small has-text-weight-bold",textContent:j(l.index)},null,8,o8)]))],64))),128)),(O(),vt(fs,{to:"#app"},[E(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1),onPlayCountChanged:e[1]||(e[1]=l=>t.$emit("play-count-changed"))},null,8,["item","show"])]))],64)}const Hn=it(i8,[["render",m8],["__scopeId","data-v-44ebdd0b"]]),g8={name:"ModalDialogAlbum",components:{ModalDialogPlayable:xs},props:{item:{required:!0,type:Object},media_kind:{default:"",type:String},show:Boolean},emits:["close","remove-podcast","play-count-changed"],computed:{buttons(){return this.media_kind_resolved==="podcast"?this.item.data_kind==="url"?[{key:"dialog.album.mark-as-played",handler:this.mark_played},{key:"dialog.album.remove-podcast",handler:this.remove_podcast}]:[{key:"dialog.album.mark-as-played",handler:this.mark_played}]:[]},media_kind_resolved(){return this.media_kind||this.item.media_kind},playable(){return{name:this.item.name,handler:this.open,image:this.item.artwork_url,uri:this.item.uri,properties:[{key:"property.artist",value:this.item.artist,handler:this.open_artist},{key:"property.release-date",value:this.$filters.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.$filters.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.$filters.toDateTime(this.item.time_added)}]}}},methods:{mark_played(){tt.library_album_track_update(this.item.id,{play_count:"played"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},open(){this.$emit("close"),this.media_kind_resolved==="podcast"?this.$router.push({name:"podcast",params:{id:this.item.id}}):this.media_kind_resolved==="audiobook"?this.$router.push({name:"audiobooks-album",params:{id:this.item.id}}):this.$router.push({name:"music-album",params:{id:this.item.id}})},open_artist(){this.$emit("close"),this.media_kind_resolved==="audiobook"?this.$router.push({name:"audiobooks-artist",params:{id:this.item.artist_id}}):this.$router.push({name:"music-artist",params:{id:this.item.artist_id}})},remove_podcast(){this.$emit("remove-podcast")}}};function b8(t,e,n,s,i,r){const o=C("modal-dialog-playable");return O(),vt(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 dd=it(g8,[["render",b8]]),ty={load(t){return Promise.all([tt.library_album(t.params.id),tt.library_album_tracks(t.params.id)])},set(t,e){t.album=e[0].data,t.tracks=new Tt(e[1].data,{criteria:[{field:"disc_number",type:Number}],index:{field:"disc_number",type:Number}}),t.tracks.indices.length<2&&t.tracks.group()}},y8={name:"PageAlbum",components:{ContentWithHero:ud,ControlButton:Qe,ControlImage:tr,ListTracks:Hn,ModalDialogAlbum:dd},beforeRouteEnter(t,e,n){ty.load(t).then(s=>{n(i=>ty.set(i,s))})},data(){return{album:{},show_details_modal:!1,tracks:new Tt}},methods:{open_artist(){this.show_details_modal=!1,this.$router.push({name:"music-artist",params:{id:this.album.artist_id}})},play(){tt.player_play_uri(this.album.uri,!0)},showDetails(){this.show_details_modal=!0}}},_8=["textContent"],v8={class:"subtitle is-6"},S8=["textContent"],E8=["textContent"],w8={class:"buttons is-centered-mobile mt-5"};function k8(t,e,n,s,i,r){const o=C("control-button"),a=C("control-image"),l=C("list-tracks"),c=C("modal-dialog-album"),u=C("content-with-hero");return O(),$("div",null,[E(u,null,{"heading-left":D(()=>[S("div",{class:"title is-5",textContent:j(i.album.name)},null,8,_8),S("div",v8,[S("a",{onClick:e[0]||(e[0]=(...d)=>r.open_artist&&r.open_artist(...d)),textContent:j(i.album.artist)},null,8,S8)]),S("div",{class:"is-size-7 is-uppercase has-text-centered-mobile",textContent:j(t.$t("count.tracks",{count:i.album.track_count}))},null,8,E8),S("div",w8,[E(o,{button:{handler:r.play,icon:"shuffle",key:"page.album.shuffle"}},null,8,["button"]),E(o,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"])])]),"heading-right":D(()=>[E(a,{url:i.album.artwork_url,artist:i.album.artist,album:i.album.name,class:"is-clickable is-medium",onClick:r.showDetails},null,8,["url","artist","album","onClick"])]),content:D(()=>[E(l,{items:i.tracks,uris:i.album.uri},null,8,["items","uris"]),E(c,{item:i.album,show:i.show_details_modal,onClose:e[1]||(e[1]=d=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const C8=it(y8,[["render",k8]]),T8={name:"ModalDialogTrackSpotify",components:{ModalDialogPlayable:xs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t;return this.item.artists?{name:this.item.name,uri:this.item.uri,properties:[{key:"property.album",value:this.item.album.name,handler:this.open_album},{key:"property.album-artist",value:(t=this.item.artists[0])==null?void 0:t.name,handler:this.open_artist},{key:"property.release-date",value:this.$filters.toDate(this.item.album.release_date)},{key:"property.position",value:[this.item.disc_number,this.item.track_number].join(" / ")},{key:"property.duration",value:this.$filters.toTimecode(this.item.duration_ms)},{key:"property.path",value:this.item.uri}]}:{}}},methods:{open_album(){this.$emit("close"),this.$router.push({name:"music-spotify-album",params:{id:this.item.album.id}})},open_artist(){this.$emit("close"),this.$router.push({name:"music-spotify-artist",params:{id:this.item.artists[0].id}})}}};function A8(t,e,n,s,i,r){const o=C("modal-dialog-playable");return O(),vt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const O8=it(T8,[["render",A8]]),x8={name:"ListTracksSpotify",components:{ModalDialogTrackSpotify:O8},props:{context_uri:{default:"",type:String},items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open_dialog(t){this.selected_item=t,this.show_details_modal=!0},play(t){t.is_playable&&tt.player_play_uri(this.context_uri||t.uri,!1,t.position||0)}}},I8=["onClick"],N8=["textContent"],P8=["textContent"],R8=["textContent"],L8={key:0,class:"is-size-7 has-text-grey"},D8=["textContent"],$8=["textContent"],M8={class:"media-right"},F8=["onClick"];function V8(t,e,n,s,i,r){const o=C("mdicon"),a=C("modal-dialog-track-spotify");return O(),$(ht,null,[(O(!0),$(ht,null,ce(n.items,l=>{var c;return O(),$("div",{key:l.id,class:"media is-align-items-center mb-0"},[S("div",{class:qt(["media-content",{"is-clickable":l.is_playable,"is-not-allowed":!l.is_playable}]),onClick:u=>r.play(l)},[S("div",{class:qt(["is-size-6 has-text-weight-bold",{"has-text-grey-light":!l.is_playable}]),textContent:j(l.name)},null,10,N8),S("div",{class:qt(["is-size-7 has-text-weight-bold",{"has-text-grey":l.is_playable,"has-text-grey-light":!l.is_playable}]),textContent:j(l.artists[0].name)},null,10,P8),S("div",{class:"is-size-7 has-text-grey",textContent:j(l.album.name)},null,8,R8),l.is_playable?bt("",!0):(O(),$("div",L8,[e[1]||(e[1]=js(" (")),S("span",{textContent:j(t.$t("list.spotify.not-playable-track"))},null,8,D8),(c=l.restrictions)!=null&&c.reason?(O(),$("span",{key:0,textContent:j(t.$t("list.spotify.restriction-reason",{reason:l.restrictions.reason}))},null,8,$8)):bt("",!0),e[2]||(e[2]=js(") "))]))],10,I8),S("div",M8,[S("a",{onClick:Ie(u=>r.open_dialog(l),["prevent","stop"])},[E(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,F8)])])}),128)),(O(),vt(fs,{to:"#app"},[E(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const Kc=it(x8,[["render",V8],["__scopeId","data-v-f2f903a5"]]),H8={name:"ModalDialogAlbumSpotify",components:{ModalDialogPlayable:xs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t,e,n,s,i,r;return{name:this.item.name||"",image:((n=(e=(t=this.item)==null?void 0:t.images)==null?void 0:e[0])==null?void 0:n.url)||"",handler:this.open,uri:this.item.uri,properties:[{key:"property.artist",value:(r=(i=(s=this.item)==null?void 0:s.artists)==null?void 0:i[0])==null?void 0:r.name,handler:this.open_artist},{key:"property.release-date",value:this.$filters.toDate(this.item.release_date)},{key:"property.type",value:this.item.album_type}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"music-spotify-album",params:{id:this.item.id}})},open_artist(){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=C("modal-dialog-playable");return O(),vt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const fS=it(H8,[["render",U8]]);var Jd={exports:{}},ey;function j8(){return ey||(ey=1,function(t){var e=function(){var n="https://api.spotify.com/v1",s=null,i=null,r=function(f,h){return f.abort=h,f},o=function(f,h){var p;if(i!==null){var m=i.defer();f(function(y){m.resolve(y)},function(y){m.reject(y)}),p=m.promise}else window.Promise&&(p=new window.Promise(f));return p?new r(p,h):null},a=function(){var f=Array.prototype.slice.call(arguments),h=f[0],p=f.slice(1);return h=h||{},p.forEach(function(m){for(var y in m)m.hasOwnProperty(y)&&(h[y]=m[y])}),h},l=function(f,h){var p="";for(var m in h)if(h.hasOwnProperty(m)){var y=h[m];p+=encodeURIComponent(m)+"="+encodeURIComponent(y)+"&"}return p.length>0&&(p=p.substring(0,p.length-1),f=f+"?"+p),f},c=function(f,h){var p=new XMLHttpRequest,m=function(y,b){function v(k){y&&y(k),h&&h(null,k)}function g(){b&&b(p),h&&h(p,null)}var _=f.type||"GET";if(p.open(_,l(f.url,f.params)),s&&p.setRequestHeader("Authorization","Bearer "+s),p.onreadystatechange=function(){if(p.readyState===4){var k=null;try{k=p.responseText?JSON.parse(p.responseText):""}catch(N){console.error(N)}p.status>=200&&p.status<300?v(k):g()}},_==="GET")p.send(null);else{var w=null;f.postData&&(f.contentType==="image/jpeg"?(w=f.postData,p.setRequestHeader("Content-Type",f.contentType)):(w=JSON.stringify(f.postData),p.setRequestHeader("Content-Type","application/json"))),p.send(w)}};return h?(m(),null):o(m,function(){p.abort()})},u=function(f,h,p,m){var y={},b=null;typeof h=="object"?(y=h,b=p):typeof h=="function"&&(b=h);var v=f.type||"GET";return v!=="GET"&&f.postData&&!m?f.postData=a(f.postData,y):f.params=a(f.params,y),c(f,b)},d=function(){};return d.prototype={constructor:e},d.prototype.getGeneric=function(f,h){var p={url:f};return u(p,h)},d.prototype.getMe=function(f,h){var p={url:n+"/me"};return u(p,f,h)},d.prototype.getMySavedTracks=function(f,h){var p={url:n+"/me/tracks"};return u(p,f,h)},d.prototype.addToMySavedTracks=function(f,h,p){var m={url:n+"/me/tracks",type:"PUT",postData:f};return u(m,h,p)},d.prototype.removeFromMySavedTracks=function(f,h,p){var m={url:n+"/me/tracks",type:"DELETE",postData:f};return u(m,h,p)},d.prototype.containsMySavedTracks=function(f,h,p){var m={url:n+"/me/tracks/contains",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getMySavedAlbums=function(f,h){var p={url:n+"/me/albums"};return u(p,f,h)},d.prototype.addToMySavedAlbums=function(f,h,p){var m={url:n+"/me/albums",type:"PUT",postData:f};return u(m,h,p)},d.prototype.removeFromMySavedAlbums=function(f,h,p){var m={url:n+"/me/albums",type:"DELETE",postData:f};return u(m,h,p)},d.prototype.containsMySavedAlbums=function(f,h,p){var m={url:n+"/me/albums/contains",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getMyTopArtists=function(f,h){var p={url:n+"/me/top/artists"};return u(p,f,h)},d.prototype.getMyTopTracks=function(f,h){var p={url:n+"/me/top/tracks"};return u(p,f,h)},d.prototype.getMyRecentlyPlayedTracks=function(f,h){var p={url:n+"/me/player/recently-played"};return u(p,f,h)},d.prototype.followUsers=function(f,h){var p={url:n+"/me/following/",type:"PUT",params:{ids:f.join(","),type:"user"}};return u(p,h)},d.prototype.followArtists=function(f,h){var p={url:n+"/me/following/",type:"PUT",params:{ids:f.join(","),type:"artist"}};return u(p,h)},d.prototype.followPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f+"/followers",type:"PUT",postData:{}};return u(m,h,p)},d.prototype.unfollowUsers=function(f,h){var p={url:n+"/me/following/",type:"DELETE",params:{ids:f.join(","),type:"user"}};return u(p,h)},d.prototype.unfollowArtists=function(f,h){var p={url:n+"/me/following/",type:"DELETE",params:{ids:f.join(","),type:"artist"}};return u(p,h)},d.prototype.unfollowPlaylist=function(f,h){var p={url:n+"/playlists/"+f+"/followers",type:"DELETE"};return u(p,h)},d.prototype.isFollowingUsers=function(f,h){var p={url:n+"/me/following/contains",type:"GET",params:{ids:f.join(","),type:"user"}};return u(p,h)},d.prototype.isFollowingArtists=function(f,h){var p={url:n+"/me/following/contains",type:"GET",params:{ids:f.join(","),type:"artist"}};return u(p,h)},d.prototype.areFollowingPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f+"/followers/contains",type:"GET",params:{ids:h.join(",")}};return u(m,p)},d.prototype.getFollowedArtists=function(f,h){var p={url:n+"/me/following",type:"GET",params:{type:"artist"}};return u(p,f,h)},d.prototype.getUser=function(f,h,p){var m={url:n+"/users/"+encodeURIComponent(f)};return u(m,h,p)},d.prototype.getUserPlaylists=function(f,h,p){var m;return typeof f=="string"?m={url:n+"/users/"+encodeURIComponent(f)+"/playlists"}:(m={url:n+"/me/playlists"},p=h,h=f),u(m,h,p)},d.prototype.getPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f};return u(m,h,p)},d.prototype.getPlaylistTracks=function(f,h,p){var m={url:n+"/playlists/"+f+"/tracks"};return u(m,h,p)},d.prototype.getPlaylistCoverImage=function(f,h){var p={url:n+"/playlists/"+f+"/images"};return u(p,h)},d.prototype.createPlaylist=function(f,h,p){var m={url:n+"/users/"+encodeURIComponent(f)+"/playlists",type:"POST",postData:h};return u(m,h,p)},d.prototype.changePlaylistDetails=function(f,h,p){var m={url:n+"/playlists/"+f,type:"PUT",postData:h};return u(m,h,p)},d.prototype.addTracksToPlaylist=function(f,h,p,m){var y={url:n+"/playlists/"+f+"/tracks",type:"POST",postData:{uris:h}};return u(y,p,m,!0)},d.prototype.replaceTracksInPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f+"/tracks",type:"PUT",postData:{uris:h}};return u(m,{},p)},d.prototype.reorderTracksInPlaylist=function(f,h,p,m,y){var b={url:n+"/playlists/"+f+"/tracks",type:"PUT",postData:{range_start:h,insert_before:p}};return u(b,m,y)},d.prototype.removeTracksFromPlaylist=function(f,h,p){var m=h.map(function(b){return typeof b=="string"?{uri:b}:b}),y={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{tracks:m}};return u(y,{},p)},d.prototype.removeTracksFromPlaylistWithSnapshotId=function(f,h,p,m){var y=h.map(function(v){return typeof v=="string"?{uri:v}:v}),b={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{tracks:y,snapshot_id:p}};return u(b,{},m)},d.prototype.removeTracksFromPlaylistInPositions=function(f,h,p,m){var y={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{positions:h,snapshot_id:p}};return u(y,{},m)},d.prototype.uploadCustomPlaylistCoverImage=function(f,h,p){var m={url:n+"/playlists/"+f+"/images",type:"PUT",postData:h.replace(/^data:image\/jpeg;base64,/,""),contentType:"image/jpeg"};return u(m,{},p)},d.prototype.getAlbum=function(f,h,p){var m={url:n+"/albums/"+f};return u(m,h,p)},d.prototype.getAlbumTracks=function(f,h,p){var m={url:n+"/albums/"+f+"/tracks"};return u(m,h,p)},d.prototype.getAlbums=function(f,h,p){var m={url:n+"/albums/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getTrack=function(f,h,p){var m={};return m.url=n+"/tracks/"+f,u(m,h,p)},d.prototype.getTracks=function(f,h,p){var m={url:n+"/tracks/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getArtist=function(f,h,p){var m={url:n+"/artists/"+f};return u(m,h,p)},d.prototype.getArtists=function(f,h,p){var m={url:n+"/artists/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getArtistAlbums=function(f,h,p){var m={url:n+"/artists/"+f+"/albums"};return u(m,h,p)},d.prototype.getArtistTopTracks=function(f,h,p,m){var y={url:n+"/artists/"+f+"/top-tracks",params:{country:h}};return u(y,p,m)},d.prototype.getArtistRelatedArtists=function(f,h,p){var m={url:n+"/artists/"+f+"/related-artists"};return u(m,h,p)},d.prototype.getFeaturedPlaylists=function(f,h){var p={url:n+"/browse/featured-playlists"};return u(p,f,h)},d.prototype.getNewReleases=function(f,h){var p={url:n+"/browse/new-releases"};return u(p,f,h)},d.prototype.getCategories=function(f,h){var p={url:n+"/browse/categories"};return u(p,f,h)},d.prototype.getCategory=function(f,h,p){var m={url:n+"/browse/categories/"+f};return u(m,h,p)},d.prototype.getCategoryPlaylists=function(f,h,p){var m={url:n+"/browse/categories/"+f+"/playlists"};return u(m,h,p)},d.prototype.search=function(f,h,p,m){var y={url:n+"/search/",params:{q:f,type:h.join(",")}};return u(y,p,m)},d.prototype.searchAlbums=function(f,h,p){return this.search(f,["album"],h,p)},d.prototype.searchArtists=function(f,h,p){return this.search(f,["artist"],h,p)},d.prototype.searchTracks=function(f,h,p){return this.search(f,["track"],h,p)},d.prototype.searchPlaylists=function(f,h,p){return this.search(f,["playlist"],h,p)},d.prototype.searchShows=function(f,h,p){return this.search(f,["show"],h,p)},d.prototype.searchEpisodes=function(f,h,p){return this.search(f,["episode"],h,p)},d.prototype.getAudioFeaturesForTrack=function(f,h){var p={};return p.url=n+"/audio-features/"+f,u(p,{},h)},d.prototype.getAudioFeaturesForTracks=function(f,h){var p={url:n+"/audio-features",params:{ids:f}};return u(p,{},h)},d.prototype.getAudioAnalysisForTrack=function(f,h){var p={};return p.url=n+"/audio-analysis/"+f,u(p,{},h)},d.prototype.getRecommendations=function(f,h){var p={url:n+"/recommendations"};return u(p,f,h)},d.prototype.getAvailableGenreSeeds=function(f){var h={url:n+"/recommendations/available-genre-seeds"};return u(h,{},f)},d.prototype.getMyDevices=function(f){var h={url:n+"/me/player/devices"};return u(h,{},f)},d.prototype.getMyCurrentPlaybackState=function(f,h){var p={url:n+"/me/player"};return u(p,f,h)},d.prototype.getMyCurrentPlayingTrack=function(f,h){var p={url:n+"/me/player/currently-playing"};return u(p,f,h)},d.prototype.transferMyPlayback=function(f,h,p){var m=h||{};m.device_ids=f;var y={type:"PUT",url:n+"/me/player",postData:m};return u(y,h,p)},d.prototype.play=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={};["context_uri","uris","offset","position_ms"].forEach(function(v){v in f&&(m[v]=f[v])});var y={type:"PUT",url:n+"/me/player/play",params:p,postData:m},b=typeof f=="function"?f:{};return u(y,b,h)},d.prototype.queue=function(f,h,p){h=h||{};var m="device_id"in h?{uri:f,device_id:h.device_id}:{uri:f},y={type:"POST",url:n+"/me/player/queue",params:m};return u(y,h,p)},d.prototype.pause=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={type:"PUT",url:n+"/me/player/pause",params:p};return u(m,f,h)},d.prototype.skipToNext=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={type:"POST",url:n+"/me/player/next",params:p};return u(m,f,h)},d.prototype.skipToPrevious=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={type:"POST",url:n+"/me/player/previous",params:p};return u(m,f,h)},d.prototype.seek=function(f,h,p){h=h||{};var m={position_ms:f};"device_id"in h&&(m.device_id=h.device_id);var y={type:"PUT",url:n+"/me/player/seek",params:m};return u(y,h,p)},d.prototype.setRepeat=function(f,h,p){h=h||{};var m={state:f};"device_id"in h&&(m.device_id=h.device_id);var y={type:"PUT",url:n+"/me/player/repeat",params:m};return u(y,h,p)},d.prototype.setVolume=function(f,h,p){h=h||{};var m={volume_percent:f};"device_id"in h&&(m.device_id=h.device_id);var y={type:"PUT",url:n+"/me/player/volume",params:m};return u(y,h,p)},d.prototype.setShuffle=function(f,h,p){h=h||{};var m={state:f};"device_id"in h&&(m.device_id=h.device_id);var y={type:"PUT",url:n+"/me/player/shuffle",params:m};return u(y,h,p)},d.prototype.getShow=function(f,h,p){var m={};return m.url=n+"/shows/"+f,u(m,h,p)},d.prototype.getShows=function(f,h,p){var m={url:n+"/shows/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getMySavedShows=function(f,h){var p={url:n+"/me/shows"};return u(p,f,h)},d.prototype.addToMySavedShows=function(f,h,p){var m={url:n+"/me/shows",type:"PUT",postData:f};return u(m,h,p)},d.prototype.removeFromMySavedShows=function(f,h,p){var m={url:n+"/me/shows",type:"DELETE",postData:f};return u(m,h,p)},d.prototype.containsMySavedShows=function(f,h,p){var m={url:n+"/me/shows/contains",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getShowEpisodes=function(f,h,p){var m={url:n+"/shows/"+f+"/episodes"};return u(m,h,p)},d.prototype.getEpisode=function(f,h,p){var m={};return m.url=n+"/episodes/"+f,u(m,h,p)},d.prototype.getEpisodes=function(f,h,p){var m={url:n+"/episodes/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getAccessToken=function(){return s},d.prototype.setAccessToken=function(f){s=f},d.prototype.setPromiseImplementation=function(f){var h=!1;try{var p=new f(function(m){m()});typeof p.then=="function"&&typeof p.catch=="function"&&(h=!0)}catch(m){console.error(m)}if(h)i=f;else throw new Error("Unsupported implementation of Promises/A+")},d}();t.exports=e}(Jd)),Jd.exports}var B8=j8();const Ws=Vu(B8),ny={load(t){const e=new Ws;return e.setAccessToken(je().spotify.webapi_token),e.getAlbum(t.params.id,{market:je().spotify.webapi_country})},set(t,e){t.album=e}},W8={name:"PageAlbumSpotify",components:{ContentWithHero:ud,ControlButton:Qe,ControlImage:tr,ListTracksSpotify:Kc,ModalDialogAlbumSpotify:fS},beforeRouteEnter(t,e,n){ny.load(t).then(s=>{n(i=>ny.set(i,s))})},setup(){return{servicesStore:je()}},data(){return{album:{artists:[{}],tracks:{}},show_details_modal:!1}},computed:{tracks(){const{album:t}=this;return t.tracks.total?t.tracks.items.map(e=>({...e,album:t})):{}}},methods:{open_artist(){this.$router.push({name:"music-spotify-artist",params:{id:this.album.artists[0].id}})},play(){this.show_details_modal=!1,tt.player_play_uri(this.album.uri,!0)},showDetails(){this.show_details_modal=!0}}},q8=["textContent"],G8={class:"subtitle is-6"},z8=["textContent"],K8=["textContent"],X8={class:"buttons is-centered-mobile mt-5"};function Y8(t,e,n,s,i,r){const o=C("control-button"),a=C("control-image"),l=C("list-tracks-spotify"),c=C("modal-dialog-album-spotify"),u=C("content-with-hero");return O(),$("div",null,[E(u,null,{"heading-left":D(()=>[S("div",{class:"title is-5",textContent:j(i.album.name)},null,8,q8),S("div",G8,[S("a",{onClick:e[0]||(e[0]=(...d)=>r.open_artist&&r.open_artist(...d)),textContent:j(i.album.artists[0].name)},null,8,z8)]),S("div",{class:"is-size-7 is-uppercase has-text-centered-mobile",textContent:j(t.$t("count.tracks",{count:i.album.tracks.total}))},null,8,K8),S("div",X8,[E(o,{button:{handler:r.play,icon:"shuffle",key:"page.spotify.album.shuffle"}},null,8,["button"]),E(o,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"])])]),"heading-right":D(()=>{var d,f;return[E(a,{url:((f=(d=i.album.images)==null?void 0:d[0])==null?void 0:f.url)??"",artist:i.album.artists[0].name,album:i.album.name,class:"is-clickable is-medium",onClick:r.showDetails},null,8,["url","artist","album","onClick"])]}),content:D(()=>[E(l,{items:r.tracks,context_uri:i.album.uri},null,8,["items","context_uri"]),E(c,{item:i.album,show:i.show_details_modal,onClose:e[1]||(e[1]=d=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const Z8=it(W8,[["render",Y8]]),J8={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)}}},Q8={class:"dropdown-trigger"},t5=["textContent"],e5={id:"dropdown",class:"dropdown-menu",role:"menu"},n5={class:"dropdown-content"},s5=["onClick","textContent"];function i5(t,e,n,s,i,r){const o=C("mdicon"),a=Hh("click-away");return xn((O(),$("div",{class:qt(["dropdown",{"is-active":i.active}])},[S("div",Q8,[S("button",{class:"button","aria-haspopup":"true","aria-controls":"dropdown",onClick:e[0]||(e[0]=l=>i.active=!i.active)},[S("span",{textContent:j(r.option.name)},null,8,t5),E(o,{class:"icon",name:"chevron-down",size:"16"})])]),S("div",e5,[S("div",n5,[(O(!0),$(ht,null,ce(n.options,l=>(O(),$("a",{key:l.id,class:qt(["dropdown-item",{"is-active":n.value===l.id}]),onClick:c=>r.select(l),textContent:j(l.name)},null,10,s5))),128))])])],2)),[[a,r.deactivate]])}const Dr=it(J8,[["render",i5]]),r5={name:"IndexButtonList",props:{indices:{required:!0,type:Array}}},o5={class:"buttons is-centered mb-4"};function a5(t,e,n,s,i,r){const o=C("router-link");return O(),$("section",null,[S("nav",o5,[(O(!0),$(ht,null,ce(n.indices,a=>(O(),vt(o,{key:a,class:"button px-2 is-small is-square",to:{hash:`#index_${a}`,query:t.$route.query}},{default:D(()=>[js(j(a),1)]),_:2},1032,["to"]))),128))])])}const Is=it(r5,[["render",a5],["__scopeId","data-v-f15ebd8e"]]),l5={name:"ListAlbums",components:{ControlImage:tr,ModalDialog:gi,ModalDialogAlbum:dd},props:{items:{required:!0,type:Object},media_kind:{default:"",type:String}},emits:["play-count-changed","podcast-deleted"],setup(){return{settingsStore:bi()}},data(){return{rss_playlist_to_remove:{},selected_item:{},show_details_modal:!1,show_remove_podcast_modal:!1}},computed:{actions(){return[{key:"page.podcast.cancel",handler:"cancel",icon:"cancel"},{key:"page.podcast.remove",handler:"remove",icon:"delete"}]},media_kind_resolved(){return this.media_kind||this.selected_item.media_kind}},methods:{open(t){this.selected_item=t,this.media_kind_resolved==="podcast"?this.$router.push({name:"podcast",params:{id:t.id}}):this.media_kind_resolved==="audiobook"?this.$router.push({name:"audiobooks-album",params:{id:t.id}}):this.$router.push({name:"music-album",params:{id:t.id}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0},open_remove_podcast_dialog(){tt.library_album_tracks(this.selected_item.id,{limit:1}).then(({data:t})=>{tt.library_track_playlists(t.items[0].id).then(({data:e})=>{[this.rss_playlist_to_remove]=e.items.filter(n=>n.type==="rss"),this.show_remove_podcast_modal=!0,this.show_details_modal=!1})})},play_count_changed(){this.$emit("play-count-changed")},remove_podcast(){this.show_remove_podcast_modal=!1,tt.library_playlist_delete(this.rss_playlist_to_remove.id).then(()=>{this.$emit("podcast-deleted")})}}},c5={key:0,class:"py-5"},u5=["id","textContent"],d5=["onClick"],f5={class:"media-content"},h5=["textContent"],p5=["textContent"],m5=["textContent"],g5={class:"media-right"},b5=["onClick"],y5=["textContent"];function _5(t,e,n,s,i,r){const o=C("control-image"),a=C("mdicon"),l=C("modal-dialog-album"),c=C("i18n-t"),u=C("modal-dialog");return O(),$(ht,null,[(O(!0),$(ht,null,ce(n.items,d=>(O(),$(ht,{key:d.itemId},[d.isItem?(O(),$("div",{key:1,class:"media is-align-items-center is-clickable mb-0",onClick:f=>r.open(d.item)},[s.settingsStore.show_cover_artwork_in_album_lists?(O(),vt(o,{key:0,url:d.item.artwork_url,artist:d.item.artist,album:d.item.name,class:"media-left is-small"},null,8,["url","artist","album"])):bt("",!0),S("div",f5,[S("div",{class:"is-size-6 has-text-weight-bold",textContent:j(d.item.name)},null,8,h5),S("div",{class:"is-size-7 has-text-grey has-text-weight-bold",textContent:j(d.item.artist)},null,8,p5),d.item.date_released&&d.item.media_kind==="music"?(O(),$("div",{key:0,class:"is-size-7 has-text-grey",textContent:j(t.$filters.toDate(d.item.date_released))},null,8,m5)):bt("",!0)]),S("div",g5,[S("a",{onClick:Ie(f=>r.open_dialog(d.item),["prevent","stop"])},[E(a,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,b5)])],8,d5)):(O(),$("div",c5,[S("span",{id:`index_${d.index}`,class:"tag is-small has-text-weight-bold",textContent:j(d.index)},null,8,u5)]))],64))),128)),(O(),vt(fs,{to:"#app"},[E(l,{item:i.selected_item,media_kind:n.media_kind,show:i.show_details_modal,onClose:e[0]||(e[0]=d=>i.show_details_modal=!1),onRemovePodcast:e[1]||(e[1]=d=>r.open_remove_podcast_dialog()),onPlayCountChanged:e[2]||(e[2]=d=>r.play_count_changed())},null,8,["item","media_kind","show"]),E(u,{actions:r.actions,show:i.show_remove_podcast_modal,title:t.$t("page.podcast.remove-podcast"),onCancel:e[3]||(e[3]=d=>i.show_remove_podcast_modal=!1),onRemove:r.remove_podcast},{content:D(()=>[E(c,{keypath:"list.albums.info",tag:"p",scope:"global"},{separator:D(()=>e[4]||(e[4]=[S("br",null,null,-1)])),name:D(()=>[S("b",{textContent:j(i.rss_playlist_to_remove.name)},null,8,y5)]),_:1})]),_:1},8,["actions","show","title","onRemove"])]))],64)}const Gn=it(l5,[["render",_5]]),v5={name:"ControlTabList",props:{links:{required:!0,type:Array}}},S5={class:"section py-0 tabs-section"},E5={class:"container"},w5={class:"columns is-centered my-0"},k5={class:"column is-four-fifths py-0"},C5={class:"tabs is-centered is-small"},T5=["onClick","onKeypress"],A5=["textContent"];function O5(t,e,n,s,i,r){const o=C("mdicon"),a=C("router-link");return O(),$("section",S5,[S("div",E5,[S("div",w5,[S("div",k5,[S("div",C5,[S("ul",null,[(O(!0),$(ht,null,ce(n.links,l=>(O(),vt(a,{key:l.to.name,to:{name:l.to.name},custom:""},{default:D(({navigate:c,isActive:u})=>[S("li",{class:qt({"is-active":u})},[S("a",{onClick:c,onKeypress:qv(c,["enter"])},[l.icon?(O(),vt(o,{key:0,class:"icon is-small",name:l.icon},null,8,["name"])):bt("",!0),S("span",{class:qt({"is-hidden-mobile":l.icon}),textContent:j(t.$t(l.key))},null,10,A5)],40,T5)],2)]),_:2},1032,["to"]))),128))])])])])])])}const Yp=it(v5,[["render",O5],["__scopeId","data-v-5c0ac09b"]]),x5={name:"TabsMusic",components:{ControlTabList:Yp},setup(){return{servicesStore:je()}},computed:{links(){const t=[{to:{name:"music-history"},icon:"history",key:"page.music.tabs.history"},{to:{name:"music-artists"},icon:"account-music",key:"page.music.tabs.artists"},{to:{name:"music-albums"},icon:"album",key:"page.music.tabs.albums"},{to:{name:"music-genres"},icon:"speaker",key:"page.music.tabs.genres"},{to:{name:"music-composers"},icon:"book-open-page-variant",key:"page.music.tabs.composers"}];return this.servicesStore.spotify.webapi_token_valid&&t.push({to:{name:"music-spotify"},icon:"spotify",key:"page.music.tabs.spotify"}),t}}};function I5(t,e,n,s,i,r){const o=C("control-tab-list");return O(),vt(o,{links:r.links},null,8,["links"])}const qs=it(x5,[["render",I5]]),sy={load(t){return tt.library_albums("music")},set(t,e){t.albums_list=new Tt(e.data)}},N5={name:"PageAlbums",components:{ContentWithHeading:ne,ControlDropdown:Dr,ControlSwitch:Rr,HeadingTitle:se,IndexButtonList:Is,ListAlbums:Gn,TabsMusic:qs},beforeRouteEnter(t,e,n){sy.load(t).then(s=>{n(i=>sy.set(i,s))})},setup(){return{uiStore:Un(),servicesStore:je()}},data(){return{albums_list:new Tt,groupings:[{id:1,name:this.$t("page.albums.sort.name"),options:{index:{field:"name_sort",type:String}}},{id:2,name:this.$t("page.albums.sort.recently-added"),options:{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}}},{id:3,name:this.$t("page.albums.sort.recently-released"),options:{criteria:[{field:"date_released",order:-1,type:Date}],index:{field:"date_released",type:Date}}},{id:4,name:this.$t("page.albums.sort.artist-name"),options:{criteria:[{field:"artist",type:String},{field:"name_sort",type:String}],index:{field:"artist",type:String}}},{id:5,name:this.$t("page.albums.sort.artist-date"),options:{criteria:[{field:"artist",type:String},{field:"date_released",type:Date}],index:{field:"artist",type:String}}}]}},computed:{albums(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.albums_sort);return t.filters=[e=>!this.uiStore.hide_singles||e.track_count>2,e=>!this.uiStore.hide_spotify||e.data_kind!=="spotify"],this.albums_list.group(t)},heading(){return{title:this.$t("page.albums.title"),subtitle:[{key:"count.albums",count:this.albums.count}]}},spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid}}},P5={class:"columns"},R5={class:"column"},L5=["textContent"],D5=["textContent"],$5=["textContent"],M5=["textContent"],F5=["textContent"],V5={class:"column"},H5=["textContent"];function U5(t,e,n,s,i,r){const o=C("tabs-music"),a=C("index-button-list"),l=C("control-switch"),c=C("control-dropdown"),u=C("heading-title"),d=C("list-albums"),f=C("content-with-heading");return O(),$("div",null,[E(o),E(f,null,{options:D(()=>[E(a,{indices:r.albums.indices},null,8,["indices"]),S("div",P5,[S("div",R5,[S("div",{class:"is-size-7 is-uppercase",textContent:j(t.$t("page.albums.filter"))},null,8,L5),E(l,{modelValue:s.uiStore.hide_singles,"onUpdate:modelValue":e[0]||(e[0]=h=>s.uiStore.hide_singles=h)},{label:D(()=>[S("span",{textContent:j(t.$t("page.albums.hide-singles"))},null,8,D5)]),help:D(()=>[S("span",{textContent:j(t.$t("page.albums.hide-singles-help"))},null,8,$5)]),_:1},8,["modelValue"]),r.spotify_enabled?(O(),vt(l,{key:0,modelValue:s.uiStore.hide_spotify,"onUpdate:modelValue":e[1]||(e[1]=h=>s.uiStore.hide_spotify=h)},{label:D(()=>[S("span",{textContent:j(t.$t("page.albums.hide-spotify"))},null,8,M5)]),help:D(()=>[S("span",{textContent:j(t.$t("page.albums.hide-spotify-help"))},null,8,F5)]),_:1},8,["modelValue"])):bt("",!0)]),S("div",V5,[S("div",{class:"is-size-7 is-uppercase",textContent:j(t.$t("page.albums.sort.title"))},null,8,H5),E(c,{value:s.uiStore.albums_sort,"onUpdate:value":e[2]||(e[2]=h=>s.uiStore.albums_sort=h),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[E(u,{content:r.heading},null,8,["content"])]),content:D(()=>[E(d,{items:r.albums},null,8,["items"])]),_:1})])}const j5=it(N5,[["render",U5]]),B5={name:"ModalDialogArtist",components:{ModalDialogPlayable:xs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item.name,handler:this.open,uri:this.item.uri,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.$filters.toDateTime(this.item.time_added)}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"music-artist",params:{id:this.item.id}})}}};function W5(t,e,n,s,i,r){const o=C("modal-dialog-playable");return O(),vt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const fd=it(B5,[["render",W5]]),iy={load(t){return Promise.all([tt.library_artist(t.params.id),tt.library_artist_albums(t.params.id)])},set(t,e){t.artist=e[0].data,t.albums_list=new Tt(e[1].data)}},q5={name:"PageArtist",components:{ContentWithHeading:ne,ControlButton:Qe,ControlDropdown:Dr,ControlSwitch:Rr,HeadingTitle:se,ListAlbums:Gn,ModalDialogArtist:fd},beforeRouteEnter(t,e,n){iy.load(t).then(s=>{n(i=>iy.set(i,s))})},setup(){return{servicesStore:je(),uiStore:Un()}},data(){return{albums_list:new Tt,artist:{},groupings:[{id:1,name:this.$t("page.artist.sort.name"),options:{criteria:[{field:"name_sort",type:String}]}},{id:2,name:this.$t("page.artist.sort.release-date"),options:{criteria:[{field:"date_released",type:Date}]}}],show_details_modal:!1}},computed:{albums(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artist_albums_sort);return t.filters=[e=>!this.uiStore.hide_spotify||e.data_kind!=="spotify"],this.albums_list.group(t)},heading(){return{title:this.artist.name,subtitle:[{key:"count.albums",count:this.albums.count},{handler:this.open_tracks,key:"count.tracks",count:this.track_count}]}},spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid},track_count(){return[...this.albums].reduce((t,e)=>t+(e.isItem?e.item.track_count:0),0)}},methods:{open_tracks(){this.$router.push({name:"music-artist-tracks",params:{id:this.artist.id}})},play(){tt.player_play_uri(this.albums.items.map(t=>t.uri).join(),!0)},showDetails(){this.show_details_modal=!0}}},G5={class:"columns"},z5={class:"column"},K5=["textContent"],X5=["textContent"],Y5=["textContent"],Z5={class:"column"},J5=["textContent"];function Q5(t,e,n,s,i,r){const o=C("control-switch"),a=C("control-dropdown"),l=C("heading-title"),c=C("control-button"),u=C("list-albums"),d=C("modal-dialog-artist"),f=C("content-with-heading");return O(),$("div",null,[E(f,null,{options:D(()=>[S("div",G5,[S("div",z5,[S("div",{class:"is-size-7 is-uppercase",textContent:j(t.$t("page.artist.filter"))},null,8,K5),r.spotify_enabled?(O(),vt(o,{key:0,modelValue:s.uiStore.hide_spotify,"onUpdate:modelValue":e[0]||(e[0]=h=>s.uiStore.hide_spotify=h)},{label:D(()=>[S("span",{textContent:j(t.$t("page.artist.hide-spotify"))},null,8,X5)]),help:D(()=>[S("span",{textContent:j(t.$t("page.artist.hide-spotify-help"))},null,8,Y5)]),_:1},8,["modelValue"])):bt("",!0)]),S("div",Z5,[S("div",{class:"is-size-7 is-uppercase",textContent:j(t.$t("page.artist.sort.title"))},null,8,J5),E(a,{value:s.uiStore.artist_albums_sort,"onUpdate:value":e[1]||(e[1]=h=>s.uiStore.artist_albums_sort=h),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[E(l,{content:r.heading},null,8,["content"])]),"heading-right":D(()=>[E(c,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"]),E(c,{button:{handler:r.play,icon:"shuffle",key:"page.artist.shuffle"}},null,8,["button"])]),content:D(()=>[E(u,{items:r.albums},null,8,["items"]),E(d,{item:i.artist,show:i.show_details_modal,onClose:e[2]||(e[2]=h=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const t6=it(q5,[["render",Q5]]),e6={name:"ListAlbumsSpotify",components:{ControlImage:tr,ModalDialogAlbumSpotify:fS},props:{items:{required:!0,type:Object}},setup(){return{settingsStore:bi()}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(t){this.$router.push({name:"music-spotify-album",params:{id:t.id}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},n6=["onClick"],s6={class:"media-content"},i6=["textContent"],r6=["textContent"],o6=["textContent"],a6={class:"media-right"},l6=["onClick"];function c6(t,e,n,s,i,r){const o=C("control-image"),a=C("mdicon"),l=C("modal-dialog-album-spotify");return O(),$(ht,null,[(O(!0),$(ht,null,ce(n.items,c=>{var u,d,f;return O(),$("div",{key:c.id,class:"media is-align-items-center is-clickable mb-0",onClick:h=>r.open(c)},[s.settingsStore.show_cover_artwork_in_album_lists?(O(),vt(o,{key:0,url:((d=(u=c.images)==null?void 0:u[0])==null?void 0:d.url)??"",artist:c.artist,album:c.name,class:"media-left is-small"},null,8,["url","artist","album"])):bt("",!0),S("div",s6,[S("div",{class:"is-size-6 has-text-weight-bold",textContent:j(c.name)},null,8,i6),S("div",{class:"is-size-7 has-text-weight-bold has-text-grey",textContent:j((f=c.artists[0])==null?void 0:f.name)},null,8,r6),S("div",{class:"is-size-7 has-text-grey",textContent:j(t.$filters.toDate(c.release_date))},null,8,o6)]),S("div",a6,[S("a",{onClick:Ie(h=>r.open_dialog(c),["prevent","stop"])},[E(a,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,l6)])],8,n6)}),128)),(O(),vt(fs,{to:"#app"},[E(l,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=c=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const qa=it(e6,[["render",c6]]),u6={name:"ModalDialogArtistSpotify",components:{ModalDialogPlayable:xs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t,e;return{name:this.item.name,handler:this.open,uri:this.item.uri,properties:[{key:"property.popularity",value:[this.item.popularity,(t=this.item.followers)==null?void 0:t.total].join(" / ")},{key:"property.genres",value:(e=this.item.genres)==null?void 0:e.join(", ")}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"music-spotify-artist",params:{id:this.item.id}})}}};function d6(t,e,n,s,i,r){const o=C("modal-dialog-playable");return O(),vt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const hS=it(u6,[["render",d6]]);function f6(t){return t.scrollHeight}function h6(t){return t.scrollWidth}function p6(t,e){t.scrollTop=t.scrollHeight-e+t.scrollTop}function m6(t,e){t.scrollLeft=t.scrollWidth-e+t.scrollLeft}const g6=S("div",{class:"loading"},"Loading...",-1),b6=S("div",{class:"no-more"},"No more.",-1),y6=S("div",{class:"no-results"},"No results.",-1),_6=S("div",{class:"error"},"Error.",-1),Zp=pi({__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=rs();let i=rs("loading"),r=rs(n.isInitial),o=0;function a(){Pr(()=>{var g,_;n.position==="top"?p6((g=n.container)!=null?g:document.documentElement,o):n.position==="left"&&m6((_=n.container)!=null?_:document.documentElement,o)})}function l(g,_){return g===0?r.value?(u(),"no-results"):(c(),"no-more"):g!==void 0&&_!==void 0&&g<_?(c(),"no-more"):(r.value=!1,a(),y(),"loading")}function c(){r.value=!1,p("no-more"),a()}function u(){r.value=!1,p("no-results"),a()}function d(){r.value=!1,p("error"),a()}function f(){r.value=!0,p("loading"),y()}function h(){p("loading"),y()}function p(g){i.value=g}function m(){s.value&&v.unobserve(s.value)}function y(){s.value&&v.observe(s.value)}function b(){return new IntersectionObserver(([g])=>{var _,w;g.isIntersecting&&(n.position==="top"?o=f6((_=n.container)!=null?_:document.documentElement):n.position==="left"&&(o=h6((w=n.container)!=null?w: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"&&fv(()=>{v&&m(),v=b(),y()},{flush:"post"}),Kn(()=>n.isInitial,g=>{g&&f()}),Kn(r,g=>{g||e("update:isInitial",!1)}),(g,_)=>(O(),$("div",{class:"vue-eternal-loading",ref_key:"rootRef",ref:s},[Mn(i)==="loading"?be(g.$slots,"loading",eo(so({key:0},{isFirstLoad:Mn(r)})),()=>[g6]):Mn(i)==="no-more"?be(g.$slots,"no-more",eo(so({key:1},{retry:h})),()=>[b6]):Mn(i)==="no-results"?be(g.$slots,"no-results",eo(so({key:2},{retry:h})),()=>[y6]):Mn(i)==="error"?be(g.$slots,"error",eo(so({key:3},{retry:h})),()=>[_6]):bt("",!0)],512))}}),hh=50,ry={load(t){const e=new Ws;return e.setAccessToken(je().spotify.webapi_token),Promise.all([e.getArtist(t.params.id),e.getArtistAlbums(t.params.id,{include_groups:"album,single",limit:hh,market:je().spotify.webapi_country,offset:0})])},set(t,e){t.artist=e.shift(),t.albums=[],t.total=0,t.offset=0,t.append_albums(e.shift())}},v6={name:"PageArtistSpotify",components:{ContentWithHeading:ne,ControlButton:Qe,HeadingTitle:se,ListAlbumsSpotify:qa,ModalDialogArtistSpotify:hS,VueEternalLoading:Zp},beforeRouteEnter(t,e,n){ry.load(t).then(s=>{n(i=>ry.set(i,s))})},setup(){return{servicesStore:je()}},data(){return{albums:[],artist:{},offset:0,show_details_modal:!1,total:0}},computed:{heading(){return{title:this.$t("artist.name"),subtitle:[{key:"count.albums",count:this.total}]}}},methods:{append_albums(t){this.albums=this.albums.concat(t.items),this.total=t.total,this.offset+=t.limit},load_next({loaded:t}){const e=new Ws;e.setAccessToken(this.servicesStore.spotify.webapi_token),e.getArtistAlbums(this.artist.id,{include_groups:"album,single",limit:hh,offset:this.offset}).then(n=>{this.append_albums(n),t(n.items.length,hh)})},play(){this.show_album_details_modal=!1,tt.player_play_uri(this.artist.uri,!0)},showDetails(){this.show_details_modal=!0}}},S6={class:"columns is-centered"},E6={class:"column has-text-centered"};function w6(t,e,n,s,i,r){const o=C("heading-title"),a=C("control-button"),l=C("list-albums-spotify"),c=C("mdicon"),u=C("vue-eternal-loading"),d=C("modal-dialog-artist-spotify"),f=C("content-with-heading");return O(),$("div",null,[E(f,null,{"heading-left":D(()=>[E(o,{content:r.heading},null,8,["content"])]),"heading-right":D(()=>[E(a,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"shuffle",key:"page.spotify.artist.shuffle"}},null,8,["button"])]),content:D(()=>[E(l,{items:i.albums},null,8,["items"]),i.offset[S("div",S6,[S("div",E6,[E(c,{class:"icon mdi-spin",name:"loading"})])])]),"no-more":D(()=>e[1]||(e[1]=[S("br",null,null,-1)])),"no-results":D(()=>e[2]||(e[2]=[S("br",null,null,-1)])),_:1},8,["load"])):bt("",!0),E(d,{item:i.artist,show:i.show_details_modal,onClose:e[0]||(e[0]=h=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const k6=it(v6,[["render",w6]]),oy={load(t){return Promise.all([tt.library_artist(t.params.id),tt.library_artist_tracks(t.params.id)])},set(t,e){t.artist=e[0].data,t.tracks_list=new Tt(e[1].data.tracks)}},C6={name:"PageArtistTracks",components:{ContentWithHeading:ne,ControlButton:Qe,ControlDropdown:Dr,ControlSwitch:Rr,HeadingTitle:se,IndexButtonList:Is,ListTracks:Hn,ModalDialogArtist:fd},beforeRouteEnter(t,e,n){oy.load(t).then(s=>{n(i=>oy.set(i,s))})},setup(){return{servicesStore:je(),uiStore:Un()}},data(){return{artist:{},groupings:[{id:1,name:this.$t("page.artist.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("page.artist.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}],show_details_modal:!1,tracks_list:new Tt}},computed:{album_count(){return new Set([...this.tracks].filter(t=>t.isItem).map(t=>t.item.album_id)).size},heading(){return{title:this.artist.name,subtitle:[{handler:this.openArtist,key:"count.albums",count:this.album_count},{key:"count.tracks",count:this.tracks.count}]}},spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid},track_uris(){return this.tracks_list.items.map(t=>t.uri).join()},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artist_tracks_sort);return t.filters=[e=>!this.uiStore.hide_spotify||e.data_kind!=="spotify"],this.tracks_list.group(t)}},methods:{openArtist(){this.show_details_modal=!1,this.$router.push({name:"music-artist",params:{id:this.artist.id}})},play(){tt.player_play_uri(this.tracks_list.items.map(t=>t.uri).join(),!0)},showDetails(){this.show_details_modal=!0}}},T6={class:"columns"},A6={class:"column"},O6=["textContent"],x6=["textContent"],I6=["textContent"],N6={class:"column"},P6=["textContent"];function R6(t,e,n,s,i,r){const o=C("index-button-list"),a=C("control-switch"),l=C("control-dropdown"),c=C("heading-title"),u=C("control-button"),d=C("list-tracks"),f=C("modal-dialog-artist"),h=C("content-with-heading");return O(),$("div",null,[E(h,null,{options:D(()=>[E(o,{indices:r.tracks.indices},null,8,["indices"]),S("div",T6,[S("div",A6,[S("p",{class:"is-size-7 is-uppercase",textContent:j(t.$t("page.artist.filter"))},null,8,O6),r.spotify_enabled?(O(),vt(a,{key:0,modelValue:s.uiStore.hide_spotify,"onUpdate:modelValue":e[0]||(e[0]=p=>s.uiStore.hide_spotify=p)},{label:D(()=>[S("span",{textContent:j(t.$t("page.artist.hide-spotify"))},null,8,x6)]),help:D(()=>[S("span",{textContent:j(t.$t("page.artist.hide-spotify-help"))},null,8,I6)]),_:1},8,["modelValue"])):bt("",!0)]),S("div",N6,[S("p",{class:"is-size-7 is-uppercase",textContent:j(t.$t("page.artist.sort.title"))},null,8,P6),E(l,{value:s.uiStore.artist_tracks_sort,"onUpdate:value":e[1]||(e[1]=p=>s.uiStore.artist_tracks_sort=p),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[E(c,{content:r.heading},null,8,["content"])]),"heading-right":D(()=>[E(u,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"]),E(u,{button:{handler:r.play,icon:"shuffle",key:"page.artist.shuffle"}},null,8,["button"])]),content:D(()=>[E(d,{items:r.tracks,uris:r.track_uris},null,8,["items","uris"]),E(f,{item:i.artist,show:i.show_details_modal,onClose:e[2]||(e[2]=p=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const L6=it(C6,[["render",R6]]),D6={name:"ListArtists",components:{ModalDialogArtist:fd},props:{items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(t){this.selected_item=t;const e=t.media_kind==="audiobook"?"audiobooks-artist":"music-artist";this.$router.push({name:e,params:{id:t.id}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},$6={key:0,class:"py-5"},M6=["id","textContent"],F6=["onClick"],V6={class:"media-content"},H6=["textContent"],U6={class:"media-right"},j6=["onClick"];function B6(t,e,n,s,i,r){const o=C("mdicon"),a=C("modal-dialog-artist");return O(),$(ht,null,[(O(!0),$(ht,null,ce(n.items,l=>(O(),$(ht,{key:l.itemId},[l.isItem?(O(),$("div",{key:1,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l.item)},[S("div",V6,[S("p",{class:"title is-6",textContent:j(l.item.name)},null,8,H6)]),S("div",U6,[S("a",{onClick:Ie(c=>r.open_dialog(l.item),["prevent","stop"])},[E(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,j6)])],8,F6)):(O(),$("div",$6,[S("span",{id:`index_${l.index}`,class:"tag is-small has-text-weight-bold",textContent:j(l.index)},null,8,M6)]))],64))),128)),(O(),vt(fs,{to:"#app"},[E(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const Xc=it(D6,[["render",B6]]),ay={load(t){return tt.library_artists("music")},set(t,e){t.artists_list=new Tt(e.data)}},W6={name:"PageArtists",components:{ContentWithHeading:ne,ControlDropdown:Dr,ControlSwitch:Rr,HeadingTitle:se,IndexButtonList:Is,ListArtists:Xc,TabsMusic:qs},beforeRouteEnter(t,e,n){ay.load(t).then(s=>{n(i=>ay.set(i,s))})},setup(){return{servicesStore:je(),uiStore:Un()}},data(){return{artists_list:new Tt,groupings:[{id:1,name:this.$t("page.artists.sort.name"),options:{index:{field:"name_sort",type:String}}},{id:2,name:this.$t("page.artists.sort.recently-added"),options:{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}}}]}},computed:{artists(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artists_sort);return t.filters=[e=>!this.uiStore.hide_singles||e.track_count>e.album_count*2,e=>!this.uiStore.hide_spotify||e.data_kind!=="spotify"],this.artists_list.group(t)},heading(){return{title:this.$t("page.artists.title"),subtitle:[{key:"count.artists",count:this.artists.count}]}},spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid}}},q6={class:"columns"},G6={class:"column"},z6=["textContent"],K6=["textContent"],X6=["textContent"],Y6={key:0,class:"field"},Z6=["textContent"],J6=["textContent"],Q6={class:"column"},tF=["textContent"];function eF(t,e,n,s,i,r){const o=C("tabs-music"),a=C("index-button-list"),l=C("control-switch"),c=C("control-dropdown"),u=C("heading-title"),d=C("list-artists"),f=C("content-with-heading");return O(),$("div",null,[E(o),E(f,null,{options:D(()=>[E(a,{indices:r.artists.indices},null,8,["indices"]),S("div",q6,[S("div",G6,[S("div",{class:"is-size-7 is-uppercase",textContent:j(t.$t("page.artists.filter"))},null,8,z6),E(l,{modelValue:s.uiStore.hide_singles,"onUpdate:modelValue":e[0]||(e[0]=h=>s.uiStore.hide_singles=h)},{label:D(()=>[S("span",{textContent:j(t.$t("page.artists.hide-singles"))},null,8,K6)]),help:D(()=>[S("span",{textContent:j(t.$t("page.artists.hide-singles-help"))},null,8,X6)]),_:1},8,["modelValue"]),r.spotify_enabled?(O(),$("div",Y6,[E(l,{modelValue:s.uiStore.hide_spotify,"onUpdate:modelValue":e[1]||(e[1]=h=>s.uiStore.hide_spotify=h)},{label:D(()=>[S("span",{textContent:j(t.$t("page.artists.hide-spotify"))},null,8,Z6)]),help:D(()=>[S("span",{textContent:j(t.$t("page.artists.hide-spotify-help"))},null,8,J6)]),_:1},8,["modelValue"])])):bt("",!0)]),S("div",Q6,[S("div",{class:"is-size-7 is-uppercase",textContent:j(t.$t("page.artists.sort.title"))},null,8,tF),E(c,{value:s.uiStore.artists_sort,"onUpdate:value":e[2]||(e[2]=h=>s.uiStore.artists_sort=h),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[E(u,{content:r.heading},null,8,["content"])]),content:D(()=>[E(d,{items:r.artists},null,8,["items"])]),_:1})])}const nF=it(W6,[["render",eF]]),ly={load(t){return Promise.all([tt.library_album(t.params.id),tt.library_album_tracks(t.params.id)])},set(t,e){t.album=e[0].data,t.tracks=new Tt(e[1].data)}},sF={name:"PageAudiobooksAlbum",components:{ContentWithHero:ud,ControlButton:Qe,ControlImage:tr,ListTracks:Hn,ModalDialogAlbum:dd},beforeRouteEnter(t,e,n){ly.load(t).then(s=>{n(i=>ly.set(i,s))})},data(){return{album:{},show_details_modal:!1,tracks:new Tt}},methods:{openArtist(){this.show_details_modal=!1,this.$router.push({name:"audiobooks-artist",params:{id:this.album.artist_id}})},play(){tt.player_play_uri(this.album.uri,!1)},showDetails(){this.show_details_modal=!0}}},iF=["textContent"],rF={class:"subtitle is-6"},oF=["textContent"],aF=["textContent"],lF={class:"buttons is-centered-mobile mt-5"};function cF(t,e,n,s,i,r){const o=C("control-button"),a=C("control-image"),l=C("list-tracks"),c=C("modal-dialog-album"),u=C("content-with-hero");return O(),$("div",null,[E(u,null,{"heading-left":D(()=>[S("div",{class:"title is-5",textContent:j(i.album.name)},null,8,iF),S("div",rF,[S("a",{onClick:e[0]||(e[0]=(...d)=>r.openArtist&&r.openArtist(...d)),textContent:j(i.album.artist)},null,8,oF)]),S("div",{class:"is-size-7 is-uppercase has-text-centered-mobile",textContent:j(t.$t("count.tracks",{count:i.album.track_count}))},null,8,aF),S("div",lF,[E(o,{button:{handler:r.play,icon:"play",key:"page.audiobooks.album.play"}},null,8,["button"]),E(o,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"])])]),"heading-right":D(()=>[E(a,{url:i.album.artwork_url,artist:i.album.artist,album:i.album.name,class:"is-clickable is-medium",onClick:r.showDetails},null,8,["url","artist","album","onClick"])]),content:D(()=>[E(l,{items:i.tracks,show_progress:!0,uris:i.album.uri},null,8,["items","uris"]),E(c,{item:i.album,show:i.show_details_modal,media_kind:"audiobook",onClose:e[1]||(e[1]=d=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const uF=it(sF,[["render",cF]]),dF={name:"TabsAudiobooks",components:{ControlTabList:Yp},computed:{links(){return[{to:{name:"audiobooks-artists"},icon:"account-music",key:"page.audiobooks.tabs.authors"},{to:{name:"audiobooks-albums"},icon:"album",key:"page.audiobooks.tabs.audiobooks"},{to:{name:"audiobooks-genres"},icon:"speaker",key:"page.audiobooks.tabs.genres"}]}}};function fF(t,e,n,s,i,r){const o=C("control-tab-list");return O(),vt(o,{links:r.links},null,8,["links"])}const Jp=it(dF,[["render",fF]]),cy={load(t){return tt.library_albums("audiobook")},set(t,e){t.albums=new Tt(e.data,{index:{field:"name_sort",type:String}})}},hF={name:"PageAudiobooksAlbums",components:{ContentWithHeading:ne,IndexButtonList:Is,ListAlbums:Gn,TabsAudiobooks:Jp,HeadingTitle:se},beforeRouteEnter(t,e,n){cy.load(t).then(s=>{n(i=>cy.set(i,s))})},data(){return{albums:new Tt}},computed:{heading(){return{title:this.$t("page.audiobooks.albums.title"),subtitle:[{key:"count.audiobooks",count:this.albums.count}]}}}};function pF(t,e,n,s,i,r){const o=C("tabs-audiobooks"),a=C("index-button-list"),l=C("heading-title"),c=C("list-albums"),u=C("content-with-heading");return O(),$("div",null,[E(o),E(u,null,{options:D(()=>[E(a,{indices:i.albums.indices},null,8,["indices"])]),"heading-left":D(()=>[E(l,{content:r.heading},null,8,["content"])]),content:D(()=>[E(c,{items:i.albums},null,8,["items"])]),_:1})])}const mF=it(hF,[["render",pF]]),uy={load(t){return Promise.all([tt.library_artist(t.params.id),tt.library_artist_albums(t.params.id)])},set(t,e){t.artist=e[0].data,t.albums=new Tt(e[1].data)}},gF={name:"PageAudiobooksArtist",components:{ContentWithHeading:ne,ControlButton:Qe,HeadingTitle:se,ListAlbums:Gn,ModalDialogArtist:fd},beforeRouteEnter(t,e,n){uy.load(t).then(s=>{n(i=>uy.set(i,s))})},data(){return{albums:new Tt,artist:{},show_details_modal:!1}},computed:{heading(){return this.artist.name?{title:this.artist.name,subtitle:[{key:"count.audiobooks",count:this.artist.album_count}]}:{}}},methods:{play(){tt.player_play_uri(this.albums.items.map(t=>t.uri).join(),!1)},showDetails(){this.show_details_modal=!0}}};function bF(t,e,n,s,i,r){const o=C("heading-title"),a=C("control-button"),l=C("list-albums"),c=C("modal-dialog-artist"),u=C("content-with-heading");return O(),$("div",null,[E(u,null,{"heading-left":D(()=>[E(o,{content:r.heading},null,8,["content"])]),"heading-right":D(()=>[E(a,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"play",key:"page.audiobooks.artist.play"}},null,8,["button"])]),content:D(()=>[E(l,{items:i.albums},null,8,["items"]),E(c,{item:i.artist,show:i.show_details_modal,onClose:e[0]||(e[0]=d=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const yF=it(gF,[["render",bF]]),dy={load(t){return tt.library_artists("audiobook")},set(t,e){t.artists=new Tt(e.data,{index:{field:"name_sort",type:String}})}},_F={name:"PageAudiobooksArtists",components:{ContentWithHeading:ne,HeadingTitle:se,IndexButtonList:Is,ListArtists:Xc,TabsAudiobooks:Jp},beforeRouteEnter(t,e,n){dy.load(t).then(s=>{n(i=>dy.set(i,s))})},data(){return{artists:new Tt}},computed:{heading(){return{title:this.$t("page.audiobooks.artists.title"),subtitle:[{key:"count.authors",count:this.artists.count}]}}}};function vF(t,e,n,s,i,r){const o=C("tabs-audiobooks"),a=C("index-button-list"),l=C("heading-title"),c=C("list-artists"),u=C("content-with-heading");return O(),$("div",null,[E(o),E(u,null,{options:D(()=>[E(a,{indices:i.artists.indices},null,8,["indices"])]),"heading-left":D(()=>[E(l,{content:r.heading},null,8,["content"])]),content:D(()=>[E(c,{items:i.artists},null,8,["items"])]),_:1})])}const SF=it(_F,[["render",vF]]),EF={name:"ModalDialogGenre",components:{ModalDialogPlayable:xs},props:{item:{required:!0,type:Object},media_kind:{required:!0,type:String},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item.name,handler:this.open,expression:`genre is "${this.item.name}" and media_kind is ${this.media_kind}`,properties:[{key:"property.albums",value:this.item.album_count},{key:"property.tracks",value:this.item.track_count},{key:"property.duration",value:this.$filters.toTimecode(this.item.length_ms)}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"genre-albums",params:{name:this.item.name},query:{media_kind:this.media_kind}})}}};function wF(t,e,n,s,i,r){const o=C("modal-dialog-playable");return O(),vt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const Qp=it(EF,[["render",wF]]),kF={name:"ListGenres",components:{ModalDialogGenre:Qp},props:{items:{required:!0,type:Object},media_kind:{required:!0,type:String}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(t){this.$router.push({name:"genre-albums",params:{name:t.name},query:{media_kind:this.media_kind}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},CF={key:0,class:"py-5"},TF={class:"media-content"},AF=["id","textContent"],OF=["onClick"],xF={class:"media-content"},IF=["textContent"],NF={class:"media-right"},PF=["onClick"];function RF(t,e,n,s,i,r){const o=C("mdicon"),a=C("modal-dialog-genre");return O(),$(ht,null,[(O(!0),$(ht,null,ce(n.items,l=>(O(),$(ht,{key:l.itemId},[l.isItem?(O(),$("div",{key:1,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l.item)},[S("div",xF,[S("p",{class:"title is-6",textContent:j(l.item.name)},null,8,IF)]),S("div",NF,[S("a",{onClick:Ie(c=>r.open_dialog(l.item),["prevent","stop"])},[E(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,PF)])],8,OF)):(O(),$("div",CF,[S("div",TF,[S("span",{id:`index_${l.index}`,class:"tag is-small has-text-weight-bold",textContent:j(l.index)},null,8,AF)])]))],64))),128)),(O(),vt(fs,{to:"#app"},[E(a,{item:i.selected_item,media_kind:n.media_kind,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","media_kind","show"])]))],64)}const pS=it(kF,[["render",RF]]),fy={load(t){return tt.library_genres("audiobook")},set(t,e){t.genres=new Tt(e.data.genres,{index:{field:"name_sort",type:String}})}},LF={name:"PageAudiobooksGenres",components:{ContentWithHeading:ne,HeadingTitle:se,IndexButtonList:Is,ListGenres:pS,TabsAudiobooks:Jp},beforeRouteEnter(t,e,n){fy.load(t).then(s=>{n(i=>fy.set(i,s))})},data(){return{genres:new Tt}},computed:{heading(){return{title:this.$t("page.genres.title"),subtitle:[{key:"count.genres",count:this.genres.total}]}}}};function DF(t,e,n,s,i,r){const o=C("tabs-audiobooks"),a=C("index-button-list"),l=C("heading-title"),c=C("list-genres"),u=C("content-with-heading");return O(),$("div",null,[E(o),E(u,null,{options:D(()=>[E(a,{indices:i.genres.indices},null,8,["indices"])]),"heading-left":D(()=>[E(l,{content:r.heading},null,8,["content"])]),content:D(()=>[E(c,{items:i.genres,media_kind:"audiobook"},null,8,["items"])]),_:1})])}const $F=it(LF,[["render",DF]]),MF={name:"ModalDialogComposer",components:{ModalDialogPlayable:xs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item.name,handler:this.open_albums,expression:`composer is "${this.item.name}" and media_kind is music`,properties:[{key:"property.albums",value:this.item.album_count,handler:this.open_albums},{key:"property.tracks",value:this.item.track_count,handler:this.open_tracks},{key:"property.duration",value:this.$filters.toTimecode(this.item.length_ms)}]}}},methods:{open_albums(){this.$emit("close"),this.$router.push({name:"music-composer-albums",params:{name:this.item.name}})},open_tracks(){this.$emit("close"),this.$router.push({name:"music-composer-tracks",params:{name:this.item.name}})}}};function FF(t,e,n,s,i,r){const o=C("modal-dialog-playable");return O(),vt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const tm=it(MF,[["render",FF]]),hy={load(t){return Promise.all([tt.library_composer(t.params.name),tt.library_composer_albums(t.params.name)])},set(t,e){t.composer=e[0].data,t.albums=new Tt(e[1].data.albums)}},VF={name:"PageComposerAlbums",components:{ContentWithHeading:ne,ControlButton:Qe,HeadingTitle:se,ListAlbums:Gn,ModalDialogComposer:tm},beforeRouteEnter(t,e,n){hy.load(t).then(s=>{n(i=>hy.set(i,s))})},data(){return{albums:new Tt,composer:{},show_details_modal:!1}},computed:{expression(){return`composer is "${this.composer.name}" and media_kind is music`},heading(){return{title:this.composer.name,subtitle:[{key:"count.albums",count:this.composer.album_count},{handler:this.open_tracks,key:"count.tracks",count:this.composer.track_count}]}}},methods:{open_tracks(){this.$router.push({name:"music-composer-tracks",params:{name:this.composer.name}})},play(){tt.player_play_expression(this.expression,!0)},showDetails(){this.show_details_modal=!0}}};function HF(t,e,n,s,i,r){const o=C("heading-title"),a=C("control-button"),l=C("list-albums"),c=C("modal-dialog-composer"),u=C("content-with-heading");return O(),$("div",null,[E(u,null,{"heading-left":D(()=>[E(o,{content:r.heading},null,8,["content"])]),"heading-right":D(()=>[E(a,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"shuffle",key:"page.composer.shuffle"}},null,8,["button"])]),content:D(()=>[E(l,{items:i.albums},null,8,["items"]),E(c,{item:i.composer,show:i.show_details_modal,onClose:e[0]||(e[0]=d=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const UF=it(VF,[["render",HF]]),py={load(t){return Promise.all([tt.library_composer(t.params.name),tt.library_composer_tracks(t.params.name)])},set(t,e){t.composer=e[0].data,t.tracks_list=new Tt(e[1].data.tracks)}},jF={name:"PageComposerTracks",components:{ContentWithHeading:ne,ControlButton:Qe,ControlDropdown:Dr,HeadingTitle:se,IndexButtonList:Is,ListTracks:Hn,ModalDialogComposer:tm},beforeRouteEnter(t,e,n){py.load(t).then(s=>{n(i=>py.set(i,s))})},setup(){return{uiStore:Un()}},data(){return{composer:{},groupings:[{id:1,name:this.$t("page.composer.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("page.composer.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}],show_details_modal:!1,tracks_list:new Tt}},computed:{expression(){return`composer is "${this.composer.name}" and media_kind is music`},heading(){return{title:this.composer.name,subtitle:[{handler:this.open_albums,key:"count.albums",count:this.composer.album_count},{key:"count.tracks",count:composer.track_count}]}},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.composer_tracks_sort);return this.tracks_list.group(t)}},methods:{open_albums(){this.$router.push({name:"music-composer-albums",params:{name:this.composer.name}})},play(){tt.player_play_expression(this.expression,!0)},showDetails(){this.show_details_modal=!0}}},BF={class:"columns"},WF={class:"column"},qF=["textContent"];function GF(t,e,n,s,i,r){const o=C("index-button-list"),a=C("control-dropdown"),l=C("heading-title"),c=C("control-button"),u=C("list-tracks"),d=C("modal-dialog-composer"),f=C("content-with-heading");return O(),$("div",null,[E(f,null,{options:D(()=>[E(o,{indices:r.tracks.indices},null,8,["indices"]),S("div",BF,[S("div",WF,[S("div",{class:"is-size-7 is-uppercase",textContent:j(t.$t("page.artist.sort.title"))},null,8,qF),E(a,{value:s.uiStore.composer_tracks_sort,"onUpdate:value":e[0]||(e[0]=h=>s.uiStore.composer_tracks_sort=h),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[E(l,{content:r.heading},null,8,["content"])]),"heading-right":D(()=>[E(c,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"]),E(c,{button:{handler:r.play,icon:"shuffle",key:"page.composer.shuffle"}},null,8,["button"])]),content:D(()=>[E(u,{items:r.tracks,expression:r.expression},null,8,["items","expression"]),E(d,{item:i.composer,show:i.show_details_modal,onClose:e[1]||(e[1]=h=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const zF=it(jF,[["render",GF]]),KF={name:"ListComposers",components:{ModalDialogComposer:tm},props:{items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(t){this.selected_item=t,this.$router.push({name:"music-composer-albums",params:{name:t.name}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},XF={key:0,class:"py-5"},YF={class:"media-content"},ZF=["id","textContent"],JF=["onClick"],QF={class:"media-content"},tV=["textContent"],eV={class:"media-right"},nV=["onClick"];function sV(t,e,n,s,i,r){const o=C("mdicon"),a=C("modal-dialog-composer");return O(),$(ht,null,[(O(!0),$(ht,null,ce(n.items,l=>(O(),$(ht,{key:l.itemId},[l.isItem?(O(),$("div",{key:1,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l.item)},[S("div",QF,[S("p",{class:"title is-6",textContent:j(l.item.name)},null,8,tV)]),S("div",eV,[S("a",{onClick:Ie(c=>r.open_dialog(l.item),["prevent","stop"])},[E(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,nV)])],8,JF)):(O(),$("div",XF,[S("div",YF,[S("span",{id:`index_${l.index}`,class:"tag is-small has-text-weight-bold",textContent:j(l.index)},null,8,ZF)])]))],64))),128)),(O(),vt(fs,{to:"#app"},[E(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const ph=it(KF,[["render",sV]]),my={load(t){return tt.library_composers("music")},set(t,e){t.composers=new Tt(e.data,{index:{field:"name_sort",type:String}})}},iV={name:"PageComposers",components:{ContentWithHeading:ne,HeadingTitle:se,IndexButtonList:Is,ListComposers:ph,TabsMusic:qs},beforeRouteEnter(t,e,n){my.load(t).then(s=>{n(i=>my.set(i,s))})},data(){return{composers:new Tt}},computed:{heading(){return{title:this.$t("page.composers.title"),subtitle:[{key:"count.composers",count:this.composers.total}]}}}};function rV(t,e,n,s,i,r){const o=C("tabs-music"),a=C("index-button-list"),l=C("heading-title"),c=C("list-composers"),u=C("content-with-heading");return O(),$("div",null,[E(o),E(u,null,{options:D(()=>[E(a,{indices:i.composers.indices},null,8,["indices"])]),"heading-left":D(()=>[E(l,{content:r.heading},null,8,["content"])]),content:D(()=>[E(c,{items:i.composers},null,8,["items"])]),_:1})])}const oV=it(iV,[["render",rV]]),aV={name:"ModalDialogDirectory",components:{ModalDialogPlayable:xs},props:{item:{required:!0,type:String},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item,expression:`path starts with "${this.item}" order by path asc`}}}};function lV(t,e,n,s,i,r){const o=C("modal-dialog-playable");return O(),vt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const mS=it(aV,[["render",lV]]),cV={name:"ListDirectories",components:{ModalDialogDirectory:mS},props:{items:{required:!0,type:Array}},data(){return{selected_item:"",show_details_modal:!1}},computed:{directories(){var n;const t=[];let e="";return(n=this.$route.query)==null||n.directory.split("/").slice(1,-1).forEach((s,i)=>{e=`${e}/${s}`,t.push({index:i,name:s,path:e})}),t}},methods:{open(t){const e={name:"files"};t.index!==0&&(e.query={directory:t.path}),this.$router.push(e)},open_dialog(t){this.selected_item=t.path,this.show_details_modal=!0},open_parent(){this.open(this.directories.slice(-1).pop())}}},uV={key:0,class:"media is-align-items-center mb-0"},dV={class:"media-content"},fV={class:"breadcrumb"},hV=["onClick"],pV=["textContent"],mV={class:"media-right"},gV=["onClick"],bV={class:"media-content"},yV=["textContent"],_V={class:"media-right"},vV=["onClick"];function SV(t,e,n,s,i,r){const o=C("mdicon"),a=C("modal-dialog-directory");return O(),$(ht,null,[t.$route.query.directory?(O(),$("div",uV,[E(o,{class:"icon media-left is-clickable",name:"chevron-left",onClick:r.open_parent},null,8,["onClick"]),S("div",dV,[S("nav",fV,[S("ul",null,[(O(!0),$(ht,null,ce(r.directories,l=>(O(),$("li",{key:l.index},[S("a",{onClick:c=>r.open(l)},[S("span",{textContent:j(l.name)},null,8,pV)],8,hV)]))),128))])])]),S("div",mV,[be(t.$slots,"actions")])])):bt("",!0),(O(!0),$(ht,null,ce(n.items,l=>(O(),$("div",{key:l.path,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l)},[E(o,{class:"media-left icon",name:"folder"}),S("div",bV,[S("p",{class:"title is-6",textContent:j(l.name)},null,8,yV)]),S("div",_V,[S("a",{onClick:Ie(c=>r.open_dialog(l),["prevent","stop"])},[E(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,vV)])],8,gV))),128)),(O(),vt(fs,{to:"#app"},[E(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const EV=it(cV,[["render",SV]]),wV={name:"ModalDialogPlaylist",components:{ModalDialogPlayable:xs},props:{item:{required:!0,type:Object},show:Boolean,uris:{default:"",type:String}},emits:["close"],computed:{playable(){return{name:this.item.name,handler:this.open,uri:this.item.uri,uris:this.uris,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}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"playlist",params:{id:this.item.id}})}}};function kV(t,e,n,s,i,r){const o=C("modal-dialog-playable");return O(),vt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const gS=it(wV,[["render",kV]]),CV={name:"ListPlaylists",components:{ModalDialogPlaylist:gS},props:{items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!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}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},TV=["onClick"],AV={class:"media-content"},OV=["textContent"],xV={class:"media-right"},IV=["onClick"];function NV(t,e,n,s,i,r){const o=C("mdicon"),a=C("modal-dialog-playlist");return O(),$(ht,null,[(O(!0),$(ht,null,ce(n.items,l=>(O(),$("div",{key:l.itemId,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l.item)},[E(o,{class:"media-left icon",name:r.icon(l.item)},null,8,["name"]),S("div",AV,[S("p",{class:"title is-6",textContent:j(l.item.name)},null,8,OV)]),S("div",xV,[S("a",{onClick:Ie(c=>r.open_dialog(l.item),["prevent","stop"])},[E(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,IV)])],8,TV))),128)),(O(),vt(fs,{to:"#app"},[E(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const Yc=it(CV,[["render",NV]]),Fl={load(t){return t.query.directory?tt.library_files(t.query.directory):Promise.resolve()},set(t,e){e?t.directories=e.data.directories.map(n=>t.transform(n.path)):Cr().directories?t.directories=Cr().directories.map(n=>t.transform(n)):tt.config().then(n=>{t.directories=n.data.directories.map(s=>t.transform(s))}),t.playlists=new Tt(e==null?void 0:e.data.playlists),t.tracks=new Tt(e==null?void 0:e.data.tracks)}},PV={name:"PageFiles",components:{ContentWithHeading:ne,ControlButton:Qe,HeadingTitle:se,ListDirectories:EV,ListPlaylists:Yc,ListTracks:Hn,ModalDialogDirectory:mS},beforeRouteEnter(t,e,n){Fl.load(t).then(s=>{n(i=>Fl.set(i,s))})},beforeRouteUpdate(t,e,n){Fl.load(t).then(s=>{Fl.set(this,s),n()})},setup(){return{configurationStore:Cr()}},data(){return{directories:[],playlists:new Tt,show_details_modal:!1,tracks:new Tt}},computed:{current(){var t;return((t=this.$route.query)==null?void 0:t.directory)||"/"},expression(){return`path starts with "${this.current}" order by path asc`},name(){var t;return this.current!=="/"?(t=this.current)==null?void 0:t.slice(this.current.lastIndexOf("/")+1):this.$t("page.files.title")}},methods:{play(){tt.player_play_expression(this.expression,!1)},showDetails(){this.show_details_modal=!0},transform(t){return{name:t.slice(t.lastIndexOf("/")+1),path:t}}}};function RV(t,e,n,s,i,r){const o=C("heading-title"),a=C("control-button"),l=C("list-directories"),c=C("list-playlists"),u=C("list-tracks"),d=C("modal-dialog-directory"),f=C("content-with-heading");return O(),$("div",null,[E(f,null,{"heading-left":D(()=>[E(o,{content:{title:r.name}},null,8,["content"])]),"heading-right":D(()=>[E(a,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"play",key:"page.files.play"}},null,8,["button"])]),content:D(()=>[E(l,{items:i.directories},null,8,["items"]),E(c,{items:i.playlists},null,8,["items"]),E(u,{expression:r.expression,items:i.tracks,show_icon:!0},null,8,["expression","items"]),E(d,{item:r.current,show:i.show_details_modal,onClose:e[0]||(e[0]=h=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const LV=it(PV,[["render",RV]]),gy={load(t){return Promise.all([tt.library_genre(t.params.name,t.query.media_kind),tt.library_genre_albums(t.params.name,t.query.media_kind)])},set(t,e){t.genre=e[0].data.genres.items.shift(),t.albums=new Tt(e[1].data.albums,{index:{field:"name_sort",type:String}})}},DV={name:"PageGenreAlbums",components:{ContentWithHeading:ne,ControlButton:Qe,HeadingTitle:se,IndexButtonList:Is,ListAlbums:Gn,ModalDialogGenre:Qp},beforeRouteEnter(t,e,n){gy.load(t).then(s=>{n(i=>gy.set(i,s))})},data(){return{albums:new Tt,genre:{},media_kind:this.$route.query.media_kind,show_details_modal:!1}},computed:{heading(){return{title:this.genre.name,subtitle:[{key:"count.albums",count:this.genre.album_count},{handler:this.open_tracks,key:"count.tracks",count:this.genre.track_count}]}}},methods:{open_tracks(){this.show_details_modal=!1,this.$router.push({name:"genre-tracks",params:{name:this.genre.name},query:{media_kind:this.media_kind}})},play(){tt.player_play_expression(`genre is "${this.genre.name}" and media_kind is ${this.media_kind}`,!0)},showDetails(){this.show_details_modal=!0}}};function $V(t,e,n,s,i,r){const o=C("index-button-list"),a=C("heading-title"),l=C("control-button"),c=C("list-albums"),u=C("modal-dialog-genre"),d=C("content-with-heading");return O(),$("div",null,[E(d,null,{options:D(()=>[E(o,{indices:i.albums.indices},null,8,["indices"])]),"heading-left":D(()=>[E(a,{content:r.heading},null,8,["content"])]),"heading-right":D(()=>[E(l,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"]),E(l,{button:{handler:r.play,icon:"shuffle",key:"page.genre.shuffle"}},null,8,["button"])]),content:D(()=>[E(c,{items:i.albums},null,8,["items"]),E(u,{item:i.genre,media_kind:i.media_kind,show:i.show_details_modal,onClose:e[0]||(e[0]=f=>i.show_details_modal=!1)},null,8,["item","media_kind","show"])]),_:1})])}const MV=it(DV,[["render",$V]]),by={load(t){return Promise.all([tt.library_genre(t.params.name,t.query.media_kind),tt.library_genre_tracks(t.params.name,t.query.media_kind)])},set(t,e){t.genre=e[0].data.genres.items.shift(),t.tracks_list=new Tt(e[1].data.tracks)}},FV={name:"PageGenreTracks",components:{ContentWithHeading:ne,ControlButton:Qe,ControlDropdown:Dr,HeadingTitle:se,IndexButtonList:Is,ListTracks:Hn,ModalDialogGenre:Qp},beforeRouteEnter(t,e,n){by.load(t).then(s=>{n(i=>by.set(i,s))})},setup(){return{uiStore:Un()}},data(){return{genre:{},groupings:[{id:1,name:this.$t("page.genre.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("page.genre.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}],media_kind:this.$route.query.media_kind,show_details_modal:!1,tracks_list:new Tt}},computed:{expression(){return`genre is "${this.genre.name}" and media_kind is ${this.media_kind}`},heading(){return{title:this.genre.name,subtitle:[{handler:this.openGenre,key:"count.albums",count:this.genre.album_count},{key:"count.tracks",count:this.genre.track_count}]}},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.genre_tracks_sort);return this.tracks_list.group(t)}},methods:{openGenre(){this.show_details_modal=!1,this.$router.push({name:"genre-albums",params:{name:this.genre.name},query:{media_kind:this.media_kind}})},play(){tt.player_play_expression(this.expression,!0)},showDetails(){this.show_details_modal=!0}}},VV={class:"columns"},HV={class:"column"},UV=["textContent"];function jV(t,e,n,s,i,r){const o=C("index-button-list"),a=C("control-dropdown"),l=C("heading-title"),c=C("control-button"),u=C("list-tracks"),d=C("modal-dialog-genre"),f=C("content-with-heading");return O(),$("div",null,[E(f,null,{options:D(()=>[E(o,{indices:r.tracks.indices},null,8,["indices"]),S("div",VV,[S("div",HV,[S("div",{class:"is-size-7 is-uppercase",textContent:j(t.$t("page.genre.sort.title"))},null,8,UV),E(a,{value:s.uiStore.genre_tracks_sort,"onUpdate:value":e[0]||(e[0]=h=>s.uiStore.genre_tracks_sort=h),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[E(l,{content:r.heading},null,8,["content"])]),"heading-right":D(()=>[E(c,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"]),E(c,{button:{handler:r.play,icon:"shuffle",key:"page.genre.shuffle"}},null,8,["button"])]),content:D(()=>[E(u,{items:r.tracks,expression:r.expression},null,8,["items","expression"]),E(d,{item:i.genre,media_kind:i.media_kind,show:i.show_details_modal,onClose:e[1]||(e[1]=h=>i.show_details_modal=!1)},null,8,["item","media_kind","show"])]),_:1})])}const BV=it(FV,[["render",jV]]),yy={load(t){return tt.library_genres("music")},set(t,e){t.genres=new Tt(e.data.genres,{index:{field:"name_sort",type:String}})}},WV={name:"PageGenres",components:{ContentWithHeading:ne,HeadingTitle:se,IndexButtonList:Is,ListGenres:pS,TabsMusic:qs},beforeRouteEnter(t,e,n){yy.load(t).then(s=>{n(i=>yy.set(i,s))})},data(){return{genres:new Tt}},computed:{heading(){return{title:this.$t("page.genres.title"),subtitle:[{key:"count.genres",count:this.genres.total}]}}}};function qV(t,e,n,s,i,r){const o=C("tabs-music"),a=C("index-button-list"),l=C("heading-title"),c=C("list-genres"),u=C("content-with-heading");return O(),$("div",null,[E(o),E(u,null,{options:D(()=>[E(a,{indices:i.genres.indices},null,8,["indices"])]),"heading-left":D(()=>[E(l,{content:r.heading},null,8,["content"])]),content:D(()=>[E(c,{items:i.genres,media_kind:"music"},null,8,["items"])]),_:1})])}const GV=it(WV,[["render",qV]]),_y={load(t){return 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"})])},set(t,e){t.albums=new Tt(e[0].data.albums),t.tracks=new Tt(e[1].data.tracks)}},zV={name:"PageMusic",components:{ContentWithHeading:ne,HeadingTitle:se,ListAlbums:Gn,ListTracks:Hn,TabsMusic:qs},beforeRouteEnter(t,e,n){_y.load(t).then(s=>{n(i=>_y.set(i,s))})},data(){return{albums:[],tracks:{items:[]},selected_track:{}}}};function KV(t,e,n,s,i,r){const o=C("tabs-music"),a=C("heading-title"),l=C("list-albums"),c=C("router-link"),u=C("content-with-heading"),d=C("list-tracks");return O(),$("div",null,[E(o),E(u,null,{"heading-left":D(()=>[E(a,{content:{title:t.$t("page.music.recently-added.title")}},null,8,["content"])]),content:D(()=>[E(l,{items:i.albums},null,8,["items"])]),footer:D(()=>[E(c,{class:"button is-small is-rounded",to:{name:"music-recently-added"}},{default:D(()=>[js(j(t.$t("page.music.show-more")),1)]),_:1})]),_:1}),E(u,null,{"heading-left":D(()=>[E(a,{content:{title:t.$t("page.music.recently-played.title")}},null,8,["content"])]),content:D(()=>[E(d,{items:i.tracks},null,8,["items"])]),footer:D(()=>[E(c,{class:"button is-small is-rounded",to:{name:"music-recently-played"}},{default:D(()=>[js(j(t.$t("page.music.show-more")),1)]),_:1})]),_:1})])}const XV=it(zV,[["render",KV]]),vy={load(t){const e=bi().recently_added_limit;return tt.search({expression:"media_kind is music having track_count > 3 order by time_added desc",limit:e,type:"album"})},set(t,e){t.albums=new Tt(e.data.albums,{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}})}},YV={name:"PageMusicRecentlyAdded",components:{ContentWithHeading:ne,HeadingTitle:se,ListAlbums:Gn,TabsMusic:qs},beforeRouteEnter(t,e,n){vy.load(t).then(s=>{n(i=>vy.set(i,s))})},setup(){return{settingsStore:bi()}},data(){return{albums:new Tt}}};function ZV(t,e,n,s,i,r){const o=C("tabs-music"),a=C("heading-title"),l=C("list-albums"),c=C("content-with-heading");return O(),$("div",null,[E(o),E(c,null,{"heading-left":D(()=>[E(a,{content:{title:t.$t("page.music.recently-added.title")}},null,8,["content"])]),content:D(()=>[E(l,{items:i.albums},null,8,["items"])]),_:1})])}const JV=it(YV,[["render",ZV]]),Sy={load(t){return tt.search({expression:"time_played after 8 weeks ago and media_kind is music order by time_played desc",limit:50,type:"track"})},set(t,e){t.tracks=new Tt(e.data.tracks)}},QV={name:"PageMusicRecentlyPlayed",components:{ContentWithHeading:ne,HeadingTitle:se,ListTracks:Hn,TabsMusic:qs},beforeRouteEnter(t,e,n){Sy.load(t).then(s=>{n(i=>Sy.set(i,s))})},data(){return{tracks:{}}}};function t7(t,e,n,s,i,r){const o=C("tabs-music"),a=C("heading-title"),l=C("list-tracks"),c=C("content-with-heading");return O(),$("div",null,[E(o),E(c,null,{"heading-left":D(()=>[E(a,{content:{title:t.$t("page.music.recently-played.title")}},null,8,["content"])]),content:D(()=>[E(l,{items:i.tracks},null,8,["items"])]),_:1})])}const e7=it(QV,[["render",t7]]),n7={name:"ModalDialogPlaylistSpotify",components:{ModalDialogPlayable:xs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t,e;return{name:this.item.name,handler:this.open,uri:this.item.uri,properties:[{key:"property.owner",value:(t=this.item.owner)==null?void 0:t.display_name},{key:"property.tracks",value:(e=this.item.tracks)==null?void 0:e.total},{key:"property.path",value:this.item.uri}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"playlist-spotify",params:{id:this.item.id}})}}};function s7(t,e,n,s,i,r){const o=C("modal-dialog-playable");return O(),vt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const bS=it(n7,[["render",s7]]),i7={name:"ListPlaylistsSpotify",components:{ModalDialogPlaylistSpotify:bS},props:{items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(t){this.$router.push({name:"playlist-spotify",params:{id:t.id}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},r7=["onClick"],o7={class:"media-content"},a7=["textContent"],l7=["textContent"],c7={class:"media-right"},u7=["onClick"];function d7(t,e,n,s,i,r){const o=C("mdicon"),a=C("modal-dialog-playlist-spotify");return O(),$(ht,null,[(O(!0),$(ht,null,ce(n.items,l=>(O(),$("div",{key:l.id,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l)},[S("div",o7,[S("div",{class:"is-size-6 has-text-weight-bold",textContent:j(l.name)},null,8,a7),S("div",{class:"is-size-7 has-text-weight-bold has-text-grey",textContent:j(l.owner.display_name)},null,8,l7)]),S("div",c7,[S("a",{onClick:Ie(c=>r.open_dialog(l),["prevent","stop"])},[E(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,u7)])],8,r7))),128)),(O(),vt(fs,{to:"#app"},[E(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const Zc=it(i7,[["render",d7]]),Ey={load(t){return tt.spotify().then(({data:e})=>{const n=new Ws;return n.setAccessToken(e.webapi_token),Promise.all([n.getNewReleases({country:e.webapi_country,limit:3}),n.getFeaturedPlaylists({country:e.webapi_country,limit:3})])})},set(t,e){t.albums=e[0].albums.items,t.playlists=e[1].playlists.items}},f7={name:"PageMusicSpotify",components:{ContentWithHeading:ne,HeadingTitle:se,ListAlbumsSpotify:qa,ListPlaylistsSpotify:Zc,TabsMusic:qs},beforeRouteEnter(t,e,n){Ey.load(t).then(s=>{n(i=>Ey.set(i,s))})},data(){return{playlists:[],albums:[]}}};function h7(t,e,n,s,i,r){const o=C("tabs-music"),a=C("heading-title"),l=C("list-albums-spotify"),c=C("router-link"),u=C("content-with-heading"),d=C("list-playlists-spotify");return O(),$("div",null,[E(o),E(u,null,{"heading-left":D(()=>[E(a,{content:{title:t.$t("page.spotify.music.new-releases")}},null,8,["content"])]),content:D(()=>[E(l,{items:i.albums},null,8,["items"])]),footer:D(()=>[E(c,{to:{name:"music-spotify-new-releases"},class:"button is-small is-rounded"},{default:D(()=>[js(j(t.$t("page.spotify.music.show-more")),1)]),_:1})]),_:1}),E(u,null,{"heading-left":D(()=>[E(a,{content:{title:t.$t("page.spotify.music.featured-playlists")}},null,8,["content"])]),content:D(()=>[E(d,{items:i.playlists},null,8,["items"])]),footer:D(()=>[E(c,{to:{name:"music-spotify-featured-playlists"},class:"button is-small is-rounded"},{default:D(()=>[js(j(t.$t("page.spotify.music.show-more")),1)]),_:1})]),_:1})])}const p7=it(f7,[["render",h7]]),wy={load(t){return tt.spotify().then(({data:e})=>{const n=new Ws;return n.setAccessToken(e.webapi_token),n.getFeaturedPlaylists({country:e.webapi_country,limit:50})})},set(t,e){t.playlists=e.playlists.items}},m7={name:"PageMusicSpotifyFeaturedPlaylists",components:{ContentWithHeading:ne,HeadingTitle:se,ListPlaylistsSpotify:Zc,TabsMusic:qs},beforeRouteEnter(t,e,n){wy.load(t).then(s=>{n(i=>wy.set(i,s))})},data(){return{playlists:[]}},computed:{heading(){return{title:this.$t("page.spotify.music.featured-playlists")}}}};function g7(t,e,n,s,i,r){const o=C("tabs-music"),a=C("heading-title"),l=C("list-playlists-spotify"),c=C("content-with-heading");return O(),$("div",null,[E(o),E(c,null,{"heading-left":D(()=>[E(a,{content:r.heading},null,8,["content"])]),content:D(()=>[E(l,{items:i.playlists},null,8,["items"])]),_:1})])}const b7=it(m7,[["render",g7]]),ky={load(t){return tt.spotify().then(({data:e})=>{const n=new Ws;return n.setAccessToken(e.webapi_token),n.getNewReleases({country:e.webapi_country,limit:50})})},set(t,e){t.albums=e.albums.items}},y7={name:"PageMusicSpotifyNewReleases",components:{ContentWithHeading:ne,HeadingTitle:se,ListAlbumsSpotify:qa,TabsMusic:qs},beforeRouteEnter(t,e,n){ky.load(t).then(s=>{n(i=>ky.set(i,s))})},data(){return{albums:[]}},computed:{heading(){return{title:this.$t("page.spotify.music.new-releases")}}}};function _7(t,e,n,s,i,r){const o=C("tabs-music"),a=C("heading-title"),l=C("list-albums-spotify"),c=C("content-with-heading");return O(),$("div",null,[E(o),E(c,null,{"heading-left":D(()=>[E(a,{content:r.heading},null,8,["content"])]),content:D(()=>[E(l,{items:i.albums},null,8,["items"])]),_:1})])}const v7=it(y7,[["render",_7]]),S7={name:"LyricsPane",setup(){return{lyricsStore:Fu(),playerStore:Jn()}},data(){return this.lastIndex=-1,this.scrollingTimer=null,this.lastItemId=-1,{autoScrolling:!0}},computed:{is_playing(){return this.playerStore.state==="play"},lyrics(){const t=this.lyricsStore.content,e=[];if(t.length>0){const n=/\[(?\d+):(?\d+)(?:\.(?\d+))?\] ?(?.*)/u;t.split(` `).forEach(s=>{const{text:i,minutes:r,seconds:o,hundredths:a}=n.exec(s).groups;if(i){const l={text:i,time:r*60+Number(o)+ +`.${a||0}`};e.push(l)}}),e.forEach((s,i,r)=>{const o=(r[i+1].time-s.time||3)/s.text.length;let a=0;s.words=s.text.match(/\S+\s*/gu).map(l=>{const c=l.length*o;return a+=c,{duration:c,delay:a,text:l}})})}return e},verse_index(){var t;if(this.lyrics.length&&this.lyrics[0].time){const e=this.playerStore.item_progress_ms/1e3,n=this.lyrics,s=this.playerStore.item_id!==this.lastItemId,i=this.lastIndex>=0&&this.lastIndexe;if((s||i)&&this.reset_scrolling(),this.lastIndexe||this.lastIndex===n.length-1)return this.lastIndex;if(this.lastIndexe)return this.lastIndex+1;let r=n.length-1,o=-1,a=0;for(;a<=r;){o=a+r>>1;const l=n[o].time,c=(t=n[o+1])==null?void 0:t.time;if(l<=e&&(c>e||!c))break;l>1)+(e.offsetHeight>>1)-t.scrollTop})},start_scrolling(t){(t.screenX??t.screenY)&&(this.autoScrolling=!1,clearTimeout(this.scrollingTimer),this.scrollingTimer=setTimeout(this.autoScrolling=!0,2e3))}}},E7=["textContent"],w7={key:1};function k7(t,e,n,s,i,r){return O(),$("div",{ref:"lyrics",class:"lyrics",onTouchstart:e[0]||(e[0]=o=>i.autoScrolling=!1),onTouchend:e[1]||(e[1]=o=>i.autoScrolling=!0),onScrollPassive:e[2]||(e[2]=(...o)=>r.start_scrolling&&r.start_scrolling(...o)),onWheelPassive:e[3]||(e[3]=(...o)=>r.start_scrolling&&r.start_scrolling(...o))},[(O(!0),$(ht,null,ce(r.lyrics,(o,a)=>(O(),$(ht,{key:a},[a===r.verse_index?(O(),$("div",{key:0,class:qt({"is-highlighted":r.is_playing})},[(O(!0),$(ht,null,ce(o.words,l=>(O(),$("span",{key:l,class:"has-text-weight-bold is-size-5"},[S("span",{style:hi({"animation-duration":`${l.delay}s`}),textContent:j(l.text)},null,12,E7)]))),128))],2)):(O(),$("div",w7,j(o.text),1))],64))),128))],544)}const C7=it(S7,[["render",k7],["__scopeId","data-v-e04e7f3f"]]),T7={name:"ModalDialogQueueItem",components:{ListProperties:dS,ModalDialog:gi},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],setup(){return{servicesStore:je()}},data(){return{spotify_track:{}}},computed:{actions(){return[{key:this.$t("dialog.queue-item.remove"),handler:this.remove,icon:"delete"},{key:this.$t("dialog.queue-item.play"),handler:this.play,icon:"play"}]},playable(){return{name:this.item.title,uri:this.item.uri,properties:[{key:"property.album",value:this.item.album,handler:this.open_album},{key:"property.album-artist",value:this.item.album_artist,handler:this.open_album_artist},{key:"property.composer",value:this.item.composer},{key:"property.year",value:this.item.year},{key:"property.genre",value:this.item.genre,handler:this.open_genre},{key:"property.position",value:[this.item.disc_number,this.item.track_number].join(" / ")},{key:"property.duration",value:this.$filters.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.$t("dialog.track.quality-value",{format:this.item.type,bitrate:this.item.bitrate,channels:this.$t("count.channels",this.item.channels),samplerate:this.item.samplerate})}]}}},watch:{item(){var t;if(((t=this.item)==null?void 0:t.data_kind)==="spotify"){const e=new Ws;e.setAccessToken(this.servicesStore.spotify.webapi_token),e.getTrack(this.item.path.slice(this.item.path.lastIndexOf(":")+1)).then(n=>{this.spotify_track=n})}else this.spotify_track={}}},methods:{open_album(){this.$emit("close"),this.item.data_kind==="spotify"?this.$router.push({name:"music-spotify-album",params:{id:this.spotify_track.album.id}}):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:"audiobooks-album",params:{id:this.item.album_id}}):this.item.media_kind==="music"&&this.$router.push({name:"music-album",params:{id:this.item.album_id}})},open_album_artist(){this.$emit("close"),this.item.data_kind==="spotify"?this.$router.push({name:"music-spotify-artist",params:{id:this.spotify_track.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:"audiobooks-artist",params:{id:this.item.album_artist_id}})},open_genre(){this.$emit("close"),this.$router.push({name:"genre-albums",params:{name:this.item.genre},query:{media_kind:this.item.media_kind}})},play(){this.$emit("close"),tt.player_play({item_id:this.item.id})},remove(){this.$emit("close"),tt.queue_remove(this.item.id)}}};function A7(t,e,n,s,i,r){const o=C("list-properties"),a=C("modal-dialog");return O(),vt(a,{actions:r.actions,show:n.show,onClose:e[0]||(e[0]=l=>t.$emit("close"))},{content:D(()=>[E(o,{item:r.playable},null,8,["item"])]),_:1},8,["actions","show"])}const yS=it(T7,[["render",A7]]),Ci=1e3,O7={name:"PageNowPlaying",components:{ControlSlider:Mu,ControlImage:tr,LyricsPane:C7,ModalDialogQueueItem:yS},setup(){return{lyricsStore:Fu(),playerStore:Jn(),queueStore:Cs(),settingsStore:bi()}},data(){return{INTERVAL:Ci,interval_id:0,is_dragged:!1,selected_item:{},show_details_modal:!1}},computed:{composer(){if(this.settingsStore.show_composer_now_playing){const t=this.settingsStore.show_composer_for_genre;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},is_live(){return this.track.length_ms===0},track(){return this.queueStore.current},track_elapsed_time(){return this.$filters.toTimecode(this.track_progress*Ci)},track_progress:{get(){return Math.floor(this.playerStore.item_progress_ms/Ci)},set(t){this.playerStore.item_progress_ms=t*Ci}},track_progress_max(){return this.is_live?1:Math.floor(this.track.length_ms/Ci)},track_total_time(){return this.is_live?this.$t("page.now-playing.live"):this.$filters.toTimecode(this.track.length_ms)}},watch:{"playerStore.state"(t){this.interval_id>0&&(window.clearTimeout(this.interval_id),this.interval_id=0),t==="play"&&(this.interval_id=window.setInterval(this.tick,Ci))}},created(){tt.player_status().then(({data:t})=>{this.playerStore.$state=t,this.playerStore.state==="play"&&(this.interval_id=window.setInterval(this.tick,Ci))})},unmounted(){this.interval_id>0&&(window.clearTimeout(this.interval_id),this.interval_id=0)},methods:{end_dragging(){this.is_dragged=!1},open_dialog(t){this.selected_item=t,this.show_details_modal=!0},seek(){this.is_live||tt.player_seek_to_pos(this.track_progress*Ci)},start_dragging(){this.is_dragged=!0},tick(){this.is_dragged||(this.track_progress+=1)}}},x7={class:"is-flex is-align-items-center has-text-centered px-5 is-full-height"},I7={key:0,class:"mx-auto",style:{"max-width":"32rem"}},N7={class:"is-flex is-justify-content-space-between"},P7=["textContent"],R7=["textContent"],L7=["textContent"],D7=["textContent"],$7=["textContent"],M7=["textContent"],F7=["textContent"],V7={key:1,class:"mx-auto"},H7=["textContent"],U7=["textContent"];function j7(t,e,n,s,i,r){const o=C("control-image"),a=C("lyrics-pane"),l=C("control-slider"),c=C("modal-dialog-queue-item");return O(),$(ht,null,[S("div",x7,[r.track.id?(O(),$("div",I7,[E(o,{url:r.track.artwork_url,artist:r.track.artist,album:r.track.album,class:qt(["is-clickable is-big",{"is-masked":s.lyricsStore.pane}]),onClick:e[0]||(e[0]=u=>r.open_dialog(r.track))},null,8,["url","artist","album","class"]),s.lyricsStore.pane?(O(),vt(a,{key:0})):bt("",!0),E(l,{value:r.track_progress,"onUpdate:value":e[1]||(e[1]=u=>r.track_progress=u),class:"mt-5",disabled:r.is_live,max:r.track_progress_max,onChange:r.seek,onMousedown:r.start_dragging,onMouseup:r.end_dragging},null,8,["value","disabled","max","onChange","onMousedown","onMouseup"]),S("div",N7,[S("p",{class:"subtitle is-7",textContent:j(r.track_elapsed_time)},null,8,P7),S("p",{class:"subtitle is-7",textContent:j(r.track_total_time)},null,8,R7)]),S("p",{class:"title is-5",textContent:j(r.track.title)},null,8,L7),S("p",{class:"title is-6",textContent:j(r.track.artist)},null,8,D7),r.composer?(O(),$("p",{key:1,class:"subtitle is-6 has-text-grey has-text-weight-bold",textContent:j(r.composer)},null,8,$7)):bt("",!0),r.track.album?(O(),$("p",{key:2,class:"subtitle is-6",textContent:j(r.track.album)},null,8,M7)):bt("",!0),s.settingsStore.show_filepath_now_playing?(O(),$("p",{key:3,class:"subtitle is-6 has-text-grey",textContent:j(r.track.path)},null,8,F7)):bt("",!0)])):(O(),$("div",V7,[S("p",{class:"title is-5",textContent:j(t.$t("page.now-playing.title"))},null,8,H7),S("p",{class:"subtitle",textContent:j(t.$t("page.now-playing.info"))},null,8,U7)]))]),E(c,{show:i.show_details_modal,item:i.selected_item,onClose:e[2]||(e[2]=u=>i.show_details_modal=!1)},null,8,["show","item"])],64)}const B7=it(O7,[["render",j7],["__scopeId","data-v-1b33df78"]]),Vl={load(t){return Promise.all([tt.library_playlist(t.params.id),tt.library_playlist_folder(t.params.id)])},set(t,e){t.playlist=e[0].data,t.playlists_list=new Tt(e[1].data)}},W7={name:"PagePlaylistFolder",components:{ContentWithHeading:ne,ListPlaylists:Yc,HeadingTitle:se},beforeRouteEnter(t,e,n){Vl.load(t).then(s=>{n(i=>Vl.set(i,s))})},beforeRouteUpdate(t,e,n){Vl.load(t).then(s=>{Vl.set(this,s),n()})},setup(){return{configurationStore:Cr()}},data(){return{playlist:{},playlists_list:new Tt}},computed:{heading(){return{title:this.playlists.count===0?this.$t("page.playlists.title"):this.playlist.name,subtitle:[{key:"count.playlists",count:this.playlists.count}]}},playlists(){return this.playlists_list.group({filters:[t=>t.folder||this.radio_playlists||t.stream_count===0||t.item_count>t.stream_count]})},radio_playlists(){return this.configurationStore.radio_playlists}}};function q7(t,e,n,s,i,r){const o=C("heading-title"),a=C("list-playlists"),l=C("content-with-heading");return O(),$("div",null,[E(l,null,{"heading-left":D(()=>[E(o,{content:r.heading},null,8,["content"])]),content:D(()=>[E(a,{items:r.playlists},null,8,["items"])]),_:1})])}const G7=it(W7,[["render",q7]]),Cy={load(t){return Promise.all([tt.library_playlist(t.params.id),tt.library_playlist_tracks(t.params.id)])},set(t,e){t.playlist=e[0].data,t.tracks=new Tt(e[1].data)}},z7={name:"PagePlaylistTracks",components:{ContentWithHeading:ne,ControlButton:Qe,HeadingTitle:se,ListTracks:Hn,ModalDialogPlaylist:gS},beforeRouteEnter(t,e,n){Cy.load(t).then(s=>{n(i=>Cy.set(i,s))})},data(){return{playlist:{},show_details_modal:!1,tracks:new Tt}},computed:{heading(){return{title:this.playlist.name,subtitle:[{key:"count.tracks",count:this.tracks.count}]}},uris(){return this.playlist.random?this.tracks.map(t=>t.uri).join():this.playlist.uri}},methods:{play(){tt.player_play_uri(this.uris,!0)},showDetails(){this.show_details_modal=!0}}};function K7(t,e,n,s,i,r){const o=C("heading-title"),a=C("control-button"),l=C("list-tracks"),c=C("modal-dialog-playlist"),u=C("content-with-heading");return O(),$("div",null,[E(u,null,{"heading-left":D(()=>[E(o,{content:r.heading},null,8,["content"])]),"heading-right":D(()=>[E(a,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"shuffle",key:"page.playlist.shuffle",disabled:i.tracks.count===0}},null,8,["button"])]),content:D(()=>[E(l,{items:i.tracks,uris:r.uris},null,8,["items","uris"]),E(c,{item:i.playlist,show:i.show_details_modal,uris:r.uris,onClose:e[0]||(e[0]=d=>i.show_details_modal=!1)},null,8,["item","show","uris"])]),_:1})])}const X7=it(z7,[["render",K7]]),mh=50,Ty={load(t){const e=new Ws;return e.setAccessToken(je().spotify.webapi_token),Promise.all([e.getPlaylist(t.params.id),e.getPlaylistTracks(t.params.id,{limit:mh,market:je().$state.spotify.webapi_country,offset:0})])},set(t,e){t.playlist=e.shift(),t.tracks=[],t.total=0,t.offset=0,t.append_tracks(e.shift())}},Y7={name:"PagePlaylistTracksSpotify",components:{ContentWithHeading:ne,ControlButton:Qe,ListTracksSpotify:Kc,ModalDialogPlaylistSpotify:bS,HeadingTitle:se,VueEternalLoading:Zp},beforeRouteEnter(t,e,n){Ty.load(t).then(s=>{n(i=>Ty.set(i,s))})},setup(){return{servicesStore:je()}},data(){return{offset:0,playlist:{tracks:{}},show_playlist_details_modal:!1,total:0,tracks:[]}},computed:{heading(){return{title:this.playlist.name,subtitle:[{key:"count.playlists",count:this.playlist.tracks.total}]}}},methods:{append_tracks(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&&(s.position=++e),this.tracks.push(s))}),this.total=t.total,this.offset+=t.limit},load_next({loaded:t}){const e=new Ws;e.setAccessToken(this.servicesStore.spotify.webapi_token),e.getPlaylistTracks(this.playlist.id,{limit:mh,market:this.servicesStore.spotify.webapi_country,offset:this.offset}).then(n=>{this.append_tracks(n),t(n.items.length,mh)})},play(){this.show_details_modal=!1,tt.player_play_uri(this.playlist.uri,!0)},showDetails(){this.show_playlist_details_modal=!0}}},Z7={class:"columns is-centered"},J7={class:"column has-text-centered"};function Q7(t,e,n,s,i,r){const o=C("heading-title"),a=C("control-button"),l=C("list-tracks-spotify"),c=C("mdicon"),u=C("vue-eternal-loading"),d=C("modal-dialog-playlist-spotify"),f=C("content-with-heading");return O(),$("div",null,[E(f,null,{"heading-left":D(()=>[E(o,{content:r.heading},null,8,["content"])]),"heading-right":D(()=>[E(a,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"shuffle",key:"page.spotify.playlist.shuffle",disabled:i.playlist.tracks.total===0}},null,8,["button"])]),content:D(()=>[E(l,{items:i.tracks,context_uri:i.playlist.uri},null,8,["items","context_uri"]),i.offset[S("div",Z7,[S("div",J7,[E(c,{class:"icon mdi-spin",name:"loading"})])])]),"no-more":D(()=>e[1]||(e[1]=[S("br",null,null,-1)])),_:1},8,["load"])):bt("",!0),E(d,{item:i.playlist,show:i.show_playlist_details_modal,onClose:e[0]||(e[0]=h=>i.show_playlist_details_modal=!1)},null,8,["item","show"])]),_:1})])}const t9=it(Y7,[["render",Q7]]),Ay={load(t){return Promise.all([tt.library_album(t.params.id),tt.library_podcast_episodes(t.params.id)])},set(t,e){t.album=e[0].data,t.tracks=new Tt(e[1].data.tracks)}},e9={name:"PagePodcast",components:{ContentWithHero:ud,ControlButton:Qe,ControlImage:tr,ListTracks:Hn,ModalDialog:gi,ModalDialogAlbum:dd},beforeRouteEnter(t,e,n){Ay.load(t).then(s=>{n(i=>Ay.set(i,s))})},data(){return{album:{},rss_playlist_to_remove:{},show_details_modal:!1,show_remove_podcast_modal:!1,tracks:new Tt}},computed:{actions(){return[{key:this.$t("page.podcast.cancel"),handler:"cancel",icon:"cancel"},{key:this.$t("page.podcast.remove"),handler:"remove",icon:"delete"}]}},methods:{open_remove_podcast_dialog(){tt.library_track_playlists(this.tracks.items[0].id).then(({data:t})=>{[this.rss_playlist_to_remove]=t.items.filter(e=>e.type==="rss"),this.show_remove_podcast_modal=!0,this.show_details_modal=!1})},play(){tt.player_play_uri(this.album.uri,!1)},reload_tracks(){tt.library_podcast_episodes(this.album.id).then(({data:t})=>{this.tracks=new Tt(t.tracks)})},remove_podcast(){this.show_remove_podcast_modal=!1,tt.library_playlist_delete(this.rss_playlist_to_remove.id).then(()=>{this.$router.replace({name:"podcasts"})})},showDetails(){this.show_details_modal=!0}}},n9=["textContent"],s9=["textContent"],i9={class:"buttons is-centered-mobile mt-5"},r9=["textContent"];function o9(t,e,n,s,i,r){const o=C("control-button"),a=C("control-image"),l=C("list-tracks"),c=C("modal-dialog-album"),u=C("i18n-t"),d=C("modal-dialog"),f=C("content-with-hero");return O(),$("div",null,[E(f,null,{"heading-left":D(()=>[S("div",{class:"title is-5",textContent:j(i.album.name)},null,8,n9),e[2]||(e[2]=S("div",{class:"subtitle is-6"},[S("br")],-1)),S("div",{class:"is-size-7 is-uppercase has-text-centered-mobile",textContent:j(t.$t("count.tracks",{count:i.album.track_count}))},null,8,s9),S("div",i9,[E(o,{button:{handler:r.play,icon:"play",key:"page.podcast.play"}},null,8,["button"]),E(o,{button:{handler:r.showDetails,icon:"dots-horizontal"}},null,8,["button"])])]),"heading-right":D(()=>[E(a,{url:i.album.artwork_url,artist:i.album.artist,album:i.album.name,class:"is-clickable is-medium",onClick:r.showDetails},null,8,["url","artist","album","onClick"])]),content:D(()=>[E(l,{items:i.tracks,show_progress:!0,onPlayCountChanged:r.reload_tracks},null,8,["items","onPlayCountChanged"]),E(c,{item:i.album,show:i.show_details_modal,media_kind:"podcast",onClose:e[0]||(e[0]=h=>i.show_details_modal=!1),onPlayCountChanged:r.reload_tracks,onRemovePodcast:r.open_remove_podcast_dialog},null,8,["item","show","onPlayCountChanged","onRemovePodcast"]),E(d,{actions:r.actions,show:i.show_remove_podcast_modal,title:t.$t("page.podcast.remove-podcast"),onCancel:e[1]||(e[1]=h=>i.show_remove_podcast_modal=!1),onRemove:r.remove_podcast},{content:D(()=>[E(u,{keypath:"page.podcast.remove-info",tag:"p",scope:"global"},{separator:D(()=>e[3]||(e[3]=[S("br",null,null,-1)])),name:D(()=>[S("b",{textContent:j(i.rss_playlist_to_remove.name)},null,8,r9)]),_:1})]),_:1},8,["actions","show","title","onRemove"])]),_:1})])}const a9=it(e9,[["render",o9]]),l9={name:"ControlUrlField",props:{placeholder:{type:String,required:!0},icon:{type:String,required:!0},help:{type:String,default:""},loading:{type:Boolean,default:!1}},emits:["url-changed"],data(){return{url:"",disabled:!0}},mounted(){setTimeout(()=>{this.$refs.input.focus()},10)},methods:{validate(t){const{validity:e}=t.target;this.disabled=e.patternMismatch||e.valueMissing,this.$emit("url-changed",this.url,this.disabled)}}},c9={class:"field"},u9={class:"control has-icons-left"},d9=["placeholder","disabled"],f9=["textContent"];function h9(t,e,n,s,i,r){const o=C("mdicon");return O(),$("div",c9,[S("p",u9,[xn(S("input",{ref:"input","onUpdate:modelValue":e[0]||(e[0]=a=>i.url=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,d9),[[Zn,i.url]]),E(o,{class:"icon is-left",name:n.icon,size:"16"},null,8,["name"])]),n.help?(O(),$("p",{key:0,class:"help",textContent:j(n.help)},null,8,f9)):bt("",!0)])}const _S=it(l9,[["render",h9]]),p9={name:"ModalDialogAddRss",components:{ControlUrlField:_S,ModalDialog:gi},props:{show:Boolean},emits:["close","podcast-added"],data(){return{loading:!1,disabled:!0,url:""}},computed:{actions(){return this.loading?[{key:"dialog.add.rss.processing",icon:"web"}]:[{key:"dialog.add.rss.cancel",handler:this.cancel,icon:"cancel"},{key:"dialog.add.rss.add",disabled:this.disabled,handler:this.add,icon:"playlist-plus"}]}},methods:{onUrlChanged(t,e){this.url=t,this.disabled=e},add(){this.loading=!0,tt.library_add(this.url).then(()=>{this.$emit("close"),this.$emit("podcast-added"),this.url=""}).catch(()=>{this.loading=!1})},cancel(){this.$emit("close")}}};function m9(t,e,n,s,i,r){const o=C("control-url-field"),a=C("modal-dialog");return O(),vt(a,{actions:r.actions,show:n.show,title:t.$t("dialog.add.rss.title"),onClose:e[0]||(e[0]=l=>t.$emit("close"))},{content:D(()=>[E(o,{icon:"rss",help:t.$t("dialog.add.rss.help"),loading:i.loading,placeholder:t.$t("dialog.add.rss.placeholder"),onUrlChanged:r.onUrlChanged},null,8,["help","loading","placeholder","onUrlChanged"])]),_:1},8,["actions","show","title"])}const g9=it(p9,[["render",m9]]),Oy={load(t){return Promise.all([tt.library_albums("podcast"),tt.library_podcasts_new_episodes()])},set(t,e){t.albums=new Tt(e[0].data),t.tracks=new Tt(e[1].data.tracks)}},b9={name:"PagePodcasts",components:{ContentWithHeading:ne,ControlButton:Qe,HeadingTitle:se,ListAlbums:Gn,ListTracks:Hn,ModalDialogAddRss:g9},beforeRouteEnter(t,e,n){Oy.load(t).then(s=>{n(i=>Oy.set(i,s))})},setup(){return{libraryStore:$u(),uiStore:Un()}},data(){return{albums:[],tracks:{items:[]},show_url_modal:!1}},computed:{heading(){return this.albums.total?{title:this.$t("page.podcasts.title"),subtitle:[{key:"count.podcasts",count:this.albums.count}]}:{}},rss(){return this.libraryStore.rss}},methods:{markAllAsPlayed(){this.tracks.items.forEach(t=>{tt.library_track_update(t.id,{play_count:"increment"})}),this.tracks.items={}},openAddPodcastDialog(){this.show_url_modal=!0},reloadNewEpisodes(){tt.library_podcasts_new_episodes().then(({data:t})=>{this.tracks=new Tt(t.tracks)})},reloadPodcasts(){tt.library_albums("podcast").then(({data:t})=>{this.albums=new Tt(t),this.reloadNewEpisodes()})},updateRss(){this.libraryStore.update_dialog_scan_kind="rss",this.uiStore.show_update_dialog=!0}}};function y9(t,e,n,s,i,r){const o=C("heading-title"),a=C("control-button"),l=C("list-tracks"),c=C("content-with-heading"),u=C("list-albums"),d=C("modal-dialog-add-rss");return O(),$("div",null,[i.tracks.items.length>0?(O(),vt(c,{key:0},{"heading-left":D(()=>[E(o,{content:{title:t.$t("page.podcasts.new-episodes")}},null,8,["content"])]),"heading-right":D(()=>[E(a,{button:{handler:r.markAllAsPlayed,icon:"pencil",key:"page.podcasts.mark-all-played"}},null,8,["button"])]),content:D(()=>[E(l,{items:i.tracks,show_progress:!0,onPlayCountChanged:r.reloadNewEpisodes},null,8,["items","onPlayCountChanged"])]),_:1})):bt("",!0),E(c,null,{"heading-left":D(()=>[E(o,{content:r.heading},null,8,["content"])]),"heading-right":D(()=>[r.rss.tracks>0?(O(),vt(a,{key:0,button:{handler:r.updateRss,icon:"refresh",key:"page.podcasts.update"}},null,8,["button"])):bt("",!0),E(a,{button:{handler:"openAddPodcastDialog",icon:"rss",key:"page.podcasts.add"}})]),content:D(()=>[E(u,{items:i.albums,onPlayCountChanged:e[0]||(e[0]=f=>r.reloadNewEpisodes()),onPodcastDeleted:e[1]||(e[1]=f=>r.reloadPodcasts())},null,8,["items"]),E(d,{show:i.show_url_modal,onClose:e[2]||(e[2]=f=>i.show_url_modal=!1),onPodcastAdded:e[3]||(e[3]=f=>r.reloadPodcasts())},null,8,["show"])]),_:1})])}const _9=it(b9,[["render",y9]]),v9={name:"ListItemQueueItem",props:{current_position:{required:!0,type:Number},edit_mode:Boolean,item:{required:!0,type:Object},position:{required:!0,type:Number},show_only_next_items:Boolean},setup(){return{playerStore:Jn()}},computed:{is_next(){return this.current_position<0||this.position>=this.current_position},player(){return this.playerStore}},methods:{play(){tt.player_play({item_id:this.item.id})}}},S9={key:0,class:"media-left"},E9={class:"media-content"},w9=["textContent"],k9=["textContent"],C9=["textContent"],T9={class:"media-right"};function A9(t,e,n,s,i,r){const o=C("mdicon");return r.is_next||!n.show_only_next_items?(O(),$("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.edit_mode?(O(),$("div",S9,[E(o,{class:"icon has-text-grey is-movable",name:"drag-horizontal",size:"18"})])):bt("",!0),S("div",E9,[S("div",{class:qt(["is-size-6 has-text-weight-bold",{"has-text-primary":n.item.id===r.player.item_id,"has-text-grey-light":!r.is_next}]),textContent:j(n.item.title)},null,10,w9),S("div",{class:qt(["is-size-7 has-text-weight-bold",{"has-text-primary":n.item.id===r.player.item_id,"has-text-grey-light":!r.is_next,"has-text-grey":r.is_next&&n.item.id!==r.player.item_id}]),textContent:j(n.item.artist)},null,10,k9),S("div",{class:qt(["is-size-7",{"has-text-primary":n.item.id===r.player.item_id,"has-text-grey-light":!r.is_next,"has-text-grey":r.is_next&&n.item.id!==r.player.item_id}]),textContent:j(n.item.album)},null,10,C9)]),S("div",T9,[be(t.$slots,"actions",{},void 0,!0)])])):bt("",!0)}const O9=it(v9,[["render",A9],["__scopeId","data-v-af14c00f"]]),x9={name:"ModalDialogAddStream",components:{ControlUrlField:_S,ModalDialog:gi},props:{show:Boolean},emits:["close"],data(){return{loading:!1,disabled:!0,url:""}},computed:{actions(){return this.loading?[{key:"dialog.add.stream.processing",icon:"web"}]:[{key:"dialog.add.stream.cancel",handler:this.cancel,icon:"cancel"},{key:"dialog.add.stream.add",disabled:this.disabled,handler:this.add,icon:"playlist-plus"},{key:"dialog.add.stream.play",disabled:this.disabled,handler:this.play,icon:"play"}]}},methods:{onUrlChanged(t,e){this.url=t,this.disabled=e},add(){this.loading=!0,tt.queue_add(this.url).then(()=>{this.$emit("close"),this.url=""}).catch(()=>{this.loading=!1})},cancel(){this.$emit("close")},play(){this.loading=!0,tt.player_play_uri(this.url,!1).then(()=>{this.$emit("close"),this.url=""}).catch(()=>{this.loading=!1})}}};function I9(t,e,n,s,i,r){const o=C("control-url-field"),a=C("modal-dialog");return O(),vt(a,{actions:r.actions,show:n.show,title:t.$t("dialog.add.stream.title"),onClose:e[1]||(e[1]=l=>t.$emit("close"))},{content:D(()=>[S("form",{onSubmit:e[0]||(e[0]=Ie((...l)=>r.play&&r.play(...l),["prevent"]))},[E(o,{icon:"web",loading:i.loading,placeholder:t.$t("dialog.add.stream.placeholder"),onUrlChanged:r.onUrlChanged},null,8,["loading","placeholder","onUrlChanged"])],32)]),_:1},8,["actions","show","title"])}const N9=it(x9,[["render",I9]]),P9={name:"ModalDialogPlaylistSave",components:{ModalDialog:gi},props:{show:Boolean},emits:["close"],data(){return{disabled:!0,loading:!1,playlist_name:""}},computed:{actions(){return this.loading?[{key:"dialog.playlist.save.saving",icon:"web"}]:[{key:"dialog.playlist.save.cancel",handler:this.cancel,icon:"cancel"},{key:"dialog.playlist.save.save",disabled:this.disabled,handler:this.save,icon:"download"}]}},watch:{show(){this.show&&(this.loading=!1,setTimeout(()=>{this.$refs.playlist_name_field.focus()},10))}},methods:{cancel(){this.$emit("close")},check_name(t){const{validity:e}=t.target;this.disabled=e.patternMismatch||e.valueMissing},save(){this.loading=!0,tt.queue_save_playlist(this.playlist_name).then(()=>{this.$emit("close"),this.playlist_name=""}).catch(()=>{this.loading=!1})}}},R9={class:"field"},L9={class:"control has-icons-left"},D9=["placeholder","disabled"];function $9(t,e,n,s,i,r){const o=C("mdicon"),a=C("modal-dialog");return O(),vt(a,{actions:r.actions,show:n.show,title:t.$t("dialog.playlist.save.title"),onClose:e[3]||(e[3]=l=>t.$emit("close"))},{content:D(()=>[S("form",{onSubmit:e[2]||(e[2]=Ie((...l)=>r.save&&r.save(...l),["prevent"]))},[S("div",R9,[S("p",L9,[xn(S("input",{ref:"playlist_name_field","onUpdate:modelValue":e[0]||(e[0]=l=>i.playlist_name=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_name&&r.check_name(...l))},null,40,D9),[[Zn,i.playlist_name]]),E(o,{class:"icon is-left",name:"playlist-music",size:"16"})])])],32)]),_:1},8,["actions","show","title"])}const M9=it(P9,[["render",$9]]);var dc={exports:{}};/**! * Sortable 1.14.0 * @author RubaXa