/
var
/
www
/
barefootlaw.org
/
wp-content
/
plugins
/
pdf-poster
/
pdfjs
/
web
/
Upload File
HOME
"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;d<e;++d){var f=b[d].split("="),g=f[0].toLowerCase(),h=f.length>1?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<d;){var e=c+d>>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/f<g/h-d?d===a?[e,f]:[f,e]:d===a?[g,h]:[h,g]}function roundToDivide(a,b){var c=a%b;return 0===c?a:Math.round(a-c+b)}function getVisibleElements(a,b,c){function h(a){var b=a.div,c=b.offsetTop+b.clientTop+b.clientHeight;return c>d}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;s<t&&(j=b[s],k=j.div,l=k.offsetTop+k.clientTop,m=k.clientHeight,!(l>e));s++)p=k.offsetLeft+k.clientLeft,q=k.clientWidth,p+q<f||p>g||(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;d<e;d++){var f=b[d];f.value===a?(f.selected=!0,c=!0):f.selected=!1}return c}function handleMouseWheel(a){var b=40,c="DOMMouseScroll"===a.type?-a.detail:a.wheelDelta/b,d=c<0?"zoomOut":"zoomIn",e=PDFViewerApplication.pdfViewer;if(e.isInPresentationMode)a.preventDefault(),PDFViewerApplication.scrollPresentationMode(c*b);else if(a.ctrlKey||a.metaKey){var f=PDFViewerApplication.supportedMouseWheelZoomModifierKeys;if(a.ctrlKey&&!f.ctrlKey||a.metaKey&&!f.metaKey)return;a.preventDefault();var g=e.currentScale;PDFViewerApplication[d](Math.abs(c));var h=e.currentScale;if(g!==h){var i=h/g-1,j=e.container.getBoundingClientRect(),k=a.clientX-j.left,l=a.clientY-j.top;e.container.scrollLeft+=k*i,e.container.scrollTop+=l*i}}}var DEFAULT_URL="compressed.tracemonkey-pldi-09.pdf",DEFAULT_SCALE_DELTA=1.1,MIN_SCALE=.25,MAX_SCALE=10,SCALE_SELECT_CONTAINER_PADDING=8,SCALE_SELECT_PADDING=22,PAGE_NUMBER_LOADING_INDICATOR="visiblePageIsLoading",DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT=5e3,mozL10n=document.mozL10n||document.webL10n,CSS_UNITS=96/72,DEFAULT_SCALE_VALUE="auto",DEFAULT_SCALE=1,UNKNOWN_SCALE=0,MAX_AUTO_SCALE=1.25,SCROLLBAR_PADDING=40,VERTICAL_PADDING=5,ProgressBar=function(){function b(a,b,c){return Math.min(Math.max(a,b),c)}function c(a,b){this.visible=!0,this.div=document.querySelector(a+" .progress"),this.bar=this.div.parentNode,this.height=b.height||100,this.width=b.width||100,this.units=b.units||"%",this.div.style.height=this.height+this.units,this.percent=0}return c.prototype={updateBar:function(){if(this._indeterminate)return this.div.classList.add("indeterminate"),void(this.div.style.width=this.width+this.units);this.div.classList.remove("indeterminate");var b=this.width*this._percent/100;this.div.style.width=b+this.units},get percent(){return this._percent},set percent(a){this._indeterminate=isNaN(a),this._percent=b(a,0,100),this.updateBar()},setWidth:function(b){if(b){var c=b.parentNode,d=c.offsetWidth-b.offsetWidth;d>0&&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<b.length){var a=b[c];"function"==typeof a.mozPrintCallback?a.mozPrintCallback({context:a.getContext("2d"),abort:g,done:f}):f()}else h(),d.call(window),setTimeout(g,20)}function g(){b&&(b=null,h(),e("afterprint"))}function h(){var a=document.getElementById("mozPrintCallback-shim");if(b&&b.length){var d=Math.round(100*c/b.length),e=a.querySelector("progress"),f=a.querySelector(".relative-progress");e.value=d,f.textContent=d+"%",a.removeAttribute("hidden"),a.onclick=g}else a.setAttribute("hidden","")}if(!("mozPrintCallback"in document.createElement("canvas"))){HTMLCanvasElement.prototype.mozPrintCallback=void 0;var b,c,d=window.print;window.print=function(){if(b)return void console.warn("Ignored window.print() because of a pending print job.");try{e("beforeprint")}finally{b=document.querySelectorAll("canvas"),c=-1,f()}};var i=!!document.attachEvent;if(window.addEventListener("keydown",function(a){if(80===a.keyCode&&(a.ctrlKey||a.metaKey)&&!a.altKey&&(!a.shiftKey||window.chrome||window.opera)){if(window.print(),i)return;return a.preventDefault(),void(a.stopImmediatePropagation?a.stopImmediatePropagation():a.stopPropagation())}27===a.keyCode&&b&&g()},!0),i&&document.attachEvent("onkeydown",function(a){if(a=a||window.event,80===a.keyCode&&a.ctrlKey)return a.keyCode=0,!1}),"onbeforeprint"in window){var j=function(a){"custom"!==a.detail&&a.stopImmediatePropagation&&a.stopImmediatePropagation()};window.addEventListener("beforeprint",j,!1),window.addEventListener("afterprint",j,!1)}}}();var DownloadManager=function(){function b(a,b){var c=document.createElement("a");if(c.click)c.href=a,c.target="_parent","download"in c&&(c.download=b),(document.body||document.documentElement).appendChild(c),c.click(),c.parentNode.removeChild(c);else{if(window.top===window&&a.split("#")[0]===window.location.href.split("#")[0]){var d=a.indexOf("?")===-1?"?":"&";a=a.replace(/#|$/,d+"$&")}window.open(a,"_parent")}}function c(){}return c.prototype={downloadUrl:function(c,d){PDFJS.isValidUrl(c,!0)&&b(c+"#pdfjs.action=download",d)},downloadData:function(c,d,e){if(navigator.msSaveBlob)return navigator.msSaveBlob(new Blob([c],{type:e}),d);var f=PDFJS.createObjectURL(c,e);b(f,d)},download:function(c,d,e){if(!URL)return void this.downloadUrl(d,e);if(navigator.msSaveBlob)return void(navigator.msSaveBlob(c,e)||this.downloadUrl(d,e));var f=URL.createObjectURL(c);b(f,e)}},c}(),DEFAULT_VIEW_HISTORY_CACHE_SIZE=20,ViewHistory=function(){function b(a,b){this.fingerprint=a,this.cacheSize=b||DEFAULT_VIEW_HISTORY_CACHE_SIZE,this.isInitializedPromiseResolved=!1,this.initializedPromise=this._readFromStorage().then(function(a){this.isInitializedPromiseResolved=!0;var b=JSON.parse(a||"{}");"files"in b||(b.files=[]),b.files.length>=this.cacheSize&&b.files.shift();for(var c,d=0,e=b.files.length;d<e;d++){var f=b.files[d];if(f.fingerprint===this.fingerprint){c=d;break}}"number"!=typeof c&&(c=b.files.push({fingerprint:this.fingerprint})-1),this.file=b.files[c],this.database=b}.bind(this))}return b.prototype={_writeToStorage:function(){return new Promise(function(a){var b=JSON.stringify(this.database);localStorage.setItem("database",b),a()}.bind(this))},_readFromStorage:function(){return new Promise(function(a){a(localStorage.getItem("database"))})},set:function(b,c){if(this.isInitializedPromiseResolved)return this.file[b]=c,this._writeToStorage()},setMultiple:function(b){if(this.isInitializedPromiseResolved){for(var c in b)this.file[c]=b[c];return this._writeToStorage()}},get:function(b,c){return this.isInitializedPromiseResolved?this.file[b]||c:c}},b}(),PDFFindBar=function(){function b(a){if(this.opened=!1,this.bar=a.bar||null,this.toggleButton=a.toggleButton||null,this.findField=a.findField||null,this.highlightAll=a.highlightAllCheckbox||null,this.caseSensitive=a.caseSensitiveCheckbox||null,this.findMsg=a.findMsg||null,this.findResultsCount=a.findResultsCount||null,this.findStatusIcon=a.findStatusIcon||null,this.findPreviousButton=a.findPreviousButton||null,this.findNextButton=a.findNextButton||null,this.findController=a.findController||null,null===this.findController)throw new Error("PDFFindBar cannot be used without a PDFFindController instance.");var b=this;this.toggleButton.addEventListener("click",function(){b.toggle()}),this.findField.addEventListener("input",function(){b.dispatchEvent("")}),this.bar.addEventListener("keydown",function(a){switch(a.keyCode){case 13:a.target===b.findField&&b.dispatchEvent("again",a.shiftKey);break;case 27:b.close()}}),this.findPreviousButton.addEventListener("click",function(){b.dispatchEvent("again",!0)}),this.findNextButton.addEventListener("click",function(){b.dispatchEvent("again",!1)}),this.highlightAll.addEventListener("click",function(){b.dispatchEvent("highlightallchange")}),this.caseSensitive.addEventListener("click",function(){b.dispatchEvent("casesensitivitychange")})}return b.prototype={dispatchEvent:function(b,c){var d=document.createEvent("CustomEvent");return d.initCustomEvent("find"+b,!0,!0,{query:this.findField.value,caseSensitive:this.caseSensitive.checked,highlightAll:this.highlightAll.checked,findPrevious:c}),window.dispatchEvent(d)},updateUIState:function(b,c,d){var e=!1,f="",g="";switch(b){case FindStates.FIND_FOUND:break;case FindStates.FIND_PENDING:g="pending";break;case FindStates.FIND_NOTFOUND:f=mozL10n.get("find_not_found",null,"Phrase not found"),e=!0;break;case FindStates.FIND_WRAPPED:f=c?mozL10n.get("find_reached_top",null,"Reached top of document, continued from bottom"):mozL10n.get("find_reached_bottom",null,"Reached end of document, continued from top")}e?this.findField.classList.add("notFound"):this.findField.classList.remove("notFound"),this.findField.setAttribute("data-status",g),this.findMsg.textContent=f,this.updateResultsCount(d)},updateResultsCount:function(a){if(this.findResultsCount){if(!a)return void this.findResultsCount.classList.add("hidden");this.findResultsCount.textContent=a.toLocaleString(),this.findResultsCount.classList.remove("hidden")}},open:function(){this.opened||(this.opened=!0,this.toggleButton.classList.add("toggled"),this.bar.classList.remove("hidden")),this.findField.select(),this.findField.focus()},close:function(){this.opened&&(this.opened=!1,this.toggleButton.classList.remove("toggled"),this.bar.classList.add("hidden"),this.findController.active=!1)},toggle:function(){this.opened?this.close():this.open()}},b}(),FindStates={FIND_FOUND:0,FIND_NOTFOUND:1,FIND_WRAPPED:2,FIND_PENDING:3},FIND_SCROLL_OFFSET_TOP=-50,FIND_SCROLL_OFFSET_LEFT=-400,PDFFindController=function(){function b(a){this.startedTextExtraction=!1,this.extractTextPromises=[],this.pendingFindMatches={},this.active=!1,this.pageContents=[],this.pageMatches=[],this.matchCount=0,this.selected={pageIdx:-1,matchIdx:-1},this.offset={pageIdx:null,matchIdx:null},this.pagesToSearch=null,this.resumePageIdx=null,this.state=null,this.dirtyMatch=!1,this.findTimeout=null,this.pdfViewer=a.pdfViewer||null,this.integratedFind=a.integratedFind||!1,this.charactersToNormalize={"‘":"'","’":"'","‚":"'","‛":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4"},this.findBar=a.findBar||null;var b=Object.keys(this.charactersToNormalize).join("");this.normalizationRegex=new RegExp("["+b+"]","g");var c=["find","findagain","findhighlightallchange","findcasesensitivitychange"];this.firstPagePromise=new Promise(function(a){this.resolveFirstPage=a}.bind(this)),this.handleEvent=this.handleEvent.bind(this);for(var d=0,e=c.length;d<e;d++)window.addEventListener(c[d],this.handleEvent)}return b.prototype={setFindBar:function(b){this.findBar=b},reset:function(){this.startedTextExtraction=!1,this.extractTextPromises=[],this.active=!1},normalize:function(b){var c=this;return b.replace(this.normalizationRegex,function(a){return c.charactersToNormalize[a]})},calcFindMatch:function(b){var c=this.normalize(this.pageContents[b]),d=this.normalize(this.state.query),e=this.state.caseSensitive,f=d.length;if(0!==f){e||(c=c.toLowerCase(),d=d.toLowerCase());for(var g=[],h=-f;;){if(h=c.indexOf(d,h+f),h===-1)break;g.push(h)}this.pageMatches[b]=g,this.updatePage(b),this.resumePageIdx===b&&(this.resumePageIdx=null,this.nextPageMatch()),g.length>0&&(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;i<j;i++)h.push(g[i].str);e.pageContents.push(h.join("")),b[a](a),a+1<e.pdfViewer.pagesCount&&f(a+1)})}if(!this.startedTextExtraction){this.startedTextExtraction=!0,this.pageContents=[];for(var b=[],c=this.pdfViewer.pagesCount,d=0;d<c;d++)this.extractTextPromises.push(new Promise(function(a){b.push(a)}));var e=this;f(0)}},handleEvent:function(b){null!==this.state&&"findagain"===b.type||(this.dirtyMatch=!0),this.state=b.detail,this.updateUIState(FindStates.FIND_PENDING),this.firstPagePromise.then(function(){this.extractText(),clearTimeout(this.findTimeout),"find"===b.type?this.findTimeout=setTimeout(this.nextMatch.bind(this),250):this.nextMatch()}.bind(this))},updatePage:function(b){this.selected.pageIdx===b&&this.pdfViewer.scrollPageIntoView(b+1);var c=this.pdfViewer.getPageView(b);c.textLayer&&c.textLayer.updateMatches()},nextMatch:function(){var b=this.state.findPrevious,c=this.pdfViewer.currentPageNumber-1,d=this.pdfViewer.pagesCount;if(this.active=!0,this.dirtyMatch){this.dirtyMatch=!1,this.selected.pageIdx=this.selected.matchIdx=-1,this.offset.pageIdx=c,this.offset.matchIdx=null,this.hadMatch=!1,this.resumePageIdx=null,this.pageMatches=[],this.matchCount=0;for(var e=this,f=0;f<d;f++)this.updatePage(f),f in this.pendingFindMatches||(this.pendingFindMatches[f]=!0,this.extractTextPromises[f].then(function(a){delete e.pendingFindMatches[a],e.calcFindMatch(a)}))}if(""===this.state.query)return void this.updateUIState(FindStates.FIND_FOUND);if(!this.resumePageIdx){var g=this.offset;if(this.pagesToSearch=d,null!==g.matchIdx){var h=this.pageMatches[g.pageIdx].length;if(!b&&g.matchIdx+1<h||b&&g.matchIdx>0)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.uid<this.currentUid){var c=this._getPreviousParams(!0);if(c)return this._pushToHistory(this.current,!1),this._pushToHistory(c,!1),this.currentUid=b.uid,void window.history.back()}this.historyUnlocked=!1,b.target.dest?this.linkService.navigateTo(b.target.dest):this.linkService.setHash(b.target.hash),this.currentUid=b.uid,b.uid>this.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.uid<this.uid-1&&window.history.forward()}}},a}(),SecondaryToolbar={opened:!1,previousContainerHeight:null,newContainerHeight:null,initialize:function(b){this.toolbar=b.toolbar,this.buttonContainer=this.toolbar.firstElementChild,this.toggleButton=b.toggleButton,this.presentationModeButton=b.presentationModeButton,this.print=b.print,this.download=b.download,this.viewBookmark=b.viewBookmark,this.firstPage=b.firstPage,this.lastPage=b.lastPage,this.pageRotateCw=b.pageRotateCw,this.pageRotateCcw=b.pageRotateCcw;var c=[{element:this.toggleButton,handler:this.toggle},{element:this.presentationModeButton,handler:this.presentationModeClick},{element:this.print,handler:this.printClick},{element:this.download,handler:this.downloadClick},{element:this.viewBookmark,handler:this.viewBookmarkClick},{element:this.firstPage,handler:this.firstPageClick},{element:this.lastPage,handler:this.lastPageClick},{element:this.pageRotateCw,handler:this.pageRotateCwClick},{element:this.pageRotateCcw,handler:this.pageRotateCcwClick}];for(var d in c){var e=c[d].element;e&&e.addEventListener("click",c[d].handler.bind(this))}},presentationModeClick:function(b){PDFViewerApplication.requestPresentationMode(),this.close()},printClick:function(b){window.print(),this.close()},downloadClick:function(b){PDFViewerApplication.download(),this.close()},viewBookmarkClick:function(b){this.close()},firstPageClick:function(b){PDFViewerApplication.page=1,this.close()},lastPageClick:function(b){PDFViewerApplication.pdfDocument&&(PDFViewerApplication.page=PDFViewerApplication.pagesCount),this.close()},pageRotateCwClick:function(b){PDFViewerApplication.rotatePages(90)},pageRotateCcwClick:function(b){PDFViewerApplication.rotatePages(-90)},setMaxHeight:function(b){b&&this.buttonContainer&&(this.newContainerHeight=b.clientHeight,this.previousContainerHeight!==this.newContainerHeight&&(this.buttonContainer.setAttribute("style","max-height: "+(this.newContainerHeight-SCROLLBAR_PADDING)+"px;"),this.previousContainerHeight=this.newContainerHeight))},open:function(){this.opened||(this.opened=!0,this.toggleButton.classList.add("toggled"),this.toolbar.classList.remove("hidden"))},close:function(b){this.opened&&(b&&!this.toolbar.contains(b)||(this.opened=!1,this.toolbar.classList.add("hidden"),this.toggleButton.classList.remove("toggled")))},toggle:function(){this.opened?this.close():this.open()}},DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS=1500,DELAY_BEFORE_HIDING_CONTROLS=3e3,ACTIVE_SELECTOR="pdfPresentationMode",CONTROLS_SELECTOR="pdfPresentationModeControls",PDFPresentationMode=function(){function b(a){this.container=a.container,this.viewer=a.viewer||a.container.firstElementChild,this.pdfViewer=a.pdfViewer,this.pdfThumbnailViewer=a.pdfThumbnailViewer||null;var b=a.contextMenuItems||null;if(this.active=!1,this.args=null,this.contextMenuOpen=!1,this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0,b)for(var c=0,d=b.length;c<d;c++){var e=b[c];e.element.addEventListener("click",function(a){this.contextMenuOpen=!1,a()}.bind(this,e.handler))}}return b.prototype={request:function(){if(this.switchInProgress||this.active||!this.viewer.hasChildNodes())return!1;if(this._addFullscreenChangeListeners(),this._setSwitchInProgress(),this._notifyStateChange(),this.container.requestFullscreen)this.container.requestFullscreen();else if(this.container.mozRequestFullScreen)this.container.mozRequestFullScreen();else if(this.container.webkitRequestFullscreen)this.container.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);else{if(!this.container.msRequestFullscreen)return!1;this.container.msRequestFullscreen()}return this.args={page:this.pdfViewer.currentPageNumber,previousScale:this.pdfViewer.currentScaleValue},!0},mouseScroll:function(b){if(this.active){var c=50,d=120,e={UP:-1,DOWN:1},f=(new Date).getTime(),g=this.mouseScrollTimeStamp;if(!(f>g&&f-g<c)&&((this.mouseScrollDelta>0&&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<f;++g){var h=e[g].view;if(!this.isViewFinished(h))return h}if(d){var i=b.last.id;if(c[i]&&!this.isViewFinished(c[i]))return c[i]}else{var j=b.first.id-2;if(c[j]&&!this.isViewFinished(c[j]))return c[j]}return null},isViewFinished:function(b){return b.renderingState===RenderingStates.FINISHED},renderView:function(b){var c=b.renderingState;switch(c){case RenderingStates.FINISHED:return!1;case RenderingStates.PAUSED:this.highestPriorityPage=b.renderingId,b.resume();break;case RenderingStates.RUNNING:this.highestPriorityPage=b.renderingId;break;case RenderingStates.INITIAL:this.highestPriorityPage=b.renderingId;var d=function(){this.renderHighestPriority()}.bind(this);b.draw().then(d,d)}return!0}},b}(),TEXT_LAYER_RENDER_DELAY=200,PDFPageView=function(){function b(a){var b=a.container,c=a.id,d=a.scale,e=a.defaultViewport,f=a.renderingQueue,g=a.textLayerFactory,h=a.annotationLayerFactory;this.id=c,this.renderingId="page"+c,this.rotation=0,this.scale=d||DEFAULT_SCALE,this.viewport=e,this.pdfPageRotate=e.rotation,this.hasRestrictedScaling=!1,this.renderingQueue=f,this.textLayerFactory=g,this.annotationLayerFactory=h,this.renderingState=RenderingStates.INITIAL,this.resume=null,this.onBeforeDraw=null,this.onAfterDraw=null,this.textLayer=null,this.zoomLayer=null,this.annotationLayer=null;var i=document.createElement("div");i.id="pageContainer"+this.id,i.className="page",i.style.width=Math.floor(this.viewport.width)+"px",i.style.height=Math.floor(this.viewport.height)+"px",i.setAttribute("data-page-number",this.id),this.div=i,b.appendChild(i)}return b.prototype={setPdfPage:function(b){this.pdfPage=b,this.pdfPageRotate=b.rotate;var c=(this.rotation+this.pdfPageRotate)%360;this.viewport=b.getViewport(this.scale*CSS_UNITS,c),this.stats=b.stats,this.reset()},destroy:function(){this.zoomLayer=null,this.reset(),this.pdfPage&&this.pdfPage.cleanup()},reset:function(b,c){this.renderTask&&this.renderTask.cancel(),this.resume=null,this.renderingState=RenderingStates.INITIAL;var d=this.div;d.style.width=Math.floor(this.viewport.width)+"px",d.style.height=Math.floor(this.viewport.height)+"px";for(var e=d.childNodes,f=b&&this.zoomLayer||null,g=c&&this.annotationLayer&&this.annotationLayer.div||null,h=e.length-1;h>=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<j;i++){for(var k=b[i];c!==f&&k>=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<n;o++){var p=b[o],q=p.begin,r=p.end,s=g&&o===h,t=s?" selected":"";if(this.findController&&this.findController.updateMatchPosition(f,o,d,q.divIdx,r.divIdx),e&&q.divIdx===e.divIdx?l(e.divIdx,e.offset,q.offset):(null!==e&&l(e.divIdx,e.offset,j.offset),k(q)),q.divIdx===r.divIdx)l(q.divIdx,q.offset,r.offset,"highlight"+t);else{l(q.divIdx,q.offset,j.offset,"highlight begin"+t);for(var u=q.divIdx+1,v=r.divIdx;u<v;u++)d[u].className="highlight middle"+t;k(r,"highlight end"+t)}e=r}e&&l(e.divIdx,e.offset,j.offset)}},updateMatches:function(){if(this.renderingDone){for(var b=this.matches,c=this.textDivs,d=this.textContent.items,e=-1,f=0,g=b.length;f<g;f++){for(var h=b[f],i=Math.max(e,h.begin.divIdx),j=i,k=h.end.divIdx;j<=k;j++){var l=c[j];l.textContent=d[j].str,l.className=""}e=h.end.divIdx+1}null!==this.findController&&this.findController.active&&(this.matches=this.convertMatches(null===this.findController?[]:this.findController.pageMatches[this.pageIdx]||[]),this.renderMatches(this.matches))}},_bindMouse:function(){var b=this.textLayerDiv;b.addEventListener("mousedown",function(a){var c=b.querySelector(".endOfContent");if(c){var d=a.target!==b;if(d=d&&"none"!==window.getComputedStyle(c).getPropertyValue("-moz-user-select")){var e=b.getBoundingClientRect(),f=Math.max(0,(a.pageY-e.top)/e.height);c.style.top=(100*f).toFixed(2)+"%"}c.classList.add("active")}}),b.addEventListener("mouseup",function(a){var c=b.querySelector(".endOfContent");c&&(c.style.top="",c.classList.remove("active"))})}},b}();DefaultTextLayerFactory.prototype={createTextLayerBuilder:function(a,b,c){return new TextLayerBuilder({textLayerDiv:a,pageIndex:b,viewport:c})}};var AnnotationLayerBuilder=function(){function b(a){this.pageDiv=a.pageDiv,this.pdfPage=a.pdfPage,this.linkService=a.linkService,this.div=null}return b.prototype={render:function(b,c){var d=this,e={intent:void 0===c?"display":c};this.pdfPage.getAnnotations(e).then(function(a){if(b=b.clone({dontFlip:!0}),e={viewport:b,div:d.div,annotations:a,page:d.pdfPage,linkService:d.linkService},d.div)PDFJS.AnnotationLayer.update(e);else{ if(0===a.length)return;d.div=document.createElement("div"),d.div.className="annotationLayer",d.pageDiv.appendChild(d.div),e.div=d.div,PDFJS.AnnotationLayer.render(e),"undefined"!=typeof mozL10n&&mozL10n.translate(d.div)}})},hide:function(){this.div&&this.div.setAttribute("hidden","true")}},b}();DefaultAnnotationLayerFactory.prototype={createAnnotationLayerBuilder:function(a,b){return new AnnotationLayerBuilder({pageDiv:a,pdfPage:b,linkService:new SimpleLinkService})}};var PDFViewer=function(){function b(a){var b=[];this.push=function(d){var e=b.indexOf(d);e>=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,0<a&&a<=this.pagesCount?(b.previousPageNumber=this._currentPageNumber,this._currentPageNumber=a,b.pageNumber=a,this.container.dispatchEvent(b),void(this.updateInProgress||this.scrollPageIntoView(a))):(b.pageNumber=this._currentPageNumber,b.previousPageNumber=a,void this.container.dispatchEvent(b))},get currentScale(){return this._currentScale!==UNKNOWN_SCALE?this._currentScale:DEFAULT_SCALE},set currentScale(a){if(isNaN(a))throw new Error("Invalid numeric scale");return this.pdfDocument?void this._setScale(a,!1):(this._currentScale=a,void(this._currentScaleValue=a!==UNKNOWN_SCALE?a.toString():null))},get currentScaleValue(){return this._currentScaleValue},set currentScaleValue(a){return this.pdfDocument?void this._setScale(a,!1):(this._currentScale=isNaN(a)?UNKNOWN_SCALE:a,void(this._currentScaleValue=a))},get pagesRotation(){return this._pagesRotation},set pagesRotation(a){this._pagesRotation=a;for(var b=0,c=this._pages.length;b<c;b++){var d=this._pages[b];d.update(d.scale,a)}this._setScale(this._currentScaleValue,!0),this.defaultRenderingQueue&&this.update()},setDocument:function(a){if(this.pdfDocument&&this._resetView(),this.pdfDocument=a,a){var d,b=a.numPages,c=this,e=new Promise(function(a){d=a});this.pagesPromise=e,e.then(function(){var a=document.createEvent("CustomEvent");a.initCustomEvent("pagesloaded",!0,!0,{pagesCount:b}),c.container.dispatchEvent(a)});var f=!1,g=null,h=new Promise(function(a){g=a});this.onePageRendered=h;var i=function(a){a.onBeforeDraw=function(){c._buffer.push(this)},a.onAfterDraw=function(){f||(f=!0,g())}},j=a.getPage(1);return this.firstPagePromise=j,j.then(function(e){for(var f=this.currentScale,g=e.getViewport(f*CSS_UNITS),j=1;j<=b;++j){var k=null;PDFJS.disableTextLayer||(k=this);var l=new PDFPageView({container:this.viewer,id:j,scale:f,defaultViewport:g.clone(),renderingQueue:this.renderingQueue,textLayerFactory:k,annotationLayerFactory:this});i(l),this._pages.push(l)}var m=this.linkService;h.then(function(){if(PDFJS.disableAutoFetch)d();else for(var e=b,f=1;f<=b;++f)a.getPage(f).then(function(a,b){var f=c._pages[a-1];f.pdfPage||f.setPdfPage(b),m.cachePageRef(a,b.ref),e--,e||d()}.bind(null,f))});var n=document.createEvent("CustomEvent");n.initCustomEvent("pagesinit",!0,!0,null),c.container.dispatchEvent(n),this.defaultRenderingQueue&&this.update(),this.findController&&this.findController.resolveFirstPage()}.bind(this))}},_resetView:function(){this._pages=[],this._currentPageNumber=1,this._currentScale=UNKNOWN_SCALE,this._currentScaleValue=null,this._buffer=new b(DEFAULT_CACHE_SIZE),this._location=null,this._pagesRotation=0,this._pagesRequests=[];for(var a=this.viewer;a.hasChildNodes();)a.removeChild(a.lastChild)},_scrollUpdate:function(){if(0!==this.pagesCount){this.update();for(var b=0,c=this._pages.length;b<c;b++)this._pages[b].updatePosition()}},_setScaleDispatchEvent:function(b,c,d){var e=document.createEvent("UIEvents");e.initUIEvent("scalechange",!0,!0,window,0),e.scale=b,d&&(e.presetValue=c),this.container.dispatchEvent(e)},_setScaleUpdatePages:function(b,d,e,f){if(this._currentScaleValue=d,c(this._currentScale,b))return void(f&&this._setScaleDispatchEvent(b,d,!0));for(var g=0,h=this._pages.length;g<h;g++)this._pages[g].update(b);if(this._currentScale=b,!e){var j,i=this._currentPageNumber;!this._location||IGNORE_CURRENT_POSITION_ON_ZOOM||this.isInPresentationMode||this.isChangingPresentationMode||(i=this._location.pageNumber,j=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView(i,j)}this._setScaleDispatchEvent(b,d,f),this.defaultRenderingQueue&&this.update()},_setScale:function(b,c){var d=parseFloat(b);if(d>0)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;g<h;++g){var j=c[g];if(j.percent<100)break;if(j.id===e){i=!0;break}}i||(e=c[0].id),this.isInPresentationMode||(this.currentPageNumber=e),this._updateLocation(f),this.updateInProgress=!1;var k=document.createEvent("UIEvents");k.initUIEvent("updateviewarea",!0,!0,window,0),k.location=this._location,this.container.dispatchEvent(k)}},containsElement:function(a){return this.container.contains(a)},focus:function(){this.container.focus()},get isInPresentationMode(){return this.presentationModeState===PresentationModeState.FULLSCREEN},get isChangingPresentationMode(){return this.presentationModeState===PresentationModeState.CHANGING},get isHorizontalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollWidth>this.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<b;a++)this._pages[a]&&this._pages[a].renderingState!==RenderingStates.FINISHED&&this._pages[a].reset()},_ensurePdfPageLoaded:function(a){if(a.pdfPage)return Promise.resolve(a.pdfPage);var b=a.id;if(this._pagesRequests[b])return this._pagesRequests[b];var c=this.pdfDocument.getPage(b).then(function(c){return a.setPdfPage(c),this._pagesRequests[b]=null,c}.bind(this));return this._pagesRequests[b]=c,c},forceRendering:function(a){var b=a||this._getVisiblePages(),c=this.renderingQueue.getHighestPriority(b,this._pages,this.scroll.down);return!!c&&(this._ensurePdfPageLoaded(c).then(function(){this.renderingQueue.renderView(c)}.bind(this)),!0)},getPageTextContent:function(a){return this.pdfDocument.getPage(a+1).then(function(a){return a.getTextContent({normalizeWhitespace:!0})})},createTextLayerBuilder:function(a,b,c){return new TextLayerBuilder({textLayerDiv:a,pageIndex:b,viewport:c,findController:this.isInPresentationMode?null:this.findController})},createAnnotationLayerBuilder:function(a,b){return new AnnotationLayerBuilder({pageDiv:a,pdfPage:b,linkService:this.linkService})},setFindController:function(a){this.findController=a}},d}(),SimpleLinkService=function(){function b(){}return b.prototype={get page(){return 0},set page(a){},navigateTo:function(a){},getDestinationHash:function(a){return"#"},getAnchorUrl:function(a){return"#"},setHash:function(a){},executeNamedAction:function(a){},cachePageRef:function(a,b){}},b}(),THUMBNAIL_SCROLL_MARGIN=-19,THUMBNAIL_WIDTH=98,THUMBNAIL_CANVAS_BORDER_WIDTH=1,PDFThumbnailView=function(){function b(a,b){var d=c.tempImageCache;d||(d=document.createElement("canvas"),c.tempImageCache=d),d.width=a,d.height=b,d.mozOpaque=!0;var e=d.getContext("2d",{alpha:!1});return e.save(),e.fillStyle="rgb(255, 255, 255)",e.fillRect(0,0,a,b),e.restore(),d}function c(a){var b=a.container,c=a.id,d=a.defaultViewport,e=a.linkService,f=a.renderingQueue;this.id=c,this.renderingId="thumbnail"+c,this.pdfPage=null,this.rotation=0,this.viewport=d,this.pdfPageRotate=d.rotation,this.linkService=e,this.renderingQueue=f,this.hasImage=!1,this.resume=null,this.renderingState=RenderingStates.INITIAL,this.pageWidth=this.viewport.width,this.pageHeight=this.viewport.height,this.pageRatio=this.pageWidth/this.pageHeight,this.canvasWidth=THUMBNAIL_WIDTH,this.canvasHeight=this.canvasWidth/this.pageRatio|0,this.scale=this.canvasWidth/this.pageWidth;var g=document.createElement("a");g.href=e.getAnchorUrl("#page="+c),g.title=mozL10n.get("thumb_page_title",{page:c},"Page {{page}}"),g.onclick=function(){return e.page=c,!1};var h=document.createElement("div");h.id="thumbnailContainer"+c,h.className="thumbnail",this.div=h,1===c&&h.classList.add("selected");var i=document.createElement("div");i.className="thumbnailSelectionRing";var j=2*THUMBNAIL_CANVAS_BORDER_WIDTH;i.style.width=this.canvasWidth+j+"px",i.style.height=this.canvasHeight+j+"px",this.ring=i,h.appendChild(i),g.appendChild(h),b.appendChild(g)}return c.prototype={setPdfPage:function(b){this.pdfPage=b,this.pdfPageRotate=b.rotate;var c=(this.rotation+this.pdfPageRotate)%360;this.viewport=b.getViewport(1,c),this.reset()},reset:function(){this.renderTask&&this.renderTask.cancel(),this.hasImage=!1,this.resume=null,this.renderingState=RenderingStates.INITIAL,this.pageWidth=this.viewport.width,this.pageHeight=this.viewport.height,this.pageRatio=this.pageWidth/this.pageHeight,this.canvasHeight=this.canvasWidth/this.pageRatio|0,this.scale=this.canvasWidth/this.pageWidth,this.div.removeAttribute("data-loaded");for(var b=this.ring,c=b.childNodes,d=c.length-1;d>=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<<g,i=f.height<<g,j=b(h,i),k=j.getContext("2d");h>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;b<c;b++){var d=this.thumbnails[b];d.update(a)}},cleanup:function(){var b=PDFThumbnailView.tempImageCache;b&&(b.width=0,b.height=0),PDFThumbnailView.tempImageCache=null},_resetView:function(){this.thumbnails=[],this._pagesRotation=0,this._pagesRequests=[]},setDocument:function(b){if(this.pdfDocument){for(var c=this.container;c.hasChildNodes();)c.removeChild(c.lastChild);this._resetView()}return this.pdfDocument=b,b?b.getPage(1).then(function(a){for(var c=b.numPages,d=a.getViewport(1),e=1;e<=c;++e){var f=new PDFThumbnailView({container:this.container,id:e,defaultViewport:d.clone(),linkService:this.linkService,renderingQueue:this.renderingQueue});this.thumbnails.push(f)}}.bind(this)):Promise.resolve()},_ensurePdfPageLoaded:function(b){if(b.pdfPage)return Promise.resolve(b.pdfPage);var c=b.id;if(this._pagesRequests[c])return this._pagesRequests[c];var d=this.pdfDocument.getPage(c).then(function(a){return b.setPdfPage(a),this._pagesRequests[c]=null,a}.bind(this));return this._pagesRequests[c]=d,d},ensureThumbnailVisible:function(b){scrollIntoView(document.getElementById("thumbnailContainer"+b))},forceRendering:function(){var a=this._getVisibleThumbs(),b=this.renderingQueue.getHighestPriority(a,this.thumbnails,this.scroll.down);return!!b&&(this._ensurePdfPageLoaded(b).then(function(){this.renderingQueue.renderView(b)}.bind(this)),!0)}},b}(),PDFOutlineView=function(){function b(a){this.container=a.container,this.outline=a.outline,this.linkService=a.linkService,this.lastToggleIsShow=!0}return b.prototype={reset:function(){for(var b=this.container;b.firstChild;)b.removeChild(b.firstChild);this.lastToggleIsShow=!0},_dispatchEvent:function(b){var c=document.createEvent("CustomEvent");c.initCustomEvent("outlineloaded",!0,!0,{outlineCount:b}),this.container.dispatchEvent(c)},_bindLink:function(b,c){if(c.url)return void PDFJS.addLinkAttributes(b,{url:c.url});var d=this.linkService;b.href=d.getDestinationHash(c.dest),b.onclick=function(b){return d.navigateTo(c.dest),!1}},_addToggleButton:function(b){var c=document.createElement("div");c.className="outlineItemToggler",c.onclick=function(a){if(a.stopPropagation(),c.classList.toggle("outlineItemsHidden"),a.shiftKey){var d=!c.classList.contains("outlineItemsHidden");this._toggleOutlineItem(b,d)}}.bind(this),b.insertBefore(c,b.firstChild)},_toggleOutlineItem:function(b,c){this.lastToggleIsShow=c;for(var d=b.querySelectorAll(".outlineItemToggler"),e=0,f=d.length;e<f;++e)d[e].classList[c?"remove":"add"]("outlineItemsHidden")},toggleOutlineTree:function(){this._toggleOutlineItem(this.container,!this.lastToggleIsShow)},render:function(){var b=this.outline,c=0;if(this.reset(),!b)return void this._dispatchEvent(c);for(var d=document.createDocumentFragment(),e=[{parent:d,items:this.outline}],f=!1;e.length>0;)for(var g=e.shift(),h=0,i=g.items.length;h<i;h++){var j=g.items[h],k=document.createElement("div");k.className="outlineItem";var l=document.createElement("a");if(this._bindLink(l,j),l.textContent=PDFJS.removeNullCharacters(j.title),k.appendChild(l),j.items.length>0){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&&c<MAX_SCALE);this.pdfViewer.currentScaleValue=c},zoomOut:function(b){var c=this.pdfViewer.currentScale;do c=(c/DEFAULT_SCALE_DELTA).toFixed(2),c=Math.floor(10*c)/10,c=Math.max(MIN_SCALE,c);while(--b>0&&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<e;c++){var f=a[c];if(f&&b.test(f))return void setTimeout(function(){window.print()})}})});var n=[l,this.animationStartedPromise];Promise.all(n).then(function(){b.getOutline().then(function(a){var b=document.getElementById("outlineView");d.outline=new PDFOutlineView({container:b,outline:a,linkService:d.pdfLinkService}),d.outline.render(),document.getElementById("viewOutline").disabled=!a,a||b.classList.contains("hidden")||d.switchSidebarView("thumbs"),a&&d.preferenceSidebarViewOnLoad===SidebarView.OUTLINE&&d.switchSidebarView("outline",!0)})}),d.preferenceSidebarViewOnLoad===SidebarView.THUMBS&&Promise.all([k,m]).then(function(){d.switchSidebarView("thumbs",!0)}),b.getMetadata().then(function(a){var c=a.info,e=a.metadata;d.documentInfo=c,d.metadata=e,console.log("PDF "+b.fingerprint+" ["+c.PDFFormatVersion+" "+(c.Producer||"-").trim()+" / "+(c.Creator||"-").trim()+"] (PDF.js: "+(PDFJS.version||"-")+(PDFJS.disableWebGL?"":" [WebGL]")+")");var f;if(e&&e.has("dc:title")){var g=e.get("dc:title");"Untitled"!==g&&(f=g)}!f&&c&&c.Title&&(f=c.Title),f&&d.setTitle(f+" - "+document.title),c.IsAcroFormPresent&&(console.warn("Warning: AcroForm/XFA is not supported"),d.fallback(PDFJS.UNSUPPORTED_FEATURES.forms))})},setInitialView:function(b,c){this.isInitialViewSet=!0,document.getElementById("pageNumber").value=this.pdfViewer.currentPageNumber,this.initialDestination?(this.pdfLinkService.navigateTo(this.initialDestination),this.initialDestination=null):this.initialBookmark?(this.pdfLinkService.setHash(this.initialBookmark),this.pdfHistory.push({hash:this.initialBookmark},!0),this.initialBookmark=null):b?this.pdfLinkService.setHash(b):c&&(this.pdfViewer.currentScaleValue=c,this.page=1),this.pdfViewer.currentScaleValue||(this.pdfViewer.currentScaleValue=DEFAULT_SCALE_VALUE)},cleanup:function(){this.pdfDocument&&(this.pdfViewer.cleanup(),this.pdfThumbnailViewer.cleanup(),this.pdfDocument.cleanup())},forceRendering:function(){this.pdfRenderingQueue.printing=this.printing,this.pdfRenderingQueue.isThumbnailViewEnabled=this.sidebarOpen,this.pdfRenderingQueue.renderHighestPriority()},refreshThumbnailViewer:function(){for(var b=this.pdfViewer,c=this.pdfThumbnailViewer,d=b.pagesCount,e=0;e<d;e++){var f=b.getPageView(e);if(f&&f.renderingState===RenderingStates.FINISHED){var g=c.getThumbnail(e);g.setImage(f)}}c.scrollThumbnailIntoView(this.page)},switchSidebarView:function(b,c){c&&!this.sidebarOpen&&document.getElementById("sidebarToggle").click();var d=document.getElementById("thumbnailView"),e=document.getElementById("outlineView"),f=document.getElementById("viewThumbnail"),g=document.getElementById("viewOutline");switch(b){case"thumbs":var h=d.classList.contains("hidden");f.classList.add("toggled"),g.classList.remove("toggled"),d.classList.remove("hidden"),e.classList.add("hidden"),this.forceRendering(),h&&this.pdfThumbnailViewer.ensureThumbnailVisible(this.page);break;case"outline":if(g.disabled)return;f.classList.remove("toggled"),g.classList.add("toggled"),d.classList.add("hidden"),e.classList.remove("hidden")}},beforePrint:function(){if(!this.supportsPrinting){var b=mozL10n.get("printing_not_supported",null,"Warning: Printing is not fully supported by this browser.");return void this.error(b)}var d,e,c=!1;if(this.pdfDocument&&this.pagesCount){for(d=0,e=this.pagesCount;d<e;++d)if(!this.pdfViewer.getPageView(d).pdfPage){c=!0;break}}else c=!0;if(c){var f=mozL10n.get("printing_not_ready",null,"Warning: The PDF is not fully loaded for printing.");return void window.alert(f)}this.printing=!0,this.forceRendering();var g=document.querySelector("body");g.setAttribute("data-mozPrintCallback",!0),this.hasEqualPageSizes||console.warn("Not all pages have the same size. The printed result may be incorrect!"),this.pageStyleSheet=document.createElement("style");var h=this.pdfViewer.getPageView(0).pdfPage.getViewport(1);for(this.pageStyleSheet.textContent="@supports ((size:A4) and (size:1pt 1pt)) {@page { size: "+h.width+"pt "+h.height+"pt;}#printContainer {height:100%}#printContainer > div {width:100% !important;height:100% !important;}}",g.appendChild(this.pageStyleSheet),d=0,e=this.pagesCount;d<e;++d)this.pdfViewer.getPageView(d).beforePrint()},get hasEqualPageSizes(){for(var a=this.pdfViewer.getPageView(0),b=1,c=this.pagesCount;b<c;++b){var d=this.pdfViewer.getPageView(b);if(d.width!==a.width||d.height!==a.height)return!1}return!0},afterPrint:function(){for(var b=document.getElementById("printContainer");b.hasChildNodes();)b.removeChild(b.lastChild);this.pageStyleSheet&&this.pageStyleSheet.parentNode&&(this.pageStyleSheet.parentNode.removeChild(this.pageStyleSheet),this.pageStyleSheet=null),this.printing=!1,this.forceRendering()},rotatePages:function(b){var c=this.page;this.pageRotation=(this.pageRotation+360+b)%360,this.pdfViewer.pagesRotation=this.pageRotation,this.pdfThumbnailViewer.pagesRotation=this.pageRotation,this.forceRendering(),this.pdfViewer.scrollPageIntoView(c)},requestPresentationMode:function(){this.pdfPresentationMode&&this.pdfPresentationMode.request()},scrollPresentationMode:function(b){this.pdfPresentationMode&&this.pdfPresentationMode.mouseScroll(b)}};window.PDFView=PDFViewerApplication;var HOSTED_VIEWER_ORIGINS=["null","http://mozilla.github.io","https://mozilla.github.io"];document.addEventListener("DOMContentLoaded",webViewerLoad,!0),document.addEventListener("pagerendered",function(a){var b=a.detail.pageNumber,c=b-1,d=PDFViewerApplication.pdfViewer.getPageView(c);if(PDFViewerApplication.sidebarOpen){var e=PDFViewerApplication.pdfThumbnailViewer.getThumbnail(c);e.setImage(d)}if(PDFJS.pdfBug&&Stats.enabled&&d.stats&&Stats.add(b,d.stats),d.error&&PDFViewerApplication.error(mozL10n.get("rendering_error",null,"An error occurred while rendering the page."),d.error),b===PDFViewerApplication.page){var f=document.getElementById("pageNumber");f.classList.remove(PAGE_NUMBER_LOADING_INDICATOR)}},!0),document.addEventListener("textlayerrendered",function(a){var b=a.detail.pageNumber-1;PDFViewerApplication.pdfViewer.getPageView(b)},!0),document.addEventListener("pagemode",function(a){if(PDFViewerApplication.initialized){var b=a.detail.mode;switch(b){case"bookmarks":b="outline";case"thumbs":PDFViewerApplication.switchSidebarView(b,!0);break;case"none":PDFViewerApplication.sidebarOpen&&document.getElementById("sidebarToggle").click()}}},!0),document.addEventListener("namedaction",function(a){if(PDFViewerApplication.initialized){var b=a.detail.action;switch(b){case"GoToPage":document.getElementById("pageNumber").focus();break;case"Find":PDFViewerApplication.supportsIntegratedFind||PDFViewerApplication.findBar.toggle()}}},!0),window.addEventListener("presentationmodechanged",function(a){var b=a.detail.active,c=a.detail.switchInProgress;PDFViewerApplication.pdfViewer.presentationModeState=c?PresentationModeState.CHANGING:b?PresentationModeState.FULLSCREEN:PresentationModeState.NORMAL}),window.addEventListener("updateviewarea",function(a){if(PDFViewerApplication.initialized){var b=a.location;PDFViewerApplication.store.initializedPromise.then(function(){PDFViewerApplication.store.setMultiple({exists:!0,page:b.pageNumber,zoom:b.scale,scrollLeft:b.left,scrollTop:b.top}).catch(function(){})});PDFViewerApplication.pdfLinkService.getAnchorUrl(b.pdfOpenParams);PDFViewerApplication.pdfHistory.updateCurrentBookmark(b.pdfOpenParams,b.pageNumber);var d=document.getElementById("pageNumber"),e=PDFViewerApplication.pdfViewer.getPageView(PDFViewerApplication.page-1);e.renderingState===RenderingStates.FINISHED?d.classList.remove(PAGE_NUMBER_LOADING_INDICATOR):d.classList.add(PAGE_NUMBER_LOADING_INDICATOR)}},!0),window.addEventListener("resize",function(b){if(PDFViewerApplication.initialized){var c=PDFViewerApplication.pdfViewer.currentScaleValue;"auto"===c||"page-fit"===c||"page-width"===c?PDFViewerApplication.pdfViewer.currentScaleValue=c:c||(PDFViewerApplication.pdfViewer.currentScaleValue=DEFAULT_SCALE_VALUE),PDFViewerApplication.pdfViewer.update()}SecondaryToolbar.setMaxHeight(document.getElementById("viewerContainer"))}),window.addEventListener("hashchange",function(b){if(PDFViewerApplication.pdfHistory.isHashChangeUnlocked){var c=document.location.hash.substring(1);if(!c)return;PDFViewerApplication.isInitialViewSet?PDFViewerApplication.pdfLinkService.setHash(c):PDFViewerApplication.initialBookmark=c}}),window.addEventListener("change",function(b){var c=b.target.files;if(c&&0!==c.length){var d=c[0];if(!PDFJS.disableCreateObjectURL&&"undefined"!=typeof URL&&URL.createObjectURL)PDFViewerApplication.open(URL.createObjectURL(d));else{var e=new FileReader;e.onload=function(b){var c=b.target.result,d=new Uint8Array(c);PDFViewerApplication.open(d)},e.readAsArrayBuffer(d)}PDFViewerApplication.setTitleUsingUrl(d.name),document.getElementById("viewBookmark").setAttribute("hidden","true"),document.getElementById("secondaryViewBookmark").setAttribute("hidden","true"),document.getElementById("download").setAttribute("hidden","true"),document.getElementById("secondaryDownload").setAttribute("hidden","true")}},!0),window.addEventListener("localized",function(b){document.getElementsByTagName("html")[0].dir=mozL10n.getDirection(),PDFViewerApplication.animationStartedPromise.then(function(){var a=document.getElementById("scaleSelectContainer");if(0===a.clientWidth&&a.setAttribute("style","display: inherit;"),a.clientWidth>0){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<PDFViewerApplication.pagesCount)&&(PDFViewerApplication.page=PDFViewerApplication.pagesCount,c=!0,i=!0);break;case 72:f||HandTool.toggle();break;case 82:PDFViewerApplication.rotatePages(90)}if(4===d)switch(b.keyCode){case 32:if(!f&&"page-fit"!==e.currentScaleValue)break;PDFViewerApplication.page--,c=!0;break;case 82:PDFViewerApplication.rotatePages(-90)}if(c||f||(b.keyCode>=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)})}();