parser_x.js 1.1.72 → 1.1.73
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 C=I[B]={i:B,l:!1,exports:{}};return A[B].call(C.exports,C,C.exports,g),C.l=!0,C.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 C in A)g.d(B,C,function(I){return A[I]}.bind(null,C));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 T})),g.d(I,"ajaxUtils",(function(){return O})),g.d(I,"getToSign",(function(){return u})),g.d(I,"packageSigned",(function(){return z})),g.d(I,"free",(function(){return P})),g.d(I,"hashOfdDocument",(function(){return v})),g.d(I,"parseOfdDocument",(function(){return $})),g.d(I,"parseOfdDocumentFromBase64",(function(){return AA})),g.d(I,"getOFDPageCount",(function(){return IA})),g.d(I,"navigatePage",(function(){return gA})),g.d(I,"getAllAttachments",(function(){return BA})),g.d(I,"getAttachmentById",(function(){return CA})),g.d(I,"getAttachmentArrayBuffer",(function(){return QA})),g.d(I,"pageSize",(function(){return EA})),g.d(I,"getCustomTag",(function(){return DA})),g.d(I,"getTextObjects",(function(){return iA})),g.d(I,"renderOfd",(function(){return oA})),g.d(I,"renderOfdByIndex",(function(){return wA})),g.d(I,"getFileStream",(function(){return GA})),g.d(I,"setLanguage",(function(){return NA})),g.d(I,"setScale",(function(){return yA})),g.d(I,"openMetaBaseViewer",(function(){return hA})),g.d(I,"openOFDBaseViewer",(function(){return RA})),g.d(I,"openOFDBaseViewerByBase64",(function(){return MA})),g.d(I,"verifySignature",(function(){return UA})),g.d(I,"printOFD",(function(){return cA})),g.d(I,"getEventBus",(function(){return sA})),g.d(I,"initOFDViewer",(function(){return aA})),g.d(I,"openOFDViewer",(function(){return YA})),g.d(I,"openFile",(function(){return SA})),g.d(I,"openFileBase64",(function(){return kA})),g.d(I,"openOFD",(function(){return KA})),g.d(I,"openOFDWithHeader",(function(){return HA}));var B=g(1),C=g.n(B),Q=g(5),E=g.n(Q),D=g(6),i=g.n(D),o=g(7),w=g.n(o),F=g(9),G=g(12),N=g(20),y=g(90),h=g(91),R=g(92),M=g(93),U=g(94),c=g(95),s=g(96),a=g(98),Y=g(35),S=g(100),k=g(32),K=g(30),H=g(36),L=g(101),J=g(102),t=g.n(J),d=g(103),e=g(104),n=g(105),l=g(106),r=g(31),Z=g(107),q=g.n(Z),f=g(108),W=g.n(f),x=g(109),p=g(110),b=g(111);g(22);function V(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,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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}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 T=S.Print_api,j=window.Module;void 0===String.prototype.replaceAll&&(String.prototype.replaceAll=function(A,I){return this.replace(new RegExp(A,"g"),(function(){return I}))});var X={ofdCore:null,viewer:null,eventBus:null,waterText:null,fileName:null,ofdRender:null},O=W.a,u=function(A,I){return Object(k.JSGetToSign)(A,I)},z=function(A,I){return Object(k.JSPackageSigned)(A,I)},P=function(){X.ofdCore&&Object(k.freeOFD)(X.ofdCore)},v=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)):q()({url:A.ofd,method:"GET",responseType:"arraybuffer",headers:A.headers}).then((function(I){var g=Object(k.readOFD)(I.data,A.secret,A.digest);_(g,A)})).catch((function(I){A.fail&&A.fail(I)}))},_=function(A,I){0===A.code?(X.ofdCore=new Y.Ofd_Core(A.data.ofd,A.data.ofdParserPtr,A.data.leftTime),I.waterText&&(X.waterText=I.waterText),I.digest||(X.waterText="demotest"),I.signatureClickCallback&&(X.eventBus=new G.EventBus,X.eventBus._on("signatureclick",I.signatureClickCallback)),I.signaturesCallback&&I.signaturesCallback(X.ofdCore.getAllSignature(0)),I.success&&I.success(X.ofdCore)):I.fail&&I.fail(A.msg)},$=function(A){FA(i()(w.a.mark((function I(){var g,B,C;return w.a.wrap((function(I){for(;;)switch(I.prev=I.next){case 0:if(X.ofdCore&&(Object(k.freeOFD)(X.ofdCore),X.ofdCore=null,X.ofdRender=null),Object(k.CreateLibrary)(),!(A.ofd instanceof File)){I.next=8;break}(g=new FileReader).readAsArrayBuffer(A.ofd),g.onload=function(){var I=Object(k.readOFD)(g.result,A.secret,A.digest);_(I,A)},I.next=20;break;case 8:if(!(A.ofd instanceof Blob)){I.next=19;break}return I.t0=k.readOFD,I.next=12,A.ofd.arrayBuffer();case 12:I.t1=I.sent,I.t2=A.secret,I.t3=A.digest,B=(0,I.t0)(I.t1,I.t2,I.t3),_(B,A),I.next=20;break;case 19:A.ofd instanceof ArrayBuffer?(C=Object(k.readOFD)(A.ofd,A.secret,A.digest),_(C,A)):fetch(A.ofd,{method:"get",headers:A.headers}).then((function(A){return A.arrayBuffer()})).then((function(I){if(A.ofd&&A.ofd.split("/")){var g=A.ofd.split("/");X.fileName=g[g.length-1]}var B=Object(k.readOFD)(I,A.secret,A.digest);_(B,A)})).catch((function(I){A.fail&&A.fail(I)}));case 20:case"end":return I.stop()}}),I)}))))},AA=function(A){FA((function(){X.ofdCore&&(Object(k.freeOFD)(X.ofdCore),X.ofdCore=null,X.ofdRender=null),Object(k.CreateLibrary)();var I=Object(k.readOFDByBase64)(A.ofd,A.secret,A.digest);_(I,A)}))},IA=function(A){return X.ofdCore.getOFDPageCount(A)},gA=function(A){A<1&&(A=1),X.viewer.toolbar&&A>X.viewer.toolbar.pagesCount&&(A=X.viewer.toolbar.pagesCount),X.viewer.eventBus.dispatch("pagenumberchanged",{source:X.viewer.ofdViewer,value:A})},BA=function(A){return X.ofdCore.getAllAttachment(A)},CA=function(A,I){return X.ofdCore.getAttachmentByID(A,I)},QA=function(A,I){return new Promise((function(g,B){var C=X.ofdCore.getAttachmentByID(A,I);C?iI(C.FileLocAbs).then((function(A){g(A)})).catch((function(A){B(A)})):B("attachmentId error")}))},EA=function(A,I,g){var B=96;g&&(B=g/X.ofdCore.pageWidth(A,I)*25.4);var C=new H.Ofd_Core_Helper(B);return{width:X.ofdCore.pageWidth(A,I),height:X.ofdCore.pageHeight(A,I),renderWidth:C.pageRenderWidth(A,I,X.ofdCore),renderHeight:C.pageRenderHeight(A,I,X.ofdCore)}},DA=function(A){return X.ofdCore.getCustomTag(A)},iA=function(A){return X.ofdCore.getAllTextObject(A)},oA=function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},B=96;I&&"number"==typeof I&&!isNaN(I)&&(B=I/X.ofdCore.pageWidth(A,0)*25.4);var C=new H.Ofd_Core_Helper(B);g.waterText?C.setWaterText(g.waterText):X.waterText&&C.setWaterText(X.waterText),X.ofdRender?X.ofdRender.setDpi(B):X.ofdRender=new K.Ofd_Render(X.ofdCore,C),g.mixBlendMode&&X.ofdRender.setMixBlendMode(g.mixBlendMode);var Q=[];if(!X.ofdCore.readOfdDocument(A))return Q;var E=X.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=C.pageRenderWidth(0,D,X.ofdCore),w=C.pageRenderHeight(0,D,X.ofdCore);i.setAttribute("style","margin-bottom: 20px;position: relative;width:".concat(o,"px;height:").concat(w,"px;background: white;overflow: hidden")),X.ofdRender.renderPage(i,0,D),Q.push(i)}return Q},wA=function(A,I,g){var B=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},C=96;g&&"number"==typeof g&&!isNaN(g)&&(C=g/X.ofdCore.pageWidth(A,I)*25.4);var Q=new H.Ofd_Core_Helper(C);B.waterText?Q.setWaterText(B.waterText):X.waterText&&Q.setWaterText(X.waterText),X.ofdRender?X.ofdRender.setDpi(C):X.ofdRender=new K.Ofd_Render(X.ofdCore,Q),B.mixBlendMode&&X.ofdRender.setMixBlendMode(B.mixBlendMode);var E=document.createElement("div"),D=Q.pageRenderWidth(0,I,X.ofdCore),i=Q.pageRenderHeight(0,I,X.ofdCore);return E.setAttribute("style","position: relative;width:".concat(D,"px;height:").concat(i,"px;overflow: hidden")),X.ofdRender.renderPage(E,0,I),E},FA=function(A){if(j)Object(k.setYYDS)(j),A&&A();else{Object(k.needInitAgain)()||A&&(A(),A=null);document.getElementsByTagName("meta").ofdwasm;t()({locateFile:function(){return d.wsdsb}}).then((function(I){var g=I.Module;Object(k.setYYDS)(g),A&&A()}))}},GA=function(){return Object(k.getStreamData)()},NA=function(A){X.viewer.toolbar&&X.viewer.toolbar.setLanguage(A)},yA=function(A){X.viewer.ofdViewer&&X.viewer.ofdViewer.zoom(A)},hA=function(A){if(A.loadingContainer){if(A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);A.container.appendChild(A.loadingContainer)}X.ofdCore&&(X.eventBus=new G.EventBus,X.eventBus._on("pageFinishRender",A.pageFinishRenderCallback),new l.OfdBaseViewer(A.container,A.width,X.eventBus,X.waterText).setOfdCore(X.ofdCore))},RA=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)}$({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 l.OfdBaseViewer(A.container,A.width,X.eventBus,X.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)},MA=function(A){if(A.loadingContainer){if(A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);A.container.appendChild(A.loadingContainer)}AA({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 l.OfdBaseViewer(A.container,A.width,X.eventBus,X.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)}})},UA=function(A){var I=X.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="",C=V(I.SignedInfo.References);try{for(C.s();!(g=C.n()).done;){var Q=g.value;B+="".concat(Object(r.replaceFirstSlash)(Q.FileRef),"|")}}catch(A){C.e(A)}finally{C.f()}var E,D=Object(k.hashPath)(X.ofdCore.ofdParserPtr,B,I.SignedInfo.ReferencesCheckMethod.toLowerCase()),i=!0,o=V(I.SignedInfo.References);try{for(o.s();!(E=o.n()).done;){var w=E.value,F=w.CheckValue,G=D["".concat(Object(r.replaceFirstSlash)(w.FileRef))];i&=F===G}}catch(A){o.e(A)}finally{o.f()}A.hashFileCallback&&A.hashFileCallback(1===i)}),200)},cA=function(){X.viewer.ofdPrint&&TA()},sA=function(){return X.viewer.eventBus},aA=function(A){YA(A)},YA=function(A){var I;X.viewer&&((I=X.viewer.eventBus)._off("resize",qA),I._off("fileinputchange",fA),I._off("openfile",tA),I._off("nextpage",pA),I._off("previouspage",bA),I._off("pagenumberchanged",VA),I._off("pagechanging",mA),I._off("print",TA),I._off("firstpage",WA),I._off("lastpage",xA),I._off("zoomin",jA),I._off("zoomout",XA),I._off("scalechanging",OA),I._off("scalechanged",zA),I._off("viewportchanging",uA),I._off("switchspreadmode",PA),I._off("scrollmodechanged",vA),I._off("switchscrollmode",_A),I._off("rotatecw",$A),I._off("rotateccw",AI),I._off("documentproperties",II),I._off("signatureclick",BI),I._off("attachmentclick",CI),I._off("customtagclick",EI),I._off("outlineClick",DI),I._off("download",lA),I._off("langchanged",nA),I._off("pageViewerClick",QI),I._off("closePage",eA),I._off("printCallback",rA),I._off("printFinishCallback",ZA),I._off("switchannotationeditormode",dA)),X.viewer=new JA(A)},SA=function(A){KA(A)},kA=function(A){X.viewer&&(A?(X.viewer.config.openFileTip&&(X.viewer.config.openFileTip.hidden=!0),X.viewer.ofdViewer.freeDocument(),X.viewer.config.loadingContainer&&X.viewer.ofdViewer.viewer.appendChild(X.viewer.config.loadingContainer),AA({ofd:A,secret:X.viewer.config.secret,digest:X.viewer.config.digest,waterText:X.viewer.config.waterText,success:function(A){var I,g,B,C;if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){X.viewer.config.errorWrapper.moreInfoButton.hidden=!0,X.viewer.config.errorWrapper.container.hidden=!1;var Q=A.leftTime/864e5,E=A.leftTime%864e5/36e5,D=A.leftTime%36e5/6e4,i=A.leftTime%6e4/1e3;X.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(Q),"天").concat(Math.floor(E),"小时").concat(Math.floor(D),"分").concat(Math.floor(i),"秒"),X.viewer.config.exceedTimeLimit&&X.viewer.config.exceedTimeLimit()}X.viewer.config.parserOFDSuccess&&X.viewer.config.parserOFDSuccess(A.ofd),X.viewer.eventBus.dispatch("secondarytoolbarreset",{source:X.viewer.secondaryToolbar}),X.ofdCore=A,X.viewer.ofdViewer.setWaterText(X.waterText),X.viewer.ofdViewer.setWaterSetting(X.viewer.config.waterSetting),X.viewer.ofdViewer.setOfdCore(A),X.viewer.ofdThumbnailViewer&&X.viewer.ofdThumbnailViewer.setOfdCore(A),null===(I=X.viewer.ofdSignatureViewer)||void 0===I||I.setOfdCore(A,X.viewer.config.signatureViewerForceCheck),null===(g=X.viewer.ofdAttachmentViewer)||void 0===g||g.setOfdCore(A),null===(B=X.viewer.ofdCustomTagViewer)||void 0===B||B.setOfdCore(A),null===(C=X.viewer.ofdOutlineViewer)||void 0===C||C.setOfdCore(A),X.viewer.config.signaturesCallback&&X.viewer.config.signaturesCallback(A.getAllSignature(0)),X.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),X.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),X.viewer.config.sidebarForceOpen&&setTimeout((function(){X.viewer.pdfSidebar.open()}),500),X.viewer.config.renderOFDCallback&&X.viewer.config.renderOFDCallback()},fail:function(A){X.viewer.config.parserOFDFail&&X.viewer.config.parserOFDFail(A),X.viewer.ofdViewer.freeDocument(),X.viewer.config.errorWrapper.moreInfoButton.hidden=!0,X.viewer.config.errorWrapper.container.hidden=!1,X.viewer.config.errorWrapper.errorMessage.textContent=A}})):X.viewer.config.parserOFDFail&&X.viewer.config.parserOFDFail("file undefined"))},KA=function(A){LA({file:A})},HA=function(A,I){LA({file:A,headers:I})},LA=function(A){X.viewer&&(A.file?(X.viewer.config.openFileTip&&(X.viewer.config.openFileTip.hidden=!0),X.viewer.ofdViewer.freeDocument(),X.viewer.config.loadingContainer&&X.viewer.ofdViewer.viewer.appendChild(X.viewer.config.loadingContainer),$({ofd:A.file,headers:A.headers,secret:X.viewer.config.secret,digest:X.viewer.config.digest,waterText:X.viewer.config.waterText,success:function(A){var I,g,B,C;if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){X.viewer.config.errorWrapper.moreInfoButton.hidden=!0,X.viewer.config.errorWrapper.container.hidden=!1;var Q=A.leftTime/864e5,E=A.leftTime%864e5/36e5,D=A.leftTime%36e5/6e4,i=A.leftTime%6e4/1e3;X.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(Q),"天").concat(Math.floor(E),"小时").concat(Math.floor(D),"分").concat(Math.floor(i),"秒"),X.viewer.config.exceedTimeLimit&&X.viewer.config.exceedTimeLimit()}X.viewer.config.parserOFDSuccess&&X.viewer.config.parserOFDSuccess(A.ofd),X.viewer.eventBus.dispatch("secondarytoolbarreset",{source:X.viewer.secondaryToolbar}),X.ofdCore=A,X.viewer.ofdViewer.setWaterText(X.waterText),X.viewer.ofdViewer.setWaterSetting(X.viewer.config.waterSetting),X.viewer.ofdViewer.setOfdCore(A),X.viewer.ofdThumbnailViewer&&X.viewer.ofdThumbnailViewer.setOfdCore(A),null===(I=X.viewer.ofdSignatureViewer)||void 0===I||I.setOfdCore(A,X.viewer.config.signatureViewerForceCheck),null===(g=X.viewer.ofdAttachmentViewer)||void 0===g||g.setOfdCore(A),null===(B=X.viewer.ofdCustomTagViewer)||void 0===B||B.setOfdCore(A),null===(C=X.viewer.ofdOutlineViewer)||void 0===C||C.setOfdCore(A),X.viewer.config.signaturesCallback&&X.viewer.config.signaturesCallback(A.getAllSignature(0)),X.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),X.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),X.viewer.config.sidebarForceOpen&&setTimeout((function(){X.viewer.pdfSidebar.open()}),500),X.viewer.config.renderOFDCallback&&X.viewer.config.renderOFDCallback()},fail:function(A){X.viewer.config.parserOFDFail&&X.viewer.config.parserOFDFail(A),X.viewer.ofdViewer.freeDocument(),X.viewer.config.errorWrapper.moreInfoButton.hidden=!0,X.viewer.config.errorWrapper.container.hidden=!1,X.viewer.config.errorWrapper.errorMessage.textContent=A,"授权信息错误"==A?X.viewer.l10n.get("error_10001").then((function(A){X.viewer.config.errorWrapper.errorMessage.textContent=A})):"授权时间过期"==A&&X.viewer.l10n.get("error_10002").then((function(A){X.viewer.config.errorWrapper.errorMessage.textContent=A}))}})):X.viewer.config.parserOFDFail&&X.viewer.config.parserOFDFail("file undefined"))},JA=C()((function A(I){var g,B=this;E()(this,A),this.config=I,this.l10n=new F.GenericL10n("zh-CN"),this.eventBus=new G.EventBus,this.ofdViewer=new N.OfdViewer(I.mainContainer,I.viewerContainer,this.eventBus,I.mixBlendMode,I.defaultScale),null!==(g=I.sidebar)&&void 0!==g&&g.thumbnailView&&(this.ofdThumbnailViewer=new y.OfdThumbnailViewer(I.sidebar.thumbnailView,this.eventBus)),I.sidebar&&(this.ofdSignatureViewer=new e.OfdSignatureViewer(I.sidebar.signaturesView,this.eventBus),this.ofdAttachmentViewer=new n.OfdAttachmentViewer(I.sidebar.attachmentsView,this.eventBus),this.ofdCustomTagViewer=new x.OfdCustomTagViewer(I.sidebar.outlineView,this.eventBus),this.ofdOutlineViewer=new p.OfdOutlineViewer(I.sidebar.outlineView,this.eventBus),this.pdfSidebar=new h.PDFSidebar({elements:I.sidebar,ofdViewer:this.ofdViewer,ofdThumbnailViewer:this.ofdThumbnailViewer,eventBus:this.eventBus,l10n:this.l10n}),this.pdfSidebarResizer=new b.PDFSidebarResizer(I.sidebarResizer,this.eventBus,this.l10n)),this.overlayManager=new R.OverlayManager,I.signatureProperties&&(this.signatureProperties=new L.OFDSignatureProperties(I.signatureProperties,this.overlayManager,this.eventBus,this.l10n)),I.documentProperties&&(this.ofdDocumentProperties=new M.PDFDocumentProperties(I.documentProperties,this.overlayManager,this.eventBus,this.l10n)),this.toolbar=new U.Toolbar(I.toolbar,this.eventBus,this.l10n),this.secondaryToolbar=new c.SecondaryToolbar(I.secondaryToolbar,I.mainContainer,this.eventBus);var C=document.createElement("input");C.id="fileInput",C.className="fileInput",C.setAttribute("type","file"),C.setAttribute("accept",".ofd"),document.body.appendChild(C);var Q=this;C.addEventListener("click",(function(A){A.target.value=null})),C.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 s.PDFCursorTools({container:I.mainContainer,eventBus:this.eventBus});var D=document.getElementById("printServiceDialog");D&&(this.ofdPrint=new a.Print(D,this.overlayManager,this.l10n,this.eventBus,I.onPrintContentCallback,I.waterText,I.waterSetting));var i=I.appContainer||document.documentElement;this.l10n.translate(i).then((function(){B.eventBus.dispatch("localized",{})})),this.eventBus._on("printCallback",rA),this.eventBus._on("printFinishCallback",ZA),this.eventBus._on("resize",qA),this.eventBus._on("fileinputchange",fA),this.eventBus._on("openfile",tA),this.eventBus._on("nextpage",pA),this.eventBus._on("previouspage",bA),this.eventBus._on("pagenumberchanged",VA),this.eventBus._on("pagechanging",mA),this.eventBus._on("print",TA),this.eventBus._on("firstpage",WA),this.eventBus._on("lastpage",xA),this.eventBus._on("zoomin",jA),this.eventBus._on("zoomout",XA),this.eventBus._on("scalechanging",OA),this.eventBus._on("viewportchanging",uA),this.eventBus._on("scalechanged",zA),this.eventBus._on("switchspreadmode",PA),this.eventBus._on("scrollmodechanged",vA),this.eventBus._on("switchscrollmode",_A),this.eventBus._on("rotatecw",$A),this.eventBus._on("rotateccw",AI),this.eventBus._on("documentproperties",II),this.eventBus._on("signatureclick",BI),this.eventBus._on("attachmentclick",CI),this.eventBus._on("customtagclick",EI),this.eventBus._on("outlineClick",DI),this.eventBus._on("download",lA),this.eventBus._on("langchanged",nA),this.eventBus._on("pageViewerClick",QI),this.eventBus._on("closePage",eA),this.eventBus._on("switchannotationeditormode",dA),window.addEventListener("click",gI),window.addEventListener("resize",(function(){B.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),D&&"function"!=typeof D.showModal&&(D&&(D.hidden=!0),I.documentProperties&&I.documentProperties.dialog&&(I.documentProperties.dialog.hidden=!0),I.signatureProperties&&I.signatureProperties.dialog&&(I.signatureProperties.dialog.hidden=!0))}));function tA(){document.getElementById("fileInput").click()}function dA(A){X.viewer.ofdViewer.annotationEditorMode=A}function eA(){X.viewer.config.closeCallback&&X.viewer.config.closeCallback()}function nA(A){X.viewer.l10n.setLanguage(A.value),X.viewer.l10n.translate(X.viewer.appContainer).then((function(){X.viewer.eventBus.dispatch("localized",{})}))}function lA(){var A=Object(k.getStreamData)();if(A){if(X.viewer.config.downloadCallback)X.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",X.fileName),document.body.append(g),g.click()}X.viewer.config.downloadFinishEvent&&X.viewer.config.downloadFinishEvent()}var B=Object(k.getStreamDataBase64)();if(B){var C=function(A){for(var I=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",g=atob(A),B=[],C=0;C<g.length;C++)B.push(g.charCodeAt(C));var Q=new Uint8Array(B);return new Blob([Q],{type:I})}(B,"application/ofd");if(X.viewer.config.downloadCallback)X.viewer.config.downloadCallback(C);else{var Q=window.URL.createObjectURL(C),E=document.createElement("a");E.style.display="none",E.href=Q,E.setAttribute("download",X.fileName),document.body.append(E),E.click()}X.viewer.config.downloadFinishEvent&&X.viewer.config.downloadFinishEvent()}}function rA(A){X.viewer.config.onPrintContentCallback&&X.viewer.config.onPrintContentCallback(A.html)}function ZA(A){X.viewer.config.onPrintFinishEvent&&X.viewer.config.onPrintFinishEvent()}function qA(){var A=X.ofdCore,I=X.viewer;if(A){var g=I.ofdViewer.currentScaleValue;"auto"!==g&&"page-fit"!==g&&"page-width"!==g||(I.ofdViewer.currentScaleValue=g),X.viewer.eventBus.dispatch("stampResize",{source:null})}}function fA(A){var I;X.viewer.config.openFileTip&&(X.viewer.config.openFileTip.hidden=!0),null!==(I=X.viewer.pdfSidebar)&&void 0!==I&&I.isOpen&&X.viewer.pdfSidebar.close();var g=A.fileInput.files[0];X.fileName=g.name,X.viewer.ofdViewer.freeDocument(),X.viewer.config.loadingContainer&&X.viewer.ofdViewer.viewer.appendChild(X.viewer.config.loadingContainer);(new Date).getTime();$({ofd:g,secret:X.viewer.config.secret,digest:X.viewer.config.digest,waterText:X.viewer.config.waterText,success:function(A){var I,g,B,C;(new Date).getTime();if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){X.viewer.config.errorWrapper.moreInfoButton.hidden=!0,X.viewer.config.errorWrapper.container.hidden=!1;var Q=A.leftTime/864e5,E=A.leftTime%864e5/36e5,D=A.leftTime%36e5/6e4,i=A.leftTime%6e4/1e3;X.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(Q),"天").concat(Math.floor(E),"小时").concat(Math.floor(D),"分").concat(Math.floor(i),"秒"),X.viewer.config.exceedTimeLimit&&X.viewer.config.exceedTimeLimit()}X.viewer.config.parserOFDSuccess&&X.viewer.config.parserOFDSuccess(A.ofd),X.viewer.eventBus.dispatch("secondarytoolbarreset",{source:X.viewer.secondaryToolbar}),X.ofdCore=A,X.viewer.ofdViewer.setWaterText(X.waterText),X.viewer.ofdViewer.setWaterSetting(X.viewer.config.waterSetting),X.viewer.ofdViewer.setOfdCore(A),X.viewer.ofdThumbnailViewer&&X.viewer.ofdThumbnailViewer.setOfdCore(A),X.viewer.config.signaturesCallback&&X.viewer.config.signaturesCallback(A.getAllSignature(0)),null===(I=X.viewer.ofdSignatureViewer)||void 0===I||I.setOfdCore(A,X.viewer.config.signatureViewerForceCheck),null===(g=X.viewer.ofdAttachmentViewer)||void 0===g||g.setOfdCore(A),null===(B=X.viewer.ofdCustomTagViewer)||void 0===B||B.setOfdCore(A),null===(C=X.viewer.ofdOutlineViewer)||void 0===C||C.setOfdCore(A),X.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),X.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),X.viewer.config.sidebarForceOpen&&setTimeout((function(){X.viewer.pdfSidebar.open()}),500),X.viewer.config.renderOFDCallback&&X.viewer.config.renderOFDCallback()},fail:function(A){X.viewer.config.parserOFDFail&&X.viewer.config.parserOFDFail(A),X.viewer.ofdViewer.freeDocument(),X.viewer.config.errorWrapper.moreInfoButton.hidden=!0,X.viewer.config.errorWrapper.container.hidden=!1,X.viewer.config.errorWrapper.errorMessage.textContent=A,"授权信息错误"==A?X.viewer.l10n.get("error_10001").then((function(A){X.viewer.config.errorWrapper.errorMessage.textContent=A})):"授权时间过期"==A&&X.viewer.l10n.get("error_10002").then((function(A){X.viewer.config.errorWrapper.errorMessage.textContent=A}))}})}function WA(){X.viewer.ofdViewer.firstPage()}function xA(){X.viewer.ofdViewer.lastPage()}function pA(){X.viewer.ofdViewer.nextPage()}function bA(){X.viewer.ofdViewer.previousPage()}function VA(A){""!==A.value&&A.source.eventBus.dispatch("jumpPage",{source:A.source,pageIndex:A.value}),X.viewer.toolbar.setPageNumber(A.value,null),X.viewer.secondaryToolbar.setPageNumber(A.value,null)}function mA(A){var I,g=A.pageNumber;X.viewer.toolbar.setPageNumber(g,null),X.viewer.secondaryToolbar.setPageNumber(g,null),null!==(I=X.viewer.pdfSidebar)&&void 0!==I&&I.isThumbnailViewVisible&&X.viewer.ofdThumbnailViewer.scrollThumbnailIntoView(g),X.viewer.config.onPageChanging&&X.viewer.config.onPageChanging(g)}function TA(){X.viewer.ofdPrint.setOfdCore(X.ofdCore),X.viewer.ofdPrint.open()}function jA(){X.viewer.ofdViewer.increaseScale()}function XA(){X.viewer.ofdViewer.decreaseScale()}function OA(A){X.viewer.toolbar.setPageScale(A.presetValue,A.scale),X.viewer.config.onPageScale&&X.viewer.config.onPageScale(A.scale)}function uA(A){X.viewer.config.onViewportChange&&X.viewer.config.onViewportChange(X.viewer.ofdViewer)}function zA(A){X.viewer.ofdViewer.zoom(A.value)}function PA(A){X.viewer.ofdViewer.setSpreadMode(A.mode)}function vA(A){}function _A(A){X.viewer.ofdViewer.setScrollMode(A.mode)}function $A(){X.viewer.ofdViewer.setRotation(90)}function AI(){X.viewer.ofdViewer.setRotation(-90)}function II(){X.viewer.ofdDocumentProperties.setOfdCore(X.ofdCore),X.viewer.ofdDocumentProperties.open()}function gI(A){X.viewer.secondaryToolbar.isOpen&&(X.viewer.config.mainContainer.contains(A.target)||X.viewer.config.toolbar.container.contains(A.target)&&A.target!==X.viewer.config.secondaryToolbar.toggleButton)&&X.viewer.secondaryToolbar.close()}function BI(A){if(X.viewer.signatureProperties)if(X.viewer.signatureProperties.setOfdCore(X.ofdCore),A.pageRef||A.signatureId){var I=X.ofdCore.findSignature(0,A.pageRef,A.signatureId);X.viewer.signatureProperties.open(I)}else X.viewer.signatureProperties.open(A.sign.Signature)}function CI(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)),iI(A.attachment.FileLocAbs,A.attachment.FileLocPln).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 QI(A){X.viewer.ofdViewer&&X.viewer.ofdViewer.removeHighLight()}function EI(A){A.source.eventBus.dispatch("jumpPage",{source:A.source,pageIndex:A.pageIndex+1,eleIdArray:A.eleIdArray}),X.viewer.toolbar.setPageNumber(A.pageIndex+1,null),X.viewer.secondaryToolbar.setPageNumber(A.pageIndex+1,null)}function DI(A){A.source.eventBus.dispatch("jumpPage",{source:A.source,pageIndex:A.pageIndex+1}),X.viewer.toolbar.setPageNumber(A.pageIndex+1,null),X.viewer.secondaryToolbar.setPageNumber(A.pageIndex+1,null)}function iI(A,I,g){return new Promise((function(g,B){if(Object(k.getStreamData)()){var C=Object(k.JSGetPathEncode)(X.ofdCore.ofdParserPtr,A,I);null!=C?g(C):B(1)}}))}},function(A,I,g){var B=g(2);function C(A,I){for(var g=0;g<I.length;g++){var C=I[g];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(A,B(C.key),C)}}A.exports=function(A,I,g){return I&&C(A.prototype,I),g&&C(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,C=g(4);A.exports=function(A){var I=C(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 C=g.call(A,I||"default");if("object"!==B(C))return C;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){function g(A,I,g,B,C,Q,E){try{var D=A[Q](E),i=D.value}catch(A){return void g(A)}D.done?I(i):Promise.resolve(i).then(B,C)}A.exports=function(A){return function(){var I=this,B=arguments;return new Promise((function(C,Q){var E=A.apply(I,B);function D(A){g(E,C,Q,D,i,"next",A)}function i(A){g(E,C,Q,D,i,"throw",A)}D(void 0)}))}},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(8)();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 C(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */A.exports=C=function(){return g},A.exports.__esModule=!0,A.exports.default=A.exports;var I,g={},Q=Object.prototype,E=Q.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",F=i.toStringTag||"@@toStringTag";function G(A,I,g){return Object.defineProperty(A,I,{value:g,enumerable:!0,configurable:!0,writable:!0}),A[I]}try{G({},"")}catch(I){G=function(A,I,g){return A[I]=g}}function N(A,I,g,B){var C=I&&I.prototype instanceof s?I:s,Q=Object.create(C.prototype),E=new l(B||[]);return D(Q,"_invoke",{value:t(A,g,E)}),Q}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 h="suspendedStart",R="suspendedYield",M="executing",U="completed",c={};function s(){}function a(){}function Y(){}var S={};G(S,o,(function(){return this}));var k=Object.getPrototypeOf,K=k&&k(k(r([])));K&&K!==Q&&E.call(K,o)&&(S=K);var H=Y.prototype=s.prototype=Object.create(S);function L(A){["next","throw","return"].forEach((function(I){G(A,I,(function(A){return this._invoke(I,A)}))}))}function J(A,I){function g(C,Q,D,i){var o=y(A[C],A,Q);if("throw"!==o.type){var w=o.arg,F=w.value;return F&&"object"==B(F)&&E.call(F,"__await")?I.resolve(F.__await).then((function(A){g("next",A,D,i)}),(function(A){g("throw",A,D,i)})):I.resolve(F).then((function(A){w.value=A,D(w)}),(function(A){return g("throw",A,D,i)}))}i(o.arg)}var C;D(this,"_invoke",{value:function(A,B){function Q(){return new I((function(I,C){g(A,B,I,C)}))}return C=C?C.then(Q,Q):Q()}})}function t(A,g,B){var C=h;return function(Q,E){if(C===M)throw new Error("Generator is already running");if(C===U){if("throw"===Q)throw E;return{value:I,done:!0}}for(B.method=Q,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(C===h)throw C=U,B.arg;B.dispatchException(B.arg)}else"return"===B.method&&B.abrupt("return",B.arg);C=M;var o=y(A,g,B);if("normal"===o.type){if(C=B.done?U:R,o.arg===c)continue;return{value:o.arg,done:B.done}}"throw"===o.type&&(C=U,B.method="throw",B.arg=o.arg)}}}function d(A,g){var B=g.method,C=A.iterator[B];if(C===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 Q=y(C,A.iterator,g.arg);if("throw"===Q.type)return g.method="throw",g.arg=Q.arg,g.delegate=null,c;var E=Q.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 e(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 n(A){var I=A.completion||{};I.type="normal",delete I.arg,A.completion=I}function l(A){this.tryEntries=[{tryLoc:"root"}],A.forEach(e,this),this.reset(!0)}function r(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 C=-1,Q=function g(){for(;++C<A.length;)if(E.call(A,C))return g.value=A[C],g.done=!1,g;return g.value=I,g.done=!0,g};return Q.next=Q}}throw new TypeError(B(A)+" is not iterable")}return a.prototype=Y,D(H,"constructor",{value:Y,configurable:!0}),D(Y,"constructor",{value:a,configurable:!0}),a.displayName=G(Y,F,"GeneratorFunction"),g.isGeneratorFunction=function(A){var I="function"==typeof A&&A.constructor;return!!I&&(I===a||"GeneratorFunction"===(I.displayName||I.name))},g.mark=function(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,Y):(A.__proto__=Y,G(A,F,"GeneratorFunction")),A.prototype=Object.create(H),A},g.awrap=function(A){return{__await:A}},L(J.prototype),G(J.prototype,w,(function(){return this})),g.AsyncIterator=J,g.async=function(A,I,B,C,Q){void 0===Q&&(Q=Promise);var E=new J(N(A,I,B,C),Q);return g.isGeneratorFunction(I)?E:E.next().then((function(A){return A.done?A.value:E.next()}))},L(H),G(H,F,"Generator"),G(H,o,(function(){return this})),G(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=r,l.prototype={constructor:l,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(n),!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,C){return D.type="throw",D.arg=A,g.next=B,C&&(g.method="next",g.arg=I),!!C}for(var C=this.tryEntries.length-1;C>=0;--C){var Q=this.tryEntries[C],D=Q.completion;if("root"===Q.tryLoc)return B("end");if(Q.tryLoc<=this.prev){var i=E.call(Q,"catchLoc"),o=E.call(Q,"finallyLoc");if(i&&o){if(this.prev<Q.catchLoc)return B(Q.catchLoc,!0);if(this.prev<Q.finallyLoc)return B(Q.finallyLoc)}else if(i){if(this.prev<Q.catchLoc)return B(Q.catchLoc,!0)}else{if(!o)throw new Error("try statement without catch or finally");if(this.prev<Q.finallyLoc)return B(Q.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 C=B;break}}C&&("break"===A||"continue"===A)&&C.tryLoc<=I&&I<=C.finallyLoc&&(C=null);var Q=C?C.completion:{};return Q.type=A,Q.arg=I,C?(this.method="next",this.next=C.finallyLoc,c):this.complete(Q)},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),n(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 C=B.arg;n(g)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(A,g,B){return this.delegate={iterator:r(A),resultName:g,nextLoc:B},"next"===this.method&&(this.arg=I),c}},g}A.exports=C,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(6),C=g.n(B),Q=g(5),E=g.n(Q),D=g(1),i=g.n(D),o=g(7),w=g.n(o),F=(g(10),g(11)),G=document.webL10n,N=function(){function A(I){E()(this,A),this._lang=I,this._ready=new Promise((function(A,g){G.setLanguage(Object(F.fixupLangCode)(I),(function(){A(G)}))}))}var I,g,B,Q,D;return i()(A,[{key:"setLanguage",value:(D=C()(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){G.setLanguage(Object(F.fixupLangCode)(I),(function(){A(G)}))}));case 2:case"end":return A.stop()}}),A,this)}))),function(A){return D.apply(this,arguments)})},{key:"getLanguage",value:(Q=C()(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 Q.apply(this,arguments)})},{key:"getDirection",value:(B=C()(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=C()(w.a.mark((function A(I){var g,B,C,Q=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return g=Q.length>1&&void 0!==Q[1]?Q[1]:null,B=Q.length>2&&void 0!==Q[2]?Q[2]:Object(F.getL10nFallback)(I,g),A.next=4,this._ready;case 4:return C=A.sent,A.abrupt("return",C.get(I,g,B));case 6:case"end":return A.stop()}}),A,this)}))),function(A){return g.apply(this,arguments)})},{key:"translate",value:(I=C()(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,g){"use strict";document.webL10n=function(A,I,g){var B={},C="",Q="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 F(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){C+=A,function(A,g){var B={},C=/^\s*|\s*$/,Q=/^\s*#|^\s*$/,E=/^\s*\[(.*)\]\s*$/,o=/^\s*@import\s+url\((.*)\)\s*$/i,F=/^([^=\s]*)\s*=\s*(.+)$/;function G(A,g,w){var G=A.replace(C,"").split(/[\r\n]+/),y="*",h=I.split("-",1)[0],R=!1,M="";!function A(){for(;;){if(!G.length)return void w();var C=G.shift();if(!Q.test(C)){if(g){if(M=E.exec(C)){y=M[1].toLowerCase(),R="*"!==y&&y!==I&&y!==h;continue}if(R)continue;if(M=o.exec(C))return void N(D+M[1],A)}var U=C.match(F);U&&3==U.length&&(B[U[1]]=i(U[2]))}}}()}function N(A,I){w(A,(function(A){G(A,!1,I)}),(function(){I()}))}G(A,!0,(function(){g(B)}))}(A,(function(A){for(var I in A){var C,E,D=I.lastIndexOf(".");D>0?(C=I.substring(0,D),E=I.substring(D+1)):(C=I,E=Q),B[C]||(B[C]={}),B[C][E]=A[I]}g&&g()}))}),E)}function G(A,g){A&&(A=A.toLowerCase()),g=g||function(){},B={},C="",E="",E=A;var Q=I.querySelectorAll('link[type="application/l10n"]'),D=Q.length;if(0!==D){var o,w,G=0;w=function(){++G>=D&&(g(),i="complete")};for(var N=0;N<D;N++){new M(Q[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 h=y.default_locale.toLowerCase();for(var R in y.locales){if((R=R.toLowerCase())===A){B=y.locales[A];break}R===h&&(B=y.locales[h])}}g()}i="complete"}function M(A){var I=A.href;this.load=function(A,g){F(I,A,g,(function(){E="",g()}))}}}function N(A,I,g){var C=B[A];if(!C){if(!g)return null;C=g}var Q={};for(var E in C){var D=C[E];D=h(D=y(D,I,A,E),I,A),Q[E]=D}return Q}function y(A,I,g,C){var Q=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/.exec(A);if(!Q||!Q.length)return A;var E,i=Q[1],o=Q[2];(I&&o in I?E=I[o]:o in B&&(E=B[o]),i in D)&&(A=(0,D[i])(A,E,g,C));return A}function h(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 R(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[Q]){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[Q]=B[Q];else{for(var C=A.childNodes,E=!1,D=0,i=C.length;D<i;D++)3===C[D].nodeType&&/\S/.test(C[D].nodeValue)&&(E?C[D].nodeValue="":(C[D].nodeValue=B[Q],E=!0));if(!E){var o=I.createTextNode(B[Q]);A.insertBefore(o,A.firstChild)}}delete B[Q]}for(var w in B)A[w]=B[w]}}}return D.plural=function(A,I,g,C){var i=parseFloat(I);if(isNaN(i))return A;if(C!=Q)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"}},C={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 C in B?B[C]:function(){return"other"}}(E));var o="["+D._pluralRules(i)+"]";return 0===i&&g+"[zero]"in B?A=B[g+"[zero]"][C]:1==i&&g+"[one]"in B?A=B[g+"[one]"][C]:2==i&&g+"[two]"in B?A=B[g+"[two]"][C]:g+o in B?A=B[g+o][C]:g+"[other]"in B&&(A=B[g+"[other]"][C]),A},{get:function(A,I,g){var B,C=A.lastIndexOf("."),E=Q;C>0&&(E=A.substring(C+1),A=A.substring(0,C)),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 C},getLanguage:function(){return E},setLanguage:function(A,I){G(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,C=0;C<B;C++)R(g[C]);R(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 G}));var B=g(6),C=g.n(B),Q=g(7),E=g.n(Q),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 F(A,I){return I?A.replace(/\{\{\s*(\w+)\s*\}\}/g,(function(A,g){return g in I?I[g]:"{{"+g+"}}"})):A}var G={getLanguage:function(){return C()(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 C()(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 C()(E.a.mark((function g(){var B,C;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,C=I.length>2&&void 0!==I[2]?I[2]:i(A,B),g.abrupt("return",F(C,B));case 3:case"end":return g.stop()}}),g)})))()},translate:function(A){return C()(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 a})),g.d(I,"EventBus",(function(){return s})),g.d(I,"waitOnEventOrTimeout",(function(){return c})),g.d(I,"WaitOnType",(function(){return U}));var B=g(13),C=g.n(B),Q=g(16),E=g.n(Q),D=g(18),i=g.n(D),o=g(15),w=g.n(o),F=g(5),G=g.n(F),N=g(1),y=g.n(N);function h(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 C=w()(this).constructor;g=Reflect.construct(B,arguments,C)}else g=B.apply(this,arguments);return i()(this,g)}}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 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,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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}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,C=void 0===B?0:B;return new Promise((function(A,B){if("object"!=typeof I||!g||"string"!=typeof g||!(Number.isInteger(C)&&C>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function Q(B){I instanceof s?I._off(g,E):I.removeEventListener(g,E),i&&clearTimeout(i),A(B)}var E=Q.bind(null,U.EVENT);I instanceof s?I._on(g,E):I.addEventListener(g,E);var D=Q.bind(null,U.TIMEOUT),i=setTimeout(D,C)}))}var s=function(){function A(){G()(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,C,Q=R(g.slice(0));try{for(Q.s();!(C=Q.n()).done;){var E=C.value,D=E.listener,i=E.external;E.once&&this._off(A,D),i?(B||(B=[]),B.push(D)):D(I)}}catch(A){Q.e(A)}finally{Q.f()}if(B){var o,w=R(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,C=g.length;B<C;B++)if(g[B].listener===I)return void g.splice(B,1)}}]),A}(),a=function(A){E()(g,A);var I=h(g);function g(){return G()(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");C()(w()(g.prototype),"dispatch",this).call(this,A,I);var B=Object.create(null);if(I)for(var Q in I){var E=I[Q];if("source"!==Q)B[Q]=E;else if(E===window||E===document)return}var D=document.createEvent("CustomEvent");D.initCustomEvent(A,!0,!0,B),document.dispatchEvent(D)}}]),g}(s)},function(A,I,g){var B=g(14);function C(){return"undefined"!=typeof Reflect&&Reflect.get?(A.exports=C=Reflect.get.bind(),A.exports.__esModule=!0,A.exports.default=A.exports):(A.exports=C=function(A,I,g){var C=B(A,I);if(C){var Q=Object.getOwnPropertyDescriptor(C,I);return Q.get?Q.get.call(arguments.length<3?A:g):Q.value}},A.exports.__esModule=!0,A.exports.default=A.exports),C.apply(this,arguments)}A.exports=C,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,C=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 C(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 a}));var B=g(6),C=g.n(B),Q=g(5),E=g.n(Q),D=g(1),i=g.n(D),o=g(21),w=g.n(o),F=g(7),G=g.n(F),N=g(22),y=g(29),h=g(30),R=g(87),M=g(36),U=g(88);function c(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 s(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 s(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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}function s(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 a=function(){function A(I,g,B,C,Q){E()(this,A),w()(this,"scrollModePageState",null),this.jumpPageEvt=null,this.coreHelper=new M.Ofd_Core_Helper,this.ofdRender=new h.Ofd_Render(null,new M.Ofd_Core_Helper),C&&this.ofdRender.setMixBlendMode(C),this.defaultScale=Q||N.DEFAULT_SCALE_VALUE,this.ofdCanvasRender=new R.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=C()(G.a.mark((function A(I){var g,B,C,Q,E,D,i,o;return G.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this._scrollMode!==N.ScrollMode.PAGE?(B=I||this._getVisiblePages(),C=this.getScrollAhead(B),this._spreadMode!==N.SpreadMode.NONE&&(this._scrollMode,N.ScrollMode.HORIZONTAL),g=Object(y.getHighestPriority)(B,this._pages,C)):g=I,!g||g.renderingState!==N.RenderingStates.INITIAL){A.next=18;break}return this.emptyNode(g.div.firstChild),A.next=5,this.ofdRender.renderPage(g.div.firstChild,0,g.id-1);case 5:this.highLightEle(),Q=this,E=G.a.mark((function A(){var I;return G.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:(I=document.getElementsByName("seal_img_div_".concat(g.id-1))[D]).id="sign-".concat(I.dataset.signatureId),I.addEventListener("click",(function(){Q.eventBus.dispatch("signatureclick",{source:Q,pageRef:I.dataset.pageRef,signatureId:I.dataset.signatureId})}));case 3:case"end":return A.stop()}}),A)})),D=0;case 9:if(!(D<document.getElementsByName("seal_img_div_".concat(g.id-1)).length)){A.next=14;break}return A.delegateYield(E(),"t0",11);case 11:D++,A.next=9;break;case 14:for(g.renderingState=N.RenderingStates.FINISHED,this.renderHighestPriority(),i=0;i<g.id-10;i++)(o=this._pages[i]).renderingState===N.RenderingStates.FINISHED&&(this.emptyNode(o.div.firstChild),o.renderingState=N.RenderingStates.INITIAL);return A.abrupt("return",!0);case 18:return A.abrupt("return",!1);case 19:case"end":return A.stop()}}),A,this)}))),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,C=!1,Q=c(I);try{for(Q.s();!(g=Q.n()).done;){var E=g.value;if(E.percent<100)break;if(E.id===B){C=!0;break}}}catch(A){Q.e(A)}finally{Q.f()}C||(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),C=this.coreHelper.pageRenderHeight(0,I,this.core),Q=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=C+"px",0,this._pages[I].width=B,this._pages[I].height=C,Q.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform:rotate(",0,"deg) translate(").concat((B-D)/2,"px, ").concat((C-i)/2,"px) scale(").concat(this._currentScale,")"));break;case 90:g.style.width=C+"px",g.style.height=B+"px",(B-C)/2,this._pages[I].width=C,this._pages[I].height=B,Q.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform: translate(").concat((C-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=C+"px",0,this._pages[I].width=B,this._pages[I].height=C,Q.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform:rotate(",180,"deg) translate(").concat(-(B-D)/2,"px, ").concat(-(C-i)/2,"px) scale(").concat(this._currentScale,")"));break;case 270:g.style.width=C+"px",g.style.height=B+"px",-(B-C)/2,this._pages[I].width=C,this._pages[I].height=B,Q.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform: translate(").concat((C-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,pageWidthMM:this.core.pageWidth(0,I),pageHeightMM:this.core.pageHeight(0,I)};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 F=this.viewer.scrollWidth;this.container.scrollTo({left:this.lastViewerContainerScrollLeft/this.lastViewerWidth*F})}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 C=this.coreHelper.pageRenderWidth(0,g,this.core),Q=this.coreHelper.pageRenderHeight(0,g,this.core);B.style.width=C+"px",B.style.height=Q+"px",B.style.overflow="hidden",B.style.position="relative";var E=document.createElement("div");B.style.width=C+"px",B.style.height=Q+"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((C-i)/2,"px, ").concat((Q-o)/2,"px) scale(").concat(this._currentScale,")"),B.appendChild(E),A.appendChild(B),0===g&&E.appendChild(this.initLoadingImg());var w={width:C,height:Q,scale:this._currentScale,pageWidthMM:this.core.pageWidth(0,g),pageHeightMM:this.core.pageHeight(0,g)};this._pages.push({div:B,viewport:w,id:g+1,renderingState:N.RenderingStates.INITIAL,scale:this._currentScale,width:C,height:Q})}}},{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 C=N.SCROLLBAR_PADDING,Q=N.VERTICAL_PADDING,E=(this.container.clientWidth-C)/B.width*B.scale/1,D=(this.container.clientHeight-Q)/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 C=new Set,Q=this._spreadMode-1;A%2!==Q?(C.add(A-1),C.add(A)):(C.add(A-2),C.add(A-1));var E,D=null,i=c(C);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===Q&&(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 C=this._spreadMode-1,Q=null,E=0,D=I.length;E<D;++E)null===Q?((Q=document.createElement("div")).className="spread",this.viewer.appendChild(Q)):E%2===C&&(Q=Q.cloneNode(!1),this.viewer.appendChild(Q)),Q.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;if(this._scrollMode===N.ScrollMode.PAGE)this._setCurrentPageNumber(A+1),this.ensurePageViewVisible();else{this._spreadMode===N.SpreadMode.ODD&&(A=Math.ceil(A/2)),this._spreadMode===N.SpreadMode.EVEN&&(A=Math.floor(A/2),A++);var I=this.viewer.children.item(A);null==I||I.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._spreadMode===N.SpreadMode.ODD&&(A=Math.ceil(A/2),A-=2),this._spreadMode===N.SpreadMode.EVEN&&(A=Math.floor(A/2),A-=1),this.viewer.children.item(A).scrollIntoView(!0));return!0}},{key:"jumpPage",value:function(A){if(this.jumpPageEvt=A,this._scrollMode===N.ScrollMode.PAGE)A.pageIndex&&this._setCurrentPageNumber(A.pageIndex),this.ensurePageViewVisible();else{var I=this.viewer.children.item(A.pageIndex-1);if(I.scrollIntoView(!0),this.highLightEle(),A.sign){var g=document.getElementById("sign-".concat(A.sign));null==g||g.scrollIntoView(!0);var B=g.style.left,C=g.style.top;g instanceof SVGElement||(B=g.parentElement.style.left,C=g.parentElement.style.top);var Q=document.createElement("div");Q.className="highLight",Q.setAttribute("style","position:absolute;left:".concat(B,";top:").concat(C,";width:").concat(g.style.width,";height:").concat(g.style.height)),I.firstElementChild.appendChild(Q)}}}},{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,B=(this.container.clientWidth,new M.Ofd_Core_Helper(96)),C=(this.container.clientWidth-I)/B.pageRenderWidth(0,0,this.core)*1/1,Q=(this.container.clientHeight-g)/B.pageRenderHeight(0,0,this.core)*1/1,E=C;if(this.defaultScale!==N.DEFAULT_SCALE_VALUE)switch(E=this.defaultScale){case"page-actual":E=1;break;case"page-width":E=C;break;case"page-height":E=Q;break;case"page-fit":E=Math.min(C,Q)}this._currentScale=E,this.coreHelper.setDpi(96*E),this.initDiv(0),this.updateView(),this.viewer.classList.toggle("scrollHorizontal",this._scrollMode===N.ScrollMode.HORIZONTAL),this.eventBus.dispatch("scalechanging",{source:this,scale:E,presetValue:this.defaultScale}),this.eventBus.dispatch("viewportchanging",{source:this}),this.scrollModePageState={previousPageNumber:1,scrollDown:!0,pages:[]},this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:U.AnnotationEditorType.NONE})}}]),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,"clamp",(function(){return z})),g.d(I,"animationStarted",(function(){return u})),g.d(I,"apiPageLayoutToViewerModes",(function(){return _})),g.d(I,"apiPageModeToSidebarView",(function(){return $})),g.d(I,"approximateFraction",(function(){return q})),g.d(I,"AutoPrintRegExp",(function(){return L})),g.d(I,"backtrackBeforeAllVisibleElements",(function(){return x})),g.d(I,"binarySearchFirstItem",(function(){return Z})),g.d(I,"DEFAULT_SCALE",(function(){return G})),g.d(I,"DEFAULT_SCALE_DELTA",(function(){return N})),g.d(I,"DEFAULT_SCALE_VALUE",(function(){return F})),g.d(I,"getActiveOrFocusedElement",(function(){return v})),g.d(I,"getPageSizeInches",(function(){return W})),g.d(I,"getVisibleElements",(function(){return p})),g.d(I,"isPortraitOrientation",(function(){return O})),g.d(I,"isValidRotation",(function(){return T})),g.d(I,"isValidScrollMode",(function(){return j})),g.d(I,"isValidSpreadMode",(function(){return X})),g.d(I,"MAX_AUTO_SCALE",(function(){return M})),g.d(I,"MAX_SCALE",(function(){return h})),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 V})),g.d(I,"OutputScale",(function(){return J})),g.d(I,"parseQueryString",(function(){return e})),g.d(I,"PresentationModeState",(function(){return a})),g.d(I,"ProgressBar",(function(){return P})),g.d(I,"removeNullCharacters",(function(){return r})),g.d(I,"RendererType",(function(){return S})),g.d(I,"RenderingStates",(function(){return s})),g.d(I,"roundToDivide",(function(){return f})),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 Y})),g.d(I,"SpreadMode",(function(){return H})),g.d(I,"TextLayerMode",(function(){return k})),g.d(I,"UNKNOWN_SCALE",(function(){return R})),g.d(I,"VERTICAL_PADDING",(function(){return c})),g.d(I,"watchScroll",(function(){return d})),g.d(I,"signTimeFormat",(function(){return IA})),g.d(I,"toggleExpandedBtn",(function(){return AA}));var B=g(23),C=g.n(B),Q=g(5),E=g.n(Q),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,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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}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 F="auto",G=1,N=1.1,y=.1,h=10,R=0,M=1.25,U=40,c=5,s={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},a={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},Y={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4,SIGNATURES:5},S={CANVAS:"canvas",SVG:"svg"},k={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},L=/\bprint\s*\(/,J=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 C=A.offsetTop+A.clientTop,Q=A.offsetLeft+A.clientLeft;B.clientHeight===B.scrollHeight&&B.clientWidth===B.scrollWidth||g&&(B.classList.contains("markedContent")||"hidden"===getComputedStyle(B).overflow);)if(C+=B.offsetTop,Q+=B.offsetLeft,!(B=B.offsetParent))return;I&&(void 0!==I.top&&(C+=I.top),void 0!==I.left&&(Q+=I.left,B.scrollLeft=Q)),B.scrollTop=C}}function d(A,I){var g=function(g){C||(C=window.requestAnimationFrame((function(){C=null;var g=A.scrollLeft,Q=B.lastX;g!==Q&&(B.right=g>Q),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},C=null;return A.addEventListener("scroll",g,!0),B}function e(A){var I,g=new Map,B=o(new URLSearchParams(A));try{for(B.s();!(I=B.n()).done;){var Q=C()(I.value,2),E=Q[0],D=Q[1];g.set(E.toLowerCase(),D)}}catch(A){B.e(A)}finally{B.f()}return g}var n=/\x00/g,l=/[\x01-\x1F]/g;function r(A){return"string"!=typeof A?A:(arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(A=A.replace(l," ")),A.replace(n,""))}function Z(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 C=g+B>>1;I(A[C])?B=C:g=C+1}return g}function q(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,C=1,Q=1,E=1;;){var D=B+Q,i=C+E;if(i>8)break;g<=D/i?(Q=D,E=i):(B=D,C=i)}return g-B/C<Q/E-g?g===A?[B,C]:[C,B]:g===A?[Q,E]:[E,Q]}function f(A,I){var g=A%I;return 0===g?A:Math.round(A-g+I)}function W(A){var I=A.view,g=A.userUnit,B=A.rotate,Q=C()(I,4),E=Q[0],D=Q[1],i=B%180!=0,o=(Q[2]-E)/72*g,w=(Q[3]-D)/72*g;return{width:i?w:o,height:i?o:w}}function x(A,I,g){if(A<2)return A;var B=I[A].div,C=B.offsetTop+B.clientTop;C>=g&&(C=(B=I[A-1].div).offsetTop+B.clientTop);for(var Q=A-2;Q>=0&&!((B=I[Q].div).offsetTop+B.clientTop+B.clientHeight<=C);--Q)A=Q;return A}function p(A){var I=A.scrollEl,g=A.views,B=A.sortByVisibility,C=void 0!==B&&B,Q=A.horizontal,E=void 0!==Q&&Q,D=A.rtl,i=void 0!==D&&D,o=I.scrollTop,w=o+I.clientHeight,F=I.scrollLeft,G=F+I.clientWidth;var N=[],y=new Set,h=g.length,R=Z(g,E?function(A){var I=A.div,g=I.offsetLeft+I.clientLeft,B=g+I.clientWidth;return i?g<G:B>F}:function(A){var I=A.div;return I.offsetTop+I.clientTop+I.clientHeight>o});R>0&&R<h&&!E&&(R=x(R,g,o));for(var M=E?G:-1,U=R;U<h;U++){var c=g[U],s=c.div,a=s.offsetLeft+s.clientLeft,Y=s.offsetTop+s.clientTop,S=s.clientWidth,k=s.clientHeight,K=a+S,H=Y+k;if(-1===M)H>=w&&(M=H);else if((E?a:Y)>M)break;if(!(H<=o||Y>=w||K<=F||a>=G)){var L=Math.max(0,o-Y)+Math.max(0,H-w),J=(S-(Math.max(0,F-a)+Math.max(0,K-G)))/S,t=(k-L)/k*J*100|0;N.push({id:c.id,x:a,y:Y,view:c,percent:t,widthPercent:100*J|0}),y.add(c.id)}}var d=N[0],e=N[N.length-1];return C&&N.sort((function(A,I){var g=A.percent-I.percent;return Math.abs(g)>.001?-g:A.id-I.id})),{first:d,last:e,views:N,ids:y}}function b(A){A.preventDefault()}function V(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=V(A);return 0===A.deltaMode?I/=900:1===A.deltaMode&&(I/=30),I}function T(A){return Number.isInteger(A)&&A%90==0}function j(A){return Number.isInteger(A)&&Object.values(K).includes(A)&&A!==K.UNKNOWN}function X(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)}));function z(A,I,g){return Math.min(Math.max(A,I),g)}var P=function(){function A(I){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},B=g.height,C=g.width,Q=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=C||100,this.units=Q||"%",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){this._indeterminate=isNaN(A),this._percent=z(A,0,100),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 v(){for(var A=document,I=A.activeElement||A.querySelector(":focus");I&&I.shadowRoot;)I=(A=I.shadowRoot).activeElement||A.querySelector(":focus");return I}function _(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 Y.NONE;case"UseThumbs":return Y.THUMBS;case"UseOutlines":return Y.OUTLINE;case"UseAttachments":return Y.ATTACHMENTS;case"UseOC":return Y.LAYERS}return Y.NONE}function AA(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;A.classList.toggle("toggled",I),A.setAttribute("aria-expanded",I),null==g||g.classList.toggle("hidden",!I)}function IA(A){if(A.indexOf("D:")>=0){var I=A.match(/D:(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\+(\d{2})'(\d{2})'/);if(I){var g=C()(I,9),B=(g[0],g[1]),Q=g[2],E=g[3],D=g[4],i=g[5],o=g[6];g[7],g[8];return"".concat(B,"-").concat(Q,"-").concat(E," ").concat(D,":").concat(i,":").concat(o," ")}}else if(A.indexOf("Z")>=0){var w=A.match(/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/);if(w){var F=C()(w,7),G=(F[0],F[1]),N=F[2],y=F[3],h=F[4],R=F[5],M=F[6];return"".concat(G,"-").concat(N,"-").concat(y," ").concat(h,":").concat(R,":").concat(M," ")}}return A}},function(A,I,g){var B=g(24),C=g(25),Q=g(26),E=g(28);A.exports=function(A,I){return B(A)||C(A,I)||Q(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,C,Q,E,D=[],i=!0,o=!1;try{if(Q=(g=g.call(A)).next,0===I){if(Object(g)!==g)return;i=!1}else for(;!(i=(B=Q.call(g)).done)&&(D.push(B.value),D.length!==I);i=!0);}catch(A){o=!0,C=A}finally{try{if(!i&&null!=g.return&&(E=g.return(),Object(E)!==E))return}finally{if(o)throw C}}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 C}));var B=g(22);function C(A,I,g){var B=arguments.length>3&&void 0!==arguments[3]&&arguments[3],C=A.views,E=C.length;if(0===E)return null;for(var D=0;D<E;D++){var i=C[D].view;if(!Q(i))return i}var o=A.first.id,w=A.last.id;if(w-o+1>E)for(var F=A.ids,G=1,N=w-o;G<N;G++){var y=g?o+G:w-G;if(!F.has(y)){var h=I[y-1];if(!Q(h))return h}}var R=g?w:o-2,M=I[R];return M&&!Q(M)||B&&(M=I[R+=g?1:-1])&&!Q(M)?M:null}function Q(A){return A.renderingState===B.RenderingStates.FINISHED}},function(A,I,g){"use strict";g.r(I),g.d(I,"Ofd_Render",(function(){return U}));var B=g(6),C=g.n(B),Q=g(5),E=g.n(Q),D=g(1),i=g.n(D),o=g(7),w=g.n(o),F=g(31),G=g(32),N=g(35),y=(g(36),g(37)),h=g.n(y);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 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,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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}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=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,C,Q){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),G=E.Signatures?E.Signatures.Signature:[],y=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,s=R(i);try{for(s.s();!(c=s.n()).done;){var a,Y=c.value,S=R(w);try{for(S.s();!(a=S.n()).done;){var k=a.value;if(k.ID==Y.TemplateID){if((k=B?B.readPageFromTemplate(k):this.core.readPageFromTemplate(k)).Page.Content){var K,H=R(k.Page.Content.Layer);try{for(H.s();!(K=H.n()).done;){var L=K.value;this.renderLayer(Q,C,g,A,y,h,U,M,L,!1)}}catch(A){H.e(A)}finally{H.f()}}break}}}catch(A){S.e(A)}finally{S.f()}}}catch(A){s.e(A)}finally{s.f()}}if(D.Page.Content){var J,t=R(D.Page.Content.Layer);try{for(t.s();!(J=t.n()).done;){var d=J.value;this.renderLayer(Q,C,g,A,y,h,U,M,d,!1)}}catch(A){t.e(A)}finally{t.f()}}var e,n=R(o);try{for(n.s();!(e=n.n()).done;){var l=e.value;if(D.ID==l.PageID){var r,Z=R(l.PageAnnot.Annot);try{for(Z.s();!(r=Z.n()).done;){var q=r.value;this.renderAnnotation(Q,C,A,q,y,h,U,M,g)}}catch(A){Z.e(A)}finally{Z.f()}}}}catch(A){n.e(A)}finally{n.f()}var f,W=R(G);try{for(W.s();!(f=W.n()).done;){var x,p=f.value,b=R(p.Signature.SignedInfo.StampAnnot);try{for(b.s();!(x=b.n()).done;){var V=x.value,m=V.PageRef;if(D.ID==m){var T=V.Boundary;if(p.Signature.PicType&&p.Signature.PicType.length>0)if("ofd"===p.Signature.PicType)for(var j=new N.Ofd_Core(p.Signature.ofd),X=0;X<j.getOFDPageCount(0);X++)this.renderSealPage(A,X,j,!0,T,m,V.ID,g,p.Signature.ZipName);else if("svg"===p.Signature.PicType){var O=Object(F.converterBox)(T,this.coreHelper.dpi),u=document.createElement("div");u.innerHTML=p.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",V.ID),_.setAttribute("data-page-ref",m),_.appendChild(u),A.appendChild(_)}else{var $=Object(F.converterBox)(T,this.coreHelper.dpi),AA="data:image/".concat(p.Signature.PicType,";base64,").concat(p.Signature.PicValue),IA=this.renderImageOnDiv(g,A.style.width,A.style.height,AA,$.w,$.h,$,V.Clip,!0,m,V.ID);IA.svg.setAttribute("style","".concat(IA.style,"left:").concat(IA.left,"px;top:").concat(IA.top,"px;mix-blend-mode:").concat(this.mixBlendMode)),p.Signature.PicType||IA.svg.removeChild(IA.svg.children[0]),A.appendChild(IA.svg)}else{var gA=Object(F.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",V.ID),BA.setAttribute("data-page-ref",m),A.appendChild(BA)}}}}catch(A){b.e(A)}finally{b.f()}}}catch(A){W.e(A)}finally{W.f()}}},{key:"throwWhite",value:(I=C()(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,C=document.createElement("canvas");C.style.width="".concat(I,"px"),C.style.height="".concat(g,"px"),C.width=I,C.height=g;var Q=C.getContext("2d");Q.drawImage(B,0,0,I,g);for(var E=Q.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);Q.putImageData(E,0,0),A(C.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,C,Q,E,D,i){var o=document.createElement("div");o.setAttribute("style","overflow: hidden;;position:relative;");var w=B.Appearance.Boundary;if(w){var G=Object(F.converterBox)(w,this.coreHelper.dpi);o.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";overflow: visible;position:absolute; left: ").concat(G.x,"px; top: ").concat(G.y,"px; width: ").concat(G.w,"px; height: ").concat(G.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,C,Q,E,D,N,!1),g.appendChild(o)}},{key:"renderSealPage",value:function(A,I,g,B,C,Q,E,D,i){var o,w;o=C;var G=g.pageWidth(0,I),N=g.pageHeight(0,I);G!==o.w&&(w="transform-origin: 0px 0px; transform: scale(".concat(o.h/N<o.w/G?o.h/N:o.w/G,")"));var y=Object(F.converterBox)(o,this.coreHelper.dpi),h=document.createElement("div");h.setAttribute("name","seal_img_div_".concat(D)),h.setAttribute("style","".concat(w,";cursor: pointer; position:absolute; left: ",0,"px; top: ",0,"px; width: ").concat(y.w,"px; height: ").concat(y.h,"px;")),h.setAttribute("data-signature-id",E),h.setAttribute("data-page-ref",Q),this.renderPage(h,0,I,g,E,i);var R=document.createElement("div");R.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")),R.appendChild(h),A.appendChild(R)}},{key:"renderLayer",value:function(A,I,g,B,C,Q,E,D,i,o,w,G,N){var y=null,h=null,M=Object(F.converterDpi)(.353,this.coreHelper.dpi),U=i.DrawParam;if(U&&Object(F.getDrawParam)(Q,U)){var c=Object(F.getDrawParam)(Q,U);if(Object(F.getDrawParam)(Q,c.Relative)){var s=Object(F.getDrawParam)(Q,c.Relative);s&&(s.StrokeColor&&(c.StrokeColor=s.StrokeColor),s.FillColor&&(c.FillColor=s.FillColor),s.LineWidth&&(c.LineWidth=s.LineWidth))}c.FillColor&&(y=Object(F.parseColor)(c.FillColor.Value)),c.StrokeColor&&(h=Object(F.parseColor)(c.StrokeColor.Value)),c.LineWidth&&(M=Object(F.converterDpi)(c.LineWidth,this.coreHelper.dpi))}var a=i.PageBlock;if(a){var Y,S=R(a);try{for(S.s();!(Y=S.n()).done;){var k=Y.value;if("ImageObject"==k.Type){var K=this.renderImageObject(A,I,g,B.style.width,B.style.height,E,k,o,G,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"==k.Type){var H=this.renderPathObject(A,I,g,Q,k,y,h,M,o,w,G,N,E,C);if(H.style){if((H.left<0||H.top<0)&&this.coreHelper.isPrinting)continue;N?H.svg.setAttribute("style","".concat(H.style,"left:").concat(H.left*N.a,"px;top:").concat(H.top*N.d,"px;")):H.svg.setAttribute("style","".concat(H.style,"left:").concat(H.left,"px;top:").concat(H.top,"px;")),B.appendChild(H.svg)}}else if("TextObject"==k.Type){if(i.ctm){var L=i.ctm.split(" ");k.CTM={a:L[0],b:L[1],c:L[2],d:L[3],e:L[4],f:L[5]}}var J=this.renderTextObject(B,C,k,y,h,Q,w,G,N);J&&B.appendChild(J)}else if("CompositeObject"==k.Type){var t,d=R(D);try{for(d.s();!(t=d.n()).done;){var e=t.value;if(e.ID===k.ResourceID){var n=k.Alpha,l=k.Boundary,r=k.CTM;this.renderLayer(A,I,g,B,C,Q,E,D,e,!1,n,l,r);break}}}catch(A){d.e(A)}finally{d.f()}}}}catch(A){S.e(A)}finally{S.f()}}}},{key:"renderImageObject",value:function(A,I,g,B,C,Q,E,D,i,o,w){var N=E.Boundary;N=Object(F.converterBox)(N,this.coreHelper.dpi);var y=E.ResourceID;if(!y)return null;var h=Object(F.getMultiMedia)(Q,y);if(!h.MediaFile)return null;var R,M=E.ImageMask;if(M>0&&(R=Object(F.getMultiMedia)(Q,M)).MediaFile&&!(R.width>0||R.height>0)&&R.MediaFile){var U=Object(G.JSGetImageInfoByPath)(this.core.ofdParserPtr,R.MediaFile,R.MediaFileResPln,this.core.getDocPln(0),A);U.ext,R.width=U.width,R.height=U.height,R.FileBase64=U.fileBase64}if(!(h.width>0||h.height>0)&&h.MediaFile){var c=Object(G.JSGetImageInfoByPath)(this.core.ofdParserPtr,h.MediaFile,h.MediaFileResPln,this.core.getDocPln(0),A);if("other"===c.ext)return null;h.width=c.width,h.height=c.height,h.FileBase64=c.fileBase64}var s=E.CTM,a=E.Clips,Y=E.BlendMode,S=E.Alpha;return this.renderImageOnDiv(g,B,C,h.FileBase64,h.width,h.height,N,!1,D,null,null,s,i,o,a,E.ID,Y,S,M>0&&R.FileBase64?R.FileBase64:null,w)}},{key:"renderImageOnDiv",value:function(A,I,g,B,C,Q,E,D,i,o,w,G,N,y,h,M,U,c,s,a){var Y=parseFloat(I.replace("px","")),S=parseFloat(g.replace("px","")),k=E.w>Y?Y:E.w,K=E.h>S?S:E.h,H=document.createElementNS("http://www.w3.org/2000/svg","svg"),L=document.createElementNS("http://www.w3.org/2000/svg","image"),J="";i&&(J="cursor: pointer;",H.setAttribute("viewbox","0 0 ".concat(k," ").concat(K)),H.setAttribute("name","seal_img_div_".concat(A)),H.setAttribute("data-signature-id",w),H.setAttribute("data-page-ref",o),L.setAttribute("preserveAspectRatio","none slice"));var t=C,d=Q;L.setAttribute("xlink:href",B),L.href.baseVal=B,L.setAttribute("width","".concat(t,"px")),L.setAttribute("height","".concat(d,"px")),c&&L.setAttribute("opacity","".concat(c/255));var e="";if(G){var n=1,l=1;if(a){var r=a.split(" ");n=r[0],l=r[3]}e="matrix(".concat(G.a/t/Object(F.ctmImageScale)(this.coreHelper.dpi)*n," ").concat(G.b/t/Object(F.ctmImageScale)(this.coreHelper.dpi)," ").concat(G.c/d/Object(F.ctmImageScale)(this.coreHelper.dpi)," ").concat(G.d/d/Object(F.ctmImageScale)(this.coreHelper.dpi)*l," ").concat(Object(F.converterDpi)(G.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(G.f,this.coreHelper.dpi),")")}y&&(e="".concat(e," matrix(").concat(y.a," ").concat(y.b," ").concat(y.c," ").concat(y.d," ").concat(Object(F.converterDpi)(y.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(y.f,this.coreHelper.dpi),")")),L.setAttribute("transform",e);var Z="";D&&(D=Object(F.converterBox)(D,this.coreHelper.dpi),Z="clip: rect(".concat(D.y,"px, ").concat(D.w+D.x,"px, ").concat(D.h+D.y,"px, ").concat(D.x,"px)"));var q=[];if(h&&h.length>0)for(var f=0;f<h.length;f++){var W=document.createElementNS("http://www.w3.org/2000/svg","clipPath");W.setAttribute("id","image-clip-path-".concat(M,"-").concat(f));for(var x=h[f].Clip,p=0;p<x.length;p++){var b=x[p].Area,V=0,m=0,T=0,j=0;b.Path.Boundary&&(V=b.Path.Boundary.x,m=b.Path.Boundary.y,T=b.Path.Boundary.w,j=b.Path.Boundary.h);var X=document.createElementNS("http://www.w3.org/2000/svg","path");if(b.CTM)G=b.CTM;else if(b.TransFlag)if(b.Path.CTM);else if(G&&0==G.b&&0==G.c){var O="matrix(".concat(G.a," ").concat(G.b," ").concat(G.c," ").concat(G.d," ").concat(Object(F.converterDpi)(G.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(G.f,this.coreHelper.dpi),")");X.setAttribute("transform",O)}var u,z="",P=R(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(F.converterDpi)(Object(F.adjustPosLimit)(v.crds[0],T)+V,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(v.crds[1],j)+m,this.coreHelper.dpi)," "):"L"===v.cmd?z+="L ".concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(v.crds[0],T)+V,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(v.crds[1],j)+m,this.coreHelper.dpi)," "):"B"===v.cmd?z+="C ".concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(v.crds[0],T)+V,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(v.crds[1],j)+m,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(v.crds[2]+V,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(v.crds[3]+m,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(v.crds[4]+V,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(v.crds[5]+m,this.coreHelper.dpi)," "):"Q"===v.cmd?z+="Q ".concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(v.crds[0],T)+V,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(v.crds[1],j)+m,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(v.crds[2]+V,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(v.crds[3]+m,this.coreHelper.dpi)," "):"A"===v.cmd?z+="A ".concat(Object(F.converterDpi)(v.crds[0],this.coreHelper.dpi),",").concat(Object(F.converterDpi)(v.crds[1],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(v.crds[2],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(v.crds[3],this.coreHelper.dpi),",").concat(Object(F.converterDpi)(v.crds[4],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(v.crds[5],this.coreHelper.dpi),",").concat(Object(F.converterDpi)(v.crds[6],this.coreHelper.dpi)):"C"===v.cmd&&(z+="Z")}}catch(A){P.e(A)}finally{P.f()}X.setAttribute("d",z),W.appendChild(X)}q.push(W)}if(s){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",s),$.href.baseVal=s,$.setAttribute("width","".concat(t,"px")),$.setAttribute("height","".concat(d,"px")),$.setAttribute("filter"," invert(100%)"),_.appendChild($),H.appendChild(_),L.setAttribute("mask","url(#mask-".concat(M,")"))}H.appendChild(L);var AA,IA=E.x,gA=E.y;if(y){var BA=y.a,CA=y.b,QA=y.c,EA=y.d,DA=BA>0?Math.sign(BA)*Math.sqrt(BA*BA+QA*QA):Math.sqrt(BA*BA+QA*QA),iA=EA>0?Math.sign(EA)*Math.sqrt(CA*CA+EA*EA):Math.sqrt(CA*CA+EA*EA);0==Math.atan2(-CA,EA)&&0!=BA&&1==EA||(gA*=iA,IA*=DA)}U&&("Add"==U&&(U="screen"),AA="mix-blend-mode: ".concat(U));var oA="".concat(J,"overflow: visible; position: absolute; width: ").concat(k,"px; height: ").concat(K,"px; ").concat(Z,";").concat(AA,";");if(q.length>0)if(1==q.length)H.appendChild(q[0]),H.setAttribute("clip-path","url(#image-clip-path-".concat(M,"-0)"));else{var wA,FA="",GA=R(q);try{for(GA.s();!(wA=GA.n()).done;){var NA=wA.value;void 0!==NA.children[0].getAttribute("d")&&(FA+="clip-path:path('".concat(NA.children[0].getAttribute("d"),"');"))}}catch(A){GA.e(A)}finally{GA.f()}oA="".concat(FA,";").concat(oA,";")}return{svg:H,style:oA,left:IA,top:gA}}},{key:"renderTextObject",value:function(A,I,g,B,C,Q,E,D,i){var o,w,N,y,M=1,U=g.Boundary;U=Object(F.converterBox)(U,this.coreHelper.dpi);var c=g.CTM,s=g.HScale,a=g.Font,Y=g.Weight,S=g.Alpha/255,k=g.Size>0;c&&!k&&(c={a:-c.a,b:c.b,c:c.c,d:-c.d,e:-c.e,f:-c.f});var K=Object(F.converterDpi)(Math.abs(parseFloat(g.Size)),this.coreHelper.dpi),H=Object(F.calTextPoint)(this.coreHelper.dpi,g.TextCode,g.CGTransform,c,g.Boundary,D,i,k,s),L=document.createElementNS("http://www.w3.org/2000/svg","svg");L.setAttribute("xmlns","http://www.w3.org/2000/svg"),L.setAttribute("version","1.1"),L.setAttribute("id",g.ID);var J,t,d,e=g.FillColor,n=!1,l=g.DrawParam;if(l){var r=Object(F.getDrawParam)(Q,l);r.FillColor&&(e&&e.Value||(e=r.FillColor))}if(e){e.Value&&(B=Object(F.parseColor)(e.Value)),M=e.alpha/255;var Z=e.axialShd;if(Z){n=!0;var q=document.createElementNS("http://www.w3.org/2000/svg","linearGradient");q.setAttribute("id","".concat(g.ID)),q.setAttribute("x1","0%"),q.setAttribute("y1","0%"),q.setAttribute("x2","100%"),q.setAttribute("y2","100%");var f,W=R(Z.Segment);try{for(W.s();!(f=W.n()).done;){var x=f.value;if(x){var p=document.createElement("stop");p.setAttribute("offset","".concat(100*x.position,"%")),p.setAttribute("style","stop-color:".concat(Object(F.parseColor)(x.color.Value),";stop-opacity:1")),q.appendChild(p),B=Object(F.parseColor)(x.color.Value)}}}catch(A){W.e(A)}finally{W.f()}L.appendChild(q)}}g.Stroke&&(J=Object(F.parseColor)(g.StrokeColor.Value),t=g.LineWidth,d=g.LineWidth),g.Fill||(M=0);var b=null===(o=U)||void 0===o?void 0:o.w,V=null===(w=U)||void 0===w?void 0:w.h,m=null===(N=U)||void 0===N?void 0:N.x,T=null===(y=U)||void 0===y?void 0:y.y,j=K,X=K,O=0;if(c){var u=c.a,z=c.b,P=c.c,v=c.d,_=u>0?Math.sign(u)*Math.sqrt(u*u+P*P):Math.sqrt(u*u+P*P),$=v>0?Math.sign(v)*Math.sqrt(z*z+v*v):Math.sqrt(z*z+v*v);0==(O=Math.atan2(-z,v))&&0!=u&&1==v||(j*=_,X*=$,d*=_),0==O&&0!=u&&1==v&&(j*=_,X*=$,d*=_),0==O&&s-0==1&&(s=u/v)>0&&(j*=s)}if(i){var AA=i.a,IA=i.b,gA=i.c,BA=i.d,CA=AA>0?Math.sign(AA)*Math.sqrt(AA*AA+gA*gA):Math.sqrt(AA*AA+gA*gA),QA=BA>0?Math.sign(BA)*Math.sqrt(IA*IA+BA*BA):Math.sqrt(IA*IA+BA*BA);0==(O=Math.atan2(-IA,BA))&&0!=AA&&1==BA||(j*=CA,X*=QA,T*=QA,m*=CA,b*=CA,V*=QA)}var EA=Object(F.getFont)(I,a),DA="",iA="",oA="",wA="";c&&(wA="matrix(".concat(c.a," ").concat(c.b," ").concat(c.c," ").concat(c.d," ").concat(Object(F.converterDpi)(c.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(c.f,this.coreHelper.dpi),")")),i&&(wA="".concat(wA," matrix(").concat(i.a," ").concat(i.b," ").concat(i.c," ").concat(i.d," ").concat(Object(F.converterDpi)(i.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(i.f,this.coreHelper.dpi),")")),s&&(wA="".concat(wA," scale(").concat(s,", 1)"),j*=s);for(var FA=!1,GA=0;GA<H.length;GA++){var NA=H[GA];if(NA&&!isNaN(NA.x)){if(NA.glyph&&EA&&EA.face){FA=!0;var yA=Object(G.loadFaceInfo)(EA.face),hA=Object(G.FT_Glyph_Get_Measure)(EA.face,NA.glyph);d=g.LineWidth;var RA=this.drawGlyph(hA.glyphPath,hA.horiUnderlinePosition,yA.units_per_EM,j,X,C||B,M,J,d,g.ID);if(0===O)RA.img.setAttribute("style","overflow: visible;position:absolute; left: ".concat(Math.ceil(NA.cx),"px; top: ").concat(NA.cy-RA.yScale*hA.horiUnderlinePosition-X,"px;width: ").concat(Math.ceil(j),"px; height:").concat(Math.ceil(X),"px")),Math.ceil(NA.cx)<parseFloat(A.style.width.replace("px",""))&&NA.cy-RA.yScale*hA.horiUnderlinePosition-X<parseFloat(A.style.height.replace("px",""))&&A.appendChild(RA.img);else{var MA=document.createElement("div");MA.setAttribute("style","transform-origin: center;transform: rotate(".concat(-O,"rad);position:absolute; left: ").concat(NA.cx,"px; top: ").concat(NA.cy-RA.yScale*hA.horiUnderlinePosition-X,"px;width: ").concat(Math.ceil(j),"px; height:").concat(Math.ceil(X),"px")),RA.img.setAttribute("style","position: absolute;left: 0px;top:0px;width: ".concat(Math.ceil(j),"px; height:").concat(Math.ceil(X),"px")),MA.appendChild(RA.img),A.appendChild(MA)}}if(DA=s?"".concat(DA).concat(NA.x+s*NA.x," "):"".concat(DA).concat(NA.x," "),iA="".concat(iA).concat(NA.y," "),oA=" "==NA.text?"".concat(oA," "):"".concat(oA).concat(NA.text),H.length>1&&s){var UA=document.createElementNS("http://www.w3.org/2000/svg","text");UA.setAttribute("x",NA.x),UA.setAttribute("y",NA.y),UA.innerHTML=NA.text,UA.setAttribute("transform",wA),n?UA.setAttribute("fill",B):(UA.setAttribute("fill",C),UA.setAttribute("fill",B),UA.setAttribute("fill-opacity",FA?0:M<S?M:S)),FA||(cA&&L.appendChild(cA),UA.setAttribute("clip-path","url(#clip-path-".concat(g.ID,"-0)"))),J&&t>0&&(UA.setAttribute("stroke",J),UA.setAttribute("stroke-width",Object(F.converterDpi)(t,this.coreHelper.dpi))),UA.setAttribute("style","font-weight: ".concat(Y,";font-size:").concat(K,"px;font-family: ").concat(Object(F.getFontFamily)(EA),";")),FA||L.appendChild(UA)}}}var cA=null,sA=g.Clips;if(sA&&sA.length>0){for(var aA=[],YA=0;YA<sA.length;YA++){(cA=document.createElementNS("http://www.w3.org/2000/svg","clipPath")).setAttribute("id","clip-path-".concat(g.ID,"-").concat(YA));for(var SA=sA[YA].Clip,kA=0;kA<SA.length;kA++){var KA=SA[kA].Area,HA=document.createElementNS("http://www.w3.org/2000/svg","path");if(KA.Path.CTM){var LA=KA.Path.CTM,JA="matrix(".concat(LA.a," ").concat(LA.b," ").concat(LA.c," ").concat(LA.d," ").concat(Object(F.converterDpi)(LA.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(LA.f,this.coreHelper.dpi),")");HA.setAttribute("transform",JA)}var tA="",dA=0,eA=0;KA.Path.Boundary&&(dA=KA.Path.Boundary.x,eA=KA.Path.Boundary.y),FA&&(eA=-eA);var nA,lA=R(KA.Path.AbbreviatedData);try{for(lA.s();!(nA=lA.n()).done;){var rA=nA.value;"M"===rA.cmd||"S"===rA.cmd?tA+="M ".concat(Object(F.converterDpi)(rA.crds[0]+dA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[1]+eA,this.coreHelper.dpi)," "):"L"===rA.cmd?tA+="L ".concat(Object(F.converterDpi)(rA.crds[0]+dA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[1]+eA,this.coreHelper.dpi)," "):"B"===rA.cmd?tA+="C ".concat(Object(F.converterDpi)(rA.crds[0]+dA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[1]+eA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[2]+dA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[3]+eA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[4]+dA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[5]+eA,this.coreHelper.dpi)," "):"Q"===rA.cmd?tA+="Q ".concat(Object(F.converterDpi)(rA.crds[0]+dA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[1]+eA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[2]+dA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[3]+eA,this.coreHelper.dpi)," "):"A"===rA.cmd?tA+="A ".concat(Object(F.converterDpi)(rA.crds[0],this.coreHelper.dpi),",").concat(Object(F.converterDpi)(rA.crds[1],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[2],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[3],this.coreHelper.dpi),",").concat(Object(F.converterDpi)(rA.crds[4],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[5],this.coreHelper.dpi),",").concat(Object(F.converterDpi)(rA.crds[6],this.coreHelper.dpi)):"C"===rA.cmd&&(tA+="Z")}}catch(A){lA.e(A)}finally{lA.f()}HA.setAttribute("d",tA),cA.appendChild(HA),aA.push(cA)}}if(aA.length>0)if(1==aA.length)L.appendChild(aA[0]);else{var ZA,qA=R(aA);try{for(qA.s();!(ZA=qA.n()).done;){var fA=ZA.value;void 0!==fA.children[0].getAttribute("d")&&"clip-path:path('".concat(fA.children[0].getAttribute("d"),"');")}}catch(A){qA.e(A)}finally{qA.f()}}}if(!s){var WA=document.createElementNS("http://www.w3.org/2000/svg","text");if(WA.setAttribute("x",DA),WA.setAttribute("y",iA),WA.textContent=oA,WA.setAttribute("transform",wA),n?WA.setAttribute("fill",B):(WA.setAttribute("fill",C),WA.setAttribute("fill",B),WA.setAttribute("fill-opacity",FA?0:M<S?M:S)),g.Visible||WA.setAttribute("fill-opacity",0),FA||(cA&&L.appendChild(cA),WA.setAttribute("clip-path","url(#clip-path-".concat(g.ID,"-0)"))),J&&t>0&&(WA.setAttribute("stroke",J),WA.setAttribute("stroke-width",Object(F.converterDpi)(t,this.coreHelper.dpi))),WA.setAttribute("style","font-weight: ".concat(Y,";font-size:").concat(K,"px;font-family: ").concat(Object(F.getFontFamily)(EA),";")),Object(F.getFontFamily)(EA)&&Object(F.getFontFamily)(EA).indexOf("BarCode")>=0)return"*"==oA||(h()(L,oA,{width:5,fontSize:K,text:"*".concat(oA,"*")}),L.setAttribute("style","overflow:visible;position:absolute;width:".concat(b,"px;height:").concat(V,"px;left:").concat(m,"px;top:").concat(T,"px;")),L.childNodes[1].lastChild.style.letterSpacing="20px"),L;FA&&(WA.setAttribute("fill",""),WA.setAttribute("stroke","")),L.appendChild(WA)}if(D){var xA=Object(F.converterBox)(D,this.coreHelper.dpi);m+=xA.x,T+=xA.y}if(L.setAttribute("style","overflow:visible;position:absolute;width:".concat(b,"px;height:").concat(V,"px;left:").concat(m,"px;top:").concat(T,"px;")),this.coreHelper.isPrinting){if(m>parseFloat(A.style.width.replace("px",""))||T>parseFloat(A.style.height.replace("px","")))return null;if(m<0||T<0)return null}return L}},{key:"renderPathObjectByCanvas",value:function(A,I,g,B,C,Q,E,D,i,o,w){var G=I.Boundary;if(G){G=Object(F.converterBox)(G,this.coreHelper.dpi);var N=Math.ceil(G.w),y=Math.ceil(G.h),h=G.x,M=G.y;if(N-0!=0&&y-0!=0){var U=document.createElement("canvas"),c=U.getContext("2d");U.width=1*N,U.height=1*y,U.style.width="".concat(N,"px"),U.style.height="".concat(y,"px");var s=I.LineWidth,a=I.AbbreviatedData,Y=I.CTM,S=I.StrokeColor,k=I.FillColor;s&&(C=Object(F.converterDpi)(s,this.coreHelper.dpi));var K=I.DrawParam;if(K){var H=Object(F.getDrawParam)(A,K);(s=H.LineWidth)&&(C=Object(F.converterDpi)(s,this.coreHelper.dpi)),H.FillColor&&(k&&k.Value||(k=H.FillColor)),H.StrokeColor&&(S&&S.Value||(S=H.StrokeColor))}Y&&c.transform(Y.a,Y.b,Y.c,Y.d,Object(F.converterDpi)(Y.e,this.coreHelper.dpi),Object(F.converterDpi)(Y.f,this.coreHelper.dpi));var L=!1;if(S){S.Value&&(B=Object(F.parseColor)(S.Value));var J=S.axialShd;if(J){L=!0;var t,d=Object(F.parseCtm)(J.StartPoint),e=Object(F.parseCtm)(J.EndPoint),n=c.createLinearGradient(d[0],d[1],e[0],e[1]),l=R(J.Segment);try{for(l.s();!(t=l.n()).done;){var r=t.value;r&&n.addColorStop(r.position,Object(F.parseColor)(r.color.Value))}}catch(A){l.e(A)}finally{l.f()}c.lineWidth=C,c.strokeStyle=n}}var Z=!1;if(k){k.Value&&(g=Object(F.parseColor)(k.Value)),k.Alpha&&0===k.Alpha&&(c.globalAlpha=0);var q=k.AxialShd;if(q){Z=!0;var f,W=Object(F.parseCtm)(q.StartPoint),x=Object(F.parseCtm)(q.EndPoint),p=c.createLinearGradient(W[0],W[1],x[0],x[1]),b=R(q.Segment);try{for(b.s();!(f=b.n()).done;){var V=f.value;V&&p.addColorStop(V.position,Object(F.parseColor)(V.color.Value))}}catch(A){b.e(A)}finally{b.f()}c.fillStyle=p}}C>0&&!B&&((B=g)||(B="rgb(0, 0, 0)"));var m=I.Clips;if(m&&m.length>0)for(var T=[],j=0;j<m.length;j++){for(var X=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),O=m[j].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=Y?"matrix(".concat(IA.a," ").concat(IA.b," ").concat(IA.c," ").concat(IA.d," ").concat(Object(F.converterDpi)(IA.e-Y.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(IA.f-Y.f,this.coreHelper.dpi),")"):"matrix(".concat(IA.a," ").concat(IA.b," ").concat(IA.c," ").concat(IA.d," ").concat(Object(F.converterDpi)(IA.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(IA.f,this.coreHelper.dpi),")"),Y){var BA=[[Y.a,Y.c,0],[Y.b,Y.d,0],[0,0,1]],CA=Object(F.inv)(BA);isNaN(CA[0][0])||CA[0][0]===1/0||(gA="".concat(gA," matrix(").concat(CA[0][0]," ").concat(CA[1][0]," ").concat(CA[0][1]," ").concat(CA[1][1]," 0 0)"))}P.setAttribute("transform",gA)}if(!z.TransFlag&&z.Path.CTM){var QA=z.Path.CTM,EA="matrix(".concat(QA.a," ").concat(QA.b," ").concat(QA.c," ").concat(QA.d," ").concat(Object(F.converterDpi)(QA.e-Y.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(QA.f-Y.f,this.coreHelper.dpi),")");if(Y){var DA=[[Y.a,Y.c,0],[Y.b,Y.d,0],[0,0,1]],iA=Object(F.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=R(z.Path.AbbreviatedData);try{for(wA.s();!(oA=wA.n()).done;){var FA=oA.value;"M"===FA.cmd||"S"===FA.cmd?c.moveTo(Object(F.converterDpi)(Object(F.adjustPosLimit)(FA.crds[0],$)+v,this.coreHelper.dpi),Object(F.converterDpi)(Object(F.adjustPosLimit)(FA.crds[1],AA)+_,this.coreHelper.dpi)):"L"===FA.cmd?c.lineTo(Object(F.converterDpi)(Object(F.adjustPosLimit)(FA.crds[0],$)+v,this.coreHelper.dpi),Object(F.converterDpi)(Object(F.adjustPosLimit)(FA.crds[1],AA)+_,this.coreHelper.dpi)):"B"===FA.cmd&&c.bezierCurveTo(Object(F.converterDpi)(Object(F.adjustPosLimit)(FA.crds[0],$)+v,this.coreHelper.dpi),Object(F.converterDpi)(Object(F.adjustPosLimit)(FA.crds[1],AA)+_,this.coreHelper.dpi),Object(F.converterDpi)(FA.crds[2]+v,this.coreHelper.dpi),Object(F.converterDpi)(FA.crds[3]+_,this.coreHelper.dpi),Object(F.converterDpi)(FA.crds[4]+v,this.coreHelper.dpi),Object(F.converterDpi)(FA.crds[5]+_,this.coreHelper.dpi))}}catch(A){wA.e(A)}finally{wA.f()}c.closePath(),c.clip()}T.push(X)}if(I.Join&&c.setLineJoin(I["@_Join"]),I.Cap&&c.setLineCap(I["@_Cap"]),I.DashPattern){var GA=I.DashPattern,NA=Object(F.parseCtm)(GA);I.DashOffset&&I.DashOffset,c.setLineDash([Object(F.converterDpi)(NA[0],this.coreHelper.dpi),Object(F.converterDpi)(NA[1],this.coreHelper.dpi)])}c.beginPath();var yA,hA=R(a);try{for(hA.s();!(yA=hA.n()).done;){var RA=yA.value;"M"===RA.cmd||"S"===RA.cmd?c.moveTo(Object(F.converterDpi)(RA.crds[0],this.coreHelper.dpi),Object(F.converterDpi)(RA.crds[1],this.coreHelper.dpi)):"L"===RA.cmd?c.lineTo(Object(F.converterDpi)(RA.crds[0],this.coreHelper.dpi),Object(F.converterDpi)(RA.crds[1],this.coreHelper.dpi)):"B"===RA.cmd?c.bezierCurveTo(Object(F.converterDpi)(RA.crds[0],this.coreHelper.dpi),Object(F.converterDpi)(RA.crds[1],this.coreHelper.dpi),Object(F.converterDpi)(RA.crds[2],this.coreHelper.dpi),Object(F.converterDpi)(RA.crds[3],this.coreHelper.dpi),Object(F.converterDpi)(RA.crds[4],this.coreHelper.dpi),Object(F.converterDpi)(RA.crds[5],this.coreHelper.dpi)):"Q"===RA.cmd?c.quadraticCurveTo(Object(F.converterDpi)(RA.crds[0],this.coreHelper.dpi),Object(F.converterDpi)(RA.crds[1],this.coreHelper.dpi),Object(F.converterDpi)(RA.crds[2],this.coreHelper.dpi),Object(F.converterDpi)(RA.crds[3],this.coreHelper.dpi)):"A"===RA.cmd||"C"===RA.cmd&&c.closePath()}}catch(A){hA.e(A)}finally{hA.f()}I.Stroke&&(L||(c.strokeStyle=B,c.lineWidth=C),c.stroke());var MA=k.pattern;if(!I.Fill||MA?c.fillStyle="none":(Z||(c.fillStyle=g),c.fill(I.Rule)),D){var UA=document.createElement("canvas"),cA=Object(F.converterBox)(D,this.coreHelper.dpi),sA=cA.w,aA=cA.h;cA.x,cA.y;UA.width=1*sA,UA.height=1*aA,UA.style.width="".concat(sA,"px"),UA.style.height="".concat(aA,"px");var YA=UA.getContext("2d");i&&YA.transform(i.a,i.b,i.c,i.d,Object(F.converterDpi)(i.e,this.coreHelper.dpi),Object(F.converterDpi)(i.f,this.coreHelper.dpi)),E&&(YA.globalAlpha=E/255),YA.drawImage(U,h,M)}return U}}}},{key:"renderPathObject",value:function(A,I,g,B,C,Q,E,D,i,o,w,G,N,y){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=C.Boundary;if(!M)return{svg:h,style:""};var U=(M=Object(F.converterBox)(M,this.coreHelper.dpi)).w,c=M.h,s=M.x,a=M.y,Y="overflow:hidden;position:absolute;width:".concat(Math.ceil(U),"px;height:").concat(Math.ceil(c),"px;"),S=C.Clips;if(S&&S.length>1)return{svg:this.renderPathObjectByCanvas(d,C,Q,E,D,i,o,w,G,N,y),style:Y,left:s,top:a};var k=C.LineWidth,K=C.AbbreviatedData,H=C.StrokeColor,L=C.FillColor,J=C.CTM,t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("ID",C.ID),k&&(D=Object(F.converterDpi)(k,this.coreHelper.dpi));var d=C.DrawParam;if(d){var e=Object(F.getDrawParam)(B,d);(k=e.LineWidth)&&(D=Object(F.converterDpi)(k,this.coreHelper.dpi)),e.FillColor&&(L&&L.Value||(L=e.FillColor)),e.StrokeColor&&(H&&H.Value||(H=e.StrokeColor))}J?t.setAttribute("transform","matrix(".concat(J.a," ").concat(J.b," ").concat(J.c," ").concat(J.d," ").concat(Object(F.converterDpi)(J.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(J.f,this.coreHelper.dpi),")")):G&&t.setAttribute("transform","matrix(".concat(G.a," ").concat(G.b," ").concat(G.c," ").concat(G.d," ").concat(Object(F.converterDpi)(G.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(G.f,this.coreHelper.dpi),")"));if(H){H.Value&&(E=Object(F.parseColor)(H.Value));var n=H.axialShd;if(n){!0;var l=document.createElementNS("http://www.w3.org/2000/svg","linearGradient");l.setAttribute("id","".concat(C.ID)),l.setAttribute("x1","0%"),l.setAttribute("y1","0%"),l.setAttribute("x2","100%"),l.setAttribute("y2","100%");var r,Z=R(n.Segment);try{for(Z.s();!(r=Z.n()).done;){var q=r.value;if(q){var f=document.createElement("stop");f.setAttribute("offset","".concat(100*q.position,"%")),f.setAttribute("style","stop-color:".concat(Object(F.parseColor)(q.color.Value),";stop-opacity:1")),l.appendChild(f),E=Object(F.parseColor)(q.color.Value)}}}catch(A){Z.e(A)}finally{Z.f()}h.appendChild(l)}}if(L){L.Value&&(Q=Object(F.parseColor)(L.Value)),void 0!==L.Alpha&&0===L.Alpha&&(Q="none"),void 0!==L.alpha&&0===L.alpha?Q="none":t.setAttribute("fill-opacity","".concat(L.alpha/255));var W=L.axialShd;if(W){!0;var x=document.createElement("linearGradient");x.setAttribute("id","".concat(C.ID)),x.setAttribute("x1","0%"),x.setAttribute("y1","0%"),x.setAttribute("x2","100%"),x.setAttribute("y2","100%");var p,b=R(W.Segment);try{for(b.s();!(p=b.n()).done;){var V=p.value;if(V){var m=document.createElement("stop");m.setAttribute("offset","".concat(100*V.position,"%")),m.setAttribute("style","stop-color:".concat(Object(F.parseColor)(V.color.Value),";stop-opacity:1")),x.appendChild(m),Q=Object(F.parseColor)(V.color.Value)}}}catch(A){b.e(A)}finally{b.f()}h.appendChild(x)}}if(D>0&&!E&&(E="rgb(0, 0, 0)"),0===C.Alpha&&(Q="none"),o&&t.setAttribute("fill-opacity","".concat(o/255)),C.Stroke&&(t.setAttribute("stroke","".concat(E)),t.setAttribute("stroke-width","".concat(D,"px"))),C.Fill?(t.setAttribute("fill-rule",C.Rule),t.setAttribute("fill","".concat(i?"none":Q||"none"))):t.setAttribute("fill","none"),C.Join&&t.setAttribute("stroke-linejoin","".concat(C["@_Join"])),C.Cap&&t.setAttribute("stroke-linecap","".concat(C["@_Cap"])),C.DashPattern){var T=C.DashPattern,j=Object(F.parseCtm)(T),X=0;C.DashOffset&&(X=C.DashOffset),t.setAttribute("stroke-dasharray","".concat(Object(F.converterDpi)(j[0],this.coreHelper.dpi),",").concat(Object(F.converterDpi)(j[1],this.coreHelper.dpi))),t.setAttribute("stroke-dashoffset","".concat(Object(F.converterDpi)(X,this.coreHelper.dpi),"px"))}var O,u="",z=R(K);try{for(z.s();!(O=z.n()).done;){var P=O.value;"M"===P.cmd||"S"===P.cmd?u+="M ".concat(Object(F.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[1],this.coreHelper.dpi)," "):"L"===P.cmd?u+="L ".concat(Object(F.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[1],this.coreHelper.dpi)," "):"B"===P.cmd?u+="C ".concat(Object(F.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[1],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[2],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[3],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[4],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[5],this.coreHelper.dpi)," "):"Q"===P.cmd?u+="Q ".concat(Object(F.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[1],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[2],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[3],this.coreHelper.dpi)," "):"A"===P.cmd?u+="A ".concat(Object(F.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[1],this.coreHelper.dpi)," ").concat(P.crds[2]," ").concat(P.crds[3],",").concat(P.crds[4]," ").concat(Object(F.converterDpi)(P.crds[5],this.coreHelper.dpi),",").concat(Object(F.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=L.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(F.converterDpi)(v.width,this.coreHelper.dpi)),$.setAttribute("height",Object(F.converterDpi)(v.height,this.coreHelper.dpi)),v.ctm&&$.setAttribute("height",Object(F.converterDpi)(v.height,this.coreHelper.dpi)+Object(F.converterDpi)(v.ctm.split(" ")[5],this.coreHelper.dpi)),$.setAttribute("x",Object(F.converterDpi)(v.width,this.coreHelper.dpi)),$.setAttribute("y",Object(F.converterDpi)(v.height,this.coreHelper.dpi)),$.setAttribute("id","pattern1-".concat(C.ID)),$.setAttribute("patternUnits","userSpaceOnUse"),this.renderLayer(A,I,g,$,y,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(C.ID,")")),h.appendChild(AA)}if(S&&S.length>0){for(var IA=[],gA=0;gA<S.length;gA++){var BA=document.createElementNS("http://www.w3.org/2000/svg","clipPath");BA.setAttribute("id","clip-path-".concat(I,"-").concat(g,"-").concat(C.ID,"-").concat(gA));for(var CA=S[gA].Clip,QA=0;QA<CA.length;QA++){var EA=CA[QA].Area,DA=document.createElementNS("http://www.w3.org/2000/svg","path"),iA="",oA=0,wA=0,FA=0,GA=0;if(EA.Path.Boundary&&(oA=EA.Path.Boundary.x,wA=EA.Path.Boundary.y,FA=EA.Path.Boundary.w,GA=EA.Path.Boundary.h),!EA.TransFlag&&EA.CTM){var NA=EA.CTM,yA=void 0;if(yA=J?"matrix(".concat(NA.a," ").concat(NA.b," ").concat(NA.c," ").concat(NA.d," ").concat(Object(F.converterDpi)(NA.e-J.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(NA.f-J.f,this.coreHelper.dpi),")"):"matrix(".concat(NA.a," ").concat(NA.b," ").concat(NA.c," ").concat(NA.d," ").concat(Object(F.converterDpi)(NA.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(NA.f,this.coreHelper.dpi),")"),J){var hA=[[J.a,J.c,0],[J.b,J.d,0],[0,0,1]],RA=Object(F.inv)(hA);isNaN(RA[0][0])||RA[0][0]===1/0||(yA="".concat(yA," matrix(").concat(RA[0][0]," ").concat(RA[1][0]," ").concat(RA[0][1]," ").concat(RA[1][1]," 0 0)"))}DA.setAttribute("transform",yA)}var MA,UA=R(EA.Path.AbbreviatedData);try{for(UA.s();!(MA=UA.n()).done;){var cA=MA.value;"M"===cA.cmd||"S"===cA.cmd?iA+="M ".concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[0],FA)+oA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[1],GA)+wA,this.coreHelper.dpi)," "):"L"===cA.cmd?iA+="L ".concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[0],FA)+oA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[1],GA)+wA,this.coreHelper.dpi)," "):"B"===cA.cmd?iA+="C ".concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[0],FA)+oA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[1],GA)+wA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(cA.crds[2]+oA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(cA.crds[3]+wA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(cA.crds[4]+oA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(cA.crds[5]+wA,this.coreHelper.dpi)," "):"Q"===cA.cmd?iA+="Q ".concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[0],FA)+oA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[1],GA)+wA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(cA.crds[2]+oA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(cA.crds[3]+wA,this.coreHelper.dpi)," "):"A"===cA.cmd?iA+="A ".concat(Object(F.converterDpi)(cA.crds[0],this.coreHelper.dpi),",").concat(Object(F.converterDpi)(cA.crds[1],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(cA.crds[2],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(cA.crds[3],this.coreHelper.dpi),",").concat(Object(F.converterDpi)(cA.crds[4],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(cA.crds[5],this.coreHelper.dpi),",").concat(Object(F.converterDpi)(cA.crds[6],this.coreHelper.dpi)):"C"===cA.cmd&&(iA+="Z")}}catch(A){UA.e(A)}finally{UA.f()}if(!EA.TransFlag&&EA.Path.CTM){var sA=EA.Path.CTM,aA="matrix(".concat(sA.a," ").concat(sA.b," ").concat(sA.c," ").concat(sA.d," ").concat(Object(F.converterDpi)(sA.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(sA.f,this.coreHelper.dpi),")");if(J){aA="matrix(".concat(sA.a," ").concat(sA.b," ").concat(sA.c," ").concat(sA.d," ").concat(Object(F.converterDpi)(sA.e-J.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(sA.f-J.f,this.coreHelper.dpi),")");var YA=[[J.a,J.c,0],[J.b,J.d,0],[0,0,1]],SA=Object(F.inv)(YA);isNaN(SA[0][0])||SA[0][0]===1/0||(aA="".concat(aA," matrix(").concat(SA[0][0]," ").concat(SA[1][0]," ").concat(SA[0][1]," ").concat(SA[1][1]," 0 0)"))}DA.setAttribute("transform",aA)}DA.setAttribute("d",iA),BA.appendChild(DA),EA.TransFlag&&EA.Path.CTM&&BA.setAttribute("id","none")}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(C.ID,"-0)"));else{var kA,KA="",HA=R(IA);try{for(HA.s();!(kA=HA.n()).done;){var LA=kA.value;void 0!==LA.children[0].getAttribute("d")&&(KA+="clip-path:path('".concat(LA.children[0].getAttribute("d"),"');"))}}catch(A){HA.e(A)}finally{HA.f()}t.setAttribute("style",KA)}}if(w){var JA=document.createElementNS("http://www.w3.org/2000/svg","svg");JA.setAttribute("version","1.1");var tA=Object(F.converterBox)(w,this.coreHelper.dpi),dA=Math.ceil(tA.w),eA=Math.ceil(tA.h),nA=tA.x+s,lA=tA.y+a;return Y="overflow:hidden;position:absolute;width:".concat(dA,"px;height:").concat(eA,"px;"),G&&J&&h.setAttribute("transform","matrix(".concat(G.a," ").concat(G.b," ").concat(G.c," ").concat(G.d," ").concat(Object(F.converterDpi)(G.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(G.f,this.coreHelper.dpi),")")),JA.appendChild(h),{svg:JA,style:Y,left:nA,top:lA}}return{svg:h,style:Y,left:s,top:a}}},{key:"drawGlyph",value:function(A,I,g,B,C,Q,E,D,i,o){var w=B/g,G=C/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(C,") scale(").concat(w,", ").concat(-G,") translate(0, ").concat(-I,")")),y.setAttribute("d",A),Q&&y.setAttribute("fill",Q),y.setAttribute("fill-opacity",E),D&&(y.setAttribute("stroke","".concat(D)),y.setAttribute("stroke-width","".concat(3*Object(F.converterDpi)(i,this.coreHelper.dpi),"px"))),N.appendChild(y),{img:N,yScale:G}}},{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 C,Q,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++){Q=I.watermark_y+(I.watermark_y_space+I.watermark_height)*o;for(var w=0;w<I.watermark_cols;w++){C=I.watermark_x+(I.watermark_width+I.watermark_x_space)*w;var F=document.createElement("div");F.id="mask_div"+o+w,F.className="mask_div",F.innerHTML=I.watermark_txt,F.style.webkitTransform="rotate(-"+I.watermark_angle+"deg)",F.style.MozTransform="rotate(-"+I.watermark_angle+"deg)",F.style.msTransform="rotate(-"+I.watermark_angle+"deg)",F.style.OTransform="rotate(-"+I.watermark_angle+"deg)",F.style.transform="rotate(-"+I.watermark_angle+"deg)",F.style.visibility="",F.style.position="absolute",F.style.left=C+"px",F.style.top=Q+"px",F.style.overflow="hidden",F.style.zIndex="9999",F.style.pointerEvents="none",F.style.opacity=I.watermark_alpha,F.style.fontSize=I.watermark_fontsize,F.style.fontFamily=I.watermark_font,F.style.color=I.watermark_color,F.style.textAlign="center",F.style.width=I.watermark_width+"px",F.style.height=I.watermark_height+"px",F.style.display="block",E.appendChild(F)}}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 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 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 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}g.r(I),g.d(I,"converterDpi",(function(){return Q})),g.d(I,"ctmImageScale",(function(){return E})),g.d(I,"adjustPosLimit",(function(){return w})),g.d(I,"calTextPoint",(function(){return F})),g.d(I,"decodeHtml",(function(){return y})),g.d(I,"getFontFamily",(function(){return R})),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 a})),g.d(I,"Uint8ArrayToHexString",(function(){return Y})),g.d(I,"replaceFirstSlash",(function(){return S})),g.d(I,"replaceFirstTarget",(function(){return k})),g.d(I,"readUTF",(function(){return K})),g.d(I,"getMultiMedia",(function(){return H})),g.d(I,"getDrawParam",(function(){return L})),g.d(I,"getFont",(function(){return J})),g.d(I,"inv",(function(){return e}));var Q=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:(null==g?void 0:g.x)+A,cy:(null==g?void 0:g.y)+I}},w=function(A,I){return 0===I?A:A>I?I:A},F=function(A,I,g,C,E,w,F,G,N){var h=0,R=0,M=0,U=0,c=[];if(!I)return c;var s,a=B(I);try{for(a.s();!(s=a.n()).done;){var Y=s.value;if(Y){if(h=G?parseFloat(Y.X):-parseFloat(Y.X),R=G?parseFloat(Y.Y):-parseFloat(Y.Y),isNaN(h)&&(h=0),isNaN(R)&&(R=0),M=h,U=R,C){var S=D(M,U,C);M=S.cx,U=S.cy}var k=[],K=[];Y.DeltaX&&Y.DeltaX.length>0&&(k=Y.DeltaX),Y.DeltaY&&Y.DeltaY.length>0&&(K=Y.DeltaY);var H=Y.text;if(H){H=(H=y(H+="")).replace(/ /g," ");for(var L=0;L<H.length;L++){if(L>0&&k.length>0){var J=L-1;if(J>=k.length&&(J=k.length-1),h+=N?G?k[J]/N:-k[J]/N:G?k[J]:-k[J],C)M+=i(G?k[L-1]:-k[L-1],0,C).ctmX;else M=h}if(L>0&&K.length>0){var t=L-1;if(t>=K.length&&(t=K.length-1),R+=G?K[t]:-K[t],C)U+=i(0,G?K[L-1]:-K[L-1],C).ctmY;else U=R}var d=H.substring(L,L+1),e=o(M,U,E);F&&(e=D(e.cx,e.cy,F));var n={x:Q(h,A),y:Q(R,A),text:d,cx:Q(e.cx,A),cy:Q(e.cy,A)};c.push(n)}}}}}catch(A){a.e(A)}finally{a.f()}if(c.length>0){var l,r=B(g);try{for(r.s();!(l=r.n()).done;)for(var Z=l.value,q=Z.CodePosition,f=Z.GlyphCount,W=q;W<f+q;W++)if(c.length<=W){var x="".concat(c[c.length-1].glyph," ").concat(Z.Glyphs[W-q]);c[c.length-1].glyph=x}else c[W].glyph=Z.Glyphs[W-q]}catch(A){r.e(A)}finally{r.f()}}return c},G=/&\w+;|&#(\d+);/g,N={"<":"<",">":">","&":"&"," ":" ",""":'"',"©":"","'":"'"},y=function(A){return"string"!=typeof(A=null!=A?A:this.toString())?A:A.replace(G,(function(A,I){var g=N[A];return null==g&&(g=isNaN(I)?A:String.fromCharCode(160==I?32:I)),g}))},h={"仿宋_gb2312":"FangSong, STFangsong, simfang","楷体_gb2312":"楷体_GB2312, KaiTi_GB2312 ","楷体":"楷体, 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",couriernew:"Courier New","courier new":"Courier New",ChangFangSong:"ChangFangSong, FangSong",FangSong_GB2312:"FangSong",fzfs:"方正仿宋_gbk, FangSong, STFangsong, simfang"},R=function(A){if(!A)return h["宋体"];var I=A.FamilyName;I||(I=A.FontName),h[I.toLowerCase()]&&(I=h[I.toLowerCase()]);for(var g=0,B=Object.keys(h);g<B.length;g++){var C=B[g];if(-1!=I.toLowerCase().indexOf(C.toLowerCase()))return h[C]}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=s(I[0],I[1],I[2],I[3]);return"rgb(".concat(g.r,", ").concat(g.g,", ").concat(g.b,")")}},s=function(A,I,g,B,C){var Q=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 C||(Q=Math.round(255*Q),E=Math.round(255*E),D=Math.round(255*D)),{r:Q,g:E,b:D}},a=function(A,I){return{x:Q(null==A?void 0:A.x,I),y:Q(null==A?void 0:A.y,I),w:Q(null==A?void 0:A.w,I),h:Q(null==A?void 0:A.h,I)}},Y=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 C=[],Q=0;Q<A.length;Q++){var E=I[Q>>>2]>>>24-Q%4*8&255;C.push((E>>>4).toString(16)),C.push((15&E).toString(16))}return C.join("")},S=function(A){return A&&0===A.indexOf("/")&&(A=A.replace("/","")),A},k=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 C=g[B].toString(2),Q=C.match(/^1+?(?=0)/);if(Q&&8==C.length){for(var E=Q[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,C=B(A);try{for(C.s();!(g=C.n()).done;){var Q=g.value;if(Q.ID==I)return Q}}catch(A){C.e(A)}finally{C.f()}},L=function(A,I){var g,C=B(A);try{for(C.s();!(g=C.n()).done;){var Q=g.value;if(Q.ID==I)return Q}}catch(A){C.e(A)}finally{C.f()}},J=function(A,I){var g,C=B(A);try{for(C.s();!(g=C.n()).done;){var Q=g.value;if(Q.ID==I)return Q}}catch(A){C.e(A)}finally{C.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 C=new Array(I-1).fill(0).map((function(A){return new Array(I-1).fill(0)})),Q=0;Q<I-1;Q++)for(var E=0;E<I-1;E++)C[Q][E]=E<B?A[Q+1][E]:A[Q+1][E+1];g+=A[0][B]*Math.pow(-1,0+B)*t(C)}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 C=0;C<I;C++){for(var Q=[],E=0;E<A.length;E++)if(E!==B){for(var D=[],i=0;i<A.length;i++)i!==C&&D.push(A[E][i]);Q.push(D)}g[B][C]=Math.pow(-1,B+C)*t(Q)}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 e(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 C=0;C<g.length;C++)g[B][C]/=I;return g}},function(A,I,g){"use strict";g.r(I),g.d(I,"needInitAgain",(function(){return w})),g.d(I,"setYYDS",(function(){return F})),g.d(I,"freeMemory",(function(){return G})),g.d(I,"getStreamData",(function(){return N})),g.d(I,"getStreamDataBase64",(function(){return y})),g.d(I,"CreateLibrary",(function(){return h})),g.d(I,"CreateNativeStream",(function(){return R})),g.d(I,"FT_Open_Face",(function(){return M})),g.d(I,"loadFaceInfo",(function(){return U})),g.d(I,"FT_Glyph_Get_Measure",(function(){return c})),g.d(I,"freeOFD",(function(){return s})),g.d(I,"readOFD",(function(){return a})),g.d(I,"readOFDByBase64",(function(){return Y})),g.d(I,"hashPath",(function(){return S})),g.d(I,"MD5",(function(){return k})),g.d(I,"SHA1",(function(){return K})),g.d(I,"SM3",(function(){return H})),g.d(I,"base64EncodeByByte",(function(){return L})),g.d(I,"base64Encode",(function(){return J})),g.d(I,"base64DecodeToUint8Array",(function(){return t})),g.d(I,"JSBase64ByHashFile",(function(){return d})),g.d(I,"JSGetImageInfoByBase64",(function(){return e})),g.d(I,"JSGetImageInfoByPath",(function(){return n})),g.d(I,"JSReadPageInfo",(function(){return l})),g.d(I,"JSGetPathEncode",(function(){return r})),g.d(I,"JSPackageSigned",(function(){return Z})),g.d(I,"JSGetToSign",(function(){return q}));var B,C,Q,E,D,i=g(33),o=g(34),w=function(){return!B},F=function(A){B=A},G=function(A){B._ASC_FT_Free(A.data),A.data=0},N=function(){return E},y=function(){return D},h=function(){C=B._ASC_FT_Init()},R=function(A){var I=new Uint8Array(A),g=B._malloc(A.byteLength);return B.HEAPU8.set(I,g),{data:g,length:A.byteLength}},M=function(A){return B._ASC_FT_Open_Face(C,A.data,A.length,0)},U=function(A){var I=B._ASC_FT_GetFaceInfo(A);if(I){var g=new i.CFaceInfo,C=Math.min(B.HEAP8.length-I>>2,250),Q=new Int32Array(B.HEAP8.buffer,I,C),E=0;g.units_per_EM=Math.abs(Q[E++]),g.ascender=Q[E++],g.descender=Q[E++],g.height=Q[E++],g.face_flags=Q[E++],g.num_faces=Q[E++],g.num_glyphs=Q[E++],g.num_charmaps=Q[E++],g.style_flags=Q[E++],g.face_index=Q[E++];for(var D=Q[E++];D;)g.family_name+=String.fromCharCode(D),D=Q[E++];for(D=Q[E++];D;)g.style_name+=String.fromCharCode(D),D=Q[E++];g.os2_version=Q[E++],g.os2_usWeightClass=Q[E++],g.os2_fsSelection=Q[E++],g.os2_usWinAscent=Q[E++],g.os2_usWinDescent=Q[E++],g.os2_usDefaultChar=Q[E++],g.os2_sTypoAscender=Q[E++],g.os2_sTypoDescender=Q[E++],g.os2_sTypoLineGap=Q[E++],g.os2_ulUnicodeRange1=f(Q[E++]),g.os2_ulUnicodeRange2=f(Q[E++]),g.os2_ulUnicodeRange3=f(Q[E++]),g.os2_ulUnicodeRange4=f(Q[E++]),g.os2_ulCodePageRange1=f(Q[E++]),g.os2_ulCodePageRange2=f(Q[E++]),g.os2_nSymbolic=Q[E++],g.header_yMin=Q[E++],g.header_yMax=Q[E++];for(var o=Q[E++],w=0;w<o;w++)g.monochromeSizes.push(Q[E++]);return B._ASC_FT_Free(I),I=null,g}},c=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 C=B.HEAP32[g>>2],Q=new Int32Array(B.HEAP8.buffer,g,C),E=new o.CGlyphMetrics;E.bbox_xMin=Q[1],E.bbox_yMin=Q[2],E.bbox_xMax=Q[3],E.bbox_yMax=Q[4],E.width=Q[5],E.height=Q[6],E.horiAdvance=Q[7],E.horiBearingX=Q[8],E.horiBearingY=Q[9],E.vertAdvance=Q[10],E.vertBearingX=Q[11],E.vertBearingY=Q[12],E.linearHoriAdvance=Q[13],E.linearVertAdvance=Q[14],E.horiUnderlinePosition=E.horiBearingY-E.height;for(var D=15,i="";D<C;)switch(Q[D++]){case 0:i+=" M ".concat(Q[D++]," ").concat(Q[D++]);break;case 1:i+=" L ".concat(Q[D++]," ").concat(Q[D++]);break;case 2:i+=" Q ".concat(Q[D++]," ").concat(Q[D++]," ").concat(Q[D++]," ").concat(Q[D++]);break;case 3:i+=" C ".concat(Q[D++]," ").concat(Q[D++]," ").concat(Q[D++]," ").concat(Q[D++]," ").concat(Q[D++]," ").concat(Q[D++])}return E.glyphPath=i,B._ASC_FT_Free(g),Q=null,E},s=function(A){if(G(Q),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)}))},a=function(A,I,g){E=A,Q=R(A);var D=B.JSReadOFD(C,Q.data,Q.length,I||"kgNVVbdUZ31C6mps",g?g.toLowerCase():"");if(D.data&&D.data.ofd&&(D.data.ofd.size=Q.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},Y=function(A,I,g){D=A;var Q=B.JSReadOFDByBase64(C,A,I||"kgNVVbdUZ31C6mps",g?g.toLowerCase():"");if(0!==Q.code)switch(Q.msg){case"10001":Q.msg="授权信息错误";break;case"10002":Q.msg="授权时间过期";break;case"10003":var E="非ofd文件无法打开";switch(Q.file_type){case 0:break;case 9:E="PDF文件无法打开";break;default:E="图片文件无法打开"}Q.msg=E}return Q},S=function(A,I,g){return B.JSHashPath(A,I,g)},k=function(A){return B.JSMD5(A)},K=function(A){return B.JSSHA1(A)},H=function(A){return B.JSSM3(A)},L=function(A){var I=R(A),g=B.JSBase64EncodeByByte(I.data,I.length);return G(I),g},J=function(A){return B.JSBase64Encode(A)},t=function(A){var I=B.JSBase64Decode(A);return new Uint8Array(B.HEAPU8.buffer,I.ptr,I.len).slice(0,I.len)},d=function(A,I,g){var C=R(A);return B.JSBase64ByHashFile(C.data,C.length,I,g)},e=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},n=function(A,I,g,C,Q){Q||(Q="");var E=B.JSGetImageInfoByPath(A,I,g,C,Q);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},l=function(A,I,g,C,Q){return B.JSReadPageInfo(A,I,g,C,Q)},r=function(A,I,g){var C=B.JSGetPathEncode(A,I,g);if(0===C.code)return new Uint8Array(B.HEAPU8.buffer,C.ptr,C.ptr_len).slice(0,C.ptr_len)},Z=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)},f=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),C=g.n(B),Q=g(5),E=g.n(Q),D=C()((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),C=g.n(B),Q=g(5),E=g.n(Q),D=C()((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),C=g.n(B),Q=g(1),E=g.n(Q),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,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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}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){C()(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 C=Object(D.JSReadPageInfo)(this.ofdParserPtr,B.BasePln,B.BaseAbs,B.pln,B.abs);g.Pages[I].Page=C.Page}return g.Pages[I]}},{key:"indexOfdPage",value:function(A,I){if(!this.ofd)return null;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:"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 C=B.PhysicalBox;if(C)g=C;else{var Q=B.ApplicationBox;if(Q)g=Q;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,C=this.readOfdDocument(A);if(C)for(var Q=0;Q<C.Signatures.Signature.length;Q++){var E,D=i(C.Signatures.Signature);try{for(D.s();!(E=D.n()).done;){var o,w=E.value,F=i(w.Signature.SignedInfo.StampAnnot);try{for(F.s();!(o=F.n()).done;){var G=o.value;if(G.ID==g&&G.PageRef==I){B=w.Signature;break}}}catch(A){F.e(A)}finally{F.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:"getOutline",value:function(A){var I=this.readOfdDocument(A);return I&&I.Outlines?I.Outlines: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,C=i(g.Attachments);try{for(C.s();!(B=C.n()).done;){var Q=B.value;if(Q.ID==I)return Q}}catch(A){C.e(A)}finally{C.f()}}return null}},{key:"getTextObject",value:function(A,I){var g=[],B=this.readOfdPage(A,I);if(B){var C,Q=i(B.Page.Content.Layer);try{for(Q.s();!(C=Q.n()).done;){var E,D=i(C.value.PageBlock);try{for(D.s();!(E=D.n()).done;){var o=E.value;if("TextObject"==o.Type){var w,F="",G=i(o.TextCode);try{for(G.s();!(w=G.n()).done;){var N=w.value;F="".concat(F).concat(N.text)}}catch(A){G.e(A)}finally{G.f()}if(F.length>0){var y={id:o.ID,pageId:B.ID};y.text=F,g.push(y)}}}}catch(A){D.e(A)}finally{D.f()}}}catch(A){Q.e(A)}finally{Q.f()}}return g}},{key:"getAllTextObject",value:function(A){for(var I=[],g=this.readOfdDocument(A),B=0;B<g.Pages.length;B++){var C=g.Pages[B];if(C.Page.onlyReadArea){var Q=Object(D.JSReadPageInfo)(this.ofdParserPtr,C.BasePln,C.BaseAbs,C.pln,C.abs);C.Page=Q.Page}if(C){var E,o=i(C.Page.Content.Layer);try{for(o.s();!(E=o.n()).done;){var w,F=i(E.value.PageBlock);try{for(F.s();!(w=F.n()).done;){var G=w.value;if("TextObject"==G.Type){var N,y="",h=i(G.TextCode);try{for(h.s();!(N=h.n()).done;){var R=N.value;y="".concat(y).concat(R.text)}}catch(A){h.e(A)}finally{h.f()}if(y.length>0){var M={id:G.ID,pageId:C.ID,pageIndex:B+1};M.text=y,I.push(M)}}}}catch(A){F.e(A)}finally{F.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),C=g.n(B),Q=g(1),E=g.n(Q),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]:"";C()(this,A),this.dpi=I,this.waterText=g,this.isPrinting=!1}return E()(A,[{key:"setPrinting",value:function(A){this.isPrinting=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";var B=G(g(38)),C=G(g(73)),Q=G(g(74)),E=G(g(75)),D=G(g(76)),i=G(g(78)),o=G(g(86)),w=g(85),F=G(g(79));function G(A){return A&&A.__esModule?A:{default:A}}var N=function(){},y=function(A,I,g){var B=new N;if(void 0===A)throw Error("No element to render on was provided.");return B._renderProperties=(0,D.default)(A),B._encodings=[],B._options=F.default,B._errorHandler=new o.default(B),void 0!==I&&((g=g||{}).format||(g.format=U()),B.options(g)[g.format](I,g).render()),B};for(var h in y.getModule=function(A){return B.default[A]},B.default)B.default.hasOwnProperty(h)&&R(B.default,h);function R(A,I){N.prototype[I]=N.prototype[I.toUpperCase()]=N.prototype[I.toLowerCase()]=function(g,B){var Q=this;return Q._errorHandler.wrapBarcodeCall((function(){B.text=void 0===B.text?void 0:""+B.text;var E=(0,C.default)(Q._options,B);E=(0,i.default)(E);var D=A[I],o=M(g,D,E);return Q._encodings.push(o),Q}))}}function M(A,I,g){var B=new I(A=""+A,g);if(!B.valid())throw new w.InvalidInputException(B.constructor.name,A);var E=B.encode();E=(0,Q.default)(E);for(var D=0;D<E.length;D++)E[D].options=(0,C.default)(g,E[D].options);return E}function U(){return B.default.CODE128?"CODE128":Object.keys(B.default)[0]}function c(A,I,g){I=(0,Q.default)(I);for(var B=0;B<I.length;B++)I[B].options=(0,C.default)(g,I[B].options),(0,E.default)(I[B].options);(0,E.default)(g),new(0,A.renderer)(A.element,I,g).render(),A.afterRender&&A.afterRender()}N.prototype.options=function(A){return this._options=(0,C.default)(this._options,A),this},N.prototype.blank=function(A){var I=new Array(A+1).join("0");return this._encodings.push({data:I}),this},N.prototype.init=function(){var A;if(this._renderProperties)for(var I in Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]),this._renderProperties){A=this._renderProperties[I];var g=(0,C.default)(this._options,A.options);"auto"==g.format&&(g.format=U()),this._errorHandler.wrapBarcodeCall((function(){var I=M(g.value,B.default[g.format.toUpperCase()],g);c(A,I,g)}))}},N.prototype.render=function(){if(!this._renderProperties)throw new w.NoElementException;if(Array.isArray(this._renderProperties))for(var A=0;A<this._renderProperties.length;A++)c(this._renderProperties[A],this._encodings,this._options);else c(this._renderProperties,this._encodings,this._options);return this},N.prototype._defaults=F.default,"undefined"!=typeof window&&(window.JsBarcode=y),"undefined"!=typeof jQuery&&(jQuery.fn.JsBarcode=function(A,I){var g=[];return jQuery(this).each((function(){g.push(this)})),y(g,A,I)}),A.exports=y},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=g(39),C=g(41),Q=g(49),E=g(59),D=g(63),i=g(70),o=g(71),w=g(72);I.default={CODE39:B.CODE39,CODE128:C.CODE128,CODE128A:C.CODE128A,CODE128B:C.CODE128B,CODE128C:C.CODE128C,EAN13:Q.EAN13,EAN8:Q.EAN8,EAN5:Q.EAN5,EAN2:Q.EAN2,UPC:Q.UPC,UPCE:Q.UPCE,ITF14:E.ITF14,ITF:E.ITF,MSI:D.MSI,MSI10:D.MSI10,MSI11:D.MSI11,MSI1010:D.MSI1010,MSI1110:D.MSI1110,pharmacode:i.pharmacode,codabar:o.codabar,GenericBarcode:w.GenericBarcode}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.CODE39=void 0;var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(40);var E=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),A=A.toUpperCase(),g.mod43&&(A+=function(A){return D[A]}(function(A){for(var I=0,g=0;g<A.length;g++)I+=w(A[g]);return I%=43}(A))),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"encode",value:function(){for(var A=o("*"),I=0;I<this.data.length;I++)A+=o(this.data[I])+"0";return{data:A+=o("*"),text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),I}(((B=Q)&&B.__esModule?B:{default:B}).default),D=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],i=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function o(A){return function(A){return i[A].toString(2)}(w(A))}function w(A){return D.indexOf(A)}I.CODE39=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.default=function A(I,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,A),this.data=I,this.text=g.text||I,this.options=g}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.CODE128C=I.CODE128B=I.CODE128A=I.CODE128=void 0;var B=D(g(42)),C=D(g(46)),Q=D(g(47)),E=D(g(48));function D(A){return A&&A.__esModule?A:{default:A}}I.CODE128=B.default,I.CODE128A=C.default,I.CODE128B=Q.default,I.CODE128C=E.default},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=Q(g(43)),C=Q(g(45));function Q(A){return A&&A.__esModule?A:{default:A}}function E(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}var D=function(A){function I(A,g){if(function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),/^[\x00-\x7F\xC8-\xD3]+$/.test(A))var B=E(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,(0,C.default)(A),g));else B=E(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));return E(B)}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),I}(B.default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(40),E=(B=Q)&&B.__esModule?B:{default:B},D=g(44);var i=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I);var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A.substring(1),g));return B.bytes=A.split("").map((function(A){return A.charCodeAt(0)})),B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var A=this.bytes,g=A.shift()-105,B=D.SET_BY_CODE[g];if(void 0===B)throw new RangeError("The encoding does not start with a start character.");!0===this.shouldEncodeAsEan128()&&A.unshift(D.FNC1);var C=I.next(A,1,B);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:I.getBar(g)+C.result+I.getBar((C.checksum+g)%D.MODULO)+I.getBar(D.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var A=this.options.ean128||!1;return"string"==typeof A&&(A="true"===A.toLowerCase()),A}}],[{key:"getBar",value:function(A){return D.BARS[A]?D.BARS[A].toString():""}},{key:"correctIndex",value:function(A,I){if(I===D.SET_A){var g=A.shift();return g<32?g+64:g-32}return I===D.SET_B?A.shift()-32:10*(A.shift()-48)+A.shift()-48}},{key:"next",value:function(A,g,B){if(!A.length)return{result:"",checksum:0};var C=void 0,Q=void 0;if(A[0]>=200){Q=A.shift()-105;var E=D.SWAP[Q];void 0!==E?C=I.next(A,g+1,E):(B!==D.SET_A&&B!==D.SET_B||Q!==D.SHIFT||(A[0]=B===D.SET_A?A[0]>95?A[0]-96:A[0]:A[0]<32?A[0]+96:A[0]),C=I.next(A,g+1,B))}else Q=I.correctIndex(A,B),C=I.next(A,g+1,B);var i=Q*g;return{result:I.getBar(Q)+C.result,checksum:i+C.checksum}}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";var B;function C(A,I,g){return I in A?Object.defineProperty(A,I,{value:g,enumerable:!0,configurable:!0,writable:!0}):A[I]=g,A}Object.defineProperty(I,"__esModule",{value:!0});var Q=I.SET_A=0,E=I.SET_B=1,D=I.SET_C=2,i=(I.SHIFT=98,I.START_A=103),o=I.START_B=104,w=I.START_C=105;I.MODULO=103,I.STOP=106,I.FNC1=207,I.SET_BY_CODE=(C(B={},i,Q),C(B,o,E),C(B,w,D),B),I.SWAP={101:Q,100:E,99:D},I.A_START_CHAR=String.fromCharCode(208),I.B_START_CHAR=String.fromCharCode(209),I.C_START_CHAR=String.fromCharCode(210),I.A_CHARS="[\0-_È-Ï]",I.B_CHARS="[ -È-Ï]",I.C_CHARS="(Ï*[0-9]{2}Ï*)",I.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011]},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=g(44),C=function(A){return A.match(new RegExp("^"+B.A_CHARS+"*"))[0].length},Q=function(A){return A.match(new RegExp("^"+B.B_CHARS+"*"))[0].length},E=function(A){return A.match(new RegExp("^"+B.C_CHARS+"*"))[0]};function D(A,I){var g=I?B.A_CHARS:B.B_CHARS,C=A.match(new RegExp("^("+g+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(C)return C[1]+String.fromCharCode(204)+i(A.substring(C[1].length));var Q=A.match(new RegExp("^"+g+"+"))[0];return Q.length===A.length?A:Q+String.fromCharCode(I?205:206)+D(A.substring(Q.length),!I)}function i(A){var I=E(A),g=I.length;if(g===A.length)return A;A=A.substring(g);var B=C(A)>=Q(A);return I+String.fromCharCode(B?206:205)+D(A,B)}I.default=function(A){var I=void 0;if(E(A).length>=2)I=B.C_START_CHAR+i(A);else{var g=C(A)>Q(A);I=(g?B.A_START_CHAR:B.B_START_CHAR)+D(A,g)}return I.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,(function(A,I){return String.fromCharCode(203)+I}))}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(43),E=(B=Q)&&B.__esModule?B:{default:B},D=g(44);var i=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,D.A_START_CHAR+A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"valid",value:function(){return new RegExp("^"+D.A_CHARS+"+$").test(this.data)}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(43),E=(B=Q)&&B.__esModule?B:{default:B},D=g(44);var i=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,D.B_START_CHAR+A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"valid",value:function(){return new RegExp("^"+D.B_CHARS+"+$").test(this.data)}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(43),E=(B=Q)&&B.__esModule?B:{default:B},D=g(44);var i=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,D.C_START_CHAR+A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"valid",value:function(){return new RegExp("^"+D.C_CHARS+"+$").test(this.data)}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.UPCE=I.UPC=I.EAN2=I.EAN5=I.EAN8=I.EAN13=void 0;var B=o(g(50)),C=o(g(54)),Q=o(g(55)),E=o(g(56)),D=o(g(57)),i=o(g(58));function o(A){return A&&A.__esModule?A:{default:A}}I.EAN13=B.default,I.EAN8=C.default,I.EAN5=Q.default,I.EAN2=E.default,I.UPC=D.default,I.UPCE=i.default},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=function A(I,g,B){null===I&&(I=Function.prototype);var C=Object.getOwnPropertyDescriptor(I,g);if(void 0===C){var Q=Object.getPrototypeOf(I);return null===Q?void 0:A(Q,g,B)}if("value"in C)return C.value;var E=C.get;return void 0!==E?E.call(B):void 0},E=g(51),D=g(52),i=(B=D)&&B.__esModule?B:{default:B};var o=function(A){return(10-A.substr(0,12).split("").map((function(A){return+A})).reduce((function(A,I,g){return g%2?A+3*I:A+I}),0)%10)%10},w=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),-1!==A.search(/^[0-9]{12}$/)&&(A+=o(A));var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));return B.lastChar=g.lastChar,B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===o(this.data)}},{key:"leftText",value:function(){return Q(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var A=this.data.substr(1,6),g=E.EAN13_STRUCTURE[this.data[0]];return Q(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"leftEncode",this).call(this,A,g)}},{key:"rightText",value:function(){return Q(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var A=this.data.substr(7,6);return Q(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"rightEncode",this).call(this,A,"RRRRRR")}},{key:"encodeGuarded",value:function(){var A=Q(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(A.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(A.push({data:"00"}),A.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),A}}]),I}(i.default);I.default=w},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.SIDE_BIN="101",I.MIDDLE_BIN="01010",I.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},I.EAN2_STRUCTURE=["LL","LG","GL","GG"],I.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],I.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(51),Q=E(g(53));function E(A){return A&&A.__esModule?A:{default:A}}var D=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I);var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));return B.fontSize=!g.flat&&g.fontSize>10*g.width?10*g.width:g.fontSize,B.guardHeight=g.height+B.fontSize/2+g.textMargin,B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),B(I,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(A,I){return this.text.substr(A,I)}},{key:"leftEncode",value:function(A,I){return(0,Q.default)(A,I)}},{key:"rightText",value:function(A,I){return this.text.substr(A,I)}},{key:"rightEncode",value:function(A,I){return(0,Q.default)(A,I)}},{key:"encodeGuarded",value:function(){var A={fontSize:this.fontSize},I={height:this.guardHeight};return[{data:C.SIDE_BIN,options:I},{data:this.leftEncode(),text:this.leftText(),options:A},{data:C.MIDDLE_BIN,options:I},{data:this.rightEncode(),text:this.rightText(),options:A},{data:C.SIDE_BIN,options:I}]}},{key:"encodeFlat",value:function(){return{data:[C.SIDE_BIN,this.leftEncode(),C.MIDDLE_BIN,this.rightEncode(),C.SIDE_BIN].join(""),text:this.text}}}]),I}(E(g(40)).default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=g(51);I.default=function(A,I,g){var C=A.split("").map((function(A,g){return B.BINARIES[I[g]]})).map((function(I,g){return I?I[A[g]]:""}));if(g){var Q=A.length-1;C=C.map((function(A,I){return I<Q?A+g:A}))}return C.join("")}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=function A(I,g,B){null===I&&(I=Function.prototype);var C=Object.getOwnPropertyDescriptor(I,g);if(void 0===C){var Q=Object.getPrototypeOf(I);return null===Q?void 0:A(Q,g,B)}if("value"in C)return C.value;var E=C.get;return void 0!==E?E.call(B):void 0},E=g(52),D=(B=E)&&B.__esModule?B:{default:B};var i=function(A){return(10-A.substr(0,7).split("").map((function(A){return+A})).reduce((function(A,I,g){return g%2?A+I:A+3*I}),0)%10)%10},o=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),-1!==A.search(/^[0-9]{7}$/)&&(A+=i(A)),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===i(this.data)}},{key:"leftText",value:function(){return Q(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var A=this.data.substr(0,4);return Q(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"leftEncode",this).call(this,A,"LLLL")}},{key:"rightText",value:function(){return Q(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var A=this.data.substr(4,4);return Q(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"rightEncode",this).call(this,A,"RRRR")}}]),I}(D.default);I.default=o},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(51),Q=D(g(53)),E=D(g(40));function D(A){return A&&A.__esModule?A:{default:A}}var i=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),B(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var A,I=C.EAN5_STRUCTURE[(A=this.data,A.split("").map((function(A){return+A})).reduce((function(A,I,g){return g%2?A+9*I:A+3*I}),0)%10)];return{data:"1011"+(0,Q.default)(this.data,I,"01"),text:this.text}}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(51),Q=E(g(53));function E(A){return A&&A.__esModule?A:{default:A}}var D=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),B(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var A=C.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,Q.default)(this.data,A,"01"),text:this.text}}}]),I}(E(g(40)).default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}();I.checksum=D;var C=Q(g(53));function Q(A){return A&&A.__esModule?A:{default:A}}var E=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),-1!==A.search(/^[0-9]{11}$/)&&(A+=D(A));var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));return B.displayValue=g.displayValue,g.fontSize>10*g.width?B.fontSize=10*g.width:B.fontSize=g.fontSize,B.guardHeight=g.height+B.fontSize/2+g.textMargin,B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),B(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==D(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var A="";return A+="101",A+=(0,C.default)(this.data.substr(0,6),"LLLLLL"),A+="01010",A+=(0,C.default)(this.data.substr(6,6),"RRRRRR"),{data:A+="101",text:this.text}}},{key:"guardedEncoding",value:function(){var A=[];return this.displayValue&&A.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),A.push({data:"101"+(0,C.default)(this.data[0],"L"),options:{height:this.guardHeight}}),A.push({data:(0,C.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),A.push({data:"01010",options:{height:this.guardHeight}}),A.push({data:(0,C.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),A.push({data:(0,C.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&A.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),A}}]),I}(Q(g(40)).default);function D(A){var I,g=0;for(I=1;I<11;I+=2)g+=parseInt(A[I]);for(I=0;I<11;I+=2)g+=3*parseInt(A[I]);return(10-g%10)%10}I.default=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=D(g(53)),Q=D(g(40)),E=g(57);function D(A){return A&&A.__esModule?A:{default:A}}function i(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}var o=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],w=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],F=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I);var B=i(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));if(B.isValid=!1,-1!==A.search(/^[0-9]{6}$/))B.middleDigits=A,B.upcA=G(A,"0"),B.text=g.text||""+B.upcA[0]+A+B.upcA[B.upcA.length-1],B.isValid=!0;else{if(-1===A.search(/^[01][0-9]{7}$/))return i(B);if(B.middleDigits=A.substring(1,A.length-1),B.upcA=G(B.middleDigits,A[0]),B.upcA[B.upcA.length-1]!==A[A.length-1])return i(B);B.isValid=!0}return B.displayValue=g.displayValue,g.fontSize>10*g.width?B.fontSize=10*g.width:B.fontSize=g.fontSize,B.guardHeight=g.height+B.fontSize/2+g.textMargin,B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),B(I,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var A="";return A+="101",A+=this.encodeMiddleDigits(),{data:A+="010101",text:this.text}}},{key:"guardedEncoding",value:function(){var A=[];return this.displayValue&&A.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),A.push({data:"101",options:{height:this.guardHeight}}),A.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),A.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&A.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),A}},{key:"encodeMiddleDigits",value:function(){var A=this.upcA[0],I=this.upcA[this.upcA.length-1],g=w[parseInt(I)][parseInt(A)];return(0,C.default)(this.middleDigits,g)}}]),I}(Q.default);function G(A,I){for(var g=parseInt(A[A.length-1]),B=o[g],C="",Q=0,D=0;D<B.length;D++){var i=B[D];C+="X"===i?A[Q++]:i}return""+(C=""+I+C)+(0,E.checksum)(C)}I.default=F},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.ITF14=I.ITF=void 0;var B=Q(g(60)),C=Q(g(62));function Q(A){return A&&A.__esModule?A:{default:A}}I.ITF=B.default,I.ITF14=C.default},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(61),E=g(40);var D=function(A){function I(){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).apply(this,arguments))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){var A=this,I=this.data.match(/.{2}/g).map((function(I){return A.encodePair(I)})).join("");return{data:Q.START_BIN+I+Q.END_BIN,text:this.text}}},{key:"encodePair",value:function(A){var I=Q.BINARIES[A[1]];return Q.BINARIES[A[0]].split("").map((function(A,g){return("1"===A?"111":"1")+("1"===I[g]?"000":"0")})).join("")}}]),I}(((B=E)&&B.__esModule?B:{default:B}).default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.START_BIN="1010",I.END_BIN="11101",I.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(60),E=(B=Q)&&B.__esModule?B:{default:B};var D=function(A){var I=A.substr(0,13).split("").map((function(A){return parseInt(A,10)})).reduce((function(A,I,g){return A+I*(3-g%2*2)}),0);return 10*Math.ceil(I/10)-I},i=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),-1!==A.search(/^[0-9]{13}$/)&&(A+=D(A)),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&+this.data[13]===D(this.data)}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.MSI1110=I.MSI1010=I.MSI11=I.MSI10=I.MSI=void 0;var B=i(g(64)),C=i(g(65)),Q=i(g(67)),E=i(g(68)),D=i(g(69));function i(A){return A&&A.__esModule?A:{default:A}}I.MSI=B.default,I.MSI10=C.default,I.MSI11=Q.default,I.MSI1010=E.default,I.MSI1110=D.default},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(40);var E=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"encode",value:function(){for(var A="110",I=0;I<this.data.length;I++){var g=parseInt(this.data[I]).toString(2);g=D(g,4-g.length);for(var B=0;B<g.length;B++)A+="0"==g[B]?"100":"110"}return{data:A+="1001",text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]),I}(((B=Q)&&B.__esModule?B:{default:B}).default);function D(A,I){for(var g=0;g<I;g++)A="0"+A;return A}I.default=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=g(64),Q=(B=C)&&B.__esModule?B:{default:B},E=g(66);var D=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A+(0,E.mod10)(A),g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),I}(Q.default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.mod10=function(A){for(var I=0,g=0;g<A.length;g++){var B=parseInt(A[g]);(g+A.length)%2==0?I+=B:I+=2*B%10+Math.floor(2*B/10)}return(10-I%10)%10},I.mod11=function(A){for(var I=0,g=[2,3,4,5,6,7],B=0;B<A.length;B++){var C=parseInt(A[A.length-1-B]);I+=g[B%g.length]*C}return(11-I%11)%11}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=g(64),Q=(B=C)&&B.__esModule?B:{default:B},E=g(66);var D=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A+(0,E.mod11)(A),g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),I}(Q.default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=g(64),Q=(B=C)&&B.__esModule?B:{default:B},E=g(66);var D=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),A+=(0,E.mod10)(A),A+=(0,E.mod10)(A),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),I}(Q.default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=g(64),Q=(B=C)&&B.__esModule?B:{default:B},E=g(66);var D=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),A+=(0,E.mod11)(A),A+=(0,E.mod10)(A),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),I}(Q.default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.pharmacode=void 0;var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(40);var E=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I);var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));return B.number=parseInt(A,10),B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"encode",value:function(){for(var A=this.number,I="";!isNaN(A)&&0!=A;)A%2==0?(I="11100"+I,A=(A-2)/2):(I="100"+I,A=(A-1)/2);return{data:I=I.slice(0,-2),text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),I}(((B=Q)&&B.__esModule?B:{default:B}).default);I.pharmacode=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.codabar=void 0;var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(40);var E=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),0===A.search(/^[0-9\-\$\:\.\+\/]+$/)&&(A="A"+A+"A");var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A.toUpperCase(),g));return B.text=B.options.text||B.text.replace(/[A-D]/g,""),B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var A=[],I=this.getEncodings(),g=0;g<this.data.length;g++)A.push(I[this.data.charAt(g)]),g!==this.data.length-1&&A.push("0");return{text:this.text,data:A.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),I}(((B=Q)&&B.__esModule?B:{default:B}).default);I.codabar=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.GenericBarcode=void 0;var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(40);var E=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),I}(((B=Q)&&B.__esModule?B:{default:B}).default);I.GenericBarcode=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=Object.assign||function(A){for(var I=1;I<arguments.length;I++){var g=arguments[I];for(var B in g)Object.prototype.hasOwnProperty.call(g,B)&&(A[B]=g[B])}return A};I.default=function(A,I){return B({},A,I)}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.default=function(A){var I=[];return function A(g){if(Array.isArray(g))for(var B=0;B<g.length;B++)A(g[B]);else g.text=g.text||"",g.data=g.data||"",I.push(g)}(A),I}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.default=function(A){return A.marginTop=A.marginTop||A.margin,A.marginBottom=A.marginBottom||A.margin,A.marginRight=A.marginRight||A.margin,A.marginLeft=A.marginLeft||A.margin,A}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B="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},C=D(g(77)),Q=D(g(80)),E=g(85);function D(A){return A&&A.__esModule?A:{default:A}}function i(A){if("string"==typeof A)return function(A){var I=document.querySelectorAll(A);if(0===I.length)return;for(var g=[],B=0;B<I.length;B++)g.push(i(I[B]));return g}(A);if(Array.isArray(A)){for(var I=[],g=0;g<A.length;g++)I.push(i(A[g]));return I}if("undefined"!=typeof HTMLCanvasElement&&A instanceof HTMLImageElement)return D=A,{element:o=document.createElement("canvas"),options:(0,C.default)(D),renderer:Q.default.CanvasRenderer,afterRender:function(){D.setAttribute("src",o.toDataURL())}};if(A&&A.nodeName&&"svg"===A.nodeName.toLowerCase()||"undefined"!=typeof SVGElement&&A instanceof SVGElement)return{element:A,options:(0,C.default)(A),renderer:Q.default.SVGRenderer};if("undefined"!=typeof HTMLCanvasElement&&A instanceof HTMLCanvasElement)return{element:A,options:(0,C.default)(A),renderer:Q.default.CanvasRenderer};if(A&&A.getContext)return{element:A,renderer:Q.default.CanvasRenderer};if(A&&"object"===(void 0===A?"undefined":B(A))&&!A.nodeName)return{element:A,renderer:Q.default.ObjectRenderer};throw new E.InvalidElementException;var D,o}I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=Q(g(78)),C=Q(g(79));function Q(A){return A&&A.__esModule?A:{default:A}}I.default=function(A){var I={};for(var g in C.default)C.default.hasOwnProperty(g)&&(A.hasAttribute("jsbarcode-"+g.toLowerCase())&&(I[g]=A.getAttribute("jsbarcode-"+g.toLowerCase())),A.hasAttribute("data-"+g.toLowerCase())&&(I[g]=A.getAttribute("data-"+g.toLowerCase())));return I.value=A.getAttribute("jsbarcode-value")||A.getAttribute("data-value"),I=(0,B.default)(I)}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.default=function(A){var I=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var g in I)I.hasOwnProperty(g)&&"string"==typeof A[g=I[g]]&&(A[g]=parseInt(A[g],10));"string"==typeof A.displayValue&&(A.displayValue="false"!=A.displayValue);return A}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};I.default=B},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=E(g(81)),C=E(g(83)),Q=E(g(84));function E(A){return A&&A.__esModule?A:{default:A}}I.default={CanvasRenderer:B.default,SVGRenderer:C.default,ObjectRenderer:Q.default}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(73),E=(B=Q)&&B.__esModule?B:{default:B},D=g(82);var i=function(){function A(I,g,B){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,A),this.canvas=I,this.encodings=g,this.options=B}return C(A,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var A=0;A<this.encodings.length;A++){var I=(0,E.default)(this.options,this.encodings[A].options);this.drawCanvasBarcode(I,this.encodings[A]),this.drawCanvasText(I,this.encodings[A]),this.moveCanvasDrawing(this.encodings[A])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var A=this.canvas.getContext("2d");A.save(),(0,D.calculateEncodingAttributes)(this.encodings,this.options,A);var I=(0,D.getTotalWidthOfEncodings)(this.encodings),g=(0,D.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=I+this.options.marginLeft+this.options.marginRight,this.canvas.height=g,A.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(A.fillStyle=this.options.background,A.fillRect(0,0,this.canvas.width,this.canvas.height)),A.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(A,I){var g,B=this.canvas.getContext("2d"),C=I.data;g="top"==A.textPosition?A.marginTop+A.fontSize+A.textMargin:A.marginTop,B.fillStyle=A.lineColor;for(var Q=0;Q<C.length;Q++){var E=Q*A.width+I.barcodePadding;"1"===C[Q]?B.fillRect(E,g,A.width,A.height):C[Q]&&B.fillRect(E,g,A.width,A.height*C[Q])}}},{key:"drawCanvasText",value:function(A,I){var g,B,C=this.canvas.getContext("2d"),Q=A.fontOptions+" "+A.fontSize+"px "+A.font;A.displayValue&&(B="top"==A.textPosition?A.marginTop+A.fontSize-A.textMargin:A.height+A.textMargin+A.marginTop+A.fontSize,C.font=Q,"left"==A.textAlign||I.barcodePadding>0?(g=0,C.textAlign="left"):"right"==A.textAlign?(g=I.width-1,C.textAlign="right"):(g=I.width/2,C.textAlign="center"),C.fillText(I.text,g,B))}},{key:"moveCanvasDrawing",value:function(A){this.canvas.getContext("2d").translate(A.width,0)}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore()}}]),A}();I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.getTotalWidthOfEncodings=I.calculateEncodingAttributes=I.getBarcodePadding=I.getEncodingHeight=I.getMaximumHeightOfEncodings=void 0;var B,C=g(73),Q=(B=C)&&B.__esModule?B:{default:B};function E(A,I){return I.height+(I.displayValue&&A.text.length>0?I.fontSize+I.textMargin:0)+I.marginTop+I.marginBottom}function D(A,I,g){if(g.displayValue&&I<A){if("center"==g.textAlign)return Math.floor((A-I)/2);if("left"==g.textAlign)return 0;if("right"==g.textAlign)return Math.floor(A-I)}return 0}function i(A,I,g){var B;if(g)B=g;else{if("undefined"==typeof document)return 0;B=document.createElement("canvas").getContext("2d")}B.font=I.fontOptions+" "+I.fontSize+"px "+I.font;var C=B.measureText(A);return C?C.width:0}I.getMaximumHeightOfEncodings=function(A){for(var I=0,g=0;g<A.length;g++)A[g].height>I&&(I=A[g].height);return I},I.getEncodingHeight=E,I.getBarcodePadding=D,I.calculateEncodingAttributes=function(A,I,g){for(var B=0;B<A.length;B++){var C,o=A[B],w=(0,Q.default)(I,o.options);C=w.displayValue?i(o.text,w,g):0;var F=o.data.length*w.width;o.width=Math.ceil(Math.max(C,F)),o.height=E(o,w),o.barcodePadding=D(C,F,w)}},I.getTotalWidthOfEncodings=function(A){for(var I=0,g=0;g<A.length;g++)I+=A[g].width;return I}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(73),E=(B=Q)&&B.__esModule?B:{default:B},D=g(82);var i="http://www.w3.org/2000/svg",o=function(){function A(I,g,B){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,A),this.svg=I,this.encodings=g,this.options=B,this.document=B.xmlDocument||document}return C(A,[{key:"render",value:function(){var A=this.options.marginLeft;this.prepareSVG();for(var I=0;I<this.encodings.length;I++){var g=this.encodings[I],B=(0,E.default)(this.options,g.options),C=this.createGroup(A,B.marginTop,this.svg);this.setGroupOptions(C,B),this.drawSvgBarcode(C,B,g),this.drawSVGText(C,B,g),A+=g.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,D.calculateEncodingAttributes)(this.encodings,this.options);var A=(0,D.getTotalWidthOfEncodings)(this.encodings),I=(0,D.getMaximumHeightOfEncodings)(this.encodings),g=A+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(g,I),this.options.background&&this.drawRect(0,0,g,I,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(A,I,g){var B,C=g.data;B="top"==I.textPosition?I.fontSize+I.textMargin:0;for(var Q=0,E=0,D=0;D<C.length;D++)E=D*I.width+g.barcodePadding,"1"===C[D]?Q++:Q>0&&(this.drawRect(E-I.width*Q,B,I.width*Q,I.height,A),Q=0);Q>0&&this.drawRect(E-I.width*(Q-1),B,I.width*Q,I.height,A)}},{key:"drawSVGText",value:function(A,I,g){var B,C,Q=this.document.createElementNS(i,"text");I.displayValue&&(Q.setAttribute("style","font:"+I.fontOptions+" "+I.fontSize+"px "+I.font),C="top"==I.textPosition?I.fontSize-I.textMargin:I.height+I.textMargin+I.fontSize,"left"==I.textAlign||g.barcodePadding>0?(B=0,Q.setAttribute("text-anchor","start")):"right"==I.textAlign?(B=g.width-1,Q.setAttribute("text-anchor","end")):(B=g.width/2,Q.setAttribute("text-anchor","middle")),Q.setAttribute("x",B),Q.setAttribute("y",C),Q.appendChild(this.document.createTextNode(g.text)),A.appendChild(Q))}},{key:"setSvgAttributes",value:function(A,I){var g=this.svg;g.setAttribute("width",A+"px"),g.setAttribute("height",I+"px"),g.setAttribute("x","0px"),g.setAttribute("y","0px"),g.setAttribute("viewBox","0 0 "+A+" "+I),g.setAttribute("xmlns",i),g.setAttribute("version","1.1"),g.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(A,I,g){var B=this.document.createElementNS(i,"g");return B.setAttribute("transform","translate("+A+", "+I+")"),g.appendChild(B),B}},{key:"setGroupOptions",value:function(A,I){A.setAttribute("style","fill:"+I.lineColor+";")}},{key:"drawRect",value:function(A,I,g,B,C){var Q=this.document.createElementNS(i,"rect");return Q.setAttribute("x",A),Q.setAttribute("y",I),Q.setAttribute("width",g),Q.setAttribute("height",B),C.appendChild(Q),Q}}]),A}();I.default=o},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}();var C=function(){function A(I,g,B){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,A),this.object=I,this.encodings=g,this.options=B}return B(A,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),A}();I.default=C},function(A,I,g){"use strict";function B(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}function C(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}function Q(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}Object.defineProperty(I,"__esModule",{value:!0});var E=function(A){function I(A,g){B(this,I);var Q=C(this,(I.__proto__||Object.getPrototypeOf(I)).call(this));return Q.name="InvalidInputException",Q.symbology=A,Q.input=g,Q.message='"'+Q.input+'" is not a valid input for '+Q.symbology,Q}return Q(I,Error),I}(),D=function(A){function I(){B(this,I);var A=C(this,(I.__proto__||Object.getPrototypeOf(I)).call(this));return A.name="InvalidElementException",A.message="Not supported type to render on",A}return Q(I,Error),I}(),i=function(A){function I(){B(this,I);var A=C(this,(I.__proto__||Object.getPrototypeOf(I)).call(this));return A.name="NoElementException",A.message="No element to render on.",A}return Q(I,Error),I}();I.InvalidInputException=E,I.InvalidElementException=D,I.NoElementException=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}();var C=function(){function A(I){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,A),this.api=I}return B(A,[{key:"handleCatch",value:function(A){if("InvalidInputException"!==A.name)throw A;if(this.api._options.valid===this.api._defaults.valid)throw A.message;this.api._options.valid(!1),this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(A){try{var I=A.apply(void 0,arguments);return this.api._options.valid(!0),I}catch(A){return this.handleCatch(A),this.api}}}]),A}();I.default=C},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdCanvasRender",(function(){return M}));var B=g(6),C=g.n(B),Q=g(5),E=g.n(Q),D=g(1),i=g.n(D),o=g(7),w=g.n(o),F=g(31),G=g(32),N=g(35),y=g(30);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 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,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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}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 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,Q,D,o,R,M,U,c;return i()(A,[{key:"setOfdCore",value:function(A){this.core=A,this.render.setOfdCore(this.core)}},{key:"renderPageByCanvas",value:(c=C()(w.a.mark((function A(I,g,B,C,Q,E){var D,i,o,y,R,M,U,c,s,a,Y,S,k,K,H,L,J,t,d,e,n,l,r,Z,q,f,W,x,p,b,V,m,T,j,X,O,u,z,P,v;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(D=Q?Q.readOfdDocument(B):this.core.readOfdDocument(B),i=Q?Q.readOfdPage(B,C):this.core.readOfdPage(B,C),o=i.Page.Template,D.Annotations,y=Q?Q.readOfdTemplatePage(B):this.core.readOfdTemplatePage(B),R=D.Signatures?D.Signatures.Signature:[],M=D.CommonData.Res.Fonts,U=D.CommonData.Res.DrawParams,D.CommonData.Res.ColorSpaces,c=D.CommonData.Res.CompositeGraphicUnits,s=D.CommonData.Res.MultiMedias,!o){A.next=64;break}a=h(o),A.prev=13,a.s();case 15:if((Y=a.n()).done){A.next=56;break}S=Y.value,k=h(y),A.prev=18,k.s();case 20:if((K=k.n()).done){A.next=46;break}if((H=K.value).ID!=S.TemplateID){A.next=44;break}if(!(H=Q?Q.readPageFromTemplate(H):this.core.readPageFromTemplate(H)).Page.Content){A.next=43;break}L=H.Page.Content.Layer,J=h(L),A.prev=27,J.s();case 29:if((t=J.n()).done){A.next=35;break}return d=t.value,A.next=33,this.renderLayerByCanvas(E,I,g,M,U,s,c,d,!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),k.e(A.t1);case 51:return A.prev=51,k.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),a.e(A.t2);case 61:return A.prev=61,a.f(),A.finish(61);case 64:if(!i.Page.Content){A.next=83;break}e=i.Page.Content.Layer,n=h(e),A.prev=67,n.s();case 69:if((l=n.n()).done){A.next=75;break}return r=l.value,A.next=73,this.renderLayerByCanvas(E,I,g,M,U,s,c,r,!1);case 73:A.next=69;break;case 75:A.next=80;break;case 77:A.prev=77,A.t3=A.catch(67),n.e(A.t3);case 80:return A.prev=80,n.f(),A.finish(80);case 83:Z=h(R),A.prev=84,Z.s();case 86:if((q=Z.n()).done){A.next=134;break}f=q.value,W=h(f.Signature.SignedInfo.StampAnnot),A.prev=89,W.s();case 91:if((x=W.n()).done){A.next=124;break}if(p=x.value,b=p.PageRef,i.ID!=b){A.next=122;break}if(V=p.Boundary,!(f.Signature.PicType&&f.Signature.PicType.length>0)){A.next=122;break}if("ofd"!==f.Signature.PicType){A.next=108;break}m=new N.Ofd_Core(f.Signature.ofd,this.coreHelper.dpi),T=0;case 100:if(!(T<m.getOFDPageCount(0))){A.next=106;break}return A.next=103,this.renderSealPageOnCanvas(I,g,T,m,!0,V,b,p.ID,C,f.Signature.ZipName);case 103:T++,A.next=100;break;case 106:A.next=122;break;case 108:if("svg"!==f.Signature.PicType){A.next=114;break}return j="data:image/svg+xml;base64,".concat(f.Signature.PicValue),A.next=112,this.renderSealSvgOnCanvas(I,g,j,V);case 112:A.next=122;break;case 114:return X=V.w,O=V.h,u=Object(F.converterBox)(V,this.coreHelper.dpi),z=Object(G.JSGetImageInfoByBase64)(f.Signature.PicValue),P=z.fileBase64,v={a:X,b:0,c:0,d:O,e:0,f:0},A.next=122,this.renderImageOnCanvas(I,g,P,z.width,z.height,u,p.Clip,!0,b,p.ID,v);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),Z.e(A.t5);case 139:return A.prev=139,Z.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,C,Q){return c.apply(this,arguments)})},{key:"renderAnnotationOnCanvas",value:(U=C()(w.a.mark((function A(I,g,B,C,Q,E,D){var i,o,G,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 G=Object(F.converterBox)(o,this.coreHelper.dpi),(N=document.createElement("canvas")).style.height="".concat(G.w,"px"),N.style.width="".concat(G.h,"px"),N.width=G.w,N.height=G.h,y=N.getContext("2d"),A.next=14,this.renderLayerByCanvas(zipName,N,y,C,Q,E,D,i,!1);case 14:g.drawImage(N,G.x,G.y);case 15:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,C,Q,E){return U.apply(this,arguments)})},{key:"renderSealSvgOnCanvas",value:(M=C()(w.a.mark((function A(I,g,B,C,Q,E){var D;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return D=Object(F.converterBox)(C,this.coreHelper.dpi),A.abrupt("return",new Promise((function(A,I){var C=new Image;C.src=B,C.onload=function(){var I=C.width,B=C.height,Q=document.createElement("canvas");if(Q.style.height="".concat(I,"px"),Q.style.width="".concat(B,"px"),Q.width=I,Q.height=B,Q.getContext("2d").drawImage(C,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(Q,0,0),g.drawImage(i,D.x,D.y)}else g.drawImage(Q,D.x,D.y);A()}})));case 2:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,C,Q){return M.apply(this,arguments)})},{key:"renderSealPageOnCanvas",value:(R=C()(w.a.mark((function A(I,g,B,C,Q,E,D,i,o,G){var N,y,h,R,M,U,c,s,a,Y;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return N={x:0,y:0,w:0,h:0},N=E,y={x:E.x,y:E.y,w:C.pageWidth(0,B),h:C.pageHeight(0,B)},h=Object(F.converterBox)(y,this.coreHelper.dpi),R=1,(M=document.createElement("canvas")).style.height="".concat(h.w,"px"),M.style.width="".concat(h.h,"px"),M.width=h.w,M.height=h.h,U=M.getContext("2d"),A.next=13,this.renderPageByCanvas(M,U,0,B,C,G);case 13:U.scale(R,R),y.w!==N.w?(c=N.h/y.h<N.w/y.w?N.h/y.h:N.w/y.w,s=document.createElement("canvas"),a=Object(F.converterBox)(N,this.coreHelper.dpi),s.style.height="".concat(a.w,"px"),s.style.width="".concat(a.h,"px"),s.width=a.w,s.height=a.h,(Y=s.getContext("2d")).scale(c,c),Y.drawImage(M,0,0),g.drawImage(s,h.x,h.y)):g.drawImage(M,h.x,h.y);case 15:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,C,Q,E,D,i,o){return R.apply(this,arguments)})},{key:"renderLayerByCanvas",value:(o=C()(w.a.mark((function A(I,g,B,C,Q,E,D,i,o,G,N,y){var R,M,U,c,s,a,Y,S,k,K,H,L,J,t,d;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(R=null,M=null,U=Object(F.converterDpi)(.353,this.coreHelper.dpi),(c=i.DrawParam)&&Object(F.getDrawParam)(Q,c)&&(s=Object(F.getDrawParam)(Q,c),Object(F.getDrawParam)(Q,s.Relative)&&(s=Object(F.getDrawParam)(Q,s.Relative)),s.FillColor&&(R=Object(F.parseColor)(s.FillColor.Value)),s.StrokeColor&&(R=Object(F.parseColor)(s.StrokeColor.Value)),s.LineWidth&&(U=Object(F.converterDpi)(s.LineWidth,this.coreHelper.dpi))),!(a=i.PageBlock)){A.next=60;break}Y=h(a),A.prev=8,Y.s();case 10:if((S=Y.n()).done){A.next=52;break}if("ImageObject"!=(k=S.value).Type){A.next=17;break}return A.next=15,this.renderImageObject(I,g,B,E,k,o,N,y);case 15:A.next=50;break;case 17:if("PathObject"!=k.Type){A.next=22;break}return A.next=20,this.renderPathObject(I,g,B,Q,k,R,M,U,o,G,N,y,E,C);case 20:A.next=50;break;case 22:if("TextObject"!=k.Type){A.next=27;break}return A.next=25,this.renderTextObject(g,B,C,k,R,M,Q,G,N,y);case 25:A.next=50;break;case 27:if("CompositeObject"!=k.Type){A.next=50;break}K=h(D),A.prev=29,K.s();case 31:if((H=K.n()).done){A.next=42;break}if((L=H.value).ID!==k.ResourceID){A.next=40;break}return J=k.Alpha,t=k.Boundary,d=k.CTM,A.next=39,this.renderLayerByCanvas(I,g,B,C,Q,E,D,L,!1,J,t,d);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),K.e(A.t0);case 47:return A.prev=47,K.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),Y.e(A.t1);case 57:return A.prev=57,Y.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,C,Q,E,D,i,w,F,G){return o.apply(this,arguments)})},{key:"renderImageObject",value:(D=C()(w.a.mark((function A(I,g,B,C,Q,E,D,i){var o,N,y,h,R,M,U,c,s;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(o=Q.Boundary,o=Object(F.converterBox)(o,this.coreHelper.dpi),N=Q.ResourceID){A.next=5;break}return A.abrupt("return");case 5:if((y=Object(F.getMultiMedia)(C,N)).MediaFile){A.next=8;break}return A.abrupt("return",null);case 8:if((h=Q.ImageMask)>0&&(R=Object(F.getMultiMedia)(C,h)).MediaFile&&(R.width>0||R.height>0||!R.MediaFile||((M=Object(G.JSGetImageInfoByPath)(this.core.ofdParserPtr,R.MediaFile,R.MediaFileResPln,this.core.getDocPln(0),I)).ext,R.width=M.width,R.height=M.height,R.FileBase64=M.fileBase64)),y.width>0||y.height>0||!y.MediaFile){A.next=17;break}if("other"!==(U=Object(G.JSGetImageInfoByPath)(this.core.ofdParserPtr,y.MediaFile,y.MediaFileResPln,this.core.getDocPln(0),I)).ext){A.next=14;break}return A.abrupt("return",null);case 14:y.width=U.width,y.height=U.height,y.FileBase64=U.fileBase64;case 17:return c=Q.CTM,s=Q.Clips,A.next=21,this.renderImageOnCanvas(g,B,y.FileBase64,y.width,y.height,o,!1,E,null,null,c,D,i,s);case 21:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,C,Q,E,i){return D.apply(this,arguments)})},{key:"renderImageOnCanvas",value:(Q=C()(w.a.mark((function A(I,g,B,C,Q,E,D,i,o,G,N,y,R,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=C,o.height=Q;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/C/Object(F.ctmImageScale)(w.coreHelper.dpi),N.b/C/Object(F.ctmImageScale)(w.coreHelper.dpi),N.c/Q/Object(F.ctmImageScale)(w.coreHelper.dpi),N.d/Q/Object(F.ctmImageScale)(w.coreHelper.dpi),Object(F.converterDpi)(N.e,w.coreHelper.dpi),Object(F.converterDpi)(N.f,w.coreHelper.dpi)),B.drawImage(o,0,0);var G=document.createElement("canvas"),U=Object(F.converterBox)(y,w.coreHelper.dpi),c=U.w,s=U.h,a=U.x,Y=U.y;G.width=c,G.height=s,G.style.width="".concat(c,"px"),G.style.height="".concat(s,"px");var S=G.getContext("2d");R&&S.transform(R.a,R.b,R.c,R.d,Object(F.converterDpi)(R.e,w.coreHelper.dpi),Object(F.converterDpi)(R.f,w.coreHelper.dpi)),S.drawImage(I,D,i),g.drawImage(G,a,Y)}else{var k=document.createElement("canvas");k.width=Math.ceil(E.w),k.height=Math.ceil(E.h),k.style.width="".concat(Math.ceil(E.w),"px"),k.style.height="".concat(Math.ceil(E.h),"px");var K=k.getContext("2d");if(M&&M.length>0)for(var H=0;H<M.length;H++)for(var L=M[H].Clip,J=0;J<L.length;J++){var t=L[J].Area,d=void 0;t.CTM?d=t.CTM:N&&(d=N),K.beginPath();var e,n=h(t.Path.AbbreviatedData);try{for(n.s();!(e=n.n()).done;){var l=e.value;if("M"===l.cmd||"S"===l.cmd){var r=l.crds[0],Z=l.crds[1];if(d){var q=w.ctmCalPoint(r,Z,d);r=q.ctmX,Z=q.ctmY}K.moveTo(Object(F.converterDpi)(r,w.coreHelper.dpi),Object(F.converterDpi)(Z,w.coreHelper.dpi))}else if("L"===l.cmd){var f=l.crds[0],W=l.crds[1];if(d){var x=w.ctmCalPoint(f,W,d);f=x.ctmX,W=x.ctmY}K.lineTo(Object(F.converterDpi)(f,w.coreHelper.dpi),Object(F.converterDpi)(W,w.coreHelper.dpi))}else if("B"===l.cmd){var p=l.crds[0],b=l.crds[1],V=l.crds[2],m=l.crds[3],T=l.crds[4],j=l.crds[5];if(d){var X=w.ctmCalPoint(p,b,d);p=X.ctmX,b=X.ctmY;var O=w.ctmCalPoint(V,m,d);V=O.ctmX,m=O.ctmY;var u=w.ctmCalPoint(T,j,d);T=u.ctmX,j=u.ctmY}K.bezierCurveTo(Object(F.converterDpi)(p,w.coreHelper.dpi),Object(F.converterDpi)(b,w.coreHelper.dpi),Object(F.converterDpi)(V,w.coreHelper.dpi),Object(F.converterDpi)(m,w.coreHelper.dpi),Object(F.converterDpi)(T,w.coreHelper.dpi),Object(F.converterDpi)(j,w.coreHelper.dpi))}else if("Q"===l.cmd){var z=l.crds[0],P=l.crds[1],v=l.crds[2],_=l.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(F.converterDpi)(z,w.coreHelper.dpi),Object(F.converterDpi)(P,w.coreHelper.dpi),Object(F.converterDpi)(v,w.coreHelper.dpi),Object(F.converterDpi)(_,w.coreHelper.dpi))}else"A"===l.cmd||"C"===l.cmd&&K.closePath()}}catch(A){n.e(A)}finally{n.f()}K.clip()}N&&K.transform(N.a/C/Object(F.ctmImageScale)(w.coreHelper.dpi),N.b/C/Object(F.ctmImageScale)(w.coreHelper.dpi),N.c/Q/Object(F.ctmImageScale)(w.coreHelper.dpi),N.d/Q/Object(F.ctmImageScale)(w.coreHelper.dpi),Object(F.converterDpi)(N.e,w.coreHelper.dpi),Object(F.converterDpi)(N.f,w.coreHelper.dpi)),K.drawImage(o,0,0),g.drawImage(k,D,i)}A()}})));case 5:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,C,E,D,i,o,w,F,G,N,y){return Q.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=C()(w.a.mark((function A(I,g,B,C,Q,E,D,i,o,G,N,y,R,M){var U,c,s,a,Y,S,k,K,H,L,J,t,d,e,n,l,r,Z,q,f,W,x,p,b,V,m,T,j,X,O,u,z,P,v,_,$,AA,IA,gA,BA,CA,QA,EA,DA,iA,oA,wA,FA,GA,NA,yA,hA,RA,MA,UA,cA,sA,aA,YA,SA,kA,KA,HA,LA,JA,tA,dA,eA,nA,lA,rA,ZA;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(U=Q.Boundary){A.next=3;break}return A.abrupt("return");case 3:if(c=1,U=Object(F.converterBox)(U,this.coreHelper.dpi),s=Math.ceil(U.w),a=Math.ceil(U.h),Y=U.x,S=U.y,s-0!=0&&a-0!=0){A.next=11;break}return A.abrupt("return");case 11:if(k=document.createElement("canvas"),K=k.getContext("2d"),k.width=s*c,k.height=a*c,k.style.width="".concat(s,"px"),k.style.height="".concat(a,"px"),H=Q.LineWidth,L=Q.AbbreviatedData,J=Q.CTM,t=Q.StrokeColor,d=Q.FillColor,H&&(i=Object(F.converterDpi)(H,this.coreHelper.dpi)),(e=Q.DrawParam)&&(n=Object(F.getDrawParam)(C,e),(H=n.LineWidth)&&(i=Object(F.converterDpi)(H,this.coreHelper.dpi)),n.FillColor&&(d&&d.Value||(d=n.FillColor)),n.StrokeColor&&(t&&t.Value||(t=n.StrokeColor))),J&&K.transform(J.a,J.b,J.c,J.d,Object(F.converterDpi)(J.e,this.coreHelper.dpi),Object(F.converterDpi)(J.f,this.coreHelper.dpi)),l=!1,t&&(t.Value&&(D=Object(F.parseColor)(t.Value)),r=t.axialShd)){l=!0,Z=Object(F.parseCtm)(r.StartPoint),q=Object(F.parseCtm)(r.EndPoint),f=K.createLinearGradient(Z[0],Z[1],q[0],q[1]),W=h(r.Segment);try{for(W.s();!(x=W.n()).done;)(p=x.value)&&f.addColorStop(p.position,Object(F.parseColor)(p.color.Value))}catch(A){W.e(A)}finally{W.f()}K.lineWidth=i,K.strokeStyle=f}if(b=!1,d&&(d.Value&&(E=Object(F.parseColor)(d.Value)),d.Alpha&&0===d.Alpha&&(K.globalAlpha=0),V=d.AxialShd)){b=!0,m=Object(F.parseCtm)(V.StartPoint),T=Object(F.parseCtm)(V.EndPoint),j=K.createLinearGradient(m[0],m[1],T[0],T[1]),X=h(V.Segment);try{for(X.s();!(O=X.n()).done;)(u=O.value)&&j.addColorStop(u.position,Object(F.parseColor)(u.color.Value))}catch(A){X.e(A)}finally{X.f()}K.fillStyle=j}if(i>0&&!D&&((D=E)||(D="rgb(0, 0, 0)")),(z=Q.Clips)&&z.length>0)for(P=[],v=0;v<z.length;v++){for(_=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),$=z[v],AA=$.Clip,IA=0;IA<AA.length;IA++){gA=AA[IA],BA=gA.Area,CA=document.createElementNS("http://www.w3.org/2000/svg","path"),QA=0,EA=0,DA=0,iA=0,BA.Path.Boundary&&(QA=BA.Path.Boundary.x,EA=BA.Path.Boundary.y,DA=BA.Path.Boundary.w,iA=BA.Path.Boundary.h),!BA.TransFlag&&BA.CTM&&(oA=BA.CTM,wA=void 0,wA=J?"matrix(".concat(oA.a," ").concat(oA.b," ").concat(oA.c," ").concat(oA.d," ").concat(Object(F.converterDpi)(oA.e-J.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(oA.f-J.f,this.coreHelper.dpi),")"):"matrix(".concat(oA.a," ").concat(oA.b," ").concat(oA.c," ").concat(oA.d," ").concat(Object(F.converterDpi)(oA.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(oA.f,this.coreHelper.dpi),")"),J&&(FA=[[J.a,J.c,0],[J.b,J.d,0],[0,0,1]],GA=Object(F.inv)(FA),isNaN(GA[0][0])||GA[0][0]===1/0||(wA="".concat(wA," matrix(").concat(GA[0][0]," ").concat(GA[1][0]," ").concat(GA[0][1]," ").concat(GA[1][1]," 0 0)"))),CA.setAttribute("transform",wA)),!BA.TransFlag&&BA.Path.CTM&&(NA=BA.Path.CTM,yA="matrix(".concat(NA.a," ").concat(NA.b," ").concat(NA.c," ").concat(NA.d," ").concat(Object(F.converterDpi)(NA.e-J.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(NA.f-J.f,this.coreHelper.dpi),")"),J&&(hA=[[J.a,J.c,0],[J.b,J.d,0],[0,0,1]],RA=Object(F.inv)(hA),isNaN(RA[0][0])||RA[0][0]===1/0||(yA="".concat(yA," matrix(").concat(RA[0][0]," ").concat(RA[1][0]," ").concat(RA[0][1]," ").concat(RA[1][1]," 0 0)"))),CA.setAttribute("transform",yA)),K.beginPath(),MA=h(BA.Path.AbbreviatedData);try{for(MA.s();!(UA=MA.n()).done;)"M"===(cA=UA.value).cmd||"S"===cA.cmd?K.moveTo(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[0],DA)+QA,this.coreHelper.dpi),Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[1],iA)+EA,this.coreHelper.dpi)):"L"===cA.cmd?K.lineTo(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[0],DA)+QA,this.coreHelper.dpi),Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[1],iA)+EA,this.coreHelper.dpi)):"B"===cA.cmd&&K.bezierCurveTo(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[0],DA)+QA,this.coreHelper.dpi),Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[1],iA)+EA,this.coreHelper.dpi),Object(F.converterDpi)(cA.crds[2]+QA,this.coreHelper.dpi),Object(F.converterDpi)(cA.crds[3]+EA,this.coreHelper.dpi),Object(F.converterDpi)(cA.crds[4]+QA,this.coreHelper.dpi),Object(F.converterDpi)(cA.crds[5]+EA,this.coreHelper.dpi))}catch(A){MA.e(A)}finally{MA.f()}K.closePath(),K.clip()}P.push(_)}Q.Join&&K.setLineJoin(Q["@_Join"]),Q.Cap&&K.setLineCap(Q["@_Cap"]),Q.DashPattern&&(sA=Q.DashPattern,aA=Object(F.parseCtm)(sA),Q.DashOffset&&Q.DashOffset,K.setLineDash([Object(F.converterDpi)(aA[0],this.coreHelper.dpi),Object(F.converterDpi)(aA[1],this.coreHelper.dpi)])),K.beginPath(),YA=h(L);try{for(YA.s();!(SA=YA.n()).done;)"M"===(kA=SA.value).cmd||"S"===kA.cmd?K.moveTo(Object(F.converterDpi)(kA.crds[0],this.coreHelper.dpi),Object(F.converterDpi)(kA.crds[1],this.coreHelper.dpi)):"L"===kA.cmd?K.lineTo(Object(F.converterDpi)(kA.crds[0],this.coreHelper.dpi),Object(F.converterDpi)(kA.crds[1],this.coreHelper.dpi)):"B"===kA.cmd?K.bezierCurveTo(Object(F.converterDpi)(kA.crds[0],this.coreHelper.dpi),Object(F.converterDpi)(kA.crds[1],this.coreHelper.dpi),Object(F.converterDpi)(kA.crds[2],this.coreHelper.dpi),Object(F.converterDpi)(kA.crds[3],this.coreHelper.dpi),Object(F.converterDpi)(kA.crds[4],this.coreHelper.dpi),Object(F.converterDpi)(kA.crds[5],this.coreHelper.dpi)):"Q"===kA.cmd?K.quadraticCurveTo(Object(F.converterDpi)(kA.crds[0],this.coreHelper.dpi),Object(F.converterDpi)(kA.crds[1],this.coreHelper.dpi),Object(F.converterDpi)(kA.crds[2],this.coreHelper.dpi),Object(F.converterDpi)(kA.crds[3],this.coreHelper.dpi)):"A"===kA.cmd||"C"===kA.cmd&&K.closePath()}catch(A){YA.e(A)}finally{YA.f()}if(Q.Stroke&&(l||(K.strokeStyle=D,K.lineWidth=i),K.stroke()),KA=d.pattern,!Q.Fill||KA?K.fillStyle="none":(b||(K.fillStyle=E),K.fill(Q.Rule)),!KA){A.next=54;break}return K.save(),HA=document.createElement("canvas"),LA=HA.getContext("2d"),HA.width=Object(F.converterDpi)(KA.width,this.coreHelper.dpi),HA.height=Object(F.converterDpi)(KA.height,this.coreHelper.dpi),A.next=50,this.renderLayerByCanvas(I,HA,LA,M,C,R,null,KA,!1,null,null,null);case 50:JA=K.createPattern(HA,"repeat"),K.fillStyle=JA,K.fillRect(0,0,s,a),K.restore();case 54:N?(tA=document.createElement("canvas"),dA=Object(F.converterBox)(N,this.coreHelper.dpi),eA=dA.w,nA=dA.h,lA=dA.x,rA=dA.y,tA.width=eA*c,tA.height=nA*c,tA.style.width="".concat(eA,"px"),tA.style.height="".concat(nA,"px"),ZA=tA.getContext("2d"),y&&ZA.transform(y.a,y.b,y.c,y.d,Object(F.converterDpi)(y.e,this.coreHelper.dpi),Object(F.converterDpi)(y.f,this.coreHelper.dpi)),G&&(ZA.globalAlpha=G/255),ZA.drawImage(k,Y,S),B.drawImage(tA,lA,rA)):B.drawImage(k,Y,S);case 55:case"end":return A.stop()}}),A,this)}))),function(A,I,g,C,Q,E,D,i,o,w,F,G,N,y){return B.apply(this,arguments)})},{key:"renderTextObject",value:(g=C()(w.a.mark((function A(I,g,B,C,Q,E,D,i,o,N){var y,R,M,U,c,s,a,Y,S,k,K,H,L,J,t,d,e,n,l,r,Z,q,f,W,x,p,b,V,m,T,j,X,O,u,z,P,v,_,$,AA,IA,gA,BA,CA,QA,EA,DA,iA,oA,wA,FA,GA,NA;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(y=1,R=C.Boundary,R=Object(F.converterBox)(R,this.coreHelper.dpi),M=C.CTM,U=C.HScale,c=C.Font,s=C.Weight,a=C.Size>0,M&&!a&&(M={a:-M.a,b:M.b,c:M.c,d:-M.d,e:-M.e,f:-M.f}),Y=Object(F.converterDpi)(Math.abs(parseFloat(C.Size)),this.coreHelper.dpi),S=Object(F.calTextPoint)(this.coreHelper.dpi,C.TextCode,C.CGTransform,M,C.Boundary,o,N,a),(k=document.createElementNS("http://www.w3.org/2000/svg","svg")).setAttribute("xmlns","http://www.w3.org/2000/svg"),k.setAttribute("version","1.1"),K=C.FillColor,H=!1,(L=C.DrawParam)&&(J=Object(F.getDrawParam)(D,L)).FillColor&&(K&&K.Value||(K=J.FillColor)),K&&(K.Value&&(Q=Object(F.parseColor)(K.Value)),t=K.alpha,y=t/255,d=K.axialShd)){H=!0,(e=document.createElementNS("http://www.w3.org/2000/svg","linearGradient")).setAttribute("id","".concat(C.ID)),e.setAttribute("x1","0%"),e.setAttribute("y1","0%"),e.setAttribute("x2","100%"),e.setAttribute("y2","100%"),n=h(d.Segment);try{for(n.s();!(l=n.n()).done;)(r=l.value)&&((Z=document.createElement("stop")).setAttribute("offset","".concat(100*r.position,"%")),Z.setAttribute("style","stop-color:".concat(Object(F.parseColor)(r.color.Value),";stop-opacity:1")),e.appendChild(Z),Q=Object(F.parseColor)(r.color.Value))}catch(A){n.e(A)}finally{n.f()}k.appendChild(e)}C.Fill||(y=0),q=R.w,f=R.h,W=R.x,x=R.y,p=Y,b=Y,V=0,M&&(m=M.a,T=M.b,j=M.c,X=M.d,O=m>0?Math.sign(m)*Math.sqrt(m*m+j*j):Math.sqrt(m*m+j*j),u=X>0?Math.sign(X)*Math.sqrt(T*T+X*X):Math.sqrt(T*T+X*X),0==(V=Math.atan2(-T,X))&&0!=m&&1==X||(p*=O,b*=u),0==V&&U-0==1&&(U=m/X)>0&&(p*=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==(V=Math.atan2(-P,_))&&0!=z&&1==_||(p*=$,b*=AA,x*=AA,W*=$,q*=$,f*=AA)),IA=Object(F.getFont)(B,c),gA=h(S),A.prev=31,gA.s();case 33:if((BA=gA.n()).done){A.next=73;break}if(!(CA=BA.value)||isNaN(CA.x)){A.next=71;break}if(!(CA.glyph&&IA&&IA.face&&M&&M.b>=0&&C.Fill)){A.next=59;break}if(!IA||!IA.face){A.next=57;break}if(QA=Object(G.loadFaceInfo)(IA.face),EA=Object(G.FT_Glyph_Get_Measure)(IA.face,CA.glyph),(DA=this.render.drawGlyph(EA.glyphPath,EA.horiUnderlinePosition,QA.units_per_EM,p,b,E||Q,y)).img.setAttribute("style","width: ".concat(Math.ceil(p),"px; height:").concat(Math.ceil(b),"px")),iA="data:image/svg+xml;base64,".concat(Object(G.base64Encode)(DA.img.outerHTML)),0!==V){A.next=48;break}return A.next=46,this.drawTextFromSvg(I,g,iA,Math.ceil(CA.cx),CA.cy-DA.yScale*EA.horiUnderlinePosition-b);case 46:A.next=57;break;case 48:return(oA=document.createElement("canvas")).style.width="".concat(Math.ceil(p),"px"),oA.style.height="".concat(Math.ceil(b),"px"),oA.width=Math.ceil(p),oA.height=Math.ceil(b),wA=oA.getContext("2d"),A.next=56,this.drawTextFromSvg(oA,wA,iA,0,0,V,Math.ceil(p)/2,Math.ceil(b)/2);case 56:g.drawImage(oA,Math.ceil(CA.cx),CA.cy-DA.yScale*EA.horiUnderlinePosition-b);case 57:A.next=71;break;case 59:(FA=document.createElementNS("http://www.w3.org/2000/svg","text")).setAttribute("x",CA.x),FA.setAttribute("y",CA.y),FA.innerHTML=CA.text,GA="",M&&(GA="matrix(".concat(M.a," ").concat(M.b," ").concat(M.c," ").concat(M.d," ").concat(Object(F.converterDpi)(M.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(M.f,this.coreHelper.dpi),")")),N&&(GA="".concat(GA," matrix(").concat(N.a," ").concat(N.b," ").concat(N.c," ").concat(N.d," ").concat(Object(F.converterDpi)(N.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(N.f,this.coreHelper.dpi),")")),U&&(GA="".concat(GA," matrix(").concat(U,", 0, 0, 1, ").concat((1-U)*CA.x,", 0)")),FA.setAttribute("transform",GA),H?FA.setAttribute("fill",Q):(FA.setAttribute("fill",E),FA.setAttribute("fill",Q),FA.setAttribute("fill-opacity",y)),FA.setAttribute("style","font-weight: ".concat(s,";font-size:").concat(Y,"px;font-family: ").concat(Object(F.getFontFamily)(IA),";")),k.appendChild(FA);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 k.setAttribute("style","overflow:visible;width:".concat(q,"px;height:").concat(f,"px")),NA="data:image/svg+xml;base64,".concat(Object(G.base64Encode)(k.outerHTML)),A.next=85,this.drawTextFromSvg(I,g,NA,W,x);case 85:case"end":return A.stop()}}),A,this,[[31,75,78,81]])}))),function(A,I,B,C,Q,E,D,i,o,w){return g.apply(this,arguments)})},{key:"drawTextFromSvg",value:(I=C()(w.a.mark((function A(I,g,B,C,Q,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,C,Q),A()}})));case 1:case"end":return A.stop()}}),A)}))),function(A,g,B,C,Q,E,D,i){return I.apply(this,arguments)})}]),A}()},function(A,I,g){"use strict";g.r(I),function(A){g.d(I,"AbortException",(function(){return oA})),g.d(I,"AnnotationActionEventType",(function(){return p})),g.d(I,"AnnotationBorderStyleType",(function(){return x})),g.d(I,"AnnotationEditorParamsType",(function(){return e})),g.d(I,"AnnotationEditorPrefix",(function(){return t})),g.d(I,"AnnotationEditorType",(function(){return d})),g.d(I,"AnnotationFieldFlag",(function(){return W})),g.d(I,"AnnotationFlag",(function(){return f})),g.d(I,"AnnotationMode",(function(){return J})),g.d(I,"AnnotationPrefix",(function(){return dA})),g.d(I,"AnnotationReplyType",(function(){return q})),g.d(I,"AnnotationType",(function(){return Z})),g.d(I,"assert",(function(){return $})),g.d(I,"BaseException",(function(){return gA})),g.d(I,"BASELINE_FACTOR",(function(){return H})),g.d(I,"bytesToString",(function(){return wA})),g.d(I,"CMapCompressionType",(function(){return T})),g.d(I,"createValidAbsoluteUrl",(function(){return AA})),g.d(I,"DocumentActionEventType",(function(){return b})),g.d(I,"FeatureTest",(function(){return hA})),g.d(I,"FONT_IDENTITY_MATRIX",(function(){return Y})),g.d(I,"FontRenderOps",(function(){return eA})),g.d(I,"FormatError",(function(){return iA})),g.d(I,"getModificationDate",(function(){return KA})),g.d(I,"getUuid",(function(){return tA})),g.d(I,"getVerbosityLevel",(function(){return z})),g.d(I,"IDENTITY_MATRIX",(function(){return a})),g.d(I,"ImageKind",(function(){return r})),g.d(I,"info",(function(){return P})),g.d(I,"InvalidPDFException",(function(){return QA})),g.d(I,"isArrayEqual",(function(){return kA})),g.d(I,"isNodeJS",(function(){return s})),g.d(I,"LINE_DESCENT_FACTOR",(function(){return K})),g.d(I,"LINE_FACTOR",(function(){return k})),g.d(I,"MAX_IMAGE_SIZE_TO_CACHE",(function(){return S})),g.d(I,"MissingPDFException",(function(){return EA})),g.d(I,"normalizeUnicode",(function(){return JA})),g.d(I,"objectFromMap",(function(){return yA})),g.d(I,"objectSize",(function(){return NA})),g.d(I,"OPS",(function(){return j})),g.d(I,"PageActionEventType",(function(){return V})),g.d(I,"PasswordException",(function(){return BA})),g.d(I,"PasswordResponses",(function(){return X})),g.d(I,"PermissionFlag",(function(){return n})),g.d(I,"RenderingIntentFlag",(function(){return L})),g.d(I,"setVerbosityLevel",(function(){return u})),g.d(I,"shadow",(function(){return IA})),g.d(I,"string32",(function(){return GA})),g.d(I,"stringToBytes",(function(){return FA})),g.d(I,"stringToPDFString",(function(){return aA})),g.d(I,"stringToUTF8String",(function(){return YA})),g.d(I,"TextRenderingMode",(function(){return l})),g.d(I,"UnexpectedResponseException",(function(){return DA})),g.d(I,"UnknownErrorException",(function(){return CA})),g.d(I,"unreachable",(function(){return _})),g.d(I,"utf8StringToString",(function(){return SA})),g.d(I,"Util",(function(){return MA})),g.d(I,"VerbosityLevel",(function(){return m})),g.d(I,"warn",(function(){return v}));var B,C=g(23),Q=g.n(C),E=g(1),D=g.n(E),i=g(5),o=g.n(i),w=g(16),F=g.n(w),G=g(18),N=g.n(G),y=g(15),h=g.n(y);function R(A,I,g){return function(A,I){if(A!==I)throw new TypeError("Private static access of wrong provenance")}(A,I),g}function M(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 U(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 U(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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}function U(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}function c(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=h()(A);if(I){var C=h()(this).constructor;g=Reflect.construct(B,arguments,C)}else g=B.apply(this,arguments);return N()(this,g)}}var s=("undefined"==typeof PDFJSDev||PDFJSDev.test("GENERIC"))&&"object"==typeof A&&A+""=="[object process]"&&!A.versions.nw&&!(A.versions.electron&&A.type&&"browser"!==A.type),a=[1,0,0,1,0,0],Y=[.001,0,0,.001,0,0],S=1e7,k=1.35,K=.35,H=K/k,L={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},J={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},t="pdfjs_internal_editor_",d={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},e={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},n={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},l={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},r={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Z={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},q={GROUP:"Group",REPLY:"R"},f={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512},W={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864},x={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},p={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"},b={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},V={O:"PageOpen",C:"PageClose"},m={ERRORS:0,WARNINGS:1,INFOS:5},T={NONE:0,BINARY:1},j={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},X={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},O=m.WARNINGS;function u(A){Number.isInteger(A)&&(O=A)}function z(){return O}function P(A){m.INFOS}function v(A){m.WARNINGS}function _(A){throw new Error(A)}function $(A,I){A||_(I)}function AA(A){var I=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!A)return null;try{if(g&&"string"==typeof A){if(g.addDefaultProtocol&&A.startsWith("www.")){var B=A.match(/\./g);(null==B?void 0:B.length)>=2&&(A="http://".concat(A))}if(g.tryConvertEncoding)try{A=YA(A)}catch(A){}}var C=I?new URL(A,I):new URL(A);if(function(A){switch(null==A?void 0:A.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(C))return C}catch(A){}return null}function IA(A,I,g){var B=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return("undefined"==typeof PDFJSDev||PDFJSDev.test("TESTING"))&&$(I in A,'shadow: Property "'.concat(I&&I.toString(),'" not found in object.')),Object.defineProperty(A,I,{value:g,enumerable:!B,configurable:!0,writable:!1}),g}var gA=function(){function A(I,g){this.constructor===A&&_("Cannot initialize BaseException."),this.message=I,this.name=g}return A.prototype=new Error,A.constructor=A,A}(),BA=function(A){F()(g,A);var I=c(g);function g(A,B){var C;return o()(this,g),(C=I.call(this,A,"PasswordException")).code=B,C}return D()(g)}(gA),CA=function(A){F()(g,A);var I=c(g);function g(A,B){var C;return o()(this,g),(C=I.call(this,A,"UnknownErrorException")).details=B,C}return D()(g)}(gA),QA=function(A){F()(g,A);var I=c(g);function g(A){return o()(this,g),I.call(this,A,"InvalidPDFException")}return D()(g)}(gA),EA=function(A){F()(g,A);var I=c(g);function g(A){return o()(this,g),I.call(this,A,"MissingPDFException")}return D()(g)}(gA),DA=function(A){F()(g,A);var I=c(g);function g(A,B){var C;return o()(this,g),(C=I.call(this,A,"UnexpectedResponseException")).status=B,C}return D()(g)}(gA),iA=function(A){F()(g,A);var I=c(g);function g(A){return o()(this,g),I.call(this,A,"FormatError")}return D()(g)}(gA),oA=function(A){F()(g,A);var I=c(g);function g(A){return o()(this,g),I.call(this,A,"AbortException")}return D()(g)}(gA);function wA(A){"object"==typeof A&&void 0!==(null==A?void 0:A.length)||_("Invalid argument for bytesToString");var I=A.length,g=8192;if(I<g)return String.fromCharCode.apply(null,A);for(var B=[],C=0;C<I;C+=g){var Q=Math.min(C+g,I),E=A.subarray(C,Q);B.push(String.fromCharCode.apply(null,E))}return B.join("")}function FA(A){"string"!=typeof A&&_("Invalid argument for stringToBytes");for(var I=A.length,g=new Uint8Array(I),B=0;B<I;++B)g[B]=255&A.charCodeAt(B);return g}function GA(A){return("undefined"==typeof PDFJSDev||PDFJSDev.test("TESTING"))&&$("number"==typeof A&&Math.abs(A)<Math.pow(2,32),'string32: Unexpected input "'.concat(A,'".')),String.fromCharCode(A>>24&255,A>>16&255,A>>8&255,255&A)}function NA(A){return Object.keys(A).length}function yA(A){var I,g=Object.create(null),B=M(A);try{for(B.s();!(I=B.n()).done;){var C=Q()(I.value,2),E=C[0],D=C[1];g[E]=D}}catch(A){B.e(A)}finally{B.f()}return g}var hA=function(){function A(){o()(this,A)}return D()(A,null,[{key:"isLittleEndian",get:function(){return IA(this,"isLittleEndian",((A=new Uint8Array(4))[0]=1,1===new Uint32Array(A.buffer,0,1)[0]));var A}},{key:"isEvalSupported",get:function(){return IA(this,"isEvalSupported",function(){try{return new Function(""),!0}catch(A){return!1}}())}},{key:"isOffscreenCanvasSupported",get:function(){return IA(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}},{key:"platform",get:function(){var A;return"undefined"!=typeof PDFJSDev&&PDFJSDev.test("MOZCENTRAL")||"undefined"!=typeof navigator&&"string"==typeof(null===(A=navigator)||void 0===A?void 0:A.platform)?IA(this,"platform",{isMac:navigator.platform.includes("Mac")}):IA(this,"platform",{isMac:!1})}},{key:"isCSSRoundSupported",get:function(){var A,I;return IA(this,"isCSSRoundSupported",null===(A=globalThis.CSS)||void 0===A||null===(I=A.supports)||void 0===I?void 0:I.call(A,"width: round(1.5px, 1px)"))}}]),A}(),RA=Array.from(Array(256).keys(),(function(A){return A.toString(16).padStart(2,"0")})),MA=function(){function A(){o()(this,A)}return D()(A,null,[{key:"makeHexColor",value:function(A,I,g){return"#".concat(RA[A]).concat(RA[I]).concat(RA[g])}},{key:"scaleMinMax",value:function(A,I){var g;A[0]?(A[0]<0&&(g=I[0],I[0]=I[2],I[2]=g),I[0]*=A[0],I[2]*=A[0],A[3]<0&&(g=I[1],I[1]=I[3],I[3]=g),I[1]*=A[3],I[3]*=A[3]):(g=I[0],I[0]=I[1],I[1]=g,g=I[2],I[2]=I[3],I[3]=g,A[1]<0&&(g=I[1],I[1]=I[3],I[3]=g),I[1]*=A[1],I[3]*=A[1],A[2]<0&&(g=I[0],I[0]=I[2],I[2]=g),I[0]*=A[2],I[2]*=A[2]),I[0]+=A[4],I[1]+=A[5],I[2]+=A[4],I[3]+=A[5]}},{key:"transform",value:function(A,I){return[A[0]*I[0]+A[2]*I[1],A[1]*I[0]+A[3]*I[1],A[0]*I[2]+A[2]*I[3],A[1]*I[2]+A[3]*I[3],A[0]*I[4]+A[2]*I[5]+A[4],A[1]*I[4]+A[3]*I[5]+A[5]]}},{key:"applyTransform",value:function(A,I){return[A[0]*I[0]+A[1]*I[2]+I[4],A[0]*I[1]+A[1]*I[3]+I[5]]}},{key:"applyInverseTransform",value:function(A,I){var g=I[0]*I[3]-I[1]*I[2];return[(A[0]*I[3]-A[1]*I[2]+I[2]*I[5]-I[4]*I[3])/g,(-A[0]*I[1]+A[1]*I[0]+I[4]*I[1]-I[5]*I[0])/g]}},{key:"getAxialAlignedBoundingBox",value:function(A,I){var g=this.applyTransform(A,I),B=this.applyTransform(A.slice(2,4),I),C=this.applyTransform([A[0],A[3]],I),Q=this.applyTransform([A[2],A[1]],I);return[Math.min(g[0],B[0],C[0],Q[0]),Math.min(g[1],B[1],C[1],Q[1]),Math.max(g[0],B[0],C[0],Q[0]),Math.max(g[1],B[1],C[1],Q[1])]}},{key:"inverseTransform",value:function(A){var I=A[0]*A[3]-A[1]*A[2];return[A[3]/I,-A[1]/I,-A[2]/I,A[0]/I,(A[2]*A[5]-A[4]*A[3])/I,(A[4]*A[1]-A[5]*A[0])/I]}},{key:"singularValueDecompose2dScale",value:function(A){var I=[A[0],A[2],A[1],A[3]],g=A[0]*I[0]+A[1]*I[2],B=A[0]*I[1]+A[1]*I[3],C=A[2]*I[0]+A[3]*I[2],Q=A[2]*I[1]+A[3]*I[3],E=(g+Q)/2,D=Math.sqrt(Math.pow(g+Q,2)-4*(g*Q-C*B))/2,i=E+D||1,o=E-D||1;return[Math.sqrt(i),Math.sqrt(o)]}},{key:"normalizeRect",value:function(A){var I=A.slice(0);return A[0]>A[2]&&(I[0]=A[2],I[2]=A[0]),A[1]>A[3]&&(I[1]=A[3],I[3]=A[1]),I}},{key:"intersect",value:function(A,I){var g=Math.max(Math.min(A[0],A[2]),Math.min(I[0],I[2])),B=Math.min(Math.max(A[0],A[2]),Math.max(I[0],I[2]));if(g>B)return null;var C=Math.max(Math.min(A[1],A[3]),Math.min(I[1],I[3])),Q=Math.min(Math.max(A[1],A[3]),Math.max(I[1],I[3]));return C>Q?null:[g,C,B,Q]}},{key:"bezierBoundingBox",value:function(I,g,B,C,Q,E,D,i,o){return o?(o[0]=Math.min(o[0],I,D),o[1]=Math.min(o[1],g,i),o[2]=Math.max(o[2],I,D),o[3]=Math.max(o[3],g,i)):o=[Math.min(I,D),Math.min(g,i),Math.max(I,D),Math.max(g,i)],R(this,A,cA).call(this,I,B,Q,D,g,C,E,i,3*(3*(B-Q)-I+D),6*(I-2*B+Q),3*(B-I),o),R(this,A,cA).call(this,I,B,Q,D,g,C,E,i,3*(3*(C-E)-g+i),6*(g-2*C+E),3*(C-g),o),o}}]),A}();function UA(A,I,g,B,C,Q,E,D,i,o){if(!(i<=0||i>=1)){var w=1-i,F=i*i,G=F*i,N=w*(w*(w*A+3*i*I)+3*F*g)+G*B,y=w*(w*(w*C+3*i*Q)+3*F*E)+G*D;o[0]=Math.min(o[0],N),o[1]=Math.min(o[1],y),o[2]=Math.max(o[2],N),o[3]=Math.max(o[3],y)}}function cA(A,I,g,C,Q,E,D,i,o,w,F,G){if(Math.abs(o)<1e-12)Math.abs(w)>=1e-12&&R(this,B,UA).call(this,A,I,g,C,Q,E,D,i,-F/w,G);else{var N=Math.pow(w,2)-4*F*o;if(!(N<0)){var y=Math.sqrt(N),h=2*o;R(this,B,UA).call(this,A,I,g,C,Q,E,D,i,(-w+y)/h,G),R(this,B,UA).call(this,A,I,g,C,Q,E,D,i,(-w-y)/h,G)}}}B=MA;var sA=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function aA(A){var I;if(A[0]>="ï"&&("þ"===A[0]&&"ÿ"===A[1]?(I="utf-16be",A.length%2==1&&(A=A.slice(0,-1))):"ÿ"===A[0]&&"þ"===A[1]?(I="utf-16le",A.length%2==1&&(A=A.slice(0,-1))):"ï"===A[0]&&"»"===A[1]&&"¿"===A[2]&&(I="utf-8"),I))try{var g=new TextDecoder(I,{fatal:!0}),B=FA(A),C=g.decode(B);return C.includes("")?C.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g,""):C}catch(A){v('stringToPDFString: "'.concat(A,'".'))}for(var Q=[],E=0,D=A.length;E<D;E++){var i=A.charCodeAt(E);if(27!==i){var o=sA[i];Q.push(o?String.fromCharCode(o):A.charAt(E))}else for(;++E<D&&27!==A.charCodeAt(E););}return Q.join("")}function YA(A){return decodeURIComponent(escape(A))}function SA(A){return unescape(encodeURIComponent(A))}function kA(A,I){if(A.length!==I.length)return!1;for(var g=0,B=A.length;g<B;g++)if(A[g]!==I[g])return!1;return!0}function KA(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return[A.getUTCFullYear().toString(),(A.getUTCMonth()+1).toString().padStart(2,"0"),A.getUTCDate().toString().padStart(2,"0"),A.getUTCHours().toString().padStart(2,"0"),A.getUTCMinutes().toString().padStart(2,"0"),A.getUTCSeconds().toString().padStart(2,"0")].join("")}var HA=null,LA=null;function JA(A){return HA||(HA=/([\xA0\xB5\u037E\u0EB3\u2000-\u200A\u202F\u2126\uFB00-\uFB04\uFB06\uFB20-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBA1\uFBA4-\uFBA9\uFBAE-\uFBB1\uFBD3-\uFBDC\uFBDE-\uFBE7\uFBEA-\uFBF8\uFBFC\uFBFD\uFC00-\uFC5D\uFC64-\uFCF1\uFCF5-\uFD3D\uFD88\uFDF4\uFDFA\uFDFB\uFE71\uFE77\uFE79\uFE7B\uFE7D]+)|(\uFB05+)/g,LA=new Map([["ſt","ſt"]])),A.replaceAll(HA,(function(A,I,g){return I?I.normalize("NFKC"):LA.get(g)}))}function tA(){var A,I;if("undefined"!=typeof PDFJSDev&&PDFJSDev.test("MOZCENTRAL")||"undefined"!=typeof crypto&&"function"==typeof(null===(A=crypto)||void 0===A?void 0:A.randomUUID))return crypto.randomUUID();var g=new Uint8Array(32);if("undefined"!=typeof crypto&&"function"==typeof(null===(I=crypto)||void 0===I?void 0:I.getRandomValues))crypto.getRandomValues(g);else for(var B=0;B<32;B++)g[B]=Math.floor(255*Math.random());return wA(g)}var dA="pdfjs_internal_id_",eA={BEZIER_CURVE_TO:0,MOVE_TO:1,LINE_TO:2,QUADRATIC_CURVE_TO:3,RESTORE:4,SAVE:5,SCALE:6,TRANSFORM:7,TRANSLATE:8}}.call(this,g(89))},function(A,I){var g,B,C=A.exports={};function Q(){throw new Error("setTimeout has not been defined")}function E(){throw new Error("clearTimeout has not been defined")}function D(A){if(g===setTimeout)return setTimeout(A,0);if((g===Q||!g)&&setTimeout)return g=setTimeout,setTimeout(A,0);try{return g(A,0)}catch(I){try{return g.call(null,A,0)}catch(I){return g.call(this,A,0)}}}!function(){try{g="function"==typeof setTimeout?setTimeout:Q}catch(A){g=Q}try{B="function"==typeof clearTimeout?clearTimeout:E}catch(A){B=E}}();var i,o=[],w=!1,F=-1;function G(){w&&i&&(w=!1,i.length?o=i.concat(o):F=-1,o.length&&N())}function N(){if(!w){var A=D(G);w=!0;for(var I=o.length;I;){for(i=o,o=[];++F<I;)i&&i[F].run();F=-1,I=o.length}i=null,w=!1,function(A){if(B===clearTimeout)return clearTimeout(A);if((B===E||!B)&&clearTimeout)return B=clearTimeout,clearTimeout(A);try{return B(A)}catch(I){try{return B.call(null,A)}catch(I){return B.call(this,A)}}}(A)}}function y(A,I){this.fun=A,this.array=I}function h(){}C.nextTick=function(A){var I=new Array(arguments.length-1);if(arguments.length>1)for(var g=1;g<arguments.length;g++)I[g-1]=arguments[g];o.push(new y(A,I)),1!==o.length||w||D(N)},y.prototype.run=function(){this.fun.apply(null,this.array)},C.title="browser",C.browser=!0,C.env={},C.argv=[],C.version="",C.versions={},C.on=h,C.addListener=h,C.once=h,C.off=h,C.removeListener=h,C.removeAllListeners=h,C.emit=h,C.prependListener=h,C.prependOnceListener=h,C.listeners=function(A){return[]},C.binding=function(A){throw new Error("process.binding is not supported")},C.cwd=function(){return"/"},C.chdir=function(A){throw new Error("process.chdir is not supported")},C.umask=function(){return 0}},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdThumbnailViewer",(function(){return y}));var B=g(5),C=g.n(B),Q=g(1),E=g.n(Q),D=g(22),i=g(29),o=g(87),w=g(36);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 G(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 G(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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}function G(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){C()(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 C=B.ring,Q=document.createElement("canvas"),E=Q.getContext("2d");Q.style.height=C.style.height,Q.style.width=C.style.width,Q.width=1*this.coreHelper.pageRenderWidth(0,B.id-1,this.core),Q.height=1*this.coreHelper.pageRenderHeight(0,B.id-1,this.core);var o=Q.width/Q.height,w=document.createElement("img");w.className="thumbnailImage",w.style.width="98px",w.style.height=98/o+"px",this.ofdCanvasRender.renderPageByCanvas(Q,E,0,B.id-1).then((function(I){var g=Q.toDataURL();w.src=g,B.renderingState=D.RenderingStates.FINISHED,A.updateThumbnailView()})),C.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,C=g.last,Q=g.views;if(Q.length>0){var E=!1;if(A<=B.id||A>=C.id)E=!0;else{var i,o=F(Q);try{for(o.s();!(i=o.n()).done;){var w=i.value,G=w.id,y=w.percent;if(G===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,C=function(A){var C=I.coreHelper.pageRenderWidth(0,A,I.core)/I.coreHelper.pageRenderHeight(0,A,I.core),Q=document.createElement("a");Q.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/C+2+"px",E.appendChild(i),Q.appendChild(E),I.pageDIV[A]={ring:i,div:E,anchor:Q,id:A+1,renderingState:D.RenderingStates.INITIAL},g.appendChild(Q)},Q=0;Q<this.core.getOFDPageCount(0);++Q)C(Q);this.updateThumbnailView()}}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"PDFSidebar",(function(){return o}));var B=g(5),C=g.n(B),Q=g(1),E=g.n(Q),D=g(22),i="pdfSidebarNotification",o=function(){function A(I){var g=I.elements,B=I.ofdViewer,Q=I.ofdThumbnailViewer,E=I.eventBus,i=I.l10n;C()(this,A),this.isOpen=!1,this.active=D.SidebarView.OUTLINE,this.isInitialViewSet=!1,this.onToggled=null,this.ofdViewer=B,this.ofdThumbnailViewer=Q,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 C=A===D.SidebarView.THUMBS,Q=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",C),this.outlineButton&&this.outlineButton.classList.toggle("toggled",Q),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",C),this.outlineButton&&this.outlineButton.setAttribute("aria-checked",Q),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",!C),this.outlineView&&this.outlineView.classList.toggle("hidden",!Q),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",!Q),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,C,Q,E,i,o,w,F=this;null===(A=this.viewerContainer)||void 0===A||A.addEventListener("transitionend",(function(A){A.target===F.viewerContainer&&F.outerContainer.classList.remove("sidebarMoving")})),null===(I=this.toggleButton)||void 0===I||I.addEventListener("click",(function(){F.toggle()})),null===(g=this.thumbnailButton)||void 0===g||g.addEventListener("click",(function(){F.switchView(D.SidebarView.THUMBS)})),null===(B=this.outlineButton)||void 0===B||B.addEventListener("click",(function(){F.switchView(D.SidebarView.OUTLINE)})),null===(C=this.outlineButton)||void 0===C||C.addEventListener("dblclick",(function(){F.eventBus.dispatch("toggleoutlinetree",{source:F})})),null===(Q=this.attachmentsButton)||void 0===Q||Q.addEventListener("click",(function(){F.switchView(D.SidebarView.ATTACHMENTS)})),null===(E=this.layersButton)||void 0===E||E.addEventListener("click",(function(){F.switchView(D.SidebarView.LAYERS)})),null===(i=this.layersButton)||void 0===i||i.addEventListener("dblclick",(function(){F.eventBus.dispatch("resetlayers",{source:F})})),null===(o=this.signaturesButton)||void 0===o||o.addEventListener("click",(function(){F.switchView(D.SidebarView.SIGNATURES)})),null===(w=this._currentOutlineItemButton)||void 0===w||w.addEventListener("click",(function(){F.eventBus.dispatch("currentoutlineitem",{source:F})}));var G=function(A,I,g){I.disabled=!A,A?F._showUINotification():F.active===g&&F.switchView(D.SidebarView.THUMBS)};this.eventBus._on("outlineloaded",(function(A){G(A.outlineCount,F.outlineButton,D.SidebarView.OUTLINE),A.currentOutlineItemPromise.then((function(A){F.isInitialViewSet&&(F._currentOutlineItemButton.disabled=!A)}))})),this.eventBus._on("attachmentsloaded",(function(A){G(A.attachmentsCount,F.attachmentsButton,D.SidebarView.ATTACHMENTS)})),this.eventBus._on("layersloaded",(function(A){G(A.layersCount,F.layersButton,D.SidebarView.LAYERS)})),this.eventBus._on("presentationmodechanged",(function(A){A.state===D.PresentationModeState.NORMAL&&F.isThumbnailViewVisible&&F._updateThumbnailViewer()}))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"OverlayManager",(function(){return F}));var B=g(6),C=g.n(B),Q=g(5),E=g.n(Q),D=g(1),i=g.n(D),o=g(7),w=g.n(o),F=function(){function A(){E()(this,A),this.overlays=new WeakMap}var I,g,B,Q;return i()(A,[{key:"register",value:(Q=C()(w.a.mark((function A(I){var g,B=this,C=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(g=C.length>1&&void 0!==C[1]&&C[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 Q.apply(this,arguments)})},{key:"unregister",value:(B=C()(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=C()(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=C()(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 F}));var B=g(6),C=g.n(B),Q=g(5),E=g.n(Q),D=g(1),i=g.n(D),o=g(7),w=g.n(o),F=(g(22),function(){function A(I,g,B,C){var Q=this,D=I.dialog,i=I.fields,o=I.closeButton;E()(this,A),this.dialog=D,this.fields=i,this.overlayManager=g,this.l10n=C,this.fieldData=null,this.reset(),o.addEventListener("click",this.close.bind(this)),this.overlayManager.register(this.dialog),B._on("pagechanging",(function(A){Q._currentPageNumber=A.pageNumber})),B._on("rotationchanging",(function(A){Q._pagesRotation=A.pagesRotation})),this._isNonMetricLocale=!0}var I,g;return i()(A,[{key:"open",value:(g=C()(w.a.mark((function A(){var I,g,B,C,Q,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(),C=B.info,B.contentDispositionFilename,Q=B.contentLength,E=this.parseFileSize(Q),this.fieldData=Object.freeze({fileSize:E,title:C.Title,author:C.Author,subject:C.Subject,keywords:C.Keywords,creationDate:C.CreationDate,modificationDate:C.ModificationDate,creator:C.Creator,producer:C.Producer,version:C.CreatorVersion,pageCount:C.numPages,pageSize:C.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=C()(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 c}));var B=g(6),C=g.n(B),Q=g(5),E=g.n(Q),D=g(1),i=g.n(D),o=g(21),w=g.n(o),F=g(7),G=g.n(F),N=g(22),y=g(88);function h(A,I){var g=Object.keys(A);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(A);I&&(B=B.filter((function(I){return Object.getOwnPropertyDescriptor(A,I).enumerable}))),g.push.apply(g,B)}return g}function R(A){for(var I=1;I<arguments.length;I++){var g=null!=arguments[I]?arguments[I]:{};I%2?h(Object(g),!0).forEach((function(I){w()(A,I,g[I])})):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(g)):h(Object(g)).forEach((function(I){Object.defineProperty(A,I,Object.getOwnPropertyDescriptor(g,I))}))}return A}function M(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 U(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 U(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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}function U(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 c=function(){function A(I,g,B){E()(this,A),w()(this,"_opts",void 0),this.toolbar=I.container,this.eventBus=g,this.l10n=B,this._opts=I,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},{element:I.editorInkButton,eventName:"switchannotationeditormode",eventDetails:{get mode(){return I.editorInkButton.classList.contains("toggled")?y.AnnotationEditorType.NONE:y.AnnotationEditorType.INK}}}],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=C()(G.a.mark((function A(I){var g,B,C;return G.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:if(this.eventBus.dispatch("langchanged",{source:self,value:I}),this.items.langSelect){A.next=8;break}return A.abrupt("return");case 8:g=M(this.items.langSelect.options),A.prev=9,g.s();case 11:if((B=g.n()).done){A.next=19;break}if((C=B.value).value===I){A.next=16;break}return C.selected=!1,A.abrupt("continue",17);case 16:C.selected=!0;case 17:A.next=11;break;case 19:A.next=24;break;case 21:A.prev=21,A.t0=A.catch(9),g.e(A.t0);case 24:return A.prev=24,g.f(),A.finish(24);case 27:case"end":return A.stop()}}),A,this,[[9,21,24,27]])}))),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=N.DEFAULT_SCALE_VALUE,this.pageScale=N.DEFAULT_SCALE,this._updateUIState(!0),this.updateLoadingIndicatorState()}},{key:"_bindListeners",value:function(){var A,I=this,g=this.items,B=g.pageNumber,C=g.scaleSelect,Q=g.langSelect,E=this,D=M(this.buttons);try{var i=function(){var g=A.value,B=g.element,C=g.eventName,Q=g.eventDetails;null==B||B.addEventListener("click",(function(A){null!==C&&I.eventBus.dispatch(C,R(R({source:I},Q),{},{isFromKeyboard:0===A.detail}))}))};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})})),C.addEventListener("change",(function(){"custom"!==this.value&&E.eventBus.dispatch("scalechanged",{source:E,value:this.value})})),C.addEventListener("click",(function(A){var I=A.target;this.value===E.pageScaleValue&&"OPTION"===I.tagName.toUpperCase()&&this.blur()})),C.oncontextmenu=N.noContextMenuHandler,Q&&Q.addEventListener("change",(function(){E.eventBus.dispatch("langchanged",{source:E,value:this.value})})),this.eventBus._on("localized",(function(){I._wasLocalized=!0,I._updateUIState(!0)}))}},{key:"_editorModeChanged",value:function(A){var I=A.mode,g=this._opts,B=g.editorInkButton,C=g.editorInkParamsToolbar;Object(N.toggleExpandedBtn)(B,I===y.AnnotationEditorType.INK,C),B.disabled=I===y.AnnotationEditorType.DISABLE}},{key:"_updateUIState",value:function(){var A=arguments.length>0&&void 0!==arguments[0]&&arguments[0],I=this.pageNumber,g=this.pagesCount,B=this.pageScaleValue,C=this.pageScale,Q=this.items,E=!1;if(Q.scaleSelect.options instanceof Array){var D,i=M(Q.scaleSelect.options);try{for(i.s();!(D=i.n()).done;){var o=D.value;o.value===B?(o.selected=!0,E=!0):o.selected=!1}}catch(A){i.e(A)}finally{i.f()}}if(E||(Q.customScaleOption.textContent="".concat((1e4*C/100).toFixed(2),"%"),Q.customScaleOption.selected=!0),Q.previous.disabled=I<=1,Q.next.disabled=I>=g,Q.zoomOut.disabled=C<=N.MIN_SCALE,Q.zoomIn.disabled=C>=N.MAX_SCALE,!this._wasLocalized)return Q.numPages.textContent="/ ".concat(g),void(Q.pageNumber.value=I);A&&(this.hasPageLabels?Q.pageNumber.type="text":(Q.pageNumber.type="number",this.l10n.get("of_pages",{pagesCount:g}).then((function(A){Q.numPages.textContent=A}))),Q.pageNumber.max=g),this.hasPageLabels?(Q.pageNumber.value=this.pageLabel,this.l10n.get("page_of_pages",{pageNumber:I,pagesCount:g}).then((function(A){Q.numPages.textContent=A}))):Q.pageNumber.value=I}},{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 F}));var B=g(5),C=g.n(B),Q=g(1),E=g.n(Q),D=g(22),i=g(96);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,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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}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 F=function(){function A(I,g,B){C()(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 C=function(){var A=g.value,B=A.element,C=A.eventName,Q=A.close,E=A.eventDetails;null==B||B.addEventListener("click",(function(A){if(null!==C){var g={source:I};for(var B in E)g[B]=E[B];I.eventBus.dispatch(C,g)}Q&&I.close()}))};for(B.s();!(g=B.n()).done;)C()}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,C=B===i.CursorTool.SELECT,Q=B===i.CursorTool.HAND;I.classList.toggle("toggled",C),g.classList.toggle("toggled",Q),I.setAttribute("aria-checked",C),g.setAttribute("aria-checked",Q)}))}},{key:"bindScrollModeListener",value:function(A){var I=this,g=A.scrollPageButton,B=A.scrollVerticalButton,C=A.scrollHorizontalButton,Q=A.scrollWrappedButton,E=A.spreadNoneButton,i=A.spreadOddButton,o=A.spreadEvenButton,w=function(A){var w=A.mode,F=w===D.ScrollMode.PAGE,G=w===D.ScrollMode.VERTICAL,N=w===D.ScrollMode.HORIZONTAL,y=w===D.ScrollMode.WRAPPED;null==g||g.classList.toggle("toggled",F),null==B||B.classList.toggle("toggled",G),null==C||C.classList.toggle("toggled",N),null==Q||Q.classList.toggle("toggled",y),null==g||g.setAttribute("aria-checked",F),null==B||B.setAttribute("aria-checked",G),null==C||C.setAttribute("aria-checked",N),null==Q||Q.setAttribute("aria-checked",y);var h=I.pagesCount>15e3;g&&(g.disabled=h),B&&(B.disabled=h),C&&(C.disabled=h),Q&&(Q.disabled=h),E&&(E.disabled=N),i&&(i.disabled=N),o&&(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,C=A.spreadEvenButton;function Q(A){var I=A.mode,Q=I===D.SpreadMode.NONE,E=I===D.SpreadMode.ODD,i=I===D.SpreadMode.EVEN;null==g||g.classList.toggle("toggled",Q),null==B||B.classList.toggle("toggled",E),null==C||C.classList.toggle("toggled",i),null==g||g.setAttribute("aria-checked",Q),null==B||B.setAttribute("aria-checked",E),null==C||C.setAttribute("aria-checked",i)}this.eventBus._on("spreadmodechanged",Q),this.eventBus._on("secondarytoolbarreset",(function(A){A.source===I&&Q({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),C=g.n(B),Q=g(1),E=g.n(Q),D=g(97),i=g(22),o={SELECT:0,HAND:1,ZOOM:2},w=function(){function A(I){var g=this,B=I.container,Q=I.eventBus,E=I.cursorToolOnLoad,i=void 0===E?o.SELECT:E;C()(this,A),this.container=B,this.eventBus=Q,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),C=g.n(B),Q=g(1),E=g.n(Q),D="grab-to-pan-grab",i=function(){function A(I){C()(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,C=this.scrollLeftStart-I;this.element.scrollTo?this.element.scrollTo({top:B,left:C,behavior:"instant"}):(this.element.scrollTop=B,this.element.scrollLeft=C),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(6),C=g.n(B),Q=g(5),E=g.n(Q),D=g(1),i=g.n(D),o=g(7),w=g.n(o),F=(g(87),g(30)),G=g(36),N=g(99),y=g.n(N);g(31);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 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,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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}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 M=function(){function A(I,g,B,C,Q,D,i){E()(this,A),this.coreHelper=new G.Ofd_Core_Helper(40),this.coreHelper.isPrinting=!0,this.waterText=D,this.waterSetting=i,this.dialog=I||document.getElementById("printServiceDialog"),this.overlayManager=g,this.l10n=B,this.ofdRender=new F.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=C,this.callback=Q}var I,g,B;return i()(A,[{key:"setOfdCore",value:function(A){this.core=A,this.ofdRender.setOfdCore(this.core)}},{key:"close",value:(B=C()(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=C()(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"),C=h(A);try{for(C.s();!(g=C.n()).done;){var Q=g.value;B.appendChild(Q)}}catch(A){C.e(A)}finally{C.f()}if(I.callback&&I.eventBus)return void I.eventBus.dispatch("printCallback",{source:I,html:B});y()({printable:B,type:"html",scanStyles:!1,style:"@media print{@page {margin: 2mm;}}"})}}))}),100);case 7:case"end":return A.stop()}}),A,this)}))),function(){return g.apply(this,arguments)})},{key:"prepare",value:(I=C()(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=C()(w.a.mark((function A(g,B){var C,Q,E,D,i,o;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:C=[],Q=0;case 2:if(!(Q<I.core.getOFDPageCount(0))||I.abort){A.next=24;break}return E=794/I.core.pageWidth(0,Q)*25.4,I.ofdRender.setDpi(E),(D=document.createElement("canvas")).style.width="794px",D.style.height="1123px",(i=document.createElement("div")).style.width="795px",i.style.height="1123px",i.style.position="relative",i.style.overflow="hidden",i.appendChild(D),o=I.core.pageHeight(0,Q)*E/25.4,I.waterText&&!I.waterSetting&&i.appendChild(I.watermark({watermark_txt:I.waterText,page_height:o})),I.waterSetting&&(I.waterSetting.page_height=o,i.appendChild(I.watermark(I.waterSetting))),I.ofdRender.renderPage(i,0,Q),C.push(i),A.next=21,I.renderProgress(Q+1);case 21:Q++,A.next=2;break;case 24:I.abort&&g(),g(C);case 26: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 C=Math.round(100*A/I.core.getOFDPageCount(0));I.progressBar.value=C,I.l10n.get("print_progress_percent",{progress:C}).then((function(A){I.progressPerc.textContent=A})),setTimeout((function(){g()}),100)}))}},{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,page_height:0};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 C,Q,E=document.createDocumentFragment(),D=(D=Math.max(document.body.scrollWidth,document.body.clientWidth),780),i=I.page_height;(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++){Q=I.watermark_y+(I.watermark_y_space+I.watermark_height)*o;for(var w=0;w<I.watermark_cols;w++){C=I.watermark_x+(I.watermark_width+I.watermark_x_space)*w;var F=document.createElement("div");F.id="mask_div"+o+w,F.className="mask_div",F.innerHTML=I.watermark_txt,F.style.webkitTransform="rotate(-"+I.watermark_angle+"deg)",F.style.MozTransform="rotate(-"+I.watermark_angle+"deg)",F.style.msTransform="rotate(-"+I.watermark_angle+"deg)",F.style.OTransform="rotate(-"+I.watermark_angle+"deg)",F.style.transform="rotate(-"+I.watermark_angle+"deg)",F.style.visibility="",F.style.position="absolute",F.style.left=C+"px",F.style.top=Q+"px",F.style.overflow="hidden",F.style.zIndex="9999",F.style.pointerEvents="none",F.style.opacity=I.watermark_alpha,F.style.fontSize=I.watermark_fontsize,F.style.fontFamily=I.watermark_font,F.style.color=I.watermark_color,F.style.textAlign="center",F.style.width=I.watermark_width+"px",F.style.height=I.watermark_height+"px",F.style.display="block",E.appendChild(F)}}return E}}]),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 C=I[B]={i:B,l:!1,exports:{}};return A[B].call(C.exports,C,C.exports,g),C.l=!0,C.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 C in A)g.d(B,C,function(I){return A[I]}.bind(null,C));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 C=I[B]={i:B,l:!1,exports:{}};return A[B].call(C.exports,C,C.exports,g),C.l=!0,C.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 C in A)g.d(B,C,function(I){return A[I]}.bind(null,C));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 T})),g.d(I,"ajaxUtils",(function(){return O})),g.d(I,"getToSign",(function(){return u})),g.d(I,"packageSigned",(function(){return z})),g.d(I,"free",(function(){return P})),g.d(I,"hashOfdDocument",(function(){return v})),g.d(I,"parseOfdDocument",(function(){return $})),g.d(I,"parseOfdDocumentFromBase64",(function(){return AA})),g.d(I,"getOFDPageCount",(function(){return IA})),g.d(I,"navigatePage",(function(){return gA})),g.d(I,"getAllAttachments",(function(){return BA})),g.d(I,"getAttachmentById",(function(){return CA})),g.d(I,"getAttachmentArrayBuffer",(function(){return QA})),g.d(I,"pageSize",(function(){return EA})),g.d(I,"getCustomTag",(function(){return DA})),g.d(I,"getTextObjects",(function(){return iA})),g.d(I,"renderOfd",(function(){return oA})),g.d(I,"renderOfdByIndex",(function(){return wA})),g.d(I,"getFileStream",(function(){return GA})),g.d(I,"setLanguage",(function(){return NA})),g.d(I,"setScale",(function(){return yA})),g.d(I,"openMetaBaseViewer",(function(){return hA})),g.d(I,"openOFDBaseViewer",(function(){return RA})),g.d(I,"openOFDBaseViewerByBase64",(function(){return MA})),g.d(I,"verifySignature",(function(){return UA})),g.d(I,"printOFD",(function(){return cA})),g.d(I,"getEventBus",(function(){return sA})),g.d(I,"initOFDViewer",(function(){return aA})),g.d(I,"openOFDViewer",(function(){return YA})),g.d(I,"openFile",(function(){return SA})),g.d(I,"openFileBase64",(function(){return kA})),g.d(I,"openOFD",(function(){return KA})),g.d(I,"openOFDWithHeader",(function(){return HA}));var B=g(1),C=g.n(B),Q=g(5),E=g.n(Q),D=g(6),i=g.n(D),o=g(7),w=g.n(o),F=g(9),G=g(12),N=g(20),y=g(90),h=g(91),R=g(92),M=g(93),U=g(94),c=g(95),s=g(96),a=g(98),Y=g(35),S=g(100),k=g(32),K=g(30),H=g(36),L=g(101),J=g(102),t=g.n(J),d=g(103),e=g(104),n=g(105),l=g(106),r=g(31),Z=g(107),q=g.n(Z),f=g(108),W=g.n(f),x=g(109),p=g(110),b=g(111);g(22);function V(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,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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}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 T=S.Print_api,j=window.Module;void 0===String.prototype.replaceAll&&(String.prototype.replaceAll=function(A,I){return this.replace(new RegExp(A,"g"),(function(){return I}))});var X={ofdCore:null,viewer:null,eventBus:null,waterText:null,fileName:null,ofdRender:null},O=W.a,u=function(A,I){return Object(k.JSGetToSign)(A,I)},z=function(A,I){return Object(k.JSPackageSigned)(A,I)},P=function(){X.ofdCore&&Object(k.freeOFD)(X.ofdCore)},v=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)):q()({url:A.ofd,method:"GET",responseType:"arraybuffer",headers:A.headers}).then((function(I){var g=Object(k.readOFD)(I.data,A.secret,A.digest);_(g,A)})).catch((function(I){A.fail&&A.fail(I)}))},_=function(A,I){0===A.code?(X.ofdCore=new Y.Ofd_Core(A.data.ofd,A.data.ofdParserPtr,A.data.leftTime),I.waterText&&(X.waterText=I.waterText),I.digest||(X.waterText="demotest"),I.signatureClickCallback&&(X.eventBus=new G.EventBus,X.eventBus._on("signatureclick",I.signatureClickCallback)),I.signaturesCallback&&I.signaturesCallback(X.ofdCore.getAllSignature(0)),I.success&&I.success(X.ofdCore)):I.fail&&I.fail(A.msg)},$=function(A){FA(i()(w.a.mark((function I(){var g,B,C;return w.a.wrap((function(I){for(;;)switch(I.prev=I.next){case 0:if(X.ofdCore&&(Object(k.freeOFD)(X.ofdCore),X.ofdCore=null,X.ofdRender=null),Object(k.CreateLibrary)(),!(A.ofd instanceof File)){I.next=8;break}(g=new FileReader).readAsArrayBuffer(A.ofd),g.onload=function(){var I=Object(k.readOFD)(g.result,A.secret,A.digest);_(I,A)},I.next=20;break;case 8:if(!(A.ofd instanceof Blob)){I.next=19;break}return I.t0=k.readOFD,I.next=12,A.ofd.arrayBuffer();case 12:I.t1=I.sent,I.t2=A.secret,I.t3=A.digest,B=(0,I.t0)(I.t1,I.t2,I.t3),_(B,A),I.next=20;break;case 19:A.ofd instanceof ArrayBuffer?(C=Object(k.readOFD)(A.ofd,A.secret,A.digest),_(C,A)):fetch(A.ofd,{method:"get",headers:A.headers}).then((function(A){return A.arrayBuffer()})).then((function(I){if(A.ofd&&A.ofd.split("/")){var g=A.ofd.split("/");X.fileName=g[g.length-1]}var B=Object(k.readOFD)(I,A.secret,A.digest);_(B,A)})).catch((function(I){A.fail&&A.fail(I)}));case 20:case"end":return I.stop()}}),I)}))))},AA=function(A){FA((function(){X.ofdCore&&(Object(k.freeOFD)(X.ofdCore),X.ofdCore=null,X.ofdRender=null),Object(k.CreateLibrary)();var I=Object(k.readOFDByBase64)(A.ofd,A.secret,A.digest);_(I,A)}))},IA=function(A){return X.ofdCore.getOFDPageCount(A)},gA=function(A){A<1&&(A=1),X.viewer.toolbar&&A>X.viewer.toolbar.pagesCount&&(A=X.viewer.toolbar.pagesCount),X.viewer.eventBus.dispatch("pagenumberchanged",{source:X.viewer.ofdViewer,value:A})},BA=function(A){return X.ofdCore.getAllAttachment(A)},CA=function(A,I){return X.ofdCore.getAttachmentByID(A,I)},QA=function(A,I){return new Promise((function(g,B){var C=X.ofdCore.getAttachmentByID(A,I);C?iI(C.FileLocAbs).then((function(A){g(A)})).catch((function(A){B(A)})):B("attachmentId error")}))},EA=function(A,I,g){var B=96;g&&(B=g/X.ofdCore.pageWidth(A,I)*25.4);var C=new H.Ofd_Core_Helper(B);return{width:X.ofdCore.pageWidth(A,I),height:X.ofdCore.pageHeight(A,I),renderWidth:C.pageRenderWidth(A,I,X.ofdCore),renderHeight:C.pageRenderHeight(A,I,X.ofdCore)}},DA=function(A){return X.ofdCore.getCustomTag(A)},iA=function(A){return X.ofdCore.getAllTextObject(A)},oA=function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},B=96;I&&"number"==typeof I&&!isNaN(I)&&(B=I/X.ofdCore.pageWidth(A,0)*25.4);var C=new H.Ofd_Core_Helper(B);g.waterText?C.setWaterText(g.waterText):X.waterText&&C.setWaterText(X.waterText),X.ofdRender?X.ofdRender.setDpi(B):X.ofdRender=new K.Ofd_Render(X.ofdCore,C),g.mixBlendMode&&X.ofdRender.setMixBlendMode(g.mixBlendMode);var Q=[];if(!X.ofdCore.readOfdDocument(A))return Q;var E=X.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=C.pageRenderWidth(0,D,X.ofdCore),w=C.pageRenderHeight(0,D,X.ofdCore);i.setAttribute("style","margin-bottom: 20px;position: relative;width:".concat(o,"px;height:").concat(w,"px;background: white;overflow: hidden")),X.ofdRender.renderPage(i,0,D),Q.push(i)}return Q},wA=function(A,I,g){var B=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},C=96;g&&"number"==typeof g&&!isNaN(g)&&(C=g/X.ofdCore.pageWidth(A,I)*25.4);var Q=new H.Ofd_Core_Helper(C);B.waterText?Q.setWaterText(B.waterText):X.waterText&&Q.setWaterText(X.waterText),X.ofdRender?X.ofdRender.setDpi(C):X.ofdRender=new K.Ofd_Render(X.ofdCore,Q),B.mixBlendMode&&X.ofdRender.setMixBlendMode(B.mixBlendMode);var E=document.createElement("div"),D=Q.pageRenderWidth(0,I,X.ofdCore),i=Q.pageRenderHeight(0,I,X.ofdCore);return E.setAttribute("style","position: relative;width:".concat(D,"px;height:").concat(i,"px;overflow: hidden")),X.ofdRender.renderPage(E,0,I),E},FA=function(A){if(j)Object(k.setYYDS)(j),A&&A();else{Object(k.needInitAgain)()||A&&(A(),A=null);document.getElementsByTagName("meta").ofdwasm;t()({locateFile:function(){return d.wsdsb}}).then((function(I){var g=I.Module;Object(k.setYYDS)(g),A&&A()}))}},GA=function(){return Object(k.getStreamData)()},NA=function(A){X.viewer.toolbar&&X.viewer.toolbar.setLanguage(A)},yA=function(A){X.viewer.ofdViewer&&X.viewer.ofdViewer.zoom(A)},hA=function(A){if(A.loadingContainer){if(A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);A.container.appendChild(A.loadingContainer)}X.ofdCore&&(X.eventBus=new G.EventBus,X.eventBus._on("pageFinishRender",A.pageFinishRenderCallback),new l.OfdBaseViewer(A.container,A.width,X.eventBus,X.waterText).setOfdCore(X.ofdCore))},RA=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)}$({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 l.OfdBaseViewer(A.container,A.width,X.eventBus,X.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)},MA=function(A){if(A.loadingContainer){if(A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);A.container.appendChild(A.loadingContainer)}AA({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 l.OfdBaseViewer(A.container,A.width,X.eventBus,X.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)}})},UA=function(A){var I=X.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="",C=V(I.SignedInfo.References);try{for(C.s();!(g=C.n()).done;){var Q=g.value;B+="".concat(Object(r.replaceFirstSlash)(Q.FileRef),"|")}}catch(A){C.e(A)}finally{C.f()}var E,D=Object(k.hashPath)(X.ofdCore.ofdParserPtr,B,I.SignedInfo.ReferencesCheckMethod.toLowerCase()),i=!0,o=V(I.SignedInfo.References);try{for(o.s();!(E=o.n()).done;){var w=E.value,F=w.CheckValue,G=D["".concat(Object(r.replaceFirstSlash)(w.FileRef))];i&=F===G}}catch(A){o.e(A)}finally{o.f()}A.hashFileCallback&&A.hashFileCallback(1===i)}),200)},cA=function(){X.viewer.ofdPrint&&TA()},sA=function(){return X.viewer.eventBus},aA=function(A){YA(A)},YA=function(A){var I;X.viewer&&((I=X.viewer.eventBus)._off("resize",qA),I._off("fileinputchange",fA),I._off("openfile",tA),I._off("nextpage",pA),I._off("previouspage",bA),I._off("pagenumberchanged",VA),I._off("pagechanging",mA),I._off("print",TA),I._off("firstpage",WA),I._off("lastpage",xA),I._off("zoomin",jA),I._off("zoomout",XA),I._off("scalechanging",OA),I._off("scalechanged",zA),I._off("viewportchanging",uA),I._off("switchspreadmode",PA),I._off("scrollmodechanged",vA),I._off("switchscrollmode",_A),I._off("rotatecw",$A),I._off("rotateccw",AI),I._off("documentproperties",II),I._off("signatureclick",BI),I._off("attachmentclick",CI),I._off("customtagclick",EI),I._off("outlineClick",DI),I._off("download",lA),I._off("langchanged",nA),I._off("pageViewerClick",QI),I._off("closePage",eA),I._off("printCallback",rA),I._off("printFinishCallback",ZA),I._off("switchannotationeditormode",dA)),X.viewer=new JA(A)},SA=function(A){KA(A)},kA=function(A){X.viewer&&(A?(X.viewer.config.openFileTip&&(X.viewer.config.openFileTip.hidden=!0),X.viewer.ofdViewer.freeDocument(),X.viewer.config.loadingContainer&&X.viewer.ofdViewer.viewer.appendChild(X.viewer.config.loadingContainer),AA({ofd:A,secret:X.viewer.config.secret,digest:X.viewer.config.digest,waterText:X.viewer.config.waterText,success:function(A){var I,g,B,C;if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){X.viewer.config.errorWrapper.moreInfoButton.hidden=!0,X.viewer.config.errorWrapper.container.hidden=!1;var Q=A.leftTime/864e5,E=A.leftTime%864e5/36e5,D=A.leftTime%36e5/6e4,i=A.leftTime%6e4/1e3;X.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(Q),"天").concat(Math.floor(E),"小时").concat(Math.floor(D),"分").concat(Math.floor(i),"秒"),X.viewer.config.exceedTimeLimit&&X.viewer.config.exceedTimeLimit()}X.viewer.config.parserOFDSuccess&&X.viewer.config.parserOFDSuccess(A.ofd),X.viewer.eventBus.dispatch("secondarytoolbarreset",{source:X.viewer.secondaryToolbar}),X.ofdCore=A,X.viewer.ofdViewer.setWaterText(X.waterText),X.viewer.ofdViewer.setWaterSetting(X.viewer.config.waterSetting),X.viewer.ofdViewer.setOfdCore(A),X.viewer.ofdThumbnailViewer&&X.viewer.ofdThumbnailViewer.setOfdCore(A),null===(I=X.viewer.ofdSignatureViewer)||void 0===I||I.setOfdCore(A,X.viewer.config.signatureViewerForceCheck),null===(g=X.viewer.ofdAttachmentViewer)||void 0===g||g.setOfdCore(A),null===(B=X.viewer.ofdCustomTagViewer)||void 0===B||B.setOfdCore(A),null===(C=X.viewer.ofdOutlineViewer)||void 0===C||C.setOfdCore(A),X.viewer.config.signaturesCallback&&X.viewer.config.signaturesCallback(A.getAllSignature(0)),X.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),X.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),X.viewer.config.sidebarForceOpen&&setTimeout((function(){X.viewer.pdfSidebar.open()}),500),X.viewer.config.renderOFDCallback&&X.viewer.config.renderOFDCallback()},fail:function(A){X.viewer.config.parserOFDFail&&X.viewer.config.parserOFDFail(A),X.viewer.ofdViewer.freeDocument(),X.viewer.config.errorWrapper.moreInfoButton.hidden=!0,X.viewer.config.errorWrapper.container.hidden=!1,X.viewer.config.errorWrapper.errorMessage.textContent=A}})):X.viewer.config.parserOFDFail&&X.viewer.config.parserOFDFail("file undefined"))},KA=function(A){LA({file:A})},HA=function(A,I){LA({file:A,headers:I})},LA=function(A){X.viewer&&(A.file?(X.viewer.config.openFileTip&&(X.viewer.config.openFileTip.hidden=!0),X.viewer.ofdViewer.freeDocument(),X.viewer.config.loadingContainer&&X.viewer.ofdViewer.viewer.appendChild(X.viewer.config.loadingContainer),$({ofd:A.file,headers:A.headers,secret:X.viewer.config.secret,digest:X.viewer.config.digest,waterText:X.viewer.config.waterText,success:function(A){var I,g,B,C;if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){X.viewer.config.errorWrapper.moreInfoButton.hidden=!0,X.viewer.config.errorWrapper.container.hidden=!1;var Q=A.leftTime/864e5,E=A.leftTime%864e5/36e5,D=A.leftTime%36e5/6e4,i=A.leftTime%6e4/1e3;X.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(Q),"天").concat(Math.floor(E),"小时").concat(Math.floor(D),"分").concat(Math.floor(i),"秒"),X.viewer.config.exceedTimeLimit&&X.viewer.config.exceedTimeLimit()}X.viewer.config.parserOFDSuccess&&X.viewer.config.parserOFDSuccess(A.ofd),X.viewer.eventBus.dispatch("secondarytoolbarreset",{source:X.viewer.secondaryToolbar}),X.ofdCore=A,X.viewer.ofdViewer.setWaterText(X.waterText),X.viewer.ofdViewer.setWaterSetting(X.viewer.config.waterSetting),X.viewer.ofdViewer.setOfdCore(A),X.viewer.ofdThumbnailViewer&&X.viewer.ofdThumbnailViewer.setOfdCore(A),null===(I=X.viewer.ofdSignatureViewer)||void 0===I||I.setOfdCore(A,X.viewer.config.signatureViewerForceCheck),null===(g=X.viewer.ofdAttachmentViewer)||void 0===g||g.setOfdCore(A),null===(B=X.viewer.ofdCustomTagViewer)||void 0===B||B.setOfdCore(A),null===(C=X.viewer.ofdOutlineViewer)||void 0===C||C.setOfdCore(A),X.viewer.config.signaturesCallback&&X.viewer.config.signaturesCallback(A.getAllSignature(0)),X.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),X.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),X.viewer.config.sidebarForceOpen&&setTimeout((function(){X.viewer.pdfSidebar.open()}),500),X.viewer.config.renderOFDCallback&&X.viewer.config.renderOFDCallback()},fail:function(A){X.viewer.config.parserOFDFail&&X.viewer.config.parserOFDFail(A),X.viewer.ofdViewer.freeDocument(),X.viewer.config.errorWrapper.moreInfoButton.hidden=!0,X.viewer.config.errorWrapper.container.hidden=!1,X.viewer.config.errorWrapper.errorMessage.textContent=A,"授权信息错误"==A?X.viewer.l10n.get("error_10001").then((function(A){X.viewer.config.errorWrapper.errorMessage.textContent=A})):"授权时间过期"==A&&X.viewer.l10n.get("error_10002").then((function(A){X.viewer.config.errorWrapper.errorMessage.textContent=A}))}})):X.viewer.config.parserOFDFail&&X.viewer.config.parserOFDFail("file undefined"))},JA=C()((function A(I){var g,B=this;E()(this,A),this.config=I,this.l10n=new F.GenericL10n("zh-CN"),this.eventBus=new G.EventBus,this.ofdViewer=new N.OfdViewer(I.mainContainer,I.viewerContainer,this.eventBus,I.mixBlendMode,I.defaultScale),null!==(g=I.sidebar)&&void 0!==g&&g.thumbnailView&&(this.ofdThumbnailViewer=new y.OfdThumbnailViewer(I.sidebar.thumbnailView,this.eventBus)),I.sidebar&&(this.ofdSignatureViewer=new e.OfdSignatureViewer(I.sidebar.signaturesView,this.eventBus),this.ofdAttachmentViewer=new n.OfdAttachmentViewer(I.sidebar.attachmentsView,this.eventBus),this.ofdCustomTagViewer=new x.OfdCustomTagViewer(I.sidebar.outlineView,this.eventBus),this.ofdOutlineViewer=new p.OfdOutlineViewer(I.sidebar.outlineView,this.eventBus),this.pdfSidebar=new h.PDFSidebar({elements:I.sidebar,ofdViewer:this.ofdViewer,ofdThumbnailViewer:this.ofdThumbnailViewer,eventBus:this.eventBus,l10n:this.l10n}),this.pdfSidebarResizer=new b.PDFSidebarResizer(I.sidebarResizer,this.eventBus,this.l10n)),this.overlayManager=new R.OverlayManager,I.signatureProperties&&(this.signatureProperties=new L.OFDSignatureProperties(I.signatureProperties,this.overlayManager,this.eventBus,this.l10n)),I.documentProperties&&(this.ofdDocumentProperties=new M.PDFDocumentProperties(I.documentProperties,this.overlayManager,this.eventBus,this.l10n)),this.toolbar=new U.Toolbar(I.toolbar,this.eventBus,this.l10n),this.secondaryToolbar=new c.SecondaryToolbar(I.secondaryToolbar,I.mainContainer,this.eventBus);var C=document.createElement("input");C.id="fileInput",C.className="fileInput",C.setAttribute("type","file"),C.setAttribute("accept",".ofd"),document.body.appendChild(C);var Q=this;C.addEventListener("click",(function(A){A.target.value=null})),C.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 s.PDFCursorTools({container:I.mainContainer,eventBus:this.eventBus});var D=document.getElementById("printServiceDialog");D&&(this.ofdPrint=new a.Print(D,this.overlayManager,this.l10n,this.eventBus,I.onPrintContentCallback,I.waterText,I.waterSetting));var i=I.appContainer||document.documentElement;this.l10n.translate(i).then((function(){B.eventBus.dispatch("localized",{})})),this.eventBus._on("printCallback",rA),this.eventBus._on("printFinishCallback",ZA),this.eventBus._on("resize",qA),this.eventBus._on("fileinputchange",fA),this.eventBus._on("openfile",tA),this.eventBus._on("nextpage",pA),this.eventBus._on("previouspage",bA),this.eventBus._on("pagenumberchanged",VA),this.eventBus._on("pagechanging",mA),this.eventBus._on("print",TA),this.eventBus._on("firstpage",WA),this.eventBus._on("lastpage",xA),this.eventBus._on("zoomin",jA),this.eventBus._on("zoomout",XA),this.eventBus._on("scalechanging",OA),this.eventBus._on("viewportchanging",uA),this.eventBus._on("scalechanged",zA),this.eventBus._on("switchspreadmode",PA),this.eventBus._on("scrollmodechanged",vA),this.eventBus._on("switchscrollmode",_A),this.eventBus._on("rotatecw",$A),this.eventBus._on("rotateccw",AI),this.eventBus._on("documentproperties",II),this.eventBus._on("signatureclick",BI),this.eventBus._on("attachmentclick",CI),this.eventBus._on("customtagclick",EI),this.eventBus._on("outlineClick",DI),this.eventBus._on("download",lA),this.eventBus._on("langchanged",nA),this.eventBus._on("pageViewerClick",QI),this.eventBus._on("closePage",eA),this.eventBus._on("switchannotationeditormode",dA),window.addEventListener("click",gI),window.addEventListener("resize",(function(){B.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),D&&"function"!=typeof D.showModal&&(D&&(D.hidden=!0),I.documentProperties&&I.documentProperties.dialog&&(I.documentProperties.dialog.hidden=!0),I.signatureProperties&&I.signatureProperties.dialog&&(I.signatureProperties.dialog.hidden=!0))}));function tA(){document.getElementById("fileInput").click()}function dA(A){X.viewer.ofdViewer.annotationEditorMode=A}function eA(){X.viewer.config.closeCallback&&X.viewer.config.closeCallback()}function nA(A){X.viewer.l10n.setLanguage(A.value),X.viewer.l10n.translate(X.viewer.appContainer).then((function(){X.viewer.eventBus.dispatch("localized",{})}))}function lA(){var A=Object(k.getStreamData)();if(A){if(X.viewer.config.downloadCallback)X.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",X.fileName),document.body.append(g),g.click()}X.viewer.config.downloadFinishEvent&&X.viewer.config.downloadFinishEvent()}var B=Object(k.getStreamDataBase64)();if(B){var C=function(A){for(var I=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",g=atob(A),B=[],C=0;C<g.length;C++)B.push(g.charCodeAt(C));var Q=new Uint8Array(B);return new Blob([Q],{type:I})}(B,"application/ofd");if(X.viewer.config.downloadCallback)X.viewer.config.downloadCallback(C);else{var Q=window.URL.createObjectURL(C),E=document.createElement("a");E.style.display="none",E.href=Q,E.setAttribute("download",X.fileName),document.body.append(E),E.click()}X.viewer.config.downloadFinishEvent&&X.viewer.config.downloadFinishEvent()}}function rA(A){X.viewer.config.onPrintContentCallback&&X.viewer.config.onPrintContentCallback(A.html)}function ZA(A){X.viewer.config.onPrintFinishEvent&&X.viewer.config.onPrintFinishEvent()}function qA(){var A=X.ofdCore,I=X.viewer;if(A){var g=I.ofdViewer.currentScaleValue;"auto"!==g&&"page-fit"!==g&&"page-width"!==g||(I.ofdViewer.currentScaleValue=g),X.viewer.eventBus.dispatch("stampResize",{source:null})}}function fA(A){var I;X.viewer.config.openFileTip&&(X.viewer.config.openFileTip.hidden=!0),null!==(I=X.viewer.pdfSidebar)&&void 0!==I&&I.isOpen&&X.viewer.pdfSidebar.close();var g=A.fileInput.files[0];X.fileName=g.name,X.viewer.ofdViewer.freeDocument(),X.viewer.config.loadingContainer&&X.viewer.ofdViewer.viewer.appendChild(X.viewer.config.loadingContainer);(new Date).getTime();$({ofd:g,secret:X.viewer.config.secret,digest:X.viewer.config.digest,waterText:X.viewer.config.waterText,success:function(A){var I,g,B,C;(new Date).getTime();if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){X.viewer.config.errorWrapper.moreInfoButton.hidden=!0,X.viewer.config.errorWrapper.container.hidden=!1;var Q=A.leftTime/864e5,E=A.leftTime%864e5/36e5,D=A.leftTime%36e5/6e4,i=A.leftTime%6e4/1e3;X.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(Q),"天").concat(Math.floor(E),"小时").concat(Math.floor(D),"分").concat(Math.floor(i),"秒"),X.viewer.config.exceedTimeLimit&&X.viewer.config.exceedTimeLimit()}X.viewer.config.parserOFDSuccess&&X.viewer.config.parserOFDSuccess(A.ofd),X.viewer.eventBus.dispatch("secondarytoolbarreset",{source:X.viewer.secondaryToolbar}),X.ofdCore=A,X.viewer.ofdViewer.setWaterText(X.waterText),X.viewer.ofdViewer.setWaterSetting(X.viewer.config.waterSetting),X.viewer.ofdViewer.setOfdCore(A),X.viewer.ofdThumbnailViewer&&X.viewer.ofdThumbnailViewer.setOfdCore(A),X.viewer.config.signaturesCallback&&X.viewer.config.signaturesCallback(A.getAllSignature(0)),null===(I=X.viewer.ofdSignatureViewer)||void 0===I||I.setOfdCore(A,X.viewer.config.signatureViewerForceCheck),null===(g=X.viewer.ofdAttachmentViewer)||void 0===g||g.setOfdCore(A),null===(B=X.viewer.ofdCustomTagViewer)||void 0===B||B.setOfdCore(A),null===(C=X.viewer.ofdOutlineViewer)||void 0===C||C.setOfdCore(A),X.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),X.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),X.viewer.config.sidebarForceOpen&&setTimeout((function(){X.viewer.pdfSidebar.open()}),500),X.viewer.config.renderOFDCallback&&X.viewer.config.renderOFDCallback()},fail:function(A){X.viewer.config.parserOFDFail&&X.viewer.config.parserOFDFail(A),X.viewer.ofdViewer.freeDocument(),X.viewer.config.errorWrapper.moreInfoButton.hidden=!0,X.viewer.config.errorWrapper.container.hidden=!1,X.viewer.config.errorWrapper.errorMessage.textContent=A,"授权信息错误"==A?X.viewer.l10n.get("error_10001").then((function(A){X.viewer.config.errorWrapper.errorMessage.textContent=A})):"授权时间过期"==A&&X.viewer.l10n.get("error_10002").then((function(A){X.viewer.config.errorWrapper.errorMessage.textContent=A}))}})}function WA(){X.viewer.ofdViewer.firstPage()}function xA(){X.viewer.ofdViewer.lastPage()}function pA(){X.viewer.ofdViewer.nextPage()}function bA(){X.viewer.ofdViewer.previousPage()}function VA(A){""!==A.value&&A.source.eventBus.dispatch("jumpPage",{source:A.source,pageIndex:A.value}),X.viewer.toolbar.setPageNumber(A.value,null),X.viewer.secondaryToolbar.setPageNumber(A.value,null)}function mA(A){var I,g=A.pageNumber;X.viewer.toolbar.setPageNumber(g,null),X.viewer.secondaryToolbar.setPageNumber(g,null),null!==(I=X.viewer.pdfSidebar)&&void 0!==I&&I.isThumbnailViewVisible&&X.viewer.ofdThumbnailViewer.scrollThumbnailIntoView(g),X.viewer.config.onPageChanging&&X.viewer.config.onPageChanging(g)}function TA(){X.viewer.ofdPrint.setOfdCore(X.ofdCore),X.viewer.ofdPrint.open()}function jA(){X.viewer.ofdViewer.increaseScale()}function XA(){X.viewer.ofdViewer.decreaseScale()}function OA(A){X.viewer.toolbar.setPageScale(A.presetValue,A.scale),X.viewer.config.onPageScale&&X.viewer.config.onPageScale(A.scale)}function uA(A){X.viewer.config.onViewportChange&&X.viewer.config.onViewportChange(X.viewer.ofdViewer)}function zA(A){X.viewer.ofdViewer.zoom(A.value)}function PA(A){X.viewer.ofdViewer.setSpreadMode(A.mode)}function vA(A){}function _A(A){X.viewer.ofdViewer.setScrollMode(A.mode)}function $A(){X.viewer.ofdViewer.setRotation(90)}function AI(){X.viewer.ofdViewer.setRotation(-90)}function II(){X.viewer.ofdDocumentProperties.setOfdCore(X.ofdCore),X.viewer.ofdDocumentProperties.open()}function gI(A){X.viewer.secondaryToolbar.isOpen&&(X.viewer.config.mainContainer.contains(A.target)||X.viewer.config.toolbar.container.contains(A.target)&&A.target!==X.viewer.config.secondaryToolbar.toggleButton)&&X.viewer.secondaryToolbar.close()}function BI(A){if(X.viewer.signatureProperties)if(X.viewer.signatureProperties.setOfdCore(X.ofdCore),A.pageRef||A.signatureId){var I=X.ofdCore.findSignature(0,A.pageRef,A.signatureId);X.viewer.signatureProperties.open(I)}else X.viewer.signatureProperties.open(A.sign.Signature)}function CI(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)),iI(A.attachment.FileLocAbs,A.attachment.FileLocPln).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 QI(A){X.viewer.ofdViewer&&X.viewer.ofdViewer.removeHighLight()}function EI(A){A.source.eventBus.dispatch("jumpPage",{source:A.source,pageIndex:A.pageIndex+1,eleIdArray:A.eleIdArray}),X.viewer.toolbar.setPageNumber(A.pageIndex+1,null),X.viewer.secondaryToolbar.setPageNumber(A.pageIndex+1,null)}function DI(A){A.source.eventBus.dispatch("jumpPage",{source:A.source,pageIndex:A.pageIndex+1}),X.viewer.toolbar.setPageNumber(A.pageIndex+1,null),X.viewer.secondaryToolbar.setPageNumber(A.pageIndex+1,null)}function iI(A,I,g){return new Promise((function(g,B){if(Object(k.getStreamData)()){var C=Object(k.JSGetPathEncode)(X.ofdCore.ofdParserPtr,A,I);null!=C?g(C):B(1)}}))}},function(A,I,g){var B=g(2);function C(A,I){for(var g=0;g<I.length;g++){var C=I[g];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(A,B(C.key),C)}}A.exports=function(A,I,g){return I&&C(A.prototype,I),g&&C(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,C=g(4);A.exports=function(A){var I=C(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 C=g.call(A,I||"default");if("object"!==B(C))return C;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){function g(A,I,g,B,C,Q,E){try{var D=A[Q](E),i=D.value}catch(A){return void g(A)}D.done?I(i):Promise.resolve(i).then(B,C)}A.exports=function(A){return function(){var I=this,B=arguments;return new Promise((function(C,Q){var E=A.apply(I,B);function D(A){g(E,C,Q,D,i,"next",A)}function i(A){g(E,C,Q,D,i,"throw",A)}D(void 0)}))}},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(8)();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 C(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */A.exports=C=function(){return g},A.exports.__esModule=!0,A.exports.default=A.exports;var I,g={},Q=Object.prototype,E=Q.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",F=i.toStringTag||"@@toStringTag";function G(A,I,g){return Object.defineProperty(A,I,{value:g,enumerable:!0,configurable:!0,writable:!0}),A[I]}try{G({},"")}catch(I){G=function(A,I,g){return A[I]=g}}function N(A,I,g,B){var C=I&&I.prototype instanceof s?I:s,Q=Object.create(C.prototype),E=new l(B||[]);return D(Q,"_invoke",{value:t(A,g,E)}),Q}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 h="suspendedStart",R="suspendedYield",M="executing",U="completed",c={};function s(){}function a(){}function Y(){}var S={};G(S,o,(function(){return this}));var k=Object.getPrototypeOf,K=k&&k(k(r([])));K&&K!==Q&&E.call(K,o)&&(S=K);var H=Y.prototype=s.prototype=Object.create(S);function L(A){["next","throw","return"].forEach((function(I){G(A,I,(function(A){return this._invoke(I,A)}))}))}function J(A,I){function g(C,Q,D,i){var o=y(A[C],A,Q);if("throw"!==o.type){var w=o.arg,F=w.value;return F&&"object"==B(F)&&E.call(F,"__await")?I.resolve(F.__await).then((function(A){g("next",A,D,i)}),(function(A){g("throw",A,D,i)})):I.resolve(F).then((function(A){w.value=A,D(w)}),(function(A){return g("throw",A,D,i)}))}i(o.arg)}var C;D(this,"_invoke",{value:function(A,B){function Q(){return new I((function(I,C){g(A,B,I,C)}))}return C=C?C.then(Q,Q):Q()}})}function t(A,g,B){var C=h;return function(Q,E){if(C===M)throw new Error("Generator is already running");if(C===U){if("throw"===Q)throw E;return{value:I,done:!0}}for(B.method=Q,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(C===h)throw C=U,B.arg;B.dispatchException(B.arg)}else"return"===B.method&&B.abrupt("return",B.arg);C=M;var o=y(A,g,B);if("normal"===o.type){if(C=B.done?U:R,o.arg===c)continue;return{value:o.arg,done:B.done}}"throw"===o.type&&(C=U,B.method="throw",B.arg=o.arg)}}}function d(A,g){var B=g.method,C=A.iterator[B];if(C===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 Q=y(C,A.iterator,g.arg);if("throw"===Q.type)return g.method="throw",g.arg=Q.arg,g.delegate=null,c;var E=Q.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 e(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 n(A){var I=A.completion||{};I.type="normal",delete I.arg,A.completion=I}function l(A){this.tryEntries=[{tryLoc:"root"}],A.forEach(e,this),this.reset(!0)}function r(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 C=-1,Q=function g(){for(;++C<A.length;)if(E.call(A,C))return g.value=A[C],g.done=!1,g;return g.value=I,g.done=!0,g};return Q.next=Q}}throw new TypeError(B(A)+" is not iterable")}return a.prototype=Y,D(H,"constructor",{value:Y,configurable:!0}),D(Y,"constructor",{value:a,configurable:!0}),a.displayName=G(Y,F,"GeneratorFunction"),g.isGeneratorFunction=function(A){var I="function"==typeof A&&A.constructor;return!!I&&(I===a||"GeneratorFunction"===(I.displayName||I.name))},g.mark=function(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,Y):(A.__proto__=Y,G(A,F,"GeneratorFunction")),A.prototype=Object.create(H),A},g.awrap=function(A){return{__await:A}},L(J.prototype),G(J.prototype,w,(function(){return this})),g.AsyncIterator=J,g.async=function(A,I,B,C,Q){void 0===Q&&(Q=Promise);var E=new J(N(A,I,B,C),Q);return g.isGeneratorFunction(I)?E:E.next().then((function(A){return A.done?A.value:E.next()}))},L(H),G(H,F,"Generator"),G(H,o,(function(){return this})),G(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=r,l.prototype={constructor:l,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(n),!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,C){return D.type="throw",D.arg=A,g.next=B,C&&(g.method="next",g.arg=I),!!C}for(var C=this.tryEntries.length-1;C>=0;--C){var Q=this.tryEntries[C],D=Q.completion;if("root"===Q.tryLoc)return B("end");if(Q.tryLoc<=this.prev){var i=E.call(Q,"catchLoc"),o=E.call(Q,"finallyLoc");if(i&&o){if(this.prev<Q.catchLoc)return B(Q.catchLoc,!0);if(this.prev<Q.finallyLoc)return B(Q.finallyLoc)}else if(i){if(this.prev<Q.catchLoc)return B(Q.catchLoc,!0)}else{if(!o)throw new Error("try statement without catch or finally");if(this.prev<Q.finallyLoc)return B(Q.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 C=B;break}}C&&("break"===A||"continue"===A)&&C.tryLoc<=I&&I<=C.finallyLoc&&(C=null);var Q=C?C.completion:{};return Q.type=A,Q.arg=I,C?(this.method="next",this.next=C.finallyLoc,c):this.complete(Q)},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),n(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 C=B.arg;n(g)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(A,g,B){return this.delegate={iterator:r(A),resultName:g,nextLoc:B},"next"===this.method&&(this.arg=I),c}},g}A.exports=C,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(6),C=g.n(B),Q=g(5),E=g.n(Q),D=g(1),i=g.n(D),o=g(7),w=g.n(o),F=(g(10),g(11)),G=document.webL10n,N=function(){function A(I){E()(this,A),this._lang=I,this._ready=new Promise((function(A,g){G.setLanguage(Object(F.fixupLangCode)(I),(function(){A(G)}))}))}var I,g,B,Q,D;return i()(A,[{key:"setLanguage",value:(D=C()(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){G.setLanguage(Object(F.fixupLangCode)(I),(function(){A(G)}))}));case 2:case"end":return A.stop()}}),A,this)}))),function(A){return D.apply(this,arguments)})},{key:"getLanguage",value:(Q=C()(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 Q.apply(this,arguments)})},{key:"getDirection",value:(B=C()(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=C()(w.a.mark((function A(I){var g,B,C,Q=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return g=Q.length>1&&void 0!==Q[1]?Q[1]:null,B=Q.length>2&&void 0!==Q[2]?Q[2]:Object(F.getL10nFallback)(I,g),A.next=4,this._ready;case 4:return C=A.sent,A.abrupt("return",C.get(I,g,B));case 6:case"end":return A.stop()}}),A,this)}))),function(A){return g.apply(this,arguments)})},{key:"translate",value:(I=C()(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,g){"use strict";document.webL10n=function(A,I,g){var B={},C="",Q="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 F(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){C+=A,function(A,g){var B={},C=/^\s*|\s*$/,Q=/^\s*#|^\s*$/,E=/^\s*\[(.*)\]\s*$/,o=/^\s*@import\s+url\((.*)\)\s*$/i,F=/^([^=\s]*)\s*=\s*(.+)$/;function G(A,g,w){var G=A.replace(C,"").split(/[\r\n]+/),y="*",h=I.split("-",1)[0],R=!1,M="";!function A(){for(;;){if(!G.length)return void w();var C=G.shift();if(!Q.test(C)){if(g){if(M=E.exec(C)){y=M[1].toLowerCase(),R="*"!==y&&y!==I&&y!==h;continue}if(R)continue;if(M=o.exec(C))return void N(D+M[1],A)}var U=C.match(F);U&&3==U.length&&(B[U[1]]=i(U[2]))}}}()}function N(A,I){w(A,(function(A){G(A,!1,I)}),(function(){I()}))}G(A,!0,(function(){g(B)}))}(A,(function(A){for(var I in A){var C,E,D=I.lastIndexOf(".");D>0?(C=I.substring(0,D),E=I.substring(D+1)):(C=I,E=Q),B[C]||(B[C]={}),B[C][E]=A[I]}g&&g()}))}),E)}function G(A,g){A&&(A=A.toLowerCase()),g=g||function(){},B={},C="",E="",E=A;var Q=I.querySelectorAll('link[type="application/l10n"]'),D=Q.length;if(0!==D){var o,w,G=0;w=function(){++G>=D&&(g(),i="complete")};for(var N=0;N<D;N++){new M(Q[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 h=y.default_locale.toLowerCase();for(var R in y.locales){if((R=R.toLowerCase())===A){B=y.locales[A];break}R===h&&(B=y.locales[h])}}g()}i="complete"}function M(A){var I=A.href;this.load=function(A,g){F(I,A,g,(function(){E="",g()}))}}}function N(A,I,g){var C=B[A];if(!C){if(!g)return null;C=g}var Q={};for(var E in C){var D=C[E];D=h(D=y(D,I,A,E),I,A),Q[E]=D}return Q}function y(A,I,g,C){var Q=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/.exec(A);if(!Q||!Q.length)return A;var E,i=Q[1],o=Q[2];(I&&o in I?E=I[o]:o in B&&(E=B[o]),i in D)&&(A=(0,D[i])(A,E,g,C));return A}function h(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 R(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[Q]){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[Q]=B[Q];else{for(var C=A.childNodes,E=!1,D=0,i=C.length;D<i;D++)3===C[D].nodeType&&/\S/.test(C[D].nodeValue)&&(E?C[D].nodeValue="":(C[D].nodeValue=B[Q],E=!0));if(!E){var o=I.createTextNode(B[Q]);A.insertBefore(o,A.firstChild)}}delete B[Q]}for(var w in B)A[w]=B[w]}}}return D.plural=function(A,I,g,C){var i=parseFloat(I);if(isNaN(i))return A;if(C!=Q)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"}},C={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 C in B?B[C]:function(){return"other"}}(E));var o="["+D._pluralRules(i)+"]";return 0===i&&g+"[zero]"in B?A=B[g+"[zero]"][C]:1==i&&g+"[one]"in B?A=B[g+"[one]"][C]:2==i&&g+"[two]"in B?A=B[g+"[two]"][C]:g+o in B?A=B[g+o][C]:g+"[other]"in B&&(A=B[g+"[other]"][C]),A},{get:function(A,I,g){var B,C=A.lastIndexOf("."),E=Q;C>0&&(E=A.substring(C+1),A=A.substring(0,C)),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 C},getLanguage:function(){return E},setLanguage:function(A,I){G(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,C=0;C<B;C++)R(g[C]);R(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 G}));var B=g(6),C=g.n(B),Q=g(7),E=g.n(Q),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 F(A,I){return I?A.replace(/\{\{\s*(\w+)\s*\}\}/g,(function(A,g){return g in I?I[g]:"{{"+g+"}}"})):A}var G={getLanguage:function(){return C()(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 C()(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 C()(E.a.mark((function g(){var B,C;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,C=I.length>2&&void 0!==I[2]?I[2]:i(A,B),g.abrupt("return",F(C,B));case 3:case"end":return g.stop()}}),g)})))()},translate:function(A){return C()(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 a})),g.d(I,"EventBus",(function(){return s})),g.d(I,"waitOnEventOrTimeout",(function(){return c})),g.d(I,"WaitOnType",(function(){return U}));var B=g(13),C=g.n(B),Q=g(16),E=g.n(Q),D=g(18),i=g.n(D),o=g(15),w=g.n(o),F=g(5),G=g.n(F),N=g(1),y=g.n(N);function h(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 C=w()(this).constructor;g=Reflect.construct(B,arguments,C)}else g=B.apply(this,arguments);return i()(this,g)}}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 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,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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}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,C=void 0===B?0:B;return new Promise((function(A,B){if("object"!=typeof I||!g||"string"!=typeof g||!(Number.isInteger(C)&&C>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function Q(B){I instanceof s?I._off(g,E):I.removeEventListener(g,E),i&&clearTimeout(i),A(B)}var E=Q.bind(null,U.EVENT);I instanceof s?I._on(g,E):I.addEventListener(g,E);var D=Q.bind(null,U.TIMEOUT),i=setTimeout(D,C)}))}var s=function(){function A(){G()(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,C,Q=R(g.slice(0));try{for(Q.s();!(C=Q.n()).done;){var E=C.value,D=E.listener,i=E.external;E.once&&this._off(A,D),i?(B||(B=[]),B.push(D)):D(I)}}catch(A){Q.e(A)}finally{Q.f()}if(B){var o,w=R(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,C=g.length;B<C;B++)if(g[B].listener===I)return void g.splice(B,1)}}]),A}(),a=function(A){E()(g,A);var I=h(g);function g(){return G()(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");C()(w()(g.prototype),"dispatch",this).call(this,A,I);var B=Object.create(null);if(I)for(var Q in I){var E=I[Q];if("source"!==Q)B[Q]=E;else if(E===window||E===document)return}var D=document.createEvent("CustomEvent");D.initCustomEvent(A,!0,!0,B),document.dispatchEvent(D)}}]),g}(s)},function(A,I,g){var B=g(14);function C(){return"undefined"!=typeof Reflect&&Reflect.get?(A.exports=C=Reflect.get.bind(),A.exports.__esModule=!0,A.exports.default=A.exports):(A.exports=C=function(A,I,g){var C=B(A,I);if(C){var Q=Object.getOwnPropertyDescriptor(C,I);return Q.get?Q.get.call(arguments.length<3?A:g):Q.value}},A.exports.__esModule=!0,A.exports.default=A.exports),C.apply(this,arguments)}A.exports=C,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,C=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 C(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 a}));var B=g(6),C=g.n(B),Q=g(5),E=g.n(Q),D=g(1),i=g.n(D),o=g(21),w=g.n(o),F=g(7),G=g.n(F),N=g(22),y=g(29),h=g(30),R=g(87),M=g(36),U=g(88);function c(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 s(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 s(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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}function s(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 a=function(){function A(I,g,B,C,Q){E()(this,A),w()(this,"scrollModePageState",null),this.jumpPageEvt=null,this.coreHelper=new M.Ofd_Core_Helper,this.ofdRender=new h.Ofd_Render(null,new M.Ofd_Core_Helper),C&&this.ofdRender.setMixBlendMode(C),this.defaultScale=Q||N.DEFAULT_SCALE_VALUE,this.ofdCanvasRender=new R.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=C()(G.a.mark((function A(I){var g,B,C,Q,E,D,i,o;return G.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this._scrollMode!==N.ScrollMode.PAGE?(B=I||this._getVisiblePages(),C=this.getScrollAhead(B),this._spreadMode!==N.SpreadMode.NONE&&(this._scrollMode,N.ScrollMode.HORIZONTAL),g=Object(y.getHighestPriority)(B,this._pages,C)):g=I,!g||g.renderingState!==N.RenderingStates.INITIAL){A.next=18;break}return this.emptyNode(g.div.firstChild),A.next=5,this.ofdRender.renderPage(g.div.firstChild,0,g.id-1);case 5:this.highLightEle(),Q=this,E=G.a.mark((function A(){var I;return G.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:(I=document.getElementsByName("seal_img_div_".concat(g.id-1))[D]).id="sign-".concat(I.dataset.signatureId),I.addEventListener("click",(function(){Q.eventBus.dispatch("signatureclick",{source:Q,pageRef:I.dataset.pageRef,signatureId:I.dataset.signatureId})}));case 3:case"end":return A.stop()}}),A)})),D=0;case 9:if(!(D<document.getElementsByName("seal_img_div_".concat(g.id-1)).length)){A.next=14;break}return A.delegateYield(E(),"t0",11);case 11:D++,A.next=9;break;case 14:for(g.renderingState=N.RenderingStates.FINISHED,this.renderHighestPriority(),i=0;i<g.id-10;i++)(o=this._pages[i]).renderingState===N.RenderingStates.FINISHED&&(this.emptyNode(o.div.firstChild),o.renderingState=N.RenderingStates.INITIAL);return A.abrupt("return",!0);case 18:return A.abrupt("return",!1);case 19:case"end":return A.stop()}}),A,this)}))),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,C=!1,Q=c(I);try{for(Q.s();!(g=Q.n()).done;){var E=g.value;if(E.percent<100)break;if(E.id===B){C=!0;break}}}catch(A){Q.e(A)}finally{Q.f()}C||(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),C=this.coreHelper.pageRenderHeight(0,I,this.core),Q=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=C+"px",0,this._pages[I].width=B,this._pages[I].height=C,Q.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform:rotate(",0,"deg) translate(").concat((B-D)/2,"px, ").concat((C-i)/2,"px) scale(").concat(this._currentScale,")"));break;case 90:g.style.width=C+"px",g.style.height=B+"px",(B-C)/2,this._pages[I].width=C,this._pages[I].height=B,Q.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform: translate(").concat((C-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=C+"px",0,this._pages[I].width=B,this._pages[I].height=C,Q.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform:rotate(",180,"deg) translate(").concat(-(B-D)/2,"px, ").concat(-(C-i)/2,"px) scale(").concat(this._currentScale,")"));break;case 270:g.style.width=C+"px",g.style.height=B+"px",-(B-C)/2,this._pages[I].width=C,this._pages[I].height=B,Q.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform: translate(").concat((C-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,pageWidthMM:this.core.pageWidth(0,I),pageHeightMM:this.core.pageHeight(0,I)};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 F=this.viewer.scrollWidth;this.container.scrollTo({left:this.lastViewerContainerScrollLeft/this.lastViewerWidth*F})}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 C=this.coreHelper.pageRenderWidth(0,g,this.core),Q=this.coreHelper.pageRenderHeight(0,g,this.core);B.style.width=C+"px",B.style.height=Q+"px",B.style.overflow="hidden",B.style.position="relative";var E=document.createElement("div");B.style.width=C+"px",B.style.height=Q+"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((C-i)/2,"px, ").concat((Q-o)/2,"px) scale(").concat(this._currentScale,")"),B.appendChild(E),A.appendChild(B),0===g&&E.appendChild(this.initLoadingImg());var w={width:C,height:Q,scale:this._currentScale,pageWidthMM:this.core.pageWidth(0,g),pageHeightMM:this.core.pageHeight(0,g)};this._pages.push({div:B,viewport:w,id:g+1,renderingState:N.RenderingStates.INITIAL,scale:this._currentScale,width:C,height:Q})}}},{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 C=N.SCROLLBAR_PADDING,Q=N.VERTICAL_PADDING,E=(this.container.clientWidth-C)/B.width*B.scale/1,D=(this.container.clientHeight-Q)/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 C=new Set,Q=this._spreadMode-1;A%2!==Q?(C.add(A-1),C.add(A)):(C.add(A-2),C.add(A-1));var E,D=null,i=c(C);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===Q&&(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 C=this._spreadMode-1,Q=null,E=0,D=I.length;E<D;++E)null===Q?((Q=document.createElement("div")).className="spread",this.viewer.appendChild(Q)):E%2===C&&(Q=Q.cloneNode(!1),this.viewer.appendChild(Q)),Q.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;if(this._scrollMode===N.ScrollMode.PAGE)this._setCurrentPageNumber(A+1),this.ensurePageViewVisible();else{this._spreadMode===N.SpreadMode.ODD&&(A=Math.ceil(A/2)),this._spreadMode===N.SpreadMode.EVEN&&(A=Math.floor(A/2),A++);var I=this.viewer.children.item(A);null==I||I.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._spreadMode===N.SpreadMode.ODD&&(A=Math.ceil(A/2),A-=2),this._spreadMode===N.SpreadMode.EVEN&&(A=Math.floor(A/2),A-=1),this.viewer.children.item(A).scrollIntoView(!0));return!0}},{key:"jumpPage",value:function(A){if(this.jumpPageEvt=A,this._scrollMode===N.ScrollMode.PAGE)A.pageIndex&&this._setCurrentPageNumber(A.pageIndex),this.ensurePageViewVisible();else{var I=this.viewer.children.item(A.pageIndex-1);if(I.scrollIntoView(!0),this.highLightEle(),A.sign){var g=document.getElementById("sign-".concat(A.sign));null==g||g.scrollIntoView(!0);var B=g.style.left,C=g.style.top;g instanceof SVGElement||(B=g.parentElement.style.left,C=g.parentElement.style.top);var Q=document.createElement("div");Q.className="highLight",Q.setAttribute("style","position:absolute;left:".concat(B,";top:").concat(C,";width:").concat(g.style.width,";height:").concat(g.style.height)),I.firstElementChild.appendChild(Q)}}}},{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,B=(this.container.clientWidth,new M.Ofd_Core_Helper(96)),C=(this.container.clientWidth-I)/B.pageRenderWidth(0,0,this.core)*1/1,Q=(this.container.clientHeight-g)/B.pageRenderHeight(0,0,this.core)*1/1,E=C;if(this.defaultScale!==N.DEFAULT_SCALE_VALUE)switch(E=this.defaultScale){case"page-actual":E=1;break;case"page-width":E=C;break;case"page-height":E=Q;break;case"page-fit":E=Math.min(C,Q)}this._currentScale=E,this.coreHelper.setDpi(96*E),this.initDiv(0),this.updateView(),this.viewer.classList.toggle("scrollHorizontal",this._scrollMode===N.ScrollMode.HORIZONTAL),this.eventBus.dispatch("scalechanging",{source:this,scale:E,presetValue:this.defaultScale}),this.eventBus.dispatch("viewportchanging",{source:this}),this.scrollModePageState={previousPageNumber:1,scrollDown:!0,pages:[]},this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:U.AnnotationEditorType.NONE})}}]),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,"clamp",(function(){return z})),g.d(I,"animationStarted",(function(){return u})),g.d(I,"apiPageLayoutToViewerModes",(function(){return _})),g.d(I,"apiPageModeToSidebarView",(function(){return $})),g.d(I,"approximateFraction",(function(){return q})),g.d(I,"AutoPrintRegExp",(function(){return L})),g.d(I,"backtrackBeforeAllVisibleElements",(function(){return x})),g.d(I,"binarySearchFirstItem",(function(){return Z})),g.d(I,"DEFAULT_SCALE",(function(){return G})),g.d(I,"DEFAULT_SCALE_DELTA",(function(){return N})),g.d(I,"DEFAULT_SCALE_VALUE",(function(){return F})),g.d(I,"getActiveOrFocusedElement",(function(){return v})),g.d(I,"getPageSizeInches",(function(){return W})),g.d(I,"getVisibleElements",(function(){return p})),g.d(I,"isPortraitOrientation",(function(){return O})),g.d(I,"isValidRotation",(function(){return T})),g.d(I,"isValidScrollMode",(function(){return j})),g.d(I,"isValidSpreadMode",(function(){return X})),g.d(I,"MAX_AUTO_SCALE",(function(){return M})),g.d(I,"MAX_SCALE",(function(){return h})),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 V})),g.d(I,"OutputScale",(function(){return J})),g.d(I,"parseQueryString",(function(){return e})),g.d(I,"PresentationModeState",(function(){return a})),g.d(I,"ProgressBar",(function(){return P})),g.d(I,"removeNullCharacters",(function(){return r})),g.d(I,"RendererType",(function(){return S})),g.d(I,"RenderingStates",(function(){return s})),g.d(I,"roundToDivide",(function(){return f})),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 Y})),g.d(I,"SpreadMode",(function(){return H})),g.d(I,"TextLayerMode",(function(){return k})),g.d(I,"UNKNOWN_SCALE",(function(){return R})),g.d(I,"VERTICAL_PADDING",(function(){return c})),g.d(I,"watchScroll",(function(){return d})),g.d(I,"signTimeFormat",(function(){return IA})),g.d(I,"toggleExpandedBtn",(function(){return AA}));var B=g(23),C=g.n(B),Q=g(5),E=g.n(Q),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,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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}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 F="auto",G=1,N=1.1,y=.1,h=10,R=0,M=1.25,U=40,c=5,s={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},a={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},Y={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4,SIGNATURES:5},S={CANVAS:"canvas",SVG:"svg"},k={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},L=/\bprint\s*\(/,J=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 C=A.offsetTop+A.clientTop,Q=A.offsetLeft+A.clientLeft;B.clientHeight===B.scrollHeight&&B.clientWidth===B.scrollWidth||g&&(B.classList.contains("markedContent")||"hidden"===getComputedStyle(B).overflow);)if(C+=B.offsetTop,Q+=B.offsetLeft,!(B=B.offsetParent))return;I&&(void 0!==I.top&&(C+=I.top),void 0!==I.left&&(Q+=I.left,B.scrollLeft=Q)),B.scrollTop=C}}function d(A,I){var g=function(g){C||(C=window.requestAnimationFrame((function(){C=null;var g=A.scrollLeft,Q=B.lastX;g!==Q&&(B.right=g>Q),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},C=null;return A.addEventListener("scroll",g,!0),B}function e(A){var I,g=new Map,B=o(new URLSearchParams(A));try{for(B.s();!(I=B.n()).done;){var Q=C()(I.value,2),E=Q[0],D=Q[1];g.set(E.toLowerCase(),D)}}catch(A){B.e(A)}finally{B.f()}return g}var n=/\x00/g,l=/[\x01-\x1F]/g;function r(A){return"string"!=typeof A?A:(arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(A=A.replace(l," ")),A.replace(n,""))}function Z(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 C=g+B>>1;I(A[C])?B=C:g=C+1}return g}function q(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,C=1,Q=1,E=1;;){var D=B+Q,i=C+E;if(i>8)break;g<=D/i?(Q=D,E=i):(B=D,C=i)}return g-B/C<Q/E-g?g===A?[B,C]:[C,B]:g===A?[Q,E]:[E,Q]}function f(A,I){var g=A%I;return 0===g?A:Math.round(A-g+I)}function W(A){var I=A.view,g=A.userUnit,B=A.rotate,Q=C()(I,4),E=Q[0],D=Q[1],i=B%180!=0,o=(Q[2]-E)/72*g,w=(Q[3]-D)/72*g;return{width:i?w:o,height:i?o:w}}function x(A,I,g){if(A<2)return A;var B=I[A].div,C=B.offsetTop+B.clientTop;C>=g&&(C=(B=I[A-1].div).offsetTop+B.clientTop);for(var Q=A-2;Q>=0&&!((B=I[Q].div).offsetTop+B.clientTop+B.clientHeight<=C);--Q)A=Q;return A}function p(A){var I=A.scrollEl,g=A.views,B=A.sortByVisibility,C=void 0!==B&&B,Q=A.horizontal,E=void 0!==Q&&Q,D=A.rtl,i=void 0!==D&&D,o=I.scrollTop,w=o+I.clientHeight,F=I.scrollLeft,G=F+I.clientWidth;var N=[],y=new Set,h=g.length,R=Z(g,E?function(A){var I=A.div,g=I.offsetLeft+I.clientLeft,B=g+I.clientWidth;return i?g<G:B>F}:function(A){var I=A.div;return I.offsetTop+I.clientTop+I.clientHeight>o});R>0&&R<h&&!E&&(R=x(R,g,o));for(var M=E?G:-1,U=R;U<h;U++){var c=g[U],s=c.div,a=s.offsetLeft+s.clientLeft,Y=s.offsetTop+s.clientTop,S=s.clientWidth,k=s.clientHeight,K=a+S,H=Y+k;if(-1===M)H>=w&&(M=H);else if((E?a:Y)>M)break;if(!(H<=o||Y>=w||K<=F||a>=G)){var L=Math.max(0,o-Y)+Math.max(0,H-w),J=(S-(Math.max(0,F-a)+Math.max(0,K-G)))/S,t=(k-L)/k*J*100|0;N.push({id:c.id,x:a,y:Y,view:c,percent:t,widthPercent:100*J|0}),y.add(c.id)}}var d=N[0],e=N[N.length-1];return C&&N.sort((function(A,I){var g=A.percent-I.percent;return Math.abs(g)>.001?-g:A.id-I.id})),{first:d,last:e,views:N,ids:y}}function b(A){A.preventDefault()}function V(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=V(A);return 0===A.deltaMode?I/=900:1===A.deltaMode&&(I/=30),I}function T(A){return Number.isInteger(A)&&A%90==0}function j(A){return Number.isInteger(A)&&Object.values(K).includes(A)&&A!==K.UNKNOWN}function X(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)}));function z(A,I,g){return Math.min(Math.max(A,I),g)}var P=function(){function A(I){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},B=g.height,C=g.width,Q=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=C||100,this.units=Q||"%",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){this._indeterminate=isNaN(A),this._percent=z(A,0,100),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 v(){for(var A=document,I=A.activeElement||A.querySelector(":focus");I&&I.shadowRoot;)I=(A=I.shadowRoot).activeElement||A.querySelector(":focus");return I}function _(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 Y.NONE;case"UseThumbs":return Y.THUMBS;case"UseOutlines":return Y.OUTLINE;case"UseAttachments":return Y.ATTACHMENTS;case"UseOC":return Y.LAYERS}return Y.NONE}function AA(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;A.classList.toggle("toggled",I),A.setAttribute("aria-expanded",I),null==g||g.classList.toggle("hidden",!I)}function IA(A){if(A.indexOf("D:")>=0){var I=A.match(/D:(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\+(\d{2})'(\d{2})'/);if(I){var g=C()(I,9),B=(g[0],g[1]),Q=g[2],E=g[3],D=g[4],i=g[5],o=g[6];g[7],g[8];return"".concat(B,"-").concat(Q,"-").concat(E," ").concat(D,":").concat(i,":").concat(o," ")}}else if(A.indexOf("Z")>=0){var w=A.match(/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/);if(w){var F=C()(w,7),G=(F[0],F[1]),N=F[2],y=F[3],h=F[4],R=F[5],M=F[6];return"".concat(G,"-").concat(N,"-").concat(y," ").concat(h,":").concat(R,":").concat(M," ")}}return A}},function(A,I,g){var B=g(24),C=g(25),Q=g(26),E=g(28);A.exports=function(A,I){return B(A)||C(A,I)||Q(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,C,Q,E,D=[],i=!0,o=!1;try{if(Q=(g=g.call(A)).next,0===I){if(Object(g)!==g)return;i=!1}else for(;!(i=(B=Q.call(g)).done)&&(D.push(B.value),D.length!==I);i=!0);}catch(A){o=!0,C=A}finally{try{if(!i&&null!=g.return&&(E=g.return(),Object(E)!==E))return}finally{if(o)throw C}}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 C}));var B=g(22);function C(A,I,g){var B=arguments.length>3&&void 0!==arguments[3]&&arguments[3],C=A.views,E=C.length;if(0===E)return null;for(var D=0;D<E;D++){var i=C[D].view;if(!Q(i))return i}var o=A.first.id,w=A.last.id;if(w-o+1>E)for(var F=A.ids,G=1,N=w-o;G<N;G++){var y=g?o+G:w-G;if(!F.has(y)){var h=I[y-1];if(!Q(h))return h}}var R=g?w:o-2,M=I[R];return M&&!Q(M)||B&&(M=I[R+=g?1:-1])&&!Q(M)?M:null}function Q(A){return A.renderingState===B.RenderingStates.FINISHED}},function(A,I,g){"use strict";g.r(I),g.d(I,"Ofd_Render",(function(){return U}));var B=g(6),C=g.n(B),Q=g(5),E=g.n(Q),D=g(1),i=g.n(D),o=g(7),w=g.n(o),F=g(31),G=g(32),N=g(35),y=(g(36),g(37)),h=g.n(y);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 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,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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}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=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,C,Q){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),G=E.Signatures?E.Signatures.Signature:[],y=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,s=R(i);try{for(s.s();!(c=s.n()).done;){var a,Y=c.value,S=R(w);try{for(S.s();!(a=S.n()).done;){var k=a.value;if(k.ID==Y.TemplateID){if((k=B?B.readPageFromTemplate(k):this.core.readPageFromTemplate(k)).Page.Content){var K,H=R(k.Page.Content.Layer);try{for(H.s();!(K=H.n()).done;){var L=K.value;this.renderLayer(Q,C,g,A,y,h,U,M,L,!1)}}catch(A){H.e(A)}finally{H.f()}}break}}}catch(A){S.e(A)}finally{S.f()}}}catch(A){s.e(A)}finally{s.f()}}if(D.Page.Content){var J,t=R(D.Page.Content.Layer);try{for(t.s();!(J=t.n()).done;){var d=J.value;this.renderLayer(Q,C,g,A,y,h,U,M,d,!1)}}catch(A){t.e(A)}finally{t.f()}}var e,n=R(o);try{for(n.s();!(e=n.n()).done;){var l=e.value;if(D.ID==l.PageID){var r,Z=R(l.PageAnnot.Annot);try{for(Z.s();!(r=Z.n()).done;){var q=r.value;this.renderAnnotation(Q,C,A,q,y,h,U,M,g)}}catch(A){Z.e(A)}finally{Z.f()}}}}catch(A){n.e(A)}finally{n.f()}var f,W=R(G);try{for(W.s();!(f=W.n()).done;){var x,p=f.value,b=R(p.Signature.SignedInfo.StampAnnot);try{for(b.s();!(x=b.n()).done;){var V=x.value,m=V.PageRef;if(D.ID==m){var T=V.Boundary;if(p.Signature.PicType&&p.Signature.PicType.length>0)if("ofd"===p.Signature.PicType)for(var j=new N.Ofd_Core(p.Signature.ofd),X=0;X<j.getOFDPageCount(0);X++)this.renderSealPage(A,X,j,!0,T,m,V.ID,g,p.Signature.ZipName);else if("svg"===p.Signature.PicType){var O=Object(F.converterBox)(T,this.coreHelper.dpi),u=document.createElement("div");u.innerHTML=p.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",V.ID),_.setAttribute("data-page-ref",m),_.appendChild(u),A.appendChild(_)}else{var $=Object(F.converterBox)(T,this.coreHelper.dpi),AA="data:image/".concat(p.Signature.PicType,";base64,").concat(p.Signature.PicValue),IA=this.renderImageOnDiv(g,A.style.width,A.style.height,AA,$.w,$.h,$,V.Clip,!0,m,V.ID);IA.svg.setAttribute("style","".concat(IA.style,"left:").concat(IA.left,"px;top:").concat(IA.top,"px;mix-blend-mode:").concat(this.mixBlendMode)),p.Signature.PicType||IA.svg.removeChild(IA.svg.children[0]),A.appendChild(IA.svg)}else{var gA=Object(F.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",V.ID),BA.setAttribute("data-page-ref",m),A.appendChild(BA)}}}}catch(A){b.e(A)}finally{b.f()}}}catch(A){W.e(A)}finally{W.f()}}},{key:"throwWhite",value:(I=C()(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,C=document.createElement("canvas");C.style.width="".concat(I,"px"),C.style.height="".concat(g,"px"),C.width=I,C.height=g;var Q=C.getContext("2d");Q.drawImage(B,0,0,I,g);for(var E=Q.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);Q.putImageData(E,0,0),A(C.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,C,Q,E,D,i){var o=document.createElement("div");o.setAttribute("style","overflow: hidden;;position:relative;");var w=B.Appearance.Boundary;if(w){var G=Object(F.converterBox)(w,this.coreHelper.dpi);o.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";overflow: visible;position:absolute; left: ").concat(G.x,"px; top: ").concat(G.y,"px; width: ").concat(G.w,"px; height: ").concat(G.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,C,Q,E,D,N,!1),g.appendChild(o)}},{key:"renderSealPage",value:function(A,I,g,B,C,Q,E,D,i){var o,w;o=C;var G=g.pageWidth(0,I),N=g.pageHeight(0,I);G!==o.w&&(w="transform-origin: 0px 0px; transform: scale(".concat(o.h/N<o.w/G?o.h/N:o.w/G,")"));var y=Object(F.converterBox)(o,this.coreHelper.dpi),h=document.createElement("div");h.setAttribute("name","seal_img_div_".concat(D)),h.setAttribute("style","".concat(w,";cursor: pointer; position:absolute; left: ",0,"px; top: ",0,"px; width: ").concat(y.w,"px; height: ").concat(y.h,"px;")),h.setAttribute("data-signature-id",E),h.setAttribute("data-page-ref",Q),this.renderPage(h,0,I,g,E,i);var R=document.createElement("div");R.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")),R.appendChild(h),A.appendChild(R)}},{key:"renderLayer",value:function(A,I,g,B,C,Q,E,D,i,o,w,G,N){var y=null,h=null,M=Object(F.converterDpi)(.353,this.coreHelper.dpi),U=i.DrawParam;if(U&&Object(F.getDrawParam)(Q,U)){var c=Object(F.getDrawParam)(Q,U);if(Object(F.getDrawParam)(Q,c.Relative)){var s=Object(F.getDrawParam)(Q,c.Relative);s&&(s.StrokeColor&&(c.StrokeColor=s.StrokeColor),s.FillColor&&(c.FillColor=s.FillColor),s.LineWidth&&(c.LineWidth=s.LineWidth))}c.FillColor&&(y=Object(F.parseColor)(c.FillColor.Value)),c.StrokeColor&&(h=Object(F.parseColor)(c.StrokeColor.Value)),c.LineWidth&&(M=Object(F.converterDpi)(c.LineWidth,this.coreHelper.dpi))}var a=i.PageBlock;if(a){var Y,S=R(a);try{for(S.s();!(Y=S.n()).done;){var k=Y.value;if("ImageObject"==k.Type){var K=this.renderImageObject(A,I,g,B.style.width,B.style.height,E,k,o,G,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"==k.Type){var H=this.renderPathObject(A,I,g,Q,k,y,h,M,o,w,G,N,E,C);if(H.style){if((H.left<0||H.top<0)&&this.coreHelper.isPrinting)continue;N?H.svg.setAttribute("style","".concat(H.style,"left:").concat(H.left*N.a,"px;top:").concat(H.top*N.d,"px;")):H.svg.setAttribute("style","".concat(H.style,"left:").concat(H.left,"px;top:").concat(H.top,"px;")),B.appendChild(H.svg)}}else if("TextObject"==k.Type){if(i.ctm){var L=i.ctm.split(" ");k.CTM={a:L[0],b:L[1],c:L[2],d:L[3],e:L[4],f:L[5]}}var J=this.renderTextObject(B,C,k,y,h,Q,w,G,N);J&&B.appendChild(J)}else if("CompositeObject"==k.Type){var t,d=R(D);try{for(d.s();!(t=d.n()).done;){var e=t.value;if(e.ID===k.ResourceID){var n=k.Alpha,l=k.Boundary,r=k.CTM;this.renderLayer(A,I,g,B,C,Q,E,D,e,!1,n,l,r);break}}}catch(A){d.e(A)}finally{d.f()}}}}catch(A){S.e(A)}finally{S.f()}}}},{key:"renderImageObject",value:function(A,I,g,B,C,Q,E,D,i,o,w){var N=E.Boundary;N=Object(F.converterBox)(N,this.coreHelper.dpi);var y=E.ResourceID;if(!y)return null;var h=Object(F.getMultiMedia)(Q,y);if(!h.MediaFile)return null;var R,M=E.ImageMask;if(M>0&&(R=Object(F.getMultiMedia)(Q,M)).MediaFile&&!(R.width>0||R.height>0)&&R.MediaFile){var U=Object(G.JSGetImageInfoByPath)(this.core.ofdParserPtr,R.MediaFile,R.MediaFileResPln,this.core.getDocPln(0),A);U.ext,R.width=U.width,R.height=U.height,R.FileBase64=U.fileBase64}if(!(h.width>0||h.height>0)&&h.MediaFile){var c=Object(G.JSGetImageInfoByPath)(this.core.ofdParserPtr,h.MediaFile,h.MediaFileResPln,this.core.getDocPln(0),A);if("other"===c.ext)return null;h.width=c.width,h.height=c.height,h.FileBase64=c.fileBase64}var s=E.CTM,a=E.Clips,Y=E.BlendMode,S=E.Alpha;return this.renderImageOnDiv(g,B,C,h.FileBase64,h.width,h.height,N,!1,D,null,null,s,i,o,a,E.ID,Y,S,M>0&&R.FileBase64?R.FileBase64:null,w)}},{key:"renderImageOnDiv",value:function(A,I,g,B,C,Q,E,D,i,o,w,G,N,y,h,M,U,c,s,a){var Y=parseFloat(I.replace("px","")),S=parseFloat(g.replace("px","")),k=E.w>Y?Y:E.w,K=E.h>S?S:E.h,H=document.createElementNS("http://www.w3.org/2000/svg","svg"),L=document.createElementNS("http://www.w3.org/2000/svg","image"),J="";i&&(J="cursor: pointer;",H.setAttribute("viewbox","0 0 ".concat(k," ").concat(K)),H.setAttribute("name","seal_img_div_".concat(A)),H.setAttribute("data-signature-id",w),H.setAttribute("data-page-ref",o),L.setAttribute("preserveAspectRatio","none slice"));var t=C,d=Q;L.setAttribute("xlink:href",B),L.href.baseVal=B,L.setAttribute("width","".concat(t,"px")),L.setAttribute("height","".concat(d,"px")),c&&L.setAttribute("opacity","".concat(c/255));var e="";if(G){var n=1,l=1;if(a){var r=a.split(" ");n=r[0],l=r[3]}e="matrix(".concat(G.a/t/Object(F.ctmImageScale)(this.coreHelper.dpi)*n," ").concat(G.b/t/Object(F.ctmImageScale)(this.coreHelper.dpi)," ").concat(G.c/d/Object(F.ctmImageScale)(this.coreHelper.dpi)," ").concat(G.d/d/Object(F.ctmImageScale)(this.coreHelper.dpi)*l," ").concat(Object(F.converterDpi)(G.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(G.f,this.coreHelper.dpi),")")}y&&(e="".concat(e," matrix(").concat(y.a," ").concat(y.b," ").concat(y.c," ").concat(y.d," ").concat(Object(F.converterDpi)(y.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(y.f,this.coreHelper.dpi),")")),L.setAttribute("transform",e);var Z="";D&&(D=Object(F.converterBox)(D,this.coreHelper.dpi),Z="clip: rect(".concat(D.y,"px, ").concat(D.w+D.x,"px, ").concat(D.h+D.y,"px, ").concat(D.x,"px)"));var q=[];if(h&&h.length>0)for(var f=0;f<h.length;f++){var W=document.createElementNS("http://www.w3.org/2000/svg","clipPath");W.setAttribute("id","image-clip-path-".concat(M,"-").concat(f));for(var x=h[f].Clip,p=0;p<x.length;p++){var b=x[p].Area,V=0,m=0,T=0,j=0;b.Path.Boundary&&(V=b.Path.Boundary.x,m=b.Path.Boundary.y,T=b.Path.Boundary.w,j=b.Path.Boundary.h);var X=document.createElementNS("http://www.w3.org/2000/svg","path");if(b.CTM)G=b.CTM;else if(b.TransFlag)if(b.Path.CTM);else if(G&&0==G.b&&0==G.c){var O="matrix(".concat(G.a," ").concat(G.b," ").concat(G.c," ").concat(G.d," ").concat(Object(F.converterDpi)(G.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(G.f,this.coreHelper.dpi),")");X.setAttribute("transform",O)}var u,z="",P=R(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(F.converterDpi)(Object(F.adjustPosLimit)(v.crds[0],T)+V,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(v.crds[1],j)+m,this.coreHelper.dpi)," "):"L"===v.cmd?z+="L ".concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(v.crds[0],T)+V,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(v.crds[1],j)+m,this.coreHelper.dpi)," "):"B"===v.cmd?z+="C ".concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(v.crds[0],T)+V,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(v.crds[1],j)+m,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(v.crds[2]+V,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(v.crds[3]+m,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(v.crds[4]+V,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(v.crds[5]+m,this.coreHelper.dpi)," "):"Q"===v.cmd?z+="Q ".concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(v.crds[0],T)+V,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(v.crds[1],j)+m,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(v.crds[2]+V,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(v.crds[3]+m,this.coreHelper.dpi)," "):"A"===v.cmd?z+="A ".concat(Object(F.converterDpi)(v.crds[0],this.coreHelper.dpi),",").concat(Object(F.converterDpi)(v.crds[1],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(v.crds[2],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(v.crds[3],this.coreHelper.dpi),",").concat(Object(F.converterDpi)(v.crds[4],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(v.crds[5],this.coreHelper.dpi),",").concat(Object(F.converterDpi)(v.crds[6],this.coreHelper.dpi)):"C"===v.cmd&&(z+="Z")}}catch(A){P.e(A)}finally{P.f()}X.setAttribute("d",z),W.appendChild(X)}q.push(W)}if(s){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",s),$.href.baseVal=s,$.setAttribute("width","".concat(t,"px")),$.setAttribute("height","".concat(d,"px")),$.setAttribute("filter"," invert(100%)"),_.appendChild($),H.appendChild(_),L.setAttribute("mask","url(#mask-".concat(M,")"))}H.appendChild(L);var AA,IA=E.x,gA=E.y;if(y){var BA=y.a,CA=y.b,QA=y.c,EA=y.d,DA=BA>0?Math.sign(BA)*Math.sqrt(BA*BA+QA*QA):Math.sqrt(BA*BA+QA*QA),iA=EA>0?Math.sign(EA)*Math.sqrt(CA*CA+EA*EA):Math.sqrt(CA*CA+EA*EA);0==Math.atan2(-CA,EA)&&0!=BA&&1==EA||(gA*=iA,IA*=DA)}U&&("Add"==U&&(U="screen"),AA="mix-blend-mode: ".concat(U));var oA="".concat(J,"overflow: visible; position: absolute; width: ").concat(k,"px; height: ").concat(K,"px; ").concat(Z,";").concat(AA,";");if(q.length>0)if(1==q.length)H.appendChild(q[0]),H.setAttribute("clip-path","url(#image-clip-path-".concat(M,"-0)"));else{var wA,FA="",GA=R(q);try{for(GA.s();!(wA=GA.n()).done;){var NA=wA.value;void 0!==NA.children[0].getAttribute("d")&&(FA+="clip-path:path('".concat(NA.children[0].getAttribute("d"),"');"))}}catch(A){GA.e(A)}finally{GA.f()}oA="".concat(FA,";").concat(oA,";")}return{svg:H,style:oA,left:IA,top:gA}}},{key:"renderTextObject",value:function(A,I,g,B,C,Q,E,D,i){var o,w,N,y,M=1,U=g.Boundary;U=Object(F.converterBox)(U,this.coreHelper.dpi);var c=g.CTM,s=g.HScale,a=g.Font,Y=g.Weight,S=g.Alpha/255,k=g.Size>0;c&&!k&&(c={a:-c.a,b:c.b,c:c.c,d:-c.d,e:-c.e,f:-c.f});var K=Object(F.converterDpi)(Math.abs(parseFloat(g.Size)),this.coreHelper.dpi),H=Object(F.calTextPoint)(this.coreHelper.dpi,g.TextCode,g.CGTransform,c,g.Boundary,D,i,k,s),L=document.createElementNS("http://www.w3.org/2000/svg","svg");L.setAttribute("xmlns","http://www.w3.org/2000/svg"),L.setAttribute("version","1.1"),L.setAttribute("id",g.ID);var J,t,d,e=g.FillColor,n=!1,l=g.DrawParam;if(l){var r=Object(F.getDrawParam)(Q,l);r.FillColor&&(e&&e.Value||(e=r.FillColor))}if(e){e.Value&&(B=Object(F.parseColor)(e.Value)),M=e.alpha/255;var Z=e.axialShd;if(Z){n=!0;var q=document.createElementNS("http://www.w3.org/2000/svg","linearGradient");q.setAttribute("id","".concat(g.ID)),q.setAttribute("x1","0%"),q.setAttribute("y1","0%"),q.setAttribute("x2","100%"),q.setAttribute("y2","100%");var f,W=R(Z.Segment);try{for(W.s();!(f=W.n()).done;){var x=f.value;if(x){var p=document.createElement("stop");p.setAttribute("offset","".concat(100*x.position,"%")),p.setAttribute("style","stop-color:".concat(Object(F.parseColor)(x.color.Value),";stop-opacity:1")),q.appendChild(p),B=Object(F.parseColor)(x.color.Value)}}}catch(A){W.e(A)}finally{W.f()}L.appendChild(q)}}g.Stroke&&(J=Object(F.parseColor)(g.StrokeColor.Value),t=g.LineWidth,d=g.LineWidth),g.Fill||(M=0);var b=null===(o=U)||void 0===o?void 0:o.w,V=null===(w=U)||void 0===w?void 0:w.h,m=null===(N=U)||void 0===N?void 0:N.x,T=null===(y=U)||void 0===y?void 0:y.y,j=K,X=K,O=0;if(c){var u=c.a,z=c.b,P=c.c,v=c.d,_=u>0?Math.sign(u)*Math.sqrt(u*u+P*P):Math.sqrt(u*u+P*P),$=v>0?Math.sign(v)*Math.sqrt(z*z+v*v):Math.sqrt(z*z+v*v);0==(O=Math.atan2(-z,v))&&0!=u&&1==v||(j*=_,X*=$,d*=_),0==O&&0!=u&&1==v&&(j*=_,X*=$,d*=_),0==O&&s-0==1&&(s=u/v)>0&&(j*=s)}if(i){var AA=i.a,IA=i.b,gA=i.c,BA=i.d,CA=AA>0?Math.sign(AA)*Math.sqrt(AA*AA+gA*gA):Math.sqrt(AA*AA+gA*gA),QA=BA>0?Math.sign(BA)*Math.sqrt(IA*IA+BA*BA):Math.sqrt(IA*IA+BA*BA);0==(O=Math.atan2(-IA,BA))&&0!=AA&&1==BA||(j*=CA,X*=QA,T*=QA,m*=CA,b*=CA,V*=QA)}var EA=Object(F.getFont)(I,a),DA="",iA="",oA="",wA="";c&&(wA="matrix(".concat(c.a," ").concat(c.b," ").concat(c.c," ").concat(c.d," ").concat(Object(F.converterDpi)(c.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(c.f,this.coreHelper.dpi),")")),i&&(wA="".concat(wA," matrix(").concat(i.a," ").concat(i.b," ").concat(i.c," ").concat(i.d," ").concat(Object(F.converterDpi)(i.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(i.f,this.coreHelper.dpi),")")),s&&(wA="".concat(wA," scale(").concat(s,", 1)"),j*=s);for(var FA=!1,GA=0;GA<H.length;GA++){var NA=H[GA];if(NA&&!isNaN(NA.x)){if(NA.glyph&&EA&&EA.face){FA=!0;var yA=Object(G.loadFaceInfo)(EA.face),hA=Object(G.FT_Glyph_Get_Measure)(EA.face,NA.glyph);d=g.LineWidth;var RA=this.drawGlyph(hA.glyphPath,hA.horiUnderlinePosition,yA.units_per_EM,j,X,C||B,M,J,d,g.ID);if(0===O)RA.img.setAttribute("style","overflow: visible;position:absolute; left: ".concat(Math.ceil(NA.cx),"px; top: ").concat(NA.cy-RA.yScale*hA.horiUnderlinePosition-X,"px;width: ").concat(Math.ceil(j),"px; height:").concat(Math.ceil(X),"px")),Math.ceil(NA.cx)<parseFloat(A.style.width.replace("px",""))&&NA.cy-RA.yScale*hA.horiUnderlinePosition-X<parseFloat(A.style.height.replace("px",""))&&A.appendChild(RA.img);else{var MA=document.createElement("div");MA.setAttribute("style","transform-origin: center;transform: rotate(".concat(-O,"rad);position:absolute; left: ").concat(NA.cx,"px; top: ").concat(NA.cy-RA.yScale*hA.horiUnderlinePosition-X,"px;width: ").concat(Math.ceil(j),"px; height:").concat(Math.ceil(X),"px")),RA.img.setAttribute("style","position: absolute;left: 0px;top:0px;width: ".concat(Math.ceil(j),"px; height:").concat(Math.ceil(X),"px")),MA.appendChild(RA.img),A.appendChild(MA)}}if(DA=s?"".concat(DA).concat(NA.x+s*NA.x," "):"".concat(DA).concat(NA.x," "),iA="".concat(iA).concat(NA.y," "),oA=" "==NA.text?"".concat(oA," "):"".concat(oA).concat(NA.text),H.length>1&&s){var UA=document.createElementNS("http://www.w3.org/2000/svg","text");UA.setAttribute("x",NA.x),UA.setAttribute("y",NA.y),UA.innerHTML=NA.text,UA.setAttribute("transform",wA),n?UA.setAttribute("fill",B):(UA.setAttribute("fill",C),UA.setAttribute("fill",B),UA.setAttribute("fill-opacity",FA?0:M<S?M:S)),FA||(cA&&L.appendChild(cA),UA.setAttribute("clip-path","url(#clip-path-".concat(g.ID,"-0)"))),J&&t>0&&(UA.setAttribute("stroke",J),UA.setAttribute("stroke-width",Object(F.converterDpi)(t,this.coreHelper.dpi))),UA.setAttribute("style","font-weight: ".concat(Y,";font-size:").concat(K,"px;font-family: ").concat(Object(F.getFontFamily)(EA),";")),FA||L.appendChild(UA)}}}var cA=null,sA=g.Clips;if(sA&&sA.length>0){for(var aA=[],YA=0;YA<sA.length;YA++){(cA=document.createElementNS("http://www.w3.org/2000/svg","clipPath")).setAttribute("id","clip-path-".concat(g.ID,"-").concat(YA));for(var SA=sA[YA].Clip,kA=0;kA<SA.length;kA++){var KA=SA[kA].Area,HA=document.createElementNS("http://www.w3.org/2000/svg","path");if(KA.Path.CTM){var LA=KA.Path.CTM,JA="matrix(".concat(LA.a," ").concat(LA.b," ").concat(LA.c," ").concat(LA.d," ").concat(Object(F.converterDpi)(LA.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(LA.f,this.coreHelper.dpi),")");HA.setAttribute("transform",JA)}var tA="",dA=0,eA=0;KA.Path.Boundary&&(dA=KA.Path.Boundary.x,eA=KA.Path.Boundary.y),FA&&(eA=-eA);var nA,lA=R(KA.Path.AbbreviatedData);try{for(lA.s();!(nA=lA.n()).done;){var rA=nA.value;"M"===rA.cmd||"S"===rA.cmd?tA+="M ".concat(Object(F.converterDpi)(rA.crds[0]+dA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[1]+eA,this.coreHelper.dpi)," "):"L"===rA.cmd?tA+="L ".concat(Object(F.converterDpi)(rA.crds[0]+dA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[1]+eA,this.coreHelper.dpi)," "):"B"===rA.cmd?tA+="C ".concat(Object(F.converterDpi)(rA.crds[0]+dA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[1]+eA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[2]+dA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[3]+eA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[4]+dA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[5]+eA,this.coreHelper.dpi)," "):"Q"===rA.cmd?tA+="Q ".concat(Object(F.converterDpi)(rA.crds[0]+dA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[1]+eA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[2]+dA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[3]+eA,this.coreHelper.dpi)," "):"A"===rA.cmd?tA+="A ".concat(Object(F.converterDpi)(rA.crds[0],this.coreHelper.dpi),",").concat(Object(F.converterDpi)(rA.crds[1],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[2],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[3],this.coreHelper.dpi),",").concat(Object(F.converterDpi)(rA.crds[4],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(rA.crds[5],this.coreHelper.dpi),",").concat(Object(F.converterDpi)(rA.crds[6],this.coreHelper.dpi)):"C"===rA.cmd&&(tA+="Z")}}catch(A){lA.e(A)}finally{lA.f()}HA.setAttribute("d",tA),cA.appendChild(HA),aA.push(cA)}}if(aA.length>0)if(1==aA.length)L.appendChild(aA[0]);else{var ZA,qA=R(aA);try{for(qA.s();!(ZA=qA.n()).done;){var fA=ZA.value;void 0!==fA.children[0].getAttribute("d")&&"clip-path:path('".concat(fA.children[0].getAttribute("d"),"');")}}catch(A){qA.e(A)}finally{qA.f()}}}if(!s){var WA=document.createElementNS("http://www.w3.org/2000/svg","text");if(WA.setAttribute("x",DA),WA.setAttribute("y",iA),WA.textContent=oA,WA.setAttribute("transform",wA),n?WA.setAttribute("fill",B):(WA.setAttribute("fill",C),WA.setAttribute("fill",B),WA.setAttribute("fill-opacity",FA?0:M<S?M:S)),g.Visible||WA.setAttribute("fill-opacity",0),FA||(cA&&L.appendChild(cA),WA.setAttribute("clip-path","url(#clip-path-".concat(g.ID,"-0)"))),J&&t>0&&(WA.setAttribute("stroke",J),WA.setAttribute("stroke-width",Object(F.converterDpi)(t,this.coreHelper.dpi))),WA.setAttribute("style","font-weight: ".concat(Y,";font-size:").concat(K,"px;font-family: ").concat(Object(F.getFontFamily)(EA),";")),Object(F.getFontFamily)(EA)&&Object(F.getFontFamily)(EA).indexOf("BarCode")>=0)return"*"==oA||(h()(L,oA,{width:5,fontSize:K,text:"*".concat(oA,"*")}),L.setAttribute("style","overflow:visible;position:absolute;width:".concat(b,"px;height:").concat(V,"px;left:").concat(m,"px;top:").concat(T,"px;")),L.childNodes[1].lastChild.style.letterSpacing="20px"),L;FA&&(WA.setAttribute("fill",""),WA.setAttribute("stroke","")),L.appendChild(WA)}if(D){var xA=Object(F.converterBox)(D,this.coreHelper.dpi);m+=xA.x,T+=xA.y}if(L.setAttribute("style","overflow:visible;position:absolute;width:".concat(b,"px;height:").concat(V,"px;left:").concat(m,"px;top:").concat(T,"px;")),this.coreHelper.isPrinting){if(m>parseFloat(A.style.width.replace("px",""))||T>parseFloat(A.style.height.replace("px","")))return null;if(m<0||T<0)return null}return L}},{key:"renderPathObjectByCanvas",value:function(A,I,g,B,C,Q,E,D,i,o,w){var G=I.Boundary;if(G){G=Object(F.converterBox)(G,this.coreHelper.dpi);var N=Math.ceil(G.w),y=Math.ceil(G.h),h=G.x,M=G.y;if(N-0!=0&&y-0!=0){var U=document.createElement("canvas"),c=U.getContext("2d");U.width=1*N,U.height=1*y,U.style.width="".concat(N,"px"),U.style.height="".concat(y,"px");var s=I.LineWidth,a=I.AbbreviatedData,Y=I.CTM,S=I.StrokeColor,k=I.FillColor;s&&(C=Object(F.converterDpi)(s,this.coreHelper.dpi));var K=I.DrawParam;if(K){var H=Object(F.getDrawParam)(A,K);(s=H.LineWidth)&&(C=Object(F.converterDpi)(s,this.coreHelper.dpi)),H.FillColor&&(k&&k.Value||(k=H.FillColor)),H.StrokeColor&&(S&&S.Value||(S=H.StrokeColor))}Y&&c.transform(Y.a,Y.b,Y.c,Y.d,Object(F.converterDpi)(Y.e,this.coreHelper.dpi),Object(F.converterDpi)(Y.f,this.coreHelper.dpi));var L=!1;if(S){S.Value&&(B=Object(F.parseColor)(S.Value));var J=S.axialShd;if(J){L=!0;var t,d=Object(F.parseCtm)(J.StartPoint),e=Object(F.parseCtm)(J.EndPoint),n=c.createLinearGradient(d[0],d[1],e[0],e[1]),l=R(J.Segment);try{for(l.s();!(t=l.n()).done;){var r=t.value;r&&n.addColorStop(r.position,Object(F.parseColor)(r.color.Value))}}catch(A){l.e(A)}finally{l.f()}c.lineWidth=C,c.strokeStyle=n}}var Z=!1;if(k){k.Value&&(g=Object(F.parseColor)(k.Value)),k.Alpha&&0===k.Alpha&&(c.globalAlpha=0);var q=k.AxialShd;if(q){Z=!0;var f,W=Object(F.parseCtm)(q.StartPoint),x=Object(F.parseCtm)(q.EndPoint),p=c.createLinearGradient(W[0],W[1],x[0],x[1]),b=R(q.Segment);try{for(b.s();!(f=b.n()).done;){var V=f.value;V&&p.addColorStop(V.position,Object(F.parseColor)(V.color.Value))}}catch(A){b.e(A)}finally{b.f()}c.fillStyle=p}}C>0&&!B&&((B=g)||(B="rgb(0, 0, 0)"));var m=I.Clips;if(m&&m.length>0)for(var T=[],j=0;j<m.length;j++){for(var X=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),O=m[j].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=Y?"matrix(".concat(IA.a," ").concat(IA.b," ").concat(IA.c," ").concat(IA.d," ").concat(Object(F.converterDpi)(IA.e-Y.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(IA.f-Y.f,this.coreHelper.dpi),")"):"matrix(".concat(IA.a," ").concat(IA.b," ").concat(IA.c," ").concat(IA.d," ").concat(Object(F.converterDpi)(IA.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(IA.f,this.coreHelper.dpi),")"),Y){var BA=[[Y.a,Y.c,0],[Y.b,Y.d,0],[0,0,1]],CA=Object(F.inv)(BA);isNaN(CA[0][0])||CA[0][0]===1/0||(gA="".concat(gA," matrix(").concat(CA[0][0]," ").concat(CA[1][0]," ").concat(CA[0][1]," ").concat(CA[1][1]," 0 0)"))}P.setAttribute("transform",gA)}if(!z.TransFlag&&z.Path.CTM){var QA=z.Path.CTM,EA="matrix(".concat(QA.a," ").concat(QA.b," ").concat(QA.c," ").concat(QA.d," ").concat(Object(F.converterDpi)(QA.e-Y.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(QA.f-Y.f,this.coreHelper.dpi),")");if(Y){var DA=[[Y.a,Y.c,0],[Y.b,Y.d,0],[0,0,1]],iA=Object(F.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=R(z.Path.AbbreviatedData);try{for(wA.s();!(oA=wA.n()).done;){var FA=oA.value;"M"===FA.cmd||"S"===FA.cmd?c.moveTo(Object(F.converterDpi)(Object(F.adjustPosLimit)(FA.crds[0],$)+v,this.coreHelper.dpi),Object(F.converterDpi)(Object(F.adjustPosLimit)(FA.crds[1],AA)+_,this.coreHelper.dpi)):"L"===FA.cmd?c.lineTo(Object(F.converterDpi)(Object(F.adjustPosLimit)(FA.crds[0],$)+v,this.coreHelper.dpi),Object(F.converterDpi)(Object(F.adjustPosLimit)(FA.crds[1],AA)+_,this.coreHelper.dpi)):"B"===FA.cmd&&c.bezierCurveTo(Object(F.converterDpi)(Object(F.adjustPosLimit)(FA.crds[0],$)+v,this.coreHelper.dpi),Object(F.converterDpi)(Object(F.adjustPosLimit)(FA.crds[1],AA)+_,this.coreHelper.dpi),Object(F.converterDpi)(FA.crds[2]+v,this.coreHelper.dpi),Object(F.converterDpi)(FA.crds[3]+_,this.coreHelper.dpi),Object(F.converterDpi)(FA.crds[4]+v,this.coreHelper.dpi),Object(F.converterDpi)(FA.crds[5]+_,this.coreHelper.dpi))}}catch(A){wA.e(A)}finally{wA.f()}c.closePath(),c.clip()}T.push(X)}if(I.Join&&c.setLineJoin(I["@_Join"]),I.Cap&&c.setLineCap(I["@_Cap"]),I.DashPattern){var GA=I.DashPattern,NA=Object(F.parseCtm)(GA);I.DashOffset&&I.DashOffset,c.setLineDash([Object(F.converterDpi)(NA[0],this.coreHelper.dpi),Object(F.converterDpi)(NA[1],this.coreHelper.dpi)])}c.beginPath();var yA,hA=R(a);try{for(hA.s();!(yA=hA.n()).done;){var RA=yA.value;"M"===RA.cmd||"S"===RA.cmd?c.moveTo(Object(F.converterDpi)(RA.crds[0],this.coreHelper.dpi),Object(F.converterDpi)(RA.crds[1],this.coreHelper.dpi)):"L"===RA.cmd?c.lineTo(Object(F.converterDpi)(RA.crds[0],this.coreHelper.dpi),Object(F.converterDpi)(RA.crds[1],this.coreHelper.dpi)):"B"===RA.cmd?c.bezierCurveTo(Object(F.converterDpi)(RA.crds[0],this.coreHelper.dpi),Object(F.converterDpi)(RA.crds[1],this.coreHelper.dpi),Object(F.converterDpi)(RA.crds[2],this.coreHelper.dpi),Object(F.converterDpi)(RA.crds[3],this.coreHelper.dpi),Object(F.converterDpi)(RA.crds[4],this.coreHelper.dpi),Object(F.converterDpi)(RA.crds[5],this.coreHelper.dpi)):"Q"===RA.cmd?c.quadraticCurveTo(Object(F.converterDpi)(RA.crds[0],this.coreHelper.dpi),Object(F.converterDpi)(RA.crds[1],this.coreHelper.dpi),Object(F.converterDpi)(RA.crds[2],this.coreHelper.dpi),Object(F.converterDpi)(RA.crds[3],this.coreHelper.dpi)):"A"===RA.cmd||"C"===RA.cmd&&c.closePath()}}catch(A){hA.e(A)}finally{hA.f()}I.Stroke&&(L||(c.strokeStyle=B,c.lineWidth=C),c.stroke());var MA=k.pattern;if(!I.Fill||MA?c.fillStyle="none":(Z||(c.fillStyle=g),c.fill(I.Rule)),D){var UA=document.createElement("canvas"),cA=Object(F.converterBox)(D,this.coreHelper.dpi),sA=cA.w,aA=cA.h;cA.x,cA.y;UA.width=1*sA,UA.height=1*aA,UA.style.width="".concat(sA,"px"),UA.style.height="".concat(aA,"px");var YA=UA.getContext("2d");i&&YA.transform(i.a,i.b,i.c,i.d,Object(F.converterDpi)(i.e,this.coreHelper.dpi),Object(F.converterDpi)(i.f,this.coreHelper.dpi)),E&&(YA.globalAlpha=E/255),YA.drawImage(U,h,M)}return U}}}},{key:"renderPathObject",value:function(A,I,g,B,C,Q,E,D,i,o,w,G,N,y){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=C.Boundary;if(!M)return{svg:h,style:""};var U=(M=Object(F.converterBox)(M,this.coreHelper.dpi)).w,c=M.h,s=M.x,a=M.y,Y="overflow:hidden;position:absolute;width:".concat(Math.ceil(U),"px;height:").concat(Math.ceil(c),"px;"),S=C.Clips;if(S&&S.length>1)return{svg:this.renderPathObjectByCanvas(d,C,Q,E,D,i,o,w,G,N,y),style:Y,left:s,top:a};var k=C.LineWidth,K=C.AbbreviatedData,H=C.StrokeColor,L=C.FillColor,J=C.CTM,t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("ID",C.ID),k&&(D=Object(F.converterDpi)(k,this.coreHelper.dpi));var d=C.DrawParam;if(d){var e=Object(F.getDrawParam)(B,d);(k=e.LineWidth)&&(D=Object(F.converterDpi)(k,this.coreHelper.dpi)),e.FillColor&&(L&&L.Value||(L=e.FillColor)),e.StrokeColor&&(H&&H.Value||(H=e.StrokeColor))}J?t.setAttribute("transform","matrix(".concat(J.a," ").concat(J.b," ").concat(J.c," ").concat(J.d," ").concat(Object(F.converterDpi)(J.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(J.f,this.coreHelper.dpi),")")):G&&t.setAttribute("transform","matrix(".concat(G.a," ").concat(G.b," ").concat(G.c," ").concat(G.d," ").concat(Object(F.converterDpi)(G.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(G.f,this.coreHelper.dpi),")"));if(H){H.Value&&(E=Object(F.parseColor)(H.Value));var n=H.axialShd;if(n){!0;var l=document.createElementNS("http://www.w3.org/2000/svg","linearGradient");l.setAttribute("id","".concat(C.ID)),l.setAttribute("x1","0%"),l.setAttribute("y1","0%"),l.setAttribute("x2","100%"),l.setAttribute("y2","100%");var r,Z=R(n.Segment);try{for(Z.s();!(r=Z.n()).done;){var q=r.value;if(q){var f=document.createElement("stop");f.setAttribute("offset","".concat(100*q.position,"%")),f.setAttribute("style","stop-color:".concat(Object(F.parseColor)(q.color.Value),";stop-opacity:1")),l.appendChild(f),E=Object(F.parseColor)(q.color.Value)}}}catch(A){Z.e(A)}finally{Z.f()}h.appendChild(l)}}if(L){L.Value&&(Q=Object(F.parseColor)(L.Value)),void 0!==L.Alpha&&0===L.Alpha&&(Q="none"),void 0!==L.alpha&&0===L.alpha?Q="none":t.setAttribute("fill-opacity","".concat(L.alpha/255));var W=L.axialShd;if(W){!0;var x=document.createElement("linearGradient");x.setAttribute("id","".concat(C.ID)),x.setAttribute("x1","0%"),x.setAttribute("y1","0%"),x.setAttribute("x2","100%"),x.setAttribute("y2","100%");var p,b=R(W.Segment);try{for(b.s();!(p=b.n()).done;){var V=p.value;if(V){var m=document.createElement("stop");m.setAttribute("offset","".concat(100*V.position,"%")),m.setAttribute("style","stop-color:".concat(Object(F.parseColor)(V.color.Value),";stop-opacity:1")),x.appendChild(m),Q=Object(F.parseColor)(V.color.Value)}}}catch(A){b.e(A)}finally{b.f()}h.appendChild(x)}}if(D>0&&!E&&(E="rgb(0, 0, 0)"),0===C.Alpha&&(Q="none"),o&&t.setAttribute("fill-opacity","".concat(o/255)),C.Stroke&&(t.setAttribute("stroke","".concat(E)),t.setAttribute("stroke-width","".concat(D,"px"))),C.Fill?(t.setAttribute("fill-rule",C.Rule),t.setAttribute("fill","".concat(i?"none":Q||"none"))):t.setAttribute("fill","none"),C.Join&&t.setAttribute("stroke-linejoin","".concat(C["@_Join"])),C.Cap&&t.setAttribute("stroke-linecap","".concat(C["@_Cap"])),C.DashPattern){var T=C.DashPattern,j=Object(F.parseCtm)(T),X=0;C.DashOffset&&(X=C.DashOffset),t.setAttribute("stroke-dasharray","".concat(Object(F.converterDpi)(j[0],this.coreHelper.dpi),",").concat(Object(F.converterDpi)(j[1],this.coreHelper.dpi))),t.setAttribute("stroke-dashoffset","".concat(Object(F.converterDpi)(X,this.coreHelper.dpi),"px"))}var O,u="",z=R(K);try{for(z.s();!(O=z.n()).done;){var P=O.value;"M"===P.cmd||"S"===P.cmd?u+="M ".concat(Object(F.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[1],this.coreHelper.dpi)," "):"L"===P.cmd?u+="L ".concat(Object(F.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[1],this.coreHelper.dpi)," "):"B"===P.cmd?u+="C ".concat(Object(F.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[1],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[2],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[3],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[4],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[5],this.coreHelper.dpi)," "):"Q"===P.cmd?u+="Q ".concat(Object(F.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[1],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[2],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[3],this.coreHelper.dpi)," "):"A"===P.cmd?u+="A ".concat(Object(F.converterDpi)(P.crds[0],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(P.crds[1],this.coreHelper.dpi)," ").concat(P.crds[2]," ").concat(P.crds[3],",").concat(P.crds[4]," ").concat(Object(F.converterDpi)(P.crds[5],this.coreHelper.dpi),",").concat(Object(F.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=L.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(F.converterDpi)(v.width,this.coreHelper.dpi)),$.setAttribute("height",Object(F.converterDpi)(v.height,this.coreHelper.dpi)),v.ctm&&$.setAttribute("height",Object(F.converterDpi)(v.height,this.coreHelper.dpi)+Object(F.converterDpi)(v.ctm.split(" ")[5],this.coreHelper.dpi)),$.setAttribute("x",Object(F.converterDpi)(v.width,this.coreHelper.dpi)),$.setAttribute("y",Object(F.converterDpi)(v.height,this.coreHelper.dpi)),$.setAttribute("id","pattern1-".concat(C.ID)),$.setAttribute("patternUnits","userSpaceOnUse"),this.renderLayer(A,I,g,$,y,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(C.ID,")")),h.appendChild(AA)}if(S&&S.length>0){for(var IA=[],gA=0;gA<S.length;gA++){var BA=document.createElementNS("http://www.w3.org/2000/svg","clipPath");BA.setAttribute("id","clip-path-".concat(I,"-").concat(g,"-").concat(C.ID,"-").concat(gA));for(var CA=S[gA].Clip,QA=0;QA<CA.length;QA++){var EA=CA[QA].Area,DA=document.createElementNS("http://www.w3.org/2000/svg","path"),iA="",oA=0,wA=0,FA=0,GA=0;if(EA.Path.Boundary&&(oA=EA.Path.Boundary.x,wA=EA.Path.Boundary.y,FA=EA.Path.Boundary.w,GA=EA.Path.Boundary.h),!EA.TransFlag&&EA.CTM){var NA=EA.CTM,yA=void 0;if(yA=J?"matrix(".concat(NA.a," ").concat(NA.b," ").concat(NA.c," ").concat(NA.d," ").concat(Object(F.converterDpi)(NA.e-J.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(NA.f-J.f,this.coreHelper.dpi),")"):"matrix(".concat(NA.a," ").concat(NA.b," ").concat(NA.c," ").concat(NA.d," ").concat(Object(F.converterDpi)(NA.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(NA.f,this.coreHelper.dpi),")"),J){var hA=[[J.a,J.c,0],[J.b,J.d,0],[0,0,1]],RA=Object(F.inv)(hA);isNaN(RA[0][0])||RA[0][0]===1/0||(yA="".concat(yA," matrix(").concat(RA[0][0]," ").concat(RA[1][0]," ").concat(RA[0][1]," ").concat(RA[1][1]," 0 0)"))}DA.setAttribute("transform",yA)}var MA,UA=R(EA.Path.AbbreviatedData);try{for(UA.s();!(MA=UA.n()).done;){var cA=MA.value;"M"===cA.cmd||"S"===cA.cmd?iA+="M ".concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[0],FA)+oA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[1],GA)+wA,this.coreHelper.dpi)," "):"L"===cA.cmd?iA+="L ".concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[0],FA)+oA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[1],GA)+wA,this.coreHelper.dpi)," "):"B"===cA.cmd?iA+="C ".concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[0],FA)+oA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[1],GA)+wA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(cA.crds[2]+oA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(cA.crds[3]+wA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(cA.crds[4]+oA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(cA.crds[5]+wA,this.coreHelper.dpi)," "):"Q"===cA.cmd?iA+="Q ".concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[0],FA)+oA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[1],GA)+wA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(cA.crds[2]+oA,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(cA.crds[3]+wA,this.coreHelper.dpi)," "):"A"===cA.cmd?iA+="A ".concat(Object(F.converterDpi)(cA.crds[0],this.coreHelper.dpi),",").concat(Object(F.converterDpi)(cA.crds[1],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(cA.crds[2],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(cA.crds[3],this.coreHelper.dpi),",").concat(Object(F.converterDpi)(cA.crds[4],this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(cA.crds[5],this.coreHelper.dpi),",").concat(Object(F.converterDpi)(cA.crds[6],this.coreHelper.dpi)):"C"===cA.cmd&&(iA+="Z")}}catch(A){UA.e(A)}finally{UA.f()}if(!EA.TransFlag&&EA.Path.CTM){var sA=EA.Path.CTM,aA="matrix(".concat(sA.a," ").concat(sA.b," ").concat(sA.c," ").concat(sA.d," ").concat(Object(F.converterDpi)(sA.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(sA.f,this.coreHelper.dpi),")");if(J){aA="matrix(".concat(sA.a," ").concat(sA.b," ").concat(sA.c," ").concat(sA.d," ").concat(Object(F.converterDpi)(sA.e-J.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(sA.f-J.f,this.coreHelper.dpi),")");var YA=[[J.a,J.c,0],[J.b,J.d,0],[0,0,1]],SA=Object(F.inv)(YA);isNaN(SA[0][0])||SA[0][0]===1/0||(aA="".concat(aA," matrix(").concat(SA[0][0]," ").concat(SA[1][0]," ").concat(SA[0][1]," ").concat(SA[1][1]," 0 0)"))}DA.setAttribute("transform",aA)}DA.setAttribute("d",iA),BA.appendChild(DA),EA.TransFlag&&EA.Path.CTM&&BA.setAttribute("id","none")}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(C.ID,"-0)"));else{var kA,KA="",HA=R(IA);try{for(HA.s();!(kA=HA.n()).done;){var LA=kA.value;void 0!==LA.children[0].getAttribute("d")&&(KA+="clip-path:path('".concat(LA.children[0].getAttribute("d"),"');"))}}catch(A){HA.e(A)}finally{HA.f()}t.setAttribute("style",KA)}}if(w){var JA=document.createElementNS("http://www.w3.org/2000/svg","svg");JA.setAttribute("version","1.1");var tA=Object(F.converterBox)(w,this.coreHelper.dpi),dA=Math.ceil(tA.w),eA=Math.ceil(tA.h),nA=tA.x+s,lA=tA.y+a;return Y="overflow:hidden;position:absolute;width:".concat(dA,"px;height:").concat(eA,"px;"),G&&J&&h.setAttribute("transform","matrix(".concat(G.a," ").concat(G.b," ").concat(G.c," ").concat(G.d," ").concat(Object(F.converterDpi)(G.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(G.f,this.coreHelper.dpi),")")),JA.appendChild(h),{svg:JA,style:Y,left:nA,top:lA}}return{svg:h,style:Y,left:s,top:a}}},{key:"drawGlyph",value:function(A,I,g,B,C,Q,E,D,i,o){var w=B/g,G=C/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(C,") scale(").concat(w,", ").concat(-G,") translate(0, ").concat(-I,")")),y.setAttribute("d",A),Q&&y.setAttribute("fill",Q),y.setAttribute("fill-opacity",E),D&&(y.setAttribute("stroke","".concat(D)),y.setAttribute("stroke-width","".concat(3*Object(F.converterDpi)(i,this.coreHelper.dpi),"px"))),N.appendChild(y),{img:N,yScale:G}}},{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 C,Q,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++){Q=I.watermark_y+(I.watermark_y_space+I.watermark_height)*o;for(var w=0;w<I.watermark_cols;w++){C=I.watermark_x+(I.watermark_width+I.watermark_x_space)*w;var F=document.createElement("div");F.id="mask_div"+o+w,F.className="mask_div",F.innerHTML=I.watermark_txt,F.style.webkitTransform="rotate(-"+I.watermark_angle+"deg)",F.style.MozTransform="rotate(-"+I.watermark_angle+"deg)",F.style.msTransform="rotate(-"+I.watermark_angle+"deg)",F.style.OTransform="rotate(-"+I.watermark_angle+"deg)",F.style.transform="rotate(-"+I.watermark_angle+"deg)",F.style.visibility="",F.style.position="absolute",F.style.left=C+"px",F.style.top=Q+"px",F.style.overflow="hidden",F.style.zIndex="9999",F.style.pointerEvents="none",F.style.opacity=I.watermark_alpha,F.style.fontSize=I.watermark_fontsize,F.style.fontFamily=I.watermark_font,F.style.color=I.watermark_color,F.style.textAlign="center",F.style.width=I.watermark_width+"px",F.style.height=I.watermark_height+"px",F.style.display="block",E.appendChild(F)}}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 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 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 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}g.r(I),g.d(I,"converterDpi",(function(){return Q})),g.d(I,"ctmImageScale",(function(){return E})),g.d(I,"adjustPosLimit",(function(){return w})),g.d(I,"calTextPoint",(function(){return F})),g.d(I,"decodeHtml",(function(){return y})),g.d(I,"getFontFamily",(function(){return R})),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 a})),g.d(I,"Uint8ArrayToHexString",(function(){return Y})),g.d(I,"replaceFirstSlash",(function(){return S})),g.d(I,"replaceFirstTarget",(function(){return k})),g.d(I,"readUTF",(function(){return K})),g.d(I,"getMultiMedia",(function(){return H})),g.d(I,"getDrawParam",(function(){return L})),g.d(I,"getFont",(function(){return J})),g.d(I,"inv",(function(){return e}));var Q=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:(null==g?void 0:g.x)+A,cy:(null==g?void 0:g.y)+I}},w=function(A,I){return 0===I?A:A>I?I:A},F=function(A,I,g,C,E,w,F,G,N){var h=0,R=0,M=0,U=0,c=[];if(!I)return c;var s,a=B(I);try{for(a.s();!(s=a.n()).done;){var Y=s.value;if(Y){if(h=G?parseFloat(Y.X):-parseFloat(Y.X),R=G?parseFloat(Y.Y):-parseFloat(Y.Y),isNaN(h)&&(h=0),isNaN(R)&&(R=0),M=h,U=R,C){var S=D(M,U,C);M=S.cx,U=S.cy}var k=[],K=[];Y.DeltaX&&Y.DeltaX.length>0&&(k=Y.DeltaX),Y.DeltaY&&Y.DeltaY.length>0&&(K=Y.DeltaY);var H=Y.text;if(H){H=(H=y(H+="")).replace(/ /g," ");for(var L=0;L<H.length;L++){if(L>0&&k.length>0){var J=L-1;if(J>=k.length&&(J=k.length-1),h+=N?G?k[J]/N:-k[J]/N:G?k[J]:-k[J],C)M+=i(G?k[L-1]:-k[L-1],0,C).ctmX;else M=h}if(L>0&&K.length>0){var t=L-1;if(t>=K.length&&(t=K.length-1),R+=G?K[t]:-K[t],C)U+=i(0,G?K[L-1]:-K[L-1],C).ctmY;else U=R}var d=H.substring(L,L+1),e=o(M,U,E);F&&(e=D(e.cx,e.cy,F));var n={x:Q(h,A),y:Q(R,A),text:d,cx:Q(e.cx,A),cy:Q(e.cy,A)};c.push(n)}}}}}catch(A){a.e(A)}finally{a.f()}if(c.length>0){var l,r=B(g);try{for(r.s();!(l=r.n()).done;)for(var Z=l.value,q=Z.CodePosition,f=Z.GlyphCount,W=q;W<f+q;W++)if(c.length<=W){var x="".concat(c[c.length-1].glyph," ").concat(Z.Glyphs[W-q]);c[c.length-1].glyph=x}else c[W].glyph=Z.Glyphs[W-q]}catch(A){r.e(A)}finally{r.f()}}return c},G=/&\w+;|&#(\d+);/g,N={"<":"<",">":">","&":"&"," ":" ",""":'"',"©":"","'":"'"},y=function(A){return"string"!=typeof(A=null!=A?A:this.toString())?A:A.replace(G,(function(A,I){var g=N[A];return null==g&&(g=isNaN(I)?A:String.fromCharCode(160==I?32:I)),g}))},h={"仿宋_gb2312":"FangSong, STFangsong, simfang","楷体_gb2312":"楷体_GB2312, KaiTi_GB2312 ","楷体":"楷体, 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",couriernew:"Courier New","courier new":"Courier New",ChangFangSong:"ChangFangSong, FangSong",FangSong_GB2312:"FangSong",fzfs:"方正仿宋_gbk, FangSong, STFangsong, simfang"},R=function(A){if(!A)return h["宋体"];var I=A.FamilyName;if(I||(I=A.FontName),h[I.toLowerCase()])return h[I.toLowerCase()];for(var g=0,B=Object.keys(h);g<B.length;g++){var C=B[g];if(-1!=I.toLowerCase().indexOf(C.toLowerCase()))return h[C]}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=s(I[0],I[1],I[2],I[3]);return"rgb(".concat(g.r,", ").concat(g.g,", ").concat(g.b,")")}},s=function(A,I,g,B,C){var Q=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 C||(Q=Math.round(255*Q),E=Math.round(255*E),D=Math.round(255*D)),{r:Q,g:E,b:D}},a=function(A,I){return{x:Q(null==A?void 0:A.x,I),y:Q(null==A?void 0:A.y,I),w:Q(null==A?void 0:A.w,I),h:Q(null==A?void 0:A.h,I)}},Y=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 C=[],Q=0;Q<A.length;Q++){var E=I[Q>>>2]>>>24-Q%4*8&255;C.push((E>>>4).toString(16)),C.push((15&E).toString(16))}return C.join("")},S=function(A){return A&&0===A.indexOf("/")&&(A=A.replace("/","")),A},k=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 C=g[B].toString(2),Q=C.match(/^1+?(?=0)/);if(Q&&8==C.length){for(var E=Q[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,C=B(A);try{for(C.s();!(g=C.n()).done;){var Q=g.value;if(Q.ID==I)return Q}}catch(A){C.e(A)}finally{C.f()}},L=function(A,I){var g,C=B(A);try{for(C.s();!(g=C.n()).done;){var Q=g.value;if(Q.ID==I)return Q}}catch(A){C.e(A)}finally{C.f()}},J=function(A,I){var g,C=B(A);try{for(C.s();!(g=C.n()).done;){var Q=g.value;if(Q.ID==I)return Q}}catch(A){C.e(A)}finally{C.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 C=new Array(I-1).fill(0).map((function(A){return new Array(I-1).fill(0)})),Q=0;Q<I-1;Q++)for(var E=0;E<I-1;E++)C[Q][E]=E<B?A[Q+1][E]:A[Q+1][E+1];g+=A[0][B]*Math.pow(-1,0+B)*t(C)}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 C=0;C<I;C++){for(var Q=[],E=0;E<A.length;E++)if(E!==B){for(var D=[],i=0;i<A.length;i++)i!==C&&D.push(A[E][i]);Q.push(D)}g[B][C]=Math.pow(-1,B+C)*t(Q)}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 e(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 C=0;C<g.length;C++)g[B][C]/=I;return g}},function(A,I,g){"use strict";g.r(I),g.d(I,"needInitAgain",(function(){return w})),g.d(I,"setYYDS",(function(){return F})),g.d(I,"freeMemory",(function(){return G})),g.d(I,"getStreamData",(function(){return N})),g.d(I,"getStreamDataBase64",(function(){return y})),g.d(I,"CreateLibrary",(function(){return h})),g.d(I,"CreateNativeStream",(function(){return R})),g.d(I,"FT_Open_Face",(function(){return M})),g.d(I,"loadFaceInfo",(function(){return U})),g.d(I,"FT_Glyph_Get_Measure",(function(){return c})),g.d(I,"freeOFD",(function(){return s})),g.d(I,"readOFD",(function(){return a})),g.d(I,"readOFDByBase64",(function(){return Y})),g.d(I,"hashPath",(function(){return S})),g.d(I,"MD5",(function(){return k})),g.d(I,"SHA1",(function(){return K})),g.d(I,"SM3",(function(){return H})),g.d(I,"base64EncodeByByte",(function(){return L})),g.d(I,"base64Encode",(function(){return J})),g.d(I,"base64DecodeToUint8Array",(function(){return t})),g.d(I,"JSBase64ByHashFile",(function(){return d})),g.d(I,"JSGetImageInfoByBase64",(function(){return e})),g.d(I,"JSGetImageInfoByPath",(function(){return n})),g.d(I,"JSReadPageInfo",(function(){return l})),g.d(I,"JSGetPathEncode",(function(){return r})),g.d(I,"JSPackageSigned",(function(){return Z})),g.d(I,"JSGetToSign",(function(){return q}));var B,C,Q,E,D,i=g(33),o=g(34),w=function(){return!B},F=function(A){B=A},G=function(A){B._ASC_FT_Free(A.data),A.data=0},N=function(){return E},y=function(){return D},h=function(){C=B._ASC_FT_Init()},R=function(A){var I=new Uint8Array(A),g=B._malloc(A.byteLength);return B.HEAPU8.set(I,g),{data:g,length:A.byteLength}},M=function(A){return B._ASC_FT_Open_Face(C,A.data,A.length,0)},U=function(A){var I=B._ASC_FT_GetFaceInfo(A);if(I){var g=new i.CFaceInfo,C=Math.min(B.HEAP8.length-I>>2,250),Q=new Int32Array(B.HEAP8.buffer,I,C),E=0;g.units_per_EM=Math.abs(Q[E++]),g.ascender=Q[E++],g.descender=Q[E++],g.height=Q[E++],g.face_flags=Q[E++],g.num_faces=Q[E++],g.num_glyphs=Q[E++],g.num_charmaps=Q[E++],g.style_flags=Q[E++],g.face_index=Q[E++];for(var D=Q[E++];D;)g.family_name+=String.fromCharCode(D),D=Q[E++];for(D=Q[E++];D;)g.style_name+=String.fromCharCode(D),D=Q[E++];g.os2_version=Q[E++],g.os2_usWeightClass=Q[E++],g.os2_fsSelection=Q[E++],g.os2_usWinAscent=Q[E++],g.os2_usWinDescent=Q[E++],g.os2_usDefaultChar=Q[E++],g.os2_sTypoAscender=Q[E++],g.os2_sTypoDescender=Q[E++],g.os2_sTypoLineGap=Q[E++],g.os2_ulUnicodeRange1=f(Q[E++]),g.os2_ulUnicodeRange2=f(Q[E++]),g.os2_ulUnicodeRange3=f(Q[E++]),g.os2_ulUnicodeRange4=f(Q[E++]),g.os2_ulCodePageRange1=f(Q[E++]),g.os2_ulCodePageRange2=f(Q[E++]),g.os2_nSymbolic=Q[E++],g.header_yMin=Q[E++],g.header_yMax=Q[E++];for(var o=Q[E++],w=0;w<o;w++)g.monochromeSizes.push(Q[E++]);return B._ASC_FT_Free(I),I=null,g}},c=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 C=B.HEAP32[g>>2],Q=new Int32Array(B.HEAP8.buffer,g,C),E=new o.CGlyphMetrics;E.bbox_xMin=Q[1],E.bbox_yMin=Q[2],E.bbox_xMax=Q[3],E.bbox_yMax=Q[4],E.width=Q[5],E.height=Q[6],E.horiAdvance=Q[7],E.horiBearingX=Q[8],E.horiBearingY=Q[9],E.vertAdvance=Q[10],E.vertBearingX=Q[11],E.vertBearingY=Q[12],E.linearHoriAdvance=Q[13],E.linearVertAdvance=Q[14],E.horiUnderlinePosition=E.horiBearingY-E.height;for(var D=15,i="";D<C;)switch(Q[D++]){case 0:i+=" M ".concat(Q[D++]," ").concat(Q[D++]);break;case 1:i+=" L ".concat(Q[D++]," ").concat(Q[D++]);break;case 2:i+=" Q ".concat(Q[D++]," ").concat(Q[D++]," ").concat(Q[D++]," ").concat(Q[D++]);break;case 3:i+=" C ".concat(Q[D++]," ").concat(Q[D++]," ").concat(Q[D++]," ").concat(Q[D++]," ").concat(Q[D++]," ").concat(Q[D++])}return E.glyphPath=i,B._ASC_FT_Free(g),Q=null,E},s=function(A){if(G(Q),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)}))},a=function(A,I,g){E=A,Q=R(A);var D=B.JSReadOFD(C,Q.data,Q.length,I||"kgNVVbdUZ31C6mps",g?g.toLowerCase():"");if(D.data&&D.data.ofd&&(D.data.ofd.size=Q.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},Y=function(A,I,g){D=A;var Q=B.JSReadOFDByBase64(C,A,I||"kgNVVbdUZ31C6mps",g?g.toLowerCase():"");if(0!==Q.code)switch(Q.msg){case"10001":Q.msg="授权信息错误";break;case"10002":Q.msg="授权时间过期";break;case"10003":var E="非ofd文件无法打开";switch(Q.file_type){case 0:break;case 9:E="PDF文件无法打开";break;default:E="图片文件无法打开"}Q.msg=E}return Q},S=function(A,I,g){return B.JSHashPath(A,I,g)},k=function(A){return B.JSMD5(A)},K=function(A){return B.JSSHA1(A)},H=function(A){return B.JSSM3(A)},L=function(A){var I=R(A),g=B.JSBase64EncodeByByte(I.data,I.length);return G(I),g},J=function(A){return B.JSBase64Encode(A)},t=function(A){var I=B.JSBase64Decode(A);return new Uint8Array(B.HEAPU8.buffer,I.ptr,I.len).slice(0,I.len)},d=function(A,I,g){var C=R(A);return B.JSBase64ByHashFile(C.data,C.length,I,g)},e=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},n=function(A,I,g,C,Q){Q||(Q="");var E=B.JSGetImageInfoByPath(A,I,g,C,Q);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},l=function(A,I,g,C,Q){return B.JSReadPageInfo(A,I,g,C,Q)},r=function(A,I,g){var C=B.JSGetPathEncode(A,I,g);if(0===C.code)return new Uint8Array(B.HEAPU8.buffer,C.ptr,C.ptr_len).slice(0,C.ptr_len)},Z=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)},f=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),C=g.n(B),Q=g(5),E=g.n(Q),D=C()((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),C=g.n(B),Q=g(5),E=g.n(Q),D=C()((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),C=g.n(B),Q=g(1),E=g.n(Q),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,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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}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){C()(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 C=Object(D.JSReadPageInfo)(this.ofdParserPtr,B.BasePln,B.BaseAbs,B.pln,B.abs);g.Pages[I].Page=C.Page}return g.Pages[I]}},{key:"indexOfdPage",value:function(A,I){if(!this.ofd)return null;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:"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 C=B.PhysicalBox;if(C)g=C;else{var Q=B.ApplicationBox;if(Q)g=Q;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,C=this.readOfdDocument(A);if(C)for(var Q=0;Q<C.Signatures.Signature.length;Q++){var E,D=i(C.Signatures.Signature);try{for(D.s();!(E=D.n()).done;){var o,w=E.value,F=i(w.Signature.SignedInfo.StampAnnot);try{for(F.s();!(o=F.n()).done;){var G=o.value;if(G.ID==g&&G.PageRef==I){B=w.Signature;break}}}catch(A){F.e(A)}finally{F.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:"getOutline",value:function(A){var I=this.readOfdDocument(A);return I&&I.Outlines?I.Outlines: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,C=i(g.Attachments);try{for(C.s();!(B=C.n()).done;){var Q=B.value;if(Q.ID==I)return Q}}catch(A){C.e(A)}finally{C.f()}}return null}},{key:"getTextObject",value:function(A,I){var g=[],B=this.readOfdPage(A,I);if(B){var C,Q=i(B.Page.Content.Layer);try{for(Q.s();!(C=Q.n()).done;){var E,D=i(C.value.PageBlock);try{for(D.s();!(E=D.n()).done;){var o=E.value;if("TextObject"==o.Type){var w,F="",G=i(o.TextCode);try{for(G.s();!(w=G.n()).done;){var N=w.value;F="".concat(F).concat(N.text)}}catch(A){G.e(A)}finally{G.f()}if(F.length>0){var y={id:o.ID,pageId:B.ID};y.text=F,g.push(y)}}}}catch(A){D.e(A)}finally{D.f()}}}catch(A){Q.e(A)}finally{Q.f()}}return g}},{key:"getAllTextObject",value:function(A){for(var I=[],g=this.readOfdDocument(A),B=0;B<g.Pages.length;B++){var C=g.Pages[B];if(C.Page.onlyReadArea){var Q=Object(D.JSReadPageInfo)(this.ofdParserPtr,C.BasePln,C.BaseAbs,C.pln,C.abs);C.Page=Q.Page}if(C){var E,o=i(C.Page.Content.Layer);try{for(o.s();!(E=o.n()).done;){var w,F=i(E.value.PageBlock);try{for(F.s();!(w=F.n()).done;){var G=w.value;if("TextObject"==G.Type){var N,y="",h=i(G.TextCode);try{for(h.s();!(N=h.n()).done;){var R=N.value;y="".concat(y).concat(R.text)}}catch(A){h.e(A)}finally{h.f()}if(y.length>0){var M={id:G.ID,pageId:C.ID,pageIndex:B+1};M.text=y,I.push(M)}}}}catch(A){F.e(A)}finally{F.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),C=g.n(B),Q=g(1),E=g.n(Q),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]:"";C()(this,A),this.dpi=I,this.waterText=g,this.isPrinting=!1}return E()(A,[{key:"setPrinting",value:function(A){this.isPrinting=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";var B=G(g(38)),C=G(g(73)),Q=G(g(74)),E=G(g(75)),D=G(g(76)),i=G(g(78)),o=G(g(86)),w=g(85),F=G(g(79));function G(A){return A&&A.__esModule?A:{default:A}}var N=function(){},y=function(A,I,g){var B=new N;if(void 0===A)throw Error("No element to render on was provided.");return B._renderProperties=(0,D.default)(A),B._encodings=[],B._options=F.default,B._errorHandler=new o.default(B),void 0!==I&&((g=g||{}).format||(g.format=U()),B.options(g)[g.format](I,g).render()),B};for(var h in y.getModule=function(A){return B.default[A]},B.default)B.default.hasOwnProperty(h)&&R(B.default,h);function R(A,I){N.prototype[I]=N.prototype[I.toUpperCase()]=N.prototype[I.toLowerCase()]=function(g,B){var Q=this;return Q._errorHandler.wrapBarcodeCall((function(){B.text=void 0===B.text?void 0:""+B.text;var E=(0,C.default)(Q._options,B);E=(0,i.default)(E);var D=A[I],o=M(g,D,E);return Q._encodings.push(o),Q}))}}function M(A,I,g){var B=new I(A=""+A,g);if(!B.valid())throw new w.InvalidInputException(B.constructor.name,A);var E=B.encode();E=(0,Q.default)(E);for(var D=0;D<E.length;D++)E[D].options=(0,C.default)(g,E[D].options);return E}function U(){return B.default.CODE128?"CODE128":Object.keys(B.default)[0]}function c(A,I,g){I=(0,Q.default)(I);for(var B=0;B<I.length;B++)I[B].options=(0,C.default)(g,I[B].options),(0,E.default)(I[B].options);(0,E.default)(g),new(0,A.renderer)(A.element,I,g).render(),A.afterRender&&A.afterRender()}N.prototype.options=function(A){return this._options=(0,C.default)(this._options,A),this},N.prototype.blank=function(A){var I=new Array(A+1).join("0");return this._encodings.push({data:I}),this},N.prototype.init=function(){var A;if(this._renderProperties)for(var I in Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]),this._renderProperties){A=this._renderProperties[I];var g=(0,C.default)(this._options,A.options);"auto"==g.format&&(g.format=U()),this._errorHandler.wrapBarcodeCall((function(){var I=M(g.value,B.default[g.format.toUpperCase()],g);c(A,I,g)}))}},N.prototype.render=function(){if(!this._renderProperties)throw new w.NoElementException;if(Array.isArray(this._renderProperties))for(var A=0;A<this._renderProperties.length;A++)c(this._renderProperties[A],this._encodings,this._options);else c(this._renderProperties,this._encodings,this._options);return this},N.prototype._defaults=F.default,"undefined"!=typeof window&&(window.JsBarcode=y),"undefined"!=typeof jQuery&&(jQuery.fn.JsBarcode=function(A,I){var g=[];return jQuery(this).each((function(){g.push(this)})),y(g,A,I)}),A.exports=y},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=g(39),C=g(41),Q=g(49),E=g(59),D=g(63),i=g(70),o=g(71),w=g(72);I.default={CODE39:B.CODE39,CODE128:C.CODE128,CODE128A:C.CODE128A,CODE128B:C.CODE128B,CODE128C:C.CODE128C,EAN13:Q.EAN13,EAN8:Q.EAN8,EAN5:Q.EAN5,EAN2:Q.EAN2,UPC:Q.UPC,UPCE:Q.UPCE,ITF14:E.ITF14,ITF:E.ITF,MSI:D.MSI,MSI10:D.MSI10,MSI11:D.MSI11,MSI1010:D.MSI1010,MSI1110:D.MSI1110,pharmacode:i.pharmacode,codabar:o.codabar,GenericBarcode:w.GenericBarcode}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.CODE39=void 0;var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(40);var E=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),A=A.toUpperCase(),g.mod43&&(A+=function(A){return D[A]}(function(A){for(var I=0,g=0;g<A.length;g++)I+=w(A[g]);return I%=43}(A))),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"encode",value:function(){for(var A=o("*"),I=0;I<this.data.length;I++)A+=o(this.data[I])+"0";return{data:A+=o("*"),text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),I}(((B=Q)&&B.__esModule?B:{default:B}).default),D=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],i=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function o(A){return function(A){return i[A].toString(2)}(w(A))}function w(A){return D.indexOf(A)}I.CODE39=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.default=function A(I,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,A),this.data=I,this.text=g.text||I,this.options=g}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.CODE128C=I.CODE128B=I.CODE128A=I.CODE128=void 0;var B=D(g(42)),C=D(g(46)),Q=D(g(47)),E=D(g(48));function D(A){return A&&A.__esModule?A:{default:A}}I.CODE128=B.default,I.CODE128A=C.default,I.CODE128B=Q.default,I.CODE128C=E.default},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=Q(g(43)),C=Q(g(45));function Q(A){return A&&A.__esModule?A:{default:A}}function E(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}var D=function(A){function I(A,g){if(function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),/^[\x00-\x7F\xC8-\xD3]+$/.test(A))var B=E(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,(0,C.default)(A),g));else B=E(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));return E(B)}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),I}(B.default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(40),E=(B=Q)&&B.__esModule?B:{default:B},D=g(44);var i=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I);var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A.substring(1),g));return B.bytes=A.split("").map((function(A){return A.charCodeAt(0)})),B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var A=this.bytes,g=A.shift()-105,B=D.SET_BY_CODE[g];if(void 0===B)throw new RangeError("The encoding does not start with a start character.");!0===this.shouldEncodeAsEan128()&&A.unshift(D.FNC1);var C=I.next(A,1,B);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:I.getBar(g)+C.result+I.getBar((C.checksum+g)%D.MODULO)+I.getBar(D.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var A=this.options.ean128||!1;return"string"==typeof A&&(A="true"===A.toLowerCase()),A}}],[{key:"getBar",value:function(A){return D.BARS[A]?D.BARS[A].toString():""}},{key:"correctIndex",value:function(A,I){if(I===D.SET_A){var g=A.shift();return g<32?g+64:g-32}return I===D.SET_B?A.shift()-32:10*(A.shift()-48)+A.shift()-48}},{key:"next",value:function(A,g,B){if(!A.length)return{result:"",checksum:0};var C=void 0,Q=void 0;if(A[0]>=200){Q=A.shift()-105;var E=D.SWAP[Q];void 0!==E?C=I.next(A,g+1,E):(B!==D.SET_A&&B!==D.SET_B||Q!==D.SHIFT||(A[0]=B===D.SET_A?A[0]>95?A[0]-96:A[0]:A[0]<32?A[0]+96:A[0]),C=I.next(A,g+1,B))}else Q=I.correctIndex(A,B),C=I.next(A,g+1,B);var i=Q*g;return{result:I.getBar(Q)+C.result,checksum:i+C.checksum}}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";var B;function C(A,I,g){return I in A?Object.defineProperty(A,I,{value:g,enumerable:!0,configurable:!0,writable:!0}):A[I]=g,A}Object.defineProperty(I,"__esModule",{value:!0});var Q=I.SET_A=0,E=I.SET_B=1,D=I.SET_C=2,i=(I.SHIFT=98,I.START_A=103),o=I.START_B=104,w=I.START_C=105;I.MODULO=103,I.STOP=106,I.FNC1=207,I.SET_BY_CODE=(C(B={},i,Q),C(B,o,E),C(B,w,D),B),I.SWAP={101:Q,100:E,99:D},I.A_START_CHAR=String.fromCharCode(208),I.B_START_CHAR=String.fromCharCode(209),I.C_START_CHAR=String.fromCharCode(210),I.A_CHARS="[\0-_È-Ï]",I.B_CHARS="[ -È-Ï]",I.C_CHARS="(Ï*[0-9]{2}Ï*)",I.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011]},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=g(44),C=function(A){return A.match(new RegExp("^"+B.A_CHARS+"*"))[0].length},Q=function(A){return A.match(new RegExp("^"+B.B_CHARS+"*"))[0].length},E=function(A){return A.match(new RegExp("^"+B.C_CHARS+"*"))[0]};function D(A,I){var g=I?B.A_CHARS:B.B_CHARS,C=A.match(new RegExp("^("+g+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(C)return C[1]+String.fromCharCode(204)+i(A.substring(C[1].length));var Q=A.match(new RegExp("^"+g+"+"))[0];return Q.length===A.length?A:Q+String.fromCharCode(I?205:206)+D(A.substring(Q.length),!I)}function i(A){var I=E(A),g=I.length;if(g===A.length)return A;A=A.substring(g);var B=C(A)>=Q(A);return I+String.fromCharCode(B?206:205)+D(A,B)}I.default=function(A){var I=void 0;if(E(A).length>=2)I=B.C_START_CHAR+i(A);else{var g=C(A)>Q(A);I=(g?B.A_START_CHAR:B.B_START_CHAR)+D(A,g)}return I.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,(function(A,I){return String.fromCharCode(203)+I}))}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(43),E=(B=Q)&&B.__esModule?B:{default:B},D=g(44);var i=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,D.A_START_CHAR+A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"valid",value:function(){return new RegExp("^"+D.A_CHARS+"+$").test(this.data)}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(43),E=(B=Q)&&B.__esModule?B:{default:B},D=g(44);var i=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,D.B_START_CHAR+A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"valid",value:function(){return new RegExp("^"+D.B_CHARS+"+$").test(this.data)}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(43),E=(B=Q)&&B.__esModule?B:{default:B},D=g(44);var i=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,D.C_START_CHAR+A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"valid",value:function(){return new RegExp("^"+D.C_CHARS+"+$").test(this.data)}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.UPCE=I.UPC=I.EAN2=I.EAN5=I.EAN8=I.EAN13=void 0;var B=o(g(50)),C=o(g(54)),Q=o(g(55)),E=o(g(56)),D=o(g(57)),i=o(g(58));function o(A){return A&&A.__esModule?A:{default:A}}I.EAN13=B.default,I.EAN8=C.default,I.EAN5=Q.default,I.EAN2=E.default,I.UPC=D.default,I.UPCE=i.default},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=function A(I,g,B){null===I&&(I=Function.prototype);var C=Object.getOwnPropertyDescriptor(I,g);if(void 0===C){var Q=Object.getPrototypeOf(I);return null===Q?void 0:A(Q,g,B)}if("value"in C)return C.value;var E=C.get;return void 0!==E?E.call(B):void 0},E=g(51),D=g(52),i=(B=D)&&B.__esModule?B:{default:B};var o=function(A){return(10-A.substr(0,12).split("").map((function(A){return+A})).reduce((function(A,I,g){return g%2?A+3*I:A+I}),0)%10)%10},w=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),-1!==A.search(/^[0-9]{12}$/)&&(A+=o(A));var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));return B.lastChar=g.lastChar,B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===o(this.data)}},{key:"leftText",value:function(){return Q(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var A=this.data.substr(1,6),g=E.EAN13_STRUCTURE[this.data[0]];return Q(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"leftEncode",this).call(this,A,g)}},{key:"rightText",value:function(){return Q(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var A=this.data.substr(7,6);return Q(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"rightEncode",this).call(this,A,"RRRRRR")}},{key:"encodeGuarded",value:function(){var A=Q(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(A.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(A.push({data:"00"}),A.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),A}}]),I}(i.default);I.default=w},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.SIDE_BIN="101",I.MIDDLE_BIN="01010",I.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},I.EAN2_STRUCTURE=["LL","LG","GL","GG"],I.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],I.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(51),Q=E(g(53));function E(A){return A&&A.__esModule?A:{default:A}}var D=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I);var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));return B.fontSize=!g.flat&&g.fontSize>10*g.width?10*g.width:g.fontSize,B.guardHeight=g.height+B.fontSize/2+g.textMargin,B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),B(I,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(A,I){return this.text.substr(A,I)}},{key:"leftEncode",value:function(A,I){return(0,Q.default)(A,I)}},{key:"rightText",value:function(A,I){return this.text.substr(A,I)}},{key:"rightEncode",value:function(A,I){return(0,Q.default)(A,I)}},{key:"encodeGuarded",value:function(){var A={fontSize:this.fontSize},I={height:this.guardHeight};return[{data:C.SIDE_BIN,options:I},{data:this.leftEncode(),text:this.leftText(),options:A},{data:C.MIDDLE_BIN,options:I},{data:this.rightEncode(),text:this.rightText(),options:A},{data:C.SIDE_BIN,options:I}]}},{key:"encodeFlat",value:function(){return{data:[C.SIDE_BIN,this.leftEncode(),C.MIDDLE_BIN,this.rightEncode(),C.SIDE_BIN].join(""),text:this.text}}}]),I}(E(g(40)).default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=g(51);I.default=function(A,I,g){var C=A.split("").map((function(A,g){return B.BINARIES[I[g]]})).map((function(I,g){return I?I[A[g]]:""}));if(g){var Q=A.length-1;C=C.map((function(A,I){return I<Q?A+g:A}))}return C.join("")}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=function A(I,g,B){null===I&&(I=Function.prototype);var C=Object.getOwnPropertyDescriptor(I,g);if(void 0===C){var Q=Object.getPrototypeOf(I);return null===Q?void 0:A(Q,g,B)}if("value"in C)return C.value;var E=C.get;return void 0!==E?E.call(B):void 0},E=g(52),D=(B=E)&&B.__esModule?B:{default:B};var i=function(A){return(10-A.substr(0,7).split("").map((function(A){return+A})).reduce((function(A,I,g){return g%2?A+I:A+3*I}),0)%10)%10},o=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),-1!==A.search(/^[0-9]{7}$/)&&(A+=i(A)),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===i(this.data)}},{key:"leftText",value:function(){return Q(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var A=this.data.substr(0,4);return Q(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"leftEncode",this).call(this,A,"LLLL")}},{key:"rightText",value:function(){return Q(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var A=this.data.substr(4,4);return Q(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"rightEncode",this).call(this,A,"RRRR")}}]),I}(D.default);I.default=o},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(51),Q=D(g(53)),E=D(g(40));function D(A){return A&&A.__esModule?A:{default:A}}var i=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),B(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var A,I=C.EAN5_STRUCTURE[(A=this.data,A.split("").map((function(A){return+A})).reduce((function(A,I,g){return g%2?A+9*I:A+3*I}),0)%10)];return{data:"1011"+(0,Q.default)(this.data,I,"01"),text:this.text}}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=g(51),Q=E(g(53));function E(A){return A&&A.__esModule?A:{default:A}}var D=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),B(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var A=C.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,Q.default)(this.data,A,"01"),text:this.text}}}]),I}(E(g(40)).default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}();I.checksum=D;var C=Q(g(53));function Q(A){return A&&A.__esModule?A:{default:A}}var E=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),-1!==A.search(/^[0-9]{11}$/)&&(A+=D(A));var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));return B.displayValue=g.displayValue,g.fontSize>10*g.width?B.fontSize=10*g.width:B.fontSize=g.fontSize,B.guardHeight=g.height+B.fontSize/2+g.textMargin,B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),B(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==D(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var A="";return A+="101",A+=(0,C.default)(this.data.substr(0,6),"LLLLLL"),A+="01010",A+=(0,C.default)(this.data.substr(6,6),"RRRRRR"),{data:A+="101",text:this.text}}},{key:"guardedEncoding",value:function(){var A=[];return this.displayValue&&A.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),A.push({data:"101"+(0,C.default)(this.data[0],"L"),options:{height:this.guardHeight}}),A.push({data:(0,C.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),A.push({data:"01010",options:{height:this.guardHeight}}),A.push({data:(0,C.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),A.push({data:(0,C.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&A.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),A}}]),I}(Q(g(40)).default);function D(A){var I,g=0;for(I=1;I<11;I+=2)g+=parseInt(A[I]);for(I=0;I<11;I+=2)g+=3*parseInt(A[I]);return(10-g%10)%10}I.default=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),C=D(g(53)),Q=D(g(40)),E=g(57);function D(A){return A&&A.__esModule?A:{default:A}}function i(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}var o=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],w=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],F=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I);var B=i(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));if(B.isValid=!1,-1!==A.search(/^[0-9]{6}$/))B.middleDigits=A,B.upcA=G(A,"0"),B.text=g.text||""+B.upcA[0]+A+B.upcA[B.upcA.length-1],B.isValid=!0;else{if(-1===A.search(/^[01][0-9]{7}$/))return i(B);if(B.middleDigits=A.substring(1,A.length-1),B.upcA=G(B.middleDigits,A[0]),B.upcA[B.upcA.length-1]!==A[A.length-1])return i(B);B.isValid=!0}return B.displayValue=g.displayValue,g.fontSize>10*g.width?B.fontSize=10*g.width:B.fontSize=g.fontSize,B.guardHeight=g.height+B.fontSize/2+g.textMargin,B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),B(I,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var A="";return A+="101",A+=this.encodeMiddleDigits(),{data:A+="010101",text:this.text}}},{key:"guardedEncoding",value:function(){var A=[];return this.displayValue&&A.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),A.push({data:"101",options:{height:this.guardHeight}}),A.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),A.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&A.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),A}},{key:"encodeMiddleDigits",value:function(){var A=this.upcA[0],I=this.upcA[this.upcA.length-1],g=w[parseInt(I)][parseInt(A)];return(0,C.default)(this.middleDigits,g)}}]),I}(Q.default);function G(A,I){for(var g=parseInt(A[A.length-1]),B=o[g],C="",Q=0,D=0;D<B.length;D++){var i=B[D];C+="X"===i?A[Q++]:i}return""+(C=""+I+C)+(0,E.checksum)(C)}I.default=F},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.ITF14=I.ITF=void 0;var B=Q(g(60)),C=Q(g(62));function Q(A){return A&&A.__esModule?A:{default:A}}I.ITF=B.default,I.ITF14=C.default},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(61),E=g(40);var D=function(A){function I(){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).apply(this,arguments))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){var A=this,I=this.data.match(/.{2}/g).map((function(I){return A.encodePair(I)})).join("");return{data:Q.START_BIN+I+Q.END_BIN,text:this.text}}},{key:"encodePair",value:function(A){var I=Q.BINARIES[A[1]];return Q.BINARIES[A[0]].split("").map((function(A,g){return("1"===A?"111":"1")+("1"===I[g]?"000":"0")})).join("")}}]),I}(((B=E)&&B.__esModule?B:{default:B}).default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.START_BIN="1010",I.END_BIN="11101",I.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(60),E=(B=Q)&&B.__esModule?B:{default:B};var D=function(A){var I=A.substr(0,13).split("").map((function(A){return parseInt(A,10)})).reduce((function(A,I,g){return A+I*(3-g%2*2)}),0);return 10*Math.ceil(I/10)-I},i=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),-1!==A.search(/^[0-9]{13}$/)&&(A+=D(A)),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&+this.data[13]===D(this.data)}}]),I}(E.default);I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.MSI1110=I.MSI1010=I.MSI11=I.MSI10=I.MSI=void 0;var B=i(g(64)),C=i(g(65)),Q=i(g(67)),E=i(g(68)),D=i(g(69));function i(A){return A&&A.__esModule?A:{default:A}}I.MSI=B.default,I.MSI10=C.default,I.MSI11=Q.default,I.MSI1010=E.default,I.MSI1110=D.default},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(40);var E=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"encode",value:function(){for(var A="110",I=0;I<this.data.length;I++){var g=parseInt(this.data[I]).toString(2);g=D(g,4-g.length);for(var B=0;B<g.length;B++)A+="0"==g[B]?"100":"110"}return{data:A+="1001",text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]),I}(((B=Q)&&B.__esModule?B:{default:B}).default);function D(A,I){for(var g=0;g<I;g++)A="0"+A;return A}I.default=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=g(64),Q=(B=C)&&B.__esModule?B:{default:B},E=g(66);var D=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A+(0,E.mod10)(A),g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),I}(Q.default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.mod10=function(A){for(var I=0,g=0;g<A.length;g++){var B=parseInt(A[g]);(g+A.length)%2==0?I+=B:I+=2*B%10+Math.floor(2*B/10)}return(10-I%10)%10},I.mod11=function(A){for(var I=0,g=[2,3,4,5,6,7],B=0;B<A.length;B++){var C=parseInt(A[A.length-1-B]);I+=g[B%g.length]*C}return(11-I%11)%11}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=g(64),Q=(B=C)&&B.__esModule?B:{default:B},E=g(66);var D=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A+(0,E.mod11)(A),g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),I}(Q.default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=g(64),Q=(B=C)&&B.__esModule?B:{default:B},E=g(66);var D=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),A+=(0,E.mod10)(A),A+=(0,E.mod10)(A),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),I}(Q.default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=g(64),Q=(B=C)&&B.__esModule?B:{default:B},E=g(66);var D=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),A+=(0,E.mod11)(A),A+=(0,E.mod10)(A),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),I}(Q.default);I.default=D},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.pharmacode=void 0;var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(40);var E=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I);var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g));return B.number=parseInt(A,10),B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"encode",value:function(){for(var A=this.number,I="";!isNaN(A)&&0!=A;)A%2==0?(I="11100"+I,A=(A-2)/2):(I="100"+I,A=(A-1)/2);return{data:I=I.slice(0,-2),text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),I}(((B=Q)&&B.__esModule?B:{default:B}).default);I.pharmacode=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.codabar=void 0;var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(40);var E=function(A){function I(A,g){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),0===A.search(/^[0-9\-\$\:\.\+\/]+$/)&&(A="A"+A+"A");var B=function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A.toUpperCase(),g));return B.text=B.options.text||B.text.replace(/[A-D]/g,""),B}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"valid",value:function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var A=[],I=this.getEncodings(),g=0;g<this.data.length;g++)A.push(I[this.data.charAt(g)]),g!==this.data.length-1&&A.push("0");return{text:this.text,data:A.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),I}(((B=Q)&&B.__esModule?B:{default:B}).default);I.codabar=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.GenericBarcode=void 0;var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(40);var E=function(A){function I(A,g){return function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,I),function(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,A,g))}return function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}(I,A),C(I,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),I}(((B=Q)&&B.__esModule?B:{default:B}).default);I.GenericBarcode=E},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=Object.assign||function(A){for(var I=1;I<arguments.length;I++){var g=arguments[I];for(var B in g)Object.prototype.hasOwnProperty.call(g,B)&&(A[B]=g[B])}return A};I.default=function(A,I){return B({},A,I)}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.default=function(A){var I=[];return function A(g){if(Array.isArray(g))for(var B=0;B<g.length;B++)A(g[B]);else g.text=g.text||"",g.data=g.data||"",I.push(g)}(A),I}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.default=function(A){return A.marginTop=A.marginTop||A.margin,A.marginBottom=A.marginBottom||A.margin,A.marginRight=A.marginRight||A.margin,A.marginLeft=A.marginLeft||A.margin,A}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B="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},C=D(g(77)),Q=D(g(80)),E=g(85);function D(A){return A&&A.__esModule?A:{default:A}}function i(A){if("string"==typeof A)return function(A){var I=document.querySelectorAll(A);if(0===I.length)return;for(var g=[],B=0;B<I.length;B++)g.push(i(I[B]));return g}(A);if(Array.isArray(A)){for(var I=[],g=0;g<A.length;g++)I.push(i(A[g]));return I}if("undefined"!=typeof HTMLCanvasElement&&A instanceof HTMLImageElement)return D=A,{element:o=document.createElement("canvas"),options:(0,C.default)(D),renderer:Q.default.CanvasRenderer,afterRender:function(){D.setAttribute("src",o.toDataURL())}};if(A&&A.nodeName&&"svg"===A.nodeName.toLowerCase()||"undefined"!=typeof SVGElement&&A instanceof SVGElement)return{element:A,options:(0,C.default)(A),renderer:Q.default.SVGRenderer};if("undefined"!=typeof HTMLCanvasElement&&A instanceof HTMLCanvasElement)return{element:A,options:(0,C.default)(A),renderer:Q.default.CanvasRenderer};if(A&&A.getContext)return{element:A,renderer:Q.default.CanvasRenderer};if(A&&"object"===(void 0===A?"undefined":B(A))&&!A.nodeName)return{element:A,renderer:Q.default.ObjectRenderer};throw new E.InvalidElementException;var D,o}I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=Q(g(78)),C=Q(g(79));function Q(A){return A&&A.__esModule?A:{default:A}}I.default=function(A){var I={};for(var g in C.default)C.default.hasOwnProperty(g)&&(A.hasAttribute("jsbarcode-"+g.toLowerCase())&&(I[g]=A.getAttribute("jsbarcode-"+g.toLowerCase())),A.hasAttribute("data-"+g.toLowerCase())&&(I[g]=A.getAttribute("data-"+g.toLowerCase())));return I.value=A.getAttribute("jsbarcode-value")||A.getAttribute("data-value"),I=(0,B.default)(I)}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.default=function(A){var I=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var g in I)I.hasOwnProperty(g)&&"string"==typeof A[g=I[g]]&&(A[g]=parseInt(A[g],10));"string"==typeof A.displayValue&&(A.displayValue="false"!=A.displayValue);return A}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};I.default=B},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=E(g(81)),C=E(g(83)),Q=E(g(84));function E(A){return A&&A.__esModule?A:{default:A}}I.default={CanvasRenderer:B.default,SVGRenderer:C.default,ObjectRenderer:Q.default}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(73),E=(B=Q)&&B.__esModule?B:{default:B},D=g(82);var i=function(){function A(I,g,B){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,A),this.canvas=I,this.encodings=g,this.options=B}return C(A,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var A=0;A<this.encodings.length;A++){var I=(0,E.default)(this.options,this.encodings[A].options);this.drawCanvasBarcode(I,this.encodings[A]),this.drawCanvasText(I,this.encodings[A]),this.moveCanvasDrawing(this.encodings[A])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var A=this.canvas.getContext("2d");A.save(),(0,D.calculateEncodingAttributes)(this.encodings,this.options,A);var I=(0,D.getTotalWidthOfEncodings)(this.encodings),g=(0,D.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=I+this.options.marginLeft+this.options.marginRight,this.canvas.height=g,A.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(A.fillStyle=this.options.background,A.fillRect(0,0,this.canvas.width,this.canvas.height)),A.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(A,I){var g,B=this.canvas.getContext("2d"),C=I.data;g="top"==A.textPosition?A.marginTop+A.fontSize+A.textMargin:A.marginTop,B.fillStyle=A.lineColor;for(var Q=0;Q<C.length;Q++){var E=Q*A.width+I.barcodePadding;"1"===C[Q]?B.fillRect(E,g,A.width,A.height):C[Q]&&B.fillRect(E,g,A.width,A.height*C[Q])}}},{key:"drawCanvasText",value:function(A,I){var g,B,C=this.canvas.getContext("2d"),Q=A.fontOptions+" "+A.fontSize+"px "+A.font;A.displayValue&&(B="top"==A.textPosition?A.marginTop+A.fontSize-A.textMargin:A.height+A.textMargin+A.marginTop+A.fontSize,C.font=Q,"left"==A.textAlign||I.barcodePadding>0?(g=0,C.textAlign="left"):"right"==A.textAlign?(g=I.width-1,C.textAlign="right"):(g=I.width/2,C.textAlign="center"),C.fillText(I.text,g,B))}},{key:"moveCanvasDrawing",value:function(A){this.canvas.getContext("2d").translate(A.width,0)}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore()}}]),A}();I.default=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0}),I.getTotalWidthOfEncodings=I.calculateEncodingAttributes=I.getBarcodePadding=I.getEncodingHeight=I.getMaximumHeightOfEncodings=void 0;var B,C=g(73),Q=(B=C)&&B.__esModule?B:{default:B};function E(A,I){return I.height+(I.displayValue&&A.text.length>0?I.fontSize+I.textMargin:0)+I.marginTop+I.marginBottom}function D(A,I,g){if(g.displayValue&&I<A){if("center"==g.textAlign)return Math.floor((A-I)/2);if("left"==g.textAlign)return 0;if("right"==g.textAlign)return Math.floor(A-I)}return 0}function i(A,I,g){var B;if(g)B=g;else{if("undefined"==typeof document)return 0;B=document.createElement("canvas").getContext("2d")}B.font=I.fontOptions+" "+I.fontSize+"px "+I.font;var C=B.measureText(A);return C?C.width:0}I.getMaximumHeightOfEncodings=function(A){for(var I=0,g=0;g<A.length;g++)A[g].height>I&&(I=A[g].height);return I},I.getEncodingHeight=E,I.getBarcodePadding=D,I.calculateEncodingAttributes=function(A,I,g){for(var B=0;B<A.length;B++){var C,o=A[B],w=(0,Q.default)(I,o.options);C=w.displayValue?i(o.text,w,g):0;var F=o.data.length*w.width;o.width=Math.ceil(Math.max(C,F)),o.height=E(o,w),o.barcodePadding=D(C,F,w)}},I.getTotalWidthOfEncodings=function(A){for(var I=0,g=0;g<A.length;g++)I+=A[g].width;return I}},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B,C=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}(),Q=g(73),E=(B=Q)&&B.__esModule?B:{default:B},D=g(82);var i="http://www.w3.org/2000/svg",o=function(){function A(I,g,B){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,A),this.svg=I,this.encodings=g,this.options=B,this.document=B.xmlDocument||document}return C(A,[{key:"render",value:function(){var A=this.options.marginLeft;this.prepareSVG();for(var I=0;I<this.encodings.length;I++){var g=this.encodings[I],B=(0,E.default)(this.options,g.options),C=this.createGroup(A,B.marginTop,this.svg);this.setGroupOptions(C,B),this.drawSvgBarcode(C,B,g),this.drawSVGText(C,B,g),A+=g.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,D.calculateEncodingAttributes)(this.encodings,this.options);var A=(0,D.getTotalWidthOfEncodings)(this.encodings),I=(0,D.getMaximumHeightOfEncodings)(this.encodings),g=A+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(g,I),this.options.background&&this.drawRect(0,0,g,I,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(A,I,g){var B,C=g.data;B="top"==I.textPosition?I.fontSize+I.textMargin:0;for(var Q=0,E=0,D=0;D<C.length;D++)E=D*I.width+g.barcodePadding,"1"===C[D]?Q++:Q>0&&(this.drawRect(E-I.width*Q,B,I.width*Q,I.height,A),Q=0);Q>0&&this.drawRect(E-I.width*(Q-1),B,I.width*Q,I.height,A)}},{key:"drawSVGText",value:function(A,I,g){var B,C,Q=this.document.createElementNS(i,"text");I.displayValue&&(Q.setAttribute("style","font:"+I.fontOptions+" "+I.fontSize+"px "+I.font),C="top"==I.textPosition?I.fontSize-I.textMargin:I.height+I.textMargin+I.fontSize,"left"==I.textAlign||g.barcodePadding>0?(B=0,Q.setAttribute("text-anchor","start")):"right"==I.textAlign?(B=g.width-1,Q.setAttribute("text-anchor","end")):(B=g.width/2,Q.setAttribute("text-anchor","middle")),Q.setAttribute("x",B),Q.setAttribute("y",C),Q.appendChild(this.document.createTextNode(g.text)),A.appendChild(Q))}},{key:"setSvgAttributes",value:function(A,I){var g=this.svg;g.setAttribute("width",A+"px"),g.setAttribute("height",I+"px"),g.setAttribute("x","0px"),g.setAttribute("y","0px"),g.setAttribute("viewBox","0 0 "+A+" "+I),g.setAttribute("xmlns",i),g.setAttribute("version","1.1"),g.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(A,I,g){var B=this.document.createElementNS(i,"g");return B.setAttribute("transform","translate("+A+", "+I+")"),g.appendChild(B),B}},{key:"setGroupOptions",value:function(A,I){A.setAttribute("style","fill:"+I.lineColor+";")}},{key:"drawRect",value:function(A,I,g,B,C){var Q=this.document.createElementNS(i,"rect");return Q.setAttribute("x",A),Q.setAttribute("y",I),Q.setAttribute("width",g),Q.setAttribute("height",B),C.appendChild(Q),Q}}]),A}();I.default=o},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}();var C=function(){function A(I,g,B){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,A),this.object=I,this.encodings=g,this.options=B}return B(A,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),A}();I.default=C},function(A,I,g){"use strict";function B(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}function C(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!I||"object"!=typeof I&&"function"!=typeof I?A:I}function Q(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}Object.defineProperty(I,"__esModule",{value:!0});var E=function(A){function I(A,g){B(this,I);var Q=C(this,(I.__proto__||Object.getPrototypeOf(I)).call(this));return Q.name="InvalidInputException",Q.symbology=A,Q.input=g,Q.message='"'+Q.input+'" is not a valid input for '+Q.symbology,Q}return Q(I,Error),I}(),D=function(A){function I(){B(this,I);var A=C(this,(I.__proto__||Object.getPrototypeOf(I)).call(this));return A.name="InvalidElementException",A.message="Not supported type to render on",A}return Q(I,Error),I}(),i=function(A){function I(){B(this,I);var A=C(this,(I.__proto__||Object.getPrototypeOf(I)).call(this));return A.name="NoElementException",A.message="No element to render on.",A}return Q(I,Error),I}();I.InvalidInputException=E,I.InvalidElementException=D,I.NoElementException=i},function(A,I,g){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var B=function(){function A(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(I,g,B){return g&&A(I.prototype,g),B&&A(I,B),I}}();var C=function(){function A(I){!function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}(this,A),this.api=I}return B(A,[{key:"handleCatch",value:function(A){if("InvalidInputException"!==A.name)throw A;if(this.api._options.valid===this.api._defaults.valid)throw A.message;this.api._options.valid(!1),this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(A){try{var I=A.apply(void 0,arguments);return this.api._options.valid(!0),I}catch(A){return this.handleCatch(A),this.api}}}]),A}();I.default=C},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdCanvasRender",(function(){return M}));var B=g(6),C=g.n(B),Q=g(5),E=g.n(Q),D=g(1),i=g.n(D),o=g(7),w=g.n(o),F=g(31),G=g(32),N=g(35),y=g(30);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 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,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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}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 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,Q,D,o,R,M,U,c;return i()(A,[{key:"setOfdCore",value:function(A){this.core=A,this.render.setOfdCore(this.core)}},{key:"renderPageByCanvas",value:(c=C()(w.a.mark((function A(I,g,B,C,Q,E){var D,i,o,y,R,M,U,c,s,a,Y,S,k,K,H,L,J,t,d,e,n,l,r,Z,q,f,W,x,p,b,V,m,T,j,X,O,u,z,P,v;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(D=Q?Q.readOfdDocument(B):this.core.readOfdDocument(B),i=Q?Q.readOfdPage(B,C):this.core.readOfdPage(B,C),o=i.Page.Template,D.Annotations,y=Q?Q.readOfdTemplatePage(B):this.core.readOfdTemplatePage(B),R=D.Signatures?D.Signatures.Signature:[],M=D.CommonData.Res.Fonts,U=D.CommonData.Res.DrawParams,D.CommonData.Res.ColorSpaces,c=D.CommonData.Res.CompositeGraphicUnits,s=D.CommonData.Res.MultiMedias,!o){A.next=64;break}a=h(o),A.prev=13,a.s();case 15:if((Y=a.n()).done){A.next=56;break}S=Y.value,k=h(y),A.prev=18,k.s();case 20:if((K=k.n()).done){A.next=46;break}if((H=K.value).ID!=S.TemplateID){A.next=44;break}if(!(H=Q?Q.readPageFromTemplate(H):this.core.readPageFromTemplate(H)).Page.Content){A.next=43;break}L=H.Page.Content.Layer,J=h(L),A.prev=27,J.s();case 29:if((t=J.n()).done){A.next=35;break}return d=t.value,A.next=33,this.renderLayerByCanvas(E,I,g,M,U,s,c,d,!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),k.e(A.t1);case 51:return A.prev=51,k.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),a.e(A.t2);case 61:return A.prev=61,a.f(),A.finish(61);case 64:if(!i.Page.Content){A.next=83;break}e=i.Page.Content.Layer,n=h(e),A.prev=67,n.s();case 69:if((l=n.n()).done){A.next=75;break}return r=l.value,A.next=73,this.renderLayerByCanvas(E,I,g,M,U,s,c,r,!1);case 73:A.next=69;break;case 75:A.next=80;break;case 77:A.prev=77,A.t3=A.catch(67),n.e(A.t3);case 80:return A.prev=80,n.f(),A.finish(80);case 83:Z=h(R),A.prev=84,Z.s();case 86:if((q=Z.n()).done){A.next=134;break}f=q.value,W=h(f.Signature.SignedInfo.StampAnnot),A.prev=89,W.s();case 91:if((x=W.n()).done){A.next=124;break}if(p=x.value,b=p.PageRef,i.ID!=b){A.next=122;break}if(V=p.Boundary,!(f.Signature.PicType&&f.Signature.PicType.length>0)){A.next=122;break}if("ofd"!==f.Signature.PicType){A.next=108;break}m=new N.Ofd_Core(f.Signature.ofd,this.coreHelper.dpi),T=0;case 100:if(!(T<m.getOFDPageCount(0))){A.next=106;break}return A.next=103,this.renderSealPageOnCanvas(I,g,T,m,!0,V,b,p.ID,C,f.Signature.ZipName);case 103:T++,A.next=100;break;case 106:A.next=122;break;case 108:if("svg"!==f.Signature.PicType){A.next=114;break}return j="data:image/svg+xml;base64,".concat(f.Signature.PicValue),A.next=112,this.renderSealSvgOnCanvas(I,g,j,V);case 112:A.next=122;break;case 114:return X=V.w,O=V.h,u=Object(F.converterBox)(V,this.coreHelper.dpi),z=Object(G.JSGetImageInfoByBase64)(f.Signature.PicValue),P=z.fileBase64,v={a:X,b:0,c:0,d:O,e:0,f:0},A.next=122,this.renderImageOnCanvas(I,g,P,z.width,z.height,u,p.Clip,!0,b,p.ID,v);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),Z.e(A.t5);case 139:return A.prev=139,Z.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,C,Q){return c.apply(this,arguments)})},{key:"renderAnnotationOnCanvas",value:(U=C()(w.a.mark((function A(I,g,B,C,Q,E,D){var i,o,G,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 G=Object(F.converterBox)(o,this.coreHelper.dpi),(N=document.createElement("canvas")).style.height="".concat(G.w,"px"),N.style.width="".concat(G.h,"px"),N.width=G.w,N.height=G.h,y=N.getContext("2d"),A.next=14,this.renderLayerByCanvas(zipName,N,y,C,Q,E,D,i,!1);case 14:g.drawImage(N,G.x,G.y);case 15:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,C,Q,E){return U.apply(this,arguments)})},{key:"renderSealSvgOnCanvas",value:(M=C()(w.a.mark((function A(I,g,B,C,Q,E){var D;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return D=Object(F.converterBox)(C,this.coreHelper.dpi),A.abrupt("return",new Promise((function(A,I){var C=new Image;C.src=B,C.onload=function(){var I=C.width,B=C.height,Q=document.createElement("canvas");if(Q.style.height="".concat(I,"px"),Q.style.width="".concat(B,"px"),Q.width=I,Q.height=B,Q.getContext("2d").drawImage(C,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(Q,0,0),g.drawImage(i,D.x,D.y)}else g.drawImage(Q,D.x,D.y);A()}})));case 2:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,C,Q){return M.apply(this,arguments)})},{key:"renderSealPageOnCanvas",value:(R=C()(w.a.mark((function A(I,g,B,C,Q,E,D,i,o,G){var N,y,h,R,M,U,c,s,a,Y;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return N={x:0,y:0,w:0,h:0},N=E,y={x:E.x,y:E.y,w:C.pageWidth(0,B),h:C.pageHeight(0,B)},h=Object(F.converterBox)(y,this.coreHelper.dpi),R=1,(M=document.createElement("canvas")).style.height="".concat(h.w,"px"),M.style.width="".concat(h.h,"px"),M.width=h.w,M.height=h.h,U=M.getContext("2d"),A.next=13,this.renderPageByCanvas(M,U,0,B,C,G);case 13:U.scale(R,R),y.w!==N.w?(c=N.h/y.h<N.w/y.w?N.h/y.h:N.w/y.w,s=document.createElement("canvas"),a=Object(F.converterBox)(N,this.coreHelper.dpi),s.style.height="".concat(a.w,"px"),s.style.width="".concat(a.h,"px"),s.width=a.w,s.height=a.h,(Y=s.getContext("2d")).scale(c,c),Y.drawImage(M,0,0),g.drawImage(s,h.x,h.y)):g.drawImage(M,h.x,h.y);case 15:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,C,Q,E,D,i,o){return R.apply(this,arguments)})},{key:"renderLayerByCanvas",value:(o=C()(w.a.mark((function A(I,g,B,C,Q,E,D,i,o,G,N,y){var R,M,U,c,s,a,Y,S,k,K,H,L,J,t,d;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(R=null,M=null,U=Object(F.converterDpi)(.353,this.coreHelper.dpi),(c=i.DrawParam)&&Object(F.getDrawParam)(Q,c)&&(s=Object(F.getDrawParam)(Q,c),Object(F.getDrawParam)(Q,s.Relative)&&(s=Object(F.getDrawParam)(Q,s.Relative)),s.FillColor&&(R=Object(F.parseColor)(s.FillColor.Value)),s.StrokeColor&&(R=Object(F.parseColor)(s.StrokeColor.Value)),s.LineWidth&&(U=Object(F.converterDpi)(s.LineWidth,this.coreHelper.dpi))),!(a=i.PageBlock)){A.next=60;break}Y=h(a),A.prev=8,Y.s();case 10:if((S=Y.n()).done){A.next=52;break}if("ImageObject"!=(k=S.value).Type){A.next=17;break}return A.next=15,this.renderImageObject(I,g,B,E,k,o,N,y);case 15:A.next=50;break;case 17:if("PathObject"!=k.Type){A.next=22;break}return A.next=20,this.renderPathObject(I,g,B,Q,k,R,M,U,o,G,N,y,E,C);case 20:A.next=50;break;case 22:if("TextObject"!=k.Type){A.next=27;break}return A.next=25,this.renderTextObject(g,B,C,k,R,M,Q,G,N,y);case 25:A.next=50;break;case 27:if("CompositeObject"!=k.Type){A.next=50;break}K=h(D),A.prev=29,K.s();case 31:if((H=K.n()).done){A.next=42;break}if((L=H.value).ID!==k.ResourceID){A.next=40;break}return J=k.Alpha,t=k.Boundary,d=k.CTM,A.next=39,this.renderLayerByCanvas(I,g,B,C,Q,E,D,L,!1,J,t,d);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),K.e(A.t0);case 47:return A.prev=47,K.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),Y.e(A.t1);case 57:return A.prev=57,Y.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,C,Q,E,D,i,w,F,G){return o.apply(this,arguments)})},{key:"renderImageObject",value:(D=C()(w.a.mark((function A(I,g,B,C,Q,E,D,i){var o,N,y,h,R,M,U,c,s;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(o=Q.Boundary,o=Object(F.converterBox)(o,this.coreHelper.dpi),N=Q.ResourceID){A.next=5;break}return A.abrupt("return");case 5:if((y=Object(F.getMultiMedia)(C,N)).MediaFile){A.next=8;break}return A.abrupt("return",null);case 8:if((h=Q.ImageMask)>0&&(R=Object(F.getMultiMedia)(C,h)).MediaFile&&(R.width>0||R.height>0||!R.MediaFile||((M=Object(G.JSGetImageInfoByPath)(this.core.ofdParserPtr,R.MediaFile,R.MediaFileResPln,this.core.getDocPln(0),I)).ext,R.width=M.width,R.height=M.height,R.FileBase64=M.fileBase64)),y.width>0||y.height>0||!y.MediaFile){A.next=17;break}if("other"!==(U=Object(G.JSGetImageInfoByPath)(this.core.ofdParserPtr,y.MediaFile,y.MediaFileResPln,this.core.getDocPln(0),I)).ext){A.next=14;break}return A.abrupt("return",null);case 14:y.width=U.width,y.height=U.height,y.FileBase64=U.fileBase64;case 17:return c=Q.CTM,s=Q.Clips,A.next=21,this.renderImageOnCanvas(g,B,y.FileBase64,y.width,y.height,o,!1,E,null,null,c,D,i,s);case 21:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,C,Q,E,i){return D.apply(this,arguments)})},{key:"renderImageOnCanvas",value:(Q=C()(w.a.mark((function A(I,g,B,C,Q,E,D,i,o,G,N,y,R,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=C,o.height=Q;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/C/Object(F.ctmImageScale)(w.coreHelper.dpi),N.b/C/Object(F.ctmImageScale)(w.coreHelper.dpi),N.c/Q/Object(F.ctmImageScale)(w.coreHelper.dpi),N.d/Q/Object(F.ctmImageScale)(w.coreHelper.dpi),Object(F.converterDpi)(N.e,w.coreHelper.dpi),Object(F.converterDpi)(N.f,w.coreHelper.dpi)),B.drawImage(o,0,0);var G=document.createElement("canvas"),U=Object(F.converterBox)(y,w.coreHelper.dpi),c=U.w,s=U.h,a=U.x,Y=U.y;G.width=c,G.height=s,G.style.width="".concat(c,"px"),G.style.height="".concat(s,"px");var S=G.getContext("2d");R&&S.transform(R.a,R.b,R.c,R.d,Object(F.converterDpi)(R.e,w.coreHelper.dpi),Object(F.converterDpi)(R.f,w.coreHelper.dpi)),S.drawImage(I,D,i),g.drawImage(G,a,Y)}else{var k=document.createElement("canvas");k.width=Math.ceil(E.w),k.height=Math.ceil(E.h),k.style.width="".concat(Math.ceil(E.w),"px"),k.style.height="".concat(Math.ceil(E.h),"px");var K=k.getContext("2d");if(M&&M.length>0)for(var H=0;H<M.length;H++)for(var L=M[H].Clip,J=0;J<L.length;J++){var t=L[J].Area,d=void 0;t.CTM?d=t.CTM:N&&(d=N),K.beginPath();var e,n=h(t.Path.AbbreviatedData);try{for(n.s();!(e=n.n()).done;){var l=e.value;if("M"===l.cmd||"S"===l.cmd){var r=l.crds[0],Z=l.crds[1];if(d){var q=w.ctmCalPoint(r,Z,d);r=q.ctmX,Z=q.ctmY}K.moveTo(Object(F.converterDpi)(r,w.coreHelper.dpi),Object(F.converterDpi)(Z,w.coreHelper.dpi))}else if("L"===l.cmd){var f=l.crds[0],W=l.crds[1];if(d){var x=w.ctmCalPoint(f,W,d);f=x.ctmX,W=x.ctmY}K.lineTo(Object(F.converterDpi)(f,w.coreHelper.dpi),Object(F.converterDpi)(W,w.coreHelper.dpi))}else if("B"===l.cmd){var p=l.crds[0],b=l.crds[1],V=l.crds[2],m=l.crds[3],T=l.crds[4],j=l.crds[5];if(d){var X=w.ctmCalPoint(p,b,d);p=X.ctmX,b=X.ctmY;var O=w.ctmCalPoint(V,m,d);V=O.ctmX,m=O.ctmY;var u=w.ctmCalPoint(T,j,d);T=u.ctmX,j=u.ctmY}K.bezierCurveTo(Object(F.converterDpi)(p,w.coreHelper.dpi),Object(F.converterDpi)(b,w.coreHelper.dpi),Object(F.converterDpi)(V,w.coreHelper.dpi),Object(F.converterDpi)(m,w.coreHelper.dpi),Object(F.converterDpi)(T,w.coreHelper.dpi),Object(F.converterDpi)(j,w.coreHelper.dpi))}else if("Q"===l.cmd){var z=l.crds[0],P=l.crds[1],v=l.crds[2],_=l.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(F.converterDpi)(z,w.coreHelper.dpi),Object(F.converterDpi)(P,w.coreHelper.dpi),Object(F.converterDpi)(v,w.coreHelper.dpi),Object(F.converterDpi)(_,w.coreHelper.dpi))}else"A"===l.cmd||"C"===l.cmd&&K.closePath()}}catch(A){n.e(A)}finally{n.f()}K.clip()}N&&K.transform(N.a/C/Object(F.ctmImageScale)(w.coreHelper.dpi),N.b/C/Object(F.ctmImageScale)(w.coreHelper.dpi),N.c/Q/Object(F.ctmImageScale)(w.coreHelper.dpi),N.d/Q/Object(F.ctmImageScale)(w.coreHelper.dpi),Object(F.converterDpi)(N.e,w.coreHelper.dpi),Object(F.converterDpi)(N.f,w.coreHelper.dpi)),K.drawImage(o,0,0),g.drawImage(k,D,i)}A()}})));case 5:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,C,E,D,i,o,w,F,G,N,y){return Q.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=C()(w.a.mark((function A(I,g,B,C,Q,E,D,i,o,G,N,y,R,M){var U,c,s,a,Y,S,k,K,H,L,J,t,d,e,n,l,r,Z,q,f,W,x,p,b,V,m,T,j,X,O,u,z,P,v,_,$,AA,IA,gA,BA,CA,QA,EA,DA,iA,oA,wA,FA,GA,NA,yA,hA,RA,MA,UA,cA,sA,aA,YA,SA,kA,KA,HA,LA,JA,tA,dA,eA,nA,lA,rA,ZA;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(U=Q.Boundary){A.next=3;break}return A.abrupt("return");case 3:if(c=1,U=Object(F.converterBox)(U,this.coreHelper.dpi),s=Math.ceil(U.w),a=Math.ceil(U.h),Y=U.x,S=U.y,s-0!=0&&a-0!=0){A.next=11;break}return A.abrupt("return");case 11:if(k=document.createElement("canvas"),K=k.getContext("2d"),k.width=s*c,k.height=a*c,k.style.width="".concat(s,"px"),k.style.height="".concat(a,"px"),H=Q.LineWidth,L=Q.AbbreviatedData,J=Q.CTM,t=Q.StrokeColor,d=Q.FillColor,H&&(i=Object(F.converterDpi)(H,this.coreHelper.dpi)),(e=Q.DrawParam)&&(n=Object(F.getDrawParam)(C,e),(H=n.LineWidth)&&(i=Object(F.converterDpi)(H,this.coreHelper.dpi)),n.FillColor&&(d&&d.Value||(d=n.FillColor)),n.StrokeColor&&(t&&t.Value||(t=n.StrokeColor))),J&&K.transform(J.a,J.b,J.c,J.d,Object(F.converterDpi)(J.e,this.coreHelper.dpi),Object(F.converterDpi)(J.f,this.coreHelper.dpi)),l=!1,t&&(t.Value&&(D=Object(F.parseColor)(t.Value)),r=t.axialShd)){l=!0,Z=Object(F.parseCtm)(r.StartPoint),q=Object(F.parseCtm)(r.EndPoint),f=K.createLinearGradient(Z[0],Z[1],q[0],q[1]),W=h(r.Segment);try{for(W.s();!(x=W.n()).done;)(p=x.value)&&f.addColorStop(p.position,Object(F.parseColor)(p.color.Value))}catch(A){W.e(A)}finally{W.f()}K.lineWidth=i,K.strokeStyle=f}if(b=!1,d&&(d.Value&&(E=Object(F.parseColor)(d.Value)),d.Alpha&&0===d.Alpha&&(K.globalAlpha=0),V=d.AxialShd)){b=!0,m=Object(F.parseCtm)(V.StartPoint),T=Object(F.parseCtm)(V.EndPoint),j=K.createLinearGradient(m[0],m[1],T[0],T[1]),X=h(V.Segment);try{for(X.s();!(O=X.n()).done;)(u=O.value)&&j.addColorStop(u.position,Object(F.parseColor)(u.color.Value))}catch(A){X.e(A)}finally{X.f()}K.fillStyle=j}if(i>0&&!D&&((D=E)||(D="rgb(0, 0, 0)")),(z=Q.Clips)&&z.length>0)for(P=[],v=0;v<z.length;v++){for(_=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),$=z[v],AA=$.Clip,IA=0;IA<AA.length;IA++){gA=AA[IA],BA=gA.Area,CA=document.createElementNS("http://www.w3.org/2000/svg","path"),QA=0,EA=0,DA=0,iA=0,BA.Path.Boundary&&(QA=BA.Path.Boundary.x,EA=BA.Path.Boundary.y,DA=BA.Path.Boundary.w,iA=BA.Path.Boundary.h),!BA.TransFlag&&BA.CTM&&(oA=BA.CTM,wA=void 0,wA=J?"matrix(".concat(oA.a," ").concat(oA.b," ").concat(oA.c," ").concat(oA.d," ").concat(Object(F.converterDpi)(oA.e-J.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(oA.f-J.f,this.coreHelper.dpi),")"):"matrix(".concat(oA.a," ").concat(oA.b," ").concat(oA.c," ").concat(oA.d," ").concat(Object(F.converterDpi)(oA.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(oA.f,this.coreHelper.dpi),")"),J&&(FA=[[J.a,J.c,0],[J.b,J.d,0],[0,0,1]],GA=Object(F.inv)(FA),isNaN(GA[0][0])||GA[0][0]===1/0||(wA="".concat(wA," matrix(").concat(GA[0][0]," ").concat(GA[1][0]," ").concat(GA[0][1]," ").concat(GA[1][1]," 0 0)"))),CA.setAttribute("transform",wA)),!BA.TransFlag&&BA.Path.CTM&&(NA=BA.Path.CTM,yA="matrix(".concat(NA.a," ").concat(NA.b," ").concat(NA.c," ").concat(NA.d," ").concat(Object(F.converterDpi)(NA.e-J.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(NA.f-J.f,this.coreHelper.dpi),")"),J&&(hA=[[J.a,J.c,0],[J.b,J.d,0],[0,0,1]],RA=Object(F.inv)(hA),isNaN(RA[0][0])||RA[0][0]===1/0||(yA="".concat(yA," matrix(").concat(RA[0][0]," ").concat(RA[1][0]," ").concat(RA[0][1]," ").concat(RA[1][1]," 0 0)"))),CA.setAttribute("transform",yA)),K.beginPath(),MA=h(BA.Path.AbbreviatedData);try{for(MA.s();!(UA=MA.n()).done;)"M"===(cA=UA.value).cmd||"S"===cA.cmd?K.moveTo(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[0],DA)+QA,this.coreHelper.dpi),Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[1],iA)+EA,this.coreHelper.dpi)):"L"===cA.cmd?K.lineTo(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[0],DA)+QA,this.coreHelper.dpi),Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[1],iA)+EA,this.coreHelper.dpi)):"B"===cA.cmd&&K.bezierCurveTo(Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[0],DA)+QA,this.coreHelper.dpi),Object(F.converterDpi)(Object(F.adjustPosLimit)(cA.crds[1],iA)+EA,this.coreHelper.dpi),Object(F.converterDpi)(cA.crds[2]+QA,this.coreHelper.dpi),Object(F.converterDpi)(cA.crds[3]+EA,this.coreHelper.dpi),Object(F.converterDpi)(cA.crds[4]+QA,this.coreHelper.dpi),Object(F.converterDpi)(cA.crds[5]+EA,this.coreHelper.dpi))}catch(A){MA.e(A)}finally{MA.f()}K.closePath(),K.clip()}P.push(_)}Q.Join&&K.setLineJoin(Q["@_Join"]),Q.Cap&&K.setLineCap(Q["@_Cap"]),Q.DashPattern&&(sA=Q.DashPattern,aA=Object(F.parseCtm)(sA),Q.DashOffset&&Q.DashOffset,K.setLineDash([Object(F.converterDpi)(aA[0],this.coreHelper.dpi),Object(F.converterDpi)(aA[1],this.coreHelper.dpi)])),K.beginPath(),YA=h(L);try{for(YA.s();!(SA=YA.n()).done;)"M"===(kA=SA.value).cmd||"S"===kA.cmd?K.moveTo(Object(F.converterDpi)(kA.crds[0],this.coreHelper.dpi),Object(F.converterDpi)(kA.crds[1],this.coreHelper.dpi)):"L"===kA.cmd?K.lineTo(Object(F.converterDpi)(kA.crds[0],this.coreHelper.dpi),Object(F.converterDpi)(kA.crds[1],this.coreHelper.dpi)):"B"===kA.cmd?K.bezierCurveTo(Object(F.converterDpi)(kA.crds[0],this.coreHelper.dpi),Object(F.converterDpi)(kA.crds[1],this.coreHelper.dpi),Object(F.converterDpi)(kA.crds[2],this.coreHelper.dpi),Object(F.converterDpi)(kA.crds[3],this.coreHelper.dpi),Object(F.converterDpi)(kA.crds[4],this.coreHelper.dpi),Object(F.converterDpi)(kA.crds[5],this.coreHelper.dpi)):"Q"===kA.cmd?K.quadraticCurveTo(Object(F.converterDpi)(kA.crds[0],this.coreHelper.dpi),Object(F.converterDpi)(kA.crds[1],this.coreHelper.dpi),Object(F.converterDpi)(kA.crds[2],this.coreHelper.dpi),Object(F.converterDpi)(kA.crds[3],this.coreHelper.dpi)):"A"===kA.cmd||"C"===kA.cmd&&K.closePath()}catch(A){YA.e(A)}finally{YA.f()}if(Q.Stroke&&(l||(K.strokeStyle=D,K.lineWidth=i),K.stroke()),KA=d.pattern,!Q.Fill||KA?K.fillStyle="none":(b||(K.fillStyle=E),K.fill(Q.Rule)),!KA){A.next=54;break}return K.save(),HA=document.createElement("canvas"),LA=HA.getContext("2d"),HA.width=Object(F.converterDpi)(KA.width,this.coreHelper.dpi),HA.height=Object(F.converterDpi)(KA.height,this.coreHelper.dpi),A.next=50,this.renderLayerByCanvas(I,HA,LA,M,C,R,null,KA,!1,null,null,null);case 50:JA=K.createPattern(HA,"repeat"),K.fillStyle=JA,K.fillRect(0,0,s,a),K.restore();case 54:N?(tA=document.createElement("canvas"),dA=Object(F.converterBox)(N,this.coreHelper.dpi),eA=dA.w,nA=dA.h,lA=dA.x,rA=dA.y,tA.width=eA*c,tA.height=nA*c,tA.style.width="".concat(eA,"px"),tA.style.height="".concat(nA,"px"),ZA=tA.getContext("2d"),y&&ZA.transform(y.a,y.b,y.c,y.d,Object(F.converterDpi)(y.e,this.coreHelper.dpi),Object(F.converterDpi)(y.f,this.coreHelper.dpi)),G&&(ZA.globalAlpha=G/255),ZA.drawImage(k,Y,S),B.drawImage(tA,lA,rA)):B.drawImage(k,Y,S);case 55:case"end":return A.stop()}}),A,this)}))),function(A,I,g,C,Q,E,D,i,o,w,F,G,N,y){return B.apply(this,arguments)})},{key:"renderTextObject",value:(g=C()(w.a.mark((function A(I,g,B,C,Q,E,D,i,o,N){var y,R,M,U,c,s,a,Y,S,k,K,H,L,J,t,d,e,n,l,r,Z,q,f,W,x,p,b,V,m,T,j,X,O,u,z,P,v,_,$,AA,IA,gA,BA,CA,QA,EA,DA,iA,oA,wA,FA,GA,NA;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(y=1,R=C.Boundary,R=Object(F.converterBox)(R,this.coreHelper.dpi),M=C.CTM,U=C.HScale,c=C.Font,s=C.Weight,a=C.Size>0,M&&!a&&(M={a:-M.a,b:M.b,c:M.c,d:-M.d,e:-M.e,f:-M.f}),Y=Object(F.converterDpi)(Math.abs(parseFloat(C.Size)),this.coreHelper.dpi),S=Object(F.calTextPoint)(this.coreHelper.dpi,C.TextCode,C.CGTransform,M,C.Boundary,o,N,a),(k=document.createElementNS("http://www.w3.org/2000/svg","svg")).setAttribute("xmlns","http://www.w3.org/2000/svg"),k.setAttribute("version","1.1"),K=C.FillColor,H=!1,(L=C.DrawParam)&&(J=Object(F.getDrawParam)(D,L)).FillColor&&(K&&K.Value||(K=J.FillColor)),K&&(K.Value&&(Q=Object(F.parseColor)(K.Value)),t=K.alpha,y=t/255,d=K.axialShd)){H=!0,(e=document.createElementNS("http://www.w3.org/2000/svg","linearGradient")).setAttribute("id","".concat(C.ID)),e.setAttribute("x1","0%"),e.setAttribute("y1","0%"),e.setAttribute("x2","100%"),e.setAttribute("y2","100%"),n=h(d.Segment);try{for(n.s();!(l=n.n()).done;)(r=l.value)&&((Z=document.createElement("stop")).setAttribute("offset","".concat(100*r.position,"%")),Z.setAttribute("style","stop-color:".concat(Object(F.parseColor)(r.color.Value),";stop-opacity:1")),e.appendChild(Z),Q=Object(F.parseColor)(r.color.Value))}catch(A){n.e(A)}finally{n.f()}k.appendChild(e)}C.Fill||(y=0),q=R.w,f=R.h,W=R.x,x=R.y,p=Y,b=Y,V=0,M&&(m=M.a,T=M.b,j=M.c,X=M.d,O=m>0?Math.sign(m)*Math.sqrt(m*m+j*j):Math.sqrt(m*m+j*j),u=X>0?Math.sign(X)*Math.sqrt(T*T+X*X):Math.sqrt(T*T+X*X),0==(V=Math.atan2(-T,X))&&0!=m&&1==X||(p*=O,b*=u),0==V&&U-0==1&&(U=m/X)>0&&(p*=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==(V=Math.atan2(-P,_))&&0!=z&&1==_||(p*=$,b*=AA,x*=AA,W*=$,q*=$,f*=AA)),IA=Object(F.getFont)(B,c),gA=h(S),A.prev=31,gA.s();case 33:if((BA=gA.n()).done){A.next=73;break}if(!(CA=BA.value)||isNaN(CA.x)){A.next=71;break}if(!(CA.glyph&&IA&&IA.face&&M&&M.b>=0&&C.Fill)){A.next=59;break}if(!IA||!IA.face){A.next=57;break}if(QA=Object(G.loadFaceInfo)(IA.face),EA=Object(G.FT_Glyph_Get_Measure)(IA.face,CA.glyph),(DA=this.render.drawGlyph(EA.glyphPath,EA.horiUnderlinePosition,QA.units_per_EM,p,b,E||Q,y)).img.setAttribute("style","width: ".concat(Math.ceil(p),"px; height:").concat(Math.ceil(b),"px")),iA="data:image/svg+xml;base64,".concat(Object(G.base64Encode)(DA.img.outerHTML)),0!==V){A.next=48;break}return A.next=46,this.drawTextFromSvg(I,g,iA,Math.ceil(CA.cx),CA.cy-DA.yScale*EA.horiUnderlinePosition-b);case 46:A.next=57;break;case 48:return(oA=document.createElement("canvas")).style.width="".concat(Math.ceil(p),"px"),oA.style.height="".concat(Math.ceil(b),"px"),oA.width=Math.ceil(p),oA.height=Math.ceil(b),wA=oA.getContext("2d"),A.next=56,this.drawTextFromSvg(oA,wA,iA,0,0,V,Math.ceil(p)/2,Math.ceil(b)/2);case 56:g.drawImage(oA,Math.ceil(CA.cx),CA.cy-DA.yScale*EA.horiUnderlinePosition-b);case 57:A.next=71;break;case 59:(FA=document.createElementNS("http://www.w3.org/2000/svg","text")).setAttribute("x",CA.x),FA.setAttribute("y",CA.y),FA.innerHTML=CA.text,GA="",M&&(GA="matrix(".concat(M.a," ").concat(M.b," ").concat(M.c," ").concat(M.d," ").concat(Object(F.converterDpi)(M.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(M.f,this.coreHelper.dpi),")")),N&&(GA="".concat(GA," matrix(").concat(N.a," ").concat(N.b," ").concat(N.c," ").concat(N.d," ").concat(Object(F.converterDpi)(N.e,this.coreHelper.dpi)," ").concat(Object(F.converterDpi)(N.f,this.coreHelper.dpi),")")),U&&(GA="".concat(GA," matrix(").concat(U,", 0, 0, 1, ").concat((1-U)*CA.x,", 0)")),FA.setAttribute("transform",GA),H?FA.setAttribute("fill",Q):(FA.setAttribute("fill",E),FA.setAttribute("fill",Q),FA.setAttribute("fill-opacity",y)),FA.setAttribute("style","font-weight: ".concat(s,";font-size:").concat(Y,"px;font-family: ").concat(Object(F.getFontFamily)(IA),";")),k.appendChild(FA);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 k.setAttribute("style","overflow:visible;width:".concat(q,"px;height:").concat(f,"px")),NA="data:image/svg+xml;base64,".concat(Object(G.base64Encode)(k.outerHTML)),A.next=85,this.drawTextFromSvg(I,g,NA,W,x);case 85:case"end":return A.stop()}}),A,this,[[31,75,78,81]])}))),function(A,I,B,C,Q,E,D,i,o,w){return g.apply(this,arguments)})},{key:"drawTextFromSvg",value:(I=C()(w.a.mark((function A(I,g,B,C,Q,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,C,Q),A()}})));case 1:case"end":return A.stop()}}),A)}))),function(A,g,B,C,Q,E,D,i){return I.apply(this,arguments)})}]),A}()},function(A,I,g){"use strict";g.r(I),function(A){g.d(I,"AbortException",(function(){return oA})),g.d(I,"AnnotationActionEventType",(function(){return p})),g.d(I,"AnnotationBorderStyleType",(function(){return x})),g.d(I,"AnnotationEditorParamsType",(function(){return e})),g.d(I,"AnnotationEditorPrefix",(function(){return t})),g.d(I,"AnnotationEditorType",(function(){return d})),g.d(I,"AnnotationFieldFlag",(function(){return W})),g.d(I,"AnnotationFlag",(function(){return f})),g.d(I,"AnnotationMode",(function(){return J})),g.d(I,"AnnotationPrefix",(function(){return dA})),g.d(I,"AnnotationReplyType",(function(){return q})),g.d(I,"AnnotationType",(function(){return Z})),g.d(I,"assert",(function(){return $})),g.d(I,"BaseException",(function(){return gA})),g.d(I,"BASELINE_FACTOR",(function(){return H})),g.d(I,"bytesToString",(function(){return wA})),g.d(I,"CMapCompressionType",(function(){return T})),g.d(I,"createValidAbsoluteUrl",(function(){return AA})),g.d(I,"DocumentActionEventType",(function(){return b})),g.d(I,"FeatureTest",(function(){return hA})),g.d(I,"FONT_IDENTITY_MATRIX",(function(){return Y})),g.d(I,"FontRenderOps",(function(){return eA})),g.d(I,"FormatError",(function(){return iA})),g.d(I,"getModificationDate",(function(){return KA})),g.d(I,"getUuid",(function(){return tA})),g.d(I,"getVerbosityLevel",(function(){return z})),g.d(I,"IDENTITY_MATRIX",(function(){return a})),g.d(I,"ImageKind",(function(){return r})),g.d(I,"info",(function(){return P})),g.d(I,"InvalidPDFException",(function(){return QA})),g.d(I,"isArrayEqual",(function(){return kA})),g.d(I,"isNodeJS",(function(){return s})),g.d(I,"LINE_DESCENT_FACTOR",(function(){return K})),g.d(I,"LINE_FACTOR",(function(){return k})),g.d(I,"MAX_IMAGE_SIZE_TO_CACHE",(function(){return S})),g.d(I,"MissingPDFException",(function(){return EA})),g.d(I,"normalizeUnicode",(function(){return JA})),g.d(I,"objectFromMap",(function(){return yA})),g.d(I,"objectSize",(function(){return NA})),g.d(I,"OPS",(function(){return j})),g.d(I,"PageActionEventType",(function(){return V})),g.d(I,"PasswordException",(function(){return BA})),g.d(I,"PasswordResponses",(function(){return X})),g.d(I,"PermissionFlag",(function(){return n})),g.d(I,"RenderingIntentFlag",(function(){return L})),g.d(I,"setVerbosityLevel",(function(){return u})),g.d(I,"shadow",(function(){return IA})),g.d(I,"string32",(function(){return GA})),g.d(I,"stringToBytes",(function(){return FA})),g.d(I,"stringToPDFString",(function(){return aA})),g.d(I,"stringToUTF8String",(function(){return YA})),g.d(I,"TextRenderingMode",(function(){return l})),g.d(I,"UnexpectedResponseException",(function(){return DA})),g.d(I,"UnknownErrorException",(function(){return CA})),g.d(I,"unreachable",(function(){return _})),g.d(I,"utf8StringToString",(function(){return SA})),g.d(I,"Util",(function(){return MA})),g.d(I,"VerbosityLevel",(function(){return m})),g.d(I,"warn",(function(){return v}));var B,C=g(23),Q=g.n(C),E=g(1),D=g.n(E),i=g(5),o=g.n(i),w=g(16),F=g.n(w),G=g(18),N=g.n(G),y=g(15),h=g.n(y);function R(A,I,g){return function(A,I){if(A!==I)throw new TypeError("Private static access of wrong provenance")}(A,I),g}function M(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 U(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 U(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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}function U(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}function c(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=h()(A);if(I){var C=h()(this).constructor;g=Reflect.construct(B,arguments,C)}else g=B.apply(this,arguments);return N()(this,g)}}var s=("undefined"==typeof PDFJSDev||PDFJSDev.test("GENERIC"))&&"object"==typeof A&&A+""=="[object process]"&&!A.versions.nw&&!(A.versions.electron&&A.type&&"browser"!==A.type),a=[1,0,0,1,0,0],Y=[.001,0,0,.001,0,0],S=1e7,k=1.35,K=.35,H=K/k,L={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},J={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},t="pdfjs_internal_editor_",d={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},e={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},n={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},l={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},r={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Z={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},q={GROUP:"Group",REPLY:"R"},f={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512},W={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864},x={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},p={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"},b={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},V={O:"PageOpen",C:"PageClose"},m={ERRORS:0,WARNINGS:1,INFOS:5},T={NONE:0,BINARY:1},j={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},X={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},O=m.WARNINGS;function u(A){Number.isInteger(A)&&(O=A)}function z(){return O}function P(A){m.INFOS}function v(A){m.WARNINGS}function _(A){throw new Error(A)}function $(A,I){A||_(I)}function AA(A){var I=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!A)return null;try{if(g&&"string"==typeof A){if(g.addDefaultProtocol&&A.startsWith("www.")){var B=A.match(/\./g);(null==B?void 0:B.length)>=2&&(A="http://".concat(A))}if(g.tryConvertEncoding)try{A=YA(A)}catch(A){}}var C=I?new URL(A,I):new URL(A);if(function(A){switch(null==A?void 0:A.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(C))return C}catch(A){}return null}function IA(A,I,g){var B=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return("undefined"==typeof PDFJSDev||PDFJSDev.test("TESTING"))&&$(I in A,'shadow: Property "'.concat(I&&I.toString(),'" not found in object.')),Object.defineProperty(A,I,{value:g,enumerable:!B,configurable:!0,writable:!1}),g}var gA=function(){function A(I,g){this.constructor===A&&_("Cannot initialize BaseException."),this.message=I,this.name=g}return A.prototype=new Error,A.constructor=A,A}(),BA=function(A){F()(g,A);var I=c(g);function g(A,B){var C;return o()(this,g),(C=I.call(this,A,"PasswordException")).code=B,C}return D()(g)}(gA),CA=function(A){F()(g,A);var I=c(g);function g(A,B){var C;return o()(this,g),(C=I.call(this,A,"UnknownErrorException")).details=B,C}return D()(g)}(gA),QA=function(A){F()(g,A);var I=c(g);function g(A){return o()(this,g),I.call(this,A,"InvalidPDFException")}return D()(g)}(gA),EA=function(A){F()(g,A);var I=c(g);function g(A){return o()(this,g),I.call(this,A,"MissingPDFException")}return D()(g)}(gA),DA=function(A){F()(g,A);var I=c(g);function g(A,B){var C;return o()(this,g),(C=I.call(this,A,"UnexpectedResponseException")).status=B,C}return D()(g)}(gA),iA=function(A){F()(g,A);var I=c(g);function g(A){return o()(this,g),I.call(this,A,"FormatError")}return D()(g)}(gA),oA=function(A){F()(g,A);var I=c(g);function g(A){return o()(this,g),I.call(this,A,"AbortException")}return D()(g)}(gA);function wA(A){"object"==typeof A&&void 0!==(null==A?void 0:A.length)||_("Invalid argument for bytesToString");var I=A.length,g=8192;if(I<g)return String.fromCharCode.apply(null,A);for(var B=[],C=0;C<I;C+=g){var Q=Math.min(C+g,I),E=A.subarray(C,Q);B.push(String.fromCharCode.apply(null,E))}return B.join("")}function FA(A){"string"!=typeof A&&_("Invalid argument for stringToBytes");for(var I=A.length,g=new Uint8Array(I),B=0;B<I;++B)g[B]=255&A.charCodeAt(B);return g}function GA(A){return("undefined"==typeof PDFJSDev||PDFJSDev.test("TESTING"))&&$("number"==typeof A&&Math.abs(A)<Math.pow(2,32),'string32: Unexpected input "'.concat(A,'".')),String.fromCharCode(A>>24&255,A>>16&255,A>>8&255,255&A)}function NA(A){return Object.keys(A).length}function yA(A){var I,g=Object.create(null),B=M(A);try{for(B.s();!(I=B.n()).done;){var C=Q()(I.value,2),E=C[0],D=C[1];g[E]=D}}catch(A){B.e(A)}finally{B.f()}return g}var hA=function(){function A(){o()(this,A)}return D()(A,null,[{key:"isLittleEndian",get:function(){return IA(this,"isLittleEndian",((A=new Uint8Array(4))[0]=1,1===new Uint32Array(A.buffer,0,1)[0]));var A}},{key:"isEvalSupported",get:function(){return IA(this,"isEvalSupported",function(){try{return new Function(""),!0}catch(A){return!1}}())}},{key:"isOffscreenCanvasSupported",get:function(){return IA(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}},{key:"platform",get:function(){var A;return"undefined"!=typeof PDFJSDev&&PDFJSDev.test("MOZCENTRAL")||"undefined"!=typeof navigator&&"string"==typeof(null===(A=navigator)||void 0===A?void 0:A.platform)?IA(this,"platform",{isMac:navigator.platform.includes("Mac")}):IA(this,"platform",{isMac:!1})}},{key:"isCSSRoundSupported",get:function(){var A,I;return IA(this,"isCSSRoundSupported",null===(A=globalThis.CSS)||void 0===A||null===(I=A.supports)||void 0===I?void 0:I.call(A,"width: round(1.5px, 1px)"))}}]),A}(),RA=Array.from(Array(256).keys(),(function(A){return A.toString(16).padStart(2,"0")})),MA=function(){function A(){o()(this,A)}return D()(A,null,[{key:"makeHexColor",value:function(A,I,g){return"#".concat(RA[A]).concat(RA[I]).concat(RA[g])}},{key:"scaleMinMax",value:function(A,I){var g;A[0]?(A[0]<0&&(g=I[0],I[0]=I[2],I[2]=g),I[0]*=A[0],I[2]*=A[0],A[3]<0&&(g=I[1],I[1]=I[3],I[3]=g),I[1]*=A[3],I[3]*=A[3]):(g=I[0],I[0]=I[1],I[1]=g,g=I[2],I[2]=I[3],I[3]=g,A[1]<0&&(g=I[1],I[1]=I[3],I[3]=g),I[1]*=A[1],I[3]*=A[1],A[2]<0&&(g=I[0],I[0]=I[2],I[2]=g),I[0]*=A[2],I[2]*=A[2]),I[0]+=A[4],I[1]+=A[5],I[2]+=A[4],I[3]+=A[5]}},{key:"transform",value:function(A,I){return[A[0]*I[0]+A[2]*I[1],A[1]*I[0]+A[3]*I[1],A[0]*I[2]+A[2]*I[3],A[1]*I[2]+A[3]*I[3],A[0]*I[4]+A[2]*I[5]+A[4],A[1]*I[4]+A[3]*I[5]+A[5]]}},{key:"applyTransform",value:function(A,I){return[A[0]*I[0]+A[1]*I[2]+I[4],A[0]*I[1]+A[1]*I[3]+I[5]]}},{key:"applyInverseTransform",value:function(A,I){var g=I[0]*I[3]-I[1]*I[2];return[(A[0]*I[3]-A[1]*I[2]+I[2]*I[5]-I[4]*I[3])/g,(-A[0]*I[1]+A[1]*I[0]+I[4]*I[1]-I[5]*I[0])/g]}},{key:"getAxialAlignedBoundingBox",value:function(A,I){var g=this.applyTransform(A,I),B=this.applyTransform(A.slice(2,4),I),C=this.applyTransform([A[0],A[3]],I),Q=this.applyTransform([A[2],A[1]],I);return[Math.min(g[0],B[0],C[0],Q[0]),Math.min(g[1],B[1],C[1],Q[1]),Math.max(g[0],B[0],C[0],Q[0]),Math.max(g[1],B[1],C[1],Q[1])]}},{key:"inverseTransform",value:function(A){var I=A[0]*A[3]-A[1]*A[2];return[A[3]/I,-A[1]/I,-A[2]/I,A[0]/I,(A[2]*A[5]-A[4]*A[3])/I,(A[4]*A[1]-A[5]*A[0])/I]}},{key:"singularValueDecompose2dScale",value:function(A){var I=[A[0],A[2],A[1],A[3]],g=A[0]*I[0]+A[1]*I[2],B=A[0]*I[1]+A[1]*I[3],C=A[2]*I[0]+A[3]*I[2],Q=A[2]*I[1]+A[3]*I[3],E=(g+Q)/2,D=Math.sqrt(Math.pow(g+Q,2)-4*(g*Q-C*B))/2,i=E+D||1,o=E-D||1;return[Math.sqrt(i),Math.sqrt(o)]}},{key:"normalizeRect",value:function(A){var I=A.slice(0);return A[0]>A[2]&&(I[0]=A[2],I[2]=A[0]),A[1]>A[3]&&(I[1]=A[3],I[3]=A[1]),I}},{key:"intersect",value:function(A,I){var g=Math.max(Math.min(A[0],A[2]),Math.min(I[0],I[2])),B=Math.min(Math.max(A[0],A[2]),Math.max(I[0],I[2]));if(g>B)return null;var C=Math.max(Math.min(A[1],A[3]),Math.min(I[1],I[3])),Q=Math.min(Math.max(A[1],A[3]),Math.max(I[1],I[3]));return C>Q?null:[g,C,B,Q]}},{key:"bezierBoundingBox",value:function(I,g,B,C,Q,E,D,i,o){return o?(o[0]=Math.min(o[0],I,D),o[1]=Math.min(o[1],g,i),o[2]=Math.max(o[2],I,D),o[3]=Math.max(o[3],g,i)):o=[Math.min(I,D),Math.min(g,i),Math.max(I,D),Math.max(g,i)],R(this,A,cA).call(this,I,B,Q,D,g,C,E,i,3*(3*(B-Q)-I+D),6*(I-2*B+Q),3*(B-I),o),R(this,A,cA).call(this,I,B,Q,D,g,C,E,i,3*(3*(C-E)-g+i),6*(g-2*C+E),3*(C-g),o),o}}]),A}();function UA(A,I,g,B,C,Q,E,D,i,o){if(!(i<=0||i>=1)){var w=1-i,F=i*i,G=F*i,N=w*(w*(w*A+3*i*I)+3*F*g)+G*B,y=w*(w*(w*C+3*i*Q)+3*F*E)+G*D;o[0]=Math.min(o[0],N),o[1]=Math.min(o[1],y),o[2]=Math.max(o[2],N),o[3]=Math.max(o[3],y)}}function cA(A,I,g,C,Q,E,D,i,o,w,F,G){if(Math.abs(o)<1e-12)Math.abs(w)>=1e-12&&R(this,B,UA).call(this,A,I,g,C,Q,E,D,i,-F/w,G);else{var N=Math.pow(w,2)-4*F*o;if(!(N<0)){var y=Math.sqrt(N),h=2*o;R(this,B,UA).call(this,A,I,g,C,Q,E,D,i,(-w+y)/h,G),R(this,B,UA).call(this,A,I,g,C,Q,E,D,i,(-w-y)/h,G)}}}B=MA;var sA=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function aA(A){var I;if(A[0]>="ï"&&("þ"===A[0]&&"ÿ"===A[1]?(I="utf-16be",A.length%2==1&&(A=A.slice(0,-1))):"ÿ"===A[0]&&"þ"===A[1]?(I="utf-16le",A.length%2==1&&(A=A.slice(0,-1))):"ï"===A[0]&&"»"===A[1]&&"¿"===A[2]&&(I="utf-8"),I))try{var g=new TextDecoder(I,{fatal:!0}),B=FA(A),C=g.decode(B);return C.includes("")?C.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g,""):C}catch(A){v('stringToPDFString: "'.concat(A,'".'))}for(var Q=[],E=0,D=A.length;E<D;E++){var i=A.charCodeAt(E);if(27!==i){var o=sA[i];Q.push(o?String.fromCharCode(o):A.charAt(E))}else for(;++E<D&&27!==A.charCodeAt(E););}return Q.join("")}function YA(A){return decodeURIComponent(escape(A))}function SA(A){return unescape(encodeURIComponent(A))}function kA(A,I){if(A.length!==I.length)return!1;for(var g=0,B=A.length;g<B;g++)if(A[g]!==I[g])return!1;return!0}function KA(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return[A.getUTCFullYear().toString(),(A.getUTCMonth()+1).toString().padStart(2,"0"),A.getUTCDate().toString().padStart(2,"0"),A.getUTCHours().toString().padStart(2,"0"),A.getUTCMinutes().toString().padStart(2,"0"),A.getUTCSeconds().toString().padStart(2,"0")].join("")}var HA=null,LA=null;function JA(A){return HA||(HA=/([\xA0\xB5\u037E\u0EB3\u2000-\u200A\u202F\u2126\uFB00-\uFB04\uFB06\uFB20-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBA1\uFBA4-\uFBA9\uFBAE-\uFBB1\uFBD3-\uFBDC\uFBDE-\uFBE7\uFBEA-\uFBF8\uFBFC\uFBFD\uFC00-\uFC5D\uFC64-\uFCF1\uFCF5-\uFD3D\uFD88\uFDF4\uFDFA\uFDFB\uFE71\uFE77\uFE79\uFE7B\uFE7D]+)|(\uFB05+)/g,LA=new Map([["ſt","ſt"]])),A.replaceAll(HA,(function(A,I,g){return I?I.normalize("NFKC"):LA.get(g)}))}function tA(){var A,I;if("undefined"!=typeof PDFJSDev&&PDFJSDev.test("MOZCENTRAL")||"undefined"!=typeof crypto&&"function"==typeof(null===(A=crypto)||void 0===A?void 0:A.randomUUID))return crypto.randomUUID();var g=new Uint8Array(32);if("undefined"!=typeof crypto&&"function"==typeof(null===(I=crypto)||void 0===I?void 0:I.getRandomValues))crypto.getRandomValues(g);else for(var B=0;B<32;B++)g[B]=Math.floor(255*Math.random());return wA(g)}var dA="pdfjs_internal_id_",eA={BEZIER_CURVE_TO:0,MOVE_TO:1,LINE_TO:2,QUADRATIC_CURVE_TO:3,RESTORE:4,SAVE:5,SCALE:6,TRANSFORM:7,TRANSLATE:8}}.call(this,g(89))},function(A,I){var g,B,C=A.exports={};function Q(){throw new Error("setTimeout has not been defined")}function E(){throw new Error("clearTimeout has not been defined")}function D(A){if(g===setTimeout)return setTimeout(A,0);if((g===Q||!g)&&setTimeout)return g=setTimeout,setTimeout(A,0);try{return g(A,0)}catch(I){try{return g.call(null,A,0)}catch(I){return g.call(this,A,0)}}}!function(){try{g="function"==typeof setTimeout?setTimeout:Q}catch(A){g=Q}try{B="function"==typeof clearTimeout?clearTimeout:E}catch(A){B=E}}();var i,o=[],w=!1,F=-1;function G(){w&&i&&(w=!1,i.length?o=i.concat(o):F=-1,o.length&&N())}function N(){if(!w){var A=D(G);w=!0;for(var I=o.length;I;){for(i=o,o=[];++F<I;)i&&i[F].run();F=-1,I=o.length}i=null,w=!1,function(A){if(B===clearTimeout)return clearTimeout(A);if((B===E||!B)&&clearTimeout)return B=clearTimeout,clearTimeout(A);try{return B(A)}catch(I){try{return B.call(null,A)}catch(I){return B.call(this,A)}}}(A)}}function y(A,I){this.fun=A,this.array=I}function h(){}C.nextTick=function(A){var I=new Array(arguments.length-1);if(arguments.length>1)for(var g=1;g<arguments.length;g++)I[g-1]=arguments[g];o.push(new y(A,I)),1!==o.length||w||D(N)},y.prototype.run=function(){this.fun.apply(null,this.array)},C.title="browser",C.browser=!0,C.env={},C.argv=[],C.version="",C.versions={},C.on=h,C.addListener=h,C.once=h,C.off=h,C.removeListener=h,C.removeAllListeners=h,C.emit=h,C.prependListener=h,C.prependOnceListener=h,C.listeners=function(A){return[]},C.binding=function(A){throw new Error("process.binding is not supported")},C.cwd=function(){return"/"},C.chdir=function(A){throw new Error("process.chdir is not supported")},C.umask=function(){return 0}},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdThumbnailViewer",(function(){return y}));var B=g(5),C=g.n(B),Q=g(1),E=g.n(Q),D=g(22),i=g(29),o=g(87),w=g(36);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 G(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 G(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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}function G(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){C()(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 C=B.ring,Q=document.createElement("canvas"),E=Q.getContext("2d");Q.style.height=C.style.height,Q.style.width=C.style.width,Q.width=1*this.coreHelper.pageRenderWidth(0,B.id-1,this.core),Q.height=1*this.coreHelper.pageRenderHeight(0,B.id-1,this.core);var o=Q.width/Q.height,w=document.createElement("img");w.className="thumbnailImage",w.style.width="98px",w.style.height=98/o+"px",this.ofdCanvasRender.renderPageByCanvas(Q,E,0,B.id-1).then((function(I){var g=Q.toDataURL();w.src=g,B.renderingState=D.RenderingStates.FINISHED,A.updateThumbnailView()})),C.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,C=g.last,Q=g.views;if(Q.length>0){var E=!1;if(A<=B.id||A>=C.id)E=!0;else{var i,o=F(Q);try{for(o.s();!(i=o.n()).done;){var w=i.value,G=w.id,y=w.percent;if(G===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,C=function(A){var C=I.coreHelper.pageRenderWidth(0,A,I.core)/I.coreHelper.pageRenderHeight(0,A,I.core),Q=document.createElement("a");Q.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/C+2+"px",E.appendChild(i),Q.appendChild(E),I.pageDIV[A]={ring:i,div:E,anchor:Q,id:A+1,renderingState:D.RenderingStates.INITIAL},g.appendChild(Q)},Q=0;Q<this.core.getOFDPageCount(0);++Q)C(Q);this.updateThumbnailView()}}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"PDFSidebar",(function(){return o}));var B=g(5),C=g.n(B),Q=g(1),E=g.n(Q),D=g(22),i="pdfSidebarNotification",o=function(){function A(I){var g=I.elements,B=I.ofdViewer,Q=I.ofdThumbnailViewer,E=I.eventBus,i=I.l10n;C()(this,A),this.isOpen=!1,this.active=D.SidebarView.OUTLINE,this.isInitialViewSet=!1,this.onToggled=null,this.ofdViewer=B,this.ofdThumbnailViewer=Q,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 C=A===D.SidebarView.THUMBS,Q=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",C),this.outlineButton&&this.outlineButton.classList.toggle("toggled",Q),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",C),this.outlineButton&&this.outlineButton.setAttribute("aria-checked",Q),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",!C),this.outlineView&&this.outlineView.classList.toggle("hidden",!Q),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",!Q),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,C,Q,E,i,o,w,F=this;null===(A=this.viewerContainer)||void 0===A||A.addEventListener("transitionend",(function(A){A.target===F.viewerContainer&&F.outerContainer.classList.remove("sidebarMoving")})),null===(I=this.toggleButton)||void 0===I||I.addEventListener("click",(function(){F.toggle()})),null===(g=this.thumbnailButton)||void 0===g||g.addEventListener("click",(function(){F.switchView(D.SidebarView.THUMBS)})),null===(B=this.outlineButton)||void 0===B||B.addEventListener("click",(function(){F.switchView(D.SidebarView.OUTLINE)})),null===(C=this.outlineButton)||void 0===C||C.addEventListener("dblclick",(function(){F.eventBus.dispatch("toggleoutlinetree",{source:F})})),null===(Q=this.attachmentsButton)||void 0===Q||Q.addEventListener("click",(function(){F.switchView(D.SidebarView.ATTACHMENTS)})),null===(E=this.layersButton)||void 0===E||E.addEventListener("click",(function(){F.switchView(D.SidebarView.LAYERS)})),null===(i=this.layersButton)||void 0===i||i.addEventListener("dblclick",(function(){F.eventBus.dispatch("resetlayers",{source:F})})),null===(o=this.signaturesButton)||void 0===o||o.addEventListener("click",(function(){F.switchView(D.SidebarView.SIGNATURES)})),null===(w=this._currentOutlineItemButton)||void 0===w||w.addEventListener("click",(function(){F.eventBus.dispatch("currentoutlineitem",{source:F})}));var G=function(A,I,g){I.disabled=!A,A?F._showUINotification():F.active===g&&F.switchView(D.SidebarView.THUMBS)};this.eventBus._on("outlineloaded",(function(A){G(A.outlineCount,F.outlineButton,D.SidebarView.OUTLINE),A.currentOutlineItemPromise.then((function(A){F.isInitialViewSet&&(F._currentOutlineItemButton.disabled=!A)}))})),this.eventBus._on("attachmentsloaded",(function(A){G(A.attachmentsCount,F.attachmentsButton,D.SidebarView.ATTACHMENTS)})),this.eventBus._on("layersloaded",(function(A){G(A.layersCount,F.layersButton,D.SidebarView.LAYERS)})),this.eventBus._on("presentationmodechanged",(function(A){A.state===D.PresentationModeState.NORMAL&&F.isThumbnailViewVisible&&F._updateThumbnailViewer()}))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"OverlayManager",(function(){return F}));var B=g(6),C=g.n(B),Q=g(5),E=g.n(Q),D=g(1),i=g.n(D),o=g(7),w=g.n(o),F=function(){function A(){E()(this,A),this.overlays=new WeakMap}var I,g,B,Q;return i()(A,[{key:"register",value:(Q=C()(w.a.mark((function A(I){var g,B=this,C=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(g=C.length>1&&void 0!==C[1]&&C[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 Q.apply(this,arguments)})},{key:"unregister",value:(B=C()(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=C()(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=C()(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 F}));var B=g(6),C=g.n(B),Q=g(5),E=g.n(Q),D=g(1),i=g.n(D),o=g(7),w=g.n(o),F=(g(22),function(){function A(I,g,B,C){var Q=this,D=I.dialog,i=I.fields,o=I.closeButton;E()(this,A),this.dialog=D,this.fields=i,this.overlayManager=g,this.l10n=C,this.fieldData=null,this.reset(),o.addEventListener("click",this.close.bind(this)),this.overlayManager.register(this.dialog),B._on("pagechanging",(function(A){Q._currentPageNumber=A.pageNumber})),B._on("rotationchanging",(function(A){Q._pagesRotation=A.pagesRotation})),this._isNonMetricLocale=!0}var I,g;return i()(A,[{key:"open",value:(g=C()(w.a.mark((function A(){var I,g,B,C,Q,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(),C=B.info,B.contentDispositionFilename,Q=B.contentLength,E=this.parseFileSize(Q),this.fieldData=Object.freeze({fileSize:E,title:C.Title,author:C.Author,subject:C.Subject,keywords:C.Keywords,creationDate:C.CreationDate,modificationDate:C.ModificationDate,creator:C.Creator,producer:C.Producer,version:C.CreatorVersion,pageCount:C.numPages,pageSize:C.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=C()(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 c}));var B=g(6),C=g.n(B),Q=g(5),E=g.n(Q),D=g(1),i=g.n(D),o=g(21),w=g.n(o),F=g(7),G=g.n(F),N=g(22),y=g(88);function h(A,I){var g=Object.keys(A);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(A);I&&(B=B.filter((function(I){return Object.getOwnPropertyDescriptor(A,I).enumerable}))),g.push.apply(g,B)}return g}function R(A){for(var I=1;I<arguments.length;I++){var g=null!=arguments[I]?arguments[I]:{};I%2?h(Object(g),!0).forEach((function(I){w()(A,I,g[I])})):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(g)):h(Object(g)).forEach((function(I){Object.defineProperty(A,I,Object.getOwnPropertyDescriptor(g,I))}))}return A}function M(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 U(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 U(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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}function U(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 c=function(){function A(I,g,B){E()(this,A),w()(this,"_opts",void 0),this.toolbar=I.container,this.eventBus=g,this.l10n=B,this._opts=I,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},{element:I.editorInkButton,eventName:"switchannotationeditormode",eventDetails:{get mode(){return I.editorInkButton.classList.contains("toggled")?y.AnnotationEditorType.NONE:y.AnnotationEditorType.INK}}}],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=C()(G.a.mark((function A(I){var g,B,C;return G.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:if(this.eventBus.dispatch("langchanged",{source:self,value:I}),this.items.langSelect){A.next=8;break}return A.abrupt("return");case 8:g=M(this.items.langSelect.options),A.prev=9,g.s();case 11:if((B=g.n()).done){A.next=19;break}if((C=B.value).value===I){A.next=16;break}return C.selected=!1,A.abrupt("continue",17);case 16:C.selected=!0;case 17:A.next=11;break;case 19:A.next=24;break;case 21:A.prev=21,A.t0=A.catch(9),g.e(A.t0);case 24:return A.prev=24,g.f(),A.finish(24);case 27:case"end":return A.stop()}}),A,this,[[9,21,24,27]])}))),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=N.DEFAULT_SCALE_VALUE,this.pageScale=N.DEFAULT_SCALE,this._updateUIState(!0),this.updateLoadingIndicatorState()}},{key:"_bindListeners",value:function(){var A,I=this,g=this.items,B=g.pageNumber,C=g.scaleSelect,Q=g.langSelect,E=this,D=M(this.buttons);try{var i=function(){var g=A.value,B=g.element,C=g.eventName,Q=g.eventDetails;null==B||B.addEventListener("click",(function(A){null!==C&&I.eventBus.dispatch(C,R(R({source:I},Q),{},{isFromKeyboard:0===A.detail}))}))};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})})),C.addEventListener("change",(function(){"custom"!==this.value&&E.eventBus.dispatch("scalechanged",{source:E,value:this.value})})),C.addEventListener("click",(function(A){var I=A.target;this.value===E.pageScaleValue&&"OPTION"===I.tagName.toUpperCase()&&this.blur()})),C.oncontextmenu=N.noContextMenuHandler,Q&&Q.addEventListener("change",(function(){E.eventBus.dispatch("langchanged",{source:E,value:this.value})})),this.eventBus._on("localized",(function(){I._wasLocalized=!0,I._updateUIState(!0)}))}},{key:"_editorModeChanged",value:function(A){var I=A.mode,g=this._opts,B=g.editorInkButton,C=g.editorInkParamsToolbar;Object(N.toggleExpandedBtn)(B,I===y.AnnotationEditorType.INK,C),B.disabled=I===y.AnnotationEditorType.DISABLE}},{key:"_updateUIState",value:function(){var A=arguments.length>0&&void 0!==arguments[0]&&arguments[0],I=this.pageNumber,g=this.pagesCount,B=this.pageScaleValue,C=this.pageScale,Q=this.items,E=!1;if(Q.scaleSelect.options instanceof Array){var D,i=M(Q.scaleSelect.options);try{for(i.s();!(D=i.n()).done;){var o=D.value;o.value===B?(o.selected=!0,E=!0):o.selected=!1}}catch(A){i.e(A)}finally{i.f()}}if(E||(Q.customScaleOption.textContent="".concat((1e4*C/100).toFixed(2),"%"),Q.customScaleOption.selected=!0),Q.previous.disabled=I<=1,Q.next.disabled=I>=g,Q.zoomOut.disabled=C<=N.MIN_SCALE,Q.zoomIn.disabled=C>=N.MAX_SCALE,!this._wasLocalized)return Q.numPages.textContent="/ ".concat(g),void(Q.pageNumber.value=I);A&&(this.hasPageLabels?Q.pageNumber.type="text":(Q.pageNumber.type="number",this.l10n.get("of_pages",{pagesCount:g}).then((function(A){Q.numPages.textContent=A}))),Q.pageNumber.max=g),this.hasPageLabels?(Q.pageNumber.value=this.pageLabel,this.l10n.get("page_of_pages",{pageNumber:I,pagesCount:g}).then((function(A){Q.numPages.textContent=A}))):Q.pageNumber.value=I}},{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 F}));var B=g(5),C=g.n(B),Q=g(1),E=g.n(Q),D=g(22),i=g(96);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,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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}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 F=function(){function A(I,g,B){C()(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 C=function(){var A=g.value,B=A.element,C=A.eventName,Q=A.close,E=A.eventDetails;null==B||B.addEventListener("click",(function(A){if(null!==C){var g={source:I};for(var B in E)g[B]=E[B];I.eventBus.dispatch(C,g)}Q&&I.close()}))};for(B.s();!(g=B.n()).done;)C()}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,C=B===i.CursorTool.SELECT,Q=B===i.CursorTool.HAND;I.classList.toggle("toggled",C),g.classList.toggle("toggled",Q),I.setAttribute("aria-checked",C),g.setAttribute("aria-checked",Q)}))}},{key:"bindScrollModeListener",value:function(A){var I=this,g=A.scrollPageButton,B=A.scrollVerticalButton,C=A.scrollHorizontalButton,Q=A.scrollWrappedButton,E=A.spreadNoneButton,i=A.spreadOddButton,o=A.spreadEvenButton,w=function(A){var w=A.mode,F=w===D.ScrollMode.PAGE,G=w===D.ScrollMode.VERTICAL,N=w===D.ScrollMode.HORIZONTAL,y=w===D.ScrollMode.WRAPPED;null==g||g.classList.toggle("toggled",F),null==B||B.classList.toggle("toggled",G),null==C||C.classList.toggle("toggled",N),null==Q||Q.classList.toggle("toggled",y),null==g||g.setAttribute("aria-checked",F),null==B||B.setAttribute("aria-checked",G),null==C||C.setAttribute("aria-checked",N),null==Q||Q.setAttribute("aria-checked",y);var h=I.pagesCount>15e3;g&&(g.disabled=h),B&&(B.disabled=h),C&&(C.disabled=h),Q&&(Q.disabled=h),E&&(E.disabled=N),i&&(i.disabled=N),o&&(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,C=A.spreadEvenButton;function Q(A){var I=A.mode,Q=I===D.SpreadMode.NONE,E=I===D.SpreadMode.ODD,i=I===D.SpreadMode.EVEN;null==g||g.classList.toggle("toggled",Q),null==B||B.classList.toggle("toggled",E),null==C||C.classList.toggle("toggled",i),null==g||g.setAttribute("aria-checked",Q),null==B||B.setAttribute("aria-checked",E),null==C||C.setAttribute("aria-checked",i)}this.eventBus._on("spreadmodechanged",Q),this.eventBus._on("secondarytoolbarreset",(function(A){A.source===I&&Q({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),C=g.n(B),Q=g(1),E=g.n(Q),D=g(97),i=g(22),o={SELECT:0,HAND:1,ZOOM:2},w=function(){function A(I){var g=this,B=I.container,Q=I.eventBus,E=I.cursorToolOnLoad,i=void 0===E?o.SELECT:E;C()(this,A),this.container=B,this.eventBus=Q,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),C=g.n(B),Q=g(1),E=g.n(Q),D="grab-to-pan-grab",i=function(){function A(I){C()(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,C=this.scrollLeftStart-I;this.element.scrollTo?this.element.scrollTo({top:B,left:C,behavior:"instant"}):(this.element.scrollTop=B,this.element.scrollLeft=C),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(6),C=g.n(B),Q=g(5),E=g.n(Q),D=g(1),i=g.n(D),o=g(7),w=g.n(o),F=(g(87),g(30)),G=g(36),N=g(99),y=g.n(N);g(31);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 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,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 Q,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,Q=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw Q}}}}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 M=function(){function A(I,g,B,C,Q,D,i){E()(this,A),this.coreHelper=new G.Ofd_Core_Helper(40),this.coreHelper.isPrinting=!0,this.waterText=D,this.waterSetting=i,this.dialog=I||document.getElementById("printServiceDialog"),this.overlayManager=g,this.l10n=B,this.ofdRender=new F.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=C,this.callback=Q}var I,g,B;return i()(A,[{key:"setOfdCore",value:function(A){this.core=A,this.ofdRender.setOfdCore(this.core)}},{key:"close",value:(B=C()(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=C()(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"),C=h(A);try{for(C.s();!(g=C.n()).done;){var Q=g.value;B.appendChild(Q)}}catch(A){C.e(A)}finally{C.f()}if(I.callback&&I.eventBus)return void I.eventBus.dispatch("printCallback",{source:I,html:B});y()({printable:B,type:"html",scanStyles:!1,style:"@media print{@page {margin: 2mm;}}"})}}))}),100);case 7:case"end":return A.stop()}}),A,this)}))),function(){return g.apply(this,arguments)})},{key:"prepare",value:(I=C()(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=C()(w.a.mark((function A(g,B){var C,Q,E,D,i,o;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:C=[],Q=0;case 2:if(!(Q<I.core.getOFDPageCount(0))||I.abort){A.next=24;break}return E=794/I.core.pageWidth(0,Q)*25.4,I.ofdRender.setDpi(E),(D=document.createElement("canvas")).style.width="794px",D.style.height="1123px",(i=document.createElement("div")).style.width="795px",i.style.height="1123px",i.style.position="relative",i.style.overflow="hidden",i.appendChild(D),o=I.core.pageHeight(0,Q)*E/25.4,I.waterText&&!I.waterSetting&&i.appendChild(I.watermark({watermark_txt:I.waterText,page_height:o})),I.waterSetting&&(I.waterSetting.page_height=o,i.appendChild(I.watermark(I.waterSetting))),I.ofdRender.renderPage(i,0,Q),C.push(i),A.next=21,I.renderProgress(Q+1);case 21:Q++,A.next=2;break;case 24:I.abort&&g(),g(C);case 26: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 C=Math.round(100*A/I.core.getOFDPageCount(0));I.progressBar.value=C,I.l10n.get("print_progress_percent",{progress:C}).then((function(A){I.progressPerc.textContent=A})),setTimeout((function(){g()}),100)}))}},{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,page_height:0};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 C,Q,E=document.createDocumentFragment(),D=(D=Math.max(document.body.scrollWidth,document.body.clientWidth),780),i=I.page_height;(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++){Q=I.watermark_y+(I.watermark_y_space+I.watermark_height)*o;for(var w=0;w<I.watermark_cols;w++){C=I.watermark_x+(I.watermark_width+I.watermark_x_space)*w;var F=document.createElement("div");F.id="mask_div"+o+w,F.className="mask_div",F.innerHTML=I.watermark_txt,F.style.webkitTransform="rotate(-"+I.watermark_angle+"deg)",F.style.MozTransform="rotate(-"+I.watermark_angle+"deg)",F.style.msTransform="rotate(-"+I.watermark_angle+"deg)",F.style.OTransform="rotate(-"+I.watermark_angle+"deg)",F.style.transform="rotate(-"+I.watermark_angle+"deg)",F.style.visibility="",F.style.position="absolute",F.style.left=C+"px",F.style.top=Q+"px",F.style.overflow="hidden",F.style.zIndex="9999",F.style.pointerEvents="none",F.style.opacity=I.watermark_alpha,F.style.fontSize=I.watermark_fontsize,F.style.fontFamily=I.watermark_font,F.style.color=I.watermark_color,F.style.textAlign="center",F.style.width=I.watermark_width+"px",F.style.height=I.watermark_height+"px",F.style.display="block",E.appendChild(F)}}return E}}]),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 C=I[B]={i:B,l:!1,exports:{}};return A[B].call(C.exports,C,C.exports,g),C.l=!0,C.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 C in A)g.d(B,C,function(I){return A[I]}.bind(null,C));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
|
\**********************/
|