@mescius/dspdfviewer
Version:
Document Solutions PDF Viewer
1 lines • 13.9 MB
JavaScript
!function(A,B){"object"==typeof exports&&"object"==typeof module?module.exports=B():"function"==typeof define&&define.amd?define([],B):"object"==typeof exports?exports.dspdfviewer=B():A.dspdfviewer=B()}(this,()=>(()=>{var A={1121:function(A,B){"use strict";var Q=this&&this.__awaiter||function(A,B,Q,I){return new(Q||(Q=Promise))(function(g,E){function C(A){try{G(I.next(A))}catch(A){E(A)}}function D(A){try{G(I.throw(A))}catch(A){E(A)}}function G(A){var B;A.done?g(A.value):(B=A.value,B instanceof Q?B:new Q(function(A){A(B)})).then(C,D)}G((I=I.apply(A,B||[])).next())})},I=this&&this.__generator||function(A,B){var Q,I,g,E,C={label:0,sent:function(){if(1&g[0])throw g[1];return g[1]},trys:[],ops:[]};return E={next:D(0),throw:D(1),return:D(2)},"function"==typeof Symbol&&(E[Symbol.iterator]=function(){return this}),E;function D(D){return function(G){return function(D){if(Q)throw new TypeError("Generator is already executing.");for(;E&&(E=0,D[0]&&(C=0)),C;)try{if(Q=1,I&&(g=2&D[0]?I.return:D[0]?I.throw||((g=I.return)&&g.call(I),0):I.next)&&!(g=g.call(I,D[1])).done)return g;switch(I=0,g&&(D=[2&D[0],g.value]),D[0]){case 0:case 1:g=D;break;case 4:return C.label++,{value:D[1],done:!1};case 5:C.label++,I=D[1],D=[0];continue;case 7:D=C.ops.pop(),C.trys.pop();continue;default:if(!(g=C.trys,(g=g.length>0&&g[g.length-1])||6!==D[0]&&2!==D[0])){C=0;continue}if(3===D[0]&&(!g||D[1]>g[0]&&D[1]<g[3])){C.label=D[1];break}if(6===D[0]&&C.label<g[1]){C.label=g[1],g=D;break}if(g&&C.label<g[2]){C.label=g[2],C.ops.push(D);break}g[2]&&C.ops.pop(),C.trys.pop();continue}D=B.call(A,C)}catch(A){D=[6,A],I=0}finally{Q=g=0}if(5&D[0])throw D[1];return{value:D[0]?D[1]:void 0,done:!0}}([D,G])}}};Object.defineProperty(B,"__esModule",{value:!0}),B.PromiseQueue=B.AsyncLock=B.createPromiseCapabilityWithTimeout=B.createPromiseCapability=void 0,B.createPromiseCapability=function(){var A={};return A.promise=new Promise(function(B,Q){A.resolve=B,A.reject=Q}),A},B.createPromiseCapabilityWithTimeout=function(A,B){void 0===A&&(A=-1),void 0===B&&(B="Timeout");var Q={resolved:!1,rejected:!1,rejectTimeout:-1};return Q.promise=new Promise(function(A,B){Q.resolve=function(B){-1!==Q.rejectTimeout&&(clearTimeout(Q.rejectTimeout),Q.rejectTimeout=-1),Q.resolved=!0,A(B)},Q.reject=function(A){-1!==Q.rejectTimeout&&(clearTimeout(Q.rejectTimeout),Q.rejectTimeout=-1),Q.rejected=!1,B(A)}}),A>0&&(Q.rejectTimeout=setTimeout(function(){Q.rejectTimeout=-1,Q.resolved||Q.rejected||Q.reject(B)},A)),Q};var g=function(){function A(){this._queue=[],this._isLocked=!1}return Object.defineProperty(A.prototype,"locked",{get:function(){return this._isLocked},enumerable:!1,configurable:!0}),A.prototype.lock=function(){return Q(this,void 0,void 0,function(){var A=this;return I(this,function(B){return[2,new Promise(function(B){A._isLocked?A._queue.push(function(){B(),A._isLocked=!0}):(A._isLocked=!0,B())})]})})},A.prototype.unlock=function(){if(this._isLocked){var A=this._queue.shift();A?A():this._isLocked=!1}},A}();B.AsyncLock=g;var E=function(){function A(){this._queue=Promise.resolve(!0),this._queueId=0}return A.prototype.enqueue=function(A){var B=this;return A.___queueId||(A.___queueId=this._queueId),new Promise(function(g,E){A.___queueId===B._queueId&&(B._queue=B._queue.then(function(){return Q(B,void 0,void 0,function(){return I(this,function(B){switch(B.label){case 0:return A.___queueId!==this._queueId?[2]:[4,A()];case 1:return B.sent(),[2]}})})}).then(g).catch(E))})},A.prototype.clear=function(){this._queueId++,isNaN(this._queueId)&&(this._queueId=0),this._queue=Promise.resolve(!0)},A}();B.PromiseQueue=E},4794:A=>{function B(A){return Promise.resolve().then(()=>{var B=new Error("Cannot find module '"+A+"'");throw B.code="MODULE_NOT_FOUND",B})}B.keys=()=>[],B.resolve=B,B.id=4794,A.exports=B},10548:()=>{},27398:function(A,B){"use strict";var Q=this&&this.__spreadArray||function(A,B,Q){if(Q||2===arguments.length)for(var I,g=0,E=B.length;g<E;g++)!I&&g in B||(I||(I=Array.prototype.slice.call(B,0,g)),I[g]=B[g]);return A.concat(I||Array.prototype.slice.call(B))};function I(A){var B=null;return A&&A.getRootNode&&(B=A.getRootNode()),B||(B=document),B}function g(A,B){return A&&(" "+A.className+" ").indexOf(" "+B+" ")>-1}function E(){var A=D().navigator,B=Number.isFinite(A.maxTouchPoints)?A.maxTouchPoints:A.msMaxTouchPoints;return Number.isFinite(B)?B>0&&256!==B:"ontouchstart"in window}function C(A,B){var Q=document.createEvent("MouseEvents");Q.initEvent(B,!0,!0),A.dispatchEvent(Q)}function D(){try{if(window.top)try{if(window!==window.top)return window.top.navigator,window.top}catch(A){if(window.frameElement)try{if(window.parent&&window!==window.parent)return window.parent.navigator,window.parent}catch(A){}}}catch(A){}return window}Object.defineProperty(B,"__esModule",{value:!0}),B.resolveGlobalWindowOption=B.getSafeTopWindow=B.sanitizeHTML=B.triggerFullStackClick=B.triggerMouseEvent=B.reversePopupRotation=B.getEventCoordinates=B.isTouchEventsEnabled=B.findElementIndex=B.findSelfOrAncestorAttr=B.findSelfOrAncestor=B.classListContains=B.isInputArea=B.getEventTarget=B.isDescendant=B.closestShadowRootOrBody=B.getShadowRootOrDocument=void 0,B.getShadowRootOrDocument=I,B.closestShadowRootOrBody=function(A){var B=I(A);return B.body?B.body:B},B.isDescendant=function(A,B){for(var Q=A.parentNode;Q;){if(Q===B)return!0;Q=Q.parentNode}return!1},B.getEventTarget=function(A){return(A.path||A.composedPath&&A.composedPath()||[])[0]||A.target},B.isInputArea=function(A){if(!A)return!1;for(var B="INPUT"===A.tagName||"TEXTAREA"===A.tagName||"SELECT"===A.tagName;A&&!B&&(B=A.hasAttribute&&A.hasAttribute("contenteditable")&&"true"===A.getAttribute("contenteditable"),"SECTION"!==A.tagName&&"BODY"!==A.tagName&&"HTML"!==A.tagName);)A=A.parentNode;return B},B.classListContains=g,B.findSelfOrAncestor=function(A,B){if(A&&!g(A,B))for(;(A=A.parentNode)&&!g(A,B););return A},B.findSelfOrAncestorAttr=function(A,B){if(A&&(!A.hasAttribute||!A.hasAttribute(B)))for(;(A=A.parentNode)&&A&&(!A.hasAttribute||!A.hasAttribute(B)););return A},B.findElementIndex=function(A){return A&&A.parentNode?Q([],Array.from(A.parentNode.children),!0).indexOf(A):-1},B.isTouchEventsEnabled=E,B.getEventCoordinates=function(A){if(E()&&A.touches&&A.touches.length>0){var B=A.touches[0];return{pageX:B.pageX||0,pageY:B.pageY||0,clientX:B.clientX||0,clientY:B.clientY||0}}return{pageX:A.pageX||0,pageY:A.pageY||0,clientX:A.clientX||0,clientY:A.clientY||0}},B.reversePopupRotation=function(A,B,Q){if(360===B&&(B=0),A){if(!A.parentNode)return;if(B){var I=parseInt((A.style.left||"").toString().replace("px",""))||0,g=Math.round(I/2);A.style.transform="rotate(-"+B+"deg)";var E="left";switch(B){case 90:case 180:case 270:E="-"+g+"px -"+g+"px"}A.style.transformOrigin=E}else A.style.transform="",A.style.transformOrigin=""}Q&&(Q.style.transform=B?"rotate(-"+B+"deg)":"")},B.triggerMouseEvent=C,B.triggerFullStackClick=function(A){A&&(C(A,"mouseover"),C(A,"mousedown"),C(A,"mouseup"),C(A,"click"))},B.sanitizeHTML=function(A){return A.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi,"")},B.getSafeTopWindow=D,B.resolveGlobalWindowOption=function(A){if(Object.prototype.hasOwnProperty.call(window,A))return window[A];var B=D();return B!==window&&Object.prototype.hasOwnProperty.call(B,A)?B[A]:null}},34401:(A,B)=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0}),B.toCamelCase=B.htmlDecode=B.unicodeToChar=B.fasterBytesToBase64=B.base64ToBytes=B.bytesToBase64=B.base64ToUtf8=B.utf8ToBase64=void 0,B.unicodeToChar=function(A){return A.replace(/\\u[\dA-F]{4}/gi,function(A){return String.fromCharCode(parseInt(A.replace(/\\u/g,""),16))})},B.htmlDecode=function(A){var B;if(window.DOMParser){B=(new window.DOMParser).parseFromString(A,"text/html").documentElement.textContent||""}else{var Q=document.createElement("textarea");Q.innerHTML=A,B=(0===Q.childNodes.length?"":Q.childNodes[0].nodeValue)||""}return B=B.replace("","•")};var Q=function(){for(var A=[],B="A".charCodeAt(0),Q="a".charCodeAt(0),I="0".charCodeAt(0),g=0;g<26;++g)A.push(String.fromCharCode(B+g));for(g=0;g<26;++g)A.push(String.fromCharCode(Q+g));for(g=0;g<10;++g)A.push(String.fromCharCode(I+g));return A.push("+"),A.push("/"),A}();B.fasterBytesToBase64=function(A){for(var B,Q="",I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g=new Uint8Array(A),E=g.byteLength,C=E%3,D=E-C,G=0;G<D;G+=3)Q+=I[(16515072&(B=g[G]<<16|g[G+1]<<8|g[G+2]))>>18]+I[(258048&B)>>12]+I[(4032&B)>>6]+I[63&B];return 1==C?Q+=I[(252&(B=g[D]))>>2]+I[(3&B)<<4]+"==":2==C&&(Q+=I[(64512&(B=g[D]<<8|g[D+1]))>>10]+I[(1008&B)>>4]+I[(15&B)<<2]+"="),Q},B.bytesToBase64=function(A){var B,I="",g=A.length;for(B=2;B<g;B+=3)I+=Q[A[B-2]>>2],I+=Q[(3&A[B-2])<<4|A[B-1]>>4],I+=Q[(15&A[B-1])<<2|A[B]>>6],I+=Q[63&A[B]];return B===g+1&&(I+=Q[A[B-2]>>2],I+=Q[(3&A[B-2])<<4],I+="=="),B===g&&(I+=Q[A[B-2]>>2],I+=Q[(3&A[B-2])<<4|A[B-1]>>4],I+=Q[(15&A[B-1])<<2],I+="="),I},B.base64ToBytes=function(A){for(var B=";base64,",Q=A.indexOf(B),I=-1!==Q?A.substring(Q+8):A,g=window.atob(I),E=g.length,C=new Uint8Array(new ArrayBuffer(E)),D=0;D<E;D++)C[D]=g.charCodeAt(D);return C},B.utf8ToBase64=function(A){return window.btoa(unescape(encodeURIComponent(A)))},B.base64ToUtf8=function(A){return decodeURIComponent(escape(window.atob(A)))},B.toCamelCase=function(A){return void 0===A?"":A.toString().replace(/[-_]+(.)?/g,function(A,B){return B?B.toUpperCase():""}).replace(/^./,function(A){return A.toLowerCase()})}},36848:(A,B)=>{"use strict";function Q(A,B,Q){return void 0===Q||0===+Q?Math[A](B):(B=+B,Q=+Q,isNaN(B)||"number"!=typeof Q||Q%1!=0?NaN:(B=B.toString().split("e"),+((B=(B=Math[A](+(B[0]+"e"+(B[1]?+B[1]-Q:-Q)))).toString().split("e"))[0]+"e"+(B[1]?+B[1]+Q:Q))))}function I(A,B){return Q("round",A,B)}function g(A){var B=A.slice(0);return A[0]>A[2]&&(B[0]=A[2],B[2]=A[0]),A[1]>A[3]&&(B[1]=A[3],B[3]=A[1]),B}function E(A,B,Q,g,E,C){void 0===C&&(C=!0);var D=C?Math.PI/180*E:E,G=Math.cos(D),w=Math.sin(D),M=G*(g-B)-w*(Q-A)+B;return[I(G*(Q-A)+w*(g-B)+A,-1),I(M,-1)]}function C(A,B,Q,I){var g=Math.atan2(I-B,Q-A)*(180/Math.PI);return g<0&&(g=360+g),g}function D(A,B,Q,I){if(void 0===I&&(I=!0),!B){var C=Math.abs(A[2]-A[0]),D=Math.abs(A[3]-A[1]);B=[A[0]+C/2,A[1]+D/2]}var G=E(B[0],B[1],A[0],A[1],Q,I),w=E(B[0],B[1],A[2],A[3],Q,I);return g([G[0],G[1],w[0],w[1]])}Object.defineProperty(B,"__esModule",{value:!0}),B.findLinesIntersection=B.rotateRectAndFillBoth=B.getAngle=B.getDistance=B.reverseRotateRect=B.rotateRect=B.deg2rad=B.rad2Deg=B.findVectorsAngle=B.rotatePoint=B.normalizeRect=B.round10=B.ceil10=B.floor10=void 0,B.floor10=function(A,B){return Q("floor",A,B)},B.ceil10=function(A,B){return Q("ceil",A,B)},B.round10=I,B.normalizeRect=g,B.rotatePoint=E,B.findVectorsAngle=function(A,B,Q){var I=C(Q[0],Q[1],A[0],A[1]);return(360+C(Q[0],Q[1],B[0],B[1])-I)%360},B.rad2Deg=function(A){return 180*A/Math.PI},B.deg2rad=function(A){return A*(Math.PI/180)},B.rotateRect=D,B.reverseRotateRect=function(A,B,Q){var I=0;return[{a:-360,sect:1},{a:-321,sect:2},{a:-270,sect:1},{a:-269,sect:2},{a:-232,sect:1},{a:-141,sect:2},{a:-90,sect:1},{a:-89,sect:2},{a:-52,sect:1},{a:39,sect:2},{a:90,sect:1},{a:91,sect:2},{a:128,sect:1},{a:219,sect:2},{a:270,sect:1},{a:271,sect:2},{a:308,sect:1}].forEach(function(A){A.a<=Q&&(I=A.sect)}),D(1===I?A:[A[2],A[1],A[0],A[3]],B,-Q,!0)},B.getDistance=function(A,B,Q,I){var g=Q-A,E=I-B;return Math.sqrt(E*E+g*g)},B.getAngle=function(A,B,Q,I){var g=Q-A,E=I-B;return Math.atan2(E,g)},B.rotateRectAndFillBoth=function(A,B,Q,I){void 0===I&&(I=!0);var E=D(A=g(A),B,Q,I),C=D([A[2],A[1],A[0],A[3]],B,Q,I),G=[Math.min(E[0],C[0]),Math.min(E[1],C[1]),Math.max(E[2],C[2]),Math.max(E[3],C[3])];return{rotatedRect:g([Math.max(A[0],G[0]),Math.min(A[1],G[1]),Math.min(A[2],G[2]),Math.max(A[3],G[3])]),transformedRect:E}},B.findLinesIntersection=function(A,B,Q,I){var g=B[1]-A[1],E=A[0]-B[0],C=g*A[0]+E*A[1],D=I[1]-Q[1],G=Q[0]-I[0],w=D*Q[0]+G*Q[1],M=g*G-D*E;return M?[(G*C-E*w)/M,(g*w-D*C)/M]:null}},39093:(A,B)=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0}),B.SharedRef=void 0;var Q="___gcpdfviewer_shared_ref",I="___gcpdfviewer_shared_ref18n",g=function(){function A(A,B,Q){this.viewer=A,this.moment=B,this.i18n=Q,this.i18n}return A.onViewerInitialize=function(B,I){window[Q]||(window[Q]={}),window[Q][B.instanceId]=new A(B,I,B.in17n)},A.get=function(A,B){if(void 0===B&&(B=!1),window[Q]||(window[Q]={}),!window[Q][A]&&B)for(var I in window[Q])return window[Q][I];if(!A&&!B)throw new Error("Missing instanceId");return window[Q][A]},A.dispose=function(B){A.get(B)&&(A.get(B).dispose(),delete window[Q][B])},Object.defineProperty(A,"moment",{get:function(){return A.get("",!0).moment},enumerable:!1,configurable:!0}),Object.defineProperty(A,"i18n",{get:function(){var B,Q;return null!==(Q=null===(B=A.get("",!0))||void 0===B?void 0:B.i18n)&&void 0!==Q?Q:window[I]},set:function(A){window[I]=A},enumerable:!1,configurable:!0}),Object.defineProperty(A,"count",{get:function(){return window[Q]?Object.keys(window[Q]).length:0},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"storage",{get:function(){return this.viewer.storage},enumerable:!1,configurable:!0}),A.prototype.dispose=function(){this.releaseResources()},A.prototype.releaseResources=function(){this.storage.releaseResources()},A}();B.SharedRef=g},48470:function(A,B,Q){"use strict";var I=this&&this.__awaiter||function(A,B,Q,I){return new(Q||(Q=Promise))(function(g,E){function C(A){try{G(I.next(A))}catch(A){E(A)}}function D(A){try{G(I.throw(A))}catch(A){E(A)}}function G(A){var B;A.done?g(A.value):(B=A.value,B instanceof Q?B:new Q(function(A){A(B)})).then(C,D)}G((I=I.apply(A,B||[])).next())})},g=this&&this.__generator||function(A,B){var Q,I,g,E,C={label:0,sent:function(){if(1&g[0])throw g[1];return g[1]},trys:[],ops:[]};return E={next:D(0),throw:D(1),return:D(2)},"function"==typeof Symbol&&(E[Symbol.iterator]=function(){return this}),E;function D(D){return function(G){return function(D){if(Q)throw new TypeError("Generator is already executing.");for(;E&&(E=0,D[0]&&(C=0)),C;)try{if(Q=1,I&&(g=2&D[0]?I.return:D[0]?I.throw||((g=I.return)&&g.call(I),0):I.next)&&!(g=g.call(I,D[1])).done)return g;switch(I=0,g&&(D=[2&D[0],g.value]),D[0]){case 0:case 1:g=D;break;case 4:return C.label++,{value:D[1],done:!1};case 5:C.label++,I=D[1],D=[0];continue;case 7:D=C.ops.pop(),C.trys.pop();continue;default:if(!(g=C.trys,(g=g.length>0&&g[g.length-1])||6!==D[0]&&2!==D[0])){C=0;continue}if(3===D[0]&&(!g||D[1]>g[0]&&D[1]<g[3])){C.label=D[1];break}if(6===D[0]&&C.label<g[1]){C.label=g[1],g=D;break}if(g&&C.label<g[2]){C.label=g[2],C.ops.push(D);break}g[2]&&C.ops.pop(),C.trys.pop();continue}D=B.call(A,C)}catch(A){D=[6,A],I=0}finally{Q=g=0}if(5&D[0])throw D[1];return{value:D[0]?D[1]:void 0,done:!0}}([D,G])}}},E=this&&this.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(B,"__esModule",{value:!0}),B.WasmSupportApiBase=void 0;var C=Q(34401),D=Q(1121),G=Q(73921),w=Q(53488),M=E(Q(71710)),i="JVBERi0xLjMNCiXi48/TDQoxIDAgb2JqDQo8PA0KL0NyZWF0b3IgKEdyYXBlQ2l0eS5Eb2N1bWVudHMuUGRmLTMuMS4wLjUwMSkNCj4+DQplbmRvYmoNCjIgMCBvYmoNCjw8DQovVHlwZSAvTWV0YWRhdGENCi9TdWJ0eXBlIC9YTUwNCi9MZW5ndGggOTI0DQo+Pg0Kc3RyZWFtDQrvu788P3hwYWNrZXQgYmVnaW49J++7vycgaWQ9J1c1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCc/Pg0KPHg6eG1wbWV0YSB4OnhtcHRrPSJHcmFwZUNpdHkuRG9jdW1lbnRzLlBkZi0zLjEuMC41MDEiIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIj4NCiAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4NCiAgICA8cmRmOkRlc2NyaXB0aW9uIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgcmRmOmFib3V0PSIiPg0KICAgICAgPGRjOmZvcm1hdD5hcHBsaWNhdGlvbi9wZGY8L2RjOmZvcm1hdD4NCiAgICA8L3JkZjpEZXNjcmlwdGlvbj4NCiAgICA8cmRmOkRlc2NyaXB0aW9uIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgcmRmOmFib3V0PSIiPg0KICAgICAgPHhtcDpDcmVhdGVEYXRlPjIwMjAtMDItMDFUMDg6NDc6MjcrMDA6MDA8L3htcDpDcmVhdGVEYXRlPg0KICAgICAgPHhtcDpNb2RpZnlEYXRlPjIwMjAtMDItMDFUMDg6NDc6MjcrMDA6MDA8L3htcDpNb2RpZnlEYXRlPg0KICAgICAgPHhtcDpNZXRhZGF0YURhdGU+MjAyMC0wMi0wMVQwODo0NzoyNyswMDowMDwveG1wOk1ldGFkYXRhRGF0ZT4NCiAgICA8L3JkZjpEZXNjcmlwdGlvbj4NCiAgICA8cmRmOkRlc2NyaXB0aW9uIHhtbG5zOnBkZj0iaHR0cDovL25zLmFkb2JlLmNvbS9wZGYvMS4zLyIgcmRmOmFib3V0PSIiPg0KICAgICAgPHBkZjpQcm9kdWNlcj5HcmFwZUNpdHkuRG9jdW1lbnRzLlBkZi0zLjEuMC41MDE8L3BkZjpQcm9kdWNlcj4NCiAgICAgIDxwZGY6UERGVmVyc2lvbj4xLjM8L3BkZjpQREZWZXJzaW9uPg0KICAgIDwvcmRmOkRlc2NyaXB0aW9uPg0KICA8L3JkZjpSREY+DQo8L3g6eG1wbWV0YT4NCjw/eHBhY2tldCBlbmQ9J3cnPz4NCmVuZHN0cmVhbQ0KZW5kb2JqDQozIDAgb2JqDQo8PA0KL1R5cGUgL1BhZ2VzDQovQ291bnQgMQ0KL01lZGlhQm94IFswIDAgNjEyIDc5Ml0NCi9LaWRzIFs0IDAgUl0NCj4+DQplbmRvYmoNCjQgMCBvYmoNCjw8DQovVHlwZSAvUGFnZQ0KL1BhcmVudCAzIDAgUg0KL1Jlc291cmNlcyA1IDAgUg0KPj4NCmVuZG9iag0KNSAwIG9iag0KPDwNCi9Qcm9jU2V0IFsvUERGIC9UZXh0IC9JbWFnZUIgL0ltYWdlQyAvSW1hZ2VJXQ0KPj4NCmVuZG9iag0KNiAwIG9iag0KPDwNCi9UeXBlIC9DYXRhbG9nDQovUGFnZXMgMyAwIFINCi9NZXRhZGF0YSAyIDAgUg0KL1BhZ2VNb2RlIC9Vc2VOb25lDQo+Pg0KZW5kb2JqDQp4cmVmDQowIDcNCjAwMDAwMDAwMDAgNjU1MzUgZg0KMDAwMDAwMDAxNyAwMDAwMCBuDQowMDAwMDAwMDg4IDAwMDAwIG4NCjAwMDAwMDExMDMgMDAwMDAgbg0KMDAwMDAwMTE5MiAwMDAwMCBuDQowMDAwMDAxMjYzIDAwMDAwIG4NCjAwMDAwMDEzMzUgMDAwMDAgbg0KdHJhaWxlcg0KPDwNCi9TaXplIDcNCi9Sb290IDYgMCBSDQovSW5mbyAxIDAgUg0KL0lEIFs8MURCMTA3QUJGMjU4MDU0QUExRTg3MzM1QjIyODQ0Q0M+IDwxREIxMDdBQkYyNTgwNTRBQTFFODczMzVCMjI4NDRDQz5dDQo+Pg0Kc3RhcnR4cmVmDQoxNDI3DQolJUVPRg0K",o=function(){function A(A){this.clientId=(0,w.generateUid)("wasm_client"),this.isDocumentShared=!1,this.isConnected=!1,this.isOpened=!1}return Object.defineProperty(A.prototype,"isConnected",{get:function(){return this._isConnected},set:function(A){var B=this;this._isConnected=A,this.viewer&&(A?this.serverVersion().then(function(A){B.viewer.plugin.onSupportApiConnected(A,!1)}):this.viewer.plugin.onSupportApiDisconnected())},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"supportApiType",{get:function(){return"DsPdfWasm"},enumerable:!1,configurable:!0}),A.prototype.applyOptions=function(A){this.viewerOptions=A},A.prototype.setViewer=function(A){this.viewer=A},A.prototype.canEditAnnotation=function(A){return this.isOpened},A.prototype.checkDocumentLoader=function(){return I(this,void 0,void 0,function(){return g(this,function(A){return[2,this.isOpened]})})},A.prototype.closeDocumentLoader=function(){return I(this,void 0,void 0,function(){return g(this,function(A){return this.isOpened&&(this.isOpened=!1,this.wasmModule._close_document()),[2,!0]})})},A.prototype.close=function(){return I(this,void 0,void 0,function(){return g(this,function(A){return this.isOpened&&(this.isOpened=!1,this.wasmModule._close_document()),[2,"ok"]})})},A.prototype.connect=function(A){return I(this,void 0,void 0,function(){return g(this,function(B){return[2,this._connectInternal(A)]})})},A.prototype.dispose=function(){this.isConnected&&(this.isConnected=!1,this.isOpened=!1,this.wasmModule._Globals_Free())},A.prototype.getDisabledFeatures=function(){return["ESign","Collaboration"]},A.prototype.normalizeExportFileName=function(A){return A?A.replace(/([.-](?:pdf|zip))+$/i,""):""},A.prototype.getDownloadUrl=function(A,B,Q){return void 0===B&&(B="PDF"),I(this,void 0,void 0,function(){var Q,I,E,D,G,w,o,F,R,k,U,h,Y,N,J,y;return g(this,function(g){switch(g.label){case 0:return this.isOpened?[3,1]:(y=(0,C.base64ToBytes)(i),Q=new Blob([y],{type:"application/pdf"}),[3,10]);case 1:return"PNG"!==B?[3,5]:(h=this.wasmModule._malloc(10),this.wasmModule.writeTime(h),0!=(Y=this.wasmModule._download_png_pages(h))?[3,2]:(y=(0,C.base64ToBytes)(i),Q=new Blob([y],{type:"application/pdf"}),[3,4]));case 2:for(D=this.wasmModule.getValue(Y,"i32"),G=this.normalizeExportFileName(A)+"-page",w=new M.default,o=Y+4,F=0;F<D;F++)I=this.wasmModule.getValue(o,"*"),o+=4,N=this.wasmModule.getValue(o,"i32"),o+=4,J=new Uint8Array(this.wasmModule.HEAPU8.buffer,I,N),(E=new Uint8Array(N)).set(J),U=F+1,w.file(G+U.toString()+".png",E,{binary:!0});return this.wasmModule._clear_image_pages(),this.wasmModule._free(Y),[4,w.generateAsync({type:"blob"})];case 3:Q=g.sent(),g.label=4;case 4:return[3,10];case 5:return"SVG"!==B?[3,9]:(h=this.wasmModule._malloc(10),this.wasmModule.writeTime(h),0!=(Y=this.wasmModule._download_svg_pages(h))?[3,6]:(y=(0,C.base64ToBytes)(i),Q=new Blob([y],{type:"application/pdf"}),[3,8]));case 6:for(D=this.wasmModule.getValue(Y,"i32"),G=this.normalizeExportFileName(A)+"-page",w=new M.default,o=Y+4,F=0;F<D;F++)R=this.wasmModule.getValue(o,"*"),o+=4,N=this.wasmModule.getValue(o,"i32"),o+=4,J=new Uint8Array(this.wasmModule.HEAPU8.buffer,R,N),(k=new Uint8Array(N)).set(J),U=F+1,w.file(G+U.toString()+".svg",k,{binary:!0});return this.wasmModule._clear_image_pages(),this.wasmModule._free(Y),[4,w.generateAsync({type:"blob"})];case 7:Q=g.sent(),g.label=8;case 8:return[3,10];case 9:h=this.wasmModule._malloc(10),this.wasmModule.writeTime(h),Y=this.wasmModule._download_modified(h),N=this.wasmModule.getValue(Y,"i32")-4,J=new Uint8Array(this.wasmModule.HEAPU8.buffer,Y+4,N),(y=new Uint8Array(N)).set(J),this.wasmModule._free(Y),Q=new Blob([y],{type:"application/pdf"}),g.label=10;case 10:return[2,window.URL.createObjectURL(Q)]}})})},A.prototype.getDownloadUnmodifiedUrl=function(A){var B;if(this.isOpened){var Q=this.wasmModule._download_unmodified(),I=this.wasmModule.getValue(Q,"i32")-4,g=new Uint8Array(this.wasmModule.HEAPU8.buffer,Q+4,I);(B=new Uint8Array(I)).set(g)}else B=(0,C.base64ToBytes)(i);var E=new Blob([B],{type:"application/pdf"});return window.URL.createObjectURL(E)},A.prototype.uploadFiles=function(A,B){return I(this,void 0,void 0,function(){var B,Q,I,E,C,D,G,w;return g(this,function(g){if(this.isOpened){if(!A||!A.length)return[2,!0];for(B=this.viewer.storage,Q=0,I=A.length;Q<I;Q++)if(E=A[Q],C=this.wasmModule.stringToNewUTF8(E),!this.wasmModule._is_uploaded_file(C)){if(!(D=B.getItem(E))){this.viewer.logError("uploadFiles","There is no data in local storage for the file with id '".concat(E,"'. Ignoring the file."));continue}G=D.length,w=this.wasmModule._malloc(G),new Uint8Array(this.wasmModule.HEAPU8.buffer,w,G).set(D),this.wasmModule._upload_file(C,w,G)}return[2,!0]}return[2,!1]})})},A.prototype.getLastError=function(){return I(this,void 0,void 0,function(){return g(this,function(A){return[2,""]})})},A.prototype.getStampCategories=function(){return I(this,void 0,void 0,function(){return g(this,function(A){switch(A.label){case 0:return[4,fetch("".concat(this._getResourcesUrl(),"images/stamps.json"))];case 1:return[4,A.sent().json()];case 2:return[2,A.sent()]}})})},A.prototype.getStampImageUrl=function(A,B,Q){var I="Stamps",g=this.viewer.language;return["ja","cn"].includes(g)&&(I="Stamps_"+g),Q?"".concat(this._getResourcesUrl(),"images/").concat(I,"/").concat(A,"/").concat(B):"".concat(this._getResourcesUrl(),"images/").concat(I,"/").concat(A,"/").concat(B,"?ts=").concat((new Date).getTime())},A.prototype.modify=function(A,B){return I(this,void 0,void 0,function(){var B,Q;return g(this,function(I){return this.isOpened&&A&&(B=JSON.stringify(A),Q=this.wasmModule.stringToNewUTF8(B),this.wasmModule._modify(Q)),[2,"ok"]})})},A.prototype.openBinary=function(A){return I(this,void 0,void 0,function(){var B,Q,I,E;return g(this,function(g){return B="",this.viewerOptions&&(B=this.viewerOptions.supportApiPassword||this.viewerOptions.password),Q=this.wasmModule.stringToNewUTF8(B),I=A.length,E=this.wasmModule._malloc(I+4),this.wasmModule.setValue(E,I+4,"i32"),new Uint8Array(this.wasmModule.HEAPU8.buffer,E+4,I).set(A),this.wasmModule._open_document(E,Q)&&(this.isOpened=!0),[2]})})},A.prototype.serverVersion=function(){return I(this,void 0,void 0,function(){var A;return g(this,function(B){if(!this.isConnected)throw this._connectInternal(!0),new Error("Wasm not loaded yet.");return A=this.wasmModule._Version(),[2,this.wasmModule.UTF8ToString(A)]})})},A.prototype.setOptions=function(A,B){return I(this,void 0,void 0,function(){var B,Q;return g(this,function(I){return this.isConnected&&(A?(B=JSON.stringify(A),Q=this.wasmModule.stringToNewUTF8(B),this.wasmModule._set_save_settings(Q)):this.wasmModule._set_save_settings(0)),[2,"ok"]})})},A.prototype.verifySignature=function(A){return I(this,void 0,void 0,function(){return g(this,function(A){return[2,!1]})})},A.prototype.extractTableData=function(A){return I(this,void 0,void 0,function(){var B,Q,I,E,C;return g(this,function(g){return this.isConnected&&A?(B=JSON.stringify(A),Q=this.wasmModule.stringToNewUTF8(B),I=this.wasmModule._extract_table_data(Q),E=this.wasmModule.UTF8ToString(I),C=JSON.parse(E),this.wasmModule._free(I),[2,C]):[2,null]})})},A.prototype.initWasmModule=function(){return I(this,void 0,void 0,function(){var A,B,Q;return g(this,function(I){switch(I.label){case 0:return[4,this.loadWasmModule()];case 1:return(A=I.sent()).preRun=[],A.postRun=[],A.writeTime=function(B){var Q=new Uint8Array(A.HEAPU8.buffer,B,10),I=new Date,g=I.getFullYear();Q[0]=g>>8,Q[1]=255&g,Q[2]=I.getMonth()+1,Q[3]=I.getDate(),Q[4]=I.getHours(),Q[5]=I.getMinutes(),Q[6]=I.getSeconds();var E=I.getMilliseconds();Q[7]=255&E;var C=1200-I.getTimezoneOffset();Q[8]=E>>2&192|C>>8,Q[9]=255&C},window.onerror=function(A){},B=A._malloc(42),(Q=new Float32Array(A.HEAPU8.buffer,B,8))[1]=Math.random(),Q[2]=Math.random(),Q[3]=Math.random(),Q[4]=Math.random(),Q[5]=Math.random(),Q[6]=Math.random(),Q[7]=293.71,A.setValue(B,4294967295&Date.now(),"*"),A.writeTime(B+32),A._Globals_Init(B),[2,A]}})})},A.prototype._connectInternal=function(A){return I(this,void 0,void 0,function(){var A,B;return g(this,function(Q){switch(Q.label){case 0:if(this.isConnected)return[3,4];if(this._connectPromiseCapability)return[2,this._connectPromiseCapability.promise];this._connectPromiseCapability=(0,D.createPromiseCapability)(),Q.label=1;case 1:return Q.trys.push([1,3,,4]),(A=document.querySelector(".wasm-debugger-outer"))&&(A.style.display="block"),B=this,[4,this.initWasmModule()];case 2:return B.wasmModule=Q.sent(),this.isConnected=!0,this._connectPromiseCapability.resolve(!0),delete this._connectPromiseCapability,[3,4];case 3:return Q.sent(),this._connectPromiseCapability&&(this._connectPromiseCapability.resolve(!1),delete this._connectPromiseCapability),[2,!1];case 4:return[2,!0]}})})},A.prototype._getResourcesUrl=function(){return"".concat(this._findBaseUrl(),"resources/")},A.prototype._findBaseUrl=function(){var A=(this.viewer.options.baseUrl||"").trim();return A||(A=(0,G.findBaseScriptUrl)()),!A||A.endsWith("/")||A.endsWith("\\")||(A+="/"),A},A}();B.WasmSupportApiBase=o},53488:function(A,B,Q){"use strict";var I,g=this&&this.__awaiter||function(A,B,Q,I){return new(Q||(Q=Promise))(function(g,E){function C(A){try{G(I.next(A))}catch(A){E(A)}}function D(A){try{G(I.throw(A))}catch(A){E(A)}}function G(A){var B;A.done?g(A.value):(B=A.value,B instanceof Q?B:new Q(function(A){A(B)})).then(C,D)}G((I=I.apply(A,B||[])).next())})},E=this&&this.__generator||function(A,B){var Q,I,g,E,C={label:0,sent:function(){if(1&g[0])throw g[1];return g[1]},trys:[],ops:[]};return E={next:D(0),throw:D(1),return:D(2)},"function"==typeof Symbol&&(E[Symbol.iterator]=function(){return this}),E;function D(D){return function(G){return function(D){if(Q)throw new TypeError("Generator is already executing.");for(;E&&(E=0,D[0]&&(C=0)),C;)try{if(Q=1,I&&(g=2&D[0]?I.return:D[0]?I.throw||((g=I.return)&&g.call(I),0):I.next)&&!(g=g.call(I,D[1])).done)return g;switch(I=0,g&&(D=[2&D[0],g.value]),D[0]){case 0:case 1:g=D;break;case 4:return C.label++,{value:D[1],done:!1};case 5:C.label++,I=D[1],D=[0];continue;case 7:D=C.ops.pop(),C.trys.pop();continue;default:if(!(g=C.trys,(g=g.length>0&&g[g.length-1])||6!==D[0]&&2!==D[0])){C=0;continue}if(3===D[0]&&(!g||D[1]>g[0]&&D[1]<g[3])){C.label=D[1];break}if(6===D[0]&&C.label<g[1]){C.label=g[1],g=D;break}if(g&&C.label<g[2]){C.label=g[2],C.ops.push(D);break}g[2]&&C.ops.pop(),C.trys.pop();continue}D=B.call(A,C)}catch(A){D=[6,A],I=0}finally{Q=g=0}if(5&D[0])throw D[1];return{value:D[0]?D[1]:void 0,done:!0}}([D,G])}}},C=this&&this.__spreadArray||function(A,B,Q){if(Q||2===arguments.length)for(var I,g=0,E=B.length;g<E;g++)!I&&g in B||(I||(I=Array.prototype.slice.call(B,0,g)),I[g]=B[g]);return A.concat(I||Array.prototype.slice.call(B))};Object.defineProperty(B,"__esModule",{value:!0}),B.isAnnotationAllowsSelectTextBehind=B.updateRotationInit=B.findRotationInit=B.calcRotationRectangles=B.initAnnotationRotateSupport=B.insertFirst=B.applyAnnotationRotate=B.applyAnnotationRotate2=B.clearAnnotationRotate=B.updateAnnotationContentPosition=B.updateInputCheckedAppearance=B.setInputCheckedState=B.logError=B.logMessage=B.isEditorModeEnabled=B.sortedIndex=B.getAccentTextColor=B.moveInkLists=B.detachHeadCss=B.detachHeadJs=B.attachHeadCss=B.cleanseRichText=B.stripHtmlTags=B.attachHeadJs=B.setActiveUserName=B.getActiveUserName=B.getDefaultUserName=B.humanReadableFileSize=B.formatDateTime=B.copyStringToClipboard=B.formatRelativeDate=B.dateToPdfDateString=B.pdfDateStringToDate=B.changeOriginToTop=B.changeOriginToBottom=B.changeRectangleOrigin=B.convertToPdfPoint=B.convertToViewportPoint=B.inverseTransform=B.applyInverseTransform=B.applyTransform=B.getAxialAlignedBoundingBox=B.adjustCoordinates=B.getTransformMatrix=B.cloneObject=B.mergeObject=B.isTypedArray=B.resetStampAspectRatio=B.updateInitialRectPosition=B.generateUid=void 0,B.getFontFormatFromUrl=B.loadFileData=B.getValueFromCssText=B.setImageFileFromCanvas=B.generateRichMediaPoster=B.injectSerializableFile=B.getStandardizedLanguageKey=void 0;var D=Q(85806),G=Q(27398),w=Q(60661),M=Q(36848),i=Q(39093),o=Q(73921);function F(A){return(A||"")+Date.now().toString(36)+Math.random().toString(36).substr(2)}function R(A,B){if(A.rotationInit){var Q=A.rect,I=A.rotationInit.initRect,g=Math.abs(Q[2]-Q[0]),E=Math.abs(Q[3]-Q[1]),C=Math.abs(I[2]-I[0]),D=Math.abs(I[3]-I[1]),G=C-g,w=D-E;B&&(Q[0]=B[0],Q[1]=B[1],Q[2]=Q[0]+g,Q[3]=Q[1]+E);var i=A.rotate||0;switch(i){case 0:case 90:case 180:case 270:var o=(0,M.rotateRect)(Q,null,i);I[0]=o[0],I[1]=o[1],I[2]=o[2],I[3]=o[3];break;default:I[0]=Q[0]+G/2,I[1]=Q[1]-w/2,I[2]=I[0]+C,I[3]=I[1]+D}}}function k(A){return ArrayBuffer.isView(A)&&!(A instanceof DataView)}function U(A,B,Q,I){if(void 0===Q&&(Q=!1),void 0===I&&(I=!1),void 0===B||Q&&void 0!==A&&(g=A)!==Object(g))return A;var g;if(k(B))return B;if(void 0===A){if(B instanceof Date)return new Date(B.getTime());if(B instanceof Array)A=[];else{if(!B||"object"!=typeof B)return B;A={}}}if(B){if(B instanceof Array){if(A&&A instanceof Array){for(var E=[],C=0;C<B.length;C++)A.length>C?E[C]=U(A[C],B[C]):E[C]=U(void 0,B[C]);return E}return B}if("object"==typeof B&&A&&"object"==typeof A){if(A instanceof Array&&(A={}),I)for(var D in A)B.hasOwnProperty(D)||(A[D]=B[D]);for(var D in B)A[D]="implementation"===D||"irtAnnotations"===D||"parentAnnotation"===D||"popupAnnotation"===D||"threads"===D||"bead"===D||"firstBead"===D||"source"===D?B[D]:U(A[D],B[D]);return A}}return B}function h(A,B,Q,I,g){void 0===g&&(g=!1);var E=A;if(g)return[Q,0,0,-I,-E[0]*Q,E[3]*I];var C=B;switch((C%=360)<0&&(C+=360),C||(C=0),C){case 90:return[0,Q,I,0,-E[1]*Q,-E[0]*I];case 180:return[-Q,0,0,I,E[2]*Q,-E[1]*I];case 270:return[0,-Q,-I,0,E[3]*Q,E[2]*I];default:return[Q,0,0,-I,-E[0]*Q,E[3]*I]}}function Y(A,B){return[A[0]*B[0]+A[1]*B[2]+B[4],A[0]*B[1]+A[1]*B[3]+B[5]]}function N(A,B){var Q=B[0]*B[3]-B[1]*B[2];return[(A[0]*B[3]-A[1]*B[2]+B[2]*B[5]-B[4]*B[3])/Q,(-A[0]*B[1]+A[1]*B[0]+B[4]*B[1]-B[5]*B[0])/Q]}function J(A){var B=A[0]*A[3]-A[1]*A[2];return[A[3]/B,-A[1]/B,-A[2]/B,A[0]/B,(A[2]*A[5]-A[4]*A[3])/B,(A[4]*A[1]-A[5]*A[0])/B]}function y(A){var B=document.createElement("textarea");B.value=A,B.style.position="absolute",B.style.left="-9999px",document.body.appendChild(B),B.select(),B.setSelectionRange(0,B.value.length);try{document.execCommand("copy")}catch(A){}document.body.removeChild(B)}function c(A,B){try{if(!A)return"";B||(B="yyyy-mm-dd HH:MM");B={0:"HH:MM",1:"h:MM tt",2:"HH:MM:ss",3:"h:MM:ss tt"}[B]||B;var Q=function(A,B){void 0===B&&(B=2);for(var Q=String(A);Q.length<B;)Q="0"+Q;return Q},I=function(A){return A<12?"am":"pm"},g={yyyy:String(A.getFullYear()),yy:String(A.getFullYear()).slice(-2),mmmm:A.toLocaleString("default",{month:"long"}),mmm:A.toLocaleString("default",{month:"short"}),mm:Q(A.getMonth()+1),m:String(A.getMonth()+1),dddd:A.toLocaleString("default",{weekday:"long"}),ddd:A.toLocaleString("default",{weekday:"short"}),dd:Q(A.getDate()),d:String(A.getDate()),HH:Q(A.getHours()),H:String(A.getHours()),hh:Q(A.getHours()%12||12),h:String(A.getHours()%12||12),MM:Q(A.getMinutes()),M:String(A.getMinutes()),ss:Q(A.getSeconds()),s:String(A.getSeconds()),tt:I(A.getHours()),t:I(A.getHours())[0]};return B.replace(/yyyy|yy|mmmm|mmm|mm|m|dddd|ddd|dd|d|HH|H|hh|h|MM|M|ss|s|tt|t/g,function(A){return g[A]})}catch(B){return String(A)}}B.generateUid=F,B.updateInitialRectPosition=R,B.resetStampAspectRatio=function(A,B,Q,I,g,E){return void 0===E&&(E=!0),new Promise(function(C){if(A){var D=window.URL.createObjectURL(new Blob([A.buffer||A])),G=new Image;G.onload=function(){var A={width:G.naturalWidth||G.width,height:G.naturalHeight||G.height};g&&(A.width=72*A.width/g,A.height=72*A.height/g);var M=B.getPageSize(B.pageIndex),i=I.rect,o=Math.abs(i[2]-i[0]),F=Math.abs(i[3]-i[1]),k=Math.max(o,F),U=w.GcMeasurement.fitWithAspectRatio(A,k>10?{width:k,height:k}:M),h={x:I.rect[0],y:I.rect[1]};h.x+U.width>M.width&&(h.x=M.width-U.width),h.y+U.height>M.height&&(h.y=M.height-U.height),h.x<0&&(h.x=0),h.y<0&&(h.y=0);var Y=[h.x,h.y,h.x+U.width,h.y+U.height];I.rect=Y,I.rotate&&(I.rotationInit=void 0,V(I,I.rotate),R(I,[h.x,h.y])),B.updateAnnotation(Q,I).then(function(A){E&&B.selectAnnotation(A.pageIndex,A.annotation),C(A)}),D&&(URL.revokeObjectURL(D),D=null)},G.onerror=function(){D&&(URL.revokeObjectURL(D),D=null),C(null)},G.src=D}else C(null)})},B.isTypedArray=k,B.mergeObject=U,B.cloneObject=function(A){return U(void 0,A)},B.getTransformMatrix=h,B.adjustCoordinates=function(A,B,Q,I,g,E){void 0===I&&(I=!0),void 0===g&&(g=!1),void 0===E&&(E=1);var C,D=[A[0]<0?-A[0]:A[0],A[1]<0?-A[1]:A[1]],G=!0;A[0]<0&&0===A[2]?(C=[A[0],A[1]-D[1],A[2],A[3]-D[1]],G=!1):C=[A[0]-D[0],A[1]-D[1],A[2]-D[0],A[3]-D[1]];var w=h(C,Q,E,E,!1);I&&(w=J(w));var M=Y(B,w);return g||(M=[M[0],C[3]-M[1]]),G?[M[0]+A[0],M[1]+A[1]]:[M[0],M[1]+A[1]]},B.getAxialAlignedBoundingBox=function(A,B){var Q=Y(A,B),I=Y(A.slice(2,4),B),g=Y([A[0],A[3]],B),E=Y([A[2],A[1]],B);return[Math.min(Q[0],I[0],g[0],E[0]),Math.min(Q[1],I[1],g[1],E[1]),Math.max(Q[0],I[0],g[0],E[0]),Math.max(Q[1],I[1],g[1],E[1])]},B.applyTransform=Y,B.applyInverseTransform=N,B.inverseTransform=J,B.convertToViewportPoint=function(A,B,Q){return Y([A,B],Q)},B.convertToPdfPoint=function(A,B,Q){return N([A,B],Q)},B.changeRectangleOrigin=function(A,B,Q,I){void 0===Q&&(Q="BottomLeft"),void 0===I&&(I=!0);var g=C([],A,!0);if(I){var E=Math.min(A[1],A[3]),D=Math.max(A[1],A[3]);return("BottomLeft"===Q||"TopLeft"===Q)&&(g[1]=B[3]-D+B[1],g[3]=B[3]-E+B[1]),(0,M.normalizeRect)(g)}return E=A[1],D=A[3],("BottomLeft"===Q||"TopLeft"===Q)&&(g[1]=B[3]-E+B[1],g[3]=B[3]-D+B[1]),g},B.changeOriginToBottom=function(A,B){return B[3]-A+B[1]},B.changeOriginToTop=function(A,B){return B[3]-A-B[1]},B.pdfDateStringToDate=function(A){if(!A||"string"!=typeof A)return A&&A.getTime?A:null;I||(I=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));var B=I.exec(A);if(!B)return null;var Q=parseInt(B[1],10),g=parseInt(B[2],10);g=g>=1&&g<=12?g-1:0;var E=parseInt(B[3],10);E=E>=1&&E<=31?E:1;var C=parseInt(B[4],10);C=C>=0&&C<=23?C:0;var D=parseInt(B[5],10);D=D>=0&&D<=59?D:0;var G=parseInt(B[6],10);G=G>=0&&G<=59?G:0;var w=B[7]||"Z",M=parseInt(B[8],10);M=M>=0&&M<=23?M:0;var i=parseInt(B[9],10)||0;return i=i>=0&&i<=59?i:0,"-"===w?(C+=M,D+=i):"+"===w&&(C-=M,D-=i),new Date(Date.UTC(Q,g,E,C,D,G))},B.dateToPdfDateString=function(A){var B=null;if(void 0===A)return null;if(A instanceof Date)B=A;else if("string"==typeof A)B=new Date(A);else if("number"==typeof A)B=new Date(A);else{if(!A||!A.toDate)return null;B=A.toDate()}if(!B)return null;if(isNaN(B.getTime()))return null;var Q=B.getUTCFullYear(),I=B.getUTCMonth()+1,g=B.getUTCDate(),E=B.getUTCHours(),C=B.getUTCMinutes(),D=B.getUTCSeconds(),G=Q.toString().padStart(4,"0"),w=I.toString().padStart(2,"0"),M=g.toString().padStart(2,"0"),i=E.toString().padStart(2,"0"),o=C.toString().padStart(2,"0"),F=D.toString().padStart(2,"0");return"D:".concat(G).concat(w).concat(M).concat(i).concat(o).concat(F,"Z")},B.formatRelativeDate=function(A,B,Q){if(!A)return"";var I=new Date,g=A.getTime()-I.getTime(),E=g>0,C=Math.abs(g);if(C<1e3)return B.t("labels.relative-date.right-now","right now");var D=Math.floor(C/1e3);if(D<60)return E?B.t("labels.relative-date.in-seconds-format","in {{sec}} sec.",{sec:D}):B.t("labels.relative-date.seconds-ago-format","{{sec}} sec. ago",{sec:D});var G=Math.floor(C/6e4);if(G<60)return E?B.t("labels.relative-date.in-minutes-format","in {{min}} min.",{min:G}):B.t("labels.relative-date.minutes-ago-format","{{min}} min. ago",{min:G});var w=c(A,Q);return E?B.t("labels.relative-date.at-format","at {{date}}",{date:w}):w},B.copyStringToClipboard=function(A){navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(A).then(function(){}).catch(function(B){y(A)}):y(A)},B.formatDateTime=c,B.humanReadableFileSize=function(A,B){var Q;Q=B?[B.t("labels.fileSize.b","B"),B.t("labels.fileSize.kb","KB"),B.t("labels.fileSize.mb","MB"),B.t("labels.fileSize.gb","GB"),B.t("labels.fileSize.tb","TB"),"PB","EB","ZB","YB"]:["B","KB","MB","GB","TB","PB","EB","ZB","YB"];var I=A?Math.floor(Math.log(A)/Math.log(1024)):0;return 1*(A/Math.pow(1024,I)).toFixed(2)+" "+Q[I]};var S="gcpdfviewerusername";function a(){var A=i.SharedRef.i18n;return A?A.t("annotation-defaults.default-user-name","Anonymous"):"Anonymous"}B.getDefaultUserName=a,B.getActiveUserName=function(A){var B=void 0;if(A&&(B=A.userName),!B)try{var Q=localStorage.getItem(S);if(Q){var I=JSON.parse(Q);I&&(B=I.userName)}}catch(A){}return B||(B=a()),B},B.setActiveUserName=function(A,B){A||(A=a());try{var Q={userName:A,setBy:B};localStorage.setItem(S,JSON.stringify(Q))}catch(A){}};var H={},s={};function L(A,B){try{for(var Q=A.querySelector(B),I=0;Q&&I<5;)Q.remove?Q.remove():Q.parentNode.removeChild(Q),Q=A.querySelector(B),I++}catch(A){}}function K(A,B,Q){var I=A.closest(".annotationLayer"),g=null==I?void 0:I.querySelectorAll('input[data-name="'+A.getAttribute("data-name")+'"]');g&&g.length>1?g.forEach(function(I){Q&&I.hasAttribute("exportValue")&&Q===I.getAttribute("exportValue")?T(I,!0):"radio"===A.type&&A!==I&&B?T(I,!1):T(I,A===I?B:void 0)}):T(A,B)}function T(A,B){void 0===B&&(B=!!A.checked);var Q=A.closest("section");if(Q){var I=Q.getAttribute("data-annotation-id");if(I){B?Q.classList.add("checked"):Q.classList.remove("checked");var g=A.getAttribute("exportValue");if(g){var E=".gc-annotation-appearance-"+I+"-N",C=".gc-annotation-appearance-"+I+"-N_"+g.replace(/[\s\\\/\n]+/gm,"_"),D=".gc-annotation-appearance-"+I+"-N_Off",G=Q.querySelector(E),w=Q.querySelector(D),M=Q.querySelector(C);M||(M=Q.querySelector(".gc-annotation-appearance-"+I+"-N_Yes")||Q.querySelector(".gc-annotation-appearance-"+I+"-N_On")),M&&(G&&(G.style.display="none"),Q.classList.add("gc-annotation-has-appearance"),B?(M.style.display="block",w&&(w.style.display="none")):(M.style.display="none",w&&(w.style.display="block")))}}}}function j(A,B,Q,I){A.style.position="absolute",A.style.left="",A.style.top="",A.style.right="";var g="100%",E="100%";switch(B){case-90:case 90:A.style.transformOrigin="0 0",g="".concat(Q,"px"),E="".concat(I,"px"),A.style.left="0px",A.style.top="".concat(Q,"px");break;case-180:case 180:A.style.transformOrigin="0 0",A.style.top="".concat(Q,"px"),A.style.left="".concat(I,"px");break;case-270:case 270:A.style.transformOrigin="0 0",g="".concat(Q,"px"),E="".concat(I,"px"),A.style.left="".concat(I,"px");break;default:g="".concat(I,"px"),E="".concat(Q,"px"),A.style.transformOrigin="initial"}A.style.width=g,A.style.height=E}function Z(A){for(var B=A.classList.contains("gc-rotate-support")?[A]:Array.from(A.querySelectorAll(".gc-rotate-support")),Q=0;Q<B.length;Q++){var I=B[Q];I.style.transform="",I.style.transformOrigin="",I.style.left="",I.style.top="",I.style.right="";for(var g=0,E=Array.from(I.querySelectorAll("IMG"));g<E.length;g++){var C=E[g];C.style.transform="",C.style.transformOrigin=""}}}function x(A,B){var Q;if(void 0===B&&(B=[0,0,0,0]),A.rotationInit)Q=A.rotationInit.initRect||A.rect||B;else if(!A.fileIdChanged){if(A.appearanceBBox){var I=A.appearanceBBox[2]-A.appearanceBBox[0],g=A.appearanceBBox[3]-A.appearanceBBox[1],E=(A.rect[2]-A.rect[0]-I)/2,C=(A.rect[3]-A.rect[1]-g)/2,D=A.rect[0]+E,G=A.rect[1]+C;Q=[D,G,D+I,G+g]}!Q&&A.rotate&&(Q=(0,M.rotateRect)(A.rect||B,null,A.rotate,!0))}return Q||(Q=A.rect||B),Q}function q(A,B,Q){void 0===Q&&(Q=!1);var I=A.closest(".gc-annotation")||A.closest(".gc-widget")||A.closest("section"),g=B.rotate;if(Number.isFinite(g))for(var E=x(B,[I.offsetLeft,I.offsetTop,I.offsetLeft+I.offsetWidth,I.offsetTop+I.offsetHeight]),C=B.rect||[I.offsetLeft,I.offsetTop,I.offsetLeft+I.offsetWidth,I.offsetTop+I.offsetHeight],D=Math.abs(E[2]-E[0]),G=Math.abs(E[3]-E[1]),w=Math.abs(C[2]-C[0]),M=Math.abs(C[3]-C[1]),i=A.classList.contains("gc-rotate-support")?[A]:Array.from(A.querySelectorAll(".gc-rotate-support")),o=0;o<i.length;o++){var F=i[o],R=(F.style.transform||"").toString();R=R.replace(/(\s*rotate\(.+\))/gm,""),R+=" rotate("+-g+"deg)",F.style.transform=R,F.style.transformOrigin="",F.style.width=D+"px",F.style.height=G+"px",F.style.position="absolute",F.style.left="".concat((w-D)/2,"px"),F.style.top="".concat((M-G)/2,"px"),F.setAttribute("data-result-width",D.toString());var k=F.querySelector(".gc-text-content");k&&(k.style.width="100%",k.style.height="100%");for(var U=0,h=Array.from(A.querySelectorAll("IMG"));U<h.length;U++){var Y=h[U];Y.style.width="100%",Y.style.height="100%"}}}function z(A,B,Q){var I;if(void 0===Q&&(Q=!1),A&&B)if(B.rotate||B.orientation){if(B.annotationType===D.AnnotationTypeCode.INK)return;if(B.annotationType===D.AnnotationTypeCode.FREETEXT)return;if(!(0,D.isFormFieldWidget)(B))return q(A,B,Q);var g=B.rotate||0,E=B.orientation||0;E&&(g=E);var C=A.closest(".gc-annotation")||A.closest(".gc-widget")||A.closest("section");if(!Q&&C.classList.contains("gc-annotation-has-appearance")&&!C.classList.contains("gc-use-custom-appearance"))return;for(var G=A.classList.contains("gc-rotate-support")?[A]:Array.from(A.querySelectorAll(".gc-rotate-support")),w=0;w<G.length;w++){if(R=(R=((F=G[w]).style.transform||"").toString()).replace(/(\s*rotate\(.+\))/gm,""),R+=" rotate("+-g+"deg)",F.style.transform=R,F.style.transformOrigin="",!F.classList.contains("gc-annotation")&&!C.classList.contains("freeTextAnnotation")){C.__borderCopied||(C.__borderCopied=!0,C.style.border&&(F.style.border=C.style.border),C.style.borderColor&&(F.style.borderColor=C.style.borderColor),"none none solid"===C.style.borderStyle?(F.style.borderBottomStyle="solid",F.style.borderBottomWidth=C.style.borderBottomWidth,F.style.borderBottomColor=C.style.borderBottomColor,C.style.paddingBottom=C.style.borderBottomWidth,C.style.borderBottomWidth="0px"):C.style.borderWidth&&(F.style.borderWidth=C.style.borderWidth,C.style.padding=C.style.borderWidth,C.style.borderWidth="0px"),C.style.borderStyle&&(F.style.borderStyle=C.style.borderStyle)),!E&&g&&g%90==0&&(E=g);var M=(null===(I=B.rotationInit)||void 0===I?void 0:I.initRect)||B.rect;(!M||E&&(C.offsetWidth||C.offsetHeight))&&(M=[C.offsetLeft,C.offsetTop,C.offsetLeft+C.offsetWidth,C.offsetTop+C.offsetHeight]);var i=Math.abs(M[2]-M[0]),o=Math.abs(M[3]-M[1]);E?j(F,E,o,i):B.rotationInit&&(F.style.width="".concat(i,"px"),F.style.height="".concat(o,"px"),F.style.position="absolute",F.style.left="".concat(B.rotationInit.dx||0,"px"),F.style.top="".concat(B.rotationInit.dy||0,"px"))}}}else for(G=A.classList.contains("gc-rotate-support")?[A]:Array.from(A.querySelectorAll(".gc-rotate-support")),w=0;w<G.length;w++){var F,R;(F=G[w]).style.width="100%",F.style.height="100%",F.style.left="0px",F.style.top="0px",R=(R=(F.style.transform||"").toString()).replace(/(\s*rotate\(.+\))/gm,""),F.style.transform=R,F.style.transformOrigin=""}}function P(A,B){A.firstChild?A.insertBefore(B,A.firstChild):A.appendChild(B)}function V(A,B,Q){if(B){var I=Q||x(A),g=Math.abs(I[2]-I[0]),E=Math.abs(I[3]-I[1]),C=(0,M.rotateRectAndFillBoth)(I,[I[0]+g/2,I[1]+E/2],B),D=C.rotatedRect,G=C.transformedRect,w=Math.abs(D[2]-D[0]),i=Math.abs(D[3]-D[1]);A.rotationInit={initRect:I,rotatedRect:D,transformedRect:G,angle:B,dx:(w-g)/2,dy:(i-E)/2},A.rect=D}else A.rotationInit&&(A.rotationInit.initRect&&(A.rect=A.rotationInit.initRect),A.rotationInit=void 0),Q&&(A.rect=Q)}function O(A,B){var Q=(0,M.rotateRect)(A,null,B,!0),I=(0,M.findLinesIntersection)([Q[0],Q[3]],[Q[2],Q[3]],[A[0],A[1]],[A[0],A[3]]),g=(0,M.findLinesIntersection)([Q[0],Q[1]],[Q[2],Q[3]],[A[2],A[1]],[A[2],A[3]]);return I&&g?(0,M.normalizeRect)([I[0],I[1],g[0],g[1]]):C([],A,!0)}function l(A,B,Q,I,C,D){return void 0===I&&(I="file"),void 0===C&&(C=!0),void 0===D&&(D=""),g(this,void 0,void 0,function(){var G=this;return E(this,function(w){return D=D||B["".concat(I,"Id")],[2,new Promise(function(w){A.toBlob(function(M){return g(G,void 0,void 0,function(){var g,G,i,o,R,k;return E(this,function(E){switch(E.label){case 0:return E.trys.push([0,,3,4]),M?[4,M.arrayBuffer()]:[3,2];case 1:g=E.sent(),G=new Uint8Array(g),i=D||F("".concat(I,"_img")),o="".concat(I,".png"),R=G.length,B["".concat(I,"Id")]=i,B["".concat(I,"Name")]=o,B["".concat(I,"Length")]=R,Q.storage.setItem(i,G),k={id:B.id,fileId:i,fileName:o,fileLength:R,filePropName:I},Q.viewer.eventBus.dispatch("annotation-image-loaded",k),E.label=2;case 2:return C&&(A.width=0,A.height=0),[3,4];case 3:return w(),[7];case 4:return[2]}})})},"image/png")})]})})}B.attachHeadJs=function(A,B,Q){return new Promise(function(I,g){if(B){if(s[B])return void I();s[B]=!0}var E=((Q=Q||document).getElementsByTagName?Q.getElementsByTagName("head")[0]:void 0)||Q.body||Q,C=document.createElement("script");B&&C.setAttribute("id",B),C.type="text/javascript",C.src=A,C.async=!0,C.onerror=function(A){g(A)};var D=!1;C.onload=C.onreadystatechange=function(A){var B=A.target;D||B.readyState&&"complete"!=B.readyState||(D=!0,I())},E.insertBefore(C,E.firstChild)})},B.stripHtmlTags=function(A){var B=document.createElement("div");return B.innerHTML=A||"",B.innerText||B.textContent||""},B.cleanseRichText=function(A){return A?A.replace(/<\/?(?:script|iframe|object|embed|form|input|textarea|select|option|button)[^>]*>/gi,"").replace(/<\?xml[^>]*\?>|<body[^>]*>|<\/body>/gi,""):""},B.attachHeadCss=function(A,B,Q){if(B){if(H[B])return;H[B]=!0}var I=((Q=Q||document).getElementsByTagName?Q.getElementsByTagName("head")[0]:void 0)||Q.body||Q,g=document.createElement("link");B&&g.setAttribute("id",B),g.setAttribute("rel","stylesheet"),g.setAttribute("type","text/css"),g.setAttribute("href","data:text/css;charset=UTF-8,"+encodeURIComponent(A)),I.insertBefore(g,I.firstChild)},B.detachHeadJs=function(A,B){A&&(L((B=B||document).head||B,"#"+A),delete s[A])},B.detachHeadCss=function(A,B){A&&(L((B=B||document).head||B,"#"+A),delete H[A])},B.moveInkLists=function(A,B,Q){if(A)for(var I=0,g=A;I<g.length;I++)for(var E=g[I],C=0;C<E.length;C++)E[C].x=E[C].x-B,E[C].y=E[C].y-Q},B.getAccentTextColor=function(){var A=document.querySelector(".gc-menu__btn-container");return A&&window.getComputedStyle&&window.getComputedStyle(A,null).getPropertyValue("background-color")||"#000000"},B.sortedIndex=function(A,B){for(var Q=0,I=A.length;Q<I;){var g=Q+I>>>1;A[g]<B?Q=g+1:I=g}return Q},B.isEditorModeEnabled=function(A){return A&&!!(0,G.findSelfOrAncestor)(A,"gc-editor-mode")},B.logMessage=function(A){window.console&&window.console.log(A);var B=document.querySelector("#log-message");if(B){var Q=new Date;A=(A=A+(" ("+Q.getHours()+":"+Q.getSeconds()+"."+Q.getMilliseconds()+")")+";<br>"+B.innerHTML).substr(0,Math.min(A.length,512)),B.innerHTML=A}},B.logError=function(A){if("object"==typeof(A=A||"[empty message]")){var B="{ ";for(var Q in A)B=B+Q+"="+A[Q]+"; ";A=B+="}"}window.console&&window.console.log(A);var I=document.querySelector("#log-error-message")||document.querySelector("#log-message");if(I){var g=new Date,E=" ("+g.getHours()+":"+g.getSeconds()+"."+g.getMilliseconds()+")";I.innerHTML=A+E}},B.setInputCheckedState=function(A,B,Q,I){var g,E;if(A){var C=A.closest("section"),D=A.hasAttribute("checked"),G=A.checked!==D||B!==A.checked||C&&(B&&!C.classList.contains("checked")||!B&&C.classList.contains("checked")),w=null;B?(A.setAttribute("checked","true"),A.checked=!0,A.hasAttribute("exportValue")&&(w=A.getAttribute("exportValue")),null===(g=A.closest("section"))||void 0===g||g.classList.add("checked")):(A.removeAttribute("checked"),A.checked=!1,null===(E=A.closest("section"))||void 0===E||E.classList.remove("checked")),K(A,B,w),G&&Q&&Q.onInputChanged(A,I)}},B.updateInputCheckedAppearance=K,B.updateAnnotationContentPosition=function(A,B,Q){if(B||Q)switch(A.annotationType){case D.AnnotationTypeCode.LINE:var I=A.lineCoordinates;if(I)for(var g=0;g<I.length;g+=2)B&&(I[g]=I[g]-B),Q&&(I[g+1]=I[g+1]-Q);break;case D.AnnotationTypeCode.INK:var E=A.inkLists;if(E)for(var C=0,G=E;C<G.length;C++)for(var w=0,M=G[C];w<M.length;w++){var i=M[w];B&&(i.x=i.x-B),Q&&(i.y=i.y-Q)}break;case D.AnnotationTypeCode.POLYLINE:case D.AnnotationTypeCode.POLYGON:var o=A.vertices;if(o)for(var F=0,R=o;F<R.length;F++){i=R[F];B&&(i.x=i.x-B),Q&&(i.y=i.y-Q)}}},B.clearAnnotationRotate=Z,B.applyAnnotationRotate2=q,B.applyAnnotationRotate=z,B.insertFirst=P,B.initAnnotationRotateSupport=function(A,B,Q){var I=A.querySelector(".gc-rotate-support")||document.createElement("div");I.classList.add("gc-rotate-support"),Q&&("string"==typeof Q?I.innerHTML=Q:I.appendChild(Q)),P(A,I),B.rotate||B.orientation?z(I,B):Z(I)},B.calcRotationRectangles=V,B.findRotationInit=O,B.updateRotationInit=function(A){A.rotationInit&&A.rotate&&(A.rotationInit.initRect=O(A.rect,A.rotate))},B.isAnnotationAllowsSelectTextBehind=function(A){return!A||!!(A.className||"").match(new RegExp("(".concat(["underlineAnnotation","squigglyAnnotation","strikeOutAnn