iqboost.mobi
Open in
urlscan Pro
2606:4700:3034::ac43:dbc7
Public Scan
URL:
https://iqboost.mobi/assets/pdfjs-dist-fd4e8776.js
Submission: On August 13 via api from US — Scanned from DE
Submission: On August 13 via api from US — Scanned from DE
Form analysis
0 forms found in the DOMText Content
var bs=Object.defineProperty;var As=(ht,f,Q)=>f in ht?bs(ht,f,{enumerable:!0,configurable:!0,writable:!0,value:Q}):ht[f]=Q;var Ut=(ht,f,Q)=>(As(ht,typeof f!="symbol"?f+"":f,Q),Q),ye=(ht,f,Q)=>{if(!f.has(ht))throw TypeError("Cannot "+Q)};var l=(ht,f,Q)=>(ye(ht,f,"read from private field"),Q?Q.call(ht):f.get(ht)),$=(ht,f,Q)=>{if(f.has(ht))throw TypeError("Cannot add the same private member more than once");f instanceof WeakSet?f.add(ht):f.set(ht,Q)},ft=(ht,f,Q,p)=>(ye(ht,f,"write to private field"),p?p.call(ht,Q):f.set(ht,Q),Q);var fe=(ht,f,Q,p)=>({set _(F){ft(ht,f,F,Q)},get _(){return l(ht,f,p)}}),tt=(ht,f,Q)=>(ye(ht,f,"access private method"),Q);import{a as getAugmentedNamespace}from"./core-js-ba475ae0.js";const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"}));function commonjsRequire(ht){throw new Error('Could not dynamically require "'+ht+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf={exports:{}};const require$$5=getAugmentedNamespace(__viteBrowserExternal$1);(function(module,exports){(function(f,Q){module.exports=Q()})(globalThis,()=>(()=>{var __webpack_modules__=[,(ht,f)=>{var Mt;Object.defineProperty(f,"__esModule",{value:!0}),f.VerbosityLevel=f.Util=f.UnknownErrorException=f.UnexpectedResponseException=f.TextRenderingMode=f.RenderingIntentFlag=f.PromiseCapability=f.PermissionFlag=f.PasswordResponses=f.PasswordException=f.PageActionEventType=f.OPS=f.MissingPDFException=f.MAX_IMAGE_SIZE_TO_CACHE=f.LINE_FACTOR=f.LINE_DESCENT_FACTOR=f.InvalidPDFException=f.ImageKind=f.IDENTITY_MATRIX=f.FormatError=f.FeatureTest=f.FONT_IDENTITY_MATRIX=f.DocumentActionEventType=f.CMapCompressionType=f.BaseException=f.BASELINE_FACTOR=f.AnnotationType=f.AnnotationStateModelType=f.AnnotationReviewState=f.AnnotationReplyType=f.AnnotationMode=f.AnnotationMarkedState=f.AnnotationFlag=f.AnnotationFieldFlag=f.AnnotationEditorType=f.AnnotationEditorPrefix=f.AnnotationEditorParamsType=f.AnnotationBorderStyleType=f.AnnotationActionEventType=f.AbortException=void 0,f.assert=Ct,f.bytesToString=k,f.createValidAbsoluteUrl=wt,f.getModificationDate=Et,f.getVerbosityLevel=pt,f.info=rt,f.isArrayBuffer=gt,f.isArrayEqual=vt,f.normalizeUnicode=Ft,f.objectFromMap=_,f.objectSize=h,f.setVerbosityLevel=nt,f.shadow=N,f.string32=n,f.stringToBytes=t,f.stringToPDFString=ct,f.stringToUTF8String=ot,f.unreachable=At,f.utf8StringToString=lt,f.warn=ut;const Q=[1,0,0,1,0,0];f.IDENTITY_MATRIX=Q;const p=[.001,0,0,.001,0,0];f.FONT_IDENTITY_MATRIX=p;const F=1e7;f.MAX_IMAGE_SIZE_TO_CACHE=F;const z=1.35;f.LINE_FACTOR=z;const H=.35;f.LINE_DESCENT_FACTOR=H;const at=H/z;f.BASELINE_FACTOR=at;const X={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};f.RenderingIntentFlag=X;const w={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};f.AnnotationMode=w;const A="pdfjs_internal_editor_";f.AnnotationEditorPrefix=A;const I={DISABLE:-1,NONE:0,FREETEXT:3,INK:15};f.AnnotationEditorType=I;const L={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};f.AnnotationEditorParamsType=L;const E={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};f.PermissionFlag=E;const m={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};f.TextRenderingMode=m;const y={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};f.ImageKind=y;const d={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};f.AnnotationType=d;const S={MARKED:"Marked",REVIEW:"Review"};f.AnnotationStateModelType=S;const P={MARKED:"Marked",UNMARKED:"Unmarked"};f.AnnotationMarkedState=P;const x={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};f.AnnotationReviewState=x;const g={GROUP:"Group",REPLY:"R"};f.AnnotationReplyType=g;const s={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};f.AnnotationFlag=s;const r={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};f.AnnotationFieldFlag=r;const a={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};f.AnnotationBorderStyleType=a;const e={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"};f.AnnotationActionEventType=e;const u={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};f.DocumentActionEventType=u;const T={O:"PageOpen",C:"PageClose"};f.PageActionEventType=T;const i={ERRORS:0,WARNINGS:1,INFOS:5};f.VerbosityLevel=i;const M={NONE:0,BINARY:1};f.CMapCompressionType=M;const U={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,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};f.OPS=U;const K={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};f.PasswordResponses=K;let et=i.WARNINGS;function nt(it){Number.isInteger(it)&&(et=it)}function pt(){return et}function rt(it){et>=i.INFOS&&console.log(`Info: ${it}`)}function ut(it){et>=i.WARNINGS&&console.log(`Warning: ${it}`)}function At(it){throw new Error(it)}function Ct(it,G){it||At(G)}function Tt(it){switch(it==null?void 0:it.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function wt(it,G=null,q=null){if(!it)return null;try{if(q&&typeof it=="string"){if(q.addDefaultProtocol&&it.startsWith("www.")){const It=it.match(/\./g);(It==null?void 0:It.length)>=2&&(it=`http://${it}`)}if(q.tryConvertEncoding)try{it=ot(it)}catch{}}const bt=G?new URL(it,G):new URL(it);if(Tt(bt))return bt}catch{}return null}function N(it,G,q,bt=!1){return Object.defineProperty(it,G,{value:q,enumerable:!bt,configurable:!0,writable:!1}),q}const o=function(){function G(q,bt){this.constructor===G&&At("Cannot initialize BaseException."),this.message=q,this.name=bt}return G.prototype=new Error,G.constructor=G,G}();f.BaseException=o;class c extends o{constructor(G,q){super(G,"PasswordException"),this.code=q}}f.PasswordException=c;class v extends o{constructor(G,q){super(G,"UnknownErrorException"),this.details=q}}f.UnknownErrorException=v;class O extends o{constructor(G){super(G,"InvalidPDFException")}}f.InvalidPDFException=O;class D extends o{constructor(G){super(G,"MissingPDFException")}}f.MissingPDFException=D;class B extends o{constructor(G,q){super(G,"UnexpectedResponseException"),this.status=q}}f.UnexpectedResponseException=B;class R extends o{constructor(G){super(G,"FormatError")}}f.FormatError=R;class C extends o{constructor(G){super(G,"AbortException")}}f.AbortException=C;function k(it){(typeof it!="object"||(it==null?void 0:it.length)===void 0)&&At("Invalid argument for bytesToString");const G=it.length,q=8192;if(G<q)return String.fromCharCode.apply(null,it);const bt=[];for(let It=0;It<G;It+=q){const Wt=Math.min(It+q,G),Gt=it.subarray(It,Wt);bt.push(String.fromCharCode.apply(null,Gt))}return bt.join("")}function t(it){typeof it!="string"&&At("Invalid argument for stringToBytes");const G=it.length,q=new Uint8Array(G);for(let bt=0;bt<G;++bt)q[bt]=it.charCodeAt(bt)&255;return q}function n(it){return String.fromCharCode(it>>24&255,it>>16&255,it>>8&255,it&255)}function h(it){return Object.keys(it).length}function _(it){const G=Object.create(null);for(const[q,bt]of it)G[q]=bt;return G}function b(){const it=new Uint8Array(4);return it[0]=1,new Uint32Array(it.buffer,0,1)[0]===1}function j(){try{return new Function(""),!0}catch{return!1}}class J{static get isLittleEndian(){return N(this,"isLittleEndian",b())}static get isEvalSupported(){return N(this,"isEvalSupported",j())}static get isOffscreenCanvasSupported(){return N(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?N(this,"platform",{isWin:!1,isMac:!1}):N(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}}f.FeatureTest=J;const Y=[...Array(256).keys()].map(it=>it.toString(16).padStart(2,"0"));class Z{static makeHexColor(G,q,bt){return`#${Y[G]}${Y[q]}${Y[bt]}`}static scaleMinMax(G,q){let bt;G[0]?(G[0]<0&&(bt=q[0],q[0]=q[1],q[1]=bt),q[0]*=G[0],q[1]*=G[0],G[3]<0&&(bt=q[2],q[2]=q[3],q[3]=bt),q[2]*=G[3],q[3]*=G[3]):(bt=q[0],q[0]=q[2],q[2]=bt,bt=q[1],q[1]=q[3],q[3]=bt,G[1]<0&&(bt=q[2],q[2]=q[3],q[3]=bt),q[2]*=G[1],q[3]*=G[1],G[2]<0&&(bt=q[0],q[0]=q[1],q[1]=bt),q[0]*=G[2],q[1]*=G[2]),q[0]+=G[4],q[1]+=G[4],q[2]+=G[5],q[3]+=G[5]}static transform(G,q){return[G[0]*q[0]+G[2]*q[1],G[1]*q[0]+G[3]*q[1],G[0]*q[2]+G[2]*q[3],G[1]*q[2]+G[3]*q[3],G[0]*q[4]+G[2]*q[5]+G[4],G[1]*q[4]+G[3]*q[5]+G[5]]}static applyTransform(G,q){const bt=G[0]*q[0]+G[1]*q[2]+q[4],It=G[0]*q[1]+G[1]*q[3]+q[5];return[bt,It]}static applyInverseTransform(G,q){const bt=q[0]*q[3]-q[1]*q[2],It=(G[0]*q[3]-G[1]*q[2]+q[2]*q[5]-q[4]*q[3])/bt,Wt=(-G[0]*q[1]+G[1]*q[0]+q[4]*q[1]-q[5]*q[0])/bt;return[It,Wt]}static getAxialAlignedBoundingBox(G,q){const bt=Z.applyTransform(G,q),It=Z.applyTransform(G.slice(2,4),q),Wt=Z.applyTransform([G[0],G[3]],q),Gt=Z.applyTransform([G[2],G[1]],q);return[Math.min(bt[0],It[0],Wt[0],Gt[0]),Math.min(bt[1],It[1],Wt[1],Gt[1]),Math.max(bt[0],It[0],Wt[0],Gt[0]),Math.max(bt[1],It[1],Wt[1],Gt[1])]}static inverseTransform(G){const q=G[0]*G[3]-G[1]*G[2];return[G[3]/q,-G[1]/q,-G[2]/q,G[0]/q,(G[2]*G[5]-G[4]*G[3])/q,(G[4]*G[1]-G[5]*G[0])/q]}static singularValueDecompose2dScale(G){const q=[G[0],G[2],G[1],G[3]],bt=G[0]*q[0]+G[1]*q[2],It=G[0]*q[1]+G[1]*q[3],Wt=G[2]*q[0]+G[3]*q[2],Gt=G[2]*q[1]+G[3]*q[3],jt=(bt+Gt)/2,ee=Math.sqrt((bt+Gt)**2-4*(bt*Gt-Wt*It))/2,Qt=jt+ee||1,V=jt-ee||1;return[Math.sqrt(Qt),Math.sqrt(V)]}static normalizeRect(G){const q=G.slice(0);return G[0]>G[2]&&(q[0]=G[2],q[2]=G[0]),G[1]>G[3]&&(q[1]=G[3],q[3]=G[1]),q}static intersect(G,q){const bt=Math.max(Math.min(G[0],G[2]),Math.min(q[0],q[2])),It=Math.min(Math.max(G[0],G[2]),Math.max(q[0],q[2]));if(bt>It)return null;const Wt=Math.max(Math.min(G[1],G[3]),Math.min(q[1],q[3])),Gt=Math.min(Math.max(G[1],G[3]),Math.max(q[1],q[3]));return Wt>Gt?null:[bt,Wt,It,Gt]}static bezierBoundingBox(G,q,bt,It,Wt,Gt,jt,ee){const Qt=[],V=[[],[]];let dt,_t,yt,St,kt,Rt,xt,Lt;for(let Bt=0;Bt<2;++Bt){if(Bt===0?(_t=6*G-12*bt+6*Wt,dt=-3*G+9*bt-9*Wt+3*jt,yt=3*bt-3*G):(_t=6*q-12*It+6*Gt,dt=-3*q+9*It-9*Gt+3*ee,yt=3*It-3*q),Math.abs(dt)<1e-12){if(Math.abs(_t)<1e-12)continue;St=-yt/_t,0<St&&St<1&&Qt.push(St);continue}xt=_t*_t-4*yt*dt,Lt=Math.sqrt(xt),!(xt<0)&&(kt=(-_t+Lt)/(2*dt),0<kt&&kt<1&&Qt.push(kt),Rt=(-_t-Lt)/(2*dt),0<Rt&&Rt<1&&Qt.push(Rt))}let Dt=Qt.length,Ot;const Nt=Dt;for(;Dt--;)St=Qt[Dt],Ot=1-St,V[0][Dt]=Ot*Ot*Ot*G+3*Ot*Ot*St*bt+3*Ot*St*St*Wt+St*St*St*jt,V[1][Dt]=Ot*Ot*Ot*q+3*Ot*Ot*St*It+3*Ot*St*St*Gt+St*St*St*ee;return V[0][Nt]=G,V[1][Nt]=q,V[0][Nt+1]=jt,V[1][Nt+1]=ee,V[0].length=V[1].length=Nt+2,[Math.min(...V[0]),Math.min(...V[1]),Math.max(...V[0]),Math.max(...V[1])]}}f.Util=Z;const st=[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 ct(it){if(it[0]>="ï"){let q;if(it[0]==="þ"&&it[1]==="ÿ"?q="utf-16be":it[0]==="ÿ"&&it[1]==="þ"?q="utf-16le":it[0]==="ï"&&it[1]==="»"&&it[2]==="¿"&&(q="utf-8"),q)try{const bt=new TextDecoder(q,{fatal:!0}),It=t(it);return bt.decode(It)}catch(bt){ut(`stringToPDFString: "${bt}".`)}}const G=[];for(let q=0,bt=it.length;q<bt;q++){const It=st[it.charCodeAt(q)];G.push(It?String.fromCharCode(It):it.charAt(q))}return G.join("")}function ot(it){return decodeURIComponent(escape(it))}function lt(it){return unescape(encodeURIComponent(it))}function gt(it){return typeof it=="object"&&(it==null?void 0:it.byteLength)!==void 0}function vt(it,G){if(it.length!==G.length)return!1;for(let q=0,bt=it.length;q<bt;q++)if(it[q]!==G[q])return!1;return!0}function Et(it=new Date){return[it.getUTCFullYear().toString(),(it.getUTCMonth()+1).toString().padStart(2,"0"),it.getUTCDate().toString().padStart(2,"0"),it.getUTCHours().toString().padStart(2,"0"),it.getUTCMinutes().toString().padStart(2,"0"),it.getUTCSeconds().toString().padStart(2,"0")].join("")}class Pt{constructor(){$(this,Mt,!1);this.promise=new Promise((G,q)=>{this.resolve=bt=>{ft(this,Mt,!0),G(bt)},this.reject=bt=>{ft(this,Mt,!0),q(bt)}})}get settled(){return l(this,Mt)}}Mt=new WeakMap,f.PromiseCapability=Pt;let W=null,mt=null;function Ft(it){return W||(W=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,mt=new Map([["ſt","ſt"]])),it.replaceAll(W,(G,q,bt)=>q?q.normalize("NFKC"):mt.get(bt))}},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var ht,Q,p,F,se,H,pe,X,w,A,I,L,E,m,y,ve,S,P,Se,g,s;Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_is_node=__w_pdfjs_require__(10),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_xfa_text=__w_pdfjs_require__(19);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3;let DefaultCanvasFactory=_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultFilterFactory=_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;let DefaultStandardFontDataFactory=_display_utils.DOMStandardFontDataFactory;if(exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory,_is_node.isNodeJS){const{NodeCanvasFactory:a,NodeCMapReaderFactory:e,NodeFilterFactory:u,NodeStandardFontDataFactory:T}=__w_pdfjs_require__(20);exports.DefaultCanvasFactory=DefaultCanvasFactory=a,exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=e,exports.DefaultFilterFactory=DefaultFilterFactory=u,exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=T}let createPDFNetworkStream;if(_is_node.isNodeJS){const{PDFNodeStream:a}=__w_pdfjs_require__(21);createPDFNetworkStream=e=>new a(e)}else{const{PDFNetworkStream:a}=__w_pdfjs_require__(24),{PDFFetchStream:e}=__w_pdfjs_require__(25);createPDFNetworkStream=u=>(0,_display_utils.isValidFetchUrl)(u.url)?new e(u):new a(u)}function getDocument(a){if(typeof a=="string"||a instanceof URL?a={url:a}:(0,_util.isArrayBuffer)(a)&&(a={data:a}),typeof a!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!a.url&&!a.data&&!a.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const e=new PDFDocumentLoadingTask,{docId:u}=e,T=a.url?getUrlProp(a.url):null,i=a.data?getDataProp(a.data):null,M=a.httpHeaders||null,U=a.withCredentials===!0,K=a.password??null,et=a.range instanceof PDFDataRangeTransport?a.range:null,nt=Number.isInteger(a.rangeChunkSize)&&a.rangeChunkSize>0?a.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let pt=a.worker instanceof PDFWorker?a.worker:null;const rt=a.verbosity,ut=typeof a.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(a.docBaseUrl)?a.docBaseUrl:null,At=typeof a.cMapUrl=="string"?a.cMapUrl:null,Ct=a.cMapPacked!==!1,Tt=a.CMapReaderFactory||DefaultCMapReaderFactory,wt=typeof a.standardFontDataUrl=="string"?a.standardFontDataUrl:null,N=a.StandardFontDataFactory||DefaultStandardFontDataFactory,o=a.stopAtErrors!==!0,c=Number.isInteger(a.maxImageSize)&&a.maxImageSize>-1?a.maxImageSize:-1,v=a.isEvalSupported!==!1,O=typeof a.isOffscreenCanvasSupported=="boolean"?a.isOffscreenCanvasSupported:!_is_node.isNodeJS,D=Number.isInteger(a.canvasMaxAreaInBytes)?a.canvasMaxAreaInBytes:-1,B=typeof a.disableFontFace=="boolean"?a.disableFontFace:_is_node.isNodeJS,R=a.fontExtraProperties===!0,C=a.enableXfa===!0,k=a.ownerDocument||globalThis.document,t=a.disableRange===!0,n=a.disableStream===!0,h=a.disableAutoFetch===!0,_=a.pdfBug===!0,b=et?et.length:a.length??NaN,j=typeof a.useSystemFonts=="boolean"?a.useSystemFonts:!_is_node.isNodeJS&&!B,J=typeof a.useWorkerFetch=="boolean"?a.useWorkerFetch:Tt===_display_utils.DOMCMapReaderFactory&&N===_display_utils.DOMStandardFontDataFactory&&(0,_display_utils.isValidFetchUrl)(At,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(wt,document.baseURI),Y=a.canvasFactory||new DefaultCanvasFactory({ownerDocument:k}),Z=a.filterFactory||new DefaultFilterFactory({docId:u,ownerDocument:k}),st=null;(0,_util.setVerbosityLevel)(rt);const ct={canvasFactory:Y,filterFactory:Z};if(J||(ct.cMapReaderFactory=new Tt({baseUrl:At,isCompressed:Ct}),ct.standardFontDataFactory=new N({baseUrl:wt})),!pt){const gt={verbosity:rt,port:_worker_options.GlobalWorkerOptions.workerPort};pt=gt.port?PDFWorker.fromPort(gt):new PDFWorker(gt),e._worker=pt}const ot={docId:u,apiVersion:"3.7.107",data:i,password:K,disableAutoFetch:h,rangeChunkSize:nt,length:b,docBaseUrl:ut,enableXfa:C,evaluatorOptions:{maxImageSize:c,disableFontFace:B,ignoreErrors:o,isEvalSupported:v,isOffscreenCanvasSupported:O,canvasMaxAreaInBytes:D,fontExtraProperties:R,useSystemFonts:j,cMapUrl:J?At:null,standardFontDataUrl:J?wt:null}},lt={ignoreErrors:o,isEvalSupported:v,disableFontFace:B,fontExtraProperties:R,enableXfa:C,ownerDocument:k,disableAutoFetch:h,pdfBug:_,styleElement:st};return pt.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");const gt=_fetchDocument(pt,ot),vt=new Promise(function(Et){let Pt;et?Pt=new _transport_stream.PDFDataTransportStream({length:b,initialData:et.initialData,progressiveDone:et.progressiveDone,contentDispositionFilename:et.contentDispositionFilename,disableRange:t,disableStream:n},et):i||(Pt=createPDFNetworkStream({url:T,length:b,httpHeaders:M,withCredentials:U,rangeChunkSize:nt,disableRange:t,disableStream:n})),Et(Pt)});return Promise.all([gt,vt]).then(function([Et,Pt]){if(e.destroyed)throw new Error("Loading aborted");const W=new _message_handler.MessageHandler(u,Et,pt.port),mt=new WorkerTransport(W,e,Pt,lt,ct);e._transport=mt,W.send("Ready",null)})}).catch(e._capability.reject),e}async function _fetchDocument(a,e){if(a.destroyed)throw new Error("Worker was destroyed");const u=await a.messageHandler.sendWithPromise("GetDocRequest",e,e.data?[e.data.buffer]:null);if(a.destroyed)throw new Error("Worker was destroyed");return u}function getUrlProp(a){if(a instanceof URL)return a.href;try{return new URL(a,window.location).href}catch{if(_is_node.isNodeJS&&typeof a=="string")return a}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(a){if(_is_node.isNodeJS&&typeof Buffer<"u"&&a instanceof Buffer)return(0,_display_utils.deprecated)("Please provide binary data as `Uint8Array`, rather than `Buffer`."),new Uint8Array(a);if(a instanceof Uint8Array&&a.byteLength===a.buffer.byteLength)return a;if(typeof a=="string")return(0,_util.stringToBytes)(a);if(typeof a=="object"&&!isNaN(a==null?void 0:a.length)||(0,_util.isArrayBuffer)(a))return new Uint8Array(a);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const f=class f{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${fe(f,ht)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var e;this.destroyed=!0,await((e=this._transport)==null?void 0:e.destroy()),this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};ht=new WeakMap,$(f,ht,0);let PDFDocumentLoadingTask=f;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(e,u,T=!1,i=null){this.length=e,this.initialData=u,this.progressiveDone=T,this.contentDispositionFilename=i,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,u){for(const T of this._rangeListeners)T(e,u)}onDataProgress(e,u){this._readyCapability.promise.then(()=>{for(const T of this._progressListeners)T(e,u)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const u of this._progressiveReadListeners)u(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,u){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(e,u){this._pdfInfo=e,this._transport=u}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(e,u,T,i=!1){$(this,F);$(this,H);$(this,Q,null);$(this,p,!1);this._pageIndex=e,this._pageInfo=u,this._transport=T,this._stats=i?new _display_utils.StatTimer:null,this._pdfBug=i,this.commonObjs=T.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:u=this.rotate,offsetX:T=0,offsetY:i=0,dontFlip:M=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:e,rotation:u,offsetX:T,offsetY:i,dontFlip:M})}getAnnotations({intent:e="display"}={}){const u=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,u.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var e;return((e=this._transport._htmlForXfa)==null?void 0:e.children[this._pageIndex])||null}render({canvasContext:e,viewport:u,intent:T="display",annotationMode:i=_util.AnnotationMode.ENABLE,transform:M=null,background:U=null,optionalContentConfigPromise:K=null,annotationCanvasMap:et=null,pageColors:nt=null,printAnnotationStorage:pt=null}){var N,o,c;if((N=arguments[0])!=null&&N.canvasFactory)throw new Error("render no longer accepts the `canvasFactory`-option, please pass it to the `getDocument`-function instead.");(o=this._stats)==null||o.time("Overall");const rt=this._transport.getRenderingIntent(T,i,pt);ft(this,p,!1),tt(this,H,pe).call(this),K||(K=this._transport.getOptionalContentConfig());let ut=this._intentStates.get(rt.cacheKey);ut||(ut=Object.create(null),this._intentStates.set(rt.cacheKey,ut)),ut.streamReaderCancelTimeout&&(clearTimeout(ut.streamReaderCancelTimeout),ut.streamReaderCancelTimeout=null);const At=!!(rt.renderingIntent&_util.RenderingIntentFlag.PRINT);ut.displayReadyCapability||(ut.displayReadyCapability=new _util.PromiseCapability,ut.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(c=this._stats)==null||c.time("Page Request"),this._pumpOperatorList(rt));const Ct=v=>{var O,D;ut.renderTasks.delete(Tt),(this._maybeCleanupAfterRender||At)&&ft(this,p,!0),tt(this,F,se).call(this,!At),v?(Tt.capability.reject(v),this._abortOperatorList({intentState:ut,reason:v instanceof Error?v:new Error(v)})):Tt.capability.resolve(),(O=this._stats)==null||O.timeEnd("Rendering"),(D=this._stats)==null||D.timeEnd("Overall")},Tt=new InternalRenderTask({callback:Ct,params:{canvasContext:e,viewport:u,transform:M,background:U},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:et,operatorList:ut.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!At,pdfBug:this._pdfBug,pageColors:nt});(ut.renderTasks||(ut.renderTasks=new Set)).add(Tt);const wt=Tt.task;return Promise.all([ut.displayReadyCapability.promise,K]).then(([v,O])=>{var D;if(l(this,p)){Ct();return}(D=this._stats)==null||D.time("Rendering"),Tt.initializeGraphics({transparency:v,optionalContentConfig:O}),Tt.operatorListChanged()}).catch(Ct),wt}getOperatorList({intent:e="display",annotationMode:u=_util.AnnotationMode.ENABLE,printAnnotationStorage:T=null}={}){var et;function i(){U.operatorList.lastChunk&&(U.opListReadCapability.resolve(U.operatorList),U.renderTasks.delete(K))}const M=this._transport.getRenderingIntent(e,u,T,!0);let U=this._intentStates.get(M.cacheKey);U||(U=Object.create(null),this._intentStates.set(M.cacheKey,U));let K;return U.opListReadCapability||(K=Object.create(null),K.operatorListChanged=i,U.opListReadCapability=new _util.PromiseCapability,(U.renderTasks||(U.renderTasks=new Set)).add(K),U.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(et=this._stats)==null||et.time("Page Request"),this._pumpOperatorList(M)),U.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:u=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:u===!0},{highWaterMark:100,size(i){return i.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(T=>_xfa_text.XfaText.textContent(T));const u=this.streamTextContent(e);return new Promise(function(T,i){function M(){U.read().then(function({value:et,done:nt}){if(nt){T(K);return}Object.assign(K.styles,et.styles),K.items.push(...et.items),M()},i)}const U=u.getReader(),K={items:[],styles:Object.create(null)};M()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const u of this._intentStates.values())if(this._abortOperatorList({intentState:u,reason:new Error("Page was destroyed."),force:!0}),!u.opListReadCapability)for(const T of u.renderTasks)e.push(T.completed),T.cancel();return this.objs.clear(),ft(this,p,!1),tt(this,H,pe).call(this),Promise.all(e)}cleanup(e=!1){ft(this,p,!0);const u=tt(this,F,se).call(this,!1);return e&&u&&this._stats&&(this._stats=new _display_utils.StatTimer),u}_startRenderPage(e,u){var i,M;const T=this._intentStates.get(u);T&&((i=this._stats)==null||i.timeEnd("Page Request"),(M=T.displayReadyCapability)==null||M.resolve(e))}_renderPageChunk(e,u){for(let T=0,i=e.length;T<i;T++)u.operatorList.fnArray.push(e.fnArray[T]),u.operatorList.argsArray.push(e.argsArray[T]);u.operatorList.lastChunk=e.lastChunk,u.operatorList.separateAnnots=e.separateAnnots;for(const T of u.renderTasks)T.operatorListChanged();e.lastChunk&&tt(this,F,se).call(this,!0)}_pumpOperatorList({renderingIntent:e,cacheKey:u,annotationStorageMap:T}){const M=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:u,annotationStorage:T}).getReader(),U=this._intentStates.get(u);U.streamReader=M;const K=()=>{M.read().then(({value:et,done:nt})=>{if(nt){U.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(et,U),K())},et=>{if(U.streamReader=null,!this._transport.destroyed){if(U.operatorList){U.operatorList.lastChunk=!0;for(const nt of U.renderTasks)nt.operatorListChanged();tt(this,F,se).call(this,!0)}if(U.displayReadyCapability)U.displayReadyCapability.reject(et);else if(U.opListReadCapability)U.opListReadCapability.reject(et);else throw et}})};K()}_abortOperatorList({intentState:e,reason:u,force:T=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!T){if(e.renderTasks.size>0)return;if(u instanceof _display_utils.RenderingCancelledException){let i=RENDERING_CANCELLED_TIMEOUT;u.extraDelay>0&&u.extraDelay<1e3&&(i+=u.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:u,force:!0})},i);return}}if(e.streamReader.cancel(new _util.AbortException(u.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[i,M]of this._intentStates)if(M===e){this._intentStates.delete(i);break}this.cleanup()}}}get stats(){return this._stats}}Q=new WeakMap,p=new WeakMap,F=new WeakSet,se=function(e=!1){if(tt(this,H,pe).call(this),!l(this,p))return!1;if(e)return ft(this,Q,setTimeout(()=>{ft(this,Q,null),tt(this,F,se).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:u,operatorList:T}of this._intentStates.values())if(u.size>0||!T.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),ft(this,p,!1),!0},H=new WeakSet,pe=function(){l(this,Q)&&(clearTimeout(l(this,Q)),ft(this,Q,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){$(this,X,new Set);$(this,w,Promise.resolve())}postMessage(e,u){const T={data:structuredClone(e,u?{transfer:u}:null)};l(this,w).then(()=>{for(const i of l(this,X))i.call(this,T)})}addEventListener(e,u){l(this,X).add(u)}removeEventListener(e,u){l(this,X).delete(u)}terminate(){l(this,X).clear()}}X=new WeakMap,w=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_is_node.isNodeJS&&typeof commonjsRequire=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const a=(A=document==null?void 0:document.currentScript)==null?void 0:A.src;a&&(PDFWorkerUtil.fallbackWorkerSrc=a.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(a,e){let u;try{if(u=new URL(a),!u.origin||u.origin==="null")return!1}catch{return!1}const T=new URL(e,u);return u.origin===T.origin},PDFWorkerUtil.createCDNWrapper=function(a){const e=`importScripts("${a}");`;return URL.createObjectURL(new Blob([e]))}}const _PDFWorker=class _PDFWorker{constructor({name:a=null,port:e=null,verbosity:u=(0,_util.getVerbosityLevel)()}={}){if(e&&l(_PDFWorker,I).has(e))throw new Error("Cannot use more than one PDFWorker per port.");if(this.name=a,this.destroyed=!1,this.verbosity=u,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,e){l(_PDFWorker,I).set(e,this),this._initializeFromPort(e);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(a){this._port=a,this._messageHandler=new _message_handler.MessageHandler("main","worker",a),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:a}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,a)||(a=PDFWorkerUtil.createCDNWrapper(new URL(a,window.location).href));const e=new Worker(a),u=new _message_handler.MessageHandler("main","worker",e),T=()=>{e.removeEventListener("error",i),u.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},i=()=>{this._webWorker||T()};e.addEventListener("error",i),u.on("test",U=>{if(e.removeEventListener("error",i),this.destroyed){T();return}U?(this._messageHandler=u,this._port=e,this._webWorker=e,this._readyCapability.resolve(),u.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),u.destroy(),e.terminate())}),u.on("ready",U=>{if(e.removeEventListener("error",i),this.destroyed){T();return}try{M()}catch{this._setupFakeWorker()}});const M=()=>{const U=new Uint8Array;u.send("test",U,[U.buffer])};M();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then(a=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const e=new LoopbackPort;this._port=e;const u=`fake${PDFWorkerUtil.fakeWorkerId++}`,T=new _message_handler.MessageHandler(u+"_worker",u,e);a.setup(T,e);const i=new _message_handler.MessageHandler(u,u+"_worker",e);this._messageHandler=i,this._readyCapability.resolve(),i.send("configure",{verbosity:this.verbosity})}).catch(a=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${a.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),l(_PDFWorker,I).delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(a){if(!(a!=null&&a.port))throw new Error("PDFWorker.fromPort - invalid method signature.");return l(this,I).has(a.port)?l(this,I).get(a.port):new _PDFWorker(a)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var a;try{return((a=globalThis.pdfjsWorker)==null?void 0:a.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};I=new WeakMap,$(_PDFWorker,I,new WeakMap);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(e,u,T,i,M){$(this,y);$(this,L,new Map);$(this,E,new Map);$(this,m,new Map);this.messageHandler=e,this.loadingTask=u,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this._params=i,this.canvasFactory=M.canvasFactory,this.filterFactory=M.filterFactory,this.cMapReaderFactory=M.cMapReaderFactory,this.standardFontDataFactory=M.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=T,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(e,u=_util.AnnotationMode.ENABLE,T=null,i=!1){let M=_util.RenderingIntentFlag.DISPLAY,U=null;switch(e){case"any":M=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":M=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${e}`)}switch(u){case _util.AnnotationMode.DISABLE:M+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:M+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:M+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,U=(M&_util.RenderingIntentFlag.PRINT&&T instanceof _annotation_storage.PrintAnnotationStorage?T:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${u}`)}return i&&(M+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:M,cacheKey:`${M}_${_annotation_storage.AnnotationStorage.getHash(U)}`,annotationStorageMap:U}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const T of l(this,E).values())e.push(T._destroy());l(this,E).clear(),l(this,m).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const u=this.messageHandler.sendWithPromise("Terminate",null);return e.push(u),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),l(this,L).clear(),this.filterFactory.destroy(),this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:u}=this;e.on("GetReader",(T,i)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=M=>{this._lastProgress={loaded:M.loaded,total:M.total}},i.onPull=()=>{this._fullReader.read().then(function({value:M,done:U}){if(U){i.close();return}(0,_util.assert)(M instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(M),1,[M])}).catch(M=>{i.error(M)})},i.onCancel=M=>{this._fullReader.cancel(M),i.ready.catch(U=>{if(!this.destroyed)throw U})}}),e.on("ReaderHeadersReady",T=>{const i=new _util.PromiseCapability,M=this._fullReader;return M.headersReady.then(()=>{var U;(!M.isStreamingSupported||!M.isRangeSupported)&&(this._lastProgress&&((U=u.onProgress)==null||U.call(u,this._lastProgress)),M.onProgress=K=>{var et;(et=u.onProgress)==null||et.call(u,{loaded:K.loaded,total:K.total})}),i.resolve({isStreamingSupported:M.isStreamingSupported,isRangeSupported:M.isRangeSupported,contentLength:M.contentLength})},i.reject),i.promise}),e.on("GetRangeReader",(T,i)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const M=this._networkStream.getRangeReader(T.begin,T.end);if(!M){i.close();return}i.onPull=()=>{M.read().then(function({value:U,done:K}){if(K){i.close();return}(0,_util.assert)(U instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(U),1,[U])}).catch(U=>{i.error(U)})},i.onCancel=U=>{M.cancel(U),i.ready.catch(K=>{if(!this.destroyed)throw K})}}),e.on("GetDoc",({pdfInfo:T})=>{this._numPages=T.numPages,this._htmlForXfa=T.htmlForXfa,delete T.htmlForXfa,u._capability.resolve(new PDFDocumentProxy(T,this))}),e.on("DocException",function(T){let i;switch(T.name){case"PasswordException":i=new _util.PasswordException(T.message,T.code);break;case"InvalidPDFException":i=new _util.InvalidPDFException(T.message);break;case"MissingPDFException":i=new _util.MissingPDFException(T.message);break;case"UnexpectedResponseException":i=new _util.UnexpectedResponseException(T.message,T.status);break;case"UnknownErrorException":i=new _util.UnknownErrorException(T.message,T.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}u._capability.reject(i)}),e.on("PasswordRequest",T=>{if(this._passwordCapability=new _util.PromiseCapability,u.onPassword){const i=M=>{M instanceof Error?this._passwordCapability.reject(M):this._passwordCapability.resolve({password:M})};try{u.onPassword(i,T.code)}catch(M){this._passwordCapability.reject(M)}}else this._passwordCapability.reject(new _util.PasswordException(T.message,T.code));return this._passwordCapability.promise}),e.on("DataLoaded",T=>{var i;(i=u.onProgress)==null||i.call(u,{loaded:T.length,total:T.length}),this.downloadInfoCapability.resolve(T)}),e.on("StartRenderPage",T=>{if(this.destroyed)return;l(this,E).get(T.pageIndex)._startRenderPage(T.transparency,T.cacheKey)}),e.on("commonobj",([T,i,M])=>{var U;if(!this.destroyed&&!this.commonObjs.has(T))switch(i){case"Font":const K=this._params;if("error"in M){const pt=M.error;(0,_util.warn)(`Error during font loading: ${pt}`),this.commonObjs.resolve(T,pt);break}const et=K.pdfBug&&((U=globalThis.FontInspector)!=null&&U.enabled)?(pt,rt)=>globalThis.FontInspector.fontAdded(pt,rt):null,nt=new _font_loader.FontFaceObject(M,{isEvalSupported:K.isEvalSupported,disableFontFace:K.disableFontFace,ignoreErrors:K.ignoreErrors,inspectFont:et});this.fontLoader.bind(nt).catch(pt=>e.sendWithPromise("FontFallback",{id:T})).finally(()=>{!K.fontExtraProperties&&nt.data&&(nt.data=null),this.commonObjs.resolve(T,nt)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(T,M);break;default:throw new Error(`Got unknown common object type ${i}`)}}),e.on("obj",([T,i,M,U])=>{var et;if(this.destroyed)return;const K=l(this,E).get(i);if(!K.objs.has(T))switch(M){case"Image":if(K.objs.resolve(T,U),U){let nt;if(U.bitmap){const{width:pt,height:rt}=U;nt=pt*rt*4}else nt=((et=U.data)==null?void 0:et.length)||0;nt>_util.MAX_IMAGE_SIZE_TO_CACHE&&(K._maybeCleanupAfterRender=!0)}break;case"Pattern":K.objs.resolve(T,U);break;default:throw new Error(`Got unknown object type ${M}`)}}),e.on("DocProgress",T=>{var i;this.destroyed||(i=u.onProgress)==null||i.call(u,{loaded:T.loaded,total:T.total})}),e.on("FetchBuiltInCMap",T=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(T):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),e.on("FetchStandardFontData",T=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(T):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var e;return this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead."),this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:((e=this._fullReader)==null?void 0:e.filename)??null}).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const u=e-1,T=l(this,m).get(u);if(T)return T;const i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:u}).then(M=>{if(this.destroyed)throw new Error("Transport destroyed");const U=new PDFPageProxy(u,M,this,this._params.pdfBug);return l(this,E).set(u,U),U});return l(this,m).set(u,i),i}getPageIndex(e){return typeof e!="object"||e===null||!Number.isInteger(e.num)||e.num<0||!Number.isInteger(e.gen)||e.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen})}getAnnotations(e,u){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:u})}getFieldObjects(){return tt(this,y,ve).call(this,"GetFieldObjects")}hasJSActions(){return tt(this,y,ve).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(e=>new _optional_content_config.OptionalContentConfig(e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",u=l(this,L).get(e);if(u)return u;const T=this.messageHandler.sendWithPromise(e,null).then(i=>{var M,U;return{info:i[0],metadata:i[1]?new _metadata.Metadata(i[1]):null,contentDispositionFilename:((M=this._fullReader)==null?void 0:M.filename)??null,contentLength:((U=this._fullReader)==null?void 0:U.contentLength)??null}});return l(this,L).set(e,T),T}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const u of l(this,E).values())if(!u.cleanup())throw new Error(`startCleanup: Page ${u.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),l(this,L).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:e,enableXfa:u}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:e,enableXfa:u})}}L=new WeakMap,E=new WeakMap,m=new WeakMap,y=new WeakSet,ve=function(e,u=null){const T=l(this,L).get(e);if(T)return T;const i=this.messageHandler.sendWithPromise(e,u);return l(this,L).set(e,i),i};class PDFObjects{constructor(){$(this,P);$(this,S,Object.create(null))}get(e,u=null){if(u){const i=tt(this,P,Se).call(this,e);return i.capability.promise.then(()=>u(i.data)),null}const T=l(this,S)[e];if(!(T!=null&&T.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${e}.`);return T.data}has(e){const u=l(this,S)[e];return(u==null?void 0:u.capability.settled)||!1}resolve(e,u=null){const T=tt(this,P,Se).call(this,e);T.data=u,T.capability.resolve()}clear(){var e;for(const u in l(this,S)){const{data:T}=l(this,S)[u];(e=T==null?void 0:T.bitmap)==null||e.close()}ft(this,S,Object.create(null))}}S=new WeakMap,P=new WeakSet,Se=function(e){const u=l(this,S)[e];return u||(l(this,S)[e]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(e){$(this,g,null);ft(this,g,e),this.onContinue=null}get promise(){return l(this,g).capability.promise}cancel(e=0){l(this,g).cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=l(this,g).operatorList;if(!e)return!1;const{annotationCanvasMap:u}=l(this,g);return e.form||e.canvas&&(u==null?void 0:u.size)>0}}g=new WeakMap,exports.RenderTask=RenderTask;const r=class r{constructor({callback:e,params:u,objs:T,commonObjs:i,annotationCanvasMap:M,operatorList:U,pageIndex:K,canvasFactory:et,filterFactory:nt,useRequestAnimationFrame:pt=!1,pdfBug:rt=!1,pageColors:ut=null}){this.callback=e,this.params=u,this.objs=T,this.commonObjs=i,this.annotationCanvasMap=M,this.operatorListIdx=null,this.operatorList=U,this._pageIndex=K,this.canvasFactory=et,this.filterFactory=nt,this._pdfBug=rt,this.pageColors=ut,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=pt===!0&&typeof window<"u",this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=u.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:u}){var K,et;if(this.cancelled)return;if(this._canvas){if(l(r,s).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");l(r,s).add(this._canvas)}this._pdfBug&&((K=globalThis.StepperManager)!=null&&K.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:T,viewport:i,transform:M,background:U}=this.params;this.gfx=new _canvas.CanvasGraphics(T,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:u},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:M,viewport:i,transparency:e,background:U}),this.operatorListIdx=0,this.graphicsReady=!0,(et=this.graphicsReadyCallback)==null||et.call(this)}cancel(e=null,u=0){var T;this.running=!1,this.cancelled=!0,(T=this.gfx)==null||T.endDrawing(),this._canvas&&l(r,s).delete(this._canvas),this.callback(e||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas",u))}operatorListChanged(){var e;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(e=this.stepper)==null||e.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(this.pageColors),this._canvas&&l(r,s).delete(this._canvas),this.callback())))}};s=new WeakMap,$(r,s,new WeakSet);let InternalRenderTask=r;const version="3.7.107";exports.version=version;const build="036f855dc";exports.build=build},(ht,f,Q)=>{var X,w,A,Ge,L;Object.defineProperty(f,"__esModule",{value:!0}),f.PrintAnnotationStorage=f.AnnotationStorage=void 0;var p=Q(1),F=Q(4),z=Q(8);class H{constructor(){$(this,A);$(this,X,!1);$(this,w,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(m,y){const d=l(this,w).get(m);return d===void 0?y:Object.assign(y,d)}getRawValue(m){return l(this,w).get(m)}remove(m){if(l(this,w).delete(m),l(this,w).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const y of l(this,w).values())if(y instanceof F.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(m,y){const d=l(this,w).get(m);let S=!1;if(d!==void 0)for(const[P,x]of Object.entries(y))d[P]!==x&&(S=!0,d[P]=x);else S=!0,l(this,w).set(m,y);S&&tt(this,A,Ge).call(this),y instanceof F.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(y.constructor._type)}has(m){return l(this,w).has(m)}getAll(){return l(this,w).size>0?(0,p.objectFromMap)(l(this,w)):null}setAll(m){for(const[y,d]of Object.entries(m))this.setValue(y,d)}get size(){return l(this,w).size}resetModified(){l(this,X)&&(ft(this,X,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new at(this)}get serializable(){if(l(this,w).size===0)return null;const m=new Map;for(const[y,d]of l(this,w)){const S=d instanceof F.AnnotationEditor?d.serialize():d;S&&m.set(y,S)}return m}static getHash(m){if(!m)return"";const y=new z.MurmurHash3_64;for(const[d,S]of m)y.update(`${d}:${JSON.stringify(S)}`);return y.hexdigest()}}X=new WeakMap,w=new WeakMap,A=new WeakSet,Ge=function(){l(this,X)||(ft(this,X,!0),typeof this.onSetModified=="function"&&this.onSetModified())},f.AnnotationStorage=H;class at extends H{constructor(y){super();$(this,L,null);ft(this,L,structuredClone(y.serializable))}get print(){(0,p.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return l(this,L)}}L=new WeakMap,f.PrintAnnotationStorage=at},(ht,f,Q)=>{var H,at,X,w,A,I;Object.defineProperty(f,"__esModule",{value:!0}),f.AnnotationEditor=void 0;var p=Q(5),F=Q(1);const L=class L{constructor(m){$(this,H,this.focusin.bind(this));$(this,at,this.focusout.bind(this));$(this,X,!1);$(this,w,!1);$(this,A,!1);Ut(this,"_uiManager",null);$(this,I,L._zIndex++);this.constructor===L&&(0,F.unreachable)("Cannot initialize AnnotationEditor."),this.parent=m.parent,this.id=m.id,this.width=this.height=null,this.pageIndex=m.parent.pageIndex,this.name=m.name,this.div=null,this._uiManager=m.uiManager;const{rotation:y,rawDims:{pageWidth:d,pageHeight:S,pageX:P,pageY:x}}=this.parent.viewport;this.rotation=y,this.pageRotation=(360+y-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[d,S],this.pageTranslation=[P,x];const[g,s]=this.parentDimensions;this.x=m.x/g,this.y=m.y/s,this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,F.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}addCommands(m){this._uiManager.addCommands(m)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=l(this,I)}setParent(m){m!==null&&(this.pageIndex=m.pageIndex,this.pageDimensions=m.pageDimensions),this.parent=m}focusin(m){l(this,X)?ft(this,X,!1):this.parent.setSelected(this)}focusout(m){var d;if(!this.isAttachedToDOM)return;const y=m.relatedTarget;y!=null&&y.closest(`#${this.id}`)||(m.preventDefault(),(d=this.parent)!=null&&d.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}dragstart(m){const y=this.parent.div.getBoundingClientRect();this.startX=m.clientX-y.x,this.startY=m.clientY-y.y,m.dataTransfer.setData("text/plain",this.id),m.dataTransfer.effectAllowed="move"}setAt(m,y,d,S){const[P,x]=this.parentDimensions;[d,S]=this.screenToPageTranslation(d,S),this.x=(m+d)/P,this.y=(y+S)/x,this.div.style.left=`${100*this.x}%`,this.div.style.top=`${100*this.y}%`}translate(m,y){const[d,S]=this.parentDimensions;[m,y]=this.screenToPageTranslation(m,y),this.x+=m/d,this.y+=y/S,this.div.style.left=`${100*this.x}%`,this.div.style.top=`${100*this.y}%`}screenToPageTranslation(m,y){switch(this.parentRotation){case 90:return[y,-m];case 180:return[-m,-y];case 270:return[-y,m];default:return[m,y]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{realScale:m}=this._uiManager.viewParameters,[y,d]=this.pageDimensions;return[y*m,d*m]}setDims(m,y){const[d,S]=this.parentDimensions;this.div.style.width=`${100*m/d}%`,this.div.style.height=`${100*y/S}%`}fixDims(){const{style:m}=this.div,{height:y,width:d}=m,S=d.endsWith("%"),P=y.endsWith("%");if(S&&P)return;const[x,g]=this.parentDimensions;S||(m.width=`${100*parseFloat(d)/x}%`),P||(m.height=`${100*parseFloat(y)/g}%`)}getInitialTranslation(){return[0,0]}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",l(this,H)),this.div.addEventListener("focusout",l(this,at));const[m,y]=this.getInitialTranslation();return this.translate(m,y),(0,p.bindEvents)(this,this.div,["dragstart","pointerdown"]),this.div}pointerdown(m){const{isMac:y}=F.FeatureTest.platform;if(m.button!==0||m.ctrlKey&&y){m.preventDefault();return}m.ctrlKey&&!y||m.shiftKey||m.metaKey&&y?this.parent.toggleSelected(this):this.parent.setSelected(this),ft(this,X,!0)}getRect(m,y){const d=this.parentScale,[S,P]=this.pageDimensions,[x,g]=this.pageTranslation,s=m/d,r=y/d,a=this.x*S,e=this.y*P,u=this.width*S,T=this.height*P;switch(this.rotation){case 0:return[a+s+x,P-e-r-T+g,a+s+u+x,P-e-r+g];case 90:return[a+r+x,P-e+s+g,a+r+T+x,P-e+s+u+g];case 180:return[a-s-u+x,P-e+r+g,a-s+x,P-e+r+T+g];case 270:return[a-r-T+x,P-e-s-u+g,a-r+x,P-e-s+g];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(m,y){const[d,S,P,x]=m,g=P-d,s=x-S;switch(this.rotation){case 0:return[d,y-x,g,s];case 90:return[d,y-S,s,g];case 180:return[P,y-S,g,s];case 270:return[P,y-x,s,g];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){ft(this,A,!0)}disableEditMode(){ft(this,A,!1)}isInEditMode(){return l(this,A)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var m;(m=this.div)==null||m.addEventListener("focusin",l(this,H))}serialize(){(0,F.unreachable)("An editor must be serializable")}static deserialize(m,y,d){const S=new this.prototype.constructor({parent:y,id:y.getNextId(),uiManager:d});S.rotation=m.rotation;const[P,x]=S.pageDimensions,[g,s,r,a]=S.getRectInCurrentCoords(m.rect,x);return S.x=g/P,S.y=s/x,S.width=r/P,S.height=a/x,S}remove(){this.div.removeEventListener("focusin",l(this,H)),this.div.removeEventListener("focusout",l(this,at)),this.isEmpty()||this.commit(),this.parent.remove(this)}select(){var m;(m=this.div)==null||m.classList.add("selectedEditor")}unselect(){var m;(m=this.div)==null||m.classList.remove("selectedEditor")}updateParams(m,y){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return l(this,w)}set isEditing(m){ft(this,w,m),m?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null)}};H=new WeakMap,at=new WeakMap,X=new WeakMap,w=new WeakMap,A=new WeakMap,I=new WeakMap,Ut(L,"_colorManager",new p.ColorManager),Ut(L,"_zIndex",1);let z=L;f.AnnotationEditor=z},(ht,f,Q)=>{var L,E,m,y,d,S,qe,g,s,r,a,e,u,T,i,M,U,K,et,nt,pt,rt,ut,At,Ct,Tt,wt,N,o,c,v,Xe,D,Ee,R,Ve,k,ze,n,$t,_,ae,j,$e,Y,Ye,st,Ce,ot,oe,gt,Te;Object.defineProperty(f,"__esModule",{value:!0}),f.KeyboardManager=f.CommandManager=f.ColorManager=f.AnnotationEditorUIManager=void 0,f.bindEvents=z,f.opacityToHex=H;var p=Q(1),F=Q(6);function z(Pt,W,mt){for(const Ft of mt)W.addEventListener(Ft,Pt[Ft].bind(Pt))}function H(Pt){return Math.round(Math.min(255,Math.max(1,255*Pt))).toString(16).padStart(2,"0")}class at{constructor(){$(this,L,0)}getId(){return`${p.AnnotationEditorPrefix}${fe(this,L)._++}`}}L=new WeakMap;class X{constructor(W=128){$(this,E,[]);$(this,m,!1);$(this,y,void 0);$(this,d,-1);ft(this,y,W)}add({cmd:W,undo:mt,mustExec:Ft,type:Mt=NaN,overwriteIfSameType:it=!1,keepUndo:G=!1}){if(Ft&&W(),l(this,m))return;const q={cmd:W,undo:mt,type:Mt};if(l(this,d)===-1){l(this,E).length>0&&(l(this,E).length=0),ft(this,d,0),l(this,E).push(q);return}if(it&&l(this,E)[l(this,d)].type===Mt){G&&(q.undo=l(this,E)[l(this,d)].undo),l(this,E)[l(this,d)]=q;return}const bt=l(this,d)+1;bt===l(this,y)?l(this,E).splice(0,1):(ft(this,d,bt),bt<l(this,E).length&&l(this,E).splice(bt)),l(this,E).push(q)}undo(){l(this,d)!==-1&&(ft(this,m,!0),l(this,E)[l(this,d)].undo(),ft(this,m,!1),ft(this,d,l(this,d)-1))}redo(){l(this,d)<l(this,E).length-1&&(ft(this,d,l(this,d)+1),ft(this,m,!0),l(this,E)[l(this,d)].cmd(),ft(this,m,!1))}hasSomethingToUndo(){return l(this,d)!==-1}hasSomethingToRedo(){return l(this,d)<l(this,E).length-1}destroy(){ft(this,E,null)}}E=new WeakMap,m=new WeakMap,y=new WeakMap,d=new WeakMap,f.CommandManager=X;class w{constructor(W){$(this,S);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:mt}=p.FeatureTest.platform;for(const[Ft,Mt]of W)for(const it of Ft){const G=it.startsWith("mac+");mt&&G?(this.callbacks.set(it.slice(4),Mt),this.allKeys.add(it.split("+").at(-1))):!mt&&!G&&(this.callbacks.set(it,Mt),this.allKeys.add(it.split("+").at(-1)))}}exec(W,mt){if(!this.allKeys.has(mt.key))return;const Ft=this.callbacks.get(tt(this,S,qe).call(this,mt));Ft&&(Ft.bind(W)(),mt.stopPropagation(),mt.preventDefault())}}S=new WeakSet,qe=function(W){W.altKey&&this.buffer.push("alt"),W.ctrlKey&&this.buffer.push("ctrl"),W.metaKey&&this.buffer.push("meta"),W.shiftKey&&this.buffer.push("shift"),this.buffer.push(W.key);const mt=this.buffer.join("+");return this.buffer.length=0,mt},f.KeyboardManager=w;const x=class x{get _colors(){const W=new Map([["CanvasText",null],["Canvas",null]]);return(0,F.getColorValues)(W),(0,p.shadow)(this,"_colors",W)}convert(W){const mt=(0,F.getRGB)(W);if(!window.matchMedia("(forced-colors: active)").matches)return mt;for(const[Ft,Mt]of this._colors)if(Mt.every((it,G)=>it===mt[G]))return x._colorsMapping.get(Ft);return mt}getHexCode(W){const mt=this._colors.get(W);return mt?p.Util.makeHexColor(...mt):W}};Ut(x,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let A=x;f.ColorManager=A;const Et=class Et{constructor(W,mt,Ft){$(this,v);$(this,D);$(this,R);$(this,k);$(this,n);$(this,_);$(this,j);$(this,Y);$(this,st);$(this,ot);$(this,gt);$(this,g,null);$(this,s,new Map);$(this,r,new Map);$(this,a,null);$(this,e,new X);$(this,u,0);$(this,T,null);$(this,i,new Set);$(this,M,null);$(this,U,new at);$(this,K,!1);$(this,et,p.AnnotationEditorType.NONE);$(this,nt,new Set);$(this,pt,this.copy.bind(this));$(this,rt,this.cut.bind(this));$(this,ut,this.paste.bind(this));$(this,At,this.keydown.bind(this));$(this,Ct,this.onEditingAction.bind(this));$(this,Tt,this.onPageChanging.bind(this));$(this,wt,this.onScaleChanging.bind(this));$(this,N,this.onRotationChanging.bind(this));$(this,o,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});$(this,c,null);ft(this,c,W),ft(this,M,mt),l(this,M)._on("editingaction",l(this,Ct)),l(this,M)._on("pagechanging",l(this,Tt)),l(this,M)._on("scalechanging",l(this,wt)),l(this,M)._on("rotationchanging",l(this,N)),ft(this,a,Ft),this.viewParameters={realScale:F.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){tt(this,D,Ee).call(this),l(this,M)._off("editingaction",l(this,Ct)),l(this,M)._off("pagechanging",l(this,Tt)),l(this,M)._off("scalechanging",l(this,wt)),l(this,M)._off("rotationchanging",l(this,N));for(const W of l(this,r).values())W.destroy();l(this,r).clear(),l(this,s).clear(),l(this,i).clear(),ft(this,g,null),l(this,nt).clear(),l(this,e).destroy()}onPageChanging({pageNumber:W}){ft(this,u,W-1)}focusMainContainer(){l(this,c).focus()}addShouldRescale(W){l(this,i).add(W)}removeShouldRescale(W){l(this,i).delete(W)}onScaleChanging({scale:W}){this.commitOrRemove(),this.viewParameters.realScale=W*F.PixelsPerInch.PDF_TO_CSS_UNITS;for(const mt of l(this,i))mt.onScaleChanging()}onRotationChanging({pagesRotation:W}){this.commitOrRemove(),this.viewParameters.rotation=W}addToAnnotationStorage(W){!W.isEmpty()&&l(this,a)&&!l(this,a).has(W.id)&&l(this,a).setValue(W.id,W)}copy(W){if(W.preventDefault(),l(this,g)&&l(this,g).commitOrRemove(),!this.hasSelection)return;const mt=[];for(const Ft of l(this,nt))Ft.isEmpty()||mt.push(Ft.serialize());mt.length!==0&&W.clipboardData.setData("application/pdfjs",JSON.stringify(mt))}cut(W){this.copy(W),this.delete()}paste(W){W.preventDefault();let mt=W.clipboardData.getData("application/pdfjs");if(!mt)return;try{mt=JSON.parse(mt)}catch(Mt){(0,p.warn)(`paste: "${Mt.message}".`);return}if(!Array.isArray(mt))return;this.unselectAll();const Ft=l(this,r).get(l(this,u));try{const Mt=[];for(const q of mt){const bt=Ft.deserialize(q);if(!bt)return;Mt.push(bt)}const it=()=>{for(const q of Mt)tt(this,st,Ce).call(this,q);tt(this,gt,Te).call(this,Mt)},G=()=>{for(const q of Mt)q.remove()};this.addCommands({cmd:it,undo:G,mustExec:!0})}catch(Mt){(0,p.warn)(`paste: "${Mt.message}".`)}}keydown(W){var mt;(mt=this.getActive())!=null&&mt.shouldGetKeyboardEvents()||Et._keyboardManager.exec(this,W)}onEditingAction(W){["undo","redo","delete","selectAll"].includes(W.name)&&this[W.name]()}setEditingState(W){W?(tt(this,v,Xe).call(this),tt(this,R,Ve).call(this),tt(this,n,$t).call(this,{isEditing:l(this,et)!==p.AnnotationEditorType.NONE,isEmpty:tt(this,ot,oe).call(this),hasSomethingToUndo:l(this,e).hasSomethingToUndo(),hasSomethingToRedo:l(this,e).hasSomethingToRedo(),hasSelectedEditor:!1})):(tt(this,D,Ee).call(this),tt(this,k,ze).call(this),tt(this,n,$t).call(this,{isEditing:!1}))}registerEditorTypes(W){if(!l(this,T)){ft(this,T,W);for(const mt of l(this,T))tt(this,_,ae).call(this,mt.defaultPropertiesToUpdate)}}getId(){return l(this,U).getId()}get currentLayer(){return l(this,r).get(l(this,u))}get currentPageIndex(){return l(this,u)}addLayer(W){l(this,r).set(W.pageIndex,W),l(this,K)?W.enable():W.disable()}removeLayer(W){l(this,r).delete(W.pageIndex)}updateMode(W){if(ft(this,et,W),W===p.AnnotationEditorType.NONE)this.setEditingState(!1),tt(this,Y,Ye).call(this);else{this.setEditingState(!0),tt(this,j,$e).call(this);for(const mt of l(this,r).values())mt.updateMode(W)}}updateToolbar(W){W!==l(this,et)&&l(this,M).dispatch("switchannotationeditormode",{source:this,mode:W})}updateParams(W,mt){if(l(this,T)){for(const Ft of l(this,nt))Ft.updateParams(W,mt);for(const Ft of l(this,T))Ft.updateDefaultParams(W,mt)}}getEditors(W){const mt=[];for(const Ft of l(this,s).values())Ft.pageIndex===W&&mt.push(Ft);return mt}getEditor(W){return l(this,s).get(W)}addEditor(W){l(this,s).set(W.id,W)}removeEditor(W){var mt;l(this,s).delete(W.id),this.unselect(W),(mt=l(this,a))==null||mt.remove(W.id)}setActiveEditor(W){l(this,g)!==W&&(ft(this,g,W),W&&tt(this,_,ae).call(this,W.propertiesToUpdate))}toggleSelected(W){if(l(this,nt).has(W)){l(this,nt).delete(W),W.unselect(),tt(this,n,$t).call(this,{hasSelectedEditor:this.hasSelection});return}l(this,nt).add(W),W.select(),tt(this,_,ae).call(this,W.propertiesToUpdate),tt(this,n,$t).call(this,{hasSelectedEditor:!0})}setSelected(W){for(const mt of l(this,nt))mt!==W&&mt.unselect();l(this,nt).clear(),l(this,nt).add(W),W.select(),tt(this,_,ae).call(this,W.propertiesToUpdate),tt(this,n,$t).call(this,{hasSelectedEditor:!0})}isSelected(W){return l(this,nt).has(W)}unselect(W){W.unselect(),l(this,nt).delete(W),tt(this,n,$t).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return l(this,nt).size!==0}undo(){l(this,e).undo(),tt(this,n,$t).call(this,{hasSomethingToUndo:l(this,e).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:tt(this,ot,oe).call(this)})}redo(){l(this,e).redo(),tt(this,n,$t).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:l(this,e).hasSomethingToRedo(),isEmpty:tt(this,ot,oe).call(this)})}addCommands(W){l(this,e).add(W),tt(this,n,$t).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:tt(this,ot,oe).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const W=[...l(this,nt)],mt=()=>{for(const Mt of W)Mt.remove()},Ft=()=>{for(const Mt of W)tt(this,st,Ce).call(this,Mt)};this.addCommands({cmd:mt,undo:Ft,mustExec:!0})}commitOrRemove(){var W;(W=l(this,g))==null||W.commitOrRemove()}selectAll(){for(const W of l(this,nt))W.commit();tt(this,gt,Te).call(this,l(this,s).values())}unselectAll(){if(l(this,g)){l(this,g).commitOrRemove();return}if(l(this,nt).size!==0){for(const W of l(this,nt))W.unselect();l(this,nt).clear(),tt(this,n,$t).call(this,{hasSelectedEditor:!1})}}isActive(W){return l(this,g)===W}getActive(){return l(this,g)}getMode(){return l(this,et)}};g=new WeakMap,s=new WeakMap,r=new WeakMap,a=new WeakMap,e=new WeakMap,u=new WeakMap,T=new WeakMap,i=new WeakMap,M=new WeakMap,U=new WeakMap,K=new WeakMap,et=new WeakMap,nt=new WeakMap,pt=new WeakMap,rt=new WeakMap,ut=new WeakMap,At=new WeakMap,Ct=new WeakMap,Tt=new WeakMap,wt=new WeakMap,N=new WeakMap,o=new WeakMap,c=new WeakMap,v=new WeakSet,Xe=function(){l(this,c).addEventListener("keydown",l(this,At))},D=new WeakSet,Ee=function(){l(this,c).removeEventListener("keydown",l(this,At))},R=new WeakSet,Ve=function(){document.addEventListener("copy",l(this,pt)),document.addEventListener("cut",l(this,rt)),document.addEventListener("paste",l(this,ut))},k=new WeakSet,ze=function(){document.removeEventListener("copy",l(this,pt)),document.removeEventListener("cut",l(this,rt)),document.removeEventListener("paste",l(this,ut))},n=new WeakSet,$t=function(W){Object.entries(W).some(([Ft,Mt])=>l(this,o)[Ft]!==Mt)&&l(this,M).dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(l(this,o),W)})},_=new WeakSet,ae=function(W){l(this,M).dispatch("annotationeditorparamschanged",{source:this,details:W})},j=new WeakSet,$e=function(){if(!l(this,K)){ft(this,K,!0);for(const W of l(this,r).values())W.enable()}},Y=new WeakSet,Ye=function(){if(this.unselectAll(),l(this,K)){ft(this,K,!1);for(const W of l(this,r).values())W.disable()}},st=new WeakSet,Ce=function(W){const mt=l(this,r).get(W.pageIndex);mt?mt.addOrRebuild(W):this.addEditor(W)},ot=new WeakSet,oe=function(){if(l(this,s).size===0)return!0;if(l(this,s).size===1)for(const W of l(this,s).values())return W.isEmpty();return!1},gt=new WeakSet,Te=function(W){l(this,nt).clear();for(const mt of W)mt.isEmpty()||(l(this,nt).add(mt),mt.select());tt(this,n,$t).call(this,{hasSelectedEditor:!0})},Ut(Et,"_keyboardManager",new w([[["ctrl+a","mac+meta+a"],Et.prototype.selectAll],[["ctrl+z","mac+meta+z"],Et.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],Et.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],Et.prototype.delete],[["Escape","mac+Escape"],Et.prototype.unselectAll]]));let I=Et;f.AnnotationEditorUIManager=I},(ht,f,Q)=>{var pt,rt,ut,At,Ct,Tt,wt,N,o,ne,v,Zt,D,Yt;Object.defineProperty(f,"__esModule",{value:!0}),f.StatTimer=f.RenderingCancelledException=f.PixelsPerInch=f.PageViewport=f.PDFDateString=f.DOMStandardFontDataFactory=f.DOMSVGFactory=f.DOMFilterFactory=f.DOMCanvasFactory=f.DOMCMapReaderFactory=f.AnnotationPrefix=void 0,f.deprecated=a,f.getColorValues=M,f.getCurrentTransform=U,f.getCurrentTransformInverse=K,f.getFilenameFromUrl=P,f.getPdfFilenameFromUrl=x,f.getRGB=i,f.getXfaPageViewport=T,f.isDataScheme=d,f.isPdfFile=S,f.isValidFetchUrl=s,f.loadScript=r,f.setLayerDimensions=et;var p=Q(7),F=Q(1);const z="http://www.w3.org/2000/svg",H="pdfjs_internal_id_";f.AnnotationPrefix=H;const nt=class nt{};Ut(nt,"CSS",96),Ut(nt,"PDF",72),Ut(nt,"PDF_TO_CSS_UNITS",nt.CSS/nt.PDF);let at=nt;f.PixelsPerInch=at;class X extends p.BaseFilterFactory{constructor({docId:k,ownerDocument:t=globalThis.document}={}){super();$(this,o);$(this,v);$(this,D);$(this,pt,void 0);$(this,rt,void 0);$(this,ut,void 0);$(this,At,void 0);$(this,Ct,void 0);$(this,Tt,void 0);$(this,wt,void 0);$(this,N,0);ft(this,ut,k),ft(this,At,t)}addFilter(k){if(!k)return"none";let t=l(this,o,ne).get(k);if(t)return t;let n,h,_,b;if(k.length===1){const st=k[0],ct=new Array(256);for(let ot=0;ot<256;ot++)ct[ot]=st[ot]/255;b=n=h=_=ct.join(",")}else{const[st,ct,ot]=k,lt=new Array(256),gt=new Array(256),vt=new Array(256);for(let Et=0;Et<256;Et++)lt[Et]=st[Et]/255,gt[Et]=ct[Et]/255,vt[Et]=ot[Et]/255;n=lt.join(","),h=gt.join(","),_=vt.join(","),b=`${n}${h}${_}`}if(t=l(this,o,ne).get(b),t)return l(this,o,ne).set(k,t),t;const j=`g_${l(this,ut)}_transfer_map_${fe(this,N)._++}`,J=`url(#${j})`;l(this,o,ne).set(k,J),l(this,o,ne).set(b,J);const Y=l(this,At).createElementNS(z,"filter",z);Y.setAttribute("id",j),Y.setAttribute("color-interpolation-filters","sRGB");const Z=l(this,At).createElementNS(z,"feComponentTransfer");return Y.append(Z),tt(this,D,Yt).call(this,Z,"feFuncR",n),tt(this,D,Yt).call(this,Z,"feFuncG",h),tt(this,D,Yt).call(this,Z,"feFuncB",_),l(this,v,Zt).append(Y),J}addHCMFilter(k,t){var ot;const n=`${k}-${t}`;if(l(this,Tt)===n)return l(this,wt);if(ft(this,Tt,n),ft(this,wt,"none"),(ot=l(this,Ct))==null||ot.remove(),!k||!t)return l(this,wt);l(this,v,Zt).style.color=k,k=getComputedStyle(l(this,v,Zt)).getPropertyValue("color");const h=i(k);k=F.Util.makeHexColor(...h),l(this,v,Zt).style.color=t,t=getComputedStyle(l(this,v,Zt)).getPropertyValue("color");const _=i(t);if(t=F.Util.makeHexColor(..._),l(this,v,Zt).style.color="",k==="#000000"&&t==="#ffffff"||k===t)return l(this,wt);const b=new Array(256);for(let lt=0;lt<=255;lt++){const gt=lt/255;b[lt]=gt<=.03928?gt/12.92:((gt+.055)/1.055)**2.4}const j=b.join(","),J=`g_${l(this,ut)}_hcm_filter`,Y=ft(this,Ct,l(this,At).createElementNS(z,"filter",z));Y.setAttribute("id",J),Y.setAttribute("color-interpolation-filters","sRGB");let Z=l(this,At).createElementNS(z,"feComponentTransfer");Y.append(Z),tt(this,D,Yt).call(this,Z,"feFuncR",j),tt(this,D,Yt).call(this,Z,"feFuncG",j),tt(this,D,Yt).call(this,Z,"feFuncB",j);const st=l(this,At).createElementNS(z,"feColorMatrix");st.setAttribute("type","matrix"),st.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),Y.append(st),Z=l(this,At).createElementNS(z,"feComponentTransfer"),Y.append(Z);const ct=(lt,gt)=>{const vt=h[lt]/255,Et=_[lt]/255,Pt=new Array(gt+1);for(let W=0;W<=gt;W++)Pt[W]=vt+W/gt*(Et-vt);return Pt.join(",")};return tt(this,D,Yt).call(this,Z,"feFuncR",ct(0,5)),tt(this,D,Yt).call(this,Z,"feFuncG",ct(1,5)),tt(this,D,Yt).call(this,Z,"feFuncB",ct(2,5)),l(this,v,Zt).append(Y),ft(this,wt,`url(#${J})`),l(this,wt)}destroy(k=!1){k&&l(this,wt)||(l(this,rt)&&(l(this,rt).parentNode.parentNode.remove(),ft(this,rt,null)),l(this,pt)&&(l(this,pt).clear(),ft(this,pt,null)),ft(this,N,0))}}pt=new WeakMap,rt=new WeakMap,ut=new WeakMap,At=new WeakMap,Ct=new WeakMap,Tt=new WeakMap,wt=new WeakMap,N=new WeakMap,o=new WeakSet,ne=function(){return l(this,pt)||ft(this,pt,new Map)},v=new WeakSet,Zt=function(){if(!l(this,rt)){const k=l(this,At).createElement("div"),{style:t}=k;t.visibility="hidden",t.contain="strict",t.width=t.height=0,t.position="absolute",t.top=t.left=0,t.zIndex=-1;const n=l(this,At).createElementNS(z,"svg");n.setAttribute("width",0),n.setAttribute("height",0),ft(this,rt,l(this,At).createElementNS(z,"defs")),k.append(n),n.append(l(this,rt)),l(this,At).body.append(k)}return l(this,rt)},D=new WeakSet,Yt=function(k,t,n){const h=l(this,At).createElementNS(z,t);h.setAttribute("type","discrete"),h.setAttribute("tableValues",n),k.append(h)},f.DOMFilterFactory=X;class w extends p.BaseCanvasFactory{constructor({ownerDocument:C=globalThis.document}={}){super(),this._document=C}_createCanvas(C,k){const t=this._document.createElement("canvas");return t.width=C,t.height=k,t}}f.DOMCanvasFactory=w;async function A(R,C=!1){if(s(R,document.baseURI)){const k=await fetch(R);if(!k.ok)throw new Error(k.statusText);return C?new Uint8Array(await k.arrayBuffer()):(0,F.stringToBytes)(await k.text())}return new Promise((k,t)=>{const n=new XMLHttpRequest;n.open("GET",R,!0),C&&(n.responseType="arraybuffer"),n.onreadystatechange=()=>{if(n.readyState===XMLHttpRequest.DONE){if(n.status===200||n.status===0){let h;if(C&&n.response?h=new Uint8Array(n.response):!C&&n.responseText&&(h=(0,F.stringToBytes)(n.responseText)),h){k(h);return}}t(new Error(n.statusText))}},n.send(null)})}class I extends p.BaseCMapReaderFactory{_fetchData(C,k){return A(C,this.isCompressed).then(t=>({cMapData:t,compressionType:k}))}}f.DOMCMapReaderFactory=I;class L extends p.BaseStandardFontDataFactory{_fetchData(C){return A(C,!0)}}f.DOMStandardFontDataFactory=L;class E extends p.BaseSVGFactory{_createSVG(C){return document.createElementNS(z,C)}}f.DOMSVGFactory=E;class m{constructor({viewBox:C,scale:k,rotation:t,offsetX:n=0,offsetY:h=0,dontFlip:_=!1}){this.viewBox=C,this.scale=k,this.rotation=t,this.offsetX=n,this.offsetY=h;const b=(C[2]+C[0])/2,j=(C[3]+C[1])/2;let J,Y,Z,st;switch(t%=360,t<0&&(t+=360),t){case 180:J=-1,Y=0,Z=0,st=1;break;case 90:J=0,Y=1,Z=1,st=0;break;case 270:J=0,Y=-1,Z=-1,st=0;break;case 0:J=1,Y=0,Z=0,st=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}_&&(Z=-Z,st=-st);let ct,ot,lt,gt;J===0?(ct=Math.abs(j-C[1])*k+n,ot=Math.abs(b-C[0])*k+h,lt=(C[3]-C[1])*k,gt=(C[2]-C[0])*k):(ct=Math.abs(b-C[0])*k+n,ot=Math.abs(j-C[1])*k+h,lt=(C[2]-C[0])*k,gt=(C[3]-C[1])*k),this.transform=[J*k,Y*k,Z*k,st*k,ct-J*k*b-Z*k*j,ot-Y*k*b-st*k*j],this.width=lt,this.height=gt}get rawDims(){const{viewBox:C}=this;return(0,F.shadow)(this,"rawDims",{pageWidth:C[2]-C[0],pageHeight:C[3]-C[1],pageX:C[0],pageY:C[1]})}clone({scale:C=this.scale,rotation:k=this.rotation,offsetX:t=this.offsetX,offsetY:n=this.offsetY,dontFlip:h=!1}={}){return new m({viewBox:this.viewBox.slice(),scale:C,rotation:k,offsetX:t,offsetY:n,dontFlip:h})}convertToViewportPoint(C,k){return F.Util.applyTransform([C,k],this.transform)}convertToViewportRectangle(C){const k=F.Util.applyTransform([C[0],C[1]],this.transform),t=F.Util.applyTransform([C[2],C[3]],this.transform);return[k[0],k[1],t[0],t[1]]}convertToPdfPoint(C,k){return F.Util.applyInverseTransform([C,k],this.transform)}}f.PageViewport=m;class y extends F.BaseException{constructor(C,k,t=0){super(C,"RenderingCancelledException"),this.type=k,this.extraDelay=t}}f.RenderingCancelledException=y;function d(R){const C=R.length;let k=0;for(;k<C&&R[k].trim()==="";)k++;return R.substring(k,k+5).toLowerCase()==="data:"}function S(R){return typeof R=="string"&&/\.pdf$/i.test(R)}function P(R,C=!1){return C||([R]=R.split(/[#?]/,1)),R.substring(R.lastIndexOf("/")+1)}function x(R,C="document.pdf"){if(typeof R!="string")return C;if(d(R))return(0,F.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),C;const k=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,t=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,n=k.exec(R);let h=t.exec(n[1])||t.exec(n[2])||t.exec(n[3]);if(h&&(h=h[0],h.includes("%")))try{h=t.exec(decodeURIComponent(h))[0]}catch{}return h||C}class g{constructor(){Ut(this,"started",Object.create(null));Ut(this,"times",[])}time(C){C in this.started&&(0,F.warn)(`Timer is already running for ${C}`),this.started[C]=Date.now()}timeEnd(C){C in this.started||(0,F.warn)(`Timer has not been started for ${C}`),this.times.push({name:C,start:this.started[C],end:Date.now()}),delete this.started[C]}toString(){const C=[];let k=0;for(const{name:t}of this.times)k=Math.max(t.length,k);for(const{name:t,start:n,end:h}of this.times)C.push(`${t.padEnd(k)} ${h-n}ms `);return C.join("")}}f.StatTimer=g;function s(R,C){try{const{protocol:k}=C?new URL(R,C):new URL(R);return k==="http:"||k==="https:"}catch{return!1}}function r(R,C=!1){return new Promise((k,t)=>{const n=document.createElement("script");n.src=R,n.onload=function(h){C&&n.remove(),k(h)},n.onerror=function(){t(new Error(`Cannot load script at: ${n.src}`))},(document.head||document.documentElement).append(n)})}function a(R){console.log("Deprecated API usage: "+R)}let e;class u{static toDateObject(C){if(!C||typeof C!="string")return null;e||(e=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const k=e.exec(C);if(!k)return null;const t=parseInt(k[1],10);let n=parseInt(k[2],10);n=n>=1&&n<=12?n-1:0;let h=parseInt(k[3],10);h=h>=1&&h<=31?h:1;let _=parseInt(k[4],10);_=_>=0&&_<=23?_:0;let b=parseInt(k[5],10);b=b>=0&&b<=59?b:0;let j=parseInt(k[6],10);j=j>=0&&j<=59?j:0;const J=k[7]||"Z";let Y=parseInt(k[8],10);Y=Y>=0&&Y<=23?Y:0;let Z=parseInt(k[9],10)||0;return Z=Z>=0&&Z<=59?Z:0,J==="-"?(_+=Y,b+=Z):J==="+"&&(_-=Y,b-=Z),new Date(Date.UTC(t,n,h,_,b,j))}}f.PDFDateString=u;function T(R,{scale:C=1,rotation:k=0}){const{width:t,height:n}=R.attributes.style,h=[0,0,parseInt(t),parseInt(n)];return new m({viewBox:h,scale:C,rotation:k})}function i(R){if(R.startsWith("#")){const C=parseInt(R.slice(1),16);return[(C&16711680)>>16,(C&65280)>>8,C&255]}return R.startsWith("rgb(")?R.slice(4,-1).split(",").map(C=>parseInt(C)):R.startsWith("rgba(")?R.slice(5,-1).split(",").map(C=>parseInt(C)).slice(0,3):((0,F.warn)(`Not a valid color format: "${R}"`),[0,0,0])}function M(R){const C=document.createElement("span");C.style.visibility="hidden",document.body.append(C);for(const k of R.keys()){C.style.color=k;const t=window.getComputedStyle(C).color;R.set(k,i(t))}C.remove()}function U(R){const{a:C,b:k,c:t,d:n,e:h,f:_}=R.getTransform();return[C,k,t,n,h,_]}function K(R){const{a:C,b:k,c:t,d:n,e:h,f:_}=R.getTransform().invertSelf();return[C,k,t,n,h,_]}function et(R,C,k=!1,t=!0){if(C instanceof m){const{pageWidth:n,pageHeight:h}=C.rawDims,{style:_}=R,b=`calc(var(--scale-factor) * ${n}px)`,j=`calc(var(--scale-factor) * ${h}px)`;!k||C.rotation%180===0?(_.width=b,_.height=j):(_.width=j,_.height=b)}t&&R.setAttribute("data-main-rotation",C.rotation)}},(ht,f,Q)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.BaseStandardFontDataFactory=f.BaseSVGFactory=f.BaseFilterFactory=f.BaseCanvasFactory=f.BaseCMapReaderFactory=void 0;var p=Q(1);class F{constructor(){this.constructor===F&&(0,p.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(A){return"none"}addHCMFilter(A,I){return"none"}destroy(A=!1){}}f.BaseFilterFactory=F;class z{constructor(){this.constructor===z&&(0,p.unreachable)("Cannot initialize BaseCanvasFactory.")}create(A,I){if(A<=0||I<=0)throw new Error("Invalid canvas size");const L=this._createCanvas(A,I);return{canvas:L,context:L.getContext("2d")}}reset(A,I,L){if(!A.canvas)throw new Error("Canvas is not specified");if(I<=0||L<=0)throw new Error("Invalid canvas size");A.canvas.width=I,A.canvas.height=L}destroy(A){if(!A.canvas)throw new Error("Canvas is not specified");A.canvas.width=0,A.canvas.height=0,A.canvas=null,A.context=null}_createCanvas(A,I){(0,p.unreachable)("Abstract method `_createCanvas` called.")}}f.BaseCanvasFactory=z;class H{constructor({baseUrl:A=null,isCompressed:I=!0}){this.constructor===H&&(0,p.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=A,this.isCompressed=I}async fetch({name:A}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!A)throw new Error("CMap name must be specified.");const I=this.baseUrl+A+(this.isCompressed?".bcmap":""),L=this.isCompressed?p.CMapCompressionType.BINARY:p.CMapCompressionType.NONE;return this._fetchData(I,L).catch(E=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${I}`)})}_fetchData(A,I){(0,p.unreachable)("Abstract method `_fetchData` called.")}}f.BaseCMapReaderFactory=H;class at{constructor({baseUrl:A=null}){this.constructor===at&&(0,p.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=A}async fetch({filename:A}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!A)throw new Error("Font filename must be specified.");const I=`${this.baseUrl}${A}`;return this._fetchData(I).catch(L=>{throw new Error(`Unable to load font data at: ${I}`)})}_fetchData(A){(0,p.unreachable)("Abstract method `_fetchData` called.")}}f.BaseStandardFontDataFactory=at;class X{constructor(){this.constructor===X&&(0,p.unreachable)("Cannot initialize BaseSVGFactory.")}create(A,I,L=!1){if(A<=0||I<=0)throw new Error("Invalid SVG dimensions");const E=this._createSVG("svg:svg");return E.setAttribute("version","1.1"),L||(E.setAttribute("width",`${A}px`),E.setAttribute("height",`${I}px`)),E.setAttribute("preserveAspectRatio","none"),E.setAttribute("viewBox",`0 0 ${A} ${I}`),E}createElement(A){if(typeof A!="string")throw new Error("Invalid SVG element type");return this._createSVG(A)}_createSVG(A){(0,p.unreachable)("Abstract method `_createSVG` called.")}}f.BaseSVGFactory=X},(ht,f,Q)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.MurmurHash3_64=void 0;var p=Q(1);const F=3285377520,z=4294901760,H=65535;class at{constructor(w){this.h1=w?w&4294967295:F,this.h2=w?w&4294967295:F}update(w){let A,I;if(typeof w=="string"){A=new Uint8Array(w.length*2),I=0;for(let a=0,e=w.length;a<e;a++){const u=w.charCodeAt(a);u<=255?A[I++]=u:(A[I++]=u>>>8,A[I++]=u&255)}}else if((0,p.isArrayBuffer)(w))A=w.slice(),I=A.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const L=I>>2,E=I-L*4,m=new Uint32Array(A.buffer,0,L);let y=0,d=0,S=this.h1,P=this.h2;const x=3432918353,g=461845907,s=x&H,r=g&H;for(let a=0;a<L;a++)a&1?(y=m[a],y=y*x&z|y*s&H,y=y<<15|y>>>17,y=y*g&z|y*r&H,S^=y,S=S<<13|S>>>19,S=S*5+3864292196):(d=m[a],d=d*x&z|d*s&H,d=d<<15|d>>>17,d=d*g&z|d*r&H,P^=d,P=P<<13|P>>>19,P=P*5+3864292196);switch(y=0,E){case 3:y^=A[L*4+2]<<16;case 2:y^=A[L*4+1]<<8;case 1:y^=A[L*4],y=y*x&z|y*s&H,y=y<<15|y>>>17,y=y*g&z|y*r&H,L&1?S^=y:P^=y}this.h1=S,this.h2=P}hexdigest(){let w=this.h1,A=this.h2;return w^=A>>>1,w=w*3981806797&z|w*36045&H,A=A*4283543511&z|((A<<16|w>>>16)*2950163797&z)>>>16,w^=A>>>1,w=w*444984403&z|w*60499&H,A=A*3301882366&z|((A<<16|w>>>16)*3120437893&z)>>>16,w^=A>>>1,(w>>>0).toString(16).padStart(8,"0")+(A>>>0).toString(16).padStart(8,"0")}}f.MurmurHash3_64=at},(ht,f,Q)=>{var at;Object.defineProperty(f,"__esModule",{value:!0}),f.FontLoader=f.FontFaceObject=void 0;var p=Q(1),F=Q(10);class z{constructor({ownerDocument:w=globalThis.document,styleElement:A=null}){$(this,at,new Set);this._document=w,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(w){this.nativeFontFaces.add(w),this._document.fonts.add(w)}removeNativeFontFace(w){this.nativeFontFaces.delete(w),this._document.fonts.delete(w)}insertRule(w){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const A=this.styleElement.sheet;A.insertRule(w,A.cssRules.length)}clear(){for(const w of this.nativeFontFaces)this._document.fonts.delete(w);this.nativeFontFaces.clear(),l(this,at).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(w){if(!(!w||l(this,at).has(w.loadedName))){if((0,p.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:A,src:I,style:L}=w,E=new FontFace(A,I,L);this.addNativeFontFace(E);try{await E.load(),l(this,at).add(A)}catch{(0,p.warn)(`Cannot load system font: ${w.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(E)}return}(0,p.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(w){if(w.attached||w.missingFile&&!w.systemFontInfo)return;if(w.attached=!0,w.systemFontInfo){await this.loadSystemFont(w.systemFontInfo);return}if(this.isFontLoadingAPISupported){const I=w.createNativeFontFace();if(I){this.addNativeFontFace(I);try{await I.loaded}catch(L){throw(0,p.warn)(`Failed to load font '${I.family}': '${L}'.`),w.disableFontFace=!0,L}}return}const A=w.createFontFaceRule();if(A){if(this.insertRule(A),this.isSyncFontLoadingSupported)return;await new Promise(I=>{const L=this._queueLoadingCallback(I);this._prepareFontLoadEvent(w,L)})}}get isFontLoadingAPISupported(){var A;const w=!!((A=this._document)!=null&&A.fonts);return(0,p.shadow)(this,"isFontLoadingAPISupported",w)}get isSyncFontLoadingSupported(){let w=!1;return(F.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(w=!0),(0,p.shadow)(this,"isSyncFontLoadingSupported",w)}_queueLoadingCallback(w){function A(){for((0,p.assert)(!L.done,"completeRequest() cannot be called twice."),L.done=!0;I.length>0&&I[0].done;){const E=I.shift();setTimeout(E.callback,0)}}const{loadingRequests:I}=this,L={done:!1,complete:A,callback:w};return I.push(L),L}get _loadTestFont(){const w=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,p.shadow)(this,"_loadTestFont",w)}_prepareFontLoadEvent(w,A){function I(M,U){return M.charCodeAt(U)<<24|M.charCodeAt(U+1)<<16|M.charCodeAt(U+2)<<8|M.charCodeAt(U+3)&255}function L(M,U,K,et){const nt=M.substring(0,U),pt=M.substring(U+K);return nt+et+pt}let E,m;const y=this._document.createElement("canvas");y.width=1,y.height=1;const d=y.getContext("2d");let S=0;function P(M,U){if(++S>30){(0,p.warn)("Load test font never loaded."),U();return}if(d.font="30px "+M,d.fillText(".",0,20),d.getImageData(0,0,1,1).data[3]>0){U();return}setTimeout(P.bind(null,M,U))}const x=`lt${Date.now()}${this.loadTestFontId++}`;let g=this._loadTestFont;g=L(g,976,x.length,x);const r=16,a=1482184792;let e=I(g,r);for(E=0,m=x.length-3;E<m;E+=4)e=e-a+I(x,E)|0;E<x.length&&(e=e-a+I(x+"XXX",E)|0),g=L(g,r,4,(0,p.string32)(e));const u=`url(data:font/opentype;base64,${btoa(g)});`,T=`@font-face {font-family:"${x}";src:${u}}`;this.insertRule(T);const i=this._document.createElement("div");i.style.visibility="hidden",i.style.width=i.style.height="10px",i.style.position="absolute",i.style.top=i.style.left="0px";for(const M of[w.loadedName,x]){const U=this._document.createElement("span");U.textContent="Hi",U.style.fontFamily=M,i.append(U)}this._document.body.append(i),P(x,()=>{i.remove(),A.complete()})}}at=new WeakMap,f.FontLoader=z;class H{constructor(w,{isEvalSupported:A=!0,disableFontFace:I=!1,ignoreErrors:L=!1,inspectFont:E=null}){this.compiledGlyphs=Object.create(null);for(const m in w)this[m]=w[m];this.isEvalSupported=A!==!1,this.disableFontFace=I===!0,this.ignoreErrors=L===!0,this._inspectFont=E}createNativeFontFace(){var A;if(!this.data||this.disableFontFace)return null;let w;if(!this.cssFontInfo)w=new FontFace(this.loadedName,this.data,{});else{const I={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(I.style=`oblique ${this.cssFontInfo.italicAngle}deg`),w=new FontFace(this.cssFontInfo.fontFamily,this.data,I)}return(A=this._inspectFont)==null||A.call(this,this),w}createFontFaceRule(){var L;if(!this.data||this.disableFontFace)return null;const w=(0,p.bytesToString)(this.data),A=`url(data:${this.mimetype};base64,${btoa(w)});`;let I;if(!this.cssFontInfo)I=`@font-face {font-family:"${this.loadedName}";src:${A}}`;else{let E=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(E+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),I=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${E}src:${A}}`}return(L=this._inspectFont)==null||L.call(this,this,A),I}getPathGenerator(w,A){if(this.compiledGlyphs[A]!==void 0)return this.compiledGlyphs[A];let I;try{I=w.get(this.loadedName+"_path_"+A)}catch(L){if(!this.ignoreErrors)throw L;return(0,p.warn)(`getPathGenerator - ignoring character: "${L}".`),this.compiledGlyphs[A]=function(E,m){}}if(this.isEvalSupported&&p.FeatureTest.isEvalSupported){const L=[];for(const E of I){const m=E.args!==void 0?E.args.join(","):"";L.push("c.",E.cmd,"(",m,`); `)}return this.compiledGlyphs[A]=new Function("c","size",L.join(""))}return this.compiledGlyphs[A]=function(L,E){for(const m of I)m.cmd==="scale"&&(m.args=[E,-E]),L[m.cmd].apply(L,m.args)}}}f.FontFaceObject=H},(ht,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.isNodeJS=void 0;const Q=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");f.isNodeJS=Q},(ht,f,Q)=>{var ut,we,Ct,Pe;Object.defineProperty(f,"__esModule",{value:!0}),f.CanvasGraphics=void 0;var p=Q(1),F=Q(6),z=Q(12),H=Q(13),at=Q(10);const X=16,w=100,A=4096,I=15,L=10,E=1e3,m=16;function y(N,o){if(N._removeMirroring)throw new Error("Context is already forwarding operations.");N.__originalSave=N.save,N.__originalRestore=N.restore,N.__originalRotate=N.rotate,N.__originalScale=N.scale,N.__originalTranslate=N.translate,N.__originalTransform=N.transform,N.__originalSetTransform=N.setTransform,N.__originalResetTransform=N.resetTransform,N.__originalClip=N.clip,N.__originalMoveTo=N.moveTo,N.__originalLineTo=N.lineTo,N.__originalBezierCurveTo=N.bezierCurveTo,N.__originalRect=N.rect,N.__originalClosePath=N.closePath,N.__originalBeginPath=N.beginPath,N._removeMirroring=()=>{N.save=N.__originalSave,N.restore=N.__originalRestore,N.rotate=N.__originalRotate,N.scale=N.__originalScale,N.translate=N.__originalTranslate,N.transform=N.__originalTransform,N.setTransform=N.__originalSetTransform,N.resetTransform=N.__originalResetTransform,N.clip=N.__originalClip,N.moveTo=N.__originalMoveTo,N.lineTo=N.__originalLineTo,N.bezierCurveTo=N.__originalBezierCurveTo,N.rect=N.__originalRect,N.closePath=N.__originalClosePath,N.beginPath=N.__originalBeginPath,delete N._removeMirroring},N.save=function(){o.save(),this.__originalSave()},N.restore=function(){o.restore(),this.__originalRestore()},N.translate=function(v,O){o.translate(v,O),this.__originalTranslate(v,O)},N.scale=function(v,O){o.scale(v,O),this.__originalScale(v,O)},N.transform=function(v,O,D,B,R,C){o.transform(v,O,D,B,R,C),this.__originalTransform(v,O,D,B,R,C)},N.setTransform=function(v,O,D,B,R,C){o.setTransform(v,O,D,B,R,C),this.__originalSetTransform(v,O,D,B,R,C)},N.resetTransform=function(){o.resetTransform(),this.__originalResetTransform()},N.rotate=function(v){o.rotate(v),this.__originalRotate(v)},N.clip=function(v){o.clip(v),this.__originalClip(v)},N.moveTo=function(c,v){o.moveTo(c,v),this.__originalMoveTo(c,v)},N.lineTo=function(c,v){o.lineTo(c,v),this.__originalLineTo(c,v)},N.bezierCurveTo=function(c,v,O,D,B,R){o.bezierCurveTo(c,v,O,D,B,R),this.__originalBezierCurveTo(c,v,O,D,B,R)},N.rect=function(c,v,O,D){o.rect(c,v,O,D),this.__originalRect(c,v,O,D)},N.closePath=function(){o.closePath(),this.__originalClosePath()},N.beginPath=function(){o.beginPath(),this.__originalBeginPath()}}class d{constructor(o){this.canvasFactory=o,this.cache=Object.create(null)}getCanvas(o,c,v){let O;return this.cache[o]!==void 0?(O=this.cache[o],this.canvasFactory.reset(O,c,v)):(O=this.canvasFactory.create(c,v),this.cache[o]=O),O}delete(o){delete this.cache[o]}clear(){for(const o in this.cache){const c=this.cache[o];this.canvasFactory.destroy(c),delete this.cache[o]}}}function S(N,o,c,v,O,D,B,R,C,k){const[t,n,h,_,b,j]=(0,F.getCurrentTransform)(N);if(n===0&&h===0){const Z=B*t+b,st=Math.round(Z),ct=R*_+j,ot=Math.round(ct),lt=(B+C)*t+b,gt=Math.abs(Math.round(lt)-st)||1,vt=(R+k)*_+j,Et=Math.abs(Math.round(vt)-ot)||1;return N.setTransform(Math.sign(t),0,0,Math.sign(_),st,ot),N.drawImage(o,c,v,O,D,0,0,gt,Et),N.setTransform(t,n,h,_,b,j),[gt,Et]}if(t===0&&_===0){const Z=R*h+b,st=Math.round(Z),ct=B*n+j,ot=Math.round(ct),lt=(R+k)*h+b,gt=Math.abs(Math.round(lt)-st)||1,vt=(B+C)*n+j,Et=Math.abs(Math.round(vt)-ot)||1;return N.setTransform(0,Math.sign(n),Math.sign(h),0,st,ot),N.drawImage(o,c,v,O,D,0,0,Et,gt),N.setTransform(t,n,h,_,b,j),[Et,gt]}N.drawImage(o,c,v,O,D,B,R,C,k);const J=Math.hypot(t,n),Y=Math.hypot(h,_);return[J*C,Y*k]}function P(N){const{width:o,height:c}=N;if(o>E||c>E)return null;const v=1e3,O=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),D=o+1;let B=new Uint8Array(D*(c+1)),R,C,k;const t=o+7&-8;let n=new Uint8Array(t*c),h=0;for(const Y of N.data){let Z=128;for(;Z>0;)n[h++]=Y&Z?0:255,Z>>=1}let _=0;for(h=0,n[h]!==0&&(B[0]=1,++_),C=1;C<o;C++)n[h]!==n[h+1]&&(B[C]=n[h]?2:1,++_),h++;for(n[h]!==0&&(B[C]=2,++_),R=1;R<c;R++){h=R*t,k=R*D,n[h-t]!==n[h]&&(B[k]=n[h]?1:8,++_);let Y=(n[h]?4:0)+(n[h-t]?8:0);for(C=1;C<o;C++)Y=(Y>>2)+(n[h+1]?4:0)+(n[h-t+1]?8:0),O[Y]&&(B[k+C]=O[Y],++_),h++;if(n[h-t]!==n[h]&&(B[k+C]=n[h]?2:4,++_),_>v)return null}for(h=t*(c-1),k=R*D,n[h]!==0&&(B[k]=8,++_),C=1;C<o;C++)n[h]!==n[h+1]&&(B[k+C]=n[h]?4:8,++_),h++;if(n[h]!==0&&(B[k+C]=4,++_),_>v)return null;const b=new Int32Array([0,D,-1,0,-D,0,0,0,1]),j=new Path2D;for(R=0;_&&R<=c;R++){let Y=R*D;const Z=Y+o;for(;Y<Z&&!B[Y];)Y++;if(Y===Z)continue;j.moveTo(Y%D,R);const st=Y;let ct=B[Y];do{const ot=b[ct];do Y+=ot;while(!B[Y]);const lt=B[Y];lt!==5&<!==10?(ct=lt,B[Y]=0):(ct=lt&51*ct>>4,B[Y]&=ct>>2|ct<<2),j.lineTo(Y%D,Y/D|0),B[Y]||--_}while(st!==Y);--R}return n=null,B=null,function(Y){Y.save(),Y.scale(1/o,-1/c),Y.translate(0,-c),Y.fill(j),Y.beginPath(),Y.restore()}}class x{constructor(o,c){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=p.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=p.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=p.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,o,c])}clone(){const o=Object.create(this);return o.clipBox=this.clipBox.slice(),o}setCurrentPoint(o,c){this.x=o,this.y=c}updatePathMinMax(o,c,v){[c,v]=p.Util.applyTransform([c,v],o),this.minX=Math.min(this.minX,c),this.minY=Math.min(this.minY,v),this.maxX=Math.max(this.maxX,c),this.maxY=Math.max(this.maxY,v)}updateRectMinMax(o,c){const v=p.Util.applyTransform(c,o),O=p.Util.applyTransform(c.slice(2),o);this.minX=Math.min(this.minX,v[0],O[0]),this.minY=Math.min(this.minY,v[1],O[1]),this.maxX=Math.max(this.maxX,v[0],O[0]),this.maxY=Math.max(this.maxY,v[1],O[1])}updateScalingPathMinMax(o,c){p.Util.scaleMinMax(o,c),this.minX=Math.min(this.minX,c[0]),this.maxX=Math.max(this.maxX,c[1]),this.minY=Math.min(this.minY,c[2]),this.maxY=Math.max(this.maxY,c[3])}updateCurvePathMinMax(o,c,v,O,D,B,R,C,k,t){const n=p.Util.bezierBoundingBox(c,v,O,D,B,R,C,k);if(t){t[0]=Math.min(t[0],n[0],n[2]),t[1]=Math.max(t[1],n[0],n[2]),t[2]=Math.min(t[2],n[1],n[3]),t[3]=Math.max(t[3],n[1],n[3]);return}this.updateRectMinMax(o,n)}getPathBoundingBox(o=z.PathType.FILL,c=null){const v=[this.minX,this.minY,this.maxX,this.maxY];if(o===z.PathType.STROKE){c||(0,p.unreachable)("Stroke bounding box must include transform.");const O=p.Util.singularValueDecompose2dScale(c),D=O[0]*this.lineWidth/2,B=O[1]*this.lineWidth/2;v[0]-=D,v[1]-=B,v[2]+=D,v[3]+=B}return v}updateClipFromPath(){const o=p.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(o||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(o){this.clipBox=o,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(o=z.PathType.FILL,c=null){return p.Util.intersect(this.clipBox,this.getPathBoundingBox(o,c))}}function g(N,o){if(typeof ImageData<"u"&&o instanceof ImageData){N.putImageData(o,0,0);return}const c=o.height,v=o.width,O=c%m,D=(c-O)/m,B=O===0?D:D+1,R=N.createImageData(v,m);let C=0,k;const t=o.data,n=R.data;let h,_,b,j;if(o.kind===p.ImageKind.GRAYSCALE_1BPP){const J=t.byteLength,Y=new Uint32Array(n.buffer,0,n.byteLength>>2),Z=Y.length,st=v+7>>3,ct=4294967295,ot=p.FeatureTest.isLittleEndian?4278190080:255;for(h=0;h<B;h++){for(b=h<D?m:O,k=0,_=0;_<b;_++){const lt=J-C;let gt=0;const vt=lt>st?v:lt*8-7,Et=vt&-8;let Pt=0,W=0;for(;gt<Et;gt+=8)W=t[C++],Y[k++]=W&128?ct:ot,Y[k++]=W&64?ct:ot,Y[k++]=W&32?ct:ot,Y[k++]=W&16?ct:ot,Y[k++]=W&8?ct:ot,Y[k++]=W&4?ct:ot,Y[k++]=W&2?ct:ot,Y[k++]=W&1?ct:ot;for(;gt<vt;gt++)Pt===0&&(W=t[C++],Pt=128),Y[k++]=W&Pt?ct:ot,Pt>>=1}for(;k<Z;)Y[k++]=0;N.putImageData(R,0,h*m)}}else if(o.kind===p.ImageKind.RGBA_32BPP){for(_=0,j=v*m*4,h=0;h<D;h++)n.set(t.subarray(C,C+j)),C+=j,N.putImageData(R,0,_),_+=m;h<B&&(j=v*O*4,n.set(t.subarray(C,C+j)),N.putImageData(R,0,_))}else if(o.kind===p.ImageKind.RGB_24BPP)for(b=m,j=v*b,h=0;h<B;h++){for(h>=D&&(b=O,j=v*b),k=0,_=j;_--;)n[k++]=t[C++],n[k++]=t[C++],n[k++]=t[C++],n[k++]=255;N.putImageData(R,0,h*m)}else throw new Error(`bad image kind: ${o.kind}`)}function s(N,o){if(o.bitmap){N.drawImage(o.bitmap,0,0);return}const c=o.height,v=o.width,O=c%m,D=(c-O)/m,B=O===0?D:D+1,R=N.createImageData(v,m);let C=0;const k=o.data,t=R.data;for(let n=0;n<B;n++){const h=n<D?m:O;({srcPos:C}=(0,H.convertBlackAndWhiteToRGBA)({src:k,srcPos:C,dest:t,width:v,height:h,nonBlackColor:0})),N.putImageData(R,0,n*m)}}function r(N,o){const c=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const v of c)N[v]!==void 0&&(o[v]=N[v]);N.setLineDash!==void 0&&(o.setLineDash(N.getLineDash()),o.lineDashOffset=N.lineDashOffset)}function a(N){N.strokeStyle=N.fillStyle="#000000",N.fillRule="nonzero",N.globalAlpha=1,N.lineWidth=1,N.lineCap="butt",N.lineJoin="miter",N.miterLimit=10,N.globalCompositeOperation="source-over",N.font="10px sans-serif",N.setLineDash!==void 0&&(N.setLineDash([]),N.lineDashOffset=0),at.isNodeJS||(N.filter="none")}function e(N,o,c,v){const O=N.length;for(let D=3;D<O;D+=4){const B=N[D];if(B===0)N[D-3]=o,N[D-2]=c,N[D-1]=v;else if(B<255){const R=255-B;N[D-3]=N[D-3]*B+o*R>>8,N[D-2]=N[D-2]*B+c*R>>8,N[D-1]=N[D-1]*B+v*R>>8}}}function u(N,o,c){const v=N.length,O=1/255;for(let D=3;D<v;D+=4){const B=c?c[N[D]]:N[D];o[D]=o[D]*B*O|0}}function T(N,o,c){const v=N.length;for(let O=3;O<v;O+=4){const D=N[O-3]*77+N[O-2]*152+N[O-1]*28;o[O]=c?o[O]*c[D>>8]>>8:o[O]*D>>16}}function i(N,o,c,v,O,D,B,R,C,k,t){const n=!!D,h=n?D[0]:0,_=n?D[1]:0,b=n?D[2]:0;let j;O==="Luminosity"?j=T:j=u;const Y=Math.min(v,Math.ceil(1048576/c));for(let Z=0;Z<v;Z+=Y){const st=Math.min(Y,v-Z),ct=N.getImageData(R-k,Z+(C-t),c,st),ot=o.getImageData(R,Z+C,c,st);n&&e(ct.data,h,_,b),j(ct.data,ot.data,B),o.putImageData(ot,R,Z+C)}}function M(N,o,c,v){const O=v[0],D=v[1],B=v[2]-O,R=v[3]-D;B===0||R===0||(i(o.context,c,B,R,o.subtype,o.backdrop,o.transferMap,O,D,o.offsetX,o.offsetY),N.save(),N.globalAlpha=1,N.globalCompositeOperation="source-over",N.setTransform(1,0,0,1,0,0),N.drawImage(c.canvas,0,0),N.restore())}function U(N,o){const c=p.Util.singularValueDecompose2dScale(N);c[0]=Math.fround(c[0]),c[1]=Math.fround(c[1]);const v=Math.fround((globalThis.devicePixelRatio||1)*F.PixelsPerInch.PDF_TO_CSS_UNITS);return o!==void 0?o:c[0]<=v||c[1]<=v}const K=["butt","round","square"],et=["miter","round","bevel"],nt={},pt={},wt=class wt{constructor(o,c,v,O,D,{optionalContentConfig:B,markedContentStack:R=null},C,k){$(this,ut);$(this,Ct);this.ctx=o,this.current=new x(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=c,this.objs=v,this.canvasFactory=O,this.filterFactory=D,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=R||[],this.optionalContentConfig=B,this.cachedCanvases=new d(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=C,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=k,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(o,c=null){return typeof o=="string"?o.startsWith("g_")?this.commonObjs.get(o):this.objs.get(o):c}beginDrawing({transform:o,viewport:c,transparency:v=!1,background:O=null}){const D=this.ctx.canvas.width,B=this.ctx.canvas.height,R=this.ctx.fillStyle;if(this.ctx.fillStyle=O||"#ffffff",this.ctx.fillRect(0,0,D,B),this.ctx.fillStyle=R,v){const C=this.cachedCanvases.getCanvas("transparent",D,B);this.compositeCtx=this.ctx,this.transparentCanvas=C.canvas,this.ctx=C.context,this.ctx.save(),this.ctx.transform(...(0,F.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),a(this.ctx),o&&(this.ctx.transform(...o),this.outputScaleX=o[0],this.outputScaleY=o[0]),this.ctx.transform(...c.transform),this.viewportScale=c.scale,this.baseTransform=(0,F.getCurrentTransform)(this.ctx)}executeOperatorList(o,c,v,O){const D=o.argsArray,B=o.fnArray;let R=c||0;const C=D.length;if(C===R)return R;const k=C-R>L&&typeof v=="function",t=k?Date.now()+I:0;let n=0;const h=this.commonObjs,_=this.objs;let b;for(;;){if(O!==void 0&&R===O.nextBreakPoint)return O.breakIt(R,v),R;if(b=B[R],b!==p.OPS.dependency)this[b].apply(this,D[R]);else for(const j of D[R]){const J=j.startsWith("g_")?h:_;if(!J.has(j))return J.get(j,v),R}if(R++,R===C)return R;if(k&&++n>L){if(Date.now()>t)return v(),R;n=0}}}endDrawing(){tt(this,ut,we).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const o of this._cachedBitmapsMap.values()){for(const c of o.values())typeof HTMLCanvasElement<"u"&&c instanceof HTMLCanvasElement&&(c.width=c.height=0);o.clear()}this._cachedBitmapsMap.clear(),tt(this,Ct,Pe).call(this)}_scaleImage(o,c){const v=o.width,O=o.height;let D=Math.max(Math.hypot(c[0],c[1]),1),B=Math.max(Math.hypot(c[2],c[3]),1),R=v,C=O,k="prescale1",t,n;for(;D>2&&R>1||B>2&&C>1;){let h=R,_=C;D>2&&R>1&&(h=R>=16384?Math.floor(R/2)-1||1:Math.ceil(R/2),D/=R/h),B>2&&C>1&&(_=C>=16384?Math.floor(C/2)-1||1:Math.ceil(C)/2,B/=C/_),t=this.cachedCanvases.getCanvas(k,h,_),n=t.context,n.clearRect(0,0,h,_),n.drawImage(o,0,0,R,C,0,0,h,_),o=t.canvas,R=h,C=_,k=k==="prescale1"?"prescale2":"prescale1"}return{img:o,paintWidth:R,paintHeight:C}}_createMaskCanvas(o){const c=this.ctx,{width:v,height:O}=o,D=this.current.fillColor,B=this.current.patternFill,R=(0,F.getCurrentTransform)(c);let C,k,t,n;if((o.bitmap||o.data)&&o.count>1){const gt=o.bitmap||o.data.buffer;k=JSON.stringify(B?R:[R.slice(0,4),D]),C=this._cachedBitmapsMap.get(gt),C||(C=new Map,this._cachedBitmapsMap.set(gt,C));const vt=C.get(k);if(vt&&!B){const Et=Math.round(Math.min(R[0],R[2])+R[4]),Pt=Math.round(Math.min(R[1],R[3])+R[5]);return{canvas:vt,offsetX:Et,offsetY:Pt}}t=vt}t||(n=this.cachedCanvases.getCanvas("maskCanvas",v,O),s(n.context,o));let h=p.Util.transform(R,[1/v,0,0,-1/O,0,0]);h=p.Util.transform(h,[1,0,0,1,0,-O]);const _=p.Util.applyTransform([0,0],h),b=p.Util.applyTransform([v,O],h),j=p.Util.normalizeRect([_[0],_[1],b[0],b[1]]),J=Math.round(j[2]-j[0])||1,Y=Math.round(j[3]-j[1])||1,Z=this.cachedCanvases.getCanvas("fillCanvas",J,Y),st=Z.context,ct=Math.min(_[0],b[0]),ot=Math.min(_[1],b[1]);st.translate(-ct,-ot),st.transform(...h),t||(t=this._scaleImage(n.canvas,(0,F.getCurrentTransformInverse)(st)),t=t.img,C&&B&&C.set(k,t)),st.imageSmoothingEnabled=U((0,F.getCurrentTransform)(st),o.interpolate),S(st,t,0,0,t.width,t.height,0,0,v,O),st.globalCompositeOperation="source-in";const lt=p.Util.transform((0,F.getCurrentTransformInverse)(st),[1,0,0,1,-ct,-ot]);return st.fillStyle=B?D.getPattern(c,this,lt,z.PathType.FILL):D,st.fillRect(0,0,v,O),C&&!B&&(this.cachedCanvases.delete("fillCanvas"),C.set(k,Z.canvas)),{canvas:Z.canvas,offsetX:Math.round(ct),offsetY:Math.round(ot)}}setLineWidth(o){o!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=o,this.ctx.lineWidth=o}setLineCap(o){this.ctx.lineCap=K[o]}setLineJoin(o){this.ctx.lineJoin=et[o]}setMiterLimit(o){this.ctx.miterLimit=o}setDash(o,c){const v=this.ctx;v.setLineDash!==void 0&&(v.setLineDash(o),v.lineDashOffset=c)}setRenderingIntent(o){}setFlatness(o){}setGState(o){for(const[c,v]of o)switch(c){case"LW":this.setLineWidth(v);break;case"LC":this.setLineCap(v);break;case"LJ":this.setLineJoin(v);break;case"ML":this.setMiterLimit(v);break;case"D":this.setDash(v[0],v[1]);break;case"RI":this.setRenderingIntent(v);break;case"FL":this.setFlatness(v);break;case"Font":this.setFont(v[0],v[1]);break;case"CA":this.current.strokeAlpha=v;break;case"ca":this.current.fillAlpha=v,this.ctx.globalAlpha=v;break;case"BM":this.ctx.globalCompositeOperation=v;break;case"SMask":this.current.activeSMask=v?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(v);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const o=this.inSMaskMode;this.current.activeSMask&&!o?this.beginSMaskMode():!this.current.activeSMask&&o&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const o=this.ctx.canvas.width,c=this.ctx.canvas.height,v="smaskGroupAt"+this.groupLevel,O=this.cachedCanvases.getCanvas(v,o,c);this.suspendedCtx=this.ctx,this.ctx=O.context;const D=this.ctx;D.setTransform(...(0,F.getCurrentTransform)(this.suspendedCtx)),r(this.suspendedCtx,D),y(D,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),r(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(o){if(!this.current.activeSMask)return;o?(o[0]=Math.floor(o[0]),o[1]=Math.floor(o[1]),o[2]=Math.ceil(o[2]),o[3]=Math.ceil(o[3])):o=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const c=this.current.activeSMask,v=this.suspendedCtx;M(v,c,this.ctx,o),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(r(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const o=this.current;this.stateStack.push(o),this.current=o.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),r(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(o,c,v,O,D,B){this.ctx.transform(o,c,v,O,D,B),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(o,c,v){const O=this.ctx,D=this.current;let B=D.x,R=D.y,C,k;const t=(0,F.getCurrentTransform)(O),n=t[0]===0&&t[3]===0||t[1]===0&&t[2]===0,h=n?v.slice(0):null;for(let _=0,b=0,j=o.length;_<j;_++)switch(o[_]|0){case p.OPS.rectangle:B=c[b++],R=c[b++];const J=c[b++],Y=c[b++],Z=B+J,st=R+Y;O.moveTo(B,R),J===0||Y===0?O.lineTo(Z,st):(O.lineTo(Z,R),O.lineTo(Z,st),O.lineTo(B,st)),n||D.updateRectMinMax(t,[B,R,Z,st]),O.closePath();break;case p.OPS.moveTo:B=c[b++],R=c[b++],O.moveTo(B,R),n||D.updatePathMinMax(t,B,R);break;case p.OPS.lineTo:B=c[b++],R=c[b++],O.lineTo(B,R),n||D.updatePathMinMax(t,B,R);break;case p.OPS.curveTo:C=B,k=R,B=c[b+4],R=c[b+5],O.bezierCurveTo(c[b],c[b+1],c[b+2],c[b+3],B,R),D.updateCurvePathMinMax(t,C,k,c[b],c[b+1],c[b+2],c[b+3],B,R,h),b+=6;break;case p.OPS.curveTo2:C=B,k=R,O.bezierCurveTo(B,R,c[b],c[b+1],c[b+2],c[b+3]),D.updateCurvePathMinMax(t,C,k,B,R,c[b],c[b+1],c[b+2],c[b+3],h),B=c[b+2],R=c[b+3],b+=4;break;case p.OPS.curveTo3:C=B,k=R,B=c[b+2],R=c[b+3],O.bezierCurveTo(c[b],c[b+1],B,R,B,R),D.updateCurvePathMinMax(t,C,k,c[b],c[b+1],B,R,B,R,h),b+=4;break;case p.OPS.closePath:O.closePath();break}n&&D.updateScalingPathMinMax(t,h),D.setCurrentPoint(B,R)}closePath(){this.ctx.closePath()}stroke(o=!0){const c=this.ctx,v=this.current.strokeColor;c.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof v=="object"&&(v!=null&&v.getPattern)?(c.save(),c.strokeStyle=v.getPattern(c,this,(0,F.getCurrentTransformInverse)(c),z.PathType.STROKE),this.rescaleAndStroke(!1),c.restore()):this.rescaleAndStroke(!0)),o&&this.consumePath(this.current.getClippedPathBoundingBox()),c.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(o=!0){const c=this.ctx,v=this.current.fillColor,O=this.current.patternFill;let D=!1;O&&(c.save(),c.fillStyle=v.getPattern(c,this,(0,F.getCurrentTransformInverse)(c),z.PathType.FILL),D=!0);const B=this.current.getClippedPathBoundingBox();this.contentVisible&&B!==null&&(this.pendingEOFill?(c.fill("evenodd"),this.pendingEOFill=!1):c.fill()),D&&c.restore(),o&&this.consumePath(B)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=nt}eoClip(){this.pendingClip=pt}beginText(){this.current.textMatrix=p.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const o=this.pendingTextPaths,c=this.ctx;if(o===void 0){c.beginPath();return}c.save(),c.beginPath();for(const v of o)c.setTransform(...v.transform),c.translate(v.x,v.y),v.addToPath(c,v.fontSize);c.restore(),c.clip(),c.beginPath(),delete this.pendingTextPaths}setCharSpacing(o){this.current.charSpacing=o}setWordSpacing(o){this.current.wordSpacing=o}setHScale(o){this.current.textHScale=o/100}setLeading(o){this.current.leading=-o}setFont(o,c){var t;const v=this.commonObjs.get(o),O=this.current;if(!v)throw new Error(`Can't find font for ${o}`);if(O.fontMatrix=v.fontMatrix||p.FONT_IDENTITY_MATRIX,(O.fontMatrix[0]===0||O.fontMatrix[3]===0)&&(0,p.warn)("Invalid font matrix for font "+o),c<0?(c=-c,O.fontDirection=-1):O.fontDirection=1,this.current.font=v,this.current.fontSize=c,v.isType3Font)return;const D=v.loadedName||"sans-serif",B=((t=v.systemFontInfo)==null?void 0:t.css)||`"${D}", ${v.fallbackName}`;let R="normal";v.black?R="900":v.bold&&(R="bold");const C=v.italic?"italic":"normal";let k=c;c<X?k=X:c>w&&(k=w),this.current.fontSizeScale=c/k,this.ctx.font=`${C} ${R} ${k}px ${B}`}setTextRenderingMode(o){this.current.textRenderingMode=o}setTextRise(o){this.current.textRise=o}moveText(o,c){this.current.x=this.current.lineX+=o,this.current.y=this.current.lineY+=c}setLeadingMoveText(o,c){this.setLeading(-c),this.moveText(o,c)}setTextMatrix(o,c,v,O,D,B){this.current.textMatrix=[o,c,v,O,D,B],this.current.textMatrixScale=Math.hypot(o,c),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(o,c,v,O){const D=this.ctx,B=this.current,R=B.font,C=B.textRenderingMode,k=B.fontSize/B.fontSizeScale,t=C&p.TextRenderingMode.FILL_STROKE_MASK,n=!!(C&p.TextRenderingMode.ADD_TO_PATH_FLAG),h=B.patternFill&&!R.missingFile;let _;(R.disableFontFace||n||h)&&(_=R.getPathGenerator(this.commonObjs,o)),R.disableFontFace||h?(D.save(),D.translate(c,v),D.beginPath(),_(D,k),O&&D.setTransform(...O),(t===p.TextRenderingMode.FILL||t===p.TextRenderingMode.FILL_STROKE)&&D.fill(),(t===p.TextRenderingMode.STROKE||t===p.TextRenderingMode.FILL_STROKE)&&D.stroke(),D.restore()):((t===p.TextRenderingMode.FILL||t===p.TextRenderingMode.FILL_STROKE)&&D.fillText(o,c,v),(t===p.TextRenderingMode.STROKE||t===p.TextRenderingMode.FILL_STROKE)&&D.strokeText(o,c,v)),n&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,F.getCurrentTransform)(D),x:c,y:v,fontSize:k,addToPath:_})}get isFontSubpixelAAEnabled(){const{context:o}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);o.scale(1.5,1),o.fillText("I",0,10);const c=o.getImageData(0,0,10,10).data;let v=!1;for(let O=3;O<c.length;O+=4)if(c[O]>0&&c[O]<255){v=!0;break}return(0,p.shadow)(this,"isFontSubpixelAAEnabled",v)}showText(o){const c=this.current,v=c.font;if(v.isType3Font)return this.showType3Text(o);const O=c.fontSize;if(O===0)return;const D=this.ctx,B=c.fontSizeScale,R=c.charSpacing,C=c.wordSpacing,k=c.fontDirection,t=c.textHScale*k,n=o.length,h=v.vertical,_=h?1:-1,b=v.defaultVMetrics,j=O*c.fontMatrix[0],J=c.textRenderingMode===p.TextRenderingMode.FILL&&!v.disableFontFace&&!c.patternFill;D.save(),D.transform(...c.textMatrix),D.translate(c.x,c.y+c.textRise),k>0?D.scale(t,-1):D.scale(t,1);let Y;if(c.patternFill){D.save();const lt=c.fillColor.getPattern(D,this,(0,F.getCurrentTransformInverse)(D),z.PathType.FILL);Y=(0,F.getCurrentTransform)(D),D.restore(),D.fillStyle=lt}let Z=c.lineWidth;const st=c.textMatrixScale;if(st===0||Z===0){const lt=c.textRenderingMode&p.TextRenderingMode.FILL_STROKE_MASK;(lt===p.TextRenderingMode.STROKE||lt===p.TextRenderingMode.FILL_STROKE)&&(Z=this.getSinglePixelWidth())}else Z/=st;if(B!==1&&(D.scale(B,B),Z/=B),D.lineWidth=Z,v.isInvalidPDFjsFont){const lt=[];let gt=0;for(const vt of o)lt.push(vt.unicode),gt+=vt.width;D.fillText(lt.join(""),0,0),c.x+=gt*j*t,D.restore(),this.compose();return}let ct=0,ot;for(ot=0;ot<n;++ot){const lt=o[ot];if(typeof lt=="number"){ct+=_*lt*O/1e3;continue}let gt=!1;const vt=(lt.isSpace?C:0)+R,Et=lt.fontChar,Pt=lt.accent;let W,mt,Ft=lt.width;if(h){const it=lt.vmetric||b,G=-(lt.vmetric?it[1]:Ft*.5)*j,q=it[2]*j;Ft=it?-it[0]:Ft,W=G/B,mt=(ct+q)/B}else W=ct/B,mt=0;if(v.remeasure&&Ft>0){const it=D.measureText(Et).width*1e3/O*B;if(Ft<it&&this.isFontSubpixelAAEnabled){const G=Ft/it;gt=!0,D.save(),D.scale(G,1),W/=G}else Ft!==it&&(W+=(Ft-it)/2e3*O/B)}if(this.contentVisible&&(lt.isInFont||v.missingFile)){if(J&&!Pt)D.fillText(Et,W,mt);else if(this.paintChar(Et,W,mt,Y),Pt){const it=W+O*Pt.offset.x/B,G=mt-O*Pt.offset.y/B;this.paintChar(Pt.fontChar,it,G,Y)}}let Mt;h?Mt=Ft*j-vt*k:Mt=Ft*j+vt*k,ct+=Mt,gt&&D.restore()}h?c.y-=ct:c.x+=ct*t,D.restore(),this.compose()}showType3Text(o){const c=this.ctx,v=this.current,O=v.font,D=v.fontSize,B=v.fontDirection,R=O.vertical?1:-1,C=v.charSpacing,k=v.wordSpacing,t=v.textHScale*B,n=v.fontMatrix||p.FONT_IDENTITY_MATRIX,h=o.length,_=v.textRenderingMode===p.TextRenderingMode.INVISIBLE;let b,j,J,Y;if(!(_||D===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,c.save(),c.transform(...v.textMatrix),c.translate(v.x,v.y),c.scale(t,B),b=0;b<h;++b){if(j=o[b],typeof j=="number"){Y=R*j*D/1e3,this.ctx.translate(Y,0),v.x+=Y*t;continue}const Z=(j.isSpace?k:0)+C,st=O.charProcOperatorList[j.operatorListId];if(!st){(0,p.warn)(`Type3 character "${j.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=j,this.save(),c.scale(D,D),c.transform(...n),this.executeOperatorList(st),this.restore()),J=p.Util.applyTransform([j.width,0],n)[0]*D+Z,c.translate(J,0),v.x+=J*t}c.restore(),this.processingType3=null}}setCharWidth(o,c){}setCharWidthAndBounds(o,c,v,O,D,B){this.ctx.rect(v,O,D-v,B-O),this.ctx.clip(),this.endPath()}getColorN_Pattern(o){let c;if(o[0]==="TilingPattern"){const v=o[1],O=this.baseTransform||(0,F.getCurrentTransform)(this.ctx),D={createCanvasGraphics:B=>new wt(B,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};c=new z.TilingPattern(o,v,this.ctx,D,O)}else c=this._getPattern(o[1],o[2]);return c}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(o,c,v){const O=p.Util.makeHexColor(o,c,v);this.ctx.strokeStyle=O,this.current.strokeColor=O}setFillRGBColor(o,c,v){const O=p.Util.makeHexColor(o,c,v);this.ctx.fillStyle=O,this.current.fillColor=O,this.current.patternFill=!1}_getPattern(o,c=null){let v;return this.cachedPatterns.has(o)?v=this.cachedPatterns.get(o):(v=(0,z.getShadingPattern)(this.getObject(o)),this.cachedPatterns.set(o,v)),c&&(v.matrix=c),v}shadingFill(o){if(!this.contentVisible)return;const c=this.ctx;this.save();const v=this._getPattern(o);c.fillStyle=v.getPattern(c,this,(0,F.getCurrentTransformInverse)(c),z.PathType.SHADING);const O=(0,F.getCurrentTransformInverse)(c);if(O){const D=c.canvas,B=D.width,R=D.height,C=p.Util.applyTransform([0,0],O),k=p.Util.applyTransform([0,R],O),t=p.Util.applyTransform([B,0],O),n=p.Util.applyTransform([B,R],O),h=Math.min(C[0],k[0],t[0],n[0]),_=Math.min(C[1],k[1],t[1],n[1]),b=Math.max(C[0],k[0],t[0],n[0]),j=Math.max(C[1],k[1],t[1],n[1]);this.ctx.fillRect(h,_,b-h,j-_)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,p.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,p.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(o,c){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(o)&&o.length===6&&this.transform(...o),this.baseTransform=(0,F.getCurrentTransform)(this.ctx),c)){const v=c[2]-c[0],O=c[3]-c[1];this.ctx.rect(c[0],c[1],v,O),this.current.updateRectMinMax((0,F.getCurrentTransform)(this.ctx),c),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(o){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const c=this.ctx;o.isolated||(0,p.info)("TODO: Support non-isolated groups."),o.knockout&&(0,p.warn)("Knockout groups not supported.");const v=(0,F.getCurrentTransform)(c);if(o.matrix&&c.transform(...o.matrix),!o.bbox)throw new Error("Bounding box is required.");let O=p.Util.getAxialAlignedBoundingBox(o.bbox,(0,F.getCurrentTransform)(c));const D=[0,0,c.canvas.width,c.canvas.height];O=p.Util.intersect(O,D)||[0,0,0,0];const B=Math.floor(O[0]),R=Math.floor(O[1]);let C=Math.max(Math.ceil(O[2])-B,1),k=Math.max(Math.ceil(O[3])-R,1),t=1,n=1;C>A&&(t=C/A,C=A),k>A&&(n=k/A,k=A),this.current.startNewPathAndClipBox([0,0,C,k]);let h="groupAt"+this.groupLevel;o.smask&&(h+="_smask_"+this.smaskCounter++%2);const _=this.cachedCanvases.getCanvas(h,C,k),b=_.context;b.scale(1/t,1/n),b.translate(-B,-R),b.transform(...v),o.smask?this.smaskStack.push({canvas:_.canvas,context:b,offsetX:B,offsetY:R,scaleX:t,scaleY:n,subtype:o.smask.subtype,backdrop:o.smask.backdrop,transferMap:o.smask.transferMap||null,startTransformInverse:null}):(c.setTransform(1,0,0,1,0,0),c.translate(B,R),c.scale(t,n),c.save()),r(c,b),this.ctx=b,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(c),this.groupLevel++}endGroup(o){if(!this.contentVisible)return;this.groupLevel--;const c=this.ctx,v=this.groupStack.pop();if(this.ctx=v,this.ctx.imageSmoothingEnabled=!1,o.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const O=(0,F.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...O);const D=p.Util.getAxialAlignedBoundingBox([0,0,c.canvas.width,c.canvas.height],O);this.ctx.drawImage(c.canvas,0,0),this.ctx.restore(),this.compose(D)}}beginAnnotation(o,c,v,O,D){if(tt(this,ut,we).call(this),a(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(c)&&c.length===4){const B=c[2]-c[0],R=c[3]-c[1];if(D&&this.annotationCanvasMap){v=v.slice(),v[4]-=c[0],v[5]-=c[1],c=c.slice(),c[0]=c[1]=0,c[2]=B,c[3]=R;const[C,k]=p.Util.singularValueDecompose2dScale((0,F.getCurrentTransform)(this.ctx)),{viewportScale:t}=this,n=Math.ceil(B*this.outputScaleX*t),h=Math.ceil(R*this.outputScaleY*t);this.annotationCanvas=this.canvasFactory.create(n,h);const{canvas:_,context:b}=this.annotationCanvas;this.annotationCanvasMap.set(o,_),this.annotationCanvas.savedCtx=this.ctx,this.ctx=b,this.ctx.save(),this.ctx.setTransform(C,0,0,-k,0,R*k),a(this.ctx)}else a(this.ctx),this.ctx.rect(c[0],c[1],B,R),this.ctx.clip(),this.endPath()}this.current=new x(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...v),this.transform(...O)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),tt(this,Ct,Pe).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(o){if(!this.contentVisible)return;const c=o.count;o=this.getObject(o.data,o),o.count=c;const v=this.ctx,O=this.processingType3;if(O&&(O.compiled===void 0&&(O.compiled=P(o)),O.compiled)){O.compiled(v);return}const D=this._createMaskCanvas(o),B=D.canvas;v.save(),v.setTransform(1,0,0,1,0,0),v.drawImage(B,D.offsetX,D.offsetY),v.restore(),this.compose()}paintImageMaskXObjectRepeat(o,c,v=0,O=0,D,B){if(!this.contentVisible)return;o=this.getObject(o.data,o);const R=this.ctx;R.save();const C=(0,F.getCurrentTransform)(R);R.transform(c,v,O,D,0,0);const k=this._createMaskCanvas(o);R.setTransform(1,0,0,1,k.offsetX-C[4],k.offsetY-C[5]);for(let t=0,n=B.length;t<n;t+=2){const h=p.Util.transform(C,[c,v,O,D,B[t],B[t+1]]),[_,b]=p.Util.applyTransform([0,0],h);R.drawImage(k.canvas,_,b)}R.restore(),this.compose()}paintImageMaskXObjectGroup(o){if(!this.contentVisible)return;const c=this.ctx,v=this.current.fillColor,O=this.current.patternFill;for(const D of o){const{data:B,width:R,height:C,transform:k}=D,t=this.cachedCanvases.getCanvas("maskCanvas",R,C),n=t.context;n.save();const h=this.getObject(B,D);s(n,h),n.globalCompositeOperation="source-in",n.fillStyle=O?v.getPattern(n,this,(0,F.getCurrentTransformInverse)(c),z.PathType.FILL):v,n.fillRect(0,0,R,C),n.restore(),c.save(),c.transform(...k),c.scale(1,-1),S(c,t.canvas,0,0,R,C,0,-1,1,1),c.restore()}this.compose()}paintImageXObject(o){if(!this.contentVisible)return;const c=this.getObject(o);if(!c){(0,p.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(c)}paintImageXObjectRepeat(o,c,v,O){if(!this.contentVisible)return;const D=this.getObject(o);if(!D){(0,p.warn)("Dependent image isn't ready yet");return}const B=D.width,R=D.height,C=[];for(let k=0,t=O.length;k<t;k+=2)C.push({transform:[c,0,0,v,O[k],O[k+1]],x:0,y:0,w:B,h:R});this.paintInlineImageXObjectGroup(D,C)}applyTransferMapsToCanvas(o){return this.current.transferMaps!=="none"&&(o.filter=this.current.transferMaps,o.drawImage(o.canvas,0,0),o.filter="none"),o.canvas}applyTransferMapsToBitmap(o){if(this.current.transferMaps==="none")return o.bitmap;const{bitmap:c,width:v,height:O}=o,D=this.cachedCanvases.getCanvas("inlineImage",v,O),B=D.context;return B.filter=this.current.transferMaps,B.drawImage(c,0,0),B.filter="none",D.canvas}paintInlineImageXObject(o){if(!this.contentVisible)return;const c=o.width,v=o.height,O=this.ctx;this.save(),at.isNodeJS||(O.filter="none"),O.scale(1/c,-1/v);let D;if(o.bitmap)D=this.applyTransferMapsToBitmap(o);else if(typeof HTMLElement=="function"&&o instanceof HTMLElement||!o.data)D=o;else{const C=this.cachedCanvases.getCanvas("inlineImage",c,v).context;g(C,o),D=this.applyTransferMapsToCanvas(C)}const B=this._scaleImage(D,(0,F.getCurrentTransformInverse)(O));O.imageSmoothingEnabled=U((0,F.getCurrentTransform)(O),o.interpolate),S(O,B.img,0,0,B.paintWidth,B.paintHeight,0,-v,c,v),this.compose(),this.restore()}paintInlineImageXObjectGroup(o,c){if(!this.contentVisible)return;const v=this.ctx;let O;if(o.bitmap)O=o.bitmap;else{const D=o.width,B=o.height,C=this.cachedCanvases.getCanvas("inlineImage",D,B).context;g(C,o),O=this.applyTransferMapsToCanvas(C)}for(const D of c)v.save(),v.transform(...D.transform),v.scale(1,-1),S(v,O,D.x,D.y,D.w,D.h,0,-1,1,1),v.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(o){}markPointProps(o,c){}beginMarkedContent(o){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(o,c){o==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(c)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(o){const c=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(o);const v=this.ctx;this.pendingClip&&(c||(this.pendingClip===pt?v.clip("evenodd"):v.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),v.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const o=(0,F.getCurrentTransform)(this.ctx);if(o[1]===0&&o[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(o[0]),Math.abs(o[3]));else{const c=Math.abs(o[0]*o[3]-o[2]*o[1]),v=Math.hypot(o[0],o[2]),O=Math.hypot(o[1],o[3]);this._cachedGetSinglePixelWidth=Math.max(v,O)/c}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:o}=this.current,{a:c,b:v,c:O,d:D}=this.ctx.getTransform();let B,R;if(v===0&&O===0){const C=Math.abs(c),k=Math.abs(D);if(C===k)if(o===0)B=R=1/C;else{const t=C*o;B=R=t<1?1/t:1}else if(o===0)B=1/C,R=1/k;else{const t=C*o,n=k*o;B=t<1?1/t:1,R=n<1?1/n:1}}else{const C=Math.abs(c*D-v*O),k=Math.hypot(c,v),t=Math.hypot(O,D);if(o===0)B=t/C,R=k/C;else{const n=o*C;B=t>n?t/n:1,R=k>n?k/n:1}}this._cachedScaleForStroking[0]=B,this._cachedScaleForStroking[1]=R}return this._cachedScaleForStroking}rescaleAndStroke(o){const{ctx:c}=this,{lineWidth:v}=this.current,[O,D]=this.getScaleForStroking();if(c.lineWidth=v||1,O===1&&D===1){c.stroke();return}const B=c.getLineDash();if(o&&c.save(),c.scale(O,D),B.length>0){const R=Math.max(O,D);c.setLineDash(B.map(C=>C/R)),c.lineDashOffset/=R}c.stroke(),o&&c.restore()}isContentVisible(){for(let o=this.markedContentStack.length-1;o>=0;o--)if(!this.markedContentStack[o].visible)return!1;return!0}};ut=new WeakSet,we=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},Ct=new WeakSet,Pe=function(){if(this.pageColors){const o=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(o!=="none"){const c=this.ctx.filter;this.ctx.filter=o,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=c}}};let rt=wt;f.CanvasGraphics=rt;for(const N in p.OPS)rt.prototype[N]!==void 0&&(rt.prototype[p.OPS[N]]=rt.prototype[N])},(ht,f,Q)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.TilingPattern=f.PathType=void 0,f.getShadingPattern=E;var p=Q(1),F=Q(6);const z={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};f.PathType=z;function H(S,P){if(!P)return;const x=P[2]-P[0],g=P[3]-P[1],s=new Path2D;s.rect(P[0],P[1],x,g),S.clip(s)}class at{constructor(){this.constructor===at&&(0,p.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,p.unreachable)("Abstract method `getPattern` called.")}}class X extends at{constructor(P){super(),this._type=P[1],this._bbox=P[2],this._colorStops=P[3],this._p0=P[4],this._p1=P[5],this._r0=P[6],this._r1=P[7],this.matrix=null}_createGradient(P){let x;this._type==="axial"?x=P.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(x=P.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const g of this._colorStops)x.addColorStop(g[0],g[1]);return x}getPattern(P,x,g,s){let r;if(s===z.STROKE||s===z.FILL){const a=x.current.getClippedPathBoundingBox(s,(0,F.getCurrentTransform)(P))||[0,0,0,0],e=Math.ceil(a[2]-a[0])||1,u=Math.ceil(a[3]-a[1])||1,T=x.cachedCanvases.getCanvas("pattern",e,u,!0),i=T.context;i.clearRect(0,0,i.canvas.width,i.canvas.height),i.beginPath(),i.rect(0,0,i.canvas.width,i.canvas.height),i.translate(-a[0],-a[1]),g=p.Util.transform(g,[1,0,0,1,a[0],a[1]]),i.transform(...x.baseTransform),this.matrix&&i.transform(...this.matrix),H(i,this._bbox),i.fillStyle=this._createGradient(i),i.fill(),r=P.createPattern(T.canvas,"no-repeat");const M=new DOMMatrix(g);r.setTransform(M)}else H(P,this._bbox),r=this._createGradient(P);return r}}function w(S,P,x,g,s,r,a,e){const u=P.coords,T=P.colors,i=S.data,M=S.width*4;let U;u[x+1]>u[g+1]&&(U=x,x=g,g=U,U=r,r=a,a=U),u[g+1]>u[s+1]&&(U=g,g=s,s=U,U=a,a=e,e=U),u[x+1]>u[g+1]&&(U=x,x=g,g=U,U=r,r=a,a=U);const K=(u[x]+P.offsetX)*P.scaleX,et=(u[x+1]+P.offsetY)*P.scaleY,nt=(u[g]+P.offsetX)*P.scaleX,pt=(u[g+1]+P.offsetY)*P.scaleY,rt=(u[s]+P.offsetX)*P.scaleX,ut=(u[s+1]+P.offsetY)*P.scaleY;if(et>=ut)return;const At=T[r],Ct=T[r+1],Tt=T[r+2],wt=T[a],N=T[a+1],o=T[a+2],c=T[e],v=T[e+1],O=T[e+2],D=Math.round(et),B=Math.round(ut);let R,C,k,t,n,h,_,b;for(let j=D;j<=B;j++){if(j<pt){let ct;j<et?ct=0:ct=(et-j)/(et-pt),R=K-(K-nt)*ct,C=At-(At-wt)*ct,k=Ct-(Ct-N)*ct,t=Tt-(Tt-o)*ct}else{let ct;j>ut?ct=1:pt===ut?ct=0:ct=(pt-j)/(pt-ut),R=nt-(nt-rt)*ct,C=wt-(wt-c)*ct,k=N-(N-v)*ct,t=o-(o-O)*ct}let J;j<et?J=0:j>ut?J=1:J=(et-j)/(et-ut),n=K-(K-rt)*J,h=At-(At-c)*J,_=Ct-(Ct-v)*J,b=Tt-(Tt-O)*J;const Y=Math.round(Math.min(R,n)),Z=Math.round(Math.max(R,n));let st=M*j+Y*4;for(let ct=Y;ct<=Z;ct++)J=(R-ct)/(R-n),J<0?J=0:J>1&&(J=1),i[st++]=C-(C-h)*J|0,i[st++]=k-(k-_)*J|0,i[st++]=t-(t-b)*J|0,i[st++]=255}}function A(S,P,x){const g=P.coords,s=P.colors;let r,a;switch(P.type){case"lattice":const e=P.verticesPerRow,u=Math.floor(g.length/e)-1,T=e-1;for(r=0;r<u;r++){let i=r*e;for(let M=0;M<T;M++,i++)w(S,x,g[i],g[i+1],g[i+e],s[i],s[i+1],s[i+e]),w(S,x,g[i+e+1],g[i+1],g[i+e],s[i+e+1],s[i+1],s[i+e])}break;case"triangles":for(r=0,a=g.length;r<a;r+=3)w(S,x,g[r],g[r+1],g[r+2],s[r],s[r+1],s[r+2]);break;default:throw new Error("illegal figure")}}class I extends at{constructor(P){super(),this._coords=P[2],this._colors=P[3],this._figures=P[4],this._bounds=P[5],this._bbox=P[7],this._background=P[8],this.matrix=null}_createMeshCanvas(P,x,g){const e=Math.floor(this._bounds[0]),u=Math.floor(this._bounds[1]),T=Math.ceil(this._bounds[2])-e,i=Math.ceil(this._bounds[3])-u,M=Math.min(Math.ceil(Math.abs(T*P[0]*1.1)),3e3),U=Math.min(Math.ceil(Math.abs(i*P[1]*1.1)),3e3),K=T/M,et=i/U,nt={coords:this._coords,colors:this._colors,offsetX:-e,offsetY:-u,scaleX:1/K,scaleY:1/et},pt=M+2*2,rt=U+2*2,ut=g.getCanvas("mesh",pt,rt,!1),At=ut.context,Ct=At.createImageData(M,U);if(x){const wt=Ct.data;for(let N=0,o=wt.length;N<o;N+=4)wt[N]=x[0],wt[N+1]=x[1],wt[N+2]=x[2],wt[N+3]=255}for(const wt of this._figures)A(Ct,wt,nt);return At.putImageData(Ct,2,2),{canvas:ut.canvas,offsetX:e-2*K,offsetY:u-2*et,scaleX:K,scaleY:et}}getPattern(P,x,g,s){H(P,this._bbox);let r;if(s===z.SHADING)r=p.Util.singularValueDecompose2dScale((0,F.getCurrentTransform)(P));else if(r=p.Util.singularValueDecompose2dScale(x.baseTransform),this.matrix){const e=p.Util.singularValueDecompose2dScale(this.matrix);r=[r[0]*e[0],r[1]*e[1]]}const a=this._createMeshCanvas(r,s===z.SHADING?null:this._background,x.cachedCanvases);return s!==z.SHADING&&(P.setTransform(...x.baseTransform),this.matrix&&P.transform(...this.matrix)),P.translate(a.offsetX,a.offsetY),P.scale(a.scaleX,a.scaleY),P.createPattern(a.canvas,"no-repeat")}}class L extends at{getPattern(){return"hotpink"}}function E(S){switch(S[0]){case"RadialAxial":return new X(S);case"Mesh":return new I(S);case"Dummy":return new L}throw new Error(`Unknown IR type: ${S[0]}`)}const m={COLORED:1,UNCOLORED:2},d=class d{constructor(P,x,g,s,r){this.operatorList=P[2],this.matrix=P[3]||[1,0,0,1,0,0],this.bbox=P[4],this.xstep=P[5],this.ystep=P[6],this.paintType=P[7],this.tilingType=P[8],this.color=x,this.ctx=g,this.canvasGraphicsFactory=s,this.baseTransform=r}createPatternCanvas(P){const x=this.operatorList,g=this.bbox,s=this.xstep,r=this.ystep,a=this.paintType,e=this.tilingType,u=this.color,T=this.canvasGraphicsFactory;(0,p.info)("TilingType: "+e);const i=g[0],M=g[1],U=g[2],K=g[3],et=p.Util.singularValueDecompose2dScale(this.matrix),nt=p.Util.singularValueDecompose2dScale(this.baseTransform),pt=[et[0]*nt[0],et[1]*nt[1]],rt=this.getSizeAndScale(s,this.ctx.canvas.width,pt[0]),ut=this.getSizeAndScale(r,this.ctx.canvas.height,pt[1]),At=P.cachedCanvases.getCanvas("pattern",rt.size,ut.size,!0),Ct=At.context,Tt=T.createCanvasGraphics(Ct);Tt.groupLevel=P.groupLevel,this.setFillAndStrokeStyleToContext(Tt,a,u);let wt=i,N=M,o=U,c=K;return i<0&&(wt=0,o+=Math.abs(i)),M<0&&(N=0,c+=Math.abs(M)),Ct.translate(-(rt.scale*wt),-(ut.scale*N)),Tt.transform(rt.scale,0,0,ut.scale,0,0),Ct.save(),this.clipBbox(Tt,wt,N,o,c),Tt.baseTransform=(0,F.getCurrentTransform)(Tt.ctx),Tt.executeOperatorList(x),Tt.endDrawing(),{canvas:At.canvas,scaleX:rt.scale,scaleY:ut.scale,offsetX:wt,offsetY:N}}getSizeAndScale(P,x,g){P=Math.abs(P);const s=Math.max(d.MAX_PATTERN_SIZE,x);let r=Math.ceil(P*g);return r>=s?r=s:g=r/P,{scale:g,size:r}}clipBbox(P,x,g,s,r){const a=s-x,e=r-g;P.ctx.rect(x,g,a,e),P.current.updateRectMinMax((0,F.getCurrentTransform)(P.ctx),[x,g,s,r]),P.clip(),P.endPath()}setFillAndStrokeStyleToContext(P,x,g){const s=P.ctx,r=P.current;switch(x){case m.COLORED:const a=this.ctx;s.fillStyle=a.fillStyle,s.strokeStyle=a.strokeStyle,r.fillColor=a.fillStyle,r.strokeColor=a.strokeStyle;break;case m.UNCOLORED:const e=p.Util.makeHexColor(g[0],g[1],g[2]);s.fillStyle=e,s.strokeStyle=e,r.fillColor=e,r.strokeColor=e;break;default:throw new p.FormatError(`Unsupported paint type: ${x}`)}}getPattern(P,x,g,s){let r=g;s!==z.SHADING&&(r=p.Util.transform(r,x.baseTransform),this.matrix&&(r=p.Util.transform(r,this.matrix)));const a=this.createPatternCanvas(x);let e=new DOMMatrix(r);e=e.translate(a.offsetX,a.offsetY),e=e.scale(1/a.scaleX,1/a.scaleY);const u=P.createPattern(a.canvas,"repeat");return u.setTransform(e),u}};Ut(d,"MAX_PATTERN_SIZE",3e3);let y=d;f.TilingPattern=y},(ht,f,Q)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.convertBlackAndWhiteToRGBA=z,f.convertToRGBA=F,f.grayToRGBA=at;var p=Q(1);function F(X){switch(X.kind){case p.ImageKind.GRAYSCALE_1BPP:return z(X);case p.ImageKind.RGB_24BPP:return H(X)}return null}function z({src:X,srcPos:w=0,dest:A,width:I,height:L,nonBlackColor:E=4294967295,inverseDecode:m=!1}){const y=p.FeatureTest.isLittleEndian?4278190080:255,[d,S]=m?[E,y]:[y,E],P=I>>3,x=I&7,g=X.length;A=new Uint32Array(A.buffer);let s=0;for(let r=0;r<L;r++){for(const e=w+P;w<e;w++){const u=w<g?X[w]:255;A[s++]=u&128?S:d,A[s++]=u&64?S:d,A[s++]=u&32?S:d,A[s++]=u&16?S:d,A[s++]=u&8?S:d,A[s++]=u&4?S:d,A[s++]=u&2?S:d,A[s++]=u&1?S:d}if(x===0)continue;const a=w<g?X[w++]:255;for(let e=0;e<x;e++)A[s++]=a&1<<7-e?S:d}return{srcPos:w,destPos:s}}function H({src:X,srcPos:w=0,dest:A,destPos:I=0,width:L,height:E}){let m=0;const y=X.length>>2,d=new Uint32Array(X.buffer,w,y);if(p.FeatureTest.isLittleEndian){for(;m<y-2;m+=3,I+=4){const S=d[m],P=d[m+1],x=d[m+2];A[I]=S|4278190080,A[I+1]=S>>>24|P<<8|4278190080,A[I+2]=P>>>16|x<<16|4278190080,A[I+3]=x>>>8|4278190080}for(let S=m*4,P=X.length;S<P;S+=3)A[I++]=X[S]|X[S+1]<<8|X[S+2]<<16|4278190080}else{for(;m<y-2;m+=3,I+=4){const S=d[m],P=d[m+1],x=d[m+2];A[I]=S|255,A[I+1]=S<<24|P>>>8|255,A[I+2]=P<<16|x>>>16|255,A[I+3]=x<<8|255}for(let S=m*4,P=X.length;S<P;S+=3)A[I++]=X[S]<<24|X[S+1]<<16|X[S+2]<<8|255}return{srcPos:w,destPos:I}}function at(X,w){if(p.FeatureTest.isLittleEndian)for(let A=0,I=X.length;A<I;A++)w[A]=X[A]*65793|4278190080;else for(let A=0,I=X.length;A<I;A++)w[A]=X[A]*16843008|255}},(ht,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.GlobalWorkerOptions=void 0;const Q=Object.create(null);f.GlobalWorkerOptions=Q,Q.workerPort=null,Q.workerSrc=""},(ht,f,Q)=>{var X,Ke,A,Je,L,ge;Object.defineProperty(f,"__esModule",{value:!0}),f.MessageHandler=void 0;var p=Q(1);const F={UNKNOWN:0,DATA:1,ERROR:2},z={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function H(m){switch(m instanceof Error||typeof m=="object"&&m!==null||(0,p.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),m.name){case"AbortException":return new p.AbortException(m.message);case"MissingPDFException":return new p.MissingPDFException(m.message);case"PasswordException":return new p.PasswordException(m.message,m.code);case"UnexpectedResponseException":return new p.UnexpectedResponseException(m.message,m.status);case"UnknownErrorException":return new p.UnknownErrorException(m.message,m.details);default:return new p.UnknownErrorException(m.message,m.toString())}}class at{constructor(y,d,S){$(this,X);$(this,A);$(this,L);this.sourceName=y,this.targetName=d,this.comObj=S,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=P=>{const x=P.data;if(x.targetName!==this.sourceName)return;if(x.stream){tt(this,A,Je).call(this,x);return}if(x.callback){const s=x.callbackId,r=this.callbackCapabilities[s];if(!r)throw new Error(`Cannot resolve callback ${s}`);if(delete this.callbackCapabilities[s],x.callback===F.DATA)r.resolve(x.data);else if(x.callback===F.ERROR)r.reject(H(x.reason));else throw new Error("Unexpected callback case");return}const g=this.actionHandler[x.action];if(!g)throw new Error(`Unknown action from worker: ${x.action}`);if(x.callbackId){const s=this.sourceName,r=x.sourceName;new Promise(function(a){a(g(x.data))}).then(function(a){S.postMessage({sourceName:s,targetName:r,callback:F.DATA,callbackId:x.callbackId,data:a})},function(a){S.postMessage({sourceName:s,targetName:r,callback:F.ERROR,callbackId:x.callbackId,reason:H(a)})});return}if(x.streamId){tt(this,X,Ke).call(this,x);return}g(x.data)},S.addEventListener("message",this._onComObjOnMessage)}on(y,d){const S=this.actionHandler;if(S[y])throw new Error(`There is already an actionName called "${y}"`);S[y]=d}send(y,d,S){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:y,data:d},S)}sendWithPromise(y,d,S){const P=this.callbackId++,x=new p.PromiseCapability;this.callbackCapabilities[P]=x;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:y,callbackId:P,data:d},S)}catch(g){x.reject(g)}return x.promise}sendWithStream(y,d,S,P){const x=this.streamId++,g=this.sourceName,s=this.targetName,r=this.comObj;return new ReadableStream({start:a=>{const e=new p.PromiseCapability;return this.streamControllers[x]={controller:a,startCall:e,pullCall:null,cancelCall:null,isClosed:!1},r.postMessage({sourceName:g,targetName:s,action:y,streamId:x,data:d,desiredSize:a.desiredSize},P),e.promise},pull:a=>{const e=new p.PromiseCapability;return this.streamControllers[x].pullCall=e,r.postMessage({sourceName:g,targetName:s,stream:z.PULL,streamId:x,desiredSize:a.desiredSize}),e.promise},cancel:a=>{(0,p.assert)(a instanceof Error,"cancel must have a valid reason");const e=new p.PromiseCapability;return this.streamControllers[x].cancelCall=e,this.streamControllers[x].isClosed=!0,r.postMessage({sourceName:g,targetName:s,stream:z.CANCEL,streamId:x,reason:H(a)}),e.promise}},S)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}X=new WeakSet,Ke=function(y){const d=y.streamId,S=this.sourceName,P=y.sourceName,x=this.comObj,g=this,s=this.actionHandler[y.action],r={enqueue(a,e=1,u){if(this.isCancelled)return;const T=this.desiredSize;this.desiredSize-=e,T>0&&this.desiredSize<=0&&(this.sinkCapability=new p.PromiseCapability,this.ready=this.sinkCapability.promise),x.postMessage({sourceName:S,targetName:P,stream:z.ENQUEUE,streamId:d,chunk:a},u)},close(){this.isCancelled||(this.isCancelled=!0,x.postMessage({sourceName:S,targetName:P,stream:z.CLOSE,streamId:d}),delete g.streamSinks[d])},error(a){(0,p.assert)(a instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,x.postMessage({sourceName:S,targetName:P,stream:z.ERROR,streamId:d,reason:H(a)}))},sinkCapability:new p.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:y.desiredSize,ready:null};r.sinkCapability.resolve(),r.ready=r.sinkCapability.promise,this.streamSinks[d]=r,new Promise(function(a){a(s(y.data,r))}).then(function(){x.postMessage({sourceName:S,targetName:P,stream:z.START_COMPLETE,streamId:d,success:!0})},function(a){x.postMessage({sourceName:S,targetName:P,stream:z.START_COMPLETE,streamId:d,reason:H(a)})})},A=new WeakSet,Je=function(y){const d=y.streamId,S=this.sourceName,P=y.sourceName,x=this.comObj,g=this.streamControllers[d],s=this.streamSinks[d];switch(y.stream){case z.START_COMPLETE:y.success?g.startCall.resolve():g.startCall.reject(H(y.reason));break;case z.PULL_COMPLETE:y.success?g.pullCall.resolve():g.pullCall.reject(H(y.reason));break;case z.PULL:if(!s){x.postMessage({sourceName:S,targetName:P,stream:z.PULL_COMPLETE,streamId:d,success:!0});break}s.desiredSize<=0&&y.desiredSize>0&&s.sinkCapability.resolve(),s.desiredSize=y.desiredSize,new Promise(function(r){var a;r((a=s.onPull)==null?void 0:a.call(s))}).then(function(){x.postMessage({sourceName:S,targetName:P,stream:z.PULL_COMPLETE,streamId:d,success:!0})},function(r){x.postMessage({sourceName:S,targetName:P,stream:z.PULL_COMPLETE,streamId:d,reason:H(r)})});break;case z.ENQUEUE:if((0,p.assert)(g,"enqueue should have stream controller"),g.isClosed)break;g.controller.enqueue(y.chunk);break;case z.CLOSE:if((0,p.assert)(g,"close should have stream controller"),g.isClosed)break;g.isClosed=!0,g.controller.close(),tt(this,L,ge).call(this,g,d);break;case z.ERROR:(0,p.assert)(g,"error should have stream controller"),g.controller.error(H(y.reason)),tt(this,L,ge).call(this,g,d);break;case z.CANCEL_COMPLETE:y.success?g.cancelCall.resolve():g.cancelCall.reject(H(y.reason)),tt(this,L,ge).call(this,g,d);break;case z.CANCEL:if(!s)break;new Promise(function(r){var a;r((a=s.onCancel)==null?void 0:a.call(s,H(y.reason)))}).then(function(){x.postMessage({sourceName:S,targetName:P,stream:z.CANCEL_COMPLETE,streamId:d,success:!0})},function(r){x.postMessage({sourceName:S,targetName:P,stream:z.CANCEL_COMPLETE,streamId:d,reason:H(r)})}),s.sinkCapability.reject(H(y.reason)),s.isCancelled=!0,delete this.streamSinks[d];break;default:throw new Error("Unexpected stream case")}},L=new WeakSet,ge=async function(y,d){var S,P,x;await Promise.allSettled([(S=y.startCall)==null?void 0:S.promise,(P=y.pullCall)==null?void 0:P.promise,(x=y.cancelCall)==null?void 0:x.promise]),delete this.streamControllers[d]},f.MessageHandler=at},(ht,f,Q)=>{var z,H;Object.defineProperty(f,"__esModule",{value:!0}),f.Metadata=void 0;var p=Q(1);class F{constructor({parsedData:X,rawData:w}){$(this,z,void 0);$(this,H,void 0);ft(this,z,X),ft(this,H,w)}getRaw(){return l(this,H)}get(X){return l(this,z).get(X)??null}getAll(){return(0,p.objectFromMap)(l(this,z))}has(X){return l(this,z).has(X)}}z=new WeakMap,H=new WeakMap,f.Metadata=F},(ht,f,Q)=>{var X,w,A,I,L,E,xe;Object.defineProperty(f,"__esModule",{value:!0}),f.OptionalContentConfig=void 0;var p=Q(1),F=Q(8);const z=Symbol("INTERNAL");class H{constructor(d,S){$(this,X,!0);this.name=d,this.intent=S}get visible(){return l(this,X)}_setVisible(d,S){d!==z&&(0,p.unreachable)("Internal method `_setVisible` called."),ft(this,X,S)}}X=new WeakMap;class at{constructor(d){$(this,E);$(this,w,null);$(this,A,new Map);$(this,I,null);$(this,L,null);if(this.name=null,this.creator=null,d!==null){this.name=d.name,this.creator=d.creator,ft(this,L,d.order);for(const S of d.groups)l(this,A).set(S.id,new H(S.name,S.intent));if(d.baseState==="OFF")for(const S of l(this,A).values())S._setVisible(z,!1);for(const S of d.on)l(this,A).get(S)._setVisible(z,!0);for(const S of d.off)l(this,A).get(S)._setVisible(z,!1);ft(this,I,this.getHash())}}isVisible(d){if(l(this,A).size===0)return!0;if(!d)return(0,p.warn)("Optional content group not defined."),!0;if(d.type==="OCG")return l(this,A).has(d.id)?l(this,A).get(d.id).visible:((0,p.warn)(`Optional content group not found: ${d.id}`),!0);if(d.type==="OCMD"){if(d.expression)return tt(this,E,xe).call(this,d.expression);if(!d.policy||d.policy==="AnyOn"){for(const S of d.ids){if(!l(this,A).has(S))return(0,p.warn)(`Optional content group not found: ${S}`),!0;if(l(this,A).get(S).visible)return!0}return!1}else if(d.policy==="AllOn"){for(const S of d.ids){if(!l(this,A).has(S))return(0,p.warn)(`Optional content group not found: ${S}`),!0;if(!l(this,A).get(S).visible)return!1}return!0}else if(d.policy==="AnyOff"){for(const S of d.ids){if(!l(this,A).has(S))return(0,p.warn)(`Optional content group not found: ${S}`),!0;if(!l(this,A).get(S).visible)return!0}return!1}else if(d.policy==="AllOff"){for(const S of d.ids){if(!l(this,A).has(S))return(0,p.warn)(`Optional content group not found: ${S}`),!0;if(l(this,A).get(S).visible)return!1}return!0}return(0,p.warn)(`Unknown optional content policy ${d.policy}.`),!0}return(0,p.warn)(`Unknown group type ${d.type}.`),!0}setVisibility(d,S=!0){if(!l(this,A).has(d)){(0,p.warn)(`Optional content group not found: ${d}`);return}l(this,A).get(d)._setVisible(z,!!S),ft(this,w,null)}get hasInitialVisibility(){return this.getHash()===l(this,I)}getOrder(){return l(this,A).size?l(this,L)?l(this,L).slice():[...l(this,A).keys()]:null}getGroups(){return l(this,A).size>0?(0,p.objectFromMap)(l(this,A)):null}getGroup(d){return l(this,A).get(d)||null}getHash(){if(l(this,w)!==null)return l(this,w);const d=new F.MurmurHash3_64;for(const[S,P]of l(this,A))d.update(`${S}:${P.visible}`);return ft(this,w,d.hexdigest())}}w=new WeakMap,A=new WeakMap,I=new WeakMap,L=new WeakMap,E=new WeakSet,xe=function(d){const S=d.length;if(S<2)return!0;const P=d[0];for(let x=1;x<S;x++){const g=d[x];let s;if(Array.isArray(g))s=tt(this,E,xe).call(this,g);else if(l(this,A).has(g))s=l(this,A).get(g).visible;else return(0,p.warn)(`Optional content group not found: ${g}`),!0;switch(P){case"And":if(!s)return!1;break;case"Or":if(s)return!0;break;case"Not":return!s;default:return!0}}return P==="And"},f.OptionalContentConfig=at},(ht,f,Q)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.PDFDataTransportStream=void 0;var p=Q(1),F=Q(6);class z{constructor({length:w,initialData:A,progressiveDone:I=!1,contentDispositionFilename:L=null,disableRange:E=!1,disableStream:m=!1},y){if((0,p.assert)(y,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=I,this._contentDispositionFilename=L,(A==null?void 0:A.length)>0){const d=A instanceof Uint8Array&&A.byteLength===A.buffer.byteLength?A.buffer:new Uint8Array(A).buffer;this._queuedChunks.push(d)}this._pdfDataRangeTransport=y,this._isStreamingSupported=!m,this._isRangeSupported=!E,this._contentLength=w,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((d,S)=>{this._onReceiveData({begin:d,chunk:S})}),this._pdfDataRangeTransport.addProgressListener((d,S)=>{this._onProgress({loaded:d,total:S})}),this._pdfDataRangeTransport.addProgressiveReadListener(d=>{this._onReceiveData({chunk:d})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData({begin:w,chunk:A}){const I=A instanceof Uint8Array&&A.byteLength===A.buffer.byteLength?A.buffer:new Uint8Array(A).buffer;if(w===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(I):this._queuedChunks.push(I);else{const L=this._rangeReaders.some(function(E){return E._begin!==w?!1:(E._enqueue(I),!0)});(0,p.assert)(L,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var w;return((w=this._fullRequestReader)==null?void 0:w._loaded)??0}_onProgress(w){var A,I,L,E;w.total===void 0?(I=(A=this._rangeReaders[0])==null?void 0:A.onProgress)==null||I.call(A,{loaded:w.loaded}):(E=(L=this._fullRequestReader)==null?void 0:L.onProgress)==null||E.call(L,{loaded:w.loaded,total:w.total})}_onProgressiveDone(){var w;(w=this._fullRequestReader)==null||w.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(w){const A=this._rangeReaders.indexOf(w);A>=0&&this._rangeReaders.splice(A,1)}getFullReader(){(0,p.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const w=this._queuedChunks;return this._queuedChunks=null,new H(this,w,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(w,A){if(A<=this._progressiveDataLength)return null;const I=new at(this,w,A);return this._pdfDataRangeTransport.requestDataRange(w,A),this._rangeReaders.push(I),I}cancelAllRequests(w){var A;(A=this._fullRequestReader)==null||A.cancel(w);for(const I of this._rangeReaders.slice(0))I.cancel(w);this._pdfDataRangeTransport.abort()}}f.PDFDataTransportStream=z;class H{constructor(w,A,I=!1,L=null){this._stream=w,this._done=I||!1,this._filename=(0,F.isPdfFile)(L)?L:null,this._queuedChunks=A||[],this._loaded=0;for(const E of this._queuedChunks)this._loaded+=E.byteLength;this._requests=[],this._headersReady=Promise.resolve(),w._fullRequestReader=this,this.onProgress=null}_enqueue(w){this._done||(this._requests.length>0?this._requests.shift().resolve({value:w,done:!1}):this._queuedChunks.push(w),this._loaded+=w.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const w=new p.PromiseCapability;return this._requests.push(w),w.promise}cancel(w){this._done=!0;for(const A of this._requests)A.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class at{constructor(w,A,I){this._stream=w,this._begin=A,this._end=I,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(w){if(!this._done){if(this._requests.length===0)this._queuedChunk=w;else{this._requests.shift().resolve({value:w,done:!1});for(const I of this._requests)I.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const A=this._queuedChunk;return this._queuedChunk=null,{value:A,done:!1}}if(this._done)return{value:void 0,done:!0};const w=new p.PromiseCapability;return this._requests.push(w),w.promise}cancel(w){this._done=!0;for(const A of this._requests)A.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(ht,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.XfaText=void 0;class Q{static textContent(F){const z=[],H={items:z,styles:Object.create(null)};function at(X){var I;if(!X)return;let w=null;const A=X.name;if(A==="#text")w=X.value;else if(Q.shouldBuildText(A))(I=X==null?void 0:X.attributes)!=null&&I.textContent?w=X.attributes.textContent:X.value&&(w=X.value);else return;if(w!==null&&z.push({str:w}),!!X.children)for(const L of X.children)at(L)}return at(F),H}static shouldBuildText(F){return!(F==="textarea"||F==="input"||F==="option"||F==="select")}}f.XfaText=Q},(ht,f,Q)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.NodeStandardFontDataFactory=f.NodeFilterFactory=f.NodeCanvasFactory=f.NodeCMapReaderFactory=void 0;var p=Q(7);const F=function(w){return new Promise((A,I)=>{require$$5.readFile(w,(E,m)=>{if(E||!m){I(new Error(E));return}A(new Uint8Array(m))})})};class z extends p.BaseFilterFactory{}f.NodeFilterFactory=z;class H extends p.BaseCanvasFactory{_createCanvas(A,I){return require$$5.createCanvas(A,I)}}f.NodeCanvasFactory=H;class at extends p.BaseCMapReaderFactory{_fetchData(A,I){return F(A).then(L=>({cMapData:L,compressionType:I}))}}f.NodeCMapReaderFactory=at;class X extends p.BaseStandardFontDataFactory{_fetchData(A){return F(A)}}f.NodeStandardFontDataFactory=X},(ht,f,Q)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.PDFNodeStream=void 0;var p=Q(1),F=Q(22);const z=require$$5,H=require$$5,at=require$$5,X=require$$5,w=/^file:\/\/\/[a-zA-Z]:\//;function A(x){const g=X.parse(x);return g.protocol==="file:"||g.host?g:/^[a-z]:[/\\]/i.test(x)?X.parse(`file:///${x}`):(g.host||(g.protocol="file:"),g)}class I{constructor(g){this.source=g,this.url=A(g.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&g.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var g;return((g=this._fullRequestReader)==null?void 0:g._loaded)??0}getFullReader(){return(0,p.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new S(this):new y(this),this._fullRequestReader}getRangeReader(g,s){if(s<=this._progressiveDataLength)return null;const r=this.isFsUrl?new P(this,g,s):new d(this,g,s);return this._rangeRequestReaders.push(r),r}cancelAllRequests(g){var s;(s=this._fullRequestReader)==null||s.cancel(g);for(const r of this._rangeRequestReaders.slice(0))r.cancel(g)}}f.PDFNodeStream=I;class L{constructor(g){this._url=g.url,this._done=!1,this._storedError=null,this.onProgress=null;const s=g.source;this._contentLength=s.length,this._loaded=0,this._filename=null,this._disableRange=s.disableRange||!1,this._rangeChunkSize=s.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!s.disableStream,this._isRangeSupported=!s.disableRange,this._readableStream=null,this._readCapability=new p.PromiseCapability,this._headersCapability=new p.PromiseCapability}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var r;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const g=this._readableStream.read();return g===null?(this._readCapability=new p.PromiseCapability,this.read()):(this._loaded+=g.length,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(g).buffer,done:!1})}cancel(g){if(!this._readableStream){this._error(g);return}this._readableStream.destroy(g)}_error(g){this._storedError=g,this._readCapability.resolve()}_setReadableStream(g){this._readableStream=g,g.on("readable",()=>{this._readCapability.resolve()}),g.on("end",()=>{g.destroy(),this._done=!0,this._readCapability.resolve()}),g.on("error",s=>{this._error(s)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new p.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class E{constructor(g){this._url=g.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new p.PromiseCapability;const s=g.source;this._isStreamingSupported=!s.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var r;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const g=this._readableStream.read();return g===null?(this._readCapability=new p.PromiseCapability,this.read()):(this._loaded+=g.length,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded}),{value:new Uint8Array(g).buffer,done:!1})}cancel(g){if(!this._readableStream){this._error(g);return}this._readableStream.destroy(g)}_error(g){this._storedError=g,this._readCapability.resolve()}_setReadableStream(g){this._readableStream=g,g.on("readable",()=>{this._readCapability.resolve()}),g.on("end",()=>{g.destroy(),this._done=!0,this._readCapability.resolve()}),g.on("error",s=>{this._error(s)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function m(x,g){return{protocol:x.protocol,auth:x.auth,host:x.hostname,port:x.port,path:x.path,method:"GET",headers:g}}class y extends L{constructor(g){super(g);const s=r=>{if(r.statusCode===404){const T=new p.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=T,this._headersCapability.reject(T);return}this._headersCapability.resolve(),this._setReadableStream(r);const a=T=>this._readableStream.headers[T.toLowerCase()],{allowRangeRequests:e,suggestedLength:u}=(0,F.validateRangeRequestCapabilities)({getResponseHeader:a,isHttp:g.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=e,this._contentLength=u||this._contentLength,this._filename=(0,F.extractFilenameFromHeader)(a)};this._request=null,this._url.protocol==="http:"?this._request=H.request(m(this._url,g.httpHeaders),s):this._request=at.request(m(this._url,g.httpHeaders),s),this._request.on("error",r=>{this._storedError=r,this._headersCapability.reject(r)}),this._request.end()}}class d extends E{constructor(g,s,r){super(g),this._httpHeaders={};for(const e in g.httpHeaders){const u=g.httpHeaders[e];u!==void 0&&(this._httpHeaders[e]=u)}this._httpHeaders.Range=`bytes=${s}-${r-1}`;const a=e=>{if(e.statusCode===404){const u=new p.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=u;return}this._setReadableStream(e)};this._request=null,this._url.protocol==="http:"?this._request=H.request(m(this._url,this._httpHeaders),a):this._request=at.request(m(this._url,this._httpHeaders),a),this._request.on("error",e=>{this._storedError=e}),this._request.end()}}class S extends L{constructor(g){super(g);let s=decodeURIComponent(this._url.path);w.test(this._url.href)&&(s=s.replace(/^\//,"")),z.lstat(s,(r,a)=>{if(r){r.code==="ENOENT"&&(r=new p.MissingPDFException(`Missing PDF "${s}".`)),this._storedError=r,this._headersCapability.reject(r);return}this._contentLength=a.size,this._setReadableStream(z.createReadStream(s)),this._headersCapability.resolve()})}}class P extends E{constructor(g,s,r){super(g);let a=decodeURIComponent(this._url.path);w.test(this._url.href)&&(a=a.replace(/^\//,"")),this._setReadableStream(z.createReadStream(a,{start:s,end:r-1}))}}},(ht,f,Q)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.createResponseStatusError=X,f.extractFilenameFromHeader=at,f.validateRangeRequestCapabilities=H,f.validateResponseStatus=w;var p=Q(1),F=Q(23),z=Q(6);function H({getResponseHeader:A,isHttp:I,rangeChunkSize:L,disableRange:E}){const m={allowRangeRequests:!1,suggestedLength:void 0},y=parseInt(A("Content-Length"),10);return!Number.isInteger(y)||(m.suggestedLength=y,y<=2*L)||E||!I||A("Accept-Ranges")!=="bytes"||(A("Content-Encoding")||"identity")!=="identity"||(m.allowRangeRequests=!0),m}function at(A){const I=A("Content-Disposition");if(I){let L=(0,F.getFilenameFromContentDispositionHeader)(I);if(L.includes("%"))try{L=decodeURIComponent(L)}catch{}if((0,z.isPdfFile)(L))return L}return null}function X(A,I){return A===404||A===0&&I.startsWith("file:")?new p.MissingPDFException('Missing PDF "'+I+'".'):new p.UnexpectedResponseException(`Unexpected server response (${A}) while retrieving PDF "${I}".`,A)}function w(A){return A===200||A===206}},(ht,f,Q)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.getFilenameFromContentDispositionHeader=F;var p=Q(1);function F(z){let H=!0,at=X("filename\\*","i").exec(z);if(at){at=at[1];let y=L(at);return y=unescape(y),y=E(y),y=m(y),A(y)}if(at=I(z),at){const y=m(at);return A(y)}if(at=X("filename","i").exec(z),at){at=at[1];let y=L(at);return y=m(y),A(y)}function X(y,d){return new RegExp("(?:^|;)\\s*"+y+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',d)}function w(y,d){if(y){if(!/^[\x00-\xFF]+$/.test(d))return d;try{const S=new TextDecoder(y,{fatal:!0}),P=(0,p.stringToBytes)(d);d=S.decode(P),H=!1}catch{}}return d}function A(y){return H&&/[\x80-\xff]/.test(y)&&(y=w("utf-8",y),H&&(y=w("iso-8859-1",y))),y}function I(y){const d=[];let S;const P=X("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(S=P.exec(y))!==null;){let[,g,s,r]=S;if(g=parseInt(g,10),g in d){if(g===0)break;continue}d[g]=[s,r]}const x=[];for(let g=0;g<d.length&&g in d;++g){let[s,r]=d[g];r=L(r),s&&(r=unescape(r),g===0&&(r=E(r))),x.push(r)}return x.join("")}function L(y){if(y.startsWith('"')){const d=y.slice(1).split('\\"');for(let S=0;S<d.length;++S){const P=d[S].indexOf('"');P!==-1&&(d[S]=d[S].slice(0,P),d.length=S+1),d[S]=d[S].replaceAll(/\\(.)/g,"$1")}y=d.join('"')}return y}function E(y){const d=y.indexOf("'");if(d===-1)return y;const S=y.slice(0,d),x=y.slice(d+1).replace(/^[^']*'/,"");return w(S,x)}function m(y){return!y.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(y)?y:y.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(d,S,P,x){if(P==="q"||P==="Q")return x=x.replaceAll("_"," "),x=x.replaceAll(/=([0-9a-fA-F]{2})/g,function(g,s){return String.fromCharCode(parseInt(s,16))}),w(S,x);try{x=atob(x)}catch{}return w(S,x)})}return""}},(ht,f,Q)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.PDFNetworkStream=void 0;var p=Q(1),F=Q(22);const z=200,H=206;function at(L){const E=L.response;return typeof E!="string"?E:(0,p.stringToBytes)(E).buffer}class X{constructor(E,m={}){this.url=E,this.isHttp=/^https?:/i.test(E),this.httpHeaders=this.isHttp&&m.httpHeaders||Object.create(null),this.withCredentials=m.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(E,m,y){const d={begin:E,end:m};for(const S in y)d[S]=y[S];return this.request(d)}requestFull(E){return this.request(E)}request(E){const m=new XMLHttpRequest,y=this.currXhrId++,d=this.pendingRequests[y]={xhr:m};m.open("GET",this.url),m.withCredentials=this.withCredentials;for(const S in this.httpHeaders){const P=this.httpHeaders[S];P!==void 0&&m.setRequestHeader(S,P)}return this.isHttp&&"begin"in E&&"end"in E?(m.setRequestHeader("Range",`bytes=${E.begin}-${E.end-1}`),d.expectedStatus=H):d.expectedStatus=z,m.responseType="arraybuffer",E.onError&&(m.onerror=function(S){E.onError(m.status)}),m.onreadystatechange=this.onStateChange.bind(this,y),m.onprogress=this.onProgress.bind(this,y),d.onHeadersReceived=E.onHeadersReceived,d.onDone=E.onDone,d.onError=E.onError,d.onProgress=E.onProgress,m.send(null),y}onProgress(E,m){var d;const y=this.pendingRequests[E];y&&((d=y.onProgress)==null||d.call(y,m))}onStateChange(E,m){var g,s,r;const y=this.pendingRequests[E];if(!y)return;const d=y.xhr;if(d.readyState>=2&&y.onHeadersReceived&&(y.onHeadersReceived(),delete y.onHeadersReceived),d.readyState!==4||!(E in this.pendingRequests))return;if(delete this.pendingRequests[E],d.status===0&&this.isHttp){(g=y.onError)==null||g.call(y,d.status);return}const S=d.status||z;if(!(S===z&&y.expectedStatus===H)&&S!==y.expectedStatus){(s=y.onError)==null||s.call(y,d.status);return}const x=at(d);if(S===H){const a=d.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(a);y.onDone({begin:parseInt(e[1],10),chunk:x})}else x?y.onDone({begin:0,chunk:x}):(r=y.onError)==null||r.call(y,d.status)}getRequestXhr(E){return this.pendingRequests[E].xhr}isPendingRequest(E){return E in this.pendingRequests}abortRequest(E){const m=this.pendingRequests[E].xhr;delete this.pendingRequests[E],m.abort()}}class w{constructor(E){this._source=E,this._manager=new X(E.url,{httpHeaders:E.httpHeaders,withCredentials:E.withCredentials}),this._rangeChunkSize=E.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(E){const m=this._rangeRequestReaders.indexOf(E);m>=0&&this._rangeRequestReaders.splice(m,1)}getFullReader(){return(0,p.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new A(this._manager,this._source),this._fullRequestReader}getRangeReader(E,m){const y=new I(this._manager,E,m);return y.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(y),y}cancelAllRequests(E){var m;(m=this._fullRequestReader)==null||m.cancel(E);for(const y of this._rangeRequestReaders.slice(0))y.cancel(E)}}f.PDFNetworkStream=w;class A{constructor(E,m){this._manager=E;const y={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=m.url,this._fullRequestId=E.requestFull(y),this._headersReceivedCapability=new p.PromiseCapability,this._disableRange=m.disableRange||!1,this._contentLength=m.length,this._rangeChunkSize=m.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const E=this._fullRequestId,m=this._manager.getRequestXhr(E),y=P=>m.getResponseHeader(P),{allowRangeRequests:d,suggestedLength:S}=(0,F.validateRangeRequestCapabilities)({getResponseHeader:y,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});d&&(this._isRangeSupported=!0),this._contentLength=S||this._contentLength,this._filename=(0,F.extractFilenameFromHeader)(y),this._isRangeSupported&&this._manager.abortRequest(E),this._headersReceivedCapability.resolve()}_onDone(E){if(E&&(this._requests.length>0?this._requests.shift().resolve({value:E.chunk,done:!1}):this._cachedChunks.push(E.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const m of this._requests)m.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(E){this._storedError=(0,F.createResponseStatusError)(E,this._url),this._headersReceivedCapability.reject(this._storedError);for(const m of this._requests)m.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(E){var m;(m=this.onProgress)==null||m.call(this,{loaded:E.loaded,total:E.lengthComputable?E.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const E=new p.PromiseCapability;return this._requests.push(E),E.promise}cancel(E){this._done=!0,this._headersReceivedCapability.reject(E);for(const m of this._requests)m.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class I{constructor(E,m,y){this._manager=E;const d={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=E.url,this._requestId=E.requestRange(m,y,d),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var E;(E=this.onClosed)==null||E.call(this,this)}_onDone(E){const m=E.chunk;this._requests.length>0?this._requests.shift().resolve({value:m,done:!1}):this._queuedChunk=m,this._done=!0;for(const y of this._requests)y.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(E){this._storedError=(0,F.createResponseStatusError)(E,this._url);for(const m of this._requests)m.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(E){var m;this.isStreamingSupported||(m=this.onProgress)==null||m.call(this,{loaded:E.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const m=this._queuedChunk;return this._queuedChunk=null,{value:m,done:!1}}if(this._done)return{value:void 0,done:!0};const E=new p.PromiseCapability;return this._requests.push(E),E.promise}cancel(E){this._done=!0;for(const m of this._requests)m.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(ht,f,Q)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.PDFFetchStream=void 0;var p=Q(1),F=Q(22);function z(I,L,E){return{method:"GET",headers:I,signal:E.signal,mode:"cors",credentials:L?"include":"same-origin",redirect:"follow"}}function H(I){const L=new Headers;for(const E in I){const m=I[E];m!==void 0&&L.append(E,m)}return L}function at(I){return I instanceof Uint8Array?I.buffer:I instanceof ArrayBuffer?I:((0,p.warn)(`getArrayBuffer - unexpected data format: ${I}`),new Uint8Array(I).buffer)}class X{constructor(L){this.source=L,this.isHttp=/^https?:/i.test(L.url),this.httpHeaders=this.isHttp&&L.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var L;return((L=this._fullRequestReader)==null?void 0:L._loaded)??0}getFullReader(){return(0,p.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new w(this),this._fullRequestReader}getRangeReader(L,E){if(E<=this._progressiveDataLength)return null;const m=new A(this,L,E);return this._rangeRequestReaders.push(m),m}cancelAllRequests(L){var E;(E=this._fullRequestReader)==null||E.cancel(L);for(const m of this._rangeRequestReaders.slice(0))m.cancel(L)}}f.PDFFetchStream=X;class w{constructor(L){this._stream=L,this._reader=null,this._loaded=0,this._filename=null;const E=L.source;this._withCredentials=E.withCredentials||!1,this._contentLength=E.length,this._headersCapability=new p.PromiseCapability,this._disableRange=E.disableRange||!1,this._rangeChunkSize=E.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!E.disableStream,this._isRangeSupported=!E.disableRange,this._headers=H(this._stream.httpHeaders);const m=E.url;fetch(m,z(this._headers,this._withCredentials,this._abortController)).then(y=>{if(!(0,F.validateResponseStatus)(y.status))throw(0,F.createResponseStatusError)(y.status,m);this._reader=y.body.getReader(),this._headersCapability.resolve();const d=x=>y.headers.get(x),{allowRangeRequests:S,suggestedLength:P}=(0,F.validateRangeRequestCapabilities)({getResponseHeader:d,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=S,this._contentLength=P||this._contentLength,this._filename=(0,F.extractFilenameFromHeader)(d),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new p.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var m;await this._headersCapability.promise;const{value:L,done:E}=await this._reader.read();return E?{value:L,done:E}:(this._loaded+=L.byteLength,(m=this.onProgress)==null||m.call(this,{loaded:this._loaded,total:this._contentLength}),{value:at(L),done:!1})}cancel(L){var E;(E=this._reader)==null||E.cancel(L),this._abortController.abort()}}class A{constructor(L,E,m){this._stream=L,this._reader=null,this._loaded=0;const y=L.source;this._withCredentials=y.withCredentials||!1,this._readCapability=new p.PromiseCapability,this._isStreamingSupported=!y.disableStream,this._abortController=new AbortController,this._headers=H(this._stream.httpHeaders),this._headers.append("Range",`bytes=${E}-${m-1}`);const d=y.url;fetch(d,z(this._headers,this._withCredentials,this._abortController)).then(S=>{if(!(0,F.validateResponseStatus)(S.status))throw(0,F.createResponseStatusError)(S.status,d);this._readCapability.resolve(),this._reader=S.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var m;await this._readCapability.promise;const{value:L,done:E}=await this._reader.read();return E?{value:L,done:E}:(this._loaded+=L.byteLength,(m=this.onProgress)==null||m.call(this,{loaded:this._loaded}),{value:at(L),done:!1})}cancel(L){var E;(E=this._reader)==null||E.cancel(L),this._abortController.abort()}}},(ht,f,Q)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.TextLayerRenderTask=void 0,f.renderTextLayer=y,f.updateTextLayer=d;var p=Q(1),F=Q(6);const z=1e5,H=30,at=.8,X=new Map;function w(S,P){let x;if(P&&p.FeatureTest.isOffscreenCanvasSupported)x=new OffscreenCanvas(S,S).getContext("2d",{alpha:!1});else{const g=document.createElement("canvas");g.width=g.height=S,x=g.getContext("2d",{alpha:!1})}return x}function A(S,P){const x=X.get(S);if(x)return x;const g=w(H,P);g.font=`${H}px ${S}`;const s=g.measureText("");let r=s.fontBoundingBoxAscent,a=Math.abs(s.fontBoundingBoxDescent);if(r){const u=r/(r+a);return X.set(S,u),g.canvas.width=g.canvas.height=0,u}g.strokeStyle="red",g.clearRect(0,0,H,H),g.strokeText("g",0,0);let e=g.getImageData(0,0,H,H).data;a=0;for(let u=e.length-1-3;u>=0;u-=4)if(e[u]>0){a=Math.ceil(u/4/H);break}g.clearRect(0,0,H,H),g.strokeText("A",0,H),e=g.getImageData(0,0,H,H).data,r=0;for(let u=0,T=e.length;u<T;u+=4)if(e[u]>0){r=H-Math.floor(u/4/H);break}if(g.canvas.width=g.canvas.height=0,r){const u=r/(r+a);return X.set(S,u),u}return X.set(S,at),at}function I(S,P,x){const g=document.createElement("span"),s={angle:0,canvasWidth:0,hasText:P.str!=="",hasEOL:P.hasEOL,fontSize:0};S._textDivs.push(g);const r=p.Util.transform(S._transform,P.transform);let a=Math.atan2(r[1],r[0]);const e=x[P.fontName];e.vertical&&(a+=Math.PI/2);const u=Math.hypot(r[2],r[3]),T=u*A(e.fontFamily,S._isOffscreenCanvasSupported);let i,M;a===0?(i=r[4],M=r[5]-T):(i=r[4]+T*Math.sin(a),M=r[5]-T*Math.cos(a));const U="calc(var(--scale-factor)*",K=g.style;S._container===S._rootContainer?(K.left=`${(100*i/S._pageWidth).toFixed(2)}%`,K.top=`${(100*M/S._pageHeight).toFixed(2)}%`):(K.left=`${U}${i.toFixed(2)}px)`,K.top=`${U}${M.toFixed(2)}px)`),K.fontSize=`${U}${u.toFixed(2)}px)`,K.fontFamily=e.fontFamily,s.fontSize=u,g.setAttribute("role","presentation"),g.textContent=P.str,g.dir=P.dir,S._fontInspectorEnabled&&(g.dataset.fontName=P.fontName),a!==0&&(s.angle=a*(180/Math.PI));let et=!1;if(P.str.length>1)et=!0;else if(P.str!==" "&&P.transform[0]!==P.transform[3]){const nt=Math.abs(P.transform[0]),pt=Math.abs(P.transform[3]);nt!==pt&&Math.max(nt,pt)/Math.min(nt,pt)>1.5&&(et=!0)}et&&(s.canvasWidth=e.vertical?P.height:P.width),S._textDivProperties.set(g,s),S._isReadableStream&&S._layoutText(g)}function L(S){const{div:P,scale:x,properties:g,ctx:s,prevFontSize:r,prevFontFamily:a}=S,{style:e}=P;let u="";if(g.canvasWidth!==0&&g.hasText){const{fontFamily:T}=e,{canvasWidth:i,fontSize:M}=g;(r!==M||a!==T)&&(s.font=`${M*x}px ${T}`,S.prevFontSize=M,S.prevFontFamily=T);const{width:U}=s.measureText(P.textContent);U>0&&(u=`scaleX(${i*x/U})`)}g.angle!==0&&(u=`rotate(${g.angle}deg) ${u}`),u.length>0&&(e.transform=u)}function E(S){if(S._canceled)return;const P=S._textDivs,x=S._capability;if(P.length>z){x.resolve();return}if(!S._isReadableStream)for(const s of P)S._layoutText(s);x.resolve()}class m{constructor({textContentSource:P,container:x,viewport:g,textDivs:s,textDivProperties:r,textContentItemsStr:a,isOffscreenCanvasSupported:e}){var U;this._textContentSource=P,this._isReadableStream=P instanceof ReadableStream,this._container=this._rootContainer=x,this._textDivs=s||[],this._textContentItemsStr=a||[],this._isOffscreenCanvasSupported=e,this._fontInspectorEnabled=!!((U=globalThis.FontInspector)!=null&&U.enabled),this._reader=null,this._textDivProperties=r||new WeakMap,this._canceled=!1,this._capability=new p.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:g.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:w(0,e)};const{pageWidth:u,pageHeight:T,pageX:i,pageY:M}=g.rawDims;this._transform=[1,0,0,-1,-i,M+T],this._pageWidth=u,this._pageHeight=T,(0,F.setLayerDimensions)(x,g),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new p.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new p.AbortException("TextLayer task cancelled."))}_processItems(P,x){for(const g of P){if(g.str===void 0){if(g.type==="beginMarkedContentProps"||g.type==="beginMarkedContent"){const s=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),g.id!==null&&this._container.setAttribute("id",`${g.id}`),s.append(this._container)}else g.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(g.str),I(this,g,x)}}_layoutText(P){const x=this._layoutTextParams.properties=this._textDivProperties.get(P);if(this._layoutTextParams.div=P,L(this._layoutTextParams),x.hasText&&this._container.append(P),x.hasEOL){const g=document.createElement("br");g.setAttribute("role","presentation"),this._container.append(g)}}_render(){const P=new p.PromiseCapability;let x=Object.create(null);if(this._isReadableStream){const g=()=>{this._reader.read().then(({value:s,done:r})=>{if(r){P.resolve();return}Object.assign(x,s.styles),this._processItems(s.items,x),g()},P.reject)};this._reader=this._textContentSource.getReader(),g()}else if(this._textContentSource){const{items:g,styles:s}=this._textContentSource;this._processItems(g,s),P.resolve()}else throw new Error('No "textContentSource" parameter specified.');P.promise.then(()=>{x=null,E(this)},this._capability.reject)}}f.TextLayerRenderTask=m;function y(S){!S.textContentSource&&(S.textContent||S.textContentStream)&&((0,F.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),S.textContentSource=S.textContent||S.textContentStream);const{container:P,viewport:x}=S,g=getComputedStyle(P),s=g.getPropertyValue("visibility"),r=parseFloat(g.getPropertyValue("--scale-factor"));s==="visible"&&(!r||Math.abs(r-x.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const a=new m(S);return a._render(),a}function d({container:S,viewport:P,textDivs:x,textDivProperties:g,isOffscreenCanvasSupported:s,mustRotate:r=!0,mustRescale:a=!0}){if(r&&(0,F.setLayerDimensions)(S,{rotation:P.rotation}),a){const e=w(0,s),T={prevFontSize:null,prevFontFamily:null,div:null,scale:P.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:e};for(const i of x)T.properties=g.get(i),T.div=i,L(T)}}},(ht,f,Q)=>{var w,A,I,L,E,m,y,d,S,ke,x,Qe,s,Fe,a,Re;Object.defineProperty(f,"__esModule",{value:!0}),f.AnnotationEditorLayer=void 0;var p=Q(1),F=Q(5),z=Q(28),H=Q(29),at=Q(6);const u=class u{constructor(i){$(this,S);$(this,x);$(this,s);$(this,a);$(this,w,void 0);$(this,A,!1);$(this,I,this.pointerup.bind(this));$(this,L,this.pointerdown.bind(this));$(this,E,new Map);$(this,m,!1);$(this,y,!1);$(this,d,void 0);u._initialized||(u._initialized=!0,z.FreeTextEditor.initialize(i.l10n),H.InkEditor.initialize(i.l10n)),i.uiManager.registerEditorTypes([z.FreeTextEditor,H.InkEditor]),ft(this,d,i.uiManager),this.pageIndex=i.pageIndex,this.div=i.div,ft(this,w,i.accessibilityManager),l(this,d).addLayer(this)}get isEmpty(){return l(this,E).size===0}updateToolbar(i){l(this,d).updateToolbar(i)}updateMode(i=l(this,d).getMode()){tt(this,a,Re).call(this),i===p.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),l(this,d).unselectAll(),i!==p.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",i===p.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",i===p.AnnotationEditorType.INK),this.div.hidden=!1)}addInkEditorIfNeeded(i){if(!i&&l(this,d).getMode()!==p.AnnotationEditorType.INK)return;if(!i){for(const U of l(this,E).values())if(U.isEmpty()){U.setInBackground();return}}tt(this,s,Fe).call(this,{offsetX:0,offsetY:0}).setInBackground()}setEditingState(i){l(this,d).setEditingState(i)}addCommands(i){l(this,d).addCommands(i)}enable(){this.div.style.pointerEvents="auto";for(const i of l(this,E).values())i.enableEditing()}disable(){this.div.style.pointerEvents="none";for(const i of l(this,E).values())i.disableEditing();tt(this,a,Re).call(this),this.isEmpty&&(this.div.hidden=!0)}setActiveEditor(i){l(this,d).getActive()!==i&&l(this,d).setActiveEditor(i)}enableClick(){this.div.addEventListener("pointerdown",l(this,L)),this.div.addEventListener("pointerup",l(this,I))}disableClick(){this.div.removeEventListener("pointerdown",l(this,L)),this.div.removeEventListener("pointerup",l(this,I))}attach(i){l(this,E).set(i.id,i)}detach(i){var M;l(this,E).delete(i.id),(M=l(this,w))==null||M.removePointerInTextLayer(i.contentDiv)}remove(i){l(this,d).removeEditor(i),this.detach(i),i.div.style.display="none",setTimeout(()=>{i.div.style.display="",i.div.remove(),i.isAttachedToDOM=!1,document.activeElement===document.body&&l(this,d).focusMainContainer()},0),l(this,y)||this.addInkEditorIfNeeded(!1)}add(i){if(tt(this,S,ke).call(this,i),l(this,d).addEditor(i),this.attach(i),!i.isAttachedToDOM){const M=i.render();this.div.append(M),i.isAttachedToDOM=!0}this.moveEditorInDOM(i),i.onceAdded(),l(this,d).addToAnnotationStorage(i)}moveEditorInDOM(i){var M;(M=l(this,w))==null||M.moveElementInDOM(this.div,i.div,i.contentDiv,!0)}addOrRebuild(i){i.needsToBeRebuilt()?i.rebuild():this.add(i)}addANewEditor(i){const M=()=>{this.addOrRebuild(i)},U=()=>{i.remove()};this.addCommands({cmd:M,undo:U,mustExec:!0})}addUndoableEditor(i){const M=()=>{this.addOrRebuild(i)},U=()=>{i.remove()};this.addCommands({cmd:M,undo:U,mustExec:!1})}getNextId(){return l(this,d).getId()}deserialize(i){switch(i.annotationType){case p.AnnotationEditorType.FREETEXT:return z.FreeTextEditor.deserialize(i,this,l(this,d));case p.AnnotationEditorType.INK:return H.InkEditor.deserialize(i,this,l(this,d))}return null}setSelected(i){l(this,d).setSelected(i)}toggleSelected(i){l(this,d).toggleSelected(i)}isSelected(i){return l(this,d).isSelected(i)}unselect(i){l(this,d).unselect(i)}pointerup(i){const{isMac:M}=p.FeatureTest.platform;if(!(i.button!==0||i.ctrlKey&&M)&&i.target===this.div&&l(this,m)){if(ft(this,m,!1),!l(this,A)){ft(this,A,!0);return}tt(this,s,Fe).call(this,i)}}pointerdown(i){const{isMac:M}=p.FeatureTest.platform;if(i.button!==0||i.ctrlKey&&M||i.target!==this.div)return;ft(this,m,!0);const U=l(this,d).getActive();ft(this,A,!U||U.isEmpty())}drop(i){const M=i.dataTransfer.getData("text/plain"),U=l(this,d).getEditor(M);if(!U)return;i.preventDefault(),i.dataTransfer.dropEffect="move",tt(this,S,ke).call(this,U);const K=this.div.getBoundingClientRect(),et=i.clientX-K.x,nt=i.clientY-K.y;U.translate(et-U.startX,nt-U.startY),this.moveEditorInDOM(U),U.div.focus()}dragover(i){i.preventDefault()}destroy(){var i,M;((i=l(this,d).getActive())==null?void 0:i.parent)===this&&l(this,d).setActiveEditor(null);for(const U of l(this,E).values())(M=l(this,w))==null||M.removePointerInTextLayer(U.contentDiv),U.setParent(null),U.isAttachedToDOM=!1,U.div.remove();this.div=null,l(this,E).clear(),l(this,d).removeLayer(this)}render({viewport:i}){this.viewport=i,(0,at.setLayerDimensions)(this.div,i),(0,F.bindEvents)(this,this.div,["dragover","drop"]);for(const M of l(this,d).getEditors(this.pageIndex))this.add(M);this.updateMode()}update({viewport:i}){l(this,d).commitOrRemove(),this.viewport=i,(0,at.setLayerDimensions)(this.div,{rotation:i.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:i,pageHeight:M}=this.viewport.rawDims;return[i,M]}};w=new WeakMap,A=new WeakMap,I=new WeakMap,L=new WeakMap,E=new WeakMap,m=new WeakMap,y=new WeakMap,d=new WeakMap,S=new WeakSet,ke=function(i){var M;i.parent!==this&&(this.attach(i),(M=i.parent)==null||M.detach(i),i.setParent(this),i.div&&i.isAttachedToDOM&&(i.div.remove(),this.div.append(i.div)))},x=new WeakSet,Qe=function(i){switch(l(this,d).getMode()){case p.AnnotationEditorType.FREETEXT:return new z.FreeTextEditor(i);case p.AnnotationEditorType.INK:return new H.InkEditor(i)}return null},s=new WeakSet,Fe=function(i){const M=this.getNextId(),U=tt(this,x,Qe).call(this,{parent:this,id:M,x:i.offsetX,y:i.offsetY,uiManager:l(this,d)});return U&&this.add(U),U},a=new WeakSet,Re=function(){ft(this,y,!0);for(const i of l(this,E).values())i.isEmpty()&&i.remove();ft(this,y,!1)},Ut(u,"_initialized",!1);let X=u;f.AnnotationEditorLayer=X},(ht,f,Q)=>{var at,X,w,A,I,L,E,m,y,d,Ze,P,ts,g,es,r,Me;Object.defineProperty(f,"__esModule",{value:!0}),f.FreeTextEditor=void 0;var p=Q(1),F=Q(5),z=Q(4);const e=class e extends z.AnnotationEditor{constructor(i){super({...i,name:"freeTextEditor"});$(this,d);$(this,P);$(this,g);$(this,r);$(this,at,this.editorDivBlur.bind(this));$(this,X,this.editorDivFocus.bind(this));$(this,w,this.editorDivInput.bind(this));$(this,A,this.editorDivKeydown.bind(this));$(this,I,void 0);$(this,L,"");$(this,E,`${this.id}-editor`);$(this,m,!1);$(this,y,void 0);ft(this,I,i.color||e._defaultColor||z.AnnotationEditor._defaultLineColor),ft(this,y,i.fontSize||e._defaultFontSize)}static initialize(i){this._l10nPromise=new Map(["free_text2_default_content","editor_free_text2_aria_label"].map(U=>[U,i.get(U)]));const M=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(M.getPropertyValue("--freetext-padding"))}static updateDefaultParams(i,M){switch(i){case p.AnnotationEditorParamsType.FREETEXT_SIZE:e._defaultFontSize=M;break;case p.AnnotationEditorParamsType.FREETEXT_COLOR:e._defaultColor=M;break}}updateParams(i,M){switch(i){case p.AnnotationEditorParamsType.FREETEXT_SIZE:tt(this,d,Ze).call(this,M);break;case p.AnnotationEditorParamsType.FREETEXT_COLOR:tt(this,P,ts).call(this,M);break}}static get defaultPropertiesToUpdate(){return[[p.AnnotationEditorParamsType.FREETEXT_SIZE,e._defaultFontSize],[p.AnnotationEditorParamsType.FREETEXT_COLOR,e._defaultColor||z.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[p.AnnotationEditorParamsType.FREETEXT_SIZE,l(this,y)],[p.AnnotationEditorParamsType.FREETEXT_COLOR,l(this,I)]]}getInitialTranslation(){const i=this.parentScale;return[-e._internalPadding*i,-(e._internalPadding+l(this,y))*i]}rebuild(){super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(p.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this.div.draggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",l(this,A)),this.editorDiv.addEventListener("focus",l(this,X)),this.editorDiv.addEventListener("blur",l(this,at)),this.editorDiv.addEventListener("input",l(this,w)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",l(this,E)),this.div.draggable=!0,this.editorDiv.removeEventListener("keydown",l(this,A)),this.editorDiv.removeEventListener("focus",l(this,X)),this.editorDiv.removeEventListener("blur",l(this,at)),this.editorDiv.removeEventListener("input",l(this,w)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(i){super.focusin(i),i.target!==this.editorDiv&&this.editorDiv.focus()}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus())}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing"),super.remove()}commit(){this.isInEditMode()&&(super.commit(),l(this,m)||(ft(this,m,!0),this.parent.addUndoableEditor(this)),this.disableEditMode(),ft(this,L,tt(this,g,es).call(this).trimEnd()),tt(this,r,Me).call(this))}shouldGetKeyboardEvents(){return this.isInEditMode()}dblclick(i){this.enableEditMode(),this.editorDiv.focus()}keydown(i){i.target===this.div&&i.key==="Enter"&&(this.enableEditMode(),this.editorDiv.focus())}editorDivKeydown(i){e._keyboardManager.exec(this,i)}editorDivFocus(i){this.isEditing=!0}editorDivBlur(i){this.isEditing=!1}editorDivInput(i){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let i,M;this.width&&(i=this.x,M=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",l(this,E)),this.enableEditing(),e._l10nPromise.get("editor_free_text2_aria_label").then(K=>{var et;return(et=this.editorDiv)==null?void 0:et.setAttribute("aria-label",K)}),e._l10nPromise.get("free_text2_default_content").then(K=>{var et;return(et=this.editorDiv)==null?void 0:et.setAttribute("default-content",K)}),this.editorDiv.contentEditable=!0;const{style:U}=this.editorDiv;if(U.fontSize=`calc(${l(this,y)}px * var(--scale-factor))`,U.color=l(this,I),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,F.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[K,et]=this.parentDimensions;this.setAt(i*K,M*et,this.width*K,this.height*et);for(const nt of l(this,L).split(` `)){const pt=document.createElement("div");pt.append(nt?document.createTextNode(nt):document.createElement("br")),this.editorDiv.append(pt)}this.div.draggable=!0,this.editorDiv.contentEditable=!1}else this.div.draggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(i,M,U){const K=super.deserialize(i,M,U);return ft(K,y,i.fontSize),ft(K,I,p.Util.makeHexColor(...i.color)),ft(K,L,i.value),K}serialize(){if(this.isEmpty())return null;const i=e._internalPadding*this.parentScale,M=this.getRect(i,i),U=z.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:l(this,I));return{annotationType:p.AnnotationEditorType.FREETEXT,color:U,fontSize:l(this,y),value:l(this,L),pageIndex:this.pageIndex,rect:M,rotation:this.rotation}}};at=new WeakMap,X=new WeakMap,w=new WeakMap,A=new WeakMap,I=new WeakMap,L=new WeakMap,E=new WeakMap,m=new WeakMap,y=new WeakMap,d=new WeakSet,Ze=function(i){const M=K=>{this.editorDiv.style.fontSize=`calc(${K}px * var(--scale-factor))`,this.translate(0,-(K-l(this,y))*this.parentScale),ft(this,y,K),tt(this,r,Me).call(this)},U=l(this,y);this.addCommands({cmd:()=>{M(i)},undo:()=>{M(U)},mustExec:!0,type:p.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},P=new WeakSet,ts=function(i){const M=l(this,I);this.addCommands({cmd:()=>{ft(this,I,this.editorDiv.style.color=i)},undo:()=>{ft(this,I,this.editorDiv.style.color=M)},mustExec:!0,type:p.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},g=new WeakSet,es=function(){const i=this.editorDiv.getElementsByTagName("div");if(i.length===0)return this.editorDiv.innerText;const M=[];for(const U of i)M.push(U.innerText.replace(/\r\n?|\n/,""));return M.join(` `)},r=new WeakSet,Me=function(){const[i,M]=this.parentDimensions;let U;if(this.isAttachedToDOM)U=this.div.getBoundingClientRect();else{const{currentLayer:K,div:et}=this,nt=et.style.display;et.style.display="hidden",K.div.append(this.div),U=et.getBoundingClientRect(),et.remove(),et.style.display=nt}this.width=U.width/i,this.height=U.height/M},Ut(e,"_freeTextDefaultContent",""),Ut(e,"_l10nPromise"),Ut(e,"_internalPadding",0),Ut(e,"_defaultColor",null),Ut(e,"_defaultFontSize",10),Ut(e,"_keyboardManager",new F.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.prototype.commitOrRemove]])),Ut(e,"_type","freetext");let H=e;f.FreeTextEditor=H},(ht,f,Q)=>{var X,w,A,I,L,E,m,y,d,S,P,x,g,s,r,a,e,ss,T,ns,M,is,K,rs,nt,De,rt,as,At,Oe,Tt,os,N,ls,c,cs,O,hs,B,ds,C,Jt,t,Ie,h,me,b,be,J,ie,Z,Le,ct,Ae,lt,us,vt,fs,Pt,ps,mt,gs,Mt,Ne,G,_e,bt,re,Wt,je;Object.defineProperty(f,"__esModule",{value:!0}),f.InkEditor=void 0;var p=Q(1),F=Q(4),z=Q(5);const H=16,jt=class jt extends F.AnnotationEditor{constructor(V){super({...V,name:"inkEditor"});$(this,e);$(this,T);$(this,M);$(this,K);$(this,nt);$(this,rt);$(this,At);$(this,Tt);$(this,N);$(this,c);$(this,O);$(this,B);$(this,C);$(this,t);$(this,h);$(this,b);$(this,J);$(this,Z);$(this,ct);$(this,vt);$(this,Pt);$(this,mt);$(this,Mt);$(this,G);$(this,bt);$(this,Wt);$(this,X,0);$(this,w,0);$(this,A,0);$(this,I,this.canvasContextMenu.bind(this));$(this,L,this.canvasPointermove.bind(this));$(this,E,this.canvasPointerleave.bind(this));$(this,m,this.canvasPointerup.bind(this));$(this,y,this.canvasPointerdown.bind(this));$(this,d,new Path2D);$(this,S,!1);$(this,P,!1);$(this,x,!1);$(this,g,null);$(this,s,0);$(this,r,0);$(this,a,null);this.color=V.color||null,this.thickness=V.thickness||null,this.opacity=V.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0}static initialize(V){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink2_aria_label"].map(dt=>[dt,V.get(dt)]))}static updateDefaultParams(V,dt){switch(V){case p.AnnotationEditorParamsType.INK_THICKNESS:jt._defaultThickness=dt;break;case p.AnnotationEditorParamsType.INK_COLOR:jt._defaultColor=dt;break;case p.AnnotationEditorParamsType.INK_OPACITY:jt._defaultOpacity=dt/100;break}}updateParams(V,dt){switch(V){case p.AnnotationEditorParamsType.INK_THICKNESS:tt(this,e,ss).call(this,dt);break;case p.AnnotationEditorParamsType.INK_COLOR:tt(this,T,ns).call(this,dt);break;case p.AnnotationEditorParamsType.INK_OPACITY:tt(this,M,is).call(this,dt);break}}static get defaultPropertiesToUpdate(){return[[p.AnnotationEditorParamsType.INK_THICKNESS,jt._defaultThickness],[p.AnnotationEditorParamsType.INK_COLOR,jt._defaultColor||F.AnnotationEditor._defaultLineColor],[p.AnnotationEditorParamsType.INK_OPACITY,Math.round(jt._defaultOpacity*100)]]}get propertiesToUpdate(){return[[p.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||jt._defaultThickness],[p.AnnotationEditorParamsType.INK_COLOR,this.color||jt._defaultColor||F.AnnotationEditor._defaultLineColor],[p.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??jt._defaultOpacity))]]}rebuild(){super.rebuild(),this.div!==null&&(this.canvas||(tt(this,h,me).call(this),tt(this,b,be).call(this)),this.isAttachedToDOM||(this.parent.add(this),tt(this,J,ie).call(this)),tt(this,bt,re).call(this))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,l(this,g).disconnect(),ft(this,g,null),super.remove())}setParent(V){!this.parent&&V?this._uiManager.removeShouldRescale(this):this.parent&&V===null&&this._uiManager.addShouldRescale(this),super.setParent(V)}onScaleChanging(){const[V,dt]=this.parentDimensions,_t=this.width*V,yt=this.height*dt;this.setDimensions(_t,yt)}enableEditMode(){l(this,S)||this.canvas===null||(super.enableEditMode(),this.div.draggable=!1,this.canvas.addEventListener("pointerdown",l(this,y)))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this.div.draggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",l(this,y)))}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){l(this,S)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),ft(this,S,!0),this.div.classList.add("disabled"),tt(this,bt,re).call(this,!0),this.parent.addInkEditorIfNeeded(!0),this.parent.moveEditorInDOM(this),this.div.focus({preventScroll:!0}))}focusin(V){super.focusin(V),this.enableEditMode()}canvasPointerdown(V){V.button!==0||!this.isInEditMode()||l(this,S)||(this.setInForeground(),V.preventDefault(),V.type!=="mouse"&&this.div.focus(),tt(this,rt,as).call(this,V.offsetX,V.offsetY))}canvasContextMenu(V){V.preventDefault()}canvasPointermove(V){V.preventDefault(),tt(this,At,Oe).call(this,V.offsetX,V.offsetY)}canvasPointerup(V){V.preventDefault(),tt(this,t,Ie).call(this,V)}canvasPointerleave(V){tt(this,t,Ie).call(this,V)}render(){if(this.div)return this.div;let V,dt;this.width&&(V=this.x,dt=this.y),super.render(),jt._l10nPromise.get("editor_ink2_aria_label").then(Rt=>{var xt;return(xt=this.div)==null?void 0:xt.setAttribute("aria-label",Rt)});const[_t,yt,St,kt]=tt(this,K,rs).call(this);if(this.setAt(_t,yt,0,0),this.setDims(St,kt),tt(this,h,me).call(this),this.width){const[Rt,xt]=this.parentDimensions;this.setAt(V*Rt,dt*xt,this.width*Rt,this.height*xt),ft(this,x,!0),tt(this,J,ie).call(this),this.setDims(this.width*Rt,this.height*xt),tt(this,C,Jt).call(this),tt(this,Wt,je).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return tt(this,b,be).call(this),this.div}setDimensions(V,dt){const _t=Math.round(V),yt=Math.round(dt);if(l(this,s)===_t&&l(this,r)===yt)return;ft(this,s,_t),ft(this,r,yt),this.canvas.style.visibility="hidden",l(this,X)&&Math.abs(l(this,X)-V/dt)>.01&&(dt=Math.ceil(V/l(this,X)),this.setDims(V,dt));const[St,kt]=this.parentDimensions;this.width=V/St,this.height=dt/kt,l(this,S)&&tt(this,Z,Le).call(this,V,dt),tt(this,J,ie).call(this),tt(this,C,Jt).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(V,dt,_t){var Nt,Bt;const yt=super.deserialize(V,dt,_t);yt.thickness=V.thickness,yt.color=p.Util.makeHexColor(...V.color),yt.opacity=V.opacity;const[St,kt]=yt.pageDimensions,Rt=yt.width*St,xt=yt.height*kt,Lt=yt.parentScale,Dt=V.thickness/2;ft(yt,X,Rt/xt),ft(yt,S,!0),ft(yt,s,Math.round(Rt)),ft(yt,r,Math.round(xt));for(const{bezier:Ht}of V.paths){const zt=[];yt.paths.push(zt);let Xt=Lt*(Ht[0]-Dt),qt=Lt*(xt-Ht[1]-Dt);for(let Vt=2,le=Ht.length;Vt<le;Vt+=6){const ce=Lt*(Ht[Vt]-Dt),he=Lt*(xt-Ht[Vt+1]-Dt),de=Lt*(Ht[Vt+2]-Dt),ue=Lt*(xt-Ht[Vt+3]-Dt),We=Lt*(Ht[Vt+4]-Dt),He=Lt*(xt-Ht[Vt+5]-Dt);zt.push([[Xt,qt],[ce,he],[de,ue],[We,He]]),Xt=We,qt=He}const Kt=tt(this,lt,us).call(this,zt);yt.bezierPath2D.push(Kt)}const Ot=tt(Nt=yt,Mt,Ne).call(Nt);return ft(yt,A,Math.max(H,Ot[2]-Ot[0])),ft(yt,w,Math.max(H,Ot[3]-Ot[1])),tt(Bt=yt,Z,Le).call(Bt,Rt,xt),yt}serialize(){if(this.isEmpty())return null;const V=this.getRect(0,0),dt=this.rotation%180===0?V[3]-V[1]:V[2]-V[0],_t=F.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:p.AnnotationEditorType.INK,color:_t,thickness:this.thickness,opacity:this.opacity,paths:tt(this,vt,fs).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,dt),pageIndex:this.pageIndex,rect:V,rotation:this.rotation}}};X=new WeakMap,w=new WeakMap,A=new WeakMap,I=new WeakMap,L=new WeakMap,E=new WeakMap,m=new WeakMap,y=new WeakMap,d=new WeakMap,S=new WeakMap,P=new WeakMap,x=new WeakMap,g=new WeakMap,s=new WeakMap,r=new WeakMap,a=new WeakMap,e=new WeakSet,ss=function(V){const dt=this.thickness;this.addCommands({cmd:()=>{this.thickness=V,tt(this,bt,re).call(this)},undo:()=>{this.thickness=dt,tt(this,bt,re).call(this)},mustExec:!0,type:p.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},T=new WeakSet,ns=function(V){const dt=this.color;this.addCommands({cmd:()=>{this.color=V,tt(this,C,Jt).call(this)},undo:()=>{this.color=dt,tt(this,C,Jt).call(this)},mustExec:!0,type:p.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},M=new WeakSet,is=function(V){V/=100;const dt=this.opacity;this.addCommands({cmd:()=>{this.opacity=V,tt(this,C,Jt).call(this)},undo:()=>{this.opacity=dt,tt(this,C,Jt).call(this)},mustExec:!0,type:p.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},K=new WeakSet,rs=function(){const{parentRotation:V,parentDimensions:[dt,_t]}=this;switch(V){case 90:return[0,_t,_t,dt];case 180:return[dt,_t,dt,_t];case 270:return[dt,0,_t,dt];default:return[0,0,dt,_t]}},nt=new WeakSet,De=function(){const{ctx:V,color:dt,opacity:_t,thickness:yt,parentScale:St,scaleFactor:kt}=this;V.lineWidth=yt*St/kt,V.lineCap="round",V.lineJoin="round",V.miterLimit=10,V.strokeStyle=`${dt}${(0,z.opacityToHex)(_t)}`},rt=new WeakSet,as=function(V,dt){this.canvas.addEventListener("contextmenu",l(this,I)),this.canvas.addEventListener("pointerleave",l(this,E)),this.canvas.addEventListener("pointermove",l(this,L)),this.canvas.addEventListener("pointerup",l(this,m)),this.canvas.removeEventListener("pointerdown",l(this,y)),this.isEditing=!0,l(this,x)||(ft(this,x,!0),tt(this,J,ie).call(this),this.thickness||(this.thickness=jt._defaultThickness),this.color||(this.color=jt._defaultColor||F.AnnotationEditor._defaultLineColor),this.opacity??(this.opacity=jt._defaultOpacity)),this.currentPath.push([V,dt]),ft(this,P,!1),tt(this,nt,De).call(this),ft(this,a,()=>{tt(this,c,cs).call(this),l(this,a)&&window.requestAnimationFrame(l(this,a))}),window.requestAnimationFrame(l(this,a))},At=new WeakSet,Oe=function(V,dt){const[_t,yt]=this.currentPath.at(-1);if(this.currentPath.length>1&&V===_t&&dt===yt)return;const St=this.currentPath;let kt=l(this,d);if(St.push([V,dt]),ft(this,P,!0),St.length<=2){kt.moveTo(...St[0]),kt.lineTo(V,dt);return}St.length===3&&(ft(this,d,kt=new Path2D),kt.moveTo(...St[0])),tt(this,O,hs).call(this,kt,...St.at(-3),...St.at(-2),V,dt)},Tt=new WeakSet,os=function(){if(this.currentPath.length===0)return;const V=this.currentPath.at(-1);l(this,d).lineTo(...V)},N=new WeakSet,ls=function(V,dt){ft(this,a,null),V=Math.min(Math.max(V,0),this.canvas.width),dt=Math.min(Math.max(dt,0),this.canvas.height),tt(this,At,Oe).call(this,V,dt),tt(this,Tt,os).call(this);let _t;if(this.currentPath.length!==1)_t=tt(this,B,ds).call(this);else{const xt=[V,dt];_t=[[xt,xt.slice(),xt.slice(),xt]]}const yt=l(this,d),St=this.currentPath;this.currentPath=[],ft(this,d,new Path2D);const kt=()=>{this.allRawPaths.push(St),this.paths.push(_t),this.bezierPath2D.push(yt),this.rebuild()},Rt=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(tt(this,h,me).call(this),tt(this,b,be).call(this)),tt(this,bt,re).call(this))};this.addCommands({cmd:kt,undo:Rt,mustExec:!0})},c=new WeakSet,cs=function(){if(!l(this,P))return;ft(this,P,!1);const V=Math.ceil(this.thickness*this.parentScale),dt=this.currentPath.slice(-3),_t=dt.map(kt=>kt[0]),yt=dt.map(kt=>kt[1]);Math.min(..._t)-V,Math.max(..._t)+V,Math.min(...yt)-V,Math.max(...yt)+V;const{ctx:St}=this;St.save(),St.clearRect(0,0,this.canvas.width,this.canvas.height);for(const kt of this.bezierPath2D)St.stroke(kt);St.stroke(l(this,d)),St.restore()},O=new WeakSet,hs=function(V,dt,_t,yt,St,kt,Rt){const xt=(dt+yt)/2,Lt=(_t+St)/2,Dt=(yt+kt)/2,Ot=(St+Rt)/2;V.bezierCurveTo(xt+2*(yt-xt)/3,Lt+2*(St-Lt)/3,Dt+2*(yt-Dt)/3,Ot+2*(St-Ot)/3,Dt,Ot)},B=new WeakSet,ds=function(){const V=this.currentPath;if(V.length<=2)return[[V[0],V[0],V.at(-1),V.at(-1)]];const dt=[];let _t,[yt,St]=V[0];for(_t=1;_t<V.length-2;_t++){const[Nt,Bt]=V[_t],[Ht,zt]=V[_t+1],Xt=(Nt+Ht)/2,qt=(Bt+zt)/2,Kt=[yt+2*(Nt-yt)/3,St+2*(Bt-St)/3],Vt=[Xt+2*(Nt-Xt)/3,qt+2*(Bt-qt)/3];dt.push([[yt,St],Kt,Vt,[Xt,qt]]),[yt,St]=[Xt,qt]}const[kt,Rt]=V[_t],[xt,Lt]=V[_t+1],Dt=[yt+2*(kt-yt)/3,St+2*(Rt-St)/3],Ot=[xt+2*(kt-xt)/3,Lt+2*(Rt-Lt)/3];return dt.push([[yt,St],Dt,Ot,[xt,Lt]]),dt},C=new WeakSet,Jt=function(){if(this.isEmpty()){tt(this,ct,Ae).call(this);return}tt(this,nt,De).call(this);const{canvas:V,ctx:dt}=this;dt.setTransform(1,0,0,1,0,0),dt.clearRect(0,0,V.width,V.height),tt(this,ct,Ae).call(this);for(const _t of this.bezierPath2D)dt.stroke(_t)},t=new WeakSet,Ie=function(V){this.canvas.removeEventListener("pointerleave",l(this,E)),this.canvas.removeEventListener("pointermove",l(this,L)),this.canvas.removeEventListener("pointerup",l(this,m)),this.canvas.addEventListener("pointerdown",l(this,y)),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",l(this,I))},10),tt(this,N,ls).call(this,V.offsetX,V.offsetY),this.addToAnnotationStorage(),this.setInBackground()},h=new WeakSet,me=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",jt._l10nPromise.get("editor_ink_canvas_aria_label").then(V=>{var dt;return(dt=this.canvas)==null?void 0:dt.setAttribute("aria-label",V)}),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},b=new WeakSet,be=function(){ft(this,g,new ResizeObserver(V=>{const dt=V[0].contentRect;dt.width&&dt.height&&this.setDimensions(dt.width,dt.height)})),l(this,g).observe(this.div)},J=new WeakSet,ie=function(){if(!l(this,x))return;const[V,dt]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*V),this.canvas.height=Math.ceil(this.height*dt),tt(this,ct,Ae).call(this)},Z=new WeakSet,Le=function(V,dt){const _t=tt(this,G,_e).call(this),yt=(V-_t)/l(this,A),St=(dt-_t)/l(this,w);this.scaleFactor=Math.min(yt,St)},ct=new WeakSet,Ae=function(){const V=tt(this,G,_e).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+V,this.translationY*this.scaleFactor+V)},lt=new WeakSet,us=function(V){const dt=new Path2D;for(let _t=0,yt=V.length;_t<yt;_t++){const[St,kt,Rt,xt]=V[_t];_t===0&&dt.moveTo(...St),dt.bezierCurveTo(kt[0],kt[1],Rt[0],Rt[1],xt[0],xt[1])}return dt},vt=new WeakSet,fs=function(V,dt,_t,yt){const kt=[],Rt=this.thickness/2;let xt,Lt;for(const Dt of this.paths){xt=[],Lt=[];for(let Ot=0,Nt=Dt.length;Ot<Nt;Ot++){const[Bt,Ht,zt,Xt]=Dt[Ot],qt=V*(Bt[0]+dt)+Rt,Kt=yt-V*(Bt[1]+_t)-Rt,Vt=V*(Ht[0]+dt)+Rt,le=yt-V*(Ht[1]+_t)-Rt,ce=V*(zt[0]+dt)+Rt,he=yt-V*(zt[1]+_t)-Rt,de=V*(Xt[0]+dt)+Rt,ue=yt-V*(Xt[1]+_t)-Rt;Ot===0&&(xt.push(qt,Kt),Lt.push(qt,Kt)),xt.push(Vt,le,ce,he,de,ue),tt(this,Pt,ps).call(this,qt,Kt,Vt,le,ce,he,de,ue,4,Lt)}kt.push({bezier:xt,points:Lt})}return kt},Pt=new WeakSet,ps=function(V,dt,_t,yt,St,kt,Rt,xt,Lt,Dt){if(tt(this,mt,gs).call(this,V,dt,_t,yt,St,kt,Rt,xt)){Dt.push(Rt,xt);return}for(let Ot=1;Ot<Lt-1;Ot++){const Nt=Ot/Lt,Bt=1-Nt;let Ht=Nt*V+Bt*_t,zt=Nt*dt+Bt*yt,Xt=Nt*_t+Bt*St,qt=Nt*yt+Bt*kt;const Kt=Nt*St+Bt*Rt,Vt=Nt*kt+Bt*xt;Ht=Nt*Ht+Bt*Xt,zt=Nt*zt+Bt*qt,Xt=Nt*Xt+Bt*Kt,qt=Nt*qt+Bt*Vt,Ht=Nt*Ht+Bt*Xt,zt=Nt*zt+Bt*qt,Dt.push(Ht,zt)}Dt.push(Rt,xt)},mt=new WeakSet,gs=function(V,dt,_t,yt,St,kt,Rt,xt){const Dt=(3*_t-2*V-Rt)**2,Ot=(3*yt-2*dt-xt)**2,Nt=(3*St-V-2*Rt)**2,Bt=(3*kt-dt-2*xt)**2;return Math.max(Dt,Nt)+Math.max(Ot,Bt)<=10},Mt=new WeakSet,Ne=function(){let V=1/0,dt=-1/0,_t=1/0,yt=-1/0;for(const St of this.paths)for(const[kt,Rt,xt,Lt]of St){const Dt=p.Util.bezierBoundingBox(...kt,...Rt,...xt,...Lt);V=Math.min(V,Dt[0]),_t=Math.min(_t,Dt[1]),dt=Math.max(dt,Dt[2]),yt=Math.max(yt,Dt[3])}return[V,_t,dt,yt]},G=new WeakSet,_e=function(){return l(this,S)?Math.ceil(this.thickness*this.parentScale):0},bt=new WeakSet,re=function(V=!1){if(this.isEmpty())return;if(!l(this,S)){tt(this,C,Jt).call(this);return}const dt=tt(this,Mt,Ne).call(this),_t=tt(this,G,_e).call(this);ft(this,A,Math.max(H,dt[2]-dt[0])),ft(this,w,Math.max(H,dt[3]-dt[1]));const yt=Math.ceil(_t+l(this,A)*this.scaleFactor),St=Math.ceil(_t+l(this,w)*this.scaleFactor),[kt,Rt]=this.parentDimensions;this.width=yt/kt,this.height=St/Rt,ft(this,X,yt/St),tt(this,Wt,je).call(this);const xt=this.translationX,Lt=this.translationY;this.translationX=-dt[0],this.translationY=-dt[1],tt(this,J,ie).call(this),tt(this,C,Jt).call(this),ft(this,s,yt),ft(this,r,St),this.setDims(yt,St);const Dt=V?_t/this.scaleFactor/2:0;this.translate(xt-this.translationX-Dt,Lt-this.translationY-Dt)},Wt=new WeakSet,je=function(){const{style:V}=this.div;l(this,X)>=1?(V.minHeight=`${H}px`,V.minWidth=`${Math.round(l(this,X)*H)}px`):(V.minWidth=`${H}px`,V.minHeight=`${Math.round(H/l(this,X))}px`)},$(jt,lt),Ut(jt,"_defaultColor",null),Ut(jt,"_defaultOpacity",1),Ut(jt,"_defaultThickness",1),Ut(jt,"_l10nPromise"),Ut(jt,"_type","ink");let at=jt;f.InkEditor=at},(ht,f,Q)=>{var wt,te,o,ms,O,Be,B,Ue;Object.defineProperty(f,"__esModule",{value:!0}),f.AnnotationLayer=void 0;var p=Q(1),F=Q(6),z=Q(3),H=Q(31),at=Q(32);const X=1e3,w=9,A=new WeakSet;function I(k){return{width:k[2]-k[0],height:k[3]-k[1]}}class L{static create(t){switch(t.data.annotationType){case p.AnnotationType.LINK:return new m(t);case p.AnnotationType.TEXT:return new y(t);case p.AnnotationType.WIDGET:switch(t.data.fieldType){case"Tx":return new S(t);case"Btn":return t.data.radioButton?new x(t):t.data.checkBox?new P(t):new g(t);case"Ch":return new s(t)}return new d(t);case p.AnnotationType.POPUP:return new r(t);case p.AnnotationType.FREETEXT:return new e(t);case p.AnnotationType.LINE:return new u(t);case p.AnnotationType.SQUARE:return new T(t);case p.AnnotationType.CIRCLE:return new i(t);case p.AnnotationType.POLYLINE:return new M(t);case p.AnnotationType.CARET:return new K(t);case p.AnnotationType.INK:return new et(t);case p.AnnotationType.POLYGON:return new U(t);case p.AnnotationType.HIGHLIGHT:return new nt(t);case p.AnnotationType.UNDERLINE:return new pt(t);case p.AnnotationType.SQUIGGLY:return new rt(t);case p.AnnotationType.STRIKEOUT:return new ut(t);case p.AnnotationType.STAMP:return new At(t);case p.AnnotationType.FILEATTACHMENT:return new Ct(t);default:return new E(t)}}}class E{constructor(t,{isRenderable:n=!1,ignoreBorder:h=!1,createQuadrilaterals:_=!1}={}){this.isRenderable=n,this.data=t.data,this.layer=t.layer,this.page=t.page,this.viewport=t.viewport,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,n&&(this.container=this._createContainer(h)),_&&(this.quadrilaterals=this._createQuadrilaterals(h))}_createContainer(t=!1){const{data:n,page:h,viewport:_}=this,b=document.createElement("section");b.setAttribute("data-annotation-id",n.id),n.noRotate&&b.classList.add("norotate");const{pageWidth:j,pageHeight:J,pageX:Y,pageY:Z}=_.rawDims,{width:st,height:ct}=I(n.rect),ot=p.Util.normalizeRect([n.rect[0],h.view[3]-n.rect[1]+h.view[1],n.rect[2],h.view[3]-n.rect[3]+h.view[1]]);if(!t&&n.borderStyle.width>0){b.style.borderWidth=`${n.borderStyle.width}px`;const gt=n.borderStyle.horizontalCornerRadius,vt=n.borderStyle.verticalCornerRadius;if(gt>0||vt>0){const Pt=`calc(${gt}px * var(--scale-factor)) / calc(${vt}px * var(--scale-factor))`;b.style.borderRadius=Pt}else if(this instanceof x){const Pt=`calc(${st}px * var(--scale-factor)) / calc(${ct}px * var(--scale-factor))`;b.style.borderRadius=Pt}switch(n.borderStyle.style){case p.AnnotationBorderStyleType.SOLID:b.style.borderStyle="solid";break;case p.AnnotationBorderStyleType.DASHED:b.style.borderStyle="dashed";break;case p.AnnotationBorderStyleType.BEVELED:(0,p.warn)("Unimplemented border style: beveled");break;case p.AnnotationBorderStyleType.INSET:(0,p.warn)("Unimplemented border style: inset");break;case p.AnnotationBorderStyleType.UNDERLINE:b.style.borderBottomStyle="solid";break}const Et=n.borderColor||null;Et?b.style.borderColor=p.Util.makeHexColor(Et[0]|0,Et[1]|0,Et[2]|0):b.style.borderWidth=0}b.style.left=`${100*(ot[0]-Y)/j}%`,b.style.top=`${100*(ot[1]-Z)/J}%`;const{rotation:lt}=n;return n.hasOwnCanvas||lt===0?(b.style.width=`${100*st/j}%`,b.style.height=`${100*ct/J}%`):this.setRotation(lt,b),b}setRotation(t,n=this.container){const{pageWidth:h,pageHeight:_}=this.viewport.rawDims,{width:b,height:j}=I(this.data.rect);let J,Y;t%180===0?(J=100*b/h,Y=100*j/_):(J=100*j/h,Y=100*b/_),n.style.width=`${J}%`,n.style.height=`${Y}%`,n.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(n,h,_)=>{const b=_.detail[n];_.target.style[h]=H.ColorConverters[`${b[0]}_HTML`](b.slice(1))};return(0,p.shadow)(this,"_commonActions",{display:n=>{const h=n.detail.display%2===1;this.container.style.visibility=h?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:h,print:n.detail.display===0||n.detail.display===3})},print:n=>{this.annotationStorage.setValue(this.data.id,{print:n.detail.print})},hidden:n=>{this.container.style.visibility=n.detail.hidden?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:n.detail.hidden})},focus:n=>{setTimeout(()=>n.target.focus({preventScroll:!1}),0)},userName:n=>{n.target.title=n.detail.userName},readonly:n=>{n.detail.readonly?n.target.setAttribute("readonly",""):n.target.removeAttribute("readonly")},required:n=>{this._setRequired(n.target,n.detail.required)},bgColor:n=>{t("bgColor","backgroundColor",n)},fillColor:n=>{t("fillColor","backgroundColor",n)},fgColor:n=>{t("fgColor","color",n)},textColor:n=>{t("textColor","color",n)},borderColor:n=>{t("borderColor","borderColor",n)},strokeColor:n=>{t("strokeColor","borderColor",n)},rotation:n=>{const h=n.detail.rotation;this.setRotation(h),this.annotationStorage.setValue(this.data.id,{rotation:h})}})}_dispatchEventFromSandbox(t,n){const h=this._commonActions;for(const _ of Object.keys(n.detail)){const b=t[_]||h[_];b==null||b(n)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const n=this.annotationStorage.getRawValue(this.data.id);if(!n)return;const h=this._commonActions;for(const[_,b]of Object.entries(n)){const j=h[_];if(j){const J={detail:{[_]:b},target:t};j(J),delete n[_]}}}_createQuadrilaterals(t=!1){if(!this.data.quadPoints)return null;const n=[],h=this.data.rect;for(const _ of this.data.quadPoints)this.data.rect=[_[2].x,_[2].y,_[1].x,_[1].y],n.push(this._createContainer(t));return this.data.rect=h,n}_createPopup(t,n){let h=this.container;this.quadrilaterals&&(t||(t=this.quadrilaterals),h=this.quadrilaterals[0]),t||(t=document.createElement("div"),t.classList.add("popupTriggerArea"),h.append(t));const b=new a({container:h,trigger:t,color:n.color,titleObj:n.titleObj,modificationDate:n.modificationDate,contentsObj:n.contentsObj,richText:n.richText,hideWrapper:!0}).render();b.style.left="100%",h.append(b)}_renderQuadrilaterals(t){for(const n of this.quadrilaterals)n.classList.add(t);return this.quadrilaterals}render(){(0,p.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,n=null){const h=[];if(this._fieldObjects){const _=this._fieldObjects[t];if(_)for(const{page:b,id:j,exportValues:J}of _){if(b===-1||j===n)continue;const Y=typeof J=="string"?J:null,Z=document.querySelector(`[data-element-id="${j}"]`);if(Z&&!A.has(Z)){(0,p.warn)(`_getElementsByName - element not allowed: ${j}`);continue}h.push({id:j,exportValue:Y,domElement:Z})}return h}for(const _ of document.getElementsByName(t)){const{exportValue:b}=_,j=_.getAttribute("data-element-id");j!==n&&A.has(_)&&h.push({id:j,exportValue:b,domElement:_})}return h}}class m extends E{constructor(n,h=null){super(n,{isRenderable:!0,ignoreBorder:!!(h!=null&&h.ignoreBorder),createQuadrilaterals:!0});$(this,wt);$(this,o);this.isTooltipOnly=n.data.isTooltipOnly}render(){const{data:n,linkService:h}=this,_=document.createElement("a");_.setAttribute("data-element-id",n.id);let b=!1;return n.url?(h.addLinkAttributes(_,n.url,n.newWindow),b=!0):n.action?(this._bindNamedAction(_,n.action),b=!0):n.attachment?(this._bindAttachment(_,n.attachment),b=!0):n.setOCGState?(tt(this,o,ms).call(this,_,n.setOCGState),b=!0):n.dest?(this._bindLink(_,n.dest),b=!0):(n.actions&&(n.actions.Action||n.actions["Mouse Up"]||n.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(_,n),b=!0),n.resetForm?(this._bindResetFormAction(_,n.resetForm),b=!0):this.isTooltipOnly&&!b&&(this._bindLink(_,""),b=!0)),this.quadrilaterals?this._renderQuadrilaterals("linkAnnotation").map((j,J)=>{const Y=J===0?_:_.cloneNode();return j.append(Y),j}):(this.container.classList.add("linkAnnotation"),b&&this.container.append(_),this.container)}_bindLink(n,h){n.href=this.linkService.getDestinationHash(h),n.onclick=()=>(h&&this.linkService.goToDestination(h),!1),(h||h==="")&&tt(this,wt,te).call(this)}_bindNamedAction(n,h){n.href=this.linkService.getAnchorUrl(""),n.onclick=()=>(this.linkService.executeNamedAction(h),!1),tt(this,wt,te).call(this)}_bindAttachment(n,h){n.href=this.linkService.getAnchorUrl(""),n.onclick=()=>{var _;return(_=this.downloadManager)==null||_.openOrDownloadData(this.container,h.content,h.filename),!1},tt(this,wt,te).call(this)}_bindJSAction(n,h){n.href=this.linkService.getAnchorUrl("");const _=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const b of Object.keys(h.actions)){const j=_.get(b);j&&(n[j]=()=>{var J;return(J=this.linkService.eventBus)==null||J.dispatch("dispatcheventinsandbox",{source:this,detail:{id:h.id,name:b}}),!1})}n.onclick||(n.onclick=()=>!1),tt(this,wt,te).call(this)}_bindResetFormAction(n,h){const _=n.onclick;if(_||(n.href=this.linkService.getAnchorUrl("")),tt(this,wt,te).call(this),!this._fieldObjects){(0,p.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),_||(n.onclick=()=>!1);return}n.onclick=()=>{var ct;_==null||_();const{fields:b,refs:j,include:J}=h,Y=[];if(b.length!==0||j.length!==0){const ot=new Set(j);for(const lt of b){const gt=this._fieldObjects[lt]||[];for(const{id:vt}of gt)ot.add(vt)}for(const lt of Object.values(this._fieldObjects))for(const gt of lt)ot.has(gt.id)===J&&Y.push(gt)}else for(const ot of Object.values(this._fieldObjects))Y.push(...ot);const Z=this.annotationStorage,st=[];for(const ot of Y){const{id:lt}=ot;switch(st.push(lt),ot.type){case"text":{const vt=ot.defaultValue||"";Z.setValue(lt,{value:vt});break}case"checkbox":case"radiobutton":{const vt=ot.defaultValue===ot.exportValues;Z.setValue(lt,{value:vt});break}case"combobox":case"listbox":{const vt=ot.defaultValue||"";Z.setValue(lt,{value:vt});break}default:continue}const gt=document.querySelector(`[data-element-id="${lt}"]`);if(gt){if(!A.has(gt)){(0,p.warn)(`_bindResetFormAction - element not allowed: ${lt}`);continue}}else continue;gt.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((ct=this.linkService.eventBus)==null||ct.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:st,name:"ResetForm"}})),!1}}}wt=new WeakSet,te=function(){this.container.setAttribute("data-internal-link","")},o=new WeakSet,ms=function(n,h){n.href=this.linkService.getAnchorUrl(""),n.onclick=()=>(this.linkService.executeSetOCGState(h),!1),tt(this,wt,te).call(this)};class y extends E{constructor(t){var h,_,b;const n=!!(t.data.hasPopup||(h=t.data.titleObj)!=null&&h.str||(_=t.data.contentsObj)!=null&&_.str||(b=t.data.richText)!=null&&b.str);super(t,{isRenderable:n})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.alt="[{{type}} Annotation]",t.dataset.l10nId="text_annotation_type",t.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(t,this.data),this.container.append(t),this.container}}class d extends E{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(t){var n;this.data.hasOwnCanvas&&(((n=t.previousSibling)==null?void 0:n.nodeName)==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){const{isWin:n,isMac:h}=p.FeatureTest.platform;return n&&t.ctrlKey||h&&t.metaKey}_setEventListener(t,n,h,_){n.includes("mouse")?t.addEventListener(n,b=>{var j;(j=this.linkService.eventBus)==null||j.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:h,value:_(b),shift:b.shiftKey,modifier:this._getKeyModifier(b)}})}):t.addEventListener(n,b=>{var j;(j=this.linkService.eventBus)==null||j.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:h,value:_(b)}})})}_setEventListeners(t,n,h){var _;for(const[b,j]of n)(j==="Action"||(_=this.data.actions)!=null&&_[j])&&this._setEventListener(t,b,j,h)}_setBackgroundColor(t){const n=this.data.backgroundColor||null;t.style.backgroundColor=n===null?"transparent":p.Util.makeHexColor(n[0],n[1],n[2])}_setTextStyle(t){const n=["left","center","right"],{fontColor:h}=this.data.defaultAppearanceData,_=this.data.defaultAppearanceData.fontSize||w,b=t.style;let j;const J=2,Y=Z=>Math.round(10*Z)/10;if(this.data.multiLine){const Z=Math.abs(this.data.rect[3]-this.data.rect[1]-J),st=Math.round(Z/(p.LINE_FACTOR*_))||1,ct=Z/st;j=Math.min(_,Y(ct/p.LINE_FACTOR))}else{const Z=Math.abs(this.data.rect[3]-this.data.rect[1]-J);j=Math.min(_,Y(Z/p.LINE_FACTOR))}b.fontSize=`calc(${j}px * var(--scale-factor))`,b.color=p.Util.makeHexColor(h[0],h[1],h[2]),this.data.textAlignment!==null&&(b.textAlign=n[this.data.textAlignment])}_setRequired(t,n){n?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",n)}}class S extends d{constructor(t){const n=t.renderForms||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:n})}setPropertyOnSiblings(t,n,h,_){const b=this.annotationStorage;for(const j of this._getElementsByName(t.name,t.id))j.domElement&&(j.domElement[n]=h),b.setValue(j.id,{[_]:h})}render(){var _,b;const t=this.annotationStorage,n=this.data.id;this.container.classList.add("textWidgetAnnotation");let h=null;if(this.renderForms){const j=t.getValue(n,{value:this.data.fieldValue});let J=j.value||"";const Y=t.getValue(n,{charLimit:this.data.maxLen}).charLimit;Y&&J.length>Y&&(J=J.slice(0,Y));let Z=j.formattedValue||((_=this.data.textContent)==null?void 0:_.join(` `))||null;Z&&this.data.comb&&(Z=Z.replaceAll(/\s+/g,""));const st={userValue:J,formattedValue:Z,lastCommittedValue:null,commitKey:1};this.data.multiLine?(h=document.createElement("textarea"),h.textContent=Z??J,this.data.doNotScroll&&(h.style.overflowY="hidden")):(h=document.createElement("input"),h.type="text",h.setAttribute("value",Z??J),this.data.doNotScroll&&(h.style.overflowX="hidden")),this.data.hasOwnCanvas&&(h.hidden=!0),A.add(h),h.setAttribute("data-element-id",n),h.disabled=this.data.readOnly,h.name=this.data.fieldName,h.tabIndex=X,this._setRequired(h,this.data.required),Y&&(h.maxLength=Y),h.addEventListener("input",ot=>{t.setValue(n,{value:ot.target.value}),this.setPropertyOnSiblings(h,"value",ot.target.value,"value"),st.formattedValue=null}),h.addEventListener("resetform",ot=>{const lt=this.data.defaultFieldValue??"";h.value=st.userValue=lt,st.formattedValue=null});let ct=ot=>{const{formattedValue:lt}=st;lt!=null&&(ot.target.value=lt),ot.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){h.addEventListener("focus",lt=>{const{target:gt}=lt;st.userValue&&(gt.value=st.userValue),st.lastCommittedValue=gt.value,st.commitKey=1}),h.addEventListener("updatefromsandbox",lt=>{this.showElementAndHideCanvas(lt.target);const gt={value(vt){st.userValue=vt.detail.value??"",t.setValue(n,{value:st.userValue.toString()}),vt.target.value=st.userValue},formattedValue(vt){const{formattedValue:Et}=vt.detail;st.formattedValue=Et,Et!=null&&vt.target!==document.activeElement&&(vt.target.value=Et),t.setValue(n,{formattedValue:Et})},selRange(vt){vt.target.setSelectionRange(...vt.detail.selRange)},charLimit:vt=>{var mt;const{charLimit:Et}=vt.detail,{target:Pt}=vt;if(Et===0){Pt.removeAttribute("maxLength");return}Pt.setAttribute("maxLength",Et);let W=st.userValue;!W||W.length<=Et||(W=W.slice(0,Et),Pt.value=st.userValue=W,t.setValue(n,{value:W}),(mt=this.linkService.eventBus)==null||mt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:W,willCommit:!0,commitKey:1,selStart:Pt.selectionStart,selEnd:Pt.selectionEnd}}))}};this._dispatchEventFromSandbox(gt,lt)}),h.addEventListener("keydown",lt=>{var Et;st.commitKey=1;let gt=-1;if(lt.key==="Escape"?gt=0:lt.key==="Enter"&&!this.data.multiLine?gt=2:lt.key==="Tab"&&(st.commitKey=3),gt===-1)return;const{value:vt}=lt.target;st.lastCommittedValue!==vt&&(st.lastCommittedValue=vt,st.userValue=vt,(Et=this.linkService.eventBus)==null||Et.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:vt,willCommit:!0,commitKey:gt,selStart:lt.target.selectionStart,selEnd:lt.target.selectionEnd}}))});const ot=ct;ct=null,h.addEventListener("blur",lt=>{var vt;if(!lt.relatedTarget)return;const{value:gt}=lt.target;st.userValue=gt,st.lastCommittedValue!==gt&&((vt=this.linkService.eventBus)==null||vt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:gt,willCommit:!0,commitKey:st.commitKey,selStart:lt.target.selectionStart,selEnd:lt.target.selectionEnd}})),ot(lt)}),(b=this.data.actions)!=null&&b.Keystroke&&h.addEventListener("beforeinput",lt=>{var Mt;st.lastCommittedValue=null;const{data:gt,target:vt}=lt,{value:Et,selectionStart:Pt,selectionEnd:W}=vt;let mt=Pt,Ft=W;switch(lt.inputType){case"deleteWordBackward":{const it=Et.substring(0,Pt).match(/\w*[^\w]*$/);it&&(mt-=it[0].length);break}case"deleteWordForward":{const it=Et.substring(Pt).match(/^[^\w]*\w*/);it&&(Ft+=it[0].length);break}case"deleteContentBackward":Pt===W&&(mt-=1);break;case"deleteContentForward":Pt===W&&(Ft+=1);break}lt.preventDefault(),(Mt=this.linkService.eventBus)==null||Mt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:Et,change:gt||"",willCommit:!1,selStart:mt,selEnd:Ft}})}),this._setEventListeners(h,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],lt=>lt.target.value)}if(ct&&h.addEventListener("blur",ct),this.data.comb){const lt=(this.data.rect[2]-this.data.rect[0])/Y;h.classList.add("comb"),h.style.letterSpacing=`calc(${lt}px * var(--scale-factor) - 1ch)`}}else h=document.createElement("div"),h.textContent=this.data.fieldValue,h.style.verticalAlign="middle",h.style.display="table-cell";return this._setTextStyle(h),this._setBackgroundColor(h),this._setDefaultPropertiesFromJS(h),this.container.append(h),this.container}}class P extends d{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,n=this.data,h=n.id;let _=t.getValue(h,{value:n.exportValue===n.fieldValue}).value;typeof _=="string"&&(_=_!=="Off",t.setValue(h,{value:_})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const b=document.createElement("input");return A.add(b),b.setAttribute("data-element-id",h),b.disabled=n.readOnly,this._setRequired(b,this.data.required),b.type="checkbox",b.name=n.fieldName,_&&b.setAttribute("checked",!0),b.setAttribute("exportValue",n.exportValue),b.tabIndex=X,b.addEventListener("change",j=>{const{name:J,checked:Y}=j.target;for(const Z of this._getElementsByName(J,h)){const st=Y&&Z.exportValue===n.exportValue;Z.domElement&&(Z.domElement.checked=st),t.setValue(Z.id,{value:st})}t.setValue(h,{value:Y})}),b.addEventListener("resetform",j=>{const J=n.defaultFieldValue||"Off";j.target.checked=J===n.exportValue}),this.enableScripting&&this.hasJSActions&&(b.addEventListener("updatefromsandbox",j=>{const J={value(Y){Y.target.checked=Y.detail.value!=="Off",t.setValue(h,{value:Y.target.checked})}};this._dispatchEventFromSandbox(J,j)}),this._setEventListeners(b,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],j=>j.target.checked)),this._setBackgroundColor(b),this._setDefaultPropertiesFromJS(b),this.container.append(b),this.container}}class x extends d{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,n=this.data,h=n.id;let _=t.getValue(h,{value:n.fieldValue===n.buttonValue}).value;typeof _=="string"&&(_=_!==n.buttonValue,t.setValue(h,{value:_}));const b=document.createElement("input");if(A.add(b),b.setAttribute("data-element-id",h),b.disabled=n.readOnly,this._setRequired(b,this.data.required),b.type="radio",b.name=n.fieldName,_&&b.setAttribute("checked",!0),b.tabIndex=X,b.addEventListener("change",j=>{const{name:J,checked:Y}=j.target;for(const Z of this._getElementsByName(J,h))t.setValue(Z.id,{value:!1});t.setValue(h,{value:Y})}),b.addEventListener("resetform",j=>{const J=n.defaultFieldValue;j.target.checked=J!=null&&J===n.buttonValue}),this.enableScripting&&this.hasJSActions){const j=n.buttonValue;b.addEventListener("updatefromsandbox",J=>{const Y={value:Z=>{const st=j===Z.detail.value;for(const ct of this._getElementsByName(Z.target.name)){const ot=st&&ct.id===h;ct.domElement&&(ct.domElement.checked=ot),t.setValue(ct.id,{value:ot})}}};this._dispatchEventFromSandbox(Y,J)}),this._setEventListeners(b,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],J=>J.target.checked)}return this._setBackgroundColor(b),this._setDefaultPropertiesFromJS(b),this.container.append(b),this.container}}class g extends m{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(t.title=this.data.alternativeText);const n=t.lastChild;return this.enableScripting&&this.hasJSActions&&n&&(this._setDefaultPropertiesFromJS(n),n.addEventListener("updatefromsandbox",h=>{this._dispatchEventFromSandbox({},h)})),t}}class s extends d{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,n=this.data.id,h=t.getValue(n,{value:this.data.fieldValue}),_=document.createElement("select");A.add(_),_.setAttribute("data-element-id",n),_.disabled=this.data.readOnly,this._setRequired(_,this.data.required),_.name=this.data.fieldName,_.tabIndex=X;let b=this.data.combo&&this.data.options.length>0;this.data.combo||(_.size=this.data.options.length,this.data.multiSelect&&(_.multiple=!0)),_.addEventListener("resetform",st=>{const ct=this.data.defaultFieldValue;for(const ot of _.options)ot.selected=ot.value===ct});for(const st of this.data.options){const ct=document.createElement("option");ct.textContent=st.displayValue,ct.value=st.exportValue,h.value.includes(st.exportValue)&&(ct.setAttribute("selected",!0),b=!1),_.append(ct)}let j=null;if(b){const st=document.createElement("option");st.value=" ",st.setAttribute("hidden",!0),st.setAttribute("selected",!0),_.prepend(st),j=()=>{st.remove(),_.removeEventListener("input",j),j=null},_.addEventListener("input",j)}const J=st=>{const ct=st?"value":"textContent",{options:ot,multiple:lt}=_;return lt?Array.prototype.filter.call(ot,gt=>gt.selected).map(gt=>gt[ct]):ot.selectedIndex===-1?null:ot[ot.selectedIndex][ct]};let Y=J(!1);const Z=st=>{const ct=st.target.options;return Array.prototype.map.call(ct,ot=>({displayValue:ot.textContent,exportValue:ot.value}))};return this.enableScripting&&this.hasJSActions?(_.addEventListener("updatefromsandbox",st=>{const ct={value(ot){j==null||j();const lt=ot.detail.value,gt=new Set(Array.isArray(lt)?lt:[lt]);for(const vt of _.options)vt.selected=gt.has(vt.value);t.setValue(n,{value:J(!0)}),Y=J(!1)},multipleSelection(ot){_.multiple=!0},remove(ot){const lt=_.options,gt=ot.detail.remove;lt[gt].selected=!1,_.remove(gt),lt.length>0&&Array.prototype.findIndex.call(lt,Et=>Et.selected)===-1&&(lt[0].selected=!0),t.setValue(n,{value:J(!0),items:Z(ot)}),Y=J(!1)},clear(ot){for(;_.length!==0;)_.remove(0);t.setValue(n,{value:null,items:[]}),Y=J(!1)},insert(ot){const{index:lt,displayValue:gt,exportValue:vt}=ot.detail.insert,Et=_.children[lt],Pt=document.createElement("option");Pt.textContent=gt,Pt.value=vt,Et?Et.before(Pt):_.append(Pt),t.setValue(n,{value:J(!0),items:Z(ot)}),Y=J(!1)},items(ot){const{items:lt}=ot.detail;for(;_.length!==0;)_.remove(0);for(const gt of lt){const{displayValue:vt,exportValue:Et}=gt,Pt=document.createElement("option");Pt.textContent=vt,Pt.value=Et,_.append(Pt)}_.options.length>0&&(_.options[0].selected=!0),t.setValue(n,{value:J(!0),items:Z(ot)}),Y=J(!1)},indices(ot){const lt=new Set(ot.detail.indices);for(const gt of ot.target.options)gt.selected=lt.has(gt.index);t.setValue(n,{value:J(!0)}),Y=J(!1)},editable(ot){ot.target.disabled=!ot.detail.editable}};this._dispatchEventFromSandbox(ct,st)}),_.addEventListener("input",st=>{var ot;const ct=J(!0);t.setValue(n,{value:ct}),st.preventDefault(),(ot=this.linkService.eventBus)==null||ot.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:Y,changeEx:ct,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(_,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],st=>st.target.value)):_.addEventListener("input",function(st){t.setValue(n,{value:J(!0)})}),this.data.combo&&this._setTextStyle(_),this._setBackgroundColor(_),this._setDefaultPropertiesFromJS(_),this.container.append(_),this.container}}const v=class v extends E{constructor(t){var _,b,j;const{data:n}=t,h=!v.IGNORE_TYPES.has(n.parentType)&&!!((_=n.titleObj)!=null&&_.str||(b=n.contentsObj)!=null&&b.str||(j=n.richText)!=null&&j.str);super(t,{isRenderable:h})}render(){this.container.classList.add("popupAnnotation");const t=this.layer.querySelectorAll(`[data-annotation-id="${this.data.parentId}"]`);if(t.length===0)return this.container;const n=new a({container:this.container,trigger:Array.from(t),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),h=this.page,_=p.Util.normalizeRect([this.data.parentRect[0],h.view[3]-this.data.parentRect[1]+h.view[1],this.data.parentRect[2],h.view[3]-this.data.parentRect[3]+h.view[1]]),b=_[0]+this.data.parentRect[2]-this.data.parentRect[0],j=_[1],{pageWidth:J,pageHeight:Y,pageX:Z,pageY:st}=this.viewport.rawDims;return this.container.style.left=`${100*(b-Z)/J}%`,this.container.style.top=`${100*(j-st)/Y}%`,this.container.append(n.render()),this.container}};Ut(v,"IGNORE_TYPES",new Set(["Line","Square","Circle","PolyLine","Polygon","Ink"]));let r=v;class a{constructor(t){this.container=t.container,this.trigger=t.trigger,this.color=t.color,this.titleObj=t.titleObj,this.modificationDate=t.modificationDate,this.contentsObj=t.contentsObj,this.richText=t.richText,this.hideWrapper=t.hideWrapper||!1,this.pinned=!1}render(){var J,Y;const n=document.createElement("div");n.classList.add("popupWrapper"),this.hideElement=this.hideWrapper?n:this.container,this.hideElement.hidden=!0;const h=document.createElement("div");h.classList.add("popup");const _=this.color;if(_){const Z=.7*(255-_[0])+_[0],st=.7*(255-_[1])+_[1],ct=.7*(255-_[2])+_[2];h.style.backgroundColor=p.Util.makeHexColor(Z|0,st|0,ct|0)}const b=document.createElement("h1");b.dir=this.titleObj.dir,b.textContent=this.titleObj.str,h.append(b);const j=F.PDFDateString.toDateObject(this.modificationDate);if(j){const Z=document.createElement("span");Z.classList.add("popupDate"),Z.textContent="{{date}}, {{time}}",Z.dataset.l10nId="annotation_date_string",Z.dataset.l10nArgs=JSON.stringify({date:j.toLocaleDateString(),time:j.toLocaleTimeString()}),h.append(Z)}if((J=this.richText)!=null&&J.str&&(!((Y=this.contentsObj)!=null&&Y.str)||this.contentsObj.str===this.richText.str))at.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:h}),h.lastChild.classList.add("richText","popupContent");else{const Z=this._formatContents(this.contentsObj);h.append(Z)}Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const Z of this.trigger)Z.addEventListener("click",this._toggle.bind(this)),Z.addEventListener("mouseover",this._show.bind(this,!1)),Z.addEventListener("mouseout",this._hide.bind(this,!1));return h.addEventListener("click",this._hide.bind(this,!0)),n.append(h),n}_formatContents({str:t,dir:n}){const h=document.createElement("p");h.classList.add("popupContent"),h.dir=n;const _=t.split(/(?:\r\n?|\n)/);for(let b=0,j=_.length;b<j;++b){const J=_[b];h.append(document.createTextNode(J)),b<j-1&&h.append(document.createElement("br"))}return h}_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(t=!1){t&&(this.pinned=!0),this.hideElement.hidden&&(this.hideElement.hidden=!1,this.container.style.zIndex=parseInt(this.container.style.zIndex)+1e3)}_hide(t=!0){t&&(this.pinned=!1),!this.hideElement.hidden&&!this.pinned&&(this.hideElement.hidden=!0,this.container.style.zIndex=parseInt(this.container.style.zIndex)-1e3)}}class e extends E{constructor(t){var h,_,b;const n=!!(t.data.hasPopup||(h=t.data.titleObj)!=null&&h.str||(_=t.data.contentsObj)!=null&&_.str||(b=t.data.richText)!=null&&b.str);super(t,{isRenderable:n,ignoreBorder:!0}),this.textContent=t.data.textContent}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const n of this.textContent){const h=document.createElement("span");h.textContent=n,t.append(h)}this.container.append(t)}return this.data.hasPopup||this._createPopup(null,this.data),this.container}}class u extends E{constructor(t){var h,_,b;const n=!!(t.data.hasPopup||(h=t.data.titleObj)!=null&&h.str||(_=t.data.contentsObj)!=null&&_.str||(b=t.data.richText)!=null&&b.str);super(t,{isRenderable:n,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:n,height:h}=I(t.rect),_=this.svgFactory.create(n,h,!0),b=this.svgFactory.createElement("svg:line");return b.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),b.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),b.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),b.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),b.setAttribute("stroke-width",t.borderStyle.width||1),b.setAttribute("stroke","transparent"),b.setAttribute("fill","transparent"),_.append(b),this.container.append(_),this._createPopup(b,t),this.container}}class T extends E{constructor(t){var h,_,b;const n=!!(t.data.hasPopup||(h=t.data.titleObj)!=null&&h.str||(_=t.data.contentsObj)!=null&&_.str||(b=t.data.richText)!=null&&b.str);super(t,{isRenderable:n,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:n,height:h}=I(t.rect),_=this.svgFactory.create(n,h,!0),b=t.borderStyle.width,j=this.svgFactory.createElement("svg:rect");return j.setAttribute("x",b/2),j.setAttribute("y",b/2),j.setAttribute("width",n-b),j.setAttribute("height",h-b),j.setAttribute("stroke-width",b||1),j.setAttribute("stroke","transparent"),j.setAttribute("fill","transparent"),_.append(j),this.container.append(_),this._createPopup(j,t),this.container}}class i extends E{constructor(t){var h,_,b;const n=!!(t.data.hasPopup||(h=t.data.titleObj)!=null&&h.str||(_=t.data.contentsObj)!=null&&_.str||(b=t.data.richText)!=null&&b.str);super(t,{isRenderable:n,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:n,height:h}=I(t.rect),_=this.svgFactory.create(n,h,!0),b=t.borderStyle.width,j=this.svgFactory.createElement("svg:ellipse");return j.setAttribute("cx",n/2),j.setAttribute("cy",h/2),j.setAttribute("rx",n/2-b/2),j.setAttribute("ry",h/2-b/2),j.setAttribute("stroke-width",b||1),j.setAttribute("stroke","transparent"),j.setAttribute("fill","transparent"),_.append(j),this.container.append(_),this._createPopup(j,t),this.container}}class M extends E{constructor(t){var h,_,b;const n=!!(t.data.hasPopup||(h=t.data.titleObj)!=null&&h.str||(_=t.data.contentsObj)!=null&&_.str||(b=t.data.richText)!=null&&b.str);super(t,{isRenderable:n,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const t=this.data,{width:n,height:h}=I(t.rect),_=this.svgFactory.create(n,h,!0);let b=[];for(const J of t.vertices){const Y=J.x-t.rect[0],Z=t.rect[3]-J.y;b.push(Y+","+Z)}b=b.join(" ");const j=this.svgFactory.createElement(this.svgElementName);return j.setAttribute("points",b),j.setAttribute("stroke-width",t.borderStyle.width||1),j.setAttribute("stroke","transparent"),j.setAttribute("fill","transparent"),_.append(j),this.container.append(_),this._createPopup(j,t),this.container}}class U extends M{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class K extends E{constructor(t){var h,_,b;const n=!!(t.data.hasPopup||(h=t.data.titleObj)!=null&&h.str||(_=t.data.contentsObj)!=null&&_.str||(b=t.data.richText)!=null&&b.str);super(t,{isRenderable:n,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),this.data.hasPopup||this._createPopup(null,this.data),this.container}}class et extends E{constructor(t){var h,_,b;const n=!!(t.data.hasPopup||(h=t.data.titleObj)!=null&&h.str||(_=t.data.contentsObj)!=null&&_.str||(b=t.data.richText)!=null&&b.str);super(t,{isRenderable:n,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const t=this.data,{width:n,height:h}=I(t.rect),_=this.svgFactory.create(n,h,!0);for(const b of t.inkLists){let j=[];for(const Y of b){const Z=Y.x-t.rect[0],st=t.rect[3]-Y.y;j.push(`${Z},${st}`)}j=j.join(" ");const J=this.svgFactory.createElement(this.svgElementName);J.setAttribute("points",j),J.setAttribute("stroke-width",t.borderStyle.width||1),J.setAttribute("stroke","transparent"),J.setAttribute("fill","transparent"),this._createPopup(J,t),_.append(J)}return this.container.append(_),this.container}}class nt extends E{constructor(t){var h,_,b;const n=!!(t.data.hasPopup||(h=t.data.titleObj)!=null&&h.str||(_=t.data.contentsObj)!=null&&_.str||(b=t.data.richText)!=null&&b.str);super(t,{isRenderable:n,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("highlightAnnotation"):(this.container.classList.add("highlightAnnotation"),this.container)}}class pt extends E{constructor(t){var h,_,b;const n=!!(t.data.hasPopup||(h=t.data.titleObj)!=null&&h.str||(_=t.data.contentsObj)!=null&&_.str||(b=t.data.richText)!=null&&b.str);super(t,{isRenderable:n,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("underlineAnnotation"):(this.container.classList.add("underlineAnnotation"),this.container)}}class rt extends E{constructor(t){var h,_,b;const n=!!(t.data.hasPopup||(h=t.data.titleObj)!=null&&h.str||(_=t.data.contentsObj)!=null&&_.str||(b=t.data.richText)!=null&&b.str);super(t,{isRenderable:n,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("squigglyAnnotation"):(this.container.classList.add("squigglyAnnotation"),this.container)}}class ut extends E{constructor(t){var h,_,b;const n=!!(t.data.hasPopup||(h=t.data.titleObj)!=null&&h.str||(_=t.data.contentsObj)!=null&&_.str||(b=t.data.richText)!=null&&b.str);super(t,{isRenderable:n,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("strikeoutAnnotation"):(this.container.classList.add("strikeoutAnnotation"),this.container)}}class At extends E{constructor(t){var h,_,b;const n=!!(t.data.hasPopup||(h=t.data.titleObj)!=null&&h.str||(_=t.data.contentsObj)!=null&&_.str||(b=t.data.richText)!=null&&b.str);super(t,{isRenderable:n,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),this.data.hasPopup||this._createPopup(null,this.data),this.container}}class Ct extends E{constructor(t){var _;super(t,{isRenderable:!0});const{filename:n,content:h}=this.data.file;this.filename=(0,F.getFilenameFromUrl)(n,!0),this.content=h,(_=this.linkService.eventBus)==null||_.dispatch("fileattachmentannotation",{source:this,filename:n,content:h})}render(){var n,h;this.container.classList.add("fileAttachmentAnnotation");let t;return this.data.hasAppearance?t=document.createElement("div"):(t=document.createElement("img"),t.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(this.data.name)?"paperclip":"pushpin"}.svg`),t.classList.add("popupTriggerArea"),t.addEventListener("dblclick",this._download.bind(this)),!this.data.hasPopup&&((n=this.data.titleObj)!=null&&n.str||(h=this.data.contentsObj)!=null&&h.str||this.data.richText)&&this._createPopup(t,this.data),this.container.append(t),this.container}_download(){var t;(t=this.downloadManager)==null||t.openOrDownloadData(this.container,this.content,this.filename)}}const C=class C{static render(t){var Y,Z;const{annotations:n,div:h,viewport:_,accessibilityManager:b}=t;(0,F.setLayerDimensions)(h,_);const j={data:null,layer:h,page:t.page,viewport:_,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:t.renderForms!==!1,svgFactory:new F.DOMSVGFactory,annotationStorage:t.annotationStorage||new z.AnnotationStorage,enableScripting:t.enableScripting===!0,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects};let J=0;for(const st of n){if(st.noHTML)continue;if(st.annotationType!==p.AnnotationType.POPUP){const{width:lt,height:gt}=I(st.rect);if(lt<=0||gt<=0)continue}j.data=st;const ct=L.create(j);if(!ct.isRenderable)continue;const ot=ct.render();if(st.hidden&&(ot.style.visibility="hidden"),Array.isArray(ot))for(const lt of ot)lt.style.zIndex=J++,tt(Y=C,O,Be).call(Y,lt,st.id,h,b);else ot.style.zIndex=J++,ct instanceof r?h.prepend(ot):tt(Z=C,O,Be).call(Z,ot,st.id,h,b)}tt(this,B,Ue).call(this,h,t.annotationCanvasMap)}static update(t){const{annotationCanvasMap:n,div:h,viewport:_}=t;(0,F.setLayerDimensions)(h,{rotation:_.rotation}),tt(this,B,Ue).call(this,h,n),h.hidden=!1}};O=new WeakSet,Be=function(t,n,h,_){const b=t.firstChild||t;b.id=`${F.AnnotationPrefix}${n}`,h.append(t),_==null||_.moveElementInDOM(h,t,b,!1)},B=new WeakSet,Ue=function(t,n){if(n){for(const[h,_]of n){const b=t.querySelector(`[data-annotation-id="${h}"]`);if(!b)continue;const{firstChild:j}=b;j?j.nodeName==="CANVAS"?j.replaceWith(_):j.before(_):b.append(_)}n.clear()}},$(C,O),$(C,B);let Tt=C;f.AnnotationLayer=Tt},(ht,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.ColorConverters=void 0;function Q(F){return Math.floor(Math.max(0,Math.min(1,F))*255).toString(16).padStart(2,"0")}class p{static CMYK_G([z,H,at,X]){return["G",1-Math.min(1,.3*z+.59*at+.11*H+X)]}static G_CMYK([z]){return["CMYK",0,0,0,1-z]}static G_RGB([z]){return["RGB",z,z,z]}static G_HTML([z]){const H=Q(z);return`#${H}${H}${H}`}static RGB_G([z,H,at]){return["G",.3*z+.59*H+.11*at]}static RGB_HTML([z,H,at]){const X=Q(z),w=Q(H),A=Q(at);return`#${X}${w}${A}`}static T_HTML(){return"#00000000"}static CMYK_RGB([z,H,at,X]){return["RGB",1-Math.min(1,z+X),1-Math.min(1,at+X),1-Math.min(1,H+X)]}static CMYK_HTML(z){const H=this.CMYK_RGB(z).slice(1);return this.RGB_HTML(H)}static RGB_CMYK([z,H,at]){const X=1-z,w=1-H,A=1-at,I=Math.min(X,w,A);return["CMYK",X,w,A,I]}}f.ColorConverters=p},(ht,f,Q)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.XfaLayer=void 0;var p=Q(19);class F{static setupStorage(H,at,X,w,A){const I=w.getValue(at,{value:null});switch(X.name){case"textarea":if(I.value!==null&&(H.textContent=I.value),A==="print")break;H.addEventListener("input",L=>{w.setValue(at,{value:L.target.value})});break;case"input":if(X.attributes.type==="radio"||X.attributes.type==="checkbox"){if(I.value===X.attributes.xfaOn?H.setAttribute("checked",!0):I.value===X.attributes.xfaOff&&H.removeAttribute("checked"),A==="print")break;H.addEventListener("change",L=>{w.setValue(at,{value:L.target.checked?L.target.getAttribute("xfaOn"):L.target.getAttribute("xfaOff")})})}else{if(I.value!==null&&H.setAttribute("value",I.value),A==="print")break;H.addEventListener("input",L=>{w.setValue(at,{value:L.target.value})})}break;case"select":if(I.value!==null)for(const L of X.children)L.attributes.value===I.value&&(L.attributes.selected=!0);H.addEventListener("input",L=>{const E=L.target.options,m=E.selectedIndex===-1?"":E[E.selectedIndex].value;w.setValue(at,{value:m})});break}}static setAttributes({html:H,element:at,storage:X=null,intent:w,linkService:A}){const{attributes:I}=at,L=H instanceof HTMLAnchorElement;I.type==="radio"&&(I.name=`${I.name}-${w}`);for(const[E,m]of Object.entries(I))if(m!=null)switch(E){case"class":m.length&&H.setAttribute(E,m.join(" "));break;case"dataId":break;case"id":H.setAttribute("data-element-id",m);break;case"style":Object.assign(H.style,m);break;case"textContent":H.textContent=m;break;default:(!L||E!=="href"&&E!=="newWindow")&&H.setAttribute(E,m)}L&&A.addLinkAttributes(H,I.href,I.newWindow),X&&I.dataId&&this.setupStorage(H,I.dataId,at,X)}static render(H){var y;const at=H.annotationStorage,X=H.linkService,w=H.xfaHtml,A=H.intent||"display",I=document.createElement(w.name);w.attributes&&this.setAttributes({html:I,element:w,intent:A,linkService:X});const L=[[w,-1,I]],E=H.div;if(E.append(I),H.viewport){const d=`matrix(${H.viewport.transform.join(",")})`;E.style.transform=d}A!=="richText"&&E.setAttribute("class","xfaLayer xfaFont");const m=[];for(;L.length>0;){const[d,S,P]=L.at(-1);if(S+1===d.children.length){L.pop();continue}const x=d.children[++L.at(-1)[1]];if(x===null)continue;const{name:g}=x;if(g==="#text"){const r=document.createTextNode(x.value);m.push(r),P.append(r);continue}let s;if((y=x==null?void 0:x.attributes)!=null&&y.xmlns?s=document.createElementNS(x.attributes.xmlns,g):s=document.createElement(g),P.append(s),x.attributes&&this.setAttributes({html:s,element:x,storage:at,intent:A,linkService:X}),x.children&&x.children.length>0)L.push([x,-1,s]);else if(x.value){const r=document.createTextNode(x.value);p.XfaText.shouldBuildText(g)&&m.push(r),s.append(r)}}for(const d of E.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))d.setAttribute("readOnly",!0);return{textDivs:m}}static update(H){const at=`matrix(${H.viewport.transform.join(",")})`;H.div.style.transform=at,H.div.hidden=!1}}f.XfaLayer=F},(ht,f,Q)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.SVGGraphics=void 0;var p=Q(6),F=Q(1),z=Q(10);let H=class{constructor(){(0,F.unreachable)("Not implemented: SVGGraphics")}};f.SVGGraphics=H;{let y=function(s){let r=[];const a=[];for(const e of s){if(e.fn==="save"){r.push({fnId:92,fn:"group",items:[]}),a.push(r),r=r.at(-1).items;continue}e.fn==="restore"?r=a.pop():r.push(e)}return r},d=function(s){if(Number.isInteger(s))return s.toString();const r=s.toFixed(10);let a=r.length-1;if(r[a]!=="0")return r;do a--;while(r[a]==="0");return r.substring(0,r[a]==="."?a:a+1)},S=function(s){if(s[4]===0&&s[5]===0){if(s[1]===0&&s[2]===0)return s[0]===1&&s[3]===1?"":`scale(${d(s[0])} ${d(s[3])})`;if(s[0]===s[3]&&s[1]===-s[2]){const r=Math.acos(s[0])*180/Math.PI;return`rotate(${d(r)})`}}else if(s[0]===1&&s[1]===0&&s[2]===0&&s[3]===1)return`translate(${d(s[4])} ${d(s[5])})`;return`matrix(${d(s[0])} ${d(s[1])} ${d(s[2])} ${d(s[3])} ${d(s[4])} ${d(s[5])})`};const at={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},X="http://www.w3.org/XML/1998/namespace",w="http://www.w3.org/1999/xlink",A=["butt","round","square"],I=["miter","round","bevel"],L=function(s,r="",a=!1){if(URL.createObjectURL&&typeof Blob<"u"&&!a)return URL.createObjectURL(new Blob([s],{type:r}));const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let u=`data:${r};base64,`;for(let T=0,i=s.length;T<i;T+=3){const M=s[T]&255,U=s[T+1]&255,K=s[T+2]&255,et=M>>2,nt=(M&3)<<4|U>>4,pt=T+1<i?(U&15)<<2|K>>6:64,rt=T+2<i?K&63:64;u+=e[et]+e[nt]+e[pt]+e[rt]}return u},E=function(){const s=new Uint8Array([137,80,78,71,13,10,26,10]),r=12,a=new Int32Array(256);for(let K=0;K<256;K++){let et=K;for(let nt=0;nt<8;nt++)et&1?et=3988292384^et>>1&2147483647:et=et>>1&2147483647;a[K]=et}function e(K,et,nt){let pt=-1;for(let rt=et;rt<nt;rt++){const ut=(pt^K[rt])&255,At=a[ut];pt=pt>>>8^At}return pt^-1}function u(K,et,nt,pt){let rt=pt;const ut=et.length;nt[rt]=ut>>24&255,nt[rt+1]=ut>>16&255,nt[rt+2]=ut>>8&255,nt[rt+3]=ut&255,rt+=4,nt[rt]=K.charCodeAt(0)&255,nt[rt+1]=K.charCodeAt(1)&255,nt[rt+2]=K.charCodeAt(2)&255,nt[rt+3]=K.charCodeAt(3)&255,rt+=4,nt.set(et,rt),rt+=et.length;const At=e(nt,pt+4,rt);nt[rt]=At>>24&255,nt[rt+1]=At>>16&255,nt[rt+2]=At>>8&255,nt[rt+3]=At&255}function T(K,et,nt){let pt=1,rt=0;for(let ut=et;ut<nt;++ut)pt=(pt+(K[ut]&255))%65521,rt=(rt+pt)%65521;return rt<<16|pt}function i(K){if(!z.isNodeJS)return M(K);try{let et;parseInt(process.versions.node)>=8?et=K:et=Buffer.from(K);const nt=require$$5.deflateSync(et,{level:9});return nt instanceof Uint8Array?nt:new Uint8Array(nt)}catch(et){(0,F.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+et)}return M(K)}function M(K){let et=K.length;const nt=65535,pt=Math.ceil(et/nt),rt=new Uint8Array(2+et+pt*5+4);let ut=0;rt[ut++]=120,rt[ut++]=156;let At=0;for(;et>nt;)rt[ut++]=0,rt[ut++]=255,rt[ut++]=255,rt[ut++]=0,rt[ut++]=0,rt.set(K.subarray(At,At+nt),ut),ut+=nt,At+=nt,et-=nt;rt[ut++]=1,rt[ut++]=et&255,rt[ut++]=et>>8&255,rt[ut++]=~et&65535&255,rt[ut++]=(~et&65535)>>8&255,rt.set(K.subarray(At),ut),ut+=K.length-At;const Ct=T(K,0,K.length);return rt[ut++]=Ct>>24&255,rt[ut++]=Ct>>16&255,rt[ut++]=Ct>>8&255,rt[ut++]=Ct&255,rt}function U(K,et,nt,pt){const rt=K.width,ut=K.height;let At,Ct,Tt;const wt=K.data;switch(et){case F.ImageKind.GRAYSCALE_1BPP:Ct=0,At=1,Tt=rt+7>>3;break;case F.ImageKind.RGB_24BPP:Ct=2,At=8,Tt=rt*3;break;case F.ImageKind.RGBA_32BPP:Ct=6,At=8,Tt=rt*4;break;default:throw new Error("invalid format")}const N=new Uint8Array((1+Tt)*ut);let o=0,c=0;for(let C=0;C<ut;++C)N[o++]=0,N.set(wt.subarray(c,c+Tt),o),c+=Tt,o+=Tt;if(et===F.ImageKind.GRAYSCALE_1BPP&&pt){o=0;for(let C=0;C<ut;C++){o++;for(let k=0;k<Tt;k++)N[o++]^=255}}const v=new Uint8Array([rt>>24&255,rt>>16&255,rt>>8&255,rt&255,ut>>24&255,ut>>16&255,ut>>8&255,ut&255,At,Ct,0,0,0]),O=i(N),D=s.length+r*3+v.length+O.length,B=new Uint8Array(D);let R=0;return B.set(s,R),R+=s.length,u("IHDR",v,B,R),R+=r+v.length,u("IDATA",O,B,R),R+=r+O.length,u("IEND",new Uint8Array(0),B,R),L(B,"image/png",nt)}return function(et,nt,pt){const rt=et.kind===void 0?F.ImageKind.GRAYSCALE_1BPP:et.kind;return U(et,rt,nt,pt)}}();class m{constructor(){this.fontSizeScale=1,this.fontWeight=at.fontWeight,this.fontSize=0,this.textMatrix=F.IDENTITY_MATRIX,this.fontMatrix=F.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=F.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=at.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(r,a){this.x=r,this.y=a}}let P=0,x=0,g=0;f.SVGGraphics=H=class{constructor(s,r,a=!1){(0,p.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new p.DOMSVGFactory,this.current=new m,this.transformMatrix=F.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=s,this.objs=r,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!a,this._operatorIdMapping=[];for(const e in F.OPS)this._operatorIdMapping[F.OPS[e]]=e}getObject(s,r=null){return typeof s=="string"?s.startsWith("g_")?this.commonObjs.get(s):this.objs.get(s):r}save(){this.transformStack.push(this.transformMatrix);const s=this.current;this.extraStack.push(s),this.current=s.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(s){this.save(),this.executeOpTree(s),this.restore()}loadDependencies(s){const r=s.fnArray,a=s.argsArray;for(let e=0,u=r.length;e<u;e++)if(r[e]===F.OPS.dependency)for(const T of a[e]){const i=T.startsWith("g_")?this.commonObjs:this.objs,M=new Promise(U=>{i.get(T,U)});this.current.dependencies.push(M)}return Promise.all(this.current.dependencies)}transform(s,r,a,e,u,T){const i=[s,r,a,e,u,T];this.transformMatrix=F.Util.transform(this.transformMatrix,i),this.tgrp=null}getSVG(s,r){this.viewport=r;const a=this._initialize(r);return this.loadDependencies(s).then(()=>(this.transformMatrix=F.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(s)),a))}convertOpList(s){const r=this._operatorIdMapping,a=s.argsArray,e=s.fnArray,u=[];for(let T=0,i=e.length;T<i;T++){const M=e[T];u.push({fnId:M,fn:r[M],args:a[T]})}return y(u)}executeOpTree(s){for(const r of s){const a=r.fn,e=r.fnId,u=r.args;switch(e|0){case F.OPS.beginText:this.beginText();break;case F.OPS.dependency:break;case F.OPS.setLeading:this.setLeading(u);break;case F.OPS.setLeadingMoveText:this.setLeadingMoveText(u[0],u[1]);break;case F.OPS.setFont:this.setFont(u);break;case F.OPS.showText:this.showText(u[0]);break;case F.OPS.showSpacedText:this.showText(u[0]);break;case F.OPS.endText:this.endText();break;case F.OPS.moveText:this.moveText(u[0],u[1]);break;case F.OPS.setCharSpacing:this.setCharSpacing(u[0]);break;case F.OPS.setWordSpacing:this.setWordSpacing(u[0]);break;case F.OPS.setHScale:this.setHScale(u[0]);break;case F.OPS.setTextMatrix:this.setTextMatrix(u[0],u[1],u[2],u[3],u[4],u[5]);break;case F.OPS.setTextRise:this.setTextRise(u[0]);break;case F.OPS.setTextRenderingMode:this.setTextRenderingMode(u[0]);break;case F.OPS.setLineWidth:this.setLineWidth(u[0]);break;case F.OPS.setLineJoin:this.setLineJoin(u[0]);break;case F.OPS.setLineCap:this.setLineCap(u[0]);break;case F.OPS.setMiterLimit:this.setMiterLimit(u[0]);break;case F.OPS.setFillRGBColor:this.setFillRGBColor(u[0],u[1],u[2]);break;case F.OPS.setStrokeRGBColor:this.setStrokeRGBColor(u[0],u[1],u[2]);break;case F.OPS.setStrokeColorN:this.setStrokeColorN(u);break;case F.OPS.setFillColorN:this.setFillColorN(u);break;case F.OPS.shadingFill:this.shadingFill(u[0]);break;case F.OPS.setDash:this.setDash(u[0],u[1]);break;case F.OPS.setRenderingIntent:this.setRenderingIntent(u[0]);break;case F.OPS.setFlatness:this.setFlatness(u[0]);break;case F.OPS.setGState:this.setGState(u[0]);break;case F.OPS.fill:this.fill();break;case F.OPS.eoFill:this.eoFill();break;case F.OPS.stroke:this.stroke();break;case F.OPS.fillStroke:this.fillStroke();break;case F.OPS.eoFillStroke:this.eoFillStroke();break;case F.OPS.clip:this.clip("nonzero");break;case F.OPS.eoClip:this.clip("evenodd");break;case F.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case F.OPS.paintImageXObject:this.paintImageXObject(u[0]);break;case F.OPS.paintInlineImageXObject:this.paintInlineImageXObject(u[0]);break;case F.OPS.paintImageMaskXObject:this.paintImageMaskXObject(u[0]);break;case F.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(u[0],u[1]);break;case F.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case F.OPS.closePath:this.closePath();break;case F.OPS.closeStroke:this.closeStroke();break;case F.OPS.closeFillStroke:this.closeFillStroke();break;case F.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case F.OPS.nextLine:this.nextLine();break;case F.OPS.transform:this.transform(u[0],u[1],u[2],u[3],u[4],u[5]);break;case F.OPS.constructPath:this.constructPath(u[0],u[1]);break;case F.OPS.endPath:this.endPath();break;case 92:this.group(r.items);break;default:(0,F.warn)(`Unimplemented operator ${a}`);break}}}setWordSpacing(s){this.current.wordSpacing=s}setCharSpacing(s){this.current.charSpacing=s}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(s,r,a,e,u,T){const i=this.current;i.textMatrix=i.lineMatrix=[s,r,a,e,u,T],i.textMatrixScale=Math.hypot(s,r),i.x=i.lineX=0,i.y=i.lineY=0,i.xcoords=[],i.ycoords=[],i.tspan=this.svgFactory.createElement("svg:tspan"),i.tspan.setAttributeNS(null,"font-family",i.fontFamily),i.tspan.setAttributeNS(null,"font-size",`${d(i.fontSize)}px`),i.tspan.setAttributeNS(null,"y",d(-i.y)),i.txtElement=this.svgFactory.createElement("svg:text"),i.txtElement.append(i.tspan)}beginText(){const s=this.current;s.x=s.lineX=0,s.y=s.lineY=0,s.textMatrix=F.IDENTITY_MATRIX,s.lineMatrix=F.IDENTITY_MATRIX,s.textMatrixScale=1,s.tspan=this.svgFactory.createElement("svg:tspan"),s.txtElement=this.svgFactory.createElement("svg:text"),s.txtgrp=this.svgFactory.createElement("svg:g"),s.xcoords=[],s.ycoords=[]}moveText(s,r){const a=this.current;a.x=a.lineX+=s,a.y=a.lineY+=r,a.xcoords=[],a.ycoords=[],a.tspan=this.svgFactory.createElement("svg:tspan"),a.tspan.setAttributeNS(null,"font-family",a.fontFamily),a.tspan.setAttributeNS(null,"font-size",`${d(a.fontSize)}px`),a.tspan.setAttributeNS(null,"y",d(-a.y))}showText(s){const r=this.current,a=r.font,e=r.fontSize;if(e===0)return;const u=r.fontSizeScale,T=r.charSpacing,i=r.wordSpacing,M=r.fontDirection,U=r.textHScale*M,K=a.vertical,et=K?1:-1,nt=a.defaultVMetrics,pt=e*r.fontMatrix[0];let rt=0;for(const Ct of s){if(Ct===null){rt+=M*i;continue}else if(typeof Ct=="number"){rt+=et*Ct*e/1e3;continue}const Tt=(Ct.isSpace?i:0)+T,wt=Ct.fontChar;let N,o,c=Ct.width;if(K){let O;const D=Ct.vmetric||nt;O=Ct.vmetric?D[1]:c*.5,O=-O*pt;const B=D[2]*pt;c=D?-D[0]:c,N=O/u,o=(rt+B)/u}else N=rt/u,o=0;(Ct.isInFont||a.missingFile)&&(r.xcoords.push(r.x+N),K&&r.ycoords.push(-r.y+o),r.tspan.textContent+=wt);let v;K?v=c*pt-Tt*M:v=c*pt+Tt*M,rt+=v}r.tspan.setAttributeNS(null,"x",r.xcoords.map(d).join(" ")),K?r.tspan.setAttributeNS(null,"y",r.ycoords.map(d).join(" ")):r.tspan.setAttributeNS(null,"y",d(-r.y)),K?r.y-=rt:r.x+=rt*U,r.tspan.setAttributeNS(null,"font-family",r.fontFamily),r.tspan.setAttributeNS(null,"font-size",`${d(r.fontSize)}px`),r.fontStyle!==at.fontStyle&&r.tspan.setAttributeNS(null,"font-style",r.fontStyle),r.fontWeight!==at.fontWeight&&r.tspan.setAttributeNS(null,"font-weight",r.fontWeight);const ut=r.textRenderingMode&F.TextRenderingMode.FILL_STROKE_MASK;if(ut===F.TextRenderingMode.FILL||ut===F.TextRenderingMode.FILL_STROKE?(r.fillColor!==at.fillColor&&r.tspan.setAttributeNS(null,"fill",r.fillColor),r.fillAlpha<1&&r.tspan.setAttributeNS(null,"fill-opacity",r.fillAlpha)):r.textRenderingMode===F.TextRenderingMode.ADD_TO_PATH?r.tspan.setAttributeNS(null,"fill","transparent"):r.tspan.setAttributeNS(null,"fill","none"),ut===F.TextRenderingMode.STROKE||ut===F.TextRenderingMode.FILL_STROKE){const Ct=1/(r.textMatrixScale||1);this._setStrokeAttributes(r.tspan,Ct)}let At=r.textMatrix;r.textRise!==0&&(At=At.slice(),At[5]+=r.textRise),r.txtElement.setAttributeNS(null,"transform",`${S(At)} scale(${d(U)}, -1)`),r.txtElement.setAttributeNS(X,"xml:space","preserve"),r.txtElement.append(r.tspan),r.txtgrp.append(r.txtElement),this._ensureTransformGroup().append(r.txtElement)}setLeadingMoveText(s,r){this.setLeading(-r),this.moveText(s,r)}addFontStyle(s){if(!s.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));const r=L(s.data,s.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${s.loadedName}"; src: url(${r}); } `}setFont(s){const r=this.current,a=this.commonObjs.get(s[0]);let e=s[1];r.font=a,this.embedFonts&&!a.missingFile&&!this.embeddedFonts[a.loadedName]&&(this.addFontStyle(a),this.embeddedFonts[a.loadedName]=a),r.fontMatrix=a.fontMatrix||F.FONT_IDENTITY_MATRIX;let u="normal";a.black?u="900":a.bold&&(u="bold");const T=a.italic?"italic":"normal";e<0?(e=-e,r.fontDirection=-1):r.fontDirection=1,r.fontSize=e,r.fontFamily=a.loadedName,r.fontWeight=u,r.fontStyle=T,r.tspan=this.svgFactory.createElement("svg:tspan"),r.tspan.setAttributeNS(null,"y",d(-r.y)),r.xcoords=[],r.ycoords=[]}endText(){var r;const s=this.current;s.textRenderingMode&F.TextRenderingMode.ADD_TO_PATH_FLAG&&((r=s.txtElement)!=null&&r.hasChildNodes())&&(s.element=s.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(s){s>0&&(this.current.lineWidth=s)}setLineCap(s){this.current.lineCap=A[s]}setLineJoin(s){this.current.lineJoin=I[s]}setMiterLimit(s){this.current.miterLimit=s}setStrokeAlpha(s){this.current.strokeAlpha=s}setStrokeRGBColor(s,r,a){this.current.strokeColor=F.Util.makeHexColor(s,r,a)}setFillAlpha(s){this.current.fillAlpha=s}setFillRGBColor(s,r,a){this.current.fillColor=F.Util.makeHexColor(s,r,a),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(s){this.current.strokeColor=this._makeColorN_Pattern(s)}setFillColorN(s){this.current.fillColor=this._makeColorN_Pattern(s)}shadingFill(s){const r=this.viewport.width,a=this.viewport.height,e=F.Util.inverseTransform(this.transformMatrix),u=F.Util.applyTransform([0,0],e),T=F.Util.applyTransform([0,a],e),i=F.Util.applyTransform([r,0],e),M=F.Util.applyTransform([r,a],e),U=Math.min(u[0],T[0],i[0],M[0]),K=Math.min(u[1],T[1],i[1],M[1]),et=Math.max(u[0],T[0],i[0],M[0]),nt=Math.max(u[1],T[1],i[1],M[1]),pt=this.svgFactory.createElement("svg:rect");pt.setAttributeNS(null,"x",U),pt.setAttributeNS(null,"y",K),pt.setAttributeNS(null,"width",et-U),pt.setAttributeNS(null,"height",nt-K),pt.setAttributeNS(null,"fill",this._makeShadingPattern(s)),this.current.fillAlpha<1&&pt.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(pt)}_makeColorN_Pattern(s){return s[0]==="TilingPattern"?this._makeTilingPattern(s):this._makeShadingPattern(s)}_makeTilingPattern(s){const r=s[1],a=s[2],e=s[3]||F.IDENTITY_MATRIX,[u,T,i,M]=s[4],U=s[5],K=s[6],et=s[7],nt=`shading${g++}`,[pt,rt,ut,At]=F.Util.normalizeRect([...F.Util.applyTransform([u,T],e),...F.Util.applyTransform([i,M],e)]),[Ct,Tt]=F.Util.singularValueDecompose2dScale(e),wt=U*Ct,N=K*Tt,o=this.svgFactory.createElement("svg:pattern");o.setAttributeNS(null,"id",nt),o.setAttributeNS(null,"patternUnits","userSpaceOnUse"),o.setAttributeNS(null,"width",wt),o.setAttributeNS(null,"height",N),o.setAttributeNS(null,"x",`${pt}`),o.setAttributeNS(null,"y",`${rt}`);const c=this.svg,v=this.transformMatrix,O=this.current.fillColor,D=this.current.strokeColor,B=this.svgFactory.create(ut-pt,At-rt);if(this.svg=B,this.transformMatrix=e,et===2){const R=F.Util.makeHexColor(...r);this.current.fillColor=R,this.current.strokeColor=R}return this.executeOpTree(this.convertOpList(a)),this.svg=c,this.transformMatrix=v,this.current.fillColor=O,this.current.strokeColor=D,o.append(B.childNodes[0]),this.defs.append(o),`url(#${nt})`}_makeShadingPattern(s){switch(typeof s=="string"&&(s=this.objs.get(s)),s[0]){case"RadialAxial":const r=`shading${g++}`,a=s[3];let e;switch(s[1]){case"axial":const u=s[4],T=s[5];e=this.svgFactory.createElement("svg:linearGradient"),e.setAttributeNS(null,"id",r),e.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),e.setAttributeNS(null,"x1",u[0]),e.setAttributeNS(null,"y1",u[1]),e.setAttributeNS(null,"x2",T[0]),e.setAttributeNS(null,"y2",T[1]);break;case"radial":const i=s[4],M=s[5],U=s[6],K=s[7];e=this.svgFactory.createElement("svg:radialGradient"),e.setAttributeNS(null,"id",r),e.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),e.setAttributeNS(null,"cx",M[0]),e.setAttributeNS(null,"cy",M[1]),e.setAttributeNS(null,"r",K),e.setAttributeNS(null,"fx",i[0]),e.setAttributeNS(null,"fy",i[1]),e.setAttributeNS(null,"fr",U);break;default:throw new Error(`Unknown RadialAxial type: ${s[1]}`)}for(const u of a){const T=this.svgFactory.createElement("svg:stop");T.setAttributeNS(null,"offset",u[0]),T.setAttributeNS(null,"stop-color",u[1]),e.append(T)}return this.defs.append(e),`url(#${r})`;case"Mesh":return(0,F.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${s[0]}`)}}setDash(s,r){this.current.dashArray=s,this.current.dashPhase=r}constructPath(s,r){const a=this.current;let e=a.x,u=a.y,T=[],i=0;for(const M of s)switch(M|0){case F.OPS.rectangle:e=r[i++],u=r[i++];const U=r[i++],K=r[i++],et=e+U,nt=u+K;T.push("M",d(e),d(u),"L",d(et),d(u),"L",d(et),d(nt),"L",d(e),d(nt),"Z");break;case F.OPS.moveTo:e=r[i++],u=r[i++],T.push("M",d(e),d(u));break;case F.OPS.lineTo:e=r[i++],u=r[i++],T.push("L",d(e),d(u));break;case F.OPS.curveTo:e=r[i+4],u=r[i+5],T.push("C",d(r[i]),d(r[i+1]),d(r[i+2]),d(r[i+3]),d(e),d(u)),i+=6;break;case F.OPS.curveTo2:T.push("C",d(e),d(u),d(r[i]),d(r[i+1]),d(r[i+2]),d(r[i+3])),e=r[i+2],u=r[i+3],i+=4;break;case F.OPS.curveTo3:e=r[i+2],u=r[i+3],T.push("C",d(r[i]),d(r[i+1]),d(e),d(u),d(e),d(u)),i+=4;break;case F.OPS.closePath:T.push("Z");break}T=T.join(" "),a.path&&s.length>0&&s[0]!==F.OPS.rectangle&&s[0]!==F.OPS.moveTo?T=a.path.getAttributeNS(null,"d")+T:(a.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(a.path)),a.path.setAttributeNS(null,"d",T),a.path.setAttributeNS(null,"fill","none"),a.element=a.path,a.setCurrentPoint(e,u)}endPath(){const s=this.current;if(s.path=null,!this.pendingClip)return;if(!s.element){this.pendingClip=null;return}const r=`clippath${P++}`,a=this.svgFactory.createElement("svg:clipPath");a.setAttributeNS(null,"id",r),a.setAttributeNS(null,"transform",S(this.transformMatrix));const e=s.element.cloneNode(!0);if(this.pendingClip==="evenodd"?e.setAttributeNS(null,"clip-rule","evenodd"):e.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,a.append(e),this.defs.append(a),s.activeClipUrl){s.clipGroup=null;for(const u of this.extraStack)u.clipGroup=null;a.setAttributeNS(null,"clip-path",s.activeClipUrl)}s.activeClipUrl=`url(#${r})`,this.tgrp=null}clip(s){this.pendingClip=s}closePath(){const s=this.current;if(s.path){const r=`${s.path.getAttributeNS(null,"d")}Z`;s.path.setAttributeNS(null,"d",r)}}setLeading(s){this.current.leading=-s}setTextRise(s){this.current.textRise=s}setTextRenderingMode(s){this.current.textRenderingMode=s}setHScale(s){this.current.textHScale=s/100}setRenderingIntent(s){}setFlatness(s){}setGState(s){for(const[r,a]of s)switch(r){case"LW":this.setLineWidth(a);break;case"LC":this.setLineCap(a);break;case"LJ":this.setLineJoin(a);break;case"ML":this.setMiterLimit(a);break;case"D":this.setDash(a[0],a[1]);break;case"RI":this.setRenderingIntent(a);break;case"FL":this.setFlatness(a);break;case"Font":this.setFont(a);break;case"CA":this.setStrokeAlpha(a);break;case"ca":this.setFillAlpha(a);break;default:(0,F.warn)(`Unimplemented graphic state operator ${r}`);break}}fill(){const s=this.current;s.element&&(s.element.setAttributeNS(null,"fill",s.fillColor),s.element.setAttributeNS(null,"fill-opacity",s.fillAlpha),this.endPath())}stroke(){const s=this.current;s.element&&(this._setStrokeAttributes(s.element),s.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(s,r=1){const a=this.current;let e=a.dashArray;r!==1&&e.length>0&&(e=e.map(function(u){return r*u})),s.setAttributeNS(null,"stroke",a.strokeColor),s.setAttributeNS(null,"stroke-opacity",a.strokeAlpha),s.setAttributeNS(null,"stroke-miterlimit",d(a.miterLimit)),s.setAttributeNS(null,"stroke-linecap",a.lineCap),s.setAttributeNS(null,"stroke-linejoin",a.lineJoin),s.setAttributeNS(null,"stroke-width",d(r*a.lineWidth)+"px"),s.setAttributeNS(null,"stroke-dasharray",e.map(d).join(" ")),s.setAttributeNS(null,"stroke-dashoffset",d(r*a.dashPhase)+"px")}eoFill(){var s;(s=this.current.element)==null||s.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var s;(s=this.current.element)==null||s.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const s=this.svgFactory.createElement("svg:rect");s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y","0"),s.setAttributeNS(null,"width","1px"),s.setAttributeNS(null,"height","1px"),s.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(s)}paintImageXObject(s){const r=this.getObject(s);if(!r){(0,F.warn)(`Dependent image with object ID ${s} is not ready yet`);return}this.paintInlineImageXObject(r)}paintInlineImageXObject(s,r){const a=s.width,e=s.height,u=E(s,this.forceDataSchema,!!r),T=this.svgFactory.createElement("svg:rect");T.setAttributeNS(null,"x","0"),T.setAttributeNS(null,"y","0"),T.setAttributeNS(null,"width",d(a)),T.setAttributeNS(null,"height",d(e)),this.current.element=T,this.clip("nonzero");const i=this.svgFactory.createElement("svg:image");i.setAttributeNS(w,"xlink:href",u),i.setAttributeNS(null,"x","0"),i.setAttributeNS(null,"y",d(-e)),i.setAttributeNS(null,"width",d(a)+"px"),i.setAttributeNS(null,"height",d(e)+"px"),i.setAttributeNS(null,"transform",`scale(${d(1/a)} ${d(-1/e)})`),r?r.append(i):this._ensureTransformGroup().append(i)}paintImageMaskXObject(s){const r=this.getObject(s.data,s);if(r.bitmap){(0,F.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const a=this.current,e=r.width,u=r.height,T=a.fillColor;a.maskId=`mask${x++}`;const i=this.svgFactory.createElement("svg:mask");i.setAttributeNS(null,"id",a.maskId);const M=this.svgFactory.createElement("svg:rect");M.setAttributeNS(null,"x","0"),M.setAttributeNS(null,"y","0"),M.setAttributeNS(null,"width",d(e)),M.setAttributeNS(null,"height",d(u)),M.setAttributeNS(null,"fill",T),M.setAttributeNS(null,"mask",`url(#${a.maskId})`),this.defs.append(i),this._ensureTransformGroup().append(M),this.paintInlineImageXObject(r,i)}paintFormXObjectBegin(s,r){if(Array.isArray(s)&&s.length===6&&this.transform(s[0],s[1],s[2],s[3],s[4],s[5]),r){const a=r[2]-r[0],e=r[3]-r[1],u=this.svgFactory.createElement("svg:rect");u.setAttributeNS(null,"x",r[0]),u.setAttributeNS(null,"y",r[1]),u.setAttributeNS(null,"width",d(a)),u.setAttributeNS(null,"height",d(e)),this.current.element=u,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(s){const r=this.svgFactory.create(s.width,s.height),a=this.svgFactory.createElement("svg:defs");r.append(a),this.defs=a;const e=this.svgFactory.createElement("svg:g");return e.setAttributeNS(null,"transform",S(s.transform)),r.append(e),this.svg=e,r}_ensureClipGroup(){if(!this.current.clipGroup){const s=this.svgFactory.createElement("svg:g");s.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(s),this.current.clipGroup=s}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",S(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}}}],__webpack_module_cache__={};function __w_pdfjs_require__(ht){var f=__webpack_module_cache__[ht];if(f!==void 0)return f.exports;var Q=__webpack_module_cache__[ht]={exports:{}};return __webpack_modules__[ht](Q,Q.exports,__w_pdfjs_require__),Q.exports}var __webpack_exports__={};return(()=>{var ht=__webpack_exports__;Object.defineProperty(ht,"__esModule",{value:!0}),Object.defineProperty(ht,"AbortException",{enumerable:!0,get:function(){return f.AbortException}}),Object.defineProperty(ht,"AnnotationEditorLayer",{enumerable:!0,get:function(){return z.AnnotationEditorLayer}}),Object.defineProperty(ht,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return f.AnnotationEditorParamsType}}),Object.defineProperty(ht,"AnnotationEditorType",{enumerable:!0,get:function(){return f.AnnotationEditorType}}),Object.defineProperty(ht,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return H.AnnotationEditorUIManager}}),Object.defineProperty(ht,"AnnotationLayer",{enumerable:!0,get:function(){return at.AnnotationLayer}}),Object.defineProperty(ht,"AnnotationMode",{enumerable:!0,get:function(){return f.AnnotationMode}}),Object.defineProperty(ht,"CMapCompressionType",{enumerable:!0,get:function(){return f.CMapCompressionType}}),Object.defineProperty(ht,"FeatureTest",{enumerable:!0,get:function(){return f.FeatureTest}}),Object.defineProperty(ht,"GlobalWorkerOptions",{enumerable:!0,get:function(){return X.GlobalWorkerOptions}}),Object.defineProperty(ht,"InvalidPDFException",{enumerable:!0,get:function(){return f.InvalidPDFException}}),Object.defineProperty(ht,"MissingPDFException",{enumerable:!0,get:function(){return f.MissingPDFException}}),Object.defineProperty(ht,"OPS",{enumerable:!0,get:function(){return f.OPS}}),Object.defineProperty(ht,"PDFDataRangeTransport",{enumerable:!0,get:function(){return Q.PDFDataRangeTransport}}),Object.defineProperty(ht,"PDFDateString",{enumerable:!0,get:function(){return p.PDFDateString}}),Object.defineProperty(ht,"PDFWorker",{enumerable:!0,get:function(){return Q.PDFWorker}}),Object.defineProperty(ht,"PasswordResponses",{enumerable:!0,get:function(){return f.PasswordResponses}}),Object.defineProperty(ht,"PermissionFlag",{enumerable:!0,get:function(){return f.PermissionFlag}}),Object.defineProperty(ht,"PixelsPerInch",{enumerable:!0,get:function(){return p.PixelsPerInch}}),Object.defineProperty(ht,"PromiseCapability",{enumerable:!0,get:function(){return f.PromiseCapability}}),Object.defineProperty(ht,"RenderingCancelledException",{enumerable:!0,get:function(){return p.RenderingCancelledException}}),Object.defineProperty(ht,"SVGGraphics",{enumerable:!0,get:function(){return w.SVGGraphics}}),Object.defineProperty(ht,"UnexpectedResponseException",{enumerable:!0,get:function(){return f.UnexpectedResponseException}}),Object.defineProperty(ht,"Util",{enumerable:!0,get:function(){return f.Util}}),Object.defineProperty(ht,"VerbosityLevel",{enumerable:!0,get:function(){return f.VerbosityLevel}}),Object.defineProperty(ht,"XfaLayer",{enumerable:!0,get:function(){return A.XfaLayer}}),Object.defineProperty(ht,"build",{enumerable:!0,get:function(){return Q.build}}),Object.defineProperty(ht,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return f.createValidAbsoluteUrl}}),Object.defineProperty(ht,"getDocument",{enumerable:!0,get:function(){return Q.getDocument}}),Object.defineProperty(ht,"getFilenameFromUrl",{enumerable:!0,get:function(){return p.getFilenameFromUrl}}),Object.defineProperty(ht,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return p.getPdfFilenameFromUrl}}),Object.defineProperty(ht,"getXfaPageViewport",{enumerable:!0,get:function(){return p.getXfaPageViewport}}),Object.defineProperty(ht,"isDataScheme",{enumerable:!0,get:function(){return p.isDataScheme}}),Object.defineProperty(ht,"isPdfFile",{enumerable:!0,get:function(){return p.isPdfFile}}),Object.defineProperty(ht,"loadScript",{enumerable:!0,get:function(){return p.loadScript}}),Object.defineProperty(ht,"normalizeUnicode",{enumerable:!0,get:function(){return f.normalizeUnicode}}),Object.defineProperty(ht,"renderTextLayer",{enumerable:!0,get:function(){return F.renderTextLayer}}),Object.defineProperty(ht,"setLayerDimensions",{enumerable:!0,get:function(){return p.setLayerDimensions}}),Object.defineProperty(ht,"shadow",{enumerable:!0,get:function(){return f.shadow}}),Object.defineProperty(ht,"updateTextLayer",{enumerable:!0,get:function(){return F.updateTextLayer}}),Object.defineProperty(ht,"version",{enumerable:!0,get:function(){return Q.version}});var f=__w_pdfjs_require__(1),Q=__w_pdfjs_require__(2),p=__w_pdfjs_require__(6),F=__w_pdfjs_require__(26),z=__w_pdfjs_require__(27),H=__w_pdfjs_require__(5),at=__w_pdfjs_require__(30),X=__w_pdfjs_require__(14),w=__w_pdfjs_require__(33),A=__w_pdfjs_require__(32)})(),__webpack_exports__})())})(pdf);var pdfExports=pdf.exports;export{pdfExports as p};