/* v 3.17 author http://codecanyon.net/user/creativeinteractivemedia/portfolio?ref=creativeinteractivemedia */ var FLIPBOOK = FLIPBOOK || {}; !function (y, M, L, a) { y.fn.flipBook = function (e) { return new FLIPBOOK.Main(e, this) }, y.fn.swipeBook = function (e) { return e.viewMode = "swipe", new FLIPBOOK.Main(e, this) }, y.fn.flipBook.options = { name: "", pages: [], tableOfContent: [], tableOfContentCloseOnClick: !0, thumbsCloseOnClick: !0, deeplinkingEnabled: !1, deeplinkingPrefix: "", assets: { preloader: "images/preloader.jpg", overlay: "images/overlay.png", flipMp3: "mp3/turnPage.mp3", spinner: "images/spinner.gif" }, pdfUrl: null, pdfBrowserViewerIfMobile: !1, pdfBrowserViewerIfIE: !1, pdfBrowserViewerFullscreen: !0, pdfBrowserViewerFullscreenTarget: "_blank", pdfPageScale: 1, pdfOutline: !0, rangeChunkSize: 64, htmlLayer: !0, rightToLeft: !1, startPage: 0, sound: !0, backgroundColor: "rgb(81, 85, 88)", backgroundImage: "", backgroundPattern: "", backgroundTransparent: !1, thumbSize: 130, loadAllPages: !1, loadPagesF: 2, loadPagesB: 1, autoplayOnStart: !1, autoplayInterval: 3e3, autoplayLoop: !0, skin: "light", layout: "1", menuOverBook: !1, menuFloating: !1, menuBackground: "", menuShadow: "", menuMargin: 0, menuPadding: 0, menuTransparent: !1, menu2OverBook: !0, menu2Floating: !1, menu2Background: "", menu2Shadow: "", menu2Margin: 0, menu2Padding: 0, menu2Transparent: !0, skinColor: "", skinBackground: "", btnColor: "", btnBackground: "none", btnSize: 14, btnRadius: 2, btnMargin: 2, btnShadow: "", btnTextShadow: "", btnBorder: "", btnColorHover: "", btnBackgroundHover: "", sideBtnColor: "#FFF", sideBtnBackground: "#00000033", sideBtnSize: 30, sideBtnRadius: 0, sideBtnMargin: 0, sideBtnPaddingV: 5, sideBtnPaddingH: 0, sideBtnShadow: "", sideBtnTextShadow: "", sideBtnBorder: "", sideBtnColorHover: "#FFF", sideBtnBackgroundHover: "#00000066", floatingBtnColor: "#EEE", floatingBtnBackground: "#00000044", floatingBtnSize: null, floatingBtnRadius: null, floatingBtnMargin: null, floatingBtnShadow: "", floatingBtnTextShadow: "", floatingBtnBorder: "", floatingBtnColorHover: "", floatingBtnBackgroundHover: "", btnOrder: ["currentPage", "btnFirst", "btnPrev", "btnNext", "btnLast", "btnZoomIn", "btnZoomOut", "btnRotateLeft", "btnRotateRight", "btnAutoplay", "btnSearch", "btnSelect", "btnBookmark", "btnToc", "btnThumbs", "btnShare", "btnPrint", "btnDownloadPages", "btnDownloadPdf", "btnSound", "btnExpand", "btnClose"], currentPage: { enabled: !0, title: "Current page", vAlign: "top", hAlign: "left", marginH: 0, marginV: 0, color: "", background: "" }, btnFirst: { enabled: !1, title: "First page", icon: "fa-angle-double-left", icon2: "first_page" }, btnPrev: { enabled: !0, title: "Previous page", icon: "fa-angle-left", icon2: "chevron_left" }, btnNext: { enabled: !0, title: "Next page", icon: "fa-angle-right", icon2: "chevron_right" }, btnLast: { enabled: !1, title: "Last page", icon: "fa-angle-double-right", icon2: "last_page" }, btnZoomIn: { enabled: !0, title: "Zoom in", icon: "fa-plus", icon2: "zoom_in" }, btnZoomOut: { enabled: !0, title: "Zoom out", icon: "fa-minus", icon2: "zoom_out" }, btnRotateLeft: { enabled: !1, title: "Rotate left", icon: "fas fa-undo" }, btnRotateRight: { enabled: !1, title: "Rotate right", icon: "fas fa-redo" }, btnAutoplay: { enabled: !0, title: "Autoplay", icon: "fa-play", icon2: "play_arrow", iconAlt: "fa-pause", iconAlt2: "pause" }, btnSearch: { enabled: !1, title: "Search", icon: "fas fa-search", icon2: "search" }, btnSelect: { enabled: !0, title: "Select tool", icon: "fas fa-i-cursor", icon2: "text_format" }, btnBookmark: { enabled: !0, title: "Bookmark", icon: "fas fa-bookmark", icon2: "bookmark" }, btnToc: { enabled: !0, title: "Table of Contents", icon: "fa-list-ol", icon2: "toc" }, btnThumbs: { enabled: !0, title: "Pages", icon: "fa-th-large", icon2: "view_module" }, btnShare: { enabled: !0, title: "Share", icon: "fa-link", icon2: "share", hideOnMobile: !0 }, btnPrint: { enabled: !0, title: "Print", icon: "fa-print", icon2: "print", hideOnMobile: !0 }, btnDownloadPages: { enabled: !0, title: "Download pages", icon: "fa-download", icon2: "file_download", url: "images/pages.zip", name: "allPages.zip" }, btnDownloadPdf: { forceDownload: !1, enabled: !0, title: "Download PDF", icon: "fa-file", icon2: "picture_as_pdf", url: null, openInNewWindow: !0, name: "allPages.pdf" }, btnSound: { enabled: !0, title: "Volume", icon: "fa-volume-up", iconAlt: "fa-volume-off", icon2: "volume_up", iconAlt2: "volume_mute", hideOnMobile: !0 }, btnExpand: { enabled: !0, title: "Toggle fullscreen", icon: "fa-expand", icon2: "fullscreen", iconAlt: "fa-compress", iconAlt2: "fullscreen_exit" }, btnClose: { title: "Close", icon: "fa-times", icon2: "close", hAlign: "right", vAlign: "top", size: 20 }, btnShareIfMobile: !1, btnSoundIfMobile: !1, btnPrintIfMobile: !1, sideNavigationButtons: !0, hideMenu: !1, twitter: { enabled: !0, url: null, description: null }, facebook: { enabled: !0, load_sdk: !0, url: null, app_id: null, title: null, caption: null, description: null, image: null }, pinterest: { enabled: !0, url: null, image: null, description: null }, email: { enabled: !0, title: null, description: null, url: null }, pdf: { annotationLayer: !1 }, pageTextureSize: 2048, pageTextureSizeSmall: 1500, pageTextureSizeMobile: null, pageTextureSizeMobileSmall: 1024, viewMode: "webgl", singlePageMode: !1, singlePageModeIfMobile: !1, zoomMin: .95, zoomMax2: null, zoomSize: null, zoomStep: 2, zoomTime: 300, zoomReset: !1, zoomResetTime: 300, wheelDisabledNotFullscreen: !1, arrowsDisabledNotFullscreen: !1, arrowsAlwaysEnabledForNavigation: !1, touchSwipeEnabled: !0, responsiveView: !0, responsiveViewTreshold: 768, minPixelRatio: 1, pageFlipDuration: 1, contentOnStart: !1, thumbnailsOnStart: !1, searchOnStart: !1, sideMenuOverBook: !0, sideMenuOverMenu: !1, sideMenuOverMenu2: !0, sideMenuPosition: "left", lightBox: !1, lightBoxOpened: !1, lightBoxFullscreen: !1, lightboxCloseOnClick: !1, lightboxResetOnOpen: !0, lightboxBackground: null, lightboxBackgroundColor: null, lightboxBackgroundPattern: null, lightboxBackgroundImage: null, lightboxStartPage: null, lightboxMarginV: "0", lightboxMarginH: "0", lightboxCSS: "", lightboxPreload: !1, lightboxShowMenu: !1, lightboxCloseOnBack: !0, disableImageResize: !0, pan: 0, panMax: 10, panMax2: 2, panMin: -10, panMin2: -2, tilt: 0, tiltMax: 0, tiltMax2: 0, tiltMin: -20, tiltMin2: -5, rotateCameraOnMouseMove: !1, rotateCameraOnMouseDrag: !0, lights: !0, lightColor: 16777215, lightPositionX: 0, lightPositionZ: 1400, lightPositionY: 350, lightIntensity: .6, shadows: !0, shadowMapSize: 1024, shadowOpacity: .2, shadowDistance: 15, pageRoughness: 1, pageMetalness: 0, pageHardness: 2, coverHardness: 2, pageSegmentsW: 5, pageSegmentsH: 1, pageMiddleShadowSize: 2, pageMiddleShadowColorL: "#999999", pageMiddleShadowColorR: "#777777", antialias: !1, preloaderText: "", fillPreloader: { enabled: !1, imgEmpty: "images/logo_light.png", imgFull: "images/logo_dark.png" }, logoImg: "", logoUrl: "", logoCSS: "position:absolute;", logoHideOnMobile: !1, printMenu: !0, downloadMenu: !0, cover: !0, backCover: !0, textLayer: !0, googleAnalyticsTrackingCode: null, minimumAndroidVersion: 6, linkColor: "rgba(255, 255, 0, .05)", linkColorHover: "rgba(255, 255, 0, .2)", rightClickEnabled: !0, strings: { print: "Print", printLeftPage: "Print left page", printRightPage: "Print right page", printCurrentPage: "Print current page", printAllPages: "Print all pages", download: "Download", downloadLeftPage: "Download left page", downloadRightPage: "Download right page", downloadCurrentPage: "Download current page", downloadAllPages: "Download all pages", bookmarks: "Bookmarks", bookmarkLeftPage: "Bookmark left page", bookmarkRightPage: "Bookmark right page", bookmarkCurrentPage: "Bookmark current page", search: "Search", findInDocument: "Find in document", pagesFoundContaining: "pages found containing", thumbnails: "Thumbnails", tableOfContent: "Table of Contents", share: "Share", pressEscToClose: "Press ESC to close", password: "Password" }, mobile: { shadows: !1 } }, FLIPBOOK.Main = function (e, t) { var n = this; this.elem = t, this.$elem = y(t), this.$body = y("body"), this.body = this.$body[0], this.$window = y(M), this.bodyHasVerticalScrollbar = function () { return n.body.scrollHeight > M.innerHeight }, this.isZoomed = function () { return 1 < n.zoom }, this.options = {}; var o, i, s, a = L.createElement("div").style, r = function () { for (var e = "t,webkitT,MozT,msT,OT".split(","), t = 0, o = e.length; t < o; t++)if (e[t] + "ransform" in a) return e[t].substr(0, e[t].length - 1); return !1 }(), l = /android/gi.test(navigator.appVersion), d = (/iphone|ipad/gi.test(navigator.appVersion), o = "perspective", ("" === r ? o : (o = o.charAt(0).toUpperCase() + o.substr(1), r + o)) in a); this.msie = M.navigator.userAgent.indexOf("MSIE "), this.isAndroid = l, this.has3d = d, void 0 === FLIPBOOK.hasWebGl && function (e) { if (M.WebGLRenderingContext) { for (var t = L.createElement("canvas"), o = ["webgl", "experimental-webgl", "moz-webgl", "webkit-3d"], i = !1, n = 0; n < 4; n++)try { if ((i = t.getContext(o[n])) && "function" == typeof i.getParameter) return e || (FLIPBOOK.hasWebGl = !0) } catch (e) { } FLIPBOOK.hasWebGl = !1 } else FLIPBOOK.hasWebGl = !1 }(), this.hasWebGl = FLIPBOOK.hasWebGl, 0 < (s = -1, "Microsoft Internet Explorer" == navigator.appName ? (i = navigator.userAgent, null != new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(i) && (s = parseFloat(RegExp.$1))) : "Netscape" == navigator.appName && (i = navigator.userAgent, null != new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(i) && (s = parseFloat(RegExp.$1))), s) && (this.hasWebGl = !1, this.options.isIE = !0), this.thumbsShowing = !1, this.bookmarkShowing = !1, this.searchingString = !1, this.tocShowing = !1, this.menuShowing = !0; var h = { 2: { currentPage: { vAlign: "bottom", hAlign: "center" }, btnAutoplay: { hAlign: "left" }, btnSound: { hAlign: "left" }, btnExpand: { hAlign: "right" }, btnZoomIn: { hAlign: "right" }, btnZoomOut: { hAlign: "right" }, btnSearch: { hAlign: "left" }, btnBookmark: { hAlign: "left" }, btnToc: { hAlign: "left" }, btnThumbs: { hAlign: "left" }, btnShare: { hAlign: "right" }, btnPrint: { hAlign: "right" }, btnDownloadPages: { hAlign: "right" }, btnDownloadPdf: { hAlign: "right" }, btnSelect: { hAlign: "right" } }, 3: { menuTransparent: !(this.fullscreenActive = !1), menu2Transparent: !1, menu2OverBook: !1, menu2Padding: 5, btnMargin: 5, currentPage: { vAlign: "top", hAlign: "center" }, btnPrint: { vAlign: "top", hAlign: "right" }, btnDownloadPdf: { vAlign: "top", hAlign: "right" }, btnDownloadPages: { vAlign: "top", hAlign: "right" }, btnThumbs: { vAlign: "top", hAlign: "left" }, btnToc: { vAlign: "top", hAlign: "left" }, btnBookmark: { vAlign: "top", hAlign: "left" }, btnSearch: { vAlign: "top", hAlign: "left" }, btnSelect: { vAlign: "top", hAlign: "right" }, btnShare: { vAlign: "top", hAlign: "right" }, btnAutoplay: { hAlign: "right" }, btnExpand: { hAlign: "right" }, btnZoomIn: { hAlign: "right" }, btnZoomOut: { hAlign: "right" }, btnSound: { hAlign: "right" }, menuPadding: 5 }, 4: { menu2Transparent: !1, menu2OverBook: !1, sideMenuOverMenu2: !1, currentPage: { vAlign: "top", hAlign: "center" }, btnAutoplay: { vAlign: "top", hAlign: "left" }, btnSound: { vAlign: "top", hAlign: "left" }, btnExpand: { vAlign: "top", hAlign: "right" }, btnZoomIn: { vAlign: "top", hAlign: "right" }, btnZoomOut: { vAlign: "top", hAlign: "right" }, btnSearch: { vAlign: "top", hAlign: "left" }, btnBookmark: { vAlign: "top", hAlign: "left" }, btnToc: { vAlign: "top", hAlign: "left" }, btnThumbs: { vAlign: "top", hAlign: "left" }, btnShare: { vAlign: "top", hAlign: "right" }, btnPrint: { vAlign: "top", hAlign: "right" }, btnDownloadPages: { vAlign: "top", hAlign: "right" }, btnDownloadPdf: { vAlign: "top", hAlign: "right" }, btnSelect: { vAlign: "top", hAlign: "right" } } }, p = { dark: { skinColor: "#EEE", btnColorHover: "#FFF", skinBackground: "#313538" }, light: { skinColor: "#222", btnColorHover: "#000", skinBackground: "#FFF", floatingBtnColor: "#FFF", floatingBtnBackground: "#00000055" }, gradient: { skinColor: "#EEE", btnColor: "#EEE", btnColorHover: "#FFF", skinBackground: "#313538DD", zoomMin: .85, menuOverBook: !0, menu2OverBook: !0, sideMenuOverMenu: !0, sideMenuOverMenu2: !0, menuBackground: "linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, transparent 100%)", menu2Background: "linear-gradient(to bottom, rgba(0, 0, 0, 0.65) 0%, transparent 100%)" } }; for (var c in p) e.skin == c && (e = y.extend(!0, {}, p[c], e)); for (var c in h) String(e.layout) === c && (e = y.extend(!0, {}, h[c], e)); this.options = y.extend(!0, {}, y.fn.flipBook.options, e); var u, g, f, b, m, k, v, w, P, S = this.options; if (S.isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent), S.isMobile) for (var c in S.mobile) S[c] = S.mobile[c]; function B() { S.pdfBrowserViewerFullscreen ? M.open(S.pdfUrl, S.pdfBrowserViewerFullscreenTarget) : y('').width("100%").height("100%").attr("data", S.pdfUrl).appendTo(n.$elem) } function x() { var e, t, o; n.disposed || (e = M.location.hash, (o = t = n.getPageFromHash()) < 1 ? t = 1 : n.numPages && t > n.numPages && (t = n.numPages), t && (t = S.rightToLeft && S.pages && S.pages.length ? S.pages.length - t + 1 : t, n.started ? n.Book && (n.lightbox && !FLIPBOOK.lightboxOpened && (n.lightbox.openLightbox(), n.lightboxStart()), n.goToPage(t, -1 == e.indexOf("flip"))) : (S.startPage = o, S.lightBox && (O(), S.lightBoxFullscreen && setTimeout(function () { n.toggleExpand() }, 100))))) } function O() { var t; S.fillPreloader.enabled ? (n.$fillPreloader = y("
").addClass("flipbook-fillPreloader"), (t = new Image).src = S.fillPreloader.imgEmpty, t.onload = function () { var e = new Image; e.src = S.fillPreloader.imgFull, e.onload = function () { y(t).appendTo(n.$fillPreloader), n.$fillPreloaderImg = y(e).appendTo(n.$fillPreloader), n.$fillPreloader.appendTo(n.wrapper), T() } }) : T() } function T() { n.initialized || (n.id = Date.now(), n.addPageItems(), S.pdfMode ? n.initPdf() : n.initJpg(), n.setLoadingProgress(.1), n.lightbox && n.options.lightboxShowMenu && n.createMenu(), n.initialized = !0) } this.strings = S.strings, S.pageShininess = S.pageShininess / 2, this.s = 0, S.googleAnalyticsTrackingCode && (this.gaCode = S.googleAnalyticsTrackingCode, M.ga || (g = L, f = "script", b = "ga", (u = M).GoogleAnalyticsObject = b, u.ga = u.ga || function () { (u.ga.q = u.ga.q || []).push(arguments) }, u.ga.l = +new Date, m = g.createElement(f), k = g.getElementsByTagName(f)[0], m.async = 1, m.src = "https://www.google-analytics.com/analytics.js", k.parentNode.insertBefore(m, k)), ga("create", this.gaCode, "auto")), S.isMobile && (S.singlePageMode = !!S.singlePageModeIfMobile || S.singlePageMode, S.viewModeMobile && (S.viewMode = S.viewModeMobile), S.pageTextureSizeMobile && (S.pageTextureSize = S.pageTextureSizeMobile), S.pageTextureSizeMobileSmall && (S.pageTextureSizeSmall = S.pageTextureSizeMobileSmall), S.touchSwipeEnabled = !0), "3dSinglePage" == S.viewMode && (S.singlePageMode = !0), "2dSinglePage" == S.viewMode && (S.singlePageMode = !0, S.viewMode = "2d"), S.singlePageMode && ("2d" != S.viewMode && "swipe" != S.viewMode && (S.viewMode = "3d"), S.rightToLeft && (S.viewMode = "swipe")), S.singlePageMode && "3d" == S.viewMode && (S.rightToLeft = !1), "simple" == S.viewMode && (S.viewMode = "3d", S.instantFlip = !0), S.sideMenuPosition = S.rightToLeft ? "right" : "left", "webgl" == S.viewMode && (!this.hasWebGl || parseFloat(!!(w = (v = (v || navigator.userAgent).toLowerCase()).match(/android\s([0-9\.]*)/)) && w[1]) < S.minimumAndroidVersion && this.isAndroid) && (S.viewMode = "3d"), "3d" != S.viewMode || n.has3d || (S.viewMode = "2d"), this.webgl = "webgl" == S.viewMode, S.menuFloating && (S.menuOverBook = !0, S.sideMenuOverMenu = !0), S.menu2Floating && (S.menu2OverBook = !0, S.sideMenuOverMenu2 = !0), S.menuTransparent && (S.menuOverBook = !0, S.sideMenuOverMenu = !0, S.menuBackground = "none"), S.menu2Transparent ? (S.menu2OverBook = !0, S.sideMenuOverMenu2 = !0, S.menu2Background = "none") : S.sideMenuOverMenu2 = !1, S.menuOverBook && (S.sideMenuOverMenu = !0), S.menu2OverBook && (S.sideMenuOverMenu2 = !0), S.isMobile && S.pdfBrowserViewerIfMobile && S.pdfUrl || S.isIE && S.pdfBrowserViewerIfIE && S.pdfUrl ? S.lightBox && !S.lightBoxOpened ? this.$elem.on("touched click", function () { B() }).css("cursor", "pointer") : B() : (S.pdfMode = Boolean(S.pdfUrl && "" != S.pdfUrl), S.backgroundTransparent && (S.backgroundColor = "none"), this.wrapper = y(L.createElement("div")).addClass("flipbook-main-wrapper"), "" != S.backgroundColor && this.wrapper.css("background", S.backgroundColor), "" != S.backgroundPattern && this.wrapper.css("background", "url(" + S.backgroundPattern + ") repeat"), "" != S.backgroundImage && (this.wrapper.css("background", "url(" + S.backgroundImage + ") no-repeat"), this.wrapper.css("background-size", "cover"), this.wrapper.css("background-position", "center center")), this.bookLayer = y(L.createElement("div")).addClass("flipbook-bookLayer").appendTo(n.wrapper), S.rightClickEnabled || this.bookLayer.bind("contextmenu", function (e) { return !1 }), S.hideMenu && (this.bookLayer.css("bottom", "0"), S.menuOverBook = !0), S.pagesOriginal = JSON.parse(JSON.stringify(S.pages)), this.book = y(L.createElement("div")).addClass("book").appendTo(n.bookLayer), S.preloader ? this.preloader = S.preloader : !y(".flipbook-preloader").length && S.lightBox ? this.preloader = y('
') : S.lightBox ? this.preloader = y(".flipbook-preloader") : this.preloader = y('
'), y(".flipbook-loading-text").text(S.preloaderText), this.setLoadingProgress(0), !S.deeplinkingPrefix && S.deeplinking && S.deeplinking.prefix && (S.deeplinkingPrefix = S.deeplinking.prefix), S.deeplinkingEnabled = S.deeplinkingPrefix || S.deeplinkingEnabled || S.deeplinking && S.deeplinking.enabled, S.deeplinkingEnabled && (x(), y(M).bind("hashchange", function (e) { x() })), this.dispose = function () { this.disposed = !0 }, S.main = this, (P = { _events: {}, on: function (e, t) { this._events[e] || (this._events[e] = []), this._events[e].push(t) }, off: function (e, t) { var o; !this._events[e] || -1 < (o = this._events[e].indexOf(t)) && this._events[e].splice(o, 1) }, trigger: function (e) { if (this._events[e]) { var t = 0, o = this._events[e].length; if (o) for (; t < o; t++)this._events[e][t].apply(this, [].slice.call(arguments, 1)) } } }).on("pageLoaded", function (e) { S.pages[e.index] = S.pages[e.index] || {}, S.pages[e.index].canvas = S.pages[e.index].canvas || {}, S.pages[e.index].canvas[e.size] = e.canvas, n.searchingString && n.mark(n.searchingString, !0) }), P.on("pageUnloaded", function (e) { e.unloadedPages.forEach(function (e) { n.Book.onPageUnloaded && n.Book.onPageUnloaded(e.index, e.size) }) }), P.on("pdfinit", function () { S.tableOfContent = n.pdfService.outline || S.tableOfContent, S.doublePage = n.pdfService.double, S.doublePage || (S.backCover = n.pdfService.numPages % 2 == 0), n.viewportOriginal = n.pdfService.viewports[0], S.firstPage = { width: n.pdfService.viewports[0].width, height: n.pdfService.viewports[0].height, ratio: n.pdfService.viewports[0].width / n.pdfService.viewports[0].height }, 1 < n.pdfService.numPages && (S.secondPage = { width: n.pdfService.viewports[1].width, height: n.pdfService.viewports[1].height, ratio: n.pdfService.viewports[1].width / n.pdfService.viewports[1].height }), S.numPages = n.pdfService.numPages, 1 == S.numPages && (S.viewMode = "swipe", S.singlePageMode = !0, S.btnNext.enabled = !1, S.btnPrev.enabled = !1, S.btnFirst.enabled = !1, S.btnLast.enabled = !1, S.sideNavigationButtons = !1, S.btnAutoplay.enabled = !1, S.printMenu = !1, S.downloadMenu = !1, n.webgl = !1); for (var e = [], t = 0; t < S.numPages; t++) { var o = { canvas: {} }; S.pages && S.pages[t] ? y.extend(o, S.pages[t]) : o.title = t + 1, e[t] = o } S.pages = e; n.book.height(); var i = S.pageTextureSize; S.pageWidth = parseInt(i * n.viewportOriginal.width / n.viewportOriginal.height), S.pageHeight = i, S.pw = S.pageWidth, S.ph = S.pageHeight, S.zoomSize = S.zoomSize || S.pageTextureSize, n.start() }), P.on("toolSelect", function () { n.bookLayer.removeClass("flipbook-move"), n.btnSelect && n.btnSelect.addClass("flipbook-btn-active"), n.bookLayer.removeClass("flipbook-disable-text-selection") }), P.on("toolMove", function () { n.bookLayer.addClass("flipbook-move"), n.btnSelect && n.btnSelect.removeClass("flipbook-btn-active"), n.bookLayer.addClass("flipbook-disable-text-selection") }), this.model = P, S.lightBox ? (S.btnClose.enabled = !0, this.lightbox = new FLIPBOOK.Lightbox(this, this.wrapper, S), this.lightboxStartedTimes = 0, this.wrapper.css("background", "none"), this.bookLayer.css("background", "none"), this.book.css("background", "none"), this.preloader.appendTo(this.$body).css("position", "fixed"), this.$elem.css("cursor", "pointer").bind("tap click", function (e) { n.lightboxStartPage = y(this).attr("data-page"), n.started ? (n.lightboxStart(), S.lightBoxFullscreen && setTimeout(function () { n.toggleExpand() }, 0)) : (O(), S.lightBoxFullscreen && setTimeout(function () { n.toggleExpand() }, 100)) }), S.lightBoxOpened ? (O(), y(M).trigger("r3d-lightboxloadingstarted")) : S.lightboxPreload && ("undefined" != typeof IScroll || FLIPBOOK.scriptsAdded[FLIPBOOK.iscrollSrc] || n.loadScript(FLIPBOOK.iscrollSrc, function () { }), void 0 !== FLIPBOOK.PdfService || FLIPBOOK.scriptsAdded[FLIPBOOK.pdfServiceSrc] || n.loadScript(FLIPBOOK.pdfServiceSrc, function () { }), S.pdfMode && ("undefined" != typeof pdfjsLib || FLIPBOOK.scriptsAdded[FLIPBOOK.pdfjsSrc] || n.loadScript(FLIPBOOK.pdfjsSrc, function () { }), void 0 !== FLIPBOOK.PdfService || FLIPBOOK.scriptsAdded[FLIPBOOK.pdfServiceSrc] || n.loadScript(FLIPBOOK.pdfServiceSrc, function () { }), S.btnSearch.enabled && (FLIPBOOK.scriptsAdded[FLIPBOOK.markSrc] || n.loadScript(FLIPBOOK.markSrc, function () { }))), "webgl" == S.viewMode && ("undefined" != typeof THREE || FLIPBOOK.scriptsAdded[FLIPBOOK.threejsSrc] || n.loadScript(FLIPBOOK.threejsSrc, function () { }))), this.fullscreenElement = L.documentElement) : (S.btnClose.enabled = !1, this.preloader.appendTo(this.wrapper), this.wrapper.appendTo(this.$elem), this.fullscreenElement = this.$elem[0], O())) }, FLIPBOOK.Main.prototype = { start: function () { this.options.dp && (this.options.doublePage = !0), this.started || (this.model.pageW = this.options.pageWidth, this.model.bookW = 2 * this.options.pageWidth, this.options.singlePageMode && (this.model.bookW /= 2), this.model.pageH = this.options.pageHeight, this.model.bookH = this.options.pageHeight, this.options.numPages % 2 == 0 ? this.options.numSheets = (this.options.numPages + 2) / 2 : this.options.numSheets = (this.options.numPages + 1) / 2, this.started = !0, this.options.lightBox && (this.lightbox.openLightbox(), this.lightboxStart()), this.createBook(), this.updateSkinColors()) }, updateSkinColors: function () { var e = this.options; e.skinColor && this.wrapper.find(".skin-color").css("color", e.skinColor), e.skinBackground && this.wrapper.find(".skin-color-bg").css("background", e.skinBackground) }, lightboxStart: function () { var e = this; this.started || this.start(), void 0 !== this.Book ? (this.Book.enable(), this.lightboxStartPage ? this.goToPage(this.lightboxStartPage, !0) : this.options.lightboxStartPage && this.goToPage(this.options.lightboxStartPage, !0), this.lightboxStartedTimes++, this.gaCode && ga("send", { hitType: "event", eventCategory: "Flipbook : " + this.options.name, eventAction: "lightbox open", eventLabel: "lightbox open", eventValue: this.lightboxStartedTimes, nonInteraction: !0 }), this.updateCurrentPage(), this.initColors(), this.resize()) : setTimeout(function () { e.lightboxStart() }, 100) }, setHash: function (e) { e < 1 && (e = 1), "#" + this.options.deeplinkingPrefix + e != M.location.hash && this.options.deeplinkingEnabled && this.Book.enabled && this.hash != e && (M.location.hash = "#" + this.options.deeplinkingPrefix + String(e), this.hash = e) }, clearHash: function () { var e, t, o = M.location; "pushState" in history ? history.pushState("", L.title, o.pathname + o.search) : (e = L.body.scrollTop, t = L.body.scrollLeft, o.hash = "", L.body.scrollTop = e, L.body.scrollLeft = t) }, getPageFromHash: function () { var e, t = M.location.hash, o = "#" + this.options.deeplinkingPrefix; return -1 !== t.indexOf(o) && (e = parseInt(M.location.hash.replace(/#/g, "").replace(this.options.deeplinkingPrefix, ""))), e }, initColors: function () { this.wrapper.find(".skin-color-bg").removeClass("flipbook-bg-light").removeClass("flipbook-bg-dark").addClass("flipbook-bg-" + this.options.skin), this.wrapper.find(".skin-color").removeClass("flipbook-color-light").removeClass("flipbook-color-dark").addClass("flipbook-color-" + this.options.skin), this.updateSkinColors() }, lightboxEnd: function () { "undefined" != typeof screenfull && screenfull.isFullscreen && screenfull.exit(), M.location.hash && this.clearHash(), this.setLoadingProgress(1), this.Book && this.Book.disable() }, turnPageComplete: function () { this.animating = !1, this.updateCurrentPage(); var e = this.Book.rightIndex || 0; this.options.rightToLeft && (e = this.options.pages.length - e), this.pdfService && this.pdfService.setRightIndex(e), this.options.zoomReset && this.Book.zoomTo(this.options.zoomMin) }, updateCurrentPage: function () { var e, t = this.options.rightToLeft, o = this.options.numPages, i = this.Book.rightIndex || 0; i % 2 == 1 && i++, t && (i = this.options.pages.length - i), this.options.singlePageMode || this.Book.singlePage || 1 == this.Book.view ? (e = this.Book.getCurrentPageNumber ? this.Book.getCurrentPageNumber() : (t && i--, i + 1), this.setHash(e), this.cPage = [e - 1]) : (o < i || i == o && o % 2 == 0 ? (e = o, this.cPage = [o - 1]) : i < 1 ? (e = 1, this.cPage = [0]) : (e = String(i) + "-" + String(i + 1), this.cPage = [i - 1, i]), this.setHash(i)), t ? (this.enableNext(0 < i), this.enablePrev(this.Book.canFlipPrev() || i < o - 1)) : (this.enablePrev(0 < i), this.enableNext(this.Book.canFlipNext() || i < o - 1)), 2 == this.cPage.length ? (this.wrapper.find(".c-l-p").show(), this.wrapper.find(".c-r-p").show(), this.wrapper.find(".c-p").hide()) : (this.wrapper.find(".c-l-p").hide(), this.wrapper.find(".c-r-p").hide(), this.wrapper.find(".c-p").show()), void 0 !== this.currentPage && (this.s && 0 < this.options.pdfPageScale && this.goToPage(0), e != this.currentPageValue && (this.currentPageValue = String(e), this.currentPage.text(e + " / " + String(o)), this.currentPageInput.width(this.currentPageHolder.width()), this.resize(), y(this).trigger({ type: "pagechange", page: this.currentPageValue, name: this.options.name }), y(M).trigger({ type: "r3d-pagechange", page: this.currentPageValue, name: this.options.name }), this.gaCode && ga("send", { hitType: "event", eventCategory: "Flipbook : " + this.options.name, eventAction: "page " + this.currentPageValue, eventLabel: "page" + this.currentPageValue, nonInteraction: !0 }))) }, initJpg: function () { var s = this; 1 == this.options.numPages && (this.options.viewMode = "swipe", this.options.singlePageMode = !0, this.webgl = !1), this.loadPage(0, this.options.pageTextureSize, function () { s.setLoadingProgress(.5); var e, n = s.options; 1 == n.pages.length ? (e = n.pages[0].img, n.pw = e.width, n.ph = e.height, n.pageWidth = e.width, n.pageHeight = e.height, n.pageMode = "singlePage", n.doublePage = !1, n.zoomSize = n.zoomSize || e.height, s.setLoadingProgress(.7), n.btnNext.enabled = !1, n.btnPrev.enabled = !1, n.btnFirst.enabled = !1, n.btnLast.enabled = !1, n.sideNavigationButtons = !1, n.btnAutoplay.enabled = !1, s.start()) : s.loadPage(1, n.pageTextureSize, function () { var e = n.pages[0].img, t = n.pages[1].img, o = e.width / e.height, i = t.width / t.height; n.pw = e.width, n.ph = e.height, n.pageWidth = e.width, n.pageHeight = e.height, n.doublePage = 1.5 < i / o, n.doublePage || (n.backCover = n.pages.length % 2 == 0), n.zoomSize = n.zoomSize || e.height, s.setLoadingProgress(.7), s.start() }) }) }, initPdf: function () { if (!this.started) { ("swipe" == this.options.viewMode || this.options.btnSearch && this.options.btnSearch.enabled) && (this.options.textLayer = !0), this.options.textLayer = !0; var t = this; if ("undefined" == typeof pdfjsLib) { if (!FLIPBOOK.scriptsAdded[FLIPBOOK.pdfjsSrc]) return void t.loadScript(FLIPBOOK.pdfjsSrc, function () { t.initPdf() }); if (!FLIPBOOK.scriptsLoaded[FLIPBOOK.pdfjsSrc]) return void setTimeout(function () { t.initPdf() }, 100) } if (this.setLoadingProgress(.2), void 0 === FLIPBOOK.PdfService) { if (!FLIPBOOK.scriptsAdded[FLIPBOOK.pdfServiceSrc]) return void t.loadScript(FLIPBOOK.pdfServiceSrc, function () { t.initPdf() }); if (!FLIPBOOK.scriptsLoaded[FLIPBOOK.pdfServiceSrc]) return void setTimeout(function () { t.initPdf() }, 100) } this.setLoadingProgress(.3), M.CanvasPixelArray && (CanvasPixelArray.prototype.set = function (e) { for (var t = this.length, o = 0; o < t; o++)this[o] = e[o] }), PDFJS = pdfjsLib, pdfjsLib.externalLinkTarget = pdfjsLib.LinkTarget.BLANK, pdfjsLib.GlobalWorkerOptions.workerSrc = this.options.pdfjsworkerSrc || FLIPBOOK.pdfjsworkerSrc, "https:" == location.protocol ? t.options.pdfUrl = t.options.pdfUrl.replace("http://", "https://") : "http:" == location.protocol && (t.options.pdfUrl = t.options.pdfUrl.replace("https://", "http://")); var e = { cMapPacked: !0, cMapUrl: "cmaps/", disableAutoFetch: !0, disableStream: !0, url: t.options.pdfUrl, rangeChunkSize: 1024 * Number(t.options.rangeChunkSize) }; if (this.options.password) { var o = prompt("Please enter PDF password", ""); if (null == o) return this.lightbox && this.lightbox.closeLightbox(!0), this.setLoadingProgress(1), void (this.pdfinitStarted = !1); e.password = o } this.pdfinitStarted || (this.pdfinitStarted = !0, pdfjsLib.getDocument(e).promise.then(function (e) { t.pdfDocument = e, t.pdfService = new FLIPBOOK.PdfService(e, t.model, t.options), t.options.thumbLoaded = function (e) { t.options.thumbs = t.options.thumbs || [], t.options.thumbs[e.index] = e }, t.setLoadingProgress(.5), t.pdfService.init() }, function (e) { "PasswordException" == e.name ? (t.pdfinitStarted = !1, t.options.password = !0, t.initPdf()) : alert(e) })) } }, loadPageHTML: function (i, n) { var s = this, i = i, a = this.options; this.options.pdfMode ? this.pdfService.loadTextLayer(i, function (e) { n.call(s, s.options.pages[i].htmlContent, i) }) : a.pages[i].json ? this.loadPageJSON(i, function (e) { var t, o = a.pages[i] || {}; o.htmlContentInitialized || ((t = L.createElement("div")).classList.add("flipbook-page-htmlContent"), t.classList.add("page" + String(i)), t.innerHTML = decodeURIComponent(e.data), o.htmlContent && y(t).append(y(o.htmlContent)), o.htmlContent = t, y(o.htmlContent).find(".internalLink").each(function () { var t = s; this.onclick = function () { var e = Number(this.dataset.page), e = t.options.rightToLeft ? t.options.pages.length - e + 1 : e; return t.goToPage(e), !1 } }), o.htmlContentInitialized = !0), n.call(s, o.htmlContent, i) }) : n.call(this, a.pages[i].htmlContent, i) }, loadPageJSON: function (e, t) { var o = this.options.pages[e] || {}, i = this; if (!o.jsonLoading && !o.jsonLoaded) return o.jsonLoading = !0, void y.getJSON(o.json, function (e) { o.jsonLoaded = !0, o.jsonLoading = !1, t.call(i, e) }); o.jsonLoaded ? t.call(i) : setTimeout(function () { i.loadPageJSON(e, t) }, 100) }, loadPage: function (e, t, o) { var i, n = this, s = this.options.pages && this.options.pages[e] && this.options.pages[e].src; this.options.pdfMode && !s ? this.loadPageFromPdf(e, t, o) : (i = (n = this).options.pages[e]).img ? i.imgLoaded ? n.pageLoaded({ index: e, size: t, image: i.img }, o) : setTimeout(function () { n.loadPage(e, t, o) }, 300) : (i.img = L.createElement("img"), i.img.setAttribute("data-id", e), i.img.onload = function () { i.imgLoaded = !0, n.pageLoaded({ index: e, size: t, image: i.img }, o) }, "webgl" == this.options.viewMode && (i.img.crossOrigin = "Anonymous"), "https:" == location.protocol ? i.src = i.src.replace("http://", "https://") : "http:" == location.protocol && (i.src = i.src.replace("https://", "http://")), i.img.src = i.src) }, pageLoaded: function (e, t) { t.call(this, e, t), this.options.loadAllPages && e.index < this.options.numPages - 1 && this.loadPage(e.index + 1, e.size, function () { }), this.searchingString && this.mark(this.searchingString, !0) }, loadPageFromPdf: function (e, t, o) { t = t || this.options.pageTextureSize, this.options.pages[e] ? this.pdfService.renderBookPage(e, t, o) : o.call(this) }, getString: function (e) { return this.options.strings[e] }, mark: function (o, e) { o == this.markedStr && !e || (this.markedStr = o, this.options.pages.forEach(function (e) { var t = y(e.htmlContent).find(".flipbook-textLayer"); e.marked != o && t.length && (e.marked = o, t.unmark({ done: function () { t.mark(o, { acrossElements: !0, separateWordSearch: !1 }) } })) })) }, unmark: function () { this.searchingString = null, this.markedStr = null, this.options.pages.forEach(function (e) { e.marked && (e.marked = null, y(e.htmlContent).unmark()) }) }, setTool: function (e) { this.tool = e, this.model.trigger(e) }, toggleTool: function () { var e = "toolSelect" == this.tool ? "toolMove" : "toolSelect"; this.setTool(e) }, toggleSound: function () { var e = this.options; e.sound = !e.sound, this.toggleIcon(this.btnSound, e.sound) }, toggleIcon: function (e, t) { var o = e.icon, i = e.iconAlt; t ? (e.find("." + o).show(), e.find("." + i).hide()) : (e.find("." + o).hide(), e.find("." + i).show()) }, scrollPageIntoView: function (e) { var t = this.options.rightToLeft ? this.options.pages.length - e.pageNumber + 1 : e.pageNumber; this.goToPage(t) }, loadScript: function (o, i) { var n = this, s = L.createElement("script"), e = L.getElementsByTagName("script")[0]; s.async = 1, e.parentNode.insertBefore(s, e), FLIPBOOK.scriptsAdded[o] = !0, s.onload = s.onreadystatechange = function (e, t) { !t && s.readyState && !/loaded|complete/.test(s.readyState) || (s.onload = s.onreadystatechange = null, s = a, t || i && i.call(n), FLIPBOOK.scriptsLoaded[o] = !0) }, s.src = o }, createBook: function () { var e, n = this, t = this.model, o = this.options; if ("material" != o.icons || FLIPBOOK.MaterialIconsLoaded || (FLIPBOOK.MaterialIconsLoaded = !0, y("head").append('')), "undefined" == typeof IScroll) { if (!FLIPBOOK.scriptsAdded[FLIPBOOK.iscrollSrc]) return void n.loadScript(FLIPBOOK.iscrollSrc, n.createBook); if (!FLIPBOOK.scriptsLoaded[FLIPBOOK.iscrollSrc]) return void setTimeout(function () { n.createBook() }, 100) } if (this.options.searchOnStart && (this.options.btnSearch.enabled = !0), this.options.btnSearch.enabled) { if (!FLIPBOOK.scriptsAdded[FLIPBOOK.markSrc]) return void n.loadScript(FLIPBOOK.markSrc, n.createBook); if (!FLIPBOOK.scriptsLoaded[FLIPBOOK.markSrc]) return void setTimeout(function () { n.createBook() }, 100) } if (n.setLoadingProgress(.9), "webgl" == n.options.viewMode) { if ("undefined" == typeof THREE) { if (!FLIPBOOK.scriptsAdded[FLIPBOOK.threejsSrc]) return void n.loadScript(FLIPBOOK.threejsSrc, n.createBook); if (!FLIPBOOK.scriptsLoaded[FLIPBOOK.threejsSrc]) return void setTimeout(function () { n.createBook() }, 100) } if (void 0 === FLIPBOOK.BookWebGL) { if (!FLIPBOOK.scriptsAdded[FLIPBOOK.flipbookWebGlSrc]) return void n.loadScript(FLIPBOOK.flipbookWebGlSrc, n.createBook); if (!FLIPBOOK.scriptsLoaded[FLIPBOOK.flipbookWebGlSrc]) return void setTimeout(function () { n.createBook() }, 100) } } else if ("swipe" == n.options.viewMode) { if (void 0 === FLIPBOOK.BookSwipe) { if (!FLIPBOOK.scriptsAdded[FLIPBOOK.flipBookSwipeSrc]) return void n.loadScript(FLIPBOOK.flipBookSwipeSrc, n.createBook); if (!FLIPBOOK.scriptsLoaded[FLIPBOOK.flipBookSwipeSrc]) return void setTimeout(function () { n.createBook() }, 100) } } else if (void 0 === FLIPBOOK.Book3) { if (!FLIPBOOK.scriptsLoaded[FLIPBOOK.flipbookBook3Src]) return void n.loadScript(FLIPBOOK.flipbookBook3Src, n.createBook); if (!FLIPBOOK.scriptsAdded[FLIPBOOK.flipbookBook3Src]) return void setTimeout(function () { n.createBook() }, 100) } if (this.setLoadingProgress(1), this.initEasing(), n.options.doublePage && 2 < n.options.pages.length) { for (var i = [n.options.pages[0]], s = 1; s <= n.options.pages.length - 2; s++) { var a, r = { src: (a = n.options.pages[s]).src, thumb: a.thumb, title: a.title, htmlContent: a.htmlContent, json: a.json, side: "left" }, l = { src: a.src, thumb: a.thumb, title: a.title, htmlContent: a.htmlContent, json: a.json, side: "right" }; i.push(r), i.push(l) } n.options.backCover ? i.push(n.options.pages[n.options.pages.length - 1]) : (r = { src: (a = n.options.pages[n.options.pages.length - 1]).src, thumb: a.thumb, title: a.title, htmlContent: a.htmlContent, json: a.json, side: "left" }, l = { src: a.src, thumb: a.thumb, title: a.title, htmlContent: a.htmlContent, json: a.json, side: "right" }, i.push(r), i.push(l)), n.options.pages = i } if (this.options.numPages = this.options.pages.length, this.options.numPages % 2 == 0 || this.options.singlePageMode || (this.oddPages = !0, this.options.oddPages = !0, this.options.pages.push({ src: this.options.assets.preloader, empty: !0 })), 0 < n.options.pages.length) for (s = 0; s < n.options.pages.length; s++)void 0 !== n.options.pages[s].htmlContent && (n.options.hasHtmlContent = !0, n.options.pages[s].htmlContent = y(n.options.pages[s].htmlContent)); function d() { n.flipsound = y('')[0] } "webgl" == n.options.viewMode ? ((e = n.options).scroll = n.scroll, (e.parent = n).Book = new FLIPBOOK.BookWebGL(n.book[0], t, e), n.webglMode = !0, n.initSwipe(), d()) : "swipe" == n.options.viewMode ? (n.Book = new FLIPBOOK.BookSwipe(n.book[0], n.bookLayer[0], t, o), n.initSwipe()) : ("2d" != n.options.viewMode && (n.options.viewMode = "3d"), n.Book = new FLIPBOOK.Book3(n.book[0], t, o), n.initSwipe(), n.webglMode = !1, d()), this.resize(), n.Book.enable(), n.book.hide().fadeIn("slow"), this.tocCreated = !1, this.createMenu(), this.onZoom(this.options.zoom), 1 == this.options.pages.length && (this.rightToLeft = !1), FLIPBOOK.books = FLIPBOOK.books || {}, FLIPBOOK.books[n.id] = n.Book; var h = y(n.Book); h.bind("loadPagesFromPdf", function (e, t, o, i) { n.loadPagesFromPdf(t, o, i) }), h.bind("turnPageComplete", function (e) { n.turnPageComplete() }), h.bind("initEasing", function (e) { n.initEasing() }), h.bind("playFlipSound", function (e) { n.playFlipSound() }), h.bind("closeLightbox", function (e) { n.closeLightbox() }), h.bind("updateCurrentPage", function (e) { n.updateCurrentPage() }), this.createLogo(), this.onBookCreated() }, addPageItems: function () { var e = this.options.pages; this.id; for (var t in e) { var o = e[t]; if (o.htmlContent = o.htmlContent || "", o.items) for (var i in o.items) { var n, s = o.items[i]; switch (s.type) { case "iframe": a = '', o.htmlContent += a; break; case "image": a = '', o.htmlContent += a; break; case "link": a = y("").addClass("flipbook-page-item").width(s.width).height(s.height).css({ top: s.y + "px", left: s.x + "px", background: this.options.linkColor }).attr("onmouseover", 'this.style.background="' + this.options.linkColorHover + '"').attr("onmouseout", 'this.style.background="' + this.options.linkColor + '"'), s.url ? a.attr("href", s.url).attr("target", "_blank") : s.page && (n = "#" + this.options.deeplinkingPrefix + s.page, s.flip && (n += "flip"), a.attr("href", n)), o.htmlContent += a[0].outerHTML; break; case "video": var a = y("
"), this.navLeft.css("background", "#f00").css("left", "0").css("top", "200px").attr("aria-hidden", "true").addClass("skin-color fa fa-chevron-left fa-5x").css("margin-top", this.navLeft.height() + "px").bind("touchend click", function (e) { e.stopPropagation(), e.preventDefault(), t.prevPage() }), this.navRight = y("
").appendTo(this.bookLayer).css("position", "absolute").css("width", "200px").css("height", "200px").css("margin-top", "-100px").css("background", "#f00").css("right", "0").css("top", "200px").bind("touchend click", function (e) { e.stopPropagation(), e.preventDefault(), t.nextPage() }) }, playFlipSound: function () { var e = this; this.options.sound && this.Book.enabled && void 0 !== this.flipsound.play && (this.flipsound.currentTime = 0, setTimeout(function () { try { e.flipsound.play() } catch (e) { } }, 100)) }, onMouseWheel: function (e) { if ("wheelDeltaX" in e) wheelDeltaX = e.wheelDeltaX / 12, wheelDeltaY = e.wheelDeltaY / 12; else if ("wheelDelta" in e) wheelDeltaX = wheelDeltaY = e.wheelDelta / 12; else { if (!("detail" in e)) return; wheelDeltaX = wheelDeltaY = 3 * -e.detail } 0 < wheelDeltaX ? this.zoomIn(e) : this.zoomOut(e) }, zoomTo: function (e, t, o) { var i, n; this.zoom = e, void 0 === o ? (i = this.model.wrapperW / 2, n = this.model.wrapperH / 2) : (n = o.touches && o.touches[0] ? (i = o.touches[0].pageX, o.touches[0].pageY) : o.changedTouches && o.changedTouches[0] ? (i = o.changedTouches[0].pageX, o.changedTouches[0].pageY) : (i = o.pageX, o.pageY), i -= this.wrapper.offset().left, n -= this.wrapper.offset().top), this.zoom < this.options.zoomMin && (this.zoom = this.options.zoomMin), this.zoom > this.options.zoomMax && (this.zoom = this.options.zoomMax), this.options.zoomMax2 && this.zoom > this.options.zoomMax2 && (this.zoom = this.options.zoomMax2), this.model.zoom = this.zoom, this.Book.zoomTo(this.zoom, t, i, n), this.onZoom(this.zoom) }, zoomOut: function (e) { var t, o = this.zoom / this.options.zoomStep; o < 1 && 1 < this.zoom && (o = 1), o = o < this.options.zoomMin ? this.options.zoomMin : o, this.zoom != o && (this.zoom = o, t = this.options.zoomTime, this.zoomTo(this.zoom, t, e)) }, zoomIn: function (e) { var t, o = this.zoom * this.options.zoomStep; 1 < o && this.zoom < 1 && (o = 1), this.bookLayer.height() * o > this.options.zoomSize && (o = this.options.zoomSize / this.bookLayer.height()), this.zoom != o && (this.zoom = o, t = this.options.zoomTime, this.zoomTo(this.zoom, t, e)) }, nextPage: function () { this.Book && this.Book.nextPage() }, prevPage: function () { this.Book && this.Book.prevPage() }, firstPage: function () { this.goToPage(1) }, lastPage: function () { this.goToPage(this.options.pages.length) }, goToPage: function (e, t) { e < 1 ? e = 1 : e > this.options.numPages && !this.options.rightToLeft && (e = this.options.numPages), this.Book && this.Book.goToPage(e, t) }, moveBook: function (e) { this.Book && this.Book.move && this.Book.move(e) }, onZoom: function (e) { this.zoom = e, this.enableButton(this.btnZoomIn, e < this.options.zoomMax), this.enableButton(this.btnZoomOut, e > this.options.zoomMin), this.enableSwipe(e <= 1), this.model.zoom = e }, enableSwipe: function (e) { this.swipeEnabled = e }, createCurrentPage: function () { var o = this, i = this.options, e = "flipbook-currentPageHolder ", t = "top" == i.currentPage.vAlign ? "left" == i.currentPage.hAlign ? this.menuTL : "right" == i.currentPage.hAlign ? this.menuTR : this.menuTC : "left" == i.currentPage.hAlign ? this.menuBL : "right" == i.currentPage.hAlign ? this.menuBR : this.menuBC, n = "top" == i.currentPage.vAlign && i.menu2Transparent || "top" != i.currentPage.vAlign && i.menuTransparent, s = n ? i.floatingBtnBackground : "", a = n ? i.floatingBtnColor : i.btnColor, r = n ? i.floatingBtnTextShadow : "", l = n ? i.floatingBtnRadius : i.btnRadius, d = (n ? i.floatingBtnMargin : i.btnMargin, y("
").appendTo(t)); d.css("margin", i.currentPage.marginV + "px " + i.currentPage.marginH + "px"), n || (e += "skin-color "), d.addClass(e).css({ color: a, background: s, "text-shadow": r, "border-radius": l + "px" }), i.currentPage.order && d.css("order", i.currentPage.order), this.currentPageHolder = d, this.currentPage = y(L.createElement("div")).addClass("flipbook-currentPageNumber").appendTo(d); var h = y("
").appendTo(d).submit(function (e) { var t = (t = parseInt(o.currentPageInput.val())) > i.pages.length ? i.pages.length : t; return o.options.rightToLeft && (t = i.pages.length - t + 1), o.goToPage(t), o.currentPageInput.trigger("blur"), !1 }); this.currentPageInput = y('').addClass("flipbook-currentPageInput").css({ margin: i.currentPage.marginV + "px " + i.currentPage.marginH + "px", color: a }).appendTo(h).val("").focus(function () { o.currentPageInput.val(""), o.currentPage.addClass("flipbook-color-transparent") }).blur(function () { o.currentPageInput.val(""), o.currentPage.removeClass("flipbook-color-transparent") }), n || this.currentPageInput.addClass("skin-color") }, createMenuHeader: function (e, t, o) { var i = this, n = y("
").addClass("flipbook-menu-header skin-clor flipbook-font").appendTo(e), t = y("").text(t).addClass("flipbook-menu-title skin-color").appendTo(n), s = y("").appendTo(n).addClass("flipbook-btn-close").bind("touchend click", function (e) { e.stopPropagation(), e.preventDefault(), i.closeMenus() }); this.createIcon(this.options.btnClose, null, !0).appendTo(s) }, createToc: function () { var i = this, e = this.options.tableOfContent; if (e && e.length || !this.pdfService || this.pdfService.outlineLoaded) { if (this.tocHolder = y("
").addClass("flipbook-tocHolder flipbook-side-menu skin-color-bg").appendTo(this.wrapper).css(this.options.sideMenuPosition, "0").hide(), this.createMenuHeader(this.tocHolder, this.strings.tableOfContent, this.toggleToc), this.toc = y("
").addClass("flipbook-toc").appendTo(this.tocHolder), this.tocScroller = y("
").addClass("flipbook-toc-scroller").appendTo(this.toc), this.tocScroll = new FLIPBOOK.IScroll(i.toc[0], { bounce: !1, mouseWheel: !0, scrollbars: !0, interactiveScrollbars: !0 }), e && 0 < e.length) { this.options.pages; for (var t = 0; t < e.length; t++)this.createTocItem(e[t]) } else for (var o = this.options.pages, t = 0; t < o.length; t++) { var n, s = o[t].title; "" != s && void 0 !== s && (n = { title: s, page: String(t + 1) }, this.createTocItem(n)) } this.initColors(), this.tocScroll.refresh(), this.tocCreated = !0, this.toggleToc() } else i.pdfService.loadOutline(function (e) { i.options.tableOfContent = e; var t = new EventBus, o = { scrollPageIntoView: function (e) { var t = e.pageNumber, o = $annotations[processingAnnotationIndex]; o && (o.dataset.page = t, processingAnnotationIndex++, processAnotations()) } }; new PDFLinkService({ eventBus: t }).setViewer(o), i.createToc() }) }, createTocItem: function (i, e, t) { var n = this, e = e || this.tocScroller, o = this.options.rightToLeft, s = y(L.createElement("a")).attr("class", "flipbook-tocItem").addClass("skin-color").css("direction", o ? "rtl" : "ltr").appendTo(e).bind("touchend click", function (e) { var t; function o(e) { n.pdfService.pdfDocument.getPageIndex(e[0]).then(function (e) { var t = e + 1, t = n.options.rightToLeft ? n.options.pages.length - t + 1 : t; setTimeout(function () { n.goToPage(t) }, 200) }) } e.stopPropagation(), e.preventDefault(), n.tocScroll.moved || (n.options.tableOfContentCloseOnClick && n.toggleToc(!1), !i.page && i.dest ? "string" == typeof i.dest ? n.pdfService.pdfDocument.getDestination(i.dest).then(function (e) { o(e) }) : o(i.dest) : (t = Number(i.page), t = n.options.rightToLeft ? n.options.pages.length - t + 1 : t, setTimeout(function () { n.goToPage(t) }, 200))) }); t = t || 0, s.level = t, s.css("padding", "8px 0"), s.css("margin-" + (o ? "right" : "left"), "10px"), t ? (s.css("margin-top", "8px"), s.css("padding-bottom", "0")) : (s.css("margin-right", "15px"), s.css("padding-left", "10px")); var a = y(L.createElement("span")).appendTo(s).css("width", "20px").css("display", "inline-block").css("cursor", "auto").bind("touchend click", function (e) { e.stopPropagation(), e.preventDefault(); for (var t = 0; t < s.items.length; t++)s.items[t].toggle(); r.toggle(), l.toggle(), n.tocScroll.refresh() }), r = y("").attr("aria-hidden", "true").appendTo(a).addClass("fa fa-chevron-" + (o ? "left" : "right") + " skin-color").hide(), l = y("").attr("aria-hidden", "true").appendTo(a).addClass("fa fa-chevron-down skin-color").hide(); if (y(L.createElement("span")).appendTo(s).addClass("title").text(i.title).css("width", String(170 - 10 * s.level) + "px"), y(L.createElement("span")).appendTo(s).width("25px").css("display", "inline-block").css("text-align", "right").text(i.page), i.items && i.items.length) { s.items = []; for (var d = 0; d < i.items.length; d++) { var h = this.createTocItem(i.items[d], s, s.level + 1); s.items.push(h), h.hide() } r.show() } return s }, enablePrev: function (e) { this.enableButton(this.btnPrev, e), this.enableButton(this.btnFirst, e), this.Book.enablePrev(e) }, enableNext: function (e) { this.enableButton(this.btnNext, e), this.enableButton(this.btnLast, e), this.Book.enableNext(e) }, enableButton: function (e, t) { void 0 !== e && (t ? (e.css("opacity", "1"), e.css("pointer-events", "auto")) : (e.css("opacity", "0.2"), e.css("pointer-events", "none")), e.enabled = t) }, resize: function () { var e, t = this.model; t.wrapperW = this.bookLayer.width(), t.wrapperH = this.bookLayer.height(), this.Book && this.Book.enabled && (!(e = this.options).menuOverBook && this.menuShowing && this.menuBottom ? this.bookLayer.css("bottom", this.menuBottom.outerHeight() + "px") : this.bookLayer.css("bottom", "0px"), !e.menu2OverBook && this.menuShowing && this.menuTop ? this.bookLayer.css("top", this.menuTop.outerHeight() + "px") : this.bookLayer.css("top", "0px"), this.tocShowing || this.thumbsShowing || this.searchShowing || this.bookmarkShowing ? (e.sideMenuOverBook || this.bookLayer.css(this.options.sideMenuPosition, "250px"), this.options.sideMenuOverMenu || this.wrapper.find(".flipbook-side-menu").css("bottom", this.menuBottom.outerHeight() + "px"), this.options.sideMenuOverMenu2 || this.wrapper.find(".flipbook-side-menu").css("top", this.menuTop.outerHeight() + "px")) : this.bookLayer.css(this.options.sideMenuPosition, "0px"), e.zoomMax = e.zoomSize / t.wrapperH, t.zoom = e.zoomMin, this.Book.onResize(), this.options.zoomReset && this.Book.zoomTo(this.options.zoomMin)) }, pdfResize: function () { this.Book.onZoom() }, createThumbs: function () { this.thumbs = new FLIPBOOK.Thumbnails(this) }, toggleThumbs: function (e) { this.thumbs || this.createThumbs(), void 0 !== e && (this.thumbsShowing = !e), this.thumbsShowing ? (this.thumbs.hide(), this.thumbsShowing = !1) : (this.closeMenus(), this.thumbs.show(), this.thumbsShowing = !0), this.resize() }, toggleToc: function (e) { this.tocCreated ? (!this.tocShowing || e ? (this.closeMenus(), this.tocShowing = !0, this.tocHolder.show(), this.tocScroll.refresh()) : (this.tocHolder.hide(), this.tocShowing = !1), this.resize()) : this.createToc() }, toggleSearch: function (e) { this.thumbs || this.createThumbs(), void 0 !== e && (this.searchShowing = !e), this.searchShowing ? (this.thumbs.hide(), this.searchShowing = !1, this.unmark()) : (this.closeMenus(), this.thumbs.show(), this.thumbs.showSearch(), this.searchShowing = !0), this.resize() }, toggleBookmark: function (e) { this.thumbs || this.createThumbs(), void 0 !== e && (this.bookmarkShowing = !e), this.bookmarkShowing ? (this.thumbs.hide(), this.bookmarkShowing = !1) : (this.closeMenus(), this.thumbs.show(), this.thumbs.showBookmarks(), this.bookmarkShowing = !0), this.resize() }, closeMenus: function () { this.thumbsShowing && this.toggleThumbs(), this.tocShowing && this.toggleToc(), this.searchShowing && this.toggleSearch(), this.bookmarkShowing && this.toggleBookmark(), this.printMenuShowing && this.togglePrintMenu(), this.dlMenuShowing && this.toggleDownloadMenu(), this.shareMenuShowing && this.toggleShareMenu(), this.passwordMenuShowing && this.togglePasswordMenu() }, togglePrintMenu: function () { var e, t, o = this; this.printMenu ? this.printMenuShowing ? (this.printMenu.hide(), this.printMenuShowing = !1) : (this.closeMenus(), this.printMenu.show(), this.printMenuShowing = !0, this.updateCurrentPage()) : (this.printMenu = y('
').appendTo(this.wrapper), e = y('').appendTo(this.printMenu), t = y('').appendTo(e), this.createMenuHeader(t, this.strings.print, this.togglePrintMenu), y('
' + this.strings.printCurrentPage + "
").appendTo(t).bind("touchend click", function (e) { o.printPage(o.cPage[0], this) }), y('
' + this.strings.printLeftPage + "
").appendTo(this.printMenu).appendTo(t).bind("touchend click", function (e) { o.printPage(o.cPage[0], this) }), y('
' + this.strings.printRightPage + "
").appendTo(this.printMenu).appendTo(t).bind("touchend click", function (e) { o.printPage(o.cPage[1], this) }), y('
' + this.strings.printAllPages + "
").appendTo(t).bind("touchend click", function (e) { o.togglePrintWindow() }), this.closeMenus(), this.printMenuShowing = !0, this.initColors(), this.updateCurrentPage()) }, toggleDownloadMenu: function () { var e, t, i = this; this.dlMenu ? this.dlMenuShowing ? (this.dlMenu.hide(), this.dlMenuShowing = !1) : (this.dlMenu.show(), this.closeMenus(), this.dlMenuShowing = !0, this.updateCurrentPage()) : (this.dlMenu = y('
').appendTo(this.wrapper), e = y('').appendTo(this.dlMenu), t = y('').appendTo(e), this.createMenuHeader(t, this.strings.download, this.toggleDownloadMenu), y('
' + this.strings.downloadCurrentPage + "
").appendTo(t).bind("touchend click", function (e) { i.downloadPage(i.cPage[0], this) }), y('
' + this.strings.downloadLeftPage + "
").appendTo(t).bind("touchend click", function (e) { i.downloadPage(i.cPage[0], this) }), y('
' + this.strings.downloadRightPage + "
").appendTo(t).bind("touchend click", function (e) { i.downloadPage(i.cPage[1], this) }), y('
' + this.strings.downloadAllPages + "
").appendTo(t).bind("touchend click", function (e) { var t = L.createElement("a"); t.href = i.options.btnDownloadPages.url; var o = t.href.split("/").pop().split("#")[0].split("?")[0]; t.download = o, t.dispatchEvent(new MouseEvent("click")) }), this.closeMenus(), this.dlMenuShowing = !0, this.initColors(), this.updateCurrentPage()) }, toggleShareMenu: function () { var e, t, o, i; this.shareMenu ? this.shareMenuShowing ? (this.shareMenu.hide(), this.shareMenuShowing = !1) : (this.shareMenu.show(), this.closeMenus(), this.shareMenuShowing = !0) : (this.shareMenu = y('
').appendTo(this.wrapper), e = y('').appendTo(this.shareMenu), t = y('').appendTo(e), this.createMenuHeader(t, this.options.strings.share, this.toggleShareMenu), o = y('').appendTo(t), i = this.options, this.share = new Share(o[0], { networks: { twitter: i.twitter, facebook: i.facebook, pinterest: i.pinterest, email: i.email } }), this.closeMenus(), this.shareMenuShowing = !0, this.initColors()) }, bookmarkPage: function (e) { var t = this.getBookmarkedPages(); t.indexOf(String(e)) < 0 && t.push(e), this.setBookmarkedPages(t), this.thumbs.showBookmarkedThumbs(), this.bookmarkShowing || this.toggleBookmark() }, removeBookmark: function (e) { var t = this.getBookmarkedPages(); -1 < t.indexOf(String(e)) && t.splice(t.indexOf(String(e)), 1), this.setBookmarkedPages(t), this.thumbs.showBookmarkedThumbs(), this.bookmarkShowing || this.toggleBookmark() }, isBookmarked: function (e) { return 0 < this.getBookmarkedPages().indexOf(String(e)) }, getBookmarkedPages: function () { var e = localStorage.getItem(this.options.name + "_flipbook_bookmarks"); return e ? e.split(";") : [] }, setBookmarkedPages: function (e) { localStorage.setItem(this.options.name + "_flipbook_bookmarks", e.join(";")) }, printPage: function (e, t) { var o, i, n, s; this.options.pages[e] && this.options.pages[e].print ? o = this.options.pages[e].print : this.options.pages[e] && this.options.pages[e].canvas && this.options.pages[e].canvas[this.options.pageTextureSize] ? o = this.options.pages[e].canvas[this.options.pageTextureSize].toDataURL() : this.options.pages[e] && this.options.pages[e].src && (o = this.options.pages[e].src), o ? (i = "", i += "", i += "Print canvas", i += "", i += '', i += "", i += "", (n = M.open("", "Print", "height=1600,width=800")).document.open(), n.document.write(i), n.document.close(), n.document.addEventListener("load", function () { n.focus(), n.print(), n.document.close(), n.close() }, !0)) : (s = this).loadPage(e, this.options.pageTextureSize, function () { s.printPage(e) }) }, downloadPage: function (e) { var t, o, i, n, s; this.options.pages[e] && this.options.pages[e].download ? t = this.options.pages[e].download : this.options.pages[e] && this.options.pages[e].src ? t = this.options.pages[e].src : this.options.pages[e] && this.options.pages[e].canvas && this.options.pages[e].canvas[this.options.pageTextureSize] && (o = L.createElement("canvas"), i = this.options.pageWidth / this.options.pageHeight, o.width = this.options.pageTextureSize * i, o.height = this.options.pageTextureSize, o.getContext("2d").drawImage(this.options.pages[e].canvas[this.options.pageTextureSize], 0, 0), t = o.toDataURL("image/jpeg", .5)), t ? ((n = L.createElement("a")).href = t, n.download = "page" + String(e + 1), L.body.appendChild(n), n.click(), L.body.removeChild(n)) : (s = this).loadPage(e, this.options.pageTextureSize, function () { s.downloadPage(e) }) }, printPdf: function (e) { var t; this.options.isMobile ? M.open(e, "_blank", "directories=0,titlebar=0,toolbar=0,location=0,status=0,menubar=0").onload = function () { this.document.body.children[0].style.display = "none", this.print() } : (t = this._printIframe, this._printIframe || (t = this._printIframe = L.createElement("iframe"), L.body.appendChild(t), t.style.display = "none", t.onload = function () { setTimeout(function () { t.focus(), t.contentWindow.print() }, 1) }), t.src = e) }, togglePrintWindow: function (e) { var n = this; function t() { link = "about:blank"; var e = M.open(link, "_new"); e.document.open(); for (var t = "", o = 0; o < n.options.pages.length; o++)n.options.pages[o].src && (t += '\n'); var i = "\n\nTemporary Printing Window\n