"use strict";function configure(a){a.imageResourcesPath="./images/",a.workerSrc="../build/pdf.worker.js",a.cMapUrl="../web/cmaps/",a.cMapPacked=!0}function getFileName(a){var b=a.indexOf("#"),c=a.indexOf("?"),d=Math.min(b>0?b:a.length,c>0?c:a.length);return a.substring(a.lastIndexOf("/",d)+1,d)}function getOutputScale(a){var b=window.devicePixelRatio||1,c=a.webkitBackingStorePixelRatio||a.mozBackingStorePixelRatio||a.msBackingStorePixelRatio||a.oBackingStorePixelRatio||a.backingStorePixelRatio||1,d=b/c;return{sx:d,sy:d,scaled:1!==d}}function scrollIntoView(a,b,c){var d=a.offsetParent;if(!d)return void console.error("offsetParent is not set -- cannot scroll");for(var e=c||!1,f=a.offsetTop+a.clientTop,g=a.offsetLeft+a.clientLeft;d.clientHeight===d.scrollHeight||e&&"hidden"===getComputedStyle(d).overflow;)if(d.dataset._scaleY&&(f/=d.dataset._scaleY,g/=d.dataset._scaleX),f+=d.offsetTop,g+=d.offsetLeft,d=d.offsetParent,!d)return;b&&(void 0!==b.top&&(f+=b.top),void 0!==b.left&&(g+=b.left,d.scrollLeft=g)),d.scrollTop=f}function watchScroll(a,b){var c=function(f){e||(e=window.requestAnimationFrame(function(){e=null;var f=a.scrollTop,g=d.lastY;f!==g&&(d.down=f>g),d.lastY=f,b(d)}))},d={down:!0,lastY:a.scrollTop,_eventHandler:c},e=null;return a.addEventListener("scroll",c,!0),d}function parseQueryString(a){for(var b=a.split("&"),c={},d=0,e=b.length;d1?f[1]:null;c[decodeURIComponent(g)]=decodeURIComponent(h)}return c}function binarySearchFirstItem(a,b){var c=0,d=a.length-1;if(0===a.length||!b(a[d]))return a.length;if(b(a[c]))return c;for(;c>1,f=a[e];b(f)?d=e:c=e+1}return c}function approximateFraction(a){if(Math.floor(a)===a)return[a,1];var b=1/a,c=8;if(b>c)return[1,c];if(Math.floor(b)===b)return[1,b];for(var d=a>1?b:a,e=0,f=1,g=1,h=1;;){var i=e+g,j=f+h;if(j>c)break;d<=i/j?(g=i,h=j):(e=i,f=j)}return d-e/fd}for(var j,k,l,m,n,o,p,q,d=a.scrollTop,e=d+a.clientHeight,f=a.scrollLeft,g=f+a.clientWidth,i=[],r=0===b.length?0:binarySearchFirstItem(b,h),s=r,t=b.length;se));s++)p=k.offsetLeft+k.clientLeft,q=k.clientWidth,p+qg||(n=Math.max(0,d-l)+Math.max(0,l+m-e),o=100*(m-n)/m|0,i.push({id:j.id,x:p,y:l,view:j,percent:o}));var u=i[0],v=i[i.length-1];return c&&i.sort(function(a,b){var c=a.percent-b.percent;return Math.abs(c)>.001?-c:a.id-b.id}),{first:u,last:v,views:i}}function noContextMenuHandler(a){a.preventDefault()}function getPDFFileNameFromURL(a){var b=/^(?:([^:]+:)?\/\/[^\/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,c=/[^\/?#=]+\.pdf\b(?!.*\.pdf\b)/i,d=b.exec(a),e=c.exec(d[1])||c.exec(d[2])||c.exec(d[3]);if(e&&(e=e[0],e.indexOf("%")!==-1))try{e=c.exec(decodeURIComponent(e))[0]}catch(a){}return e||"document.pdf"}function DefaultTextLayerFactory(){}function DefaultAnnotationLayerFactory(){}function validateFileURL(a){try{var b=new URL(window.location.href).origin||"null";if(HOSTED_VIEWER_ORIGINS.indexOf(b)>=0)return;var c=new URL(a,window.location.href).origin;if(c!==b)throw new Error("file origin does not match viewer's")}catch(a){var d=a&&a.message,e=mozL10n.get("loading_error",null,"An error occurred while loading the PDF."),f={message:d};throw PDFViewerApplication.error(e,f),a}}function webViewerLoad(a){configure(PDFJS),PDFViewerApplication.initialize().then(webViewerInitialized)}function webViewerInitialized(){var a=document.location.search.substring(1),b=parseQueryString(a),c="file"in b?b.file:DEFAULT_URL;validateFileURL(c);var d=document.createElement("input");d.id="fileInput",d.className="fileInput",d.setAttribute("type","file"),d.oncontextmenu=noContextMenuHandler,document.body.appendChild(d);var e=PDFJS.locale||navigator.language;if(PDFViewerApplication.preferencePdfBugEnabled){var f=document.location.hash.substring(1),g=parseQueryString(f);if("disableworker"in g&&(PDFJS.disableWorker="true"===g.disableworker),"disablerange"in g&&(PDFJS.disableRange="true"===g.disablerange),"disablestream"in g&&(PDFJS.disableStream="true"===g.disablestream),"disableautofetch"in g&&(PDFJS.disableAutoFetch="true"===g.disableautofetch),"disablefontface"in g&&(PDFJS.disableFontFace="true"===g.disablefontface),"disablehistory"in g&&(PDFJS.disableHistory="true"===g.disablehistory),"webgl"in g&&(PDFJS.disableWebGL="true"!==g.webgl),"useonlycsszoom"in g&&(PDFJS.useOnlyCssZoom="true"===g.useonlycsszoom),"verbosity"in g&&(PDFJS.verbosity=0|g.verbosity),"ignorecurrentpositiononzoom"in g&&(IGNORE_CURRENT_POSITION_ON_ZOOM="true"===g.ignorecurrentpositiononzoom),"locale"in g&&(e=g.locale),"textlayer"in g)switch(g.textlayer){case"off":PDFJS.disableTextLayer=!0;break;case"visible":case"shadow":case"hover":var h=document.getElementById("viewer");h.classList.add("textLayer-"+g.textlayer)}if("pdfbug"in g){PDFJS.pdfBug=!0;var i=g.pdfbug,j=i.split(",");PDFBug.enable(j),PDFBug.init()}}mozL10n.setLanguage(e),PDFViewerApplication.supportsPrinting||(document.getElementById("print").classList.add("hidden"),document.getElementById("secondaryPrint").classList.add("hidden")),PDFViewerApplication.supportsFullscreen||(document.getElementById("presentationMode").classList.add("hidden"),document.getElementById("secondaryPresentationMode").classList.add("hidden")),PDFViewerApplication.supportsIntegratedFind&&document.getElementById("viewFind").classList.add("hidden"),document.getElementById("scaleSelect").oncontextmenu=noContextMenuHandler;var k=document.getElementById("mainContainer"),l=document.getElementById("outerContainer");if(k.addEventListener("transitionend",function(a){if(a.target===k){var b=document.createEvent("UIEvents");b.initUIEvent("resize",!1,!1,window,0),window.dispatchEvent(b),l.classList.remove("sidebarMoving")}},!0),document.getElementById("sidebarToggle").addEventListener("click",function(){this.classList.toggle("toggled"),l.classList.add("sidebarMoving"),l.classList.toggle("sidebarOpen"),PDFViewerApplication.sidebarOpen=l.classList.contains("sidebarOpen"),PDFViewerApplication.sidebarOpen&&PDFViewerApplication.refreshThumbnailViewer(),PDFViewerApplication.forceRendering()}),document.getElementById("viewThumbnail").addEventListener("click",function(){PDFViewerApplication.switchSidebarView("thumbs")}),document.getElementById("viewOutline").addEventListener("click",function(){PDFViewerApplication.switchSidebarView("outline")}),document.getElementById("viewOutline").addEventListener("dblclick",function(){PDFViewerApplication.outline.toggleOutlineTree()}),document.getElementById("previous").addEventListener("click",function(){PDFViewerApplication.page--}),document.getElementById("next").addEventListener("click",function(){PDFViewerApplication.page++}),document.getElementById("zoomIn").addEventListener("click",function(){PDFViewerApplication.zoomIn()}),document.getElementById("zoomOut").addEventListener("click",function(){PDFViewerApplication.zoomOut()}),document.getElementById("pageNumber").addEventListener("click",function(){this.select()}),document.getElementById("pageNumber").addEventListener("change",function(){PDFViewerApplication.page=0|this.value,this.value!==(0|this.value).toString()&&(this.value=PDFViewerApplication.page)}),document.getElementById("scaleSelect").addEventListener("change",function(){"custom"!==this.value&&(PDFViewerApplication.pdfViewer.currentScaleValue=this.value)}),document.getElementById("presentationMode").addEventListener("click",SecondaryToolbar.presentationModeClick.bind(SecondaryToolbar)),document.getElementById("print").addEventListener("click",SecondaryToolbar.printClick.bind(SecondaryToolbar)),document.getElementById("download").addEventListener("click",SecondaryToolbar.downloadClick.bind(SecondaryToolbar)),c&&0===c.lastIndexOf("file:",0)){PDFViewerApplication.setTitleUsingUrl(c);var m=new XMLHttpRequest;m.onload=function(){PDFViewerApplication.open(new Uint8Array(m.response))};try{m.open("GET",c),m.responseType="arraybuffer",m.send()}catch(a){PDFViewerApplication.error(mozL10n.get("loading_error",null,"An error occurred while loading the PDF."),a)}}else c&&PDFViewerApplication.open(c)}function selectScaleOption(a){for(var b=document.getElementById("scaleSelect").options,c=!1,d=0,e=b.length;d0&&this.bar.setAttribute("style","width: calc(100% - "+d+"px);")}},hide:function(){this.visible&&(this.visible=!1,this.bar.classList.add("hidden"),document.body.classList.remove("loadingInProgress"))},show:function(){this.visible||(this.visible=!0,document.body.classList.add("loadingInProgress"),this.bar.classList.remove("hidden"))}},c}(),DEFAULT_PREFERENCES={showPreviousViewOnLoad:!0,defaultZoomValue:"",sidebarViewOnLoad:0,enableHandToolOnLoad:!1,enableWebGL:!1,pdfBugEnabled:!1,disableRange:!1,disableStream:!1,disableAutoFetch:!1,disableFontFace:!1,disableTextLayer:!1,useOnlyCssZoom:!1,externalLinkTarget:0},SidebarView={NONE:0,THUMBS:1,OUTLINE:2},Preferences={prefs:Object.create(DEFAULT_PREFERENCES),isInitializedPromiseResolved:!1,initializedPromise:null,initialize:function(){return this.initializedPromise=this._readFromStorage(DEFAULT_PREFERENCES).then(function(a){this.isInitializedPromiseResolved=!0,a&&(this.prefs=a)}.bind(this))},_writeToStorage:function(b){return Promise.resolve()},_readFromStorage:function(b){return Promise.resolve()},reset:function(){return this.initializedPromise.then(function(){return this.prefs=Object.create(DEFAULT_PREFERENCES),this._writeToStorage(DEFAULT_PREFERENCES)}.bind(this))},reload:function(){return this.initializedPromise.then(function(){this._readFromStorage(DEFAULT_PREFERENCES).then(function(a){a&&(this.prefs=a)}.bind(this))}.bind(this))},set:function(b,c){return this.initializedPromise.then(function(){if(void 0===DEFAULT_PREFERENCES[b])throw new Error("preferencesSet: '"+b+"' is undefined.");if(void 0===c)throw new Error("preferencesSet: no value is specified.");var a=typeof c,d=typeof DEFAULT_PREFERENCES[b];if(a!==d){if("number"!==a||"string"!==d)throw new Error("Preferences_set: '"+c+"' is a \""+a+'", expected "'+d+'".');c=c.toString()}else if("number"===a&&(0|c)!==c)throw new Error("Preferences_set: '"+c+'\' must be an "integer".');return this.prefs[b]=c,this._writeToStorage(this.prefs)}.bind(this))},get:function(b){return this.initializedPromise.then(function(){var a=DEFAULT_PREFERENCES[b];if(void 0===a)throw new Error("preferencesGet: '"+b+"' is undefined.");var c=this.prefs[b];return void 0!==c?c:a}.bind(this))}};Preferences._writeToStorage=function(a){return new Promise(function(b){localStorage.setItem("pdfjs.preferences",JSON.stringify(a)),b()})},Preferences._readFromStorage=function(a){return new Promise(function(a){var b=JSON.parse(localStorage.getItem("pdfjs.preferences"));a(b)})},function(){function e(a){var b=document.createEvent("CustomEvent");b.initCustomEvent(a,!1,!1,"custom"),window.dispatchEvent(b)}function f(){if(b)if(h(),++c=this.cacheSize&&b.files.shift();for(var c,d=0,e=b.files.length;d0&&(this.matchCount+=g.length,this.updateUIResultsCount())}},extractText:function(){function f(a){e.pdfViewer.getPageTextContent(a).then(function(d){for(var g=d.items,h=[],i=0,j=g.length;i0)return this.hadMatch=!0,g.matchIdx=b?g.matchIdx-1:g.matchIdx+1,void this.updateMatch(!0);this.advanceOffsetPage(b)}this.nextPageMatch()}},matchesReady:function(b){var c=this.offset,d=b.length,e=this.state.findPrevious;return d?(this.hadMatch=!0,c.matchIdx=e?d-1:0,this.updateMatch(!0),!0):(this.advanceOffsetPage(e),!!(c.wrapped&&(c.matchIdx=null,this.pagesToSearch<0))&&(this.updateMatch(!1),!0))},updateMatchPosition:function(b,c,d,e,f){if(this.selected.matchIdx===c&&this.selected.pageIdx===b){var g={top:FIND_SCROLL_OFFSET_TOP,left:FIND_SCROLL_OFFSET_LEFT};scrollIntoView(d[e],g,!0)}},nextPageMatch:function(){null!==this.resumePageIdx&&console.error("There can only be one pending page.");do{var b=this.offset.pageIdx,c=this.pageMatches[b];if(!c){this.resumePageIdx=b;break}}while(!this.matchesReady(c))},advanceOffsetPage:function(b){var c=this.offset,d=this.extractTextPromises.length;c.pageIdx=b?c.pageIdx-1:c.pageIdx+1,c.matchIdx=null,this.pagesToSearch--,(c.pageIdx>=d||c.pageIdx<0)&&(c.pageIdx=b?d-1:0,c.wrapped=!0)},updateMatch:function(b){var c=FindStates.FIND_NOTFOUND,d=this.offset.wrapped;if(this.offset.wrapped=!1,b){var e=this.selected.pageIdx;this.selected.pageIdx=this.offset.pageIdx,this.selected.matchIdx=this.offset.matchIdx,c=d?FindStates.FIND_WRAPPED:FindStates.FIND_FOUND,e!==-1&&e!==this.selected.pageIdx&&this.updatePage(e)}this.updateUIState(c,this.state.findPrevious),this.selected.pageIdx!==-1&&this.updatePage(this.selected.pageIdx)},updateUIResultsCount:function(){if(null===this.findBar)throw new Error("PDFFindController is not initialized with a PDFFindBar instance.");this.findBar.updateResultsCount(this.matchCount)},updateUIState:function(b,c){if(this.integratedFind)return void FirefoxCom.request("updateFindControlState",{result:b,findPrevious:c});if(null===this.findBar)throw new Error("PDFFindController is not initialized with a PDFFindBar instance.");this.findBar.updateUIState(b,c,this.matchCount)}},b}(),PDFLinkService=function(){function a(){this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null,this._pagesRefCache=null}return a.prototype={setDocument:function(b,c){this.baseUrl=c,this.pdfDocument=b,this._pagesRefCache=Object.create(null)},setViewer:function(b){this.pdfViewer=b},setHistory:function(b){this.pdfHistory=b},get pagesCount(){return this.pdfDocument.numPages},get page(){return this.pdfViewer.currentPageNumber},set page(a){this.pdfViewer.currentPageNumber=a},navigateTo:function(b){var f,c="",d=this,e=function(a){var f=a instanceof Object?d._pagesRefCache[a.num+" "+a.gen+" R"]:a+1;f?(f>d.pagesCount&&(f=d.pagesCount),d.pdfViewer.scrollPageIntoView(f,b),d.pdfHistory&&d.pdfHistory.push({dest:b,hash:c,page:f})):d.pdfDocument.getPageIndex(a).then(function(b){var c=b+1,f=a.num+" "+a.gen+" R";d._pagesRefCache[f]=c,e(a)})};"string"==typeof b?(c=b,f=this.pdfDocument.getDestination(b)):f=Promise.resolve(b),f.then(function(a){b=a,a instanceof Array&&e(a[0])})},getDestinationHash:function(b){if("string"==typeof b)return this.getAnchorUrl("#"+escape(b));if(b instanceof Array){var c=b[0],d=c instanceof Object?this._pagesRefCache[c.num+" "+c.gen+" R"]:c+1;if(d){var e=this.getAnchorUrl("#page="+d),f=b[1];if("object"==typeof f&&"name"in f&&"XYZ"===f.name){var g=b[4]||this.pdfViewer.currentScaleValue,h=parseFloat(g);h&&(g=100*h),e+="&zoom="+g,(b[2]||b[3])&&(e+=","+(b[2]||0)+","+(b[3]||0))}return e}}return this.getAnchorUrl("")},getAnchorUrl:function(b){return(this.baseUrl||"")+b},setHash:function(b){if(b.indexOf("=")>=0){var c=parseQueryString(b);if("nameddest"in c)return this.pdfHistory&&this.pdfHistory.updateNextHashParam(c.nameddest),void this.navigateTo(c.nameddest);var d,e;if("page"in c&&(d=0|c.page||1),"zoom"in c){var f=c.zoom.split(","),g=f[0],h=parseFloat(g);g.indexOf("Fit")===-1?e=[null,{name:"XYZ"},f.length>1?0|f[1]:null,f.length>2?0|f[2]:null,h?h/100:g]:"Fit"===g||"FitB"===g?e=[null,{name:g}]:"FitH"===g||"FitBH"===g||"FitV"===g||"FitBV"===g?e=[null,{name:g},f.length>1?0|f[1]:null]:"FitR"===g?5!==f.length?console.error("PDFLinkService_setHash: Not enough parameters for 'FitR'."):e=[null,{name:g},0|f[1],0|f[2],0|f[3],0|f[4]]:console.error("PDFLinkService_setHash: '"+g+"' is not a valid zoom value.")}if(e?this.pdfViewer.scrollPageIntoView(d||this.page,e):d&&(this.page=d),"pagemode"in c){var i=document.createEvent("CustomEvent");i.initCustomEvent("pagemode",!0,!0,{mode:c.pagemode}),this.pdfViewer.container.dispatchEvent(i)}}else/^\d+$/.test(b)?this.page=b:(this.pdfHistory&&this.pdfHistory.updateNextHashParam(unescape(b)),this.navigateTo(unescape(b)))},executeNamedAction:function(b){switch(b){case"GoBack":this.pdfHistory&&this.pdfHistory.back();break;case"GoForward":this.pdfHistory&&this.pdfHistory.forward();break;case"NextPage":this.page++;break;case"PrevPage":this.page--;break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1}var c=document.createEvent("CustomEvent");c.initCustomEvent("namedaction",!0,!0,{action:b}),this.pdfViewer.container.dispatchEvent(c)},cachePageRef:function(b,c){var d=c.num+" "+c.gen+" R";this._pagesRefCache[d]=b}},a}(),PDFHistory=function(){function a(a){this.linkService=a.linkService,this.initialized=!1,this.initialDestination=null,this.initialBookmark=null}return a.prototype={initialize:function(b){function e(){d.previousHash=window.location.hash.slice(1),d._pushToHistory({hash:d.previousHash},!1,!0),d._updatePreviousBookmark()}function f(a,b){function c(){window.removeEventListener("popstate",c),window.addEventListener("popstate",e),d._pushToHistory(a,!1,!0),history.forward()}function e(){window.removeEventListener("popstate",e),d.allowHashChange=!0,d.historyUnlocked=!0,b()}d.historyUnlocked=!1,d.allowHashChange=!1,window.addEventListener("popstate",c),history.back()}function g(){var a=d._getPreviousParams(null,!0);if(a){var b=!d.current.dest&&d.current.hash!==d.previousHash;d._pushToHistory(a,!1,b),d._updatePreviousBookmark()}window.removeEventListener("beforeunload",g,!1)}this.initialized=!0,this.reInitialized=!1,this.allowHashChange=!0,this.historyUnlocked=!0,this.isViewerInPresentationMode=!1,this.previousHash=window.location.hash.substring(1),this.currentBookmark="",this.currentPage=0,this.updatePreviousBookmark=!1,this.previousBookmark="",this.previousPage=0,this.nextHashParam="",this.fingerprint=b,this.currentUid=this.uid=0,this.current={};var c=window.history.state;this._isStateObjectDefined(c)?(c.target.dest?this.initialDestination=c.target.dest:this.initialBookmark=c.target.hash,this.currentUid=c.uid,this.uid=c.uid+1,this.current=c.target):(c&&c.fingerprint&&this.fingerprint!==c.fingerprint&&(this.reInitialized=!0),this._pushOrReplaceState({fingerprint:this.fingerprint},!0));var d=this;window.addEventListener("popstate",function(b){if(d.historyUnlocked){if(b.state)return void d._goTo(b.state);if(0===d.uid){var c=d.previousHash&&d.currentBookmark&&d.previousHash!==d.currentBookmark?{hash:d.currentBookmark,page:d.currentPage}:{page:1};f(c,function(){e()})}else e()}},!1),window.addEventListener("beforeunload",g,!1),window.addEventListener("pageshow",function(b){window.addEventListener("beforeunload",g,!1)},!1),window.addEventListener("presentationmodechanged",function(a){d.isViewerInPresentationMode=!!a.detail.active})},clearHistoryState:function(){this._pushOrReplaceState(null,!0)},_isStateObjectDefined:function(b){return!!(b&&b.uid>=0&&b.fingerprint&&this.fingerprint===b.fingerprint&&b.target&&b.target.hash)},_pushOrReplaceState:function(b,c){c?window.history.replaceState(b,"",document.URL):window.history.pushState(b,"",document.URL)},get isHashChangeUnlocked(){return!this.initialized||this.allowHashChange},_updatePreviousBookmark:function(){this.updatePreviousBookmark&&this.currentBookmark&&this.currentPage&&(this.previousBookmark=this.currentBookmark,this.previousPage=this.currentPage,this.updatePreviousBookmark=!1)},updateCurrentBookmark:function(b,c){this.initialized&&(this.currentBookmark=b.substring(1),this.currentPage=0|c,this._updatePreviousBookmark())},updateNextHashParam:function(b){this.initialized&&(this.nextHashParam=b)},push:function(b,c){if(this.initialized&&this.historyUnlocked){if(b.dest&&!b.hash&&(b.hash=this.current.hash&&this.current.dest&&this.current.dest===b.dest?this.current.hash:this.linkService.getDestinationHash(b.dest).split("#")[1]),b.page&&(b.page|=0),c){var d=window.history.state.target;return d||(this._pushToHistory(b,!1),this.previousHash=window.location.hash.substring(1)),this.updatePreviousBookmark=!this.nextHashParam,void(d&&this._updatePreviousBookmark())}if(this.nextHashParam){if(this.nextHashParam===b.hash)return this.nextHashParam=null,void(this.updatePreviousBookmark=!0);this.nextHashParam=null}b.hash?this.current.hash?this.current.hash!==b.hash?this._pushToHistory(b,!0):(!this.current.page&&b.page&&this._pushToHistory(b,!1,!0),this.updatePreviousBookmark=!0):this._pushToHistory(b,!0):this.current.page&&b.page&&this.current.page!==b.page&&this._pushToHistory(b,!0)}},_getPreviousParams:function(b,c){if(!this.currentBookmark||!this.currentPage)return null; if(this.updatePreviousBookmark&&(this.updatePreviousBookmark=!1),this.uid>0&&(!this.previousBookmark||!this.previousPage))return null;if(!this.current.dest&&!b||c){if(this.previousBookmark===this.currentBookmark)return null}else{if(!this.current.page&&!b)return null;if(this.previousPage===this.currentPage)return null}var d={hash:this.currentBookmark,page:this.currentPage};return this.isViewerInPresentationMode&&(d.hash=null),d},_stateObj:function(b){return{fingerprint:this.fingerprint,uid:this.uid,target:b}},_pushToHistory:function(b,c,d){if(this.initialized){if(!b.hash&&b.page&&(b.hash="page="+b.page),c&&!d){var e=this._getPreviousParams();if(e){var f=!this.current.dest&&this.current.hash!==this.previousHash;this._pushToHistory(e,!1,f)}}this._pushOrReplaceState(this._stateObj(b),d||0===this.uid),this.currentUid=this.uid++,this.current=b,this.updatePreviousBookmark=!0}},_goTo:function(b){if(this.initialized&&this.historyUnlocked&&this._isStateObjectDefined(b)){if(!this.reInitialized&&b.uidthis.uid&&(this.uid=b.uid),this.current=b.target,this.updatePreviousBookmark=!0;var d=window.location.hash.substring(1);this.previousHash!==d&&(this.allowHashChange=!1),this.previousHash=d,this.historyUnlocked=!0}},back:function(){this.go(-1)},forward:function(){this.go(1)},go:function(b){if(this.initialized&&this.historyUnlocked){var c=window.history.state;b===-1&&c&&c.uid>0?window.history.back():1===b&&c&&c.uidg&&f-g0&&b<0||this.mouseScrollDelta<0&&b>0)&&this._resetMouseScrollState(),this.mouseScrollDelta+=b,Math.abs(this.mouseScrollDelta)>=d)){var h=this.mouseScrollDelta>0?e.UP:e.DOWN,i=this.pdfViewer.currentPageNumber;if(this._resetMouseScrollState(),1===i&&h===e.UP||i===this.pdfViewer.pagesCount&&h===e.DOWN)return;this.pdfViewer.currentPageNumber=i+h,this.mouseScrollTimeStamp=f}}},get isFullscreen(){return!!(document.fullscreenElement||document.mozFullScreen||document.webkitIsFullScreen||document.msFullscreenElement)},_notifyStateChange:function(){var b=document.createEvent("CustomEvent");b.initCustomEvent("presentationmodechanged",!0,!0,{active:this.active,switchInProgress:!!this.switchInProgress}),window.dispatchEvent(b)},_setSwitchInProgress:function(){this.switchInProgress&&clearTimeout(this.switchInProgress),this.switchInProgress=setTimeout(function(){this._removeFullscreenChangeListeners(),delete this.switchInProgress,this._notifyStateChange()}.bind(this),DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS)},_resetSwitchInProgress:function(){this.switchInProgress&&(clearTimeout(this.switchInProgress),delete this.switchInProgress)},_enter:function(){this.active=!0,this._resetSwitchInProgress(),this._notifyStateChange(),this.container.classList.add(ACTIVE_SELECTOR),setTimeout(function(){this.pdfViewer.currentPageNumber=this.args.page,this.pdfViewer.currentScaleValue="page-fit"}.bind(this),0),this._addWindowListeners(),this._showControls(),this.contextMenuOpen=!1,this.container.setAttribute("contextmenu","viewerContextMenu"),window.getSelection().removeAllRanges()},_exit:function(){var b=this.pdfViewer.currentPageNumber;this.container.classList.remove(ACTIVE_SELECTOR),setTimeout(function(){this.active=!1,this._removeFullscreenChangeListeners(),this._notifyStateChange(),this.pdfViewer.currentScaleValue=this.args.previousScale,this.pdfViewer.currentPageNumber=b,this.args=null}.bind(this),0),this._removeWindowListeners(),this._hideControls(),this._resetMouseScrollState(),this.container.removeAttribute("contextmenu"),this.contextMenuOpen=!1,this.pdfThumbnailViewer&&this.pdfThumbnailViewer.ensureThumbnailVisible(b)},_mouseDown:function(b){if(this.contextMenuOpen)return this.contextMenuOpen=!1,void b.preventDefault();if(0===b.button){var c=b.target.href&&b.target.classList.contains("internalLink");c||(b.preventDefault(),this.pdfViewer.currentPageNumber+=b.shiftKey?-1:1)}},_contextMenu:function(){this.contextMenuOpen=!0},_showControls:function(){this.controlsTimeout?clearTimeout(this.controlsTimeout):this.container.classList.add(CONTROLS_SELECTOR),this.controlsTimeout=setTimeout(function(){this.container.classList.remove(CONTROLS_SELECTOR),delete this.controlsTimeout}.bind(this),DELAY_BEFORE_HIDING_CONTROLS)},_hideControls:function(){this.controlsTimeout&&(clearTimeout(this.controlsTimeout),this.container.classList.remove(CONTROLS_SELECTOR),delete this.controlsTimeout)},_resetMouseScrollState:function(){this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0},_addWindowListeners:function(){this.showControlsBind=this._showControls.bind(this),this.mouseDownBind=this._mouseDown.bind(this),this.resetMouseScrollStateBind=this._resetMouseScrollState.bind(this),this.contextMenuBind=this._contextMenu.bind(this),window.addEventListener("mousemove",this.showControlsBind),window.addEventListener("mousedown",this.mouseDownBind),window.addEventListener("keydown",this.resetMouseScrollStateBind),window.addEventListener("contextmenu",this.contextMenuBind)},_removeWindowListeners:function(){window.removeEventListener("mousemove",this.showControlsBind),window.removeEventListener("mousedown",this.mouseDownBind),window.removeEventListener("keydown",this.resetMouseScrollStateBind),window.removeEventListener("contextmenu",this.contextMenuBind),delete this.showControlsBind,delete this.mouseDownBind,delete this.resetMouseScrollStateBind,delete this.contextMenuBind},_fullscreenChange:function(){this.isFullscreen?this._enter():this._exit()},_addFullscreenChangeListeners:function(){this.fullscreenChangeBind=this._fullscreenChange.bind(this),window.addEventListener("fullscreenchange",this.fullscreenChangeBind),window.addEventListener("mozfullscreenchange",this.fullscreenChangeBind),window.addEventListener("webkitfullscreenchange",this.fullscreenChangeBind),window.addEventListener("MSFullscreenChange",this.fullscreenChangeBind)},_removeFullscreenChangeListeners:function(){window.removeEventListener("fullscreenchange",this.fullscreenChangeBind),window.removeEventListener("mozfullscreenchange",this.fullscreenChangeBind),window.removeEventListener("webkitfullscreenchange",this.fullscreenChangeBind),window.removeEventListener("MSFullscreenChange",this.fullscreenChangeBind),delete this.fullscreenChangeBind}},b}(),GrabToPan=function(){function b(a){this.element=a.element,this.document=a.element.ownerDocument,"function"==typeof a.ignoreTarget&&(this.ignoreTarget=a.ignoreTarget),this.onActiveChanged=a.onActiveChanged,this.activate=this.activate.bind(this),this.deactivate=this.deactivate.bind(this),this.toggle=this.toggle.bind(this),this._onmousedown=this._onmousedown.bind(this),this._onmousemove=this._onmousemove.bind(this),this._endPan=this._endPan.bind(this);var b=this.overlay=document.createElement("div");b.className="grab-to-pan-grabbing"}function h(a){return"buttons"in a&&d?!(1|a.buttons):f||g?0===a.which:void 0}b.prototype={CSS_CLASS_GRAB:"grab-to-pan-grab",activate:function(){this.active||(this.active=!0,this.element.addEventListener("mousedown",this._onmousedown,!0),this.element.classList.add(this.CSS_CLASS_GRAB),this.onActiveChanged&&this.onActiveChanged(!0))},deactivate:function(){this.active&&(this.active=!1,this.element.removeEventListener("mousedown",this._onmousedown,!0),this._endPan(),this.element.classList.remove(this.CSS_CLASS_GRAB),this.onActiveChanged&&this.onActiveChanged(!1))},toggle:function(){this.active?this.deactivate():this.activate()},ignoreTarget:function(b){return b[c]("a[href], a[href] *, input, textarea, button, button *, select, option")},_onmousedown:function(b){if(0===b.button&&!this.ignoreTarget(b.target)){if(b.originalTarget)try{b.originalTarget.tagName}catch(a){return}this.scrollLeftStart=this.element.scrollLeft,this.scrollTopStart=this.element.scrollTop,this.clientXStart=b.clientX,this.clientYStart=b.clientY,this.document.addEventListener("mousemove",this._onmousemove,!0),this.document.addEventListener("mouseup",this._endPan,!0),this.element.addEventListener("scroll",this._endPan,!0),b.preventDefault(),b.stopPropagation(),this.document.documentElement.classList.add(this.CSS_CLASS_GRABBING);var c=document.activeElement;c&&!c.contains(b.target)&&c.blur()}},_onmousemove:function(b){if(this.element.removeEventListener("scroll",this._endPan,!0),h(b))return void this._endPan();var c=b.clientX-this.clientXStart,d=b.clientY-this.clientYStart;this.element.scrollTop=this.scrollTopStart-d,this.element.scrollLeft=this.scrollLeftStart-c,this.overlay.parentNode||document.body.appendChild(this.overlay)},_endPan:function(){this.element.removeEventListener("scroll",this._endPan,!0),this.document.removeEventListener("mousemove",this._onmousemove,!0),this.document.removeEventListener("mouseup",this._endPan,!0),this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)}};var c;["webkitM","mozM","msM","oM","m"].some(function(a){var b=a+"atches";return b in document.documentElement&&(c=b),b+="Selector",b in document.documentElement&&(c=b),c});var d=!document.documentMode||document.documentMode>9,e=window.chrome,f=e&&(e.webstore||e.app),g=/Apple/.test(navigator.vendor)&&/Version\/([6-9]\d*|[1-5]\d+)/.test(navigator.userAgent);return b}(),HandTool={initialize:function(b){var c=b.toggleHandTool;this.handTool=new GrabToPan({element:b.container,onActiveChanged:function(a){c&&(a?(c.title=mozL10n.get("hand_tool_disable.title",null,"Disable hand tool"),c.firstElementChild.textContent=mozL10n.get("hand_tool_disable_label",null,"Disable hand tool")):(c.title=mozL10n.get("hand_tool_enable.title",null,"Enable hand tool"),c.firstElementChild.textContent=mozL10n.get("hand_tool_enable_label",null,"Enable hand tool")))}}),c&&(c.addEventListener("click",this.toggle.bind(this),!1),window.addEventListener("localized",function(a){Preferences.get("enableHandToolOnLoad").then(function(b){b&&this.handTool.activate()}.bind(this),function(b){})}.bind(this)),window.addEventListener("presentationmodechanged",function(a){a.detail.switchInProgress||(a.detail.active?this.enterPresentationMode():this.exitPresentationMode())}.bind(this)))},toggle:function(){this.handTool.toggle(),SecondaryToolbar.close()},enterPresentationMode:function(){this.handTool.active&&(this.wasActive=!0,this.handTool.deactivate())},exitPresentationMode:function(){this.wasActive&&(this.wasActive=null,this.handTool.activate())}},OverlayManager={overlays:{},active:null,register:function(b,c,d){return new Promise(function(a){var e,f;if(!(b&&(e=document.getElementById(b))&&(f=e.parentNode)))throw new Error("Not enough parameters.");if(this.overlays[b])throw new Error("The overlay is already registered.");this.overlays[b]={element:e,container:f,callerCloseMethod:c||null,canForceClose:d||!1},a()}.bind(this))},unregister:function(b){return new Promise(function(a){if(!this.overlays[b])throw new Error("The overlay does not exist.");if(this.active===b)throw new Error("The overlay cannot be removed while it is active.");delete this.overlays[b],a()}.bind(this))},open:function(b){return new Promise(function(a){if(!this.overlays[b])throw new Error("The overlay does not exist.");if(this.active){if(!this.overlays[b].canForceClose)throw this.active===b?new Error("The overlay is already active."):new Error("Another overlay is currently active.");this._closeThroughCaller()}this.active=b,this.overlays[this.active].element.classList.remove("hidden"),this.overlays[this.active].container.classList.remove("hidden"),window.addEventListener("keydown",this._keyDown),a()}.bind(this))},close:function(b){return new Promise(function(a){if(!this.overlays[b])throw new Error("The overlay does not exist.");if(!this.active)throw new Error("The overlay is currently not active.");if(this.active!==b)throw new Error("Another overlay is currently active.");this.overlays[this.active].container.classList.add("hidden"),this.overlays[this.active].element.classList.add("hidden"),this.active=null,window.removeEventListener("keydown",this._keyDown),a()}.bind(this))},_keyDown:function(b){var c=OverlayManager;c.active&&27===b.keyCode&&(c._closeThroughCaller(),b.preventDefault())},_closeThroughCaller:function(){this.overlays[this.active].callerCloseMethod&&this.overlays[this.active].callerCloseMethod(),this.active&&this.close(this.active)}},PasswordPrompt={overlayName:null,updatePassword:null,reason:null,passwordField:null,passwordText:null,passwordSubmit:null,passwordCancel:null,initialize:function(b){this.overlayName=b.overlayName,this.passwordField=b.passwordField,this.passwordText=b.passwordText,this.passwordSubmit=b.passwordSubmit,this.passwordCancel=b.passwordCancel,this.passwordSubmit.addEventListener("click",this.verifyPassword.bind(this)),this.passwordCancel.addEventListener("click",this.close.bind(this)),this.passwordField.addEventListener("keydown",function(a){13===a.keyCode&&this.verifyPassword()}.bind(this)),OverlayManager.register(this.overlayName,this.close.bind(this),!0)},open:function(){OverlayManager.open(this.overlayName).then(function(){this.passwordField.type="password",this.passwordField.focus();var a=mozL10n.get("password_label",null,"Enter the password to open this PDF file.");this.reason===PDFJS.PasswordResponses.INCORRECT_PASSWORD&&(a=mozL10n.get("password_invalid",null,"Invalid password. Please try again.")),this.passwordText.textContent=a}.bind(this))},close:function(){OverlayManager.close(this.overlayName).then(function(){this.passwordField.value="",this.passwordField.type=""}.bind(this))},verifyPassword:function(){var b=this.passwordField.value;if(b&&b.length>0)return this.close(),this.updatePassword(b)}},PresentationModeState={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},IGNORE_CURRENT_POSITION_ON_ZOOM=!1,DEFAULT_CACHE_SIZE=10,CLEANUP_TIMEOUT=3e4,RenderingStates={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},PDFRenderingQueue=function(){function b(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1}return b.prototype={setViewer:function(b){this.pdfViewer=b},setThumbnailViewer:function(b){this.pdfThumbnailViewer=b},isHighestPriority:function(b){return this.highestPriorityPage===b.renderingId},renderHighestPriority:function(b){this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),this.pdfViewer.forceRendering(b)||this.pdfThumbnailViewer&&this.isThumbnailViewEnabled&&this.pdfThumbnailViewer.forceRendering()||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),CLEANUP_TIMEOUT))},getHighestPriority:function(b,c,d){var e=b.views,f=e.length;if(0===f)return!1;for(var g=0;g=0;h--){var i=e[h];f!==i&&g!==i&&d.removeChild(i)}d.removeAttribute("data-loaded"),g?this.annotationLayer.hide():this.annotationLayer=null,this.canvas&&!f&&(this.canvas.width=0,this.canvas.height=0,delete this.canvas),this.loadingIconDiv=document.createElement("div"),this.loadingIconDiv.className="loadingIcon",d.appendChild(this.loadingIconDiv)},update:function(b,c){this.scale=b||this.scale,"undefined"!=typeof c&&(this.rotation=c);var d=(this.rotation+this.pdfPageRotate)%360;this.viewport=this.viewport.clone({scale:this.scale*CSS_UNITS,rotation:d});var e=!1;if(this.canvas&&PDFJS.maxCanvasPixels>0){var f=this.outputScale,g=this.viewport.width*this.viewport.height;Math.sqrt(PDFJS.maxCanvasPixels/g);(Math.floor(this.viewport.width)*f.sx|0)*(Math.floor(this.viewport.height)*f.sy|0)>PDFJS.maxCanvasPixels&&(e=!0)}if(this.canvas){if(PDFJS.useOnlyCssZoom||this.hasRestrictedScaling&&e){this.cssTransform(this.canvas,!0);var i=document.createEvent("CustomEvent");return i.initCustomEvent("pagerendered",!0,!0,{pageNumber:this.id,cssTransform:!0}),void this.div.dispatchEvent(i)}this.zoomLayer||(this.zoomLayer=this.canvas.parentNode,this.zoomLayer.style.position="absolute")}this.zoomLayer&&this.cssTransform(this.zoomLayer.firstChild),this.reset(!0,!0)},updatePosition:function(){this.textLayer&&this.textLayer.render(TEXT_LAYER_RENDER_DELAY)},cssTransform:function(b,c){var d=PDFJS.CustomStyle,e=this.viewport.width,f=this.viewport.height,g=this.div;b.style.width=b.parentNode.style.width=g.style.width=Math.floor(e)+"px",b.style.height=b.parentNode.style.height=g.style.height=Math.floor(f)+"px";var h=this.viewport.rotation-b._viewport.rotation,i=Math.abs(h),j=1,k=1;90!==i&&270!==i||(j=f/e,k=e/f);var l="rotate("+h+"deg) scale("+j+","+k+")";if(d.setProp("transform",b,l),this.textLayer){var m=this.textLayer.viewport,n=this.viewport.rotation-m.rotation,o=Math.abs(n),p=e/m.width;90!==o&&270!==o||(p=e/m.height);var r,s,q=this.textLayer.textLayerDiv;switch(o){case 0:r=s=0;break;case 90:r=0,s="-"+q.style.height;break;case 180:r="-"+q.style.width,s="-"+q.style.height;break;case 270:r="-"+q.style.width,s=0;break;default:console.error("Bad rotation value.")}d.setProp("transform",q,"rotate("+o+"deg) scale("+p+", "+p+") translate("+r+", "+s+")"),d.setProp("transformOrigin",q,"0% 0%")}c&&this.annotationLayer&&this.annotationLayer.render(this.viewport,"display")},get width(){return this.viewport.width},get height(){return this.viewport.height},getPagePoint:function(b,c){return this.viewport.convertToPdfPoint(b,c)},draw:function(){function u(a){if(y===t.renderTask&&(t.renderTask=null),"cancelled"===a)return void r(a);if(t.renderingState=RenderingStates.FINISHED,g&&(t.canvas.removeAttribute("hidden"),g=!1),t.loadingIconDiv&&(d.removeChild(t.loadingIconDiv),delete t.loadingIconDiv),t.zoomLayer){var c=t.zoomLayer.firstChild;c.width=0,c.height=0,d.removeChild(t.zoomLayer),t.zoomLayer=null}t.error=a,t.stats=b.stats,t.onAfterDraw&&t.onAfterDraw();var e=document.createEvent("CustomEvent");e.initCustomEvent("pagerendered",!0,!0,{pageNumber:t.id,cssTransform:!1}),d.dispatchEvent(e);var f=document.createEvent("CustomEvent");f.initCustomEvent("pagerender",!0,!0,{pageNumber:b.pageNumber}),d.dispatchEvent(f),a?r(a):q(void 0)}this.renderingState!==RenderingStates.INITIAL&&console.error("Must be in new state before drawing"),this.renderingState=RenderingStates.RUNNING;var b=this.pdfPage,c=this.viewport,d=this.div,e=document.createElement("div");e.style.width=d.style.width,e.style.height=d.style.height,e.classList.add("canvasWrapper");var f=document.createElement("canvas");f.id="page"+this.id,f.setAttribute("hidden","hidden");var g=!0;e.appendChild(f),this.annotationLayer&&this.annotationLayer.div?d.insertBefore(e,this.annotationLayer.div):d.appendChild(e),this.canvas=f,f.mozOpaque=!0;var h=f.getContext("2d",{alpha:!1}),i=getOutputScale(h);if(this.outputScale=i,PDFJS.useOnlyCssZoom){var j=c.clone({scale:CSS_UNITS});i.sx*=j.width/c.width,i.sy*=j.height/c.height,i.scaled=!0}if(PDFJS.maxCanvasPixels>0){var k=c.width*c.height,l=Math.sqrt(PDFJS.maxCanvasPixels/k);i.sx>l||i.sy>l?(i.sx=l,i.sy=l,i.scaled=!0,this.hasRestrictedScaling=!0):this.hasRestrictedScaling=!1}var m=approximateFraction(i.sx),n=approximateFraction(i.sy);f.width=roundToDivide(c.width*i.sx,m[0]),f.height=roundToDivide(c.height*i.sy,n[0]),f.style.width=roundToDivide(c.width,m[1])+"px",f.style.height=roundToDivide(c.height,n[1])+"px",f._viewport=c;var o=null,p=null;this.textLayerFactory&&(o=document.createElement("div"),o.className="textLayer",o.style.width=e.style.width,o.style.height=e.style.height,this.annotationLayer&&this.annotationLayer.div?d.insertBefore(o,this.annotationLayer.div):d.appendChild(o),p=this.textLayerFactory.createTextLayerBuilder(o,this.id-1,this.viewport)),this.textLayer=p;var q,r,s=new Promise(function(a,b){q=a,r=b}),t=this,v=null;this.renderingQueue&&(v=function(b){return t.renderingQueue.isHighestPriority(t)?(g&&(t.canvas.removeAttribute("hidden"),g=!1),void b()):(t.renderingState=RenderingStates.PAUSED,void(t.resume=function(){t.renderingState=RenderingStates.RUNNING,b()}))});var w=i.scaled?[i.sx,0,0,i.sy,0,0]:null,x={canvasContext:h,transform:w,viewport:this.viewport},y=this.renderTask=this.pdfPage.render(x);return y.onContinue=v,this.renderTask.promise.then(function(){u(null),p&&t.pdfPage.getTextContent({normalizeWhitespace:!0}).then(function(b){p.setTextContent(b),p.render(TEXT_LAYER_RENDER_DELAY)})},function(b){u(b)}),this.annotationLayerFactory&&(this.annotationLayer||(this.annotationLayer=this.annotationLayerFactory.createAnnotationLayerBuilder(d,this.pdfPage)),this.annotationLayer.render(this.viewport,"display")),d.setAttribute("data-loaded",!0),t.onBeforeDraw&&t.onBeforeDraw(),s},beforePrint:function(){var b=PDFJS.CustomStyle,c=this.pdfPage,d=c.getViewport(1),e=2,f=document.createElement("canvas");f.width=Math.floor(d.width)*e,f.height=Math.floor(d.height)*e,f.style.width=100*e+"%",f.style.height=100*e+"%";var g="scale("+1/e+", "+1/e+")";b.setProp("transform",f,g),b.setProp("transformOrigin",f,"0% 0%");var h=document.getElementById("printContainer"),i=document.createElement("div");i.style.width=d.width+"pt",i.style.height=d.height+"pt",i.appendChild(f),h.appendChild(i),f.mozPrintCallback=function(a){var b=a.context;b.save(),b.fillStyle="rgb(255, 255, 255)",b.fillRect(0,0,f.width,f.height),b.restore(),b._transformMatrix=[e,0,0,e,0,0],b.scale(e,e);var g={canvasContext:b,viewport:d,intent:"print"};c.render(g).promise.then(function(){a.done()},function(b){console.error(b),"abort"in a?a.abort():a.done()})}}},b}(),TextLayerBuilder=function(){function b(a){this.textLayerDiv=a.textLayerDiv,this.renderingDone=!1,this.divContentDone=!1,this.pageIdx=a.pageIndex,this.pageNumber=this.pageIdx+1,this.matches=[],this.viewport=a.viewport,this.textDivs=[],this.findController=a.findController||null,this.textLayerRenderTask=null,this._bindMouse()}return b.prototype={_finishRendering:function(){this.renderingDone=!0;var b=document.createElement("div");b.className="endOfContent",this.textLayerDiv.appendChild(b);var c=document.createEvent("CustomEvent");c.initCustomEvent("textlayerrendered",!0,!0,{pageNumber:this.pageNumber}),this.textLayerDiv.dispatchEvent(c)},render:function(b){if(this.divContentDone&&!this.renderingDone){this.textLayerRenderTask&&(this.textLayerRenderTask.cancel(),this.textLayerRenderTask=null),this.textDivs=[];var c=document.createDocumentFragment();this.textLayerRenderTask=PDFJS.renderTextLayer({textContent:this.textContent,container:c,viewport:this.viewport,textDivs:this.textDivs,timeout:b}),this.textLayerRenderTask.promise.then(function(){this.textLayerDiv.appendChild(c),this._finishRendering(),this.updateMatches()}.bind(this),function(a){})}},setTextContent:function(b){this.textLayerRenderTask&&(this.textLayerRenderTask.cancel(),this.textLayerRenderTask=null),this.textContent=b,this.divContentDone=!0},convertMatches:function(b){for(var c=0,d=0,e=this.textContent.items,f=e.length-1,g=null===this.findController?0:this.findController.state.query.length,h=[],i=0,j=b.length;i=d+e[c].str.length;)d+=e[c].str.length,c++;c===e.length&&console.error("Could not find a matching mapping");var l={begin:{divIdx:c,offset:k-d}};for(k+=g;c!==f&&k>d+e[c].str.length;)d+=e[c].str.length,c++;l.end={divIdx:c,offset:k-d},h.push(l)}return h},renderMatches:function(b){function k(a,b){var c=a.divIdx;d[c].textContent="",l(c,0,a.offset,b)}function l(a,b,e,f){var g=d[a],h=c[a].str.substring(b,e),i=document.createTextNode(h);if(f){var j=document.createElement("span");return j.className=f,j.appendChild(i),void g.appendChild(j)}g.appendChild(i)}if(0!==b.length){var c=this.textContent.items,d=this.textDivs,e=null,f=this.pageIdx,g=null!==this.findController&&f===this.findController.selected.pageIdx,h=null===this.findController?-1:this.findController.selected.matchIdx,i=null!==this.findController&&this.findController.state.highlightAll,j={divIdx:-1,offset:void 0},m=h,n=m+1;if(i)m=0,n=b.length;else if(!g)return;for(var o=m;o=0&&b.splice(e,1),b.push(d),b.length>a&&b.shift().destroy()},this.resize=function(c){for(a=c;b.length>a;)b.shift().destroy()}}function c(a,b){return b===a||Math.abs(b-a)<1e-15}function d(a){this.container=a.container,this.viewer=a.viewer||a.container.firstElementChild,this.linkService=a.linkService||new SimpleLinkService,this.removePageBorders=a.removePageBorders||!1,this.defaultRenderingQueue=!a.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new PDFRenderingQueue,this.renderingQueue.setViewer(this)):this.renderingQueue=a.renderingQueue,this.scroll=watchScroll(this.container,this._scrollUpdate.bind(this)),this.updateInProgress=!1,this.presentationModeState=PresentationModeState.UNKNOWN,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders")}return d.prototype={get pagesCount(){return this._pages.length},getPageView:function(a){return this._pages[a]},get currentPageNumber(){return this._currentPageNumber},set currentPageNumber(a){if(!this.pdfDocument)return void(this._currentPageNumber=a);var b=document.createEvent("UIEvents");return b.initUIEvent("pagechange",!0,!0,window,0),b.updateInProgress=this.updateInProgress,00)this._setScaleUpdatePages(d,b,c,!1);else{var e=this._pages[this._currentPageNumber-1];if(!e)return;var f=this.isInPresentationMode||this.removePageBorders?0:SCROLLBAR_PADDING,g=this.isInPresentationMode||this.removePageBorders?0:VERTICAL_PADDING,h=(this.container.clientWidth-f)/e.width*e.scale,i=(this.container.clientHeight-g)/e.height*e.scale;switch(b){case"page-actual":d=1;break;case"page-width":d=h;break;case"page-height":d=i;break;case"page-fit":d=Math.min(h,i);break;case"auto":var j=e.width>e.height,k=j?Math.min(i,h):h;d=Math.min(MAX_AUTO_SCALE,k);break;default:return void console.error("pdfViewSetScale: '"+b+"' is an unknown zoom value.")}this._setScaleUpdatePages(d,b,c,!0)}},scrollPageIntoView:function(b,c){if(this.pdfDocument){var d=this._pages[b-1];if(this.isInPresentationMode){if(this._currentPageNumber!==d.id)return void(this.currentPageNumber=d.id);c=null,this._setScale(this._currentScaleValue,!0)}if(!c)return void scrollIntoView(d.div);var i,j,e=0,f=0,g=0,h=0,k=d.rotation%180!==0,l=(k?d.height:d.width)/d.scale/CSS_UNITS,m=(k?d.width:d.height)/d.scale/CSS_UNITS,n=0;switch(c[1].name){case"XYZ":e=c[2],f=c[3],n=c[4],e=null!==e?e:0,f=null!==f?f:m;break;case"Fit":case"FitB":n="page-fit";break;case"FitH":case"FitBH":f=c[2],n="page-width",null===f&&this._location&&(e=this._location.left,f=this._location.top);break;case"FitV":case"FitBV":e=c[2],g=l,h=m,n="page-height";break;case"FitR":e=c[2],f=c[3],g=c[4]-e,h=c[5]-f;var o=this.removePageBorders?0:SCROLLBAR_PADDING,p=this.removePageBorders?0:VERTICAL_PADDING;i=(this.container.clientWidth-o)/g/CSS_UNITS,j=(this.container.clientHeight-p)/h/CSS_UNITS,n=Math.min(Math.abs(i),Math.abs(j));break;default:return}if(n&&n!==this._currentScale?this.currentScaleValue=n:this._currentScale===UNKNOWN_SCALE&&(this.currentScaleValue=DEFAULT_SCALE_VALUE),"page-fit"===n&&!c[4])return void scrollIntoView(d.div);var q=[d.viewport.convertToViewportPoint(e,f),d.viewport.convertToViewportPoint(e+g,f+h)],r=Math.min(q[0][0],q[1][0]),s=Math.min(q[0][1],q[1][1]);scrollIntoView(d.div,{left:r,top:s})}},_updateLocation:function(a){var b=this._currentScale,c=this._currentScaleValue,d=parseFloat(c)===b?Math.round(1e4*b)/100:c,e=a.id,f="#page="+e;f+="&zoom="+d;var g=this._pages[e-1],h=this.container,i=g.getPagePoint(h.scrollLeft-a.x,h.scrollTop-a.y),j=Math.round(i[0]),k=Math.round(i[1]);f+=","+j+","+k,this._location={pageNumber:e,scale:d,top:k,left:j,pdfOpenParams:f}},update:function(){var b=this._getVisiblePages(),c=b.views;if(0!==c.length){this.updateInProgress=!0;var d=Math.max(DEFAULT_CACHE_SIZE,2*c.length+1);this._buffer.resize(d),this.renderingQueue.renderHighestPriority(b);for(var e=this._currentPageNumber,f=b.first,g=0,h=c.length,i=!1;gthis.container.clientWidth},_getVisiblePages:function(){if(this.isInPresentationMode){var a=[],b=this._pages[this._currentPageNumber-1];return a.push({id:b.id,view:b}),{first:b,last:b,views:a}}return getVisibleElements(this.container,this._pages,!0)},cleanup:function(){for(var a=0,b=this._pages.length;a=0;d--)b.removeChild(c[d]);var e=2*THUMBNAIL_CANVAS_BORDER_WIDTH;b.style.width=this.canvasWidth+e+"px",b.style.height=this.canvasHeight+e+"px",this.canvas&&(this.canvas.width=0,this.canvas.height=0,delete this.canvas),this.image&&(this.image.removeAttribute("src"),delete this.image)},update:function(b){"undefined"!=typeof b&&(this.rotation=b);var c=(this.rotation+this.pdfPageRotate)%360;this.viewport=this.viewport.clone({scale:1,rotation:c}),this.reset()},_getPageDrawContext:function(b){var c=document.createElement("canvas");this.canvas=c,c.mozOpaque=!0;var d=c.getContext("2d",{alpha:!1}),e=getOutputScale(d);c.width=this.canvasWidth*e.sx|0,c.height=this.canvasHeight*e.sy|0,c.style.width=this.canvasWidth+"px",c.style.height=this.canvasHeight+"px",!b&&e.scaled&&d.scale(e.sx,e.sy);var f=document.createElement("img");return this.image=f,f.id=this.renderingId,f.className="thumbnailImage",f.setAttribute("aria-label",mozL10n.get("thumb_page_canvas",{page:this.id},"Thumbnail of Page {{page}}")),f.style.width=c.style.width,f.style.height=c.style.height,d},_convertCanvasToImage:function(){this.canvas&&(this.image.src=this.canvas.toDataURL(),this.div.setAttribute("data-loaded",!0),this.ring.appendChild(this.image),this.canvas.width=0,this.canvas.height=0,delete this.canvas)},draw:function(){function f(a){return k===e.renderTask&&(e.renderTask=null),"cancelled"===a?void c(a):(e.renderingState=RenderingStates.FINISHED,e._convertCanvasToImage(),void(a?c(a):b(void 0)))}if(this.renderingState!==RenderingStates.INITIAL&&console.error("Must be in new state before drawing"),this.hasImage)return Promise.resolve(void 0);this.hasImage=!0,this.renderingState=RenderingStates.RUNNING;var b,c,d=new Promise(function(a,d){b=a,c=d}),e=this,g=this._getPageDrawContext(),h=this.viewport.clone({scale:this.scale}),i=function(b){return e.renderingQueue.isHighestPriority(e)?void b():(e.renderingState=RenderingStates.PAUSED,void(e.resume=function(){e.renderingState=RenderingStates.RUNNING,b()}))},j={canvasContext:g,viewport:h},k=this.renderTask=this.pdfPage.render(j);return k.onContinue=i,k.promise.then(function(){f(null)},function(b){f(b)}),d},setImage:function(c){var d=c.canvas;if(!this.hasImage&&d){this.pdfPage||this.setPdfPage(c.pdfPage),this.hasImage=!0,this.renderingState=RenderingStates.FINISHED;var e=this._getPageDrawContext(!0),f=e.canvas;if(d.width<=2*f.width)return e.drawImage(d,0,0,d.width,d.height,0,0,f.width,f.height),void this._convertCanvasToImage();for(var g=3,h=f.width<d.width||i>d.height;)h>>=1,i>>=1;for(k.drawImage(d,0,0,d.width,d.height,0,0,h,i);h>2*f.width;)k.drawImage(j,0,0,h,i,0,0,h>>1,i>>1),h>>=1,i>>=1;e.drawImage(j,0,0,h,i,0,0,f.width,f.height),this._convertCanvasToImage()}}},c}();PDFThumbnailView.tempImageCache=null;var PDFThumbnailViewer=function(){function b(a){this.container=a.container,this.renderingQueue=a.renderingQueue,this.linkService=a.linkService,this.scroll=watchScroll(this.container,this._scrollUpdated.bind(this)),this._resetView()}return b.prototype={_scrollUpdated:function(){this.renderingQueue.renderHighestPriority()},getThumbnail:function(b){return this.thumbnails[b]},_getVisibleThumbs:function(){return getVisibleElements(this.container,this.thumbnails)},scrollThumbnailIntoView:function(b){var c=document.querySelector(".thumbnail.selected");c&&c.classList.remove("selected");var d=document.getElementById("thumbnailContainer"+b);d&&d.classList.add("selected");var e=this._getVisibleThumbs(),f=e.views.length;if(f>0){var g=e.first.id,h=f>1?e.last.id:g;(b<=g||b>=h)&&scrollIntoView(d,{top:THUMBNAIL_SCROLL_MARGIN})}},get pagesRotation(){return this._pagesRotation},set pagesRotation(a){this._pagesRotation=a;for(var b=0,c=this.thumbnails.length;b0;)for(var g=e.shift(),h=0,i=g.items.length;h0){f=!0,this._addToggleButton(k);var m=document.createElement("div");m.className="outlineItems",k.appendChild(m),e.push({parent:m,items:j.items})}g.parent.appendChild(k),c++}f&&this.container.classList.add("outlineWithDeepNesting"),this.container.appendChild(d),this._dispatchEvent(c)}},b}(),PDFViewerApplication={initialBookmark:document.location.hash.substring(1),initialDestination:null,initialized:!1,fellback:!1,pdfDocument:null,pdfLoadingTask:null,sidebarOpen:!1,printing:!1,pdfViewer:null,pdfThumbnailViewer:null,pdfRenderingQueue:null,pdfPresentationMode:null,pdfLinkService:null,pdfHistory:null,pageRotation:0,isInitialViewSet:!1,animationStartedPromise:null,preferenceSidebarViewOnLoad:SidebarView.NONE,preferencePdfBugEnabled:!1,preferenceShowPreviousViewOnLoad:!0,preferenceDefaultZoomValue:"",isViewerEmbedded:window.parent!==window,url:"",initialize:function(){var b=new PDFRenderingQueue;b.onIdle=this.cleanup.bind(this),this.pdfRenderingQueue=b;var c=new PDFLinkService;this.pdfLinkService=c;var d=document.getElementById("viewerContainer"),e=document.getElementById("viewer");this.pdfViewer=new PDFViewer({container:d,viewer:e,renderingQueue:b,linkService:c}),b.setViewer(this.pdfViewer),c.setViewer(this.pdfViewer);var f=document.getElementById("thumbnailView");if(this.pdfThumbnailViewer=new PDFThumbnailViewer({container:f,renderingQueue:b,linkService:c}),b.setThumbnailViewer(this.pdfThumbnailViewer),Preferences.initialize(),this.pdfHistory=new PDFHistory({linkService:c}),c.setHistory(this.pdfHistory),this.findController=new PDFFindController({pdfViewer:this.pdfViewer,integratedFind:this.supportsIntegratedFind}),this.pdfViewer.setFindController(this.findController),this.findBar=new PDFFindBar({bar:document.getElementById("findbar"),toggleButton:document.getElementById("viewFind"),findField:document.getElementById("findInput"),highlightAllCheckbox:document.getElementById("findHighlightAll"),caseSensitiveCheckbox:document.getElementById("findMatchCase"),findMsg:document.getElementById("findMsg"),findResultsCount:document.getElementById("findResultsCount"),findStatusIcon:document.getElementById("findStatusIcon"),findPreviousButton:document.getElementById("findPrevious"),findNextButton:document.getElementById("findNext"),findController:this.findController}),this.findController.setFindBar(this.findBar),HandTool.initialize({container:d,toggleHandTool:document.getElementById("toggleHandTool")}),SecondaryToolbar.initialize({toolbar:document.getElementById("secondaryToolbar"),toggleButton:document.getElementById("secondaryToolbarToggle"),presentationModeButton:document.getElementById("secondaryPresentationMode"),print:document.getElementById("secondaryPrint"),download:document.getElementById("secondaryDownload"),viewBookmark:document.getElementById("secondaryViewBookmark"),firstPage:document.getElementById("firstPage"),lastPage:document.getElementById("lastPage"),pageRotateCw:document.getElementById("pageRotateCw"),pageRotateCcw:document.getElementById("pageRotateCcw")}),this.supportsFullscreen){var g=SecondaryToolbar;this.pdfPresentationMode=new PDFPresentationMode({container:d,viewer:e,pdfViewer:this.pdfViewer,pdfThumbnailViewer:this.pdfThumbnailViewer,contextMenuItems:[{element:document.getElementById("contextFirstPage"),handler:g.firstPageClick.bind(g)},{element:document.getElementById("contextLastPage"),handler:g.lastPageClick.bind(g)},{element:document.getElementById("contextPageRotateCw"),handler:g.pageRotateCwClick.bind(g)},{element:document.getElementById("contextPageRotateCcw"),handler:g.pageRotateCcwClick.bind(g)}]})}PasswordPrompt.initialize({overlayName:"passwordOverlay",passwordField:document.getElementById("password"),passwordText:document.getElementById("passwordText"),passwordSubmit:document.getElementById("passwordSubmit"),passwordCancel:document.getElementById("passwordCancel")});var h=this,i=Promise.all([Preferences.get("enableWebGL").then(function(b){PDFJS.disableWebGL=!b}),Preferences.get("sidebarViewOnLoad").then(function(b){h.preferenceSidebarViewOnLoad=b}),Preferences.get("pdfBugEnabled").then(function(b){h.preferencePdfBugEnabled=b}),Preferences.get("showPreviousViewOnLoad").then(function(b){h.preferenceShowPreviousViewOnLoad=b}),Preferences.get("defaultZoomValue").then(function(b){h.preferenceDefaultZoomValue=b}),Preferences.get("disableTextLayer").then(function(b){PDFJS.disableTextLayer!==!0&&(PDFJS.disableTextLayer=b)}),Preferences.get("disableRange").then(function(b){PDFJS.disableRange!==!0&&(PDFJS.disableRange=b)}),Preferences.get("disableStream").then(function(b){PDFJS.disableStream!==!0&&(PDFJS.disableStream=b)}),Preferences.get("disableAutoFetch").then(function(b){PDFJS.disableAutoFetch=b}),Preferences.get("disableFontFace").then(function(b){PDFJS.disableFontFace!==!0&&(PDFJS.disableFontFace=b)}),Preferences.get("useOnlyCssZoom").then(function(b){PDFJS.useOnlyCssZoom=b}),Preferences.get("externalLinkTarget").then(function(b){PDFJS.isExternalLinkTargetSet()||(PDFJS.externalLinkTarget=b)})]).catch(function(a){});return i.then(function(){h.isViewerEmbedded&&!PDFJS.isExternalLinkTargetSet()&&(PDFJS.externalLinkTarget=PDFJS.LinkTarget.TOP),h.initialized=!0})},zoomIn:function(b){var c=this.pdfViewer.currentScale;do c=(c*DEFAULT_SCALE_DELTA).toFixed(2),c=Math.ceil(10*c)/10,c=Math.min(MAX_SCALE,c);while(--b>0&&c0&&c>MIN_SCALE);this.pdfViewer.currentScaleValue=c},get pagesCount(){return this.pdfDocument.numPages},set page(a){this.pdfLinkService.page=a},get page(){return this.pdfLinkService.page},get supportsPrinting(){var a=document.createElement("canvas"),b="mozPrintCallback"in a;return PDFJS.shadow(this,"supportsPrinting",b)},get supportsFullscreen(){var a=document.documentElement,b=!!(a.requestFullscreen||a.mozRequestFullScreen||a.webkitRequestFullScreen||a.msRequestFullscreen);return document.fullscreenEnabled!==!1&&document.mozFullScreenEnabled!==!1&&document.webkitFullscreenEnabled!==!1&&document.msFullscreenEnabled!==!1||(b=!1),b&&PDFJS.disableFullscreen===!0&&(b=!1),PDFJS.shadow(this,"supportsFullscreen",b)},get supportsIntegratedFind(){var a=!1;return PDFJS.shadow(this,"supportsIntegratedFind",a)},get supportsDocumentFonts(){var a=!0;return PDFJS.shadow(this,"supportsDocumentFonts",a)},get supportsDocumentColors(){var a=!0;return PDFJS.shadow(this,"supportsDocumentColors",a)},get loadingBar(){var a=new ProgressBar("#loadingBar",{});return PDFJS.shadow(this,"loadingBar",a)},get supportedMouseWheelZoomModifierKeys(){var a={ctrlKey:!0,metaKey:!0};return PDFJS.shadow(this,"supportedMouseWheelZoomModifierKeys",a)},setTitleUsingUrl:function(b){this.url=b;try{this.setTitle(decodeURIComponent(getFileName(b))||b)}catch(a){this.setTitle(b)}},setTitle:function(b){this.isViewerEmbedded||(document.title=b)},close:function(){var b=document.getElementById("errorWrapper");if(b.setAttribute("hidden","true"),!this.pdfLoadingTask)return Promise.resolve();var c=this.pdfLoadingTask.destroy();return this.pdfLoadingTask=null,this.pdfDocument&&(this.pdfDocument=null,this.pdfThumbnailViewer.setDocument(null),this.pdfViewer.setDocument(null),this.pdfLinkService.setDocument(null,null)),"undefined"!=typeof PDFBug&&PDFBug.cleanup(),c},open:function(b,c){var d=0;if((arguments.length>2||"number"==typeof c)&&(console.warn("Call of open() with obsolete signature."),"number"==typeof c&&(d=c),c=arguments[4]||null,arguments[3]&&"object"==typeof arguments[3]&&(c=Object.create(c),c.range=arguments[3]),"string"==typeof arguments[2]&&(c=Object.create(c),c.password=arguments[2])),this.pdfLoadingTask)return this.close().then(function(){return Preferences.reload(),this.open(b,c)}.bind(this));var e=Object.create(null);if("string"==typeof b?(this.setTitleUsingUrl(b),e.url=b):b&&"byteLength"in b?e.data=b:b.url&&b.originalUrl&&(this.setTitleUsingUrl(b.originalUrl),e.url=b.url),c)for(var f in c)e[f]=c[f];var g=this;g.downloadComplete=!1;var h=PDFJS.getDocument(e);this.pdfLoadingTask=h,h.onPassword=function(b,c){PasswordPrompt.updatePassword=b,PasswordPrompt.reason=c,PasswordPrompt.open()},h.onProgress=function(b){g.progress(b.loaded/b.total)},h.onUnsupportedFeature=this.fallback.bind(this);var i=h.promise.then(function(b){g.load(b,d)},function(b){var c=b&&b.message,d=mozL10n.get("loading_error",null,"An error occurred while loading the PDF.");b instanceof PDFJS.InvalidPDFException?d=mozL10n.get("invalid_file_error",null,"Invalid or corrupted PDF file."):b instanceof PDFJS.MissingPDFException?d=mozL10n.get("missing_file_error",null,"Missing PDF file."):b instanceof PDFJS.UnexpectedResponseException&&(d=mozL10n.get("unexpected_response_error",null,"Unexpected server response."));var e={message:c};throw g.error(d,e),new Error(d)});return i},download:function(){function b(){e.downloadUrl(c,d)}var c=this.url.split("#")[0],d=getPDFFileNameFromURL(c),e=new DownloadManager;return e.onerror=function(a){PDFViewerApplication.error("PDF failed to download.")},this.pdfDocument&&this.downloadComplete?void this.pdfDocument.getData().then(function(b){var f=PDFJS.createBlob(b,"application/pdf");e.download(f,c,d)},b).then(null,b):void b()},fallback:function(b){},error:function(b,c){var d=mozL10n.get("error_version_info",{version:PDFJS.version||"?",build:PDFJS.build||"?"},"PDF.js v{{version}} (build: {{build}})")+"\n";c&&(d+=mozL10n.get("error_message",{message:c.message},"Message: {{message}}"),c.stack?d+="\n"+mozL10n.get("error_stack",{stack:c.stack},"Stack: {{stack}}"):(c.filename&&(d+="\n"+mozL10n.get("error_file",{file:c.filename},"File: {{file}}")),c.lineNumber&&(d+="\n"+mozL10n.get("error_line",{line:c.lineNumber},"Line: {{line}}"))));var e=document.getElementById("errorWrapper");e.removeAttribute("hidden");var f=document.getElementById("errorMessage");f.textContent=b;var g=document.getElementById("errorClose");g.onclick=function(){e.setAttribute("hidden","true")};var h=document.getElementById("errorMoreInfo"),i=document.getElementById("errorShowMore"),j=document.getElementById("errorShowLess");i.onclick=function(){h.removeAttribute("hidden"),i.setAttribute("hidden","true"),j.removeAttribute("hidden"),h.style.height=h.scrollHeight+"px"},j.onclick=function(){h.setAttribute("hidden","true"),i.removeAttribute("hidden"),j.setAttribute("hidden","true")},i.oncontextmenu=noContextMenuHandler,j.oncontextmenu=noContextMenuHandler,g.oncontextmenu=noContextMenuHandler,i.removeAttribute("hidden"),j.setAttribute("hidden","true"),h.value=d},progress:function(b){var c=Math.round(100*b);(c>this.loadingBar.percent||isNaN(c))&&(this.loadingBar.percent=c,PDFJS.disableAutoFetch&&c&&(this.disableAutoFetchLoadingBarTimeout&&(clearTimeout(this.disableAutoFetchLoadingBarTimeout),this.disableAutoFetchLoadingBarTimeout=null),this.loadingBar.show(),this.disableAutoFetchLoadingBarTimeout=setTimeout(function(){this.loadingBar.hide(),this.disableAutoFetchLoadingBarTimeout=null}.bind(this),DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT)))},load:function(b,c){var d=this;c=c||UNKNOWN_SCALE,this.findController.reset(),this.pdfDocument=b;var e=b.getDownloadInfo().then(function(){d.downloadComplete=!0,d.loadingBar.hide()}),f=b.numPages;document.getElementById("numPages").textContent=mozL10n.get("page_of",{pageCount:f},"of {{pageCount}}"),document.getElementById("pageNumber").max=f;var g=this.documentFingerprint=b.fingerprint,h=this.store=new ViewHistory(g),i=null;this.pdfLinkService.setDocument(b,i);var j=this.pdfViewer;j.currentScale=c,j.setDocument(b);var k=j.firstPagePromise,l=j.pagesPromise,m=j.onePageRendered;this.pageRotation=0,this.isInitialViewSet=!1,this.pdfThumbnailViewer.setDocument(b),k.then(function(a){e.then(function(){var a=document.createEvent("CustomEvent");a.initCustomEvent("documentload",!0,!0,{}),window.dispatchEvent(a)}),d.loadingBar.setWidth(document.getElementById("viewer")),PDFJS.disableHistory||d.isViewerEmbedded||(d.preferenceShowPreviousViewOnLoad||d.pdfHistory.clearHistoryState(),d.pdfHistory.initialize(d.documentFingerprint),d.pdfHistory.initialDestination?d.initialDestination=d.pdfHistory.initialDestination:d.pdfHistory.initialBookmark&&(d.initialBookmark=d.pdfHistory.initialBookmark));var b={destination:d.initialDestination,bookmark:d.initialBookmark,hash:null};h.initializedPromise.then(function(){var e=null;if(d.preferenceShowPreviousViewOnLoad&&h.get("exists",!1)){var f=h.get("page","1"),g=d.preferenceDefaultZoomValue||h.get("zoom",DEFAULT_SCALE_VALUE),i=h.get("scrollLeft","0"),j=h.get("scrollTop","0"); e="page="+f+"&zoom="+g+","+i+","+j}else d.preferenceDefaultZoomValue&&(e="page=1&zoom="+d.preferenceDefaultZoomValue);d.setInitialView(e,c),b.hash=e,d.isViewerEmbedded||d.pdfViewer.focus()},function(b){console.error(b),d.setInitialView(null,c)}),l.then(function(){(b.destination||b.bookmark||b.hash)&&(d.hasEqualPageSizes||(d.initialDestination=b.destination,d.initialBookmark=b.bookmark,d.pdfViewer.currentScaleValue=d.pdfViewer.currentScaleValue,d.setInitialView(b.hash,c)))})}),l.then(function(){d.supportsPrinting&&b.getJavaScript().then(function(a){a.length&&(console.warn("Warning: JavaScript is not supported"),d.fallback(PDFJS.UNSUPPORTED_FEATURES.javaScript));for(var b=/\bprint\s*\(/,c=0,e=a.length;c div {width:100% !important;height:100% !important;}}",g.appendChild(this.pageStyleSheet),d=0,e=this.pagesCount;d0){var b=document.getElementById("scaleSelect");b.setAttribute("style","min-width: inherit;");var c=b.clientWidth+SCALE_SELECT_CONTAINER_PADDING;b.setAttribute("style","min-width: "+(c+SCALE_SELECT_PADDING)+"px;"),a.setAttribute("style","min-width: "+c+"px; max-width: "+c+"px;")}SecondaryToolbar.setMaxHeight(document.getElementById("viewerContainer"))})},!0),window.addEventListener("scalechange",function(b){document.getElementById("zoomOut").disabled=b.scale===MIN_SCALE,document.getElementById("zoomIn").disabled=b.scale===MAX_SCALE;var c=selectScaleOption(b.presetValue||""+b.scale);if(!c){var d=document.getElementById("customScaleOption"),e=Math.round(1e4*b.scale)/100;d.textContent=mozL10n.get("page_scale_percent",{scale:e},"{{scale}}%"),d.selected=!0}PDFViewerApplication.initialized&&PDFViewerApplication.pdfViewer.update()},!0),window.addEventListener("pagechange",function(b){var c=b.pageNumber;b.previousPageNumber!==c&&(document.getElementById("pageNumber").value=c,PDFViewerApplication.sidebarOpen&&PDFViewerApplication.pdfThumbnailViewer.scrollThumbnailIntoView(c));var d=PDFViewerApplication.pagesCount;if(document.getElementById("previous").disabled=c<=1,document.getElementById("next").disabled=c>=d,document.getElementById("firstPage").disabled=c<=1,document.getElementById("lastPage").disabled=c>=d,PDFJS.pdfBug&&Stats.enabled){var e=PDFViewerApplication.pdfViewer.getPageView(c-1);e.stats&&Stats.add(c,e.stats)}},!0),window.addEventListener("DOMMouseScroll",handleMouseWheel),window.addEventListener("mousewheel",handleMouseWheel),window.addEventListener("click",function(b){SecondaryToolbar.opened&&PDFViewerApplication.pdfViewer.containsElement(b.target)&&SecondaryToolbar.close()},!1),window.addEventListener("keydown",function(b){if(!OverlayManager.active){var c=!1,d=(b.ctrlKey?1:0)|(b.altKey?2:0)|(b.shiftKey?4:0)|(b.metaKey?8:0),e=PDFViewerApplication.pdfViewer,f=e&&e.isInPresentationMode;if(1===d||8===d||5===d||12===d)switch(b.keyCode){case 70:PDFViewerApplication.supportsIntegratedFind||(PDFViewerApplication.findBar.open(),c=!0);break;case 71:PDFViewerApplication.supportsIntegratedFind||(PDFViewerApplication.findBar.dispatchEvent("again",5===d||12===d),c=!0);break;case 61:case 107:case 187:case 171:f||PDFViewerApplication.zoomIn(),c=!0;break;case 173:case 109:case 189:f||PDFViewerApplication.zoomOut(),c=!0;break;case 48:case 96:f||(setTimeout(function(){e.currentScaleValue=DEFAULT_SCALE_VALUE}),c=!1)}if(1===d||8===d)switch(b.keyCode){case 83:PDFViewerApplication.download(),c=!0}if(3===d||10===d)switch(b.keyCode){case 80:PDFViewerApplication.requestPresentationMode(),c=!0;break;case 71:document.getElementById("pageNumber").select(),c=!0}if(c)return void b.preventDefault();var g=document.activeElement||document.querySelector(":focus"),h=g&&g.tagName.toUpperCase();if("INPUT"!==h&&"TEXTAREA"!==h&&"SELECT"!==h||27===b.keyCode){var i=!1;if(0===d)switch(b.keyCode){case 38:case 33:case 8:if(!f&&"page-fit"!==e.currentScaleValue)break;case 37:if(e.isHorizontalScrollbarEnabled)break;case 75:case 80:PDFViewerApplication.page--,c=!0;break;case 27:SecondaryToolbar.opened&&(SecondaryToolbar.close(),c=!0),!PDFViewerApplication.supportsIntegratedFind&&PDFViewerApplication.findBar.opened&&(PDFViewerApplication.findBar.close(),c=!0);break;case 40:case 34:case 32:if(!f&&"page-fit"!==e.currentScaleValue)break;case 39:if(e.isHorizontalScrollbarEnabled)break;case 74:case 78:PDFViewerApplication.page++,c=!0;break;case 36:(f||PDFViewerApplication.page>1)&&(PDFViewerApplication.page=1,c=!0,i=!0);break;case 35:(f||PDFViewerApplication.pdfDocument&&PDFViewerApplication.page=33&&b.keyCode<=40||32===b.keyCode&&"BUTTON"!==h)&&(i=!0),2===d)switch(b.keyCode){case 37:f&&(PDFViewerApplication.pdfHistory.back(),c=!0);break;case 39:f&&(PDFViewerApplication.pdfHistory.forward(),c=!0)}i&&!e.containsElement(g)&&e.focus(),c&&b.preventDefault()}}}),window.addEventListener("beforeprint",function(b){PDFViewerApplication.beforePrint()}),window.addEventListener("afterprint",function(b){PDFViewerApplication.afterPrint()}),function(){PDFViewerApplication.animationStartedPromise=new Promise(function(a){window.requestAnimationFrame(a)})}();