file-viewer-demo/public/dist/assets/pdf.worker-2ce04d0b.js

59 lines
1.1 MiB
JavaScript
Raw Permalink Normal View History

2024-01-30 00:54:29 +00:00
var oa=Object.defineProperty;var ca=(Rt,Dt,Ut)=>Dt in Rt?oa(Rt,Dt,{enumerable:!0,configurable:!0,writable:!0,value:Ut}):Rt[Dt]=Ut;var Xt=(Rt,Dt,Ut)=>(ca(Rt,typeof Dt!="symbol"?Dt+"":Dt,Ut),Ut),Ln=(Rt,Dt,Ut)=>{if(!Dt.has(Rt))throw TypeError("Cannot "+Ut)};var Bt=(Rt,Dt,Ut)=>(Ln(Rt,Dt,"read from private field"),Ut?Ut.call(Rt):Dt.get(Rt)),vt=(Rt,Dt,Ut)=>{if(Dt.has(Rt))throw TypeError("Cannot add the same private member more than once");Dt instanceof WeakSet?Dt.add(Rt):Dt.set(Rt,Ut)},gn=(Rt,Dt,Ut,Sn)=>(Ln(Rt,Dt,"write to private field"),Sn?Sn.call(Rt,Ut):Dt.set(Rt,Ut),Ut);var ct=(Rt,Dt,Ut)=>(Ln(Rt,Dt,"access private method"),Ut);(function(){"use strict";var Rt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Dt={exports:{}};(function(Ut,Sn){(function(cn,ln){Ut.exports=cn.pdfjsWorker=ln()})(globalThis,()=>(()=>{var Vn=[,(he,d,i)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.WorkerTask=d.WorkerMessageHandler=void 0,i(2),i(84),i(93),i(94),i(97),i(99),i(101),i(105),i(108),i(115),i(116),i(127),i(129),i(132),i(134),i(136),i(138),i(140),i(144);var n=i(145),u=i(150),g=i(151),e=i(153),t=i(157),s=i(219),L=i(224),U=i(258),C=i(259),y=i(223);class f{constructor(v){this.name=v,this.terminated=!1,this._capability=new n.PromiseCapability}get finished(){return this._capability.promise}finish(){this._capability.resolve()}terminate(){this.terminated=!0}ensureNotTerminated(){if(this.terminated)throw new Error("Worker task was terminated")}}d.WorkerTask=f;class x{static setup(v,P){let F=!1;v.on("test",function(B){F||(F=!0,v.send("test",B instanceof Uint8Array))}),v.on("configure",function(B){(0,n.setVerbosityLevel)(B.verbosity)}),v.on("GetDocRequest",function(B){return x.createDocumentHandler(B,P)})}static createDocumentHandler(v,P){let F,B=!1,W=null;const j=new Set,M=(0,n.getVerbosityLevel)(),{docId:T,apiVersion:c}=v,h="3.11.174";if(c!==h)throw new Error(`The API version "${c}" does not match the Worker version "${h}".`);const E=[];for(const A in[])E.push(A);if(E.length)throw new Error("The `Array.prototype` contains unexpected enumerable properties: "+E.join(", ")+"; thus breaking e.g. `for...in` iteration of `Array`s.");const o=T+"_worker";let l=new U.MessageHandler(o,T,P);function b(){if(B)throw new Error("Worker was terminated")}function R(A){j.add(A)}function S(A){A.finish(),j.delete(A)}async function p(A){await F.ensureDoc("checkHeader"),await F.ensureDoc("parseStartXRef"),await F.ensureDoc("parse",[A]),await F.ensureDoc("checkFirstPage",[A]),await F.ensureDoc("checkLastPage",[A]);const D=await F.ensureDoc("isPureXfa");if(D){const H=new f("loadXfaFonts");R(H),await Promise.all([F.loadXfaFonts(l,H).catch(Y=>{}).then(()=>S(H)),F.loadXfaImages()])}const[w,m]=await Promise.all([F.ensureDoc("numPages"),F.ensureDoc("fingerprints")]),I=D?await F.ensureDoc("htmlForXfa"):null;return{numPages:w,fingerprints:m,htmlForXfa:I}}function G(A){let{data:D,password:w,disableAutoFetch:m,rangeChunkSize:I,length:H,docBaseUrl:Y,enableXfa:Q,evaluatorOptions:oe}=A;const ne={source:null,disableAutoFetch:m,docBaseUrl:Y,docId:T,enableXfa:Q,evaluatorOptions:oe,handler:l,length:H,password:w,rangeChunkSize:I},ce=new n.PromiseCapability;let J;if(D){try{ne.source=D,J=new e.LocalPdfManager(ne),ce.resolve(J)}catch(te){ce.reject(te)}return ce.promise}let _,k=[];try{_=new C.PDFWorkerStream(l)}catch(te){return ce.reject(te),ce.promise}const O=_.getFullReader();O.headersReady.then(function(){if(O.isRangeSupported){ne.source=_,ne.length=O.contentLength,ne.disableAutoFetch||(ne.disableAutoFetch=O.isStreamingSupported),J=new e.NetworkPdfManager(ne);for(const te of k)J.sendProgressiveData(te);k=[],ce.resolve(J),W=null}}).catch(function(te){ce.reject(te),W=null});let V=0;const K=function(){const te=(0,u.arrayBuffersToBytes)(k);H&&te.length!==H&&(0,n.warn)("reported HTTP length is different from actual");try{ne.source=te,J=new e.LocalPdfManager(ne),ce.resolve(J)}catch(re){ce.reject(re)}k=[]};return new Promise(function(te,re){const ie=function(Z){let{value:ee,done:q}=Z;try{if(b(),q){J||K(),W=null;return}V+=ee.byteLeng
`?"\\n":w==="\r"?"\\r":`\\${w}`)}function T(D,w,m,I){if(!D)return;let H=null;if(D instanceof u.Ref){if(I.has(D))return;H=D,I.put(H),D=w.fetch(D)}if(Array.isArray(D))for(const Y of D)T(Y,w,m,I);else if(D instanceof u.Dict){if((0,u.isName)(D.get("S"),"JavaScript")){const Y=D.get("JS");let Q;Y instanceof g.BaseStream?Q=Y.getString():typeof Y=="string"&&(Q=Y),Q&&(Q=(0,n.stringToPDFString)(Q).replaceAll("\0","")),Q&&m.push(Q)}T(D.getRaw("Next"),w,m,I)}H&&I.remove(H)}function c(D,w,m){const I=Object.create(null),H=f({dict:w,key:"AA",stopWhenFound:!1});if(H)for(let Y=H.length-1;Y>=0;Y--){const Q=H[Y];if(Q instanceof u.Dict)for(const oe of Q.getKeys()){const ne=m[oe];if(!ne)continue;const ce=Q.getRaw(oe),J=new u.RefSet,_=[];T(ce,D,_,J),_.length>0&&(I[ne]=_)}}if(w.has("A")){const Y=w.get("A"),Q=new u.RefSet,oe=[];T(Y,D,oe,Q),oe.length>0&&(I.Action=oe)}return(0,n.objectSize)(I)>0?I:null}const h={60:"&lt;",62:"&gt;",38:"&amp;",34:"&quot;",39:"&apos;"};function E(D){const w=[];let m=0;for(let I=0,H=D.length;I<H;I++){const Y=D.codePointAt(I);if(32<=Y&&Y<=126){const Q=h[Y];Q&&(m<I&&w.push(D.substring(m,I)),w.push(Q),m=I+1)}else m<I&&w.push(D.substring(m,I)),w.push(`&#x${Y.toString(16).toUpperCase()};`),Y>55295&&(Y<57344||Y>65533)&&I++,m=I+1}return w.length===0?D:(m<D.length&&w.push(D.substring(m,D.length)),w.join(""))}function o(D){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const m=/^("|').*("|')$/.exec(D);if(m&&m[1]===m[2]){if(new RegExp(`[^\\\\]${m[1]}`).test(D.slice(1,-1)))return w&&(0,n.warn)(`FontFamily contains unescaped ${m[1]}: ${D}.`),!1}else for(const I of D.split(/[ \t]+/))if(/^(\d|(-(\d|-)))/.test(I)||!/^[\w-\\]+$/.test(I))return w&&(0,n.warn)(`FontFamily contains invalid <custom-ident>: ${D}.`),!1;return!0}function l(D){const w="14",m="400",I=new Set(["100","200","300","400","500","600","700","800","900","1000","normal","bold","bolder","lighter"]),{fontFamily:H,fontWeight:Y,italicAngle:Q}=D;if(!o(H,!0))return!1;const oe=Y?Y.toString():"";D.fontWeight=I.has(oe)?oe:m;const ne=parseFloat(Q);return D.italicAngle=isNaN(ne)||ne<-90||ne>90?w:Q.toString(),!0}function b(D){const w=["app.launchURL","window.open","xfa.host.gotoURL"],I=new RegExp("^\\s*("+w.join("|").replaceAll(".","\\.")+`)\\((?:'|")([^'"]*)(?:'|")(?:,\\s*(\\w+)\\)|\\))`,"i").exec(D);if(I!=null&&I[2]){const H=I[2];let Y=!1;return I[3]==="true"&&I[1]==="app.launchURL"&&(Y=!0),{url:H,newWindow:Y}}return null}function R(D){if(Number.isInteger(D))return D.toString();const w=Math.round(D*100);return w%100===0?(w/100).toString():w%10===0?D.toFixed(1):D.toFixed(2)}function S(D){if(!D)return null;const w=new Map;for(const[m,I]of D){if(!m.startsWith(n.AnnotationEditorPrefix))continue;let H=w.get(I.pageIndex);H||(H=[],w.set(I.pageIndex,H)),H.push(I)}return w.size>0?w:null}function p(D){return/^[\x00-\x7F]*$/.test(D)}function G(D){const w=[];for(let m=0,I=D.length;m<I;m++){const H=D.charCodeAt(m);w.push((H>>8&255).toString(16).padStart(2,"0"),(H&255).toString(16).padStart(2,"0"))}return w.join("")}function $(D){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const m=[];w&&m.push("þÿ");for(let I=0,H=D.length;I<H;I++){const Y=D.charCodeAt(I);m.push(String.fromCharCode(Y>>8&255),String.fromCharCode(Y&255))}return m.join("")}function A(D,w,m){switch(D){case 90:return[0,1,-1,0,w,0];case 180:return[-1,0,0,-1,w,m];case 270:return[0,-1,1,0,0,m];default:throw new Error("Invalid rotation")}}},(he,d,i)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.RefSetCache=d.RefSet=d.Ref=d.Name=d.EOF=d.Dict=d.Cmd=d.CIRCULAR_REF=void 0,d.clearPrimitiveCaches=L,d.isCmd=P,d.isDict=F,d.isName=v,d.isRefsEqual=B,i(140),i(116),i(127),i(129),i(132),i(134),i(136),i(138);var n=i(145);const u=Symbol("CIRCULAR_REF");d.CIRCULAR_REF=u;const g=Symbol("EOF");d.EOF=g;let e=Object.create(null),t=Object.create(null),s=Object.create(null);function L(){e=Object.create(null),t=Object.create(null),s=Object.create(null)}class U{constructor(j){this.name=j}static get(j){return t[j]||(t[j]=new U(j))}}d.Name=U;class C{constructor(j){this.cmd=j}static get(j){return e[j]||(e[j]=new C(
`);return`/Tx BMC q ${fe}BT `+k+` 1 0 0 1 0 ${(0,u.numberToString)(re)} Tm ${ge} ET Q EMC`}_splitLine(k,O,V,K){let te=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};k=te.line||k;const re=te.glyphs||O.charsToGlyphs(k);if(re.length<=1)return[k];const ie=te.positions||O.getCharPositions(k),Z=V/1e3,ee=[];let q=-1,z=-1,ae=-1,se=0,le=0;for(let ue=0,fe=re.length;ue<fe;ue++){const[ge,me]=ie[ue],be=re[ue],ye=be.width*Z;be.unicode===" "?le+ye>K?(ee.push(k.substring(se,ge)),se=ge,le=ye,q=-1,ae=-1):(le+=ye,q=ge,z=me,ae=ue):le+ye>K?q!==-1?(ee.push(k.substring(se,z)),se=z,ue=ae+1,q=-1,le=0):(ee.push(k.substring(se,ge)),se=ge,le=ye):le+=ye}return se<k.length&&ee.push(k.substring(se,k.length)),ee}getFieldObject(){return{id:this.data.id,value:this.data.fieldValue,defaultValue:this.data.defaultFieldValue||"",multiline:this.data.multiLine,password:this.hasFieldFlag(n.AnnotationFieldFlag.PASSWORD),charLimit:this.data.maxLen,comb:this.data.comb,editable:!this.data.readOnly,hidden:this.data.hidden,name:this.data.fieldName,rect:this.data.rect,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:"text"}}}class o extends h{constructor(k){super(k),this.checkedAppearance=null,this.uncheckedAppearance=null,this.data.checkBox=!this.hasFieldFlag(n.AnnotationFieldFlag.RADIO)&&!this.hasFieldFlag(n.AnnotationFieldFlag.PUSHBUTTON),this.data.radioButton=this.hasFieldFlag(n.AnnotationFieldFlag.RADIO)&&!this.hasFieldFlag(n.AnnotationFieldFlag.PUSHBUTTON),this.data.pushButton=this.hasFieldFlag(n.AnnotationFieldFlag.PUSHBUTTON),this.data.isTooltipOnly=!1,this.data.checkBox?this._processCheckBox(k):this.data.radioButton?this._processRadioButton(k):this.data.pushButton?(this.data.hasOwnCanvas=!0,this._processPushButton(k)):(0,n.warn)("Invalid field flags for button widget annotation")}async getOperatorList(k,O,V,K,te){if(this.data.pushButton)return super.getOperatorList(k,O,V,!1,te);let re=null,ie=null;if(te){const ee=te.get(this.data.id);re=ee?ee.value:null,ie=ee?ee.rotation:null}if(re===null&&this.appearance)return super.getOperatorList(k,O,V,K,te);re==null&&(re=this.data.checkBox?this.data.fieldValue===this.data.exportValue:this.data.fieldValue===this.data.buttonValue);const Z=re?this.checkedAppearance:this.uncheckedAppearance;if(Z){const ee=this.appearance,q=Z.dict.getArray("Matrix")||n.IDENTITY_MATRIX;ie&&Z.dict.set("Matrix",this.getRotationMatrix(te)),this.appearance=Z;const z=super.getOperatorList(k,O,V,K,te);return this.appearance=ee,Z.dict.set("Matrix",q),z}return{opList:new a.OperatorList,separateForm:!1,separateCanvas:!1}}async save(k,O,V){return this.data.checkBox?this._saveCheckbox(k,O,V):this.data.radioButton?this._saveRadioButton(k,O,V):null}async _saveCheckbox(k,O,V){if(!V)return null;const K=V.get(this.data.id);let te=K==null?void 0:K.rotation,re=K==null?void 0:K.value;if(te===void 0&&(re===void 0||this.data.fieldValue===this.data.exportValue===re))return null;const ie=k.xref.fetchIfRef(this.ref);if(!(ie instanceof e.Dict))return null;te===void 0&&(te=this.rotation),re===void 0&&(re=this.data.fieldValue===this.data.exportValue);const Z={path:this.data.fieldName,value:re?this.data.exportValue:""},ee=e.Name.get(re?this.data.exportValue:"Off");ie.set("V",ee),ie.set("AS",ee),ie.set("M",`D:${(0,n.getModificationDate)()}`);const q=this._getMKDict(te);q&&ie.set("MK",q);const z=[];return await(0,N.writeObject)(this.ref,ie,z,k.xref),[{ref:this.ref,data:z.join(""),xfa:Z}]}async _saveRadioButton(k,O,V){if(!V)return null;const K=V.get(this.data.id);let te=K==null?void 0:K.rotation,re=K==null?void 0:K.value;if(te===void 0&&(re===void 0||this.data.fieldValue===this.data.buttonValue===re))return null;const ie=k.xref.fetchIfRef(this.ref);if(!(ie instanceof e.Dict))return null;re===void 0&&(re=this.data.fieldValue===this.data.buttonValue),te===void 0&&(te=this.rotation);const Z={path:this.data.fieldName,value:re?this.data.buttonValue:""},ee=e.Name.get(re?this.data.buttonValue:"Off"),q=[];let z=null;if(re)if(this.parent instanceof e.Ref){const le=k.xref.fe
`)}}class b extends h{constructor(k){super(k),this.data.fieldValue=null,this.data.hasOwnCanvas=this.data.noRotate}getFieldObject(){return{id:this.data.id,value:null,page:this.data.pageIndex,type:"signature"}}}class R extends c{constructor(k){super(k),this.data.noRotate=!0,this.data.hasOwnCanvas=this.data.noRotate;const{dict:V}=k;this.data.annotationType=n.AnnotationType.TEXT,this.data.hasAppearance?this.data.name="NoIcon":(this.data.rect[1]=this.data.rect[3]-22,this.data.rect[2]=this.data.rect[0]+22,this.data.name=V.has("Name")?V.get("Name").name:"Note"),V.has("State")?(this.data.state=V.get("State")||null,this.data.stateModel=V.get("StateModel")||null):(this.data.state=null,this.data.stateModel=null)}}class S extends M{constructor(k){var te;super(k);const{dict:O,annotationGlobals:V}=k;this.data.annotationType=n.AnnotationType.LINK;const K=W(O,this.rectangle);K&&(this.data.quadPoints=K),(te=this.data).borderColor||(te.borderColor=this.data.color),U.Catalog.parseDestDictionary({destDict:O,resultObj:this.data,docBaseUrl:V.baseUrl,docAttachments:V.attachments})}}class p extends M{constructor(k){super(k);const{dict:O}=k;this.data.annotationType=n.AnnotationType.POPUP,(this.data.rect[0]===this.data.rect[2]||this.data.rect[1]===this.data.rect[3])&&(this.data.rect=null);let V=O.get("Parent");if(!V){(0,n.warn)("Popup annotation has a missing or invalid parent annotation.");return}const K=V.getArray("Rect");this.data.parentRect=Array.isArray(K)&&K.length===4?n.Util.normalizeRect(K):null;const te=V.get("RT");if((0,e.isName)(te,n.AnnotationReplyType.GROUP)&&(V=V.get("IRT")),V.has("M")?(this.setModificationDate(V.get("M")),this.data.modificationDate=this.modificationDate):this.data.modificationDate=null,V.has("C")?(this.setColor(V.getArray("C")),this.data.color=this.color):this.data.color=null,!this.viewable){const re=V.get("F");this._isViewable(re)&&this.setFlags(re)}this.setTitle(V.get("T")),this.data.titleObj=this._title,this.setContents(V.get("Contents")),this.data.contentsObj=this._contents,V.has("RC")&&(this.data.richText=v.XFAFactory.getRichTextAsHtml(V.get("RC"))),this.data.open=!!O.get("Open")}}d.PopupAnnotation=p;class G extends c{constructor(k){var K;super(k),this.data.hasOwnCanvas=!0;const{evaluatorOptions:O,xref:V}=k;if(this.data.annotationType=n.AnnotationType.FREETEXT,this.setDefaultAppearance(k),this.appearance){const{fontColor:te,fontSize:re}=(0,g.parseAppearanceStream)(this.appearance,O,V);this.data.defaultAppearanceData.fontColor=te,this.data.defaultAppearanceData.fontSize=re||10}else if(this._isOffscreenCanvasSupported){const te=k.dict.get("CA"),re=new g.FakeUnicodeFont(V,"sans-serif");(K=this.data.defaultAppearanceData).fontSize||(K.fontSize=10);const{fontColor:ie,fontSize:Z}=this.data.defaultAppearanceData;this.appearance=re.createAppearance(this._contents.str,this.rectangle,this.rotation,Z,ie,te),this._streams.push(this.appearance,g.FakeUnicodeFont.toUnicodeStream)}else(0,n.warn)("FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly.")}get hasTextContent(){return!!this.appearance}static createNewDict(k,O,V){let{apRef:K,ap:te}=V;const{color:re,fontSize:ie,rect:Z,rotation:ee,user:q,value:z}=k,ae=new e.Dict(O);ae.set("Type",e.Name.get("Annot")),ae.set("Subtype",e.Name.get("FreeText")),ae.set("CreationDate",`D:${(0,n.getModificationDate)()}`),ae.set("Rect",Z);const se=`/Helv ${ie} Tf ${(0,g.getPdfColor)(re,!0)}`;if(ae.set("DA",se),ae.set("Contents",(0,u.isAscii)(z)?z:(0,u.stringToUTF16String)(z,!0)),ae.set("F",4),ae.set("Border",[0,0,0]),ae.set("Rotate",ee),q&&ae.set("T",(0,u.isAscii)(q)?q:(0,u.stringToUTF16String)(q,!0)),K||te){const le=new e.Dict(O);ae.set("AP",le),K?le.set("N",K):le.set("N",te)}return ae}static async createNewAppearanceStream(k,O,V){const{baseFontRef:K,evaluator:te,task:re}=V,{color:ie,fontSize:Z,rect:ee,rotation:q,value:z}=k,ae=new e.Dict(O),se=new e.Dict(O);if(K)se.set("Helv",K);else{const rt=new e.Dict(O);rt.set("BaseFont",e.Name.get("Helvetica")),rt.set("Type",e.Name.get("Font")),rt.set("Subtype",e.Name.get("Type1")),rt.set("Encoding",e.Name.get("WinAns
`),Ae=Z/1e3;let Fe=-1/0;const xe=[];for(let rt of Se){const At=le.encodeString(rt);if(At.length>1)return null;rt=At.join(""),xe.push(rt);let Ot=0;const Ve=le.charsToGlyphs(rt);for(const Ge of Ve)Ot+=Ge.width*Ae;Fe=Math.max(Fe,Ot)}let de=1;Fe>be&&(de=be/Fe);let pe=1;const Ce=n.LINE_FACTOR*Z,we=(n.LINE_FACTOR-n.LINE_DESCENT_FACTOR)*Z,$e=Ce*Se.length;$e>ye&&(pe=ye/$e);const ze=Math.min(de,pe),Ee=Z*ze;let tt,nt,We;switch(q){case 0:We=[1,0,0,1],nt=[ee[0],ee[1],be,ye],tt=[ee[0],ee[3]-we];break;case 90:We=[0,1,-1,0],nt=[ee[1],-ee[2],be,ye],tt=[ee[1],-ee[0]-we];break;case 180:We=[-1,0,0,-1],nt=[-ee[2],-ee[3],be,ye],tt=[-ee[2],-ee[1]-we];break;case 270:We=[0,-1,1,0],nt=[-ee[3],ee[0],be,ye],tt=[-ee[3],ee[2]-we];break}const Le=["q",`${We.join(" ")} 0 0 cm`,`${nt.join(" ")} re W n`,"BT",`${(0,g.getPdfColor)(ie,!0)}`,`0 Tc /Helv ${(0,u.numberToString)(Ee)} Tf`];Le.push(`${tt.join(" ")} Td (${(0,u.escapeString)(xe[0])}) Tj`);const Qe=(0,u.numberToString)(Ce);for(let rt=1,At=xe.length;rt<At;rt++){const Ot=xe[rt];Le.push(`0 -${Qe} Td (${(0,u.escapeString)(Ot)}) Tj`)}Le.push("ET","Q");const gt=Le.join(`
`),De=new e.Dict(O);De.set("FormType",1),De.set("Subtype",e.Name.get("Form")),De.set("Type",e.Name.get("XObject")),De.set("BBox",ee),De.set("Resources",ae),De.set("Matrix",[1,0,0,1,-ee[0],-ee[1]]);const St=new t.StringStream(gt);return St.dict=De,St}}class $ extends c{constructor(k){super(k);const{dict:O,xref:V}=k;this.data.annotationType=n.AnnotationType.LINE,this.data.hasOwnCanvas=this.data.noRotate;const K=O.getArray("L");if(this.data.lineCoordinates=n.Util.normalizeRect(K),this.setLineEndings(O.getArray("LE")),this.data.lineEndings=this.lineEndings,!this.appearance){const te=this.color?B(this.color):[0,0,0],re=O.get("CA"),ie=F(O.getArray("IC"),null),Z=ie?B(ie):null,ee=Z?re:null,q=this.borderStyle.width||1,z=2*q,ae=[this.data.lineCoordinates[0]-z,this.data.lineCoordinates[1]-z,this.data.lineCoordinates[2]+z,this.data.lineCoordinates[3]+z];n.Util.intersect(this.rectangle,ae)||(this.rectangle=ae),this._setDefaultAppearance({xref:V,extra:`${q} w`,strokeColor:te,fillColor:Z,strokeAlpha:re,fillAlpha:ee,pointsCallback:(se,le)=>(se.push(`${K[0]} ${K[1]} m`,`${K[2]} ${K[3]} l`,"S"),[le[0].x-q,le[1].x+q,le[3].y-q,le[1].y+q])})}}}class A extends c{constructor(k){super(k);const{dict:O,xref:V}=k;if(this.data.annotationType=n.AnnotationType.SQUARE,this.data.hasOwnCanvas=this.data.noRotate,!this.appearance){const K=this.color?B(this.color):[0,0,0],te=O.get("CA"),re=F(O.getArray("IC"),null),ie=re?B(re):null,Z=ie?te:null;if(this.borderStyle.width===0&&!ie)return;this._setDefaultAppearance({xref:V,extra:`${this.borderStyle.width} w`,strokeColor:K,fillColor:ie,strokeAlpha:te,fillAlpha:Z,pointsCallback:(ee,q)=>{const z=q[2].x+this.borderStyle.width/2,ae=q[2].y+this.borderStyle.width/2,se=q[3].x-q[2].x-this.borderStyle.width,le=q[1].y-q[3].y-this.borderStyle.width;return ee.push(`${z} ${ae} ${se} ${le} re`),ie?ee.push("B"):ee.push("S"),[q[0].x,q[1].x,q[3].y,q[1].y]}})}}}class D extends c{constructor(k){super(k);const{dict:O,xref:V}=k;if(this.data.annotationType=n.AnnotationType.CIRCLE,!this.appearance){const K=this.color?B(this.color):[0,0,0],te=O.get("CA"),re=F(O.getArray("IC"),null),ie=re?B(re):null,Z=ie?te:null;if(this.borderStyle.width===0&&!ie)return;const ee=4/3*Math.tan(Math.PI/(2*4));this._setDefaultAppearance({xref:V,extra:`${this.borderStyle.width} w`,strokeColor:K,fillColor:ie,strokeAlpha:te,fillAlpha:Z,pointsCallback:(q,z)=>{const ae=z[0].x+this.borderStyle.width/2,se=z[0].y-this.borderStyle.width/2,le=z[3].x-this.borderStyle.width/2,ue=z[3].y+this.borderStyle.width/2,fe=ae+(le-ae)/2,ge=se+(ue-se)/2,me=(le-ae)/2*ee,be=(ue-se)/2*ee;return q.push(`${fe} ${ue} m`,`${fe+me} ${ue} ${le} ${ge+be} ${le} ${ge} c`,`${le} ${ge-be} ${fe+me} ${se} ${fe} ${se} c`,`${fe-me} ${se} ${ae} ${ge-be} ${ae} ${ge} c`,`${ae} ${ge+be} ${fe-me} ${ue} ${fe} ${ue} c`,"h"),ie?q.push("B"):q.push("S"),[z[0].x,z[1].x,z[3].y,z[1].y]}})}}}class w extends c{constructor(k){super(k);const{dict:O,xref:V}=k;this.data.annotationType=n.AnnotationType.POLYLINE,this.data.hasOwnCanvas=this.data.noRotate,this.data.vertices=[],this instanceof m||(this.setLineEndings(O.getArray("LE")),this.data.lineEndings=this.lineEndings);const K=O.getArray("Vertices");if(Array.isArray(K)){for(let te=0,re=K.length;te<re;te+=2)this.data.vertices.push({x:K[te],y:K[te+1]});if(!this.appearance){const te=this.color?B(this.color):[0,0,0],re=O.get("CA"),ie=this.borderStyle.width||1,Z=2*ie,ee=[1/0,1/0,-1/0,-1/0];for(const q of this.data.vertices)ee[0]=Math.min(ee[0],q.x-Z),ee[1]=Math.min(ee[1],q.y-Z),ee[2]=Math.max(ee[2],q.x+Z),ee[3]=Math.max(ee[3],q.y+Z);n.Util.intersect(this.rectangle,ee)||(this.rectangle=ee),this._setDefaultAppearance({xref:V,extra:`${ie} w`,strokeColor:te,strokeAlpha:re,pointsCallback:(q,z)=>{const ae=this.data.vertices;for(let se=0,le=ae.length;se<le;se++)q.push(`${ae[se].x} ${ae[se].y} ${se===0?"m":"l"}`);return q.push("S"),[z[0].x,z[1].x,z[3].y,z[1].y]}})}}}}class m extends w{constructor(k){super(k),this.data.annotationType=n.AnnotationType.POLYGON}}class I extends c{constructor(k){super(k),this.data.annotationType=n.AnnotationType.CARET}}class H extends c{constructor(
`))}const z=ee.join(`
`),ae=new e.Dict(O);if(ae.set("FormType",1),ae.set("Subtype",e.Name.get("Form")),ae.set("Type",e.Name.get("XObject")),ae.set("BBox",te),ae.set("Length",z.length),Z!==1){const le=new e.Dict(O),ue=new e.Dict(O),fe=new e.Dict(O);fe.set("CA",Z),fe.set("Type",e.Name.get("ExtGState")),ue.set("R0",fe),le.set("ExtGState",ue),ae.set("Resources",le)}const se=new t.StringStream(z);return se.dict=ae,se}}class Y extends c{constructor(k){var te;super(k);const{dict:O,xref:V}=k;if(this.data.annotationType=n.AnnotationType.HIGHLIGHT,this.data.quadPoints=W(O,null)){const re=(te=this.appearance)==null?void 0:te.dict.get("Resources");if(!this.appearance||!(re!=null&&re.has("ExtGState"))){this.appearance&&(0,n.warn)("HighlightAnnotation - ignoring built-in appearance stream.");const ie=this.color?B(this.color):[1,1,0],Z=O.get("CA");this._setDefaultAppearance({xref:V,fillColor:ie,blendMode:"Multiply",fillAlpha:Z,pointsCallback:(ee,q)=>(ee.push(`${q[0].x} ${q[0].y} m`,`${q[1].x} ${q[1].y} l`,`${q[3].x} ${q[3].y} l`,`${q[2].x} ${q[2].y} l`,"f"),[q[0].x,q[1].x,q[3].y,q[1].y])})}}else this.data.popupRef=null}}class Q extends c{constructor(k){super(k);const{dict:O,xref:V}=k;if(this.data.annotationType=n.AnnotationType.UNDERLINE,this.data.quadPoints=W(O,null)){if(!this.appearance){const te=this.color?B(this.color):[0,0,0],re=O.get("CA");this._setDefaultAppearance({xref:V,extra:"[] 0 d 0.571 w",strokeColor:te,strokeAlpha:re,pointsCallback:(ie,Z)=>(ie.push(`${Z[2].x} ${Z[2].y+1.3} m`,`${Z[3].x} ${Z[3].y+1.3} l`,"S"),[Z[0].x,Z[1].x,Z[3].y,Z[1].y])})}}else this.data.popupRef=null}}class oe extends c{constructor(k){super(k);const{dict:O,xref:V}=k;if(this.data.annotationType=n.AnnotationType.SQUIGGLY,this.data.quadPoints=W(O,null)){if(!this.appearance){const te=this.color?B(this.color):[0,0,0],re=O.get("CA");this._setDefaultAppearance({xref:V,extra:"[] 0 d 1 w",strokeColor:te,strokeAlpha:re,pointsCallback:(ie,Z)=>{const ee=(Z[0].y-Z[2].y)/6;let q=ee,z=Z[2].x;const ae=Z[2].y,se=Z[3].x;ie.push(`${z} ${ae+q} m`);do z+=2,q=q===0?ee:0,ie.push(`${z} ${ae+q} l`);while(z<se);return ie.push("S"),[Z[2].x,se,ae-2*ee,ae+2*ee]}})}}else this.data.popupRef=null}}class ne extends c{constructor(k){super(k);const{dict:O,xref:V}=k;if(this.data.annotationType=n.AnnotationType.STRIKEOUT,this.data.quadPoints=W(O,null)){if(!this.appearance){const te=this.color?B(this.color):[0,0,0],re=O.get("CA");this._setDefaultAppearance({xref:V,extra:"[] 0 d 1 w",strokeColor:te,strokeAlpha:re,pointsCallback:(ie,Z)=>(ie.push(`${(Z[0].x+Z[2].x)/2} ${(Z[0].y+Z[2].y)/2} m`,`${(Z[1].x+Z[3].x)/2} ${(Z[1].y+Z[3].y)/2} l`,"S"),[Z[0].x,Z[1].x,Z[3].y,Z[1].y])})}}else this.data.popupRef=null}}class ce extends c{constructor(k){super(k),this.data.annotationType=n.AnnotationType.STAMP,this.data.hasOwnCanvas=this.data.noRotate}static async createImage(k,O){const{width:V,height:K}=k,te=new OffscreenCanvas(V,K),re=te.getContext("2d",{alpha:!0});re.drawImage(k,0,0);const ie=re.getImageData(0,0,V,K).data,Z=new Uint32Array(ie.buffer),ee=Z.some(n.FeatureTest.isLittleEndian?fe=>fe>>>24!==255:fe=>(fe&255)!==255);ee&&(re.fillStyle="white",re.fillRect(0,0,V,K),re.drawImage(k,0,0));const q=te.convertToBlob({type:"image/jpeg",quality:1}).then(fe=>fe.arrayBuffer()),z=e.Name.get("XObject"),ae=e.Name.get("Image"),se=new e.Dict(O);se.set("Type",z),se.set("Subtype",ae),se.set("BitsPerComponent",8),se.set("ColorSpace",e.Name.get("DeviceRGB")),se.set("Filter",e.Name.get("DCTDecode")),se.set("BBox",[0,0,V,K]),se.set("Width",V),se.set("Height",K);let le=null;if(ee){const fe=new Uint8Array(Z.length);if(n.FeatureTest.isLittleEndian)for(let me=0,be=Z.length;me<be;me++)fe[me]=Z[me]>>>24;else for(let me=0,be=Z.length;me<be;me++)fe[me]=Z[me]&255;const ge=new e.Dict(O);ge.set("Type",z),ge.set("Subtype",ae),ge.set("BitsPerComponent",8),ge.set("ColorSpace",e.Name.get("DeviceGray")),ge.set("Width",V),ge.set("Height",K),le=new t.Stream(fe,0,0,ge)}return{imageStream:new t.Stream(await q,0,0,se),smaskStream:le,width:V,height:K}}static createNewDict(k,O,V){let{apRef:K,ap:te}=V;const{rect:re,rotation:ie,user:Z}=k,ee=new e.Dict(O);if(ee.set
12 dict begin
begincmap
/CIDSystemInfo
<< /Registry (Adobe)
/Ordering (UCS) /Supplement 0 >> def
/CMapName /Adobe-Identity-UCS def
/CMapType 2 def
1 begincodespacerange
<0000> <FFFF>
endcodespacerange
1 beginbfrange
<0000> <FFFF> <0000>
endbfrange
endcmap CMapName currentdict /CMap defineresource pop end end`,B=v.toUnicodeStream=new U.StringStream(F),W=new n.Dict(this.xref);B.dict=W,W.set("Length",F.length),v._toUnicodeRef=this.xref.getNewPersistentRef(B)}return v._toUnicodeRef}get fontDescriptorRef(){if(!v._fontDescriptorRef){const F=new n.Dict(this.xref);F.set("Type",n.Name.get("FontDescriptor")),F.set("FontName",this.fontName),F.set("FontFamily","MyriadPro Regular"),F.set("FontBBox",[0,0,0,0]),F.set("FontStretch",n.Name.get("Normal")),F.set("FontWeight",400),F.set("ItalicAngle",0),v._fontDescriptorRef=this.xref.getNewPersistentRef(F)}return v._fontDescriptorRef}get descendantFontRef(){const F=new n.Dict(this.xref);F.set("BaseFont",this.fontName),F.set("Type",n.Name.get("Font")),F.set("Subtype",n.Name.get("CIDFontType0")),F.set("CIDToGIDMap",n.Name.get("Identity")),F.set("FirstChar",this.firstChar),F.set("LastChar",this.lastChar),F.set("FontDescriptor",this.fontDescriptorRef),F.set("DW",1e3);const B=[],W=[...this.widths.entries()].sort();let j=null,M=null;for(const[c,h]of W){if(!j){j=c,M=[h];continue}c===j+M.length?M.push(h):(B.push(j,M),j=c,M=[h])}j&&B.push(j,M),F.set("W",B);const T=new n.Dict(this.xref);return T.set("Ordering","Identity"),T.set("Registry","Adobe"),T.set("Supplement",0),F.set("CIDSystemInfo",T),this.xref.getNewPersistentRef(F)}get baseFontRef(){const F=new n.Dict(this.xref);return F.set("BaseFont",this.fontName),F.set("Type",n.Name.get("Font")),F.set("Subtype",n.Name.get("Type0")),F.set("Encoding",n.Name.get("Identity-H")),F.set("DescendantFonts",[this.descendantFontRef]),F.set("ToUnicode",this.toUnicodeRef),this.xref.getNewPersistentRef(F)}get resources(){const F=new n.Dict(this.xref),B=new n.Dict(this.xref);return B.set(this.fontName.name,this.baseFontRef),F.set("Font",B),F}_createContext(){return this.widths=new Map,this.ctxMeasure.font=`1000px ${this.fontFamily}`,this.ctxMeasure}createFontResources(F){const B=this._createContext();for(const W of F.split(/\r\n?|\n/))for(const j of W.split("")){const M=j.charCodeAt(0);if(this.widths.has(M))continue;const T=B.measureText(j),c=Math.ceil(T.width);this.widths.set(M,c),this.firstChar=Math.min(M,this.firstChar),this.lastChar=Math.max(M,this.lastChar)}return this.resources}createAppearance(F,B,W,j,M,T){const c=this._createContext(),h=[];let E=-1/0;for(const J of F.split(/\r\n?|\n/)){h.push(J);const _=c.measureText(J).width;E=Math.max(E,_);for(const k of J.split("")){const O=k.charCodeAt(0);let V=this.widths.get(O);if(V===void 0){const K=c.measureText(k);V=Math.ceil(K.width),this.widths.set(O,V),this.firstChar=Math.min(O,this.firstChar),this.lastChar=Math.max(O,this.lastChar)}}}E*=j/1e3;const[o,l,b,R]=B;let S=b-o,p=R-l;W%180!==0&&([S,p]=[p,S]);let G=1;E>S&&(G=S/E);let $=1;const A=g.LINE_FACTOR*j,D=g.LINE_DESCENT_FACTOR*j,w=A*h.length;w>p&&($=p/w);const m=Math.min(G,$),I=j*m,H=["q",`0 0 ${(0,u.numberToString)(S)} ${(0,u.numberToString)(p)} re W n`,"BT",`1 0 0 1 0 ${(0,u.numberToString)(p+D)} Tm 0 Tc ${a(M,!0)}`,`/${this.fontName.name} ${(0,u.numberToString)(I)} Tf`],{resources:Y}=this;if(T=typeof T=="number"&&T>=0&&T<=1?T:1,T!==1){H.push("/R0 gs");const J=new n.Dict(this.xref),_=new n.Dict(this.xref);_.set("ca",T),_.set("CA",T),_.set("Type",n.Name.get("ExtGState")),J.set("R0",_),Y.set("ExtGState",J)}const Q=(0,u.numberToString)(A);for(const J of h)H.push(`0 -${Q} Td <${(0,u.stringToUTF16HexString)(J)}> Tj`);H.push("ET","Q");const oe=H.join(`
`),ne=new n.Dict(this.xref);if(ne.set("Subtype",n.Name.get("Form")),ne.set("Type",n.Name.get("XObject")),ne.set("BBox",[0,0,S,p]),ne.set("Length",oe.length),ne.set("Resources",Y),W){const J=(0,u.getRotationMatrix)(W,S,p);ne.set("Matrix",J)}const ce=new U.StringStream(oe);return ce.dict=ne,ce}}d.FakeUnicodeFont=v},(he,d,i)=>{var P,Un,B,Xn,j,M,T,c,h,E,o,l,b,en,S,Yn,G,Jn,A,xn,w,tn,I,nn,Y,Zn,oe,Qn,ce,qn,_,Hn,V,mn,te,pn,ie,zn;Object.defineProperty(d,"__esModule",{value:!0}),d.ColorSpace=void 0,i(84),i(93),i(94),i(97),i(99),i(101),i(105),i(108),i(115),i(2);var n=i(145),u=i(151),g=i(152),e=i(150);function t(ee,q,z,ae,se,le,ue){ue=ue!==1?0:ue;const ge=z/se,me=ae/le;let be=0,ye;const Se=new Uint16Array(se),Ae=z*3;for(let Fe=0;Fe<se;Fe++)Se[Fe]=Math.floor(Fe*ge)*3;for(let Fe=0;Fe<le;Fe++){const xe=Math.floor(Fe*me)*Ae;for(let de=0;de<se;de++)ye=xe+Se[de],q[be++]=ee[ye++],q[be++]=ee[ye++],q[be++]=ee[ye++],be+=ue}}class s{constructor(q,z){this.constructor===s&&(0,n.unreachable)("Cannot initialize ColorSpace."),this.name=q,this.numComps=z}getRgb(q,z){const ae=new Uint8ClampedArray(3);return this.getRgbItem(q,z,ae,0),ae}getRgbItem(q,z,ae,se){(0,n.unreachable)("Should not call ColorSpace.getRgbItem")}getRgbBuffer(q,z,ae,se,le,ue,fe){(0,n.unreachable)("Should not call ColorSpace.getRgbBuffer")}getOutputLength(q,z){(0,n.unreachable)("Should not call ColorSpace.getOutputLength")}isPassthrough(q){return!1}isDefaultDecode(q,z){return s.isDefaultDecode(q,this.numComps)}fillRgb(q,z,ae,se,le,ue,fe,ge,me){const be=z*ae;let ye=null;const Se=1<<fe,Ae=ae!==le||z!==se;if(this.isPassthrough(fe))ye=ge;else if(this.numComps===1&&be>Se&&this.name!=="DeviceGray"&&this.name!=="DeviceRGB"){const Fe=fe<=8?new Uint8Array(Se):new Uint16Array(Se);for(let de=0;de<Se;de++)Fe[de]=de;const xe=new Uint8ClampedArray(Se*3);if(this.getRgbBuffer(Fe,0,Se,xe,0,fe,0),Ae){ye=new Uint8Array(be*3);let de=0;for(let pe=0;pe<be;++pe){const Ce=ge[pe]*3;ye[de++]=xe[Ce],ye[de++]=xe[Ce+1],ye[de++]=xe[Ce+2]}}else{let de=0;for(let pe=0;pe<be;++pe){const Ce=ge[pe]*3;q[de++]=xe[Ce],q[de++]=xe[Ce+1],q[de++]=xe[Ce+2],de+=me}}}else Ae?(ye=new Uint8ClampedArray(be*3),this.getRgbBuffer(ge,0,be,ye,0,fe,0)):this.getRgbBuffer(ge,0,se*ue,q,0,fe,me);if(ye)if(Ae)t(ye,q,z,ae,se,le,me);else{let Fe=0,xe=0;for(let de=0,pe=se*ue;de<pe;de++)q[Fe++]=ye[xe++],q[Fe++]=ye[xe++],q[Fe++]=ye[xe++],Fe+=me}}get usesZeroToOneRange(){return(0,n.shadow)(this,"usesZeroToOneRange",!0)}static _cache(q,z,ae,se){if(!ae)throw new Error('ColorSpace._cache - expected "localColorSpaceCache" argument.');if(!se)throw new Error('ColorSpace._cache - expected "parsedColorSpace" argument.');let le,ue;q instanceof u.Ref&&(ue=q,q=z.fetch(q)),q instanceof u.Name&&(le=q.name),(le||ue)&&ae.set(le,ue,se)}static getCached(q,z,ae){if(!ae)throw new Error('ColorSpace.getCached - expected "localColorSpaceCache" argument.');if(q instanceof u.Ref){const se=ae.getByRef(q);if(se)return se;try{q=z.fetch(q)}catch(le){if(le instanceof e.MissingDataException)throw le}}if(q instanceof u.Name){const se=ae.getByName(q.name);if(se)return se}return null}static async parseAsync(q){let{cs:z,xref:ae,resources:se=null,pdfFunctionFactory:le,localColorSpaceCache:ue}=q;const fe=this._parse(z,ae,se,le);return this._cache(z,ae,ue,fe),fe}static parse(q){let{cs:z,xref:ae,resources:se=null,pdfFunctionFactory:le,localColorSpaceCache:ue}=q;const fe=this.getCached(z,ae,ue);if(fe)return fe;const ge=this._parse(z,ae,se,le);return this._cache(z,ae,ue,ge),ge}static _parse(q,z){let ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,se=arguments.length>3?arguments[3]:void 0;if(q=z.fetchIfRef(q),q instanceof u.Name)switch(q.name){case"G":case"DeviceGray":return this.singletons.gray;case"RGB":case"DeviceRGB":return this.singletons.rgb;case"CMYK":case"DeviceCMYK":return this.singletons.cmyk;case"Pattern":return new U(null);default:if(ae instanceof u.Dict){const le=ae.get("ColorSpace");if(le instanceof u.Dict){const ue=le.get(q.name);if(ue){if(ue instanceof u.Name)return this._parse(ue,z,ae,se);q=ue;break}}}throw new n.FormatError(`Unrecognized ColorSpace: ${q.na
`);break;case 114:E.push("\r");break;case 116:E.push(" ");break;case 98:E.push("\b");break;case 102:E.push("\f");break;case 92:case 40:case 41:E.push(String.fromCharCode(o));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:let b=o&15;o=this.nextChar(),l=!0,o>=48&&o<=55&&(b=(b<<3)+(o&15),o=this.nextChar(),o>=48&&o<=55&&(l=!1,b=(b<<3)+(o&15))),E.push(String.fromCharCode(b));break;case 13:this.peekChar()===10&&this.nextChar();break;case 10:break;default:E.push(String.fromCharCode(o));break}break;default:E.push(String.fromCharCode(o));break}if(h)break;l||(o=this.nextChar())}return E.join("")}getName(){let c,h;const E=this.strBuf;for(E.length=0;(c=this.nextChar())>=0&&!B[c];)if(c===35){if(c=this.nextChar(),B[c]){(0,n.warn)("Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number."),E.push("#");break}const o=W(c);if(o!==-1){h=c,c=this.nextChar();const l=W(c);if(l===-1){if((0,n.warn)(`Lexer_getName: Illegal digit (${String.fromCharCode(c)}) in hexadecimal number.`),E.push("#",String.fromCharCode(h)),B[c])break;E.push(String.fromCharCode(c));continue}E.push(String.fromCharCode(o<<4|l))}else E.push("#",String.fromCharCode(c))}else E.push(String.fromCharCode(c));return E.length>127&&(0,n.warn)(`Name token is longer than allowed by the spec: ${E.length}`),u.Name.get(E.join(""))}_hexStringWarn(c){if(this._hexStringNumWarn++===5){(0,n.warn)("getHexString - ignoring additional invalid characters.");return}this._hexStringNumWarn>5||(0,n.warn)(`getHexString - ignoring invalid character: ${c}`)}getHexString(){const c=this.strBuf;c.length=0;let h=this.currentChar,E=!0,o,l;for(this._hexStringNumWarn=0;;)if(h<0){(0,n.warn)("Unterminated hex string");break}else if(h===62){this.nextChar();break}else if(B[h]===1){h=this.nextChar();continue}else{if(E){if(o=W(h),o===-1){this._hexStringWarn(h),h=this.nextChar();continue}}else{if(l=W(h),l===-1){this._hexStringWarn(h),h=this.nextChar();continue}c.push(String.fromCharCode(o<<4|l))}E=!E,h=this.nextChar()}return c.join("")}getObj(){let c=!1,h=this.currentChar;for(;;){if(h<0)return u.EOF;if(c)(h===10||h===13)&&(c=!1);else if(h===37)c=!0;else if(B[h]!==1)break;h=this.nextChar()}switch(h|0){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return this.getNumber();case 40:return this.getString();case 47:return this.getName();case 91:return this.nextChar(),u.Cmd.get("[");case 93:return this.nextChar(),u.Cmd.get("]");case 60:return h=this.nextChar(),h===60?(this.nextChar(),u.Cmd.get("<<")):this.getHexString();case 62:return h=this.nextChar(),h===62?(this.nextChar(),u.Cmd.get(">>")):u.Cmd.get(">");case 123:return this.nextChar(),u.Cmd.get("{");case 125:return this.nextChar(),u.Cmd.get("}");case 41:throw this.nextChar(),new n.FormatError(`Illegal character: ${h}`)}let E=String.fromCharCode(h);if(h<32||h>127){const b=this.peekChar();if(b>=32&&b<=127)return this.nextChar(),u.Cmd.get(E)}const o=this.knownCommands;let l=(o==null?void 0:o[E])!==void 0;for(;(h=this.nextChar())>=0&&!B[h];){const b=E+String.fromCharCode(h);if(l&&o[b]===void 0)break;if(E.length===128)throw new n.FormatError(`Command token too long: ${E.length}`);E=b,l=(o==null?void 0:o[E])!==void 0}return E==="true"?!0:E==="false"?!1:E==="null"?null:(E==="BI"&&(this.beginInlineImagePos=this.stream.pos),u.Cmd.get(E))}skipToNextLine(){let c=this.currentChar;for(;c>=0;){if(c===13){c=this.nextChar(),c===10&&this.nextChar();break}else if(c===10){this.nextChar();break}c=this.nextChar()}}}d.Lexer=j;class M{static create(c){function h($,A){let D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const w=$.get(A);if(Number.isInteger(w)&&(D?w>=0:w>0))return w;throw new Error(`The "${A}" parameter in the linearization dictionary is invalid.`)}function E($){const A=$.get("H");let D;if(Array.isArray(A)&&((D=A.length)===2||D===4)){for(let w=0;w<D;w++){const m=A[w];if(!(Number.isInteger(m)&&m>0))throw new Error(`Hint (${w}) in the linearization dictionary is invalid.`)}return A}throw new Error("Hint array in the linearization dictionary is invalid.")}const o=new F({l
`+(0,n.string32)(4+ae*8+4+tt.length),nt="",le=0,ue=z.length;le<ue;le++){we=z[le],$e=we[0],Ee=we[2];let Le=Ee[0];for(fe=1,ge=Ee.length;fe<ge;++fe)Ee[fe]!==Ee[fe-1]+1&&(ze=we[0]+fe-1,nt+=(0,n.string32)($e)+(0,n.string32)(ze)+(0,n.string32)(Le),$e=ze+1,Le=Ee[fe]);nt+=(0,n.string32)($e)+(0,n.string32)(we[1])+(0,n.string32)(Le)}We="\0\f\0\0"+(0,n.string32)(nt.length+16)+"\0\0\0\0"+(0,n.string32)(nt.length/12)}return se+"\0"+p(tt.length+4)+tt+We+nt}function k(Z,ee){ee.pos=(ee.start||0)+Z.offset;const q=ee.getUint16();ee.skip(60);const z=ee.getUint16();if(q<4&&z&768)return!1;const ae=ee.getUint16(),se=ee.getUint16();return ae>se||(ee.skip(6),ee.getUint16()===0)?!1:(Z.data[8]=Z.data[9]=0,!0)}function O(Z,ee,q){q||(q={unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0});let z=0,ae=0,se=0,le=0,ue=null,fe=0,ge=-1;if(ee){for(let de in ee)if(de|=0,(ue>de||!ue)&&(ue=de),fe<de&&(fe=de),ge=(0,e.getUnicodeRangeFor)(de,ge),ge<32)z|=1<<ge;else if(ge<64)ae|=1<<ge-32;else if(ge<96)se|=1<<ge-64;else if(ge<123)le|=1<<ge-96;else throw new n.FormatError("Unicode ranges Bits > 123 are reserved for internal usage");fe>65535&&(fe=65535)}else ue=0,fe=255;const me=Z.bbox||[0,0,0,0],be=q.unitsPerEm||1/(Z.fontMatrix||n.FONT_IDENTITY_MATRIX)[0],ye=Z.ascentScaled?1:be/W,Se=q.ascent||Math.round(ye*(Z.ascent||me[3]));let Ae=q.descent||Math.round(ye*(Z.descent||me[1]));Ae>0&&Z.descent>0&&me[1]<0&&(Ae=-Ae);const Fe=q.yMax||Se,xe=-q.yMin||-Ae;return"\0$ô\0\0\0Š»\0\0\0ŒŠ»\0\0ß\x001\0\0\0\0"+String.fromCharCode(Z.fixedPitch?9:0)+"\0\0\0\0\0\0"+(0,n.string32)(z)+(0,n.string32)(ae)+(0,n.string32)(se)+(0,n.string32)(le)+"*21*"+p(Z.italicAngle?1:0)+p(ue||Z.firstChar)+p(fe||Z.lastChar)+p(Se)+p(Ae)+"\0d"+p(Fe)+p(xe)+"\0\0\0\0\0\0\0\0"+p(Z.xHeight)+p(Z.capHeight)+p(0)+p(ue||Z.firstChar)+"\0"}function V(Z){const ee=Math.floor(Z.italicAngle*65536);return"\0\0\0"+(0,n.string32)(ee)+"\0\0\0\0"+(0,n.string32)(Z.fixedPitch?1:0)+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}function K(Z){return Z.replaceAll(/[^\x21-\x7E]|[[\](){}<>/%]/g,"").slice(0,63)}function te(Z,ee){ee||(ee=[[],[]]);const q=[ee[0][0]||"Original licence",ee[0][1]||Z,ee[0][2]||"Unknown",ee[0][3]||"uniqueID",ee[0][4]||Z,ee[0][5]||"Version 0.11",ee[0][6]||K(Z),ee[0][7]||"Unknown",ee[0][8]||"Unknown",ee[0][9]||"Unknown"],z=[];let ae,se,le,ue,fe;for(ae=0,se=q.length;ae<se;ae++){fe=ee[1][ae]||q[ae];const xe=[];for(le=0,ue=fe.length;le<ue;le++)xe.push(p(fe.charCodeAt(le)));z.push(xe.join(""))}const ge=[q,z],me=["\0","\0"],be=["\0\0","\0"],ye=["\0\0"," "],Se=q.length*me.length;let Ae="\0\0"+p(Se)+p(Se*12+6),Fe=0;for(ae=0,se=me.length;ae<se;ae++){const xe=ge[ae];for(le=0,ue=xe.length;le<ue;le++){fe=xe[le];const de=me[ae]+be[ae]+ye[ae]+p(le)+p(fe.length)+p(Fe);Ae+=de,Fe+=fe.length}}return Ae+=q.join("")+z.join(""),Ae}class re{constructor(ee,q,z){var ge;this.name=ee,this.psName=null,this.mimetype=null,this.disableFontFace=!1,this.loadedName=z.loadedName,this.isType3Font=z.isType3Font,this.missingFile=!1,this.cssFontInfo=z.cssFontInfo,this._charsCache=Object.create(null),this._glyphCache=Object.create(null);let ae=!!(z.flags&g.FontFlags.Serif);if(!ae&&!z.isSimulatedFlags){const me=ee.replaceAll(/[,_]/g,"-").split("-")[0],be=(0,L.getSerifFonts)();for(const ye of me.split("+"))if(be[ye]){ae=!0;break}}this.isSerifFont=ae,this.isSymbolicFont=!!(z.flags&g.FontFlags.Symbolic),this.isMonospace=!!(z.flags&g.FontFlags.FixedPitch);let{type:se,subtype:le}=z;this.type=se,this.subtype=le,this.systemFontInfo=z.systemFontInfo;const ue=ee.match(/^InvalidPDFjsFont_(.*)_\d+$/);if(this.isInvalidPDFjsFont=!!ue,this.isInvalidPDFjsFont?this.fallbackName=ue[1]:this.isMonospace?this.fallbackName="monospace":this.isSerifFont?this.fallbackName="serif":this.fallbackName="sans-serif",(ge=this.systemFontInfo)!=null&&ge.guessFallback&&(this.systemFontInfo.guessFallback=!1,this.systemFontInfo.css+=`,${this.fallbackName}`),this.differences=z.differences,this.widths=z.widths,this.defaultWidth=z.defaultWidth,this.composite=z.composite,this.cMap=z.cMap,this.capHeight=z.capHeight/W,this.ascent=z.ascent/W,this.descent=z.descent/W,this.lineHei
`)}}d.PostScriptCompiler=h},(he,d,i)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.PostScriptParser=d.PostScriptLexer=void 0,i(140);var n=i(145),u=i(151),g=i(150);class e{constructor(C){this.lexer=C,this.operators=[],this.token=null,this.prev=null}nextToken(){this.prev=this.token,this.token=this.lexer.getToken()}accept(C){return this.token.type===C?(this.nextToken(),!0):!1}expect(C){if(this.accept(C))return!0;throw new n.FormatError(`Unexpected symbol: found ${this.token.type} expected ${C}.`)}parse(){return this.nextToken(),this.expect(t.LBRACE),this.parseBlock(),this.expect(t.RBRACE),this.operators}parseBlock(){for(;;)if(this.accept(t.NUMBER))this.operators.push(this.prev.value);else if(this.accept(t.OPERATOR))this.operators.push(this.prev.value);else if(this.accept(t.LBRACE))this.parseCondition();else return}parseCondition(){const C=this.operators.length;if(this.operators.push(null,null),this.parseBlock(),this.expect(t.RBRACE),this.accept(t.IF))this.operators[C]=this.operators.length,this.operators[C+1]="jz";else if(this.accept(t.LBRACE)){const y=this.operators.length;this.operators.push(null,null);const f=this.operators.length;this.parseBlock(),this.expect(t.RBRACE),this.expect(t.IFELSE),this.operators[y]=this.operators.length,this.operators[y+1]="j",this.operators[C]=f,this.operators[C+1]="jz"}else throw new n.FormatError("PS Function: error parsing conditional.")}}d.PostScriptParser=e;const t={LBRACE:0,RBRACE:1,NUMBER:2,OPERATOR:3,IF:4,IFELSE:5};class s{static get opCache(){return(0,n.shadow)(this,"opCache",Object.create(null))}constructor(C,y){this.type=C,this.value=y}static getOperator(C){var y;return(y=s.opCache)[C]||(y[C]=new s(t.OPERATOR,C))}static get LBRACE(){return(0,n.shadow)(this,"LBRACE",new s(t.LBRACE,"{"))}static get RBRACE(){return(0,n.shadow)(this,"RBRACE",new s(t.RBRACE,"}"))}static get IF(){return(0,n.shadow)(this,"IF",new s(t.IF,"IF"))}static get IFELSE(){return(0,n.shadow)(this,"IFELSE",new s(t.IFELSE,"IFELSE"))}}class L{constructor(C){this.stream=C,this.nextChar(),this.strBuf=[]}nextChar(){return this.currentChar=this.stream.getByte()}getToken(){let C=!1,y=this.currentChar;for(;;){if(y<0)return u.EOF;if(C)(y===10||y===13)&&(C=!1);else if(y===37)C=!0;else if(!(0,g.isWhiteSpace)(y))break;y=this.nextChar()}switch(y|0){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return new s(t.NUMBER,this.getNumber());case 123:return this.nextChar(),s.LBRACE;case 125:return this.nextChar(),s.RBRACE}const f=this.strBuf;for(f.length=0,f[0]=String.fromCharCode(y);(y=this.nextChar())>=0&&(y>=65&&y<=90||y>=97&&y<=122);)f.push(String.fromCharCode(y));const x=f.join("");switch(x.toLowerCase()){case"if":return s.IF;case"ifelse":return s.IFELSE;default:return s.getOperator(x)}}getNumber(){let C=this.currentChar;const y=this.strBuf;for(y.length=0,y[0]=String.fromCharCode(C);(C=this.nextChar())>=0&&(C>=48&&C<=57||C===45||C===46);)y.push(String.fromCharCode(C));const f=parseFloat(y.join(""));if(isNaN(f))throw new n.FormatError(`Invalid floating point number: ${f}`);return f}}d.PostScriptLexer=L},(he,d,i)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.RegionalImageCache=d.LocalTilingPatternCache=d.LocalImageCache=d.LocalGStateCache=d.LocalFunctionCache=d.LocalColorSpaceCache=d.GlobalImageCache=void 0,i(2),i(116),i(127),i(129),i(132),i(134),i(136),i(138);var n=i(145),u=i(151);class g{constructor(a){this.constructor===g&&(0,n.unreachable)("Cannot initialize BaseLocalCache."),this._onlyRefs=(a==null?void 0:a.onlyRefs)===!0,this._onlyRefs||(this._nameRefMap=new Map,this._imageMap=new Map),this._imageCache=new u.RefSetCache}getByName(a){this._onlyRefs&&(0,n.unreachable)("Should not call `getByName` method.");const N=this._nameRefMap.get(a);return N?this.getByRef(N):this._imageMap.get(a)||null}getByRef(a){return this._imageCache.get(a)||null}set(a,N,v){(0,n.unreachable)("Abstract method `set` called.")}}class e extends g{set(a){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,v=arguments.length>2?arguments[2]:void 0;if(typeof a!="string")throw n
`||y==="\r"||y===" "}function e(U){for(let C=0,y=U.length;C<y;C++)if(!g(U,C))return!1;return!0}class t{_resolveEntities(C){return C.replaceAll(/&([^;]+);/g,(y,f)=>{if(f.substring(0,2)==="#x")return String.fromCodePoint(parseInt(f.substring(2),16));if(f.substring(0,1)==="#")return String.fromCodePoint(parseInt(f.substring(1),10));switch(f){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return'"';case"apos":return"'"}return this.onResolveEntity(f)})}_parseContent(C,y){const f=[];let x=y;function a(){for(;x<C.length&&g(C,x);)++x}for(;x<C.length&&!g(C,x)&&C[x]!==">"&&C[x]!=="/";)++x;const N=C.substring(y,x);for(a();x<C.length&&C[x]!==">"&&C[x]!=="/"&&C[x]!=="?";){a();let v="",P="";for(;x<C.length&&!g(C,x)&&C[x]!=="=";)v+=C[x],++x;if(a(),C[x]!=="=")return null;++x,a();const F=C[x];if(F!=='"'&&F!=="'")return null;const B=C.indexOf(F,++x);if(B<0)return null;P=C.substring(x,B),f.push({name:v,value:this._resolveEntities(P)}),x=B+1,a()}return{name:N,attributes:f,parsed:x-y}}_parseProcessingInstruction(C,y){let f=y;function x(){for(;f<C.length&&g(C,f);)++f}for(;f<C.length&&!g(C,f)&&C[f]!==">"&&C[f]!=="?"&&C[f]!=="/";)++f;const a=C.substring(y,f);x();const N=f;for(;f<C.length&&(C[f]!=="?"||C[f+1]!==">");)++f;const v=C.substring(N,f);return{name:a,value:v,parsed:f-y}}parseXml(C){let y=0;for(;y<C.length;){const f=C[y];let x=y;if(f==="<"){++x;const a=C[x];let N;switch(a){case"/":if(++x,N=C.indexOf(">",x),N<0){this.onError(u.UnterminatedElement);return}this.onEndElement(C.substring(x,N)),x=N+1;break;case"?":++x;const v=this._parseProcessingInstruction(C,x);if(C.substring(x+v.parsed,x+v.parsed+2)!=="?>"){this.onError(u.UnterminatedXmlDeclaration);return}this.onPi(v.name,v.value),x+=v.parsed+2;break;case"!":if(C.substring(x+1,x+3)==="--"){if(N=C.indexOf("-->",x+3),N<0){this.onError(u.UnterminatedComment);return}this.onComment(C.substring(x+3,N)),x=N+3}else if(C.substring(x+1,x+8)==="[CDATA["){if(N=C.indexOf("]]>",x+8),N<0){this.onError(u.UnterminatedCdat);return}this.onCdata(C.substring(x+8,N)),x=N+3}else if(C.substring(x+1,x+8)==="DOCTYPE"){const B=C.indexOf("[",x+8);let W=!1;if(N=C.indexOf(">",x+8),N<0){this.onError(u.UnterminatedDoctypeDeclaration);return}if(B>0&&N>B){if(N=C.indexOf("]>",x+8),N<0){this.onError(u.UnterminatedDoctypeDeclaration);return}W=!0}const j=C.substring(x+8,N+(W?1:0));this.onDoctype(j),x=N+(W?2:1)}else{this.onError(u.MalformedElement);return}break;default:const P=this._parseContent(C,x);if(P===null){this.onError(u.MalformedElement);return}let F=!1;if(C.substring(x+P.parsed,x+P.parsed+2)==="/>")F=!0;else if(C.substring(x+P.parsed,x+P.parsed+1)!==">"){this.onError(u.UnterminatedElement);return}this.onBeginElement(P.name,P.attributes,F),x+=P.parsed+(F?2:1);break}}else{for(;x<C.length&&C[x]!=="<";)x++;const a=C.substring(y,x);this.onText(this._resolveEntities(a))}y=x}}onResolveEntity(C){return`&${C};`}onPi(C,y){}onComment(C){}onCdata(C){}onDoctype(C){}onText(C){}onBeginElement(C,y,f){}onEndElement(C){}onError(C){}}d.XMLParserBase=t;class s{constructor(C,y){this.nodeName=C,this.nodeValue=y,Object.defineProperty(this,"parentNode",{value:null,writable:!0})}get firstChild(){var C;return(C=this.childNodes)==null?void 0:C[0]}get nextSibling(){const C=this.parentNode.childNodes;if(!C)return;const y=C.indexOf(this);if(y!==-1)return C[y+1]}get textContent(){return this.childNodes?this.childNodes.map(function(C){return C.textContent}).join(""):this.nodeValue||""}get children(){return this.childNodes||[]}hasChildNodes(){var C;return((C=this.childNodes)==null?void 0:C.length)>0}searchNode(C,y){var N;if(y>=C.length)return this;const f=C[y];if(f.name.startsWith("#")&&y<C.length-1)return this.searchNode(C,y+1);const x=[];let a=this;for(;;){if(f.name===a.nodeName)if(f.pos===0){const v=a.searchNode(C,y+1);if(v!==null)return v}else{if(x.length===0)return null;{const[v]=x.pop();let P=0;for(const F of v.childNodes)if(f.name===F.nodeName){if(P===f.pos)return F.searchNode(C,y+1);P++}return a.searchNode(C,y+1)}}if(((N=a.childNodes)==null?void 0:N.length)>0)x.push([a,0]),a=a.childNodes[0];else{if(x.length===0)return nu
`),j instanceof u.Dict?await U(j,M,h):j instanceof t.BaseStream?await C(j,M,h):Array.isArray(j)&&await y(j,M,h),M.push(`
endobj
`)}async function U(W,j,M){j.push("<<");for(const T of W.getKeys())j.push(` /${(0,g.escapePDFName)(T)} `),await f(W.getRaw(T),j,M);j.push(">>")}async function C(W,j,M){let T=W.getString();const{dict:c}=W,[h,E]=await Promise.all([c.getAsync("Filter"),c.getAsync("DecodeParms")]),o=Array.isArray(h)?await c.xref.fetchIfRefAsync(h[0]):h,l=(0,u.isName)(o,"FlateDecode"),b=256;if(typeof CompressionStream<"u"&&(T.length>=b||l))try{const R=(0,n.stringToBytes)(T),S=new CompressionStream("deflate"),p=S.writable.getWriter();p.write(R),p.close();const G=await new Response(S.readable).arrayBuffer();T=(0,n.bytesToString)(new Uint8Array(G));let $,A;h?l||($=Array.isArray(h)?[u.Name.get("FlateDecode"),...h]:[u.Name.get("FlateDecode"),h],E&&(A=Array.isArray(E)?[null,...E]:[null,E])):$=u.Name.get("FlateDecode"),$&&c.set("Filter",$),A&&c.set("DecodeParms",A)}catch(R){(0,n.info)(`writeStream - cannot compress data: "${R}".`)}M&&(T=M.encryptString(T)),c.set("Length",T.length),await U(c,j,M),j.push(` stream
`,T,`
endstream`)}async function y(W,j,M){j.push("[");let T=!0;for(const c of W)T?T=!1:j.push(" "),await f(c,j,M);j.push("]")}async function f(W,j,M){W instanceof u.Name?j.push(`/${(0,g.escapePDFName)(W.name)}`):W instanceof u.Ref?j.push(`${W.num} ${W.gen} R`):Array.isArray(W)?await y(W,j,M):typeof W=="string"?(M&&(W=M.encryptString(W)),j.push(`(${(0,g.escapeString)(W)})`)):typeof W=="number"?j.push((0,g.numberToString)(W)):typeof W=="boolean"?j.push(W.toString()):W instanceof u.Dict?await U(W,j,M):W instanceof t.BaseStream?await C(W,j,M):W===null?j.push("null"):(0,n.warn)(`Unhandled value in writer: ${typeof W}, please file a bug.`)}function x(W,j,M,T){for(let c=j+M-1;c>M-1;c--)T[c]=W&255,W>>=8;return M+j}function a(W,j,M){for(let T=0,c=W.length;T<c;T++)M[j+T]=W.charCodeAt(T)&255}function N(W,j){const M=Math.floor(Date.now()/1e3),T=j.filename||"",c=[M.toString(),T,W.toString()];let h=c.reduce((l,b)=>l+b.length,0);for(const l of Object.values(j.info))c.push(l),h+=l.length;const E=new Uint8Array(h);let o=0;for(const l of c)a(l,o,E),o+=l.length;return(0,n.bytesToString)((0,s.calculateMD5)(E))}function v(W,j){const M=new e.SimpleXMLParser({hasAttributes:!0}).parseFromString(W);for(const{xfa:c}of j){if(!c)continue;const{path:h,value:E}=c;if(!h)continue;const o=(0,g.parseXFAPath)(h);let l=M.documentElement.searchNode(o,0);!l&&o.length>1&&(l=M.documentElement.searchNode([o.at(-1)],0)),l?l.childNodes=Array.isArray(E)?E.map(b=>new e.SimpleDOMNode("value",b)):[new e.SimpleDOMNode("#text",E)]:(0,n.warn)(`Node not found for path: ${h}`)}const T=[];return M.documentElement.dump(T),T.join("")}async function P(W){let{xref:j,acroForm:M,acroFormRef:T,hasXfa:c,hasXfaDatasetsEntry:h,xfaDatasetsRef:E,needAppearances:o,newRefs:l}=W;if(c&&!h&&!E&&(0,n.warn)("XFA - Cannot save it"),!o&&(!c||!E||h))return;const b=M.clone();if(c&&!h){const S=M.get("XFA").slice();S.splice(2,0,"datasets"),S.splice(3,0,E),b.set("XFA",S)}o&&b.set("NeedAppearances",!0);const R=[];await L(T,b,R,j),l.push({ref:T,data:R.join("")})}function F(W){let{xfaData:j,xfaDatasetsRef:M,newRefs:T,xref:c}=W;if(j===null){const o=c.fetchIfRef(M);j=v(o.getString(),T)}const h=c.encrypt;h&&(j=h.createCipherTransform(M.num,M.gen).encryptString(j));const E=`${M.num} ${M.gen} obj
<< /Type /EmbeddedFile /Length ${j.length}>>
stream
`+j+`
endstream
endobj
`;T.push({ref:M,data:E})}async function B(W){let{originalData:j,xrefInfo:M,newRefs:T,xref:c=null,hasXfa:h=!1,xfaDatasetsRef:E=null,hasXfaDatasetsEntry:o=!1,needAppearances:l,acroFormRef:b=null,acroForm:R=null,xfaData:S=null}=W;await P({xref:c,acroForm:R,acroFormRef:b,hasXfa:h,hasXfaDatasetsEntry:o,xfaDatasetsRef:E,needAppearances:l,newRefs:T}),h&&F({xfaData:S,xfaDatasetsRef:E,newRefs:T,xref:c});const p=new u.Dict(null),G=M.newRef;let $,A;const D=j.at(-1);D===10||D===13?($=[],A=j.length):($=[`
`],A=j.length+1),p.set("Size",G.num+1),p.set("Prev",M.startXRef),p.set("Type",u.Name.get("XRef")),M.rootRef!==null&&p.set("Root",M.rootRef),M.infoRef!==null&&p.set("Info",M.infoRef),M.encryptRef!==null&&p.set("Encrypt",M.encryptRef),T.push({ref:G,data:""}),T=T.sort((k,O)=>k.ref.num-O.ref.num);const w=[[0,1,65535]],m=[0,1];let I=0;for(const{ref:k,data:O}of T)I=Math.max(I,A),w.push([1,A,Math.min(k.gen,65535)]),A+=O.length,m.push(k.num,1),$.push(O);if(p.set("Index",m),Array.isArray(M.fileIds)&&M.fileIds.length>0){const k=N(A,M);p.set("ID",[M.fileIds[0],k])}const Y=[1,Math.ceil(Math.log2(I)/8),2],oe=(Y[0]+Y[1]+Y[2])*w.length;p.set("W",Y),p.set("Length",oe),$.push(`${G.num} ${G.gen} obj
`),await U(p,$,null),$.push(` stream
`);const ne=$.reduce((k,O)=>k+O.length,0),ce=`
endstream
endobj
startxref
${A}
%%EOF
`,J=new Uint8Array(j.length+ne+oe+ce.length);J.set(j);let _=j.length;for(const k of $)a(k,_,J),_+=k.length;for(const[k,O,V]of w)_=x(k,Y[0],_,J),_=x(O,Y[1],_,J),_=x(V,Y[2],_,J);return a(ce,_,J),J}},(he,d,i)=>{var B,W,na,M,jn,c,aa,E,bn,l,Wn;Object.defineProperty(d,"__esModule",{value:!0}),d.calculateSHA256=d.calculateMD5=d.PDF20=d.PDF17=d.CipherTransformFactory=d.ARCFourCipher=d.AES256Cipher=d.AES128Cipher=void 0,d.calculateSHA384=C,d.calculateSHA512=void 0,i(84),i(93),i(94),i(97),i(99),i(101),i(105),i(108),i(115),i(140);var n=i(145),u=i(151),g=i(226);class e{constructor(p){this.a=0,this.b=0;const G=new Uint8Array(256),$=p.length;for(let A=0;A<256;++A)G[A]=A;for(let A=0,D=0;A<256;++A){const w=G[A];D=D+w+p[A%$]&255,G[A]=G[D],G[D]=w}this.s=G}encryptBlock(p){let G=this.a,$=this.b;const A=this.s,D=p.length,w=new Uint8Array(D);for(let m=0;m<D;++m){G=G+1&255;const I=A[G];$=$+I&255;const H=A[$];A[G]=H,A[$]=I,w[m]=p[m]^A[I+H&255]}return this.a=G,this.b=$,w}decryptBlock(p){return this.encryptBlock(p)}encrypt(p){return this.encryptBlock(p)}}d.ARCFourCipher=e;const t=function(){const p=new Uint8Array([7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21]),G=new Int32Array([-680876936,-389564586,606105819,-1044525330,-176418897,1200080426,-1473231341,-45705983,1770035416,-1958414417,-42063,-1990404162,1804603682,-40341101,-1502002290,1236535329,-165796510,-1069501632,643717713,-373897302,-701558691,38016083,-660478335,-405537848,568446438,-1019803690,-187363961,1163531501,-1444681467,-51403784,1735328473,-1926607734,-378558,-2022574463,1839030562,-35309556,-1530992060,1272893353,-155497632,-1094730640,681279174,-358537222,-722521979,76029189,-640364487,-421815835,530742520,-995338651,-198630844,1126891415,-1416354905,-57434055,1700485571,-1894986606,-1051523,-2054922799,1873313359,-30611744,-1560198380,1309151649,-145523070,-1120210379,718787259,-343485551]);function $(A,D,w){let m=1732584193,I=-271733879,H=-1732584194,Y=271733878;const Q=w+72&-64,oe=new Uint8Array(Q);let ne,ce;for(ne=0;ne<w;++ne)oe[ne]=A[D++];oe[ne++]=128;const J=Q-8;for(;ne<J;)oe[ne++]=0;oe[ne++]=w<<3&255,oe[ne++]=w>>5&255,oe[ne++]=w>>13&255,oe[ne++]=w>>21&255,oe[ne++]=w>>>29&255,oe[ne++]=0,oe[ne++]=0,oe[ne++]=0;const _=new Int32Array(16);for(ne=0;ne<Q;){for(ce=0;ce<16;++ce,ne+=4)_[ce]=oe[ne]|oe[ne+1]<<8|oe[ne+2]<<16|oe[ne+3]<<24;let k=m,O=I,V=H,K=Y,te,re;for(ce=0;ce<64;++ce){ce<16?(te=O&V|~O&K,re=ce):ce<32?(te=K&O|~K&V,re=5*ce+1&15):ce<48?(te=O^V^K,re=3*ce+5&15):(te=V^(O|~K),re=7*ce&15);const ie=K,Z=k+te+G[ce]+_[re]|0,ee=p[ce];K=V,V=O,O=O+(Z<<ee|Z>>>32-ee)|0,k=ie}m=m+k|0,I=I+O|0,H=H+V|0,Y=Y+K|0}return new Uint8Array([m&255,m>>8&255,m>>16&255,m>>>24&255,I&255,I>>8&255,I>>16&255,I>>>24&255,H&255,H>>8&255,H>>16&255,H>>>24&255,Y&255,Y>>8&255,Y>>16&255,Y>>>24&255])}return $}();d.calculateMD5=t;class s{constructor(p,G){this.high=p|0,this.low=G|0}and(p){this.high&=p.high,this.low&=p.low}xor(p){this.high^=p.high,this.low^=p.low}or(p){this.high|=p.high,this.low|=p.low}shiftRight(p){p>=32?(this.low=this.high>>>p-32|0,this.high=0):(this.low=this.low>>>p|this.high<<32-p,this.high=this.high>>>p|0)}shiftLeft(p){p>=32?(this.high=this.low<<p-32,this.low=0):(this.high=this.high<<p|this.low>>>32-p,this.low<<=p)}rotateRight(p){let G,$;p&32?($=this.low,G=this.high):(G=this.low,$=this.high),p&=31,this.low=G>>>p|$<<32-p,this.high=$>>>p|G<<32-p}not(){this.high=~this.high,this.low=~this.low}add(p){const G=(this.low>>>0)+(p.low>>>0);let $=(this.high>>>0)+(p.high>>>0);G>4294967295&&($+=1),this.low=G|0,this.high=$|0}copyTo(p,G){p[G]=this.high>>>24&255,p[G+1]=this.high>>16&255,p[G+2]=this.high>>8&255,p[G+3]=this.high&255,p[G+4]=this.low>>>24&255,p[G+5]=this.low>>16&255,p[G+6]=this.low>>8&255,p[G+7]=this.low&255}assign(p){this.high=p.high,this.low=p.low}}const L=function(){function p(Y,Q){return Y>>>Q|Y<<32-Q}function G(Y,Q,oe){return Y&Q^~Y&oe}function $(Y,Q,oe){return Y&Q^Y&oe^Q&oe}function A(Y){return p(Y,2)^p(Y,13)^p(Y,22)}function D(Y){return p(Y,6)^p(Y,11)^p(Y,25)}funct
`);f[n.$setValue](U(P))}else this._isConsumeData()&&(0,s.warn)("XFA - Nodes haven't the same type.");else!x[n.$isDataValue]()||this._isMatchTemplate()?this._bindElement(f,x):(0,s.warn)("XFA - Nodes haven't the same type.")}_findDataByNameToConsume(f,x,a,N){if(!f)return null;let v,P;for(let F=0;F<3;F++){for(v=a[n.$getRealChildrenByNameIt](f,!1,!0);P=v.next().value,!!P;)if(x===P[n.$isDataValue]())return P;if(a[n.$namespaceId]===t.NamespaceIds.datasets.id&&a[n.$nodeName]==="data")break;a=a[n.$getParent]()}return N?(v=this.data[n.$getRealChildrenByNameIt](f,!0,!1),P=v.next().value,P||(v=this.data[n.$getAttributeIt](f,!0),P=v.next().value,P!=null&&P[n.$isDataValue]())?P:null):null}_setProperties(f,x){if(f.hasOwnProperty("setProperty"))for(const{ref:a,target:N,connection:v}of f.setProperty.children){if(v||!a)continue;const P=(0,g.searchNode)(this.root,x,a,!1,!1);if(!P){(0,s.warn)(`XFA - Invalid reference: ${a}.`);continue}const[F]=P;if(!F[n.$isDescendent](this.data)){(0,s.warn)("XFA - Invalid node: must be a data node.");continue}const B=(0,g.searchNode)(this.root,f,N,!1,!1);if(!B){(0,s.warn)(`XFA - Invalid target: ${N}.`);continue}const[W]=B;if(!W[n.$isDescendent](f)){(0,s.warn)("XFA - Invalid target: must be a property or subproperty.");continue}const j=W[n.$getParent]();if(W instanceof u.SetProperty||j instanceof u.SetProperty){(0,s.warn)("XFA - Invalid target: cannot be a setProperty or one of its properties.");continue}if(W instanceof u.BindItems||j instanceof u.BindItems){(0,s.warn)("XFA - Invalid target: cannot be a bindItems or one of its properties.");continue}const M=F[n.$text](),T=W[n.$nodeName];if(W instanceof e.XFAAttribute){const c=Object.create(null);c[T]=M;const h=Reflect.construct(Object.getPrototypeOf(j).constructor,[c]);j[T]=h[T];continue}if(!W.hasOwnProperty(n.$content)){(0,s.warn)("XFA - Invalid node to use in setProperty");continue}W[n.$data]=F,W[n.$content]=M,W[n.$finalize]()}}_bindItems(f,x){if(!f.hasOwnProperty("items")||!f.hasOwnProperty("bindItems")||f.bindItems.isEmpty())return;for(const v of f.items.children)f[n.$removeChild](v);f.items.clear();const a=new u.Items({}),N=new u.Items({});f[n.$appendChild](a),f.items.push(a),f[n.$appendChild](N),f.items.push(N);for(const{ref:v,labelRef:P,valueRef:F,connection:B}of f.bindItems.children){if(B||!v)continue;const W=(0,g.searchNode)(this.root,x,v,!1,!1);if(!W){(0,s.warn)(`XFA - Invalid reference: ${v}.`);continue}for(const j of W){if(!j[n.$isDescendent](this.datasets)){(0,s.warn)(`XFA - Invalid ref (${v}): must be a datasets child.`);continue}const M=(0,g.searchNode)(this.root,j,P,!0,!1);if(!M){(0,s.warn)(`XFA - Invalid label: ${P}.`);continue}const[T]=M;if(!T[n.$isDescendent](this.datasets)){(0,s.warn)("XFA - Invalid label: must be a datasets child.");continue}const c=(0,g.searchNode)(this.root,j,F,!0,!1);if(!c){(0,s.warn)(`XFA - Invalid value: ${F}.`);continue}const[h]=c;if(!h[n.$isDescendent](this.datasets)){(0,s.warn)("XFA - Invalid value: must be a datasets child.");continue}const E=U(T[n.$text]()),o=U(h[n.$text]());a[n.$appendChild](E),a.text.push(E),N[n.$appendChild](o),N.text.push(o)}}}_bindOccurrences(f,x,a){let N;if(x.length>1&&(N=f[n.$clone](),N[n.$removeChild](N.occur),N.occur=null),this._bindValue(f,x[0],a),this._setProperties(f,x[0]),this._bindItems(f,x[0]),x.length===1)return;const v=f[n.$getParent](),P=f[n.$nodeName],F=v[n.$indexOf](f);for(let B=1,W=x.length;B<W;B++){const j=x[B],M=N[n.$clone]();v[P].push(M),v[n.$insertAt](F+B,M),this._bindValue(M,j,a),this._setProperties(M,j),this._bindItems(M,j)}}_createOccurrences(f){if(!this.emptyMerge)return;const{occur:x}=f;if(!x||x.initial<=1)return;const a=f[n.$getParent](),N=f[n.$nodeName];if(!(a[N]instanceof e.XFAObjectArray))return;let v;f.name?v=a[N].children.filter(B=>B.name===f.name).length:v=a[N].children.length;const P=a[n.$indexOf](f)+1,F=x.initial-v;if(F){const B=f[n.$clone]();B[n.$removeChild](B.occur),B.occur=null,a[N].push(B),a[n.$insertAt](P,B);for(let W=1;W<F;W++){const j=B[n.$clone]();a[N].push(j),a[n.$insertAt](P+W,j)}}}_getOccurInfo(f){const{name:x,occur:a}=f;if(!a||!x)return[1,1]
`,`
`))}[n.$getExtra](){return typeof this[n.$content]=="string"?this[n.$content].split(/[\u2029\u2028\n]/).reduce((r,X)=>(X&&r.push(X),r),[]).join(`
`):this[n.$content][n.$text]()}[n.$toHTML](r){if(typeof this[n.$content]=="string"){const X=l(this[n.$content]).html;return this[n.$content].includes("\u2029")?(X.name="div",X.children=[],this[n.$content].split("\u2029").map(ve=>ve.split(/[\u2028\n]/).reduce((Ie,Pe)=>(Ie.push({name:"span",value:Pe},{name:"br"}),Ie),[])).forEach(ve=>{X.children.push({name:"p",children:ve})})):/[\u2028\n]/.test(this[n.$content])&&(X.name="div",X.children=[],this[n.$content].split(/[\u2028\n]/).forEach(ve=>{X.children.push({name:"span",value:ve},{name:"br"})})),s.HTMLResult.success(X)}return this[n.$content][n.$toHTML](r)}}d.Text=un;class fn extends t.XFAObject{constructor(r){super(f,"textEdit",!0),this.allowRichText=(0,s.getInteger)({data:r.allowRichText,defaultValue:0,validate:X=>X===1}),this.hScrollPolicy=(0,s.getStringOption)(r.hScrollPolicy,["auto","off","on"]),this.id=r.id||"",this.multiLine=(0,s.getInteger)({data:r.multiLine,defaultValue:"",validate:X=>X===0||X===1}),this.use=r.use||"",this.usehref=r.usehref||"",this.vScrollPolicy=(0,s.getStringOption)(r.vScrollPolicy,["auto","off","on"]),this.border=null,this.comb=null,this.extras=null,this.margin=null}[n.$toHTML](r){var Pe,Ue;const X=(0,e.toStyle)(this,"border","font","margin");let ve;const Ie=this[n.$getParent]()[n.$getParent]();return this.multiLine===""&&(this.multiLine=Ie instanceof be?1:0),this.multiLine===1?ve={name:"textarea",attributes:{dataId:((Pe=Ie[n.$data])==null?void 0:Pe[n.$uid])||Ie[n.$uid],fieldId:Ie[n.$uid],class:["xfaTextfield"],style:X,"aria-label":o(Ie),"aria-required":!1}}:ve={name:"input",attributes:{type:"text",dataId:((Ue=Ie[n.$data])==null?void 0:Ue[n.$uid])||Ie[n.$uid],fieldId:Ie[n.$uid],class:["xfaTextfield"],style:X,"aria-label":o(Ie),"aria-required":!1}},c(Ie)&&(ve.attributes["aria-required"]=!0,ve.attributes.required=!0),s.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[ve]})}}class Tn extends t.StringObject{constructor(r){super(f,"time"),this.id=r.id||"",this.name=r.name||"",this.use=r.use||"",this.usehref=r.usehref||""}[n.$finalize](){const r=this[n.$content].trim();this[n.$content]=r?new Date(r):null}[n.$toHTML](r){return l(this[n.$content]?this[n.$content].toString():"")}}class En extends t.XFAObject{constructor(r){super(f,"timeStamp"),this.id=r.id||"",this.server=r.server||"",this.type=(0,s.getStringOption)(r.type,["optional","required"]),this.use=r.use||"",this.usehref=r.usehref||""}}class Mn extends t.StringObject{constructor(r){super(f,"toolTip"),this.id=r.id||"",this.rid=r.rid||"",this.use=r.use||"",this.usehref=r.usehref||""}}class Pn extends t.XFAObject{constructor(r){super(f,"traversal",!0),this.id=r.id||"",this.use=r.use||"",this.usehref=r.usehref||"",this.extras=null,this.traverse=new t.XFAObjectArray}}class Rn extends t.XFAObject{constructor(r){super(f,"traverse",!0),this.id=r.id||"",this.operation=(0,s.getStringOption)(r.operation,["next","back","down","first","left","right","up"]),this.ref=r.ref||"",this.use=r.use||"",this.usehref=r.usehref||"",this.extras=null,this.script=null}get name(){return this.operation}[n.$isTransparent](){return!1}}class sn extends t.XFAObject{constructor(r){super(f,"ui",!0),this.id=r.id||"",this.use=r.use||"",this.usehref=r.usehref||"",this.extras=null,this.picture=null,this.barcode=null,this.button=null,this.checkButton=null,this.choiceList=null,this.dateTimeEdit=null,this.defaultUi=null,this.imageEdit=null,this.numericEdit=null,this.passwordEdit=null,this.signature=null,this.textEdit=null}[n.$getExtra](){if(this[n.$extra]===void 0){for(const r of Object.getOwnPropertyNames(this)){if(r==="extras"||r==="picture")continue;const X=this[r];if(X instanceof t.XFAObject)return this[n.$extra]=X,X}this[n.$extra]=null}return this[n.$extra]}[n.$toHTML](r){const X=this[n.$getExtra]();return X?X[n.$toHTML](r):s.HTMLResult.EMPTY}}class Dn extends t.XFAObject{constructor(r){super(f,"validate",!0),this.formatTest=(0,s.getStringOption)(r.formatTest,["warning","disabled","error"]),this.id=r.id||"",this.nullTest=(0,s.getStringOption)(r.nullTest,["disabled","error","warning"]),this.scriptTest=(0,s.ge
`,!0])}this.glyphs.pop();return}for(const y of L.split(/[\u2029\n]/)){for(const f of y.split(""))this.glyphs.push([C,1.2*C,C,f,!1]);this.glyphs.push([0,0,0,`
`,!0])}this.glyphs.pop()}compute(L){let U=-1,C=0,y=0,f=0,x=0,a=0,N=!1,v=!0;for(let P=0,F=this.glyphs.length;P<F;P++){const[B,W,j,M,T]=this.glyphs[P],c=M===" ",h=v?j:W;if(T){y=Math.max(y,x),x=0,f+=a,a=h,U=-1,C=0,v=!1;continue}if(c){x+B>L?(y=Math.max(y,x),x=0,f+=a,a=h,U=-1,C=0,N=!0,v=!1):(a=Math.max(h,a),C=x,x+=B,U=P);continue}if(x+B>L){f+=a,a=h,U!==-1?(P=U,y=Math.max(y,C),x=0,U=-1,C=0):(y=Math.max(y,x),x=B),N=!0,v=!1;continue}x+=B,a=Math.max(h,a)}return y=Math.max(y,x),f+=a+this.extraHeight,{width:u*y,height:f,isBroken:N}}}d.TextMeasure=t},(he,d,i)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.XmlObject=d.XFAObjectArray=d.XFAObject=d.XFAAttribute=d.StringObject=d.OptionObject=d.Option10=d.Option01=d.IntegerObject=d.ContentObject=void 0,i(140),i(116),i(127),i(129),i(132),i(134),i(136),i(138);var n=i(229),u=i(238),g=i(145),e=i(150),t=i(235),s=i(242);const L=Symbol(),U=Symbol(),C=Symbol(),y=Symbol("_children"),f=Symbol(),x=Symbol(),a=Symbol(),N=Symbol(),v=Symbol(),P=Symbol(),F=Symbol(),B=Symbol(),W=Symbol(),j=Symbol("parent"),M=Symbol(),T=Symbol(),c=Symbol();let h=0;const E=t.NamespaceIds.datasets.id;class o{constructor(m,I){let H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this[n.$namespaceId]=m,this[n.$nodeName]=I,this[F]=H,this[j]=null,this[y]=[],this[n.$uid]=`${I}${h++}`,this[n.$globalData]=null}get isXFAObject(){return!0}get isXFAObjectArray(){return!1}createNodes(m){let I=this,H=null;for(const{name:Y,index:Q}of m){for(let oe=0,ne=isFinite(Q)?Q:0;oe<=ne;oe++){const ce=I[n.$namespaceId]===E?-1:I[n.$namespaceId];H=new R(ce,Y),I[n.$appendChild](H)}I=H}return H}[n.$onChild](m){if(!this[F]||!this[n.$onChildCheck](m))return!1;const I=m[n.$nodeName],H=this[I];if(H instanceof l){if(H.push(m))return this[n.$appendChild](m),!0}else return H!==null&&this[n.$removeChild](H),this[I]=m,this[n.$appendChild](m),!0;let Y="";return this.id?Y=` (id: ${this.id})`:this.name&&(Y=` (name: ${this.name} ${this.h.value})`),(0,g.warn)(`XFA - node "${this[n.$nodeName]}"${Y} has already enough "${I}"!`),!1}[n.$onChildCheck](m){return this.hasOwnProperty(m[n.$nodeName])&&m[n.$namespaceId]===this[n.$namespaceId]}[n.$isNsAgnostic](){return!1}[n.$acceptWhitespace](){return!1}[n.$isCDATAXml](){return!1}[n.$isBindable](){return!1}[n.$popPara](){this.para&&this[n.$getTemplateRoot]()[n.$extra].paraStack.pop()}[n.$pushPara](){this[n.$getTemplateRoot]()[n.$extra].paraStack.push(this.para)}[n.$setId](m){this.id&&this[n.$namespaceId]===t.NamespaceIds.template.id&&m.set(this.id,this)}[n.$getTemplateRoot](){return this[n.$globalData].template}[n.$isSplittable](){return!1}[n.$isThereMoreWidth](){return!1}[n.$appendChild](m){m[j]=this,this[y].push(m),!m[n.$globalData]&&this[n.$globalData]&&(m[n.$globalData]=this[n.$globalData])}[n.$removeChild](m){const I=this[y].indexOf(m);this[y].splice(I,1)}[n.$hasSettableValue](){return this.hasOwnProperty("value")}[n.$setValue](m){}[n.$onText](m){}[n.$finalize](){}[n.$clean](m){delete this[F],this[n.$cleanup]&&(m.clean(this[n.$cleanup]),delete this[n.$cleanup])}[n.$indexOf](m){return this[y].indexOf(m)}[n.$insertAt](m,I){I[j]=this,this[y].splice(m,0,I),!I[n.$globalData]&&this[n.$globalData]&&(I[n.$globalData]=this[n.$globalData])}[n.$isTransparent](){return!this.name}[n.$lastAttribute](){return""}[n.$text](){return this[y].length===0?this[n.$content]:this[y].map(m=>m[n.$text]()).join("")}get[C](){const m=Object.getPrototypeOf(this);if(!m._attributes){const I=m._attributes=new Set;for(const H of Object.getOwnPropertyNames(this)){if(this[H]===null||this[H]instanceof o||this[H]instanceof l)break;I.add(H)}}return(0,g.shadow)(this,C,m._attributes)}[n.$isDescendent](m){let I=this;for(;I;){if(I===m)return!0;I=I[n.$getParent]()}return!1}[n.$getParent](){return this[j]}[n.$getSubformParent](){return this[n.$getParent]()}[n.$getChildren](){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return m?this[m]:this[y]}[n.$dump](){const m=Object.create(null);this[n.$content]&&(m.$content=this[n.$content]);for(const I of Object.getOwnPropertyNames(this)){const H=this[I];H!==null&&(H instanceof o?m[I]=H[n.
`):void 0:A=this[n.$content]||void 0,e.HTMLResult.success({name:this[n.$nodeName],attributes:{href:this.href,style:a(this.style,this,this[L])},children:$,value:A})}}class F extends P{constructor(G){super(G,"a"),this.href=(0,g.fixURL)(G.href)||""}}class B extends P{constructor(G){super(G,"b")}[n.$pushGlyphs](G){G.pushFont({weight:"bold"}),super[n.$pushGlyphs](G),G.popFont()}}class W extends P{constructor(G){super(G,"body")}[n.$toHTML](G){const $=super[n.$toHTML](G),{html:A}=$;return A?(A.name="div",A.attributes.class=["xfaRich"],$):e.HTMLResult.EMPTY}}class j extends P{constructor(G){super(G,"br")}[n.$text](){return`
`}[n.$pushGlyphs](G){G.addString(`
`)}[n.$toHTML](G){return e.HTMLResult.success({name:"br"})}}class M extends P{constructor(G){super(G,"html")}[n.$toHTML](G){var A;const $=[];if(this[n.$extra]={children:$},this[n.$childrenToHTML]({}),$.length===0)return e.HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},value:this[n.$content]||""});if($.length===1){const D=$[0];if((A=D.attributes)!=null&&A.class.includes("xfaRich"))return e.HTMLResult.success(D)}return e.HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},children:$})}}class T extends P{constructor(G){super(G,"i")}[n.$pushGlyphs](G){G.pushFont({posture:"italic"}),super[n.$pushGlyphs](G),G.popFont()}}class c extends P{constructor(G){super(G,"li")}}class h extends P{constructor(G){super(G,"ol")}}class E extends P{constructor(G){super(G,"p")}[n.$pushGlyphs](G){super[n.$pushGlyphs](G,!1),G.addString(`
`),G.addPara(),G.popFont()}[n.$text](){return this[n.$getParent]()[n.$getChildren]().at(-1)===this?super[n.$text]():super[n.$text]()+`
`}}class o extends P{constructor(G){super(G,"span")}}class l extends P{constructor(G){super(G,"sub")}}class b extends P{constructor(G){super(G,"sup")}}class R extends P{constructor(G){super(G,"ul")}}class S{static[u.$buildXFAObject](G,$){if(S.hasOwnProperty(G))return S[G]($)}static a(G){return new F(G)}static b(G){return new B(G)}static body(G){return new W(G)}static br(G){return new j(G)}static html(G){return new M(G)}static i(G){return new T(G)}static li(G){return new c(G)}static ol(G){return new h(G)}static p(G){return new E(G)}static span(G){return new o(G)}static sub(G){return new l(G)}static sup(G){return new b(G)}static ul(G){return new R(G)}}d.XhtmlNamespace=S},(he,d,i)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.UnknownNamespace=void 0;var n=i(235),u=i(241);class g{constructor(t){this.namespaceId=t}[n.$buildXFAObject](t,s){return new u.XmlObject(this.namespaceId,t,s)}}d.UnknownNamespace=g},(he,d,i)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.DatasetReader=void 0,i(2);var n=i(145),u=i(150),g=i(222);function e(L){try{return(0,n.stringToUTF8String)(L)}catch(U){return(0,n.warn)(`UTF-8 decoding failed: "${U}".`),L}}class t extends g.SimpleXMLParser{constructor(U){super(U),this.node=null}onEndElement(U){const C=super.onEndElement(U);if(C&&U==="xfa:datasets")throw this.node=C,new Error("Aborting DatasetXMLParser.")}}class s{constructor(U){if(U.datasets)this.node=new g.SimpleXMLParser({hasAttributes:!0}).parseFromString(U.datasets).documentElement;else{const C=new t({hasAttributes:!0});try{C.parseFromString(U["xdp:xdp"])}catch{}this.node=C.node}}getValue(U){if(!this.node||!U)return"";const C=this.node.searchNode((0,u.parseXFAPath)(U),0);if(!C)return"";const y=C.firstChild;return(y==null?void 0:y.nodeName)==="value"?C.children.map(f=>e(f.textContent)):e(C.textContent)}}d.DatasetReader=s},(he,d,i)=>{var U;Object.defineProperty(d,"__esModule",{value:!0}),d.XRef=void 0,i(116),i(127),i(129),i(132),i(134),i(136),i(138),i(84),i(93),i(94),i(97),i(99),i(101),i(105),i(108),i(115),i(140),i(2);var n=i(145),u=i(151),g=i(167),e=i(150),t=i(152),s=i(225);class L{constructor(y,f){vt(this,U,null);this.stream=y,this.pdfManager=f,this.entries=[],this._xrefStms=new Set,this._cacheMap=new Map,this._pendingRefs=new u.RefSet,this._newPersistentRefNum=null,this._newTemporaryRefNum=null}getNewPersistentRef(y){this._newPersistentRefNum===null&&(this._newPersistentRefNum=this.entries.length||1);const f=this._newPersistentRefNum++;return this._cacheMap.set(f,y),u.Ref.get(f,0)}getNewTemporaryRef(){return this._newTemporaryRefNum===null&&(this._newTemporaryRefNum=this.entries.length||1),u.Ref.get(this._newTemporaryRefNum++,0)}resetNewTemporaryRef(){this._newTemporaryRefNum=null}setStartXRef(y){this.startXRefQueue=[y]}parse(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,f;y?((0,n.warn)("Indexing all PDF objects"),f=this.indexObjects()):f=this.readXRef(),f.assignXref(this),this.trailer=f;let x;try{x=f.get("Encrypt")}catch(N){if(N instanceof e.MissingDataException)throw N;(0,n.warn)(`XRef.parse - Invalid "Encrypt" reference: "${N}".`)}if(x instanceof u.Dict){const N=f.get("ID"),v=N!=null&&N.length?N[0]:"";x.suppressEncryption=!0,this.encrypt=new s.CipherTransformFactory(x,v,this.pdfManager.password)}let a;try{a=f.get("Root")}catch(N){if(N instanceof e.MissingDataException)throw N;(0,n.warn)(`XRef.parse - Invalid "Root" reference: "${N}".`)}if(a instanceof u.Dict)try{if(a.get("Pages")instanceof u.Dict){this.root=a;return}}catch(N){if(N instanceof e.MissingDataException)throw N;(0,n.warn)(`XRef.parse - Invalid "Pages" reference: "${N}".`)}throw y?new n.InvalidPDFException("Invalid Root reference."):new e.XRefParseException}processXRefTable(y){"tableState"in this||(this.tableState={entryNum:0,streamPos:y.lexer.stream.pos,parserBuf1:y.buf1,parserBuf2:y.buf2});const f=this.readXRefTable(y);if(!(0,u.isCmd)(f,"trailer"))throw new n.FormatError("Invalid XRef table: could not find trailer dictionary");let x=y.getObj();if(!(x instanceof u.Dict)&&x.dict&&(x=x.dict),!(x instanceof u.Dict))throw new n.FormatError("Invalid XRef t