pdfjs-dist
Version:
Generic build of Mozilla's PDF.js library.
22 lines • 1.61 MB
JavaScript
/**
* @licstart The following is the entire license notice for the
* JavaScript code in this page
*
* Copyright 2022 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @licend The above is the entire license notice for the
* JavaScript code in this page
*/
!function webpackUniversalModuleDefinition(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf.worker",[],r):"object"==typeof exports?exports["pdfjs-dist/build/pdf.worker"]=r():t["pdfjs-dist/build/pdf.worker"]=t.pdfjsWorker=r()}(globalThis,(()=>(()=>{var t=[,(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.WorkerTask=r.WorkerMessageHandler=void 0;var c=o(2),l=o(130),u=o(131),h=o(133),d=o(196),g=o(190),y=o(4),m=o(227),v=o(228);function _regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return t};var t={},r=Object.prototype,o=r.hasOwnProperty,c="function"==typeof Symbol?Symbol:{},l=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",h=c.toStringTag||"@@toStringTag";function define(t,r,o){return Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,o){return t[r]=o}}function wrap(t,r,o,c){var l=r&&r.prototype instanceof Generator?r:Generator,u=Object.create(l.prototype),h=new Context(c||[]);return u._invoke=function(t,r,o){var c="suspendedStart";return function(l,u){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===l)throw u;return doneResult()}for(o.method=l,o.arg=u;;){var h=o.delegate;if(h){var g=maybeInvokeDelegate(h,o);if(g){if(g===d)continue;return g}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===c)throw c="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);c="executing";var y=tryCatch(t,r,o);if("normal"===y.type){if(c=o.done?"completed":"suspendedYield",y.arg===d)continue;return{value:y.arg,done:o.done}}"throw"===y.type&&(c="completed",o.method="throw",o.arg=y.arg)}}}(t,o,h),u}function tryCatch(t,r,o){try{return{type:"normal",arg:t.call(r,o)}}catch(t){return{type:"throw",arg:t}}}t.wrap=wrap;var d={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,l,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(values([])));m&&m!==r&&o.call(m,l)&&(g=m);var v=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(c,l,u,h){var d=tryCatch(t[c],t,l);if("throw"!==d.type){var g=d.arg,y=g.value;return y&&"object"==_typeof(y)&&o.call(y,"__await")?r.resolve(y.__await).then((function(t){invoke("next",t,u,h)}),(function(t){invoke("throw",t,u,h)})):r.resolve(y).then((function(t){g.value=t,u(g)}),(function(t){return invoke("throw",t,u,h)}))}h(d.arg)}var c;this._invoke=function(t,o){function callInvokeWithMethodAndArg(){return new r((function(r,c){invoke(t,o,r,c)}))}return c=c?c.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(t,r){var o=t.iterator[r.method];if(void 0===o){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=void 0,maybeInvokeDelegate(t,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var c=tryCatch(o,t.iterator,r.arg);if("throw"===c.type)return r.method="throw",r.arg=c.arg,r.delegate=null,d;var l=c.arg;return l?l.done?(r[t.resultName]=l.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,d):l:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(t){if(t){var r=t[l];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var c=-1,u=function next(){for(;++c<t.length;)if(o.call(t,c))return next.value=t[c],next.done=!1,next;return next.value=void 0,next.done=!0,next};return u.next=u}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(v,"constructor",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(v),t},t.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,u,(function(){return this})),t.AsyncIterator=AsyncIterator,t.async=function(r,o,c,l,u){void 0===u&&(u=Promise);var h=new AsyncIterator(wrap(r,o,c,l),u);return t.isGeneratorFunction(o)?h:h.next().then((function(t){return t.done?t.value:h.next()}))},defineIteratorMethods(v),define(v,h,"Generator"),define(v,l,(function(){return this})),define(v,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var r=[];for(var o in t)r.push(o);return r.reverse(),function next(){for(;r.length;){var o=r.pop();if(o in t)return next.value=o,next.done=!1,next}return next.done=!0,next}},t.values=values,Context.prototype={constructor:Context,reset:function reset(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(t){if(this.done)throw t;var r=this;function handle(o,c){return u.type="throw",u.arg=t,r.next=o,c&&(r.method="next",r.arg=void 0),!!c}for(var c=this.tryEntries.length-1;c>=0;--c){var l=this.tryEntries[c],u=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var h=o.call(l,"catchLoc"),d=o.call(l,"finallyLoc");if(h&&d){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(h){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!d)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var c=this.tryEntries.length-1;c>=0;--c){var l=this.tryEntries[c];if(l.tryLoc<=this.prev&&o.call(l,"finallyLoc")&&this.prev<l.finallyLoc){var u=l;break}}u&&("break"===t||"continue"===t)&&u.tryLoc<=r&&r<=u.finallyLoc&&(u=null);var h=u?u.completion:{};return h.type=t,h.arg=r,u?(this.method="next",this.next=u.finallyLoc,d):this.complete(h)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),d},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.finallyLoc===t)return this.complete(o.completion,o.afterLoc),resetTryEntry(o),d}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc===t){var c=o.completion;if("throw"===c.type){var l=c.arg;resetTryEntry(o)}return l}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,r,o){return this.delegate={iterator:values(t),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=void 0),d}},t}function _toArray(t){return _arrayWithHoles(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||_nonIterableRest()}function _slicedToArray(t,r){return _arrayWithHoles(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function asyncGeneratorStep(t,r,o,c,l,u,h){try{var d=t[u](h),g=d.value}catch(t){o(t);return}d.done?r(g):Promise.resolve(g).then(c,l)}function _asyncToGenerator(t){return function(){var r=this,o=arguments;return new Promise((function(c,l){var u=t.apply(r,o);function _next(t){asyncGeneratorStep(u,c,l,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,c,l,_next,_throw,"throw",t)}_next(void 0)}))}}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var w=function(){function WorkerTask(t){_classCallCheck(this,WorkerTask);this.name=t;this.terminated=!1;this._capability=(0,c.createPromiseCapability)()}_createClass(WorkerTask,[{key:"finished",get:function get(){return this._capability.promise}},{key:"finish",value:function finish(){this._capability.resolve()}},{key:"terminate",value:function terminate(){this.terminated=!0}},{key:"ensureNotTerminated",value:function ensureNotTerminated(){if(this.terminated)throw new Error("Worker task was terminated")}}]);return WorkerTask}();r.WorkerTask=w;var _=function(){function WorkerMessageHandler(){_classCallCheck(this,WorkerMessageHandler)}_createClass(WorkerMessageHandler,null,[{key:"setup",value:function setup(t,r){var o=!1;t.on("test",(function wphSetupTest(r){if(!o){o=!0;t.send("test",r instanceof Uint8Array)}}));t.on("configure",(function wphConfigure(t){(0,c.setVerbosityLevel)(t.verbosity)}));t.on("GetDocRequest",(function wphSetupDoc(t){return WorkerMessageHandler.createDocumentHandler(t,r)}))}},{key:"createDocumentHandler",value:function createDocumentHandler(t,r){var o,_=!1,k=null,S=[],C=(0,c.getVerbosityLevel)(),x=t.apiVersion,O="2.15.349";if(x!==O)throw new Error('The API version "'.concat(x,'" does not match ')+'the Worker version "'.concat(O,'".'));var T=[];for(var E in[])T.push(E);if(T.length)throw new Error("The `Array.prototype` contains unexpected enumerable properties: "+T.join(", ")+"; thus breaking e.g. `for...in` iteration of `Array`s.");if("undefined"==typeof ReadableStream){var M="The browser/environment lacks native support for critical functionality used by the PDF.js library (e.g. `ReadableStream`); ";if(y.isNodeJS)throw new Error(M+"please use a `legacy`-build instead.");throw new Error(M+"please update to a supported browser.")}var R=t.docId,L=t.docBaseUrl,j=t.docId+"_worker",D=new m.MessageHandler(j,R,r);function ensureNotTerminated(){if(_)throw new Error("Worker was terminated")}function startWorkerTask(t){S.push(t)}function finishWorkerTask(t){t.finish();var r=S.indexOf(t);S.splice(r,1)}function loadDocument(t){return _loadDocument.apply(this,arguments)}function _loadDocument(){return(_loadDocument=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(t){var r,c,l,u,h,d,g;return _regeneratorRuntime().wrap((function _callee$(y){for(;;)switch(y.prev=y.next){case 0:y.next=2;return o.ensureDoc("checkHeader");case 2:y.next=4;return o.ensureDoc("parseStartXRef");case 4:y.next=6;return o.ensureDoc("parse",[t]);case 6:y.next=8;return o.ensureDoc("checkFirstPage",[t]);case 8:y.next=10;return o.ensureDoc("checkLastPage",[t]);case 10:y.next=12;return o.ensureDoc("isPureXfa");case 12:if(!(r=y.sent)){y.next=18;break}startWorkerTask(c=new w("loadXfaFonts"));y.next=18;return Promise.all([o.loadXfaFonts(D,c).catch((function(t){})).then((function(){return finishWorkerTask(c)})),o.loadXfaImages()]);case 18:y.next=20;return Promise.all([o.ensureDoc("numPages"),o.ensureDoc("fingerprints")]);case 20:l=y.sent;u=_slicedToArray(l,2);h=u[0];d=u[1];if(!r){y.next=30;break}y.next=27;return o.ensureDoc("htmlForXfa");case 27:y.t0=y.sent;y.next=31;break;case 30:y.t0=null;case 31:g=y.t0;return y.abrupt("return",{numPages:h,fingerprints:d,htmlForXfa:g});case 33:case"end":return y.stop()}}),_callee)})))).apply(this,arguments)}function getPdfManager(t,r,o){var l,u=(0,c.createPromiseCapability)(),d=t.source;if(d.data){try{l=new h.LocalPdfManager(R,d.data,d.password,D,r,o,L);u.resolve(l)}catch(t){u.reject(t)}return u.promise}var g,y=[];try{g=new v.PDFWorkerStream(D)}catch(t){u.reject(t);return u.promise}var m=g.getFullReader();m.headersReady.then((function(){if(m.isRangeSupported){var t=d.disableAutoFetch||m.isStreamingSupported;l=new h.NetworkPdfManager(R,g,{msgHandler:D,password:d.password,length:m.contentLength,disableAutoFetch:t,rangeChunkSize:d.rangeChunkSize},r,o,L);var c,v=_createForOfIteratorHelper(y);try{for(v.s();!(c=v.n()).done;){var w=c.value;l.sendProgressiveData(w)}}catch(t){v.e(t)}finally{v.f()}y=[];u.resolve(l);k=null}})).catch((function(t){u.reject(t);k=null}));var w=0;new Promise((function(t,g){m.read().then((function readChunk(t){var v=t.value,_=t.done;try{ensureNotTerminated();if(_){l||function flushChunks(){var t=(0,c.arraysToBytes)(y);d.length&&t.length!==d.length&&(0,c.warn)("reported HTTP length is different from actual");try{l=new h.LocalPdfManager(R,t,d.password,D,r,o,L);u.resolve(l)}catch(t){u.reject(t)}y=[]}();k=null;return}w+=(0,c.arrayByteLength)(v);m.isStreamingSupported||D.send("DocProgress",{loaded:w,total:Math.max(w,m.contentLength||0)});l?l.sendProgressiveData(v):y.push(v);m.read().then(readChunk,g)}catch(t){g(t)}}),g)})).catch((function(t){u.reject(t);k=null}));k=function cancelXHRs(t){g.cancelAllRequests(t)};return u.promise}D.on("GetPage",(function wphSetupGetPage(t){return o.getPage(t.pageIndex).then((function(t){return Promise.all([o.ensure(t,"rotate"),o.ensure(t,"ref"),o.ensure(t,"userUnit"),o.ensure(t,"view")]).then((function(t){var r=_slicedToArray(t,4);return{rotate:r[0],ref:r[1],userUnit:r[2],view:r[3]}}))}))}));D.on("GetPageIndex",(function wphSetupGetPageIndex(t){var r=l.Ref.get(t.num,t.gen);return o.ensureCatalog("getPageIndex",[r])}));D.on("GetDestinations",(function wphSetupGetDestinations(t){return o.ensureCatalog("destinations")}));D.on("GetDestination",(function wphSetupGetDestination(t){return o.ensureCatalog("getDestination",[t.id])}));D.on("GetPageLabels",(function wphSetupGetPageLabels(t){return o.ensureCatalog("pageLabels")}));D.on("GetPageLayout",(function wphSetupGetPageLayout(t){return o.ensureCatalog("pageLayout")}));D.on("GetPageMode",(function wphSetupGetPageMode(t){return o.ensureCatalog("pageMode")}));D.on("GetViewerPreferences",(function(t){return o.ensureCatalog("viewerPreferences")}));D.on("GetOpenAction",(function(t){return o.ensureCatalog("openAction")}));D.on("GetAttachments",(function wphSetupGetAttachments(t){return o.ensureCatalog("attachments")}));D.on("GetJavaScript",(function wphSetupGetJavaScript(t){return o.ensureCatalog("javaScript")}));D.on("GetDocJSActions",(function wphSetupGetDocJSActions(t){return o.ensureCatalog("jsActions")}));D.on("GetPageJSActions",(function(t){var r=t.pageIndex;return o.getPage(r).then((function(t){return o.ensure(t,"jsActions")}))}));D.on("GetOutline",(function wphSetupGetOutline(t){return o.ensureCatalog("documentOutline")}));D.on("GetOptionalContentConfig",(function(t){return o.ensureCatalog("optionalContentConfig")}));D.on("GetPermissions",(function(t){return o.ensureCatalog("permissions")}));D.on("GetMetadata",(function wphSetupGetMetadata(t){return Promise.all([o.ensureDoc("documentInfo"),o.ensureCatalog("metadata")])}));D.on("GetMarkInfo",(function wphSetupGetMarkInfo(t){return o.ensureCatalog("markInfo")}));D.on("GetData",(function wphSetupGetData(t){o.requestLoadedStream();return o.onLoadedStream().then((function(t){return t.bytes}))}));D.on("GetAnnotations",(function(t){var r=t.pageIndex,c=t.intent;return o.getPage(r).then((function(t){return t.getAnnotationsData(c)}))}));D.on("GetFieldObjects",(function(t){return o.ensureDoc("fieldObjects")}));D.on("HasJSActions",(function(t){return o.ensureDoc("hasJSActions")}));D.on("GetCalculationOrderIds",(function(t){return o.ensureDoc("calculationOrderIds")}));D.on("SaveDocument",(function(t){var r=t.isPureXfa,h=t.numPages,d=t.annotationStorage,y=t.filename;o.requestLoadedStream();var m=r?null:(0,u.getNewAnnotationsMap)(d),v=[o.onLoadedStream(),o.ensureCatalog("acroForm"),o.ensureCatalog("acroFormRef"),o.ensureDoc("xref"),o.ensureDoc("startXRef")];if(m){var _,k=_createForOfIteratorHelper(m);try{var S=function _loop(){var t=_slicedToArray(_.value,2),r=t[0],c=t[1];v.push(o.getPage(r).then((function(t){var o=new w("Save (editor): page ".concat(r));return t.saveNewAnnotations(D,o,c).finally((function(){finishWorkerTask(o)}))})))};for(k.s();!(_=k.n()).done;)S()}catch(t){k.e(t)}finally{k.f()}}if(r)v.push(o.serializeXfaData(d));else for(var C=function _loop2(t){v.push(o.getPage(t).then((function(r){var o=new w("Save: page ".concat(t));return r.save(D,o,d).finally((function(){finishWorkerTask(o)}))})))},x=0;x<h;x++)C(x);return Promise.all(v).then((function(t){var o=_toArray(t),u=o[0],h=o[1],d=o[2],m=o[3],v=o[4],w=o.slice(5),_=[],k=null;if(r){if(!(k=w[0]))return u.bytes}else if(0===(_=w.flat(2)).length)return u.bytes;var S=h instanceof l.Dict&&h.get("XFA")||null,C=null,x=!1;if(Array.isArray(S)){for(var O=0,T=S.length;O<T;O+=2)if("datasets"===S[O]){C=S[O+1];d=null;x=!0}null===C&&(C=m.getNewRef())}else if(S){d=null;(0,c.warn)("Unsupported XFA type.")}var E=Object.create(null);if(m.trailer){var M=Object.create(null),R=m.trailer.get("Info")||null;R instanceof l.Dict&&R.forEach((function(t,r){"string"==typeof r&&(M[t]=(0,c.stringToPDFString)(r))}));E={rootRef:m.trailer.getRaw("Root")||null,encryptRef:m.trailer.getRaw("Encrypt")||null,newRef:m.getNewRef(),infoRef:m.trailer.getRaw("Info")||null,info:M,fileIds:m.trailer.get("ID")||null,startXRef:v,filename:y}}m.resetNewRef();return(0,g.incrementalUpdate)({originalData:u.bytes,xrefInfo:E,newRefs:_,xref:m,hasXfa:!!S,xfaDatasetsRef:C,hasXfaDatasetsEntry:x,acroFormRef:d,acroForm:h,xfaData:k})}))}));D.on("GetOperatorList",(function wphSetupRenderPage(t,r){var l=t.pageIndex;o.getPage(l).then((function(o){var u=new w("GetOperatorList: page ".concat(l));startWorkerTask(u);var h=C>=c.VerbosityLevel.INFOS?Date.now():0;o.getOperatorList({handler:D,sink:r,task:u,intent:t.intent,cacheKey:t.cacheKey,annotationStorage:t.annotationStorage}).then((function(t){finishWorkerTask(u);h&&(0,c.info)("page=".concat(l+1," - getOperatorList: time=")+"".concat(Date.now()-h,"ms, len=").concat(t.length));r.close()}),(function(t){finishWorkerTask(u);if(!u.terminated){D.send("UnsupportedFeature",{featureId:c.UNSUPPORTED_FEATURES.errorOperatorList});r.error(t)}}))}))}));D.on("GetTextContent",(function wphExtractText(t,r){var l=t.pageIndex;o.getPage(l).then((function(o){var u=new w("GetTextContent: page "+l);startWorkerTask(u);var h=C>=c.VerbosityLevel.INFOS?Date.now():0;o.extractTextContent({handler:D,task:u,sink:r,includeMarkedContent:t.includeMarkedContent,combineTextItems:t.combineTextItems}).then((function(){finishWorkerTask(u);h&&(0,c.info)("page=".concat(l+1," - getTextContent: time=")+"".concat(Date.now()-h,"ms"));r.close()}),(function(t){finishWorkerTask(u);u.terminated||r.error(t)}))}))}));D.on("GetStructTree",(function wphGetStructTree(t){return o.getPage(t.pageIndex).then((function(t){return o.ensure(t,"getStructTree")}))}));D.on("FontFallback",(function(t){return o.fontFallback(t.id,D)}));D.on("Cleanup",(function wphCleanup(t){return o.cleanup(!0)}));D.on("Terminate",(function wphTerminate(t){_=!0;var r=[];if(o){o.terminate(new c.AbortException("Worker was terminated."));var l=o.cleanup();r.push(l);o=null}else(0,d.clearGlobalCaches)();k&&k(new c.AbortException("Worker was terminated."));var u,h=_createForOfIteratorHelper(S);try{for(h.s();!(u=h.n()).done;){var g=u.value;r.push(g.finished);g.terminate()}}catch(t){h.e(t)}finally{h.f()}return Promise.all(r).then((function(){D.destroy();D=null}))}));D.on("Ready",(function wphReady(r){!function setupDoc(t){function onSuccess(t){ensureNotTerminated();D.send("GetDoc",{pdfInfo:t})}function onFailure(t){ensureNotTerminated();if(t instanceof c.PasswordException){var r=new w("PasswordException: response ".concat(t.code));startWorkerTask(r);D.sendWithPromise("PasswordRequest",t).then((function(t){var c=t.password;finishWorkerTask(r);o.updatePassword(c);pdfManagerReady()})).catch((function(){finishWorkerTask(r);D.send("DocException",t)}))}else t instanceof c.InvalidPDFException||t instanceof c.MissingPDFException||t instanceof c.UnexpectedResponseException||t instanceof c.UnknownErrorException?D.send("DocException",t):D.send("DocException",new c.UnknownErrorException(t.message,t.toString()))}function pdfManagerReady(){ensureNotTerminated();loadDocument(!1).then(onSuccess,(function(t){ensureNotTerminated();if(t instanceof u.XRefParseException){o.requestLoadedStream();o.onLoadedStream().then((function(){ensureNotTerminated();loadDocument(!0).then(onSuccess,onFailure)}))}else onFailure(t)}))}ensureNotTerminated();getPdfManager(t,{maxImageSize:t.maxImageSize,disableFontFace:t.disableFontFace,ignoreErrors:t.ignoreErrors,isEvalSupported:t.isEvalSupported,fontExtraProperties:t.fontExtraProperties,useSystemFonts:t.useSystemFonts,cMapUrl:t.cMapUrl,standardFontDataUrl:t.standardFontDataUrl},t.enableXfa).then((function(t){if(_){t.terminate(new c.AbortException("Worker was terminated."));throw new Error("Worker was terminated")}(o=t).onLoadedStream().then((function(t){D.send("DataLoaded",{length:t.bytes.byteLength})}))})).then(pdfManagerReady,onFailure)}(t);t=null}));return j}},{key:"initializeFromPort",value:function initializeFromPort(t){var r=new m.MessageHandler("worker","main",t);WorkerMessageHandler.setup(r,t);r.send("ready",null)}}]);return WorkerMessageHandler}();r.WorkerMessageHandler=_;"undefined"==typeof window&&!y.isNodeJS&&"undefined"!=typeof self&&function isMessagePort(t){return"function"==typeof t.postMessage&&"onmessage"in t}(self)&&_.initializeFromPort(self)},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.VerbosityLevel=r.Util=r.UnknownErrorException=r.UnexpectedResponseException=r.UNSUPPORTED_FEATURES=r.TextRenderingMode=r.StreamType=r.RenderingIntentFlag=r.PermissionFlag=r.PasswordResponses=r.PasswordException=r.PageActionEventType=r.OPS=r.MissingPDFException=r.LINE_FACTOR=r.LINE_DESCENT_FACTOR=r.InvalidPDFException=r.ImageKind=r.IDENTITY_MATRIX=r.FormatError=r.FontType=r.FeatureTest=r.FONT_IDENTITY_MATRIX=r.DocumentActionEventType=r.CMapCompressionType=r.BaseException=r.AnnotationType=r.AnnotationStateModelType=r.AnnotationReviewState=r.AnnotationReplyType=r.AnnotationMode=r.AnnotationMarkedState=r.AnnotationFlag=r.AnnotationFieldFlag=r.AnnotationEditorType=r.AnnotationEditorPrefix=r.AnnotationEditorParamsType=r.AnnotationBorderStyleType=r.AnnotationActionEventType=r.AbortException=void 0;r.arrayByteLength=arrayByteLength;r.arraysToBytes=function arraysToBytes(t){var r=t.length;if(1===r&&t[0]instanceof Uint8Array)return t[0];for(var o=0,c=0;c<r;c++)o+=arrayByteLength(t[c]);for(var l=0,u=new Uint8Array(o),h=0;h<r;h++){var d=t[h];d instanceof Uint8Array||(d="string"==typeof d?stringToBytes(d):new Uint8Array(d));var g=d.byteLength;u.set(d,l);l+=g}return u};r.assert=function assert(t,r){t||unreachable(r)};r.bytesToString=function bytesToString(t){"object"===_typeof(t)&&null!==t&&void 0!==t.length||unreachable("Invalid argument for bytesToString");var r=t.length,o=8192;if(r<o)return String.fromCharCode.apply(null,t);for(var c=[],l=0;l<r;l+=o){var u=Math.min(l+o,r),h=t.subarray(l,u);c.push(String.fromCharCode.apply(null,h))}return c.join("")};r.createPromiseCapability=function createPromiseCapability(){var t=Object.create(null),r=!1;Object.defineProperty(t,"settled",{get:function get(){return r}});t.promise=new Promise((function(o,c){t.resolve=function(t){r=!0;o(t)};t.reject=function(t){r=!0;c(t)}}));return t};r.createValidAbsoluteUrl=function createValidAbsoluteUrl(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(o&&"string"==typeof t){if(o.addDefaultProtocol&&t.startsWith("www.")){var c=t.match(/\./g);c&&c.length>=2&&(t="http://".concat(t))}if(o.tryConvertEncoding)try{t=stringToUTF8String(t)}catch(t){}}var l=r?new URL(t,r):new URL(t);if(_isValidProtocol(l))return l}catch(t){}return null};r.escapeString=function escapeString(t){return t.replace(/([()\\\n\r])/g,(function(t){return"\n"===t?"\\n":"\r"===t?"\\r":"\\".concat(t)}))};r.getModificationDate=function getModificationDate(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,r=[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")];return r.join("")};r.getVerbosityLevel=function getVerbosityLevel(){return l};r.info=function info(t){l>=c.INFOS&&console.log("Info: ".concat(t))};r.isArrayBuffer=function isArrayBuffer(t){return"object"===_typeof(t)&&null!==t&&void 0!==t.byteLength};r.isArrayEqual=function isArrayEqual(t,r){if(t.length!==r.length)return!1;for(var o=0,c=t.length;o<c;o++)if(t[o]!==r[o])return!1;return!0};r.isAscii=function isAscii(t){return/^[\x00-\x7F]*$/.test(t)};r.objectFromMap=function objectFromMap(t){var r,o=Object.create(null),c=function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}(t);try{for(c.s();!(r=c.n()).done;){var l=(d=r.value,g=2,function _arrayWithHoles(t){if(Array.isArray(t))return t}(d)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(d,g)||_unsupportedIterableToArray(d,g)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=l[0],h=l[1];o[u]=h}}catch(t){c.e(t)}finally{c.f()}var d,g;return o};r.objectSize=function objectSize(t){return Object.keys(t).length};r.setVerbosityLevel=function setVerbosityLevel(t){Number.isInteger(t)&&(l=t)};r.shadow=shadow;r.string32=function string32(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)};r.stringToBytes=stringToBytes;r.stringToPDFString=function stringToPDFString(t){if(t[0]>="ï"){var r;"þ"===t[0]&&"ÿ"===t[1]?r="utf-16be":"ÿ"===t[0]&&"þ"===t[1]?r="utf-16le":"ï"===t[0]&&"»"===t[1]&&"¿"===t[2]&&(r="utf-8");if(r)try{var o=new TextDecoder(r,{fatal:!0}),c=stringToBytes(t);return o.decode(c)}catch(t){warn('stringToPDFString: "'.concat(t,'".'))}}for(var l=[],u=0,h=t.length;u<h;u++){var d=C[t.charCodeAt(u)];l.push(d?String.fromCharCode(d):t.charAt(u))}return l.join("")};r.stringToUTF16BEString=function stringToUTF16BEString(t){for(var r=["þÿ"],o=0,c=t.length;o<c;o++){var l=t.charCodeAt(o);r.push(String.fromCharCode(l>>8&255),String.fromCharCode(255&l))}return r.join("")};r.stringToUTF8String=stringToUTF8String;r.unreachable=unreachable;r.utf8StringToString=function utf8StringToString(t){return unescape(encodeURIComponent(t))};r.warn=warn;o(3);function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}r.IDENTITY_MATRIX=[1,0,0,1,0,0];r.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0];r.LINE_FACTOR=1.35;r.LINE_DESCENT_FACTOR=.35;r.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};r.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};r.AnnotationEditorPrefix="pdfjs_internal_editor_";r.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,INK:15};r.AnnotationEditorParamsType={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};r.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};r.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};r.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};r.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};r.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"};r.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"};r.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};r.AnnotationReplyType={GROUP:"Group",REPLY:"R"};r.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};r.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};r.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};r.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};r.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};r.PageActionEventType={O:"PageOpen",C:"PageClose"};r.StreamType={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};r.FontType={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};var c={ERRORS:0,WARNINGS:1,INFOS:5};r.VerbosityLevel=c;r.CMapCompressionType={NONE:0,BINARY:1,STREAM:2};r.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};r.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"};r.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};var l=c.WARNINGS;function warn(t){l>=c.WARNINGS&&console.log("Warning: ".concat(t))}function unreachable(t){throw new Error(t)}function _isValidProtocol(t){if(!t)return!1;switch(t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function shadow(t,r,o){Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!1});return o}var u=function BaseExceptionClosure(){function BaseException(t,r){this.constructor===BaseException&&unreachable("Cannot initialize BaseException.");this.message=t;this.name=r}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();r.BaseException=u;var h=function(t){_inherits(PasswordException,t);var r=_createSuper(PasswordException);function PasswordException(t,o){var c;_classCallCheck(this,PasswordException);(c=r.call(this,t,"PasswordException")).code=o;return c}return _createClass(PasswordException)}(u);r.PasswordException=h;var d=function(t){_inherits(UnknownErrorException,t);var r=_createSuper(UnknownErrorException);function UnknownErrorException(t,o){var c;_classCallCheck(this,UnknownErrorException);(c=r.call(this,t,"UnknownErrorException")).details=o;return c}return _createClass(UnknownErrorException)}(u);r.UnknownErrorException=d;var g=function(t){_inherits(InvalidPDFException,t);var r=_createSuper(InvalidPDFException);function InvalidPDFException(t){_classCallCheck(this,InvalidPDFException);return r.call(this,t,"InvalidPDFException")}return _createClass(InvalidPDFException)}(u);r.InvalidPDFException=g;var y=function(t){_inherits(MissingPDFException,t);var r=_createSuper(MissingPDFException);function MissingPDFException(t){_classCallCheck(this,MissingPDFException);return r.call(this,t,"MissingPDFException")}return _createClass(MissingPDFException)}(u);r.MissingPDFException=y;var m=function(t){_inherits(UnexpectedResponseException,t);var r=_createSuper(UnexpectedResponseException);function UnexpectedResponseException(t,o){var c;_classCallCheck(this,UnexpectedResponseException);(c=r.call(this,t,"UnexpectedResponseException")).status=o;return c}return _createClass(UnexpectedResponseException)}(u);r.UnexpectedResponseException=m;var v=function(t){_inherits(FormatError,t);var r=_createSuper(FormatError);function FormatError(t){_classCallCheck(this,FormatError);return r.call(this,t,"FormatError")}return _createClass(FormatError)}(u);r.FormatError=v;var w=function(t){_inherits(AbortException,t);var r=_createSuper(AbortException);function AbortException(t){_classCallCheck(this,AbortException);return r.call(this,t,"AbortException")}return _createClass(AbortException)}(u);r.AbortException=w;function stringToBytes(t){"string"!=typeof t&&unreachable("Invalid argument for stringToBytes");for(var r=t.length,o=new Uint8Array(r),c=0;c<r;++c)o[c]=255&t.charCodeAt(c);return o}function arrayByteLength(t){if(void 0!==t.length)return t.length;if(void 0!==t.byteLength)return t.byteLength;unreachable("Invalid argument for arrayByteLength")}var _=function(){function FeatureTest(){_classCallCheck(this,FeatureTest)}_createClass(FeatureTest,null,[{key:"isLittleEndian",get:function get(){return shadow(this,"isLittleEndian",function isLittleEndian(){var t=new Uint8Array(4);t[0]=1;return 1===new Uint32Array(t.buffer,0,1)[0]}())}},{key:"isEvalSupported",get:function get(){return shadow(this,"isEvalSupported",function isEvalSupported(){try{new Function("");return!0}catch(t){return!1}}())}},{key:"isOffscreenCanvasSupported",get:function get(){return shadow(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}}]);return FeatureTest}();r.FeatureTest=_;var k=_toConsumableArray(Array(256).keys()).map((function(t){return t.toString(16).padStart(2,"0")})),S=function(){function Util(){_classCallCheck(this,Util)}_createClass(Util,null,[{key:"makeHexColor",value:function makeHexColor(t,r,o){return"#".concat(k[t]).concat(k[r]).concat(k[o])}},{key:"scaleMinMax",value:function scaleMinMax(t,r){var o;if(t[0]){if(t[0]<0){o=r[0];r[0]=r[1];r[1]=o}r[0]*=t[0];r[1]*=t[0];if(t[3]<0){o=r[2];r[2]=r[3];r[3]=o}r[2]*=t[3];r[3]*=t[3]}else{o=r[0];r[0]=r[2];r[2]=o;o=r[1];r[1]=r[3];r[3]=o;if(t[1]<0){o=r[2];r[2]=r[3];r[3]=o}r[2]*=t[1];r[3]*=t[1];if(t[2]<0){o=r[0];r[0]=r[1];r[1]=o}r[0]*=t[2];r[1]*=t[2]}r[0]+=t[4];r[1]+=t[4];r[2]+=t[5];r[3]+=t[5]}},{key:"transform",value:function transform(t,r){return[t[0]*r[0]+t[2]*r[1],t[1]*r[0]+t[3]*r[1],t[0]*r[2]+t[2]*r[3],t[1]*r[2]+t[3]*r[3],t[0]*r[4]+t[2]*r[5]+t[4],t[1]*r[4]+t[3]*r[5]+t[5]]}},{key:"applyTransform",value:function applyTransform(t,r){return[t[0]*r[0]+t[1]*r[2]+r[4],t[0]*r[1]+t[1]*r[3]+r[5]]}},{key:"applyInverseTransform",value:function applyInverseTransform(t,r){var o=r[0]*r[3]-r[1]*r[2];return[(t[0]*r[3]-t[1]*r[2]+r[2]*r[5]-r[4]*r[3])/o,(-t[0]*r[1]+t[1]*r[0]+r[4]*r[1]-r[5]*r[0])/o]}},{key:"getAxialAlignedBoundingBox",value:function getAxialAlignedBoundingBox(t,r){var o=Util.applyTransform(t,r),c=Util.applyTransform(t.slice(2,4),r),l=Util.applyTransform([t[0],t[3]],r),u=Util.applyTransform([t[2],t[1]],r);return[Math.min(o[0],c[0],l[0],u[0]),Math.min(o[1],c[1],l[1],u[1]),Math.max(o[0],c[0],l[0],u[0]),Math.max(o[1],c[1],l[1],u[1])]}},{key:"inverseTransform",value:function inverseTransform(t){var r=t[0]*t[3]-t[1]*t[2];return[t[3]/r,-t[1]/r,-t[2]/r,t[0]/r,(t[2]*t[5]-t[4]*t[3])/r,(t[4]*t[1]-t[5]*t[0])/r]}},{key:"apply3dTransform",value:function apply3dTransform(t,r){return[t[0]*r[0]+t[1]*r[1]+t[2]*r[2],t[3]*r[0]+t[4]*r[1]+t[5]*r[2],t[6]*r[0]+t[7]*r[1]+t[8]*r[2]]}},{key:"singularValueDecompose2dScale",value:function singularValueDecompose2dScale(t){var r=[t[0],t[2],t[1],t[3]],o=t[0]*r[0]+t[1]*r[2],c=t[0]*r[1]+t[1]*r[3],l=t[2]*r[0]+t[3]*r[2],u=t[2]*r[1]+t[3]*r[3],h=(o+u)/2,d=Math.sqrt(Math.pow(o+u,2)-4*(o*u-l*c))/2,g=h+d||1,y=h-d||1;return[Math.sqrt(g),Math.sqrt(y)]}},{key:"normalizeRect",value:function normalizeRect(t){var r=t.slice(0);if(t[0]>t[2]){r[0]=t[2];r[2]=t[0]}if(t[1]>t[3]){r[1]=t[3];r[3]=t[1]}return r}},{key:"intersect",value:function intersect(t,r){var o=Math.max(Math.min(t[0],t[2]),Math.min(r[0],r[2])),c=Math.min(Math.max(t[0],t[2]),Math.max(r[0],r[2]));if(o>c)return null;var l=Math.max(Math.min(t[1],t[3]),Math.min(r[1],r[3])),u=Math.min(Math.max(t[1],t[3]),Math.max(r[1],r[3]));return l>u?null:[o,l,c,u]}},{key:"bezierBoundingBox",value:function bezierBoundingBox(t,r,o,c,l,u,h,d){for(var g,y,m,v,w,_,k,S,C=[],x=[[],[]],O=0;O<2;++O){if(0===O){y=6*t-12*o+6*l;g=-3*t+9*o-9*l+3*h;m=3*o-3*t}else{y=6*r-12*c+6*u;g=-3*r+9*c-9*u+3*d;m=3*c-3*r}if(Math.abs(g)<1e-12){if(Math.abs(y)<1e-12)continue;0<(v=-m/y)&&v<1&&C.push(v)}else{k=y*y-4*m*g;S=Math.sqrt(k);if(!(k<0)){0<(w=(-y+S)/(2*g))&&w<1&&C.push(w);0<(_=(-y-S)/(2*g))&&_<1&&C.push(_)}}}for(var T,E=C.length,M=E;E--;){T=1-(v=C[E]);x[0][E]=T*T*T*t+3*T*T*v*o+3*T*v*v*l+v*v*v*h;x[1][E]=T*T*T*r+3*T*T*v*c+3*T*v*v*u+v*v*v*d}x[0][M]=t;x[1][M]=r;x[0][M+1]=h;x[1][M+1]=d;x[0].length=x[1].length=M+2;return[Math.min.apply(Math,_toConsumableArray(x[0])),Math.min.apply(Math,_toConsumableArray(x[1])),Math.max.apply(Math,_toConsumableArray(x[0])),Math.max.apply(Math,_toConsumableArray(x[1]))]}}]);return Util}();r.Util=S;var C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function stringToUTF8String(t){return decodeURIComponent(escape(t))}},(t,r,o)=>{"use strict";var c=o(4);if(!globalThis._pdfjsCompatibilityChecked){globalThis._pdfjsCompatibilityChecked=!0;!function checkNodeBtoa(){!globalThis.btoa&&c.isNodeJS&&(globalThis.btoa=function(t){return Buffer.from(t,"binary").toString("base64")})}();!function checkNodeAtob(){!globalThis.atob&&c.isNodeJS&&(globalThis.atob=function(t){return Buffer.from(t,"base64").toString("binary")})}();!function checkDOMMatrix(){!globalThis.DOMMatrix&&c.isNodeJS&&(globalThis.DOMMatrix=require("dommatrix/dist/dommatrix.js"))}();!function checkReadableStream(){!globalThis.ReadableStream&&c.isNodeJS&&(globalThis.ReadableStream=require("web-streams-polyfill/dist/ponyfill.js").ReadableStream)}();!function checkArrayAt(){Array.prototype.at||o(5)}();!function checkTypedArrayAt(){Uint8Array.prototype.at||o(77)}();!function checkStructuredClone(){globalThis.structuredClone||o(87)}()}},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.isNodeJS=void 0;function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}var o=!("object"!==("undefined"==typeof process?"undefined":_typeof(process))||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);r.isNodeJS=o},(t,r,o)=>{o(6);var c=o(76);t.exports=c("Array","at")},(t,r,o)=>{"use strict";var c=o(7),l=o(42),u=o(66),h=o(64),d=o(71);c({target:"Array",proto:!0},{at:function at(t){var r=l(this),o=u(r),c=h(t),d=c>=0?c:o+c;return d<0||d>=o?void 0:r[d]}});d("at")},(t,r,o)=>{var c=o(8),l=o(9).f,u=o(46),h=o(50),d=o(40),g=o(58),y=o(70);t.exports=function(t,r){var o,m,v,w,_,k=t.target,S=t.global,C=t.stat;if(o=S?c:C?c[k]||d(k,{}):(c[k]||{}).prototype)for(m in r){w=r[m];v=t.dontCallGetSet?(_=l(o,m))&&_.value:o[m];if(!y(S?m:k+(C?".":"#")+m,t.forced)&&void 0!==v){if(typeof w==typeof v)continue;g(w,v)}(t.sham||v&&v.sham)&&u(w,"sham",!0);h(o,m,w,t)}}},t=>{var check=function(t){return t&&t.Math==Math&&t};t.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||function(){return this}()||Function("return this")()},(t,r,o)=>{var c=o(10),l=o(12),u=o(14),h=o(15),d=o(16),g=o(21),y=o(41),m=o(44),v=Object.getOwnPropertyDescriptor;r.f=c?v:function getOwnPropertyDescriptor(t,r){t=d(t);r=g(r);i