/*! For license information please see 3.js.LICENSE.txt */ (self.webpackChunkFBPublication=self.webpackChunkFBPublication||[]).push([[3],{462:function(t,e){"use strict";e.Z={computed:{fullPdf:function(){return this.$store.state.downloads.allPagesVisible&&this.$store.getters["downloads/getFullPdf"]},customFiles:function(){return this.$store.getters["downloads/getCustomFiles"]},pageFiles:function(){return this.$store.state.downloads.currentPagesVisible&&this.$store.getters["downloads/getPageFiles"]},windowTitle:function(){return this.$i18n.t("SaveWindow.TITLE")},fullTooltip:function(){return this.$t("SaveWindow.SAVE_FULL_PUBLICATION_TOOLTIP")},pagesTitle:function(){return{full:this.$t("SaveWindow.FULL_PUBLICATION"),left:this.$t("SaveWindow.SAVE_LEFT_PAGE"),right:this.$t("SaveWindow.SAVE_RIGHT_PAGE"),one:this.$t("SaveWindow.SAVE_CURRENT_PAGE")}},pagesTooltip:function(){return{full:this.$t("SaveWindow.SAVE_FULL_PUBLICATION_TOOLTIP"),left:this.$t("SaveWindow.SAVE_LEFT_PAGE_TOOLTIP"),right:this.$t("SaveWindow.SAVE_RIGHT_PAGE_TOOLTIP"),one:this.$t("SaveWindow.SAVE_CURRENT_PAGE_TOOLTIP")}},pagerState:function(){return this.$store.getters["pager/legacyState"]}}}},6411:function(t,e,i){"use strict";var s=i(1443);e.Z={methods:{movePagerLeft:function(t){var e=t.target;(0,s.oJ)(this.$store,{target:e})},movePagerRight:function(t){var e=t.target;(0,s.X0)(this.$store,{target:e})},movePagerLeftmost:function(t){var e=t.target,i=void 0===e?null:e,o=t.navTarget,r=void 0!==o&&o;(0,s.tc)(this.$store,{target:i,navTarget:r})},movePagerRightmost:function(t){var e=t.target,i=void 0===e?null:e,o=t.navTarget,r=void 0!==o&&o;(0,s.w9)(this.$store,{target:i,navTarget:r})}}}},3866:function(t,e){"use strict";e.Z={props:{itemData:{type:[Object,Array],required:!0}},name:"SearchResultItem",computed:{isItemDataArray:function(){return Array.isArray(this.itemData)},pageId:function(){return this.isItemDataArray?this.itemData[0].pageId:this.itemData.pageId},textData:function(){return this.isItemDataArray?this.itemData[0].relevance<=this.itemData[1].relevance?this.itemData[0].text:this.itemData[1].text:this.itemData.text},title:function(){var t;if(this.$store.state.pager.spreadMode)if(this.isItemDataArray){var e=this.$store.getters["pages/pageCaptionById"]({id:this.itemData[0].pageId.toString()}),i=this.$store.getters["pages/pageCaptionById"]({id:this.itemData[1].pageId.toString()});if(this.$store.state.book.rightToLeft){var s=[i,e];e=s[0],i=s[1]}t=e+" - "+i}else{var o=this.$store.getters["pages/pageIndexById"](this.pageId.toString()),r=o%2==0?o-1:o+1,n=this.$store.getters["pages/pageIdByIndex"](r),a=this.$store.getters["pages/pageCaptionById"]({id:this.pageId.toString()});if(n){var h=this.$store.getters["pages/pageCaptionById"]({id:n.toString()});if(this.$store.state.book.rightToLeft){var l=[h,a];a=l[0],h=l[1]}t=o>r?h+" - "+a:a+" - "+h}else t=a}else t=this.$store.getters["pages/pageCaptionById"]({id:this.pageId.toString(),forceFullWide:this.itemData.isWide&&!this.itemData.isDivided,widePageSecondHalf:this.itemData.widePageSecondHalf});return this.$i18n.t("SearchToolWindow.PAGE_NUMBER",{0:t})},moreResults:function(){var t=this.isItemDataArray?this.itemData[0].count+this.itemData[1].count:this.itemData.count;return t>1?"..."+this.$i18n.tc("SearchToolWindow.MORE_RESULTS",t-1,{0:t-1}):null}}}},2248:function(t,e,i){"use strict";var s=i(6382),o=i.n(s);e.Z={data:function(){return{tempTimeout:null,showClear:!1,inputDir:this.$store.getters["i18n/isLocaleRtl"]?"rtl":"ltr"}},computed:{results:function(){return this.$store.state.search.results},progress:function(){return this.$store.getters["search/getProgress"]},isSearching:function(){return 100!==this.progress&&null!==this.progress},isInitializing:function(){return this.$store.getters["search/isInitializing"]},preloaderVisible:function(){return this.isSearching||this.isInitializing&&!this.searchQueryIsEmpty},searchQueryIsEmpty:function(){return 0===this.$store.state.search.query.length},exactMatch:{get:function(){return this.$store.state.search.exactMatch},set:function(t){this.$store.dispatch("search/setExactMatch",{component:"search",value:t}),this.updateSearchQuery()}}},methods:{input:function(t){if(t){if(this.showClear=!0,!t.trim())return}else this.showClear=!1;this.tempTimeout&&clearTimeout(this.tempTimeout),this.tempTimeout=setTimeout((function(){this.$refs.searchInput&&(this.tempTimeout=null,this.$root.log("search.query",this.$refs.searchInput.value),this.updateSearchQuery())}).bind(this),500),this.setInputDir()},updateSearchQuery:function(){var t=this.$refs.searchInput.value;t=t.trim().replace(/\s*(\s)\s*/gm,"$1"),this.$store.dispatch("search/setQuery",{value:t})},clear:function(){this.$refs.searchInput.value&&(this.$store.dispatch("search/setQuery",{value:""}),this.$refs.searchInput.value="",this.showClear=!1,this.$nextTick(this.focusInput)),this.setInputDir()},setInputDir:function(){if(this.$refs.searchInput.value){var t=o().getDirection(this.$refs.searchInput.value);this.inputDir=t?"ltr"===t?"ltr":"rtl":"ltr"}else this.inputDir=this.$store.getters["i18n/isLocaleRtl"]?"rtl":"ltr"}}}},663:function(t,e,i){"use strict";var s=i(6382),o=i.n(s),r=i(7503);e.Z={props:{data:{type:Object,required:!0}},components:{thumb:r.Z},computed:{singleMode:function(){return this.$store.state.pager.singleMode},textDirection:function(){return o().getDirection(this.data.caption)},itemStyles:function(){var t={};return this.data.size&&(t.width=this.data.size.width+"px",t.height=this.data.size.height+"px"),t},slideMode:function(){return this.$store.state.pager.slideMode},contentCrop:function(){return this.slideMode&&this.$store.state.book.contentCrop}}}},3549:function(t,e){"use strict";e.Z={computed:{title:function(){return this.$i18n.t("ThumbnailsToolWindow.TITLE")},isRtl:function(){return this.$store.state.book.rightToLeft},pagerState:function(){return this.$store.getters["pager/state"]},singleMode:function(){return this.pagerState.singleMode},slideMode:function(){return this.pagerState.slideMode},mode:function(){return this.pagerState.mode},contentCrop:function(){return this.slideMode&&this.$store.state.book.contentCrop},thumbSizes:function(){return this.getThumbSizes(!1)},thumbDoubleSizes:function(){return this.getThumbSizes(!0)},hasPages:function(){return this.$store.getters["pages/pagesCount"]>0},numerationOffset:function(){return this.$store.state.book.numerationOffset},lowercaseRomans:function(){return this.$store.state.workspace.lowercaseRomans}}}},3760:function(t,e,i){"use strict";var s=i(6382),o=i.n(s),r=i(8531);e.Z={props:{itemData:{type:Object,required:!0},depth:{type:[Number,String],default:0}},computed:{width:function(){return this.depth<=2?214-20*this.depth:154},pageLabel:function(){return this.$store.getters["pages/pageCaptionByIndex"](this.itemData.page-1)},itemTitle:function(){return""+(0,r.jJ)((0,r.m9)(this.itemData.title)).replace(/\n/g,"")+""},textDirection:function(){return o().getDirection(this.itemData.title)},isLocaleRtl:function(){return this.$store.getters["i18n/isLocaleRtl"]}},methods:{toggleOpen:function(t){this.$store.dispatch("toc/toggleState",this.itemData)},refresh:function(){this.$parent.refresh()}},updated:function(){this.$parent.refresh()},mounted:function(){this.$parent.refresh()}}},8002:function(t,e){"use strict";e.Z={computed:{tocItems:function(){return this.$store.state.toc.enabled?this.$store.state.toc.children:[]},level2Items:function(){if(this.$store.state.toc.children)for(var t=0,e=this.$store.state.toc.children.length;t'}})},8384:function(t,e,i){i(4147).register({"add-note":{width:16,height:16,viewBox:"0 0 24 24",data:''}})},607:function(t,e,i){i(4147).register({"arrow-down":{width:16,height:16,viewBox:"0 0 24 24",data:''}})},464:function(t,e,i){i(4147).register({"book-first":{width:16,height:16,viewBox:"0 0 24 24",data:''}})},925:function(t,e,i){i(4147).register({"book-last":{width:16,height:16,viewBox:"0 0 24 24",data:''}})},9036:function(t,e,i){i(4147).register({"book-next":{width:16,height:16,viewBox:"0 0 24 24",data:''}})},6965:function(t,e,i){i(4147).register({"book-prev":{width:16,height:16,viewBox:"0 0 24 24",data:''}})},2731:function(t,e,i){i(4147).register({cancel:{width:16,height:16,viewBox:"0 0 24 24",data:''}})},3374:function(t,e,i){i(4147).register({"chevron-right":{width:24,height:24,viewBox:"0 0 24 24",data:''}})},1691:function(t,e,i){i(4147).register({cross:{width:24,height:24,viewBox:"0 0 24 24",data:''}})},5274:function(t,e,i){i(4147).register({"down-arrow":{width:16,height:16,viewBox:"0 0 16 16",data:''}})},2209:function(t,e,i){i(4147).register({drag:{width:16,height:16,viewBox:"0 0 100 100",data:''}})},9074:function(t,e,i){i(4147).register({equalizer:{width:100,height:100,viewBox:"0 0 100 100",data:''}})},5903:function(t,e,i){i(4147).register({fullscreen:{width:16,height:16,viewBox:"0 0 24 24",data:''}})},5843:function(t,e,i){i(4147).register({"mobile-left":{width:16,height:16,viewBox:"0 0 24 40",data:''}})},9117:function(t,e,i){i(4147).register({"mobile-right":{width:16,height:16,viewBox:"0 0 24 40",data:''}})},2150:function(t,e,i){i(4147).register({"note-content":{width:16,height:16,viewBox:"0 0 24 24",data:''}})},6722:function(t,e,i){i(4147).register({"open-link":{width:16,height:16,viewBox:"0 0 24 24",data:''}})},5958:function(t,e,i){i(4147).register({"rounded-close":{width:16,height:16,viewBox:"0 0 16 16",data:''}})},6010:function(t,e,i){i(4147).register({search:{width:24,height:24,viewBox:"0 0 24 24",data:''}})},169:function(t,e,i){i(4147).register({text:{width:16,height:16,viewBox:"0 0 30 30",data:''}})},5606:function(t,e,i){i(4147).register({thumbnails:{width:16,height:16,viewBox:"0 0 24 24",data:''}})},6062:function(t,e,i){i(4147).register({"trash-can":{width:16,height:16,viewBox:"0 0 24 24",data:''}})},6177:function(t,e,i){i(4147).register({error:{width:16,height:16,viewBox:"0 0 128 128",data:''}})},5284:function(t,e,i){i(4147).register({"made-with":{width:119,height:30,viewBox:"0 0 119 30",data:''}})},1619:function(t,e,i){i(4147).register({"page-wide":{width:500,height:370,viewBox:"0 0 500 370",data:''}})},9719:function(t,e,i){i(4147).register({page:{width:250,height:370,viewBox:"0 0 250 370",data:''}})},148:function(t,e,i){i(4147).register({replay:{width:16,height:16,viewBox:"0 0 70 70",data:''}})},2358:function(t,e,i){"use strict";function s(t){var e=t.filenameOrUrl,i=t.relativePath,s=void 0===i?"assets/pages/content/":i,o=t.encode,r=void 0!==o&&o;return/^(?:https?|medialib):\/\//.test(e)?e:s+(r?encodeURIComponent(e):e)}i.d(e,{n:function(){return s}})},2567:function(t,e,i){"use strict";var s=i(320),o={cTest:!1,id:function(t){return document.getElementById(t)},tag:function(t){return document.getElementsByTagName(t)[0]},tags:function(t){return document.getElementsByTagName(t)},byClass:function(t){return document.getElementsByClassName(t)},add:function(t){return document.createElement(t)},round:function(t,e){e=e||0;for(var i=1,s=0;s=1.5&&(i*=1.5);var s=e.sizes.reduce((function(t,e){return tt?e:t:e>=i&&e0&&void 0!==arguments[0]?arguments[0]:this.pageId;this.renderContent&&this.$pageRegistry.registerPage(t,this.pageSide,this)},deregisterPage:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pageId;this.renderContent&&this.$pageRegistry.deregisterPage(t,this.pageSide)},getSpreadTwin:function(){var t=this.$store.getters["pager/state"];return this.isCurrent&&t.spreadMode?this.pageId!==t.leftPage||this.isWide&&"right"===this.pageSide?this.pageId===t.rightPage?this.$pageRegistry.getPageComponent(t.leftPage,"left"):null:this.$pageRegistry.getPageComponent(t.rightPage,"right"):null},getDownloadProgress:function(){this.isDownloaded=this.$store.getters["pages/isDownloaded"](this.pageId)}},computed:{showThumbnail:function(){return this.isReady&&this.isDownloaded&&!this.hasError},isMobile:function(){return this.$store.getters["workspace/isMobile"]},isRTLBook:function(){return this.$store.state.book.rightToLeft},apiChange:function(){return this.$store.state.pages.apiChange},changeProperty:function(){return this.$store.state.pages.changeInPage},downloadProgressUpdated:function(){return this.$store.state.pages.downloadProgressUpdated},contentFreezed:function(){return"pending"!==this.$store.state.pager.flipState},updatePending:function(){return!this.isMobile&&this.isZoomed&&this.$store.getters["pages/pageProp"](this.pageId,"updatePending")},preloaderHeader:function(){return this.hasError?this.$t("Other.PAGE_ERROR_TITLE"):null},preloaderText:function(){return this.hasError?this.$t("Other.PAGE_ERROR_MESSAGE"):this.isReady?this.isDownloaded?null:this.$t("Other.DOWNLOADING_PAGE"):this.$t("Other.CONVERTING_PAGE")},backgroundLuma:function(){return this.backgroundColor?(0,c.R)((0,c.l)(this.backgroundColor)):1},enforceTransparentBg:function(){return this.$store.state.workspace.alteredSVGColors&&this.$store.state.workspace.userAgentInfo.browser.samsung},isZoomed:function(){return this.$store.state.pages.size.zoomFactor>1},dir:function(){return this.$store.getters["i18n/isLocaleRtl"]?"rtl":"ltr"},isResizing:function(){return this.$store.state.workspace.isResizing},isPreloaderShown:function(){return this.$store.state.workspace.preloader},pageWidthMultiplier:function(){return this.isWide&&"both"===this.pageSide?2:1},pagesSize:function(){return this.$store.getters["pages/size"]},contentSize:function(){if(this.pageId){var t=this.isOutsideHardcover&&parseInt(this.propWidth,10)===parseInt(this.$store.state.book.bookSize.width,10)&&parseInt(this.propHeight,10)===parseInt(this.$store.state.book.bookSize.height,10)?"FILL":null;return this.$store.getters["pages/contentSize"]({pageID:this.pageId,pageSide:this.pageSide,pageSize:this.pageSize,resizeOverride:t})}return{width:0,height:0,offsetX:0,offsetY:0,scaleRatio:{w:0,h:0}}}}},p=i(6411),g=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-touch",{class:"selecttext"+(t.showCanvas?" active":""),style:t.contStyle,on:{pan:t.pan,panstart:t.reset,panend:t.panEnd,pancancel:t.panEnd}},[t.showCanvas?i("canvas",{class:t.canvasClass,style:{position:"absolute",right:t.isWide&&"right"===t.pageSide?0:"none"},attrs:{width:t.containerSize.width,height:t.containerSize.height}}):t._e(),t._v(" "),t._l(t.textBlockSizes,(function(e,s){return i("div",{staticClass:"text-block",style:{width:e.width+"px",top:e.top+"px",left:e.left+"px",height:e.height+"px"},attrs:{"data-set":"select-text-block"}},[t.inspectorMode?i("span",{staticClass:"block-inspector-mode"},[t._v(t._s(s))]):t._e(),t._v(" "),t._l(t.finalTree[s].lines,(function(s,o){return t.inspectorMode?i("span",{staticClass:"line-inspector-mode",style:{top:s.top*t.containerSize.scaleRatio.h-e.top+"px",left:s.left*t.containerSize.scaleRatio.w-e.left+"px",width:s.width*t.containerSize.scaleRatio.w+"px",height:s.height*t.containerSize.scaleRatio.h+"px"}},[t._v(t._s(o))]):t._e()}))],2)}))],2)},f=[];function m(t,e){return S(t)||b(t,e)||x(t,e)||v()}function v(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function b(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var s,o,r,n,a=[],h=!0,l=!1;try{if(r=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;h=!1}else for(;!(h=(s=r.call(i)).done)&&(a.push(s.value),a.length!==e);h=!0);}catch(t){l=!0,o=t}finally{try{if(!h&&null!=i.return&&(n=i.return(),Object(n)!==n))return}finally{if(l)throw o}}return a}}function S(t){if(Array.isArray(t))return t}function y(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=x(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var s=0,o=function(){};return{s:o,n:function(){return s>=t.length?{done:!0}:{done:!1,value:t[s++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,n=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return n=t.done,t},e:function(t){a=!0,r=t},f:function(){try{n||null==i.return||i.return()}finally{if(a)throw r}}}}function w(t){return $(t)||P(t)||x(t)||k()}function k(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function x(t,e){if(t){if("string"==typeof t)return z(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?z(t,e):void 0}}function P(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function $(t){if(Array.isArray(t))return z(t)}function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,s=new Array(e);i=e.bottom&&t.left<=e.left&&t.right>=e.right?{rectCrossed:!1,fullSelected:!0}:t.top<=e.top&&t.bottom>=e.bottom&&(t.left>=e.left&&t.left<=e.right||t.right<=e.right&&t.right>=e.left)?{rectCrossed:!0,fullSelected:!0}:t.bottome.bottom||t.left>e.right||t.righte.top&&t.bottom>e.bottom,o=t.tope.top&&t.bottom>e.bottom),"right"===t.cursorHSide?(r=e.right>t.right&&e.leftt.left&&e.leftt.left&&e.leftt.right&&e.leftt.top,h=e.topt.bottom):(n=e.topt.bottom,h=e.topt.top),{activePoint:r&&n,startPoint:a&&h,leftSelected:s,rightSelected:o,rectCrossed:!0,fullSelected:!1});var s,o,r,n,a,h}T.prototype.selectSymbols=function(t,e){var i=this._intersectRects(t,e);return this._collectSelectedBlocks(i),this._collectSelectedLines(i),this._collectSelectedSymbols(i),this._getSelectedSymbols(e)},T.prototype._collectSelectedBlocks=function(t){this.crossInfos=this._getCrossInfos(t);for(var e=this.crossInfos.filter((function(t){return t.startPoint||t.activePoint})).length<2,i=0,s=this.finalTree.length;ithis.finalTree[o].lines[r].top&&n.bottomthis.finalTree[o].lines[r].top&&n.topthis.finalTree[o].lines[r].top&&n.topthis.finalTree[o].lines[r].top&&n.bottom0&&(n.push(this._getLineBreak(n)),e.push.apply(e,w(n)))}}else{var l=this._filterByAllowedRect(this.finalTree[i].lines[o].symbols,t);l.length>0&&e.push.apply(e,w(l).concat([this._getLineBreak(l)]))}else e.push.apply(e,w(this._getSymbolsFromBlock(i,t)));return this._removeRedundantLineBreaks(e)},T.prototype._intersectRects=function(t,e){if(!e)return t;var i=I(t.left,e.left,e.left+e.width),s=I(t.left+t.width,e.left,e.left+e.width),o=I(t.top,e.top,e.top+e.height),r=I(t.top+t.height,e.top,e.top+e.height);return C({},t,{left:i,width:Math.max(s-i,0),right:s,top:o,height:Math.max(r-o,0),bottom:r})},T.prototype._filterByAllowedRect=function(t,e){if(!e)return t;var i=e.left+e.width,s=e.top+e.height;return t.filter((function(t){var o=t.left>=e.left&&t.right<=i||t.left>e.left&&t.left<=i||t.left=e.left,r=t.top>=e.top&&t.bottom<=s||t.top=e.top||t.top>e.top&&t.top<=s;return o&&r}))},T.prototype._removeRedundantLineBreaks=function(t){return 0===t.length||("\n"===t[0].word&&t.splice(0,1),"\n"===t[t.length-1].word&&t.pop()),t},T.prototype._modifyCurrentSelectRect=function(t,e){var i=this,s=this,o=this.partSelectedBlocks[t],r=this.crossInfos[this.partSelectedBlocks[t]],n=C({},e),a=function(t){n.height=i.finalTree[o].top+i.finalTree[o].height-n.top+2,n.top=e.top,t||(n.top+=e.height,s.inverseLineSelection=!0)},h=function(t){n.top=i.finalTree[o].top,n.height=e.height+e.top-i.finalTree[o].top,t||(n.height-=e.height,s.inverseLineSelection=!0)};if(0===t)r.startPoint?a("bottom"===n.cursorVSide):a("bottom"!==n.cursorVSide);else if(1===t){if(r.activePoint)h("bottom"===n.cursorVSide);else h("bottom"!==n.cursorVSide)}return n},T.prototype._simplifySelectedBlocks=function(){var t=this;this.partSelectedBlocks.length>2&&(this.partSelectedBlocks=[Math.min.apply(Math,w(this.partSelectedBlocks)),Math.max.apply(Math,w(this.partSelectedBlocks))]);var e=[].concat(w(this.partSelectedBlocks),w(this.fullSelectedBlocks));if(e.length>0){for(var i=Math.min.apply(Math,w(e)),s=Math.max.apply(Math,w(e)),o=[];i<=s;)o.push(i),i++;this.fullSelectedBlocks=o.filter((function(e){return-1===t.partSelectedBlocks.indexOf(e)}))}},T.prototype._simplifySelectedLines=function(){for(var t=[].concat(w(this.partSelectedLines),w(this.fullSelectedLines)),e=new Map,i=[],s=0,o=t.length;s0&&i.push.apply(i,w(n).concat([this._getLineBreak(n)]))}return i},T.prototype._getLineBreak=function(t,e){var i=.01,s=e?t[0]:t[t.length-1],o={left:e?s.left-i:s.left+s.width,top:s.top,height:s.height,angle:s.angle,width:i,word:"\n",lineBreak:!0};return o.right=o.left+o.width,o},T.prototype._getCrossInfos=function(t){for(var e=[],i=0,s=this.finalTree.length;i=i?i:t};function L(t,e){return t.right=t.left+t.width,t.lefte.right||(t.lefte.right||t.lefte.right-.7*e.width)}function R(t,e,i){var s=e.indexOf(i);t?-1===s&&e.push(i):-1!==s&&e.splice(s,1)}var E,O,F,D,_=i(320);try{i.e(11).then(i.bind(i,4015)).then((function(t){(E=t).memory.grow(80),F=new TextEncoder("utf8"),D=new TextDecoder("utf8"),O=!0})).catch((function(t){console.log("fribidi wasn't initialized")}))}catch(nr){console.log("fribidi wasn't initialized")}var W="‏";function B(){}function A(t,e){var i=t.map((function(t){return t.rtl})).filter((function(t){return!(0,_.o8)(t)}));return 0===i.length?e:i[0]}B.prototype.getSelectedText=function(t,e){for(var i=this._getLines(t),s="",o=O?this._processLineFribidi:this._processLineSimple,r=0,n=i.length;r0?" ":"")+i}return i},B.prototype._processBrackets=function(t){for(var e=[{char:"(",open:!0,reversed:")"},{char:")",open:!1,reversed:"("},{char:"[",open:!0,reversed:"]"},{char:"]",open:!1,reversed:"["},{char:"{",open:!0,reversed:"}"},{char:"}",open:!1,reversed:"{"}],i=t,s=0;s=0;)o=(i=this._processBracket(i,o,e[s].open,e[s].reversed)).indexOf(e[s].char,o+1);return i},B.prototype._processBracket=function(t,e,i,s){var o=function(t,e){return e?/[\s,:;\\.\\!\\?]/.test(t):/[\s,:;]/.test(t)},r=t;return i?(e===r.length-1||o(r[e+1],!0))&&e>0&&!o(r[e-1],!1)&&(r=(e>0?r.substr(0,e):"")+s+(e0?r.substr(0,e):"")+s+(e=e||"right"===this.pageSide&&t.left0?this.pageRect=this.$el.getBoundingClientRect():this.pageRect=null},getBorderCollisions:function(t){return this.allowedRect?{left:t.leftthis.allowedRect.left+this.allowedRect.width,top:t.topthis.allowedRect.bottom}:{}},getCornerSymbol:function(t){return{isRtlSelection:this.isRtlSelection,top:Math.round(t.top*this.containerSize.scaleRatio.h),left:Math.round(t.left*this.containerSize.scaleRatio.w),width:Math.round(t.width*this.containerSize.scaleRatio.w),height:Math.round(t.height*this.containerSize.scaleRatio.h),collisions:this.getBorderCollisions(t)}},drawSelection:function(){if(0!==this.selectedSymbols.length){this.context||this.initContext(),this.context.clearRect(0,0,this.containerSize.width,this.containerSize.height),this.context.fillStyle="#027bff";for(var t=0,e=this.selectedSymbols.length;t0?this.$nextTick((function(){e.drawSelection()})):this.resetContext(),this.cornerTimeout=setTimeout((function(){if(!(e.selectedSymbols.length<1)){var t,i;if(1===e.selectedSymbols.length)t=i=e.selectedSymbols[0];else if(e.isRtlSelection){var s=e.selectedSymbols.findIndex((function(t){return t.lineBreak}));t=-1===s?e.selectedSymbols[0]:e.selectedSymbols[s-1];for(var o=e.selectedSymbols.length-1;o>=0&&!e.selectedSymbols[o].lineBreak;)o-=1;i=-1===o?e.selectedSymbols[e.selectedSymbols.length-1]:o===e.selectedSymbols.length-1?e.selectedSymbols[o-1]:e.selectedSymbols[o+1]}else t=e.selectedSymbols[0],10===(i=e.selectedSymbols[e.selectedSymbols.length-1]).word.charCodeAt(0)&&(i=e.selectedSymbols[e.selectedSymbols.length-2]);e.$store.dispatch("text/setCornerSymbols",{first:e.getCornerSymbol(t),last:e.getCornerSymbol(i)})}}),50),0===this.selectedSymbols.length&&this.$root.$emit("selectText:hidePanel")):this.$root.$emit("selectText:hidePanel")},isCurrent:function(t){var e=this;t&&(0===this.finalTree.length&&this.getAndParseXML(),this.$nextTick((function(){e.getPageRect()})))},selectTextInfoLoaded:function(t){t.pageId===this.pageId&&this.getAndParseXML()},animationInProgress:function(t){t||this.$store.getters["pager/isCurrentPage"]({pageId:this.pageId,pageSide:this.pageSide})&&this.getPageRect()}},computed:{canvasClass:function(){return{"select-text-canvas":!0,"show-effect":this.showEffect,"hide-before-effect":!this.showEffect&&this.effectOn}},effectOn:function(){return this.$store.state.text.effect},userRect:function(){var t={top:0,left:0,width:0,height:0};return this.$store.state.text.selectionRect&&(this.pageId===this.$store.state.text.pageID&&this.isWide&&this.pageSide!==this.$store.state.text.pageSide||this.pageId===this.$store.state.text.pageID&&this.pageSide===this.$store.state.text.pageSide&&this.isCurrent)?this.$store.state.text.selectionRect:t},allowedRect:function(){if(this.isWide&&this.isCrossWide&&this.singleMode){var t=this.$store.getters["pages/pageProp"](this.pageId,"width")/2;return{left:"right"===this.pageSide?t:0,width:t,top:0,height:this.$store.getters["pages/pageProp"](this.pageId,"height")}}},singleMode:function(){return this.$store.state.pager.singleMode},showCanvas:function(){return this.selectedSymbols.length>0},selectTextInfoLoaded:function(){return this.$store.state.search.selectTextInfoLoaded},animationInProgress:function(){return this.$store.getters["workspace/animationInProgress"]}}},V=i(2155),j={name:"select-text",mixins:[Z],data:function(){return{isActive:!1,isDragging:!0}},mounted:function(){var t=this;this.$nextTick((function(){t.getPageRect()})),this.$parent.$parent.$on("highlight",this.highlight),this.$root.$on("zoomMove",this.zoomMove),this.effectOn&&this.$el.addEventListener("mousemove",this.checkMousePosition)},beforeDestroy:function(){this.resetContext(),this.$parent.$parent.$off("highlight",this.highlight),this.$root.$off("zoomMove",this.zoomMove),this.$el.removeEventListener("mousemove",this.checkMousePosition)},methods:{highlight:function(){var t=this;this.effectOn&&(this.panEnd(),this.showEffect=!0,setTimeout((function(){t.showEffect=!1,t.$store.dispatch("text/setEffect",!1)}),3e3))},reset:function(t){this.effectOn||(this.$el.removeEventListener("mousemove",this.checkMousePosition),this.$root.$emit("selectText:hidePanel"),t&&"panstart"===t.type&&(this.isActive=!0),this.$store.dispatch("text/reset"))},pan:function(t){if(this.pageRect&&this.isLoaded&&this.isCurrent&&(!this.isZoomed||!this.isDragging)&&this.isActive&&!this.selectAll&&!this.effectOn&&!this.animationInProgress){var e={top:t.deltaY>0?t.center.y-t.deltaY-this.pageRect.top:t.center.y-this.pageRect.top,left:t.deltaX>0?t.center.x-t.deltaX-this.pageRect.left:t.center.x-this.pageRect.left,width:Math.abs(t.deltaX),height:Math.abs(t.deltaY),offsetX:this.containerSize.offsetX,offsetY:this.containerSize.offsetY,cursorHSide:t.deltaX>0?"right":"left",cursorVSide:t.deltaY>0?"bottom":"top"};if(e.top=e.top/this.containerSize.scaleRatio.h,e.left/=this.containerSize.scaleRatio.w,e.width/=this.containerSize.scaleRatio.w,e.height/=this.containerSize.scaleRatio.h,this.isWide&&!this.isCrossWide){if("right"===e.cursorHSide&&"left"===this.pageSide&&e.left+e.width>this.containerSize.width/this.containerSize.scaleRatio.w)return;if("left"===e.cursorHSide&&"right"===this.pageSide&&e.left0&&(t.$root.$emit("selectText",{action:"select",pageId:t.pageId,text:t.$store.state.text.selectedText}),t.$root.$emit("selectText:showPanel"),t.$el.addEventListener("mousemove",t.checkMousePosition))}),100)},zoomMove:function(t){"drag"===t.direction&&(this.isDragging=t.active)},checkMousePosition:function(t){this.$parent.$parent.isPointInSelection(t)?this.$root.$emit("selectText:showPanel"):this.$root.$emit("selectText:hidePanel",{forceHide:!1})}},watch:{isActive:function(t){this.$store.dispatch("text/setInProgressSelection",t)},pageSize:function(){var t=this;this.$root.$emit("selectText:hidePanel"),this.$nextTick((function(){t.getPageRect()}))},sidebar:function(){var t=this;this.$root.$emit("selectText:hidePanel"),this.$nextTick((function(){t.getPageRect()}))},wsContainerSize:function(){var t=this;this.$root.$emit("selectText:hidePanel"),this.$nextTick((function(){t.getPageRect()}))},scrollPosition:function(){var t=this;this.$nextTick((function(){t.getPageRect()}))},isLoaded:function(t){this.getPageRect()},animationInProgress:function(){this.$store.dispatch("text/reset"),this.$root.$emit("selectText:hidePanel")},pageResize:function(){var t=this;this.$nextTick((function(){t.getPageRect()}))},selectAll:function(t){t&&this.selectAllPageContent()},preliminarySelection:function(t){this.validContainerSize&&t&&this.finalizePreliminarySelection()},containerSize:function(){this.validContainerSize&&(this.preliminarySelection?this.finalizePreliminarySelection():this.drawSelectionDebounced())}},computed:{inspectorMode:function(){return this.$store.state.workspace.inspectorMode},selectAll:function(){return this.$store.state.text.selectAll&&this.pageId===this.$store.state.text.pageID&&this.pageSide===this.$store.state.text.pageSide},preliminarySelection:function(){return this.$store.state.text.preliminarySelection&&this.pageId===this.$store.state.text.pageID&&this.pageSide===this.$store.state.text.pageSide},validContainerSize:function(){var t,e;return(null===(t=this.containerSize)||void 0===t?void 0:t.width)>0&&(null===(e=this.containerSize)||void 0===e?void 0:e.height)>0},textBlockSizes:function(){var t=this;return this.finalTree.map((function(e){return{width:Math.ceil(e.width*t.containerSize.scaleRatio.w),height:Math.ceil(e.height*t.containerSize.scaleRatio.h),left:Math.floor(e.left*t.containerSize.scaleRatio.w),top:Math.floor(e.top*t.containerSize.scaleRatio.h)}}))},pageSize:function(){return this.$store.state.pages.size},sidebar:function(){return this.$store.state.sidebar.opened},wsContainerSize:function(){return this.$store.state.workspace.containerSize},scrollPosition:function(){return this.$store.getters["text/holderScroll"]},isZoomed:function(){return this.$store.state.pages.size.zoomFactor>1},animationInProgress:function(){return this.$store.getters["workspace/animationInProgress"]},pageResize:function(){return this.$store.getters["pages/pageProp"](this.pageId,"pageResize")}}},U=i(1900),G=(0,U.Z)(j,g,f,!1,null,"22b6e05d",null).exports,X=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-touch",{staticClass:"selecttext",style:t.contStyle,on:{tap:t.reset}},[this.showCanvas?i("canvas",{class:t.canvasClass,style:{position:"absolute",right:"right"===t.pageSide&&t.isWide?0:"none"},attrs:{width:t.containerSize.width,height:t.containerSize.height}}):t._e()])},Y=[],q={name:"select-text-mobile",mixins:[Z],mounted:function(){var t=this;this.$nextTick((function(){t.getPageRect()})),this.$parent.$parent.$on("highlight",this.highlight)},beforeDestroy:function(){this.resetContext(),this.$parent.$parent.$off("highlight",this.highlight)},methods:{highlight:function(){var t=this;this.effectOn&&(this.showEffect=!0,setTimeout((function(){t.showEffect=!1,t.$store.dispatch("text/setEffect",!1)}),3e3))},reset:function(){this.$store.dispatch("text/reset")}},watch:{containerSize:function(){this.getAndParseXML()},animationInProgress:function(){this.$store.dispatch("text/reset")}},computed:{animationInProgress:function(){return this.$store.getters["workspace/animationInProgress"]}}},K=(0,U.Z)(q,X,Y,!1,null,"6d6ab027",null).exports,Q=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-touch",{staticClass:"publication-note",style:t.noteStyle,attrs:{"data-note-id":t.data.id},on:{tap:t.onNoteClick}},[i("div",{ref:"icon",class:t.iconClass},[i("svgicon",{attrs:{focusable:"false",name:"note-content"}})],1)])},J=[],tt=(i(2150),i(2567)),et={name:"Note",props:{data:{type:Object,default:function(){return{}}},pageSize:{type:Object,default:function(){return{}}},pageSide:{type:String,default:""},isWide:Boolean,isOutsideHardcover:Boolean},data:function(){return{state:"mini",offsetX:0,offsetY:0,deltaX:0,deltaY:0,minDeltaX:0,minDeltaY:0,maxDeltaX:0,maxDeltaY:0,onMove:!1,position:"absolute",leftOffset:16,rightOffset:16,topOffset:28,bottomOffset:4,ieOffsetX:0,ieOffsetY:0}},computed:{isIE:function(){return!!this.$store.state.workspace.userAgentInfo.browser.msie},isOpened:function(){return this.$store.state.notes.opened===this.data.id},isFirstPage:function(){return this.$store.getters["pages/isFirstPage"](this.data.page)},isLastPage:function(){return this.$store.getters["pages/isLastPage"](this.data.page)},scale:function(){return{w:this.pageSize.width/this.$store.state.book.bookSize.width/("both"===this.pageSide?2:1),h:this.pageSize.height/this.$store.state.book.bookSize.height}},noteStyle:function(){var t=0,e=0,i=0;if(this.isWide&&"right"===this.pageSide&&(t=-this.pageSize.width),this.onMove){if("right"===this.pageSide){var s=this.slideMode&&(this.isFirstPage&&!this.rtl||this.isLastPage&&this.rtl);this.isOutsideHardcover||s||(e=this.pageSize.width)}if("left"===this.pageSide)this.slideMode&&(this.isLastPage&&!this.rtl||this.isFirstPage&&this.rtl)||(i=this.pageSize.width);this.slideMode&&(this.pagerSlideMode&&"both"!==this.pageSide||this.pagerSingleMode)&&(e=0,i=this.pageSize.width),this.pagerSingleMode&&(this.isIE?this.isFirstPage||"right"!==this.pageSide||this.isLastPage&&this.$store.getters["pages/pagesCount"]%2==0||(t-=this.pageSize.width):this.rtl&&"right"===this.pageSide?t-=this.pageSize.width:this.rtl||"left"!==this.pageSide||(t+=this.pageSize.width))}var o=this.data.pX*this.scale.w+this.deltaX+e+t;o=Math.max(this.leftOffset,Math.min(this.pageSize.width+e+i-this.rightOffset,o));var r=this.data.pY*this.scale.h+this.deltaY;return r=Math.max(this.topOffset,Math.min(this.pageSize.height-this.bottomOffset,r)),{"z-index":this.data.id+1e4,position:this.position,top:r+this.ieOffsetY+"px",left:o+this.ieOffsetX+"px"}},iconClass:function(){var t=["note-icon",this.data.color,this.state];return this.isOpened&&t.push("opened"),t},rtl:function(){return this.$store.state.book.rightToLeft},slideMode:function(){return"slide-book"===this.$store.state.workspace.bookComponent},pagerSlideMode:function(){return this.$store.state.pager.slideMode},pagerSingleMode:function(){return this.$store.state.pager.singleMode},currentBookHolder:function(){return this.slideMode?document.querySelector(".slide-wrapper.current .spread-wrapper"):document.getElementById("book-holder")},isFrozenOrNotReady:function(){return this.$store.state.workspace.freezed||"ready"!==this.$store.state.workspace.status||this.$store.state.workspace.isResizing||this.$store.state.pager.freezed}},mounted:function(){this.$refs.icon.addEventListener("mousedown",this.iconMouseDown,!0),this.parentEl=this.$el.parentElement},beforeDestroy:function(){this.$refs.icon.removeEventListener("mousedown",this.iconMouseDown,!0)},methods:{onNoteClick:function(t){var e=this;this.isFrozenOrNotReady||(0,l.iZ)(t.target).some((function(t){return t===e.$refs.icon}))&&(this.isOpened?this.$store.dispatch("notes/setOpenedId",{id:null}):this.$store.dispatch("notes/setOpenedId",{id:this.data.id}))},iconMouseDown:function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this.offsetX=t.pageX,this.offsetY=t.pageY,this.isOpened||this.$store.dispatch("notes/setOpenedId",{id:null}),this.$store.dispatch("notes/setMoving",!0),document.addEventListener("mousemove",this.iconMouseMove),document.addEventListener("mouseup",this.iconMouseUp))},iconMouseMove:function(t){if(t.stopPropagation(),!this.onMove){if(this.moveElementToSpreadNotes(),this.slideMode&&!this.pagerSingleMode)this.minDeltaX=this.leftOffset-this.data.pX*this.scale.w,this.maxDeltaX=this.pageSize.width-this.data.pX*this.scale.w-this.rightOffset;else if("left"===this.pageSide){this.minDeltaX=this.leftOffset-this.data.pX*this.scale.w;var e=!this.isWide&&(this.isLastPage&&!this.rtl||this.isFirstPage&&this.rtl)?1:2;this.maxDeltaX=this.pageSize.width*e-this.data.pX*this.scale.w-this.rightOffset}else{var i=!this.isWide&&(this.isFirstPage&&!this.rtl||this.isLastPage&&this.rtl)?0:this.pageSize.width;this.minDeltaX=(this.isWide?this.pageSize.width:0)+this.leftOffset-i-this.data.pX*this.scale.w,this.maxDeltaX=this.pageSize.width*(this.isWide?2:1)-this.data.pX*this.scale.w-this.rightOffset}if(!this.pagerSingleMode||this.isFirstPage||this.isLastPage&&this.$store.getters["pages/pagesCount"]%2==0||("left"===this.pageSide?this.maxDeltaX-=this.pageSize.width:"right"===this.pageSide&&(this.minDeltaX+=this.pageSize.width)),this.minDeltaY=this.topOffset-this.data.pY*this.scale.h,this.maxDeltaY=(this.pageSize.height/this.scale.h-this.data.pY)*this.scale.h-this.bottomOffset,!this.isOutsideHardcover){if(this.isIE){var s=this.currentBookHolder.getBoundingClientRect(),o=this.getIEDeltaOffset();this.ieOffsetX=s.left-o,this.ieOffsetY=s.top}this.position="fixed"}this.onMove=!0,this.state="move"}this.deltaX=Math.max(this.minDeltaX,Math.min(t.pageX-this.offsetX,this.maxDeltaX)),this.deltaY=Math.max(this.minDeltaY,Math.min(t.pageY-this.offsetY,this.maxDeltaY))},getIEDeltaOffset:function(){if(this.slideMode&&this.pagerSlideMode)return 0;var t=this.$store.getters["pager/state"];return!this.isWide&&this.isLastPage&&this.rtl&&t.rightPage!==this.data.page||!this.isWide&&this.isFirstPage&&!this.rtl?this.pageSize.width:0},iconMouseUp:function(){if(document.removeEventListener("mousemove",this.iconMouseMove),document.removeEventListener("mouseup",this.iconMouseUp),this.$store.dispatch("notes/setMoving",!1),this.moveElementToPageContainer(),this.onMove){this.isIE&&(this.ieOffsetX=0,this.ieOffsetY=0),this.onMove=!1,this.position="absolute";var t=this.data.page,e=this.deltaX/this.scale.w+this.data.pX;this.isWide||("left"===this.pageSide?e>this.pageSize.width/this.scale.w&&(e-=this.pageSize.width/this.scale.w,this.rtl?t--:t++):e<0&&(e+=this.pageSize.width/this.scale.w,this.rtl?t++:t--),ethis.pageSize.width/this.scale.w-this.rightOffset/this.scale.w&&(e=this.pageSize.width/this.scale.w-this.rightOffset/this.scale.w)),this.$store.dispatch("notes/moveNote",{id:this.data.id,page:t.toString(),pX:Math.round(100*e)/100,pY:Math.round(100*(this.deltaY/this.scale.h+this.data.pY))/100}),this.state="mini",this.deltaX=0,this.deltaY=0}},moveElementToSpreadNotes:function(){this.slideMode||this.isOutsideHardcover||(this.spreadNotesEl||(this.spreadNotesEl=this.createSpreadNotesElement()),this.spreadNotesEl.appendChild(this.$el))},moveElementToPageContainer:function(){this.slideMode||this.isOutsideHardcover||this.parentEl.appendChild(this.$el)},createSpreadNotesElement:function(){var t=document.getElementById("spread-notes");if(!t){var e=document.getElementById("book");t=tt.Z.createElement("div",{id:"spread-notes"},e)}return t}}},it=(0,U.Z)(et,Q,J,!1,null,"4f0d47b2",null).exports,st=i(924),ot=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{class:t.classes},[i("div",{staticClass:"flip-me-backface",style:t.backfaceStyle},[t.isTranslucentReverseSide?t._l(t.backfaceBackgrounds,(function(e,s){return i("img",{key:s,staticClass:"flip-me-image",style:t.backfaceImgStyle,attrs:{crossOrigin:t.crossOrigin,src:e}})})):t._e(),t._v(" "),i("div",{staticClass:"flip-me-gradient2",style:t.backGradientStyle})],2),t._v(" "),i("div",{staticClass:"flip-me-mask",style:t.maskStyle},[i("div",{staticClass:"flip-me-gradient",style:t.nextGradientStyle}),t._v(" "),i("div",{staticClass:"flip-me-shift-page",style:t.shiftPageStyle},[i("div",{staticClass:"flip-me-next-page",style:t.nextPageStyle},t._l(t.nextBackgrounds,(function(e,s){return i("img",{key:s,staticClass:"flip-me-image",style:t.nextImgStyle,attrs:{crossOrigin:t.crossOrigin,src:e}})})),0)])])])},rt=[],nt=i(2029),at=i.n(nt),ht=(H=window.getComputedStyle(document.documentElement,""),N=(Array.prototype.slice.call(H).join("").match(/-(moz|webkit|ms)-/)||""===H.OLink&&["","o"])[1],{dom:"WebKit|Moz|MS|O".match(new RegExp("("+N+")","i"))[1],lowercase:N,css:"-"+N+"-",js:N[0].toUpperCase()+N.substr(1)}),lt={name:"FlipMe",props:{pageId:{type:String,required:!0},isLeft:{type:Boolean,required:!0}},data:function(){return{angle:0,width:0,backfaceParams:null,nextPageParams:null,tween:null,crossOrigin:(0,d.Z)().getCrossOrigin()}},created:function(){var t=this.$store.getters["pager/flipState"],e=this.isLeft?t.currentLeft:t.currentRight,i=e+(this.isLeft?-1:1),s=e+(this.isLeft?-2:2);this.backfaceParams=this.$store.getters["pager/flipParams"](i),this.nextPageParams=this.$store.getters["pager/flipParams"](s)},mounted:function(){var t=this,e={angle:19,width:0};this.tween=new(at().Tween)(e).to({angle:19,width:7},800).easing(at().Easing.Cubic.InOut).onUpdate((function(){if(t.width=e.width,t.angle=e.angle,0===e.width){var i=5*Math.random()+3,s=11*Math.random()+19;setTimeout((function(){t.tween.to({angle:s,width:i})}),10)}})).yoyo(!0).repeat(1/0).delay(2e3).repeatDelay(200).start(),this.$parent.$once("onContentContainerClick",this.stopAnimation)},beforeDestroy:function(){this.stopAnimation()},computed:{classes:function(){return{"flip-me-container":!0,left:this.isLeft,"translucent-reverse-side":this.singleMode&&this.isTranslucentReverseSide}},singleMode:function(){return this.$store.state.pager.singleMode},isRTLBook:function(){return this.$store.state.book.rightToLeft},isTranslucentReverseSide:function(){return this.$store.state.workspace.components.book.isTranslucentReverseSide},nextBackgrounds:function(){return this.getBackgroundsArray(this.nextPageParams.pageId)},backfaceBackgrounds:function(){return this.getBackgroundsArray(this.backfaceParams.pageId)},pagesSize:function(){return this.$store.getters["pages/size"]},backfaceImgStyle:function(){return this.getImageStyle(this.backfaceParams)},nextImgStyle:function(){return this.getImageStyle(this.nextPageParams)},maskStyle:function(){var t=100-this.width;return{transform:this.isLeft?"rotate3d(0,0,1,-".concat(this.angle,"deg) translate3d(-").concat(t,"%, 0%, 0)"):"rotate3d(0,0,1,".concat(this.angle,"deg) translate3d(").concat(t,"%, 50%, 0)"),transformOrigin:this.isLeft?"".concat(100-t,"% 100%"):"100% 100%"}},nextPageStyle:function(){var t=100-this.width;return{transform:this.isLeft?"rotate3d(0,0,1,".concat(this.angle,"deg)"):"rotate3d(0,0,1,-".concat(this.angle,"deg)"),transformOrigin:this.isLeft?"".concat(100-t,"% 100%"):"100% 100%",backgroundColor:this.$store.getters["pages/pageProp"](this.nextPageParams.pageId,"backgroundColor")}},shiftPageStyle:function(){var t=100-this.width;return{transform:this.isLeft?"translate3d(".concat(t,"%, 0%,0)"):"translate3d(-".concat(t,"%, -50%,0)")}},backfaceStyle:function(){var t,e,i=90-this.angle,s=this.width/Math.sin(i*Math.PI/180);if(this.isLeft){var o=s,r=100-2*s;t="rotate(-".concat(2*this.angle,"deg) translate3d(-").concat(r,"%, 0%,0)"),e="".concat(o,"% 100%")}else{var n=100-s,a=n-s;t="rotate(".concat(2*this.angle,"deg) translate3d(").concat(a,"%, 0%,0)"),e="".concat(n,"% 100%")}return{transform:t,transformOrigin:e,backgroundColor:this.$store.getters["pages/pageProp"](this.backfaceParams.pageId,"backgroundColor")}},nextGradientStyle:function(){return{background:ht.css+"linear-gradient(".concat(this.isLeft?"right":"left",", rgba(0, 0, 0, ").concat((65-this.width)/100,") 0px, transparent ").concat(this.width,"%)")}},backGradientStyle:function(){var t=90-this.angle,e=this.width/Math.sin(t*Math.PI/180);return{transform:this.isLeft?"rotate(".concat(this.angle,"deg) translate3d(0, 10%, 1px)"):"rotate(-".concat(this.angle,"deg) translate3d(0, 10%, 1px)"),transformOrigin:"100% 100%",width:e+"%"}}},methods:{stopAnimation:function(){this.tween.delay(0).repeat(1)},getBackgroundsArray:function(t){var e=[];if(t){var i=this.$store.getters["pages/pageProp"](t,"textUrl"),s=this.$store.getters["pages/pageProp"](t,"substrateUrl");e.push(s),i&&e.push(i)}return e},getImageStyle:function(t){var e=t.wide,i="right"===t.pageSide,s=this.$store.state.pages.size.width,o=document.querySelector('.background[data-id="'+t.pageId+'"]');return(o&&o.style?o.style.cssText:"")+(e&&i?" transform: translate3d(-".concat(s,"px,0,0);"):"")}}},ct=(0,U.Z)(lt,ot,rt,!1,null,"75383dbe",null).exports,dt=i(9426);function ut(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=pt(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var s=0,o=function(){};return{s:o,n:function(){return s>=t.length?{done:!0}:{done:!1,value:t[s++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,n=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return n=t.done,t},e:function(t){a=!0,r=t},f:function(){try{n||null==i.return||i.return()}finally{if(a)throw r}}}}function pt(t,e){if(t){if("string"==typeof t)return gt(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?gt(t,e):void 0}}function gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,s=new Array(e);i0&&this.$emit("content:changed"),this.refreshCache()},isResizing:function(t){this.$emit("resize:"+(t?"start":"end")),this.refreshCache(),t?this.stopHighlight():this.checkHighlight()},contentFreezed:function(t){this.refreshCache(),t?this.cancelResize("freezed",!0):(this.resizeCancelled=!1,this.updateCanvasDebounced(!1))},preloaderVisible:function(t,e){this.refreshCache(),this.isCurrent&&!t&&e&&this.$root.$emit("pageLoaded")},backgrounds:function(){this.refreshCache()},backgroundsCache:function(){this.updateCanvasDebounced(!0)},isHighlighted:function(t){t?this.stopIconAttract():this.startIconAttract()}},created:function(){var t=this;this.updateCanvasDebounced=(0,l.Ds)((function(e){e&&(t.canvasUpdated=!1),t.updateCanvas()}),1e3),this.isLoading=this.rawIsLoading},mounted:function(){this.refreshCache(),this.$root.$on("zoomMove",this.zoomMove),this.getContent(),window.addEventListener("resize",this.onResize)},beforeUpdate:function(){this.contentItemsReady>this.content.length&&(this.contentItemsReady=this.content.length)},beforeDestroy:function(){window.removeEventListener("resize",this.onResize),this.cancelResize("destroyed",!0),this.updateCanvasDebounced.destroy(),this.$root.$off("zoomMove",this.zoomMove),this.stopHighlight(),clearInterval(this.iconAttractInterval),this.$refs.bgImage.onload=null,this.$refs.bgImage.onerror=null,this.$refs.bgImage.src="",this.$refs.bgSVG&&(this.$refs.bgSVG.src="")},methods:{bgCacheImageLoaded:function(t){this.isZoomed&&t===this.substrateUrl&&this.setCursor("inherit")},getContent:function(){this.pageContent=this.$store.getters["pages/pageContent"](this.pageId)},getProperties:function(){this.isSVGSupported=this.$store.getters["pages/isSVGSupported"](this.pageId),this.thumbnailUrl=this.$store.getters["pages/pageProp"](this.pageId,"thumbnailUrl"),this.textUrl=this.$store.getters["pages/pageProp"](this.pageId,"textUrl"),this.substrateUrl=this.$store.getters["pages/pageProp"](this.pageId,"substrateUrl"),this.isReady=this.$store.getters["pages/pageProp"](this.pageId,"status")===st.Z.READY,this.loadPending=this.$store.getters["pages/pageProp"](this.pageId,"loadPending"),this.hasError=this.$store.getters["pages/hasError"](this.pageId)},getAPIProperties:function(){this.isWide=this.$store.getters["pages/pageProp"](this.pageId,"wide"),this.isStub=this.$store.getters["pages/pageProp"](this.pageId,"stub");var t=this.$store.getters["pages/isLastPage"](this.pageId)&&this.$store.getters["pages/pageIndexById"](this.pageId)%2!=0&&!this.isWide&&!this.$store.state.pager.singleMode;this.isOutsideHardcover="flip-book"===this.bookComponent&&this.$store.getters["book/hasHardcover"]&&(this.$store.getters["pages/isFirstPage"](this.pageId)||t),this.backgroundColor=this.isOutsideHardcover?this.$store.state.book.hardcoverColor:this.enforceTransparentBg?null:this.$store.getters["pages/pageProp"](this.pageId,"backgroundColor")},refreshCache:function(){var t=this;this.contentFreezed||this.$nextTick((function(){t.preloaderVisibleCache=t.preloaderVisible,t.backgroundsCache=t.backgrounds,t.vectorLayerCache=t.vectorLayer,t.isLoadingCache=t.isLoading,t.updatePendingCache=t.updatePending}))},isVisible:function(t){return!this.isWide||"both"===this.pageSide||t.side===this.pageSide||t.crossWide},checkPageStripes:function(t){if(!this.isCurrent||this.isZoomed||"flip-book"!==this.bookComponent||t.srcEvent.metaKey||t.srcEvent.ctrlKey)return!1;var e=this.$el.getBoundingClientRect(),i=this.$store.getters["pager/state"].singleMode,s=i?this.isRTLBook:"left"===this.pageSide,o=i?!this.isRTLBook:"right"===this.pageSide;return s&&!this.hideLeftStripe&&t.center.x-e.left<.05*e.width?(this.leftStripeTap(),!0):!!(o&&!this.hideRightStripe&&t.center.x-e.left>.95*e.width)&&(this.rightStripeTap(),!0)},onMouseDown:function(){document.activeElement.blur()},onContentTap:function(t){var e=this;if(!this.isWorkspaceFrozen){null!==this.$store.state.text.selectionRect&&this.$store.dispatch("text/reset");var i=t.target.classList;if(i)if(i.contains("link"))this.isMobile&&this.$root.$emit("link-highlight",{itemId:t.target.dataset.itemId}),Date.now()>this.tapTimeout&&(setTimeout((function(){e.linkTo(t.target)}),this.$store.state.workspace.doubletapInterval+1),this.tapTimeout=Date.now()+this.$store.state.workspace.doubletapInterval);else if("desktop"===this.layout){var s=(0,l.UZ)(t.target);if(!i.contains("block")&&!i.contains("text-block")&&-1===s.indexOf("content")&&this.checkPageStripes(t))return;(i.contains("content")||i.contains("block")||i.contains("text-block")||i.contains("selecttext")||i.contains("select-text-canvas"))&&setTimeout((function(){if(!(e.$store.state.workspace.highlightTimeout+350>Date.now())){e.clearHighlightTimeouts(),e.isHighlighted=!(e.isHighlighted||e.initialLinkHighlight||e.initialPopupIconHighlight),e.initialIconsHide=!1,e.initialPopupIconHighlight=!1,e.initialLinkHighlight=!1;var t=e.getSpreadTwin();null!==t&&(t.clearHighlightTimeouts(),t.isHighlighted=e.isHighlighted,t.initialIconsHide=!1,t.initialPopupIconHighlight=!1,t.initialLinkHighlight=!1);var i=e.$store.getters["pages/urlHeaderById"]({id:e.pageId,forceFullWide:"both"===e.pageSide,widePageSecondHalf:"right"===e.pageSide});e.$root.$emit("highlight",{action:e.isHighlighted?"on":"off",page:i})}}),350)}}},linkTo:function(t){if("ready"===this.bookStatus){var e=t.getAttribute("data-id"),i=t.getAttribute("data-url");if(e&&!i)this.$store.dispatch("pager/goToPageById",{id:e,target:"link"}),this.$emit("link:click",t),this.$root.$emit("link",{type:"internal",source:"page",pageId:this.pageId,pageToId:e});else if(i){var s=!1===this.checkUrl(i);if(this.$root.$emit("link",{type:"external",pageId:this.pageId,url:i,target:t.target,source:null,isBlacklisted:s}),s)return;t.setAttribute("href",i),t.click(),t.removeAttribute("href"),this.$emit("link:click",t)}}},checkUrl:function(t){for(var e=0;e0?this.$once("loaded",(function(){this.checkHighlight()})):this.isPreloaderShown?this.$once("preloader:off",(function(){this.checkHighlight()})):0===this.content.length&&this.$once("content:changed",(function(){this.checkHighlight()})):(this.autoHighlight&&this.highlightContent(),this.$emit("highlight"))}},startIconAttract:function(){var t=this;if(this.isPrimarySpreadPage){var e=this.getSpreadTwin();this.iconAttractInterval=setInterval((function(){t.iconAttract=!0,e&&(e.iconAttract=!0),setTimeout((function(){t.iconAttract=!1,e&&(e.iconAttract=!1)}),1800)}),8e3)}},stopIconAttract:function(){var t=this.getSpreadTwin();clearInterval(this.iconAttractInterval),this.iconAttract=!1,t&&(t.iconAttract=!1)},clearHighlightTimeouts:function(){clearTimeout(this.highlightTimeout),clearTimeout(this.highlightOffTimeout),clearTimeout(this.linkHighlightOffTimeout)},stopHighlight:function(){this.clearHighlightTimeouts(),this.isHighlighted=!1,this.initialPopupIconHighlight=!1,this.initialLinkHighlight=!1},highlightContent:function(){var t=this;if(this.isPrimarySpreadPage){var e=this.getSpreadTwin();this.highlightTimeout=setTimeout((function(){t.initialIconsHide=!1,t.initialPopupIconHighlight=!0,t.initialLinkHighlight=!0,e&&(e.initialIconsHide=!1,e.initialPopupIconHighlight=!0,e.initialLinkHighlight=!0),t.highlightOffTimeout=setTimeout((function(){t.initialPopupIconHighlight=!1,e&&(e.initialPopupIconHighlight=!1),t.startIconAttract()}),2e3),t.linkHighlightOffTimeout=setTimeout((function(){t.initialLinkHighlight=!1,e&&(e.initialLinkHighlight=!1)}),1700)}),100)}},contentItemReady:function(t){"link"!==t.data.type&&this.contentItemsReady++},contentError:function(){this.$store.dispatch("pages/setStatus",{value:st.Z.ERROR,pageID:this.pageId})},updateCanvas:function(){var t=this,e=this.isZoomed&&this.substrateNum>1;if(!("desktop"!==this.layout||!this.isCurrent||e||this.canvasUpdated||this.contentFreezed||this.devicePixelRatio>1.5)&&(!this.isWide||"right"!==this.pageSide||this.$store.state.pager.singleMode)&&this.backgroundsCache&&this.backgroundsCache[0]){this.cancelResize("new resize",!1),this.resizeCancelled=!1;var i=new Image;this.crossOrigin&&(i.crossOrigin=this.crossOrigin),i.onload=function(){var e=document.createElement("canvas"),s=e.getContext("2d");if(e.style.transform="translateZ(0)",i.onload=null,!t.resizeCancelled)if(t.backgroundsCache.length>1){var o=new Image;t.crossOrigin&&(o.crossOrigin=t.crossOrigin),o.onload=function(){o.onload=null,t.resizeCancelled||(e.width=o.width,e.height=o.height,s.drawImage(i,0,0,o.width,o.height),s.drawImage(o,0,0,o.width,o.height),o.src="",o=null,i=null,t.resizeCanvas(e,t.$refs.bgImage),s=null,e=null)},o.src=t.backgroundsCache[1]}else e.width=i.width,e.height=i.height,s.drawImage(i,0,0,i.width,i.height),i=null,t.resizeCanvas(e,t.$refs.bgImage),s=null,e=null},i.src=this.backgroundsCache[0]}},skipResize:function(){var t=this.$store.state.workspace.userAgentInfo.browser;return t.firefox||t.ie||t.msie||t.msedge},onResize:function(){this.isCurrent&&this.updateCanvasDebounced(!0)},resizeCanvas:function(t,e){var i=this;if(!this.skipResize()&&!this.resizeCancelled){this.cancelResize("new resize",!1);var s=new Date,o=s.getHours()+":"+s.getMinutes()+":"+s.getSeconds()+"."+s.getMilliseconds(),r=this.pageId+"_"+o,n=document.createElement("canvas");this.cancelResize=function(t,e){try{e&&(i.resizeCancelled=!0),r&&i.bookElement.cancelResize&&i.bookElement.cancelResize(r),n=null}catch(s){i.$emit("error",s)}},n.style.transform="translateZ(0)",n.width=this.contentSize.width*(this.wideHalf?2:1)*this.devicePixelRatio,n.height=this.contentSize.height*this.devicePixelRatio,n.getContext("2d").drawImage(t,0,0,n.width,n.height);var a={unsharpAmount:80,unsharpRadius:.6,unsharpThreshold:166,quality:3,alpha:!0};if(!this.resizeCancelled&&this.bookElement.resizePage){var h=this;this.bookElement.resizePage(t,n,a,r,(function(i){if(i){var s=i.toDataURL();if(h.setResizedImg(e,h,s),h.isWide){var o=h.getSpreadTwin();null!==o&&h.setResizedImg(o.$refs.bgImage,o,s)}}r=null,t=null,n=null}))}}},setResizedImg:function(t,e,i){if(t){t.onload=function(){t.onload=null,setTimeout((function(){e.resizeCancelled||(e.canvasUpdated=!0)}),500)};var s=window.MSInputMethodContext&&document.documentMode?1e4:6500;i.length>s&&(t.src=i)}},leftStripeTap:function(){this.movePagerLeft({target:"page-edge-tap"})},rightStripeTap:function(){this.movePagerRight({target:"page-edge-tap"})},arrowHover:function(t,e){"function"==typeof this.bookElement.arrowHover&&this.bookElement.arrowHover(t,e)},zoomMove:function(t){"drag"===t.direction&&(this.contentActive=!!t.active)},isPointInSelection:function(t){var e=this.$el.querySelector(".select-text-canvas");if(!e)return!1;var i=e.getBoundingClientRect(),s=t.clientX-i.left,o=t.clientY-i.top,r=e.getContext("2d").getImageData(s,o,1,1).data;return r[0]+r[1]+r[2]+r[3]!==0},forceBackgroundColor:function(t){this.backgroundColor=t}},computed:{pageStyle:function(){var t="rgba(39, 47, 55, 0.03)",e=this.contentCrop?this.contentSize.height:this.pageSize.height;return{width:(this.contentCrop?this.contentSize.width:this.pageSize.width)+"px",height:(e%2==0?e:e+1)+"px","background-color":this.bordered?t:this.backgroundColor}},zoomInBlur:function(){return!1},showPreloaderContainer:function(){return!this.isStub&&(this.thDebounced||this.preloaderVisibleCache)},showSpinner:function(){return(this.thDebounced||this.isLoadingCache||this.updatePendingCache)&&!this.contentFreezed&&this.isReady&&this.isDownloaded&&!this.hasError},showHighlights:function(){return this.isCurrent&&!this.contentFreezed&&(this.isMobile||this.isSearchOpened)&&!this.showPreloaderContainer},animationInProgress:function(){return this.$store.getters["workspace/animationInProgress"]},isLeftFlipCorner:function(){return"left"===this.$store.getters["workspace/callToNavigation"].side},isLightboxShown:function(){return this.$store.getters["lightbox/isShown"]},flipCornerEnabled:function(){if("flip-book"!==this.bookComponent||!this.isCurrent||this.isLightboxShown)return!1;var t=this.$store.getters["workspace/callToNavigation"];return"corner"===t.type&&(this.$store.state.pager.singleMode||t.side===this.pageSide)&&!this.contentFreezed},bookStatus:function(){return this.bookElement.status||"ready"},isIE:function(){return!0===this.$store.state.workspace.userAgentInfo.browser.msie},bookComponent:function(){return this.$store.state.workspace.bookComponent},bookElement:function(){return"slide-book"===this.bookComponent?this.$parent.$parent:this.$parent},rawIsLoading:function(){return 0===this.$store.state.pages.size.width||null===this.$store.state.pages.size.width||!(this.isStub||!this.isReady||!this.isDownloaded||this.hasError)&&(this.contentItemsReady.5,dark:this.backgroundLuma<=.5,only:this.isOnlyPage,"left-stripe":"flip-book"===this.bookComponent&&"left"===this.pageSide&&!this.hideLeftStripe,"right-stripe":"flip-book"===this.bookComponent&&"right"===this.pageSide&&!this.hideRightStripe,"last-single-page":this.isLastSinglePage,"content-inactive":!this.contentActive}},isOnlyPage:function(){return 1===this.$store.getters["pages/pagesCount"]},isLastSinglePage:function(){return!(!this.$store.state.pager.singleMode||!this.$store.getters["pages/isLastPage"](this.pageId))&&(!this.isWide||!(this.isRTLBook&&"left"!==this.pageSide||!this.isRTLBook&&"right"!==this.pageSide))},preloaderVisible:function(){return!this.isStub&&(this.isLoading||!this.isReady||!this.isDownloaded||this.hasError)},vectorLayer:function(){return this.pageId&&this.isReady&&this.isDownloaded&&!this.hasError&&this.isSVGSupported?this.textUrl:null},backgrounds:function(){if(!this.pageId||!this.isReady||!this.isDownloaded||this.hasError)return[];var t=this.enforceTransparentBg?this.whitePixelUrl:this.stubUrl,e=this.substrateUrl,i=this.textUrl,s=this.isSVGSupported,o=[];if(this.isStub)o.push(t);else{var r=i;e&&o.push(e),r&&!s&&o.push(r)}return o},selectTextEnabled:function(){return!this.isIE&&this.$store.state.workspace.components.textSelection},mobileShowEffectPass:function(){return this.isMobile&&this.$store.state.text.pageID&&this.pageId===this.$store.state.text.pageID},contentPagesArray:function(){return this.$store.getters["content/pagesArray"]},content:function(){var t=this;if(!this.pageId||!this.isReady||!this.isDownloaded||this.hasError||!this.renderContent||this.isStub)return[];var e=this.contentSize.scaleRatio;if(e<=0)return[];var i=this.pageContent;if(!i)return[];for(var s=this.pageId,o=this.pageSide,r=this.isWide,n=[],a=[],h=i.filter((function(e){return"block"!==e.type&&"link"!==e.type&&t.isVisible(e)})).length,c="right"===this.pageSide,d=this.isRTLBook===c,u=this.$store.state.pager.singleMode,p=u||d?0:150,g=0;g8&&(e=8),t.filter="blur("+e+"px)",t},wideHalf:function(){return this.isWide&&"both"!==this.pageSide},marginSide:function(){var t=this.contentCrop?0:(this.pageSize.width-this.contentSize.width)/(this.wideHalf?1:2);return t=Math.round(t),t},contentStyle:function(){var t=this.contentCrop?0:(this.pageSize.height-this.contentSize.height)/2,e={width:this.contentSize.width*(this.wideHalf?2:1)+"px",height:this.contentSize.height+"px"};return this.zoomInBlur&&(e.filter="blur(2px)"),"right"===this.pageSide&&(e.right="0",e.marginRight=this.marginSide+"px"),this.marginSide&&"right"!==this.pageSide&&(e.marginLeft=this.marginSide+"px"),t&&(e.marginTop=t.toFixed(0)+"px"),e},substrateNum:function(){var t=this.$store.getters["pages/currentSize"](this.pageId),e=this.$store.getters["pages/contentSize"]({pageID:this.pageId,pageSize:t});return this.$store.getters["pages/imageSizes"](this.pageId,e).substrate},notesArray:function(){for(var t=[],e=this.$store.state.notes.items,i=0,s=e.length;i=i-o;r--)c+=t[h=a+(r<<2)],d+=t[h+1],u+=t[h+2],p+=t[h+3],e[h]=c/(i-r)|0,e[h+1]=d/(i-r)|0,e[h+2]=u/(i-r)|0,e[h+3]=p/(i-r)|0;for(;r>=0;r--)l=(h=a+(r<<2))+g,e[h]=c/o|0,e[h+1]=d/o|0,e[h+2]=u/o|0,e[h+3]=p/o|0,c+=t[h]-t[l],d+=t[h+1]-t[l+1],u+=t[h+2]-t[l+2],p+=t[h+3]-t[l+3]}}function Lt(t,e,i,s,o){var r,n,a,h,l,c,d,u,p,g=i<<2,f=g*o;for(r=0;r=s-o;n--)c+=t[h=a+n*g],d+=t[h+1],u+=t[h+2],p+=t[h+3],e[h]=c/(s-n)|0,e[h+1]=d/(s-n)|0,e[h+2]=u/(s-n)|0,e[h+3]=p/(s-n)|0;for(;n>=0;n--)l=(h=a+n*g)+f,e[h]=c/o|0,e[h+1]=d/o|0,e[h+2]=u/o|0,e[h+3]=p/o|0,c+=t[h]-t[l],d+=t[h+1]-t[l+1],u+=t[h+2]-t[l+2],p+=t[h+3]-t[l+3]}}function Et(t,e,i,s,o,r,n){var a=t.canvas,h=0|s,l=0|o,c=0|e,d=0|i;r=32*(0|r),r=Math.min(Math.max(r,32),256);var u=Math.max(0,Math.log(r)/Math.log(2)-3|0),p=r>>>u,g=a.width>>>u,f=a.height>>>u;zt.clearRect(0,0,$t.width,$t.height),zt.drawImage(a,0,0,g,f);var m=zt.getImageData(0,0,g,f);return Tt(m.data,g,f,p,n),zt.putImageData(m,0,0),t.clearRect(0,0,h,l),t.drawImage($t,0,0,g,f,c,d,1.01*h,l),t}var Ot=Et,Ft=0,Dt=3,_t={mixins:[u],mounted:function(){this.resizeTimer=null},data:function(){return{pageResize:null,widthCache:0}},watch:{isZoomed:function(t){t||this.setCursor("inherit")},isCurrent:function(t){var e=this;this.lastIsCurrent!==t&&(this.alreadyLoaded&&this.getProperties(),this.lastIsCurrent=t,t&&(Ft=0,this.shouldRenderCanvas?this.renderCanvas():function t(){Ft!==Dt&&(setTimeout((function(){e.shouldRenderCanvas?e.renderCanvas():e.isCurrent&&t()}),200),!e.$store.state.workspace.animationInProgress&&e.thumbnailUrl&&Ft++)}()))},pageSize:function(){this.rerenderCanvas(!0)},pageResize:function(){this.rerenderCanvas()},backgroundColor:function(){this.rerenderCanvas()}},methods:{renderCanvas:function(){if(!this.$store.state.pager.zoomMode){var t=this.$refs.canvas;if(t){var e=t.getContext("2d"),i=new Image;i.crossOrigin=(0,d.Z)().getCrossOrigin();var s=this.pageSize.width;this.widthCache=s;var o=this.pageSize.height,r="right"===this.pageSide&&this.isWide?-this.contentSize.width:this.contentSize.offsetX,n=this.contentSize.offsetY,a=this.contentSize.width*(this.isWide?2:1),h=this.contentSize.height,l=20,c=(h+=l)/this.contentSize.height,u=Math.floor(s*c)-s;a+=u,r-=l/2,n-=Math.floor(u/2),t.height=Math.floor(o*c),t.width=Math.floor(s*c);var p=t.width-s;t.style.top="-".concat(l/2,"px"),"right"===this.pageSide&&this.isWide?t.style.right="".concat(-Math.floor(p/2),"px"):t.style.left="".concat(-Math.floor(p/2),"px"),e.fillStyle=this.backgroundColor,e.fillRect(0,0,s,o),i.onload=function(){e.save(),e.translate(s,0),e.scale(-1,1),e.drawImage(i,r,n,a,h),e.restore(),Ot(e,0,0,t.width,t.height,2,1),t=null},i.src=this.thumbnailUrl}}},rerenderCanvas:function(){var t=this;arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.widthCache===this.pageSize.width||this.showCanvas&&this.isCurrent&&(null!==this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout((function(){t.renderCanvas(),t.resizeTimer=null}),350))},getProperties:function(){this.thumbnailUrl=this.isStub&&this.enforceTransparentBg?this.whitePixelUrl:this.$store.getters["pages/pageProp"](this.pageId,"thumbnailUrl"),this.isReady=this.$store.getters["pages/pageProp"](this.pageId,"status")===st.Z.READY,this.loadPending=this.$store.getters["pages/pageProp"](this.pageId,"loadPending"),this.hasError=this.$store.getters["pages/hasError"](this.pageId)},getAPIProperties:function(){this.isWide=this.$store.getters["pages/pageProp"](this.pageId,"wide"),this.isStub=this.$store.getters["pages/pageProp"](this.pageId,"stub"),this.pageResize=this.$store.getters["pages/pageProp"](this.pageId,"pageResize"),this.isHardcoverFirstPage?this.backgroundColor="rgba(255, 255, 255, .15)":this.backgroundColor=null===this.pageId?this.backgroundColor:this.$store.getters["pages/pageProp"](this.pageId,"backgroundColor")}},computed:{showCanvas:function(){return this.showThumbnail&&!this.isHardcoverFirstPage&&!!this.thumbnailUrl},shouldRenderCanvas:function(){return this.showCanvas&&this.$refs.canvas&&!this.$store.state.workspace.animationInProgress},className:function(){return{page:!0,"page-reverse-side":!0,bordered:this.bordered,unready:!this.isReady&&!this.hasError,error:this.hasError,light:this.backgroundLuma>.5,dark:this.backgroundLuma<=.5}},isHardcoverFirstPage:function(){return this.$store.getters["book/hasHardcover"]&&this.$store.getters["pages/isFirstPage"](this.id)},pageSize:function(){var t=this.isOutsideHardcover&&!this.isHardcoverFirstPage?1.03:1,e=this.size||!1,i=this.pagesSize,s=this.pageWidthMultiplier;return e&&e.width&&e.height?{width:Math.round(e.width*t),height:Math.round(e.height*t)}:{width:Math.round(i.width*s*t),height:Math.round(i.height*t)}},pageStyle:function(){return{width:this.pageSize.width+"px",height:this.pageSize.height+"px","background-color":this.backgroundColor}}}},Wt=_t,Bt=(0,U.Z)(Wt,xt,Pt,!1,null,null,null).exports;function At(){return At=Object.assign?Object.assign.bind():function(t){for(var e=1;e3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,r=arguments.length>5?arguments[5]:void 0,n=arguments.length>6?arguments[6]:void 0,a=arguments.length>7?arguments[7]:void 0,h=arguments.length>8?arguments[8]:void 0,l=arguments.length>9&&void 0!==arguments[9]&&arguments[9],c=h?p(h):s&&3===o?t.rightSheet:s&&2===o?t.bottomRightSheet:s||3!==o?s||2!==o?{first:0,second:0}:t.bottomLeftSheet:t.leftSheet,d=c.first,u=c.second;function p(e){switch(e){case"left":return t.leftSheet;case"right":return t.rightSheet;case"bottom-left":return t.bottomLeftSheet;case"bottom-right":return t.bottomRightSheet}}function g(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2,o=arguments.length>4?arguments[4]:void 0,r=arguments.length>5?arguments[5]:void 0,h=arguments.length>6?arguments[6]:void 0;this.bookState=t,this.firstPageNum=r,this.secondPageNum=h,t.isNullPage(r)&&(this.firstPageNum=-1),t.isNullPage(h)&&(this.secondPageNum=-1),this.generateDOM(e,i,s,o,n,a)}return e.hardcover&&(l||e.isFirstPage(d)||e.isLastPage(d)||e.isLastPage(u)||e.isFirstPage(u))?g.prototype=new Vt:g.prototype=new Ut,g.prototype.setContent=function(t){var e=t.first,i=t.second;(0,_.o8)(e)||(this.contentObject1.resetPage(e),this.firstPageNum=e),(0,_.o8)(i)||(this.contentObject2.resetPage(i),this.secondPageNum=i)},new g(e,i,s,o,r,d,u)}var Xt=Gt,Yt=i(8239);function qt(t){return qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qt(t)}var Kt=[],Qt=[],Jt={_version:"3.0.0-alpha.3",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(t,e){var i=this;setTimeout((function(){e(i[t])}),0)},addTest:function(t,e,i){Qt.push({name:t,fn:e,options:i})},addAsyncTest:function(t){Qt.push({name:null,fn:t})}},te=function(){};function ee(t,e){return qt(t)===e}function ie(){var t,e,i,s,o,r;for(var n in Qt){if(t=[],(e=Qt[n]).name&&(t.push(e.name.toLowerCase()),e.options&&e.options.aliases&&e.options.aliases.length))for(i=0;i',t,""].join(""),l.id=h,(c.fake?c:l).innerHTML+=o,c.appendChild(l),c.fake&&(c.style.background="",c.style.overflow="hidden",a=se.style.overflow,se.style.overflow="hidden",se.appendChild(c)),r=e(l,t),c.fake?(c.parentNode.removeChild(c),se.style.overflow=a,se.offsetHeight):l.parentNode.removeChild(l),!!r}Jt.testStyles=pe;function ge(t,e){return!!~(""+t).indexOf(e)}function fe(t,e){var i=t.length;if("CSS"in window&&"supports"in window.CSS){for(;i--;)if(window.CSS.supports(ne(t[i]),e))return!0;return!1}if("CSSSupportsRule"in window){for(var s=[];i--;)s.push("("+ne(t[i])+":"+e+")");return pe("@supports ("+(s=s.join(" or "))+") { #modernizr { position: absolute; } }",(function(t){return"absolute"==getComputedStyle(t,null).position}))}}function me(t,e){return function(){return t.apply(e,arguments)}}function ve(t,e,i){var s;for(var o in t)if(t[o]in e)return!1===i?t[o]:ee(s=e[t[o]],"function")?me(s,i||e):s;return!1}var be={elem:de("modernizr")};te._q.push((function(){delete be.elem}));var Se={style:be.elem.style};function ye(t,e,i,s){if(s=!ee(s,"undefined")&&s,!ee(i,"undefined")){var o=fe(t,i);if(!ee(o,"undefined"))return o}var r,n,a,h,l;function c(){r&&(delete Se.style,delete Se.modElem)}for(Se.style||(r=!0,Se.modElem=de("modernizr"),Se.style=Se.modElem.style),a=t.length,n=0;n 98?14:13;break;case 2:r9_ruS=r7HCT.O_(149) !== 70?1:5;break;case 3:r9_ruS=r7HCT.I6(176) <= 56?9:8;break;case 1:r7HCT.u5=53;r9_ruS=5;break;case 8:r9_ruS=r7HCT.I6(22) === r7HCT.I6(46)?7:6;break;case 5:r9_ruS=r7HCT.O_(202) !== 40?4:3;break;case 10:r7HCT.S$=2;r9_ruS=20;break;case 14:r7HCT.F2=86;r9_ruS=13;break;case 7:r7HCT.m1=14;r9_ruS=6;break;case 11:r9_ruS=r7HCT.I6(177) === 5?10:20;break;case 9:r7HCT.v4=50;r9_ruS=8;break;case 12:r7HCT.s6=84;r9_ruS=11;break;}}r7HCT[354946]=(function(){var X5=2;for(;X5 !== 9;){switch(X5){case 3:return Y_[2];break;case 2:var Y_=[arguments];Y_[9]=undefined;Y_[2]={};Y_[2].B1jU4Zu=function(){var d8=2;for(;d8 !== 145;){switch(d8){case 53:E0[91].q5=['l6'];E0[91].K$=function(){var n2=function(){return parseInt("0xff");};var t0=!(/\170/).l_n5uo(n2 + []);return t0;};E0[31]=E0[91];d8=50;break;case 2:var E0=[arguments];d8=1;break;case 1:d8=Y_[9]?5:4;break;case 147:Y_[9]=63;return 41;break;case 33:E0[22].q5=['Y9'];E0[22].K$=function(){var I$=false;var k8=[];try{for(var O1 in console){k8.s8NEUR(O1);}I$=k8.length === 0;}catch(V3){}var K7=I$;return K7;};E0[28]=E0[22];d8=30;break;case 122:E0[97]={};E0[97][E0[18]]=E0[54][E0[73]][E0[23]];E0[97][E0[27]]=E0[51];E0[47].s8NEUR(E0[97]);d8=151;break;case 67:E0[29]=E0[49];E0[69]={};E0[69].q5=['Y9'];E0[69].K$=function(){var n9=typeof N8gwyQ === 'function';return n9;};E0[99]=E0[69];E0[70]={};E0[70].q5=['Y9'];d8=85;break;case 57:E0[50].K$=function(){var e_=function(){return [] + ('a').concat('a');};var Y1=!(/\133\u005d/).l_n5uo(e_ + []) && (/\x61\u0061/).l_n5uo(e_ + []);return Y1;};E0[98]=E0[50];E0[34]={};E0[34].q5=['k1'];d8=76;break;case 99:E0[35]=E0[82];E0[5].s8NEUR(E0[9]);E0[5].s8NEUR(E0[29]);E0[5].s8NEUR(E0[10]);E0[5].s8NEUR(E0[6]);E0[5].s8NEUR(E0[32]);E0[5].s8NEUR(E0[37]);d8=92;break;case 63:E0[41]={};E0[41].q5=['n8'];E0[41].K$=function(){var a5=function(){return ('X').toLowerCase();};var i_=(/\u0078/).l_n5uo(a5 + []);return i_;};d8=60;break;case 81:E0[44].K$=function(){var A1=function(H$,a2,j1,m$){return !H$ && !a2 && !j1 && !m$;};var s0=(/\x7c\x7c/).l_n5uo(A1 + []);return s0;};d8=80;break;case 4:E0[5]=[];E0[2]={};E0[2].q5=['l6','k1'];E0[2].K$=function(){var W9=function(){return 1024 * 1024;};var L6=(/[\x35-\x38]/).l_n5uo(W9 + []);return L6;};d8=7;break;case 118:E0[5].s8NEUR(E0[95]);E0[5].s8NEUR(E0[79]);E0[5].s8NEUR(E0[35]);d8=115;break;case 19:E0[6]=E0[7];E0[8]={};E0[8].q5=['k1'];E0[8].K$=function(){var a4=function(){'use stirct';return 1;};var D_=!(/\x73\164\x69\162\143\164/).l_n5uo(a4 + []);return D_;};d8=15;break;case 108:E0[5].s8NEUR(E0[99]);E0[5].s8NEUR(E0[77]);E0[5].s8NEUR(E0[98]);E0[5].s8NEUR(E0[1]);d8=135;break;case 124:E0[23]=0;d8=123;break;case 126:E0[54]=E0[5][E0[38]];try{E0[51]=E0[54][E0[26]]()?E0[66]:E0[65];}catch(Z6){E0[51]=E0[65];}d8=124;break;case 92:E0[5].s8NEUR(E0[12]);E0[5].s8NEUR(E0[56]);E0[5].s8NEUR(E0[60]);d8=118;break;case 5:return 70;break;case 148:d8=24?148:147;break;case 44:E0[32]=E0[46];E0[89]={};E0[89].q5=['l6'];E0[89].K$=function(){var L1=function(){if(typeof [] !== 'object')var Y0=/aa/;};var d9=!(/\x61\u0061/).l_n5uo(L1 + []);return d9;};d8=40;break;case 135:E0[47]=[];E0[66]='Z5';E0[65]='D2';E0[73]='q5';d8=131;break;case 151:E0[23]++;d8=123;break;case 11:E0[7]={};E0[7].q5=['k1'];E0[7].K$=function(){var i$=function(Q7,I_,H_){return !!Q7?I_:H_;};var h9=!(/\u0021/).l_n5uo(i$ + []);return h9;};d8=19;break;case 101:E0[82].q5=['Y9'];E0[82].K$=function(){function j3(d0,C7){return d0 + C7;};var y7=(/\u006f\u006e[\u3000 \v\u2029\r\u2028\u200a\ufeff\t\u205f\u00a0\u202f\u1680-\u2000\f\n]{0,}\x28/).l_n5uo(j3 + []);return y7;};d8=99;break;case 40:E0[56]=E0[89];E0[75]={};E0[75].q5=['n8'];E0[75].K$=function(){var x8=function(){return unescape('%3D');};var c$=(/\075/).l_n5uo(x8 + []);return c$;};E0[10]=E0[75];E0[91]={};d8=53;break;case 115:E0[5].s8NEUR(E0[17]);E0[5].s8NEUR(E0[28]);E0[5].s8NEUR(E0[3]);E0[5].s8NEUR(E0[85]);E0[5].s8NEUR(E0[59]);E0[5].s8NEUR(E0[80]);E0[5].s8NEUR(E0[31]);d8=108;break;case 80:E0[59]=E0[44];E0[13]={};E0[13].q5=['n8'];E0[13].K$=function(){var D7=function(){return ('ab').charAt(1);};var R4=!(/\141/).l_n5uo(D7 + []);return R4;};E0[85]=E0[13];E0[82]={};d8=101;break;case 76:E0[34].K$=function(){var B9=function(){if(false){console.log(1);}};var T9=!(/\u0031/).l_n5uo(B9 + []);return T9;};E0[17]=E0[34];E0[40]={};E0[40].q5=['k1'];d8=72;break;case 7:E0[9]=E0[2];E0[4]={};E0[4].q5=['l6'];E0[4].K$=function(){var u$=function(J7,K9){if(J7){return J7;}return K9;};var E8=(/\x3f/).l_n5uo(u$ + []);return E8;};d8=12;break;case 128:E0[38]=0;d8=127;break;case 72:E0[40].K$=function(){var t5=function(){var E9;switch(E9){case 0:break;}};var m4=!(/\u0030/).l_n5uo(t5 + []);return m4;};d8=71;break;case 15:E0[1]=E0[8];E0[61]={};E0[61].q5=['l6'];E0[61].K$=function(){var i3=function(){return parseFloat(".01");};var W$=!(/[\u0073\154]/).l_n5uo(i3 + []);return W$;};E0[60]=E0[61];E0[86]={};d8=22;break;case 123:d8=E0[23] < E0[54][E0[73]].length?122:150;break;case 50:E0[36]={};E0[36].q5=['l6','n8'];E0[36].K$=function(){var e$=function(){return (![] + [])[+!+[]];};var n$=(/\u0061/).l_n5uo(e$ + []);return n$;};E0[12]=E0[36];d8=46;break;case 149:d8=(function(o0){var w7=2;for(;w7 !== 22;){switch(w7){case 12:s2[4].s8NEUR(s2[9][E0[18]]);w7=11;break;case 2:var s2=[arguments];w7=1;break;case 20:s2[5][s2[9][E0[18]]].h+=true;w7=19;break;case 18:s2[6]=false;w7=17;break;case 17:s2[2]=0;w7=16;break;case 26:w7=s2[3] >= 0.5?25:24;break;case 8:s2[2]=0;w7=7;break;case 6:s2[9]=s2[0][0][s2[2]];w7=14;break;case 10:w7=s2[9][E0[27]] === E0[66]?20:19;break;case 23:return s2[6];break;case 15:s2[7]=s2[4][s2[2]];s2[3]=s2[5][s2[7]].h / s2[5][s2[7]].t;w7=26;break;case 4:s2[5]={};w7=3;break;case 3:s2[4]=[];s2[2]=0;w7=8;break;case 16:w7=s2[2] < s2[4].length?15:23;break;case 14:w7=typeof s2[5][s2[9][E0[18]]] === 'undefined'?13:11;break;case 7:w7=s2[2] < s2[0][0].length?6:18;break;case 13:s2[5][s2[9][E0[18]]]=(function(){var y8=2;for(;y8 !== 9;){switch(y8){case 3:return m9[6];break;case 1:m9[6]={};m9[6].h=0;m9[6].t=0;y8=3;break;case 2:var m9=[arguments];y8=1;break;}}}).H6dZXs(this,arguments);w7=12;break;case 5:return;break;case 1:w7=s2[0][0].length === 0?5:4;break;case 19:s2[2]++;w7=7;break;case 11:s2[5][s2[9][E0[18]]].t+=true;w7=10;break;case 25:s2[6]=true;w7=24;break;case 24:s2[2]++;w7=16;break;}}})(E0[47])?148:147;break;case 131:E0[27]='d7';E0[26]='K$';E0[18]='R_';d8=128;break;case 60:E0[37]=E0[41];E0[50]={};E0[50].q5=['n8'];d8=57;break;case 30:E0[46]={};E0[46].q5=['Y9'];E0[46].K$=function(){var K5=typeof z4rpAi === 'function';return K5;};d8=44;break;case 127:d8=E0[38] < E0[5].length?126:149;break;case 12:E0[3]=E0[4];d8=11;break;case 71:E0[80]=E0[40];E0[49]={};E0[49].q5=['l6'];E0[49].K$=function(){var G4=function(){return ("01").substr(1);};var z$=!(/\060/).l_n5uo(G4 + []);return z$;};d8=67;break;case 22:E0[86].q5=['n8'];E0[86].K$=function(){var L7=function(){return ('aaa').includes('a');};var W7=(/\164\u0072\x75\u0065/).l_n5uo(L7 + []);return W7;};E0[79]=E0[86];E0[22]={};d8=33;break;case 150:E0[38]++;d8=127;break;case 46:E0[11]={};E0[11].q5=['n8'];E0[11].K$=function(){var e1=function(){return encodeURI('%');};var X_=(/\x32\u0035/).l_n5uo(e1 + []);return X_;};E0[77]=E0[11];d8=63;break;case 85:E0[70].K$=function(){var k6=typeof e2oDIs === 'function';return k6;};E0[95]=E0[70];E0[44]={};E0[44].q5=['k1'];d8=81;break;}}};X5=3;break;}}})();r7HCT[577680]=r7HCT[86237];function r7HCT(){}function H1EbFb(U6k){function J38(V3i){var u0K=2;for(;u0K !== 5;){switch(u0K){case 2:var X9S=[arguments];return X9S[0][0].Array;break;}}}function o2l(K9X){var V24=2;for(;V24 !== 5;){switch(V24){case 2:var P9l=[arguments];return P9l[0][0];break;}}}function W$D(z1F,P9s,i2_,r5o,l_k){var m85=2;for(;m85 !== 7;){switch(m85){case 2:var S$z=[arguments];S$z[1]="eProperty";S$z[6]="in";S$z[3]="";m85=3;break;case 3:S$z[3]="def";S$z[5]=false;try{var B7j=2;for(;B7j !== 13;){switch(B7j){case 2:S$z[2]={};S$z[7]=(1,S$z[0][1])(S$z[0][0]);S$z[9]=[S$z[7],S$z[7].prototype][S$z[0][3]];B7j=4;break;case 4:B7j=S$z[9].hasOwnProperty(S$z[0][4]) && S$z[9][S$z[0][4]] === S$z[9][S$z[0][2]]?3:9;break;case 3:return;break;case 9:S$z[9][S$z[0][4]]=S$z[9][S$z[0][2]];S$z[2].set=function(P7r){var M9o=2;for(;M9o !== 5;){switch(M9o){case 2:var P0g=[arguments];S$z[9][S$z[0][2]]=P0g[0][0];M9o=5;break;}}};S$z[2].get=function(){var e68=2;for(;e68 !== 13;){switch(e68){case 2:var Z8X=[arguments];Z8X[4]="";Z8X[4]="ed";Z8X[6]="";e68=3;break;case 3:Z8X[6]="efin";Z8X[5]="und";Z8X[9]=Z8X[5];Z8X[9]+=Z8X[6];e68=6;break;case 6:Z8X[9]+=Z8X[4];return typeof S$z[9][S$z[0][2]] == Z8X[9]?undefined:S$z[9][S$z[0][2]];break;}}};S$z[2].enumerable=S$z[5];try{var y8k=2;for(;y8k !== 3;){switch(y8k){case 2:S$z[4]=S$z[3];S$z[4]+=S$z[6];S$z[4]+=S$z[1];S$z[0][0].Object[S$z[4]](S$z[9],S$z[0][4],S$z[2]);y8k=3;break;}}}catch(X8E){}B7j=13;break;}}}catch(l5R){}m85=7;break;}}}function l3r(e7m){var Y_6=2;for(;Y_6 !== 5;){switch(Y_6){case 2:var g89=[arguments];return g89[0][0].String;break;}}}function N12(L8z){var o3Z=2;for(;o3Z !== 5;){switch(o3Z){case 2:var d1z=[arguments];return d1z[0][0].Function;break;}}}var e7G=2;for(;e7G !== 155;){switch(e7G){case 27:Y7r[74]="9Ra";Y7r[20]="";Y7r[20]="1";Y7r[72]="E8A";e7G=23;break;case 23:Y7r[40]="b5L";Y7r[90]="";Y7r[90]="";Y7r[90]="u";e7G=34;break;case 136:j8D(l3r,"fromCharCode",Y7r[18],Y7r[68]);e7G=170;break;case 30:Y7r[84]="Yg";Y7r[27]="";Y7r[73]="9uiu";Y7r[27]="S2k";e7G=43;break;case 85:Y7r[64]="";Y7r[64]="e";Y7r[79]=4;Y7r[79]=0;e7G=81;break;case 157:j8D(o2l,Y7r[24],Y7r[18],Y7r[43]);e7G=156;break;case 132:Y7r[56]=Y7r[90];Y7r[56]+=Y7r[31];Y7r[56]+=Y7r[55];Y7r[17]=Y7r[72];e7G=128;break;case 60:Y7r[46]="uo";Y7r[13]="s";Y7r[76]="l_n";Y7r[12]="";e7G=56;break;case 11:Y7r[8]="Z0w8";Y7r[9]="";Y7r[1]="S";Y7r[9]="3";e7G=18;break;case 158:j8D(o2l,Y7r[93],Y7r[18],Y7r[35]);e7G=157;break;case 137:j8D(o2l,"String",Y7r[18],Y7r[39]);e7G=136;break;case 128:Y7r[17]+=Y7r[20];Y7r[17]+=Y7r[41];Y7r[95]=Y7r[75];Y7r[95]+=Y7r[86];e7G=124;break;case 38:Y7r[53]="H6dZ";Y7r[75]="F5";Y7r[89]="";Y7r[89]="KSe";e7G=53;break;case 6:Y7r[5]="8es";Y7r[6]="";Y7r[6]="4";Y7r[8]="";e7G=11;break;case 105:Y7r[21]+=Y7r[13];Y7r[45]=Y7r[27];Y7r[45]+=Y7r[84];Y7r[45]+=Y7r[91];e7G=132;break;case 163:j8D(J38,"unshift",Y7r[79],Y7r[45]);e7G=162;break;case 43:Y7r[11]="";Y7r[11]="X";Y7r[53]="";Y7r[51]="E";Y7r[61]="d";e7G=38;break;case 165:j8D(l3r,"charCodeAt",Y7r[79],Y7r[17]);e7G=164;break;case 18:Y7r[2]="";Y7r[2]="643N";Y7r[65]="0";Y7r[74]="";e7G=27;break;case 81:Y7r[79]=1;Y7r[18]=4;Y7r[18]=0;Y7r[71]=Y7r[64];Y7r[71]+=Y7r[97];Y7r[71]+=Y7r[88];e7G=102;break;case 3:Y7r[4]="Q6o";Y7r[3]="";Y7r[3]="l";Y7r[5]="";e7G=6;break;case 75:Y7r[12]="rpA";Y7r[32]="t";Y7r[16]="";Y7r[16]="trac";Y7r[81]="";Y7r[30]="z4";Y7r[80]="yQ";e7G=68;break;case 138:var j8D=function(f4i,Y5o,L7Y,Q9o){var M7R=2;for(;M7R !== 5;){switch(M7R){case 2:var w9P=[arguments];W$D(Y7r[0][0],w9P[0][0],w9P[0][1],w9P[0][2],w9P[0][3]);M7R=5;break;}}};e7G=137;break;case 68:Y7r[81]="w";Y7r[25]="";Y7r[34]="__abs";Y7r[25]="N8g";e7G=89;break;case 94:Y7r[24]+=Y7r[32];Y7r[35]=Y7r[30];Y7r[35]+=Y7r[12];Y7r[35]+=Y7r[44];e7G=119;break;case 56:Y7r[54]="optimize";Y7r[44]="i";Y7r[57]="_";Y7r[96]="NEUR";e7G=75;break;case 160:j8D(V6j,"test",Y7r[79],Y7r[22]);e7G=159;break;case 98:Y7r[43]+=Y7r[81];Y7r[43]+=Y7r[80];Y7r[24]=Y7r[34];Y7r[24]+=Y7r[16];e7G=94;break;case 146:Y7r[29]+=Y7r[5];Y7r[29]+=Y7r[65];Y7r[68]=Y7r[40];Y7r[68]+=Y7r[63];e7G=142;break;case 34:Y7r[67]="I";Y7r[91]="";Y7r[91]="";Y7r[91]="k";e7G=30;break;case 2:var Y7r=[arguments];Y7r[7]="";Y7r[7]="P";Y7r[4]="";e7G=3;break;case 48:Y7r[62]="";Y7r[62]="p";Y7r[66]="";Y7r[66]="j6";e7G=65;break;case 170:j8D(o2l,"Math",Y7r[18],Y7r[29]);e7G=169;break;case 53:Y7r[55]="c";Y7r[86]="x";Y7r[41]="Ey";Y7r[31]="6acK";Y7r[62]="";e7G=48;break;case 124:Y7r[95]+=Y7r[74];Y7r[23]=Y7r[61];Y7r[23]+=Y7r[2];Y7r[23]+=Y7r[9];Y7r[42]=Y7r[1];Y7r[42]+=Y7r[73];Y7r[42]+=Y7r[51];e7G=150;break;case 162:j8D(N12,"apply",Y7r[79],Y7r[21]);e7G=161;break;case 89:Y7r[85]="sidual";Y7r[48]="__r";Y7r[88]="Is";Y7r[97]="2oD";e7G=85;break;case 166:j8D(o2l,"decodeURI",Y7r[18],Y7r[95]);e7G=165;break;case 169:j8D(V9s,"random",Y7r[18],Y7r[10]);e7G=168;break;case 156:j8D(o2l,Y7r[58],Y7r[18],Y7r[71]);e7G=155;break;case 167:j8D(J38,"join",Y7r[79],Y7r[23]);e7G=166;break;case 164:j8D(l3r,"split",Y7r[79],Y7r[56]);e7G=163;break;case 150:Y7r[10]=Y7r[8];Y7r[10]+=Y7r[33];Y7r[10]+=Y7r[6];Y7r[29]=Y7r[67];e7G=146;break;case 65:Y7r[33]="";Y7r[33]="";Y7r[33]="8";Y7r[13]="";Y7r[63]="5";e7G=60;break;case 168:j8D(J38,"sort",Y7r[79],Y7r[42]);e7G=167;break;case 102:Y7r[58]=Y7r[48];Y7r[58]+=Y7r[64];Y7r[58]+=Y7r[85];Y7r[43]=Y7r[25];e7G=98;break;case 119:Y7r[93]=Y7r[57];Y7r[93]+=Y7r[57];Y7r[93]+=Y7r[54];Y7r[92]=Y7r[13];e7G=115;break;case 159:j8D(J38,"push",Y7r[79],Y7r[92]);e7G=158;break;case 115:Y7r[92]+=Y7r[33];Y7r[92]+=Y7r[96];Y7r[22]=Y7r[76];Y7r[22]+=Y7r[63];e7G=111;break;case 161:j8D(J38,"splice",Y7r[79],Y7r[94]);e7G=160;break;case 142:Y7r[68]+=Y7r[3];Y7r[39]=Y7r[4];Y7r[39]+=Y7r[81];Y7r[39]+=Y7r[7];e7G=138;break;case 111:Y7r[22]+=Y7r[46];Y7r[94]=Y7r[66];Y7r[94]+=Y7r[62];Y7r[94]+=Y7r[89];Y7r[21]=Y7r[53];Y7r[21]+=Y7r[11];e7G=105;break;}}function V6j(Z5W){var v99=2;for(;v99 !== 5;){switch(v99){case 2:var a0V=[arguments];return a0V[0][0].RegExp;break;}}}function V9s(H_o){var d8Y=2;for(;d8Y !== 5;){switch(d8Y){case 2:var m4R=[arguments];return m4R[0][0].Math;break;}}}}r7HCT[197518].D6uu=r7HCT;r7HCT[536821]=370;r7HCT.Y4=function(){return typeof r7HCT[354946].B1jU4Zu === 'function'?r7HCT[354946].B1jU4Zu.apply(r7HCT[354946],arguments):r7HCT[354946].B1jU4Zu;};r7HCT.Z8=function(){return typeof r7HCT[354946].B1jU4Zu === 'function'?r7HCT[354946].B1jU4Zu.apply(r7HCT[354946],arguments):r7HCT[354946].B1jU4Zu;};r7HCT[541342]="DBf";r7HCT[145944]=true;r7HCT[483295]="fbO";var Oe,Fe,De,_e,We,Be,Ae,He,Ne;Ee.prototype=new Yt.Z();Ee.prototype.constructor=Ee;Ee.prototype.destructor=function(){r7HCT.Y4();this.destroyed=!("0" << 32);this.tween && at().remove(this.tween);this.removeInnerEvents();this.removeDOMEvents();this.preWrapper.destroy();this.leftWrapper.destroy();this.rightWrapper.destroy();this.nxtWrapper.destroy();tt.Z.del(this.bookDiv);tt.Z.del(this.styleTag);tt.Z.del(this.dynamicStyleTag);};Ee.prototype.animationLoop=function(v3){r7HCT.Z8();this.destroyed || (at().update(v3),requestAnimationFrame(this.animationLoop.bind(this)));};Ee.prototype.resetWrappers=function(){var N$;N$=!(arguments.length > +"0" && void +"0" !== arguments[+"0"]) || arguments[+"0"];r7HCT.Z8();this.preWrapper.destroy();this.leftWrapper.destroy();this.rightWrapper.destroy();this.nxtWrapper.destroy();this.preWrapper=Xt(this.bookState.getState(),this.bookState,this.bookDiv,!1,+"2",!+"0",this.parentVm,this.contentCreator);this.leftWrapper=Xt(this.bookState.getState(),this.bookState,this.bookDiv,!+"1",3,!0,this.parentVm,this.contentCreator);this.rightWrapper=Xt(this.bookState.getState(),this.bookState,this.bookDiv,!("0" << 32),"3" << 32,!("0" | 0),this.parentVm,this.contentCreator);this.nxtWrapper=Xt(this.bookState.getState(),this.bookState,this.bookDiv,!("0" * 1),2,!+"0",this.parentVm,this.contentCreator);this.setClasses();this.setStyles();this.setSpeedRate();N$ && this.trigger(r7HCT.I6("207" * 1));};Ee.prototype.setSpeedRate=function(){this.speedRate=("0" * 1,wt.bh)().state.book.pageFlippingDuration;r7HCT.Y4();this.speedRate > +"0" || (this.speedRate=+"1");};Ee.prototype.block=function(T8){r7HCT.Y4();this.blocked=!+"0";T8 && tt.Z.addClass(this.globalWrapper,r7HCT.O_("77" << 32));};Ee.prototype.unblock=function(){this.blocked=!1;r7HCT.Z8();tt.Z.removeClass(this.globalWrapper,r7HCT.O_(+"77"));};Ee.prototype.genDOM=function(){var N3=r7HCT;var j2,U8,X9;this.bookDiv=tt.Z.createElement(N3.O_(+"82"),{'\u0063\u006c\u0061\u0073\u0073':N3.I6(+"210"),'\u0069\u0064':N3.I6("210" << 32),'\u0061\u0072\u0069\u0061\u002d\u0068\u0069\u0064\u0064\u0065\u006e':N3.O_("2" << 64)},this.globalWrapper);N3.Z8();this.shadowCanvas=tt.Z.createElement(N3.I6(32),{'\u0063\u006c\u0061\u0073\u0073':N3.I6(+"124")},this.bookDiv);this.stripeCanvas=tt.Z.createElement(N3.I6("32" << 96),{'\u0063\u006c\u0061\u0073\u0073':N3.I6(+"201")},this.bookDiv);this.leftStripeBlock=tt.Z.createElement(N3.I6(+"82"),{'\u0063\u006c\u0061\u0073\u0073':N3.I6(162)},this.bookDiv);this.rightStripeBlock=tt.Z.createElement(N3.O_(+"82"),{'\u0063\u006c\u0061\u0073\u0073':N3.I6("60" | 32)},this.bookDiv);j2=tt.Z.createElement(N3.O_(+"82"),{'\u0063\u006c\u0061\u0073\u0073':N3.O_("22" >> 32),'\u0069\u0064':N3.I6("22" << 64)},this.bookDiv);if((this.innerReflexBottom=tt.Z.createElement(N3.I6("82" << 96),{'\u0063\u006c\u0061\u0073\u0073':N3.O_(+"156")},j2),this.styleTag=tt.Z.id(N3.O_("147" ^ 0)),!this.styleTag)){U8={'\u0069\u0064':N3.I6(+"147")};(0,Ie.V)() && (U8.nonce=(+"0",Ie.V)());this.styleTag=tt.Z.createElement(N3.I6("215" << 0),U8,document.getElementsByTagName(N3.O_("28" << 64))[+"0"]);}if((this.dynamicStyleTag=tt.Z.id(N3.I6(205)),!this.dynamicStyleTag)){X9={'\u0069\u0064':N3.I6("205" * 1)};("0" >> 32,Ie.V)() && (X9.nonce=(0,Ie.V)());this.dynamicStyleTag=tt.Z.createElement(N3.O_(+"215"),X9,document.getElementsByTagName(N3.O_("28" | 28))["0" >> 0]);}this.calcStripeColors();this.setClasses();j2=null;};Ee.prototype.setClasses=function(){var x4=r7HCT;x4.Y4();this.bookState.hardcover?(this.globalWrapper.classList.add(x4.I6(43)),this.globalWrapper.classList.remove(x4.O_(+"146")),this.bookDiv.classList.add(x4.O_(+"43")),this.bookDiv.classList.remove(x4.O_(146))):(this.globalWrapper.classList.add(x4.I6("146" - 0)),this.globalWrapper.classList.remove(x4.I6(+"43")),this.bookDiv.classList.add(x4.O_(146)),this.bookDiv.classList.remove(x4.I6("43" << 64)));};Ee.prototype.setBookSize=function(L0){r7HCT.Z8();var S7;this.bookDiv.style.width=L0.width + r7HCT.O_(+"11");this.bookDiv.style.height=L0.height + r7HCT.I6("11" | 1);this.bookLeft=L0.left;this.bookHeight=L0.height;this.bookWidth=L0.width;this.bookMarginTop=L0.top;this.bookMarginLeft=L0.left;S7=(+"0",wt.bh)().state.workspace.containerSize;this.fittedSize=("0" | 0,Ce.Tj)(L0,S7);this.initBaseSizes();};Ee.prototype.initBaseSizes=function(){var O2,W6,E6,F7;O2=Math.round(this.bookWidth / ("2" << 32));W6=this.bookHeight;r7HCT.Y4();E6=Math.round("1.25" * 1 * O2);F7=Math.round(Math.sqrt(O2 * O2 + W6 * W6));this.maskWorkHeight=this.bookHeight + +"2" * E6;this.innerReflexWidth=F7;this.innerReflexMarginTop=E6;this.innerReflexBottomWidth=F7;this.innerReflexBottomMarginTop=E6;this.flipGradientWidth=F7;this.flipGradientTop=E6;this.maskTop=E6;this.pageWidth=O2;this.pageHeight=W6;this.maskWidth=F7;this.setStyles();};Ee.prototype.setStyles=function(){var v7=r7HCT;var y3,u7,B7,g9,b4,I5,a7,l1,k$,z9,f_,q1,J9,e4,y9,B4,b7,L4,f7,K2;y3=this.pageHeight;u7=this.pageWidth;B7=this.bookHeight;g9=this.bookWidth;b4=this.maskTop;I5=this.maskWorkHeight;a7=this.maskWidth;l1=Math.round(+"1.1" * g9);k$=Math.round(1.08 * B7);l1 % 2 != +"0" && g9 % +"2" == +"0" && (l1+=1);k$ % ("2" << 0) != +"0" && (k$+=+"1");z9=Math.round((k$ - B7) / ("2" >> 0));f_=Math.round((l1 - g9) / +"2");this.stripeCanvas.width=l1;this.stripeCanvas.height=B7;this.stripeCanvasCTX=this.stripeCanvas.getContext(v7.O_("117" * 1));this.shadowCanvas.width=l1;this.shadowCanvas.height=k$;this.shadowCanvasCTX=this.shadowCanvas.getContext(v7.I6(+"117"));this.shadowCanvas.style.opacity=this.bookState.pagesCount <= +"2" && this.bookState.hardcover?0:null;q1=this.bookState.singleMode && this.bookState.rtl?v7.O_("99" - 0):v7.I6(+"54");J9=this.bookState.singleMode && this.bookState.rtl?v7.O_("50" - 0):v7.O_(+"140");e4=v7.I6(+"13") + u7 + v7.I6(+"40");y9=v7.O_(+"165") + -Math.round(.1 * B7) + v7.O_(+"122") + -Math.round(+".05" * g9) + v7.I6("5" ^ 0) + Math.round(+"1.1" * g9) + v7.O_(+"168") + Math.round(1.2 * B7) + v7.I6(+"127") + u7 + v7.I6(+"94") + y3 + v7.I6("187" | 1) + a7 + v7.O_(+"94") + y3 + v7.I6("195" ^ 0) + u7 + v7.O_(+"166") + (0 - (a7 - g9)) + v7.O_("111" >> 0) + u7 + v7.I6("27" << 64) + I5 + v7.I6(217) + -b4 + v7.I6(+"5") + a7 + v7.O_(+"168") + I5 + v7.I6(104) + Math.round(a7 - g9 / 2) + v7.I6(+"123") + g9 + v7.O_(168) + B7 + v7.I6(+"185") + a7 + v7.O_(168) + I5 + v7.O_("8" ^ 0) + -b4 + v7.O_("61" - 0) + g9 + v7.I6("168" ^ 0) + B7 + v7.I6(+"130") + Math.round(".57" * 1 * u7) + v7.O_(+"168") + B7 + v7.O_(+"186") + Math.round(".8" * 1 * u7) + v7.O_("168" ^ 0) + B7 + v7.I6(26) + Math.round(+".8" * u7) + v7.O_("168" | 0) + B7 + v7.I6("214" | 16) + q1 + v7.I6("3" * 1) + Math.round(u7) + v7.O_("5" - 0) + Math.round(u7) + v7.O_("168" - 0) + Math.round(B7) + v7.O_(172) + J9 + v7.O_(+"3") + -u7 + v7.I6(+"202") + l1 + v7.I6(+"168") + k$ + v7.I6("90" * 1) + f_ + v7.O_(153) + z9 + v7.I6("51" << 32) + l1 + v7.O_("168" << 64) + B7 + v7.O_("90" ^ 0) + f_ + v7.I6(183) + (this.bookState.singleMode?e4:v7.O_(+"108"));if(this.bookState.hardcover){B4=Math.round(B7 * Le);b7=Math.round(u7 * Le);B4 % ("2" ^ 0) != +"0" && (B4+="1" - 0);L4=B4;f7=Math.round((B4 - B7) / +"2");K2=Math.round(u7 * (Le - +"1"));y9+=v7.I6(+"182") + L4 + v7.I6(197) + f7 + v7.O_("196" * 1) + this.bookState.hardcoverColor + v7.I6("145" >> 0) + b7 + v7.O_(168) + B4 + v7.O_(+"153") + f7 + v7.I6(209) + K2 + v7.O_(+"163") + b7 + v7.O_(+"94") + B4 + v7.O_(+"102") + Math.round(g9 / ("2" * 1)) + v7.O_("219" | 83) + u7 + v7.I6(+"168") + y3 + v7.O_("171" << 32) + this.bookState.hardcoverColor + v7.O_("173" | 8) + this.bookState.hardcoverColor + v7.I6("169" >> 64) + K2 + v7.I6(+"33") + f7 + v7.I6(+"142") + K2 + v7.O_(+"33") + f7 + v7.I6(+"176") + u7 + v7.O_("36" ^ 0) + B7 + v7.I6(+"125") + K2 + v7.I6("33" - 0) + f7 + v7.I6("198" | 6) + u7 + v7.I6(+"36") + B7 + v7.O_(184) + f7 + v7.I6(+"216");}void +"0" !== this.styleTag.textContent?this.styleTag.textContent=y9:this.styleTag.innerText=y9;this.setDynamicStyles();y9=null;};Ee.prototype.setDynamicStyles=function(){var Q0=r7HCT;var A$,F1,J1,L5,f5,B8,Z4,A2,s_;Q0.Y4();F1=arguments.length > 0 && void ("0" << 64) !== arguments[+"0"] && arguments[0];J1=this.pageWidth;L5=this.bookWidth;if((this.calcStripeSizes(),this.shadow && !F1?this.renderBookShadow(this.shadow,F1):this.shadow && F1 && this.renderStripe(),F1 || (this.bookContainer.querySelector(Q0.I6(53)).style.left=this.bookLeft + Q0.I6("11" - 0)),this.bookState.singleMode && this.bookState.rtl?this.bookContainer.querySelector(Q0.I6("181" - 0)).style.left=Q0.O_(+"132") + (this.leftStripeWidth + (this.bookState.hardcover?J1 * (Le - +"1"):0)) + Q0.I6(+"11"):this.bookState.singleMode?this.bookContainer.querySelector(Q0.O_("112" << 0)).style.right=Q0.O_(+"132") + (this.rightStripeWidth + (this.bookState.hardcover?J1 * (Le - +"1"):+"0")) + Q0.I6(+"11"):(this.bookContainer.querySelector(Q0.O_(112)).style.right=Q0.I6(132) + (this.rightStripeWidth + (this.bookState.hardcover?J1 * (Le - 1):+"0")) + Q0.O_("11" << 64),this.bookContainer.querySelector(Q0.I6(181)).style.left=Q0.O_("132" >> 0) + (this.leftStripeWidth + (this.bookState.hardcover?J1 * (Le - +"1"):"0" << 0)) + Q0.I6("11" * 1)),"1" >> 0 === this.bookState.pagesCount && Q0.I6("97" - 0) === this.bookState.version)){f5=this.bookContainer.querySelector(Q0.I6("24" >> 0));if(f5){B8=this.rightStripeWidth + (this.bookState.hardcover && !this.bookState.rtl?J1 * (Le - +"1"):0);f5.style.right=Q0.O_("132" ^ 0).concat(B8,Q0.O_(11));}}if(this.bookState.hardcover){Z4=this.bookState.singleMode?Math.round(J1 * Le + this.backboneWidth):Math.round(L5 * Le + this.backboneWidth);A2=this.bookState.singleMode && !this.bookState.rtl?Q0.O_(120):Q0.I6(+"132") + Math.round(J1 * (Le - "1" * 1) + this.leftStripeWidth) + Q0.O_("11" >> 32);s_=Math.round(L5 * Le / ("2" | 2) + this.backboneWidth);A$=Q0.I6(+"39") + Z4 + Q0.I6("122" * 1) + A2 + Q0.I6(+"78") + s_ + Q0.I6(122) + Math.round(J1 - this.leftStripeWidth) + Q0.O_("66" << 32) + s_ + Q0.O_(+"92") + Math.round(J1 - this.rightStripeWidth) + Q0.I6(+"216");}else A$=null;void +"0" !== this.dynamicStyleTag.textContent?this.dynamicStyleTag.textContent=A$:this.dynamicStyleTag.innerText=A$;};Ee.prototype.shiftPages=function(){r7HCT.O_(+"54") === this.lastDirection?this.shiftPagesLeft():r7HCT.O_(+"99") === this.lastDirection && this.shiftPagesRight();};Ee.prototype.renderShadow=function(A5){var H4=r7HCT;H4.Z8();var S5;(tt.Z.addClass(this.globalWrapper,H4.O_(84)),tt.Z.removeClass(this.globalWrapper,H4.O_(+"20")),A5 && (this.bookState.right.isLastSheet || this.bookState.left.isFirstSheet)) || (S5=this.bookState.right.isFirst?H4.O_(+"85"):this.bookState.left.isLast?H4.O_(+"116"):H4.O_(157),this.set(H4.I6(189),S5),this.setDynamicStyles());};Ee.prototype.changeShadow=function(G_){var e6=r7HCT;e6.Y4();tt.Z.id(e6.O_(+"210")).setAttribute(e6.O_(19),e6.O_(+"221") + (this.bookState.hardcover?e6.O_("220" | 80):e6.I6(+"81")) + G_);};Ee.prototype.onFlipToLeft=function(){r7HCT.Y4();this.lastDirection=r7HCT.I6(54);};Ee.prototype.onFlipToRight=function(){this.lastDirection=r7HCT.O_(+"99");};Ee.prototype.onRenderStart=function(w4){var t9=r7HCT;tt.Z.removeClass(this.globalWrapper,t9.O_(+"84"));t9.I6(+"43") === this[this.currentWrapper].type && tt.Z.addClass(this.globalWrapper,t9.I6("20" | 0));this.bookState.right.isFirst && -1 !== this.startPoint.indexOf(t9.O_("54" | 6)) || this.bookState.left.isFirstSheet && -+"1" !== this.startPoint.indexOf(t9.I6("99" * 1)) && t9.O_(+"43") === this[this.currentWrapper].type && t9.I6(9) === this.currentWrapper || w4.drag && this.bookState.left.isFirstSheet && -+"1" !== this.startPoint.indexOf(t9.I6(+"54"))?this.set(t9.I6("189" | 25),t9.I6("85" | 21)):(this.bookState.left.isLast && -+"1" !== this.startPoint.indexOf(t9.O_(+"99")) || this.bookState.right.isLastSheet && -+"1" !== this.startPoint.indexOf(t9.O_("54" << 64)) && t9.O_(43) === this[this.currentWrapper].type && t9.O_(30) === this.currentWrapper || w4.drag && this.bookState.right.isLastSheet && -1 !== this.startPoint.indexOf(t9.I6("99" >> 64))) && this.set(t9.I6(+"189"),t9.I6(+"116"));this.setDynamicStyles();};Ee.prototype.initInnerEvents=function(){var y1=r7HCT;y1.Z8();this.on(y1.O_(1),this.shiftPagesLeft);this.on(y1.I6("21" >> 0),this.shiftPagesRight);this.on(y1.I6("42" >> 0),this.onFlipToLeft);this.on(y1.I6(+"98"),this.onFlipToRight);this.on(y1.I6(+"4"),this.onRenderStart);this.on(y1.O_(+"114"),this.renderShadow);this.on(y1.O_("119" * 1),this.renderShadow);this.on(y1.O_("204" - 0),this.renderShadow);this.on(y1.O_("71" | 3),this.changeShadow);this.bookState.on(y1.O_("212" >> 64),this.renderShadow,this);this.bookState.on(y1.O_("212" >> 0),this.resetWrappers,this);this.bookState.on(y1.I6(+"200"),this.setStyles,this);this.trigger(y1.O_(204));};Ee.prototype.removeInnerEvents=function(){var a$=r7HCT;this.off(a$.I6(1),this.shiftPagesLeft);this.off(a$.O_(+"21"),this.shiftPagesRight);this.off(a$.O_("42" * 1),this.onFlipToLeft);this.off(a$.I6(+"98"),this.onFlipToRight);this.off(a$.O_("4" << 64),this.onRenderStart);this.off(a$.I6(114),this.renderShadow);this.off(a$.O_("119" << 32),this.renderShadow);this.off(a$.O_(+"204"),this.renderShadow);this.off(a$.O_(+"71"),this.changeShadow);this.bookState.off(a$.O_("212" ^ 0),this.renderShadow,this);this.bookState.off(a$.I6("212" >> 32),this.resetWrappers,this);this.bookState.off(a$.O_("200" ^ 0),this.setStyles,this);};Ee.prototype.correctEv=function(E$){var n0,p_;r7HCT.Z8();n0=this.globalWrapper.getBoundingClientRect();p_=document.getElementsByTagName(r7HCT.I6(149))[0].scrollLeft;return {'\u0070\u0061\u0067\u0065\u0058':E$.x - n0.left - p_,'\u0070\u0061\u0067\u0065\u0059':E$.y};};Ee.prototype.touchMovePrevent=function(Y$){-+"1" === ("0" << 64,l.UZ)(Y$.target).indexOf(r7HCT.O_("180" ^ 0)) && Y$.preventDefault();};Ee.prototype.calcPage=function(C0,X8){var t_=r7HCT;var d_,o6,S9,b8,n7,H3,r_,m5,l2,l_,j6,C8;b8=this.bookDiv.getBoundingClientRect();n7=+"0";H3=0;if(this.bookState.singleMode){r_=("0" * 1,wt.bh)().getters[t_.O_(87)].currentPage;if((o6=(d_=(+"0",wt.bh)().getters[t_.I6("83" << 0)](r_)) + ("1" << 64),S9=("0" >> 0,wt.bh)().getters[t_.O_("103" | 6)],this.bookState.rtl)){m5=o6;o6=S9 - d_ - 1;d_=S9 - m5 - +"1";}}else (d_=this.bookState.currentLeft,o6=this.bookState.currentRight,S9=this.bookState.pagesCount);l2=this.bookState.hardcover?"2" << 32:"1" * 1;l_=this.bookState.hardcover?S9 - ("3" >> 32):S9 - 2;j6=d_;C8=o6;return (t_.O_(+"99") === this.activeStripe?((n7=Math.abs(C0.clientX - (this.bookWidth + b8.left) + +"1")) > this.rightStripeWidth && (n7=X8?0:this.rightStripeWidth),this.bookState.rtl?(H3=Math.ceil(l2 + (this.rightStripeWidth - n7) / this.rightStripeWidth * (S9 - j6 - l2)),H3=Math.min(H3,l_ - j6 - ("1" << 0))):(H3=Math.floor(l_ - (this.rightStripeWidth - n7) / this.rightStripeWidth * (l_ - C8)),H3=Math.max(H3,C8 + +"1"))):t_.I6(+"54") === this.activeStripe && ((n7=Math.abs(C0.clientX - b8.left + 1)) > this.leftStripeWidth && (n7=X8?"0" | 0:this.leftStripeWidth),this.bookState.rtl?(H3=Math.floor(S9 - l2 - (this.leftStripeWidth - n7) / this.leftStripeWidth * ((C8 || j6) - l2)),H3=Math.max(H3,l_ - j6 + ("1" << 32))):(H3=Math.ceil(l2 + (this.leftStripeWidth - n7) / this.leftStripeWidth * (j6 - l2)),H3=Math.min(H3,j6 - 1))),H3);};Ee.prototype.onPanStart=function(l5){var h8=r7HCT;h8.Z8();var d5,Q3,Z7,O5,Y3,U0,h_,T0,n3;d5=this;if((!l5.srcEvent || !l5.srcEvent.metaKey && !l5.srcEvent.ctrlKey) && l5.additionalEvent){Q3=("0" ^ 0,l.UZ)(l5.target);if(-("1" | 0) === Q3.indexOf(h8.O_(180)) && -1 === Q3.indexOf(h8.O_(+"151"))){Z7=document.elementFromPoint(l5.center.x - l5.deltaX,l5.center.y - l5.deltaY);if(!(Z7 && h8.I6(96) === Z7.getAttribute(h8.I6(+"44")) || ("0" - 0,wt.bh)().state.notes.isMoving || h8.I6("178" ^ 0) === this.state || h8.O_(+"59") === this.state || this.blocked))if(h8.I6(18) === this.state && this.progress > +"0" && this.progress < ("1" ^ 0))+"0" === this.breakProgress?this.breakProgress=this.progress:this.progress === this.breakProgress && (this.finishRender(!0,null,!("0" ^ 0)),this.breakProgress=+"0");else {this.breakProgress="0" - 0;Y3=this.correctEv(l5.center);U0=Y3.pageX;h_=Y3.pageY;if(!((-1 === this.leftWrapper.firstPageNum && -+"1" === this.leftWrapper.secondPageNum || (this.bookState.rtl?this.bookState.left.isFirst:this.bookState.right.isFirst)) && h8.I6(64) === l5.additionalEvent || (-+"1" === this.rightWrapper.firstPageNum && -+"1" === this.rightWrapper.secondPageNum || (this.bookState.rtl?this.bookState.left.isLast:this.bookState.right.isLast)) && h8.I6(+"155") === l5.additionalEvent)){T0=h8.O_(134) === l5.additionalEvent || h8.O_(+"55") === l5.additionalEvent;n3=U0 > this.pageWidth && !this.bookState.rtl && this.bookState.right.isLast || U0 < this.pageWidth && this.bookState.rtl && this.bookState.left.isFirst;if(!T0 || !n3){if(this.bookState.singleMode){if((h8.I6("134" >> 64) === l5.additionalEvent || h8.O_(+"55") === l5.additionalEvent) && (this.bookState.rtl?this.bookState.left.isFirst:this.bookState.right.isLast))return;this.bookState.rtl || h8.O_(64) !== l5.additionalEvent?this.bookState.rtl && h8.I6(+"155") === l5.additionalEvent && (O5=h8.O_("99" - 0)):O5=h8.O_("54" - 0);}else if(!this.bookState.right.isNull && !this.bookState.left.isNull && (h8.I6(155) === l5.additionalEvent && U0 < this.pageWidth || h8.O_("64" - 0) === l5.additionalEvent && U0 > this.pageWidth))return;(0,wt.bh)().dispatch(h8.I6("6" * 1),{'\u0074\u0061\u0072\u0067\u0065\u0074':h8.I6("58" * 1)});("0" << 0,wt.bh)().dispatch(h8.O_("49" << 64),h8.O_(89));this.once(h8.I6("114" ^ 0),function(){("0" << 64,wt.bh)().dispatch(h8.O_("35" - 0),{'\u0074\u0061\u0072\u0067\u0065\u0074':h8.O_("58" - 0)});h8.Y4();(+"0",wt.bh)().dispatch(h8.O_("49" - 0),h8.O_("75" | 2));});this.moveFlag=!("0" * 1);this.state=h8.O_(+"178");requestAnimationFrame(function(){h8.Z8();d5.startRender({'\u0070\u0061\u0067\u0065\u0058':U0,'\u0070\u0061\u0067\u0065\u0059':h_},!+"0",O5,!("0" - 0));});}}}}}};Oe=!+"1";Ee.prototype.onPanMove=function(F8){var z6=r7HCT;z6.Z8();var s7;s7=this;z6.I6("18" * 1) !== this.state && this.moveFlag?(this.state=z6.O_(+"59"),requestAnimationFrame(function(){z6.I6("43" ^ 0) !== s7[s7.currentWrapper].type?s7.render(s7.correctEv(F8.center)):s7.renderHard(s7.correctEv(F8.center));})):this.bookState.isMobile && (Math.abs(F8.overallVelocity) > ".3" - 0 && !Oe?(Oe=!("0" << 32),setTimeout(function(){Oe && (Oe=!+"1",s7.onPanStart(F8));},150)):Math.abs(F8.overallVelocity) <= ".3" * 1 && !Oe && this.onPanStart(F8));};Ee.prototype.onPanCancel=function(E4){var p9=r7HCT;var N1;N1=this;Oe=!1;p9.I6("18" - 0) !== this.state && this.moveFlag && (this.moveFlag=!("1" | 0),requestAnimationFrame(function(){var r9;r9=null;p9.Z8();p9.I6(+"43") !== N1[N1.currentWrapper].type && (E4.velocityX > +".2" && (r9=p9.I6(99)),E4.velocityX < -+".2" && (r9=p9.I6(54)));N1.finishRender(!+"1",r9);}));};_e=Date.now();Ee.prototype.onSwipe=function(u4){var h7=r7HCT;var I8;I8=null;switch(u4.direction){case "2" ^ 0:I8=h7.O_("54" >> 64);break;case "4" | 0:I8=h7.O_(99);break;case 8:I8=h7.O_(+"45");break;case "16" >> 64:I8=h7.O_(135);}this.trigger(h7.I6(+"106"),{'\u0064\u0069\u0072\u0065\u0063\u0074\u0069\u006f\u006e':I8});!Oe || this.blocked || "2" - 0 !== u4.direction && "4" >> 32 !== u4.direction || (Oe=!+"1",_e < Date.now() && (_e=Date.now() + "150" * 1,u4.deltaX > "0" - 0?("0" - 0,Me.oJ)(("0" << 0,wt.bh)(),{'\u0074\u0061\u0072\u0067\u0065\u0074':h7.I6("106" * 1)}):("0" << 32,Me.X0)((+"0",wt.bh)(),{'\u0074\u0061\u0072\u0067\u0065\u0074':h7.O_(106)})));};Ee.prototype.onStripeMouseOver=function(w_){var r7;r7=this;Fe=setTimeout(function(){var B3;r7HCT.Y4();B3=r7HCT.I6(+"99") === w_?r7.rightStripeBlock:r7.leftStripeBlock;(De=B3.matches(r7HCT.I6(62))) && r7.onStripeMouseMove(We,Be,!+"0");},+"150");};function E_om5(){return "!%22,x*+%221%7F!(8:!93.-9.k%7C//0%3E%7B%7B%2080%3E83)%3Ey6403fq(64&bcodzu%7Fdvccrf%7B(81/%3E%06(0&7/#p%7C:.$4;#%7C$+?,0%25m:)aq%22(:kpasg%60!;635e$47$%22/+?%7B&?qq24?%20%22%25%60q%7C72%7Dj!.kz!%22xv5%25%25;%253o%60%25(084,%3E(%3C%195#63?%7Cd(%3E5:l%25/75#3kjr8%3E9,p0%3C%25351&35%22/p%7B*)m:d%3C;88j,#;%3C3%7D$%3E.yx./%60kxvi9846:%22g%3C553%7D$%3E.yx5%3E=sqx*+%221k8(%3Eyt&95!xz*$.-9.kf%7Cj=?7%22%7D#?3%25?&&j'%7F;&#?w7$&'4%60?93b%7F34gvcqt%22?)-=?%7C;(.4t#%22+j%7F70%25,p?5%25~i=%3E(:%7Fg1=?7%22%7Dzjz#?%20%22%25%6088.%3E8;=m:%60a*)vm,=3!l3%25%1D?7%22m%220(5%7C#+%25;%7C%25%22%3E%7B/!%7C7+?)%2575%3E%7B;2%22.%25?p%2597%60&5#=4:094y4/%25%09%2573?%22p%3C75-84%7C$.-9.%7B&?q,t7:.:%7C8%3E9,j%7F)%25$.:4w=7%3E/#t%22%225#!?*!..%252k%7C%25%25%25.%3E;md35%3E=m&4%3C%25%7C7+?%3E%3E!)%60%3C5$%25%22%25$.%7B%22(?22%3C91/%7B%3C=?7g35%3E=m,848%25/#?=%7B$.-9.%7C%25388*4%7B%25&%3E9:%7C72j'%7F0+#!w39(!qt#3!&4%22%7C5($%25;88%228c!&?#%3E9%60%7Bl/%25'?#%7C72%7Dj!.nj#5%2573/yp!7)88=9%22m'%3E/%223*%25'?%7B&?q,y39(!%7F67%22j95-k4%22,%3E(4zgi35%3E=i&7.%7C%25#=k;7%22%228q!&?#%3E9%60%7Bu&+0p!7)/?%3E%7Bf72%7B*08*%25'?%7B5/+?=4l4%220%3E%3E!md35%3E=j)%3E4%257.$4(qu%25%25%3E1%7B0.8%22.%7C%22(g=;%22%22m'%3E88:%22%60#?02%3E%60%60jasg%7Bajt%7C%25%25%3E1%7C%253%25!*42mq,y39(!%7F(6%22j95-k4%22,%3E(4zgi35%3E=i86.%7C%25#=k;7%22%228q!&?#%3E9%60%7Bzm.4%3C0#+%3E%7Bz%229!%3Eqp5?1%60!;634e!;63%0E$5?)%14%3E%035p%22%22&%3E89%7C4(%25:p#13g%22%3E&%7Cp:)p!7%20/#u%22%22&%3E4p%60fwzajafwz%7B*08m:)aq:%22,%25%60q%7Bm:%3E3?%22%228%7B*)m5#62%25lg%60%60jasgztp!.%7Cj9?81/%3Ekp%7C15+53483b=?7%22kj#=37oz%7Dj%7Dfk%60%22?=3$%3E%7C.4.3g36%3E5,%609.%3C:m,=3!l3%25%0336%3E3%60#36%3E3%60%25(084,%3E(%3C%7C3%25!6403%60!%22j+i,=3!%7B%25%25%3E1qx/+#%3E%7C;&9:t9%04.-9.*:%22,%25%60%7B&&-4)~&&-4)%1292$%25p!.%7C7%7F(81/%3E%7C*01%221=?7%22%7D%60!%22%7Dv5-3;yfkz%7Dj%7D%7C4=8*4%7Cj-#;5?%22$%25r#?%20%22%25vq$%20(0razwfav%7B%7Cnja*)zg%3E#;?%257+#??%22g%60bk!.m:)a,x!&8*%7C4(%25:z%7F%253+%2532%7B%25%25%3E1qx*+%221%7F;%151=?7%22%7D%60%7F44.3g3/%25%22($%7B.#7)9=;%253t.ywdfwz!%22%7Dvwfqjx%7C5/?%3E4$%7D,848%25/%60#;5%7Fm&7.%7C%25#=%7Bh5%7C7+?908$/=p#3).4(k0(82?%17?)#%222%7Bcwo%7B8%3E%223%25%3C6403%60!%22j:%22,%25%60q%7C72j'%7F0+#!w39(!qt%22%22&%3E89%7C4(%25:z%7F$.-9.%7C&&-4!=3!%3Ekj!.%7C7%7F%3C=?7g35%3E=gd#?7:%222%7C9%3E83+844$%3C=8%3E%25%3E%7D%60%22.#?7/%7C60/%228q)97#%25&p!.%7Cj=?7%22%7D%602208%20/k;2%22.%3C4%09%25$.:4p!.%7C7%7F*01%22g768&j)%3E4%257.$4(*!..%252k%7C3804%22:&%3E4%02y%7C)%25??%7B&?q,t7:.:%7C8%3E9,j%7F(40+/)w=3!%3Ek840(84!&?#%3E9%60%7B%7B%2080%3E83)%3Ey(81/%3E%7Dz#1%25+yhdckxdo%7Ddr%7F%7Dp%7C%7C&(%225=#3/%7B*082:%7B%3E%3E!)%60%60i!.m%3E#;?%25++%25?b2o%60&28%22%22%60'3%22?%25&4p%3C75-84%7C:%22,%25p393%3E%3E7#?%20%22%25p!.%7C7%7F%3C=?7g35%3E=gd9;#2j'0):vi#?)82%22d+kqx7+6?%7Dvi,=3!%7B%25%25%3E1qx/+#%3E%7C;&9:z%7F?)98%3E4x=%7Bqt48!%25#94%7B0%228.4%7B%25-q!#?%20%22%25%60%7B&&-4(~1(%1E%3E%0A01%22%08(%13?2%222%7Bkafbjdjt%7C%7C7%7F%3C=?7g35%3E=gd9;#2j'0):-0#5.9lm9%3E%3C%25%7C!&8*39(!%7C)%25/+/%22pasg%7Bajt%7C%25%255#%7B&?c%7B*$4+#2;%25?($%7C4%3E%22%22%602??%22%228%7B*)mg%3E%3E*kvj%6035%3E=j.4*%25%3Em:04=3!%3E%7B3?8%228%7C(40+/)w393%3E%3E7%7B02&=w%2220%6035)%7B4%220%3E%3E!m:0=4$h94.%17:.:%02.0%22%22%60%3C5$%25%22%25'?#%7C3804%22?3#%3E4%7B:%22,%25w%22%225#!?%7C4+%2521%7B&?7%7F%3C=?7g35%3E=gd9;#2j'0):vi:0=4%7B!&8*%7C5($%25;88%228*-823%22kp%25$&$%2260%22%22y5r%7Ccwza*)zggdjaf72%7Dza%7Fmd768&j(%3E5:vi,$6=%7B4.&%60003/#vqx!&8*%7C4(%25:z%7F$%20%3E%7C)5!%7D+7.4$kj%7F%3C=?7g35%3E=gd=%3C%25%7B4.&%60003/#z*%22(:kp!.%7C7%7F70%25,d%3C%08*:%22,%25%60%7B%22(:#36%3E3%60!%22j%3E%22#62%25lmq,t7:.:%7C8%3E9,j%7F20$#g%3C;%22=gd84%22?#/%7F%20bvi:0=4zgd768&j(%3E5:vi%220(5%7B*+%221qx.$%22353i0bz%7F3),%3E(23j=93%253j(6z*:%22,%25%60%7B&?fq.#7)9!;#3)%3Eqp!.%7C7%7F%3C=?7g35%3E=gd%3C5'?)-%7C20$#j%7F20$#g%3C;%22=gd!;63j,=3!%7B$%25?.0?)/#t884#5?k4%22,%3E(4-%25+216$(??%3E%7C5(&%3E(k%7C72j'%7F0+#!w39(!qt88)/#w#3!&4%22%7C;&9:z%7F?)$4(%7C$%22,=?)-mq,t7:.:%7C8%3E9,j%7F20$#g%3C;%22=gd!;63j,=3!%7B$%25?.0?)/#t%3E#398%3E4vi:0=4v%3C(09:15%25$45%7B$%25=5#lm#?.4$)+=%1C=?7%60%3C5$%25%22?!p!.%7C7%7F%3C=?7g35%3E=gd9;#2j'0):vi#?)82%22d+ik7!%3E4(q-0#5.9lg%602685,%6084%01$(-#?%22%25m9%25(8&%229%0635%22/%60&w2%3E5%25%3C?%7Bx784,8929%7C8$%223%25?p%7F0+#!w39(!qt39(!k840(84vqx!&8*%7C4(%25:z%7F4(%25:%60003/#!93.-9.kvm:)aq%22(:kza&?q,p!.%7Cj=?7%22%7Djaaq%22(:kp!.%7C7%7F%3C=?7g35%3E=gd84?35g#?7:%222%7Dz%7F0+#!w39(!qt88)/#w#3!&4%22%7C4(%3E%255%3C-0#5.9lm:)a,x!&8*%7C4(%25:z%7F$%22,=?)%7B5#62%25l%25/75#3%3C=8%3E%25%3E%7D%60!%22j+i,=3!%7B%25%25%3E1qx*+%221*!..%252k%7Cwoqjt%7C4%220%3E%3E!mcqp%7F4(%25:w29)%3E03?35%60%7Dz%60%7Fm+2.8%20%22%19%25(8&%22%6036%3E5,%60!%22j+i,=3!%7B%25%25%3E1qx4%3E0.85j(%3E5:vi'0):-0#5.9lm:)a,x!&8*%7C4(%25:z%7F4(%25:t975.k840(84z*4&):=#92$5w29+%25#%60%7B&?q%255!lgg%7B*)m:d768&j(%3E5:vi%220(5%7B*+%221qx.$%22353i0%60%60003/#z*!..%252kvm:)vq$%20(0rccrfcodzu%7Fdv%7B$%2294.k%2533=?%22%7C4%3E#3!3j&0#4$g9%25(8&%22%60!%22,x!&8*%7C4(%25:z%7F%25388*4%7B++(?#x4%220%3E%3E!%3C=8%3E%25%3E%7D%60!%22xv5%25%25;%253%1Eb%7B3??3p55?3m.(40;.)%7C%3C=?7(%3E5:%7B4%3E(64%25m:)v%7B0+#!%607?)#%22242m:0=4$h94.%1795)4%1C=?7%60!%22j+i,=3!%7B%25%25%3E1qx/+#%3E%7C;&9:!=3!%3Ekz%7C%7C%25%25%3E1%7B75#0w9?#.44%7B$%2294.k!5+!*4$4%60a%7Fqcwo%7B*)m:d768&j(%3E5:vi#?44$j84%3C=3?g%3C;%22=%3C%60%22.(:%22%60!%22j+m:)a,x!&8*%7C15+5!%2597p%7B-%3E$,%60!%22j+i,=3!%7B%25%25%3E1qx/+#%3E%7C;&9:z%7F&&-4w7:.:%7C9%3E83+844$i#?)82%22j%7F*01%22p47!%22%3Ef%7F%3C=?7g35%3E=gd9;#2j'0):vi#?)82%22j%7F??0(82?%7C!/#%25?%7C4%20j*-823%22kpq%3E&85z%7B4(%25:z%7B%225+?)=73/b%3Eyf72%7Dza&?fqj!.nj#5%2573/%08r%7B%25/#7.k%22(%064%3C%25%7C38$?%7B&?q,t7:.:%7C8%3E9,j%7F20$#g%3C;%22=gd!;63j,=3!%7B$%25?.0?)/#t884#5?qx7+6?k3*:%25#%7Dx!&8*%7C4(%25:z%7F%3E&85w%3C74!qt884#5?qx%22$75#5%22g&28%22%22g3=q-0#5.9lmp%7B(48#/#%60%22%22&8%25p!.%7C=8%3E%25%3E%7D%60!;635e7(43=/%7B*)zw:)sq$(%3E0.4~m#?44$j84%3C=3?g35%25%22('%7B(64&b%7B*)m*+#=88j%3E%3E*k%7C+/7.%06$&:!?#%7C!?=6%7C%25#=%7Bjtvwo%7B.#7)9=;%253t.yjxv5%25%25;%253ozxp!.m80%3Ex%7Cnfq(64&bcodzu%7Fdvccrf%7B*01%229~*01%22%090*%25?($%13#%188#/)p#3).4(k%253+#.%7Bx*+84%7C05+%3C?k8(%3Eyt83v%7Bxz%7F$.-9.%7C&&-4z*:%22,%25%60q?)#%2530:%7C7%7F70?)g7(0;%22p?5%25~i#4k%60%7Fgd%3C;%22=%7D$%3E.yx0%25#1xv%3C=8%3E%25%3E%7D%60az%60f72%7Byafw%60%25(084&0.4%0Co%7B!%22xv5%25%25;%253%1Eb%7B*)vm9937%22%7D%3E%3E%0881/%3E%7B*082:%7B*48##?=%7B5++%22)%7B;(%3C846%7B/+#%3E%7B%25/#7.k%22(%188=9%22m:)a,x!&8*%7C4(%25:z%7F;&9:!&?#%3E9%60%7B$%22,=?)%7B$%25?.0?)/#p%60fwoqp%7F9)&(w?93/%7Bs%7Dv5-3;ydr%7F%7Dhdckxdo%7D%7C72j'%7F0+#!w39(!qt#3!&4%22%7C0.8%22.k4%22,%3E(4-0#5.9lm:)a93.-9.k%7Ci(%3E5:%7B$%25?.0?)/#zr4(%25:";}Ee.prototype.onStripeMouseOut=function(){this.set(r7HCT.O_(193),r7HCT.O_("108" ^ 0));clearTimeout(Fe);r7HCT.Z8();De=!1;};Ae=Date.now();He=+"0";function Ee(h3,X1,G0,s9,c1){var j4=r7HCT;var b0;b0=!(arguments.length > +"5" && void +"0" !== arguments[5]) || arguments[5];this.storedStates=[];this.progress="0" << 0;this.breakProgress=+"0";this.endingAnimation=!("1" - 0);this.state=j4.I6("18" << 0);("0" << 64,wt.bh)().dispatch(j4.I6(+"159"),{'\u006e\u0065\u0077\u0053\u0074\u0061\u0074\u0065':j4.O_(+"18")});this.isIE=!!(+"0",wt.bh)().state.workspace.userAgentInfo.browser.msie;this.blocked=!("1" >> 64);this.bookState=G0;this.lastDirection=null;this.postPager=!("1" ^ 0);this.parentVm=s9;this.contentCreator=c1;this.bookContainer=s9.$root.$el.querySelector(j4.O_("191" - 0));this.bookBlock=null;this.transformMethod=Pe.prefixed(j4.O_(+"100"));this.transitionMethod=Pe.prefixed(j4.I6(+"161"));this.transformOriginMethod=Pe.prefixed(j4.I6("38" | 32));this.gradientPrefix=j4.I6(132) + Re.lowercase + j4.I6(+"31");this.globalWrapper=h3;this.activeStripe=j4.I6(+"108");this.genDOM();this.setBookSize(X1);this.setSpeedRate();this.preWrapper=Xt(this.bookState.getState(),this.bookState,this.bookDiv,!+"1","2" | 0,!+"1",this.parentVm,this.contentCreator);this.leftWrapper=Xt(this.bookState.getState(),this.bookState,this.bookDiv,!+"1",3,!+"1",this.parentVm,this.contentCreator);this.rightWrapper=Xt(this.bookState.getState(),this.bookState,this.bookDiv,!+"0",3,!+"1",this.parentVm,this.contentCreator);this.nxtWrapper=Xt(this.bookState.getState(),this.bookState,this.bookDiv,!("0" | 0),+"2",!1,this.parentVm,this.contentCreator);b0 && this.initDOMEvents();this.initInnerEvents();requestAnimationFrame(this.animationLoop.bind(this));}Ee.prototype._skipStripeMouseMove=function(N0,Y5){r7HCT.Z8();var e2;if(!N0 || +"1" === N0.buttons)return !("0" >> 64);if(!De)return !+"0";e2="1" >> 64;Date.now() - Ae > 300?(Ae=Date.now(),He=N0.clientX):e2=Math.abs(N0.clientX - He) / (Date.now() - Ae);return !Y5 && e2 > +".2";};Ee.prototype.onStripeMouseMove=function(s1,U7,y$){var t7=r7HCT;var c_,k9,A7,M9;if((We=s1,Be=U7,!this._skipStripeMouseMove(U7,y$))){this.set(t7.O_("193" >> 0),s1);c_=this.bookBlock.getBoundingClientRect();if(this.bookState.singleMode && this.bookState.rtl)this.stripeDiv.style.left=U7.clientX - c_.left + ("3" << 64) + t7.O_(+"11");else if(this.bookState.singleMode)this.stripeDiv.style.left=U7.clientX - c_.width / 2 - c_.left + +"3" + t7.I6(+"11");else if(t7.O_("54" | 36) === s1){k9=this.bookContainer.getBoundingClientRect().left;this.stripeDiv.style.left=(U7.clientX - ("33" - 0) >= k9 + +"3"?U7.clientX - c_.left - +"33":k9 - c_.left + 3) + t7.O_("11" ^ 0);}else {A7=this.stripeDiv.clientWidth;M9=this.bookContainer.getBoundingClientRect().right;this.stripeDiv.style.left=(U7.clientX + +"3" <= M9 - +"3" - A7?U7.clientX - c_.left + ("3" ^ 0):M9 - c_.left - ("3" | 2) - A7) + t7.O_(+"11");}this.stripeDiv.style.top=U7.clientY - c_.top - 33 + t7.O_(11);this.stripeDiv.innerText=(+"0",wt.bh)().getters[t7.I6(12)](this.calcPage(U7));}};Ee.prototype.onStripeMouseUp=function(P2,V0){r7HCT.Y4();this.onStripeMouseMove(P2,V0,!+"0");};Ee.prototype.onStripeBlockClick=function(i0){var T_=r7HCT;T_.Z8();var u3,i9;u3=this;if(!this.bookState.isMobile && (i0.stopPropagation(),i0.preventDefault(),T_.I6(108) !== this.activeStripe)){i9=this.calcPage(i0,!("0" ^ 0));(0,wt.bh)().dispatch(T_.O_(143),{'\u0070\u0061\u0067\u0065\u0049\u006e\u0064\u0065\u0078':i9,'\u0074\u0061\u0072\u0067\u0065\u0074':T_.O_(+"154")});this.stripeDiv.innerText=("0" ^ 0,wt.bh)().getters[T_.I6(+"12")](this.calcPage(i0));setTimeout(function(){return u3.stripeDiv.innerText=(+"0",wt.bh)().getters[T_.O_(+"12")](u3.calcPage(i0));},+"50");}};Ee.prototype.onChangeActiveStripe=function(i2){var F4=r7HCT;F4.I6("108" | 44) !== i2?(this.stripeDiv.style.display=F4.O_("194" | 64),this.stripeCanvas.style.cursor=F4.I6("91" >> 0)):(this.stripeDiv.style.display=F4.O_("129" - 0),this.stripeCanvas.style.cursor=F4.O_("80" * 1));};Ee.prototype.initDOMEvents=function(){var P6=r7HCT;this.moveFlag=!+"1";document.addEventListener(P6.O_(+"57"),this.touchMovePrevent,{'\u0070\u0061\u0073\u0073\u0069\u0076\u0065':!("1" << 32)});this.bookDiv.ontouchmove=this.touchMovePrevent;this.bookState.isMobile || (this.leftStripeBlock.addEventListener(P6.O_("160" - 0),this.onStripeMouseOver.bind(this,P6.I6("54" - 0))),this.rightStripeBlock.addEventListener(P6.I6(+"160"),this.onStripeMouseOver.bind(this,P6.O_(99))),this.leftStripeBlock.addEventListener(P6.I6(+"56"),this.onStripeMouseOut.bind(this)),this.rightStripeBlock.addEventListener(P6.O_("56" >> 0),this.onStripeMouseOut.bind(this)),this.leftStripeBlock.addEventListener(P6.O_("65" >> 64),this.onStripeMouseMove.bind(this,P6.O_("54" | 32))),this.rightStripeBlock.addEventListener(P6.I6("65" << 64),this.onStripeMouseMove.bind(this,P6.I6("99" ^ 0))),this.leftStripeBlock.addEventListener(P6.O_(175),this.onStripeMouseUp.bind(this,P6.O_("54" * 1))),this.rightStripeBlock.addEventListener(P6.I6("175" ^ 0),this.onStripeMouseUp.bind(this,P6.O_(99))),this.leftStripeBlock.addEventListener(P6.O_("177" | 0),this.onStripeBlockClick.bind(this)),this.rightStripeBlock.addEventListener(P6.I6(+"177"),this.onStripeBlockClick.bind(this)),this.on(P6.I6(+"126"),this.onChangeActiveStripe),this.stripeDiv=document.createElement(P6.O_(+"82")),this.globalWrapper.appendChild(this.stripeDiv),this.stripeDiv.style.position=P6.I6("133" ^ 0),this.stripeDiv.style.zIndex=P6.O_(+"88"),this.stripeDiv.style.padding=P6.O_("14" * 1),this.stripeDiv.style.fontSize=P6.I6(+"136"),this.stripeDiv.style.lineHeight=P6.I6("110" >> 32),this.stripeDiv.style.height=P6.O_("110" << 32),this.stripeDiv.style.textAlign=P6.I6(+"152"),this.stripeDiv.style.borderRadius=P6.I6(+"86"),this.stripeDiv.style.backgroundColor=P6.I6(+"67"),this.stripeDiv.style.color=P6.I6("138" | 2),this.stripeDiv.style.display=P6.I6(+"129"),this.bookBlock=this.parentVm.$root.$el.querySelector(P6.O_(+"72")));this.bookDivEventEmiter=new (ze())(this.bookDiv,{});this.bookDivEventEmiter.get(P6.O_(89)).set({'\u0064\u0069\u0072\u0065\u0063\u0074\u0069\u006f\u006e':ze().DIRECTION_ALL});this.bookDivEventEmiter.get(P6.I6(+"106")).set({'\u0064\u0069\u0072\u0065\u0063\u0074\u0069\u006f\u006e':ze().DIRECTION_ALL});this.bookDivEventEmiter.on(P6.I6("70" * 1),this.onPanMove.bind(this));this.bookDivEventEmiter.on(P6.I6(+"68"),this.onPanCancel.bind(this));this.bookDivEventEmiter.on(P6.O_(+"118"),this.onPanCancel.bind(this));this.bookState.isMobile?this.bookDivEventEmiter.on(P6.I6("106" * 1),this.onSwipe.bind(this)):this.bookDivEventEmiter.on(P6.I6(46),this.onPanStart.bind(this));};Ee.prototype.removeDOMEvents=function(){document.removeEventListener(r7HCT.I6(+"57"),this.touchMovePrevent,{'\u0070\u0061\u0073\u0073\u0069\u0076\u0065':!1});this.bookDiv.ontouchmove=null;this.bookState.isMobile || this.off(r7HCT.O_("126" >> 64),this.onChangeActiveStripe);this.bookDivEventEmiter.destroy();};Ee.prototype.initPoints=function(y5){var j9S=r7HCT;var P8,u_,A6,x0,I4,M1;P8=this.pageWidth;u_=this.pageHeight;A6=this.bookWidth;x0=this.bookHeight;I4=this.bookMarginTop;M1=this.bookMarginLeft;switch((this.innerRadius=P8,this.outerRadius=+"1" * (Math.sqrt(P8 * P8 + u_ * u_) - .5).toFixed("0" - 0),this.startPoint)){case j9S.O_("141" ^ 0):(this.spineTop=new Ze(P8 + M1,0 + I4),this.spineCenter=new Ze(P8 + M1,u_ / ("2" - 0) + I4),this.spineBottom=new Ze(P8 + M1,u_ + I4),this.edgeBottom=new Ze(A6 + M1,x0 + I4));break;case j9S.I6("167" | 34):(this.spineBottom=new Ze(P8 + M1,("0" ^ 0) + I4),this.spineCenter=new Ze(P8 + M1,u_ / +"2" + I4),this.spineTop=new Ze(P8 + M1,u_ + I4),this.edgeBottom=new Ze(A6 + M1,+"0" + I4));break;case j9S.I6("121" - 0):(this.spineTop=new Ze(P8 + M1,+"0" + I4),this.spineCenter=new Ze(P8 + M1,u_ / 2 + I4),this.spineBottom=new Ze(P8 + M1,u_ + I4),this.edgeBottom=new Ze(M1 - 1,x0 + I4));break;case j9S.I6("101" << 0):(this.spineBottom=new Ze(P8 + M1,("0" >> 0) + I4),this.spineCenter=new Ze(P8 + M1,u_ / 2 + I4),this.spineTop=new Ze(P8 + M1,u_ + I4),this.edgeBottom=new Ze(M1 - "1" * 1,I4));}this.radius1=new Ze(+"0","0" ^ 0);this.radius2=new Ze("0" - 0,0);this.corner=new Ze("0" * 1,+"0");j9S.Y4();this.follow=new Ze("0" ^ 0,"0" ^ 0);this.middle={};this.renderData={};this.deltaFromCorner=Math.abs(this.edgeBottom.y - y5.pageY);this.deltaFromCorner > ".15" * 1 * this.bookHeight?this.deltaFromCorner=j9S.O_("101" - 0) === this.startPoint || j9S.O_(167) === this.startPoint?+".95" * -this.deltaFromCorner:+".95" * this.deltaFromCorner:this.deltaFromCorner="0" * 1;};Ee.prototype.toggleCorner=function(J0){var p7x=r7HCT;var g6;g6=this.bookHeight - Math.abs(this.deltaFromCorner);-("1" | 1) !== this.startPoint.indexOf(p7x.O_("48" - 0))?(this.startPoint=this.startPoint.replace(p7x.O_(+"48"),p7x.I6("52" >> 0)),this.startY=this.bookMarginTop + this.bookHeight):(this.startPoint=this.startPoint.replace(p7x.O_("52" - 0),p7x.I6(+"48")),this.startY=this.bookMarginTop);this.initPoints(J0);this.deltaFromCorner=this.deltaFromCorner < +"0"?-g6:g6;this.initOnceSizes();this.render(J0,!("1" - 0),!("0" >> 32));};Ee.prototype.startRender=function(l4,a9,b9){var Y6c=r7HCT;var w6,l3,c9,o5,T4,G2,i7,I7,B0,g5,f6;c9=arguments.length > +"3" && void +"0" !== arguments[+"3"] && arguments["3" >> 64];o5=l4.pageX - this.bookMarginLeft;T4=l4.pageY - this.bookMarginTop;if((b9=b9 || !1,o5 > this.pageWidth && Y6c.I6("54" * 1) !== b9 || Y6c.I6("99" ^ 0) === b9)){if((w6=Y6c.I6("99" - 0),this.currentWrapper=Y6c.I6(+"30"),this.bookState.right.isNull || this.bookState.right.isLast)){if(!(0,wt.bh)().state.pager.forceFlip)return void (this.state=Y6c.O_("18" * 1));(+"0",wt.bh)().dispatch(Y6c.I6("208" * 1),{'\u0066\u006f\u0072\u0063\u0065\u0046\u006c\u0069\u0070':!("1" | 0)});}this.bookState.right.isLastSheet && (this.innerReflexBottom.style.display=Y6c.O_(+"129"));this.startX=this.bookMarginLeft + this.bookWidth - +"3";}else {if((w6=Y6c.O_("54" * 1),this.currentWrapper=Y6c.I6("9" >> 32),this.bookState.left.isNull || this.bookState.rtl && this.bookState.left.isFirst)){if(!("0" << 32,wt.bh)().state.pager.forceFlip)return void (this.state=Y6c.O_("18" ^ 0));(0,wt.bh)().dispatch(Y6c.I6(208),{'\u0066\u006f\u0072\u0063\u0065\u0046\u006c\u0069\u0070':!+"1"});}this.bookState.left.isFirstSheet && (this.innerReflexBottom.style.display=Y6c.I6(129));this.startX=this.bookMarginLeft + +"3";}if(((-("1" ^ 0) === this.leftWrapper.secondPageNum && this.bookState.left.isLast || -+"1" === this.rightWrapper.firstPageNum && this.bookState.right.isFirst || ("2" | 2) === this.bookState.pagesCount) && tt.Z.addClass(this.globalWrapper,Y6c.I6(+"73")),Y6c.I6("43" << 32) !== this[this.currentWrapper].type)){T4 > this.bookHeight / 2?(l3=Y6c.I6(52),this.startY=this.bookMarginTop + this.bookHeight):(l3=Y6c.I6("48" - 0),this.startY=this.bookMarginTop);this.startPoint=l3 + w6;this.initPoints(l4);G2=l4.pageX - this.startX;i7=l4.pageY - this.startY;this.initOnceSizes();this.bookState.singleMode || !this.bookState.left.isFirstSheet && !this.bookState.right.isLastSheet || this[this.currentWrapper].reflexMask && (this[this.currentWrapper].reflexMask.style.overflow=Y6c.O_(139));I7={'\u0070\u0061\u0067\u0065\u0058':this.startX,'\u0070\u0061\u0067\u0065\u0059':this.startY - this.deltaFromCorner};B0={'\u0070\u0061\u0067\u0065\u0058':this.startX + G2,'\u0070\u0061\u0067\u0065\u0059':this.startY - this.deltaFromCorner + (i7 + this.deltaFromCorner)};this.render(I7);g5=this;this.trigger(Y6c.O_(+"4"),{'\u0064\u0072\u0061\u0067':c9,'\u0068\u0069\u0064\u0065':c9 && (this.bookState.left.isFirstSheet || this.bookState.right.isLastSheet)?w6:Y6c.O_(108)});f6=function(){a9?g5.render(B0):g5.tween=new (at().Tween)(I7).to(B0,+"50").easing(at().Easing.Sinusoidal.Out).onUpdate(function(){Y6c.Y4();g5.render(I7);}).start();};this.tween && this.tween._isPlaying?g5.tween.onStop(function(){Y6c.Z8();f6();}).stop():f6();tt.Z.addClass(this[this.currentWrapper].mask,Y6c.I6("218" - 0));(0,wt.bh)().dispatch(Y6c.I6(159),{'\u006e\u0065\u0077\u0053\u0074\u0061\u0074\u0065':Y6c.I6("178" * 1)});this.state=Y6c.I6("178" | 2);this[this.currentWrapper].mask.style.top=-this.maskTop + Y6c.I6("11" - 0);}else this.startRenderHard(l4,c9,b9);};Ee.prototype.render=function(Q_,l$,I1){var s7W=r7HCT;s7W.Z8();var Z1,x3,a3,j7,X7,C4,D4,M5,L2,A4,p$,g7,v9,N2,B5,b5,O4,o2,b1,S0,b6,q4,i4,m_,P7,w2,W2,F6,x5,r2,i6,c3,q8,u1,N9,F$,o_,w9,O3,S2,i8,m0,A3,f8,t8,G$,s8,o3,R2,C2,k5,O6,r6,Y2,y4,E_,r0,p3,J3,z8,o$,s4,l0,u0,h4,c8,s5,V2,D3,j5;if(!this.destroyed){A4=this.renderData;l$=l$ || !1;p$=Q_.pageX;g7=Q_.pageY;v9=this.deltaFromCorner;N2=this.edgeBottom.x;B5=this.edgeBottom.y;b5=this.spineBottom.x;O4=this.spineBottom.y;o2=this.spineTop.x;b1=this.spineTop.y;S0=this.outerRadius;b6=this.bookWidth;q4=this.bookHeight;i4=this.maskWidth;m_=this.maskTop;P7=this.pageWidth;w2=this.gradientPrefix;W2=this.innerReflexBottomWidth;F6=this.flipGradientWidth;x5=this.innerReflexWidth;r2=this.startPoint;i6=this.transformMethod;c3=this.currentWrapper;q8=this.innerRadius;if(0 !== v9){u1=Math.atan((B5 - v9 - g7) / (N2 - p$));u1 !== +u1 && (u1=+"0");Z1=p$ + -v9 * Math.sin(+"2" * u1);x3=g7 + v9 * Math.cos(("2" >> 64) * u1);}else (Z1=p$,x3=g7);N9=b5 - Z1;F$=O4 - x3;o_=Math.atan2(F$,N9);w9=b5 - Math.cos(o_) * q8;O3=O4 - Math.sin(o_) * q8;Math.sqrt(F$ * F$ + N9 * N9) > q8?(a3=w9 - (".5" - 0),j7=O3 - (".5" - 0)):(a3=Z1,j7=x3);N9=o2 - a3;F$=b1 - j7;o_=Math.atan2(F$,N9);S2=o2 - Math.cos(o_) * S0;i8=b1 - Math.sin(o_) * S0;if((Math.sqrt(N9 * N9 + F$ * F$) > S0 && (a3=S2 - +".5",j7=i8 - ".5" * 1),("0" | 0) !== v9 && !I1)){if(a3 <= N2 + ("2" >> 0) && -("1" << 0) !== r2.indexOf(s7W.I6(54)))return void this.toggleCorner(Q_);if(a3 >= N2 - +"2" && -+"1" !== r2.indexOf(s7W.O_(+"99")))return void this.toggleCorner(Q_);}m0=a3 + +".5" * (N2 - a3);A3=j7 + .5 * (B5 - j7);Math.abs(A3 - B5) >= "1" - 0 || Math.abs(m0 - N2) >= +"1"?(X7=Math.atan((A3 - B5) / (m0 - N2)),M5=Math.sqrt((N2 - a3) * (N2 - a3) + (B5 - j7) * (B5 - j7)) / 2,C4=N2 - m0,D4=B5 - A3):(X7=+"0",M5=+"0",C4=+"0",D4="0" * 1);X7 !== +X7 && (X7=+"0");f8=Math.abs(C4 / P7);L2=+"0" === f8?0:f8 > ".8" - 0?+"5" * (("1" ^ 0) - f8):+"1";X7=tt.Z.round(X7,5);t8=(f8 > +".9"?+".35":-+".35") * window.devicePixelRatio;G$=b6 > ("1300" | 20)?("2" >> 0) * t8:t8;if((s7W.O_("141" | 4) === r2 || s7W.I6("167" - 0) === r2?(A4.reversePageTransform=s7W.O_(+"137") + (i4 - M5 + G$) + s7W.O_("206" * 1) + m_ + s7W.O_(63) + X7 + s7W.I6("115" * 1),A4.maskTransform=s7W.O_(+"137") + (-C4 + t8) + s7W.I6(+"206") + -D4 + s7W.I6("63" ^ 0) + X7 + s7W.O_(+"115"),A4.frontPageTransform=s7W.O_(+"137") + (i4 - P7 + M5) + s7W.O_(+"206") + m_ + s7W.I6(+"63") + -X7 + s7W.I6("115" << 32)):(A4.reversePageTransform=s7W.O_(137) + (-P7 + M5 - G$) + s7W.I6(206) + m_ + s7W.I6(+"63") + X7 + s7W.O_(115),A4.maskTransform=s7W.I6(137) + (-C4 - t8) + s7W.O_(+"206") + -D4 + s7W.I6("63" << 0) + X7 + s7W.O_(+"115"),A4.frontPageTransform=s7W.I6(137) + -M5 + s7W.O_("206" - 0) + m_ + s7W.I6(+"63") + -X7 + s7W.O_(+"115")),+"0" !== L2)){if(s7W.I6(+"141") === r2){s8=M5 / Math.cos(X7);o3=Math.tan(X7) * q4;R2=o3 < "0" * 1?s8 - o3:M5;o3 < "0" << 0 && (R2=Math.cos(X7) * R2);A4.flipGradientBackground=w2 + s7W.O_(+"131") + +".45" * L2 + s7W.I6("25" - 0) + +".15" * L2 + s7W.O_(190) + +".01" * R2 + s7W.I6(+"199") + ".45" * 1 * L2 + s7W.O_("190" ^ 0) + +".055" * R2 + s7W.I6(+"105") + ".65" * 1 * L2 * (".32" * 1) + s7W.I6("190" * 1) + +".185" * R2 + s7W.O_(170) + R2 + s7W.I6("150" - 0);A4.flipGradientTransform=s7W.I6("137" << 32) + (s8 - F6) + s7W.I6(37) + -X7 + s7W.I6(+"115");C2=Math.tan(X7) * D4;k5=N2 - p$;k5=k5 < .03 * b6?(".03" - 0) * b6:k5 > (".3" - 0) * b6?".3" * 1 * b6:k5;A4.innerReflexBottomBackground=w2 + s7W.O_("95" << 64) + +".45" * L2 + s7W.I6("109" ^ 0) + k5 + s7W.O_(+"150");A4.innerReflexBottomTransform=s7W.O_(137) + (b6 - C4 - C2) + s7W.O_(+"37") + X7 + s7W.O_("115" >> 0);O6=k5 * (.45 + f8 / 2);A4.innerReflexBackground=w2 + s7W.I6("107" | 40) + (".1" * 1 + "1.6" * 1 * f8 * +".4") + s7W.I6(109) + O6 + s7W.I6(150);A4.innerReflexTransform=s7W.I6("137" - 0) + (b6 - C4 - C2 - x5) + s7W.O_(+"37") + X7 + s7W.I6(115);A4.reflexContainerTransform=s7W.O_("137" | 1) + (i4 - b6 + M5) + s7W.I6(+"206") + m_ + s7W.O_("63" - 0) + -X7 + s7W.I6(+"115");}else if(s7W.I6(+"167") === r2){r6=M5 / Math.cos(X7);Y2=Math.tan(X7) * q4;y4=Y2 > +"0"?r6 + Y2:M5;Y2 > +"0" && (y4=Math.cos(X7) * y4);A4.flipGradientBackground=w2 + s7W.I6(+"131") + +".45" * L2 + s7W.O_(+"25") + ".15" * 1 * L2 + s7W.I6("190" - 0) + +".01" * y4 + s7W.I6("199" << 32) + .45 * L2 + s7W.O_("190" * 1) + .055 * y4 + s7W.O_(+"105") + +".65" * L2 * +".32" + s7W.O_(+"190") + +".185" * y4 + s7W.O_(+"170") + y4 + s7W.I6(+"150");A4.flipGradientTransform=s7W.O_(+"137") + (r6 - F6) + s7W.O_(+"37") + -X7 + s7W.I6(115);E_=Math.tan(X7) * D4;r0=N2 - p$;r0=r0 < +".03" * b6?+".03" * b6:r0 > ".3" * 1 * b6?(".3" - 0) * b6:r0;A4.innerReflexBottomBackground=w2 + s7W.O_("95" - 0) + +".45" * L2 + s7W.O_("109" << 0) + r0 + s7W.O_(+"150");A4.innerReflexBottomTransform=s7W.O_("137" >> 32) + (b6 - C4 - E_) + s7W.O_("37" ^ 0) + X7 + s7W.O_("115" << 32);p3=r0 * (.45 + f8 / ("2" | 0));A4.innerReflexBackground=w2 + s7W.I6("107" * 1) + (".1" * 1 + +"1.6" * f8 * (".4" * 1)) + s7W.O_("109" << 64) + p3 + s7W.O_(+"150");A4.innerReflexTransform=s7W.O_("137" * 1) + (b6 - C4 - x5 - E_) + s7W.O_(37) + X7 + s7W.I6("115" | 64);A4.reflexContainerTransform=s7W.I6(+"137") + (i4 - b6 + M5) + s7W.O_(206) + m_ + s7W.I6("63" * 1) + -X7 + s7W.O_("115" ^ 0);}else if(s7W.O_(+"121") === r2){J3=M5 / Math.cos(X7);z8=Math.tan(X7) * q4;o$=z8 > ("0" | 0)?J3 + z8:M5;z8 > ("0" | 0) && (o$=Math.cos(X7) * o$);A4.flipGradientBackground=w2 + s7W.I6(+"29") + (".45" - 0) * L2 + s7W.O_(+"25") + +".15" * L2 + s7W.I6(+"190") + (".01" - 0) * o$ + s7W.I6(+"199") + +".45" * L2 + s7W.I6(190) + (".055" - 0) * o$ + s7W.I6("105" << 32) + (".65" - 0) * L2 * (".32" - 0) + s7W.I6("190" << 64) + (".185" - 0) * o$ + s7W.I6("170" << 0) + o$ + s7W.O_(+"150");A4.flipGradientTransform=s7W.I6(+"137") + (P7 - J3) + s7W.I6("37" >> 64) + -X7 + s7W.O_("115" - 0);s4=p$ - N2;s4=s4 < (".03" - 0) * b6?".03" * 1 * b6:s4 > .3 * b6?.3 * b6:s4;A4.innerReflexBottomBackground=w2 + s7W.O_("107" | 2) + +".45" * L2 + s7W.I6("109" >> 0) + s4 + s7W.O_(+"150");A4.innerReflexBottomTransform=s7W.O_(+"137") + (J3 - W2) + s7W.I6("37" ^ 0) + X7 + s7W.O_(+"115");l0=s4 * (+".45" + f8 / ("2" * 1));A4.innerReflexBackground=w2 + s7W.O_("95" * 1) + (+".1" + 1.6 * f8 * .4) + s7W.I6(109) + l0 + s7W.O_("150" | 0);A4.innerReflexTransform=s7W.I6(+"137") + J3 + s7W.I6("37" - 0) + X7 + s7W.O_(115);A4.reflexContainerTransform=s7W.I6(+"137") + -M5 + s7W.O_("206" << 64) + m_ + s7W.I6("63" * 1) + -X7 + s7W.O_(+"115");}else {u0=M5 / Math.cos(X7);h4=Math.tan(X7) * q4;c8=h4 < ("0" | 0)?u0 - h4:M5;h4 < 0 && (c8=Math.cos(X7) * c8);A4.flipGradientBackground=w2 + s7W.O_("29" >> 32) + .45 * L2 + s7W.I6("25" << 64) + +".15" * L2 + s7W.I6("190" ^ 0) + +".01" * c8 + s7W.O_(+"199") + ".45" * 1 * L2 + s7W.I6(190) + +".055" * c8 + s7W.I6(+"105") + ".65" * 1 * L2 * +".32" + s7W.I6(+"190") + +".185" * c8 + s7W.I6("170" * 1) + c8 + s7W.O_(+"150");A4.flipGradientTransform=s7W.O_("137" ^ 0) + (P7 - u0) + s7W.O_("37" ^ 0) + -X7 + s7W.I6(115);s5=p$ - N2;s5=s5 < (".03" - 0) * b6?".03" * 1 * b6:s5 > +".3" * b6?+".3" * b6:s5;A4.innerReflexBottomBackground=w2 + s7W.I6("107" ^ 0) + .45 * L2 + s7W.I6("109" ^ 0) + s5 + s7W.I6("150" >> 64);A4.innerReflexBottomTransform=s7W.I6(+"137") + (u0 - W2) + s7W.I6("37" - 0) + X7 + s7W.O_(+"115");V2=s5 * (".45" * 1 + f8 / +"2");A4.innerReflexBackground=w2 + s7W.O_("95" << 0) + (+".1" + "1.6" * 1 * f8 * +".4") + s7W.I6("109" | 69) + V2 + s7W.O_("150" - 0);A4.innerReflexTransform=s7W.I6(+"137") + u0 + s7W.O_("37" - 0) + X7 + s7W.I6(+"115");A4.reflexContainerTransform=s7W.O_("137" * 1) + -M5 + s7W.I6(+"206") + m_ + s7W.I6(63) + -X7 + s7W.O_(+"115");}}else A4.innerReflexBottomTransform=s7W.I6(+"10");if((this[c3].reversePage.style[i6]=A4.reversePageTransform,this[c3].mask.style[i6]=A4.maskTransform,this[c3].frontPage.style[i6]=A4.frontPageTransform,this[c3].flipGradient.style.background=A4.flipGradientBackground,this[c3].flipGradient.style[i6]=A4.flipGradientTransform,l$ || this.bookState.isMobile?this.innerReflexBottom.style.display=s7W.I6("129" - 0):(this.innerReflexBottom.style.background=A4.innerReflexBottomBackground,this.innerReflexBottom.style[i6]=A4.innerReflexBottomTransform,this[c3].innerReflex.style.background=A4.innerReflexBackground,this[c3].innerReflex.style[i6]=A4.innerReflexTransform,this[c3].innerReflex.style.display=0 === L2?s7W.O_(+"129"):s7W.O_("108" - 0)),this.bookState.singleMode)){if(-+"1" !== r2.indexOf(this.bookState.rtl?s7W.O_(+"54"):s7W.O_(+"99"))){D3=f8 < ".85" * 1?+"1":("1" << 0) - Math.pow((f8 - (".85" - 0)) / (".15" * 1),+"2");D3=D3 <= 0?+"0":D3;this[c3].frontPage.style.opacity=D3;this[c3].reversePage.style.opacity=D3;this[c3].innerReflex.style.opacity=D3;this.innerReflexBottom.style.opacity=1;}if(-("1" * 1) !== r2.indexOf(this.bookState.rtl?s7W.O_(+"99"):s7W.I6(+"54"))){j5=f8 > +".7"?+"1":Math.pow(f8 / +".7",2);j5=j5 <= +"0"?"0" >> 96:j5;this[c3].frontPage.style.opacity=f8 > +".3"?Math.pow((f8 - +".3") / .7,+"2"):+"0";this[c3].reversePage.style.opacity=j5;this[c3].innerReflex.style.opacity=j5;this.innerReflexBottom.style.opacity=+"0";}}this[c3].reflexContainer.style[i6]=A4.reflexContainerTransform;this.follow=new Ze(Z1,x3);this.corner=new Ze(a3,j7);this.radius1=new Ze(w9,O3);this.radius2=new Ze(S2,i8);this.progress=f8;this.renderData=A4;this.middle={'\u0078':m0,'\u0079':A3,'\u0064\u0069\u0073\u0074':M5,'\u0061\u006c\u0066\u0061':X7,'\u0064\u0069\u0073\u0074\u0058':C4,'\u0064\u0069\u0073\u0074\u0059':D4};(this.bookState.left.isFirstSheet && -("1" | 0) !== r2.indexOf(s7W.O_("54" - 0)) || this.bookState.left.isLast || this.bookState.right.isFirst || this.bookState.right.isLastSheet && -("1" ^ 0) !== r2.indexOf(s7W.O_("99" >> 0)) || Q_.fakePointer && this.bookState.left.isFirstSheet || Q_.fakePointer && this.bookState.right.isLastSheet) && this.setDynamicStyles(!0);}};Ee.prototype.finishRender=function(x$,h2,F3,N7){var o5Q=r7HCT;var R$,Q9,x1,A0,Q2,T1,E3;if((x$=x$ || !1,this.postPager=!("1" | 0),!this.destroyed))if(o5Q.O_(+"43") !== this[this.currentWrapper].type){R$=o5Q.I6(+"74") === this.bookState.version && this.bookState.singleMode?".25" * 1:+".5";Q9=this.progress < R$?this.corner.x - this.startX:o5Q.O_(+"141") === this.startPoint || o5Q.I6(+"167") === this.startPoint?this.corner.x - this.startX + this.bookWidth:this.corner.x - this.startX - this.bookWidth;o5Q.I6("99" - 0) === h2?(this.progress=".9" * 1,Q9=this.corner.x - this.startX - this.bookWidth):o5Q.I6(+"54") === h2 && (this.progress=+".9",Q9=this.corner.x - this.startX + this.bookWidth);x1=this.corner.y - this.startY;A0=this.corner.x;Q2=this.corner.y;T1=this;this.deltaFromCorner=+"0";E3=function(){var r3,o9;r3={'\u0070\u0061\u0067\u0065\u0058':A0,'\u0070\u0061\u0067\u0065\u0059':Q2};o9=function(){T1.render({'\u0070\u0061\u0067\u0065\u0058':A0 - Q9,'\u0070\u0061\u0067\u0065\u0059':Q2 - x1},!("0" << 32));o5Q.Z8();T1.destroyed || (T1.progress > R$ && (o5Q.O_("141" | 9) === T1.startPoint || o5Q.I6(+"167") === T1.startPoint?T1[T1.currentWrapper].setLeft():T1[T1.currentWrapper].setRight()),tt.Z.removeClass(T1[T1.currentWrapper].mask,o5Q.O_(+"218")),T1.state=o5Q.O_(+"18"),("0" >> 0,wt.bh)().dispatch(o5Q.O_(159),{'\u006e\u0065\u0077\u0053\u0074\u0061\u0074\u0065':o5Q.O_("18" * 1)}),T1[T1.currentWrapper].mask.style.top=o5Q.O_(69),T1[T1.currentWrapper].mask.style[T1.transformMethod]=o5Q.O_(108),T1[T1.currentWrapper].frontPage.style[T1.transformMethod]=o5Q.O_("108" << 64),T1[T1.currentWrapper].reversePage.style[T1.transformMethod]=o5Q.I6(113),T1.innerReflexBottom.style[T1.transformMethod]=o5Q.O_(+"164"),T1.innerReflexBottom.style.display=o5Q.I6("108" | 72),T1[T1.currentWrapper].reflexMask && (T1[T1.currentWrapper].reflexMask.style.overflow=o5Q.I6(+"108")),T1.progress > R$ && !F3 && (o5Q.O_(+"141") === T1.startPoint || o5Q.O_(+"167") === T1.startPoint?T1.trigger(o5Q.O_(+"42")):T1.trigger(o5Q.I6("98" >> 0))),F3?T1.trigger(o5Q.I6(+"119"),N7):T1.trigger(o5Q.I6("114" ^ 0),N7),T1.progress > R$ && F3 && (o5Q.I6(+"141") === T1.startPoint || o5Q.O_("167" ^ 0) === T1.startPoint?T1.trigger(o5Q.O_(+"1")):T1.trigger(o5Q.O_(21))),tt.Z.removeClass(T1.globalWrapper,o5Q.O_(73)),T1.progress=+"1");};x$?o9():T1.tween=new (at().Tween)(r3).to({'\u0070\u0061\u0067\u0065\u0058':A0 - Q9,'\u0070\u0061\u0067\u0065\u0059':Q2 - x1},+"350").easing(at().Easing.Sinusoidal.Out).onUpdate(function(){o5Q.Z8();x$ || T1.render(r3);}).onComplete(o9).start();};this.tween && this.tween._isPlaying?this.tween.onStop(function(){E3();}).stop():E3();}else this.finishRenderHard(x$,h2,F3,N7);};Ee.prototype.startRenderHard=function(x_,f2,g3){var t6v=r7HCT;var z5;t6v.Y4();z5=x_.pageX - this.bookMarginLeft;z5 > this.pageWidth && t6v.I6(54) !== g3 || t6v.O_("99" | 67) === g3?(this.startPoint=t6v.O_(+"167"),this.currentWrapper=t6v.O_(+"30"),this.startX=this.bookMarginLeft + this.bookWidth,this.finishX=this.bookMarginLeft):(this.startPoint=t6v.O_(+"101"),this.currentWrapper=t6v.I6("9" * 1),this.startX=this.bookMarginLeft,this.finishX=this.bookMarginLeft + this.bookWidth);this.isIE && (this[this.currentWrapper].firstPage.style[this.transformOriginMethod]=t6v.I6(+"213"),this[this.currentWrapper].secondPage.style[this.transformOriginMethod]=t6v.I6("144" ^ 0));tt.Z.addClass(this[this.currentWrapper].mask,t6v.I6("47" << 64));this.trigger(t6v.O_(+"4"),{'\u0064\u0072\u0061\u0067':f2,'\u0068\u0069\u0064\u0065':z5 > this.pageWidth?t6v.O_(+"99"):t6v.I6("54" * 1)});this.state=t6v.I6("178" ^ 0);("0" ^ 0,wt.bh)().dispatch(t6v.I6(+"159"),{'\u006e\u0065\u0077\u0053\u0074\u0061\u0074\u0065':t6v.I6("178" ^ 0)});};Ee.prototype.renderHard=function(X2){var i52=r7HCT;i52.Z8();var P4,j9,I9,J6,S3;if(!this.destroyed){I9=this.pageWidth;if((j9=(j9=(j9=i52.O_(+"167") === this.startPoint?X2.pageX - (this.bookMarginLeft + this.pageWidth):this.bookMarginLeft + this.pageWidth - X2.pageX) > this.pageWidth?this.pageWidth:j9) < -this.pageWidth?-this.pageWidth:j9,P4=Math.acos(j9 / I9),P4=i52.O_(+"167") === this.startPoint?-P4:P4,this.progress=+"1" * Math.abs(P4 / Math.PI).toFixed("2" - 0),this.pageX=X2.pageX,this.bookState.singleMode)){if(-+"1" !== this.startPoint.indexOf(this.bookState.rtl?i52.I6(+"54"):i52.O_(+"99"))){J6=this.progress < ".5" - 0?"1" << 32:+"1" - Math.pow((this.progress - +".5") / (".5" * 1),+"2");J6=J6 <= "0" >> 32?+"0":J6;this[this.currentWrapper].frontPage.style.opacity=J6;this[this.currentWrapper].reversePage.style.opacity=J6;this[this.currentWrapper].mask.style[i52.O_(+"158")]=this.progress >= ".5" - 0?i52.O_(+"129"):i52.O_(+"108");}if(-+"1" !== this.startPoint.indexOf(this.bookState.rtl?i52.I6(+"99"):i52.I6(+"54"))){S3=this.progress > +".5"?"1" ^ 0:Math.pow(this.progress / .5,+"2");S3=S3 <= +"0"?+"0":S3;this[this.currentWrapper].frontPage.style.opacity=S3;this[this.currentWrapper].reversePage.style.opacity=S3;this[this.currentWrapper].mask.style[i52.I6(+"158")]=this.progress >= +".5"?i52.O_(+"108"):i52.I6(+"129");}}this.isIE?i52.O_("167" >> 32) === this.startPoint?(this[this.currentWrapper].firstPage.style[this.transformMethod]=i52.O_("0" ^ 0) + P4 + i52.O_(+"115"),this[this.currentWrapper].secondPage.style[this.transformMethod]=i52.I6("128" >> 32) + -Le * this.pageWidth + i52.I6(+"203") + (P4 + Math.PI) + i52.O_(+"115")):(this[this.currentWrapper].firstPage.style[this.transformMethod]=i52.O_(128) + Le * this.pageWidth + i52.I6("203" * 1) + (P4 + Math.PI) + i52.I6(+"115"),this[this.currentWrapper].secondPage.style[this.transformMethod]=i52.I6(0) + P4 + i52.I6("115" ^ 0)):this[this.currentWrapper].mask.style[this.transformMethod]=i52.O_("16" >> 32) + P4 + i52.I6(+"115");this.setDynamicStyles();}};r7HCT.Z8();Ee.prototype.finishRenderHard=function(M8,p8,E7,z_){var W81=r7HCT;var w5,o7,V9,e5,Y6,e9,D6;w5=this.progress;o7={'\u0078':this.progress,'\u0070\u0061\u0067\u0065\u0058':this.pageX};V9=W81.O_(+"167") === this.startPoint && W81.I6(54) === p8 || W81.O_(+"101") === this.startPoint && W81.O_("99" >> 0) === p8;e5=w5 > +".35" && (W81.O_(+"167") === this.startPoint && this.bookState.right.isFirst || W81.O_("101" >> 0) === this.startPoint && this.bookState.left.isLast);Y6=w5 > ".5" - 0 || e5 || V9;e9=this;D6=function(){var D1;D1=function(){W81.Y4();e9.destroyed || (e9.state=W81.I6("18" >> 64),(+"0",wt.bh)().dispatch(W81.I6(+"159"),{'\u006e\u0065\u0077\u0053\u0074\u0061\u0074\u0065':W81.I6("18" ^ 0)}),tt.Z.removeClass(e9[e9.currentWrapper].mask,W81.O_("47" << 32)),e9[e9.currentWrapper].mask.style[e9.transitionMethod]=W81.O_(+"108"),e9.isIE?(e9[e9.currentWrapper].firstPage.style[e9.transformMethod]=W81.O_(108),e9[e9.currentWrapper].secondPage.style[e9.transformMethod]=W81.O_("108" ^ 0),e9[e9.currentWrapper].firstPage.style[e9.transformOriginMethod]=W81.I6("108" ^ 0),e9[e9.currentWrapper].secondPage.style[e9.transformOriginMethod]=W81.I6(+"108")):e9[e9.currentWrapper].mask.style[e9.transformMethod]=W81.O_(+"108"),Y6 && (W81.O_(167) === e9.startPoint && W81.O_(+"99") !== p8?(e9[e9.currentWrapper].setLeft(),E7 || e9.trigger(W81.I6(+"42"))):W81.I6(+"101") === e9.startPoint && W81.O_(+"54") !== p8 && (e9[e9.currentWrapper].setRight(),E7 || e9.trigger(W81.I6("98" << 64)))),E7?e9.trigger(W81.I6("119" - 0),z_):e9.trigger(W81.I6(+"114"),z_),Y6 && E7 && (W81.I6("141" << 32) === e9.startPoint || W81.I6("167" ^ 0) === e9.startPoint?e9.trigger(W81.I6(+"1")):e9.trigger(W81.O_("21" >> 64))),tt.Z.removeClass(e9.globalWrapper,W81.I6(+"73")),M8 && (e9.setDynamicStyles(),e9.progress=+"1"));};M8?D1():e9.tween=new (at().Tween)(o7).to({'\u0078':Y6?+"1":+"0",'\u0070\u0061\u0067\u0065\u0058':Y6?e9.finishX:e9.startX},500).easing(at().Easing.Sinusoidal.Out).onUpdate(function(){e9.progress=o7.x;e9.renderHard({'\u0070\u0061\u0067\u0065\u0058':o7.pageX});}).onComplete(D1).start();};this.tween && this.tween._isPlaying?this.tween.onStop(function(){W81.Z8();D6();}).stop():D6();};Ee.prototype.shiftPagesLeft=function(){var h1;this.preWrapper.destroy();this.preWrapper=this.leftWrapper.setLayer(this.leftWrapper.layer - +"1");this.leftWrapper=this.rightWrapper;this.rightWrapper=this.nxtWrapper.setLayer(this.nxtWrapper.layer + 1);h1=this.storedStates.length > ("0" ^ 0)?this.storedStates.shift():this.bookState.getState();this.nxtWrapper=Xt(h1,this.bookState,this.bookDiv,!+"0","2" >> 0,!+"1",this.parentVm,this.contentCreator);this.trigger(r7HCT.I6(207));};Ee.prototype.shiftPagesRight=function(){var R7;this.nxtWrapper.destroy();this.nxtWrapper=this.rightWrapper.setLayer(this.rightWrapper.layer - ("1" << 64));this.rightWrapper=this.leftWrapper;r7HCT.Z8();this.leftWrapper=this.preWrapper.setLayer(this.preWrapper.layer + 1);R7=this.storedStates.length > ("0" | 0)?this.storedStates.shift():this.bookState.getState();this.preWrapper=Xt(R7,this.bookState,this.bookDiv,!+"1",2,!("0" - 0),this.parentVm,this.contentCreator);this.trigger(r7HCT.O_(+"207"));};Ee.prototype.flipToLeft=function(){var J8,U6,b_,G1,c5,b2,x6,t2;r7HCT.Z8();J8=this;U6=arguments.length > +"0" && void +"0" !== arguments["0" >> 0] && arguments[+"0"];b_=arguments.length > ("1" ^ 0) && void +"0" !== arguments[+"1"] && arguments[+"1"];G1=arguments.length > +"2"?arguments[+"2"]:void +"0";if(!this.bookState.left.isLast || (+"0",wt.bh)().state.pager.forceFlip){c5=this._getBookLeftMargin();b2={'\u0070\u0061\u0067\u0065\u0058':c5 + this.bookWidth - +"1",'\u0070\u0061\u0067\u0065\u0059':this.bookMarginTop};x6={'\u0070\u0061\u0067\u0065\u0058':c5};t2=function(j$,R8){j$.pageY=J8.bookMarginTop - Math.min(J8.bookWidth,J8.bookHeight) / +"10" * (R8 > +".5"?1 - R8:R8);};this._internalFlip(U6,b_,G1,b2,x6,t2);}};Ee.prototype.flipToRight=function(){var D5,f1,U_,L3,R0,X3,V6,F_;D5=this;f1=arguments.length > 0 && void +"0" !== arguments[+"0"] && arguments[0];U_=arguments.length > ("1" | 1) && void ("0" - 0) !== arguments[1] && arguments[+"1"];L3=arguments.length > "2" >> 64?arguments["2" * 1]:void +"0";if(!this.bookState.right.isFirst || ("0" << 0,wt.bh)().state.pager.forceFlip){R0=this._getBookLeftMargin();X3={'\u0070\u0061\u0067\u0065\u0058':R0 + ("1" << 64),'\u0070\u0061\u0067\u0065\u0059':this.bookMarginTop};V6={'\u0070\u0061\u0067\u0065\u0058':R0 + this.bookWidth};F_=function(c6,R1){c6.pageY=D5.bookMarginTop - Math.min(D5.bookWidth,D5.bookHeight) / +"10" * (R1 > +".5"?"1" - 0 - R1:R1);};this._internalFlip(f1,U_,L3,X3,V6,F_);}};Ee.prototype._internalFlip=function(){var J_,g0,D8,o1,v8,o8,M4,l8,K_;g0=arguments.length > ("0" ^ 0) && void ("0" - 0) !== arguments["0" * 1] && arguments[0];D8=arguments.length > 1 && void +"0" !== arguments["1" << 32] && arguments[+"1"];o1=arguments.length > +"2"?arguments["2" << 32]:void ("0" | 0);v8=arguments.length > ("3" ^ 0)?arguments["3" << 64]:void +"0";o8=arguments.length > ("4" | 0)?arguments["4" >> 0]:void ("0" * 1);M4=arguments.length > +"5"?arguments[+"5"]:void +"0";this.storedStates.push(o1 || this.bookState.getState());l8=this;K_=function(){var g8y=r7HCT;g8y.Z8();l8.destroyed || ((+"0",wt.bh)().dispatch(g8y.O_("49" - 0),g8y.I6(174)),l8.once(g8y.O_(+"114"),function(){g8y.Y4();("0" | 0,wt.bh)().dispatch(g8y.O_(+"49"),g8y.I6("75" >> 32));}),l8.startRender(v8,!+"0"),l8.postPager=!+"0",D8?l8.finishRender(!0,null,g0):l8.tween=new (at().Tween)(v8).to(o8,+"500" / l8.speedRate).easing(at().Easing.Sinusoidal.Out).onUpdate(function(){g8y.Z8();g8y.I6(+"43") !== l8[l8.currentWrapper].type?(M4(v8,l8.progress),v8.fakePointer=!("0" ^ 0),l8.render(v8,!0)):l8.renderHard(v8,!+"0");}).onComplete(function(){l8.finishRender(!("0" | 0),null,g0);}).start());};null !== (J_=l8.tween) && void ("0" * 1) !== J_ && J_._isPlaying?l8._stopInternalFlip(K_):K_();};Ee.prototype._stopInternalFlip=function(L$){var P1v=r7HCT;var G8,g_;P1v.Y4();g_=this;null !== (G8=this.tween) && void ("0" >> 64) !== G8 && G8._isPlaying && this.tween.onStop(function(){var P1;P1=-("1" << 32) !== g_.startPoint.indexOf(P1v.I6("54" ^ 0))?P1v.I6(99):P1v.I6(54);g_.finishRender(!("0" >> 0),P1,!("0" * 1),!("0" - 0));null == L$ || L$();}).stop();};Ee.prototype._getBookLeftMargin=function(){var p2,M2,B2;p2=this.bookMarginLeft;M2=this.bookWidth;if(this.bookState.hardcover && !this.bookState.singleMode){B2=(+"0",wt.bh)().getters[r7HCT.I6("87" | 16)];p2=null === (this.bookState.rtl?B2.rightPage:B2.leftPage)?-M2 / +"2":"0" ^ 0;}return p2;};Ee.prototype.flipToPager=function(){var E6_=r7HCT;E6_.Y4();var h$,T$,T6,C3,k_,V$,e3,Q5,C6,W3;h$=this;this._stopInternalFlip();T$=!+"0";if(((+"0",wt.bh)().dispatch(E6_.I6(+"208"),{'\u0066\u006f\u0072\u0063\u0065\u0046\u006c\u0069\u0070':!0}),Math.max(this.leftWrapper.secondPageNum,this.rightWrapper.firstPageNum) > Math.max(this.bookState.currentLeft,this.bookState.currentRight) && (T$=!+"1"),T$)){-+"1" === this.leftWrapper.secondPageNum && this.bookState.left.isLast && tt.Z.addClass(this.globalWrapper,E6_.I6(+"73"));C3=null !== (T6=[this.bookState.right,this.bookState.left].filter(function(t4){E6_.Z8();return !t4.isNull;})["0" - 0]) && void ("0" >> 0) !== T6?T6:this.bookState.right;k_=this.bookState.hardcover && (C3.isLastSheet || C3.isLast);if((this.bookState.left.isLast || k_?(this.nxtWrapper.destroy(),this.nxtWrapper=Xt(this.bookState.getState(),this.bookState,this.bookDiv,!("0" * 1),"2" - 0,!("1" | 0),this.parentVm,this.contentCreator,E6_.I6("99" * 1),k_,!("0" ^ 0))):this.bookState.left.isLast || this.nxtWrapper.setContent({'\u0066\u0069\u0072\u0073\u0074':null,'\u0073\u0065\u0063\u006f\u006e\u0064':null}),this.bookState.left.isLast && this.bookState.hardcover)){V$=this.rightWrapper.firstPageNum;this.rightWrapper.destroy();this.rightWrapper=Xt(this.bookState.getState(),this.bookState,this.bookDiv,!("1" * 1),+"3",!("1" << 96),this.parentVm,this.contentCreator,E6_.O_("54" ^ 0));this.rightWrapper.setRight();this.rightWrapper.setContent({'\u0066\u0069\u0072\u0073\u0074':V$});}else this.bookState.singleMode?this.bookState.singleMode && this.bookState.rtl && this.rightWrapper.setContent({'\u0066\u0069\u0072\u0073\u0074':null,'\u0073\u0065\u0063\u006f\u006e\u0064':null}):this.rightWrapper.setContent({'\u0073\u0065\u0063\u006f\u006e\u0064':null});this.once(E6_.O_("114" - 0),function(){tt.Z.removeClass(h$.globalWrapper,E6_.O_(73));h$.resetWrappers();},this);this.nxtWrapper.contentObject1.setPageBg(this.bookState.currentRight);this.rightWrapper.contentObject2.setPageBg(this.bookState.currentLeft);this.flipToLeft();}else {-1 === this.rightWrapper.firstPageNum && this.bookState.right.isFirst && tt.Z.addClass(this.globalWrapper,E6_.O_("73" - 0));Q5=null !== (e3=[this.bookState.left,this.bookState.right].filter(function(p7){E6_.Y4();return !p7.isNull;})[+"0"]) && void +"0" !== e3?e3:this.bookState.left;C6=this.bookState.hardcover && (Q5.isFirstSheet || Q5.isFirst);if((this.bookState.right.isFirst || C6?(this.preWrapper.destroy(),this.preWrapper=Xt(this.bookState.getState(),this.bookState,this.bookDiv,!1,+"2",!1,this.parentVm,this.contentCreator,E6_.I6("54" - 0),C6)):this.bookState.right.isFirst || this.preWrapper.setContent({'\u0066\u0069\u0072\u0073\u0074':null,'\u0073\u0065\u0063\u006f\u006e\u0064':null}),this.bookState.right.isFirst && this.bookState.hardcover)){W3=this.leftWrapper.secondPageNum;this.leftWrapper.destroy();this.leftWrapper=Xt(this.bookState.getState(),this.bookState,this.bookDiv,!0,"3" << 0,!+"1",this.parentVm,this.contentCreator,E6_.I6("99" | 67));this.leftWrapper.setLeft();this.leftWrapper.setContent({'\u0073\u0065\u0063\u006f\u006e\u0064':W3});}else this.bookState.singleMode && this.bookState.rtl || this.leftWrapper.setContent({'\u0066\u0069\u0072\u0073\u0074':null});this.preWrapper.contentObject2.setPageBg(this.bookState.currentLeft);this.leftWrapper.contentObject1.setPageBg(this.bookState.currentRight);this.once(E6_.O_("114" ^ 0),function(){tt.Z.removeClass(h$.globalWrapper,E6_.I6("73" | 65));h$.resetWrappers(!+"1");},this);this.flipToRight();}};Ee.prototype.initOnceSizes=function(){var z1B=r7HCT;var k2,u9,r8,x9,w8,C_,z2,F9,v_,V5,L_;k2=this.bookHeight;u9=this.maskTop;r8=this.flipGradientWidth;x9=this.flipGradientTop;w8=this.transformOriginMethod;C_=this.innerReflexWidth;z2=this.innerReflexBottomWidth;F9=this.innerReflexBottomMarginTop;v_=this.renderData;V5=this.currentWrapper;L_=this.innerReflexMarginTop;switch(this.startPoint){case z1B.O_(141):(this.renderData.reversePageOrigin=z1B.O_(+"148"),this.renderData.frontPageOrigin=z1B.I6("76" ^ 0),this.renderData.maskOrigin=z1B.I6(23) + (k2 + u9) + z1B.I6(+"11"),this.renderData.flipGradientOrigin=r8 + z1B.I6(17) + (k2 + x9) + z1B.O_(+"11"),this.renderData.innerReflexBottomOrigin=z1B.I6(+"41") + (k2 + F9) + z1B.I6("11" ^ 0),this.renderData.innerReflexOrigin=C_ + z1B.I6(+"17") + (k2 + L_) + z1B.I6(11),this.renderData.reflexContainerOrigin=z1B.I6(+"76"));break;case z1B.O_(167):(this.renderData.reversePageOrigin=z1B.O_(+"188"),this.renderData.frontPageOrigin=z1B.O_(+"93"),this.renderData.maskOrigin=z1B.O_("23" - 0) + u9 + z1B.O_("11" - 0),this.renderData.flipGradientOrigin=r8 + z1B.O_(+"17") + x9 + z1B.I6("11" << 0),this.renderData.innerReflexBottomOrigin=z1B.O_("41" - 0) + F9 + z1B.O_(+"11"),this.renderData.innerReflexOrigin=C_ + z1B.O_(17) + L_ + z1B.O_("11" | 8),this.renderData.reflexContainerOrigin=z1B.O_(93));break;case z1B.I6("121" | 80):(this.renderData.reversePageOrigin=z1B.I6(+"76"),this.renderData.frontPageOrigin=z1B.I6("148" - 0),this.renderData.maskOrigin=z1B.O_(+"34") + (k2 + u9) + z1B.I6("11" * 1),this.renderData.flipGradientOrigin=z1B.I6("41" - 0) + (k2 + x9) + z1B.I6(+"11"),this.renderData.innerReflexBottomOrigin=z2 + z1B.I6("17" >> 64) + (k2 + F9) + z1B.I6(+"11"),this.renderData.innerReflexOrigin=z1B.O_(+"41") + (k2 + L_) + z1B.I6(+"11"),this.renderData.reflexContainerOrigin=z1B.O_("148" - 0));break;default:(this.renderData.reversePageOrigin=z1B.O_("93" << 64),this.renderData.frontPageOrigin=z1B.I6("188" | 8),this.renderData.maskOrigin=z1B.I6(34) + u9 + z1B.I6(11),this.renderData.flipGradientOrigin=z1B.O_("41" >> 32) + x9 + z1B.I6("11" | 3),this.renderData.innerReflexBottomOrigin=z2 + z1B.O_(17) + F9 + z1B.O_(+"11"),this.renderData.innerReflexOrigin=z1B.I6(+"41") + L_ + z1B.I6(+"11"),this.renderData.reflexContainerOrigin=z1B.I6("188" | 36));}this[V5].reversePage.style[w8]=v_.reversePageOrigin;this[V5].frontPage.style[w8]=v_.frontPageOrigin;this[V5].mask.style[w8]=v_.maskOrigin;this[V5].flipGradient.style[w8]=v_.flipGradientOrigin;this.innerReflexBottom.style[w8]=v_.innerReflexBottomOrigin;this[V5].innerReflex.style[w8]=v_.innerReflexOrigin;z1B.Z8();this[V5].reflexContainer.style[w8]=v_.reflexContainerOrigin;};Ee.prototype.calcStripeSizes=function(){var k2g=r7HCT;var A_,V4,m2,m8,x2,p6,h6,M6,O$,d6,z4;if(Math.max(document.documentElement.clientWidth || +"0",window.innerWidth || +"0") <= +"480" || !this.bookState.thickness)return (this.leftStripeWidth=+"0",this.rightStripeWidth="0" - 0,this.backboneWidth=+"0",this.leftStripeBlock.style.width="0" * 1,this.rightStripeBlock.style.width=0,void this.bookState.set(k2g.O_(179),"0" << 0));if(this.bookState.singleMode){m8=("0" << 64,wt.bh)().getters[k2g.O_("87" ^ 0)].currentPage;if((V4=(A_=("0" ^ 0,wt.bh)().getters[k2g.O_("83" ^ 0)](m8)) + ("1" | 1),m2=("0" | 0,wt.bh)().getters[k2g.I6(+"103")],this.bookState.rtl)){x2=V4;V4=m2 - A_ - 1;A_=m2 - x2 - +"1";}}else (A_=this.bookState.currentLeft,V4=this.bookState.currentRight,m2=this.bookState.pagesCount);O$=A_ / +"2";d6=null === V4 || this.bookState.right.isLastSheet?"0" >> 64:(m2 - V4 + ("1" >> 32)) / +"2";this.bookState.singleMode && !this.bookState.hardcover?M6=1:(p6=(k2g.O_("178" ^ 0) === this.state || k2g.I6(+"59") === this.state) && (this.bookState.left.isFirstSheet || this.bookState.right.isFirst || this.bookState.left.isLast || this.bookState.right.isLastSheet) && !(!this.postPager && this.bookState.left.isFirstSheet && k2g.O_(+"30") === this.currentWrapper || !this.postPager && this.bookState.right.isLastSheet && k2g.O_("9" << 32) === this.currentWrapper) && !(this.postPager && this.bookState.left.isFirstSheet && k2g.I6(+"9") === this.currentWrapper || this.postPager && this.bookState.right.isLastSheet && k2g.I6("30" * 1) === this.currentWrapper),h6=this.progress,((this.bookState.left.isFirstSheet || this.bookState.right.isLastSheet) && !this.postPager || (this.bookState.right.isFirst || this.bookState.left.isLast) && this.postPager) && (h6=+"1" - h6),M6=p6?h6:(this.bookState.right.isFirst || this.bookState.left.isLast) && k2g.O_(+"18") === this.state?"0" >> 32:"1" << 32);z4=this.stripeCanvas.width - this.bookWidth;this.bookState.singleMode && this.bookState.rtl?(this.rightStripeWidth=0,this.rightStripeBlock.style.width="0" - 0,this.leftStripeWidth=Math.floor(Te(O$,m2,this.fittedSize,z4) * M6),this.leftStripeBlock.style.width=this.leftStripeWidth + k2g.I6(+"11")):this.bookState.singleMode?(this.leftStripeWidth=0,this.leftStripeBlock.style.width=+"0",this.rightStripeWidth=Math.floor(Te(d6,m2,this.fittedSize,z4) * M6),this.rightStripeBlock.style.width=this.rightStripeWidth + k2g.I6(+"11")):(this.leftStripeWidth=Math.floor(Te(O$,m2,this.fittedSize,z4) * M6),this.leftStripeBlock.style.width=this.leftStripeWidth + k2g.I6("11" >> 64),this.rightStripeWidth=Math.floor(Te(d6,m2,this.fittedSize,z4) * M6),this.rightStripeBlock.style.width=this.rightStripeWidth + k2g.I6(+"11"));this.backboneWidth=this.leftStripeWidth + this.rightStripeWidth;k2g.Z8();this.bookState.set(k2g.I6("179" ^ 0),Te(m2 / +"2",m2,this.fittedSize,z4));};Ee.prototype.calcStripeColors=function(){var l8h=r7HCT;for(var m6,p4,G7,W5=[],k0=[],H2=this.bookState.pagesCount,D9=[200,"210" << 64,+"220","230" | 34,"240" >> 96],h0=function y2(){var y_;y_=Math.min(Math.floor(Math.random() * D9.length),D9.length - +"1");return y_ === m6 || y_ - ("1" << 0) === m6 || y_ + ("1" - 0) === m6?y2():y_;},D0=+"0",R6=H2;D0 < R6;D0++){m6=h0();p4=(".2" - 0) * Math.random() + +".2" + "1" * 1;G7=l8h.I6(+"7") + D9[m6] + l8h.I6(79) + D9[m6] + l8h.O_(+"79") + D9[m6] + l8h.O_(+"192");W5.push(G7);k0.push(p4);}this.stripeColorArray=W5;this.stripeHeightArray=k0;};Ee.prototype.renderStripe=function(){var l9,Z0,U1,Z3,p0,v5,v$,V8;l9=this.stripeCanvasCTX;Z0=this.stripeCanvas;U1=this.bookWidth;Z3=this.bookHeight;p0=Math.round((Z0.width - U1) / +"2");v5=Z0.width;v$=!("1" << 64);V8=!1;if((l9.clearRect("0" << 0,+"0",v5,Z0.height),("0" * 1 === this.rightWrapper.firstPageNum || 0 === this.leftWrapper.firstPageNum && this.bookState.rtl) && (v$=!+"0"),(this.leftWrapper.secondPageNum === this.bookState.pagesCount - ("1" | 1) || this.rightWrapper.secondPageNum === this.bookState.pagesCount - +"1" && this.bookState.rtl) && (V8=!("0" >> 0)),this.leftStripeWidth > 0 && !v$))for(var U4=0,f9=this.leftStripeWidth;f9 > "0" - 0;f9--){U4=f9 * this.stripeHeightArray[this.leftStripeWidth - f9];l9.fillStyle=this.stripeColorArray[this.leftStripeWidth - f9];l9.fillRect(p0 - f9 + ("1" << 0),Math.round(U4 / ("4" | 4)),"1" * 1,Z3 - f9 / ("2" | 2));}if(this.rightStripeWidth > +"0" && !V8)for(var g2=+"0",l7=+"0",L9=this.rightStripeWidth;l7 < L9;l7++){g2=l7 * this.stripeHeightArray[this.stripeColorArray.length - L9 + l7];l9.fillStyle=this.stripeColorArray[this.stripeColorArray.length - L9 + l7];l9.fillRect(p0 + U1 + l7 - +"1",Math.round(g2 / ("4" << 32)),1,Z3 - l7 / +"2");}};Ne=function(S_,G9,Z_,q9,K0,O7){O7=O7 || "1" - 0;Z_+=+".6" * K0;S_.beginPath();r7HCT.Y4();S_.moveTo(G9,Z_);S_.bezierCurveTo(G9,Z_ - K0,G9 + (".6" - 0) * q9,Z_ - K0 / +"3.5",G9 + q9,Z_);S_.shadowColor=r7HCT.O_("15" * 1);S_.shadowBlur=O7;S_.shadowOffsetY=+".3" * -K0;S_.closePath();S_.fill();}; function Ze(t,e){this.x=t,this.y=e}Ee.prototype.renderBookShadow=function(t){var e=this,i=this.shadowCanvasCTX,s=this.shadowCanvas,o=s.width,r=s.height,n=this.bookWidth,a=this.pageWidth,h=this.bookHeight,l=(o-n)/2,c=(r-h)/2,d=this.rightStripeWidth,u=this.leftStripeWidth,p=this.backboneWidth,g=.01*n,f=Math.round(h*Le);f%2!=0&&(f+=1);var m,v,b=Math.round(s.height-f)/2,S=this.bookState.singleMode,y=8,w=12,k=(a-4)/a,x=(h-8)/h,P=c+h,$=o/2;i.clearRect(0,0,o,r),i.fillStyle="rgba(0,0,0,0.17)",i.save();var z=function(t){t.addColorStop(0,"rgba(0, 0, 0, 0.1)"),t.addColorStop(.01,"rgba(0, 0, 0, 0)"),t.addColorStop(.05,"rgba(0, 0, 0, 0.05)"),t.addColorStop(.5,"rgba(0, 0, 0, 0)")},C=function(){if(i.shadowColor=null,i.shadowBlur=0,i.shadowOffsetY=0,"rgt-sdw"!==t){var e=$-g-u,s=$-g-u-a,o=i.createLinearGradient(e,0,s,0);z(o),i.fillStyle=o,i.fillRect(e,b,-a,f)}if("lft-sdw"!==t){var r=$+g+d+(S?p:0),n=$+g+d+a,h=i.createLinearGradient(r,0,n,0);z(h),i.fillStyle=h,i.fillRect(r,b,a,f)}},T=function(){var e=s.width/2-u-g,o=p+2*g,r=i.createLinearGradient(e,0,e+o,0);r.addColorStop(0,"rgba(0, 0, 0, 0)"),r.addColorStop(.02,"rgba(0, 0, 0, 0.33)"),r.addColorStop(.5,"rgba(0, 0, 0, 0.20)"),r.addColorStop(.98,"rgba(0, 0, 0, 0.33)"),r.addColorStop(1,"rgba(0, 0, 0, 0)"),i.shadowColor=null,i.shadowBlur=0,i.shadowOffsetY=0,i.fillStyle=r,i.fillRect(e,b,o,f),i.restore(),"rgt-sdw"===t&&i.clearRect(e-2,b-2,g+2,f+4),"lft-sdw"===t&&i.clearRect(e+p+g,b-2,g+2,f+4)},M=function(){S?i.scale(.999,.999):(i.scale(k,x),i.translate(y/2,w/2)),i.shadowColor="#000",i.shadowBlur=7,i.shadowOffsetY=0,i.fillRect(l,c,a,h),i.fillRect($,c,a,h),i.restore(),e.bookState.left.isFirstSheet||(Ne(i,$,c,-a,.3*c,12),Ne(i,$,P,-a,.9*-c,18)),e.bookState.right.isLastSheet||(Ne(i,$,c,a,.2*c,12),Ne(i,$,P,a,.6*-c,18))},I=function(t){S?i.scale(.999,.999):(i.scale(k,x),i.translate(y/2,w/2)),"right"===t?(v=1,m=$):(v=-1,m=l),i.shadowColor="#000",i.shadowBlur=7,i.shadowOffsetY=1,i.fillRect(m,c,a,h),i.restore(),Ne(i,$,c,a*v,c*("right"===t?.2:.3),12),Ne(i,$,P,a*v,-c*("right"===t?.6:.9),18)};"rgt-sdw"===t?I("right"):"lft-sdw"===t?I("left"):M(),this.bookState.hardcover&&n&&(C(),T()),this.renderStripe()};var Ve=Ee,je=function(t){this.bookState=new Ue(t),this.book=new Ve(t.container,t.bookSize,this.bookState,t.parentVm,t.contentCreator,t.initDomEvents),this.notForPagerEventTrigger=!1,this.options=t,this.book.on("flip:toRight",this.flipToRight,this),this.book.on("flip:toLeft",this.flipToLeft,this),this.book.on("render:start",this.renderStart,this),this.book.on("render:finish",this.renderFinish,this),this.book.on("flip:finished",this.flipFinished,this),this.book.on("swipe",this.onSwipe,this),this.bookState.on("state:updated",this.stateUpdated,this),this.bookState.on("change:stripesWidth",this.changeStripesWidth,this),this.on("go:toRight",this.goToRight),this.on("go:toLeft",this.goToLeft),this.on("go:toPage",this.goToPage)};je.prototype=new Yt.Z,je.prototype.constructor=je,je.prototype.destructor=function(){this.off("go:toRight",this.goToRight),this.off("go:toLeft",this.goToLeft),this.off("go:toPage",this.goToPage),this.book.off("flip:toRight",this.flipToRight,this),this.book.off("flip:toLeft",this.flipToLeft,this),this.book.off("render:start",this.renderStart,this),this.book.off("render:finish",this.renderFinish,this),this.book.off("flip:finished",this.flipFinished,this),this.book.off("swipe",this.onSwipe,this),this.book.destructor(),this.bookState.off("state:updated",this.stateUpdated,this),this.bookState.off("change:stripesWidth",this.changeStripesWidth,this),this.bookState.destructor()},je.prototype.flipToRight=function(){this.notForPagerEventTrigger?(this.notForPagerEventTrigger=!1,this.book.shiftPages(),this.options.state.dispatch("pager/unfreeze",{target:"flip-book"})):(this.options.state.dispatch("pager/unfreeze",{target:"flip-book"}),(0,Me.oJ)(this.options.state,{target:"flipComponent"}),this.bookState._updateState(),this.book.shiftPages())},je.prototype.flipToLeft=function(){this.notForPagerEventTrigger?(this.notForPagerEventTrigger=!1,this.book.shiftPages(),this.options.state.dispatch("pager/unfreeze",{target:"flip-book"})):(this.options.state.dispatch("pager/unfreeze",{target:"flip-book"}),(0,Me.X0)(this.options.state,{target:"flipComponent"}),this.bookState._updateState(),this.book.shiftPages())},je.prototype.renderStart=function(t){this.options.state.dispatch("workspace/setAnimationProgress",{animationType:"pagerMove"}),this.trigger("render:start",t)},je.prototype.onSwipe=function(t){this.options.parentVm.$root.$emit("swipe",t)},je.prototype.renderFinish=function(){this.options.state.dispatch("workspace/unsetAnimationProgress"),this.options.parentVm.$emit("render:finish"),this.trigger("render:finish")},je.prototype.flipFinished=function(){this.trigger("flip:finished")},je.prototype.stateUpdated=function(t,e){this.trigger("go:"+t,e)},je.prototype.changeStripesWidth=function(t){this.options.parentVm.stripesWidth=t},je.prototype.goToRight=function(t){"flipComponent"!==t&&"orientation"!==t&&(this.notForPagerEventTrigger=!0,this.bookState.rtl?this.book.flipToLeft(!1,!1,this.bookState.getState()):this.book.flipToRight(!1,!1,this.bookState.getState()))},je.prototype.goToLeft=function(t){"flipComponent"!==t&&"orientation"!==t&&(this.notForPagerEventTrigger=!0,this.bookState.rtl?this.book.flipToRight(!1,!1,this.bookState.getState()):this.book.flipToLeft(!1,!1,this.bookState.getState()))},je.prototype.goToPage=function(t){"flipComponent"!==t&&"orientation"!==t&&(!this.options.isMobile||"toc"!==t&&"thumbnails"!==t&&"search"!==t&&"notes"!==t?(this.options.state.dispatch("pager/freeze",{target:"flip-book"}),this.notForPagerEventTrigger=!0,this.book.flipToPager(this.bookState.getState())):this.bookState.trigger("reset:wrappers",!0))},je.prototype.resizeBook=function(t){this.book.setBookSize(t)},je.prototype.block=function(t){this.book.block(t)},je.prototype.unblock=function(){this.book.unblock()},je.prototype.resetBook=function(){this.book.resetWrappers()},je.prototype.setRtl=function(t){this.bookState.set("rtl",t)},je.prototype.setHardcover=function(t){this.bookState.set("hardcover",t)},je.prototype.setThickness=function(t){this.bookState.set("thickness",t)},je.prototype.setHardcoverColor=function(t){this.bookState.set("hardcoverColor",t)},je.prototype.setSingleMode=function(t){this.bookState.set("singleMode",t)},je.prototype.updateState=function(t,e,i){this.bookState._updateState(t,e,i)},je.prototype.setZoom=function(t){this.bookState.set("isZoomed",t)};var Ue=function(t){this.state=t.state,this.isMobile=t.isMobile,this.version=t.version,this.hardcover=this.state.getters["book/hasHardcover"],this.hardcoverColor=this.state.state.book.hardcoverColor,this.rtl=this.state.state.book.rightToLeft,this.isZoomed=!1,this.stripesWidth=0,this.left={},this.right={},this._updateState(),this.on("change:singleMode",this.resetWrappers),this.on("change:rtl",this.resetWrappers),this.on("change:hardcover",this.resetWrappers),this.on("change:hardcoverColor",this.resetStyles),this.on("change:thickness",this.resetStyles),this.on("change:isZoomed",this.resetStyles)};Ue.prototype=new Yt.Z,Ue.prototype.constructor=Ue,Ue.prototype.destructor=function(){this.off("change:singleMode",this.resetWrappers),this.off("change:rtl",this.resetWrappers),this.off("change:hardcover",this.resetWrappers),this.off("change:hardcoverColor",this.resetStyles),this.off("change:thickness",this.resetStyles),this.off("change:isZoomed",this.resetStyles)},Ue.prototype.resetWrappers=function(){this._updateState(),this.trigger("reset:wrappers")},Ue.prototype.resetStyles=function(){this.trigger("reset:styles")},Ue.prototype.getState=function(){return{leftSheet:this.getLeftSheet(),rightSheet:this.getRightSheet(),bottomLeftSheet:this.getBottomLeftSheet(),bottomRightSheet:this.getBottomRightSheet()}},Ue.prototype._updateState=function(t,e,i){t=t||"",e=e||this.state.getters["pager/state"],i=i||this.state.getters["pager/flipState"],this.thickness=this.state.state.book.thickness,this.pagesCount=this.state.getters["pages/pagesCount"],this.singleMode=e.singleMode,this.pagesCount=i.pagesCount,this.currentLeft=i.currentLeft<0?null:i.currentLeft,this.currentRight=i.currentRight>=i.pagesCount?null:i.currentRight,this.right.isFirst=0===this.currentRight,this.right.isLast=this.currentRight===this.pagesCount-1,this.right.isNull=null===this.currentRight,this.right.isLastSheet=this.currentRight===this.pagesCount-2,this.left.isFirst=0===this.currentLeft,this.left.isLast=this.currentLeft===this.pagesCount-1,this.left.isNull=null===this.currentLeft,this.left.isFirstSheet=1===this.currentLeft,""!==t&&this.trigger("state:updated",t,e.target)},Ue.prototype.isFirstPage=function(t){return 0===t},Ue.prototype.isLastPage=function(t){return t===this.pagesCount-1},Ue.prototype.isFirstSheet=function(t){return 1===t},Ue.prototype.isLastSheet=function(t){return t===this.pagesCount-2},Ue.prototype.isNullPage=function(t){return t<0||t>this.pagesCount-1||null===t},Ue.prototype.getRightSheet=function(){return{first:null===this.currentRight?null:this.currentRight,second:null===this.currentRight?null:this.currentRight+1}},Ue.prototype.getLeftSheet=function(){return{first:null===this.currentLeft?null:this.currentLeft-1,second:null===this.currentLeft?null:this.currentLeft}},Ue.prototype.getBottomRightSheet=function(){return{first:null===this.currentRight?null:this.currentRight+2,second:null===this.currentRight?null:this.currentRight+3}},Ue.prototype.getBottomLeftSheet=function(){return{first:null===this.currentLeft?null:this.currentLeft-3,second:null===this.currentLeft?null:this.currentLeft-2}};var Ge,Xe,Ye=je,qe=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"block",style:t.containerStyle,attrs:{"data-id":t.itemId}})},Ke=[],Qe=i(9937),Je=i(2358);function ti(t){return ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ti(t)}function ei(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,s)}return i}function ii(t){for(var e=1;e.5?"#000000":"#ffffff")}},crossWideContentMargin:function(){return this.singleMode&&this.data.crossWide?this.contentMargin:null},contentElementNonVisibleWidth:function(){if(!this.singleMode||!this.data.crossWide)return null;var t=this.pageWidth-this.containerRect.left-this.crossWideContentMargin;return"left"===this.data.page.side&&(t=this.containerRect.width-t),t},crossWideCenterIconLeft:function(){if(!this.singleMode||!this.data.crossWide)return null;var t;if("left"===this.data.page.side)t=Math.floor((this.pageWidth-this.containerRect.left-this.crossWideContentMargin)/2);else{var e=this.containerRect.width-this.contentElementNonVisibleWidth;t=Math.floor(e/2+this.contentElementNonVisibleWidth)}return t},crossWideCenterIconPositionStyle:function(){return{left:this.crossWideCenterIconLeft+"px"}},crossWideIconPositionStyle:function(){if(!this.singleMode||!this.data.crossWide)return null;switch(this.iconPosition){case"bottom-left":case"top-left":return"left"===this.data.page.side?{}:{left:this.contentElementNonVisibleWidth+this.iconPadding+"px"};case"bottom-right":case"top-right":return"right"===this.data.page.side?{}:{right:this.contentElementNonVisibleWidth+this.iconPadding+"px"};default:return this.crossWideCenterIconPositionStyle}},isIE:function(){return this.$store.state.workspace.userAgentInfo.browser.msie},iconLegacyStyle:function(){return this.isIE?{width:this.iconActualSize.width+"px",height:this.iconActualSize.height+"px",transform:"translate(".concat(this.iconTranslate.x,", ").concat(this.iconTranslate.y,") scale(.9) translateZ(0)")}:{}},iconStyles:function(){return ii(ii(ii(ii(ii({},this.iconVisibilityStyle),this.iconPositionStyle),this.crossWideIconPositionStyle),this.iconDelayStyle),this.iconLegacyStyle)},containerRect:function(){return{width:Math.round(this.data.rect[0]*this.data.scaleRatio.w),height:Math.round(this.data.rect[1]*this.data.scaleRatio.h),left:Math.round(this.data.rect[2]*this.data.scaleRatio.w),top:Math.round(this.data.rect[3]*this.data.scaleRatio.h)}},containerStyle:function(){var t={};return this.data.style?t=this.data.style:(t={width:this.containerRect.width+"px",height:this.containerRect.height+"px",left:this.containerRect.left+"px",top:this.containerRect.top+"px"},this.data.zIndex&&(t.zIndex=this.data.zIndex),(0,_.o8)(this.data.angle)||0!==this.data.angle&&(t.transformOrigin="0px 0px 0px",t.transform="rotate("+this.data.angle+"rad)")),t},rawThumbnailUrl:function(){return this.data.previewUrl?(0,Je.n)({filenameOrUrl:this.data.previewUrl,encode:!0}):null},thumbnailStyle:function(){return this.getThumbnailStyle(this.thumbnailBlob)},isCurrentPage:function(){return this.$store.getters["pager/isCurrentPage"]({pageId:this.data.page.id,pageSide:this.data.page.side})},isMobile:function(){return this.$store.getters["workspace/isMobile"]},isFrozenOrNotReady:function(){return this.$store.state.workspace.freezed||"ready"!==this.$store.state.workspace.status||this.$store.state.pager.freezed},isResizing:function(){return this.$store.state.workspace.isResizing}},created:function(){var t=this;this.data.crossWide&&"both"!==this.data.page.side&&!this.singleMode&&(this.$on("crossWideRegistered",(function(e){t.crossWideItem=e})),this.$contentRegistry.registerContentItem(this.data.itemId,this.data.page.side,this))},beforeMount:function(){this.rawThumbnailUrl&&this.loadThumbnail()},mounted:function(){var t=this;this.rawThumbnailUrl||this.$emit("ready",this),this.data.crossWide&&(Ge=function(){t.isHighlighted=!0,t.crossWideItem&&(t.crossWideItem.isHighlighted=!0)},Xe=function(){t.isHighlighted=!1,t.crossWideItem&&(t.crossWideItem.isHighlighted=!1)},this.$el.addEventListener("mouseover",Ge),this.$el.addEventListener("mouseout",Xe))},beforeDestroy:function(){var t=this;this.data.crossWide&&(this.$el.removeEventListener("mouseover",Ge),this.$el.removeEventListener("mouseout",Xe),this.$contentRegistry.deregisterContentItem(this.data.itemId,this.data.page.side)),this.thumbnailBlob&&(this.thumbnailBlob=null),this.blobCache&&(Object.keys(this.blobCache).forEach((function(e){return window.URL.revokeObjectURL(t.blobCache[e])})),this.blobCache=null)},watch:{rawThumbnailUrl:function(t){t?this.loadThumbnail():this.thumbnailBlob&&(this.thumbnailBlob=null)},isCurrentPage:function(t){t||(this.isHighlighted=!1,this.crossWideItem&&(this.crossWideItem.isHighlighted=!1))}},methods:{loadThumbnail:function(){var t=this,e=this.blobCache[this.rawThumbnailUrl];e?this.thumbnailBlob=e:(0,Qe.Z)({url:this.rawThumbnailUrl,autofillCrossOrigin:!1,callback:function(e){t.ready||(t.ready=!0,-1===["gallery","image"].indexOf(t.data.type)&&t.$emit("ready",t)),t.thumbnailBlob=e,(0,_.Kn)(t.blobCache)&&(t.blobCache[t.rawThumbnailUrl]=t.thumbnailBlob)},errorback:function(e){t.error=!0,t.$emit("error",t,e)}})},getThumbnailStyle:function(t){var e={};return this.thumbnailBlob&&(e.backgroundImage='url("'+t+'")'),e}}},pi=(0,U.Z)(ui,ni,ai,!1,null,null,null).exports,gi={extends:pi,name:"ContentBlock",data:function(){return{itemId:this.data.type+"_"+this.data.itemId}},methods:{zoomToBLock:function(){this.$emit("block:zoomed",this.data.rect)}}},fi=(0,U.Z)(gi,qe,Ke,!1,null,null,null).exports,mi=function(){var t=this,e=t.$createElement;return(t._self._c||e)("a",{directives:[{name:"show",rawName:"v-show",value:t.isVisible,expression:"isVisible"}],class:t.classes,style:t.linkStyle,attrs:{"data-url":t.url,"data-id":t.data.id,"data-item-id":t.data.itemId,title:t.title,target:t.target}})},vi=[];function bi(){return bi=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0;--r){var n=this.tryEntries[r],a=n.completion;if("root"===n.tryLoc)return o("end");if(n.tryLoc<=this.prev){var h=s.call(n,"catchLoc"),l=s.call(n,"finallyLoc");if(h&&l){if(this.prev=0;--i){var o=this.tryEntries[i];if(o.tryLoc<=this.prev&&s.call(o,"finallyLoc")&&this.prev=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),M(i),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var s=i.completion;if("throw"===s.type){var o=s.arg;M(i)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,i,s){return this.delegate={iterator:L(e),resultName:i,nextLoc:s},"next"===this.method&&(this.arg=t),m}},e}function Ri(t,e,i,s,o,r,n){try{var a=t[r](n),h=a.value}catch(l){return void i(l)}a.done?e(h):Promise.resolve(h).then(s,o)}function Ei(t){return function(){var e=this,i=arguments;return new Promise((function(s,o){var r=t.apply(e,i);function n(t){Ri(r,s,o,n,a,"next",t)}function a(t){Ri(r,s,o,n,a,"throw",t)}n(void 0)}))}}var Oi={name:"ContentButton",props:{icon:{type:String,default:null},caption:{type:String,default:null},size:{type:Object,required:!0,default:function(){return{}},validator:function(t){return!(0,_.o8)(t.height)&&(0,_.kE)(t.height)&&(!(0,_.o8)(t.width)&&(0,_.kE)(t.width)||!(0,_.o8)(t.maxWidth)&&(0,_.kE)(t.maxWidth))}},translate:{type:Object,default:function(){return{x:"-50%",y:"-50%"}}},color:{type:Object,default:function(){return{mainColor:"#ffffff",backgroundColor:"rgba(39, 47, 55, .6)"}}},iconSize:{type:Number,required:!1,default:60,validator:function(t){return(0,_.kE)(t)&&t>=0&&t<=100}},fontSize:{type:Number,required:!1,default:50,validator:function(t){return(0,_.kE)(t)&&t>=0&&t<=100}},cornerRadius:{type:Number,required:!1,default:100,validator:function(t){return(0,_.kE)(t)&&t>=0&&t<=100}}},created:function(){var t=this;return Ei(Li().mark((function e(){return Li().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.icon){e.next=9;break}return e.prev=1,e.next=4,i(4186)("./"+t.icon);case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),console.log("Could not load the icon '"+t.icon+"'.");case 9:case"end":return e.stop()}}),e,null,[[1,6]])})))()},computed:{buttonClasses:function(){return{"has-icon":!!this.icon,"has-caption":!!this.caption,"no-blur":"transparent"===this.color.backgroundColor}},buttonHeight:function(){return this.size.height},buttonWidth:function(){return this.size.width||this.size.maxWidth},buttonSizeStyle:function(){return{"--button-height":this.buttonHeight,"--button-width":this.buttonWidth,width:this.size.width?this.size.width+"px":null,maxWidth:this.size.maxWidth?this.size.maxWidth+"px":null}},buttonColorStyle:function(){return{backgroundColor:this.color.backgroundColor,fill:this.color.mainColor,color:this.color.mainColor}},finalIconSize:function(){var t=Math.round(this.buttonHeight*this.iconSize/100);return t%2!=0&&t++,t},finalFontSize:function(){var t=Math.round(this.buttonHeight*this.fontSize/100);return t%2!=0&&t++,t},buttonAdditionalStyle:function(){return{"--icon-size":this.finalIconSize,"--font-size":this.finalFontSize,"--corner-radius-factor":this.cornerRadius/100,"--zoom-factor":this.zoomFactor,"--button-translate-x":this.translate.x,"--button-translate-y":this.translate.y}},buttonStyles:function(){return Ci(Ci(Ci({},this.buttonSizeStyle),this.buttonColorStyle),this.buttonAdditionalStyle)},dir:function(){return this.$store.getters["i18n/isLocaleRtl"]?"rtl":"ltr"},zoomFactor:function(){return this.$store.state.pages.size.zoomFactor}}},Fi=(0,U.Z)(Oi,xi,Pi,!1,null,"8e50e958",null).exports,Di=i(5657);function _i(){return _i=Object.assign?Object.assign.bind():function(t){for(var e=1;e1)return null;var s=(0,Di.F)({data:t,maxSize:i});return(0,d.Z)().getImageFileName(s)},animationInProgress:function(){return this.$store.getters["workspace/animationInProgress"]}},methods:{onImageClick:function(){!this.hasPopup||this.animationInProgress||this.isResizing||(this.$store.commit("sound/SET_MUTE_TEMPORARY",!this.$store.state.caniuse.userInteractions.firstClick),Date.now()>this.tapTimeout&&setTimeout(this.imageClick,this.$store.state.workspace.doubletapInterval+1),this.tapTimeout=Date.now()+this.$store.state.workspace.doubletapInterval)},imageClick:function(){this.$store.commit("sound/SET_MUTE_TEMPORARY",!1),this.isFrozenOrNotReady||this.isEmbed||this.$store.dispatch("lightbox/openLightbox",{itemId:this.data.itemId,target:"content-click"})},preventDefault:function(t){t.preventDefault()},previewLoad:function(t){var e=this;if(t){var i=document.createElement("img");i.onload=function(){e.$emit("ready",e),e.addHiddenThumbnail(t),setTimeout((function(){e.makeThumbnailVisible(t)}),100)},i.onerror=function(t){e.$emit("error",e,t)},i.src=t}},addHiddenThumbnail:function(t){if(!this.cachedThumbnails.some((function(e){return e.id===t}))){var e={visibility:"visible",zIndex:-1},i={id:t,style:_i({},this.getThumbnailStyle(t),e)};this.cachedThumbnails.push(i)}},makeThumbnailVisible:function(t){this.cachedThumbnails.forEach((function(e){e.id===t?(e.style.visibility="visible",e.style.zIndex=null):e.style.visibility="hidden"}))}},watch:{thumbnailBlob:function(t){t&&this.previewLoad(t)}},components:{ContentButton:Fi}},Bi=(0,U.Z)(Wi,wi,ki,!1,null,null,null).exports,Ai=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",t._g({class:["content-element gallery",t.containerClasses],style:t.containerStyle},t.isEmbed?null:{tap:t.onGalleryClick,panstart:t.preventDefault}),[i("content-button",{style:t.iconStyles,attrs:{icon:t.iconType,caption:t.iconCountCaption,size:t.buttonSize,translate:t.iconTranslate,color:t.iconColor,"icon-size":60,"font-size":40}}),t._v(" "),i("div",{staticClass:"thumbsContainer"},t._l(t.cachedThumbnails,(function(t){return i("div",{key:t.id,staticClass:"thumbnail",style:t.style})})),0)],1)},Hi=[];function Ni(){return Ni=Object.assign?Object.assign.bind():function(t){for(var e=1;e1)return null;var s=(0,Di.F)({data:t,maxSize:i});return(0,d.Z)().getImageFileName(s)},animationInProgress:function(){return this.$store.getters["workspace/animationInProgress"]},galleryItemsCount:function(){return this.data.items.length},iconWidthLimit:function(){return Zi[this.iconSize]},iconActualSize:function(){var t=this.singleMode&&this.data.crossWide?this.containerRect.width-this.contentElementNonVisibleWidth:this.containerRect.width,e=Math.min(t*this.iconWidthLimit,this.iconNominalSize*(this.isIE?1:2)),i=e/(this.isIE?1:2);return i>this.containerRect.height*this.iconSizeLimit&&(e=(i=this.containerRect.height*this.iconSizeLimit)*(this.isIE?1:2)),{width:Math.round(e),height:Math.round(i)}},buttonSize:function(){return{maxWidth:this.iconActualSize.width,height:this.iconActualSize.height}},iconCountCaption:function(){return""+this.galleryItemsCount}},methods:{onGalleryClick:function(){this.animationInProgress||this.isResizing||(this.$store.commit("sound/SET_MUTE_TEMPORARY",!this.$store.state.caniuse.userInteractions.firstClick),Date.now()>this.tapTimeout&&setTimeout(this.galleryClick,this.$store.state.workspace.doubletapInterval+1),this.tapTimeout=Date.now()+this.$store.state.workspace.doubletapInterval)},galleryClick:function(){this.$store.commit("sound/SET_MUTE_TEMPORARY",!1),this.isFrozenOrNotReady||this.isEmbed||this.$store.dispatch("lightbox/openLightbox",{itemId:this.data.itemId,target:"content-click"})},preventDefault:function(t){t.preventDefault()},previewLoad:function(t){var e=this;if(t){var i=document.createElement("img");i.onload=function(){e.$emit("ready",e),e.addHiddenThumbnail(t),setTimeout((function(){e.makeThumbnailVisible(t)}),100)},i.onerror=function(t){e.$emit("error",e,t)},i.src=t}},addHiddenThumbnail:function(t){if(!this.cachedThumbnails.some((function(e){return e.id===t}))){var e={visibility:"visible",zIndex:-1},i={id:t,style:Ni({},this.getThumbnailStyle(t),e)};this.cachedThumbnails.push(i)}},makeThumbnailVisible:function(t){this.cachedThumbnails.forEach((function(e){e.id===t?(e.style.visibility="visible",e.style.zIndex=null):e.style.visibility="hidden"}))}},watch:{thumbnailBlob:function(t){t&&this.previewLoad(t)}},components:{ContentButton:Fi}},ji=(0,U.Z)(Vi,Ai,Hi,!1,null,null,null).exports,Ui=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-touch",{staticClass:"content-element gif",class:t.containerClasses,style:t.containerStyle,on:{tap:t.onGifClick}},[i("content-button",{style:t.iconStyles,attrs:{icon:t.iconType,size:t.iconActualSize,translate:t.iconTranslate,color:t.iconColor,"icon-size":75}}),t._v(" "),i("transition",{attrs:{name:"fade-thumbnail"}},[t.rawThumbnailUrl?i("div",{directives:[{name:"show",rawName:"v-show",value:t.showThumbnail,expression:"showThumbnail"}],staticClass:"thumbnail",style:t.thumbnailStyle}):t._e()]),t._v(" "),t.isPlaying||t.isEnded?i("div",{staticClass:"image"},[i("img",{ref:"gifImg",style:t.imageStyle,attrs:{crossOrigin:t.crossOrigin,src:t.imageSrcCache}})]):t._e(),t._v(" "),t.isCurrentPage&&t.isLoading?i("div",{staticClass:"preloader",style:t.crossWideCenterIconPositionStyle},[i("spinner",{attrs:{sync:t.spreadMode&&t.data.crossWide,size:18,"line-fg-color":"#5692AE","line-bg-color":"#ffffff"}})],1):t._e(),t._v(" "),!1===t.data.loop?i("div",{staticClass:"replay",style:t.replayPositions},[i("svgicon",{attrs:{focusable:"false",name:"replay",color:"white"}})],1):t._e()],1)},Gi=[];i(148);function Xi(t){return Xi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xi(t)}function Yi(t,e,i){return(e=qi(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function qi(t){var e=Ki(t,"string");return"symbol"===Xi(e)?e:String(e)}function Ki(t,e){if("object"!==Xi(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var s=i.call(t,e||"default");if("object"!==Xi(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Qi,Ji=8,ts={extends:pi,name:"ContentGif",props:[],data:function(){return{crossOrigin:(0,d.Z)().getCrossOrigin(),isIdle:!0,isLoading:!1,isPlaying:!1,isLoaded:!1,isEnded:!1,isAutoplay:this.data.autoplay,imgWidth:null,imgHeight:null,imgRatio:null,imageSrcCache:null,preloaderTimeout:null,loopTimeout:null,tapTimeout:0}},computed:{spreadMode:function(){return this.$store.state.pager.spreadMode},isLocaleRtl:function(){return this.$store.getters["i18n/isLocaleRtl"]},replayPositions:function(){var t=this.isLocaleRtl?"left":"right",e=this.singleMode&&this.data.crossWide&&this.data.page.side!==t?this.contentElementNonVisibleWidth+Ji:Ji;return Yi({bottom:Ji+"px"},t,e+"px")},containerClasses:function(){return{autoplay:this.isAutoplay,loading:this.isLoading,playing:this.isPlaying,ended:this.isEnded,highlighted:this.isHighlighted,"cross-wide":!!this.crossWideItem,"hover-button":"hover"===this.iconVisibility}},imageStyle:function(){return{width:Math.round(this.imgWidth*this.imgRatio*this.data.scaleRatio.w)+"px",height:Math.round(this.imgHeight*this.imgRatio*this.data.scaleRatio.h)+"px"}},imageSrc:function(){var t=!1===this.data.loop?"?rand="+this.rand:"",e=(this.$store.state.workspace.policiesUpdated,(0,Je.n)({filenameOrUrl:this.data.url,encode:!0}));return(0,d.Z)().translatePath(e+t)},rand:function(){return this.$store.state.content.rands[this.data.itemId]},isEmbed:function(){return this.$store.state.workspace.isEmbed},showThumbnail:function(){return!this.isEnded&&!this.isPlaying},animationInProgress:function(){return this.$store.state.workspace.animationInProgress},isLoadedAndVisible:function(){return this.isLoaded&&!this.$store.state.workspace.preloader}},mounted:function(){(!this.data.crossWide&&!this.rand||this.data.crossWide&&!this.crossWideItem&&!1===this.data.loop)&&this.newRand(),this.updateSrcCache(),this.$nextTick(this.checkAutoplay)},watch:{isCurrentPage:"currentPageChanged",isLoadedAndVisible:function(t){t&&(!this.crossWideItem||this.crossWideItem.isLoaded||this.singleMode)&&(this.isLoading=!1,this.playGif(this),this.crossWideItem&&!this.singleMode&&(this.crossWideItem.isLoading=!1,this.playGif(this.crossWideItem)),this.$emit("gif:loaded",this),this.$root.$emit("gif",{action:"loaded",url:this.data.url}))},imageSrc:"updateSrcCache",animationInProgress:function(t){t||this.$emit("pageAnimationEnded")}},methods:{playGif:function(t){t.isPlaying=!0,!1===t.data.loop&&t.data.duration&&(t.loopTimeout=setTimeout((function(){t.isPlaying=!1,t.isEnded=!0}),t.data.duration+300))},onGifClick:function(t){var e=this;this.isResizing||(Date.now()>this.tapTimeout&&setTimeout((function(){e.gifClick(t)}),this.$store.state.workspace.doubletapInterval+1),this.tapTimeout=Date.now()+this.$store.state.workspace.doubletapInterval)},gifClick:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.isFrozenOrNotReady&&!this.isEmbed){if(this.data.url&&this.isIdle&&!this.isLoading)this.$emit("gif:click",this),this.$root.$emit("gif",{action:"click",url:this.data.url}),this.loadGif();else if(!1===this.data.loop&&this.isEnded){var i=this.isMobile&&document.activeElement!==this.$el&&!this.isHighlighted,s=this.isMobile&&this.isHighlighted;if(!e&&!s&&(i||-1===(0,l.UZ)(t.target).indexOf("replay")))return void(i&&(this.isHighlighted=!0,this.crossWideItem&&(this.crossWideItem.isHighlighted=!0)));this.unloadGif(!e),this.$nextTick(this.loadGif),this.isMobile&&this.isHighlighted&&(this.isHighlighted=!1,this.crossWideItem&&(this.crossWideItem.isHighlighted=!1))}else(this.isPlaying||this.isLoading)&&this.unloadGif(!e&&!1===this.data.loop);this.crossWideItem&&!e&&this.crossWideItem.gifClick(null,!0)}},loadGif:function(){var t=this;this.img||(this.img=document.createElement("img")),this.img.onload=function(){clearTimeout(t.preloaderTimeout),t.imgWidth=t.img.naturalWidth,t.imgHeight=t.img.naturalHeight,t.imgRatio=Math.max(t.data.rect[0]/t.imgWidth,t.data.rect[1]/t.imgHeight),t.isLoaded=!0},this.img.onerror=function(e){t.$emit("gif:error",t,e)},this.crossOrigin&&(this.img.crossOrigin=this.crossOrigin),this.img.src=this.imageSrcCache,this.isIdle=!1,this.preloaderTimeout=setTimeout((function(){t.isLoading=!0}),this.data.loop?200:0)},unloadGif:function(t){var e;this.rawThumbnailUrl&&(clearTimeout(this.preloaderTimeout),clearTimeout(this.loopTimeout),this.isLoading=!1,this.isEnded=!1,this.img&&(this.img.onload=null,this.img.onerror=null,this.img.src=""),null===(e=this.$refs.gifImg)||void 0===e||e.removeAttribute("src"),this.isLoaded=!1,this.isPlaying=!1,this.isAutoplay=!1,this.isIdle=!0,t&&this.newRand(),this.$emit("gif:stop",this),this.$root.$emit("gif",{action:"stop",url:this.data.url}))},checkAutoplay:function(){this.data.autoplay&&(this.data.fileSize<10485760||!this.isMobile?this.isCurrentPage&&this.loadGif():this.isAutoplay=!1)},currentPageChanged:function(t){var e=this;t?this.animationInProgress?this.$once("pageAnimationEnded",(function(){e.checkAutoplay()})):this.checkAutoplay():(this.unloadGif(!0),this.data.autoplay&&(this.isAutoplay=!0))},newRand:function(){this.$store.dispatch("content/newRand",{itemId:this.data.itemId})},updateSrcCache:function(){this.imageSrcCache===this.imageSrc||this.isLoaded||(this.imageSrcCache=this.imageSrc)}},components:{spinner:dt.Z,ContentButton:Fi}},es=ts,is=(0,U.Z)(es,Ui,Gi,!1,null,null,null).exports,ss=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",t._g({staticClass:"content-element video",class:t.containerClasses,style:t.containerStyle},t.isEmbed?null:{tap:t.onVideoClick}),[t.isPlayerShown||t.hasError?t._e():i("content-button",{key:"content-element-icon-"+t.data.itemId,style:t.iconStyles,attrs:{icon:t.iconType,size:t.iconActualSize,translate:t.iconTranslate,color:t.iconColor,iconSize:75}}),t._v(" "),t.hasError?i("content-button",{style:t.iconStyles,attrs:{icon:"error",size:t.iconActualSize,color:t.iconColor,iconSize:75}}):t._e(),t._v(" "),i("v-touch",t._g({directives:[{name:"show",rawName:"v-show",value:t.isThumbnailShown,expression:"isThumbnailShown"}],staticClass:"thumbnail",style:t.thumbnailStyle},t.isEmbed?null:{tap:t.onVideoClick})),t._v(" "),t.isInline&&t.isPlayerShown&&!t.isModalShown?i(t.videoData.provider,{ref:"player",tag:"component",attrs:{id:t.videoData.id,itemId:t.data.itemId,url:t.videoData.originalUrl,embedUrl:t.videoData.embedUrl,accessKey:t.videoData.accessKey,width:t.containerRect.width,height:t.containerRect.height,mute:t.isMuted,start:t.videoData.startFrom,isCurrentPage:t.isCurrentPage,isIos:t.isIos,customUrl:t.videoData.customUrl}}):t._e(),t._v(" "),t.isModalShown?i("modal-window",{ref:"modalWindow",attrs:{width:t.modalRect.width,height:t.modalRect.height,bgColor:"#000",delay:150}},[t.isIos&&t.showPreventer&&"wistia"!==t.videoData.provider?i("v-touch",{ref:"touchPreventer",staticClass:"touch-preventer",class:t.videoData.provider+(t.isModalSmall?" small":""),on:{tap:t.playPause,doubletap:function(t){t.preventDefault()},pinch:function(t){t.preventDefault()}}}):t._e(),t._v(" "),i(t.videoData.provider,{ref:"player",tag:"component",style:t.modalVideoStyle,attrs:{id:t.videoData.id,itemId:t.data.itemId,url:t.videoData.originalUrl,embedUrl:t.videoData.embedUrl,accessKey:t.videoData.accessKey,width:t.modalRect.width,height:t.modalRect.height,mute:t.isMuted,start:t.videoData.startFrom,isCurrentPage:!0,isIos:t.isIos,customUrl:t.videoData.customUrl}})],1):t._e()],1)},os=[],rs=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("div",{ref:"playerMount",staticClass:"youtube-player player",attrs:{id:t.elementId}})])},ns=[],as=i(1062),hs=i.n(as);function ls(t){return ls="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ls(t)}function cs(){return cs=Object.assign?Object.assign.bind():function(t){for(var e=1;e.1?t:.3})).catch(this.error),this.player.setMuted(!0).catch(this.error)):(this.player.setMuted(!1).catch(this.error),this.player.setVolume(this.volume).catch(this.error))},setVolume:function(t){this.player.setVolume(t).catch(this.error)},setSize:function(){this.player.element&&(this.player.element.width=this.width,this.player.element.height=this.height)},setCurrentTime:function(t){this.player.setCurrentTime(t)},init:function(){var t=this;this.player.ready().then((function(){t.start&&t.player.setCurrentTime(t.start),t.isCurrentPage&&!t.$store.state.workspace.pausedByReader[t.itemId]&&t.player.play(),t.$emit("ready",t.player),t.setMute(t.mute),Is.forEach((function(e){return Cs.call(t,e)}))})).catch(this.error)},error:function(t){var e=this;if(-1!==t.message.indexOf("is not embeddable")&&this.$el.querySelector("iframe"))return;"PasswordError"!==t.name&&"PrivacyError"!==t.name||this.player.element&&(this.$nextTick((function(){e.player.element.focus()})),setTimeout((function(){e.player.element.focus()}),100)),this.$emit("error",t,this.player)}},mounted:function(){var t={width:this.width,height:this.height,autoplay:0,autopause:0,muted:this.mute,transparent:!1,playsinline:!0};this.customUrl?(t.url=this.url,t.url+=this.accessKey?"/"+this.accessKey:""):this.embedUrl?t.url=this.embedUrl:this.accessKey?t.url="https://www.vimeo.com/"+this.id+"/"+this.accessKey:t.id=this.id,this.player=new Ps.Z(this.$el,$s(t,this.options)),this.init(),this.$parent.$on("play",this.play),this.$parent.$on("stop",this.stop),this.$parent.$on("pause",this.pause)},beforeDestroy:function(){this.player&&this.player.unload().catch((function(){})),this.$parent.$off("play",this.play),this.$parent.$off("stop",this.stop),this.$parent.$off("pause",this.pause)}},Rs=(0,U.Z)(Ls,Ts,Ms,!1,null,null,null).exports,Es=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{key:t.elementId,class:"wistia-player player wistia_embed wistia_async_"+t.id,attrs:{id:t.elementId},on:{wheel:function(t){t.stopPropagation()},click:function(t){t.stopPropagation()},touchstart:function(t){t.stopPropagation()},touchmove:function(t){t.stopPropagation()},touchstop:function(t){t.stopPropagation()},touchcancel:function(t){t.stopPropagation()},pointerdown:function(t){t.stopPropagation()},mousedown:function(t){t.stopPropagation()}}})},Os=[],Fs=i(1042),Ds=i(8531);function _s(){return _s=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(0,l.UZ)(t.target).indexOf("modal-close")>=0)&&(this.isClosing=!0,this.historyEnabled&&0!==window.history.length?window.history.back():this.hide())},loading:function(){this.isLoaded=!1},loaded:function(){this.isLoaded=!0},error:function(){this.hasError=!0},onResize:function(){if(this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight,this.isAndroid){var t=document.activeElement;if(0!==this.androidKeyboardShift||"input"!==t.tagName.toLowerCase()&&"textarea"!==t.tagName.toLowerCase())0!==this.androidKeyboardShift&&(this.androidKeyboardShift=0);else{var e,i=t.getBoundingClientRect();i.top>this.windowHeight/2&&this.windowHeight<((null===(e=this.rect)||void 0===e?void 0:e.height)||this.height)&&(this.androidKeyboardShift=-i.top/4)}}},onKeydown:function(t){"Escape"===t.code&&this.hide()}},mounted:function(){this.onResizeDebounced=(0,l.Ds)(this.onResize,100,!1),window.addEventListener("resize",this.onResizeDebounced),window.addEventListener("keydown",this.onKeydown),this.$root.$el.appendChild(this.$el)},beforeDestroy:function(){var t=this;window.removeEventListener("resize",this.onResizeDebounced),window.removeEventListener("keydown",this.onKeydown),this.$store.dispatch("workspace/setModalOpened",!1),this.isHideEventEmitted||this.$emit("hidden"),setTimeout((function(){var e,i;null===(e=(i=t.$el).remove)||void 0===e||e.call(i)}),this.delay)},components:{spinner:dt.Z}}),Gs={extends:pi,name:"ContentVideo",data:function(){var t;return{playerPromise:new Promise((function(e){t=e})),resolvePlayer:t,isModalShown:!1,isPlayerShown:!1,playerLoaded:!1,isPlaying:!1,volumeEnabled:!1,isEnded:!1,isMutedByPlayer:!1,tapTimeout:0,hasError:!1,videoData:null,showPreventer:!0,currentTime:null,lastProgressId:null,originalStartFrom:null,playedWhenFrozen:!1}},beforeMount:function(){this.data.originalUrl?this.videoData=this.getVideoInfo(this.data.originalUrl):this.videoData=this.data,this.originalStartFrom=this.videoData.startFrom},beforeDestroy:function(){this.saveTime(this.currentTime),this.unbindEvents()},watch:{isCurrentPage:"currentPageChanged",isPlaying:"setPlayingWithSound",isMutedByPlayer:"setPlayingWithSound",shouldAutoplay:function(t){!t||this.isPlayerShown||this.$store.state.workspace.pausedByReader[this.data.itemId]||this.startInline()},data:function(t){t.originalUrl?this.videoData=this.getVideoInfo(t.originalUrl):this.videoData=t},isInline:function(t,e){e&&!t&&this.isPlayerShown&&this.removeInline()},currentTime:function(t){this.saveTime(t)},isWorkspaceFrozen:function(t,e){t&&!e&&this.isInline&&this.removeInline(),!t&&e&&this.shouldAutoplay&&!this.$store.state.workspace.pausedByReader[this.data.itemId]&&this.startInline()},isLightboxShown:function(t){t&&!this.isModalShown?this.$emit("pause"):!this.isMobile&&this.data.autoplay&&this.isCurrentPage&&!this.$store.state.workspace.pausedByReader[this.data.itemId]&&this.$emit("play")}},mounted:function(){this.shouldAutoplay&&!this.$store.state.workspace.pausedByReader[this.data.itemId]&&this.startInline()},computed:{isInline:function(){var t=this.$store.state.workspace.userAgentInfo;return"dialog"!==this.data.mode&&!this.data.crossWide&&!t.browser.safari&&!this.isMobileApp&&!this.isPublisher&&this.data.rect[0]*this.data.scaleRatio.w>144&&this.data.rect[1]*this.data.scaleRatio.h>100},shouldAutoplay:function(){return!this.isFrozenOrNotReady&&!this.isEmbed&&!this.hasError&&!this.isPublisher&&!this.isMobile&&!this.isLightboxShown&&!this.$store.state.workspace.pausedByReader[this.data.itemId]&&this.isInline&&(this.$store.state.caniuse.video.inlineMutedAutoplay||this.$store.state.caniuse.video.inlineAutoplay)&&this.data.autoplay},isLightboxShown:function(){return this.$store.getters["lightbox/isShown"]||this.$store.state.workspace.modalOpened||null!==this.$store.state.popup.opened},shouldShowThumbnail:function(){return"dialog"!==this.data.mode||this.data.showImage},isThumbnailShown:function(){return this.shouldShowThumbnail&&!this.playerLoaded},isIos:function(){return this.$store.state.workspace.userAgentInfo.os.ios},isModalSmall:function(){return this.modalRect.height<=200},isPublisher:function(){return this.$store.state.workspace.userAgentInfo.browser.publisher},isMobileApp:function(){return"mobile-app"===this.$store.getters["info/version"]},apiVideoUrl:function(){var t="";switch(this.data.provider){case"youtube":t="https://www.youtube.com/watch?v="+this.data.id;break;case"vimeo":t="https://vimeo.com/"+this.data.id,this.data.accessKey?t="https://vimeo.com/"+this.data.id+"/"+this.data.accessKey:this.data.originalUrl&&(t=this.data.originalUrl.split("#")[0].split("?")[0]);break;case"wistia":t=this.data.account?"https://"+this.data.account+".wistia.com/medias/"+this.data.id:this.data.originalUrl?this.data.originalUrl.split("#")[0].split("?")[0]:"https://fast.wistia.net/embed/iframe/"+this.data.id;break;default:t=this.data.originalUrl||this.data.id}return t},modalRect:function(){var t=(0,Ce.Tj)({width:this.data.width?this.data.width:this.data.rect[0],height:this.data.height?this.data.height:this.data.rect[1]},{width:.8*this.workspaceSize.width,height:.8*this.workspaceSize.height});return{width:Math.round(t.width),height:Math.round(t.height)}},workspaceSize:function(){return this.$store.getters["workspace/size"]},modalVideoStyle:function(){return"youtube"===this.data.provider?null:{width:this.modalRect.width+"px",height:this.modalRect.height+"px"}},containerClasses:function(){return{error:this.hasError,"cross-wide":!!this.crossWideItem,highlighted:this.isHighlighted,"hover-button":"hover"===this.iconVisibility}},isMuted:function(){return this.$store.state.sound.muteSound||this.$store.state.sound.muteTemporary||this.isInline&&!this.$store.state.caniuse.video.inlineAutoplay&&this.$store.state.caniuse.video.inlineMutedAutoplay},isEmbed:function(){return this.$store.state.workspace.isEmbed},isWorkspaceFrozen:function(){return this.$store.getters["workspace/isFrozen"]},animationInProgress:function(){return this.$store.getters["workspace/animationInProgress"]},rawThumbnailUrl:function(){return this.data.image&&this.shouldShowThumbnail?(0,Je.n)({filenameOrUrl:this.data.image}):null}},methods:{onVideoClick:function(){this.animationInProgress||this.isResizing||(this.$store.commit("sound/SET_MUTE_TEMPORARY",!this.$store.state.caniuse.userInteractions.firstClick),this.$store.commit("workspace/SET_PAUSED_BY_READER",{itemId:this.data.itemId,value:!1}),Date.now()>this.tapTimeout&&setTimeout(this.videoClick,this.$store.state.workspace.doubletapInterval+1),this.tapTimeout=Date.now()+this.$store.state.workspace.doubletapInterval)},videoClick:function(){this.$store.commit("sound/SET_MUTE_TEMPORARY",!1),this.isFrozenOrNotReady||this.isEmbed||this.hasError||(this.isPublisher?this.$root.$emit("video",{action:"publisher",url:this.apiVideoUrl}):(this.$emit("video:click",this),this.isInline?this.startInline():this.openinModal()))},startInline:function(){var t,e=this;this.currentTime=this.loadTime(),this.videoData.startFrom=null!==(t=this.currentTime)&&void 0!==t?t:this.originalStartFrom,this.playerPromise.then((function(){"youtube"===e.data.provider&&(e.playerLoaded=!0)})),this.isPlayerShown=!0,this.$nextTick((function(){this.bindEvents()}))},removeInline:function(){var t=this;this.unbindEvents(),this.isPlayerShown=!1,this.playerLoaded=!1,this.playerPromise=new Promise((function(e){t.resolvePlayer=e}))},openinModal:function(){var t;this.currentTime=this.loadTime(),this.videoData.startFrom=null!==(t=this.currentTime)&&void 0!==t?t:this.originalStartFrom,this.$root.$emit("popupStateChanged",{state:1}),this.isModalShown=!0,this.$nextTick((function(){var t=this;this.$refs.modalWindow.show(),this.$nextTick((function(){this.bindEvents()})),this.$refs.modalWindow.$once("hidden",(function(){t.$root.$emit("popupStateChanged",{state:0}),t.isModalShown=!1,t.isPlaying=!1,t.$emit("video:close",t),t.$root.$emit("video",{action:"close",url:t.apiVideoUrl}),t.unbindEvents()}))}))},playPause:function(t){t.preventDefault(),this.isPlaying?this.$refs.player.pause():this.$refs.player.play()},getVideoInfo:function(t){var e=t.split("?"),i=e[0],s=e[1],o=i.split("#")[0],r=/(?:(?:https?:)?\/\/)?(?:[^.]+\.)?(\w+)(\.|\-)/.exec(o),n=r?r[1]:null,a=o.split("/"),h={provider:n,id:a[a.length-1]};switch(n){case"youtu":case"youtube":if(h.provider="youtube","watch"===h.id){var l=/v=([^&]+)/.exec(s);h.id=l?l[1]:null}break;case"vimeo":var c=/user[0-9]+\/\w+/,d=/^\d+$/;h.customUrl=c.exec(o)?o:null,h.customUrl||d.exec(h.id)||(h.accessKey=h.id,h.id=a[a.length-2]);break;case"wistia":var u=/https?:\/\/(.*)?(?:\.wistia\.com|fast\.wistia\.net)/.exec(o);h.account=u?u[1]:null}return(0,V.Z)(this.data,h)},currentPageChanged:function(t){t?this.isMobile||!this.data.autoplay||this.$store.state.workspace.pausedByReader[this.data.itemId]||this.$emit("play"):this.$emit("pause")},bindEvents:function(){var t=this;this.$refs.player.$on("play",(function(e,i,s){["vimeo","wistia"].includes(t.data.provider)&&t.$store.commit("workspace/SET_PAUSED_BY_READER",{itemId:t.data.itemId,value:null}),"youtube"!==t.data.provider&&t.isInline&&(t.playerLoaded=!0);var o=0===e||0===(null==e?void 0:e.seconds);t.isEnded&&o&&t.originalStartFrom&&t.$refs.player.setCurrentTime(t.originalStartFrom),t.isMutedByPlayer=s,t.isEnded=!1,t.isPlaying=!0,t.showPreventer=!0,t.$emit("video:play",e,t,i),t.$root.$emit("video",{action:"play",url:t.apiVideoUrl,time:e})})),this.$refs.player.$on("pause",(function(e,i,s){if(["vimeo","wistia"].includes(t.data.provider)){var o=t.$store.state.workspace.pausedByReader[t.data.itemId];t.$store.commit("workspace/SET_PAUSED_BY_READER",{itemId:t.data.itemId,value:o||null===o})}t.isPlaying=!1,t.isMutedByPlayer=s,t.currentTime=e,t.$emit("video:pause",e,t,i),t.$root.$emit("video",{action:"pause",url:t.apiVideoUrl,time:e})}));var e=function(e,i,s){t.isEnded=!0,t.isMutedByPlayer=s,t.isPlaying=!1,t.currentTime=t.originalStartFrom,t.$emit("video:end",e,t,i),t.$root.$emit("video",{action:"stop",url:t.apiVideoUrl,time:e})};this.$refs.player.$on("end",e),this.$refs.player.$on("ended",e);var i=function(e,i,s){t.currentTime=e,t.isMutedByPlayer=s,t.$emit("video:seek",e,t,i),t.$root.$emit("video",{action:"seekTo",url:t.apiVideoUrl,time:e})};this.$refs.player.$on("seek",i),this.$refs.player.$on("seeked",i),this.$refs.player.$on("timeupdate",(function(e,i,s){t.isMutedByPlayer=s,t.currentTime=e})),this.$refs.player.$on("secondchange",(function(e,i,s){"wistia"===t.data.provider&&t.isEnded||(t.currentTime=e),t.isMutedByPlayer=s})),this.$refs.player.$on("error",(function(e,i,s){"PasswordError"!==e.name&&"PrivacyError"!==e.name?(t.$emit("video:error",e,t,i),t.isModalShown=!1,t.isPlayerShown=!1,t.playerLoaded=!1,t.isPlaying=!1,t.hasError=!0,t.isMutedByPlayer=s):t.showPreventer=!1})),this.$refs.player.$on("loaded",(function(e,i,s){t.showPreventer=!0,"youtube"!==t.data.provider&&t.isInline&&(t.playerLoaded=!0),t.isMutedByPlayer=s,t.$emit("video:loaded",e,t,i)})),this.$refs.player.$on("ready",(function(){t.$nextTick((function(){t.resolvePlayer()}))}))},unbindEvents:function(){this.$refs.player&&(this.$refs.player.$off("play"),this.$refs.player.$off("pause"),this.$refs.player.$off("end"),this.$refs.player.$off("ended"),this.$refs.player.$off("seek"),this.$refs.player.$off("seeked"),this.$refs.player.$off("error"),this.$refs.player.$off("loaded"),this.$refs.player.$off("ready"))},setPlayingWithSound:function(){this.$store.state.caniuse.userInteractions.firstClick||this.isMutedByPlayer||this.$store.dispatch("caniuse/setFirstClick"),this.$store.dispatch("content/setVideoPlayingWithSound",{playing:this.isPlaying&&!this.isMutedByPlayer,itemId:this.data.itemId})},getVideoHash:function(t){return[[this.videoData.page.id,this.videoData.page.isWide?"wide":this.videoData.page.side].join("_"),this.videoData.provider,this.videoData.id,t].join("_")},saveTime:function(t){var e=this.getVideoHash("time"),i=this.getVideoHash("id"),s=(0,d.Z)().getSessionStorage().getItem(i);this.data.crossWide&&s&&s!=this.lastProgressId||(this.lastProgressId=Date.now(),(0,d.Z)().getSessionStorage().setItem(e,t),(0,d.Z)().getSessionStorage().setItem(i,this.lastProgressId))},loadTime:function(){var t=this.getVideoHash("time"),e=(0,d.Z)().getSessionStorage().getItem(t),i=e?parseInt(e,10):null,s=this.getVideoHash("id");return this.lastProgressId=(0,d.Z)().getSessionStorage().getItem(s),null===i||isNaN(i)?null:i}},components:{ContentButton:Fi,youtube:xs,vimeo:Rs,wistia:Zs,"modal-window":(0,U.Z)(Us,Vs,js,!1,null,"1536e47e",null).exports}},Xs=(0,U.Z)(Gs,ss,os,!1,null,null,null).exports,Ys=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("transition",{attrs:{name:"panel-fade"}},[i("div",{directives:[{name:"show",rawName:"v-show",value:(t.showPanel||t.forceShow)&&!t.inProgress&&!t.contextMenuVisible,expression:"(showPanel || forceShow) && !inProgress && !contextMenuVisible"}],ref:"copyPanel",staticClass:"select-text-panel",class:t.panelClass,style:t.panelStyle,attrs:{dir:t.blockDirection},on:{mouseenter:t.onMouseEnter,mouseleave:t.onMouseLeave}},[i("div",{staticClass:"pointer",style:t.pointerStyle}),t._v(" "),i("span",{staticClass:"button",on:{click:t.copyText}},[t._v(t._s(t.$t("RightClickMenu.COPY_TEXT")))]),t._v(" "),t.isOnline?i("span",{staticClass:"divider"},[t._v("|")]):t._e(),t._v(" "),t.isOnline?i("span",{staticClass:"button",on:{click:t.copyTextLink}},[t._v(t._s(t.$t("RightClickMenu.SHARE_SELECTED_TEXT")))]):t._e()])])},qs=[],Ks={name:"select-text-panel",data:function(){return{showPanel:!1,forceShow:!1,panelStyle:{},panelRect:{},vertical:null,rightOffset:!1,showPanelTimeout:null,pointerStyle:{}}},mounted:function(){this.$root.$on("selectText:hidePanel",this.hide),this.$root.$on("selectText:showPanel",this.show)},beforeDestroy:function(){this.$root.$off("selectText:hidePanel",this.hide),this.$root.$off("selectText:showPanel",this.show)},computed:{isSlideMode:function(){return this.$store.state.pager.slideMode},userRect:function(){return this.$store.state.text.selectionRect},pageId:function(){return this.$store.state.text.pageID},pageSide:function(){return this.$store.state.text.pageSide},inProgress:function(){return this.$store.state.text.inProgress},pageSize:function(){return this.$store.state.pages.size},cornerSymbols:function(){return this.$store.state.text.cornerSymbols},holderSize:function(){return this.$store.getters["workspace/holderSize"]},bookComponent:function(){return this.$store.state.workspace.bookComponent},locale:function(){return this.$store.getters["i18n/getCurrent"]},blockDirection:function(){return this.$store.getters["i18n/isLocaleRtl"]?"rtl":null},isRtl:function(){return this.$store.state.book.rightToLeft},panelClass:function(){return this.vertical+(this.rightOffset?" right-side":"")+(this.contextMenuVisible?" quick-leave":"")},pages:function(){var t=this.$store.getters["pager/currentPages"].length;return this.$store.getters["pages/pageProp"](this.pageId,"wide")?2:t},hardcoverTopPadding:function(){return this.$store.getters["book/hasHardcover"]?this.$store.state.pager.spreadMode?1===this.pages&&(this.$store.getters["pages/isFirstPage"](this.pageId)||this.$store.getters["pages/isLastPage"](this.pageId))?-.03*this.pageSize.height/2:0:this.$store.state.pager.singleMode&&this.$store.getters["pages/isFirstPage"](this.pageId)?-.03*this.pageSize.height/2:0:0},hardcoverLeftPadding:function(){return this.$store.getters["book/hasHardcover"]&&(this.$store.state.pager.spreadMode&&1===this.pages&&(!this.isRtl&&this.$store.getters["pages/isLastPage"](this.pageId)||this.isRtl&&this.$store.getters["pages/isFirstPage"](this.pageId))||this.$store.state.pager.singleMode&&this.isRtl&&this.$store.getters["pages/isFirstPage"](this.pageId))?-.03*this.pageSize.width:0},pageLeftPadding:function(){var t=this.$store.getters["pages/pageProp"](this.pageId,"wide");return this.$store.getters["pager/isFirstSpread"]||"right"!==this.pageSide||(this.isRtl&&this.$store.getters["pages/isLastPage"](this.pageId)||t)&&!this.$store.state.pager.singleMode?0:this.$store.state.pager.spreadMode?this.pageSize.width:this.$store.state.pager.singleMode&&t?-this.pageSize.width:0},contextMenuVisible:function(){return this.$store.state.workspace.contextMenuVisible},isOnline:function(){return!this.$store.getters["workspace/isOffline"]},pagesWidth:function(){var t,e=this.$store.getters["pager/state"];if(e.slideMode)t=this.holderSize.width;else{var i=e.leftPage&&e.rightPage;t=this.$store.state.pages.size.width*(i?2:1)}return t},workspaceSize:function(){return this.$store.getters["workspace/size"]},isZoomed:function(){return 1!==this.$store.state.pages.size.zoomFactor},bookContainerWidth:function(){var t=this.$store.state.sidebar.opened?this.$store.state.sidebar.width:0;return this.workspaceSize.width-t}},methods:{hide:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{forceHide:!0};this.showPanel=!1,t.forceHide&&(this.forceShow=!1)},show:function(){var t=this,e="first:"+this.cornerSymbols.first.left+"-"+this.cornerSymbols.first.top+" last:"+this.cornerSymbols.last.left+"-"+this.cornerSymbols.last.top;null===this.userRect||this.showPanel&&this.cornerSymbolsCode===e||(this.showPanel=!0,this.cornerSymbolsCode=e,this.$nextTick((function(){t.setPosition()})))},setPosition:function(){var t=this.calculatePanelPosition();this.panelRect.left=t.left,this.panelRect.top=t.top,this.vertical=t.vertical,this.panelStyle={left:this.panelRect.left+"px",top:this.panelRect.top+"px"}},calculatePanelPosition:function(){var t;t=this.cornerSymbols.first.top===this.cornerSymbols.last.top?"left"===this.userRect.cursorHSide?{vertical:"top",horizontal:"first"}:{vertical:"bottom",horizontal:"last"}:"top"===this.userRect.cursorVSide?{vertical:"top",horizontal:"first"}:{vertical:"bottom",horizontal:"last"};var e="[data-zoom-wrapper]",i=new window.WebKitCSSMatrix(window.getComputedStyle(this.$root.$el.querySelector(e)).transform),s=i.m41,o=i.m42,r=50,n=this.calculatePanelCoordinates({position:t,zoomWrapperTranslateX:s});return this.isZoomed?n.top+othis.holderSize.height-r&&(t.vertical="top",n=this.calculatePanelCoordinates({position:t,zoomWrapperTranslateX:s})):n.topthis.holderSize.height-r&&(t.vertical="top",n=this.calculatePanelCoordinates({position:t,zoomWrapperTranslateX:s})),t=(0,V.Z)(t,n)},calculatePanelCoordinates:function(t){var e,i,s,o,r,n=t.position,a=t.zoomWrapperTranslateX,h=null!==(e=null===(i=this.userRect)||void 0===i?void 0:i.offsetX)&&void 0!==e?e:0,l=null!==(s=this.userRect.offsetY)&&void 0!==s?s:0,c=this.cornerSymbols[n.horizontal],d=this.cornerSymbols.first.top!==this.cornerSymbols.last.top,u=this.cornerSymbols.first.isRtlSelection&&d,p=n.horizontal===(u?"last":"first")&&c.collisions.left||n.horizontal===(u?"first":"last")&&!c.collisions.right?c.width:0,g="bottom"===n.vertical?c.height:0,f=this.pageLeftPadding+this.hardcoverLeftPadding+c.left+p+h,m=this.hardcoverTopPadding+c.top+g+l;if(this.isZoomed){var v=this.isSlideMode&&this.holderSize.left<0?0:this.holderSize.left,b=!this.isSlideMode&&this.bookContainerWidth>this.pagesWidth?(this.bookContainerWidth-this.pagesWidth)/2:0;o=this.$el.offsetWidth/2-v-a-b,r=this.bookContainerWidth-this.$el.offsetWidth/2-v-a-b}else o=this.$el.offsetWidth/2-this.holderSize.left,r=this.pagesWidth-(this.$el.offsetWidth/2-this.holderSize.left);var S=this.isZoomed&&(this.$el.offsetWidth/2-(o-f)<23||this.$el.offsetWidth/2-(f-r)<23);return this.pointerStyle.marginLeft=null,this.pointerStyle.display=S?"none":"block",fr&&(this.pointerStyle.marginLeft=f-r+"px",f=r),{left:f,top:m}},copyText:function(){this.$root.$emit("contextMenu:copyText"),this.hide()},copyTextLink:function(){this.$root.$emit("contextMenu:copyTextLink"),this.hide()},onMouseEnter:function(){this.forceShow=!0},onMouseLeave:function(){this.forceShow=!1}}},Qs=Ks,Js=(0,U.Z)(Qs,Ys,qs,!1,null,"122cbd9d",null).exports,to=i(6373);function eo(){return eo=Object.assign?Object.assign.bind():function(t){for(var e=1;ee.width+e.left-t.left?e.width+e.left-t.left:t.width,height:t.height,left:t.left-e.left,top:t.top-e.top};return i.left<0&&(i.width=i.width+i.left,i.left=0),i},checkScaleFactorForZoom:function(t,e,i){return 1*(e*t).toFixed(2)>i?i/e:t},getScrollAmount:function(t,e,i,s,o){if(t&&t.direction){var r,n;switch(t.direction){case"left":r=e<-100?100:-e;break;case"up":r=i<-100?100:-i;break;case"right":r=e-100>-(n=Math.max(o.width-s.width,0))?-100:-n-e;break;case"down":r=i-100>-(n=Math.max(o.height-s.height,0))?-100:-n-i}return r}},getSuitableZoomFactor:function(t,e,i,s){if(0===e)return null;var o=[1.1,1.25,1.5,1.75,2,2.5,3,3.5,4,4.5,5].filter((function(t){return t>=i&&t<=s})).filter((function(i){return e>0?i>t:i0?o.shift():o.pop()},showSelectTextTip:function(){this.$store.getters["workspace/canShowSelectTextTip"]&&(this.$store.dispatch("workspace/setFlashMessage",{text:this.$tc("AlertMessage.SELECT_TEXT_TIP",0,{key:this.isMac?"⌘":"Ctrl"}),delay:1500}),this.$store.dispatch("workspace/increaseSelectTextTipShowsCount"))}}};function no(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};return{width:Math.round(t.width*e),height:Math.round(t.height*e),top:Math.round(t.top+(i.y-i.y*e)),left:Math.round(t.left+(i.x-i.x*e))}}function ao(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{x:0,y:0};return{width:Math.round(e.width*i),height:Math.round(e.height*i),top:Math.round(t.height/2-s.y*i+2*t.top),left:Math.round(t.width/2-s.x*i+2*t.left)}}function ho(t,e){var i=t.width,s=t.height,o=t.top,r=t.left;return s0?o=0:s+o0?r=0:i+r2&&void 0!==arguments[2]?arguments[2]:1;return 1===i?{x:0,y:0}:{x:Math.round((t.left-e.left)/(i-1)),y:Math.round((t.top-e.top)/(i-1))}}i(8384),i(6965),i(9036),i(464),i(925);var co=i(5109),uo={"content-block":fi,"content-link":yi,"content-image":Bi,"content-gallery":ji,"content-gif":is,"content-video":Xs},po={name:"FlipBook",mixins:[oo,ro,p.Z],props:{containerSize:{type:Object,required:!0},pageSize:{type:Object,required:!0}},components:{page:bt,selectTextPanel:Js},data:function(){return{status:"ready",zoomFactor:1,scaleFactor:1,scaleOrigin:{x:0,y:0},holderScrollTop:0,holderScrollLeft:0,holderScrollY:0,holderScrollX:0,zoomTimeout:0,addNoteTimeout:0,hideLeftArrow:!1,hideRightArrow:!1,visiblePages:"right",animation:!1,lastWheelTime:0,dragActive:!0,stripesWidth:0,dragging:!1,lastZoomFactor:null,overriddenPagerState:null}},beforeMount:function(){this.visiblePages=this.getVisiblePages(),this.lastZoomFactor=this.defaultZoomFactor,this.zoomFactor=this.$store.state.pages.size.zoomFactor,this.setPageSize(this.pageSize)},mounted:function(){var t={};t.bookWidth=2*this.$store.state.pages.size.width,t.bookHeight=this.$store.state.pages.size.height,this.bookHolderElement=this.$el.querySelector("#book-holder"),this.lastZoomBlockID=null,this.flipAdapter=new Ye({bookSize:this.bookSize,state:this.$store,container:this.bookHolderElement,parentVm:this,contentCreator:this.contentCreator,initDomEvents:!this.isEmbed,isMobile:this.isMobile,version:this.version}),this.toggleBlockOnFlip(),this.flipAdapter.on("render:start",this.onRenderStart,this),this.flipAdapter.on("render:finish",this.onRenderFinish,this),this.flipAdapter.on("flip:finished",this.onFlipFinished,this),this.$root.$on("contextMenu:zoomIn",this.zoomIn),this.$root.$on("contextMenu:zoomOut",this.zoomOut),this.$root.$on("bottomMenu:zoomIn",this.zoomIn),this.$root.$on("bottomMenu:zoomOut",this.zoomOut),this.$root.$on("zoomPanel",this.changeZoom),this.$root.$on("zoomMove",this.zoomMove),this.$root.$on("wheel",this.onWheel),this.zoomFactor>1&&this.refreshScroll()},beforeDestroy:function(){this.$root.$off("contextMenu:zoomIn",this.zoomIn),this.$root.$off("contextMenu:zoomOut",this.zoomOut),this.$root.$off("bottomMenu:zoomIn",this.zoomIn),this.$root.$off("bottomMenu:zoomOut",this.zoomOut),this.$root.$off("zoomPanel",this.changeZoom),this.$root.$off("zoomMove",this.zoomMove),this.$root.$off("wheel",this.onWheel),this.flipAdapter.off("render:start",this.onRenderStart,this),this.flipAdapter.off("render:finish",this.onRenderFinish,this),this.flipAdapter.off("flip:finished",this.onFlipFinished,this),this.flipAdapter.destructor()},watch:{forceRerender:function(){this.forceRerender&&(this.$store.dispatch("pager/setForceRerender",{forceRerender:!1}),this.flipAdapter.resetBook())},pageSize:function(t){this.setPageSize(t)},zoomFactor:function(t,e){var i=this;this.toggleBlockOnFlip();var s={width:this.pageSize.width,height:this.pageSize.height};if(s.width=s.width*t,s.height=s.height*t,s.zoomFactor=t,this.$store.dispatch("pages/changePageSize",s),t>1&&1===e){var o=this.$store.getters["pager/currentPages"].some((function(t){return i.$store.getters["pages/pageProp"](t,"textBlocks")}),this);this.selectTextEnabled&&o&&!this.$store.state.pager.isMoveWatcherActive&&this.showSelectTextTip()}},zoomPanel:function(){this.toggleBlockOnFlip()},status:function(t){"ready"!==t?(this.$store.dispatch("pager/freeze",{target:"flip-book-zoom"}),this.$store.dispatch("workspace/setAnimationProgress",{animationType:this.scaleFactor>1&&1===this.zoomFactor?"initialZoom":"zoomNotInitial"})):(this.$store.dispatch("pager/unfreeze",{target:"flip-book-zoom"}),this.$store.dispatch("workspace/unsetAnimationProgress")),this.toggleBlockOnFlip(),this.refreshScroll(),this.$store.dispatch("workspace/setStatus",t)},bookSize:function(t){this.flipAdapter.resizeBook(t)},singleMode:function(t){this.zoomOut(!0),this.flipAdapter.setSingleMode(t)},currentPages:function(t,e){var i=this;if(t.mode===e.mode||t.zoomMode===e.zoomMode)if(t.isEqualState(e))t.zoomMode?this.zoomIn():this.zoomOut(!1);else{var s=function(t,e,s){t.mode===e.mode&&i.$store.dispatch("sound/playFlipSound",{hardcover:e.hardcover||t.hardcover});var o=i.$store.getters["pager/getDeltaTurns"](e,t);if(1===Math.abs(o)){var r=o>0?"toLeft":"toRight",n=o>0?!t.rightPage||t.isLastSpread:!t.leftPage||t.isFirstSpread;"flipComponent"!==t.target&&"orientation"!==t.target&&n&&i.$store.dispatch("pager/setForceFlip",{forceFlip:!0}),i.flipAdapter.updateState(r,t,s)}else Math.abs(o)>1&&i.flipAdapter.updateState("toPage",t,s)};if(1!==this.zoomFactor){this.overriddenPagerState=e,this.zoomOut(!1);var o=this.$store.getters["pager/flipState"];this.$once("transition:end",(function(){i.overriddenPagerState=null,setTimeout(s.bind(i,t,e,o),0)}))}else{var r=this.$store.getters["pager/flipState"];setTimeout(s.bind(this,t,e,r),0)}}},isWorkspaceFrozen:function(t){t?this.flipAdapter.block(!1):this.flipAdapter.unblock()},workspaceSize:function(){var t;if(1!==this.zoomFactor){var e;if(this.isInitialZoom)e={x:this.isRTLBook?this.bookHolderSize.width:0,y:0};else e={x:this.bookHolderSize.width>this.containerSize.width?-this.holderScrollX+this.containerSize.width/2:this.bookHolderSize.width/2,y:this.bookHolderSize.height>this.containerSize.height?-this.holderScrollY+this.containerSize.height/2:this.bookHolderSize.height/2};var i={x:e.x-this.bookHolderSize.left,y:e.y-this.bookHolderSize.top};this.scaleFactor=1;var s=ao(this.containerSize,this.bookHolderSize,this.scaleFactor,i);s=ho(s,this.containerSize),this.fixBounds(s),this.holderScrollLeft=s.left,this.holderScrollTop=s.top,null===(t=this.scrollComponent)||void 0===t||t.refresh(),this.isInitialZoom&&this.$store.dispatch("workspace/clearInitialZoom")}},isRTLBook:function(t){this.flipAdapter.setRtl(t)},isHardcover:function(t){this.zoomOut(!0),this.flipAdapter.setHardcover(t),this.$root.$emit("forceBookResize")},hardcoverColor:function(t){this.flipAdapter.setHardcoverColor(t)},hasThickness:function(t){this.flipAdapter.setThickness(t)},isOnlyRightPage:function(){var t=this.getVisiblePages();t!==this.visiblePages&&(this.visiblePages=t)},isOnlyLeftPage:function(){var t=this.getVisiblePages();t!==this.visiblePages&&(this.visiblePages=t)},dragActive:function(t){t?this.$refs.bookHolder.$el.classList.remove("nodrag"):this.$refs.bookHolder.$el.classList.add("nodrag")},isMini:function(){this.zoomOut(!0)},workspaceBookSize:function(){this.zoomOut(!0)},orientationChanged:function(t,e){e&&this.isMobile&&this.zoomOut(!0)}},computed:{isFirstSpread:function(){return this.$store.getters["pager/isFirstSpread"]},isLastSpread:function(){return this.$store.getters["pager/isLastSpread"]},isOuterHardcover:function(){return this.isHardcover&&(this.isFirstSpread||this.isLastSpread)},bookSize:function(){var t,e=this.$store.state;return t=e.book.rightToLeft?"left"===this.visiblePages?-e.pages.size.width:0:this.singleMode||"right"===this.visiblePages?-e.pages.size.width:0,{width:2*this.$store.state.pages.size.width,height:this.$store.state.pages.size.height,top:this.containerSize.top+(this.containerSize.height-e.pages.size.height)/2,left:t}},isOnlyRightPage:function(){var t,e=null!==(t=this.overriddenPagerState)&&void 0!==t?t:this.$store.getters["pager/state"];return e.spreadMode&&null===e.leftPage},isOnlyLeftPage:function(){var t,e=null!==(t=this.overriddenPagerState)&&void 0!==t?t:this.$store.getters["pager/state"];return e.spreadMode&&null===e.rightPage},isOnlyPage:function(){return 1===this.$store.getters["pages/pagesCount"]},bookHolderSize:function(){var t,e,i="both"!==this.visiblePages,s=this.$store.getters["pages/size"],o=this.singleMode,r=this.isHardcover?1.03:1,n=this.containerSize.width,a=this.containerSize.height,h=this.holderScrollLeft,l=this.holderScrollTop,c=this.stripesWidth||0,d=24,u=i||o?s.width:2*s.width,p=s.height;return 1===this.zoomFactor?(t=(n-u)/2,e=(a-p)/2):(t=h,e=l),this.$store.dispatch("workspace/setHolderSize",{width:u*r+2*c+2*d,height:p*r,left:1===this.zoomFactor?t:0,top:1===this.zoomFactor?e:0}),{width:Math.round(u),height:Math.round(p),top:Math.round(e),left:Math.round(t)}},bookHolderStyle:function(){var t=this.bookHolderSize,e=this.containerSize,i=this.zoomFactor,s=this.scaleOrigin,o=this.holderScrollLeft,r=this.holderScrollTop,n=this.scaleFactor,a=this.status,h=this.fastAnimation,l=this.animationSpeed,c=e.height>=t.height?Math.round(t.top)+"px":"0",d=e.width>=t.width?Math.round(t.left)+"px":"0",u={width:t.width+"px",height:t.height+"px",top:1===i?t.top+"px":c,left:1===i?t.left+"px":d};if("animating"===a||"pinch"===a||"scale"===a){u.transformOrigin=s.x+"px "+s.y+"px";var p="translate("+(e.width=.9?t.square=!0:e>1.1?t.portrait=!0:t.landscape=!0),t.scaling="scale"===this.status,t["drag-active"]=this.dragging,t["single-page"]=this.pageCount<=2,t["single-mode"]=this.singleMode,t},pageCount:function(){return this.$store.getters["pages/pagesCount"]},currentPages:function(){var t=this.$store.getters["pager/state"],e=this.$store.getters["pages/isFirstPage"](t.currentPage),i=t.spreadMode&&!this.$store.state.pager.spread_rightPage,s=this.isHardcover&&(e||i);return(0,V.Z)(t,{hardcover:s})},singleMode:function(){return this.$store.state.pager.singleMode},forceRerender:function(){return this.$store.state.pager.forceRerender},holderOriginalWidth:function(){return"both"!==this.visiblePages||this.singleMode?this.pageSize.width:2*this.pageSize.width},isWorkspaceFrozen:function(){return this.$store.state.workspace.freezed},frozenBy:function(){return this.$store.state.workspace.frozenBy?this.$store.state.workspace.frozenBy:null},zoomPanel:function(){return this.$store.state.workspace.zoomPanel},wheelScroll:function(){return this.$store.state.workspace.wheelScroll},workspaceSize:function(){return this.$store.state.workspace.containerSize},workspaceBookSize:function(){return this.$store.state.workspace.bookSize},orientationChanged:function(){return this.$store.getters["workspace/orientation"]},minZoom:function(){var t=this.isHardcover&&(this.isFirstPage||this.isLastPage)?1.03:1,e=this.singleMode?1:2;return Math.min(this.$store.state.workspace.containerSize.height/(this.$store.state.pages.size.height*t/this.$store.state.pages.size.zoomFactor),this.$store.state.workspace.containerSize.width/(this.$store.state.pages.size.width*t*e/this.$store.state.pages.size.zoomFactor))},maxZoom:function(){return this.$store.state.workspace.maxZoom},isInitialZoom:function(){return this.$store.state.workspace.initialZoom},animationSpeed:function(){return this.scaleFactor<1?400:600},isMini:function(){return this.$store.state.workspace.mini},isEmbed:function(){return this.$store.state.workspace.isEmbed},version:function(){return this.$store.getters["info/version"]},isMobile:function(){return this.$store.getters["workspace/isMobile"]},isFirefox:function(){return!0===this.$store.state.workspace.userAgentInfo.browser.firefox},isIE:function(){return!0===this.$store.state.workspace.userAgentInfo.browser.msie},isSafari:function(){return!!this.$store.state.workspace.userAgentInfo.browser.safari},isMac:function(){return!0===this.$store.state.workspace.userAgentInfo.os.mac},isRTLBook:function(){return this.$store.state.book.rightToLeft},isLocaleRtl:function(){return this.$store.getters["i18n/isLocaleRtl"]},isHardcover:function(){return this.$store.getters["book/hasHardcover"]},hardcoverColor:function(){return this.$store.state.book.hardcoverColor},hasThickness:function(){return this.$store.state.book.thickness},isFirstPage:function(){var t=this.$store.getters["pager/isFirstSpread"],e=this.$store.getters["pager/isLastSpread"];return this.isRTLBook?e:t},isLastPage:function(){var t=this.$store.getters["pager/isLastSpread"],e=this.$store.getters["pager/isFirstSpread"];return this.isRTLBook?e:t},isSecondPage:function(){var t=this.$store.getters["pager/prevPageId"];return this.$store.getters["pages/isFirstPage"](t)},isSecondToLastPage:function(){var t=this.$store.getters["pager/nextPageId"];return this.$store.getters["pages/isLastPage"](t)},isLightboxShown:function(){return this.$store.getters["lightbox/isShown"]},showBookButtons:function(){return!this.isLightboxShown&&1===this.zoomFactor&&1===this.scaleFactor&&"html"===this.version},showLeftButtons:function(){var t=this.showBookButtons&&!this.isFirstPage&&!(this.hideLeftArrow&&(this.isRTLBook?this.isSecondToLastPage:this.isSecondPage));return t||this.switchFocus("left","right"),t},showRightButtons:function(){var t=this.showBookButtons&&!this.isLastPage&&!(this.hideRightArrow&&(this.isRTLBook?this.isSecondPage:this.isSecondToLastPage));return t||this.switchFocus("right","left"),t},notesEnabled:function(){return this.$store.state.workspace.components.notes&&!this.isMini},showRightAddNote:function(){return(this.showRightButtons||this.hideRightArrow)&&(!this.isLocaleRtl||this.isFirstPage)},showOnlyAddNote:function(){return this.showBookButtons&&this.notesEnabled&&this.isOnlyPage},addNoteTitleText:function(){return this.$t("NotesToolWindow.ADD_NOTE")},leftArrowTitle:function(){return this.isRTLBook?this.$t("NavigationPanel.NEXT_PAGE_TIP"):this.$t("NavigationPanel.PREV_PAGE_TIP")},rightArrowTitle:function(){return this.isRTLBook?this.$t("NavigationPanel.PREV_PAGE_TIP"):this.$t("NavigationPanel.NEXT_PAGE_TIP")},leftMostArrowTitle:function(){return this.isRTLBook?this.$t("NavigationPanel.LAST_PAGE_TIP"):this.$t("NavigationPanel.FIRST_PAGE_TIP")},rightMostArrowTitle:function(){return this.isRTLBook?this.$t("NavigationPanel.FIRST_PAGE_TIP"):this.$t("NavigationPanel.LAST_PAGE_TIP")},bookState:function(){return this.flipAdapter},selectTextEnabled:function(){return!this.isMobile&&!this.isIE&&this.$store.state.workspace.components.textSelection},arrowAttract:function(){var t=this.$store.getters["workspace/callToNavigation"];return"arrow"===t.type&&t.side},bookEventHandlers:function(){return this.isEmbed?null:{pinchstart:this.onPinchStart,pinchmove:this.onPinchMove,pinchend:this.onPinchFinish,pinchcancel:this.onPinchFinish}},bookHolderEventHandlers:function(){var t=this.isEmbed?{}:{doubletap:this.zoomByTap.bind(this,"tap")};return t.tap=this.isHardcover?this.clickOnCover:function(){},t}},methods:{fixBounds:function(t){if(this.isOuterHardcover){var e=this.scaleFactor*this.zoomFactor;if(e>1||e<.95){var i=this.isFirstSpread&&!this.isRTLBook||this.isLastSpread&&this.isRTLBook&&!this.singleMode,s=this.isLastSpread&&!this.isRTLBook&&!this.singleMode||this.isFirstSpread&&this.isRTLBook,o=this.$store.state.pages.size.width,r=Math.round(.03*o/this.zoomFactor*e/2);i?t.left=t.left-r:s&&(t.left=t.left+r)}}},setPageSize:function(t){var e={width:t.width*this.zoomFactor,height:t.height*this.zoomFactor,zoomFactor:this.zoomFactor};this.$store.dispatch("pages/changePageSize",e)},clickOnCover:function(t){for(var e=(0,l.iZ)(t.target),i=0,s=e.length;i1||this.scaleFactor>1)return;this.$store.state.notes.opened&&this.$store.dispatch("notes/setOpenedId",{id:null}),t.deltaY>0?this.$store.dispatch("pager/goForward",{target:"wheel"}):t.deltaY<0&&this.$store.dispatch("pager/goBackward",{target:"wheel"})}this.lastWheelTime=Date.now()}},zoomMove:function(t){if(t&&t.direction)if("ready"===this.status){var e;switch(t.direction){case"left":case"right":e=this.getScrollAmount(t,this.scrollComponent.x,0,this.containerSize,this.bookHolderSize),this.scrollComponent.scrollBy(e,0);break;case"up":case"down":e=this.getScrollAmount(t,0,this.scrollComponent.y,this.containerSize,this.bookHolderSize),this.scrollComponent.scrollBy(0,e);break;case"drag":this.dragActive=t.active,this.initScrollComponent(this.dragActive)}this.scrollComponent&&(this.holderScrollX=this.scrollComponent.x,this.holderScrollY=this.scrollComponent.y,this.$store.dispatch("text/setHolderScroll",{x:this.holderScrollX,y:this.holderScrollY}))}else"drag"===t.direction&&(this.dragActive=t.active)},getVisiblePages:function(){return this.isOnlyRightPage?"right":this.isOnlyLeftPage?"left":"both"},toggleBlockOnFlip:function(){var t=this;1!==this.zoomFactor||this.zoomPanel||"ready"!==this.status?this.flipAdapter.block(!0):setTimeout((function(){t.flipAdapter.unblock()}),20)},refreshScroll:function(){var t=this;this.cancelDragging(),this.$nextTick((function(){t.zoomFactor>1&&"ready"===t.status?t.initScrollComponent(t.dragActive):t.scrollComponent&&(t.holderScrollX=0,t.holderScrollY=0,t.$store.dispatch("text/setHolderScroll",{x:t.holderScrollX,y:t.holderScrollY}),t.scrollComponent.destroy(),delete t.scrollComponent)}))},onScrollEnd:function(){this.cancelDragging(),this.holderScrollX=this.scrollComponent.x,this.holderScrollY=this.scrollComponent.y,this.$store.dispatch("text/setHolderScroll",{x:this.holderScrollX,y:this.holderScrollY})},onScrollBegin:function(){this.holderScrollX=this.scrollComponent.x,this.holderScrollY=this.scrollComponent.y,this.$store.dispatch("text/setHolderScroll",{x:this.holderScrollX,y:this.holderScrollY})},setDragging:function(){1!==this.zoomFactor&&(this.dragging=!0)},cancelDragging:function(){this.dragging=!1},zoomOut:function(t,e){if(1!==this.zoomFactor){if(this.lastZoomFactor=Math.max(this.zoomFactor,this.defaultZoomFactor),t)return this.status="calculating",this.zoomFactor=1,this.scaleFactor=1,this.refreshScroll(),this.holderScrollLeft=0,this.holderScrollTop=0,this.status="ready",this.$root.$emit("unzoomed"),void(this.fastAnimation=!1);this.zoomByTap(e,{center:{x:0,y:0}})}},zoomIn:function(t){this.zoomFactor>1||this.zoomByTap(t)},zoomByTap:function(t,e){if(t&&this.$store.dispatch("pager/setLastTarget",t),!(this.zoomTimeout>Date.now()||this.isWorkspaceFrozen||"ready"!==this.status||"pending"!==this.$store.state.pager.flipState||this.isMini)){e||(e={center:{x:this.isRTLBook?this.workspaceSize.width:0,y:0},target:null});var i=["next-button","previous-button","icon-book-next","icon-book-prev","reflex-container"];if(!e.target||!(i.indexOf(e.target.className)>=0||e.target.classList.contains("stripe")||e.target.classList.contains("page-stripe")||(0,_.HD)(e.target.className)&&e.target.className.indexOf("stripe-block")>=0||"0-0"===e.target.dataset.page||"textarea"===e.target.tagName.toLowerCase())){this.status="calculating";var s,o=!1,r=this.getTappedZoomBlock(e);if(this.isMobile&&r.id){o=this.lastZoomBlockID!==r.id;var n=this.bookHolderElement.getBoundingClientRect();s=this.getBlockRect(r.rect,n)}if(this.lastZoomBlockID=o?r.id:null,o){var a=1.5,h=40,l=2,c=this.containerSize.width-h*l,d=1*(.96*c/s.width).toFixed(2),u=this.bookHolderSize.width-s.width-s.left;(s.left*d1),this.scaleFactor>1?this.$root.$emit("zoomed"):(this.scaleFactor<1||this.zoomPanel&&1===this.scaleFactor)&&this.$root.$emit("unzoomed"),this.$store.dispatch("workspace/setHighlightTimeout",Date.now()+1e3)}}},onPinchStart:function(t){this.isWorkspaceFrozen||"ready"!==this.status||"inProgress"===this.$store.state.pager.flipState||this.isMini||(this.$store.dispatch("pager/setLastTarget","pinch-zoom"),this.minScale=this.holderOriginalWidth/this.bookHolderSize.width,this.scaleFactor=1,this.pinchCenter=t.center,this.isZoomed?(this.updateHolderScroll(!1),this.scaleOrigin={x:t.center.x-this.holderScrollLeft,y:t.center.y-this.holderScrollTop}):this.scaleOrigin={x:t.center.x-this.bookHolderSize.left,y:t.center.y-this.bookHolderSize.top},this.status="pinch")},onPinchMove:function(t){if("pinch"===this.status){var e=this.minScale1?this.$root.$emit("zoomed"):this.scaleFactor<1&&this.$root.$emit("unzoomed")}},setZoom:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0;if(!this.isWorkspaceFrozen&&"ready"===this.status){this.scaleFactor=t/this.zoomFactor,this.updateHolderScroll(!1);var s=i||{x:this.workspaceSize.width/2,y:this.workspaceSize.height/2},o={x:s.x-this.bookHolderSize.left,y:s.y-this.bookHolderSize.top},r=no(this.bookHolderSize,this.scaleFactor,o);r=ho(r,this.containerSize),this.fixBounds(r),this.scaleOrigin=lo(this.bookHolderSize,r,this.scaleFactor),this.newBounds=r,this.flipAdapter.setZoom(this.scaleFactor*this.zoomFactor>1),this.fastAnimation=e,this.status="animating",this.refreshScroll()}},setScaleStart:function(){this.minScale=Math.max(this.minZoom/this.zoomFactor,this.holderOriginalWidth/this.bookHolderSize.width),this.maxScale=this.maxZoom/this.zoomFactor,this.scaleFactor=1,this.updateHolderScroll(!1),this.scaleOrigin={x:this.workspaceSize.width/2-this.holderScrollLeft,y:this.workspaceSize.height/2-this.holderScrollTop},this.status="scale"},setScale:function(t){if("scale"===this.status){var e=this.minScale+(this.maxScale-this.minScale)*t,i=no(this.bookHolderSize,e,{x:this.workspaceSize.width/2-this.holderScrollLeft,y:this.workspaceSize.height/2-this.holderScrollTop});i=ho(i,this.containerSize),this.fixBounds(i),this.scaleOrigin=lo(this.bookHolderSize,i,e);var s=Math.min(this.maxScale,Math.max(this.minScale,e));this.scaleFactor=this.checkScaleFactorForZoom(s,this.zoomFactor,this.maxZoom)}},setScaleFinish:function(){if("scale"===this.status){var t=no(this.bookHolderSize,this.scaleFactor,this.scaleOrigin);t=ho(t,this.containerSize),this.fixBounds(t),this.zoomFactor=1*(this.zoomFactor*this.scaleFactor).toFixed(2),this.scaleFactor=1,this.holderScrollLeft=1!==this.zoomFactor?t.left:0,this.holderScrollTop=1!==this.zoomFactor?t.top:0,this.status="ready"}},changeZoom:function(t){switch(this.$store.dispatch("pager/setLastTarget","change-zoom"),t.action){case"setZoom":this.setZoom(t.zoomFactor,t.fast);break;case"startScale":this.setScaleStart();break;case"changeScale":this.setScale(t.scalePosition);break;case"endScale":this.setScaleFinish();break;case"zoomIn":this.zoomByTap();break;case"zoomOut":this.dragActive=!0,this.zoomOut()}},transitionEnd:function(t){t&&"transform"===t.propertyName&&t.target===this.bookHolderElement&&"animating"===this.status&&(this.fastAnimation=!1,this.lastZoomFactor=Math.max(this.zoomFactor,this.defaultZoomFactor),this.zoomFactor=1*(this.zoomFactor*this.scaleFactor).toFixed(2),this.scaleFactor=1,this.holderScrollLeft=1===this.zoomFactor?0:this.newBounds.left,this.holderScrollTop=1===this.zoomFactor?0:this.newBounds.top,this.status="ready",this.$emit("transition:end"))},updateHolderScroll:function(t){t&&1===this.zoomFactor||(this.containerSize.widthDate.now()||this.$store.state.pager.freezed||(this.zoomTimeout=Date.now()+500,setTimeout((function(){t.movePagerRight({target:"nav-arrow-tap"})}),0))},leftPage:function(){var t=this;this.addNoteTimeout>Date.now()||this.$store.state.pager.freezed||(this.zoomTimeout=Date.now()+500,setTimeout((function(){t.movePagerLeft({target:"nav-arrow-tap"})}),0))},rightmostPage:function(){var t=this;this.zoomTimeout=Date.now()+500,setTimeout((function(){t.movePagerRightmost({navTarget:!0})}),0)},leftmostPage:function(){var t=this;this.zoomTimeout=Date.now()+500,setTimeout((function(){t.movePagerLeftmost({navTarget:!0})}),0)},arrowHover:function(t,e){e?this.$el.classList.add(t+"-highlighted"):this.$el.classList.remove(t+"-highlighted")},btnAddNote:function(t){var e,i,s;this.zoomTimeout=Date.now()+500,this.addNoteTimeout=Date.now()+500,this.currentPages.singleMode?(e=this.currentPages.currentPage,i=this.currentPages.widePageSecondHalf,s=this.isRTLBook&&this.$store.getters["pages/pageProp"](e,"wide")&&!i):(e="left"===t&&!this.isRTLBook||"right"===t&&this.isRTLBook?this.currentPages.leftPage:this.currentPages.rightPage,i="right"===t&&this.currentPages.wide),this.$store.dispatch("notes/addNote",{pageId:e,wideRight:i,wideOpposite:s})},initScrollComponent:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];1!==this.zoomFactor&&(this.scrollComponent?(this.holderScrollX=this.scrollComponent.x,this.holderScrollY=this.scrollComponent.y,this.scrollComponent.off("beforeScrollStart",this.setDragging),this.scrollComponent.off("scrollCancel",this.cancelDragging),this.scrollComponent.off("scroll",this.onScrollBegin),this.scrollComponent.off("scrollEnd",this.onScrollEnd),this.scrollComponent.destroy(),delete this.scrollComponent):(this.holderScrollX=this.containerSize.widtht.length)&&(e=t.length);for(var i=0,s=new Array(e);i1&&this.refreshScroll()},beforeDestroy:function(){this.tween&&at().remove(this.tween),this.$root.$off("contextMenu:zoomIn",this.zoomIn),this.$root.$off("contextMenu:zoomOut",this.zoomOut),this.$root.$off("bottomMenu:zoomIn",this.zoomIn),this.$root.$off("bottomMenu:zoomOut",this.zoomOut),this.$root.$off("zoomPanel",this.changeZoom),this.$root.$off("zoomMove",this.zoomMove),this.$root.$off("wheel",this.onWheel),this.$root.$off("nav:goRight",this.goFastRight),this.$root.$off("nav:goLeft",this.goFastLeft)},watch:{pageSize:function(t){var e={width:t.width*this.zoomFactor,height:t.height*this.zoomFactor,zoomFactor:this.zoomFactor};this.$store.dispatch("pages/changePageSize",e),this.slidesCacheUpdate()},isSingleMode:function(){this.slidesCacheUpdate()},isSlideMode:function(){this.slidesCacheUpdate()},isRtl:function(){this.slidesCacheUpdate()},zoomFactor:function(t,e){var i=this,s={width:this.pageSize.width*t,height:this.pageSize.height*t,zoomFactor:t};if(this.$store.dispatch("pages/changePageSize",s),t>1&&1===e){var o=bo(this.slidesCache.current.map((function(t){return t.id}))).filter((function(t){return null!==t})).some((function(t){return i.$store.getters["pages/pageProp"](t,"textBlocks")}),this);this.selectTextEnabled&&o&&this.showSelectTextTip()}this.refreshScroll()},status:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){"sliding"===t?this.$store.dispatch("pager/isPageChanging",!0):this.$store.state.pager.isMoveWatcherActive||this.$store.dispatch("pager/isPageChanging",!1),this.refreshScroll(),this.$store.dispatch("workspace/setStatus",t);var e=["sliding","pan"].indexOf(status)>=0?"inProgress":"pending";this.$store.dispatch("pager/setFlipState",{newState:e}),"ready"!==t||this.isFastSliding?this.$store.dispatch("workspace/setAnimationProgress",{animationType:"pagerMove"}):this.$store.dispatch("workspace/unsetAnimationProgress"),this.updateNoteIcon()})),slides:function(t,e){var i=this;if(this.scrollLock)this.scrollLock=!1;else{var s=e.current[0].state,o=t.current[0].state;if(s.mode===o.mode){this.isSlideMode||this.isSingleMode||this.updateHorizontalScale(t.current,e.current);var r=this.$store.getters["pager/getDeltaTurns"](s,o),n=Math.abs(r)>1;o.zoomMode===s.zoomMode||r?!this.isRtl&&r>0||this.isRtl&&r<0?(n&&this.replaceCachedSlide("right",t.current),this.isZoomed?(this.pendingSlide="right",this.zoomOut()):this.$nextTick((function(){i.animateSlides("right",!1,!0)}))):(!this.isRtl&&r<0||this.isRtl&&r>0)&&(n&&this.replaceCachedSlide("left",t.current),this.isZoomed?(this.pendingSlide="left",this.zoomOut()):this.$nextTick((function(){i.animateSlides("left",!1,!0)}))):o.zoomMode?this.zoomIn():this.zoomOut()}}},workspaceSize:function(t,e){if(this.isMobile&&e.width&&e.height&&(t.width!==e.width||t.height!==e.height))this.zoomOut(!0);else if(1!==this.zoomFactor){var i,s,o={x:(i=this.isInitialZoom?{x:this.isRTLBook?this.spreadSizes.current.width:0,y:0}:{x:t.width/2,y:t.height/2}).x-this.spreadSizes.current.left,y:i.y-this.spreadSizes.current.top};this.scaleFactor=1,s=ho(s=this.isInitialZoom?ao(this.containerSize,this.spreadSizes.current,this.scaleFactor,o):no(this.spreadSizes.current,this.scaleFactor,o),this.containerSize),this.scaleOrigin=lo(this.spreadSizes.current,s,this.scaleFactor),this.slideScrollLeft=s.left,this.slideScrollTop=s.top,this.isInitialZoom&&(this.$store.dispatch("workspace/clearInitialZoom"),this.refreshScroll())}},containerSize:function(){1===this.zoomFactor||this.isMobile||this.refreshScroll()},pageSizes:function(t){var e=this,i=this.slidesCache;Object.keys(i).forEach((function(s){for(var o=0;o1&&"current"!==s||e.isSingleMode&&l)return;e.$store.dispatch("pages/setCurrentSize",{pageID:r,value:{width:a,height:h}})}}))},spreadSizes:function(t){this.$store.dispatch("workspace/setHolderSize",t.current),this.updateNoteIcon()},isLocaleRtl:function(){this.updateNoteIcon()},notesEnabled:function(){this.updateNoteIcon()},dragActive:function(t){t?this.$refs.holder.$el.classList.remove("nodrag"):this.$refs.holder.$el.classList.add("nodrag")},isMini:function(){this.zoomOut(!0),this.updateNoteIcon()},orientationChanged:function(t,e){e&&this.zoomOut(!0)}},computed:{isRTLBook:function(){return this.$store.state.book.rightToLeft},isFirstPage:function(){return this.$store.getters["pager/isFirstSpread"]},isLastPage:function(){return this.$store.getters["pager/isLastSpread"]},isRightmostPage:function(){return this.isFirstPage&&this.isRtl||this.isLastPage&&!this.isRtl},isLeftmostPage:function(){return this.isLastPage&&this.isRtl||this.isFirstPage&&!this.isRtl},isRtl:function(){return this.$store.state.book.rightToLeft},isLocaleRtl:function(){return this.$store.getters["i18n/isLocaleRtl"]},isMobile:function(){return this.$store.getters["workspace/isMobile"]},isSingleMode:function(){return this.$store.state.pager.singleMode},isSpreadMode:function(){return this.$store.state.pager.spreadMode},isSlideMode:function(){return this.$store.state.pager.slideMode},isContentCropMode:function(){return this.isSlideMode&&this.$store.state.book.contentCrop},isZoomed:function(){return 1!==this.zoomFactor},isInitialZoom:function(){return this.$store.state.workspace.initialZoom},zoomPanel:function(){return this.$store.state.workspace.zoomPanel},slides:function(){var t=this,e={},i=this.isRtl?"right":"left",s=this.isRtl?"left":"right",o=this.$store.getters["pager/state"],r=this.$store.getters["pager/nextState"],n=this.$store.getters["pager/prevState"],a=this.$store.getters["pager/secondNextState"],h=this.$store.getters["pager/secondPrevState"],l=this.isRtl?r:n,c=this.isRtl?n:r,d=this.isRtl?a:h,u=this.isRtl?h:a,p=function(i,s,r,n,a,h){if(h||(e[i]=[]),s){var l=t.$store.getters["pages/pageIndexById"](s);n&&r===(t.isRtl?"left":"right")&&l++;var c=t.$store.getters["pages/pageCaptionByIndex"](l),d=t.$store.getters["pages/pageProp"](s,"backgroundColor"),u=t.isSlideMode&&n?"page-wide":"page",p={backgroundColor:d};t.isFastSliding&&(p["font-size"]=Math.min(Math.floor(t.containerSize.height/20),20)+"px"),e[i].push({id:s,side:r,caption:c,icon:u,style:p,wide:n,position:a,state:o})}};if(o.singleMode)p("current",o.currentPage,o.pageSide,o.wide,""),l&&p("left",l.currentPage,l.pageSide,l.wide,""),c&&p("right",c.currentPage,c.pageSide,c.wide,""),d&&p("second-left",d.currentPage,d.pageSide,d.wide,""),u&&p("second-right",u.currentPage,u.pageSide,u.wide,"");else if(o.slideMode){if(e.current=[],o.currentPage){var g=o.wide?"both":i;p("current",o.currentPage,g,o.wide,i)}if(l){var f=l.wide?"both":i;p("left",l.currentPage,f,l.wide,i)}if(c){var m=c.wide?"both":i;p("right",c.currentPage,m,c.wide,i)}if(d){var v=d.wide?"both":i;p("second-left",d.currentPage,v,d.wide,i)}if(u){var b=u.wide?"both":i;p("second-right",u.currentPage,b,u.wide,i)}}else if(o.spreadMode){var S=function(e,o){var r=t.getPageProp(o.leftPage,"wide"),n=r?"both":i;if(p(e,o.leftPage,n,r,i),o.rightPage&&o.leftPage!==o.rightPage){var a=r?"both":s;p(e,o.rightPage,a,r,s,!0)}};S("current",o),l&&S("left",l),c&&S("right",c),d&&S("second-left",d),u&&S("second-right",u)}return e},fitPageSize:function(){return(0,Ce.Tj)(this.pageSize,this.containerSize)},fitDoublePageSize:function(){return(0,Ce.Tj)({width:2*this.pageSize.width,height:this.pageSize.height},this.containerSize)},fitSinglePageSize:function(){return{width:this.fitDoublePageSize.width/2,height:this.fitDoublePageSize.height,top:this.fitDoublePageSize.top,left:(this.containerSize.width-this.fitDoublePageSize.width/2)/2}},pageSizes:function(){var t={},e=this.fitPageSize,i=this.fitDoublePageSize,s=this.fitSinglePageSize;for(var o in this.slidesCache){if(!this.slidesCache.hasOwnProperty(o))return;var r="current"===o?this.zoomFactor:1;if(this.isSingleMode)t[o]={width:Math.round(e.width*r),height:Math.round(e.height*r)};else if(this.isContentCropMode){var n=this.getContentSize(this.slidesCache[o][0].id);t[o]={width:Math.round(n.width*r),height:Math.round(n.height*r),left:n.left,top:n.top}}else{var a=this.slidesCache[o][0].wide;t[o]={width:Math.round((a?i.width:s.width)*r),height:Math.round((a?i.height:s.height)*r)}}}return t},spreadSizes:function(){var t={};for(var e in this.slidesCache){if(!this.slidesCache.hasOwnProperty(e))return;if(t[e]={width:this.pageSizes[e].width*this.slidesCache[e].length,height:this.pageSizes[e].height},this.isZoomed&&"current"===e)t[e].left=this.slideScrollLeft,t[e].top=this.slideScrollTop;else if(this.isSingleMode)t[e].left=this.fitPageSize.left,t[e].top=this.fitPageSize.top;else if(this.isContentCropMode)t[e].left=this.pageSizes[e].left,t[e].top=this.pageSizes[e].top;else{var i=2===this.slidesCache[e].length||this.slidesCache[e][0].wide;t[e].left=i?this.fitDoublePageSize.left:this.fitSinglePageSize.left,t[e].top=i?this.fitDoublePageSize.top:this.fitSinglePageSize.top}}return t},holderClasses:function(){return{zoomed:this.isZoomed,"drag-active":this.dragging,single:this.isSingleMode}},spreadStyles:function(){var t={};return t.current={width:this.spreadSizes.current.width+"px",height:this.spreadSizes.current.height+"px",left:this.isZoomed?this.containerSize.width>=this.spreadSizes.current.width?Math.round((this.containerSize.width-this.spreadSizes.current.width)/2)+"px":0:Math.round(this.spreadSizes.current.left)+"px",top:this.isZoomed?this.containerSize.height>=this.spreadSizes.current.height?Math.round((this.containerSize.height-this.spreadSizes.current.height)/2)+"px":0:Math.round(this.spreadSizes.current.top)+"px",transformOrigin:Math.round(this.scaleOrigin.x)+"px "+Math.round(this.scaleOrigin.y)+"px",transition:"animating"===this.status?["-webkit-transform "+(this.fastAnimation?1:this.zoomAnimationSpeed)+"ms cubic-bezier(0.215, 0.61, 0.355, 1)","transform "+(this.fastAnimation?1:this.zoomAnimationSpeed)+"ms cubic-bezier(0.215, 0.61, 0.355, 1)"]:["-webkit-transform 0ms","transform 0ms"]},"pinch"!==this.status&&"scale"!==this.status&&"animating"!==this.status?t.current.transform="":0!==this.slideScrollTop||0!==this.slideScrollLeft?t.current.transform="translate3d("+(this.containerSize.width1?this.$root.$emit("zoomed"):(this.scaleFactor<1||this.zoomPanel&&1===this.scaleFactor)&&this.$root.$emit("unzoomed")}},setZoom:function(t,e){if(!this.isWorkspaceFrozen&&"ready"===this.status){this.scaleFactor=t/this.zoomFactor,this.updateSlideScroll(!1);var i=e||{x:this.workspaceSize.width/2,y:this.workspaceSize.height/2},s={x:i.x-this.spreadSizes.current.left,y:i.y-this.spreadSizes.current.top},o=no(this.spreadSizes.current,this.scaleFactor,s);o=ho(o,this.containerSize),this.scaleOrigin=lo(this.spreadSizes.current,o,this.scaleFactor),this.newBounds=o,this.fastAnimation=!0,this.status="animating",this.refreshScroll()}},setScaleStart:function(){this.minScale=Math.min(this.containerSize.width/this.spreadSizes.current.width,this.containerSize.height/this.spreadSizes.current.height),this.maxScale=this.maxZoom/this.zoomFactor,this.scaleFactor=1,this.updateSlideScroll(!1),this.scaleOrigin={x:this.workspaceSize.width/2-this.slideScrollLeft,y:this.workspaceSize.height/2-this.slideScrollTop},this.status="scale"},setScale:function(t){if("scale"===this.status){var e=this.minScale+(this.maxScale-this.minScale)*t,i=no(this.spreadSizes.current,e,{x:this.workspaceSize.width/2-this.slideScrollLeft,y:this.workspaceSize.height/2-this.slideScrollTop});i=ho(i,this.containerSize),this.scaleOrigin=lo(this.spreadSizes.current,i,e);var s=Math.min(this.maxScale,Math.max(this.minScale,e));this.scaleFactor=this.checkScaleFactorForZoom(s,this.zoomFactor,this.maxZoom)}},setScaleFinish:function(){if("scale"===this.status){var t=no(this.spreadSizes.current,this.scaleFactor,this.scaleOrigin);t=ho(t,this.containerSize),this.zoomFactor=1*(this.zoomFactor*this.scaleFactor).toFixed(2),this.scaleFactor=1,this.slideScrollLeft=this.isZoomed?t.left:0,this.slideScrollTop=this.isZoomed?t.top:0,this.status="ready"}},onTransitionEnd:function(t){t&&"transform"===t.propertyName&&("animating"===this.status&&(this.fastAnimation=!1,this.lastZoomFactor=Math.max(this.zoomFactor,this.defaultZoomFactor),this.zoomFactor=1*(this.zoomFactor*this.scaleFactor).toFixed(2),this.slideScrollLeft=this.isZoomed?this.newBounds.left:0,this.slideScrollTop=this.isZoomed?this.newBounds.top:0,this.status="ready"),this.pendingSlide&&(this.updatePendingSlide(),this.animateSlides(this.pendingSlide,!1,!0),this.pendingSlide=null))},onPinchStart:function(t){this.isWorkspaceFrozen||"ready"!==this.status||this.isMini||(this.$store.dispatch("pager/setLastTarget","pinch-zoom"),this.minScale=Math.min(this.containerSize.width/this.spreadSizes.current.width,this.containerSize.height/this.spreadSizes.current.height),this.scaleFactor=1,this.pinchCenter=t.center,this.isZoomed?(this.updateSlideScroll(!1),this.scaleOrigin={x:t.center.x-this.slideScrollLeft,y:t.center.y-this.slideScrollTop}):this.scaleOrigin={x:t.center.x-this.spreadSizes.current.left,y:t.center.y-this.spreadSizes.current.top},this.status="pinch")},onPinchMove:function(t){if("pinch"===this.status){var e=this.minScale1?this.$root.$emit("zoomed"):this.scaleFactor<1&&this.$root.$emit("unzoomed")}},changeZoom:function(t){switch(this.$store.dispatch("pager/setLastTarget","change-zoom"),t.action){case"setZoom":this.setZoom(t.zoomFactor);break;case"startScale":this.setScaleStart();break;case"changeScale":this.setScale(t.scalePosition);break;case"endScale":this.setScaleFinish();break;case"zoomIn":this.onTap();break;case"zoomOut":this.zoomOut()}},onPanStart:function(t){var e;if(!(this.blockPan||this.isFastSliding||"ready"!==this.status||t.srcEvent&&(t.srcEvent.metaKey||t.srcEvent.ctrlKey)||null!=t&&null!==(e=t.target)&&void 0!==e&&null!==(e=e.classList)&&void 0!==e&&e.contains("note-article"))){var i=document.elementFromPoint(t.center.x-t.deltaX,t.center.y-t.deltaY);i&&"select-text-block"===i.getAttribute("data-set")||(this.status="pan",this.$root.$emit("turnStart"))}},onPanMove:function(t){var e,i=this;if(!(this.blockPan||this.isFastSliding||"pan"!==this.status||null!=t&&null!==(e=t.target)&&void 0!==e&&null!==(e=e.classList)&&void 0!==e&&e.contains("note-article"))){var s=1;(t.deltaX<0&&this.isRightmostPage||t.deltaX>0&&this.isLeftmostPage)&&(s=.3),window.requestAnimationFrame((function(){i.delta=t.deltaX*s}))}},onPanEnd:function(t){var e;if(!this.blockPan&&(this.isFastSliding||"pan"===this.status||"sliding"===this.status)&&(null==t||null===(e=t.target)||void 0===e||null===(e=e.classList)||void 0===e||!e.contains("note-article"))){var i,s=Math.abs(t.overallVelocityX).toPrecision(2),o=Math.abs(t.deltaX),r=null;t.deltaX>0&&!this.isLeftmostPage&&(o>this.maxDelta/3||s>.5)?(i="left",r="left"):t.deltaX<0&&!this.isRightmostPage&&(o>this.maxDelta/3||s>.5)?(i="right",r="right"):(i="center",r=t.deltaY>0?"down":t.deltaY<0?"up":null),("sliding"===this.status||this.isFastSliding)&&(this.checkFastSlide(i,!1),this.pendingFastSlide)||("left"===i&&!this.isLeftmostPage&&(o>this.maxDelta/3||s>.5)?this.animateSlides("left"):"right"===i&&!this.isRightmostPage&&(o>this.maxDelta/3||s>.5)?this.animateSlides("right"):"sliding"!==this.status&&this.animateSlides("center"),r&&this.$root.$emit("swipe",{direction:r}))}},zoomIn:function(t){this.zoomFactor>1||this.onTap(t)},zoomOut:function(t,e){if(1!==this.zoomFactor){if(this.lastZoomFactor=Math.max(this.zoomFactor,this.defaultZoomFactor),t)return this.status="calculating",this.zoomFactor=1,this.refreshScroll(),this.slideScrollLeft=0,this.slideScrollTop=0,this.status="ready",void this.$root.$emit("unzoomed");this.onTap(e,{center:{x:0,y:0}})}},goRight:function(){this.scrollLock=!0,this.movePagerRight({target:"slide-swipe"}),this.$root.$emit("render:finish")},goLeft:function(){this.scrollLock=!0,this.movePagerLeft({target:"slide-swipe"}),this.$root.$emit("render:finish")},goFastRight:function(){this.checkFastSlide("right")},goFastLeft:function(){this.checkFastSlide("left")},canSlideInDirection:function(t){return t&&("left"===t&&!this.isLeftmostPage||"right"===t&&!this.isRightmostPage)},checkFastSlide:function(t){var e,i,s=this,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.canSlideInDirection(t)&&(this.isFastSliding&&(this.isSpreadFillerShown=!0),this.pendingFastSlide&&this.pendingFastSlide!==t&&(this.pendingFastSlide=null),"sliding"===this.status&&null!==(e=this.tween)&&void 0!==e&&e._isPlaying&&this.isPagerFrozen&&(this.isFastSliding=!0,o&&this.tween.stop()),!this.pendingFastSlide&&this.isFastSliding&&null!==(i=this.tween)&&void 0!==i&&i._isPlaying&&(this.tween._duration=200,this.pendingFastSlide=t),this.isFastSliding&&(clearTimeout(this.fastSlidingCancelTimeout),this.fastSlidingCancelTimeout=setTimeout((function(){s.isFastSliding=!1,s.isSpreadFillerShown=!1,s.$store.dispatch("workspace/unsetAnimationProgress")}),400)))},animateSlides:function(t){var e,i=this,s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r={x:this.delta};switch(t){case"left":e={x:this.maxDelta};break;case"right":e={x:-this.maxDelta};break;case"center":e={x:0}}o&&this.$root.$emit("turnStart"),this.status="sliding",this.$store.dispatch("pager/freeze",{target:"slide-book"}),this.tween=new(at().Tween)(r).to(e,s||this.isFastSliding?200:this.slideAnimationSpeed).easing(this.slideEasing).onUpdate((function(t){i.delta=t.x})).onComplete((function(){i.$root.$emit("turnStop"),i.$store.dispatch("pager/unfreeze",{target:"slide-book"}),o?i.$root.$emit("render:finish"):"left"===t?i.goLeft():"right"===t&&i.goRight(),i.slidesCacheUpdate(),i.status="ready","center"!==t&&i.$root.$emit("turned"),i.pendingFastSlide&&i.canSlideInDirection(i.pendingFastSlide)&&(i.animateSlides(i.pendingFastSlide),i.pendingFastSlide=null)})).onStop((function(){i.slidesCacheUpdate(),i.$store.dispatch("pager/unfreeze",{target:"slide-book"})})).start()},updateHorizontalScale:function(t,e){var i=0;(e[0].wide||2===e.length)&&i--,(t[0].wide||2===t.length)&&i++,this.horizontalScale=i>0?2:i<0?.5:1},convertToOutputSlides:function(t){var e=function(e){return{position:e,pages:t[e]||[]}};return[e("current")].concat([e("left")]).concat([e("right")]).concat([e("second-left")]).concat([e("second-right")]).filter((function(t){return t.pages.length>0}))},getSlidesWithAllPages:function(t,e){var i=[].concat.apply([],t.map((function(t){return t.pages}))),s=[].concat.apply([],e.map((function(t){return t.pages}))).filter((function(t){return!i.some((function(e){return e.id===t.id}))}));return t.forEach((function(t){t.pages=t.pages.filter((function(t){return!s.some((function(e){return t.id===e.id}))}))})),s.length>0&&s.forEach((function(e){var i={position:"hidden page_"+e.id,pages:[e]};t=t.concat([i])})),t.sort((function(t,e){return t.pages[0].id-e.pages[0].id}))},getNonHiddenSlides:function(t){return t.filter((function(t){return t.position.indexOf("hidden")<0}))},updateOutputSlides:function(){var t=this,e=this.convertToOutputSlides(this.slidesCache);this.outputSlidesCache=this.getSlidesWithAllPages(e,this.outputSlidesCache),this.$nextTick((function(){t.outputSlidesCache=t.getNonHiddenSlides(t.outputSlidesCache)}))},slidesCacheUpdate:function(){this.slidesCache=this.slides,this.delta=0,this.updateOutputSlides()},updatePendingSlide:function(){this.pendingSlide&&this.replaceCachedSlide(this.pendingSlide,this.slides.current)},replaceCachedSlide:function(t,e){this.slidesCache[t]=e,this.updateOutputSlides()},contentCreator:function(t){return Po["content-"+t.type]},refreshScroll:function(){var t=this;this.isInitialZoom||(this.cancelDragging(),this.$nextTick((function(){t.isZoomed&&"ready"===t.status?(t.initScrollComponent(t.dragActive),t.scrollComponent.refresh()):t.scrollComponent&&(t.slideScrollX=0,t.slideScrollY=0,t.$store.dispatch("text/setHolderScroll",{x:t.slideScrollX,y:t.slideScrollY}),t.scrollComponent.refresh(),t.scrollComponent.destroy(),delete t.scrollComponent)})))},initScrollComponent:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];1!==this.zoomFactor&&(this.scrollComponent?(this.slideScrollX=this.scrollComponent.x,this.slideScrollY=this.scrollComponent.y,this.scrollComponent.off("beforeScrollStart",this.setDragging),this.scrollComponent.off("scrollCancel",this.cancelDragging),this.scrollComponent.off("scroll",this.onScrollBegin),this.scrollComponent.off("scrollEnd",this.onScrollEnd),this.scrollComponent.destroy(),delete this.scrollComponent):(this.slideScrollX=this.containerSize.width1||this.scaleFactor>1)return;this.$store.state.notes.opened&&this.$store.dispatch("notes/setOpenedId",{id:null}),t.deltaY>0&&(this.$store.getters["pager/nextPageId"]||0===this.$store.getters["pager/nextPageId"])?(this.checkFastSlide(this.isRTLBook?"left":"right"),this.$store.dispatch("pager/goForward",{target:"wheel"})):t.deltaY<0&&(this.$store.getters["pager/prevPageId"]||0===this.$store.getters["pager/prevPageId"])&&(this.checkFastSlide(this.isRTLBook?"right":"left"),this.$store.dispatch("pager/goBackward",{target:"wheel"}))}this.lastWheelTime=Date.now()}},updateSlideScroll:function(t){t&&!this.isZoomed||(this.containerSize.width0&&e.push("outside")}else{e.push("right");var s=this.spreadSizes.current.left+this.spreadSizes.current.width;t.left=Math.min(s,this.containerSize.width-30)+"px",si,t.name="menuSideRect",this.applySizeConstraints(t),t.scale=this.calculateScale(t),t},menuRect:function(){if("top"===this.level||this.opaqueBottom&&!this.allowOpaqueBar||!this.bottomMenu)return{scale:0};var t={},e=this.bottomMenu.getBoundingClientRect();return t.width=(this.containerSize.width-e.width)/2-10,t.height=e.height-10,t[this.side]=10,t[this.level]=8-e.height,t.lockWidth=!0,t.lockHeight=!0,t.name="menuRect",this.applySizeConstraints(t),t.scale=this.calculateScale(t),t},slideRect:function(){if(this.bookMode)return{scale:0};var t={};return t.width=this.containerSize.width/2,t.height=this.containerSize.height/2,t[this.side]=this.globalPadding,t[this.level]=this.globalPadding,t.sizeOverride=!0,t.name="slideRect",this.applySizeConstraints(t),t.scale=this.calculateScale(t),t},slideLevelRect:function(){if(this.bookMode||"top"===this.level||this.opaqueBottom||!this.bottomMenu)return{scale:0};var t={},e=this.bottomMenu.getBoundingClientRect();return t.width=(this.containerSize.width-e.width)/2-2*this.globalPadding,t.height=this.containerSize.height/2,t[this.side]=this.globalPadding,t[this.level]=this.globalPadding-e.height,t.sizeOverride=!0,t.lockWidth=!0,t.name="slideLevelRect",this.applySizeConstraints(t),t.scale=this.calculateScale(t),t},optimalRect:function(){var t=[this.menuRect];return this.bookMode?t.push(this.menuLevelRect,this.menuSideRect,this.levelRect,this.sideRect):t.push(this.slideLevelRect,this.slideRect),t.reduce((function(t,e){return e.scale>t.scale?e:t}))},containerClasses:function(){return{overlap:!!this.optimalRect.sizeOverride}},containerStyles:function(){if(!this.optimalRect.scale)return{display:"none"};var t={opacity:this.isReady?1:0,width:this.originalWidth*this.optimalRect.scale+"px",height:this.originalHeight*this.optimalRect.scale+"px"};return t.top=(0,_.o8)(this.optimalRect.top)?null:this.optimalRect.top+"px",t.bottom=(0,_.o8)(this.optimalRect.bottom)?null:this.optimalRect.bottom+"px",t.left=(0,_.o8)(this.optimalRect.left)?null:this.optimalRect.left+"px",t.right=(0,_.o8)(this.optimalRect.right)?null:this.optimalRect.right+"px","0px"!==t.width&&"0px"!==t.height||(t.display="none"),t},logoStyles:function(){return this.hasDefaultLogo?{fill:this.svgLogoColor}:{}},imageStyles:function(){return{width:this.originalWidth*this.optimalRect.scale+"px",height:this.originalHeight*this.optimalRect.scale+"px"}},opaqueBottom:function(){return this.$store.state.skin&&this.$store.state.skin.styles&&(0,_.HD)(this.$store.state.skin.styles.classes)?-1!==this.$store.state.skin.styles.classes.indexOf("opaqueBottom"):null}},watch:{bottomMenuEnabled:function(){this.setBottomMenu()},rawCustomLogoUrl:"logoLoad",hasDefaultLogo:"logoLoad",side:"setSvgTransform",optimalRect:function(t){this.$store.dispatch("logo/setFitRectName",t.name)}},methods:{setBottomMenu:function(){this.bottomMenu=this.bottomMenuEnabled?document.getElementsByClassName("bottom-toolbar")[0]:null},logoLoad:function(){var t=this;this.isReady=!1,!this.hasDefaultLogo&&this.rawCustomLogoUrl?this.preloadImg(this.customLogoUrl):this.hasDefaultLogo&&(this.originalWidth=119,this.originalHeight=30,this.customLogoUrl=null,this.isReady=!0,this.$nextTick((function(){return t.setSvgTransform()})))},preloadImg:function(){var t=this;(0,Qe.Z)({url:this.rawCustomLogoUrl,callback:function(e){var i=document.createElement("img");i.onload=function(){t.originalWidth=i.naturalWidth,t.originalHeight=i.naturalHeight,t.destroyImgBlob(),t.customLogoUrl=e,t.isReady=!0},i.onerror=function(){},i.src=e,i.style.width="100%"}})},destroyImgBlob:function(){this.customLogoUrl&&window.URL.revokeObjectURL(this.customLogoUrl)},calculateScale:function(t){if(0===this.originalWidth||0===this.originalHeight)return 0;if(t.width<0||t.height<0)return 0;var e=1,i=1;return this.originalHeight>t.height&&(e=t.height/this.originalHeight),this.originalWidth>t.width&&(i=t.width/this.originalWidth),Math.min(i,e,1)},applySizeConstraints:function(t){this.hasDefaultLogo?(t.width=t.lockWidth?t.width:this.originalWidth,t.height=t.lockHeight?t.height:this.originalHeight):(!t.lockWidth&&t.width1&&void 0!==arguments[1]&&arguments[1];this.timeout>Date.now()||(this.$root.$emit("nav:goRight"),this.$store.state.pager.freezed||(setTimeout((function(){e.movePagerRight({target:i?"nav-swipe":"nav-tap"})}),0),this.timeout=Date.now()+150))},goLeft:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.timeout>Date.now()||(this.$root.$emit("nav:goLeft"),this.$store.state.pager.freezed||(setTimeout((function(){e.movePagerLeft({target:i?"nav-swipe":"nav-tap"})}),0),this.timeout=Date.now()+150))}}}),Fo=Oo,Do=(0,U.Z)(Fo,Ro,Eo,!1,null,"713bdbfe",null).exports,_o=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{class:t.classes},[t.isFirstPage||t.isLightboxShown?t._e():i("div",{staticClass:"button-block left"},[i("button",{staticClass:"nav-btn next-btn nav-left-arrow",attrs:{tabindex:"0",title:t.leftArrowTitle},on:{click:function(e){return e.preventDefault(),t.goLeft(e)}}},[i("transition",{attrs:{name:"bars-fade"}},[t.show?i("svgicon",{staticClass:"arrow",attrs:{focusable:"false",name:"mobile-left",height:"100%"}}):t._e()],1)],1),t._v(" "),i("button",{staticClass:"nav-btn last-btn nav-first-left-arrow",attrs:{tabindex:"0",title:t.leftMostArrowTitle},on:{click:function(e){return e.preventDefault(),t.leftToTheLast(e)}}},[t.show?i("svgicon",{staticClass:"arrow",attrs:{focusable:"false",name:"book-first",height:"100%"}}):t._e()],1)]),t._v(" "),t.isLastPage||t.isLightboxShown?t._e():i("div",{staticClass:"button-block right"},[i("button",{staticClass:"nav-btn next-btn nav-right-arrow",attrs:{tabindex:"0",title:t.rightArrowTitle},on:{click:function(e){return e.preventDefault(),t.goRight(e)}}},[i("transition",{attrs:{name:"bars-fade"}},[t.show?i("svgicon",{staticClass:"arrow",attrs:{focusable:"false",name:"mobile-right",height:"100%"}}):t._e()],1)],1),t._v(" "),i("button",{staticClass:"nav-btn last-btn nav-last-right-arrow",attrs:{tabindex:"0",title:t.rightMostArrowTitle},on:{click:function(e){return e.preventDefault(),t.rightToTheLast(e)}}},[t.show?i("svgicon",{staticClass:"arrow",attrs:{focusable:"false",name:"book-last",height:"100%"}}):t._e()],1)])])},Wo=[],Bo={mixins:[p.Z],props:{show:Boolean},data:function(){return{timeout:0,classes:{"nav-arrows":!0,start:!0}}},mounted:function(){var t=this;setTimeout((function(){t.classes.start=!1}),8e3)},computed:{isLightboxShown:function(){return this.$store.getters["lightbox/isShown"]},isRTLBook:function(){return this.$store.state.book.rightToLeft},isFirstPage:function(){var t=null===this.$store.getters["pager/prevNonStubPageId"],e=null===this.$store.getters["pager/nextPageId"];return this.isRTLBook?e:t},isLastPage:function(){var t=null===this.$store.getters["pager/nextPageId"],e=null===this.$store.getters["pager/prevNonStubPageId"];return this.isRTLBook?e:t},isEmbed:function(){return this.$store.state.workspace.isEmbed},leftArrowTitle:function(){return this.isRTLBook?this.$t("NavigationPanel.NEXT_PAGE_TIP"):this.$t("NavigationPanel.PREV_PAGE_TIP")},rightArrowTitle:function(){return this.isRTLBook?this.$t("NavigationPanel.PREV_PAGE_TIP"):this.$t("NavigationPanel.NEXT_PAGE_TIP")},leftMostArrowTitle:function(){return this.isRTLBook?this.$t("NavigationPanel.LAST_PAGE_TIP"):this.$t("NavigationPanel.FIRST_PAGE_TIP")},rightMostArrowTitle:function(){return this.isRTLBook?this.$t("NavigationPanel.FIRST_PAGE_TIP"):this.$t("NavigationPanel.LAST_PAGE_TIP")},animationInProgress:function(){return this.$store.state.workspace.animationInProgress}},watch:{animationInProgress:function(){this.classes.start=!1}},methods:{goRight:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.timeout>Date.now()||(this.$root.$emit("nav:goRight"),this.movePagerRight({target:e?"nav-swipe":"nav-tap"}),this.timeout=Date.now()+150)},goLeft:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.timeout>Date.now()||(this.$root.$emit("nav:goLeft"),this.movePagerLeft({target:e?"nav-swipe":"nav-tap"}),this.timeout=Date.now()+150)},rightToTheLast:function(){this.timeout>Date.now()||(this.movePagerRightmost({navTarget:!0}),this.timeout=Date.now()+150)},leftToTheLast:function(){this.timeout>Date.now()||(this.movePagerLeftmost({navTarget:!0}),this.timeout=Date.now()+150)}}},Ao=Bo,Ho=(0,U.Z)(Ao,_o,Wo,!1,null,"b2596fc6",null).exports,No=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"zoom-panel",class:t.panelClass,style:t.panelStyle,attrs:{id:"zoom-panel",dir:t.dir}},[i("span",{staticClass:"zoom-panel-caption minus",attrs:{title:t.$t("ZoomBar.ZOOM_OUT_TIP")},on:{click:t.zoomOut}},[t._v("–")]),t._v(" "),i("div",{ref:"zoomLine",staticClass:"zoom-panel-line",on:{click:t.lineClick}},[i("v-touch",{ref:"zoomSlider",staticClass:"zoom-panel-slider",style:t.sliderStyle,attrs:{id:"zoom-slider","pan-options":{direction:"horizontal",threshold:1}},on:{panstart:t.onPanStart,panmove:t.onPanMove,panend:t.onPanEnd,pancancel:t.onPanEnd}})],1),t._v(" "),i("span",{staticClass:"zoom-panel-caption plus",attrs:{title:t.$t("ZoomBar.ZOOM_IN_TIP")},on:{click:t.zoomIn}},[t._v("+")])])},Zo=[],Vo=(i(169),i(2209),{name:"ZoomPanel",data:function(){return{scalePosition:0,savedScalePosition:null,lineWidth:90,forceOpacity:!1,forceVisibility:!1,opacityTimer:null,isGrabbing:!1}},mounted:function(){window.addEventListener("keydown",this.keyDownHandler),this.$root.$on("unzoomed",this.hide),this.updateScalePosition(this.zoomFactor)},beforeDestroy:function(){window.removeEventListener("keydown",this.keyDownHandler),this.$root.$off("unzoomed",this.hide)},watch:{zoomFactor:"updateScalePosition",minZoom:function(t){this.zoomFactor>t?this.scalePosition=1*((this.zoomFactor-t)/(this.maxZoom-t)).toFixed(2):this.scalePosition=0},scalePosition:function(){var t=this;this.forceOpacity=!0,clearTimeout(this.opacityTimer),this.opacityTimer=setTimeout((function(){t.forceOpacity=!1}),2e3)},pagerState:function(){this.forceVisibility=!1},visible:function(t){this.$store.dispatch("workspace/setZoomPanel",t)},zoomPanel:function(t){t||(this.forceVisibility=!1)}},computed:{zoomFactor:function(){return this.$store.state.pages.size.zoomFactor},isRtl:function(){return this.$store.getters["i18n/isLocaleRtl"]},dir:function(){return this.isRtl?"rtl":"ltr"},pagerState:function(){return[this.$store.state.pager.currentPage]},visible:function(){return this.zoomFactor>this.minZoom||this.forceVisibility},zoomPanel:function(){return this.$store.state.workspace.zoomPanel},minZoom:function(){if("slide-book"===this.$store.state.workspace.bookComponent)return 1;var t=this.isHardcover&&(this.isFirstPage||this.isLastPage)?1.03:1,e=this.isSingleMode?1:2;return Math.min(this.$store.state.workspace.containerSize.height/(this.$store.state.pages.size.height*t/this.$store.state.pages.size.zoomFactor),this.$store.state.workspace.containerSize.width/(this.$store.state.pages.size.width*t*e/this.$store.state.pages.size.zoomFactor))},isFirstPage:function(){return this.$store.getters["pager/isFirstSpread"]},isLastPage:function(){return this.$store.getters["pager/isLastSpread"]},isSingleMode:function(){return"single"===this.$store.getters["pager/mode"]},maxZoom:function(){return this.$store.state.workspace.maxZoom},sliderStyle:function(){var t={},e=6;return this.isRtl?t.right=Math.round((this.lineWidth-e)*this.scalePosition)+"px":t.left=Math.round((this.lineWidth-e)*this.scalePosition)+"px",t},panelClass:function(){return{grabbing:this.isGrabbing}},panelStyle:function(){return{opacity:this.forceOpacity?.9:null,visibility:this.visible?"visible":"hidden"}},shouldBlockHotkeys:function(){return null!==this.$store.state.popup.opened||null!==this.$store.state.sidebar.opened||this.$store.state.workspace.modalOpened||this.$store.getters["lightbox/isShown"]}},methods:{zoomOut:function(){if(!this.$store.state.workspace.animationInProgress&&(!1!==this.forceVisibility||0!==this.scalePosition)){if(this.scalePosition>.1)this.scalePosition-=.1;else{if(!0===this.forceVisibility&&0===this.scalePosition)return this.forceVisibility=!1,void this.$root.$emit("zoomPanel",{action:"zoomOut"});this.forceVisibility=!0,this.scalePosition=0}this.$root.$emit("zoomPanel",{action:"setZoom",zoomFactor:1*(this.scalePosition*(this.maxZoom-this.minZoom)+this.minZoom).toFixed(2),fast:!0})}},zoomOutFull:function(){this.$store.state.workspace.animationInProgress||(this.forceVisibility=!1,this.$root.$emit("zoomPanel",{action:"zoomOut"}))},zoomIn:function(){this.$store.state.workspace.animationInProgress||(0!==this.scalePosition||this.visible?(this.scalePosition<0&&(this.scalePosition=0),this.scalePosition<.9?this.scalePosition+=.1:this.scalePosition=1,this.$root.$emit("zoomPanel",{action:"setZoom",zoomFactor:1*(this.scalePosition*(this.maxZoom-this.minZoom)+this.minZoom).toFixed(2),fast:!0})):this.$root.$emit("zoomPanel",{action:"zoomIn"}))},lineClick:function(t){var e=this;if(!this.$store.state.workspace.animationInProgress){var i=this.$refs.zoomLine.getBoundingClientRect();this.isRtl?this.scalePosition=(this.lineWidth-t.clientX+i.left)/this.lineWidth:this.scalePosition=(t.clientX-i.left)/this.lineWidth,this.scalePosition<=0&&(this.scalePosition=0),0===this.scalePosition&&(this.forceVisibility=!0),this.$nextTick((function(){e.$root.$emit("zoomPanel",{action:"setZoom",zoomFactor:1*(e.scalePosition*(e.maxZoom-e.minZoom)+e.minZoom).toFixed(2),fast:!1})}))}},onPanStart:function(){this.savedScalePosition=this.scalePosition,this.isGrabbing=!0,this.$root.$emit("zoomPanel",{action:"startScale"})},onPanMove:function(t){var e=1*(this.isRtl?-t.deltaX/this.lineWidth:t.deltaX/this.lineWidth).toFixed(2);this.scalePosition=this.savedScalePosition+e,this.scalePosition>1&&(this.scalePosition=1),this.scalePosition<=0&&(this.scalePosition=0);var i=this.scalePosition/this.savedScalePosition;this.$root.$emit("zoomPanel",{action:"changeScale",scalePosition:this.scalePosition,scaleRatio:i})},onPanEnd:function(t){this.isGrabbing=!1;var e=1*(this.isRtl?-t.deltaX/this.lineWidth:t.deltaX/this.lineWidth).toFixed(2);this.scalePosition+=e,this.scalePosition>1&&(this.scalePosition=1),this.scalePosition<=0&&(this.scalePosition=0),0===this.scalePosition?this.forceVisibility=!0:this.forceVisibility=!1,this.$root.$emit("zoomPanel",{action:"endScale",zoomFactor:this.scalePosition*(this.maxZoom-this.minZoom)+this.minZoom})},keyDownHandler:function(t){if(((0,_.Ft)(t.target)||(0,_.o8)(t.target)||"input"!==t.target.tagName.toLowerCase()&&"textarea"!==t.target.tagName.toLowerCase()&&"select"!==t.target.tagName.toLowerCase()&&"option"!==t.target.tagName.toLowerCase())&&!this.shouldBlockHotkeys)switch(t.code){case"Equal":case"NumpadAdd":(t.metaKey||t.ctrlKey)&&(t.preventDefault(),this.zoomIn());break;case"Minus":case"NumpadSubtract":(t.metaKey||t.ctrlKey)&&(t.preventDefault(),this.zoomOut());break;case"Digit0":(t.metaKey||t.ctrlKey)&&this.zoomOutFull()}},hide:function(){this.forceVisibility=!1,this.$store.dispatch("workspace/setZoomPanel",!1)},updateScalePosition:function(t){t>this.minZoom?this.scalePosition=1*((t-this.minZoom)/(this.maxZoom-this.minZoom)).toFixed(2):this.scalePosition=0}}}),jo=(0,U.Z)(Vo,No,Zo,!1,null,"9d1e0d5e",null).exports,Uo=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"note-editor"},[t.showRect?i("div",{ref:"rect",class:t.rectClass,style:t.rectStyle,attrs:{role:"dialog"}},[i("div",{staticClass:"note-body"},[i("textarea",{directives:[{name:"model",rawName:"v-model",value:t.textAreaValue,expression:"textAreaValue"}],ref:"text",staticClass:"note-article",attrs:{role:"textbox",dir:t.textareaDir,maxlength:"500",placeholder:t.placeholderText,tabindex:"0"},domProps:{value:t.textAreaValue},on:{focus:t.focusTextArea,keydown:function(e){return(e.type.indexOf("key")||13===e.keyCode)&&e.ctrlKey?t.setViewState(e):null},input:function(e){e.target.composing||(t.textAreaValue=e.target.value)}}})]),t._v(" "),i("div",{staticClass:"note-footer",attrs:{"aria-hidden":"true"}},[i("div",{class:t.colorSetClass},[i("div",{staticClass:"note-border-color green",on:{click:function(e){return t.setColor("green")}}},[i("div",{staticClass:"note-color"})]),t._v(" "),i("div",{staticClass:"note-border-color blue",on:{click:function(e){return t.setColor("blue")}}},[i("div",{staticClass:"note-color"})]),t._v(" "),i("div",{staticClass:"note-border-color violet",on:{click:function(e){return t.setColor("violet")}}},[i("div",{staticClass:"note-color"})]),t._v(" "),i("div",{staticClass:"note-border-color red",on:{click:function(e){return t.setColor("red")}}},[i("div",{staticClass:"note-color"})]),t._v(" "),i("div",{staticClass:"note-border-color orange",on:{click:function(e){return t.setColor("orange")}}},[i("div",{staticClass:"note-color"})]),t._v(" "),i("div",{staticClass:"note-border-color gray",on:{click:function(e){return t.setColor("gray")}}},[i("div",{staticClass:"note-color"})])]),t._v(" "),i("div",{staticClass:"note-time"},[t._v(t._s(t.formattedTime))]),t._v(" "),i("span",{staticClass:"icon icon-trash-can note-button note-delete-button",attrs:{title:t.deleteTip},on:{click:t.deleteNoteCheck}},[i("svgicon",{attrs:{focusable:"false",name:"trash-can"}})],1)])]):t._e(),t._v(" "),t.deleteDialog?i("div",{ref:"deleteDialog",class:t.rectClass,style:t.rectStyle,attrs:{role:"dialog"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.deleteDialogCancel(e)}}},[i("div",{staticClass:"note-delete-dialog",attrs:{dir:t.dir,"aria-hidden":"true"}},[i("div",{staticClass:"note-delete-dialog-text"},[i("div",{staticClass:"note-delete-dialog-text-flex"},[i("span",[t._v(t._s(t.dialogDeleteText))])])]),t._v(" "),i("div",{staticClass:"note-delete-dialog-buttons"},[i("button",{ref:"cancelButton",staticClass:"note-delete-dialog-cancel",attrs:{tabindex:"0"},on:{click:t.deleteDialogCancel}},[t._v("\n "+t._s(t.cancelButton)+"\n ")]),t._v(" "),i("button",{staticClass:"note-delete-dialog-confirm",attrs:{tabindex:"0"},on:{click:function(e){return t.deleteNote(e,"editor")}}},[t._v("\n "+t._s(t.deleteButton)+"\n ")])])])]):t._e()])},Go=[],Xo=(i(6062),i(6382)),Yo=i.n(Xo),qo=24,Ko=4,Qo=1.03,Jo={name:"NoteEditor",data:function(){return{rectLeft:-115,rectTop:4,rectHeight:125,rectWidth:230,rectPadding:10,rectState:"view",deleteDialog:!1,textAreaValue:""}},computed:{textareaDir:function(){if(""!==this.textAreaValue){var t=Yo().getDirection(this.textAreaValue);return t&&"ltr"!==t?"rtl":"ltr"}return this.dir},isOpened:function(){return!!this.currentNoteId},isMovingNote:function(){return this.$store.state.notes.isMoving},showRect:function(){return this.isOpened&&!this.isMovingNote&&this.enoughSpace},currentNoteId:function(){return this.$store.state.notes.opened},currentNoteData:function(){return this.$store.getters["notes/noteByID"](this.currentNoteId)},oneCurrentPage:function(){var t=this.pagerState.singleMode,e=this.pagerState.slideMode,i=this.pagerState.isFirstSpread||this.pagerState.isLastSpread;return t||e||i},rightPageOffset:function(){var t=this.pagerState.wide;return!this.oneCurrentPage&&!t&&this.rtl!==(this.pagerState.rightPage===this.currentNoteData.page)?this.pageSize.width:0},singleModeRightPageCorrectionX:function(){var t=this.pagerState.singleMode,e=this.pagerState.wide,i="right"===this.pagerState.pageSide;return t&&e&&i?-this.pageSize.width:0},leftZoomOffset:function(){return this.containerSize.width>this.pageSize.width&&this.oneCurrentPage?(this.containerSize.width-this.pageSize.width)/2+this.leftHardcoverZoomOffset:0},topZoomOffset:function(){return this.containerSize.height>this.pageSize.height?(this.containerSize.height-this.pageSize.height)/2:0},topHardcoverZoomOffset:function(){return this.pagerState.hardcover?-this.pageSize.height*(Qo-1)/2:0},leftHardcoverZoomOffset:function(){if(!this.pagerState.hardcover)return 0;var t=this.pageSize.width*(Qo-1)/2;return this.isRtlOrientation?t:-t},isZoomed:function(){return 1!==this.$store.state.pages.size.zoomFactor},hardcoverTopPadding:function(){var t=Math.round(this.pageSize.height*Qo);return t%2!=0&&(t+=1),this.pagerState.hardcover?Math.round((t-this.pageSize.height)/2):0},isRtlOrientation:function(){return this.pagerState.isFirstSpread&&this.rtl||this.pagerState.isLastSpread&&!this.rtl},hardcoverLeftPadding:function(){return this.pagerState.hardcover&&this.isRtlOrientation?this.pageSize.width*(1-Qo):0},currentNotePosition:function(){var t,e;if(this.isZoomed){var i="[data-zoom-wrapper]",s=new window.WebKitCSSMatrix(window.getComputedStyle(this.$root.$el.querySelector(i)).transform);t=s.m41+this.leftZoomOffset,e=s.m42+this.topZoomOffset+this.topHardcoverZoomOffset}else t=this.holderSize.left,e=this.holderSize.top-this.hardcoverTopPadding;return{left:t+this.rightPageOffset+this.singleModeRightPageCorrectionX+this.hardcoverLeftPadding+Math.round(this.currentNoteData.pX*this.scale.w),top:Math.max(e+Math.round(this.currentNoteData.pY*this.scale.h),e+qo+Ko)}},pagerState:function(){return this.$store.getters["pager/state"]},slideComponent:function(){return"slide-book"===this.$store.state.workspace.bookComponent},isContentCropMode:function(){return this.pagerState.slideMode&&this.$store.state.book.contentCrop},pageSize:function(){if(this.slideComponent){var t=this.pagerState.currentPage;return this.$store.getters["pages/currentSize"](t)}return this.$store.getters["pages/size"]},holderSize:function(){return this.$store.getters["workspace/holderSize"]},containerSize:function(){return this.$store.getters["workspace/containerSize"]},enoughSpace:function(){return this.containerSize.width>=this.rectWidth+2*this.rectPadding&&this.containerSize.height>=this.rectHeight+2*this.rectPadding},scale:function(){var t=this.slideComponent&&this.pagerState.wide;return{w:this.pageSize.width*(this.pagerState.hardcover?Qo:1)/this.$store.state.book.bookSize.width/(t?2:1),h:this.pageSize.height*(this.pagerState.hardcover?Qo:1)/this.$store.state.book.bookSize.height}},rectStyle:function(){return{top:this.currentNotePosition.top+this.rectTop+"px",left:this.currentNotePosition.left+this.rectLeft+"px"}},rectClass:function(){return["note-rect",this.rectState]},colorSetClass:function(){return["note-color-set",this.currentNoteData.color]},formattedTime:function(){var t=new Date(Date.now()),e=new Date(this.currentNoteData.date),i=e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return t.getDay()===e.getDay()&&t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()||(i=e.toLocaleDateString()+", "+i),i},dir:function(){return this.$store.getters["i18n/isLocaleRtl"]?"rtl":"ltr"},rtl:function(){return this.$store.state.book.rightToLeft},placeholderText:function(){return this.$i18n.t("Notes.PLACEHOLDER")},dialogDeleteText:function(){return this.$i18n.t("Notes.DIALOG_DELETE_TEXT")},deleteTip:function(){return this.$i18n.t("Notes.DELETE_TIP")},deleteButton:function(){return this.$i18n.t("AlertWindow.BUTTON_DELETE")},cancelButton:function(){return this.$i18n.t("AlertWindow.BUTTON_CANCEL")},isFrozenOrNotReady:function(){return this.$store.state.workspace.freezed||"ready"!==this.$store.state.workspace.status||this.$store.state.workspace.isResizing||this.$store.state.pager.freezed}},watch:{isOpened:function(t){var e,i=this;t&&(null!==(e=this.currentNoteData)&&void 0!==e&&e.new&&(this.rectState="edit"),this.showEditor(),setTimeout((function(){"edit"===i.rectState&&i.forceFocus()}),100))},isMovingNote:function(t){t?this.deleteDialog=!1:this.updateEditorParams()},currentNoteId:function(t,e){!t&&e&&this.hideEditor(e)},size:function(){this.isOpened&&this.updateEditorParams()},containerSize:function(){this.updateEditorParams()},currentNoteData:function(t){this.textAreaValue=t?t.text:""}},mounted:function(){this.$root.$on("contextMenu:deleteNote",this.onDelete),this.$root.$on("contextMenu:editNote",this.onEdit),this.$root.$on("note:deleteDialog",this.onDeleteDialog),this.$root.$on("turnStart",this.onTurnStart),this.hideEditorBound=this.hideEditor.bind(this.currentNoteId,this),this.$root.$on("zoomScrollMove",this.hideEditorBound),this.updateEditorParams(),this.isOpened&&this.showEditor(),this.parentEl=this.$el.parentElement},beforeDestroy:function(){this.$root.$off("contextMenu:deleteNote",this.onDelete),this.$root.$off("contextMenu:editNote",this.onEdit),this.$root.$off("note:deleteDialog",this.onDeleteDialog),this.$root.$off("zoomScrollMove",this.hideEditorBound),this.$root.$off("turnStart",this.onTurnStart),document.removeEventListener("keydown",this.checkKeydown),this.removeEditorEventListeners(),this.deleteDialog=!1},methods:{showEditor:function(){this.updateEditorParams(),this.$store.dispatch("notes/setOpenedId",{id:this.currentNoteId}),this.$store.dispatch("notes/setActiveItemById",this.currentNoteId),document.addEventListener("mousedown",this.hideEditorClick,!0),document.addEventListener("keydown",this.checkKeydown)},hideEditor:function(t){this.deleteDialog=!1,document.activeElement===this.$refs.text&&this.$refs.text.blur(),this.saveText(t),this.$store.dispatch("notes/setOpenedId",{id:null}),this.$store.dispatch("workspace/setHighlightTimeout",Date.now()+300),document.removeEventListener("keydown",this.checkKeydown),this.removeEditorEventListeners(),this.rectState="view"},updateEditorParams:function(){if(this.isOpened){var t=this.containerSize.width-this.currentNotePosition.left;this.currentNotePosition.leftthis.rectHeight+2*Ko,i=this.currentNotePosition.top>this.rectHeight+qo+2*Ko;if(e)this.rectTop=Ko;else if(i)this.rectTop=-(this.rectHeight+qo+2*Ko);else{this.rectTop=-(this.rectHeight+qo+2*Ko)/2,this.rectLeft=-this.rectWidth/2;var s=this.rectWidth/2+qo+Ko,o=this.currentNotePosition.left>this.rectWidth+this.rectPadding,r=t-qo>this.rectWidth+this.rectPadding;if(o||r)this.rectLeft+="rtl"===this.dir&&o||!r?-s:s;else{var n=this.$el.getBoundingClientRect().right+this.rectWidth+this.rectPadding>this.$store.state.workspace.size.width;this.rectLeft+=n?-s:s}}}},hideEditorClick:function(t){for(var e=(0,l.iZ)(t.target),i=0,s=e.length;i1&&void 0!==arguments[1]?arguments[1]:"editor";""===this.currentNoteData.text?this.deleteNote(t,i):(this.deleteDialog=!0,this.isOpened||document.addEventListener("mousedown",this.deleteDialogCancel),this.$nextTick((function(){document.removeEventListener("keydown",e.checkKeydown),e.$refs.cancelButton.focus()})))},onDeleteDialog:function(t,e){this.currentNoteId!==t&&this.$store.dispatch("notes/setOpenedId",{id:t}),this.deleteNoteCheck(null,e)},checkKeydown:function(t){if("Escape"===t.code&&this.$store.dispatch("notes/setOpenedId",{id:null}),"view"===this.rectState&&t.preventDefault(),"Backspace"===t.code||"Delete"===t.code){if(this.$refs.text===document.activeElement)return;this.deleteNoteCheck(t,"hotkey")}},removeEditorEventListeners:function(){document.removeEventListener("mousedown",this.hideEditorClick,!0)},deleteNote:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;document.removeEventListener("keydown",this.checkKeydown),this.removeEditorEventListeners(),this.$store.dispatch("notes/deleteNote",{id:this.currentNoteId,initiator:e}),this.$store.dispatch("notes/setOpenedId",{id:null}),this.deleteDialogCancel()},deleteDialogCancel:function(){var t=this;this.isOpened&&document.addEventListener("keydown",this.checkKeydown),document.removeEventListener("mousedown",this.deleteDialogCancel),this.deleteDialog=!1,this.$nextTick((function(){t.$root.$emit("note:closeDeleteDialog")}))},setViewState:function(t){this.rectState="view",t.target.blur()},forceFocus:function(){var t;null===(t=this.$refs.text)||void 0===t||t.focus()},onDelete:function(t){this.currentNoteId!==t&&this.$store.dispatch("notes/setOpenedId",{id:t}),this.deleteNoteCheck(null,"context-menu")},onEdit:function(t){this.$store.dispatch("notes/setOpenedId",{id:t})},onTurnStart:function(){this.hideEditor(this.currentNoteId)}}},tr=Jo,er=(0,U.Z)(tr,Uo,Go,!1,null,"bf390c46",null).exports;i(5903);function ir(){return ir=Object.assign?Object.assign.bind():function(t){for(var e=1;e0},substrateStyle:function(){var t,e;if(this.$store.getters["pager/state"].slideMode)e="100%",t=0;else{var i=this.$store.state.workspace.holderSize.top,s=this.$store.getters["pages/size"].height,o=this.$store.state.workspace.containerSize.height;t=1===this.$store.state.book.bookSize.zoomFactor?i+"px":o>=s?Math.round(i)+"px":0,e=Math.min(s,o)+"px"}return{display:"block",height:e,top:t,cursor:this.isFrozen?"inherit":"pointer","z-index":this.isFrozen&&"flip-book"===this.bookComponent?2e5:"auto"}},logoKey:function(){return this.$store.getters["logo/logoKey"]},renderLogo:function(){return this.$store.getters["logo/renderLogo"]},isMobile:function(){return this.$store.getters["workspace/isMobile"]},isMobileApp:function(){return"mobile-app"===this.$store.getters["info/version"]},isFrozen:function(){return this.$store.getters["workspace/isFrozen"]||this.$store.getters["pager/isFrozen"]}},methods:{documentOnMouseUp:function(){clearTimeout(this.inspectorModeTimeoutId)},documentOnMouseDown:function(t){var e=this;t.shiftKey&&t.altKey&&(t.ctrlKey||t.metaKey)&&(t.preventDefault(),this.inspectorModeTimeoutId=setTimeout((function(){e.$store.dispatch("workspace/setInspectorMode",!e.inspectorMode)}),1e3))},fitBook:function(t,e){var i=ir({},e),s=this.$store.state.book.bookSize,o=this.bookScaleSize,r=this.pagesCount,n=(0,Ce.Tj)({width:2*s.width,height:s.height},i),a=Te(r,r,n,.1*n.width),h=(o||100)/100,l=28,c=34,d=this.isSingleMode?2*c:2*l,u=10;"desktop"===this.layout?(this.hasThickness&&(i.width-=a),i.width-=d):this.isMobile&&(!this.isSingleMode&&this.hasThickness&&(i.width-=a),i.height-=u);var p=(0,Ce.Tj)(t,i);if(this.isHardcover){var g=this.isSingleMode?1.04:1.03;p.width=p.width/g,p.height=p.height/g}var f=p.height/p.width;return p.width=Math.floor(p.width*h),p.width=p.width%2==0?p.width:p.width+1,p.height=Math.floor(f*p.width),{width:p.width,height:p.height}},resize:function(t){var e=window.getComputedStyle(this.$el),i={left:1*e.getPropertyValue("margin-left").split("px")[0],right:1*e.getPropertyValue("margin-right").split("px")[0],top:1*e.getPropertyValue("margin-top").split("px")[0],bottom:1*e.getPropertyValue("margin-bottom").split("px")[0]};this.containerSize={width:this.size.width-i.left-i.right,height:this.size.height-i.top-i.bottom,top:this.size.top+i.top,left:this.size.left+i.left},this.$store.dispatch("workspace/setContainerSize",this.containerSize);var s=this.fitBook(this.originalBookSize,this.containerSize),o=Math.round(s.width/(this.isSingleMode?1:2)),r=Math.round(s.height);r=r%2==0?r:r+1,this.bookSize={width:o,height:r,zoomFactor:this.originalBookSize.zoomFactor}},goToRightPage:function(){var t=this;this.$store.state.pager.freezed||setTimeout((function(){t.movePagerRight({target:"free-space-tap"})}),0)},goToLeftPage:function(){var t=this;this.$store.state.pager.freezed||setTimeout((function(){t.movePagerLeft({target:"free-space-tap"})}),0)},arrowHover:function(t,e){this.$refs.bookComponent&&"function"==typeof this.$refs.bookComponent.arrowHover&&this.$refs.bookComponent.arrowHover(t,e)},afterFade:function(){this.ctrFade="no-fade"}},beforeMount:function(){this.$root.$once("before-preloader-off",this.resize),this.$store.dispatch("workspace/setBookComponent",this.bookComponent),this.$root.$on("forceBookResize",this.resize)},mounted:function(){this.resize(!0),this.hasPages||this.$root.onPublicationLoad({}),document.addEventListener("mousedown",this.documentOnMouseDown),document.addEventListener("mouseup",this.documentOnMouseUp)},beforeDestroy:function(){this.$root.$off("forceBookResize",this.resize),document.removeEventListener("mousedown",this.documentOnMouseDown),document.removeEventListener("mouseup",this.documentOnMouseUp)},watch:{size:function(){this.resize()},bookScaleSize:function(){this.resize()},originalBookSize:function(){this.resize()},hasThickness:function(){this.resize()},bookComponent:function(t){this.$store.dispatch("pager/setForceRerender",{forceRerender:!1}),this.$store.dispatch("workspace/setBookComponent",t),this.resize()},pagerState:function(t,e){var i=this;!this.miniState||this.miniFullScreen||t.isEqualState(e)||(this.ctrFade="ctr-fade",this.$nextTick((function(){i.miniFullScreen=!0})))},renderLogo:function(t){var e,i=this;t||(null!==(e=this.$refs)&&void 0!==e&&null!==(e=e.logoComponent)&&void 0!==e&&e.$el&&!this.$refs.logoComponent.$el.parentElement&&this.$el.appendChild(this.$refs.logoComponent.$el),this.$nextTick((function(){i.$store.dispatch("logo/updateKey")})))}}},or=sr,rr=(0,U.Z)(or,s,o,!1,null,"42bb92b2",null).exports},5343:function(t,e,i){"use strict";i.d(e,{Z:function(){return n}});var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("transition",{attrs:{name:"fade"}},[i("div",{staticClass:"flash-message",style:t.messageData.style,attrs:{role:"alert","aria-live":"assertive","aria-atomic":"true"}},[t._v("\n "+t._s(t.messageData.text)+"\n ")])])},o=[],r={name:"FlashMessage",mounted:function(){var t=this;null!==this.$store.getters["workspace/flashMessage"]&&setTimeout((function(){t.$store.dispatch("workspace/setFlashMessage",null)}),this.delay)},computed:{messageData:function(){return this.$store.getters["workspace/flashMessage"]},delay:function(){return this.messageData&&this.messageData.delay?this.messageData.delay:900}}},n=(0,i(1900).Z)(r,s,o,!1,null,"8ce2c984",null).exports},1500:function(t,e,i){"use strict";i.d(e,{Z:function(){return G}});var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.show?i("v-touch",{on:{swipeleft:function(e){t.isNavEnabled&&t.goRight("swipe")},swiperight:function(e){t.isNavEnabled&&t.goLeft("swipe")},swipeup:t.close,swipedown:t.close}},[i("span",{ref:"first-trap",attrs:{tabindex:"0","aria-hidden":"true"}}),t._v(" "),i("transition",{attrs:{name:"lightbox"},on:{"after-enter":function(e){!t.isMobile&&t.setFocusTraps({})}}},[i("div",{directives:[{name:"show",rawName:"v-show",value:t.isLightboxActive&&(t.areThumbnailsReady||t.isSmallWorkspace||!t.isNavEnabled),expression:"isLightboxActive && (areThumbnailsReady || isSmallWorkspace || !isNavEnabled)"}],class:t.lightboxClasses,style:t.lightboxStyle},[i("div",{staticClass:"lightbox-main"},[i("div",{staticClass:"lightbox-content",style:t.lightboxSizeStyle,on:{click:function(e){!t.isMobile&&t.setFocusTraps({justResetFocus:!0})}}},[i("transition",{attrs:{name:"lightbox-element"}},[i(t.item.component,{key:t.item.key,tag:"component",staticClass:"lightbox-element",attrs:{currentItem:t.item.data},on:{"lightbox-rect":t.setLightboxRect,"toggle-overlap-visibility":t.toggleOverlapVisibility}})],1),t._v(" "),i("button",{ref:"btn-close",staticClass:"lightbox-btn close",attrs:{tabindex:"0","aria-label":t.localization.closeButton,title:t.localization.closeButton},on:{click:t.close}},[i("svgicon",{staticClass:"svg-icon",attrs:{focusable:"false",name:"cross"}})],1),t._v(" "),t.currentLightboxItem&&t.currentLightboxItem.description&&t.isOverlapVisible?i("div",{staticClass:"lightbox-description-wrapper",attrs:{dir:t.descriptionDir}},[i("div",{staticClass:"lightbox-description-container",on:{click:function(e){e.preventDefault(),t.isDescriptionOverflowing&&t.toggleDescription()},mousedown:function(t){t.preventDefault()},mouseup:function(t){t.preventDefault()}}},[null!==t.isDescriptionOverflowing?i("div",{ref:"lightbox-description",class:t.descriptionClasses,attrs:{id:"lightbox-description"}},t._l(t.currentLightboxItem.descriptionByType,(function(e){return i("span",["text"===e.type?[t._v(t._s(e.raw))]:"link"===e.type?i("a",{staticClass:"description-link",attrs:{href:e.link,target:"_blank"},on:{click:function(t){t.stopPropagation()},mousedown:function(t){t.preventDefault()},mouseup:function(t){t.preventDefault()}}},[t._v("\n "+t._s(e.text))]):t._e()],2)})),0):t._e(),t._v(" "),i("div",{ref:"description-placeholder",staticClass:"lightbox-description lightbox-description-placeholder",attrs:{"aria-hidden":"true"}},t._l(t.currentLightboxItem.descriptionByType,(function(e){return i("span",["text"===e.type?[t._v(t._s(e.raw))]:"link"===e.type?i("a",{staticClass:"description-link",attrs:{href:e.link,tabindex:"-1"}},[t._v("\n "+t._s(e.text))]):t._e()],2)})),0),t._v(" "),t.isDescriptionOverflowing?i("div",{staticClass:"lightbox-description-more"},[t._v("\n "+t._s(t.descriptionMore)+"\n ")]):t._e()])]):t._e()],1)]),t._v(" "),!t.isSmallWorkspace&&t.isNavEnabled?[i("div",{staticClass:"nav-area nav-area-left",on:{click:function(e){return t.goLeft("area")}}}),t._v(" "),i("div",{staticClass:"nav-area nav-area-right",on:{click:function(e){return t.goRight("area")}}})]:t._e(),t._v(" "),!t.isSmallWorkspace&&t.isNavEnabled?i("div",{staticClass:"nav-btns"},[i("button",{ref:"nav-btn-left",staticClass:"lightbox-btn nav-btn nav-btn-left",attrs:{tabindex:"0","aria-label":t.localization.leftButton,title:t.localization.leftButton},on:{click:function(e){return t.goLeft("button")}}},[i("svgicon",{staticClass:"chevron-left",attrs:{focusable:"false",name:"chevron-right"}})],1),t._v(" "),i("button",{ref:"nav-btn-right",staticClass:"lightbox-btn nav-btn nav-btn-right",attrs:{tabindex:"0","aria-label":t.localization.rightButton,title:t.localization.rightButton},on:{click:function(e){return t.goRight("button")}}},[i("svgicon",{attrs:{focusable:"false",name:"chevron-right"}})],1)]):t._e(),t._v(" "),t.isSmallWorkspace&&t.isNavEnabled?i("div",{ref:"small-workspace-nav",staticClass:"small-workspace-nav",attrs:{dir:"ltr"}},[i("div",{ref:"nav-btn-left",staticClass:"lightbox-btn small-workspace-nav-btn small-workspace-nav-btn-left",attrs:{role:"button",tabindex:"0","aria-label":t.localization.leftButton,title:t.localization.leftButton},on:{click:function(e){return t.goLeft("button")}}},[i("svgicon",{staticClass:"chevron-left",attrs:{focusable:"false",name:"chevron-right"}})],1),t._v(" "),i("div",{staticClass:"lightbox-nav-dots-wrapper",attrs:{"data-lightbox-nav-dots-wrapper":"true"}},[i("div",{staticClass:"lightbox-nav-dots-grad-left"}),t._v(" "),i("div",{staticClass:"lightbox-nav-dots-grad-right"}),t._v(" "),i("div",{staticClass:"lightbox-nav-dots"},[i("lightbox-nav-dots")],1)]),t._v(" "),i("div",{ref:"nav-btn-right",staticClass:"lightbox-btn small-workspace-nav-btn small-workspace-nav-btn-right",attrs:{role:"button",tabindex:"0","aria-label":t.localization.rightButton,title:t.localization.rightButton},on:{click:function(e){return t.goRight("button")}}},[i("svgicon",{attrs:{focusable:"false",name:"chevron-right"}})],1)]):t._e(),t._v(" "),!t.isSmallWorkspace&&t.isNavEnabled?i("div",{staticClass:"lightbox-nav"},[i("lightbox-thumbnails")],1):t._e(),t._v(" "),i("div",{staticClass:"lightbox-overlay",on:{click:t.close}})],2)]),t._v(" "),i("span",{ref:"last-trap",attrs:{tabindex:"0","aria-hidden":"true"}})],1):t._e()},o=[],r=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{class:[{"lightbox-thumbnail-image":t.thumbnail}]},[i("transition",{attrs:{name:t.thumbnail?null:"image"}},[t.blobUrl?i("div",{staticClass:"image-wrapper"},[i("div",{staticClass:"image",style:t.imageStyle,attrs:{role:"img","aria-labelledby":"lightbox-description"},on:{click:function(e){!t.thumbnail&&t.isSmallWorkspace&&t.$emit("toggle-overlap-visibility")}}})]):t._e()]),t._v(" "),t.hasError?i("div",{staticClass:"icon-wrap"},[i("svgicon",{staticClass:"error-icon",attrs:{focusable:"false",name:"error"}})],1):t.blobUrl?t._e():i("div",{staticClass:"icon-wrap"},[i("spinner",{attrs:{size:t.thumbnail?12:36,"line-size":3,"line-fg-color":"#5692AE","line-bg-color":"#333"}})],1)],1)},n=[],a=i(9426),h=i(9937),l=i(776),c=i(5657),d=i(2918),u=i(2358),p=(i(6177),{}),g={},f={components:{Spinner:a.Z},props:{currentItem:{type:Object,required:!1},thumbnail:{type:Boolean,default:!1}},data:function(){return{crossOrigin:(0,l.Z)().getCrossOrigin(),blobUrl:null,naturalWidth:null,naturalHeight:null,hasError:null}},computed:{workspaceSize:function(){return this.$store.getters["workspace/size"]},isNavEnabled:function(){return this.$store.getters["lightbox/isNavEnabled"]},isPortrait:function(){return this.$store.getters["workspace/isPortrait"]},wrapperRect:function(){if(this.thumbnail)return this.$store.state.lightbox.thumbnailSizeLimits;if(!this.currentItem||!this.workspaceSize.width)return null;var t=this.getSafeAreaInset("top"),e=this.getSafeAreaInset("right"),i=this.getSafeAreaInset("bottom"),s=this.getSafeAreaInset("left"),o=t+"-"+e+"-"+i+"-"+s+"-"+this.isSmallWorkspace+"-"+this.isPortrait+"-"+this.isNavEnabled+"-"+this.workspaceSize.width+"-"+this.workspaceSize.height;p[this.currentItem.name]=p[this.currentItem.name]||{};var r=p[this.currentItem.name][o];if(void 0===r){var n,a;n=this.currentItem.originalSize?{width:this.currentItem.originalSize[0],height:this.currentItem.originalSize[1]}:this.naturalWidth?{width:this.naturalWidth,height:this.naturalHeight}:{width:Math.round(this.currentItem.rect[0]*this.currentItem.scaleRatio.w),height:Math.round(this.currentItem.rect[1]*this.currentItem.scaleRatio.h)};var h=Math.max(s,e);if(this.isSmallWorkspace){var l=4;a=this.isPortrait?{width:this.workspaceSize.width-2*l,height:this.workspaceSize.height-2*this.buttonSize-this.navHeight-t-i}:{width:this.workspaceSize.width-2*this.buttonSize-2*h,height:this.workspaceSize.height-(this.navHeight||l)-i-l}}else{var c=this.isNavEnabled?Math.max(this.$store.state.lightbox.navAreaPadding,h):0;a={width:this.workspaceSize.width-2*(this.buttonSize+2*c),height:this.workspaceSize.height-2*this.buttonSize-this.navHeight}}r=(0,d.Tj)(n,a,!0),r.width=Math.round(r.width)||1,r.height=Math.round(r.height)||1,p[this.currentItem.name][o]=r}return this.$emit("lightbox-rect",r),r},rawUrl:function(){return this.currentItem&&this.fileName?(0,u.n)({filenameOrUrl:this.fileName}):null},fileName:function(){var t=this.currentItem;if(!(t&&t.name&&t.sizes&&this.wrapperRect))return null;var e=Math.max(this.wrapperRect.width,this.wrapperRect.height),i=(0,c.F)({data:t,maxSize:e});return(0,l.Z)().getImageFileName(i)},isSmallWorkspace:function(){return this.$store.getters["workspace/isSmallWorkspace"]},isMobile:function(){return this.$store.getters["workspace/isMobile"]},isLocaleRtl:function(){return this.$store.getters["i18n/isLocaleRtl"]},imageStyle:function(){return{width:this.wrapperRect.width+"px",height:this.wrapperRect.height+"px","background-image":this.blobUrl?"url("+this.blobUrl+")":null}},isPublisher:function(){return this.$store.state.workspace.userAgentInfo.browser.publisher},buttonSize:function(){return this.isSmallWorkspace?this.$store.state.lightbox.smallWorkspaceButtonSize:this.$store.state.lightbox.buttonSize},navHeight:function(){return this.$store.getters["lightbox/navHeight"]}},watch:{rawUrl:{handler:function(t){this.clear(),t&&this.load()},immediate:!0}},methods:{clear:function(){this.blobUrl=null,this.naturalWidth=null,this.naturalHeight=null,this.hasError=null},load:function(){var t=this;(0,h.Z)({url:this.rawUrl,callback:function(e){var i=document.createElement("img");i.onload=function(){t.blobUrl=e,t.naturalWidth=i.naturalWidth,t.naturalHeight=i.naturalHeight,!t.thumbnail&&t.currentItem&&t.$root.$emit("image",{action:"loaded",pageId:t.currentItem.pageId,url:(0,c.q)(t.currentItem),lightboxUrl:window.location.href})},i.onerror=t.onLoadError,i.crossOrigin=t.crossOrigin,i.src=e,i.style.width="100%"},errorback:this.onLoadError})},onLoadError:function(t){console.error("Image loading error from LightboxImage component.",t),this.hasError=!0},getSafeAreaInset:function(t){return!this.isMobile||this.isPublisher?0:(g[this.workspaceSize.width]=g[this.workspaceSize.width]||{},void 0===g[this.workspaceSize.width][t]&&(g[this.workspaceSize.width][t]=Number(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-inset-"+t).trim().slice(0,-2))),g[this.workspaceSize.width][t])}}},m=i(1900),v=(0,m.Z)(f,r,n,!1,null,"c1eef398",null).exports,b=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"nav-dots"},t._l(t.currentContent,(function(e,s){return i("lightbox-nav-dot",{key:e.itemId,style:t.navDotsStyle,attrs:{item:e}})})),1)},S=[],y=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{class:t.navDotClass,attrs:{"data-active":t.isActive,"data-active-gallery-item":t.isActive&&t.isGalleryItem}},[t.isGallery?t._l(t.item.items,(function(e,s){return i("lightbox-nav-dot",{key:t.item.itemId+"-"+s,attrs:{item:e,itemId:t.item.itemId,galleryItemIndex:s}})})):i("div",{staticClass:"circle"})],2)},w=[],k={name:"lightbox-nav-dot",props:{item:{type:Object,required:!0},galleryItemIndex:{type:Number},itemId:{type:Number}},computed:{navDotClass:function(){return{"nav-dot":!this.isGallery,gallery:this.isGallery,active:this.isActive,"gallery-item":this.isGalleryItem}},isGallery:function(){return"gallery"===this.item.type},isGalleryItem:function(){return this.galleryItemIndex||0===this.galleryItemIndex},currentItemId:function(){return this.$store.state.lightbox.currentItemId},currentGalleryItemIndex:function(){return this.$store.state.lightbox.currentGalleryItemIndex},isActive:function(){return this.isGalleryItem?this.itemId===this.currentItemId&&this.galleryItemIndex===this.currentGalleryItemIndex:this.item.itemId===this.currentItemId}}},x={components:{LightboxNavDot:(0,m.Z)(k,y,w,!1,null,"430c6897",null).exports},data:function(){return{translateX:0}},mounted:function(){setTimeout(this.moveDots)},computed:{currentContent:function(){return this.$store.getters["lightbox/currentContent"]},currentItemId:function(){return this.$store.state.lightbox.currentItemId},currentGalleryItemIndex:function(){return this.$store.state.lightbox.currentGalleryItemIndex},navDotsStyle:function(){return{transform:"translateX("+this.translateX+"px)"}}},watch:{currentItemId:function(t){t&&this.$nextTick(this.moveDots)},currentGalleryItemIndex:function(t){(t||0===t)&&this.$nextTick(this.moveDots)}},methods:{moveDots:function(){var t=this.$el.querySelector("[data-active]"),e=null===this.currentGalleryItemIndex?null:this.$el.querySelector("[data-active-gallery-item]"),i=(e||t).offsetWidth,s=document.querySelector("[data-lightbox-nav-dots-wrapper]").offsetWidth;this.translateX=s/2-t.offsetLeft-i/2,e&&(this.translateX=this.translateX-e.offsetLeft-2)}}},P=(0,m.Z)(x,b,S,!1,null,"7fd5bd80",null).exports,$=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"lightbox-thumbnails",style:t.thumbnailsStyle},[t._l(t.currentContent,(function(e,s){return i("lightbox-thumbnail",{key:e.itemId,attrs:{index:s,thumbnail:t.thumbnails[s]}})})),t._v(" "),i("div",{staticClass:"lightbox-thumbnails-pager",attrs:{dir:t.workspaceDir}},[i("span",[t._v(t._s(t.pager))])])],2)},z=[],C=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{class:t.thumbnailClass,style:t.thumbnailStyle,on:{click:function(e){!t.thumbnail.isActive&&t.lightboxGoTo(e)}}},["image"===t.thumbnail.type?i("lightbox-image",{attrs:{currentItem:t.thumbnail,thumbnail:!0}}):t.isGallery?i("div",{staticClass:"gallery-items-wrapper",attrs:{dir:"ltr"}},t._l(t.thumbnail.items,(function(e,s){return i("div",{key:s,class:["gallery-item",{active:t.thumbnail.isActive&&s===t.thumbnail.galleryItemIndex}],style:{width:t.thumbnailsSizes[t.thumbnail.itemId][s].width+"px",height:t.thumbnailsSizes[t.thumbnail.itemId][s].height+"px"},on:{click:function(e){return t.lightboxGoTo(e,s)}}},["image"===e.type?i("lightbox-image",{attrs:{currentItem:e,thumbnail:!0}}):t._e()],1)})),0):t._e(),t._v(" "),t.isGallery?i("div",{staticClass:"gallery-frame"}):t._e()],1)},T=[];function M(t){return E(t)||R(t)||L(t)||I()}function I(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function L(t,e){if(t){if("string"==typeof t)return O(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?O(t,e):void 0}}function R(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function E(t){if(Array.isArray(t))return O(t)}function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,s=new Array(e);i=t,!o.isMobile&&o.isDescriptionOverflowing&&o.$nextTick((function(){o.$refs["lightbox-description"].addEventListener("focusin",(function(t){o.isDescriptionExpanded=!0})),o.$refs["lightbox-description"].addEventListener("focusout",(function(t){o.isDescriptionExpanded=!1}))}))}),100))}},beforeDestroy:function(){this.$root.$off("lightbox-go-right",this.goRight),this.$root.$off("lightbox-go-left",this.goLeft),this.$root.$off("lightbox-close",this.close)},methods:{toggleOverlapVisibility:function(){this.isOverlapVisible=!this.isOverlapVisible},toggleDescription:function(){this.isDescriptionExpanded=!this.isDescriptionExpanded},close:function(){this.$root.$emit("popupStateChanged",{state:0}),this.$store.dispatch("lightbox/closeLightbox")},goRight:function(t){this.isOverlapVisible=!0,this.isRtl?this.$store.dispatch("lightbox/lightboxGoPrev",t):this.$store.dispatch("lightbox/lightboxGoNext",t),this.emitLightboxEvent("show_content")},goLeft:function(t){this.isOverlapVisible=!0,this.isRtl?this.$store.dispatch("lightbox/lightboxGoNext",t):this.$store.dispatch("lightbox/lightboxGoPrev",t),this.emitLightboxEvent("show_content")},emitLightboxEvent:function(t){this.currentLightboxItem&&this.$root.$emit("lightbox",{action:t,openTarget:"open"===t||"show_content"===t?this.$store.state.lightbox.target:null,itemType:this.currentLightboxItem.type,itemId:this.$store.state.lightbox.currentItemId,galleryItemIndex:this.currentGalleryItemIndex,itemUrl:(0,c.q)(this.currentLightboxItem),lightboxUrl:window.location.href,pageId:this.currentItem.pageId})},setLightboxRect:function(t){this.lightboxRect.width=t.width,this.lightboxRect.height=t.height},setFocusTraps:function(t){var e=t.justResetFocus,i=this.$refs["first-trap"],s=this.$refs["last-trap"],o=this.$refs["nav-btn-right"],r=this.$refs["nav-btn-left"],n=this.$refs["btn-close"];n&&(this.isNavEnabled?(this.isRtl?r.focus():o.focus(),e||(i.addEventListener("focusin",(function(t){t.relatedTarget!==r?o.focus():n.focus()})),s.addEventListener("focusin",(function(t){n.focus()})),this.isFocusTrapped=!0)):n.focus())},getElementComponent:function(t){return"image"===t.type?"lightbox-image":null}}}),G=(0,m.Z)(U,s,o,!1,null,"66001db2",null).exports},9426:function(t,e,i){"use strict";i.d(e,{Z:function(){return c}});var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("div",{staticClass:"vue-simple-spinner",style:t.spinnerStyle}),t._v(" "),t.message.length>0?i("div",{staticClass:"vue-simple-spinner-text",style:t.textStyle},[t._v("\n "+t._s(t.message)+"\n ")]):t._e()])},o=[],r=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},n=16,a=0,h=0,l={props:{size:{default:32},"line-size":{type:Number,default:3},"line-bg-color":{type:String,default:"#eee"},"line-fg-color":{type:String,default:"#2196f3"},speed:{type:Number,default:.8},sync:{type:Boolean,default:!1},spacing:{type:Number,default:4},message:{type:String,default:""},"font-size":{type:Number,default:13},"text-fg-color":{type:String,default:"#555"}},data:function(){return{syncAngle:null}},mounted:function(){this.sync&&(this.syncAngle=a,requestAnimationFrame(this.rotate),h++)},beforeDestroy:function(){clearTimeout(this.rotateTimeoutId),--h||(a=0)},computed:{oneDegDelay:function(){return 1e3*this.speed/360},syncStep:function(){return Math.round(n/this.oneDegDelay)},spinnerSize:function(){switch(this.size){case"tiny":return 12;case"small":return 16;case"medium":return 32;case"large":return 48;case"big":return 64;case"huge":return 96;case"massive":return 128}return r(this.size)?this.size:32},spinnerBorderWidth:function(){switch(this.size){case"tiny":return 1;case"small":return 2;case"medium":case"large":return 3;case"big":case"huge":return 4;case"massive":return 5}return r(this.lineSize)?this.lineSize:4},spinnerStyle:function(){return{border:this.spinnerBorderWidth+"px solid "+this.lineBgColor,borderTop:this.spinnerBorderWidth+"px solid "+this.lineFgColor,width:this.spinnerSize+"px",height:this.spinnerSize+"px",animation:this.sync?null:"vue-simple-spinner-spin "+this.speed+"s linear infinite",transition:this.sync?null:"all 0.3s linear",transform:this.sync?"rotate("+this.syncAngle+"deg)":null}},textStyle:function(){var t,e;switch(this.size){case"tiny":case"small":case"medium":case"large":case"big":case"huge":case"massive":t=Math.min(Math.max(Math.ceil(this.spinnerSize/8),3),12),e=Math.min(Math.max(Math.ceil(.4*this.spinnerSize),11),32);break;default:t=r(this.spacing)?this.spacing:4,e=r(this.fontSize)?this.fontSize:13}return{marginTop:t+"px",fontSize:e+"px",color:this.textFgColor}}},methods:{rotate:function(){var t=this;this.rotateTimeoutId=setTimeout((function(){t.syncAngle===a?(t.syncAngle=t.syncAngle+t.syncStep,t.syncAngle=t.syncAngle>360?t.syncAngle-360:t.syncAngle,a=t.syncAngle):t.syncAngle=a,requestAnimationFrame(t.rotate)}),n)}}},c=(0,i(1900).Z)(l,s,o,!1,null,null,null).exports},7503:function(t,e,i){"use strict";i.d(e,{Z:function(){return l}});var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{class:t.className,style:t.pageStyle},[t.preloaderVisible?i("div",{staticClass:"preloader",attrs:{"aria-hidden":"true"}},[i("div",{staticClass:"preloader-container"},[t.isLoading?i("spinner",{staticClass:"preloader-spinner",attrs:{size:t.preloaderSize,"line-size":t.preloaderLineSize,"line-fg-color":"#5692AE","line-bg-color":"#ffffff"}}):t._e()],1)]):t._e(),t._v(" "),t.rightPreloaderVisible?i("div",{staticClass:"preloader right",attrs:{"aria-hidden":"true"}},[i("div",{staticClass:"preloader-container"},[t.isLoading?i("spinner",{staticClass:"preloader-spinner",attrs:{size:t.preloaderSize,"line-size":t.preloaderLineSize,"line-fg-color":"#5692AE","line-bg-color":"#ffffff"}}):t._e()],1)]):t._e(),t._v(" "),t.enforceWhiteBg?i("img",{staticClass:"enforce-white-bg",attrs:{src:t.whitePixelUrl}}):t._e(),t._v(" "),t.background?i("img",{staticClass:"background",style:t.contentStyle,attrs:{crossOrigin:t.crossOrigin,src:t.background,role:"img","data-id":t.pageId,title:t.$t("AlertMessage.LINK_PAGE_TIP"),"aria-label":t.$t("AlertMessage.LINK_PAGE_TIP"),alt:t.imageAlt}}):t._e()])},o=[],r=i(9426),n=i(776),a=i(2918),h={name:"Thumb",props:{id:{type:[String,Number],required:!0},side:{type:String,required:!1,default:"both",validator:function(t){return-1!==["left","right","both"].indexOf(t)}},size:{type:Object,required:!1,default:null},contentCrop:{type:Boolean,default:!1},showPreloader:{type:Boolean,default:!0}},data:function(){return{isReady:!0,pageId:this.id,pageSide:this.side,crossOrigin:(0,n.Z)().getCrossOrigin(),isWide:!1,isStub:!1,hasError:!1,backgroundColor:"#ffffff",thumbnailUrl:null,pageResize:null,contentWidth:0,contentHeight:0,whitePixelUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII="}},components:{spinner:r.Z},beforeMount:function(){this.getProperties()},watch:{id:function(t){this.pageId=t},side:function(t){this.pageSide=t},changeProperty:function(t){t.pageID===this.pageId&&this.getProperties()},pageId:function(){this.getProperties()}},methods:{getProperties:function(){this.isWide=this.$store.getters["pages/pageProp"](this.pageId,"wide"),this.isStub=this.$store.getters["pages/pageProp"](this.pageId,"stub"),this.hasError=-1===this.$store.getters["pages/pageProp"](this.pageId,"thumbnailUrl"),this.backgroundColor=this.$store.getters["pages/pageProp"](this.pageId,"backgroundColor"),this.thumbnailUrl=this.$store.getters["pages/pageProp"](this.pageId,"thumbnailUrl"),this.pageResize=this.$store.getters["pages/pageProp"](this.pageId,"pageResize"),this.contentWidth=this.$store.getters["pages/pageProp"](this.pageId,"width")/this.contentWidthMultiplier,this.contentHeight=this.$store.getters["pages/pageProp"](this.pageId,"height")}},computed:{imageAlt:function(){return this.$i18n.t("AlertMessage.LINK_PAGE_TIP")+" "+this.pageCaption+" ("+this.$i18n.t("ThumbnailsToolWindow.TITLE")+")"},pageCaption:function(){return this.$store.getters["pages/pageCaptionById"]({id:this.id})},className:function(){return{thumb:!0,double:this.bookMode&&this.isWide&&"both"===this.pageSide,loading:this.isLoading,unready:!this.isReady,error:this.hasError}},preloaderVisible:function(){return this.showPreloader&&!this.isStub&&(this.isLoading||!this.isReady||this.hasError)},rightPreloaderVisible:function(){return this.preloaderVisible&&this.bookMode&&this.isWide&&"both"===this.pageSide},preloaderSize:function(){var t=2,e=this.contentCrop?this.contentSize.height:this.pageSize.height,i=this.contentCrop?this.contentSize.width:this.pageSize.width,s=Math.min(i,e)-2*t;return Math.min(24,s)},preloaderLineSize:function(){return 2},enforceWhiteBg:function(){return this.$store.state.workspace.alteredSVGColors&&this.$store.state.workspace.userAgentInfo.browser.samsung},background:function(){if(!this.pageId||!this.isReady||this.hasError)return null;if(this.isStub){this.$store.state.workspace.policiesUpdated;return this.enforceWhiteBg?this.whitePixelUrl:(0,n.Z)().translatePath("assets/pages/pagestub.png")}return this.thumbnailUrl?this.thumbnailUrl:null},isLoading:function(){return!this.thumbnailUrl||(0===this.$store.state.pages.size.width||null===this.$store.state.pages.size.width)},pageWidthMultiplier:function(){return this.isWide&&"both"===this.pageSide?2:1},contentWidthMultiplier:function(){return this.isWide&&"both"!==this.pageSide?"2":"1"},pagesSize:function(){return this.$store.getters["pages/size"]},pageSize:function(){return this.size&&this.size.width&&this.size.height?{width:this.size.width,height:this.size.height}:{width:this.pagesSize.width*this.pageWidthMultiplier,height:1*this.pagesSize.height}},singleMode:function(){return this.$store.state.pager.singleMode},bookMode:function(){return this.$store.state.pager.spreadMode},pageStyle:function(){return{width:(this.contentCrop?this.contentSize.width:this.pageSize.width)+"px",height:(this.contentCrop?this.contentSize.height:this.pageSize.height)+"px","background-color":this.enforceWhiteBg?null:this.backgroundColor}},contentSize:function(){if(this.pageId){var t,e=this.pageResize,i=this.contentWidth,s=this.contentHeight;return t="FIT"===e?(0,a.Tj)({width:i,height:s},this.pageSize):(0,a.hl)({width:i,height:s},this.pageSize),{width:Math.ceil(t.width),height:Math.ceil(t.height),scaleRatio:{w:t.width/i,h:t.height/s}}}return{width:0,height:0,scaleRatio:{w:0,h:0}}},contentStyle:function(){var t=this.contentCrop?0:(this.pageSize.width-this.contentSize.width)/(this.isWide&&"both"!==this.pageSide?1:2),e=this.contentCrop?0:(this.pageSize.height-this.contentSize.height)/2,i={width:this.contentSize.width*this.contentWidthMultiplier+"px",height:this.contentSize.height+"px"};return"right"===this.pageSide?(i.right="0",t&&(i.marginRight=t+"px")):(i.left="0",t&&(i.marginLeft=t+"px")),e&&(i.marginTop=e+"px"),i},changeProperty:function(){return this.$store.state.pages.changeInPage}}},l=(0,i(1900).Z)(h,s,o,!1,null,null,null).exports},4186:function(t,e,i){var s={"./":[2565,10],"./arrow":[4902,15],"./arrow.js":[4902,15],"./audio":[2400,9],"./audio.js":[2400,9],"./cart":[7875,18],"./cart.js":[7875,18],"./close":[5483,16],"./close.js":[5483,16],"./error":[6177],"./error.js":[6177],"./gallery":[7537,17],"./gallery.js":[7537,17],"./gif":[4582,14],"./gif.js":[4582,14],"./image":[4136,13],"./image.js":[4136,13],"./index":[2565,10],"./index.js":[2565,10],"./made-with":[5284],"./made-with.js":[5284],"./page":[9719],"./page-wide":[1619],"./page-wide.js":[1619],"./page.js":[9719],"./pause":[8175,19],"./pause.js":[8175,19],"./play":[9783,22],"./play.js":[9783,22],"./point":[9596,21],"./point.js":[9596,21],"./replay":[148],"./replay.js":[148]};function o(t){if(!i.o(s,t))return Promise.resolve().then((function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}));var e=s[t],o=e[0];return Promise.all(e.slice(1).map(i.e)).then((function(){return i.t(o,23)}))}o.keys=function(){return Object.keys(s)},o.id=4186,t.exports=o}}]);