PageSourceSearch

https://www.dvcreators.net/assets/2.4.1/eBookPlayer.89cfbcb2.js

js dvcreators.net collected 2026-10-02 11:38:44 UTC 4,970 bytes, 1 lines download raw bytes

1import{v,ag as C,x as s,y as o,a3 as b,I as r,C as d,Q as w,aL as x,z as g,a1 as p,a2 as c,j as n,O as u,M as h,D as i,aj as f,Y as k,cr as P,al as q,F as Q,U as I,a5 as S,a4 as D}from"./index.ccd35ebd.js";import{Q as M}from"./QScrollArea.06db0997.js";import{Q as z}from"./QDrawer.d0198a90.js";import{T as B}from"./TouchSwipe.e926239a.js";import"./TouchPan.fe5c8598.js";import"./touch.6391c159.js";const _={name:"EBookPlayer",props:["chapters"],data:()=>({loading:!1,currentPage:null,currentPageSrc:null,showChapterModal:!1,playDebounced:null}),computed:{pages(){return this.chapters.reduce((e,t)=>e.concat(t.pages),[])},currentChapter(){return this.chapters.find(e=>e.pages.includes(this.currentPage))},currentPageIndex(){return this.pages.indexOf(this.currentPage)},haveChapters(){var e;return(e=this.chapters.filter(t=>!!t.name))==null?void 0:e.length}},methods:{handleSwipe(e){e.direction=="left"&&this.nextPage(),e.direction=="right"&&this.previousPage()},async nextPage(){this.playDebounced(this.pages[this.currentPageIndex+1])},async previousPage(){this.playDebounced(this.pages[this.currentPageIndex-1])},async signURL(e){const t=await this.$api("content/mediaRequest",{type:"eBook",contentID:this.$store.state.contentMetaData.id,fileName:e});return(t==null?void 0:t.messageCode)==="noAccess"?(this.$q.notify({color:"red",position:"bottom",message:"You don't have access to this content"}),this.exitContentPlay()):t.signedURL},async play(e){this.loading=!0,e&&(this.currentPage=e,console.log(e),this.currentPageSrc=await this.signURL(e.fileName)),this.loading=!1},playCover(){var e;this.play(((e=this.chapters.find(t=>t.isCover))==null?void 0:e.pages[0])||this.pages[0])}},created(){this.playDebounced=C(this.play,250)},async mounted(){this.playCover()}},L={style:{height:"calc(100vh - 106px) !important","min-height":"450px"},class:"column"},V={class:"col relative-position bg-grey-1 no-scroll overflow-hidden"},N={class:"fit flex row bg-grey-2 flex-center"},R={class:"q-px-sm text-caption",style:{"min-width":"50px"}},U={key:0},$={class:"text-bold"},j={key:0},T={class:"text-grey-3 text-caption"},A={key:1},E={class:"gt-sm q-ml-sm"};function F(e,t,m,O,Y,a){return s(),o("div",L,[b((s(),o("div",V,[r("div",N,[e.loading?(s(),d(w,{key:0,size:"xl"})):(s(),d(x,{key:e.currentPageSrc,src:e.currentPageSrc,class:"col",fit:"contain"},null,8,["src"]))])])),[[B,a.handleSwipe,void 0,{mouse:!0,left:!0,right:!0}]]),r("div",{class:k(["col-auto flex justify-between flex-center bg-grey-10 text-white no-wrap q-py-xs text-center",{"q-px-xs":!e.$q.screen.lt.sm}])},[r("div",{style:g({borderRight:e.$q.screen.lt.sm?"1px solid lightgrey":void 0}),class:"full-height flex-center flex"},[r("div",R,[t[3]||(t[3]=r("span",{class:"gt-sm"},"Page",-1)),p(" "+c(`${a.currentPageIndex+1} / ${a.pages.length}`),1)])],4),e.$q.platform.is.mobile?h("",!0):(s(),o("div",U,[n(u,{key:"previous",icon:"fa fa-arrow-left",disable:a.currentPageIndex<=0,unelevated:"",size:"sm",round:"",onClick:a.previousPage},null,8,["disable","onClick"])])),r("div",$,[a.currentChapter&&a.currentChapter.name?(s(),o("div",j," Chapter : "+c(a.currentChapter.name),1)):h("",!0),r("div",T,c(e.$store.state.contentMetaData.contentName),1)]),e.$q.platform.is.mobile?h("",!0):(s(),o("div",A,[n(u,{key:"next",icon:"fa fa-arrow-right",unelevated:"",disable:a.currentPageIndex==a.pages.length-1,size:"sm",round:"",onClick:a.nextPage},null,8,["disable","onClick"])])),r("div",{style:g({borderLeft:e.$q.screen.lt.sm?"1px solid lightgrey":void 0}),class:"full-height flex-center flex"},[a.haveChapters?(s(),d(u,{key:0,title:"Chapters",unelevated:"",disable:a.pages.length==1,onClick:t[0]||(t[0]=l=>e.showChapterModal=!0)},{default:i(()=>[n(f,{name:"fas fa-bars",style:{"font-size":"0.9rem"}}),r("span",E,c(e.$t("Chapters")),1)]),_:1},8,["disable"])):h("",!0)],4)],2),a.haveChapters?(s(),d(z,{key:0,modelValue:e.showChapterModal,"onUpdate:modelValue":t[2]||(t[2]=l=>e.showChapterModal=l),side:"right",width:e.$q.screen.gt.sm?300:e.$q.screen.width,behavior:"mobile",overlay:"",bordered:"",class:"bg-grey-2","no-swipe-open":""},{default:i(()=>[n(M,{class:"fit"},{default:i(()=>[n(P,{style:g({backgroundColor:e.$store.getters.brandColor}),class:"text-white flex justify-between"},{default:i(()=>[t[4]||(t[4]=r("div",{class:"full-width text-center"}," Chapters ",-1)),n(u,{flat:"",dense:"",onClick:t[1]||(t[1]=l=>e.showChapterModal=!1)},{default:i(()=>[n(f,{name:"fa fa-chevron-right",style:{"font-size":"0.9rem"}})]),_:1})]),_:1},8,["style"]),n(q,null,{default:i(()=>[(s(!0),o(Q,null,I(m.chapters.filter(l=>!!l.name),(l,y)=>(s(),d(S,{key:y,"active-class":"bg-grey-14 text-white",clickable:"",class:"q-ma-xs rounded-borders",active:a.currentChapter==l,onClick:G=>(a.play(l.pages[0]),e.showChapterModal=!1)},{default:i(()=>[n(D,null,{default:i(()=>[p(c(l.name),1)]),_:2},1024)]),_:2},1032,["active","onClick"]))),128))]),_:1})]),_:1})]),_:1}
1,8,["modelValue","width"])):h("",!0)])}var ee=v(_,[["render",F]]);export{ee as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.