parser_x.js 1.1.30 → 1.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/parser_x.js +1 -1
- package/package.json +1 -1
package/dist/parser_x.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(A,I){"object"==typeof exports&&"object"==typeof module?module.exports=I(require("parser_helper_x.js"),require("axios")):"function"==typeof define&&define.amd?define([,"axios"],I):"object"==typeof exports?exports.parser_x=I(require("parser_helper_x.js"),require("axios")):A.parser_x=I(A.parser_helper_x,A.axios)}(window,(function(A,I){return function(A){var I={};function g(B){if(I[B])return I[B].exports;var Q=I[B]={i:B,l:!1,exports:{}};return A[B].call(Q.exports,Q,Q.exports,g),Q.l=!0,Q.exports}return g.m=A,g.c=I,g.d=function(A,I,B){g.o(A,I)||Object.defineProperty(A,I,{enumerable:!0,get:B})},g.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},g.t=function(A,I){if(1&I&&(A=g(A)),8&I)return A;if(4&I&&"object"==typeof A&&A&&A.__esModule)return A;var B=Object.create(null);if(g.r(B),Object.defineProperty(B,"default",{enumerable:!0,value:A}),2&I&&"string"!=typeof A)for(var Q in A)g.d(B,Q,function(I){return A[I]}.bind(null,Q));return B},g.n=function(A){var I=A&&A.__esModule?function(){return A.default}:function(){return A};return g.d(I,"a",I),I},g.o=function(A,I){return Object.prototype.hasOwnProperty.call(A,I)},g.p="",g(g.s=0)}([function(A,I,g){"use strict";g.r(I),g.d(I,"OFDPrintApi",(function(){return x})),g.d(I,"ajaxUtils",(function(){return b})),g.d(I,"getToSign",(function(){return p})),g.d(I,"packageSigned",(function(){return m})),g.d(I,"free",(function(){return T})),g.d(I,"hashOfdDocument",(function(){return X})),g.d(I,"parseOfdDocument",(function(){return O})),g.d(I,"parseOfdDocumentFromBase64",(function(){return u})),g.d(I,"getOFDPageCount",(function(){return z})),g.d(I,"getAllAttachments",(function(){return P})),g.d(I,"getAttachmentById",(function(){return v})),g.d(I,"getAttachmentArrayBuffer",(function(){return _})),g.d(I,"pageSize",(function(){return $})),g.d(I,"getCustomTag",(function(){return AA})),g.d(I,"getTextObjects",(function(){return IA})),g.d(I,"renderOfd",(function(){return gA})),g.d(I,"renderOfdByIndex",(function(){return BA})),g.d(I,"getFileStream",(function(){return CA})),g.d(I,"setLanguage",(function(){return EA})),g.d(I,"openMetaBaseViewer",(function(){return DA})),g.d(I,"openOFDBaseViewer",(function(){return iA})),g.d(I,"openOFDBaseViewerByBase64",(function(){return oA})),g.d(I,"verifySignature",(function(){return wA})),g.d(I,"printOFD",(function(){return GA})),g.d(I,"getEventBus",(function(){return FA})),g.d(I,"initOFDViewer",(function(){return NA})),g.d(I,"openOFDViewer",(function(){return yA})),g.d(I,"openFile",(function(){return RA})),g.d(I,"openFileBase64",(function(){return hA})),g.d(I,"openOFD",(function(){return MA}));var B=g(1),Q=g.n(B),C=g(5),E=g.n(C),D=g(6),i=g(12),o=g(20),w=g(38),G=g(39),F=g(40),N=g(41),y=g(42),R=g(43),h=g(44),M=g(46),U=g(35),c=g(48),k=g(32),S=g(30),s=g(36),a=g(49),Y=g(50),K=g.n(Y),H=g(51),J=g(52),L=g(53),t=g(54),d=g(31),Z=g(55),e=g.n(Z),n=g(56),q=g.n(n),l=g(57);function W(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return r(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return r(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function r(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var x=c.Print_api,f=window.Module,V={ofdCore:null,viewer:null,eventBus:null,waterText:null,fileName:null,ofdRender:null},b=q.a,p=function(A,I){return Object(k.JSGetToSign)(A,I)},m=function(A,I){return Object(k.JSPackageSigned)(A,I)},T=function(){V.ofdCore&&Object(k.freeOFD)(V.ofdCore)},X=function(A){if(A.ofd instanceof File){var I=new FileReader;I.readAsArrayBuffer(A.ofd),I.onload=function(){A.success&&A.success(Object(k.JSBase64ByHashFile)(I.result,A.list,A.method))}}else A.ofd instanceof ArrayBuffer?A.success&&A.success(Object(k.JSBase64ByHashFile)(A.ofd,A.list,A.method)):e()({url:A.ofd,method:"GET",responseType:"arraybuffer",headers:A.headers}).then((function(I){var g=Object(k.readOFD)(I.data,A.secret,A.digest);j(g,A)})).catch((function(I){A.fail&&A.fail(I)}))},j=function(A,I){0===A.code?(V.ofdCore=new U.Ofd_Core(A.data.ofd,A.data.ofdParserPtr,A.data.leftTime),I.waterText&&(V.waterText=I.waterText),I.digest||(V.waterText="demotest"),I.signatureClickCallback&&(V.eventBus=new i.EventBus,V.eventBus._on("signatureclick",I.signatureClickCallback)),I.signaturesCallback&&I.signaturesCallback(V.ofdCore.getAllSignature(0)),I.success&&I.success(V.ofdCore)):I.fail&&I.fail(A.msg)},O=function(A){QA((function(){if(V.ofdCore&&(Object(k.freeOFD)(V.ofdCore),V.ofdCore=null,V.ofdRender=null),Object(k.CreateLibrary)(),A.ofd instanceof File){var I=new FileReader;I.readAsArrayBuffer(A.ofd),I.onload=function(){var g=Object(k.readOFD)(I.result,A.secret,A.digest);j(g,A)}}else if(A.ofd instanceof ArrayBuffer){var g=Object(k.readOFD)(A.ofd,A.secret,A.digest);j(g,A)}else e()({url:A.ofd,method:"GET",responseType:"arraybuffer",headers:A.headers}).then((function(I){if(A.ofd&&A.ofd.split("/")){var g=A.ofd.split("/");V.fileName=g[g.length-1]}var B=Object(k.readOFD)(I.data,A.secret,A.digest);j(B,A)})).catch((function(I){A.fail&&A.fail(I)}))}))},u=function(A){QA((function(){V.ofdCore&&(Object(k.freeOFD)(V.ofdCore),V.ofdCore=null,V.ofdRender=null),Object(k.CreateLibrary)();var I=Object(k.readOFDByBase64)(A.ofd,A.secret,A.digest);j(I,A)}))},z=function(A){return V.ofdCore.getOFDPageCount(A)},P=function(A){return V.ofdCore.getAllAttachment(A)},v=function(A,I){return V.ofdCore.getAttachmentByID(A,I)},_=function(A,I){return new Promise((function(g,B){var Q=V.ofdCore.getAttachmentByID(A,I);Q?zA(Q.FileLocAbs).then((function(A){g(A)})).catch((function(A){B(A)})):B("attachmentId error")}))},$=function(A,I,g){var B=96;g&&(B=g/V.ofdCore.pageWidth(A,I)*25.4);var Q=new s.Ofd_Core_Helper(B);return{width:V.ofdCore.pageWidth(A,I),height:V.ofdCore.pageHeight(A,I),renderWidth:Q.pageRenderWidth(A,I,V.ofdCore),renderHeight:Q.pageRenderHeight(A,I,V.ofdCore)}},AA=function(A){return V.ofdCore.getCustomTag(A)},IA=function(A){return V.ofdCore.getAllTextObject(A)},gA=function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},B=96;I&&"number"==typeof I&&!isNaN(I)&&(B=I/V.ofdCore.pageWidth(A,0)*25.4);var Q=new s.Ofd_Core_Helper(B);g.waterText?Q.setWaterText(g.waterText):V.waterText&&Q.setWaterText(V.waterText),V.ofdRender?V.ofdRender.setDpi(B):V.ofdRender=new S.Ofd_Render(V.ofdCore,Q),g.mixBlendMode&&V.ofdRender.setMixBlendMode(g.mixBlendMode);var C=[];if(!V.ofdCore.readOfdDocument(A))return C;var E=V.ofdCore.getOFDPageCount(A);g.frontPages>0&&g.frontPages<E&&(E=g.frontPages);for(var D=0;D<E;D++){var i=document.createElement("div"),o=Q.pageRenderWidth(0,D,V.ofdCore),w=Q.pageRenderHeight(0,D,V.ofdCore);i.setAttribute("style","margin-bottom: 20px;position: relative;width:".concat(o,"px;height:").concat(w,"px;background: white;overflow: hidden")),V.ofdRender.renderPage(i,0,D),C.push(i)}return C},BA=function(A,I,g){var B=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},Q=96;g&&"number"==typeof g&&!isNaN(g)&&(Q=g/V.ofdCore.pageWidth(A,I)*25.4);var C=new s.Ofd_Core_Helper(Q);B.waterText?C.setWaterText(B.waterText):V.waterText&&C.setWaterText(V.waterText),V.ofdRender?V.ofdRender.setDpi(Q):V.ofdRender=new S.Ofd_Render(V.ofdCore,C),B.mixBlendMode&&V.ofdRender.setMixBlendMode(B.mixBlendMode);var E=document.createElement("div"),D=C.pageRenderWidth(0,I,V.ofdCore),i=C.pageRenderHeight(0,I,V.ofdCore);return E.setAttribute("style","position: relative;width:".concat(D,"px;height:").concat(i,"px;overflow: hidden")),V.ofdRender.renderPage(E,0,I),E},QA=function(A){if(f)Object(k.setYYDS)(f),A&&A();else{Object(k.needInitAgain)()||A&&(A(),A=null);document.getElementsByTagName("meta").ofdwasm;K()({locateFile:function(){return H.wsdsb}}).then((function(I){var g=I.Module;Object(k.setYYDS)(g),A&&A()}))}},CA=function(){return Object(k.getStreamData)()},EA=function(A){V.viewer.toolbar&&V.viewer.toolbar.setLanguage(A)},DA=function(A){if(A.loadingContainer){if(A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);A.container.appendChild(A.loadingContainer)}V.ofdCore&&(V.eventBus=new i.EventBus,V.eventBus._on("pageFinishRender",A.pageFinishRenderCallback),new t.OfdBaseViewer(A.container,A.width,V.eventBus,V.waterText).setOfdCore(V.ofdCore))},iA=function(A){setTimeout((function(){if(A.loadingContainer){if(A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);A.container.appendChild(A.loadingContainer)}O({ofd:A.ofd,secret:A.secret,digest:A.digest,headers:A.headers,signatureClickCallback:A.signatureClickCallback,signaturesCallback:A.signaturesCallback,waterText:A.waterText,success:function(I){A.parserOFDSuccess&&A.parserOFDSuccess(I),new t.OfdBaseViewer(A.container,A.width,V.eventBus,V.waterText).setOfdCore(I),A.renderOFDCallback&&A.renderOFDCallback()},fail:function(I){if(A.parserOFDFail&&A.parserOFDFail(I),A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);var g=document.createElement("div");g.classList.add("error"),g.textContent=I,A.container.appendChild(g)}})}),200)},oA=function(A){if(A.loadingContainer){if(A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);A.container.appendChild(A.loadingContainer)}u({ofd:A.ofd,secret:A.secret,digest:A.digest,signatureClickCallback:A.signatureClickCallback,signaturesCallback:A.signaturesCallback,waterText:A.waterText,success:function(I){A.parserOFDSuccess&&A.parserOFDSuccess(I.ofd),new t.OfdBaseViewer(A.container,A.width,V.eventBus,V.waterText).setOfdCore(I)},fail:function(I){if(A.parserOFDFail&&A.parserOFDFail(I),A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);var g=document.createElement("div");g.textContent=I,A.container.appendChild(g)}})},wA=function(A){var I=V.ofdCore.findSignature(0,A.pageRef,A.signatureId),g={signer:I.SignCert.subject,provider:I.SignedInfo.Provider.ProviderName,hashedValue:I.HashHex,HashValid:I.HashValid,signedValue:I.signatureHex,signMethod:I.SignedInfo.SignatureMethod,signVersion:I.SignedInfo.Seal.esVersion,signatureVerify:I.SignatureValid,sealID:I.SignedInfo.Seal.esID,sealName:I.SignedInfo.Seal.Property.name,sealType:I.SignedInfo.Seal.Property.type,sealAuthTime:"".concat(I.SignedInfo.Seal.Property.validStart," 至 ").concat(I.SignedInfo.Seal.Property.validEnd),sealMakeTime:I.SignedInfo.Seal.Property.createDate,sealVersion:I.SignedInfo.Seal.Header.version};A.signatureCallback&&A.signatureCallback(g),setTimeout((function(){var g,B="",Q=W(I.SignedInfo.References);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;B+="".concat(Object(d.replaceFirstSlash)(C.FileRef),"|")}}catch(A){Q.e(A)}finally{Q.f()}var E,D=Object(k.hashPath)(V.ofdCore.ofdParserPtr,B,I.SignedInfo.ReferencesCheckMethod.toLowerCase()),i=!0,o=W(I.SignedInfo.References);try{for(o.s();!(E=o.n()).done;){var w=E.value,G=w.CheckValue,F=D["".concat(Object(d.replaceFirstSlash)(w.FileRef))];i&=G===F}}catch(A){o.e(A)}finally{o.f()}A.hashFileCallback&&A.hashFileCallback(1===i)}),200)},GA=function(){V.viewer.ofdPrint&&eA()},FA=function(){return V.viewer.eventBus},NA=function(A){yA(A)},yA=function(A){var I;V.viewer&&((I=V.viewer.eventBus)._off("resize",YA),I._off("fileinputchange",KA),I._off("openfile",cA),I._off("nextpage",LA),I._off("previouspage",tA),I._off("pagenumberchanged",dA),I._off("pagechanging",ZA),I._off("print",eA),I._off("firstpage",HA),I._off("lastpage",JA),I._off("zoomin",nA),I._off("zoomout",qA),I._off("scalechanging",lA),I._off("scalechanged",rA),I._off("viewportchanging",WA),I._off("switchspreadmode",xA),I._off("scrollmodechanged",fA),I._off("switchscrollmode",VA),I._off("rotatecw",bA),I._off("rotateccw",pA),I._off("documentproperties",mA),I._off("signatureclick",XA),I._off("attachmentclick",jA),I._off("customtagclick",uA),I._off("download",sA),I._off("langchanged",SA),I._off("pageViewerClick",OA),I._off("closePage",kA),I._off("printCallback",aA)),V.viewer=new UA(A)},RA=function(A){MA(A)},hA=function(A){V.viewer&&(A?(V.viewer.config.openFileTip&&(V.viewer.config.openFileTip.hidden=!0),V.viewer.ofdViewer.freeDocument(),V.viewer.config.loadingContainer&&V.viewer.ofdViewer.viewer.appendChild(V.viewer.config.loadingContainer),u({ofd:A,secret:V.viewer.config.secret,digest:V.viewer.config.digest,waterText:V.viewer.config.waterText,success:function(A){if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){V.viewer.config.errorWrapper.moreInfoButton.hidden=!0,V.viewer.config.errorWrapper.container.hidden=!1;var I=A.leftTime/864e5,g=A.leftTime%864e5/36e5,B=A.leftTime%36e5/6e4,Q=A.leftTime%6e4/1e3;V.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(I),"天").concat(Math.floor(g),"小时").concat(Math.floor(B),"分").concat(Math.floor(Q),"秒"),V.viewer.config.exceedTimeLimit&&V.viewer.config.exceedTimeLimit()}V.viewer.config.parserOFDSuccess&&V.viewer.config.parserOFDSuccess(A.ofd),V.ofdCore=A,V.viewer.ofdViewer.setWaterText(V.waterText),V.viewer.ofdViewer.setWaterSetting(V.viewer.config.waterSetting),V.viewer.ofdViewer.setOfdCore(A),V.viewer.ofdThumbnailViewer&&V.viewer.ofdThumbnailViewer.setOfdCore(A),V.viewer.ofdSignatureViewer.setOfdCore(A,V.viewer.config.signatureViewerForceCheck),V.viewer.ofdAttachmentViewer.setOfdCore(A),V.viewer.ofdCustomTagViewer.setOfdCore(A),V.viewer.config.signaturesCallback&&V.viewer.config.signaturesCallback(A.getAllSignature(0)),V.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),V.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),V.viewer.config.sidebarForceOpen&&setTimeout((function(){V.viewer.pdfSidebar.open()}),500)},fail:function(A){V.viewer.config.parserOFDFail&&V.viewer.config.parserOFDFail(A),V.viewer.ofdViewer.freeDocument(),V.viewer.config.errorWrapper.moreInfoButton.hidden=!0,V.viewer.config.errorWrapper.container.hidden=!1,V.viewer.config.errorWrapper.errorMessage.textContent=A}})):V.viewer.config.parserOFDFail&&V.viewer.config.parserOFDFail("file undefined"))},MA=function(A){V.viewer&&(A?(V.viewer.config.openFileTip&&(V.viewer.config.openFileTip.hidden=!0),V.viewer.ofdViewer.freeDocument(),V.viewer.config.loadingContainer&&V.viewer.ofdViewer.viewer.appendChild(V.viewer.config.loadingContainer),O({ofd:A,secret:V.viewer.config.secret,digest:V.viewer.config.digest,waterText:V.viewer.config.waterText,success:function(A){if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){V.viewer.config.errorWrapper.moreInfoButton.hidden=!0,V.viewer.config.errorWrapper.container.hidden=!1;var I=A.leftTime/864e5,g=A.leftTime%864e5/36e5,B=A.leftTime%36e5/6e4,Q=A.leftTime%6e4/1e3;V.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(I),"天").concat(Math.floor(g),"小时").concat(Math.floor(B),"分").concat(Math.floor(Q),"秒"),V.viewer.config.exceedTimeLimit&&V.viewer.config.exceedTimeLimit()}V.viewer.config.parserOFDSuccess&&V.viewer.config.parserOFDSuccess(A.ofd),V.ofdCore=A,V.viewer.ofdViewer.setWaterText(V.waterText),V.viewer.ofdViewer.setWaterSetting(V.viewer.config.waterSetting),V.viewer.ofdViewer.setOfdCore(A),V.viewer.ofdThumbnailViewer&&V.viewer.ofdThumbnailViewer.setOfdCore(A),V.viewer.ofdSignatureViewer.setOfdCore(A,V.viewer.config.signatureViewerForceCheck),V.viewer.ofdAttachmentViewer.setOfdCore(A),V.viewer.ofdCustomTagViewer.setOfdCore(A),V.viewer.config.signaturesCallback&&V.viewer.config.signaturesCallback(A.getAllSignature(0)),V.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),V.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),V.viewer.config.sidebarForceOpen&&setTimeout((function(){V.viewer.pdfSidebar.open()}),500)},fail:function(A){V.viewer.config.parserOFDFail&&V.viewer.config.parserOFDFail(A),V.viewer.ofdViewer.freeDocument(),V.viewer.config.errorWrapper.moreInfoButton.hidden=!0,V.viewer.config.errorWrapper.container.hidden=!1,V.viewer.config.errorWrapper.errorMessage.textContent=A}})):V.viewer.config.parserOFDFail&&V.viewer.config.parserOFDFail("file undefined"))},UA=Q()((function A(I){var g=this;E()(this,A),this.config=I,this.l10n=new D.GenericL10n("zh-CN"),this.eventBus=new i.EventBus,this.ofdViewer=new o.OfdViewer(I.mainContainer,I.viewerContainer,this.eventBus,I.mixBlendMode,I.defaultScale),I.sidebar.thumbnailView&&(this.ofdThumbnailViewer=new w.OfdThumbnailViewer(I.sidebar.thumbnailView,this.eventBus)),this.ofdSignatureViewer=new J.OfdSignatureViewer(I.sidebar.signaturesView,this.eventBus),this.ofdAttachmentViewer=new L.OfdAttachmentViewer(I.sidebar.attachmentsView,this.eventBus),this.ofdCustomTagViewer=new l.OfdCustomTagViewer(I.sidebar.outlineView,this.eventBus),this.pdfSidebar=new G.PDFSidebar({elements:I.sidebar,ofdViewer:this.ofdViewer,ofdThumbnailViewer:this.ofdThumbnailViewer,eventBus:this.eventBus,l10n:this.l10n}),this.overlayManager=new F.OverlayManager,I.signatureProperties&&(this.signatureProperties=new a.OFDSignatureProperties(I.signatureProperties,this.overlayManager,this.eventBus,this.l10n)),I.documentProperties&&(this.ofdDocumentProperties=new N.PDFDocumentProperties(I.documentProperties,this.overlayManager,this.eventBus,this.l10n)),this.toolbar=new y.Toolbar(I.toolbar,this.eventBus,this.l10n),this.secondaryToolbar=new R.SecondaryToolbar(I.secondaryToolbar,I.mainContainer,this.eventBus);var B=document.createElement("input");B.id="fileInput",B.className="fileInput",B.setAttribute("type","file"),B.setAttribute("accept",".ofd"),document.body.appendChild(B);var Q=this;B.addEventListener("click",(function(A){A.target.value=null})),B.addEventListener("change",(function(A){var I=A.target.files;I&&0!==I.length&&Q.eventBus.dispatch("fileinputchange",{source:this,fileInput:A.target,eventBus:Q.eventBus})})),new h.PDFCursorTools({container:I.mainContainer,eventBus:this.eventBus});var C=document.getElementById("printServiceDialog");C&&(this.ofdPrint=new M.Print(C,this.overlayManager,this.l10n,this.eventBus,I.onPrintContentCallback));var U=I.appContainer||document.documentElement;this.l10n.translate(U).then((function(){g.eventBus.dispatch("localized",{})})),this.eventBus._on("printCallback",aA),this.eventBus._on("resize",YA),this.eventBus._on("fileinputchange",KA),this.eventBus._on("openfile",cA),this.eventBus._on("nextpage",LA),this.eventBus._on("previouspage",tA),this.eventBus._on("pagenumberchanged",dA),this.eventBus._on("pagechanging",ZA),this.eventBus._on("print",eA),this.eventBus._on("firstpage",HA),this.eventBus._on("lastpage",JA),this.eventBus._on("zoomin",nA),this.eventBus._on("zoomout",qA),this.eventBus._on("scalechanging",lA),this.eventBus._on("viewportchanging",WA),this.eventBus._on("scalechanged",rA),this.eventBus._on("switchspreadmode",xA),this.eventBus._on("scrollmodechanged",fA),this.eventBus._on("switchscrollmode",VA),this.eventBus._on("rotatecw",bA),this.eventBus._on("rotateccw",pA),this.eventBus._on("documentproperties",mA),this.eventBus._on("signatureclick",XA),this.eventBus._on("attachmentclick",jA),this.eventBus._on("customtagclick",uA),this.eventBus._on("download",sA),this.eventBus._on("langchanged",SA),this.eventBus._on("pageViewerClick",OA),this.eventBus._on("closePage",kA),window.addEventListener("click",TA),window.addEventListener("resize",(function(){g.eventBus.dispatch("resize",{source:window})})),I.errorWrapper.closeButton.onclick=function(){I.errorWrapper.container.hidden=!0},I.toolbar.presentationModeButton&&(I.toolbar.presentationModeButton.hidden=!0),I.toolbar.viewBookmark&&(I.toolbar.viewBookmark.hidden=!0),I.secondaryToolbar.presentationModeButton&&(I.secondaryToolbar.presentationModeButton.hidden=!0),I.secondaryToolbar.viewBookmarkButton&&(I.secondaryToolbar.viewBookmarkButton.hidden=!0),I.secondaryToolbar.viewBookmarkButton&&(I.secondaryToolbar.viewBookmarkButton.hidden=!0),C&&"function"!=typeof C.showModal&&(C&&(C.hidden=!0),I.documentProperties&&I.documentProperties.dialog&&(I.documentProperties.dialog.hidden=!0),I.signatureProperties&&I.signatureProperties.dialog&&(I.signatureProperties.dialog.hidden=!0))}));function cA(){document.getElementById("fileInput").click()}function kA(){V.viewer.config.closeCallback&&V.viewer.config.closeCallback()}function SA(A){V.viewer.l10n.setLanguage(A.value),V.viewer.l10n.translate(V.viewer.appContainer).then((function(){V.viewer.eventBus.dispatch("localized",{})}))}function sA(){var A=Object(k.getStreamData)();if(A)if(V.viewer.config.downloadCallback)V.viewer.config.downloadCallback(new Blob([A]));else{var I=window.URL.createObjectURL(new Blob([A])),g=document.createElement("a");g.style.display="none",g.href=I,g.setAttribute("download",V.fileName),document.body.append(g),g.click()}}function aA(A){V.viewer.config.onPrintContentCallback&&V.viewer.config.onPrintContentCallback(A.html)}function YA(){var A=V.ofdCore,I=V.viewer;if(A){var g=I.ofdViewer.currentScaleValue;"auto"!==g&&"page-fit"!==g&&"page-width"!==g||(I.ofdViewer.currentScaleValue=g),V.viewer.eventBus.dispatch("stampResize",{source:null})}}function KA(A){V.viewer.config.openFileTip&&(V.viewer.config.openFileTip.hidden=!0),V.viewer.pdfSidebar.isOpen&&V.viewer.pdfSidebar.close();var I=A.fileInput.files[0];V.fileName=I.name,V.viewer.ofdViewer.freeDocument(),V.viewer.config.loadingContainer&&V.viewer.ofdViewer.viewer.appendChild(V.viewer.config.loadingContainer);(new Date).getTime();O({ofd:I,secret:V.viewer.config.secret,digest:V.viewer.config.digest,waterText:V.viewer.config.waterText,success:function(A){(new Date).getTime();if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){V.viewer.config.errorWrapper.moreInfoButton.hidden=!0,V.viewer.config.errorWrapper.container.hidden=!1;var I=A.leftTime/864e5,g=A.leftTime%864e5/36e5,B=A.leftTime%36e5/6e4,Q=A.leftTime%6e4/1e3;V.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(I),"天").concat(Math.floor(g),"小时").concat(Math.floor(B),"分").concat(Math.floor(Q),"秒"),V.viewer.config.exceedTimeLimit&&V.viewer.config.exceedTimeLimit()}V.viewer.config.parserOFDSuccess&&V.viewer.config.parserOFDSuccess(A.ofd),V.ofdCore=A,V.viewer.ofdViewer.setWaterText(V.waterText),V.viewer.ofdViewer.setWaterSetting(V.viewer.config.waterSetting),V.viewer.ofdViewer.setOfdCore(A),V.viewer.ofdThumbnailViewer&&V.viewer.ofdThumbnailViewer.setOfdCore(A),V.viewer.config.signaturesCallback&&V.viewer.config.signaturesCallback(A.getAllSignature(0)),V.viewer.ofdSignatureViewer.setOfdCore(A,V.viewer.config.signatureViewerForceCheck),V.viewer.ofdAttachmentViewer.setOfdCore(A),V.viewer.ofdCustomTagViewer.setOfdCore(A),V.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),V.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),V.viewer.config.sidebarForceOpen&&setTimeout((function(){V.viewer.pdfSidebar.open()}),500)},fail:function(A){V.viewer.config.parserOFDFail&&V.viewer.config.parserOFDFail(A),V.viewer.ofdViewer.freeDocument(),V.viewer.config.errorWrapper.moreInfoButton.hidden=!0,V.viewer.config.errorWrapper.container.hidden=!1,V.viewer.config.errorWrapper.errorMessage.textContent=A}})}function HA(){V.viewer.ofdViewer.firstPage()}function JA(){V.viewer.ofdViewer.lastPage()}function LA(){V.viewer.ofdViewer.nextPage()}function tA(){V.viewer.ofdViewer.previousPage()}function dA(A){""!==A.value&&A.source.eventBus.dispatch("jumpPage",{source:A.source,pageIndex:A.value}),V.viewer.toolbar.setPageNumber(A.value,null),V.viewer.secondaryToolbar.setPageNumber(A.value,null)}function ZA(A){var I=A.pageNumber;V.viewer.toolbar.setPageNumber(I,null),V.viewer.secondaryToolbar.setPageNumber(I,null),V.viewer.pdfSidebar.isThumbnailViewVisible&&V.viewer.ofdThumbnailViewer.scrollThumbnailIntoView(I),V.viewer.config.onPageChanging&&V.viewer.config.onPageChanging(I)}function eA(){V.viewer.ofdPrint.setOfdCore(V.ofdCore),V.viewer.ofdPrint.open()}function nA(){V.viewer.ofdViewer.increaseScale()}function qA(){V.viewer.ofdViewer.decreaseScale()}function lA(A){V.viewer.toolbar.setPageScale(A.presetValue,A.scale),V.viewer.config.onPageScale&&V.viewer.config.onPageScale(A.scale)}function WA(A){V.viewer.config.onViewportChange&&V.viewer.config.onViewportChange(V.viewer.ofdViewer)}function rA(A){V.viewer.ofdViewer.zoom(A.value)}function xA(A){V.viewer.ofdViewer.setSpreadMode(A.mode)}function fA(A){}function VA(A){V.viewer.ofdViewer.setScrollMode(A.mode)}function bA(){V.viewer.ofdViewer.setRotation(90)}function pA(){V.viewer.ofdViewer.setRotation(-90)}function mA(){V.viewer.ofdDocumentProperties.setOfdCore(V.ofdCore),V.viewer.ofdDocumentProperties.open()}function TA(A){V.viewer.secondaryToolbar.isOpen&&(V.viewer.config.mainContainer.contains(A.target)||V.viewer.config.toolbar.container.contains(A.target)&&A.target!==V.viewer.config.secondaryToolbar.toggleButton)&&V.viewer.secondaryToolbar.close()}function XA(A){if(V.viewer.signatureProperties)if(V.viewer.signatureProperties.setOfdCore(V.ofdCore),A.pageRef||A.signatureId){var I=V.ofdCore.findSignature(0,A.pageRef,A.signatureId);V.viewer.signatureProperties.open(I)}else V.viewer.signatureProperties.open(A.sign.Signature)}function jA(A){var I=A.attachment.FileLocAbs.split("/"),g=A.attachment.Name;g||(g=I[I.length-1]),g.indexOf(".")<0&&(g="".concat(g,".").concat(A.attachment.Format)),zA(A.attachment.FileLocAbs).then((function(A){var I=window.URL.createObjectURL(new Blob([A])),B=document.createElement("a");B.style.display="none",B.href=I,B.setAttribute("download",g),document.body.append(B),B.click()})).catch((function(A){}))}function OA(A){V.viewer.ofdViewer&&V.viewer.ofdViewer.removeHighLight()}function uA(A){A.source.eventBus.dispatch("jumpPage",{source:A.source,pageIndex:A.pageIndex+1,eleIdArray:A.eleIdArray}),V.viewer.toolbar.setPageNumber(A.pageIndex+1,null),V.viewer.secondaryToolbar.setPageNumber(A.pageIndex+1,null)}function zA(A){return new Promise((function(I,g){Object(k.getStreamData)()&&I(Object(k.JSGetPathEncode)(V.ofdCore.ofdParserPtr,A))}))}},function(A,I,g){var B=g(2);function Q(A,I){for(var g=0;g<I.length;g++){var Q=I[g];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(A,B(Q.key),Q)}}A.exports=function(A,I,g){return I&&Q(A.prototype,I),g&&Q(A,g),Object.defineProperty(A,"prototype",{writable:!1}),A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(3).default,Q=g(4);A.exports=function(A){var I=Q(A,"string");return"symbol"===B(I)?I:String(I)},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){function g(I){return A.exports=g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},A.exports.__esModule=!0,A.exports.default=A.exports,g(I)}A.exports=g,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(3).default;A.exports=function(A,I){if("object"!==B(A)||null===A)return A;var g=A[Symbol.toPrimitive];if(void 0!==g){var Q=g.call(A,I||"default");if("object"!==B(Q))return Q;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===I?String:Number)(A)},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"GenericL10n",(function(){return N}));var B=g(7),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(8),w=g.n(o),G=(g(10),g(11)),F=document.webL10n,N=function(){function A(I){E()(this,A),this._lang=I,this._ready=new Promise((function(A,g){F.setLanguage(Object(G.fixupLangCode)(I),(function(){A(F)}))}))}var I,g,B,C,D;return i()(A,[{key:"setLanguage",value:(D=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:this._lang=I,this._ready=new Promise((function(A,g){F.setLanguage(Object(G.fixupLangCode)(I),(function(){A(F)}))}));case 2:case"end":return A.stop()}}),A,this)}))),function(A){return D.apply(this,arguments)})},{key:"getLanguage",value:(C=Q()(w.a.mark((function A(){var I;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this._ready;case 2:return I=A.sent,A.abrupt("return",I.getLanguage());case 4:case"end":return A.stop()}}),A,this)}))),function(){return C.apply(this,arguments)})},{key:"getDirection",value:(B=Q()(w.a.mark((function A(){var I;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this._ready;case 2:return I=A.sent,A.abrupt("return",I.getDirection());case 4:case"end":return A.stop()}}),A,this)}))),function(){return B.apply(this,arguments)})},{key:"get",value:(g=Q()(w.a.mark((function A(I){var g,B,Q,C=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return g=C.length>1&&void 0!==C[1]?C[1]:null,B=C.length>2&&void 0!==C[2]?C[2]:Object(G.getL10nFallback)(I,g),A.next=4,this._ready;case 4:return Q=A.sent,A.abrupt("return",Q.get(I,g,B));case 6:case"end":return A.stop()}}),A,this)}))),function(A){return g.apply(this,arguments)})},{key:"translate",value:(I=Q()(w.a.mark((function A(I){var g;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this._ready;case 2:return g=A.sent,A.abrupt("return",g.translate(I));case 4:case"end":return A.stop()}}),A,this)}))),function(A){return I.apply(this,arguments)})}]),A}()},function(A,I){function g(A,I,g,B,Q,C,E){try{var D=A[C](E),i=D.value}catch(A){return void g(A)}D.done?I(i):Promise.resolve(i).then(B,Q)}A.exports=function(A){return function(){var I=this,B=arguments;return new Promise((function(Q,C){var E=A.apply(I,B);function D(A){g(E,Q,C,D,i,"next",A)}function i(A){g(E,Q,C,D,i,"throw",A)}D(void 0)}))}},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(9)();A.exports=B;try{regeneratorRuntime=B}catch(A){"object"==typeof globalThis?globalThis.regeneratorRuntime=B:Function("r","regeneratorRuntime = r")(B)}},function(A,I,g){var B=g(3).default;function Q(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */A.exports=Q=function(){return g},A.exports.__esModule=!0,A.exports.default=A.exports;var I,g={},C=Object.prototype,E=C.hasOwnProperty,D=Object.defineProperty||function(A,I,g){A[I]=g.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",w=i.asyncIterator||"@@asyncIterator",G=i.toStringTag||"@@toStringTag";function F(A,I,g){return Object.defineProperty(A,I,{value:g,enumerable:!0,configurable:!0,writable:!0}),A[I]}try{F({},"")}catch(I){F=function(A,I,g){return A[I]=g}}function N(A,I,g,B){var Q=I&&I.prototype instanceof k?I:k,C=Object.create(Q.prototype),E=new n(B||[]);return D(C,"_invoke",{value:t(A,g,E)}),C}function y(A,I,g){try{return{type:"normal",arg:A.call(I,g)}}catch(A){return{type:"throw",arg:A}}}g.wrap=N;var R="suspendedStart",h="suspendedYield",M="executing",U="completed",c={};function k(){}function S(){}function s(){}var a={};F(a,o,(function(){return this}));var Y=Object.getPrototypeOf,K=Y&&Y(Y(q([])));K&&K!==C&&E.call(K,o)&&(a=K);var H=s.prototype=k.prototype=Object.create(a);function J(A){["next","throw","return"].forEach((function(I){F(A,I,(function(A){return this._invoke(I,A)}))}))}function L(A,I){function g(Q,C,D,i){var o=y(A[Q],A,C);if("throw"!==o.type){var w=o.arg,G=w.value;return G&&"object"==B(G)&&E.call(G,"__await")?I.resolve(G.__await).then((function(A){g("next",A,D,i)}),(function(A){g("throw",A,D,i)})):I.resolve(G).then((function(A){w.value=A,D(w)}),(function(A){return g("throw",A,D,i)}))}i(o.arg)}var Q;D(this,"_invoke",{value:function(A,B){function C(){return new I((function(I,Q){g(A,B,I,Q)}))}return Q=Q?Q.then(C,C):C()}})}function t(A,g,B){var Q=R;return function(C,E){if(Q===M)throw new Error("Generator is already running");if(Q===U){if("throw"===C)throw E;return{value:I,done:!0}}for(B.method=C,B.arg=E;;){var D=B.delegate;if(D){var i=d(D,B);if(i){if(i===c)continue;return i}}if("next"===B.method)B.sent=B._sent=B.arg;else if("throw"===B.method){if(Q===R)throw Q=U,B.arg;B.dispatchException(B.arg)}else"return"===B.method&&B.abrupt("return",B.arg);Q=M;var o=y(A,g,B);if("normal"===o.type){if(Q=B.done?U:h,o.arg===c)continue;return{value:o.arg,done:B.done}}"throw"===o.type&&(Q=U,B.method="throw",B.arg=o.arg)}}}function d(A,g){var B=g.method,Q=A.iterator[B];if(Q===I)return g.delegate=null,"throw"===B&&A.iterator.return&&(g.method="return",g.arg=I,d(A,g),"throw"===g.method)||"return"!==B&&(g.method="throw",g.arg=new TypeError("The iterator does not provide a '"+B+"' method")),c;var C=y(Q,A.iterator,g.arg);if("throw"===C.type)return g.method="throw",g.arg=C.arg,g.delegate=null,c;var E=C.arg;return E?E.done?(g[A.resultName]=E.value,g.next=A.nextLoc,"return"!==g.method&&(g.method="next",g.arg=I),g.delegate=null,c):E:(g.method="throw",g.arg=new TypeError("iterator result is not an object"),g.delegate=null,c)}function Z(A){var I={tryLoc:A[0]};1 in A&&(I.catchLoc=A[1]),2 in A&&(I.finallyLoc=A[2],I.afterLoc=A[3]),this.tryEntries.push(I)}function e(A){var I=A.completion||{};I.type="normal",delete I.arg,A.completion=I}function n(A){this.tryEntries=[{tryLoc:"root"}],A.forEach(Z,this),this.reset(!0)}function q(A){if(A||""===A){var g=A[o];if(g)return g.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length)){var Q=-1,C=function g(){for(;++Q<A.length;)if(E.call(A,Q))return g.value=A[Q],g.done=!1,g;return g.value=I,g.done=!0,g};return C.next=C}}throw new TypeError(B(A)+" is not iterable")}return S.prototype=s,D(H,"constructor",{value:s,configurable:!0}),D(s,"constructor",{value:S,configurable:!0}),S.displayName=F(s,G,"GeneratorFunction"),g.isGeneratorFunction=function(A){var I="function"==typeof A&&A.constructor;return!!I&&(I===S||"GeneratorFunction"===(I.displayName||I.name))},g.mark=function(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,s):(A.__proto__=s,F(A,G,"GeneratorFunction")),A.prototype=Object.create(H),A},g.awrap=function(A){return{__await:A}},J(L.prototype),F(L.prototype,w,(function(){return this})),g.AsyncIterator=L,g.async=function(A,I,B,Q,C){void 0===C&&(C=Promise);var E=new L(N(A,I,B,Q),C);return g.isGeneratorFunction(I)?E:E.next().then((function(A){return A.done?A.value:E.next()}))},J(H),F(H,G,"Generator"),F(H,o,(function(){return this})),F(H,"toString",(function(){return"[object Generator]"})),g.keys=function(A){var I=Object(A),g=[];for(var B in I)g.push(B);return g.reverse(),function A(){for(;g.length;){var B=g.pop();if(B in I)return A.value=B,A.done=!1,A}return A.done=!0,A}},g.values=q,n.prototype={constructor:n,reset:function(A){if(this.prev=0,this.next=0,this.sent=this._sent=I,this.done=!1,this.delegate=null,this.method="next",this.arg=I,this.tryEntries.forEach(e),!A)for(var g in this)"t"===g.charAt(0)&&E.call(this,g)&&!isNaN(+g.slice(1))&&(this[g]=I)},stop:function(){this.done=!0;var A=this.tryEntries[0].completion;if("throw"===A.type)throw A.arg;return this.rval},dispatchException:function(A){if(this.done)throw A;var g=this;function B(B,Q){return D.type="throw",D.arg=A,g.next=B,Q&&(g.method="next",g.arg=I),!!Q}for(var Q=this.tryEntries.length-1;Q>=0;--Q){var C=this.tryEntries[Q],D=C.completion;if("root"===C.tryLoc)return B("end");if(C.tryLoc<=this.prev){var i=E.call(C,"catchLoc"),o=E.call(C,"finallyLoc");if(i&&o){if(this.prev<C.catchLoc)return B(C.catchLoc,!0);if(this.prev<C.finallyLoc)return B(C.finallyLoc)}else if(i){if(this.prev<C.catchLoc)return B(C.catchLoc,!0)}else{if(!o)throw new Error("try statement without catch or finally");if(this.prev<C.finallyLoc)return B(C.finallyLoc)}}}},abrupt:function(A,I){for(var g=this.tryEntries.length-1;g>=0;--g){var B=this.tryEntries[g];if(B.tryLoc<=this.prev&&E.call(B,"finallyLoc")&&this.prev<B.finallyLoc){var Q=B;break}}Q&&("break"===A||"continue"===A)&&Q.tryLoc<=I&&I<=Q.finallyLoc&&(Q=null);var C=Q?Q.completion:{};return C.type=A,C.arg=I,Q?(this.method="next",this.next=Q.finallyLoc,c):this.complete(C)},complete:function(A,I){if("throw"===A.type)throw A.arg;return"break"===A.type||"continue"===A.type?this.next=A.arg:"return"===A.type?(this.rval=this.arg=A.arg,this.method="return",this.next="end"):"normal"===A.type&&I&&(this.next=I),c},finish:function(A){for(var I=this.tryEntries.length-1;I>=0;--I){var g=this.tryEntries[I];if(g.finallyLoc===A)return this.complete(g.completion,g.afterLoc),e(g),c}},catch:function(A){for(var I=this.tryEntries.length-1;I>=0;--I){var g=this.tryEntries[I];if(g.tryLoc===A){var B=g.completion;if("throw"===B.type){var Q=B.arg;e(g)}return Q}}throw new Error("illegal catch attempt")},delegateYield:function(A,g,B){return this.delegate={iterator:q(A),resultName:g,nextLoc:B},"next"===this.method&&(this.arg=I),c}},g}A.exports=Q,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";document.webL10n=function(A,I,g){var B={},Q="",C="textContent",E="",D={},i="loading",o=!0;function w(A,I,g){I=I||function(A){},g=g||function(){};var B=new XMLHttpRequest;B.open("GET",A,o),B.overrideMimeType&&B.overrideMimeType("text/plain; charset=utf-8"),B.onreadystatechange=function(){4==B.readyState&&(200==B.status||0===B.status?I(B.responseText):g())},B.onerror=g,B.ontimeout=g;try{B.send(null)}catch(A){g()}}function G(A,I,g,E){var D=A.replace(/[^\/]*$/,"")||"./";function i(A){return A.lastIndexOf("\\")<0?A:A.replace(/\\\\/g,"\\").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}w(A,(function(A){Q+=A,function(A,g){var B={},Q=/^\s*|\s*$/,C=/^\s*#|^\s*$/,E=/^\s*\[(.*)\]\s*$/,o=/^\s*@import\s+url\((.*)\)\s*$/i,G=/^([^=\s]*)\s*=\s*(.+)$/;function F(A,g,w){var F=A.replace(Q,"").split(/[\r\n]+/),y="*",R=I.split("-",1)[0],h=!1,M="";!function A(){for(;;){if(!F.length)return void w();var Q=F.shift();if(!C.test(Q)){if(g){if(M=E.exec(Q)){y=M[1].toLowerCase(),h="*"!==y&&y!==I&&y!==R;continue}if(h)continue;if(M=o.exec(Q))return void N(D+M[1],A)}var U=Q.match(G);U&&3==U.length&&(B[U[1]]=i(U[2]))}}}()}function N(A,I){w(A,(function(A){F(A,!1,I)}),(function(){I()}))}F(A,!0,(function(){g(B)}))}(A,(function(A){for(var I in A){var Q,E,D=I.lastIndexOf(".");D>0?(Q=I.substring(0,D),E=I.substring(D+1)):(Q=I,E=C),B[Q]||(B[Q]={}),B[Q][E]=A[I]}g&&g()}))}),E)}function F(A,g){A&&(A=A.toLowerCase()),g=g||function(){},B={},Q="",E="",E=A;var C=I.querySelectorAll('link[type="application/l10n"]'),D=C.length;if(0!==D){var o,w,F=0;w=function(){++F>=D&&(g(),i="complete")};for(var N=0;N<D;N++){new M(C[N]).load(A,w)}}else{var y=(o=I.querySelector('script[type="application/l10n"]'))?JSON.parse(o.innerHTML):null;if(y&&y.locales&&y.default_locale){if(!(B=y.locales[A])){var R=y.default_locale.toLowerCase();for(var h in y.locales){if((h=h.toLowerCase())===A){B=y.locales[A];break}h===R&&(B=y.locales[R])}}g()}i="complete"}function M(A){var I=A.href;this.load=function(A,g){G(I,A,g,(function(){E="",g()}))}}}function N(A,I,g){var Q=B[A];if(!Q){if(!g)return null;Q=g}var C={};for(var E in Q){var D=Q[E];D=R(D=y(D,I,A,E),I,A),C[E]=D}return C}function y(A,I,g,Q){var C=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/.exec(A);if(!C||!C.length)return A;var E,i=C[1],o=C[2];(I&&o in I?E=I[o]:o in B&&(E=B[o]),i in D)&&(A=(0,D[i])(A,E,g,Q));return A}function R(A,I,g){return A.replace(/\{\{\s*(.+?)\s*\}\}/g,(function(A,g){return I&&g in I?I[g]:g in B?B[g]:A}))}function h(A){var g=function(A){if(!A)return{};var I=A.getAttribute("data-l10n-id"),g=A.getAttribute("data-l10n-args"),B={};if(g)try{B=JSON.parse(g)}catch(A){}return{id:I,args:B}}(A);if(g.id){var B=N(g.id,g.args);if(B){if(B[C]){if(0===function(A){if(A.children)return A.children.length;if(void 0!==A.childElementCount)return A.childElementCount;for(var I=0,g=0;g<A.childNodes.length;g++)I+=1===A.nodeType?1:0;return I}(A))A[C]=B[C];else{for(var Q=A.childNodes,E=!1,D=0,i=Q.length;D<i;D++)3===Q[D].nodeType&&/\S/.test(Q[D].nodeValue)&&(E?Q[D].nodeValue="":(Q[D].nodeValue=B[C],E=!0));if(!E){var o=I.createTextNode(B[C]);A.insertBefore(o,A.firstChild)}}delete B[C]}for(var w in B)A[w]=B[w]}}}return D.plural=function(A,I,g,Q){var i=parseFloat(I);if(isNaN(i))return A;if(Q!=C)return A;D._pluralRules||(D._pluralRules=function(A){function I(A,I){return-1!==I.indexOf(A)}function g(A,I,g){return I<=A&&A<=g}var B={0:function(A){return"other"},1:function(A){return g(A%100,3,10)?"few":0===A?"zero":g(A%100,11,99)?"many":2==A?"two":1==A?"one":"other"},2:function(A){return 0!==A&&A%10==0?"many":2==A?"two":1==A?"one":"other"},3:function(A){return 1==A?"one":"other"},4:function(A){return g(A,0,1)?"one":"other"},5:function(A){return g(A,0,2)&&2!=A?"one":"other"},6:function(A){return 0===A?"zero":A%10==1&&A%100!=11?"one":"other"},7:function(A){return 2==A?"two":1==A?"one":"other"},8:function(A){return g(A,3,6)?"few":g(A,7,10)?"many":2==A?"two":1==A?"one":"other"},9:function(A){return 0===A||1!=A&&g(A%100,1,19)?"few":1==A?"one":"other"},10:function(A){return g(A%10,2,9)&&!g(A%100,11,19)?"few":A%10!=1||g(A%100,11,19)?"other":"one"},11:function(A){return g(A%10,2,4)&&!g(A%100,12,14)?"few":A%10==0||g(A%10,5,9)||g(A%100,11,14)?"many":A%10==1&&A%100!=11?"one":"other"},12:function(A){return g(A,2,4)?"few":1==A?"one":"other"},13:function(A){return g(A%10,2,4)&&!g(A%100,12,14)?"few":1!=A&&g(A%10,0,1)||g(A%10,5,9)||g(A%100,12,14)?"many":1==A?"one":"other"},14:function(A){return g(A%100,3,4)?"few":A%100==2?"two":A%100==1?"one":"other"},15:function(A){return 0===A||g(A%100,2,10)?"few":g(A%100,11,19)?"many":1==A?"one":"other"},16:function(A){return A%10==1&&11!=A?"one":"other"},17:function(A){return 3==A?"few":0===A?"zero":6==A?"many":2==A?"two":1==A?"one":"other"},18:function(A){return 0===A?"zero":g(A,0,2)&&0!==A&&2!=A?"one":"other"},19:function(A){return g(A,2,10)?"few":g(A,0,1)?"one":"other"},20:function(A){return!g(A%10,3,4)&&A%10!=9||g(A%100,10,19)||g(A%100,70,79)||g(A%100,90,99)?A%1e6==0&&0!==A?"many":A%10!=2||I(A%100,[12,72,92])?A%10!=1||I(A%100,[11,71,91])?"other":"one":"two":"few"},21:function(A){return 0===A?"zero":1==A?"one":"other"},22:function(A){return g(A,0,1)||g(A,11,99)?"one":"other"},23:function(A){return g(A%10,1,2)||A%20==0?"one":"other"},24:function(A){return g(A,3,10)||g(A,13,19)?"few":I(A,[2,12])?"two":I(A,[1,11])?"one":"other"}},Q={af:3,ak:4,am:4,ar:1,asa:3,az:0,be:11,bem:3,bez:3,bg:3,bh:4,bm:0,bn:3,bo:0,br:20,brx:3,bs:11,ca:3,cgg:3,chr:3,cs:12,cy:17,da:3,de:3,dv:3,dz:0,ee:3,el:3,en:3,eo:3,es:3,et:3,eu:3,fa:0,ff:5,fi:3,fil:4,fo:3,fr:5,fur:3,fy:3,ga:8,gd:24,gl:3,gsw:3,gu:3,guw:4,gv:23,ha:3,haw:3,he:2,hi:4,hr:11,hu:0,id:0,ig:0,ii:0,is:3,it:3,iu:7,ja:0,jmc:3,jv:0,ka:0,kab:5,kaj:3,kcg:3,kde:0,kea:0,kk:3,kl:3,km:0,kn:0,ko:0,ksb:3,ksh:21,ku:3,kw:7,lag:18,lb:3,lg:3,ln:4,lo:0,lt:10,lv:6,mas:3,mg:4,mk:16,ml:3,mn:3,mo:9,mr:3,ms:0,mt:15,my:0,nah:3,naq:7,nb:3,nd:3,ne:3,nl:3,nn:3,no:3,nr:3,nso:4,ny:3,nyn:3,om:3,or:3,pa:3,pap:3,pl:13,ps:3,pt:3,rm:3,ro:9,rof:3,ru:11,rwk:3,sah:0,saq:3,se:7,seh:3,ses:0,sg:0,sh:11,shi:19,sk:12,sl:14,sma:7,smi:7,smj:7,smn:7,sms:7,sn:3,so:3,sq:3,sr:11,ss:3,ssy:3,st:3,sv:3,sw:3,syr:3,ta:3,te:3,teo:3,th:0,ti:4,tig:3,tk:3,tl:4,tn:3,to:0,tr:0,ts:3,tzm:22,uk:11,ur:3,ve:3,vi:0,vun:3,wa:4,wae:3,wo:0,xh:3,xog:3,yo:0,zh:0,zu:3}[A.replace(/-.*$/,"")];return Q in B?B[Q]:function(){return"other"}}(E));var o="["+D._pluralRules(i)+"]";return 0===i&&g+"[zero]"in B?A=B[g+"[zero]"][Q]:1==i&&g+"[one]"in B?A=B[g+"[one]"][Q]:2==i&&g+"[two]"in B?A=B[g+"[two]"][Q]:g+o in B?A=B[g+o][Q]:g+"[other]"in B&&(A=B[g+"[other]"][Q]),A},{get:function(A,I,g){var B,Q=A.lastIndexOf("."),E=C;Q>0&&(E=A.substring(Q+1),A=A.substring(0,Q)),g&&((B={})[E]=g);var D=N(A,I,B);return D&&E in D?D[E]:"{{"+A+"}}"},getData:function(){return B},getText:function(){return Q},getLanguage:function(){return E},setLanguage:function(A,I){F(A,(function(){I&&I()}))},getDirection:function(){var A=E.split("-",1)[0];return["ar","he","fa","ps","ur"].indexOf(A)>=0?"rtl":"ltr"},translate:function(A){for(var g=function(A){return A?A.querySelectorAll("*[data-l10n-id]"):[]}(A=A||I.documentElement),B=g.length,Q=0;Q<B;Q++)h(g[Q]);h(A)},getReadyState:function(){return i},ready:function(g){g&&("complete"==i||"interactive"==i?A.setTimeout((function(){g()})):I.addEventListener&&I.addEventListener("localized",(function A(){I.removeEventListener("localized",A),g()})))}}}(window,document)},function(A,I,g){"use strict";g.r(I),g.d(I,"fixupLangCode",(function(){return w})),g.d(I,"getL10nFallback",(function(){return i})),g.d(I,"NullL10n",(function(){return F}));var B=g(7),Q=g.n(B),C=g(8),E=g.n(C),D={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",print_progress_percent:"{{progress}}%","toggle_sidebar.title":"Toggle Sidebar","toggle_sidebar_notification2.title":"Toggle Sidebar (document contains outline/attachments/layers)",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",error_version_info:"PDF.js v{{version}} (build: {{build}})",error_message:"Message: {{message}}",error_stack:"Stack: {{stack}}",error_file:"File: {{file}}",error_line:"Line: {{line}}",rendering_error:"An error occurred while rendering the page.",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading:"Loading…",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts."};function i(A,I){switch(A){case"find_match_count":A="find_match_count[".concat(1===I.total?"one":"other","]");break;case"find_match_count_limit":A="find_match_count_limit[".concat(1===I.limit?"one":"other","]")}return D[A]||""}var o={en:"en-US",es:"es-ES",fy:"fy-NL",ga:"ga-IE",gu:"gu-IN",hi:"hi-IN",hy:"hy-AM",nb:"nb-NO",ne:"ne-NP",nn:"nn-NO",pa:"pa-IN",pt:"pt-PT",sv:"sv-SE",zh:"zh-CN"};function w(A){return o[!!A&&A.toLowerCase()]||A}function G(A,I){return I?A.replace(/\{\{\s*(\w+)\s*\}\}/g,(function(A,g){return g in I?I[g]:"{{"+g+"}}"})):A}var F={getLanguage:function(){return Q()(E.a.mark((function A(){return E.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return","en-us");case 1:case"end":return A.stop()}}),A)})))()},getDirection:function(){return Q()(E.a.mark((function A(){return E.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return","ltr");case 1:case"end":return A.stop()}}),A)})))()},get:function(A){var I=arguments;return Q()(E.a.mark((function g(){var B,Q;return E.a.wrap((function(g){for(;;)switch(g.prev=g.next){case 0:return B=I.length>1&&void 0!==I[1]?I[1]:null,Q=I.length>2&&void 0!==I[2]?I[2]:i(A,B),g.abrupt("return",G(Q,B));case 3:case"end":return g.stop()}}),g)})))()},translate:function(A){return Q()(E.a.mark((function A(){return E.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:case"end":return A.stop()}}),A)})))()}}},function(A,I,g){"use strict";g.r(I),g.d(I,"AutomationEventBus",(function(){return S})),g.d(I,"EventBus",(function(){return k})),g.d(I,"waitOnEventOrTimeout",(function(){return c})),g.d(I,"WaitOnType",(function(){return U}));var B=g(13),Q=g.n(B),C=g(16),E=g.n(C),D=g(18),i=g.n(D),o=g(15),w=g.n(o),G=g(5),F=g.n(G),N=g(1),y=g.n(N);function R(A){var I=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var g,B=w()(A);if(I){var Q=w()(this).constructor;g=Reflect.construct(B,arguments,Q)}else g=B.apply(this,arguments);return i()(this,g)}}function h(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return M(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return M(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function M(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var U={EVENT:"event",TIMEOUT:"timeout"};function c(A){var I=A.target,g=A.name,B=A.delay,Q=void 0===B?0:B;return new Promise((function(A,B){if("object"!=typeof I||!g||"string"!=typeof g||!(Number.isInteger(Q)&&Q>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function C(B){I instanceof k?I._off(g,E):I.removeEventListener(g,E),i&&clearTimeout(i),A(B)}var E=C.bind(null,U.EVENT);I instanceof k?I._on(g,E):I.addEventListener(g,E);var D=C.bind(null,U.TIMEOUT),i=setTimeout(D,Q)}))}var k=function(){function A(){F()(this,A),this._listeners=Object.create(null)}return y()(A,[{key:"on",value:function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._on(A,I,{external:!0,once:g&&g.once})}},{key:"off",value:function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._off(A,I,{external:!0,once:g&&g.once})}},{key:"dispatch",value:function(A,I){var g=this._listeners[A];if(g&&0!==g.length){var B,Q,C=h(g.slice(0));try{for(C.s();!(Q=C.n()).done;){var E=Q.value,D=E.listener,i=E.external;E.once&&this._off(A,D),i?(B||(B=[]),B.push(D)):D(I)}}catch(A){C.e(A)}finally{C.f()}if(B){var o,w=h(B);try{for(w.s();!(o=w.n()).done;){(0,o.value)(I)}}catch(A){w.e(A)}finally{w.f()}B=null}}}},{key:"_on",value:function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._listeners[A]||(this._listeners[A]=[]),this._listeners[A].push({listener:I,external:g&&!0===g.external,once:g&&!0===g.once})}},{key:"_off",value:function(A,I){var g=this._listeners[A];if(g)for(var B=0,Q=g.length;B<Q;B++)if(g[B].listener===I)return void g.splice(B,1)}}]),A}(),S=function(A){E()(g,A);var I=R(g);function g(){return F()(this,g),I.apply(this,arguments)}return y()(g,[{key:"dispatch",value:function(A,I){if("undefined"!=typeof PDFJSDev&&!PDFJSDev.test("MOZCENTRAL"))throw new Error("Not implemented: AutomationEventBus.dispatch");Q()(w()(g.prototype),"dispatch",this).call(this,A,I);var B=Object.create(null);if(I)for(var C in I){var E=I[C];if("source"!==C)B[C]=E;else if(E===window||E===document)return}var D=document.createEvent("CustomEvent");D.initCustomEvent(A,!0,!0,B),document.dispatchEvent(D)}}]),g}(k)},function(A,I,g){var B=g(14);function Q(){return"undefined"!=typeof Reflect&&Reflect.get?(A.exports=Q=Reflect.get.bind(),A.exports.__esModule=!0,A.exports.default=A.exports):(A.exports=Q=function(A,I,g){var Q=B(A,I);if(Q){var C=Object.getOwnPropertyDescriptor(Q,I);return C.get?C.get.call(arguments.length<3?A:g):C.value}},A.exports.__esModule=!0,A.exports.default=A.exports),Q.apply(this,arguments)}A.exports=Q,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(15);A.exports=function(A,I){for(;!Object.prototype.hasOwnProperty.call(A,I)&&null!==(A=B(A)););return A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){function g(I){return A.exports=g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},A.exports.__esModule=!0,A.exports.default=A.exports,g(I)}A.exports=g,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(17);A.exports=function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),I&&B(A,I)},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){function g(I,B){return A.exports=g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,I){return A.__proto__=I,A},A.exports.__esModule=!0,A.exports.default=A.exports,g(I,B)}A.exports=g,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(3).default,Q=g(19);A.exports=function(A,I){if(I&&("object"===B(I)||"function"==typeof I))return I;if(void 0!==I)throw new TypeError("Derived constructors may only return object or undefined");return Q(A)},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdViewer",(function(){return k}));var B=g(7),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(21),w=g.n(o),G=g(8),F=g.n(G),N=g(22),y=g(29),R=g(30),h=g(37),M=g(36);function U(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return c(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return c(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function c(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var k=function(){function A(I,g,B,Q,C){E()(this,A),w()(this,"scrollModePageState",null),this.jumpPageEvt=null,this.coreHelper=new M.Ofd_Core_Helper,this.ofdRender=new R.Ofd_Render(null,new M.Ofd_Core_Helper),Q&&this.ofdRender.setMixBlendMode(Q),this.defaultScale=C||N.DEFAULT_SCALE_VALUE,this.ofdCanvasRender=new h.OfdCanvasRender(null,this.coreHelper),this.eventBus=B,this.container=I,this.viewer=g,this._currentScaleValue=this.defaultScale,this._pages=[],this._currentScale=1,this._spreadMode=N.SpreadMode.NONE,this._scrollMode=N.ScrollMode.VERTICAL,this._pagesRotation=0,this.currentPage=1,this.scroll=Object(N.watchScroll)(this.container,this._scrollUpdate.bind(this)),this.eventBus.dispatch("pagechanging",{source:this,pageNumber:1,pageLabel:null,previous:1}),this.eventBus._on("jumpPage",this.jumpPage.bind(this)),this.scrollModePageState={previousPageNumber:1,scrollDown:!0,pages:[]},this._location=null,this.lastViewerHeight=0,this.lastViewerContainerScrollTop=0,this.lastViewerWidth=0,this.lastViewerContainerScrollLeft=0}var I;return i()(A,[{key:"getPages",value:function(){return this._pages}},{key:"currentScaleValue",get:function(){return this._currentScaleValue},set:function(A){this.core&&this._setScale(A,!1)}},{key:"getOfdCore",value:function(){return this.core}},{key:"emptyNode",value:function(A){if(A)for(;A.firstChild;)A.removeChild(A.firstChild)}},{key:"_scrollUpdate",value:function(){0!==this.pageCount&&this.updateView()}},{key:"_getVisiblePages",value:function(){var A=this._pages;return Object(N.getVisibleElements)({scrollEl:this.container,views:A,sortByVisibility:!0,horizontal:false,rtl:false})}},{key:"renderHighestPriority",value:function(A){this.forceRendering(A)}},{key:"getScrollAhead",value:function(A){if(A.first&&1===A.first.id)return!0;if(A.last&&A.last.id===this.pageCount)return!1;switch(this._scrollMode){case N.ScrollMode.PAGE:return this.scrollModePageState.scrollDown;case N.ScrollMode.HORIZONTAL:return this.scroll.right}return this.scroll.down}},{key:"forceRendering",value:(I=Q()(F.a.mark((function A(I){var g,B,Q,C,E,D,i,o,w;return F.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this._scrollMode!==N.ScrollMode.PAGE?(B=I||this._getVisiblePages(),Q=this.getScrollAhead(B),this._spreadMode!==N.SpreadMode.NONE&&(this._scrollMode,N.ScrollMode.HORIZONTAL),g=Object(y.getHighestPriority)(B,this._pages,Q)):g=I,!g||g.renderingState!==N.RenderingStates.INITIAL){A.next=27;break}return this.emptyNode(g.div.firstChild),A.next=5,this.ofdRender.renderPage(g.div.firstChild,0,g.id-1);case 5:this.highLightEle(),C=this,E=U(document.getElementsByName("seal_img_div_".concat(g.id-1))),A.prev=8,i=F.a.mark((function A(){var I;return F.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:(I=D.value).addEventListener("click",(function(){C.eventBus.dispatch("signatureclick",{source:C,pageRef:I.dataset.pageRef,signatureId:I.dataset.signatureId})}));case 2:case"end":return A.stop()}}),A)})),E.s();case 11:if((D=E.n()).done){A.next=15;break}return A.delegateYield(i(),"t0",13);case 13:A.next=11;break;case 15:A.next=20;break;case 17:A.prev=17,A.t1=A.catch(8),E.e(A.t1);case 20:return A.prev=20,E.f(),A.finish(20);case 23:for(g.renderingState=N.RenderingStates.FINISHED,this.renderHighestPriority(),o=0;o<g.id-10;o++)(w=this._pages[o]).renderingState===N.RenderingStates.FINISHED&&(this.emptyNode(w.div.firstChild),w.renderingState=N.RenderingStates.INITIAL);return A.abrupt("return",!0);case 27:return A.abrupt("return",!1);case 28:case"end":return A.stop()}}),A,this,[[8,17,20,23]])}))),function(A){return I.apply(this,arguments)})},{key:"highLightEle",value:function(){if(this.removeHighLight(),this.jumpPageEvt&&this.jumpPageEvt.eleIdArray){document.getElementById(this.jumpPageEvt.eleIdArray[0].eleId);this.jumpPageEvt.eleIdArray.forEach((function(A){var I=document.getElementById("page_".concat(A.pageIndex));if(I.firstElementChild&&I.firstElementChild.childElementCount>0){var g=document.getElementById(A.eleId),B=document.createElement("div");B.className="highLight",B.setAttribute("style","position:absolute;left:".concat(g.style.left,";top:").concat(g.style.top,";width:").concat(g.style.width,";height:").concat(g.style.height)),I.firstElementChild.appendChild(B)}})),this.jumpPageEvt=null}}},{key:"removeHighLight",value:function(){var A=document.getElementsByClassName("highLight");if(A)for(var I=A.length-1;I>=0;I--){var g=A[I];g&&g.parentNode.removeChild(g)}}},{key:"updateView",value:function(){var A=this._getVisiblePages(),I=A.views;if(0!==I.length){this.renderHighestPriority(A);var g,B=this.currentPage,Q=!1,C=U(I);try{for(C.s();!(g=C.n()).done;){var E=g.value;if(E.percent<100)break;if(E.id===B){Q=!0;break}}}catch(A){C.e(A)}finally{C.f()}Q||(B=I[0].id),this._setCurrentPageNumber(B)}}},{key:"logError",value:function(A,I){}},{key:"showDocumentError",value:function(A,I){this.logError(A,I);var g=document.createElement("div");g.classList.add("error"),g.textContent=I,this.emptyNode(this.viewer),this.viewer.appendChild(g)}},{key:"resetPageScale",value:function(){this.core&&(this.coreHelper.setDpi(96*this._currentScale),this.reformDiv(this._pagesRotation))}},{key:"reformDiv",value:function(A){for(var I=0;I<this._pages.length;++I){var g=this._pages[I].div,B=this.coreHelper.pageRenderWidth(0,I,this.core),Q=this.coreHelper.pageRenderHeight(0,I,this.core),C=g.firstChild,E=new M.Ofd_Core_Helper,D=E.pageRenderWidth(0,I,this.core),i=E.pageRenderHeight(0,I,this.core);switch(A){case 0:g.style.width=B+"px",g.style.height=Q+"px",0,this._pages[I].width=B,this._pages[I].height=Q,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform:rotate(",0,"deg) translate(").concat((B-D)/2,"px, ").concat((Q-i)/2,"px) scale(").concat(this._currentScale,")"));break;case 90:g.style.width=Q+"px",g.style.height=B+"px",(B-Q)/2,this._pages[I].width=Q,this._pages[I].height=B,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform: translate(").concat((Q-D)/2,"px, ").concat((B-i)/2,"px) rotate(").concat(A,"deg) scale(").concat(this._currentScale,")"));break;case 180:g.style.width=B+"px",g.style.height=Q+"px",0,this._pages[I].width=B,this._pages[I].height=Q,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform:rotate(",180,"deg) translate(").concat(-(B-D)/2,"px, ").concat(-(Q-i)/2,"px) scale(").concat(this._currentScale,")"));break;case 270:g.style.width=Q+"px",g.style.height=B+"px",-(B-Q)/2,this._pages[I].width=Q,this._pages[I].height=B,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform: translate(").concat((Q-D)/2,"px, ").concat((B-i)/2,"px) rotate(",270,"deg) scale(").concat(this._currentScale,")"))}this._pages[I].scale=this._currentScale;var o={width:this._pages[I].width,height:this._pages[I].height,scale:this._currentScale};this._pages[I].viewport=o}if(0!==this.lastViewerHeight&&0!==this.lastViewerContainerScrollTop){var w=this.viewer.scrollHeight;this.container.scrollTo({top:this.lastViewerContainerScrollTop/this.lastViewerHeight*w})}if(0!==this.lastViewerWidth&&0!==this.lastViewerContainerScrollLeft){var G=this.viewer.scrollWidth;this.container.scrollTo({left:this.lastViewerContainerScrollLeft/this.lastViewerWidth*G})}this.eventBus.dispatch("viewportchanging",{source:this})}},{key:"initDiv",value:function(){var A=this.viewer;this._pages=[],this.emptyNode(A);var I=this;A.addEventListener("click",(function(){I.eventBus.dispatch("pageViewerClick",{source:I})}));for(var g=0;g<this.pageCount;++g){var B=document.createElement("div");B.classList.add("page"),B.id="page_"+g;var Q=this.coreHelper.pageRenderWidth(0,g,this.core),C=this.coreHelper.pageRenderHeight(0,g,this.core);B.style.width=Q+"px",B.style.height=C+"px",B.style.overflow="hidden",B.style.position="relative";var E=document.createElement("div");B.style.width=Q+"px",B.style.height=C+"px",0;var D=new M.Ofd_Core_Helper,i=D.pageRenderWidth(0,g,this.core),o=D.pageRenderHeight(0,g,this.core);E.style.width=i+"px",E.style.height=o+"px",E.style.overflow="hidden",E.style.transform="translate(".concat((Q-i)/2,"px, ").concat((C-o)/2,"px) scale(").concat(this._currentScale,")"),B.appendChild(E),A.appendChild(B),0===g&&E.appendChild(this.initLoadingImg());var w={width:Q,height:C,scale:this._currentScale};this._pages.push({div:B,viewport:w,id:g+1,renderingState:N.RenderingStates.INITIAL,scale:this._currentScale,width:Q,height:C})}}},{key:"currentPageNumber",get:function(){return this.currentPage}},{key:"_setCurrentPageNumber",value:function(A){if(this.currentPage===A)return!0;if(!(0<A&&A<=this.pageCount))return!1;var I=this.currentPage;return this.currentPage=A,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:A,pageLabel:null,previous:I}),!0}},{key:"setRotation",value:function(A){A+=this._pagesRotation,Object(N.isValidRotation)(A),(A%=360)<0&&(A+=360),this._pagesRotation!==A&&this.core&&(this._pagesRotation=A,this.reformDiv(this._pagesRotation,!0),this.updateView())}},{key:"increaseScale",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,I=this._currentScale;do{I=(I*N.DEFAULT_SCALE_DELTA).toFixed(2),I=Math.ceil(10*I)/10,I=Math.min(N.MAX_SCALE,I)}while(--A>0&&I<N.MAX_SCALE);this._setScale(I)}},{key:"decreaseScale",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,I=this._currentScale;do{I=(I/N.DEFAULT_SCALE_DELTA).toFixed(2),I=Math.floor(10*I)/10,I=Math.max(N.MIN_SCALE,I)}while(--A>0&&I>N.MIN_SCALE);this._setScale(I)}},{key:"zoom",value:function(A){this._setScale(A)}},{key:"_setScale",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.lastViewerHeight=this.viewer.scrollHeight,this.lastViewerWidth=this.viewer.scrollWidth,this.lastViewerContainerScrollTop=this.container.scrollTop,this.lastViewerContainerScrollLeft=this.container.scrollLeft;var g=parseFloat(A);if(g>0)this._setScaleUpdatePages(g,A,I,!1);else{var B=this._pages[0];if(!B)return;var Q=N.SCROLLBAR_PADDING,C=N.VERTICAL_PADDING,E=(this.container.clientWidth-Q)/B.width*B.scale/1,D=(this.container.clientHeight-C)/B.height*B.scale;switch(A){case"page-actual":g=1;break;case"page-width":g=E;break;case"page-height":g=D;break;case"page-fit":g=Math.min(E,D);break;case"auto":var i=Object(N.isPortraitOrientation)(B)?E:Math.min(D,E);g=Math.min(N.MAX_AUTO_SCALE,i);break;default:return}this._setScaleUpdatePages(g,A,I,!0)}}},{key:"isSameScale",value:function(A){return A===this._currentScale||Math.abs(A-this._currentScale)<1e-15}},{key:"ensurePageViewVisible",value:function(){if(this._scrollMode!==N.ScrollMode.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");var A=this.currentPageNumber,I=this.scrollModePageState,g=this.viewer;if(g.textContent="",I.pages.length=0,this._spreadMode===N.SpreadMode.NONE){var B=this._pages[A-1];B.renderingState===N.RenderingStates.INITIAL&&this.forceRendering(B),g.appendChild(B.div)}else{var Q=new Set,C=this._spreadMode-1;A%2!==C?(Q.add(A-1),Q.add(A)):(Q.add(A-2),Q.add(A-1));var E,D=null,i=U(Q);try{for(i.s();!(E=i.n()).done;){var o=E.value,w=this._pages[o];w&&(null===D?((D=document.createElement("div")).className="spread",g.appendChild(D)):o%2===C&&(D=D.cloneNode(!1),g.appendChild(D)),D.appendChild(w.div))}}catch(A){i.e(A)}finally{i.f()}}I.scrollDown=A>=I.previousPageNumber,I.previousPageNumber=A}},{key:"_setScaleUpdatePages",value:function(A,I){var g=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._currentScaleValue=I.toString(),this.isSameScale(A)?g&&this.eventBus.dispatch("scalechanging",{source:this,scale:A,presetValue:I}):(this._currentScale=A,this.resetPageScale(),this.eventBus.dispatch("scalechanging",{source:this,scale:A,presetValue:g?I:void 0}))}},{key:"setSpreadMode",value:function(A){if(this._spreadMode!==A){if(!Object(N.isValidSpreadMode)(A))throw new Error("Invalid spread mode: ".concat(A));this._spreadMode=A,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:A}),this._updateSpreadMode(this.currentPage)}}},{key:"_updateSpreadMode",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,I=this._pages;if(this._scrollMode===N.ScrollMode.PAGE)this.ensurePageViewVisible();else if(this._spreadMode===N.SpreadMode.NONE){this.viewer.textContent="";for(var g=0,B=I.length;g<B;++g)this.viewer.appendChild(I[g].div)}else{this.viewer.textContent="";for(var Q=this._spreadMode-1,C=null,E=0,D=I.length;E<D;++E)null===C?((C=document.createElement("div")).className="spread",this.viewer.appendChild(C)):E%2===Q&&(C=C.cloneNode(!1),this.viewer.appendChild(C)),C.appendChild(I[E].div)}A&&(this._currentScale&&isNaN(this._currentScale)&&this._setScale(this._currentScale,!0),this._setCurrentPageNumber(A,!0),this.updateView())}},{key:"setScrollMode",value:function(A){if(this._scrollMode!==A){if(!Object(N.isValidScrollMode)(A))throw new Error("Invalid scroll mode: ".concat(A));this.pageCount>15e3||(this._previousScrollMode=this._scrollMode,this._scrollMode=A,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:A}),this._updateScrollMode(this.currentPage))}}},{key:"_updateScrollMode",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,I=this._scrollMode;this.viewer.classList.toggle("scrollHorizontal",I===N.ScrollMode.HORIZONTAL),this.viewer.classList.toggle("scrollWrapped",I===N.ScrollMode.WRAPPED),this.core&&(I===N.ScrollMode.PAGE?this.ensurePageViewVisible():this._previousScrollMode===N.ScrollMode.PAGE&&this._updateSpreadMode(),this._currentScale&&isNaN(this._currentScale)&&this._setScale(this._currentScale,!0),this._setCurrentPageNumber(A,!0),this.updateView())}},{key:"firstPage",value:function(){this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(1),this.ensurePageViewVisible()):this.viewer.children.item(0).scrollIntoView(!0);return!0}},{key:"lastPage",value:function(){this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(this.pageCount),this.ensurePageViewVisible()):this.viewer.children.item(this.pageCount-1).scrollIntoView(!0);return!0}},{key:"nextPage",value:function(){var A=this.currentPage;if(A>=this.pageCount)return!1;this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(A+1),this.ensurePageViewVisible()):this.viewer.children.item(A).scrollIntoView(!0);return!0}},{key:"previousPage",value:function(){var A=this.currentPage;if(A<=1)return!1;this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(A-1),this.ensurePageViewVisible()):this.viewer.children.item(A-2).scrollIntoView(!0);return!0}},{key:"jumpPage",value:function(A){(this.jumpPageEvt=A,this._scrollMode===N.ScrollMode.PAGE)?(A.pageIndex&&this._setCurrentPageNumber(A.pageIndex),this.ensurePageViewVisible()):(this.viewer.children.item(A.pageIndex-1).scrollIntoView(!0),this.highLightEle())}},{key:"freeDocument",value:function(){this.currentPage=1,this.pageCount=0,this._pages=[],this.emptyNode(this.viewer)}},{key:"initLoadingImg",value:function(){var A=new Image;return A.style.position="absolute",A.style.left=0,A.style.right=0,A.style.margin="auto",A.style.top=0,A.style.bottom=0,A.src="data:image/gif;base64,R0lGODlhNgA3APMAAP///zAyOJKTlkdJTzw+RN/g4XV2euPj5M/Q0WtscaChpDAyODAyODAyODAyODAyOCH5BAkKAAAAIf4aQ3JlYXRlZCB3aXRoIGFqYXhsb2FkLmluZm8AIf8LTkVUU0NBUEUyLjADAQAAACwAAAAANgA3AAAEzBDISau9OOvNu/9gKI5kaZ4lkhBEgqCnws6EApMITb93uOqsRC8EpA1Bxdnx8wMKl51ckXcsGFiGAkamsy0LA9pAe1EFqRbBYCAYXXUGk4DWJhZN4dlAlMSLRW80cSVzM3UgB3ksAwcnamwkB28GjVCWl5iZmpucnZ4cj4eWoRqFLKJHpgSoFIoEe5ausBeyl7UYqqw9uaVrukOkn8LDxMXGx8ibwY6+JLxydCO3JdMg1dJ/Is+E0SPLcs3Jnt/F28XXw+jC5uXh4u89EQAh+QQJCgAAACwAAAAANgA3AAAEzhDISau9OOvNu/9gKI5kaZ5oqhYGQRiFWhaD6w6xLLa2a+iiXg8YEtqIIF7vh/QcarbB4YJIuBKIpuTAM0wtCqNiJBgMBCaE0ZUFCXpoknWdCEFvpfURdCcM8noEIW82cSNzRnWDZoYjamttWhphQmOSHFVXkZecnZ6foKFujJdlZxqELo1AqQSrFH1/TbEZtLM9shetrzK7qKSSpryixMXGx8jJyifCKc1kcMzRIrYl1Xy4J9cfvibdIs/MwMue4cffxtvE6qLoxubk8ScRACH5BAkKAAAALAAAAAA2ADcAAATOEMhJq7046827/2AojmRpnmiqrqwwDAJbCkRNxLI42MSQ6zzfD0Sz4YYfFwyZKxhqhgJJeSQVdraBNFSsVUVPHsEAzJrEtnJNSELXRN2bKcwjw19f0QG7PjA7B2EGfn+FhoeIiYoSCAk1CQiLFQpoChlUQwhuBJEWcXkpjm4JF3w9P5tvFqZsLKkEF58/omiksXiZm52SlGKWkhONj7vAxcbHyMkTmCjMcDygRNAjrCfVaqcm11zTJrIjzt64yojhxd/G28XqwOjG5uTxJhEAIfkECQoAAAAsAAAAADYANwAABM0QyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7/i8qmCoGQoacT8FZ4AXbFopfTwEBhhnQ4w2j0GRkgQYiEOLPI6ZUkgHZwd6EweLBqSlq6ytricICTUJCKwKkgojgiMIlwS1VEYlspcJIZAkvjXHlcnKIZokxJLG0KAlvZfAebeMuUi7FbGz2z/Rq8jozavn7Nev8CsRACH5BAkKAAAALAAAAAA2ADcAAATLEMhJq7046827/2AojmRpnmiqrqwwDAJbCkRNxLI42MSQ6zzfD0Sz4YYfFwzJNCmPzheUyJuKijVrZ2cTlrg1LwjcO5HFyeoJeyM9U++mfE6v2+/4PD6O5F/YWiqAGWdIhRiHP4kWg0ONGH4/kXqUlZaXmJlMBQY1BgVuUicFZ6AhjyOdPAQGQF0mqzauYbCxBFdqJao8rVeiGQgJNQkIFwdnB0MKsQrGqgbJPwi2BMV5wrYJetQ129x62LHaedO21nnLq82VwcPnIhEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7/g8Po7kX9haKoAZZ0iFGIc/iRaDQ40Yfj+RepSVlpeYAAgJNQkIlgo8NQqUCKI2nzNSIpynBAkzaiCuNl9BIbQ1tl0hraewbrIfpq6pbqsioaKkFwUGNQYFSJudxhUFZ9KUz6IGlbTfrpXcPN6UB2cHlgfcBuqZKBEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7yJEopZA4CsKPDUKfxIIgjZ+P3EWe4gECYtqFo82P2cXlTWXQReOiJE5bFqHj4qiUhmBgoSFho59rrKztLVMBQY1BgWzBWe8UUsiuYIGTpMglSaYIcpfnSHEPMYzyB8HZwdrqSMHxAbath2MsqO0zLLorua05OLvJxEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhfohELYHQuGBDgIJXU0Q5CKqtOXsdP0otITHjfTtiW2lnE37StXUwFNaSScXaGZvm4r0jU1RWV1hhTIWJiouMjVcFBjUGBY4WBWw1A5RDT3sTkVQGnGYYaUOYPaVip3MXoDyiP3k3GAeoAwdRnRoHoAa5lcHCw8TFxscduyjKIrOeRKRAbSe3I9Um1yHOJ9sjzCbfyInhwt3E2cPo5dHF5OLvJREAOw==",A.draggable=!1,A}},{key:"setWaterText",value:function(A){this.ofdRender.coreHelper.setWaterText(A)}},{key:"setWaterSetting",value:function(A){this.ofdRender.coreHelper.setWaterSetting(A)}},{key:"setOfdCore",value:function(A){this.core=A,this.ofdRender.setOfdCore(this.core),this.ofdCanvasRender.setOfdCore(this.core),this._spreadMode=N.SpreadMode.NONE,this._scrollMode=N.ScrollMode.VERTICAL,this._pagesRotation=0,this.pageCount=this.core.getOFDPageCount(0),this.eventBus.dispatch("pagechanging",{source:this,pageNumber:1,pageLabel:null,previous:1}),this.viewer.scrollTo(0,0);var I=N.SCROLLBAR_PADDING,g=(N.VERTICAL_PADDING,this.container.clientWidth,new M.Ofd_Core_Helper(96)),B=(this.container.clientWidth-I)/g.pageRenderWidth(0,0,this.core)*1/1,Q=Math.min(N.MAX_AUTO_SCALE,B);this.defaultScale!==N.DEFAULT_SCALE_VALUE&&(Q=this.defaultScale),this._currentScale=Q,this.coreHelper.setDpi(96*Q),this.initDiv(0),this.updateView(),this.eventBus.dispatch("scalechanging",{source:this,scale:Q,presetValue:this.defaultScale}),this.eventBus.dispatch("viewportchanging",{source:this}),this.scrollModePageState={previousPageNumber:1,scrollDown:!0,pages:[]}}}]),A}()},function(A,I,g){var B=g(2);A.exports=function(A,I,g){return(I=B(I))in A?Object.defineProperty(A,I,{value:g,enumerable:!0,configurable:!0,writable:!0}):A[I]=g,A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"animationStarted",(function(){return u})),g.d(I,"apiPageLayoutToViewerModes",(function(){return v})),g.d(I,"apiPageModeToSidebarView",(function(){return _})),g.d(I,"approximateFraction",(function(){return W})),g.d(I,"AutoPrintRegExp",(function(){return J})),g.d(I,"backtrackBeforeAllVisibleElements",(function(){return f})),g.d(I,"binarySearchFirstItem",(function(){return l})),g.d(I,"DEFAULT_SCALE",(function(){return F})),g.d(I,"DEFAULT_SCALE_DELTA",(function(){return N})),g.d(I,"DEFAULT_SCALE_VALUE",(function(){return G})),g.d(I,"getActiveOrFocusedElement",(function(){return P})),g.d(I,"getPageSizeInches",(function(){return x})),g.d(I,"getVisibleElements",(function(){return V})),g.d(I,"isPortraitOrientation",(function(){return O})),g.d(I,"isValidRotation",(function(){return T})),g.d(I,"isValidScrollMode",(function(){return X})),g.d(I,"isValidSpreadMode",(function(){return j})),g.d(I,"MAX_AUTO_SCALE",(function(){return M})),g.d(I,"MAX_SCALE",(function(){return R})),g.d(I,"MIN_SCALE",(function(){return y})),g.d(I,"noContextMenuHandler",(function(){return b})),g.d(I,"normalizeWheelEventDelta",(function(){return m})),g.d(I,"normalizeWheelEventDirection",(function(){return p})),g.d(I,"OutputScale",(function(){return L})),g.d(I,"parseQueryString",(function(){return Z})),g.d(I,"PresentationModeState",(function(){return S})),g.d(I,"ProgressBar",(function(){return z})),g.d(I,"removeNullCharacters",(function(){return q})),g.d(I,"RendererType",(function(){return a})),g.d(I,"RenderingStates",(function(){return k})),g.d(I,"roundToDivide",(function(){return r})),g.d(I,"SCROLLBAR_PADDING",(function(){return U})),g.d(I,"scrollIntoView",(function(){return t})),g.d(I,"ScrollMode",(function(){return K})),g.d(I,"SidebarView",(function(){return s})),g.d(I,"SpreadMode",(function(){return H})),g.d(I,"TextLayerMode",(function(){return Y})),g.d(I,"UNKNOWN_SCALE",(function(){return h})),g.d(I,"VERTICAL_PADDING",(function(){return c})),g.d(I,"watchScroll",(function(){return d}));var B=g(23),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D);function o(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return w(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return w(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function w(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var G="auto",F=1,N=1.1,y=.1,R=10,h=0,M=1.25,U=40,c=5,k={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},S={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},s={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4,SIGNATURES:5},a={CANVAS:"canvas",SVG:"svg"},Y={DISABLE:0,ENABLE:1,ENABLE_ENHANCE:2},K={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},H={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2},J=/\bprint\s*\(/,L=function(){function A(){E()(this,A);var I=window.devicePixelRatio||1;this.sx=I,this.sy=I}return i()(A,[{key:"scaled",get:function(){return 1!==this.sx||1!==this.sy}}]),A}();function t(A,I){var g=arguments.length>2&&void 0!==arguments[2]&&arguments[2],B=A.offsetParent;if(B){for(var Q=A.offsetTop+A.clientTop,C=A.offsetLeft+A.clientLeft;B.clientHeight===B.scrollHeight&&B.clientWidth===B.scrollWidth||g&&(B.classList.contains("markedContent")||"hidden"===getComputedStyle(B).overflow);)if(Q+=B.offsetTop,C+=B.offsetLeft,!(B=B.offsetParent))return;I&&(void 0!==I.top&&(Q+=I.top),void 0!==I.left&&(C+=I.left,B.scrollLeft=C)),B.scrollTop=Q}}function d(A,I){var g=function(g){Q||(Q=window.requestAnimationFrame((function(){Q=null;var g=A.scrollLeft,C=B.lastX;g!==C&&(B.right=g>C),B.lastX=g;var E=A.scrollTop,D=B.lastY;E!==D&&(B.down=E>D),B.lastY=E,I(B)})))},B={right:!0,down:!0,lastX:A.scrollLeft,lastY:A.scrollTop,_eventHandler:g},Q=null;return A.addEventListener("scroll",g,!0),B}function Z(A){var I,g=new Map,B=o(new URLSearchParams(A));try{for(B.s();!(I=B.n()).done;){var C=Q()(I.value,2),E=C[0],D=C[1];g.set(E.toLowerCase(),D)}}catch(A){B.e(A)}finally{B.f()}return g}var e=/\x00/g,n=/[\x01-\x1F]/g;function q(A){return"string"!=typeof A?A:(arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(A=A.replace(n," ")),A.replace(e,""))}function l(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,B=A.length-1;if(B<0||!I(A[B]))return A.length;if(I(A[g]))return g;for(;g<B;){var Q=g+B>>1;I(A[Q])?B=Q:g=Q+1}return g}function W(A){if(Math.floor(A)===A)return[A,1];var I=1/A;if(I>8)return[1,8];if(Math.floor(I)===I)return[1,I];for(var g=A>1?I:A,B=0,Q=1,C=1,E=1;;){var D=B+C,i=Q+E;if(i>8)break;g<=D/i?(C=D,E=i):(B=D,Q=i)}return g-B/Q<C/E-g?g===A?[B,Q]:[Q,B]:g===A?[C,E]:[E,C]}function r(A,I){var g=A%I;return 0===g?A:Math.round(A-g+I)}function x(A){var I=A.view,g=A.userUnit,B=A.rotate,C=Q()(I,4),E=C[0],D=C[1],i=B%180!=0,o=(C[2]-E)/72*g,w=(C[3]-D)/72*g;return{width:i?w:o,height:i?o:w}}function f(A,I,g){if(A<2)return A;var B=I[A].div,Q=B.offsetTop+B.clientTop;Q>=g&&(Q=(B=I[A-1].div).offsetTop+B.clientTop);for(var C=A-2;C>=0&&!((B=I[C].div).offsetTop+B.clientTop+B.clientHeight<=Q);--C)A=C;return A}function V(A){var I=A.scrollEl,g=A.views,B=A.sortByVisibility,Q=void 0!==B&&B,C=A.horizontal,E=void 0!==C&&C,D=A.rtl,i=void 0!==D&&D,o=I.scrollTop,w=o+I.clientHeight,G=I.scrollLeft,F=G+I.clientWidth;var N=[],y=new Set,R=g.length,h=l(g,E?function(A){var I=A.div,g=I.offsetLeft+I.clientLeft,B=g+I.clientWidth;return i?g<F:B>G}:function(A){var I=A.div;return I.offsetTop+I.clientTop+I.clientHeight>o});h>0&&h<R&&!E&&(h=f(h,g,o));for(var M=E?F:-1,U=h;U<R;U++){var c=g[U],k=c.div,S=k.offsetLeft+k.clientLeft,s=k.offsetTop+k.clientTop,a=k.clientWidth,Y=k.clientHeight,K=S+a,H=s+Y;if(-1===M)H>=w&&(M=H);else if((E?S:s)>M)break;if(!(H<=o||s>=w||K<=G||S>=F)){var J=Math.max(0,o-s)+Math.max(0,H-w),L=(a-(Math.max(0,G-S)+Math.max(0,K-F)))/a,t=(Y-J)/Y*L*100|0;N.push({id:c.id,x:S,y:s,view:c,percent:t,widthPercent:100*L|0}),y.add(c.id)}}var d=N[0],Z=N[N.length-1];return Q&&N.sort((function(A,I){var g=A.percent-I.percent;return Math.abs(g)>.001?-g:A.id-I.id})),{first:d,last:Z,views:N,ids:y}}function b(A){A.preventDefault()}function p(A){var I=Math.hypot(A.deltaX,A.deltaY),g=Math.atan2(A.deltaY,A.deltaX);return-.25*Math.PI<g&&g<.75*Math.PI&&(I=-I),I}function m(A){var I=p(A);return 0===A.deltaMode?I/=900:1===A.deltaMode&&(I/=30),I}function T(A){return Number.isInteger(A)&&A%90==0}function X(A){return Number.isInteger(A)&&Object.values(K).includes(A)&&A!==K.UNKNOWN}function j(A){return Number.isInteger(A)&&Object.values(H).includes(A)&&A!==H.UNKNOWN}function O(A){return A.width<=A.height}var u=new Promise((function(A){"undefined"!=typeof PDFJSDev&&PDFJSDev.test("LIB")&&"undefined"==typeof window?setTimeout(A,20):window.requestAnimationFrame(A)}));var z=function(){function A(I){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},B=g.height,Q=g.width,C=g.units;E()(this,A),this.visible=!0,this.div=document.querySelector(I+" .progress"),this.bar=this.div.parentNode,this.height=B||100,this.width=Q||100,this.units=C||"%",this.div.style.height=this.height+this.units,this.percent=0}return i()(A,[{key:"_updateBar",value:function(){if(this._indeterminate)return this.div.classList.add("indeterminate"),void(this.div.style.width=this.width+this.units);this.div.classList.remove("indeterminate");var A=this.width*this._percent/100;this.div.style.width=A+this.units}},{key:"percent",get:function(){return this._percent},set:function(A){var I,g,B;this._indeterminate=isNaN(A),this._percent=(I=A,g=0,B=100,Math.min(Math.max(I,g),B)),this._updateBar()}},{key:"setWidth",value:function(A){if(A){var I=A.parentNode.offsetWidth-A.offsetWidth;if(I>0)document.documentElement.style.setProperty("--loadingBar-end-offset","".concat(I,"px"))}}},{key:"hide",value:function(){this.visible&&(this.visible=!1,this.bar.classList.add("hidden"))}},{key:"show",value:function(){this.visible||(this.visible=!0,this.bar.classList.remove("hidden"))}}]),A}();function P(){for(var A=document,I=A.activeElement||A.querySelector(":focus");I&&I.shadowRoot;)I=(A=I.shadowRoot).activeElement||A.querySelector(":focus");return I}function v(A){var I=K.VERTICAL,g=H.NONE;switch(A){case"SinglePage":I=K.PAGE;break;case"OneColumn":break;case"TwoPageLeft":I=K.PAGE;case"TwoColumnLeft":g=H.ODD;break;case"TwoPageRight":I=K.PAGE;case"TwoColumnRight":g=H.EVEN}return{scrollMode:I,spreadMode:g}}function _(A){switch(A){case"UseNone":return s.NONE;case"UseThumbs":return s.THUMBS;case"UseOutlines":return s.OUTLINE;case"UseAttachments":return s.ATTACHMENTS;case"UseOC":return s.LAYERS}return s.NONE}},function(A,I,g){var B=g(24),Q=g(25),C=g(26),E=g(28);A.exports=function(A,I){return B(A)||Q(A,I)||C(A,I)||E()},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A){if(Array.isArray(A))return A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A,I){var g=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=g){var B,Q,C,E,D=[],i=!0,o=!1;try{if(C=(g=g.call(A)).next,0===I){if(Object(g)!==g)return;i=!1}else for(;!(i=(B=C.call(g)).done)&&(D.push(B.value),D.length!==I);i=!0);}catch(A){o=!0,Q=A}finally{try{if(!i&&null!=g.return&&(E=g.return(),Object(E)!==E))return}finally{if(o)throw Q}}return D}},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(27);A.exports=function(A,I){if(A){if("string"==typeof A)return B(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);return"Object"===g&&A.constructor&&(g=A.constructor.name),"Map"===g||"Set"===g?Array.from(A):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?B(A,I):void 0}},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"getHighestPriority",(function(){return Q}));var B=g(22);function Q(A,I,g){var B=arguments.length>3&&void 0!==arguments[3]&&arguments[3],Q=A.views,E=Q.length;if(0===E)return null;for(var D=0;D<E;D++){var i=Q[D].view;if(!C(i))return i}var o=A.first.id,w=A.last.id;if(w-o+1>E)for(var G=A.ids,F=1,N=w-o;F<N;F++){var y=g?o+F:w-F;if(!G.has(y)){var R=I[y-1];if(!C(R))return R}}var h=g?w:o-2,M=I[h];return M&&!C(M)||B&&(M=I[h+=g?1:-1])&&!C(M)?M:null}function C(A){return A.renderingState===B.RenderingStates.FINISHED}},function(A,I,g){"use strict";g.r(I),g.d(I,"Ofd_Render",(function(){return h}));var B=g(7),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(8),w=g.n(o),G=g(31),F=g(32),N=g(35);g(36);function y(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return R(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return R(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function R(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var h=function(){function A(I,g){E()(this,A),this.core=I,this.coreHelper=g,this.mixBlendMode="darken"}var I;return i()(A,[{key:"setDpi",value:function(A){this.coreHelper.setDpi(A)}},{key:"setOfdCore",value:function(A){this.core=A}},{key:"setMixBlendMode",value:function(A){this.mixBlendMode=A}},{key:"renderPage",value:function(A,I,g,B,Q,C){var E=B?B.readOfdDocument(I):this.core.readOfdDocument(I),D=B?B.readOfdPage(I,g):this.core.readOfdPage(I,g);this.coreHelper.waterText&&!this.coreHelper.waterSetting&&A.appendChild(this.watermark({watermark_txt:this.coreHelper.waterText})),this.coreHelper.waterSetting&&A.appendChild(this.watermark(this.coreHelper.waterSetting));var i=D.Page.Template,o=E.Annotations?E.Annotations:[],w=B?B.readOfdTemplatePage(I):this.core.readOfdTemplatePage(I),F=E.Signatures?E.Signatures.Signature:[],R=E.CommonData.Res.Fonts,h=E.CommonData.Res.DrawParams,M=(E.CommonData.Res.ColorSpaces,E.CommonData.Res.CompositeGraphicUnits),U=E.CommonData.Res.MultiMedias;if(i){var c,k=y(i);try{for(k.s();!(c=k.n()).done;){var S,s=c.value,a=y(w);try{for(a.s();!(S=a.n()).done;){var Y=S.value;if(Y.ID==s.TemplateID){if((Y=B?B.readPageFromTemplate(Y):this.core.readPageFromTemplate(Y)).Page.Content){var K,H=y(Y.Page.Content.Layer);try{for(H.s();!(K=H.n()).done;){var J=K.value;this.renderLayer(C,Q,g,A,R,h,U,M,J,!1)}}catch(A){H.e(A)}finally{H.f()}}break}}}catch(A){a.e(A)}finally{a.f()}}}catch(A){k.e(A)}finally{k.f()}}if(D.Page.Content){var L,t=y(D.Page.Content.Layer);try{for(t.s();!(L=t.n()).done;){var d=L.value;this.renderLayer(C,Q,g,A,R,h,U,M,d,!1)}}catch(A){t.e(A)}finally{t.f()}}var Z,e=y(o);try{for(e.s();!(Z=e.n()).done;){var n=Z.value;if(D.ID==n.PageID){var q,l=y(n.PageAnnot.Annot);try{for(l.s();!(q=l.n()).done;){var W=q.value;this.renderAnnotation(C,Q,A,W,R,h,U,M,g)}}catch(A){l.e(A)}finally{l.f()}}}}catch(A){e.e(A)}finally{e.f()}var r,x=y(F);try{for(x.s();!(r=x.n()).done;){var f,V=r.value,b=y(V.Signature.SignedInfo.StampAnnot);try{for(b.s();!(f=b.n()).done;){var p=f.value,m=p.PageRef;if(D.ID==m){var T=p.Boundary;if(V.Signature.PicType&&V.Signature.PicType.length>0)if("ofd"===V.Signature.PicType)for(var X=new N.Ofd_Core(V.Signature.ofd),j=0;j<X.getOFDPageCount(0);j++)this.renderSealPage(A,j,X,!0,T,m,p.ID,g,V.Signature.ZipName);else if("svg"===V.Signature.PicType){var O=Object(G.converterBox)(T,this.coreHelper.dpi),u=document.createElement("div");u.innerHTML=V.Signature.svg;var z=void 0,P=u.children[0].width.baseVal.value,v=u.children[0].height.baseVal.value;P!==O.w&&(z="transform-origin: 0px 0px; transform: scale(".concat(O.h/v<O.w/P?O.h/v:O.w/P,")")),u.setAttribute("style","".concat(z,"; position:absolute; left: ",0,"px; top: ",0,"px; width: ").concat(O.w,"px; height: ").concat(O.h,"px;"));var _=document.createElement("div");_.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";cursor: pointer;position:absolute; left: ").concat(O.x,"px; top: ").concat(O.y,"px; width: ").concat(O.w,"px; height: ").concat(O.h,"px;overflow:hidden")),_.setAttribute("name","seal_img_div_".concat(g)),_.setAttribute("data-signature-id",p.ID),_.setAttribute("data-page-ref",m),_.appendChild(u),A.appendChild(_)}else{var $=Object(G.converterBox)(T,this.coreHelper.dpi),AA="data:image/".concat(V.Signature.PicType,";base64,").concat(V.Signature.PicValue),IA=this.renderImageOnDiv(g,A.style.width,A.style.height,AA,$.w,$.h,$,p.Clip,!0,m,p.ID);IA.svg.setAttribute("style","".concat(IA.style,"left:").concat(IA.left,"px;top:").concat(IA.top,"px;mix-blend-mode:").concat(this.mixBlendMode)),V.Signature.PicType||IA.svg.removeChild(IA.svg.children[0]),A.appendChild(IA.svg)}else{var gA=Object(G.converterBox)(T,this.coreHelper.dpi),BA=document.createElement("div");BA.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";cursor: pointer;position:absolute; left: ").concat(gA.x,"px; top: ").concat(gA.y,"px; width: ").concat(gA.w,"px; height: ").concat(gA.h,"px;overflow:hidden")),BA.setAttribute("name","seal_img_div_".concat(g)),BA.setAttribute("data-signature-id",p.ID),BA.setAttribute("data-page-ref",m),A.appendChild(BA)}}}}catch(A){b.e(A)}finally{b.f()}}}catch(A){x.e(A)}finally{x.f()}}},{key:"throwWhite",value:(I=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",new Promise((function(A,g){var B=new Image;B.onload=function(){var I=B.width,g=B.height,Q=document.createElement("canvas");Q.style.width="".concat(I,"px"),Q.style.height="".concat(g,"px"),Q.width=I,Q.height=g;var C=Q.getContext("2d");C.drawImage(B,0,0,I,g);for(var E=C.getImageData(0,0,I,g),D=E.data,i=0;i<D.length;i+=4)[D[i],D[i+1],D[i+2]].every((function(A){return A<256&&A>245}))&&(D[i+3]=0);C.putImageData(E,0,0),A(Q.toDataURL())},B.src=I})));case 1:case"end":return A.stop()}}),A)}))),function(A){return I.apply(this,arguments)})},{key:"renderAnnotation",value:function(A,I,g,B,Q,C,E,D,i){var o=document.createElement("div");o.setAttribute("style","overflow: hidden;;position:relative;");var w=B.Appearance.Boundary;if(w){var F=Object(G.converterBox)(w,this.coreHelper.dpi);o.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";overflow: visible;position:absolute; left: ").concat(F.x,"px; top: ").concat(F.y,"px; width: ").concat(F.w,"px; height: ").concat(F.h,"px"))}else o.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";overflow: visible;position:absolute; left: 0px; top: 0px; width: 1px; height: 1px"));var N=B.Appearance;this.renderLayer(A,I,i,o,Q,C,E,D,N,!1),g.appendChild(o)}},{key:"renderSealPage",value:function(A,I,g,B,Q,C,E,D,i){var o,w;o=Q;var F=g.pageWidth(0,I),N=g.pageHeight(0,I);F!==o.w&&(w="transform-origin: 0px 0px; transform: scale(".concat(o.h/N<o.w/F?o.h/N:o.w/F,")"));var y=Object(G.converterBox)(o,this.coreHelper.dpi),R=document.createElement("div");R.setAttribute("name","seal_img_div_".concat(D)),R.setAttribute("style","".concat(w,";cursor: pointer; position:absolute; left: ",0,"px; top: ",0,"px; width: ").concat(y.w,"px; height: ").concat(y.h,"px;")),R.setAttribute("data-signature-id",E),R.setAttribute("data-page-ref",C),this.renderPage(R,0,I,g,E,i);var h=document.createElement("div");h.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";position:absolute; left: ").concat(y.x,"px; top: ").concat(y.y,"px; width: ").concat(y.w,"px; height: ").concat(y.h,"px;overflow:hidden")),h.appendChild(R),A.appendChild(h)}},{key:"renderLayer",value:function(A,I,g,B,Q,C,E,D,i,o,w,F,N){var R=null,h=null,M=Object(G.converterDpi)(.353,this.coreHelper.dpi),U=i.DrawParam;if(U&&Object(G.getDrawParam)(C,U)){var c=Object(G.getDrawParam)(C,U);if(Object(G.getDrawParam)(C,c.Relative)){var k=Object(G.getDrawParam)(C,c.Relative);k&&(k.StrokeColor&&(c.StrokeColor=k.StrokeColor),k.FillColor&&(c.FillColor=k.FillColor),k.LineWidth&&(c.LineWidth=k.LineWidth))}c.FillColor&&(R=Object(G.parseColor)(c.FillColor.Value)),c.StrokeColor&&(h=Object(G.parseColor)(c.StrokeColor.Value)),c.LineWidth&&(M=Object(G.converterDpi)(c.LineWidth,this.coreHelper.dpi))}var S=i.PageBlock;if(S){var s,a=y(S);try{for(a.s();!(s=a.n()).done;){var Y=s.value;if("ImageObject"==Y.Type){var K=this.renderImageObject(A,I,g,B.style.width,B.style.height,E,Y,o,F,N,i.ctm);K&&(K.svg.setAttribute("style","".concat(K.style,"left:").concat(K.left,"px;top:").concat(K.top,"px;")),B.appendChild(K.svg))}else if("PathObject"==Y.Type){var H=this.renderPathObject(A,I,g,C,Y,R,h,M,o,w,F,N,E,Q);H.style&&(H.svg.setAttribute("style","".concat(H.style,"left:").concat(H.left,"px;top:").concat(H.top,"px;")),B.appendChild(H.svg))}else if("TextObject"==Y.Type){if(i.ctm){var J=i.ctm.split(" ");Y.CTM={a:J[0],b:J[1],c:J[2],d:J[3],e:J[4],f:J[5]}}var L=this.renderTextObject(B,Q,Y,R,h,C,w,F,N);L.childElementCount>0&&B.appendChild(L)}else if("CompositeObject"==Y.Type){var t,d=y(D);try{for(d.s();!(t=d.n()).done;){var Z=t.value;if(Z.ID===Y.ResourceID){var e=Y.Alpha,n=Y.Boundary,q=Y.CTM;this.renderLayer(A,I,g,B,Q,C,E,D,Z,!1,e,n,q);break}}}catch(A){d.e(A)}finally{d.f()}}}}catch(A){a.e(A)}finally{a.f()}}}},{key:"renderImageObject",value:function(A,I,g,B,Q,C,E,D,i,o,w){var N=E.Boundary;N=Object(G.converterBox)(N,this.coreHelper.dpi);var y=E.ResourceID;if(!y)return null;var R=Object(G.getMultiMedia)(C,y);if(!R.MediaFile)return null;var h,M=E.ImageMask;if(M>0&&(h=Object(G.getMultiMedia)(C,M)).MediaFile&&!(h.width>0||h.height>0)&&h.MediaFile){var U=Object(F.JSGetImageInfoByPath)(this.core.ofdParserPtr,h.MediaFile,h.MediaFileResPln,this.core.getDocPln(0),A);U.ext,h.width=U.width,h.height=U.height,h.FileBase64=U.fileBase64}if(!(R.width>0||R.height>0)&&R.MediaFile){var c=Object(F.JSGetImageInfoByPath)(this.core.ofdParserPtr,R.MediaFile,R.MediaFileResPln,this.core.getDocPln(0),A);if("other"===c.ext)return null;R.width=c.width,R.height=c.height,R.FileBase64=c.fileBase64}var k=E.CTM,S=E.Clips,s=E.BlendMode,a=E.Alpha;return this.renderImageOnDiv(g,B,Q,R.FileBase64,R.width,R.height,N,!1,D,null,null,k,i,o,S,E.ID,s,a,M>0&&h.FileBase64?h.FileBase64:null,w)}},{key:"renderImageOnDiv",value:function(A,I,g,B,Q,C,E,D,i,o,w,F,N,R,h,M,U,c,k,S){var s=parseFloat(I.replace("px","")),a=parseFloat(g.replace("px","")),Y=E.w>s?s:E.w,K=E.h>a?a:E.h,H=document.createElementNS("http://www.w3.org/2000/svg","svg"),J=document.createElementNS("http://www.w3.org/2000/svg","image"),L="";i&&(L="cursor: pointer;",H.setAttribute("viewbox","0 0 ".concat(Y," ").concat(K)),H.setAttribute("name","seal_img_div_".concat(A)),H.setAttribute("data-signature-id",w),H.setAttribute("data-page-ref",o),J.setAttribute("preserveAspectRatio","none slice"));var t=Q,d=C;J.setAttribute("xlink:href",B),J.href.baseVal=B,J.setAttribute("width","".concat(t,"px")),J.setAttribute("height","".concat(d,"px")),c&&J.setAttribute("opacity","".concat(c/255));var Z="";if(F){var e=1,n=1;if(S){var q=S.split(" ");e=q[0],n=q[3]}Z="matrix(".concat(F.a/t/Object(G.ctmImageScale)(this.coreHelper.dpi)*e," ").concat(F.b/t/Object(G.ctmImageScale)(this.coreHelper.dpi)," ").concat(F.c/d/Object(G.ctmImageScale)(this.coreHelper.dpi)," ").concat(F.d/d/Object(G.ctmImageScale)(this.coreHelper.dpi)*n," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")")}R&&(Z="".concat(Z," matrix(").concat(R.a," ").concat(R.b," ").concat(R.c," ").concat(R.d," ").concat(Object(G.converterDpi)(R.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(R.f,this.coreHelper.dpi),")")),J.setAttribute("transform",Z);var l="";D&&(D=Object(G.converterBox)(D,this.coreHelper.dpi),l="clip: rect(".concat(D.y,"px, ").concat(D.w+D.x,"px, ").concat(D.h+D.y,"px, ").concat(D.x,"px)"));var W=[];if(h&&h.length>0)for(var r=0;r<h.length;r++){var x=document.createElementNS("http://www.w3.org/2000/svg","clipPath");x.setAttribute("id","image-clip-path-".concat(M,"-").concat(r));for(var f=h[r].Clip,V=0;V<f.length;V++){var b=f[V].Area,p=0,m=0,T=0,X=0;b.Path.Boundary&&(p=b.Path.Boundary.x,m=b.Path.Boundary.y,T=b.Path.Boundary.w,X=b.Path.Boundary.h);var j=document.createElementNS("http://www.w3.org/2000/svg","path");if(b.CTM)F=b.CTM;else if(b.TransFlag)if(b.Path.CTM);else if(F&&0==F.b&&0==F.c){var O="matrix(".concat(F.a," ").concat(F.b," ").concat(F.c," ").concat(F.d," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")");j.setAttribute("transform",O)}var u,z="",P=y(b.Path.AbbreviatedData);try{for(P.s();!(u=P.n()).done;){var v=u.value;"M"===v.cmd||"S"===v.cmd?z+="M ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],X)+m,this.coreHelper.dpi)," "):"L"===v.cmd?z+="L ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],X)+m,this.coreHelper.dpi)," "):"B"===v.cmd?z+="C ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],X)+m,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[2]+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[3]+m,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[4]+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[5]+m,this.coreHelper.dpi)," "):"Q"===v.cmd?z+="Q ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],X)+m,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[2]+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[3]+m,this.coreHelper.dpi)," "):"A"===v.cmd?z+="A ".concat(Object(G.converterDpi)(v.crds[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(v.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[3],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(v.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(v.crds[6],this.coreHelper.dpi)):"C"===v.cmd&&(z+="Z")}}catch(A){P.e(A)}finally{P.f()}j.setAttribute("d",z),x.appendChild(j)}W.push(x)}if(k){var _=document.createElementNS("http://www.w3.org/2000/svg","mask");_.setAttribute("id","mask-".concat(M));var $=document.createElementNS("http://www.w3.org/2000/svg","image");$.setAttribute("xlink:href",k),$.href.baseVal=k,_.appendChild($),H.appendChild(_),J.setAttribute("mask","url(#mask-".concat(M,")"))}H.appendChild(J);var AA,IA=E.x,gA=E.y;if(R){var BA=R.a,QA=R.b,CA=R.c,EA=R.d,DA=BA>0?Math.sign(BA)*Math.sqrt(BA*BA+CA*CA):Math.sqrt(BA*BA+CA*CA),iA=EA>0?Math.sign(EA)*Math.sqrt(QA*QA+EA*EA):Math.sqrt(QA*QA+EA*EA);0==Math.atan2(-QA,EA)&&0!=BA&&1==EA||(gA*=iA,IA*=DA)}U&&(AA="mix-blend-mode: ".concat(U));var oA="".concat(L,"overflow: visible; position: absolute; width: ").concat(Y,"px; height: ").concat(K,"px; ").concat(l,";").concat(AA,";");if(W.length>0)if(1==W.length)H.appendChild(W[0]),H.setAttribute("clip-path","url(#image-clip-path-".concat(M,"-0)"));else{var wA,GA="",FA=y(W);try{for(FA.s();!(wA=FA.n()).done;){var NA=wA.value;void 0!==NA.children[0].getAttribute("d")&&(GA+="clip-path:path('".concat(NA.children[0].getAttribute("d"),"');"))}}catch(A){FA.e(A)}finally{FA.f()}oA="".concat(GA,";").concat(oA,";")}return{svg:H,style:oA,left:IA,top:gA}}},{key:"renderTextObject",value:function(A,I,g,B,Q,C,E,D,i){var o=1,w=g.Boundary;w=Object(G.converterBox)(w,this.coreHelper.dpi);var N=g.CTM,R=g.HScale,h=g.Font,M=g.Weight,U=g.Alpha/255,c=g.Size>0;N&&!c&&(N={a:-N.a,b:N.b,c:N.c,d:-N.d,e:-N.e,f:-N.f});var k=Object(G.converterDpi)(Math.abs(parseFloat(g.Size)),this.coreHelper.dpi),S=Object(G.calTextPoint)(this.coreHelper.dpi,g.TextCode,g.CGTransform,N,g.Boundary,D,i,c,R),s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("xmlns","http://www.w3.org/2000/svg"),s.setAttribute("version","1.1"),s.setAttribute("id",g.ID);var a,Y,K,H=g.FillColor,J=!1,L=g.DrawParam;if(L){var t=Object(G.getDrawParam)(C,L);t.FillColor&&(H&&H.Value||(H=t.FillColor))}if(H){H.Value&&(B=Object(G.parseColor)(H.Value)),o=H.alpha/255;var d=H.axialShd;if(d){J=!0;var Z=document.createElementNS("http://www.w3.org/2000/svg","linearGradient");Z.setAttribute("id","".concat(g.ID)),Z.setAttribute("x1","0%"),Z.setAttribute("y1","0%"),Z.setAttribute("x2","100%"),Z.setAttribute("y2","100%");var e,n=y(d.Segment);try{for(n.s();!(e=n.n()).done;){var q=e.value;if(q){var l=document.createElement("stop");l.setAttribute("offset","".concat(100*q.position,"%")),l.setAttribute("style","stop-color:".concat(Object(G.parseColor)(q.color.Value),";stop-opacity:1")),Z.appendChild(l),B=Object(G.parseColor)(q.color.Value)}}}catch(A){n.e(A)}finally{n.f()}s.appendChild(Z)}}g.Stroke&&(a=Object(G.parseColor)(g.StrokeColor.Value),Y=g.LineWidth,K=g.LineWidth),g.Fill||(o=0);var W=w.w,r=w.h,x=w.x,f=w.y,V=k,b=k,p=0;if(N){var m=N.a,T=N.b,X=N.c,j=N.d,O=m>0?Math.sign(m)*Math.sqrt(m*m+X*X):Math.sqrt(m*m+X*X),u=j>0?Math.sign(j)*Math.sqrt(T*T+j*j):Math.sqrt(T*T+j*j);0==(p=Math.atan2(-T,j))&&0!=m&&1==j||(V*=O,b*=u,K*=O),0==p&&0!=m&&1==j&&(V*=O,b*=u,K*=O),0==p&&R-0==1&&(R=m/j)>0&&(V*=R)}if(i){var z=i.a,P=i.b,v=i.c,_=i.d,$=z>0?Math.sign(z)*Math.sqrt(z*z+v*v):Math.sqrt(z*z+v*v),AA=_>0?Math.sign(_)*Math.sqrt(P*P+_*_):Math.sqrt(P*P+_*_);0==(p=Math.atan2(-P,_))&&0!=z&&1==_||(V*=$,b*=AA,f*=AA,x*=$,W*=$,r*=AA)}var IA=Object(G.getFont)(I,h),gA="",BA="",QA="",CA="";N&&(CA="matrix(".concat(N.a," ").concat(N.b," ").concat(N.c," ").concat(N.d," ").concat(Object(G.converterDpi)(N.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(N.f,this.coreHelper.dpi),")")),i&&(CA="".concat(CA," matrix(").concat(i.a," ").concat(i.b," ").concat(i.c," ").concat(i.d," ").concat(Object(G.converterDpi)(i.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(i.f,this.coreHelper.dpi),")")),R&&(CA="".concat(CA," scale(").concat(R,", 1)"));for(var EA=!1,DA=0;DA<S.length;DA++){var iA=S[DA];if(iA&&!isNaN(iA.x)){if(iA.glyph&&IA&&IA.face&&N.b>=0){EA=!0;var oA=Object(F.loadFaceInfo)(IA.face),wA=Object(F.FT_Glyph_Get_Measure)(IA.face,iA.glyph),GA=this.drawGlyph(wA.glyphPath,wA.horiUnderlinePosition,oA.units_per_EM,V,b,Q||B,o,a,K,g.ID);if(0===p)GA.img.setAttribute("style","overflow: visible;position:absolute; left: ".concat(Math.ceil(iA.cx),"px; top: ").concat(iA.cy-GA.yScale*wA.horiUnderlinePosition-b,"px;width: ").concat(Math.ceil(V),"px; height:").concat(Math.ceil(b),"px")),A.appendChild(GA.img);else{var FA=document.createElement("div");FA.setAttribute("style","transform-origin: center;transform: rotate(".concat(-p,"rad);position:absolute; left: ").concat(iA.cx,"px; top: ").concat(iA.cy-GA.yScale*wA.horiUnderlinePosition-b,"px;width: ").concat(Math.ceil(V),"px; height:").concat(Math.ceil(b),"px")),GA.img.setAttribute("style","position: absolute;left: 0px;top:0px;width: ".concat(Math.ceil(V),"px; height:").concat(Math.ceil(b),"px")),FA.appendChild(GA.img),A.appendChild(FA)}}if(gA=R?"".concat(gA).concat(iA.x+R*iA.x," "):"".concat(gA).concat(iA.x," "),BA="".concat(BA).concat(iA.y," "),QA=" "==iA.text?"".concat(QA," "):"".concat(QA).concat(iA.text),S.length>1&&R){var NA=document.createElementNS("http://www.w3.org/2000/svg","text");NA.setAttribute("x",iA.x),NA.setAttribute("y",iA.y),NA.innerHTML=iA.text,NA.setAttribute("transform",CA),J?NA.setAttribute("fill",B):(NA.setAttribute("fill",Q),NA.setAttribute("fill",B),NA.setAttribute("fill-opacity",EA?0:o<U?o:U)),EA||(yA&&s.appendChild(yA),NA.setAttribute("clip-path","url(#clip-path-".concat(g.ID,"-0)"))),a&&Y>0&&(NA.setAttribute("stroke",a),NA.setAttribute("stroke-width",Object(G.converterDpi)(Y,this.coreHelper.dpi))),NA.setAttribute("style","font-weight: ".concat(M,";font-size:").concat(k,"px;font-family: ").concat(Object(G.getFontFamily)(IA),";")),EA||s.appendChild(NA)}}}var yA=null,RA=g.Clips;if(RA&&RA.length>0){for(var hA=[],MA=0;MA<RA.length;MA++){(yA=document.createElementNS("http://www.w3.org/2000/svg","clipPath")).setAttribute("id","clip-path-".concat(g.ID,"-").concat(MA));for(var UA=RA[MA].Clip,cA=0;cA<UA.length;cA++){var kA=UA[cA].Area,SA=document.createElementNS("http://www.w3.org/2000/svg","path"),sA="",aA=0,YA=0;kA.Path.Boundary&&(aA=kA.Path.Boundary.x,YA=kA.Path.Boundary.y),EA&&(YA=-YA);var KA,HA=y(kA.Path.AbbreviatedData);try{for(HA.s();!(KA=HA.n()).done;){var JA=KA.value;"M"===JA.cmd||"S"===JA.cmd?sA+="M ".concat(Object(G.converterDpi)(JA.crds[0]+aA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[1]+YA,this.coreHelper.dpi)," "):"L"===JA.cmd?sA+="L ".concat(Object(G.converterDpi)(JA.crds[0]+aA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[1]+YA,this.coreHelper.dpi)," "):"B"===JA.cmd?sA+="C ".concat(Object(G.converterDpi)(JA.crds[0]+aA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[1]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[2]+aA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[3]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[4]+aA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[5]+YA,this.coreHelper.dpi)," "):"Q"===JA.cmd?sA+="Q ".concat(Object(G.converterDpi)(JA.crds[0]+aA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[1]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[2]+aA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[3]+YA,this.coreHelper.dpi)," "):"A"===JA.cmd?sA+="A ".concat(Object(G.converterDpi)(JA.crds[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(JA.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[3],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(JA.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(JA.crds[6],this.coreHelper.dpi)):"C"===JA.cmd&&(sA+="Z")}}catch(A){HA.e(A)}finally{HA.f()}SA.setAttribute("d",sA),yA.appendChild(SA),hA.push(yA)}}if(hA.length>0)if(1==hA.length)s.appendChild(hA[0]);else{var LA,tA=y(hA);try{for(tA.s();!(LA=tA.n()).done;){var dA=LA.value;void 0!==dA.children[0].getAttribute("d")&&"clip-path:path('".concat(dA.children[0].getAttribute("d"),"');")}}catch(A){tA.e(A)}finally{tA.f()}}}if(!R){var ZA=document.createElementNS("http://www.w3.org/2000/svg","text");ZA.setAttribute("x",gA),ZA.setAttribute("y",BA),ZA.textContent=QA,ZA.setAttribute("transform",CA),J?ZA.setAttribute("fill",B):(ZA.setAttribute("fill",Q),ZA.setAttribute("fill",B),ZA.setAttribute("fill-opacity",EA?0:o<U?o:U)),g.Visible||ZA.setAttribute("fill-opacity",0),EA||(yA&&s.appendChild(yA),ZA.setAttribute("clip-path","url(#clip-path-".concat(g.ID,"-0)"))),a&&Y>0&&(ZA.setAttribute("stroke",a),ZA.setAttribute("stroke-width",Object(G.converterDpi)(Y,this.coreHelper.dpi))),ZA.setAttribute("style","font-weight: ".concat(M,";font-size:").concat(k,"px;font-family: ").concat(Object(G.getFontFamily)(IA),";")),EA||s.appendChild(ZA)}if(D){var eA=Object(G.converterBox)(D,this.coreHelper.dpi);x+=eA.x,f+=eA.y}return s.setAttribute("style","overflow:visible;position:absolute;width:".concat(W,"px;height:").concat(r,"px;left:").concat(x,"px;top:").concat(f,"px;")),s}},{key:"renderPathObject",value:function(A,I,g,B,Q,C,E,D,i,o,w,F,N,R){var h=document.createElementNS("http://www.w3.org/2000/svg","svg");h.setAttribute("version","1.1"),h.setAttribute("xmlns","http://www.w3.org/2000/svg");var M=Q.Boundary;if(!M)return{svg:h,style:""};M=Object(G.converterBox)(M,this.coreHelper.dpi);var U=Q.LineWidth,c=Q.AbbreviatedData,k=Q.StrokeColor,S=Q.FillColor,s=Q.CTM,a=document.createElementNS("http://www.w3.org/2000/svg","path");a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("ID",Q.ID),U&&(D=Object(G.converterDpi)(U,this.coreHelper.dpi));var Y=Q.DrawParam;if(Y){var K=Object(G.getDrawParam)(B,Y);(U=K.LineWidth)&&(D=Object(G.converterDpi)(U,this.coreHelper.dpi)),K.FillColor&&(S&&S.Value||(S=K.FillColor)),K.StrokeColor&&(k&&k.Value||(k=K.StrokeColor))}s?a.setAttribute("transform","matrix(".concat(s.a," ").concat(s.b," ").concat(s.c," ").concat(s.d," ").concat(Object(G.converterDpi)(s.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(s.f,this.coreHelper.dpi),")")):F&&a.setAttribute("transform","matrix(".concat(F.a," ").concat(F.b," ").concat(F.c," ").concat(F.d," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")"));if(k){k.Value&&(E=Object(G.parseColor)(k.Value));var H=k.axialShd;if(H){!0;var J=document.createElementNS("http://www.w3.org/2000/svg","linearGradient");J.setAttribute("id","".concat(Q.ID)),J.setAttribute("x1","0%"),J.setAttribute("y1","0%"),J.setAttribute("x2","100%"),J.setAttribute("y2","100%");var L,t=y(H.Segment);try{for(t.s();!(L=t.n()).done;){var d=L.value;if(d){var Z=document.createElement("stop");Z.setAttribute("offset","".concat(100*d.position,"%")),Z.setAttribute("style","stop-color:".concat(Object(G.parseColor)(d.color.Value),";stop-opacity:1")),J.appendChild(Z),E=Object(G.parseColor)(d.color.Value)}}}catch(A){t.e(A)}finally{t.f()}h.appendChild(J)}}if(S){S.Value&&(C=Object(G.parseColor)(S.Value)),void 0!==S.Alpha&&0===S.Alpha&&(C="none"),void 0!==S.alpha&&0===S.alpha?C="none":a.setAttribute("fill-opacity","".concat(S.alpha/255));var e=S.axialShd;if(e){!0;var n=document.createElement("linearGradient");n.setAttribute("id","".concat(Q.ID)),n.setAttribute("x1","0%"),n.setAttribute("y1","0%"),n.setAttribute("x2","100%"),n.setAttribute("y2","100%");var q,l=y(e.Segment);try{for(l.s();!(q=l.n()).done;){var W=q.value;if(W){var r=document.createElement("stop");r.setAttribute("offset","".concat(100*W.position,"%")),r.setAttribute("style","stop-color:".concat(Object(G.parseColor)(W.color.Value),";stop-opacity:1")),n.appendChild(r),C=Object(G.parseColor)(W.color.Value)}}}catch(A){l.e(A)}finally{l.f()}h.appendChild(n)}}if(D>0&&!E&&(E="rgb(0, 0, 0)"),0===Q.Alpha&&(C="none"),o&&a.setAttribute("fill-opacity","".concat(o/255)),Q.Stroke&&(a.setAttribute("stroke","".concat(E)),a.setAttribute("stroke-width","".concat(D,"px"))),Q.Fill?(a.setAttribute("fill-rule",Q.Rule),a.setAttribute("fill","".concat(i?"none":C||"none"))):a.setAttribute("fill","none"),Q.Join&&a.setAttribute("stroke-linejoin","".concat(Q["@_Join"])),Q.Cap&&a.setAttribute("stroke-linecap","".concat(Q["@_Cap"])),Q.DashPattern){var x=Q.DashPattern,f=Object(G.parseCtm)(x),V=0;Q.DashOffset&&(V=Q.DashOffset),a.setAttribute("stroke-dasharray","".concat(Object(G.converterDpi)(f[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(f[1],this.coreHelper.dpi))),a.setAttribute("stroke-dashoffset","".concat(Object(G.converterDpi)(V,this.coreHelper.dpi),"px"))}var b,p="",m=y(c);try{for(m.s();!(b=m.n()).done;){var T=b.value;"M"===T.cmd||"S"===T.cmd?p+="M ".concat(Object(G.converterDpi)(T.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[1],this.coreHelper.dpi)," "):"L"===T.cmd?p+="L ".concat(Object(G.converterDpi)(T.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[1],this.coreHelper.dpi)," "):"B"===T.cmd?p+="C ".concat(Object(G.converterDpi)(T.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[3],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[5],this.coreHelper.dpi)," "):"Q"===T.cmd?p+="Q ".concat(Object(G.converterDpi)(T.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[3],this.coreHelper.dpi)," "):"A"===T.cmd?p+="A ".concat(Object(G.converterDpi)(T.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[1],this.coreHelper.dpi)," ").concat(T.crds[2]," ").concat(T.crds[3],",").concat(T.crds[4]," ").concat(Object(G.converterDpi)(T.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(T.crds[6],this.coreHelper.dpi)," "):"C"===T.cmd&&(p+="Z")}}catch(A){m.e(A)}finally{m.f()}a.setAttribute("d",p),h.appendChild(a);var X=M.w,j=M.h,O=M.x,u=M.y,z=S.pattern;if(z){var P=document.createElementNS("http://www.w3.org/2000/svg","defs"),v=document.createElementNS("http://www.w3.org/2000/svg","pattern");v.setAttribute("width",Object(G.converterDpi)(z.width,this.coreHelper.dpi)),v.setAttribute("height",Object(G.converterDpi)(z.height,this.coreHelper.dpi)),z.ctm&&v.setAttribute("height",Object(G.converterDpi)(z.height,this.coreHelper.dpi)+Object(G.converterDpi)(z.ctm.split(" ")[5],this.coreHelper.dpi)),v.setAttribute("x",Object(G.converterDpi)(z.width,this.coreHelper.dpi)),v.setAttribute("y",Object(G.converterDpi)(z.height,this.coreHelper.dpi)),v.setAttribute("id","pattern1-".concat(Q.ID)),v.setAttribute("patternUnits","userSpaceOnUse"),this.renderLayer(A,I,g,v,R,B,N,null,z,!1,null,null,null),P.appendChild(v),h.appendChild(P);var _=document.createElementNS("http://www.w3.org/2000/svg","rect");_.setAttribute("width",X),_.setAttribute("height",j),_.setAttribute("style","fill:url(#pattern1-".concat(Q.ID,")")),h.appendChild(_)}var $=Q.Clips;if($&&$.length>0){for(var AA=[],IA=0;IA<$.length;IA++){var gA=document.createElementNS("http://www.w3.org/2000/svg","clipPath");gA.setAttribute("id","clip-path-".concat(I,"-").concat(g,"-").concat(Q.ID,"-").concat(IA));for(var BA=$[IA].Clip,QA=0;QA<BA.length;QA++){var CA=BA[QA].Area,EA=document.createElementNS("http://www.w3.org/2000/svg","path"),DA="",iA=0,oA=0,wA=0,GA=0;if(CA.Path.Boundary&&(iA=CA.Path.Boundary.x,oA=CA.Path.Boundary.y,wA=CA.Path.Boundary.w,GA=CA.Path.Boundary.h),!CA.TransFlag&&CA.CTM){var FA=CA.CTM,NA=void 0;if(NA=s?"matrix(".concat(FA.a," ").concat(FA.b," ").concat(FA.c," ").concat(FA.d," ").concat(Object(G.converterDpi)(FA.e-s.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(FA.f-s.f,this.coreHelper.dpi),")"):"matrix(".concat(FA.a," ").concat(FA.b," ").concat(FA.c," ").concat(FA.d," ").concat(Object(G.converterDpi)(FA.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(FA.f,this.coreHelper.dpi),")"),s){var yA=[[s.a,s.c,0],[s.b,s.d,0],[0,0,1]],RA=Object(G.inv)(yA);isNaN(RA[0][0])||RA[0][0]===1/0||(NA="".concat(NA," matrix(").concat(RA[0][0]," ").concat(RA[1][0]," ").concat(RA[0][1]," ").concat(RA[1][1]," 0 0)"))}EA.setAttribute("transform",NA)}if(!CA.TransFlag&&CA.Path.CTM){var hA=CA.Path.CTM,MA="matrix(".concat(hA.a," ").concat(hA.b," ").concat(hA.c," ").concat(hA.d," ").concat(Object(G.converterDpi)(hA.e-s.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(hA.f-s.f,this.coreHelper.dpi),")");if(s){var UA=[[s.a,s.c,0],[s.b,s.d,0],[0,0,1]],cA=Object(G.inv)(UA);isNaN(cA[0][0])||cA[0][0]===1/0||(MA="".concat(MA," matrix(").concat(cA[0][0]," ").concat(cA[1][0]," ").concat(cA[0][1]," ").concat(cA[1][1]," 0 0)"))}EA.setAttribute("transform",MA)}var kA,SA=y(CA.Path.AbbreviatedData);try{for(SA.s();!(kA=SA.n()).done;){var sA=kA.value;"M"===sA.cmd||"S"===sA.cmd?DA+="M ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[0],wA)+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[1],GA)+oA,this.coreHelper.dpi)," "):"L"===sA.cmd?DA+="L ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[0],wA)+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[1],GA)+oA,this.coreHelper.dpi)," "):"B"===sA.cmd?DA+="C ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[0],wA)+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[1],GA)+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[2]+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[3]+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[4]+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[5]+oA,this.coreHelper.dpi)," "):"Q"===sA.cmd?DA+="Q ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[0],wA)+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[1],GA)+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[2]+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[3]+oA,this.coreHelper.dpi)," "):"A"===sA.cmd?DA+="A ".concat(Object(G.converterDpi)(sA.crds[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(sA.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[3],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(sA.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(sA.crds[6],this.coreHelper.dpi)):"C"===sA.cmd&&(DA+="Z")}}catch(A){SA.e(A)}finally{SA.f()}EA.setAttribute("d",DA),gA.appendChild(EA)}AA.push(gA)}if(AA.length>0)if(1==AA.length)h.appendChild(AA[0]),a.setAttribute("clip-path","url(#clip-path-".concat(I,"-").concat(g,"-").concat(Q.ID,"-0)"));else{var aA,YA="",KA=y(AA);try{for(KA.s();!(aA=KA.n()).done;){var HA=aA.value;void 0!==HA.children[0].getAttribute("d")&&(YA+="clip-path:path('".concat(HA.children[0].getAttribute("d"),"');"))}}catch(A){KA.e(A)}finally{KA.f()}a.setAttribute("style",YA)}}var JA="overflow:hidden;position:absolute;width:".concat(Math.ceil(X),"px;height:").concat(Math.ceil(j),"px;");if(w){var LA=document.createElementNS("http://www.w3.org/2000/svg","svg");LA.setAttribute("version","1.1");var tA=Object(G.converterBox)(w,this.coreHelper.dpi),dA=Math.ceil(tA.w),ZA=Math.ceil(tA.h),eA=tA.x+O,nA=tA.y+u;return JA="overflow:hidden;position:absolute;width:".concat(dA,"px;height:").concat(ZA,"px;"),F&&s&&h.setAttribute("transform","matrix(".concat(F.a," ").concat(F.b," ").concat(F.c," ").concat(F.d," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")")),LA.appendChild(h),{svg:LA,style:JA,left:eA,top:nA}}return{svg:h,style:JA,left:O,top:u}}},{key:"drawGlyph",value:function(A,I,g,B,Q,C,E,D,i,o){var w=B/g,F=Q/g,N=document.createElementNS("http://www.w3.org/2000/svg","svg");N.setAttribute("version","1.1"),N.setAttribute("xmlns","http://www.w3.org/2000/svg");var y=document.createElementNS("http://www.w3.org/2000/svg","path");return y.setAttribute("transform","translate(0, ".concat(Q,") scale(").concat(w,", ").concat(-F,") translate(0, ").concat(-I,")")),y.setAttribute("d",A),C&&y.setAttribute("fill",C),y.setAttribute("fill-opacity",E),D&&(y.setAttribute("stroke","".concat(D)),y.setAttribute("stroke-width","".concat(Object(G.converterDpi)(i,this.coreHelper.dpi),"px"))),y.setAttribute("clip-path","url(#clip-path-".concat(o,"-0)")),N.appendChild(y),{img:N,yScale:F}}},{key:"watermark",value:function(A){var I={watermark_txt:"text",watermark_x:20,watermark_y:20,watermark_rows:20,watermark_cols:20,watermark_x_space:100,watermark_y_space:50,watermark_color:"#aaa",watermark_alpha:.4,watermark_fontsize:"15px",watermark_font:"微软雅黑",watermark_width:210,watermark_height:80,watermark_angle:20};if(1===arguments.length&&"object"==typeof arguments[0]){var g=arguments[0]||{};for(var B in g)g[B]&&I[B]&&g[B]===I[B]||g[B]&&(I[B]=g[B])}var Q,C,E=document.createDocumentFragment(),D=(D=Math.max(document.body.scrollWidth,document.body.clientWidth))-.015*D,i=Math.max(document.body.scrollHeight,document.body.clientHeight)+450;i=Math.max(i,window.innerHeight-30),(0==I.watermark_cols||parseInt(I.watermark_x+I.watermark_width*I.watermark_cols+I.watermark_x_space*(I.watermark_cols-1))>D)&&(I.watermark_cols=parseInt((D-I.watermark_x+I.watermark_x_space)/(I.watermark_width+I.watermark_x_space)),I.watermark_x_space=parseInt((D-I.watermark_x-I.watermark_width*I.watermark_cols)/(I.watermark_cols-1))),(0==I.watermark_rows||parseInt(I.watermark_y+I.watermark_height*I.watermark_rows+I.watermark_y_space*(I.watermark_rows-1))>i)&&(I.watermark_rows=parseInt((I.watermark_y_space+i-I.watermark_y)/(I.watermark_height+I.watermark_y_space)),I.watermark_y_space=parseInt((i-I.watermark_y-I.watermark_height*I.watermark_rows)/(I.watermark_rows-1)));for(var o=0;o<I.watermark_rows;o++){C=I.watermark_y+(I.watermark_y_space+I.watermark_height)*o;for(var w=0;w<I.watermark_cols;w++){Q=I.watermark_x+(I.watermark_width+I.watermark_x_space)*w;var G=document.createElement("div");G.id="mask_div"+o+w,G.className="mask_div",G.innerHTML=I.watermark_txt,G.style.webkitTransform="rotate(-"+I.watermark_angle+"deg)",G.style.MozTransform="rotate(-"+I.watermark_angle+"deg)",G.style.msTransform="rotate(-"+I.watermark_angle+"deg)",G.style.OTransform="rotate(-"+I.watermark_angle+"deg)",G.style.transform="rotate(-"+I.watermark_angle+"deg)",G.style.visibility="",G.style.position="absolute",G.style.left=Q+"px",G.style.top=C+"px",G.style.overflow="hidden",G.style.zIndex="9999",G.style.pointerEvents="none",G.style.opacity=I.watermark_alpha,G.style.fontSize=I.watermark_fontsize,G.style.fontFamily=I.watermark_font,G.style.color=I.watermark_color,G.style.textAlign="center",G.style.width=I.watermark_width+"px",G.style.height=I.watermark_height+"px",G.style.display="block",E.appendChild(G)}}return E}}]),A}()},function(A,I,g){"use strict";function B(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return Q(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return Q(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,C=function(){};return{s:C,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var E,D=!0,i=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return D=A.done,A},e:function(A){i=!0,E=A},f:function(){try{D||null==g.return||g.return()}finally{if(i)throw E}}}}function Q(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}g.r(I),g.d(I,"converterDpi",(function(){return C})),g.d(I,"ctmImageScale",(function(){return E})),g.d(I,"adjustPosLimit",(function(){return w})),g.d(I,"calTextPoint",(function(){return G})),g.d(I,"decodeHtml",(function(){return y})),g.d(I,"getFontFamily",(function(){return h})),g.d(I,"parseStBox",(function(){return M})),g.d(I,"parseCtm",(function(){return U})),g.d(I,"parseColor",(function(){return c})),g.d(I,"converterBox",(function(){return S})),g.d(I,"Uint8ArrayToHexString",(function(){return s})),g.d(I,"replaceFirstSlash",(function(){return a})),g.d(I,"replaceFirstTarget",(function(){return Y})),g.d(I,"readUTF",(function(){return K})),g.d(I,"getMultiMedia",(function(){return H})),g.d(I,"getDrawParam",(function(){return J})),g.d(I,"getFont",(function(){return L})),g.d(I,"inv",(function(){return Z}));var C=function(A,I){return function(A,I){return A*I/25.4}(A,I)},E=function(A){return 25.4/A},D=function(A,I,g){return{cx:A*g.a+I*g.c+1*g.e,cy:A*g.b+I*g.d+1*g.f}},i=function(A,I,g){return{ctmX:A*g.a+I*g.c,ctmY:A*g.b+I*g.d}},o=function(A,I,g){return{cx:g.x+A,cy:g.y+I}},w=function(A,I){return 0===I?A:A>I?I:A},G=function(A,I,g,Q,E,w,G,F,N){var R=0,h=0,M=0,U=0,c=[];if(!I)return c;var k,S=B(I);try{for(S.s();!(k=S.n()).done;){var s=k.value;if(s){if(R=F?parseFloat(s.X):-parseFloat(s.X),h=F?parseFloat(s.Y):-parseFloat(s.Y),isNaN(R)&&(R=0),isNaN(h)&&(h=0),M=R,U=h,Q){var a=D(M,U,Q);M=a.cx,U=a.cy}var Y=[],K=[];s.DeltaX&&s.DeltaX.length>0&&(Y=s.DeltaX),s.DeltaY&&s.DeltaY.length>0&&(K=s.DeltaY);var H=s.text;if(H){H=(H=y(H+="")).replace(/ /g," ");for(var J=0;J<H.length;J++){if(J>0&&Y.length>0){var L=J-1;if(L>=Y.length&&(L=Y.length-1),R+=N?F?Y[L]/N:-Y[L]/N:F?Y[L]:-Y[L],Q)M+=i(F?Y[J-1]:-Y[J-1],0,Q).ctmX;else M=R}if(J>0&&K.length>0){var t=J-1;if(t>=K.length&&(t=K.length-1),h+=F?K[t]:-K[t],Q)U+=i(0,F?K[J-1]:-K[J-1],Q).ctmY;else U=h}var d=H.substring(J,J+1),Z=o(M,U,E);G&&(Z=D(Z.cx,Z.cy,G));var e={x:C(R,A),y:C(h,A),text:d,cx:C(Z.cx,A),cy:C(Z.cy,A)};c.push(e)}}}}}catch(A){S.e(A)}finally{S.f()}if(c.length>0){var n,q=B(g);try{for(q.s();!(n=q.n()).done;)for(var l=n.value,W=l.CodePosition,r=l.GlyphCount,x=W;x<r+W;x++)if(c.length<=x){var f="".concat(c[c.length-1].glyph," ").concat(l.Glyphs[x-W]);c[c.length-1].glyph=f}else c[x].glyph=l.Glyphs[x-W]}catch(A){q.e(A)}finally{q.f()}}return c},F=/&\w+;|&#(\d+);/g,N={"<":"<",">":">","&":"&"," ":" ",""":'"',"©":"","'":"'"},y=function(A){return"string"!=typeof(A=null!=A?A:this.toString())?A:A.replace(F,(function(A,I){var g=N[A];return null==g&&(g=isNaN(I)?A:String.fromCharCode(160==I?32:I)),g}))},R={"楷体":"楷体, KaiTi, Kai, simkai",kaiti:"楷体, KaiTi, Kai, simkai",Kai:"楷体, KaiTi, Kai",simsun:"SimSun, simsun, Songti SC","宋体":"SimSun, simsun, Songti SC","黑体":"SimHei, STHeiti, simhei","仿宋":"FangSong, STFangsong, simfang","小标宋体":"小标宋体","方正小标宋_gbk":"方正小标宋_gbk, FZXiaoBiaoSong-B05S, NSimSun","方正小标宋简体":"方正小标宋_gbk, FZXiaoBiaoSong-B05S, NSimSun","仿宋_gb2312":"FangSong, STFangsong, simfang","楷体_gb2312":"楷体, KaiTi, Kai, simkai",couriernew:"Courier New","courier new":"Courier New"},h=function(A){if(!A)return R["宋体"];var I=A.FamilyName;I||(I=A.FontName),R[I.toLowerCase()]&&(I=R[I.toLowerCase()]);for(var g=0,B=Object.keys(R);g<B.length;g++){var Q=B[g];if(-1!=I.toLowerCase().indexOf(Q.toLowerCase()))return R[Q]}return I},M=function(A){if(A){var I=A.split(" ");return{x:parseFloat(I[0]),y:parseFloat(I[1]),w:parseFloat(I[2]),h:parseFloat(I[3])}}return null},U=function(A){return A.split(" ")},c=function(A){if(!(A&&A.length>0))return"rgb(0, 0, 0)";if(-1!==A.indexOf("#"))return A="#"+(A=(A=A.replace(/#/g,"")).replace(/ /g,"")).toString();var I=A.split(" ");if(3===I.length)return"rgb(".concat(I[0],", ").concat(I[1],", ").concat(I[2],")");if(4===I.length){var g=k(I[0],I[1],I[2],I[3]);return"rgb(".concat(g.r,", ").concat(g.g,", ").concat(g.b,")")}},k=function(A,I,g,B,Q){var C=1-(A=(A/=100)*(1-(B/=100))+B),E=1-(I=(I/=100)*(1-B)+B),D=1-(g=(g/=100)*(1-B)+B);return Q||(C=Math.round(255*C),E=Math.round(255*E),D=Math.round(255*D)),{r:C,g:E,b:D}},S=function(A,I){return{x:C(A.x,I),y:C(A.y,I),w:C(A.w,I),h:C(A.h,I)}},s=function(A){for(var I=[],g=0,B=0;B<2*A.length;B+=2)I[B>>>3]|=parseInt(A[g],10)<<24-B%8*4,g++;for(var Q=[],C=0;C<A.length;C++){var E=I[C>>>2]>>>24-C%4*8&255;Q.push((E>>>4).toString(16)),Q.push((15&E).toString(16))}return Q.join("")},a=function(A){return A&&0===A.indexOf("/")&&(A=A.replace("/","")),A},Y=function(A,I){return A&&0===A.indexOf(I)&&(A=A.replace(I,"")),A},K=function(A){if("string"==typeof A)return A;for(var I="",g=A,B=0;B<g.length;B++){var Q=g[B].toString(2),C=Q.match(/^1+?(?=0)/);if(C&&8==Q.length){for(var E=C[0].length,D=g[B].toString(2).slice(7-E),i=1;i<E;i++)D+=g[i+B].toString(2).slice(2);I="".concat(I).concat(String.fromCharCode(parseInt(D,2))),B+=E-1}}return I},H=function(A,I){var g,Q=B(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}},J=function(A,I){var g,Q=B(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}},L=function(A,I){var g,Q=B(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}};function t(A){if(A.length!==A[0].length)throw new Error;var I=A.length,g=0;if(I>3)for(var B=0;B<I;B++){for(var Q=new Array(I-1).fill(0).map((function(A){return new Array(I-1).fill(0)})),C=0;C<I-1;C++)for(var E=0;E<I-1;E++)Q[C][E]=E<B?A[C+1][E]:A[C+1][E+1];g+=A[0][B]*Math.pow(-1,0+B)*t(Q)}else 3===I?g=A[0][0]*A[1][1]*A[2][2]+A[0][1]*A[1][2]*A[2][0]+A[0][2]*A[1][0]*A[2][1]-A[0][2]*A[1][1]*A[2][0]-A[0][1]*A[1][0]*A[2][2]-A[0][0]*A[1][2]*A[2][1]:2===I?g=A[0][0]*A[1][1]-A[0][1]*A[1][0]:1===I&&(g=A[0][0]);return g}function d(A){if(A[0].length!==A.length)throw new Error;for(var I=A.length,g=new Array(I).fill(0).map((function(A){return new Array(I).fill(0)})),B=0;B<I;B++)for(var Q=0;Q<I;Q++){for(var C=[],E=0;E<A.length;E++)if(E!==B){for(var D=[],i=0;i<A.length;i++)i!==Q&&D.push(A[E][i]);C.push(D)}g[B][Q]=Math.pow(-1,B+Q)*t(C)}return function(A){for(var I=new Array(A.length).fill(0).map((function(I){return new Array(A[0].length).fill(0)})),g=0;g<I.length;g++)for(var B=0;B<I[0].length;B++)I[g][B]=A[B][g];return I}(g)}function Z(A){if(A[0].length!==A.length)throw new Error;for(var I=t(A),g=d(A),B=0;B<g.length;B++)for(var Q=0;Q<g.length;Q++)g[B][Q]/=I;return g}},function(A,I,g){"use strict";g.r(I),g.d(I,"needInitAgain",(function(){return o})),g.d(I,"setYYDS",(function(){return w})),g.d(I,"freeMemory",(function(){return G})),g.d(I,"getStreamData",(function(){return F})),g.d(I,"CreateLibrary",(function(){return N})),g.d(I,"CreateNativeStream",(function(){return y})),g.d(I,"FT_Open_Face",(function(){return R})),g.d(I,"loadFaceInfo",(function(){return h})),g.d(I,"FT_Glyph_Get_Measure",(function(){return M})),g.d(I,"freeOFD",(function(){return U})),g.d(I,"readOFD",(function(){return c})),g.d(I,"readOFDByBase64",(function(){return k})),g.d(I,"hashPath",(function(){return S})),g.d(I,"MD5",(function(){return s})),g.d(I,"SHA1",(function(){return a})),g.d(I,"SM3",(function(){return Y})),g.d(I,"base64EncodeByByte",(function(){return K})),g.d(I,"base64Encode",(function(){return H})),g.d(I,"base64DecodeToUint8Array",(function(){return J})),g.d(I,"JSBase64ByHashFile",(function(){return L})),g.d(I,"JSGetImageInfoByBase64",(function(){return t})),g.d(I,"JSGetImageInfoByPath",(function(){return d})),g.d(I,"JSReadPageInfo",(function(){return Z})),g.d(I,"JSGetPathEncode",(function(){return e})),g.d(I,"JSPackageSigned",(function(){return n})),g.d(I,"JSGetToSign",(function(){return q}));var B,Q,C,E,D=g(33),i=g(34),o=function(){return!B},w=function(A){B=A},G=function(A){B._ASC_FT_Free(A.data),A.data=0},F=function(){return E},N=function(){Q=B._ASC_FT_Init()},y=function(A){var I=new Uint8Array(A),g=B._malloc(A.byteLength);return B.HEAPU8.set(I,g),{data:g,length:A.byteLength}},R=function(A){return B._ASC_FT_Open_Face(Q,A.data,A.length,0)},h=function(A){var I=B._ASC_FT_GetFaceInfo(A);if(I){var g=new D.CFaceInfo,Q=Math.min(B.HEAP8.length-I>>2,250),C=new Int32Array(B.HEAP8.buffer,I,Q),E=0;g.units_per_EM=Math.abs(C[E++]),g.ascender=C[E++],g.descender=C[E++],g.height=C[E++],g.face_flags=C[E++],g.num_faces=C[E++],g.num_glyphs=C[E++],g.num_charmaps=C[E++],g.style_flags=C[E++],g.face_index=C[E++];for(var i=C[E++];i;)g.family_name+=String.fromCharCode(i),i=C[E++];for(i=C[E++];i;)g.style_name+=String.fromCharCode(i),i=C[E++];g.os2_version=C[E++],g.os2_usWeightClass=C[E++],g.os2_fsSelection=C[E++],g.os2_usWinAscent=C[E++],g.os2_usWinDescent=C[E++],g.os2_usDefaultChar=C[E++],g.os2_sTypoAscender=C[E++],g.os2_sTypoDescender=C[E++],g.os2_sTypoLineGap=C[E++],g.os2_ulUnicodeRange1=l(C[E++]),g.os2_ulUnicodeRange2=l(C[E++]),g.os2_ulUnicodeRange3=l(C[E++]),g.os2_ulUnicodeRange4=l(C[E++]),g.os2_ulCodePageRange1=l(C[E++]),g.os2_ulCodePageRange2=l(C[E++]),g.os2_nSymbolic=C[E++],g.header_yMin=C[E++],g.header_yMax=C[E++];for(var o=C[E++],w=0;w<o;w++)g.monochromeSizes.push(C[E++]);return B._ASC_FT_Free(I),I=null,g}},M=function(A,I){if(B._AST_FT_Load_Glyph(A,I,1)>0)return" ";var g=B._ASC_FT_Get_Glyph_Measure_Params(A,1);if(!g)return null;var Q=B.HEAP32[g>>2],C=new Int32Array(B.HEAP8.buffer,g,Q),E=new i.CGlyphMetrics;E.bbox_xMin=C[1],E.bbox_yMin=C[2],E.bbox_xMax=C[3],E.bbox_yMax=C[4],E.width=C[5],E.height=C[6],E.horiAdvance=C[7],E.horiBearingX=C[8],E.horiBearingY=C[9],E.vertAdvance=C[10],E.vertBearingX=C[11],E.vertBearingY=C[12],E.linearHoriAdvance=C[13],E.linearVertAdvance=C[14],E.horiUnderlinePosition=E.horiBearingY-E.height;for(var D=15,o="";D<Q;)switch(C[D++]){case 0:o+=" M ".concat(C[D++]," ").concat(C[D++]);break;case 1:o+=" L ".concat(C[D++]," ").concat(C[D++]);break;case 2:o+=" Q ".concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]);break;case 3:o+=" C ".concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++])}return E.glyphPath=o,B._ASC_FT_Free(g),C=null,E},U=function(A){if(G(C),A.ofdParserPtr>0)B.JSFreeOFD(A.ofdParserPtr);var I=A.getFontRes(0);I&&I.forEach((function(A){A.face&&B._ASC_FT_Free(A.face)}))},c=function(A,I,g){E=A,C=y(A);var D=B.JSReadOFD(Q,C.data,C.length,I||"kgNVVbdUZ31C6mps",g?g.toLowerCase():"");if(D.data&&D.data.ofd&&(D.data.ofd.size=C.length),0!==D.code)switch(D.msg){case"10001":D.msg="授权信息错误";break;case"10002":D.msg="授权时间过期";break;case"10003":var i="非ofd文件无法打开";switch(D.file_type){case 0:break;case 9:i="PDF文件无法打开";break;default:i="图片文件无法打开"}D.msg=i}return D},k=function(A,I,g){return B.JSReadOFDByBase64(Q,A,I||"kgNVVbdUZ31C6mps",g?g.toLowerCase():"")},S=function(A,I,g){return B.JSHashPath(A,I,g)},s=function(A){return B.JSMD5(A)},a=function(A){return B.JSSHA1(A)},Y=function(A){return B.JSSM3(A)},K=function(A){var I=y(A),g=B.JSBase64EncodeByByte(I.data,I.length);return G(I),g},H=function(A){return B.JSBase64Encode(A)},J=function(A){var I=B.JSBase64Decode(A);return new Uint8Array(B.HEAPU8.buffer,I.ptr,I.len).slice(0,I.len)},L=function(A,I,g){var Q=y(A);return B.JSBase64ByHashFile(Q.data,Q.length,I,g)},t=function(A){var I=B.JSGetImageInfoByBase64(A);return"jb2"!==I.ext&&"jp2"!==I.ext&&"tif"!==I.ext&&"gif"!==I.ext&&"bmp"!==I.ext||(I.ext="png"),0===I.fileBase64.length&&(I.fileBase64=A),0!==I.fileBase64.indexOf("data:image")&&(I.fileBase64="data:image/".concat(I.ext,";base64,").concat(I.fileBase64)),I},d=function(A,I,g,Q,C){C||(C="");var E=B.JSGetImageInfoByPath(A,I,g,Q,C);return"jb2"!==E.ext&&"jp2"!==E.ext&&"tif"!==E.ext&&"gif"!==E.ext&&"bmp"!==E.ext&&"webp"!==E.ext||(E.ext="png"),0!==E.fileBase64.indexOf("data:image")&&(E.fileBase64="data:image/".concat(E.ext,";base64,").concat(E.fileBase64)),E},Z=function(A,I,g,Q,C){return B.JSReadPageInfo(A,I,g,Q,C)},e=function(A,I){var g=B.JSGetPathEncode(A,I);return new Uint8Array(B.HEAPU8.buffer,g.ptr,g.ptr_len).slice(0,g.ptr_len)},n=function(A,I){var g=B.JSPackageSigned(A,I);return g.ptr_len>0?new Uint8Array(B.HEAPU8.buffer,g.ptr,g.ptr_len).slice(0,g.ptr_len):g},q=function(A,I){return B.JSGetToSign(A,I)},l=function(A){return A<0?A+4294967296:A}},function(A,I,g){"use strict";g.r(I),g.d(I,"CFaceInfo",(function(){return D}));var B=g(1),Q=g.n(B),C=g(5),E=g.n(C),D=Q()((function A(){E()(this,A),this.units_per_EM=0,this.ascender=0,this.descender=0,this.height=0,this.face_flags=0,this.num_faces=0,this.num_glyphs=0,this.num_charmaps=0,this.style_flags=0,this.face_index=0,this.family_name="",this.style_name="",this.os2_version=0,this.os2_usWeightClass=0,this.os2_fsSelection=0,this.os2_usWinAscent=0,this.os2_usWinDescent=0,this.os2_usDefaultChar=0,this.os2_sTypoAscender=0,this.os2_sTypoDescender=0,this.os2_sTypoLineGap=0,this.os2_ulUnicodeRange1=0,this.os2_ulUnicodeRange2=0,this.os2_ulUnicodeRange3=0,this.os2_ulUnicodeRange4=0,this.os2_ulCodePageRange1=0,this.os2_ulCodePageRange2=0,this.os2_nSymbolic=0,this.header_yMin=0,this.header_yMax=0,this.monochromeSizes=[]}))},function(A,I,g){"use strict";g.r(I),g.d(I,"CGlyphMetrics",(function(){return D}));var B=g(1),Q=g.n(B),C=g(5),E=g.n(C),D=Q()((function A(){E()(this,A),this.bbox_xMin=0,this.bbox_yMin=0,this.bbox_xMax=0,this.bbox_yMax=0,this.width=0,this.height=0,this.horiAdvance=0,this.horiBearingX=0,this.horiBearingY=0,this.vertAdvance=0,this.vertBearingX=0,this.vertBearingY=0,this.linearHoriAdvance=0,this.linearVertAdvance=0,this.horiUnderlinePosition=0,this.glyphPath=null}))},function(A,I,g){"use strict";g.r(I),g.d(I,"Ofd_Core",(function(){return w}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=(g(31),g(32));function i(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return o(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return o(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function o(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var w=function(){function A(I,g,B){Q()(this,A),this.ofd=I,this.ofdParserPtr=g,this.leftTime=B}return E()(A,[{key:"getMetadata",value:function(A){return A?A>this.ofd.DocBody.length&&(A=this.ofd.DocBody.length-1):A=0,{Title:this.ofd.DocBody[A].DocInfo.Title,Author:this.ofd.DocBody[A].DocInfo.Author,Subject:this.ofd.DocBody[A].DocInfo.Subject,Creator:this.ofd.DocBody[A].DocInfo.Creator,CreationDate:this.ofd.DocBody[A].DocInfo.CreationDate,CreatorVersion:this.ofd.DocBody[A].DocInfo.CreatorVersion,ModificationDate:this.ofd.DocBody[A].DocInfo.ModDate,Keywords:this.ofd.DocBody[A].DocInfo.Keywords,numPages:this.getOFDPageCount(A),pageSize:"".concat(this.pageWidth(A,0),"毫米 X ").concat(this.pageHeight(A,0),"毫米")}}},{key:"readOfdDocBody",value:function(A){return this.ofd?(A?A>this.ofd.DocBody.length&&(A=this.ofd.DocBody.length-1):A=0,this.ofd.DocBody[A]):null}},{key:"readOfdDocument",value:function(A){return this.ofd?(A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0,this.ofd.Document[A]):null}},{key:"readOfdPage",value:function(A,I){if(!this.ofd)return null;A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0;var g=this.ofd.Document[A],B=g.Pages[I];if(B.Page.onlyReadArea){var Q=Object(D.JSReadPageInfo)(this.ofdParserPtr,B.BasePln,B.BaseAbs,B.pln,B.abs);g.Pages[I].Page=Q.Page}return g.Pages[I]}},{key:"readOfdTemplatePage",value:function(A){return this.ofd?(A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0,this.ofd.Document[A].CommonData.TemplatePage):null}},{key:"readPageFromTemplate",value:function(A){if(A.Page.onlyReadArea){var I=Object(D.JSReadPageInfo)(this.ofdParserPtr,A.BasePln,A.BaseAbs,"","");A.Page=I.Page}return A}},{key:"getOFDPageCount",value:function(A){var I=this.readOfdDocument(A);return I?I.Pages.length:0}},{key:"pageWidth",value:function(A,I){var g=this.readOfdDocument(A);if(!g)return 0;var B=g.Pages[I];return this.calPageBox(g,B).w}},{key:"pageHeight",value:function(A,I){var g=this.readOfdDocument(A);if(!g)return 0;var B=g.Pages[I];return this.calPageBox(g,B).h}},{key:"calPageBox",value:function(A,I){var g,B=I.Page.Area;if(B&&Object.keys(B).length>0){var Q=B.PhysicalBox;if(Q)g=Q;else{var C=B.ApplicationBox;if(C)g=C;else{var E=B.ContentBox;E&&(g=E)}}}else{var D=A.CommonData.PageArea,i=D.PhysicalBox;if(i)g=i;else{var o=D.ApplicationBox;if(o)g=o;else{var w=D.ContentBox;w&&(g=w)}}}return g}},{key:"getSignatureCount",value:function(A){var I=this.readOfdDocument(A);return I&&I.Signatures&&I.Signatures.Signature?I.Signatures.Signature.length:0}},{key:"getAllSignature",value:function(A){var I=this.readOfdDocument(A);return I&&I.Signatures?I.Signatures.Signature:0}},{key:"getSignatureByIndex",value:function(A,I){var g=this.readOfdDocument(A);return g?g.Signatures.Signature[I]:null}},{key:"findSignature",value:function(A,I,g){var B=null,Q=this.readOfdDocument(A);if(Q)for(var C=0;C<Q.Signatures.Signature.length;C++){var E,D=i(Q.Signatures.Signature);try{for(D.s();!(E=D.n()).done;){var o,w=E.value,G=i(w.Signature.SignedInfo.StampAnnot);try{for(G.s();!(o=G.n()).done;){var F=o.value;if(F.ID==g&&F.PageRef==I){B=w.Signature;break}}}catch(A){G.e(A)}finally{G.f()}}}catch(A){D.e(A)}finally{D.f()}}return B}},{key:"getFontRes",value:function(A){var I,g=this.readOfdDocument(A);if(g)return null==g||null===(I=g.CommonData)||void 0===I||null===(I=I.Res)||void 0===I?void 0:I.Fonts}},{key:"getDocPln",value:function(A){var I=this.readOfdDocBody(A);if(I)return null==I?void 0:I.DocPln}},{key:"getAttachmentCount",value:function(A){var I=this.readOfdDocument(A);return I&&I.Attachments?I.Attachments.length:0}},{key:"getCustomTag",value:function(A){var I=this.readOfdDocument(A);return I&&I.CustomTags?I.CustomTags:null}},{key:"getPageIndexByPageId",value:function(A,I){if(!this.ofd)return 0;A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0;for(var g=this.ofd.Document[A],B=0;B<g.Pages.length;B++){if(g.Pages[B].ID==I)return B}}},{key:"getAllAttachment",value:function(A){var I=this.readOfdDocument(A);return I&&I.Attachments?I.Attachments:[]}},{key:"getAttachmentByIndex",value:function(A,I){var g=this.readOfdDocument(A);return g?g.Attachments[I]:null}},{key:"getAttachmentByID",value:function(A,I){var g=this.readOfdDocument(A);if(g){var B,Q=i(g.Attachments);try{for(Q.s();!(B=Q.n()).done;){var C=B.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}}return null}},{key:"getTextObject",value:function(A,I){var g=[],B=this.readOfdPage(A,I);if(B){var Q,C=i(B.Page.Content.Layer);try{for(C.s();!(Q=C.n()).done;){var E,D=i(Q.value.PageBlock);try{for(D.s();!(E=D.n()).done;){var o=E.value;if("TextObject"==o.Type){var w,G="",F=i(o.TextCode);try{for(F.s();!(w=F.n()).done;){var N=w.value;G="".concat(G).concat(N.text)}}catch(A){F.e(A)}finally{F.f()}if(G.length>0){var y={id:o.ID,pageId:B.ID};y.text=G,g.push(y)}}}}catch(A){D.e(A)}finally{D.f()}}}catch(A){C.e(A)}finally{C.f()}}return g}},{key:"getAllTextObject",value:function(A){for(var I=[],g=this.readOfdDocument(A),B=0;B<g.Pages.length;B++){var Q=g.Pages[B];if(Q.Page.onlyReadArea){var C=Object(D.JSReadPageInfo)(this.ofdParserPtr,Q.BasePln,Q.BaseAbs,Q.pln,Q.abs);Q.Page=C.Page}if(Q){var E,o=i(Q.Page.Content.Layer);try{for(o.s();!(E=o.n()).done;){var w,G=i(E.value.PageBlock);try{for(G.s();!(w=G.n()).done;){var F=w.value;if("TextObject"==F.Type){var N,y="",R=i(F.TextCode);try{for(R.s();!(N=R.n()).done;){var h=N.value;y="".concat(y).concat(h.text)}}catch(A){R.e(A)}finally{R.f()}if(y.length>0){var M={id:F.ID,pageId:Q.ID,pageIndex:B+1};M.text=y,I.push(M)}}}}catch(A){G.e(A)}finally{G.f()}}}catch(A){o.e(A)}finally{o.f()}}}return I}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"Ofd_Core_Helper",(function(){return i}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=g(31),i=function(){function A(){var I=arguments.length>0&&void 0!==arguments[0]?arguments[0]:96,g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Q()(this,A),this.dpi=I,this.waterText=g}return E()(A,[{key:"setWaterText",value:function(A){this.waterText=A}},{key:"setWaterSetting",value:function(A){this.waterSetting=A}},{key:"setDpi",value:function(A){this.dpi=A}},{key:"pageRenderWidth",value:function(A,I,g){var B=g.pageWidth(A,I);return B=Object(D.converterDpi)(B,this.dpi)}},{key:"pageRenderHeight",value:function(A,I,g){var B=g.pageHeight(A,I);return B=Object(D.converterDpi)(B,this.dpi)}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdCanvasRender",(function(){return M}));var B=g(7),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(8),w=g.n(o),G=g(31),F=g(32),N=g(35),y=g(30);function R(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return h(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return h(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function h(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var M=function(){function A(I,g){E()(this,A),this.core=I,this.coreHelper=g,this.render=new y.Ofd_Render(this.core,this.coreHelper)}var I,g,B,C,D,o,h,M,U,c;return i()(A,[{key:"setOfdCore",value:function(A){this.core=A,this.render.setOfdCore(this.core)}},{key:"renderPageByCanvas",value:(c=Q()(w.a.mark((function A(I,g,B,Q,C){var E,D,i,o,y,h,M,U,c,k,S,s,a,Y,K,H,J,L,t,d,Z,e,n,q,l,W,r,x,f,V,b,p,m,T,X,j,O,u,z,P;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(E=C?C.readOfdDocument(B):this.core.readOfdDocument(B),D=C?C.readOfdPage(B,Q):this.core.readOfdPage(B,Q),i=D.Page.Template,E.Annotations,o=C?C.readOfdTemplatePage(B):this.core.readOfdTemplatePage(B),y=E.Signatures?E.Signatures.Signature:[],h=E.CommonData.Res.Fonts,M=E.CommonData.Res.DrawParams,E.CommonData.Res.ColorSpaces,U=E.CommonData.Res.CompositeGraphicUnits,c=E.CommonData.Res.MultiMedias,!i){A.next=64;break}k=R(i),A.prev=13,k.s();case 15:if((S=k.n()).done){A.next=56;break}s=S.value,a=R(o),A.prev=18,a.s();case 20:if((Y=a.n()).done){A.next=46;break}if((K=Y.value).ID!=s.TemplateID){A.next=44;break}if(!(K=C?C.readPageFromTemplate(K):this.core.readPageFromTemplate(K)).Page.Content){A.next=43;break}H=K.Page.Content.Layer,J=R(H),A.prev=27,J.s();case 29:if((L=J.n()).done){A.next=35;break}return t=L.value,A.next=33,this.renderLayerByCanvas(I,g,h,M,c,U,t,!1);case 33:A.next=29;break;case 35:A.next=40;break;case 37:A.prev=37,A.t0=A.catch(27),J.e(A.t0);case 40:return A.prev=40,J.f(),A.finish(40);case 43:return A.abrupt("break",46);case 44:A.next=20;break;case 46:A.next=51;break;case 48:A.prev=48,A.t1=A.catch(18),a.e(A.t1);case 51:return A.prev=51,a.f(),A.finish(51);case 54:A.next=15;break;case 56:A.next=61;break;case 58:A.prev=58,A.t2=A.catch(13),k.e(A.t2);case 61:return A.prev=61,k.f(),A.finish(61);case 64:if(!D.Page.Content){A.next=83;break}d=D.Page.Content.Layer,Z=R(d),A.prev=67,Z.s();case 69:if((e=Z.n()).done){A.next=75;break}return n=e.value,A.next=73,this.renderLayerByCanvas(I,g,h,M,c,U,n,!1);case 73:A.next=69;break;case 75:A.next=80;break;case 77:A.prev=77,A.t3=A.catch(67),Z.e(A.t3);case 80:return A.prev=80,Z.f(),A.finish(80);case 83:q=R(y),A.prev=84,q.s();case 86:if((l=q.n()).done){A.next=134;break}W=l.value,r=R(W.Signature.SignedInfo.StampAnnot),A.prev=89,r.s();case 91:if((x=r.n()).done){A.next=124;break}if(f=x.value,V=f.PageRef,D.ID!=V){A.next=122;break}if(b=f.Boundary,!(W.Signature.PicType&&W.Signature.PicType.length>0)){A.next=122;break}if("ofd"!==W.Signature.PicType){A.next=108;break}p=new N.Ofd_Core(W.Signature.ofd,this.coreHelper.dpi),m=0;case 100:if(!(m<p.getOFDPageCount(0))){A.next=106;break}return A.next=103,this.renderSealPageOnCanvas(I,g,m,p,!0,b,V,f.ID);case 103:m++,A.next=100;break;case 106:A.next=122;break;case 108:if("svg"!==W.Signature.PicType){A.next=114;break}return T="data:image/svg+xml;base64,".concat(W.Signature.PicValue),A.next=112,this.renderSealSvgOnCanvas(I,g,T,b);case 112:A.next=122;break;case 114:return X=b.w,j=b.h,O=Object(G.converterBox)(b,this.coreHelper.dpi),u=Object(F.JSGetImageInfoByBase64)(W.Signature.PicValue),z=u.fileBase64,P={a:X,b:0,c:0,d:j,e:0,f:0},A.next=122,this.renderImageOnCanvas(I,g,z,u.width,u.height,O,f.Clip,!0,V,f.ID,P);case 122:A.next=91;break;case 124:A.next=129;break;case 126:A.prev=126,A.t4=A.catch(89),r.e(A.t4);case 129:return A.prev=129,r.f(),A.finish(129);case 132:A.next=86;break;case 134:A.next=139;break;case 136:A.prev=136,A.t5=A.catch(84),q.e(A.t5);case 139:return A.prev=139,q.f(),A.finish(139);case 142:case"end":return A.stop()}}),A,this,[[13,58,61,64],[18,48,51,54],[27,37,40,43],[67,77,80,83],[84,136,139,142],[89,126,129,132]])}))),function(A,I,g,B,Q){return c.apply(this,arguments)})},{key:"renderAnnotationOnCanvas",value:(U=Q()(w.a.mark((function A(I,g,B,Q,C,E,D){var i,o,F,N,y;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(i=B.Appearance,!(o=B.Appearance.Boundary)){A.next=15;break}if(0!==o.w&&0!==o.h){A.next=5;break}return A.abrupt("return");case 5:return F=Object(G.converterBox)(o,this.coreHelper.dpi),(N=document.createElement("canvas")).style.height="".concat(F.w,"px"),N.style.width="".concat(F.h,"px"),N.width=F.w,N.height=F.h,y=N.getContext("2d"),A.next=14,this.renderLayerByCanvas(N,y,Q,C,E,D,i,!1);case 14:g.drawImage(N,F.x,F.y);case 15:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C,E){return U.apply(this,arguments)})},{key:"renderSealSvgOnCanvas",value:(M=Q()(w.a.mark((function A(I,g,B,Q,C,E){var D;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return D=Object(G.converterBox)(Q,this.coreHelper.dpi),A.abrupt("return",new Promise((function(A,I){var Q=new Image;Q.src=B,Q.onload=function(){var I=Q.width,B=Q.height,C=document.createElement("canvas");if(C.style.height="".concat(I,"px"),C.style.width="".concat(B,"px"),C.width=I,C.height=B,C.getContext("2d").drawImage(Q,0,0),I!==D.w){var E=D.h/B<D.w/I?D.h/B:D.w/I,i=document.createElement("canvas");i.style.height="".concat(D.w,"px"),i.style.width="".concat(D.h,"px"),i.width=D.w,i.height=D.h;var o=i.getContext("2d");o.scale(E,E),o.drawImage(C,0,0),g.drawImage(i,D.x,D.y)}else g.drawImage(C,D.x,D.y);A()}})));case 2:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C){return M.apply(this,arguments)})},{key:"renderSealPageOnCanvas",value:(h=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i){var o,F,N,y,R,h,M,U,c,k;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return o={x:0,y:0,w:0,h:0},o=E,F={x:E.x,y:E.y,w:Q.pageWidth(0,B),h:Q.pageHeight(0,B)},N=Object(G.converterBox)(F,this.coreHelper.dpi),y=1,(R=document.createElement("canvas")).style.height="".concat(N.w,"px"),R.style.width="".concat(N.h,"px"),R.width=N.w,R.height=N.h,h=R.getContext("2d"),A.next=13,this.renderPageByCanvas(R,h,0,B,Q);case 13:h.scale(y,y),F.w!==o.w?(M=o.h/F.h<o.w/F.w?o.h/F.h:o.w/F.w,U=document.createElement("canvas"),c=Object(G.converterBox)(o,this.coreHelper.dpi),U.style.height="".concat(c.w,"px"),U.style.width="".concat(c.h,"px"),U.width=c.w,U.height=c.h,(k=U.getContext("2d")).scale(M,M),k.drawImage(R,0,0),g.drawImage(U,N.x,N.y)):g.drawImage(R,N.x,N.y);case 15:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C,E,D){return h.apply(this,arguments)})},{key:"renderLayerByCanvas",value:(o=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,F,N){var y,h,M,U,c,k,S,s,a,Y,K,H,J,L,t;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(y=null,h=null,M=Object(G.converterDpi)(.353,this.coreHelper.dpi),(U=D.DrawParam)&&Object(G.getDrawParam)(Q,U)&&(c=Object(G.getDrawParam)(Q,U),Object(G.getDrawParam)(Q,c.Relative)&&(c=Object(G.getDrawParam)(Q,c.Relative)),c.FillColor&&(y=Object(G.parseColor)(c.FillColor.Value)),c.StrokeColor&&(y=Object(G.parseColor)(c.StrokeColor.Value)),c.LineWidth&&(M=Object(G.converterDpi)(c.LineWidth,this.coreHelper.dpi))),!(k=D.PageBlock)){A.next=60;break}S=R(k),A.prev=8,S.s();case 10:if((s=S.n()).done){A.next=52;break}if("ImageObject"!=(a=s.value).Type){A.next=17;break}return A.next=15,this.renderImageObject(I,g,C,a,i,F,N);case 15:A.next=50;break;case 17:if("PathObject"!=a.Type){A.next=22;break}return A.next=20,this.renderPathObject(I,g,Q,a,y,h,M,i,o,F,N,C,B);case 20:A.next=50;break;case 22:if("TextObject"!=a.Type){A.next=27;break}return A.next=25,this.renderTextObject(I,g,B,a,y,h,Q,o,F,N);case 25:A.next=50;break;case 27:if("CompositeObject"!=a.Type){A.next=50;break}Y=R(E),A.prev=29,Y.s();case 31:if((K=Y.n()).done){A.next=42;break}if((H=K.value).ID!==a.ResourceID){A.next=40;break}return J=a.Alpha,L=a.Boundary,t=a.CTM,A.next=39,this.renderLayerByCanvas(I,g,B,Q,C,E,H,!1,J,L,t);case 39:return A.abrupt("break",42);case 40:A.next=31;break;case 42:A.next=47;break;case 44:A.prev=44,A.t0=A.catch(29),Y.e(A.t0);case 47:return A.prev=47,Y.f(),A.finish(47);case 50:A.next=10;break;case 52:A.next=57;break;case 54:A.prev=54,A.t1=A.catch(8),S.e(A.t1);case 57:return A.prev=57,S.f(),A.finish(57);case 60:case"end":return A.stop()}}),A,this,[[8,54,57,60],[29,44,47,50]])}))),function(A,I,g,B,Q,C,E,D,i,w,G){return o.apply(this,arguments)})},{key:"renderImageObject",value:(D=Q()(w.a.mark((function A(I,g,B,Q,C,E,D){var i,o,N,y,R,h;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(i=Q.Boundary,i=Object(G.converterBox)(i,this.coreHelper.dpi),o=Q.ResourceID){A.next=5;break}return A.abrupt("return");case 5:return(N=Object(G.getMultiMedia)(B,o)).width>0||N.height>0||(y=Object(F.JSGetImageInfoByBase64)(N.FileBase64),N.width=y.width,N.height=y.height,N.FileBase64=y.fileBase64),R=Q.CTM,h=Q.Clips,A.next=11,this.renderImageOnCanvas(I,g,N.FileBase64,N.width,N.height,i,!1,C,null,null,R,E,D,h);case 11:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C,E){return D.apply(this,arguments)})},{key:"renderImageOnCanvas",value:(C=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,F,N,y,h,M){var U=this;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(!i){A.next=4;break}return A.next=3,this.render.throwWhite(B);case 3:B=A.sent;case 4:return A.abrupt("return",new Promise((function(A,I){var D=E.x,i=E.y,o=new Image;o.src=B,o.width=Q,o.height=C;var w=U;o.onload=function(){if(y){var I=document.createElement("canvas");I.width=E.w,I.height=E.h,I.style.width="".concat(E.w,"px"),I.style.height="".concat(E.h,"px");var B=I.getContext("2d");N&&B.transform(N.a/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.b/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.c/C/Object(G.ctmImageScale)(w.coreHelper.dpi),N.d/C/Object(G.ctmImageScale)(w.coreHelper.dpi),Object(G.converterDpi)(N.e,w.coreHelper.dpi),Object(G.converterDpi)(N.f,w.coreHelper.dpi)),B.drawImage(o,0,0);var F=document.createElement("canvas"),U=Object(G.converterBox)(y,w.coreHelper.dpi),c=U.w,k=U.h,S=U.x,s=U.y;F.width=c,F.height=k,F.style.width="".concat(c,"px"),F.style.height="".concat(k,"px");var a=F.getContext("2d");h&&a.transform(h.a,h.b,h.c,h.d,Object(G.converterDpi)(h.e,w.coreHelper.dpi),Object(G.converterDpi)(h.f,w.coreHelper.dpi)),a.drawImage(I,D,i),g.drawImage(F,S,s)}else{var Y=document.createElement("canvas");Y.width=Math.ceil(E.w),Y.height=Math.ceil(E.h),Y.style.width="".concat(Math.ceil(E.w),"px"),Y.style.height="".concat(Math.ceil(E.h),"px");var K=Y.getContext("2d");if(M&&M.length>0)for(var H=0;H<M.length;H++)for(var J=M[H].Clip,L=0;L<J.length;L++){var t=J[L].Area,d=void 0;t.CTM?d=t.CTM:N&&(d=N),K.beginPath();var Z,e=R(t.Path.AbbreviatedData);try{for(e.s();!(Z=e.n()).done;){var n=Z.value;if("M"===n.cmd||"S"===n.cmd){var q=n.crds[0],l=n.crds[1];if(d){var W=w.ctmCalPoint(q,l,d);q=W.ctmX,l=W.ctmY}K.moveTo(Object(G.converterDpi)(q,w.coreHelper.dpi),Object(G.converterDpi)(l,w.coreHelper.dpi))}else if("L"===n.cmd){var r=n.crds[0],x=n.crds[1];if(d){var f=w.ctmCalPoint(r,x,d);r=f.ctmX,x=f.ctmY}K.lineTo(Object(G.converterDpi)(r,w.coreHelper.dpi),Object(G.converterDpi)(x,w.coreHelper.dpi))}else if("B"===n.cmd){var V=n.crds[0],b=n.crds[1],p=n.crds[2],m=n.crds[3],T=n.crds[4],X=n.crds[5];if(d){var j=w.ctmCalPoint(V,b,d);V=j.ctmX,b=j.ctmY;var O=w.ctmCalPoint(p,m,d);p=O.ctmX,m=O.ctmY;var u=w.ctmCalPoint(T,X,d);T=u.ctmX,X=u.ctmY}K.bezierCurveTo(Object(G.converterDpi)(V,w.coreHelper.dpi),Object(G.converterDpi)(b,w.coreHelper.dpi),Object(G.converterDpi)(p,w.coreHelper.dpi),Object(G.converterDpi)(m,w.coreHelper.dpi),Object(G.converterDpi)(T,w.coreHelper.dpi),Object(G.converterDpi)(X,w.coreHelper.dpi))}else if("Q"===n.cmd){var z=n.crds[0],P=n.crds[1],v=n.crds[2],_=n.crds[3];if(d){var $=w.ctmCalPoint(z,P,d);z=$.ctmX,P=$.ctmY;var AA=w.ctmCalPoint(v,_,d);v=AA.ctmX,_=AA.ctmY}K.quadraticCurveTo(Object(G.converterDpi)(z,w.coreHelper.dpi),Object(G.converterDpi)(P,w.coreHelper.dpi),Object(G.converterDpi)(v,w.coreHelper.dpi),Object(G.converterDpi)(_,w.coreHelper.dpi))}else"A"===n.cmd||"C"===n.cmd&&K.closePath()}}catch(A){e.e(A)}finally{e.f()}K.clip()}N&&K.transform(N.a/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.b/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.c/C/Object(G.ctmImageScale)(w.coreHelper.dpi),N.d/C/Object(G.ctmImageScale)(w.coreHelper.dpi),Object(G.converterDpi)(N.e,w.coreHelper.dpi),Object(G.converterDpi)(N.f,w.coreHelper.dpi)),K.drawImage(o,0,0),g.drawImage(Y,D,i)}A()}})));case 5:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,E,D,i,o,w,G,F,N,y){return C.apply(this,arguments)})},{key:"ctmCalPoint",value:function(A,I,g){return{ctmX:A*g.a+I*g.c+1*g.e,ctmY:A*g.b+I*g.d+1*g.f}}},{key:"renderPathObject",value:(B=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,F,N,y,h){var M,U,c,k,S,s,a,Y,K,H,J,L,t,d,Z,e,n,q,l,W,r,x,f,V,b,p,m,T,X,j,O,u,z,P,v,_,$,AA,IA,gA,BA,QA,CA,EA,DA,iA,oA;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(M=Q.Boundary){A.next=3;break}return A.abrupt("return");case 3:if(U=1,M=Object(G.converterBox)(M,this.coreHelper.dpi),c=Math.ceil(M.w),k=Math.ceil(M.h),S=M.x,s=M.y,c-0!=0&&k-0!=0){A.next=11;break}return A.abrupt("return");case 11:if(a=document.createElement("canvas"),Y=a.getContext("2d"),a.width=c*U,a.height=k*U,a.style.width="".concat(c,"px"),a.style.height="".concat(k,"px"),K=Q.LineWidth,H=Q.AbbreviatedData,J=Q.CTM,L=Q.StrokeColor,t=Q.FillColor,K&&(D=Object(G.converterDpi)(K,this.coreHelper.dpi)),(d=Q.DrawParam)&&(Z=Object(G.getDrawParam)(B,d),(K=Z.LineWidth)&&(D=Object(G.converterDpi)(K,this.coreHelper.dpi)),Z.FillColor&&(t&&t.Value||(t=Z.FillColor)),Z.StrokeColor&&(L&&L.Value||(L=Z.StrokeColor))),J&&Y.transform(J.a,J.b,J.c,J.d,Object(G.converterDpi)(J.e,this.coreHelper.dpi),Object(G.converterDpi)(J.f,this.coreHelper.dpi)),e=!1,L&&(L.Value&&(E=Object(G.parseColor)(L.Value)),n=L.axialShd)){e=!0,q=Object(G.parseCtm)(n.StartPoint),l=Object(G.parseCtm)(n.EndPoint),W=Y.createLinearGradient(q[0],q[1],l[0],l[1]),r=R(n.Segment);try{for(r.s();!(x=r.n()).done;)(f=x.value)&&W.addColorStop(f.position,Object(G.parseColor)(f.color.Value))}catch(A){r.e(A)}finally{r.f()}Y.lineWidth=D,Y.strokeStyle=W}if(V=!1,t&&(t.Value&&(C=Object(G.parseColor)(t.Value)),t.Alpha&&0===t.Alpha&&(Y.globalAlpha=0),b=t.AxialShd)){V=!0,p=Object(G.parseCtm)(b.StartPoint),m=Object(G.parseCtm)(b.EndPoint),T=Y.createLinearGradient(p[0],p[1],m[0],m[1]),X=R(b.Segment);try{for(X.s();!(j=X.n()).done;)(O=j.value)&&T.addColorStop(O.position,Object(G.parseColor)(O.color.Value))}catch(A){X.e(A)}finally{X.f()}Y.fillStyle=T}D>0&&!E&&((E=C)||(E="rgb(0, 0, 0)")),Q.Join&&Y.setLineJoin(Q["@_Join"]),Q.Cap&&Y.setLineCap(Q["@_Cap"]),Q.DashPattern&&(u=Q.DashPattern,z=Object(G.parseCtm)(u),Q.DashOffset&&Q.DashOffset,Y.setLineDash([Object(G.converterDpi)(z[0],this.coreHelper.dpi),Object(G.converterDpi)(z[1],this.coreHelper.dpi)])),Y.beginPath(),P=R(H);try{for(P.s();!(v=P.n()).done;)"M"===(_=v.value).cmd||"S"===_.cmd?Y.moveTo(Object(G.converterDpi)(_.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[1],this.coreHelper.dpi)):"L"===_.cmd?Y.lineTo(Object(G.converterDpi)(_.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[1],this.coreHelper.dpi)):"B"===_.cmd?Y.bezierCurveTo(Object(G.converterDpi)(_.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[1],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[2],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[3],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[4],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[5],this.coreHelper.dpi)):"Q"===_.cmd?Y.quadraticCurveTo(Object(G.converterDpi)(_.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[1],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[2],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[3],this.coreHelper.dpi)):"A"===_.cmd||"C"===_.cmd&&Y.closePath()}catch(A){P.e(A)}finally{P.f()}if(Q.Stroke&&(e||(Y.strokeStyle=E,Y.lineWidth=D),Y.stroke()),$=t.pattern,!Q.Fill||$?Y.fillStyle="none":(V||(Y.fillStyle=C),Y.fill(Q.Rule)),!$){A.next=52;break}return Y.save(),AA=document.createElement("canvas"),IA=AA.getContext("2d"),AA.width=Object(G.converterDpi)($.width,this.coreHelper.dpi),AA.height=Object(G.converterDpi)($.height,this.coreHelper.dpi),A.next=48,this.renderLayerByCanvas(AA,IA,h,B,y,null,$,!1,null,null,null);case 48:gA=Y.createPattern(AA,"repeat"),Y.fillStyle=gA,Y.fillRect(0,0,c,k),Y.restore();case 52:F?(BA=document.createElement("canvas"),QA=Object(G.converterBox)(F,this.coreHelper.dpi),CA=QA.w,EA=QA.h,DA=QA.x,iA=QA.y,BA.width=CA*U,BA.height=EA*U,BA.style.width="".concat(CA,"px"),BA.style.height="".concat(EA,"px"),oA=BA.getContext("2d"),N&&oA.transform(N.a,N.b,N.c,N.d,Object(G.converterDpi)(N.e,this.coreHelper.dpi),Object(G.converterDpi)(N.f,this.coreHelper.dpi)),o&&(oA.globalAlpha=o/255),oA.drawImage(a,S,s),g.drawImage(BA,DA,iA)):g.drawImage(a,S,s);case 53:case"end":return A.stop()}}),A,this)}))),function(A,I,g,Q,C,E,D,i,o,w,G,F,N){return B.apply(this,arguments)})},{key:"renderTextObject",value:(g=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,N){var y,h,M,U,c,k,S,s,a,Y,K,H,J,L,t,d,Z,e,n,q,l,W,r,x,f,V,b,p,m,T,X,j,O,u,z,P,v,_,$,AA,IA,gA,BA,QA,CA,EA,DA,iA,oA,wA,GA,FA,NA;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(y=1,h=Q.Boundary,h=Object(G.converterBox)(h,this.coreHelper.dpi),M=Q.CTM,U=Q.HScale,c=Q.Font,k=Q.Weight,S=Q.Size>0,M&&!S&&(M={a:-M.a,b:M.b,c:M.c,d:-M.d,e:-M.e,f:-M.f}),s=Object(G.converterDpi)(Math.abs(parseFloat(Q.Size)),this.coreHelper.dpi),a=Object(G.calTextPoint)(this.coreHelper.dpi,Q.TextCode,Q.CGTransform,M,Q.Boundary,o,N,S),(Y=document.createElementNS("http://www.w3.org/2000/svg","svg")).setAttribute("xmlns","http://www.w3.org/2000/svg"),Y.setAttribute("version","1.1"),K=Q.FillColor,H=!1,(J=Q.DrawParam)&&(L=Object(G.getDrawParam)(D,J)).FillColor&&(K&&K.Value||(K=L.FillColor)),K&&(K.Value&&(C=Object(G.parseColor)(K.Value)),t=K.alpha,y=t/255,d=K.axialShd)){H=!0,(Z=document.createElementNS("http://www.w3.org/2000/svg","linearGradient")).setAttribute("id","".concat(Q.ID)),Z.setAttribute("x1","0%"),Z.setAttribute("y1","0%"),Z.setAttribute("x2","100%"),Z.setAttribute("y2","100%"),e=R(d.Segment);try{for(e.s();!(n=e.n()).done;)(q=n.value)&&((l=document.createElement("stop")).setAttribute("offset","".concat(100*q.position,"%")),l.setAttribute("style","stop-color:".concat(Object(G.parseColor)(q.color.Value),";stop-opacity:1")),Z.appendChild(l),C=Object(G.parseColor)(q.color.Value))}catch(A){e.e(A)}finally{e.f()}Y.appendChild(Z)}Q.Fill||(y=0),W=h.w,r=h.h,x=h.x,f=h.y,V=s,b=s,p=0,M&&(m=M.a,T=M.b,X=M.c,j=M.d,O=m>0?Math.sign(m)*Math.sqrt(m*m+X*X):Math.sqrt(m*m+X*X),u=j>0?Math.sign(j)*Math.sqrt(T*T+j*j):Math.sqrt(T*T+j*j),0==(p=Math.atan2(-T,j))&&0!=m&&1==j||(V*=O,b*=u),0==p&&U-0==1&&(U=m/j)>0&&(V*=U)),N&&(z=N.a,P=N.b,v=N.c,_=N.d,$=z>0?Math.sign(z)*Math.sqrt(z*z+v*v):Math.sqrt(z*z+v*v),AA=_>0?Math.sign(_)*Math.sqrt(P*P+_*_):Math.sqrt(P*P+_*_),0==(p=Math.atan2(-P,_))&&0!=z&&1==_||(V*=$,b*=AA,f*=AA,x*=$,W*=$,r*=AA)),IA=Object(G.getFont)(B,c),gA=R(a),A.prev=31,gA.s();case 33:if((BA=gA.n()).done){A.next=73;break}if(!(QA=BA.value)||isNaN(QA.x)){A.next=71;break}if(!QA.glyph){A.next=59;break}if(!IA||!IA.face){A.next=57;break}if(CA=Object(F.loadFaceInfo)(IA.face),EA=Object(F.FT_Glyph_Get_Measure)(IA.face,QA.glyph),(DA=this.render.drawGlyph(EA.glyphPath,EA.horiUnderlinePosition,CA.units_per_EM,V,b,E||C,y)).img.setAttribute("style","width: ".concat(Math.ceil(V),"px; height:").concat(Math.ceil(b),"px")),iA="data:image/svg+xml;base64,".concat(Object(F.base64Encode)(DA.img.outerHTML)),0!==p){A.next=48;break}return A.next=46,this.drawTextFromSvg(I,g,iA,Math.ceil(QA.cx),QA.cy-DA.yScale*EA.horiUnderlinePosition-b);case 46:A.next=57;break;case 48:return(oA=document.createElement("canvas")).style.width="".concat(Math.ceil(V),"px"),oA.style.height="".concat(Math.ceil(b),"px"),oA.width=Math.ceil(V),oA.height=Math.ceil(b),wA=oA.getContext("2d"),A.next=56,this.drawTextFromSvg(oA,wA,iA,0,0,p,Math.ceil(V)/2,Math.ceil(b)/2);case 56:g.drawImage(oA,Math.ceil(QA.cx),QA.cy-DA.yScale*EA.horiUnderlinePosition-b);case 57:A.next=71;break;case 59:(GA=document.createElementNS("http://www.w3.org/2000/svg","text")).setAttribute("x",QA.x),GA.setAttribute("y",QA.y),GA.innerHTML=QA.text,FA="",M&&(FA="matrix(".concat(M.a," ").concat(M.b," ").concat(M.c," ").concat(M.d," ").concat(Object(G.converterDpi)(M.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(M.f,this.coreHelper.dpi),")")),N&&(FA="".concat(FA," matrix(").concat(N.a," ").concat(N.b," ").concat(N.c," ").concat(N.d," ").concat(Object(G.converterDpi)(N.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(N.f,this.coreHelper.dpi),")")),U&&(FA="".concat(FA," matrix(").concat(U,", 0, 0, 1, ").concat((1-U)*QA.x,", 0)")),GA.setAttribute("transform",FA),H?GA.setAttribute("fill",C):(GA.setAttribute("fill",E),GA.setAttribute("fill",C),GA.setAttribute("fill-opacity",y)),GA.setAttribute("style","font-weight: ".concat(k,";font-size:").concat(s,"px;font-family: ").concat(Object(G.getFontFamily)(IA),";")),Y.appendChild(GA);case 71:A.next=33;break;case 73:A.next=78;break;case 75:A.prev=75,A.t0=A.catch(31),gA.e(A.t0);case 78:return A.prev=78,gA.f(),A.finish(78);case 81:return Y.setAttribute("style","overflow:visible;width:".concat(W,"px;height:").concat(r,"px")),NA="data:image/svg+xml;base64,".concat(Object(F.base64Encode)(Y.outerHTML)),A.next=85,this.drawTextFromSvg(I,g,NA,x,f);case 85:case"end":return A.stop()}}),A,this,[[31,75,78,81]])}))),function(A,I,B,Q,C,E,D,i,o,w){return g.apply(this,arguments)})},{key:"drawTextFromSvg",value:(I=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",new Promise((function(A,I){var o=new Image;o.src=B,o.onload=function(){0!=E&&D&&i&&(g.translate(D,i),g.rotate(-E),g.translate(-D,-i)),g.drawImage(o,Q,C),A()}})));case 1:case"end":return A.stop()}}),A)}))),function(A,g,B,Q,C,E,D,i){return I.apply(this,arguments)})}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdThumbnailViewer",(function(){return y}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=g(22),i=g(29),o=g(37),w=g(36);function G(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return F(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return F(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function F(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var N="selected",y=function(){function A(I,g){Q()(this,A),this.core=null,this.coreHelper=new w.Ofd_Core_Helper(96),this.ofdCanvasRender=new o.OfdCanvasRender(null,this.coreHelper),this.eventBus=g,this.container=I,this.pageDIV=[],this.currentPage=1,this.container&&(this.scroll=Object(D.watchScroll)(this.container,this._scrollUpdate.bind(this)))}return E()(A,[{key:"emptyNode",value:function(A){if(A)for(;A.firstChild;)A.removeChild(A.firstChild)}},{key:"freeThumbnailDocument",value:function(){this.pageDIV=[];var A=this.container;this.emptyNode(A)}},{key:"getScrollAhead",value:function(A){return!(!A.first||1!==A.first.id)||(!A.last||A.last.id!==this.pageDIV.length)&&scroll.down}},{key:"_scrollUpdate",value:function(){0!==this.core.getOFDPageCount(0)&&this.updateThumbnailView()}},{key:"_getVisibleThumbs",value:function(){return Object(D.getVisibleElements)({scrollEl:this.container,views:this.pageDIV})}},{key:"updateThumbnailView",value:function(){var A=this,I=this._getVisibleThumbs();if(0!==I.views.length){var g=this.getScrollAhead(I),B=Object(i.getHighestPriority)(I,this.pageDIV,g);if(B&&B.renderingState===D.RenderingStates.INITIAL){B.renderingState=D.RenderingStates.RUNNING;var Q=B.ring,C=document.createElement("canvas"),E=C.getContext("2d");C.style.height=Q.style.height,C.style.width=Q.style.width,C.width=1*this.coreHelper.pageRenderWidth(0,B.id-1,this.core),C.height=1*this.coreHelper.pageRenderHeight(0,B.id-1,this.core);var o=C.width/C.height,w=document.createElement("img");w.className="thumbnailImage",w.style.width="98px",w.style.height=98/o+"px",this.ofdCanvasRender.renderPageByCanvas(C,E,0,B.id-1).then((function(I){var g=C.toDataURL();w.src=g,B.renderingState=D.RenderingStates.FINISHED,A.updateThumbnailView()})),Q.appendChild(w)}}}},{key:"scrollThumbnailIntoView",value:function(A){if(A){var I=this.pageDIV[A-1];if(I){if(A!==this.currentPage)this.pageDIV[this.currentPage-1].div.classList.remove(N),I.div.classList.add(N);var g=this._getVisibleThumbs(),B=g.first,Q=g.last,C=g.views;if(C.length>0){var E=!1;if(A<=B.id||A>=Q.id)E=!0;else{var i,o=G(C);try{for(o.s();!(i=o.n()).done;){var w=i.value,F=w.id,y=w.percent;if(F===A){E=y<100;break}}}catch(A){o.e(A)}finally{o.f()}}E&&Object(D.scrollIntoView)(I.div,{top:-19})}this.currentPage=A}}}},{key:"setOfdCore",value:function(A){var I=this;if(this.container){this.core&&this.freeThumbnailDocument(),this.core=A,this.ofdCanvasRender.setOfdCore(this.core);for(var g=this.container,B=this,Q=function(A){var Q=I.coreHelper.pageRenderWidth(0,A,I.core)/I.coreHelper.pageRenderHeight(0,A,I.core),C=document.createElement("a");C.onclick=function(){return B.eventBus.dispatch("jumpPage",{source:this,pageIndex:A+1}),!1};var E=document.createElement("div");E.className="thumbnail",E.setAttribute("data-page-number","".concat(A+1));var i=document.createElement("div");i.className="thumbnailSelectionRing";i.style.width="100px",i.style.height=98/Q+2+"px",E.appendChild(i),C.appendChild(E),I.pageDIV[A]={ring:i,div:E,anchor:C,id:A+1,renderingState:D.RenderingStates.INITIAL},g.appendChild(C)},C=0;C<this.core.getOFDPageCount(0);++C)Q(C);this.updateThumbnailView()}}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"PDFSidebar",(function(){return o}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=g(22),i="pdfSidebarNotification",o=function(){function A(I){var g=I.elements,B=I.ofdViewer,C=I.ofdThumbnailViewer,E=I.eventBus,i=I.l10n;Q()(this,A),this.isOpen=!1,this.active=D.SidebarView.OUTLINE,this.isInitialViewSet=!1,this.onToggled=null,this.ofdViewer=B,this.ofdThumbnailViewer=C,this.outerContainer=g.outerContainer,this.viewerContainer=g.viewerContainer,this.toggleButton=g.toggleButton,this.thumbnailButton=g.thumbnailButton,this.outlineButton=g.outlineButton,this.attachmentsButton=g.attachmentsButton,this.layersButton=g.layersButton,this.signaturesButton=g.signaturesButton,this.thumbnailView=g.thumbnailView,this.outlineView=g.outlineView,this.attachmentsView=g.attachmentsView,this.layersView=g.layersView,this.signaturesView=g.signaturesView,this._outlineOptionsContainer=g.outlineOptionsContainer,this._currentOutlineItemButton=g.currentOutlineItemButton,this.eventBus=E,this.l10n=i,this._addEventListeners()}return E()(A,[{key:"reset",value:function(){this.isInitialViewSet=!1,this._hideUINotification(!0),this.switchView(D.SidebarView.OUTLINE),this.outlineButton.disabled=!1,this.attachmentsButton.disabled=!1,this.layersButton.disabled=!1,this._currentOutlineItemButton.disabled=!0}},{key:"visibleView",get:function(){return this.isOpen?this.active:D.SidebarView.NONE}},{key:"isThumbnailViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.THUMBS}},{key:"isOutlineViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.OUTLINE}},{key:"isAttachmentsViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.ATTACHMENTS}},{key:"isLayersViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.LAYERS}},{key:"isSignatureViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.SIGNATURES}},{key:"setInitialView",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D.SidebarView.NONE;this.isInitialViewSet||(this.isInitialViewSet=!0,A!==D.SidebarView.NONE&&A!==D.SidebarView.UNKNOWN&&this._switchView(A,!0)||this._dispatchEvent())}},{key:"switchView",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._switchView(A,I)}},{key:"_switchView",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]&&arguments[1],g=A!==this.active,B=!1;switch(A){case D.SidebarView.NONE:return!!this.isOpen&&(this.close(),!0);case D.SidebarView.THUMBS:this.isOpen&&g&&(B=!0);break;case D.SidebarView.OUTLINE:if(this.outlineButton.disabled)return!1;break;case D.SidebarView.ATTACHMENTS:if(this.attachmentsButton.disabled)return!1;break;case D.SidebarView.LAYERS:if(this.layersButton.disabled)return!1;break;case D.SidebarView.SIGNATURES:if(this.signaturesButton.disabled)return!1;break;default:return!1}this.active=A;var Q=A===D.SidebarView.THUMBS,C=A===D.SidebarView.OUTLINE,E=A===D.SidebarView.ATTACHMENTS,i=A===D.SidebarView.LAYERS,o=A===D.SidebarView.SIGNATURES;return this.thumbnailButton&&this.thumbnailButton.classList.toggle("toggled",Q),this.outlineButton&&this.outlineButton.classList.toggle("toggled",C),this.attachmentsButton&&this.attachmentsButton.classList.toggle("toggled",E),this.layersButton&&this.layersButton.classList.toggle("toggled",i),this.signaturesButton&&this.signaturesButton.classList.toggle("toggled",o),this.thumbnailButton&&this.thumbnailButton.setAttribute("aria-checked",Q),this.outlineButton&&this.outlineButton.setAttribute("aria-checked",C),this.attachmentsButton&&this.attachmentsButton.setAttribute("aria-checked",E),this.layersButton&&this.layersButton.setAttribute("aria-checked",i),this.signaturesButton&&this.signaturesButton.setAttribute("aria-checked",o),this.thumbnailView&&this.thumbnailView.classList.toggle("hidden",!Q),this.outlineView&&this.outlineView.classList.toggle("hidden",!C),this.attachmentsView&&this.attachmentsView.classList.toggle("hidden",!E),this.layersView&&this.layersView.classList.toggle("hidden",!i),this.signaturesView&&this.signaturesView.classList.toggle("hidden",!o),this._outlineOptionsContainer&&this._outlineOptionsContainer.classList.toggle("hidden",!C),I&&!this.isOpen?(this.open(),!0):(B&&(this._updateThumbnailViewer(),this._forceRendering()),g&&this._dispatchEvent(),g)}},{key:"open",value:function(){this.isOpen||(this.isOpen=!0,this.toggleButton.classList.add("toggled"),this.toggleButton.setAttribute("aria-expanded","true"),this.outerContainer.classList.add("sidebarMoving","sidebarOpen"),this.active===D.SidebarView.THUMBS&&this._updateThumbnailViewer(),this._forceRendering(),this._dispatchEvent(),this._hideUINotification())}},{key:"close",value:function(){this.isOpen&&(this.isOpen=!1,this.toggleButton.classList.remove("toggled"),this.toggleButton.setAttribute("aria-expanded","false"),this.outerContainer.classList.add("sidebarMoving"),this.outerContainer.classList.remove("sidebarOpen"),this._forceRendering(),this._dispatchEvent())}},{key:"toggle",value:function(){this.isOpen?this.close():this.open()}},{key:"_dispatchEvent",value:function(){this.eventBus.dispatch("sidebarviewchanged",{source:this,view:this.isOutlineViewVisible})}},{key:"_forceRendering",value:function(){this.onToggled?this.onToggled():(this.ofdViewer.forceRendering(),this.ofdThumbnailViewer&&this.ofdThumbnailViewer.updateThumbnailView())}},{key:"_updateThumbnailViewer",value:function(){var A=this.ofdViewer;this.ofdThumbnailViewer.scrollThumbnailIntoView(A.currentPageNumber)}},{key:"_showUINotification",value:function(){var A=this;this.l10n.get("toggle_sidebar_notification2.title").then((function(I){A.toggleButton.title=I})),this.isOpen||this.toggleButton.classList.add(i)}},{key:"_hideUINotification",value:function(){var A=this,I=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(this.isOpen||I)&&this.toggleButton.classList.remove(i),I&&this.l10n.get("toggle_sidebar.title").then((function(I){A.toggleButton.title=I}))}},{key:"_addEventListeners",value:function(){var A,I,g,B,Q,C,E,i,o,w,G=this;null===(A=this.viewerContainer)||void 0===A||A.addEventListener("transitionend",(function(A){A.target===G.viewerContainer&&G.outerContainer.classList.remove("sidebarMoving")})),null===(I=this.toggleButton)||void 0===I||I.addEventListener("click",(function(){G.toggle()})),null===(g=this.thumbnailButton)||void 0===g||g.addEventListener("click",(function(){G.switchView(D.SidebarView.THUMBS)})),null===(B=this.outlineButton)||void 0===B||B.addEventListener("click",(function(){G.switchView(D.SidebarView.OUTLINE)})),null===(Q=this.outlineButton)||void 0===Q||Q.addEventListener("dblclick",(function(){G.eventBus.dispatch("toggleoutlinetree",{source:G})})),null===(C=this.attachmentsButton)||void 0===C||C.addEventListener("click",(function(){G.switchView(D.SidebarView.ATTACHMENTS)})),null===(E=this.layersButton)||void 0===E||E.addEventListener("click",(function(){G.switchView(D.SidebarView.LAYERS)})),null===(i=this.layersButton)||void 0===i||i.addEventListener("dblclick",(function(){G.eventBus.dispatch("resetlayers",{source:G})})),null===(o=this.signaturesButton)||void 0===o||o.addEventListener("click",(function(){G.switchView(D.SidebarView.SIGNATURES)})),null===(w=this._currentOutlineItemButton)||void 0===w||w.addEventListener("click",(function(){G.eventBus.dispatch("currentoutlineitem",{source:G})}));var F=function(A,I,g){I.disabled=!A,A?G._showUINotification():G.active===g&&G.switchView(D.SidebarView.THUMBS)};this.eventBus._on("outlineloaded",(function(A){F(A.outlineCount,G.outlineButton,D.SidebarView.OUTLINE),A.currentOutlineItemPromise.then((function(A){G.isInitialViewSet&&(G._currentOutlineItemButton.disabled=!A)}))})),this.eventBus._on("attachmentsloaded",(function(A){F(A.attachmentsCount,G.attachmentsButton,D.SidebarView.ATTACHMENTS)})),this.eventBus._on("layersloaded",(function(A){F(A.layersCount,G.layersButton,D.SidebarView.LAYERS)})),this.eventBus._on("presentationmodechanged",(function(A){A.state===D.PresentationModeState.NORMAL&&G.isThumbnailViewVisible&&G._updateThumbnailViewer()}))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"OverlayManager",(function(){return G}));var B=g(7),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(8),w=g.n(o),G=function(){function A(){E()(this,A),this.overlays=new WeakMap}var I,g,B,C;return i()(A,[{key:"register",value:(C=Q()(w.a.mark((function A(I){var g,B=this,Q=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(g=Q.length>1&&void 0!==Q[1]&&Q[1],"object"==typeof I){A.next=5;break}throw new Error("Not enough parameters.");case 5:if(!this.overlays.has(I)){A.next=7;break}throw new Error("The overlay is already registered.");case 7:this.overlays.set(I,{canForceClose:g}),"undefined"!=typeof PDFJSDev&&PDFJSDev.test("GENERIC && !SKIP_BABEL")&&I.showModal,I.addEventListener("cancel",(function(A){B.active=null}));case 10:case"end":return A.stop()}}),A,this)}))),function(A){return C.apply(this,arguments)})},{key:"unregister",value:(B=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.overlays.has(I)){A.next=4;break}throw new Error("The overlay does not exist.");case 4:if(this.active!==I){A.next=6;break}throw new Error("The overlay cannot be removed while it is active.");case 6:this.overlays.delete(I);case 7:case"end":return A.stop()}}),A,this)}))),function(A){return B.apply(this,arguments)})},{key:"open",value:(g=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.overlays.has(I)){A.next=4;break}throw new Error("The overlay does not exist.");case 4:if(!this.active){A.next=15;break}if(this.active!==I){A.next=9;break}this.active=null,A.next=15;break;case 9:if(!this.overlays.get(I).canForceClose){A.next=14;break}return A.next=12,this.close();case 12:A.next=15;break;case 14:this.active=null;case 15:this.active=I,"function"==typeof I.showModal&&I.showModal();case 17:case"end":return A.stop()}}),A,this)}))),function(A){return g.apply(this,arguments)})},{key:"close",value:(I=Q()(w.a.mark((function A(){var I,g=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(I=g.length>0&&void 0!==g[0]?g[0]:this.active,this.overlays.has(I)){A.next=5;break}throw new Error("The overlay does not exist.");case 5:if(this.active){A.next=9;break}throw new Error("The overlay is currently not active.");case 9:if(this.active===I){A.next=11;break}throw new Error("Another overlay is currently active.");case 11:I.close(),this.active=null;case 13:case"end":return A.stop()}}),A,this)}))),function(){return I.apply(this,arguments)})}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"PDFDocumentProperties",(function(){return G}));var B=g(7),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(8),w=g.n(o),G=(g(22),function(){function A(I,g,B,Q){var C=this,D=I.dialog,i=I.fields,o=I.closeButton;E()(this,A),this.dialog=D,this.fields=i,this.overlayManager=g,this.l10n=Q,this.fieldData=null,this.reset(),o.addEventListener("click",this.close.bind(this)),this.overlayManager.register(this.dialog),B._on("pagechanging",(function(A){C._currentPageNumber=A.pageNumber})),B._on("rotationchanging",(function(A){C._pagesRotation=A.pagesRotation})),this._isNonMetricLocale=!0}var I,g;return i()(A,[{key:"open",value:(g=Q()(w.a.mark((function A(){var I,g,B,Q,C,E;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.dialog.hidden=!1,this.ofdCore){A.next=3;break}return A.abrupt("return");case 3:if(this.overlayManager.open(this.dialog),I=this._currentPageNumber,g=this._pagesRotation,!this.fieldData||I!==this.fieldData._currentPageNumber||g!==this.fieldData._pagesRotation){A.next=9;break}return this.updateUI(),A.abrupt("return");case 9:B=this.getMetadata(),Q=B.info,B.contentDispositionFilename,C=B.contentLength,E=this.parseFileSize(C),this.fieldData=Object.freeze({fileSize:E,title:Q.Title,author:Q.Author,subject:Q.Subject,keywords:Q.Keywords,creationDate:Q.CreationDate,modificationDate:Q.ModificationDate,creator:Q.Creator,producer:Q.Producer,version:Q.CreatorVersion,pageCount:Q.numPages,pageSize:Q.pageSize,_currentPageNumber:I,_pagesRotation:g}),this.updateUI();case 13:case"end":return A.stop()}}),A,this)}))),function(){return g.apply(this,arguments)})},{key:"close",value:(I=Q()(w.a.mark((function A(){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:this.overlayManager.close(this.dialog);case 1:case"end":return A.stop()}}),A,this)}))),function(){return I.apply(this,arguments)})},{key:"setOfdCore",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.ofdCore&&(this.reset(),this.updateUI(!0)),A&&(this.ofdCore=A,this.url=I)}},{key:"getMetadata",value:function(){if(this.ofdCore)return{info:this.ofdCore.getMetadata(0),contentLength:this.ofdCore.ofd.size}}},{key:"reset",value:function(){this.ofdCore=null,this.url=null,this.fieldData=null,this._currentPageNumber=1,this._pagesRotation=0}},{key:"updateUI",value:function(){if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.fieldData){if(this.overlayManager.active===this.dialog)for(var A in this.fields){var I=this.fieldData[A];this.fields[A].textContent=I||0===I?I:"-"}}else for(var g in this.fields)this.fields[g].textContent="-"}},{key:"parseFileSize",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,I=A/1024,g=I/1024;if(I)return g>=1?"".concat(g>=1&&(+g.toPrecision(3)).toLocaleString(),"mb(").concat(A.toLocaleString(),"字节)"):"".concat(g<1&&(+I.toPrecision(3)).toLocaleString(),"kb(").concat(A.toLocaleString(),"字节)")}},{key:"parseLinearization",value:function(A){return this.l10n.get("document_properties_linearized_".concat(A?"yes":"no"))}}]),A}())},function(A,I,g){"use strict";g.r(I),g.d(I,"Toolbar",(function(){return y}));var B=g(7),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(8),w=g.n(o),G=g(22);function F(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return N(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return N(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function N(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var y=function(){function A(I,g,B){E()(this,A),this.toolbar=I.container,this.eventBus=g,this.l10n=B,this.buttons=[{element:I.previous,eventName:"previouspage"},{element:I.next,eventName:"nextpage"},{element:I.zoomIn,eventName:"zoomin"},{element:I.zoomOut,eventName:"zoomout"},{element:I.openFile,eventName:"openfile"},{element:I.print,eventName:"print"},{element:I.presentationModeButton,eventName:"presentationmode"},{element:I.download,eventName:"download"},{element:I.viewBookmark,eventName:null}],this.items={numPages:I.numPages,pageNumber:I.pageNumber,scaleSelect:I.scaleSelect,langSelect:I.langSelect,customScaleOption:I.customScaleOption,previous:I.previous,next:I.next,zoomIn:I.zoomIn,zoomOut:I.zoomOut},this._wasLocalized=!1,this.reset(),this._bindListeners()}var I;return i()(A,[{key:"setPageNumber",value:function(A,I){this.pageNumber=A,this.pageLabel=I,this._updateUIState(!1)}},{key:"setPagesCount",value:function(A,I){this.pagesCount=A,this.hasPageLabels=I,this._updateUIState(!0)}},{key:"setPageScale",value:function(A,I){this.pageScaleValue=(A||I).toString(),this.pageScale=I,this._updateUIState(!1)}},{key:"setLanguage",value:(I=Q()(w.a.mark((function A(I){var g,B,Q;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this.l10n.getLanguage();case 2:if(A.sent!=I){A.next=5;break}return A.abrupt("return");case 5:this.eventBus.dispatch("langchanged",{source:self,value:I}),g=F(this.items.langSelect.options),A.prev=7,g.s();case 9:if((B=g.n()).done){A.next=17;break}if((Q=B.value).value===I){A.next=14;break}return Q.selected=!1,A.abrupt("continue",15);case 14:Q.selected=!0;case 15:A.next=9;break;case 17:A.next=22;break;case 19:A.prev=19,A.t0=A.catch(7),g.e(A.t0);case 22:return A.prev=22,g.f(),A.finish(22);case 25:case"end":return A.stop()}}),A,this,[[7,19,22,25]])}))),function(A){return I.apply(this,arguments)})},{key:"reset",value:function(){this.pageNumber=0,this.pageLabel=null,this.hasPageLabels=!1,this.pagesCount=0,this.pageScaleValue=G.DEFAULT_SCALE_VALUE,this.pageScale=G.DEFAULT_SCALE,this._updateUIState(!0),this.updateLoadingIndicatorState()}},{key:"_bindListeners",value:function(){var A,I=this,g=this.items,B=g.pageNumber,Q=g.scaleSelect,C=g.langSelect,E=this,D=F(this.buttons);try{var i=function(){var g=A.value,B=g.element,Q=g.eventName;null==B||B.addEventListener("click",(function(A){null!==Q&&I.eventBus.dispatch(Q,{source:I})}))};for(D.s();!(A=D.n()).done;)i()}catch(A){D.e(A)}finally{D.f()}B.addEventListener("click",(function(){this.select()})),B.addEventListener("change",(function(){E.eventBus.dispatch("pagenumberchanged",{source:E,value:this.value})})),Q.addEventListener("change",(function(){"custom"!==this.value&&E.eventBus.dispatch("scalechanged",{source:E,value:this.value})})),Q.addEventListener("click",(function(A){var I=A.target;this.value===E.pageScaleValue&&"OPTION"===I.tagName.toUpperCase()&&this.blur()})),Q.oncontextmenu=G.noContextMenuHandler,C&&C.addEventListener("change",(function(){E.eventBus.dispatch("langchanged",{source:E,value:this.value})})),this.eventBus._on("localized",(function(){I._wasLocalized=!0,I._updateUIState(!0)}))}},{key:"_updateUIState",value:function(){var A=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._wasLocalized){var I=this.pageNumber,g=this.pagesCount,B=this.pageScaleValue,Q=this.pageScale,C=this.items;A&&(this.hasPageLabels?C.pageNumber.type="text":(C.pageNumber.type="number",this.l10n.get("of_pages",{pagesCount:g}).then((function(A){C.numPages.textContent=A}))),C.pageNumber.max=g),this.hasPageLabels?(C.pageNumber.value=this.pageLabel,this.l10n.get("page_of_pages",{pageNumber:I,pagesCount:g}).then((function(A){C.numPages.textContent=A}))):C.pageNumber.value=I,C.previous.disabled=I<=1,C.next.disabled=I>=g,C.zoomOut.disabled=Q<=G.MIN_SCALE,C.zoomIn.disabled=Q>=G.MAX_SCALE;var E,D=!1,i=F(C.scaleSelect.options);try{for(i.s();!(E=i.n()).done;){var o=E.value;o.value===B?(o.selected=!0,D=!0):o.selected=!1}}catch(A){i.e(A)}finally{i.f()}D||(C.customScaleOption.textContent="".concat(1e4*Q/100,"%"),C.customScaleOption.selected=!0)}}},{key:"updateLoadingIndicatorState",value:function(){var A=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.items.pageNumber.classList.toggle("visiblePageIsLoading",A)}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"SecondaryToolbar",(function(){return G}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=g(22),i=g(44);function o(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return w(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return w(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function w(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var G=function(){function A(I,g,B){Q()(this,A),this.toolbar=I.toolbar,this.toggleButton=I.toggleButton,this.toolbarButtonContainer=I.toolbarButtonContainer,this.buttons=[{element:I.presentationModeButton,eventName:"presentationmode",close:!0},{element:I.openFileButton,eventName:"openfile",close:!0},{element:I.printButton,eventName:"print",close:!0},{element:I.downloadButton,eventName:"download",close:!0},{element:I.viewBookmarkButton,eventName:null,close:!0},{element:I.firstPageButton,eventName:"firstpage",close:!0},{element:I.lastPageButton,eventName:"lastpage",close:!0},{element:I.pageRotateCwButton,eventName:"rotatecw",close:!1},{element:I.pageRotateCcwButton,eventName:"rotateccw",close:!1},{element:I.cursorSelectToolButton,eventName:"switchcursortool",eventDetails:{tool:i.CursorTool.SELECT},close:!0},{element:I.cursorHandToolButton,eventName:"switchcursortool",eventDetails:{tool:i.CursorTool.HAND},close:!0},{element:I.scrollPageButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.PAGE},close:!0},{element:I.scrollVerticalButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.VERTICAL},close:!0},{element:I.scrollHorizontalButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.HORIZONTAL},close:!0},{element:I.scrollWrappedButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.WRAPPED},close:!0},{element:I.spreadNoneButton,eventName:"switchspreadmode",eventDetails:{mode:D.SpreadMode.NONE},close:!0},{element:I.spreadOddButton,eventName:"switchspreadmode",eventDetails:{mode:D.SpreadMode.ODD},close:!0},{element:I.spreadEvenButton,eventName:"switchspreadmode",eventDetails:{mode:D.SpreadMode.EVEN},close:!0},{element:I.documentPropertiesButton,eventName:"documentproperties",close:!0},{element:I.closeButton,eventName:"closePage",close:!0}],this.items={firstPage:I.firstPageButton,lastPage:I.lastPageButton,pageRotateCw:I.pageRotateCwButton,pageRotateCcw:I.pageRotateCcwButton},this.mainContainer=g,this.eventBus=B,this.opened=!1,this.containerHeight=null,this.previousContainerHeight=null,this.reset(),this.bindClickListeners(),this.bindCursorToolsListener(I),this.bindScrollModeListener(I),this.bindSpreadModeListener(I),this.eventBus._on("resize",this.setMaxHeight.bind(this))}return E()(A,[{key:"isOpen",get:function(){return this.opened}},{key:"setPageNumber",value:function(A){this.pageNumber=A,this.updateUIState()}},{key:"setPagesCount",value:function(A){this.pagesCount=A,this.updateUIState()}},{key:"reset",value:function(){this.pageNumber=0,this.pagesCount=0,this.updateUIState(),this.eventBus.dispatch("secondarytoolbarreset",{source:this})}},{key:"updateUIState",value:function(){this.items.firstPage&&(this.items.firstPage.disabled=this.pageNumber<=1),this.items.lastPage&&(this.items.lastPage.disabled=this.pageNumber>=this.pagesCount),this.items.pageRotateCw&&(this.items.pageRotateCw.disabled=0===this.pagesCount),this.items.pageRotateCcw&&(this.items.pageRotateCcw.disabled=0===this.pagesCount)}},{key:"bindClickListeners",value:function(){var A,I=this;null===(A=this.toggleButton)||void 0===A||A.addEventListener("click",this.toggle.bind(this));var g,B=o(this.buttons);try{var Q=function(){var A=g.value,B=A.element,Q=A.eventName,C=A.close,E=A.eventDetails;null==B||B.addEventListener("click",(function(A){if(null!==Q){var g={source:I};for(var B in E)g[B]=E[B];I.eventBus.dispatch(Q,g)}C&&I.close()}))};for(B.s();!(g=B.n()).done;)Q()}catch(A){B.e(A)}finally{B.f()}}},{key:"bindCursorToolsListener",value:function(A){var I=A.cursorSelectToolButton,g=A.cursorHandToolButton;this.eventBus._on("cursortoolchanged",(function(A){var B=A.tool,Q=B===i.CursorTool.SELECT,C=B===i.CursorTool.HAND;I.classList.toggle("toggled",Q),g.classList.toggle("toggled",C),I.setAttribute("aria-checked",Q),g.setAttribute("aria-checked",C)}))}},{key:"bindScrollModeListener",value:function(A){var I=this,g=A.scrollPageButton,B=A.scrollVerticalButton,Q=A.scrollHorizontalButton,C=A.scrollWrappedButton,E=A.spreadNoneButton,i=A.spreadOddButton,o=A.spreadEvenButton,w=function(A){var w=A.mode,G=w===D.ScrollMode.PAGE,F=w===D.ScrollMode.VERTICAL,N=w===D.ScrollMode.HORIZONTAL,y=w===D.ScrollMode.WRAPPED;g.classList.toggle("toggled",G),B.classList.toggle("toggled",F),Q.classList.toggle("toggled",N),C.classList.toggle("toggled",y),g.setAttribute("aria-checked",G),B.setAttribute("aria-checked",F),Q.setAttribute("aria-checked",N),C.setAttribute("aria-checked",y);var R=I.pagesCount>15e3;g.disabled=R,B.disabled=R,Q.disabled=R,C.disabled=R,E.disabled=N,i.disabled=N,o.disabled=N};this.eventBus._on("scrollmodechanged",w),this.eventBus._on("secondarytoolbarreset",(function(A){A.source===I&&w({mode:D.ScrollMode.VERTICAL})}))}},{key:"bindSpreadModeListener",value:function(A){var I=this,g=A.spreadNoneButton,B=A.spreadOddButton,Q=A.spreadEvenButton;function C(A){var I=A.mode,C=I===D.SpreadMode.NONE,E=I===D.SpreadMode.ODD,i=I===D.SpreadMode.EVEN;g.classList.toggle("toggled",C),B.classList.toggle("toggled",E),Q.classList.toggle("toggled",i),g.setAttribute("aria-checked",C),B.setAttribute("aria-checked",E),Q.setAttribute("aria-checked",i)}this.eventBus._on("spreadmodechanged",C),this.eventBus._on("secondarytoolbarreset",(function(A){A.source===I&&C({mode:D.SpreadMode.NONE})}))}},{key:"open",value:function(){this.opened||(this.opened=!0,this.setMaxHeight(),this.toggleButton.classList.add("toggled"),this.toggleButton.setAttribute("aria-expanded","true"),this.toolbar.classList.remove("hidden"))}},{key:"close",value:function(){this.opened&&(this.opened=!1,this.toolbar.classList.add("hidden"),this.toggleButton.classList.remove("toggled"),this.toggleButton.setAttribute("aria-expanded","false"))}},{key:"toggle",value:function(){this.opened?this.close():this.open()}},{key:"setMaxHeight",value:function(){this.opened&&(this.containerHeight=this.mainContainer.clientHeight,this.containerHeight!==this.previousContainerHeight&&(this.toolbarButtonContainer.style.maxHeight="".concat(this.containerHeight-D.SCROLLBAR_PADDING,"px"),this.previousContainerHeight=this.containerHeight))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"CursorTool",(function(){return o})),g.d(I,"PDFCursorTools",(function(){return w}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=g(45),i=g(22),o={SELECT:0,HAND:1,ZOOM:2},w=function(){function A(I){var g=this,B=I.container,C=I.eventBus,E=I.cursorToolOnLoad,i=void 0===E?o.SELECT:E;Q()(this,A),this.container=B,this.eventBus=C,this.active=o.SELECT,this.activeBeforePresentationMode=null,this.handTool=new D.GrabToPan({element:this.container}),this.addEventListeners(),Promise.resolve().then((function(){g.switchTool(i)}))}return E()(A,[{key:"activeTool",get:function(){return this.active}},{key:"switchTool",value:function(A){var I=this;if(null===this.activeBeforePresentationMode&&A!==this.active){var g=function(){switch(I.active){case o.SELECT:break;case o.HAND:I.handTool.deactivate();case o.ZOOM:}};switch(A){case o.SELECT:g();break;case o.HAND:g(),this.handTool.activate();break;case o.ZOOM:default:return}this.active=A,this.dispatchEvent()}}},{key:"dispatchEvent",value:function(){this.eventBus.dispatch("cursortoolchanged",{source:this,tool:this.active})}},{key:"addEventListeners",value:function(){var A=this;this.eventBus._on("switchcursortool",(function(I){A.switchTool(I.tool)})),this.eventBus._on("presentationmodechanged",(function(I){switch(I.state){case i.PresentationModeState.FULLSCREEN:var g=A.active;A.switchTool(o.SELECT),A.activeBeforePresentationMode=g;break;case i.PresentationModeState.NORMAL:var B=A.activeBeforePresentationMode;A.activeBeforePresentationMode=null,A.switchTool(B)}}))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"GrabToPan",(function(){return i}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D="grab-to-pan-grab",i=function(){function A(I){Q()(this,A),this.element=I.element,this.document=I.element.ownerDocument,"function"==typeof I.ignoreTarget&&(this.ignoreTarget=I.ignoreTarget),this.onActiveChanged=I.onActiveChanged,this.activate=this.activate.bind(this),this.deactivate=this.deactivate.bind(this),this.toggle=this.toggle.bind(this),this._onMouseDown=this.onMouseDown.bind(this),this._onMouseMove=this.onMouseMove.bind(this),this._endPan=this.endPan.bind(this),(this.overlay=document.createElement("div")).className="grab-to-pan-grabbing"}return E()(A,[{key:"activate",value:function(){this.active||(this.active=!0,this.element.addEventListener("mousedown",this._onMouseDown,!0),this.element.classList.add(D),this.onActiveChanged&&this.onActiveChanged(!0))}},{key:"deactivate",value:function(){this.active&&(this.active=!1,this.element.removeEventListener("mousedown",this._onMouseDown,!0),this._endPan(),this.element.classList.remove(D),this.onActiveChanged&&this.onActiveChanged(!1))}},{key:"toggle",value:function(){this.active?this.deactivate():this.activate()}},{key:"ignoreTarget",value:function(A){return A.matches("a[href], a[href] *, input, textarea, button, button *, select, option")}},{key:"onMouseDown",value:function(A){if(0===A.button&&!this.ignoreTarget(A.target)){if(A.originalTarget)try{A.originalTarget.tagName}catch(A){return}this.scrollLeftStart=this.element.scrollLeft,this.scrollTopStart=this.element.scrollTop,this.clientXStart=A.clientX,this.clientYStart=A.clientY,this.document.addEventListener("mousemove",this._onMouseMove,!0),this.document.addEventListener("mouseup",this._endPan,!0),this.element.addEventListener("scroll",this._endPan,!0),A.preventDefault(),A.stopPropagation();var I=document.activeElement;I&&!I.contains(A.target)&&I.blur()}}},{key:"onMouseMove",value:function(A){if(this.element.removeEventListener("scroll",this._endPan,!0),1&A.buttons){var I=A.clientX-this.clientXStart,g=A.clientY-this.clientYStart,B=this.scrollTopStart-g,Q=this.scrollLeftStart-I;this.element.scrollTo?this.element.scrollTo({top:B,left:Q,behavior:"instant"}):(this.element.scrollTop=B,this.element.scrollLeft=Q),this.overlay.parentNode||document.body.appendChild(this.overlay)}else this._endPan()}},{key:"endPan",value:function(){this.element.removeEventListener("scroll",this._endPan,!0),this.document.removeEventListener("mousemove",this._onMouseMove,!0),this.document.removeEventListener("mouseup",this._endPan,!0),this.overlay.remove()}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"Print",(function(){return M}));var B=g(7),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(8),w=g.n(o),G=(g(37),g(30)),F=g(36),N=g(47),y=g.n(N);function R(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return h(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return h(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function h(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var M=function(){function A(I,g,B,Q,C){E()(this,A),this.coreHelper=new F.Ofd_Core_Helper(40),this.dialog=I||document.getElementById("printServiceDialog"),this.overlayManager=g,this.l10n=B,this.ofdRender=new G.Ofd_Render(null,this.coreHelper),document.getElementById("printCancel").addEventListener("click",this.close.bind(this)),this.overlayManager.register(this.dialog),this.progressBar=this.dialog.querySelector("progress"),this.progressPerc=this.dialog.querySelector(".relative-progress"),this.abort=!1,this.eventBus=Q,this.callback=C}var I,g,B;return i()(A,[{key:"setOfdCore",value:function(A){this.core=A,this.ofdRender.setOfdCore(this.core)}},{key:"close",value:(B=Q()(w.a.mark((function A(){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:this.abort=!0,this.overlayManager.close(this.dialog);case 2:case"end":return A.stop()}}),A,this)}))),function(){return B.apply(this,arguments)})},{key:"open",value:(g=Q()(w.a.mark((function A(){var I=this;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.core){A.next=2;break}return A.abrupt("return");case 2:return this.abort=!1,this.overlayManager.open(this.dialog),A.next=6,this.renderProgress(0);case 6:setTimeout((function(){I.prepare().then((function(A){if(A&&A.length>0){I.close();var g,B=document.createElement("div"),Q=R(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;B.appendChild(C)}}catch(A){Q.e(A)}finally{Q.f()}if(I.callback&&I.eventBus)return void I.eventBus.dispatch("printCallback",{source:I,html:B});y()({printable:B,type:"html",scanStyles:!1})}}))}),100);case 7:case"end":return A.stop()}}),A,this)}))),function(){return g.apply(this,arguments)})},{key:"prepare",value:(I=Q()(w.a.mark((function A(){var I=this;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",new Promise(function(){var A=Q()(w.a.mark((function A(g,B){var Q,C,E,D,i;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:Q=[],C=0;case 2:if(!(C<I.core.getOFDPageCount(0))||I.abort){A.next=21;break}return E=785/I.core.pageWidth(0,C)*25.4,I.ofdRender.setDpi(E),(D=document.createElement("canvas")).style.width="794px",D.style.height="1123px",(i=document.createElement("div")).style.width="794px",i.style.height="1123px",i.style.position="relative",i.appendChild(D),A.next=15,I.ofdRender.renderPage(i,0,C);case 15:return Q.push(i),A.next=18,I.renderProgress(C+1);case 18:C++,A.next=2;break;case 21:I.abort&&g(),g(Q);case 23:case"end":return A.stop()}}),A)})));return function(I,g){return A.apply(this,arguments)}}()));case 1:case"end":return A.stop()}}),A)}))),function(){return I.apply(this,arguments)})},{key:"renderProgress",value:function(A){var I=this;return new Promise((function(g,B){var Q=Math.round(100*A/I.core.getOFDPageCount(0));I.progressBar.value=Q,I.l10n.get("print_progress_percent",{progress:Q}).then((function(A){I.progressPerc.textContent=A})),setTimeout((function(){g()}),100)}))}}]),A}()},function(A,I,g){var B;window,B=function(){return function(A){var I={};function g(B){if(I[B])return I[B].exports;var Q=I[B]={i:B,l:!1,exports:{}};return A[B].call(Q.exports,Q,Q.exports,g),Q.l=!0,Q.exports}return g.m=A,g.c=I,g.d=function(A,I,B){g.o(A,I)||Object.defineProperty(A,I,{enumerable:!0,get:B})},g.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},g.t=function(A,I){if(1&I&&(A=g(A)),8&I)return A;if(4&I&&"object"==typeof A&&A&&A.__esModule)return A;var B=Object.create(null);if(g.r(B),Object.defineProperty(B,"default",{enumerable:!0,value:A}),2&I&&"string"!=typeof A)for(var Q in A)g.d(B,Q,function(I){return A[I]}.bind(null,Q));return B},g.n=function(A){var I=A&&A.__esModule?function(){return A.default}:function(){return A};return g.d(I,"a",I),I},g.o=function(A,I){return Object.prototype.hasOwnProperty.call(A,I)},g.p="",g(g.s=0)}({"./src/index.js":
|
|
1
|
+
!function(A,I){"object"==typeof exports&&"object"==typeof module?module.exports=I(require("parser_helper_x.js"),require("axios")):"function"==typeof define&&define.amd?define([,"axios"],I):"object"==typeof exports?exports.parser_x=I(require("parser_helper_x.js"),require("axios")):A.parser_x=I(A.parser_helper_x,A.axios)}(window,(function(A,I){return function(A){var I={};function g(B){if(I[B])return I[B].exports;var Q=I[B]={i:B,l:!1,exports:{}};return A[B].call(Q.exports,Q,Q.exports,g),Q.l=!0,Q.exports}return g.m=A,g.c=I,g.d=function(A,I,B){g.o(A,I)||Object.defineProperty(A,I,{enumerable:!0,get:B})},g.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},g.t=function(A,I){if(1&I&&(A=g(A)),8&I)return A;if(4&I&&"object"==typeof A&&A&&A.__esModule)return A;var B=Object.create(null);if(g.r(B),Object.defineProperty(B,"default",{enumerable:!0,value:A}),2&I&&"string"!=typeof A)for(var Q in A)g.d(B,Q,function(I){return A[I]}.bind(null,Q));return B},g.n=function(A){var I=A&&A.__esModule?function(){return A.default}:function(){return A};return g.d(I,"a",I),I},g.o=function(A,I){return Object.prototype.hasOwnProperty.call(A,I)},g.p="",g(g.s=0)}([function(A,I,g){"use strict";g.r(I),g.d(I,"OFDPrintApi",(function(){return x})),g.d(I,"ajaxUtils",(function(){return b})),g.d(I,"getToSign",(function(){return p})),g.d(I,"packageSigned",(function(){return m})),g.d(I,"free",(function(){return T})),g.d(I,"hashOfdDocument",(function(){return X})),g.d(I,"parseOfdDocument",(function(){return O})),g.d(I,"parseOfdDocumentFromBase64",(function(){return u})),g.d(I,"getOFDPageCount",(function(){return z})),g.d(I,"getAllAttachments",(function(){return P})),g.d(I,"getAttachmentById",(function(){return v})),g.d(I,"getAttachmentArrayBuffer",(function(){return _})),g.d(I,"pageSize",(function(){return $})),g.d(I,"getCustomTag",(function(){return AA})),g.d(I,"getTextObjects",(function(){return IA})),g.d(I,"renderOfd",(function(){return gA})),g.d(I,"renderOfdByIndex",(function(){return BA})),g.d(I,"getFileStream",(function(){return CA})),g.d(I,"setLanguage",(function(){return EA})),g.d(I,"openMetaBaseViewer",(function(){return DA})),g.d(I,"openOFDBaseViewer",(function(){return iA})),g.d(I,"openOFDBaseViewerByBase64",(function(){return oA})),g.d(I,"verifySignature",(function(){return wA})),g.d(I,"printOFD",(function(){return GA})),g.d(I,"getEventBus",(function(){return FA})),g.d(I,"initOFDViewer",(function(){return NA})),g.d(I,"openOFDViewer",(function(){return yA})),g.d(I,"openFile",(function(){return RA})),g.d(I,"openFileBase64",(function(){return hA})),g.d(I,"openOFD",(function(){return MA}));var B=g(1),Q=g.n(B),C=g(5),E=g.n(C),D=g(6),i=g(12),o=g(20),w=g(38),G=g(39),F=g(40),N=g(41),y=g(42),R=g(43),h=g(44),M=g(46),U=g(35),c=g(48),k=g(32),S=g(30),s=g(36),a=g(49),Y=g(50),K=g.n(Y),H=g(51),J=g(52),L=g(53),t=g(54),d=g(31),Z=g(55),e=g.n(Z),n=g(56),l=g.n(n),q=g(57);function r(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return W(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return W(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function W(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var x=c.Print_api,f=window.Module,V={ofdCore:null,viewer:null,eventBus:null,waterText:null,fileName:null,ofdRender:null},b=l.a,p=function(A,I){return Object(k.JSGetToSign)(A,I)},m=function(A,I){return Object(k.JSPackageSigned)(A,I)},T=function(){V.ofdCore&&Object(k.freeOFD)(V.ofdCore)},X=function(A){if(A.ofd instanceof File){var I=new FileReader;I.readAsArrayBuffer(A.ofd),I.onload=function(){A.success&&A.success(Object(k.JSBase64ByHashFile)(I.result,A.list,A.method))}}else A.ofd instanceof ArrayBuffer?A.success&&A.success(Object(k.JSBase64ByHashFile)(A.ofd,A.list,A.method)):e()({url:A.ofd,method:"GET",responseType:"arraybuffer",headers:A.headers}).then((function(I){var g=Object(k.readOFD)(I.data,A.secret,A.digest);j(g,A)})).catch((function(I){A.fail&&A.fail(I)}))},j=function(A,I){0===A.code?(V.ofdCore=new U.Ofd_Core(A.data.ofd,A.data.ofdParserPtr,A.data.leftTime),I.waterText&&(V.waterText=I.waterText),I.digest||(V.waterText="demotest"),I.signatureClickCallback&&(V.eventBus=new i.EventBus,V.eventBus._on("signatureclick",I.signatureClickCallback)),I.signaturesCallback&&I.signaturesCallback(V.ofdCore.getAllSignature(0)),I.success&&I.success(V.ofdCore)):I.fail&&I.fail(A.msg)},O=function(A){QA((function(){if(V.ofdCore&&(Object(k.freeOFD)(V.ofdCore),V.ofdCore=null,V.ofdRender=null),Object(k.CreateLibrary)(),A.ofd instanceof File){var I=new FileReader;I.readAsArrayBuffer(A.ofd),I.onload=function(){var g=Object(k.readOFD)(I.result,A.secret,A.digest);j(g,A)}}else if(A.ofd instanceof ArrayBuffer){var g=Object(k.readOFD)(A.ofd,A.secret,A.digest);j(g,A)}else e()({url:A.ofd,method:"GET",responseType:"arraybuffer",headers:A.headers}).then((function(I){if(A.ofd&&A.ofd.split("/")){var g=A.ofd.split("/");V.fileName=g[g.length-1]}var B=Object(k.readOFD)(I.data,A.secret,A.digest);j(B,A)})).catch((function(I){A.fail&&A.fail(I)}))}))},u=function(A){QA((function(){V.ofdCore&&(Object(k.freeOFD)(V.ofdCore),V.ofdCore=null,V.ofdRender=null),Object(k.CreateLibrary)();var I=Object(k.readOFDByBase64)(A.ofd,A.secret,A.digest);j(I,A)}))},z=function(A){return V.ofdCore.getOFDPageCount(A)},P=function(A){return V.ofdCore.getAllAttachment(A)},v=function(A,I){return V.ofdCore.getAttachmentByID(A,I)},_=function(A,I){return new Promise((function(g,B){var Q=V.ofdCore.getAttachmentByID(A,I);Q?PA(Q.FileLocAbs).then((function(A){g(A)})).catch((function(A){B(A)})):B("attachmentId error")}))},$=function(A,I,g){var B=96;g&&(B=g/V.ofdCore.pageWidth(A,I)*25.4);var Q=new s.Ofd_Core_Helper(B);return{width:V.ofdCore.pageWidth(A,I),height:V.ofdCore.pageHeight(A,I),renderWidth:Q.pageRenderWidth(A,I,V.ofdCore),renderHeight:Q.pageRenderHeight(A,I,V.ofdCore)}},AA=function(A){return V.ofdCore.getCustomTag(A)},IA=function(A){return V.ofdCore.getAllTextObject(A)},gA=function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},B=96;I&&"number"==typeof I&&!isNaN(I)&&(B=I/V.ofdCore.pageWidth(A,0)*25.4);var Q=new s.Ofd_Core_Helper(B);g.waterText?Q.setWaterText(g.waterText):V.waterText&&Q.setWaterText(V.waterText),V.ofdRender?V.ofdRender.setDpi(B):V.ofdRender=new S.Ofd_Render(V.ofdCore,Q),g.mixBlendMode&&V.ofdRender.setMixBlendMode(g.mixBlendMode);var C=[];if(!V.ofdCore.readOfdDocument(A))return C;var E=V.ofdCore.getOFDPageCount(A);g.frontPages>0&&g.frontPages<E&&(E=g.frontPages);for(var D=0;D<E;D++){var i=document.createElement("div"),o=Q.pageRenderWidth(0,D,V.ofdCore),w=Q.pageRenderHeight(0,D,V.ofdCore);i.setAttribute("style","margin-bottom: 20px;position: relative;width:".concat(o,"px;height:").concat(w,"px;background: white;overflow: hidden")),V.ofdRender.renderPage(i,0,D),C.push(i)}return C},BA=function(A,I,g){var B=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},Q=96;g&&"number"==typeof g&&!isNaN(g)&&(Q=g/V.ofdCore.pageWidth(A,I)*25.4);var C=new s.Ofd_Core_Helper(Q);B.waterText?C.setWaterText(B.waterText):V.waterText&&C.setWaterText(V.waterText),V.ofdRender?V.ofdRender.setDpi(Q):V.ofdRender=new S.Ofd_Render(V.ofdCore,C),B.mixBlendMode&&V.ofdRender.setMixBlendMode(B.mixBlendMode);var E=document.createElement("div"),D=C.pageRenderWidth(0,I,V.ofdCore),i=C.pageRenderHeight(0,I,V.ofdCore);return E.setAttribute("style","position: relative;width:".concat(D,"px;height:").concat(i,"px;overflow: hidden")),V.ofdRender.renderPage(E,0,I),E},QA=function(A){if(f)Object(k.setYYDS)(f),A&&A();else{Object(k.needInitAgain)()||A&&(A(),A=null);document.getElementsByTagName("meta").ofdwasm;K()({locateFile:function(){return H.wsdsb}}).then((function(I){var g=I.Module;Object(k.setYYDS)(g),A&&A()}))}},CA=function(){return Object(k.getStreamData)()},EA=function(A){V.viewer.toolbar&&V.viewer.toolbar.setLanguage(A)},DA=function(A){if(A.loadingContainer){if(A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);A.container.appendChild(A.loadingContainer)}V.ofdCore&&(V.eventBus=new i.EventBus,V.eventBus._on("pageFinishRender",A.pageFinishRenderCallback),new t.OfdBaseViewer(A.container,A.width,V.eventBus,V.waterText).setOfdCore(V.ofdCore))},iA=function(A){setTimeout((function(){if(A.loadingContainer){if(A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);A.container.appendChild(A.loadingContainer)}O({ofd:A.ofd,secret:A.secret,digest:A.digest,headers:A.headers,signatureClickCallback:A.signatureClickCallback,signaturesCallback:A.signaturesCallback,waterText:A.waterText,success:function(I){A.parserOFDSuccess&&A.parserOFDSuccess(I),new t.OfdBaseViewer(A.container,A.width,V.eventBus,V.waterText).setOfdCore(I),A.renderOFDCallback&&A.renderOFDCallback()},fail:function(I){if(A.parserOFDFail&&A.parserOFDFail(I),A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);var g=document.createElement("div");g.classList.add("error"),g.textContent=I,A.container.appendChild(g)}})}),200)},oA=function(A){if(A.loadingContainer){if(A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);A.container.appendChild(A.loadingContainer)}u({ofd:A.ofd,secret:A.secret,digest:A.digest,signatureClickCallback:A.signatureClickCallback,signaturesCallback:A.signaturesCallback,waterText:A.waterText,success:function(I){A.parserOFDSuccess&&A.parserOFDSuccess(I.ofd),new t.OfdBaseViewer(A.container,A.width,V.eventBus,V.waterText).setOfdCore(I)},fail:function(I){if(A.parserOFDFail&&A.parserOFDFail(I),A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);var g=document.createElement("div");g.textContent=I,A.container.appendChild(g)}})},wA=function(A){var I=V.ofdCore.findSignature(0,A.pageRef,A.signatureId),g={signer:I.SignCert.subject,provider:I.SignedInfo.Provider.ProviderName,hashedValue:I.HashHex,HashValid:I.HashValid,signedValue:I.signatureHex,signMethod:I.SignedInfo.SignatureMethod,signVersion:I.SignedInfo.Seal.esVersion,signatureVerify:I.SignatureValid,sealID:I.SignedInfo.Seal.esID,sealName:I.SignedInfo.Seal.Property.name,sealType:I.SignedInfo.Seal.Property.type,sealAuthTime:"".concat(I.SignedInfo.Seal.Property.validStart," 至 ").concat(I.SignedInfo.Seal.Property.validEnd),sealMakeTime:I.SignedInfo.Seal.Property.createDate,sealVersion:I.SignedInfo.Seal.Header.version};A.signatureCallback&&A.signatureCallback(g),setTimeout((function(){var g,B="",Q=r(I.SignedInfo.References);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;B+="".concat(Object(d.replaceFirstSlash)(C.FileRef),"|")}}catch(A){Q.e(A)}finally{Q.f()}var E,D=Object(k.hashPath)(V.ofdCore.ofdParserPtr,B,I.SignedInfo.ReferencesCheckMethod.toLowerCase()),i=!0,o=r(I.SignedInfo.References);try{for(o.s();!(E=o.n()).done;){var w=E.value,G=w.CheckValue,F=D["".concat(Object(d.replaceFirstSlash)(w.FileRef))];i&=G===F}}catch(A){o.e(A)}finally{o.f()}A.hashFileCallback&&A.hashFileCallback(1===i)}),200)},GA=function(){V.viewer.ofdPrint&&nA()},FA=function(){return V.viewer.eventBus},NA=function(A){yA(A)},yA=function(A){var I;V.viewer&&((I=V.viewer.eventBus)._off("resize",KA),I._off("fileinputchange",HA),I._off("openfile",cA),I._off("nextpage",tA),I._off("previouspage",dA),I._off("pagenumberchanged",ZA),I._off("pagechanging",eA),I._off("print",nA),I._off("firstpage",JA),I._off("lastpage",LA),I._off("zoomin",lA),I._off("zoomout",qA),I._off("scalechanging",rA),I._off("scalechanged",xA),I._off("viewportchanging",WA),I._off("switchspreadmode",fA),I._off("scrollmodechanged",VA),I._off("switchscrollmode",bA),I._off("rotatecw",pA),I._off("rotateccw",mA),I._off("documentproperties",TA),I._off("signatureclick",jA),I._off("attachmentclick",OA),I._off("customtagclick",zA),I._off("download",sA),I._off("langchanged",SA),I._off("pageViewerClick",uA),I._off("closePage",kA),I._off("printCallback",aA),I._off("printFinishCallback",YA)),V.viewer=new UA(A)},RA=function(A){MA(A)},hA=function(A){V.viewer&&(A?(V.viewer.config.openFileTip&&(V.viewer.config.openFileTip.hidden=!0),V.viewer.ofdViewer.freeDocument(),V.viewer.config.loadingContainer&&V.viewer.ofdViewer.viewer.appendChild(V.viewer.config.loadingContainer),u({ofd:A,secret:V.viewer.config.secret,digest:V.viewer.config.digest,waterText:V.viewer.config.waterText,success:function(A){if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){V.viewer.config.errorWrapper.moreInfoButton.hidden=!0,V.viewer.config.errorWrapper.container.hidden=!1;var I=A.leftTime/864e5,g=A.leftTime%864e5/36e5,B=A.leftTime%36e5/6e4,Q=A.leftTime%6e4/1e3;V.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(I),"天").concat(Math.floor(g),"小时").concat(Math.floor(B),"分").concat(Math.floor(Q),"秒"),V.viewer.config.exceedTimeLimit&&V.viewer.config.exceedTimeLimit()}V.viewer.config.parserOFDSuccess&&V.viewer.config.parserOFDSuccess(A.ofd),V.ofdCore=A,V.viewer.ofdViewer.setWaterText(V.waterText),V.viewer.ofdViewer.setWaterSetting(V.viewer.config.waterSetting),V.viewer.ofdViewer.setOfdCore(A),V.viewer.ofdThumbnailViewer&&V.viewer.ofdThumbnailViewer.setOfdCore(A),V.viewer.ofdSignatureViewer.setOfdCore(A,V.viewer.config.signatureViewerForceCheck),V.viewer.ofdAttachmentViewer.setOfdCore(A),V.viewer.ofdCustomTagViewer.setOfdCore(A),V.viewer.config.signaturesCallback&&V.viewer.config.signaturesCallback(A.getAllSignature(0)),V.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),V.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),V.viewer.config.sidebarForceOpen&&setTimeout((function(){V.viewer.pdfSidebar.open()}),500)},fail:function(A){V.viewer.config.parserOFDFail&&V.viewer.config.parserOFDFail(A),V.viewer.ofdViewer.freeDocument(),V.viewer.config.errorWrapper.moreInfoButton.hidden=!0,V.viewer.config.errorWrapper.container.hidden=!1,V.viewer.config.errorWrapper.errorMessage.textContent=A}})):V.viewer.config.parserOFDFail&&V.viewer.config.parserOFDFail("file undefined"))},MA=function(A){V.viewer&&(A?(V.viewer.config.openFileTip&&(V.viewer.config.openFileTip.hidden=!0),V.viewer.ofdViewer.freeDocument(),V.viewer.config.loadingContainer&&V.viewer.ofdViewer.viewer.appendChild(V.viewer.config.loadingContainer),O({ofd:A,secret:V.viewer.config.secret,digest:V.viewer.config.digest,waterText:V.viewer.config.waterText,success:function(A){if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){V.viewer.config.errorWrapper.moreInfoButton.hidden=!0,V.viewer.config.errorWrapper.container.hidden=!1;var I=A.leftTime/864e5,g=A.leftTime%864e5/36e5,B=A.leftTime%36e5/6e4,Q=A.leftTime%6e4/1e3;V.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(I),"天").concat(Math.floor(g),"小时").concat(Math.floor(B),"分").concat(Math.floor(Q),"秒"),V.viewer.config.exceedTimeLimit&&V.viewer.config.exceedTimeLimit()}V.viewer.config.parserOFDSuccess&&V.viewer.config.parserOFDSuccess(A.ofd),V.ofdCore=A,V.viewer.ofdViewer.setWaterText(V.waterText),V.viewer.ofdViewer.setWaterSetting(V.viewer.config.waterSetting),V.viewer.ofdViewer.setOfdCore(A),V.viewer.ofdThumbnailViewer&&V.viewer.ofdThumbnailViewer.setOfdCore(A),V.viewer.ofdSignatureViewer.setOfdCore(A,V.viewer.config.signatureViewerForceCheck),V.viewer.ofdAttachmentViewer.setOfdCore(A),V.viewer.ofdCustomTagViewer.setOfdCore(A),V.viewer.config.signaturesCallback&&V.viewer.config.signaturesCallback(A.getAllSignature(0)),V.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),V.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),V.viewer.config.sidebarForceOpen&&setTimeout((function(){V.viewer.pdfSidebar.open()}),500)},fail:function(A){V.viewer.config.parserOFDFail&&V.viewer.config.parserOFDFail(A),V.viewer.ofdViewer.freeDocument(),V.viewer.config.errorWrapper.moreInfoButton.hidden=!0,V.viewer.config.errorWrapper.container.hidden=!1,V.viewer.config.errorWrapper.errorMessage.textContent=A}})):V.viewer.config.parserOFDFail&&V.viewer.config.parserOFDFail("file undefined"))},UA=Q()((function A(I){var g=this;E()(this,A),this.config=I,this.l10n=new D.GenericL10n("zh-CN"),this.eventBus=new i.EventBus,this.ofdViewer=new o.OfdViewer(I.mainContainer,I.viewerContainer,this.eventBus,I.mixBlendMode,I.defaultScale),I.sidebar.thumbnailView&&(this.ofdThumbnailViewer=new w.OfdThumbnailViewer(I.sidebar.thumbnailView,this.eventBus)),this.ofdSignatureViewer=new J.OfdSignatureViewer(I.sidebar.signaturesView,this.eventBus),this.ofdAttachmentViewer=new L.OfdAttachmentViewer(I.sidebar.attachmentsView,this.eventBus),this.ofdCustomTagViewer=new q.OfdCustomTagViewer(I.sidebar.outlineView,this.eventBus),this.pdfSidebar=new G.PDFSidebar({elements:I.sidebar,ofdViewer:this.ofdViewer,ofdThumbnailViewer:this.ofdThumbnailViewer,eventBus:this.eventBus,l10n:this.l10n}),this.overlayManager=new F.OverlayManager,I.signatureProperties&&(this.signatureProperties=new a.OFDSignatureProperties(I.signatureProperties,this.overlayManager,this.eventBus,this.l10n)),I.documentProperties&&(this.ofdDocumentProperties=new N.PDFDocumentProperties(I.documentProperties,this.overlayManager,this.eventBus,this.l10n)),this.toolbar=new y.Toolbar(I.toolbar,this.eventBus,this.l10n),this.secondaryToolbar=new R.SecondaryToolbar(I.secondaryToolbar,I.mainContainer,this.eventBus);var B=document.createElement("input");B.id="fileInput",B.className="fileInput",B.setAttribute("type","file"),B.setAttribute("accept",".ofd"),document.body.appendChild(B);var Q=this;B.addEventListener("click",(function(A){A.target.value=null})),B.addEventListener("change",(function(A){var I=A.target.files;I&&0!==I.length&&Q.eventBus.dispatch("fileinputchange",{source:this,fileInput:A.target,eventBus:Q.eventBus})})),new h.PDFCursorTools({container:I.mainContainer,eventBus:this.eventBus});var C=document.getElementById("printServiceDialog");C&&(this.ofdPrint=new M.Print(C,this.overlayManager,this.l10n,this.eventBus,I.onPrintContentCallback));var U=I.appContainer||document.documentElement;this.l10n.translate(U).then((function(){g.eventBus.dispatch("localized",{})})),this.eventBus._on("printCallback",aA),this.eventBus._on("printFinishCallback",YA),this.eventBus._on("resize",KA),this.eventBus._on("fileinputchange",HA),this.eventBus._on("openfile",cA),this.eventBus._on("nextpage",tA),this.eventBus._on("previouspage",dA),this.eventBus._on("pagenumberchanged",ZA),this.eventBus._on("pagechanging",eA),this.eventBus._on("print",nA),this.eventBus._on("firstpage",JA),this.eventBus._on("lastpage",LA),this.eventBus._on("zoomin",lA),this.eventBus._on("zoomout",qA),this.eventBus._on("scalechanging",rA),this.eventBus._on("viewportchanging",WA),this.eventBus._on("scalechanged",xA),this.eventBus._on("switchspreadmode",fA),this.eventBus._on("scrollmodechanged",VA),this.eventBus._on("switchscrollmode",bA),this.eventBus._on("rotatecw",pA),this.eventBus._on("rotateccw",mA),this.eventBus._on("documentproperties",TA),this.eventBus._on("signatureclick",jA),this.eventBus._on("attachmentclick",OA),this.eventBus._on("customtagclick",zA),this.eventBus._on("download",sA),this.eventBus._on("langchanged",SA),this.eventBus._on("pageViewerClick",uA),this.eventBus._on("closePage",kA),window.addEventListener("click",XA),window.addEventListener("resize",(function(){g.eventBus.dispatch("resize",{source:window})})),I.errorWrapper.closeButton.onclick=function(){I.errorWrapper.container.hidden=!0},I.toolbar.presentationModeButton&&(I.toolbar.presentationModeButton.hidden=!0),I.toolbar.viewBookmark&&(I.toolbar.viewBookmark.hidden=!0),I.secondaryToolbar.presentationModeButton&&(I.secondaryToolbar.presentationModeButton.hidden=!0),I.secondaryToolbar.viewBookmarkButton&&(I.secondaryToolbar.viewBookmarkButton.hidden=!0),I.secondaryToolbar.viewBookmarkButton&&(I.secondaryToolbar.viewBookmarkButton.hidden=!0),C&&"function"!=typeof C.showModal&&(C&&(C.hidden=!0),I.documentProperties&&I.documentProperties.dialog&&(I.documentProperties.dialog.hidden=!0),I.signatureProperties&&I.signatureProperties.dialog&&(I.signatureProperties.dialog.hidden=!0))}));function cA(){document.getElementById("fileInput").click()}function kA(){V.viewer.config.closeCallback&&V.viewer.config.closeCallback()}function SA(A){V.viewer.l10n.setLanguage(A.value),V.viewer.l10n.translate(V.viewer.appContainer).then((function(){V.viewer.eventBus.dispatch("localized",{})}))}function sA(){var A=Object(k.getStreamData)();if(A){if(V.viewer.config.downloadCallback)V.viewer.config.downloadCallback(new Blob([A]));else{var I=window.URL.createObjectURL(new Blob([A])),g=document.createElement("a");g.style.display="none",g.href=I,g.setAttribute("download",V.fileName),document.body.append(g),g.click()}V.viewer.config.downloadFinishEvent&&V.viewer.config.downloadFinishEvent()}}function aA(A){V.viewer.config.onPrintContentCallback&&V.viewer.config.onPrintContentCallback(A.html)}function YA(A){V.viewer.config.onPrintFinishEvent&&V.viewer.config.onPrintFinishEvent()}function KA(){var A=V.ofdCore,I=V.viewer;if(A){var g=I.ofdViewer.currentScaleValue;"auto"!==g&&"page-fit"!==g&&"page-width"!==g||(I.ofdViewer.currentScaleValue=g),V.viewer.eventBus.dispatch("stampResize",{source:null})}}function HA(A){V.viewer.config.openFileTip&&(V.viewer.config.openFileTip.hidden=!0),V.viewer.pdfSidebar.isOpen&&V.viewer.pdfSidebar.close();var I=A.fileInput.files[0];V.fileName=I.name,V.viewer.ofdViewer.freeDocument(),V.viewer.config.loadingContainer&&V.viewer.ofdViewer.viewer.appendChild(V.viewer.config.loadingContainer);(new Date).getTime();O({ofd:I,secret:V.viewer.config.secret,digest:V.viewer.config.digest,waterText:V.viewer.config.waterText,success:function(A){(new Date).getTime();if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){V.viewer.config.errorWrapper.moreInfoButton.hidden=!0,V.viewer.config.errorWrapper.container.hidden=!1;var I=A.leftTime/864e5,g=A.leftTime%864e5/36e5,B=A.leftTime%36e5/6e4,Q=A.leftTime%6e4/1e3;V.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(I),"天").concat(Math.floor(g),"小时").concat(Math.floor(B),"分").concat(Math.floor(Q),"秒"),V.viewer.config.exceedTimeLimit&&V.viewer.config.exceedTimeLimit()}V.viewer.config.parserOFDSuccess&&V.viewer.config.parserOFDSuccess(A.ofd),V.ofdCore=A,V.viewer.ofdViewer.setWaterText(V.waterText),V.viewer.ofdViewer.setWaterSetting(V.viewer.config.waterSetting),V.viewer.ofdViewer.setOfdCore(A),V.viewer.ofdThumbnailViewer&&V.viewer.ofdThumbnailViewer.setOfdCore(A),V.viewer.config.signaturesCallback&&V.viewer.config.signaturesCallback(A.getAllSignature(0)),V.viewer.ofdSignatureViewer.setOfdCore(A,V.viewer.config.signatureViewerForceCheck),V.viewer.ofdAttachmentViewer.setOfdCore(A),V.viewer.ofdCustomTagViewer.setOfdCore(A),V.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),V.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),V.viewer.config.sidebarForceOpen&&setTimeout((function(){V.viewer.pdfSidebar.open()}),500)},fail:function(A){V.viewer.config.parserOFDFail&&V.viewer.config.parserOFDFail(A),V.viewer.ofdViewer.freeDocument(),V.viewer.config.errorWrapper.moreInfoButton.hidden=!0,V.viewer.config.errorWrapper.container.hidden=!1,V.viewer.config.errorWrapper.errorMessage.textContent=A}})}function JA(){V.viewer.ofdViewer.firstPage()}function LA(){V.viewer.ofdViewer.lastPage()}function tA(){V.viewer.ofdViewer.nextPage()}function dA(){V.viewer.ofdViewer.previousPage()}function ZA(A){""!==A.value&&A.source.eventBus.dispatch("jumpPage",{source:A.source,pageIndex:A.value}),V.viewer.toolbar.setPageNumber(A.value,null),V.viewer.secondaryToolbar.setPageNumber(A.value,null)}function eA(A){var I=A.pageNumber;V.viewer.toolbar.setPageNumber(I,null),V.viewer.secondaryToolbar.setPageNumber(I,null),V.viewer.pdfSidebar.isThumbnailViewVisible&&V.viewer.ofdThumbnailViewer.scrollThumbnailIntoView(I),V.viewer.config.onPageChanging&&V.viewer.config.onPageChanging(I)}function nA(){V.viewer.ofdPrint.setOfdCore(V.ofdCore),V.viewer.ofdPrint.open()}function lA(){V.viewer.ofdViewer.increaseScale()}function qA(){V.viewer.ofdViewer.decreaseScale()}function rA(A){V.viewer.toolbar.setPageScale(A.presetValue,A.scale),V.viewer.config.onPageScale&&V.viewer.config.onPageScale(A.scale)}function WA(A){V.viewer.config.onViewportChange&&V.viewer.config.onViewportChange(V.viewer.ofdViewer)}function xA(A){V.viewer.ofdViewer.zoom(A.value)}function fA(A){V.viewer.ofdViewer.setSpreadMode(A.mode)}function VA(A){}function bA(A){V.viewer.ofdViewer.setScrollMode(A.mode)}function pA(){V.viewer.ofdViewer.setRotation(90)}function mA(){V.viewer.ofdViewer.setRotation(-90)}function TA(){V.viewer.ofdDocumentProperties.setOfdCore(V.ofdCore),V.viewer.ofdDocumentProperties.open()}function XA(A){V.viewer.secondaryToolbar.isOpen&&(V.viewer.config.mainContainer.contains(A.target)||V.viewer.config.toolbar.container.contains(A.target)&&A.target!==V.viewer.config.secondaryToolbar.toggleButton)&&V.viewer.secondaryToolbar.close()}function jA(A){if(V.viewer.signatureProperties)if(V.viewer.signatureProperties.setOfdCore(V.ofdCore),A.pageRef||A.signatureId){var I=V.ofdCore.findSignature(0,A.pageRef,A.signatureId);V.viewer.signatureProperties.open(I)}else V.viewer.signatureProperties.open(A.sign.Signature)}function OA(A){var I=A.attachment.FileLocAbs.split("/"),g=A.attachment.Name;g||(g=I[I.length-1]),g.indexOf(".")<0&&(g="".concat(g,".").concat(A.attachment.Format)),PA(A.attachment.FileLocAbs).then((function(A){var I=window.URL.createObjectURL(new Blob([A])),B=document.createElement("a");B.style.display="none",B.href=I,B.setAttribute("download",g),document.body.append(B),B.click()})).catch((function(A){}))}function uA(A){V.viewer.ofdViewer&&V.viewer.ofdViewer.removeHighLight()}function zA(A){A.source.eventBus.dispatch("jumpPage",{source:A.source,pageIndex:A.pageIndex+1,eleIdArray:A.eleIdArray}),V.viewer.toolbar.setPageNumber(A.pageIndex+1,null),V.viewer.secondaryToolbar.setPageNumber(A.pageIndex+1,null)}function PA(A){return new Promise((function(I,g){Object(k.getStreamData)()&&I(Object(k.JSGetPathEncode)(V.ofdCore.ofdParserPtr,A))}))}},function(A,I,g){var B=g(2);function Q(A,I){for(var g=0;g<I.length;g++){var Q=I[g];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(A,B(Q.key),Q)}}A.exports=function(A,I,g){return I&&Q(A.prototype,I),g&&Q(A,g),Object.defineProperty(A,"prototype",{writable:!1}),A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(3).default,Q=g(4);A.exports=function(A){var I=Q(A,"string");return"symbol"===B(I)?I:String(I)},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){function g(I){return A.exports=g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},A.exports.__esModule=!0,A.exports.default=A.exports,g(I)}A.exports=g,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(3).default;A.exports=function(A,I){if("object"!==B(A)||null===A)return A;var g=A[Symbol.toPrimitive];if(void 0!==g){var Q=g.call(A,I||"default");if("object"!==B(Q))return Q;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===I?String:Number)(A)},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"GenericL10n",(function(){return N}));var B=g(7),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(8),w=g.n(o),G=(g(10),g(11)),F=document.webL10n,N=function(){function A(I){E()(this,A),this._lang=I,this._ready=new Promise((function(A,g){F.setLanguage(Object(G.fixupLangCode)(I),(function(){A(F)}))}))}var I,g,B,C,D;return i()(A,[{key:"setLanguage",value:(D=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:this._lang=I,this._ready=new Promise((function(A,g){F.setLanguage(Object(G.fixupLangCode)(I),(function(){A(F)}))}));case 2:case"end":return A.stop()}}),A,this)}))),function(A){return D.apply(this,arguments)})},{key:"getLanguage",value:(C=Q()(w.a.mark((function A(){var I;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this._ready;case 2:return I=A.sent,A.abrupt("return",I.getLanguage());case 4:case"end":return A.stop()}}),A,this)}))),function(){return C.apply(this,arguments)})},{key:"getDirection",value:(B=Q()(w.a.mark((function A(){var I;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this._ready;case 2:return I=A.sent,A.abrupt("return",I.getDirection());case 4:case"end":return A.stop()}}),A,this)}))),function(){return B.apply(this,arguments)})},{key:"get",value:(g=Q()(w.a.mark((function A(I){var g,B,Q,C=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return g=C.length>1&&void 0!==C[1]?C[1]:null,B=C.length>2&&void 0!==C[2]?C[2]:Object(G.getL10nFallback)(I,g),A.next=4,this._ready;case 4:return Q=A.sent,A.abrupt("return",Q.get(I,g,B));case 6:case"end":return A.stop()}}),A,this)}))),function(A){return g.apply(this,arguments)})},{key:"translate",value:(I=Q()(w.a.mark((function A(I){var g;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this._ready;case 2:return g=A.sent,A.abrupt("return",g.translate(I));case 4:case"end":return A.stop()}}),A,this)}))),function(A){return I.apply(this,arguments)})}]),A}()},function(A,I){function g(A,I,g,B,Q,C,E){try{var D=A[C](E),i=D.value}catch(A){return void g(A)}D.done?I(i):Promise.resolve(i).then(B,Q)}A.exports=function(A){return function(){var I=this,B=arguments;return new Promise((function(Q,C){var E=A.apply(I,B);function D(A){g(E,Q,C,D,i,"next",A)}function i(A){g(E,Q,C,D,i,"throw",A)}D(void 0)}))}},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(9)();A.exports=B;try{regeneratorRuntime=B}catch(A){"object"==typeof globalThis?globalThis.regeneratorRuntime=B:Function("r","regeneratorRuntime = r")(B)}},function(A,I,g){var B=g(3).default;function Q(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */A.exports=Q=function(){return g},A.exports.__esModule=!0,A.exports.default=A.exports;var I,g={},C=Object.prototype,E=C.hasOwnProperty,D=Object.defineProperty||function(A,I,g){A[I]=g.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",w=i.asyncIterator||"@@asyncIterator",G=i.toStringTag||"@@toStringTag";function F(A,I,g){return Object.defineProperty(A,I,{value:g,enumerable:!0,configurable:!0,writable:!0}),A[I]}try{F({},"")}catch(I){F=function(A,I,g){return A[I]=g}}function N(A,I,g,B){var Q=I&&I.prototype instanceof k?I:k,C=Object.create(Q.prototype),E=new n(B||[]);return D(C,"_invoke",{value:t(A,g,E)}),C}function y(A,I,g){try{return{type:"normal",arg:A.call(I,g)}}catch(A){return{type:"throw",arg:A}}}g.wrap=N;var R="suspendedStart",h="suspendedYield",M="executing",U="completed",c={};function k(){}function S(){}function s(){}var a={};F(a,o,(function(){return this}));var Y=Object.getPrototypeOf,K=Y&&Y(Y(l([])));K&&K!==C&&E.call(K,o)&&(a=K);var H=s.prototype=k.prototype=Object.create(a);function J(A){["next","throw","return"].forEach((function(I){F(A,I,(function(A){return this._invoke(I,A)}))}))}function L(A,I){function g(Q,C,D,i){var o=y(A[Q],A,C);if("throw"!==o.type){var w=o.arg,G=w.value;return G&&"object"==B(G)&&E.call(G,"__await")?I.resolve(G.__await).then((function(A){g("next",A,D,i)}),(function(A){g("throw",A,D,i)})):I.resolve(G).then((function(A){w.value=A,D(w)}),(function(A){return g("throw",A,D,i)}))}i(o.arg)}var Q;D(this,"_invoke",{value:function(A,B){function C(){return new I((function(I,Q){g(A,B,I,Q)}))}return Q=Q?Q.then(C,C):C()}})}function t(A,g,B){var Q=R;return function(C,E){if(Q===M)throw new Error("Generator is already running");if(Q===U){if("throw"===C)throw E;return{value:I,done:!0}}for(B.method=C,B.arg=E;;){var D=B.delegate;if(D){var i=d(D,B);if(i){if(i===c)continue;return i}}if("next"===B.method)B.sent=B._sent=B.arg;else if("throw"===B.method){if(Q===R)throw Q=U,B.arg;B.dispatchException(B.arg)}else"return"===B.method&&B.abrupt("return",B.arg);Q=M;var o=y(A,g,B);if("normal"===o.type){if(Q=B.done?U:h,o.arg===c)continue;return{value:o.arg,done:B.done}}"throw"===o.type&&(Q=U,B.method="throw",B.arg=o.arg)}}}function d(A,g){var B=g.method,Q=A.iterator[B];if(Q===I)return g.delegate=null,"throw"===B&&A.iterator.return&&(g.method="return",g.arg=I,d(A,g),"throw"===g.method)||"return"!==B&&(g.method="throw",g.arg=new TypeError("The iterator does not provide a '"+B+"' method")),c;var C=y(Q,A.iterator,g.arg);if("throw"===C.type)return g.method="throw",g.arg=C.arg,g.delegate=null,c;var E=C.arg;return E?E.done?(g[A.resultName]=E.value,g.next=A.nextLoc,"return"!==g.method&&(g.method="next",g.arg=I),g.delegate=null,c):E:(g.method="throw",g.arg=new TypeError("iterator result is not an object"),g.delegate=null,c)}function Z(A){var I={tryLoc:A[0]};1 in A&&(I.catchLoc=A[1]),2 in A&&(I.finallyLoc=A[2],I.afterLoc=A[3]),this.tryEntries.push(I)}function e(A){var I=A.completion||{};I.type="normal",delete I.arg,A.completion=I}function n(A){this.tryEntries=[{tryLoc:"root"}],A.forEach(Z,this),this.reset(!0)}function l(A){if(A||""===A){var g=A[o];if(g)return g.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length)){var Q=-1,C=function g(){for(;++Q<A.length;)if(E.call(A,Q))return g.value=A[Q],g.done=!1,g;return g.value=I,g.done=!0,g};return C.next=C}}throw new TypeError(B(A)+" is not iterable")}return S.prototype=s,D(H,"constructor",{value:s,configurable:!0}),D(s,"constructor",{value:S,configurable:!0}),S.displayName=F(s,G,"GeneratorFunction"),g.isGeneratorFunction=function(A){var I="function"==typeof A&&A.constructor;return!!I&&(I===S||"GeneratorFunction"===(I.displayName||I.name))},g.mark=function(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,s):(A.__proto__=s,F(A,G,"GeneratorFunction")),A.prototype=Object.create(H),A},g.awrap=function(A){return{__await:A}},J(L.prototype),F(L.prototype,w,(function(){return this})),g.AsyncIterator=L,g.async=function(A,I,B,Q,C){void 0===C&&(C=Promise);var E=new L(N(A,I,B,Q),C);return g.isGeneratorFunction(I)?E:E.next().then((function(A){return A.done?A.value:E.next()}))},J(H),F(H,G,"Generator"),F(H,o,(function(){return this})),F(H,"toString",(function(){return"[object Generator]"})),g.keys=function(A){var I=Object(A),g=[];for(var B in I)g.push(B);return g.reverse(),function A(){for(;g.length;){var B=g.pop();if(B in I)return A.value=B,A.done=!1,A}return A.done=!0,A}},g.values=l,n.prototype={constructor:n,reset:function(A){if(this.prev=0,this.next=0,this.sent=this._sent=I,this.done=!1,this.delegate=null,this.method="next",this.arg=I,this.tryEntries.forEach(e),!A)for(var g in this)"t"===g.charAt(0)&&E.call(this,g)&&!isNaN(+g.slice(1))&&(this[g]=I)},stop:function(){this.done=!0;var A=this.tryEntries[0].completion;if("throw"===A.type)throw A.arg;return this.rval},dispatchException:function(A){if(this.done)throw A;var g=this;function B(B,Q){return D.type="throw",D.arg=A,g.next=B,Q&&(g.method="next",g.arg=I),!!Q}for(var Q=this.tryEntries.length-1;Q>=0;--Q){var C=this.tryEntries[Q],D=C.completion;if("root"===C.tryLoc)return B("end");if(C.tryLoc<=this.prev){var i=E.call(C,"catchLoc"),o=E.call(C,"finallyLoc");if(i&&o){if(this.prev<C.catchLoc)return B(C.catchLoc,!0);if(this.prev<C.finallyLoc)return B(C.finallyLoc)}else if(i){if(this.prev<C.catchLoc)return B(C.catchLoc,!0)}else{if(!o)throw new Error("try statement without catch or finally");if(this.prev<C.finallyLoc)return B(C.finallyLoc)}}}},abrupt:function(A,I){for(var g=this.tryEntries.length-1;g>=0;--g){var B=this.tryEntries[g];if(B.tryLoc<=this.prev&&E.call(B,"finallyLoc")&&this.prev<B.finallyLoc){var Q=B;break}}Q&&("break"===A||"continue"===A)&&Q.tryLoc<=I&&I<=Q.finallyLoc&&(Q=null);var C=Q?Q.completion:{};return C.type=A,C.arg=I,Q?(this.method="next",this.next=Q.finallyLoc,c):this.complete(C)},complete:function(A,I){if("throw"===A.type)throw A.arg;return"break"===A.type||"continue"===A.type?this.next=A.arg:"return"===A.type?(this.rval=this.arg=A.arg,this.method="return",this.next="end"):"normal"===A.type&&I&&(this.next=I),c},finish:function(A){for(var I=this.tryEntries.length-1;I>=0;--I){var g=this.tryEntries[I];if(g.finallyLoc===A)return this.complete(g.completion,g.afterLoc),e(g),c}},catch:function(A){for(var I=this.tryEntries.length-1;I>=0;--I){var g=this.tryEntries[I];if(g.tryLoc===A){var B=g.completion;if("throw"===B.type){var Q=B.arg;e(g)}return Q}}throw new Error("illegal catch attempt")},delegateYield:function(A,g,B){return this.delegate={iterator:l(A),resultName:g,nextLoc:B},"next"===this.method&&(this.arg=I),c}},g}A.exports=Q,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";document.webL10n=function(A,I,g){var B={},Q="",C="textContent",E="",D={},i="loading",o=!0;function w(A,I,g){I=I||function(A){},g=g||function(){};var B=new XMLHttpRequest;B.open("GET",A,o),B.overrideMimeType&&B.overrideMimeType("text/plain; charset=utf-8"),B.onreadystatechange=function(){4==B.readyState&&(200==B.status||0===B.status?I(B.responseText):g())},B.onerror=g,B.ontimeout=g;try{B.send(null)}catch(A){g()}}function G(A,I,g,E){var D=A.replace(/[^\/]*$/,"")||"./";function i(A){return A.lastIndexOf("\\")<0?A:A.replace(/\\\\/g,"\\").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}w(A,(function(A){Q+=A,function(A,g){var B={},Q=/^\s*|\s*$/,C=/^\s*#|^\s*$/,E=/^\s*\[(.*)\]\s*$/,o=/^\s*@import\s+url\((.*)\)\s*$/i,G=/^([^=\s]*)\s*=\s*(.+)$/;function F(A,g,w){var F=A.replace(Q,"").split(/[\r\n]+/),y="*",R=I.split("-",1)[0],h=!1,M="";!function A(){for(;;){if(!F.length)return void w();var Q=F.shift();if(!C.test(Q)){if(g){if(M=E.exec(Q)){y=M[1].toLowerCase(),h="*"!==y&&y!==I&&y!==R;continue}if(h)continue;if(M=o.exec(Q))return void N(D+M[1],A)}var U=Q.match(G);U&&3==U.length&&(B[U[1]]=i(U[2]))}}}()}function N(A,I){w(A,(function(A){F(A,!1,I)}),(function(){I()}))}F(A,!0,(function(){g(B)}))}(A,(function(A){for(var I in A){var Q,E,D=I.lastIndexOf(".");D>0?(Q=I.substring(0,D),E=I.substring(D+1)):(Q=I,E=C),B[Q]||(B[Q]={}),B[Q][E]=A[I]}g&&g()}))}),E)}function F(A,g){A&&(A=A.toLowerCase()),g=g||function(){},B={},Q="",E="",E=A;var C=I.querySelectorAll('link[type="application/l10n"]'),D=C.length;if(0!==D){var o,w,F=0;w=function(){++F>=D&&(g(),i="complete")};for(var N=0;N<D;N++){new M(C[N]).load(A,w)}}else{var y=(o=I.querySelector('script[type="application/l10n"]'))?JSON.parse(o.innerHTML):null;if(y&&y.locales&&y.default_locale){if(!(B=y.locales[A])){var R=y.default_locale.toLowerCase();for(var h in y.locales){if((h=h.toLowerCase())===A){B=y.locales[A];break}h===R&&(B=y.locales[R])}}g()}i="complete"}function M(A){var I=A.href;this.load=function(A,g){G(I,A,g,(function(){E="",g()}))}}}function N(A,I,g){var Q=B[A];if(!Q){if(!g)return null;Q=g}var C={};for(var E in Q){var D=Q[E];D=R(D=y(D,I,A,E),I,A),C[E]=D}return C}function y(A,I,g,Q){var C=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/.exec(A);if(!C||!C.length)return A;var E,i=C[1],o=C[2];(I&&o in I?E=I[o]:o in B&&(E=B[o]),i in D)&&(A=(0,D[i])(A,E,g,Q));return A}function R(A,I,g){return A.replace(/\{\{\s*(.+?)\s*\}\}/g,(function(A,g){return I&&g in I?I[g]:g in B?B[g]:A}))}function h(A){var g=function(A){if(!A)return{};var I=A.getAttribute("data-l10n-id"),g=A.getAttribute("data-l10n-args"),B={};if(g)try{B=JSON.parse(g)}catch(A){}return{id:I,args:B}}(A);if(g.id){var B=N(g.id,g.args);if(B){if(B[C]){if(0===function(A){if(A.children)return A.children.length;if(void 0!==A.childElementCount)return A.childElementCount;for(var I=0,g=0;g<A.childNodes.length;g++)I+=1===A.nodeType?1:0;return I}(A))A[C]=B[C];else{for(var Q=A.childNodes,E=!1,D=0,i=Q.length;D<i;D++)3===Q[D].nodeType&&/\S/.test(Q[D].nodeValue)&&(E?Q[D].nodeValue="":(Q[D].nodeValue=B[C],E=!0));if(!E){var o=I.createTextNode(B[C]);A.insertBefore(o,A.firstChild)}}delete B[C]}for(var w in B)A[w]=B[w]}}}return D.plural=function(A,I,g,Q){var i=parseFloat(I);if(isNaN(i))return A;if(Q!=C)return A;D._pluralRules||(D._pluralRules=function(A){function I(A,I){return-1!==I.indexOf(A)}function g(A,I,g){return I<=A&&A<=g}var B={0:function(A){return"other"},1:function(A){return g(A%100,3,10)?"few":0===A?"zero":g(A%100,11,99)?"many":2==A?"two":1==A?"one":"other"},2:function(A){return 0!==A&&A%10==0?"many":2==A?"two":1==A?"one":"other"},3:function(A){return 1==A?"one":"other"},4:function(A){return g(A,0,1)?"one":"other"},5:function(A){return g(A,0,2)&&2!=A?"one":"other"},6:function(A){return 0===A?"zero":A%10==1&&A%100!=11?"one":"other"},7:function(A){return 2==A?"two":1==A?"one":"other"},8:function(A){return g(A,3,6)?"few":g(A,7,10)?"many":2==A?"two":1==A?"one":"other"},9:function(A){return 0===A||1!=A&&g(A%100,1,19)?"few":1==A?"one":"other"},10:function(A){return g(A%10,2,9)&&!g(A%100,11,19)?"few":A%10!=1||g(A%100,11,19)?"other":"one"},11:function(A){return g(A%10,2,4)&&!g(A%100,12,14)?"few":A%10==0||g(A%10,5,9)||g(A%100,11,14)?"many":A%10==1&&A%100!=11?"one":"other"},12:function(A){return g(A,2,4)?"few":1==A?"one":"other"},13:function(A){return g(A%10,2,4)&&!g(A%100,12,14)?"few":1!=A&&g(A%10,0,1)||g(A%10,5,9)||g(A%100,12,14)?"many":1==A?"one":"other"},14:function(A){return g(A%100,3,4)?"few":A%100==2?"two":A%100==1?"one":"other"},15:function(A){return 0===A||g(A%100,2,10)?"few":g(A%100,11,19)?"many":1==A?"one":"other"},16:function(A){return A%10==1&&11!=A?"one":"other"},17:function(A){return 3==A?"few":0===A?"zero":6==A?"many":2==A?"two":1==A?"one":"other"},18:function(A){return 0===A?"zero":g(A,0,2)&&0!==A&&2!=A?"one":"other"},19:function(A){return g(A,2,10)?"few":g(A,0,1)?"one":"other"},20:function(A){return!g(A%10,3,4)&&A%10!=9||g(A%100,10,19)||g(A%100,70,79)||g(A%100,90,99)?A%1e6==0&&0!==A?"many":A%10!=2||I(A%100,[12,72,92])?A%10!=1||I(A%100,[11,71,91])?"other":"one":"two":"few"},21:function(A){return 0===A?"zero":1==A?"one":"other"},22:function(A){return g(A,0,1)||g(A,11,99)?"one":"other"},23:function(A){return g(A%10,1,2)||A%20==0?"one":"other"},24:function(A){return g(A,3,10)||g(A,13,19)?"few":I(A,[2,12])?"two":I(A,[1,11])?"one":"other"}},Q={af:3,ak:4,am:4,ar:1,asa:3,az:0,be:11,bem:3,bez:3,bg:3,bh:4,bm:0,bn:3,bo:0,br:20,brx:3,bs:11,ca:3,cgg:3,chr:3,cs:12,cy:17,da:3,de:3,dv:3,dz:0,ee:3,el:3,en:3,eo:3,es:3,et:3,eu:3,fa:0,ff:5,fi:3,fil:4,fo:3,fr:5,fur:3,fy:3,ga:8,gd:24,gl:3,gsw:3,gu:3,guw:4,gv:23,ha:3,haw:3,he:2,hi:4,hr:11,hu:0,id:0,ig:0,ii:0,is:3,it:3,iu:7,ja:0,jmc:3,jv:0,ka:0,kab:5,kaj:3,kcg:3,kde:0,kea:0,kk:3,kl:3,km:0,kn:0,ko:0,ksb:3,ksh:21,ku:3,kw:7,lag:18,lb:3,lg:3,ln:4,lo:0,lt:10,lv:6,mas:3,mg:4,mk:16,ml:3,mn:3,mo:9,mr:3,ms:0,mt:15,my:0,nah:3,naq:7,nb:3,nd:3,ne:3,nl:3,nn:3,no:3,nr:3,nso:4,ny:3,nyn:3,om:3,or:3,pa:3,pap:3,pl:13,ps:3,pt:3,rm:3,ro:9,rof:3,ru:11,rwk:3,sah:0,saq:3,se:7,seh:3,ses:0,sg:0,sh:11,shi:19,sk:12,sl:14,sma:7,smi:7,smj:7,smn:7,sms:7,sn:3,so:3,sq:3,sr:11,ss:3,ssy:3,st:3,sv:3,sw:3,syr:3,ta:3,te:3,teo:3,th:0,ti:4,tig:3,tk:3,tl:4,tn:3,to:0,tr:0,ts:3,tzm:22,uk:11,ur:3,ve:3,vi:0,vun:3,wa:4,wae:3,wo:0,xh:3,xog:3,yo:0,zh:0,zu:3}[A.replace(/-.*$/,"")];return Q in B?B[Q]:function(){return"other"}}(E));var o="["+D._pluralRules(i)+"]";return 0===i&&g+"[zero]"in B?A=B[g+"[zero]"][Q]:1==i&&g+"[one]"in B?A=B[g+"[one]"][Q]:2==i&&g+"[two]"in B?A=B[g+"[two]"][Q]:g+o in B?A=B[g+o][Q]:g+"[other]"in B&&(A=B[g+"[other]"][Q]),A},{get:function(A,I,g){var B,Q=A.lastIndexOf("."),E=C;Q>0&&(E=A.substring(Q+1),A=A.substring(0,Q)),g&&((B={})[E]=g);var D=N(A,I,B);return D&&E in D?D[E]:"{{"+A+"}}"},getData:function(){return B},getText:function(){return Q},getLanguage:function(){return E},setLanguage:function(A,I){F(A,(function(){I&&I()}))},getDirection:function(){var A=E.split("-",1)[0];return["ar","he","fa","ps","ur"].indexOf(A)>=0?"rtl":"ltr"},translate:function(A){for(var g=function(A){return A?A.querySelectorAll("*[data-l10n-id]"):[]}(A=A||I.documentElement),B=g.length,Q=0;Q<B;Q++)h(g[Q]);h(A)},getReadyState:function(){return i},ready:function(g){g&&("complete"==i||"interactive"==i?A.setTimeout((function(){g()})):I.addEventListener&&I.addEventListener("localized",(function A(){I.removeEventListener("localized",A),g()})))}}}(window,document)},function(A,I,g){"use strict";g.r(I),g.d(I,"fixupLangCode",(function(){return w})),g.d(I,"getL10nFallback",(function(){return i})),g.d(I,"NullL10n",(function(){return F}));var B=g(7),Q=g.n(B),C=g(8),E=g.n(C),D={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",print_progress_percent:"{{progress}}%","toggle_sidebar.title":"Toggle Sidebar","toggle_sidebar_notification2.title":"Toggle Sidebar (document contains outline/attachments/layers)",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",error_version_info:"PDF.js v{{version}} (build: {{build}})",error_message:"Message: {{message}}",error_stack:"Stack: {{stack}}",error_file:"File: {{file}}",error_line:"Line: {{line}}",rendering_error:"An error occurred while rendering the page.",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading:"Loading…",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts."};function i(A,I){switch(A){case"find_match_count":A="find_match_count[".concat(1===I.total?"one":"other","]");break;case"find_match_count_limit":A="find_match_count_limit[".concat(1===I.limit?"one":"other","]")}return D[A]||""}var o={en:"en-US",es:"es-ES",fy:"fy-NL",ga:"ga-IE",gu:"gu-IN",hi:"hi-IN",hy:"hy-AM",nb:"nb-NO",ne:"ne-NP",nn:"nn-NO",pa:"pa-IN",pt:"pt-PT",sv:"sv-SE",zh:"zh-CN"};function w(A){return o[!!A&&A.toLowerCase()]||A}function G(A,I){return I?A.replace(/\{\{\s*(\w+)\s*\}\}/g,(function(A,g){return g in I?I[g]:"{{"+g+"}}"})):A}var F={getLanguage:function(){return Q()(E.a.mark((function A(){return E.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return","en-us");case 1:case"end":return A.stop()}}),A)})))()},getDirection:function(){return Q()(E.a.mark((function A(){return E.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return","ltr");case 1:case"end":return A.stop()}}),A)})))()},get:function(A){var I=arguments;return Q()(E.a.mark((function g(){var B,Q;return E.a.wrap((function(g){for(;;)switch(g.prev=g.next){case 0:return B=I.length>1&&void 0!==I[1]?I[1]:null,Q=I.length>2&&void 0!==I[2]?I[2]:i(A,B),g.abrupt("return",G(Q,B));case 3:case"end":return g.stop()}}),g)})))()},translate:function(A){return Q()(E.a.mark((function A(){return E.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:case"end":return A.stop()}}),A)})))()}}},function(A,I,g){"use strict";g.r(I),g.d(I,"AutomationEventBus",(function(){return S})),g.d(I,"EventBus",(function(){return k})),g.d(I,"waitOnEventOrTimeout",(function(){return c})),g.d(I,"WaitOnType",(function(){return U}));var B=g(13),Q=g.n(B),C=g(16),E=g.n(C),D=g(18),i=g.n(D),o=g(15),w=g.n(o),G=g(5),F=g.n(G),N=g(1),y=g.n(N);function R(A){var I=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var g,B=w()(A);if(I){var Q=w()(this).constructor;g=Reflect.construct(B,arguments,Q)}else g=B.apply(this,arguments);return i()(this,g)}}function h(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return M(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return M(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function M(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var U={EVENT:"event",TIMEOUT:"timeout"};function c(A){var I=A.target,g=A.name,B=A.delay,Q=void 0===B?0:B;return new Promise((function(A,B){if("object"!=typeof I||!g||"string"!=typeof g||!(Number.isInteger(Q)&&Q>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function C(B){I instanceof k?I._off(g,E):I.removeEventListener(g,E),i&&clearTimeout(i),A(B)}var E=C.bind(null,U.EVENT);I instanceof k?I._on(g,E):I.addEventListener(g,E);var D=C.bind(null,U.TIMEOUT),i=setTimeout(D,Q)}))}var k=function(){function A(){F()(this,A),this._listeners=Object.create(null)}return y()(A,[{key:"on",value:function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._on(A,I,{external:!0,once:g&&g.once})}},{key:"off",value:function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._off(A,I,{external:!0,once:g&&g.once})}},{key:"dispatch",value:function(A,I){var g=this._listeners[A];if(g&&0!==g.length){var B,Q,C=h(g.slice(0));try{for(C.s();!(Q=C.n()).done;){var E=Q.value,D=E.listener,i=E.external;E.once&&this._off(A,D),i?(B||(B=[]),B.push(D)):D(I)}}catch(A){C.e(A)}finally{C.f()}if(B){var o,w=h(B);try{for(w.s();!(o=w.n()).done;){(0,o.value)(I)}}catch(A){w.e(A)}finally{w.f()}B=null}}}},{key:"_on",value:function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._listeners[A]||(this._listeners[A]=[]),this._listeners[A].push({listener:I,external:g&&!0===g.external,once:g&&!0===g.once})}},{key:"_off",value:function(A,I){var g=this._listeners[A];if(g)for(var B=0,Q=g.length;B<Q;B++)if(g[B].listener===I)return void g.splice(B,1)}}]),A}(),S=function(A){E()(g,A);var I=R(g);function g(){return F()(this,g),I.apply(this,arguments)}return y()(g,[{key:"dispatch",value:function(A,I){if("undefined"!=typeof PDFJSDev&&!PDFJSDev.test("MOZCENTRAL"))throw new Error("Not implemented: AutomationEventBus.dispatch");Q()(w()(g.prototype),"dispatch",this).call(this,A,I);var B=Object.create(null);if(I)for(var C in I){var E=I[C];if("source"!==C)B[C]=E;else if(E===window||E===document)return}var D=document.createEvent("CustomEvent");D.initCustomEvent(A,!0,!0,B),document.dispatchEvent(D)}}]),g}(k)},function(A,I,g){var B=g(14);function Q(){return"undefined"!=typeof Reflect&&Reflect.get?(A.exports=Q=Reflect.get.bind(),A.exports.__esModule=!0,A.exports.default=A.exports):(A.exports=Q=function(A,I,g){var Q=B(A,I);if(Q){var C=Object.getOwnPropertyDescriptor(Q,I);return C.get?C.get.call(arguments.length<3?A:g):C.value}},A.exports.__esModule=!0,A.exports.default=A.exports),Q.apply(this,arguments)}A.exports=Q,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(15);A.exports=function(A,I){for(;!Object.prototype.hasOwnProperty.call(A,I)&&null!==(A=B(A)););return A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){function g(I){return A.exports=g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},A.exports.__esModule=!0,A.exports.default=A.exports,g(I)}A.exports=g,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(17);A.exports=function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),I&&B(A,I)},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){function g(I,B){return A.exports=g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,I){return A.__proto__=I,A},A.exports.__esModule=!0,A.exports.default=A.exports,g(I,B)}A.exports=g,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(3).default,Q=g(19);A.exports=function(A,I){if(I&&("object"===B(I)||"function"==typeof I))return I;if(void 0!==I)throw new TypeError("Derived constructors may only return object or undefined");return Q(A)},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdViewer",(function(){return k}));var B=g(7),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(21),w=g.n(o),G=g(8),F=g.n(G),N=g(22),y=g(29),R=g(30),h=g(37),M=g(36);function U(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return c(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return c(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function c(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var k=function(){function A(I,g,B,Q,C){E()(this,A),w()(this,"scrollModePageState",null),this.jumpPageEvt=null,this.coreHelper=new M.Ofd_Core_Helper,this.ofdRender=new R.Ofd_Render(null,new M.Ofd_Core_Helper),Q&&this.ofdRender.setMixBlendMode(Q),this.defaultScale=C||N.DEFAULT_SCALE_VALUE,this.ofdCanvasRender=new h.OfdCanvasRender(null,this.coreHelper),this.eventBus=B,this.container=I,this.viewer=g,this._currentScaleValue=this.defaultScale,this._pages=[],this._currentScale=1,this._spreadMode=N.SpreadMode.NONE,this._scrollMode=N.ScrollMode.VERTICAL,this._pagesRotation=0,this.currentPage=1,this.scroll=Object(N.watchScroll)(this.container,this._scrollUpdate.bind(this)),this.eventBus.dispatch("pagechanging",{source:this,pageNumber:1,pageLabel:null,previous:1}),this.eventBus._on("jumpPage",this.jumpPage.bind(this)),this.scrollModePageState={previousPageNumber:1,scrollDown:!0,pages:[]},this._location=null,this.lastViewerHeight=0,this.lastViewerContainerScrollTop=0,this.lastViewerWidth=0,this.lastViewerContainerScrollLeft=0}var I;return i()(A,[{key:"getPages",value:function(){return this._pages}},{key:"currentScaleValue",get:function(){return this._currentScaleValue},set:function(A){this.core&&this._setScale(A,!1)}},{key:"getOfdCore",value:function(){return this.core}},{key:"emptyNode",value:function(A){if(A)for(;A.firstChild;)A.removeChild(A.firstChild)}},{key:"_scrollUpdate",value:function(){0!==this.pageCount&&this.updateView()}},{key:"_getVisiblePages",value:function(){var A=this._pages;return Object(N.getVisibleElements)({scrollEl:this.container,views:A,sortByVisibility:!0,horizontal:false,rtl:false})}},{key:"renderHighestPriority",value:function(A){this.forceRendering(A)}},{key:"getScrollAhead",value:function(A){if(A.first&&1===A.first.id)return!0;if(A.last&&A.last.id===this.pageCount)return!1;switch(this._scrollMode){case N.ScrollMode.PAGE:return this.scrollModePageState.scrollDown;case N.ScrollMode.HORIZONTAL:return this.scroll.right}return this.scroll.down}},{key:"forceRendering",value:(I=Q()(F.a.mark((function A(I){var g,B,Q,C,E,D,i,o,w;return F.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this._scrollMode!==N.ScrollMode.PAGE?(B=I||this._getVisiblePages(),Q=this.getScrollAhead(B),this._spreadMode!==N.SpreadMode.NONE&&(this._scrollMode,N.ScrollMode.HORIZONTAL),g=Object(y.getHighestPriority)(B,this._pages,Q)):g=I,!g||g.renderingState!==N.RenderingStates.INITIAL){A.next=27;break}return this.emptyNode(g.div.firstChild),A.next=5,this.ofdRender.renderPage(g.div.firstChild,0,g.id-1);case 5:this.highLightEle(),C=this,E=U(document.getElementsByName("seal_img_div_".concat(g.id-1))),A.prev=8,i=F.a.mark((function A(){var I;return F.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:(I=D.value).addEventListener("click",(function(){C.eventBus.dispatch("signatureclick",{source:C,pageRef:I.dataset.pageRef,signatureId:I.dataset.signatureId})}));case 2:case"end":return A.stop()}}),A)})),E.s();case 11:if((D=E.n()).done){A.next=15;break}return A.delegateYield(i(),"t0",13);case 13:A.next=11;break;case 15:A.next=20;break;case 17:A.prev=17,A.t1=A.catch(8),E.e(A.t1);case 20:return A.prev=20,E.f(),A.finish(20);case 23:for(g.renderingState=N.RenderingStates.FINISHED,this.renderHighestPriority(),o=0;o<g.id-10;o++)(w=this._pages[o]).renderingState===N.RenderingStates.FINISHED&&(this.emptyNode(w.div.firstChild),w.renderingState=N.RenderingStates.INITIAL);return A.abrupt("return",!0);case 27:return A.abrupt("return",!1);case 28:case"end":return A.stop()}}),A,this,[[8,17,20,23]])}))),function(A){return I.apply(this,arguments)})},{key:"highLightEle",value:function(){if(this.removeHighLight(),this.jumpPageEvt&&this.jumpPageEvt.eleIdArray){document.getElementById(this.jumpPageEvt.eleIdArray[0].eleId);this.jumpPageEvt.eleIdArray.forEach((function(A){var I=document.getElementById("page_".concat(A.pageIndex));if(I.firstElementChild&&I.firstElementChild.childElementCount>0){var g=document.getElementById(A.eleId),B=document.createElement("div");B.className="highLight",B.setAttribute("style","position:absolute;left:".concat(g.style.left,";top:").concat(g.style.top,";width:").concat(g.style.width,";height:").concat(g.style.height)),I.firstElementChild.appendChild(B)}})),this.jumpPageEvt=null}}},{key:"removeHighLight",value:function(){var A=document.getElementsByClassName("highLight");if(A)for(var I=A.length-1;I>=0;I--){var g=A[I];g&&g.parentNode.removeChild(g)}}},{key:"updateView",value:function(){var A=this._getVisiblePages(),I=A.views;if(0!==I.length){this.renderHighestPriority(A);var g,B=this.currentPage,Q=!1,C=U(I);try{for(C.s();!(g=C.n()).done;){var E=g.value;if(E.percent<100)break;if(E.id===B){Q=!0;break}}}catch(A){C.e(A)}finally{C.f()}Q||(B=I[0].id),this._setCurrentPageNumber(B)}}},{key:"logError",value:function(A,I){}},{key:"showDocumentError",value:function(A,I){this.logError(A,I);var g=document.createElement("div");g.classList.add("error"),g.textContent=I,this.emptyNode(this.viewer),this.viewer.appendChild(g)}},{key:"resetPageScale",value:function(){this.core&&(this.coreHelper.setDpi(96*this._currentScale),this.reformDiv(this._pagesRotation))}},{key:"reformDiv",value:function(A){for(var I=0;I<this._pages.length;++I){var g=this._pages[I].div,B=this.coreHelper.pageRenderWidth(0,I,this.core),Q=this.coreHelper.pageRenderHeight(0,I,this.core),C=g.firstChild,E=new M.Ofd_Core_Helper,D=E.pageRenderWidth(0,I,this.core),i=E.pageRenderHeight(0,I,this.core);switch(A){case 0:g.style.width=B+"px",g.style.height=Q+"px",0,this._pages[I].width=B,this._pages[I].height=Q,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform:rotate(",0,"deg) translate(").concat((B-D)/2,"px, ").concat((Q-i)/2,"px) scale(").concat(this._currentScale,")"));break;case 90:g.style.width=Q+"px",g.style.height=B+"px",(B-Q)/2,this._pages[I].width=Q,this._pages[I].height=B,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform: translate(").concat((Q-D)/2,"px, ").concat((B-i)/2,"px) rotate(").concat(A,"deg) scale(").concat(this._currentScale,")"));break;case 180:g.style.width=B+"px",g.style.height=Q+"px",0,this._pages[I].width=B,this._pages[I].height=Q,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform:rotate(",180,"deg) translate(").concat(-(B-D)/2,"px, ").concat(-(Q-i)/2,"px) scale(").concat(this._currentScale,")"));break;case 270:g.style.width=Q+"px",g.style.height=B+"px",-(B-Q)/2,this._pages[I].width=Q,this._pages[I].height=B,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform: translate(").concat((Q-D)/2,"px, ").concat((B-i)/2,"px) rotate(",270,"deg) scale(").concat(this._currentScale,")"))}this._pages[I].scale=this._currentScale;var o={width:this._pages[I].width,height:this._pages[I].height,scale:this._currentScale};this._pages[I].viewport=o}if(0!==this.lastViewerHeight&&0!==this.lastViewerContainerScrollTop){var w=this.viewer.scrollHeight;this.container.scrollTo({top:this.lastViewerContainerScrollTop/this.lastViewerHeight*w})}if(0!==this.lastViewerWidth&&0!==this.lastViewerContainerScrollLeft){var G=this.viewer.scrollWidth;this.container.scrollTo({left:this.lastViewerContainerScrollLeft/this.lastViewerWidth*G})}this.eventBus.dispatch("viewportchanging",{source:this})}},{key:"initDiv",value:function(){var A=this.viewer;this._pages=[],this.emptyNode(A);var I=this;A.addEventListener("click",(function(){I.eventBus.dispatch("pageViewerClick",{source:I})}));for(var g=0;g<this.pageCount;++g){var B=document.createElement("div");B.classList.add("page"),B.id="page_"+g;var Q=this.coreHelper.pageRenderWidth(0,g,this.core),C=this.coreHelper.pageRenderHeight(0,g,this.core);B.style.width=Q+"px",B.style.height=C+"px",B.style.overflow="hidden",B.style.position="relative";var E=document.createElement("div");B.style.width=Q+"px",B.style.height=C+"px",0;var D=new M.Ofd_Core_Helper,i=D.pageRenderWidth(0,g,this.core),o=D.pageRenderHeight(0,g,this.core);E.style.width=i+"px",E.style.height=o+"px",E.style.overflow="hidden",E.style.transform="translate(".concat((Q-i)/2,"px, ").concat((C-o)/2,"px) scale(").concat(this._currentScale,")"),B.appendChild(E),A.appendChild(B),0===g&&E.appendChild(this.initLoadingImg());var w={width:Q,height:C,scale:this._currentScale};this._pages.push({div:B,viewport:w,id:g+1,renderingState:N.RenderingStates.INITIAL,scale:this._currentScale,width:Q,height:C})}}},{key:"currentPageNumber",get:function(){return this.currentPage}},{key:"_setCurrentPageNumber",value:function(A){if(this.currentPage===A)return!0;if(!(0<A&&A<=this.pageCount))return!1;var I=this.currentPage;return this.currentPage=A,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:A,pageLabel:null,previous:I}),!0}},{key:"setRotation",value:function(A){A+=this._pagesRotation,Object(N.isValidRotation)(A),(A%=360)<0&&(A+=360),this._pagesRotation!==A&&this.core&&(this._pagesRotation=A,this.reformDiv(this._pagesRotation,!0),this.updateView())}},{key:"increaseScale",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,I=this._currentScale;do{I=(I*N.DEFAULT_SCALE_DELTA).toFixed(2),I=Math.ceil(10*I)/10,I=Math.min(N.MAX_SCALE,I)}while(--A>0&&I<N.MAX_SCALE);this._setScale(I)}},{key:"decreaseScale",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,I=this._currentScale;do{I=(I/N.DEFAULT_SCALE_DELTA).toFixed(2),I=Math.floor(10*I)/10,I=Math.max(N.MIN_SCALE,I)}while(--A>0&&I>N.MIN_SCALE);this._setScale(I)}},{key:"zoom",value:function(A){this._setScale(A)}},{key:"_setScale",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.lastViewerHeight=this.viewer.scrollHeight,this.lastViewerWidth=this.viewer.scrollWidth,this.lastViewerContainerScrollTop=this.container.scrollTop,this.lastViewerContainerScrollLeft=this.container.scrollLeft;var g=parseFloat(A);if(g>0)this._setScaleUpdatePages(g,A,I,!1);else{var B=this._pages[0];if(!B)return;var Q=N.SCROLLBAR_PADDING,C=N.VERTICAL_PADDING,E=(this.container.clientWidth-Q)/B.width*B.scale/1,D=(this.container.clientHeight-C)/B.height*B.scale;switch(A){case"page-actual":g=1;break;case"page-width":g=E;break;case"page-height":g=D;break;case"page-fit":g=Math.min(E,D);break;case"auto":var i=Object(N.isPortraitOrientation)(B)?E:Math.min(D,E);g=Math.min(N.MAX_AUTO_SCALE,i);break;default:return}this._setScaleUpdatePages(g,A,I,!0)}}},{key:"isSameScale",value:function(A){return A===this._currentScale||Math.abs(A-this._currentScale)<1e-15}},{key:"ensurePageViewVisible",value:function(){if(this._scrollMode!==N.ScrollMode.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");var A=this.currentPageNumber,I=this.scrollModePageState,g=this.viewer;if(g.textContent="",I.pages.length=0,this._spreadMode===N.SpreadMode.NONE){var B=this._pages[A-1];B.renderingState===N.RenderingStates.INITIAL&&this.forceRendering(B),g.appendChild(B.div)}else{var Q=new Set,C=this._spreadMode-1;A%2!==C?(Q.add(A-1),Q.add(A)):(Q.add(A-2),Q.add(A-1));var E,D=null,i=U(Q);try{for(i.s();!(E=i.n()).done;){var o=E.value,w=this._pages[o];w&&(null===D?((D=document.createElement("div")).className="spread",g.appendChild(D)):o%2===C&&(D=D.cloneNode(!1),g.appendChild(D)),D.appendChild(w.div))}}catch(A){i.e(A)}finally{i.f()}}I.scrollDown=A>=I.previousPageNumber,I.previousPageNumber=A}},{key:"_setScaleUpdatePages",value:function(A,I){var g=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._currentScaleValue=I.toString(),this.isSameScale(A)?g&&this.eventBus.dispatch("scalechanging",{source:this,scale:A,presetValue:I}):(this._currentScale=A,this.resetPageScale(),this.eventBus.dispatch("scalechanging",{source:this,scale:A,presetValue:g?I:void 0}))}},{key:"setSpreadMode",value:function(A){if(this._spreadMode!==A){if(!Object(N.isValidSpreadMode)(A))throw new Error("Invalid spread mode: ".concat(A));this._spreadMode=A,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:A}),this._updateSpreadMode(this.currentPage)}}},{key:"_updateSpreadMode",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,I=this._pages;if(this._scrollMode===N.ScrollMode.PAGE)this.ensurePageViewVisible();else if(this._spreadMode===N.SpreadMode.NONE){this.viewer.textContent="";for(var g=0,B=I.length;g<B;++g)this.viewer.appendChild(I[g].div)}else{this.viewer.textContent="";for(var Q=this._spreadMode-1,C=null,E=0,D=I.length;E<D;++E)null===C?((C=document.createElement("div")).className="spread",this.viewer.appendChild(C)):E%2===Q&&(C=C.cloneNode(!1),this.viewer.appendChild(C)),C.appendChild(I[E].div)}A&&(this._currentScale&&isNaN(this._currentScale)&&this._setScale(this._currentScale,!0),this._setCurrentPageNumber(A,!0),this.updateView())}},{key:"setScrollMode",value:function(A){if(this._scrollMode!==A){if(!Object(N.isValidScrollMode)(A))throw new Error("Invalid scroll mode: ".concat(A));this.pageCount>15e3||(this._previousScrollMode=this._scrollMode,this._scrollMode=A,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:A}),this._updateScrollMode(this.currentPage))}}},{key:"_updateScrollMode",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,I=this._scrollMode;this.viewer.classList.toggle("scrollHorizontal",I===N.ScrollMode.HORIZONTAL),this.viewer.classList.toggle("scrollWrapped",I===N.ScrollMode.WRAPPED),this.core&&(I===N.ScrollMode.PAGE?this.ensurePageViewVisible():this._previousScrollMode===N.ScrollMode.PAGE&&this._updateSpreadMode(),this._currentScale&&isNaN(this._currentScale)&&this._setScale(this._currentScale,!0),this._setCurrentPageNumber(A,!0),this.updateView())}},{key:"firstPage",value:function(){this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(1),this.ensurePageViewVisible()):this.viewer.children.item(0).scrollIntoView(!0);return!0}},{key:"lastPage",value:function(){this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(this.pageCount),this.ensurePageViewVisible()):this.viewer.children.item(this.pageCount-1).scrollIntoView(!0);return!0}},{key:"nextPage",value:function(){var A=this.currentPage;if(A>=this.pageCount)return!1;this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(A+1),this.ensurePageViewVisible()):this.viewer.children.item(A).scrollIntoView(!0);return!0}},{key:"previousPage",value:function(){var A=this.currentPage;if(A<=1)return!1;this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(A-1),this.ensurePageViewVisible()):this.viewer.children.item(A-2).scrollIntoView(!0);return!0}},{key:"jumpPage",value:function(A){(this.jumpPageEvt=A,this._scrollMode===N.ScrollMode.PAGE)?(A.pageIndex&&this._setCurrentPageNumber(A.pageIndex),this.ensurePageViewVisible()):(this.viewer.children.item(A.pageIndex-1).scrollIntoView(!0),this.highLightEle())}},{key:"freeDocument",value:function(){this.currentPage=1,this.pageCount=0,this._pages=[],this.emptyNode(this.viewer)}},{key:"initLoadingImg",value:function(){var A=new Image;return A.style.position="absolute",A.style.left=0,A.style.right=0,A.style.margin="auto",A.style.top=0,A.style.bottom=0,A.src="data:image/gif;base64,R0lGODlhNgA3APMAAP///zAyOJKTlkdJTzw+RN/g4XV2euPj5M/Q0WtscaChpDAyODAyODAyODAyODAyOCH5BAkKAAAAIf4aQ3JlYXRlZCB3aXRoIGFqYXhsb2FkLmluZm8AIf8LTkVUU0NBUEUyLjADAQAAACwAAAAANgA3AAAEzBDISau9OOvNu/9gKI5kaZ4lkhBEgqCnws6EApMITb93uOqsRC8EpA1Bxdnx8wMKl51ckXcsGFiGAkamsy0LA9pAe1EFqRbBYCAYXXUGk4DWJhZN4dlAlMSLRW80cSVzM3UgB3ksAwcnamwkB28GjVCWl5iZmpucnZ4cj4eWoRqFLKJHpgSoFIoEe5ausBeyl7UYqqw9uaVrukOkn8LDxMXGx8ibwY6+JLxydCO3JdMg1dJ/Is+E0SPLcs3Jnt/F28XXw+jC5uXh4u89EQAh+QQJCgAAACwAAAAANgA3AAAEzhDISau9OOvNu/9gKI5kaZ5oqhYGQRiFWhaD6w6xLLa2a+iiXg8YEtqIIF7vh/QcarbB4YJIuBKIpuTAM0wtCqNiJBgMBCaE0ZUFCXpoknWdCEFvpfURdCcM8noEIW82cSNzRnWDZoYjamttWhphQmOSHFVXkZecnZ6foKFujJdlZxqELo1AqQSrFH1/TbEZtLM9shetrzK7qKSSpryixMXGx8jJyifCKc1kcMzRIrYl1Xy4J9cfvibdIs/MwMue4cffxtvE6qLoxubk8ScRACH5BAkKAAAALAAAAAA2ADcAAATOEMhJq7046827/2AojmRpnmiqrqwwDAJbCkRNxLI42MSQ6zzfD0Sz4YYfFwyZKxhqhgJJeSQVdraBNFSsVUVPHsEAzJrEtnJNSELXRN2bKcwjw19f0QG7PjA7B2EGfn+FhoeIiYoSCAk1CQiLFQpoChlUQwhuBJEWcXkpjm4JF3w9P5tvFqZsLKkEF58/omiksXiZm52SlGKWkhONj7vAxcbHyMkTmCjMcDygRNAjrCfVaqcm11zTJrIjzt64yojhxd/G28XqwOjG5uTxJhEAIfkECQoAAAAsAAAAADYANwAABM0QyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7/i8qmCoGQoacT8FZ4AXbFopfTwEBhhnQ4w2j0GRkgQYiEOLPI6ZUkgHZwd6EweLBqSlq6ytricICTUJCKwKkgojgiMIlwS1VEYlspcJIZAkvjXHlcnKIZokxJLG0KAlvZfAebeMuUi7FbGz2z/Rq8jozavn7Nev8CsRACH5BAkKAAAALAAAAAA2ADcAAATLEMhJq7046827/2AojmRpnmiqrqwwDAJbCkRNxLI42MSQ6zzfD0Sz4YYfFwzJNCmPzheUyJuKijVrZ2cTlrg1LwjcO5HFyeoJeyM9U++mfE6v2+/4PD6O5F/YWiqAGWdIhRiHP4kWg0ONGH4/kXqUlZaXmJlMBQY1BgVuUicFZ6AhjyOdPAQGQF0mqzauYbCxBFdqJao8rVeiGQgJNQkIFwdnB0MKsQrGqgbJPwi2BMV5wrYJetQ129x62LHaedO21nnLq82VwcPnIhEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7/g8Po7kX9haKoAZZ0iFGIc/iRaDQ40Yfj+RepSVlpeYAAgJNQkIlgo8NQqUCKI2nzNSIpynBAkzaiCuNl9BIbQ1tl0hraewbrIfpq6pbqsioaKkFwUGNQYFSJudxhUFZ9KUz6IGlbTfrpXcPN6UB2cHlgfcBuqZKBEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7yJEopZA4CsKPDUKfxIIgjZ+P3EWe4gECYtqFo82P2cXlTWXQReOiJE5bFqHj4qiUhmBgoSFho59rrKztLVMBQY1BgWzBWe8UUsiuYIGTpMglSaYIcpfnSHEPMYzyB8HZwdrqSMHxAbath2MsqO0zLLorua05OLvJxEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhfohELYHQuGBDgIJXU0Q5CKqtOXsdP0otITHjfTtiW2lnE37StXUwFNaSScXaGZvm4r0jU1RWV1hhTIWJiouMjVcFBjUGBY4WBWw1A5RDT3sTkVQGnGYYaUOYPaVip3MXoDyiP3k3GAeoAwdRnRoHoAa5lcHCw8TFxscduyjKIrOeRKRAbSe3I9Um1yHOJ9sjzCbfyInhwt3E2cPo5dHF5OLvJREAOw==",A.draggable=!1,A}},{key:"setWaterText",value:function(A){this.ofdRender.coreHelper.setWaterText(A)}},{key:"setWaterSetting",value:function(A){this.ofdRender.coreHelper.setWaterSetting(A)}},{key:"setOfdCore",value:function(A){this.core=A,this.ofdRender.setOfdCore(this.core),this.ofdCanvasRender.setOfdCore(this.core),this._spreadMode=N.SpreadMode.NONE,this._scrollMode=N.ScrollMode.VERTICAL,this._pagesRotation=0,this.pageCount=this.core.getOFDPageCount(0),this.eventBus.dispatch("pagechanging",{source:this,pageNumber:1,pageLabel:null,previous:1}),this.viewer.scrollTo(0,0);var I=N.SCROLLBAR_PADDING,g=(N.VERTICAL_PADDING,this.container.clientWidth,new M.Ofd_Core_Helper(96)),B=(this.container.clientWidth-I)/g.pageRenderWidth(0,0,this.core)*1/1,Q=Math.min(N.MAX_AUTO_SCALE,B);this.defaultScale!==N.DEFAULT_SCALE_VALUE&&(Q=this.defaultScale),this._currentScale=Q,this.coreHelper.setDpi(96*Q),this.initDiv(0),this.updateView(),this.eventBus.dispatch("scalechanging",{source:this,scale:Q,presetValue:this.defaultScale}),this.eventBus.dispatch("viewportchanging",{source:this}),this.scrollModePageState={previousPageNumber:1,scrollDown:!0,pages:[]}}}]),A}()},function(A,I,g){var B=g(2);A.exports=function(A,I,g){return(I=B(I))in A?Object.defineProperty(A,I,{value:g,enumerable:!0,configurable:!0,writable:!0}):A[I]=g,A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"animationStarted",(function(){return u})),g.d(I,"apiPageLayoutToViewerModes",(function(){return v})),g.d(I,"apiPageModeToSidebarView",(function(){return _})),g.d(I,"approximateFraction",(function(){return r})),g.d(I,"AutoPrintRegExp",(function(){return J})),g.d(I,"backtrackBeforeAllVisibleElements",(function(){return f})),g.d(I,"binarySearchFirstItem",(function(){return q})),g.d(I,"DEFAULT_SCALE",(function(){return F})),g.d(I,"DEFAULT_SCALE_DELTA",(function(){return N})),g.d(I,"DEFAULT_SCALE_VALUE",(function(){return G})),g.d(I,"getActiveOrFocusedElement",(function(){return P})),g.d(I,"getPageSizeInches",(function(){return x})),g.d(I,"getVisibleElements",(function(){return V})),g.d(I,"isPortraitOrientation",(function(){return O})),g.d(I,"isValidRotation",(function(){return T})),g.d(I,"isValidScrollMode",(function(){return X})),g.d(I,"isValidSpreadMode",(function(){return j})),g.d(I,"MAX_AUTO_SCALE",(function(){return M})),g.d(I,"MAX_SCALE",(function(){return R})),g.d(I,"MIN_SCALE",(function(){return y})),g.d(I,"noContextMenuHandler",(function(){return b})),g.d(I,"normalizeWheelEventDelta",(function(){return m})),g.d(I,"normalizeWheelEventDirection",(function(){return p})),g.d(I,"OutputScale",(function(){return L})),g.d(I,"parseQueryString",(function(){return Z})),g.d(I,"PresentationModeState",(function(){return S})),g.d(I,"ProgressBar",(function(){return z})),g.d(I,"removeNullCharacters",(function(){return l})),g.d(I,"RendererType",(function(){return a})),g.d(I,"RenderingStates",(function(){return k})),g.d(I,"roundToDivide",(function(){return W})),g.d(I,"SCROLLBAR_PADDING",(function(){return U})),g.d(I,"scrollIntoView",(function(){return t})),g.d(I,"ScrollMode",(function(){return K})),g.d(I,"SidebarView",(function(){return s})),g.d(I,"SpreadMode",(function(){return H})),g.d(I,"TextLayerMode",(function(){return Y})),g.d(I,"UNKNOWN_SCALE",(function(){return h})),g.d(I,"VERTICAL_PADDING",(function(){return c})),g.d(I,"watchScroll",(function(){return d}));var B=g(23),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D);function o(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return w(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return w(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function w(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var G="auto",F=1,N=1.1,y=.1,R=10,h=0,M=1.25,U=40,c=5,k={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},S={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},s={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4,SIGNATURES:5},a={CANVAS:"canvas",SVG:"svg"},Y={DISABLE:0,ENABLE:1,ENABLE_ENHANCE:2},K={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},H={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2},J=/\bprint\s*\(/,L=function(){function A(){E()(this,A);var I=window.devicePixelRatio||1;this.sx=I,this.sy=I}return i()(A,[{key:"scaled",get:function(){return 1!==this.sx||1!==this.sy}}]),A}();function t(A,I){var g=arguments.length>2&&void 0!==arguments[2]&&arguments[2],B=A.offsetParent;if(B){for(var Q=A.offsetTop+A.clientTop,C=A.offsetLeft+A.clientLeft;B.clientHeight===B.scrollHeight&&B.clientWidth===B.scrollWidth||g&&(B.classList.contains("markedContent")||"hidden"===getComputedStyle(B).overflow);)if(Q+=B.offsetTop,C+=B.offsetLeft,!(B=B.offsetParent))return;I&&(void 0!==I.top&&(Q+=I.top),void 0!==I.left&&(C+=I.left,B.scrollLeft=C)),B.scrollTop=Q}}function d(A,I){var g=function(g){Q||(Q=window.requestAnimationFrame((function(){Q=null;var g=A.scrollLeft,C=B.lastX;g!==C&&(B.right=g>C),B.lastX=g;var E=A.scrollTop,D=B.lastY;E!==D&&(B.down=E>D),B.lastY=E,I(B)})))},B={right:!0,down:!0,lastX:A.scrollLeft,lastY:A.scrollTop,_eventHandler:g},Q=null;return A.addEventListener("scroll",g,!0),B}function Z(A){var I,g=new Map,B=o(new URLSearchParams(A));try{for(B.s();!(I=B.n()).done;){var C=Q()(I.value,2),E=C[0],D=C[1];g.set(E.toLowerCase(),D)}}catch(A){B.e(A)}finally{B.f()}return g}var e=/\x00/g,n=/[\x01-\x1F]/g;function l(A){return"string"!=typeof A?A:(arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(A=A.replace(n," ")),A.replace(e,""))}function q(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,B=A.length-1;if(B<0||!I(A[B]))return A.length;if(I(A[g]))return g;for(;g<B;){var Q=g+B>>1;I(A[Q])?B=Q:g=Q+1}return g}function r(A){if(Math.floor(A)===A)return[A,1];var I=1/A;if(I>8)return[1,8];if(Math.floor(I)===I)return[1,I];for(var g=A>1?I:A,B=0,Q=1,C=1,E=1;;){var D=B+C,i=Q+E;if(i>8)break;g<=D/i?(C=D,E=i):(B=D,Q=i)}return g-B/Q<C/E-g?g===A?[B,Q]:[Q,B]:g===A?[C,E]:[E,C]}function W(A,I){var g=A%I;return 0===g?A:Math.round(A-g+I)}function x(A){var I=A.view,g=A.userUnit,B=A.rotate,C=Q()(I,4),E=C[0],D=C[1],i=B%180!=0,o=(C[2]-E)/72*g,w=(C[3]-D)/72*g;return{width:i?w:o,height:i?o:w}}function f(A,I,g){if(A<2)return A;var B=I[A].div,Q=B.offsetTop+B.clientTop;Q>=g&&(Q=(B=I[A-1].div).offsetTop+B.clientTop);for(var C=A-2;C>=0&&!((B=I[C].div).offsetTop+B.clientTop+B.clientHeight<=Q);--C)A=C;return A}function V(A){var I=A.scrollEl,g=A.views,B=A.sortByVisibility,Q=void 0!==B&&B,C=A.horizontal,E=void 0!==C&&C,D=A.rtl,i=void 0!==D&&D,o=I.scrollTop,w=o+I.clientHeight,G=I.scrollLeft,F=G+I.clientWidth;var N=[],y=new Set,R=g.length,h=q(g,E?function(A){var I=A.div,g=I.offsetLeft+I.clientLeft,B=g+I.clientWidth;return i?g<F:B>G}:function(A){var I=A.div;return I.offsetTop+I.clientTop+I.clientHeight>o});h>0&&h<R&&!E&&(h=f(h,g,o));for(var M=E?F:-1,U=h;U<R;U++){var c=g[U],k=c.div,S=k.offsetLeft+k.clientLeft,s=k.offsetTop+k.clientTop,a=k.clientWidth,Y=k.clientHeight,K=S+a,H=s+Y;if(-1===M)H>=w&&(M=H);else if((E?S:s)>M)break;if(!(H<=o||s>=w||K<=G||S>=F)){var J=Math.max(0,o-s)+Math.max(0,H-w),L=(a-(Math.max(0,G-S)+Math.max(0,K-F)))/a,t=(Y-J)/Y*L*100|0;N.push({id:c.id,x:S,y:s,view:c,percent:t,widthPercent:100*L|0}),y.add(c.id)}}var d=N[0],Z=N[N.length-1];return Q&&N.sort((function(A,I){var g=A.percent-I.percent;return Math.abs(g)>.001?-g:A.id-I.id})),{first:d,last:Z,views:N,ids:y}}function b(A){A.preventDefault()}function p(A){var I=Math.hypot(A.deltaX,A.deltaY),g=Math.atan2(A.deltaY,A.deltaX);return-.25*Math.PI<g&&g<.75*Math.PI&&(I=-I),I}function m(A){var I=p(A);return 0===A.deltaMode?I/=900:1===A.deltaMode&&(I/=30),I}function T(A){return Number.isInteger(A)&&A%90==0}function X(A){return Number.isInteger(A)&&Object.values(K).includes(A)&&A!==K.UNKNOWN}function j(A){return Number.isInteger(A)&&Object.values(H).includes(A)&&A!==H.UNKNOWN}function O(A){return A.width<=A.height}var u=new Promise((function(A){"undefined"!=typeof PDFJSDev&&PDFJSDev.test("LIB")&&"undefined"==typeof window?setTimeout(A,20):window.requestAnimationFrame(A)}));var z=function(){function A(I){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},B=g.height,Q=g.width,C=g.units;E()(this,A),this.visible=!0,this.div=document.querySelector(I+" .progress"),this.bar=this.div.parentNode,this.height=B||100,this.width=Q||100,this.units=C||"%",this.div.style.height=this.height+this.units,this.percent=0}return i()(A,[{key:"_updateBar",value:function(){if(this._indeterminate)return this.div.classList.add("indeterminate"),void(this.div.style.width=this.width+this.units);this.div.classList.remove("indeterminate");var A=this.width*this._percent/100;this.div.style.width=A+this.units}},{key:"percent",get:function(){return this._percent},set:function(A){var I,g,B;this._indeterminate=isNaN(A),this._percent=(I=A,g=0,B=100,Math.min(Math.max(I,g),B)),this._updateBar()}},{key:"setWidth",value:function(A){if(A){var I=A.parentNode.offsetWidth-A.offsetWidth;if(I>0)document.documentElement.style.setProperty("--loadingBar-end-offset","".concat(I,"px"))}}},{key:"hide",value:function(){this.visible&&(this.visible=!1,this.bar.classList.add("hidden"))}},{key:"show",value:function(){this.visible||(this.visible=!0,this.bar.classList.remove("hidden"))}}]),A}();function P(){for(var A=document,I=A.activeElement||A.querySelector(":focus");I&&I.shadowRoot;)I=(A=I.shadowRoot).activeElement||A.querySelector(":focus");return I}function v(A){var I=K.VERTICAL,g=H.NONE;switch(A){case"SinglePage":I=K.PAGE;break;case"OneColumn":break;case"TwoPageLeft":I=K.PAGE;case"TwoColumnLeft":g=H.ODD;break;case"TwoPageRight":I=K.PAGE;case"TwoColumnRight":g=H.EVEN}return{scrollMode:I,spreadMode:g}}function _(A){switch(A){case"UseNone":return s.NONE;case"UseThumbs":return s.THUMBS;case"UseOutlines":return s.OUTLINE;case"UseAttachments":return s.ATTACHMENTS;case"UseOC":return s.LAYERS}return s.NONE}},function(A,I,g){var B=g(24),Q=g(25),C=g(26),E=g(28);A.exports=function(A,I){return B(A)||Q(A,I)||C(A,I)||E()},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A){if(Array.isArray(A))return A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A,I){var g=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=g){var B,Q,C,E,D=[],i=!0,o=!1;try{if(C=(g=g.call(A)).next,0===I){if(Object(g)!==g)return;i=!1}else for(;!(i=(B=C.call(g)).done)&&(D.push(B.value),D.length!==I);i=!0);}catch(A){o=!0,Q=A}finally{try{if(!i&&null!=g.return&&(E=g.return(),Object(E)!==E))return}finally{if(o)throw Q}}return D}},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(27);A.exports=function(A,I){if(A){if("string"==typeof A)return B(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);return"Object"===g&&A.constructor&&(g=A.constructor.name),"Map"===g||"Set"===g?Array.from(A):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?B(A,I):void 0}},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"getHighestPriority",(function(){return Q}));var B=g(22);function Q(A,I,g){var B=arguments.length>3&&void 0!==arguments[3]&&arguments[3],Q=A.views,E=Q.length;if(0===E)return null;for(var D=0;D<E;D++){var i=Q[D].view;if(!C(i))return i}var o=A.first.id,w=A.last.id;if(w-o+1>E)for(var G=A.ids,F=1,N=w-o;F<N;F++){var y=g?o+F:w-F;if(!G.has(y)){var R=I[y-1];if(!C(R))return R}}var h=g?w:o-2,M=I[h];return M&&!C(M)||B&&(M=I[h+=g?1:-1])&&!C(M)?M:null}function C(A){return A.renderingState===B.RenderingStates.FINISHED}},function(A,I,g){"use strict";g.r(I),g.d(I,"Ofd_Render",(function(){return h}));var B=g(7),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(8),w=g.n(o),G=g(31),F=g(32),N=g(35);g(36);function y(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return R(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return R(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function R(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var h=function(){function A(I,g){E()(this,A),this.core=I,this.coreHelper=g,this.mixBlendMode="darken"}var I;return i()(A,[{key:"setDpi",value:function(A){this.coreHelper.setDpi(A)}},{key:"setOfdCore",value:function(A){this.core=A}},{key:"setMixBlendMode",value:function(A){this.mixBlendMode=A}},{key:"renderPage",value:function(A,I,g,B,Q,C){var E=B?B.readOfdDocument(I):this.core.readOfdDocument(I),D=B?B.readOfdPage(I,g):this.core.readOfdPage(I,g);this.coreHelper.waterText&&!this.coreHelper.waterSetting&&A.appendChild(this.watermark({watermark_txt:this.coreHelper.waterText})),this.coreHelper.waterSetting&&A.appendChild(this.watermark(this.coreHelper.waterSetting));var i=D.Page.Template,o=E.Annotations?E.Annotations:[],w=B?B.readOfdTemplatePage(I):this.core.readOfdTemplatePage(I),F=E.Signatures?E.Signatures.Signature:[],R=E.CommonData.Res.Fonts,h=E.CommonData.Res.DrawParams,M=(E.CommonData.Res.ColorSpaces,E.CommonData.Res.CompositeGraphicUnits),U=E.CommonData.Res.MultiMedias;if(i){var c,k=y(i);try{for(k.s();!(c=k.n()).done;){var S,s=c.value,a=y(w);try{for(a.s();!(S=a.n()).done;){var Y=S.value;if(Y.ID==s.TemplateID){if((Y=B?B.readPageFromTemplate(Y):this.core.readPageFromTemplate(Y)).Page.Content){var K,H=y(Y.Page.Content.Layer);try{for(H.s();!(K=H.n()).done;){var J=K.value;this.renderLayer(C,Q,g,A,R,h,U,M,J,!1)}}catch(A){H.e(A)}finally{H.f()}}break}}}catch(A){a.e(A)}finally{a.f()}}}catch(A){k.e(A)}finally{k.f()}}if(D.Page.Content){var L,t=y(D.Page.Content.Layer);try{for(t.s();!(L=t.n()).done;){var d=L.value;this.renderLayer(C,Q,g,A,R,h,U,M,d,!1)}}catch(A){t.e(A)}finally{t.f()}}var Z,e=y(o);try{for(e.s();!(Z=e.n()).done;){var n=Z.value;if(D.ID==n.PageID){var l,q=y(n.PageAnnot.Annot);try{for(q.s();!(l=q.n()).done;){var r=l.value;this.renderAnnotation(C,Q,A,r,R,h,U,M,g)}}catch(A){q.e(A)}finally{q.f()}}}}catch(A){e.e(A)}finally{e.f()}var W,x=y(F);try{for(x.s();!(W=x.n()).done;){var f,V=W.value,b=y(V.Signature.SignedInfo.StampAnnot);try{for(b.s();!(f=b.n()).done;){var p=f.value,m=p.PageRef;if(D.ID==m){var T=p.Boundary;if(V.Signature.PicType&&V.Signature.PicType.length>0)if("ofd"===V.Signature.PicType)for(var X=new N.Ofd_Core(V.Signature.ofd),j=0;j<X.getOFDPageCount(0);j++)this.renderSealPage(A,j,X,!0,T,m,p.ID,g,V.Signature.ZipName);else if("svg"===V.Signature.PicType){var O=Object(G.converterBox)(T,this.coreHelper.dpi),u=document.createElement("div");u.innerHTML=V.Signature.svg;var z=void 0,P=u.children[0].width.baseVal.value,v=u.children[0].height.baseVal.value;P!==O.w&&(z="transform-origin: 0px 0px; transform: scale(".concat(O.h/v<O.w/P?O.h/v:O.w/P,")")),u.setAttribute("style","".concat(z,"; position:absolute; left: ",0,"px; top: ",0,"px; width: ").concat(O.w,"px; height: ").concat(O.h,"px;"));var _=document.createElement("div");_.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";cursor: pointer;position:absolute; left: ").concat(O.x,"px; top: ").concat(O.y,"px; width: ").concat(O.w,"px; height: ").concat(O.h,"px;overflow:hidden")),_.setAttribute("name","seal_img_div_".concat(g)),_.setAttribute("data-signature-id",p.ID),_.setAttribute("data-page-ref",m),_.appendChild(u),A.appendChild(_)}else{var $=Object(G.converterBox)(T,this.coreHelper.dpi),AA="data:image/".concat(V.Signature.PicType,";base64,").concat(V.Signature.PicValue),IA=this.renderImageOnDiv(g,A.style.width,A.style.height,AA,$.w,$.h,$,p.Clip,!0,m,p.ID);IA.svg.setAttribute("style","".concat(IA.style,"left:").concat(IA.left,"px;top:").concat(IA.top,"px;mix-blend-mode:").concat(this.mixBlendMode)),V.Signature.PicType||IA.svg.removeChild(IA.svg.children[0]),A.appendChild(IA.svg)}else{var gA=Object(G.converterBox)(T,this.coreHelper.dpi),BA=document.createElement("div");BA.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";cursor: pointer;position:absolute; left: ").concat(gA.x,"px; top: ").concat(gA.y,"px; width: ").concat(gA.w,"px; height: ").concat(gA.h,"px;overflow:hidden")),BA.setAttribute("name","seal_img_div_".concat(g)),BA.setAttribute("data-signature-id",p.ID),BA.setAttribute("data-page-ref",m),A.appendChild(BA)}}}}catch(A){b.e(A)}finally{b.f()}}}catch(A){x.e(A)}finally{x.f()}}},{key:"throwWhite",value:(I=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",new Promise((function(A,g){var B=new Image;B.onload=function(){var I=B.width,g=B.height,Q=document.createElement("canvas");Q.style.width="".concat(I,"px"),Q.style.height="".concat(g,"px"),Q.width=I,Q.height=g;var C=Q.getContext("2d");C.drawImage(B,0,0,I,g);for(var E=C.getImageData(0,0,I,g),D=E.data,i=0;i<D.length;i+=4)[D[i],D[i+1],D[i+2]].every((function(A){return A<256&&A>245}))&&(D[i+3]=0);C.putImageData(E,0,0),A(Q.toDataURL())},B.src=I})));case 1:case"end":return A.stop()}}),A)}))),function(A){return I.apply(this,arguments)})},{key:"renderAnnotation",value:function(A,I,g,B,Q,C,E,D,i){var o=document.createElement("div");o.setAttribute("style","overflow: hidden;;position:relative;");var w=B.Appearance.Boundary;if(w){var F=Object(G.converterBox)(w,this.coreHelper.dpi);o.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";overflow: visible;position:absolute; left: ").concat(F.x,"px; top: ").concat(F.y,"px; width: ").concat(F.w,"px; height: ").concat(F.h,"px"))}else o.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";overflow: visible;position:absolute; left: 0px; top: 0px; width: 1px; height: 1px"));var N=B.Appearance;this.renderLayer(A,I,i,o,Q,C,E,D,N,!1),g.appendChild(o)}},{key:"renderSealPage",value:function(A,I,g,B,Q,C,E,D,i){var o,w;o=Q;var F=g.pageWidth(0,I),N=g.pageHeight(0,I);F!==o.w&&(w="transform-origin: 0px 0px; transform: scale(".concat(o.h/N<o.w/F?o.h/N:o.w/F,")"));var y=Object(G.converterBox)(o,this.coreHelper.dpi),R=document.createElement("div");R.setAttribute("name","seal_img_div_".concat(D)),R.setAttribute("style","".concat(w,";cursor: pointer; position:absolute; left: ",0,"px; top: ",0,"px; width: ").concat(y.w,"px; height: ").concat(y.h,"px;")),R.setAttribute("data-signature-id",E),R.setAttribute("data-page-ref",C),this.renderPage(R,0,I,g,E,i);var h=document.createElement("div");h.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";position:absolute; left: ").concat(y.x,"px; top: ").concat(y.y,"px; width: ").concat(y.w,"px; height: ").concat(y.h,"px;overflow:hidden")),h.appendChild(R),A.appendChild(h)}},{key:"renderLayer",value:function(A,I,g,B,Q,C,E,D,i,o,w,F,N){var R=null,h=null,M=Object(G.converterDpi)(.353,this.coreHelper.dpi),U=i.DrawParam;if(U&&Object(G.getDrawParam)(C,U)){var c=Object(G.getDrawParam)(C,U);if(Object(G.getDrawParam)(C,c.Relative)){var k=Object(G.getDrawParam)(C,c.Relative);k&&(k.StrokeColor&&(c.StrokeColor=k.StrokeColor),k.FillColor&&(c.FillColor=k.FillColor),k.LineWidth&&(c.LineWidth=k.LineWidth))}c.FillColor&&(R=Object(G.parseColor)(c.FillColor.Value)),c.StrokeColor&&(h=Object(G.parseColor)(c.StrokeColor.Value)),c.LineWidth&&(M=Object(G.converterDpi)(c.LineWidth,this.coreHelper.dpi))}var S=i.PageBlock;if(S){var s,a=y(S);try{for(a.s();!(s=a.n()).done;){var Y=s.value;if("ImageObject"==Y.Type){var K=this.renderImageObject(A,I,g,B.style.width,B.style.height,E,Y,o,F,N,i.ctm);K&&(K.svg.setAttribute("style","".concat(K.style,"left:").concat(K.left,"px;top:").concat(K.top,"px;")),B.appendChild(K.svg))}else if("PathObject"==Y.Type){var H=this.renderPathObject(A,I,g,C,Y,R,h,M,o,w,F,N,E,Q);H.style&&(H.svg.setAttribute("style","".concat(H.style,"left:").concat(H.left,"px;top:").concat(H.top,"px;")),B.appendChild(H.svg))}else if("TextObject"==Y.Type){if(i.ctm){var J=i.ctm.split(" ");Y.CTM={a:J[0],b:J[1],c:J[2],d:J[3],e:J[4],f:J[5]}}var L=this.renderTextObject(B,Q,Y,R,h,C,w,F,N);L.childElementCount>0&&B.appendChild(L)}else if("CompositeObject"==Y.Type){var t,d=y(D);try{for(d.s();!(t=d.n()).done;){var Z=t.value;if(Z.ID===Y.ResourceID){var e=Y.Alpha,n=Y.Boundary,l=Y.CTM;this.renderLayer(A,I,g,B,Q,C,E,D,Z,!1,e,n,l);break}}}catch(A){d.e(A)}finally{d.f()}}}}catch(A){a.e(A)}finally{a.f()}}}},{key:"renderImageObject",value:function(A,I,g,B,Q,C,E,D,i,o,w){var N=E.Boundary;N=Object(G.converterBox)(N,this.coreHelper.dpi);var y=E.ResourceID;if(!y)return null;var R=Object(G.getMultiMedia)(C,y);if(!R.MediaFile)return null;var h,M=E.ImageMask;if(M>0&&(h=Object(G.getMultiMedia)(C,M)).MediaFile&&!(h.width>0||h.height>0)&&h.MediaFile){var U=Object(F.JSGetImageInfoByPath)(this.core.ofdParserPtr,h.MediaFile,h.MediaFileResPln,this.core.getDocPln(0),A);U.ext,h.width=U.width,h.height=U.height,h.FileBase64=U.fileBase64}if(!(R.width>0||R.height>0)&&R.MediaFile){var c=Object(F.JSGetImageInfoByPath)(this.core.ofdParserPtr,R.MediaFile,R.MediaFileResPln,this.core.getDocPln(0),A);if("other"===c.ext)return null;R.width=c.width,R.height=c.height,R.FileBase64=c.fileBase64}var k=E.CTM,S=E.Clips,s=E.BlendMode,a=E.Alpha;return this.renderImageOnDiv(g,B,Q,R.FileBase64,R.width,R.height,N,!1,D,null,null,k,i,o,S,E.ID,s,a,M>0&&h.FileBase64?h.FileBase64:null,w)}},{key:"renderImageOnDiv",value:function(A,I,g,B,Q,C,E,D,i,o,w,F,N,R,h,M,U,c,k,S){var s=parseFloat(I.replace("px","")),a=parseFloat(g.replace("px","")),Y=E.w>s?s:E.w,K=E.h>a?a:E.h,H=document.createElementNS("http://www.w3.org/2000/svg","svg"),J=document.createElementNS("http://www.w3.org/2000/svg","image"),L="";i&&(L="cursor: pointer;",H.setAttribute("viewbox","0 0 ".concat(Y," ").concat(K)),H.setAttribute("name","seal_img_div_".concat(A)),H.setAttribute("data-signature-id",w),H.setAttribute("data-page-ref",o),J.setAttribute("preserveAspectRatio","none slice"));var t=Q,d=C;J.setAttribute("xlink:href",B),J.href.baseVal=B,J.setAttribute("width","".concat(t,"px")),J.setAttribute("height","".concat(d,"px")),c&&J.setAttribute("opacity","".concat(c/255));var Z="";if(F){var e=1,n=1;if(S){var l=S.split(" ");e=l[0],n=l[3]}Z="matrix(".concat(F.a/t/Object(G.ctmImageScale)(this.coreHelper.dpi)*e," ").concat(F.b/t/Object(G.ctmImageScale)(this.coreHelper.dpi)," ").concat(F.c/d/Object(G.ctmImageScale)(this.coreHelper.dpi)," ").concat(F.d/d/Object(G.ctmImageScale)(this.coreHelper.dpi)*n," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")")}R&&(Z="".concat(Z," matrix(").concat(R.a," ").concat(R.b," ").concat(R.c," ").concat(R.d," ").concat(Object(G.converterDpi)(R.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(R.f,this.coreHelper.dpi),")")),J.setAttribute("transform",Z);var q="";D&&(D=Object(G.converterBox)(D,this.coreHelper.dpi),q="clip: rect(".concat(D.y,"px, ").concat(D.w+D.x,"px, ").concat(D.h+D.y,"px, ").concat(D.x,"px)"));var r=[];if(h&&h.length>0)for(var W=0;W<h.length;W++){var x=document.createElementNS("http://www.w3.org/2000/svg","clipPath");x.setAttribute("id","image-clip-path-".concat(M,"-").concat(W));for(var f=h[W].Clip,V=0;V<f.length;V++){var b=f[V].Area,p=0,m=0,T=0,X=0;b.Path.Boundary&&(p=b.Path.Boundary.x,m=b.Path.Boundary.y,T=b.Path.Boundary.w,X=b.Path.Boundary.h);var j=document.createElementNS("http://www.w3.org/2000/svg","path");if(b.CTM)F=b.CTM;else if(b.TransFlag)if(b.Path.CTM);else if(F&&0==F.b&&0==F.c){var O="matrix(".concat(F.a," ").concat(F.b," ").concat(F.c," ").concat(F.d," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")");j.setAttribute("transform",O)}var u,z="",P=y(b.Path.AbbreviatedData);try{for(P.s();!(u=P.n()).done;){var v=u.value;"M"===v.cmd||"S"===v.cmd?z+="M ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],X)+m,this.coreHelper.dpi)," "):"L"===v.cmd?z+="L ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],X)+m,this.coreHelper.dpi)," "):"B"===v.cmd?z+="C ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],X)+m,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[2]+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[3]+m,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[4]+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[5]+m,this.coreHelper.dpi)," "):"Q"===v.cmd?z+="Q ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],X)+m,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[2]+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[3]+m,this.coreHelper.dpi)," "):"A"===v.cmd?z+="A ".concat(Object(G.converterDpi)(v.crds[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(v.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[3],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(v.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(v.crds[6],this.coreHelper.dpi)):"C"===v.cmd&&(z+="Z")}}catch(A){P.e(A)}finally{P.f()}j.setAttribute("d",z),x.appendChild(j)}r.push(x)}if(k){var _=document.createElementNS("http://www.w3.org/2000/svg","mask");_.setAttribute("id","mask-".concat(M));var $=document.createElementNS("http://www.w3.org/2000/svg","image");$.setAttribute("xlink:href",k),$.href.baseVal=k,_.appendChild($),H.appendChild(_),J.setAttribute("mask","url(#mask-".concat(M,")"))}H.appendChild(J);var AA,IA=E.x,gA=E.y;if(R){var BA=R.a,QA=R.b,CA=R.c,EA=R.d,DA=BA>0?Math.sign(BA)*Math.sqrt(BA*BA+CA*CA):Math.sqrt(BA*BA+CA*CA),iA=EA>0?Math.sign(EA)*Math.sqrt(QA*QA+EA*EA):Math.sqrt(QA*QA+EA*EA);0==Math.atan2(-QA,EA)&&0!=BA&&1==EA||(gA*=iA,IA*=DA)}U&&(AA="mix-blend-mode: ".concat(U));var oA="".concat(L,"overflow: visible; position: absolute; width: ").concat(Y,"px; height: ").concat(K,"px; ").concat(q,";").concat(AA,";");if(r.length>0)if(1==r.length)H.appendChild(r[0]),H.setAttribute("clip-path","url(#image-clip-path-".concat(M,"-0)"));else{var wA,GA="",FA=y(r);try{for(FA.s();!(wA=FA.n()).done;){var NA=wA.value;void 0!==NA.children[0].getAttribute("d")&&(GA+="clip-path:path('".concat(NA.children[0].getAttribute("d"),"');"))}}catch(A){FA.e(A)}finally{FA.f()}oA="".concat(GA,";").concat(oA,";")}return{svg:H,style:oA,left:IA,top:gA}}},{key:"renderTextObject",value:function(A,I,g,B,Q,C,E,D,i){var o=1,w=g.Boundary;w=Object(G.converterBox)(w,this.coreHelper.dpi);var N=g.CTM,R=g.HScale,h=g.Font,M=g.Weight,U=g.Alpha/255,c=g.Size>0;N&&!c&&(N={a:-N.a,b:N.b,c:N.c,d:-N.d,e:-N.e,f:-N.f});var k=Object(G.converterDpi)(Math.abs(parseFloat(g.Size)),this.coreHelper.dpi),S=Object(G.calTextPoint)(this.coreHelper.dpi,g.TextCode,g.CGTransform,N,g.Boundary,D,i,c,R),s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("xmlns","http://www.w3.org/2000/svg"),s.setAttribute("version","1.1"),s.setAttribute("id",g.ID);var a,Y,K,H=g.FillColor,J=!1,L=g.DrawParam;if(L){var t=Object(G.getDrawParam)(C,L);t.FillColor&&(H&&H.Value||(H=t.FillColor))}if(H){H.Value&&(B=Object(G.parseColor)(H.Value)),o=H.alpha/255;var d=H.axialShd;if(d){J=!0;var Z=document.createElementNS("http://www.w3.org/2000/svg","linearGradient");Z.setAttribute("id","".concat(g.ID)),Z.setAttribute("x1","0%"),Z.setAttribute("y1","0%"),Z.setAttribute("x2","100%"),Z.setAttribute("y2","100%");var e,n=y(d.Segment);try{for(n.s();!(e=n.n()).done;){var l=e.value;if(l){var q=document.createElement("stop");q.setAttribute("offset","".concat(100*l.position,"%")),q.setAttribute("style","stop-color:".concat(Object(G.parseColor)(l.color.Value),";stop-opacity:1")),Z.appendChild(q),B=Object(G.parseColor)(l.color.Value)}}}catch(A){n.e(A)}finally{n.f()}s.appendChild(Z)}}g.Stroke&&(a=Object(G.parseColor)(g.StrokeColor.Value),Y=g.LineWidth,K=g.LineWidth),g.Fill||(o=0);var r=w.w,W=w.h,x=w.x,f=w.y,V=k,b=k,p=0;if(N){var m=N.a,T=N.b,X=N.c,j=N.d,O=m>0?Math.sign(m)*Math.sqrt(m*m+X*X):Math.sqrt(m*m+X*X),u=j>0?Math.sign(j)*Math.sqrt(T*T+j*j):Math.sqrt(T*T+j*j);0==(p=Math.atan2(-T,j))&&0!=m&&1==j||(V*=O,b*=u,K*=O),0==p&&0!=m&&1==j&&(V*=O,b*=u,K*=O),0==p&&R-0==1&&(R=m/j)>0&&(V*=R)}if(i){var z=i.a,P=i.b,v=i.c,_=i.d,$=z>0?Math.sign(z)*Math.sqrt(z*z+v*v):Math.sqrt(z*z+v*v),AA=_>0?Math.sign(_)*Math.sqrt(P*P+_*_):Math.sqrt(P*P+_*_);0==(p=Math.atan2(-P,_))&&0!=z&&1==_||(V*=$,b*=AA,f*=AA,x*=$,r*=$,W*=AA)}var IA=Object(G.getFont)(I,h),gA="",BA="",QA="",CA="";N&&(CA="matrix(".concat(N.a," ").concat(N.b," ").concat(N.c," ").concat(N.d," ").concat(Object(G.converterDpi)(N.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(N.f,this.coreHelper.dpi),")")),i&&(CA="".concat(CA," matrix(").concat(i.a," ").concat(i.b," ").concat(i.c," ").concat(i.d," ").concat(Object(G.converterDpi)(i.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(i.f,this.coreHelper.dpi),")")),R&&(CA="".concat(CA," scale(").concat(R,", 1)"));for(var EA=!1,DA=0;DA<S.length;DA++){var iA=S[DA];if(iA&&!isNaN(iA.x)){if(iA.glyph&&IA&&IA.face&&N.b>=0){EA=!0;var oA=Object(F.loadFaceInfo)(IA.face),wA=Object(F.FT_Glyph_Get_Measure)(IA.face,iA.glyph),GA=this.drawGlyph(wA.glyphPath,wA.horiUnderlinePosition,oA.units_per_EM,V,b,Q||B,o,a,K,g.ID);if(0===p)GA.img.setAttribute("style","overflow: visible;position:absolute; left: ".concat(Math.ceil(iA.cx),"px; top: ").concat(iA.cy-GA.yScale*wA.horiUnderlinePosition-b,"px;width: ").concat(Math.ceil(V),"px; height:").concat(Math.ceil(b),"px")),A.appendChild(GA.img);else{var FA=document.createElement("div");FA.setAttribute("style","transform-origin: center;transform: rotate(".concat(-p,"rad);position:absolute; left: ").concat(iA.cx,"px; top: ").concat(iA.cy-GA.yScale*wA.horiUnderlinePosition-b,"px;width: ").concat(Math.ceil(V),"px; height:").concat(Math.ceil(b),"px")),GA.img.setAttribute("style","position: absolute;left: 0px;top:0px;width: ".concat(Math.ceil(V),"px; height:").concat(Math.ceil(b),"px")),FA.appendChild(GA.img),A.appendChild(FA)}}if(gA=R?"".concat(gA).concat(iA.x+R*iA.x," "):"".concat(gA).concat(iA.x," "),BA="".concat(BA).concat(iA.y," "),QA=" "==iA.text?"".concat(QA," "):"".concat(QA).concat(iA.text),S.length>1&&R){var NA=document.createElementNS("http://www.w3.org/2000/svg","text");NA.setAttribute("x",iA.x),NA.setAttribute("y",iA.y),NA.innerHTML=iA.text,NA.setAttribute("transform",CA),J?NA.setAttribute("fill",B):(NA.setAttribute("fill",Q),NA.setAttribute("fill",B),NA.setAttribute("fill-opacity",EA?0:o<U?o:U)),EA||(yA&&s.appendChild(yA),NA.setAttribute("clip-path","url(#clip-path-".concat(g.ID,"-0)"))),a&&Y>0&&(NA.setAttribute("stroke",a),NA.setAttribute("stroke-width",Object(G.converterDpi)(Y,this.coreHelper.dpi))),NA.setAttribute("style","font-weight: ".concat(M,";font-size:").concat(k,"px;font-family: ").concat(Object(G.getFontFamily)(IA),";")),EA||s.appendChild(NA)}}}var yA=null,RA=g.Clips;if(RA&&RA.length>0){for(var hA=[],MA=0;MA<RA.length;MA++){(yA=document.createElementNS("http://www.w3.org/2000/svg","clipPath")).setAttribute("id","clip-path-".concat(g.ID,"-").concat(MA));for(var UA=RA[MA].Clip,cA=0;cA<UA.length;cA++){var kA=UA[cA].Area,SA=document.createElementNS("http://www.w3.org/2000/svg","path"),sA="",aA=0,YA=0;kA.Path.Boundary&&(aA=kA.Path.Boundary.x,YA=kA.Path.Boundary.y),EA&&(YA=-YA);var KA,HA=y(kA.Path.AbbreviatedData);try{for(HA.s();!(KA=HA.n()).done;){var JA=KA.value;"M"===JA.cmd||"S"===JA.cmd?sA+="M ".concat(Object(G.converterDpi)(JA.crds[0]+aA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[1]+YA,this.coreHelper.dpi)," "):"L"===JA.cmd?sA+="L ".concat(Object(G.converterDpi)(JA.crds[0]+aA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[1]+YA,this.coreHelper.dpi)," "):"B"===JA.cmd?sA+="C ".concat(Object(G.converterDpi)(JA.crds[0]+aA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[1]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[2]+aA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[3]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[4]+aA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[5]+YA,this.coreHelper.dpi)," "):"Q"===JA.cmd?sA+="Q ".concat(Object(G.converterDpi)(JA.crds[0]+aA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[1]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[2]+aA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[3]+YA,this.coreHelper.dpi)," "):"A"===JA.cmd?sA+="A ".concat(Object(G.converterDpi)(JA.crds[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(JA.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[3],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(JA.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(JA.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(JA.crds[6],this.coreHelper.dpi)):"C"===JA.cmd&&(sA+="Z")}}catch(A){HA.e(A)}finally{HA.f()}SA.setAttribute("d",sA),yA.appendChild(SA),hA.push(yA)}}if(hA.length>0)if(1==hA.length)s.appendChild(hA[0]);else{var LA,tA=y(hA);try{for(tA.s();!(LA=tA.n()).done;){var dA=LA.value;void 0!==dA.children[0].getAttribute("d")&&"clip-path:path('".concat(dA.children[0].getAttribute("d"),"');")}}catch(A){tA.e(A)}finally{tA.f()}}}if(!R){var ZA=document.createElementNS("http://www.w3.org/2000/svg","text");ZA.setAttribute("x",gA),ZA.setAttribute("y",BA),ZA.textContent=QA,ZA.setAttribute("transform",CA),J?ZA.setAttribute("fill",B):(ZA.setAttribute("fill",Q),ZA.setAttribute("fill",B),ZA.setAttribute("fill-opacity",EA?0:o<U?o:U)),g.Visible||ZA.setAttribute("fill-opacity",0),EA||(yA&&s.appendChild(yA),ZA.setAttribute("clip-path","url(#clip-path-".concat(g.ID,"-0)"))),a&&Y>0&&(ZA.setAttribute("stroke",a),ZA.setAttribute("stroke-width",Object(G.converterDpi)(Y,this.coreHelper.dpi))),ZA.setAttribute("style","font-weight: ".concat(M,";font-size:").concat(k,"px;font-family: ").concat(Object(G.getFontFamily)(IA),";")),EA||s.appendChild(ZA)}if(D){var eA=Object(G.converterBox)(D,this.coreHelper.dpi);x+=eA.x,f+=eA.y}return s.setAttribute("style","overflow:visible;position:absolute;width:".concat(r,"px;height:").concat(W,"px;left:").concat(x,"px;top:").concat(f,"px;")),s}},{key:"renderPathObjectByCanvas",value:function(A,I,g,B,Q,C,E,D,i,o,w){var F=I.Boundary;if(F){F=Object(G.converterBox)(F,this.coreHelper.dpi);var N=Math.ceil(F.w),R=Math.ceil(F.h),h=F.x,M=F.y;if(N-0!=0&&R-0!=0){var U=document.createElement("canvas"),c=U.getContext("2d");U.width=1*N,U.height=1*R,U.style.width="".concat(N,"px"),U.style.height="".concat(R,"px");var k=I.LineWidth,S=I.AbbreviatedData,s=I.CTM,a=I.StrokeColor,Y=I.FillColor;k&&(Q=Object(G.converterDpi)(k,this.coreHelper.dpi));var K=I.DrawParam;if(K){var H=Object(G.getDrawParam)(A,K);(k=H.LineWidth)&&(Q=Object(G.converterDpi)(k,this.coreHelper.dpi)),H.FillColor&&(Y&&Y.Value||(Y=H.FillColor)),H.StrokeColor&&(a&&a.Value||(a=H.StrokeColor))}s&&c.transform(s.a,s.b,s.c,s.d,Object(G.converterDpi)(s.e,this.coreHelper.dpi),Object(G.converterDpi)(s.f,this.coreHelper.dpi));var J=!1;if(a){a.Value&&(B=Object(G.parseColor)(a.Value));var L=a.axialShd;if(L){J=!0;var t,d=Object(G.parseCtm)(L.StartPoint),Z=Object(G.parseCtm)(L.EndPoint),e=c.createLinearGradient(d[0],d[1],Z[0],Z[1]),n=y(L.Segment);try{for(n.s();!(t=n.n()).done;){var l=t.value;l&&e.addColorStop(l.position,Object(G.parseColor)(l.color.Value))}}catch(A){n.e(A)}finally{n.f()}c.lineWidth=Q,c.strokeStyle=e}}var q=!1;if(Y){Y.Value&&(g=Object(G.parseColor)(Y.Value)),Y.Alpha&&0===Y.Alpha&&(c.globalAlpha=0);var r=Y.AxialShd;if(r){q=!0;var W,x=Object(G.parseCtm)(r.StartPoint),f=Object(G.parseCtm)(r.EndPoint),V=c.createLinearGradient(x[0],x[1],f[0],f[1]),b=y(r.Segment);try{for(b.s();!(W=b.n()).done;){var p=W.value;p&&V.addColorStop(p.position,Object(G.parseColor)(p.color.Value))}}catch(A){b.e(A)}finally{b.f()}c.fillStyle=V}}Q>0&&!B&&((B=g)||(B="rgb(0, 0, 0)"));var m=I.Clips;if(m&&m.length>0)for(var T=[],X=0;X<m.length;X++){for(var j=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),O=m[X].Clip,u=0;u<O.length;u++){var z=O[u].Area,P=document.createElementNS("http://www.w3.org/2000/svg","path"),v=0,_=0,$=0,AA=0;if(z.Path.Boundary&&(v=z.Path.Boundary.x,_=z.Path.Boundary.y,$=z.Path.Boundary.w,AA=z.Path.Boundary.h),!z.TransFlag&&z.CTM){var IA=z.CTM,gA=void 0;if(gA=s?"matrix(".concat(IA.a," ").concat(IA.b," ").concat(IA.c," ").concat(IA.d," ").concat(Object(G.converterDpi)(IA.e-s.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(IA.f-s.f,this.coreHelper.dpi),")"):"matrix(".concat(IA.a," ").concat(IA.b," ").concat(IA.c," ").concat(IA.d," ").concat(Object(G.converterDpi)(IA.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(IA.f,this.coreHelper.dpi),")"),s){var BA=[[s.a,s.c,0],[s.b,s.d,0],[0,0,1]],QA=Object(G.inv)(BA);isNaN(QA[0][0])||QA[0][0]===1/0||(gA="".concat(gA," matrix(").concat(QA[0][0]," ").concat(QA[1][0]," ").concat(QA[0][1]," ").concat(QA[1][1]," 0 0)"))}P.setAttribute("transform",gA)}if(!z.TransFlag&&z.Path.CTM){var CA=z.Path.CTM,EA="matrix(".concat(CA.a," ").concat(CA.b," ").concat(CA.c," ").concat(CA.d," ").concat(Object(G.converterDpi)(CA.e-s.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(CA.f-s.f,this.coreHelper.dpi),")");if(s){var DA=[[s.a,s.c,0],[s.b,s.d,0],[0,0,1]],iA=Object(G.inv)(DA);isNaN(iA[0][0])||iA[0][0]===1/0||(EA="".concat(EA," matrix(").concat(iA[0][0]," ").concat(iA[1][0]," ").concat(iA[0][1]," ").concat(iA[1][1]," 0 0)"))}P.setAttribute("transform",EA)}c.beginPath();var oA,wA=y(z.Path.AbbreviatedData);try{for(wA.s();!(oA=wA.n()).done;){var GA=oA.value;"M"===GA.cmd||"S"===GA.cmd?c.moveTo(Object(G.converterDpi)(Object(G.adjustPosLimit)(GA.crds[0],$)+v,this.coreHelper.dpi),Object(G.converterDpi)(Object(G.adjustPosLimit)(GA.crds[1],AA)+_,this.coreHelper.dpi)):"L"===GA.cmd?c.lineTo(Object(G.converterDpi)(Object(G.adjustPosLimit)(GA.crds[0],$)+v,this.coreHelper.dpi),Object(G.converterDpi)(Object(G.adjustPosLimit)(GA.crds[1],AA)+_,this.coreHelper.dpi)):"B"===GA.cmd&&c.bezierCurveTo(Object(G.converterDpi)(Object(G.adjustPosLimit)(GA.crds[0],$)+v,this.coreHelper.dpi),Object(G.converterDpi)(Object(G.adjustPosLimit)(GA.crds[1],AA)+_,this.coreHelper.dpi),Object(G.converterDpi)(GA.crds[2]+v,this.coreHelper.dpi),Object(G.converterDpi)(GA.crds[3]+_,this.coreHelper.dpi),Object(G.converterDpi)(GA.crds[4]+v,this.coreHelper.dpi),Object(G.converterDpi)(GA.crds[5]+_,this.coreHelper.dpi))}}catch(A){wA.e(A)}finally{wA.f()}c.closePath(),c.clip()}T.push(j)}if(I.Join&&c.setLineJoin(I["@_Join"]),I.Cap&&c.setLineCap(I["@_Cap"]),I.DashPattern){var FA=I.DashPattern,NA=Object(G.parseCtm)(FA);I.DashOffset&&I.DashOffset,c.setLineDash([Object(G.converterDpi)(NA[0],this.coreHelper.dpi),Object(G.converterDpi)(NA[1],this.coreHelper.dpi)])}c.beginPath();var yA,RA=y(S);try{for(RA.s();!(yA=RA.n()).done;){var hA=yA.value;"M"===hA.cmd||"S"===hA.cmd?c.moveTo(Object(G.converterDpi)(hA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(hA.crds[1],this.coreHelper.dpi)):"L"===hA.cmd?c.lineTo(Object(G.converterDpi)(hA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(hA.crds[1],this.coreHelper.dpi)):"B"===hA.cmd?c.bezierCurveTo(Object(G.converterDpi)(hA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(hA.crds[1],this.coreHelper.dpi),Object(G.converterDpi)(hA.crds[2],this.coreHelper.dpi),Object(G.converterDpi)(hA.crds[3],this.coreHelper.dpi),Object(G.converterDpi)(hA.crds[4],this.coreHelper.dpi),Object(G.converterDpi)(hA.crds[5],this.coreHelper.dpi)):"Q"===hA.cmd?c.quadraticCurveTo(Object(G.converterDpi)(hA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(hA.crds[1],this.coreHelper.dpi),Object(G.converterDpi)(hA.crds[2],this.coreHelper.dpi),Object(G.converterDpi)(hA.crds[3],this.coreHelper.dpi)):"A"===hA.cmd||"C"===hA.cmd&&c.closePath()}}catch(A){RA.e(A)}finally{RA.f()}I.Stroke&&(J||(c.strokeStyle=B,c.lineWidth=Q),c.stroke());var MA=Y.pattern;if(!I.Fill||MA?c.fillStyle="none":(q||(c.fillStyle=g),c.fill(I.Rule)),D){var UA=document.createElement("canvas"),cA=Object(G.converterBox)(D,this.coreHelper.dpi),kA=cA.w,SA=cA.h;cA.x,cA.y;UA.width=1*kA,UA.height=1*SA,UA.style.width="".concat(kA,"px"),UA.style.height="".concat(SA,"px");var sA=UA.getContext("2d");i&&sA.transform(i.a,i.b,i.c,i.d,Object(G.converterDpi)(i.e,this.coreHelper.dpi),Object(G.converterDpi)(i.f,this.coreHelper.dpi)),E&&(sA.globalAlpha=E/255),sA.drawImage(U,h,M)}return U}}}},{key:"renderPathObject",value:function(A,I,g,B,Q,C,E,D,i,o,w,F,N,R){var h=document.createElementNS("http://www.w3.org/2000/svg","svg");h.setAttribute("version","1.1"),h.setAttribute("xmlns","http://www.w3.org/2000/svg");var M=Q.Boundary;if(!M)return{svg:h,style:""};var U=(M=Object(G.converterBox)(M,this.coreHelper.dpi)).w,c=M.h,k=M.x,S=M.y,s="overflow:hidden;position:absolute;width:".concat(Math.ceil(U),"px;height:").concat(Math.ceil(c),"px;"),a=Q.Clips;if(a&&a.length>1)return{svg:this.renderPathObjectByCanvas(d,Q,C,E,D,i,o,w,F,N,R),style:s,left:k,top:S};var Y=Q.LineWidth,K=Q.AbbreviatedData,H=Q.StrokeColor,J=Q.FillColor,L=Q.CTM,t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("ID",Q.ID),Y&&(D=Object(G.converterDpi)(Y,this.coreHelper.dpi));var d=Q.DrawParam;if(d){var Z=Object(G.getDrawParam)(B,d);(Y=Z.LineWidth)&&(D=Object(G.converterDpi)(Y,this.coreHelper.dpi)),Z.FillColor&&(J&&J.Value||(J=Z.FillColor)),Z.StrokeColor&&(H&&H.Value||(H=Z.StrokeColor))}L?t.setAttribute("transform","matrix(".concat(L.a," ").concat(L.b," ").concat(L.c," ").concat(L.d," ").concat(Object(G.converterDpi)(L.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(L.f,this.coreHelper.dpi),")")):F&&t.setAttribute("transform","matrix(".concat(F.a," ").concat(F.b," ").concat(F.c," ").concat(F.d," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")"));if(H){H.Value&&(E=Object(G.parseColor)(H.Value));var e=H.axialShd;if(e){!0;var n=document.createElementNS("http://www.w3.org/2000/svg","linearGradient");n.setAttribute("id","".concat(Q.ID)),n.setAttribute("x1","0%"),n.setAttribute("y1","0%"),n.setAttribute("x2","100%"),n.setAttribute("y2","100%");var l,q=y(e.Segment);try{for(q.s();!(l=q.n()).done;){var r=l.value;if(r){var W=document.createElement("stop");W.setAttribute("offset","".concat(100*r.position,"%")),W.setAttribute("style","stop-color:".concat(Object(G.parseColor)(r.color.Value),";stop-opacity:1")),n.appendChild(W),E=Object(G.parseColor)(r.color.Value)}}}catch(A){q.e(A)}finally{q.f()}h.appendChild(n)}}if(J){J.Value&&(C=Object(G.parseColor)(J.Value)),void 0!==J.Alpha&&0===J.Alpha&&(C="none"),void 0!==J.alpha&&0===J.alpha?C="none":t.setAttribute("fill-opacity","".concat(J.alpha/255));var x=J.axialShd;if(x){!0;var f=document.createElement("linearGradient");f.setAttribute("id","".concat(Q.ID)),f.setAttribute("x1","0%"),f.setAttribute("y1","0%"),f.setAttribute("x2","100%"),f.setAttribute("y2","100%");var V,b=y(x.Segment);try{for(b.s();!(V=b.n()).done;){var p=V.value;if(p){var m=document.createElement("stop");m.setAttribute("offset","".concat(100*p.position,"%")),m.setAttribute("style","stop-color:".concat(Object(G.parseColor)(p.color.Value),";stop-opacity:1")),f.appendChild(m),C=Object(G.parseColor)(p.color.Value)}}}catch(A){b.e(A)}finally{b.f()}h.appendChild(f)}}if(D>0&&!E&&(E="rgb(0, 0, 0)"),0===Q.Alpha&&(C="none"),o&&t.setAttribute("fill-opacity","".concat(o/255)),Q.Stroke&&(t.setAttribute("stroke","".concat(E)),t.setAttribute("stroke-width","".concat(D,"px"))),Q.Fill?(t.setAttribute("fill-rule",Q.Rule),t.setAttribute("fill","".concat(i?"none":C||"none"))):t.setAttribute("fill","none"),Q.Join&&t.setAttribute("stroke-linejoin","".concat(Q["@_Join"])),Q.Cap&&t.setAttribute("stroke-linecap","".concat(Q["@_Cap"])),Q.DashPattern){var T=Q.DashPattern,X=Object(G.parseCtm)(T),j=0;Q.DashOffset&&(j=Q.DashOffset),t.setAttribute("stroke-dasharray","".concat(Object(G.converterDpi)(X[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(X[1],this.coreHelper.dpi))),t.setAttribute("stroke-dashoffset","".concat(Object(G.converterDpi)(j,this.coreHelper.dpi),"px"))}var O,u="",z=y(K);try{for(z.s();!(O=z.n()).done;){var P=O.value;"M"===P.cmd||"S"===P.cmd?u+="M ".concat(Object(G.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[1],this.coreHelper.dpi)," "):"L"===P.cmd?u+="L ".concat(Object(G.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[1],this.coreHelper.dpi)," "):"B"===P.cmd?u+="C ".concat(Object(G.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[3],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[5],this.coreHelper.dpi)," "):"Q"===P.cmd?u+="Q ".concat(Object(G.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[3],this.coreHelper.dpi)," "):"A"===P.cmd?u+="A ".concat(Object(G.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(P.crds[1],this.coreHelper.dpi)," ").concat(P.crds[2]," ").concat(P.crds[3],",").concat(P.crds[4]," ").concat(Object(G.converterDpi)(P.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(P.crds[6],this.coreHelper.dpi)," "):"C"===P.cmd&&(u+="Z")}}catch(A){z.e(A)}finally{z.f()}t.setAttribute("d",u),h.appendChild(t);var v=J.pattern;if(v){var _=document.createElementNS("http://www.w3.org/2000/svg","defs"),$=document.createElementNS("http://www.w3.org/2000/svg","pattern");$.setAttribute("width",Object(G.converterDpi)(v.width,this.coreHelper.dpi)),$.setAttribute("height",Object(G.converterDpi)(v.height,this.coreHelper.dpi)),v.ctm&&$.setAttribute("height",Object(G.converterDpi)(v.height,this.coreHelper.dpi)+Object(G.converterDpi)(v.ctm.split(" ")[5],this.coreHelper.dpi)),$.setAttribute("x",Object(G.converterDpi)(v.width,this.coreHelper.dpi)),$.setAttribute("y",Object(G.converterDpi)(v.height,this.coreHelper.dpi)),$.setAttribute("id","pattern1-".concat(Q.ID)),$.setAttribute("patternUnits","userSpaceOnUse"),this.renderLayer(A,I,g,$,R,B,N,null,v,!1,null,null,null),_.appendChild($),h.appendChild(_);var AA=document.createElementNS("http://www.w3.org/2000/svg","rect");AA.setAttribute("width",U),AA.setAttribute("height",c),AA.setAttribute("style","fill:url(#pattern1-".concat(Q.ID,")")),h.appendChild(AA)}if(a&&a.length>0){for(var IA=[],gA=0;gA<a.length;gA++){var BA=document.createElementNS("http://www.w3.org/2000/svg","clipPath");BA.setAttribute("id","clip-path-".concat(I,"-").concat(g,"-").concat(Q.ID,"-").concat(gA));for(var QA=a[gA].Clip,CA=0;CA<QA.length;CA++){var EA=QA[CA].Area,DA=document.createElementNS("http://www.w3.org/2000/svg","path"),iA="",oA=0,wA=0,GA=0,FA=0;if(EA.Path.Boundary&&(oA=EA.Path.Boundary.x,wA=EA.Path.Boundary.y,GA=EA.Path.Boundary.w,FA=EA.Path.Boundary.h),!EA.TransFlag&&EA.CTM){var NA=EA.CTM,yA=void 0;if(yA=L?"matrix(".concat(NA.a," ").concat(NA.b," ").concat(NA.c," ").concat(NA.d," ").concat(Object(G.converterDpi)(NA.e-L.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(NA.f-L.f,this.coreHelper.dpi),")"):"matrix(".concat(NA.a," ").concat(NA.b," ").concat(NA.c," ").concat(NA.d," ").concat(Object(G.converterDpi)(NA.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(NA.f,this.coreHelper.dpi),")"),L){var RA=[[L.a,L.c,0],[L.b,L.d,0],[0,0,1]],hA=Object(G.inv)(RA);isNaN(hA[0][0])||hA[0][0]===1/0||(yA="".concat(yA," matrix(").concat(hA[0][0]," ").concat(hA[1][0]," ").concat(hA[0][1]," ").concat(hA[1][1]," 0 0)"))}DA.setAttribute("transform",yA)}if(!EA.TransFlag&&EA.Path.CTM){var MA=EA.Path.CTM,UA="matrix(".concat(MA.a," ").concat(MA.b," ").concat(MA.c," ").concat(MA.d," ").concat(Object(G.converterDpi)(MA.e-L.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(MA.f-L.f,this.coreHelper.dpi),")");if(L){var cA=[[L.a,L.c,0],[L.b,L.d,0],[0,0,1]],kA=Object(G.inv)(cA);isNaN(kA[0][0])||kA[0][0]===1/0||(UA="".concat(UA," matrix(").concat(kA[0][0]," ").concat(kA[1][0]," ").concat(kA[0][1]," ").concat(kA[1][1]," 0 0)"))}DA.setAttribute("transform",UA)}var SA,sA=y(EA.Path.AbbreviatedData);try{for(sA.s();!(SA=sA.n()).done;){var aA=SA.value;"M"===aA.cmd||"S"===aA.cmd?iA+="M ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(aA.crds[0],GA)+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(aA.crds[1],FA)+wA,this.coreHelper.dpi)," "):"L"===aA.cmd?iA+="L ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(aA.crds[0],GA)+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(aA.crds[1],FA)+wA,this.coreHelper.dpi)," "):"B"===aA.cmd?iA+="C ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(aA.crds[0],GA)+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(aA.crds[1],FA)+wA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(aA.crds[2]+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(aA.crds[3]+wA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(aA.crds[4]+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(aA.crds[5]+wA,this.coreHelper.dpi)," "):"Q"===aA.cmd?iA+="Q ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(aA.crds[0],GA)+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(aA.crds[1],FA)+wA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(aA.crds[2]+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(aA.crds[3]+wA,this.coreHelper.dpi)," "):"A"===aA.cmd?iA+="A ".concat(Object(G.converterDpi)(aA.crds[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(aA.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(aA.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(aA.crds[3],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(aA.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(aA.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(aA.crds[6],this.coreHelper.dpi)):"C"===aA.cmd&&(iA+="Z")}}catch(A){sA.e(A)}finally{sA.f()}DA.setAttribute("d",iA),BA.appendChild(DA)}IA.push(BA)}if(IA.length>0)if(1==IA.length)h.appendChild(IA[0]),t.setAttribute("clip-path","url(#clip-path-".concat(I,"-").concat(g,"-").concat(Q.ID,"-0)"));else{var YA,KA="",HA=y(IA);try{for(HA.s();!(YA=HA.n()).done;){var JA=YA.value;void 0!==JA.children[0].getAttribute("d")&&(KA+="clip-path:path('".concat(JA.children[0].getAttribute("d"),"');"))}}catch(A){HA.e(A)}finally{HA.f()}t.setAttribute("style",KA)}}if(w){var LA=document.createElementNS("http://www.w3.org/2000/svg","svg");LA.setAttribute("version","1.1");var tA=Object(G.converterBox)(w,this.coreHelper.dpi),dA=Math.ceil(tA.w),ZA=Math.ceil(tA.h),eA=tA.x+k,nA=tA.y+S;return s="overflow:hidden;position:absolute;width:".concat(dA,"px;height:").concat(ZA,"px;"),F&&L&&h.setAttribute("transform","matrix(".concat(F.a," ").concat(F.b," ").concat(F.c," ").concat(F.d," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")")),LA.appendChild(h),{svg:LA,style:s,left:eA,top:nA}}return{svg:h,style:s,left:k,top:S}}},{key:"drawGlyph",value:function(A,I,g,B,Q,C,E,D,i,o){var w=B/g,F=Q/g,N=document.createElementNS("http://www.w3.org/2000/svg","svg");N.setAttribute("version","1.1"),N.setAttribute("xmlns","http://www.w3.org/2000/svg");var y=document.createElementNS("http://www.w3.org/2000/svg","path");return y.setAttribute("transform","translate(0, ".concat(Q,") scale(").concat(w,", ").concat(-F,") translate(0, ").concat(-I,")")),y.setAttribute("d",A),C&&y.setAttribute("fill",C),y.setAttribute("fill-opacity",E),D&&(y.setAttribute("stroke","".concat(D)),y.setAttribute("stroke-width","".concat(Object(G.converterDpi)(i,this.coreHelper.dpi),"px"))),y.setAttribute("clip-path","url(#clip-path-".concat(o,"-0)")),N.appendChild(y),{img:N,yScale:F}}},{key:"watermark",value:function(A){var I={watermark_txt:"text",watermark_x:20,watermark_y:20,watermark_rows:20,watermark_cols:20,watermark_x_space:100,watermark_y_space:50,watermark_color:"#aaa",watermark_alpha:.4,watermark_fontsize:"15px",watermark_font:"微软雅黑",watermark_width:210,watermark_height:80,watermark_angle:20};if(1===arguments.length&&"object"==typeof arguments[0]){var g=arguments[0]||{};for(var B in g)g[B]&&I[B]&&g[B]===I[B]||g[B]&&(I[B]=g[B])}var Q,C,E=document.createDocumentFragment(),D=(D=Math.max(document.body.scrollWidth,document.body.clientWidth))-.015*D,i=Math.max(document.body.scrollHeight,document.body.clientHeight)+450;i=Math.max(i,window.innerHeight-30),(0==I.watermark_cols||parseInt(I.watermark_x+I.watermark_width*I.watermark_cols+I.watermark_x_space*(I.watermark_cols-1))>D)&&(I.watermark_cols=parseInt((D-I.watermark_x+I.watermark_x_space)/(I.watermark_width+I.watermark_x_space)),I.watermark_x_space=parseInt((D-I.watermark_x-I.watermark_width*I.watermark_cols)/(I.watermark_cols-1))),(0==I.watermark_rows||parseInt(I.watermark_y+I.watermark_height*I.watermark_rows+I.watermark_y_space*(I.watermark_rows-1))>i)&&(I.watermark_rows=parseInt((I.watermark_y_space+i-I.watermark_y)/(I.watermark_height+I.watermark_y_space)),I.watermark_y_space=parseInt((i-I.watermark_y-I.watermark_height*I.watermark_rows)/(I.watermark_rows-1)));for(var o=0;o<I.watermark_rows;o++){C=I.watermark_y+(I.watermark_y_space+I.watermark_height)*o;for(var w=0;w<I.watermark_cols;w++){Q=I.watermark_x+(I.watermark_width+I.watermark_x_space)*w;var G=document.createElement("div");G.id="mask_div"+o+w,G.className="mask_div",G.innerHTML=I.watermark_txt,G.style.webkitTransform="rotate(-"+I.watermark_angle+"deg)",G.style.MozTransform="rotate(-"+I.watermark_angle+"deg)",G.style.msTransform="rotate(-"+I.watermark_angle+"deg)",G.style.OTransform="rotate(-"+I.watermark_angle+"deg)",G.style.transform="rotate(-"+I.watermark_angle+"deg)",G.style.visibility="",G.style.position="absolute",G.style.left=Q+"px",G.style.top=C+"px",G.style.overflow="hidden",G.style.zIndex="9999",G.style.pointerEvents="none",G.style.opacity=I.watermark_alpha,G.style.fontSize=I.watermark_fontsize,G.style.fontFamily=I.watermark_font,G.style.color=I.watermark_color,G.style.textAlign="center",G.style.width=I.watermark_width+"px",G.style.height=I.watermark_height+"px",G.style.display="block",E.appendChild(G)}}return E}}]),A}()},function(A,I,g){"use strict";function B(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return Q(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return Q(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,C=function(){};return{s:C,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var E,D=!0,i=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return D=A.done,A},e:function(A){i=!0,E=A},f:function(){try{D||null==g.return||g.return()}finally{if(i)throw E}}}}function Q(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}g.r(I),g.d(I,"converterDpi",(function(){return C})),g.d(I,"ctmImageScale",(function(){return E})),g.d(I,"adjustPosLimit",(function(){return w})),g.d(I,"calTextPoint",(function(){return G})),g.d(I,"decodeHtml",(function(){return y})),g.d(I,"getFontFamily",(function(){return h})),g.d(I,"parseStBox",(function(){return M})),g.d(I,"parseCtm",(function(){return U})),g.d(I,"parseColor",(function(){return c})),g.d(I,"converterBox",(function(){return S})),g.d(I,"Uint8ArrayToHexString",(function(){return s})),g.d(I,"replaceFirstSlash",(function(){return a})),g.d(I,"replaceFirstTarget",(function(){return Y})),g.d(I,"readUTF",(function(){return K})),g.d(I,"getMultiMedia",(function(){return H})),g.d(I,"getDrawParam",(function(){return J})),g.d(I,"getFont",(function(){return L})),g.d(I,"inv",(function(){return Z}));var C=function(A,I){return function(A,I){return A*I/25.4}(A,I)},E=function(A){return 25.4/A},D=function(A,I,g){return{cx:A*g.a+I*g.c+1*g.e,cy:A*g.b+I*g.d+1*g.f}},i=function(A,I,g){return{ctmX:A*g.a+I*g.c,ctmY:A*g.b+I*g.d}},o=function(A,I,g){return{cx:g.x+A,cy:g.y+I}},w=function(A,I){return 0===I?A:A>I?I:A},G=function(A,I,g,Q,E,w,G,F,N){var R=0,h=0,M=0,U=0,c=[];if(!I)return c;var k,S=B(I);try{for(S.s();!(k=S.n()).done;){var s=k.value;if(s){if(R=F?parseFloat(s.X):-parseFloat(s.X),h=F?parseFloat(s.Y):-parseFloat(s.Y),isNaN(R)&&(R=0),isNaN(h)&&(h=0),M=R,U=h,Q){var a=D(M,U,Q);M=a.cx,U=a.cy}var Y=[],K=[];s.DeltaX&&s.DeltaX.length>0&&(Y=s.DeltaX),s.DeltaY&&s.DeltaY.length>0&&(K=s.DeltaY);var H=s.text;if(H){H=(H=y(H+="")).replace(/ /g," ");for(var J=0;J<H.length;J++){if(J>0&&Y.length>0){var L=J-1;if(L>=Y.length&&(L=Y.length-1),R+=N?F?Y[L]/N:-Y[L]/N:F?Y[L]:-Y[L],Q)M+=i(F?Y[J-1]:-Y[J-1],0,Q).ctmX;else M=R}if(J>0&&K.length>0){var t=J-1;if(t>=K.length&&(t=K.length-1),h+=F?K[t]:-K[t],Q)U+=i(0,F?K[J-1]:-K[J-1],Q).ctmY;else U=h}var d=H.substring(J,J+1),Z=o(M,U,E);G&&(Z=D(Z.cx,Z.cy,G));var e={x:C(R,A),y:C(h,A),text:d,cx:C(Z.cx,A),cy:C(Z.cy,A)};c.push(e)}}}}}catch(A){S.e(A)}finally{S.f()}if(c.length>0){var n,l=B(g);try{for(l.s();!(n=l.n()).done;)for(var q=n.value,r=q.CodePosition,W=q.GlyphCount,x=r;x<W+r;x++)if(c.length<=x){var f="".concat(c[c.length-1].glyph," ").concat(q.Glyphs[x-r]);c[c.length-1].glyph=f}else c[x].glyph=q.Glyphs[x-r]}catch(A){l.e(A)}finally{l.f()}}return c},F=/&\w+;|&#(\d+);/g,N={"<":"<",">":">","&":"&"," ":" ",""":'"',"©":"","'":"'"},y=function(A){return"string"!=typeof(A=null!=A?A:this.toString())?A:A.replace(F,(function(A,I){var g=N[A];return null==g&&(g=isNaN(I)?A:String.fromCharCode(160==I?32:I)),g}))},R={"楷体":"楷体, KaiTi, Kai, simkai",kaiti:"楷体, KaiTi, Kai, simkai",Kai:"楷体, KaiTi, Kai",simsun:"SimSun, simsun, Songti SC","宋体":"SimSun, simsun, Songti SC","黑体":"SimHei, STHeiti, simhei","仿宋":"FangSong, STFangsong, simfang","小标宋体":"小标宋体","方正小标宋_gbk":"方正小标宋_gbk, FZXiaoBiaoSong-B05S, NSimSun","方正小标宋简体":"方正小标宋_gbk, FZXiaoBiaoSong-B05S, NSimSun","仿宋_gb2312":"FangSong, STFangsong, simfang","楷体_gb2312":"楷体, KaiTi, Kai, simkai",couriernew:"Courier New","courier new":"Courier New"},h=function(A){if(!A)return R["宋体"];var I=A.FamilyName;I||(I=A.FontName),R[I.toLowerCase()]&&(I=R[I.toLowerCase()]);for(var g=0,B=Object.keys(R);g<B.length;g++){var Q=B[g];if(-1!=I.toLowerCase().indexOf(Q.toLowerCase()))return R[Q]}return I},M=function(A){if(A){var I=A.split(" ");return{x:parseFloat(I[0]),y:parseFloat(I[1]),w:parseFloat(I[2]),h:parseFloat(I[3])}}return null},U=function(A){return A.split(" ")},c=function(A){if(!(A&&A.length>0))return"rgb(0, 0, 0)";if(-1!==A.indexOf("#"))return A="#"+(A=(A=A.replace(/#/g,"")).replace(/ /g,"")).toString();var I=A.split(" ");if(3===I.length)return"rgb(".concat(I[0],", ").concat(I[1],", ").concat(I[2],")");if(4===I.length){var g=k(I[0],I[1],I[2],I[3]);return"rgb(".concat(g.r,", ").concat(g.g,", ").concat(g.b,")")}},k=function(A,I,g,B,Q){var C=1-(A=(A/=100)*(1-(B/=100))+B),E=1-(I=(I/=100)*(1-B)+B),D=1-(g=(g/=100)*(1-B)+B);return Q||(C=Math.round(255*C),E=Math.round(255*E),D=Math.round(255*D)),{r:C,g:E,b:D}},S=function(A,I){return{x:C(A.x,I),y:C(A.y,I),w:C(A.w,I),h:C(A.h,I)}},s=function(A){for(var I=[],g=0,B=0;B<2*A.length;B+=2)I[B>>>3]|=parseInt(A[g],10)<<24-B%8*4,g++;for(var Q=[],C=0;C<A.length;C++){var E=I[C>>>2]>>>24-C%4*8&255;Q.push((E>>>4).toString(16)),Q.push((15&E).toString(16))}return Q.join("")},a=function(A){return A&&0===A.indexOf("/")&&(A=A.replace("/","")),A},Y=function(A,I){return A&&0===A.indexOf(I)&&(A=A.replace(I,"")),A},K=function(A){if("string"==typeof A)return A;for(var I="",g=A,B=0;B<g.length;B++){var Q=g[B].toString(2),C=Q.match(/^1+?(?=0)/);if(C&&8==Q.length){for(var E=C[0].length,D=g[B].toString(2).slice(7-E),i=1;i<E;i++)D+=g[i+B].toString(2).slice(2);I="".concat(I).concat(String.fromCharCode(parseInt(D,2))),B+=E-1}}return I},H=function(A,I){var g,Q=B(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}},J=function(A,I){var g,Q=B(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}},L=function(A,I){var g,Q=B(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}};function t(A){if(A.length!==A[0].length)throw new Error;var I=A.length,g=0;if(I>3)for(var B=0;B<I;B++){for(var Q=new Array(I-1).fill(0).map((function(A){return new Array(I-1).fill(0)})),C=0;C<I-1;C++)for(var E=0;E<I-1;E++)Q[C][E]=E<B?A[C+1][E]:A[C+1][E+1];g+=A[0][B]*Math.pow(-1,0+B)*t(Q)}else 3===I?g=A[0][0]*A[1][1]*A[2][2]+A[0][1]*A[1][2]*A[2][0]+A[0][2]*A[1][0]*A[2][1]-A[0][2]*A[1][1]*A[2][0]-A[0][1]*A[1][0]*A[2][2]-A[0][0]*A[1][2]*A[2][1]:2===I?g=A[0][0]*A[1][1]-A[0][1]*A[1][0]:1===I&&(g=A[0][0]);return g}function d(A){if(A[0].length!==A.length)throw new Error;for(var I=A.length,g=new Array(I).fill(0).map((function(A){return new Array(I).fill(0)})),B=0;B<I;B++)for(var Q=0;Q<I;Q++){for(var C=[],E=0;E<A.length;E++)if(E!==B){for(var D=[],i=0;i<A.length;i++)i!==Q&&D.push(A[E][i]);C.push(D)}g[B][Q]=Math.pow(-1,B+Q)*t(C)}return function(A){for(var I=new Array(A.length).fill(0).map((function(I){return new Array(A[0].length).fill(0)})),g=0;g<I.length;g++)for(var B=0;B<I[0].length;B++)I[g][B]=A[B][g];return I}(g)}function Z(A){if(A[0].length!==A.length)throw new Error;for(var I=t(A),g=d(A),B=0;B<g.length;B++)for(var Q=0;Q<g.length;Q++)g[B][Q]/=I;return g}},function(A,I,g){"use strict";g.r(I),g.d(I,"needInitAgain",(function(){return o})),g.d(I,"setYYDS",(function(){return w})),g.d(I,"freeMemory",(function(){return G})),g.d(I,"getStreamData",(function(){return F})),g.d(I,"CreateLibrary",(function(){return N})),g.d(I,"CreateNativeStream",(function(){return y})),g.d(I,"FT_Open_Face",(function(){return R})),g.d(I,"loadFaceInfo",(function(){return h})),g.d(I,"FT_Glyph_Get_Measure",(function(){return M})),g.d(I,"freeOFD",(function(){return U})),g.d(I,"readOFD",(function(){return c})),g.d(I,"readOFDByBase64",(function(){return k})),g.d(I,"hashPath",(function(){return S})),g.d(I,"MD5",(function(){return s})),g.d(I,"SHA1",(function(){return a})),g.d(I,"SM3",(function(){return Y})),g.d(I,"base64EncodeByByte",(function(){return K})),g.d(I,"base64Encode",(function(){return H})),g.d(I,"base64DecodeToUint8Array",(function(){return J})),g.d(I,"JSBase64ByHashFile",(function(){return L})),g.d(I,"JSGetImageInfoByBase64",(function(){return t})),g.d(I,"JSGetImageInfoByPath",(function(){return d})),g.d(I,"JSReadPageInfo",(function(){return Z})),g.d(I,"JSGetPathEncode",(function(){return e})),g.d(I,"JSPackageSigned",(function(){return n})),g.d(I,"JSGetToSign",(function(){return l}));var B,Q,C,E,D=g(33),i=g(34),o=function(){return!B},w=function(A){B=A},G=function(A){B._ASC_FT_Free(A.data),A.data=0},F=function(){return E},N=function(){Q=B._ASC_FT_Init()},y=function(A){var I=new Uint8Array(A),g=B._malloc(A.byteLength);return B.HEAPU8.set(I,g),{data:g,length:A.byteLength}},R=function(A){return B._ASC_FT_Open_Face(Q,A.data,A.length,0)},h=function(A){var I=B._ASC_FT_GetFaceInfo(A);if(I){var g=new D.CFaceInfo,Q=Math.min(B.HEAP8.length-I>>2,250),C=new Int32Array(B.HEAP8.buffer,I,Q),E=0;g.units_per_EM=Math.abs(C[E++]),g.ascender=C[E++],g.descender=C[E++],g.height=C[E++],g.face_flags=C[E++],g.num_faces=C[E++],g.num_glyphs=C[E++],g.num_charmaps=C[E++],g.style_flags=C[E++],g.face_index=C[E++];for(var i=C[E++];i;)g.family_name+=String.fromCharCode(i),i=C[E++];for(i=C[E++];i;)g.style_name+=String.fromCharCode(i),i=C[E++];g.os2_version=C[E++],g.os2_usWeightClass=C[E++],g.os2_fsSelection=C[E++],g.os2_usWinAscent=C[E++],g.os2_usWinDescent=C[E++],g.os2_usDefaultChar=C[E++],g.os2_sTypoAscender=C[E++],g.os2_sTypoDescender=C[E++],g.os2_sTypoLineGap=C[E++],g.os2_ulUnicodeRange1=q(C[E++]),g.os2_ulUnicodeRange2=q(C[E++]),g.os2_ulUnicodeRange3=q(C[E++]),g.os2_ulUnicodeRange4=q(C[E++]),g.os2_ulCodePageRange1=q(C[E++]),g.os2_ulCodePageRange2=q(C[E++]),g.os2_nSymbolic=C[E++],g.header_yMin=C[E++],g.header_yMax=C[E++];for(var o=C[E++],w=0;w<o;w++)g.monochromeSizes.push(C[E++]);return B._ASC_FT_Free(I),I=null,g}},M=function(A,I){if(B._AST_FT_Load_Glyph(A,I,1)>0)return" ";var g=B._ASC_FT_Get_Glyph_Measure_Params(A,1);if(!g)return null;var Q=B.HEAP32[g>>2],C=new Int32Array(B.HEAP8.buffer,g,Q),E=new i.CGlyphMetrics;E.bbox_xMin=C[1],E.bbox_yMin=C[2],E.bbox_xMax=C[3],E.bbox_yMax=C[4],E.width=C[5],E.height=C[6],E.horiAdvance=C[7],E.horiBearingX=C[8],E.horiBearingY=C[9],E.vertAdvance=C[10],E.vertBearingX=C[11],E.vertBearingY=C[12],E.linearHoriAdvance=C[13],E.linearVertAdvance=C[14],E.horiUnderlinePosition=E.horiBearingY-E.height;for(var D=15,o="";D<Q;)switch(C[D++]){case 0:o+=" M ".concat(C[D++]," ").concat(C[D++]);break;case 1:o+=" L ".concat(C[D++]," ").concat(C[D++]);break;case 2:o+=" Q ".concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]);break;case 3:o+=" C ".concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++])}return E.glyphPath=o,B._ASC_FT_Free(g),C=null,E},U=function(A){if(G(C),A.ofdParserPtr>0)B.JSFreeOFD(A.ofdParserPtr);var I=A.getFontRes(0);I&&I.forEach((function(A){A.face&&B._ASC_FT_Free(A.face)}))},c=function(A,I,g){E=A,C=y(A);var D=B.JSReadOFD(Q,C.data,C.length,I||"kgNVVbdUZ31C6mps",g?g.toLowerCase():"");if(D.data&&D.data.ofd&&(D.data.ofd.size=C.length),0!==D.code)switch(D.msg){case"10001":D.msg="授权信息错误";break;case"10002":D.msg="授权时间过期";break;case"10003":var i="非ofd文件无法打开";switch(D.file_type){case 0:break;case 9:i="PDF文件无法打开";break;default:i="图片文件无法打开"}D.msg=i}return D},k=function(A,I,g){return B.JSReadOFDByBase64(Q,A,I||"kgNVVbdUZ31C6mps",g?g.toLowerCase():"")},S=function(A,I,g){return B.JSHashPath(A,I,g)},s=function(A){return B.JSMD5(A)},a=function(A){return B.JSSHA1(A)},Y=function(A){return B.JSSM3(A)},K=function(A){var I=y(A),g=B.JSBase64EncodeByByte(I.data,I.length);return G(I),g},H=function(A){return B.JSBase64Encode(A)},J=function(A){var I=B.JSBase64Decode(A);return new Uint8Array(B.HEAPU8.buffer,I.ptr,I.len).slice(0,I.len)},L=function(A,I,g){var Q=y(A);return B.JSBase64ByHashFile(Q.data,Q.length,I,g)},t=function(A){var I=B.JSGetImageInfoByBase64(A);return"jb2"!==I.ext&&"jp2"!==I.ext&&"tif"!==I.ext&&"gif"!==I.ext&&"bmp"!==I.ext||(I.ext="png"),0===I.fileBase64.length&&(I.fileBase64=A),0!==I.fileBase64.indexOf("data:image")&&(I.fileBase64="data:image/".concat(I.ext,";base64,").concat(I.fileBase64)),I},d=function(A,I,g,Q,C){C||(C="");var E=B.JSGetImageInfoByPath(A,I,g,Q,C);return"jb2"!==E.ext&&"jp2"!==E.ext&&"tif"!==E.ext&&"gif"!==E.ext&&"bmp"!==E.ext&&"webp"!==E.ext||(E.ext="png"),0!==E.fileBase64.indexOf("data:image")&&(E.fileBase64="data:image/".concat(E.ext,";base64,").concat(E.fileBase64)),E},Z=function(A,I,g,Q,C){return B.JSReadPageInfo(A,I,g,Q,C)},e=function(A,I){var g=B.JSGetPathEncode(A,I);return new Uint8Array(B.HEAPU8.buffer,g.ptr,g.ptr_len).slice(0,g.ptr_len)},n=function(A,I){var g=B.JSPackageSigned(A,I);return g.ptr_len>0?new Uint8Array(B.HEAPU8.buffer,g.ptr,g.ptr_len).slice(0,g.ptr_len):g},l=function(A,I){return B.JSGetToSign(A,I)},q=function(A){return A<0?A+4294967296:A}},function(A,I,g){"use strict";g.r(I),g.d(I,"CFaceInfo",(function(){return D}));var B=g(1),Q=g.n(B),C=g(5),E=g.n(C),D=Q()((function A(){E()(this,A),this.units_per_EM=0,this.ascender=0,this.descender=0,this.height=0,this.face_flags=0,this.num_faces=0,this.num_glyphs=0,this.num_charmaps=0,this.style_flags=0,this.face_index=0,this.family_name="",this.style_name="",this.os2_version=0,this.os2_usWeightClass=0,this.os2_fsSelection=0,this.os2_usWinAscent=0,this.os2_usWinDescent=0,this.os2_usDefaultChar=0,this.os2_sTypoAscender=0,this.os2_sTypoDescender=0,this.os2_sTypoLineGap=0,this.os2_ulUnicodeRange1=0,this.os2_ulUnicodeRange2=0,this.os2_ulUnicodeRange3=0,this.os2_ulUnicodeRange4=0,this.os2_ulCodePageRange1=0,this.os2_ulCodePageRange2=0,this.os2_nSymbolic=0,this.header_yMin=0,this.header_yMax=0,this.monochromeSizes=[]}))},function(A,I,g){"use strict";g.r(I),g.d(I,"CGlyphMetrics",(function(){return D}));var B=g(1),Q=g.n(B),C=g(5),E=g.n(C),D=Q()((function A(){E()(this,A),this.bbox_xMin=0,this.bbox_yMin=0,this.bbox_xMax=0,this.bbox_yMax=0,this.width=0,this.height=0,this.horiAdvance=0,this.horiBearingX=0,this.horiBearingY=0,this.vertAdvance=0,this.vertBearingX=0,this.vertBearingY=0,this.linearHoriAdvance=0,this.linearVertAdvance=0,this.horiUnderlinePosition=0,this.glyphPath=null}))},function(A,I,g){"use strict";g.r(I),g.d(I,"Ofd_Core",(function(){return w}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=(g(31),g(32));function i(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return o(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return o(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function o(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var w=function(){function A(I,g,B){Q()(this,A),this.ofd=I,this.ofdParserPtr=g,this.leftTime=B}return E()(A,[{key:"getMetadata",value:function(A){return A?A>this.ofd.DocBody.length&&(A=this.ofd.DocBody.length-1):A=0,{Title:this.ofd.DocBody[A].DocInfo.Title,Author:this.ofd.DocBody[A].DocInfo.Author,Subject:this.ofd.DocBody[A].DocInfo.Subject,Creator:this.ofd.DocBody[A].DocInfo.Creator,CreationDate:this.ofd.DocBody[A].DocInfo.CreationDate,CreatorVersion:this.ofd.DocBody[A].DocInfo.CreatorVersion,ModificationDate:this.ofd.DocBody[A].DocInfo.ModDate,Keywords:this.ofd.DocBody[A].DocInfo.Keywords,numPages:this.getOFDPageCount(A),pageSize:"".concat(this.pageWidth(A,0),"毫米 X ").concat(this.pageHeight(A,0),"毫米")}}},{key:"readOfdDocBody",value:function(A){return this.ofd?(A?A>this.ofd.DocBody.length&&(A=this.ofd.DocBody.length-1):A=0,this.ofd.DocBody[A]):null}},{key:"readOfdDocument",value:function(A){return this.ofd?(A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0,this.ofd.Document[A]):null}},{key:"readOfdPage",value:function(A,I){if(!this.ofd)return null;A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0;var g=this.ofd.Document[A],B=g.Pages[I];if(B.Page.onlyReadArea){var Q=Object(D.JSReadPageInfo)(this.ofdParserPtr,B.BasePln,B.BaseAbs,B.pln,B.abs);g.Pages[I].Page=Q.Page}return g.Pages[I]}},{key:"readOfdTemplatePage",value:function(A){return this.ofd?(A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0,this.ofd.Document[A].CommonData.TemplatePage):null}},{key:"readPageFromTemplate",value:function(A){if(A.Page.onlyReadArea){var I=Object(D.JSReadPageInfo)(this.ofdParserPtr,A.BasePln,A.BaseAbs,"","");A.Page=I.Page}return A}},{key:"getOFDPageCount",value:function(A){var I=this.readOfdDocument(A);return I?I.Pages.length:0}},{key:"pageWidth",value:function(A,I){var g=this.readOfdDocument(A);if(!g)return 0;var B=g.Pages[I];return this.calPageBox(g,B).w}},{key:"pageHeight",value:function(A,I){var g=this.readOfdDocument(A);if(!g)return 0;var B=g.Pages[I];return this.calPageBox(g,B).h}},{key:"calPageBox",value:function(A,I){var g,B=I.Page.Area;if(B&&Object.keys(B).length>0){var Q=B.PhysicalBox;if(Q)g=Q;else{var C=B.ApplicationBox;if(C)g=C;else{var E=B.ContentBox;E&&(g=E)}}}else{var D=A.CommonData.PageArea,i=D.PhysicalBox;if(i)g=i;else{var o=D.ApplicationBox;if(o)g=o;else{var w=D.ContentBox;w&&(g=w)}}}return g}},{key:"getSignatureCount",value:function(A){var I=this.readOfdDocument(A);return I&&I.Signatures&&I.Signatures.Signature?I.Signatures.Signature.length:0}},{key:"getAllSignature",value:function(A){var I=this.readOfdDocument(A);return I&&I.Signatures?I.Signatures.Signature:0}},{key:"getSignatureByIndex",value:function(A,I){var g=this.readOfdDocument(A);return g?g.Signatures.Signature[I]:null}},{key:"findSignature",value:function(A,I,g){var B=null,Q=this.readOfdDocument(A);if(Q)for(var C=0;C<Q.Signatures.Signature.length;C++){var E,D=i(Q.Signatures.Signature);try{for(D.s();!(E=D.n()).done;){var o,w=E.value,G=i(w.Signature.SignedInfo.StampAnnot);try{for(G.s();!(o=G.n()).done;){var F=o.value;if(F.ID==g&&F.PageRef==I){B=w.Signature;break}}}catch(A){G.e(A)}finally{G.f()}}}catch(A){D.e(A)}finally{D.f()}}return B}},{key:"getFontRes",value:function(A){var I,g=this.readOfdDocument(A);if(g)return null==g||null===(I=g.CommonData)||void 0===I||null===(I=I.Res)||void 0===I?void 0:I.Fonts}},{key:"getDocPln",value:function(A){var I=this.readOfdDocBody(A);if(I)return null==I?void 0:I.DocPln}},{key:"getAttachmentCount",value:function(A){var I=this.readOfdDocument(A);return I&&I.Attachments?I.Attachments.length:0}},{key:"getCustomTag",value:function(A){var I=this.readOfdDocument(A);return I&&I.CustomTags?I.CustomTags:null}},{key:"getPageIndexByPageId",value:function(A,I){if(!this.ofd)return 0;A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0;for(var g=this.ofd.Document[A],B=0;B<g.Pages.length;B++){if(g.Pages[B].ID==I)return B}}},{key:"getAllAttachment",value:function(A){var I=this.readOfdDocument(A);return I&&I.Attachments?I.Attachments:[]}},{key:"getAttachmentByIndex",value:function(A,I){var g=this.readOfdDocument(A);return g?g.Attachments[I]:null}},{key:"getAttachmentByID",value:function(A,I){var g=this.readOfdDocument(A);if(g){var B,Q=i(g.Attachments);try{for(Q.s();!(B=Q.n()).done;){var C=B.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}}return null}},{key:"getTextObject",value:function(A,I){var g=[],B=this.readOfdPage(A,I);if(B){var Q,C=i(B.Page.Content.Layer);try{for(C.s();!(Q=C.n()).done;){var E,D=i(Q.value.PageBlock);try{for(D.s();!(E=D.n()).done;){var o=E.value;if("TextObject"==o.Type){var w,G="",F=i(o.TextCode);try{for(F.s();!(w=F.n()).done;){var N=w.value;G="".concat(G).concat(N.text)}}catch(A){F.e(A)}finally{F.f()}if(G.length>0){var y={id:o.ID,pageId:B.ID};y.text=G,g.push(y)}}}}catch(A){D.e(A)}finally{D.f()}}}catch(A){C.e(A)}finally{C.f()}}return g}},{key:"getAllTextObject",value:function(A){for(var I=[],g=this.readOfdDocument(A),B=0;B<g.Pages.length;B++){var Q=g.Pages[B];if(Q.Page.onlyReadArea){var C=Object(D.JSReadPageInfo)(this.ofdParserPtr,Q.BasePln,Q.BaseAbs,Q.pln,Q.abs);Q.Page=C.Page}if(Q){var E,o=i(Q.Page.Content.Layer);try{for(o.s();!(E=o.n()).done;){var w,G=i(E.value.PageBlock);try{for(G.s();!(w=G.n()).done;){var F=w.value;if("TextObject"==F.Type){var N,y="",R=i(F.TextCode);try{for(R.s();!(N=R.n()).done;){var h=N.value;y="".concat(y).concat(h.text)}}catch(A){R.e(A)}finally{R.f()}if(y.length>0){var M={id:F.ID,pageId:Q.ID,pageIndex:B+1};M.text=y,I.push(M)}}}}catch(A){G.e(A)}finally{G.f()}}}catch(A){o.e(A)}finally{o.f()}}}return I}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"Ofd_Core_Helper",(function(){return i}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=g(31),i=function(){function A(){var I=arguments.length>0&&void 0!==arguments[0]?arguments[0]:96,g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Q()(this,A),this.dpi=I,this.waterText=g}return E()(A,[{key:"setWaterText",value:function(A){this.waterText=A}},{key:"setWaterSetting",value:function(A){this.waterSetting=A}},{key:"setDpi",value:function(A){this.dpi=A}},{key:"pageRenderWidth",value:function(A,I,g){var B=g.pageWidth(A,I);return B=Object(D.converterDpi)(B,this.dpi)}},{key:"pageRenderHeight",value:function(A,I,g){var B=g.pageHeight(A,I);return B=Object(D.converterDpi)(B,this.dpi)}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdCanvasRender",(function(){return M}));var B=g(7),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(8),w=g.n(o),G=g(31),F=g(32),N=g(35),y=g(30);function R(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return h(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return h(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function h(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var M=function(){function A(I,g){E()(this,A),this.core=I,this.coreHelper=g,this.render=new y.Ofd_Render(this.core,this.coreHelper)}var I,g,B,C,D,o,h,M,U,c;return i()(A,[{key:"setOfdCore",value:function(A){this.core=A,this.render.setOfdCore(this.core)}},{key:"renderPageByCanvas",value:(c=Q()(w.a.mark((function A(I,g,B,Q,C){var E,D,i,o,y,h,M,U,c,k,S,s,a,Y,K,H,J,L,t,d,Z,e,n,l,q,r,W,x,f,V,b,p,m,T,X,j,O,u,z,P;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(E=C?C.readOfdDocument(B):this.core.readOfdDocument(B),D=C?C.readOfdPage(B,Q):this.core.readOfdPage(B,Q),i=D.Page.Template,E.Annotations,o=C?C.readOfdTemplatePage(B):this.core.readOfdTemplatePage(B),y=E.Signatures?E.Signatures.Signature:[],h=E.CommonData.Res.Fonts,M=E.CommonData.Res.DrawParams,E.CommonData.Res.ColorSpaces,U=E.CommonData.Res.CompositeGraphicUnits,c=E.CommonData.Res.MultiMedias,!i){A.next=64;break}k=R(i),A.prev=13,k.s();case 15:if((S=k.n()).done){A.next=56;break}s=S.value,a=R(o),A.prev=18,a.s();case 20:if((Y=a.n()).done){A.next=46;break}if((K=Y.value).ID!=s.TemplateID){A.next=44;break}if(!(K=C?C.readPageFromTemplate(K):this.core.readPageFromTemplate(K)).Page.Content){A.next=43;break}H=K.Page.Content.Layer,J=R(H),A.prev=27,J.s();case 29:if((L=J.n()).done){A.next=35;break}return t=L.value,A.next=33,this.renderLayerByCanvas(I,g,h,M,c,U,t,!1);case 33:A.next=29;break;case 35:A.next=40;break;case 37:A.prev=37,A.t0=A.catch(27),J.e(A.t0);case 40:return A.prev=40,J.f(),A.finish(40);case 43:return A.abrupt("break",46);case 44:A.next=20;break;case 46:A.next=51;break;case 48:A.prev=48,A.t1=A.catch(18),a.e(A.t1);case 51:return A.prev=51,a.f(),A.finish(51);case 54:A.next=15;break;case 56:A.next=61;break;case 58:A.prev=58,A.t2=A.catch(13),k.e(A.t2);case 61:return A.prev=61,k.f(),A.finish(61);case 64:if(!D.Page.Content){A.next=83;break}d=D.Page.Content.Layer,Z=R(d),A.prev=67,Z.s();case 69:if((e=Z.n()).done){A.next=75;break}return n=e.value,A.next=73,this.renderLayerByCanvas(I,g,h,M,c,U,n,!1);case 73:A.next=69;break;case 75:A.next=80;break;case 77:A.prev=77,A.t3=A.catch(67),Z.e(A.t3);case 80:return A.prev=80,Z.f(),A.finish(80);case 83:l=R(y),A.prev=84,l.s();case 86:if((q=l.n()).done){A.next=134;break}r=q.value,W=R(r.Signature.SignedInfo.StampAnnot),A.prev=89,W.s();case 91:if((x=W.n()).done){A.next=124;break}if(f=x.value,V=f.PageRef,D.ID!=V){A.next=122;break}if(b=f.Boundary,!(r.Signature.PicType&&r.Signature.PicType.length>0)){A.next=122;break}if("ofd"!==r.Signature.PicType){A.next=108;break}p=new N.Ofd_Core(r.Signature.ofd,this.coreHelper.dpi),m=0;case 100:if(!(m<p.getOFDPageCount(0))){A.next=106;break}return A.next=103,this.renderSealPageOnCanvas(I,g,m,p,!0,b,V,f.ID);case 103:m++,A.next=100;break;case 106:A.next=122;break;case 108:if("svg"!==r.Signature.PicType){A.next=114;break}return T="data:image/svg+xml;base64,".concat(r.Signature.PicValue),A.next=112,this.renderSealSvgOnCanvas(I,g,T,b);case 112:A.next=122;break;case 114:return X=b.w,j=b.h,O=Object(G.converterBox)(b,this.coreHelper.dpi),u=Object(F.JSGetImageInfoByBase64)(r.Signature.PicValue),z=u.fileBase64,P={a:X,b:0,c:0,d:j,e:0,f:0},A.next=122,this.renderImageOnCanvas(I,g,z,u.width,u.height,O,f.Clip,!0,V,f.ID,P);case 122:A.next=91;break;case 124:A.next=129;break;case 126:A.prev=126,A.t4=A.catch(89),W.e(A.t4);case 129:return A.prev=129,W.f(),A.finish(129);case 132:A.next=86;break;case 134:A.next=139;break;case 136:A.prev=136,A.t5=A.catch(84),l.e(A.t5);case 139:return A.prev=139,l.f(),A.finish(139);case 142:case"end":return A.stop()}}),A,this,[[13,58,61,64],[18,48,51,54],[27,37,40,43],[67,77,80,83],[84,136,139,142],[89,126,129,132]])}))),function(A,I,g,B,Q){return c.apply(this,arguments)})},{key:"renderAnnotationOnCanvas",value:(U=Q()(w.a.mark((function A(I,g,B,Q,C,E,D){var i,o,F,N,y;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(i=B.Appearance,!(o=B.Appearance.Boundary)){A.next=15;break}if(0!==o.w&&0!==o.h){A.next=5;break}return A.abrupt("return");case 5:return F=Object(G.converterBox)(o,this.coreHelper.dpi),(N=document.createElement("canvas")).style.height="".concat(F.w,"px"),N.style.width="".concat(F.h,"px"),N.width=F.w,N.height=F.h,y=N.getContext("2d"),A.next=14,this.renderLayerByCanvas(N,y,Q,C,E,D,i,!1);case 14:g.drawImage(N,F.x,F.y);case 15:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C,E){return U.apply(this,arguments)})},{key:"renderSealSvgOnCanvas",value:(M=Q()(w.a.mark((function A(I,g,B,Q,C,E){var D;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return D=Object(G.converterBox)(Q,this.coreHelper.dpi),A.abrupt("return",new Promise((function(A,I){var Q=new Image;Q.src=B,Q.onload=function(){var I=Q.width,B=Q.height,C=document.createElement("canvas");if(C.style.height="".concat(I,"px"),C.style.width="".concat(B,"px"),C.width=I,C.height=B,C.getContext("2d").drawImage(Q,0,0),I!==D.w){var E=D.h/B<D.w/I?D.h/B:D.w/I,i=document.createElement("canvas");i.style.height="".concat(D.w,"px"),i.style.width="".concat(D.h,"px"),i.width=D.w,i.height=D.h;var o=i.getContext("2d");o.scale(E,E),o.drawImage(C,0,0),g.drawImage(i,D.x,D.y)}else g.drawImage(C,D.x,D.y);A()}})));case 2:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C){return M.apply(this,arguments)})},{key:"renderSealPageOnCanvas",value:(h=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i){var o,F,N,y,R,h,M,U,c,k;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return o={x:0,y:0,w:0,h:0},o=E,F={x:E.x,y:E.y,w:Q.pageWidth(0,B),h:Q.pageHeight(0,B)},N=Object(G.converterBox)(F,this.coreHelper.dpi),y=1,(R=document.createElement("canvas")).style.height="".concat(N.w,"px"),R.style.width="".concat(N.h,"px"),R.width=N.w,R.height=N.h,h=R.getContext("2d"),A.next=13,this.renderPageByCanvas(R,h,0,B,Q);case 13:h.scale(y,y),F.w!==o.w?(M=o.h/F.h<o.w/F.w?o.h/F.h:o.w/F.w,U=document.createElement("canvas"),c=Object(G.converterBox)(o,this.coreHelper.dpi),U.style.height="".concat(c.w,"px"),U.style.width="".concat(c.h,"px"),U.width=c.w,U.height=c.h,(k=U.getContext("2d")).scale(M,M),k.drawImage(R,0,0),g.drawImage(U,N.x,N.y)):g.drawImage(R,N.x,N.y);case 15:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C,E,D){return h.apply(this,arguments)})},{key:"renderLayerByCanvas",value:(o=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,F,N){var y,h,M,U,c,k,S,s,a,Y,K,H,J,L,t;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(y=null,h=null,M=Object(G.converterDpi)(.353,this.coreHelper.dpi),(U=D.DrawParam)&&Object(G.getDrawParam)(Q,U)&&(c=Object(G.getDrawParam)(Q,U),Object(G.getDrawParam)(Q,c.Relative)&&(c=Object(G.getDrawParam)(Q,c.Relative)),c.FillColor&&(y=Object(G.parseColor)(c.FillColor.Value)),c.StrokeColor&&(y=Object(G.parseColor)(c.StrokeColor.Value)),c.LineWidth&&(M=Object(G.converterDpi)(c.LineWidth,this.coreHelper.dpi))),!(k=D.PageBlock)){A.next=60;break}S=R(k),A.prev=8,S.s();case 10:if((s=S.n()).done){A.next=52;break}if("ImageObject"!=(a=s.value).Type){A.next=17;break}return A.next=15,this.renderImageObject(I,g,C,a,i,F,N);case 15:A.next=50;break;case 17:if("PathObject"!=a.Type){A.next=22;break}return A.next=20,this.renderPathObject(I,g,Q,a,y,h,M,i,o,F,N,C,B);case 20:A.next=50;break;case 22:if("TextObject"!=a.Type){A.next=27;break}return A.next=25,this.renderTextObject(I,g,B,a,y,h,Q,o,F,N);case 25:A.next=50;break;case 27:if("CompositeObject"!=a.Type){A.next=50;break}Y=R(E),A.prev=29,Y.s();case 31:if((K=Y.n()).done){A.next=42;break}if((H=K.value).ID!==a.ResourceID){A.next=40;break}return J=a.Alpha,L=a.Boundary,t=a.CTM,A.next=39,this.renderLayerByCanvas(I,g,B,Q,C,E,H,!1,J,L,t);case 39:return A.abrupt("break",42);case 40:A.next=31;break;case 42:A.next=47;break;case 44:A.prev=44,A.t0=A.catch(29),Y.e(A.t0);case 47:return A.prev=47,Y.f(),A.finish(47);case 50:A.next=10;break;case 52:A.next=57;break;case 54:A.prev=54,A.t1=A.catch(8),S.e(A.t1);case 57:return A.prev=57,S.f(),A.finish(57);case 60:case"end":return A.stop()}}),A,this,[[8,54,57,60],[29,44,47,50]])}))),function(A,I,g,B,Q,C,E,D,i,w,G){return o.apply(this,arguments)})},{key:"renderImageObject",value:(D=Q()(w.a.mark((function A(I,g,B,Q,C,E,D){var i,o,N,y,R,h;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(i=Q.Boundary,i=Object(G.converterBox)(i,this.coreHelper.dpi),o=Q.ResourceID){A.next=5;break}return A.abrupt("return");case 5:return(N=Object(G.getMultiMedia)(B,o)).width>0||N.height>0||(y=Object(F.JSGetImageInfoByBase64)(N.FileBase64),N.width=y.width,N.height=y.height,N.FileBase64=y.fileBase64),R=Q.CTM,h=Q.Clips,A.next=11,this.renderImageOnCanvas(I,g,N.FileBase64,N.width,N.height,i,!1,C,null,null,R,E,D,h);case 11:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C,E){return D.apply(this,arguments)})},{key:"renderImageOnCanvas",value:(C=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,F,N,y,h,M){var U=this;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(!i){A.next=4;break}return A.next=3,this.render.throwWhite(B);case 3:B=A.sent;case 4:return A.abrupt("return",new Promise((function(A,I){var D=E.x,i=E.y,o=new Image;o.src=B,o.width=Q,o.height=C;var w=U;o.onload=function(){if(y){var I=document.createElement("canvas");I.width=E.w,I.height=E.h,I.style.width="".concat(E.w,"px"),I.style.height="".concat(E.h,"px");var B=I.getContext("2d");N&&B.transform(N.a/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.b/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.c/C/Object(G.ctmImageScale)(w.coreHelper.dpi),N.d/C/Object(G.ctmImageScale)(w.coreHelper.dpi),Object(G.converterDpi)(N.e,w.coreHelper.dpi),Object(G.converterDpi)(N.f,w.coreHelper.dpi)),B.drawImage(o,0,0);var F=document.createElement("canvas"),U=Object(G.converterBox)(y,w.coreHelper.dpi),c=U.w,k=U.h,S=U.x,s=U.y;F.width=c,F.height=k,F.style.width="".concat(c,"px"),F.style.height="".concat(k,"px");var a=F.getContext("2d");h&&a.transform(h.a,h.b,h.c,h.d,Object(G.converterDpi)(h.e,w.coreHelper.dpi),Object(G.converterDpi)(h.f,w.coreHelper.dpi)),a.drawImage(I,D,i),g.drawImage(F,S,s)}else{var Y=document.createElement("canvas");Y.width=Math.ceil(E.w),Y.height=Math.ceil(E.h),Y.style.width="".concat(Math.ceil(E.w),"px"),Y.style.height="".concat(Math.ceil(E.h),"px");var K=Y.getContext("2d");if(M&&M.length>0)for(var H=0;H<M.length;H++)for(var J=M[H].Clip,L=0;L<J.length;L++){var t=J[L].Area,d=void 0;t.CTM?d=t.CTM:N&&(d=N),K.beginPath();var Z,e=R(t.Path.AbbreviatedData);try{for(e.s();!(Z=e.n()).done;){var n=Z.value;if("M"===n.cmd||"S"===n.cmd){var l=n.crds[0],q=n.crds[1];if(d){var r=w.ctmCalPoint(l,q,d);l=r.ctmX,q=r.ctmY}K.moveTo(Object(G.converterDpi)(l,w.coreHelper.dpi),Object(G.converterDpi)(q,w.coreHelper.dpi))}else if("L"===n.cmd){var W=n.crds[0],x=n.crds[1];if(d){var f=w.ctmCalPoint(W,x,d);W=f.ctmX,x=f.ctmY}K.lineTo(Object(G.converterDpi)(W,w.coreHelper.dpi),Object(G.converterDpi)(x,w.coreHelper.dpi))}else if("B"===n.cmd){var V=n.crds[0],b=n.crds[1],p=n.crds[2],m=n.crds[3],T=n.crds[4],X=n.crds[5];if(d){var j=w.ctmCalPoint(V,b,d);V=j.ctmX,b=j.ctmY;var O=w.ctmCalPoint(p,m,d);p=O.ctmX,m=O.ctmY;var u=w.ctmCalPoint(T,X,d);T=u.ctmX,X=u.ctmY}K.bezierCurveTo(Object(G.converterDpi)(V,w.coreHelper.dpi),Object(G.converterDpi)(b,w.coreHelper.dpi),Object(G.converterDpi)(p,w.coreHelper.dpi),Object(G.converterDpi)(m,w.coreHelper.dpi),Object(G.converterDpi)(T,w.coreHelper.dpi),Object(G.converterDpi)(X,w.coreHelper.dpi))}else if("Q"===n.cmd){var z=n.crds[0],P=n.crds[1],v=n.crds[2],_=n.crds[3];if(d){var $=w.ctmCalPoint(z,P,d);z=$.ctmX,P=$.ctmY;var AA=w.ctmCalPoint(v,_,d);v=AA.ctmX,_=AA.ctmY}K.quadraticCurveTo(Object(G.converterDpi)(z,w.coreHelper.dpi),Object(G.converterDpi)(P,w.coreHelper.dpi),Object(G.converterDpi)(v,w.coreHelper.dpi),Object(G.converterDpi)(_,w.coreHelper.dpi))}else"A"===n.cmd||"C"===n.cmd&&K.closePath()}}catch(A){e.e(A)}finally{e.f()}K.clip()}N&&K.transform(N.a/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.b/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.c/C/Object(G.ctmImageScale)(w.coreHelper.dpi),N.d/C/Object(G.ctmImageScale)(w.coreHelper.dpi),Object(G.converterDpi)(N.e,w.coreHelper.dpi),Object(G.converterDpi)(N.f,w.coreHelper.dpi)),K.drawImage(o,0,0),g.drawImage(Y,D,i)}A()}})));case 5:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,E,D,i,o,w,G,F,N,y){return C.apply(this,arguments)})},{key:"ctmCalPoint",value:function(A,I,g){return{ctmX:A*g.a+I*g.c+1*g.e,ctmY:A*g.b+I*g.d+1*g.f}}},{key:"renderPathObject",value:(B=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,F,N,y,h){var M,U,c,k,S,s,a,Y,K,H,J,L,t,d,Z,e,n,l,q,r,W,x,f,V,b,p,m,T,X,j,O,u,z,P,v,_,$,AA,IA,gA,BA,QA,CA,EA,DA,iA,oA,wA,GA,FA,NA,yA,RA,hA,MA,UA,cA,kA,SA,sA,aA,YA,KA,HA,JA,LA,tA,dA,ZA,eA,nA,lA;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(M=Q.Boundary){A.next=3;break}return A.abrupt("return");case 3:if(U=1,M=Object(G.converterBox)(M,this.coreHelper.dpi),c=Math.ceil(M.w),k=Math.ceil(M.h),S=M.x,s=M.y,c-0!=0&&k-0!=0){A.next=11;break}return A.abrupt("return");case 11:if(a=document.createElement("canvas"),Y=a.getContext("2d"),a.width=c*U,a.height=k*U,a.style.width="".concat(c,"px"),a.style.height="".concat(k,"px"),K=Q.LineWidth,H=Q.AbbreviatedData,J=Q.CTM,L=Q.StrokeColor,t=Q.FillColor,K&&(D=Object(G.converterDpi)(K,this.coreHelper.dpi)),(d=Q.DrawParam)&&(Z=Object(G.getDrawParam)(B,d),(K=Z.LineWidth)&&(D=Object(G.converterDpi)(K,this.coreHelper.dpi)),Z.FillColor&&(t&&t.Value||(t=Z.FillColor)),Z.StrokeColor&&(L&&L.Value||(L=Z.StrokeColor))),J&&Y.transform(J.a,J.b,J.c,J.d,Object(G.converterDpi)(J.e,this.coreHelper.dpi),Object(G.converterDpi)(J.f,this.coreHelper.dpi)),e=!1,L&&(L.Value&&(E=Object(G.parseColor)(L.Value)),n=L.axialShd)){e=!0,l=Object(G.parseCtm)(n.StartPoint),q=Object(G.parseCtm)(n.EndPoint),r=Y.createLinearGradient(l[0],l[1],q[0],q[1]),W=R(n.Segment);try{for(W.s();!(x=W.n()).done;)(f=x.value)&&r.addColorStop(f.position,Object(G.parseColor)(f.color.Value))}catch(A){W.e(A)}finally{W.f()}Y.lineWidth=D,Y.strokeStyle=r}if(V=!1,t&&(t.Value&&(C=Object(G.parseColor)(t.Value)),t.Alpha&&0===t.Alpha&&(Y.globalAlpha=0),b=t.AxialShd)){V=!0,p=Object(G.parseCtm)(b.StartPoint),m=Object(G.parseCtm)(b.EndPoint),T=Y.createLinearGradient(p[0],p[1],m[0],m[1]),X=R(b.Segment);try{for(X.s();!(j=X.n()).done;)(O=j.value)&&T.addColorStop(O.position,Object(G.parseColor)(O.color.Value))}catch(A){X.e(A)}finally{X.f()}Y.fillStyle=T}if(D>0&&!E&&((E=C)||(E="rgb(0, 0, 0)")),(u=Q.Clips)&&u.length>0)for(z=[],P=0;P<u.length;P++){for(v=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),_=u[P],$=_.Clip,AA=0;AA<$.length;AA++){IA=$[AA],gA=IA.Area,BA=document.createElementNS("http://www.w3.org/2000/svg","path"),QA=0,CA=0,EA=0,DA=0,gA.Path.Boundary&&(QA=gA.Path.Boundary.x,CA=gA.Path.Boundary.y,EA=gA.Path.Boundary.w,DA=gA.Path.Boundary.h),!gA.TransFlag&&gA.CTM&&(iA=gA.CTM,oA=void 0,oA=J?"matrix(".concat(iA.a," ").concat(iA.b," ").concat(iA.c," ").concat(iA.d," ").concat(Object(G.converterDpi)(iA.e-J.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(iA.f-J.f,this.coreHelper.dpi),")"):"matrix(".concat(iA.a," ").concat(iA.b," ").concat(iA.c," ").concat(iA.d," ").concat(Object(G.converterDpi)(iA.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(iA.f,this.coreHelper.dpi),")"),J&&(wA=[[J.a,J.c,0],[J.b,J.d,0],[0,0,1]],GA=Object(G.inv)(wA),isNaN(GA[0][0])||GA[0][0]===1/0||(oA="".concat(oA," matrix(").concat(GA[0][0]," ").concat(GA[1][0]," ").concat(GA[0][1]," ").concat(GA[1][1]," 0 0)"))),BA.setAttribute("transform",oA)),!gA.TransFlag&&gA.Path.CTM&&(FA=gA.Path.CTM,NA="matrix(".concat(FA.a," ").concat(FA.b," ").concat(FA.c," ").concat(FA.d," ").concat(Object(G.converterDpi)(FA.e-J.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(FA.f-J.f,this.coreHelper.dpi),")"),J&&(yA=[[J.a,J.c,0],[J.b,J.d,0],[0,0,1]],RA=Object(G.inv)(yA),isNaN(RA[0][0])||RA[0][0]===1/0||(NA="".concat(NA," matrix(").concat(RA[0][0]," ").concat(RA[1][0]," ").concat(RA[0][1]," ").concat(RA[1][1]," 0 0)"))),BA.setAttribute("transform",NA)),Y.beginPath(),hA=R(gA.Path.AbbreviatedData);try{for(hA.s();!(MA=hA.n()).done;)"M"===(UA=MA.value).cmd||"S"===UA.cmd?Y.moveTo(Object(G.converterDpi)(Object(G.adjustPosLimit)(UA.crds[0],EA)+QA,this.coreHelper.dpi),Object(G.converterDpi)(Object(G.adjustPosLimit)(UA.crds[1],DA)+CA,this.coreHelper.dpi)):"L"===UA.cmd?Y.lineTo(Object(G.converterDpi)(Object(G.adjustPosLimit)(UA.crds[0],EA)+QA,this.coreHelper.dpi),Object(G.converterDpi)(Object(G.adjustPosLimit)(UA.crds[1],DA)+CA,this.coreHelper.dpi)):"B"===UA.cmd&&Y.bezierCurveTo(Object(G.converterDpi)(Object(G.adjustPosLimit)(UA.crds[0],EA)+QA,this.coreHelper.dpi),Object(G.converterDpi)(Object(G.adjustPosLimit)(UA.crds[1],DA)+CA,this.coreHelper.dpi),Object(G.converterDpi)(UA.crds[2]+QA,this.coreHelper.dpi),Object(G.converterDpi)(UA.crds[3]+CA,this.coreHelper.dpi),Object(G.converterDpi)(UA.crds[4]+QA,this.coreHelper.dpi),Object(G.converterDpi)(UA.crds[5]+CA,this.coreHelper.dpi))}catch(A){hA.e(A)}finally{hA.f()}Y.closePath(),Y.clip()}z.push(v)}Q.Join&&Y.setLineJoin(Q["@_Join"]),Q.Cap&&Y.setLineCap(Q["@_Cap"]),Q.DashPattern&&(cA=Q.DashPattern,kA=Object(G.parseCtm)(cA),Q.DashOffset&&Q.DashOffset,Y.setLineDash([Object(G.converterDpi)(kA[0],this.coreHelper.dpi),Object(G.converterDpi)(kA[1],this.coreHelper.dpi)])),Y.beginPath(),SA=R(H);try{for(SA.s();!(sA=SA.n()).done;)"M"===(aA=sA.value).cmd||"S"===aA.cmd?Y.moveTo(Object(G.converterDpi)(aA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(aA.crds[1],this.coreHelper.dpi)):"L"===aA.cmd?Y.lineTo(Object(G.converterDpi)(aA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(aA.crds[1],this.coreHelper.dpi)):"B"===aA.cmd?Y.bezierCurveTo(Object(G.converterDpi)(aA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(aA.crds[1],this.coreHelper.dpi),Object(G.converterDpi)(aA.crds[2],this.coreHelper.dpi),Object(G.converterDpi)(aA.crds[3],this.coreHelper.dpi),Object(G.converterDpi)(aA.crds[4],this.coreHelper.dpi),Object(G.converterDpi)(aA.crds[5],this.coreHelper.dpi)):"Q"===aA.cmd?Y.quadraticCurveTo(Object(G.converterDpi)(aA.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(aA.crds[1],this.coreHelper.dpi),Object(G.converterDpi)(aA.crds[2],this.coreHelper.dpi),Object(G.converterDpi)(aA.crds[3],this.coreHelper.dpi)):"A"===aA.cmd||"C"===aA.cmd&&Y.closePath()}catch(A){SA.e(A)}finally{SA.f()}if(Q.Stroke&&(e||(Y.strokeStyle=E,Y.lineWidth=D),Y.stroke()),YA=t.pattern,!Q.Fill||YA?Y.fillStyle="none":(V||(Y.fillStyle=C),Y.fill(Q.Rule)),!YA){A.next=54;break}return Y.save(),KA=document.createElement("canvas"),HA=KA.getContext("2d"),KA.width=Object(G.converterDpi)(YA.width,this.coreHelper.dpi),KA.height=Object(G.converterDpi)(YA.height,this.coreHelper.dpi),A.next=50,this.renderLayerByCanvas(KA,HA,h,B,y,null,YA,!1,null,null,null);case 50:JA=Y.createPattern(KA,"repeat"),Y.fillStyle=JA,Y.fillRect(0,0,c,k),Y.restore();case 54:F?(LA=document.createElement("canvas"),tA=Object(G.converterBox)(F,this.coreHelper.dpi),dA=tA.w,ZA=tA.h,eA=tA.x,nA=tA.y,LA.width=dA*U,LA.height=ZA*U,LA.style.width="".concat(dA,"px"),LA.style.height="".concat(ZA,"px"),lA=LA.getContext("2d"),N&&lA.transform(N.a,N.b,N.c,N.d,Object(G.converterDpi)(N.e,this.coreHelper.dpi),Object(G.converterDpi)(N.f,this.coreHelper.dpi)),o&&(lA.globalAlpha=o/255),lA.drawImage(a,S,s),g.drawImage(LA,eA,nA)):g.drawImage(a,S,s);case 55:case"end":return A.stop()}}),A,this)}))),function(A,I,g,Q,C,E,D,i,o,w,G,F,N){return B.apply(this,arguments)})},{key:"renderTextObject",value:(g=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,N){var y,h,M,U,c,k,S,s,a,Y,K,H,J,L,t,d,Z,e,n,l,q,r,W,x,f,V,b,p,m,T,X,j,O,u,z,P,v,_,$,AA,IA,gA,BA,QA,CA,EA,DA,iA,oA,wA,GA,FA,NA;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(y=1,h=Q.Boundary,h=Object(G.converterBox)(h,this.coreHelper.dpi),M=Q.CTM,U=Q.HScale,c=Q.Font,k=Q.Weight,S=Q.Size>0,M&&!S&&(M={a:-M.a,b:M.b,c:M.c,d:-M.d,e:-M.e,f:-M.f}),s=Object(G.converterDpi)(Math.abs(parseFloat(Q.Size)),this.coreHelper.dpi),a=Object(G.calTextPoint)(this.coreHelper.dpi,Q.TextCode,Q.CGTransform,M,Q.Boundary,o,N,S),(Y=document.createElementNS("http://www.w3.org/2000/svg","svg")).setAttribute("xmlns","http://www.w3.org/2000/svg"),Y.setAttribute("version","1.1"),K=Q.FillColor,H=!1,(J=Q.DrawParam)&&(L=Object(G.getDrawParam)(D,J)).FillColor&&(K&&K.Value||(K=L.FillColor)),K&&(K.Value&&(C=Object(G.parseColor)(K.Value)),t=K.alpha,y=t/255,d=K.axialShd)){H=!0,(Z=document.createElementNS("http://www.w3.org/2000/svg","linearGradient")).setAttribute("id","".concat(Q.ID)),Z.setAttribute("x1","0%"),Z.setAttribute("y1","0%"),Z.setAttribute("x2","100%"),Z.setAttribute("y2","100%"),e=R(d.Segment);try{for(e.s();!(n=e.n()).done;)(l=n.value)&&((q=document.createElement("stop")).setAttribute("offset","".concat(100*l.position,"%")),q.setAttribute("style","stop-color:".concat(Object(G.parseColor)(l.color.Value),";stop-opacity:1")),Z.appendChild(q),C=Object(G.parseColor)(l.color.Value))}catch(A){e.e(A)}finally{e.f()}Y.appendChild(Z)}Q.Fill||(y=0),r=h.w,W=h.h,x=h.x,f=h.y,V=s,b=s,p=0,M&&(m=M.a,T=M.b,X=M.c,j=M.d,O=m>0?Math.sign(m)*Math.sqrt(m*m+X*X):Math.sqrt(m*m+X*X),u=j>0?Math.sign(j)*Math.sqrt(T*T+j*j):Math.sqrt(T*T+j*j),0==(p=Math.atan2(-T,j))&&0!=m&&1==j||(V*=O,b*=u),0==p&&U-0==1&&(U=m/j)>0&&(V*=U)),N&&(z=N.a,P=N.b,v=N.c,_=N.d,$=z>0?Math.sign(z)*Math.sqrt(z*z+v*v):Math.sqrt(z*z+v*v),AA=_>0?Math.sign(_)*Math.sqrt(P*P+_*_):Math.sqrt(P*P+_*_),0==(p=Math.atan2(-P,_))&&0!=z&&1==_||(V*=$,b*=AA,f*=AA,x*=$,r*=$,W*=AA)),IA=Object(G.getFont)(B,c),gA=R(a),A.prev=31,gA.s();case 33:if((BA=gA.n()).done){A.next=73;break}if(!(QA=BA.value)||isNaN(QA.x)){A.next=71;break}if(!QA.glyph){A.next=59;break}if(!IA||!IA.face){A.next=57;break}if(CA=Object(F.loadFaceInfo)(IA.face),EA=Object(F.FT_Glyph_Get_Measure)(IA.face,QA.glyph),(DA=this.render.drawGlyph(EA.glyphPath,EA.horiUnderlinePosition,CA.units_per_EM,V,b,E||C,y)).img.setAttribute("style","width: ".concat(Math.ceil(V),"px; height:").concat(Math.ceil(b),"px")),iA="data:image/svg+xml;base64,".concat(Object(F.base64Encode)(DA.img.outerHTML)),0!==p){A.next=48;break}return A.next=46,this.drawTextFromSvg(I,g,iA,Math.ceil(QA.cx),QA.cy-DA.yScale*EA.horiUnderlinePosition-b);case 46:A.next=57;break;case 48:return(oA=document.createElement("canvas")).style.width="".concat(Math.ceil(V),"px"),oA.style.height="".concat(Math.ceil(b),"px"),oA.width=Math.ceil(V),oA.height=Math.ceil(b),wA=oA.getContext("2d"),A.next=56,this.drawTextFromSvg(oA,wA,iA,0,0,p,Math.ceil(V)/2,Math.ceil(b)/2);case 56:g.drawImage(oA,Math.ceil(QA.cx),QA.cy-DA.yScale*EA.horiUnderlinePosition-b);case 57:A.next=71;break;case 59:(GA=document.createElementNS("http://www.w3.org/2000/svg","text")).setAttribute("x",QA.x),GA.setAttribute("y",QA.y),GA.innerHTML=QA.text,FA="",M&&(FA="matrix(".concat(M.a," ").concat(M.b," ").concat(M.c," ").concat(M.d," ").concat(Object(G.converterDpi)(M.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(M.f,this.coreHelper.dpi),")")),N&&(FA="".concat(FA," matrix(").concat(N.a," ").concat(N.b," ").concat(N.c," ").concat(N.d," ").concat(Object(G.converterDpi)(N.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(N.f,this.coreHelper.dpi),")")),U&&(FA="".concat(FA," matrix(").concat(U,", 0, 0, 1, ").concat((1-U)*QA.x,", 0)")),GA.setAttribute("transform",FA),H?GA.setAttribute("fill",C):(GA.setAttribute("fill",E),GA.setAttribute("fill",C),GA.setAttribute("fill-opacity",y)),GA.setAttribute("style","font-weight: ".concat(k,";font-size:").concat(s,"px;font-family: ").concat(Object(G.getFontFamily)(IA),";")),Y.appendChild(GA);case 71:A.next=33;break;case 73:A.next=78;break;case 75:A.prev=75,A.t0=A.catch(31),gA.e(A.t0);case 78:return A.prev=78,gA.f(),A.finish(78);case 81:return Y.setAttribute("style","overflow:visible;width:".concat(r,"px;height:").concat(W,"px")),NA="data:image/svg+xml;base64,".concat(Object(F.base64Encode)(Y.outerHTML)),A.next=85,this.drawTextFromSvg(I,g,NA,x,f);case 85:case"end":return A.stop()}}),A,this,[[31,75,78,81]])}))),function(A,I,B,Q,C,E,D,i,o,w){return g.apply(this,arguments)})},{key:"drawTextFromSvg",value:(I=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",new Promise((function(A,I){var o=new Image;o.src=B,o.onload=function(){0!=E&&D&&i&&(g.translate(D,i),g.rotate(-E),g.translate(-D,-i)),g.drawImage(o,Q,C),A()}})));case 1:case"end":return A.stop()}}),A)}))),function(A,g,B,Q,C,E,D,i){return I.apply(this,arguments)})}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdThumbnailViewer",(function(){return y}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=g(22),i=g(29),o=g(37),w=g(36);function G(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return F(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return F(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function F(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var N="selected",y=function(){function A(I,g){Q()(this,A),this.core=null,this.coreHelper=new w.Ofd_Core_Helper(96),this.ofdCanvasRender=new o.OfdCanvasRender(null,this.coreHelper),this.eventBus=g,this.container=I,this.pageDIV=[],this.currentPage=1,this.container&&(this.scroll=Object(D.watchScroll)(this.container,this._scrollUpdate.bind(this)))}return E()(A,[{key:"emptyNode",value:function(A){if(A)for(;A.firstChild;)A.removeChild(A.firstChild)}},{key:"freeThumbnailDocument",value:function(){this.pageDIV=[];var A=this.container;this.emptyNode(A)}},{key:"getScrollAhead",value:function(A){return!(!A.first||1!==A.first.id)||(!A.last||A.last.id!==this.pageDIV.length)&&scroll.down}},{key:"_scrollUpdate",value:function(){0!==this.core.getOFDPageCount(0)&&this.updateThumbnailView()}},{key:"_getVisibleThumbs",value:function(){return Object(D.getVisibleElements)({scrollEl:this.container,views:this.pageDIV})}},{key:"updateThumbnailView",value:function(){var A=this,I=this._getVisibleThumbs();if(0!==I.views.length){var g=this.getScrollAhead(I),B=Object(i.getHighestPriority)(I,this.pageDIV,g);if(B&&B.renderingState===D.RenderingStates.INITIAL){B.renderingState=D.RenderingStates.RUNNING;var Q=B.ring,C=document.createElement("canvas"),E=C.getContext("2d");C.style.height=Q.style.height,C.style.width=Q.style.width,C.width=1*this.coreHelper.pageRenderWidth(0,B.id-1,this.core),C.height=1*this.coreHelper.pageRenderHeight(0,B.id-1,this.core);var o=C.width/C.height,w=document.createElement("img");w.className="thumbnailImage",w.style.width="98px",w.style.height=98/o+"px",this.ofdCanvasRender.renderPageByCanvas(C,E,0,B.id-1).then((function(I){var g=C.toDataURL();w.src=g,B.renderingState=D.RenderingStates.FINISHED,A.updateThumbnailView()})),Q.appendChild(w)}}}},{key:"scrollThumbnailIntoView",value:function(A){if(A){var I=this.pageDIV[A-1];if(I){if(A!==this.currentPage)this.pageDIV[this.currentPage-1].div.classList.remove(N),I.div.classList.add(N);var g=this._getVisibleThumbs(),B=g.first,Q=g.last,C=g.views;if(C.length>0){var E=!1;if(A<=B.id||A>=Q.id)E=!0;else{var i,o=G(C);try{for(o.s();!(i=o.n()).done;){var w=i.value,F=w.id,y=w.percent;if(F===A){E=y<100;break}}}catch(A){o.e(A)}finally{o.f()}}E&&Object(D.scrollIntoView)(I.div,{top:-19})}this.currentPage=A}}}},{key:"setOfdCore",value:function(A){var I=this;if(this.container){this.core&&this.freeThumbnailDocument(),this.core=A,this.ofdCanvasRender.setOfdCore(this.core);for(var g=this.container,B=this,Q=function(A){var Q=I.coreHelper.pageRenderWidth(0,A,I.core)/I.coreHelper.pageRenderHeight(0,A,I.core),C=document.createElement("a");C.onclick=function(){return B.eventBus.dispatch("jumpPage",{source:this,pageIndex:A+1}),!1};var E=document.createElement("div");E.className="thumbnail",E.setAttribute("data-page-number","".concat(A+1));var i=document.createElement("div");i.className="thumbnailSelectionRing";i.style.width="100px",i.style.height=98/Q+2+"px",E.appendChild(i),C.appendChild(E),I.pageDIV[A]={ring:i,div:E,anchor:C,id:A+1,renderingState:D.RenderingStates.INITIAL},g.appendChild(C)},C=0;C<this.core.getOFDPageCount(0);++C)Q(C);this.updateThumbnailView()}}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"PDFSidebar",(function(){return o}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=g(22),i="pdfSidebarNotification",o=function(){function A(I){var g=I.elements,B=I.ofdViewer,C=I.ofdThumbnailViewer,E=I.eventBus,i=I.l10n;Q()(this,A),this.isOpen=!1,this.active=D.SidebarView.OUTLINE,this.isInitialViewSet=!1,this.onToggled=null,this.ofdViewer=B,this.ofdThumbnailViewer=C,this.outerContainer=g.outerContainer,this.viewerContainer=g.viewerContainer,this.toggleButton=g.toggleButton,this.thumbnailButton=g.thumbnailButton,this.outlineButton=g.outlineButton,this.attachmentsButton=g.attachmentsButton,this.layersButton=g.layersButton,this.signaturesButton=g.signaturesButton,this.thumbnailView=g.thumbnailView,this.outlineView=g.outlineView,this.attachmentsView=g.attachmentsView,this.layersView=g.layersView,this.signaturesView=g.signaturesView,this._outlineOptionsContainer=g.outlineOptionsContainer,this._currentOutlineItemButton=g.currentOutlineItemButton,this.eventBus=E,this.l10n=i,this._addEventListeners()}return E()(A,[{key:"reset",value:function(){this.isInitialViewSet=!1,this._hideUINotification(!0),this.switchView(D.SidebarView.OUTLINE),this.outlineButton.disabled=!1,this.attachmentsButton.disabled=!1,this.layersButton.disabled=!1,this._currentOutlineItemButton.disabled=!0}},{key:"visibleView",get:function(){return this.isOpen?this.active:D.SidebarView.NONE}},{key:"isThumbnailViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.THUMBS}},{key:"isOutlineViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.OUTLINE}},{key:"isAttachmentsViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.ATTACHMENTS}},{key:"isLayersViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.LAYERS}},{key:"isSignatureViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.SIGNATURES}},{key:"setInitialView",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D.SidebarView.NONE;this.isInitialViewSet||(this.isInitialViewSet=!0,A!==D.SidebarView.NONE&&A!==D.SidebarView.UNKNOWN&&this._switchView(A,!0)||this._dispatchEvent())}},{key:"switchView",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._switchView(A,I)}},{key:"_switchView",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]&&arguments[1],g=A!==this.active,B=!1;switch(A){case D.SidebarView.NONE:return!!this.isOpen&&(this.close(),!0);case D.SidebarView.THUMBS:this.isOpen&&g&&(B=!0);break;case D.SidebarView.OUTLINE:if(this.outlineButton.disabled)return!1;break;case D.SidebarView.ATTACHMENTS:if(this.attachmentsButton.disabled)return!1;break;case D.SidebarView.LAYERS:if(this.layersButton.disabled)return!1;break;case D.SidebarView.SIGNATURES:if(this.signaturesButton.disabled)return!1;break;default:return!1}this.active=A;var Q=A===D.SidebarView.THUMBS,C=A===D.SidebarView.OUTLINE,E=A===D.SidebarView.ATTACHMENTS,i=A===D.SidebarView.LAYERS,o=A===D.SidebarView.SIGNATURES;return this.thumbnailButton&&this.thumbnailButton.classList.toggle("toggled",Q),this.outlineButton&&this.outlineButton.classList.toggle("toggled",C),this.attachmentsButton&&this.attachmentsButton.classList.toggle("toggled",E),this.layersButton&&this.layersButton.classList.toggle("toggled",i),this.signaturesButton&&this.signaturesButton.classList.toggle("toggled",o),this.thumbnailButton&&this.thumbnailButton.setAttribute("aria-checked",Q),this.outlineButton&&this.outlineButton.setAttribute("aria-checked",C),this.attachmentsButton&&this.attachmentsButton.setAttribute("aria-checked",E),this.layersButton&&this.layersButton.setAttribute("aria-checked",i),this.signaturesButton&&this.signaturesButton.setAttribute("aria-checked",o),this.thumbnailView&&this.thumbnailView.classList.toggle("hidden",!Q),this.outlineView&&this.outlineView.classList.toggle("hidden",!C),this.attachmentsView&&this.attachmentsView.classList.toggle("hidden",!E),this.layersView&&this.layersView.classList.toggle("hidden",!i),this.signaturesView&&this.signaturesView.classList.toggle("hidden",!o),this._outlineOptionsContainer&&this._outlineOptionsContainer.classList.toggle("hidden",!C),I&&!this.isOpen?(this.open(),!0):(B&&(this._updateThumbnailViewer(),this._forceRendering()),g&&this._dispatchEvent(),g)}},{key:"open",value:function(){this.isOpen||(this.isOpen=!0,this.toggleButton.classList.add("toggled"),this.toggleButton.setAttribute("aria-expanded","true"),this.outerContainer.classList.add("sidebarMoving","sidebarOpen"),this.active===D.SidebarView.THUMBS&&this._updateThumbnailViewer(),this._forceRendering(),this._dispatchEvent(),this._hideUINotification())}},{key:"close",value:function(){this.isOpen&&(this.isOpen=!1,this.toggleButton.classList.remove("toggled"),this.toggleButton.setAttribute("aria-expanded","false"),this.outerContainer.classList.add("sidebarMoving"),this.outerContainer.classList.remove("sidebarOpen"),this._forceRendering(),this._dispatchEvent())}},{key:"toggle",value:function(){this.isOpen?this.close():this.open()}},{key:"_dispatchEvent",value:function(){this.eventBus.dispatch("sidebarviewchanged",{source:this,view:this.isOutlineViewVisible})}},{key:"_forceRendering",value:function(){this.onToggled?this.onToggled():(this.ofdViewer.forceRendering(),this.ofdThumbnailViewer&&this.ofdThumbnailViewer.updateThumbnailView())}},{key:"_updateThumbnailViewer",value:function(){var A=this.ofdViewer;this.ofdThumbnailViewer.scrollThumbnailIntoView(A.currentPageNumber)}},{key:"_showUINotification",value:function(){var A=this;this.l10n.get("toggle_sidebar_notification2.title").then((function(I){A.toggleButton.title=I})),this.isOpen||this.toggleButton.classList.add(i)}},{key:"_hideUINotification",value:function(){var A=this,I=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(this.isOpen||I)&&this.toggleButton.classList.remove(i),I&&this.l10n.get("toggle_sidebar.title").then((function(I){A.toggleButton.title=I}))}},{key:"_addEventListeners",value:function(){var A,I,g,B,Q,C,E,i,o,w,G=this;null===(A=this.viewerContainer)||void 0===A||A.addEventListener("transitionend",(function(A){A.target===G.viewerContainer&&G.outerContainer.classList.remove("sidebarMoving")})),null===(I=this.toggleButton)||void 0===I||I.addEventListener("click",(function(){G.toggle()})),null===(g=this.thumbnailButton)||void 0===g||g.addEventListener("click",(function(){G.switchView(D.SidebarView.THUMBS)})),null===(B=this.outlineButton)||void 0===B||B.addEventListener("click",(function(){G.switchView(D.SidebarView.OUTLINE)})),null===(Q=this.outlineButton)||void 0===Q||Q.addEventListener("dblclick",(function(){G.eventBus.dispatch("toggleoutlinetree",{source:G})})),null===(C=this.attachmentsButton)||void 0===C||C.addEventListener("click",(function(){G.switchView(D.SidebarView.ATTACHMENTS)})),null===(E=this.layersButton)||void 0===E||E.addEventListener("click",(function(){G.switchView(D.SidebarView.LAYERS)})),null===(i=this.layersButton)||void 0===i||i.addEventListener("dblclick",(function(){G.eventBus.dispatch("resetlayers",{source:G})})),null===(o=this.signaturesButton)||void 0===o||o.addEventListener("click",(function(){G.switchView(D.SidebarView.SIGNATURES)})),null===(w=this._currentOutlineItemButton)||void 0===w||w.addEventListener("click",(function(){G.eventBus.dispatch("currentoutlineitem",{source:G})}));var F=function(A,I,g){I.disabled=!A,A?G._showUINotification():G.active===g&&G.switchView(D.SidebarView.THUMBS)};this.eventBus._on("outlineloaded",(function(A){F(A.outlineCount,G.outlineButton,D.SidebarView.OUTLINE),A.currentOutlineItemPromise.then((function(A){G.isInitialViewSet&&(G._currentOutlineItemButton.disabled=!A)}))})),this.eventBus._on("attachmentsloaded",(function(A){F(A.attachmentsCount,G.attachmentsButton,D.SidebarView.ATTACHMENTS)})),this.eventBus._on("layersloaded",(function(A){F(A.layersCount,G.layersButton,D.SidebarView.LAYERS)})),this.eventBus._on("presentationmodechanged",(function(A){A.state===D.PresentationModeState.NORMAL&&G.isThumbnailViewVisible&&G._updateThumbnailViewer()}))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"OverlayManager",(function(){return G}));var B=g(7),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(8),w=g.n(o),G=function(){function A(){E()(this,A),this.overlays=new WeakMap}var I,g,B,C;return i()(A,[{key:"register",value:(C=Q()(w.a.mark((function A(I){var g,B=this,Q=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(g=Q.length>1&&void 0!==Q[1]&&Q[1],"object"==typeof I){A.next=5;break}throw new Error("Not enough parameters.");case 5:if(!this.overlays.has(I)){A.next=7;break}throw new Error("The overlay is already registered.");case 7:this.overlays.set(I,{canForceClose:g}),"undefined"!=typeof PDFJSDev&&PDFJSDev.test("GENERIC && !SKIP_BABEL")&&I.showModal,I.addEventListener("cancel",(function(A){B.active=null}));case 10:case"end":return A.stop()}}),A,this)}))),function(A){return C.apply(this,arguments)})},{key:"unregister",value:(B=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.overlays.has(I)){A.next=4;break}throw new Error("The overlay does not exist.");case 4:if(this.active!==I){A.next=6;break}throw new Error("The overlay cannot be removed while it is active.");case 6:this.overlays.delete(I);case 7:case"end":return A.stop()}}),A,this)}))),function(A){return B.apply(this,arguments)})},{key:"open",value:(g=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.overlays.has(I)){A.next=4;break}throw new Error("The overlay does not exist.");case 4:if(!this.active){A.next=15;break}if(this.active!==I){A.next=9;break}this.active=null,A.next=15;break;case 9:if(!this.overlays.get(I).canForceClose){A.next=14;break}return A.next=12,this.close();case 12:A.next=15;break;case 14:this.active=null;case 15:this.active=I,"function"==typeof I.showModal&&I.showModal();case 17:case"end":return A.stop()}}),A,this)}))),function(A){return g.apply(this,arguments)})},{key:"close",value:(I=Q()(w.a.mark((function A(){var I,g=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(I=g.length>0&&void 0!==g[0]?g[0]:this.active,this.overlays.has(I)){A.next=5;break}throw new Error("The overlay does not exist.");case 5:if(this.active){A.next=9;break}throw new Error("The overlay is currently not active.");case 9:if(this.active===I){A.next=11;break}throw new Error("Another overlay is currently active.");case 11:I.close(),this.active=null;case 13:case"end":return A.stop()}}),A,this)}))),function(){return I.apply(this,arguments)})}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"PDFDocumentProperties",(function(){return G}));var B=g(7),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(8),w=g.n(o),G=(g(22),function(){function A(I,g,B,Q){var C=this,D=I.dialog,i=I.fields,o=I.closeButton;E()(this,A),this.dialog=D,this.fields=i,this.overlayManager=g,this.l10n=Q,this.fieldData=null,this.reset(),o.addEventListener("click",this.close.bind(this)),this.overlayManager.register(this.dialog),B._on("pagechanging",(function(A){C._currentPageNumber=A.pageNumber})),B._on("rotationchanging",(function(A){C._pagesRotation=A.pagesRotation})),this._isNonMetricLocale=!0}var I,g;return i()(A,[{key:"open",value:(g=Q()(w.a.mark((function A(){var I,g,B,Q,C,E;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.dialog.hidden=!1,this.ofdCore){A.next=3;break}return A.abrupt("return");case 3:if(this.overlayManager.open(this.dialog),I=this._currentPageNumber,g=this._pagesRotation,!this.fieldData||I!==this.fieldData._currentPageNumber||g!==this.fieldData._pagesRotation){A.next=9;break}return this.updateUI(),A.abrupt("return");case 9:B=this.getMetadata(),Q=B.info,B.contentDispositionFilename,C=B.contentLength,E=this.parseFileSize(C),this.fieldData=Object.freeze({fileSize:E,title:Q.Title,author:Q.Author,subject:Q.Subject,keywords:Q.Keywords,creationDate:Q.CreationDate,modificationDate:Q.ModificationDate,creator:Q.Creator,producer:Q.Producer,version:Q.CreatorVersion,pageCount:Q.numPages,pageSize:Q.pageSize,_currentPageNumber:I,_pagesRotation:g}),this.updateUI();case 13:case"end":return A.stop()}}),A,this)}))),function(){return g.apply(this,arguments)})},{key:"close",value:(I=Q()(w.a.mark((function A(){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:this.overlayManager.close(this.dialog);case 1:case"end":return A.stop()}}),A,this)}))),function(){return I.apply(this,arguments)})},{key:"setOfdCore",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.ofdCore&&(this.reset(),this.updateUI(!0)),A&&(this.ofdCore=A,this.url=I)}},{key:"getMetadata",value:function(){if(this.ofdCore)return{info:this.ofdCore.getMetadata(0),contentLength:this.ofdCore.ofd.size}}},{key:"reset",value:function(){this.ofdCore=null,this.url=null,this.fieldData=null,this._currentPageNumber=1,this._pagesRotation=0}},{key:"updateUI",value:function(){if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.fieldData){if(this.overlayManager.active===this.dialog)for(var A in this.fields){var I=this.fieldData[A];this.fields[A].textContent=I||0===I?I:"-"}}else for(var g in this.fields)this.fields[g].textContent="-"}},{key:"parseFileSize",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,I=A/1024,g=I/1024;if(I)return g>=1?"".concat(g>=1&&(+g.toPrecision(3)).toLocaleString(),"mb(").concat(A.toLocaleString(),"字节)"):"".concat(g<1&&(+I.toPrecision(3)).toLocaleString(),"kb(").concat(A.toLocaleString(),"字节)")}},{key:"parseLinearization",value:function(A){return this.l10n.get("document_properties_linearized_".concat(A?"yes":"no"))}}]),A}())},function(A,I,g){"use strict";g.r(I),g.d(I,"Toolbar",(function(){return y}));var B=g(7),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(8),w=g.n(o),G=g(22);function F(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return N(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return N(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function N(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var y=function(){function A(I,g,B){E()(this,A),this.toolbar=I.container,this.eventBus=g,this.l10n=B,this.buttons=[{element:I.previous,eventName:"previouspage"},{element:I.next,eventName:"nextpage"},{element:I.zoomIn,eventName:"zoomin"},{element:I.zoomOut,eventName:"zoomout"},{element:I.openFile,eventName:"openfile"},{element:I.print,eventName:"print"},{element:I.presentationModeButton,eventName:"presentationmode"},{element:I.download,eventName:"download"},{element:I.viewBookmark,eventName:null}],this.items={numPages:I.numPages,pageNumber:I.pageNumber,scaleSelect:I.scaleSelect,langSelect:I.langSelect,customScaleOption:I.customScaleOption,previous:I.previous,next:I.next,zoomIn:I.zoomIn,zoomOut:I.zoomOut},this._wasLocalized=!1,this.reset(),this._bindListeners()}var I;return i()(A,[{key:"setPageNumber",value:function(A,I){this.pageNumber=A,this.pageLabel=I,this._updateUIState(!1)}},{key:"setPagesCount",value:function(A,I){this.pagesCount=A,this.hasPageLabels=I,this._updateUIState(!0)}},{key:"setPageScale",value:function(A,I){this.pageScaleValue=(A||I).toString(),this.pageScale=I,this._updateUIState(!1)}},{key:"setLanguage",value:(I=Q()(w.a.mark((function A(I){var g,B,Q;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this.l10n.getLanguage();case 2:if(A.sent!=I){A.next=5;break}return A.abrupt("return");case 5:this.eventBus.dispatch("langchanged",{source:self,value:I}),g=F(this.items.langSelect.options),A.prev=7,g.s();case 9:if((B=g.n()).done){A.next=17;break}if((Q=B.value).value===I){A.next=14;break}return Q.selected=!1,A.abrupt("continue",15);case 14:Q.selected=!0;case 15:A.next=9;break;case 17:A.next=22;break;case 19:A.prev=19,A.t0=A.catch(7),g.e(A.t0);case 22:return A.prev=22,g.f(),A.finish(22);case 25:case"end":return A.stop()}}),A,this,[[7,19,22,25]])}))),function(A){return I.apply(this,arguments)})},{key:"reset",value:function(){this.pageNumber=0,this.pageLabel=null,this.hasPageLabels=!1,this.pagesCount=0,this.pageScaleValue=G.DEFAULT_SCALE_VALUE,this.pageScale=G.DEFAULT_SCALE,this._updateUIState(!0),this.updateLoadingIndicatorState()}},{key:"_bindListeners",value:function(){var A,I=this,g=this.items,B=g.pageNumber,Q=g.scaleSelect,C=g.langSelect,E=this,D=F(this.buttons);try{var i=function(){var g=A.value,B=g.element,Q=g.eventName;null==B||B.addEventListener("click",(function(A){null!==Q&&I.eventBus.dispatch(Q,{source:I})}))};for(D.s();!(A=D.n()).done;)i()}catch(A){D.e(A)}finally{D.f()}B.addEventListener("click",(function(){this.select()})),B.addEventListener("change",(function(){E.eventBus.dispatch("pagenumberchanged",{source:E,value:this.value})})),Q.addEventListener("change",(function(){"custom"!==this.value&&E.eventBus.dispatch("scalechanged",{source:E,value:this.value})})),Q.addEventListener("click",(function(A){var I=A.target;this.value===E.pageScaleValue&&"OPTION"===I.tagName.toUpperCase()&&this.blur()})),Q.oncontextmenu=G.noContextMenuHandler,C&&C.addEventListener("change",(function(){E.eventBus.dispatch("langchanged",{source:E,value:this.value})})),this.eventBus._on("localized",(function(){I._wasLocalized=!0,I._updateUIState(!0)}))}},{key:"_updateUIState",value:function(){var A=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._wasLocalized){var I=this.pageNumber,g=this.pagesCount,B=this.pageScaleValue,Q=this.pageScale,C=this.items;A&&(this.hasPageLabels?C.pageNumber.type="text":(C.pageNumber.type="number",this.l10n.get("of_pages",{pagesCount:g}).then((function(A){C.numPages.textContent=A}))),C.pageNumber.max=g),this.hasPageLabels?(C.pageNumber.value=this.pageLabel,this.l10n.get("page_of_pages",{pageNumber:I,pagesCount:g}).then((function(A){C.numPages.textContent=A}))):C.pageNumber.value=I,C.previous.disabled=I<=1,C.next.disabled=I>=g,C.zoomOut.disabled=Q<=G.MIN_SCALE,C.zoomIn.disabled=Q>=G.MAX_SCALE;var E,D=!1,i=F(C.scaleSelect.options);try{for(i.s();!(E=i.n()).done;){var o=E.value;o.value===B?(o.selected=!0,D=!0):o.selected=!1}}catch(A){i.e(A)}finally{i.f()}D||(C.customScaleOption.textContent="".concat(1e4*Q/100,"%"),C.customScaleOption.selected=!0)}}},{key:"updateLoadingIndicatorState",value:function(){var A=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.items.pageNumber.classList.toggle("visiblePageIsLoading",A)}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"SecondaryToolbar",(function(){return G}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=g(22),i=g(44);function o(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return w(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return w(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function w(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var G=function(){function A(I,g,B){Q()(this,A),this.toolbar=I.toolbar,this.toggleButton=I.toggleButton,this.toolbarButtonContainer=I.toolbarButtonContainer,this.buttons=[{element:I.presentationModeButton,eventName:"presentationmode",close:!0},{element:I.openFileButton,eventName:"openfile",close:!0},{element:I.printButton,eventName:"print",close:!0},{element:I.downloadButton,eventName:"download",close:!0},{element:I.viewBookmarkButton,eventName:null,close:!0},{element:I.firstPageButton,eventName:"firstpage",close:!0},{element:I.lastPageButton,eventName:"lastpage",close:!0},{element:I.pageRotateCwButton,eventName:"rotatecw",close:!1},{element:I.pageRotateCcwButton,eventName:"rotateccw",close:!1},{element:I.cursorSelectToolButton,eventName:"switchcursortool",eventDetails:{tool:i.CursorTool.SELECT},close:!0},{element:I.cursorHandToolButton,eventName:"switchcursortool",eventDetails:{tool:i.CursorTool.HAND},close:!0},{element:I.scrollPageButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.PAGE},close:!0},{element:I.scrollVerticalButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.VERTICAL},close:!0},{element:I.scrollHorizontalButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.HORIZONTAL},close:!0},{element:I.scrollWrappedButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.WRAPPED},close:!0},{element:I.spreadNoneButton,eventName:"switchspreadmode",eventDetails:{mode:D.SpreadMode.NONE},close:!0},{element:I.spreadOddButton,eventName:"switchspreadmode",eventDetails:{mode:D.SpreadMode.ODD},close:!0},{element:I.spreadEvenButton,eventName:"switchspreadmode",eventDetails:{mode:D.SpreadMode.EVEN},close:!0},{element:I.documentPropertiesButton,eventName:"documentproperties",close:!0},{element:I.closeButton,eventName:"closePage",close:!0}],this.items={firstPage:I.firstPageButton,lastPage:I.lastPageButton,pageRotateCw:I.pageRotateCwButton,pageRotateCcw:I.pageRotateCcwButton},this.mainContainer=g,this.eventBus=B,this.opened=!1,this.containerHeight=null,this.previousContainerHeight=null,this.reset(),this.bindClickListeners(),this.bindCursorToolsListener(I),this.bindScrollModeListener(I),this.bindSpreadModeListener(I),this.eventBus._on("resize",this.setMaxHeight.bind(this))}return E()(A,[{key:"isOpen",get:function(){return this.opened}},{key:"setPageNumber",value:function(A){this.pageNumber=A,this.updateUIState()}},{key:"setPagesCount",value:function(A){this.pagesCount=A,this.updateUIState()}},{key:"reset",value:function(){this.pageNumber=0,this.pagesCount=0,this.updateUIState(),this.eventBus.dispatch("secondarytoolbarreset",{source:this})}},{key:"updateUIState",value:function(){this.items.firstPage&&(this.items.firstPage.disabled=this.pageNumber<=1),this.items.lastPage&&(this.items.lastPage.disabled=this.pageNumber>=this.pagesCount),this.items.pageRotateCw&&(this.items.pageRotateCw.disabled=0===this.pagesCount),this.items.pageRotateCcw&&(this.items.pageRotateCcw.disabled=0===this.pagesCount)}},{key:"bindClickListeners",value:function(){var A,I=this;null===(A=this.toggleButton)||void 0===A||A.addEventListener("click",this.toggle.bind(this));var g,B=o(this.buttons);try{var Q=function(){var A=g.value,B=A.element,Q=A.eventName,C=A.close,E=A.eventDetails;null==B||B.addEventListener("click",(function(A){if(null!==Q){var g={source:I};for(var B in E)g[B]=E[B];I.eventBus.dispatch(Q,g)}C&&I.close()}))};for(B.s();!(g=B.n()).done;)Q()}catch(A){B.e(A)}finally{B.f()}}},{key:"bindCursorToolsListener",value:function(A){var I=A.cursorSelectToolButton,g=A.cursorHandToolButton;this.eventBus._on("cursortoolchanged",(function(A){var B=A.tool,Q=B===i.CursorTool.SELECT,C=B===i.CursorTool.HAND;I.classList.toggle("toggled",Q),g.classList.toggle("toggled",C),I.setAttribute("aria-checked",Q),g.setAttribute("aria-checked",C)}))}},{key:"bindScrollModeListener",value:function(A){var I=this,g=A.scrollPageButton,B=A.scrollVerticalButton,Q=A.scrollHorizontalButton,C=A.scrollWrappedButton,E=A.spreadNoneButton,i=A.spreadOddButton,o=A.spreadEvenButton,w=function(A){var w=A.mode,G=w===D.ScrollMode.PAGE,F=w===D.ScrollMode.VERTICAL,N=w===D.ScrollMode.HORIZONTAL,y=w===D.ScrollMode.WRAPPED;g.classList.toggle("toggled",G),B.classList.toggle("toggled",F),Q.classList.toggle("toggled",N),C.classList.toggle("toggled",y),g.setAttribute("aria-checked",G),B.setAttribute("aria-checked",F),Q.setAttribute("aria-checked",N),C.setAttribute("aria-checked",y);var R=I.pagesCount>15e3;g.disabled=R,B.disabled=R,Q.disabled=R,C.disabled=R,E.disabled=N,i.disabled=N,o.disabled=N};this.eventBus._on("scrollmodechanged",w),this.eventBus._on("secondarytoolbarreset",(function(A){A.source===I&&w({mode:D.ScrollMode.VERTICAL})}))}},{key:"bindSpreadModeListener",value:function(A){var I=this,g=A.spreadNoneButton,B=A.spreadOddButton,Q=A.spreadEvenButton;function C(A){var I=A.mode,C=I===D.SpreadMode.NONE,E=I===D.SpreadMode.ODD,i=I===D.SpreadMode.EVEN;g.classList.toggle("toggled",C),B.classList.toggle("toggled",E),Q.classList.toggle("toggled",i),g.setAttribute("aria-checked",C),B.setAttribute("aria-checked",E),Q.setAttribute("aria-checked",i)}this.eventBus._on("spreadmodechanged",C),this.eventBus._on("secondarytoolbarreset",(function(A){A.source===I&&C({mode:D.SpreadMode.NONE})}))}},{key:"open",value:function(){this.opened||(this.opened=!0,this.setMaxHeight(),this.toggleButton.classList.add("toggled"),this.toggleButton.setAttribute("aria-expanded","true"),this.toolbar.classList.remove("hidden"))}},{key:"close",value:function(){this.opened&&(this.opened=!1,this.toolbar.classList.add("hidden"),this.toggleButton.classList.remove("toggled"),this.toggleButton.setAttribute("aria-expanded","false"))}},{key:"toggle",value:function(){this.opened?this.close():this.open()}},{key:"setMaxHeight",value:function(){this.opened&&(this.containerHeight=this.mainContainer.clientHeight,this.containerHeight!==this.previousContainerHeight&&(this.toolbarButtonContainer.style.maxHeight="".concat(this.containerHeight-D.SCROLLBAR_PADDING,"px"),this.previousContainerHeight=this.containerHeight))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"CursorTool",(function(){return o})),g.d(I,"PDFCursorTools",(function(){return w}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D=g(45),i=g(22),o={SELECT:0,HAND:1,ZOOM:2},w=function(){function A(I){var g=this,B=I.container,C=I.eventBus,E=I.cursorToolOnLoad,i=void 0===E?o.SELECT:E;Q()(this,A),this.container=B,this.eventBus=C,this.active=o.SELECT,this.activeBeforePresentationMode=null,this.handTool=new D.GrabToPan({element:this.container}),this.addEventListeners(),Promise.resolve().then((function(){g.switchTool(i)}))}return E()(A,[{key:"activeTool",get:function(){return this.active}},{key:"switchTool",value:function(A){var I=this;if(null===this.activeBeforePresentationMode&&A!==this.active){var g=function(){switch(I.active){case o.SELECT:break;case o.HAND:I.handTool.deactivate();case o.ZOOM:}};switch(A){case o.SELECT:g();break;case o.HAND:g(),this.handTool.activate();break;case o.ZOOM:default:return}this.active=A,this.dispatchEvent()}}},{key:"dispatchEvent",value:function(){this.eventBus.dispatch("cursortoolchanged",{source:this,tool:this.active})}},{key:"addEventListeners",value:function(){var A=this;this.eventBus._on("switchcursortool",(function(I){A.switchTool(I.tool)})),this.eventBus._on("presentationmodechanged",(function(I){switch(I.state){case i.PresentationModeState.FULLSCREEN:var g=A.active;A.switchTool(o.SELECT),A.activeBeforePresentationMode=g;break;case i.PresentationModeState.NORMAL:var B=A.activeBeforePresentationMode;A.activeBeforePresentationMode=null,A.switchTool(B)}}))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"GrabToPan",(function(){return i}));var B=g(5),Q=g.n(B),C=g(1),E=g.n(C),D="grab-to-pan-grab",i=function(){function A(I){Q()(this,A),this.element=I.element,this.document=I.element.ownerDocument,"function"==typeof I.ignoreTarget&&(this.ignoreTarget=I.ignoreTarget),this.onActiveChanged=I.onActiveChanged,this.activate=this.activate.bind(this),this.deactivate=this.deactivate.bind(this),this.toggle=this.toggle.bind(this),this._onMouseDown=this.onMouseDown.bind(this),this._onMouseMove=this.onMouseMove.bind(this),this._endPan=this.endPan.bind(this),(this.overlay=document.createElement("div")).className="grab-to-pan-grabbing"}return E()(A,[{key:"activate",value:function(){this.active||(this.active=!0,this.element.addEventListener("mousedown",this._onMouseDown,!0),this.element.classList.add(D),this.onActiveChanged&&this.onActiveChanged(!0))}},{key:"deactivate",value:function(){this.active&&(this.active=!1,this.element.removeEventListener("mousedown",this._onMouseDown,!0),this._endPan(),this.element.classList.remove(D),this.onActiveChanged&&this.onActiveChanged(!1))}},{key:"toggle",value:function(){this.active?this.deactivate():this.activate()}},{key:"ignoreTarget",value:function(A){return A.matches("a[href], a[href] *, input, textarea, button, button *, select, option")}},{key:"onMouseDown",value:function(A){if(0===A.button&&!this.ignoreTarget(A.target)){if(A.originalTarget)try{A.originalTarget.tagName}catch(A){return}this.scrollLeftStart=this.element.scrollLeft,this.scrollTopStart=this.element.scrollTop,this.clientXStart=A.clientX,this.clientYStart=A.clientY,this.document.addEventListener("mousemove",this._onMouseMove,!0),this.document.addEventListener("mouseup",this._endPan,!0),this.element.addEventListener("scroll",this._endPan,!0),A.preventDefault(),A.stopPropagation();var I=document.activeElement;I&&!I.contains(A.target)&&I.blur()}}},{key:"onMouseMove",value:function(A){if(this.element.removeEventListener("scroll",this._endPan,!0),1&A.buttons){var I=A.clientX-this.clientXStart,g=A.clientY-this.clientYStart,B=this.scrollTopStart-g,Q=this.scrollLeftStart-I;this.element.scrollTo?this.element.scrollTo({top:B,left:Q,behavior:"instant"}):(this.element.scrollTop=B,this.element.scrollLeft=Q),this.overlay.parentNode||document.body.appendChild(this.overlay)}else this._endPan()}},{key:"endPan",value:function(){this.element.removeEventListener("scroll",this._endPan,!0),this.document.removeEventListener("mousemove",this._onMouseMove,!0),this.document.removeEventListener("mouseup",this._endPan,!0),this.overlay.remove()}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"Print",(function(){return M}));var B=g(7),Q=g.n(B),C=g(5),E=g.n(C),D=g(1),i=g.n(D),o=g(8),w=g.n(o),G=(g(37),g(30)),F=g(36),N=g(47),y=g.n(N);function R(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return h(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return h(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function h(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var M=function(){function A(I,g,B,Q,C){E()(this,A),this.coreHelper=new F.Ofd_Core_Helper(40),this.dialog=I||document.getElementById("printServiceDialog"),this.overlayManager=g,this.l10n=B,this.ofdRender=new G.Ofd_Render(null,this.coreHelper),document.getElementById("printCancel").addEventListener("click",this.close.bind(this)),this.overlayManager.register(this.dialog),this.progressBar=this.dialog.querySelector("progress"),this.progressPerc=this.dialog.querySelector(".relative-progress"),this.abort=!1,this.eventBus=Q,this.callback=C}var I,g,B;return i()(A,[{key:"setOfdCore",value:function(A){this.core=A,this.ofdRender.setOfdCore(this.core)}},{key:"close",value:(B=Q()(w.a.mark((function A(){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:this.abort=!0,this.overlayManager.close(this.dialog);case 2:case"end":return A.stop()}}),A,this)}))),function(){return B.apply(this,arguments)})},{key:"open",value:(g=Q()(w.a.mark((function A(){var I=this;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.core){A.next=2;break}return A.abrupt("return");case 2:return this.abort=!1,this.overlayManager.open(this.dialog),A.next=6,this.renderProgress(0);case 6:setTimeout((function(){I.prepare().then((function(A){if(A&&A.length>0){I.close();var g,B=document.createElement("div"),Q=R(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;B.appendChild(C)}}catch(A){Q.e(A)}finally{Q.f()}if(I.callback&&I.eventBus)return void I.eventBus.dispatch("printCallback",{source:I,html:B});y()({printable:B,type:"html",scanStyles:!1}),I.eventBus.dispatch("printFinishCallback",{source:I})}}))}),100);case 7:case"end":return A.stop()}}),A,this)}))),function(){return g.apply(this,arguments)})},{key:"prepare",value:(I=Q()(w.a.mark((function A(){var I=this;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",new Promise(function(){var A=Q()(w.a.mark((function A(g,B){var Q,C,E,D,i;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:Q=[],C=0;case 2:if(!(C<I.core.getOFDPageCount(0))||I.abort){A.next=21;break}return E=785/I.core.pageWidth(0,C)*25.4,I.ofdRender.setDpi(E),(D=document.createElement("canvas")).style.width="794px",D.style.height="1123px",(i=document.createElement("div")).style.width="794px",i.style.height="1123px",i.style.position="relative",i.appendChild(D),A.next=15,I.ofdRender.renderPage(i,0,C);case 15:return Q.push(i),A.next=18,I.renderProgress(C+1);case 18:C++,A.next=2;break;case 21:I.abort&&g(),g(Q);case 23:case"end":return A.stop()}}),A)})));return function(I,g){return A.apply(this,arguments)}}()));case 1:case"end":return A.stop()}}),A)}))),function(){return I.apply(this,arguments)})},{key:"renderProgress",value:function(A){var I=this;return new Promise((function(g,B){var Q=Math.round(100*A/I.core.getOFDPageCount(0));I.progressBar.value=Q,I.l10n.get("print_progress_percent",{progress:Q}).then((function(A){I.progressPerc.textContent=A})),setTimeout((function(){g()}),100)}))}}]),A}()},function(A,I,g){var B;window,B=function(){return function(A){var I={};function g(B){if(I[B])return I[B].exports;var Q=I[B]={i:B,l:!1,exports:{}};return A[B].call(Q.exports,Q,Q.exports,g),Q.l=!0,Q.exports}return g.m=A,g.c=I,g.d=function(A,I,B){g.o(A,I)||Object.defineProperty(A,I,{enumerable:!0,get:B})},g.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},g.t=function(A,I){if(1&I&&(A=g(A)),8&I)return A;if(4&I&&"object"==typeof A&&A&&A.__esModule)return A;var B=Object.create(null);if(g.r(B),Object.defineProperty(B,"default",{enumerable:!0,value:A}),2&I&&"string"!=typeof A)for(var Q in A)g.d(B,Q,function(I){return A[I]}.bind(null,Q));return B},g.n=function(A){var I=A&&A.__esModule?function(){return A.default}:function(){return A};return g.d(I,"a",I),I},g.o=function(A,I){return Object.prototype.hasOwnProperty.call(A,I)},g.p="",g(g.s=0)}({"./src/index.js":
|
|
2
2
|
/*!**********************!*\
|
|
3
3
|
!*** ./src/index.js ***!
|
|
4
4
|
\**********************/
|