/*! * PSPDFKit for Web 2023.5.0-3f96296 (https://pspdfkit.com/web) * * Copyright (c) 2016-2023 PSPDFKit GmbH. All rights reserved. * * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT. * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES. * This notice may not be removed from this file. * * PSPDFKit uses several open source third-party components: https://pspdfkit.com/acknowledgements/web/ */ (self.webpackChunkPSPDFKit=self.webpackChunkPSPDFKit||[]).push([[9859],{49859:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Conformance:()=>f,GdPicture:()=>h,GdPictureClientNative:()=>P,GdPictureWorker:()=>S,getBrowserSpawner:()=>E});var n=r(84121),o=r(47347),s=r(72852);const a="pspdfkit-lib/",i=`${a}gdpicture-2255489f40d33d76b4ed1c4fa1925c8a5a50ab31/jit`,c=`${i}/initDotnet.js`,l=`${a}gdpicture-2255489f40d33d76b4ed1c4fa1925c8a5a50ab31/aot`,d=`${l}/initDotnet.js`;let f;function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function p(t){for(var e=1;e1?r-1:0),s=1;s{const e=t.data,r=this.requests.get(e.id);(0,o.kG)(r,`No request was made for id ${e.id}.`);const{resolve:n,reject:s}=r;if(this.requests.delete(e.id),e.error){const t=new o.p2(e.error);t.callArgs=e.callArgs,s(t)}else n(e.result)})),this.workerSpawner=l,this.workerSpawner.setMessageHandler(this.handleMessage),this.moduleLoadPromise=this.sendRequest("loadModule",[d?{baseUrl:e,wasmLoaderPath:d}:e,r,s,a,i,c])}toPdf(t,e){let r;return e&&(r=e.replace("pdf","pdf_").replaceAll("-","_")),this.sendRequest("toPdf",[t,r])}destroy(){var t;null===(t=this.workerSpawner)||void 0===t||t.terminate(),this.workerSpawner=null}async sendRequest(t,e){(0,o.kG)(this.workerSpawner,"GdPictureClient has been destroyed"),this.moduleLoadPromise&&await this.moduleLoadPromise;const r=this.workerSpawner;return new Promise(((n,o)=>{const s=this.assignId(),a=[...e].filter((t=>t instanceof ArrayBuffer));r.postMessage({id:s,action:t,args:e},a),this.requests=this.requests.set(s,{resolve:n,reject:o})}))}assignId(){const t=this.nextRequestId;return this.nextRequestId=this.nextRequestId+1,t}};const P=class{constructor(t){let{baseUrl:e,aot:r,mainThreadOrigin:n,licenseKey:o,customFonts:s,dynamicFonts:a}=t;this.gdPicture=new h,this.moduleLoadPromise=this.gdPicture.loadModule(e,r,n,o,s,a)}async toPdf(t,e){let r;return this.moduleLoadPromise&&await this.moduleLoadPromise,e&&(r=e.replace("pdf","pdf_").replaceAll("-","_")),this.gdPicture.toPdf(t,r)}destroy(){}};var O=r(59817),F=r.n(O);const E=async function(){let t=new(F());return{setMessageHandler(e){(0,o.kG)(t,"Worker is null"),t.onmessage=e},postMessage(e,r){var n;null===(n=t)||void 0===n||n.postMessage(e,r)},terminate(){var e;null===(e=t)||void 0===e||e.terminate(),t=null}}}},59817:(t,e,r)=>{t.exports=function(){return r(69855)('/*!\n * PSPDFKit for Web 2023.5.0-3f96296 (https://pspdfkit.com/web)\n *\n * Copyright (c) 2016-2023 PSPDFKit GmbH. All rights reserved.\n *\n * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW\n * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.\n * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.\n * This notice may not be removed from this file.\n *\n * PSPDFKit uses several open source third-party components: https://pspdfkit.com/acknowledgements/web/\n */(()=>{"use strict";const t=function t(e){let r;return r=e instanceof Error?e:new Error(e),Object.setPrototypeOf(r,t.prototype),r};t.prototype=Object.create(Error.prototype,{name:{value:"PSPDFKitError",enumerable:!1}});const e=t;function r(t,r){if(!t)throw new e(`Assertion failed: ${r||"Condition not met"}\\n\\nFor further assistance, please go to: https://pspdfkit.com/support/request`)}function n(t){return n="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},n(t)}function o(t){var e=function(t,e){if("object"!==n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===n(e)?e:String(e)}function a(t,e,r){return(e=o(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[contenteditable]",\'[tabindex]:not([tabindex^="-"])\'].join(",");new WeakMap;const i="pspdfkit-lib/",s=`${i}gdpicture-2255489f40d33d76b4ed1c4fa1925c8a5a50ab31/jit`,c=`${s}/initDotnet.js`,f=`${i}gdpicture-2255489f40d33d76b4ed1c4fa1925c8a5a50ab31/aot`,l=`${f}/initDotnet.js`;let u;function d(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function p(t){for(var e=1;e1?n-1:0),a=1;a{throw new e(`Error fetching dynamic fonts file ${t}. ${r}`)}));if(200!==r.status)throw new e(`Error fetching dynamic fonts file ${t}. Status code: ${r.status}`);const n=await r.json().catch((r=>{throw new e(`Error parsing dynamic fonts file ${t}. ${r}`)}));return n}catch(t){throw t}}(i);w("gdpicture/setDynamicFontLoading",{baseUrl:i.split("/").slice(0,-1).join("/"),allowedFonts:t.availableFonts,v:1})}}toPdf(t,e){_.FS.writeFile(b,new Uint8Array(t));const r={file:y};e&&e in u&&(r.conformance=e);try{return w("gdpicture/process",{input:{file:b},output:r}),_.FS.readFile(y).buffer}finally{try{_.FS.unlink(y)}catch(t){}}}},S=self;S.global=S,S.module={},S.onmessage=async t=>{let e,r,{data:n}=t;try{const t=await h[n.action](...n.args);if(e={id:n.id,result:t},Array.isArray(t)){const e=t.filter((t=>t instanceof ArrayBuffer));e.length>0&&(r=e)}t instanceof ArrayBuffer&&(r=[t])}catch(t){const o=[...n.args].filter((t=>t instanceof ArrayBuffer));o.length>0&&(r=o),e={id:n.id,error:t.message||t.toString(),callArgs:n.args}}S.postMessage(e,r)}})();',null)}}}]);