/*! * PSPDFKit for Web 2023.5.2 (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:()=>i,GdPicture:()=>g,GdPictureClientNative:()=>h,GdPictureWorker:()=>w,getBrowserSpawner:()=>F});var n=r(84121),o=r(47347),s=r(72852);let i=function(t){return t[t.pdf_a_1a=0]="pdf_a_1a",t[t.pdf_a_1b=1]="pdf_a_1b",t[t.pdf_a_2a=2]="pdf_a_2a",t[t.pdf_a_2u=3]="pdf_a_2u",t[t.pdf_a_2b=4]="pdf_a_2b",t[t.pdf_a_3a=5]="pdf_a_3a",t[t.pdf_a_3u=6]="pdf_a_3u",t[t.pdf_a_3b=7]="pdf_a_3b",t[t.pdf_a_4=8]="pdf_a_4",t[t.pdf_a_4e=9]="pdf_a_4e",t[t.pdf_a_4f=10]="pdf_a_4f",t}({});function a(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 l(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=u,this.workerSpawner.setMessageHandler(this.handleMessage),this.moduleLoadPromise=this.sendRequest("loadModule",[d?{baseUrl:e,wasmLoaderPath:d}:e,r,s,i,a,l,c])}toPdf(t,e){let r;return e&&(r=e.replace("pdf","pdf_").replaceAll("-","_")),this.sendRequest("toPdf",[t,r])}async populateDocumentTemplate(t,e){return this.sendRequest("populateDocumentTemplate",[t,e])}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(),i=[...e].filter((t=>t instanceof ArrayBuffer));r.postMessage({id:s,action:t,args:e},i),this.requests=this.requests.set(s,{resolve:n,reject:o})}))}assignId(){const t=this.nextRequestId;return this.nextRequestId=this.nextRequestId+1,t}};const h=class{constructor(t){let{baseUrl:e,aot:r,mainThreadOrigin:n,licenseKey:o,customFonts:s,dynamicFonts:i,fontSubstitutions:a}=t;this.gdPicture=new g,this.moduleLoadPromise=this.gdPicture.loadModule(e,r,n,o,s,i,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)}async populateDocumentTemplate(t,e){return this.moduleLoadPromise&&await this.moduleLoadPromise,this.gdPicture.populateDocumentTemplate(t,e)}destroy(){}};var S=r(59817),P=r.n(S);const F=async function(){let t=new(P());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.2 (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 i(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;let a=function(t){return t[t.pdf_a_1a=0]="pdf_a_1a",t[t.pdf_a_1b=1]="pdf_a_1b",t[t.pdf_a_2a=2]="pdf_a_2a",t[t.pdf_a_2u=3]="pdf_a_2u",t[t.pdf_a_2b=4]="pdf_a_2b",t[t.pdf_a_3a=5]="pdf_a_3a",t[t.pdf_a_3u=6]="pdf_a_3u",t[t.pdf_a_3b=7]="pdf_a_3b",t[t.pdf_a_4=8]="pdf_a_4",t[t.pdf_a_4e=9]="pdf_a_4e",t[t.pdf_a_4f=10]="pdf_a_4f",t}({});function s(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 c(t){for(var e=1;e1?n-1:0),i=1;i{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}}(a);_("gdpicture/setDynamicFontLoading",{baseUrl:a.split("/").slice(0,-1).join("/"),allowedFonts:t.availableFonts,v:1})}s&&_("gdpicture/setFontSubstitutions",{fontSubstitutions:s})}toPdf(t,e){b.FS.writeFile(f,new Uint8Array(t));const r={file:l,format:"pdf"};e&&e in a&&(r.conformance=e);try{return _("gdpicture/process",{input:{file:f},output:r}),b.FS.readFile(l).buffer}finally{try{b.FS.unlink(l)}catch(t){}}}async populateDocumentTemplate(t,e){let r;b.FS.writeFile(u,new Uint8Array(t));try{r=JSON.stringify(e,null,2)}catch(t){throw new Error("Invalid config data")}b.FS.writeFile(d,r);try{return _("gdpicture/process-office-template",{inputFile:u,modelAndConfigFile:d,outputFile:p}),b.FS.readFile(p).buffer}finally{try{b.FS.unlink(p),b.FS.unlink(d)}catch(t){}}}},w=self;w.global=w,w.module={},w.onmessage=async t=>{let e,r,{data:n}=t;try{const t=await g[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}}w.postMessage(e,r)}})();',null)}}}]);