(window.webpackJsonp=window.webpackJsonp||[]).push([[125],{746:function(t,e,r){"use strict";r.r(e);r(17),r(56),r(27),r(15);var n={props:{libraryItem:{type:Object,default:function(){}},keepOpen:Boolean},data:function(){return{expanded:!1}},computed:{libraryItemId:function(){return this.libraryItem.id},media:function(){return this.libraryItem&&this.libraryItem.media||{}},metadata:function(){return this.media.metadata||{}},chapters:function(){return this.media.chapters||[]},userCanUpdate:function(){return this.$store.getters["user/getUserCanUpdate"]}},methods:{clickBar:function(){this.expanded=!this.expanded},goToTimestamp:function(time){var t=this,e={libraryItemId:this.libraryItemId,libraryId:this.libraryItem.libraryId,episodeId:null,title:this.metadata.title,subtitle:this.metadata.authors.map((function(t){return t.name})).join(", "),caption:"",duration:this.media.duration||null,coverPath:this.media.coverPath||null};if(this.$store.getters.getIsMediaStreaming(this.libraryItemId))this.$eventBus.$emit("play-item",{libraryItemId:this.libraryItemId,episodeId:null,startTime:time,queueItems:[e]});else{var r={message:'Start playback for "'.concat(this.metadata.title,'" at ').concat(this.$secondsToTimestamp(time),"?"),callback:function(r){r&&t.$eventBus.$emit("play-item",{libraryItemId:t.libraryItemId,episodeId:null,startTime:time,queueItems:[e]})},type:"yesNo"};this.$store.commit("globals/setConfirmPrompt",r)}},clickEditChapters:function(){var t,e;"audiobook-id-chapters"===this.$route.name&&(null===(t=this.$route.params)||void 0===t?void 0:t.id)===(null===(e=this.libraryItem)||void 0===e?void 0:e.id)&&this.$emit("close")}},mounted:function(){}},o=r(4),component=Object(o.a)(n,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"w-full my-2"},[e("div",{staticClass:"w-full bg-primary px-6 py-2 flex items-center cursor-pointer",on:{click:function(e){return e.stopPropagation(),t.clickBar.apply(null,arguments)}}},[e("p",{staticClass:"pr-4"},[t._v(t._s(t.$strings.HeaderChapters))]),t._v(" "),e("span",{staticClass:"bg-black-400 rounded-xl py-1 px-2 text-sm font-mono"},[t._v(t._s(t.chapters.length))]),t._v(" "),e("div",{staticClass:"grow"}),t._v(" "),t.userCanUpdate?e("ui-btn",{staticClass:"mr-2",attrs:{small:"",to:"/audiobook/".concat(t.libraryItemId,"/chapters"),color:"bg-primary"},on:{click:t.clickEditChapters}},[t._v(t._s(t.$strings.ButtonEditChapters))]):t._e(),t._v(" "),t.keepOpen?t._e():e("div",{staticClass:"cursor-pointer h-10 w-10 rounded-full hover:bg-black-400 flex justify-center items-center duration-500",class:t.expanded?"transform rotate-180":""},[e("span",{staticClass:"material-symbols text-4xl"},[t._v("")])])],1),t._v(" "),e("transition",{attrs:{name:"slide"}},[e("table",{directives:[{name:"show",rawName:"v-show",value:t.expanded||t.keepOpen,expression:"expanded || keepOpen"}],staticClass:"text-sm tracksTable"},[e("tr",[e("th",{staticClass:"text-left w-16"},[e("span",{staticClass:"px-4"},[t._v("Id")])]),t._v(" "),e("th",{staticClass:"text-left"},[t._v(t._s(t.$strings.LabelTitle))]),t._v(" "),e("th",{staticClass:"text-center"},[t._v(t._s(t.$strings.LabelStart))]),t._v(" "),e("th",{staticClass:"text-center"},[t._v(t._s(t.$strings.LabelDuration))])]),t._v(" "),t._l(t.chapters,(function(r){return e("tr",{key:r.id},[e("td",{staticClass:"text-left"},[e("p",{staticClass:"px-4"},[t._v(t._s(r.id))])]),t._v(" "),e("td",{attrs:{dir:"auto"}},[t._v("\n          "+t._s(r.title)+"\n        ")]),t._v(" "),e("td",{staticClass:"font-mono text-center hover:underline cursor-pointer",on:{click:function(e){return e.stopPropagation(),t.goToTimestamp(r.start)}}},[t._v("\n          "+t._s(t.$secondsToTimestamp(r.start))+"\n        ")]),t._v(" "),e("td",{staticClass:"font-mono text-center"},[t._v("\n          "+t._s(t.$secondsToTimestamp(Math.max(0,r.end-r.start)))+"\n        ")])])}))],2)])],1)}),[],!1,null,null,null);e.default=component.exports;installComponents(component,{UiBtn:r(42).default})}}]);