diff --git a/index.html b/index.html index 423c2d4..9a6931b 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Logy.AI
\ No newline at end of file +Logy.AI
\ No newline at end of file diff --git a/logy/.DS_Store b/logy/.DS_Store index 1f49fbf..4c65a6f 100644 Binary files a/logy/.DS_Store and b/logy/.DS_Store differ diff --git a/logy/asset-manifest.json b/logy/asset-manifest.json index c5c69b3..516a7fd 100644 --- a/logy/asset-manifest.json +++ b/logy/asset-manifest.json @@ -1,7 +1,7 @@ { "files": { "main.css": "/logy/static/css/main.6692b25e.css", - "main.js": "/logy/static/js/main.cb2cea4d.js", + "main.js": "/logy/static/js/main.4dbf88d7.js", "static/media/logyanim.gif": "/logy/static/media/logyanim.723301ae925492376c3a.gif", "static/media/Nivedita Tiwari.png": "/logy/static/media/Nivedita Tiwari.e19aea7d2a9a124d1bd8.png", "static/media/Vinay Khobragade.png": "/logy/static/media/Vinay Khobragade.1146a1a13a76af787b36.png", @@ -35,6 +35,7 @@ "static/media/colgate_t.png": "/logy/static/media/colgate_t.3840b993ce6c908b2516.png", "static/media/dainikbhaskar.png": "/logy/static/media/dainikbhaskar.99b7a735cdd477e258df.png", "static/media/Apollo-Clinic.png": "/logy/static/media/Apollo-Clinic.5b1d27b87e41a6aa67e2.png", + "static/media/articleImage3.jpeg": "/logy/static/media/articleImage3.7847372792986ca22dc2.jpeg", "static/media/Dr. Agarwals.png": "/logy/static/media/Dr. Agarwals.1a82a55cf9845f1de242.png", "static/media/aboutusnumbers.svg": "/logy/static/media/aboutusnumbers.bbadaf516877b808543b4bd4eb9b71de.svg", "static/media/sharpsight_t.png": "/logy/static/media/sharpsight_t.b0554afd29ebed450a98.png", @@ -62,10 +63,10 @@ "static/media/fb.svg": "/logy/static/media/fb.946ec2d8104097c73520da7b5b65eda2.svg", "static/media/scans.svg": "/logy/static/media/scans.829779fea8b5e7ad110bd851e844a523.svg", "main.6692b25e.css.map": "/logy/static/css/main.6692b25e.css.map", - "main.cb2cea4d.js.map": "/logy/static/js/main.cb2cea4d.js.map" + "main.4dbf88d7.js.map": "/logy/static/js/main.4dbf88d7.js.map" }, "entrypoints": [ "static/css/main.6692b25e.css", - "static/js/main.cb2cea4d.js" + "static/js/main.4dbf88d7.js" ] } \ No newline at end of file diff --git a/logy/index.html b/logy/index.html index 423c2d4..9a6931b 100644 --- a/logy/index.html +++ b/logy/index.html @@ -1 +1 @@ -Logy.AI
\ No newline at end of file +Logy.AI
\ No newline at end of file diff --git a/logy/static/.DS_Store b/logy/static/.DS_Store index 9479887..e68e830 100644 Binary files a/logy/static/.DS_Store and b/logy/static/.DS_Store differ diff --git a/logy/static/js/main.cb2cea4d.js b/logy/static/js/main.4dbf88d7.js similarity index 75% rename from logy/static/js/main.cb2cea4d.js rename to logy/static/js/main.4dbf88d7.js index 7b1e202..fd97ce1 100644 --- a/logy/static/js/main.cb2cea4d.js +++ b/logy/static/js/main.4dbf88d7.js @@ -1,3 +1,3 @@ -/*! For license information please see main.cb2cea4d.js.LICENSE.txt */ -(()=>{var __webpack_modules__={2740:e=>{"use strict";e.exports=function(e,t,n,r,a,i,s,l){if(!e){var o;if(void 0===t)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,a,i,s,l],d=0;(o=new Error(t.replace(/%s/g,(function(){return c[d++]})))).name="Invariant Violation"}throw o.framesToPop=1,o}}},5766:function(e,t){var n,r,a;r=[],n=function e(){"use strict";var t="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:{},n=!t.document&&!!t.postMessage,r=t.IS_PAPA_WORKER||!1,a={},i=0,s={parse:function(n,r){var l=(r=r||{}).dynamicTyping||!1;if(w(l)&&(r.dynamicTypingFunction=l,l={}),r.dynamicTyping=l,r.transform=!!w(r.transform)&&r.transform,r.worker&&s.WORKERS_SUPPORTED){var o=function(){if(!s.WORKERS_SUPPORTED)return!1;var n,r,l=(n=t.URL||t.webkitURL||null,r=e.toString(),s.BLOB_URL||(s.BLOB_URL=n.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",r,")();"],{type:"text/javascript"})))),o=new t.Worker(l);return o.onmessage=g,o.id=i++,a[o.id]=o}();return o.userStep=r.step,o.userChunk=r.chunk,o.userComplete=r.complete,o.userError=r.error,r.step=w(r.step),r.chunk=w(r.chunk),r.complete=w(r.complete),r.error=w(r.error),delete r.worker,void o.postMessage({input:n,config:r,workerId:o.id})}var f=null;return s.NODE_STREAM_INPUT,"string"==typeof n?(n=function(e){return 65279===e.charCodeAt(0)?e.slice(1):e}(n),f=r.download?new c(r):new u(r)):!0===n.readable&&w(n.read)&&w(n.on)?f=new h(r):(t.File&&n instanceof File||n instanceof Object)&&(f=new d(r)),f.stream(n)},unparse:function(e,t){var n=!1,r=!0,a=",",i="\r\n",l='"',o=l+l,c=!1,d=null,u=!1;!function(){if("object"==typeof t){if("string"!=typeof t.delimiter||s.BAD_DELIMITERS.filter((function(e){return-1!==t.delimiter.indexOf(e)})).length||(a=t.delimiter),("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(n=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(c=t.skipEmptyLines),"string"==typeof t.newline&&(i=t.newline),"string"==typeof t.quoteChar&&(l=t.quoteChar),"boolean"==typeof t.header&&(r=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw new Error("Option columns is empty");d=t.columns}void 0!==t.escapeChar&&(o=t.escapeChar+l),("boolean"==typeof t.escapeFormulae||t.escapeFormulae instanceof RegExp)&&(u=t.escapeFormulae instanceof RegExp?t.escapeFormulae:/^[=+\-@\t\r].*$/)}}();var h=new RegExp(p(l),"g");if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return f(null,e,c);if("object"==typeof e[0])return f(d||Object.keys(e[0]),e,c)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||d),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),f(e.fields||[],e.data||[],c);throw new Error("Unable to serialize unrecognized input");function f(e,t,n){var s="";"string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t));var l=Array.isArray(e)&&0=this._config.preview;if(r)t.postMessage({results:l,workerId:s.WORKER_ID,finished:c});else if(w(this._config.chunk)&&!n){if(this._config.chunk(l,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);l=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(l.data),this._completeResults.errors=this._completeResults.errors.concat(l.errors),this._completeResults.meta=l.meta),this._completed||!c||!w(this._config.complete)||l&&l.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),c||l&&l.meta.paused||this._nextChunk(),l}this._halted=!0},this._sendError=function(e){w(this._config.error)?this._config.error(e):r&&this._config.error&&t.postMessage({workerId:s.WORKER_ID,error:e,finished:!1})}}function c(e){var t;(e=e||{}).chunkSize||(e.chunkSize=s.RemoteChunkSize),o.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),n||(t.onload=y(this._chunkLoaded,this),t.onerror=y(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var e=this._config.downloadRequestHeaders;for(var r in e)t.setRequestHeader(r,e[r])}if(this._config.chunkSize){var a=this._start+this._config.chunkSize-1;t.setRequestHeader("Range","bytes="+this._start+"-"+a)}try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}n&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:t.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(e){var t=e.getResponseHeader("Content-Range");return null===t?-1:parseInt(t.substring(t.lastIndexOf("/")+1))}(t),this.parseChunk(t.responseText)))},this._chunkError=function(e){var n=t.statusText||e;this._sendError(new Error(n))}}function d(e){var t,n;(e=e||{}).chunkSize||(e.chunkSize=s.LocalChunkSize),o.call(this,e);var r="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,r?((t=new FileReader).onload=y(this._chunkLoaded,this),t.onerror=y(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function u(e){var t;o.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e,n=this._config.chunkSize;return n?(e=t.substring(0,n),t=t.substring(n)):(e=t,t=""),this._finished=!t,this.parseChunk(e)}}}function h(e){o.call(this,e=e||{});var t=[],n=!0,r=!1;this.pause=function(){o.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){o.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){r&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=y((function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}}),this),this._streamError=y((function(e){this._streamCleanUp(),this._sendError(e)}),this),this._streamEnd=y((function(){this._streamCleanUp(),r=!0,this._streamData("")}),this),this._streamCleanUp=y((function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)}),this)}function f(e){var t,n,r,a=Math.pow(2,53),i=-a,l=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,o=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,c=this,d=0,u=0,h=!1,f=!1,g=[],v={data:[],errors:[],meta:{}};if(w(e.step)){var x=e.step;e.step=function(t){if(v=t,S())_();else{if(_(),0===v.data.length)return;d+=t.data.length,e.preview&&d>e.preview?n.abort():(v.data=v.data[0],x(v,c))}}}function y(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function _(){return v&&r&&(C("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+s.DefaultDelimiter+"'"),r=!1),e.skipEmptyLines&&(v.data=v.data.filter((function(e){return!y(e)}))),S()&&function(){if(v)if(Array.isArray(v.data[0])){for(var t=0;S()&&t=g.length?"__parsed_extra":g[r]),e.transform&&(s=e.transform(s,i)),s=P(i,s),"__parsed_extra"===i?(a[i]=a[i]||[],a[i].push(s)):a[i]=s}return e.header&&(r>g.length?C("FieldMismatch","TooManyFields","Too many fields: expected "+g.length+" fields but parsed "+r,u+n):r=r.length/2?"\r\n":"\r"}(a,o)),r=!1,e.delimiter)w(e.delimiter)&&(e.delimiter=e.delimiter(a),v.meta.delimiter=e.delimiter);else{var c=function(t,n,r,a,i){var l,o,c,d;i=i||[",","\t","|",";",s.RECORD_SEP,s.UNIT_SEP];for(var u=0;u=l)return V(!0)}else for(G=d,d++;;){if(-1===(G=s.indexOf(t,G+1)))return f||_.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:y.length,index:d}),H();if(G===m-1)return H(s.substring(d,G).replace(D,t));if(t!==c||s[G+1]!==c){if(t===c||0===G||s[G-1]!==c){-1!==L&&L=l)return V(!0);break}_.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:y.length,index:d}),G++}}else G++}return H();function W(e){y.push(e),P=d}function U(e){var t=0;if(-1!==e){var n=s.substring(G+1,e);n&&""===n.trim()&&(t=n.length)}return t}function H(e){return f||(void 0===e&&(e=s.substring(d)),S.push(e),d=m,W(S),b&&X()),V()}function q(e){d=e,W(S),S=[],O=s.indexOf(r,d)}function V(e){return{data:y,errors:_,meta:{delimiter:n,linebreak:r,aborted:u,truncated:!!e,cursor:P+(h||0)}}}function X(){i(V()),y=[],_=[]}},this.abort=function(){u=!0},this.getCharIndex=function(){return d}}function g(e){var t=e.data,n=a[t.workerId],r=!1;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var i={abort:function(){r=!0,v(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:x,resume:x};if(w(n.userStep)){for(var s=0;s{var _classPrivateGetter=__webpack_require__(183).default,_defineProperty=__webpack_require__(3693).default,_classPrivateMethodInitSpec=__webpack_require__(3312).default,_assertClassBrand=__webpack_require__(1756).default,_classPrivateFieldInitSpec=__webpack_require__(2459).default,_classPrivateFieldGet=__webpack_require__(6668).default,_classPrivateFieldSet=__webpack_require__(7088).default,root,factory;root=globalThis,factory=()=>(()=>{"use strict";var __webpack_modules__=[,(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VerbosityLevel=t.Util=t.UnknownErrorException=t.UnexpectedResponseException=t.TextRenderingMode=t.RenderingIntentFlag=t.PromiseCapability=t.PermissionFlag=t.PasswordResponses=t.PasswordException=t.PageActionEventType=t.OPS=t.MissingPDFException=t.MAX_IMAGE_SIZE_TO_CACHE=t.LINE_FACTOR=t.LINE_DESCENT_FACTOR=t.InvalidPDFException=t.ImageKind=t.IDENTITY_MATRIX=t.FormatError=t.FeatureTest=t.FONT_IDENTITY_MATRIX=t.DocumentActionEventType=t.CMapCompressionType=t.BaseException=t.BASELINE_FACTOR=t.AnnotationType=t.AnnotationReplyType=t.AnnotationPrefix=t.AnnotationMode=t.AnnotationFlag=t.AnnotationFieldFlag=t.AnnotationEditorType=t.AnnotationEditorPrefix=t.AnnotationEditorParamsType=t.AnnotationBorderStyleType=t.AnnotationActionEventType=t.AbortException=void 0,t.assert=function(e,t){e||l(t)},t.bytesToString=d,t.createValidAbsoluteUrl=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e)return null;try{if(n&&"string"===typeof e){if(n.addDefaultProtocol&&e.startsWith("www.")){const t=e.match(/\./g);(null===t||void 0===t?void 0:t.length)>=2&&(e="http://".concat(e))}if(n.tryConvertEncoding)try{e=p(e)}catch{}}const r=t?new URL(e,t):new URL(e);if(function(e){switch(null===e||void 0===e?void 0:e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(r))return r}catch{}return null},t.getModificationDate=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0"),e.getUTCHours().toString().padStart(2,"0"),e.getUTCMinutes().toString().padStart(2,"0"),e.getUTCSeconds().toString().padStart(2,"0")].join("")},t.getUuid=function(){var e,t;if("undefined"!==typeof crypto&&"function"===typeof(null===(e=crypto)||void 0===e?void 0:e.randomUUID))return crypto.randomUUID();const n=new Uint8Array(32);if("undefined"!==typeof crypto&&"function"===typeof(null===(t=crypto)||void 0===t?void 0:t.getRandomValues))crypto.getRandomValues(n);else for(let r=0;r<32;r++)n[r]=Math.floor(255*Math.random());return d(n)},t.getVerbosityLevel=function(){return i},t.info=function(e){i>=a.INFOS&&console.log("Info: ".concat(e))},t.isArrayBuffer=function(e){return"object"===typeof e&&void 0!==(null===e||void 0===e?void 0:e.byteLength)},t.isArrayEqual=function(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;nt?t.normalize("NFKC"):v.get(n)))},t.objectFromMap=function(e){const t=Object.create(null);for(const[n,r]of e)t[n]=r;return t},t.objectSize=function(e){return Object.keys(e).length},t.setVerbosityLevel=function(e){Number.isInteger(e)&&(i=e)},t.shadow=o,t.string32=function(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=u,t.stringToPDFString=function(e){if(e[0]>="\xef"){let t;if("\xfe"===e[0]&&"\xff"===e[1]?t="utf-16be":"\xff"===e[0]&&"\xfe"===e[1]?t="utf-16le":"\xef"===e[0]&&"\xbb"===e[1]&&"\xbf"===e[2]&&(t="utf-8"),t)try{const n=new TextDecoder(t,{fatal:!0}),r=u(e);return n.decode(r)}catch(n){s('stringToPDFString: "'.concat(n,'".'))}}const t=[];for(let r=0,a=e.length;r=a.WARNINGS&&console.log("Warning: ".concat(e))}function l(e){throw new Error(e)}function o(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Object.defineProperty(e,t,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}const c=function(){function e(t,n){this.constructor===e&&l("Cannot initialize BaseException."),this.message=t,this.name=n}return e.prototype=new Error,e.constructor=e,e}();function d(e){"object"===typeof e&&void 0!==(null===e||void 0===e?void 0:e.length)||l("Invalid argument for bytesToString");const t=e.length,n=8192;if(te.toString(16).padStart(2,"0")));t.Util=class{static makeHexColor(e,t,n){return"#".concat(h[e]).concat(h[t]).concat(h[n])}static scaleMinMax(e,t){let n;e[0]?(e[0]<0&&(n=t[0],t[0]=t[1],t[1]=n),t[0]*=e[0],t[1]*=e[0],e[3]<0&&(n=t[2],t[2]=t[3],t[3]=n),t[2]*=e[3],t[3]*=e[3]):(n=t[0],t[0]=t[2],t[2]=n,n=t[1],t[1]=t[3],t[3]=n,e[1]<0&&(n=t[2],t[2]=t[3],t[3]=n),t[2]*=e[1],t[3]*=e[1],e[2]<0&&(n=t[0],t[0]=t[1],t[1]=n),t[0]*=e[2],t[1]*=e[2]),t[0]+=e[4],t[1]+=e[4],t[2]+=e[5],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){const n=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/n,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/n]}static getAxialAlignedBoundingBox(e,t){const n=this.applyTransform(e,t),r=this.applyTransform(e.slice(2,4),t),a=this.applyTransform([e[0],e[3]],t),i=this.applyTransform([e[2],e[1]],t);return[Math.min(n[0],r[0],a[0],i[0]),Math.min(n[1],r[1],a[1],i[1]),Math.max(n[0],r[0],a[0],i[0]),Math.max(n[1],r[1],a[1],i[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],n=e[0]*t[0]+e[1]*t[2],r=e[0]*t[1]+e[1]*t[3],a=e[2]*t[0]+e[3]*t[2],i=e[2]*t[1]+e[3]*t[3],s=(n+i)/2,l=Math.sqrt((n+i)**2-4*(n*i-a*r))/2,o=s+l||1,c=s-l||1;return[Math.sqrt(o),Math.sqrt(c)]}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>r)return null;const a=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),i=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return a>i?null:[n,a,r,i]}static bezierBoundingBox(e,t,n,r,a,i,s,l){const o=[],c=[[],[]];let d,u,h,f,p,m,g,v;for(let w=0;w<2;++w)if(0===w?(u=6*e-12*n+6*a,d=-3*e+9*n-9*a+3*s,h=3*n-3*e):(u=6*t-12*r+6*i,d=-3*t+9*r-9*i+3*l,h=3*r-3*t),Math.abs(d)<1e-12){if(Math.abs(u)<1e-12)continue;f=-h/u,0{this.resolve=t=>{_classPrivateFieldSet(m,this,!0),e(t)},this.reject=e=>{_classPrivateFieldSet(m,this,!0),t(e)}}))}get settled(){return _classPrivateFieldGet(m,this)}};let g=null,v=null;t.AnnotationPrefix="pdfjs_internal_id_"},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;function getDocument(e){var t,n;if("string"===typeof e||e instanceof URL?e={url:e}:(0,_util.isArrayBuffer)(e)&&(e={data:e}),"object"!==typeof e)throw new Error("Invalid parameter in getDocument, need parameter object.");if(!e.url&&!e.data&&!e.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const r=new PDFDocumentLoadingTask,{docId:a}=r,i=e.url?getUrlProp(e.url):null,s=e.data?getDataProp(e.data):null,l=e.httpHeaders||null,o=!0===e.withCredentials,c=null!==(t=e.password)&&void 0!==t?t:null,d=e.range instanceof PDFDataRangeTransport?e.range:null,u=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let h=e.worker instanceof PDFWorker?e.worker:null;const f=e.verbosity,p="string"!==typeof e.docBaseUrl||(0,_display_utils.isDataScheme)(e.docBaseUrl)?null:e.docBaseUrl,m="string"===typeof e.cMapUrl?e.cMapUrl:null,g=!1!==e.cMapPacked,v=e.CMapReaderFactory||DefaultCMapReaderFactory,x="string"===typeof e.standardFontDataUrl?e.standardFontDataUrl:null,b=e.StandardFontDataFactory||DefaultStandardFontDataFactory,y=!0!==e.stopAtErrors,w=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,_=!1!==e.isEvalSupported,S="boolean"===typeof e.isOffscreenCanvasSupported?e.isOffscreenCanvasSupported:!_util.isNodeJS,P=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,C="boolean"===typeof e.disableFontFace?e.disableFontFace:_util.isNodeJS,A=!0===e.fontExtraProperties,k=!0===e.enableXfa,j=e.ownerDocument||globalThis.document,E=!0===e.disableRange,N=!0===e.disableStream,F=!0===e.disableAutoFetch,T=!0===e.pdfBug,M=d?d.length:null!==(n=e.length)&&void 0!==n?n:NaN,R="boolean"===typeof e.useSystemFonts?e.useSystemFonts:!_util.isNodeJS&&!C,I="boolean"===typeof e.useWorkerFetch?e.useWorkerFetch:v===_display_utils.DOMCMapReaderFactory&&b===_display_utils.DOMStandardFontDataFactory&&m&&x&&(0,_display_utils.isValidFetchUrl)(m,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(x,document.baseURI),L=e.canvasFactory||new DefaultCanvasFactory({ownerDocument:j}),O=e.filterFactory||new DefaultFilterFactory({docId:a,ownerDocument:j});(0,_util.setVerbosityLevel)(f);const D={canvasFactory:L,filterFactory:O};if(I||(D.cMapReaderFactory=new v({baseUrl:m,isCompressed:g}),D.standardFontDataFactory=new b({baseUrl:x})),!h){const e={verbosity:f,port:_worker_options.GlobalWorkerOptions.workerPort};h=e.port?PDFWorker.fromPort(e):new PDFWorker(e),r._worker=h}const G={docId:a,apiVersion:"3.11.174",data:s,password:c,disableAutoFetch:F,rangeChunkSize:u,length:M,docBaseUrl:p,enableXfa:k,evaluatorOptions:{maxImageSize:w,disableFontFace:C,ignoreErrors:y,isEvalSupported:_,isOffscreenCanvasSupported:S,canvasMaxAreaInBytes:P,fontExtraProperties:A,useSystemFonts:R,cMapUrl:I?m:null,standardFontDataUrl:I?x:null}},B={ignoreErrors:y,isEvalSupported:_,disableFontFace:C,fontExtraProperties:A,enableXfa:k,ownerDocument:j,disableAutoFetch:F,pdfBug:T,styleElement:null};return h.promise.then((function(){if(r.destroyed)throw new Error("Loading aborted");const e=_fetchDocument(h,G),t=new Promise((function(e){let t;var n;d?t=new _transport_stream.PDFDataTransportStream({length:M,initialData:d.initialData,progressiveDone:d.progressiveDone,contentDispositionFilename:d.contentDispositionFilename,disableRange:E,disableStream:N},d):s||(n={url:i,length:M,httpHeaders:l,withCredentials:o,rangeChunkSize:u,disableRange:E,disableStream:N},t=_util.isNodeJS?new _displayNode_stream.PDFNodeStream(n):(0,_display_utils.isValidFetchUrl)(n.url)?new _displayFetch_stream.PDFFetchStream(n):new _displayNetwork.PDFNetworkStream(n)),e(t)}));return Promise.all([e,t]).then((function(e){let[t,n]=e;if(r.destroyed)throw new Error("Loading aborted");const i=new _message_handler.MessageHandler(a,t,h.port),s=new WorkerTransport(i,r,n,B,D);r._transport=s,i.send("Ready",null)}))})).catch(r._capability.reject),r}async function _fetchDocument(e,t){if(e.destroyed)throw new Error("Worker was destroyed");const n=await e.messageHandler.sendWithPromise("GetDocRequest",t,t.data?[t.data.buffer]:null);if(e.destroyed)throw new Error("Worker was destroyed");return n}function getUrlProp(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch{if(_util.isNodeJS&&"string"===typeof e)return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(e){if(_util.isNodeJS&&"undefined"!==typeof Buffer&&e instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if("string"===typeof e)return(0,_util.stringToBytes)(e);if("object"===typeof e&&!isNaN(null===e||void 0===e?void 0:e.length)||(0,_util.isArrayBuffer)(e))return new Uint8Array(e);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;class PDFDocumentLoadingTask{constructor(){var e,t;this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId="d".concat((_docId._=(e=_docId._,t=e++,e),t)),this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{var e,t;null!==(e=this._worker)&&void 0!==e&&e.port&&(this._worker._pendingDestroy=!0),await(null===(t=this._transport)||void 0===t?void 0:t.destroy())}catch(r){var n;throw null!==(n=this._worker)&&void 0!==n&&n.port&&delete this._worker._pendingDestroy,r}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}var _docId={_:0};exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=r,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,t){for(const n of this._rangeListeners)n(e,t)}onDataProgress(e,t){this._readyCapability.promise.then((()=>{for(const n of this._progressListeners)n(e,t)}))}onDataProgressiveRead(e){this._readyCapability.promise.then((()=>{for(const t of this._progressiveReadListeners)t(e)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const e of this._progressiveDoneListeners)e()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(e,t){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(e,t){this._pdfInfo=e,this._transport=t,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then((e=>{if(!e)return e;const t=[];for(const n in e)t.push(...e[n]);return t})))})}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;var _delayedCleanupTimeout=new WeakMap,_pendingCleanup=new WeakMap,_PDFPageProxy_brand=new WeakSet;class PDFPageProxy{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];_classPrivateMethodInitSpec(this,_PDFPageProxy_brand),_classPrivateFieldInitSpec(this,_delayedCleanupTimeout,null),_classPrivateFieldInitSpec(this,_pendingCleanup,!1),this._pageIndex=e,this._pageInfo=t,this._transport=n,this._stats=r?new _display_utils.StatTimer:null,this._pdfBug=r,this.commonObjs=n.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){let{scale:e,rotation:t=this.rotate,offsetX:n=0,offsetY:r=0,dontFlip:a=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:e,rotation:t,offsetX:n,offsetY:r,dontFlip:a})}getAnnotations(){let{intent:e="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var e;return(null===(e=this._transport._htmlForXfa)||void 0===e?void 0:e.children[this._pageIndex])||null}render(e){var t,n;let{canvasContext:r,viewport:a,intent:i="display",annotationMode:s=_util.AnnotationMode.ENABLE,transform:l=null,background:o=null,optionalContentConfigPromise:c=null,annotationCanvasMap:d=null,pageColors:u=null,printAnnotationStorage:h=null}=e;null===(t=this._stats)||void 0===t||t.time("Overall");const f=this._transport.getRenderingIntent(i,s,h);_classPrivateFieldSet(_pendingCleanup,this,!1),_assertClassBrand(_PDFPageProxy_brand,this,_abortDelayedCleanup).call(this),c||(c=this._transport.getOptionalContentConfig());let p=this._intentStates.get(f.cacheKey);p||(p=Object.create(null),this._intentStates.set(f.cacheKey,p)),p.streamReaderCancelTimeout&&(clearTimeout(p.streamReaderCancelTimeout),p.streamReaderCancelTimeout=null);const m=!!(f.renderingIntent&_util.RenderingIntentFlag.PRINT);var g;p.displayReadyCapability||(p.displayReadyCapability=new _util.PromiseCapability,p.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(g=this._stats)||void 0===g||g.time("Page Request"),this._pumpOperatorList(f));const v=e=>{var t,n;p.renderTasks.delete(x),(this._maybeCleanupAfterRender||m)&&_classPrivateFieldSet(_pendingCleanup,this,!0),_assertClassBrand(_PDFPageProxy_brand,this,_tryCleanup).call(this,!m),e?(x.capability.reject(e),this._abortOperatorList({intentState:p,reason:e instanceof Error?e:new Error(e)})):x.capability.resolve(),null===(t=this._stats)||void 0===t||t.timeEnd("Rendering"),null===(n=this._stats)||void 0===n||n.timeEnd("Overall")},x=new InternalRenderTask({callback:v,params:{canvasContext:r,viewport:a,transform:l,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:d,operatorList:p.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!m,pdfBug:this._pdfBug,pageColors:u});((n=p).renderTasks||(n.renderTasks=new Set)).add(x);const b=x.task;return Promise.all([p.displayReadyCapability.promise,c]).then((e=>{var t;let[n,r]=e;this.destroyed?v():(null===(t=this._stats)||void 0===t||t.time("Rendering"),x.initializeGraphics({transparency:n,optionalContentConfig:r}),x.operatorListChanged())})).catch(v),b}getOperatorList(){let{intent:e="display",annotationMode:t=_util.AnnotationMode.ENABLE,printAnnotationStorage:n=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=this._transport.getRenderingIntent(e,t,n,!0);let a,i=this._intentStates.get(r.cacheKey);var s,l;return i||(i=Object.create(null),this._intentStates.set(r.cacheKey,i)),i.opListReadCapability||(a=Object.create(null),a.operatorListChanged=function(){i.operatorList.lastChunk&&(i.opListReadCapability.resolve(i.operatorList),i.renderTasks.delete(a))},i.opListReadCapability=new _util.PromiseCapability,((s=i).renderTasks||(s.renderTasks=new Set)).add(a),i.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(l=this._stats)||void 0===l||l.time("Page Request"),this._pumpOperatorList(r)),i.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:e=!1,disableNormalization:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===e,disableNormalization:!0===t},{highWaterMark:100,size:e=>e.items.length})}getTextContent(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then((e=>_xfa_text.XfaText.textContent(e)));const t=this.streamTextContent(e);return new Promise((function(e,n){const r=t.getReader(),a={items:[],styles:Object.create(null)};!function t(){r.read().then((function(n){let{value:r,done:i}=n;i?e(a):(Object.assign(a.styles,r.styles),a.items.push(...r.items),t())}),n)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(const n of t.renderTasks)e.push(n.completed),n.cancel();return this.objs.clear(),_classPrivateFieldSet(_pendingCleanup,this,!1),_assertClassBrand(_PDFPageProxy_brand,this,_abortDelayedCleanup).call(this),Promise.all(e)}cleanup(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];_classPrivateFieldSet(_pendingCleanup,this,!0);const t=_assertClassBrand(_PDFPageProxy_brand,this,_tryCleanup).call(this,!1);return e&&t&&this._stats&&(this._stats=new _display_utils.StatTimer),t}_startRenderPage(e,t){var n,r;const a=this._intentStates.get(t);a&&(null===(n=this._stats)||void 0===n||n.timeEnd("Page Request"),null===(r=a.displayReadyCapability)||void 0===r||r.resolve(e))}_renderPageChunk(e,t){for(let n=0,r=e.length;n{s.read().then((e=>{let{value:t,done:n}=e;n?l.streamReader=null:this._transport.destroyed||(this._renderPageChunk(t,l),o())}),(e=>{if(l.streamReader=null,!this._transport.destroyed){if(l.operatorList){l.operatorList.lastChunk=!0;for(const e of l.renderTasks)e.operatorListChanged();_assertClassBrand(_PDFPageProxy_brand,this,_tryCleanup).call(this,!0)}if(l.displayReadyCapability)l.displayReadyCapability.reject(e);else{if(!l.opListReadCapability)throw e;l.opListReadCapability.reject(e)}}}))};o()}_abortOperatorList(e){let{intentState:t,reason:n,force:r=!1}=e;if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!r){if(t.renderTasks.size>0)return;if(n instanceof _display_utils.RenderingCancelledException){let e=RENDERING_CANCELLED_TIMEOUT;return n.extraDelay>0&&n.extraDelay<1e3&&(e+=n.extraDelay),void(t.streamReaderCancelTimeout=setTimeout((()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:n,force:!0})}),e))}}if(t.streamReader.cancel(new _util.AbortException(n.message)).catch((()=>{})),t.streamReader=null,!this._transport.destroyed){for(const[e,n]of this._intentStates)if(n===t){this._intentStates.delete(e);break}this.cleanup()}}}get stats(){return this._stats}}function _tryCleanup(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(_assertClassBrand(_PDFPageProxy_brand,this,_abortDelayedCleanup).call(this),!_classPrivateFieldGet(_pendingCleanup,this)||this.destroyed)return!1;if(e)return _classPrivateFieldSet(_delayedCleanupTimeout,this,setTimeout((()=>{_classPrivateFieldSet(_delayedCleanupTimeout,this,null),_assertClassBrand(_PDFPageProxy_brand,this,_tryCleanup).call(this,!1)}),DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:t,operatorList:n}of this._intentStates.values())if(t.size>0||!n.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),_classPrivateFieldSet(_pendingCleanup,this,!1),!0}function _abortDelayedCleanup(){_classPrivateFieldGet(_delayedCleanupTimeout,this)&&(clearTimeout(_classPrivateFieldGet(_delayedCleanupTimeout,this)),_classPrivateFieldSet(_delayedCleanupTimeout,this,null))}exports.PDFPageProxy=PDFPageProxy;var _listeners=new WeakMap,_deferred=new WeakMap;class LoopbackPort{constructor(){_classPrivateFieldInitSpec(this,_listeners,new Set),_classPrivateFieldInitSpec(this,_deferred,Promise.resolve())}postMessage(e,t){const n={data:structuredClone(e,t?{transfer:t}:null)};_classPrivateFieldGet(_deferred,this).then((()=>{for(const e of _classPrivateFieldGet(_listeners,this))e.call(this,n)}))}addEventListener(e,t){_classPrivateFieldGet(_listeners,this).add(t)}removeEventListener(e,t){_classPrivateFieldGet(_listeners,this).delete(t)}terminate(){_classPrivateFieldGet(_listeners,this).clear()}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_util.isNodeJS)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"===typeof document){var _document;const e=null===(_document=document)||void 0===_document||null===(_document=_document.currentScript)||void 0===_document?void 0:_document.src;e&&(PDFWorkerUtil.fallbackWorkerSrc=e.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(e,t){let n;try{if(n=new URL(e),!n.origin||"null"===n.origin)return!1}catch{return!1}const r=new URL(t,n);return n.origin===r.origin},PDFWorkerUtil.createCDNWrapper=function(e){const t='importScripts("'.concat(e,'");');return URL.createObjectURL(new Blob([t]))};class PDFWorker{constructor(){let{name:e=null,port:t=null,verbosity:n=(0,_util.getVerbosityLevel)()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.name=e,this.destroyed=!1,this.verbosity=n,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,t){var r;if(null!==(r=_workerPorts._)&&void 0!==r&&r.has(t))throw new Error("Cannot use more than one PDFWorker per port.");return(_workerPorts._||(_workerPorts._=new WeakMap)).set(t,this),void this._initializeFromPort(t)}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new _message_handler.MessageHandler("main","worker",e),this._messageHandler.on("ready",(function(){})),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:e}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,e)||(e=PDFWorkerUtil.createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e),n=new _message_handler.MessageHandler("main","worker",t),r=()=>{t.removeEventListener("error",a),n.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},a=()=>{this._webWorker||r()};t.addEventListener("error",a),n.on("test",(e=>{t.removeEventListener("error",a),this.destroyed?r():e?(this._messageHandler=n,this._port=t,this._webWorker=t,this._readyCapability.resolve(),n.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),n.destroy(),t.terminate())})),n.on("ready",(e=>{if(t.removeEventListener("error",a),this.destroyed)r();else try{i()}catch{this._setupFakeWorker()}}));const i=()=>{const e=new Uint8Array;n.send("test",e,[e.buffer])};return void i()}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),PDFWorker._setupFakeWorkerGlobal.then((e=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const t=new LoopbackPort;this._port=t;const n="fake".concat(PDFWorkerUtil.fakeWorkerId++),r=new _message_handler.MessageHandler(n+"_worker",n,t);e.setup(r,t);const a=new _message_handler.MessageHandler(n,n+"_worker",t);this._messageHandler=a,this._readyCapability.resolve(),a.send("configure",{verbosity:this.verbosity})})).catch((e=>{this._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(e.message,'".')))}))}destroy(){var e;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),null===(e=_workerPorts._)||void 0===e||e.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){var t;if(null===e||void 0===e||!e.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const n=null===(t=_assertClassBrand(PDFWorker,this,_workerPorts)._)||void 0===t?void 0:t.get(e.port);if(n){if(n._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return n}return new PDFWorker(e)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{var e;return(null===(e=globalThis.pdfjsWorker)||void 0===e?void 0:e.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}var _workerPorts={_:void 0};exports.PDFWorker=PDFWorker;var _methodPromises=new WeakMap,_pageCache=new WeakMap,_pagePromises=new WeakMap,_passwordCapability=new WeakMap,_WorkerTransport_brand=new WeakSet;class WorkerTransport{constructor(e,t,n,r,a){_classPrivateMethodInitSpec(this,_WorkerTransport_brand),_classPrivateFieldInitSpec(this,_methodPromises,new Map),_classPrivateFieldInitSpec(this,_pageCache,new Map),_classPrivateFieldInitSpec(this,_pagePromises,new Map),_classPrivateFieldInitSpec(this,_passwordCapability,null),this.messageHandler=e,this.loadingTask=t,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this._params=r,this.canvasFactory=a.canvasFactory,this.filterFactory=a.filterFactory,this.cMapReaderFactory=a.cMapReaderFactory,this.standardFontDataFactory=a.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=_util.RenderingIntentFlag.DISPLAY,i=_annotation_storage.SerializableEmpty;switch(e){case"any":a=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":a=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)("getRenderingIntent - invalid intent: ".concat(e))}switch(t){case _util.AnnotationMode.DISABLE:a+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:a+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:a+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,i=(a&_util.RenderingIntentFlag.PRINT&&n instanceof _annotation_storage.PrintAnnotationStorage?n:this.annotationStorage).serializable;break;default:(0,_util.warn)("getRenderingIntent - invalid annotationMode: ".concat(t))}return r&&(a+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:a,cacheKey:"".concat(a,"_").concat(i.hash),annotationStorageSerializable:i}}destroy(){var e;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,null===(e=_classPrivateFieldGet(_passwordCapability,this))||void 0===e||e.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const r of _classPrivateFieldGet(_pageCache,this).values())t.push(r._destroy());_classPrivateFieldGet(_pageCache,this).clear(),_classPrivateFieldGet(_pagePromises,this).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const n=this.messageHandler.sendWithPromise("Terminate",null);return t.push(n),Promise.all(t).then((()=>{var e;this.commonObjs.clear(),this.fontLoader.clear(),_classPrivateFieldGet(_methodPromises,this).clear(),this.filterFactory.destroy(),null===(e=this._networkStream)||void 0===e||e.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()}),this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:t}=this;e.on("GetReader",((e,t)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=e=>{this._lastProgress={loaded:e.loaded,total:e.total}},t.onPull=()=>{this._fullReader.read().then((function(e){let{value:n,done:r}=e;r?t.close():((0,_util.assert)(n instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(n),1,[n]))})).catch((e=>{t.error(e)}))},t.onCancel=e=>{this._fullReader.cancel(e),t.ready.catch((e=>{if(!this.destroyed)throw e}))}})),e.on("ReaderHeadersReady",(e=>{const n=new _util.PromiseCapability,r=this._fullReader;return r.headersReady.then((()=>{var e;r.isStreamingSupported&&r.isRangeSupported||(this._lastProgress&&(null===(e=t.onProgress)||void 0===e||e.call(t,this._lastProgress)),r.onProgress=e=>{var n;null===(n=t.onProgress)||void 0===n||n.call(t,{loaded:e.loaded,total:e.total})});n.resolve({isStreamingSupported:r.isStreamingSupported,isRangeSupported:r.isRangeSupported,contentLength:r.contentLength})}),n.reject),n.promise})),e.on("GetRangeReader",((e,t)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(e.begin,e.end);n?(t.onPull=()=>{n.read().then((function(e){let{value:n,done:r}=e;r?t.close():((0,_util.assert)(n instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(n),1,[n]))})).catch((e=>{t.error(e)}))},t.onCancel=e=>{n.cancel(e),t.ready.catch((e=>{if(!this.destroyed)throw e}))}):t.close()})),e.on("GetDoc",(e=>{let{pdfInfo:n}=e;this._numPages=n.numPages,this._htmlForXfa=n.htmlForXfa,delete n.htmlForXfa,t._capability.resolve(new PDFDocumentProxy(n,this))})),e.on("DocException",(function(e){let n;switch(e.name){case"PasswordException":n=new _util.PasswordException(e.message,e.code);break;case"InvalidPDFException":n=new _util.InvalidPDFException(e.message);break;case"MissingPDFException":n=new _util.MissingPDFException(e.message);break;case"UnexpectedResponseException":n=new _util.UnexpectedResponseException(e.message,e.status);break;case"UnknownErrorException":n=new _util.UnknownErrorException(e.message,e.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}t._capability.reject(n)})),e.on("PasswordRequest",(e=>{if(_classPrivateFieldSet(_passwordCapability,this,new _util.PromiseCapability),t.onPassword){const r=e=>{e instanceof Error?_classPrivateFieldGet(_passwordCapability,this).reject(e):_classPrivateFieldGet(_passwordCapability,this).resolve({password:e})};try{t.onPassword(r,e.code)}catch(n){_classPrivateFieldGet(_passwordCapability,this).reject(n)}}else _classPrivateFieldGet(_passwordCapability,this).reject(new _util.PasswordException(e.message,e.code));return _classPrivateFieldGet(_passwordCapability,this).promise})),e.on("DataLoaded",(e=>{var n;null===(n=t.onProgress)||void 0===n||n.call(t,{loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)})),e.on("StartRenderPage",(e=>{this.destroyed||_classPrivateFieldGet(_pageCache,this).get(e.pageIndex)._startRenderPage(e.transparency,e.cacheKey)})),e.on("commonobj",(t=>{var n;let[r,a,i]=t;if(!this.destroyed&&!this.commonObjs.has(r))switch(a){case"Font":const t=this._params;if("error"in i){const e=i.error;(0,_util.warn)("Error during font loading: ".concat(e)),this.commonObjs.resolve(r,e);break}const s=t.pdfBug&&null!==(n=globalThis.FontInspector)&&void 0!==n&&n.enabled?(e,t)=>globalThis.FontInspector.fontAdded(e,t):null,l=new _font_loader.FontFaceObject(i,{isEvalSupported:t.isEvalSupported,disableFontFace:t.disableFontFace,ignoreErrors:t.ignoreErrors,inspectFont:s});this.fontLoader.bind(l).catch((t=>e.sendWithPromise("FontFallback",{id:r}))).finally((()=>{!t.fontExtraProperties&&l.data&&(l.data=null),this.commonObjs.resolve(r,l)}));break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(r,i);break;default:throw new Error("Got unknown common object type ".concat(a))}})),e.on("obj",(e=>{let[t,n,r,a]=e;if(this.destroyed)return;const i=_classPrivateFieldGet(_pageCache,this).get(n);if(!i.objs.has(t))switch(r){case"Image":if(i.objs.resolve(t,a),a){let e;if(a.bitmap){const{width:t,height:n}=a;e=t*n*4}else{var s;e=(null===(s=a.data)||void 0===s?void 0:s.length)||0}e>_util.MAX_IMAGE_SIZE_TO_CACHE&&(i._maybeCleanupAfterRender=!0)}break;case"Pattern":i.objs.resolve(t,a);break;default:throw new Error("Got unknown object type ".concat(r))}})),e.on("DocProgress",(e=>{var n;this.destroyed||null===(n=t.onProgress)||void 0===n||n.call(t,{loaded:e.loaded,total:e.total})})),e.on("FetchBuiltInCMap",(e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(e):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.")))),e.on("FetchStandardFontData",(e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(e):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var e,t;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:n,transfers:r}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:n,filename:null!==(e=null===(t=this._fullReader)||void 0===t?void 0:t.filename)&&void 0!==e?e:null},r).finally((()=>{this.annotationStorage.resetModified()}))}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const t=e-1,n=_classPrivateFieldGet(_pagePromises,this).get(t);if(n)return n;const r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then((e=>{if(this.destroyed)throw new Error("Transport destroyed");const n=new PDFPageProxy(t,e,this,this._params.pdfBug);return _classPrivateFieldGet(_pageCache,this).set(t,n),n}));return _classPrivateFieldGet(_pagePromises,this).set(t,r),r}getPageIndex(e){return"object"!==typeof e||null===e||!Number.isInteger(e.num)||e.num<0||!Number.isInteger(e.gen)||e.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen})}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return _assertClassBrand(_WorkerTransport_brand,this,_cacheSimpleMethod).call(this,"GetFieldObjects")}hasJSActions(){return _assertClassBrand(_WorkerTransport_brand,this,_cacheSimpleMethod).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return"string"!==typeof e?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return _assertClassBrand(_WorkerTransport_brand,this,_cacheSimpleMethod).call(this,"GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((e=>new _optional_content_config.OptionalContentConfig(e)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",t=_classPrivateFieldGet(_methodPromises,this).get(e);if(t)return t;const n=this.messageHandler.sendWithPromise(e,null).then((e=>{var t,n,r,a;return{info:e[0],metadata:e[1]?new _metadata.Metadata(e[1]):null,contentDispositionFilename:null!==(t=null===(n=this._fullReader)||void 0===n?void 0:n.filename)&&void 0!==t?t:null,contentLength:null!==(r=null===(a=this._fullReader)||void 0===a?void 0:a.contentLength)&&void 0!==r?r:null}}));return _classPrivateFieldGet(_methodPromises,this).set(e,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const e of _classPrivateFieldGet(_pageCache,this).values())if(!e.cleanup())throw new Error("startCleanup: Page ".concat(e.pageNumber," is currently rendering."));this.commonObjs.clear(),e||this.fontLoader.clear(),_classPrivateFieldGet(_methodPromises,this).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:e,enableXfa:t}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:e,enableXfa:t})}}function _cacheSimpleMethod(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=_classPrivateFieldGet(_methodPromises,this).get(e);if(n)return n;const r=this.messageHandler.sendWithPromise(e,t);return _classPrivateFieldGet(_methodPromises,this).set(e,r),r}var _objs=new WeakMap,_PDFObjects_brand=new WeakSet;class PDFObjects{constructor(){_classPrivateMethodInitSpec(this,_PDFObjects_brand),_classPrivateFieldInitSpec(this,_objs,Object.create(null))}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t){const n=_assertClassBrand(_PDFObjects_brand,this,_ensureObj).call(this,e);return n.capability.promise.then((()=>t(n.data))),null}const n=_classPrivateFieldGet(_objs,this)[e];if(null===n||void 0===n||!n.capability.settled)throw new Error("Requesting object that isn't resolved yet ".concat(e,"."));return n.data}has(e){const t=_classPrivateFieldGet(_objs,this)[e];return(null===t||void 0===t?void 0:t.capability.settled)||!1}resolve(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=_assertClassBrand(_PDFObjects_brand,this,_ensureObj).call(this,e);n.data=t,n.capability.resolve()}clear(){for(const t in _classPrivateFieldGet(_objs,this)){var e;const{data:n}=_classPrivateFieldGet(_objs,this)[t];null===n||void 0===n||null===(e=n.bitmap)||void 0===e||e.close()}_classPrivateFieldSet(_objs,this,Object.create(null))}}function _ensureObj(e){var t;return(t=_classPrivateFieldGet(_objs,this))[e]||(t[e]={capability:new _util.PromiseCapability,data:null})}var _internalRenderTask=new WeakMap;class RenderTask{constructor(e){_classPrivateFieldInitSpec(this,_internalRenderTask,null),_classPrivateFieldSet(_internalRenderTask,this,e),this.onContinue=null}get promise(){return _classPrivateFieldGet(_internalRenderTask,this).capability.promise}cancel(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;_classPrivateFieldGet(_internalRenderTask,this).cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=_classPrivateFieldGet(_internalRenderTask,this).operatorList;if(!e)return!1;const{annotationCanvasMap:t}=_classPrivateFieldGet(_internalRenderTask,this);return e.form||e.canvas&&(null===t||void 0===t?void 0:t.size)>0}}exports.RenderTask=RenderTask;class InternalRenderTask{constructor(e){let{callback:t,params:n,objs:r,commonObjs:a,annotationCanvasMap:i,operatorList:s,pageIndex:l,canvasFactory:o,filterFactory:c,useRequestAnimationFrame:d=!1,pdfBug:u=!1,pageColors:h=null}=e;this.callback=t,this.params=n,this.objs=r,this.commonObjs=a,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=l,this.canvasFactory=o,this.filterFactory=c,this._pdfBug=u,this.pageColors=h,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===d&&"undefined"!==typeof window,this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=n.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics(e){var t,n;let{transparency:r=!1,optionalContentConfig:a}=e;if(this.cancelled)return;if(this._canvas){if(_canvasInUse._.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");_canvasInUse._.add(this._canvas)}this._pdfBug&&null!==(t=globalThis.StepperManager)&&void 0!==t&&t.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:i,viewport:s,transform:l,background:o}=this.params;this.gfx=new _canvas.CanvasGraphics(i,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:a},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:l,viewport:s,transparency:r,background:o}),this.operatorListIdx=0,this.graphicsReady=!0,null===(n=this.graphicsReadyCallback)||void 0===n||n.call(this)}cancel(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1,this.cancelled=!0,null===(e=this.gfx)||void 0===e||e.endDrawing(),_canvasInUse._.delete(this._canvas),this.callback(t||new _display_utils.RenderingCancelledException("Rendering cancelled, page ".concat(this._pageIndex+1),n))}operatorListChanged(){var e;this.graphicsReady?(null===(e=this.stepper)||void 0===e||e.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame((()=>{this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),_canvasInUse._.delete(this._canvas),this.callback())))}}var _canvasInUse={_:new WeakSet};const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SerializableEmpty=t.PrintAnnotationStorage=t.AnnotationStorage=void 0;var r=n(1),a=n(4),i=n(8);const s=Object.freeze({map:null,hash:"",transfers:void 0});t.SerializableEmpty=s;var l=new WeakMap,o=new WeakMap,c=new WeakSet;class d{constructor(){_classPrivateMethodInitSpec(this,c),_classPrivateFieldInitSpec(this,l,!1),_classPrivateFieldInitSpec(this,o,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){const n=_classPrivateFieldGet(o,this).get(e);return void 0===n?t:Object.assign(t,n)}getRawValue(e){return _classPrivateFieldGet(o,this).get(e)}remove(e){if(_classPrivateFieldGet(o,this).delete(e),0===_classPrivateFieldGet(o,this).size&&this.resetModified(),"function"===typeof this.onAnnotationEditor){for(const e of _classPrivateFieldGet(o,this).values())if(e instanceof a.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(e,t){const n=_classPrivateFieldGet(o,this).get(e);let r=!1;if(void 0!==n)for(const[a,i]of Object.entries(t))n[a]!==i&&(r=!0,n[a]=i);else r=!0,_classPrivateFieldGet(o,this).set(e,t);r&&_assertClassBrand(c,this,u).call(this),t instanceof a.AnnotationEditor&&"function"===typeof this.onAnnotationEditor&&this.onAnnotationEditor(t.constructor._type)}has(e){return _classPrivateFieldGet(o,this).has(e)}getAll(){return _classPrivateFieldGet(o,this).size>0?(0,r.objectFromMap)(_classPrivateFieldGet(o,this)):null}setAll(e){for(const[t,n]of Object.entries(e))this.setValue(t,n)}get size(){return _classPrivateFieldGet(o,this).size}resetModified(){_classPrivateFieldGet(l,this)&&(_classPrivateFieldSet(l,this,!1),"function"===typeof this.onResetModified&&this.onResetModified())}get print(){return new f(this)}get serializable(){if(0===_classPrivateFieldGet(o,this).size)return s;const e=new Map,t=new i.MurmurHash3_64,n=[],r=Object.create(null);let l=!1;for(const[i,s]of _classPrivateFieldGet(o,this)){const n=s instanceof a.AnnotationEditor?s.serialize(!1,r):s;n&&(e.set(i,n),t.update("".concat(i,":").concat(JSON.stringify(n))),l||(l=!!n.bitmap))}if(l)for(const a of e.values())a.bitmap&&n.push(a.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfers:n}:s}}function u(){_classPrivateFieldGet(l,this)||(_classPrivateFieldSet(l,this,!0),"function"===typeof this.onSetModified&&this.onSetModified())}t.AnnotationStorage=d;var h=new WeakMap;class f extends d{constructor(e){super(),_classPrivateFieldInitSpec(this,h,void 0);const{map:t,hash:n,transfers:r}=e.serializable,a=structuredClone(t,r?{transfer:r}:null);_classPrivateFieldSet(h,this,{map:a,hash:n,transfers:r})}get print(){(0,r.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return _classPrivateFieldGet(h,this)}}t.PrintAnnotationStorage=f},(e,t,n)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditor=void 0;var a=n(5),i=n(1),s=n(6),l=new WeakMap,o=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,h=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,g=new WeakMap,v=new WeakMap,x=new WeakMap,b=new WeakMap,y=new WeakMap,w=new WeakSet;class _{constructor(e){_classPrivateMethodInitSpec(this,w),_classPrivateFieldInitSpec(this,l,""),_classPrivateFieldInitSpec(this,o,!1),_classPrivateFieldInitSpec(this,c,null),_classPrivateFieldInitSpec(this,d,null),_classPrivateFieldInitSpec(this,u,null),_classPrivateFieldInitSpec(this,h,!1),_classPrivateFieldInitSpec(this,f,null),_classPrivateFieldInitSpec(this,p,this.focusin.bind(this)),_classPrivateFieldInitSpec(this,m,this.focusout.bind(this)),_classPrivateFieldInitSpec(this,g,!1),_classPrivateFieldInitSpec(this,v,!1),_classPrivateFieldInitSpec(this,x,!1),_defineProperty(this,"_initialOptions",Object.create(null)),_defineProperty(this,"_uiManager",null),_defineProperty(this,"_focusEventsAllowed",!0),_defineProperty(this,"_l10nPromise",null),_classPrivateFieldInitSpec(this,b,!1),_classPrivateFieldInitSpec(this,y,_._zIndex++),this.constructor===_&&(0,i.unreachable)("Cannot initialize AnnotationEditor."),this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null;const{rotation:t,rawDims:{pageWidth:n,pageHeight:r,pageX:a,pageY:s}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,r],this.pageTranslation=[a,s];const[S,P]=this.parentDimensions;this.x=e.x/S,this.y=e.y/P,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,i.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const t=new T({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(_._l10nPromise||(_._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map((t=>[t,e.get(t)])))),null!==t&&void 0!==t&&t.strings)for(const r of t.strings)_._l10nPromise.set(r,e.get(r));if(-1!==_._borderLineWidth)return;const n=getComputedStyle(document.documentElement);_._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){(0,i.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return _classPrivateFieldGet(b,this)}set _isDraggable(e){var t;_classPrivateFieldSet(b,this,e),null===(t=this.div)||void 0===t||t.classList.toggle("draggable",e)}center(){const[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(2*e),this.y+=this.width*e/(2*t);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(2*e),this.y-=this.width*e/(2*t);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=_classPrivateFieldGet(y,this)}setParent(e){null!==e&&(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions),this.parent=e}focusin(e){this._focusEventsAllowed&&(_classPrivateFieldGet(g,this)?_classPrivateFieldSet(g,this,!1):this.parent.setSelected(this))}focusout(e){var t;if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const n=e.relatedTarget;null!==n&&void 0!==n&&n.closest("#".concat(this.id))||(e.preventDefault(),null!==(t=this.parent)&&void 0!==t&&t.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,n,r){const[a,i]=this.parentDimensions;[n,r]=this.screenToPageTranslation(n,r),this.x=(e+n)/a,this.y=(t+r)/i,this.fixAndSetPosition()}translate(e,t){_assertClassBrand(w,this,S).call(this,this.parentDimensions,e,t)}translateInPage(e,t){_assertClassBrand(w,this,S).call(this,this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}drag(e,t){const[n,r]=this.parentDimensions;if(this.x+=e/n,this.y+=t/r,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:e,y:t}=this.div.getBoundingClientRect();this.parent.findNewParent(this,e,t)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:i}=this;const[s,l]=_assertClassBrand(w,this,P).call(this);a+=s,i+=l,this.div.style.left="".concat((100*a).toFixed(2),"%"),this.div.style.top="".concat((100*i).toFixed(2),"%"),this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[e,t]=this.pageDimensions;let{x:n,y:r,width:a,height:i}=this;switch(a*=e,i*=t,n*=e,r*=t,this.rotation){case 0:n=Math.max(0,Math.min(e-a,n)),r=Math.max(0,Math.min(t-i,r));break;case 90:n=Math.max(0,Math.min(e-i,n)),r=Math.min(t,Math.max(a,r));break;case 180:n=Math.min(e,Math.max(a,n)),r=Math.min(t,Math.max(i,r));break;case 270:n=Math.min(e,Math.max(i,n)),r=Math.max(0,Math.min(t-a,r))}this.x=n/=e,this.y=r/=t;const[s,l]=_assertClassBrand(w,this,P).call(this);n+=s,r+=l;const{style:o}=this.div;o.left="".concat((100*n).toFixed(2),"%"),o.top="".concat((100*r).toFixed(2),"%"),this.moveInDOM()}screenToPageTranslation(e,t){return C.call(_,e,t,this.parentRotation)}pageTranslationToScreen(e,t){return C.call(_,e,t,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[t,n]}=this,r=t*e,a=n*e;return i.FeatureTest.isCSSRoundSupported?[Math.round(r),Math.round(a)]:[r,a]}setDims(e,t){var n;const[r,a]=this.parentDimensions;this.div.style.width="".concat((100*e/r).toFixed(2),"%"),_classPrivateFieldGet(h,this)||(this.div.style.height="".concat((100*t/a).toFixed(2),"%")),null===(n=_classPrivateFieldGet(c,this))||void 0===n||n.classList.toggle("small",e<_.SMALL_EDITOR_SIZE||t<_.SMALL_EDITOR_SIZE)}fixDims(){const{style:e}=this.div,{height:t,width:n}=e,r=n.endsWith("%"),a=!_classPrivateFieldGet(h,this)&&t.endsWith("%");if(r&&a)return;const[i,s]=this.parentDimensions;r||(e.width="".concat((100*parseFloat(n)/i).toFixed(2),"%")),_classPrivateFieldGet(h,this)||a||(e.height="".concat((100*parseFloat(t)/s).toFixed(2),"%"))}getInitialTranslation(){return[0,0]}async addAltTextButton(){if(_classPrivateFieldGet(c,this))return;const e=_classPrivateFieldSet(c,this,document.createElement("button"));e.className="altText";const t=await _._l10nPromise.get("editor_alt_text_button_label");if(e.textContent=t,e.setAttribute("aria-label",t),e.tabIndex="0",e.addEventListener("contextmenu",s.noContextMenu),e.addEventListener("pointerdown",(e=>e.stopPropagation())),e.addEventListener("click",(e=>{e.preventDefault(),this._uiManager.editAltText(this)}),{capture:!0}),e.addEventListener("keydown",(t=>{t.target===e&&"Enter"===t.key&&(t.preventDefault(),this._uiManager.editAltText(this))})),_assertClassBrand(w,this,N).call(this),this.div.append(e),!_.SMALL_EDITOR_SIZE){const t=40;_.SMALL_EDITOR_SIZE=Math.min(128,Math.round(e.getBoundingClientRect().width*(1+t/100)))}}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:_classPrivateFieldGet(l,this),decorative:_classPrivateFieldGet(o,this)}}set altTextData(e){let{altText:t,decorative:n}=e;_classPrivateFieldGet(l,this)===t&&_classPrivateFieldGet(o,this)===n||(_classPrivateFieldSet(l,this,t),_classPrivateFieldSet(o,this,n),_assertClassBrand(w,this,N).call(this))}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",_classPrivateFieldGet(p,this)),this.div.addEventListener("focusout",_classPrivateFieldGet(m,this));const[e,t]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth="".concat((100*t/e).toFixed(2),"%"),this.div.style.maxHeight="".concat((100*e/t).toFixed(2),"%"));const[n,r]=this.getInitialTranslation();return this.translate(n,r),(0,a.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(e){const{isMac:t}=i.FeatureTest.platform;0!==e.button||e.ctrlKey&&t?e.preventDefault():(_classPrivateFieldSet(g,this,!0),_assertClassBrand(w,this,F).call(this,e))}moveInDOM(){var e;null===(e=this.parent)||void 0===e||e.moveEditorInDOM(this)}_setParentAndPosition(e,t,n){e.changeParent(this),this.x=t,this.y=n,this.fixAndSetPosition()}getRect(e,t){const n=this.parentScale,[r,a]=this.pageDimensions,[i,s]=this.pageTranslation,l=e/n,o=t/n,c=this.x*r,d=this.y*a,u=this.width*r,h=this.height*a;switch(this.rotation){case 0:return[c+l+i,a-d-o-h+s,c+l+u+i,a-d-o+s];case 90:return[c+o+i,a-d+l+s,c+o+h+i,a-d+l+u+s];case 180:return[c-l-u+i,a-d+o+s,c-l+i,a-d+o+h+s];case 270:return[c-o-h+i,a-d-l-u+s,c-o+i,a-d-l+s];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[n,r,a,i]=e,s=a-n,l=i-r;switch(this.rotation){case 0:return[n,t-i,s,l];case 90:return[n,t-r,l,s];case 180:return[a,t-r,s,l];case 270:return[a,t-i,l,s];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){_classPrivateFieldSet(x,this,!0)}disableEditMode(){_classPrivateFieldSet(x,this,!1)}isInEditMode(){return _classPrivateFieldGet(x,this)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var e,t;null===(e=this.div)||void 0===e||e.addEventListener("focusin",_classPrivateFieldGet(p,this)),null===(t=this.div)||void 0===t||t.addEventListener("focusout",_classPrivateFieldGet(m,this))}serialize(){(0,i.unreachable)("An editor must be serializable")}static deserialize(e,t,n){const r=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:n});r.rotation=e.rotation;const[a,i]=r.pageDimensions,[s,l,o,c]=r.getRectInCurrentCoords(e.rect,i);return r.x=s/a,r.y=l/i,r.width=o/a,r.height=c/i,r}remove(){var e;this.div.removeEventListener("focusin",_classPrivateFieldGet(p,this)),this.div.removeEventListener("focusout",_classPrivateFieldGet(m,this)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),null===(e=_classPrivateFieldGet(c,this))||void 0===e||e.remove(),_classPrivateFieldSet(c,this,null),_classPrivateFieldSet(d,this,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(_assertClassBrand(w,this,k).call(this),_classPrivateFieldGet(f,this).classList.remove("hidden"))}select(){var e;this.makeResizable(),null===(e=this.div)||void 0===e||e.classList.add("selectedEditor")}unselect(){var e,t,n;null===(e=_classPrivateFieldGet(f,this))||void 0===e||e.classList.add("hidden"),null===(t=this.div)||void 0===t||t.classList.remove("selectedEditor"),null!==(n=this.div)&&void 0!==n&&n.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(e,t){}disableEditing(){_classPrivateFieldGet(c,this)&&(_classPrivateFieldGet(c,this).hidden=!0)}enableEditing(){_classPrivateFieldGet(c,this)&&(_classPrivateFieldGet(c,this).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return _classPrivateFieldGet(v,this)}set isEditing(e){_classPrivateFieldSet(v,this,e),this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,t){_classPrivateFieldSet(h,this,!0);const n=e/t,{style:r}=this.div;r.aspectRatio=n,r.height="auto"}static get MIN_SIZE(){return 16}}function S(e,t,n){let[r,a]=e;[t,n]=this.screenToPageTranslation(t,n),this.x+=t/r,this.y+=n/a,this.fixAndSetPosition()}function P(){const[e,t]=this.parentDimensions,{_borderLineWidth:n}=r,a=n/e,i=n/t;switch(this.rotation){case 90:return[-a,i];case 180:return[a,i];case 270:return[a,-i];default:return[-a,-i]}}function C(e,t,n){switch(n){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}function A(e){switch(e){case 90:{const[e,t]=this.pageDimensions;return[0,-e/t,t/e,0]}case 180:return[-1,0,0,-1];case 270:{const[e,t]=this.pageDimensions;return[0,e/t,-t/e,0]}default:return[1,0,0,1]}}function k(){if(_classPrivateFieldGet(f,this))return;_classPrivateFieldSet(f,this,document.createElement("div")),_classPrivateFieldGet(f,this).classList.add("resizers");const e=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||e.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const t of e){const e=document.createElement("div");_classPrivateFieldGet(f,this).append(e),e.classList.add("resizer",t),e.addEventListener("pointerdown",_assertClassBrand(w,this,j).bind(this,t)),e.addEventListener("contextmenu",s.noContextMenu)}this.div.prepend(_classPrivateFieldGet(f,this))}function j(e,t){t.preventDefault();const{isMac:n}=i.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&n)return;const r=_assertClassBrand(w,this,E).bind(this,e),a=this._isDraggable;this._isDraggable=!1;const s={passive:!0,capture:!0};window.addEventListener("pointermove",r,s);const l=this.x,o=this.y,c=this.width,d=this.height,u=this.parent.div.style.cursor,h=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;const f=()=>{this._isDraggable=a,window.removeEventListener("pointerup",f),window.removeEventListener("blur",f),window.removeEventListener("pointermove",r,s),this.parent.div.style.cursor=u,this.div.style.cursor=h;const e=this.x,t=this.y,n=this.width,i=this.height;e===l&&t===o&&n===c&&i===d||this.addCommands({cmd:()=>{this.width=n,this.height=i,this.x=e,this.y=t;const[r,a]=this.parentDimensions;this.setDims(r*n,a*i),this.fixAndSetPosition()},undo:()=>{this.width=c,this.height=d,this.x=l,this.y=o;const[e,t]=this.parentDimensions;this.setDims(e*c,t*d),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",f),window.addEventListener("blur",f)}function E(e,t){const[n,a]=this.parentDimensions,i=this.x,s=this.y,l=this.width,o=this.height,c=r.MIN_SIZE/n,d=r.MIN_SIZE/a,u=e=>Math.round(1e4*e)/1e4,h=_assertClassBrand(w,this,A).call(this,this.rotation),f=(e,t)=>[h[0]*e+h[2]*t,h[1]*e+h[3]*t],p=_assertClassBrand(w,this,A).call(this,360-this.rotation);let m,g,v=!1,x=!1;switch(e){case"topLeft":v=!0,m=(e,t)=>[0,0],g=(e,t)=>[e,t];break;case"topMiddle":m=(e,t)=>[e/2,0],g=(e,t)=>[e/2,t];break;case"topRight":v=!0,m=(e,t)=>[e,0],g=(e,t)=>[0,t];break;case"middleRight":x=!0,m=(e,t)=>[e,t/2],g=(e,t)=>[0,t/2];break;case"bottomRight":v=!0,m=(e,t)=>[e,t],g=(e,t)=>[0,0];break;case"bottomMiddle":m=(e,t)=>[e/2,t],g=(e,t)=>[e/2,0];break;case"bottomLeft":v=!0,m=(e,t)=>[0,t],g=(e,t)=>[e,0];break;case"middleLeft":x=!0,m=(e,t)=>[0,t/2],g=(e,t)=>[e,t/2]}const b=m(l,o),y=g(l,o);let _=f(...y);const S=u(i+_[0]),P=u(s+_[1]);let C=1,k=1,[j,E]=this.screenToPageTranslation(t.movementX,t.movementY);var N,F;if([j,E]=(N=j/n,F=E/a,[p[0]*N+p[2]*F,p[1]*N+p[3]*F]),v){const e=Math.hypot(l,o);C=k=Math.max(Math.min(Math.hypot(y[0]-b[0]-j,y[1]-b[1]-E)/e,1/l,1/o),c/l,d/o)}else x?C=Math.max(c,Math.min(1,Math.abs(y[0]-b[0]-j)))/l:k=Math.max(d,Math.min(1,Math.abs(y[1]-b[1]-E)))/o;const T=u(l*C),M=u(o*k);_=f(...g(T,M));const R=S-_[0],I=P-_[1];this.width=T,this.height=M,this.x=R,this.y=I,this.setDims(n*T,a*M),this.fixAndSetPosition()}async function N(){const e=_classPrivateFieldGet(c,this);if(!e)return;var t;if(!_classPrivateFieldGet(l,this)&&!_classPrivateFieldGet(o,this))return e.classList.remove("done"),void(null===(t=_classPrivateFieldGet(d,this))||void 0===t||t.remove());r._l10nPromise.get("editor_alt_text_edit_button_label").then((t=>{e.setAttribute("aria-label",t)}));let n=_classPrivateFieldGet(d,this);if(!n){_classPrivateFieldSet(d,this,n=document.createElement("span")),n.className="tooltip",n.setAttribute("role","tooltip");const t=n.id="alt-text-tooltip-".concat(this.id);e.setAttribute("aria-describedby",t);const r=100;e.addEventListener("mouseenter",(()=>{_classPrivateFieldSet(u,this,setTimeout((()=>{_classPrivateFieldSet(u,this,null),_classPrivateFieldGet(d,this).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})}),r))})),e.addEventListener("mouseleave",(()=>{var e;clearTimeout(_classPrivateFieldGet(u,this)),_classPrivateFieldSet(u,this,null),null===(e=_classPrivateFieldGet(d,this))||void 0===e||e.classList.remove("show")}))}e.classList.add("done"),n.innerText=_classPrivateFieldGet(o,this)?await r._l10nPromise.get("editor_alt_text_decorative_tooltip"):_classPrivateFieldGet(l,this),n.parentNode||e.append(n)}function F(e){if(!this._isDraggable)return;const t=this._uiManager.isSelected(this);let n,r;this._uiManager.setUpDragSession(),t&&(n={passive:!0,capture:!0},r=e=>{const[t,n]=this.screenToPageTranslation(e.movementX,e.movementY);this._uiManager.dragSelectedEditors(t,n)},window.addEventListener("pointermove",r,n));const a=()=>{if(window.removeEventListener("pointerup",a),window.removeEventListener("blur",a),t&&window.removeEventListener("pointermove",r,n),_classPrivateFieldSet(g,this,!1),!this._uiManager.endDragSession()){const{isMac:t}=i.FeatureTest.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",a),window.addEventListener("blur",a)}r=_,_defineProperty(_,"_borderLineWidth",-1),_defineProperty(_,"_colorManager",new a.ColorManager),_defineProperty(_,"_zIndex",1),_defineProperty(_,"SMALL_EDITOR_SIZE",0),t.AnnotationEditor=_;class T extends _{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(e,t,n)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.KeyboardManager=t.CommandManager=t.ColorManager=t.AnnotationEditorUIManager=void 0,t.bindEvents=function(e,t,n){for(const r of n)t.addEventListener(r,e[r].bind(e))},t.opacityToHex=function(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")};var a=n(1),i=n(6),s=new WeakMap;class l{constructor(){_classPrivateFieldInitSpec(this,s,0)}getId(){var e,t;return"".concat(a.AnnotationEditorPrefix).concat((_classPrivateFieldSet(s,this,(e=_classPrivateFieldGet(s,this),t=e++,e)),t))}}var o=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakSet;class h{constructor(){_classPrivateMethodInitSpec(this,u),_classPrivateFieldInitSpec(this,o,(0,a.getUuid)()),_classPrivateFieldInitSpec(this,c,0),_classPrivateFieldInitSpec(this,d,null)}static get _isSVGFittingCanvas(){const e=new OffscreenCanvas(1,3).getContext("2d"),t=new Image;t.src='data:image/svg+xml;charset=UTF-8,';const n=t.decode().then((()=>(e.drawImage(t,0,0,1,1,0,0,1,3),0===new Uint32Array(e.getImageData(0,0,1,1).data.buffer)[0])));return(0,a.shadow)(this,"_isSVGFittingCanvas",n)}async getFromFile(e){const{lastModified:t,name:n,size:r,type:a}=e;return _assertClassBrand(u,this,f).call(this,"".concat(t,"_").concat(n,"_").concat(r,"_").concat(a),e)}async getFromUrl(e){return _assertClassBrand(u,this,f).call(this,e,e)}async getFromId(e){_classPrivateFieldGet(d,this)||_classPrivateFieldSet(d,this,new Map);const t=_classPrivateFieldGet(d,this).get(e);return t?t.bitmap?(t.refCounter+=1,t):t.file?this.getFromFile(t.file):this.getFromUrl(t.url):null}getSvgUrl(e){const t=_classPrivateFieldGet(d,this).get(e);return null!==t&&void 0!==t&&t.isSvg?t.svgUrl:null}deleteId(e){_classPrivateFieldGet(d,this)||_classPrivateFieldSet(d,this,new Map);const t=_classPrivateFieldGet(d,this).get(e);t&&(t.refCounter-=1,0===t.refCounter&&(t.bitmap=null))}isValidId(e){return e.startsWith("image_".concat(_classPrivateFieldGet(o,this),"_"))}}async function f(e,t){var n;_classPrivateFieldGet(d,this)||_classPrivateFieldSet(d,this,new Map);let a=_classPrivateFieldGet(d,this).get(e);if(null===a)return null;if(null!==(n=a)&&void 0!==n&&n.bitmap)return a.refCounter+=1,a;try{var i,s;let e;if(a||(a={bitmap:null,id:"image_".concat(_classPrivateFieldGet(o,this),"_").concat((_classPrivateFieldSet(c,this,(i=_classPrivateFieldGet(c,this),s=i++,i)),s)),refCounter:0,isSvg:!1}),"string"===typeof t){a.url=t;const n=await fetch(t);if(!n.ok)throw new Error(n.statusText);e=await n.blob()}else e=a.file=t;if("image/svg+xml"===e.type){const t=r._isSVGFittingCanvas,n=new FileReader,i=new Image,s=new Promise(((e,r)=>{i.onload=()=>{a.bitmap=i,a.isSvg=!0,e()},n.onload=async()=>{const e=a.svgUrl=n.result;i.src=await t?"".concat(e,"#svgView(preserveAspectRatio(none))"):e},i.onerror=n.onerror=r}));n.readAsDataURL(e),await s}else a.bitmap=await createImageBitmap(e);a.refCounter=1}catch(l){console.error(l),a=null}return _classPrivateFieldGet(d,this).set(e,a),a&&_classPrivateFieldGet(d,this).set(a.id,a),a}r=h;var p=new WeakMap,m=new WeakMap,g=new WeakMap,v=new WeakMap;class x{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;_classPrivateFieldInitSpec(this,p,[]),_classPrivateFieldInitSpec(this,m,!1),_classPrivateFieldInitSpec(this,g,void 0),_classPrivateFieldInitSpec(this,v,-1),_classPrivateFieldSet(g,this,e)}add(e){let{cmd:t,undo:n,mustExec:r,type:a=NaN,overwriteIfSameType:i=!1,keepUndo:s=!1}=e;if(r&&t(),_classPrivateFieldGet(m,this))return;const l={cmd:t,undo:n,type:a};if(-1===_classPrivateFieldGet(v,this))return _classPrivateFieldGet(p,this).length>0&&(_classPrivateFieldGet(p,this).length=0),_classPrivateFieldSet(v,this,0),void _classPrivateFieldGet(p,this).push(l);if(i&&_classPrivateFieldGet(p,this)[_classPrivateFieldGet(v,this)].type===a)return s&&(l.undo=_classPrivateFieldGet(p,this)[_classPrivateFieldGet(v,this)].undo),void(_classPrivateFieldGet(p,this)[_classPrivateFieldGet(v,this)]=l);const o=_classPrivateFieldGet(v,this)+1;o===_classPrivateFieldGet(g,this)?_classPrivateFieldGet(p,this).splice(0,1):(_classPrivateFieldSet(v,this,o),o<_classPrivateFieldGet(p,this).length&&_classPrivateFieldGet(p,this).splice(o)),_classPrivateFieldGet(p,this).push(l)}undo(){-1!==_classPrivateFieldGet(v,this)&&(_classPrivateFieldSet(m,this,!0),_classPrivateFieldGet(p,this)[_classPrivateFieldGet(v,this)].undo(),_classPrivateFieldSet(m,this,!1),_classPrivateFieldSet(v,this,_classPrivateFieldGet(v,this)-1))}redo(){_classPrivateFieldGet(v,this)<_classPrivateFieldGet(p,this).length-1&&(_classPrivateFieldSet(v,this,_classPrivateFieldGet(v,this)+1),_classPrivateFieldSet(m,this,!0),_classPrivateFieldGet(p,this)[_classPrivateFieldGet(v,this)].cmd(),_classPrivateFieldSet(m,this,!1))}hasSomethingToUndo(){return-1!==_classPrivateFieldGet(v,this)}hasSomethingToRedo(){return _classPrivateFieldGet(v,this)<_classPrivateFieldGet(p,this).length-1}destroy(){_classPrivateFieldSet(p,this,null)}}t.CommandManager=x;var b=new WeakSet;class y{constructor(e){_classPrivateMethodInitSpec(this,b),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:t}=a.FeatureTest.platform;for(const[n,r,a={}]of e)for(const e of n){const n=e.startsWith("mac+");t&&n?(this.callbacks.set(e.slice(4),{callback:r,options:a}),this.allKeys.add(e.split("+").at(-1))):t||n||(this.callbacks.set(e,{callback:r,options:a}),this.allKeys.add(e.split("+").at(-1)))}}exec(e,t){if(!this.allKeys.has(t.key))return;const n=this.callbacks.get(_assertClassBrand(b,this,w).call(this,t));if(!n)return;const{callback:r,options:{bubbles:a=!1,args:i=[],checker:s=null}}=n;s&&!s(e,t)||(r.bind(e,...i)(),a||(t.stopPropagation(),t.preventDefault()))}}function w(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const t=this.buffer.join("+");return this.buffer.length=0,t}t.KeyboardManager=y;class _{get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return(0,i.getColorValues)(e),(0,a.shadow)(this,"_colors",e)}convert(e){const t=(0,i.getRGB)(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(const[n,r]of this._colors)if(r.every(((e,n)=>e===t[n])))return _._colorsMapping.get(n);return t}getHexCode(e){const t=this._colors.get(e);return t?a.Util.makeHexColor(...t):e}}_defineProperty(_,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]])),t.ColorManager=_;var S=new WeakMap,P=new WeakMap,C=new WeakMap,A=new WeakMap,k=new WeakMap,j=new WeakMap,E=new WeakMap,N=new WeakMap,F=new WeakMap,T=new WeakMap,M=new WeakMap,R=new WeakMap,I=new WeakMap,L=new WeakMap,O=new WeakMap,D=new WeakMap,G=new WeakMap,B=new WeakMap,z=new WeakMap,W=new WeakMap,U=new WeakMap,H=new WeakMap,q=new WeakMap,V=new WeakMap,X=new WeakMap,Y=new WeakMap,K=new WeakMap,J=new WeakMap,Q=new WeakMap,Z=new WeakMap,$=new WeakMap,ee=new WeakMap,te=new WeakMap,ne=new WeakMap,re=new WeakSet;class ae{static get _keyboardManager(){const e=ae.prototype,t=e=>{const{activeElement:t}=document;return t&&_classPrivateFieldGet(te,e).contains(t)&&e.hasSomethingToControl()},n=this.TRANSLATE_SMALL,r=this.TRANSLATE_BIG;return(0,a.shadow)(this,"_keyboardManager",new y([[["ctrl+a","mac+meta+a"],e.selectAll],[["ctrl+z","mac+meta+z"],e.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-n,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-r,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[n,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[r,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-n],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-r],checker:t}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,n],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,r],checker:t}]]))}constructor(e,t,n,r,s,o){_classPrivateMethodInitSpec(this,re),_classPrivateFieldInitSpec(this,S,null),_classPrivateFieldInitSpec(this,P,new Map),_classPrivateFieldInitSpec(this,C,new Map),_classPrivateFieldInitSpec(this,A,null),_classPrivateFieldInitSpec(this,k,null),_classPrivateFieldInitSpec(this,j,new x),_classPrivateFieldInitSpec(this,E,0),_classPrivateFieldInitSpec(this,N,new Set),_classPrivateFieldInitSpec(this,F,null),_classPrivateFieldInitSpec(this,T,null),_classPrivateFieldInitSpec(this,M,new Set),_classPrivateFieldInitSpec(this,R,null),_classPrivateFieldInitSpec(this,I,new l),_classPrivateFieldInitSpec(this,L,!1),_classPrivateFieldInitSpec(this,O,!1),_classPrivateFieldInitSpec(this,D,null),_classPrivateFieldInitSpec(this,G,a.AnnotationEditorType.NONE),_classPrivateFieldInitSpec(this,B,new Set),_classPrivateFieldInitSpec(this,z,null),_classPrivateFieldInitSpec(this,W,this.blur.bind(this)),_classPrivateFieldInitSpec(this,U,this.focus.bind(this)),_classPrivateFieldInitSpec(this,H,this.copy.bind(this)),_classPrivateFieldInitSpec(this,q,this.cut.bind(this)),_classPrivateFieldInitSpec(this,V,this.paste.bind(this)),_classPrivateFieldInitSpec(this,X,this.keydown.bind(this)),_classPrivateFieldInitSpec(this,Y,this.onEditingAction.bind(this)),_classPrivateFieldInitSpec(this,K,this.onPageChanging.bind(this)),_classPrivateFieldInitSpec(this,J,this.onScaleChanging.bind(this)),_classPrivateFieldInitSpec(this,Q,this.onRotationChanging.bind(this)),_classPrivateFieldInitSpec(this,Z,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1}),_classPrivateFieldInitSpec(this,$,[0,0]),_classPrivateFieldInitSpec(this,ee,null),_classPrivateFieldInitSpec(this,te,null),_classPrivateFieldInitSpec(this,ne,null),_classPrivateFieldSet(te,this,e),_classPrivateFieldSet(ne,this,t),_classPrivateFieldSet(A,this,n),this._eventBus=r,this._eventBus._on("editingaction",_classPrivateFieldGet(Y,this)),this._eventBus._on("pagechanging",_classPrivateFieldGet(K,this)),this._eventBus._on("scalechanging",_classPrivateFieldGet(J,this)),this._eventBus._on("rotationchanging",_classPrivateFieldGet(Q,this)),_classPrivateFieldSet(k,this,s.annotationStorage),_classPrivateFieldSet(R,this,s.filterFactory),_classPrivateFieldSet(z,this,o),this.viewParameters={realScale:i.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){_assertClassBrand(re,this,oe).call(this),_assertClassBrand(re,this,se).call(this),this._eventBus._off("editingaction",_classPrivateFieldGet(Y,this)),this._eventBus._off("pagechanging",_classPrivateFieldGet(K,this)),this._eventBus._off("scalechanging",_classPrivateFieldGet(J,this)),this._eventBus._off("rotationchanging",_classPrivateFieldGet(Q,this));for(const e of _classPrivateFieldGet(C,this).values())e.destroy();_classPrivateFieldGet(C,this).clear(),_classPrivateFieldGet(P,this).clear(),_classPrivateFieldGet(M,this).clear(),_classPrivateFieldSet(S,this,null),_classPrivateFieldGet(B,this).clear(),_classPrivateFieldGet(j,this).destroy(),_classPrivateFieldGet(A,this).destroy()}get hcmFilter(){return(0,a.shadow)(this,"hcmFilter",_classPrivateFieldGet(z,this)?_classPrivateFieldGet(R,this).addHCMFilter(_classPrivateFieldGet(z,this).foreground,_classPrivateFieldGet(z,this).background):"none")}get direction(){return(0,a.shadow)(this,"direction",getComputedStyle(_classPrivateFieldGet(te,this)).direction)}editAltText(e){var t;null===(t=_classPrivateFieldGet(A,this))||void 0===t||t.editAltText(this,e)}onPageChanging(e){let{pageNumber:t}=e;_classPrivateFieldSet(E,this,t-1)}focusMainContainer(){_classPrivateFieldGet(te,this).focus()}findParent(e,t){for(const n of _classPrivateFieldGet(C,this).values()){const{x:r,y:a,width:i,height:s}=n.div.getBoundingClientRect();if(e>=r&&e<=r+i&&t>=a&&t<=a+s)return n}return null}disableUserSelect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];_classPrivateFieldGet(ne,this).classList.toggle("noUserSelect",e)}addShouldRescale(e){_classPrivateFieldGet(M,this).add(e)}removeShouldRescale(e){_classPrivateFieldGet(M,this).delete(e)}onScaleChanging(e){let{scale:t}=e;this.commitOrRemove(),this.viewParameters.realScale=t*i.PixelsPerInch.PDF_TO_CSS_UNITS;for(const n of _classPrivateFieldGet(M,this))n.onScaleChanging()}onRotationChanging(e){let{pagesRotation:t}=e;this.commitOrRemove(),this.viewParameters.rotation=t}addToAnnotationStorage(e){e.isEmpty()||!_classPrivateFieldGet(k,this)||_classPrivateFieldGet(k,this).has(e.id)||_classPrivateFieldGet(k,this).setValue(e.id,e)}blur(){if(!this.hasSelection)return;const{activeElement:e}=document;for(const t of _classPrivateFieldGet(B,this))if(t.div.contains(e)){_classPrivateFieldSet(D,this,[t,e]),t._focusEventsAllowed=!1;break}}focus(){if(!_classPrivateFieldGet(D,this))return;const[e,t]=_classPrivateFieldGet(D,this);_classPrivateFieldSet(D,this,null),t.addEventListener("focusin",(()=>{e._focusEventsAllowed=!0}),{once:!0}),t.focus()}addEditListeners(){_assertClassBrand(re,this,le).call(this),_assertClassBrand(re,this,ce).call(this)}removeEditListeners(){_assertClassBrand(re,this,oe).call(this),_assertClassBrand(re,this,de).call(this)}copy(e){var t;if(e.preventDefault(),null===(t=_classPrivateFieldGet(S,this))||void 0===t||t.commitOrRemove(),!this.hasSelection)return;const n=[];for(const r of _classPrivateFieldGet(B,this)){const e=r.serialize(!0);e&&n.push(e)}0!==n.length&&e.clipboardData.setData("application/pdfjs",JSON.stringify(n))}cut(e){this.copy(e),this.delete()}paste(e){e.preventDefault();const{clipboardData:t}=e;for(const a of t.items)for(const e of _classPrivateFieldGet(T,this))if(e.isHandlingMimeForPasting(a.type))return void e.paste(a,this.currentLayer);let n=t.getData("application/pdfjs");if(!n)return;try{n=JSON.parse(n)}catch(i){return void(0,a.warn)('paste: "'.concat(i.message,'".'))}if(!Array.isArray(n))return;this.unselectAll();const r=this.currentLayer;try{const e=[];for(const i of n){const t=r.deserialize(i);if(!t)return;e.push(t)}const t=()=>{for(const t of e)_assertClassBrand(re,this,me).call(this,t);_assertClassBrand(re,this,ve).call(this,e)},a=()=>{for(const t of e)t.remove()};this.addCommands({cmd:t,undo:a,mustExec:!0})}catch(i){(0,a.warn)('paste: "'.concat(i.message,'".'))}}keydown(e){var t;null!==(t=this.getActive())&&void 0!==t&&t.shouldGetKeyboardEvents()||ae._keyboardManager.exec(this,e)}onEditingAction(e){["undo","redo","delete","selectAll"].includes(e.name)&&this[e.name]()}setEditingState(e){e?(_assertClassBrand(re,this,ie).call(this),_assertClassBrand(re,this,le).call(this),_assertClassBrand(re,this,ce).call(this),_assertClassBrand(re,this,ue).call(this,{isEditing:_classPrivateFieldGet(G,this)!==a.AnnotationEditorType.NONE,isEmpty:_assertClassBrand(re,this,ge).call(this),hasSomethingToUndo:_classPrivateFieldGet(j,this).hasSomethingToUndo(),hasSomethingToRedo:_classPrivateFieldGet(j,this).hasSomethingToRedo(),hasSelectedEditor:!1})):(_assertClassBrand(re,this,se).call(this),_assertClassBrand(re,this,oe).call(this),_assertClassBrand(re,this,de).call(this),_assertClassBrand(re,this,ue).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!_classPrivateFieldGet(T,this)){_classPrivateFieldSet(T,this,e);for(const e of _classPrivateFieldGet(T,this))_assertClassBrand(re,this,he).call(this,e.defaultPropertiesToUpdate)}}getId(){return _classPrivateFieldGet(I,this).getId()}get currentLayer(){return _classPrivateFieldGet(C,this).get(_classPrivateFieldGet(E,this))}getLayer(e){return _classPrivateFieldGet(C,this).get(e)}get currentPageIndex(){return _classPrivateFieldGet(E,this)}addLayer(e){_classPrivateFieldGet(C,this).set(e.pageIndex,e),_classPrivateFieldGet(L,this)?e.enable():e.disable()}removeLayer(e){_classPrivateFieldGet(C,this).delete(e.pageIndex)}updateMode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(_classPrivateFieldGet(G,this)!==e){if(_classPrivateFieldSet(G,this,e),e===a.AnnotationEditorType.NONE)return this.setEditingState(!1),void _assertClassBrand(re,this,pe).call(this);this.setEditingState(!0),_assertClassBrand(re,this,fe).call(this),this.unselectAll();for(const t of _classPrivateFieldGet(C,this).values())t.updateMode(e);if(t)for(const e of _classPrivateFieldGet(P,this).values())if(e.annotationElementId===t){this.setSelected(e),e.enterInEditMode();break}}}updateToolbar(e){e!==_classPrivateFieldGet(G,this)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,t){if(_classPrivateFieldGet(T,this))if(e!==a.AnnotationEditorParamsType.CREATE){for(const n of _classPrivateFieldGet(B,this))n.updateParams(e,t);for(const n of _classPrivateFieldGet(T,this))n.updateDefaultParams(e,t)}else this.currentLayer.addNewEditor(e)}enableWaiting(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(_classPrivateFieldGet(O,this)!==e){_classPrivateFieldSet(O,this,e);for(const t of _classPrivateFieldGet(C,this).values())e?t.disableClick():t.enableClick(),t.div.classList.toggle("waiting",e)}}getEditors(e){const t=[];for(const n of _classPrivateFieldGet(P,this).values())n.pageIndex===e&&t.push(n);return t}getEditor(e){return _classPrivateFieldGet(P,this).get(e)}addEditor(e){_classPrivateFieldGet(P,this).set(e.id,e)}removeEditor(e){var t;_classPrivateFieldGet(P,this).delete(e.id),this.unselect(e),e.annotationElementId&&_classPrivateFieldGet(N,this).has(e.annotationElementId)||null===(t=_classPrivateFieldGet(k,this))||void 0===t||t.remove(e.id)}addDeletedAnnotationElement(e){_classPrivateFieldGet(N,this).add(e.annotationElementId),e.deleted=!0}isDeletedAnnotationElement(e){return _classPrivateFieldGet(N,this).has(e)}removeDeletedAnnotationElement(e){_classPrivateFieldGet(N,this).delete(e.annotationElementId),e.deleted=!1}setActiveEditor(e){_classPrivateFieldGet(S,this)!==e&&(_classPrivateFieldSet(S,this,e),e&&_assertClassBrand(re,this,he).call(this,e.propertiesToUpdate))}toggleSelected(e){if(_classPrivateFieldGet(B,this).has(e))return _classPrivateFieldGet(B,this).delete(e),e.unselect(),void _assertClassBrand(re,this,ue).call(this,{hasSelectedEditor:this.hasSelection});_classPrivateFieldGet(B,this).add(e),e.select(),_assertClassBrand(re,this,he).call(this,e.propertiesToUpdate),_assertClassBrand(re,this,ue).call(this,{hasSelectedEditor:!0})}setSelected(e){for(const t of _classPrivateFieldGet(B,this))t!==e&&t.unselect();_classPrivateFieldGet(B,this).clear(),_classPrivateFieldGet(B,this).add(e),e.select(),_assertClassBrand(re,this,he).call(this,e.propertiesToUpdate),_assertClassBrand(re,this,ue).call(this,{hasSelectedEditor:!0})}isSelected(e){return _classPrivateFieldGet(B,this).has(e)}unselect(e){e.unselect(),_classPrivateFieldGet(B,this).delete(e),_assertClassBrand(re,this,ue).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==_classPrivateFieldGet(B,this).size}undo(){_classPrivateFieldGet(j,this).undo(),_assertClassBrand(re,this,ue).call(this,{hasSomethingToUndo:_classPrivateFieldGet(j,this).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:_assertClassBrand(re,this,ge).call(this)})}redo(){_classPrivateFieldGet(j,this).redo(),_assertClassBrand(re,this,ue).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:_classPrivateFieldGet(j,this).hasSomethingToRedo(),isEmpty:_assertClassBrand(re,this,ge).call(this)})}addCommands(e){_classPrivateFieldGet(j,this).add(e),_assertClassBrand(re,this,ue).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:_assertClassBrand(re,this,ge).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const e=[..._classPrivateFieldGet(B,this)];this.addCommands({cmd:()=>{for(const t of e)t.remove()},undo:()=>{for(const t of e)_assertClassBrand(re,this,me).call(this,t)},mustExec:!0})}commitOrRemove(){var e;null===(e=_classPrivateFieldGet(S,this))||void 0===e||e.commitOrRemove()}hasSomethingToControl(){return _classPrivateFieldGet(S,this)||this.hasSelection}selectAll(){for(const e of _classPrivateFieldGet(B,this))e.commit();_assertClassBrand(re,this,ve).call(this,_classPrivateFieldGet(P,this).values())}unselectAll(){if(_classPrivateFieldGet(S,this))_classPrivateFieldGet(S,this).commitOrRemove();else if(this.hasSelection){for(const e of _classPrivateFieldGet(B,this))e.unselect();_classPrivateFieldGet(B,this).clear(),_assertClassBrand(re,this,ue).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,t){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove(),!this.hasSelection)return;_classPrivateFieldGet($,this)[0]+=e,_classPrivateFieldGet($,this)[1]+=t;const[n,r]=_classPrivateFieldGet($,this),a=[..._classPrivateFieldGet(B,this)];_classPrivateFieldGet(ee,this)&&clearTimeout(_classPrivateFieldGet(ee,this)),_classPrivateFieldSet(ee,this,setTimeout((()=>{_classPrivateFieldSet(ee,this,null),_classPrivateFieldGet($,this)[0]=_classPrivateFieldGet($,this)[1]=0,this.addCommands({cmd:()=>{for(const e of a)_classPrivateFieldGet(P,this).has(e.id)&&e.translateInPage(n,r)},undo:()=>{for(const e of a)_classPrivateFieldGet(P,this).has(e.id)&&e.translateInPage(-n,-r)},mustExec:!1})}),1e3));for(const i of a)i.translateInPage(e,t)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),_classPrivateFieldSet(F,this,new Map);for(const e of _classPrivateFieldGet(B,this))_classPrivateFieldGet(F,this).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!_classPrivateFieldGet(F,this))return!1;this.disableUserSelect(!1);const e=_classPrivateFieldGet(F,this);_classPrivateFieldSet(F,this,null);let t=!1;for(const[{x:r,y:a,pageIndex:i},s]of e)s.newX=r,s.newY=a,s.newPageIndex=i,t||(t=r!==s.savedX||a!==s.savedY||i!==s.savedPageIndex);if(!t)return!1;const n=(e,t,n,r)=>{if(_classPrivateFieldGet(P,this).has(e.id)){const a=_classPrivateFieldGet(C,this).get(r);a?e._setParentAndPosition(a,t,n):(e.pageIndex=r,e.x=t,e.y=n)}};return this.addCommands({cmd:()=>{for(const[t,{newX:r,newY:a,newPageIndex:i}]of e)n(t,r,a,i)},undo:()=>{for(const[t,{savedX:r,savedY:a,savedPageIndex:i}]of e)n(t,r,a,i)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(_classPrivateFieldGet(F,this))for(const n of _classPrivateFieldGet(F,this).keys())n.drag(e,t)}rebuild(e){if(null===e.parent){const t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}isActive(e){return _classPrivateFieldGet(S,this)===e}getActive(){return _classPrivateFieldGet(S,this)}getMode(){return _classPrivateFieldGet(G,this)}get imageManager(){return(0,a.shadow)(this,"imageManager",new h)}}function ie(){window.addEventListener("focus",_classPrivateFieldGet(U,this)),window.addEventListener("blur",_classPrivateFieldGet(W,this))}function se(){window.removeEventListener("focus",_classPrivateFieldGet(U,this)),window.removeEventListener("blur",_classPrivateFieldGet(W,this))}function le(){window.addEventListener("keydown",_classPrivateFieldGet(X,this),{capture:!0})}function oe(){window.removeEventListener("keydown",_classPrivateFieldGet(X,this),{capture:!0})}function ce(){document.addEventListener("copy",_classPrivateFieldGet(H,this)),document.addEventListener("cut",_classPrivateFieldGet(q,this)),document.addEventListener("paste",_classPrivateFieldGet(V,this))}function de(){document.removeEventListener("copy",_classPrivateFieldGet(H,this)),document.removeEventListener("cut",_classPrivateFieldGet(q,this)),document.removeEventListener("paste",_classPrivateFieldGet(V,this))}function ue(e){Object.entries(e).some((e=>{let[t,n]=e;return _classPrivateFieldGet(Z,this)[t]!==n}))&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(_classPrivateFieldGet(Z,this),e)})}function he(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})}function fe(){if(!_classPrivateFieldGet(L,this)){_classPrivateFieldSet(L,this,!0);for(const e of _classPrivateFieldGet(C,this).values())e.enable()}}function pe(){if(this.unselectAll(),_classPrivateFieldGet(L,this)){_classPrivateFieldSet(L,this,!1);for(const e of _classPrivateFieldGet(C,this).values())e.disable()}}function me(e){const t=_classPrivateFieldGet(C,this).get(e.pageIndex);t?t.addOrRebuild(e):this.addEditor(e)}function ge(){if(0===_classPrivateFieldGet(P,this).size)return!0;if(1===_classPrivateFieldGet(P,this).size)for(const e of _classPrivateFieldGet(P,this).values())return e.isEmpty();return!1}function ve(e){_classPrivateFieldGet(B,this).clear();for(const t of e)t.isEmpty()||(_classPrivateFieldGet(B,this).add(t),t.select());_assertClassBrand(re,this,ue).call(this,{hasSelectedEditor:!0})}_defineProperty(ae,"TRANSLATE_SMALL",1),_defineProperty(ae,"TRANSLATE_BIG",10),t.AnnotationEditorUIManager=ae},(e,t,n)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.StatTimer=t.RenderingCancelledException=t.PixelsPerInch=t.PageViewport=t.PDFDateString=t.DOMStandardFontDataFactory=t.DOMSVGFactory=t.DOMFilterFactory=t.DOMCanvasFactory=t.DOMCMapReaderFactory=void 0,t.deprecated=function(e){console.log("Deprecated API usage: "+e)},t.getColorValues=function(e){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const n of e.keys()){t.style.color=n;const r=window.getComputedStyle(t).color;e.set(n,D(r))}t.remove()},t.getCurrentTransform=function(e){const{a:t,b:n,c:r,d:a,e:i,f:s}=e.getTransform();return[t,n,r,a,i,s]},t.getCurrentTransformInverse=function(e){const{a:t,b:n,c:r,d:a,e:i,f:s}=e.getTransform().invertSelf();return[t,n,r,a,i,s]},t.getFilenameFromUrl=function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]||([e]=e.split(/[#?]/,1)),e.substring(e.lastIndexOf("/")+1)},t.getPdfFilenameFromUrl=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!==typeof e)return t;if(I(e))return(0,i.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const n=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,r=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(e);let a=n.exec(r[1])||n.exec(r[2])||n.exec(r[3]);if(a&&(a=a[0],a.includes("%")))try{a=n.exec(decodeURIComponent(a))[0]}catch{}return a||t},t.getRGB=D,t.getXfaPageViewport=function(e,t){let{scale:n=1,rotation:r=0}=t;const{width:a,height:i}=e.attributes.style,s=[0,0,parseInt(a),parseInt(i)];return new M({viewBox:s,scale:n,rotation:r})},t.isDataScheme=I,t.isPdfFile=function(e){return"string"===typeof e&&/\.pdf$/i.test(e)},t.isValidFetchUrl=L,t.loadScript=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise(((n,r)=>{const a=document.createElement("script");a.src=e,a.onload=function(e){t&&a.remove(),n(e)},a.onerror=function(){r(new Error("Cannot load script at: ".concat(a.src)))},(document.head||document.documentElement).append(a)}))},t.noContextMenu=function(e){e.preventDefault()},t.setLayerDimensions=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(t instanceof M){const{pageWidth:r,pageHeight:a}=t.rawDims,{style:s}=e,l=i.FeatureTest.isCSSRoundSupported,o="var(--scale-factor) * ".concat(r,"px"),c="var(--scale-factor) * ".concat(a,"px"),d=l?"round(".concat(o,", 1px)"):"calc(".concat(o,")"),u=l?"round(".concat(c,", 1px)"):"calc(".concat(c,")");n&&t.rotation%180!==0?(s.width=u,s.height=d):(s.width=d,s.height=u)}r&&e.setAttribute("data-main-rotation",t.rotation)};var a=n(7),i=n(1);const s="http://www.w3.org/2000/svg";class l{}r=l,_defineProperty(l,"CSS",96),_defineProperty(l,"PDF",72),_defineProperty(l,"PDF_TO_CSS_UNITS",r.CSS/r.PDF),t.PixelsPerInch=l;var o=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,h=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,g=new WeakMap,v=new WeakMap,x=new WeakMap,b=new WeakSet;class y extends a.BaseFilterFactory{constructor(){let{docId:e,ownerDocument:t=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),_classPrivateMethodInitSpec(this,b),_classPrivateFieldInitSpec(this,o,void 0),_classPrivateFieldInitSpec(this,c,void 0),_classPrivateFieldInitSpec(this,d,void 0),_classPrivateFieldInitSpec(this,u,void 0),_classPrivateFieldInitSpec(this,h,void 0),_classPrivateFieldInitSpec(this,f,void 0),_classPrivateFieldInitSpec(this,p,void 0),_classPrivateFieldInitSpec(this,m,void 0),_classPrivateFieldInitSpec(this,g,void 0),_classPrivateFieldInitSpec(this,v,void 0),_classPrivateFieldInitSpec(this,x,0),_classPrivateFieldSet(d,this,e),_classPrivateFieldSet(u,this,t)}addFilter(e){var t,n;if(!e)return"none";let r,a,i,s,l=_classPrivateGetter(b,this,w).get(e);if(l)return l;if(1===e.length){const t=e[0],n=new Array(256);for(let e=0;e<256;e++)n[e]=t[e]/255;s=r=a=i=n.join(",")}else{const[t,n,l]=e,o=new Array(256),c=new Array(256),d=new Array(256);for(let e=0;e<256;e++)o[e]=t[e]/255,c[e]=n[e]/255,d[e]=l[e]/255;r=o.join(","),a=c.join(","),i=d.join(","),s="".concat(r).concat(a).concat(i)}if(l=_classPrivateGetter(b,this,w).get(s),l)return _classPrivateGetter(b,this,w).set(e,l),l;const o="g_".concat(_classPrivateFieldGet(d,this),"_transfer_map_").concat((_classPrivateFieldSet(x,this,(t=_classPrivateFieldGet(x,this),n=t++,t)),n)),c="url(#".concat(o,")");_classPrivateGetter(b,this,w).set(e,c),_classPrivateGetter(b,this,w).set(s,c);const u=_assertClassBrand(b,this,P).call(this,o);return _assertClassBrand(b,this,A).call(this,r,a,i,u),c}addHCMFilter(e,t){var n;const r="".concat(e,"-").concat(t);if(_classPrivateFieldGet(f,this)===r)return _classPrivateFieldGet(p,this);if(_classPrivateFieldSet(f,this,r),_classPrivateFieldSet(p,this,"none"),null===(n=_classPrivateFieldGet(h,this))||void 0===n||n.remove(),!e||!t)return _classPrivateFieldGet(p,this);const a=_assertClassBrand(b,this,k).call(this,e);e=i.Util.makeHexColor(...a);const s=_assertClassBrand(b,this,k).call(this,t);if(t=i.Util.makeHexColor(...s),_classPrivateGetter(b,this,_).style.color="","#000000"===e&&"#ffffff"===t||e===t)return _classPrivateFieldGet(p,this);const l=new Array(256);for(let i=0;i<=255;i++){const e=i/255;l[i]=e<=.03928?e/12.92:((e+.055)/1.055)**2.4}const o=l.join(","),c="g_".concat(_classPrivateFieldGet(d,this),"_hcm_filter"),u=_classPrivateFieldSet(m,this,_assertClassBrand(b,this,P).call(this,c));_assertClassBrand(b,this,A).call(this,o,o,o,u),_assertClassBrand(b,this,S).call(this,u);const g=(e,t)=>{const n=a[e]/255,r=s[e]/255,i=new Array(t+1);for(let a=0;a<=t;a++)i[a]=n+a/t*(r-n);return i.join(",")};return _assertClassBrand(b,this,A).call(this,g(0,5),g(1,5),g(2,5),u),_classPrivateFieldSet(p,this,"url(#".concat(c,")")),_classPrivateFieldGet(p,this)}addHighlightHCMFilter(e,t,n,r){var a;const i="".concat(e,"-").concat(t,"-").concat(n,"-").concat(r);if(_classPrivateFieldGet(g,this)===i)return _classPrivateFieldGet(v,this);if(_classPrivateFieldSet(g,this,i),_classPrivateFieldSet(v,this,"none"),null===(a=_classPrivateFieldGet(m,this))||void 0===a||a.remove(),!e||!t)return _classPrivateFieldGet(v,this);const[s,l]=[e,t].map(_assertClassBrand(b,this,k).bind(this));let o=Math.round(.2126*s[0]+.7152*s[1]+.0722*s[2]),c=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),[u,h]=[n,r].map(_assertClassBrand(b,this,k).bind(this));c{const r=new Array(256),a=(c-o)/n,i=e/255,s=(t-e)/(255*n);let l=0;for(let c=0;c<=n;c++){const e=Math.round(o+c*a),t=i+c*s;for(let n=l;n<=e;n++)r[n]=t;l=e+1}for(let o=l;o<256;o++)r[o]=r[l-1];return r.join(",")},p="g_".concat(_classPrivateFieldGet(d,this),"_hcm_highlight_filter"),x=_classPrivateFieldSet(m,this,_assertClassBrand(b,this,P).call(this,p));return _assertClassBrand(b,this,S).call(this,x),_assertClassBrand(b,this,A).call(this,f(u[0],h[0],5),f(u[1],h[1],5),f(u[2],h[2],5),x),_classPrivateFieldSet(v,this,"url(#".concat(p,")")),_classPrivateFieldGet(v,this)}destroy(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(_classPrivateFieldGet(p,this)||_classPrivateFieldGet(v,this))||(_classPrivateFieldGet(c,this)&&(_classPrivateFieldGet(c,this).parentNode.parentNode.remove(),_classPrivateFieldSet(c,this,null)),_classPrivateFieldGet(o,this)&&(_classPrivateFieldGet(o,this).clear(),_classPrivateFieldSet(o,this,null)),_classPrivateFieldSet(x,this,0))}}function w(e){return _classPrivateFieldGet(o,e)||_classPrivateFieldSet(o,e,new Map)}function _(e){if(!_classPrivateFieldGet(c,e)){const t=_classPrivateFieldGet(u,e).createElement("div"),{style:n}=t;n.visibility="hidden",n.contain="strict",n.width=n.height=0,n.position="absolute",n.top=n.left=0,n.zIndex=-1;const r=_classPrivateFieldGet(u,e).createElementNS(s,"svg");r.setAttribute("width",0),r.setAttribute("height",0),_classPrivateFieldSet(c,e,_classPrivateFieldGet(u,e).createElementNS(s,"defs")),t.append(r),r.append(_classPrivateFieldGet(c,e)),_classPrivateFieldGet(u,e).body.append(t)}return _classPrivateFieldGet(c,e)}function S(e){const t=_classPrivateFieldGet(u,this).createElementNS(s,"feColorMatrix");t.setAttribute("type","matrix"),t.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),e.append(t)}function P(e){const t=_classPrivateFieldGet(u,this).createElementNS(s,"filter");return t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("id",e),_classPrivateGetter(b,this,_).append(t),t}function C(e,t,n){const r=_classPrivateFieldGet(u,this).createElementNS(s,t);r.setAttribute("type","discrete"),r.setAttribute("tableValues",n),e.append(r)}function A(e,t,n,r){const a=_classPrivateFieldGet(u,this).createElementNS(s,"feComponentTransfer");r.append(a),_assertClassBrand(b,this,C).call(this,a,"feFuncR",e),_assertClassBrand(b,this,C).call(this,a,"feFuncG",t),_assertClassBrand(b,this,C).call(this,a,"feFuncB",n)}function k(e){return _classPrivateGetter(b,this,_).style.color=e,D(getComputedStyle(_classPrivateGetter(b,this,_)).getPropertyValue("color"))}t.DOMFilterFactory=y;class j extends a.BaseCanvasFactory{constructor(){let{ownerDocument:e=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._document=e}_createCanvas(e,t){const n=this._document.createElement("canvas");return n.width=e,n.height=t,n}}async function E(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(L(e,document.baseURI)){const n=await fetch(e);if(!n.ok)throw new Error(n.statusText);return t?new Uint8Array(await n.arrayBuffer()):(0,i.stringToBytes)(await n.text())}return new Promise(((n,r)=>{const a=new XMLHttpRequest;a.open("GET",e,!0),t&&(a.responseType="arraybuffer"),a.onreadystatechange=()=>{if(a.readyState===XMLHttpRequest.DONE){if(200===a.status||0===a.status){let e;if(t&&a.response?e=new Uint8Array(a.response):!t&&a.responseText&&(e=(0,i.stringToBytes)(a.responseText)),e)return void n(e)}r(new Error(a.statusText))}},a.send(null)}))}t.DOMCanvasFactory=j;class N extends a.BaseCMapReaderFactory{_fetchData(e,t){return E(e,this.isCompressed).then((e=>({cMapData:e,compressionType:t})))}}t.DOMCMapReaderFactory=N;class F extends a.BaseStandardFontDataFactory{_fetchData(e){return E(e,!0)}}t.DOMStandardFontDataFactory=F;class T extends a.BaseSVGFactory{_createSVG(e){return document.createElementNS(s,e)}}t.DOMSVGFactory=T;class M{constructor(e){let{viewBox:t,scale:n,rotation:r,offsetX:a=0,offsetY:i=0,dontFlip:s=!1}=e;this.viewBox=t,this.scale=n,this.rotation=r,this.offsetX=a,this.offsetY=i;const l=(t[2]+t[0])/2,o=(t[3]+t[1])/2;let c,d,u,h,f,p,m,g;switch(r%=360,r<0&&(r+=360),r){case 180:c=-1,d=0,u=0,h=1;break;case 90:c=0,d=1,u=1,h=0;break;case 270:c=0,d=-1,u=-1,h=0;break;case 0:c=1,d=0,u=0,h=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}s&&(u=-u,h=-h),0===c?(f=Math.abs(o-t[1])*n+a,p=Math.abs(l-t[0])*n+i,m=(t[3]-t[1])*n,g=(t[2]-t[0])*n):(f=Math.abs(l-t[0])*n+a,p=Math.abs(o-t[1])*n+i,m=(t[2]-t[0])*n,g=(t[3]-t[1])*n),this.transform=[c*n,d*n,u*n,h*n,f-c*n*l-u*n*o,p-d*n*l-h*n*o],this.width=m,this.height=g}get rawDims(){const{viewBox:e}=this;return(0,i.shadow)(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone(){let{scale:e=this.scale,rotation:t=this.rotation,offsetX:n=this.offsetX,offsetY:r=this.offsetY,dontFlip:a=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new M({viewBox:this.viewBox.slice(),scale:e,rotation:t,offsetX:n,offsetY:r,dontFlip:a})}convertToViewportPoint(e,t){return i.Util.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){const t=i.Util.applyTransform([e[0],e[1]],this.transform),n=i.Util.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],n[0],n[1]]}convertToPdfPoint(e,t){return i.Util.applyInverseTransform([e,t],this.transform)}}t.PageViewport=M;class R extends i.BaseException{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(e,"RenderingCancelledException"),this.extraDelay=t}}function I(e){const t=e.length;let n=0;for(;n>16,(65280&t)>>8,255&t]}return e.startsWith("rgb(")?e.slice(4,-1).split(",").map((e=>parseInt(e))):e.startsWith("rgba(")?e.slice(5,-1).split(",").map((e=>parseInt(e))).slice(0,3):((0,i.warn)('Not a valid color format: "'.concat(e,'"')),[0,0,0])}t.RenderingCancelledException=R,t.StatTimer=class{constructor(){_defineProperty(this,"started",Object.create(null)),_defineProperty(this,"times",[])}time(e){e in this.started&&(0,i.warn)("Timer is already running for ".concat(e)),this.started[e]=Date.now()}timeEnd(e){e in this.started||(0,i.warn)("Timer has not been started for ".concat(e)),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let t=0;for(const{name:n}of this.times)t=Math.max(n.length,t);for(const{name:n,start:r,end:a}of this.times)e.push("".concat(n.padEnd(t)," ").concat(a-r,"ms\n"));return e.join("")}},t.PDFDateString=class{static toDateObject(e){if(!e||"string"!==typeof e)return null;O||(O=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const t=O.exec(e);if(!t)return null;const n=parseInt(t[1],10);let r=parseInt(t[2],10);r=r>=1&&r<=12?r-1:0;let a=parseInt(t[3],10);a=a>=1&&a<=31?a:1;let i=parseInt(t[4],10);i=i>=0&&i<=23?i:0;let s=parseInt(t[5],10);s=s>=0&&s<=59?s:0;let l=parseInt(t[6],10);l=l>=0&&l<=59?l:0;const o=t[7]||"Z";let c=parseInt(t[8],10);c=c>=0&&c<=23?c:0;let d=parseInt(t[9],10)||0;return d=d>=0&&d<=59?d:0,"-"===o?(i+=c,s+=d):"+"===o&&(i-=c,s-=d),new Date(Date.UTC(n,r,a,i,s,l))}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseStandardFontDataFactory=t.BaseSVGFactory=t.BaseFilterFactory=t.BaseCanvasFactory=t.BaseCMapReaderFactory=void 0;var r=n(1);class a{constructor(){this.constructor===a&&(0,r.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addHighlightHCMFilter(e,t,n,r){return"none"}destroy(){}}t.BaseFilterFactory=a;class i{constructor(){this.constructor===i&&(0,r.unreachable)("Cannot initialize BaseCanvasFactory.")}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const n=this._createCanvas(e,t);return{canvas:n,context:n.getContext("2d")}}reset(e,t,n){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||n<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=n}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){(0,r.unreachable)("Abstract method `_createCanvas` called.")}}t.BaseCanvasFactory=i;class s{constructor(e){let{baseUrl:t=null,isCompressed:n=!0}=e;this.constructor===s&&(0,r.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=t,this.isCompressed=n}async fetch(e){let{name:t}=e;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!t)throw new Error("CMap name must be specified.");const n=this.baseUrl+t+(this.isCompressed?".bcmap":""),a=this.isCompressed?r.CMapCompressionType.BINARY:r.CMapCompressionType.NONE;return this._fetchData(n,a).catch((e=>{throw new Error("Unable to load ".concat(this.isCompressed?"binary ":"","CMap at: ").concat(n))}))}_fetchData(e,t){(0,r.unreachable)("Abstract method `_fetchData` called.")}}t.BaseCMapReaderFactory=s;class l{constructor(e){let{baseUrl:t=null}=e;this.constructor===l&&(0,r.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=t}async fetch(e){let{filename:t}=e;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!t)throw new Error("Font filename must be specified.");const n="".concat(this.baseUrl).concat(t);return this._fetchData(n).catch((e=>{throw new Error("Unable to load font data at: ".concat(n))}))}_fetchData(e){(0,r.unreachable)("Abstract method `_fetchData` called.")}}t.BaseStandardFontDataFactory=l;class o{constructor(){this.constructor===o&&(0,r.unreachable)("Cannot initialize BaseSVGFactory.")}create(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const r=this._createSVG("svg:svg");return r.setAttribute("version","1.1"),n||(r.setAttribute("width","".concat(e,"px")),r.setAttribute("height","".concat(t,"px"))),r.setAttribute("preserveAspectRatio","none"),r.setAttribute("viewBox","0 0 ".concat(e," ").concat(t)),r}createElement(e){if("string"!==typeof e)throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){(0,r.unreachable)("Abstract method `_createSVG` called.")}}t.BaseSVGFactory=o},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MurmurHash3_64=void 0;var r=n(1);const a=3285377520,i=4294901760,s=65535;t.MurmurHash3_64=class{constructor(e){this.h1=e?4294967295&e:a,this.h2=e?4294967295&e:a}update(e){let t,n;if("string"===typeof e){t=new Uint8Array(2*e.length),n=0;for(let r=0,a=e.length;r>>8,t[n++]=255&a)}}else{if(!(0,r.isArrayBuffer)(e))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");t=e.slice(),n=t.byteLength}const a=n>>2,l=n-4*a,o=new Uint32Array(t.buffer,0,a);let c=0,d=0,u=this.h1,h=this.h2;const f=3432918353,p=461845907,m=11601,g=13715;for(let r=0;r>>17,c=c*p&i|c*g&s,u^=c,u=u<<13|u>>>19,u=5*u+3864292196):(d=o[r],d=d*f&i|d*m&s,d=d<<15|d>>>17,d=d*p&i|d*g&s,h^=d,h=h<<13|h>>>19,h=5*h+3864292196);switch(c=0,l){case 3:c^=t[4*a+2]<<16;case 2:c^=t[4*a+1]<<8;case 1:c^=t[4*a],c=c*f&i|c*m&s,c=c<<15|c>>>17,c=c*p&i|c*g&s,1&a?u^=c:h^=c}this.h1=u,this.h2=h}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=3981806797*e&i|36045*e&s,t=4283543511*t&i|(2950163797*(t<<16|e>>>16)&i)>>>16,e^=t>>>1,e=444984403*e&i|60499*e&s,t=3301882366*t&i|(3120437893*(t<<16|e>>>16)&i)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FontLoader=t.FontFaceObject=void 0;var r=n(1),a=new WeakMap;t.FontLoader=class{constructor(e){let{ownerDocument:t=globalThis.document,styleElement:n=null}=e;_classPrivateFieldInitSpec(this,a,new Set),this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),_classPrivateFieldGet(a,this).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(e){if(e&&!_classPrivateFieldGet(a,this).has(e.loadedName))if((0,r.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:t,src:n,style:i}=e,s=new FontFace(t,n,i);this.addNativeFontFace(s);try{await s.load(),_classPrivateFieldGet(a,this).add(t)}catch{(0,r.warn)("Cannot load system font: ".concat(e.baseFontName,", installing it could help to improve PDF rendering.")),this.removeNativeFontFace(s)}}else(0,r.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo)return void await this.loadSystemFont(e.systemFontInfo);if(this.isFontLoadingAPISupported){const t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(n){throw(0,r.warn)("Failed to load font '".concat(t.family,"': '").concat(n,"'.")),e.disableFontFace=!0,n}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise((t=>{const n=this._queueLoadingCallback(t);this._prepareFontLoadEvent(e,n)}))}}get isFontLoadingAPISupported(){var e;const t=!(null===(e=this._document)||void 0===e||!e.fonts);return(0,r.shadow)(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let e=!1;return(r.isNodeJS||"undefined"!==typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),(0,r.shadow)(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){const{loadingRequests:t}=this,n={done:!1,complete:function(){for((0,r.assert)(!n.done,"completeRequest() cannot be called twice."),n.done=!0;t.length>0&&t[0].done;){const e=t.shift();setTimeout(e.callback,0)}},callback:e};return t.push(n),n}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,r.shadow)(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,t){function n(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function a(e,t,n,r){return e.substring(0,t)+r+e.substring(t+n)}let i,s;const l=this._document.createElement("canvas");l.width=1,l.height=1;const o=l.getContext("2d");let c=0;const d="lt".concat(Date.now()).concat(this.loadTestFontId++);let u=this._loadTestFont;u=a(u,976,d.length,d);const h=1482184792;let f=n(u,16);for(i=0,s=d.length-3;i30)return(0,r.warn)("Load test font never loaded."),void n();o.font="30px "+t,o.fillText(".",0,20),o.getImageData(0,0,1,1).data[3]>0?n():setTimeout(e.bind(null,t,n))}(d,(()=>{g.remove(),t.complete()}))}},t.FontFaceObject=class{constructor(e,t){let{isEvalSupported:n=!0,disableFontFace:r=!1,ignoreErrors:a=!1,inspectFont:i=null}=t;this.compiledGlyphs=Object.create(null);for(const s in e)this[s]=e[s];this.isEvalSupported=!1!==n,this.disableFontFace=!0===r,this.ignoreErrors=!0===a,this._inspectFont=i}createNativeFontFace(){var e;if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style="oblique ".concat(this.cssFontInfo.italicAngle,"deg")),t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});return null===(e=this._inspectFont)||void 0===e||e.call(this,this),t}createFontFaceRule(){var e;if(!this.data||this.disableFontFace)return null;const t=(0,r.bytesToString)(this.data),n="url(data:".concat(this.mimetype,";base64,").concat(btoa(t),");");let a;if(this.cssFontInfo){let e="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(e+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;")),a='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(e,"src:").concat(n,"}")}else a='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(n,"}");return null===(e=this._inspectFont)||void 0===e||e.call(this,this,n),a}getPathGenerator(e,t){if(void 0!==this.compiledGlyphs[t])return this.compiledGlyphs[t];let n;try{n=e.get(this.loadedName+"_path_"+t)}catch(a){if(!this.ignoreErrors)throw a;return(0,r.warn)('getPathGenerator - ignoring character: "'.concat(a,'".')),this.compiledGlyphs[t]=function(e,t){}}if(this.isEvalSupported&&r.FeatureTest.isEvalSupported){const e=[];for(const t of n){const n=void 0!==t.args?t.args.join(","):"";e.push("c.",t.cmd,"(",n,");\n")}return this.compiledGlyphs[t]=new Function("c","size",e.join(""))}return this.compiledGlyphs[t]=function(e,t){for(const r of n)"scale"===r.cmd&&(r.args=[t,-t]),e[r.cmd].apply(e,r.args)}}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStandardFontDataFactory=t.NodeFilterFactory=t.NodeCanvasFactory=t.NodeCMapReaderFactory=void 0;var r=n(7);n(1);const a=function(e){return new Promise(((t,n)=>{__webpack_require__(3237).readFile(e,((e,r)=>{!e&&r?t(new Uint8Array(r)):n(new Error(e))}))}))};class i extends r.BaseFilterFactory{}t.NodeFilterFactory=i;class s extends r.BaseCanvasFactory{_createCanvas(e,t){return __webpack_require__(7640).createCanvas(e,t)}}t.NodeCanvasFactory=s;class l extends r.BaseCMapReaderFactory{_fetchData(e,t){return a(e).then((e=>({cMapData:e,compressionType:t})))}}t.NodeCMapReaderFactory=l;class o extends r.BaseStandardFontDataFactory{_fetchData(e){return a(e)}}t.NodeStandardFontDataFactory=o},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasGraphics=void 0;var r=n(1),a=n(6),i=n(12),s=n(13);const l=4096,o=16;class c{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,n){let r;return void 0!==this.cache[e]?(r=this.cache[e],this.canvasFactory.reset(r,t,n)):(r=this.canvasFactory.create(t,n),this.cache[e]=r),r}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}}function d(e,t,n,r,i,s,l,o,c,d){const[u,h,f,p,m,g]=(0,a.getCurrentTransform)(e);if(0===h&&0===f){const a=l*u+m,v=Math.round(a),x=o*p+g,b=Math.round(x),y=(l+c)*u+m,w=Math.abs(Math.round(y)-v)||1,_=(o+d)*p+g,S=Math.abs(Math.round(_)-b)||1;return e.setTransform(Math.sign(u),0,0,Math.sign(p),v,b),e.drawImage(t,n,r,i,s,0,0,w,S),e.setTransform(u,h,f,p,m,g),[w,S]}if(0===u&&0===p){const a=o*f+m,v=Math.round(a),x=l*h+g,b=Math.round(x),y=(o+d)*f+m,w=Math.abs(Math.round(y)-v)||1,_=(l+c)*h+g,S=Math.abs(Math.round(_)-b)||1;return e.setTransform(0,Math.sign(h),Math.sign(f),0,v,b),e.drawImage(t,n,r,i,s,0,0,S,w),e.setTransform(u,h,f,p,m,g),[S,w]}return e.drawImage(t,n,r,i,s,l,o,c,d),[Math.hypot(u,h)*c,Math.hypot(f,p)*d]}class u{constructor(e,t){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=r.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=r.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=r.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,e,t])}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,t){this.x=e,this.y=t}updatePathMinMax(e,t,n){[t,n]=r.Util.applyTransform([t,n],e),this.minX=Math.min(this.minX,t),this.minY=Math.min(this.minY,n),this.maxX=Math.max(this.maxX,t),this.maxY=Math.max(this.maxY,n)}updateRectMinMax(e,t){const n=r.Util.applyTransform(t,e),a=r.Util.applyTransform(t.slice(2),e);this.minX=Math.min(this.minX,n[0],a[0]),this.minY=Math.min(this.minY,n[1],a[1]),this.maxX=Math.max(this.maxX,n[0],a[0]),this.maxY=Math.max(this.maxY,n[1],a[1])}updateScalingPathMinMax(e,t){r.Util.scaleMinMax(e,t),this.minX=Math.min(this.minX,t[0]),this.maxX=Math.max(this.maxX,t[1]),this.minY=Math.min(this.minY,t[2]),this.maxY=Math.max(this.maxY,t[3])}updateCurvePathMinMax(e,t,n,a,i,s,l,o,c,d){const u=r.Util.bezierBoundingBox(t,n,a,i,s,l,o,c);if(d)return d[0]=Math.min(d[0],u[0],u[2]),d[1]=Math.max(d[1],u[0],u[2]),d[2]=Math.min(d[2],u[1],u[3]),void(d[3]=Math.max(d[3],u[1],u[3]));this.updateRectMinMax(e,u)}getPathBoundingBox(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.PathType.FILL,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=[this.minX,this.minY,this.maxX,this.maxY];if(e===i.PathType.STROKE){t||(0,r.unreachable)("Stroke bounding box must include transform.");const e=r.Util.singularValueDecompose2dScale(t),a=e[0]*this.lineWidth/2,i=e[1]*this.lineWidth/2;n[0]-=a,n[1]-=i,n[2]+=a,n[3]+=i}return n}updateClipFromPath(){const e=r.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.PathType.FILL,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return r.Util.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function h(e,t){if("undefined"!==typeof ImageData&&t instanceof ImageData)return void e.putImageData(t,0,0);const n=t.height,a=t.width,i=n%o,s=(n-i)/o,l=0===i?s:s+1,c=e.createImageData(a,o);let d,u=0;const h=t.data,f=c.data;let p,m,g,v;if(t.kind===r.ImageKind.GRAYSCALE_1BPP){const t=h.byteLength,n=new Uint32Array(f.buffer,0,f.byteLength>>2),v=n.length,x=a+7>>3,b=4294967295,y=r.FeatureTest.isLittleEndian?4278190080:255;for(p=0;px?a:8*e-7,s=-8&i;let l=0,o=0;for(;r>=1}for(;d=s&&(g=i,v=a*g),d=0,m=v;m--;)f[d++]=h[u++],f[d++]=h[u++],f[d++]=h[u++],f[d++]=255;e.putImageData(c,0,p*o)}}}function f(e,t){if(t.bitmap)return void e.drawImage(t.bitmap,0,0);const n=t.height,r=t.width,a=n%o,i=(n-a)/o,l=0===a?i:i+1,c=e.createImageData(r,o);let d=0;const u=t.data,h=c.data;for(let f=0;f>8,e[i-2]=e[i-2]*a+n*s>>8,e[i-1]=e[i-1]*a+r*s>>8}}}function v(e,t,n){const r=e.length,a=1/255;for(let i=3;i>8]>>8:t[a]*r>>16}}function b(e,t,n,r){const a=r[0],i=r[1],s=r[2]-a,l=r[3]-i;0!==s&&0!==l&&(function(e,t,n,r,a,i,s,l,o,c,d){const u=!!i,h=u?i[0]:0,f=u?i[1]:0,p=u?i[2]:0,m="Luminosity"===a?x:v,b=Math.min(r,Math.ceil(1048576/n));for(let v=0;v1&&void 0!==arguments[1]?arguments[1]:null;return"string"===typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}beginDrawing(e){let{transform:t,viewport:n,transparency:r=!1,background:i=null}=e;const s=this.ctx.canvas.width,l=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,s,l),this.ctx.fillStyle=o,r){const e=this.cachedCanvases.getCanvas("transparent",s,l);this.compositeCtx=this.ctx,this.transparentCanvas=e.canvas,this.ctx=e.context,this.ctx.save(),this.ctx.transform(...(0,a.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),m(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...n.transform),this.viewportScale=n.scale,this.baseTransform=(0,a.getCurrentTransform)(this.ctx)}executeOperatorList(e,t,n,a){const i=e.argsArray,s=e.fnArray;let l=t||0;const o=i.length;if(o===l)return l;const c=o-l>10&&"function"===typeof n,d=c?Date.now()+15:0;let u=0;const h=this.commonObjs,f=this.objs;let p;for(;;){if(void 0!==a&&l===a.nextBreakPoint)return a.breakIt(l,n),l;if(p=s[l],p!==r.OPS.dependency)this[p].apply(this,i[l]);else for(const e of i[l]){const t=e.startsWith("g_")?h:f;if(!t.has(e))return t.get(e,n),l}if(l++,l===o)return l;if(c&&++u>10){if(Date.now()>d)return n(),l;u=0}}}endDrawing(){_assertClassBrand(C,this,k).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const t of e.values())"undefined"!==typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),_assertClassBrand(C,this,j).call(this)}_scaleImage(e,t){const n=e.width,r=e.height;let a,i,s=Math.max(Math.hypot(t[0],t[1]),1),l=Math.max(Math.hypot(t[2],t[3]),1),o=n,c=r,d="prescale1";for(;s>2&&o>1||l>2&&c>1;){let t=o,n=c;s>2&&o>1&&(t=o>=16384?Math.floor(o/2)-1||1:Math.ceil(o/2),s/=o/t),l>2&&c>1&&(n=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,l/=c/n),a=this.cachedCanvases.getCanvas(d,t,n),i=a.context,i.clearRect(0,0,t,n),i.drawImage(e,0,0,o,c,0,0,t,n),e=a.canvas,o=t,c=n,d="prescale1"===d?"prescale2":"prescale1"}return{img:e,paintWidth:o,paintHeight:c}}_createMaskCanvas(e){const t=this.ctx,{width:n,height:s}=e,l=this.current.fillColor,o=this.current.patternFill,c=(0,a.getCurrentTransform)(t);let u,h,p,m;if((e.bitmap||e.data)&&e.count>1){const t=e.bitmap||e.data.buffer;h=JSON.stringify(o?c:[c.slice(0,4),l]),u=this._cachedBitmapsMap.get(t),u||(u=new Map,this._cachedBitmapsMap.set(t,u));const n=u.get(h);if(n&&!o)return{canvas:n,offsetX:Math.round(Math.min(c[0],c[2])+c[4]),offsetY:Math.round(Math.min(c[1],c[3])+c[5])};p=n}p||(m=this.cachedCanvases.getCanvas("maskCanvas",n,s),f(m.context,e));let g=r.Util.transform(c,[1/n,0,0,-1/s,0,0]);g=r.Util.transform(g,[1,0,0,1,0,-s]);const v=r.Util.applyTransform([0,0],g),x=r.Util.applyTransform([n,s],g),b=r.Util.normalizeRect([v[0],v[1],x[0],x[1]]),w=Math.round(b[2]-b[0])||1,_=Math.round(b[3]-b[1])||1,S=this.cachedCanvases.getCanvas("fillCanvas",w,_),P=S.context,C=Math.min(v[0],x[0]),A=Math.min(v[1],x[1]);P.translate(-C,-A),P.transform(...g),p||(p=this._scaleImage(m.canvas,(0,a.getCurrentTransformInverse)(P)),p=p.img,u&&o&&u.set(h,p)),P.imageSmoothingEnabled=y((0,a.getCurrentTransform)(P),e.interpolate),d(P,p,0,0,p.width,p.height,0,0,n,s),P.globalCompositeOperation="source-in";const k=r.Util.transform((0,a.getCurrentTransformInverse)(P),[1,0,0,1,-C,-A]);return P.fillStyle=o?l.getPattern(t,this,k,i.PathType.FILL):l,P.fillRect(0,0,n,s),u&&!o&&(this.cachedCanvases.delete("fillCanvas"),u.set(h,S.canvas)),{canvas:S.canvas,offsetX:Math.round(C),offsetY:Math.round(A)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=w[e]}setLineJoin(e){this.ctx.lineJoin=_[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){const n=this.ctx;void 0!==n.setLineDash&&(n.setLineDash(e),n.lineDashOffset=t)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,n]of e)switch(t){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n[0],n[1]);break;case"CA":this.current.strokeAlpha=n;break;case"ca":this.current.fillAlpha=n,this.ctx.globalAlpha=n;break;case"BM":this.ctx.globalCompositeOperation=n;break;case"SMask":this.current.activeSMask=n?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(n)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,t=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,r=this.cachedCanvases.getCanvas(n,e,t);this.suspendedCtx=this.ctx,this.ctx=r.context;const i=this.ctx;i.setTransform(...(0,a.getCurrentTransform)(this.suspendedCtx)),p(this.suspendedCtx,i),function(e,t){if(e._removeMirroring)throw new Error("Context is already forwarding operations.");e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(e,n){t.translate(e,n),this.__originalTranslate(e,n)},e.scale=function(e,n){t.scale(e,n),this.__originalScale(e,n)},e.transform=function(e,n,r,a,i,s){t.transform(e,n,r,a,i,s),this.__originalTransform(e,n,r,a,i,s)},e.setTransform=function(e,n,r,a,i,s){t.setTransform(e,n,r,a,i,s),this.__originalSetTransform(e,n,r,a,i,s)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(e){t.rotate(e),this.__originalRotate(e)},e.clip=function(e){t.clip(e),this.__originalClip(e)},e.moveTo=function(e,n){t.moveTo(e,n),this.__originalMoveTo(e,n)},e.lineTo=function(e,n){t.lineTo(e,n),this.__originalLineTo(e,n)},e.bezierCurveTo=function(e,n,r,a,i,s){t.bezierCurveTo(e,n,r,a,i,s),this.__originalBezierCurveTo(e,n,r,a,i,s)},e.rect=function(e,n,r,a){t.rect(e,n,r,a),this.__originalRect(e,n,r,a)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}(i,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),p(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const t=this.current.activeSMask;b(this.suspendedCtx,t,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(p(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),p(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,t,n,r,a,i){this.ctx.transform(e,t,n,r,a,i),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,n){const i=this.ctx,s=this.current;let l,o,c=s.x,d=s.y;const u=(0,a.getCurrentTransform)(i),h=0===u[0]&&0===u[3]||0===u[1]&&0===u[2],f=h?n.slice(0):null;for(let a=0,p=0,m=e.length;a0&&void 0!==arguments[0])||arguments[0];const t=this.ctx,n=this.current.strokeColor;t.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"===typeof n&&null!==n&&void 0!==n&&n.getPattern?(t.save(),t.strokeStyle=n.getPattern(t,this,(0,a.getCurrentTransformInverse)(t),i.PathType.STROKE),this.rescaleAndStroke(!1),t.restore()):this.rescaleAndStroke(!0)),e&&this.consumePath(this.current.getClippedPathBoundingBox()),t.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=this.ctx,n=this.current.fillColor;let r=!1;this.current.patternFill&&(t.save(),t.fillStyle=n.getPattern(t,this,(0,a.getCurrentTransformInverse)(t),i.PathType.FILL),r=!0);const s=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==s&&(this.pendingEOFill?(t.fill("evenodd"),this.pendingEOFill=!1):t.fill()),r&&t.restore(),e&&this.consumePath(s)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=S}eoClip(){this.pendingClip=P}beginText(){this.current.textMatrix=r.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const e=this.pendingTextPaths,t=this.ctx;if(void 0!==e){t.save(),t.beginPath();for(const n of e)t.setTransform(...n.transform),t.translate(n.x,n.y),n.addToPath(t,n.fontSize);t.restore(),t.clip(),t.beginPath(),delete this.pendingTextPaths}else t.beginPath()}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(e,t){var n;const a=this.commonObjs.get(e),i=this.current;if(!a)throw new Error("Can't find font for ".concat(e));if(i.fontMatrix=a.fontMatrix||r.FONT_IDENTITY_MATRIX,0!==i.fontMatrix[0]&&0!==i.fontMatrix[3]||(0,r.warn)("Invalid font matrix for font "+e),t<0?(t=-t,i.fontDirection=-1):i.fontDirection=1,this.current.font=a,this.current.fontSize=t,a.isType3Font)return;const s=a.loadedName||"sans-serif",l=(null===(n=a.systemFontInfo)||void 0===n?void 0:n.css)||'"'.concat(s,'", ').concat(a.fallbackName);let o="normal";a.black?o="900":a.bold&&(o="bold");const c=a.italic?"italic":"normal";let d=t;t<16?d=16:t>100&&(d=100),this.current.fontSizeScale=t/d,this.ctx.font="".concat(c," ").concat(o," ").concat(d,"px ").concat(l)}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}setTextMatrix(e,t,n,r,a,i){this.current.textMatrix=[e,t,n,r,a,i],this.current.textMatrixScale=Math.hypot(e,t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,t,n,i){const s=this.ctx,l=this.current,o=l.font,c=l.textRenderingMode,d=l.fontSize/l.fontSizeScale,u=c&r.TextRenderingMode.FILL_STROKE_MASK,h=!!(c&r.TextRenderingMode.ADD_TO_PATH_FLAG),f=l.patternFill&&!o.missingFile;let p;(o.disableFontFace||h||f)&&(p=o.getPathGenerator(this.commonObjs,e)),o.disableFontFace||f?(s.save(),s.translate(t,n),s.beginPath(),p(s,d),i&&s.setTransform(...i),u!==r.TextRenderingMode.FILL&&u!==r.TextRenderingMode.FILL_STROKE||s.fill(),u!==r.TextRenderingMode.STROKE&&u!==r.TextRenderingMode.FILL_STROKE||s.stroke(),s.restore()):(u!==r.TextRenderingMode.FILL&&u!==r.TextRenderingMode.FILL_STROKE||s.fillText(e,t,n),u!==r.TextRenderingMode.STROKE&&u!==r.TextRenderingMode.FILL_STROKE||s.strokeText(e,t,n)),h&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,a.getCurrentTransform)(s),x:t,y:n,fontSize:d,addToPath:p})}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const t=e.getImageData(0,0,10,10).data;let n=!1;for(let r=3;r0&&t[r]<255){n=!0;break}return(0,r.shadow)(this,"isFontSubpixelAAEnabled",n)}showText(e){const t=this.current,n=t.font;if(n.isType3Font)return this.showType3Text(e);const s=t.fontSize;if(0===s)return;const l=this.ctx,o=t.fontSizeScale,c=t.charSpacing,d=t.wordSpacing,u=t.fontDirection,h=t.textHScale*u,f=e.length,p=n.vertical,m=p?1:-1,g=n.defaultVMetrics,v=s*t.fontMatrix[0],x=t.textRenderingMode===r.TextRenderingMode.FILL&&!n.disableFontFace&&!t.patternFill;let b;if(l.save(),l.transform(...t.textMatrix),l.translate(t.x,t.y+t.textRise),u>0?l.scale(h,-1):l.scale(h,1),t.patternFill){l.save();const e=t.fillColor.getPattern(l,this,(0,a.getCurrentTransformInverse)(l),i.PathType.FILL);b=(0,a.getCurrentTransform)(l),l.restore(),l.fillStyle=e}let y=t.lineWidth;const w=t.textMatrixScale;if(0===w||0===y){const e=t.textRenderingMode&r.TextRenderingMode.FILL_STROKE_MASK;e!==r.TextRenderingMode.STROKE&&e!==r.TextRenderingMode.FILL_STROKE||(y=this.getSinglePixelWidth())}else y/=w;if(1!==o&&(l.scale(o,o),y/=o),l.lineWidth=y,n.isInvalidPDFjsFont){const n=[];let r=0;for(const t of e)n.push(t.unicode),r+=t.width;return l.fillText(n.join(""),0,0),t.x+=r*v*h,l.restore(),void this.compose()}let _,S=0;for(_=0;_0){const e=1e3*l.measureText(i).width/s*o;if(wnew A(e,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};t=new i.TilingPattern(e,n,this.ctx,s,r)}else t=this._getPattern(e[1],e[2]);return t}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,t,n){const a=r.Util.makeHexColor(e,t,n);this.ctx.strokeStyle=a,this.current.strokeColor=a}setFillRGBColor(e,t,n){const a=r.Util.makeHexColor(e,t,n);this.ctx.fillStyle=a,this.current.fillColor=a,this.current.patternFill=!1}_getPattern(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.cachedPatterns.has(e)?t=this.cachedPatterns.get(e):(t=(0,i.getShadingPattern)(this.getObject(e)),this.cachedPatterns.set(e,t)),n&&(t.matrix=n),t}shadingFill(e){if(!this.contentVisible)return;const t=this.ctx;this.save();const n=this._getPattern(e);t.fillStyle=n.getPattern(t,this,(0,a.getCurrentTransformInverse)(t),i.PathType.SHADING);const s=(0,a.getCurrentTransformInverse)(t);if(s){const{width:e,height:n}=t.canvas,[a,i,l,o]=r.Util.getAxialAlignedBoundingBox([0,0,e,n],s);this.ctx.fillRect(a,i,l-a,o-i)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,r.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,r.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(e)&&6===e.length&&this.transform(...e),this.baseTransform=(0,a.getCurrentTransform)(this.ctx),t)){const e=t[2]-t[0],n=t[3]-t[1];this.ctx.rect(t[0],t[1],e,n),this.current.updateRectMinMax((0,a.getCurrentTransform)(this.ctx),t),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const t=this.ctx;e.isolated||(0,r.info)("TODO: Support non-isolated groups."),e.knockout&&(0,r.warn)("Knockout groups not supported.");const n=(0,a.getCurrentTransform)(t);if(e.matrix&&t.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let i=r.Util.getAxialAlignedBoundingBox(e.bbox,(0,a.getCurrentTransform)(t));const s=[0,0,t.canvas.width,t.canvas.height];i=r.Util.intersect(i,s)||[0,0,0,0];const o=Math.floor(i[0]),c=Math.floor(i[1]);let d=Math.max(Math.ceil(i[2])-o,1),u=Math.max(Math.ceil(i[3])-c,1),h=1,f=1;d>l&&(h=d/l,d=l),u>l&&(f=u/l,u=l),this.current.startNewPathAndClipBox([0,0,d,u]);let m="groupAt"+this.groupLevel;e.smask&&(m+="_smask_"+this.smaskCounter++%2);const g=this.cachedCanvases.getCanvas(m,d,u),v=g.context;v.scale(1/h,1/f),v.translate(-o,-c),v.transform(...n),e.smask?this.smaskStack.push({canvas:g.canvas,context:v,offsetX:o,offsetY:c,scaleX:h,scaleY:f,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(o,c),t.scale(h,f),t.save()),p(t,v),this.ctx=v,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const t=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const e=(0,a.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...e);const n=r.Util.getAxialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],e);this.ctx.drawImage(t.canvas,0,0),this.ctx.restore(),this.compose(n)}}beginAnnotation(e,t,n,i,s){if(_assertClassBrand(C,this,k).call(this),m(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(t)&&4===t.length){const i=t[2]-t[0],l=t[3]-t[1];if(s&&this.annotationCanvasMap){(n=n.slice())[4]-=t[0],n[5]-=t[1],(t=t.slice())[0]=t[1]=0,t[2]=i,t[3]=l;const[s,o]=r.Util.singularValueDecompose2dScale((0,a.getCurrentTransform)(this.ctx)),{viewportScale:c}=this,d=Math.ceil(i*this.outputScaleX*c),u=Math.ceil(l*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(d,u);const{canvas:h,context:f}=this.annotationCanvas;this.annotationCanvasMap.set(e,h),this.annotationCanvas.savedCtx=this.ctx,this.ctx=f,this.ctx.save(),this.ctx.setTransform(s,0,0,-o,0,l*o),m(this.ctx)}else m(this.ctx),this.ctx.rect(t[0],t[1],i,l),this.ctx.clip(),this.endPath()}this.current=new u(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...n),this.transform(...i)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),_assertClassBrand(C,this,j).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const t=e.count;(e=this.getObject(e.data,e)).count=t;const n=this.ctx,r=this.processingType3;if(r&&(void 0===r.compiled&&(r.compiled=function(e){const{width:t,height:n}=e;if(t>1e3||n>1e3)return null;const r=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),a=t+1;let i,s,l,o=new Uint8Array(a*(n+1));const c=t+7&-8;let d=new Uint8Array(c*n),u=0;for(const m of e.data){let e=128;for(;e>0;)d[u++]=m&e?0:255,e>>=1}let h=0;for(u=0,0!==d[u]&&(o[0]=1,++h),s=1;s>2)+(d[u+1]?4:0)+(d[u-c+1]?8:0),r[e]&&(o[l+s]=r[e],++h),u++;if(d[u-c]!==d[u]&&(o[l+s]=d[u]?2:4,++h),h>1e3)return null}for(u=c*(n-1),l=i*a,0!==d[u]&&(o[l]=8,++h),s=1;s1e3)return null;const f=new Int32Array([0,a,-1,0,-a,0,0,0,1]),p=new Path2D;for(i=0;h&&i<=n;i++){let e=i*a;const n=e+t;for(;e>4,o[e]&=s>>2|s<<2),p.lineTo(e%a,e/a|0),o[e]||--h}while(r!==e);--i}return d=null,o=null,function(e){e.save(),e.scale(1/t,-1/n),e.translate(0,-n),e.fill(p),e.beginPath(),e.restore()}}(e)),r.compiled))return void r.compiled(n);const a=this._createMaskCanvas(e),i=a.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(i,a.offsetX,a.offsetY),n.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4?arguments[4]:void 0,l=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;e=this.getObject(e.data,e);const o=this.ctx;o.save();const c=(0,a.getCurrentTransform)(o);o.transform(t,n,i,s,0,0);const d=this._createMaskCanvas(e);o.setTransform(1,0,0,1,d.offsetX-c[4],d.offsetY-c[5]);for(let a=0,u=l.length;at?c/t:1,s=o>t?o/t:1}}this._cachedScaleForStroking[0]=i,this._cachedScaleForStroking[1]=s}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:t}=this,{lineWidth:n}=this.current,[r,a]=this.getScaleForStroking();if(t.lineWidth=n||1,1===r&&1===a)return void t.stroke();const i=t.getLineDash();if(e&&t.save(),t.scale(r,a),i.length>0){const e=Math.max(r,a);t.setLineDash(i.map((t=>t/e))),t.lineDashOffset/=e}t.stroke(),e&&t.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}function k(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}function j(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==e){const t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}t.CanvasGraphics=A;for(const E in r.OPS)void 0!==A.prototype[E]&&(A.prototype[r.OPS[E]]=A.prototype[E])},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TilingPattern=t.PathType=void 0,t.getShadingPattern=function(e){switch(e[0]){case"RadialAxial":return new o(e);case"Mesh":return new u(e);case"Dummy":return new h}throw new Error("Unknown IR type: ".concat(e[0]))};var r=n(1),a=n(6);const i={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function s(e,t){if(!t)return;const n=t[2]-t[0],r=t[3]-t[1],a=new Path2D;a.rect(t[0],t[1],n,r),e.clip(a)}t.PathType=i;class l{constructor(){this.constructor===l&&(0,r.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,r.unreachable)("Abstract method `getPattern` called.")}}class o extends l{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;"axial"===this._type?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const n of this._colorStops)t.addColorStop(n[0],n[1]);return t}getPattern(e,t,n,l){let o;if(l===i.STROKE||l===i.FILL){const i=t.current.getClippedPathBoundingBox(l,(0,a.getCurrentTransform)(e))||[0,0,0,0],c=Math.ceil(i[2]-i[0])||1,d=Math.ceil(i[3]-i[1])||1,u=t.cachedCanvases.getCanvas("pattern",c,d,!0),h=u.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-i[0],-i[1]),n=r.Util.transform(n,[1,0,0,1,i[0],i[1]]),h.transform(...t.baseTransform),this.matrix&&h.transform(...this.matrix),s(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),o=e.createPattern(u.canvas,"no-repeat");const f=new DOMMatrix(n);o.setTransform(f)}else s(e,this._bbox),o=this._createGradient(e);return o}}function c(e,t,n,r,a,i,s,l){const o=t.coords,c=t.colors,d=e.data,u=4*e.width;let h;o[n+1]>o[r+1]&&(h=n,n=r,r=h,h=i,i=s,s=h),o[r+1]>o[a+1]&&(h=r,r=a,a=h,h=s,s=l,l=h),o[n+1]>o[r+1]&&(h=n,n=r,r=h,h=i,i=s,s=h);const f=(o[n]+t.offsetX)*t.scaleX,p=(o[n+1]+t.offsetY)*t.scaleY,m=(o[r]+t.offsetX)*t.scaleX,g=(o[r+1]+t.offsetY)*t.scaleY,v=(o[a]+t.offsetX)*t.scaleX,x=(o[a+1]+t.offsetY)*t.scaleY;if(p>=x)return;const b=c[i],y=c[i+1],w=c[i+2],_=c[s],S=c[s+1],P=c[s+2],C=c[l],A=c[l+1],k=c[l+2],j=Math.round(p),E=Math.round(x);let N,F,T,M,R,I,L,O;for(let D=j;D<=E;D++){if(Dx?1:g===x?0:(g-D)/(g-x),N=m-(m-v)*e,F=_-(_-C)*e,T=S-(S-A)*e,M=P-(P-k)*e}let e;e=Dx?1:(p-D)/(p-x),R=f-(f-v)*e,I=b-(b-C)*e,L=y-(y-A)*e,O=w-(w-k)*e;const t=Math.round(Math.min(N,R)),n=Math.round(Math.max(N,R));let r=u*D+4*t;for(let a=t;a<=n;a++)e=(N-a)/(N-R),e<0?e=0:e>1&&(e=1),d[r++]=F-(F-I)*e|0,d[r++]=T-(T-L)*e|0,d[r++]=M-(M-O)*e|0,d[r++]=255}}function d(e,t,n){const r=t.coords,a=t.colors;let i,s;switch(t.type){case"lattice":const l=t.verticesPerRow,o=Math.floor(r.length/l)-1,d=l-1;for(i=0;i=r?a=r:n=a/e,{scale:n,size:a}}clipBbox(e,t,n,r,i){const s=r-t,l=i-n;e.ctx.rect(t,n,s,l),e.current.updateRectMinMax((0,a.getCurrentTransform)(e.ctx),[t,n,r,i]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,n){const a=e.ctx,i=e.current;switch(t){case f:const e=this.ctx;a.fillStyle=e.fillStyle,a.strokeStyle=e.strokeStyle,i.fillColor=e.fillStyle,i.strokeColor=e.strokeStyle;break;case p:const s=r.Util.makeHexColor(n[0],n[1],n[2]);a.fillStyle=s,a.strokeStyle=s,i.fillColor=s,i.strokeColor=s;break;default:throw new r.FormatError("Unsupported paint type: ".concat(t))}}getPattern(e,t,n,a){let s=n;a!==i.SHADING&&(s=r.Util.transform(s,t.baseTransform),this.matrix&&(s=r.Util.transform(s,this.matrix)));const l=this.createPatternCanvas(t);let o=new DOMMatrix(s);o=o.translate(l.offsetX,l.offsetY),o=o.scale(1/l.scaleX,1/l.scaleY);const c=e.createPattern(l.canvas,"repeat");return c.setTransform(o),c}}_defineProperty(m,"MAX_PATTERN_SIZE",3e3),t.TilingPattern=m},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.convertBlackAndWhiteToRGBA=a,t.convertToRGBA=function(e){switch(e.kind){case r.ImageKind.GRAYSCALE_1BPP:return a(e);case r.ImageKind.RGB_24BPP:return function(e){let{src:t,srcPos:n=0,dest:a,destPos:i=0,width:s,height:l}=e,o=0;const c=t.length>>2,d=new Uint32Array(t.buffer,n,c);if(r.FeatureTest.isLittleEndian){for(;o>>24|t<<8|4278190080,a[i+2]=t>>>16|n<<16|4278190080,a[i+3]=n>>>8|4278190080}for(let e=4*o,n=t.length;e>>8|255,a[i+2]=t<<16|n>>>16|255,a[i+3]=n<<8|255}for(let e=4*o,n=t.length;e>3,f=7&i,p=t.length;a=new Uint32Array(a.buffer);let m=0;for(let r=0;r{Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalWorkerOptions=void 0;const n=Object.create(null);t.GlobalWorkerOptions=n,n.workerPort=null,n.workerSrc=""},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=void 0;var r=n(1);const a=1,i=2,s=1,l=2,o=3,c=4,d=5,u=6,h=7,f=8;function p(e){switch(e instanceof Error||"object"===typeof e&&null!==e||(0,r.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new r.AbortException(e.message);case"MissingPDFException":return new r.MissingPDFException(e.message);case"PasswordException":return new r.PasswordException(e.message,e.code);case"UnexpectedResponseException":return new r.UnexpectedResponseException(e.message,e.status);case"UnknownErrorException":return new r.UnknownErrorException(e.message,e.details);default:return new r.UnknownErrorException(e.message,e.toString())}}var m=new WeakSet;function g(e){const t=e.streamId,n=this.sourceName,a=e.sourceName,i=this.comObj,s=this,l=this.actionHandler[e.action],u={enqueue(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,l=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=s,o>0&&this.desiredSize<=0&&(this.sinkCapability=new r.PromiseCapability,this.ready=this.sinkCapability.promise),i.postMessage({sourceName:n,targetName:a,stream:c,streamId:t,chunk:e},l)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:a,stream:o,streamId:t}),delete s.streamSinks[t])},error(e){(0,r.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:a,stream:d,streamId:t,reason:p(e)}))},sinkCapability:new r.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};u.sinkCapability.resolve(),u.ready=u.sinkCapability.promise,this.streamSinks[t]=u,new Promise((function(t){t(l(e.data,u))})).then((function(){i.postMessage({sourceName:n,targetName:a,stream:f,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:n,targetName:a,stream:f,streamId:t,reason:p(e)})}))}function v(e){const t=e.streamId,n=this.sourceName,a=e.sourceName,i=this.comObj,g=this.streamControllers[t],v=this.streamSinks[t];switch(e.stream){case f:e.success?g.startCall.resolve():g.startCall.reject(p(e.reason));break;case h:e.success?g.pullCall.resolve():g.pullCall.reject(p(e.reason));break;case u:if(!v){i.postMessage({sourceName:n,targetName:a,stream:h,streamId:t,success:!0});break}v.desiredSize<=0&&e.desiredSize>0&&v.sinkCapability.resolve(),v.desiredSize=e.desiredSize,new Promise((function(e){var t;e(null===(t=v.onPull)||void 0===t?void 0:t.call(v))})).then((function(){i.postMessage({sourceName:n,targetName:a,stream:h,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:n,targetName:a,stream:h,streamId:t,reason:p(e)})}));break;case c:if((0,r.assert)(g,"enqueue should have stream controller"),g.isClosed)break;g.controller.enqueue(e.chunk);break;case o:if((0,r.assert)(g,"close should have stream controller"),g.isClosed)break;g.isClosed=!0,g.controller.close(),_assertClassBrand(m,this,x).call(this,g,t);break;case d:(0,r.assert)(g,"error should have stream controller"),g.controller.error(p(e.reason)),_assertClassBrand(m,this,x).call(this,g,t);break;case l:e.success?g.cancelCall.resolve():g.cancelCall.reject(p(e.reason)),_assertClassBrand(m,this,x).call(this,g,t);break;case s:if(!v)break;new Promise((function(t){var n;t(null===(n=v.onCancel)||void 0===n?void 0:n.call(v,p(e.reason)))})).then((function(){i.postMessage({sourceName:n,targetName:a,stream:l,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:n,targetName:a,stream:l,streamId:t,reason:p(e)})})),v.sinkCapability.reject(p(e.reason)),v.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async function x(e,t){var n,r,a;await Promise.allSettled([null===(n=e.startCall)||void 0===n?void 0:n.promise,null===(r=e.pullCall)||void 0===r?void 0:r.promise,null===(a=e.cancelCall)||void 0===a?void 0:a.promise]),delete this.streamControllers[t]}t.MessageHandler=class{constructor(e,t,n){_classPrivateMethodInitSpec(this,m),this.sourceName=e,this.targetName=t,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=e=>{const t=e.data;if(t.targetName!==this.sourceName)return;if(t.stream)return void _assertClassBrand(m,this,v).call(this,t);if(t.callback){const e=t.callbackId,n=this.callbackCapabilities[e];if(!n)throw new Error("Cannot resolve callback ".concat(e));if(delete this.callbackCapabilities[e],t.callback===a)n.resolve(t.data);else{if(t.callback!==i)throw new Error("Unexpected callback case");n.reject(p(t.reason))}return}const r=this.actionHandler[t.action];if(!r)throw new Error("Unknown action from worker: ".concat(t.action));if(t.callbackId){const e=this.sourceName,s=t.sourceName;new Promise((function(e){e(r(t.data))})).then((function(r){n.postMessage({sourceName:e,targetName:s,callback:a,callbackId:t.callbackId,data:r})}),(function(r){n.postMessage({sourceName:e,targetName:s,callback:i,callbackId:t.callbackId,reason:p(r)})}))}else t.streamId?_assertClassBrand(m,this,g).call(this,t):r(t.data)},n.addEventListener("message",this._onComObjOnMessage)}on(e,t){const n=this.actionHandler;if(n[e])throw new Error('There is already an actionName called "'.concat(e,'"'));n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){const a=this.callbackId++,i=new r.PromiseCapability;this.callbackCapabilities[a]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:a,data:t},n)}catch(s){i.reject(s)}return i.promise}sendWithStream(e,t,n,a){const i=this.streamId++,l=this.sourceName,o=this.targetName,c=this.comObj;return new ReadableStream({start:n=>{const s=new r.PromiseCapability;return this.streamControllers[i]={controller:n,startCall:s,pullCall:null,cancelCall:null,isClosed:!1},c.postMessage({sourceName:l,targetName:o,action:e,streamId:i,data:t,desiredSize:n.desiredSize},a),s.promise},pull:e=>{const t=new r.PromiseCapability;return this.streamControllers[i].pullCall=t,c.postMessage({sourceName:l,targetName:o,stream:u,streamId:i,desiredSize:e.desiredSize}),t.promise},cancel:e=>{(0,r.assert)(e instanceof Error,"cancel must have a valid reason");const t=new r.PromiseCapability;return this.streamControllers[i].cancelCall=t,this.streamControllers[i].isClosed=!0,c.postMessage({sourceName:l,targetName:o,stream:s,streamId:i,reason:p(e)}),t.promise}},n)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;var r=n(1),a=new WeakMap,i=new WeakMap;t.Metadata=class{constructor(e){let{parsedData:t,rawData:n}=e;_classPrivateFieldInitSpec(this,a,void 0),_classPrivateFieldInitSpec(this,i,void 0),_classPrivateFieldSet(a,this,t),_classPrivateFieldSet(i,this,n)}getRaw(){return _classPrivateFieldGet(i,this)}get(e){var t;return null!==(t=_classPrivateFieldGet(a,this).get(e))&&void 0!==t?t:null}getAll(){return(0,r.objectFromMap)(_classPrivateFieldGet(a,this))}has(e){return _classPrivateFieldGet(a,this).has(e)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionalContentConfig=void 0;var r=n(1),a=n(8);const i=Symbol("INTERNAL");var s=new WeakMap;class l{constructor(e,t){_classPrivateFieldInitSpec(this,s,!0),this.name=e,this.intent=t}get visible(){return _classPrivateFieldGet(s,this)}_setVisible(e,t){e!==i&&(0,r.unreachable)("Internal method `_setVisible` called."),_classPrivateFieldSet(s,this,t)}}var o=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,h=new WeakSet;function f(e){const t=e.length;if(t<2)return!0;const n=e[0];for(let a=1;a1&&void 0!==arguments[1])||arguments[1];_classPrivateFieldGet(c,this).has(e)?(_classPrivateFieldGet(c,this).get(e)._setVisible(i,!!t),_classPrivateFieldSet(o,this,null)):(0,r.warn)("Optional content group not found: ".concat(e))}get hasInitialVisibility(){return null===_classPrivateFieldGet(d,this)||this.getHash()===_classPrivateFieldGet(d,this)}getOrder(){return _classPrivateFieldGet(c,this).size?_classPrivateFieldGet(u,this)?_classPrivateFieldGet(u,this).slice():[..._classPrivateFieldGet(c,this).keys()]:null}getGroups(){return _classPrivateFieldGet(c,this).size>0?(0,r.objectFromMap)(_classPrivateFieldGet(c,this)):null}getGroup(e){return _classPrivateFieldGet(c,this).get(e)||null}getHash(){if(null!==_classPrivateFieldGet(o,this))return _classPrivateFieldGet(o,this);const e=new a.MurmurHash3_64;for(const[t,n]of _classPrivateFieldGet(c,this))e.update("".concat(t,":").concat(n.visible));return _classPrivateFieldSet(o,this,e.hexdigest())}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFDataTransportStream=void 0;var r=n(1),a=n(6);t.PDFDataTransportStream=class{constructor(e,t){let{length:n,initialData:a,progressiveDone:i=!1,contentDispositionFilename:s=null,disableRange:l=!1,disableStream:o=!1}=e;if((0,r.assert)(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=i,this._contentDispositionFilename=s,(null===a||void 0===a?void 0:a.length)>0){const e=a instanceof Uint8Array&&a.byteLength===a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!o,this._isRangeSupported=!l,this._contentLength=n,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener(((e,t)=>{this._onReceiveData({begin:e,chunk:t})})),this._pdfDataRangeTransport.addProgressListener(((e,t)=>{this._onProgress({loaded:e,total:t})})),this._pdfDataRangeTransport.addProgressiveReadListener((e=>{this._onReceiveData({chunk:e})})),this._pdfDataRangeTransport.addProgressiveDoneListener((()=>{this._onProgressiveDone()})),this._pdfDataRangeTransport.transportReady()}_onReceiveData(e){let{begin:t,chunk:n}=e;const a=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;if(void 0===t)this._fullRequestReader?this._fullRequestReader._enqueue(a):this._queuedChunks.push(a);else{const e=this._rangeReaders.some((function(e){return e._begin===t&&(e._enqueue(a),!0)}));(0,r.assert)(e,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var e,t;return null!==(e=null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)&&void 0!==e?e:0}_onProgress(e){var t,n,r,a;void 0===e.total?null===(t=this._rangeReaders[0])||void 0===t||null===(n=t.onProgress)||void 0===n||n.call(t,{loaded:e.loaded}):null===(r=this._fullRequestReader)||void 0===r||null===(a=r.onProgress)||void 0===a||a.call(r,{loaded:e.loaded,total:e.total})}_onProgressiveDone(){var e;null===(e=this._fullRequestReader)||void 0===e||e.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){(0,r.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new i(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new s(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(n),n}cancelAllRequests(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);for(const n of this._rangeReaders.slice(0))n.cancel(e);this._pdfDataRangeTransport.abort()}};class i{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._stream=e,this._done=n||!1,this._filename=(0,a.isPdfFile)(r)?r:null,this._queuedChunks=t||[],this._loaded=0;for(const a of this._queuedChunks)this._loaded+=a.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=new r.PromiseCapability;return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class s{constructor(e,t,n){this._stream=e,this._begin=t,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(0===this._requests.length)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=new r.PromiseCapability;return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFetchStream=void 0;var r=n(1),a=n(20);function i(e,t,n){return{method:"GET",headers:e,signal:n.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function s(e){const t=new Headers;for(const n in e){const r=e[n];void 0!==r&&t.append(n,r)}return t}function l(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:((0,r.warn)("getArrayBuffer - unexpected data format: ".concat(e)),new Uint8Array(e).buffer)}t.PDFFetchStream=class{constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e,t;return null!==(e=null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)&&void 0!==e?e:0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new o(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new c(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.cancel(e)}};class o{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=new r.PromiseCapability,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._headers=s(this._stream.httpHeaders);const n=t.url;fetch(n,i(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,a.validateResponseStatus)(e.status))throw(0,a.createResponseStatusError)(e.status,n);this._reader=e.body.getReader(),this._headersCapability.resolve();const t=t=>e.headers.get(t),{allowRangeRequests:i,suggestedLength:s}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i,this._contentLength=s||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(t),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new r.AbortException("Streaming is disabled."))})).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;await this._headersCapability.promise;const{value:t,done:n}=await this._reader.read();return n?{value:t,done:n}:(this._loaded+=t.byteLength,null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:this._loaded,total:this._contentLength}),{value:l(t),done:!1})}cancel(e){var t;null===(t=this._reader)||void 0===t||t.cancel(e),this._abortController.abort()}}class c{constructor(e,t,n){this._stream=e,this._reader=null,this._loaded=0;const l=e.source;this._withCredentials=l.withCredentials||!1,this._readCapability=new r.PromiseCapability,this._isStreamingSupported=!l.disableStream,this._abortController=new AbortController,this._headers=s(this._stream.httpHeaders),this._headers.append("Range","bytes=".concat(t,"-").concat(n-1));const o=l.url;fetch(o,i(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,a.validateResponseStatus)(e.status))throw(0,a.createResponseStatusError)(e.status,o);this._readCapability.resolve(),this._reader=e.body.getReader()})).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;await this._readCapability.promise;const{value:t,done:n}=await this._reader.read();return n?{value:t,done:n}:(this._loaded+=t.byteLength,null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:this._loaded}),{value:l(t),done:!1})}cancel(e){var t;null===(t=this._reader)||void 0===t||t.cancel(e),this._abortController.abort()}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createResponseStatusError=function(e,t){return 404===e||0===e&&t.startsWith("file:")?new r.MissingPDFException('Missing PDF "'+t+'".'):new r.UnexpectedResponseException("Unexpected server response (".concat(e,') while retrieving PDF "').concat(t,'".'),e)},t.extractFilenameFromHeader=function(e){const t=e("Content-Disposition");if(t){let e=(0,a.getFilenameFromContentDispositionHeader)(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch{}if((0,i.isPdfFile)(e))return e}return null},t.validateRangeRequestCapabilities=function(e){let{getResponseHeader:t,isHttp:n,rangeChunkSize:r,disableRange:a}=e;const i={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(t("Content-Length"),10);return Number.isInteger(s)?(i.suggestedLength=s,s<=2*r||a||!n||"bytes"!==t("Accept-Ranges")||"identity"!==(t("Content-Encoding")||"identity")||(i.allowRangeRequests=!0),i):i},t.validateResponseStatus=function(e){return 200===e||206===e};var r=n(1),a=n(21),i=n(6)},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getFilenameFromContentDispositionHeader=function(e){let t=!0,n=a("filename\\*","i").exec(e);if(n){n=n[1];let e=l(n);return e=unescape(e),e=o(e),e=c(e),s(e)}if(n=function(e){const t=[];let n;const r=a("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(n=r.exec(e));){let[,e,r,a]=n;if(e=parseInt(e,10),e in t){if(0===e)break}else t[e]=[r,a]}const i=[];for(let a=0;a{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNetworkStream=void 0;var r=n(1),a=n(20);class i{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.url=e,this.isHttp=/^https?:/i.test(e),this.httpHeaders=this.isHttp&&t.httpHeaders||Object.create(null),this.withCredentials=t.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,t,n){const r={begin:e,end:t};for(const a in n)r[a]=n[a];return this.request(r)}requestFull(e){return this.request(e)}request(e){const t=new XMLHttpRequest,n=this.currXhrId++,r=this.pendingRequests[n]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(const a in this.httpHeaders){const e=this.httpHeaders[a];void 0!==e&&t.setRequestHeader(a,e)}return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range","bytes=".concat(e.begin,"-").concat(e.end-1)),r.expectedStatus=206):r.expectedStatus=200,t.responseType="arraybuffer",e.onError&&(t.onerror=function(n){e.onError(t.status)}),t.onreadystatechange=this.onStateChange.bind(this,n),t.onprogress=this.onProgress.bind(this,n),r.onHeadersReceived=e.onHeadersReceived,r.onDone=e.onDone,r.onError=e.onError,r.onProgress=e.onProgress,t.send(null),n}onProgress(e,t){var n;const r=this.pendingRequests[e];r&&(null===(n=r.onProgress)||void 0===n||n.call(r,t))}onStateChange(e,t){const n=this.pendingRequests[e];if(!n)return;const a=n.xhr;if(a.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),4!==a.readyState)return;if(!(e in this.pendingRequests))return;var i;if(delete this.pendingRequests[e],0===a.status&&this.isHttp)return void(null===(i=n.onError)||void 0===i||i.call(n,a.status));const s=a.status||200;var l;if((200!==s||206!==n.expectedStatus)&&s!==n.expectedStatus)return void(null===(l=n.onError)||void 0===l||l.call(n,a.status));const o=function(e){const t=e.response;return"string"!==typeof t?t:(0,r.stringToBytes)(t).buffer}(a);if(206===s){const e=a.getResponseHeader("Content-Range"),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);n.onDone({begin:parseInt(t[1],10),chunk:o})}else if(o)n.onDone({begin:0,chunk:o});else{var c;null===(c=n.onError)||void 0===c||c.call(n,a.status)}}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}t.PDFNetworkStream=class{constructor(e){this._source=e,this._manager=new i(e.url,{httpHeaders:e.httpHeaders,withCredentials:e.withCredentials}),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new s(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const n=new l(this._manager,e,t);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.cancel(e)}};class s{constructor(e,t){this._manager=e;const n={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._fullRequestId=e.requestFull(n),this._headersReceivedCapability=new r.PromiseCapability,this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const e=this._fullRequestId,t=this._manager.getRequestXhr(e),n=e=>t.getResponseHeader(e),{allowRangeRequests:r,suggestedLength:i}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});r&&(this._isRangeSupported=!0),this._contentLength=i||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(n),this._isRangeSupported&&this._manager.abortRequest(e),this._headersReceivedCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=(0,a.createResponseStatusError)(e,this._url),this._headersReceivedCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){var t;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=new r.PromiseCapability;return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersReceivedCapability.reject(e);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class l{constructor(e,t,n){this._manager=e;const r={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._requestId=e.requestRange(t,n,r),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var e;null===(e=this.onClosed)||void 0===e||e.call(this,this)}_onDone(e){const t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError=(0,a.createResponseStatusError)(e,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){var t;this.isStreamingSupported||null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=new r.PromiseCapability;return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNodeStream=void 0;var r=n(1),a=n(20);const i=/^file:\/\/\/[a-zA-Z]:\//;t.PDFNodeStream=class{constructor(e){this.source=e,this.url=function(e){const t=__webpack_require__(9052),n=t.parse(e);return"file:"===n.protocol||n.host?n:/^[a-z]:[/\\]/i.test(e)?t.parse("file:///".concat(e)):(n.host||(n.protocol="file:"),n)}(e.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e,t;return null!==(e=null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)&&void 0!==e?e:0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new u(this):new c(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=this.isFsUrl?new h(this,e,t):new d(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.cancel(e)}};class s{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=new r.PromiseCapability,this._headersCapability=new r.PromiseCapability}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return null===t?(this._readCapability=new r.PromiseCapability,this.read()):(this._loaded+=t.length,null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",(()=>{this._readCapability.resolve()})),e.on("end",(()=>{e.destroy(),this._done=!0,this._readCapability.resolve()})),e.on("error",(e=>{this._error(e)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new r.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class l{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new r.PromiseCapability;const t=e.source;this._isStreamingSupported=!t.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return null===t?(this._readCapability=new r.PromiseCapability,this.read()):(this._loaded+=t.length,null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",(()=>{this._readCapability.resolve()})),e.on("end",(()=>{e.destroy(),this._done=!0,this._readCapability.resolve()})),e.on("error",(e=>{this._error(e)})),this._storedError&&this._readableStream.destroy(this._storedError)}}function o(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class c extends s{constructor(e){super(e);const t=t=>{if(404===t.statusCode){const e=new r.MissingPDFException('Missing PDF "'.concat(this._url,'".'));return this._storedError=e,void this._headersCapability.reject(e)}this._headersCapability.resolve(),this._setReadableStream(t);const n=e=>this._readableStream.headers[e.toLowerCase()],{allowRangeRequests:i,suggestedLength:s}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i,this._contentLength=s||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(n)};if(this._request=null,"http:"===this._url.protocol){const n=__webpack_require__(7492);this._request=n.request(o(this._url,e.httpHeaders),t)}else{const n=__webpack_require__(1815);this._request=n.request(o(this._url,e.httpHeaders),t)}this._request.on("error",(e=>{this._storedError=e,this._headersCapability.reject(e)})),this._request.end()}}class d extends l{constructor(e,t,n){super(e),this._httpHeaders={};for(const r in e.httpHeaders){const t=e.httpHeaders[r];void 0!==t&&(this._httpHeaders[r]=t)}this._httpHeaders.Range="bytes=".concat(t,"-").concat(n-1);const a=e=>{if(404!==e.statusCode)this._setReadableStream(e);else{const e=new r.MissingPDFException('Missing PDF "'.concat(this._url,'".'));this._storedError=e}};if(this._request=null,"http:"===this._url.protocol){const e=__webpack_require__(7492);this._request=e.request(o(this._url,this._httpHeaders),a)}else{const e=__webpack_require__(1815);this._request=e.request(o(this._url,this._httpHeaders),a)}this._request.on("error",(e=>{this._storedError=e})),this._request.end()}}class u extends s{constructor(e){super(e);let t=decodeURIComponent(this._url.path);i.test(this._url.href)&&(t=t.replace(/^\//,""));const n=__webpack_require__(3237);n.lstat(t,((e,a)=>{if(e)return"ENOENT"===e.code&&(e=new r.MissingPDFException('Missing PDF "'.concat(t,'".'))),this._storedError=e,void this._headersCapability.reject(e);this._contentLength=a.size,this._setReadableStream(n.createReadStream(t)),this._headersCapability.resolve()}))}}class h extends l{constructor(e,t,n){super(e);let r=decodeURIComponent(this._url.path);i.test(this._url.href)&&(r=r.replace(/^\//,""));const a=__webpack_require__(3237);this._setReadableStream(a.createReadStream(r,{start:t,end:n-1}))}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SVGGraphics=void 0;var r=n(6),a=n(1);const i="normal",s="normal",l="#000000",o=["butt","round","square"],c=["miter","round","bevel"],d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(URL.createObjectURL&&"undefined"!==typeof Blob&&!n)return URL.createObjectURL(new Blob([e],{type:t}));const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let a="data:".concat(t,";base64,");for(let i=0,s=e.length;i>2]+r[(3&t)<<4|n>>4]+r[i+1>6:64]+r[i+2>1&2147483647:e>>1&2147483647;t[a]=e}function n(e,n,r,a){let i=a;const s=n.length;r[i]=s>>24&255,r[i+1]=s>>16&255,r[i+2]=s>>8&255,r[i+3]=255&s,i+=4,r[i]=255&e.charCodeAt(0),r[i+1]=255&e.charCodeAt(1),r[i+2]=255&e.charCodeAt(2),r[i+3]=255&e.charCodeAt(3),i+=4,r.set(n,i),i+=n.length;const l=function(e,n,r){let a=-1;for(let i=n;i>>8^t[n]}return~a}(r,a+4,i);r[i]=l>>24&255,r[i+1]=l>>16&255,r[i+2]=l>>8&255,r[i+3]=255&l}function r(e){let t=e.length;const n=65535,r=Math.ceil(t/n),a=new Uint8Array(2+t+5*r+4);let i=0;a[i++]=120,a[i++]=156;let s=0;for(;t>n;)a[i++]=0,a[i++]=255,a[i++]=255,a[i++]=0,a[i++]=0,a.set(e.subarray(s,s+n),i),i+=n,s+=n,t-=n;a[i++]=1,a[i++]=255&t,a[i++]=t>>8&255,a[i++]=255&~t,a[i++]=(65535&~t)>>8&255,a.set(e.subarray(s),i),i+=e.length-s;const l=function(e,t,n){let r=1,a=0;for(let i=t;i>24&255,a[i++]=l>>16&255,a[i++]=l>>8&255,a[i++]=255&l,a}function i(t,i,s,l){const o=t.width,c=t.height;let u,h,f;const p=t.data;switch(i){case a.ImageKind.GRAYSCALE_1BPP:h=0,u=1,f=o+7>>3;break;case a.ImageKind.RGB_24BPP:h=2,u=8,f=3*o;break;case a.ImageKind.RGBA_32BPP:h=6,u=8,f=4*o;break;default:throw new Error("invalid format")}const m=new Uint8Array((1+f)*c);let g=0,v=0;for(let e=0;e>24&255,o>>16&255,o>>8&255,255&o,c>>24&255,c>>16&255,c>>8&255,255&c,u,h,0,0,0]),b=function(e){if(!a.isNodeJS)return r(e);try{const t=parseInt(process.versions.node)>=8?e:Buffer.from(e),n=__webpack_require__(2787).deflateSync(t,{level:9});return n instanceof Uint8Array?n:new Uint8Array(n)}catch(t){(0,a.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+t)}return r(e)}(m),y=e.length+36+x.length+b.length,w=new Uint8Array(y);let _=0;return w.set(e,_),_+=e.length,n("IHDR",x,w,_),_+=12+x.length,n("IDATA",b,w,_),_+=12+b.length,n("IEND",new Uint8Array(0),w,_),d(w,"image/png",s)}return function(e,t,n){return i(e,void 0===e.kind?a.ImageKind.GRAYSCALE_1BPP:e.kind,t,n)}}();class h{constructor(){this.fontSizeScale=1,this.fontWeight=s,this.fontSize=0,this.textMatrix=a.IDENTITY_MATRIX,this.fontMatrix=a.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=a.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=l,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(e,t){this.x=e,this.y=t}}function f(e){if(Number.isInteger(e))return e.toString();const t=e.toFixed(10);let n=t.length-1;if("0"!==t[n])return t;do{n--}while("0"===t[n]);return t.substring(0,"."===t[n]?n:n+1)}function p(e){if(0===e[4]&&0===e[5]){if(0===e[1]&&0===e[2])return 1===e[0]&&1===e[3]?"":"scale(".concat(f(e[0])," ").concat(f(e[3]),")");if(e[0]===e[3]&&e[1]===-e[2]){const t=180*Math.acos(e[0])/Math.PI;return"rotate(".concat(f(t),")")}}else if(1===e[0]&&0===e[1]&&0===e[2]&&1===e[3])return"translate(".concat(f(e[4])," ").concat(f(e[5]),")");return"matrix(".concat(f(e[0])," ").concat(f(e[1])," ").concat(f(e[2])," ").concat(f(e[3])," ").concat(f(e[4])," ")+"".concat(f(e[5]),")")}let m=0,g=0,v=0;t.SVGGraphics=class{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,r.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new r.DOMSVGFactory,this.current=new h,this.transformMatrix=a.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=e,this.objs=t,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!n,this._operatorIdMapping=[];for(const r in a.OPS)this._operatorIdMapping[a.OPS[r]]=r}getObject(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"===typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}save(){this.transformStack.push(this.transformMatrix);const e=this.current;this.extraStack.push(e),this.current=e.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(e){this.save(),this.executeOpTree(e),this.restore()}loadDependencies(e){const t=e.fnArray,n=e.argsArray;for(let r=0,i=t.length;r{t.get(e,n)}));this.current.dependencies.push(n)}return Promise.all(this.current.dependencies)}transform(e,t,n,r,i,s){const l=[e,t,n,r,i,s];this.transformMatrix=a.Util.transform(this.transformMatrix,l),this.tgrp=null}getSVG(e,t){this.viewport=t;const n=this._initialize(t);return this.loadDependencies(e).then((()=>(this.transformMatrix=a.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(e)),n)))}convertOpList(e){const t=this._operatorIdMapping,n=e.argsArray,r=e.fnArray,a=[];for(let i=0,s=r.length;i0&&(this.current.lineWidth=e)}setLineCap(e){this.current.lineCap=o[e]}setLineJoin(e){this.current.lineJoin=c[e]}setMiterLimit(e){this.current.miterLimit=e}setStrokeAlpha(e){this.current.strokeAlpha=e}setStrokeRGBColor(e,t,n){this.current.strokeColor=a.Util.makeHexColor(e,t,n)}setFillAlpha(e){this.current.fillAlpha=e}setFillRGBColor(e,t,n){this.current.fillColor=a.Util.makeHexColor(e,t,n),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(e){this.current.strokeColor=this._makeColorN_Pattern(e)}setFillColorN(e){this.current.fillColor=this._makeColorN_Pattern(e)}shadingFill(e){const{width:t,height:n}=this.viewport,r=a.Util.inverseTransform(this.transformMatrix),[i,s,l,o]=a.Util.getAxialAlignedBoundingBox([0,0,t,n],r),c=this.svgFactory.createElement("svg:rect");c.setAttributeNS(null,"x",i),c.setAttributeNS(null,"y",s),c.setAttributeNS(null,"width",l-i),c.setAttributeNS(null,"height",o-s),c.setAttributeNS(null,"fill",this._makeShadingPattern(e)),this.current.fillAlpha<1&&c.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(c)}_makeColorN_Pattern(e){return"TilingPattern"===e[0]?this._makeTilingPattern(e):this._makeShadingPattern(e)}_makeTilingPattern(e){const t=e[1],n=e[2],r=e[3]||a.IDENTITY_MATRIX,[i,s,l,o]=e[4],c=e[5],d=e[6],u=e[7],h="shading".concat(v++),[f,p,m,g]=a.Util.normalizeRect([...a.Util.applyTransform([i,s],r),...a.Util.applyTransform([l,o],r)]),[x,b]=a.Util.singularValueDecompose2dScale(r),y=c*x,w=d*b,_=this.svgFactory.createElement("svg:pattern");_.setAttributeNS(null,"id",h),_.setAttributeNS(null,"patternUnits","userSpaceOnUse"),_.setAttributeNS(null,"width",y),_.setAttributeNS(null,"height",w),_.setAttributeNS(null,"x","".concat(f)),_.setAttributeNS(null,"y","".concat(p));const S=this.svg,P=this.transformMatrix,C=this.current.fillColor,A=this.current.strokeColor,k=this.svgFactory.create(m-f,g-p);if(this.svg=k,this.transformMatrix=r,2===u){const e=a.Util.makeHexColor(...t);this.current.fillColor=e,this.current.strokeColor=e}return this.executeOpTree(this.convertOpList(n)),this.svg=S,this.transformMatrix=P,this.current.fillColor=C,this.current.strokeColor=A,_.append(k.childNodes[0]),this.defs.append(_),"url(#".concat(h,")")}_makeShadingPattern(e){switch("string"===typeof e&&(e=this.objs.get(e)),e[0]){case"RadialAxial":const t="shading".concat(v++),n=e[3];let r;switch(e[1]){case"axial":const n=e[4],a=e[5];r=this.svgFactory.createElement("svg:linearGradient"),r.setAttributeNS(null,"id",t),r.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),r.setAttributeNS(null,"x1",n[0]),r.setAttributeNS(null,"y1",n[1]),r.setAttributeNS(null,"x2",a[0]),r.setAttributeNS(null,"y2",a[1]);break;case"radial":const i=e[4],s=e[5],l=e[6],o=e[7];r=this.svgFactory.createElement("svg:radialGradient"),r.setAttributeNS(null,"id",t),r.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),r.setAttributeNS(null,"cx",s[0]),r.setAttributeNS(null,"cy",s[1]),r.setAttributeNS(null,"r",o),r.setAttributeNS(null,"fx",i[0]),r.setAttributeNS(null,"fy",i[1]),r.setAttributeNS(null,"fr",l);break;default:throw new Error("Unknown RadialAxial type: ".concat(e[1]))}for(const e of n){const t=this.svgFactory.createElement("svg:stop");t.setAttributeNS(null,"offset",e[0]),t.setAttributeNS(null,"stop-color",e[1]),r.append(t)}return this.defs.append(r),"url(#".concat(t,")");case"Mesh":return(0,a.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: ".concat(e[0]))}}setDash(e,t){this.current.dashArray=e,this.current.dashPhase=t}constructPath(e,t){const n=this.current;let r=n.x,i=n.y,s=[],l=0;for(const o of e)switch(0|o){case a.OPS.rectangle:r=t[l++],i=t[l++];const e=r+t[l++],n=i+t[l++];s.push("M",f(r),f(i),"L",f(e),f(i),"L",f(e),f(n),"L",f(r),f(n),"Z");break;case a.OPS.moveTo:r=t[l++],i=t[l++],s.push("M",f(r),f(i));break;case a.OPS.lineTo:r=t[l++],i=t[l++],s.push("L",f(r),f(i));break;case a.OPS.curveTo:r=t[l+4],i=t[l+5],s.push("C",f(t[l]),f(t[l+1]),f(t[l+2]),f(t[l+3]),f(r),f(i)),l+=6;break;case a.OPS.curveTo2:s.push("C",f(r),f(i),f(t[l]),f(t[l+1]),f(t[l+2]),f(t[l+3])),r=t[l+2],i=t[l+3],l+=4;break;case a.OPS.curveTo3:r=t[l+2],i=t[l+3],s.push("C",f(t[l]),f(t[l+1]),f(r),f(i),f(r),f(i)),l+=4;break;case a.OPS.closePath:s.push("Z")}s=s.join(" "),n.path&&e.length>0&&e[0]!==a.OPS.rectangle&&e[0]!==a.OPS.moveTo?s=n.path.getAttributeNS(null,"d")+s:(n.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(n.path)),n.path.setAttributeNS(null,"d",s),n.path.setAttributeNS(null,"fill","none"),n.element=n.path,n.setCurrentPoint(r,i)}endPath(){const e=this.current;if(e.path=null,!this.pendingClip)return;if(!e.element)return void(this.pendingClip=null);const t="clippath".concat(m++),n=this.svgFactory.createElement("svg:clipPath");n.setAttributeNS(null,"id",t),n.setAttributeNS(null,"transform",p(this.transformMatrix));const r=e.element.cloneNode(!0);if("evenodd"===this.pendingClip?r.setAttributeNS(null,"clip-rule","evenodd"):r.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,n.append(r),this.defs.append(n),e.activeClipUrl){e.clipGroup=null;for(const e of this.extraStack)e.clipGroup=null;n.setAttributeNS(null,"clip-path",e.activeClipUrl)}e.activeClipUrl="url(#".concat(t,")"),this.tgrp=null}clip(e){this.pendingClip=e}closePath(){const e=this.current;if(e.path){const t="".concat(e.path.getAttributeNS(null,"d"),"Z");e.path.setAttributeNS(null,"d",t)}}setLeading(e){this.current.leading=-e}setTextRise(e){this.current.textRise=e}setTextRenderingMode(e){this.current.textRenderingMode=e}setHScale(e){this.current.textHScale=e/100}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,n]of e)switch(t){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n);break;case"CA":this.setStrokeAlpha(n);break;case"ca":this.setFillAlpha(n);break;default:(0,a.warn)("Unimplemented graphic state operator ".concat(t))}}fill(){const e=this.current;e.element&&(e.element.setAttributeNS(null,"fill",e.fillColor),e.element.setAttributeNS(null,"fill-opacity",e.fillAlpha),this.endPath())}stroke(){const e=this.current;e.element&&(this._setStrokeAttributes(e.element),e.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=this.current;let r=n.dashArray;1!==t&&r.length>0&&(r=r.map((function(e){return t*e}))),e.setAttributeNS(null,"stroke",n.strokeColor),e.setAttributeNS(null,"stroke-opacity",n.strokeAlpha),e.setAttributeNS(null,"stroke-miterlimit",f(n.miterLimit)),e.setAttributeNS(null,"stroke-linecap",n.lineCap),e.setAttributeNS(null,"stroke-linejoin",n.lineJoin),e.setAttributeNS(null,"stroke-width",f(t*n.lineWidth)+"px"),e.setAttributeNS(null,"stroke-dasharray",r.map(f).join(" ")),e.setAttributeNS(null,"stroke-dashoffset",f(t*n.dashPhase)+"px")}eoFill(){var e;null===(e=this.current.element)||void 0===e||e.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var e;null===(e=this.current.element)||void 0===e||e.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const e=this.svgFactory.createElement("svg:rect");e.setAttributeNS(null,"x","0"),e.setAttributeNS(null,"y","0"),e.setAttributeNS(null,"width","1px"),e.setAttributeNS(null,"height","1px"),e.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(e)}paintImageXObject(e){const t=this.getObject(e);t?this.paintInlineImageXObject(t):(0,a.warn)("Dependent image with object ID ".concat(e," is not ready yet"))}paintInlineImageXObject(e,t){const n=e.width,r=e.height,a=u(e,this.forceDataSchema,!!t),i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x","0"),i.setAttributeNS(null,"y","0"),i.setAttributeNS(null,"width",f(n)),i.setAttributeNS(null,"height",f(r)),this.current.element=i,this.clip("nonzero");const s=this.svgFactory.createElement("svg:image");s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a),s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y",f(-r)),s.setAttributeNS(null,"width",f(n)+"px"),s.setAttributeNS(null,"height",f(r)+"px"),s.setAttributeNS(null,"transform","scale(".concat(f(1/n)," ").concat(f(-1/r),")")),t?t.append(s):this._ensureTransformGroup().append(s)}paintImageMaskXObject(e){const t=this.getObject(e.data,e);if(t.bitmap)return void(0,a.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");const n=this.current,r=t.width,i=t.height,s=n.fillColor;n.maskId="mask".concat(g++);const l=this.svgFactory.createElement("svg:mask");l.setAttributeNS(null,"id",n.maskId);const o=this.svgFactory.createElement("svg:rect");o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y","0"),o.setAttributeNS(null,"width",f(r)),o.setAttributeNS(null,"height",f(i)),o.setAttributeNS(null,"fill",s),o.setAttributeNS(null,"mask","url(#".concat(n.maskId,")")),this.defs.append(l),this._ensureTransformGroup().append(o),this.paintInlineImageXObject(t,l)}paintFormXObjectBegin(e,t){if(Array.isArray(e)&&6===e.length&&this.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t){const e=t[2]-t[0],n=t[3]-t[1],r=this.svgFactory.createElement("svg:rect");r.setAttributeNS(null,"x",t[0]),r.setAttributeNS(null,"y",t[1]),r.setAttributeNS(null,"width",f(e)),r.setAttributeNS(null,"height",f(n)),this.current.element=r,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(e){const t=this.svgFactory.create(e.width,e.height),n=this.svgFactory.createElement("svg:defs");t.append(n),this.defs=n;const r=this.svgFactory.createElement("svg:g");return r.setAttributeNS(null,"transform",p(e.transform)),t.append(r),this.svg=r,t}_ensureClipGroup(){if(!this.current.clipGroup){const e=this.svgFactory.createElement("svg:g");e.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(e),this.current.clipGroup=e}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",p(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaText=void 0;class n{static textContent(e){const t=[],r={items:t,styles:Object.create(null)};return function e(r){var a;if(!r)return;let i=null;const s=r.name;if("#text"===s)i=r.value;else{if(!n.shouldBuildText(s))return;null!==r&&void 0!==r&&null!==(a=r.attributes)&&void 0!==a&&a.textContent?i=r.attributes.textContent:r.value&&(i=r.value)}if(null!==i&&t.push({str:i}),r.children)for(const t of r.children)e(t)}(e),r}static shouldBuildText(e){return!("textarea"===e||"input"===e||"option"===e||"select"===e)}}t.XfaText=n},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextLayerRenderTask=void 0,t.renderTextLayer=function(e){e.textContentSource||!e.textContent&&!e.textContentStream||((0,a.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),e.textContentSource=e.textContent||e.textContentStream);const{container:t,viewport:n}=e,r=getComputedStyle(t),i=r.getPropertyValue("visibility"),s=parseFloat(r.getPropertyValue("--scale-factor"));"visible"===i&&(!s||Math.abs(s-n.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const l=new u(e);return l._render(),l},t.updateTextLayer=function(e){let{container:t,viewport:n,textDivs:r,textDivProperties:i,isOffscreenCanvasSupported:s,mustRotate:l=!0,mustRescale:c=!0}=e;if(l&&(0,a.setLayerDimensions)(t,{rotation:n.rotation}),c){const e=o(0,s),t={prevFontSize:null,prevFontFamily:null,div:null,scale:n.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:e};for(const n of r)t.properties=i.get(n),t.div=n,d(t)}};var r=n(1),a=n(6);const i=30,s=.8,l=new Map;function o(e,t){let n;if(t&&r.FeatureTest.isOffscreenCanvasSupported)n=new OffscreenCanvas(e,e).getContext("2d",{alpha:!1});else{const t=document.createElement("canvas");t.width=t.height=e,n=t.getContext("2d",{alpha:!1})}return n}function c(e,t,n){const a=document.createElement("span"),c={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};e._textDivs.push(a);const d=r.Util.transform(e._transform,t.transform);let u=Math.atan2(d[1],d[0]);const h=n[t.fontName];h.vertical&&(u+=Math.PI/2);const f=Math.hypot(d[2],d[3]),p=f*function(e,t){const n=l.get(e);if(n)return n;const r=o(i,t);r.font="".concat(i,"px ").concat(e);const a=r.measureText("");let c=a.fontBoundingBoxAscent,d=Math.abs(a.fontBoundingBoxDescent);if(c){const t=c/(c+d);return l.set(e,t),r.canvas.width=r.canvas.height=0,t}r.strokeStyle="red",r.clearRect(0,0,i,i),r.strokeText("g",0,0);let u=r.getImageData(0,0,i,i).data;d=0;for(let s=u.length-1-3;s>=0;s-=4)if(u[s]>0){d=Math.ceil(s/4/i);break}r.clearRect(0,0,i,i),r.strokeText("A",0,i),u=r.getImageData(0,0,i,i).data,c=0;for(let s=0,l=u.length;s0){c=i-Math.floor(s/4/i);break}if(r.canvas.width=r.canvas.height=0,c){const t=c/(c+d);return l.set(e,t),t}return l.set(e,s),s}(h.fontFamily,e._isOffscreenCanvasSupported);let m,g;0===u?(m=d[4],g=d[5]-p):(m=d[4]+p*Math.sin(u),g=d[5]-p*Math.cos(u));const v="calc(var(--scale-factor)*",x=a.style;e._container===e._rootContainer?(x.left="".concat((100*m/e._pageWidth).toFixed(2),"%"),x.top="".concat((100*g/e._pageHeight).toFixed(2),"%")):(x.left="".concat(v).concat(m.toFixed(2),"px)"),x.top="".concat(v).concat(g.toFixed(2),"px)")),x.fontSize="".concat(v).concat(f.toFixed(2),"px)"),x.fontFamily=h.fontFamily,c.fontSize=f,a.setAttribute("role","presentation"),a.textContent=t.str,a.dir=t.dir,e._fontInspectorEnabled&&(a.dataset.fontName=t.fontName),0!==u&&(c.angle=u*(180/Math.PI));let b=!1;if(t.str.length>1)b=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),n=Math.abs(t.transform[3]);e!==n&&Math.max(e,n)/Math.min(e,n)>1.5&&(b=!0)}b&&(c.canvasWidth=h.vertical?t.height:t.width),e._textDivProperties.set(a,c),e._isReadableStream&&e._layoutText(a)}function d(e){const{div:t,scale:n,properties:r,ctx:a,prevFontSize:i,prevFontFamily:s}=e,{style:l}=t;let o="";if(0!==r.canvasWidth&&r.hasText){const{fontFamily:c}=l,{canvasWidth:d,fontSize:u}=r;i===u&&s===c||(a.font="".concat(u*n,"px ").concat(c),e.prevFontSize=u,e.prevFontFamily=c);const{width:h}=a.measureText(t.textContent);h>0&&(o="scaleX(".concat(d*n/h,")"))}0!==r.angle&&(o="rotate(".concat(r.angle,"deg) ").concat(o)),o.length>0&&(l.transform=o)}class u{constructor(e){var t;let{textContentSource:n,container:i,viewport:s,textDivs:l,textDivProperties:c,textContentItemsStr:d,isOffscreenCanvasSupported:u}=e;this._textContentSource=n,this._isReadableStream=n instanceof ReadableStream,this._container=this._rootContainer=i,this._textDivs=l||[],this._textContentItemsStr=d||[],this._isOffscreenCanvasSupported=u,this._fontInspectorEnabled=!(null===(t=globalThis.FontInspector)||void 0===t||!t.enabled),this._reader=null,this._textDivProperties=c||new WeakMap,this._canceled=!1,this._capability=new r.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:s.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:o(0,u)};const{pageWidth:h,pageHeight:f,pageX:p,pageY:m}=s.rawDims;this._transform=[1,0,0,-1,-p,m+f],this._pageWidth=h,this._pageHeight=f,(0,a.setLayerDimensions)(i,s),this._capability.promise.finally((()=>{this._layoutTextParams=null})).catch((()=>{}))}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new r.AbortException("TextLayer task cancelled.")).catch((()=>{})),this._reader=null),this._capability.reject(new r.AbortException("TextLayer task cancelled."))}_processItems(e,t){for(const n of e)if(void 0!==n.str)this._textContentItemsStr.push(n.str),c(this,n,t);else if("beginMarkedContentProps"===n.type||"beginMarkedContent"===n.type){const e=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==n.id&&this._container.setAttribute("id","".concat(n.id)),e.append(this._container)}else"endMarkedContent"===n.type&&(this._container=this._container.parentNode)}_layoutText(e){const t=this._layoutTextParams.properties=this._textDivProperties.get(e);if(this._layoutTextParams.div=e,d(this._layoutTextParams),t.hasText&&this._container.append(e),t.hasEOL){const e=document.createElement("br");e.setAttribute("role","presentation"),this._container.append(e)}}_render(){const e=new r.PromiseCapability;let t=Object.create(null);if(this._isReadableStream){const n=()=>{this._reader.read().then((r=>{let{value:a,done:i}=r;i?e.resolve():(Object.assign(t,a.styles),this._processItems(a.items,t),n())}),e.reject)};this._reader=this._textContentSource.getReader(),n()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{const{items:t,styles:n}=this._textContentSource;this._processItems(t,n),e.resolve()}}e.promise.then((()=>{t=null,function(e){if(e._canceled)return;const t=e._textDivs,n=e._capability;if(t.length>1e5)n.resolve();else{if(!e._isReadableStream)for(const n of t)e._layoutText(n);n.resolve()}}(this)}),this._capability.reject)}}t.TextLayerRenderTask=u},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditorLayer=void 0;var r=n(1),a=n(4),i=n(28),s=n(33),l=n(6),o=n(34),c=new WeakMap,d=new WeakMap,u=new WeakMap,h=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,g=new WeakMap,v=new WeakMap,x=new WeakMap,b=new WeakSet;class y{constructor(e){let{uiManager:t,pageIndex:n,div:r,accessibilityManager:a,annotationLayer:l,viewport:w,l10n:_}=e;_classPrivateMethodInitSpec(this,b),_classPrivateFieldInitSpec(this,c,void 0),_classPrivateFieldInitSpec(this,d,!1),_classPrivateFieldInitSpec(this,u,null),_classPrivateFieldInitSpec(this,h,this.pointerup.bind(this)),_classPrivateFieldInitSpec(this,f,this.pointerdown.bind(this)),_classPrivateFieldInitSpec(this,p,new Map),_classPrivateFieldInitSpec(this,m,!1),_classPrivateFieldInitSpec(this,g,!1),_classPrivateFieldInitSpec(this,v,!1),_classPrivateFieldInitSpec(this,x,void 0);const S=[i.FreeTextEditor,s.InkEditor,o.StampEditor];if(!y._initialized){y._initialized=!0;for(const e of S)e.initialize(_)}t.registerEditorTypes(S),_classPrivateFieldSet(x,this,t),this.pageIndex=n,this.div=r,_classPrivateFieldSet(c,this,a),_classPrivateFieldSet(u,this,l),this.viewport=w,_classPrivateFieldGet(x,this).addLayer(this)}get isEmpty(){return 0===_classPrivateFieldGet(p,this).size}updateToolbar(e){_classPrivateFieldGet(x,this).updateToolbar(e)}updateMode(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_classPrivateFieldGet(x,this).getMode();_assertClassBrand(b,this,P).call(this),e===r.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),e!==r.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",e===r.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",e===r.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",e===r.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(e){if(e||_classPrivateFieldGet(x,this).getMode()===r.AnnotationEditorType.INK){if(!e)for(const e of _classPrivateFieldGet(p,this).values())if(e.isEmpty())return void e.setInBackground();_assertClassBrand(b,this,_).call(this,{offsetX:0,offsetY:0},!1).setInBackground()}}setEditingState(e){_classPrivateFieldGet(x,this).setEditingState(e)}addCommands(e){_classPrivateFieldGet(x,this).addCommands(e)}enable(){this.div.style.pointerEvents="auto";const e=new Set;for(const n of _classPrivateFieldGet(p,this).values())n.enableEditing(),n.annotationElementId&&e.add(n.annotationElementId);if(!_classPrivateFieldGet(u,this))return;const t=_classPrivateFieldGet(u,this).getEditableAnnotations();for(const n of t){if(n.hide(),_classPrivateFieldGet(x,this).isDeletedAnnotationElement(n.data.id))continue;if(e.has(n.data.id))continue;const t=this.deserialize(n);t&&(this.addOrRebuild(t),t.enableEditing())}}disable(){_classPrivateFieldSet(v,this,!0),this.div.style.pointerEvents="none";const e=new Set;for(const n of _classPrivateFieldGet(p,this).values()){var t;n.disableEditing(),n.annotationElementId&&null===n.serialize()?(null===(t=this.getEditableAnnotation(n.annotationElementId))||void 0===t||t.show(),n.remove()):e.add(n.annotationElementId)}if(_classPrivateFieldGet(u,this)){const t=_classPrivateFieldGet(u,this).getEditableAnnotations();for(const n of t){const{id:t}=n.data;e.has(t)||_classPrivateFieldGet(x,this).isDeletedAnnotationElement(t)||n.show()}}_assertClassBrand(b,this,P).call(this),this.isEmpty&&(this.div.hidden=!0),_classPrivateFieldSet(v,this,!1)}getEditableAnnotation(e){var t;return(null===(t=_classPrivateFieldGet(u,this))||void 0===t?void 0:t.getEditableAnnotation(e))||null}setActiveEditor(e){_classPrivateFieldGet(x,this).getActive()!==e&&_classPrivateFieldGet(x,this).setActiveEditor(e)}enableClick(){this.div.addEventListener("pointerdown",_classPrivateFieldGet(f,this)),this.div.addEventListener("pointerup",_classPrivateFieldGet(h,this))}disableClick(){this.div.removeEventListener("pointerdown",_classPrivateFieldGet(f,this)),this.div.removeEventListener("pointerup",_classPrivateFieldGet(h,this))}attach(e){_classPrivateFieldGet(p,this).set(e.id,e);const{annotationElementId:t}=e;t&&_classPrivateFieldGet(x,this).isDeletedAnnotationElement(t)&&_classPrivateFieldGet(x,this).removeDeletedAnnotationElement(e)}detach(e){var t;_classPrivateFieldGet(p,this).delete(e.id),null===(t=_classPrivateFieldGet(c,this))||void 0===t||t.removePointerInTextLayer(e.contentDiv),!_classPrivateFieldGet(v,this)&&e.annotationElementId&&_classPrivateFieldGet(x,this).addDeletedAnnotationElement(e)}remove(e){this.detach(e),_classPrivateFieldGet(x,this).removeEditor(e),e.div.contains(document.activeElement)&&setTimeout((()=>{_classPrivateFieldGet(x,this).focusMainContainer()}),0),e.div.remove(),e.isAttachedToDOM=!1,_classPrivateFieldGet(g,this)||this.addInkEditorIfNeeded(!1)}changeParent(e){var t;e.parent!==this&&(e.annotationElementId&&(_classPrivateFieldGet(x,this).addDeletedAnnotationElement(e.annotationElementId),a.AnnotationEditor.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),null===(t=e.parent)||void 0===t||t.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(this.changeParent(e),_classPrivateFieldGet(x,this).addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(),_classPrivateFieldGet(x,this).addToAnnotationStorage(e)}moveEditorInDOM(e){var t;if(!e.isAttachedToDOM)return;const{activeElement:n}=document;e.div.contains(n)&&(e._focusEventsAllowed=!1,setTimeout((()=>{e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",(()=>{e._focusEventsAllowed=!0}),{once:!0}),n.focus())}),0)),e._structTreeParentId=null===(t=_classPrivateFieldGet(c,this))||void 0===t?void 0:t.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?e.rebuild():this.add(e)}addUndoableEditor(e){this.addCommands({cmd:()=>e._uiManager.rebuild(e),undo:()=>{e.remove()},mustExec:!1})}getNextId(){return _classPrivateFieldGet(x,this).getId()}pasteEditor(e,t){_classPrivateFieldGet(x,this).updateToolbar(e),_classPrivateFieldGet(x,this).updateMode(e);const{offsetX:n,offsetY:r}=_assertClassBrand(b,this,S).call(this),a=this.getNextId(),i=_assertClassBrand(b,this,w).call(this,{parent:this,id:a,x:n,y:r,uiManager:_classPrivateFieldGet(x,this),isCentered:!0,...t});i&&this.add(i)}deserialize(e){var t;switch(null!==(t=e.annotationType)&&void 0!==t?t:e.annotationEditorType){case r.AnnotationEditorType.FREETEXT:return i.FreeTextEditor.deserialize(e,this,_classPrivateFieldGet(x,this));case r.AnnotationEditorType.INK:return s.InkEditor.deserialize(e,this,_classPrivateFieldGet(x,this));case r.AnnotationEditorType.STAMP:return o.StampEditor.deserialize(e,this,_classPrivateFieldGet(x,this))}return null}addNewEditor(){_assertClassBrand(b,this,_).call(this,_assertClassBrand(b,this,S).call(this),!0)}setSelected(e){_classPrivateFieldGet(x,this).setSelected(e)}toggleSelected(e){_classPrivateFieldGet(x,this).toggleSelected(e)}isSelected(e){return _classPrivateFieldGet(x,this).isSelected(e)}unselect(e){_classPrivateFieldGet(x,this).unselect(e)}pointerup(e){const{isMac:t}=r.FeatureTest.platform;0!==e.button||e.ctrlKey&&t||e.target===this.div&&_classPrivateFieldGet(m,this)&&(_classPrivateFieldSet(m,this,!1),_classPrivateFieldGet(d,this)?_classPrivateFieldGet(x,this).getMode()!==r.AnnotationEditorType.STAMP?_assertClassBrand(b,this,_).call(this,e,!1):_classPrivateFieldGet(x,this).unselectAll():_classPrivateFieldSet(d,this,!0))}pointerdown(e){if(_classPrivateFieldGet(m,this))return void _classPrivateFieldSet(m,this,!1);const{isMac:t}=r.FeatureTest.platform;if(0!==e.button||e.ctrlKey&&t)return;if(e.target!==this.div)return;_classPrivateFieldSet(m,this,!0);const n=_classPrivateFieldGet(x,this).getActive();_classPrivateFieldSet(d,this,!n||n.isEmpty())}findNewParent(e,t,n){const r=_classPrivateFieldGet(x,this).findParent(t,n);return null!==r&&r!==this&&(r.changeParent(e),!0)}destroy(){var e;(null===(e=_classPrivateFieldGet(x,this).getActive())||void 0===e?void 0:e.parent)===this&&(_classPrivateFieldGet(x,this).commitOrRemove(),_classPrivateFieldGet(x,this).setActiveEditor(null));for(const n of _classPrivateFieldGet(p,this).values()){var t;null===(t=_classPrivateFieldGet(c,this))||void 0===t||t.removePointerInTextLayer(n.contentDiv),n.setParent(null),n.isAttachedToDOM=!1,n.div.remove()}this.div=null,_classPrivateFieldGet(p,this).clear(),_classPrivateFieldGet(x,this).removeLayer(this)}render(e){let{viewport:t}=e;this.viewport=t,(0,l.setLayerDimensions)(this.div,t);for(const n of _classPrivateFieldGet(x,this).getEditors(this.pageIndex))this.add(n);this.updateMode()}update(e){let{viewport:t}=e;_classPrivateFieldGet(x,this).commitOrRemove(),this.viewport=t,(0,l.setLayerDimensions)(this.div,{rotation:t.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}}function w(e){switch(_classPrivateFieldGet(x,this).getMode()){case r.AnnotationEditorType.FREETEXT:return new i.FreeTextEditor(e);case r.AnnotationEditorType.INK:return new s.InkEditor(e);case r.AnnotationEditorType.STAMP:return new o.StampEditor(e)}return null}function _(e,t){const n=this.getNextId(),r=_assertClassBrand(b,this,w).call(this,{parent:this,id:n,x:e.offsetX,y:e.offsetY,uiManager:_classPrivateFieldGet(x,this),isCentered:t});return r&&this.add(r),r}function S(){const{x:e,y:t,width:n,height:r}=this.div.getBoundingClientRect(),a=Math.max(0,e),i=Math.max(0,t),s=(a+Math.min(window.innerWidth,e+n))/2-e,l=(i+Math.min(window.innerHeight,t+r))/2-t,[o,c]=this.viewport.rotation%180===0?[s,l]:[l,s];return{offsetX:o,offsetY:c}}function P(){_classPrivateFieldSet(g,this,!0);for(const e of _classPrivateFieldGet(p,this).values())e.isEmpty()&&e.remove();_classPrivateFieldSet(g,this,!1)}_defineProperty(y,"_initialized",!1),t.AnnotationEditorLayer=y},(e,t,n)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.FreeTextEditor=void 0;var a=n(1),i=n(5),s=n(4),l=n(29),o=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,h=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,g=new WeakMap,v=new WeakSet;class x extends s.AnnotationEditor{static get _keyboardManager(){const e=x.prototype,t=e=>e.isEmpty(),n=i.AnnotationEditorUIManager.TRANSLATE_SMALL,r=i.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,a.shadow)(this,"_keyboardManager",new i.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-n,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-r,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[n,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[r,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-n],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-r],checker:t}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,n],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,r],checker:t}]]))}constructor(e){super({...e,name:"freeTextEditor"}),_classPrivateMethodInitSpec(this,v),_classPrivateFieldInitSpec(this,o,this.editorDivBlur.bind(this)),_classPrivateFieldInitSpec(this,c,this.editorDivFocus.bind(this)),_classPrivateFieldInitSpec(this,d,this.editorDivInput.bind(this)),_classPrivateFieldInitSpec(this,u,this.editorDivKeydown.bind(this)),_classPrivateFieldInitSpec(this,h,void 0),_classPrivateFieldInitSpec(this,f,""),_classPrivateFieldInitSpec(this,p,"".concat(this.id,"-editor")),_classPrivateFieldInitSpec(this,m,void 0),_classPrivateFieldInitSpec(this,g,null),_classPrivateFieldSet(h,this,e.color||x._defaultColor||s.AnnotationEditor._defaultLineColor),_classPrivateFieldSet(m,this,e.fontSize||x._defaultFontSize)}static initialize(e){s.AnnotationEditor.initialize(e,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});const t=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(t.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,t){switch(e){case a.AnnotationEditorParamsType.FREETEXT_SIZE:x._defaultFontSize=t;break;case a.AnnotationEditorParamsType.FREETEXT_COLOR:x._defaultColor=t}}updateParams(e,t){switch(e){case a.AnnotationEditorParamsType.FREETEXT_SIZE:_assertClassBrand(v,this,b).call(this,t);break;case a.AnnotationEditorParamsType.FREETEXT_COLOR:_assertClassBrand(v,this,y).call(this,t)}}static get defaultPropertiesToUpdate(){return[[a.AnnotationEditorParamsType.FREETEXT_SIZE,x._defaultFontSize],[a.AnnotationEditorParamsType.FREETEXT_COLOR,x._defaultColor||s.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[a.AnnotationEditorParamsType.FREETEXT_SIZE,_classPrivateFieldGet(m,this)],[a.AnnotationEditorParamsType.FREETEXT_COLOR,_classPrivateFieldGet(h,this)]]}_translateEmpty(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}getInitialTranslation(){const e=this.parentScale;return[-x._internalPadding*e,-(x._internalPadding+_classPrivateFieldGet(m,this))*e]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(a.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",_classPrivateFieldGet(u,this)),this.editorDiv.addEventListener("focus",_classPrivateFieldGet(c,this)),this.editorDiv.addEventListener("blur",_classPrivateFieldGet(o,this)),this.editorDiv.addEventListener("input",_classPrivateFieldGet(d,this)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",_classPrivateFieldGet(p,this)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",_classPrivateFieldGet(u,this)),this.editorDiv.removeEventListener("focus",_classPrivateFieldGet(c,this)),this.editorDiv.removeEventListener("blur",_classPrivateFieldGet(o,this)),this.editorDiv.removeEventListener("input",_classPrivateFieldGet(d,this)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var e;this.width?_assertClassBrand(v,this,C).call(this):(this.enableEditMode(),this.editorDiv.focus(),null!==(e=this._initialOptions)&&void 0!==e&&e.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=_classPrivateFieldGet(f,this),t=_classPrivateFieldSet(f,this,_assertClassBrand(v,this,w).call(this).trimEnd());if(e===t)return;const n=e=>{_classPrivateFieldSet(f,this,e),e?(_assertClassBrand(v,this,S).call(this),this._uiManager.rebuild(this),_assertClassBrand(v,this,_).call(this)):this.remove()};this.addCommands({cmd:()=>{n(t)},undo:()=>{n(e)},mustExec:!1}),_assertClassBrand(v,this,_).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(e){this.enterInEditMode()}keydown(e){e.target===this.div&&"Enter"===e.key&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){x._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",_classPrivateFieldGet(p,this)),this.enableEditing(),s.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then((e=>{var t;return null===(t=this.editorDiv)||void 0===t?void 0:t.setAttribute("aria-label",e)})),s.AnnotationEditor._l10nPromise.get("free_text2_default_content").then((e=>{var t;return null===(t=this.editorDiv)||void 0===t?void 0:t.setAttribute("default-content",e)})),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize="calc(".concat(_classPrivateFieldGet(m,this),"px * var(--scale-factor))"),n.color=_classPrivateFieldGet(h,this),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,i.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[n,r]=this.parentDimensions;if(this.annotationElementId){const{position:a}=_classPrivateFieldGet(g,this);let[i,s]=this.getInitialTranslation();[i,s]=this.pageTranslationToScreen(i,s);const[l,o]=this.pageDimensions,[c,d]=this.pageTranslation;let u,h;switch(this.rotation){case 0:u=e+(a[0]-c)/l,h=t+this.height-(a[1]-d)/o;break;case 90:u=e+(a[0]-c)/l,h=t-(a[1]-d)/o,[i,s]=[s,-i];break;case 180:u=e-this.width+(a[0]-c)/l,h=t-(a[1]-d)/o,[i,s]=[-i,-s];break;case 270:u=e+(a[0]-c-this.height*o)/l,h=t+(a[1]-d-this.width*l)/o,[i,s]=[-s,i]}this.setAt(u*n,h*r,i,s)}else this.setAt(e*n,t*r,this.width*n,this.height*r);_assertClassBrand(v,this,S).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(e,t,n){let r=null;if(e instanceof l.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:t,fontColor:n},rect:i,rotation:s,id:l},textContent:o,textPosition:c,parent:{page:{pageNumber:d}}}=e;if(!o||0===o.length)return null;r=e={annotationType:a.AnnotationEditorType.FREETEXT,color:Array.from(n),fontSize:t,value:o.join("\n"),position:c,pageIndex:d-1,rect:i,rotation:s,id:l,deleted:!1}}const i=super.deserialize(e,t,n);return _classPrivateFieldSet(m,i,e.fontSize),_classPrivateFieldSet(h,i,a.Util.makeHexColor(...e.color)),_classPrivateFieldSet(f,i,e.value),i.annotationElementId=e.id||null,_classPrivateFieldSet(g,i,r),i}serialize(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const t=x._internalPadding*this.parentScale,n=this.getRect(t,t),r=s.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:_classPrivateFieldGet(h,this)),i={annotationType:a.AnnotationEditorType.FREETEXT,color:r,fontSize:_classPrivateFieldGet(m,this),value:_classPrivateFieldGet(f,this),pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return e?i:this.annotationElementId&&!_assertClassBrand(v,this,P).call(this,i)?null:(i.id=this.annotationElementId,i)}}function b(e){const t=e=>{this.editorDiv.style.fontSize="calc(".concat(e,"px * var(--scale-factor))"),this.translate(0,-(e-_classPrivateFieldGet(m,this))*this.parentScale),_classPrivateFieldSet(m,this,e),_assertClassBrand(v,this,_).call(this)},n=_classPrivateFieldGet(m,this);this.addCommands({cmd:()=>{t(e)},undo:()=>{t(n)},mustExec:!0,type:a.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function y(e){const t=_classPrivateFieldGet(h,this);this.addCommands({cmd:()=>{_classPrivateFieldSet(h,this,this.editorDiv.style.color=e)},undo:()=>{_classPrivateFieldSet(h,this,this.editorDiv.style.color=t)},mustExec:!0,type:a.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function w(){const e=this.editorDiv.getElementsByTagName("div");if(0===e.length)return this.editorDiv.innerText;const t=[];for(const n of e)t.push(n.innerText.replace(/\r\n?|\n/,""));return t.join("\n")}function _(){const[e,t]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:e,div:t}=this,r=t.style.display;t.style.display="hidden",e.div.append(this.div),n=t.getBoundingClientRect(),t.remove(),t.style.display=r}this.rotation%180===this.parentRotation%180?(this.width=n.width/e,this.height=n.height/t):(this.width=n.height/e,this.height=n.width/t),this.fixAndSetPosition()}function S(){if(this.editorDiv.replaceChildren(),_classPrivateFieldGet(f,this))for(const e of _classPrivateFieldGet(f,this).split("\n")){const t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}}function P(e){const{value:t,fontSize:n,color:r,rect:a,pageIndex:i}=_classPrivateFieldGet(g,this);return e.value!==t||e.fontSize!==n||e.rect.some(((e,t)=>Math.abs(e-a[t])>=1))||e.color.some(((e,t)=>e!==r[t]))||e.pageIndex!==i}function C(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.annotationElementId)return;if(_assertClassBrand(v,this,_).call(this),!e&&(0===this.width||0===this.height))return void setTimeout((()=>_assertClassBrand(v,this,C).call(this,!0)),0);const t=r._internalPadding*this.parentScale;_classPrivateFieldGet(g,this).rect=this.getRect(t,t)}r=x,_defineProperty(x,"_freeTextDefaultContent",""),_defineProperty(x,"_internalPadding",0),_defineProperty(x,"_defaultColor",null),_defineProperty(x,"_defaultFontSize",10),_defineProperty(x,"_type","freetext"),t.FreeTextEditor=x},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StampAnnotationElement=t.InkAnnotationElement=t.FreeTextAnnotationElement=t.AnnotationLayer=void 0;var r=n(1),a=n(6),i=n(3),s=n(30),l=n(31),o=n(32);const c=1e3,d=new WeakSet;function u(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class h{static create(e){switch(e.data.annotationType){case r.AnnotationType.LINK:return new g(e);case r.AnnotationType.TEXT:return new b(e);case r.AnnotationType.WIDGET:switch(e.data.fieldType){case"Tx":return new w(e);case"Btn":return e.data.radioButton?new P(e):e.data.checkBox?new S(e):new C(e);case"Ch":return new A(e);case"Sig":return new _(e)}return new y(e);case r.AnnotationType.POPUP:return new k(e);case r.AnnotationType.FREETEXT:return new Q(e);case r.AnnotationType.LINE:return new $(e);case r.AnnotationType.SQUARE:return new te(e);case r.AnnotationType.CIRCLE:return new re(e);case r.AnnotationType.POLYLINE:return new ie(e);case r.AnnotationType.CARET:return new le(e);case r.AnnotationType.INK:return new ce(e);case r.AnnotationType.POLYGON:return new se(e);case r.AnnotationType.HIGHLIGHT:return new de(e);case r.AnnotationType.UNDERLINE:return new ue(e);case r.AnnotationType.SQUIGGLY:return new he(e);case r.AnnotationType.STRIKEOUT:return new fe(e);case r.AnnotationType.STAMP:return new pe(e);case r.AnnotationType.FILEATTACHMENT:return new ve(e);default:return new p(e)}}}var f=new WeakMap;class p{constructor(e){let{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:r=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classPrivateFieldInitSpec(this,f,!1),this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,t&&(this.container=this._createContainer(n)),r&&this._createQuadrilaterals()}static _hasPopupData(e){let{titleObj:t,contentsObj:n,richText:r}=e;return!!(null!==t&&void 0!==t&&t.str||null!==n&&void 0!==n&&n.str||null!==r&&void 0!==r&&r.str)}get hasPopupData(){return p._hasPopupData(this.data)}_createContainer(e){const{data:t,parent:{page:n,viewport:a}}=this,i=document.createElement("section");i.setAttribute("data-annotation-id",t.id),this instanceof y||(i.tabIndex=c),i.style.zIndex=this.parent.zIndex++,this.data.popupRef&&i.setAttribute("aria-haspopup","dialog"),t.noRotate&&i.classList.add("norotate");const{pageWidth:s,pageHeight:l,pageX:o,pageY:d}=a.rawDims;if(!t.rect||this instanceof k){const{rotation:e}=t;return t.hasOwnCanvas||0===e||this.setRotation(e,i),i}const{width:h,height:p}=u(t.rect),m=r.Util.normalizeRect([t.rect[0],n.view[3]-t.rect[1]+n.view[1],t.rect[2],n.view[3]-t.rect[3]+n.view[1]]);if(!e&&t.borderStyle.width>0){i.style.borderWidth="".concat(t.borderStyle.width,"px");const e=t.borderStyle.horizontalCornerRadius,n=t.borderStyle.verticalCornerRadius;if(e>0||n>0){const t="calc(".concat(e,"px * var(--scale-factor)) / calc(").concat(n,"px * var(--scale-factor))");i.style.borderRadius=t}else if(this instanceof P){const e="calc(".concat(h,"px * var(--scale-factor)) / calc(").concat(p,"px * var(--scale-factor))");i.style.borderRadius=e}switch(t.borderStyle.style){case r.AnnotationBorderStyleType.SOLID:i.style.borderStyle="solid";break;case r.AnnotationBorderStyleType.DASHED:i.style.borderStyle="dashed";break;case r.AnnotationBorderStyleType.BEVELED:(0,r.warn)("Unimplemented border style: beveled");break;case r.AnnotationBorderStyleType.INSET:(0,r.warn)("Unimplemented border style: inset");break;case r.AnnotationBorderStyleType.UNDERLINE:i.style.borderBottomStyle="solid"}const a=t.borderColor||null;a?(_classPrivateFieldSet(f,this,!0),i.style.borderColor=r.Util.makeHexColor(0|a[0],0|a[1],0|a[2])):i.style.borderWidth=0}i.style.left="".concat(100*(m[0]-o)/s,"%"),i.style.top="".concat(100*(m[1]-d)/l,"%");const{rotation:g}=t;return t.hasOwnCanvas||0===g?(i.style.width="".concat(100*h/s,"%"),i.style.height="".concat(100*p/l,"%")):this.setRotation(g,i),i}setRotation(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;if(!this.data.rect)return;const{pageWidth:n,pageHeight:r}=this.parent.viewport.rawDims,{width:a,height:i}=u(this.data.rect);let s,l;e%180===0?(s=100*a/n,l=100*i/r):(s=100*i/n,l=100*a/r),t.style.width="".concat(s,"%"),t.style.height="".concat(l,"%"),t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(e,t,n)=>{const r=n.detail[e],a=r[0],i=r.slice(1);n.target.style[t]=s.ColorConverters["".concat(a,"_HTML")](i),this.annotationStorage.setValue(this.data.id,{[t]:s.ColorConverters["".concat(a,"_rgb")](i)})};return(0,r.shadow)(this,"_commonActions",{display:e=>{const{display:t}=e.detail,n=t%2===1;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:1===t||2===t})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{const{hidden:t}=e.detail;this.container.style.visibility=t?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:t,noView:t})},focus:e=>{setTimeout((()=>e.target.focus({preventScroll:!1})),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:e=>{const t=e.detail.rotation;this.setRotation(t),this.annotationStorage.setValue(this.data.id,{rotation:t})}})}_dispatchEventFromSandbox(e,t){const n=this._commonActions;for(const r of Object.keys(t.detail)){const a=e[r]||n[r];null===a||void 0===a||a(t)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const n=this._commonActions;for(const[r,a]of Object.entries(t)){const i=n[r];i&&(i({detail:{[r]:a},target:e}),delete t[r])}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[t,n,r,a]=this.data.rect;if(1===e.length){const[,{x:i,y:s},{x:l,y:o}]=e[0];if(r===i&&a===s&&t===l&&n===o)return}const{style:i}=this.container;let s;if(_classPrivateFieldGet(f,this)){const{borderColor:e,borderWidth:t}=i;i.borderWidth=0,s=["url('data:image/svg+xml;utf8,",'','')],this.container.classList.add("hasBorder")}const l=r-t,o=a-n,{svgFactory:c}=this,d=c.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0);const u=c.createElement("defs");d.append(u);const h=c.createElement("clipPath"),p="clippath_".concat(this.data.id);h.setAttribute("id",p),h.setAttribute("clipPathUnits","objectBoundingBox"),u.append(h);for(const[,{x:f,y:g},{x:v,y:x}]of e){var m;const e=c.createElement("rect"),n=(v-t)/l,r=(a-g)/o,i=(f-v)/l,d=(g-x)/o;e.setAttribute("x",n),e.setAttribute("y",r),e.setAttribute("width",i),e.setAttribute("height",d),h.append(e),null===(m=s)||void 0===m||m.push(''))}_classPrivateFieldGet(f,this)&&(s.push("')"),i.backgroundImage=s.join("")),this.container.append(d),this.container.style.clipPath="url(#".concat(p,")")}_createPopup(){const{container:e,data:t}=this;e.setAttribute("aria-haspopup","dialog");const n=new k({data:{color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,parentRect:t.rect,borderStyle:0,id:"popup_".concat(t.id),rotation:t.rotation},parent:this.parent,elements:[this]});this.parent.div.append(n.render())}render(){(0,r.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=[];if(this._fieldObjects){const a=this._fieldObjects[e];if(a)for(const{page:e,id:i,exportValues:s}of a){if(-1===e)continue;if(i===t)continue;const a="string"===typeof s?s:null,l=document.querySelector('[data-element-id="'.concat(i,'"]'));!l||d.has(l)?n.push({id:i,exportValue:a,domElement:l}):(0,r.warn)("_getElementsByName - element not allowed: ".concat(i))}return n}for(const r of document.getElementsByName(e)){const{exportValue:e}=r,a=r.getAttribute("data-element-id");a!==t&&d.has(r)&&n.push({id:a,exportValue:e,domElement:r})}return n}show(){var e;this.container&&(this.container.hidden=!1),null===(e=this.popup)||void 0===e||e.maybeShow()}hide(){var e;this.container&&(this.container.hidden=!0),null===(e=this.popup)||void 0===e||e.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){const{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener("dblclick",(()=>{var n;null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t})}))}}var m=new WeakSet;class g extends p{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(e,{isRenderable:!0,ignoreBorder:!(null===t||void 0===t||!t.ignoreBorder),createQuadrilaterals:!0}),_classPrivateMethodInitSpec(this,m),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:t}=this,n=document.createElement("a");n.setAttribute("data-element-id",e.id);let r=!1;return e.url?(t.addLinkAttributes(n,e.url,e.newWindow),r=!0):e.action?(this._bindNamedAction(n,e.action),r=!0):e.attachment?(this._bindAttachment(n,e.attachment),r=!0):e.setOCGState?(_assertClassBrand(m,this,x).call(this,n,e.setOCGState),r=!0):e.dest?(this._bindLink(n,e.dest),r=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,e),r=!0),e.resetForm?(this._bindResetFormAction(n,e.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(n,""),r=!0)),this.container.classList.add("linkAnnotation"),r&&this.container.append(n),this.container}_bindLink(e,t){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||""===t)&&_assertClassBrand(m,this,v).call(this)}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),_assertClassBrand(m,this,v).call(this)}_bindAttachment(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>{var e;return null===(e=this.downloadManager)||void 0===e||e.openOrDownloadData(this.container,t.content,t.filename),!1},_assertClassBrand(m,this,v).call(this)}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const r of Object.keys(t.actions)){const a=n.get(r);a&&(e[a]=()=>{var e;return null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:r}}),!1})}e.onclick||(e.onclick=()=>!1),_assertClassBrand(m,this,v).call(this)}_bindResetFormAction(e,t){const n=e.onclick;if(n||(e.href=this.linkService.getAnchorUrl("")),_assertClassBrand(m,this,v).call(this),!this._fieldObjects)return(0,r.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(n||(e.onclick=()=>!1));e.onclick=()=>{null===n||void 0===n||n();const{fields:e,refs:a,include:i}=t,s=[];if(0!==e.length||0!==a.length){const t=new Set(a);for(const n of e){const e=this._fieldObjects[n]||[];for(const{id:n}of e)t.add(n)}for(const e of Object.values(this._fieldObjects))for(const n of e)t.has(n.id)===i&&s.push(n)}else for(const t of Object.values(this._fieldObjects))s.push(...t);const l=this.annotationStorage,o=[];for(const t of s){const{id:e}=t;switch(o.push(e),t.type){case"text":{const n=t.defaultValue||"";l.setValue(e,{value:n});break}case"checkbox":case"radiobutton":{const n=t.defaultValue===t.exportValues;l.setValue(e,{value:n});break}case"combobox":case"listbox":{const n=t.defaultValue||"";l.setValue(e,{value:n});break}default:continue}const n=document.querySelector('[data-element-id="'.concat(e,'"]'));n&&(d.has(n)?n.dispatchEvent(new Event("resetform")):(0,r.warn)("_bindResetFormAction - element not allowed: ".concat(e)))}var c;return this.enableScripting&&(null===(c=this.linkService.eventBus)||void 0===c||c.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}})),!1}}}function v(){this.container.setAttribute("data-internal-link","")}function x(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),_assertClassBrand(m,this,v).call(this)}class b extends p{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.alt="[{{type}} Annotation]",e.dataset.l10nId="text_annotation_type",e.dataset.l10nArgs=JSON.stringify({type:this.data.name}),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}}class y extends p{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(e){var t;this.data.hasOwnCanvas&&("CANVAS"===(null===(t=e.previousSibling)||void 0===t?void 0:t.nodeName)&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){const{isWin:t,isMac:n}=r.FeatureTest.platform;return t&&e.ctrlKey||n&&e.metaKey}_setEventListener(e,t,n,r,a){n.includes("mouse")?e.addEventListener(n,(e=>{var t;null===(t=this.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:a(e),shift:e.shiftKey,modifier:this._getKeyModifier(e)}})})):e.addEventListener(n,(e=>{var i;if("blur"===n){if(!t.focused||!e.relatedTarget)return;t.focused=!1}else if("focus"===n){if(t.focused)return;t.focused=!0}a&&(null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:a(e)}}))}))}_setEventListeners(e,t,n,r){for(const[l,o]of n){var a,i,s;("Action"===o||null!==(a=this.data.actions)&&void 0!==a&&a[o])&&("Focus"!==o&&"Blur"!==o||t||(t={focused:!1}),this._setEventListener(e,t,l,o,r),"Focus"!==o||null!==(i=this.data.actions)&&void 0!==i&&i.Blur?"Blur"!==o||null!==(s=this.data.actions)&&void 0!==s&&s.Focus||this._setEventListener(e,t,"focus","Focus",null):this._setEventListener(e,t,"blur","Blur",null))}}_setBackgroundColor(e){const t=this.data.backgroundColor||null;e.style.backgroundColor=null===t?"transparent":r.Util.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){const t=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,a=this.data.defaultAppearanceData.fontSize||9,i=e.style;let s;const l=e=>Math.round(10*e)/10;if(this.data.multiLine){const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2),t=e/(Math.round(e/(r.LINE_FACTOR*a))||1);s=Math.min(a,l(t/r.LINE_FACTOR))}else{const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2);s=Math.min(a,l(e/r.LINE_FACTOR))}i.fontSize="calc(".concat(s,"px * var(--scale-factor))"),i.color=r.Util.makeHexColor(n[0],n[1],n[2]),null!==this.data.textAlignment&&(i.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class w extends y{constructor(e){super(e,{isRenderable:e.renderForms||!e.data.hasAppearance&&!!e.data.fieldValue})}setPropertyOnSiblings(e,t,n,r){const a=this.annotationStorage;for(const i of this._getElementsByName(e.name,e.id))i.domElement&&(i.domElement[t]=n),a.setValue(i.id,{[r]:n})}render(){const e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){var r;const l=e.getValue(t,{value:this.data.fieldValue});let o=l.value||"";const u=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;u&&o.length>u&&(o=o.slice(0,u));let h=l.formattedValue||(null===(r=this.data.textContent)||void 0===r?void 0:r.join("\n"))||null;h&&this.data.comb&&(h=h.replaceAll(/\s+/g,""));const f={userValue:o,formattedValue:h,lastCommittedValue:null,commitKey:1,focused:!1};var a,i;this.data.multiLine?(n=document.createElement("textarea"),n.textContent=null!==(a=h)&&void 0!==a?a:o,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type="text",n.setAttribute("value",null!==(i=h)&&void 0!==i?i:o),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),d.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=c,this._setRequired(n,this.data.required),u&&(n.maxLength=u),n.addEventListener("input",(r=>{e.setValue(t,{value:r.target.value}),this.setPropertyOnSiblings(n,"value",r.target.value,"value"),f.formattedValue=null})),n.addEventListener("resetform",(e=>{var t;const r=null!==(t=this.data.defaultFieldValue)&&void 0!==t?t:"";n.value=f.userValue=r,f.formattedValue=null}));let p=e=>{const{formattedValue:t}=f;null!==t&&void 0!==t&&(e.target.value=t),e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var s;n.addEventListener("focus",(e=>{if(f.focused)return;const{target:t}=e;f.userValue&&(t.value=f.userValue),f.lastCommittedValue=t.value,f.commitKey=1,f.focused=!0})),n.addEventListener("updatefromsandbox",(n=>{this.showElementAndHideCanvas(n.target);const r={value(n){var r;f.userValue=null!==(r=n.detail.value)&&void 0!==r?r:"",e.setValue(t,{value:f.userValue.toString()}),n.target.value=f.userValue},formattedValue(n){const{formattedValue:r}=n.detail;f.formattedValue=r,null!==r&&void 0!==r&&n.target!==document.activeElement&&(n.target.value=r),e.setValue(t,{formattedValue:r})},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:n=>{var r;const{charLimit:a}=n.detail,{target:i}=n;if(0===a)return void i.removeAttribute("maxLength");i.setAttribute("maxLength",a);let s=f.userValue;!s||s.length<=a||(s=s.slice(0,a),i.value=f.userValue=s,e.setValue(t,{value:s}),null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:s,willCommit:!0,commitKey:1,selStart:i.selectionStart,selEnd:i.selectionEnd}}))}};this._dispatchEventFromSandbox(r,n)})),n.addEventListener("keydown",(e=>{var n;f.commitKey=1;let r=-1;if("Escape"===e.key?r=0:"Enter"!==e.key||this.data.multiLine?"Tab"===e.key&&(f.commitKey=3):r=2,-1===r)return;const{value:a}=e.target;f.lastCommittedValue!==a&&(f.lastCommittedValue=a,f.userValue=a,null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:a,willCommit:!0,commitKey:r,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}))}));const r=p;p=null,n.addEventListener("blur",(e=>{if(!f.focused||!e.relatedTarget)return;f.focused=!1;const{value:n}=e.target;var a;f.userValue=n,f.lastCommittedValue!==n&&(null===(a=this.linkService.eventBus)||void 0===a||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:n,willCommit:!0,commitKey:f.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}})),r(e)})),null!==(s=this.data.actions)&&void 0!==s&&s.Keystroke&&n.addEventListener("beforeinput",(e=>{var n;f.lastCommittedValue=null;const{data:r,target:a}=e,{value:i,selectionStart:s,selectionEnd:l}=a;let o=s,c=l;switch(e.inputType){case"deleteWordBackward":{const e=i.substring(0,s).match(/\w*[^\w]*$/);e&&(o-=e[0].length);break}case"deleteWordForward":{const e=i.substring(s).match(/^[^\w]*\w*/);e&&(c+=e[0].length);break}case"deleteContentBackward":s===l&&(o-=1);break;case"deleteContentForward":s===l&&(c+=1)}e.preventDefault(),null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:i,change:r||"",willCommit:!1,selStart:o,selEnd:c}})})),this._setEventListeners(n,f,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.value))}if(p&&n.addEventListener("blur",p),this.data.comb){const e=(this.data.rect[2]-this.data.rect[0])/u;n.classList.add("comb"),n.style.letterSpacing="calc(".concat(e,"px * var(--scale-factor) - 1ch)")}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell";return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class _ extends y{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class S extends y{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,n=t.id;let r=e.getValue(n,{value:t.exportValue===t.fieldValue}).value;"string"===typeof r&&(r="Off"!==r,e.setValue(n,{value:r})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const a=document.createElement("input");return d.add(a),a.setAttribute("data-element-id",n),a.disabled=t.readOnly,this._setRequired(a,this.data.required),a.type="checkbox",a.name=t.fieldName,r&&a.setAttribute("checked",!0),a.setAttribute("exportValue",t.exportValue),a.tabIndex=c,a.addEventListener("change",(r=>{const{name:a,checked:i}=r.target;for(const s of this._getElementsByName(a,n)){const n=i&&s.exportValue===t.exportValue;s.domElement&&(s.domElement.checked=n),e.setValue(s.id,{value:n})}e.setValue(n,{value:i})})),a.addEventListener("resetform",(e=>{const n=t.defaultFieldValue||"Off";e.target.checked=n===t.exportValue})),this.enableScripting&&this.hasJSActions&&(a.addEventListener("updatefromsandbox",(t=>{const r={value(t){t.target.checked="Off"!==t.detail.value,e.setValue(n,{value:t.target.checked})}};this._dispatchEventFromSandbox(r,t)})),this._setEventListeners(a,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.checked))),this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class P extends y{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,t=this.data,n=t.id;let r=e.getValue(n,{value:t.fieldValue===t.buttonValue}).value;"string"===typeof r&&(r=r!==t.buttonValue,e.setValue(n,{value:r}));const a=document.createElement("input");if(d.add(a),a.setAttribute("data-element-id",n),a.disabled=t.readOnly,this._setRequired(a,this.data.required),a.type="radio",a.name=t.fieldName,r&&a.setAttribute("checked",!0),a.tabIndex=c,a.addEventListener("change",(t=>{const{name:r,checked:a}=t.target;for(const i of this._getElementsByName(r,n))e.setValue(i.id,{value:!1});e.setValue(n,{value:a})})),a.addEventListener("resetform",(e=>{const n=t.defaultFieldValue;e.target.checked=null!==n&&void 0!==n&&n===t.buttonValue})),this.enableScripting&&this.hasJSActions){const r=t.buttonValue;a.addEventListener("updatefromsandbox",(t=>{const a={value:t=>{const a=r===t.detail.value;for(const r of this._getElementsByName(t.target.name)){const t=a&&r.id===n;r.domElement&&(r.domElement.checked=t),e.setValue(r.id,{value:t})}}};this._dispatchEventFromSandbox(a,t)})),this._setEventListeners(a,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.checked))}return this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class C extends g{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(e.title=this.data.alternativeText);const t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",(e=>{this._dispatchEventFromSandbox({},e)}))),e}}class A extends y{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,t=this.data.id,n=e.getValue(t,{value:this.data.fieldValue}),r=document.createElement("select");d.add(r),r.setAttribute("data-element-id",t),r.disabled=this.data.readOnly,this._setRequired(r,this.data.required),r.name=this.data.fieldName,r.tabIndex=c;let a=this.data.combo&&this.data.options.length>0;this.data.combo||(r.size=this.data.options.length,this.data.multiSelect&&(r.multiple=!0)),r.addEventListener("resetform",(e=>{const t=this.data.defaultFieldValue;for(const n of r.options)n.selected=n.value===t}));for(const c of this.data.options){const e=document.createElement("option");e.textContent=c.displayValue,e.value=c.exportValue,n.value.includes(c.exportValue)&&(e.setAttribute("selected",!0),a=!1),r.append(e)}let i=null;if(a){const e=document.createElement("option");e.value=" ",e.setAttribute("hidden",!0),e.setAttribute("selected",!0),r.prepend(e),i=()=>{e.remove(),r.removeEventListener("input",i),i=null},r.addEventListener("input",i)}const s=e=>{const t=e?"value":"textContent",{options:n,multiple:a}=r;return a?Array.prototype.filter.call(n,(e=>e.selected)).map((e=>e[t])):-1===n.selectedIndex?null:n[n.selectedIndex][t]};let l=s(!1);const o=e=>{const t=e.target.options;return Array.prototype.map.call(t,(e=>({displayValue:e.textContent,exportValue:e.value})))};return this.enableScripting&&this.hasJSActions?(r.addEventListener("updatefromsandbox",(n=>{const a={value(n){var a;null===(a=i)||void 0===a||a();const o=n.detail.value,c=new Set(Array.isArray(o)?o:[o]);for(const e of r.options)e.selected=c.has(e.value);e.setValue(t,{value:s(!0)}),l=s(!1)},multipleSelection(e){r.multiple=!0},remove(n){const a=r.options,i=n.detail.remove;a[i].selected=!1,r.remove(i),a.length>0&&-1===Array.prototype.findIndex.call(a,(e=>e.selected))&&(a[0].selected=!0),e.setValue(t,{value:s(!0),items:o(n)}),l=s(!1)},clear(n){for(;0!==r.length;)r.remove(0);e.setValue(t,{value:null,items:[]}),l=s(!1)},insert(n){const{index:a,displayValue:i,exportValue:c}=n.detail.insert,d=r.children[a],u=document.createElement("option");u.textContent=i,u.value=c,d?d.before(u):r.append(u),e.setValue(t,{value:s(!0),items:o(n)}),l=s(!1)},items(n){const{items:a}=n.detail;for(;0!==r.length;)r.remove(0);for(const e of a){const{displayValue:t,exportValue:n}=e,a=document.createElement("option");a.textContent=t,a.value=n,r.append(a)}r.options.length>0&&(r.options[0].selected=!0),e.setValue(t,{value:s(!0),items:o(n)}),l=s(!1)},indices(n){const r=new Set(n.detail.indices);for(const e of n.target.options)e.selected=r.has(e.index);e.setValue(t,{value:s(!0)}),l=s(!1)},editable(e){e.target.disabled=!e.detail.editable}};this._dispatchEventFromSandbox(a,n)})),r.addEventListener("input",(n=>{var r;const a=s(!0);e.setValue(t,{value:a}),n.preventDefault(),null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:l,changeEx:a,willCommit:!1,commitKey:1,keyDown:!1}})})),this._setEventListeners(r,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(e=>e.target.value))):r.addEventListener("input",(function(n){e.setValue(t,{value:s(!0)})})),this.data.combo&&this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class k extends p{constructor(e){const{data:t,elements:n}=e;super(e,{isRenderable:p._hasPopupData(t)}),this.elements=n}render(){this.container.classList.add("popupAnnotation");const e=new V({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),t=[];for(const n of this.elements)n.popup=e,t.push(n.data.id),n.addHighlightArea();return this.container.setAttribute("aria-controls",t.map((e=>"".concat(r.AnnotationPrefix).concat(e))).join(",")),this.container}}var j=new WeakMap,E=new WeakMap,N=new WeakMap,F=new WeakMap,T=new WeakMap,M=new WeakMap,R=new WeakMap,I=new WeakMap,L=new WeakMap,O=new WeakMap,D=new WeakMap,G=new WeakMap,B=new WeakMap,z=new WeakMap,W=new WeakMap,U=new WeakMap,H=new WeakMap,q=new WeakSet;class V{constructor(e){let{container:t,color:n,elements:r,titleObj:i,modificationDate:s,contentsObj:l,richText:o,parent:c,rect:d,parentRect:u,open:h}=e;_classPrivateMethodInitSpec(this,q),_classPrivateFieldInitSpec(this,j,null),_classPrivateFieldInitSpec(this,E,_assertClassBrand(q,this,X).bind(this)),_classPrivateFieldInitSpec(this,N,_assertClassBrand(q,this,J).bind(this)),_classPrivateFieldInitSpec(this,F,_assertClassBrand(q,this,K).bind(this)),_classPrivateFieldInitSpec(this,T,_assertClassBrand(q,this,Y).bind(this)),_classPrivateFieldInitSpec(this,M,null),_classPrivateFieldInitSpec(this,R,null),_classPrivateFieldInitSpec(this,I,null),_classPrivateFieldInitSpec(this,L,null),_classPrivateFieldInitSpec(this,O,null),_classPrivateFieldInitSpec(this,D,null),_classPrivateFieldInitSpec(this,G,!1),_classPrivateFieldInitSpec(this,B,null),_classPrivateFieldInitSpec(this,z,null),_classPrivateFieldInitSpec(this,W,null),_classPrivateFieldInitSpec(this,U,null),_classPrivateFieldInitSpec(this,H,!1),_classPrivateFieldSet(R,this,t),_classPrivateFieldSet(U,this,i),_classPrivateFieldSet(I,this,l),_classPrivateFieldSet(W,this,o),_classPrivateFieldSet(O,this,c),_classPrivateFieldSet(M,this,n),_classPrivateFieldSet(z,this,d),_classPrivateFieldSet(D,this,u),_classPrivateFieldSet(L,this,r);const f=a.PDFDateString.toDateObject(s);f&&_classPrivateFieldSet(j,this,c.l10n.get("annotation_date_string",{date:f.toLocaleDateString(),time:f.toLocaleTimeString()})),this.trigger=r.flatMap((e=>e.getElementsToTriggerPopup()));for(const a of this.trigger)a.addEventListener("click",_classPrivateFieldGet(T,this)),a.addEventListener("mouseenter",_classPrivateFieldGet(F,this)),a.addEventListener("mouseleave",_classPrivateFieldGet(N,this)),a.classList.add("popupTriggerArea");for(const a of r){var p;null===(p=a.container)||void 0===p||p.addEventListener("keydown",_classPrivateFieldGet(E,this))}_classPrivateFieldGet(R,this).hidden=!0,h&&_assertClassBrand(q,this,Y).call(this)}render(){if(_classPrivateFieldGet(B,this))return;const{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:n,pageX:a,pageY:i}}}=_classPrivateFieldGet(O,this),s=_classPrivateFieldSet(B,this,document.createElement("div"));if(s.className="popup",_classPrivateFieldGet(M,this)){const e=s.style.outlineColor=r.Util.makeHexColor(..._classPrivateFieldGet(M,this));if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))s.style.backgroundColor="color-mix(in srgb, ".concat(e," 30%, white)");else{const e=.7;s.style.backgroundColor=r.Util.makeHexColor(..._classPrivateFieldGet(M,this).map((t=>Math.floor(e*(255-t)+t))))}}const l=document.createElement("span");l.className="header";const c=document.createElement("h1");if(l.append(c),({dir:c.dir,str:c.textContent}=_classPrivateFieldGet(U,this)),s.append(l),_classPrivateFieldGet(j,this)){const e=document.createElement("span");e.classList.add("popupDate"),_classPrivateFieldGet(j,this).then((t=>{e.textContent=t})),l.append(e)}const d=_classPrivateFieldGet(I,this),u=_classPrivateFieldGet(W,this);if(null===u||void 0===u||!u.str||null!==d&&void 0!==d&&d.str&&d.str!==u.str){const e=this._formatContents(d);s.append(e)}else o.XfaLayer.render({xfaHtml:u.html,intent:"richText",div:s}),s.lastChild.classList.add("richText","popupContent");let h=!!_classPrivateFieldGet(D,this),f=_classPrivateFieldGet(h?D:z,this);for(const o of _classPrivateFieldGet(L,this))if(!f||null!==r.Util.intersect(o.data.rect,f)){f=o.data.rect,h=!0;break}const p=r.Util.normalizeRect([f[0],e[3]-f[1]+e[1],f[2],e[3]-f[3]+e[1]]),m=h?f[2]-f[0]+5:0,g=p[0]+m,v=p[1],{style:x}=_classPrivateFieldGet(R,this);x.left="".concat(100*(g-a)/t,"%"),x.top="".concat(100*(v-i)/n,"%"),_classPrivateFieldGet(R,this).append(s)}_formatContents(e){let{str:t,dir:n}=e;const r=document.createElement("p");r.classList.add("popupContent"),r.dir=n;const a=t.split(/(?:\r\n?|\n)/);for(let i=0,s=a.length;i{"Enter"===e.key&&(a?e.metaKey:e.ctrlKey)&&_assertClassBrand(ge,this,xe).call(this)})),!t.popupRef&&this.hasPopupData?this._createPopup():n.classList.add("popupTriggerArea"),e.append(n),e}getElementsToTriggerPopup(){return _classPrivateFieldGet(me,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}function xe(){var e;null===(e=this.downloadManager)||void 0===e||e.openOrDownloadData(this.container,this.content,this.filename)}var be=new WeakMap,ye=new WeakMap,we=new WeakMap,_e=new WeakSet;function Se(e,t){var n;const a=e.firstChild||e;a.id="".concat(r.AnnotationPrefix).concat(t),this.div.append(e),null===(n=_classPrivateFieldGet(be,this))||void 0===n||n.moveElementInDOM(this.div,e,a,!1)}function Pe(){if(!_classPrivateFieldGet(ye,this))return;const e=this.div;for(const[t,n]of _classPrivateFieldGet(ye,this)){const r=e.querySelector('[data-annotation-id="'.concat(t,'"]'));if(!r)continue;const{firstChild:a}=r;a?"CANVAS"===a.nodeName?a.replaceWith(n):a.before(n):r.append(n)}_classPrivateFieldGet(ye,this).clear()}t.AnnotationLayer=class{constructor(e){let{div:t,accessibilityManager:n,annotationCanvasMap:r,l10n:a,page:i,viewport:s}=e;_classPrivateMethodInitSpec(this,_e),_classPrivateFieldInitSpec(this,be,null),_classPrivateFieldInitSpec(this,ye,null),_classPrivateFieldInitSpec(this,we,new Map),this.div=t,_classPrivateFieldSet(be,this,n),_classPrivateFieldSet(ye,this,r),this.l10n=a,this.page=i,this.viewport=s,this.zIndex=0,this.l10n||(this.l10n=l.NullL10n)}async render(e){const{annotations:t}=e,n=this.div;(0,a.setLayerDimensions)(n,this.viewport);const s=new Map,l={data:null,layer:n,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:!1!==e.renderForms,svgFactory:new a.DOMSVGFactory,annotationStorage:e.annotationStorage||new i.AnnotationStorage,enableScripting:!0===e.enableScripting,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const a of t){if(a.noHTML)continue;const e=a.annotationType===r.AnnotationType.POPUP;if(e){const e=s.get(a.id);if(!e)continue;l.elements=e}else{const{width:e,height:t}=u(a.rect);if(e<=0||t<=0)continue}l.data=a;const t=h.create(l);if(!t.isRenderable)continue;if(!e&&a.popupRef){const e=s.get(a.popupRef);e?e.push(t):s.set(a.popupRef,[t])}t.annotationEditorType>0&&_classPrivateFieldGet(we,this).set(t.data.id,t);const n=t.render();a.hidden&&(n.style.visibility="hidden"),_assertClassBrand(_e,this,Se).call(this,n,a.id)}_assertClassBrand(_e,this,Pe).call(this),await this.l10n.translate(n)}update(e){let{viewport:t}=e;const n=this.div;this.viewport=t,(0,a.setLayerDimensions)(n,{rotation:t.rotation}),_assertClassBrand(_e,this,Pe).call(this),n.hidden=!1}getEditableAnnotations(){return Array.from(_classPrivateFieldGet(we,this).values())}getEditableAnnotation(e){return _classPrivateFieldGet(we,this).get(e)}}},(e,t)=>{function n(e){return Math.floor(255*Math.max(0,Math.min(1,e))).toString(16).padStart(2,"0")}function r(e){return Math.max(0,Math.min(255,255*e))}Object.defineProperty(t,"__esModule",{value:!0}),t.ColorConverters=void 0,t.ColorConverters=class{static CMYK_G(e){let[t,n,r,a]=e;return["G",1-Math.min(1,.3*t+.59*r+.11*n+a)]}static G_CMYK(e){let[t]=e;return["CMYK",0,0,0,1-t]}static G_RGB(e){let[t]=e;return["RGB",t,t,t]}static G_rgb(e){let[t]=e;return t=r(t),[t,t,t]}static G_HTML(e){let[t]=e;const r=n(t);return"#".concat(r).concat(r).concat(r)}static RGB_G(e){let[t,n,r]=e;return["G",.3*t+.59*n+.11*r]}static RGB_rgb(e){return e.map(r)}static RGB_HTML(e){return"#".concat(e.map(n).join(""))}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(e){let[t,n,r,a]=e;return["RGB",1-Math.min(1,t+a),1-Math.min(1,r+a),1-Math.min(1,n+a)]}static CMYK_rgb(e){let[t,n,a,i]=e;return[r(1-Math.min(1,t+i)),r(1-Math.min(1,a+i)),r(1-Math.min(1,n+i))]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK(e){let[t,n,r]=e;const a=1-t,i=1-n,s=1-r;return["CMYK",a,i,s,Math.min(a,i,s)]}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NullL10n=void 0,t.getL10nFallback=r;const n={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}} \xd7 {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} \xd7 {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",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",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_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.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",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.",free_text2_default_content:"Start typing\u2026",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative"};function r(e,t){switch(e){case"find_match_count":e="find_match_count[".concat(1===t.total?"one":"other","]");break;case"find_match_count_limit":e="find_match_count_limit[".concat(1===t.limit?"one":"other","]")}return n[e]||""}n.print_progress_percent="{{progress}}%";const a={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(e,t){return t?e.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,((e,n)=>n in t?t[n]:"{{"+n+"}}")):e}(arguments.length>2&&void 0!==arguments[2]?arguments[2]:r(e,t),t)},async translate(e){}};t.NullL10n=a},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaLayer=void 0;var r=n(25);t.XfaLayer=class{static setupStorage(e,t,n,r,a){const i=r.getValue(t,{value:null});switch(n.name){case"textarea":if(null!==i.value&&(e.textContent=i.value),"print"===a)break;e.addEventListener("input",(e=>{r.setValue(t,{value:e.target.value})}));break;case"input":if("radio"===n.attributes.type||"checkbox"===n.attributes.type){if(i.value===n.attributes.xfaOn?e.setAttribute("checked",!0):i.value===n.attributes.xfaOff&&e.removeAttribute("checked"),"print"===a)break;e.addEventListener("change",(e=>{r.setValue(t,{value:e.target.checked?e.target.getAttribute("xfaOn"):e.target.getAttribute("xfaOff")})}))}else{if(null!==i.value&&e.setAttribute("value",i.value),"print"===a)break;e.addEventListener("input",(e=>{r.setValue(t,{value:e.target.value})}))}break;case"select":if(null!==i.value){e.setAttribute("value",i.value);for(const e of n.children)e.attributes.value===i.value?e.attributes.selected=!0:e.attributes.hasOwnProperty("selected")&&delete e.attributes.selected}e.addEventListener("input",(e=>{const n=e.target.options,a=-1===n.selectedIndex?"":n[n.selectedIndex].value;r.setValue(t,{value:a})}))}}static setAttributes(e){let{html:t,element:n,storage:r=null,intent:a,linkService:i}=e;const{attributes:s}=n,l=t instanceof HTMLAnchorElement;"radio"===s.type&&(s.name="".concat(s.name,"-").concat(a));for(const[o,c]of Object.entries(s))if(null!==c&&void 0!==c)switch(o){case"class":c.length&&t.setAttribute(o,c.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",c);break;case"style":Object.assign(t.style,c);break;case"textContent":t.textContent=c;break;default:(!l||"href"!==o&&"newWindow"!==o)&&t.setAttribute(o,c)}l&&i.addLinkAttributes(t,s.href,s.newWindow),r&&s.dataId&&this.setupStorage(t,s.dataId,n,r)}static render(e){const t=e.annotationStorage,n=e.linkService,a=e.xfaHtml,i=e.intent||"display",s=document.createElement(a.name);a.attributes&&this.setAttributes({html:s,element:a,intent:i,linkService:n});const l=[[a,-1,s]],o=e.div;if(o.append(s),e.viewport){const t="matrix(".concat(e.viewport.transform.join(","),")");o.style.transform=t}"richText"!==i&&o.setAttribute("class","xfaLayer xfaFont");const c=[];for(;l.length>0;){var d;const[e,a,s]=l.at(-1);if(a+1===e.children.length){l.pop();continue}const o=e.children[++l.at(-1)[1]];if(null===o)continue;const{name:u}=o;if("#text"===u){const e=document.createTextNode(o.value);c.push(e),s.append(e);continue}const h=null!==o&&void 0!==o&&null!==(d=o.attributes)&&void 0!==d&&d.xmlns?document.createElementNS(o.attributes.xmlns,u):document.createElement(u);if(s.append(h),o.attributes&&this.setAttributes({html:h,element:o,storage:t,intent:i,linkService:n}),o.children&&o.children.length>0)l.push([o,-1,h]);else if(o.value){const e=document.createTextNode(o.value);r.XfaText.shouldBuildText(u)&&c.push(e),h.append(e)}}for(const r of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))r.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){const t="matrix(".concat(e.viewport.transform.join(","),")");e.div.style.transform=t,e.div.hidden=!1}}},(e,t,n)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.InkEditor=void 0;var a=n(1),i=n(4),s=n(29),l=n(6),o=n(5),c=new WeakMap,d=new WeakMap,u=new WeakMap,h=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,g=new WeakMap,v=new WeakMap,x=new WeakMap,b=new WeakMap,y=new WeakMap,w=new WeakMap,_=new WeakMap,S=new WeakSet;class P extends i.AnnotationEditor{constructor(e){super({...e,name:"inkEditor"}),_classPrivateMethodInitSpec(this,S),_classPrivateFieldInitSpec(this,c,0),_classPrivateFieldInitSpec(this,d,0),_classPrivateFieldInitSpec(this,u,this.canvasPointermove.bind(this)),_classPrivateFieldInitSpec(this,h,this.canvasPointerleave.bind(this)),_classPrivateFieldInitSpec(this,f,this.canvasPointerup.bind(this)),_classPrivateFieldInitSpec(this,p,this.canvasPointerdown.bind(this)),_classPrivateFieldInitSpec(this,m,new Path2D),_classPrivateFieldInitSpec(this,g,!1),_classPrivateFieldInitSpec(this,v,!1),_classPrivateFieldInitSpec(this,x,!1),_classPrivateFieldInitSpec(this,b,null),_classPrivateFieldInitSpec(this,y,0),_classPrivateFieldInitSpec(this,w,0),_classPrivateFieldInitSpec(this,_,null),this.color=e.color||null,this.thickness=e.thickness||null,this.opacity=e.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(e){i.AnnotationEditor.initialize(e,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(e,t){switch(e){case a.AnnotationEditorParamsType.INK_THICKNESS:P._defaultThickness=t;break;case a.AnnotationEditorParamsType.INK_COLOR:P._defaultColor=t;break;case a.AnnotationEditorParamsType.INK_OPACITY:P._defaultOpacity=t/100}}updateParams(e,t){switch(e){case a.AnnotationEditorParamsType.INK_THICKNESS:_assertClassBrand(S,this,C).call(this,t);break;case a.AnnotationEditorParamsType.INK_COLOR:_assertClassBrand(S,this,A).call(this,t);break;case a.AnnotationEditorParamsType.INK_OPACITY:_assertClassBrand(S,this,k).call(this,t)}}static get defaultPropertiesToUpdate(){return[[a.AnnotationEditorParamsType.INK_THICKNESS,P._defaultThickness],[a.AnnotationEditorParamsType.INK_COLOR,P._defaultColor||i.AnnotationEditor._defaultLineColor],[a.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*P._defaultOpacity)]]}get propertiesToUpdate(){var e;return[[a.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||P._defaultThickness],[a.AnnotationEditorParamsType.INK_COLOR,this.color||P._defaultColor||i.AnnotationEditor._defaultLineColor],[a.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(null!==(e=this.opacity)&&void 0!==e?e:P._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||(_assertClassBrand(S,this,G).call(this),_assertClassBrand(S,this,B).call(this)),this.isAttachedToDOM||(this.parent.add(this),_assertClassBrand(S,this,z).call(this)),_assertClassBrand(S,this,J).call(this)))}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,_classPrivateFieldGet(b,this).disconnect(),_classPrivateFieldSet(b,this,null),super.remove())}setParent(e){!this.parent&&e?this._uiManager.removeShouldRescale(this):this.parent&&null===e&&this._uiManager.addShouldRescale(this),super.setParent(e)}onScaleChanging(){const[e,t]=this.parentDimensions,n=this.width*e,r=this.height*t;this.setDimensions(n,r)}enableEditMode(){_classPrivateFieldGet(g,this)||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",_classPrivateFieldGet(p,this)))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",_classPrivateFieldGet(p,this)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}commit(){_classPrivateFieldGet(g,this)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),_classPrivateFieldSet(g,this,!0),this.div.classList.add("disabled"),_assertClassBrand(S,this,J).call(this,!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),this.enableEditMode())}canvasPointerdown(e){0===e.button&&this.isInEditMode()&&!_classPrivateFieldGet(g,this)&&(this.setInForeground(),e.preventDefault(),"mouse"!==e.type&&this.div.focus(),_assertClassBrand(S,this,N).call(this,e.offsetX,e.offsetY))}canvasPointermove(e){e.preventDefault(),_assertClassBrand(S,this,F).call(this,e.offsetX,e.offsetY)}canvasPointerup(e){e.preventDefault(),_assertClassBrand(S,this,D).call(this,e)}canvasPointerleave(e){_assertClassBrand(S,this,D).call(this,e)}get isResizable(){return!this.isEmpty()&&_classPrivateFieldGet(g,this)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),i.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then((e=>{var t;return null===(t=this.div)||void 0===t?void 0:t.setAttribute("aria-label",e)}));const[n,r,a,s]=_assertClassBrand(S,this,j).call(this);if(this.setAt(n,r,0,0),this.setDims(a,s),_assertClassBrand(S,this,G).call(this),this.width){const[n,r]=this.parentDimensions;this.setAspectRatio(this.width*n,this.height*r),this.setAt(e*n,t*r,this.width*n,this.height*r),_classPrivateFieldSet(x,this,!0),_assertClassBrand(S,this,z).call(this),this.setDims(this.width*n,this.height*r),_assertClassBrand(S,this,O).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return _assertClassBrand(S,this,B).call(this),this.div}setDimensions(e,t){const n=Math.round(e),r=Math.round(t);if(_classPrivateFieldGet(y,this)===n&&_classPrivateFieldGet(w,this)===r)return;_classPrivateFieldSet(y,this,n),_classPrivateFieldSet(w,this,r),this.canvas.style.visibility="hidden";const[a,i]=this.parentDimensions;this.width=e/a,this.height=t/i,this.fixAndSetPosition(),_classPrivateFieldGet(g,this)&&_assertClassBrand(S,this,W).call(this,e,t),_assertClassBrand(S,this,z).call(this),_assertClassBrand(S,this,O).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(e,t,n){if(e instanceof s.InkAnnotationElement)return null;const r=super.deserialize(e,t,n);r.thickness=e.thickness,r.color=a.Util.makeHexColor(...e.color),r.opacity=e.opacity;const[l,o]=r.pageDimensions,u=r.width*l,h=r.height*o,f=r.parentScale,p=e.thickness/2;_classPrivateFieldSet(g,r,!0),_classPrivateFieldSet(y,r,Math.round(u)),_classPrivateFieldSet(w,r,Math.round(h));const{paths:m,rect:v,rotation:x}=e;for(let{bezier:a}of m){a=V.call(P,a,v,x);const e=[];r.paths.push(e);let t=f*(a[0]-p),n=f*(a[1]-p);for(let r=2,s=a.length;r{this.thickness=e,_assertClassBrand(S,this,J).call(this)},undo:()=>{this.thickness=t,_assertClassBrand(S,this,J).call(this)},mustExec:!0,type:a.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function A(e){const t=this.color;this.addCommands({cmd:()=>{this.color=e,_assertClassBrand(S,this,O).call(this)},undo:()=>{this.color=t,_assertClassBrand(S,this,O).call(this)},mustExec:!0,type:a.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function k(e){e/=100;const t=this.opacity;this.addCommands({cmd:()=>{this.opacity=e,_assertClassBrand(S,this,O).call(this)},undo:()=>{this.opacity=t,_assertClassBrand(S,this,O).call(this)},mustExec:!0,type:a.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function j(){const{parentRotation:e,parentDimensions:[t,n]}=this;switch(e){case 90:return[0,n,n,t];case 180:return[t,n,t,n];case 270:return[t,0,n,t];default:return[0,0,t,n]}}function E(){const{ctx:e,color:t,opacity:n,thickness:r,parentScale:a,scaleFactor:i}=this;e.lineWidth=r*a/i,e.lineCap="round",e.lineJoin="round",e.miterLimit=10,e.strokeStyle="".concat(t).concat((0,o.opacityToHex)(n))}function N(e,t){var n;this.canvas.addEventListener("contextmenu",l.noContextMenu),this.canvas.addEventListener("pointerleave",_classPrivateFieldGet(h,this)),this.canvas.addEventListener("pointermove",_classPrivateFieldGet(u,this)),this.canvas.addEventListener("pointerup",_classPrivateFieldGet(f,this)),this.canvas.removeEventListener("pointerdown",_classPrivateFieldGet(p,this)),this.isEditing=!0,_classPrivateFieldGet(x,this)||(_classPrivateFieldSet(x,this,!0),_assertClassBrand(S,this,z).call(this),this.thickness||(this.thickness=r._defaultThickness),this.color||(this.color=r._defaultColor||i.AnnotationEditor._defaultLineColor),null!==(n=this.opacity)&&void 0!==n||(this.opacity=r._defaultOpacity)),this.currentPath.push([e,t]),_classPrivateFieldSet(v,this,!1),_assertClassBrand(S,this,E).call(this),_classPrivateFieldSet(_,this,(()=>{_assertClassBrand(S,this,R).call(this),_classPrivateFieldGet(_,this)&&window.requestAnimationFrame(_classPrivateFieldGet(_,this))})),window.requestAnimationFrame(_classPrivateFieldGet(_,this))}function F(e,t){const[n,r]=this.currentPath.at(-1);if(this.currentPath.length>1&&e===n&&t===r)return;const a=this.currentPath;let i=_classPrivateFieldGet(m,this);if(a.push([e,t]),_classPrivateFieldSet(v,this,!0),a.length<=2)return i.moveTo(...a[0]),void i.lineTo(e,t);3===a.length&&(_classPrivateFieldSet(m,this,i=new Path2D),i.moveTo(...a[0])),_assertClassBrand(S,this,I).call(this,i,...a.at(-3),...a.at(-2),e,t)}function T(){if(0===this.currentPath.length)return;const e=this.currentPath.at(-1);_classPrivateFieldGet(m,this).lineTo(...e)}function M(e,t){let n;if(_classPrivateFieldSet(_,this,null),e=Math.min(Math.max(e,0),this.canvas.width),t=Math.min(Math.max(t,0),this.canvas.height),_assertClassBrand(S,this,F).call(this,e,t),_assertClassBrand(S,this,T).call(this),1!==this.currentPath.length)n=_assertClassBrand(S,this,L).call(this);else{const r=[e,t];n=[[r,r.slice(),r.slice(),r]]}const r=_classPrivateFieldGet(m,this),a=this.currentPath;this.currentPath=[],_classPrivateFieldSet(m,this,new Path2D),this.addCommands({cmd:()=>{this.allRawPaths.push(a),this.paths.push(n),this.bezierPath2D.push(r),this.rebuild()},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(_assertClassBrand(S,this,G).call(this),_assertClassBrand(S,this,B).call(this)),_assertClassBrand(S,this,J).call(this))},mustExec:!0})}function R(){if(!_classPrivateFieldGet(v,this))return;_classPrivateFieldSet(v,this,!1);Math.ceil(this.thickness*this.parentScale);const e=this.currentPath.slice(-3),t=e.map((e=>e[0])),n=e.map((e=>e[1])),{ctx:r}=(Math.min(...t),Math.max(...t),Math.min(...n),Math.max(...n),this);r.save(),r.clearRect(0,0,this.canvas.width,this.canvas.height);for(const a of this.bezierPath2D)r.stroke(a);r.stroke(_classPrivateFieldGet(m,this)),r.restore()}function I(e,t,n,r,a,i,s){const l=(t+r)/2,o=(n+a)/2,c=(r+i)/2,d=(a+s)/2;e.bezierCurveTo(l+2*(r-l)/3,o+2*(a-o)/3,c+2*(r-c)/3,d+2*(a-d)/3,c,d)}function L(){const e=this.currentPath;if(e.length<=2)return[[e[0],e[0],e.at(-1),e.at(-1)]];const t=[];let n,[r,a]=e[0];for(n=1;n{this.canvas.removeEventListener("contextmenu",l.noContextMenu)}),10),_assertClassBrand(S,this,M).call(this,e.offsetX,e.offsetY),this.addToAnnotationStorage(),this.setInBackground()}function G(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",i.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then((e=>{var t;return null===(t=this.canvas)||void 0===t?void 0:t.setAttribute("aria-label",e)})),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}function B(){_classPrivateFieldSet(b,this,new ResizeObserver((e=>{const t=e[0].contentRect;t.width&&t.height&&this.setDimensions(t.width,t.height)}))),_classPrivateFieldGet(b,this).observe(this.div)}function z(){if(!_classPrivateFieldGet(x,this))return;const[e,t]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*e),this.canvas.height=Math.ceil(this.height*t),_assertClassBrand(S,this,U).call(this)}function W(e,t){const n=_assertClassBrand(S,this,K).call(this),r=(e-n)/_classPrivateFieldGet(d,this),a=(t-n)/_classPrivateFieldGet(c,this);this.scaleFactor=Math.min(r,a)}function U(){const e=_assertClassBrand(S,this,K).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+e,this.translationY*this.scaleFactor+e)}function H(e){const t=new Path2D;for(let n=0,r=e.length;n0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!_classPrivateFieldGet(g,this))return void _assertClassBrand(S,this,O).call(this);const t=_assertClassBrand(S,this,Y).call(this),n=_assertClassBrand(S,this,K).call(this);_classPrivateFieldSet(d,this,Math.max(i.AnnotationEditor.MIN_SIZE,t[2]-t[0])),_classPrivateFieldSet(c,this,Math.max(i.AnnotationEditor.MIN_SIZE,t[3]-t[1]));const r=Math.ceil(n+_classPrivateFieldGet(d,this)*this.scaleFactor),a=Math.ceil(n+_classPrivateFieldGet(c,this)*this.scaleFactor),[s,l]=this.parentDimensions;this.width=r/s,this.height=a/l,this.setAspectRatio(r,a);const o=this.translationX,u=this.translationY;this.translationX=-t[0],this.translationY=-t[1],_assertClassBrand(S,this,z).call(this),_assertClassBrand(S,this,O).call(this),_classPrivateFieldSet(y,this,r),_classPrivateFieldSet(w,this,a),this.setDims(r,a);const h=e?n/this.scaleFactor/2:0;this.translate(o-this.translationX-h,u-this.translationY-h)}r=P,_defineProperty(P,"_defaultColor",null),_defineProperty(P,"_defaultOpacity",1),_defineProperty(P,"_defaultThickness",1),_defineProperty(P,"_type","ink"),t.InkEditor=P},(e,t,n)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.StampEditor=void 0;var a=n(1),i=n(4),s=n(6),l=n(29),o=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,h=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,g=new WeakMap,v=new WeakMap,x=new WeakSet;class b extends i.AnnotationEditor{constructor(e){super({...e,name:"stampEditor"}),_classPrivateMethodInitSpec(this,x),_classPrivateFieldInitSpec(this,o,null),_classPrivateFieldInitSpec(this,c,null),_classPrivateFieldInitSpec(this,d,null),_classPrivateFieldInitSpec(this,u,null),_classPrivateFieldInitSpec(this,h,null),_classPrivateFieldInitSpec(this,f,null),_classPrivateFieldInitSpec(this,p,null),_classPrivateFieldInitSpec(this,m,null),_classPrivateFieldInitSpec(this,g,!1),_classPrivateFieldInitSpec(this,v,!1),_classPrivateFieldSet(u,this,e.bitmapUrl),_classPrivateFieldSet(h,this,e.bitmapFile)}static initialize(e){i.AnnotationEditor.initialize(e)}static get supportedTypes(){return(0,a.shadow)(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map((e=>"image/".concat(e))))}static get supportedTypesStr(){return(0,a.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(e){return this.supportedTypes.includes(e)}static paste(e,t){t.pasteEditor(a.AnnotationEditorType.STAMP,{bitmapFile:e.getAsFile()})}remove(){var e,t;_classPrivateFieldGet(c,this)&&(_classPrivateFieldSet(o,this,null),this._uiManager.imageManager.deleteId(_classPrivateFieldGet(c,this)),null===(e=_classPrivateFieldGet(f,this))||void 0===e||e.remove(),_classPrivateFieldSet(f,this,null),null===(t=_classPrivateFieldGet(p,this))||void 0===t||t.disconnect(),_classPrivateFieldSet(p,this,null)),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(_classPrivateFieldGet(c,this)&&_assertClassBrand(x,this,_).call(this),this.isAttachedToDOM||this.parent.add(this))):_classPrivateFieldGet(c,this)&&_assertClassBrand(x,this,_).call(this)}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(_classPrivateFieldGet(d,this)||_classPrivateFieldGet(o,this)||_classPrivateFieldGet(u,this)||_classPrivateFieldGet(h,this))}get isResizable(){return!0}render(){if(this.div)return this.div;let e,t;if(this.width&&(e=this.x,t=this.y),super.render(),this.div.hidden=!0,_classPrivateFieldGet(o,this)?_assertClassBrand(x,this,S).call(this):_assertClassBrand(x,this,_).call(this),this.width){const[n,r]=this.parentDimensions;this.setAt(e*n,t*r,this.width*n,this.height*r)}return this.div}static deserialize(e,t,n){if(e instanceof l.StampAnnotationElement)return null;const r=super.deserialize(e,t,n),{rect:a,bitmapUrl:i,bitmapId:s,isSvg:o,accessibilityData:d}=e;s&&n.imageManager.isValidId(s)?_classPrivateFieldSet(c,r,s):_classPrivateFieldSet(u,r,i),_classPrivateFieldSet(g,r,o);const[h,f]=r.pageDimensions;return r.width=(a[2]-a[0])/h,r.height=(a[3]-a[1])/f,d&&(r.altTextData=d),r}serialize(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;const n={annotationType:a.AnnotationEditorType.STAMP,bitmapId:_classPrivateFieldGet(c,this),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:_classPrivateFieldGet(g,this),structTreeParentId:this._structTreeParentId};if(e)return n.bitmapUrl=_assertClassBrand(x,this,k).call(this,!0),n.accessibilityData=this.altTextData,n;const{decorative:r,altText:i}=this.altTextData;if(!r&&i&&(n.accessibilityData={type:"Figure",alt:i}),null===t)return n;t.stamps||(t.stamps=new Map);const s=_classPrivateFieldGet(g,this)?(n.rect[2]-n.rect[0])*(n.rect[3]-n.rect[1]):null;if(t.stamps.has(_classPrivateFieldGet(c,this))){if(_classPrivateFieldGet(g,this)){const e=t.stamps.get(_classPrivateFieldGet(c,this));s>e.area&&(e.area=s,e.serialized.bitmap.close(),e.serialized.bitmap=_assertClassBrand(x,this,k).call(this,!1))}}else t.stamps.set(_classPrivateFieldGet(c,this),{area:s,serialized:n}),n.bitmap=_assertClassBrand(x,this,k).call(this,!1);return n}}function y(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e?(_classPrivateFieldSet(o,this,e.bitmap),t||(_classPrivateFieldSet(c,this,e.id),_classPrivateFieldSet(g,this,e.isSvg)),_assertClassBrand(x,this,S).call(this)):this.remove()}function w(){_classPrivateFieldSet(d,this,null),this._uiManager.enableWaiting(!1),_classPrivateFieldGet(f,this)&&this.div.focus()}function _(){if(_classPrivateFieldGet(c,this))return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(_classPrivateFieldGet(c,this)).then((e=>_assertClassBrand(x,this,y).call(this,e,!0))).finally((()=>_assertClassBrand(x,this,w).call(this)));if(_classPrivateFieldGet(u,this)){const e=_classPrivateFieldGet(u,this);return _classPrivateFieldSet(u,this,null),this._uiManager.enableWaiting(!0),void _classPrivateFieldSet(d,this,this._uiManager.imageManager.getFromUrl(e).then((e=>_assertClassBrand(x,this,y).call(this,e))).finally((()=>_assertClassBrand(x,this,w).call(this))))}if(_classPrivateFieldGet(h,this)){const e=_classPrivateFieldGet(h,this);return _classPrivateFieldSet(h,this,null),this._uiManager.enableWaiting(!0),void _classPrivateFieldSet(d,this,this._uiManager.imageManager.getFromFile(e).then((e=>_assertClassBrand(x,this,y).call(this,e))).finally((()=>_assertClassBrand(x,this,w).call(this))))}const e=document.createElement("input");e.type="file",e.accept=r.supportedTypesStr,_classPrivateFieldSet(d,this,new Promise((t=>{e.addEventListener("change",(async()=>{if(e.files&&0!==e.files.length){this._uiManager.enableWaiting(!0);const t=await this._uiManager.imageManager.getFromFile(e.files[0]);_assertClassBrand(x,this,y).call(this,t)}else this.remove();t()})),e.addEventListener("cancel",(()=>{this.remove(),t()}))})).finally((()=>_assertClassBrand(x,this,w).call(this)))),e.click()}function S(){const{div:e}=this;let{width:t,height:n}=_classPrivateFieldGet(o,this);const[r,a]=this.pageDimensions,i=.75;if(this.width)t=this.width*r,n=this.height*a;else if(t>i*r||n>i*a){const e=Math.min(i*r/t,i*a/n);t*=e,n*=e}const[s,l]=this.parentDimensions;this.setDims(t*s/r,n*l/a),this._uiManager.enableWaiting(!1);const c=_classPrivateFieldSet(f,this,document.createElement("canvas"));e.append(c),e.hidden=!1,_assertClassBrand(x,this,A).call(this,t,n),_assertClassBrand(x,this,j).call(this),_classPrivateFieldGet(v,this)||(this.parent.addUndoableEditor(this),_classPrivateFieldSet(v,this,!0)),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()}function P(e,t){var n;const[r,a]=this.parentDimensions;this.width=e/r,this.height=t/a,this.setDims(e,t),null!==(n=this._initialOptions)&&void 0!==n&&n.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==_classPrivateFieldGet(m,this)&&clearTimeout(_classPrivateFieldGet(m,this)),_classPrivateFieldSet(m,this,setTimeout((()=>{_classPrivateFieldSet(m,this,null),_assertClassBrand(x,this,A).call(this,e,t)}),200))}function C(e,t){const{width:n,height:r}=_classPrivateFieldGet(o,this);let a=n,i=r,s=_classPrivateFieldGet(o,this);for(;a>2*e||i>2*t;){const n=a,r=i;a>2*e&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2)),i>2*t&&(i=i>=16384?Math.floor(i/2)-1:Math.ceil(i/2));const l=new OffscreenCanvas(a,i);l.getContext("2d").drawImage(s,0,0,n,r,0,0,a,i),s=l.transferToImageBitmap()}return s}function A(e,t){e=Math.ceil(e),t=Math.ceil(t);const n=_classPrivateFieldGet(f,this);if(!n||n.width===e&&n.height===t)return;n.width=e,n.height=t;const r=_classPrivateFieldGet(g,this)?_classPrivateFieldGet(o,this):_assertClassBrand(x,this,C).call(this,e,t),a=n.getContext("2d");a.filter=this._uiManager.hcmFilter,a.drawImage(r,0,0,r.width,r.height,0,0,e,t)}function k(e){if(e){if(_classPrivateFieldGet(g,this)){const e=this._uiManager.imageManager.getSvgUrl(_classPrivateFieldGet(c,this));if(e)return e}const e=document.createElement("canvas");return({width:e.width,height:e.height}=_classPrivateFieldGet(o,this)),e.getContext("2d").drawImage(_classPrivateFieldGet(o,this),0,0),e.toDataURL()}if(_classPrivateFieldGet(g,this)){const[e,t]=this.pageDimensions,n=Math.round(this.width*e*s.PixelsPerInch.PDF_TO_CSS_UNITS),r=Math.round(this.height*t*s.PixelsPerInch.PDF_TO_CSS_UNITS),a=new OffscreenCanvas(n,r);return a.getContext("2d").drawImage(_classPrivateFieldGet(o,this),0,0,_classPrivateFieldGet(o,this).width,_classPrivateFieldGet(o,this).height,0,0,n,r),a.transferToImageBitmap()}return structuredClone(_classPrivateFieldGet(o,this))}function j(){_classPrivateFieldSet(p,this,new ResizeObserver((e=>{const t=e[0].contentRect;t.width&&t.height&&_assertClassBrand(x,this,P).call(this,t.width,t.height)}))),_classPrivateFieldGet(p,this).observe(this.div)}r=b,_defineProperty(b,"_type","stamp"),t.StampEditor=b}],__webpack_module_cache__={};function __w_pdfjs_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__w_pdfjs_require__),n.exports}var __nested_webpack_exports__={};return(()=>{var e=__nested_webpack_exports__;Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"AbortException",{enumerable:!0,get:function(){return t.AbortException}}),Object.defineProperty(e,"AnnotationEditorLayer",{enumerable:!0,get:function(){return i.AnnotationEditorLayer}}),Object.defineProperty(e,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return t.AnnotationEditorParamsType}}),Object.defineProperty(e,"AnnotationEditorType",{enumerable:!0,get:function(){return t.AnnotationEditorType}}),Object.defineProperty(e,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return s.AnnotationEditorUIManager}}),Object.defineProperty(e,"AnnotationLayer",{enumerable:!0,get:function(){return l.AnnotationLayer}}),Object.defineProperty(e,"AnnotationMode",{enumerable:!0,get:function(){return t.AnnotationMode}}),Object.defineProperty(e,"CMapCompressionType",{enumerable:!0,get:function(){return t.CMapCompressionType}}),Object.defineProperty(e,"DOMSVGFactory",{enumerable:!0,get:function(){return r.DOMSVGFactory}}),Object.defineProperty(e,"FeatureTest",{enumerable:!0,get:function(){return t.FeatureTest}}),Object.defineProperty(e,"GlobalWorkerOptions",{enumerable:!0,get:function(){return o.GlobalWorkerOptions}}),Object.defineProperty(e,"ImageKind",{enumerable:!0,get:function(){return t.ImageKind}}),Object.defineProperty(e,"InvalidPDFException",{enumerable:!0,get:function(){return t.InvalidPDFException}}),Object.defineProperty(e,"MissingPDFException",{enumerable:!0,get:function(){return t.MissingPDFException}}),Object.defineProperty(e,"OPS",{enumerable:!0,get:function(){return t.OPS}}),Object.defineProperty(e,"PDFDataRangeTransport",{enumerable:!0,get:function(){return n.PDFDataRangeTransport}}),Object.defineProperty(e,"PDFDateString",{enumerable:!0,get:function(){return r.PDFDateString}}),Object.defineProperty(e,"PDFWorker",{enumerable:!0,get:function(){return n.PDFWorker}}),Object.defineProperty(e,"PasswordResponses",{enumerable:!0,get:function(){return t.PasswordResponses}}),Object.defineProperty(e,"PermissionFlag",{enumerable:!0,get:function(){return t.PermissionFlag}}),Object.defineProperty(e,"PixelsPerInch",{enumerable:!0,get:function(){return r.PixelsPerInch}}),Object.defineProperty(e,"PromiseCapability",{enumerable:!0,get:function(){return t.PromiseCapability}}),Object.defineProperty(e,"RenderingCancelledException",{enumerable:!0,get:function(){return r.RenderingCancelledException}}),Object.defineProperty(e,"SVGGraphics",{enumerable:!0,get:function(){return n.SVGGraphics}}),Object.defineProperty(e,"UnexpectedResponseException",{enumerable:!0,get:function(){return t.UnexpectedResponseException}}),Object.defineProperty(e,"Util",{enumerable:!0,get:function(){return t.Util}}),Object.defineProperty(e,"VerbosityLevel",{enumerable:!0,get:function(){return t.VerbosityLevel}}),Object.defineProperty(e,"XfaLayer",{enumerable:!0,get:function(){return c.XfaLayer}}),Object.defineProperty(e,"build",{enumerable:!0,get:function(){return n.build}}),Object.defineProperty(e,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return t.createValidAbsoluteUrl}}),Object.defineProperty(e,"getDocument",{enumerable:!0,get:function(){return n.getDocument}}),Object.defineProperty(e,"getFilenameFromUrl",{enumerable:!0,get:function(){return r.getFilenameFromUrl}}),Object.defineProperty(e,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return r.getPdfFilenameFromUrl}}),Object.defineProperty(e,"getXfaPageViewport",{enumerable:!0,get:function(){return r.getXfaPageViewport}}),Object.defineProperty(e,"isDataScheme",{enumerable:!0,get:function(){return r.isDataScheme}}),Object.defineProperty(e,"isPdfFile",{enumerable:!0,get:function(){return r.isPdfFile}}),Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return r.loadScript}}),Object.defineProperty(e,"noContextMenu",{enumerable:!0,get:function(){return r.noContextMenu}}),Object.defineProperty(e,"normalizeUnicode",{enumerable:!0,get:function(){return t.normalizeUnicode}}),Object.defineProperty(e,"renderTextLayer",{enumerable:!0,get:function(){return a.renderTextLayer}}),Object.defineProperty(e,"setLayerDimensions",{enumerable:!0,get:function(){return r.setLayerDimensions}}),Object.defineProperty(e,"shadow",{enumerable:!0,get:function(){return t.shadow}}),Object.defineProperty(e,"updateTextLayer",{enumerable:!0,get:function(){return a.updateTextLayer}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return n.version}});var t=__w_pdfjs_require__(1),n=__w_pdfjs_require__(2),r=__w_pdfjs_require__(6),a=__w_pdfjs_require__(26),i=__w_pdfjs_require__(27),s=__w_pdfjs_require__(5),l=__w_pdfjs_require__(29),o=__w_pdfjs_require__(14),c=__w_pdfjs_require__(32)})(),__nested_webpack_exports__})(),module.exports=root.pdfjsLib=factory()},1497:(e,t,n)=>{"use strict";var r=n(3218);function a(){}function i(){}i.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,i,s){if(s!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:a};return n.PropTypes=n,n}},5173:(e,t,n)=>{e.exports=n(1497)()},3218:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2730:(e,t,n)=>{"use strict";var r=n(5043),a=n(8853);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n