From 9d432c5f903cec467a0498d2f1fb7acc667fcc9f Mon Sep 17 00:00:00 2001 From: pdfjsbot Date: Wed, 3 May 2017 19:19:04 +0000 Subject: [PATCH] PDF.js version 1.8.310 - See mozilla/pdf.js@e42fc546a0b4b9e8b47f0005610bfcf4ec405ee2 --- bower.json | 2 +- build/pdf.combined.js | 12 ++++++------ build/pdf.js | 12 ++++++------ build/pdf.min.js | 4 ++-- build/pdf.worker.js | 4 ++-- lib/display/api.js | 4 ++-- lib/display/global.js | 4 ++-- lib/pdf.js | 4 ++-- lib/pdf.worker.js | 4 ++-- package.json | 2 +- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/bower.json b/bower.json index 42b1076c2..3c8255ef7 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.8.308", + "version": "1.8.310", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 76da4f27f..6ba7555de 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -12750,8 +12750,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() { }(); var version, build; { - exports.version = version = '1.8.308'; - exports.build = build = '74ba3033'; + exports.version = version = '1.8.310'; + exports.build = build = 'e42fc546'; } exports.getDocument = getDocument; exports.LoopbackPort = LoopbackPort; @@ -28089,8 +28089,8 @@ if (!_util.globalScope.PDFJS) { } var PDFJS = _util.globalScope.PDFJS; { - PDFJS.version = '1.8.308'; - PDFJS.build = '74ba3033'; + PDFJS.version = '1.8.310'; + PDFJS.build = 'e42fc546'; } PDFJS.pdfBug = false; if (PDFJS.verbosity !== undefined) { @@ -43629,8 +43629,8 @@ exports.TilingPattern = TilingPattern; "use strict"; -var pdfjsVersion = '1.8.308'; -var pdfjsBuild = '74ba3033'; +var pdfjsVersion = '1.8.310'; +var pdfjsBuild = 'e42fc546'; var pdfjsSharedUtil = __w_pdfjs_require__(0); var pdfjsDisplayGlobal = __w_pdfjs_require__(26); var pdfjsDisplayAPI = __w_pdfjs_require__(10); diff --git a/build/pdf.js b/build/pdf.js index 9c330b8b0..e67f7fd58 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -3455,8 +3455,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() { }(); var version, build; { - exports.version = version = '1.8.308'; - exports.build = build = '74ba3033'; + exports.version = version = '1.8.310'; + exports.build = build = 'e42fc546'; } exports.getDocument = getDocument; exports.LoopbackPort = LoopbackPort; @@ -5424,8 +5424,8 @@ if (!_util.globalScope.PDFJS) { } var PDFJS = _util.globalScope.PDFJS; { - PDFJS.version = '1.8.308'; - PDFJS.build = '74ba3033'; + PDFJS.version = '1.8.310'; + PDFJS.build = 'e42fc546'; } PDFJS.pdfBug = false; if (PDFJS.verbosity !== undefined) { @@ -7920,8 +7920,8 @@ exports.TilingPattern = TilingPattern; "use strict"; -var pdfjsVersion = '1.8.308'; -var pdfjsBuild = '74ba3033'; +var pdfjsVersion = '1.8.310'; +var pdfjsBuild = 'e42fc546'; var pdfjsSharedUtil = __w_pdfjs_require__(0); var pdfjsDisplayGlobal = __w_pdfjs_require__(9); var pdfjsDisplayAPI = __w_pdfjs_require__(3); diff --git a/build/pdf.min.js b/build/pdf.min.js index a8400ad14..b1967cc17 100644 --- a/build/pdf.min.js +++ b/build/pdf.min.js @@ -1,6 +1,6 @@ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],e):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=e():t["pdfjs-dist/build/pdf"]=t.pdfjsDistBuildPdf=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=13)}([function(t,e,n){"use strict";(function(t){function r(t){rt=t}function i(){return rt}function a(t){rt>=tt.infos&&console.log("Info: "+t)}function s(t){rt>=tt.warnings&&console.log("Warning: "+t)}function o(t){console.log("Deprecated API usage: "+t)}function c(t){throw rt>=tt.errors&&(console.log("Error: "+t),console.log(l())),new Error(t)}function l(){try{throw new Error}catch(t){return t.stack?t.stack.split("\n").slice(2).join("\n"):""}}function h(t,e){t||c(e)}function u(t,e){try{var n=new URL(t);if(!n.origin||"null"===n.origin)return!1}catch(t){return!1}var r=new URL(e,n);return n.origin===r.origin}function d(t){if(!t)return!1;switch(t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function f(t,e){if(!t)return null;try{var n=e?new URL(t,e):new URL(t);if(d(n))return n}catch(t){}return null}function p(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!1}),n}function g(t){var e;return function(){return t&&(e=Object.create(null),t(e),t=null),e}}function m(t){return"string"!=typeof t?(s("The argument for removeNullCharacters must be a string."),t):t.replace(pt,"")}function A(t){h(null!==t&&"object"===(void 0===t?"undefined":X(t))&&void 0!==t.length,"Invalid argument for bytesToString");var e=t.length;if(e<8192)return String.fromCharCode.apply(null,t);for(var n=[],r=0;r>24&255,t>>16&255,t>>8&255,255&t)}function x(t){for(var e=1,n=0;t>e;)e<<=1,n++;return n}function w(t,e){return t[e]<<24>>24}function _(t,e){return t[e]<<8|t[e+1]}function k(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}function T(){var t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}function C(){try{return new Function(""),!0}catch(t){return!1}}function P(t){var e,n=t.length,r=[];if("þ"===t[0]&&"ÿ"===t[1])for(e=2;et[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e},t.intersect=function(e,n){function r(t,e){return t-e}var i=[e[0],e[2],n[0],n[2]].sort(r),a=[e[1],e[3],n[1],n[3]].sort(r),s=[];return e=t.normalizeRect(e),n=t.normalizeRect(n),(i[0]===e[0]&&i[1]===n[0]||i[0]===n[0]&&i[1]===e[0])&&(s[0]=i[1],s[2]=i[2],(a[0]===e[1]&&a[1]===n[1]||a[0]===n[1]&&a[1]===e[1])&&(s[1]=a[1],s[3]=a[2],s))},t.sign=function(t){return t<0?-1:1};var n=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];return t.toRoman=function(t,e){h(I(t)&&t>0,"The number should be a positive integer.");for(var r,i=[];t>=1e3;)t-=1e3,i.push("M");r=t/100|0,t%=100,i.push(n[r]),r=t/10|0,t%=10,i.push(n[10+r]),i.push(n[20+t]);var a=i.join("");return e?a.toLowerCase():a},t.appendToArray=function(t,e){Array.prototype.push.apply(t,e)},t.prependToArray=function(t,e){Array.prototype.unshift.apply(t,e)},t.extendObj=function(t,e){for(var n in e)t[n]=e[n]},t.getInheritableProperty=function(t,e,n){for(;t&&!t.has(e);)t=t.get("Parent");return t?n?t.getArray(e):t.get(e):null},t.inherit=function(t,e,n){t.prototype=Object.create(e.prototype),t.prototype.constructor=t;for(var r in n)t.prototype[r]=n[r]},t.loadScript=function(t,e){var n=document.createElement("script"),r=!1;n.setAttribute("src",t),e&&(n.onload=function(){r||e(),r=!0}),document.getElementsByTagName("head")[0].appendChild(n)},t}(),At=function(){function t(t,e,n,r,i,a){this.viewBox=t,this.scale=e,this.rotation=n,this.offsetX=r,this.offsetY=i;var s,o,c,l,h=(t[2]+t[0])/2,u=(t[3]+t[1])/2;switch(n%=360,n=n<0?n+360:n){case 180:s=-1,o=0,c=0,l=1;break;case 90:s=0,o=1,c=1,l=0;break;case 270:s=0,o=-1,c=-1,l=0;break;default:s=1,o=0,c=0,l=-1}a&&(c=-c,l=-l);var d,f,p,g;0===s?(d=Math.abs(u-t[1])*e+r,f=Math.abs(h-t[0])*e+i,p=Math.abs(t[3]-t[1])*e,g=Math.abs(t[2]-t[0])*e):(d=Math.abs(h-t[0])*e+r,f=Math.abs(u-t[1])*e+i,p=Math.abs(t[2]-t[0])*e,g=Math.abs(t[3]-t[1])*e),this.transform=[s*e,o*e,c*e,l*e,d-s*e*h-c*e*u,f-o*e*h-l*e*u],this.width=p,this.height=g,this.fontScale=e}return t.prototype={clone:function(e){e=e||{};var n="scale"in e?e.scale:this.scale,r="rotation"in e?e.rotation:this.rotation;return new t(this.viewBox.slice(),n,r,this.offsetX,this.offsetY,e.dontFlip)},convertToViewportPoint:function(t,e){return mt.applyTransform([t,e],this.transform)},convertToViewportRectangle:function(t){var e=mt.applyTransform([t[0],t[1]],this.transform),n=mt.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],n[0],n[1]]},convertToPdfPoint:function(t,e){return mt.applyInverseTransform([t,e],this.transform)}},t}(),vt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364],bt=function(){function t(t,e,n){for(;t.lengtha&&(a=s.length)}for(e=0,n=r.length;e2&&void 0!==arguments[2]&&arguments[2])&&URL.createObjectURL){var r=yt(e,n);return URL.createObjectURL(r)}for(var i="data:"+n+";base64,",a=0,s=e.length;a>2]+t[(3&o)<<4|c>>4]+t[a+1>6:64]+t[a+20?e:t.length,n>0?n:t.length);return t.substring(t.lastIndexOf("/",r)+1,r)}function s(t){var e=l.globalScope.PDFJS;switch(t){case"pdfBug":return!!e&&e.pdfBug;case"disableAutoFetch":return!!e&&e.disableAutoFetch;case"disableStream":return!!e&&e.disableStream;case"disableRange":return!!e&&e.disableRange;case"disableFontFace":return!!e&&e.disableFontFace;case"disableCreateObjectURL":return!!e&&e.disableCreateObjectURL;case"disableWebGL":return!e||e.disableWebGL;case"cMapUrl":return e?e.cMapUrl:null;case"cMapPacked":return!!e&&e.cMapPacked;case"postMessageTransfers":return!e||e.postMessageTransfers;case"workerPort":return e?e.workerPort:null;case"workerSrc":return e?e.workerSrc:null;case"disableWorker":return!!e&&e.disableWorker;case"maxImageSize":return e?e.maxImageSize:-1;case"imageResourcesPath":return e?e.imageResourcesPath:"";case"isEvalSupported":return!e||e.isEvalSupported;case"externalLinkTarget":if(!e)return p.NONE;switch(e.externalLinkTarget){case p.NONE:case p.SELF:case p.BLANK:case p.PARENT:case p.TOP:return e.externalLinkTarget}return(0,l.warn)("PDFJS.externalLinkTarget is invalid: "+e.externalLinkTarget),e.externalLinkTarget=p.NONE,p.NONE;case"externalLinkRel":return e?e.externalLinkRel:h;case"enableStats":return!(!e||!e.enableStats);case"pdfjsNext":return!(!e||!e.pdfjsNext);default:throw new Error("Unknown default setting: "+t)}}function o(){switch(s("externalLinkTarget")){case p.NONE:return!1;case p.SELF:case p.BLANK:case p.PARENT:case p.TOP:return!0}}function c(t,e){(0,l.deprecated)("isValidUrl(), please use createValidAbsoluteUrl() instead.");var n=e?"http://example.com":null;return null!==(0,l.createValidAbsoluteUrl)(t,n)}Object.defineProperty(e,"__esModule",{value:!0}),e.DOMCMapReaderFactory=e.DOMCanvasFactory=e.DEFAULT_LINK_REL=e.getDefaultSetting=e.LinkTarget=e.getFilenameFromUrl=e.isValidUrl=e.isExternalLinkTargetSet=e.addLinkAttributes=e.RenderingCancelledException=e.CustomStyle=void 0;var l=n(0),h="noopener noreferrer nofollow";r.prototype={create:function(t,e){(0,l.assert)(t>0&&e>0,"invalid canvas size");var n=document.createElement("canvas"),r=n.getContext("2d");return n.width=t,n.height=e,{canvas:n,context:r}},reset:function(t,e,n){(0,l.assert)(t.canvas,"canvas is not specified"),(0,l.assert)(e>0&&n>0,"invalid canvas size"),t.canvas.width=e,t.canvas.height=n},destroy:function(t){(0,l.assert)(t.canvas,"canvas is not specified"),t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}};var u=function(){function t(t){this.baseUrl=t.baseUrl||null,this.isCompressed=t.isCompressed||!1}return t.prototype={fetch:function(t){var e=t.name;return e?new Promise(function(t,n){var r=this.baseUrl+e+(this.isCompressed?".bcmap":""),i=new XMLHttpRequest;i.open("GET",r,!0),this.isCompressed&&(i.responseType="arraybuffer"),i.onreadystatechange=function(){if(i.readyState===XMLHttpRequest.DONE){if(200===i.status||0===i.status){var e;if(this.isCompressed&&i.response?e=new Uint8Array(i.response):!this.isCompressed&&i.responseText&&(e=(0,l.stringToBytes)(i.responseText)),e)return void t({cMapData:e,compressionType:this.isCompressed?l.CMapCompressionType.BINARY:l.CMapCompressionType.NONE})}n(new Error("Unable to load "+(this.isCompressed?"binary ":"")+"CMap at: "+r))}}.bind(this),i.send(null)}.bind(this)):Promise.reject(new Error("CMap name must be specified."))}},t}(),d=function(){function t(){}var e=["ms","Moz","Webkit","O"],n=Object.create(null);return t.getProp=function(t,r){if(1===arguments.length&&"string"==typeof n[t])return n[t];r=r||document.documentElement;var i,a,s=r.style;if("string"==typeof s[t])return n[t]=t;a=t.charAt(0).toUpperCase()+t.slice(1);for(var o=0,c=e.length;o0){s.style.borderWidth=e.borderStyle.width+"px",e.borderStyle.style!==a.AnnotationBorderStyleType.UNDERLINE&&(o-=2*e.borderStyle.width,c-=2*e.borderStyle.width);var h=e.borderStyle.horizontalCornerRadius,u=e.borderStyle.verticalCornerRadius;if(h>0||u>0){var d=h+"px / "+u+"px";i.CustomStyle.setProp("borderRadius",s,d)}switch(e.borderStyle.style){case a.AnnotationBorderStyleType.SOLID:s.style.borderStyle="solid";break;case a.AnnotationBorderStyleType.DASHED:s.style.borderStyle="dashed";break;case a.AnnotationBorderStyleType.BEVELED:(0,a.warn)("Unimplemented border style: beveled");break;case a.AnnotationBorderStyleType.INSET:(0,a.warn)("Unimplemented border style: inset");break;case a.AnnotationBorderStyleType.UNDERLINE:s.style.borderBottomStyle="solid"}e.color?s.style.borderColor=a.Util.makeCssRgb(0|e.color[0],0|e.color[1],0|e.color[2]):s.style.borderWidth=0}return s.style.left=l[0]+"px",s.style.top=l[1]+"px",s.style.width=o+"px",s.style.height=c+"px",s},_createPopup:function(t,e,n){e||(e=document.createElement("div"),e.style.height=t.style.height,e.style.width=t.style.width,t.appendChild(e));var r=new g({container:t,trigger:e,color:n.color,title:n.title,contents:n.contents,hideWrapper:!0}),i=r.render();i.style.left=t.style.width,t.appendChild(i)},render:function(){throw new Error("Abstract method AnnotationElement.render called")}},t}(),o=function(){function t(t){s.call(this,t,!0)}return a.Util.inherit(t,s,{render:function(){this.container.className="linkAnnotation";var t=document.createElement("a");return(0,i.addLinkAttributes)(t,{url:this.data.url,target:this.data.newWindow?i.LinkTarget.BLANK:void 0}),this.data.url||(this.data.action?this._bindNamedAction(t,this.data.action):this._bindLink(t,this.data.dest)),this.container.appendChild(t),this.container},_bindLink:function(t,e){var n=this;t.href=this.linkService.getDestinationHash(e),t.onclick=function(){return e&&n.linkService.navigateTo(e),!1},e&&(t.className="internalLink")},_bindNamedAction:function(t,e){var n=this;t.href=this.linkService.getAnchorUrl(""),t.onclick=function(){return n.linkService.executeNamedAction(e),!1},t.className="internalLink"}}),t}(),c=function(){function t(t){var e=!!(t.data.hasPopup||t.data.title||t.data.contents);s.call(this,t,e)}return a.Util.inherit(t,s,{render:function(){this.container.className="textAnnotation";var t=document.createElement("img");return t.style.height=this.container.style.height,t.style.width=this.container.style.width,t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.alt="[{{type}} Annotation]",t.dataset.l10nId="text_annotation_type",t.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(this.container,t,this.data),this.container.appendChild(t),this.container}}),t}(),l=function(){function t(t,e){s.call(this,t,e)}return a.Util.inherit(t,s,{render:function(){return this.container}}),t}(),h=function(){function t(t){var e=t.renderInteractiveForms||!t.data.hasAppearance&&!!t.data.fieldValue;l.call(this,t,e)}var e=["left","center","right"];return a.Util.inherit(t,l,{render:function(){this.container.className="textWidgetAnnotation";var t=null;if(this.renderInteractiveForms){if(this.data.multiLine?(t=document.createElement("textarea"),t.textContent=this.data.fieldValue):(t=document.createElement("input"),t.type="text",t.setAttribute("value",this.data.fieldValue)),t.disabled=this.data.readOnly,null!==this.data.maxLen&&(t.maxLength=this.data.maxLen),this.data.comb){var n=this.data.rect[2]-this.data.rect[0],r=n/this.data.maxLen;t.classList.add("comb"),t.style.letterSpacing="calc("+r+"px - 1ch)"}}else{t=document.createElement("div"),t.textContent=this.data.fieldValue,t.style.verticalAlign="middle",t.style.display="table-cell";var i=null;this.data.fontRefName&&(i=this.page.commonObjs.getData(this.data.fontRefName)),this._setTextStyle(t,i)}return null!==this.data.textAlignment&&(t.style.textAlign=e[this.data.textAlignment]),this.container.appendChild(t),this.container},_setTextStyle:function(t,e){var n=t.style;if(n.fontSize=this.data.fontSize+"px",n.direction=this.data.fontDirection<0?"rtl":"ltr",e){n.fontWeight=e.black?e.bold?"900":"bold":e.bold?"bold":"normal",n.fontStyle=e.italic?"italic":"normal";var r=e.loadedName?'"'+e.loadedName+'", ':"",i=e.fallbackName||"Helvetica, sans-serif";n.fontFamily=r+i}}}),t}(),u=function(){function t(t){l.call(this,t,t.renderInteractiveForms)}return a.Util.inherit(t,l,{render:function(){this.container.className="buttonWidgetAnnotation checkBox";var t=document.createElement("input");return t.disabled=this.data.readOnly,t.type="checkbox",this.data.fieldValue&&"Off"!==this.data.fieldValue&&t.setAttribute("checked",!0),this.container.appendChild(t),this.container}}),t}(),d=function(){function t(t){l.call(this,t,t.renderInteractiveForms)}return a.Util.inherit(t,l,{render:function(){this.container.className="buttonWidgetAnnotation radioButton";var t=document.createElement("input");return t.disabled=this.data.readOnly,t.type="radio",t.name=this.data.fieldName,this.data.fieldValue===this.data.buttonValue&&t.setAttribute("checked",!0),this.container.appendChild(t),this.container}}),t}(),f=function(){function t(t){l.call(this,t,t.renderInteractiveForms)}return a.Util.inherit(t,l,{render:function(){this.container.className="choiceWidgetAnnotation";var t=document.createElement("select");t.disabled=this.data.readOnly,this.data.combo||(t.size=this.data.options.length,this.data.multiSelect&&(t.multiple=!0));for(var e=0,n=this.data.options.length;e=0&&i.setAttribute("selected",!0),t.appendChild(i)}return this.container.appendChild(t),this.container}}),t}(),p=function(){function t(t){var e=!(!t.data.title&&!t.data.contents);s.call(this,t,e)}var e=["Line"];return a.Util.inherit(t,s,{render:function(){if(this.container.className="popupAnnotation",e.indexOf(this.data.parentType)>=0)return this.container;var t='[data-annotation-id="'+this.data.parentId+'"]',n=this.layer.querySelector(t);if(!n)return this.container;var r=new g({container:this.container,trigger:n,color:this.data.color,title:this.data.title,contents:this.data.contents}),a=parseFloat(n.style.left),s=parseFloat(n.style.width);return i.CustomStyle.setProp("transformOrigin",this.container,-(a+s)+"px -"+n.style.top),this.container.style.left=a+s+"px",this.container.appendChild(r.render()),this.container}}),t}(),g=function(){function t(t){this.container=t.container,this.trigger=t.trigger,this.color=t.color,this.title=t.title,this.contents=t.contents,this.hideWrapper=t.hideWrapper||!1,this.pinned=!1}return t.prototype={render:function(){var t=document.createElement("div");t.className="popupWrapper",this.hideElement=this.hideWrapper?t:this.container,this.hideElement.setAttribute("hidden",!0);var e=document.createElement("div");e.className="popup";var n=this.color;if(n){var r=.7*(255-n[0])+n[0],i=.7*(255-n[1])+n[1],s=.7*(255-n[2])+n[2];e.style.backgroundColor=a.Util.makeCssRgb(0|r,0|i,0|s)}var o=this._formatContents(this.contents),c=document.createElement("h1");return c.textContent=this.title,this.trigger.addEventListener("click",this._toggle.bind(this)),this.trigger.addEventListener("mouseover",this._show.bind(this,!1)),this.trigger.addEventListener("mouseout",this._hide.bind(this,!1)),e.addEventListener("click",this._hide.bind(this,!0)),e.appendChild(c),e.appendChild(o),t.appendChild(e),t},_formatContents:function(t){for(var e=document.createElement("p"),n=t.split(/(?:\r\n?|\n)/),r=0,i=n.length;r1&&(0,l.deprecated)("getDocument is called with pdfDataRangeTransport, passwordCallback or progressCallback argument"),e&&(e instanceof _||(e=Object.create(e),e.length=t.length,e.initialData=t.initialData,e.abort||(e.abort=function(){})),t=Object.create(t),t.range=e),i.onPassword=n||null,i.onProgress=r||null;var s;"string"==typeof t?s={url:t}:(0,l.isArrayBuffer)(t)?s={data:t}:t instanceof _?s={range:t}:("object"!==(void 0===t?"undefined":c(t))&&(0,l.error)("Invalid parameter in getDocument, need either Uint8Array, string or a parameter object"),t.url||t.data||t.range||(0,l.error)("Invalid parameter object: need either .data, .range or .url"),s=t);var o={},u=null,d=null;for(var f in s)if("url"!==f||"undefined"==typeof window)if("range"!==f)if("worker"!==f)if("data"!==f||s[f]instanceof Uint8Array)o[f]=s[f];else{var g=s[f];"string"==typeof g?o[f]=(0,l.stringToBytes)(g):"object"!==(void 0===g?"undefined":c(g))||null===g||isNaN(g.length)?(0,l.isArrayBuffer)(g)?o[f]=new Uint8Array(g):(0,l.error)("Invalid PDF binary data: either typed array, string or array-like object is expected in the data property."):o[f]=new Uint8Array(g)}else d=s[f];else u=s[f];else o[f]=new URL(s[f],window.location).href;o.rangeChunkSize=o.rangeChunkSize||p,o.disableNativeImageDecoder=!0===o.disableNativeImageDecoder,o.ignoreErrors=!0!==o.stopAtErrors;var m=o.CMapReaderFactory||h.DOMCMapReaderFactory;if(!d){var A=(0,h.getDefaultSetting)("workerPort");d=A?new P(null,A):new P,i._worker=d}var v=i.docId;return d.promise.then(function(){if(i.destroyed)throw new Error("Loading aborted");return a(d,o,u,v).then(function(t){if(i.destroyed)throw new Error("Loading aborted");var e=new l.MessageHandler(v,t,d.port),n=new L(e,i,u,m);i._transport=n,e.send("Ready",null)})}).catch(i._capability.reject),i}function a(t,e,n,r){return t.destroyed?Promise.reject(new Error("Worker was destroyed")):(e.disableAutoFetch=(0,h.getDefaultSetting)("disableAutoFetch"),e.disableStream=(0,h.getDefaultSetting)("disableStream"),e.chunkedViewerLoading=!!n,n&&(e.length=n.length,e.initialData=n.initialData),t.messageHandler.sendWithPromise("GetDocRequest",{docId:r,source:e,disableRange:(0,h.getDefaultSetting)("disableRange"),maxImageSize:(0,h.getDefaultSetting)("maxImageSize"),disableFontFace:(0,h.getDefaultSetting)("disableFontFace"),disableCreateObjectURL:(0,h.getDefaultSetting)("disableCreateObjectURL"),postMessageTransfers:(0,h.getDefaultSetting)("postMessageTransfers")&&!m,docBaseUrl:e.docBaseUrl,disableNativeImageDecoder:e.disableNativeImageDecoder,ignoreErrors:e.ignoreErrors}).then(function(e){if(t.destroyed)throw new Error("Worker was destroyed");return e}))}Object.defineProperty(e,"__esModule",{value:!0}),e.build=e.version=e._UnsupportedManager=e.PDFPageProxy=e.PDFDocumentProxy=e.PDFWorker=e.PDFDataRangeTransport=e.LoopbackPort=e.getDocument=void 0;var s,o=function(){function t(t,e){for(var n=0;n=0&&a.renderTasks.splice(e,1),c.cleanupAfterRender&&(c.pendingCleanup=!0),c._tryCleanup(),t?s.capability.reject(t):s.capability.resolve(),n.timeEnd("Rendering"),n.timeEnd("Overall")}var n=this.stats;n.time("Overall"),this.pendingCleanup=!1;var r="print"===t.intent?"print":"display",i=t.canvasFactory||new h.DOMCanvasFactory;this.intentStates[r]||(this.intentStates[r]=Object.create(null));var a=this.intentStates[r];a.displayReadyCapability||(a.receivingOperatorList=!0,a.displayReadyCapability=(0,l.createPromiseCapability)(),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this.stats.time("Page Request"),this.transport.messageHandler.send("RenderPageRequest",{pageIndex:this.pageNumber-1,intent:r,renderInteractiveForms:!0===t.renderInteractiveForms}));var s=new O(e,t,this.objs,this.commonObjs,a.operatorList,this.pageNumber,i);s.useRequestAnimationFrame="print"!==r,a.renderTasks||(a.renderTasks=[]),a.renderTasks.push(s);var o=s.task;t.continueCallback&&((0,l.deprecated)("render is used with continueCallback parameter"),o.onContinue=t.continueCallback);var c=this;return a.displayReadyCapability.promise.then(function(t){if(c.pendingCleanup)return void e();n.time("Rendering"),s.initializeGraphics(t),s.operatorListChanged()},function(t){e(t)}),o},getOperatorList:function(){function t(){if(n.operatorList.lastChunk){n.opListReadCapability.resolve(n.operatorList);var t=n.renderTasks.indexOf(e);t>=0&&n.renderTasks.splice(t,1)}}this.intentStates.oplist||(this.intentStates.oplist=Object.create(null));var e,n=this.intentStates.oplist;return n.opListReadCapability||(e={},e.operatorListChanged=t,n.receivingOperatorList=!0,n.opListReadCapability=(0,l.createPromiseCapability)(),n.renderTasks=[],n.renderTasks.push(e),n.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this.transport.messageHandler.send("RenderPageRequest",{pageIndex:this.pageIndex,intent:"oplist"})),n.opListReadCapability.promise},getTextContent:function(t){return t=t||{},this.transport.messageHandler.sendWithPromise("GetTextContent",{pageIndex:this.pageNumber-1,normalizeWhitespace:!0===t.normalizeWhitespace,combineTextItems:!0!==t.disableCombineTextItems})},_destroy:function(){this.destroyed=!0,this.transport.pageCache[this.pageIndex]=null;var t=[];return Object.keys(this.intentStates).forEach(function(e){if("oplist"!==e){this.intentStates[e].renderTasks.forEach(function(e){var n=e.capability.promise.catch(function(){});t.push(n),e.cancel()})}},this),this.objs.clear(),this.annotationsPromise=null,this.pendingCleanup=!1,Promise.all(t)},destroy:function(){(0,l.deprecated)("page destroy method, use cleanup() instead"),this.cleanup()},cleanup:function(){this.pendingCleanup=!0,this._tryCleanup()},_tryCleanup:function(){this.pendingCleanup&&!Object.keys(this.intentStates).some(function(t){var e=this.intentStates[t];return 0!==e.renderTasks.length||e.receivingOperatorList},this)&&(Object.keys(this.intentStates).forEach(function(t){delete this.intentStates[t]},this),this.objs.clear(),this.annotationsPromise=null,this.pendingCleanup=!1)},_startRenderPage:function(t,e){var n=this.intentStates[e];n.displayReadyCapability&&n.displayReadyCapability.resolve(t)},_renderPageChunk:function(t,e){var n,r,i=this.intentStates[e];for(n=0,r=t.length;n=0;return i=t===a?t:s?new t.constructor(a,t.byteOffset,t.byteLength):new t.constructor(t),r.set(t,i),i}i=(0,l.isArray)(t)?[]:{},r.set(t,i);for(var o in t){for(var h,u=t;!(h=Object.getOwnPropertyDescriptor(u,o));)u=Object.getPrototypeOf(u);void 0!==h.value&&"function"!=typeof h.value&&(i[o]=n(h.value))}return i}if(!this._defer)return void this._listeners.forEach(function(e){e.call(this,{data:t})},this);var r=new WeakMap,i={data:n(t)};this._deferred.then(function(){this._listeners.forEach(function(t){t.call(this,i)},this)}.bind(this))}},{key:"addEventListener",value:function(t,e){this._listeners.push(e)}},{key:"removeEventListener",value:function(t,e){var n=this._listeners.indexOf(e);this._listeners.splice(n,1)}},{key:"terminate",value:function(){this._listeners=[]}}]),t}(),P=function(){function t(){return void 0!==s?s:(0,h.getDefaultSetting)("workerSrc")?(0,h.getDefaultSetting)("workerSrc"):A?A.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"):void(0,l.error)("No PDFJS.workerSrc specified")}function e(){return i?i.promise:(i=(0,l.createPromiseCapability)(),(v||function(e){l.Util.loadScript(t(),function(){e(window.pdfjsDistBuildPdfWorker.WorkerMessageHandler)})})(i.resolve),i.promise)}function n(t){var e="importScripts('"+t+"');";return URL.createObjectURL(new Blob([e]))}function r(t,e){if(this.name=t,this.destroyed=!1,this._readyCapability=(0,l.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,e)return void this._initializeFromPort(e);this._initialize()}var i,a=0;return r.prototype={get promise(){return this._readyCapability.promise},get port(){return this._port},get messageHandler(){return this._messageHandler},_initializeFromPort:function(t){this._port=t,this._messageHandler=new l.MessageHandler("main","worker",t),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve()},_initialize:function(){if(!g&&!(0,h.getDefaultSetting)("disableWorker")&&"undefined"!=typeof Worker){var e=t();try{(0,l.isSameOrigin)(window.location.href,e)||(e=n(new URL(e,window.location).href));var r=new Worker(e),i=new l.MessageHandler("main","worker",r),a=function(){r.removeEventListener("error",s),i.destroy(),r.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()}.bind(this),s=function(t){this._webWorker||a()}.bind(this);r.addEventListener("error",s),i.on("test",function(t){if(r.removeEventListener("error",s),this.destroyed)return void a();t&&t.supportTypedArray?(this._messageHandler=i,this._port=r,this._webWorker=r,t.supportTransfers||(m=!0),this._readyCapability.resolve(),i.send("configure",{verbosity:(0,l.getVerbosityLevel)()})):(this._setupFakeWorker(),i.destroy(),r.terminate())}.bind(this)),i.on("console_log",function(t){console.log.apply(console,t)}),i.on("console_error",function(t){console.error.apply(console,t)}),i.on("ready",function(t){if(r.removeEventListener("error",s),this.destroyed)return void a();try{o()}catch(t){this._setupFakeWorker()}}.bind(this));var o=function(){var t=(0,h.getDefaultSetting)("postMessageTransfers")&&!m,e=new Uint8Array([t?255:0]);try{i.send("test",e,[e.buffer])}catch(t){(0,l.info)("Cannot use postMessage transfers"),e[0]=0,i.send("test",e)}};return void o()}catch(t){(0,l.info)("The worker has been disabled.")}}this._setupFakeWorker()},_setupFakeWorker:function(){g||(0,h.getDefaultSetting)("disableWorker")||((0,l.warn)("Setting up fake worker."),g=!0),e().then(function(t){if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));var e=Uint8Array!==Float32Array,n=new C(e);this._port=n;var r="fake"+a++,i=new l.MessageHandler(r+"_worker",r,n);t.setup(i,n);var s=new l.MessageHandler(r,r+"_worker",n);this._messageHandler=s,this._readyCapability.resolve()}.bind(this))},destroy:function(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}},r}(),L=function(){function t(t,e,n,r){this.messageHandler=t,this.loadingTask=e,this.pdfDataRangeTransport=n,this.commonObjs=new E,this.fontLoader=new u.FontLoader(e.docId),this.CMapReaderFactory=new r({baseUrl:(0,h.getDefaultSetting)("cMapUrl"),isCompressed:(0,h.getDefaultSetting)("cMapPacked")}),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this.pageCache=[],this.pagePromises=[],this.downloadInfoCapability=(0,l.createPromiseCapability)(),this.setupMessageHandler()}return t.prototype={destroy:function(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,l.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));var t=[];this.pageCache.forEach(function(e){e&&t.push(e._destroy())}),this.pageCache=[],this.pagePromises=[];var e=this,n=this.messageHandler.sendWithPromise("Terminate",null);return t.push(n),Promise.all(t).then(function(){e.fontLoader.clear(),e.pdfDataRangeTransport&&(e.pdfDataRangeTransport.abort(),e.pdfDataRangeTransport=null),e.messageHandler&&(e.messageHandler.destroy(),e.messageHandler=null),e.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise},setupMessageHandler:function(){var t=this.messageHandler,e=this.loadingTask,n=this.pdfDataRangeTransport;n&&(n.addRangeListener(function(e,n){t.send("OnDataRange",{begin:e,chunk:n})}),n.addProgressListener(function(e){t.send("OnDataProgress",{loaded:e})}),n.addProgressiveReadListener(function(e){t.send("OnDataRange",{chunk:e})}),t.on("RequestDataRange",function(t){n.requestDataRange(t.begin,t.end)},this)),t.on("GetDoc",function(t){var e=t.pdfInfo;this.numPages=t.pdfInfo.numPages;var n=this.loadingTask,r=new k(e,this,n);this.pdfDocument=r,n._capability.resolve(r)},this),t.on("PasswordRequest",function(t){var n=this;if(this._passwordCapability=(0,l.createPromiseCapability)(),e.onPassword){var r=function(t){n._passwordCapability.resolve({password:t})};e.onPassword(r,t.code)}else this._passwordCapability.reject(new l.PasswordException(t.message,t.code));return this._passwordCapability.promise},this),t.on("PasswordException",function(t){e._capability.reject(new l.PasswordException(t.message,t.code))},this),t.on("InvalidPDF",function(t){this.loadingTask._capability.reject(new l.InvalidPDFException(t.message))},this),t.on("MissingPDF",function(t){this.loadingTask._capability.reject(new l.MissingPDFException(t.message))},this),t.on("UnexpectedResponse",function(t){this.loadingTask._capability.reject(new l.UnexpectedResponseException(t.message,t.status))},this),t.on("UnknownError",function(t){this.loadingTask._capability.reject(new l.UnknownErrorException(t.message,t.details))},this),t.on("DataLoaded",function(t){this.downloadInfoCapability.resolve(t)},this),t.on("PDFManagerReady",function(t){this.pdfDataRangeTransport&&this.pdfDataRangeTransport.transportReady()},this),t.on("StartRenderPage",function(t){if(!this.destroyed){var e=this.pageCache[t.pageIndex];e.stats.timeEnd("Page Request"),e._startRenderPage(t.transparency,t.intent)}},this),t.on("RenderPageChunk",function(t){if(!this.destroyed){this.pageCache[t.pageIndex]._renderPageChunk(t.operatorList,t.intent)}},this),t.on("commonobj",function(t){if(!this.destroyed){var e=t[0],n=t[1];if(!this.commonObjs.hasData(e))switch(n){case"Font":var r=t[2];if("error"in r){var i=r.error;(0,l.warn)("Error during font loading: "+i),this.commonObjs.resolve(e,i);break}var a=null;(0,h.getDefaultSetting)("pdfBug")&&l.globalScope.FontInspector&&l.globalScope.FontInspector.enabled&&(a={registerFont:function(t,e){l.globalScope.FontInspector.fontAdded(t,e)}});var s=new u.FontFaceObject(r,{isEvalSuported:(0,h.getDefaultSetting)("isEvalSupported"),disableFontFace:(0,h.getDefaultSetting)("disableFontFace"),fontRegistry:a});this.fontLoader.bind([s],function(t){this.commonObjs.resolve(e,s)}.bind(this));break;case"FontPath":this.commonObjs.resolve(e,t[2]);break;default:(0,l.error)("Got unknown common object type "+n)}}},this),t.on("obj",function(t){if(!this.destroyed){var e,n=t[0],r=t[1],i=t[2],a=this.pageCache[r];if(!a.objs.hasData(n))switch(i){case"JpegStream":e=t[3],(0,l.loadJpegStream)(n,e,a.objs);break;case"Image":e=t[3],a.objs.resolve(n,e);e&&"data"in e&&e.data.length>8e6&&(a.cleanupAfterRender=!0);break;default:(0,l.error)("Got unknown object type "+i)}}},this),t.on("DocProgress",function(t){if(!this.destroyed){var e=this.loadingTask;e.onProgress&&e.onProgress({loaded:t.loaded,total:t.total})}},this),t.on("PageError",function(t){if(!this.destroyed){var e=this.pageCache[t.pageNum-1],n=e.intentStates[t.intent];if(n.displayReadyCapability?n.displayReadyCapability.reject(t.error):(0,l.error)(t.error),n.operatorList){n.operatorList.lastChunk=!0;for(var r=0;rthis.numPages)return Promise.reject(new Error("Invalid page request"));var n=t-1;if(n in this.pagePromises)return this.pagePromises[n];var r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:n}).then(function(t){if(this.destroyed)throw new Error("Transport destroyed");var e=new T(n,t,this);return this.pageCache[n]=e,e}.bind(this));return this.pagePromises[n]=r,r},getPageIndex:function(t){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:t}).catch(function(t){return Promise.reject(new Error(t))})},getAnnotations:function(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})},getDestinations:function(){return this.messageHandler.sendWithPromise("GetDestinations",null)},getDestination:function(t){return this.messageHandler.sendWithPromise("GetDestination",{id:t})},getPageLabels:function(){return this.messageHandler.sendWithPromise("GetPageLabels",null)},getAttachments:function(){return this.messageHandler.sendWithPromise("GetAttachments",null)},getJavaScript:function(){return this.messageHandler.sendWithPromise("GetJavaScript",null)},getOutline:function(){return this.messageHandler.sendWithPromise("GetOutline",null)},getMetadata:function(){return this.messageHandler.sendWithPromise("GetMetadata",null).then(function(t){return{info:t[0],metadata:t[1]?new f.Metadata(t[1]):null}})},getStats:function(){return this.messageHandler.sendWithPromise("GetStats",null)},startCleanup:function(){this.messageHandler.sendWithPromise("Cleanup",null).then(function(){for(var t=0,e=this.pageCache.length;t>>8^o[a]}return-1^r}function e(e,n,r,i){var a=i,s=n.length;r[a]=s>>24&255,r[a+1]=s>>16&255,r[a+2]=s>>8&255,r[a+3]=255&s,a+=4,r[a]=255&e.charCodeAt(0),r[a+1]=255&e.charCodeAt(1),r[a+2]=255&e.charCodeAt(2),r[a+3]=255&e.charCodeAt(3),a+=4,r.set(n,a),a+=n.length;var o=t(r,i+4,a);r[a]=o>>24&255,r[a+1]=o>>16&255,r[a+2]=o>>8&255,r[a+3]=255&o}function n(t,e,n){for(var r=1,i=0,a=e;a1&&(0,l.deprecated)("getDocument is called with pdfDataRangeTransport, passwordCallback or progressCallback argument"),e&&(e instanceof _||(e=Object.create(e),e.length=t.length,e.initialData=t.initialData,e.abort||(e.abort=function(){})),t=Object.create(t),t.range=e),i.onPassword=n||null,i.onProgress=r||null;var s;"string"==typeof t?s={url:t}:(0,l.isArrayBuffer)(t)?s={data:t}:t instanceof _?s={range:t}:("object"!==(void 0===t?"undefined":c(t))&&(0,l.error)("Invalid parameter in getDocument, need either Uint8Array, string or a parameter object"),t.url||t.data||t.range||(0,l.error)("Invalid parameter object: need either .data, .range or .url"),s=t);var o={},u=null,d=null;for(var f in s)if("url"!==f||"undefined"==typeof window)if("range"!==f)if("worker"!==f)if("data"!==f||s[f]instanceof Uint8Array)o[f]=s[f];else{var g=s[f];"string"==typeof g?o[f]=(0,l.stringToBytes)(g):"object"!==(void 0===g?"undefined":c(g))||null===g||isNaN(g.length)?(0,l.isArrayBuffer)(g)?o[f]=new Uint8Array(g):(0,l.error)("Invalid PDF binary data: either typed array, string or array-like object is expected in the data property."):o[f]=new Uint8Array(g)}else d=s[f];else u=s[f];else o[f]=new URL(s[f],window.location).href;o.rangeChunkSize=o.rangeChunkSize||p,o.disableNativeImageDecoder=!0===o.disableNativeImageDecoder,o.ignoreErrors=!0!==o.stopAtErrors;var m=o.CMapReaderFactory||h.DOMCMapReaderFactory;if(!d){var A=(0,h.getDefaultSetting)("workerPort");d=A?new P(null,A):new P,i._worker=d}var v=i.docId;return d.promise.then(function(){if(i.destroyed)throw new Error("Loading aborted");return a(d,o,u,v).then(function(t){if(i.destroyed)throw new Error("Loading aborted");var e=new l.MessageHandler(v,t,d.port),n=new L(e,i,u,m);i._transport=n,e.send("Ready",null)})}).catch(i._capability.reject),i}function a(t,e,n,r){return t.destroyed?Promise.reject(new Error("Worker was destroyed")):(e.disableAutoFetch=(0,h.getDefaultSetting)("disableAutoFetch"),e.disableStream=(0,h.getDefaultSetting)("disableStream"),e.chunkedViewerLoading=!!n,n&&(e.length=n.length,e.initialData=n.initialData),t.messageHandler.sendWithPromise("GetDocRequest",{docId:r,source:e,disableRange:(0,h.getDefaultSetting)("disableRange"),maxImageSize:(0,h.getDefaultSetting)("maxImageSize"),disableFontFace:(0,h.getDefaultSetting)("disableFontFace"),disableCreateObjectURL:(0,h.getDefaultSetting)("disableCreateObjectURL"),postMessageTransfers:(0,h.getDefaultSetting)("postMessageTransfers")&&!m,docBaseUrl:e.docBaseUrl,disableNativeImageDecoder:e.disableNativeImageDecoder,ignoreErrors:e.ignoreErrors}).then(function(e){if(t.destroyed)throw new Error("Worker was destroyed");return e}))}Object.defineProperty(e,"__esModule",{value:!0}),e.build=e.version=e._UnsupportedManager=e.PDFPageProxy=e.PDFDocumentProxy=e.PDFWorker=e.PDFDataRangeTransport=e.LoopbackPort=e.getDocument=void 0;var s,o=function(){function t(t,e){for(var n=0;n=0&&a.renderTasks.splice(e,1),c.cleanupAfterRender&&(c.pendingCleanup=!0),c._tryCleanup(),t?s.capability.reject(t):s.capability.resolve(),n.timeEnd("Rendering"),n.timeEnd("Overall")}var n=this.stats;n.time("Overall"),this.pendingCleanup=!1;var r="print"===t.intent?"print":"display",i=t.canvasFactory||new h.DOMCanvasFactory;this.intentStates[r]||(this.intentStates[r]=Object.create(null));var a=this.intentStates[r];a.displayReadyCapability||(a.receivingOperatorList=!0,a.displayReadyCapability=(0,l.createPromiseCapability)(),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this.stats.time("Page Request"),this.transport.messageHandler.send("RenderPageRequest",{pageIndex:this.pageNumber-1,intent:r,renderInteractiveForms:!0===t.renderInteractiveForms}));var s=new O(e,t,this.objs,this.commonObjs,a.operatorList,this.pageNumber,i);s.useRequestAnimationFrame="print"!==r,a.renderTasks||(a.renderTasks=[]),a.renderTasks.push(s);var o=s.task;t.continueCallback&&((0,l.deprecated)("render is used with continueCallback parameter"),o.onContinue=t.continueCallback);var c=this;return a.displayReadyCapability.promise.then(function(t){if(c.pendingCleanup)return void e();n.time("Rendering"),s.initializeGraphics(t),s.operatorListChanged()},function(t){e(t)}),o},getOperatorList:function(){function t(){if(n.operatorList.lastChunk){n.opListReadCapability.resolve(n.operatorList);var t=n.renderTasks.indexOf(e);t>=0&&n.renderTasks.splice(t,1)}}this.intentStates.oplist||(this.intentStates.oplist=Object.create(null));var e,n=this.intentStates.oplist;return n.opListReadCapability||(e={},e.operatorListChanged=t,n.receivingOperatorList=!0,n.opListReadCapability=(0,l.createPromiseCapability)(),n.renderTasks=[],n.renderTasks.push(e),n.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this.transport.messageHandler.send("RenderPageRequest",{pageIndex:this.pageIndex,intent:"oplist"})),n.opListReadCapability.promise},getTextContent:function(t){return t=t||{},this.transport.messageHandler.sendWithPromise("GetTextContent",{pageIndex:this.pageNumber-1,normalizeWhitespace:!0===t.normalizeWhitespace,combineTextItems:!0!==t.disableCombineTextItems})},_destroy:function(){this.destroyed=!0,this.transport.pageCache[this.pageIndex]=null;var t=[];return Object.keys(this.intentStates).forEach(function(e){if("oplist"!==e){this.intentStates[e].renderTasks.forEach(function(e){var n=e.capability.promise.catch(function(){});t.push(n),e.cancel()})}},this),this.objs.clear(),this.annotationsPromise=null,this.pendingCleanup=!1,Promise.all(t)},destroy:function(){(0,l.deprecated)("page destroy method, use cleanup() instead"),this.cleanup()},cleanup:function(){this.pendingCleanup=!0,this._tryCleanup()},_tryCleanup:function(){this.pendingCleanup&&!Object.keys(this.intentStates).some(function(t){var e=this.intentStates[t];return 0!==e.renderTasks.length||e.receivingOperatorList},this)&&(Object.keys(this.intentStates).forEach(function(t){delete this.intentStates[t]},this),this.objs.clear(),this.annotationsPromise=null,this.pendingCleanup=!1)},_startRenderPage:function(t,e){var n=this.intentStates[e];n.displayReadyCapability&&n.displayReadyCapability.resolve(t)},_renderPageChunk:function(t,e){var n,r,i=this.intentStates[e];for(n=0,r=t.length;n=0;return i=t===a?t:s?new t.constructor(a,t.byteOffset,t.byteLength):new t.constructor(t),r.set(t,i),i}i=(0,l.isArray)(t)?[]:{},r.set(t,i);for(var o in t){for(var h,u=t;!(h=Object.getOwnPropertyDescriptor(u,o));)u=Object.getPrototypeOf(u);void 0!==h.value&&"function"!=typeof h.value&&(i[o]=n(h.value))}return i}if(!this._defer)return void this._listeners.forEach(function(e){e.call(this,{data:t})},this);var r=new WeakMap,i={data:n(t)};this._deferred.then(function(){this._listeners.forEach(function(t){t.call(this,i)},this)}.bind(this))}},{key:"addEventListener",value:function(t,e){this._listeners.push(e)}},{key:"removeEventListener",value:function(t,e){var n=this._listeners.indexOf(e);this._listeners.splice(n,1)}},{key:"terminate",value:function(){this._listeners=[]}}]),t}(),P=function(){function t(){return void 0!==s?s:(0,h.getDefaultSetting)("workerSrc")?(0,h.getDefaultSetting)("workerSrc"):A?A.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"):void(0,l.error)("No PDFJS.workerSrc specified")}function e(){return i?i.promise:(i=(0,l.createPromiseCapability)(),(v||function(e){l.Util.loadScript(t(),function(){e(window.pdfjsDistBuildPdfWorker.WorkerMessageHandler)})})(i.resolve),i.promise)}function n(t){var e="importScripts('"+t+"');";return URL.createObjectURL(new Blob([e]))}function r(t,e){if(this.name=t,this.destroyed=!1,this._readyCapability=(0,l.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,e)return void this._initializeFromPort(e);this._initialize()}var i,a=0;return r.prototype={get promise(){return this._readyCapability.promise},get port(){return this._port},get messageHandler(){return this._messageHandler},_initializeFromPort:function(t){this._port=t,this._messageHandler=new l.MessageHandler("main","worker",t),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve()},_initialize:function(){if(!g&&!(0,h.getDefaultSetting)("disableWorker")&&"undefined"!=typeof Worker){var e=t();try{(0,l.isSameOrigin)(window.location.href,e)||(e=n(new URL(e,window.location).href));var r=new Worker(e),i=new l.MessageHandler("main","worker",r),a=function(){r.removeEventListener("error",s),i.destroy(),r.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()}.bind(this),s=function(t){this._webWorker||a()}.bind(this);r.addEventListener("error",s),i.on("test",function(t){if(r.removeEventListener("error",s),this.destroyed)return void a();t&&t.supportTypedArray?(this._messageHandler=i,this._port=r,this._webWorker=r,t.supportTransfers||(m=!0),this._readyCapability.resolve(),i.send("configure",{verbosity:(0,l.getVerbosityLevel)()})):(this._setupFakeWorker(),i.destroy(),r.terminate())}.bind(this)),i.on("console_log",function(t){console.log.apply(console,t)}),i.on("console_error",function(t){console.error.apply(console,t)}),i.on("ready",function(t){if(r.removeEventListener("error",s),this.destroyed)return void a();try{o()}catch(t){this._setupFakeWorker()}}.bind(this));var o=function(){var t=(0,h.getDefaultSetting)("postMessageTransfers")&&!m,e=new Uint8Array([t?255:0]);try{i.send("test",e,[e.buffer])}catch(t){(0,l.info)("Cannot use postMessage transfers"),e[0]=0,i.send("test",e)}};return void o()}catch(t){(0,l.info)("The worker has been disabled.")}}this._setupFakeWorker()},_setupFakeWorker:function(){g||(0,h.getDefaultSetting)("disableWorker")||((0,l.warn)("Setting up fake worker."),g=!0),e().then(function(t){if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));var e=Uint8Array!==Float32Array,n=new C(e);this._port=n;var r="fake"+a++,i=new l.MessageHandler(r+"_worker",r,n);t.setup(i,n);var s=new l.MessageHandler(r,r+"_worker",n);this._messageHandler=s,this._readyCapability.resolve()}.bind(this))},destroy:function(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}},r}(),L=function(){function t(t,e,n,r){this.messageHandler=t,this.loadingTask=e,this.pdfDataRangeTransport=n,this.commonObjs=new E,this.fontLoader=new u.FontLoader(e.docId),this.CMapReaderFactory=new r({baseUrl:(0,h.getDefaultSetting)("cMapUrl"),isCompressed:(0,h.getDefaultSetting)("cMapPacked")}),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this.pageCache=[],this.pagePromises=[],this.downloadInfoCapability=(0,l.createPromiseCapability)(),this.setupMessageHandler()}return t.prototype={destroy:function(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,l.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));var t=[];this.pageCache.forEach(function(e){e&&t.push(e._destroy())}),this.pageCache=[],this.pagePromises=[];var e=this,n=this.messageHandler.sendWithPromise("Terminate",null);return t.push(n),Promise.all(t).then(function(){e.fontLoader.clear(),e.pdfDataRangeTransport&&(e.pdfDataRangeTransport.abort(),e.pdfDataRangeTransport=null),e.messageHandler&&(e.messageHandler.destroy(),e.messageHandler=null),e.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise},setupMessageHandler:function(){var t=this.messageHandler,e=this.loadingTask,n=this.pdfDataRangeTransport;n&&(n.addRangeListener(function(e,n){t.send("OnDataRange",{begin:e,chunk:n})}),n.addProgressListener(function(e){t.send("OnDataProgress",{loaded:e})}),n.addProgressiveReadListener(function(e){t.send("OnDataRange",{chunk:e})}),t.on("RequestDataRange",function(t){n.requestDataRange(t.begin,t.end)},this)),t.on("GetDoc",function(t){var e=t.pdfInfo;this.numPages=t.pdfInfo.numPages;var n=this.loadingTask,r=new k(e,this,n);this.pdfDocument=r,n._capability.resolve(r)},this),t.on("PasswordRequest",function(t){var n=this;if(this._passwordCapability=(0,l.createPromiseCapability)(),e.onPassword){var r=function(t){n._passwordCapability.resolve({password:t})};e.onPassword(r,t.code)}else this._passwordCapability.reject(new l.PasswordException(t.message,t.code));return this._passwordCapability.promise},this),t.on("PasswordException",function(t){e._capability.reject(new l.PasswordException(t.message,t.code))},this),t.on("InvalidPDF",function(t){this.loadingTask._capability.reject(new l.InvalidPDFException(t.message))},this),t.on("MissingPDF",function(t){this.loadingTask._capability.reject(new l.MissingPDFException(t.message))},this),t.on("UnexpectedResponse",function(t){this.loadingTask._capability.reject(new l.UnexpectedResponseException(t.message,t.status))},this),t.on("UnknownError",function(t){this.loadingTask._capability.reject(new l.UnknownErrorException(t.message,t.details))},this),t.on("DataLoaded",function(t){this.downloadInfoCapability.resolve(t)},this),t.on("PDFManagerReady",function(t){this.pdfDataRangeTransport&&this.pdfDataRangeTransport.transportReady()},this),t.on("StartRenderPage",function(t){if(!this.destroyed){var e=this.pageCache[t.pageIndex];e.stats.timeEnd("Page Request"),e._startRenderPage(t.transparency,t.intent)}},this),t.on("RenderPageChunk",function(t){if(!this.destroyed){this.pageCache[t.pageIndex]._renderPageChunk(t.operatorList,t.intent)}},this),t.on("commonobj",function(t){if(!this.destroyed){var e=t[0],n=t[1];if(!this.commonObjs.hasData(e))switch(n){case"Font":var r=t[2];if("error"in r){var i=r.error;(0,l.warn)("Error during font loading: "+i),this.commonObjs.resolve(e,i);break}var a=null;(0,h.getDefaultSetting)("pdfBug")&&l.globalScope.FontInspector&&l.globalScope.FontInspector.enabled&&(a={registerFont:function(t,e){l.globalScope.FontInspector.fontAdded(t,e)}});var s=new u.FontFaceObject(r,{isEvalSuported:(0,h.getDefaultSetting)("isEvalSupported"),disableFontFace:(0,h.getDefaultSetting)("disableFontFace"),fontRegistry:a});this.fontLoader.bind([s],function(t){this.commonObjs.resolve(e,s)}.bind(this));break;case"FontPath":this.commonObjs.resolve(e,t[2]);break;default:(0,l.error)("Got unknown common object type "+n)}}},this),t.on("obj",function(t){if(!this.destroyed){var e,n=t[0],r=t[1],i=t[2],a=this.pageCache[r];if(!a.objs.hasData(n))switch(i){case"JpegStream":e=t[3],(0,l.loadJpegStream)(n,e,a.objs);break;case"Image":e=t[3],a.objs.resolve(n,e);e&&"data"in e&&e.data.length>8e6&&(a.cleanupAfterRender=!0);break;default:(0,l.error)("Got unknown object type "+i)}}},this),t.on("DocProgress",function(t){if(!this.destroyed){var e=this.loadingTask;e.onProgress&&e.onProgress({loaded:t.loaded,total:t.total})}},this),t.on("PageError",function(t){if(!this.destroyed){var e=this.pageCache[t.pageNum-1],n=e.intentStates[t.intent];if(n.displayReadyCapability?n.displayReadyCapability.reject(t.error):(0,l.error)(t.error),n.operatorList){n.operatorList.lastChunk=!0;for(var r=0;rthis.numPages)return Promise.reject(new Error("Invalid page request"));var n=t-1;if(n in this.pagePromises)return this.pagePromises[n];var r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:n}).then(function(t){if(this.destroyed)throw new Error("Transport destroyed");var e=new T(n,t,this);return this.pageCache[n]=e,e}.bind(this));return this.pagePromises[n]=r,r},getPageIndex:function(t){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:t}).catch(function(t){return Promise.reject(new Error(t))})},getAnnotations:function(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})},getDestinations:function(){return this.messageHandler.sendWithPromise("GetDestinations",null)},getDestination:function(t){return this.messageHandler.sendWithPromise("GetDestination",{id:t})},getPageLabels:function(){return this.messageHandler.sendWithPromise("GetPageLabels",null)},getAttachments:function(){return this.messageHandler.sendWithPromise("GetAttachments",null)},getJavaScript:function(){return this.messageHandler.sendWithPromise("GetJavaScript",null)},getOutline:function(){return this.messageHandler.sendWithPromise("GetOutline",null)},getMetadata:function(){return this.messageHandler.sendWithPromise("GetMetadata",null).then(function(t){return{info:t[0],metadata:t[1]?new f.Metadata(t[1]):null}})},getStats:function(){return this.messageHandler.sendWithPromise("GetStats",null)},startCleanup:function(){this.messageHandler.sendWithPromise("Cleanup",null).then(function(){for(var t=0,e=this.pageCache.length;t>>8^o[a]}return-1^r}function e(e,n,r,i){var a=i,s=n.length;r[a]=s>>24&255,r[a+1]=s>>16&255,r[a+2]=s>>8&255,r[a+3]=255&s,a+=4,r[a]=255&e.charCodeAt(0),r[a+1]=255&e.charCodeAt(1),r[a+2]=255&e.charCodeAt(2),r[a+3]=255&e.charCodeAt(3),a+=4,r.set(n,a),a+=n.length;var o=t(r,i+4,a);r[a]=o>>24&255,r[a+1]=o>>16&255,r[a+2]=o>>8&255,r[a+3]=255&o}function n(t,e,n){for(var r=1,i=0,a=e;a>3;break;case r.ImageKind.RGB_24BPP:l=2,c=8,h=3*u;break;case r.ImageKind.RGBA_32BPP:l=6,c=8,h=4*u;break;default:throw new Error("invalid format")}var p,g,m=new Uint8Array((1+h)*d),A=0,v=0;for(p=0;p>24&255,u>>16&255,u>>8&255,255&u,d>>24&255,d>>16&255,d>>8&255,255&d,c,l,0,0,0]),y=m.length,S=Math.ceil(y/65535),x=new Uint8Array(2+y+5*S+4),w=0;x[w++]=120,x[w++]=156;for(var _=0;y>65535;)x[w++]=0,x[w++]=255,x[w++]=255,x[w++]=0,x[w++]=0,x.set(m.subarray(_,_+65535),w),w+=65535,_+=65535,y-=65535;x[w++]=1,x[w++]=255&y,x[w++]=y>>8&255,x[w++]=255&~y,x[w++]=(65535&~y)>>8&255,x.set(m.subarray(_),w),w+=m.length-_;var k=n(m,0,m.length);x[w++]=k>>24&255,x[w++]=k>>16&255,x[w++]=k>>8&255,x[w++]=255&k;var T=a.length+3*s+b.length+x.length,C=new Uint8Array(T),P=0;return C.set(a,P),P+=a.length,e("IHDR",b,C,P),P+=s+b.length,e("IDATA",x,C,P),P+=s+x.length,e("IEND",new Uint8Array(0),C,P),(0,r.createObjectURL)(C,"image/png",o)}for(var a=new Uint8Array([137,80,78,71,13,10,26,10]),s=12,o=new Int32Array(256),c=0;c<256;c++){for(var l=c,h=0;h<8;h++)l=1&l?3988292384^l>>1&2147483647:l>>1&2147483647;o[c]=l}return function(t,e){return i(t,void 0===t.kind?r.ImageKind.GRAYSCALE_1BPP:t.kind,e)}}(),o=function(){function t(){this.fontSizeScale=1,this.fontWeight=a.fontWeight,this.fontSize=0,this.textMatrix=r.IDENTITY_MATRIX,this.fontMatrix=r.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=a.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}return t.prototype={clone:function(){return Object.create(this)},setCurrentPoint:function(t,e){this.x=t,this.y=e}},t}();e.SVGGraphics=i=function(){function t(t){for(var e=[],n=[],r=t.length,i=0;i1&&(h.vertical?o.canvasWidth=n.height*e._viewport.scale:o.canvasWidth=n.width*e._viewport.scale),e._textDivProperties.set(s,o),e._enhanceTextSelection){var m=1,A=0;0!==l&&(m=Math.cos(l),A=Math.sin(l));var v,b,y=(h.vertical?n.height:n.width)*e._viewport.scale,S=u;0!==l?(v=[m,A,-A,m,p,g],b=r.Util.getAxialAlignedBoundingBox([0,0,y,S],v)):b=[p,g,p+y,g+S],e._bounds.push({left:b[0],top:b[1],right:b[2],bottom:b[3],div:s,size:[y,S],m:v})}}function n(t){if(!t._canceled){var e=t._container,n=t._textDivs,r=t._capability,a=n.length;if(a>h)return t._renderingDone=!0,void r.resolve();var s=document.createElement("canvas");s.mozOpaque=!0;for(var o,c,l=s.getContext("2d",{alpha:!1}),u=0;u0&&(f.scale=f.canvasWidth/m,A="scaleX("+f.scale+")"),0!==f.angle&&(A="rotate("+f.angle+"deg) "+A),""!==A&&(f.originalTransform=A,i.CustomStyle.setProp("transform",d,A)),t._textDivProperties.set(d,f)}}t._renderingDone=!0,r.resolve()}}function a(t){for(var e=t._bounds,n=t._viewport,i=s(n.width,n.height,e),a=0;a0&&(r=r?Math.min(a,r):a)}return r},A=1+Math.min(Math.abs(d),Math.abs(f));c.paddingLeft=m(g,32,16)/A,c.paddingTop=m(g,48,16)/A,c.paddingRight=m(g,0,16)/A,c.paddingBottom=m(g,16,16)/A,t._textDivProperties.set(o,c)}else c.paddingLeft=e[a].left-i[a].left,c.paddingTop=e[a].top-i[a].top,c.paddingRight=i[a].right-e[a].right,c.paddingBottom=i[a].bottom-e[a].bottom,t._textDivProperties.set(o,c)}}function s(t,e,n){var r=n.map(function(t,e){return{x1:t.left,y1:t.top,x2:t.right,y2:t.bottom,index:e,x1New:void 0,x2New:void 0}});o(t,r);var i=new Array(n.length);return r.forEach(function(t){var e=t.index;i[e]={left:t.x1New,top:0,right:t.x2New,bottom:0}}),n.map(function(e,n){var a=i[n],s=r[n];s.x1=e.top,s.y1=t-a.right,s.x2=e.bottom,s.y2=t-a.left,s.index=n,s.x1New=void 0,s.x2New=void 0}),o(e,r),r.forEach(function(t){var e=t.index;i[e].top=t.x1New,i[e].bottom=t.x2New}),i}function o(t,e){e.sort(function(t,e){return t.x1-e.x1||t.index-e.index});var n={x1:-1/0,y1:-1/0,x2:0,y2:1/0,index:-1,x1New:0,x2New:0},r=[{start:-1/0,end:1/0,boundary:n}];e.forEach(function(t){for(var e=0;e=0&&r[n].start>=t.y2;)n--;var i,a,s,o,c=-1/0;for(s=e;s<=n;s++){i=r[s],a=i.boundary;var l;l=a.x2>t.x1?a.index>t.index?a.x1New:t.x1:void 0===a.x2New?(a.x2+t.x1)/2:a.x2New,l>c&&(c=l)}for(t.x1New=c,s=e;s<=n;s++)i=r[s],a=i.boundary,void 0===a.x2New?a.x2>t.x1?a.index>t.index&&(a.x2New=a.x2):a.x2New=c:a.x2New>c&&(a.x2New=Math.max(c,a.x2));var h=[],u=null;for(s=e;s<=n;s++){i=r[s],a=i.boundary;var d=a.x2>t.x2?a:t;u===d?h[h.length-1].end=i.end:(h.push({start:i.start,end:i.end,boundary:d}),u=d)}for(r[e].start=0&&r[o].start>=a.y1;o--)f=r[o].boundary===a;for(o=n+1;!f&&o\\376\\377([^<]+)/g,function(t,e){for(var n=e.replace(/\\([0-3])([0-7])([0-7])/g,function(t,e,n,r){return String.fromCharCode(64*e+8*n+1*r)}),r="",i=0;i=32&&a<127&&60!==a&&62!==a&&38!==a?String.fromCharCode(a):"&#x"+(65536+a).toString(16).substring(1)+";"}return">"+r})}function i(t){if("string"==typeof t){t=r(t);t=(new DOMParser).parseFromString(t,"application/xml")}else t instanceof Document||(0,a.error)("Metadata: Invalid metadata object");this.metaDocument=t,this.metadata=Object.create(null),this.parse()}Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var a=n(0);i.prototype={parse:function(){var t=this.metaDocument,e=t.documentElement;if("rdf:rdf"!==e.nodeName.toLowerCase())for(e=e.firstChild;e&&"rdf:rdf"!==e.nodeName.toLowerCase();)e=e.nextSibling;var n=e?e.nodeName.toLowerCase():null;if(e&&"rdf:rdf"===n&&e.hasChildNodes()){var r,i,a,s,o,c,l,h=e.childNodes;for(s=0,c=h.length;s0;)d[f++]=g&p?0:255,p>>=1;var m=0;for(f=0,0!==d[f]&&(c[0]=1,++m),n=1;n>2)+(d[f+1]?4:0)+(d[f-h+1]?8:0),l[A]&&(c[r+n]=l[A],++m),f++;if(d[f-h]!==d[f]&&(c[r+n]=d[f]?2:4,++m),m>1e3)return null}for(f=h*(s-1),r=e*o,0!==d[f]&&(c[r]=8,++m),n=1;n1e3)return null;var v=new Int32Array([0,o,-1,0,-o,0,0,0,1]),b=[];for(e=0;m&&e<=s;e++){for(var y=e*o,S=y+a;y>4,c[y]&=_>>2|_<<2),w.push(y%o),w.push(y/o|0),--m}while(k!==y);b.push(w),--e}}return function(t){t.save(),t.scale(1/a,-1/s),t.translate(0,-s),t.beginPath();for(var e=0,n=b.length;e>2),S=y.length,x=u+7>>3,w=4294967295,_=l.value?4278190080:255;for(r=0;rx?u:8*k-7,P=-8&C,L=0,E=0;T>=1}for(;n=f&&(s=d,o=u*s),n=0,i=o;i--;)v[n++]=A[m++],v[n++]=A[m++],v[n++]=A[m++],v[n++]=255;t.putImageData(g,0,r*c)}else(0,a.error)("bad image kind: "+e.kind)}function n(t,e){for(var n=e.height,r=e.width,i=n%c,a=(n-i)/c,s=0===i?a:a+1,o=t.createImageData(r,c),l=0,h=e.data,u=o.data,d=0;d>=1}t.putImageData(o,0,d*c)}}function d(t,e){for(var n=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"],r=0,i=n.length;r>8,t[a-2]=t[a-2]*s+n*o>>8,t[a-1]=t[a-1]*s+r*o>>8}}}function p(t,e,n){for(var r=t.length,i=3;i>8]>>8:e[i]*a>>16}}function m(t,e,n,r,i,a,s){var o,c=!!a,l=c?a[0]:0,h=c?a[1]:0,u=c?a[2]:0;o="Luminosity"===i?g:p;for(var d=Math.min(r,Math.ceil(1048576/n)),m=0;m10&&"function"==typeof n,u=h?Date.now()+15:0,d=0,f=this.commonObjs,p=this.objs;;){if(void 0!==r&&o===r.nextBreakPoint)return r.breakIt(o,n),o;if((l=s[o])!==a.OPS.dependency)this[l].apply(this,i[o]);else for(var g=i[o],m=0,A=g.length;m10){if(Date.now()>u)return n(),o;d=0}}},endDrawing:function(){null!==this.current.activeSMask&&this.endSMaskGroup(),this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null),this.cachedCanvases.clear(),o.WebGLUtils.clear(),this.imageLayer&&this.imageLayer.endLayout()},setLineWidth:function(t){this.current.lineWidth=t,this.ctx.lineWidth=t},setLineCap:function(t){this.ctx.lineCap=v[t]},setLineJoin:function(t){this.ctx.lineJoin=b[t]},setMiterLimit:function(t){this.ctx.miterLimit=t},setDash:function(t,e){var n=this.ctx;void 0!==n.setLineDash&&(n.setLineDash(t),n.lineDashOffset=e)},setRenderingIntent:function(t){},setFlatness:function(t){},setGState:function(t){for(var e=0,n=t.length;e0&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask?this.suspendSMaskGroup():this.endSMaskGroup()),this.current.activeSMask=a?this.tempSMask:null,this.current.activeSMask&&this.beginSMaskGroup(),this.tempSMask=null}}},beginSMaskGroup:function(){var t=this.current.activeSMask,e=t.canvas.width,n=t.canvas.height,r="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(r,e,n,!0),a=this.ctx,s=a.mozCurrentTransform;this.ctx.save();var o=i.context;o.scale(1/t.scaleX,1/t.scaleY),o.translate(-t.offsetX,-t.offsetY),o.transform.apply(o,s),t.startTransformInverse=o.mozCurrentTransformInverse,d(a,o),this.ctx=o,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(a),this.groupLevel++},suspendSMaskGroup:function(){var t=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),A(this.ctx,this.current.activeSMask,t),this.ctx.restore(),this.ctx.save(),d(t,this.ctx),this.current.resumeSMaskCtx=t;var e=a.Util.transform(this.current.activeSMask.startTransformInverse,t.mozCurrentTransform);this.ctx.transform.apply(this.ctx,e),t.save(),t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,t.canvas.width,t.canvas.height),t.restore()},resumeSMaskGroup:function(){var t=this.current.resumeSMaskCtx,e=this.ctx;this.ctx=t,this.groupStack.push(e),this.groupLevel++},endSMaskGroup:function(){var t=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),A(this.ctx,this.current.activeSMask,t),this.ctx.restore(),d(t,this.ctx);var e=a.Util.transform(this.current.activeSMask.startTransformInverse,t.mozCurrentTransform);this.ctx.transform.apply(this.ctx,e)},save:function(){this.ctx.save();var t=this.current;this.stateStack.push(t),this.current=t.clone(),this.current.resumeSMaskCtx=null},restore:function(){this.current.resumeSMaskCtx&&this.resumeSMaskGroup(),null===this.current.activeSMask||0!==this.stateStack.length&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask||this.endSMaskGroup(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.ctx.restore(),this.pendingClip=null,this.cachedGetSinglePixelWidth=null)},transform:function(t,e,n,r,i,a){this.ctx.transform(t,e,n,r,i,a),this.cachedGetSinglePixelWidth=null},constructPath:function(t,e){for(var n=this.ctx,r=this.current,i=r.x,s=r.y,o=0,c=0,l=t.length;o100?100:e;this.current.fontSizeScale=e/l;var h=o+" "+s+" "+l+"px "+c;this.ctx.font=h}},setTextRenderingMode:function(t){this.current.textRenderingMode=t},setTextRise:function(t){this.current.textRise=t},moveText:function(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e},setLeadingMoveText:function(t,e){this.setLeading(-e),this.moveText(t,e)},setTextMatrix:function(t,e,n,r,i,a){this.current.textMatrix=[t,e,n,r,i,a],this.current.textMatrixScale=Math.sqrt(t*t+e*e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0},nextLine:function(){this.moveText(0,this.current.leading)},paintChar:function(t,e,n){var r,i=this.ctx,s=this.current,o=s.font,c=s.textRenderingMode,l=s.fontSize/s.fontSizeScale,h=c&a.TextRenderingMode.FILL_STROKE_MASK,u=!!(c&a.TextRenderingMode.ADD_TO_PATH_FLAG);if((o.disableFontFace||u)&&(r=o.getPathGenerator(this.commonObjs,t)),o.disableFontFace?(i.save(),i.translate(e,n),i.beginPath(),r(i,l),h!==a.TextRenderingMode.FILL&&h!==a.TextRenderingMode.FILL_STROKE||i.fill(),h!==a.TextRenderingMode.STROKE&&h!==a.TextRenderingMode.FILL_STROKE||i.stroke(),i.restore()):(h!==a.TextRenderingMode.FILL&&h!==a.TextRenderingMode.FILL_STROKE||i.fillText(t,e,n),h!==a.TextRenderingMode.STROKE&&h!==a.TextRenderingMode.FILL_STROKE||i.strokeText(t,e,n)),u){(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:i.mozCurrentTransform,x:e,y:n,fontSize:l,addToPath:r})}},get isFontSubpixelAAEnabled(){var t=this.canvasFactory.create(10,10).context;t.scale(1.5,1),t.fillText("I",0,10);for(var e=t.getImageData(0,0,10,10).data,n=!1,r=3;r0&&e[r]<255){n=!0;break}return(0,a.shadow)(this,"isFontSubpixelAAEnabled",n)},showText:function(t){var e=this.current,n=e.font;if(n.isType3Font)return this.showType3Text(t);var r=e.fontSize;if(0!==r){var i=this.ctx,s=e.fontSizeScale,o=e.charSpacing,c=e.wordSpacing,l=e.fontDirection,h=e.textHScale*l,u=t.length,d=n.vertical,f=d?1:-1,p=n.defaultVMetrics,g=r*e.fontMatrix[0],m=e.textRenderingMode===a.TextRenderingMode.FILL&&!n.disableFontFace;i.save(),i.transform.apply(i,e.textMatrix),i.translate(e.x,e.y+e.textRise),e.patternFill&&(i.fillStyle=e.fillColor.getPattern(i,this)),l>0?i.scale(h,-1):i.scale(h,1);var A=e.lineWidth,v=e.textMatrixScale;if(0===v||0===A){var b=e.textRenderingMode&a.TextRenderingMode.FILL_STROKE_MASK;b!==a.TextRenderingMode.STROKE&&b!==a.TextRenderingMode.FILL_STROKE||(this.cachedGetSinglePixelWidth=null,A=.65*this.getSinglePixelWidth())}else A/=v;1!==s&&(i.scale(s,s),A/=s),i.lineWidth=A;var y,S=0;for(y=0;y0){var M=1e3*i.measureText(L).width/r*s;if(R4096&&(h=c/4096,c=4096),l>4096&&(u=l/4096,l=4096);var f="groupAt"+this.groupLevel;t.smask&&(f+="_smask_"+this.smaskCounter++%2);var p=this.cachedCanvases.getCanvas(f,c,l,!0),g=p.context;g.scale(1/h,1/u),g.translate(-s,-o),g.transform.apply(g,n),t.smask?this.smaskStack.push({canvas:p.canvas,context:g,offsetX:s,offsetY:o,scaleX:h,scaleY:u,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(s,o),e.scale(h,u)),d(e,g),this.ctx=g,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++,this.current.activeSMask=null},endGroup:function(t){this.groupLevel--;var e=this.ctx;this.ctx=this.groupStack.pop(),void 0!==this.ctx.imageSmoothingEnabled?this.ctx.imageSmoothingEnabled=!1:this.ctx.mozImageSmoothingEnabled=!1,t.smask?this.tempSMask=this.smaskStack.pop():this.ctx.drawImage(e.canvas,0,0),this.restore()},beginAnnotations:function(){this.save(),this.current=new u,this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform)},endAnnotations:function(){this.restore()},beginAnnotation:function(t,e,n){if(this.save(),(0,a.isArray)(t)&&4===t.length){var r=t[2]-t[0],i=t[3]-t[1];this.ctx.rect(t[0],t[1],r,i),this.clip(),this.endPath()}this.transform.apply(this,e),this.transform.apply(this,n)},endAnnotation:function(){this.restore()},paintJpegXObject:function(t,e,n){var r=this.objs.get(t);if(!r)return void(0,a.warn)("Dependent image isn't ready yet");this.save();var i=this.ctx;if(i.scale(1/e,-1/n),i.drawImage(r,0,0,r.width,r.height,0,-n,e,n),this.imageLayer){var s=i.mozCurrentTransformInverse,o=this.getCanvasPosition(0,0);this.imageLayer.appendImage({objId:t,left:o[0],top:o[1],width:e/s[0], +var f,p,g=" attribute vec2 a_position; attribute vec2 a_texCoord; uniform vec2 u_resolution; varying vec2 v_texCoord; void main() { vec2 clipSpace = (a_position / u_resolution) * 2.0 - 1.0; gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); v_texCoord = a_texCoord; } ",m=" precision mediump float; uniform vec4 u_backdrop; uniform int u_subtype; uniform sampler2D u_image; uniform sampler2D u_mask; varying vec2 v_texCoord; void main() { vec4 imageColor = texture2D(u_image, v_texCoord); vec4 maskColor = texture2D(u_mask, v_texCoord); if (u_backdrop.a > 0.0) { maskColor.rgb = maskColor.rgb * maskColor.a + u_backdrop.rgb * (1.0 - maskColor.a); } float lum; if (u_subtype == 0) { lum = maskColor.a; } else { lum = maskColor.r * 0.3 + maskColor.g * 0.59 + maskColor.b * 0.11; } imageColor.a *= lum; imageColor.rgb *= imageColor.a; gl_FragColor = imageColor; } ",A=null,v=" attribute vec2 a_position; attribute vec3 a_color; uniform vec2 u_resolution; uniform vec2 u_scale; uniform vec2 u_offset; varying vec4 v_color; void main() { vec2 position = (a_position + u_offset) * u_scale; vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0; gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); v_color = vec4(a_color / 255.0, 1.0); } ",b=" precision mediump float; varying vec4 v_color; void main() { gl_FragColor = v_color; } ",y=null;return{get isEnabled(){if((0,r.getDefaultSetting)("disableWebGL"))return!1;var t=!1;try{o(),t=!!f}catch(t){}return(0,i.shadow)(this,"isEnabled",t)},composeSMask:l,drawFigures:u,clear:d}}();e.WebGLUtils=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PDFJS=e.isWorker=e.globalScope=void 0;var r=n(3),i=n(1),a=n(0),s=n(2),o=n(7),c=n(5),l=n(4),h="undefined"==typeof window;a.globalScope.PDFJS||(a.globalScope.PDFJS={});var u=a.globalScope.PDFJS;u.version="1.8.310",u.build="e42fc546",u.pdfBug=!1,void 0!==u.verbosity&&(0,a.setVerbosityLevel)(u.verbosity),delete u.verbosity,Object.defineProperty(u,"verbosity",{get:function(){return(0,a.getVerbosityLevel)()},set:function(t){(0,a.setVerbosityLevel)(t)},enumerable:!0,configurable:!0}),u.VERBOSITY_LEVELS=a.VERBOSITY_LEVELS,u.OPS=a.OPS,u.UNSUPPORTED_FEATURES=a.UNSUPPORTED_FEATURES,u.isValidUrl=i.isValidUrl,u.shadow=a.shadow,u.createBlob=a.createBlob,u.createObjectURL=function(t,e){return(0,a.createObjectURL)(t,e,u.disableCreateObjectURL)},Object.defineProperty(u,"isLittleEndian",{configurable:!0,get:function(){return(0,a.shadow)(u,"isLittleEndian",(0,a.isLittleEndian)())}}),u.removeNullCharacters=a.removeNullCharacters,u.PasswordResponses=a.PasswordResponses,u.PasswordException=a.PasswordException,u.UnknownErrorException=a.UnknownErrorException,u.InvalidPDFException=a.InvalidPDFException,u.MissingPDFException=a.MissingPDFException,u.UnexpectedResponseException=a.UnexpectedResponseException,u.Util=a.Util,u.PageViewport=a.PageViewport,u.createPromiseCapability=a.createPromiseCapability,u.maxImageSize=void 0===u.maxImageSize?-1:u.maxImageSize,u.cMapUrl=void 0===u.cMapUrl?null:u.cMapUrl,u.cMapPacked=void 0!==u.cMapPacked&&u.cMapPacked,u.disableFontFace=void 0!==u.disableFontFace&&u.disableFontFace,u.imageResourcesPath=void 0===u.imageResourcesPath?"":u.imageResourcesPath,u.disableWorker=void 0!==u.disableWorker&&u.disableWorker,u.workerSrc=void 0===u.workerSrc?null:u.workerSrc,u.workerPort=void 0===u.workerPort?null:u.workerPort,u.disableRange=void 0!==u.disableRange&&u.disableRange,u.disableStream=void 0!==u.disableStream&&u.disableStream,u.disableAutoFetch=void 0!==u.disableAutoFetch&&u.disableAutoFetch,u.pdfBug=void 0!==u.pdfBug&&u.pdfBug,u.postMessageTransfers=void 0===u.postMessageTransfers||u.postMessageTransfers,u.disableCreateObjectURL=void 0!==u.disableCreateObjectURL&&u.disableCreateObjectURL,u.disableWebGL=void 0===u.disableWebGL||u.disableWebGL,u.externalLinkTarget=void 0===u.externalLinkTarget?i.LinkTarget.NONE:u.externalLinkTarget,u.externalLinkRel=void 0===u.externalLinkRel?i.DEFAULT_LINK_REL:u.externalLinkRel,u.isEvalSupported=void 0===u.isEvalSupported||u.isEvalSupported,u.pdfjsNext=void 0!==u.pdfjsNext&&u.pdfjsNext;var d=u.openExternalLinksInNewWindow;delete u.openExternalLinksInNewWindow,Object.defineProperty(u,"openExternalLinksInNewWindow",{get:function(){return u.externalLinkTarget===i.LinkTarget.BLANK},set:function(t){if(t&&(0,a.deprecated)('PDFJS.openExternalLinksInNewWindow, please use "PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK" instead.'),u.externalLinkTarget!==i.LinkTarget.NONE)return void(0,a.warn)("PDFJS.externalLinkTarget is already initialized");u.externalLinkTarget=t?i.LinkTarget.BLANK:i.LinkTarget.NONE},enumerable:!0,configurable:!0}),d&&(u.openExternalLinksInNewWindow=d),u.getDocument=r.getDocument,u.LoopbackPort=r.LoopbackPort,u.PDFDataRangeTransport=r.PDFDataRangeTransport,u.PDFWorker=r.PDFWorker,u.hasCanvasTypedArrays=!0,u.CustomStyle=i.CustomStyle,u.LinkTarget=i.LinkTarget,u.addLinkAttributes=i.addLinkAttributes,u.getFilenameFromUrl=i.getFilenameFromUrl,u.isExternalLinkTargetSet=i.isExternalLinkTargetSet,u.AnnotationLayer=s.AnnotationLayer,u.renderTextLayer=c.renderTextLayer,u.Metadata=o.Metadata,u.SVGGraphics=l.SVGGraphics,u.UnsupportedManager=r._UnsupportedManager,e.globalScope=a.globalScope,e.isWorker=h,e.PDFJS=u},function(t,e,n){"use strict";function r(t){t.mozCurrentTransform||(t._originalSave=t.save,t._originalRestore=t.restore,t._originalRotate=t.rotate,t._originalScale=t.scale,t._originalTranslate=t.translate,t._originalTransform=t.transform,t._originalSetTransform=t.setTransform,t._transformMatrix=t._transformMatrix||[1,0,0,1,0,0],t._transformStack=[],Object.defineProperty(t,"mozCurrentTransform",{get:function(){return this._transformMatrix}}),Object.defineProperty(t,"mozCurrentTransformInverse",{get:function(){var t=this._transformMatrix,e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],o=e*i-n*r,c=n*r-e*i;return[i/o,n/c,r/c,e/o,(i*a-r*s)/c,(n*a-e*s)/o]}}),t.save=function(){var t=this._transformMatrix;this._transformStack.push(t),this._transformMatrix=t.slice(0,6),this._originalSave()},t.restore=function(){var t=this._transformStack.pop();t&&(this._transformMatrix=t,this._originalRestore())},t.translate=function(t,e){var n=this._transformMatrix;n[4]=n[0]*t+n[2]*e+n[4],n[5]=n[1]*t+n[3]*e+n[5],this._originalTranslate(t,e)},t.scale=function(t,e){var n=this._transformMatrix;n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*e,n[3]=n[3]*e,this._originalScale(t,e)},t.transform=function(e,n,r,i,a,s){var o=this._transformMatrix;this._transformMatrix=[o[0]*e+o[2]*n,o[1]*e+o[3]*n,o[0]*r+o[2]*i,o[1]*r+o[3]*i,o[0]*a+o[2]*s+o[4],o[1]*a+o[3]*s+o[5]],t._originalTransform(e,n,r,i,a,s)},t.setTransform=function(e,n,r,i,a,s){this._transformMatrix=[e,n,r,i,a,s],t._originalSetTransform(e,n,r,i,a,s)},t.rotate=function(t){var e=Math.cos(t),n=Math.sin(t),r=this._transformMatrix;this._transformMatrix=[r[0]*e+r[2]*n,r[1]*e+r[3]*n,r[0]*-n+r[2]*e,r[1]*-n+r[3]*e,r[4],r[5]],this._originalRotate(t)})}function i(t){var e,n,r,i,a=t.width,s=t.height,o=a+1,c=new Uint8Array(o*(s+1)),l=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),h=a+7&-8,u=t.data,d=new Uint8Array(h*s),f=0;for(e=0,i=u.length;e0;)d[f++]=g&p?0:255,p>>=1;var m=0;for(f=0,0!==d[f]&&(c[0]=1,++m),n=1;n>2)+(d[f+1]?4:0)+(d[f-h+1]?8:0),l[A]&&(c[r+n]=l[A],++m),f++;if(d[f-h]!==d[f]&&(c[r+n]=d[f]?2:4,++m),m>1e3)return null}for(f=h*(s-1),r=e*o,0!==d[f]&&(c[r]=8,++m),n=1;n1e3)return null;var v=new Int32Array([0,o,-1,0,-o,0,0,0,1]),b=[];for(e=0;m&&e<=s;e++){for(var y=e*o,S=y+a;y>4,c[y]&=_>>2|_<<2),w.push(y%o),w.push(y/o|0),--m}while(k!==y);b.push(w),--e}}return function(t){t.save(),t.scale(1/a,-1/s),t.translate(0,-s),t.beginPath();for(var e=0,n=b.length;e>2),S=y.length,x=u+7>>3,w=4294967295,_=l.value?4278190080:255;for(r=0;rx?u:8*k-7,P=-8&C,L=0,E=0;T>=1}for(;n=f&&(s=d,o=u*s),n=0,i=o;i--;)v[n++]=A[m++],v[n++]=A[m++],v[n++]=A[m++],v[n++]=255;t.putImageData(g,0,r*c)}else(0,a.error)("bad image kind: "+e.kind)}function n(t,e){for(var n=e.height,r=e.width,i=n%c,a=(n-i)/c,s=0===i?a:a+1,o=t.createImageData(r,c),l=0,h=e.data,u=o.data,d=0;d>=1}t.putImageData(o,0,d*c)}}function d(t,e){for(var n=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"],r=0,i=n.length;r>8,t[a-2]=t[a-2]*s+n*o>>8,t[a-1]=t[a-1]*s+r*o>>8}}}function p(t,e,n){for(var r=t.length,i=3;i>8]>>8:e[i]*a>>16}}function m(t,e,n,r,i,a,s){var o,c=!!a,l=c?a[0]:0,h=c?a[1]:0,u=c?a[2]:0;o="Luminosity"===i?g:p;for(var d=Math.min(r,Math.ceil(1048576/n)),m=0;m10&&"function"==typeof n,u=h?Date.now()+15:0,d=0,f=this.commonObjs,p=this.objs;;){if(void 0!==r&&o===r.nextBreakPoint)return r.breakIt(o,n),o;if((l=s[o])!==a.OPS.dependency)this[l].apply(this,i[o]);else for(var g=i[o],m=0,A=g.length;m10){if(Date.now()>u)return n(),o;d=0}}},endDrawing:function(){null!==this.current.activeSMask&&this.endSMaskGroup(),this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null),this.cachedCanvases.clear(),o.WebGLUtils.clear(),this.imageLayer&&this.imageLayer.endLayout()},setLineWidth:function(t){this.current.lineWidth=t,this.ctx.lineWidth=t},setLineCap:function(t){this.ctx.lineCap=v[t]},setLineJoin:function(t){this.ctx.lineJoin=b[t]},setMiterLimit:function(t){this.ctx.miterLimit=t},setDash:function(t,e){var n=this.ctx;void 0!==n.setLineDash&&(n.setLineDash(t),n.lineDashOffset=e)},setRenderingIntent:function(t){},setFlatness:function(t){},setGState:function(t){for(var e=0,n=t.length;e0&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask?this.suspendSMaskGroup():this.endSMaskGroup()),this.current.activeSMask=a?this.tempSMask:null,this.current.activeSMask&&this.beginSMaskGroup(),this.tempSMask=null}}},beginSMaskGroup:function(){var t=this.current.activeSMask,e=t.canvas.width,n=t.canvas.height,r="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(r,e,n,!0),a=this.ctx,s=a.mozCurrentTransform;this.ctx.save();var o=i.context;o.scale(1/t.scaleX,1/t.scaleY),o.translate(-t.offsetX,-t.offsetY),o.transform.apply(o,s),t.startTransformInverse=o.mozCurrentTransformInverse,d(a,o),this.ctx=o,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(a),this.groupLevel++},suspendSMaskGroup:function(){var t=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),A(this.ctx,this.current.activeSMask,t),this.ctx.restore(),this.ctx.save(),d(t,this.ctx),this.current.resumeSMaskCtx=t;var e=a.Util.transform(this.current.activeSMask.startTransformInverse,t.mozCurrentTransform);this.ctx.transform.apply(this.ctx,e),t.save(),t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,t.canvas.width,t.canvas.height),t.restore()},resumeSMaskGroup:function(){var t=this.current.resumeSMaskCtx,e=this.ctx;this.ctx=t,this.groupStack.push(e),this.groupLevel++},endSMaskGroup:function(){var t=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),A(this.ctx,this.current.activeSMask,t),this.ctx.restore(),d(t,this.ctx);var e=a.Util.transform(this.current.activeSMask.startTransformInverse,t.mozCurrentTransform);this.ctx.transform.apply(this.ctx,e)},save:function(){this.ctx.save();var t=this.current;this.stateStack.push(t),this.current=t.clone(),this.current.resumeSMaskCtx=null},restore:function(){this.current.resumeSMaskCtx&&this.resumeSMaskGroup(),null===this.current.activeSMask||0!==this.stateStack.length&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask||this.endSMaskGroup(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.ctx.restore(),this.pendingClip=null,this.cachedGetSinglePixelWidth=null)},transform:function(t,e,n,r,i,a){this.ctx.transform(t,e,n,r,i,a),this.cachedGetSinglePixelWidth=null},constructPath:function(t,e){for(var n=this.ctx,r=this.current,i=r.x,s=r.y,o=0,c=0,l=t.length;o100?100:e;this.current.fontSizeScale=e/l;var h=o+" "+s+" "+l+"px "+c;this.ctx.font=h}},setTextRenderingMode:function(t){this.current.textRenderingMode=t},setTextRise:function(t){this.current.textRise=t},moveText:function(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e},setLeadingMoveText:function(t,e){this.setLeading(-e),this.moveText(t,e)},setTextMatrix:function(t,e,n,r,i,a){this.current.textMatrix=[t,e,n,r,i,a],this.current.textMatrixScale=Math.sqrt(t*t+e*e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0},nextLine:function(){this.moveText(0,this.current.leading)},paintChar:function(t,e,n){var r,i=this.ctx,s=this.current,o=s.font,c=s.textRenderingMode,l=s.fontSize/s.fontSizeScale,h=c&a.TextRenderingMode.FILL_STROKE_MASK,u=!!(c&a.TextRenderingMode.ADD_TO_PATH_FLAG);if((o.disableFontFace||u)&&(r=o.getPathGenerator(this.commonObjs,t)),o.disableFontFace?(i.save(),i.translate(e,n),i.beginPath(),r(i,l),h!==a.TextRenderingMode.FILL&&h!==a.TextRenderingMode.FILL_STROKE||i.fill(),h!==a.TextRenderingMode.STROKE&&h!==a.TextRenderingMode.FILL_STROKE||i.stroke(),i.restore()):(h!==a.TextRenderingMode.FILL&&h!==a.TextRenderingMode.FILL_STROKE||i.fillText(t,e,n),h!==a.TextRenderingMode.STROKE&&h!==a.TextRenderingMode.FILL_STROKE||i.strokeText(t,e,n)),u){(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:i.mozCurrentTransform,x:e,y:n,fontSize:l,addToPath:r})}},get isFontSubpixelAAEnabled(){var t=this.canvasFactory.create(10,10).context;t.scale(1.5,1),t.fillText("I",0,10);for(var e=t.getImageData(0,0,10,10).data,n=!1,r=3;r0&&e[r]<255){n=!0;break}return(0,a.shadow)(this,"isFontSubpixelAAEnabled",n)},showText:function(t){var e=this.current,n=e.font;if(n.isType3Font)return this.showType3Text(t);var r=e.fontSize;if(0!==r){var i=this.ctx,s=e.fontSizeScale,o=e.charSpacing,c=e.wordSpacing,l=e.fontDirection,h=e.textHScale*l,u=t.length,d=n.vertical,f=d?1:-1,p=n.defaultVMetrics,g=r*e.fontMatrix[0],m=e.textRenderingMode===a.TextRenderingMode.FILL&&!n.disableFontFace;i.save(),i.transform.apply(i,e.textMatrix),i.translate(e.x,e.y+e.textRise),e.patternFill&&(i.fillStyle=e.fillColor.getPattern(i,this)),l>0?i.scale(h,-1):i.scale(h,1);var A=e.lineWidth,v=e.textMatrixScale;if(0===v||0===A){var b=e.textRenderingMode&a.TextRenderingMode.FILL_STROKE_MASK;b!==a.TextRenderingMode.STROKE&&b!==a.TextRenderingMode.FILL_STROKE||(this.cachedGetSinglePixelWidth=null,A=.65*this.getSinglePixelWidth())}else A/=v;1!==s&&(i.scale(s,s),A/=s),i.lineWidth=A;var y,S=0;for(y=0;y0){var M=1e3*i.measureText(L).width/r*s;if(R4096&&(h=c/4096,c=4096),l>4096&&(u=l/4096,l=4096);var f="groupAt"+this.groupLevel;t.smask&&(f+="_smask_"+this.smaskCounter++%2);var p=this.cachedCanvases.getCanvas(f,c,l,!0),g=p.context;g.scale(1/h,1/u),g.translate(-s,-o),g.transform.apply(g,n),t.smask?this.smaskStack.push({canvas:p.canvas,context:g,offsetX:s,offsetY:o,scaleX:h,scaleY:u,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(s,o),e.scale(h,u)),d(e,g),this.ctx=g,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++,this.current.activeSMask=null},endGroup:function(t){this.groupLevel--;var e=this.ctx;this.ctx=this.groupStack.pop(),void 0!==this.ctx.imageSmoothingEnabled?this.ctx.imageSmoothingEnabled=!1:this.ctx.mozImageSmoothingEnabled=!1,t.smask?this.tempSMask=this.smaskStack.pop():this.ctx.drawImage(e.canvas,0,0),this.restore()},beginAnnotations:function(){this.save(),this.current=new u,this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform)},endAnnotations:function(){this.restore()},beginAnnotation:function(t,e,n){if(this.save(),(0,a.isArray)(t)&&4===t.length){var r=t[2]-t[0],i=t[3]-t[1];this.ctx.rect(t[0],t[1],r,i),this.clip(),this.endPath()}this.transform.apply(this,e),this.transform.apply(this,n)},endAnnotation:function(){this.restore()},paintJpegXObject:function(t,e,n){var r=this.objs.get(t);if(!r)return void(0,a.warn)("Dependent image isn't ready yet");this.save();var i=this.ctx;if(i.scale(1/e,-1/n),i.drawImage(r,0,0,r.width,r.height,0,-n,e,n),this.imageLayer){var s=i.mozCurrentTransformInverse,o=this.getCanvasPosition(0,0);this.imageLayer.appendImage({objId:t,left:o[0],top:o[1],width:e/s[0], height:n/s[3]})}this.restore()},paintImageMaskXObject:function(t){var e=this.ctx,r=t.width,a=t.height,s=this.current.fillColor,o=this.current.patternFill,c=this.processingType3;if(c&&void 0===c.compiled&&(c.compiled=r<=1e3&&a<=1e3?i({data:t.data,width:r,height:a}):null),c&&c.compiled)return void c.compiled(e);var l=this.cachedCanvases.getCanvas("maskCanvas",r,a),h=l.context;h.save(),n(h,t),h.globalCompositeOperation="source-in",h.fillStyle=o?s.getPattern(h,this):s,h.fillRect(0,0,r,a),h.restore(),this.paintInlineImageXObject(l.canvas)},paintImageMaskXObjectRepeat:function(t,e,r,i){var a=t.width,s=t.height,o=this.current.fillColor,c=this.current.patternFill,l=this.cachedCanvases.getCanvas("maskCanvas",a,s),h=l.context;h.save(),n(h,t),h.globalCompositeOperation="source-in",h.fillStyle=c?o.getPattern(h,this):o,h.fillRect(0,0,a,s),h.restore();for(var u=this.ctx,d=0,f=i.length;d2&&g>1||f>2&&m>1;){var v=g,b=m;h>2&&g>1&&(v=Math.ceil(g/2),h/=g/v),f>2&&m>1&&(b=Math.ceil(m/2),f/=m/b),s=this.cachedCanvases.getCanvas(A,v,b),p=s.context,p.clearRect(0,0,v,b),p.drawImage(a,0,0,g,m,0,0,v,b),a=s.canvas,g=v,m=b,A="prescale1"===A?"prescale2":"prescale1"}if(i.drawImage(a,0,0,g,m,0,-r,n,r),this.imageLayer){var y=this.getCanvasPosition(0,-r);this.imageLayer.appendImage({imgData:t,left:y[0],top:y[1],width:n/o[0],height:r/o[3]})}this.restore()},paintInlineImageXObjectGroup:function(t,n){var r=this.ctx,i=t.width,a=t.height,s=this.cachedCanvases.getCanvas("inlineImage",i,a);e(s.context,t);for(var o=0,c=n.length;o0&&!r.isSyncFontLoadingSupported?this.prepareFontLoadEvent(n,a,f):f.complete()},r.prototype.queueLoadingCallback=function(t){function e(){for((0,i.assert)(!a.end,"completeRequest() cannot be called twice"),a.end=Date.now();n.requests.length>0&&n.requests[0].end;){var t=n.requests.shift();setTimeout(t.callback,0)}}var n=this.loadingContext,r="pdfjs-font-loading-"+n.nextRequestId++,a={id:r,complete:e,callback:t,started:Date.now()};return n.requests.push(a),a},r.prototype.prepareFontLoadEvent=function(t,e,n){function r(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function a(t,e,n,r){return t.substr(0,e)+r+t.substr(e+n)}function s(t,e){return++u>30?((0,i.warn)("Load test font never loaded."),void e()):(h.font="30px "+t,h.fillText(".",0,20),h.getImageData(0,0,1,1).data[3]>0?void e():void setTimeout(s.bind(null,t,e)))}var o,c,l=document.createElement("canvas");l.width=1,l.height=1;var h=l.getContext("2d"),u=0,d="lt"+Date.now()+this.loadTestFontId++,f=this.loadTestFont;f=a(f,976,d.length,d);var p=r(f,16);for(o=0,c=d.length-3;o=14&&(t=!0),t};Object.defineProperty(r,"isSyncFontLoadingSupported",{get:function(){return(0,i.shadow)(r,"isSyncFontLoadingSupported",s())},enumerable:!0,configurable:!0});var o={get value(){return(0,i.shadow)(this,"value",(0,i.isEvalSupported)())}},c=function(){function t(t,e){this.compiledGlyphs=Object.create(null);for(var n in t)this[n]=t[n];this.options=e}return t.prototype={createNativeFontFace:function(){if(!this.data)return null;if(this.options.disableFontFace)return this.disableFontFace=!0,null;var t=new FontFace(this.loadedName,this.data,{});return this.options.fontRegistry&&this.options.fontRegistry.registerFont(this),t},createFontFaceRule:function(){if(!this.data)return null;if(this.options.disableFontFace)return this.disableFontFace=!0,null;var t=(0,i.bytesToString)(new Uint8Array(this.data)),e=this.loadedName,n="url(data:"+this.mimetype+";base64,"+btoa(t)+");",r='@font-face { font-family:"'+e+'";src:'+n+"}";return this.options.fontRegistry&&this.options.fontRegistry.registerFont(this,n),r},getPathGenerator:function(t,e){if(!(e in this.compiledGlyphs)){var n,r,i,a=t.get(this.loadedName+"_path_"+e);if(this.options.isEvalSupported&&o.value){var s,c="";for(r=0,i=a.length;rl[r+1]&&(c=n,n=r,r=c,c=a,a=s,s=c),l[r+1]>l[i+1]&&(c=r,r=i,i=c,c=s,s=o,o=c),l[n+1]>l[r+1]&&(c=n,n=r,r=c,c=a,a=s,s=c);var f=(l[n]+e.offsetX)*e.scaleX,p=(l[n+1]+e.offsetY)*e.scaleY,g=(l[r]+e.offsetX)*e.scaleX,m=(l[r+1]+e.offsetY)*e.scaleY,A=(l[i]+e.offsetX)*e.scaleX,v=(l[i+1]+e.offsetY)*e.scaleY;if(!(p>=v))for(var b,y,S,x,w,_,k,T,C,P=h[a],L=h[a+1],E=h[a+2],R=h[s],O=h[s+1],I=h[s+2],F=h[o],M=h[o+1],D=h[o+2],N=Math.round(p),j=Math.round(v),U=N;U<=j;U++){Uv?1:m===v?0:(m-U)/(m-v),b=g-(g-A)*C,y=R-(R-F)*C,S=O-(O-M)*C,x=I-(I-D)*C),C=Uv?1:(p-U)/(p-v),w=f-(f-A)*C,_=P-(P-F)*C,k=L-(L-M)*C,T=E-(E-D)*C;for(var B=Math.round(Math.min(b,w)),W=Math.round(Math.max(b,w)),G=d*U+4*B,X=B;X<=W;X++)C=(b-X)/(b-w),C=C<0?0:C>1?1:C,u[G++]=y-(y-_)*C|0,u[G++]=S-(S-k)*C|0,u[G++]=x-(x-T)*C|0,u[G++]=255}}function e(e,n,r){var a,s,o=n.coords,c=n.colors;switch(n.type){case"lattice":var l=n.verticesPerRow,h=Math.floor(o.length/l)-1,u=l-1;for(a=0;a=0,c=/Chrome\/(39|40)\./.test(r),l=r.indexOf("CriOS")>=0,h=r.indexOf("Trident")>=0,u=/\b(iPad|iPhone|iPod)(?=;)/.test(r),d=r.indexOf("Opera")>=0,f=/Safari\//.test(r)&&!/(Chrome\/|Android\s)/.test(r),p="object"===("undefined"==typeof window?"undefined":e(window))&&"object"===("undefined"==typeof document?"undefined":e(document));"undefined"==typeof PDFJS&&(n.PDFJS={}),PDFJS.compatibilityChecked=!0,function(){function t(t,e){return new o(this.slice(t,e))}function r(t,e){arguments.length<2&&(e=0);for(var n=0,r=t.length;n>>0},set:function(e){var n=this.buffer,r=t<<2;n[r]=255&e,n[r+1]=e>>8&255,n[r+2]=e>>16&255,n[r+3]=e>>>24&255}}}function s(t){for(;c>2,l=(3&a)<<4|s>>4,h=n+1>6:64,u=n+2>(-2*r&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return a}}}(),function(){void 0===Function.prototype.bind&&(Function.prototype.bind=function(t){var e=this,n=Array.prototype.slice.call(arguments,1);return function(){var r=n.concat(Array.prototype.slice.call(arguments));return e.apply(t,r)}})}(),function(){if(p){"dataset"in document.createElement("div")||Object.defineProperty(HTMLElement.prototype,"dataset",{get:function(){if(this._dataset)return this._dataset;for(var t={},e=0,n=this.attributes.length;e=0&&r&&a.splice(s,1),t.className=a.join(" "),s>=0}if(p){if(!("classList"in document.createElement("div"))){var e={add:function(e){t(this.element,e,!0,!1)},contains:function(e){return t(this.element,e,!1,!1)},remove:function(e){t(this.element,e,!1,!0)},toggle:function(e){t(this.element,e,!0,!0)}};Object.defineProperty(HTMLElement.prototype,"classList",{get:function(){if(this._classList)return this._classList;var t=Object.create(e,{element:{value:this,writable:!1,enumerable:!0}});return Object.defineProperty(this,"_classList",{value:t,writable:!1,enumerable:!1}),t},enumerable:!0})}}}(),function(){if(!("undefined"==typeof importScripts||"console"in n)){var t={},e={log:function(){var t=Array.prototype.slice.call(arguments);n.postMessage({targetName:"main",action:"console_log",data:t})},error:function(){var t=Array.prototype.slice.call(arguments);n.postMessage({targetName:"main",action:"console_error",data:t})},time:function(e){t[e]=Date.now()},timeEnd:function(e){var n=t[e];if(!n)throw new Error("Unknown timer name "+e);this.log("Timer:",e,Date.now()-n)}};n.console=e}}(),function(){if(p)"console"in window?"bind"in console.log||(console.log=function(t){return function(e){return t(e)}}(console.log),console.error=function(t){return function(e){return t(e)}}(console.error),console.warn=function(t){return function(e){return t(e)}}(console.warn)):window.console={log:function(){},error:function(){},warn:function(){}}}(),function(){function t(t){e(t.target)&&t.stopPropagation()}function e(t){return t.disabled||t.parentNode&&e(t.parentNode)}d&&document.addEventListener("click",t,!0)}(),function(){(h||l)&&(PDFJS.disableCreateObjectURL=!0)}(),function(){"undefined"!=typeof navigator&&("language"in navigator||(PDFJS.locale=navigator.userLanguage||"en-US"))}(),function(){(f||a||c||u)&&(PDFJS.disableRange=!0,PDFJS.disableStream=!0)}(),function(){p&&(history.pushState&&!a||(PDFJS.disableHistory=!0))}(),function(){if(p)if(window.CanvasPixelArray)"function"!=typeof window.CanvasPixelArray.prototype.set&&(window.CanvasPixelArray.prototype.set=function(t){for(var e=0,n=this.length;e0;){var n=this.handlers.shift(),r=n.thisPromise._status,i=n.thisPromise._value;try{1===r?"function"==typeof n.onResolve&&(i=n.onResolve(i)):"function"==typeof n.onReject&&(i=n.onReject(i),r=1,n.thisPromise._unhandledRejection&&this.removeUnhandeledRejection(n.thisPromise))}catch(e){r=t,i=e}if(n.nextPromise._updateStatus(r,i),Date.now()>=e)break}if(this.handlers.length>0)return void setTimeout(this.runHandlers.bind(this),0);this.running=!1},addUnhandledRejection:function(t){this.unhandledRejections.push({promise:t,time:Date.now()}),this.scheduleRejectionCheck()},removeUnhandeledRejection:function(t){t._unhandledRejection=!1;for(var e=0;e500){var n=this.unhandledRejections[e].promise._value,r="Unhandled rejection: "+n;n.stack&&(r+="\n"+n.stack);try{throw new Error(r)}catch(t){console.warn(r)}this.unhandledRejections.splice(e),e--}this.unhandledRejections.length&&this.scheduleRejectionCheck()}.bind(this),500))}},r=function(t){this._status=0,this._handlers=[];try{t.call(this,this._resolve.bind(this),this._reject.bind(this))}catch(t){this._reject(t)}};r.all=function(e){function n(e){s._status!==t&&(c=[],a(e))}var i,a,s=new r(function(t,e){i=t,a=e}),o=e.length,c=[];if(0===o)return i(c),s;for(var l=0,h=e.length;l32&&e<127&&-1===[34,35,60,62,63,96].indexOf(e)?t:encodeURIComponent(t)}function s(t){var e=t.charCodeAt(0);return e>32&&e<127&&-1===[34,35,60,62,96].indexOf(e)?t:encodeURIComponent(t)}function o(e,n,o){function c(t){b.push(t)}var l=n||"scheme start",h=0,u="",A=!1,v=!1,b=[];t:for(;(e[h-1]!==p||0===h)&&!this._isInvalid;){var y=e[h];switch(l){case"scheme start":if(!y||!g.test(y)){if(n){c("Invalid scheme.");break t}u="",l="no scheme";continue}u+=y.toLowerCase(),l="scheme";break;case"scheme":if(y&&m.test(y))u+=y.toLowerCase();else{if(":"!==y){if(n){if(y===p)break t;c("Code point not allowed in scheme: "+y);break t}u="",h=0,l="no scheme";continue}if(this._scheme=u,u="",n)break t;t(this._scheme)&&(this._isRelative=!0),l="file"===this._scheme?"relative":this._isRelative&&o&&o._scheme===this._scheme?"relative or authority":this._isRelative?"authority first slash":"scheme data"}break;case"scheme data":"?"===y?(this._query="?",l="query"):"#"===y?(this._fragment="#", l="fragment"):y!==p&&"\t"!==y&&"\n"!==y&&"\r"!==y&&(this._schemeData+=a(y));break;case"no scheme":if(o&&t(o._scheme)){l="relative";continue}c("Missing scheme."),r.call(this);break;case"relative or authority":if("/"!==y||"/"!==e[h+1]){c("Expected /, got: "+y),l="relative";continue}l="authority ignore slashes";break;case"relative":if(this._isRelative=!0,"file"!==this._scheme&&(this._scheme=o._scheme),y===p){this._host=o._host,this._port=o._port,this._path=o._path.slice(),this._query=o._query,this._username=o._username,this._password=o._password;break t}if("/"===y||"\\"===y)"\\"===y&&c("\\ is an invalid code point."),l="relative slash";else if("?"===y)this._host=o._host,this._port=o._port,this._path=o._path.slice(),this._query="?",this._username=o._username,this._password=o._password,l="query";else{if("#"!==y){var S=e[h+1],x=e[h+2];("file"!==this._scheme||!g.test(y)||":"!==S&&"|"!==S||x!==p&&"/"!==x&&"\\"!==x&&"?"!==x&&"#"!==x)&&(this._host=o._host,this._port=o._port,this._username=o._username,this._password=o._password,this._path=o._path.slice(),this._path.pop()),l="relative path";continue}this._host=o._host,this._port=o._port,this._path=o._path.slice(),this._query=o._query,this._fragment="#",this._username=o._username,this._password=o._password,l="fragment"}break;case"relative slash":if("/"!==y&&"\\"!==y){"file"!==this._scheme&&(this._host=o._host,this._port=o._port,this._username=o._username,this._password=o._password),l="relative path";continue}"\\"===y&&c("\\ is an invalid code point."),l="file"===this._scheme?"file host":"authority ignore slashes";break;case"authority first slash":if("/"!==y){c("Expected '/', got: "+y),l="authority ignore slashes";continue}l="authority second slash";break;case"authority second slash":if(l="authority ignore slashes","/"!==y){c("Expected '/', got: "+y);continue}break;case"authority ignore slashes":if("/"!==y&&"\\"!==y){l="authority";continue}c("Expected authority, got: "+y);break;case"authority":if("@"===y){A&&(c("@ already seen."),u+="%40"),A=!0;for(var w=0;w