1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1463],{1067:(e,n,o)=>{o.d(n,{A:()=>a});var t=o(89099),r=o(14232);let a=function(){let e=(0,t.useRouter)(),[n,o]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let n=(e,n)=>{let{shallow:t}=n;t||o(!0)},t=()=>o(!1);return e.events.on("routeChangeStart",n),e.events.on("routeChangeComplete",t),e.events.on("routeChangeError",t),()=>{e.events.off("routeChangeStart",n),e.events.off("routeChangeComplete",t),e.events.off("routeChangeError",t)}},[]),{isLoading:n}}},17530:(e,n,o)=>{o.d(n,{G_:()=>g,Kz:()=>u,Ly:()=>d,MB:()=>x,iS:()=>h,mr:()=>s,rN:()=>p,uh:()=>l,vU:()=>c});var t=o(30915),r=o.n(t),a=o(81115),i=o(16317);let l=async function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12,t=r().stringify({search:e,page:n,resultsPerPage:o});return await (0,i.FR)("".concat(a.FH.books,"/marketplace/books?").concat(t))},s=async(e,n)=>await (0,i.$X)("".concat(a.FH.books,"/marketplace/books/").concat(e),null!=n?n:""),c=async(e,n)=>{let o=await (0,i.$X)("".concat(a.FH.books,"/MyBooks?").concat(n),e);return{...o,results:(0,i.eK)(o)?[]:o.results.map(e=>({...e,progress:e.progress?100*e.progress:e.progress}))}},d=async(e,n)=>await (0,i.NE)("".concat(a.FH.books,"/MyBooks/").concat(n),e),h=async(e,n)=>await (0,i.$X)("".concat(a.FH.books,"/MyBooks/").concat(n),e),p=async(e,n,o)=>await (0,i.NE)("".concat(a.FH.books,"/MyBooks/").concat(n,"/bookmarks"),e,o),u=async function(e,n){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,l=r().stringify({page:o,resultsPerPage:t});return await (0,i.$X)("".concat(a.FH.books,"/MyBooks/").concat(n,"/bookmarks?").concat(l),e)},g=async(e,n,o)=>await (0,i.sl)("".concat(a.FH.books,"/MyBooks/").concat(n,"/bookmarks/").concat(o),e,void 0),x=async(e,n,o)=>await (0,i.$X)("".concat(a.FH.books,"/Groups/").concat(n,"/Books/").concat(o),e)},51463:(e,n,o)=>{o.d(n,{A:()=>eQ});var t=o(28888),r=o(37876),a=o(54587),i=o.n(a),l=o(89099),s=o(96851),c=o(14232),d=o(77165),h=o(66438),p=o(42008),u=o(41813),g=o(38441),x=o(71839);let m={src:"/_next/static/media/brand-execution-logo.a5816bf2.svg",height:250,width:561,blurWidth:0,blurHeight:0};var k=o(74359),b=o(33643),f=o(90542),y=o(63900),A=o(17530),w=o(39137),v=o(45285);let C=async(e,n,o,t)=>{var r,a;let i=await (0,A.Kz)(e,n,o,t);if((0,y.eK)(i))throw Error(i.message);if((null==(r=i.results)?void 0:r.length)===0)return[];let l=null==(a=i.results)?void 0:a.map(e=>{let n=(0,b.H)(e.date);return{...e,date:n.getTime()}});return null==l?void 0:l.sort((e,n)=>e.date-n.date)};var S=o(67768),j=o(40097);let O=async(e,n,o)=>{let t=await (0,A.rN)(e,n,o);if((0,y.eK)(t))throw Error(t.message);return t},I=async(e,n,o)=>{let t=await (0,A.G_)(e,n,o);if((0,y.eK)(t))throw Error(t.message);return t};var B=o(1067);let _=function(e){var n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0===o.length)return e("bookmark",{value:1});let t=o[o.length-1];return e("bookmark",{value:Number(null==t||null==(n=t.name)?void 0:n.split(" ")[1])+1})};var T=o(86120),D=o(67319),E=o(89708),z=o(82777),F=o(51804),H=o(77025),N=o(69585),R=o(92264);let L=e=>{let{bookmarks:n,...o}=e,t=(0,s.c)("BookDetailPage"),[a,i]=(0,c.useState)(!1),[l,d]=(0,c.useState)(0);return(null==n?void 0:n.length)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(F.A,{sx:{display:"flex",flexDirection:"column",paddingLeft:"8px",gap:"8px"},children:null==n?void 0:n.map(e=>(0,r.jsxs)(H.Ay,{sx:{display:"flex",height:"60px",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingRight:"2rem",borderLeft:e=>"8px solid ".concat(e.palette.primary.main)},children:[(0,r.jsx)(z.A,{component:"span",sx:{overflow:"hidden",fontSize:"1.4rem",whiteSpace:"nowrap",textOverflow:"ellipsis",color:e=>e.palette.common.black,fontWeight:500},children:e.name}),(0,r.jsx)(N.A,{onClick:()=>{var n,t;return n=e.id,t=e.location,void(d(n),o.handleChangeLocation(t),i(!0))},children:(0,r.jsx)(E.A,{sx:{fontSize:20,color:e=>e.palette.grey[600]}})})]},e.id))}),(0,r.jsx)(R.A,{justifyActions:"center",title:t("delete"),message:t("areYouSure"),isOpen:a,submitText:t
1("delete"),onClose:()=>i(!1),onSuccess:function(){o.handleDeleteBookmark(l),i(!1)}})]}):(0,r.jsx)(p.A,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:(0,r.jsx)(z.A,{sx:{fontStyle:"italic",fontSize:"1.4rem"},children:t("noBookmarks")})})};var K=o(53318),W=o(53912),G=o(4657),P=o(25313);function M(){let e=(0,t._)(["\n cursor: pointer;\n"]);return M=function(){return e},e}function U(){let e=(0,t._)(["\n padding: 1rem;\n font-size: 1.25rem;\n"]);return U=function(){return e},e}function Z(){let e=(0,t._)(["\n overflow: visible;\n"]);return Z=function(){return e},e}function q(){let e=(0,t._)(["\n position: relative;\n padding-top: calc("," + ",");\n height: calc(100% - ",");\n font-size: inherit;\n"]);return q=function(){return e},e}function X(){let e=(0,t._)(["\n text-align: center;\n padding-bottom: 4rem;\n font-weight: bold;\n width: 30rem;\n margin: 0 auto;\n font-size: inherit;\n"]);return X=function(){return e},e}(0,h.Ay)(u.A)(()=>({boxShadow:"none"}));let $=(0,h.Ay)(z.A)(e=>{let{theme:n}=e;return"\n margin-left: 3rem;\n cursor: pointer;\n color: ".concat(n.palette.text.secondary,";")});(0,h.Ay)(p.A)(()=>({flexGrow:1,p:3}));let Y=(0,h.Ay)("div")(M());(0,h.Ay)(G.A)(U()),(0,h.Ay)("div")(Z());let Q="50px",J="64px",V=(0,h.Ay)("div")(q(),J,Q,"112px");(0,h.Ay)("div",{shouldForwardProp:e=>"isSideBarOpen"!==e})(e=>{let{isSideBarOpen:n}=e;return"\n display: flex;\n justify-content: space-between;\n width: 20rem;\n height: 4rem;\n z-index: +1;\n position: relative;\n top: 1rem;\n right: ".concat(n?"36rem":"6rem",";\n cursor: pointer;\n svg {\n height: 2rem;\n width: 3rem;\n }\n p {\n position: relative;\n top: -0.25rem;\n font-size: 1.6rem;\n margin-right: -1rem;\n }\n")}),(0,h.Ay)(N.A)(()=>({width:35,height:35,top:-8}));let ee=(0,h.Ay)(P.A)(e=>{let{theme:n}=e;return"\n padding-top: 12px;\n padding-bottom: 12px;\n\n border-top: 1px solid ".concat(n.palette.grey[300],";\n border-bottom: none;\n\n &:last-child {\n border-bottom: 1px solid ").concat(n.palette.grey[300],";\n }\n\n &:hover {\n color: ").concat(n.palette.primary.main,";\n }\n")}),en=(0,h.Ay)(H.Ay)(e=>{let{theme:n}=e;return"\n cursor: pointer;\n\n border-top: 1px solid ".concat(n.palette.grey[300],";\n\n &:last-child {\n border-bottom: 1px solid ").concat(n.palette.grey[300],";\n }\n\n &:hover {\n color: ").concat(n.palette.primary.main,";\n background-color: ").concat(n.palette.grey[200],";\n }\n")});(0,h.Ay)("div")(()=>"\n position: relative;\n top: 1.1rem;\n z-index: +1;\n width: 4rem;\n svg {\n height: 2rem;\n width: 3rem;\n }\n ");let eo=(0,h.Ay)("div")(X()),et=e=>(0,K.A)(e=>e.breakpoints.down("md"))?(0,r.jsx)(W.Ay,{open:e.isOpen,variant:"temporary",anchor:e.anchor,onClose:e.onClose,disableScrollLock:!0,sx:{flexShrink:0,height:"calc(100vh - ".concat(J," - ").concat(Q,")"),width:"100vw"},PaperProps:{sx:{width:"100vw",height:"calc(100vh - ".concat(J," - ").concat(Q,")"),top:"calc(".concat(J," + ").concat(Q,")"),borderLeft:e=>"1px solid ".concat(e.palette.grey[300])}},children:e.children}):(0,r.jsx)(W.Ay,{open:e.isOpen,variant:"temporary",anchor:e.anchor,onClose:e.onClose,disableScrollLock:!0,sx:{flexShrink:0,height:"calc(100vh - ".concat(J," - ").concat(Q,")")},PaperProps:{sx:{width:"330px",height:"calc(100vh - ".concat(J," - ").concat(Q,")"),top:"calc(".concat(J," + ").concat(Q,")"),borderLeft:e=>"1px solid ".concat(e.palette.grey[300])}},children:e.children}),er=e=>(0,r.jsx)(x.A,{sx:{"&.MuiToolbar-root":{paddingLeft:"2rem"}},children:(0,r.jsx)(z.A,{sx:{fontSize:"1.6rem",fontWeight:e=>e.typography.fontWeightBold},children:e.title})}),ea=e=>{var n;let o=(0,s.c)("BookDetailPage");return e.isOpen?e.isBookmarksDataAvailable?(0,r.jsxs)(et,{isOpen:e.isOpen,anchor:"right",onClose:function(){e.handleCloseDrawer(),e.handleHighlightBookmark(!1)},children:[(0,r.jsx)(er,{title:o("myBookmarks")}),(0,r.jsx)(L,{bookmarks:null!=(n=e.bookmarks)?n:[],handleChangeLocation:e.handleChangeLocation,handleDeleteBookmark:e.handleDeleteBookmark,book:e.book,location:e.location})]}):(0,r.jsx)(et,{isOpen:e.isOpen,anchor:"right",children:(0,r.jsx)(er,{title:o("noBookFound")})}):null};var ei=o(36982),el=o(46290),es=o(74654),ec=o(76235);let ed=(0,h.Ay)(N.A)(e=>{let{theme:n}=e;return"\n transition: none;\n\n &:active {\n background-color: ".concat(n.palette.primary.main,";\n border-radius: 8px;\n padding: 4px;\n margin: 4px;\n }\n\n &:hover {\n background-color: none;\n }\n")}),eh=e=>{let{min:n=1,max:o=10,step:t=1,...a}=e;return(0,r.jsxs)(ec.fI,{sx:{gap:2},children:[(0,r.jsx)(ed,{disableRipple:!0,disableFocusRipple:!0,onClick:()=>{a.value!==n&&a.handleChange(a.value-t)},"aria-label":"Decrease value",children:(0,r.jsx)(ei.A,{sx:{fontSize:24}})}),(0,r.jsx)(es.Ay,{marks:!0,size:"small",value:a.value,step:t,min:n,max:o,onChange:(e,n)=>{"number"==typeof n&&a.handleChange(n)}
1,"aria-labelledby":"custom-slider",valueLabelDisplay:"auto"}),(0,r.jsx)(ed,{disableRipple:!0,disableFocusRipple:!0,onClick:()=>{a.value!==o&&a.handleChange(a.value+t)},"aria-label":"Increase value",children:(0,r.jsx)(el.A,{sx:{fontSize:24}})})]})},ep=e=>{let n=(0,s.c)("BookDetailPage");return(0,r.jsxs)(et,{isOpen:e.isOpen,anchor:"right",onClose:e.handleCloseDrawer,children:[(0,r.jsx)(er,{title:n("fontSize")}),(0,r.jsx)(p.A,{sx:{width:"100%",padding:"0 3rem"},children:(0,r.jsx)(eh,{value:e.value,step:10,min:80,max:130,handleChange:e.handleChangeFontSize})})]})};var eu=o(77865),eg=o(79029),ex=o(20463),em=o(82401),ek=o(39295),eb=o(13063),ef=o(95063),ey=o(89901);let eA=(0,h.Ay)(N.A)(e=>{let{theme:n}=e;return"\n background-color: ".concat(n.palette.primary.main,";\n border-radius: 8px;\n padding: 4px;\n margin: 4px;\n\n &:hover {\n background-color: ").concat(n.palette.primary.main,";\n }\n")}),ew=e=>e.isHighlighted?(0,r.jsx)(eA,{disableRipple:!0,disableFocusRipple:!0,onClick:e.onClick,children:e.children}):(0,r.jsx)(N.A,{disableRipple:!0,disableFocusRipple:!0,onClick:e.onClick,children:e.children}),ev=e=>{let n=()=>{e.bookmarkId?e.handleDeleteBookmark(e.bookmarkId):e.handleAddBookmark()};return e.isPending?(0,r.jsx)(N.A,{disabled:!0,children:(0,r.jsx)(ef.A,{size:24})}):e.bookmarkId?(0,r.jsx)(N.A,{onClick:n,children:(0,r.jsx)(eg.A,{sx:{fontSize:"24px",color:e=>e.palette.primary.main}})}):(0,r.jsx)(N.A,{onClick:n,children:(0,r.jsx)(ex.A,{sx:{fontSize:"24px"}})})},eC=(0,h.Ay)("div")(e=>{let{theme:n}=e;return"\n display: flex;\n width: 100%;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n height: 50px;\n background-color: #ffffff;\n border-bottom: 1px solid ".concat(n.palette.grey[300],";\n")}),eS=e=>{if(!(0,K.A)(e=>e.breakpoints.down("md"))){var n;return(0,r.jsxs)(eC,{children:[(0,r.jsxs)(ec.fI,{children:[(0,r.jsx)(N.A,{onClick:()=>T.mH.DASHBOARD_BOOKS_TAB(),children:(0,r.jsx)(eu.A,{sx:{fontSize:"30px"}})}),(0,r.jsx)(ew,{isHighlighted:e.highlightTableOfContentsIcon,onClick:e.toggleTableOfContentsDrawer,children:(0,r.jsx)(em.A,{sx:{fontSize:"24px"}})})]}),(0,r.jsx)(G.A,{sx:{color:e=>e.palette.secondary.main,"& .MuiBreadcrumbs-separator":{marginLeft:"3px",marginRight:"3px"}},"aria-label":"breadcrumbs",children:null==(n=e.breadcrumbs)?void 0:n.map(e=>(null==e?void 0:e.link)?(0,r.jsx)(ey.A,{sx:{fontSize:"1.2rem"},color:"secondary",href:e.link,children:e.label},e.id):null)}),(0,r.jsxs)(ec.fI,{children:[(0,r.jsx)(ew,{isHighlighted:e.highlightFontSizeIcon,onClick:e.toggleFontSizeDrawer,children:(0,r.jsx)(eb.A,{fontSize:"large"})}),(0,r.jsx)(ew,{isHighlighted:e.highlightBookmarkIcon,onClick:e.toggleBookmarksDrawer,children:(0,r.jsx)(ek.A,{sx:{fontSize:"24px"}})}),(0,r.jsx)(ev,{bookmarkId:e.bookmarkId,isPending:e.isPending,handleAddBookmark:e.handleAddBookmark,handleDeleteBookmark:e.handleDeleteBookmark})]})]})}return(0,r.jsxs)(eC,{children:[(0,r.jsxs)(ec.fI,{children:[(0,r.jsx)(N.A,{onClick:()=>T.mH.DASHBOARD_BOOKS_TAB(),children:(0,r.jsx)(eu.A,{sx:{fontSize:"30px"}})}),(0,r.jsx)(ew,{isHighlighted:e.highlightTableOfContentsIcon,onClick:e.toggleTableOfContentsDrawer,children:(0,r.jsx)(em.A,{sx:{fontSize:"24px"}})})]}),(0,r.jsxs)(ec.fI,{children:[(0,r.jsx)(ew,{isHighlighted:e.highlightFontSizeIcon,onClick:e.toggleFontSizeDrawer,children:(0,r.jsx)(eb.A,{fontSize:"large"})}),(0,r.jsx)(ew,{isHighlighted:e.highlightBookmarkIcon,onClick:e.toggleBookmarksDrawer,children:(0,r.jsx)(ek.A,{sx:{fontSize:"24px"}})}),(0,r.jsx)(ev,{bookmarkId:e.bookmarkId,isPending:e.isPending,handleAddBookmark:e.handleAddBookmark,handleDeleteBookmark:e.handleDeleteBookmark})]})]})};var ej=o(95831);let eO={color:"inherit",edge:"end"},{width:eI,height:eB}={width:f.FE?140:90,height:40};function e_(){let e=(0,t._)(["\n font-size: 1.2rem;\n overflow-wrap: break-word;\n text-align: center;\n"]);return e_=function(){return e},e}let eT=(0,h.Ay)(ej.Y)(()=>"\n align-items: center;\n height: 112px;\n background-color: #ffffff;\n"),eD=(0,h.Ay)(es.Ay)(e=>{let{theme:n}=e;return"\n width: 24rem;\n\n ".concat(n.breakpoints.up("md")," {\n width: 30rem;\n }\n")}),eE=(0,h.Ay)(z.A)(e_()),ez=e=>{var n;let{isOpen:o=!1,pageDetails:t,tableOfContents:a,handleChangeLocation:i,pageNumber:l}=e,c=(0,s.c)("BookDetailPage"),d=(null==(n=a.current)?void 0:n.length)?a.current.length-1:0;return o?(0,r.jsxs)(eT,{children:[(0,r.jsx)(ej.Y,{sx:{maxWidth:"80%"},children:(0,r.jsx)(eE,{children:t})}),(0,r.jsx)(eD,{size:"small","aria-label":c("pagination"),marks:!0,step:1,min:0,max:d,onChange:(e,n)=>{if((null==a?void 0:a.current)&&e.target){var o;i(null==(o=a.current[n])?void 0:o.href)}},value:l,color:"primary"})]}):null};var eF=o(42155);let eH=eF.w.palette.primary.main,eN=eF.w.palette.text,eR=eF.w.palette.background.paper,eL={container:{overflow:"hidden",height:"100%"},readerArea:{position:"relative",zIndex:1,height:"100%",width:"100%",backgroundColor:"#fff",transition:"all .3s ease"},containerExpanded:{transform:"translateX(256px)"},titleArea:{position:"absolute",top:"20px",left:"50px",right:"50px",textAlign:"center",color:"#999"},reader:{position:"absolute",top:"50px",left:"50px",bottom:"20px",right:"50px"},swipeWrapper:{position:"absolute",top:0,left:0,bottom:0,right:0,zIndex:200},prev:{left:"1px",color:"".concat(eH)},next:{right:"1px",color:"".concat(eH)},arrow:{outline:"none",border:"none",background:"none",position:"absolute",top:"50%",marginTop:"-32px",fontSize:"40px",padding:"0 10px",color:"#E2E2E2",fontFamily:"arial, sans-serif",curs
1or:"pointer",userSelect:"none",appearance:"none",fontWeight:"normal"},arrowHover:{color:"#777"},tocBackground:{position:"absolute",left:"256px",top:0,bottom:0,right:0,zIndex:1},tocArea:{position:"absolute",left:0,top:0,bottom:0,zIndex:0,width:"256px",overflowY:"auto",WebkitOverflowScrolling:"touch",background:"".concat(eR),padding:"10px 0"},tocAreaButton:{userSelect:"none",appearance:"none",background:"".concat(eR),border:"none",display:"block",fontFamily:"sans-serif",width:"100%",fontSize:".9em",textAlign:"left",padding:".9em 1em",borderBottom:"1px solid #ddd",color:"".concat(eN),boxSizing:"border-box",outline:"none",cursor:"pointer"},tocButton:{background:"none",border:"none",width:"32px",height:"32px",position:"absolute",top:"10px",left:"10px",borderRadius:"2px",outline:"none",cursor:"pointer"},tocButtonExpanded:{background:"#f2f2f2"},tocButtonBar:{position:"absolute",width:"60%",background:"#ccc",height:"2px",left:"50%",margin:"-1px -30%",top:"35%",transition:"all .5s ease"},tocButtonBarTop:{top:"65%"},tocButtonBottom:{top:"35%"},toc:{},loadingView:{position:"absolute",top:"50%",left:"10%",right:"10%",color:"#ccc",textAlign:"center",marginTop:"-0.5em"}};var eK=o(45972),eW=o(74020),eG=o(3291),eP=o(89320);let eM=(0,h.Ay)(eG.A)(()=>"\n & .MuiTypography-root {\n font-size: 1.5rem;\n overflow-wrap: break-word;\n }\n"),eU=e=>{let{data:n,handleChangeLocation:o,bookName:t}=e,[a,i]=(0,c.useState)(null),l=e=>n=>{n.stopPropagation(),i(null!=e?e:null)};return(0,r.jsxs)(F.A,{children:[(0,r.jsx)(H.Ay,{children:(0,r.jsx)(z.A,{sx:{fontSize:"2.4rem"},children:t})}),null==n?void 0:n.map(e=>(e=>e&&e.subitems&&0!==e.subitems.length)(e)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(ee,{onClick:()=>o(e.href),children:[(0,r.jsx)(eM,{primary:e.label,title:e.label}),a===e.id?(0,r.jsx)(N.A,{onClick:l(),...eO,children:(0,r.jsx)(eK.A,{})}):(0,r.jsx)(N.A,{onClick:l(e.id),...eO,children:(0,r.jsx)(eW.A,{})})]},e.id),(0,r.jsx)(eP.A,{in:a===e.id,timeout:"auto",unmountOnExit:!0,children:(0,r.jsx)(F.A,{children:e.subitems.map(e=>(0,r.jsx)(ee,{onClick:()=>o(e.href),children:(0,r.jsx)(eM,{primary:e.label,title:e.label})},e.id))})})]}):(0,r.jsx)(en,{sx:{cursor:"pointer","&:hover":{color:e=>e.palette.primary.main,backgroundColor:e=>e.palette.grey[200]}},onClick:()=>o(e.href),children:(0,r.jsx)(z.A,{sx:{fontSize:"1.6rem"},children:e.label})},e.id))]})},eZ=e=>(0,r.jsx)(p.A,{sx:{zIndex:1,position:"absolute"},children:e.showTableOfContents&&(0,r.jsx)(et,{isOpen:e.showTableOfContents,anchor:"left",onClose:()=>e.handleCloseDrawer(),children:(0,r.jsx)(p.A,{sx:{overflow:"auto",scrollbarWidth:"thin"},children:(0,r.jsx)(eU,{bookName:e.bookName,data:e.tableOfContents,handleChangeLocation:n=>{e.handleCloseDrawer(),e.handleChangeLocation(n)}})})})});function eq(){let e=(0,t._)(["\n font-size: 1.4rem;\n height: 100vh;\n"]);return eq=function(){return e},e}let eX=(0,h.Ay)(p.A)(eq()),e$=(0,h.Ay)(u.A)(e=>{let{theme:n}=e;return"\n box-shadow: none;\n height: calc(".concat(J," + ").concat(Q,");\n z-index: ").concat(n.zIndex.drawer+1,";\n padding-right: 0;\n")}),eY=(e,n)=>{switch(n.type){case"SHOW_TABLE_OF_CONTENTS_DRAWER":return{...e,showBookmarksDrawer:!1,showFontSizeDrawer:!1,showTableOfContentsDrawer:n.payload};case"SHOW_BOOKMARKS_DRAWER":return{...e,showFontSizeDrawer:!1,showTableOfContentsDrawer:!1,showBookmarksDrawer:n.payload};case"SHOW_FONT_SIZE_DRAWER":return{...e,showTableOfContentsDrawer:!1,showBookmarksDrawer:!1,showFontSizeDrawer:n.payload};case"HIGHLIGHT_BOOKMARK_ICON":return{...e,highlightTableOfContentsIcon:!1,highlightFontSizeIcon:!1,highlightBookmarkIcon:n.payload};case"HIGHLIGHT_TABLE_OF_CONTENTS_ICON":return{...e,highlightFontSizeIcon:!1,highlightBookmarkIcon:!1,highlightTableOfContentsIcon:n.payload};case"HIGHLIGHT_FONT_SIZE_ICON":return{...e,highlightTableOfContents:!1,highlightBookmarkIcon:!1,highlightFontSizeIcon:n.payload};case"SET_PAGE_NUMBER":return{...e,pageNumber:n.payload};case"SET_PAGE_DETAILS":return{...e,pageDetails:n.payload};case"SET_FONT_SIZE":return{...e,fontSize:n.payload};case"SET_LOCATION_ID":return{...e,locationId:n.payload};case"SET_BOOKMARK_PROGRESS":return{...e,bookmarkProgress:n.payload};case"SET_TABLE_OF_CONTENTS":return{...e,tableOfContents:n.payload};case"SET_RENDITION":return{...e,rendition:n.payload};default:return e}},eQ=e=>{var n;let{bookDetails:o,isBookPreview:t}=e,a=(0,s.c)("BookDetailPage"),h=(0,s.c)("common"),p=(0,c.useRef)(null),u=(0,c.useRef)(null),b=(0,l.useRouter)(),[y,E]=(0,c.useReducer)(eY,{pageNumber:0,pageDetails:"",fontSize:100,locationId:0,tableOfContents:[],showTableOfContentsDrawer:!1,showBookmarksDrawer:!1,showFontSizeDrawer:!1,highlightBookmarkIcon:!1,highlightTableOfContentsIcon:!1,highlightFontSizeIcon:!1,bookmarkProgress:0,rendition:null}),{isLoading:z}=(0,B.A)(),{userBookDetails:F,isLoadingUserBookDetails:H,bookmarks:N}=((e,n)=>{let{authToken:o}=(0,v.A)(),{id:t}=e,{data:r,isLoading:a}=(0,k.I)({queryKey:(0,w.yH)(o,t),queryFn:()=>(0,A.iS)(o,t),enabled:!!(t&&!n&&o)}),{data:i}=(0,k.I)({queryKey:(0,w.kb)(o,t,0),queryFn:()=>C(o,t,0,f.J3),enabled:!!(t&&!n&&o)});return{userBookDetails:r,isLoadingUserBookDetails:a,bookmarks:i}})(o,t),R=(0,c.useMemo)(()=>{var e;return null==N||null==(e=N.find(e=>e.location===y.locationId))?void 0:e.id},[N,y.locationId]),{addBookmark:L,deleteBookmark:K,isPendingAddBookmark:W,isPendingDeleteBookmark:G}=(e=>{let n=(0,S.jE)(),{authToken:o}=(0,v.A)(),{mutate:t,isPending:r}=(0,j.n)({mutationKey:["addBookmark"],mutationFn:e=>O(o,e.bookId,e.bookmark),onSuccess:()=>n.invalidateQueries({queryKey:(0,w.kb)(o,e,0)}),onError:e=>{console.error(e)}}),{mutate:a,isPending:i}=(0,j.n)({mutationKey:["deleteBookmark"],mutationFn:n=>I(o,e,n),onSuccess:()=>{n.invalidateQueries({queryKey:(0,w.kb)(o,e,0)})}});return{addBookmark:async e=>{r||t(e)},isPendingAddBookmark:r,deleteBookmark:async e=>{i||a(e)},isPendingDeleteBookmark:i}})(o.id),P=(0,c.useCallback)(()=>
1{if(u.current){let e={name:"(".concat(u.current,"%) ").concat(y.pageDetails),location:y.locationId};L({bookId:o.id,bookmark:e})}else{let e={name:"".concat(y.pageDetails)||_(a,N),location:y.locationId};L({bookId:o.id,bookmark:e})}},[L,o.id,y.locationId,y.pageDetails,N,a]),M=(0,c.useCallback)(e=>K(e),[K]),U=t?o:null==F?void 0:F.book,{fontSize:Z,rendition:q}=y;(0,c.useEffect)(()=>{q&&q.themes.fontSize("".concat(Z,"%"))},[Z,q]),(0,c.useEffect)(()=>{q&&(q.book.locations.generate(),q.book.ready.then(async()=>{q.book.loaded.navigation.then(e=>{let{toc:n}=e;E({type:"SET_TABLE_OF_CONTENTS",payload:n})})}),q.on("relocated",e=>{u.current=Math.floor(100*q.book.locations.percentageFromCfi(e.start.cfi))}))},[q]),(0,c.useEffect)(()=>{var e;let n=p.current;if(q&&(null==q||null==(e=q.location)?void 0:e.start)&&n){let{href:e}=q.location.start,o=n.findIndex(n=>n.href===e);-1!==o&&(E({type:"SET_PAGE_DETAILS",payload:n[o].label}),E({type:"SET_PAGE_NUMBER",payload:o}))}},[q]);let X=(0,c.useMemo)(()=>!!(null==U?void 0:U.fileUrl),[null==U?void 0:U.fileUrl]),Q=X&&!!y.locationId,J=X&&y.pageDetails,ee=(e=>{var n,o;return[{id:1,label:null!=(o=null==(n=e.group)?void 0:n.name)?o:""},{id:2,label:e.name}]})(o),en=e=>E({type:"SET_LOCATION_ID",payload:e});return z||H?(0,r.jsx)(D.A,{}):(0,r.jsxs)(eX,{children:[(0,r.jsx)(g.Ay,{}),(0,r.jsxs)(e$,{position:"fixed",children:[(0,r.jsxs)(x.A,{sx:{height:"64px"},children:[(0,r.jsx)(Y,{onClick:()=>!t&&b.push(T.Dl.HOME),children:(0,r.jsx)(i(),{src:m,alt:h("imageAlt"),width:eI,height:eB})}),(0,r.jsx)($,{variant:"h4",noWrap:!0,onClick:()=>!t&&b.push(T.Dl.BOOK(b.query.slug)),children:o.name})]}),(0,r.jsx)(eS,{bookmarkId:R,breadcrumbs:ee,isPending:W||G,highlightBookmarkIcon:y.highlightBookmarkIcon,highlightTableOfContentsIcon:y.highlightTableOfContentsIcon,highlightFontSizeIcon:y.highlightFontSizeIcon,toggleBookmarksDrawer:()=>{E({type:"HIGHLIGHT_BOOKMARK_ICON",payload:!y.highlightBookmarkIcon}),E({type:"SHOW_BOOKMARKS_DRAWER",payload:!y.showBookmarksDrawer})},toggleFontSizeDrawer:()=>{E({type:"HIGHLIGHT_FONT_SIZE_ICON",payload:!y.highlightFontSizeIcon}),E({type:"SHOW_FONT_SIZE_DRAWER",payload:!y.showFontSizeDrawer})},toggleTableOfContentsDrawer:()=>{E({type:"HIGHLIGHT_TABLE_OF_CONTENTS_ICON",payload:!y.highlightTableOfContentsIcon}),E({type:"SHOW_TABLE_OF_CONTENTS_DRAWER",payload:!y.showTableOfContentsDrawer})},handleAddBookmark:P,handleDeleteBookmark:M})]}),(0,r.jsx)(V,{children:X?(0,r.jsx)(d.$W,{url:null!=(n=null==U?void 0:U.fileUrl)?n:"",location:y.locationId,readerStyles:eL,showToc:!1,tocChanged:e=>p.current=e,getRendition:e=>{E({type:"SET_RENDITION",payload:e})},locationChanged:en}):(0,r.jsx)(eo,{children:(0,r.jsx)("h1",{children:a("noBookFound")})})}),(0,r.jsx)(ez,{isOpen:!!J,pageNumber:y.pageNumber,pageDetails:y.pageDetails,tableOfContents:p,handleChangeLocation:en}),(0,r.jsx)(eZ,{bookName:o.name,showTableOfContents:y.showTableOfContentsDrawer,tableOfContents:y.tableOfContents,handleChangeLocation:en,handleCloseDrawer:()=>{E({type:"HIGHLIGHT_TABLE_OF_CONTENTS_ICON",payload:!1}),E({type:"SHOW_TABLE_OF_CONTENTS_DRAWER",payload:!1})}}),(0,r.jsx)(ep,{value:y.fontSize,isOpen:y.showFontSizeDrawer,handleCloseDrawer:()=>{E({type:"SHOW_FONT_SIZE_DRAWER",payload:!1}),E({type:"HIGHLIGHT_FONT_SIZE_ICON",payload:!1})},handleChangeFontSize:e=>{E({type:"SET_FONT_SIZE",payload:e})}}),(0,r.jsx)(ea,{isOpen:y.showBookmarksDrawer,isBookmarksDataAvailable:Q,handleHighlightBookmark:e=>{E({type:"HIGHLIGHT_BOOKMARK_ICON",payload:e})},coverUrl:o.coverUrl,book:o,bookmarks:N,handleDeleteBookmark:M,handleCloseDrawer:()=>E({type:"SHOW_BOOKMARKS_DRAWER",payload:!1}),handleChangeLocation:en})]})}},89901:(e,n,o)=>{o.d(n,{A:()=>a});var t=o(48230),r=o.n(t);let a=(0,o(66438).Ay)(r())(e=>{let{theme:n}=e;return"\n display: inline-flex;\n align-items: center;\n gap: 4px;\n cursor: pointer;\n font-size: 1.6rem;\n line-height: 24px;\n color: ".concat(n.palette.primary.main,";\n text-decoration: none;\n\n &:hover {\n text-decoration: underline;\n }\n")})},92264:(e,n,o)=>{o.d(n,{A:()=>h});var t=o(37876),r=o(96851),a=o(11514),i=o(43185),l=o(14476),s=o(60591),c=o(50090),d=o(92228);let h=e=>{let{title:n,message:o,isOpen:h,onClose:p,onSuccess:u,submitText:g,hideCancelButton:x,justifyActions:m="flex-end"}=e,k=(0,r.c)("common");return(0,t.jsxs)(a.A,{open:h,onClose:p,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[(0,t.jsx)(i.A,{color:"primary",id:"alert-dialog-title",sx:{fontSize:20},children:n}),(0,t.jsx)(l.A,{children:(Array.isArray(o)?o:[o]).map(e=>(0,t.jsx)(s.A,{id:"alert-dialog-description",color:"secondary",sx:{fontSize:16},children:e},e))}),(0,t.jsxs)(c.A,{sx:{display:"flex",justifyContent:m},children:[!x&&(0,t.jsx)(d.A,{variant:"contained",onClick:p,sx:{fontSize:14,marginBottom:5,textTransform:"none",boxShadow:0,backgroundColor:"inherit",border:e=>"1px solid ".concat(e.palette.button.primary),color:e=>e.palette.button.primary,"&:hover":{backgroundColor:"inherit",border:e=>
1"1px solid ".concat(e.palette.button.primary),boxShadow:0}},children:k("cancel")}),(0,t.jsx)(d.A,{autoFocus:!0,variant:"contained",onClick:u,color:"primary",sx:{fontSize:14,marginBottom:5,textTransform:"none",color:e=>e.palette.brand.navbarButtonTextPrimary,backgroundColor:e=>e.palette.primary.main,"&:hover":{backgroundColor:e=>e.palette.button.hover,boxShadow:0},boxShadow:0},children:null!=g?g:k("ok")})]})]})}}}]);
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.