Linux websever 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64
Apache/2.4.52 (Ubuntu)
: 192.168.3.70 | : 192.168.1.99
Cant Read [ /etc/named.conf ]
8.1.2-1ubuntu2.23
urlab
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
coursewise /
assets /
[ HOME SHELL ]
Name
Size
Permission
Action
AcademicTools-tj30wEj0.js
7.55
KB
-rwxr-xr-x
AcademicTools-tj30wEj0.js.map
14.63
KB
-rwxr-xr-x
AddCourse-BTNu-pnI.js
10.08
KB
-rwxr-xr-x
AddCourse-BTNu-pnI.js.map
35.84
KB
-rwxr-xr-x
AdminFeedbackManagement-DsTd1C...
13.52
KB
-rwxr-xr-x
AdminFeedbackManagement-DsTd1C...
45.25
KB
-rwxr-xr-x
CourseReviews-CLlzbLuT.js
27.45
KB
-rwxr-xr-x
CourseReviews-CLlzbLuT.js.map
112.09
KB
-rwxr-xr-x
Dewan-B5d13VSK.png
819.07
KB
-rwxr-xr-x
Dewan-Bniqtmij.js
102
B
-rwxr-xr-x
Dewan-Bniqtmij.js.map
197
B
-rwxr-xr-x
EditCourse-DeWQqcol.js
9.65
KB
-rwxr-xr-x
EditCourse-DeWQqcol.js.map
34.87
KB
-rwxr-xr-x
MyCourses-BA9wctPB.js
8.48
KB
-rwxr-xr-x
MyCourses-BA9wctPB.js.map
31.95
KB
-rwxr-xr-x
Rajput-BnxWGXCy.js
104
B
-rwxr-xr-x
Rajput-BnxWGXCy.js.map
200
B
-rwxr-xr-x
Rajput-CE3gMniE.png
908.11
KB
-rwxr-xr-x
Settings-BGf6-NRc.js
2.09
KB
-rwxr-xr-x
Settings-BGf6-NRc.js.map
5.35
KB
-rwxr-xr-x
TimetableClashChecker-gskbNvYE...
32.74
KB
-rwxr-xr-x
TimetableClashChecker-gskbNvYE...
137.78
KB
-rwxr-xr-x
UserManagement-pl4YxOXe.js
2.17
KB
-rwxr-xr-x
UserManagement-pl4YxOXe.js.map
5.49
KB
-rwxr-xr-x
academic-components-DF0R8Z3x.j...
670.84
KB
-rwxr-xr-x
academic-components-DF0R8Z3x.j...
1.87
MB
-rwxr-xr-x
admin-components-DUStTukf.js
1.36
MB
-rwxr-xr-x
admin-components-DUStTukf.js.m...
5.5
MB
-rwxr-xr-x
apple-touch-icon-CvbJoadU.png
20.94
KB
-rwxr-xr-x
browser-DyVnc2OH.js
392
B
-rwxr-xr-x
browser-DyVnc2OH.js.map
404
B
-rwxr-xr-x
favicon-16x16-CXk8OJVQ.png
734
B
-rwxr-xr-x
favicon-32x32-BMg2Kocu.png
1.78
KB
-rwxr-xr-x
favicon-hhFM0i7Z.ico
15.04
KB
-rwxr-xr-x
geminiService-khxcBfs7.js
2.36
KB
-rwxr-xr-x
geminiService-khxcBfs7.js.map
6.73
KB
-rwxr-xr-x
index-BbxTXAhJ.css
45.32
KB
-rwxr-xr-x
index-DN1SJQ1D.js
73.27
KB
-rwxr-xr-x
index-DN1SJQ1D.js.map
215.58
KB
-rwxr-xr-x
index.es-B3idowhG.js
155.35
KB
-rwxr-xr-x
index.es-B3idowhG.js.map
624.87
KB
-rwxr-xr-x
kunal-UYflGF6w.jpg
9.22
MB
-rwxr-xr-x
kunal-ozIpZZVI.js
102
B
-rwxr-xr-x
kunal-ozIpZZVI.js.map
197
B
-rwxr-xr-x
pdf-vendor-Bz5wMm03.js
317.87
KB
-rwxr-xr-x
pdf-vendor-Bz5wMm03.js.map
976.2
KB
-rwxr-xr-x
purify.es-CQJ0hv7W.js
21.35
KB
-rwxr-xr-x
purify.es-CQJ0hv7W.js.map
88.01
KB
-rwxr-xr-x
react-vendor-BFYHlx6n.js
160.29
KB
-rwxr-xr-x
react-vendor-BFYHlx6n.js.map
687.16
KB
-rwxr-xr-x
sarthak-CfXTejkX.png
764.15
KB
-rwxr-xr-x
sarthak-Cq6ZcrGb.js
106
B
-rwxr-xr-x
sarthak-Cq6ZcrGb.js.map
203
B
-rwxr-xr-x
site-BwHFeIBa.webmanifest
263
B
-rwxr-xr-x
supabase-vendor-DtZyL83W.js
105.45
KB
-rwxr-xr-x
supabase-vendor-DtZyL83W.js.ma...
449.41
KB
-rwxr-xr-x
ui-vendor-DSJ4jbeb.js
44.26
KB
-rwxr-xr-x
ui-vendor-DSJ4jbeb.js.map
190.96
KB
-rwxr-xr-x
useToast-Bg1woyD1.js
414
B
-rwxr-xr-x
useToast-Bg1woyD1.js.map
1.83
KB
-rwxr-xr-x
xlsx-vendor-D_ykzFJ-.js
276.48
KB
-rwxr-xr-x
xlsx-vendor-D_ykzFJ-.js.map
1.37
MB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : pdf-vendor-Bz5wMm03.js
var Yi=Object.defineProperty;var pi=St=>{throw TypeError(St)};var Ki=(St,h,lt)=>h in St?Yi(St,h,{enumerable:!0,configurable:!0,writable:!0,value:lt}):St[h]=lt;var Yt=(St,h,lt)=>Ki(St,typeof h!="symbol"?h+"":h,lt),Re=(St,h,lt)=>h.has(St)||pi("Cannot "+lt);var t=(St,h,lt)=>(Re(St,h,"read from private field"),lt?lt.call(St):h.get(St)),Z=(St,h,lt)=>h.has(St)?pi("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(St):h.set(St,lt),tt=(St,h,lt,o)=>(Re(St,h,"write to private field"),o?o.call(St,lt):h.set(St,lt),lt),H=(St,h,lt)=>(Re(St,h,"access private method"),lt);var ce=(St,h,lt,o)=>({set _(T){tt(St,h,T,lt)},get _(){return t(St,h,o)}});import{g as getAugmentedNamespace}from"./react-vendor-BFYHlx6n.js";function commonjsRequire(St){throw new Error('Could not dynamically require "'+St+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$5=getAugmentedNamespace(__viteBrowserExternal$1);var hasRequiredPdf;function requirePdf(){return hasRequiredPdf||(hasRequiredPdf=1,function(module,exports){(function(h,lt){module.exports=h.pdfjsLib=lt()})(globalThis,()=>(()=>{var __webpack_modules__=[,(St,h)=>{var qt;Object.defineProperty(h,"__esModule",{value:!0}),h.VerbosityLevel=h.Util=h.UnknownErrorException=h.UnexpectedResponseException=h.TextRenderingMode=h.RenderingIntentFlag=h.PromiseCapability=h.PermissionFlag=h.PasswordResponses=h.PasswordException=h.PageActionEventType=h.OPS=h.MissingPDFException=h.MAX_IMAGE_SIZE_TO_CACHE=h.LINE_FACTOR=h.LINE_DESCENT_FACTOR=h.InvalidPDFException=h.ImageKind=h.IDENTITY_MATRIX=h.FormatError=h.FeatureTest=h.FONT_IDENTITY_MATRIX=h.DocumentActionEventType=h.CMapCompressionType=h.BaseException=h.BASELINE_FACTOR=h.AnnotationType=h.AnnotationReplyType=h.AnnotationPrefix=h.AnnotationMode=h.AnnotationFlag=h.AnnotationFieldFlag=h.AnnotationEditorType=h.AnnotationEditorPrefix=h.AnnotationEditorParamsType=h.AnnotationBorderStyleType=h.AnnotationActionEventType=h.AbortException=void 0,h.assert=R,h.bytesToString=ht,h.createValidAbsoluteUrl=$,h.getModificationDate=Ct,h.getUuid=Ut,h.getVerbosityLevel=V,h.info=J,h.isArrayBuffer=X,h.isArrayEqual=wt,h.isNodeJS=void 0,h.normalizeUnicode=Rt,h.objectFromMap=At,h.objectSize=bt,h.setVerbosityLevel=rt,h.shadow=y,h.string32=pt,h.stringToBytes=ut,h.stringToPDFString=dt,h.stringToUTF8String=_t,h.unreachable=nt,h.utf8StringToString=yt,h.warn=j;const lt=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");h.isNodeJS=lt;const o=[1,0,0,1,0,0];h.IDENTITY_MATRIX=o;const T=[.001,0,0,.001,0,0];h.FONT_IDENTITY_MATRIX=T;const ct=1e7;h.MAX_IMAGE_SIZE_TO_CACHE=ct;const q=1.35;h.LINE_FACTOR=q;const mt=.35;h.LINE_DESCENT_FACTOR=mt;const O=mt/q;h.BASELINE_FACTOR=O;const M={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};h.RenderingIntentFlag=M;const m={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};h.AnnotationMode=m;const I="pdfjs_internal_editor_";h.AnnotationEditorPrefix=I;const L={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};h.AnnotationEditorType=L;const v={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};h.AnnotationEditorParamsType=v;const A={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};h.PermissionFlag=A;const w={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};h.TextRenderingMode=w;const u={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};h.ImageKind=u;const c={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};h.AnnotationType=c;const p={GROUP:"Group",REPLY:"R"};h.AnnotationReplyType=p;const x={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};h.AnnotationFlag=x;const b={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};h.AnnotationFieldFlag=b;const r={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};h.AnnotationBorderStyleType=r;const i={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"};h.AnnotationActionEventType=i;const e={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};h.DocumentActionEventType=e;const g={O:"PageOpen",C:"PageClose"};h.PageActionEventType=g;const l={ERRORS:0,WARNINGS:1,INFOS:5};h.VerbosityLevel=l;const W={NONE:0,BINARY:1};h.CMapCompressionType=W;const a={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};h.OPS=a;const S={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};h.PasswordResponses=S;let N=l.WARNINGS;function rt(vt){Number.isInteger(vt)&&(N=vt)}function V(){return N}function J(vt){N>=l.INFOS&&console.log(`Info: ${vt}`)}function j(vt){N>=l.WARNINGS&&console.log(`Warning: ${vt}`)}function nt(vt){throw new Error(vt)}function R(vt,st){vt||nt(st)}function G(vt){switch(vt?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function $(vt,st=null,it=null){if(!vt)return null;try{if(it&&typeof vt=="string"&&(it.addDefaultProtocol&&vt.startsWith("www.")&&vt.match(/\./g)?.length>=2&&(vt=`http://${vt}`),it.tryConvertEncoding))try{vt=_t(vt)}catch{}const Mt=st?new URL(vt,st):new URL(vt);if(G(Mt))return Mt}catch{}return null}function y(vt,st,it,Mt=!1){return Object.defineProperty(vt,st,{value:it,enumerable:!Mt,configurable:!0,writable:!1}),it}const s=function(){function st(it,Mt){this.constructor===st&&nt("Cannot initialize BaseException."),this.message=it,this.name=Mt}return st.prototype=new Error,st.constructor=st,st}();h.BaseException=s;class n extends s{constructor(st,it){super(st,"PasswordException"),this.code=it}}h.PasswordException=n;class d extends s{constructor(st,it){super(st,"UnknownErrorException"),this.details=it}}h.UnknownErrorException=d;class C extends s{constructor(st){super(st,"InvalidPDFException")}}h.InvalidPDFException=C;class P extends s{constructor(st){super(st,"MissingPDFException")}}h.MissingPDFException=P;class k extends s{constructor(st,it){super(st,"UnexpectedResponseException"),this.status=it}}h.UnexpectedResponseException=k;class U extends s{constructor(st){super(st,"FormatError")}}h.FormatError=U;class et extends s{constructor(st){super(st,"AbortException")}}h.AbortException=et;function ht(vt){(typeof vt!="object"||vt?.length===void 0)&&nt("Invalid argument for bytesToString");const st=vt.length,it=8192;if(st<it)return String.fromCharCode.apply(null,vt);const Mt=[];for(let zt=0;zt<st;zt+=it){const Ht=Math.min(zt+it,st),D=vt.subarray(zt,Ht);Mt.push(String.fromCharCode.apply(null,D))}return Mt.join("")}function ut(vt){typeof vt!="string"&&nt("Invalid argument for stringToBytes");const st=vt.length,it=new Uint8Array(st);for(let Mt=0;Mt<st;++Mt)it[Mt]=vt.charCodeAt(Mt)&255;return it}function pt(vt){return String.fromCharCode(vt>>24&255,vt>>16&255,vt>>8&255,vt&255)}function bt(vt){return Object.keys(vt).length}function At(vt){const st=Object.create(null);for(const[it,Mt]of vt)st[it]=Mt;return st}function Y(){const vt=new Uint8Array(4);return vt[0]=1,new Uint32Array(vt.buffer,0,1)[0]===1}function K(){try{return new Function(""),!0}catch{return!1}}class f{static get isLittleEndian(){return y(this,"isLittleEndian",Y())}static get isEvalSupported(){return y(this,"isEvalSupported",K())}static get isOffscreenCanvasSupported(){return y(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?y(this,"platform",{isWin:!1,isMac:!1}):y(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){return y(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}h.FeatureTest=f;const F=[...Array(256).keys()].map(vt=>vt.toString(16).padStart(2,"0"));class z{static makeHexColor(st,it,Mt){return`#${F[st]}${F[it]}${F[Mt]}`}static scaleMinMax(st,it){let Mt;st[0]?(st[0]<0&&(Mt=it[0],it[0]=it[1],it[1]=Mt),it[0]*=st[0],it[1]*=st[0],st[3]<0&&(Mt=it[2],it[2]=it[3],it[3]=Mt),it[2]*=st[3],it[3]*=st[3]):(Mt=it[0],it[0]=it[2],it[2]=Mt,Mt=it[1],it[1]=it[3],it[3]=Mt,st[1]<0&&(Mt=it[2],it[2]=it[3],it[3]=Mt),it[2]*=st[1],it[3]*=st[1],st[2]<0&&(Mt=it[0],it[0]=it[1],it[1]=Mt),it[0]*=st[2],it[1]*=st[2]),it[0]+=st[4],it[1]+=st[4],it[2]+=st[5],it[3]+=st[5]}static transform(st,it){return[st[0]*it[0]+st[2]*it[1],st[1]*it[0]+st[3]*it[1],st[0]*it[2]+st[2]*it[3],st[1]*it[2]+st[3]*it[3],st[0]*it[4]+st[2]*it[5]+st[4],st[1]*it[4]+st[3]*it[5]+st[5]]}static applyTransform(st,it){const Mt=st[0]*it[0]+st[1]*it[2]+it[4],zt=st[0]*it[1]+st[1]*it[3]+it[5];return[Mt,zt]}static applyInverseTransform(st,it){const Mt=it[0]*it[3]-it[1]*it[2],zt=(st[0]*it[3]-st[1]*it[2]+it[2]*it[5]-it[4]*it[3])/Mt,Ht=(-st[0]*it[1]+st[1]*it[0]+it[4]*it[1]-it[5]*it[0])/Mt;return[zt,Ht]}static getAxialAlignedBoundingBox(st,it){const Mt=this.applyTransform(st,it),zt=this.applyTransform(st.slice(2,4),it),Ht=this.applyTransform([st[0],st[3]],it),D=this.applyTransform([st[2],st[1]],it);return[Math.min(Mt[0],zt[0],Ht[0],D[0]),Math.min(Mt[1],zt[1],Ht[1],D[1]),Math.max(Mt[0],zt[0],Ht[0],D[0]),Math.max(Mt[1],zt[1],Ht[1],D[1])]}static inverseTransform(st){const it=st[0]*st[3]-st[1]*st[2];return[st[3]/it,-st[1]/it,-st[2]/it,st[0]/it,(st[2]*st[5]-st[4]*st[3])/it,(st[4]*st[1]-st[5]*st[0])/it]}static singularValueDecompose2dScale(st){const it=[st[0],st[2],st[1],st[3]],Mt=st[0]*it[0]+st[1]*it[2],zt=st[0]*it[1]+st[1]*it[3],Ht=st[2]*it[0]+st[3]*it[2],D=st[2]*it[1]+st[3]*it[3],gt=(Mt+D)/2,Tt=Math.sqrt((Mt+D)**2-4*(Mt*D-Ht*zt))/2,Dt=gt+Tt||1,Lt=gt-Tt||1;return[Math.sqrt(Dt),Math.sqrt(Lt)]}static normalizeRect(st){const it=st.slice(0);return st[0]>st[2]&&(it[0]=st[2],it[2]=st[0]),st[1]>st[3]&&(it[1]=st[3],it[3]=st[1]),it}static intersect(st,it){const Mt=Math.max(Math.min(st[0],st[2]),Math.min(it[0],it[2])),zt=Math.min(Math.max(st[0],st[2]),Math.max(it[0],it[2]));if(Mt>zt)return null;const Ht=Math.max(Math.min(st[1],st[3]),Math.min(it[1],it[3])),D=Math.min(Math.max(st[1],st[3]),Math.max(it[1],it[3]));return Ht>D?null:[Mt,Ht,zt,D]}static bezierBoundingBox(st,it,Mt,zt,Ht,D,gt,Tt){const Dt=[],Lt=[[],[]];let Ft,E,_,B,at,ot,ft,Et;for(let kt=0;kt<2;++kt){if(kt===0?(E=6*st-12*Mt+6*Ht,Ft=-3*st+9*Mt-9*Ht+3*gt,_=3*Mt-3*st):(E=6*it-12*zt+6*D,Ft=-3*it+9*zt-9*D+3*Tt,_=3*zt-3*it),Math.abs(Ft)<1e-12){if(Math.abs(E)<1e-12)continue;B=-_/E,0<B&&B<1&&Dt.push(B);continue}ft=E*E-4*_*Ft,Et=Math.sqrt(ft),!(ft<0)&&(at=(-E+Et)/(2*Ft),0<at&&at<1&&Dt.push(at),ot=(-E-Et)/(2*Ft),0<ot&&ot<1&&Dt.push(ot))}let Pt=Dt.length,Ot;const It=Pt;for(;Pt--;)B=Dt[Pt],Ot=1-B,Lt[0][Pt]=Ot*Ot*Ot*st+3*Ot*Ot*B*Mt+3*Ot*B*B*Ht+B*B*B*gt,Lt[1][Pt]=Ot*Ot*Ot*it+3*Ot*Ot*B*zt+3*Ot*B*B*D+B*B*B*Tt;return Lt[0][It]=st,Lt[1][It]=it,Lt[0][It+1]=gt,Lt[1][It+1]=Tt,Lt[0].length=Lt[1].length=It+2,[Math.min(...Lt[0]),Math.min(...Lt[1]),Math.max(...Lt[0]),Math.max(...Lt[1])]}}h.Util=z;const Q=[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 dt(vt){if(vt[0]>="ï"){let it;if(vt[0]==="þ"&&vt[1]==="ÿ"?it="utf-16be":vt[0]==="ÿ"&&vt[1]==="þ"?it="utf-16le":vt[0]==="ï"&&vt[1]==="»"&&vt[2]==="¿"&&(it="utf-8"),it)try{const Mt=new TextDecoder(it,{fatal:!0}),zt=ut(vt);return Mt.decode(zt)}catch(Mt){j(`stringToPDFString: "${Mt}".`)}}const st=[];for(let it=0,Mt=vt.length;it<Mt;it++){const zt=Q[vt.charCodeAt(it)];st.push(zt?String.fromCharCode(zt):vt.charAt(it))}return st.join("")}function _t(vt){return decodeURIComponent(escape(vt))}function yt(vt){return unescape(encodeURIComponent(vt))}function X(vt){return typeof vt=="object"&&vt?.byteLength!==void 0}function wt(vt,st){if(vt.length!==st.length)return!1;for(let it=0,Mt=vt.length;it<Mt;it++)if(vt[it]!==st[it])return!1;return!0}function Ct(vt=new Date){return[vt.getUTCFullYear().toString(),(vt.getUTCMonth()+1).toString().padStart(2,"0"),vt.getUTCDate().toString().padStart(2,"0"),vt.getUTCHours().toString().padStart(2,"0"),vt.getUTCMinutes().toString().padStart(2,"0"),vt.getUTCSeconds().toString().padStart(2,"0")].join("")}class jt{constructor(){Z(this,qt,!1);this.promise=new Promise((st,it)=>{this.resolve=Mt=>{tt(this,qt,!0),st(Mt)},this.reject=Mt=>{tt(this,qt,!0),it(Mt)}})}get settled(){return t(this,qt)}}qt=new WeakMap,h.PromiseCapability=jt;let Bt=null,Xt=null;function Rt(vt){return Bt||(Bt=/([\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,Xt=new Map([["ſt","ſt"]])),vt.replaceAll(Bt,(st,it,Mt)=>it?it.normalize("NFKC"):Xt.get(Mt))}function Ut(){if(typeof crypto<"u"&&typeof crypto?.randomUUID=="function")return crypto.randomUUID();const vt=new Uint8Array(32);if(typeof crypto<"u"&&typeof crypto?.getRandomValues=="function")crypto.getRandomValues(vt);else for(let st=0;st<32;st++)vt[st]=Math.floor(Math.random()*255);return ht(vt)}const Gt="pdfjs_internal_id_";h.AnnotationPrefix=Gt},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var St,lt,o,T,ie,be,mt,O,M,m,I,L,v,A,_e,u,c,xe,x,b;Object.defineProperty(exports,"__esModule",{value:!0}),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,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=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),_displayNode_utils=__w_pdfjs_require__(10),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument(i){if(typeof i=="string"||i instanceof URL?i={url:i}:(0,_util.isArrayBuffer)(i)&&(i={data:i}),typeof i!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!i.url&&!i.data&&!i.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const e=new PDFDocumentLoadingTask,{docId:g}=e,l=i.url?getUrlProp(i.url):null,W=i.data?getDataProp(i.data):null,a=i.httpHeaders||null,S=i.withCredentials===!0,N=i.password??null,rt=i.range instanceof PDFDataRangeTransport?i.range:null,V=Number.isInteger(i.rangeChunkSize)&&i.rangeChunkSize>0?i.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let J=i.worker instanceof PDFWorker?i.worker:null;const j=i.verbosity,nt=typeof i.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(i.docBaseUrl)?i.docBaseUrl:null,R=typeof i.cMapUrl=="string"?i.cMapUrl:null,G=i.cMapPacked!==!1,$=i.CMapReaderFactory||DefaultCMapReaderFactory,y=typeof i.standardFontDataUrl=="string"?i.standardFontDataUrl:null,s=i.StandardFontDataFactory||DefaultStandardFontDataFactory,n=i.stopAtErrors!==!0,d=Number.isInteger(i.maxImageSize)&&i.maxImageSize>-1?i.maxImageSize:-1,C=i.isEvalSupported!==!1,P=typeof i.isOffscreenCanvasSupported=="boolean"?i.isOffscreenCanvasSupported:!_util.isNodeJS,k=Number.isInteger(i.canvasMaxAreaInBytes)?i.canvasMaxAreaInBytes:-1,U=typeof i.disableFontFace=="boolean"?i.disableFontFace:_util.isNodeJS,et=i.fontExtraProperties===!0,ht=i.enableXfa===!0,ut=i.ownerDocument||globalThis.document,pt=i.disableRange===!0,bt=i.disableStream===!0,At=i.disableAutoFetch===!0,Y=i.pdfBug===!0,K=rt?rt.length:i.length??NaN,f=typeof i.useSystemFonts=="boolean"?i.useSystemFonts:!_util.isNodeJS&&!U,F=typeof i.useWorkerFetch=="boolean"?i.useWorkerFetch:$===_display_utils.DOMCMapReaderFactory&&s===_display_utils.DOMStandardFontDataFactory&&R&&y&&(0,_display_utils.isValidFetchUrl)(R,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(y,document.baseURI),z=i.canvasFactory||new DefaultCanvasFactory({ownerDocument:ut}),Q=i.filterFactory||new DefaultFilterFactory({docId:g,ownerDocument:ut}),dt=null;(0,_util.setVerbosityLevel)(j);const _t={canvasFactory:z,filterFactory:Q};if(F||(_t.cMapReaderFactory=new $({baseUrl:R,isCompressed:G}),_t.standardFontDataFactory=new s({baseUrl:y})),!J){const wt={verbosity:j,port:_worker_options.GlobalWorkerOptions.workerPort};J=wt.port?PDFWorker.fromPort(wt):new PDFWorker(wt),e._worker=J}const yt={docId:g,apiVersion:"3.11.174",data:W,password:N,disableAutoFetch:At,rangeChunkSize:V,length:K,docBaseUrl:nt,enableXfa:ht,evaluatorOptions:{maxImageSize:d,disableFontFace:U,ignoreErrors:n,isEvalSupported:C,isOffscreenCanvasSupported:P,canvasMaxAreaInBytes:k,fontExtraProperties:et,useSystemFonts:f,cMapUrl:F?R:null,standardFontDataUrl:F?y:null}},X={ignoreErrors:n,isEvalSupported:C,disableFontFace:U,fontExtraProperties:et,enableXfa:ht,ownerDocument:ut,disableAutoFetch:At,pdfBug:Y,styleElement:dt};return J.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");const wt=_fetchDocument(J,yt),Ct=new Promise(function(jt){let Bt;rt?Bt=new _transport_stream.PDFDataTransportStream({length:K,initialData:rt.initialData,progressiveDone:rt.progressiveDone,contentDispositionFilename:rt.contentDispositionFilename,disableRange:pt,disableStream:bt},rt):W||(Bt=(Rt=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(Rt):(0,_display_utils.isValidFetchUrl)(Rt.url)?new _displayFetch_stream.PDFFetchStream(Rt):new _displayNetwork.PDFNetworkStream(Rt))({url:l,length:K,httpHeaders:a,withCredentials:S,rangeChunkSize:V,disableRange:pt,disableStream:bt})),jt(Bt)});return Promise.all([wt,Ct]).then(function([jt,Bt]){if(e.destroyed)throw new Error("Loading aborted");const Xt=new _message_handler.MessageHandler(g,jt,J.port),Rt=new WorkerTransport(Xt,e,Bt,X,_t);e._transport=Rt,Xt.send("Ready",null)})}).catch(e._capability.reject),e}async function _fetchDocument(i,e){if(i.destroyed)throw new Error("Worker was destroyed");const g=await i.messageHandler.sendWithPromise("GetDocRequest",e,e.data?[e.data.buffer]:null);if(i.destroyed)throw new Error("Worker was destroyed");return g}function getUrlProp(i){if(i instanceof URL)return i.href;try{return new URL(i,window.location).href}catch{if(_util.isNodeJS&&typeof i=="string")return i}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(i){if(_util.isNodeJS&&typeof Buffer<"u"&&i instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength)return i;if(typeof i=="string")return(0,_util.stringToBytes)(i);if(typeof i=="object"&&!isNaN(i?.length)||(0,_util.isArrayBuffer)(i))return new Uint8Array(i);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const h=class h{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${ce(h,St)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};St=new WeakMap,Z(h,St,0);let PDFDocumentLoadingTask=h;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(e,g,l=!1,W=null){this.length=e,this.initialData=g,this.progressiveDone=l,this.contentDispositionFilename=W,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,g){for(const l of this._rangeListeners)l(e,g)}onDataProgress(e,g){this._readyCapability.promise.then(()=>{for(const l of this._progressListeners)l(e,g)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const g of this._progressiveReadListeners)g(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,g){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(e,g){this._pdfInfo=e,this._transport=g,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(l=>{if(!l)return l;const W=[];for(const a in l)W.push(...l[a]);return W}))})}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()}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,g,l,W=!1){Z(this,T);Z(this,lt,null);Z(this,o,!1);this._pageIndex=e,this._pageInfo=g,this._transport=l,this._stats=W?new _display_utils.StatTimer:null,this._pdfBug=W,this.commonObjs=l.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:g=this.rotate,offsetX:l=0,offsetY:W=0,dontFlip:a=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:e,rotation:g,offsetX:l,offsetY:W,dontFlip:a})}getAnnotations({intent:e="display"}={}){const g=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,g.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,viewport:g,intent:l="display",annotationMode:W=_util.AnnotationMode.ENABLE,transform:a=null,background:S=null,optionalContentConfigPromise:N=null,annotationCanvasMap:rt=null,pageColors:V=null,printAnnotationStorage:J=null}){this._stats?.time("Overall");const j=this._transport.getRenderingIntent(l,W,J);tt(this,o,!1),H(this,T,be).call(this),N||(N=this._transport.getOptionalContentConfig());let nt=this._intentStates.get(j.cacheKey);nt||(nt=Object.create(null),this._intentStates.set(j.cacheKey,nt)),nt.streamReaderCancelTimeout&&(clearTimeout(nt.streamReaderCancelTimeout),nt.streamReaderCancelTimeout=null);const R=!!(j.renderingIntent&_util.RenderingIntentFlag.PRINT);nt.displayReadyCapability||(nt.displayReadyCapability=new _util.PromiseCapability,nt.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(j));const G=s=>{nt.renderTasks.delete($),(this._maybeCleanupAfterRender||R)&&tt(this,o,!0),H(this,T,ie).call(this,!R),s?($.capability.reject(s),this._abortOperatorList({intentState:nt,reason:s instanceof Error?s:new Error(s)})):$.capability.resolve(),this._stats?.timeEnd("Rendering"),this._stats?.timeEnd("Overall")},$=new InternalRenderTask({callback:G,params:{canvasContext:e,viewport:g,transform:a,background:S},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:rt,operatorList:nt.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!R,pdfBug:this._pdfBug,pageColors:V});(nt.renderTasks||(nt.renderTasks=new Set)).add($);const y=$.task;return Promise.all([nt.displayReadyCapability.promise,N]).then(([s,n])=>{if(this.destroyed){G();return}this._stats?.time("Rendering"),$.initializeGraphics({transparency:s,optionalContentConfig:n}),$.operatorListChanged()}).catch(G),y}getOperatorList({intent:e="display",annotationMode:g=_util.AnnotationMode.ENABLE,printAnnotationStorage:l=null}={}){function W(){S.operatorList.lastChunk&&(S.opListReadCapability.resolve(S.operatorList),S.renderTasks.delete(N))}const a=this._transport.getRenderingIntent(e,g,l,!0);let S=this._intentStates.get(a.cacheKey);S||(S=Object.create(null),this._intentStates.set(a.cacheKey,S));let N;return S.opListReadCapability||(N=Object.create(null),N.operatorListChanged=W,S.opListReadCapability=new _util.PromiseCapability,(S.renderTasks||(S.renderTasks=new Set)).add(N),S.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(a)),S.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:g=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:g===!0},{highWaterMark:100,size(W){return W.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(l=>_xfa_text.XfaText.textContent(l));const g=this.streamTextContent(e);return new Promise(function(l,W){function a(){S.read().then(function({value:rt,done:V}){if(V){l(N);return}Object.assign(N.styles,rt.styles),N.items.push(...rt.items),a()},W)}const S=g.getReader(),N={items:[],styles:Object.create(null)};a()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const g of this._intentStates.values())if(this._abortOperatorList({intentState:g,reason:new Error("Page was destroyed."),force:!0}),!g.opListReadCapability)for(const l of g.renderTasks)e.push(l.completed),l.cancel();return this.objs.clear(),tt(this,o,!1),H(this,T,be).call(this),Promise.all(e)}cleanup(e=!1){tt(this,o,!0);const g=H(this,T,ie).call(this,!1);return e&&g&&this._stats&&(this._stats=new _display_utils.StatTimer),g}_startRenderPage(e,g){const l=this._intentStates.get(g);l&&(this._stats?.timeEnd("Page Request"),l.displayReadyCapability?.resolve(e))}_renderPageChunk(e,g){for(let l=0,W=e.length;l<W;l++)g.operatorList.fnArray.push(e.fnArray[l]),g.operatorList.argsArray.push(e.argsArray[l]);g.operatorList.lastChunk=e.lastChunk,g.operatorList.separateAnnots=e.separateAnnots;for(const l of g.renderTasks)l.operatorListChanged();e.lastChunk&&H(this,T,ie).call(this,!0)}_pumpOperatorList({renderingIntent:e,cacheKey:g,annotationStorageSerializable:l}){const{map:W,transfers:a}=l,N=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:g,annotationStorage:W},a).getReader(),rt=this._intentStates.get(g);rt.streamReader=N;const V=()=>{N.read().then(({value:J,done:j})=>{if(j){rt.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(J,rt),V())},J=>{if(rt.streamReader=null,!this._transport.destroyed){if(rt.operatorList){rt.operatorList.lastChunk=!0;for(const j of rt.renderTasks)j.operatorListChanged();H(this,T,ie).call(this,!0)}if(rt.displayReadyCapability)rt.displayReadyCapability.reject(J);else if(rt.opListReadCapability)rt.opListReadCapability.reject(J);else throw J}})};V()}_abortOperatorList({intentState:e,reason:g,force:l=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!l){if(e.renderTasks.size>0)return;if(g instanceof _display_utils.RenderingCancelledException){let W=RENDERING_CANCELLED_TIMEOUT;g.extraDelay>0&&g.extraDelay<1e3&&(W+=g.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:g,force:!0})},W);return}}if(e.streamReader.cancel(new _util.AbortException(g.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[W,a]of this._intentStates)if(a===e){this._intentStates.delete(W);break}this.cleanup()}}}get stats(){return this._stats}}lt=new WeakMap,o=new WeakMap,T=new WeakSet,ie=function(e=!1){if(H(this,T,be).call(this),!t(this,o)||this.destroyed)return!1;if(e)return tt(this,lt,setTimeout(()=>{tt(this,lt,null),H(this,T,ie).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:g,operatorList:l}of this._intentStates.values())if(g.size>0||!l.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),tt(this,o,!1),!0},be=function(){t(this,lt)&&(clearTimeout(t(this,lt)),tt(this,lt,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){Z(this,mt,new Set);Z(this,O,Promise.resolve())}postMessage(e,g){const l={data:structuredClone(e,g?{transfer:g}:null)};t(this,O).then(()=>{for(const W of t(this,mt))W.call(this,l)})}addEventListener(e,g){t(this,mt).add(g)}removeEventListener(e,g){t(this,mt).delete(g)}terminate(){t(this,mt).clear()}}mt=new WeakMap,O=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_util.isNodeJS&&typeof commonjsRequire=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const i=document?.currentScript?.src;i&&(PDFWorkerUtil.fallbackWorkerSrc=i.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(i,e){let g;try{if(g=new URL(i),!g.origin||g.origin==="null")return!1}catch{return!1}const l=new URL(e,g);return g.origin===l.origin},PDFWorkerUtil.createCDNWrapper=function(i){const e=`importScripts("${i}");`;return URL.createObjectURL(new Blob([e]))}}const _PDFWorker=class _PDFWorker{constructor({name:i=null,port:e=null,verbosity:g=(0,_util.getVerbosityLevel)()}={}){if(this.name=i,this.destroyed=!1,this.verbosity=g,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,e){if(t(_PDFWorker,M)?.has(e))throw new Error("Cannot use more than one PDFWorker per port.");(t(_PDFWorker,M)||tt(_PDFWorker,M,new WeakMap)).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(i){this._port=i,this._messageHandler=new _message_handler.MessageHandler("main","worker",i),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:i}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,i)||(i=PDFWorkerUtil.createCDNWrapper(new URL(i,window.location).href));const e=new Worker(i),g=new _message_handler.MessageHandler("main","worker",e),l=()=>{e.removeEventListener("error",W),g.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},W=()=>{this._webWorker||l()};e.addEventListener("error",W),g.on("test",S=>{if(e.removeEventListener("error",W),this.destroyed){l();return}S?(this._messageHandler=g,this._port=e,this._webWorker=e,this._readyCapability.resolve(),g.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),g.destroy(),e.terminate())}),g.on("ready",S=>{if(e.removeEventListener("error",W),this.destroyed){l();return}try{a()}catch{this._setupFakeWorker()}});const a=()=>{const S=new Uint8Array;g.send("test",S,[S.buffer])};a();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(i=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const e=new LoopbackPort;this._port=e;const g=`fake${PDFWorkerUtil.fakeWorkerId++}`,l=new _message_handler.MessageHandler(g+"_worker",g,e);i.setup(l,e);const W=new _message_handler.MessageHandler(g,g+"_worker",e);this._messageHandler=W,this._readyCapability.resolve(),W.send("configure",{verbosity:this.verbosity})}).catch(i=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${i.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),t(_PDFWorker,M)?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(i){if(!i?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const e=t(this,M)?.get(i.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new _PDFWorker(i)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.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())}};M=new WeakMap,Z(_PDFWorker,M);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(e,g,l,W,a){Z(this,A);Z(this,m,new Map);Z(this,I,new Map);Z(this,L,new Map);Z(this,v,null);this.messageHandler=e,this.loadingTask=g,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:W.ownerDocument,styleElement:W.styleElement}),this._params=W,this.canvasFactory=a.canvasFactory,this.filterFactory=a.filterFactory,this.cMapReaderFactory=a.cMapReaderFactory,this.standardFontDataFactory=a.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=l,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,g=_util.AnnotationMode.ENABLE,l=null,W=!1){let a=_util.RenderingIntentFlag.DISPLAY,S=_annotation_storage.SerializableEmpty;switch(e){case"any":a=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":a=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${e}`)}switch(g){case _util.AnnotationMode.DISABLE:a+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:a+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:a+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,S=(a&_util.RenderingIntentFlag.PRINT&&l instanceof _annotation_storage.PrintAnnotationStorage?l:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${g}`)}return W&&(a+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:a,cacheKey:`${a}_${S.hash}`,annotationStorageSerializable:S}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,t(this,v)?.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const l of t(this,I).values())e.push(l._destroy());t(this,I).clear(),t(this,L).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const g=this.messageHandler.sendWithPromise("Terminate",null);return e.push(g),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),t(this,m).clear(),this.filterFactory.destroy(),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:g}=this;e.on("GetReader",(l,W)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=a=>{this._lastProgress={loaded:a.loaded,total:a.total}},W.onPull=()=>{this._fullReader.read().then(function({value:a,done:S}){if(S){W.close();return}(0,_util.assert)(a instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),W.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{W.error(a)})},W.onCancel=a=>{this._fullReader.cancel(a),W.ready.catch(S=>{if(!this.destroyed)throw S})}}),e.on("ReaderHeadersReady",l=>{const W=new _util.PromiseCapability,a=this._fullReader;return a.headersReady.then(()=>{(!a.isStreamingSupported||!a.isRangeSupported)&&(this._lastProgress&&g.onProgress?.(this._lastProgress),a.onProgress=S=>{g.onProgress?.({loaded:S.loaded,total:S.total})}),W.resolve({isStreamingSupported:a.isStreamingSupported,isRangeSupported:a.isRangeSupported,contentLength:a.contentLength})},W.reject),W.promise}),e.on("GetRangeReader",(l,W)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const a=this._networkStream.getRangeReader(l.begin,l.end);if(!a){W.close();return}W.onPull=()=>{a.read().then(function({value:S,done:N}){if(N){W.close();return}(0,_util.assert)(S instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),W.enqueue(new Uint8Array(S),1,[S])}).catch(S=>{W.error(S)})},W.onCancel=S=>{a.cancel(S),W.ready.catch(N=>{if(!this.destroyed)throw N})}}),e.on("GetDoc",({pdfInfo:l})=>{this._numPages=l.numPages,this._htmlForXfa=l.htmlForXfa,delete l.htmlForXfa,g._capability.resolve(new PDFDocumentProxy(l,this))}),e.on("DocException",function(l){let W;switch(l.name){case"PasswordException":W=new _util.PasswordException(l.message,l.code);break;case"InvalidPDFException":W=new _util.InvalidPDFException(l.message);break;case"MissingPDFException":W=new _util.MissingPDFException(l.message);break;case"UnexpectedResponseException":W=new _util.UnexpectedResponseException(l.message,l.status);break;case"UnknownErrorException":W=new _util.UnknownErrorException(l.message,l.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}g._capability.reject(W)}),e.on("PasswordRequest",l=>{if(tt(this,v,new _util.PromiseCapability),g.onPassword){const W=a=>{a instanceof Error?t(this,v).reject(a):t(this,v).resolve({password:a})};try{g.onPassword(W,l.code)}catch(a){t(this,v).reject(a)}}else t(this,v).reject(new _util.PasswordException(l.message,l.code));return t(this,v).promise}),e.on("DataLoaded",l=>{g.onProgress?.({loaded:l.length,total:l.length}),this.downloadInfoCapability.resolve(l)}),e.on("StartRenderPage",l=>{if(this.destroyed)return;t(this,I).get(l.pageIndex)._startRenderPage(l.transparency,l.cacheKey)}),e.on("commonobj",([l,W,a])=>{if(!this.destroyed&&!this.commonObjs.has(l))switch(W){case"Font":const S=this._params;if("error"in a){const V=a.error;(0,_util.warn)(`Error during font loading: ${V}`),this.commonObjs.resolve(l,V);break}const N=S.pdfBug&&globalThis.FontInspector?.enabled?(V,J)=>globalThis.FontInspector.fontAdded(V,J):null,rt=new _font_loader.FontFaceObject(a,{isEvalSupported:S.isEvalSupported,disableFontFace:S.disableFontFace,ignoreErrors:S.ignoreErrors,inspectFont:N});this.fontLoader.bind(rt).catch(V=>e.sendWithPromise("FontFallback",{id:l})).finally(()=>{!S.fontExtraProperties&&rt.data&&(rt.data=null),this.commonObjs.resolve(l,rt)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(l,a);break;default:throw new Error(`Got unknown common object type ${W}`)}}),e.on("obj",([l,W,a,S])=>{if(this.destroyed)return;const N=t(this,I).get(W);if(!N.objs.has(l))switch(a){case"Image":if(N.objs.resolve(l,S),S){let rt;if(S.bitmap){const{width:V,height:J}=S;rt=V*J*4}else rt=S.data?.length||0;rt>_util.MAX_IMAGE_SIZE_TO_CACHE&&(N._maybeCleanupAfterRender=!0)}break;case"Pattern":N.objs.resolve(l,S);break;default:throw new Error(`Got unknown object type ${a}`)}}),e.on("DocProgress",l=>{this.destroyed||g.onProgress?.({loaded:l.loaded,total:l.total})}),e.on("FetchBuiltInCMap",l=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(l):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),e.on("FetchStandardFontData",l=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(l):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfers:g}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},g).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const g=e-1,l=t(this,L).get(g);if(l)return l;const W=this.messageHandler.sendWithPromise("GetPage",{pageIndex:g}).then(a=>{if(this.destroyed)throw new Error("Transport destroyed");const S=new PDFPageProxy(g,a,this,this._params.pdfBug);return t(this,I).set(g,S),S});return t(this,L).set(g,W),W}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,g){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:g})}getFieldObjects(){return H(this,A,_e).call(this,"GetFieldObjects")}hasJSActions(){return H(this,A,_e).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)}getDocJSActions(){return H(this,A,_e).call(this,"GetDocJSActions")}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",g=t(this,m).get(e);if(g)return g;const l=this.messageHandler.sendWithPromise(e,null).then(W=>({info:W[0],metadata:W[1]?new _metadata.Metadata(W[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return t(this,m).set(e,l),l}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const g of t(this,I).values())if(!g.cleanup())throw new Error(`startCleanup: Page ${g.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),t(this,m).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:e,enableXfa:g}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:e,enableXfa:g})}}m=new WeakMap,I=new WeakMap,L=new WeakMap,v=new WeakMap,A=new WeakSet,_e=function(e,g=null){const l=t(this,m).get(e);if(l)return l;const W=this.messageHandler.sendWithPromise(e,g);return t(this,m).set(e,W),W};class PDFObjects{constructor(){Z(this,c);Z(this,u,Object.create(null))}get(e,g=null){if(g){const W=H(this,c,xe).call(this,e);return W.capability.promise.then(()=>g(W.data)),null}const l=t(this,u)[e];if(!l?.capability.settled)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return l.data}has(e){return t(this,u)[e]?.capability.settled||!1}resolve(e,g=null){const l=H(this,c,xe).call(this,e);l.data=g,l.capability.resolve()}clear(){for(const e in t(this,u)){const{data:g}=t(this,u)[e];g?.bitmap?.close()}tt(this,u,Object.create(null))}}u=new WeakMap,c=new WeakSet,xe=function(e){var g;return(g=t(this,u))[e]||(g[e]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(e){Z(this,x,null);tt(this,x,e),this.onContinue=null}get promise(){return t(this,x).capability.promise}cancel(e=0){t(this,x).cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=t(this,x).operatorList;if(!e)return!1;const{annotationCanvasMap:g}=t(this,x);return e.form||e.canvas&&g?.size>0}}x=new WeakMap,exports.RenderTask=RenderTask;const r=class r{constructor({callback:e,params:g,objs:l,commonObjs:W,annotationCanvasMap:a,operatorList:S,pageIndex:N,canvasFactory:rt,filterFactory:V,useRequestAnimationFrame:J=!1,pdfBug:j=!1,pageColors:nt=null}){this.callback=e,this.params=g,this.objs=l,this.commonObjs=W,this.annotationCanvasMap=a,this.operatorListIdx=null,this.operatorList=S,this._pageIndex=N,this.canvasFactory=rt,this.filterFactory=V,this._pdfBug=j,this.pageColors=nt,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=J===!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=g.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:g}){if(this.cancelled)return;if(this._canvas){if(t(r,b).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.");t(r,b).add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:l,viewport:W,transform:a,background:S}=this.params;this.gfx=new _canvas.CanvasGraphics(l,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:g},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:a,viewport:W,transparency:e,background:S}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,g=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),t(r,b).delete(this._canvas),this.callback(e||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,g))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}this.stepper?.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(),t(r,b).delete(this._canvas),this.callback())))}};b=new WeakMap,Z(r,b,new WeakSet);let InternalRenderTask=r;const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(St,h,lt)=>{var M,m,I,gi,v;Object.defineProperty(h,"__esModule",{value:!0}),h.SerializableEmpty=h.PrintAnnotationStorage=h.AnnotationStorage=void 0;var o=lt(1),T=lt(4),ct=lt(8);const q=Object.freeze({map:null,hash:"",transfers:void 0});h.SerializableEmpty=q;class mt{constructor(){Z(this,I);Z(this,M,!1);Z(this,m,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(w,u){const c=t(this,m).get(w);return c===void 0?u:Object.assign(u,c)}getRawValue(w){return t(this,m).get(w)}remove(w){if(t(this,m).delete(w),t(this,m).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const u of t(this,m).values())if(u instanceof T.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(w,u){const c=t(this,m).get(w);let p=!1;if(c!==void 0)for(const[x,b]of Object.entries(u))c[x]!==b&&(p=!0,c[x]=b);else p=!0,t(this,m).set(w,u);p&&H(this,I,gi).call(this),u instanceof T.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(u.constructor._type)}has(w){return t(this,m).has(w)}getAll(){return t(this,m).size>0?(0,o.objectFromMap)(t(this,m)):null}setAll(w){for(const[u,c]of Object.entries(w))this.setValue(u,c)}get size(){return t(this,m).size}resetModified(){t(this,M)&&(tt(this,M,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new O(this)}get serializable(){if(t(this,m).size===0)return q;const w=new Map,u=new ct.MurmurHash3_64,c=[],p=Object.create(null);let x=!1;for(const[b,r]of t(this,m)){const i=r instanceof T.AnnotationEditor?r.serialize(!1,p):r;i&&(w.set(b,i),u.update(`${b}:${JSON.stringify(i)}`),x||(x=!!i.bitmap))}if(x)for(const b of w.values())b.bitmap&&c.push(b.bitmap);return w.size>0?{map:w,hash:u.hexdigest(),transfers:c}:q}}M=new WeakMap,m=new WeakMap,I=new WeakSet,gi=function(){t(this,M)||(tt(this,M,!0),typeof this.onSetModified=="function"&&this.onSetModified())},h.AnnotationStorage=mt;class O extends mt{constructor(u){super();Z(this,v);const{map:c,hash:p,transfers:x}=u.serializable,b=structuredClone(c,x?{transfer:x}:null);tt(this,v,{map:b,hash:p,transfers:x})}get print(){(0,o.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return t(this,v)}}v=new WeakMap,h.PrintAnnotationStorage=O},(St,h,lt)=>{var O,M,m,I,L,v,A,w,u,c,p,x,b,r,i,De,Ie,l,Le,Oe,mi,bi,_i,Ne,Ai;Object.defineProperty(h,"__esModule",{value:!0}),h.AnnotationEditor=void 0;var o=lt(5),T=lt(1),ct=lt(6);const j=class j{constructor(R){Z(this,i);Z(this,O,"");Z(this,M,!1);Z(this,m,null);Z(this,I,null);Z(this,L,null);Z(this,v,!1);Z(this,A,null);Z(this,w,this.focusin.bind(this));Z(this,u,this.focusout.bind(this));Z(this,c,!1);Z(this,p,!1);Z(this,x,!1);Yt(this,"_initialOptions",Object.create(null));Yt(this,"_uiManager",null);Yt(this,"_focusEventsAllowed",!0);Yt(this,"_l10nPromise",null);Z(this,b,!1);Z(this,r,j._zIndex++);this.constructor===j&&(0,T.unreachable)("Cannot initialize AnnotationEditor."),this.parent=R.parent,this.id=R.id,this.width=this.height=null,this.pageIndex=R.parent.pageIndex,this.name=R.name,this.div=null,this._uiManager=R.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=R.isCentered,this._structTreeParentId=null;const{rotation:G,rawDims:{pageWidth:$,pageHeight:y,pageX:s,pageY:n}}=this.parent.viewport;this.rotation=G,this.pageRotation=(360+G-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[$,y],this.pageTranslation=[s,n];const[d,C]=this.parentDimensions;this.x=R.x/d,this.y=R.y/C,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,T.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(R){const G=new mt({id:R.parent.getNextId(),parent:R.parent,uiManager:R._uiManager});G.annotationElementId=R.annotationElementId,G.deleted=!0,G._uiManager.addToAnnotationStorage(G)}static initialize(R,G=null){if(j._l10nPromise||(j._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(y=>[y,R.get(y)]))),G?.strings)for(const y of G.strings)j._l10nPromise.set(y,R.get(y));if(j._borderLineWidth!==-1)return;const $=getComputedStyle(document.documentElement);j._borderLineWidth=parseFloat($.getPropertyValue("--outline-width"))||0}static updateDefaultParams(R,G){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(R){return!1}static paste(R,G){(0,T.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return t(this,b)}set _isDraggable(R){tt(this,b,R),this.div?.classList.toggle("draggable",R)}center(){const[R,G]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*G/(R*2),this.y+=this.width*R/(G*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*G/(R*2),this.y-=this.width*R/(G*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(R){this._uiManager.addCommands(R)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=t(this,r)}setParent(R){R!==null&&(this.pageIndex=R.pageIndex,this.pageDimensions=R.pageDimensions),this.parent=R}focusin(R){this._focusEventsAllowed&&(t(this,c)?tt(this,c,!1):this.parent.setSelected(this))}focusout(R){!this._focusEventsAllowed||!this.isAttachedToDOM||R.relatedTarget?.closest(`#${this.id}`)||(R.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(R,G,$,y){const[s,n]=this.parentDimensions;[$,y]=this.screenToPageTranslation($,y),this.x=(R+$)/s,this.y=(G+y)/n,this.fixAndSetPosition()}translate(R,G){H(this,i,De).call(this,this.parentDimensions,R,G)}translateInPage(R,G){H(this,i,De).call(this,this.pageDimensions,R,G),this.div.scrollIntoView({block:"nearest"})}drag(R,G){const[$,y]=this.parentDimensions;if(this.x+=R/$,this.y+=G/y,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:P,y:k}=this.div.getBoundingClientRect();this.parent.findNewParent(this,P,k)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:n}=this;const[d,C]=H(this,i,Ie).call(this);s+=d,n+=C,this.div.style.left=`${(100*s).toFixed(2)}%`,this.div.style.top=`${(100*n).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[R,G]=this.pageDimensions;let{x:$,y,width:s,height:n}=this;switch(s*=R,n*=G,$*=R,y*=G,this.rotation){case 0:$=Math.max(0,Math.min(R-s,$)),y=Math.max(0,Math.min(G-n,y));break;case 90:$=Math.max(0,Math.min(R-n,$)),y=Math.min(G,Math.max(s,y));break;case 180:$=Math.min(R,Math.max(s,$)),y=Math.min(G,Math.max(n,y));break;case 270:$=Math.min(R,Math.max(n,$)),y=Math.max(0,Math.min(G-s,y));break}this.x=$/=R,this.y=y/=G;const[d,C]=H(this,i,Ie).call(this);$+=d,y+=C;const{style:P}=this.div;P.left=`${(100*$).toFixed(2)}%`,P.top=`${(100*y).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(R,G){var $;return H($=j,l,Le).call($,R,G,this.parentRotation)}pageTranslationToScreen(R,G){var $;return H($=j,l,Le).call($,R,G,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:R,pageDimensions:[G,$]}=this,y=G*R,s=$*R;return T.FeatureTest.isCSSRoundSupported?[Math.round(y),Math.round(s)]:[y,s]}setDims(R,G){const[$,y]=this.parentDimensions;this.div.style.width=`${(100*R/$).toFixed(2)}%`,t(this,v)||(this.div.style.height=`${(100*G/y).toFixed(2)}%`),t(this,m)?.classList.toggle("small",R<j.SMALL_EDITOR_SIZE||G<j.SMALL_EDITOR_SIZE)}fixDims(){const{style:R}=this.div,{height:G,width:$}=R,y=$.endsWith("%"),s=!t(this,v)&&G.endsWith("%");if(y&&s)return;const[n,d]=this.parentDimensions;y||(R.width=`${(100*parseFloat($)/n).toFixed(2)}%`),!t(this,v)&&!s&&(R.height=`${(100*parseFloat(G)/d).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}async addAltTextButton(){if(t(this,m))return;const R=tt(this,m,document.createElement("button"));R.className="altText";const G=await j._l10nPromise.get("editor_alt_text_button_label");R.textContent=G,R.setAttribute("aria-label",G),R.tabIndex="0",R.addEventListener("contextmenu",ct.noContextMenu),R.addEventListener("pointerdown",$=>$.stopPropagation()),R.addEventListener("click",$=>{$.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),R.addEventListener("keydown",$=>{$.target===R&&$.key==="Enter"&&($.preventDefault(),this._uiManager.editAltText(this))}),H(this,i,Ne).call(this),this.div.append(R),j.SMALL_EDITOR_SIZE||(j.SMALL_EDITOR_SIZE=Math.min(128,Math.round(R.getBoundingClientRect().width*1.4)))}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:t(this,O),decorative:t(this,M)}}set altTextData({altText:R,decorative:G}){t(this,O)===R&&t(this,M)===G||(tt(this,O,R),tt(this,M,G),H(this,i,Ne).call(this))}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",t(this,w)),this.div.addEventListener("focusout",t(this,u));const[R,G]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*G/R).toFixed(2)}%`,this.div.style.maxHeight=`${(100*R/G).toFixed(2)}%`);const[$,y]=this.getInitialTranslation();return this.translate($,y),(0,o.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(R){const{isMac:G}=T.FeatureTest.platform;if(R.button!==0||R.ctrlKey&&G){R.preventDefault();return}tt(this,c,!0),H(this,i,Ai).call(this,R)}moveInDOM(){this.parent?.moveEditorInDOM(this)}_setParentAndPosition(R,G,$){R.changeParent(this),this.x=G,this.y=$,this.fixAndSetPosition()}getRect(R,G){const $=this.parentScale,[y,s]=this.pageDimensions,[n,d]=this.pageTranslation,C=R/$,P=G/$,k=this.x*y,U=this.y*s,et=this.width*y,ht=this.height*s;switch(this.rotation){case 0:return[k+C+n,s-U-P-ht+d,k+C+et+n,s-U-P+d];case 90:return[k+P+n,s-U+C+d,k+P+ht+n,s-U+C+et+d];case 180:return[k-C-et+n,s-U+P+d,k-C+n,s-U+P+ht+d];case 270:return[k-P-ht+n,s-U-C-et+d,k-P+n,s-U-C+d];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(R,G){const[$,y,s,n]=R,d=s-$,C=n-y;switch(this.rotation){case 0:return[$,G-n,d,C];case 90:return[$,G-y,C,d];case 180:return[s,G-y,d,C];case 270:return[s,G-n,C,d];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){tt(this,x,!0)}disableEditMode(){tt(this,x,!1)}isInEditMode(){return t(this,x)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",t(this,w)),this.div?.addEventListener("focusout",t(this,u))}serialize(R=!1,G=null){(0,T.unreachable)("An editor must be serializable")}static deserialize(R,G,$){const y=new this.prototype.constructor({parent:G,id:G.getNextId(),uiManager:$});y.rotation=R.rotation;const[s,n]=y.pageDimensions,[d,C,P,k]=y.getRectInCurrentCoords(R.rect,n);return y.x=d/s,y.y=C/n,y.width=P/s,y.height=k/n,y}remove(){this.div.removeEventListener("focusin",t(this,w)),this.div.removeEventListener("focusout",t(this,u)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),t(this,m)?.remove(),tt(this,m,null),tt(this,I,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(H(this,i,mi).call(this),t(this,A).classList.remove("hidden"))}select(){this.makeResizable(),this.div?.classList.add("selectedEditor")}unselect(){t(this,A)?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(R,G){}disableEditing(){t(this,m)&&(t(this,m).hidden=!0)}enableEditing(){t(this,m)&&(t(this,m).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return t(this,p)}set isEditing(R){tt(this,p,R),this.parent&&(R?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(R,G){tt(this,v,!0);const $=R/G,{style:y}=this.div;y.aspectRatio=$,y.height="auto"}static get MIN_SIZE(){return 16}};O=new WeakMap,M=new WeakMap,m=new WeakMap,I=new WeakMap,L=new WeakMap,v=new WeakMap,A=new WeakMap,w=new WeakMap,u=new WeakMap,c=new WeakMap,p=new WeakMap,x=new WeakMap,b=new WeakMap,r=new WeakMap,i=new WeakSet,De=function([R,G],$,y){[$,y]=this.screenToPageTranslation($,y),this.x+=$/R,this.y+=y/G,this.fixAndSetPosition()},Ie=function(){const[R,G]=this.parentDimensions,{_borderLineWidth:$}=j,y=$/R,s=$/G;switch(this.rotation){case 90:return[-y,s];case 180:return[y,s];case 270:return[y,-s];default:return[-y,-s]}},l=new WeakSet,Le=function(R,G,$){switch($){case 90:return[G,-R];case 180:return[-R,-G];case 270:return[-G,R];default:return[R,G]}},Oe=function(R){switch(R){case 90:{const[G,$]=this.pageDimensions;return[0,-G/$,$/G,0]}case 180:return[-1,0,0,-1];case 270:{const[G,$]=this.pageDimensions;return[0,G/$,-$/G,0]}default:return[1,0,0,1]}},mi=function(){if(t(this,A))return;tt(this,A,document.createElement("div")),t(this,A).classList.add("resizers");const R=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||R.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const G of R){const $=document.createElement("div");t(this,A).append($),$.classList.add("resizer",G),$.addEventListener("pointerdown",H(this,i,bi).bind(this,G)),$.addEventListener("contextmenu",ct.noContextMenu)}this.div.prepend(t(this,A))},bi=function(R,G){G.preventDefault();const{isMac:$}=T.FeatureTest.platform;if(G.button!==0||G.ctrlKey&&$)return;const y=H(this,i,_i).bind(this,R),s=this._isDraggable;this._isDraggable=!1;const n={passive:!0,capture:!0};window.addEventListener("pointermove",y,n);const d=this.x,C=this.y,P=this.width,k=this.height,U=this.parent.div.style.cursor,et=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(G.target).cursor;const ht=()=>{this._isDraggable=s,window.removeEventListener("pointerup",ht),window.removeEventListener("blur",ht),window.removeEventListener("pointermove",y,n),this.parent.div.style.cursor=U,this.div.style.cursor=et;const ut=this.x,pt=this.y,bt=this.width,At=this.height;ut===d&&pt===C&&bt===P&&At===k||this.addCommands({cmd:()=>{this.width=bt,this.height=At,this.x=ut,this.y=pt;const[Y,K]=this.parentDimensions;this.setDims(Y*bt,K*At),this.fixAndSetPosition()},undo:()=>{this.width=P,this.height=k,this.x=d,this.y=C;const[Y,K]=this.parentDimensions;this.setDims(Y*P,K*k),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",ht),window.addEventListener("blur",ht)},_i=function(R,G){const[$,y]=this.parentDimensions,s=this.x,n=this.y,d=this.width,C=this.height,P=j.MIN_SIZE/$,k=j.MIN_SIZE/y,U=Rt=>Math.round(Rt*1e4)/1e4,et=H(this,i,Oe).call(this,this.rotation),ht=(Rt,Ut)=>[et[0]*Rt+et[2]*Ut,et[1]*Rt+et[3]*Ut],ut=H(this,i,Oe).call(this,360-this.rotation),pt=(Rt,Ut)=>[ut[0]*Rt+ut[2]*Ut,ut[1]*Rt+ut[3]*Ut];let bt,At,Y=!1,K=!1;switch(R){case"topLeft":Y=!0,bt=(Rt,Ut)=>[0,0],At=(Rt,Ut)=>[Rt,Ut];break;case"topMiddle":bt=(Rt,Ut)=>[Rt/2,0],At=(Rt,Ut)=>[Rt/2,Ut];break;case"topRight":Y=!0,bt=(Rt,Ut)=>[Rt,0],At=(Rt,Ut)=>[0,Ut];break;case"middleRight":K=!0,bt=(Rt,Ut)=>[Rt,Ut/2],At=(Rt,Ut)=>[0,Ut/2];break;case"bottomRight":Y=!0,bt=(Rt,Ut)=>[Rt,Ut],At=(Rt,Ut)=>[0,0];break;case"bottomMiddle":bt=(Rt,Ut)=>[Rt/2,Ut],At=(Rt,Ut)=>[Rt/2,0];break;case"bottomLeft":Y=!0,bt=(Rt,Ut)=>[0,Ut],At=(Rt,Ut)=>[Rt,0];break;case"middleLeft":K=!0,bt=(Rt,Ut)=>[0,Ut/2],At=(Rt,Ut)=>[Rt,Ut/2];break}const f=bt(d,C),F=At(d,C);let z=ht(...F);const Q=U(s+z[0]),dt=U(n+z[1]);let _t=1,yt=1,[X,wt]=this.screenToPageTranslation(G.movementX,G.movementY);if([X,wt]=pt(X/$,wt/y),Y){const Rt=Math.hypot(d,C);_t=yt=Math.max(Math.min(Math.hypot(F[0]-f[0]-X,F[1]-f[1]-wt)/Rt,1/d,1/C),P/d,k/C)}else K?_t=Math.max(P,Math.min(1,Math.abs(F[0]-f[0]-X)))/d:yt=Math.max(k,Math.min(1,Math.abs(F[1]-f[1]-wt)))/C;const Ct=U(d*_t),jt=U(C*yt);z=ht(...At(Ct,jt));const Bt=Q-z[0],Xt=dt-z[1];this.width=Ct,this.height=jt,this.x=Bt,this.y=Xt,this.setDims($*Ct,y*jt),this.fixAndSetPosition()},Ne=async function(){const R=t(this,m);if(!R)return;if(!t(this,O)&&!t(this,M)){R.classList.remove("done"),t(this,I)?.remove();return}j._l10nPromise.get("editor_alt_text_edit_button_label").then($=>{R.setAttribute("aria-label",$)});let G=t(this,I);if(!G){tt(this,I,G=document.createElement("span")),G.className="tooltip",G.setAttribute("role","tooltip");const $=G.id=`alt-text-tooltip-${this.id}`;R.setAttribute("aria-describedby",$);const y=100;R.addEventListener("mouseenter",()=>{tt(this,L,setTimeout(()=>{tt(this,L,null),t(this,I).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},y))}),R.addEventListener("mouseleave",()=>{clearTimeout(t(this,L)),tt(this,L,null),t(this,I)?.classList.remove("show")})}R.classList.add("done"),G.innerText=t(this,M)?await j._l10nPromise.get("editor_alt_text_decorative_tooltip"):t(this,O),G.parentNode||R.append(G)},Ai=function(R){if(!this._isDraggable)return;const G=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let $,y;G&&($={passive:!0,capture:!0},y=n=>{const[d,C]=this.screenToPageTranslation(n.movementX,n.movementY);this._uiManager.dragSelectedEditors(d,C)},window.addEventListener("pointermove",y,$));const s=()=>{if(window.removeEventListener("pointerup",s),window.removeEventListener("blur",s),G&&window.removeEventListener("pointermove",y,$),tt(this,c,!1),!this._uiManager.endDragSession()){const{isMac:n}=T.FeatureTest.platform;R.ctrlKey&&!n||R.shiftKey||R.metaKey&&n?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",s),window.addEventListener("blur",s)},Z(j,l),Yt(j,"_borderLineWidth",-1),Yt(j,"_colorManager",new o.ColorManager),Yt(j,"_zIndex",1),Yt(j,"SMALL_EDITOR_SIZE",0);let q=j;h.AnnotationEditor=q;class mt extends q{constructor(R){super(R),this.annotationElementId=R.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(St,h,lt)=>{var v,A,w,u,c,Be,b,r,i,e,g,yi,a,S,N,rt,V,J,j,nt,R,G,$,y,s,n,d,C,P,k,U,et,ht,ut,pt,bt,At,Y,K,f,F,z,Q,dt,_t,yt,X,vi,Ue,je,Ae,He,We,Qt,he,Si,Ei,Ge,de,ze;Object.defineProperty(h,"__esModule",{value:!0}),h.KeyboardManager=h.CommandManager=h.ColorManager=h.AnnotationEditorUIManager=void 0,h.bindEvents=ct,h.opacityToHex=q;var o=lt(1),T=lt(6);function ct(Ht,D,gt){for(const Tt of gt)D.addEventListener(Tt,Ht[Tt].bind(Ht))}function q(Ht){return Math.round(Math.min(255,Math.max(1,255*Ht))).toString(16).padStart(2,"0")}class mt{constructor(){Z(this,v,0)}getId(){return`${o.AnnotationEditorPrefix}${ce(this,v)._++}`}}v=new WeakMap;const x=class x{constructor(){Z(this,c);Z(this,A,(0,o.getUuid)());Z(this,w,0);Z(this,u,null)}static get _isSVGFittingCanvas(){const D='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',Tt=new OffscreenCanvas(1,3).getContext("2d"),Dt=new Image;Dt.src=D;const Lt=Dt.decode().then(()=>(Tt.drawImage(Dt,0,0,1,1,0,0,1,3),new Uint32Array(Tt.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,o.shadow)(this,"_isSVGFittingCanvas",Lt)}async getFromFile(D){const{lastModified:gt,name:Tt,size:Dt,type:Lt}=D;return H(this,c,Be).call(this,`${gt}_${Tt}_${Dt}_${Lt}`,D)}async getFromUrl(D){return H(this,c,Be).call(this,D,D)}async getFromId(D){t(this,u)||tt(this,u,new Map);const gt=t(this,u).get(D);return gt?gt.bitmap?(gt.refCounter+=1,gt):gt.file?this.getFromFile(gt.file):this.getFromUrl(gt.url):null}getSvgUrl(D){const gt=t(this,u).get(D);return gt?.isSvg?gt.svgUrl:null}deleteId(D){t(this,u)||tt(this,u,new Map);const gt=t(this,u).get(D);gt&&(gt.refCounter-=1,gt.refCounter===0&&(gt.bitmap=null))}isValidId(D){return D.startsWith(`image_${t(this,A)}_`)}};A=new WeakMap,w=new WeakMap,u=new WeakMap,c=new WeakSet,Be=async function(D,gt){t(this,u)||tt(this,u,new Map);let Tt=t(this,u).get(D);if(Tt===null)return null;if(Tt?.bitmap)return Tt.refCounter+=1,Tt;try{Tt||(Tt={bitmap:null,id:`image_${t(this,A)}_${ce(this,w)._++}`,refCounter:0,isSvg:!1});let Dt;if(typeof gt=="string"){Tt.url=gt;const Lt=await fetch(gt);if(!Lt.ok)throw new Error(Lt.statusText);Dt=await Lt.blob()}else Dt=Tt.file=gt;if(Dt.type==="image/svg+xml"){const Lt=x._isSVGFittingCanvas,Ft=new FileReader,E=new Image,_=new Promise((B,at)=>{E.onload=()=>{Tt.bitmap=E,Tt.isSvg=!0,B()},Ft.onload=async()=>{const ot=Tt.svgUrl=Ft.result;E.src=await Lt?`${ot}#svgView(preserveAspectRatio(none))`:ot},E.onerror=Ft.onerror=at});Ft.readAsDataURL(Dt),await _}else Tt.bitmap=await createImageBitmap(Dt);Tt.refCounter=1}catch(Dt){console.error(Dt),Tt=null}return t(this,u).set(D,Tt),Tt&&t(this,u).set(Tt.id,Tt),Tt};let O=x;class M{constructor(D=128){Z(this,b,[]);Z(this,r,!1);Z(this,i);Z(this,e,-1);tt(this,i,D)}add({cmd:D,undo:gt,mustExec:Tt,type:Dt=NaN,overwriteIfSameType:Lt=!1,keepUndo:Ft=!1}){if(Tt&&D(),t(this,r))return;const E={cmd:D,undo:gt,type:Dt};if(t(this,e)===-1){t(this,b).length>0&&(t(this,b).length=0),tt(this,e,0),t(this,b).push(E);return}if(Lt&&t(this,b)[t(this,e)].type===Dt){Ft&&(E.undo=t(this,b)[t(this,e)].undo),t(this,b)[t(this,e)]=E;return}const _=t(this,e)+1;_===t(this,i)?t(this,b).splice(0,1):(tt(this,e,_),_<t(this,b).length&&t(this,b).splice(_)),t(this,b).push(E)}undo(){t(this,e)!==-1&&(tt(this,r,!0),t(this,b)[t(this,e)].undo(),tt(this,r,!1),tt(this,e,t(this,e)-1))}redo(){t(this,e)<t(this,b).length-1&&(tt(this,e,t(this,e)+1),tt(this,r,!0),t(this,b)[t(this,e)].cmd(),tt(this,r,!1))}hasSomethingToUndo(){return t(this,e)!==-1}hasSomethingToRedo(){return t(this,e)<t(this,b).length-1}destroy(){tt(this,b,null)}}b=new WeakMap,r=new WeakMap,i=new WeakMap,e=new WeakMap,h.CommandManager=M;class m{constructor(D){Z(this,g);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:gt}=o.FeatureTest.platform;for(const[Tt,Dt,Lt={}]of D)for(const Ft of Tt){const E=Ft.startsWith("mac+");gt&&E?(this.callbacks.set(Ft.slice(4),{callback:Dt,options:Lt}),this.allKeys.add(Ft.split("+").at(-1))):!gt&&!E&&(this.callbacks.set(Ft,{callback:Dt,options:Lt}),this.allKeys.add(Ft.split("+").at(-1)))}}exec(D,gt){if(!this.allKeys.has(gt.key))return;const Tt=this.callbacks.get(H(this,g,yi).call(this,gt));if(!Tt)return;const{callback:Dt,options:{bubbles:Lt=!1,args:Ft=[],checker:E=null}}=Tt;E&&!E(D,gt)||(Dt.bind(D,...Ft)(),Lt||(gt.stopPropagation(),gt.preventDefault()))}}g=new WeakSet,yi=function(D){D.altKey&&this.buffer.push("alt"),D.ctrlKey&&this.buffer.push("ctrl"),D.metaKey&&this.buffer.push("meta"),D.shiftKey&&this.buffer.push("shift"),this.buffer.push(D.key);const gt=this.buffer.join("+");return this.buffer.length=0,gt},h.KeyboardManager=m;const W=class W{get _colors(){const D=new Map([["CanvasText",null],["Canvas",null]]);return(0,T.getColorValues)(D),(0,o.shadow)(this,"_colors",D)}convert(D){const gt=(0,T.getRGB)(D);if(!window.matchMedia("(forced-colors: active)").matches)return gt;for(const[Tt,Dt]of this._colors)if(Dt.every((Lt,Ft)=>Lt===gt[Ft]))return W._colorsMapping.get(Tt);return gt}getHexCode(D){const gt=this._colors.get(D);return gt?o.Util.makeHexColor(...gt):D}};Yt(W,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let I=W;h.ColorManager=I;const zt=class zt{constructor(D,gt,Tt,Dt,Lt,Ft){Z(this,X);Z(this,a,null);Z(this,S,new Map);Z(this,N,new Map);Z(this,rt,null);Z(this,V,null);Z(this,J,new M);Z(this,j,0);Z(this,nt,new Set);Z(this,R,null);Z(this,G,null);Z(this,$,new Set);Z(this,y,null);Z(this,s,new mt);Z(this,n,!1);Z(this,d,!1);Z(this,C,null);Z(this,P,o.AnnotationEditorType.NONE);Z(this,k,new Set);Z(this,U,null);Z(this,et,this.blur.bind(this));Z(this,ht,this.focus.bind(this));Z(this,ut,this.copy.bind(this));Z(this,pt,this.cut.bind(this));Z(this,bt,this.paste.bind(this));Z(this,At,this.keydown.bind(this));Z(this,Y,this.onEditingAction.bind(this));Z(this,K,this.onPageChanging.bind(this));Z(this,f,this.onScaleChanging.bind(this));Z(this,F,this.onRotationChanging.bind(this));Z(this,z,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});Z(this,Q,[0,0]);Z(this,dt,null);Z(this,_t,null);Z(this,yt,null);tt(this,_t,D),tt(this,yt,gt),tt(this,rt,Tt),this._eventBus=Dt,this._eventBus._on("editingaction",t(this,Y)),this._eventBus._on("pagechanging",t(this,K)),this._eventBus._on("scalechanging",t(this,f)),this._eventBus._on("rotationchanging",t(this,F)),tt(this,V,Lt.annotationStorage),tt(this,y,Lt.filterFactory),tt(this,U,Ft),this.viewParameters={realScale:T.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){const D=zt.prototype,gt=Lt=>{const{activeElement:Ft}=document;return Ft&&t(Lt,_t).contains(Ft)&&Lt.hasSomethingToControl()},Tt=this.TRANSLATE_SMALL,Dt=this.TRANSLATE_BIG;return(0,o.shadow)(this,"_keyboardManager",new m([[["ctrl+a","mac+meta+a"],D.selectAll],[["ctrl+z","mac+meta+z"],D.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],D.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],D.delete],[["Escape","mac+Escape"],D.unselectAll],[["ArrowLeft","mac+ArrowLeft"],D.translateSelectedEditors,{args:[-Tt,0],checker:gt}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],D.translateSelectedEditors,{args:[-Dt,0],checker:gt}],[["ArrowRight","mac+ArrowRight"],D.translateSelectedEditors,{args:[Tt,0],checker:gt}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],D.translateSelectedEditors,{args:[Dt,0],checker:gt}],[["ArrowUp","mac+ArrowUp"],D.translateSelectedEditors,{args:[0,-Tt],checker:gt}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],D.translateSelectedEditors,{args:[0,-Dt],checker:gt}],[["ArrowDown","mac+ArrowDown"],D.translateSelectedEditors,{args:[0,Tt],checker:gt}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],D.translateSelectedEditors,{args:[0,Dt],checker:gt}]]))}destroy(){H(this,X,Ae).call(this),H(this,X,Ue).call(this),this._eventBus._off("editingaction",t(this,Y)),this._eventBus._off("pagechanging",t(this,K)),this._eventBus._off("scalechanging",t(this,f)),this._eventBus._off("rotationchanging",t(this,F));for(const D of t(this,N).values())D.destroy();t(this,N).clear(),t(this,S).clear(),t(this,$).clear(),tt(this,a,null),t(this,k).clear(),t(this,J).destroy(),t(this,rt).destroy()}get hcmFilter(){return(0,o.shadow)(this,"hcmFilter",t(this,U)?t(this,y).addHCMFilter(t(this,U).foreground,t(this,U).background):"none")}get direction(){return(0,o.shadow)(this,"direction",getComputedStyle(t(this,_t)).direction)}editAltText(D){t(this,rt)?.editAltText(this,D)}onPageChanging({pageNumber:D}){tt(this,j,D-1)}focusMainContainer(){t(this,_t).focus()}findParent(D,gt){for(const Tt of t(this,N).values()){const{x:Dt,y:Lt,width:Ft,height:E}=Tt.div.getBoundingClientRect();if(D>=Dt&&D<=Dt+Ft&>>=Lt&><=Lt+E)return Tt}return null}disableUserSelect(D=!1){t(this,yt).classList.toggle("noUserSelect",D)}addShouldRescale(D){t(this,$).add(D)}removeShouldRescale(D){t(this,$).delete(D)}onScaleChanging({scale:D}){this.commitOrRemove(),this.viewParameters.realScale=D*T.PixelsPerInch.PDF_TO_CSS_UNITS;for(const gt of t(this,$))gt.onScaleChanging()}onRotationChanging({pagesRotation:D}){this.commitOrRemove(),this.viewParameters.rotation=D}addToAnnotationStorage(D){!D.isEmpty()&&t(this,V)&&!t(this,V).has(D.id)&&t(this,V).setValue(D.id,D)}blur(){if(!this.hasSelection)return;const{activeElement:D}=document;for(const gt of t(this,k))if(gt.div.contains(D)){tt(this,C,[gt,D]),gt._focusEventsAllowed=!1;break}}focus(){if(!t(this,C))return;const[D,gt]=t(this,C);tt(this,C,null),gt.addEventListener("focusin",()=>{D._focusEventsAllowed=!0},{once:!0}),gt.focus()}addEditListeners(){H(this,X,je).call(this),H(this,X,He).call(this)}removeEditListeners(){H(this,X,Ae).call(this),H(this,X,We).call(this)}copy(D){if(D.preventDefault(),t(this,a)?.commitOrRemove(),!this.hasSelection)return;const gt=[];for(const Tt of t(this,k)){const Dt=Tt.serialize(!0);Dt&>.push(Dt)}gt.length!==0&&D.clipboardData.setData("application/pdfjs",JSON.stringify(gt))}cut(D){this.copy(D),this.delete()}paste(D){D.preventDefault();const{clipboardData:gt}=D;for(const Lt of gt.items)for(const Ft of t(this,G))if(Ft.isHandlingMimeForPasting(Lt.type)){Ft.paste(Lt,this.currentLayer);return}let Tt=gt.getData("application/pdfjs");if(!Tt)return;try{Tt=JSON.parse(Tt)}catch(Lt){(0,o.warn)(`paste: "${Lt.message}".`);return}if(!Array.isArray(Tt))return;this.unselectAll();const Dt=this.currentLayer;try{const Lt=[];for(const _ of Tt){const B=Dt.deserialize(_);if(!B)return;Lt.push(B)}const Ft=()=>{for(const _ of Lt)H(this,X,Ge).call(this,_);H(this,X,ze).call(this,Lt)},E=()=>{for(const _ of Lt)_.remove()};this.addCommands({cmd:Ft,undo:E,mustExec:!0})}catch(Lt){(0,o.warn)(`paste: "${Lt.message}".`)}}keydown(D){this.getActive()?.shouldGetKeyboardEvents()||zt._keyboardManager.exec(this,D)}onEditingAction(D){["undo","redo","delete","selectAll"].includes(D.name)&&this[D.name]()}setEditingState(D){D?(H(this,X,vi).call(this),H(this,X,je).call(this),H(this,X,He).call(this),H(this,X,Qt).call(this,{isEditing:t(this,P)!==o.AnnotationEditorType.NONE,isEmpty:H(this,X,de).call(this),hasSomethingToUndo:t(this,J).hasSomethingToUndo(),hasSomethingToRedo:t(this,J).hasSomethingToRedo(),hasSelectedEditor:!1})):(H(this,X,Ue).call(this),H(this,X,Ae).call(this),H(this,X,We).call(this),H(this,X,Qt).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(D){if(!t(this,G)){tt(this,G,D);for(const gt of t(this,G))H(this,X,he).call(this,gt.defaultPropertiesToUpdate)}}getId(){return t(this,s).getId()}get currentLayer(){return t(this,N).get(t(this,j))}getLayer(D){return t(this,N).get(D)}get currentPageIndex(){return t(this,j)}addLayer(D){t(this,N).set(D.pageIndex,D),t(this,n)?D.enable():D.disable()}removeLayer(D){t(this,N).delete(D.pageIndex)}updateMode(D,gt=null){if(t(this,P)!==D){if(tt(this,P,D),D===o.AnnotationEditorType.NONE){this.setEditingState(!1),H(this,X,Ei).call(this);return}this.setEditingState(!0),H(this,X,Si).call(this),this.unselectAll();for(const Tt of t(this,N).values())Tt.updateMode(D);if(gt){for(const Tt of t(this,S).values())if(Tt.annotationElementId===gt){this.setSelected(Tt),Tt.enterInEditMode();break}}}}updateToolbar(D){D!==t(this,P)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:D})}updateParams(D,gt){if(t(this,G)){if(D===o.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(D);return}for(const Tt of t(this,k))Tt.updateParams(D,gt);for(const Tt of t(this,G))Tt.updateDefaultParams(D,gt)}}enableWaiting(D=!1){if(t(this,d)!==D){tt(this,d,D);for(const gt of t(this,N).values())D?gt.disableClick():gt.enableClick(),gt.div.classList.toggle("waiting",D)}}getEditors(D){const gt=[];for(const Tt of t(this,S).values())Tt.pageIndex===D&>.push(Tt);return gt}getEditor(D){return t(this,S).get(D)}addEditor(D){t(this,S).set(D.id,D)}removeEditor(D){t(this,S).delete(D.id),this.unselect(D),(!D.annotationElementId||!t(this,nt).has(D.annotationElementId))&&t(this,V)?.remove(D.id)}addDeletedAnnotationElement(D){t(this,nt).add(D.annotationElementId),D.deleted=!0}isDeletedAnnotationElement(D){return t(this,nt).has(D)}removeDeletedAnnotationElement(D){t(this,nt).delete(D.annotationElementId),D.deleted=!1}setActiveEditor(D){t(this,a)!==D&&(tt(this,a,D),D&&H(this,X,he).call(this,D.propertiesToUpdate))}toggleSelected(D){if(t(this,k).has(D)){t(this,k).delete(D),D.unselect(),H(this,X,Qt).call(this,{hasSelectedEditor:this.hasSelection});return}t(this,k).add(D),D.select(),H(this,X,he).call(this,D.propertiesToUpdate),H(this,X,Qt).call(this,{hasSelectedEditor:!0})}setSelected(D){for(const gt of t(this,k))gt!==D&>.unselect();t(this,k).clear(),t(this,k).add(D),D.select(),H(this,X,he).call(this,D.propertiesToUpdate),H(this,X,Qt).call(this,{hasSelectedEditor:!0})}isSelected(D){return t(this,k).has(D)}unselect(D){D.unselect(),t(this,k).delete(D),H(this,X,Qt).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return t(this,k).size!==0}undo(){t(this,J).undo(),H(this,X,Qt).call(this,{hasSomethingToUndo:t(this,J).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:H(this,X,de).call(this)})}redo(){t(this,J).redo(),H(this,X,Qt).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:t(this,J).hasSomethingToRedo(),isEmpty:H(this,X,de).call(this)})}addCommands(D){t(this,J).add(D),H(this,X,Qt).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:H(this,X,de).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const D=[...t(this,k)],gt=()=>{for(const Dt of D)Dt.remove()},Tt=()=>{for(const Dt of D)H(this,X,Ge).call(this,Dt)};this.addCommands({cmd:gt,undo:Tt,mustExec:!0})}commitOrRemove(){t(this,a)?.commitOrRemove()}hasSomethingToControl(){return t(this,a)||this.hasSelection}selectAll(){for(const D of t(this,k))D.commit();H(this,X,ze).call(this,t(this,S).values())}unselectAll(){if(t(this,a)){t(this,a).commitOrRemove();return}if(this.hasSelection){for(const D of t(this,k))D.unselect();t(this,k).clear(),H(this,X,Qt).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(D,gt,Tt=!1){if(Tt||this.commitOrRemove(),!this.hasSelection)return;t(this,Q)[0]+=D,t(this,Q)[1]+=gt;const[Dt,Lt]=t(this,Q),Ft=[...t(this,k)],E=1e3;t(this,dt)&&clearTimeout(t(this,dt)),tt(this,dt,setTimeout(()=>{tt(this,dt,null),t(this,Q)[0]=t(this,Q)[1]=0,this.addCommands({cmd:()=>{for(const _ of Ft)t(this,S).has(_.id)&&_.translateInPage(Dt,Lt)},undo:()=>{for(const _ of Ft)t(this,S).has(_.id)&&_.translateInPage(-Dt,-Lt)},mustExec:!1})},E));for(const _ of Ft)_.translateInPage(D,gt)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),tt(this,R,new Map);for(const D of t(this,k))t(this,R).set(D,{savedX:D.x,savedY:D.y,savedPageIndex:D.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!t(this,R))return!1;this.disableUserSelect(!1);const D=t(this,R);tt(this,R,null);let gt=!1;for(const[{x:Dt,y:Lt,pageIndex:Ft},E]of D)E.newX=Dt,E.newY=Lt,E.newPageIndex=Ft,gt||(gt=Dt!==E.savedX||Lt!==E.savedY||Ft!==E.savedPageIndex);if(!gt)return!1;const Tt=(Dt,Lt,Ft,E)=>{if(t(this,S).has(Dt.id)){const _=t(this,N).get(E);_?Dt._setParentAndPosition(_,Lt,Ft):(Dt.pageIndex=E,Dt.x=Lt,Dt.y=Ft)}};return this.addCommands({cmd:()=>{for(const[Dt,{newX:Lt,newY:Ft,newPageIndex:E}]of D)Tt(Dt,Lt,Ft,E)},undo:()=>{for(const[Dt,{savedX:Lt,savedY:Ft,savedPageIndex:E}]of D)Tt(Dt,Lt,Ft,E)},mustExec:!0}),!0}dragSelectedEditors(D,gt){if(t(this,R))for(const Tt of t(this,R).keys())Tt.drag(D,gt)}rebuild(D){if(D.parent===null){const gt=this.getLayer(D.pageIndex);gt?(gt.changeParent(D),gt.addOrRebuild(D)):(this.addEditor(D),this.addToAnnotationStorage(D),D.rebuild())}else D.parent.addOrRebuild(D)}isActive(D){return t(this,a)===D}getActive(){return t(this,a)}getMode(){return t(this,P)}get imageManager(){return(0,o.shadow)(this,"imageManager",new O)}};a=new WeakMap,S=new WeakMap,N=new WeakMap,rt=new WeakMap,V=new WeakMap,J=new WeakMap,j=new WeakMap,nt=new WeakMap,R=new WeakMap,G=new WeakMap,$=new WeakMap,y=new WeakMap,s=new WeakMap,n=new WeakMap,d=new WeakMap,C=new WeakMap,P=new WeakMap,k=new WeakMap,U=new WeakMap,et=new WeakMap,ht=new WeakMap,ut=new WeakMap,pt=new WeakMap,bt=new WeakMap,At=new WeakMap,Y=new WeakMap,K=new WeakMap,f=new WeakMap,F=new WeakMap,z=new WeakMap,Q=new WeakMap,dt=new WeakMap,_t=new WeakMap,yt=new WeakMap,X=new WeakSet,vi=function(){window.addEventListener("focus",t(this,ht)),window.addEventListener("blur",t(this,et))},Ue=function(){window.removeEventListener("focus",t(this,ht)),window.removeEventListener("blur",t(this,et))},je=function(){window.addEventListener("keydown",t(this,At),{capture:!0})},Ae=function(){window.removeEventListener("keydown",t(this,At),{capture:!0})},He=function(){document.addEventListener("copy",t(this,ut)),document.addEventListener("cut",t(this,pt)),document.addEventListener("paste",t(this,bt))},We=function(){document.removeEventListener("copy",t(this,ut)),document.removeEventListener("cut",t(this,pt)),document.removeEventListener("paste",t(this,bt))},Qt=function(D){Object.entries(D).some(([Tt,Dt])=>t(this,z)[Tt]!==Dt)&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(t(this,z),D)})},he=function(D){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:D})},Si=function(){if(!t(this,n)){tt(this,n,!0);for(const D of t(this,N).values())D.enable()}},Ei=function(){if(this.unselectAll(),t(this,n)){tt(this,n,!1);for(const D of t(this,N).values())D.disable()}},Ge=function(D){const gt=t(this,N).get(D.pageIndex);gt?gt.addOrRebuild(D):this.addEditor(D)},de=function(){if(t(this,S).size===0)return!0;if(t(this,S).size===1)for(const D of t(this,S).values())return D.isEmpty();return!1},ze=function(D){t(this,k).clear();for(const gt of D)gt.isEmpty()||(t(this,k).add(gt),gt.select());H(this,X,Qt).call(this,{hasSelectedEditor:!0})},Yt(zt,"TRANSLATE_SMALL",1),Yt(zt,"TRANSLATE_BIG",10);let L=zt;h.AnnotationEditorUIManager=L},(St,h,lt)=>{var j,nt,R,G,$,y,s,n,d,C,P,k,se,ne,Xe,ye,ve,ue,fe;Object.defineProperty(h,"__esModule",{value:!0}),h.StatTimer=h.RenderingCancelledException=h.PixelsPerInch=h.PageViewport=h.PDFDateString=h.DOMStandardFontDataFactory=h.DOMSVGFactory=h.DOMFilterFactory=h.DOMCanvasFactory=h.DOMCMapReaderFactory=void 0,h.deprecated=e,h.getColorValues=S,h.getCurrentTransform=N,h.getCurrentTransformInverse=rt,h.getFilenameFromUrl=c,h.getPdfFilenameFromUrl=p,h.getRGB=a,h.getXfaPageViewport=W,h.isDataScheme=w,h.isPdfFile=u,h.isValidFetchUrl=b,h.loadScript=i,h.noContextMenu=r,h.setLayerDimensions=V;var o=lt(7),T=lt(1);const ct="http://www.w3.org/2000/svg",J=class J{};Yt(J,"CSS",96),Yt(J,"PDF",72),Yt(J,"PDF_TO_CSS_UNITS",J.CSS/J.PDF);let q=J;h.PixelsPerInch=q;class mt extends o.BaseFilterFactory{constructor({docId:f,ownerDocument:F=globalThis.document}={}){super();Z(this,k);Z(this,j);Z(this,nt);Z(this,R);Z(this,G);Z(this,$);Z(this,y);Z(this,s);Z(this,n);Z(this,d);Z(this,C);Z(this,P,0);tt(this,R,f),tt(this,G,F)}addFilter(f){if(!f)return"none";let F=t(this,k,se).get(f);if(F)return F;let z,Q,dt,_t;if(f.length===1){const Ct=f[0],jt=new Array(256);for(let Bt=0;Bt<256;Bt++)jt[Bt]=Ct[Bt]/255;_t=z=Q=dt=jt.join(",")}else{const[Ct,jt,Bt]=f,Xt=new Array(256),Rt=new Array(256),Ut=new Array(256);for(let Gt=0;Gt<256;Gt++)Xt[Gt]=Ct[Gt]/255,Rt[Gt]=jt[Gt]/255,Ut[Gt]=Bt[Gt]/255;z=Xt.join(","),Q=Rt.join(","),dt=Ut.join(","),_t=`${z}${Q}${dt}`}if(F=t(this,k,se).get(_t),F)return t(this,k,se).set(f,F),F;const yt=`g_${t(this,R)}_transfer_map_${ce(this,P)._++}`,X=`url(#${yt})`;t(this,k,se).set(f,X),t(this,k,se).set(_t,X);const wt=H(this,k,ye).call(this,yt);return H(this,k,ue).call(this,z,Q,dt,wt),X}addHCMFilter(f,F){const z=`${f}-${F}`;if(t(this,y)===z)return t(this,s);if(tt(this,y,z),tt(this,s,"none"),t(this,$)?.remove(),!f||!F)return t(this,s);const Q=H(this,k,fe).call(this,f);f=T.Util.makeHexColor(...Q);const dt=H(this,k,fe).call(this,F);if(F=T.Util.makeHexColor(...dt),t(this,k,ne).style.color="",f==="#000000"&&F==="#ffffff"||f===F)return t(this,s);const _t=new Array(256);for(let jt=0;jt<=255;jt++){const Bt=jt/255;_t[jt]=Bt<=.03928?Bt/12.92:((Bt+.055)/1.055)**2.4}const yt=_t.join(","),X=`g_${t(this,R)}_hcm_filter`,wt=tt(this,n,H(this,k,ye).call(this,X));H(this,k,ue).call(this,yt,yt,yt,wt),H(this,k,Xe).call(this,wt);const Ct=(jt,Bt)=>{const Xt=Q[jt]/255,Rt=dt[jt]/255,Ut=new Array(Bt+1);for(let Gt=0;Gt<=Bt;Gt++)Ut[Gt]=Xt+Gt/Bt*(Rt-Xt);return Ut.join(",")};return H(this,k,ue).call(this,Ct(0,5),Ct(1,5),Ct(2,5),wt),tt(this,s,`url(#${X})`),t(this,s)}addHighlightHCMFilter(f,F,z,Q){const dt=`${f}-${F}-${z}-${Q}`;if(t(this,d)===dt)return t(this,C);if(tt(this,d,dt),tt(this,C,"none"),t(this,n)?.remove(),!f||!F)return t(this,C);const[_t,yt]=[f,F].map(H(this,k,fe).bind(this));let X=Math.round(.2126*_t[0]+.7152*_t[1]+.0722*_t[2]),wt=Math.round(.2126*yt[0]+.7152*yt[1]+.0722*yt[2]),[Ct,jt]=[z,Q].map(H(this,k,fe).bind(this));wt<X&&([X,wt,Ct,jt]=[wt,X,jt,Ct]),t(this,k,ne).style.color="";const Bt=(Ut,Gt,qt)=>{const vt=new Array(256),st=(wt-X)/qt,it=Ut/255,Mt=(Gt-Ut)/(255*qt);let zt=0;for(let Ht=0;Ht<=qt;Ht++){const D=Math.round(X+Ht*st),gt=it+Ht*Mt;for(let Tt=zt;Tt<=D;Tt++)vt[Tt]=gt;zt=D+1}for(let Ht=zt;Ht<256;Ht++)vt[Ht]=vt[zt-1];return vt.join(",")},Xt=`g_${t(this,R)}_hcm_highlight_filter`,Rt=tt(this,n,H(this,k,ye).call(this,Xt));return H(this,k,Xe).call(this,Rt),H(this,k,ue).call(this,Bt(Ct[0],jt[0],5),Bt(Ct[1],jt[1],5),Bt(Ct[2],jt[2],5),Rt),tt(this,C,`url(#${Xt})`),t(this,C)}destroy(f=!1){f&&(t(this,s)||t(this,C))||(t(this,nt)&&(t(this,nt).parentNode.parentNode.remove(),tt(this,nt,null)),t(this,j)&&(t(this,j).clear(),tt(this,j,null)),tt(this,P,0))}}j=new WeakMap,nt=new WeakMap,R=new WeakMap,G=new WeakMap,$=new WeakMap,y=new WeakMap,s=new WeakMap,n=new WeakMap,d=new WeakMap,C=new WeakMap,P=new WeakMap,k=new WeakSet,se=function(){return t(this,j)||tt(this,j,new Map)},ne=function(){if(!t(this,nt)){const f=t(this,G).createElement("div"),{style:F}=f;F.visibility="hidden",F.contain="strict",F.width=F.height=0,F.position="absolute",F.top=F.left=0,F.zIndex=-1;const z=t(this,G).createElementNS(ct,"svg");z.setAttribute("width",0),z.setAttribute("height",0),tt(this,nt,t(this,G).createElementNS(ct,"defs")),f.append(z),z.append(t(this,nt)),t(this,G).body.append(f)}return t(this,nt)},Xe=function(f){const F=t(this,G).createElementNS(ct,"feColorMatrix");F.setAttribute("type","matrix"),F.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"),f.append(F)},ye=function(f){const F=t(this,G).createElementNS(ct,"filter");return F.setAttribute("color-interpolation-filters","sRGB"),F.setAttribute("id",f),t(this,k,ne).append(F),F},ve=function(f,F,z){const Q=t(this,G).createElementNS(ct,F);Q.setAttribute("type","discrete"),Q.setAttribute("tableValues",z),f.append(Q)},ue=function(f,F,z,Q){const dt=t(this,G).createElementNS(ct,"feComponentTransfer");Q.append(dt),H(this,k,ve).call(this,dt,"feFuncR",f),H(this,k,ve).call(this,dt,"feFuncG",F),H(this,k,ve).call(this,dt,"feFuncB",z)},fe=function(f){return t(this,k,ne).style.color=f,a(getComputedStyle(t(this,k,ne)).getPropertyValue("color"))},h.DOMFilterFactory=mt;class O extends o.BaseCanvasFactory{constructor({ownerDocument:K=globalThis.document}={}){super(),this._document=K}_createCanvas(K,f){const F=this._document.createElement("canvas");return F.width=K,F.height=f,F}}h.DOMCanvasFactory=O;async function M(Y,K=!1){if(b(Y,document.baseURI)){const f=await fetch(Y);if(!f.ok)throw new Error(f.statusText);return K?new Uint8Array(await f.arrayBuffer()):(0,T.stringToBytes)(await f.text())}return new Promise((f,F)=>{const z=new XMLHttpRequest;z.open("GET",Y,!0),K&&(z.responseType="arraybuffer"),z.onreadystatechange=()=>{if(z.readyState===XMLHttpRequest.DONE){if(z.status===200||z.status===0){let Q;if(K&&z.response?Q=new Uint8Array(z.response):!K&&z.responseText&&(Q=(0,T.stringToBytes)(z.responseText)),Q){f(Q);return}}F(new Error(z.statusText))}},z.send(null)})}class m extends o.BaseCMapReaderFactory{_fetchData(K,f){return M(K,this.isCompressed).then(F=>({cMapData:F,compressionType:f}))}}h.DOMCMapReaderFactory=m;class I extends o.BaseStandardFontDataFactory{_fetchData(K){return M(K,!0)}}h.DOMStandardFontDataFactory=I;class L extends o.BaseSVGFactory{_createSVG(K){return document.createElementNS(ct,K)}}h.DOMSVGFactory=L;class v{constructor({viewBox:K,scale:f,rotation:F,offsetX:z=0,offsetY:Q=0,dontFlip:dt=!1}){this.viewBox=K,this.scale=f,this.rotation=F,this.offsetX=z,this.offsetY=Q;const _t=(K[2]+K[0])/2,yt=(K[3]+K[1])/2;let X,wt,Ct,jt;switch(F%=360,F<0&&(F+=360),F){case 180:X=-1,wt=0,Ct=0,jt=1;break;case 90:X=0,wt=1,Ct=1,jt=0;break;case 270:X=0,wt=-1,Ct=-1,jt=0;break;case 0:X=1,wt=0,Ct=0,jt=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}dt&&(Ct=-Ct,jt=-jt);let Bt,Xt,Rt,Ut;X===0?(Bt=Math.abs(yt-K[1])*f+z,Xt=Math.abs(_t-K[0])*f+Q,Rt=(K[3]-K[1])*f,Ut=(K[2]-K[0])*f):(Bt=Math.abs(_t-K[0])*f+z,Xt=Math.abs(yt-K[1])*f+Q,Rt=(K[2]-K[0])*f,Ut=(K[3]-K[1])*f),this.transform=[X*f,wt*f,Ct*f,jt*f,Bt-X*f*_t-Ct*f*yt,Xt-wt*f*_t-jt*f*yt],this.width=Rt,this.height=Ut}get rawDims(){const{viewBox:K}=this;return(0,T.shadow)(this,"rawDims",{pageWidth:K[2]-K[0],pageHeight:K[3]-K[1],pageX:K[0],pageY:K[1]})}clone({scale:K=this.scale,rotation:f=this.rotation,offsetX:F=this.offsetX,offsetY:z=this.offsetY,dontFlip:Q=!1}={}){return new v({viewBox:this.viewBox.slice(),scale:K,rotation:f,offsetX:F,offsetY:z,dontFlip:Q})}convertToViewportPoint(K,f){return T.Util.applyTransform([K,f],this.transform)}convertToViewportRectangle(K){const f=T.Util.applyTransform([K[0],K[1]],this.transform),F=T.Util.applyTransform([K[2],K[3]],this.transform);return[f[0],f[1],F[0],F[1]]}convertToPdfPoint(K,f){return T.Util.applyInverseTransform([K,f],this.transform)}}h.PageViewport=v;class A extends T.BaseException{constructor(K,f=0){super(K,"RenderingCancelledException"),this.extraDelay=f}}h.RenderingCancelledException=A;function w(Y){const K=Y.length;let f=0;for(;f<K&&Y[f].trim()==="";)f++;return Y.substring(f,f+5).toLowerCase()==="data:"}function u(Y){return typeof Y=="string"&&/\.pdf$/i.test(Y)}function c(Y,K=!1){return K||([Y]=Y.split(/[#?]/,1)),Y.substring(Y.lastIndexOf("/")+1)}function p(Y,K="document.pdf"){if(typeof Y!="string")return K;if(w(Y))return(0,T.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),K;const f=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,F=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,z=f.exec(Y);let Q=F.exec(z[1])||F.exec(z[2])||F.exec(z[3]);if(Q&&(Q=Q[0],Q.includes("%")))try{Q=F.exec(decodeURIComponent(Q))[0]}catch{}return Q||K}class x{constructor(){Yt(this,"started",Object.create(null));Yt(this,"times",[])}time(K){K in this.started&&(0,T.warn)(`Timer is already running for ${K}`),this.started[K]=Date.now()}timeEnd(K){K in this.started||(0,T.warn)(`Timer has not been started for ${K}`),this.times.push({name:K,start:this.started[K],end:Date.now()}),delete this.started[K]}toString(){const K=[];let f=0;for(const{name:F}of this.times)f=Math.max(F.length,f);for(const{name:F,start:z,end:Q}of this.times)K.push(`${F.padEnd(f)} ${Q-z}ms `);return K.join("")}}h.StatTimer=x;function b(Y,K){try{const{protocol:f}=K?new URL(Y,K):new URL(Y);return f==="http:"||f==="https:"}catch{return!1}}function r(Y){Y.preventDefault()}function i(Y,K=!1){return new Promise((f,F)=>{const z=document.createElement("script");z.src=Y,z.onload=function(Q){K&&z.remove(),f(Q)},z.onerror=function(){F(new Error(`Cannot load script at: ${z.src}`))},(document.head||document.documentElement).append(z)})}function e(Y){console.log("Deprecated API usage: "+Y)}let g;class l{static toDateObject(K){if(!K||typeof K!="string")return null;g||(g=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const f=g.exec(K);if(!f)return null;const F=parseInt(f[1],10);let z=parseInt(f[2],10);z=z>=1&&z<=12?z-1:0;let Q=parseInt(f[3],10);Q=Q>=1&&Q<=31?Q:1;let dt=parseInt(f[4],10);dt=dt>=0&&dt<=23?dt:0;let _t=parseInt(f[5],10);_t=_t>=0&&_t<=59?_t:0;let yt=parseInt(f[6],10);yt=yt>=0&&yt<=59?yt:0;const X=f[7]||"Z";let wt=parseInt(f[8],10);wt=wt>=0&&wt<=23?wt:0;let Ct=parseInt(f[9],10)||0;return Ct=Ct>=0&&Ct<=59?Ct:0,X==="-"?(dt+=wt,_t+=Ct):X==="+"&&(dt-=wt,_t-=Ct),new Date(Date.UTC(F,z,Q,dt,_t,yt))}}h.PDFDateString=l;function W(Y,{scale:K=1,rotation:f=0}){const{width:F,height:z}=Y.attributes.style,Q=[0,0,parseInt(F),parseInt(z)];return new v({viewBox:Q,scale:K,rotation:f})}function a(Y){if(Y.startsWith("#")){const K=parseInt(Y.slice(1),16);return[(K&16711680)>>16,(K&65280)>>8,K&255]}return Y.startsWith("rgb(")?Y.slice(4,-1).split(",").map(K=>parseInt(K)):Y.startsWith("rgba(")?Y.slice(5,-1).split(",").map(K=>parseInt(K)).slice(0,3):((0,T.warn)(`Not a valid color format: "${Y}"`),[0,0,0])}function S(Y){const K=document.createElement("span");K.style.visibility="hidden",document.body.append(K);for(const f of Y.keys()){K.style.color=f;const F=window.getComputedStyle(K).color;Y.set(f,a(F))}K.remove()}function N(Y){const{a:K,b:f,c:F,d:z,e:Q,f:dt}=Y.getTransform();return[K,f,F,z,Q,dt]}function rt(Y){const{a:K,b:f,c:F,d:z,e:Q,f:dt}=Y.getTransform().invertSelf();return[K,f,F,z,Q,dt]}function V(Y,K,f=!1,F=!0){if(K instanceof v){const{pageWidth:z,pageHeight:Q}=K.rawDims,{style:dt}=Y,_t=T.FeatureTest.isCSSRoundSupported,yt=`var(--scale-factor) * ${z}px`,X=`var(--scale-factor) * ${Q}px`,wt=_t?`round(${yt}, 1px)`:`calc(${yt})`,Ct=_t?`round(${X}, 1px)`:`calc(${X})`;!f||K.rotation%180===0?(dt.width=wt,dt.height=Ct):(dt.width=Ct,dt.height=wt)}F&&Y.setAttribute("data-main-rotation",K.rotation)}},(St,h,lt)=>{Object.defineProperty(h,"__esModule",{value:!0}),h.BaseStandardFontDataFactory=h.BaseSVGFactory=h.BaseFilterFactory=h.BaseCanvasFactory=h.BaseCMapReaderFactory=void 0;var o=lt(1);class T{constructor(){this.constructor===T&&(0,o.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(m){return"none"}addHCMFilter(m,I){return"none"}addHighlightHCMFilter(m,I,L,v){return"none"}destroy(m=!1){}}h.BaseFilterFactory=T;class ct{constructor(){this.constructor===ct&&(0,o.unreachable)("Cannot initialize BaseCanvasFactory.")}create(m,I){if(m<=0||I<=0)throw new Error("Invalid canvas size");const L=this._createCanvas(m,I);return{canvas:L,context:L.getContext("2d")}}reset(m,I,L){if(!m.canvas)throw new Error("Canvas is not specified");if(I<=0||L<=0)throw new Error("Invalid canvas size");m.canvas.width=I,m.canvas.height=L}destroy(m){if(!m.canvas)throw new Error("Canvas is not specified");m.canvas.width=0,m.canvas.height=0,m.canvas=null,m.context=null}_createCanvas(m,I){(0,o.unreachable)("Abstract method `_createCanvas` called.")}}h.BaseCanvasFactory=ct;class q{constructor({baseUrl:m=null,isCompressed:I=!0}){this.constructor===q&&(0,o.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=m,this.isCompressed=I}async fetch({name:m}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!m)throw new Error("CMap name must be specified.");const I=this.baseUrl+m+(this.isCompressed?".bcmap":""),L=this.isCompressed?o.CMapCompressionType.BINARY:o.CMapCompressionType.NONE;return this._fetchData(I,L).catch(v=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${I}`)})}_fetchData(m,I){(0,o.unreachable)("Abstract method `_fetchData` called.")}}h.BaseCMapReaderFactory=q;class mt{constructor({baseUrl:m=null}){this.constructor===mt&&(0,o.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=m}async fetch({filename:m}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!m)throw new Error("Font filename must be specified.");const I=`${this.baseUrl}${m}`;return this._fetchData(I).catch(L=>{throw new Error(`Unable to load font data at: ${I}`)})}_fetchData(m){(0,o.unreachable)("Abstract method `_fetchData` called.")}}h.BaseStandardFontDataFactory=mt;class O{constructor(){this.constructor===O&&(0,o.unreachable)("Cannot initialize BaseSVGFactory.")}create(m,I,L=!1){if(m<=0||I<=0)throw new Error("Invalid SVG dimensions");const v=this._createSVG("svg:svg");return v.setAttribute("version","1.1"),L||(v.setAttribute("width",`${m}px`),v.setAttribute("height",`${I}px`)),v.setAttribute("preserveAspectRatio","none"),v.setAttribute("viewBox",`0 0 ${m} ${I}`),v}createElement(m){if(typeof m!="string")throw new Error("Invalid SVG element type");return this._createSVG(m)}_createSVG(m){(0,o.unreachable)("Abstract method `_createSVG` called.")}}h.BaseSVGFactory=O},(St,h,lt)=>{Object.defineProperty(h,"__esModule",{value:!0}),h.MurmurHash3_64=void 0;var o=lt(1);const T=3285377520,ct=4294901760,q=65535;class mt{constructor(M){this.h1=M?M&4294967295:T,this.h2=M?M&4294967295:T}update(M){let m,I;if(typeof M=="string"){m=new Uint8Array(M.length*2),I=0;for(let e=0,g=M.length;e<g;e++){const l=M.charCodeAt(e);l<=255?m[I++]=l:(m[I++]=l>>>8,m[I++]=l&255)}}else if((0,o.isArrayBuffer)(M))m=M.slice(),I=m.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const L=I>>2,v=I-L*4,A=new Uint32Array(m.buffer,0,L);let w=0,u=0,c=this.h1,p=this.h2;const x=3432918353,b=461845907,r=x&q,i=b&q;for(let e=0;e<L;e++)e&1?(w=A[e],w=w*x&ct|w*r&q,w=w<<15|w>>>17,w=w*b&ct|w*i&q,c^=w,c=c<<13|c>>>19,c=c*5+3864292196):(u=A[e],u=u*x&ct|u*r&q,u=u<<15|u>>>17,u=u*b&ct|u*i&q,p^=u,p=p<<13|p>>>19,p=p*5+3864292196);switch(w=0,v){case 3:w^=m[L*4+2]<<16;case 2:w^=m[L*4+1]<<8;case 1:w^=m[L*4],w=w*x&ct|w*r&q,w=w<<15|w>>>17,w=w*b&ct|w*i&q,L&1?c^=w:p^=w}this.h1=c,this.h2=p}hexdigest(){let M=this.h1,m=this.h2;return M^=m>>>1,M=M*3981806797&ct|M*36045&q,m=m*4283543511&ct|((m<<16|M>>>16)*2950163797&ct)>>>16,M^=m>>>1,M=M*444984403&ct|M*60499&q,m=m*3301882366&ct|((m<<16|M>>>16)*3120437893&ct)>>>16,M^=m>>>1,(M>>>0).toString(16).padStart(8,"0")+(m>>>0).toString(16).padStart(8,"0")}}h.MurmurHash3_64=mt},(St,h,lt)=>{var q;Object.defineProperty(h,"__esModule",{value:!0}),h.FontLoader=h.FontFaceObject=void 0;var o=lt(1);class T{constructor({ownerDocument:O=globalThis.document,styleElement:M=null}){Z(this,q,new Set);this._document=O,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(O){this.nativeFontFaces.add(O),this._document.fonts.add(O)}removeNativeFontFace(O){this.nativeFontFaces.delete(O),this._document.fonts.delete(O)}insertRule(O){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const M=this.styleElement.sheet;M.insertRule(O,M.cssRules.length)}clear(){for(const O of this.nativeFontFaces)this._document.fonts.delete(O);this.nativeFontFaces.clear(),t(this,q).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(O){if(!(!O||t(this,q).has(O.loadedName))){if((0,o.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:M,src:m,style:I}=O,L=new FontFace(M,m,I);this.addNativeFontFace(L);try{await L.load(),t(this,q).add(M)}catch{(0,o.warn)(`Cannot load system font: ${O.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(L)}return}(0,o.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(O){if(O.attached||O.missingFile&&!O.systemFontInfo)return;if(O.attached=!0,O.systemFontInfo){await this.loadSystemFont(O.systemFontInfo);return}if(this.isFontLoadingAPISupported){const m=O.createNativeFontFace();if(m){this.addNativeFontFace(m);try{await m.loaded}catch(I){throw(0,o.warn)(`Failed to load font '${m.family}': '${I}'.`),O.disableFontFace=!0,I}}return}const M=O.createFontFaceRule();if(M){if(this.insertRule(M),this.isSyncFontLoadingSupported)return;await new Promise(m=>{const I=this._queueLoadingCallback(m);this._prepareFontLoadEvent(O,I)})}}get isFontLoadingAPISupported(){const O=!!this._document?.fonts;return(0,o.shadow)(this,"isFontLoadingAPISupported",O)}get isSyncFontLoadingSupported(){let O=!1;return(o.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(O=!0),(0,o.shadow)(this,"isSyncFontLoadingSupported",O)}_queueLoadingCallback(O){function M(){for((0,o.assert)(!I.done,"completeRequest() cannot be called twice."),I.done=!0;m.length>0&&m[0].done;){const L=m.shift();setTimeout(L.callback,0)}}const{loadingRequests:m}=this,I={done:!1,complete:M,callback:O};return m.push(I),I}get _loadTestFont(){const O=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,o.shadow)(this,"_loadTestFont",O)}_prepareFontLoadEvent(O,M){function m(a,S){return a.charCodeAt(S)<<24|a.charCodeAt(S+1)<<16|a.charCodeAt(S+2)<<8|a.charCodeAt(S+3)&255}function I(a,S,N,rt){const V=a.substring(0,S),J=a.substring(S+N);return V+rt+J}let L,v;const A=this._document.createElement("canvas");A.width=1,A.height=1;const w=A.getContext("2d");let u=0;function c(a,S){if(++u>30){(0,o.warn)("Load test font never loaded."),S();return}if(w.font="30px "+a,w.fillText(".",0,20),w.getImageData(0,0,1,1).data[3]>0){S();return}setTimeout(c.bind(null,a,S))}const p=`lt${Date.now()}${this.loadTestFontId++}`;let x=this._loadTestFont;x=I(x,976,p.length,p);const r=16,i=1482184792;let e=m(x,r);for(L=0,v=p.length-3;L<v;L+=4)e=e-i+m(p,L)|0;L<p.length&&(e=e-i+m(p+"XXX",L)|0),x=I(x,r,4,(0,o.string32)(e));const g=`url(data:font/opentype;base64,${btoa(x)});`,l=`@font-face {font-family:"${p}";src:${g}}`;this.insertRule(l);const W=this._document.createElement("div");W.style.visibility="hidden",W.style.width=W.style.height="10px",W.style.position="absolute",W.style.top=W.style.left="0px";for(const a of[O.loadedName,p]){const S=this._document.createElement("span");S.textContent="Hi",S.style.fontFamily=a,W.append(S)}this._document.body.append(W),c(p,()=>{W.remove(),M.complete()})}}q=new WeakMap,h.FontLoader=T;class ct{constructor(O,{isEvalSupported:M=!0,disableFontFace:m=!1,ignoreErrors:I=!1,inspectFont:L=null}){this.compiledGlyphs=Object.create(null);for(const v in O)this[v]=O[v];this.isEvalSupported=M!==!1,this.disableFontFace=m===!0,this.ignoreErrors=I===!0,this._inspectFont=L}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let O;if(!this.cssFontInfo)O=new FontFace(this.loadedName,this.data,{});else{const M={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(M.style=`oblique ${this.cssFontInfo.italicAngle}deg`),O=new FontFace(this.cssFontInfo.fontFamily,this.data,M)}return this._inspectFont?.(this),O}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const O=(0,o.bytesToString)(this.data),M=`url(data:${this.mimetype};base64,${btoa(O)});`;let m;if(!this.cssFontInfo)m=`@font-face {font-family:"${this.loadedName}";src:${M}}`;else{let I=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(I+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),m=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${I}src:${M}}`}return this._inspectFont?.(this,M),m}getPathGenerator(O,M){if(this.compiledGlyphs[M]!==void 0)return this.compiledGlyphs[M];let m;try{m=O.get(this.loadedName+"_path_"+M)}catch(I){if(!this.ignoreErrors)throw I;return(0,o.warn)(`getPathGenerator - ignoring character: "${I}".`),this.compiledGlyphs[M]=function(L,v){}}if(this.isEvalSupported&&o.FeatureTest.isEvalSupported){const I=[];for(const L of m){const v=L.args!==void 0?L.args.join(","):"";I.push("c.",L.cmd,"(",v,`); `)}return this.compiledGlyphs[M]=new Function("c","size",I.join(""))}return this.compiledGlyphs[M]=function(I,L){for(const v of m)v.cmd==="scale"&&(v.args=[L,-L]),I[v.cmd].apply(I,v.args)}}}h.FontFaceObject=ct},(St,h,lt)=>{Object.defineProperty(h,"__esModule",{value:!0}),h.NodeStandardFontDataFactory=h.NodeFilterFactory=h.NodeCanvasFactory=h.NodeCMapReaderFactory=void 0;var o=lt(7);lt(1);const T=function(M){return new Promise((m,I)=>{require$$5.readFile(M,(v,A)=>{if(v||!A){I(new Error(v));return}m(new Uint8Array(A))})})};class ct extends o.BaseFilterFactory{}h.NodeFilterFactory=ct;class q extends o.BaseCanvasFactory{_createCanvas(m,I){return require$$5.createCanvas(m,I)}}h.NodeCanvasFactory=q;class mt extends o.BaseCMapReaderFactory{_fetchData(m,I){return T(m).then(L=>({cMapData:L,compressionType:I}))}}h.NodeCMapReaderFactory=mt;class O extends o.BaseStandardFontDataFactory{_fetchData(m){return T(m)}}h.NodeStandardFontDataFactory=O},(St,h,lt)=>{var nt,qe,Ve;Object.defineProperty(h,"__esModule",{value:!0}),h.CanvasGraphics=void 0;var o=lt(1),T=lt(6),ct=lt(12),q=lt(13);const mt=16,O=100,M=4096,m=15,I=10,L=1e3,v=16;function A(y,s){if(y._removeMirroring)throw new Error("Context is already forwarding operations.");y.__originalSave=y.save,y.__originalRestore=y.restore,y.__originalRotate=y.rotate,y.__originalScale=y.scale,y.__originalTranslate=y.translate,y.__originalTransform=y.transform,y.__originalSetTransform=y.setTransform,y.__originalResetTransform=y.resetTransform,y.__originalClip=y.clip,y.__originalMoveTo=y.moveTo,y.__originalLineTo=y.lineTo,y.__originalBezierCurveTo=y.bezierCurveTo,y.__originalRect=y.rect,y.__originalClosePath=y.closePath,y.__originalBeginPath=y.beginPath,y._removeMirroring=()=>{y.save=y.__originalSave,y.restore=y.__originalRestore,y.rotate=y.__originalRotate,y.scale=y.__originalScale,y.translate=y.__originalTranslate,y.transform=y.__originalTransform,y.setTransform=y.__originalSetTransform,y.resetTransform=y.__originalResetTransform,y.clip=y.__originalClip,y.moveTo=y.__originalMoveTo,y.lineTo=y.__originalLineTo,y.bezierCurveTo=y.__originalBezierCurveTo,y.rect=y.__originalRect,y.closePath=y.__originalClosePath,y.beginPath=y.__originalBeginPath,delete y._removeMirroring},y.save=function(){s.save(),this.__originalSave()},y.restore=function(){s.restore(),this.__originalRestore()},y.translate=function(d,C){s.translate(d,C),this.__originalTranslate(d,C)},y.scale=function(d,C){s.scale(d,C),this.__originalScale(d,C)},y.transform=function(d,C,P,k,U,et){s.transform(d,C,P,k,U,et),this.__originalTransform(d,C,P,k,U,et)},y.setTransform=function(d,C,P,k,U,et){s.setTransform(d,C,P,k,U,et),this.__originalSetTransform(d,C,P,k,U,et)},y.resetTransform=function(){s.resetTransform(),this.__originalResetTransform()},y.rotate=function(d){s.rotate(d),this.__originalRotate(d)},y.clip=function(d){s.clip(d),this.__originalClip(d)},y.moveTo=function(n,d){s.moveTo(n,d),this.__originalMoveTo(n,d)},y.lineTo=function(n,d){s.lineTo(n,d),this.__originalLineTo(n,d)},y.bezierCurveTo=function(n,d,C,P,k,U){s.bezierCurveTo(n,d,C,P,k,U),this.__originalBezierCurveTo(n,d,C,P,k,U)},y.rect=function(n,d,C,P){s.rect(n,d,C,P),this.__originalRect(n,d,C,P)},y.closePath=function(){s.closePath(),this.__originalClosePath()},y.beginPath=function(){s.beginPath(),this.__originalBeginPath()}}class w{constructor(s){this.canvasFactory=s,this.cache=Object.create(null)}getCanvas(s,n,d){let C;return this.cache[s]!==void 0?(C=this.cache[s],this.canvasFactory.reset(C,n,d)):(C=this.canvasFactory.create(n,d),this.cache[s]=C),C}delete(s){delete this.cache[s]}clear(){for(const s in this.cache){const n=this.cache[s];this.canvasFactory.destroy(n),delete this.cache[s]}}}function u(y,s,n,d,C,P,k,U,et,ht){const[ut,pt,bt,At,Y,K]=(0,T.getCurrentTransform)(y);if(pt===0&&bt===0){const z=k*ut+Y,Q=Math.round(z),dt=U*At+K,_t=Math.round(dt),yt=(k+et)*ut+Y,X=Math.abs(Math.round(yt)-Q)||1,wt=(U+ht)*At+K,Ct=Math.abs(Math.round(wt)-_t)||1;return y.setTransform(Math.sign(ut),0,0,Math.sign(At),Q,_t),y.drawImage(s,n,d,C,P,0,0,X,Ct),y.setTransform(ut,pt,bt,At,Y,K),[X,Ct]}if(ut===0&&At===0){const z=U*bt+Y,Q=Math.round(z),dt=k*pt+K,_t=Math.round(dt),yt=(U+ht)*bt+Y,X=Math.abs(Math.round(yt)-Q)||1,wt=(k+et)*pt+K,Ct=Math.abs(Math.round(wt)-_t)||1;return y.setTransform(0,Math.sign(pt),Math.sign(bt),0,Q,_t),y.drawImage(s,n,d,C,P,0,0,Ct,X),y.setTransform(ut,pt,bt,At,Y,K),[Ct,X]}y.drawImage(s,n,d,C,P,k,U,et,ht);const f=Math.hypot(ut,pt),F=Math.hypot(bt,At);return[f*et,F*ht]}function c(y){const{width:s,height:n}=y;if(s>L||n>L)return null;const d=1e3,C=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),P=s+1;let k=new Uint8Array(P*(n+1)),U,et,ht;const ut=s+7&-8;let pt=new Uint8Array(ut*n),bt=0;for(const F of y.data){let z=128;for(;z>0;)pt[bt++]=F&z?0:255,z>>=1}let At=0;for(bt=0,pt[bt]!==0&&(k[0]=1,++At),et=1;et<s;et++)pt[bt]!==pt[bt+1]&&(k[et]=pt[bt]?2:1,++At),bt++;for(pt[bt]!==0&&(k[et]=2,++At),U=1;U<n;U++){bt=U*ut,ht=U*P,pt[bt-ut]!==pt[bt]&&(k[ht]=pt[bt]?1:8,++At);let F=(pt[bt]?4:0)+(pt[bt-ut]?8:0);for(et=1;et<s;et++)F=(F>>2)+(pt[bt+1]?4:0)+(pt[bt-ut+1]?8:0),C[F]&&(k[ht+et]=C[F],++At),bt++;if(pt[bt-ut]!==pt[bt]&&(k[ht+et]=pt[bt]?2:4,++At),At>d)return null}for(bt=ut*(n-1),ht=U*P,pt[bt]!==0&&(k[ht]=8,++At),et=1;et<s;et++)pt[bt]!==pt[bt+1]&&(k[ht+et]=pt[bt]?4:8,++At),bt++;if(pt[bt]!==0&&(k[ht+et]=4,++At),At>d)return null;const Y=new Int32Array([0,P,-1,0,-P,0,0,0,1]),K=new Path2D;for(U=0;At&&U<=n;U++){let F=U*P;const z=F+s;for(;F<z&&!k[F];)F++;if(F===z)continue;K.moveTo(F%P,U);const Q=F;let dt=k[F];do{const _t=Y[dt];do F+=_t;while(!k[F]);const yt=k[F];yt!==5&&yt!==10?(dt=yt,k[F]=0):(dt=yt&51*dt>>4,k[F]&=dt>>2|dt<<2),K.lineTo(F%P,F/P|0),k[F]||--At}while(Q!==F);--U}return pt=null,k=null,function(F){F.save(),F.scale(1/s,-1/n),F.translate(0,-n),F.fill(K),F.beginPath(),F.restore()}}class p{constructor(s,n){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=o.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=o.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=o.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,s,n])}clone(){const s=Object.create(this);return s.clipBox=this.clipBox.slice(),s}setCurrentPoint(s,n){this.x=s,this.y=n}updatePathMinMax(s,n,d){[n,d]=o.Util.applyTransform([n,d],s),this.minX=Math.min(this.minX,n),this.minY=Math.min(this.minY,d),this.maxX=Math.max(this.maxX,n),this.maxY=Math.max(this.maxY,d)}updateRectMinMax(s,n){const d=o.Util.applyTransform(n,s),C=o.Util.applyTransform(n.slice(2),s);this.minX=Math.min(this.minX,d[0],C[0]),this.minY=Math.min(this.minY,d[1],C[1]),this.maxX=Math.max(this.maxX,d[0],C[0]),this.maxY=Math.max(this.maxY,d[1],C[1])}updateScalingPathMinMax(s,n){o.Util.scaleMinMax(s,n),this.minX=Math.min(this.minX,n[0]),this.maxX=Math.max(this.maxX,n[1]),this.minY=Math.min(this.minY,n[2]),this.maxY=Math.max(this.maxY,n[3])}updateCurvePathMinMax(s,n,d,C,P,k,U,et,ht,ut){const pt=o.Util.bezierBoundingBox(n,d,C,P,k,U,et,ht);if(ut){ut[0]=Math.min(ut[0],pt[0],pt[2]),ut[1]=Math.max(ut[1],pt[0],pt[2]),ut[2]=Math.min(ut[2],pt[1],pt[3]),ut[3]=Math.max(ut[3],pt[1],pt[3]);return}this.updateRectMinMax(s,pt)}getPathBoundingBox(s=ct.PathType.FILL,n=null){const d=[this.minX,this.minY,this.maxX,this.maxY];if(s===ct.PathType.STROKE){n||(0,o.unreachable)("Stroke bounding box must include transform.");const C=o.Util.singularValueDecompose2dScale(n),P=C[0]*this.lineWidth/2,k=C[1]*this.lineWidth/2;d[0]-=P,d[1]-=k,d[2]+=P,d[3]+=k}return d}updateClipFromPath(){const s=o.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(s||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(s){this.clipBox=s,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(s=ct.PathType.FILL,n=null){return o.Util.intersect(this.clipBox,this.getPathBoundingBox(s,n))}}function x(y,s){if(typeof ImageData<"u"&&s instanceof ImageData){y.putImageData(s,0,0);return}const n=s.height,d=s.width,C=n%v,P=(n-C)/v,k=C===0?P:P+1,U=y.createImageData(d,v);let et=0,ht;const ut=s.data,pt=U.data;let bt,At,Y,K;if(s.kind===o.ImageKind.GRAYSCALE_1BPP){const f=ut.byteLength,F=new Uint32Array(pt.buffer,0,pt.byteLength>>2),z=F.length,Q=d+7>>3,dt=4294967295,_t=o.FeatureTest.isLittleEndian?4278190080:255;for(bt=0;bt<k;bt++){for(Y=bt<P?v:C,ht=0,At=0;At<Y;At++){const yt=f-et;let X=0;const wt=yt>Q?d:yt*8-7,Ct=wt&-8;let jt=0,Bt=0;for(;X<Ct;X+=8)Bt=ut[et++],F[ht++]=Bt&128?dt:_t,F[ht++]=Bt&64?dt:_t,F[ht++]=Bt&32?dt:_t,F[ht++]=Bt&16?dt:_t,F[ht++]=Bt&8?dt:_t,F[ht++]=Bt&4?dt:_t,F[ht++]=Bt&2?dt:_t,F[ht++]=Bt&1?dt:_t;for(;X<wt;X++)jt===0&&(Bt=ut[et++],jt=128),F[ht++]=Bt&jt?dt:_t,jt>>=1}for(;ht<z;)F[ht++]=0;y.putImageData(U,0,bt*v)}}else if(s.kind===o.ImageKind.RGBA_32BPP){for(At=0,K=d*v*4,bt=0;bt<P;bt++)pt.set(ut.subarray(et,et+K)),et+=K,y.putImageData(U,0,At),At+=v;bt<k&&(K=d*C*4,pt.set(ut.subarray(et,et+K)),y.putImageData(U,0,At))}else if(s.kind===o.ImageKind.RGB_24BPP)for(Y=v,K=d*Y,bt=0;bt<k;bt++){for(bt>=P&&(Y=C,K=d*Y),ht=0,At=K;At--;)pt[ht++]=ut[et++],pt[ht++]=ut[et++],pt[ht++]=ut[et++],pt[ht++]=255;y.putImageData(U,0,bt*v)}else throw new Error(`bad image kind: ${s.kind}`)}function b(y,s){if(s.bitmap){y.drawImage(s.bitmap,0,0);return}const n=s.height,d=s.width,C=n%v,P=(n-C)/v,k=C===0?P:P+1,U=y.createImageData(d,v);let et=0;const ht=s.data,ut=U.data;for(let pt=0;pt<k;pt++){const bt=pt<P?v:C;({srcPos:et}=(0,q.convertBlackAndWhiteToRGBA)({src:ht,srcPos:et,dest:ut,width:d,height:bt,nonBlackColor:0})),y.putImageData(U,0,pt*v)}}function r(y,s){const n=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const d of n)y[d]!==void 0&&(s[d]=y[d]);y.setLineDash!==void 0&&(s.setLineDash(y.getLineDash()),s.lineDashOffset=y.lineDashOffset)}function i(y){if(y.strokeStyle=y.fillStyle="#000000",y.fillRule="nonzero",y.globalAlpha=1,y.lineWidth=1,y.lineCap="butt",y.lineJoin="miter",y.miterLimit=10,y.globalCompositeOperation="source-over",y.font="10px sans-serif",y.setLineDash!==void 0&&(y.setLineDash([]),y.lineDashOffset=0),!o.isNodeJS){const{filter:s}=y;s!=="none"&&s!==""&&(y.filter="none")}}function e(y,s,n,d){const C=y.length;for(let P=3;P<C;P+=4){const k=y[P];if(k===0)y[P-3]=s,y[P-2]=n,y[P-1]=d;else if(k<255){const U=255-k;y[P-3]=y[P-3]*k+s*U>>8,y[P-2]=y[P-2]*k+n*U>>8,y[P-1]=y[P-1]*k+d*U>>8}}}function g(y,s,n){const d=y.length,C=1/255;for(let P=3;P<d;P+=4){const k=n?n[y[P]]:y[P];s[P]=s[P]*k*C|0}}function l(y,s,n){const d=y.length;for(let C=3;C<d;C+=4){const P=y[C-3]*77+y[C-2]*152+y[C-1]*28;s[C]=n?s[C]*n[P>>8]>>8:s[C]*P>>16}}function W(y,s,n,d,C,P,k,U,et,ht,ut){const pt=!!P,bt=pt?P[0]:0,At=pt?P[1]:0,Y=pt?P[2]:0,K=C==="Luminosity"?l:g,F=Math.min(d,Math.ceil(1048576/n));for(let z=0;z<d;z+=F){const Q=Math.min(F,d-z),dt=y.getImageData(U-ht,z+(et-ut),n,Q),_t=s.getImageData(U,z+et,n,Q);pt&&e(dt.data,bt,At,Y),K(dt.data,_t.data,k),s.putImageData(_t,U,z+et)}}function a(y,s,n,d){const C=d[0],P=d[1],k=d[2]-C,U=d[3]-P;k===0||U===0||(W(s.context,n,k,U,s.subtype,s.backdrop,s.transferMap,C,P,s.offsetX,s.offsetY),y.save(),y.globalAlpha=1,y.globalCompositeOperation="source-over",y.setTransform(1,0,0,1,0,0),y.drawImage(n.canvas,0,0),y.restore())}function S(y,s){const n=o.Util.singularValueDecompose2dScale(y);n[0]=Math.fround(n[0]),n[1]=Math.fround(n[1]);const d=Math.fround((globalThis.devicePixelRatio||1)*T.PixelsPerInch.PDF_TO_CSS_UNITS);return s!==void 0?s:n[0]<=d||n[1]<=d}const N=["butt","round","square"],rt=["miter","round","bevel"],V={},J={},$=class ${constructor(s,n,d,C,P,{optionalContentConfig:k,markedContentStack:U=null},et,ht){Z(this,nt);this.ctx=s,this.current=new p(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=n,this.objs=d,this.canvasFactory=C,this.filterFactory=P,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=U||[],this.optionalContentConfig=k,this.cachedCanvases=new w(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=et,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=ht,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(s,n=null){return typeof s=="string"?s.startsWith("g_")?this.commonObjs.get(s):this.objs.get(s):n}beginDrawing({transform:s,viewport:n,transparency:d=!1,background:C=null}){const P=this.ctx.canvas.width,k=this.ctx.canvas.height,U=this.ctx.fillStyle;if(this.ctx.fillStyle=C||"#ffffff",this.ctx.fillRect(0,0,P,k),this.ctx.fillStyle=U,d){const et=this.cachedCanvases.getCanvas("transparent",P,k);this.compositeCtx=this.ctx,this.transparentCanvas=et.canvas,this.ctx=et.context,this.ctx.save(),this.ctx.transform(...(0,T.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),i(this.ctx),s&&(this.ctx.transform(...s),this.outputScaleX=s[0],this.outputScaleY=s[0]),this.ctx.transform(...n.transform),this.viewportScale=n.scale,this.baseTransform=(0,T.getCurrentTransform)(this.ctx)}executeOperatorList(s,n,d,C){const P=s.argsArray,k=s.fnArray;let U=n||0;const et=P.length;if(et===U)return U;const ht=et-U>I&&typeof d=="function",ut=ht?Date.now()+m:0;let pt=0;const bt=this.commonObjs,At=this.objs;let Y;for(;;){if(C!==void 0&&U===C.nextBreakPoint)return C.breakIt(U,d),U;if(Y=k[U],Y!==o.OPS.dependency)this[Y].apply(this,P[U]);else for(const K of P[U]){const f=K.startsWith("g_")?bt:At;if(!f.has(K))return f.get(K,d),U}if(U++,U===et)return U;if(ht&&++pt>I){if(Date.now()>ut)return d(),U;pt=0}}}endDrawing(){H(this,nt,qe).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const s of this._cachedBitmapsMap.values()){for(const n of s.values())typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&(n.width=n.height=0);s.clear()}this._cachedBitmapsMap.clear(),H(this,nt,Ve).call(this)}_scaleImage(s,n){const d=s.width,C=s.height;let P=Math.max(Math.hypot(n[0],n[1]),1),k=Math.max(Math.hypot(n[2],n[3]),1),U=d,et=C,ht="prescale1",ut,pt;for(;P>2&&U>1||k>2&&et>1;){let bt=U,At=et;P>2&&U>1&&(bt=U>=16384?Math.floor(U/2)-1||1:Math.ceil(U/2),P/=U/bt),k>2&&et>1&&(At=et>=16384?Math.floor(et/2)-1||1:Math.ceil(et)/2,k/=et/At),ut=this.cachedCanvases.getCanvas(ht,bt,At),pt=ut.context,pt.clearRect(0,0,bt,At),pt.drawImage(s,0,0,U,et,0,0,bt,At),s=ut.canvas,U=bt,et=At,ht=ht==="prescale1"?"prescale2":"prescale1"}return{img:s,paintWidth:U,paintHeight:et}}_createMaskCanvas(s){const n=this.ctx,{width:d,height:C}=s,P=this.current.fillColor,k=this.current.patternFill,U=(0,T.getCurrentTransform)(n);let et,ht,ut,pt;if((s.bitmap||s.data)&&s.count>1){const X=s.bitmap||s.data.buffer;ht=JSON.stringify(k?U:[U.slice(0,4),P]),et=this._cachedBitmapsMap.get(X),et||(et=new Map,this._cachedBitmapsMap.set(X,et));const wt=et.get(ht);if(wt&&!k){const Ct=Math.round(Math.min(U[0],U[2])+U[4]),jt=Math.round(Math.min(U[1],U[3])+U[5]);return{canvas:wt,offsetX:Ct,offsetY:jt}}ut=wt}ut||(pt=this.cachedCanvases.getCanvas("maskCanvas",d,C),b(pt.context,s));let bt=o.Util.transform(U,[1/d,0,0,-1/C,0,0]);bt=o.Util.transform(bt,[1,0,0,1,0,-C]);const At=o.Util.applyTransform([0,0],bt),Y=o.Util.applyTransform([d,C],bt),K=o.Util.normalizeRect([At[0],At[1],Y[0],Y[1]]),f=Math.round(K[2]-K[0])||1,F=Math.round(K[3]-K[1])||1,z=this.cachedCanvases.getCanvas("fillCanvas",f,F),Q=z.context,dt=Math.min(At[0],Y[0]),_t=Math.min(At[1],Y[1]);Q.translate(-dt,-_t),Q.transform(...bt),ut||(ut=this._scaleImage(pt.canvas,(0,T.getCurrentTransformInverse)(Q)),ut=ut.img,et&&k&&et.set(ht,ut)),Q.imageSmoothingEnabled=S((0,T.getCurrentTransform)(Q),s.interpolate),u(Q,ut,0,0,ut.width,ut.height,0,0,d,C),Q.globalCompositeOperation="source-in";const yt=o.Util.transform((0,T.getCurrentTransformInverse)(Q),[1,0,0,1,-dt,-_t]);return Q.fillStyle=k?P.getPattern(n,this,yt,ct.PathType.FILL):P,Q.fillRect(0,0,d,C),et&&!k&&(this.cachedCanvases.delete("fillCanvas"),et.set(ht,z.canvas)),{canvas:z.canvas,offsetX:Math.round(dt),offsetY:Math.round(_t)}}setLineWidth(s){s!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=s,this.ctx.lineWidth=s}setLineCap(s){this.ctx.lineCap=N[s]}setLineJoin(s){this.ctx.lineJoin=rt[s]}setMiterLimit(s){this.ctx.miterLimit=s}setDash(s,n){const d=this.ctx;d.setLineDash!==void 0&&(d.setLineDash(s),d.lineDashOffset=n)}setRenderingIntent(s){}setFlatness(s){}setGState(s){for(const[n,d]of s)switch(n){case"LW":this.setLineWidth(d);break;case"LC":this.setLineCap(d);break;case"LJ":this.setLineJoin(d);break;case"ML":this.setMiterLimit(d);break;case"D":this.setDash(d[0],d[1]);break;case"RI":this.setRenderingIntent(d);break;case"FL":this.setFlatness(d);break;case"Font":this.setFont(d[0],d[1]);break;case"CA":this.current.strokeAlpha=d;break;case"ca":this.current.fillAlpha=d,this.ctx.globalAlpha=d;break;case"BM":this.ctx.globalCompositeOperation=d;break;case"SMask":this.current.activeSMask=d?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(d);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const s=this.inSMaskMode;this.current.activeSMask&&!s?this.beginSMaskMode():!this.current.activeSMask&&s&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const s=this.ctx.canvas.width,n=this.ctx.canvas.height,d="smaskGroupAt"+this.groupLevel,C=this.cachedCanvases.getCanvas(d,s,n);this.suspendedCtx=this.ctx,this.ctx=C.context;const P=this.ctx;P.setTransform(...(0,T.getCurrentTransform)(this.suspendedCtx)),r(this.suspendedCtx,P),A(P,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(s){if(!this.current.activeSMask)return;s?(s[0]=Math.floor(s[0]),s[1]=Math.floor(s[1]),s[2]=Math.ceil(s[2]),s[3]=Math.ceil(s[3])):s=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const n=this.current.activeSMask,d=this.suspendedCtx;a(d,n,this.ctx,s),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 s=this.current;this.stateStack.push(s),this.current=s.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(s,n,d,C,P,k){this.ctx.transform(s,n,d,C,P,k),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(s,n,d){const C=this.ctx,P=this.current;let k=P.x,U=P.y,et,ht;const ut=(0,T.getCurrentTransform)(C),pt=ut[0]===0&&ut[3]===0||ut[1]===0&&ut[2]===0,bt=pt?d.slice(0):null;for(let At=0,Y=0,K=s.length;At<K;At++)switch(s[At]|0){case o.OPS.rectangle:k=n[Y++],U=n[Y++];const f=n[Y++],F=n[Y++],z=k+f,Q=U+F;C.moveTo(k,U),f===0||F===0?C.lineTo(z,Q):(C.lineTo(z,U),C.lineTo(z,Q),C.lineTo(k,Q)),pt||P.updateRectMinMax(ut,[k,U,z,Q]),C.closePath();break;case o.OPS.moveTo:k=n[Y++],U=n[Y++],C.moveTo(k,U),pt||P.updatePathMinMax(ut,k,U);break;case o.OPS.lineTo:k=n[Y++],U=n[Y++],C.lineTo(k,U),pt||P.updatePathMinMax(ut,k,U);break;case o.OPS.curveTo:et=k,ht=U,k=n[Y+4],U=n[Y+5],C.bezierCurveTo(n[Y],n[Y+1],n[Y+2],n[Y+3],k,U),P.updateCurvePathMinMax(ut,et,ht,n[Y],n[Y+1],n[Y+2],n[Y+3],k,U,bt),Y+=6;break;case o.OPS.curveTo2:et=k,ht=U,C.bezierCurveTo(k,U,n[Y],n[Y+1],n[Y+2],n[Y+3]),P.updateCurvePathMinMax(ut,et,ht,k,U,n[Y],n[Y+1],n[Y+2],n[Y+3],bt),k=n[Y+2],U=n[Y+3],Y+=4;break;case o.OPS.curveTo3:et=k,ht=U,k=n[Y+2],U=n[Y+3],C.bezierCurveTo(n[Y],n[Y+1],k,U,k,U),P.updateCurvePathMinMax(ut,et,ht,n[Y],n[Y+1],k,U,k,U,bt),Y+=4;break;case o.OPS.closePath:C.closePath();break}pt&&P.updateScalingPathMinMax(ut,bt),P.setCurrentPoint(k,U)}closePath(){this.ctx.closePath()}stroke(s=!0){const n=this.ctx,d=this.current.strokeColor;n.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof d=="object"&&d?.getPattern?(n.save(),n.strokeStyle=d.getPattern(n,this,(0,T.getCurrentTransformInverse)(n),ct.PathType.STROKE),this.rescaleAndStroke(!1),n.restore()):this.rescaleAndStroke(!0)),s&&this.consumePath(this.current.getClippedPathBoundingBox()),n.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(s=!0){const n=this.ctx,d=this.current.fillColor,C=this.current.patternFill;let P=!1;C&&(n.save(),n.fillStyle=d.getPattern(n,this,(0,T.getCurrentTransformInverse)(n),ct.PathType.FILL),P=!0);const k=this.current.getClippedPathBoundingBox();this.contentVisible&&k!==null&&(this.pendingEOFill?(n.fill("evenodd"),this.pendingEOFill=!1):n.fill()),P&&n.restore(),s&&this.consumePath(k)}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=V}eoClip(){this.pendingClip=J}beginText(){this.current.textMatrix=o.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const s=this.pendingTextPaths,n=this.ctx;if(s===void 0){n.beginPath();return}n.save(),n.beginPath();for(const d of s)n.setTransform(...d.transform),n.translate(d.x,d.y),d.addToPath(n,d.fontSize);n.restore(),n.clip(),n.beginPath(),delete this.pendingTextPaths}setCharSpacing(s){this.current.charSpacing=s}setWordSpacing(s){this.current.wordSpacing=s}setHScale(s){this.current.textHScale=s/100}setLeading(s){this.current.leading=-s}setFont(s,n){const d=this.commonObjs.get(s),C=this.current;if(!d)throw new Error(`Can't find font for ${s}`);if(C.fontMatrix=d.fontMatrix||o.FONT_IDENTITY_MATRIX,(C.fontMatrix[0]===0||C.fontMatrix[3]===0)&&(0,o.warn)("Invalid font matrix for font "+s),n<0?(n=-n,C.fontDirection=-1):C.fontDirection=1,this.current.font=d,this.current.fontSize=n,d.isType3Font)return;const P=d.loadedName||"sans-serif",k=d.systemFontInfo?.css||`"${P}", ${d.fallbackName}`;let U="normal";d.black?U="900":d.bold&&(U="bold");const et=d.italic?"italic":"normal";let ht=n;n<mt?ht=mt:n>O&&(ht=O),this.current.fontSizeScale=n/ht,this.ctx.font=`${et} ${U} ${ht}px ${k}`}setTextRenderingMode(s){this.current.textRenderingMode=s}setTextRise(s){this.current.textRise=s}moveText(s,n){this.current.x=this.current.lineX+=s,this.current.y=this.current.lineY+=n}setLeadingMoveText(s,n){this.setLeading(-n),this.moveText(s,n)}setTextMatrix(s,n,d,C,P,k){this.current.textMatrix=[s,n,d,C,P,k],this.current.textMatrixScale=Math.hypot(s,n),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(s,n,d,C){const P=this.ctx,k=this.current,U=k.font,et=k.textRenderingMode,ht=k.fontSize/k.fontSizeScale,ut=et&o.TextRenderingMode.FILL_STROKE_MASK,pt=!!(et&o.TextRenderingMode.ADD_TO_PATH_FLAG),bt=k.patternFill&&!U.missingFile;let At;(U.disableFontFace||pt||bt)&&(At=U.getPathGenerator(this.commonObjs,s)),U.disableFontFace||bt?(P.save(),P.translate(n,d),P.beginPath(),At(P,ht),C&&P.setTransform(...C),(ut===o.TextRenderingMode.FILL||ut===o.TextRenderingMode.FILL_STROKE)&&P.fill(),(ut===o.TextRenderingMode.STROKE||ut===o.TextRenderingMode.FILL_STROKE)&&P.stroke(),P.restore()):((ut===o.TextRenderingMode.FILL||ut===o.TextRenderingMode.FILL_STROKE)&&P.fillText(s,n,d),(ut===o.TextRenderingMode.STROKE||ut===o.TextRenderingMode.FILL_STROKE)&&P.strokeText(s,n,d)),pt&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,T.getCurrentTransform)(P),x:n,y:d,fontSize:ht,addToPath:At})}get isFontSubpixelAAEnabled(){const{context:s}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);s.scale(1.5,1),s.fillText("I",0,10);const n=s.getImageData(0,0,10,10).data;let d=!1;for(let C=3;C<n.length;C+=4)if(n[C]>0&&n[C]<255){d=!0;break}return(0,o.shadow)(this,"isFontSubpixelAAEnabled",d)}showText(s){const n=this.current,d=n.font;if(d.isType3Font)return this.showType3Text(s);const C=n.fontSize;if(C===0)return;const P=this.ctx,k=n.fontSizeScale,U=n.charSpacing,et=n.wordSpacing,ht=n.fontDirection,ut=n.textHScale*ht,pt=s.length,bt=d.vertical,At=bt?1:-1,Y=d.defaultVMetrics,K=C*n.fontMatrix[0],f=n.textRenderingMode===o.TextRenderingMode.FILL&&!d.disableFontFace&&!n.patternFill;P.save(),P.transform(...n.textMatrix),P.translate(n.x,n.y+n.textRise),ht>0?P.scale(ut,-1):P.scale(ut,1);let F;if(n.patternFill){P.save();const yt=n.fillColor.getPattern(P,this,(0,T.getCurrentTransformInverse)(P),ct.PathType.FILL);F=(0,T.getCurrentTransform)(P),P.restore(),P.fillStyle=yt}let z=n.lineWidth;const Q=n.textMatrixScale;if(Q===0||z===0){const yt=n.textRenderingMode&o.TextRenderingMode.FILL_STROKE_MASK;(yt===o.TextRenderingMode.STROKE||yt===o.TextRenderingMode.FILL_STROKE)&&(z=this.getSinglePixelWidth())}else z/=Q;if(k!==1&&(P.scale(k,k),z/=k),P.lineWidth=z,d.isInvalidPDFjsFont){const yt=[];let X=0;for(const wt of s)yt.push(wt.unicode),X+=wt.width;P.fillText(yt.join(""),0,0),n.x+=X*K*ut,P.restore(),this.compose();return}let dt=0,_t;for(_t=0;_t<pt;++_t){const yt=s[_t];if(typeof yt=="number"){dt+=At*yt*C/1e3;continue}let X=!1;const wt=(yt.isSpace?et:0)+U,Ct=yt.fontChar,jt=yt.accent;let Bt,Xt,Rt=yt.width;if(bt){const Gt=yt.vmetric||Y,qt=-(yt.vmetric?Gt[1]:Rt*.5)*K,vt=Gt[2]*K;Rt=Gt?-Gt[0]:Rt,Bt=qt/k,Xt=(dt+vt)/k}else Bt=dt/k,Xt=0;if(d.remeasure&&Rt>0){const Gt=P.measureText(Ct).width*1e3/C*k;if(Rt<Gt&&this.isFontSubpixelAAEnabled){const qt=Rt/Gt;X=!0,P.save(),P.scale(qt,1),Bt/=qt}else Rt!==Gt&&(Bt+=(Rt-Gt)/2e3*C/k)}if(this.contentVisible&&(yt.isInFont||d.missingFile)){if(f&&!jt)P.fillText(Ct,Bt,Xt);else if(this.paintChar(Ct,Bt,Xt,F),jt){const Gt=Bt+C*jt.offset.x/k,qt=Xt-C*jt.offset.y/k;this.paintChar(jt.fontChar,Gt,qt,F)}}const Ut=bt?Rt*K-wt*ht:Rt*K+wt*ht;dt+=Ut,X&&P.restore()}bt?n.y-=dt:n.x+=dt*ut,P.restore(),this.compose()}showType3Text(s){const n=this.ctx,d=this.current,C=d.font,P=d.fontSize,k=d.fontDirection,U=C.vertical?1:-1,et=d.charSpacing,ht=d.wordSpacing,ut=d.textHScale*k,pt=d.fontMatrix||o.FONT_IDENTITY_MATRIX,bt=s.length,At=d.textRenderingMode===o.TextRenderingMode.INVISIBLE;let Y,K,f,F;if(!(At||P===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,n.save(),n.transform(...d.textMatrix),n.translate(d.x,d.y),n.scale(ut,k),Y=0;Y<bt;++Y){if(K=s[Y],typeof K=="number"){F=U*K*P/1e3,this.ctx.translate(F,0),d.x+=F*ut;continue}const z=(K.isSpace?ht:0)+et,Q=C.charProcOperatorList[K.operatorListId];if(!Q){(0,o.warn)(`Type3 character "${K.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=K,this.save(),n.scale(P,P),n.transform(...pt),this.executeOperatorList(Q),this.restore()),f=o.Util.applyTransform([K.width,0],pt)[0]*P+z,n.translate(f,0),d.x+=f*ut}n.restore(),this.processingType3=null}}setCharWidth(s,n){}setCharWidthAndBounds(s,n,d,C,P,k){this.ctx.rect(d,C,P-d,k-C),this.ctx.clip(),this.endPath()}getColorN_Pattern(s){let n;if(s[0]==="TilingPattern"){const d=s[1],C=this.baseTransform||(0,T.getCurrentTransform)(this.ctx),P={createCanvasGraphics:k=>new $(k,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};n=new ct.TilingPattern(s,d,this.ctx,P,C)}else n=this._getPattern(s[1],s[2]);return n}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(s,n,d){const C=o.Util.makeHexColor(s,n,d);this.ctx.strokeStyle=C,this.current.strokeColor=C}setFillRGBColor(s,n,d){const C=o.Util.makeHexColor(s,n,d);this.ctx.fillStyle=C,this.current.fillColor=C,this.current.patternFill=!1}_getPattern(s,n=null){let d;return this.cachedPatterns.has(s)?d=this.cachedPatterns.get(s):(d=(0,ct.getShadingPattern)(this.getObject(s)),this.cachedPatterns.set(s,d)),n&&(d.matrix=n),d}shadingFill(s){if(!this.contentVisible)return;const n=this.ctx;this.save();const d=this._getPattern(s);n.fillStyle=d.getPattern(n,this,(0,T.getCurrentTransformInverse)(n),ct.PathType.SHADING);const C=(0,T.getCurrentTransformInverse)(n);if(C){const{width:P,height:k}=n.canvas,[U,et,ht,ut]=o.Util.getAxialAlignedBoundingBox([0,0,P,k],C);this.ctx.fillRect(U,et,ht-U,ut-et)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,o.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,o.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(s,n){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(s)&&s.length===6&&this.transform(...s),this.baseTransform=(0,T.getCurrentTransform)(this.ctx),n)){const d=n[2]-n[0],C=n[3]-n[1];this.ctx.rect(n[0],n[1],d,C),this.current.updateRectMinMax((0,T.getCurrentTransform)(this.ctx),n),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(s){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const n=this.ctx;s.isolated||(0,o.info)("TODO: Support non-isolated groups."),s.knockout&&(0,o.warn)("Knockout groups not supported.");const d=(0,T.getCurrentTransform)(n);if(s.matrix&&n.transform(...s.matrix),!s.bbox)throw new Error("Bounding box is required.");let C=o.Util.getAxialAlignedBoundingBox(s.bbox,(0,T.getCurrentTransform)(n));const P=[0,0,n.canvas.width,n.canvas.height];C=o.Util.intersect(C,P)||[0,0,0,0];const k=Math.floor(C[0]),U=Math.floor(C[1]);let et=Math.max(Math.ceil(C[2])-k,1),ht=Math.max(Math.ceil(C[3])-U,1),ut=1,pt=1;et>M&&(ut=et/M,et=M),ht>M&&(pt=ht/M,ht=M),this.current.startNewPathAndClipBox([0,0,et,ht]);let bt="groupAt"+this.groupLevel;s.smask&&(bt+="_smask_"+this.smaskCounter++%2);const At=this.cachedCanvases.getCanvas(bt,et,ht),Y=At.context;Y.scale(1/ut,1/pt),Y.translate(-k,-U),Y.transform(...d),s.smask?this.smaskStack.push({canvas:At.canvas,context:Y,offsetX:k,offsetY:U,scaleX:ut,scaleY:pt,subtype:s.smask.subtype,backdrop:s.smask.backdrop,transferMap:s.smask.transferMap||null,startTransformInverse:null}):(n.setTransform(1,0,0,1,0,0),n.translate(k,U),n.scale(ut,pt),n.save()),r(n,Y),this.ctx=Y,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(n),this.groupLevel++}endGroup(s){if(!this.contentVisible)return;this.groupLevel--;const n=this.ctx,d=this.groupStack.pop();if(this.ctx=d,this.ctx.imageSmoothingEnabled=!1,s.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const C=(0,T.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...C);const P=o.Util.getAxialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],C);this.ctx.drawImage(n.canvas,0,0),this.ctx.restore(),this.compose(P)}}beginAnnotation(s,n,d,C,P){if(H(this,nt,qe).call(this),i(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(n)&&n.length===4){const k=n[2]-n[0],U=n[3]-n[1];if(P&&this.annotationCanvasMap){d=d.slice(),d[4]-=n[0],d[5]-=n[1],n=n.slice(),n[0]=n[1]=0,n[2]=k,n[3]=U;const[et,ht]=o.Util.singularValueDecompose2dScale((0,T.getCurrentTransform)(this.ctx)),{viewportScale:ut}=this,pt=Math.ceil(k*this.outputScaleX*ut),bt=Math.ceil(U*this.outputScaleY*ut);this.annotationCanvas=this.canvasFactory.create(pt,bt);const{canvas:At,context:Y}=this.annotationCanvas;this.annotationCanvasMap.set(s,At),this.annotationCanvas.savedCtx=this.ctx,this.ctx=Y,this.ctx.save(),this.ctx.setTransform(et,0,0,-ht,0,U*ht),i(this.ctx)}else i(this.ctx),this.ctx.rect(n[0],n[1],k,U),this.ctx.clip(),this.endPath()}this.current=new p(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...d),this.transform(...C)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),H(this,nt,Ve).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(s){if(!this.contentVisible)return;const n=s.count;s=this.getObject(s.data,s),s.count=n;const d=this.ctx,C=this.processingType3;if(C&&(C.compiled===void 0&&(C.compiled=c(s)),C.compiled)){C.compiled(d);return}const P=this._createMaskCanvas(s),k=P.canvas;d.save(),d.setTransform(1,0,0,1,0,0),d.drawImage(k,P.offsetX,P.offsetY),d.restore(),this.compose()}paintImageMaskXObjectRepeat(s,n,d=0,C=0,P,k){if(!this.contentVisible)return;s=this.getObject(s.data,s);const U=this.ctx;U.save();const et=(0,T.getCurrentTransform)(U);U.transform(n,d,C,P,0,0);const ht=this._createMaskCanvas(s);U.setTransform(1,0,0,1,ht.offsetX-et[4],ht.offsetY-et[5]);for(let ut=0,pt=k.length;ut<pt;ut+=2){const bt=o.Util.transform(et,[n,d,C,P,k[ut],k[ut+1]]),[At,Y]=o.Util.applyTransform([0,0],bt);U.drawImage(ht.canvas,At,Y)}U.restore(),this.compose()}paintImageMaskXObjectGroup(s){if(!this.contentVisible)return;const n=this.ctx,d=this.current.fillColor,C=this.current.patternFill;for(const P of s){const{data:k,width:U,height:et,transform:ht}=P,ut=this.cachedCanvases.getCanvas("maskCanvas",U,et),pt=ut.context;pt.save();const bt=this.getObject(k,P);b(pt,bt),pt.globalCompositeOperation="source-in",pt.fillStyle=C?d.getPattern(pt,this,(0,T.getCurrentTransformInverse)(n),ct.PathType.FILL):d,pt.fillRect(0,0,U,et),pt.restore(),n.save(),n.transform(...ht),n.scale(1,-1),u(n,ut.canvas,0,0,U,et,0,-1,1,1),n.restore()}this.compose()}paintImageXObject(s){if(!this.contentVisible)return;const n=this.getObject(s);if(!n){(0,o.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(n)}paintImageXObjectRepeat(s,n,d,C){if(!this.contentVisible)return;const P=this.getObject(s);if(!P){(0,o.warn)("Dependent image isn't ready yet");return}const k=P.width,U=P.height,et=[];for(let ht=0,ut=C.length;ht<ut;ht+=2)et.push({transform:[n,0,0,d,C[ht],C[ht+1]],x:0,y:0,w:k,h:U});this.paintInlineImageXObjectGroup(P,et)}applyTransferMapsToCanvas(s){return this.current.transferMaps!=="none"&&(s.filter=this.current.transferMaps,s.drawImage(s.canvas,0,0),s.filter="none"),s.canvas}applyTransferMapsToBitmap(s){if(this.current.transferMaps==="none")return s.bitmap;const{bitmap:n,width:d,height:C}=s,P=this.cachedCanvases.getCanvas("inlineImage",d,C),k=P.context;return k.filter=this.current.transferMaps,k.drawImage(n,0,0),k.filter="none",P.canvas}paintInlineImageXObject(s){if(!this.contentVisible)return;const n=s.width,d=s.height,C=this.ctx;if(this.save(),!o.isNodeJS){const{filter:U}=C;U!=="none"&&U!==""&&(C.filter="none")}C.scale(1/n,-1/d);let P;if(s.bitmap)P=this.applyTransferMapsToBitmap(s);else if(typeof HTMLElement=="function"&&s instanceof HTMLElement||!s.data)P=s;else{const et=this.cachedCanvases.getCanvas("inlineImage",n,d).context;x(et,s),P=this.applyTransferMapsToCanvas(et)}const k=this._scaleImage(P,(0,T.getCurrentTransformInverse)(C));C.imageSmoothingEnabled=S((0,T.getCurrentTransform)(C),s.interpolate),u(C,k.img,0,0,k.paintWidth,k.paintHeight,0,-d,n,d),this.compose(),this.restore()}paintInlineImageXObjectGroup(s,n){if(!this.contentVisible)return;const d=this.ctx;let C;if(s.bitmap)C=s.bitmap;else{const P=s.width,k=s.height,et=this.cachedCanvases.getCanvas("inlineImage",P,k).context;x(et,s),C=this.applyTransferMapsToCanvas(et)}for(const P of n)d.save(),d.transform(...P.transform),d.scale(1,-1),u(d,C,P.x,P.y,P.w,P.h,0,-1,1,1),d.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(s){}markPointProps(s,n){}beginMarkedContent(s){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(s,n){s==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(n)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(s){const n=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(s);const d=this.ctx;this.pendingClip&&(n||(this.pendingClip===J?d.clip("evenodd"):d.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),d.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const s=(0,T.getCurrentTransform)(this.ctx);if(s[1]===0&&s[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(s[0]),Math.abs(s[3]));else{const n=Math.abs(s[0]*s[3]-s[2]*s[1]),d=Math.hypot(s[0],s[2]),C=Math.hypot(s[1],s[3]);this._cachedGetSinglePixelWidth=Math.max(d,C)/n}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:s}=this.current,{a:n,b:d,c:C,d:P}=this.ctx.getTransform();let k,U;if(d===0&&C===0){const et=Math.abs(n),ht=Math.abs(P);if(et===ht)if(s===0)k=U=1/et;else{const ut=et*s;k=U=ut<1?1/ut:1}else if(s===0)k=1/et,U=1/ht;else{const ut=et*s,pt=ht*s;k=ut<1?1/ut:1,U=pt<1?1/pt:1}}else{const et=Math.abs(n*P-d*C),ht=Math.hypot(n,d),ut=Math.hypot(C,P);if(s===0)k=ut/et,U=ht/et;else{const pt=s*et;k=ut>pt?ut/pt:1,U=ht>pt?ht/pt:1}}this._cachedScaleForStroking[0]=k,this._cachedScaleForStroking[1]=U}return this._cachedScaleForStroking}rescaleAndStroke(s){const{ctx:n}=this,{lineWidth:d}=this.current,[C,P]=this.getScaleForStroking();if(n.lineWidth=d||1,C===1&&P===1){n.stroke();return}const k=n.getLineDash();if(s&&n.save(),n.scale(C,P),k.length>0){const U=Math.max(C,P);n.setLineDash(k.map(et=>et/U)),n.lineDashOffset/=U}n.stroke(),s&&n.restore()}isContentVisible(){for(let s=this.markedContentStack.length-1;s>=0;s--)if(!this.markedContentStack[s].visible)return!1;return!0}};nt=new WeakSet,qe=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)},Ve=function(){if(this.pageColors){const s=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(s!=="none"){const n=this.ctx.filter;this.ctx.filter=s,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=n}}};let j=$;h.CanvasGraphics=j;for(const y in o.OPS)j.prototype[y]!==void 0&&(j.prototype[o.OPS[y]]=j.prototype[y])},(St,h,lt)=>{Object.defineProperty(h,"__esModule",{value:!0}),h.TilingPattern=h.PathType=void 0,h.getShadingPattern=v;var o=lt(1),T=lt(6);const ct={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};h.PathType=ct;function q(c,p){if(!p)return;const x=p[2]-p[0],b=p[3]-p[1],r=new Path2D;r.rect(p[0],p[1],x,b),c.clip(r)}class mt{constructor(){this.constructor===mt&&(0,o.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,o.unreachable)("Abstract method `getPattern` called.")}}class O extends mt{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 b of this._colorStops)x.addColorStop(b[0],b[1]);return x}getPattern(p,x,b,r){let i;if(r===ct.STROKE||r===ct.FILL){const e=x.current.getClippedPathBoundingBox(r,(0,T.getCurrentTransform)(p))||[0,0,0,0],g=Math.ceil(e[2]-e[0])||1,l=Math.ceil(e[3]-e[1])||1,W=x.cachedCanvases.getCanvas("pattern",g,l,!0),a=W.context;a.clearRect(0,0,a.canvas.width,a.canvas.height),a.beginPath(),a.rect(0,0,a.canvas.width,a.canvas.height),a.translate(-e[0],-e[1]),b=o.Util.transform(b,[1,0,0,1,e[0],e[1]]),a.transform(...x.baseTransform),this.matrix&&a.transform(...this.matrix),q(a,this._bbox),a.fillStyle=this._createGradient(a),a.fill(),i=p.createPattern(W.canvas,"no-repeat");const S=new DOMMatrix(b);i.setTransform(S)}else q(p,this._bbox),i=this._createGradient(p);return i}}function M(c,p,x,b,r,i,e,g){const l=p.coords,W=p.colors,a=c.data,S=c.width*4;let N;l[x+1]>l[b+1]&&(N=x,x=b,b=N,N=i,i=e,e=N),l[b+1]>l[r+1]&&(N=b,b=r,r=N,N=e,e=g,g=N),l[x+1]>l[b+1]&&(N=x,x=b,b=N,N=i,i=e,e=N);const rt=(l[x]+p.offsetX)*p.scaleX,V=(l[x+1]+p.offsetY)*p.scaleY,J=(l[b]+p.offsetX)*p.scaleX,j=(l[b+1]+p.offsetY)*p.scaleY,nt=(l[r]+p.offsetX)*p.scaleX,R=(l[r+1]+p.offsetY)*p.scaleY;if(V>=R)return;const G=W[i],$=W[i+1],y=W[i+2],s=W[e],n=W[e+1],d=W[e+2],C=W[g],P=W[g+1],k=W[g+2],U=Math.round(V),et=Math.round(R);let ht,ut,pt,bt,At,Y,K,f;for(let F=U;F<=et;F++){if(F<j){const yt=F<V?0:(V-F)/(V-j);ht=rt-(rt-J)*yt,ut=G-(G-s)*yt,pt=$-($-n)*yt,bt=y-(y-d)*yt}else{let yt;F>R?yt=1:j===R?yt=0:yt=(j-F)/(j-R),ht=J-(J-nt)*yt,ut=s-(s-C)*yt,pt=n-(n-P)*yt,bt=d-(d-k)*yt}let z;F<V?z=0:F>R?z=1:z=(V-F)/(V-R),At=rt-(rt-nt)*z,Y=G-(G-C)*z,K=$-($-P)*z,f=y-(y-k)*z;const Q=Math.round(Math.min(ht,At)),dt=Math.round(Math.max(ht,At));let _t=S*F+Q*4;for(let yt=Q;yt<=dt;yt++)z=(ht-yt)/(ht-At),z<0?z=0:z>1&&(z=1),a[_t++]=ut-(ut-Y)*z|0,a[_t++]=pt-(pt-K)*z|0,a[_t++]=bt-(bt-f)*z|0,a[_t++]=255}}function m(c,p,x){const b=p.coords,r=p.colors;let i,e;switch(p.type){case"lattice":const g=p.verticesPerRow,l=Math.floor(b.length/g)-1,W=g-1;for(i=0;i<l;i++){let a=i*g;for(let S=0;S<W;S++,a++)M(c,x,b[a],b[a+1],b[a+g],r[a],r[a+1],r[a+g]),M(c,x,b[a+g+1],b[a+1],b[a+g],r[a+g+1],r[a+1],r[a+g])}break;case"triangles":for(i=0,e=b.length;i<e;i+=3)M(c,x,b[i],b[i+1],b[i+2],r[i],r[i+1],r[i+2]);break;default:throw new Error("illegal figure")}}class I extends mt{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,b){const g=Math.floor(this._bounds[0]),l=Math.floor(this._bounds[1]),W=Math.ceil(this._bounds[2])-g,a=Math.ceil(this._bounds[3])-l,S=Math.min(Math.ceil(Math.abs(W*p[0]*1.1)),3e3),N=Math.min(Math.ceil(Math.abs(a*p[1]*1.1)),3e3),rt=W/S,V=a/N,J={coords:this._coords,colors:this._colors,offsetX:-g,offsetY:-l,scaleX:1/rt,scaleY:1/V},j=S+2*2,nt=N+2*2,R=b.getCanvas("mesh",j,nt,!1),G=R.context,$=G.createImageData(S,N);if(x){const s=$.data;for(let n=0,d=s.length;n<d;n+=4)s[n]=x[0],s[n+1]=x[1],s[n+2]=x[2],s[n+3]=255}for(const s of this._figures)m($,s,J);return G.putImageData($,2,2),{canvas:R.canvas,offsetX:g-2*rt,offsetY:l-2*V,scaleX:rt,scaleY:V}}getPattern(p,x,b,r){q(p,this._bbox);let i;if(r===ct.SHADING)i=o.Util.singularValueDecompose2dScale((0,T.getCurrentTransform)(p));else if(i=o.Util.singularValueDecompose2dScale(x.baseTransform),this.matrix){const g=o.Util.singularValueDecompose2dScale(this.matrix);i=[i[0]*g[0],i[1]*g[1]]}const e=this._createMeshCanvas(i,r===ct.SHADING?null:this._background,x.cachedCanvases);return r!==ct.SHADING&&(p.setTransform(...x.baseTransform),this.matrix&&p.transform(...this.matrix)),p.translate(e.offsetX,e.offsetY),p.scale(e.scaleX,e.scaleY),p.createPattern(e.canvas,"no-repeat")}}class L extends mt{getPattern(){return"hotpink"}}function v(c){switch(c[0]){case"RadialAxial":return new O(c);case"Mesh":return new I(c);case"Dummy":return new L}throw new Error(`Unknown IR type: ${c[0]}`)}const A={COLORED:1,UNCOLORED:2},u=class u{constructor(p,x,b,r,i){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=b,this.canvasGraphicsFactory=r,this.baseTransform=i}createPatternCanvas(p){const x=this.operatorList,b=this.bbox,r=this.xstep,i=this.ystep,e=this.paintType,g=this.tilingType,l=this.color,W=this.canvasGraphicsFactory;(0,o.info)("TilingType: "+g);const a=b[0],S=b[1],N=b[2],rt=b[3],V=o.Util.singularValueDecompose2dScale(this.matrix),J=o.Util.singularValueDecompose2dScale(this.baseTransform),j=[V[0]*J[0],V[1]*J[1]],nt=this.getSizeAndScale(r,this.ctx.canvas.width,j[0]),R=this.getSizeAndScale(i,this.ctx.canvas.height,j[1]),G=p.cachedCanvases.getCanvas("pattern",nt.size,R.size,!0),$=G.context,y=W.createCanvasGraphics($);y.groupLevel=p.groupLevel,this.setFillAndStrokeStyleToContext(y,e,l);let s=a,n=S,d=N,C=rt;return a<0&&(s=0,d+=Math.abs(a)),S<0&&(n=0,C+=Math.abs(S)),$.translate(-(nt.scale*s),-(R.scale*n)),y.transform(nt.scale,0,0,R.scale,0,0),$.save(),this.clipBbox(y,s,n,d,C),y.baseTransform=(0,T.getCurrentTransform)(y.ctx),y.executeOperatorList(x),y.endDrawing(),{canvas:G.canvas,scaleX:nt.scale,scaleY:R.scale,offsetX:s,offsetY:n}}getSizeAndScale(p,x,b){p=Math.abs(p);const r=Math.max(u.MAX_PATTERN_SIZE,x);let i=Math.ceil(p*b);return i>=r?i=r:b=i/p,{scale:b,size:i}}clipBbox(p,x,b,r,i){const e=r-x,g=i-b;p.ctx.rect(x,b,e,g),p.current.updateRectMinMax((0,T.getCurrentTransform)(p.ctx),[x,b,r,i]),p.clip(),p.endPath()}setFillAndStrokeStyleToContext(p,x,b){const r=p.ctx,i=p.current;switch(x){case A.COLORED:const e=this.ctx;r.fillStyle=e.fillStyle,r.strokeStyle=e.strokeStyle,i.fillColor=e.fillStyle,i.strokeColor=e.strokeStyle;break;case A.UNCOLORED:const g=o.Util.makeHexColor(b[0],b[1],b[2]);r.fillStyle=g,r.strokeStyle=g,i.fillColor=g,i.strokeColor=g;break;default:throw new o.FormatError(`Unsupported paint type: ${x}`)}}getPattern(p,x,b,r){let i=b;r!==ct.SHADING&&(i=o.Util.transform(i,x.baseTransform),this.matrix&&(i=o.Util.transform(i,this.matrix)));const e=this.createPatternCanvas(x);let g=new DOMMatrix(i);g=g.translate(e.offsetX,e.offsetY),g=g.scale(1/e.scaleX,1/e.scaleY);const l=p.createPattern(e.canvas,"repeat");return l.setTransform(g),l}};Yt(u,"MAX_PATTERN_SIZE",3e3);let w=u;h.TilingPattern=w},(St,h,lt)=>{Object.defineProperty(h,"__esModule",{value:!0}),h.convertBlackAndWhiteToRGBA=ct,h.convertToRGBA=T,h.grayToRGBA=mt;var o=lt(1);function T(O){switch(O.kind){case o.ImageKind.GRAYSCALE_1BPP:return ct(O);case o.ImageKind.RGB_24BPP:return q(O)}return null}function ct({src:O,srcPos:M=0,dest:m,width:I,height:L,nonBlackColor:v=4294967295,inverseDecode:A=!1}){const w=o.FeatureTest.isLittleEndian?4278190080:255,[u,c]=A?[v,w]:[w,v],p=I>>3,x=I&7,b=O.length;m=new Uint32Array(m.buffer);let r=0;for(let i=0;i<L;i++){for(const g=M+p;M<g;M++){const l=M<b?O[M]:255;m[r++]=l&128?c:u,m[r++]=l&64?c:u,m[r++]=l&32?c:u,m[r++]=l&16?c:u,m[r++]=l&8?c:u,m[r++]=l&4?c:u,m[r++]=l&2?c:u,m[r++]=l&1?c:u}if(x===0)continue;const e=M<b?O[M++]:255;for(let g=0;g<x;g++)m[r++]=e&1<<7-g?c:u}return{srcPos:M,destPos:r}}function q({src:O,srcPos:M=0,dest:m,destPos:I=0,width:L,height:v}){let A=0;const w=O.length>>2,u=new Uint32Array(O.buffer,M,w);if(o.FeatureTest.isLittleEndian){for(;A<w-2;A+=3,I+=4){const c=u[A],p=u[A+1],x=u[A+2];m[I]=c|4278190080,m[I+1]=c>>>24|p<<8|4278190080,m[I+2]=p>>>16|x<<16|4278190080,m[I+3]=x>>>8|4278190080}for(let c=A*4,p=O.length;c<p;c+=3)m[I++]=O[c]|O[c+1]<<8|O[c+2]<<16|4278190080}else{for(;A<w-2;A+=3,I+=4){const c=u[A],p=u[A+1],x=u[A+2];m[I]=c|255,m[I+1]=c<<24|p>>>8|255,m[I+2]=p<<16|x>>>16|255,m[I+3]=x<<8|255}for(let c=A*4,p=O.length;c<p;c+=3)m[I++]=O[c]<<24|O[c+1]<<16|O[c+2]<<8|255}return{srcPos:M,destPos:I}}function mt(O,M){if(o.FeatureTest.isLittleEndian)for(let m=0,I=O.length;m<I;m++)M[m]=O[m]*65793|4278190080;else for(let m=0,I=O.length;m<I;m++)M[m]=O[m]*16843008|255}},(St,h)=>{Object.defineProperty(h,"__esModule",{value:!0}),h.GlobalWorkerOptions=void 0;const lt=Object.create(null);h.GlobalWorkerOptions=lt,lt.workerPort=null,lt.workerSrc=""},(St,h,lt)=>{var O,wi,Ci,Se;Object.defineProperty(h,"__esModule",{value:!0}),h.MessageHandler=void 0;var o=lt(1);const T={DATA:1,ERROR:2},ct={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function q(L){switch(L instanceof Error||typeof L=="object"&&L!==null||(0,o.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),L.name){case"AbortException":return new o.AbortException(L.message);case"MissingPDFException":return new o.MissingPDFException(L.message);case"PasswordException":return new o.PasswordException(L.message,L.code);case"UnexpectedResponseException":return new o.UnexpectedResponseException(L.message,L.status);case"UnknownErrorException":return new o.UnknownErrorException(L.message,L.details);default:return new o.UnknownErrorException(L.message,L.toString())}}class mt{constructor(v,A,w){Z(this,O);this.sourceName=v,this.targetName=A,this.comObj=w,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=u=>{const c=u.data;if(c.targetName!==this.sourceName)return;if(c.stream){H(this,O,Ci).call(this,c);return}if(c.callback){const x=c.callbackId,b=this.callbackCapabilities[x];if(!b)throw new Error(`Cannot resolve callback ${x}`);if(delete this.callbackCapabilities[x],c.callback===T.DATA)b.resolve(c.data);else if(c.callback===T.ERROR)b.reject(q(c.reason));else throw new Error("Unexpected callback case");return}const p=this.actionHandler[c.action];if(!p)throw new Error(`Unknown action from worker: ${c.action}`);if(c.callbackId){const x=this.sourceName,b=c.sourceName;new Promise(function(r){r(p(c.data))}).then(function(r){w.postMessage({sourceName:x,targetName:b,callback:T.DATA,callbackId:c.callbackId,data:r})},function(r){w.postMessage({sourceName:x,targetName:b,callback:T.ERROR,callbackId:c.callbackId,reason:q(r)})});return}if(c.streamId){H(this,O,wi).call(this,c);return}p(c.data)},w.addEventListener("message",this._onComObjOnMessage)}on(v,A){const w=this.actionHandler;if(w[v])throw new Error(`There is already an actionName called "${v}"`);w[v]=A}send(v,A,w){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:v,data:A},w)}sendWithPromise(v,A,w){const u=this.callbackId++,c=new o.PromiseCapability;this.callbackCapabilities[u]=c;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:v,callbackId:u,data:A},w)}catch(p){c.reject(p)}return c.promise}sendWithStream(v,A,w,u){const c=this.streamId++,p=this.sourceName,x=this.targetName,b=this.comObj;return new ReadableStream({start:r=>{const i=new o.PromiseCapability;return this.streamControllers[c]={controller:r,startCall:i,pullCall:null,cancelCall:null,isClosed:!1},b.postMessage({sourceName:p,targetName:x,action:v,streamId:c,data:A,desiredSize:r.desiredSize},u),i.promise},pull:r=>{const i=new o.PromiseCapability;return this.streamControllers[c].pullCall=i,b.postMessage({sourceName:p,targetName:x,stream:ct.PULL,streamId:c,desiredSize:r.desiredSize}),i.promise},cancel:r=>{(0,o.assert)(r instanceof Error,"cancel must have a valid reason");const i=new o.PromiseCapability;return this.streamControllers[c].cancelCall=i,this.streamControllers[c].isClosed=!0,b.postMessage({sourceName:p,targetName:x,stream:ct.CANCEL,streamId:c,reason:q(r)}),i.promise}},w)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}O=new WeakSet,wi=function(v){const A=v.streamId,w=this.sourceName,u=v.sourceName,c=this.comObj,p=this,x=this.actionHandler[v.action],b={enqueue(r,i=1,e){if(this.isCancelled)return;const g=this.desiredSize;this.desiredSize-=i,g>0&&this.desiredSize<=0&&(this.sinkCapability=new o.PromiseCapability,this.ready=this.sinkCapability.promise),c.postMessage({sourceName:w,targetName:u,stream:ct.ENQUEUE,streamId:A,chunk:r},e)},close(){this.isCancelled||(this.isCancelled=!0,c.postMessage({sourceName:w,targetName:u,stream:ct.CLOSE,streamId:A}),delete p.streamSinks[A])},error(r){(0,o.assert)(r instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,c.postMessage({sourceName:w,targetName:u,stream:ct.ERROR,streamId:A,reason:q(r)}))},sinkCapability:new o.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:v.desiredSize,ready:null};b.sinkCapability.resolve(),b.ready=b.sinkCapability.promise,this.streamSinks[A]=b,new Promise(function(r){r(x(v.data,b))}).then(function(){c.postMessage({sourceName:w,targetName:u,stream:ct.START_COMPLETE,streamId:A,success:!0})},function(r){c.postMessage({sourceName:w,targetName:u,stream:ct.START_COMPLETE,streamId:A,reason:q(r)})})},Ci=function(v){const A=v.streamId,w=this.sourceName,u=v.sourceName,c=this.comObj,p=this.streamControllers[A],x=this.streamSinks[A];switch(v.stream){case ct.START_COMPLETE:v.success?p.startCall.resolve():p.startCall.reject(q(v.reason));break;case ct.PULL_COMPLETE:v.success?p.pullCall.resolve():p.pullCall.reject(q(v.reason));break;case ct.PULL:if(!x){c.postMessage({sourceName:w,targetName:u,stream:ct.PULL_COMPLETE,streamId:A,success:!0});break}x.desiredSize<=0&&v.desiredSize>0&&x.sinkCapability.resolve(),x.desiredSize=v.desiredSize,new Promise(function(b){b(x.onPull?.())}).then(function(){c.postMessage({sourceName:w,targetName:u,stream:ct.PULL_COMPLETE,streamId:A,success:!0})},function(b){c.postMessage({sourceName:w,targetName:u,stream:ct.PULL_COMPLETE,streamId:A,reason:q(b)})});break;case ct.ENQUEUE:if((0,o.assert)(p,"enqueue should have stream controller"),p.isClosed)break;p.controller.enqueue(v.chunk);break;case ct.CLOSE:if((0,o.assert)(p,"close should have stream controller"),p.isClosed)break;p.isClosed=!0,p.controller.close(),H(this,O,Se).call(this,p,A);break;case ct.ERROR:(0,o.assert)(p,"error should have stream controller"),p.controller.error(q(v.reason)),H(this,O,Se).call(this,p,A);break;case ct.CANCEL_COMPLETE:v.success?p.cancelCall.resolve():p.cancelCall.reject(q(v.reason)),H(this,O,Se).call(this,p,A);break;case ct.CANCEL:if(!x)break;new Promise(function(b){b(x.onCancel?.(q(v.reason)))}).then(function(){c.postMessage({sourceName:w,targetName:u,stream:ct.CANCEL_COMPLETE,streamId:A,success:!0})},function(b){c.postMessage({sourceName:w,targetName:u,stream:ct.CANCEL_COMPLETE,streamId:A,reason:q(b)})}),x.sinkCapability.reject(q(v.reason)),x.isCancelled=!0,delete this.streamSinks[A];break;default:throw new Error("Unexpected stream case")}},Se=async function(v,A){await Promise.allSettled([v.startCall?.promise,v.pullCall?.promise,v.cancelCall?.promise]),delete this.streamControllers[A]},h.MessageHandler=mt},(St,h,lt)=>{var ct,q;Object.defineProperty(h,"__esModule",{value:!0}),h.Metadata=void 0;var o=lt(1);class T{constructor({parsedData:O,rawData:M}){Z(this,ct);Z(this,q);tt(this,ct,O),tt(this,q,M)}getRaw(){return t(this,q)}get(O){return t(this,ct).get(O)??null}getAll(){return(0,o.objectFromMap)(t(this,ct))}has(O){return t(this,ct).has(O)}}ct=new WeakMap,q=new WeakMap,h.Metadata=T},(St,h,lt)=>{var O,M,m,I,L,v,$e;Object.defineProperty(h,"__esModule",{value:!0}),h.OptionalContentConfig=void 0;var o=lt(1),T=lt(8);const ct=Symbol("INTERNAL");class q{constructor(u,c){Z(this,O,!0);this.name=u,this.intent=c}get visible(){return t(this,O)}_setVisible(u,c){u!==ct&&(0,o.unreachable)("Internal method `_setVisible` called."),tt(this,O,c)}}O=new WeakMap;class mt{constructor(u){Z(this,v);Z(this,M,null);Z(this,m,new Map);Z(this,I,null);Z(this,L,null);if(this.name=null,this.creator=null,u!==null){this.name=u.name,this.creator=u.creator,tt(this,L,u.order);for(const c of u.groups)t(this,m).set(c.id,new q(c.name,c.intent));if(u.baseState==="OFF")for(const c of t(this,m).values())c._setVisible(ct,!1);for(const c of u.on)t(this,m).get(c)._setVisible(ct,!0);for(const c of u.off)t(this,m).get(c)._setVisible(ct,!1);tt(this,I,this.getHash())}}isVisible(u){if(t(this,m).size===0)return!0;if(!u)return(0,o.warn)("Optional content group not defined."),!0;if(u.type==="OCG")return t(this,m).has(u.id)?t(this,m).get(u.id).visible:((0,o.warn)(`Optional content group not found: ${u.id}`),!0);if(u.type==="OCMD"){if(u.expression)return H(this,v,$e).call(this,u.expression);if(!u.policy||u.policy==="AnyOn"){for(const c of u.ids){if(!t(this,m).has(c))return(0,o.warn)(`Optional content group not found: ${c}`),!0;if(t(this,m).get(c).visible)return!0}return!1}else if(u.policy==="AllOn"){for(const c of u.ids){if(!t(this,m).has(c))return(0,o.warn)(`Optional content group not found: ${c}`),!0;if(!t(this,m).get(c).visible)return!1}return!0}else if(u.policy==="AnyOff"){for(const c of u.ids){if(!t(this,m).has(c))return(0,o.warn)(`Optional content group not found: ${c}`),!0;if(!t(this,m).get(c).visible)return!0}return!1}else if(u.policy==="AllOff"){for(const c of u.ids){if(!t(this,m).has(c))return(0,o.warn)(`Optional content group not found: ${c}`),!0;if(t(this,m).get(c).visible)return!1}return!0}return(0,o.warn)(`Unknown optional content policy ${u.policy}.`),!0}return(0,o.warn)(`Unknown group type ${u.type}.`),!0}setVisibility(u,c=!0){if(!t(this,m).has(u)){(0,o.warn)(`Optional content group not found: ${u}`);return}t(this,m).get(u)._setVisible(ct,!!c),tt(this,M,null)}get hasInitialVisibility(){return t(this,I)===null||this.getHash()===t(this,I)}getOrder(){return t(this,m).size?t(this,L)?t(this,L).slice():[...t(this,m).keys()]:null}getGroups(){return t(this,m).size>0?(0,o.objectFromMap)(t(this,m)):null}getGroup(u){return t(this,m).get(u)||null}getHash(){if(t(this,M)!==null)return t(this,M);const u=new T.MurmurHash3_64;for(const[c,p]of t(this,m))u.update(`${c}:${p.visible}`);return tt(this,M,u.hexdigest())}}M=new WeakMap,m=new WeakMap,I=new WeakMap,L=new WeakMap,v=new WeakSet,$e=function(u){const c=u.length;if(c<2)return!0;const p=u[0];for(let x=1;x<c;x++){const b=u[x];let r;if(Array.isArray(b))r=H(this,v,$e).call(this,b);else if(t(this,m).has(b))r=t(this,m).get(b).visible;else return(0,o.warn)(`Optional content group not found: ${b}`),!0;switch(p){case"And":if(!r)return!1;break;case"Or":if(r)return!0;break;case"Not":return!r;default:return!0}}return p==="And"},h.OptionalContentConfig=mt},(St,h,lt)=>{Object.defineProperty(h,"__esModule",{value:!0}),h.PDFDataTransportStream=void 0;var o=lt(1),T=lt(6);class ct{constructor({length:M,initialData:m,progressiveDone:I=!1,contentDispositionFilename:L=null,disableRange:v=!1,disableStream:A=!1},w){if((0,o.assert)(w,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=I,this._contentDispositionFilename=L,m?.length>0){const u=m instanceof Uint8Array&&m.byteLength===m.buffer.byteLength?m.buffer:new Uint8Array(m).buffer;this._queuedChunks.push(u)}this._pdfDataRangeTransport=w,this._isStreamingSupported=!A,this._isRangeSupported=!v,this._contentLength=M,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((u,c)=>{this._onReceiveData({begin:u,chunk:c})}),this._pdfDataRangeTransport.addProgressListener((u,c)=>{this._onProgress({loaded:u,total:c})}),this._pdfDataRangeTransport.addProgressiveReadListener(u=>{this._onReceiveData({chunk:u})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData({begin:M,chunk:m}){const I=m instanceof Uint8Array&&m.byteLength===m.buffer.byteLength?m.buffer:new Uint8Array(m).buffer;if(M===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(I):this._queuedChunks.push(I);else{const L=this._rangeReaders.some(function(v){return v._begin!==M?!1:(v._enqueue(I),!0)});(0,o.assert)(L,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(M){M.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:M.loaded}):this._fullRequestReader?.onProgress?.({loaded:M.loaded,total:M.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(M){const m=this._rangeReaders.indexOf(M);m>=0&&this._rangeReaders.splice(m,1)}getFullReader(){(0,o.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const M=this._queuedChunks;return this._queuedChunks=null,new q(this,M,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(M,m){if(m<=this._progressiveDataLength)return null;const I=new mt(this,M,m);return this._pdfDataRangeTransport.requestDataRange(M,m),this._rangeReaders.push(I),I}cancelAllRequests(M){this._fullRequestReader?.cancel(M);for(const m of this._rangeReaders.slice(0))m.cancel(M);this._pdfDataRangeTransport.abort()}}h.PDFDataTransportStream=ct;class q{constructor(M,m,I=!1,L=null){this._stream=M,this._done=I||!1,this._filename=(0,T.isPdfFile)(L)?L:null,this._queuedChunks=m||[],this._loaded=0;for(const v of this._queuedChunks)this._loaded+=v.byteLength;this._requests=[],this._headersReady=Promise.resolve(),M._fullRequestReader=this,this.onProgress=null}_enqueue(M){this._done||(this._requests.length>0?this._requests.shift().resolve({value:M,done:!1}):this._queuedChunks.push(M),this._loaded+=M.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 M=new o.PromiseCapability;return this._requests.push(M),M.promise}cancel(M){this._done=!0;for(const m of this._requests)m.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class mt{constructor(M,m,I){this._stream=M,this._begin=m,this._end=I,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(M){if(!this._done){if(this._requests.length===0)this._queuedChunk=M;else{this._requests.shift().resolve({value:M,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 m=this._queuedChunk;return this._queuedChunk=null,{value:m,done:!1}}if(this._done)return{value:void 0,done:!0};const M=new o.PromiseCapability;return this._requests.push(M),M.promise}cancel(M){this._done=!0;for(const m of this._requests)m.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(St,h,lt)=>{Object.defineProperty(h,"__esModule",{value:!0}),h.PDFFetchStream=void 0;var o=lt(1),T=lt(20);function ct(I,L,v){return{method:"GET",headers:I,signal:v.signal,mode:"cors",credentials:L?"include":"same-origin",redirect:"follow"}}function q(I){const L=new Headers;for(const v in I){const A=I[v];A!==void 0&&L.append(v,A)}return L}function mt(I){return I instanceof Uint8Array?I.buffer:I instanceof ArrayBuffer?I:((0,o.warn)(`getArrayBuffer - unexpected data format: ${I}`),new Uint8Array(I).buffer)}class O{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(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,o.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new M(this),this._fullRequestReader}getRangeReader(L,v){if(v<=this._progressiveDataLength)return null;const A=new m(this,L,v);return this._rangeRequestReaders.push(A),A}cancelAllRequests(L){this._fullRequestReader?.cancel(L);for(const v of this._rangeRequestReaders.slice(0))v.cancel(L)}}h.PDFFetchStream=O;class M{constructor(L){this._stream=L,this._reader=null,this._loaded=0,this._filename=null;const v=L.source;this._withCredentials=v.withCredentials||!1,this._contentLength=v.length,this._headersCapability=new o.PromiseCapability,this._disableRange=v.disableRange||!1,this._rangeChunkSize=v.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!v.disableStream,this._isRangeSupported=!v.disableRange,this._headers=q(this._stream.httpHeaders);const A=v.url;fetch(A,ct(this._headers,this._withCredentials,this._abortController)).then(w=>{if(!(0,T.validateResponseStatus)(w.status))throw(0,T.createResponseStatusError)(w.status,A);this._reader=w.body.getReader(),this._headersCapability.resolve();const u=x=>w.headers.get(x),{allowRangeRequests:c,suggestedLength:p}=(0,T.validateRangeRequestCapabilities)({getResponseHeader:u,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=c,this._contentLength=p||this._contentLength,this._filename=(0,T.extractFilenameFromHeader)(u),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new o.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(){await this._headersCapability.promise;const{value:L,done:v}=await this._reader.read();return v?{value:L,done:v}:(this._loaded+=L.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:mt(L),done:!1})}cancel(L){this._reader?.cancel(L),this._abortController.abort()}}class m{constructor(L,v,A){this._stream=L,this._reader=null,this._loaded=0;const w=L.source;this._withCredentials=w.withCredentials||!1,this._readCapability=new o.PromiseCapability,this._isStreamingSupported=!w.disableStream,this._abortController=new AbortController,this._headers=q(this._stream.httpHeaders),this._headers.append("Range",`bytes=${v}-${A-1}`);const u=w.url;fetch(u,ct(this._headers,this._withCredentials,this._abortController)).then(c=>{if(!(0,T.validateResponseStatus)(c.status))throw(0,T.createResponseStatusError)(c.status,u);this._readCapability.resolve(),this._reader=c.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:L,done:v}=await this._reader.read();return v?{value:L,done:v}:(this._loaded+=L.byteLength,this.onProgress?.({loaded:this._loaded}),{value:mt(L),done:!1})}cancel(L){this._reader?.cancel(L),this._abortController.abort()}}},(St,h,lt)=>{Object.defineProperty(h,"__esModule",{value:!0}),h.createResponseStatusError=O,h.extractFilenameFromHeader=mt,h.validateRangeRequestCapabilities=q,h.validateResponseStatus=M;var o=lt(1),T=lt(21),ct=lt(6);function q({getResponseHeader:m,isHttp:I,rangeChunkSize:L,disableRange:v}){const A={allowRangeRequests:!1,suggestedLength:void 0},w=parseInt(m("Content-Length"),10);return!Number.isInteger(w)||(A.suggestedLength=w,w<=2*L)||v||!I||m("Accept-Ranges")!=="bytes"||(m("Content-Encoding")||"identity")!=="identity"||(A.allowRangeRequests=!0),A}function mt(m){const I=m("Content-Disposition");if(I){let L=(0,T.getFilenameFromContentDispositionHeader)(I);if(L.includes("%"))try{L=decodeURIComponent(L)}catch{}if((0,ct.isPdfFile)(L))return L}return null}function O(m,I){return m===404||m===0&&I.startsWith("file:")?new o.MissingPDFException('Missing PDF "'+I+'".'):new o.UnexpectedResponseException(`Unexpected server response (${m}) while retrieving PDF "${I}".`,m)}function M(m){return m===200||m===206}},(St,h,lt)=>{Object.defineProperty(h,"__esModule",{value:!0}),h.getFilenameFromContentDispositionHeader=T;var o=lt(1);function T(ct){let q=!0,mt=O("filename\\*","i").exec(ct);if(mt){mt=mt[1];let w=L(mt);return w=unescape(w),w=v(w),w=A(w),m(w)}if(mt=I(ct),mt){const w=A(mt);return m(w)}if(mt=O("filename","i").exec(ct),mt){mt=mt[1];let w=L(mt);return w=A(w),m(w)}function O(w,u){return new RegExp("(?:^|;)\\s*"+w+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',u)}function M(w,u){if(w){if(!/^[\x00-\xFF]+$/.test(u))return u;try{const c=new TextDecoder(w,{fatal:!0}),p=(0,o.stringToBytes)(u);u=c.decode(p),q=!1}catch{}}return u}function m(w){return q&&/[\x80-\xff]/.test(w)&&(w=M("utf-8",w),q&&(w=M("iso-8859-1",w))),w}function I(w){const u=[];let c;const p=O("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(c=p.exec(w))!==null;){let[,b,r,i]=c;if(b=parseInt(b,10),b in u){if(b===0)break;continue}u[b]=[r,i]}const x=[];for(let b=0;b<u.length&&b in u;++b){let[r,i]=u[b];i=L(i),r&&(i=unescape(i),b===0&&(i=v(i))),x.push(i)}return x.join("")}function L(w){if(w.startsWith('"')){const u=w.slice(1).split('\\"');for(let c=0;c<u.length;++c){const p=u[c].indexOf('"');p!==-1&&(u[c]=u[c].slice(0,p),u.length=c+1),u[c]=u[c].replaceAll(/\\(.)/g,"$1")}w=u.join('"')}return w}function v(w){const u=w.indexOf("'");if(u===-1)return w;const c=w.slice(0,u),x=w.slice(u+1).replace(/^[^']*'/,"");return M(c,x)}function A(w){return!w.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(w)?w:w.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(u,c,p,x){if(p==="q"||p==="Q")return x=x.replaceAll("_"," "),x=x.replaceAll(/=([0-9a-fA-F]{2})/g,function(b,r){return String.fromCharCode(parseInt(r,16))}),M(c,x);try{x=atob(x)}catch{}return M(c,x)})}return""}},(St,h,lt)=>{Object.defineProperty(h,"__esModule",{value:!0}),h.PDFNetworkStream=void 0;var o=lt(1),T=lt(20);const ct=200,q=206;function mt(L){const v=L.response;return typeof v!="string"?v:(0,o.stringToBytes)(v).buffer}class O{constructor(v,A={}){this.url=v,this.isHttp=/^https?:/i.test(v),this.httpHeaders=this.isHttp&&A.httpHeaders||Object.create(null),this.withCredentials=A.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(v,A,w){const u={begin:v,end:A};for(const c in w)u[c]=w[c];return this.request(u)}requestFull(v){return this.request(v)}request(v){const A=new XMLHttpRequest,w=this.currXhrId++,u=this.pendingRequests[w]={xhr:A};A.open("GET",this.url),A.withCredentials=this.withCredentials;for(const c in this.httpHeaders){const p=this.httpHeaders[c];p!==void 0&&A.setRequestHeader(c,p)}return this.isHttp&&"begin"in v&&"end"in v?(A.setRequestHeader("Range",`bytes=${v.begin}-${v.end-1}`),u.expectedStatus=q):u.expectedStatus=ct,A.responseType="arraybuffer",v.onError&&(A.onerror=function(c){v.onError(A.status)}),A.onreadystatechange=this.onStateChange.bind(this,w),A.onprogress=this.onProgress.bind(this,w),u.onHeadersReceived=v.onHeadersReceived,u.onDone=v.onDone,u.onError=v.onError,u.onProgress=v.onProgress,A.send(null),w}onProgress(v,A){const w=this.pendingRequests[v];w&&w.onProgress?.(A)}onStateChange(v,A){const w=this.pendingRequests[v];if(!w)return;const u=w.xhr;if(u.readyState>=2&&w.onHeadersReceived&&(w.onHeadersReceived(),delete w.onHeadersReceived),u.readyState!==4||!(v in this.pendingRequests))return;if(delete this.pendingRequests[v],u.status===0&&this.isHttp){w.onError?.(u.status);return}const c=u.status||ct;if(!(c===ct&&w.expectedStatus===q)&&c!==w.expectedStatus){w.onError?.(u.status);return}const x=mt(u);if(c===q){const b=u.getResponseHeader("Content-Range"),r=/bytes (\d+)-(\d+)\/(\d+)/.exec(b);w.onDone({begin:parseInt(r[1],10),chunk:x})}else x?w.onDone({begin:0,chunk:x}):w.onError?.(u.status)}getRequestXhr(v){return this.pendingRequests[v].xhr}isPendingRequest(v){return v in this.pendingRequests}abortRequest(v){const A=this.pendingRequests[v].xhr;delete this.pendingRequests[v],A.abort()}}class M{constructor(v){this._source=v,this._manager=new O(v.url,{httpHeaders:v.httpHeaders,withCredentials:v.withCredentials}),this._rangeChunkSize=v.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(v){const A=this._rangeRequestReaders.indexOf(v);A>=0&&this._rangeRequestReaders.splice(A,1)}getFullReader(){return(0,o.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new m(this._manager,this._source),this._fullRequestReader}getRangeReader(v,A){const w=new I(this._manager,v,A);return w.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(w),w}cancelAllRequests(v){this._fullRequestReader?.cancel(v);for(const A of this._rangeRequestReaders.slice(0))A.cancel(v)}}h.PDFNetworkStream=M;class m{constructor(v,A){this._manager=v;const w={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=A.url,this._fullRequestId=v.requestFull(w),this._headersReceivedCapability=new o.PromiseCapability,this._disableRange=A.disableRange||!1,this._contentLength=A.length,this._rangeChunkSize=A.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 v=this._fullRequestId,A=this._manager.getRequestXhr(v),w=p=>A.getResponseHeader(p),{allowRangeRequests:u,suggestedLength:c}=(0,T.validateRangeRequestCapabilities)({getResponseHeader:w,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});u&&(this._isRangeSupported=!0),this._contentLength=c||this._contentLength,this._filename=(0,T.extractFilenameFromHeader)(w),this._isRangeSupported&&this._manager.abortRequest(v),this._headersReceivedCapability.resolve()}_onDone(v){if(v&&(this._requests.length>0?this._requests.shift().resolve({value:v.chunk,done:!1}):this._cachedChunks.push(v.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const A of this._requests)A.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(v){this._storedError=(0,T.createResponseStatusError)(v,this._url),this._headersReceivedCapability.reject(this._storedError);for(const A of this._requests)A.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(v){this.onProgress?.({loaded:v.loaded,total:v.lengthComputable?v.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 v=new o.PromiseCapability;return this._requests.push(v),v.promise}cancel(v){this._done=!0,this._headersReceivedCapability.reject(v);for(const A of this._requests)A.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(v,A,w){this._manager=v;const u={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=v.url,this._requestId=v.requestRange(A,w,u),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(v){const A=v.chunk;this._requests.length>0?this._requests.shift().resolve({value:A,done:!1}):this._queuedChunk=A,this._done=!0;for(const w of this._requests)w.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(v){this._storedError=(0,T.createResponseStatusError)(v,this._url);for(const A of this._requests)A.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(v){this.isStreamingSupported||this.onProgress?.({loaded:v.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const A=this._queuedChunk;return this._queuedChunk=null,{value:A,done:!1}}if(this._done)return{value:void 0,done:!0};const v=new o.PromiseCapability;return this._requests.push(v),v.promise}cancel(v){this._done=!0;for(const A of this._requests)A.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(St,h,lt)=>{Object.defineProperty(h,"__esModule",{value:!0}),h.PDFNodeStream=void 0;var o=lt(1),T=lt(20);const ct=/^file:\/\/\/[a-zA-Z]:\//;function q(w){const u=require$$5,c=u.parse(w);return c.protocol==="file:"||c.host?c:/^[a-z]:[/\\]/i.test(w)?u.parse(`file:///${w}`):(c.host||(c.protocol="file:"),c)}class mt{constructor(u){this.source=u,this.url=q(u.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&u.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,o.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new v(this):new I(this),this._fullRequestReader}getRangeReader(u,c){if(c<=this._progressiveDataLength)return null;const p=this.isFsUrl?new A(this,u,c):new L(this,u,c);return this._rangeRequestReaders.push(p),p}cancelAllRequests(u){this._fullRequestReader?.cancel(u);for(const c of this._rangeRequestReaders.slice(0))c.cancel(u)}}h.PDFNodeStream=mt;class O{constructor(u){this._url=u.url,this._done=!1,this._storedError=null,this.onProgress=null;const c=u.source;this._contentLength=c.length,this._loaded=0,this._filename=null,this._disableRange=c.disableRange||!1,this._rangeChunkSize=c.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!c.disableStream,this._isRangeSupported=!c.disableRange,this._readableStream=null,this._readCapability=new o.PromiseCapability,this._headersCapability=new o.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(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const u=this._readableStream.read();return u===null?(this._readCapability=new o.PromiseCapability,this.read()):(this._loaded+=u.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(u).buffer,done:!1})}cancel(u){if(!this._readableStream){this._error(u);return}this._readableStream.destroy(u)}_error(u){this._storedError=u,this._readCapability.resolve()}_setReadableStream(u){this._readableStream=u,u.on("readable",()=>{this._readCapability.resolve()}),u.on("end",()=>{u.destroy(),this._done=!0,this._readCapability.resolve()}),u.on("error",c=>{this._error(c)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new o.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class M{constructor(u){this._url=u.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new o.PromiseCapability;const c=u.source;this._isStreamingSupported=!c.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const u=this._readableStream.read();return u===null?(this._readCapability=new o.PromiseCapability,this.read()):(this._loaded+=u.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(u).buffer,done:!1})}cancel(u){if(!this._readableStream){this._error(u);return}this._readableStream.destroy(u)}_error(u){this._storedError=u,this._readCapability.resolve()}_setReadableStream(u){this._readableStream=u,u.on("readable",()=>{this._readCapability.resolve()}),u.on("end",()=>{u.destroy(),this._done=!0,this._readCapability.resolve()}),u.on("error",c=>{this._error(c)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function m(w,u){return{protocol:w.protocol,auth:w.auth,host:w.hostname,port:w.port,path:w.path,method:"GET",headers:u}}class I extends O{constructor(u){super(u);const c=p=>{if(p.statusCode===404){const i=new o.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=i,this._headersCapability.reject(i);return}this._headersCapability.resolve(),this._setReadableStream(p);const x=i=>this._readableStream.headers[i.toLowerCase()],{allowRangeRequests:b,suggestedLength:r}=(0,T.validateRangeRequestCapabilities)({getResponseHeader:x,isHttp:u.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=b,this._contentLength=r||this._contentLength,this._filename=(0,T.extractFilenameFromHeader)(x)};if(this._request=null,this._url.protocol==="http:"){const p=require$$5;this._request=p.request(m(this._url,u.httpHeaders),c)}else{const p=require$$5;this._request=p.request(m(this._url,u.httpHeaders),c)}this._request.on("error",p=>{this._storedError=p,this._headersCapability.reject(p)}),this._request.end()}}class L extends M{constructor(u,c,p){super(u),this._httpHeaders={};for(const b in u.httpHeaders){const r=u.httpHeaders[b];r!==void 0&&(this._httpHeaders[b]=r)}this._httpHeaders.Range=`bytes=${c}-${p-1}`;const x=b=>{if(b.statusCode===404){const r=new o.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=r;return}this._setReadableStream(b)};if(this._request=null,this._url.protocol==="http:"){const b=require$$5;this._request=b.request(m(this._url,this._httpHeaders),x)}else{const b=require$$5;this._request=b.request(m(this._url,this._httpHeaders),x)}this._request.on("error",b=>{this._storedError=b}),this._request.end()}}class v extends O{constructor(u){super(u);let c=decodeURIComponent(this._url.path);ct.test(this._url.href)&&(c=c.replace(/^\//,""));const p=require$$5;p.lstat(c,(x,b)=>{if(x){x.code==="ENOENT"&&(x=new o.MissingPDFException(`Missing PDF "${c}".`)),this._storedError=x,this._headersCapability.reject(x);return}this._contentLength=b.size,this._setReadableStream(p.createReadStream(c)),this._headersCapability.resolve()})}}class A extends M{constructor(u,c,p){super(u);let x=decodeURIComponent(this._url.path);ct.test(this._url.href)&&(x=x.replace(/^\//,""));const b=require$$5;this._setReadableStream(b.createReadStream(x,{start:c,end:p-1}))}}},(St,h,lt)=>{Object.defineProperty(h,"__esModule",{value:!0}),h.SVGGraphics=void 0;var o=lt(6),T=lt(1);const ct={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},q="http://www.w3.org/XML/1998/namespace",mt="http://www.w3.org/1999/xlink",O=["butt","round","square"],M=["miter","round","bevel"],m=function(b,r="",i=!1){if(URL.createObjectURL&&typeof Blob<"u"&&!i)return URL.createObjectURL(new Blob([b],{type:r}));const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let g=`data:${r};base64,`;for(let l=0,W=b.length;l<W;l+=3){const a=b[l]&255,S=b[l+1]&255,N=b[l+2]&255,rt=a>>2,V=(a&3)<<4|S>>4,J=l+1<W?(S&15)<<2|N>>6:64,j=l+2<W?N&63:64;g+=e[rt]+e[V]+e[J]+e[j]}return g},I=function(){const b=new Uint8Array([137,80,78,71,13,10,26,10]),r=12,i=new Int32Array(256);for(let N=0;N<256;N++){let rt=N;for(let V=0;V<8;V++)rt=rt&1?3988292384^rt>>1&2147483647:rt>>1&2147483647;i[N]=rt}function e(N,rt,V){let J=-1;for(let j=rt;j<V;j++){const nt=(J^N[j])&255,R=i[nt];J=J>>>8^R}return J^-1}function g(N,rt,V,J){let j=J;const nt=rt.length;V[j]=nt>>24&255,V[j+1]=nt>>16&255,V[j+2]=nt>>8&255,V[j+3]=nt&255,j+=4,V[j]=N.charCodeAt(0)&255,V[j+1]=N.charCodeAt(1)&255,V[j+2]=N.charCodeAt(2)&255,V[j+3]=N.charCodeAt(3)&255,j+=4,V.set(rt,j),j+=rt.length;const R=e(V,J+4,j);V[j]=R>>24&255,V[j+1]=R>>16&255,V[j+2]=R>>8&255,V[j+3]=R&255}function l(N,rt,V){let J=1,j=0;for(let nt=rt;nt<V;++nt)J=(J+(N[nt]&255))%65521,j=(j+J)%65521;return j<<16|J}function W(N){if(!T.isNodeJS)return a(N);try{const rt=parseInt(process.versions.node)>=8?N:Buffer.from(N),V=require$$5.deflateSync(rt,{level:9});return V instanceof Uint8Array?V:new Uint8Array(V)}catch(rt){(0,T.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+rt)}return a(N)}function a(N){let rt=N.length;const V=65535,J=Math.ceil(rt/V),j=new Uint8Array(2+rt+J*5+4);let nt=0;j[nt++]=120,j[nt++]=156;let R=0;for(;rt>V;)j[nt++]=0,j[nt++]=255,j[nt++]=255,j[nt++]=0,j[nt++]=0,j.set(N.subarray(R,R+V),nt),nt+=V,R+=V,rt-=V;j[nt++]=1,j[nt++]=rt&255,j[nt++]=rt>>8&255,j[nt++]=~rt&65535&255,j[nt++]=(~rt&65535)>>8&255,j.set(N.subarray(R),nt),nt+=N.length-R;const G=l(N,0,N.length);return j[nt++]=G>>24&255,j[nt++]=G>>16&255,j[nt++]=G>>8&255,j[nt++]=G&255,j}function S(N,rt,V,J){const j=N.width,nt=N.height;let R,G,$;const y=N.data;switch(rt){case T.ImageKind.GRAYSCALE_1BPP:G=0,R=1,$=j+7>>3;break;case T.ImageKind.RGB_24BPP:G=2,R=8,$=j*3;break;case T.ImageKind.RGBA_32BPP:G=6,R=8,$=j*4;break;default:throw new Error("invalid format")}const s=new Uint8Array((1+$)*nt);let n=0,d=0;for(let ht=0;ht<nt;++ht)s[n++]=0,s.set(y.subarray(d,d+$),n),d+=$,n+=$;if(rt===T.ImageKind.GRAYSCALE_1BPP&&J){n=0;for(let ht=0;ht<nt;ht++){n++;for(let ut=0;ut<$;ut++)s[n++]^=255}}const C=new Uint8Array([j>>24&255,j>>16&255,j>>8&255,j&255,nt>>24&255,nt>>16&255,nt>>8&255,nt&255,R,G,0,0,0]),P=W(s),k=b.length+r*3+C.length+P.length,U=new Uint8Array(k);let et=0;return U.set(b,et),et+=b.length,g("IHDR",C,U,et),et+=r+C.length,g("IDATA",P,U,et),et+=r+P.length,g("IEND",new Uint8Array(0),U,et),m(U,"image/png",V)}return function(rt,V,J){const j=rt.kind===void 0?T.ImageKind.GRAYSCALE_1BPP:rt.kind;return S(rt,j,V,J)}}();class L{constructor(){this.fontSizeScale=1,this.fontWeight=ct.fontWeight,this.fontSize=0,this.textMatrix=T.IDENTITY_MATRIX,this.fontMatrix=T.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=T.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=ct.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,i){this.x=r,this.y=i}}function v(b){let r=[];const i=[];for(const e of b){if(e.fn==="save"){r.push({fnId:92,fn:"group",items:[]}),i.push(r),r=r.at(-1).items;continue}e.fn==="restore"?r=i.pop():r.push(e)}return r}function A(b){if(Number.isInteger(b))return b.toString();const r=b.toFixed(10);let i=r.length-1;if(r[i]!=="0")return r;do i--;while(r[i]==="0");return r.substring(0,r[i]==="."?i:i+1)}function w(b){if(b[4]===0&&b[5]===0){if(b[1]===0&&b[2]===0)return b[0]===1&&b[3]===1?"":`scale(${A(b[0])} ${A(b[3])})`;if(b[0]===b[3]&&b[1]===-b[2]){const r=Math.acos(b[0])*180/Math.PI;return`rotate(${A(r)})`}}else if(b[0]===1&&b[1]===0&&b[2]===0&&b[3]===1)return`translate(${A(b[4])} ${A(b[5])})`;return`matrix(${A(b[0])} ${A(b[1])} ${A(b[2])} ${A(b[3])} ${A(b[4])} ${A(b[5])})`}let u=0,c=0,p=0;class x{constructor(r,i,e=!1){(0,o.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new o.DOMSVGFactory,this.current=new L,this.transformMatrix=T.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=r,this.objs=i,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!e,this._operatorIdMapping=[];for(const g in T.OPS)this._operatorIdMapping[T.OPS[g]]=g}getObject(r,i=null){return typeof r=="string"?r.startsWith("g_")?this.commonObjs.get(r):this.objs.get(r):i}save(){this.transformStack.push(this.transformMatrix);const r=this.current;this.extraStack.push(r),this.current=r.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(r){this.save(),this.executeOpTree(r),this.restore()}loadDependencies(r){const i=r.fnArray,e=r.argsArray;for(let g=0,l=i.length;g<l;g++)if(i[g]===T.OPS.dependency)for(const W of e[g]){const a=W.startsWith("g_")?this.commonObjs:this.objs,S=new Promise(N=>{a.get(W,N)});this.current.dependencies.push(S)}return Promise.all(this.current.dependencies)}transform(r,i,e,g,l,W){const a=[r,i,e,g,l,W];this.transformMatrix=T.Util.transform(this.transformMatrix,a),this.tgrp=null}getSVG(r,i){this.viewport=i;const e=this._initialize(i);return this.loadDependencies(r).then(()=>(this.transformMatrix=T.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(r)),e))}convertOpList(r){const i=this._operatorIdMapping,e=r.argsArray,g=r.fnArray,l=[];for(let W=0,a=g.length;W<a;W++){const S=g[W];l.push({fnId:S,fn:i[S],args:e[W]})}return v(l)}executeOpTree(r){for(const i of r){const e=i.fn,g=i.fnId,l=i.args;switch(g|0){case T.OPS.beginText:this.beginText();break;case T.OPS.dependency:break;case T.OPS.setLeading:this.setLeading(l);break;case T.OPS.setLeadingMoveText:this.setLeadingMoveText(l[0],l[1]);break;case T.OPS.setFont:this.setFont(l);break;case T.OPS.showText:this.showText(l[0]);break;case T.OPS.showSpacedText:this.showText(l[0]);break;case T.OPS.endText:this.endText();break;case T.OPS.moveText:this.moveText(l[0],l[1]);break;case T.OPS.setCharSpacing:this.setCharSpacing(l[0]);break;case T.OPS.setWordSpacing:this.setWordSpacing(l[0]);break;case T.OPS.setHScale:this.setHScale(l[0]);break;case T.OPS.setTextMatrix:this.setTextMatrix(l[0],l[1],l[2],l[3],l[4],l[5]);break;case T.OPS.setTextRise:this.setTextRise(l[0]);break;case T.OPS.setTextRenderingMode:this.setTextRenderingMode(l[0]);break;case T.OPS.setLineWidth:this.setLineWidth(l[0]);break;case T.OPS.setLineJoin:this.setLineJoin(l[0]);break;case T.OPS.setLineCap:this.setLineCap(l[0]);break;case T.OPS.setMiterLimit:this.setMiterLimit(l[0]);break;case T.OPS.setFillRGBColor:this.setFillRGBColor(l[0],l[1],l[2]);break;case T.OPS.setStrokeRGBColor:this.setStrokeRGBColor(l[0],l[1],l[2]);break;case T.OPS.setStrokeColorN:this.setStrokeColorN(l);break;case T.OPS.setFillColorN:this.setFillColorN(l);break;case T.OPS.shadingFill:this.shadingFill(l[0]);break;case T.OPS.setDash:this.setDash(l[0],l[1]);break;case T.OPS.setRenderingIntent:this.setRenderingIntent(l[0]);break;case T.OPS.setFlatness:this.setFlatness(l[0]);break;case T.OPS.setGState:this.setGState(l[0]);break;case T.OPS.fill:this.fill();break;case T.OPS.eoFill:this.eoFill();break;case T.OPS.stroke:this.stroke();break;case T.OPS.fillStroke:this.fillStroke();break;case T.OPS.eoFillStroke:this.eoFillStroke();break;case T.OPS.clip:this.clip("nonzero");break;case T.OPS.eoClip:this.clip("evenodd");break;case T.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case T.OPS.paintImageXObject:this.paintImageXObject(l[0]);break;case T.OPS.paintInlineImageXObject:this.paintInlineImageXObject(l[0]);break;case T.OPS.paintImageMaskXObject:this.paintImageMaskXObject(l[0]);break;case T.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(l[0],l[1]);break;case T.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case T.OPS.closePath:this.closePath();break;case T.OPS.closeStroke:this.closeStroke();break;case T.OPS.closeFillStroke:this.closeFillStroke();break;case T.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case T.OPS.nextLine:this.nextLine();break;case T.OPS.transform:this.transform(l[0],l[1],l[2],l[3],l[4],l[5]);break;case T.OPS.constructPath:this.constructPath(l[0],l[1]);break;case T.OPS.endPath:this.endPath();break;case 92:this.group(i.items);break;default:(0,T.warn)(`Unimplemented operator ${e}`);break}}}setWordSpacing(r){this.current.wordSpacing=r}setCharSpacing(r){this.current.charSpacing=r}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(r,i,e,g,l,W){const a=this.current;a.textMatrix=a.lineMatrix=[r,i,e,g,l,W],a.textMatrixScale=Math.hypot(r,i),a.x=a.lineX=0,a.y=a.lineY=0,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",`${A(a.fontSize)}px`),a.tspan.setAttributeNS(null,"y",A(-a.y)),a.txtElement=this.svgFactory.createElement("svg:text"),a.txtElement.append(a.tspan)}beginText(){const r=this.current;r.x=r.lineX=0,r.y=r.lineY=0,r.textMatrix=T.IDENTITY_MATRIX,r.lineMatrix=T.IDENTITY_MATRIX,r.textMatrixScale=1,r.tspan=this.svgFactory.createElement("svg:tspan"),r.txtElement=this.svgFactory.createElement("svg:text"),r.txtgrp=this.svgFactory.createElement("svg:g"),r.xcoords=[],r.ycoords=[]}moveText(r,i){const e=this.current;e.x=e.lineX+=r,e.y=e.lineY+=i,e.xcoords=[],e.ycoords=[],e.tspan=this.svgFactory.createElement("svg:tspan"),e.tspan.setAttributeNS(null,"font-family",e.fontFamily),e.tspan.setAttributeNS(null,"font-size",`${A(e.fontSize)}px`),e.tspan.setAttributeNS(null,"y",A(-e.y))}showText(r){const i=this.current,e=i.font,g=i.fontSize;if(g===0)return;const l=i.fontSizeScale,W=i.charSpacing,a=i.wordSpacing,S=i.fontDirection,N=i.textHScale*S,rt=e.vertical,V=rt?1:-1,J=e.defaultVMetrics,j=g*i.fontMatrix[0];let nt=0;for(const $ of r){if($===null){nt+=S*a;continue}else if(typeof $=="number"){nt+=V*$*g/1e3;continue}const y=($.isSpace?a:0)+W,s=$.fontChar;let n,d,C=$.width;if(rt){let k;const U=$.vmetric||J;k=$.vmetric?U[1]:C*.5,k=-k*j;const et=U[2]*j;C=U?-U[0]:C,n=k/l,d=(nt+et)/l}else n=nt/l,d=0;($.isInFont||e.missingFile)&&(i.xcoords.push(i.x+n),rt&&i.ycoords.push(-i.y+d),i.tspan.textContent+=s);const P=rt?C*j-y*S:C*j+y*S;nt+=P}i.tspan.setAttributeNS(null,"x",i.xcoords.map(A).join(" ")),rt?i.tspan.setAttributeNS(null,"y",i.ycoords.map(A).join(" ")):i.tspan.setAttributeNS(null,"y",A(-i.y)),rt?i.y-=nt:i.x+=nt*N,i.tspan.setAttributeNS(null,"font-family",i.fontFamily),i.tspan.setAttributeNS(null,"font-size",`${A(i.fontSize)}px`),i.fontStyle!==ct.fontStyle&&i.tspan.setAttributeNS(null,"font-style",i.fontStyle),i.fontWeight!==ct.fontWeight&&i.tspan.setAttributeNS(null,"font-weight",i.fontWeight);const R=i.textRenderingMode&T.TextRenderingMode.FILL_STROKE_MASK;if(R===T.TextRenderingMode.FILL||R===T.TextRenderingMode.FILL_STROKE?(i.fillColor!==ct.fillColor&&i.tspan.setAttributeNS(null,"fill",i.fillColor),i.fillAlpha<1&&i.tspan.setAttributeNS(null,"fill-opacity",i.fillAlpha)):i.textRenderingMode===T.TextRenderingMode.ADD_TO_PATH?i.tspan.setAttributeNS(null,"fill","transparent"):i.tspan.setAttributeNS(null,"fill","none"),R===T.TextRenderingMode.STROKE||R===T.TextRenderingMode.FILL_STROKE){const $=1/(i.textMatrixScale||1);this._setStrokeAttributes(i.tspan,$)}let G=i.textMatrix;i.textRise!==0&&(G=G.slice(),G[5]+=i.textRise),i.txtElement.setAttributeNS(null,"transform",`${w(G)} scale(${A(N)}, -1)`),i.txtElement.setAttributeNS(q,"xml:space","preserve"),i.txtElement.append(i.tspan),i.txtgrp.append(i.txtElement),this._ensureTransformGroup().append(i.txtElement)}setLeadingMoveText(r,i){this.setLeading(-i),this.moveText(r,i)}addFontStyle(r){if(!r.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 i=m(r.data,r.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${r.loadedName}"; src: url(${i}); } `}setFont(r){const i=this.current,e=this.commonObjs.get(r[0]);let g=r[1];i.font=e,this.embedFonts&&!e.missingFile&&!this.embeddedFonts[e.loadedName]&&(this.addFontStyle(e),this.embeddedFonts[e.loadedName]=e),i.fontMatrix=e.fontMatrix||T.FONT_IDENTITY_MATRIX;let l="normal";e.black?l="900":e.bold&&(l="bold");const W=e.italic?"italic":"normal";g<0?(g=-g,i.fontDirection=-1):i.fontDirection=1,i.fontSize=g,i.fontFamily=e.loadedName,i.fontWeight=l,i.fontStyle=W,i.tspan=this.svgFactory.createElement("svg:tspan"),i.tspan.setAttributeNS(null,"y",A(-i.y)),i.xcoords=[],i.ycoords=[]}endText(){const r=this.current;r.textRenderingMode&T.TextRenderingMode.ADD_TO_PATH_FLAG&&r.txtElement?.hasChildNodes()&&(r.element=r.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(r){r>0&&(this.current.lineWidth=r)}setLineCap(r){this.current.lineCap=O[r]}setLineJoin(r){this.current.lineJoin=M[r]}setMiterLimit(r){this.current.miterLimit=r}setStrokeAlpha(r){this.current.strokeAlpha=r}setStrokeRGBColor(r,i,e){this.current.strokeColor=T.Util.makeHexColor(r,i,e)}setFillAlpha(r){this.current.fillAlpha=r}setFillRGBColor(r,i,e){this.current.fillColor=T.Util.makeHexColor(r,i,e),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(r){this.current.strokeColor=this._makeColorN_Pattern(r)}setFillColorN(r){this.current.fillColor=this._makeColorN_Pattern(r)}shadingFill(r){const{width:i,height:e}=this.viewport,g=T.Util.inverseTransform(this.transformMatrix),[l,W,a,S]=T.Util.getAxialAlignedBoundingBox([0,0,i,e],g),N=this.svgFactory.createElement("svg:rect");N.setAttributeNS(null,"x",l),N.setAttributeNS(null,"y",W),N.setAttributeNS(null,"width",a-l),N.setAttributeNS(null,"height",S-W),N.setAttributeNS(null,"fill",this._makeShadingPattern(r)),this.current.fillAlpha<1&&N.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(N)}_makeColorN_Pattern(r){return r[0]==="TilingPattern"?this._makeTilingPattern(r):this._makeShadingPattern(r)}_makeTilingPattern(r){const i=r[1],e=r[2],g=r[3]||T.IDENTITY_MATRIX,[l,W,a,S]=r[4],N=r[5],rt=r[6],V=r[7],J=`shading${p++}`,[j,nt,R,G]=T.Util.normalizeRect([...T.Util.applyTransform([l,W],g),...T.Util.applyTransform([a,S],g)]),[$,y]=T.Util.singularValueDecompose2dScale(g),s=N*$,n=rt*y,d=this.svgFactory.createElement("svg:pattern");d.setAttributeNS(null,"id",J),d.setAttributeNS(null,"patternUnits","userSpaceOnUse"),d.setAttributeNS(null,"width",s),d.setAttributeNS(null,"height",n),d.setAttributeNS(null,"x",`${j}`),d.setAttributeNS(null,"y",`${nt}`);const C=this.svg,P=this.transformMatrix,k=this.current.fillColor,U=this.current.strokeColor,et=this.svgFactory.create(R-j,G-nt);if(this.svg=et,this.transformMatrix=g,V===2){const ht=T.Util.makeHexColor(...i);this.current.fillColor=ht,this.current.strokeColor=ht}return this.executeOpTree(this.convertOpList(e)),this.svg=C,this.transformMatrix=P,this.current.fillColor=k,this.current.strokeColor=U,d.append(et.childNodes[0]),this.defs.append(d),`url(#${J})`}_makeShadingPattern(r){switch(typeof r=="string"&&(r=this.objs.get(r)),r[0]){case"RadialAxial":const i=`shading${p++}`,e=r[3];let g;switch(r[1]){case"axial":const l=r[4],W=r[5];g=this.svgFactory.createElement("svg:linearGradient"),g.setAttributeNS(null,"id",i),g.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),g.setAttributeNS(null,"x1",l[0]),g.setAttributeNS(null,"y1",l[1]),g.setAttributeNS(null,"x2",W[0]),g.setAttributeNS(null,"y2",W[1]);break;case"radial":const a=r[4],S=r[5],N=r[6],rt=r[7];g=this.svgFactory.createElement("svg:radialGradient"),g.setAttributeNS(null,"id",i),g.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),g.setAttributeNS(null,"cx",S[0]),g.setAttributeNS(null,"cy",S[1]),g.setAttributeNS(null,"r",rt),g.setAttributeNS(null,"fx",a[0]),g.setAttributeNS(null,"fy",a[1]),g.setAttributeNS(null,"fr",N);break;default:throw new Error(`Unknown RadialAxial type: ${r[1]}`)}for(const l of e){const W=this.svgFactory.createElement("svg:stop");W.setAttributeNS(null,"offset",l[0]),W.setAttributeNS(null,"stop-color",l[1]),g.append(W)}return this.defs.append(g),`url(#${i})`;case"Mesh":return(0,T.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${r[0]}`)}}setDash(r,i){this.current.dashArray=r,this.current.dashPhase=i}constructPath(r,i){const e=this.current;let g=e.x,l=e.y,W=[],a=0;for(const S of r)switch(S|0){case T.OPS.rectangle:g=i[a++],l=i[a++];const N=i[a++],rt=i[a++],V=g+N,J=l+rt;W.push("M",A(g),A(l),"L",A(V),A(l),"L",A(V),A(J),"L",A(g),A(J),"Z");break;case T.OPS.moveTo:g=i[a++],l=i[a++],W.push("M",A(g),A(l));break;case T.OPS.lineTo:g=i[a++],l=i[a++],W.push("L",A(g),A(l));break;case T.OPS.curveTo:g=i[a+4],l=i[a+5],W.push("C",A(i[a]),A(i[a+1]),A(i[a+2]),A(i[a+3]),A(g),A(l)),a+=6;break;case T.OPS.curveTo2:W.push("C",A(g),A(l),A(i[a]),A(i[a+1]),A(i[a+2]),A(i[a+3])),g=i[a+2],l=i[a+3],a+=4;break;case T.OPS.curveTo3:g=i[a+2],l=i[a+3],W.push("C",A(i[a]),A(i[a+1]),A(g),A(l),A(g),A(l)),a+=4;break;case T.OPS.closePath:W.push("Z");break}W=W.join(" "),e.path&&r.length>0&&r[0]!==T.OPS.rectangle&&r[0]!==T.OPS.moveTo?W=e.path.getAttributeNS(null,"d")+W:(e.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(e.path)),e.path.setAttributeNS(null,"d",W),e.path.setAttributeNS(null,"fill","none"),e.element=e.path,e.setCurrentPoint(g,l)}endPath(){const r=this.current;if(r.path=null,!this.pendingClip)return;if(!r.element){this.pendingClip=null;return}const i=`clippath${u++}`,e=this.svgFactory.createElement("svg:clipPath");e.setAttributeNS(null,"id",i),e.setAttributeNS(null,"transform",w(this.transformMatrix));const g=r.element.cloneNode(!0);if(this.pendingClip==="evenodd"?g.setAttributeNS(null,"clip-rule","evenodd"):g.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,e.append(g),this.defs.append(e),r.activeClipUrl){r.clipGroup=null;for(const l of this.extraStack)l.clipGroup=null;e.setAttributeNS(null,"clip-path",r.activeClipUrl)}r.activeClipUrl=`url(#${i})`,this.tgrp=null}clip(r){this.pendingClip=r}closePath(){const r=this.current;if(r.path){const i=`${r.path.getAttributeNS(null,"d")}Z`;r.path.setAttributeNS(null,"d",i)}}setLeading(r){this.current.leading=-r}setTextRise(r){this.current.textRise=r}setTextRenderingMode(r){this.current.textRenderingMode=r}setHScale(r){this.current.textHScale=r/100}setRenderingIntent(r){}setFlatness(r){}setGState(r){for(const[i,e]of r)switch(i){case"LW":this.setLineWidth(e);break;case"LC":this.setLineCap(e);break;case"LJ":this.setLineJoin(e);break;case"ML":this.setMiterLimit(e);break;case"D":this.setDash(e[0],e[1]);break;case"RI":this.setRenderingIntent(e);break;case"FL":this.setFlatness(e);break;case"Font":this.setFont(e);break;case"CA":this.setStrokeAlpha(e);break;case"ca":this.setFillAlpha(e);break;default:(0,T.warn)(`Unimplemented graphic state operator ${i}`);break}}fill(){const r=this.current;r.element&&(r.element.setAttributeNS(null,"fill",r.fillColor),r.element.setAttributeNS(null,"fill-opacity",r.fillAlpha),this.endPath())}stroke(){const r=this.current;r.element&&(this._setStrokeAttributes(r.element),r.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(r,i=1){const e=this.current;let g=e.dashArray;i!==1&&g.length>0&&(g=g.map(function(l){return i*l})),r.setAttributeNS(null,"stroke",e.strokeColor),r.setAttributeNS(null,"stroke-opacity",e.strokeAlpha),r.setAttributeNS(null,"stroke-miterlimit",A(e.miterLimit)),r.setAttributeNS(null,"stroke-linecap",e.lineCap),r.setAttributeNS(null,"stroke-linejoin",e.lineJoin),r.setAttributeNS(null,"stroke-width",A(i*e.lineWidth)+"px"),r.setAttributeNS(null,"stroke-dasharray",g.map(A).join(" ")),r.setAttributeNS(null,"stroke-dashoffset",A(i*e.dashPhase)+"px")}eoFill(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const r=this.svgFactory.createElement("svg:rect");r.setAttributeNS(null,"x","0"),r.setAttributeNS(null,"y","0"),r.setAttributeNS(null,"width","1px"),r.setAttributeNS(null,"height","1px"),r.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(r)}paintImageXObject(r){const i=this.getObject(r);if(!i){(0,T.warn)(`Dependent image with object ID ${r} is not ready yet`);return}this.paintInlineImageXObject(i)}paintInlineImageXObject(r,i){const e=r.width,g=r.height,l=I(r,this.forceDataSchema,!!i),W=this.svgFactory.createElement("svg:rect");W.setAttributeNS(null,"x","0"),W.setAttributeNS(null,"y","0"),W.setAttributeNS(null,"width",A(e)),W.setAttributeNS(null,"height",A(g)),this.current.element=W,this.clip("nonzero");const a=this.svgFactory.createElement("svg:image");a.setAttributeNS(mt,"xlink:href",l),a.setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y",A(-g)),a.setAttributeNS(null,"width",A(e)+"px"),a.setAttributeNS(null,"height",A(g)+"px"),a.setAttributeNS(null,"transform",`scale(${A(1/e)} ${A(-1/g)})`),i?i.append(a):this._ensureTransformGroup().append(a)}paintImageMaskXObject(r){const i=this.getObject(r.data,r);if(i.bitmap){(0,T.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const e=this.current,g=i.width,l=i.height,W=e.fillColor;e.maskId=`mask${c++}`;const a=this.svgFactory.createElement("svg:mask");a.setAttributeNS(null,"id",e.maskId);const S=this.svgFactory.createElement("svg:rect");S.setAttributeNS(null,"x","0"),S.setAttributeNS(null,"y","0"),S.setAttributeNS(null,"width",A(g)),S.setAttributeNS(null,"height",A(l)),S.setAttributeNS(null,"fill",W),S.setAttributeNS(null,"mask",`url(#${e.maskId})`),this.defs.append(a),this._ensureTransformGroup().append(S),this.paintInlineImageXObject(i,a)}paintFormXObjectBegin(r,i){if(Array.isArray(r)&&r.length===6&&this.transform(r[0],r[1],r[2],r[3],r[4],r[5]),i){const e=i[2]-i[0],g=i[3]-i[1],l=this.svgFactory.createElement("svg:rect");l.setAttributeNS(null,"x",i[0]),l.setAttributeNS(null,"y",i[1]),l.setAttributeNS(null,"width",A(e)),l.setAttributeNS(null,"height",A(g)),this.current.element=l,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(r){const i=this.svgFactory.create(r.width,r.height),e=this.svgFactory.createElement("svg:defs");i.append(e),this.defs=e;const g=this.svgFactory.createElement("svg:g");return g.setAttributeNS(null,"transform",w(r.transform)),i.append(g),this.svg=g,i}_ensureClipGroup(){if(!this.current.clipGroup){const r=this.svgFactory.createElement("svg:g");r.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(r),this.current.clipGroup=r}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",w(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}h.SVGGraphics=x},(St,h)=>{Object.defineProperty(h,"__esModule",{value:!0}),h.XfaText=void 0;class lt{static textContent(T){const ct=[],q={items:ct,styles:Object.create(null)};function mt(O){if(!O)return;let M=null;const m=O.name;if(m==="#text")M=O.value;else if(lt.shouldBuildText(m))O?.attributes?.textContent?M=O.attributes.textContent:O.value&&(M=O.value);else return;if(M!==null&&ct.push({str:M}),!!O.children)for(const I of O.children)mt(I)}return mt(T),q}static shouldBuildText(T){return!(T==="textarea"||T==="input"||T==="option"||T==="select")}}h.XfaText=lt},(St,h,lt)=>{Object.defineProperty(h,"__esModule",{value:!0}),h.TextLayerRenderTask=void 0,h.renderTextLayer=w,h.updateTextLayer=u;var o=lt(1),T=lt(6);const ct=1e5,q=30,mt=.8,O=new Map;function M(c,p){let x;if(p&&o.FeatureTest.isOffscreenCanvasSupported)x=new OffscreenCanvas(c,c).getContext("2d",{alpha:!1});else{const b=document.createElement("canvas");b.width=b.height=c,x=b.getContext("2d",{alpha:!1})}return x}function m(c,p){const x=O.get(c);if(x)return x;const b=M(q,p);b.font=`${q}px ${c}`;const r=b.measureText("");let i=r.fontBoundingBoxAscent,e=Math.abs(r.fontBoundingBoxDescent);if(i){const l=i/(i+e);return O.set(c,l),b.canvas.width=b.canvas.height=0,l}b.strokeStyle="red",b.clearRect(0,0,q,q),b.strokeText("g",0,0);let g=b.getImageData(0,0,q,q).data;e=0;for(let l=g.length-1-3;l>=0;l-=4)if(g[l]>0){e=Math.ceil(l/4/q);break}b.clearRect(0,0,q,q),b.strokeText("A",0,q),g=b.getImageData(0,0,q,q).data,i=0;for(let l=0,W=g.length;l<W;l+=4)if(g[l]>0){i=q-Math.floor(l/4/q);break}if(b.canvas.width=b.canvas.height=0,i){const l=i/(i+e);return O.set(c,l),l}return O.set(c,mt),mt}function I(c,p,x){const b=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:p.str!=="",hasEOL:p.hasEOL,fontSize:0};c._textDivs.push(b);const i=o.Util.transform(c._transform,p.transform);let e=Math.atan2(i[1],i[0]);const g=x[p.fontName];g.vertical&&(e+=Math.PI/2);const l=Math.hypot(i[2],i[3]),W=l*m(g.fontFamily,c._isOffscreenCanvasSupported);let a,S;e===0?(a=i[4],S=i[5]-W):(a=i[4]+W*Math.sin(e),S=i[5]-W*Math.cos(e));const N="calc(var(--scale-factor)*",rt=b.style;c._container===c._rootContainer?(rt.left=`${(100*a/c._pageWidth).toFixed(2)}%`,rt.top=`${(100*S/c._pageHeight).toFixed(2)}%`):(rt.left=`${N}${a.toFixed(2)}px)`,rt.top=`${N}${S.toFixed(2)}px)`),rt.fontSize=`${N}${l.toFixed(2)}px)`,rt.fontFamily=g.fontFamily,r.fontSize=l,b.setAttribute("role","presentation"),b.textContent=p.str,b.dir=p.dir,c._fontInspectorEnabled&&(b.dataset.fontName=p.fontName),e!==0&&(r.angle=e*(180/Math.PI));let V=!1;if(p.str.length>1)V=!0;else if(p.str!==" "&&p.transform[0]!==p.transform[3]){const J=Math.abs(p.transform[0]),j=Math.abs(p.transform[3]);J!==j&&Math.max(J,j)/Math.min(J,j)>1.5&&(V=!0)}V&&(r.canvasWidth=g.vertical?p.height:p.width),c._textDivProperties.set(b,r),c._isReadableStream&&c._layoutText(b)}function L(c){const{div:p,scale:x,properties:b,ctx:r,prevFontSize:i,prevFontFamily:e}=c,{style:g}=p;let l="";if(b.canvasWidth!==0&&b.hasText){const{fontFamily:W}=g,{canvasWidth:a,fontSize:S}=b;(i!==S||e!==W)&&(r.font=`${S*x}px ${W}`,c.prevFontSize=S,c.prevFontFamily=W);const{width:N}=r.measureText(p.textContent);N>0&&(l=`scaleX(${a*x/N})`)}b.angle!==0&&(l=`rotate(${b.angle}deg) ${l}`),l.length>0&&(g.transform=l)}function v(c){if(c._canceled)return;const p=c._textDivs,x=c._capability;if(p.length>ct){x.resolve();return}if(!c._isReadableStream)for(const r of p)c._layoutText(r);x.resolve()}class A{constructor({textContentSource:p,container:x,viewport:b,textDivs:r,textDivProperties:i,textContentItemsStr:e,isOffscreenCanvasSupported:g}){this._textContentSource=p,this._isReadableStream=p instanceof ReadableStream,this._container=this._rootContainer=x,this._textDivs=r||[],this._textContentItemsStr=e||[],this._isOffscreenCanvasSupported=g,this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled,this._reader=null,this._textDivProperties=i||new WeakMap,this._canceled=!1,this._capability=new o.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:b.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:M(0,g)};const{pageWidth:l,pageHeight:W,pageX:a,pageY:S}=b.rawDims;this._transform=[1,0,0,-1,-a,S+W],this._pageWidth=l,this._pageHeight=W,(0,T.setLayerDimensions)(x,b),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new o.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new o.AbortException("TextLayer task cancelled."))}_processItems(p,x){for(const b of p){if(b.str===void 0){if(b.type==="beginMarkedContentProps"||b.type==="beginMarkedContent"){const r=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),b.id!==null&&this._container.setAttribute("id",`${b.id}`),r.append(this._container)}else b.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(b.str),I(this,b,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 b=document.createElement("br");b.setAttribute("role","presentation"),this._container.append(b)}}_render(){const p=new o.PromiseCapability;let x=Object.create(null);if(this._isReadableStream){const b=()=>{this._reader.read().then(({value:r,done:i})=>{if(i){p.resolve();return}Object.assign(x,r.styles),this._processItems(r.items,x),b()},p.reject)};this._reader=this._textContentSource.getReader(),b()}else if(this._textContentSource){const{items:b,styles:r}=this._textContentSource;this._processItems(b,r),p.resolve()}else throw new Error('No "textContentSource" parameter specified.');p.promise.then(()=>{x=null,v(this)},this._capability.reject)}}h.TextLayerRenderTask=A;function w(c){!c.textContentSource&&(c.textContent||c.textContentStream)&&((0,T.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),c.textContentSource=c.textContent||c.textContentStream);const{container:p,viewport:x}=c,b=getComputedStyle(p),r=b.getPropertyValue("visibility"),i=parseFloat(b.getPropertyValue("--scale-factor"));r==="visible"&&(!i||Math.abs(i-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 e=new A(c);return e._render(),e}function u({container:c,viewport:p,textDivs:x,textDivProperties:b,isOffscreenCanvasSupported:r,mustRotate:i=!0,mustRescale:e=!0}){if(i&&(0,T.setLayerDimensions)(c,{rotation:p.rotation}),e){const g=M(0,r),W={prevFontSize:null,prevFontFamily:null,div:null,scale:p.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:g};for(const a of x)W.properties=b.get(a),W.div=a,L(W)}}},(St,h,lt)=>{var m,I,L,v,A,w,u,c,p,x,b,Ye,Ee,Ke,Je;Object.defineProperty(h,"__esModule",{value:!0}),h.AnnotationEditorLayer=void 0;var o=lt(1),T=lt(4),ct=lt(28),q=lt(33),mt=lt(6),O=lt(34);const l=class l{constructor({uiManager:a,pageIndex:S,div:N,accessibilityManager:rt,annotationLayer:V,viewport:J,l10n:j}){Z(this,b);Z(this,m);Z(this,I,!1);Z(this,L,null);Z(this,v,this.pointerup.bind(this));Z(this,A,this.pointerdown.bind(this));Z(this,w,new Map);Z(this,u,!1);Z(this,c,!1);Z(this,p,!1);Z(this,x);const nt=[ct.FreeTextEditor,q.InkEditor,O.StampEditor];if(!l._initialized){l._initialized=!0;for(const R of nt)R.initialize(j)}a.registerEditorTypes(nt),tt(this,x,a),this.pageIndex=S,this.div=N,tt(this,m,rt),tt(this,L,V),this.viewport=J,t(this,x).addLayer(this)}get isEmpty(){return t(this,w).size===0}updateToolbar(a){t(this,x).updateToolbar(a)}updateMode(a=t(this,x).getMode()){H(this,b,Je).call(this),a===o.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),a!==o.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",a===o.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",a===o.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",a===o.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(a){if(!a&&t(this,x).getMode()!==o.AnnotationEditorType.INK)return;if(!a){for(const N of t(this,w).values())if(N.isEmpty()){N.setInBackground();return}}H(this,b,Ee).call(this,{offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(a){t(this,x).setEditingState(a)}addCommands(a){t(this,x).addCommands(a)}enable(){this.div.style.pointerEvents="auto";const a=new Set;for(const N of t(this,w).values())N.enableEditing(),N.annotationElementId&&a.add(N.annotationElementId);if(!t(this,L))return;const S=t(this,L).getEditableAnnotations();for(const N of S){if(N.hide(),t(this,x).isDeletedAnnotationElement(N.data.id)||a.has(N.data.id))continue;const rt=this.deserialize(N);rt&&(this.addOrRebuild(rt),rt.enableEditing())}}disable(){tt(this,p,!0),this.div.style.pointerEvents="none";const a=new Set;for(const S of t(this,w).values()){if(S.disableEditing(),!S.annotationElementId||S.serialize()!==null){a.add(S.annotationElementId);continue}this.getEditableAnnotation(S.annotationElementId)?.show(),S.remove()}if(t(this,L)){const S=t(this,L).getEditableAnnotations();for(const N of S){const{id:rt}=N.data;a.has(rt)||t(this,x).isDeletedAnnotationElement(rt)||N.show()}}H(this,b,Je).call(this),this.isEmpty&&(this.div.hidden=!0),tt(this,p,!1)}getEditableAnnotation(a){return t(this,L)?.getEditableAnnotation(a)||null}setActiveEditor(a){t(this,x).getActive()!==a&&t(this,x).setActiveEditor(a)}enableClick(){this.div.addEventListener("pointerdown",t(this,A)),this.div.addEventListener("pointerup",t(this,v))}disableClick(){this.div.removeEventListener("pointerdown",t(this,A)),this.div.removeEventListener("pointerup",t(this,v))}attach(a){t(this,w).set(a.id,a);const{annotationElementId:S}=a;S&&t(this,x).isDeletedAnnotationElement(S)&&t(this,x).removeDeletedAnnotationElement(a)}detach(a){t(this,w).delete(a.id),t(this,m)?.removePointerInTextLayer(a.contentDiv),!t(this,p)&&a.annotationElementId&&t(this,x).addDeletedAnnotationElement(a)}remove(a){this.detach(a),t(this,x).removeEditor(a),a.div.contains(document.activeElement)&&setTimeout(()=>{t(this,x).focusMainContainer()},0),a.div.remove(),a.isAttachedToDOM=!1,t(this,c)||this.addInkEditorIfNeeded(!1)}changeParent(a){a.parent!==this&&(a.annotationElementId&&(t(this,x).addDeletedAnnotationElement(a.annotationElementId),T.AnnotationEditor.deleteAnnotationElement(a),a.annotationElementId=null),this.attach(a),a.parent?.detach(a),a.setParent(this),a.div&&a.isAttachedToDOM&&(a.div.remove(),this.div.append(a.div)))}add(a){if(this.changeParent(a),t(this,x).addEditor(a),this.attach(a),!a.isAttachedToDOM){const S=a.render();this.div.append(S),a.isAttachedToDOM=!0}a.fixAndSetPosition(),a.onceAdded(),t(this,x).addToAnnotationStorage(a)}moveEditorInDOM(a){if(!a.isAttachedToDOM)return;const{activeElement:S}=document;a.div.contains(S)&&(a._focusEventsAllowed=!1,setTimeout(()=>{a.div.contains(document.activeElement)?a._focusEventsAllowed=!0:(a.div.addEventListener("focusin",()=>{a._focusEventsAllowed=!0},{once:!0}),S.focus())},0)),a._structTreeParentId=t(this,m)?.moveElementInDOM(this.div,a.div,a.contentDiv,!0)}addOrRebuild(a){a.needsToBeRebuilt()?a.rebuild():this.add(a)}addUndoableEditor(a){const S=()=>a._uiManager.rebuild(a),N=()=>{a.remove()};this.addCommands({cmd:S,undo:N,mustExec:!1})}getNextId(){return t(this,x).getId()}pasteEditor(a,S){t(this,x).updateToolbar(a),t(this,x).updateMode(a);const{offsetX:N,offsetY:rt}=H(this,b,Ke).call(this),V=this.getNextId(),J=H(this,b,Ye).call(this,{parent:this,id:V,x:N,y:rt,uiManager:t(this,x),isCentered:!0,...S});J&&this.add(J)}deserialize(a){switch(a.annotationType??a.annotationEditorType){case o.AnnotationEditorType.FREETEXT:return ct.FreeTextEditor.deserialize(a,this,t(this,x));case o.AnnotationEditorType.INK:return q.InkEditor.deserialize(a,this,t(this,x));case o.AnnotationEditorType.STAMP:return O.StampEditor.deserialize(a,this,t(this,x))}return null}addNewEditor(){H(this,b,Ee).call(this,H(this,b,Ke).call(this),!0)}setSelected(a){t(this,x).setSelected(a)}toggleSelected(a){t(this,x).toggleSelected(a)}isSelected(a){return t(this,x).isSelected(a)}unselect(a){t(this,x).unselect(a)}pointerup(a){const{isMac:S}=o.FeatureTest.platform;if(!(a.button!==0||a.ctrlKey&&S)&&a.target===this.div&&t(this,u)){if(tt(this,u,!1),!t(this,I)){tt(this,I,!0);return}if(t(this,x).getMode()===o.AnnotationEditorType.STAMP){t(this,x).unselectAll();return}H(this,b,Ee).call(this,a,!1)}}pointerdown(a){if(t(this,u)){tt(this,u,!1);return}const{isMac:S}=o.FeatureTest.platform;if(a.button!==0||a.ctrlKey&&S||a.target!==this.div)return;tt(this,u,!0);const N=t(this,x).getActive();tt(this,I,!N||N.isEmpty())}findNewParent(a,S,N){const rt=t(this,x).findParent(S,N);return rt===null||rt===this?!1:(rt.changeParent(a),!0)}destroy(){t(this,x).getActive()?.parent===this&&(t(this,x).commitOrRemove(),t(this,x).setActiveEditor(null));for(const a of t(this,w).values())t(this,m)?.removePointerInTextLayer(a.contentDiv),a.setParent(null),a.isAttachedToDOM=!1,a.div.remove();this.div=null,t(this,w).clear(),t(this,x).removeLayer(this)}render({viewport:a}){this.viewport=a,(0,mt.setLayerDimensions)(this.div,a);for(const S of t(this,x).getEditors(this.pageIndex))this.add(S);this.updateMode()}update({viewport:a}){t(this,x).commitOrRemove(),this.viewport=a,(0,mt.setLayerDimensions)(this.div,{rotation:a.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:a,pageHeight:S}=this.viewport.rawDims;return[a,S]}};m=new WeakMap,I=new WeakMap,L=new WeakMap,v=new WeakMap,A=new WeakMap,w=new WeakMap,u=new WeakMap,c=new WeakMap,p=new WeakMap,x=new WeakMap,b=new WeakSet,Ye=function(a){switch(t(this,x).getMode()){case o.AnnotationEditorType.FREETEXT:return new ct.FreeTextEditor(a);case o.AnnotationEditorType.INK:return new q.InkEditor(a);case o.AnnotationEditorType.STAMP:return new O.StampEditor(a)}return null},Ee=function(a,S){const N=this.getNextId(),rt=H(this,b,Ye).call(this,{parent:this,id:N,x:a.offsetX,y:a.offsetY,uiManager:t(this,x),isCentered:S});return rt&&this.add(rt),rt},Ke=function(){const{x:a,y:S,width:N,height:rt}=this.div.getBoundingClientRect(),V=Math.max(0,a),J=Math.max(0,S),j=Math.min(window.innerWidth,a+N),nt=Math.min(window.innerHeight,S+rt),R=(V+j)/2-a,G=(J+nt)/2-S,[$,y]=this.viewport.rotation%180===0?[R,G]:[G,R];return{offsetX:$,offsetY:y}},Je=function(){tt(this,c,!0);for(const a of t(this,w).values())a.isEmpty()&&a.remove();tt(this,c,!1)},Yt(l,"_initialized",!1);let M=l;h.AnnotationEditorLayer=M},(St,h,lt)=>{var O,M,m,I,L,v,A,w,u,c,Ti,Pi,ki,pe,Qe,Fi,Ze;Object.defineProperty(h,"__esModule",{value:!0}),h.FreeTextEditor=void 0;var o=lt(1),T=lt(5),ct=lt(4),q=lt(29);const l=class l extends ct.AnnotationEditor{constructor(S){super({...S,name:"freeTextEditor"});Z(this,c);Z(this,O,this.editorDivBlur.bind(this));Z(this,M,this.editorDivFocus.bind(this));Z(this,m,this.editorDivInput.bind(this));Z(this,I,this.editorDivKeydown.bind(this));Z(this,L);Z(this,v,"");Z(this,A,`${this.id}-editor`);Z(this,w);Z(this,u,null);tt(this,L,S.color||l._defaultColor||ct.AnnotationEditor._defaultLineColor),tt(this,w,S.fontSize||l._defaultFontSize)}static get _keyboardManager(){const S=l.prototype,N=J=>J.isEmpty(),rt=T.AnnotationEditorUIManager.TRANSLATE_SMALL,V=T.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,o.shadow)(this,"_keyboardManager",new T.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],S.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],S.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],S._translateEmpty,{args:[-rt,0],checker:N}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],S._translateEmpty,{args:[-V,0],checker:N}],[["ArrowRight","mac+ArrowRight"],S._translateEmpty,{args:[rt,0],checker:N}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],S._translateEmpty,{args:[V,0],checker:N}],[["ArrowUp","mac+ArrowUp"],S._translateEmpty,{args:[0,-rt],checker:N}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],S._translateEmpty,{args:[0,-V],checker:N}],[["ArrowDown","mac+ArrowDown"],S._translateEmpty,{args:[0,rt],checker:N}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],S._translateEmpty,{args:[0,V],checker:N}]]))}static initialize(S){ct.AnnotationEditor.initialize(S,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});const N=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(N.getPropertyValue("--freetext-padding"))}static updateDefaultParams(S,N){switch(S){case o.AnnotationEditorParamsType.FREETEXT_SIZE:l._defaultFontSize=N;break;case o.AnnotationEditorParamsType.FREETEXT_COLOR:l._defaultColor=N;break}}updateParams(S,N){switch(S){case o.AnnotationEditorParamsType.FREETEXT_SIZE:H(this,c,Ti).call(this,N);break;case o.AnnotationEditorParamsType.FREETEXT_COLOR:H(this,c,Pi).call(this,N);break}}static get defaultPropertiesToUpdate(){return[[o.AnnotationEditorParamsType.FREETEXT_SIZE,l._defaultFontSize],[o.AnnotationEditorParamsType.FREETEXT_COLOR,l._defaultColor||ct.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[o.AnnotationEditorParamsType.FREETEXT_SIZE,t(this,w)],[o.AnnotationEditorParamsType.FREETEXT_COLOR,t(this,L)]]}_translateEmpty(S,N){this._uiManager.translateSelectedEditors(S,N,!0)}getInitialTranslation(){const S=this.parentScale;return[-l._internalPadding*S,-(l._internalPadding+t(this,w))*S]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(o.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",t(this,I)),this.editorDiv.addEventListener("focus",t(this,M)),this.editorDiv.addEventListener("blur",t(this,O)),this.editorDiv.addEventListener("input",t(this,m)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",t(this,A)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",t(this,I)),this.editorDiv.removeEventListener("focus",t(this,M)),this.editorDiv.removeEventListener("blur",t(this,O)),this.editorDiv.removeEventListener("input",t(this,m)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(S){this._focusEventsAllowed&&(super.focusin(S),S.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){if(this.width){H(this,c,Ze).call(this);return}this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const S=t(this,v),N=tt(this,v,H(this,c,ki).call(this).trimEnd());if(S===N)return;const rt=V=>{if(tt(this,v,V),!V){this.remove();return}H(this,c,Qe).call(this),this._uiManager.rebuild(this),H(this,c,pe).call(this)};this.addCommands({cmd:()=>{rt(N)},undo:()=>{rt(S)},mustExec:!1}),H(this,c,pe).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(S){this.enterInEditMode()}keydown(S){S.target===this.div&&S.key==="Enter"&&(this.enterInEditMode(),S.preventDefault())}editorDivKeydown(S){l._keyboardManager.exec(this,S)}editorDivFocus(S){this.isEditing=!0}editorDivBlur(S){this.isEditing=!1}editorDivInput(S){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 S,N;this.width&&(S=this.x,N=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",t(this,A)),this.enableEditing(),ct.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(V=>this.editorDiv?.setAttribute("aria-label",V)),ct.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(V=>this.editorDiv?.setAttribute("default-content",V)),this.editorDiv.contentEditable=!0;const{style:rt}=this.editorDiv;if(rt.fontSize=`calc(${t(this,w)}px * var(--scale-factor))`,rt.color=t(this,L),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,T.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[V,J]=this.parentDimensions;if(this.annotationElementId){const{position:j}=t(this,u);let[nt,R]=this.getInitialTranslation();[nt,R]=this.pageTranslationToScreen(nt,R);const[G,$]=this.pageDimensions,[y,s]=this.pageTranslation;let n,d;switch(this.rotation){case 0:n=S+(j[0]-y)/G,d=N+this.height-(j[1]-s)/$;break;case 90:n=S+(j[0]-y)/G,d=N-(j[1]-s)/$,[nt,R]=[R,-nt];break;case 180:n=S-this.width+(j[0]-y)/G,d=N-(j[1]-s)/$,[nt,R]=[-nt,-R];break;case 270:n=S+(j[0]-y-this.height*$)/G,d=N+(j[1]-s-this.width*G)/$,[nt,R]=[-R,nt];break}this.setAt(n*V,d*J,nt,R)}else this.setAt(S*V,N*J,this.width*V,this.height*J);H(this,c,Qe).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(S,N,rt){let V=null;if(S instanceof q.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:j,fontColor:nt},rect:R,rotation:G,id:$},textContent:y,textPosition:s,parent:{page:{pageNumber:n}}}=S;if(!y||y.length===0)return null;V=S={annotationType:o.AnnotationEditorType.FREETEXT,color:Array.from(nt),fontSize:j,value:y.join(` `),position:s,pageIndex:n-1,rect:R,rotation:G,id:$,deleted:!1}}const J=super.deserialize(S,N,rt);return tt(J,w,S.fontSize),tt(J,L,o.Util.makeHexColor(...S.color)),tt(J,v,S.value),J.annotationElementId=S.id||null,tt(J,u,V),J}serialize(S=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const N=l._internalPadding*this.parentScale,rt=this.getRect(N,N),V=ct.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:t(this,L)),J={annotationType:o.AnnotationEditorType.FREETEXT,color:V,fontSize:t(this,w),value:t(this,v),pageIndex:this.pageIndex,rect:rt,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return S?J:this.annotationElementId&&!H(this,c,Fi).call(this,J)?null:(J.id=this.annotationElementId,J)}};O=new WeakMap,M=new WeakMap,m=new WeakMap,I=new WeakMap,L=new WeakMap,v=new WeakMap,A=new WeakMap,w=new WeakMap,u=new WeakMap,c=new WeakSet,Ti=function(S){const N=V=>{this.editorDiv.style.fontSize=`calc(${V}px * var(--scale-factor))`,this.translate(0,-(V-t(this,w))*this.parentScale),tt(this,w,V),H(this,c,pe).call(this)},rt=t(this,w);this.addCommands({cmd:()=>{N(S)},undo:()=>{N(rt)},mustExec:!0,type:o.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},Pi=function(S){const N=t(this,L);this.addCommands({cmd:()=>{tt(this,L,this.editorDiv.style.color=S)},undo:()=>{tt(this,L,this.editorDiv.style.color=N)},mustExec:!0,type:o.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},ki=function(){const S=this.editorDiv.getElementsByTagName("div");if(S.length===0)return this.editorDiv.innerText;const N=[];for(const rt of S)N.push(rt.innerText.replace(/\r\n?|\n/,""));return N.join(` `)},pe=function(){const[S,N]=this.parentDimensions;let rt;if(this.isAttachedToDOM)rt=this.div.getBoundingClientRect();else{const{currentLayer:V,div:J}=this,j=J.style.display;J.style.display="hidden",V.div.append(this.div),rt=J.getBoundingClientRect(),J.remove(),J.style.display=j}this.rotation%180===this.parentRotation%180?(this.width=rt.width/S,this.height=rt.height/N):(this.width=rt.height/S,this.height=rt.width/N),this.fixAndSetPosition()},Qe=function(){if(this.editorDiv.replaceChildren(),!!t(this,v))for(const S of t(this,v).split(` `)){const N=document.createElement("div");N.append(S?document.createTextNode(S):document.createElement("br")),this.editorDiv.append(N)}},Fi=function(S){const{value:N,fontSize:rt,color:V,rect:J,pageIndex:j}=t(this,u);return S.value!==N||S.fontSize!==rt||S.rect.some((nt,R)=>Math.abs(nt-J[R])>=1)||S.color.some((nt,R)=>nt!==V[R])||S.pageIndex!==j},Ze=function(S=!1){if(!this.annotationElementId)return;if(H(this,c,pe).call(this),!S&&(this.width===0||this.height===0)){setTimeout(()=>H(this,c,Ze).call(this,!0),0);return}const N=l._internalPadding*this.parentScale;t(this,u).rect=this.getRect(N,N)},Yt(l,"_freeTextDefaultContent",""),Yt(l,"_internalPadding",0),Yt(l,"_defaultColor",null),Yt(l,"_defaultFontSize",10),Yt(l,"_type","freetext");let mt=l;h.FreeTextEditor=mt},(St,h,lt)=>{var d,P,ee,Mi,et,ht,ut,pt,bt,At,Y,K,f,F,z,Q,dt,_t,yt,X,wt,Ct,Ri,we,ti,ei,Ut,Gt,qt,vt,st,it,Mt,ii,Ht,D,gt,Tt,xi,si;Object.defineProperty(h,"__esModule",{value:!0}),h.StampAnnotationElement=h.InkAnnotationElement=h.FreeTextAnnotationElement=h.AnnotationLayer=void 0;var o=lt(1),T=lt(6),ct=lt(3),q=lt(30),mt=lt(31),O=lt(32);const M=1e3,m=9,I=new WeakSet;function L(Ft){return{width:Ft[2]-Ft[0],height:Ft[3]-Ft[1]}}class v{static create(E){switch(E.data.annotationType){case o.AnnotationType.LINK:return new w(E);case o.AnnotationType.TEXT:return new u(E);case o.AnnotationType.WIDGET:switch(E.data.fieldType){case"Tx":return new p(E);case"Btn":return E.data.radioButton?new r(E):E.data.checkBox?new b(E):new i(E);case"Ch":return new e(E);case"Sig":return new x(E)}return new c(E);case o.AnnotationType.POPUP:return new g(E);case o.AnnotationType.FREETEXT:return new W(E);case o.AnnotationType.LINE:return new a(E);case o.AnnotationType.SQUARE:return new S(E);case o.AnnotationType.CIRCLE:return new N(E);case o.AnnotationType.POLYLINE:return new rt(E);case o.AnnotationType.CARET:return new J(E);case o.AnnotationType.INK:return new j(E);case o.AnnotationType.POLYGON:return new V(E);case o.AnnotationType.HIGHLIGHT:return new nt(E);case o.AnnotationType.UNDERLINE:return new R(E);case o.AnnotationType.SQUIGGLY:return new G(E);case o.AnnotationType.STRIKEOUT:return new $(E);case o.AnnotationType.STAMP:return new y(E);case o.AnnotationType.FILEATTACHMENT:return new s(E);default:return new A(E)}}}const C=class C{constructor(E,{isRenderable:_=!1,ignoreBorder:B=!1,createQuadrilaterals:at=!1}={}){Z(this,d,!1);this.isRenderable=_,this.data=E.data,this.layer=E.layer,this.linkService=E.linkService,this.downloadManager=E.downloadManager,this.imageResourcesPath=E.imageResourcesPath,this.renderForms=E.renderForms,this.svgFactory=E.svgFactory,this.annotationStorage=E.annotationStorage,this.enableScripting=E.enableScripting,this.hasJSActions=E.hasJSActions,this._fieldObjects=E.fieldObjects,this.parent=E.parent,_&&(this.container=this._createContainer(B)),at&&this._createQuadrilaterals()}static _hasPopupData({titleObj:E,contentsObj:_,richText:B}){return!!(E?.str||_?.str||B?.str)}get hasPopupData(){return C._hasPopupData(this.data)}_createContainer(E){const{data:_,parent:{page:B,viewport:at}}=this,ot=document.createElement("section");ot.setAttribute("data-annotation-id",_.id),this instanceof c||(ot.tabIndex=M),ot.style.zIndex=this.parent.zIndex++,this.data.popupRef&&ot.setAttribute("aria-haspopup","dialog"),_.noRotate&&ot.classList.add("norotate");const{pageWidth:ft,pageHeight:Et,pageX:Pt,pageY:Ot}=at.rawDims;if(!_.rect||this instanceof g){const{rotation:Wt}=_;return!_.hasOwnCanvas&&Wt!==0&&this.setRotation(Wt,ot),ot}const{width:It,height:kt}=L(_.rect),xt=o.Util.normalizeRect([_.rect[0],B.view[3]-_.rect[1]+B.view[1],_.rect[2],B.view[3]-_.rect[3]+B.view[1]]);if(!E&&_.borderStyle.width>0){ot.style.borderWidth=`${_.borderStyle.width}px`;const Wt=_.borderStyle.horizontalCornerRadius,$t=_.borderStyle.verticalCornerRadius;if(Wt>0||$t>0){const Kt=`calc(${Wt}px * var(--scale-factor)) / calc(${$t}px * var(--scale-factor))`;ot.style.borderRadius=Kt}else if(this instanceof r){const Kt=`calc(${It}px * var(--scale-factor)) / calc(${kt}px * var(--scale-factor))`;ot.style.borderRadius=Kt}switch(_.borderStyle.style){case o.AnnotationBorderStyleType.SOLID:ot.style.borderStyle="solid";break;case o.AnnotationBorderStyleType.DASHED:ot.style.borderStyle="dashed";break;case o.AnnotationBorderStyleType.BEVELED:(0,o.warn)("Unimplemented border style: beveled");break;case o.AnnotationBorderStyleType.INSET:(0,o.warn)("Unimplemented border style: inset");break;case o.AnnotationBorderStyleType.UNDERLINE:ot.style.borderBottomStyle="solid";break}const Vt=_.borderColor||null;Vt?(tt(this,d,!0),ot.style.borderColor=o.Util.makeHexColor(Vt[0]|0,Vt[1]|0,Vt[2]|0)):ot.style.borderWidth=0}ot.style.left=`${100*(xt[0]-Pt)/ft}%`,ot.style.top=`${100*(xt[1]-Ot)/Et}%`;const{rotation:Nt}=_;return _.hasOwnCanvas||Nt===0?(ot.style.width=`${100*It/ft}%`,ot.style.height=`${100*kt/Et}%`):this.setRotation(Nt,ot),ot}setRotation(E,_=this.container){if(!this.data.rect)return;const{pageWidth:B,pageHeight:at}=this.parent.viewport.rawDims,{width:ot,height:ft}=L(this.data.rect);let Et,Pt;E%180===0?(Et=100*ot/B,Pt=100*ft/at):(Et=100*ft/B,Pt=100*ot/at),_.style.width=`${Et}%`,_.style.height=`${Pt}%`,_.setAttribute("data-main-rotation",(360-E)%360)}get _commonActions(){const E=(_,B,at)=>{const ot=at.detail[_],ft=ot[0],Et=ot.slice(1);at.target.style[B]=q.ColorConverters[`${ft}_HTML`](Et),this.annotationStorage.setValue(this.data.id,{[B]:q.ColorConverters[`${ft}_rgb`](Et)})};return(0,o.shadow)(this,"_commonActions",{display:_=>{const{display:B}=_.detail,at=B%2===1;this.container.style.visibility=at?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:at,noPrint:B===1||B===2})},print:_=>{this.annotationStorage.setValue(this.data.id,{noPrint:!_.detail.print})},hidden:_=>{const{hidden:B}=_.detail;this.container.style.visibility=B?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:B,noView:B})},focus:_=>{setTimeout(()=>_.target.focus({preventScroll:!1}),0)},userName:_=>{_.target.title=_.detail.userName},readonly:_=>{_.target.disabled=_.detail.readonly},required:_=>{this._setRequired(_.target,_.detail.required)},bgColor:_=>{E("bgColor","backgroundColor",_)},fillColor:_=>{E("fillColor","backgroundColor",_)},fgColor:_=>{E("fgColor","color",_)},textColor:_=>{E("textColor","color",_)},borderColor:_=>{E("borderColor","borderColor",_)},strokeColor:_=>{E("strokeColor","borderColor",_)},rotation:_=>{const B=_.detail.rotation;this.setRotation(B),this.annotationStorage.setValue(this.data.id,{rotation:B})}})}_dispatchEventFromSandbox(E,_){const B=this._commonActions;for(const at of Object.keys(_.detail))(E[at]||B[at])?.(_)}_setDefaultPropertiesFromJS(E){if(!this.enableScripting)return;const _=this.annotationStorage.getRawValue(this.data.id);if(!_)return;const B=this._commonActions;for(const[at,ot]of Object.entries(_)){const ft=B[at];if(ft){const Et={detail:{[at]:ot},target:E};ft(Et),delete _[at]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:E}=this.data;if(!E)return;const[_,B,at,ot]=this.data.rect;if(E.length===1){const[,{x:$t,y:Vt},{x:Kt,y:Zt}]=E[0];if(at===$t&&ot===Vt&&_===Kt&&B===Zt)return}const{style:ft}=this.container;let Et;if(t(this,d)){const{borderColor:$t,borderWidth:Vt}=ft;ft.borderWidth=0,Et=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${$t}" stroke-width="${Vt}">`],this.container.classList.add("hasBorder")}const Pt=at-_,Ot=ot-B,{svgFactory:It}=this,kt=It.createElement("svg");kt.classList.add("quadrilateralsContainer"),kt.setAttribute("width",0),kt.setAttribute("height",0);const xt=It.createElement("defs");kt.append(xt);const Nt=It.createElement("clipPath"),Wt=`clippath_${this.data.id}`;Nt.setAttribute("id",Wt),Nt.setAttribute("clipPathUnits","objectBoundingBox"),xt.append(Nt);for(const[,{x:$t,y:Vt},{x:Kt,y:Zt}]of E){const Jt=It.createElement("rect"),oe=(Kt-_)/Pt,le=(ot-Vt)/Ot,ui=($t-Kt)/Pt,fi=(Vt-Zt)/Ot;Jt.setAttribute("x",oe),Jt.setAttribute("y",le),Jt.setAttribute("width",ui),Jt.setAttribute("height",fi),Nt.append(Jt),Et?.push(`<rect vector-effect="non-scaling-stroke" x="${oe}" y="${le}" width="${ui}" height="${fi}"/>`)}t(this,d)&&(Et.push("</g></svg>')"),ft.backgroundImage=Et.join("")),this.container.append(kt),this.container.style.clipPath=`url(#${Wt})`}_createPopup(){const{container:E,data:_}=this;E.setAttribute("aria-haspopup","dialog");const B=new g({data:{color:_.color,titleObj:_.titleObj,modificationDate:_.modificationDate,contentsObj:_.contentsObj,richText:_.richText,parentRect:_.rect,borderStyle:0,id:`popup_${_.id}`,rotation:_.rotation},parent:this.parent,elements:[this]});this.parent.div.append(B.render())}render(){(0,o.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(E,_=null){const B=[];if(this._fieldObjects){const at=this._fieldObjects[E];if(at)for(const{page:ot,id:ft,exportValues:Et}of at){if(ot===-1||ft===_)continue;const Pt=typeof Et=="string"?Et:null,Ot=document.querySelector(`[data-element-id="${ft}"]`);if(Ot&&!I.has(Ot)){(0,o.warn)(`_getElementsByName - element not allowed: ${ft}`);continue}B.push({id:ft,exportValue:Pt,domElement:Ot})}return B}for(const at of document.getElementsByName(E)){const{exportValue:ot}=at,ft=at.getAttribute("data-element-id");ft!==_&&I.has(at)&&B.push({id:ft,exportValue:ot,domElement:at})}return B}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const E=this.getElementsToTriggerPopup();if(Array.isArray(E))for(const _ of E)_.classList.add("highlightArea");else E.classList.add("highlightArea")}_editOnDoubleClick(){const{annotationEditorType:E,data:{id:_}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:E,editId:_})})}};d=new WeakMap;let A=C;class w extends A{constructor(_,B=null){super(_,{isRenderable:!0,ignoreBorder:!!B?.ignoreBorder,createQuadrilaterals:!0});Z(this,P);this.isTooltipOnly=_.data.isTooltipOnly}render(){const{data:_,linkService:B}=this,at=document.createElement("a");at.setAttribute("data-element-id",_.id);let ot=!1;return _.url?(B.addLinkAttributes(at,_.url,_.newWindow),ot=!0):_.action?(this._bindNamedAction(at,_.action),ot=!0):_.attachment?(this._bindAttachment(at,_.attachment),ot=!0):_.setOCGState?(H(this,P,Mi).call(this,at,_.setOCGState),ot=!0):_.dest?(this._bindLink(at,_.dest),ot=!0):(_.actions&&(_.actions.Action||_.actions["Mouse Up"]||_.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(at,_),ot=!0),_.resetForm?(this._bindResetFormAction(at,_.resetForm),ot=!0):this.isTooltipOnly&&!ot&&(this._bindLink(at,""),ot=!0)),this.container.classList.add("linkAnnotation"),ot&&this.container.append(at),this.container}_bindLink(_,B){_.href=this.linkService.getDestinationHash(B),_.onclick=()=>(B&&this.linkService.goToDestination(B),!1),(B||B==="")&&H(this,P,ee).call(this)}_bindNamedAction(_,B){_.href=this.linkService.getAnchorUrl(""),_.onclick=()=>(this.linkService.executeNamedAction(B),!1),H(this,P,ee).call(this)}_bindAttachment(_,B){_.href=this.linkService.getAnchorUrl(""),_.onclick=()=>(this.downloadManager?.openOrDownloadData(this.container,B.content,B.filename),!1),H(this,P,ee).call(this)}_bindJSAction(_,B){_.href=this.linkService.getAnchorUrl("");const at=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const ot of Object.keys(B.actions)){const ft=at.get(ot);ft&&(_[ft]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:B.id,name:ot}}),!1))}_.onclick||(_.onclick=()=>!1),H(this,P,ee).call(this)}_bindResetFormAction(_,B){const at=_.onclick;if(at||(_.href=this.linkService.getAnchorUrl("")),H(this,P,ee).call(this),!this._fieldObjects){(0,o.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),at||(_.onclick=()=>!1);return}_.onclick=()=>{at?.();const{fields:ot,refs:ft,include:Et}=B,Pt=[];if(ot.length!==0||ft.length!==0){const kt=new Set(ft);for(const xt of ot){const Nt=this._fieldObjects[xt]||[];for(const{id:Wt}of Nt)kt.add(Wt)}for(const xt of Object.values(this._fieldObjects))for(const Nt of xt)kt.has(Nt.id)===Et&&Pt.push(Nt)}else for(const kt of Object.values(this._fieldObjects))Pt.push(...kt);const Ot=this.annotationStorage,It=[];for(const kt of Pt){const{id:xt}=kt;switch(It.push(xt),kt.type){case"text":{const Wt=kt.defaultValue||"";Ot.setValue(xt,{value:Wt});break}case"checkbox":case"radiobutton":{const Wt=kt.defaultValue===kt.exportValues;Ot.setValue(xt,{value:Wt});break}case"combobox":case"listbox":{const Wt=kt.defaultValue||"";Ot.setValue(xt,{value:Wt});break}default:continue}const Nt=document.querySelector(`[data-element-id="${xt}"]`);if(Nt){if(!I.has(Nt)){(0,o.warn)(`_bindResetFormAction - element not allowed: ${xt}`);continue}}else continue;Nt.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:It,name:"ResetForm"}}),!1}}}P=new WeakSet,ee=function(){this.container.setAttribute("data-internal-link","")},Mi=function(_,B){_.href=this.linkService.getAnchorUrl(""),_.onclick=()=>(this.linkService.executeSetOCGState(B),!1),H(this,P,ee).call(this)};class u extends A{constructor(E){super(E,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const E=document.createElement("img");return E.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",E.alt="[{{type}} Annotation]",E.dataset.l10nId="text_annotation_type",E.dataset.l10nArgs=JSON.stringify({type:this.data.name}),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(E),this.container}}class c extends A{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(E){this.data.hasOwnCanvas&&(E.previousSibling?.nodeName==="CANVAS"&&(E.previousSibling.hidden=!0),E.hidden=!1)}_getKeyModifier(E){const{isWin:_,isMac:B}=o.FeatureTest.platform;return _&&E.ctrlKey||B&&E.metaKey}_setEventListener(E,_,B,at,ot){B.includes("mouse")?E.addEventListener(B,ft=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:at,value:ot(ft),shift:ft.shiftKey,modifier:this._getKeyModifier(ft)}})}):E.addEventListener(B,ft=>{if(B==="blur"){if(!_.focused||!ft.relatedTarget)return;_.focused=!1}else if(B==="focus"){if(_.focused)return;_.focused=!0}ot&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:at,value:ot(ft)}})})}_setEventListeners(E,_,B,at){for(const[ot,ft]of B)(ft==="Action"||this.data.actions?.[ft])&&((ft==="Focus"||ft==="Blur")&&(_||(_={focused:!1})),this._setEventListener(E,_,ot,ft,at),ft==="Focus"&&!this.data.actions?.Blur?this._setEventListener(E,_,"blur","Blur",null):ft==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(E,_,"focus","Focus",null))}_setBackgroundColor(E){const _=this.data.backgroundColor||null;E.style.backgroundColor=_===null?"transparent":o.Util.makeHexColor(_[0],_[1],_[2])}_setTextStyle(E){const _=["left","center","right"],{fontColor:B}=this.data.defaultAppearanceData,at=this.data.defaultAppearanceData.fontSize||m,ot=E.style;let ft;const Et=2,Pt=Ot=>Math.round(10*Ot)/10;if(this.data.multiLine){const Ot=Math.abs(this.data.rect[3]-this.data.rect[1]-Et),It=Math.round(Ot/(o.LINE_FACTOR*at))||1,kt=Ot/It;ft=Math.min(at,Pt(kt/o.LINE_FACTOR))}else{const Ot=Math.abs(this.data.rect[3]-this.data.rect[1]-Et);ft=Math.min(at,Pt(Ot/o.LINE_FACTOR))}ot.fontSize=`calc(${ft}px * var(--scale-factor))`,ot.color=o.Util.makeHexColor(B[0],B[1],B[2]),this.data.textAlignment!==null&&(ot.textAlign=_[this.data.textAlignment])}_setRequired(E,_){_?E.setAttribute("required",!0):E.removeAttribute("required"),E.setAttribute("aria-required",_)}}class p extends c{constructor(E){const _=E.renderForms||!E.data.hasAppearance&&!!E.data.fieldValue;super(E,{isRenderable:_})}setPropertyOnSiblings(E,_,B,at){const ot=this.annotationStorage;for(const ft of this._getElementsByName(E.name,E.id))ft.domElement&&(ft.domElement[_]=B),ot.setValue(ft.id,{[at]:B})}render(){const E=this.annotationStorage,_=this.data.id;this.container.classList.add("textWidgetAnnotation");let B=null;if(this.renderForms){const at=E.getValue(_,{value:this.data.fieldValue});let ot=at.value||"";const ft=E.getValue(_,{charLimit:this.data.maxLen}).charLimit;ft&&ot.length>ft&&(ot=ot.slice(0,ft));let Et=at.formattedValue||this.data.textContent?.join(` `)||null;Et&&this.data.comb&&(Et=Et.replaceAll(/\s+/g,""));const Pt={userValue:ot,formattedValue:Et,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(B=document.createElement("textarea"),B.textContent=Et??ot,this.data.doNotScroll&&(B.style.overflowY="hidden")):(B=document.createElement("input"),B.type="text",B.setAttribute("value",Et??ot),this.data.doNotScroll&&(B.style.overflowX="hidden")),this.data.hasOwnCanvas&&(B.hidden=!0),I.add(B),B.setAttribute("data-element-id",_),B.disabled=this.data.readOnly,B.name=this.data.fieldName,B.tabIndex=M,this._setRequired(B,this.data.required),ft&&(B.maxLength=ft),B.addEventListener("input",It=>{E.setValue(_,{value:It.target.value}),this.setPropertyOnSiblings(B,"value",It.target.value,"value"),Pt.formattedValue=null}),B.addEventListener("resetform",It=>{const kt=this.data.defaultFieldValue??"";B.value=Pt.userValue=kt,Pt.formattedValue=null});let Ot=It=>{const{formattedValue:kt}=Pt;kt!=null&&(It.target.value=kt),It.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){B.addEventListener("focus",kt=>{if(Pt.focused)return;const{target:xt}=kt;Pt.userValue&&(xt.value=Pt.userValue),Pt.lastCommittedValue=xt.value,Pt.commitKey=1,Pt.focused=!0}),B.addEventListener("updatefromsandbox",kt=>{this.showElementAndHideCanvas(kt.target);const xt={value(Nt){Pt.userValue=Nt.detail.value??"",E.setValue(_,{value:Pt.userValue.toString()}),Nt.target.value=Pt.userValue},formattedValue(Nt){const{formattedValue:Wt}=Nt.detail;Pt.formattedValue=Wt,Wt!=null&&Nt.target!==document.activeElement&&(Nt.target.value=Wt),E.setValue(_,{formattedValue:Wt})},selRange(Nt){Nt.target.setSelectionRange(...Nt.detail.selRange)},charLimit:Nt=>{const{charLimit:Wt}=Nt.detail,{target:$t}=Nt;if(Wt===0){$t.removeAttribute("maxLength");return}$t.setAttribute("maxLength",Wt);let Vt=Pt.userValue;!Vt||Vt.length<=Wt||(Vt=Vt.slice(0,Wt),$t.value=Pt.userValue=Vt,E.setValue(_,{value:Vt}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:_,name:"Keystroke",value:Vt,willCommit:!0,commitKey:1,selStart:$t.selectionStart,selEnd:$t.selectionEnd}}))}};this._dispatchEventFromSandbox(xt,kt)}),B.addEventListener("keydown",kt=>{Pt.commitKey=1;let xt=-1;if(kt.key==="Escape"?xt=0:kt.key==="Enter"&&!this.data.multiLine?xt=2:kt.key==="Tab"&&(Pt.commitKey=3),xt===-1)return;const{value:Nt}=kt.target;Pt.lastCommittedValue!==Nt&&(Pt.lastCommittedValue=Nt,Pt.userValue=Nt,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:_,name:"Keystroke",value:Nt,willCommit:!0,commitKey:xt,selStart:kt.target.selectionStart,selEnd:kt.target.selectionEnd}}))});const It=Ot;Ot=null,B.addEventListener("blur",kt=>{if(!Pt.focused||!kt.relatedTarget)return;Pt.focused=!1;const{value:xt}=kt.target;Pt.userValue=xt,Pt.lastCommittedValue!==xt&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:_,name:"Keystroke",value:xt,willCommit:!0,commitKey:Pt.commitKey,selStart:kt.target.selectionStart,selEnd:kt.target.selectionEnd}}),It(kt)}),this.data.actions?.Keystroke&&B.addEventListener("beforeinput",kt=>{Pt.lastCommittedValue=null;const{data:xt,target:Nt}=kt,{value:Wt,selectionStart:$t,selectionEnd:Vt}=Nt;let Kt=$t,Zt=Vt;switch(kt.inputType){case"deleteWordBackward":{const Jt=Wt.substring(0,$t).match(/\w*[^\w]*$/);Jt&&(Kt-=Jt[0].length);break}case"deleteWordForward":{const Jt=Wt.substring($t).match(/^[^\w]*\w*/);Jt&&(Zt+=Jt[0].length);break}case"deleteContentBackward":$t===Vt&&(Kt-=1);break;case"deleteContentForward":$t===Vt&&(Zt+=1);break}kt.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:_,name:"Keystroke",value:Wt,change:xt||"",willCommit:!1,selStart:Kt,selEnd:Zt}})}),this._setEventListeners(B,Pt,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],kt=>kt.target.value)}if(Ot&&B.addEventListener("blur",Ot),this.data.comb){const kt=(this.data.rect[2]-this.data.rect[0])/ft;B.classList.add("comb"),B.style.letterSpacing=`calc(${kt}px * var(--scale-factor) - 1ch)`}}else B=document.createElement("div"),B.textContent=this.data.fieldValue,B.style.verticalAlign="middle",B.style.display="table-cell";return this._setTextStyle(B),this._setBackgroundColor(B),this._setDefaultPropertiesFromJS(B),this.container.append(B),this.container}}class x extends c{constructor(E){super(E,{isRenderable:!!E.data.hasOwnCanvas})}}class b extends c{constructor(E){super(E,{isRenderable:E.renderForms})}render(){const E=this.annotationStorage,_=this.data,B=_.id;let at=E.getValue(B,{value:_.exportValue===_.fieldValue}).value;typeof at=="string"&&(at=at!=="Off",E.setValue(B,{value:at})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const ot=document.createElement("input");return I.add(ot),ot.setAttribute("data-element-id",B),ot.disabled=_.readOnly,this._setRequired(ot,this.data.required),ot.type="checkbox",ot.name=_.fieldName,at&&ot.setAttribute("checked",!0),ot.setAttribute("exportValue",_.exportValue),ot.tabIndex=M,ot.addEventListener("change",ft=>{const{name:Et,checked:Pt}=ft.target;for(const Ot of this._getElementsByName(Et,B)){const It=Pt&&Ot.exportValue===_.exportValue;Ot.domElement&&(Ot.domElement.checked=It),E.setValue(Ot.id,{value:It})}E.setValue(B,{value:Pt})}),ot.addEventListener("resetform",ft=>{const Et=_.defaultFieldValue||"Off";ft.target.checked=Et===_.exportValue}),this.enableScripting&&this.hasJSActions&&(ot.addEventListener("updatefromsandbox",ft=>{const Et={value(Pt){Pt.target.checked=Pt.detail.value!=="Off",E.setValue(B,{value:Pt.target.checked})}};this._dispatchEventFromSandbox(Et,ft)}),this._setEventListeners(ot,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],ft=>ft.target.checked)),this._setBackgroundColor(ot),this._setDefaultPropertiesFromJS(ot),this.container.append(ot),this.container}}class r extends c{constructor(E){super(E,{isRenderable:E.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const E=this.annotationStorage,_=this.data,B=_.id;let at=E.getValue(B,{value:_.fieldValue===_.buttonValue}).value;typeof at=="string"&&(at=at!==_.buttonValue,E.setValue(B,{value:at}));const ot=document.createElement("input");if(I.add(ot),ot.setAttribute("data-element-id",B),ot.disabled=_.readOnly,this._setRequired(ot,this.data.required),ot.type="radio",ot.name=_.fieldName,at&&ot.setAttribute("checked",!0),ot.tabIndex=M,ot.addEventListener("change",ft=>{const{name:Et,checked:Pt}=ft.target;for(const Ot of this._getElementsByName(Et,B))E.setValue(Ot.id,{value:!1});E.setValue(B,{value:Pt})}),ot.addEventListener("resetform",ft=>{const Et=_.defaultFieldValue;ft.target.checked=Et!=null&&Et===_.buttonValue}),this.enableScripting&&this.hasJSActions){const ft=_.buttonValue;ot.addEventListener("updatefromsandbox",Et=>{const Pt={value:Ot=>{const It=ft===Ot.detail.value;for(const kt of this._getElementsByName(Ot.target.name)){const xt=It&&kt.id===B;kt.domElement&&(kt.domElement.checked=xt),E.setValue(kt.id,{value:xt})}}};this._dispatchEventFromSandbox(Pt,Et)}),this._setEventListeners(ot,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Et=>Et.target.checked)}return this._setBackgroundColor(ot),this._setDefaultPropertiesFromJS(ot),this.container.append(ot),this.container}}class i extends w{constructor(E){super(E,{ignoreBorder:E.data.hasAppearance})}render(){const E=super.render();E.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(E.title=this.data.alternativeText);const _=E.lastChild;return this.enableScripting&&this.hasJSActions&&_&&(this._setDefaultPropertiesFromJS(_),_.addEventListener("updatefromsandbox",B=>{this._dispatchEventFromSandbox({},B)})),E}}class e extends c{constructor(E){super(E,{isRenderable:E.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const E=this.annotationStorage,_=this.data.id,B=E.getValue(_,{value:this.data.fieldValue}),at=document.createElement("select");I.add(at),at.setAttribute("data-element-id",_),at.disabled=this.data.readOnly,this._setRequired(at,this.data.required),at.name=this.data.fieldName,at.tabIndex=M;let ot=this.data.combo&&this.data.options.length>0;this.data.combo||(at.size=this.data.options.length,this.data.multiSelect&&(at.multiple=!0)),at.addEventListener("resetform",It=>{const kt=this.data.defaultFieldValue;for(const xt of at.options)xt.selected=xt.value===kt});for(const It of this.data.options){const kt=document.createElement("option");kt.textContent=It.displayValue,kt.value=It.exportValue,B.value.includes(It.exportValue)&&(kt.setAttribute("selected",!0),ot=!1),at.append(kt)}let ft=null;if(ot){const It=document.createElement("option");It.value=" ",It.setAttribute("hidden",!0),It.setAttribute("selected",!0),at.prepend(It),ft=()=>{It.remove(),at.removeEventListener("input",ft),ft=null},at.addEventListener("input",ft)}const Et=It=>{const kt=It?"value":"textContent",{options:xt,multiple:Nt}=at;return Nt?Array.prototype.filter.call(xt,Wt=>Wt.selected).map(Wt=>Wt[kt]):xt.selectedIndex===-1?null:xt[xt.selectedIndex][kt]};let Pt=Et(!1);const Ot=It=>{const kt=It.target.options;return Array.prototype.map.call(kt,xt=>({displayValue:xt.textContent,exportValue:xt.value}))};return this.enableScripting&&this.hasJSActions?(at.addEventListener("updatefromsandbox",It=>{const kt={value(xt){ft?.();const Nt=xt.detail.value,Wt=new Set(Array.isArray(Nt)?Nt:[Nt]);for(const $t of at.options)$t.selected=Wt.has($t.value);E.setValue(_,{value:Et(!0)}),Pt=Et(!1)},multipleSelection(xt){at.multiple=!0},remove(xt){const Nt=at.options,Wt=xt.detail.remove;Nt[Wt].selected=!1,at.remove(Wt),Nt.length>0&&Array.prototype.findIndex.call(Nt,Vt=>Vt.selected)===-1&&(Nt[0].selected=!0),E.setValue(_,{value:Et(!0),items:Ot(xt)}),Pt=Et(!1)},clear(xt){for(;at.length!==0;)at.remove(0);E.setValue(_,{value:null,items:[]}),Pt=Et(!1)},insert(xt){const{index:Nt,displayValue:Wt,exportValue:$t}=xt.detail.insert,Vt=at.children[Nt],Kt=document.createElement("option");Kt.textContent=Wt,Kt.value=$t,Vt?Vt.before(Kt):at.append(Kt),E.setValue(_,{value:Et(!0),items:Ot(xt)}),Pt=Et(!1)},items(xt){const{items:Nt}=xt.detail;for(;at.length!==0;)at.remove(0);for(const Wt of Nt){const{displayValue:$t,exportValue:Vt}=Wt,Kt=document.createElement("option");Kt.textContent=$t,Kt.value=Vt,at.append(Kt)}at.options.length>0&&(at.options[0].selected=!0),E.setValue(_,{value:Et(!0),items:Ot(xt)}),Pt=Et(!1)},indices(xt){const Nt=new Set(xt.detail.indices);for(const Wt of xt.target.options)Wt.selected=Nt.has(Wt.index);E.setValue(_,{value:Et(!0)}),Pt=Et(!1)},editable(xt){xt.target.disabled=!xt.detail.editable}};this._dispatchEventFromSandbox(kt,It)}),at.addEventListener("input",It=>{const kt=Et(!0);E.setValue(_,{value:kt}),It.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:_,name:"Keystroke",value:Pt,changeEx:kt,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(at,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],It=>It.target.value)):at.addEventListener("input",function(It){E.setValue(_,{value:Et(!0)})}),this.data.combo&&this._setTextStyle(at),this._setBackgroundColor(at),this._setDefaultPropertiesFromJS(at),this.container.append(at),this.container}}class g extends A{constructor(E){const{data:_,elements:B}=E;super(E,{isRenderable:A._hasPopupData(_)}),this.elements=B}render(){this.container.classList.add("popupAnnotation");const E=new l({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),_=[];for(const B of this.elements)B.popup=E,_.push(B.data.id),B.addHighlightArea();return this.container.setAttribute("aria-controls",_.map(B=>`${o.AnnotationPrefix}${B}`).join(",")),this.container}}class l{constructor({container:E,color:_,elements:B,titleObj:at,modificationDate:ot,contentsObj:ft,richText:Et,parent:Pt,rect:Ot,parentRect:It,open:kt}){Z(this,Ct);Z(this,et,null);Z(this,ht,H(this,Ct,Ri).bind(this));Z(this,ut,H(this,Ct,ei).bind(this));Z(this,pt,H(this,Ct,ti).bind(this));Z(this,bt,H(this,Ct,we).bind(this));Z(this,At,null);Z(this,Y,null);Z(this,K,null);Z(this,f,null);Z(this,F,null);Z(this,z,null);Z(this,Q,!1);Z(this,dt,null);Z(this,_t,null);Z(this,yt,null);Z(this,X,null);Z(this,wt,!1);tt(this,Y,E),tt(this,X,at),tt(this,K,ft),tt(this,yt,Et),tt(this,F,Pt),tt(this,At,_),tt(this,_t,Ot),tt(this,z,It),tt(this,f,B);const xt=T.PDFDateString.toDateObject(ot);xt&&tt(this,et,Pt.l10n.get("annotation_date_string",{date:xt.toLocaleDateString(),time:xt.toLocaleTimeString()})),this.trigger=B.flatMap(Nt=>Nt.getElementsToTriggerPopup());for(const Nt of this.trigger)Nt.addEventListener("click",t(this,bt)),Nt.addEventListener("mouseenter",t(this,pt)),Nt.addEventListener("mouseleave",t(this,ut)),Nt.classList.add("popupTriggerArea");for(const Nt of B)Nt.container?.addEventListener("keydown",t(this,ht));t(this,Y).hidden=!0,kt&&H(this,Ct,we).call(this)}render(){if(t(this,dt))return;const{page:{view:E},viewport:{rawDims:{pageWidth:_,pageHeight:B,pageX:at,pageY:ot}}}=t(this,F),ft=tt(this,dt,document.createElement("div"));if(ft.className="popup",t(this,At)){const Jt=ft.style.outlineColor=o.Util.makeHexColor(...t(this,At));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?ft.style.backgroundColor=`color-mix(in srgb, ${Jt} 30%, white)`:ft.style.backgroundColor=o.Util.makeHexColor(...t(this,At).map(le=>Math.floor(.7*(255-le)+le)))}const Et=document.createElement("span");Et.className="header";const Pt=document.createElement("h1");if(Et.append(Pt),{dir:Pt.dir,str:Pt.textContent}=t(this,X),ft.append(Et),t(this,et)){const Jt=document.createElement("span");Jt.classList.add("popupDate"),t(this,et).then(oe=>{Jt.textContent=oe}),Et.append(Jt)}const Ot=t(this,K),It=t(this,yt);if(It?.str&&(!Ot?.str||Ot.str===It.str))O.XfaLayer.render({xfaHtml:It.html,intent:"richText",div:ft}),ft.lastChild.classList.add("richText","popupContent");else{const Jt=this._formatContents(Ot);ft.append(Jt)}let kt=!!t(this,z),xt=kt?t(this,z):t(this,_t);for(const Jt of t(this,f))if(!xt||o.Util.intersect(Jt.data.rect,xt)!==null){xt=Jt.data.rect,kt=!0;break}const Nt=o.Util.normalizeRect([xt[0],E[3]-xt[1]+E[1],xt[2],E[3]-xt[3]+E[1]]),$t=kt?xt[2]-xt[0]+5:0,Vt=Nt[0]+$t,Kt=Nt[1],{style:Zt}=t(this,Y);Zt.left=`${100*(Vt-at)/_}%`,Zt.top=`${100*(Kt-ot)/B}%`,t(this,Y).append(ft)}_formatContents({str:E,dir:_}){const B=document.createElement("p");B.classList.add("popupContent"),B.dir=_;const at=E.split(/(?:\r\n?|\n)/);for(let ot=0,ft=at.length;ot<ft;++ot){const Et=at[ot];B.append(document.createTextNode(Et)),ot<ft-1&&B.append(document.createElement("br"))}return B}forceHide(){tt(this,wt,this.isVisible),t(this,wt)&&(t(this,Y).hidden=!0)}maybeShow(){t(this,wt)&&(tt(this,wt,!1),t(this,Y).hidden=!1)}get isVisible(){return t(this,Y).hidden===!1}}et=new WeakMap,ht=new WeakMap,ut=new WeakMap,pt=new WeakMap,bt=new WeakMap,At=new WeakMap,Y=new WeakMap,K=new WeakMap,f=new WeakMap,F=new WeakMap,z=new WeakMap,Q=new WeakMap,dt=new WeakMap,_t=new WeakMap,yt=new WeakMap,X=new WeakMap,wt=new WeakMap,Ct=new WeakSet,Ri=function(E){E.altKey||E.shiftKey||E.ctrlKey||E.metaKey||(E.key==="Enter"||E.key==="Escape"&&t(this,Q))&&H(this,Ct,we).call(this)},we=function(){tt(this,Q,!t(this,Q)),t(this,Q)?(H(this,Ct,ti).call(this),t(this,Y).addEventListener("click",t(this,bt)),t(this,Y).addEventListener("keydown",t(this,ht))):(H(this,Ct,ei).call(this),t(this,Y).removeEventListener("click",t(this,bt)),t(this,Y).removeEventListener("keydown",t(this,ht)))},ti=function(){t(this,dt)||this.render(),this.isVisible?t(this,Q)&&t(this,Y).classList.add("focused"):(t(this,Y).hidden=!1,t(this,Y).style.zIndex=parseInt(t(this,Y).style.zIndex)+1e3)},ei=function(){t(this,Y).classList.remove("focused"),!(t(this,Q)||!this.isVisible)&&(t(this,Y).hidden=!0,t(this,Y).style.zIndex=parseInt(t(this,Y).style.zIndex)-1e3)};class W extends A{constructor(E){super(E,{isRenderable:!0,ignoreBorder:!0}),this.textContent=E.data.textContent,this.textPosition=E.data.textPosition,this.annotationEditorType=o.AnnotationEditorType.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const E=document.createElement("div");E.classList.add("annotationTextContent"),E.setAttribute("role","comment");for(const _ of this.textContent){const B=document.createElement("span");B.textContent=_,E.append(B)}this.container.append(E)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}h.FreeTextAnnotationElement=W;class a extends A{constructor(_){super(_,{isRenderable:!0,ignoreBorder:!0});Z(this,Ut,null)}render(){this.container.classList.add("lineAnnotation");const _=this.data,{width:B,height:at}=L(_.rect),ot=this.svgFactory.create(B,at,!0),ft=tt(this,Ut,this.svgFactory.createElement("svg:line"));return ft.setAttribute("x1",_.rect[2]-_.lineCoordinates[0]),ft.setAttribute("y1",_.rect[3]-_.lineCoordinates[1]),ft.setAttribute("x2",_.rect[2]-_.lineCoordinates[2]),ft.setAttribute("y2",_.rect[3]-_.lineCoordinates[3]),ft.setAttribute("stroke-width",_.borderStyle.width||1),ft.setAttribute("stroke","transparent"),ft.setAttribute("fill","transparent"),ot.append(ft),this.container.append(ot),!_.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return t(this,Ut)}addHighlightArea(){this.container.classList.add("highlightArea")}}Ut=new WeakMap;class S extends A{constructor(_){super(_,{isRenderable:!0,ignoreBorder:!0});Z(this,Gt,null)}render(){this.container.classList.add("squareAnnotation");const _=this.data,{width:B,height:at}=L(_.rect),ot=this.svgFactory.create(B,at,!0),ft=_.borderStyle.width,Et=tt(this,Gt,this.svgFactory.createElement("svg:rect"));return Et.setAttribute("x",ft/2),Et.setAttribute("y",ft/2),Et.setAttribute("width",B-ft),Et.setAttribute("height",at-ft),Et.setAttribute("stroke-width",ft||1),Et.setAttribute("stroke","transparent"),Et.setAttribute("fill","transparent"),ot.append(Et),this.container.append(ot),!_.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return t(this,Gt)}addHighlightArea(){this.container.classList.add("highlightArea")}}Gt=new WeakMap;class N extends A{constructor(_){super(_,{isRenderable:!0,ignoreBorder:!0});Z(this,qt,null)}render(){this.container.classList.add("circleAnnotation");const _=this.data,{width:B,height:at}=L(_.rect),ot=this.svgFactory.create(B,at,!0),ft=_.borderStyle.width,Et=tt(this,qt,this.svgFactory.createElement("svg:ellipse"));return Et.setAttribute("cx",B/2),Et.setAttribute("cy",at/2),Et.setAttribute("rx",B/2-ft/2),Et.setAttribute("ry",at/2-ft/2),Et.setAttribute("stroke-width",ft||1),Et.setAttribute("stroke","transparent"),Et.setAttribute("fill","transparent"),ot.append(Et),this.container.append(ot),!_.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return t(this,qt)}addHighlightArea(){this.container.classList.add("highlightArea")}}qt=new WeakMap;class rt extends A{constructor(_){super(_,{isRenderable:!0,ignoreBorder:!0});Z(this,vt,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const _=this.data,{width:B,height:at}=L(_.rect),ot=this.svgFactory.create(B,at,!0);let ft=[];for(const Pt of _.vertices){const Ot=Pt.x-_.rect[0],It=_.rect[3]-Pt.y;ft.push(Ot+","+It)}ft=ft.join(" ");const Et=tt(this,vt,this.svgFactory.createElement(this.svgElementName));return Et.setAttribute("points",ft),Et.setAttribute("stroke-width",_.borderStyle.width||1),Et.setAttribute("stroke","transparent"),Et.setAttribute("fill","transparent"),ot.append(Et),this.container.append(ot),!_.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return t(this,vt)}addHighlightArea(){this.container.classList.add("highlightArea")}}vt=new WeakMap;class V extends rt{constructor(E){super(E),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class J extends A{constructor(E){super(E,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class j extends A{constructor(_){super(_,{isRenderable:!0,ignoreBorder:!0});Z(this,st,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=o.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);const _=this.data,{width:B,height:at}=L(_.rect),ot=this.svgFactory.create(B,at,!0);for(const ft of _.inkLists){let Et=[];for(const Ot of ft){const It=Ot.x-_.rect[0],kt=_.rect[3]-Ot.y;Et.push(`${It},${kt}`)}Et=Et.join(" ");const Pt=this.svgFactory.createElement(this.svgElementName);t(this,st).push(Pt),Pt.setAttribute("points",Et),Pt.setAttribute("stroke-width",_.borderStyle.width||1),Pt.setAttribute("stroke","transparent"),Pt.setAttribute("fill","transparent"),!_.popupRef&&this.hasPopupData&&this._createPopup(),ot.append(Pt)}return this.container.append(ot),this.container}getElementsToTriggerPopup(){return t(this,st)}addHighlightArea(){this.container.classList.add("highlightArea")}}st=new WeakMap,h.InkAnnotationElement=j;class nt extends A{constructor(E){super(E,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class R extends A{constructor(E){super(E,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class G extends A{constructor(E){super(E,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class $ extends A{constructor(E){super(E,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class y extends A{constructor(E){super(E,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}h.StampAnnotationElement=y;class s extends A{constructor(_){super(_,{isRenderable:!0});Z(this,Mt);Z(this,it,null);const{filename:B,content:at}=this.data.file;this.filename=(0,T.getFilenameFromUrl)(B,!0),this.content=at,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,filename:B,content:at})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:_,data:B}=this;let at;B.hasAppearance||B.fillAlpha===0?at=document.createElement("div"):(at=document.createElement("img"),at.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(B.name)?"paperclip":"pushpin"}.svg`,B.fillAlpha&&B.fillAlpha<1&&(at.style=`filter: opacity(${Math.round(B.fillAlpha*100)}%);`)),at.addEventListener("dblclick",H(this,Mt,ii).bind(this)),tt(this,it,at);const{isMac:ot}=o.FeatureTest.platform;return _.addEventListener("keydown",ft=>{ft.key==="Enter"&&(ot?ft.metaKey:ft.ctrlKey)&&H(this,Mt,ii).call(this)}),!B.popupRef&&this.hasPopupData?this._createPopup():at.classList.add("popupTriggerArea"),_.append(at),_}getElementsToTriggerPopup(){return t(this,it)}addHighlightArea(){this.container.classList.add("highlightArea")}}it=new WeakMap,Mt=new WeakSet,ii=function(){this.downloadManager?.openOrDownloadData(this.container,this.content,this.filename)};class n{constructor({div:E,accessibilityManager:_,annotationCanvasMap:B,l10n:at,page:ot,viewport:ft}){Z(this,Tt);Z(this,Ht,null);Z(this,D,null);Z(this,gt,new Map);this.div=E,tt(this,Ht,_),tt(this,D,B),this.l10n=at,this.page=ot,this.viewport=ft,this.zIndex=0,this.l10n||(this.l10n=mt.NullL10n)}async render(E){const{annotations:_}=E,B=this.div;(0,T.setLayerDimensions)(B,this.viewport);const at=new Map,ot={data:null,layer:B,linkService:E.linkService,downloadManager:E.downloadManager,imageResourcesPath:E.imageResourcesPath||"",renderForms:E.renderForms!==!1,svgFactory:new T.DOMSVGFactory,annotationStorage:E.annotationStorage||new ct.AnnotationStorage,enableScripting:E.enableScripting===!0,hasJSActions:E.hasJSActions,fieldObjects:E.fieldObjects,parent:this,elements:null};for(const ft of _){if(ft.noHTML)continue;const Et=ft.annotationType===o.AnnotationType.POPUP;if(Et){const It=at.get(ft.id);if(!It)continue;ot.elements=It}else{const{width:It,height:kt}=L(ft.rect);if(It<=0||kt<=0)continue}ot.data=ft;const Pt=v.create(ot);if(!Pt.isRenderable)continue;if(!Et&&ft.popupRef){const It=at.get(ft.popupRef);It?It.push(Pt):at.set(ft.popupRef,[Pt])}Pt.annotationEditorType>0&&t(this,gt).set(Pt.data.id,Pt);const Ot=Pt.render();ft.hidden&&(Ot.style.visibility="hidden"),H(this,Tt,xi).call(this,Ot,ft.id)}H(this,Tt,si).call(this),await this.l10n.translate(B)}update({viewport:E}){const _=this.div;this.viewport=E,(0,T.setLayerDimensions)(_,{rotation:E.rotation}),H(this,Tt,si).call(this),_.hidden=!1}getEditableAnnotations(){return Array.from(t(this,gt).values())}getEditableAnnotation(E){return t(this,gt).get(E)}}Ht=new WeakMap,D=new WeakMap,gt=new WeakMap,Tt=new WeakSet,xi=function(E,_){const B=E.firstChild||E;B.id=`${o.AnnotationPrefix}${_}`,this.div.append(E),t(this,Ht)?.moveElementInDOM(this.div,E,B,!1)},si=function(){if(!t(this,D))return;const E=this.div;for(const[_,B]of t(this,D)){const at=E.querySelector(`[data-annotation-id="${_}"]`);if(!at)continue;const{firstChild:ot}=at;ot?ot.nodeName==="CANVAS"?ot.replaceWith(B):ot.before(B):at.append(B)}t(this,D).clear()},h.AnnotationLayer=n},(St,h)=>{Object.defineProperty(h,"__esModule",{value:!0}),h.ColorConverters=void 0;function lt(ct){return Math.floor(Math.max(0,Math.min(1,ct))*255).toString(16).padStart(2,"0")}function o(ct){return Math.max(0,Math.min(255,255*ct))}class T{static CMYK_G([q,mt,O,M]){return["G",1-Math.min(1,.3*q+.59*O+.11*mt+M)]}static G_CMYK([q]){return["CMYK",0,0,0,1-q]}static G_RGB([q]){return["RGB",q,q,q]}static G_rgb([q]){return q=o(q),[q,q,q]}static G_HTML([q]){const mt=lt(q);return`#${mt}${mt}${mt}`}static RGB_G([q,mt,O]){return["G",.3*q+.59*mt+.11*O]}static RGB_rgb(q){return q.map(o)}static RGB_HTML(q){return`#${q.map(lt).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([q,mt,O,M]){return["RGB",1-Math.min(1,q+M),1-Math.min(1,O+M),1-Math.min(1,mt+M)]}static CMYK_rgb([q,mt,O,M]){return[o(1-Math.min(1,q+M)),o(1-Math.min(1,O+M)),o(1-Math.min(1,mt+M))]}static CMYK_HTML(q){const mt=this.CMYK_RGB(q).slice(1);return this.RGB_HTML(mt)}static RGB_CMYK([q,mt,O]){const M=1-q,m=1-mt,I=1-O,L=Math.min(M,m,I);return["CMYK",M,m,I,L]}}h.ColorConverters=T},(St,h)=>{Object.defineProperty(h,"__esModule",{value:!0}),h.NullL10n=void 0,h.getL10nFallback=o;const lt={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typing…",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative"};lt.print_progress_percent="{{progress}}%";function o(q,mt){switch(q){case"find_match_count":q=`find_match_count[${mt.total===1?"one":"other"}]`;break;case"find_match_count_limit":q=`find_match_count_limit[${mt.limit===1?"one":"other"}]`;break}return lt[q]||""}function T(q,mt){return mt?q.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(O,M)=>M in mt?mt[M]:"{{"+M+"}}"):q}const ct={async getLanguage(){return"en-us"},async getDirection(){return"ltr"},async get(q,mt=null,O=o(q,mt)){return T(O,mt)},async translate(q){}};h.NullL10n=ct},(St,h,lt)=>{Object.defineProperty(h,"__esModule",{value:!0}),h.XfaLayer=void 0;var o=lt(25);class T{static setupStorage(q,mt,O,M,m){const I=M.getValue(mt,{value:null});switch(O.name){case"textarea":if(I.value!==null&&(q.textContent=I.value),m==="print")break;q.addEventListener("input",L=>{M.setValue(mt,{value:L.target.value})});break;case"input":if(O.attributes.type==="radio"||O.attributes.type==="checkbox"){if(I.value===O.attributes.xfaOn?q.setAttribute("checked",!0):I.value===O.attributes.xfaOff&&q.removeAttribute("checked"),m==="print")break;q.addEventListener("change",L=>{M.setValue(mt,{value:L.target.checked?L.target.getAttribute("xfaOn"):L.target.getAttribute("xfaOff")})})}else{if(I.value!==null&&q.setAttribute("value",I.value),m==="print")break;q.addEventListener("input",L=>{M.setValue(mt,{value:L.target.value})})}break;case"select":if(I.value!==null){q.setAttribute("value",I.value);for(const L of O.children)L.attributes.value===I.value?L.attributes.selected=!0:L.attributes.hasOwnProperty("selected")&&delete L.attributes.selected}q.addEventListener("input",L=>{const v=L.target.options,A=v.selectedIndex===-1?"":v[v.selectedIndex].value;M.setValue(mt,{value:A})});break}}static setAttributes({html:q,element:mt,storage:O=null,intent:M,linkService:m}){const{attributes:I}=mt,L=q instanceof HTMLAnchorElement;I.type==="radio"&&(I.name=`${I.name}-${M}`);for(const[v,A]of Object.entries(I))if(A!=null)switch(v){case"class":A.length&&q.setAttribute(v,A.join(" "));break;case"dataId":break;case"id":q.setAttribute("data-element-id",A);break;case"style":Object.assign(q.style,A);break;case"textContent":q.textContent=A;break;default:(!L||v!=="href"&&v!=="newWindow")&&q.setAttribute(v,A)}L&&m.addLinkAttributes(q,I.href,I.newWindow),O&&I.dataId&&this.setupStorage(q,I.dataId,mt,O)}static render(q){const mt=q.annotationStorage,O=q.linkService,M=q.xfaHtml,m=q.intent||"display",I=document.createElement(M.name);M.attributes&&this.setAttributes({html:I,element:M,intent:m,linkService:O});const L=[[M,-1,I]],v=q.div;if(v.append(I),q.viewport){const w=`matrix(${q.viewport.transform.join(",")})`;v.style.transform=w}m!=="richText"&&v.setAttribute("class","xfaLayer xfaFont");const A=[];for(;L.length>0;){const[w,u,c]=L.at(-1);if(u+1===w.children.length){L.pop();continue}const p=w.children[++L.at(-1)[1]];if(p===null)continue;const{name:x}=p;if(x==="#text"){const r=document.createTextNode(p.value);A.push(r),c.append(r);continue}const b=p?.attributes?.xmlns?document.createElementNS(p.attributes.xmlns,x):document.createElement(x);if(c.append(b),p.attributes&&this.setAttributes({html:b,element:p,storage:mt,intent:m,linkService:O}),p.children&&p.children.length>0)L.push([p,-1,b]);else if(p.value){const r=document.createTextNode(p.value);o.XfaText.shouldBuildText(x)&&A.push(r),b.append(r)}}for(const w of v.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))w.setAttribute("readOnly",!0);return{textDivs:A}}static update(q){const mt=`matrix(${q.viewport.transform.join(",")})`;q.div.style.transform=mt,q.div.hidden=!1}}h.XfaLayer=T},(St,h,lt)=>{var M,m,I,L,v,A,w,u,c,p,x,b,r,i,e,Di,Ii,Li,Oi,ni,Ni,ri,Bi,Ui,ji,Hi,Wi,te,ai,Ce,Te,re,oi,Pe,P,Gi,li,zi,Xi,ci,ke,ae;Object.defineProperty(h,"__esModule",{value:!0}),h.InkEditor=void 0;var o=lt(1),T=lt(4),ct=lt(29),q=lt(6),mt=lt(5);const At=class At extends T.AnnotationEditor{constructor(f){super({...f,name:"inkEditor"});Z(this,e);Z(this,M,0);Z(this,m,0);Z(this,I,this.canvasPointermove.bind(this));Z(this,L,this.canvasPointerleave.bind(this));Z(this,v,this.canvasPointerup.bind(this));Z(this,A,this.canvasPointerdown.bind(this));Z(this,w,new Path2D);Z(this,u,!1);Z(this,c,!1);Z(this,p,!1);Z(this,x,null);Z(this,b,0);Z(this,r,0);Z(this,i,null);this.color=f.color||null,this.thickness=f.thickness||null,this.opacity=f.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(f){T.AnnotationEditor.initialize(f,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(f,F){switch(f){case o.AnnotationEditorParamsType.INK_THICKNESS:At._defaultThickness=F;break;case o.AnnotationEditorParamsType.INK_COLOR:At._defaultColor=F;break;case o.AnnotationEditorParamsType.INK_OPACITY:At._defaultOpacity=F/100;break}}updateParams(f,F){switch(f){case o.AnnotationEditorParamsType.INK_THICKNESS:H(this,e,Di).call(this,F);break;case o.AnnotationEditorParamsType.INK_COLOR:H(this,e,Ii).call(this,F);break;case o.AnnotationEditorParamsType.INK_OPACITY:H(this,e,Li).call(this,F);break}}static get defaultPropertiesToUpdate(){return[[o.AnnotationEditorParamsType.INK_THICKNESS,At._defaultThickness],[o.AnnotationEditorParamsType.INK_COLOR,At._defaultColor||T.AnnotationEditor._defaultLineColor],[o.AnnotationEditorParamsType.INK_OPACITY,Math.round(At._defaultOpacity*100)]]}get propertiesToUpdate(){return[[o.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||At._defaultThickness],[o.AnnotationEditorParamsType.INK_COLOR,this.color||At._defaultColor||T.AnnotationEditor._defaultLineColor],[o.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??At._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(H(this,e,Ce).call(this),H(this,e,Te).call(this)),this.isAttachedToDOM||(this.parent.add(this),H(this,e,re).call(this)),H(this,e,ae).call(this)))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,t(this,x).disconnect(),tt(this,x,null),super.remove())}setParent(f){!this.parent&&f?this._uiManager.removeShouldRescale(this):this.parent&&f===null&&this._uiManager.addShouldRescale(this),super.setParent(f)}onScaleChanging(){const[f,F]=this.parentDimensions,z=this.width*f,Q=this.height*F;this.setDimensions(z,Q)}enableEditMode(){t(this,u)||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",t(this,A)))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",t(this,A)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){t(this,u)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),tt(this,u,!0),this.div.classList.add("disabled"),H(this,e,ae).call(this,!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(f){this._focusEventsAllowed&&(super.focusin(f),this.enableEditMode())}canvasPointerdown(f){f.button!==0||!this.isInEditMode()||t(this,u)||(this.setInForeground(),f.preventDefault(),f.type!=="mouse"&&this.div.focus(),H(this,e,Ni).call(this,f.offsetX,f.offsetY))}canvasPointermove(f){f.preventDefault(),H(this,e,ri).call(this,f.offsetX,f.offsetY)}canvasPointerup(f){f.preventDefault(),H(this,e,ai).call(this,f)}canvasPointerleave(f){H(this,e,ai).call(this,f)}get isResizable(){return!this.isEmpty()&&t(this,u)}render(){if(this.div)return this.div;let f,F;this.width&&(f=this.x,F=this.y),super.render(),T.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then(yt=>this.div?.setAttribute("aria-label",yt));const[z,Q,dt,_t]=H(this,e,Oi).call(this);if(this.setAt(z,Q,0,0),this.setDims(dt,_t),H(this,e,Ce).call(this),this.width){const[yt,X]=this.parentDimensions;this.setAspectRatio(this.width*yt,this.height*X),this.setAt(f*yt,F*X,this.width*yt,this.height*X),tt(this,p,!0),H(this,e,re).call(this),this.setDims(this.width*yt,this.height*X),H(this,e,te).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return H(this,e,Te).call(this),this.div}setDimensions(f,F){const z=Math.round(f),Q=Math.round(F);if(t(this,b)===z&&t(this,r)===Q)return;tt(this,b,z),tt(this,r,Q),this.canvas.style.visibility="hidden";const[dt,_t]=this.parentDimensions;this.width=f/dt,this.height=F/_t,this.fixAndSetPosition(),t(this,u)&&H(this,e,oi).call(this,f,F),H(this,e,re).call(this),H(this,e,te).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(f,F,z){var Ut,Gt,qt;if(f instanceof ct.InkAnnotationElement)return null;const Q=super.deserialize(f,F,z);Q.thickness=f.thickness,Q.color=o.Util.makeHexColor(...f.color),Q.opacity=f.opacity;const[dt,_t]=Q.pageDimensions,yt=Q.width*dt,X=Q.height*_t,wt=Q.parentScale,Ct=f.thickness/2;tt(Q,u,!0),tt(Q,b,Math.round(yt)),tt(Q,r,Math.round(X));const{paths:jt,rect:Bt,rotation:Xt}=f;for(let{bezier:vt}of jt){vt=H(Ut=At,P,zi).call(Ut,vt,Bt,Xt);const st=[];Q.paths.push(st);let it=wt*(vt[0]-Ct),Mt=wt*(vt[1]-Ct);for(let Ht=2,D=vt.length;Ht<D;Ht+=6){const gt=wt*(vt[Ht]-Ct),Tt=wt*(vt[Ht+1]-Ct),Dt=wt*(vt[Ht+2]-Ct),Lt=wt*(vt[Ht+3]-Ct),Ft=wt*(vt[Ht+4]-Ct),E=wt*(vt[Ht+5]-Ct);st.push([[it,Mt],[gt,Tt],[Dt,Lt],[Ft,E]]),it=Ft,Mt=E}const zt=H(this,P,Gi).call(this,st);Q.bezierPath2D.push(zt)}const Rt=H(Gt=Q,e,ci).call(Gt);return tt(Q,m,Math.max(T.AnnotationEditor.MIN_SIZE,Rt[2]-Rt[0])),tt(Q,M,Math.max(T.AnnotationEditor.MIN_SIZE,Rt[3]-Rt[1])),H(qt=Q,e,oi).call(qt,yt,X),Q}serialize(){if(this.isEmpty())return null;const f=this.getRect(0,0),F=T.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:o.AnnotationEditorType.INK,color:F,thickness:this.thickness,opacity:this.opacity,paths:H(this,e,Xi).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,f),pageIndex:this.pageIndex,rect:f,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};M=new WeakMap,m=new WeakMap,I=new WeakMap,L=new WeakMap,v=new WeakMap,A=new WeakMap,w=new WeakMap,u=new WeakMap,c=new WeakMap,p=new WeakMap,x=new WeakMap,b=new WeakMap,r=new WeakMap,i=new WeakMap,e=new WeakSet,Di=function(f){const F=this.thickness;this.addCommands({cmd:()=>{this.thickness=f,H(this,e,ae).call(this)},undo:()=>{this.thickness=F,H(this,e,ae).call(this)},mustExec:!0,type:o.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},Ii=function(f){const F=this.color;this.addCommands({cmd:()=>{this.color=f,H(this,e,te).call(this)},undo:()=>{this.color=F,H(this,e,te).call(this)},mustExec:!0,type:o.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},Li=function(f){f/=100;const F=this.opacity;this.addCommands({cmd:()=>{this.opacity=f,H(this,e,te).call(this)},undo:()=>{this.opacity=F,H(this,e,te).call(this)},mustExec:!0,type:o.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},Oi=function(){const{parentRotation:f,parentDimensions:[F,z]}=this;switch(f){case 90:return[0,z,z,F];case 180:return[F,z,F,z];case 270:return[F,0,z,F];default:return[0,0,F,z]}},ni=function(){const{ctx:f,color:F,opacity:z,thickness:Q,parentScale:dt,scaleFactor:_t}=this;f.lineWidth=Q*dt/_t,f.lineCap="round",f.lineJoin="round",f.miterLimit=10,f.strokeStyle=`${F}${(0,mt.opacityToHex)(z)}`},Ni=function(f,F){this.canvas.addEventListener("contextmenu",q.noContextMenu),this.canvas.addEventListener("pointerleave",t(this,L)),this.canvas.addEventListener("pointermove",t(this,I)),this.canvas.addEventListener("pointerup",t(this,v)),this.canvas.removeEventListener("pointerdown",t(this,A)),this.isEditing=!0,t(this,p)||(tt(this,p,!0),H(this,e,re).call(this),this.thickness||(this.thickness=At._defaultThickness),this.color||(this.color=At._defaultColor||T.AnnotationEditor._defaultLineColor),this.opacity??(this.opacity=At._defaultOpacity)),this.currentPath.push([f,F]),tt(this,c,!1),H(this,e,ni).call(this),tt(this,i,()=>{H(this,e,ji).call(this),t(this,i)&&window.requestAnimationFrame(t(this,i))}),window.requestAnimationFrame(t(this,i))},ri=function(f,F){const[z,Q]=this.currentPath.at(-1);if(this.currentPath.length>1&&f===z&&F===Q)return;const dt=this.currentPath;let _t=t(this,w);if(dt.push([f,F]),tt(this,c,!0),dt.length<=2){_t.moveTo(...dt[0]),_t.lineTo(f,F);return}dt.length===3&&(tt(this,w,_t=new Path2D),_t.moveTo(...dt[0])),H(this,e,Hi).call(this,_t,...dt.at(-3),...dt.at(-2),f,F)},Bi=function(){if(this.currentPath.length===0)return;const f=this.currentPath.at(-1);t(this,w).lineTo(...f)},Ui=function(f,F){tt(this,i,null),f=Math.min(Math.max(f,0),this.canvas.width),F=Math.min(Math.max(F,0),this.canvas.height),H(this,e,ri).call(this,f,F),H(this,e,Bi).call(this);let z;if(this.currentPath.length!==1)z=H(this,e,Wi).call(this);else{const X=[f,F];z=[[X,X.slice(),X.slice(),X]]}const Q=t(this,w),dt=this.currentPath;this.currentPath=[],tt(this,w,new Path2D);const _t=()=>{this.allRawPaths.push(dt),this.paths.push(z),this.bezierPath2D.push(Q),this.rebuild()},yt=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(H(this,e,Ce).call(this),H(this,e,Te).call(this)),H(this,e,ae).call(this))};this.addCommands({cmd:_t,undo:yt,mustExec:!0})},ji=function(){if(!t(this,c))return;tt(this,c,!1);const f=Math.ceil(this.thickness*this.parentScale),F=this.currentPath.slice(-3),z=F.map(_t=>_t[0]),Q=F.map(_t=>_t[1]);Math.min(...z)-f,Math.max(...z)+f,Math.min(...Q)-f,Math.max(...Q)+f;const{ctx:dt}=this;dt.save(),dt.clearRect(0,0,this.canvas.width,this.canvas.height);for(const _t of this.bezierPath2D)dt.stroke(_t);dt.stroke(t(this,w)),dt.restore()},Hi=function(f,F,z,Q,dt,_t,yt){const X=(F+Q)/2,wt=(z+dt)/2,Ct=(Q+_t)/2,jt=(dt+yt)/2;f.bezierCurveTo(X+2*(Q-X)/3,wt+2*(dt-wt)/3,Ct+2*(Q-Ct)/3,jt+2*(dt-jt)/3,Ct,jt)},Wi=function(){const f=this.currentPath;if(f.length<=2)return[[f[0],f[0],f.at(-1),f.at(-1)]];const F=[];let z,[Q,dt]=f[0];for(z=1;z<f.length-2;z++){const[Bt,Xt]=f[z],[Rt,Ut]=f[z+1],Gt=(Bt+Rt)/2,qt=(Xt+Ut)/2,vt=[Q+2*(Bt-Q)/3,dt+2*(Xt-dt)/3],st=[Gt+2*(Bt-Gt)/3,qt+2*(Xt-qt)/3];F.push([[Q,dt],vt,st,[Gt,qt]]),[Q,dt]=[Gt,qt]}const[_t,yt]=f[z],[X,wt]=f[z+1],Ct=[Q+2*(_t-Q)/3,dt+2*(yt-dt)/3],jt=[X+2*(_t-X)/3,wt+2*(yt-wt)/3];return F.push([[Q,dt],Ct,jt,[X,wt]]),F},te=function(){if(this.isEmpty()){H(this,e,Pe).call(this);return}H(this,e,ni).call(this);const{canvas:f,ctx:F}=this;F.setTransform(1,0,0,1,0,0),F.clearRect(0,0,f.width,f.height),H(this,e,Pe).call(this);for(const z of this.bezierPath2D)F.stroke(z)},ai=function(f){this.canvas.removeEventListener("pointerleave",t(this,L)),this.canvas.removeEventListener("pointermove",t(this,I)),this.canvas.removeEventListener("pointerup",t(this,v)),this.canvas.addEventListener("pointerdown",t(this,A)),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",q.noContextMenu)},10),H(this,e,Ui).call(this,f.offsetX,f.offsetY),this.addToAnnotationStorage(),this.setInBackground()},Ce=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",T.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(f=>this.canvas?.setAttribute("aria-label",f)),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},Te=function(){tt(this,x,new ResizeObserver(f=>{const F=f[0].contentRect;F.width&&F.height&&this.setDimensions(F.width,F.height)})),t(this,x).observe(this.div)},re=function(){if(!t(this,p))return;const[f,F]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*f),this.canvas.height=Math.ceil(this.height*F),H(this,e,Pe).call(this)},oi=function(f,F){const z=H(this,e,ke).call(this),Q=(f-z)/t(this,m),dt=(F-z)/t(this,M);this.scaleFactor=Math.min(Q,dt)},Pe=function(){const f=H(this,e,ke).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+f,this.translationY*this.scaleFactor+f)},P=new WeakSet,Gi=function(f){const F=new Path2D;for(let z=0,Q=f.length;z<Q;z++){const[dt,_t,yt,X]=f[z];z===0&&F.moveTo(...dt),F.bezierCurveTo(_t[0],_t[1],yt[0],yt[1],X[0],X[1])}return F},li=function(f,F,z){const[Q,dt,_t,yt]=F;switch(z){case 0:for(let X=0,wt=f.length;X<wt;X+=2)f[X]+=Q,f[X+1]=yt-f[X+1];break;case 90:for(let X=0,wt=f.length;X<wt;X+=2){const Ct=f[X];f[X]=f[X+1]+Q,f[X+1]=Ct+dt}break;case 180:for(let X=0,wt=f.length;X<wt;X+=2)f[X]=_t-f[X],f[X+1]+=dt;break;case 270:for(let X=0,wt=f.length;X<wt;X+=2){const Ct=f[X];f[X]=_t-f[X+1],f[X+1]=yt-Ct}break;default:throw new Error("Invalid rotation")}return f},zi=function(f,F,z){const[Q,dt,_t,yt]=F;switch(z){case 0:for(let X=0,wt=f.length;X<wt;X+=2)f[X]-=Q,f[X+1]=yt-f[X+1];break;case 90:for(let X=0,wt=f.length;X<wt;X+=2){const Ct=f[X];f[X]=f[X+1]-dt,f[X+1]=Ct-Q}break;case 180:for(let X=0,wt=f.length;X<wt;X+=2)f[X]=_t-f[X],f[X+1]-=dt;break;case 270:for(let X=0,wt=f.length;X<wt;X+=2){const Ct=f[X];f[X]=yt-f[X+1],f[X+1]=_t-Ct}break;default:throw new Error("Invalid rotation")}return f},Xi=function(f,F,z,Q){var wt,Ct;const dt=[],_t=this.thickness/2,yt=f*F+_t,X=f*z+_t;for(const jt of this.paths){const Bt=[],Xt=[];for(let Rt=0,Ut=jt.length;Rt<Ut;Rt++){const[Gt,qt,vt,st]=jt[Rt],it=f*Gt[0]+yt,Mt=f*Gt[1]+X,zt=f*qt[0]+yt,Ht=f*qt[1]+X,D=f*vt[0]+yt,gt=f*vt[1]+X,Tt=f*st[0]+yt,Dt=f*st[1]+X;Rt===0&&(Bt.push(it,Mt),Xt.push(it,Mt)),Bt.push(zt,Ht,D,gt,Tt,Dt),Xt.push(zt,Ht),Rt===Ut-1&&Xt.push(Tt,Dt)}dt.push({bezier:H(wt=At,P,li).call(wt,Bt,Q,this.rotation),points:H(Ct=At,P,li).call(Ct,Xt,Q,this.rotation)})}return dt},ci=function(){let f=1/0,F=-1/0,z=1/0,Q=-1/0;for(const dt of this.paths)for(const[_t,yt,X,wt]of dt){const Ct=o.Util.bezierBoundingBox(..._t,...yt,...X,...wt);f=Math.min(f,Ct[0]),z=Math.min(z,Ct[1]),F=Math.max(F,Ct[2]),Q=Math.max(Q,Ct[3])}return[f,z,F,Q]},ke=function(){return t(this,u)?Math.ceil(this.thickness*this.parentScale):0},ae=function(f=!1){if(this.isEmpty())return;if(!t(this,u)){H(this,e,te).call(this);return}const F=H(this,e,ci).call(this),z=H(this,e,ke).call(this);tt(this,m,Math.max(T.AnnotationEditor.MIN_SIZE,F[2]-F[0])),tt(this,M,Math.max(T.AnnotationEditor.MIN_SIZE,F[3]-F[1]));const Q=Math.ceil(z+t(this,m)*this.scaleFactor),dt=Math.ceil(z+t(this,M)*this.scaleFactor),[_t,yt]=this.parentDimensions;this.width=Q/_t,this.height=dt/yt,this.setAspectRatio(Q,dt);const X=this.translationX,wt=this.translationY;this.translationX=-F[0],this.translationY=-F[1],H(this,e,re).call(this),H(this,e,te).call(this),tt(this,b,Q),tt(this,r,dt),this.setDims(Q,dt);const Ct=f?z/this.scaleFactor/2:0;this.translate(X-this.translationX-Ct,wt-this.translationY-Ct)},Z(At,P),Yt(At,"_defaultColor",null),Yt(At,"_defaultOpacity",1),Yt(At,"_defaultThickness",1),Yt(At,"_type","ink");let O=At;h.InkEditor=O},(St,h,lt)=>{var O,M,m,I,L,v,A,w,u,c,p,ge,me,Fe,hi,qi,Vi,di,Me,$i;Object.defineProperty(h,"__esModule",{value:!0}),h.StampEditor=void 0;var o=lt(1),T=lt(4),ct=lt(6),q=lt(29);const S=class S extends T.AnnotationEditor{constructor(V){super({...V,name:"stampEditor"});Z(this,p);Z(this,O,null);Z(this,M,null);Z(this,m,null);Z(this,I,null);Z(this,L,null);Z(this,v,null);Z(this,A,null);Z(this,w,null);Z(this,u,!1);Z(this,c,!1);tt(this,I,V.bitmapUrl),tt(this,L,V.bitmapFile)}static initialize(V){T.AnnotationEditor.initialize(V)}static get supportedTypes(){const V=["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"];return(0,o.shadow)(this,"supportedTypes",V.map(J=>`image/${J}`))}static get supportedTypesStr(){return(0,o.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(V){return this.supportedTypes.includes(V)}static paste(V,J){J.pasteEditor(o.AnnotationEditorType.STAMP,{bitmapFile:V.getAsFile()})}remove(){t(this,M)&&(tt(this,O,null),this._uiManager.imageManager.deleteId(t(this,M)),t(this,v)?.remove(),tt(this,v,null),t(this,A)?.disconnect(),tt(this,A,null)),super.remove()}rebuild(){if(!this.parent){t(this,M)&&H(this,p,Fe).call(this);return}super.rebuild(),this.div!==null&&(t(this,M)&&H(this,p,Fe).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(t(this,m)||t(this,O)||t(this,I)||t(this,L))}get isResizable(){return!0}render(){if(this.div)return this.div;let V,J;if(this.width&&(V=this.x,J=this.y),super.render(),this.div.hidden=!0,t(this,O)?H(this,p,hi).call(this):H(this,p,Fe).call(this),this.width){const[j,nt]=this.parentDimensions;this.setAt(V*j,J*nt,this.width*j,this.height*nt)}return this.div}static deserialize(V,J,j){if(V instanceof q.StampAnnotationElement)return null;const nt=super.deserialize(V,J,j),{rect:R,bitmapUrl:G,bitmapId:$,isSvg:y,accessibilityData:s}=V;$&&j.imageManager.isValidId($)?tt(nt,M,$):tt(nt,I,G),tt(nt,u,y);const[n,d]=nt.pageDimensions;return nt.width=(R[2]-R[0])/n,nt.height=(R[3]-R[1])/d,s&&(nt.altTextData=s),nt}serialize(V=!1,J=null){if(this.isEmpty())return null;const j={annotationType:o.AnnotationEditorType.STAMP,bitmapId:t(this,M),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:t(this,u),structTreeParentId:this._structTreeParentId};if(V)return j.bitmapUrl=H(this,p,Me).call(this,!0),j.accessibilityData=this.altTextData,j;const{decorative:nt,altText:R}=this.altTextData;if(!nt&&R&&(j.accessibilityData={type:"Figure",alt:R}),J===null)return j;J.stamps||(J.stamps=new Map);const G=t(this,u)?(j.rect[2]-j.rect[0])*(j.rect[3]-j.rect[1]):null;if(!J.stamps.has(t(this,M)))J.stamps.set(t(this,M),{area:G,serialized:j}),j.bitmap=H(this,p,Me).call(this,!1);else if(t(this,u)){const $=J.stamps.get(t(this,M));G>$.area&&($.area=G,$.serialized.bitmap.close(),$.serialized.bitmap=H(this,p,Me).call(this,!1))}return j}};O=new WeakMap,M=new WeakMap,m=new WeakMap,I=new WeakMap,L=new WeakMap,v=new WeakMap,A=new WeakMap,w=new WeakMap,u=new WeakMap,c=new WeakMap,p=new WeakSet,ge=function(V,J=!1){if(!V){this.remove();return}tt(this,O,V.bitmap),J||(tt(this,M,V.id),tt(this,u,V.isSvg)),H(this,p,hi).call(this)},me=function(){tt(this,m,null),this._uiManager.enableWaiting(!1),t(this,v)&&this.div.focus()},Fe=function(){if(t(this,M)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(t(this,M)).then(J=>H(this,p,ge).call(this,J,!0)).finally(()=>H(this,p,me).call(this));return}if(t(this,I)){const J=t(this,I);tt(this,I,null),this._uiManager.enableWaiting(!0),tt(this,m,this._uiManager.imageManager.getFromUrl(J).then(j=>H(this,p,ge).call(this,j)).finally(()=>H(this,p,me).call(this)));return}if(t(this,L)){const J=t(this,L);tt(this,L,null),this._uiManager.enableWaiting(!0),tt(this,m,this._uiManager.imageManager.getFromFile(J).then(j=>H(this,p,ge).call(this,j)).finally(()=>H(this,p,me).call(this)));return}const V=document.createElement("input");V.type="file",V.accept=S.supportedTypesStr,tt(this,m,new Promise(J=>{V.addEventListener("change",async()=>{if(!V.files||V.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const j=await this._uiManager.imageManager.getFromFile(V.files[0]);H(this,p,ge).call(this,j)}J()}),V.addEventListener("cancel",()=>{this.remove(),J()})}).finally(()=>H(this,p,me).call(this))),V.click()},hi=function(){const{div:V}=this;let{width:J,height:j}=t(this,O);const[nt,R]=this.pageDimensions,G=.75;if(this.width)J=this.width*nt,j=this.height*R;else if(J>G*nt||j>G*R){const n=Math.min(G*nt/J,G*R/j);J*=n,j*=n}const[$,y]=this.parentDimensions;this.setDims(J*$/nt,j*y/R),this._uiManager.enableWaiting(!1);const s=tt(this,v,document.createElement("canvas"));V.append(s),V.hidden=!1,H(this,p,di).call(this,J,j),H(this,p,$i).call(this),t(this,c)||(this.parent.addUndoableEditor(this),tt(this,c,!0)),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()},qi=function(V,J){const[j,nt]=this.parentDimensions;this.width=V/j,this.height=J/nt,this.setDims(V,J),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,t(this,w)!==null&&clearTimeout(t(this,w)),tt(this,w,setTimeout(()=>{tt(this,w,null),H(this,p,di).call(this,V,J)},200))},Vi=function(V,J){const{width:j,height:nt}=t(this,O);let R=j,G=nt,$=t(this,O);for(;R>2*V||G>2*J;){const y=R,s=G;R>2*V&&(R=R>=16384?Math.floor(R/2)-1:Math.ceil(R/2)),G>2*J&&(G=G>=16384?Math.floor(G/2)-1:Math.ceil(G/2));const n=new OffscreenCanvas(R,G);n.getContext("2d").drawImage($,0,0,y,s,0,0,R,G),$=n.transferToImageBitmap()}return $},di=function(V,J){V=Math.ceil(V),J=Math.ceil(J);const j=t(this,v);if(!j||j.width===V&&j.height===J)return;j.width=V,j.height=J;const nt=t(this,u)?t(this,O):H(this,p,Vi).call(this,V,J),R=j.getContext("2d");R.filter=this._uiManager.hcmFilter,R.drawImage(nt,0,0,nt.width,nt.height,0,0,V,J)},Me=function(V){if(V){if(t(this,u)){const nt=this._uiManager.imageManager.getSvgUrl(t(this,M));if(nt)return nt}const J=document.createElement("canvas");return{width:J.width,height:J.height}=t(this,O),J.getContext("2d").drawImage(t(this,O),0,0),J.toDataURL()}if(t(this,u)){const[J,j]=this.pageDimensions,nt=Math.round(this.width*J*ct.PixelsPerInch.PDF_TO_CSS_UNITS),R=Math.round(this.height*j*ct.PixelsPerInch.PDF_TO_CSS_UNITS),G=new OffscreenCanvas(nt,R);return G.getContext("2d").drawImage(t(this,O),0,0,t(this,O).width,t(this,O).height,0,0,nt,R),G.transferToImageBitmap()}return structuredClone(t(this,O))},$i=function(){tt(this,A,new ResizeObserver(V=>{const J=V[0].contentRect;J.width&&J.height&&H(this,p,qi).call(this,J.width,J.height)})),t(this,A).observe(this.div)},Yt(S,"_type","stamp");let mt=S;h.StampEditor=mt}],__webpack_module_cache__={};function __w_pdfjs_require__(St){var h=__webpack_module_cache__[St];if(h!==void 0)return h.exports;var lt=__webpack_module_cache__[St]={exports:{}};return __webpack_modules__[St](lt,lt.exports,__w_pdfjs_require__),lt.exports}var __webpack_exports__={};return(()=>{var St=__webpack_exports__;Object.defineProperty(St,"__esModule",{value:!0}),Object.defineProperty(St,"AbortException",{enumerable:!0,get:function(){return h.AbortException}}),Object.defineProperty(St,"AnnotationEditorLayer",{enumerable:!0,get:function(){return ct.AnnotationEditorLayer}}),Object.defineProperty(St,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return h.AnnotationEditorParamsType}}),Object.defineProperty(St,"AnnotationEditorType",{enumerable:!0,get:function(){return h.AnnotationEditorType}}),Object.defineProperty(St,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return q.AnnotationEditorUIManager}}),Object.defineProperty(St,"AnnotationLayer",{enumerable:!0,get:function(){return mt.AnnotationLayer}}),Object.defineProperty(St,"AnnotationMode",{enumerable:!0,get:function(){return h.AnnotationMode}}),Object.defineProperty(St,"CMapCompressionType",{enumerable:!0,get:function(){return h.CMapCompressionType}}),Object.defineProperty(St,"DOMSVGFactory",{enumerable:!0,get:function(){return o.DOMSVGFactory}}),Object.defineProperty(St,"FeatureTest",{enumerable:!0,get:function(){return h.FeatureTest}}),Object.defineProperty(St,"GlobalWorkerOptions",{enumerable:!0,get:function(){return O.GlobalWorkerOptions}}),Object.defineProperty(St,"ImageKind",{enumerable:!0,get:function(){return h.ImageKind}}),Object.defineProperty(St,"InvalidPDFException",{enumerable:!0,get:function(){return h.InvalidPDFException}}),Object.defineProperty(St,"MissingPDFException",{enumerable:!0,get:function(){return h.MissingPDFException}}),Object.defineProperty(St,"OPS",{enumerable:!0,get:function(){return h.OPS}}),Object.defineProperty(St,"PDFDataRangeTransport",{enumerable:!0,get:function(){return lt.PDFDataRangeTransport}}),Object.defineProperty(St,"PDFDateString",{enumerable:!0,get:function(){return o.PDFDateString}}),Object.defineProperty(St,"PDFWorker",{enumerable:!0,get:function(){return lt.PDFWorker}}),Object.defineProperty(St,"PasswordResponses",{enumerable:!0,get:function(){return h.PasswordResponses}}),Object.defineProperty(St,"PermissionFlag",{enumerable:!0,get:function(){return h.PermissionFlag}}),Object.defineProperty(St,"PixelsPerInch",{enumerable:!0,get:function(){return o.PixelsPerInch}}),Object.defineProperty(St,"PromiseCapability",{enumerable:!0,get:function(){return h.PromiseCapability}}),Object.defineProperty(St,"RenderingCancelledException",{enumerable:!0,get:function(){return o.RenderingCancelledException}}),Object.defineProperty(St,"SVGGraphics",{enumerable:!0,get:function(){return lt.SVGGraphics}}),Object.defineProperty(St,"UnexpectedResponseException",{enumerable:!0,get:function(){return h.UnexpectedResponseException}}),Object.defineProperty(St,"Util",{enumerable:!0,get:function(){return h.Util}}),Object.defineProperty(St,"VerbosityLevel",{enumerable:!0,get:function(){return h.VerbosityLevel}}),Object.defineProperty(St,"XfaLayer",{enumerable:!0,get:function(){return M.XfaLayer}}),Object.defineProperty(St,"build",{enumerable:!0,get:function(){return lt.build}}),Object.defineProperty(St,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return h.createValidAbsoluteUrl}}),Object.defineProperty(St,"getDocument",{enumerable:!0,get:function(){return lt.getDocument}}),Object.defineProperty(St,"getFilenameFromUrl",{enumerable:!0,get:function(){return o.getFilenameFromUrl}}),Object.defineProperty(St,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return o.getPdfFilenameFromUrl}}),Object.defineProperty(St,"getXfaPageViewport",{enumerable:!0,get:function(){return o.getXfaPageViewport}}),Object.defineProperty(St,"isDataScheme",{enumerable:!0,get:function(){return o.isDataScheme}}),Object.defineProperty(St,"isPdfFile",{enumerable:!0,get:function(){return o.isPdfFile}}),Object.defineProperty(St,"loadScript",{enumerable:!0,get:function(){return o.loadScript}}),Object.defineProperty(St,"noContextMenu",{enumerable:!0,get:function(){return o.noContextMenu}}),Object.defineProperty(St,"normalizeUnicode",{enumerable:!0,get:function(){return h.normalizeUnicode}}),Object.defineProperty(St,"renderTextLayer",{enumerable:!0,get:function(){return T.renderTextLayer}}),Object.defineProperty(St,"setLayerDimensions",{enumerable:!0,get:function(){return o.setLayerDimensions}}),Object.defineProperty(St,"shadow",{enumerable:!0,get:function(){return h.shadow}}),Object.defineProperty(St,"updateTextLayer",{enumerable:!0,get:function(){return T.updateTextLayer}}),Object.defineProperty(St,"version",{enumerable:!0,get:function(){return lt.version}});var h=__w_pdfjs_require__(1),lt=__w_pdfjs_require__(2),o=__w_pdfjs_require__(6),T=__w_pdfjs_require__(26),ct=__w_pdfjs_require__(27),q=__w_pdfjs_require__(5),mt=__w_pdfjs_require__(29),O=__w_pdfjs_require__(14),M=__w_pdfjs_require__(32)})(),__webpack_exports__})())}(pdf)),pdf.exports}export{commonjsRequire as c,requirePdf as r}; //# sourceMappingURL=pdf-vendor-Bz5wMm03.js.map
Close