Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

10 строки
384KB

  1. var tr=Object.defineProperty;var er=(R,o,t)=>o in R?tr(R,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):R[o]=t;var ee=(R,o,t)=>(er(R,typeof o!="symbol"?o+"":o,t),t),Be=(R,o,t)=>{if(!o.has(R))throw TypeError("Cannot "+t)};var r=(R,o,t)=>(Be(R,o,"read from private field"),t?t.call(R):o.get(R)),X=(R,o,t)=>{if(o.has(R))throw TypeError("Cannot add the same private member more than once");o instanceof WeakSet?o.add(R):o.set(R,t)},ot=(R,o,t,e)=>(Be(R,o,"write to private field"),e?e.call(R,t):o.set(R,t),t),ge=(R,o,t,e)=>({set _(n){ot(R,o,n,t)},get _(){return r(R,o,e)}}),j=(R,o,t)=>(Be(R,o,"access private method"),t);import{af as getAugmentedNamespace,ag as commonjsGlobal}from"./index.8d65dd27.js";function commonjsRequire(R){throw new Error('Could not dynamically require "'+R+'". 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$$6=getAugmentedNamespace(__viteBrowserExternal$1);var path2dPolyfill_min={},hasRequiredPath2dPolyfill_min;function requirePath2dPolyfill_min(){return hasRequiredPath2dPolyfill_min||(hasRequiredPath2dPolyfill_min=1,function(){function R(s,m,d){if(d||arguments.length===2)for(var x,v=0,b=m.length;v<b;v++)!x&&v in m||(x||(x=Array.prototype.slice.call(m,0,v)),x[v]=m[v]);return s.concat(x||Array.prototype.slice.call(m))}var o={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},t=/([astvzqmhlc])([^astvzqmhlc]*)/gi,e=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function n(s){var m=[],d=String(s).trim();return d[0]!=="M"&&d[0]!=="m"||d.replace(t,function(x,v,b){var y=function(D){var I=D.match(e);return I?I.map(Number):[]}(b),C=v.toLowerCase(),P=v;if(C==="m"&&y.length>2&&(m.push(R([P],y.splice(0,2),!0)),C="l",P=P==="m"?"l":"L"),y.length<o[C])return"";for(m.push(R([P],y.splice(0,o[C]),!0));y.length>=o[C]&&y.length&&o[C];)m.push(R([P],y.splice(0,o[C]),!0));return""}),m}function l(s,m){var d=s.x*Math.cos(m)-s.y*Math.sin(m),x=s.y*Math.cos(m)+s.x*Math.sin(m);s.x=d,s.y=x}function g(s,m){s.x*=m,s.y*=m}var w=function(){function s(m){var d;this.commands=[],m&&m instanceof s?(d=this.commands).push.apply(d,m.commands):m&&(this.commands=n(m))}return s.prototype.addPath=function(m){var d;m&&m instanceof s&&(d=this.commands).push.apply(d,m.commands)},s.prototype.moveTo=function(m,d){this.commands.push(["M",m,d])},s.prototype.lineTo=function(m,d){this.commands.push(["L",m,d])},s.prototype.arc=function(m,d,x,v,b,y){this.commands.push(["AC",m,d,x,v,b,!!y])},s.prototype.arcTo=function(m,d,x,v,b){this.commands.push(["AT",m,d,x,v,b])},s.prototype.ellipse=function(m,d,x,v,b,y,C,P){this.commands.push(["E",m,d,x,v,b,y,C,!!P])},s.prototype.closePath=function(){this.commands.push(["Z"])},s.prototype.bezierCurveTo=function(m,d,x,v,b,y){this.commands.push(["C",m,d,x,v,b,y])},s.prototype.quadraticCurveTo=function(m,d,x,v){this.commands.push(["Q",m,d,x,v])},s.prototype.rect=function(m,d,x,v){this.commands.push(["R",m,d,x,v])},s.prototype.roundRect=function(m,d,x,v,b){b===void 0?this.commands.push(["RR",m,d,x,v,0]):this.commands.push(["RR",m,d,x,v,b])},s}();function k(s,m){var d,x,v,b,y,C,P,D,I,h,E,N,M,A,F,O,G,_,B,K,rt,st,Y,ct,nt=0,it=0,kt=null,U=null,c=null,f=null,i=null,u=null;s.beginPath();for(var p=0;p<m.length;++p){(_=m[p][0])!=="S"&&_!=="s"&&_!=="C"&&_!=="c"&&(kt=null,U=null),_!=="T"&&_!=="t"&&_!=="Q"&&_!=="q"&&(c=null,f=null);var T=void 0;switch(_){case"m":case"M":T=m[p],_==="m"?(nt+=T[1],it+=T[2]):(nt=T[1],it=T[2]),_!=="M"&&i||(i={x:nt,y:it}),s.moveTo(nt,it);break;case"l":nt+=(T=m[p])[1],it+=T[2],s.lineTo(nt,it);break;case"L":nt=(T=m[p])[1],it=T[2],s.lineTo(nt,it);break;case"H":nt=(T=m[p])[1],s.lineTo(nt,it);break;case"h":nt+=(T=m[p])[1],s.lineTo(nt,it);break;case"V":it=(T=m[p])[1],s.lineTo(nt,it);break;case"v":it+=(T=m[p])[1],s.lineTo(nt,it);break;case"a":case"A":if(T=m[p],u===null)throw new Error("This should never happen");_==="a"?(nt+=T[6],it+=T[7]):(nt=T[6],it=T[7]),A=T[1],F=T[2],P=T[3]*Math.PI/180,v=!!T[4],b=!!T[5],y={x:nt,y:it},l(C={x:(u.x-y.x)/2,y:(u.y-y.y)/2},-P),(D=C.x*C.x/(A*A)+C.y*C.y/(F*F))>1&&(A*=D=Math.sqrt(D),F*=D),I=A*A*F*F,h=A*A*C.y*C.y+F*F*C.x*C.x,g(B={x:A*C.y/F,y:-F*C.x/A},b!==v?Math.sqrt((I-h)/h)||0:-Math.sqrt((I-h)/h)||0),x=Math.atan2((C.y-B.y)/F,(C.x-B.x)/A),d=Math.atan2(-(C.y+B.y)/F,-(C.x+B.x)/A),l(B,P),st=B,Y=(y.x+u.x)/2,ct=(y.y+u.y)/2,st.x+=Y,st.y+=ct,s.save(),s.translate(B.x,B.y),s.rotate(P),s.scale(A,F),s.arc(0,0,1,x,d,!b),s.restore();break;case"C":kt=(T=m[p])[3],U=T[4],nt=T[5],it=T[6],s.bezierCurveTo(T[1],T[2],kt,U,nt,it);break;case"c":T=m[p],s.bezierCurveTo(T[1]+nt,T[2]+it,T[3]+nt,T[4]+it,T[5]+nt,T[6]+it),kt=T[3]+nt,U=T[4]+it,nt+=T[5],it+=T[6];break;case"S":T=m[p],kt!==null&&U!==null||(kt=nt,U=it),s.bezierCurveTo(2*nt-kt,2*it-U,T[1],T[2],T[3],T[4]),kt=T[1],U=T[2],nt=T[3],it=T[4];break;case"s":T=m[p],kt!==null&&U!==null||(kt=nt,U=it),s.bezierCurveTo(2*nt-kt,2*it-U,T[1]+nt,T[2]+it,T[3]+nt,T[4]+it),kt=T[1]+nt,U=T[2]+it,nt+=T[3],it+=T[4];break;case"Q":c=(T=m[p])[1],f=T[2],nt=T[3],it=T[4],s.quadraticCurveTo(c,f,nt,it);break;case"q":c=(T=m[p])[1]+nt,f=T[2]+it,nt+=T[3],it+=T[4],s.quadraticCurveTo(c,f,nt,it);break;case"T":c!==null&&f!==null||(c=nt,f=it),c=2*nt-c,f=2*it-f,nt=(T=m[p])[1],it=T[2],s.quadraticCurveTo(c,f,nt,it);break;case"t":c!==null&&f!==null||(c=nt,f=it),c=2*nt-c,f=2*it-f,nt+=(T=m[p])[1],it+=T[2],s.quadraticCurveTo(c,f,nt,it);break;case"z":case"Z":i&&(nt=i.x,it=i.y),i=null,s.closePath();break;case"AC":nt=(T=m[p])[1],it=T[2],M=T[3],x=T[4],d=T[5],K=T[6],s.arc(nt,it,M,x,d,K);break;case"AT":E=(T=m[p])[1],N=T[2],nt=T[3],it=T[4],M=T[5],s.arcTo(E,N,nt,it,M);break;case"E":nt=(T=m[p])[1],it=T[2],A=T[3],F=T[4],P=T[5],x=T[6],d=T[7],K=T[8],s.save(),s.translate(nt,it),s.rotate(P),s.scale(A,F),s.arc(0,0,1,x,d,K),s.restore();break;case"R":nt=(T=m[p])[1],it=T[2],O=T[3],G=T[4],i={x:nt,y:it},s.rect(nt,it,O,G);break;case"RR":nt=(T=m[p])[1],it=T[2],O=T[3],G=T[4],rt=T[5],i={x:nt,y:it},s.roundRect(nt,it,O,G,rt)}u?(u.x=nt,u.y=it):u={x:nt,y:it}}}function S(s,m,d,x,v){var b=this;if(v===void 0&&(v=0),typeof v=="number"&&(v=[v]),Array.isArray(v)){if(v.length===0||v.length>4)throw new RangeError("Failed to execute 'roundRect' on '".concat(this.constructor.name,"': ").concat(v.length," radii provided. Between one and four radii are necessary."));if(v.forEach(function(h){if(h<0)throw new RangeError("Failed to execute 'roundRect' on '".concat(b.constructor.name,"': Radius value ").concat(h," is negative."))}),v.length===1&&v[0]===0)return this.rect(s,m,d,x);var y,C,P,D=Math.min(d,x)/2,I=y=C=P=Math.min(D,v[0]);v.length===2&&(y=P=Math.min(D,v[1])),v.length===3&&(y=P=Math.min(D,v[1]),C=Math.min(D,v[2])),v.length===4&&(y=Math.min(D,v[1]),C=Math.min(D,v[2]),P=Math.min(D,v[3])),this.moveTo(s,m+x-P),this.arcTo(s,m,s+I,m,I),this.arcTo(s+d,m,s+d,m+y,y),this.arcTo(s+d,m+x,s+d-C,m+x,C),this.arcTo(s,m+x,s,m+x-P,P),this.moveTo(s,m)}}(function(s){if(s&&s.CanvasRenderingContext2D&&!s.Path2D){var m=s.CanvasRenderingContext2D,d=m.prototype.fill,x=m.prototype.stroke,v=m.prototype.isPointInPath;m.prototype.fill=function(){for(var b=[],y=0;y<arguments.length;y++)b[y]=arguments[y];if(!(b[0]instanceof w))return P=b[0]||"nonzero",d.apply(this,[P]);var C=b[0],P=b[1]||"nonzero";k(this,C.commands),d.apply(this,[P])},m.prototype.stroke=function(b){b&&k(this,b.commands),x.apply(this)},m.prototype.isPointInPath=function(){for(var b=[],y=0;y<arguments.length;y++)b[y]=arguments[y];if(b[0]instanceof w){var C=b[0],P=b[1],D=b[2],I=b[3]||"nonzero";return k(this,C.commands),v.apply(this,[P,D,I])}return v.apply(this,b)},s.Path2D=w}})(window),function(s){if(s&&s.CanvasRenderingContext2D){var m=s.CanvasRenderingContext2D,d=s.Path2D;m&&!m.prototype.roundRect&&(m.prototype.roundRect=S),d&&!d.prototype.roundRect&&(d.prototype.roundRect=S)}}(window)}()),path2dPolyfill_min}(function(module,exports){(function(o,t){module.exports=o.pdfjsLib=t()})(globalThis,()=>(()=>{var __webpack_modules__=[,(R,o,t)=>{var $t;Object.defineProperty(o,"__esModule",{value:!0}),o.VerbosityLevel=o.Util=o.UnknownErrorException=o.UnexpectedResponseException=o.TextRenderingMode=o.RenderingIntentFlag=o.PromiseCapability=o.PermissionFlag=o.PasswordResponses=o.PasswordException=o.PageActionEventType=o.OPS=o.MissingPDFException=o.MAX_IMAGE_SIZE_TO_CACHE=o.LINE_FACTOR=o.LINE_DESCENT_FACTOR=o.InvalidPDFException=o.ImageKind=o.IDENTITY_MATRIX=o.FormatError=o.FeatureTest=o.FONT_IDENTITY_MATRIX=o.DocumentActionEventType=o.CMapCompressionType=o.BaseException=o.BASELINE_FACTOR=o.AnnotationType=o.AnnotationReplyType=o.AnnotationPrefix=o.AnnotationMode=o.AnnotationFlag=o.AnnotationFieldFlag=o.AnnotationEditorType=o.AnnotationEditorPrefix=o.AnnotationEditorParamsType=o.AnnotationBorderStyleType=o.AnnotationActionEventType=o.AbortException=void 0,o.assert=nt,o.bytesToString=tt,o.createValidAbsoluteUrl=kt,o.getModificationDate=Gt,o.getUuid=Jt,o.getVerbosityLevel=rt,o.info=st,o.isArrayBuffer=wt,o.isArrayEqual=It,o.isNodeJS=void 0,o.normalizeUnicode=Kt,o.objectFromMap=Et,o.objectSize=ft,o.setVerbosityLevel=K,o.shadow=U,o.string32=ut,o.stringToBytes=q,o.stringToPDFString=dt,o.stringToUTF8String=at,o.unreachable=ct,o.utf8StringToString=pt,o.warn=Y,t(2),t(84),t(86),t(87),t(89),t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123);const e=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");o.isNodeJS=e;const n=[1,0,0,1,0,0];o.IDENTITY_MATRIX=n;const l=[.001,0,0,.001,0,0];o.FONT_IDENTITY_MATRIX=l;const g=1e7;o.MAX_IMAGE_SIZE_TO_CACHE=g;const w=1.35;o.LINE_FACTOR=w;const k=.35;o.LINE_DESCENT_FACTOR=k;const S=k/w;o.BASELINE_FACTOR=S;const s={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};o.RenderingIntentFlag=s;const m={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};o.AnnotationMode=m;const d="pdfjs_internal_editor_";o.AnnotationEditorPrefix=d;const x={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};o.AnnotationEditorType=x;const v={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};o.AnnotationEditorParamsType=v;const b={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};o.PermissionFlag=b;const y={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};o.TextRenderingMode=y;const C={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};o.ImageKind=C;const P={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};o.AnnotationType=P;const D={GROUP:"Group",REPLY:"R"};o.AnnotationReplyType=D;const I={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};o.AnnotationFlag=I;const h={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};o.AnnotationFieldFlag=h;const E={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};o.AnnotationBorderStyleType=E;const N={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"};o.AnnotationActionEventType=N;const M={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};o.DocumentActionEventType=M;const A={O:"PageOpen",C:"PageClose"};o.PageActionEventType=A;const F={ERRORS:0,WARNINGS:1,INFOS:5};o.VerbosityLevel=F;const O={NONE:0,BINARY:1};o.CMapCompressionType=O;const G={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};o.OPS=G;const _={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};o.PasswordResponses=_;let B=F.WARNINGS;function K(yt){Number.isInteger(yt)&&(B=yt)}function rt(){return B}function st(yt){B>=F.INFOS&&console.log(`Info: ${yt}`)}function Y(yt){B>=F.WARNINGS&&console.log(`Warning: ${yt}`)}function ct(yt){throw new Error(yt)}function nt(yt,Z){yt||ct(Z)}function it(yt){switch(yt==null?void 0:yt.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function kt(yt){let Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!yt)return null;try{if(J&&typeof yt=="string"){if(J.addDefaultProtocol&&yt.startsWith("www.")){const jt=yt.match(/\./g);(jt==null?void 0:jt.length)>=2&&(yt=`http://${yt}`)}if(J.tryConvertEncoding)try{yt=at(yt)}catch{}}const mt=Z?new URL(yt,Z):new URL(yt);if(it(mt))return mt}catch{}return null}function U(yt,Z,J){let mt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return Object.defineProperty(yt,Z,{value:J,enumerable:!mt,configurable:!0,writable:!1}),J}const c=function(){function Z(J,mt){this.constructor===Z&&ct("Cannot initialize BaseException."),this.message=J,this.name=mt}return Z.prototype=new Error,Z.constructor=Z,Z}();o.BaseException=c;class f extends c{constructor(Z,J){super(Z,"PasswordException"),this.code=J}}o.PasswordException=f;class i extends c{constructor(Z,J){super(Z,"UnknownErrorException"),this.details=J}}o.UnknownErrorException=i;class u extends c{constructor(Z){super(Z,"InvalidPDFException")}}o.InvalidPDFException=u;class p extends c{constructor(Z){super(Z,"MissingPDFException")}}o.MissingPDFException=p;class T extends c{constructor(Z,J){super(Z,"UnexpectedResponseException"),this.status=J}}o.UnexpectedResponseException=T;class W extends c{constructor(Z){super(Z,"FormatError")}}o.FormatError=W;class H extends c{constructor(Z){super(Z,"AbortException")}}o.AbortException=H;function tt(yt){(typeof yt!="object"||(yt==null?void 0:yt.length)===void 0)&&ct("Invalid argument for bytesToString");const Z=yt.length,J=8192;if(Z<J)return String.fromCharCode.apply(null,yt);const mt=[];for(let jt=0;jt<Z;jt+=J){const lt=Math.min(jt+J,Z),z=yt.subarray(jt,lt);mt.push(String.fromCharCode.apply(null,z))}return mt.join("")}function q(yt){typeof yt!="string"&&ct("Invalid argument for stringToBytes");const Z=yt.length,J=new Uint8Array(Z);for(let mt=0;mt<Z;++mt)J[mt]=yt.charCodeAt(mt)&255;return J}function ut(yt){return String.fromCharCode(yt>>24&255,yt>>16&255,yt>>8&255,yt&255)}function ft(yt){return Object.keys(yt).length}function Et(yt){const Z=Object.create(null);for(const[J,mt]of yt)Z[J]=mt;return Z}function vt(){const yt=new Uint8Array(4);return yt[0]=1,new Uint32Array(yt.buffer,0,1)[0]===1}function Dt(){try{return new Function(""),!0}catch{return!1}}class Wt{static get isLittleEndian(){return U(this,"isLittleEndian",vt())}static get isEvalSupported(){return U(this,"isEvalSupported",Dt())}static get isOffscreenCanvasSupported(){return U(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?U(this,"platform",{isWin:!1,isMac:!1}):U(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var Z,J;return U(this,"isCSSRoundSupported",(J=(Z=globalThis.CSS)==null?void 0:Z.supports)==null?void 0:J.call(Z,"width: round(1.5px, 1px)"))}}o.FeatureTest=Wt;const Rt=[...Array(256).keys()].map(yt=>yt.toString(16).padStart(2,"0"));class Nt{static makeHexColor(Z,J,mt){return`#${Rt[Z]}${Rt[J]}${Rt[mt]}`}static scaleMinMax(Z,J){let mt;Z[0]?(Z[0]<0&&(mt=J[0],J[0]=J[1],J[1]=mt),J[0]*=Z[0],J[1]*=Z[0],Z[3]<0&&(mt=J[2],J[2]=J[3],J[3]=mt),J[2]*=Z[3],J[3]*=Z[3]):(mt=J[0],J[0]=J[2],J[2]=mt,mt=J[1],J[1]=J[3],J[3]=mt,Z[1]<0&&(mt=J[2],J[2]=J[3],J[3]=mt),J[2]*=Z[1],J[3]*=Z[1],Z[2]<0&&(mt=J[0],J[0]=J[1],J[1]=mt),J[0]*=Z[2],J[1]*=Z[2]),J[0]+=Z[4],J[1]+=Z[4],J[2]+=Z[5],J[3]+=Z[5]}static transform(Z,J){return[Z[0]*J[0]+Z[2]*J[1],Z[1]*J[0]+Z[3]*J[1],Z[0]*J[2]+Z[2]*J[3],Z[1]*J[2]+Z[3]*J[3],Z[0]*J[4]+Z[2]*J[5]+Z[4],Z[1]*J[4]+Z[3]*J[5]+Z[5]]}static applyTransform(Z,J){const mt=Z[0]*J[0]+Z[1]*J[2]+J[4],jt=Z[0]*J[1]+Z[1]*J[3]+J[5];return[mt,jt]}static applyInverseTransform(Z,J){const mt=J[0]*J[3]-J[1]*J[2],jt=(Z[0]*J[3]-Z[1]*J[2]+J[2]*J[5]-J[4]*J[3])/mt,lt=(-Z[0]*J[1]+Z[1]*J[0]+J[4]*J[1]-J[5]*J[0])/mt;return[jt,lt]}static getAxialAlignedBoundingBox(Z,J){const mt=this.applyTransform(Z,J),jt=this.applyTransform(Z.slice(2,4),J),lt=this.applyTransform([Z[0],Z[3]],J),z=this.applyTransform([Z[2],Z[1]],J);return[Math.min(mt[0],jt[0],lt[0],z[0]),Math.min(mt[1],jt[1],lt[1],z[1]),Math.max(mt[0],jt[0],lt[0],z[0]),Math.max(mt[1],jt[1],lt[1],z[1])]}static inverseTransform(Z){const J=Z[0]*Z[3]-Z[1]*Z[2];return[Z[3]/J,-Z[1]/J,-Z[2]/J,Z[0]/J,(Z[2]*Z[5]-Z[4]*Z[3])/J,(Z[4]*Z[1]-Z[5]*Z[0])/J]}static singularValueDecompose2dScale(Z){const J=[Z[0],Z[2],Z[1],Z[3]],mt=Z[0]*J[0]+Z[1]*J[2],jt=Z[0]*J[1]+Z[1]*J[3],lt=Z[2]*J[0]+Z[3]*J[2],z=Z[2]*J[1]+Z[3]*J[3],gt=(mt+z)/2,xt=Math.sqrt((mt+z)**2-4*(mt*z-lt*jt))/2,St=gt+xt||1,Pt=gt-xt||1;return[Math.sqrt(St),Math.sqrt(Pt)]}static normalizeRect(Z){const J=Z.slice(0);return Z[0]>Z[2]&&(J[0]=Z[2],J[2]=Z[0]),Z[1]>Z[3]&&(J[1]=Z[3],J[3]=Z[1]),J}static intersect(Z,J){const mt=Math.max(Math.min(Z[0],Z[2]),Math.min(J[0],J[2])),jt=Math.min(Math.max(Z[0],Z[2]),Math.max(J[0],J[2]));if(mt>jt)return null;const lt=Math.max(Math.min(Z[1],Z[3]),Math.min(J[1],J[3])),z=Math.min(Math.max(Z[1],Z[3]),Math.max(J[1],J[3]));return lt>z?null:[mt,lt,jt,z]}static bezierBoundingBox(Z,J,mt,jt,lt,z,gt,xt){const St=[],Pt=[[],[]];let bt,Ht,Tt,Lt,Ft,$,a,L;for(let ht=0;ht<2;++ht){if(ht===0?(Ht=6*Z-12*mt+6*lt,bt=-3*Z+9*mt-9*lt+3*gt,Tt=3*mt-3*Z):(Ht=6*J-12*jt+6*z,bt=-3*J+9*jt-9*z+3*xt,Tt=3*jt-3*J),Math.abs(bt)<1e-12){if(Math.abs(Ht)<1e-12)continue;Lt=-Tt/Ht,0<Lt&&Lt<1&&St.push(Lt);continue}a=Ht*Ht-4*Tt*bt,L=Math.sqrt(a),!(a<0)&&(Ft=(-Ht+L)/(2*bt),0<Ft&&Ft<1&&St.push(Ft),$=(-Ht-L)/(2*bt),0<$&&$<1&&St.push($))}let V=St.length,Q;const et=V;for(;V--;)Lt=St[V],Q=1-Lt,Pt[0][V]=Q*Q*Q*Z+3*Q*Q*Lt*mt+3*Q*Lt*Lt*lt+Lt*Lt*Lt*gt,Pt[1][V]=Q*Q*Q*J+3*Q*Q*Lt*jt+3*Q*Lt*Lt*z+Lt*Lt*Lt*xt;return Pt[0][et]=Z,Pt[1][et]=J,Pt[0][et+1]=gt,Pt[1][et+1]=xt,Pt[0].length=Pt[1].length=et+2,[Math.min(...Pt[0]),Math.min(...Pt[1]),Math.max(...Pt[0]),Math.max(...Pt[1])]}}o.Util=Nt;const At=[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(yt){if(yt[0]>="\xEF"){let J;if(yt[0]==="\xFE"&&yt[1]==="\xFF"?J="utf-16be":yt[0]==="\xFF"&&yt[1]==="\xFE"?J="utf-16le":yt[0]==="\xEF"&&yt[1]==="\xBB"&&yt[2]==="\xBF"&&(J="utf-8"),J)try{const mt=new TextDecoder(J,{fatal:!0}),jt=q(yt);return mt.decode(jt)}catch(mt){Y(`stringToPDFString: "${mt}".`)}}const Z=[];for(let J=0,mt=yt.length;J<mt;J++){const jt=At[yt.charCodeAt(J)];Z.push(jt?String.fromCharCode(jt):yt.charAt(J))}return Z.join("")}function at(yt){return decodeURIComponent(escape(yt))}function pt(yt){return unescape(encodeURIComponent(yt))}function wt(yt){return typeof yt=="object"&&(yt==null?void 0:yt.byteLength)!==void 0}function It(yt,Z){if(yt.length!==Z.length)return!1;for(let J=0,mt=yt.length;J<mt;J++)if(yt[J]!==Z[J])return!1;return!0}function Gt(){let yt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return[yt.getUTCFullYear().toString(),(yt.getUTCMonth()+1).toString().padStart(2,"0"),yt.getUTCDate().toString().padStart(2,"0"),yt.getUTCHours().toString().padStart(2,"0"),yt.getUTCMinutes().toString().padStart(2,"0"),yt.getUTCSeconds().toString().padStart(2,"0")].join("")}class Xt{constructor(){X(this,$t,!1);this.promise=new Promise((Z,J)=>{this.resolve=mt=>{ot(this,$t,!0),Z(mt)},this.reject=mt=>{ot(this,$t,!0),J(mt)}})}get settled(){return r(this,$t)}}$t=new WeakMap,o.PromiseCapability=Xt;let zt=null,Vt=null;function Kt(yt){return zt||(zt=/([\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,Vt=new Map([["\uFB05","\u017Ft"]])),yt.replaceAll(zt,(Z,J,mt)=>J?J.normalize("NFKC"):Vt.get(mt))}function Jt(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const yt=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(yt);else for(let Z=0;Z<32;Z++)yt[Z]=Math.floor(Math.random()*255);return tt(yt)}const Zt="pdfjs_internal_id_";o.AnnotationPrefix=Zt},(R,o,t)=>{var e=t(3),n=t(4),l=t(69),g=t(70),w="WebAssembly",k=n[w],S=Error("e",{cause:7}).cause!==7,s=function(d,x){var v={};v[d]=g(d,x,S),e({global:!0,constructor:!0,arity:1,forced:S},v)},m=function(d,x){if(k&&k[d]){var v={};v[d]=g(w+"."+d,x,S),e({target:w,stat:!0,constructor:!0,arity:1,forced:S},v)}};s("Error",function(d){return function(v){return l(d,this,arguments)}}),s("EvalError",function(d){return function(v){return l(d,this,arguments)}}),s("RangeError",function(d){return function(v){return l(d,this,arguments)}}),s("ReferenceError",function(d){return function(v){return l(d,this,arguments)}}),s("SyntaxError",function(d){return function(v){return l(d,this,arguments)}}),s("TypeError",function(d){return function(v){return l(d,this,arguments)}}),s("URIError",function(d){return function(v){return l(d,this,arguments)}}),m("CompileError",function(d){return function(v){return l(d,this,arguments)}}),m("LinkError",function(d){return function(v){return l(d,this,arguments)}}),m("RuntimeError",function(d){return function(v){return l(d,this,arguments)}})},(R,o,t)=>{var e=t(4),n=t(5).f,l=t(44),g=t(48),w=t(38),k=t(56),S=t(68);R.exports=function(s,m){var d=s.target,x=s.global,v=s.stat,b,y,C,P,D,I;if(x?y=e:v?y=e[d]||w(d,{}):y=(e[d]||{}).prototype,y)for(C in m){if(D=m[C],s.dontCallGetSet?(I=n(y,C),P=I&&I.value):P=y[C],b=S(x?C:d+(v?".":"#")+C,s.forced),!b&&P!==void 0){if(typeof D==typeof P)continue;k(D,P)}(s.sham||P&&P.sham)&&l(D,"sham",!0),g(y,C,D,s)}}},function(R){var o=function(t){return t&&t.Math===Math&&t};R.exports=o(typeof globalThis=="object"&&globalThis)||o(typeof window=="object"&&window)||o(typeof self=="object"&&self)||o(typeof commonjsGlobal=="object"&&commonjsGlobal)||function(){return this}()||this||Function("return this")()},(R,o,t)=>{var e=t(6),n=t(8),l=t(10),g=t(11),w=t(12),k=t(18),S=t(39),s=t(42),m=Object.getOwnPropertyDescriptor;o.f=e?m:function(x,v){if(x=w(x),v=k(v),s)try{return m(x,v)}catch{}if(S(x,v))return g(!n(l.f,x,v),x[v])}},(R,o,t)=>{var e=t(7);R.exports=!e(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})},R=>{R.exports=function(o){try{return!!o()}catch{return!0}}},(R,o,t)=>{var e=t(9),n=Function.prototype.call;R.exports=e?n.bind(n):function(){return n.apply(n,arguments)}},(R,o,t)=>{var e=t(7);R.exports=!e(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})},(R,o)=>{var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,n=e&&!t.call({1:2},1);o.f=n?function(g){var w=e(this,g);return!!w&&w.enumerable}:t},R=>{R.exports=function(o,t){return{enumerable:!(o&1),configurable:!(o&2),writable:!(o&4),value:t}}},(R,o,t)=>{var e=t(13),n=t(16);R.exports=function(l){return e(n(l))}},(R,o,t)=>{var e=t(14),n=t(7),l=t(15),g=Object,w=e("".split);R.exports=n(function(){return!g("z").propertyIsEnumerable(0)})?function(k){return l(k)==="String"?w(k,""):g(k)}:g},(R,o,t)=>{var e=t(9),n=Function.prototype,l=n.call,g=e&&n.bind.bind(l,l);R.exports=e?g:function(w){return function(){return l.apply(w,arguments)}}},(R,o,t)=>{var e=t(14),n=e({}.toString),l=e("".slice);R.exports=function(g){return l(n(g),8,-1)}},(R,o,t)=>{var e=t(17),n=TypeError;R.exports=function(l){if(e(l))throw n("Can't call method on "+l);return l}},R=>{R.exports=function(o){return o==null}},(R,o,t)=>{var e=t(19),n=t(23);R.exports=function(l){var g=e(l,"string");return n(g)?g:g+""}},(R,o,t)=>{var e=t(8),n=t(20),l=t(23),g=t(30),w=t(33),k=t(34),S=TypeError,s=k("toPrimitive");R.exports=function(m,d){if(!n(m)||l(m))return m;var x=g(m,s),v;if(x){if(d===void 0&&(d="default"),v=e(x,m,d),!n(v)||l(v))return v;throw S("Can't convert object to primitive value")}return d===void 0&&(d="number"),w(m,d)}},(R,o,t)=>{var e=t(21),n=t(22),l=n.all;R.exports=n.IS_HTMLDDA?function(g){return typeof g=="object"?g!==null:e(g)||g===l}:function(g){return typeof g=="object"?g!==null:e(g)}},(R,o,t)=>{var e=t(22),n=e.all;R.exports=e.IS_HTMLDDA?function(l){return typeof l=="function"||l===n}:function(l){return typeof l=="function"}},R=>{var o=typeof document=="object"&&document.all,t=typeof o>"u"&&o!==void 0;R.exports={all:o,IS_HTMLDDA:t}},(R,o,t)=>{var e=t(24),n=t(21),l=t(25),g=t(26),w=Object;R.exports=g?function(k){return typeof k=="symbol"}:function(k){var S=e("Symbol");return n(S)&&l(S.prototype,w(k))}},(R,o,t)=>{var e=t(4),n=t(21),l=function(g){return n(g)?g:void 0};R.exports=function(g,w){return arguments.length<2?l(e[g]):e[g]&&e[g][w]}},(R,o,t)=>{var e=t(14);R.exports=e({}.isPrototypeOf)},(R,o,t)=>{var e=t(27);R.exports=e&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},(R,o,t)=>{var e=t(28),n=t(7),l=t(4),g=l.String;R.exports=!!Object.getOwnPropertySymbols&&!n(function(){var w=Symbol("symbol detection");return!g(w)||!(Object(w)instanceof Symbol)||!Symbol.sham&&e&&e<41})},(R,o,t)=>{var e=t(4),n=t(29),l=e.process,g=e.Deno,w=l&&l.versions||g&&g.version,k=w&&w.v8,S,s;k&&(S=k.split("."),s=S[0]>0&&S[0]<4?1:+(S[0]+S[1])),!s&&n&&(S=n.match(/Edge\/(\d+)/),(!S||S[1]>=74)&&(S=n.match(/Chrome\/(\d+)/),S&&(s=+S[1]))),R.exports=s},R=>{R.exports=typeof navigator<"u"&&String(navigator.userAgent)||""},(R,o,t)=>{var e=t(31),n=t(17);R.exports=function(l,g){var w=l[g];return n(w)?void 0:e(w)}},(R,o,t)=>{var e=t(21),n=t(32),l=TypeError;R.exports=function(g){if(e(g))return g;throw l(n(g)+" is not a function")}},R=>{var o=String;R.exports=function(t){try{return o(t)}catch{return"Object"}}},(R,o,t)=>{var e=t(8),n=t(21),l=t(20),g=TypeError;R.exports=function(w,k){var S,s;if(k==="string"&&n(S=w.toString)&&!l(s=e(S,w))||n(S=w.valueOf)&&!l(s=e(S,w))||k!=="string"&&n(S=w.toString)&&!l(s=e(S,w)))return s;throw g("Can't convert object to primitive value")}},(R,o,t)=>{var e=t(4),n=t(35),l=t(39),g=t(41),w=t(27),k=t(26),S=e.Symbol,s=n("wks"),m=k?S.for||S:S&&S.withoutSetter||g;R.exports=function(d){return l(s,d)||(s[d]=w&&l(S,d)?S[d]:m("Symbol."+d)),s[d]}},(R,o,t)=>{var e=t(36),n=t(37);(R.exports=function(l,g){return n[l]||(n[l]=g!==void 0?g:{})})("versions",[]).push({version:"3.32.2",mode:e?"pure":"global",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.32.2/LICENSE",source:"https://github.com/zloirock/core-js"})},R=>{R.exports=!1},(R,o,t)=>{var e=t(4),n=t(38),l="__core-js_shared__",g=e[l]||n(l,{});R.exports=g},(R,o,t)=>{var e=t(4),n=Object.defineProperty;R.exports=function(l,g){try{n(e,l,{value:g,configurable:!0,writable:!0})}catch{e[l]=g}return g}},(R,o,t)=>{var e=t(14),n=t(40),l=e({}.hasOwnProperty);R.exports=Object.hasOwn||function(w,k){return l(n(w),k)}},(R,o,t)=>{var e=t(16),n=Object;R.exports=function(l){return n(e(l))}},(R,o,t)=>{var e=t(14),n=0,l=Math.random(),g=e(1 .toString);R.exports=function(w){return"Symbol("+(w===void 0?"":w)+")_"+g(++n+l,36)}},(R,o,t)=>{var e=t(6),n=t(7),l=t(43);R.exports=!e&&!n(function(){return Object.defineProperty(l("div"),"a",{get:function(){return 7}}).a!==7})},(R,o,t)=>{var e=t(4),n=t(20),l=e.document,g=n(l)&&n(l.createElement);R.exports=function(w){return g?l.createElement(w):{}}},(R,o,t)=>{var e=t(6),n=t(45),l=t(11);R.exports=e?function(g,w,k){return n.f(g,w,l(1,k))}:function(g,w,k){return g[w]=k,g}},(R,o,t)=>{var e=t(6),n=t(42),l=t(46),g=t(47),w=t(18),k=TypeError,S=Object.defineProperty,s=Object.getOwnPropertyDescriptor,m="enumerable",d="configurable",x="writable";o.f=e?l?function(b,y,C){if(g(b),y=w(y),g(C),typeof b=="function"&&y==="prototype"&&"value"in C&&x in C&&!C[x]){var P=s(b,y);P&&P[x]&&(b[y]=C.value,C={configurable:d in C?C[d]:P[d],enumerable:m in C?C[m]:P[m],writable:!1})}return S(b,y,C)}:S:function(b,y,C){if(g(b),y=w(y),g(C),n)try{return S(b,y,C)}catch{}if("get"in C||"set"in C)throw k("Accessors not supported");return"value"in C&&(b[y]=C.value),b}},(R,o,t)=>{var e=t(6),n=t(7);R.exports=e&&n(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})},(R,o,t)=>{var e=t(20),n=String,l=TypeError;R.exports=function(g){if(e(g))return g;throw l(n(g)+" is not an object")}},(R,o,t)=>{var e=t(21),n=t(45),l=t(49),g=t(38);R.exports=function(w,k,S,s){s||(s={});var m=s.enumerable,d=s.name!==void 0?s.name:k;if(e(S)&&l(S,d,s),s.global)m?w[k]=S:g(k,S);else{try{s.unsafe?w[k]&&(m=!0):delete w[k]}catch{}m?w[k]=S:n.f(w,k,{value:S,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return w}},(R,o,t)=>{var e=t(14),n=t(7),l=t(21),g=t(39),w=t(6),k=t(50).CONFIGURABLE,S=t(51),s=t(52),m=s.enforce,d=s.get,x=String,v=Object.defineProperty,b=e("".slice),y=e("".replace),C=e([].join),P=w&&!n(function(){return v(function(){},"length",{value:8}).length!==8}),D=String(String).split("String"),I=R.exports=function(h,E,N){b(x(E),0,7)==="Symbol("&&(E="["+y(x(E),/^Symbol\(([^)]*)\)/,"$1")+"]"),N&&N.getter&&(E="get "+E),N&&N.setter&&(E="set "+E),(!g(h,"name")||k&&h.name!==E)&&(w?v(h,"name",{value:E,configurable:!0}):h.name=E),P&&N&&g(N,"arity")&&h.length!==N.arity&&v(h,"length",{value:N.arity});try{N&&g(N,"constructor")&&N.constructor?w&&v(h,"prototype",{writable:!1}):h.prototype&&(h.prototype=void 0)}catch{}var M=m(h);return g(M,"source")||(M.source=C(D,typeof E=="string"?E:"")),h};Function.prototype.toString=I(function(){return l(this)&&d(this).source||S(this)},"toString")},(R,o,t)=>{var e=t(6),n=t(39),l=Function.prototype,g=e&&Object.getOwnPropertyDescriptor,w=n(l,"name"),k=w&&function(){}.name==="something",S=w&&(!e||e&&g(l,"name").configurable);R.exports={EXISTS:w,PROPER:k,CONFIGURABLE:S}},(R,o,t)=>{var e=t(14),n=t(21),l=t(37),g=e(Function.toString);n(l.inspectSource)||(l.inspectSource=function(w){return g(w)}),R.exports=l.inspectSource},(R,o,t)=>{var e=t(53),n=t(4),l=t(20),g=t(44),w=t(39),k=t(37),S=t(54),s=t(55),m="Object already initialized",d=n.TypeError,x=n.WeakMap,v,b,y,C=function(h){return y(h)?b(h):v(h,{})},P=function(h){return function(E){var N;if(!l(E)||(N=b(E)).type!==h)throw d("Incompatible receiver, "+h+" required");return N}};if(e||k.state){var D=k.state||(k.state=new x);D.get=D.get,D.has=D.has,D.set=D.set,v=function(h,E){if(D.has(h))throw d(m);return E.facade=h,D.set(h,E),E},b=function(h){return D.get(h)||{}},y=function(h){return D.has(h)}}else{var I=S("state");s[I]=!0,v=function(h,E){if(w(h,I))throw d(m);return E.facade=h,g(h,I,E),E},b=function(h){return w(h,I)?h[I]:{}},y=function(h){return w(h,I)}}R.exports={set:v,get:b,has:y,enforce:C,getterFor:P}},(R,o,t)=>{var e=t(4),n=t(21),l=e.WeakMap;R.exports=n(l)&&/native code/.test(String(l))},(R,o,t)=>{var e=t(35),n=t(41),l=e("keys");R.exports=function(g){return l[g]||(l[g]=n(g))}},R=>{R.exports={}},(R,o,t)=>{var e=t(39),n=t(57),l=t(5),g=t(45);R.exports=function(w,k,S){for(var s=n(k),m=g.f,d=l.f,x=0;x<s.length;x++){var v=s[x];!e(w,v)&&!(S&&e(S,v))&&m(w,v,d(k,v))}}},(R,o,t)=>{var e=t(24),n=t(14),l=t(58),g=t(67),w=t(47),k=n([].concat);R.exports=e("Reflect","ownKeys")||function(s){var m=l.f(w(s)),d=g.f;return d?k(m,d(s)):m}},(R,o,t)=>{var e=t(59),n=t(66),l=n.concat("length","prototype");o.f=Object.getOwnPropertyNames||function(w){return e(w,l)}},(R,o,t)=>{var e=t(14),n=t(39),l=t(12),g=t(60).indexOf,w=t(55),k=e([].push);R.exports=function(S,s){var m=l(S),d=0,x=[],v;for(v in m)!n(w,v)&&n(m,v)&&k(x,v);for(;s.length>d;)n(m,v=s[d++])&&(~g(x,v)||k(x,v));return x}},(R,o,t)=>{var e=t(12),n=t(61),l=t(64),g=function(w){return function(k,S,s){var m=e(k),d=l(m),x=n(s,d),v;if(w&&S!==S){for(;d>x;)if(v=m[x++],v!==v)return!0}else for(;d>x;x++)if((w||x in m)&&m[x]===S)return w||x||0;return!w&&-1}};R.exports={includes:g(!0),indexOf:g(!1)}},(R,o,t)=>{var e=t(62),n=Math.max,l=Math.min;R.exports=function(g,w){var k=e(g);return k<0?n(k+w,0):l(k,w)}},(R,o,t)=>{var e=t(63);R.exports=function(n){var l=+n;return l!==l||l===0?0:e(l)}},R=>{var o=Math.ceil,t=Math.floor;R.exports=Math.trunc||function(n){var l=+n;return(l>0?t:o)(l)}},(R,o,t)=>{var e=t(65);R.exports=function(n){return e(n.length)}},(R,o,t)=>{var e=t(62),n=Math.min;R.exports=function(l){return l>0?n(e(l),9007199254740991):0}},R=>{R.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(R,o)=>{o.f=Object.getOwnPropertySymbols},(R,o,t)=>{var e=t(7),n=t(21),l=/#|\.prototype\./,g=function(m,d){var x=k[w(m)];return x===s?!0:x===S?!1:n(d)?e(d):!!d},w=g.normalize=function(m){return String(m).replace(l,".").toLowerCase()},k=g.data={},S=g.NATIVE="N",s=g.POLYFILL="P";R.exports=g},(R,o,t)=>{var e=t(9),n=Function.prototype,l=n.apply,g=n.call;R.exports=typeof Reflect=="object"&&Reflect.apply||(e?g.bind(l):function(){return g.apply(l,arguments)})},(R,o,t)=>{var e=t(24),n=t(39),l=t(44),g=t(25),w=t(71),k=t(56),S=t(74),s=t(75),m=t(76),d=t(80),x=t(81),v=t(6),b=t(36);R.exports=function(y,C,P,D){var I="stackTraceLimit",h=D?2:1,E=y.split("."),N=E[E.length-1],M=e.apply(null,E);if(!!M){var A=M.prototype;if(!b&&n(A,"cause")&&delete A.cause,!P)return M;var F=e("Error"),O=C(function(G,_){var B=m(D?_:G,void 0),K=D?new M(G):new M;return B!==void 0&&l(K,"message",B),x(K,O,K.stack,2),this&&g(A,this)&&s(K,this,O),arguments.length>h&&d(K,arguments[h]),K});if(O.prototype=A,N!=="Error"?w?w(O,F):k(O,F,{name:!0}):v&&I in M&&(S(O,M,I),S(O,M,"prepareStackTrace")),k(O,M),!b)try{A.name!==N&&l(A,"name",N),A.constructor=O}catch{}return O}}},(R,o,t)=>{var e=t(72),n=t(47),l=t(73);R.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var g=!1,w={},k;try{k=e(Object.prototype,"__proto__","set"),k(w,[]),g=w instanceof Array}catch{}return function(s,m){return n(s),l(m),g?k(s,m):s.__proto__=m,s}}():void 0)},(R,o,t)=>{var e=t(14),n=t(31);R.exports=function(l,g,w){try{return e(n(Object.getOwnPropertyDescriptor(l,g)[w]))}catch{}}},(R,o,t)=>{var e=t(21),n=String,l=TypeError;R.exports=function(g){if(typeof g=="object"||e(g))return g;throw l("Can't set "+n(g)+" as a prototype")}},(R,o,t)=>{var e=t(45).f;R.exports=function(n,l,g){g in n||e(n,g,{configurable:!0,get:function(){return l[g]},set:function(w){l[g]=w}})}},(R,o,t)=>{var e=t(21),n=t(20),l=t(71);R.exports=function(g,w,k){var S,s;return l&&e(S=w.constructor)&&S!==k&&n(s=S.prototype)&&s!==k.prototype&&l(g,s),g}},(R,o,t)=>{var e=t(77);R.exports=function(n,l){return n===void 0?arguments.length<2?"":l:e(n)}},(R,o,t)=>{var e=t(78),n=String;R.exports=function(l){if(e(l)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return n(l)}},(R,o,t)=>{var e=t(79),n=t(21),l=t(15),g=t(34),w=g("toStringTag"),k=Object,S=l(function(){return arguments}())==="Arguments",s=function(m,d){try{return m[d]}catch{}};R.exports=e?l:function(m){var d,x,v;return m===void 0?"Undefined":m===null?"Null":typeof(x=s(d=k(m),w))=="string"?x:S?l(d):(v=l(d))==="Object"&&n(d.callee)?"Arguments":v}},(R,o,t)=>{var e=t(34),n=e("toStringTag"),l={};l[n]="z",R.exports=String(l)==="[object z]"},(R,o,t)=>{var e=t(20),n=t(44);R.exports=function(l,g){e(g)&&"cause"in g&&n(l,"cause",g.cause)}},(R,o,t)=>{var e=t(44),n=t(82),l=t(83),g=Error.captureStackTrace;R.exports=function(w,k,S,s){l&&(g?g(w,k):e(w,"stack",n(S,s)))}},(R,o,t)=>{var e=t(14),n=Error,l=e("".replace),g=function(S){return String(n(S).stack)}("zxcasd"),w=/\n\s*at [^:]*:[^\n]*/,k=w.test(g);R.exports=function(S,s){if(k&&typeof S=="string"&&!n.prepareStackTrace)for(;s--;)S=l(S,w,"");return S}},(R,o,t)=>{var e=t(7),n=t(11);R.exports=!e(function(){var l=Error("a");return"stack"in l?(Object.defineProperty(l,"stack",n(1,7)),l.stack!==7):!0})},(R,o,t)=>{var e=t(48),n=t(14),l=t(77),g=t(85),w=URLSearchParams,k=w.prototype,S=n(k.append),s=n(k.delete),m=n(k.forEach),d=n([].push),x=new w("a=1&a=2&b=3");x.delete("a",1),x.delete("b",void 0),x+""!="a=2"&&e(k,"delete",function(v){var b=arguments.length,y=b<2?void 0:arguments[1];if(b&&y===void 0)return s(this,v);var C=[];m(this,function(A,F){d(C,{key:F,value:A})}),g(b,1);for(var P=l(v),D=l(y),I=0,h=0,E=!1,N=C.length,M;I<N;)M=C[I++],E||M.key===P?(E=!0,s(this,M.key)):h++;for(;h<N;)M=C[h++],M.key===P&&M.value===D||S(this,M.key,M.value)},{enumerable:!0,unsafe:!0})},R=>{var o=TypeError;R.exports=function(t,e){if(t<e)throw o("Not enough arguments");return t}},(R,o,t)=>{var e=t(48),n=t(14),l=t(77),g=t(85),w=URLSearchParams,k=w.prototype,S=n(k.getAll),s=n(k.has),m=new w("a=1");(m.has("a",2)||!m.has("a",void 0))&&e(k,"has",function(x){var v=arguments.length,b=v<2?void 0:arguments[1];if(v&&b===void 0)return s(this,x);var y=S(this,x);g(v,1);for(var C=l(b),P=0;P<y.length;)if(y[P++]===C)return!0;return!1},{enumerable:!0,unsafe:!0})},(R,o,t)=>{var e=t(6),n=t(14),l=t(88),g=URLSearchParams.prototype,w=n(g.forEach);e&&!("size"in g)&&l(g,"size",{get:function(){var S=0;return w(this,function(){S++}),S},configurable:!0,enumerable:!0})},(R,o,t)=>{var e=t(49),n=t(45);R.exports=function(l,g,w){return w.get&&e(w.get,g,{getter:!0}),w.set&&e(w.set,g,{setter:!0}),n.f(l,g,w)}},(R,o,t)=>{var e=t(3),n=t(40),l=t(64),g=t(90),w=t(92),k=t(7),S=k(function(){return[].push.call({length:4294967296},1)!==4294967297}),s=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(d){return d instanceof TypeError}},m=S||!s();e({target:"Array",proto:!0,arity:1,forced:m},{push:function(x){var v=n(this),b=l(v),y=arguments.length;w(b+y);for(var C=0;C<y;C++)v[b]=arguments[C],b++;return g(v,b),b}})},(R,o,t)=>{var e=t(6),n=t(91),l=TypeError,g=Object.getOwnPropertyDescriptor,w=e&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(k){return k instanceof TypeError}}();R.exports=w?function(k,S){if(n(k)&&!g(k,"length").writable)throw l("Cannot set read only .length");return k.length=S}:function(k,S){return k.length=S}},(R,o,t)=>{var e=t(15);R.exports=Array.isArray||function(l){return e(l)==="Array"}},R=>{var o=TypeError,t=9007199254740991;R.exports=function(e){if(e>t)throw o("Maximum allowed index exceeded");return e}},(R,o,t)=>{var e=t(94),n=t(98).findLast,l=e.aTypedArray,g=e.exportTypedArrayMethod;g("findLast",function(k){return n(l(this),k,arguments.length>1?arguments[1]:void 0)})},(R,o,t)=>{var e=t(95),n=t(6),l=t(4),g=t(21),w=t(20),k=t(39),S=t(78),s=t(32),m=t(44),d=t(48),x=t(88),v=t(25),b=t(96),y=t(71),C=t(34),P=t(41),D=t(52),I=D.enforce,h=D.get,E=l.Int8Array,N=E&&E.prototype,M=l.Uint8ClampedArray,A=M&&M.prototype,F=E&&b(E),O=N&&b(N),G=Object.prototype,_=l.TypeError,B=C("toStringTag"),K=P("TYPED_ARRAY_TAG"),rt="TypedArrayConstructor",st=e&&!!y&&S(l.opera)!=="Opera",Y=!1,ct,nt,it,kt={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},U={BigInt64Array:8,BigUint64Array:8},c=function(tt){if(!w(tt))return!1;var q=S(tt);return q==="DataView"||k(kt,q)||k(U,q)},f=function(H){var tt=b(H);if(!!w(tt)){var q=h(tt);return q&&k(q,rt)?q[rt]:f(tt)}},i=function(H){if(!w(H))return!1;var tt=S(H);return k(kt,tt)||k(U,tt)},u=function(H){if(i(H))return H;throw _("Target is not a typed array")},p=function(H){if(g(H)&&(!y||v(F,H)))return H;throw _(s(H)+" is not a typed array constructor")},T=function(H,tt,q,ut){if(!!n){if(q)for(var ft in kt){var Et=l[ft];if(Et&&k(Et.prototype,H))try{delete Et.prototype[H]}catch{try{Et.prototype[H]=tt}catch{}}}(!O[H]||q)&&d(O,H,q?tt:st&&N[H]||tt,ut)}},W=function(H,tt,q){var ut,ft;if(!!n){if(y){if(q){for(ut in kt)if(ft=l[ut],ft&&k(ft,H))try{delete ft[H]}catch{}}if(!F[H]||q)try{return d(F,H,q?tt:st&&F[H]||tt)}catch{}else return}for(ut in kt)ft=l[ut],ft&&(!ft[H]||q)&&d(ft,H,tt)}};for(ct in kt)nt=l[ct],it=nt&&nt.prototype,it?I(it)[rt]=nt:st=!1;for(ct in U)nt=l[ct],it=nt&&nt.prototype,it&&(I(it)[rt]=nt);if((!st||!g(F)||F===Function.prototype)&&(F=function(){throw _("Incorrect invocation")},st))for(ct in kt)l[ct]&&y(l[ct],F);if((!st||!O||O===G)&&(O=F.prototype,st))for(ct in kt)l[ct]&&y(l[ct].prototype,O);if(st&&b(A)!==O&&y(A,O),n&&!k(O,B)){Y=!0,x(O,B,{configurable:!0,get:function(){return w(this)?this[K]:void 0}});for(ct in kt)l[ct]&&m(l[ct],K,ct)}R.exports={NATIVE_ARRAY_BUFFER_VIEWS:st,TYPED_ARRAY_TAG:Y&&K,aTypedArray:u,aTypedArrayConstructor:p,exportTypedArrayMethod:T,exportTypedArrayStaticMethod:W,getTypedArrayConstructor:f,isView:c,isTypedArray:i,TypedArray:F,TypedArrayPrototype:O}},R=>{R.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"},(R,o,t)=>{var e=t(39),n=t(21),l=t(40),g=t(54),w=t(97),k=g("IE_PROTO"),S=Object,s=S.prototype;R.exports=w?S.getPrototypeOf:function(m){var d=l(m);if(e(d,k))return d[k];var x=d.constructor;return n(x)&&d instanceof x?x.prototype:d instanceof S?s:null}},(R,o,t)=>{var e=t(7);R.exports=!e(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})},(R,o,t)=>{var e=t(99),n=t(13),l=t(40),g=t(64),w=function(k){var S=k===1;return function(s,m,d){for(var x=l(s),v=n(x),b=e(m,d),y=g(v),C,P;y-- >0;)if(C=v[y],P=b(C,y,x),P)switch(k){case 0:return C;case 1:return y}return S?-1:void 0}};R.exports={findLast:w(0),findLastIndex:w(1)}},(R,o,t)=>{var e=t(100),n=t(31),l=t(9),g=e(e.bind);R.exports=function(w,k){return n(w),k===void 0?w:l?g(w,k):function(){return w.apply(k,arguments)}}},(R,o,t)=>{var e=t(15),n=t(14);R.exports=function(l){if(e(l)==="Function")return n(l)}},(R,o,t)=>{var e=t(94),n=t(98).findLastIndex,l=e.aTypedArray,g=e.exportTypedArrayMethod;g("findLastIndex",function(k){return n(l(this),k,arguments.length>1?arguments[1]:void 0)})},(R,o,t)=>{var e=t(4),n=t(8),l=t(94),g=t(64),w=t(103),k=t(40),S=t(7),s=e.RangeError,m=e.Int8Array,d=m&&m.prototype,x=d&&d.set,v=l.aTypedArray,b=l.exportTypedArrayMethod,y=!S(function(){var P=new Uint8ClampedArray(2);return n(x,P,{length:1,0:3},1),P[1]!==3}),C=y&&l.NATIVE_ARRAY_BUFFER_VIEWS&&S(function(){var P=new m(2);return P.set(1),P.set("2",1),P[0]!==0||P[1]!==2});b("set",function(D){v(this);var I=w(arguments.length>1?arguments[1]:void 0,1),h=k(D);if(y)return n(x,this,h,I);var E=this.length,N=g(h),M=0;if(N+I>E)throw s("Wrong length");for(;M<N;)this[I+M]=h[M++]},!y||C)},(R,o,t)=>{var e=t(104),n=RangeError;R.exports=function(l,g){var w=e(l);if(w%g)throw n("Wrong offset");return w}},(R,o,t)=>{var e=t(62),n=RangeError;R.exports=function(l){var g=e(l);if(g<0)throw n("The argument can't be less than 0");return g}},(R,o,t)=>{var e=t(106),n=t(94),l=n.aTypedArray,g=n.exportTypedArrayMethod,w=n.getTypedArrayConstructor;g("toReversed",function(){return e(l(this),w(this))})},(R,o,t)=>{var e=t(64);R.exports=function(n,l){for(var g=e(n),w=new l(g),k=0;k<g;k++)w[k]=n[g-k-1];return w}},(R,o,t)=>{var e=t(94),n=t(14),l=t(31),g=t(108),w=e.aTypedArray,k=e.getTypedArrayConstructor,S=e.exportTypedArrayMethod,s=n(e.TypedArrayPrototype.sort);S("toSorted",function(d){d!==void 0&&l(d);var x=w(this),v=g(k(x),x);return s(v,d)})},(R,o,t)=>{var e=t(64);R.exports=function(n,l){for(var g=0,w=e(l),k=new n(w);w>g;)k[g]=l[g++];return k}},(R,o,t)=>{var e=t(110),n=t(94),l=t(111),g=t(62),w=t(112),k=n.aTypedArray,S=n.getTypedArrayConstructor,s=n.exportTypedArrayMethod,m=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(d){return d===8}}();s("with",function(d,x){var v=k(this),b=g(d),y=l(v)?w(x):+x;return e(v,S(v),b,y)},!m)},(R,o,t)=>{var e=t(64),n=t(62),l=RangeError;R.exports=function(g,w,k,S){var s=e(g),m=n(k),d=m<0?s+m:m;if(d>=s||d<0)throw l("Incorrect index");for(var x=new w(s),v=0;v<s;v++)x[v]=v===d?S:g[v];return x}},(R,o,t)=>{var e=t(78);R.exports=function(n){var l=e(n);return l==="BigInt64Array"||l==="BigUint64Array"}},(R,o,t)=>{var e=t(19),n=TypeError;R.exports=function(l){var g=e(l,"number");if(typeof g=="number")throw n("Can't convert number to bigint");return BigInt(g)}},(R,o,t)=>{var e=t(6),n=t(88),l=t(114),g=ArrayBuffer.prototype;e&&!("detached"in g)&&n(g,"detached",{configurable:!0,get:function(){return l(this)}})},(R,o,t)=>{var e=t(14),n=t(115),l=e(ArrayBuffer.prototype.slice);R.exports=function(g){if(n(g)!==0)return!1;try{return l(g,0,0),!1}catch{return!0}}},(R,o,t)=>{var e=t(72),n=t(15),l=TypeError;R.exports=e(ArrayBuffer.prototype,"byteLength","get")||function(g){if(n(g)!=="ArrayBuffer")throw l("ArrayBuffer expected");return g.byteLength}},(R,o,t)=>{var e=t(3),n=t(117);n&&e({target:"ArrayBuffer",proto:!0},{transfer:function(){return n(this,arguments.length?arguments[0]:void 0,!0)}})},(R,o,t)=>{var e=t(4),n=t(14),l=t(72),g=t(118),w=t(114),k=t(115),S=t(119),s=e.TypeError,m=e.structuredClone,d=e.ArrayBuffer,x=e.DataView,v=Math.min,b=d.prototype,y=x.prototype,C=n(b.slice),P=l(b,"resizable","get"),D=l(b,"maxByteLength","get"),I=n(y.getInt8),h=n(y.setInt8);R.exports=S&&function(E,N,M){var A=k(E),F=N===void 0?A:g(N),O=!P||!P(E);if(w(E))throw s("ArrayBuffer is detached");var G=m(E,{transfer:[E]});if(A===F&&(M||O))return G;if(A>=F&&(!M||O))return C(G,0,F);for(var _=M&&!O&&D?{maxByteLength:D(G)}:void 0,B=new d(F,_),K=new x(G),rt=new x(B),st=v(F,A),Y=0;Y<st;Y++)h(rt,Y,I(K,Y));return B}},(R,o,t)=>{var e=t(62),n=t(65),l=RangeError;R.exports=function(g){if(g===void 0)return 0;var w=e(g),k=n(w);if(w!==k)throw l("Wrong length or index");return k}},(R,o,t)=>{var e=t(4),n=t(7),l=t(28),g=t(120),w=t(121),k=t(122),S=e.structuredClone;R.exports=!!S&&!n(function(){if(w&&l>92||k&&l>94||g&&l>97)return!1;var s=new ArrayBuffer(8),m=S(s,{transfer:[s]});return s.byteLength!==0||m.byteLength!==8})},(R,o,t)=>{var e=t(121),n=t(122);R.exports=!e&&!n&&typeof window=="object"&&typeof document=="object"},R=>{R.exports=typeof Deno=="object"&&Deno&&typeof Deno.version=="object"},(R,o,t)=>{var e=t(4),n=t(15);R.exports=n(e.process)==="process"},(R,o,t)=>{var e=t(3),n=t(117);n&&e({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return n(this,arguments.length?arguments[0]:void 0,!1)}})},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var R,t,e,n,he,g,xe,k,S,s,m,d,x,v,b,y,Te,P,D,Ue,h,E;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,__w_pdfjs_require__(84),__w_pdfjs_require__(86),__w_pdfjs_require__(87),__w_pdfjs_require__(2),__w_pdfjs_require__(93),__w_pdfjs_require__(101),__w_pdfjs_require__(102),__w_pdfjs_require__(105),__w_pdfjs_require__(107),__w_pdfjs_require__(109),__w_pdfjs_require__(113),__w_pdfjs_require__(116),__w_pdfjs_require__(123),__w_pdfjs_require__(89),__w_pdfjs_require__(125),__w_pdfjs_require__(136),__w_pdfjs_require__(138),__w_pdfjs_require__(141),__w_pdfjs_require__(143),__w_pdfjs_require__(145),__w_pdfjs_require__(147),__w_pdfjs_require__(149),__w_pdfjs_require__(152);var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(163),_display_utils=__w_pdfjs_require__(168),_font_loader=__w_pdfjs_require__(171),_displayNode_utils=__w_pdfjs_require__(172),_canvas=__w_pdfjs_require__(173),_worker_options=__w_pdfjs_require__(176),_message_handler=__w_pdfjs_require__(177),_metadata=__w_pdfjs_require__(178),_optional_content_config=__w_pdfjs_require__(179),_transport_stream=__w_pdfjs_require__(180),_displayFetch_stream=__w_pdfjs_require__(181),_displayNetwork=__w_pdfjs_require__(184),_displayNode_stream=__w_pdfjs_require__(185),_displaySvg=__w_pdfjs_require__(186),_xfa_text=__w_pdfjs_require__(194);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(M){var Gt,Xt;if(typeof M=="string"||M instanceof URL?M={url:M}:(0,_util.isArrayBuffer)(M)&&(M={data:M}),typeof M!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!M.url&&!M.data&&!M.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const A=new PDFDocumentLoadingTask,{docId:F}=A,O=M.url?getUrlProp(M.url):null,G=M.data?getDataProp(M.data):null,_=M.httpHeaders||null,B=M.withCredentials===!0,K=(Gt=M.password)!=null?Gt:null,rt=M.range instanceof PDFDataRangeTransport?M.range:null,st=Number.isInteger(M.rangeChunkSize)&&M.rangeChunkSize>0?M.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let Y=M.worker instanceof PDFWorker?M.worker:null;const ct=M.verbosity,nt=typeof M.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(M.docBaseUrl)?M.docBaseUrl:null,it=typeof M.cMapUrl=="string"?M.cMapUrl:null,kt=M.cMapPacked!==!1,U=M.CMapReaderFactory||DefaultCMapReaderFactory,c=typeof M.standardFontDataUrl=="string"?M.standardFontDataUrl:null,f=M.StandardFontDataFactory||DefaultStandardFontDataFactory,i=M.stopAtErrors!==!0,u=Number.isInteger(M.maxImageSize)&&M.maxImageSize>-1?M.maxImageSize:-1,p=M.isEvalSupported!==!1,T=typeof M.isOffscreenCanvasSupported=="boolean"?M.isOffscreenCanvasSupported:!_util.isNodeJS,W=Number.isInteger(M.canvasMaxAreaInBytes)?M.canvasMaxAreaInBytes:-1,H=typeof M.disableFontFace=="boolean"?M.disableFontFace:_util.isNodeJS,tt=M.fontExtraProperties===!0,q=M.enableXfa===!0,ut=M.ownerDocument||globalThis.document,ft=M.disableRange===!0,Et=M.disableStream===!0,vt=M.disableAutoFetch===!0,Dt=M.pdfBug===!0,Wt=rt?rt.length:(Xt=M.length)!=null?Xt:NaN,Rt=typeof M.useSystemFonts=="boolean"?M.useSystemFonts:!_util.isNodeJS&&!H,Nt=typeof M.useWorkerFetch=="boolean"?M.useWorkerFetch:U===_display_utils.DOMCMapReaderFactory&&f===_display_utils.DOMStandardFontDataFactory&&it&&c&&(0,_display_utils.isValidFetchUrl)(it,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(c,document.baseURI),At=M.canvasFactory||new DefaultCanvasFactory({ownerDocument:ut}),dt=M.filterFactory||new DefaultFilterFactory({docId:F,ownerDocument:ut}),at=null;(0,_util.setVerbosityLevel)(ct);const pt={canvasFactory:At,filterFactory:dt};if(Nt||(pt.cMapReaderFactory=new U({baseUrl:it,isCompressed:kt}),pt.standardFontDataFactory=new f({baseUrl:c})),!Y){const zt={verbosity:ct,port:_worker_options.GlobalWorkerOptions.workerPort};Y=zt.port?PDFWorker.fromPort(zt):new PDFWorker(zt),A._worker=Y}const wt={docId:F,apiVersion:"3.11.174",data:G,password:K,disableAutoFetch:vt,rangeChunkSize:st,length:Wt,docBaseUrl:nt,enableXfa:q,evaluatorOptions:{maxImageSize:u,disableFontFace:H,ignoreErrors:i,isEvalSupported:p,isOffscreenCanvasSupported:T,canvasMaxAreaInBytes:W,fontExtraProperties:tt,useSystemFonts:Rt,cMapUrl:Nt?it:null,standardFontDataUrl:Nt?c:null}},It={ignoreErrors:i,isEvalSupported:p,disableFontFace:H,fontExtraProperties:tt,enableXfa:q,ownerDocument:ut,disableAutoFetch:vt,pdfBug:Dt,styleElement:at};return Y.promise.then(function(){if(A.destroyed)throw new Error("Loading aborted");const zt=_fetchDocument(Y,wt),Vt=new Promise(function(Kt){let Jt;rt?Jt=new _transport_stream.PDFDataTransportStream({length:Wt,initialData:rt.initialData,progressiveDone:rt.progressiveDone,contentDispositionFilename:rt.contentDispositionFilename,disableRange:ft,disableStream:Et},rt):G||(Jt=($t=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream($t):(0,_display_utils.isValidFetchUrl)($t.url)?new _displayFetch_stream.PDFFetchStream($t):new _displayNetwork.PDFNetworkStream($t))({url:O,length:Wt,httpHeaders:_,withCredentials:B,rangeChunkSize:st,disableRange:ft,disableStream:Et})),Kt(Jt)});return Promise.all([zt,Vt]).then(function(Kt){let[Jt,Zt]=Kt;if(A.destroyed)throw new Error("Loading aborted");const $t=new _message_handler.MessageHandler(F,Jt,Y.port),yt=new WorkerTransport($t,A,Zt,It,pt);A._transport=yt,$t.send("Ready",null)})}).catch(A._capability.reject),A}async function _fetchDocument(M,A){if(M.destroyed)throw new Error("Worker was destroyed");const F=await M.messageHandler.sendWithPromise("GetDocRequest",A,A.data?[A.data.buffer]:null);if(M.destroyed)throw new Error("Worker was destroyed");return F}function getUrlProp(M){if(M instanceof URL)return M.href;try{return new URL(M,window.location).href}catch{if(_util.isNodeJS&&typeof M=="string")return M}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(M){if(_util.isNodeJS&&typeof Buffer<"u"&&M instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(M instanceof Uint8Array&&M.byteLength===M.buffer.byteLength)return M;if(typeof M=="string")return(0,_util.stringToBytes)(M);if(typeof M=="object"&&!isNaN(M==null?void 0:M.length)||(0,_util.isArrayBuffer)(M))return new Uint8Array(M);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const o=class{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${ge(o,R)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var A,F,O;this.destroyed=!0;try{(A=this._worker)!=null&&A.port&&(this._worker._pendingDestroy=!0),await((F=this._transport)==null?void 0:F.destroy())}catch(G){throw(O=this._worker)!=null&&O.port&&delete this._worker._pendingDestroy,G}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};let PDFDocumentLoadingTask=o;R=new WeakMap,X(PDFDocumentLoadingTask,R,0),exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(A,F){let O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,G=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;this.length=A,this.initialData=F,this.progressiveDone=O,this.contentDispositionFilename=G,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(A){this._rangeListeners.push(A)}addProgressListener(A){this._progressListeners.push(A)}addProgressiveReadListener(A){this._progressiveReadListeners.push(A)}addProgressiveDoneListener(A){this._progressiveDoneListeners.push(A)}onDataRange(A,F){for(const O of this._rangeListeners)O(A,F)}onDataProgress(A,F){this._readyCapability.promise.then(()=>{for(const O of this._progressListeners)O(A,F)})}onDataProgressiveRead(A){this._readyCapability.promise.then(()=>{for(const F of this._progressiveReadListeners)F(A)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const A of this._progressiveDoneListeners)A()})}transportReady(){this._readyCapability.resolve()}requestDataRange(A,F){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(A,F){this._pdfInfo=A,this._transport=F,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(O=>{if(!O)return O;const G=[];for(const _ in O)G.push(...O[_]);return G}))})}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(A){return this._transport.getPage(A)}getPageIndex(A){return this._transport.getPageIndex(A)}getDestinations(){return this._transport.getDestinations()}getDestination(A){return this._transport.getDestination(A)}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(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this._transport.startCleanup(A||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(A,F,O){X(this,n);X(this,g);X(this,t,null);X(this,e,!1);let G=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;this._pageIndex=A,this._pageInfo=F,this._transport=O,this._stats=G?new _display_utils.StatTimer:null,this._pdfBug=G,this.commonObjs=O.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(){let{scale:A,rotation:F=this.rotate,offsetX:O=0,offsetY:G=0,dontFlip:_=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:A,rotation:F,offsetX:O,offsetY:G,dontFlip:_})}getAnnotations(){let{intent:A="display"}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const F=this._transport.getRenderingIntent(A);return this._transport.getAnnotations(this._pageIndex,F.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(){var A;return((A=this._transport._htmlForXfa)==null?void 0:A.children[this._pageIndex])||null}render(A){var i,u;let{canvasContext:F,viewport:O,intent:G="display",annotationMode:_=_util.AnnotationMode.ENABLE,transform:B=null,background:K=null,optionalContentConfigPromise:rt=null,annotationCanvasMap:st=null,pageColors:Y=null,printAnnotationStorage:ct=null}=A;(i=this._stats)==null||i.time("Overall");const nt=this._transport.getRenderingIntent(G,_,ct);ot(this,e,!1),j(this,g,xe).call(this),rt||(rt=this._transport.getOptionalContentConfig());let it=this._intentStates.get(nt.cacheKey);it||(it=Object.create(null),this._intentStates.set(nt.cacheKey,it)),it.streamReaderCancelTimeout&&(clearTimeout(it.streamReaderCancelTimeout),it.streamReaderCancelTimeout=null);const kt=!!(nt.renderingIntent&_util.RenderingIntentFlag.PRINT);it.displayReadyCapability||(it.displayReadyCapability=new _util.PromiseCapability,it.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(u=this._stats)==null||u.time("Page Request"),this._pumpOperatorList(nt));const U=p=>{var T,W;it.renderTasks.delete(c),(this._maybeCleanupAfterRender||kt)&&ot(this,e,!0),j(this,n,he).call(this,!kt),p?(c.capability.reject(p),this._abortOperatorList({intentState:it,reason:p instanceof Error?p:new Error(p)})):c.capability.resolve(),(T=this._stats)==null||T.timeEnd("Rendering"),(W=this._stats)==null||W.timeEnd("Overall")},c=new InternalRenderTask({callback:U,params:{canvasContext:F,viewport:O,transform:B,background:K},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:st,operatorList:it.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!kt,pdfBug:this._pdfBug,pageColors:Y});(it.renderTasks||(it.renderTasks=new Set)).add(c);const f=c.task;return Promise.all([it.displayReadyCapability.promise,rt]).then(p=>{var H;let[T,W]=p;if(this.destroyed){U();return}(H=this._stats)==null||H.time("Rendering"),c.initializeGraphics({transparency:T,optionalContentConfig:W}),c.operatorListChanged()}).catch(U),f}getOperatorList(){var rt;let{intent:A="display",annotationMode:F=_util.AnnotationMode.ENABLE,printAnnotationStorage:O=null}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};function G(){B.operatorList.lastChunk&&(B.opListReadCapability.resolve(B.operatorList),B.renderTasks.delete(K))}const _=this._transport.getRenderingIntent(A,F,O,!0);let B=this._intentStates.get(_.cacheKey);B||(B=Object.create(null),this._intentStates.set(_.cacheKey,B));let K;return B.opListReadCapability||(K=Object.create(null),K.operatorListChanged=G,B.opListReadCapability=new _util.PromiseCapability,(B.renderTasks||(B.renderTasks=new Set)).add(K),B.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(rt=this._stats)==null||rt.time("Page Request"),this._pumpOperatorList(_)),B.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:A=!1,disableNormalization:F=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const O=100;return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:A===!0,disableNormalization:F===!0},{highWaterMark:O,size(G){return G.items.length}})}getTextContent(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then(O=>_xfa_text.XfaText.textContent(O));const F=this.streamTextContent(A);return new Promise(function(O,G){function _(){B.read().then(function(rt){let{value:st,done:Y}=rt;if(Y){O(K);return}Object.assign(K.styles,st.styles),K.items.push(...st.items),_()},G)}const B=F.getReader(),K={items:[],styles:Object.create(null)};_()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const A=[];for(const F of this._intentStates.values())if(this._abortOperatorList({intentState:F,reason:new Error("Page was destroyed."),force:!0}),!F.opListReadCapability)for(const O of F.renderTasks)A.push(O.completed),O.cancel();return this.objs.clear(),ot(this,e,!1),j(this,g,xe).call(this),Promise.all(A)}cleanup(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;ot(this,e,!0);const F=j(this,n,he).call(this,!1);return A&&F&&this._stats&&(this._stats=new _display_utils.StatTimer),F}_startRenderPage(A,F){var G,_;const O=this._intentStates.get(F);!O||((G=this._stats)==null||G.timeEnd("Page Request"),(_=O.displayReadyCapability)==null||_.resolve(A))}_renderPageChunk(A,F){for(let O=0,G=A.length;O<G;O++)F.operatorList.fnArray.push(A.fnArray[O]),F.operatorList.argsArray.push(A.argsArray[O]);F.operatorList.lastChunk=A.lastChunk,F.operatorList.separateAnnots=A.separateAnnots;for(const O of F.renderTasks)O.operatorListChanged();A.lastChunk&&j(this,n,he).call(this,!0)}_pumpOperatorList(A){let{renderingIntent:F,cacheKey:O,annotationStorageSerializable:G}=A;const{map:_,transfers:B}=G,rt=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:F,cacheKey:O,annotationStorage:_},B).getReader(),st=this._intentStates.get(O);st.streamReader=rt;const Y=()=>{rt.read().then(ct=>{let{value:nt,done:it}=ct;if(it){st.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(nt,st),Y())},ct=>{if(st.streamReader=null,!this._transport.destroyed){if(st.operatorList){st.operatorList.lastChunk=!0;for(const nt of st.renderTasks)nt.operatorListChanged();j(this,n,he).call(this,!0)}if(st.displayReadyCapability)st.displayReadyCapability.reject(ct);else if(st.opListReadCapability)st.opListReadCapability.reject(ct);else throw ct}})};Y()}_abortOperatorList(A){let{intentState:F,reason:O,force:G=!1}=A;if(!!F.streamReader){if(F.streamReaderCancelTimeout&&(clearTimeout(F.streamReaderCancelTimeout),F.streamReaderCancelTimeout=null),!G){if(F.renderTasks.size>0)return;if(O instanceof _display_utils.RenderingCancelledException){let _=RENDERING_CANCELLED_TIMEOUT;O.extraDelay>0&&O.extraDelay<1e3&&(_+=O.extraDelay),F.streamReaderCancelTimeout=setTimeout(()=>{F.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:F,reason:O,force:!0})},_);return}}if(F.streamReader.cancel(new _util.AbortException(O.message)).catch(()=>{}),F.streamReader=null,!this._transport.destroyed){for(const[_,B]of this._intentStates)if(B===F){this._intentStates.delete(_);break}this.cleanup()}}}get stats(){return this._stats}}t=new WeakMap,e=new WeakMap,n=new WeakSet,he=function(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(j(this,g,xe).call(this),!r(this,e)||this.destroyed)return!1;if(A)return ot(this,t,setTimeout(()=>{ot(this,t,null),j(this,n,he).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:F,operatorList:O}of this._intentStates.values())if(F.size>0||!O.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),ot(this,e,!1),!0},g=new WeakSet,xe=function(){r(this,t)&&(clearTimeout(r(this,t)),ot(this,t,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){X(this,k,new Set);X(this,S,Promise.resolve())}postMessage(A,F){const O={data:structuredClone(A,null)};r(this,S).then(()=>{for(const G of r(this,k))G.call(this,O)})}addEventListener(A,F){r(this,k).add(F)}removeEventListener(A,F){r(this,k).delete(F)}terminate(){r(this,k).clear()}}k=new WeakMap,S=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 M=(s=document==null?void 0:document.currentScript)==null?void 0:s.src;M&&(PDFWorkerUtil.fallbackWorkerSrc=M.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(M,A){let F;try{if(F=new URL(M),!F.origin||F.origin==="null")return!1}catch{return!1}const O=new URL(A,F);return F.origin===O.origin},PDFWorkerUtil.createCDNWrapper=function(M){const A=`importScripts("${M}");`;return URL.createObjectURL(new Blob([A]))}}const _PDFWorker=class{constructor(){var O;let{name:M=null,port:A=null,verbosity:F=(0,_util.getVerbosityLevel)()}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.name=M,this.destroyed=!1,this.verbosity=F,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,A){if((O=r(_PDFWorker,m))!=null&&O.has(A))throw new Error("Cannot use more than one PDFWorker per port.");(r(_PDFWorker,m)||ot(_PDFWorker,m,new WeakMap)).set(A,this),this._initializeFromPort(A);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(M){this._port=M,this._messageHandler=new _message_handler.MessageHandler("main","worker",M),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:M}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,M)||(M=PDFWorkerUtil.createCDNWrapper(new URL(M,window.location).href));const A=new Worker(M),F=new _message_handler.MessageHandler("main","worker",A),O=()=>{A.removeEventListener("error",G),F.destroy(),A.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},G=()=>{this._webWorker||O()};A.addEventListener("error",G),F.on("test",B=>{if(A.removeEventListener("error",G),this.destroyed){O();return}B?(this._messageHandler=F,this._port=A,this._webWorker=A,this._readyCapability.resolve(),F.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),F.destroy(),A.terminate())}),F.on("ready",B=>{if(A.removeEventListener("error",G),this.destroyed){O();return}try{_()}catch{this._setupFakeWorker()}});const _=()=>{const B=new Uint8Array;F.send("test",B,[B.buffer])};_();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(M=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const A=new LoopbackPort;this._port=A;const F=`fake${PDFWorkerUtil.fakeWorkerId++}`,O=new _message_handler.MessageHandler(F+"_worker",F,A);M.setup(O,A);const G=new _message_handler.MessageHandler(F,F+"_worker",A);this._messageHandler=G,this._readyCapability.resolve(),G.send("configure",{verbosity:this.verbosity})}).catch(M=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${M.message}".`))})}destroy(){var M;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),(M=r(_PDFWorker,m))==null||M.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(M){var F;if(!(M!=null&&M.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const A=(F=r(this,m))==null?void 0:F.get(M.port);if(A){if(A._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return A}return new _PDFWorker(M)}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(){var M;try{return((M=globalThis.pdfjsWorker)==null?void 0:M.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())}};let PDFWorker=_PDFWorker;m=new WeakMap,X(PDFWorker,m,void 0),exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(A,F,O,G,_){X(this,y);X(this,d,new Map);X(this,x,new Map);X(this,v,new Map);X(this,b,null);this.messageHandler=A,this.loadingTask=F,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:G.ownerDocument,styleElement:G.styleElement}),this._params=G,this.canvasFactory=_.canvasFactory,this.filterFactory=_.filterFactory,this.cMapReaderFactory=_.cMapReaderFactory,this.standardFontDataFactory=_.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=O,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(A){let F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_util.AnnotationMode.ENABLE,O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,G=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,_=_util.RenderingIntentFlag.DISPLAY,B=_annotation_storage.SerializableEmpty;switch(A){case"any":_=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":_=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${A}`)}switch(F){case _util.AnnotationMode.DISABLE:_+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:_+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:_+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,B=(_&_util.RenderingIntentFlag.PRINT&&O instanceof _annotation_storage.PrintAnnotationStorage?O:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${F}`)}return G&&(_+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:_,cacheKey:`${_}_${B.hash}`,annotationStorageSerializable:B}}destroy(){var O;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,(O=r(this,b))==null||O.reject(new Error("Worker was destroyed during onPassword callback"));const A=[];for(const G of r(this,x).values())A.push(G._destroy());r(this,x).clear(),r(this,v).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const F=this.messageHandler.sendWithPromise("Terminate",null);return A.push(F),Promise.all(A).then(()=>{var G;this.commonObjs.clear(),this.fontLoader.clear(),r(this,d).clear(),this.filterFactory.destroy(),(G=this._networkStream)==null||G.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:A,loadingTask:F}=this;A.on("GetReader",(O,G)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=_=>{this._lastProgress={loaded:_.loaded,total:_.total}},G.onPull=()=>{this._fullReader.read().then(function(_){let{value:B,done:K}=_;if(K){G.close();return}(0,_util.assert)(B instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),G.enqueue(new Uint8Array(B),1,[B])}).catch(_=>{G.error(_)})},G.onCancel=_=>{this._fullReader.cancel(_),G.ready.catch(B=>{if(!this.destroyed)throw B})}}),A.on("ReaderHeadersReady",O=>{const G=new _util.PromiseCapability,_=this._fullReader;return _.headersReady.then(()=>{var B;(!_.isStreamingSupported||!_.isRangeSupported)&&(this._lastProgress&&((B=F.onProgress)==null||B.call(F,this._lastProgress)),_.onProgress=K=>{var rt;(rt=F.onProgress)==null||rt.call(F,{loaded:K.loaded,total:K.total})}),G.resolve({isStreamingSupported:_.isStreamingSupported,isRangeSupported:_.isRangeSupported,contentLength:_.contentLength})},G.reject),G.promise}),A.on("GetRangeReader",(O,G)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const _=this._networkStream.getRangeReader(O.begin,O.end);if(!_){G.close();return}G.onPull=()=>{_.read().then(function(B){let{value:K,done:rt}=B;if(rt){G.close();return}(0,_util.assert)(K instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),G.enqueue(new Uint8Array(K),1,[K])}).catch(B=>{G.error(B)})},G.onCancel=B=>{_.cancel(B),G.ready.catch(K=>{if(!this.destroyed)throw K})}}),A.on("GetDoc",O=>{let{pdfInfo:G}=O;this._numPages=G.numPages,this._htmlForXfa=G.htmlForXfa,delete G.htmlForXfa,F._capability.resolve(new PDFDocumentProxy(G,this))}),A.on("DocException",function(O){let G;switch(O.name){case"PasswordException":G=new _util.PasswordException(O.message,O.code);break;case"InvalidPDFException":G=new _util.InvalidPDFException(O.message);break;case"MissingPDFException":G=new _util.MissingPDFException(O.message);break;case"UnexpectedResponseException":G=new _util.UnexpectedResponseException(O.message,O.status);break;case"UnknownErrorException":G=new _util.UnknownErrorException(O.message,O.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}F._capability.reject(G)}),A.on("PasswordRequest",O=>{if(ot(this,b,new _util.PromiseCapability),F.onPassword){const G=_=>{_ instanceof Error?r(this,b).reject(_):r(this,b).resolve({password:_})};try{F.onPassword(G,O.code)}catch(_){r(this,b).reject(_)}}else r(this,b).reject(new _util.PasswordException(O.message,O.code));return r(this,b).promise}),A.on("DataLoaded",O=>{var G;(G=F.onProgress)==null||G.call(F,{loaded:O.length,total:O.length}),this.downloadInfoCapability.resolve(O)}),A.on("StartRenderPage",O=>{if(this.destroyed)return;r(this,x).get(O.pageIndex)._startRenderPage(O.transparency,O.cacheKey)}),A.on("commonobj",O=>{var K;let[G,_,B]=O;if(!this.destroyed&&!this.commonObjs.has(G))switch(_){case"Font":const rt=this._params;if("error"in B){const ct=B.error;(0,_util.warn)(`Error during font loading: ${ct}`),this.commonObjs.resolve(G,ct);break}const st=rt.pdfBug&&((K=globalThis.FontInspector)==null?void 0:K.enabled)?(ct,nt)=>globalThis.FontInspector.fontAdded(ct,nt):null,Y=new _font_loader.FontFaceObject(B,{isEvalSupported:rt.isEvalSupported,disableFontFace:rt.disableFontFace,ignoreErrors:rt.ignoreErrors,inspectFont:st});this.fontLoader.bind(Y).catch(ct=>A.sendWithPromise("FontFallback",{id:G})).finally(()=>{!rt.fontExtraProperties&&Y.data&&(Y.data=null),this.commonObjs.resolve(G,Y)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(G,B);break;default:throw new Error(`Got unknown common object type ${_}`)}}),A.on("obj",O=>{var st;let[G,_,B,K]=O;if(this.destroyed)return;const rt=r(this,x).get(_);if(!rt.objs.has(G))switch(B){case"Image":if(rt.objs.resolve(G,K),K){let Y;if(K.bitmap){const{width:ct,height:nt}=K;Y=ct*nt*4}else Y=((st=K.data)==null?void 0:st.length)||0;Y>_util.MAX_IMAGE_SIZE_TO_CACHE&&(rt._maybeCleanupAfterRender=!0)}break;case"Pattern":rt.objs.resolve(G,K);break;default:throw new Error(`Got unknown object type ${B}`)}}),A.on("DocProgress",O=>{var G;this.destroyed||(G=F.onProgress)==null||G.call(F,{loaded:O.loaded,total:O.total})}),A.on("FetchBuiltInCMap",O=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(O):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),A.on("FetchStandardFontData",O=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(O):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var O,G;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:A,transfers:F}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:A,filename:(G=(O=this._fullReader)==null?void 0:O.filename)!=null?G:null},F).finally(()=>{this.annotationStorage.resetModified()})}getPage(A){if(!Number.isInteger(A)||A<=0||A>this._numPages)return Promise.reject(new Error("Invalid page request."));const F=A-1,O=r(this,v).get(F);if(O)return O;const G=this.messageHandler.sendWithPromise("GetPage",{pageIndex:F}).then(_=>{if(this.destroyed)throw new Error("Transport destroyed");const B=new PDFPageProxy(F,_,this,this._params.pdfBug);return r(this,x).set(F,B),B});return r(this,v).set(F,G),G}getPageIndex(A){return typeof A!="object"||A===null||!Number.isInteger(A.num)||A.num<0||!Number.isInteger(A.gen)||A.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:A.num,gen:A.gen})}getAnnotations(A,F){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:A,intent:F})}getFieldObjects(){return j(this,y,Te).call(this,"GetFieldObjects")}hasJSActions(){return j(this,y,Te).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(A){return typeof A!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:A})}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 j(this,y,Te).call(this,"GetDocJSActions")}getPageJSActions(A){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:A})}getStructTree(A){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:A})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(A=>new _optional_content_config.OptionalContentConfig(A))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const A="GetMetadata",F=r(this,d).get(A);if(F)return F;const O=this.messageHandler.sendWithPromise(A,null).then(G=>{var _,B,K,rt;return{info:G[0],metadata:G[1]?new _metadata.Metadata(G[1]):null,contentDispositionFilename:(B=(_=this._fullReader)==null?void 0:_.filename)!=null?B:null,contentLength:(rt=(K=this._fullReader)==null?void 0:K.contentLength)!=null?rt:null}});return r(this,d).set(A,O),O}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const F of r(this,x).values())if(!F.cleanup())throw new Error(`startCleanup: Page ${F.pageNumber} is currently rendering.`);this.commonObjs.clear(),A||this.fontLoader.clear(),r(this,d).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:A,enableXfa:F}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:A,enableXfa:F})}}d=new WeakMap,x=new WeakMap,v=new WeakMap,b=new WeakMap,y=new WeakSet,Te=function(A){let F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const O=r(this,d).get(A);if(O)return O;const G=this.messageHandler.sendWithPromise(A,F);return r(this,d).set(A,G),G};class PDFObjects{constructor(){X(this,D);X(this,P,Object.create(null))}get(A){let F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(F){const G=j(this,D,Ue).call(this,A);return G.capability.promise.then(()=>F(G.data)),null}const O=r(this,P)[A];if(!(O!=null&&O.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${A}.`);return O.data}has(A){const F=r(this,P)[A];return(F==null?void 0:F.capability.settled)||!1}resolve(A){let F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const O=j(this,D,Ue).call(this,A);O.data=F,O.capability.resolve()}clear(){var A;for(const F in r(this,P)){const{data:O}=r(this,P)[F];(A=O==null?void 0:O.bitmap)==null||A.close()}ot(this,P,Object.create(null))}}P=new WeakMap,D=new WeakSet,Ue=function(A){var F;return(F=r(this,P))[A]||(F[A]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(A){X(this,h,null);ot(this,h,A),this.onContinue=null}get promise(){return r(this,h).capability.promise}cancel(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;r(this,h).cancel(null,A)}get separateAnnots(){const{separateAnnots:A}=r(this,h).operatorList;if(!A)return!1;const{annotationCanvasMap:F}=r(this,h);return A.form||A.canvas&&(F==null?void 0:F.size)>0}}h=new WeakMap,exports.RenderTask=RenderTask;const N=class{constructor(A){let{callback:F,params:O,objs:G,commonObjs:_,annotationCanvasMap:B,operatorList:K,pageIndex:rt,canvasFactory:st,filterFactory:Y,useRequestAnimationFrame:ct=!1,pdfBug:nt=!1,pageColors:it=null}=A;this.callback=F,this.params=O,this.objs=G,this.commonObjs=_,this.annotationCanvasMap=B,this.operatorListIdx=null,this.operatorList=K,this._pageIndex=rt,this.canvasFactory=st,this.filterFactory=Y,this._pdfBug=nt,this.pageColors=it,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=ct===!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=O.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics(A){var rt,st;let{transparency:F=!1,optionalContentConfig:O}=A;if(this.cancelled)return;if(this._canvas){if(r(N,E).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.");r(N,E).add(this._canvas)}this._pdfBug&&((rt=globalThis.StepperManager)==null?void 0:rt.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:G,viewport:_,transform:B,background:K}=this.params;this.gfx=new _canvas.CanvasGraphics(G,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:O},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:B,viewport:_,transparency:F,background:K}),this.operatorListIdx=0,this.graphicsReady=!0,(st=this.graphicsReadyCallback)==null||st.call(this)}cancel(){var O;let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.running=!1,this.cancelled=!0,(O=this.gfx)==null||O.endDrawing(),r(N,E).delete(this._canvas),this.callback(A||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,F))}operatorListChanged(){var A;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(A=this.stepper)==null||A.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(),r(N,E).delete(this._canvas),this.callback())))}};let InternalRenderTask=N;E=new WeakMap,X(InternalRenderTask,E,new WeakSet);const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(R,o,t)=>{var e=t(3),n=t(126),l=t(135);e({target:"Set",proto:!0,real:!0,forced:!l("difference")},{difference:n})},(R,o,t)=>{var e=t(127),n=t(128),l=t(129),g=t(132),w=t(133),k=t(130),S=t(131),s=n.has,m=n.remove;R.exports=function(x){var v=e(this),b=w(x),y=l(v);return g(v)<=b.size?k(v,function(C){b.includes(C)&&m(y,C)}):S(b.getIterator(),function(C){s(v,C)&&m(y,C)}),y}},(R,o,t)=>{var e=t(128).has;R.exports=function(n){return e(n),n}},(R,o,t)=>{var e=t(14),n=Set.prototype;R.exports={Set,add:e(n.add),has:e(n.has),remove:e(n.delete),proto:n}},(R,o,t)=>{var e=t(128),n=t(130),l=e.Set,g=e.add;R.exports=function(w){var k=new l;return n(w,function(S){g(k,S)}),k}},(R,o,t)=>{var e=t(14),n=t(131),l=t(128),g=l.Set,w=l.proto,k=e(w.forEach),S=e(w.keys),s=S(new g).next;R.exports=function(m,d,x){return x?n({iterator:S(m),next:s},d):k(m,d)}},(R,o,t)=>{var e=t(8);R.exports=function(n,l,g){for(var w=g?n:n.iterator,k=n.next,S,s;!(S=e(k,w)).done;)if(s=l(S.value),s!==void 0)return s}},(R,o,t)=>{var e=t(72),n=t(128);R.exports=e(n.proto,"size","get")||function(l){return l.size}},(R,o,t)=>{var e=t(31),n=t(47),l=t(8),g=t(62),w=t(134),k="Invalid size",S=RangeError,s=TypeError,m=Math.max,d=function(x,v,b,y){this.set=x,this.size=v,this.has=b,this.keys=y};d.prototype={getIterator:function(){return w(n(l(this.keys,this.set)))},includes:function(x){return l(this.has,this.set,x)}},R.exports=function(x){n(x);var v=+x.size;if(v!==v)throw s(k);var b=g(v);if(b<0)throw S(k);return new d(x,m(b,0),e(x.has),e(x.keys))}},R=>{R.exports=function(o){return{iterator:o,next:o.next,done:!1}}},(R,o,t)=>{var e=t(24),n=function(l){return{size:l,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};R.exports=function(l){var g=e("Set");try{new g()[l](n(0));try{return new g()[l](n(-1)),!1}catch{return!0}}catch{return!1}}},(R,o,t)=>{var e=t(3),n=t(7),l=t(137),g=t(135),w=!g("intersection")||n(function(){return Array.from(new Set([1,2,3]).intersection(new Set([3,2])))!=="3,2"});e({target:"Set",proto:!0,real:!0,forced:w},{intersection:l})},(R,o,t)=>{var e=t(127),n=t(128),l=t(132),g=t(133),w=t(130),k=t(131),S=n.Set,s=n.add,m=n.has;R.exports=function(x){var v=e(this),b=g(x),y=new S;return l(v)>b.size?k(b.getIterator(),function(C){m(v,C)&&s(y,C)}):w(v,function(C){b.includes(C)&&s(y,C)}),y}},(R,o,t)=>{var e=t(3),n=t(139),l=t(135);e({target:"Set",proto:!0,real:!0,forced:!l("isDisjointFrom")},{isDisjointFrom:n})},(R,o,t)=>{var e=t(127),n=t(128).has,l=t(132),g=t(133),w=t(130),k=t(131),S=t(140);R.exports=function(m){var d=e(this),x=g(m);if(l(d)<=x.size)return w(d,function(b){if(x.includes(b))return!1},!0)!==!1;var v=x.getIterator();return k(v,function(b){if(n(d,b))return S(v,"normal",!1)})!==!1}},(R,o,t)=>{var e=t(8),n=t(47),l=t(30);R.exports=function(g,w,k){var S,s;n(g);try{if(S=l(g,"return"),!S){if(w==="throw")throw k;return k}S=e(S,g)}catch(m){s=!0,S=m}if(w==="throw")throw k;if(s)throw S;return n(S),k}},(R,o,t)=>{var e=t(3),n=t(142),l=t(135);e({target:"Set",proto:!0,real:!0,forced:!l("isSubsetOf")},{isSubsetOf:n})},(R,o,t)=>{var e=t(127),n=t(132),l=t(130),g=t(133);R.exports=function(k){var S=e(this),s=g(k);return n(S)>s.size?!1:l(S,function(m){if(!s.includes(m))return!1},!0)!==!1}},(R,o,t)=>{var e=t(3),n=t(144),l=t(135);e({target:"Set",proto:!0,real:!0,forced:!l("isSupersetOf")},{isSupersetOf:n})},(R,o,t)=>{var e=t(127),n=t(128).has,l=t(132),g=t(133),w=t(131),k=t(140);R.exports=function(s){var m=e(this),d=g(s);if(l(m)<d.size)return!1;var x=d.getIterator();return w(x,function(v){if(!n(m,v))return k(x,"normal",!1)})!==!1}},(R,o,t)=>{var e=t(3),n=t(146),l=t(135);e({target:"Set",proto:!0,real:!0,forced:!l("symmetricDifference")},{symmetricDifference:n})},(R,o,t)=>{var e=t(127),n=t(128),l=t(129),g=t(133),w=t(131),k=n.add,S=n.has,s=n.remove;R.exports=function(d){var x=e(this),v=g(d).getIterator(),b=l(x);return w(v,function(y){S(x,y)?s(b,y):k(b,y)}),b}},(R,o,t)=>{var e=t(3),n=t(148),l=t(135);e({target:"Set",proto:!0,real:!0,forced:!l("union")},{union:n})},(R,o,t)=>{var e=t(127),n=t(128).add,l=t(129),g=t(133),w=t(131);R.exports=function(S){var s=e(this),m=g(S).getIterator(),d=l(s);return w(m,function(x){n(d,x)}),d}},(R,o,t)=>{var e=t(3),n=t(4),l=t(24),g=t(11),w=t(45).f,k=t(39),S=t(150),s=t(75),m=t(76),d=t(151),x=t(82),v=t(6),b=t(36),y="DOMException",C=l("Error"),P=l(y),D=function(){S(this,I);var rt=arguments.length,st=m(rt<1?void 0:arguments[0]),Y=m(rt<2?void 0:arguments[1],"Error"),ct=new P(st,Y),nt=C(st);return nt.name=y,w(ct,"stack",g(1,x(nt.stack,1))),s(ct,this,D),ct},I=D.prototype=P.prototype,h="stack"in C(y),E="stack"in new P(1,2),N=P&&v&&Object.getOwnPropertyDescriptor(n,y),M=!!N&&!(N.writable&&N.configurable),A=h&&!M&&!E;e({global:!0,constructor:!0,forced:b||A},{DOMException:A?D:P});var F=l(y),O=F.prototype;if(O.constructor!==F){b||w(O,"constructor",g(1,F));for(var G in d)if(k(d,G)){var _=d[G],B=_.s;k(F,B)||w(F,B,g(6,_.c))}}},(R,o,t)=>{var e=t(25),n=TypeError;R.exports=function(l,g){if(e(g,l))return l;throw n("Incorrect invocation")}},R=>{R.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},(R,o,t)=>{var e=t(36),n=t(3),l=t(4),g=t(24),w=t(14),k=t(7),S=t(41),s=t(21),m=t(153),d=t(17),x=t(20),v=t(23),b=t(154),y=t(47),C=t(78),P=t(39),D=t(159),I=t(44),h=t(64),E=t(85),N=t(160),M=t(162),A=t(128),F=t(83),O=t(119),G=l.Object,_=l.Array,B=l.Date,K=l.Error,rt=l.EvalError,st=l.RangeError,Y=l.ReferenceError,ct=l.SyntaxError,nt=l.TypeError,it=l.URIError,kt=l.PerformanceMark,U=l.WebAssembly,c=U&&U.CompileError||K,f=U&&U.LinkError||K,i=U&&U.RuntimeError||K,u=g("DOMException"),p=M.Map,T=M.has,W=M.get,H=M.set,tt=A.Set,q=A.add,ut=g("Object","keys"),ft=w([].push),Et=w((!0).valueOf),vt=w(1 .valueOf),Dt=w("".valueOf),Wt=w(B.prototype.getTime),Rt=S("structuredClone"),Nt="DataCloneError",At="Transferring",dt=function(lt){return!k(function(){var z=new l.Set([7]),gt=lt(z),xt=lt(G(7));return gt===z||!gt.has(7)||typeof xt!="object"||+xt!=7})&&lt},at=function(lt,z){return!k(function(){var gt=new z,xt=lt({a:gt,b:gt});return!(xt&&xt.a===xt.b&&xt.a instanceof z&&xt.a.stack===gt.stack)})},pt=function(lt){return!k(function(){var z=lt(new l.AggregateError([1],Rt,{cause:3}));return z.name!=="AggregateError"||z.errors[0]!==1||z.message!==Rt||z.cause!==3})},wt=l.structuredClone,It=e||!at(wt,K)||!at(wt,u)||!pt(wt),Gt=!wt&&dt(function(lt){return new kt(Rt,{detail:lt}).detail}),Xt=dt(wt)||Gt,zt=function(lt){throw new u("Uncloneable type: "+lt,Nt)},Vt=function(lt,z){throw new u((z||"Cloning")+" of "+lt+" cannot be properly polyfilled in this engine",Nt)},Kt=function(lt,z){return Xt||Vt(z),Xt(lt)},Jt=function(){var lt;try{lt=new l.DataTransfer}catch{try{lt=new l.ClipboardEvent("").clipboardData}catch{}}return lt&&lt.items&&lt.files?lt:null},Zt=function(lt,z,gt){if(T(z,lt))return W(z,lt);var xt=gt||C(lt),St,Pt,bt,Ht,Tt,Lt;if(xt==="SharedArrayBuffer")Xt?St=Xt(lt):St=lt;else{var Ft=l.DataView;!Ft&&typeof lt.slice!="function"&&Vt("ArrayBuffer");try{if(typeof lt.slice=="function"&&!lt.resizable)St=lt.slice(0);else for(Pt=lt.byteLength,bt=("maxByteLength"in lt)?{maxByteLength:lt.maxByteLength}:void 0,St=new ArrayBuffer(Pt,bt),Ht=new Ft(lt),Tt=new Ft(St),Lt=0;Lt<Pt;Lt++)Tt.setUint8(Lt,Ht.getUint8(Lt))}catch{throw new u("ArrayBuffer is detached",Nt)}}return H(z,lt,St),St},$t=function(lt,z,gt,xt,St){var Pt=l[z];return x(Pt)||Vt(z),new Pt(Zt(lt.buffer,St),gt,xt)},yt=function(lt,z,gt){this.object=lt,this.type=z,this.metadata=gt},Z=function(lt,z,gt){if(v(lt)&&zt("Symbol"),!x(lt))return lt;if(z){if(T(z,lt))return W(z,lt)}else z=new p;var xt=C(lt),St,Pt,bt,Ht,Tt,Lt,Ft,$;switch(xt){case"Array":bt=_(h(lt));break;case"Object":bt={};break;case"Map":bt=new p;break;case"Set":bt=new tt;break;case"RegExp":bt=new RegExp(lt.source,N(lt));break;case"Error":switch(Pt=lt.name,Pt){case"AggregateError":bt=g("AggregateError")([]);break;case"EvalError":bt=rt();break;case"RangeError":bt=st();break;case"ReferenceError":bt=Y();break;case"SyntaxError":bt=ct();break;case"TypeError":bt=nt();break;case"URIError":bt=it();break;case"CompileError":bt=c();break;case"LinkError":bt=f();break;case"RuntimeError":bt=i();break;default:bt=K()}break;case"DOMException":bt=new u(lt.message,lt.name);break;case"ArrayBuffer":case"SharedArrayBuffer":bt=gt?new yt(lt,xt):Zt(lt,z,xt);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":Lt=xt==="DataView"?lt.byteLength:lt.length,bt=gt?new yt(lt,xt,{offset:lt.byteOffset,length:Lt}):$t(lt,xt,lt.byteOffset,Lt,z);break;case"DOMQuad":try{bt=new DOMQuad(Z(lt.p1,z,gt),Z(lt.p2,z,gt),Z(lt.p3,z,gt),Z(lt.p4,z,gt))}catch{bt=Kt(lt,xt)}break;case"File":if(Xt)try{bt=Xt(lt),C(bt)!==xt&&(bt=void 0)}catch{}if(!bt)try{bt=new File([lt],lt.name,lt)}catch{}bt||Vt(xt);break;case"FileList":if(Ht=Jt(),Ht){for(Tt=0,Lt=h(lt);Tt<Lt;Tt++)Ht.items.add(Z(lt[Tt],z,gt));bt=Ht.files}else bt=Kt(lt,xt);break;case"ImageData":try{bt=new ImageData(Z(lt.data,z,gt),lt.width,lt.height,{colorSpace:lt.colorSpace})}catch{bt=Kt(lt,xt)}break;default:if(Xt)bt=Xt(lt);else switch(xt){case"BigInt":bt=G(lt.valueOf());break;case"Boolean":bt=G(Et(lt));break;case"Number":bt=G(vt(lt));break;case"String":bt=G(Dt(lt));break;case"Date":bt=new B(Wt(lt));break;case"Blob":try{bt=lt.slice(0,lt.size,lt.type)}catch{Vt(xt)}break;case"DOMPoint":case"DOMPointReadOnly":St=l[xt];try{bt=St.fromPoint?St.fromPoint(lt):new St(lt.x,lt.y,lt.z,lt.w)}catch{Vt(xt)}break;case"DOMRect":case"DOMRectReadOnly":St=l[xt];try{bt=St.fromRect?St.fromRect(lt):new St(lt.x,lt.y,lt.width,lt.height)}catch{Vt(xt)}break;case"DOMMatrix":case"DOMMatrixReadOnly":St=l[xt];try{bt=St.fromMatrix?St.fromMatrix(lt):new St(lt)}catch{Vt(xt)}break;case"AudioData":case"VideoFrame":s(lt.clone)||Vt(xt);try{bt=lt.clone()}catch{zt(xt)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":Vt(xt);default:zt(xt)}}switch(H(z,lt,bt),xt){case"Array":case"Object":for(Ft=ut(lt),Tt=0,Lt=h(Ft);Tt<Lt;Tt++)$=Ft[Tt],D(bt,$,Z(lt[$],z,gt));break;case"Map":lt.forEach(function(a,L){H(bt,Z(L,z,gt),Z(a,z,gt))});break;case"Set":lt.forEach(function(a){q(bt,Z(a,z,gt))});break;case"Error":I(bt,"message",Z(lt.message,z,gt)),P(lt,"cause")&&I(bt,"cause",Z(lt.cause,z,gt)),Pt==="AggregateError"&&(bt.errors=Z(lt.errors,z,gt));case"DOMException":F&&I(bt,"stack",Z(lt.stack,z,gt))}return bt},J=function(lt,z){if(!x(lt))return lt;if(T(z,lt))return W(z,lt);var gt,xt,St,Pt,bt,Ht,Tt,Lt;if(lt instanceof yt)switch(gt=lt.type,xt=lt.object,gt){case"ArrayBuffer":case"SharedArrayBuffer":Lt=Zt(xt,z,gt);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":St=lt.metadata,Lt=$t(xt,gt,St.offset,St.length,z)}else switch(C(lt)){case"Array":case"Object":for(Ht=ut(lt),Pt=0,bt=h(Ht);Pt<bt;Pt++)Tt=Ht[Pt],lt[Tt]=J(lt[Tt],z);break;case"Map":Lt=new p,lt.forEach(function(Ft,$){H(Lt,J($,z),J(Ft,z))});break;case"Set":Lt=new tt,lt.forEach(function(Ft){q(Lt,J(Ft,z))});break;case"Error":lt.message=J(lt.message,z),P(lt,"cause")&&(lt.cause=J(lt.cause,z)),lt.name==="AggregateError"&&(lt.errors=J(lt.errors,z));case"DOMException":F&&(lt.stack=J(lt.stack,z))}return H(z,lt,Lt||lt),Lt||lt},mt=function(lt,z){if(!x(lt))throw nt("Transfer option cannot be converted to a sequence");var gt=[];b(lt,function(a){ft(gt,y(a))});for(var xt=0,St=h(gt),Pt=[],bt,Ht,Tt,Lt,Ft,$;xt<St;){if(bt=gt[xt++],Ht=C(bt),Ht==="ArrayBuffer"){ft(Pt,bt);continue}if(T(z,bt))throw new u("Duplicate transferable",Nt);if(O)Lt=wt(bt,{transfer:[bt]});else switch(Ht){case"ImageBitmap":Tt=l.OffscreenCanvas,m(Tt)||Vt(Ht,At);try{Ft=new Tt(bt.width,bt.height),$=Ft.getContext("bitmaprenderer"),$.transferFromImageBitmap(bt),Lt=Ft.transferToImageBitmap()}catch{}break;case"AudioData":case"VideoFrame":(!s(bt.clone)||!s(bt.close))&&Vt(Ht,At);try{Lt=bt.clone(),bt.close()}catch{}break;case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":Vt(Ht,At)}if(Lt===void 0)throw new u("This object cannot be transferred: "+Ht,Nt);H(z,bt,Lt)}return Pt},jt=function(lt,z){for(var gt=0,xt=h(lt),St,Pt;gt<xt;){if(St=lt[gt++],T(z,St))throw new u("Duplicate transferable",Nt);O?Pt=wt(St,{transfer:[St]}):(s(St.transfer)||Vt("ArrayBuffer",At),Pt=St.transfer()),H(z,St,Pt)}};n({global:!0,enumerable:!0,sham:!O,forced:It},{structuredClone:function(z){var gt=E(arguments.length,1)>1&&!d(arguments[1])?y(arguments[1]):void 0,xt=gt?gt.transfer:void 0,St=!1,Pt,bt;xt!==void 0&&(Pt=new p,bt=mt(xt,Pt),St=!!h(bt));var Ht=Z(z,Pt,St);return St&&(Pt=new p,jt(xt,Pt),Ht=J(Ht,Pt)),Ht}})},(R,o,t)=>{var e=t(14),n=t(7),l=t(21),g=t(78),w=t(24),k=t(51),S=function(){},s=[],m=w("Reflect","construct"),d=/^\s*(?:class|function)\b/,x=e(d.exec),v=!d.exec(S),b=function(P){if(!l(P))return!1;try{return m(S,s,P),!0}catch{return!1}},y=function(P){if(!l(P))return!1;switch(g(P)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return v||!!x(d,k(P))}catch{return!0}};y.sham=!0,R.exports=!m||n(function(){var C;return b(b.call)||!b(Object)||!b(function(){C=!0})||C})?y:b},(R,o,t)=>{var e=t(99),n=t(8),l=t(47),g=t(32),w=t(155),k=t(64),S=t(25),s=t(157),m=t(158),d=t(140),x=TypeError,v=function(y,C){this.stopped=y,this.result=C},b=v.prototype;R.exports=function(y,C,P){var D=P&&P.that,I=!!(P&&P.AS_ENTRIES),h=!!(P&&P.IS_RECORD),E=!!(P&&P.IS_ITERATOR),N=!!(P&&P.INTERRUPTED),M=e(C,D),A,F,O,G,_,B,K,rt=function(Y){return A&&d(A,"normal",Y),new v(!0,Y)},st=function(Y){return I?(l(Y),N?M(Y[0],Y[1],rt):M(Y[0],Y[1])):N?M(Y,rt):M(Y)};if(h)A=y.iterator;else if(E)A=y;else{if(F=m(y),!F)throw x(g(y)+" is not iterable");if(w(F)){for(O=0,G=k(y);G>O;O++)if(_=st(y[O]),_&&S(b,_))return _;return new v(!1)}A=s(y,F)}for(B=h?y.next:A.next;!(K=n(B,A)).done;){try{_=st(K.value)}catch(Y){d(A,"throw",Y)}if(typeof _=="object"&&_&&S(b,_))return _}return new v(!1)}},(R,o,t)=>{var e=t(34),n=t(156),l=e("iterator"),g=Array.prototype;R.exports=function(w){return w!==void 0&&(n.Array===w||g[l]===w)}},R=>{R.exports={}},(R,o,t)=>{var e=t(8),n=t(31),l=t(47),g=t(32),w=t(158),k=TypeError;R.exports=function(S,s){var m=arguments.length<2?w(S):s;if(n(m))return l(e(m,S));throw k(g(S)+" is not iterable")}},(R,o,t)=>{var e=t(78),n=t(30),l=t(17),g=t(156),w=t(34),k=w("iterator");R.exports=function(S){if(!l(S))return n(S,k)||n(S,"@@iterator")||g[e(S)]}},(R,o,t)=>{var e=t(18),n=t(45),l=t(11);R.exports=function(g,w,k){var S=e(w);S in g?n.f(g,S,l(0,k)):g[S]=k}},(R,o,t)=>{var e=t(8),n=t(39),l=t(25),g=t(161),w=RegExp.prototype;R.exports=function(k){var S=k.flags;return S===void 0&&!("flags"in w)&&!n(k,"flags")&&l(w,k)?e(g,k):S}},(R,o,t)=>{var e=t(47);R.exports=function(){var n=e(this),l="";return n.hasIndices&&(l+="d"),n.global&&(l+="g"),n.ignoreCase&&(l+="i"),n.multiline&&(l+="m"),n.dotAll&&(l+="s"),n.unicode&&(l+="u"),n.unicodeSets&&(l+="v"),n.sticky&&(l+="y"),l}},(R,o,t)=>{var e=t(14),n=Map.prototype;R.exports={Map,set:e(n.set),get:e(n.get),has:e(n.has),remove:e(n.delete),proto:n}},(R,o,t)=>{var S,s,m,An,x;Object.defineProperty(o,"__esModule",{value:!0}),o.SerializableEmpty=o.PrintAnnotationStorage=o.AnnotationStorage=void 0,t(89),t(149),t(152);var e=t(1),n=t(164),l=t(170);const g=Object.freeze({map:null,hash:"",transfers:void 0});o.SerializableEmpty=g;class w{constructor(){X(this,m);X(this,S,!1);X(this,s,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(b,y){const C=r(this,s).get(b);return C===void 0?y:Object.assign(y,C)}getRawValue(b){return r(this,s).get(b)}remove(b){if(r(this,s).delete(b),r(this,s).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const y of r(this,s).values())if(y instanceof n.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(b,y){const C=r(this,s).get(b);let P=!1;if(C!==void 0)for(const[D,I]of Object.entries(y))C[D]!==I&&(P=!0,C[D]=I);else P=!0,r(this,s).set(b,y);P&&j(this,m,An).call(this),y instanceof n.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(y.constructor._type)}has(b){return r(this,s).has(b)}getAll(){return r(this,s).size>0?(0,e.objectFromMap)(r(this,s)):null}setAll(b){for(const[y,C]of Object.entries(b))this.setValue(y,C)}get size(){return r(this,s).size}resetModified(){r(this,S)&&(ot(this,S,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new k(this)}get serializable(){if(r(this,s).size===0)return g;const b=new Map,y=new l.MurmurHash3_64,C=[],P=Object.create(null);let D=!1;for(const[I,h]of r(this,s)){const E=h instanceof n.AnnotationEditor?h.serialize(!1,P):h;E&&(b.set(I,E),y.update(`${I}:${JSON.stringify(E)}`),D||(D=!!E.bitmap))}if(D)for(const I of b.values())I.bitmap&&C.push(I.bitmap);return b.size>0?{map:b,hash:y.hexdigest(),transfers:C}:g}}S=new WeakMap,s=new WeakMap,m=new WeakSet,An=function(){r(this,S)||(ot(this,S,!0),typeof this.onSetModified=="function"&&this.onSetModified())},o.AnnotationStorage=w;class k extends w{constructor(y){super();X(this,x,void 0);const{map:C,hash:P,transfers:D}=y.serializable,I=structuredClone(C,null);ot(this,x,{map:I,hash:P,transfers:D})}get print(){(0,e.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return r(this,x)}}x=new WeakMap,o.PrintAnnotationStorage=k},(R,o,t)=>{var k,S,s,m,d,x,v,b,y,C,P,D,I,h,E,We,M,He,F,ze,G,$e,B,Sn,rt,En,Y,xn,nt,Ge,kt,Tn;Object.defineProperty(o,"__esModule",{value:!0}),o.AnnotationEditor=void 0,t(89),t(2);var e=t(165),n=t(1),l=t(168);const c=class{constructor(i){X(this,E);X(this,M);X(this,G);X(this,B);X(this,rt);X(this,Y);X(this,nt);X(this,kt);X(this,k,"");X(this,S,!1);X(this,s,null);X(this,m,null);X(this,d,null);X(this,x,!1);X(this,v,null);X(this,b,this.focusin.bind(this));X(this,y,this.focusout.bind(this));X(this,C,!1);X(this,P,!1);X(this,D,!1);ee(this,"_initialOptions",Object.create(null));ee(this,"_uiManager",null);ee(this,"_focusEventsAllowed",!0);ee(this,"_l10nPromise",null);X(this,I,!1);X(this,h,c._zIndex++);this.constructor===c&&(0,n.unreachable)("Cannot initialize AnnotationEditor."),this.parent=i.parent,this.id=i.id,this.width=this.height=null,this.pageIndex=i.parent.pageIndex,this.name=i.name,this.div=null,this._uiManager=i.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=i.isCentered,this._structTreeParentId=null;const{rotation:u,rawDims:{pageWidth:p,pageHeight:T,pageX:W,pageY:H}}=this.parent.viewport;this.rotation=u,this.pageRotation=(360+u-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[p,T],this.pageTranslation=[W,H];const[tt,q]=this.parentDimensions;this.x=i.x/tt,this.y=i.y/q,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,n.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(i){const u=new w({id:i.parent.getNextId(),parent:i.parent,uiManager:i._uiManager});u.annotationElementId=i.annotationElementId,u.deleted=!0,u._uiManager.addToAnnotationStorage(u)}static initialize(i){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(c._l10nPromise||(c._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(T=>[T,i.get(T)]))),u!=null&&u.strings)for(const T of u.strings)c._l10nPromise.set(T,i.get(T));if(c._borderLineWidth!==-1)return;const p=getComputedStyle(document.documentElement);c._borderLineWidth=parseFloat(p.getPropertyValue("--outline-width"))||0}static updateDefaultParams(i,u){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(i){return!1}static paste(i,u){(0,n.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return r(this,I)}set _isDraggable(i){var u;ot(this,I,i),(u=this.div)==null||u.classList.toggle("draggable",i)}center(){const[i,u]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*u/(i*2),this.y+=this.width*i/(u*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*u/(i*2),this.y-=this.width*i/(u*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(i){this._uiManager.addCommands(i)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=r(this,h)}setParent(i){i!==null&&(this.pageIndex=i.pageIndex,this.pageDimensions=i.pageDimensions),this.parent=i}focusin(i){!this._focusEventsAllowed||(r(this,C)?ot(this,C,!1):this.parent.setSelected(this))}focusout(i){var p;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const u=i.relatedTarget;u!=null&&u.closest(`#${this.id}`)||(i.preventDefault(),(p=this.parent)!=null&&p.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(i,u,p,T){const[W,H]=this.parentDimensions;[p,T]=this.screenToPageTranslation(p,T),this.x=(i+p)/W,this.y=(u+T)/H,this.fixAndSetPosition()}translate(i,u){j(this,E,We).call(this,this.parentDimensions,i,u)}translateInPage(i,u){j(this,E,We).call(this,this.pageDimensions,i,u),this.div.scrollIntoView({block:"nearest"})}drag(i,u){const[p,T]=this.parentDimensions;if(this.x+=i/p,this.y+=u/T,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:ut,y:ft}=this.div.getBoundingClientRect();this.parent.findNewParent(this,ut,ft)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:W,y:H}=this;const[tt,q]=j(this,M,He).call(this);W+=tt,H+=q,this.div.style.left=`${(100*W).toFixed(2)}%`,this.div.style.top=`${(100*H).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[i,u]=this.pageDimensions;let{x:p,y:T,width:W,height:H}=this;switch(W*=i,H*=u,p*=i,T*=u,this.rotation){case 0:p=Math.max(0,Math.min(i-W,p)),T=Math.max(0,Math.min(u-H,T));break;case 90:p=Math.max(0,Math.min(i-H,p)),T=Math.min(u,Math.max(W,T));break;case 180:p=Math.min(i,Math.max(W,p)),T=Math.min(u,Math.max(H,T));break;case 270:p=Math.min(i,Math.max(H,p)),T=Math.max(0,Math.min(u-W,T));break}this.x=p/=i,this.y=T/=u;const[tt,q]=j(this,M,He).call(this);p+=tt,T+=q;const{style:ut}=this.div;ut.left=`${(100*p).toFixed(2)}%`,ut.top=`${(100*T).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(i,u){var p;return j(p=c,F,ze).call(p,i,u,this.parentRotation)}pageTranslationToScreen(i,u){var p;return j(p=c,F,ze).call(p,i,u,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:i,pageDimensions:[u,p]}=this,T=u*i,W=p*i;return n.FeatureTest.isCSSRoundSupported?[Math.round(T),Math.round(W)]:[T,W]}setDims(i,u){var W;const[p,T]=this.parentDimensions;this.div.style.width=`${(100*i/p).toFixed(2)}%`,r(this,x)||(this.div.style.height=`${(100*u/T).toFixed(2)}%`),(W=r(this,s))==null||W.classList.toggle("small",i<c.SMALL_EDITOR_SIZE||u<c.SMALL_EDITOR_SIZE)}fixDims(){const{style:i}=this.div,{height:u,width:p}=i,T=p.endsWith("%"),W=!r(this,x)&&u.endsWith("%");if(T&&W)return;const[H,tt]=this.parentDimensions;T||(i.width=`${(100*parseFloat(p)/H).toFixed(2)}%`),!r(this,x)&&!W&&(i.height=`${(100*parseFloat(u)/tt).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}async addAltTextButton(){if(r(this,s))return;const i=ot(this,s,document.createElement("button"));i.className="altText";const u=await c._l10nPromise.get("editor_alt_text_button_label");i.textContent=u,i.setAttribute("aria-label",u),i.tabIndex="0",i.addEventListener("contextmenu",l.noContextMenu),i.addEventListener("pointerdown",p=>p.stopPropagation()),i.addEventListener("click",p=>{p.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),i.addEventListener("keydown",p=>{p.target===i&&p.key==="Enter"&&(p.preventDefault(),this._uiManager.editAltText(this))}),j(this,nt,Ge).call(this),this.div.append(i),c.SMALL_EDITOR_SIZE||(c.SMALL_EDITOR_SIZE=Math.min(128,Math.round(i.getBoundingClientRect().width*1.4)))}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:r(this,k),decorative:r(this,S)}}set altTextData(i){let{altText:u,decorative:p}=i;r(this,k)===u&&r(this,S)===p||(ot(this,k,u),ot(this,S,p),j(this,nt,Ge).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",r(this,b)),this.div.addEventListener("focusout",r(this,y));const[i,u]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*u/i).toFixed(2)}%`,this.div.style.maxHeight=`${(100*i/u).toFixed(2)}%`);const[p,T]=this.getInitialTranslation();return this.translate(p,T),(0,e.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(i){const{isMac:u}=n.FeatureTest.platform;if(i.button!==0||i.ctrlKey&&u){i.preventDefault();return}ot(this,C,!0),j(this,kt,Tn).call(this,i)}moveInDOM(){var i;(i=this.parent)==null||i.moveEditorInDOM(this)}_setParentAndPosition(i,u,p){i.changeParent(this),this.x=u,this.y=p,this.fixAndSetPosition()}getRect(i,u){const p=this.parentScale,[T,W]=this.pageDimensions,[H,tt]=this.pageTranslation,q=i/p,ut=u/p,ft=this.x*T,Et=this.y*W,vt=this.width*T,Dt=this.height*W;switch(this.rotation){case 0:return[ft+q+H,W-Et-ut-Dt+tt,ft+q+vt+H,W-Et-ut+tt];case 90:return[ft+ut+H,W-Et+q+tt,ft+ut+Dt+H,W-Et+q+vt+tt];case 180:return[ft-q-vt+H,W-Et+ut+tt,ft-q+H,W-Et+ut+Dt+tt];case 270:return[ft-ut-Dt+H,W-Et-q-vt+tt,ft-ut+H,W-Et-q+tt];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(i,u){const[p,T,W,H]=i,tt=W-p,q=H-T;switch(this.rotation){case 0:return[p,u-H,tt,q];case 90:return[p,u-T,q,tt];case 180:return[W,u-T,tt,q];case 270:return[W,u-H,q,tt];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){ot(this,D,!0)}disableEditMode(){ot(this,D,!1)}isInEditMode(){return r(this,D)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var i,u;(i=this.div)==null||i.addEventListener("focusin",r(this,b)),(u=this.div)==null||u.addEventListener("focusout",r(this,y))}serialize(){(0,n.unreachable)("An editor must be serializable")}static deserialize(i,u,p){const T=new this.prototype.constructor({parent:u,id:u.getNextId(),uiManager:p});T.rotation=i.rotation;const[W,H]=T.pageDimensions,[tt,q,ut,ft]=T.getRectInCurrentCoords(i.rect,H);return T.x=tt/W,T.y=q/H,T.width=ut/W,T.height=ft/H,T}remove(){var i;this.div.removeEventListener("focusin",r(this,b)),this.div.removeEventListener("focusout",r(this,y)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(i=r(this,s))==null||i.remove(),ot(this,s,null),ot(this,m,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(j(this,B,Sn).call(this),r(this,v).classList.remove("hidden"))}select(){var i;this.makeResizable(),(i=this.div)==null||i.classList.add("selectedEditor")}unselect(){var i,u,p;(i=r(this,v))==null||i.classList.add("hidden"),(u=this.div)==null||u.classList.remove("selectedEditor"),(p=this.div)!=null&&p.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(i,u){}disableEditing(){r(this,s)&&(r(this,s).hidden=!0)}enableEditing(){r(this,s)&&(r(this,s).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return r(this,P)}set isEditing(i){ot(this,P,i),this.parent&&(i?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(i,u){ot(this,x,!0);const p=i/u,{style:T}=this.div;T.aspectRatio=p,T.height="auto"}static get MIN_SIZE(){return 16}};let g=c;k=new WeakMap,S=new WeakMap,s=new WeakMap,m=new WeakMap,d=new WeakMap,x=new WeakMap,v=new WeakMap,b=new WeakMap,y=new WeakMap,C=new WeakMap,P=new WeakMap,D=new WeakMap,I=new WeakMap,h=new WeakMap,E=new WeakSet,We=function(i,u,p){let[T,W]=i;[u,p]=this.screenToPageTranslation(u,p),this.x+=u/T,this.y+=p/W,this.fixAndSetPosition()},M=new WeakSet,He=function(){const[i,u]=this.parentDimensions,{_borderLineWidth:p}=c,T=p/i,W=p/u;switch(this.rotation){case 90:return[-T,W];case 180:return[T,W];case 270:return[T,-W];default:return[-T,-W]}},F=new WeakSet,ze=function(i,u,p){switch(p){case 90:return[u,-i];case 180:return[-i,-u];case 270:return[-u,i];default:return[i,u]}},G=new WeakSet,$e=function(i){switch(i){case 90:{const[u,p]=this.pageDimensions;return[0,-u/p,p/u,0]}case 180:return[-1,0,0,-1];case 270:{const[u,p]=this.pageDimensions;return[0,u/p,-p/u,0]}default:return[1,0,0,1]}},B=new WeakSet,Sn=function(){if(r(this,v))return;ot(this,v,document.createElement("div")),r(this,v).classList.add("resizers");const i=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||i.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const u of i){const p=document.createElement("div");r(this,v).append(p),p.classList.add("resizer",u),p.addEventListener("pointerdown",j(this,rt,En).bind(this,u)),p.addEventListener("contextmenu",l.noContextMenu)}this.div.prepend(r(this,v))},rt=new WeakSet,En=function(i,u){u.preventDefault();const{isMac:p}=n.FeatureTest.platform;if(u.button!==0||u.ctrlKey&&p)return;const T=j(this,Y,xn).bind(this,i),W=this._isDraggable;this._isDraggable=!1;const H={passive:!0,capture:!0};window.addEventListener("pointermove",T,H);const tt=this.x,q=this.y,ut=this.width,ft=this.height,Et=this.parent.div.style.cursor,vt=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(u.target).cursor;const Dt=()=>{this._isDraggable=W,window.removeEventListener("pointerup",Dt),window.removeEventListener("blur",Dt),window.removeEventListener("pointermove",T,H),this.parent.div.style.cursor=Et,this.div.style.cursor=vt;const Wt=this.x,Rt=this.y,Nt=this.width,At=this.height;Wt===tt&&Rt===q&&Nt===ut&&At===ft||this.addCommands({cmd:()=>{this.width=Nt,this.height=At,this.x=Wt,this.y=Rt;const[dt,at]=this.parentDimensions;this.setDims(dt*Nt,at*At),this.fixAndSetPosition()},undo:()=>{this.width=ut,this.height=ft,this.x=tt,this.y=q;const[dt,at]=this.parentDimensions;this.setDims(dt*ut,at*ft),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",Dt),window.addEventListener("blur",Dt)},Y=new WeakSet,xn=function(i,u){const[p,T]=this.parentDimensions,W=this.x,H=this.y,tt=this.width,q=this.height,ut=c.MIN_SIZE/p,ft=c.MIN_SIZE/T,Et=J=>Math.round(J*1e4)/1e4,vt=j(this,G,$e).call(this,this.rotation),Dt=(J,mt)=>[vt[0]*J+vt[2]*mt,vt[1]*J+vt[3]*mt],Wt=j(this,G,$e).call(this,360-this.rotation),Rt=(J,mt)=>[Wt[0]*J+Wt[2]*mt,Wt[1]*J+Wt[3]*mt];let Nt,At,dt=!1,at=!1;switch(i){case"topLeft":dt=!0,Nt=(J,mt)=>[0,0],At=(J,mt)=>[J,mt];break;case"topMiddle":Nt=(J,mt)=>[J/2,0],At=(J,mt)=>[J/2,mt];break;case"topRight":dt=!0,Nt=(J,mt)=>[J,0],At=(J,mt)=>[0,mt];break;case"middleRight":at=!0,Nt=(J,mt)=>[J,mt/2],At=(J,mt)=>[0,mt/2];break;case"bottomRight":dt=!0,Nt=(J,mt)=>[J,mt],At=(J,mt)=>[0,0];break;case"bottomMiddle":Nt=(J,mt)=>[J/2,mt],At=(J,mt)=>[J/2,0];break;case"bottomLeft":dt=!0,Nt=(J,mt)=>[0,mt],At=(J,mt)=>[J,0];break;case"middleLeft":at=!0,Nt=(J,mt)=>[0,mt/2],At=(J,mt)=>[J,mt/2];break}const pt=Nt(tt,q),wt=At(tt,q);let It=Dt(...wt);const Gt=Et(W+It[0]),Xt=Et(H+It[1]);let zt=1,Vt=1,[Kt,Jt]=this.screenToPageTranslation(u.movementX,u.movementY);if([Kt,Jt]=Rt(Kt/p,Jt/T),dt){const J=Math.hypot(tt,q);zt=Vt=Math.max(Math.min(Math.hypot(wt[0]-pt[0]-Kt,wt[1]-pt[1]-Jt)/J,1/tt,1/q),ut/tt,ft/q)}else at?zt=Math.max(ut,Math.min(1,Math.abs(wt[0]-pt[0]-Kt)))/tt:Vt=Math.max(ft,Math.min(1,Math.abs(wt[1]-pt[1]-Jt)))/q;const Zt=Et(tt*zt),$t=Et(q*Vt);It=Dt(...At(Zt,$t));const yt=Gt-It[0],Z=Xt-It[1];this.width=Zt,this.height=$t,this.x=yt,this.y=Z,this.setDims(p*Zt,T*$t),this.fixAndSetPosition()},nt=new WeakSet,Ge=async function(){var p;const i=r(this,s);if(!i)return;if(!r(this,k)&&!r(this,S)){i.classList.remove("done"),(p=r(this,m))==null||p.remove();return}c._l10nPromise.get("editor_alt_text_edit_button_label").then(T=>{i.setAttribute("aria-label",T)});let u=r(this,m);if(!u){ot(this,m,u=document.createElement("span")),u.className="tooltip",u.setAttribute("role","tooltip");const T=u.id=`alt-text-tooltip-${this.id}`;i.setAttribute("aria-describedby",T);const W=100;i.addEventListener("mouseenter",()=>{ot(this,d,setTimeout(()=>{ot(this,d,null),r(this,m).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},W))}),i.addEventListener("mouseleave",()=>{var H;clearTimeout(r(this,d)),ot(this,d,null),(H=r(this,m))==null||H.classList.remove("show")})}i.classList.add("done"),u.innerText=r(this,S)?await c._l10nPromise.get("editor_alt_text_decorative_tooltip"):r(this,k),u.parentNode||i.append(u)},kt=new WeakSet,Tn=function(i){if(!this._isDraggable)return;const u=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let p,T;u&&(p={passive:!0,capture:!0},T=H=>{const[tt,q]=this.screenToPageTranslation(H.movementX,H.movementY);this._uiManager.dragSelectedEditors(tt,q)},window.addEventListener("pointermove",T,p));const W=()=>{if(window.removeEventListener("pointerup",W),window.removeEventListener("blur",W),u&&window.removeEventListener("pointermove",T,p),ot(this,C,!1),!this._uiManager.endDragSession()){const{isMac:H}=n.FeatureTest.platform;i.ctrlKey&&!H||i.shiftKey||i.metaKey&&H?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",W),window.addEventListener("blur",W)},X(g,F),ee(g,"_borderLineWidth",-1),ee(g,"_colorManager",new e.ColorManager),ee(g,"_zIndex",1),ee(g,"SMALL_EDITOR_SIZE",0),o.AnnotationEditor=g;class w extends g{constructor(i){super(i),this.annotationElementId=i.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(R,o,t)=>{var x,v,b,y,C,Ve,I,h,E,N,M,Cn,O,G,_,B,K,rt,st,Y,ct,nt,it,kt,U,c,f,i,u,p,T,W,H,tt,q,ut,ft,Et,vt,Dt,Wt,Rt,Nt,At,dt,at,pt,kn,It,Xe,Xt,Ye,Vt,Ce,Jt,_e,$t,Ke,Z,ie,mt,me,lt,Pn,gt,Rn,St,Je,bt,ve,Tt,Qe;Object.defineProperty(o,"__esModule",{value:!0}),o.KeyboardManager=o.CommandManager=o.ColorManager=o.AnnotationEditorUIManager=void 0,o.bindEvents=l,o.opacityToHex=g,t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123),t(2),t(89),t(125),t(136),t(138),t(141),t(143),t(145),t(147),t(166);var e=t(1),n=t(168);function l($,a,L){for(const V of L)a.addEventListener(V,$[V].bind($))}function g($){return Math.round(Math.min(255,Math.max(1,255*$))).toString(16).padStart(2,"0")}class w{constructor(){X(this,x,0)}getId(){return`${e.AnnotationEditorPrefix}${ge(this,x)._++}`}}x=new WeakMap;const D=class{constructor(){X(this,C);X(this,v,(0,e.getUuid)());X(this,b,0);X(this,y,null)}static get _isSVGFittingCanvas(){const a='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>',V=new OffscreenCanvas(1,3).getContext("2d"),Q=new Image;Q.src=a;const et=Q.decode().then(()=>(V.drawImage(Q,0,0,1,1,0,0,1,3),new Uint32Array(V.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,e.shadow)(this,"_isSVGFittingCanvas",et)}async getFromFile(a){const{lastModified:L,name:V,size:Q,type:et}=a;return j(this,C,Ve).call(this,`${L}_${V}_${Q}_${et}`,a)}async getFromUrl(a){return j(this,C,Ve).call(this,a,a)}async getFromId(a){r(this,y)||ot(this,y,new Map);const L=r(this,y).get(a);return L?L.bitmap?(L.refCounter+=1,L):L.file?this.getFromFile(L.file):this.getFromUrl(L.url):null}getSvgUrl(a){const L=r(this,y).get(a);return L!=null&&L.isSvg?L.svgUrl:null}deleteId(a){r(this,y)||ot(this,y,new Map);const L=r(this,y).get(a);!L||(L.refCounter-=1,L.refCounter===0&&(L.bitmap=null))}isValidId(a){return a.startsWith(`image_${r(this,v)}_`)}};let k=D;v=new WeakMap,b=new WeakMap,y=new WeakMap,C=new WeakSet,Ve=async function(a,L){r(this,y)||ot(this,y,new Map);let V=r(this,y).get(a);if(V===null)return null;if(V!=null&&V.bitmap)return V.refCounter+=1,V;try{V||(V={bitmap:null,id:`image_${r(this,v)}_${ge(this,b)._++}`,refCounter:0,isSvg:!1});let Q;if(typeof L=="string"){V.url=L;const et=await fetch(L);if(!et.ok)throw new Error(et.statusText);Q=await et.blob()}else Q=V.file=L;if(Q.type==="image/svg+xml"){const et=D._isSVGFittingCanvas,ht=new FileReader,Ct=new Image,Ot=new Promise((Mt,Qt)=>{Ct.onload=()=>{V.bitmap=Ct,V.isSvg=!0,Mt()},ht.onload=async()=>{const Ut=V.svgUrl=ht.result;Ct.src=await et?`${Ut}#svgView(preserveAspectRatio(none))`:Ut},Ct.onerror=ht.onerror=Qt});ht.readAsDataURL(Q),await Ot}else V.bitmap=await createImageBitmap(Q);V.refCounter=1}catch(Q){console.error(Q),V=null}return r(this,y).set(a,V),V&&r(this,y).set(V.id,V),V};class S{constructor(){X(this,I,[]);X(this,h,!1);X(this,E,void 0);X(this,N,-1);let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:128;ot(this,E,a)}add(a){let{cmd:L,undo:V,mustExec:Q,type:et=NaN,overwriteIfSameType:ht=!1,keepUndo:Ct=!1}=a;if(Q&&L(),r(this,h))return;const Ot={cmd:L,undo:V,type:et};if(r(this,N)===-1){r(this,I).length>0&&(r(this,I).length=0),ot(this,N,0),r(this,I).push(Ot);return}if(ht&&r(this,I)[r(this,N)].type===et){Ct&&(Ot.undo=r(this,I)[r(this,N)].undo),r(this,I)[r(this,N)]=Ot;return}const Mt=r(this,N)+1;Mt===r(this,E)?r(this,I).splice(0,1):(ot(this,N,Mt),Mt<r(this,I).length&&r(this,I).splice(Mt)),r(this,I).push(Ot)}undo(){r(this,N)!==-1&&(ot(this,h,!0),r(this,I)[r(this,N)].undo(),ot(this,h,!1),ot(this,N,r(this,N)-1))}redo(){r(this,N)<r(this,I).length-1&&(ot(this,N,r(this,N)+1),ot(this,h,!0),r(this,I)[r(this,N)].cmd(),ot(this,h,!1))}hasSomethingToUndo(){return r(this,N)!==-1}hasSomethingToRedo(){return r(this,N)<r(this,I).length-1}destroy(){ot(this,I,null)}}I=new WeakMap,h=new WeakMap,E=new WeakMap,N=new WeakMap,o.CommandManager=S;class s{constructor(a){X(this,M);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:L}=e.FeatureTest.platform;for(const[V,Q,et={}]of a)for(const ht of V){const Ct=ht.startsWith("mac+");L&&Ct?(this.callbacks.set(ht.slice(4),{callback:Q,options:et}),this.allKeys.add(ht.split("+").at(-1))):!L&&!Ct&&(this.callbacks.set(ht,{callback:Q,options:et}),this.allKeys.add(ht.split("+").at(-1)))}}exec(a,L){if(!this.allKeys.has(L.key))return;const V=this.callbacks.get(j(this,M,Cn).call(this,L));if(!V)return;const{callback:Q,options:{bubbles:et=!1,args:ht=[],checker:Ct=null}}=V;Ct&&!Ct(a,L)||(Q.bind(a,...ht)(),et||(L.stopPropagation(),L.preventDefault()))}}M=new WeakSet,Cn=function(a){a.altKey&&this.buffer.push("alt"),a.ctrlKey&&this.buffer.push("ctrl"),a.metaKey&&this.buffer.push("meta"),a.shiftKey&&this.buffer.push("shift"),this.buffer.push(a.key);const L=this.buffer.join("+");return this.buffer.length=0,L},o.KeyboardManager=s;const F=class{get _colors(){const a=new Map([["CanvasText",null],["Canvas",null]]);return(0,n.getColorValues)(a),(0,e.shadow)(this,"_colors",a)}convert(a){const L=(0,n.getRGB)(a);if(!window.matchMedia("(forced-colors: active)").matches)return L;for(const[V,Q]of this._colors)if(Q.every((et,ht)=>et===L[ht]))return F._colorsMapping.get(V);return L}getHexCode(a){const L=this._colors.get(a);return L?e.Util.makeHexColor(...L):a}};let m=F;ee(m,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]])),o.ColorManager=m;const Ft=class{constructor(a,L,V,Q,et,ht){X(this,pt);X(this,It);X(this,Xt);X(this,Vt);X(this,Jt);X(this,$t);X(this,Z);X(this,mt);X(this,lt);X(this,gt);X(this,St);X(this,bt);X(this,Tt);X(this,O,null);X(this,G,new Map);X(this,_,new Map);X(this,B,null);X(this,K,null);X(this,rt,new S);X(this,st,0);X(this,Y,new Set);X(this,ct,null);X(this,nt,null);X(this,it,new Set);X(this,kt,null);X(this,U,new w);X(this,c,!1);X(this,f,!1);X(this,i,null);X(this,u,e.AnnotationEditorType.NONE);X(this,p,new Set);X(this,T,null);X(this,W,this.blur.bind(this));X(this,H,this.focus.bind(this));X(this,tt,this.copy.bind(this));X(this,q,this.cut.bind(this));X(this,ut,this.paste.bind(this));X(this,ft,this.keydown.bind(this));X(this,Et,this.onEditingAction.bind(this));X(this,vt,this.onPageChanging.bind(this));X(this,Dt,this.onScaleChanging.bind(this));X(this,Wt,this.onRotationChanging.bind(this));X(this,Rt,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});X(this,Nt,[0,0]);X(this,At,null);X(this,dt,null);X(this,at,null);ot(this,dt,a),ot(this,at,L),ot(this,B,V),this._eventBus=Q,this._eventBus._on("editingaction",r(this,Et)),this._eventBus._on("pagechanging",r(this,vt)),this._eventBus._on("scalechanging",r(this,Dt)),this._eventBus._on("rotationchanging",r(this,Wt)),ot(this,K,et.annotationStorage),ot(this,kt,et.filterFactory),ot(this,T,ht),this.viewParameters={realScale:n.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){const a=Ft.prototype,L=et=>{const{activeElement:ht}=document;return ht&&r(et,dt).contains(ht)&&et.hasSomethingToControl()},V=this.TRANSLATE_SMALL,Q=this.TRANSLATE_BIG;return(0,e.shadow)(this,"_keyboardManager",new s([[["ctrl+a","mac+meta+a"],a.selectAll],[["ctrl+z","mac+meta+z"],a.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],a.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],a.delete],[["Escape","mac+Escape"],a.unselectAll],[["ArrowLeft","mac+ArrowLeft"],a.translateSelectedEditors,{args:[-V,0],checker:L}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],a.translateSelectedEditors,{args:[-Q,0],checker:L}],[["ArrowRight","mac+ArrowRight"],a.translateSelectedEditors,{args:[V,0],checker:L}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],a.translateSelectedEditors,{args:[Q,0],checker:L}],[["ArrowUp","mac+ArrowUp"],a.translateSelectedEditors,{args:[0,-V],checker:L}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],a.translateSelectedEditors,{args:[0,-Q],checker:L}],[["ArrowDown","mac+ArrowDown"],a.translateSelectedEditors,{args:[0,V],checker:L}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],a.translateSelectedEditors,{args:[0,Q],checker:L}]]))}destroy(){j(this,Vt,Ce).call(this),j(this,It,Xe).call(this),this._eventBus._off("editingaction",r(this,Et)),this._eventBus._off("pagechanging",r(this,vt)),this._eventBus._off("scalechanging",r(this,Dt)),this._eventBus._off("rotationchanging",r(this,Wt));for(const a of r(this,_).values())a.destroy();r(this,_).clear(),r(this,G).clear(),r(this,it).clear(),ot(this,O,null),r(this,p).clear(),r(this,rt).destroy(),r(this,B).destroy()}get hcmFilter(){return(0,e.shadow)(this,"hcmFilter",r(this,T)?r(this,kt).addHCMFilter(r(this,T).foreground,r(this,T).background):"none")}get direction(){return(0,e.shadow)(this,"direction",getComputedStyle(r(this,dt)).direction)}editAltText(a){var L;(L=r(this,B))==null||L.editAltText(this,a)}onPageChanging(a){let{pageNumber:L}=a;ot(this,st,L-1)}focusMainContainer(){r(this,dt).focus()}findParent(a,L){for(const V of r(this,_).values()){const{x:Q,y:et,width:ht,height:Ct}=V.div.getBoundingClientRect();if(a>=Q&&a<=Q+ht&&L>=et&&L<=et+Ct)return V}return null}disableUserSelect(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;r(this,at).classList.toggle("noUserSelect",a)}addShouldRescale(a){r(this,it).add(a)}removeShouldRescale(a){r(this,it).delete(a)}onScaleChanging(a){let{scale:L}=a;this.commitOrRemove(),this.viewParameters.realScale=L*n.PixelsPerInch.PDF_TO_CSS_UNITS;for(const V of r(this,it))V.onScaleChanging()}onRotationChanging(a){let{pagesRotation:L}=a;this.commitOrRemove(),this.viewParameters.rotation=L}addToAnnotationStorage(a){!a.isEmpty()&&r(this,K)&&!r(this,K).has(a.id)&&r(this,K).setValue(a.id,a)}blur(){if(!this.hasSelection)return;const{activeElement:a}=document;for(const L of r(this,p))if(L.div.contains(a)){ot(this,i,[L,a]),L._focusEventsAllowed=!1;break}}focus(){if(!r(this,i))return;const[a,L]=r(this,i);ot(this,i,null),L.addEventListener("focusin",()=>{a._focusEventsAllowed=!0},{once:!0}),L.focus()}addEditListeners(){j(this,Xt,Ye).call(this),j(this,Jt,_e).call(this)}removeEditListeners(){j(this,Vt,Ce).call(this),j(this,$t,Ke).call(this)}copy(a){var V;if(a.preventDefault(),(V=r(this,O))==null||V.commitOrRemove(),!this.hasSelection)return;const L=[];for(const Q of r(this,p)){const et=Q.serialize(!0);et&&L.push(et)}L.length!==0&&a.clipboardData.setData("application/pdfjs",JSON.stringify(L))}cut(a){this.copy(a),this.delete()}paste(a){a.preventDefault();const{clipboardData:L}=a;for(const et of L.items)for(const ht of r(this,nt))if(ht.isHandlingMimeForPasting(et.type)){ht.paste(et,this.currentLayer);return}let V=L.getData("application/pdfjs");if(!V)return;try{V=JSON.parse(V)}catch(et){(0,e.warn)(`paste: "${et.message}".`);return}if(!Array.isArray(V))return;this.unselectAll();const Q=this.currentLayer;try{const et=[];for(const Ot of V){const Mt=Q.deserialize(Ot);if(!Mt)return;et.push(Mt)}const ht=()=>{for(const Ot of et)j(this,St,Je).call(this,Ot);j(this,Tt,Qe).call(this,et)},Ct=()=>{for(const Ot of et)Ot.remove()};this.addCommands({cmd:ht,undo:Ct,mustExec:!0})}catch(et){(0,e.warn)(`paste: "${et.message}".`)}}keydown(a){var L;(L=this.getActive())!=null&&L.shouldGetKeyboardEvents()||Ft._keyboardManager.exec(this,a)}onEditingAction(a){["undo","redo","delete","selectAll"].includes(a.name)&&this[a.name]()}setEditingState(a){a?(j(this,pt,kn).call(this),j(this,Xt,Ye).call(this),j(this,Jt,_e).call(this),j(this,Z,ie).call(this,{isEditing:r(this,u)!==e.AnnotationEditorType.NONE,isEmpty:j(this,bt,ve).call(this),hasSomethingToUndo:r(this,rt).hasSomethingToUndo(),hasSomethingToRedo:r(this,rt).hasSomethingToRedo(),hasSelectedEditor:!1})):(j(this,It,Xe).call(this),j(this,Vt,Ce).call(this),j(this,$t,Ke).call(this),j(this,Z,ie).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(a){if(!r(this,nt)){ot(this,nt,a);for(const L of r(this,nt))j(this,mt,me).call(this,L.defaultPropertiesToUpdate)}}getId(){return r(this,U).getId()}get currentLayer(){return r(this,_).get(r(this,st))}getLayer(a){return r(this,_).get(a)}get currentPageIndex(){return r(this,st)}addLayer(a){r(this,_).set(a.pageIndex,a),r(this,c)?a.enable():a.disable()}removeLayer(a){r(this,_).delete(a.pageIndex)}updateMode(a){let L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(r(this,u)!==a){if(ot(this,u,a),a===e.AnnotationEditorType.NONE){this.setEditingState(!1),j(this,gt,Rn).call(this);return}this.setEditingState(!0),j(this,lt,Pn).call(this),this.unselectAll();for(const V of r(this,_).values())V.updateMode(a);if(!!L){for(const V of r(this,G).values())if(V.annotationElementId===L){this.setSelected(V),V.enterInEditMode();break}}}}updateToolbar(a){a!==r(this,u)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:a})}updateParams(a,L){if(!!r(this,nt)){if(a===e.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(a);return}for(const V of r(this,p))V.updateParams(a,L);for(const V of r(this,nt))V.updateDefaultParams(a,L)}}enableWaiting(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(r(this,f)!==a){ot(this,f,a);for(const L of r(this,_).values())a?L.disableClick():L.enableClick(),L.div.classList.toggle("waiting",a)}}getEditors(a){const L=[];for(const V of r(this,G).values())V.pageIndex===a&&L.push(V);return L}getEditor(a){return r(this,G).get(a)}addEditor(a){r(this,G).set(a.id,a)}removeEditor(a){var L;r(this,G).delete(a.id),this.unselect(a),(!a.annotationElementId||!r(this,Y).has(a.annotationElementId))&&((L=r(this,K))==null||L.remove(a.id))}addDeletedAnnotationElement(a){r(this,Y).add(a.annotationElementId),a.deleted=!0}isDeletedAnnotationElement(a){return r(this,Y).has(a)}removeDeletedAnnotationElement(a){r(this,Y).delete(a.annotationElementId),a.deleted=!1}setActiveEditor(a){r(this,O)!==a&&(ot(this,O,a),a&&j(this,mt,me).call(this,a.propertiesToUpdate))}toggleSelected(a){if(r(this,p).has(a)){r(this,p).delete(a),a.unselect(),j(this,Z,ie).call(this,{hasSelectedEditor:this.hasSelection});return}r(this,p).add(a),a.select(),j(this,mt,me).call(this,a.propertiesToUpdate),j(this,Z,ie).call(this,{hasSelectedEditor:!0})}setSelected(a){for(const L of r(this,p))L!==a&&L.unselect();r(this,p).clear(),r(this,p).add(a),a.select(),j(this,mt,me).call(this,a.propertiesToUpdate),j(this,Z,ie).call(this,{hasSelectedEditor:!0})}isSelected(a){return r(this,p).has(a)}unselect(a){a.unselect(),r(this,p).delete(a),j(this,Z,ie).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return r(this,p).size!==0}undo(){r(this,rt).undo(),j(this,Z,ie).call(this,{hasSomethingToUndo:r(this,rt).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:j(this,bt,ve).call(this)})}redo(){r(this,rt).redo(),j(this,Z,ie).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:r(this,rt).hasSomethingToRedo(),isEmpty:j(this,bt,ve).call(this)})}addCommands(a){r(this,rt).add(a),j(this,Z,ie).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:j(this,bt,ve).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const a=[...r(this,p)],L=()=>{for(const Q of a)Q.remove()},V=()=>{for(const Q of a)j(this,St,Je).call(this,Q)};this.addCommands({cmd:L,undo:V,mustExec:!0})}commitOrRemove(){var a;(a=r(this,O))==null||a.commitOrRemove()}hasSomethingToControl(){return r(this,O)||this.hasSelection}selectAll(){for(const a of r(this,p))a.commit();j(this,Tt,Qe).call(this,r(this,G).values())}unselectAll(){if(r(this,O)){r(this,O).commitOrRemove();return}if(!!this.hasSelection){for(const a of r(this,p))a.unselect();r(this,p).clear(),j(this,Z,ie).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(a,L){if((arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1)||this.commitOrRemove(),!this.hasSelection)return;r(this,Nt)[0]+=a,r(this,Nt)[1]+=L;const[Q,et]=r(this,Nt),ht=[...r(this,p)],Ct=1e3;r(this,At)&&clearTimeout(r(this,At)),ot(this,At,setTimeout(()=>{ot(this,At,null),r(this,Nt)[0]=r(this,Nt)[1]=0,this.addCommands({cmd:()=>{for(const Ot of ht)r(this,G).has(Ot.id)&&Ot.translateInPage(Q,et)},undo:()=>{for(const Ot of ht)r(this,G).has(Ot.id)&&Ot.translateInPage(-Q,-et)},mustExec:!1})},Ct));for(const Ot of ht)Ot.translateInPage(a,L)}setUpDragSession(){if(!!this.hasSelection){this.disableUserSelect(!0),ot(this,ct,new Map);for(const a of r(this,p))r(this,ct).set(a,{savedX:a.x,savedY:a.y,savedPageIndex:a.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!r(this,ct))return!1;this.disableUserSelect(!1);const a=r(this,ct);ot(this,ct,null);let L=!1;for(const[{x:Q,y:et,pageIndex:ht},Ct]of a)Ct.newX=Q,Ct.newY=et,Ct.newPageIndex=ht,L||(L=Q!==Ct.savedX||et!==Ct.savedY||ht!==Ct.savedPageIndex);if(!L)return!1;const V=(Q,et,ht,Ct)=>{if(r(this,G).has(Q.id)){const Ot=r(this,_).get(Ct);Ot?Q._setParentAndPosition(Ot,et,ht):(Q.pageIndex=Ct,Q.x=et,Q.y=ht)}};return this.addCommands({cmd:()=>{for(const[Q,{newX:et,newY:ht,newPageIndex:Ct}]of a)V(Q,et,ht,Ct)},undo:()=>{for(const[Q,{savedX:et,savedY:ht,savedPageIndex:Ct}]of a)V(Q,et,ht,Ct)},mustExec:!0}),!0}dragSelectedEditors(a,L){if(!!r(this,ct))for(const V of r(this,ct).keys())V.drag(a,L)}rebuild(a){if(a.parent===null){const L=this.getLayer(a.pageIndex);L?(L.changeParent(a),L.addOrRebuild(a)):(this.addEditor(a),this.addToAnnotationStorage(a),a.rebuild())}else a.parent.addOrRebuild(a)}isActive(a){return r(this,O)===a}getActive(){return r(this,O)}getMode(){return r(this,u)}get imageManager(){return(0,e.shadow)(this,"imageManager",new k)}};let d=Ft;O=new WeakMap,G=new WeakMap,_=new WeakMap,B=new WeakMap,K=new WeakMap,rt=new WeakMap,st=new WeakMap,Y=new WeakMap,ct=new WeakMap,nt=new WeakMap,it=new WeakMap,kt=new WeakMap,U=new WeakMap,c=new WeakMap,f=new WeakMap,i=new WeakMap,u=new WeakMap,p=new WeakMap,T=new WeakMap,W=new WeakMap,H=new WeakMap,tt=new WeakMap,q=new WeakMap,ut=new WeakMap,ft=new WeakMap,Et=new WeakMap,vt=new WeakMap,Dt=new WeakMap,Wt=new WeakMap,Rt=new WeakMap,Nt=new WeakMap,At=new WeakMap,dt=new WeakMap,at=new WeakMap,pt=new WeakSet,kn=function(){window.addEventListener("focus",r(this,H)),window.addEventListener("blur",r(this,W))},It=new WeakSet,Xe=function(){window.removeEventListener("focus",r(this,H)),window.removeEventListener("blur",r(this,W))},Xt=new WeakSet,Ye=function(){window.addEventListener("keydown",r(this,ft),{capture:!0})},Vt=new WeakSet,Ce=function(){window.removeEventListener("keydown",r(this,ft),{capture:!0})},Jt=new WeakSet,_e=function(){document.addEventListener("copy",r(this,tt)),document.addEventListener("cut",r(this,q)),document.addEventListener("paste",r(this,ut))},$t=new WeakSet,Ke=function(){document.removeEventListener("copy",r(this,tt)),document.removeEventListener("cut",r(this,q)),document.removeEventListener("paste",r(this,ut))},Z=new WeakSet,ie=function(a){Object.entries(a).some(V=>{let[Q,et]=V;return r(this,Rt)[Q]!==et})&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(r(this,Rt),a)})},mt=new WeakSet,me=function(a){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:a})},lt=new WeakSet,Pn=function(){if(!r(this,c)){ot(this,c,!0);for(const a of r(this,_).values())a.enable()}},gt=new WeakSet,Rn=function(){if(this.unselectAll(),r(this,c)){ot(this,c,!1);for(const a of r(this,_).values())a.disable()}},St=new WeakSet,Je=function(a){const L=r(this,_).get(a.pageIndex);L?L.addOrRebuild(a):this.addEditor(a)},bt=new WeakSet,ve=function(){if(r(this,G).size===0)return!0;if(r(this,G).size===1)for(const a of r(this,G).values())return a.isEmpty();return!1},Tt=new WeakSet,Qe=function(a){r(this,p).clear();for(const L of a)L.isEmpty()||(r(this,p).add(L),L.select());j(this,Z,ie).call(this,{hasSelectedEditor:!0})},ee(d,"TRANSLATE_SMALL",1),ee(d,"TRANSLATE_BIG",10),o.AnnotationEditorUIManager=d},(R,o,t)=>{var e=t(3),n=t(6),l=t(4),g=t(24),w=t(14),k=t(8),S=t(21),s=t(20),m=t(91),d=t(39),x=t(77),v=t(64),b=t(159),y=t(7),C=t(167),P=t(27),D=l.JSON,I=l.Number,h=l.SyntaxError,E=D&&D.parse,N=g("Object","keys"),M=Object.getOwnPropertyDescriptor,A=w("".charAt),F=w("".slice),O=w(/./.exec),G=w([].push),_=/^\d$/,B=/^[1-9]$/,K=/^(?:-|\d)$/,rt=/^[\t\n\r ]$/,st=0,Y=1,ct=function(i,u){i=x(i);var p=new U(i,0),T=p.parse(),W=T.value,H=p.skip(rt,T.end);if(H<i.length)throw h('Unexpected extra character: "'+A(i,H)+'" after the parsed data at: '+H);return S(u)?nt({"":W},"",u,T):W},nt=function(i,u,p,T){var W=i[u],H=T&&W===T.value,tt=H&&typeof T.source=="string"?{source:T.source}:{},q,ut,ft,Et,vt;if(s(W)){var Dt=m(W),Wt=H?T.nodes:Dt?[]:{};if(Dt)for(q=Wt.length,ft=v(W),Et=0;Et<ft;Et++)it(W,Et,nt(W,""+Et,p,Et<q?Wt[Et]:void 0));else for(ut=N(W),ft=v(ut),Et=0;Et<ft;Et++)vt=ut[Et],it(W,vt,nt(W,vt,p,d(Wt,vt)?Wt[vt]:void 0))}return k(p,i,u,W,tt)},it=function(i,u,p){if(n){var T=M(i,u);if(T&&!T.configurable)return}p===void 0?delete i[u]:b(i,u,p)},kt=function(i,u,p,T){this.value=i,this.end=u,this.source=p,this.nodes=T},U=function(i,u){this.source=i,this.index=u};U.prototype={fork:function(i){return new U(this.source,i)},parse:function(){var i=this.source,u=this.skip(rt,this.index),p=this.fork(u),T=A(i,u);if(O(K,T))return p.number();switch(T){case"{":return p.object();case"[":return p.array();case'"':return p.string();case"t":return p.keyword(!0);case"f":return p.keyword(!1);case"n":return p.keyword(null)}throw h('Unexpected character: "'+T+'" at: '+u)},node:function(i,u,p,T,W){return new kt(u,T,i?null:F(this.source,p,T),W)},object:function(){for(var i=this.source,u=this.index+1,p=!1,T={},W={};u<i.length;){if(u=this.until(['"',"}"],u),A(i,u)==="}"&&!p){u++;break}var H=this.fork(u).string(),tt=H.value;u=H.end,u=this.until([":"],u)+1,u=this.skip(rt,u),H=this.fork(u).parse(),b(W,tt,H),b(T,tt,H.value),u=this.until([",","}"],H.end);var q=A(i,u);if(q===",")p=!0,u++;else if(q==="}"){u++;break}}return this.node(Y,T,this.index,u,W)},array:function(){for(var i=this.source,u=this.index+1,p=!1,T=[],W=[];u<i.length;){if(u=this.skip(rt,u),A(i,u)==="]"&&!p){u++;break}var H=this.fork(u).parse();if(G(W,H),G(T,H.value),u=this.until([",","]"],H.end),A(i,u)===",")p=!0,u++;else if(A(i,u)==="]"){u++;break}}return this.node(Y,T,this.index,u,W)},string:function(){var i=this.index,u=C(this.source,this.index+1);return this.node(st,u.value,i,u.end)},number:function(){var i=this.source,u=this.index,p=u;if(A(i,p)==="-"&&p++,A(i,p)==="0")p++;else if(O(B,A(i,p)))p=this.skip(_,++p);else throw h("Failed to parse number at: "+p);if(A(i,p)==="."&&(p=this.skip(_,++p)),A(i,p)==="e"||A(i,p)==="E"){p++,(A(i,p)==="+"||A(i,p)==="-")&&p++;var T=p;if(p=this.skip(_,p),T===p)throw h("Failed to parse number's exponent value at: "+p)}return this.node(st,I(F(i,u,p)),u,p)},keyword:function(i){var u=""+i,p=this.index,T=p+u.length;if(F(this.source,p,T)!==u)throw h("Failed to parse value at: "+p);return this.node(st,i,p,T)},skip:function(i,u){for(var p=this.source;u<p.length&&O(i,A(p,u));u++);return u},until:function(i,u){u=this.skip(rt,u);for(var p=A(this.source,u),T=0;T<i.length;T++)if(i[T]===p)return u;throw h('Unexpected character: "'+p+'" at: '+u)}};var c=y(function(){var i="9007199254740993",u;return E(i,function(p,T,W){u=W.source}),u!==i}),f=P&&!y(function(){return 1/E("-0 ")!==-1/0});e({target:"JSON",stat:!0,forced:c},{parse:function(u,p){return f&&!S(p)?E(u):ct(u,p)}})},(R,o,t)=>{var e=t(14),n=t(39),l=SyntaxError,g=parseInt,w=String.fromCharCode,k=e("".charAt),S=e("".slice),s=e(/./.exec),m={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":`
  2. `,"\\r":"\r","\\t":" "},d=/^[\da-f]{4}$/i,x=/^[\u0000-\u001F]$/;R.exports=function(v,b){for(var y=!0,C="";b<v.length;){var P=k(v,b);if(P==="\\"){var D=S(v,b,b+2);if(n(m,D))C+=m[D],b+=2;else if(D==="\\u"){b+=2;var I=S(v,b,b+4);if(!s(d,I))throw l("Bad Unicode escape at: "+b);C+=w(g(I,16)),b+=4}else throw l('Unknown escape sequence: "'+D+'"')}else if(P==='"'){y=!1,b++;break}else{if(s(x,P))throw l("Bad control character in string literal at: "+b);C+=P,b++}}if(y)throw l("Unterminated string at: "+b);return{value:C,end:b}}},(R,o,t)=>{var st,Y,ct,nt,it,kt,U,c,f,i,u,p,ue,W,de,tt,Ze,ut,ke,Et,Pe,Dt,be,Rt,ye;Object.defineProperty(o,"__esModule",{value:!0}),o.StatTimer=o.RenderingCancelledException=o.PixelsPerInch=o.PageViewport=o.PDFDateString=o.DOMStandardFontDataFactory=o.DOMSVGFactory=o.DOMFilterFactory=o.DOMCanvasFactory=o.DOMCMapReaderFactory=void 0,o.deprecated=N,o.getColorValues=G,o.getCurrentTransform=_,o.getCurrentTransformInverse=B,o.getFilenameFromUrl=C,o.getPdfFilenameFromUrl=P,o.getRGB=O,o.getXfaPageViewport=F,o.isDataScheme=b,o.isPdfFile=y,o.isValidFetchUrl=I,o.loadScript=E,o.noContextMenu=h,o.setLayerDimensions=K,t(2),t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123),t(89),t(84),t(86),t(87);var e=t(169),n=t(1);const l="http://www.w3.org/2000/svg",rt=class{};let g=rt;ee(g,"CSS",96),ee(g,"PDF",72),ee(g,"PDF_TO_CSS_UNITS",rt.CSS/rt.PDF),o.PixelsPerInch=g;class w extends e.BaseFilterFactory{constructor(){let{docId:at,ownerDocument:pt=globalThis.document}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super();X(this,p);X(this,W);X(this,tt);X(this,ut);X(this,Et);X(this,Dt);X(this,Rt);X(this,st,void 0);X(this,Y,void 0);X(this,ct,void 0);X(this,nt,void 0);X(this,it,void 0);X(this,kt,void 0);X(this,U,void 0);X(this,c,void 0);X(this,f,void 0);X(this,i,void 0);X(this,u,0);ot(this,ct,at),ot(this,nt,pt)}addFilter(at){if(!at)return"none";let pt=r(this,p,ue).get(at);if(pt)return pt;let wt,It,Gt,Xt;if(at.length===1){const Jt=at[0],Zt=new Array(256);for(let $t=0;$t<256;$t++)Zt[$t]=Jt[$t]/255;Xt=wt=It=Gt=Zt.join(",")}else{const[Jt,Zt,$t]=at,yt=new Array(256),Z=new Array(256),J=new Array(256);for(let mt=0;mt<256;mt++)yt[mt]=Jt[mt]/255,Z[mt]=Zt[mt]/255,J[mt]=$t[mt]/255;wt=yt.join(","),It=Z.join(","),Gt=J.join(","),Xt=`${wt}${It}${Gt}`}if(pt=r(this,p,ue).get(Xt),pt)return r(this,p,ue).set(at,pt),pt;const zt=`g_${r(this,ct)}_transfer_map_${ge(this,u)._++}`,Vt=`url(#${zt})`;r(this,p,ue).set(at,Vt),r(this,p,ue).set(Xt,Vt);const Kt=j(this,ut,ke).call(this,zt);return j(this,Dt,be).call(this,wt,It,Gt,Kt),Vt}addHCMFilter(at,pt){var Zt;const wt=`${at}-${pt}`;if(r(this,kt)===wt)return r(this,U);if(ot(this,kt,wt),ot(this,U,"none"),(Zt=r(this,it))==null||Zt.remove(),!at||!pt)return r(this,U);const It=j(this,Rt,ye).call(this,at);at=n.Util.makeHexColor(...It);const Gt=j(this,Rt,ye).call(this,pt);if(pt=n.Util.makeHexColor(...Gt),r(this,W,de).style.color="",at==="#000000"&&pt==="#ffffff"||at===pt)return r(this,U);const Xt=new Array(256);for(let $t=0;$t<=255;$t++){const yt=$t/255;Xt[$t]=yt<=.03928?yt/12.92:((yt+.055)/1.055)**2.4}const zt=Xt.join(","),Vt=`g_${r(this,ct)}_hcm_filter`,Kt=ot(this,c,j(this,ut,ke).call(this,Vt));j(this,Dt,be).call(this,zt,zt,zt,Kt),j(this,tt,Ze).call(this,Kt);const Jt=($t,yt)=>{const Z=It[$t]/255,J=Gt[$t]/255,mt=new Array(yt+1);for(let jt=0;jt<=yt;jt++)mt[jt]=Z+jt/yt*(J-Z);return mt.join(",")};return j(this,Dt,be).call(this,Jt(0,5),Jt(1,5),Jt(2,5),Kt),ot(this,U,`url(#${Vt})`),r(this,U)}addHighlightHCMFilter(at,pt,wt,It){var J;const Gt=`${at}-${pt}-${wt}-${It}`;if(r(this,f)===Gt)return r(this,i);if(ot(this,f,Gt),ot(this,i,"none"),(J=r(this,c))==null||J.remove(),!at||!pt)return r(this,i);const[Xt,zt]=[at,pt].map(j(this,Rt,ye).bind(this));let Vt=Math.round(.2126*Xt[0]+.7152*Xt[1]+.0722*Xt[2]),Kt=Math.round(.2126*zt[0]+.7152*zt[1]+.0722*zt[2]),[Jt,Zt]=[wt,It].map(j(this,Rt,ye).bind(this));Kt<Vt&&([Vt,Kt,Jt,Zt]=[Kt,Vt,Zt,Jt]),r(this,W,de).style.color="";const $t=(mt,jt,lt)=>{const z=new Array(256),gt=(Kt-Vt)/lt,xt=mt/255,St=(jt-mt)/(255*lt);let Pt=0;for(let bt=0;bt<=lt;bt++){const Ht=Math.round(Vt+bt*gt),Tt=xt+bt*St;for(let Lt=Pt;Lt<=Ht;Lt++)z[Lt]=Tt;Pt=Ht+1}for(let bt=Pt;bt<256;bt++)z[bt]=z[Pt-1];return z.join(",")},yt=`g_${r(this,ct)}_hcm_highlight_filter`,Z=ot(this,c,j(this,ut,ke).call(this,yt));return j(this,tt,Ze).call(this,Z),j(this,Dt,be).call(this,$t(Jt[0],Zt[0],5),$t(Jt[1],Zt[1],5),$t(Jt[2],Zt[2],5),Z),ot(this,i,`url(#${yt})`),r(this,i)}destroy(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&(r(this,U)||r(this,i))||(r(this,Y)&&(r(this,Y).parentNode.parentNode.remove(),ot(this,Y,null)),r(this,st)&&(r(this,st).clear(),ot(this,st,null)),ot(this,u,0))}}st=new WeakMap,Y=new WeakMap,ct=new WeakMap,nt=new WeakMap,it=new WeakMap,kt=new WeakMap,U=new WeakMap,c=new WeakMap,f=new WeakMap,i=new WeakMap,u=new WeakMap,p=new WeakSet,ue=function(){return r(this,st)||ot(this,st,new Map)},W=new WeakSet,de=function(){if(!r(this,Y)){const at=r(this,nt).createElement("div"),{style:pt}=at;pt.visibility="hidden",pt.contain="strict",pt.width=pt.height=0,pt.position="absolute",pt.top=pt.left=0,pt.zIndex=-1;const wt=r(this,nt).createElementNS(l,"svg");wt.setAttribute("width",0),wt.setAttribute("height",0),ot(this,Y,r(this,nt).createElementNS(l,"defs")),at.append(wt),wt.append(r(this,Y)),r(this,nt).body.append(at)}return r(this,Y)},tt=new WeakSet,Ze=function(at){const pt=r(this,nt).createElementNS(l,"feColorMatrix");pt.setAttribute("type","matrix"),pt.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"),at.append(pt)},ut=new WeakSet,ke=function(at){const pt=r(this,nt).createElementNS(l,"filter");return pt.setAttribute("color-interpolation-filters","sRGB"),pt.setAttribute("id",at),r(this,W,de).append(pt),pt},Et=new WeakSet,Pe=function(at,pt,wt){const It=r(this,nt).createElementNS(l,pt);It.setAttribute("type","discrete"),It.setAttribute("tableValues",wt),at.append(It)},Dt=new WeakSet,be=function(at,pt,wt,It){const Gt=r(this,nt).createElementNS(l,"feComponentTransfer");It.append(Gt),j(this,Et,Pe).call(this,Gt,"feFuncR",at),j(this,Et,Pe).call(this,Gt,"feFuncG",pt),j(this,Et,Pe).call(this,Gt,"feFuncB",wt)},Rt=new WeakSet,ye=function(at){return r(this,W,de).style.color=at,O(getComputedStyle(r(this,W,de)).getPropertyValue("color"))},o.DOMFilterFactory=w;class k extends e.BaseCanvasFactory{constructor(){let{ownerDocument:dt=globalThis.document}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this._document=dt}_createCanvas(dt,at){const pt=this._document.createElement("canvas");return pt.width=dt,pt.height=at,pt}}o.DOMCanvasFactory=k;async function S(At){let dt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(I(At,document.baseURI)){const at=await fetch(At);if(!at.ok)throw new Error(at.statusText);return dt?new Uint8Array(await at.arrayBuffer()):(0,n.stringToBytes)(await at.text())}return new Promise((at,pt)=>{const wt=new XMLHttpRequest;wt.open("GET",At,!0),dt&&(wt.responseType="arraybuffer"),wt.onreadystatechange=()=>{if(wt.readyState===XMLHttpRequest.DONE){if(wt.status===200||wt.status===0){let It;if(dt&&wt.response?It=new Uint8Array(wt.response):!dt&&wt.responseText&&(It=(0,n.stringToBytes)(wt.responseText)),It){at(It);return}}pt(new Error(wt.statusText))}},wt.send(null)})}class s extends e.BaseCMapReaderFactory{_fetchData(dt,at){return S(dt,this.isCompressed).then(pt=>({cMapData:pt,compressionType:at}))}}o.DOMCMapReaderFactory=s;class m extends e.BaseStandardFontDataFactory{_fetchData(dt){return S(dt,!0)}}o.DOMStandardFontDataFactory=m;class d extends e.BaseSVGFactory{_createSVG(dt){return document.createElementNS(l,dt)}}o.DOMSVGFactory=d;class x{constructor(dt){let{viewBox:at,scale:pt,rotation:wt,offsetX:It=0,offsetY:Gt=0,dontFlip:Xt=!1}=dt;this.viewBox=at,this.scale=pt,this.rotation=wt,this.offsetX=It,this.offsetY=Gt;const zt=(at[2]+at[0])/2,Vt=(at[3]+at[1])/2;let Kt,Jt,Zt,$t;switch(wt%=360,wt<0&&(wt+=360),wt){case 180:Kt=-1,Jt=0,Zt=0,$t=1;break;case 90:Kt=0,Jt=1,Zt=1,$t=0;break;case 270:Kt=0,Jt=-1,Zt=-1,$t=0;break;case 0:Kt=1,Jt=0,Zt=0,$t=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}Xt&&(Zt=-Zt,$t=-$t);let yt,Z,J,mt;Kt===0?(yt=Math.abs(Vt-at[1])*pt+It,Z=Math.abs(zt-at[0])*pt+Gt,J=(at[3]-at[1])*pt,mt=(at[2]-at[0])*pt):(yt=Math.abs(zt-at[0])*pt+It,Z=Math.abs(Vt-at[1])*pt+Gt,J=(at[2]-at[0])*pt,mt=(at[3]-at[1])*pt),this.transform=[Kt*pt,Jt*pt,Zt*pt,$t*pt,yt-Kt*pt*zt-Zt*pt*Vt,Z-Jt*pt*zt-$t*pt*Vt],this.width=J,this.height=mt}get rawDims(){const{viewBox:dt}=this;return(0,n.shadow)(this,"rawDims",{pageWidth:dt[2]-dt[0],pageHeight:dt[3]-dt[1],pageX:dt[0],pageY:dt[1]})}clone(){let{scale:dt=this.scale,rotation:at=this.rotation,offsetX:pt=this.offsetX,offsetY:wt=this.offsetY,dontFlip:It=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new x({viewBox:this.viewBox.slice(),scale:dt,rotation:at,offsetX:pt,offsetY:wt,dontFlip:It})}convertToViewportPoint(dt,at){return n.Util.applyTransform([dt,at],this.transform)}convertToViewportRectangle(dt){const at=n.Util.applyTransform([dt[0],dt[1]],this.transform),pt=n.Util.applyTransform([dt[2],dt[3]],this.transform);return[at[0],at[1],pt[0],pt[1]]}convertToPdfPoint(dt,at){return n.Util.applyInverseTransform([dt,at],this.transform)}}o.PageViewport=x;class v extends n.BaseException{constructor(dt){let at=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;super(dt,"RenderingCancelledException"),this.extraDelay=at}}o.RenderingCancelledException=v;function b(At){const dt=At.length;let at=0;for(;at<dt&&At[at].trim()==="";)at++;return At.substring(at,at+5).toLowerCase()==="data:"}function y(At){return typeof At=="string"&&/\.pdf$/i.test(At)}function C(At){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)||([At]=At.split(/[#?]/,1)),At.substring(At.lastIndexOf("/")+1)}function P(At){let dt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"document.pdf";if(typeof At!="string")return dt;if(b(At))return(0,n.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),dt;const at=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,pt=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,wt=at.exec(At);let It=pt.exec(wt[1])||pt.exec(wt[2])||pt.exec(wt[3]);if(It&&(It=It[0],It.includes("%")))try{It=pt.exec(decodeURIComponent(It))[0]}catch{}return It||dt}class D{constructor(){ee(this,"started",Object.create(null));ee(this,"times",[])}time(dt){dt in this.started&&(0,n.warn)(`Timer is already running for ${dt}`),this.started[dt]=Date.now()}timeEnd(dt){dt in this.started||(0,n.warn)(`Timer has not been started for ${dt}`),this.times.push({name:dt,start:this.started[dt],end:Date.now()}),delete this.started[dt]}toString(){const dt=[];let at=0;for(const{name:pt}of this.times)at=Math.max(pt.length,at);for(const{name:pt,start:wt,end:It}of this.times)dt.push(`${pt.padEnd(at)} ${It-wt}ms
  3. `);return dt.join("")}}o.StatTimer=D;function I(At,dt){try{const{protocol:at}=dt?new URL(At,dt):new URL(At);return at==="http:"||at==="https:"}catch{return!1}}function h(At){At.preventDefault()}function E(At){let dt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return new Promise((at,pt)=>{const wt=document.createElement("script");wt.src=At,wt.onload=function(It){dt&&wt.remove(),at(It)},wt.onerror=function(){pt(new Error(`Cannot load script at: ${wt.src}`))},(document.head||document.documentElement).append(wt)})}function N(At){console.log("Deprecated API usage: "+At)}let M;class A{static toDateObject(dt){if(!dt||typeof dt!="string")return null;M||(M=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const at=M.exec(dt);if(!at)return null;const pt=parseInt(at[1],10);let wt=parseInt(at[2],10);wt=wt>=1&&wt<=12?wt-1:0;let It=parseInt(at[3],10);It=It>=1&&It<=31?It:1;let Gt=parseInt(at[4],10);Gt=Gt>=0&&Gt<=23?Gt:0;let Xt=parseInt(at[5],10);Xt=Xt>=0&&Xt<=59?Xt:0;let zt=parseInt(at[6],10);zt=zt>=0&&zt<=59?zt:0;const Vt=at[7]||"Z";let Kt=parseInt(at[8],10);Kt=Kt>=0&&Kt<=23?Kt:0;let Jt=parseInt(at[9],10)||0;return Jt=Jt>=0&&Jt<=59?Jt:0,Vt==="-"?(Gt+=Kt,Xt+=Jt):Vt==="+"&&(Gt-=Kt,Xt-=Jt),new Date(Date.UTC(pt,wt,It,Gt,Xt,zt))}}o.PDFDateString=A;function F(At,dt){let{scale:at=1,rotation:pt=0}=dt;const{width:wt,height:It}=At.attributes.style,Gt=[0,0,parseInt(wt),parseInt(It)];return new x({viewBox:Gt,scale:at,rotation:pt})}function O(At){if(At.startsWith("#")){const dt=parseInt(At.slice(1),16);return[(dt&16711680)>>16,(dt&65280)>>8,dt&255]}return At.startsWith("rgb(")?At.slice(4,-1).split(",").map(dt=>parseInt(dt)):At.startsWith("rgba(")?At.slice(5,-1).split(",").map(dt=>parseInt(dt)).slice(0,3):((0,n.warn)(`Not a valid color format: "${At}"`),[0,0,0])}function G(At){const dt=document.createElement("span");dt.style.visibility="hidden",document.body.append(dt);for(const at of At.keys()){dt.style.color=at;const pt=window.getComputedStyle(dt).color;At.set(at,O(pt))}dt.remove()}function _(At){const{a:dt,b:at,c:pt,d:wt,e:It,f:Gt}=At.getTransform();return[dt,at,pt,wt,It,Gt]}function B(At){const{a:dt,b:at,c:pt,d:wt,e:It,f:Gt}=At.getTransform().invertSelf();return[dt,at,pt,wt,It,Gt]}function K(At,dt){let at=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,pt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;if(dt instanceof x){const{pageWidth:wt,pageHeight:It}=dt.rawDims,{style:Gt}=At,Xt=n.FeatureTest.isCSSRoundSupported,zt=`var(--scale-factor) * ${wt}px`,Vt=`var(--scale-factor) * ${It}px`,Kt=Xt?`round(${zt}, 1px)`:`calc(${zt})`,Jt=Xt?`round(${Vt}, 1px)`:`calc(${Vt})`;!at||dt.rotation%180===0?(Gt.width=Kt,Gt.height=Jt):(Gt.width=Jt,Gt.height=Kt)}pt&&At.setAttribute("data-main-rotation",dt.rotation)}},(R,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BaseStandardFontDataFactory=o.BaseSVGFactory=o.BaseFilterFactory=o.BaseCanvasFactory=o.BaseCMapReaderFactory=void 0,t(2);var e=t(1);class n{constructor(){this.constructor===n&&(0,e.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(s){return"none"}addHCMFilter(s,m){return"none"}addHighlightHCMFilter(s,m,d,x){return"none"}destroy(){}}o.BaseFilterFactory=n;class l{constructor(){this.constructor===l&&(0,e.unreachable)("Cannot initialize BaseCanvasFactory.")}create(s,m){if(s<=0||m<=0)throw new Error("Invalid canvas size");const d=this._createCanvas(s,m);return{canvas:d,context:d.getContext("2d")}}reset(s,m,d){if(!s.canvas)throw new Error("Canvas is not specified");if(m<=0||d<=0)throw new Error("Invalid canvas size");s.canvas.width=m,s.canvas.height=d}destroy(s){if(!s.canvas)throw new Error("Canvas is not specified");s.canvas.width=0,s.canvas.height=0,s.canvas=null,s.context=null}_createCanvas(s,m){(0,e.unreachable)("Abstract method `_createCanvas` called.")}}o.BaseCanvasFactory=l;class g{constructor(s){let{baseUrl:m=null,isCompressed:d=!0}=s;this.constructor===g&&(0,e.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=m,this.isCompressed=d}async fetch(s){let{name:m}=s;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 d=this.baseUrl+m+(this.isCompressed?".bcmap":""),x=this.isCompressed?e.CMapCompressionType.BINARY:e.CMapCompressionType.NONE;return this._fetchData(d,x).catch(v=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${d}`)})}_fetchData(s,m){(0,e.unreachable)("Abstract method `_fetchData` called.")}}o.BaseCMapReaderFactory=g;class w{constructor(s){let{baseUrl:m=null}=s;this.constructor===w&&(0,e.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=m}async fetch(s){let{filename:m}=s;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 d=`${this.baseUrl}${m}`;return this._fetchData(d).catch(x=>{throw new Error(`Unable to load font data at: ${d}`)})}_fetchData(s){(0,e.unreachable)("Abstract method `_fetchData` called.")}}o.BaseStandardFontDataFactory=w;class k{constructor(){this.constructor===k&&(0,e.unreachable)("Cannot initialize BaseSVGFactory.")}create(s,m){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(s<=0||m<=0)throw new Error("Invalid SVG dimensions");const x=this._createSVG("svg:svg");return x.setAttribute("version","1.1"),d||(x.setAttribute("width",`${s}px`),x.setAttribute("height",`${m}px`)),x.setAttribute("preserveAspectRatio","none"),x.setAttribute("viewBox",`0 0 ${s} ${m}`),x}createElement(s){if(typeof s!="string")throw new Error("Invalid SVG element type");return this._createSVG(s)}_createSVG(s){(0,e.unreachable)("Abstract method `_createSVG` called.")}}o.BaseSVGFactory=k},(R,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.MurmurHash3_64=void 0,t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123),t(2);var e=t(1);const n=3285377520,l=4294901760,g=65535;class w{constructor(S){this.h1=S?S&4294967295:n,this.h2=S?S&4294967295:n}update(S){let s,m;if(typeof S=="string"){s=new Uint8Array(S.length*2),m=0;for(let N=0,M=S.length;N<M;N++){const A=S.charCodeAt(N);A<=255?s[m++]=A:(s[m++]=A>>>8,s[m++]=A&255)}}else if((0,e.isArrayBuffer)(S))s=S.slice(),m=s.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const d=m>>2,x=m-d*4,v=new Uint32Array(s.buffer,0,d);let b=0,y=0,C=this.h1,P=this.h2;const D=3432918353,I=461845907,h=D&g,E=I&g;for(let N=0;N<d;N++)N&1?(b=v[N],b=b*D&l|b*h&g,b=b<<15|b>>>17,b=b*I&l|b*E&g,C^=b,C=C<<13|C>>>19,C=C*5+3864292196):(y=v[N],y=y*D&l|y*h&g,y=y<<15|y>>>17,y=y*I&l|y*E&g,P^=y,P=P<<13|P>>>19,P=P*5+3864292196);switch(b=0,x){case 3:b^=s[d*4+2]<<16;case 2:b^=s[d*4+1]<<8;case 1:b^=s[d*4],b=b*D&l|b*h&g,b=b<<15|b>>>17,b=b*I&l|b*E&g,d&1?C^=b:P^=b}this.h1=C,this.h2=P}hexdigest(){let S=this.h1,s=this.h2;return S^=s>>>1,S=S*3981806797&l|S*36045&g,s=s*4283543511&l|((s<<16|S>>>16)*2950163797&l)>>>16,S^=s>>>1,S=S*444984403&l|S*60499&g,s=s*3301882366&l|((s<<16|S>>>16)*3120437893&l)>>>16,S^=s>>>1,(S>>>0).toString(16).padStart(8,"0")+(s>>>0).toString(16).padStart(8,"0")}}o.MurmurHash3_64=w},(R,o,t)=>{var g;Object.defineProperty(o,"__esModule",{value:!0}),o.FontLoader=o.FontFaceObject=void 0,t(125),t(136),t(138),t(141),t(143),t(145),t(147),t(89),t(149);var e=t(1);class n{constructor(k){X(this,g,new Set);let{ownerDocument:S=globalThis.document,styleElement:s=null}=k;this._document=S,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(k){this.nativeFontFaces.add(k),this._document.fonts.add(k)}removeNativeFontFace(k){this.nativeFontFaces.delete(k),this._document.fonts.delete(k)}insertRule(k){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const S=this.styleElement.sheet;S.insertRule(k,S.cssRules.length)}clear(){for(const k of this.nativeFontFaces)this._document.fonts.delete(k);this.nativeFontFaces.clear(),r(this,g).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(k){if(!(!k||r(this,g).has(k.loadedName))){if((0,e.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:S,src:s,style:m}=k,d=new FontFace(S,s,m);this.addNativeFontFace(d);try{await d.load(),r(this,g).add(S)}catch{(0,e.warn)(`Cannot load system font: ${k.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(d)}return}(0,e.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(k){if(k.attached||k.missingFile&&!k.systemFontInfo)return;if(k.attached=!0,k.systemFontInfo){await this.loadSystemFont(k.systemFontInfo);return}if(this.isFontLoadingAPISupported){const s=k.createNativeFontFace();if(s){this.addNativeFontFace(s);try{await s.loaded}catch(m){throw(0,e.warn)(`Failed to load font '${s.family}': '${m}'.`),k.disableFontFace=!0,m}}return}const S=k.createFontFaceRule();if(S){if(this.insertRule(S),this.isSyncFontLoadingSupported)return;await new Promise(s=>{const m=this._queueLoadingCallback(s);this._prepareFontLoadEvent(k,m)})}}get isFontLoadingAPISupported(){var S;const k=!!((S=this._document)!=null&&S.fonts);return(0,e.shadow)(this,"isFontLoadingAPISupported",k)}get isSyncFontLoadingSupported(){let k=!1;return(e.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(k=!0),(0,e.shadow)(this,"isSyncFontLoadingSupported",k)}_queueLoadingCallback(k){function S(){for((0,e.assert)(!m.done,"completeRequest() cannot be called twice."),m.done=!0;s.length>0&&s[0].done;){const d=s.shift();setTimeout(d.callback,0)}}const{loadingRequests:s}=this,m={done:!1,complete:S,callback:k};return s.push(m),m}get _loadTestFont(){const k=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,e.shadow)(this,"_loadTestFont",k)}_prepareFontLoadEvent(k,S){function s(O,G){return O.charCodeAt(G)<<24|O.charCodeAt(G+1)<<16|O.charCodeAt(G+2)<<8|O.charCodeAt(G+3)&255}function m(O,G,_,B){const K=O.substring(0,G),rt=O.substring(G+_);return K+B+rt}let d,x;const v=this._document.createElement("canvas");v.width=1,v.height=1;const b=v.getContext("2d");let y=0;function C(O,G){if(++y>30){(0,e.warn)("Load test font never loaded."),G();return}if(b.font="30px "+O,b.fillText(".",0,20),b.getImageData(0,0,1,1).data[3]>0){G();return}setTimeout(C.bind(null,O,G))}const P=`lt${Date.now()}${this.loadTestFontId++}`;let D=this._loadTestFont;D=m(D,976,P.length,P);const h=16,E=1482184792;let N=s(D,h);for(d=0,x=P.length-3;d<x;d+=4)N=N-E+s(P,d)|0;d<P.length&&(N=N-E+s(P+"XXX",d)|0),D=m(D,h,4,(0,e.string32)(N));const M=`url(data:font/opentype;base64,${btoa(D)});`,A=`@font-face {font-family:"${P}";src:${M}}`;this.insertRule(A);const F=this._document.createElement("div");F.style.visibility="hidden",F.style.width=F.style.height="10px",F.style.position="absolute",F.style.top=F.style.left="0px";for(const O of[k.loadedName,P]){const G=this._document.createElement("span");G.textContent="Hi",G.style.fontFamily=O,F.append(G)}this._document.body.append(F),C(P,()=>{F.remove(),S.complete()})}}g=new WeakMap,o.FontLoader=n;class l{constructor(k,S){let{isEvalSupported:s=!0,disableFontFace:m=!1,ignoreErrors:d=!1,inspectFont:x=null}=S;this.compiledGlyphs=Object.create(null);for(const v in k)this[v]=k[v];this.isEvalSupported=s!==!1,this.disableFontFace=m===!0,this.ignoreErrors=d===!0,this._inspectFont=x}createNativeFontFace(){var S;if(!this.data||this.disableFontFace)return null;let k;if(!this.cssFontInfo)k=new FontFace(this.loadedName,this.data,{});else{const s={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(s.style=`oblique ${this.cssFontInfo.italicAngle}deg`),k=new FontFace(this.cssFontInfo.fontFamily,this.data,s)}return(S=this._inspectFont)==null||S.call(this,this),k}createFontFaceRule(){var m;if(!this.data||this.disableFontFace)return null;const k=(0,e.bytesToString)(this.data),S=`url(data:${this.mimetype};base64,${btoa(k)});`;let s;if(!this.cssFontInfo)s=`@font-face {font-family:"${this.loadedName}";src:${S}}`;else{let d=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(d+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),s=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${d}src:${S}}`}return(m=this._inspectFont)==null||m.call(this,this,S),s}getPathGenerator(k,S){if(this.compiledGlyphs[S]!==void 0)return this.compiledGlyphs[S];let s;try{s=k.get(this.loadedName+"_path_"+S)}catch(m){if(!this.ignoreErrors)throw m;return(0,e.warn)(`getPathGenerator - ignoring character: "${m}".`),this.compiledGlyphs[S]=function(d,x){}}if(this.isEvalSupported&&e.FeatureTest.isEvalSupported){const m=[];for(const d of s){const x=d.args!==void 0?d.args.join(","):"";m.push("c.",d.cmd,"(",x,`);
  4. `)}return this.compiledGlyphs[S]=new Function("c","size",m.join(""))}return this.compiledGlyphs[S]=function(m,d){for(const x of s)x.cmd==="scale"&&(x.args=[d,-d]),m[x.cmd].apply(m,x.args)}}}o.FontFaceObject=l},(R,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.NodeStandardFontDataFactory=o.NodeFilterFactory=o.NodeCanvasFactory=o.NodeCMapReaderFactory=void 0,t(2),t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123);var e=t(169),n=t(1);(function(){if(!(globalThis.DOMMatrix||!n.isNodeJS))try{globalThis.DOMMatrix=require$$6.DOMMatrix}catch(m){(0,n.warn)(`Cannot polyfill \`DOMMatrix\`, rendering may be broken: "${m}".`)}})(),function(){if(!(globalThis.Path2D||!n.isNodeJS))try{const{CanvasRenderingContext2D:m}=require$$6,{polyfillPath2D:d}=requirePath2dPolyfill_min();globalThis.CanvasRenderingContext2D=m,d(globalThis)}catch(m){(0,n.warn)(`Cannot polyfill \`Path2D\`, rendering may be broken: "${m}".`)}}();const l=function(s){return new Promise((m,d)=>{require$$6.readFile(s,(v,b)=>{if(v||!b){d(new Error(v));return}m(new Uint8Array(b))})})};class g extends e.BaseFilterFactory{}o.NodeFilterFactory=g;class w extends e.BaseCanvasFactory{_createCanvas(m,d){return require$$6.createCanvas(m,d)}}o.NodeCanvasFactory=w;class k extends e.BaseCMapReaderFactory{_fetchData(m,d){return l(m).then(x=>({cMapData:x,compressionType:d}))}}o.NodeCMapReaderFactory=k;class S extends e.BaseStandardFontDataFactory{_fetchData(m){return l(m)}}o.NodeStandardFontDataFactory=S},(R,o,t)=>{var Y,je,nt,qe;Object.defineProperty(o,"__esModule",{value:!0}),o.CanvasGraphics=void 0,t(2),t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123),t(89);var e=t(1),n=t(168),l=t(174),g=t(175);const w=16,k=100,S=4096,s=15,m=10,d=1e3,x=16;function v(U,c){if(U._removeMirroring)throw new Error("Context is already forwarding operations.");U.__originalSave=U.save,U.__originalRestore=U.restore,U.__originalRotate=U.rotate,U.__originalScale=U.scale,U.__originalTranslate=U.translate,U.__originalTransform=U.transform,U.__originalSetTransform=U.setTransform,U.__originalResetTransform=U.resetTransform,U.__originalClip=U.clip,U.__originalMoveTo=U.moveTo,U.__originalLineTo=U.lineTo,U.__originalBezierCurveTo=U.bezierCurveTo,U.__originalRect=U.rect,U.__originalClosePath=U.closePath,U.__originalBeginPath=U.beginPath,U._removeMirroring=()=>{U.save=U.__originalSave,U.restore=U.__originalRestore,U.rotate=U.__originalRotate,U.scale=U.__originalScale,U.translate=U.__originalTranslate,U.transform=U.__originalTransform,U.setTransform=U.__originalSetTransform,U.resetTransform=U.__originalResetTransform,U.clip=U.__originalClip,U.moveTo=U.__originalMoveTo,U.lineTo=U.__originalLineTo,U.bezierCurveTo=U.__originalBezierCurveTo,U.rect=U.__originalRect,U.closePath=U.__originalClosePath,U.beginPath=U.__originalBeginPath,delete U._removeMirroring},U.save=function(){c.save(),this.__originalSave()},U.restore=function(){c.restore(),this.__originalRestore()},U.translate=function(i,u){c.translate(i,u),this.__originalTranslate(i,u)},U.scale=function(i,u){c.scale(i,u),this.__originalScale(i,u)},U.transform=function(i,u,p,T,W,H){c.transform(i,u,p,T,W,H),this.__originalTransform(i,u,p,T,W,H)},U.setTransform=function(i,u,p,T,W,H){c.setTransform(i,u,p,T,W,H),this.__originalSetTransform(i,u,p,T,W,H)},U.resetTransform=function(){c.resetTransform(),this.__originalResetTransform()},U.rotate=function(i){c.rotate(i),this.__originalRotate(i)},U.clip=function(i){c.clip(i),this.__originalClip(i)},U.moveTo=function(f,i){c.moveTo(f,i),this.__originalMoveTo(f,i)},U.lineTo=function(f,i){c.lineTo(f,i),this.__originalLineTo(f,i)},U.bezierCurveTo=function(f,i,u,p,T,W){c.bezierCurveTo(f,i,u,p,T,W),this.__originalBezierCurveTo(f,i,u,p,T,W)},U.rect=function(f,i,u,p){c.rect(f,i,u,p),this.__originalRect(f,i,u,p)},U.closePath=function(){c.closePath(),this.__originalClosePath()},U.beginPath=function(){c.beginPath(),this.__originalBeginPath()}}class b{constructor(c){this.canvasFactory=c,this.cache=Object.create(null)}getCanvas(c,f,i){let u;return this.cache[c]!==void 0?(u=this.cache[c],this.canvasFactory.reset(u,f,i)):(u=this.canvasFactory.create(f,i),this.cache[c]=u),u}delete(c){delete this.cache[c]}clear(){for(const c in this.cache){const f=this.cache[c];this.canvasFactory.destroy(f),delete this.cache[c]}}}function y(U,c,f,i,u,p,T,W,H,tt){const[q,ut,ft,Et,vt,Dt]=(0,n.getCurrentTransform)(U);if(ut===0&&ft===0){const Nt=T*q+vt,At=Math.round(Nt),dt=W*Et+Dt,at=Math.round(dt),pt=(T+H)*q+vt,wt=Math.abs(Math.round(pt)-At)||1,It=(W+tt)*Et+Dt,Gt=Math.abs(Math.round(It)-at)||1;return U.setTransform(Math.sign(q),0,0,Math.sign(Et),At,at),U.drawImage(c,f,i,u,p,0,0,wt,Gt),U.setTransform(q,ut,ft,Et,vt,Dt),[wt,Gt]}if(q===0&&Et===0){const Nt=W*ft+vt,At=Math.round(Nt),dt=T*ut+Dt,at=Math.round(dt),pt=(W+tt)*ft+vt,wt=Math.abs(Math.round(pt)-At)||1,It=(T+H)*ut+Dt,Gt=Math.abs(Math.round(It)-at)||1;return U.setTransform(0,Math.sign(ut),Math.sign(ft),0,At,at),U.drawImage(c,f,i,u,p,0,0,Gt,wt),U.setTransform(q,ut,ft,Et,vt,Dt),[Gt,wt]}U.drawImage(c,f,i,u,p,T,W,H,tt);const Wt=Math.hypot(q,ut),Rt=Math.hypot(ft,Et);return[Wt*H,Rt*tt]}function C(U){const{width:c,height:f}=U;if(c>d||f>d)return null;const i=1e3,u=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),p=c+1;let T=new Uint8Array(p*(f+1)),W,H,tt;const q=c+7&-8;let ut=new Uint8Array(q*f),ft=0;for(const Rt of U.data){let Nt=128;for(;Nt>0;)ut[ft++]=Rt&Nt?0:255,Nt>>=1}let Et=0;for(ft=0,ut[ft]!==0&&(T[0]=1,++Et),H=1;H<c;H++)ut[ft]!==ut[ft+1]&&(T[H]=ut[ft]?2:1,++Et),ft++;for(ut[ft]!==0&&(T[H]=2,++Et),W=1;W<f;W++){ft=W*q,tt=W*p,ut[ft-q]!==ut[ft]&&(T[tt]=ut[ft]?1:8,++Et);let Rt=(ut[ft]?4:0)+(ut[ft-q]?8:0);for(H=1;H<c;H++)Rt=(Rt>>2)+(ut[ft+1]?4:0)+(ut[ft-q+1]?8:0),u[Rt]&&(T[tt+H]=u[Rt],++Et),ft++;if(ut[ft-q]!==ut[ft]&&(T[tt+H]=ut[ft]?2:4,++Et),Et>i)return null}for(ft=q*(f-1),tt=W*p,ut[ft]!==0&&(T[tt]=8,++Et),H=1;H<c;H++)ut[ft]!==ut[ft+1]&&(T[tt+H]=ut[ft]?4:8,++Et),ft++;if(ut[ft]!==0&&(T[tt+H]=4,++Et),Et>i)return null;const vt=new Int32Array([0,p,-1,0,-p,0,0,0,1]),Dt=new Path2D;for(W=0;Et&&W<=f;W++){let Rt=W*p;const Nt=Rt+c;for(;Rt<Nt&&!T[Rt];)Rt++;if(Rt===Nt)continue;Dt.moveTo(Rt%p,W);const At=Rt;let dt=T[Rt];do{const at=vt[dt];do Rt+=at;while(!T[Rt]);const pt=T[Rt];pt!==5&&pt!==10?(dt=pt,T[Rt]=0):(dt=pt&51*dt>>4,T[Rt]&=dt>>2|dt<<2),Dt.lineTo(Rt%p,Rt/p|0),T[Rt]||--Et}while(At!==Rt);--W}return ut=null,T=null,function(Rt){Rt.save(),Rt.scale(1/c,-1/f),Rt.translate(0,-f),Rt.fill(Dt),Rt.beginPath(),Rt.restore()}}class P{constructor(c,f){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=e.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=e.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=e.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,c,f])}clone(){const c=Object.create(this);return c.clipBox=this.clipBox.slice(),c}setCurrentPoint(c,f){this.x=c,this.y=f}updatePathMinMax(c,f,i){[f,i]=e.Util.applyTransform([f,i],c),this.minX=Math.min(this.minX,f),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,f),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(c,f){const i=e.Util.applyTransform(f,c),u=e.Util.applyTransform(f.slice(2),c);this.minX=Math.min(this.minX,i[0],u[0]),this.minY=Math.min(this.minY,i[1],u[1]),this.maxX=Math.max(this.maxX,i[0],u[0]),this.maxY=Math.max(this.maxY,i[1],u[1])}updateScalingPathMinMax(c,f){e.Util.scaleMinMax(c,f),this.minX=Math.min(this.minX,f[0]),this.maxX=Math.max(this.maxX,f[1]),this.minY=Math.min(this.minY,f[2]),this.maxY=Math.max(this.maxY,f[3])}updateCurvePathMinMax(c,f,i,u,p,T,W,H,tt,q){const ut=e.Util.bezierBoundingBox(f,i,u,p,T,W,H,tt);if(q){q[0]=Math.min(q[0],ut[0],ut[2]),q[1]=Math.max(q[1],ut[0],ut[2]),q[2]=Math.min(q[2],ut[1],ut[3]),q[3]=Math.max(q[3],ut[1],ut[3]);return}this.updateRectMinMax(c,ut)}getPathBoundingBox(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:l.PathType.FILL,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const i=[this.minX,this.minY,this.maxX,this.maxY];if(c===l.PathType.STROKE){f||(0,e.unreachable)("Stroke bounding box must include transform.");const u=e.Util.singularValueDecompose2dScale(f),p=u[0]*this.lineWidth/2,T=u[1]*this.lineWidth/2;i[0]-=p,i[1]-=T,i[2]+=p,i[3]+=T}return i}updateClipFromPath(){const c=e.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(c||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(c){this.clipBox=c,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:l.PathType.FILL,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return e.Util.intersect(this.clipBox,this.getPathBoundingBox(c,f))}}function D(U,c){if(typeof ImageData<"u"&&c instanceof ImageData){U.putImageData(c,0,0);return}const f=c.height,i=c.width,u=f%x,p=(f-u)/x,T=u===0?p:p+1,W=U.createImageData(i,x);let H=0,tt;const q=c.data,ut=W.data;let ft,Et,vt,Dt;if(c.kind===e.ImageKind.GRAYSCALE_1BPP){const Wt=q.byteLength,Rt=new Uint32Array(ut.buffer,0,ut.byteLength>>2),Nt=Rt.length,At=i+7>>3,dt=4294967295,at=e.FeatureTest.isLittleEndian?4278190080:255;for(ft=0;ft<T;ft++){for(vt=ft<p?x:u,tt=0,Et=0;Et<vt;Et++){const pt=Wt-H;let wt=0;const It=pt>At?i:pt*8-7,Gt=It&-8;let Xt=0,zt=0;for(;wt<Gt;wt+=8)zt=q[H++],Rt[tt++]=zt&128?dt:at,Rt[tt++]=zt&64?dt:at,Rt[tt++]=zt&32?dt:at,Rt[tt++]=zt&16?dt:at,Rt[tt++]=zt&8?dt:at,Rt[tt++]=zt&4?dt:at,Rt[tt++]=zt&2?dt:at,Rt[tt++]=zt&1?dt:at;for(;wt<It;wt++)Xt===0&&(zt=q[H++],Xt=128),Rt[tt++]=zt&Xt?dt:at,Xt>>=1}for(;tt<Nt;)Rt[tt++]=0;U.putImageData(W,0,ft*x)}}else if(c.kind===e.ImageKind.RGBA_32BPP){for(Et=0,Dt=i*x*4,ft=0;ft<p;ft++)ut.set(q.subarray(H,H+Dt)),H+=Dt,U.putImageData(W,0,Et),Et+=x;ft<T&&(Dt=i*u*4,ut.set(q.subarray(H,H+Dt)),U.putImageData(W,0,Et))}else if(c.kind===e.ImageKind.RGB_24BPP)for(vt=x,Dt=i*vt,ft=0;ft<T;ft++){for(ft>=p&&(vt=u,Dt=i*vt),tt=0,Et=Dt;Et--;)ut[tt++]=q[H++],ut[tt++]=q[H++],ut[tt++]=q[H++],ut[tt++]=255;U.putImageData(W,0,ft*x)}else throw new Error(`bad image kind: ${c.kind}`)}function I(U,c){if(c.bitmap){U.drawImage(c.bitmap,0,0);return}const f=c.height,i=c.width,u=f%x,p=(f-u)/x,T=u===0?p:p+1,W=U.createImageData(i,x);let H=0;const tt=c.data,q=W.data;for(let ut=0;ut<T;ut++){const ft=ut<p?x:u;({srcPos:H}=(0,g.convertBlackAndWhiteToRGBA)({src:tt,srcPos:H,dest:q,width:i,height:ft,nonBlackColor:0})),U.putImageData(W,0,ut*x)}}function h(U,c){const f=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const i of f)U[i]!==void 0&&(c[i]=U[i]);U.setLineDash!==void 0&&(c.setLineDash(U.getLineDash()),c.lineDashOffset=U.lineDashOffset)}function E(U){if(U.strokeStyle=U.fillStyle="#000000",U.fillRule="nonzero",U.globalAlpha=1,U.lineWidth=1,U.lineCap="butt",U.lineJoin="miter",U.miterLimit=10,U.globalCompositeOperation="source-over",U.font="10px sans-serif",U.setLineDash!==void 0&&(U.setLineDash([]),U.lineDashOffset=0),!e.isNodeJS){const{filter:c}=U;c!=="none"&&c!==""&&(U.filter="none")}}function N(U,c,f,i){const u=U.length;for(let p=3;p<u;p+=4){const T=U[p];if(T===0)U[p-3]=c,U[p-2]=f,U[p-1]=i;else if(T<255){const W=255-T;U[p-3]=U[p-3]*T+c*W>>8,U[p-2]=U[p-2]*T+f*W>>8,U[p-1]=U[p-1]*T+i*W>>8}}}function M(U,c,f){const i=U.length,u=1/255;for(let p=3;p<i;p+=4){const T=f?f[U[p]]:U[p];c[p]=c[p]*T*u|0}}function A(U,c,f){const i=U.length;for(let u=3;u<i;u+=4){const p=U[u-3]*77+U[u-2]*152+U[u-1]*28;c[u]=f?c[u]*f[p>>8]>>8:c[u]*p>>16}}function F(U,c,f,i,u,p,T,W,H,tt,q){const ut=!!p,ft=ut?p[0]:0,Et=ut?p[1]:0,vt=ut?p[2]:0,Dt=u==="Luminosity"?A:M,Rt=Math.min(i,Math.ceil(1048576/f));for(let Nt=0;Nt<i;Nt+=Rt){const At=Math.min(Rt,i-Nt),dt=U.getImageData(W-tt,Nt+(H-q),f,At),at=c.getImageData(W,Nt+H,f,At);ut&&N(dt.data,ft,Et,vt),Dt(dt.data,at.data,T),c.putImageData(at,W,Nt+H)}}function O(U,c,f,i){const u=i[0],p=i[1],T=i[2]-u,W=i[3]-p;T===0||W===0||(F(c.context,f,T,W,c.subtype,c.backdrop,c.transferMap,u,p,c.offsetX,c.offsetY),U.save(),U.globalAlpha=1,U.globalCompositeOperation="source-over",U.setTransform(1,0,0,1,0,0),U.drawImage(f.canvas,0,0),U.restore())}function G(U,c){const f=e.Util.singularValueDecompose2dScale(U);f[0]=Math.fround(f[0]),f[1]=Math.fround(f[1]);const i=Math.fround((globalThis.devicePixelRatio||1)*n.PixelsPerInch.PDF_TO_CSS_UNITS);return c!==void 0?c:f[0]<=i||f[1]<=i}const _=["butt","round","square"],B=["miter","round","bevel"],K={},rt={},kt=class{constructor(c,f,i,u,p,T,W,H){X(this,Y);X(this,nt);let{optionalContentConfig:tt,markedContentStack:q=null}=T;this.ctx=c,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=f,this.objs=i,this.canvasFactory=u,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=q||[],this.optionalContentConfig=tt,this.cachedCanvases=new b(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=W,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=H,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(c){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return typeof c=="string"?c.startsWith("g_")?this.commonObjs.get(c):this.objs.get(c):f}beginDrawing(c){let{transform:f,viewport:i,transparency:u=!1,background:p=null}=c;const T=this.ctx.canvas.width,W=this.ctx.canvas.height,H=this.ctx.fillStyle;if(this.ctx.fillStyle=p||"#ffffff",this.ctx.fillRect(0,0,T,W),this.ctx.fillStyle=H,u){const tt=this.cachedCanvases.getCanvas("transparent",T,W);this.compositeCtx=this.ctx,this.transparentCanvas=tt.canvas,this.ctx=tt.context,this.ctx.save(),this.ctx.transform(...(0,n.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),E(this.ctx),f&&(this.ctx.transform(...f),this.outputScaleX=f[0],this.outputScaleY=f[0]),this.ctx.transform(...i.transform),this.viewportScale=i.scale,this.baseTransform=(0,n.getCurrentTransform)(this.ctx)}executeOperatorList(c,f,i,u){const p=c.argsArray,T=c.fnArray;let W=f||0;const H=p.length;if(H===W)return W;const tt=H-W>m&&typeof i=="function",q=tt?Date.now()+s:0;let ut=0;const ft=this.commonObjs,Et=this.objs;let vt;for(;;){if(u!==void 0&&W===u.nextBreakPoint)return u.breakIt(W,i),W;if(vt=T[W],vt!==e.OPS.dependency)this[vt].apply(this,p[W]);else for(const Dt of p[W]){const Wt=Dt.startsWith("g_")?ft:Et;if(!Wt.has(Dt))return Wt.get(Dt,i),W}if(W++,W===H)return W;if(tt&&++ut>m){if(Date.now()>q)return i(),W;ut=0}}}endDrawing(){j(this,Y,je).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const c of this._cachedBitmapsMap.values()){for(const f of c.values())typeof HTMLCanvasElement<"u"&&f instanceof HTMLCanvasElement&&(f.width=f.height=0);c.clear()}this._cachedBitmapsMap.clear(),j(this,nt,qe).call(this)}_scaleImage(c,f){const i=c.width,u=c.height;let p=Math.max(Math.hypot(f[0],f[1]),1),T=Math.max(Math.hypot(f[2],f[3]),1),W=i,H=u,tt="prescale1",q,ut;for(;p>2&&W>1||T>2&&H>1;){let ft=W,Et=H;p>2&&W>1&&(ft=W>=16384?Math.floor(W/2)-1||1:Math.ceil(W/2),p/=W/ft),T>2&&H>1&&(Et=H>=16384?Math.floor(H/2)-1||1:Math.ceil(H)/2,T/=H/Et),q=this.cachedCanvases.getCanvas(tt,ft,Et),ut=q.context,ut.clearRect(0,0,ft,Et),ut.drawImage(c,0,0,W,H,0,0,ft,Et),c=q.canvas,W=ft,H=Et,tt=tt==="prescale1"?"prescale2":"prescale1"}return{img:c,paintWidth:W,paintHeight:H}}_createMaskCanvas(c){const f=this.ctx,{width:i,height:u}=c,p=this.current.fillColor,T=this.current.patternFill,W=(0,n.getCurrentTransform)(f);let H,tt,q,ut;if((c.bitmap||c.data)&&c.count>1){const wt=c.bitmap||c.data.buffer;tt=JSON.stringify(T?W:[W.slice(0,4),p]),H=this._cachedBitmapsMap.get(wt),H||(H=new Map,this._cachedBitmapsMap.set(wt,H));const It=H.get(tt);if(It&&!T){const Gt=Math.round(Math.min(W[0],W[2])+W[4]),Xt=Math.round(Math.min(W[1],W[3])+W[5]);return{canvas:It,offsetX:Gt,offsetY:Xt}}q=It}q||(ut=this.cachedCanvases.getCanvas("maskCanvas",i,u),I(ut.context,c));let ft=e.Util.transform(W,[1/i,0,0,-1/u,0,0]);ft=e.Util.transform(ft,[1,0,0,1,0,-u]);const Et=e.Util.applyTransform([0,0],ft),vt=e.Util.applyTransform([i,u],ft),Dt=e.Util.normalizeRect([Et[0],Et[1],vt[0],vt[1]]),Wt=Math.round(Dt[2]-Dt[0])||1,Rt=Math.round(Dt[3]-Dt[1])||1,Nt=this.cachedCanvases.getCanvas("fillCanvas",Wt,Rt),At=Nt.context,dt=Math.min(Et[0],vt[0]),at=Math.min(Et[1],vt[1]);At.translate(-dt,-at),At.transform(...ft),q||(q=this._scaleImage(ut.canvas,(0,n.getCurrentTransformInverse)(At)),q=q.img,H&&T&&H.set(tt,q)),At.imageSmoothingEnabled=G((0,n.getCurrentTransform)(At),c.interpolate),y(At,q,0,0,q.width,q.height,0,0,i,u),At.globalCompositeOperation="source-in";const pt=e.Util.transform((0,n.getCurrentTransformInverse)(At),[1,0,0,1,-dt,-at]);return At.fillStyle=T?p.getPattern(f,this,pt,l.PathType.FILL):p,At.fillRect(0,0,i,u),H&&!T&&(this.cachedCanvases.delete("fillCanvas"),H.set(tt,Nt.canvas)),{canvas:Nt.canvas,offsetX:Math.round(dt),offsetY:Math.round(at)}}setLineWidth(c){c!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=c,this.ctx.lineWidth=c}setLineCap(c){this.ctx.lineCap=_[c]}setLineJoin(c){this.ctx.lineJoin=B[c]}setMiterLimit(c){this.ctx.miterLimit=c}setDash(c,f){const i=this.ctx;i.setLineDash!==void 0&&(i.setLineDash(c),i.lineDashOffset=f)}setRenderingIntent(c){}setFlatness(c){}setGState(c){for(const[f,i]of c)switch(f){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const c=this.inSMaskMode;this.current.activeSMask&&!c?this.beginSMaskMode():!this.current.activeSMask&&c&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const c=this.ctx.canvas.width,f=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,u=this.cachedCanvases.getCanvas(i,c,f);this.suspendedCtx=this.ctx,this.ctx=u.context;const p=this.ctx;p.setTransform(...(0,n.getCurrentTransform)(this.suspendedCtx)),h(this.suspendedCtx,p),v(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(),h(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(c){if(!this.current.activeSMask)return;c?(c[0]=Math.floor(c[0]),c[1]=Math.floor(c[1]),c[2]=Math.ceil(c[2]),c[3]=Math.ceil(c[3])):c=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const f=this.current.activeSMask,i=this.suspendedCtx;O(i,f,this.ctx,c),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?(h(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const c=this.current;this.stateStack.push(c),this.current=c.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),h(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(c,f,i,u,p,T){this.ctx.transform(c,f,i,u,p,T),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(c,f,i){const u=this.ctx,p=this.current;let T=p.x,W=p.y,H,tt;const q=(0,n.getCurrentTransform)(u),ut=q[0]===0&&q[3]===0||q[1]===0&&q[2]===0,ft=ut?i.slice(0):null;for(let Et=0,vt=0,Dt=c.length;Et<Dt;Et++)switch(c[Et]|0){case e.OPS.rectangle:T=f[vt++],W=f[vt++];const Wt=f[vt++],Rt=f[vt++],Nt=T+Wt,At=W+Rt;u.moveTo(T,W),Wt===0||Rt===0?u.lineTo(Nt,At):(u.lineTo(Nt,W),u.lineTo(Nt,At),u.lineTo(T,At)),ut||p.updateRectMinMax(q,[T,W,Nt,At]),u.closePath();break;case e.OPS.moveTo:T=f[vt++],W=f[vt++],u.moveTo(T,W),ut||p.updatePathMinMax(q,T,W);break;case e.OPS.lineTo:T=f[vt++],W=f[vt++],u.lineTo(T,W),ut||p.updatePathMinMax(q,T,W);break;case e.OPS.curveTo:H=T,tt=W,T=f[vt+4],W=f[vt+5],u.bezierCurveTo(f[vt],f[vt+1],f[vt+2],f[vt+3],T,W),p.updateCurvePathMinMax(q,H,tt,f[vt],f[vt+1],f[vt+2],f[vt+3],T,W,ft),vt+=6;break;case e.OPS.curveTo2:H=T,tt=W,u.bezierCurveTo(T,W,f[vt],f[vt+1],f[vt+2],f[vt+3]),p.updateCurvePathMinMax(q,H,tt,T,W,f[vt],f[vt+1],f[vt+2],f[vt+3],ft),T=f[vt+2],W=f[vt+3],vt+=4;break;case e.OPS.curveTo3:H=T,tt=W,T=f[vt+2],W=f[vt+3],u.bezierCurveTo(f[vt],f[vt+1],T,W,T,W),p.updateCurvePathMinMax(q,H,tt,f[vt],f[vt+1],T,W,T,W,ft),vt+=4;break;case e.OPS.closePath:u.closePath();break}ut&&p.updateScalingPathMinMax(q,ft),p.setCurrentPoint(T,W)}closePath(){this.ctx.closePath()}stroke(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const f=this.ctx,i=this.current.strokeColor;f.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof i=="object"&&(i==null?void 0:i.getPattern)?(f.save(),f.strokeStyle=i.getPattern(f,this,(0,n.getCurrentTransformInverse)(f),l.PathType.STROKE),this.rescaleAndStroke(!1),f.restore()):this.rescaleAndStroke(!0)),c&&this.consumePath(this.current.getClippedPathBoundingBox()),f.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const f=this.ctx,i=this.current.fillColor,u=this.current.patternFill;let p=!1;u&&(f.save(),f.fillStyle=i.getPattern(f,this,(0,n.getCurrentTransformInverse)(f),l.PathType.FILL),p=!0);const T=this.current.getClippedPathBoundingBox();this.contentVisible&&T!==null&&(this.pendingEOFill?(f.fill("evenodd"),this.pendingEOFill=!1):f.fill()),p&&f.restore(),c&&this.consumePath(T)}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=K}eoClip(){this.pendingClip=rt}beginText(){this.current.textMatrix=e.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const c=this.pendingTextPaths,f=this.ctx;if(c===void 0){f.beginPath();return}f.save(),f.beginPath();for(const i of c)f.setTransform(...i.transform),f.translate(i.x,i.y),i.addToPath(f,i.fontSize);f.restore(),f.clip(),f.beginPath(),delete this.pendingTextPaths}setCharSpacing(c){this.current.charSpacing=c}setWordSpacing(c){this.current.wordSpacing=c}setHScale(c){this.current.textHScale=c/100}setLeading(c){this.current.leading=-c}setFont(c,f){var q;const i=this.commonObjs.get(c),u=this.current;if(!i)throw new Error(`Can't find font for ${c}`);if(u.fontMatrix=i.fontMatrix||e.FONT_IDENTITY_MATRIX,(u.fontMatrix[0]===0||u.fontMatrix[3]===0)&&(0,e.warn)("Invalid font matrix for font "+c),f<0?(f=-f,u.fontDirection=-1):u.fontDirection=1,this.current.font=i,this.current.fontSize=f,i.isType3Font)return;const p=i.loadedName||"sans-serif",T=((q=i.systemFontInfo)==null?void 0:q.css)||`"${p}", ${i.fallbackName}`;let W="normal";i.black?W="900":i.bold&&(W="bold");const H=i.italic?"italic":"normal";let tt=f;f<w?tt=w:f>k&&(tt=k),this.current.fontSizeScale=f/tt,this.ctx.font=`${H} ${W} ${tt}px ${T}`}setTextRenderingMode(c){this.current.textRenderingMode=c}setTextRise(c){this.current.textRise=c}moveText(c,f){this.current.x=this.current.lineX+=c,this.current.y=this.current.lineY+=f}setLeadingMoveText(c,f){this.setLeading(-f),this.moveText(c,f)}setTextMatrix(c,f,i,u,p,T){this.current.textMatrix=[c,f,i,u,p,T],this.current.textMatrixScale=Math.hypot(c,f),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(c,f,i,u){const p=this.ctx,T=this.current,W=T.font,H=T.textRenderingMode,tt=T.fontSize/T.fontSizeScale,q=H&e.TextRenderingMode.FILL_STROKE_MASK,ut=!!(H&e.TextRenderingMode.ADD_TO_PATH_FLAG),ft=T.patternFill&&!W.missingFile;let Et;(W.disableFontFace||ut||ft)&&(Et=W.getPathGenerator(this.commonObjs,c)),W.disableFontFace||ft?(p.save(),p.translate(f,i),p.beginPath(),Et(p,tt),u&&p.setTransform(...u),(q===e.TextRenderingMode.FILL||q===e.TextRenderingMode.FILL_STROKE)&&p.fill(),(q===e.TextRenderingMode.STROKE||q===e.TextRenderingMode.FILL_STROKE)&&p.stroke(),p.restore()):((q===e.TextRenderingMode.FILL||q===e.TextRenderingMode.FILL_STROKE)&&p.fillText(c,f,i),(q===e.TextRenderingMode.STROKE||q===e.TextRenderingMode.FILL_STROKE)&&p.strokeText(c,f,i)),ut&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,n.getCurrentTransform)(p),x:f,y:i,fontSize:tt,addToPath:Et})}get isFontSubpixelAAEnabled(){const{context:c}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);c.scale(1.5,1),c.fillText("I",0,10);const f=c.getImageData(0,0,10,10).data;let i=!1;for(let u=3;u<f.length;u+=4)if(f[u]>0&&f[u]<255){i=!0;break}return(0,e.shadow)(this,"isFontSubpixelAAEnabled",i)}showText(c){const f=this.current,i=f.font;if(i.isType3Font)return this.showType3Text(c);const u=f.fontSize;if(u===0)return;const p=this.ctx,T=f.fontSizeScale,W=f.charSpacing,H=f.wordSpacing,tt=f.fontDirection,q=f.textHScale*tt,ut=c.length,ft=i.vertical,Et=ft?1:-1,vt=i.defaultVMetrics,Dt=u*f.fontMatrix[0],Wt=f.textRenderingMode===e.TextRenderingMode.FILL&&!i.disableFontFace&&!f.patternFill;p.save(),p.transform(...f.textMatrix),p.translate(f.x,f.y+f.textRise),tt>0?p.scale(q,-1):p.scale(q,1);let Rt;if(f.patternFill){p.save();const pt=f.fillColor.getPattern(p,this,(0,n.getCurrentTransformInverse)(p),l.PathType.FILL);Rt=(0,n.getCurrentTransform)(p),p.restore(),p.fillStyle=pt}let Nt=f.lineWidth;const At=f.textMatrixScale;if(At===0||Nt===0){const pt=f.textRenderingMode&e.TextRenderingMode.FILL_STROKE_MASK;(pt===e.TextRenderingMode.STROKE||pt===e.TextRenderingMode.FILL_STROKE)&&(Nt=this.getSinglePixelWidth())}else Nt/=At;if(T!==1&&(p.scale(T,T),Nt/=T),p.lineWidth=Nt,i.isInvalidPDFjsFont){const pt=[];let wt=0;for(const It of c)pt.push(It.unicode),wt+=It.width;p.fillText(pt.join(""),0,0),f.x+=wt*Dt*q,p.restore(),this.compose();return}let dt=0,at;for(at=0;at<ut;++at){const pt=c[at];if(typeof pt=="number"){dt+=Et*pt*u/1e3;continue}let wt=!1;const It=(pt.isSpace?H:0)+W,Gt=pt.fontChar,Xt=pt.accent;let zt,Vt,Kt=pt.width;if(ft){const Zt=pt.vmetric||vt,$t=-(pt.vmetric?Zt[1]:Kt*.5)*Dt,yt=Zt[2]*Dt;Kt=Zt?-Zt[0]:Kt,zt=$t/T,Vt=(dt+yt)/T}else zt=dt/T,Vt=0;if(i.remeasure&&Kt>0){const Zt=p.measureText(Gt).width*1e3/u*T;if(Kt<Zt&&this.isFontSubpixelAAEnabled){const $t=Kt/Zt;wt=!0,p.save(),p.scale($t,1),zt/=$t}else Kt!==Zt&&(zt+=(Kt-Zt)/2e3*u/T)}if(this.contentVisible&&(pt.isInFont||i.missingFile)){if(Wt&&!Xt)p.fillText(Gt,zt,Vt);else if(this.paintChar(Gt,zt,Vt,Rt),Xt){const Zt=zt+u*Xt.offset.x/T,$t=Vt-u*Xt.offset.y/T;this.paintChar(Xt.fontChar,Zt,$t,Rt)}}const Jt=ft?Kt*Dt-It*tt:Kt*Dt+It*tt;dt+=Jt,wt&&p.restore()}ft?f.y-=dt:f.x+=dt*q,p.restore(),this.compose()}showType3Text(c){const f=this.ctx,i=this.current,u=i.font,p=i.fontSize,T=i.fontDirection,W=u.vertical?1:-1,H=i.charSpacing,tt=i.wordSpacing,q=i.textHScale*T,ut=i.fontMatrix||e.FONT_IDENTITY_MATRIX,ft=c.length,Et=i.textRenderingMode===e.TextRenderingMode.INVISIBLE;let vt,Dt,Wt,Rt;if(!(Et||p===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,f.save(),f.transform(...i.textMatrix),f.translate(i.x,i.y),f.scale(q,T),vt=0;vt<ft;++vt){if(Dt=c[vt],typeof Dt=="number"){Rt=W*Dt*p/1e3,this.ctx.translate(Rt,0),i.x+=Rt*q;continue}const Nt=(Dt.isSpace?tt:0)+H,At=u.charProcOperatorList[Dt.operatorListId];if(!At){(0,e.warn)(`Type3 character "${Dt.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=Dt,this.save(),f.scale(p,p),f.transform(...ut),this.executeOperatorList(At),this.restore()),Wt=e.Util.applyTransform([Dt.width,0],ut)[0]*p+Nt,f.translate(Wt,0),i.x+=Wt*q}f.restore(),this.processingType3=null}}setCharWidth(c,f){}setCharWidthAndBounds(c,f,i,u,p,T){this.ctx.rect(i,u,p-i,T-u),this.ctx.clip(),this.endPath()}getColorN_Pattern(c){let f;if(c[0]==="TilingPattern"){const i=c[1],u=this.baseTransform||(0,n.getCurrentTransform)(this.ctx),p={createCanvasGraphics:T=>new kt(T,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};f=new l.TilingPattern(c,i,this.ctx,p,u)}else f=this._getPattern(c[1],c[2]);return f}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(c,f,i){const u=e.Util.makeHexColor(c,f,i);this.ctx.strokeStyle=u,this.current.strokeColor=u}setFillRGBColor(c,f,i){const u=e.Util.makeHexColor(c,f,i);this.ctx.fillStyle=u,this.current.fillColor=u,this.current.patternFill=!1}_getPattern(c){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,i;return this.cachedPatterns.has(c)?i=this.cachedPatterns.get(c):(i=(0,l.getShadingPattern)(this.getObject(c)),this.cachedPatterns.set(c,i)),f&&(i.matrix=f),i}shadingFill(c){if(!this.contentVisible)return;const f=this.ctx;this.save();const i=this._getPattern(c);f.fillStyle=i.getPattern(f,this,(0,n.getCurrentTransformInverse)(f),l.PathType.SHADING);const u=(0,n.getCurrentTransformInverse)(f);if(u){const{width:p,height:T}=f.canvas,[W,H,tt,q]=e.Util.getAxialAlignedBoundingBox([0,0,p,T],u);this.ctx.fillRect(W,H,tt-W,q-H)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,e.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,e.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(c,f){if(!!this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(c)&&c.length===6&&this.transform(...c),this.baseTransform=(0,n.getCurrentTransform)(this.ctx),f)){const i=f[2]-f[0],u=f[3]-f[1];this.ctx.rect(f[0],f[1],i,u),this.current.updateRectMinMax((0,n.getCurrentTransform)(this.ctx),f),this.clip(),this.endPath()}}paintFormXObjectEnd(){!this.contentVisible||(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(c){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const f=this.ctx;c.isolated||(0,e.info)("TODO: Support non-isolated groups."),c.knockout&&(0,e.warn)("Knockout groups not supported.");const i=(0,n.getCurrentTransform)(f);if(c.matrix&&f.transform(...c.matrix),!c.bbox)throw new Error("Bounding box is required.");let u=e.Util.getAxialAlignedBoundingBox(c.bbox,(0,n.getCurrentTransform)(f));const p=[0,0,f.canvas.width,f.canvas.height];u=e.Util.intersect(u,p)||[0,0,0,0];const T=Math.floor(u[0]),W=Math.floor(u[1]);let H=Math.max(Math.ceil(u[2])-T,1),tt=Math.max(Math.ceil(u[3])-W,1),q=1,ut=1;H>S&&(q=H/S,H=S),tt>S&&(ut=tt/S,tt=S),this.current.startNewPathAndClipBox([0,0,H,tt]);let ft="groupAt"+this.groupLevel;c.smask&&(ft+="_smask_"+this.smaskCounter++%2);const Et=this.cachedCanvases.getCanvas(ft,H,tt),vt=Et.context;vt.scale(1/q,1/ut),vt.translate(-T,-W),vt.transform(...i),c.smask?this.smaskStack.push({canvas:Et.canvas,context:vt,offsetX:T,offsetY:W,scaleX:q,scaleY:ut,subtype:c.smask.subtype,backdrop:c.smask.backdrop,transferMap:c.smask.transferMap||null,startTransformInverse:null}):(f.setTransform(1,0,0,1,0,0),f.translate(T,W),f.scale(q,ut),f.save()),h(f,vt),this.ctx=vt,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(f),this.groupLevel++}endGroup(c){if(!this.contentVisible)return;this.groupLevel--;const f=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,c.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const u=(0,n.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...u);const p=e.Util.getAxialAlignedBoundingBox([0,0,f.canvas.width,f.canvas.height],u);this.ctx.drawImage(f.canvas,0,0),this.ctx.restore(),this.compose(p)}}beginAnnotation(c,f,i,u,p){if(j(this,Y,je).call(this),E(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(f)&&f.length===4){const T=f[2]-f[0],W=f[3]-f[1];if(p&&this.annotationCanvasMap){i=i.slice(),i[4]-=f[0],i[5]-=f[1],f=f.slice(),f[0]=f[1]=0,f[2]=T,f[3]=W;const[H,tt]=e.Util.singularValueDecompose2dScale((0,n.getCurrentTransform)(this.ctx)),{viewportScale:q}=this,ut=Math.ceil(T*this.outputScaleX*q),ft=Math.ceil(W*this.outputScaleY*q);this.annotationCanvas=this.canvasFactory.create(ut,ft);const{canvas:Et,context:vt}=this.annotationCanvas;this.annotationCanvasMap.set(c,Et),this.annotationCanvas.savedCtx=this.ctx,this.ctx=vt,this.ctx.save(),this.ctx.setTransform(H,0,0,-tt,0,W*tt),E(this.ctx)}else E(this.ctx),this.ctx.rect(f[0],f[1],T,W),this.ctx.clip(),this.endPath()}this.current=new P(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...u)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),j(this,nt,qe).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(c){if(!this.contentVisible)return;const f=c.count;c=this.getObject(c.data,c),c.count=f;const i=this.ctx,u=this.processingType3;if(u&&(u.compiled===void 0&&(u.compiled=C(c)),u.compiled)){u.compiled(i);return}const p=this._createMaskCanvas(c),T=p.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(T,p.offsetX,p.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(c,f){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,p=arguments.length>4?arguments[4]:void 0,T=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;c=this.getObject(c.data,c);const W=this.ctx;W.save();const H=(0,n.getCurrentTransform)(W);W.transform(f,i,u,p,0,0);const tt=this._createMaskCanvas(c);W.setTransform(1,0,0,1,tt.offsetX-H[4],tt.offsetY-H[5]);for(let q=0,ut=T.length;q<ut;q+=2){const ft=e.Util.transform(H,[f,i,u,p,T[q],T[q+1]]),[Et,vt]=e.Util.applyTransform([0,0],ft);W.drawImage(tt.canvas,Et,vt)}W.restore(),this.compose()}paintImageMaskXObjectGroup(c){if(!this.contentVisible)return;const f=this.ctx,i=this.current.fillColor,u=this.current.patternFill;for(const p of c){const{data:T,width:W,height:H,transform:tt}=p,q=this.cachedCanvases.getCanvas("maskCanvas",W,H),ut=q.context;ut.save();const ft=this.getObject(T,p);I(ut,ft),ut.globalCompositeOperation="source-in",ut.fillStyle=u?i.getPattern(ut,this,(0,n.getCurrentTransformInverse)(f),l.PathType.FILL):i,ut.fillRect(0,0,W,H),ut.restore(),f.save(),f.transform(...tt),f.scale(1,-1),y(f,q.canvas,0,0,W,H,0,-1,1,1),f.restore()}this.compose()}paintImageXObject(c){if(!this.contentVisible)return;const f=this.getObject(c);if(!f){(0,e.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(f)}paintImageXObjectRepeat(c,f,i,u){if(!this.contentVisible)return;const p=this.getObject(c);if(!p){(0,e.warn)("Dependent image isn't ready yet");return}const T=p.width,W=p.height,H=[];for(let tt=0,q=u.length;tt<q;tt+=2)H.push({transform:[f,0,0,i,u[tt],u[tt+1]],x:0,y:0,w:T,h:W});this.paintInlineImageXObjectGroup(p,H)}applyTransferMapsToCanvas(c){return this.current.transferMaps!=="none"&&(c.filter=this.current.transferMaps,c.drawImage(c.canvas,0,0),c.filter="none"),c.canvas}applyTransferMapsToBitmap(c){if(this.current.transferMaps==="none")return c.bitmap;const{bitmap:f,width:i,height:u}=c,p=this.cachedCanvases.getCanvas("inlineImage",i,u),T=p.context;return T.filter=this.current.transferMaps,T.drawImage(f,0,0),T.filter="none",p.canvas}paintInlineImageXObject(c){if(!this.contentVisible)return;const f=c.width,i=c.height,u=this.ctx;if(this.save(),!e.isNodeJS){const{filter:W}=u;W!=="none"&&W!==""&&(u.filter="none")}u.scale(1/f,-1/i);let p;if(c.bitmap)p=this.applyTransferMapsToBitmap(c);else if(typeof HTMLElement=="function"&&c instanceof HTMLElement||!c.data)p=c;else{const H=this.cachedCanvases.getCanvas("inlineImage",f,i).context;D(H,c),p=this.applyTransferMapsToCanvas(H)}const T=this._scaleImage(p,(0,n.getCurrentTransformInverse)(u));u.imageSmoothingEnabled=G((0,n.getCurrentTransform)(u),c.interpolate),y(u,T.img,0,0,T.paintWidth,T.paintHeight,0,-i,f,i),this.compose(),this.restore()}paintInlineImageXObjectGroup(c,f){if(!this.contentVisible)return;const i=this.ctx;let u;if(c.bitmap)u=c.bitmap;else{const p=c.width,T=c.height,H=this.cachedCanvases.getCanvas("inlineImage",p,T).context;D(H,c),u=this.applyTransferMapsToCanvas(H)}for(const p of f)i.save(),i.transform(...p.transform),i.scale(1,-1),y(i,u,p.x,p.y,p.w,p.h,0,-1,1,1),i.restore();this.compose()}paintSolidColorImageMask(){!this.contentVisible||(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(c){}markPointProps(c,f){}beginMarkedContent(c){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(c,f){c==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(f)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(c){const f=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(c);const i=this.ctx;this.pendingClip&&(f||(this.pendingClip===rt?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const c=(0,n.getCurrentTransform)(this.ctx);if(c[1]===0&&c[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(c[0]),Math.abs(c[3]));else{const f=Math.abs(c[0]*c[3]-c[2]*c[1]),i=Math.hypot(c[0],c[2]),u=Math.hypot(c[1],c[3]);this._cachedGetSinglePixelWidth=Math.max(i,u)/f}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:c}=this.current,{a:f,b:i,c:u,d:p}=this.ctx.getTransform();let T,W;if(i===0&&u===0){const H=Math.abs(f),tt=Math.abs(p);if(H===tt)if(c===0)T=W=1/H;else{const q=H*c;T=W=q<1?1/q:1}else if(c===0)T=1/H,W=1/tt;else{const q=H*c,ut=tt*c;T=q<1?1/q:1,W=ut<1?1/ut:1}}else{const H=Math.abs(f*p-i*u),tt=Math.hypot(f,i),q=Math.hypot(u,p);if(c===0)T=q/H,W=tt/H;else{const ut=c*H;T=q>ut?q/ut:1,W=tt>ut?tt/ut:1}}this._cachedScaleForStroking[0]=T,this._cachedScaleForStroking[1]=W}return this._cachedScaleForStroking}rescaleAndStroke(c){const{ctx:f}=this,{lineWidth:i}=this.current,[u,p]=this.getScaleForStroking();if(f.lineWidth=i||1,u===1&&p===1){f.stroke();return}const T=f.getLineDash();if(c&&f.save(),f.scale(u,p),T.length>0){const W=Math.max(u,p);f.setLineDash(T.map(H=>H/W)),f.lineDashOffset/=W}f.stroke(),c&&f.restore()}isContentVisible(){for(let c=this.markedContentStack.length-1;c>=0;c--)if(!this.markedContentStack[c].visible)return!1;return!0}};let st=kt;Y=new WeakSet,je=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)},nt=new WeakSet,qe=function(){if(this.pageColors){const c=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(c!=="none"){const f=this.ctx.filter;this.ctx.filter=c,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=f}}},o.CanvasGraphics=st;for(const U in e.OPS)st.prototype[U]!==void 0&&(st.prototype[e.OPS[U]]=st.prototype[U])},(R,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TilingPattern=o.PathType=void 0,o.getShadingPattern=x,t(2);var e=t(1),n=t(168);const l={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};o.PathType=l;function g(C,P){if(!P)return;const D=P[2]-P[0],I=P[3]-P[1],h=new Path2D;h.rect(P[0],P[1],D,I),C.clip(h)}class w{constructor(){this.constructor===w&&(0,e.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,e.unreachable)("Abstract method `getPattern` called.")}}class k extends w{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 D;this._type==="axial"?D=P.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(D=P.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const I of this._colorStops)D.addColorStop(I[0],I[1]);return D}getPattern(P,D,I,h){let E;if(h===l.STROKE||h===l.FILL){const N=D.current.getClippedPathBoundingBox(h,(0,n.getCurrentTransform)(P))||[0,0,0,0],M=Math.ceil(N[2]-N[0])||1,A=Math.ceil(N[3]-N[1])||1,F=D.cachedCanvases.getCanvas("pattern",M,A,!0),O=F.context;O.clearRect(0,0,O.canvas.width,O.canvas.height),O.beginPath(),O.rect(0,0,O.canvas.width,O.canvas.height),O.translate(-N[0],-N[1]),I=e.Util.transform(I,[1,0,0,1,N[0],N[1]]),O.transform(...D.baseTransform),this.matrix&&O.transform(...this.matrix),g(O,this._bbox),O.fillStyle=this._createGradient(O),O.fill(),E=P.createPattern(F.canvas,"no-repeat");const G=new DOMMatrix(I);E.setTransform(G)}else g(P,this._bbox),E=this._createGradient(P);return E}}function S(C,P,D,I,h,E,N,M){const A=P.coords,F=P.colors,O=C.data,G=C.width*4;let _;A[D+1]>A[I+1]&&(_=D,D=I,I=_,_=E,E=N,N=_),A[I+1]>A[h+1]&&(_=I,I=h,h=_,_=N,N=M,M=_),A[D+1]>A[I+1]&&(_=D,D=I,I=_,_=E,E=N,N=_);const B=(A[D]+P.offsetX)*P.scaleX,K=(A[D+1]+P.offsetY)*P.scaleY,rt=(A[I]+P.offsetX)*P.scaleX,st=(A[I+1]+P.offsetY)*P.scaleY,Y=(A[h]+P.offsetX)*P.scaleX,ct=(A[h+1]+P.offsetY)*P.scaleY;if(K>=ct)return;const nt=F[E],it=F[E+1],kt=F[E+2],U=F[N],c=F[N+1],f=F[N+2],i=F[M],u=F[M+1],p=F[M+2],T=Math.round(K),W=Math.round(ct);let H,tt,q,ut,ft,Et,vt,Dt;for(let Wt=T;Wt<=W;Wt++){if(Wt<st){const at=Wt<K?0:(K-Wt)/(K-st);H=B-(B-rt)*at,tt=nt-(nt-U)*at,q=it-(it-c)*at,ut=kt-(kt-f)*at}else{let at;Wt>ct?at=1:st===ct?at=0:at=(st-Wt)/(st-ct),H=rt-(rt-Y)*at,tt=U-(U-i)*at,q=c-(c-u)*at,ut=f-(f-p)*at}let Rt;Wt<K?Rt=0:Wt>ct?Rt=1:Rt=(K-Wt)/(K-ct),ft=B-(B-Y)*Rt,Et=nt-(nt-i)*Rt,vt=it-(it-u)*Rt,Dt=kt-(kt-p)*Rt;const Nt=Math.round(Math.min(H,ft)),At=Math.round(Math.max(H,ft));let dt=G*Wt+Nt*4;for(let at=Nt;at<=At;at++)Rt=(H-at)/(H-ft),Rt<0?Rt=0:Rt>1&&(Rt=1),O[dt++]=tt-(tt-Et)*Rt|0,O[dt++]=q-(q-vt)*Rt|0,O[dt++]=ut-(ut-Dt)*Rt|0,O[dt++]=255}}function s(C,P,D){const I=P.coords,h=P.colors;let E,N;switch(P.type){case"lattice":const M=P.verticesPerRow,A=Math.floor(I.length/M)-1,F=M-1;for(E=0;E<A;E++){let O=E*M;for(let G=0;G<F;G++,O++)S(C,D,I[O],I[O+1],I[O+M],h[O],h[O+1],h[O+M]),S(C,D,I[O+M+1],I[O+1],I[O+M],h[O+M+1],h[O+1],h[O+M])}break;case"triangles":for(E=0,N=I.length;E<N;E+=3)S(C,D,I[E],I[E+1],I[E+2],h[E],h[E+1],h[E+2]);break;default:throw new Error("illegal figure")}}class m extends w{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,D,I){const M=Math.floor(this._bounds[0]),A=Math.floor(this._bounds[1]),F=Math.ceil(this._bounds[2])-M,O=Math.ceil(this._bounds[3])-A,G=Math.min(Math.ceil(Math.abs(F*P[0]*1.1)),3e3),_=Math.min(Math.ceil(Math.abs(O*P[1]*1.1)),3e3),B=F/G,K=O/_,rt={coords:this._coords,colors:this._colors,offsetX:-M,offsetY:-A,scaleX:1/B,scaleY:1/K},st=G+2*2,Y=_+2*2,ct=I.getCanvas("mesh",st,Y,!1),nt=ct.context,it=nt.createImageData(G,_);if(D){const U=it.data;for(let c=0,f=U.length;c<f;c+=4)U[c]=D[0],U[c+1]=D[1],U[c+2]=D[2],U[c+3]=255}for(const U of this._figures)s(it,U,rt);return nt.putImageData(it,2,2),{canvas:ct.canvas,offsetX:M-2*B,offsetY:A-2*K,scaleX:B,scaleY:K}}getPattern(P,D,I,h){g(P,this._bbox);let E;if(h===l.SHADING)E=e.Util.singularValueDecompose2dScale((0,n.getCurrentTransform)(P));else if(E=e.Util.singularValueDecompose2dScale(D.baseTransform),this.matrix){const M=e.Util.singularValueDecompose2dScale(this.matrix);E=[E[0]*M[0],E[1]*M[1]]}const N=this._createMeshCanvas(E,h===l.SHADING?null:this._background,D.cachedCanvases);return h!==l.SHADING&&(P.setTransform(...D.baseTransform),this.matrix&&P.transform(...this.matrix)),P.translate(N.offsetX,N.offsetY),P.scale(N.scaleX,N.scaleY),P.createPattern(N.canvas,"no-repeat")}}class d extends w{getPattern(){return"hotpink"}}function x(C){switch(C[0]){case"RadialAxial":return new k(C);case"Mesh":return new m(C);case"Dummy":return new d}throw new Error(`Unknown IR type: ${C[0]}`)}const v={COLORED:1,UNCOLORED:2},y=class{constructor(P,D,I,h,E){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=D,this.ctx=I,this.canvasGraphicsFactory=h,this.baseTransform=E}createPatternCanvas(P){const D=this.operatorList,I=this.bbox,h=this.xstep,E=this.ystep,N=this.paintType,M=this.tilingType,A=this.color,F=this.canvasGraphicsFactory;(0,e.info)("TilingType: "+M);const O=I[0],G=I[1],_=I[2],B=I[3],K=e.Util.singularValueDecompose2dScale(this.matrix),rt=e.Util.singularValueDecompose2dScale(this.baseTransform),st=[K[0]*rt[0],K[1]*rt[1]],Y=this.getSizeAndScale(h,this.ctx.canvas.width,st[0]),ct=this.getSizeAndScale(E,this.ctx.canvas.height,st[1]),nt=P.cachedCanvases.getCanvas("pattern",Y.size,ct.size,!0),it=nt.context,kt=F.createCanvasGraphics(it);kt.groupLevel=P.groupLevel,this.setFillAndStrokeStyleToContext(kt,N,A);let U=O,c=G,f=_,i=B;return O<0&&(U=0,f+=Math.abs(O)),G<0&&(c=0,i+=Math.abs(G)),it.translate(-(Y.scale*U),-(ct.scale*c)),kt.transform(Y.scale,0,0,ct.scale,0,0),it.save(),this.clipBbox(kt,U,c,f,i),kt.baseTransform=(0,n.getCurrentTransform)(kt.ctx),kt.executeOperatorList(D),kt.endDrawing(),{canvas:nt.canvas,scaleX:Y.scale,scaleY:ct.scale,offsetX:U,offsetY:c}}getSizeAndScale(P,D,I){P=Math.abs(P);const h=Math.max(y.MAX_PATTERN_SIZE,D);let E=Math.ceil(P*I);return E>=h?E=h:I=E/P,{scale:I,size:E}}clipBbox(P,D,I,h,E){const N=h-D,M=E-I;P.ctx.rect(D,I,N,M),P.current.updateRectMinMax((0,n.getCurrentTransform)(P.ctx),[D,I,h,E]),P.clip(),P.endPath()}setFillAndStrokeStyleToContext(P,D,I){const h=P.ctx,E=P.current;switch(D){case v.COLORED:const N=this.ctx;h.fillStyle=N.fillStyle,h.strokeStyle=N.strokeStyle,E.fillColor=N.fillStyle,E.strokeColor=N.strokeStyle;break;case v.UNCOLORED:const M=e.Util.makeHexColor(I[0],I[1],I[2]);h.fillStyle=M,h.strokeStyle=M,E.fillColor=M,E.strokeColor=M;break;default:throw new e.FormatError(`Unsupported paint type: ${D}`)}}getPattern(P,D,I,h){let E=I;h!==l.SHADING&&(E=e.Util.transform(E,D.baseTransform),this.matrix&&(E=e.Util.transform(E,this.matrix)));const N=this.createPatternCanvas(D);let M=new DOMMatrix(E);M=M.translate(N.offsetX,N.offsetY),M=M.scale(1/N.scaleX,1/N.scaleY);const A=P.createPattern(N.canvas,"repeat");return A.setTransform(M),A}};let b=y;ee(b,"MAX_PATTERN_SIZE",3e3),o.TilingPattern=b},(R,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.convertBlackAndWhiteToRGBA=l,o.convertToRGBA=n,o.grayToRGBA=w,t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123);var e=t(1);function n(k){switch(k.kind){case e.ImageKind.GRAYSCALE_1BPP:return l(k);case e.ImageKind.RGB_24BPP:return g(k)}return null}function l(k){let{src:S,srcPos:s=0,dest:m,width:d,height:x,nonBlackColor:v=4294967295,inverseDecode:b=!1}=k;const y=e.FeatureTest.isLittleEndian?4278190080:255,[C,P]=b?[v,y]:[y,v],D=d>>3,I=d&7,h=S.length;m=new Uint32Array(m.buffer);let E=0;for(let N=0;N<x;N++){for(const A=s+D;s<A;s++){const F=s<h?S[s]:255;m[E++]=F&128?P:C,m[E++]=F&64?P:C,m[E++]=F&32?P:C,m[E++]=F&16?P:C,m[E++]=F&8?P:C,m[E++]=F&4?P:C,m[E++]=F&2?P:C,m[E++]=F&1?P:C}if(I===0)continue;const M=s<h?S[s++]:255;for(let A=0;A<I;A++)m[E++]=M&1<<7-A?P:C}return{srcPos:s,destPos:E}}function g(k){let{src:S,srcPos:s=0,dest:m,destPos:d=0,width:x,height:v}=k,b=0;const y=S.length>>2,C=new Uint32Array(S.buffer,s,y);if(e.FeatureTest.isLittleEndian){for(;b<y-2;b+=3,d+=4){const P=C[b],D=C[b+1],I=C[b+2];m[d]=P|4278190080,m[d+1]=P>>>24|D<<8|4278190080,m[d+2]=D>>>16|I<<16|4278190080,m[d+3]=I>>>8|4278190080}for(let P=b*4,D=S.length;P<D;P+=3)m[d++]=S[P]|S[P+1]<<8|S[P+2]<<16|4278190080}else{for(;b<y-2;b+=3,d+=4){const P=C[b],D=C[b+1],I=C[b+2];m[d]=P|255,m[d+1]=P<<24|D>>>8|255,m[d+2]=D<<16|I>>>16|255,m[d+3]=I<<8|255}for(let P=b*4,D=S.length;P<D;P+=3)m[d++]=S[P]<<24|S[P+1]<<16|S[P+2]<<8|255}return{srcPos:s,destPos:d}}function w(k,S){if(e.FeatureTest.isLittleEndian)for(let s=0,m=k.length;s<m;s++)S[s]=k[s]*65793|4278190080;else for(let s=0,m=k.length;s<m;s++)S[s]=k[s]*16843008|255}},(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GlobalWorkerOptions=void 0;const t=Object.create(null);o.GlobalWorkerOptions=t,t.workerPort=null,t.workerSrc=""},(R,o,t)=>{var k,wn,s,Mn,d,Re;Object.defineProperty(o,"__esModule",{value:!0}),o.MessageHandler=void 0,t(2);var e=t(1);const n={UNKNOWN:0,DATA:1,ERROR:2},l={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function g(v){switch(v instanceof Error||typeof v=="object"&&v!==null||(0,e.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),v.name){case"AbortException":return new e.AbortException(v.message);case"MissingPDFException":return new e.MissingPDFException(v.message);case"PasswordException":return new e.PasswordException(v.message,v.code);case"UnexpectedResponseException":return new e.UnexpectedResponseException(v.message,v.status);case"UnknownErrorException":return new e.UnknownErrorException(v.message,v.details);default:return new e.UnknownErrorException(v.message,v.toString())}}class w{constructor(b,y,C){X(this,k);X(this,s);X(this,d);this.sourceName=b,this.targetName=y,this.comObj=C,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=P=>{const D=P.data;if(D.targetName!==this.sourceName)return;if(D.stream){j(this,s,Mn).call(this,D);return}if(D.callback){const h=D.callbackId,E=this.callbackCapabilities[h];if(!E)throw new Error(`Cannot resolve callback ${h}`);if(delete this.callbackCapabilities[h],D.callback===n.DATA)E.resolve(D.data);else if(D.callback===n.ERROR)E.reject(g(D.reason));else throw new Error("Unexpected callback case");return}const I=this.actionHandler[D.action];if(!I)throw new Error(`Unknown action from worker: ${D.action}`);if(D.callbackId){const h=this.sourceName,E=D.sourceName;new Promise(function(N){N(I(D.data))}).then(function(N){C.postMessage({sourceName:h,targetName:E,callback:n.DATA,callbackId:D.callbackId,data:N})},function(N){C.postMessage({sourceName:h,targetName:E,callback:n.ERROR,callbackId:D.callbackId,reason:g(N)})});return}if(D.streamId){j(this,k,wn).call(this,D);return}I(D.data)},C.addEventListener("message",this._onComObjOnMessage)}on(b,y){const C=this.actionHandler;if(C[b])throw new Error(`There is already an actionName called "${b}"`);C[b]=y}send(b,y,C){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:b,data:y},C)}sendWithPromise(b,y,C){const P=this.callbackId++,D=new e.PromiseCapability;this.callbackCapabilities[P]=D;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:b,callbackId:P,data:y},C)}catch(I){D.reject(I)}return D.promise}sendWithStream(b,y,C,P){const D=this.streamId++,I=this.sourceName,h=this.targetName,E=this.comObj;return new ReadableStream({start:N=>{const M=new e.PromiseCapability;return this.streamControllers[D]={controller:N,startCall:M,pullCall:null,cancelCall:null,isClosed:!1},E.postMessage({sourceName:I,targetName:h,action:b,streamId:D,data:y,desiredSize:N.desiredSize},P),M.promise},pull:N=>{const M=new e.PromiseCapability;return this.streamControllers[D].pullCall=M,E.postMessage({sourceName:I,targetName:h,stream:l.PULL,streamId:D,desiredSize:N.desiredSize}),M.promise},cancel:N=>{(0,e.assert)(N instanceof Error,"cancel must have a valid reason");const M=new e.PromiseCapability;return this.streamControllers[D].cancelCall=M,this.streamControllers[D].isClosed=!0,E.postMessage({sourceName:I,targetName:h,stream:l.CANCEL,streamId:D,reason:g(N)}),M.promise}},C)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}k=new WeakSet,wn=function(b){const y=b.streamId,C=this.sourceName,P=b.sourceName,D=this.comObj,I=this,h=this.actionHandler[b.action],E={enqueue(N){let M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,A=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const F=this.desiredSize;this.desiredSize-=M,F>0&&this.desiredSize<=0&&(this.sinkCapability=new e.PromiseCapability,this.ready=this.sinkCapability.promise),D.postMessage({sourceName:C,targetName:P,stream:l.ENQUEUE,streamId:y,chunk:N},A)},close(){this.isCancelled||(this.isCancelled=!0,D.postMessage({sourceName:C,targetName:P,stream:l.CLOSE,streamId:y}),delete I.streamSinks[y])},error(N){(0,e.assert)(N instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,D.postMessage({sourceName:C,targetName:P,stream:l.ERROR,streamId:y,reason:g(N)}))},sinkCapability:new e.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:b.desiredSize,ready:null};E.sinkCapability.resolve(),E.ready=E.sinkCapability.promise,this.streamSinks[y]=E,new Promise(function(N){N(h(b.data,E))}).then(function(){D.postMessage({sourceName:C,targetName:P,stream:l.START_COMPLETE,streamId:y,success:!0})},function(N){D.postMessage({sourceName:C,targetName:P,stream:l.START_COMPLETE,streamId:y,reason:g(N)})})},s=new WeakSet,Mn=function(b){const y=b.streamId,C=this.sourceName,P=b.sourceName,D=this.comObj,I=this.streamControllers[y],h=this.streamSinks[y];switch(b.stream){case l.START_COMPLETE:b.success?I.startCall.resolve():I.startCall.reject(g(b.reason));break;case l.PULL_COMPLETE:b.success?I.pullCall.resolve():I.pullCall.reject(g(b.reason));break;case l.PULL:if(!h){D.postMessage({sourceName:C,targetName:P,stream:l.PULL_COMPLETE,streamId:y,success:!0});break}h.desiredSize<=0&&b.desiredSize>0&&h.sinkCapability.resolve(),h.desiredSize=b.desiredSize,new Promise(function(E){var N;E((N=h.onPull)==null?void 0:N.call(h))}).then(function(){D.postMessage({sourceName:C,targetName:P,stream:l.PULL_COMPLETE,streamId:y,success:!0})},function(E){D.postMessage({sourceName:C,targetName:P,stream:l.PULL_COMPLETE,streamId:y,reason:g(E)})});break;case l.ENQUEUE:if((0,e.assert)(I,"enqueue should have stream controller"),I.isClosed)break;I.controller.enqueue(b.chunk);break;case l.CLOSE:if((0,e.assert)(I,"close should have stream controller"),I.isClosed)break;I.isClosed=!0,I.controller.close(),j(this,d,Re).call(this,I,y);break;case l.ERROR:(0,e.assert)(I,"error should have stream controller"),I.controller.error(g(b.reason)),j(this,d,Re).call(this,I,y);break;case l.CANCEL_COMPLETE:b.success?I.cancelCall.resolve():I.cancelCall.reject(g(b.reason)),j(this,d,Re).call(this,I,y);break;case l.CANCEL:if(!h)break;new Promise(function(E){var N;E((N=h.onCancel)==null?void 0:N.call(h,g(b.reason)))}).then(function(){D.postMessage({sourceName:C,targetName:P,stream:l.CANCEL_COMPLETE,streamId:y,success:!0})},function(E){D.postMessage({sourceName:C,targetName:P,stream:l.CANCEL_COMPLETE,streamId:y,reason:g(E)})}),h.sinkCapability.reject(g(b.reason)),h.isCancelled=!0,delete this.streamSinks[y];break;default:throw new Error("Unexpected stream case")}},d=new WeakSet,Re=async function(b,y){var C,P,D;await Promise.allSettled([(C=b.startCall)==null?void 0:C.promise,(P=b.pullCall)==null?void 0:P.promise,(D=b.cancelCall)==null?void 0:D.promise]),delete this.streamControllers[y]},o.MessageHandler=w},(R,o,t)=>{var l,g;Object.defineProperty(o,"__esModule",{value:!0}),o.Metadata=void 0;var e=t(1);class n{constructor(k){X(this,l,void 0);X(this,g,void 0);let{parsedData:S,rawData:s}=k;ot(this,l,S),ot(this,g,s)}getRaw(){return r(this,g)}get(k){var S;return(S=r(this,l).get(k))!=null?S:null}getAll(){return(0,e.objectFromMap)(r(this,l))}has(k){return r(this,l).has(k)}}l=new WeakMap,g=new WeakMap,o.Metadata=n},(R,o,t)=>{var k,S,s,m,d,x,tn;Object.defineProperty(o,"__esModule",{value:!0}),o.OptionalContentConfig=void 0;var e=t(1),n=t(170);const l=Symbol("INTERNAL");class g{constructor(y,C){X(this,k,!0);this.name=y,this.intent=C}get visible(){return r(this,k)}_setVisible(y,C){y!==l&&(0,e.unreachable)("Internal method `_setVisible` called."),ot(this,k,C)}}k=new WeakMap;class w{constructor(y){X(this,x);X(this,S,null);X(this,s,new Map);X(this,m,null);X(this,d,null);if(this.name=null,this.creator=null,y!==null){this.name=y.name,this.creator=y.creator,ot(this,d,y.order);for(const C of y.groups)r(this,s).set(C.id,new g(C.name,C.intent));if(y.baseState==="OFF")for(const C of r(this,s).values())C._setVisible(l,!1);for(const C of y.on)r(this,s).get(C)._setVisible(l,!0);for(const C of y.off)r(this,s).get(C)._setVisible(l,!1);ot(this,m,this.getHash())}}isVisible(y){if(r(this,s).size===0)return!0;if(!y)return(0,e.warn)("Optional content group not defined."),!0;if(y.type==="OCG")return r(this,s).has(y.id)?r(this,s).get(y.id).visible:((0,e.warn)(`Optional content group not found: ${y.id}`),!0);if(y.type==="OCMD"){if(y.expression)return j(this,x,tn).call(this,y.expression);if(!y.policy||y.policy==="AnyOn"){for(const C of y.ids){if(!r(this,s).has(C))return(0,e.warn)(`Optional content group not found: ${C}`),!0;if(r(this,s).get(C).visible)return!0}return!1}else if(y.policy==="AllOn"){for(const C of y.ids){if(!r(this,s).has(C))return(0,e.warn)(`Optional content group not found: ${C}`),!0;if(!r(this,s).get(C).visible)return!1}return!0}else if(y.policy==="AnyOff"){for(const C of y.ids){if(!r(this,s).has(C))return(0,e.warn)(`Optional content group not found: ${C}`),!0;if(!r(this,s).get(C).visible)return!0}return!1}else if(y.policy==="AllOff"){for(const C of y.ids){if(!r(this,s).has(C))return(0,e.warn)(`Optional content group not found: ${C}`),!0;if(r(this,s).get(C).visible)return!1}return!0}return(0,e.warn)(`Unknown optional content policy ${y.policy}.`),!0}return(0,e.warn)(`Unknown group type ${y.type}.`),!0}setVisibility(y){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!r(this,s).has(y)){(0,e.warn)(`Optional content group not found: ${y}`);return}r(this,s).get(y)._setVisible(l,!!C),ot(this,S,null)}get hasInitialVisibility(){return r(this,m)===null||this.getHash()===r(this,m)}getOrder(){return r(this,s).size?r(this,d)?r(this,d).slice():[...r(this,s).keys()]:null}getGroups(){return r(this,s).size>0?(0,e.objectFromMap)(r(this,s)):null}getGroup(y){return r(this,s).get(y)||null}getHash(){if(r(this,S)!==null)return r(this,S);const y=new n.MurmurHash3_64;for(const[C,P]of r(this,s))y.update(`${C}:${P.visible}`);return ot(this,S,y.hexdigest())}}S=new WeakMap,s=new WeakMap,m=new WeakMap,d=new WeakMap,x=new WeakSet,tn=function(y){const C=y.length;if(C<2)return!0;const P=y[0];for(let D=1;D<C;D++){const I=y[D];let h;if(Array.isArray(I))h=j(this,x,tn).call(this,I);else if(r(this,s).has(I))h=r(this,s).get(I).visible;else return(0,e.warn)(`Optional content group not found: ${I}`),!0;switch(P){case"And":if(!h)return!1;break;case"Or":if(h)return!0;break;case"Not":return!h;default:return!0}}return P==="And"},o.OptionalContentConfig=w},(R,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PDFDataTransportStream=void 0,t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123),t(89);var e=t(1),n=t(168);class l{constructor(S,s){let{length:m,initialData:d,progressiveDone:x=!1,contentDispositionFilename:v=null,disableRange:b=!1,disableStream:y=!1}=S;if((0,e.assert)(s,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=x,this._contentDispositionFilename=v,(d==null?void 0:d.length)>0){const C=d instanceof Uint8Array&&d.byteLength===d.buffer.byteLength?d.buffer:new Uint8Array(d).buffer;this._queuedChunks.push(C)}this._pdfDataRangeTransport=s,this._isStreamingSupported=!y,this._isRangeSupported=!b,this._contentLength=m,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((C,P)=>{this._onReceiveData({begin:C,chunk:P})}),this._pdfDataRangeTransport.addProgressListener((C,P)=>{this._onProgress({loaded:C,total:P})}),this._pdfDataRangeTransport.addProgressiveReadListener(C=>{this._onReceiveData({chunk:C})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData(S){let{begin:s,chunk:m}=S;const d=m instanceof Uint8Array&&m.byteLength===m.buffer.byteLength?m.buffer:new Uint8Array(m).buffer;if(s===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(d):this._queuedChunks.push(d);else{const x=this._rangeReaders.some(function(v){return v._begin!==s?!1:(v._enqueue(d),!0)});(0,e.assert)(x,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var S,s;return(s=(S=this._fullRequestReader)==null?void 0:S._loaded)!=null?s:0}_onProgress(S){var s,m,d,x;S.total===void 0?(m=(s=this._rangeReaders[0])==null?void 0:s.onProgress)==null||m.call(s,{loaded:S.loaded}):(x=(d=this._fullRequestReader)==null?void 0:d.onProgress)==null||x.call(d,{loaded:S.loaded,total:S.total})}_onProgressiveDone(){var S;(S=this._fullRequestReader)==null||S.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(S){const s=this._rangeReaders.indexOf(S);s>=0&&this._rangeReaders.splice(s,1)}getFullReader(){(0,e.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const S=this._queuedChunks;return this._queuedChunks=null,new g(this,S,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(S,s){if(s<=this._progressiveDataLength)return null;const m=new w(this,S,s);return this._pdfDataRangeTransport.requestDataRange(S,s),this._rangeReaders.push(m),m}cancelAllRequests(S){var s;(s=this._fullRequestReader)==null||s.cancel(S);for(const m of this._rangeReaders.slice(0))m.cancel(S);this._pdfDataRangeTransport.abort()}}o.PDFDataTransportStream=l;class g{constructor(S,s){let m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;this._stream=S,this._done=m||!1,this._filename=(0,n.isPdfFile)(d)?d:null,this._queuedChunks=s||[],this._loaded=0;for(const x of this._queuedChunks)this._loaded+=x.byteLength;this._requests=[],this._headersReady=Promise.resolve(),S._fullRequestReader=this,this.onProgress=null}_enqueue(S){this._done||(this._requests.length>0?this._requests.shift().resolve({value:S,done:!1}):this._queuedChunks.push(S),this._loaded+=S.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 S=new e.PromiseCapability;return this._requests.push(S),S.promise}cancel(S){this._done=!0;for(const s of this._requests)s.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class w{constructor(S,s,m){this._stream=S,this._begin=s,this._end=m,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(S){if(!this._done){if(this._requests.length===0)this._queuedChunk=S;else{this._requests.shift().resolve({value:S,done:!1});for(const m of this._requests)m.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 s=this._queuedChunk;return this._queuedChunk=null,{value:s,done:!1}}if(this._done)return{value:void 0,done:!0};const S=new e.PromiseCapability;return this._requests.push(S),S.promise}cancel(S){this._done=!0;for(const s of this._requests)s.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(R,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PDFFetchStream=void 0,t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123),t(89);var e=t(1),n=t(182);function l(m,d,x){return{method:"GET",headers:m,signal:x.signal,mode:"cors",credentials:d?"include":"same-origin",redirect:"follow"}}function g(m){const d=new Headers;for(const x in m){const v=m[x];v!==void 0&&d.append(x,v)}return d}function w(m){return m instanceof Uint8Array?m.buffer:m instanceof ArrayBuffer?m:((0,e.warn)(`getArrayBuffer - unexpected data format: ${m}`),new Uint8Array(m).buffer)}class k{constructor(d){this.source=d,this.isHttp=/^https?:/i.test(d.url),this.httpHeaders=this.isHttp&&d.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var d,x;return(x=(d=this._fullRequestReader)==null?void 0:d._loaded)!=null?x:0}getFullReader(){return(0,e.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new S(this),this._fullRequestReader}getRangeReader(d,x){if(x<=this._progressiveDataLength)return null;const v=new s(this,d,x);return this._rangeRequestReaders.push(v),v}cancelAllRequests(d){var x;(x=this._fullRequestReader)==null||x.cancel(d);for(const v of this._rangeRequestReaders.slice(0))v.cancel(d)}}o.PDFFetchStream=k;class S{constructor(d){this._stream=d,this._reader=null,this._loaded=0,this._filename=null;const x=d.source;this._withCredentials=x.withCredentials||!1,this._contentLength=x.length,this._headersCapability=new e.PromiseCapability,this._disableRange=x.disableRange||!1,this._rangeChunkSize=x.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!x.disableStream,this._isRangeSupported=!x.disableRange,this._headers=g(this._stream.httpHeaders);const v=x.url;fetch(v,l(this._headers,this._withCredentials,this._abortController)).then(b=>{if(!(0,n.validateResponseStatus)(b.status))throw(0,n.createResponseStatusError)(b.status,v);this._reader=b.body.getReader(),this._headersCapability.resolve();const y=D=>b.headers.get(D),{allowRangeRequests:C,suggestedLength:P}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:y,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=C,this._contentLength=P||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(y),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new e.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var v;await this._headersCapability.promise;const{value:d,done:x}=await this._reader.read();return x?{value:d,done:x}:(this._loaded+=d.byteLength,(v=this.onProgress)==null||v.call(this,{loaded:this._loaded,total:this._contentLength}),{value:w(d),done:!1})}cancel(d){var x;(x=this._reader)==null||x.cancel(d),this._abortController.abort()}}class s{constructor(d,x,v){this._stream=d,this._reader=null,this._loaded=0;const b=d.source;this._withCredentials=b.withCredentials||!1,this._readCapability=new e.PromiseCapability,this._isStreamingSupported=!b.disableStream,this._abortController=new AbortController,this._headers=g(this._stream.httpHeaders),this._headers.append("Range",`bytes=${x}-${v-1}`);const y=b.url;fetch(y,l(this._headers,this._withCredentials,this._abortController)).then(C=>{if(!(0,n.validateResponseStatus)(C.status))throw(0,n.createResponseStatusError)(C.status,y);this._readCapability.resolve(),this._reader=C.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var v;await this._readCapability.promise;const{value:d,done:x}=await this._reader.read();return x?{value:d,done:x}:(this._loaded+=d.byteLength,(v=this.onProgress)==null||v.call(this,{loaded:this._loaded}),{value:w(d),done:!1})}cancel(d){var x;(x=this._reader)==null||x.cancel(d),this._abortController.abort()}}},(R,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createResponseStatusError=k,o.extractFilenameFromHeader=w,o.validateRangeRequestCapabilities=g,o.validateResponseStatus=S;var e=t(1),n=t(183),l=t(168);function g(s){let{getResponseHeader:m,isHttp:d,rangeChunkSize:x,disableRange:v}=s;const b={allowRangeRequests:!1,suggestedLength:void 0},y=parseInt(m("Content-Length"),10);return!Number.isInteger(y)||(b.suggestedLength=y,y<=2*x)||v||!d||m("Accept-Ranges")!=="bytes"||(m("Content-Encoding")||"identity")!=="identity"||(b.allowRangeRequests=!0),b}function w(s){const m=s("Content-Disposition");if(m){let d=(0,n.getFilenameFromContentDispositionHeader)(m);if(d.includes("%"))try{d=decodeURIComponent(d)}catch{}if((0,l.isPdfFile)(d))return d}return null}function k(s,m){return s===404||s===0&&m.startsWith("file:")?new e.MissingPDFException('Missing PDF "'+m+'".'):new e.UnexpectedResponseException(`Unexpected server response (${s}) while retrieving PDF "${m}".`,s)}function S(s){return s===200||s===206}},(R,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getFilenameFromContentDispositionHeader=n,t(89),t(149);var e=t(1);function n(l){let g=!0,w=k("filename\\*","i").exec(l);if(w){w=w[1];let b=d(w);return b=unescape(b),b=x(b),b=v(b),s(b)}if(w=m(l),w){const b=v(w);return s(b)}if(w=k("filename","i").exec(l),w){w=w[1];let b=d(w);return b=v(b),s(b)}function k(b,y){return new RegExp("(?:^|;)\\s*"+b+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',y)}function S(b,y){if(b){if(!/^[\x00-\xFF]+$/.test(y))return y;try{const C=new TextDecoder(b,{fatal:!0}),P=(0,e.stringToBytes)(y);y=C.decode(P),g=!1}catch{}}return y}function s(b){return g&&/[\x80-\xff]/.test(b)&&(b=S("utf-8",b),g&&(b=S("iso-8859-1",b))),b}function m(b){const y=[];let C;const P=k("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(C=P.exec(b))!==null;){let[,I,h,E]=C;if(I=parseInt(I,10),I in y){if(I===0)break;continue}y[I]=[h,E]}const D=[];for(let I=0;I<y.length&&I in y;++I){let[h,E]=y[I];E=d(E),h&&(E=unescape(E),I===0&&(E=x(E))),D.push(E)}return D.join("")}function d(b){if(b.startsWith('"')){const y=b.slice(1).split('\\"');for(let C=0;C<y.length;++C){const P=y[C].indexOf('"');P!==-1&&(y[C]=y[C].slice(0,P),y.length=C+1),y[C]=y[C].replaceAll(/\\(.)/g,"$1")}b=y.join('"')}return b}function x(b){const y=b.indexOf("'");if(y===-1)return b;const C=b.slice(0,y),D=b.slice(y+1).replace(/^[^']*'/,"");return S(C,D)}function v(b){return!b.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(b)?b:b.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(y,C,P,D){if(P==="q"||P==="Q")return D=D.replaceAll("_"," "),D=D.replaceAll(/=([0-9a-fA-F]{2})/g,function(I,h){return String.fromCharCode(parseInt(h,16))}),S(C,D);try{D=atob(D)}catch{}return S(C,D)})}return""}},(R,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PDFNetworkStream=void 0,t(89);var e=t(1),n=t(182);const l=200,g=206;function w(d){const x=d.response;return typeof x!="string"?x:(0,e.stringToBytes)(x).buffer}class k{constructor(x){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.url=x,this.isHttp=/^https?:/i.test(x),this.httpHeaders=this.isHttp&&v.httpHeaders||Object.create(null),this.withCredentials=v.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(x,v,b){const y={begin:x,end:v};for(const C in b)y[C]=b[C];return this.request(y)}requestFull(x){return this.request(x)}request(x){const v=new XMLHttpRequest,b=this.currXhrId++,y=this.pendingRequests[b]={xhr:v};v.open("GET",this.url),v.withCredentials=this.withCredentials;for(const C in this.httpHeaders){const P=this.httpHeaders[C];P!==void 0&&v.setRequestHeader(C,P)}return this.isHttp&&"begin"in x&&"end"in x?(v.setRequestHeader("Range",`bytes=${x.begin}-${x.end-1}`),y.expectedStatus=g):y.expectedStatus=l,v.responseType="arraybuffer",x.onError&&(v.onerror=function(C){x.onError(v.status)}),v.onreadystatechange=this.onStateChange.bind(this,b),v.onprogress=this.onProgress.bind(this,b),y.onHeadersReceived=x.onHeadersReceived,y.onDone=x.onDone,y.onError=x.onError,y.onProgress=x.onProgress,v.send(null),b}onProgress(x,v){var y;const b=this.pendingRequests[x];!b||(y=b.onProgress)==null||y.call(b,v)}onStateChange(x,v){var I,h,E;const b=this.pendingRequests[x];if(!b)return;const y=b.xhr;if(y.readyState>=2&&b.onHeadersReceived&&(b.onHeadersReceived(),delete b.onHeadersReceived),y.readyState!==4||!(x in this.pendingRequests))return;if(delete this.pendingRequests[x],y.status===0&&this.isHttp){(I=b.onError)==null||I.call(b,y.status);return}const C=y.status||l;if(!(C===l&&b.expectedStatus===g)&&C!==b.expectedStatus){(h=b.onError)==null||h.call(b,y.status);return}const D=w(y);if(C===g){const N=y.getResponseHeader("Content-Range"),M=/bytes (\d+)-(\d+)\/(\d+)/.exec(N);b.onDone({begin:parseInt(M[1],10),chunk:D})}else D?b.onDone({begin:0,chunk:D}):(E=b.onError)==null||E.call(b,y.status)}getRequestXhr(x){return this.pendingRequests[x].xhr}isPendingRequest(x){return x in this.pendingRequests}abortRequest(x){const v=this.pendingRequests[x].xhr;delete this.pendingRequests[x],v.abort()}}class S{constructor(x){this._source=x,this._manager=new k(x.url,{httpHeaders:x.httpHeaders,withCredentials:x.withCredentials}),this._rangeChunkSize=x.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(x){const v=this._rangeRequestReaders.indexOf(x);v>=0&&this._rangeRequestReaders.splice(v,1)}getFullReader(){return(0,e.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new s(this._manager,this._source),this._fullRequestReader}getRangeReader(x,v){const b=new m(this._manager,x,v);return b.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(b),b}cancelAllRequests(x){var v;(v=this._fullRequestReader)==null||v.cancel(x);for(const b of this._rangeRequestReaders.slice(0))b.cancel(x)}}o.PDFNetworkStream=S;class s{constructor(x,v){this._manager=x;const b={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=v.url,this._fullRequestId=x.requestFull(b),this._headersReceivedCapability=new e.PromiseCapability,this._disableRange=v.disableRange||!1,this._contentLength=v.length,this._rangeChunkSize=v.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 x=this._fullRequestId,v=this._manager.getRequestXhr(x),b=P=>v.getResponseHeader(P),{allowRangeRequests:y,suggestedLength:C}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:b,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});y&&(this._isRangeSupported=!0),this._contentLength=C||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(b),this._isRangeSupported&&this._manager.abortRequest(x),this._headersReceivedCapability.resolve()}_onDone(x){if(x&&(this._requests.length>0?this._requests.shift().resolve({value:x.chunk,done:!1}):this._cachedChunks.push(x.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const v of this._requests)v.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(x){this._storedError=(0,n.createResponseStatusError)(x,this._url),this._headersReceivedCapability.reject(this._storedError);for(const v of this._requests)v.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(x){var v;(v=this.onProgress)==null||v.call(this,{loaded:x.loaded,total:x.lengthComputable?x.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 x=new e.PromiseCapability;return this._requests.push(x),x.promise}cancel(x){this._done=!0,this._headersReceivedCapability.reject(x);for(const v of this._requests)v.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class m{constructor(x,v,b){this._manager=x;const y={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=x.url,this._requestId=x.requestRange(v,b,y),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var x;(x=this.onClosed)==null||x.call(this,this)}_onDone(x){const v=x.chunk;this._requests.length>0?this._requests.shift().resolve({value:v,done:!1}):this._queuedChunk=v,this._done=!0;for(const b of this._requests)b.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(x){this._storedError=(0,n.createResponseStatusError)(x,this._url);for(const v of this._requests)v.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(x){var v;this.isStreamingSupported||(v=this.onProgress)==null||v.call(this,{loaded:x.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const v=this._queuedChunk;return this._queuedChunk=null,{value:v,done:!1}}if(this._done)return{value:void 0,done:!0};const x=new e.PromiseCapability;return this._requests.push(x),x.promise}cancel(x){this._done=!0;for(const v of this._requests)v.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(R,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PDFNodeStream=void 0,t(89),t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123);var e=t(1),n=t(182);const l=/^file:\/\/\/[a-zA-Z]:\//;function g(b){const y=require$$6,C=y.parse(b);return C.protocol==="file:"||C.host?C:/^[a-z]:[/\\]/i.test(b)?y.parse(`file:///${b}`):(C.host||(C.protocol="file:"),C)}class w{constructor(y){this.source=y,this.url=g(y.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&y.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var y,C;return(C=(y=this._fullRequestReader)==null?void 0:y._loaded)!=null?C:0}getFullReader(){return(0,e.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new x(this):new m(this),this._fullRequestReader}getRangeReader(y,C){if(C<=this._progressiveDataLength)return null;const P=this.isFsUrl?new v(this,y,C):new d(this,y,C);return this._rangeRequestReaders.push(P),P}cancelAllRequests(y){var C;(C=this._fullRequestReader)==null||C.cancel(y);for(const P of this._rangeRequestReaders.slice(0))P.cancel(y)}}o.PDFNodeStream=w;class k{constructor(y){this._url=y.url,this._done=!1,this._storedError=null,this.onProgress=null;const C=y.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 e.PromiseCapability,this._headersCapability=new e.PromiseCapability}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var P;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const y=this._readableStream.read();return y===null?(this._readCapability=new e.PromiseCapability,this.read()):(this._loaded+=y.length,(P=this.onProgress)==null||P.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(y).buffer,done:!1})}cancel(y){if(!this._readableStream){this._error(y);return}this._readableStream.destroy(y)}_error(y){this._storedError=y,this._readCapability.resolve()}_setReadableStream(y){this._readableStream=y,y.on("readable",()=>{this._readCapability.resolve()}),y.on("end",()=>{y.destroy(),this._done=!0,this._readCapability.resolve()}),y.on("error",C=>{this._error(C)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new e.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class S{constructor(y){this._url=y.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new e.PromiseCapability;const C=y.source;this._isStreamingSupported=!C.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var P;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const y=this._readableStream.read();return y===null?(this._readCapability=new e.PromiseCapability,this.read()):(this._loaded+=y.length,(P=this.onProgress)==null||P.call(this,{loaded:this._loaded}),{value:new Uint8Array(y).buffer,done:!1})}cancel(y){if(!this._readableStream){this._error(y);return}this._readableStream.destroy(y)}_error(y){this._storedError=y,this._readCapability.resolve()}_setReadableStream(y){this._readableStream=y,y.on("readable",()=>{this._readCapability.resolve()}),y.on("end",()=>{y.destroy(),this._done=!0,this._readCapability.resolve()}),y.on("error",C=>{this._error(C)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function s(b,y){return{protocol:b.protocol,auth:b.auth,host:b.hostname,port:b.port,path:b.path,method:"GET",headers:y}}class m extends k{constructor(y){super(y);const C=P=>{if(P.statusCode===404){const E=new e.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=E,this._headersCapability.reject(E);return}this._headersCapability.resolve(),this._setReadableStream(P);const D=E=>this._readableStream.headers[E.toLowerCase()],{allowRangeRequests:I,suggestedLength:h}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:D,isHttp:y.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=I,this._contentLength=h||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(D)};if(this._request=null,this._url.protocol==="http:"){const P=require$$6;this._request=P.request(s(this._url,y.httpHeaders),C)}else{const P=require$$6;this._request=P.request(s(this._url,y.httpHeaders),C)}this._request.on("error",P=>{this._storedError=P,this._headersCapability.reject(P)}),this._request.end()}}class d extends S{constructor(y,C,P){super(y),this._httpHeaders={};for(const I in y.httpHeaders){const h=y.httpHeaders[I];h!==void 0&&(this._httpHeaders[I]=h)}this._httpHeaders.Range=`bytes=${C}-${P-1}`;const D=I=>{if(I.statusCode===404){const h=new e.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=h;return}this._setReadableStream(I)};if(this._request=null,this._url.protocol==="http:"){const I=require$$6;this._request=I.request(s(this._url,this._httpHeaders),D)}else{const I=require$$6;this._request=I.request(s(this._url,this._httpHeaders),D)}this._request.on("error",I=>{this._storedError=I}),this._request.end()}}class x extends k{constructor(y){super(y);let C=decodeURIComponent(this._url.path);l.test(this._url.href)&&(C=C.replace(/^\//,""));const P=require$$6;P.lstat(C,(D,I)=>{if(D){D.code==="ENOENT"&&(D=new e.MissingPDFException(`Missing PDF "${C}".`)),this._storedError=D,this._headersCapability.reject(D);return}this._contentLength=I.size,this._setReadableStream(P.createReadStream(C)),this._headersCapability.resolve()})}}class v extends S{constructor(y,C,P){super(y);let D=decodeURIComponent(this._url.path);l.test(this._url.href)&&(D=D.replace(/^\//,""));const I=require$$6;this._setReadableStream(I.createReadStream(D,{start:C,end:P-1}))}}},(R,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SVGGraphics=void 0,t(84),t(86),t(87),t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123),t(2),t(89),t(187);var e=t(168),n=t(1);const l={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},g="http://www.w3.org/XML/1998/namespace",w="http://www.w3.org/1999/xlink",k=["butt","round","square"],S=["miter","round","bevel"],s=function(I){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(URL.createObjectURL&&typeof Blob<"u"&&!E)return URL.createObjectURL(new Blob([I],{type:h}));const N="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let M=`data:${h};base64,`;for(let A=0,F=I.length;A<F;A+=3){const O=I[A]&255,G=I[A+1]&255,_=I[A+2]&255,B=O>>2,K=(O&3)<<4|G>>4,rt=A+1<F?(G&15)<<2|_>>6:64,st=A+2<F?_&63:64;M+=N[B]+N[K]+N[rt]+N[st]}return M},m=function(){const I=new Uint8Array([137,80,78,71,13,10,26,10]),h=12,E=new Int32Array(256);for(let _=0;_<256;_++){let B=_;for(let K=0;K<8;K++)B=B&1?3988292384^B>>1&2147483647:B>>1&2147483647;E[_]=B}function N(_,B,K){let rt=-1;for(let st=B;st<K;st++){const Y=(rt^_[st])&255,ct=E[Y];rt=rt>>>8^ct}return rt^-1}function M(_,B,K,rt){let st=rt;const Y=B.length;K[st]=Y>>24&255,K[st+1]=Y>>16&255,K[st+2]=Y>>8&255,K[st+3]=Y&255,st+=4,K[st]=_.charCodeAt(0)&255,K[st+1]=_.charCodeAt(1)&255,K[st+2]=_.charCodeAt(2)&255,K[st+3]=_.charCodeAt(3)&255,st+=4,K.set(B,st),st+=B.length;const ct=N(K,rt+4,st);K[st]=ct>>24&255,K[st+1]=ct>>16&255,K[st+2]=ct>>8&255,K[st+3]=ct&255}function A(_,B,K){let rt=1,st=0;for(let Y=B;Y<K;++Y)rt=(rt+(_[Y]&255))%65521,st=(st+rt)%65521;return st<<16|rt}function F(_){if(!n.isNodeJS)return O(_);try{const B=parseInt(process.versions.node)>=8?_:Buffer.from(_),K=require$$6.deflateSync(B,{level:9});return K instanceof Uint8Array?K:new Uint8Array(K)}catch(B){(0,n.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+B)}return O(_)}function O(_){let B=_.length;const K=65535,rt=Math.ceil(B/K),st=new Uint8Array(2+B+rt*5+4);let Y=0;st[Y++]=120,st[Y++]=156;let ct=0;for(;B>K;)st[Y++]=0,st[Y++]=255,st[Y++]=255,st[Y++]=0,st[Y++]=0,st.set(_.subarray(ct,ct+K),Y),Y+=K,ct+=K,B-=K;st[Y++]=1,st[Y++]=B&255,st[Y++]=B>>8&255,st[Y++]=~B&65535&255,st[Y++]=(~B&65535)>>8&255,st.set(_.subarray(ct),Y),Y+=_.length-ct;const nt=A(_,0,_.length);return st[Y++]=nt>>24&255,st[Y++]=nt>>16&255,st[Y++]=nt>>8&255,st[Y++]=nt&255,st}function G(_,B,K,rt){const st=_.width,Y=_.height;let ct,nt,it;const kt=_.data;switch(B){case n.ImageKind.GRAYSCALE_1BPP:nt=0,ct=1,it=st+7>>3;break;case n.ImageKind.RGB_24BPP:nt=2,ct=8,it=st*3;break;case n.ImageKind.RGBA_32BPP:nt=6,ct=8,it=st*4;break;default:throw new Error("invalid format")}const U=new Uint8Array((1+it)*Y);let c=0,f=0;for(let H=0;H<Y;++H)U[c++]=0,U.set(kt.subarray(f,f+it),c),f+=it,c+=it;if(B===n.ImageKind.GRAYSCALE_1BPP&&rt){c=0;for(let H=0;H<Y;H++){c++;for(let tt=0;tt<it;tt++)U[c++]^=255}}const i=new Uint8Array([st>>24&255,st>>16&255,st>>8&255,st&255,Y>>24&255,Y>>16&255,Y>>8&255,Y&255,ct,nt,0,0,0]),u=F(U),p=I.length+h*3+i.length+u.length,T=new Uint8Array(p);let W=0;return T.set(I,W),W+=I.length,M("IHDR",i,T,W),W+=h+i.length,M("IDATA",u,T,W),W+=h+u.length,M("IEND",new Uint8Array(0),T,W),s(T,"image/png",K)}return function(B,K,rt){const st=B.kind===void 0?n.ImageKind.GRAYSCALE_1BPP:B.kind;return G(B,st,K,rt)}}();class d{constructor(){this.fontSizeScale=1,this.fontWeight=l.fontWeight,this.fontSize=0,this.textMatrix=n.IDENTITY_MATRIX,this.fontMatrix=n.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=n.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=l.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(h,E){this.x=h,this.y=E}}function x(I){let h=[];const E=[];for(const N of I){if(N.fn==="save"){h.push({fnId:92,fn:"group",items:[]}),E.push(h),h=h.at(-1).items;continue}N.fn==="restore"?h=E.pop():h.push(N)}return h}function v(I){if(Number.isInteger(I))return I.toString();const h=I.toFixed(10);let E=h.length-1;if(h[E]!=="0")return h;do E--;while(h[E]==="0");return h.substring(0,h[E]==="."?E:E+1)}function b(I){if(I[4]===0&&I[5]===0){if(I[1]===0&&I[2]===0)return I[0]===1&&I[3]===1?"":`scale(${v(I[0])} ${v(I[3])})`;if(I[0]===I[3]&&I[1]===-I[2]){const h=Math.acos(I[0])*180/Math.PI;return`rotate(${v(h)})`}}else if(I[0]===1&&I[1]===0&&I[2]===0&&I[3]===1)return`translate(${v(I[4])} ${v(I[5])})`;return`matrix(${v(I[0])} ${v(I[1])} ${v(I[2])} ${v(I[3])} ${v(I[4])} ${v(I[5])})`}let y=0,C=0,P=0;class D{constructor(h,E){let N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(0,e.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new e.DOMSVGFactory,this.current=new d,this.transformMatrix=n.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=h,this.objs=E,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!N,this._operatorIdMapping=[];for(const M in n.OPS)this._operatorIdMapping[n.OPS[M]]=M}getObject(h){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return typeof h=="string"?h.startsWith("g_")?this.commonObjs.get(h):this.objs.get(h):E}save(){this.transformStack.push(this.transformMatrix);const h=this.current;this.extraStack.push(h),this.current=h.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(h){this.save(),this.executeOpTree(h),this.restore()}loadDependencies(h){const E=h.fnArray,N=h.argsArray;for(let M=0,A=E.length;M<A;M++)if(E[M]===n.OPS.dependency)for(const F of N[M]){const O=F.startsWith("g_")?this.commonObjs:this.objs,G=new Promise(_=>{O.get(F,_)});this.current.dependencies.push(G)}return Promise.all(this.current.dependencies)}transform(h,E,N,M,A,F){const O=[h,E,N,M,A,F];this.transformMatrix=n.Util.transform(this.transformMatrix,O),this.tgrp=null}getSVG(h,E){this.viewport=E;const N=this._initialize(E);return this.loadDependencies(h).then(()=>(this.transformMatrix=n.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(h)),N))}convertOpList(h){const E=this._operatorIdMapping,N=h.argsArray,M=h.fnArray,A=[];for(let F=0,O=M.length;F<O;F++){const G=M[F];A.push({fnId:G,fn:E[G],args:N[F]})}return x(A)}executeOpTree(h){for(const E of h){const N=E.fn,M=E.fnId,A=E.args;switch(M|0){case n.OPS.beginText:this.beginText();break;case n.OPS.dependency:break;case n.OPS.setLeading:this.setLeading(A);break;case n.OPS.setLeadingMoveText:this.setLeadingMoveText(A[0],A[1]);break;case n.OPS.setFont:this.setFont(A);break;case n.OPS.showText:this.showText(A[0]);break;case n.OPS.showSpacedText:this.showText(A[0]);break;case n.OPS.endText:this.endText();break;case n.OPS.moveText:this.moveText(A[0],A[1]);break;case n.OPS.setCharSpacing:this.setCharSpacing(A[0]);break;case n.OPS.setWordSpacing:this.setWordSpacing(A[0]);break;case n.OPS.setHScale:this.setHScale(A[0]);break;case n.OPS.setTextMatrix:this.setTextMatrix(A[0],A[1],A[2],A[3],A[4],A[5]);break;case n.OPS.setTextRise:this.setTextRise(A[0]);break;case n.OPS.setTextRenderingMode:this.setTextRenderingMode(A[0]);break;case n.OPS.setLineWidth:this.setLineWidth(A[0]);break;case n.OPS.setLineJoin:this.setLineJoin(A[0]);break;case n.OPS.setLineCap:this.setLineCap(A[0]);break;case n.OPS.setMiterLimit:this.setMiterLimit(A[0]);break;case n.OPS.setFillRGBColor:this.setFillRGBColor(A[0],A[1],A[2]);break;case n.OPS.setStrokeRGBColor:this.setStrokeRGBColor(A[0],A[1],A[2]);break;case n.OPS.setStrokeColorN:this.setStrokeColorN(A);break;case n.OPS.setFillColorN:this.setFillColorN(A);break;case n.OPS.shadingFill:this.shadingFill(A[0]);break;case n.OPS.setDash:this.setDash(A[0],A[1]);break;case n.OPS.setRenderingIntent:this.setRenderingIntent(A[0]);break;case n.OPS.setFlatness:this.setFlatness(A[0]);break;case n.OPS.setGState:this.setGState(A[0]);break;case n.OPS.fill:this.fill();break;case n.OPS.eoFill:this.eoFill();break;case n.OPS.stroke:this.stroke();break;case n.OPS.fillStroke:this.fillStroke();break;case n.OPS.eoFillStroke:this.eoFillStroke();break;case n.OPS.clip:this.clip("nonzero");break;case n.OPS.eoClip:this.clip("evenodd");break;case n.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case n.OPS.paintImageXObject:this.paintImageXObject(A[0]);break;case n.OPS.paintInlineImageXObject:this.paintInlineImageXObject(A[0]);break;case n.OPS.paintImageMaskXObject:this.paintImageMaskXObject(A[0]);break;case n.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(A[0],A[1]);break;case n.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case n.OPS.closePath:this.closePath();break;case n.OPS.closeStroke:this.closeStroke();break;case n.OPS.closeFillStroke:this.closeFillStroke();break;case n.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case n.OPS.nextLine:this.nextLine();break;case n.OPS.transform:this.transform(A[0],A[1],A[2],A[3],A[4],A[5]);break;case n.OPS.constructPath:this.constructPath(A[0],A[1]);break;case n.OPS.endPath:this.endPath();break;case 92:this.group(E.items);break;default:(0,n.warn)(`Unimplemented operator ${N}`);break}}}setWordSpacing(h){this.current.wordSpacing=h}setCharSpacing(h){this.current.charSpacing=h}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(h,E,N,M,A,F){const O=this.current;O.textMatrix=O.lineMatrix=[h,E,N,M,A,F],O.textMatrixScale=Math.hypot(h,E),O.x=O.lineX=0,O.y=O.lineY=0,O.xcoords=[],O.ycoords=[],O.tspan=this.svgFactory.createElement("svg:tspan"),O.tspan.setAttributeNS(null,"font-family",O.fontFamily),O.tspan.setAttributeNS(null,"font-size",`${v(O.fontSize)}px`),O.tspan.setAttributeNS(null,"y",v(-O.y)),O.txtElement=this.svgFactory.createElement("svg:text"),O.txtElement.append(O.tspan)}beginText(){const h=this.current;h.x=h.lineX=0,h.y=h.lineY=0,h.textMatrix=n.IDENTITY_MATRIX,h.lineMatrix=n.IDENTITY_MATRIX,h.textMatrixScale=1,h.tspan=this.svgFactory.createElement("svg:tspan"),h.txtElement=this.svgFactory.createElement("svg:text"),h.txtgrp=this.svgFactory.createElement("svg:g"),h.xcoords=[],h.ycoords=[]}moveText(h,E){const N=this.current;N.x=N.lineX+=h,N.y=N.lineY+=E,N.xcoords=[],N.ycoords=[],N.tspan=this.svgFactory.createElement("svg:tspan"),N.tspan.setAttributeNS(null,"font-family",N.fontFamily),N.tspan.setAttributeNS(null,"font-size",`${v(N.fontSize)}px`),N.tspan.setAttributeNS(null,"y",v(-N.y))}showText(h){const E=this.current,N=E.font,M=E.fontSize;if(M===0)return;const A=E.fontSizeScale,F=E.charSpacing,O=E.wordSpacing,G=E.fontDirection,_=E.textHScale*G,B=N.vertical,K=B?1:-1,rt=N.defaultVMetrics,st=M*E.fontMatrix[0];let Y=0;for(const it of h){if(it===null){Y+=G*O;continue}else if(typeof it=="number"){Y+=K*it*M/1e3;continue}const kt=(it.isSpace?O:0)+F,U=it.fontChar;let c,f,i=it.width;if(B){let p;const T=it.vmetric||rt;p=it.vmetric?T[1]:i*.5,p=-p*st;const W=T[2]*st;i=T?-T[0]:i,c=p/A,f=(Y+W)/A}else c=Y/A,f=0;(it.isInFont||N.missingFile)&&(E.xcoords.push(E.x+c),B&&E.ycoords.push(-E.y+f),E.tspan.textContent+=U);const u=B?i*st-kt*G:i*st+kt*G;Y+=u}E.tspan.setAttributeNS(null,"x",E.xcoords.map(v).join(" ")),B?E.tspan.setAttributeNS(null,"y",E.ycoords.map(v).join(" ")):E.tspan.setAttributeNS(null,"y",v(-E.y)),B?E.y-=Y:E.x+=Y*_,E.tspan.setAttributeNS(null,"font-family",E.fontFamily),E.tspan.setAttributeNS(null,"font-size",`${v(E.fontSize)}px`),E.fontStyle!==l.fontStyle&&E.tspan.setAttributeNS(null,"font-style",E.fontStyle),E.fontWeight!==l.fontWeight&&E.tspan.setAttributeNS(null,"font-weight",E.fontWeight);const ct=E.textRenderingMode&n.TextRenderingMode.FILL_STROKE_MASK;if(ct===n.TextRenderingMode.FILL||ct===n.TextRenderingMode.FILL_STROKE?(E.fillColor!==l.fillColor&&E.tspan.setAttributeNS(null,"fill",E.fillColor),E.fillAlpha<1&&E.tspan.setAttributeNS(null,"fill-opacity",E.fillAlpha)):E.textRenderingMode===n.TextRenderingMode.ADD_TO_PATH?E.tspan.setAttributeNS(null,"fill","transparent"):E.tspan.setAttributeNS(null,"fill","none"),ct===n.TextRenderingMode.STROKE||ct===n.TextRenderingMode.FILL_STROKE){const it=1/(E.textMatrixScale||1);this._setStrokeAttributes(E.tspan,it)}let nt=E.textMatrix;E.textRise!==0&&(nt=nt.slice(),nt[5]+=E.textRise),E.txtElement.setAttributeNS(null,"transform",`${b(nt)} scale(${v(_)}, -1)`),E.txtElement.setAttributeNS(g,"xml:space","preserve"),E.txtElement.append(E.tspan),E.txtgrp.append(E.txtElement),this._ensureTransformGroup().append(E.txtElement)}setLeadingMoveText(h,E){this.setLeading(-E),this.moveText(h,E)}addFontStyle(h){if(!h.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 E=s(h.data,h.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${h.loadedName}"; src: url(${E}); }
  5. `}setFont(h){const E=this.current,N=this.commonObjs.get(h[0]);let M=h[1];E.font=N,this.embedFonts&&!N.missingFile&&!this.embeddedFonts[N.loadedName]&&(this.addFontStyle(N),this.embeddedFonts[N.loadedName]=N),E.fontMatrix=N.fontMatrix||n.FONT_IDENTITY_MATRIX;let A="normal";N.black?A="900":N.bold&&(A="bold");const F=N.italic?"italic":"normal";M<0?(M=-M,E.fontDirection=-1):E.fontDirection=1,E.fontSize=M,E.fontFamily=N.loadedName,E.fontWeight=A,E.fontStyle=F,E.tspan=this.svgFactory.createElement("svg:tspan"),E.tspan.setAttributeNS(null,"y",v(-E.y)),E.xcoords=[],E.ycoords=[]}endText(){var E;const h=this.current;h.textRenderingMode&n.TextRenderingMode.ADD_TO_PATH_FLAG&&((E=h.txtElement)==null?void 0:E.hasChildNodes())&&(h.element=h.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(h){h>0&&(this.current.lineWidth=h)}setLineCap(h){this.current.lineCap=k[h]}setLineJoin(h){this.current.lineJoin=S[h]}setMiterLimit(h){this.current.miterLimit=h}setStrokeAlpha(h){this.current.strokeAlpha=h}setStrokeRGBColor(h,E,N){this.current.strokeColor=n.Util.makeHexColor(h,E,N)}setFillAlpha(h){this.current.fillAlpha=h}setFillRGBColor(h,E,N){this.current.fillColor=n.Util.makeHexColor(h,E,N),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(h){this.current.strokeColor=this._makeColorN_Pattern(h)}setFillColorN(h){this.current.fillColor=this._makeColorN_Pattern(h)}shadingFill(h){const{width:E,height:N}=this.viewport,M=n.Util.inverseTransform(this.transformMatrix),[A,F,O,G]=n.Util.getAxialAlignedBoundingBox([0,0,E,N],M),_=this.svgFactory.createElement("svg:rect");_.setAttributeNS(null,"x",A),_.setAttributeNS(null,"y",F),_.setAttributeNS(null,"width",O-A),_.setAttributeNS(null,"height",G-F),_.setAttributeNS(null,"fill",this._makeShadingPattern(h)),this.current.fillAlpha<1&&_.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(_)}_makeColorN_Pattern(h){return h[0]==="TilingPattern"?this._makeTilingPattern(h):this._makeShadingPattern(h)}_makeTilingPattern(h){const E=h[1],N=h[2],M=h[3]||n.IDENTITY_MATRIX,[A,F,O,G]=h[4],_=h[5],B=h[6],K=h[7],rt=`shading${P++}`,[st,Y,ct,nt]=n.Util.normalizeRect([...n.Util.applyTransform([A,F],M),...n.Util.applyTransform([O,G],M)]),[it,kt]=n.Util.singularValueDecompose2dScale(M),U=_*it,c=B*kt,f=this.svgFactory.createElement("svg:pattern");f.setAttributeNS(null,"id",rt),f.setAttributeNS(null,"patternUnits","userSpaceOnUse"),f.setAttributeNS(null,"width",U),f.setAttributeNS(null,"height",c),f.setAttributeNS(null,"x",`${st}`),f.setAttributeNS(null,"y",`${Y}`);const i=this.svg,u=this.transformMatrix,p=this.current.fillColor,T=this.current.strokeColor,W=this.svgFactory.create(ct-st,nt-Y);if(this.svg=W,this.transformMatrix=M,K===2){const H=n.Util.makeHexColor(...E);this.current.fillColor=H,this.current.strokeColor=H}return this.executeOpTree(this.convertOpList(N)),this.svg=i,this.transformMatrix=u,this.current.fillColor=p,this.current.strokeColor=T,f.append(W.childNodes[0]),this.defs.append(f),`url(#${rt})`}_makeShadingPattern(h){switch(typeof h=="string"&&(h=this.objs.get(h)),h[0]){case"RadialAxial":const E=`shading${P++}`,N=h[3];let M;switch(h[1]){case"axial":const A=h[4],F=h[5];M=this.svgFactory.createElement("svg:linearGradient"),M.setAttributeNS(null,"id",E),M.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),M.setAttributeNS(null,"x1",A[0]),M.setAttributeNS(null,"y1",A[1]),M.setAttributeNS(null,"x2",F[0]),M.setAttributeNS(null,"y2",F[1]);break;case"radial":const O=h[4],G=h[5],_=h[6],B=h[7];M=this.svgFactory.createElement("svg:radialGradient"),M.setAttributeNS(null,"id",E),M.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),M.setAttributeNS(null,"cx",G[0]),M.setAttributeNS(null,"cy",G[1]),M.setAttributeNS(null,"r",B),M.setAttributeNS(null,"fx",O[0]),M.setAttributeNS(null,"fy",O[1]),M.setAttributeNS(null,"fr",_);break;default:throw new Error(`Unknown RadialAxial type: ${h[1]}`)}for(const A of N){const F=this.svgFactory.createElement("svg:stop");F.setAttributeNS(null,"offset",A[0]),F.setAttributeNS(null,"stop-color",A[1]),M.append(F)}return this.defs.append(M),`url(#${E})`;case"Mesh":return(0,n.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${h[0]}`)}}setDash(h,E){this.current.dashArray=h,this.current.dashPhase=E}constructPath(h,E){const N=this.current;let M=N.x,A=N.y,F=[],O=0;for(const G of h)switch(G|0){case n.OPS.rectangle:M=E[O++],A=E[O++];const _=E[O++],B=E[O++],K=M+_,rt=A+B;F.push("M",v(M),v(A),"L",v(K),v(A),"L",v(K),v(rt),"L",v(M),v(rt),"Z");break;case n.OPS.moveTo:M=E[O++],A=E[O++],F.push("M",v(M),v(A));break;case n.OPS.lineTo:M=E[O++],A=E[O++],F.push("L",v(M),v(A));break;case n.OPS.curveTo:M=E[O+4],A=E[O+5],F.push("C",v(E[O]),v(E[O+1]),v(E[O+2]),v(E[O+3]),v(M),v(A)),O+=6;break;case n.OPS.curveTo2:F.push("C",v(M),v(A),v(E[O]),v(E[O+1]),v(E[O+2]),v(E[O+3])),M=E[O+2],A=E[O+3],O+=4;break;case n.OPS.curveTo3:M=E[O+2],A=E[O+3],F.push("C",v(E[O]),v(E[O+1]),v(M),v(A),v(M),v(A)),O+=4;break;case n.OPS.closePath:F.push("Z");break}F=F.join(" "),N.path&&h.length>0&&h[0]!==n.OPS.rectangle&&h[0]!==n.OPS.moveTo?F=N.path.getAttributeNS(null,"d")+F:(N.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(N.path)),N.path.setAttributeNS(null,"d",F),N.path.setAttributeNS(null,"fill","none"),N.element=N.path,N.setCurrentPoint(M,A)}endPath(){const h=this.current;if(h.path=null,!this.pendingClip)return;if(!h.element){this.pendingClip=null;return}const E=`clippath${y++}`,N=this.svgFactory.createElement("svg:clipPath");N.setAttributeNS(null,"id",E),N.setAttributeNS(null,"transform",b(this.transformMatrix));const M=h.element.cloneNode(!0);if(this.pendingClip==="evenodd"?M.setAttributeNS(null,"clip-rule","evenodd"):M.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,N.append(M),this.defs.append(N),h.activeClipUrl){h.clipGroup=null;for(const A of this.extraStack)A.clipGroup=null;N.setAttributeNS(null,"clip-path",h.activeClipUrl)}h.activeClipUrl=`url(#${E})`,this.tgrp=null}clip(h){this.pendingClip=h}closePath(){const h=this.current;if(h.path){const E=`${h.path.getAttributeNS(null,"d")}Z`;h.path.setAttributeNS(null,"d",E)}}setLeading(h){this.current.leading=-h}setTextRise(h){this.current.textRise=h}setTextRenderingMode(h){this.current.textRenderingMode=h}setHScale(h){this.current.textHScale=h/100}setRenderingIntent(h){}setFlatness(h){}setGState(h){for(const[E,N]of h)switch(E){case"LW":this.setLineWidth(N);break;case"LC":this.setLineCap(N);break;case"LJ":this.setLineJoin(N);break;case"ML":this.setMiterLimit(N);break;case"D":this.setDash(N[0],N[1]);break;case"RI":this.setRenderingIntent(N);break;case"FL":this.setFlatness(N);break;case"Font":this.setFont(N);break;case"CA":this.setStrokeAlpha(N);break;case"ca":this.setFillAlpha(N);break;default:(0,n.warn)(`Unimplemented graphic state operator ${E}`);break}}fill(){const h=this.current;h.element&&(h.element.setAttributeNS(null,"fill",h.fillColor),h.element.setAttributeNS(null,"fill-opacity",h.fillAlpha),this.endPath())}stroke(){const h=this.current;h.element&&(this._setStrokeAttributes(h.element),h.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(h){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;const N=this.current;let M=N.dashArray;E!==1&&M.length>0&&(M=M.map(function(A){return E*A})),h.setAttributeNS(null,"stroke",N.strokeColor),h.setAttributeNS(null,"stroke-opacity",N.strokeAlpha),h.setAttributeNS(null,"stroke-miterlimit",v(N.miterLimit)),h.setAttributeNS(null,"stroke-linecap",N.lineCap),h.setAttributeNS(null,"stroke-linejoin",N.lineJoin),h.setAttributeNS(null,"stroke-width",v(E*N.lineWidth)+"px"),h.setAttributeNS(null,"stroke-dasharray",M.map(v).join(" ")),h.setAttributeNS(null,"stroke-dashoffset",v(E*N.dashPhase)+"px")}eoFill(){var h;(h=this.current.element)==null||h.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var h;(h=this.current.element)==null||h.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const h=this.svgFactory.createElement("svg:rect");h.setAttributeNS(null,"x","0"),h.setAttributeNS(null,"y","0"),h.setAttributeNS(null,"width","1px"),h.setAttributeNS(null,"height","1px"),h.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(h)}paintImageXObject(h){const E=this.getObject(h);if(!E){(0,n.warn)(`Dependent image with object ID ${h} is not ready yet`);return}this.paintInlineImageXObject(E)}paintInlineImageXObject(h,E){const N=h.width,M=h.height,A=m(h,this.forceDataSchema,!!E),F=this.svgFactory.createElement("svg:rect");F.setAttributeNS(null,"x","0"),F.setAttributeNS(null,"y","0"),F.setAttributeNS(null,"width",v(N)),F.setAttributeNS(null,"height",v(M)),this.current.element=F,this.clip("nonzero");const O=this.svgFactory.createElement("svg:image");O.setAttributeNS(w,"xlink:href",A),O.setAttributeNS(null,"x","0"),O.setAttributeNS(null,"y",v(-M)),O.setAttributeNS(null,"width",v(N)+"px"),O.setAttributeNS(null,"height",v(M)+"px"),O.setAttributeNS(null,"transform",`scale(${v(1/N)} ${v(-1/M)})`),E?E.append(O):this._ensureTransformGroup().append(O)}paintImageMaskXObject(h){const E=this.getObject(h.data,h);if(E.bitmap){(0,n.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const N=this.current,M=E.width,A=E.height,F=N.fillColor;N.maskId=`mask${C++}`;const O=this.svgFactory.createElement("svg:mask");O.setAttributeNS(null,"id",N.maskId);const G=this.svgFactory.createElement("svg:rect");G.setAttributeNS(null,"x","0"),G.setAttributeNS(null,"y","0"),G.setAttributeNS(null,"width",v(M)),G.setAttributeNS(null,"height",v(A)),G.setAttributeNS(null,"fill",F),G.setAttributeNS(null,"mask",`url(#${N.maskId})`),this.defs.append(O),this._ensureTransformGroup().append(G),this.paintInlineImageXObject(E,O)}paintFormXObjectBegin(h,E){if(Array.isArray(h)&&h.length===6&&this.transform(h[0],h[1],h[2],h[3],h[4],h[5]),E){const N=E[2]-E[0],M=E[3]-E[1],A=this.svgFactory.createElement("svg:rect");A.setAttributeNS(null,"x",E[0]),A.setAttributeNS(null,"y",E[1]),A.setAttributeNS(null,"width",v(N)),A.setAttributeNS(null,"height",v(M)),this.current.element=A,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(h){const E=this.svgFactory.create(h.width,h.height),N=this.svgFactory.createElement("svg:defs");E.append(N),this.defs=N;const M=this.svgFactory.createElement("svg:g");return M.setAttributeNS(null,"transform",b(h.transform)),E.append(M),this.svg=M,E}_ensureClipGroup(){if(!this.current.clipGroup){const h=this.svgFactory.createElement("svg:g");h.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(h),this.current.clipGroup=h}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",b(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}o.SVGGraphics=D},(R,o,t)=>{var e=t(3),n=t(188),l=t(193);e({target:"Array",proto:!0},{group:function(w){var k=arguments.length>1?arguments[1]:void 0;return n(this,w,k)}}),l("group")},(R,o,t)=>{var e=t(99),n=t(14),l=t(13),g=t(40),w=t(18),k=t(64),S=t(189),s=t(108),m=Array,d=n([].push);R.exports=function(x,v,b,y){for(var C=g(x),P=l(C),D=e(v,b),I=S(null),h=k(P),E=0,N,M,A;h>E;E++)A=P[E],M=w(D(A,E,C)),M in I?d(I[M],A):I[M]=[A];if(y&&(N=y(C),N!==m))for(M in I)I[M]=s(N,I[M]);return I}},(R,o,t)=>{var e=t(47),n=t(190),l=t(66),g=t(55),w=t(192),k=t(43),S=t(54),s=">",m="<",d="prototype",x="script",v=S("IE_PROTO"),b=function(){},y=function(h){return m+x+s+h+m+"/"+x+s},C=function(h){h.write(y("")),h.close();var E=h.parentWindow.Object;return h=null,E},P=function(){var h=k("iframe"),E="java"+x+":",N;return h.style.display="none",w.appendChild(h),h.src=String(E),N=h.contentWindow.document,N.open(),N.write(y("document.F=Object")),N.close(),N.F},D,I=function(){try{D=new ActiveXObject("htmlfile")}catch{}I=typeof document<"u"?document.domain&&D?C(D):P():C(D);for(var h=l.length;h--;)delete I[d][l[h]];return I()};g[v]=!0,R.exports=Object.create||function(E,N){var M;return E!==null?(b[d]=e(E),M=new b,b[d]=null,M[v]=E):M=I(),N===void 0?M:n.f(M,N)}},(R,o,t)=>{var e=t(6),n=t(46),l=t(45),g=t(47),w=t(12),k=t(191);o.f=e&&!n?Object.defineProperties:function(s,m){g(s);for(var d=w(m),x=k(m),v=x.length,b=0,y;v>b;)l.f(s,y=x[b++],d[y]);return s}},(R,o,t)=>{var e=t(59),n=t(66);R.exports=Object.keys||function(g){return e(g,n)}},(R,o,t)=>{var e=t(24);R.exports=e("document","documentElement")},(R,o,t)=>{var e=t(34),n=t(189),l=t(45).f,g=e("unscopables"),w=Array.prototype;w[g]===void 0&&l(w,g,{configurable:!0,value:n(null)}),R.exports=function(k){w[g][k]=!0}},(R,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.XfaText=void 0,t(89);class e{static textContent(l){const g=[],w={items:g,styles:Object.create(null)};function k(S){var d;if(!S)return;let s=null;const m=S.name;if(m==="#text")s=S.value;else if(e.shouldBuildText(m))(d=S==null?void 0:S.attributes)!=null&&d.textContent?s=S.attributes.textContent:S.value&&(s=S.value);else return;if(s!==null&&g.push({str:s}),!!S.children)for(const x of S.children)k(x)}return k(l),w}static shouldBuildText(l){return!(l==="textarea"||l==="input"||l==="option"||l==="select")}}o.XfaText=e},(R,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TextLayerRenderTask=void 0,o.renderTextLayer=b,o.updateTextLayer=y,t(89),t(2);var e=t(1),n=t(168);const l=1e5,g=30,w=.8,k=new Map;function S(C,P){let D;if(P&&e.FeatureTest.isOffscreenCanvasSupported)D=new OffscreenCanvas(C,C).getContext("2d",{alpha:!1});else{const I=document.createElement("canvas");I.width=I.height=C,D=I.getContext("2d",{alpha:!1})}return D}function s(C,P){const D=k.get(C);if(D)return D;const I=S(g,P);I.font=`${g}px ${C}`;const h=I.measureText("");let E=h.fontBoundingBoxAscent,N=Math.abs(h.fontBoundingBoxDescent);if(E){const A=E/(E+N);return k.set(C,A),I.canvas.width=I.canvas.height=0,A}I.strokeStyle="red",I.clearRect(0,0,g,g),I.strokeText("g",0,0);let M=I.getImageData(0,0,g,g).data;N=0;for(let A=M.length-1-3;A>=0;A-=4)if(M[A]>0){N=Math.ceil(A/4/g);break}I.clearRect(0,0,g,g),I.strokeText("A",0,g),M=I.getImageData(0,0,g,g).data,E=0;for(let A=0,F=M.length;A<F;A+=4)if(M[A]>0){E=g-Math.floor(A/4/g);break}if(I.canvas.width=I.canvas.height=0,E){const A=E/(E+N);return k.set(C,A),A}return k.set(C,w),w}function m(C,P,D){const I=document.createElement("span"),h={angle:0,canvasWidth:0,hasText:P.str!=="",hasEOL:P.hasEOL,fontSize:0};C._textDivs.push(I);const E=e.Util.transform(C._transform,P.transform);let N=Math.atan2(E[1],E[0]);const M=D[P.fontName];M.vertical&&(N+=Math.PI/2);const A=Math.hypot(E[2],E[3]),F=A*s(M.fontFamily,C._isOffscreenCanvasSupported);let O,G;N===0?(O=E[4],G=E[5]-F):(O=E[4]+F*Math.sin(N),G=E[5]-F*Math.cos(N));const _="calc(var(--scale-factor)*",B=I.style;C._container===C._rootContainer?(B.left=`${(100*O/C._pageWidth).toFixed(2)}%`,B.top=`${(100*G/C._pageHeight).toFixed(2)}%`):(B.left=`${_}${O.toFixed(2)}px)`,B.top=`${_}${G.toFixed(2)}px)`),B.fontSize=`${_}${A.toFixed(2)}px)`,B.fontFamily=M.fontFamily,h.fontSize=A,I.setAttribute("role","presentation"),I.textContent=P.str,I.dir=P.dir,C._fontInspectorEnabled&&(I.dataset.fontName=P.fontName),N!==0&&(h.angle=N*(180/Math.PI));let K=!1;if(P.str.length>1)K=!0;else if(P.str!==" "&&P.transform[0]!==P.transform[3]){const rt=Math.abs(P.transform[0]),st=Math.abs(P.transform[3]);rt!==st&&Math.max(rt,st)/Math.min(rt,st)>1.5&&(K=!0)}K&&(h.canvasWidth=M.vertical?P.height:P.width),C._textDivProperties.set(I,h),C._isReadableStream&&C._layoutText(I)}function d(C){const{div:P,scale:D,properties:I,ctx:h,prevFontSize:E,prevFontFamily:N}=C,{style:M}=P;let A="";if(I.canvasWidth!==0&&I.hasText){const{fontFamily:F}=M,{canvasWidth:O,fontSize:G}=I;(E!==G||N!==F)&&(h.font=`${G*D}px ${F}`,C.prevFontSize=G,C.prevFontFamily=F);const{width:_}=h.measureText(P.textContent);_>0&&(A=`scaleX(${O*D/_})`)}I.angle!==0&&(A=`rotate(${I.angle}deg) ${A}`),A.length>0&&(M.transform=A)}function x(C){if(C._canceled)return;const P=C._textDivs,D=C._capability;if(P.length>l){D.resolve();return}if(!C._isReadableStream)for(const h of P)C._layoutText(h);D.resolve()}class v{constructor(P){var B;let{textContentSource:D,container:I,viewport:h,textDivs:E,textDivProperties:N,textContentItemsStr:M,isOffscreenCanvasSupported:A}=P;this._textContentSource=D,this._isReadableStream=D instanceof ReadableStream,this._container=this._rootContainer=I,this._textDivs=E||[],this._textContentItemsStr=M||[],this._isOffscreenCanvasSupported=A,this._fontInspectorEnabled=!!((B=globalThis.FontInspector)!=null&&B.enabled),this._reader=null,this._textDivProperties=N||new WeakMap,this._canceled=!1,this._capability=new e.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:h.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:S(0,A)};const{pageWidth:F,pageHeight:O,pageX:G,pageY:_}=h.rawDims;this._transform=[1,0,0,-1,-G,_+O],this._pageWidth=F,this._pageHeight=O,(0,n.setLayerDimensions)(I,h),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new e.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new e.AbortException("TextLayer task cancelled."))}_processItems(P,D){for(const I of P){if(I.str===void 0){if(I.type==="beginMarkedContentProps"||I.type==="beginMarkedContent"){const h=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),I.id!==null&&this._container.setAttribute("id",`${I.id}`),h.append(this._container)}else I.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(I.str),m(this,I,D)}}_layoutText(P){const D=this._layoutTextParams.properties=this._textDivProperties.get(P);if(this._layoutTextParams.div=P,d(this._layoutTextParams),D.hasText&&this._container.append(P),D.hasEOL){const I=document.createElement("br");I.setAttribute("role","presentation"),this._container.append(I)}}_render(){const P=new e.PromiseCapability;let D=Object.create(null);if(this._isReadableStream){const I=()=>{this._reader.read().then(h=>{let{value:E,done:N}=h;if(N){P.resolve();return}Object.assign(D,E.styles),this._processItems(E.items,D),I()},P.reject)};this._reader=this._textContentSource.getReader(),I()}else if(this._textContentSource){const{items:I,styles:h}=this._textContentSource;this._processItems(I,h),P.resolve()}else throw new Error('No "textContentSource" parameter specified.');P.promise.then(()=>{D=null,x(this)},this._capability.reject)}}o.TextLayerRenderTask=v;function b(C){!C.textContentSource&&(C.textContent||C.textContentStream)&&((0,n.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:D}=C,I=getComputedStyle(P),h=I.getPropertyValue("visibility"),E=parseFloat(I.getPropertyValue("--scale-factor"));h==="visible"&&(!E||Math.abs(E-D.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 N=new v(C);return N._render(),N}function y(C){let{container:P,viewport:D,textDivs:I,textDivProperties:h,isOffscreenCanvasSupported:E,mustRotate:N=!0,mustRescale:M=!0}=C;if(N&&(0,n.setLayerDimensions)(P,{rotation:D.rotation}),M){const A=S(0,E),O={prevFontSize:null,prevFontFamily:null,div:null,scale:D.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:A};for(const G of I)O.properties=h.get(G),O.div=G,d(O)}}},(R,o,t)=>{var s,m,d,x,v,b,y,C,P,D,I,en,E,we,M,nn,F,rn;Object.defineProperty(o,"__esModule",{value:!0}),o.AnnotationEditorLayer=void 0,t(125),t(136),t(138),t(141),t(143),t(145),t(147);var e=t(1),n=t(164),l=t(197),g=t(202),w=t(168),k=t(203);const G=class{constructor(B){X(this,I);X(this,E);X(this,M);X(this,F);X(this,s,void 0);X(this,m,!1);X(this,d,null);X(this,x,this.pointerup.bind(this));X(this,v,this.pointerdown.bind(this));X(this,b,new Map);X(this,y,!1);X(this,C,!1);X(this,P,!1);X(this,D,void 0);let{uiManager:K,pageIndex:rt,div:st,accessibilityManager:Y,annotationLayer:ct,viewport:nt,l10n:it}=B;const kt=[l.FreeTextEditor,g.InkEditor,k.StampEditor];if(!G._initialized){G._initialized=!0;for(const U of kt)U.initialize(it)}K.registerEditorTypes(kt),ot(this,D,K),this.pageIndex=rt,this.div=st,ot(this,s,Y),ot(this,d,ct),this.viewport=nt,r(this,D).addLayer(this)}get isEmpty(){return r(this,b).size===0}updateToolbar(B){r(this,D).updateToolbar(B)}updateMode(){let B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r(this,D).getMode();j(this,F,rn).call(this),B===e.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),B!==e.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",B===e.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",B===e.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",B===e.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(B){if(!B&&r(this,D).getMode()!==e.AnnotationEditorType.INK)return;if(!B){for(const rt of r(this,b).values())if(rt.isEmpty()){rt.setInBackground();return}}j(this,E,we).call(this,{offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(B){r(this,D).setEditingState(B)}addCommands(B){r(this,D).addCommands(B)}enable(){this.div.style.pointerEvents="auto";const B=new Set;for(const rt of r(this,b).values())rt.enableEditing(),rt.annotationElementId&&B.add(rt.annotationElementId);if(!r(this,d))return;const K=r(this,d).getEditableAnnotations();for(const rt of K){if(rt.hide(),r(this,D).isDeletedAnnotationElement(rt.data.id)||B.has(rt.data.id))continue;const st=this.deserialize(rt);!st||(this.addOrRebuild(st),st.enableEditing())}}disable(){var K;ot(this,P,!0),this.div.style.pointerEvents="none";const B=new Set;for(const rt of r(this,b).values()){if(rt.disableEditing(),!rt.annotationElementId||rt.serialize()!==null){B.add(rt.annotationElementId);continue}(K=this.getEditableAnnotation(rt.annotationElementId))==null||K.show(),rt.remove()}if(r(this,d)){const rt=r(this,d).getEditableAnnotations();for(const st of rt){const{id:Y}=st.data;B.has(Y)||r(this,D).isDeletedAnnotationElement(Y)||st.show()}}j(this,F,rn).call(this),this.isEmpty&&(this.div.hidden=!0),ot(this,P,!1)}getEditableAnnotation(B){var K;return((K=r(this,d))==null?void 0:K.getEditableAnnotation(B))||null}setActiveEditor(B){r(this,D).getActive()!==B&&r(this,D).setActiveEditor(B)}enableClick(){this.div.addEventListener("pointerdown",r(this,v)),this.div.addEventListener("pointerup",r(this,x))}disableClick(){this.div.removeEventListener("pointerdown",r(this,v)),this.div.removeEventListener("pointerup",r(this,x))}attach(B){r(this,b).set(B.id,B);const{annotationElementId:K}=B;K&&r(this,D).isDeletedAnnotationElement(K)&&r(this,D).removeDeletedAnnotationElement(B)}detach(B){var K;r(this,b).delete(B.id),(K=r(this,s))==null||K.removePointerInTextLayer(B.contentDiv),!r(this,P)&&B.annotationElementId&&r(this,D).addDeletedAnnotationElement(B)}remove(B){this.detach(B),r(this,D).removeEditor(B),B.div.contains(document.activeElement)&&setTimeout(()=>{r(this,D).focusMainContainer()},0),B.div.remove(),B.isAttachedToDOM=!1,r(this,C)||this.addInkEditorIfNeeded(!1)}changeParent(B){var K;B.parent!==this&&(B.annotationElementId&&(r(this,D).addDeletedAnnotationElement(B.annotationElementId),n.AnnotationEditor.deleteAnnotationElement(B),B.annotationElementId=null),this.attach(B),(K=B.parent)==null||K.detach(B),B.setParent(this),B.div&&B.isAttachedToDOM&&(B.div.remove(),this.div.append(B.div)))}add(B){if(this.changeParent(B),r(this,D).addEditor(B),this.attach(B),!B.isAttachedToDOM){const K=B.render();this.div.append(K),B.isAttachedToDOM=!0}B.fixAndSetPosition(),B.onceAdded(),r(this,D).addToAnnotationStorage(B)}moveEditorInDOM(B){var rt;if(!B.isAttachedToDOM)return;const{activeElement:K}=document;B.div.contains(K)&&(B._focusEventsAllowed=!1,setTimeout(()=>{B.div.contains(document.activeElement)?B._focusEventsAllowed=!0:(B.div.addEventListener("focusin",()=>{B._focusEventsAllowed=!0},{once:!0}),K.focus())},0)),B._structTreeParentId=(rt=r(this,s))==null?void 0:rt.moveElementInDOM(this.div,B.div,B.contentDiv,!0)}addOrRebuild(B){B.needsToBeRebuilt()?B.rebuild():this.add(B)}addUndoableEditor(B){const K=()=>B._uiManager.rebuild(B),rt=()=>{B.remove()};this.addCommands({cmd:K,undo:rt,mustExec:!1})}getNextId(){return r(this,D).getId()}pasteEditor(B,K){r(this,D).updateToolbar(B),r(this,D).updateMode(B);const{offsetX:rt,offsetY:st}=j(this,M,nn).call(this),Y=this.getNextId(),ct=j(this,I,en).call(this,{parent:this,id:Y,x:rt,y:st,uiManager:r(this,D),isCentered:!0,...K});ct&&this.add(ct)}deserialize(B){var K;switch((K=B.annotationType)!=null?K:B.annotationEditorType){case e.AnnotationEditorType.FREETEXT:return l.FreeTextEditor.deserialize(B,this,r(this,D));case e.AnnotationEditorType.INK:return g.InkEditor.deserialize(B,this,r(this,D));case e.AnnotationEditorType.STAMP:return k.StampEditor.deserialize(B,this,r(this,D))}return null}addNewEditor(){j(this,E,we).call(this,j(this,M,nn).call(this),!0)}setSelected(B){r(this,D).setSelected(B)}toggleSelected(B){r(this,D).toggleSelected(B)}isSelected(B){return r(this,D).isSelected(B)}unselect(B){r(this,D).unselect(B)}pointerup(B){const{isMac:K}=e.FeatureTest.platform;if(!(B.button!==0||B.ctrlKey&&K)&&B.target===this.div&&!!r(this,y)){if(ot(this,y,!1),!r(this,m)){ot(this,m,!0);return}if(r(this,D).getMode()===e.AnnotationEditorType.STAMP){r(this,D).unselectAll();return}j(this,E,we).call(this,B,!1)}}pointerdown(B){if(r(this,y)){ot(this,y,!1);return}const{isMac:K}=e.FeatureTest.platform;if(B.button!==0||B.ctrlKey&&K||B.target!==this.div)return;ot(this,y,!0);const rt=r(this,D).getActive();ot(this,m,!rt||rt.isEmpty())}findNewParent(B,K,rt){const st=r(this,D).findParent(K,rt);return st===null||st===this?!1:(st.changeParent(B),!0)}destroy(){var B,K;((B=r(this,D).getActive())==null?void 0:B.parent)===this&&(r(this,D).commitOrRemove(),r(this,D).setActiveEditor(null));for(const rt of r(this,b).values())(K=r(this,s))==null||K.removePointerInTextLayer(rt.contentDiv),rt.setParent(null),rt.isAttachedToDOM=!1,rt.div.remove();this.div=null,r(this,b).clear(),r(this,D).removeLayer(this)}render(B){let{viewport:K}=B;this.viewport=K,(0,w.setLayerDimensions)(this.div,K);for(const rt of r(this,D).getEditors(this.pageIndex))this.add(rt);this.updateMode()}update(B){let{viewport:K}=B;r(this,D).commitOrRemove(),this.viewport=K,(0,w.setLayerDimensions)(this.div,{rotation:K.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:B,pageHeight:K}=this.viewport.rawDims;return[B,K]}};let S=G;s=new WeakMap,m=new WeakMap,d=new WeakMap,x=new WeakMap,v=new WeakMap,b=new WeakMap,y=new WeakMap,C=new WeakMap,P=new WeakMap,D=new WeakMap,I=new WeakSet,en=function(B){switch(r(this,D).getMode()){case e.AnnotationEditorType.FREETEXT:return new l.FreeTextEditor(B);case e.AnnotationEditorType.INK:return new g.InkEditor(B);case e.AnnotationEditorType.STAMP:return new k.StampEditor(B)}return null},E=new WeakSet,we=function(B,K){const rt=this.getNextId(),st=j(this,I,en).call(this,{parent:this,id:rt,x:B.offsetX,y:B.offsetY,uiManager:r(this,D),isCentered:K});return st&&this.add(st),st},M=new WeakSet,nn=function(){const{x:B,y:K,width:rt,height:st}=this.div.getBoundingClientRect(),Y=Math.max(0,B),ct=Math.max(0,K),nt=Math.min(window.innerWidth,B+rt),it=Math.min(window.innerHeight,K+st),kt=(Y+nt)/2-B,U=(ct+it)/2-K,[c,f]=this.viewport.rotation%180===0?[kt,U]:[U,kt];return{offsetX:c,offsetY:f}},F=new WeakSet,rn=function(){ot(this,C,!0);for(const B of r(this,b).values())B.isEmpty()&&B.remove();ot(this,C,!1)},ee(S,"_initialized",!1),o.AnnotationEditorLayer=S},(R,o,t)=>{var k,S,s,m,d,x,v,b,y,C,In,D,On,h,Dn,N,Ae,A,sn,O,Fn,_,an;Object.defineProperty(o,"__esModule",{value:!0}),o.FreeTextEditor=void 0,t(89);var e=t(1),n=t(165),l=t(164),g=t(198);const K=class extends l.AnnotationEditor{constructor(Y){super({...Y,name:"freeTextEditor"});X(this,C);X(this,D);X(this,h);X(this,N);X(this,A);X(this,O);X(this,_);X(this,k,this.editorDivBlur.bind(this));X(this,S,this.editorDivFocus.bind(this));X(this,s,this.editorDivInput.bind(this));X(this,m,this.editorDivKeydown.bind(this));X(this,d,void 0);X(this,x,"");X(this,v,`${this.id}-editor`);X(this,b,void 0);X(this,y,null);ot(this,d,Y.color||K._defaultColor||l.AnnotationEditor._defaultLineColor),ot(this,b,Y.fontSize||K._defaultFontSize)}static get _keyboardManager(){const Y=K.prototype,ct=kt=>kt.isEmpty(),nt=n.AnnotationEditorUIManager.TRANSLATE_SMALL,it=n.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,e.shadow)(this,"_keyboardManager",new n.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],Y.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],Y.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],Y._translateEmpty,{args:[-nt,0],checker:ct}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],Y._translateEmpty,{args:[-it,0],checker:ct}],[["ArrowRight","mac+ArrowRight"],Y._translateEmpty,{args:[nt,0],checker:ct}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],Y._translateEmpty,{args:[it,0],checker:ct}],[["ArrowUp","mac+ArrowUp"],Y._translateEmpty,{args:[0,-nt],checker:ct}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],Y._translateEmpty,{args:[0,-it],checker:ct}],[["ArrowDown","mac+ArrowDown"],Y._translateEmpty,{args:[0,nt],checker:ct}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],Y._translateEmpty,{args:[0,it],checker:ct}]]))}static initialize(Y){l.AnnotationEditor.initialize(Y,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});const ct=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(ct.getPropertyValue("--freetext-padding"))}static updateDefaultParams(Y,ct){switch(Y){case e.AnnotationEditorParamsType.FREETEXT_SIZE:K._defaultFontSize=ct;break;case e.AnnotationEditorParamsType.FREETEXT_COLOR:K._defaultColor=ct;break}}updateParams(Y,ct){switch(Y){case e.AnnotationEditorParamsType.FREETEXT_SIZE:j(this,C,In).call(this,ct);break;case e.AnnotationEditorParamsType.FREETEXT_COLOR:j(this,D,On).call(this,ct);break}}static get defaultPropertiesToUpdate(){return[[e.AnnotationEditorParamsType.FREETEXT_SIZE,K._defaultFontSize],[e.AnnotationEditorParamsType.FREETEXT_COLOR,K._defaultColor||l.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[e.AnnotationEditorParamsType.FREETEXT_SIZE,r(this,b)],[e.AnnotationEditorParamsType.FREETEXT_COLOR,r(this,d)]]}_translateEmpty(Y,ct){this._uiManager.translateSelectedEditors(Y,ct,!0)}getInitialTranslation(){const Y=this.parentScale;return[-K._internalPadding*Y,-(K._internalPadding+r(this,b))*Y]}rebuild(){!this.parent||(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(e.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",r(this,m)),this.editorDiv.addEventListener("focus",r(this,S)),this.editorDiv.addEventListener("blur",r(this,k)),this.editorDiv.addEventListener("input",r(this,s)))}disableEditMode(){!this.isInEditMode()||(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",r(this,v)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",r(this,m)),this.editorDiv.removeEventListener("focus",r(this,S)),this.editorDiv.removeEventListener("blur",r(this,k)),this.editorDiv.removeEventListener("input",r(this,s)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(Y){!this._focusEventsAllowed||(super.focusin(Y),Y.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var Y;if(this.width){j(this,_,an).call(this);return}this.enableEditMode(),this.editorDiv.focus(),(Y=this._initialOptions)!=null&&Y.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 Y=r(this,x),ct=ot(this,x,j(this,h,Dn).call(this).trimEnd());if(Y===ct)return;const nt=it=>{if(ot(this,x,it),!it){this.remove();return}j(this,A,sn).call(this),this._uiManager.rebuild(this),j(this,N,Ae).call(this)};this.addCommands({cmd:()=>{nt(ct)},undo:()=>{nt(Y)},mustExec:!1}),j(this,N,Ae).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(Y){this.enterInEditMode()}keydown(Y){Y.target===this.div&&Y.key==="Enter"&&(this.enterInEditMode(),Y.preventDefault())}editorDivKeydown(Y){K._keyboardManager.exec(this,Y)}editorDivFocus(Y){this.isEditing=!0}editorDivBlur(Y){this.isEditing=!1}editorDivInput(Y){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 Y,ct;this.width&&(Y=this.x,ct=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",r(this,v)),this.enableEditing(),l.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(it=>{var kt;return(kt=this.editorDiv)==null?void 0:kt.setAttribute("aria-label",it)}),l.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(it=>{var kt;return(kt=this.editorDiv)==null?void 0:kt.setAttribute("default-content",it)}),this.editorDiv.contentEditable=!0;const{style:nt}=this.editorDiv;if(nt.fontSize=`calc(${r(this,b)}px * var(--scale-factor))`,nt.color=r(this,d),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,n.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[it,kt]=this.parentDimensions;if(this.annotationElementId){const{position:U}=r(this,y);let[c,f]=this.getInitialTranslation();[c,f]=this.pageTranslationToScreen(c,f);const[i,u]=this.pageDimensions,[p,T]=this.pageTranslation;let W,H;switch(this.rotation){case 0:W=Y+(U[0]-p)/i,H=ct+this.height-(U[1]-T)/u;break;case 90:W=Y+(U[0]-p)/i,H=ct-(U[1]-T)/u,[c,f]=[f,-c];break;case 180:W=Y-this.width+(U[0]-p)/i,H=ct-(U[1]-T)/u,[c,f]=[-c,-f];break;case 270:W=Y+(U[0]-p-this.height*u)/i,H=ct+(U[1]-T-this.width*i)/u,[c,f]=[-f,c];break}this.setAt(W*it,H*kt,c,f)}else this.setAt(Y*it,ct*kt,this.width*it,this.height*kt);j(this,A,sn).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(Y,ct,nt){let it=null;if(Y instanceof g.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:U,fontColor:c},rect:f,rotation:i,id:u},textContent:p,textPosition:T,parent:{page:{pageNumber:W}}}=Y;if(!p||p.length===0)return null;it=Y={annotationType:e.AnnotationEditorType.FREETEXT,color:Array.from(c),fontSize:U,value:p.join(`
  6. `),position:T,pageIndex:W-1,rect:f,rotation:i,id:u,deleted:!1}}const kt=super.deserialize(Y,ct,nt);return ot(kt,b,Y.fontSize),ot(kt,d,e.Util.makeHexColor(...Y.color)),ot(kt,x,Y.value),kt.annotationElementId=Y.id||null,ot(kt,y,it),kt}serialize(){let Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const ct=K._internalPadding*this.parentScale,nt=this.getRect(ct,ct),it=l.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:r(this,d)),kt={annotationType:e.AnnotationEditorType.FREETEXT,color:it,fontSize:r(this,b),value:r(this,x),pageIndex:this.pageIndex,rect:nt,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return Y?kt:this.annotationElementId&&!j(this,O,Fn).call(this,kt)?null:(kt.id=this.annotationElementId,kt)}};let w=K;k=new WeakMap,S=new WeakMap,s=new WeakMap,m=new WeakMap,d=new WeakMap,x=new WeakMap,v=new WeakMap,b=new WeakMap,y=new WeakMap,C=new WeakSet,In=function(Y){const ct=it=>{this.editorDiv.style.fontSize=`calc(${it}px * var(--scale-factor))`,this.translate(0,-(it-r(this,b))*this.parentScale),ot(this,b,it),j(this,N,Ae).call(this)},nt=r(this,b);this.addCommands({cmd:()=>{ct(Y)},undo:()=>{ct(nt)},mustExec:!0,type:e.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},D=new WeakSet,On=function(Y){const ct=r(this,d);this.addCommands({cmd:()=>{ot(this,d,this.editorDiv.style.color=Y)},undo:()=>{ot(this,d,this.editorDiv.style.color=ct)},mustExec:!0,type:e.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},h=new WeakSet,Dn=function(){const Y=this.editorDiv.getElementsByTagName("div");if(Y.length===0)return this.editorDiv.innerText;const ct=[];for(const nt of Y)ct.push(nt.innerText.replace(/\r\n?|\n/,""));return ct.join(`
  7. `)},N=new WeakSet,Ae=function(){const[Y,ct]=this.parentDimensions;let nt;if(this.isAttachedToDOM)nt=this.div.getBoundingClientRect();else{const{currentLayer:it,div:kt}=this,U=kt.style.display;kt.style.display="hidden",it.div.append(this.div),nt=kt.getBoundingClientRect(),kt.remove(),kt.style.display=U}this.rotation%180===this.parentRotation%180?(this.width=nt.width/Y,this.height=nt.height/ct):(this.width=nt.height/Y,this.height=nt.width/ct),this.fixAndSetPosition()},A=new WeakSet,sn=function(){if(this.editorDiv.replaceChildren(),!!r(this,x))for(const Y of r(this,x).split(`
  8. `)){const ct=document.createElement("div");ct.append(Y?document.createTextNode(Y):document.createElement("br")),this.editorDiv.append(ct)}},O=new WeakSet,Fn=function(Y){const{value:ct,fontSize:nt,color:it,rect:kt,pageIndex:U}=r(this,y);return Y.value!==ct||Y.fontSize!==nt||Y.rect.some((c,f)=>Math.abs(c-kt[f])>=1)||Y.color.some((c,f)=>c!==it[f])||Y.pageIndex!==U},_=new WeakSet,an=function(){let Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.annotationElementId)return;if(j(this,N,Ae).call(this),!Y&&(this.width===0||this.height===0)){setTimeout(()=>j(this,_,an).call(this,!0),0);return}const ct=K._internalPadding*this.parentScale;r(this,y).rect=this.getRect(ct,ct)},ee(w,"_freeTextDefaultContent",""),ee(w,"_internalPadding",0),ee(w,"_defaultColor",null),ee(w,"_defaultFontSize",10),ee(w,"_type","freetext"),o.FreeTextEditor=w},(R,o,t)=>{var f,u,ce,T,Ln,H,tt,q,ut,ft,Et,vt,Dt,Wt,Rt,Nt,At,dt,at,pt,wt,It,Gt,Nn,zt,Me,Kt,on,Zt,ln,yt,Z,J,mt,jt,lt,z,cn,xt,St,Pt,bt,Bn,Tt,hn;Object.defineProperty(o,"__esModule",{value:!0}),o.StampAnnotationElement=o.InkAnnotationElement=o.FreeTextAnnotationElement=o.AnnotationLayer=void 0,t(89),t(125),t(136),t(138),t(141),t(143),t(145),t(147);var e=t(1),n=t(168),l=t(163),g=t(199),w=t(200),k=t(201);const S=1e3,s=9,m=new WeakSet;function d(Ft){return{width:Ft[2]-Ft[0],height:Ft[3]-Ft[1]}}class x{static create($){switch($.data.annotationType){case e.AnnotationType.LINK:return new b($);case e.AnnotationType.TEXT:return new y($);case e.AnnotationType.WIDGET:switch($.data.fieldType){case"Tx":return new P($);case"Btn":return $.data.radioButton?new h($):$.data.checkBox?new I($):new E($);case"Ch":return new N($);case"Sig":return new D($)}return new C($);case e.AnnotationType.POPUP:return new M($);case e.AnnotationType.FREETEXT:return new F($);case e.AnnotationType.LINE:return new O($);case e.AnnotationType.SQUARE:return new G($);case e.AnnotationType.CIRCLE:return new _($);case e.AnnotationType.POLYLINE:return new B($);case e.AnnotationType.CARET:return new rt($);case e.AnnotationType.INK:return new st($);case e.AnnotationType.POLYGON:return new K($);case e.AnnotationType.HIGHLIGHT:return new Y($);case e.AnnotationType.UNDERLINE:return new ct($);case e.AnnotationType.SQUIGGLY:return new nt($);case e.AnnotationType.STRIKEOUT:return new it($);case e.AnnotationType.STAMP:return new kt($);case e.AnnotationType.FILEATTACHMENT:return new U($);default:return new v($)}}}const i=class{constructor($){X(this,f,!1);let{isRenderable:a=!1,ignoreBorder:L=!1,createQuadrilaterals:V=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.isRenderable=a,this.data=$.data,this.layer=$.layer,this.linkService=$.linkService,this.downloadManager=$.downloadManager,this.imageResourcesPath=$.imageResourcesPath,this.renderForms=$.renderForms,this.svgFactory=$.svgFactory,this.annotationStorage=$.annotationStorage,this.enableScripting=$.enableScripting,this.hasJSActions=$.hasJSActions,this._fieldObjects=$.fieldObjects,this.parent=$.parent,a&&(this.container=this._createContainer(L)),V&&this._createQuadrilaterals()}static _hasPopupData($){let{titleObj:a,contentsObj:L,richText:V}=$;return!!((a==null?void 0:a.str)||(L==null?void 0:L.str)||(V==null?void 0:V.str))}get hasPopupData(){return i._hasPopupData(this.data)}_createContainer($){const{data:a,parent:{page:L,viewport:V}}=this,Q=document.createElement("section");Q.setAttribute("data-annotation-id",a.id),this instanceof C||(Q.tabIndex=S),Q.style.zIndex=this.parent.zIndex++,this.data.popupRef&&Q.setAttribute("aria-haspopup","dialog"),a.noRotate&&Q.classList.add("norotate");const{pageWidth:et,pageHeight:ht,pageX:Ct,pageY:Ot}=V.rawDims;if(!a.rect||this instanceof M){const{rotation:_t}=a;return!a.hasOwnCanvas&&_t!==0&&this.setRotation(_t,Q),Q}const{width:Mt,height:Qt}=d(a.rect),Ut=e.Util.normalizeRect([a.rect[0],L.view[3]-a.rect[1]+L.view[1],a.rect[2],L.view[3]-a.rect[3]+L.view[1]]);if(!$&&a.borderStyle.width>0){Q.style.borderWidth=`${a.borderStyle.width}px`;const _t=a.borderStyle.horizontalCornerRadius,Yt=a.borderStyle.verticalCornerRadius;if(_t>0||Yt>0){const te=`calc(${_t}px * var(--scale-factor)) / calc(${Yt}px * var(--scale-factor))`;Q.style.borderRadius=te}else if(this instanceof h){const te=`calc(${Mt}px * var(--scale-factor)) / calc(${Qt}px * var(--scale-factor))`;Q.style.borderRadius=te}switch(a.borderStyle.style){case e.AnnotationBorderStyleType.SOLID:Q.style.borderStyle="solid";break;case e.AnnotationBorderStyleType.DASHED:Q.style.borderStyle="dashed";break;case e.AnnotationBorderStyleType.BEVELED:(0,e.warn)("Unimplemented border style: beveled");break;case e.AnnotationBorderStyleType.INSET:(0,e.warn)("Unimplemented border style: inset");break;case e.AnnotationBorderStyleType.UNDERLINE:Q.style.borderBottomStyle="solid";break}const qt=a.borderColor||null;qt?(ot(this,f,!0),Q.style.borderColor=e.Util.makeHexColor(qt[0]|0,qt[1]|0,qt[2]|0)):Q.style.borderWidth=0}Q.style.left=`${100*(Ut[0]-Ct)/et}%`,Q.style.top=`${100*(Ut[1]-Ot)/ht}%`;const{rotation:Bt}=a;return a.hasOwnCanvas||Bt===0?(Q.style.width=`${100*Mt/et}%`,Q.style.height=`${100*Qt/ht}%`):this.setRotation(Bt,Q),Q}setRotation($){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.container;if(!this.data.rect)return;const{pageWidth:L,pageHeight:V}=this.parent.viewport.rawDims,{width:Q,height:et}=d(this.data.rect);let ht,Ct;$%180===0?(ht=100*Q/L,Ct=100*et/V):(ht=100*et/L,Ct=100*Q/V),a.style.width=`${ht}%`,a.style.height=`${Ct}%`,a.setAttribute("data-main-rotation",(360-$)%360)}get _commonActions(){const $=(a,L,V)=>{const Q=V.detail[a],et=Q[0],ht=Q.slice(1);V.target.style[L]=g.ColorConverters[`${et}_HTML`](ht),this.annotationStorage.setValue(this.data.id,{[L]:g.ColorConverters[`${et}_rgb`](ht)})};return(0,e.shadow)(this,"_commonActions",{display:a=>{const{display:L}=a.detail,V=L%2===1;this.container.style.visibility=V?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:V,noPrint:L===1||L===2})},print:a=>{this.annotationStorage.setValue(this.data.id,{noPrint:!a.detail.print})},hidden:a=>{const{hidden:L}=a.detail;this.container.style.visibility=L?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:L,noView:L})},focus:a=>{setTimeout(()=>a.target.focus({preventScroll:!1}),0)},userName:a=>{a.target.title=a.detail.userName},readonly:a=>{a.target.disabled=a.detail.readonly},required:a=>{this._setRequired(a.target,a.detail.required)},bgColor:a=>{$("bgColor","backgroundColor",a)},fillColor:a=>{$("fillColor","backgroundColor",a)},fgColor:a=>{$("fgColor","color",a)},textColor:a=>{$("textColor","color",a)},borderColor:a=>{$("borderColor","borderColor",a)},strokeColor:a=>{$("strokeColor","borderColor",a)},rotation:a=>{const L=a.detail.rotation;this.setRotation(L),this.annotationStorage.setValue(this.data.id,{rotation:L})}})}_dispatchEventFromSandbox($,a){const L=this._commonActions;for(const V of Object.keys(a.detail)){const Q=$[V]||L[V];Q==null||Q(a)}}_setDefaultPropertiesFromJS($){if(!this.enableScripting)return;const a=this.annotationStorage.getRawValue(this.data.id);if(!a)return;const L=this._commonActions;for(const[V,Q]of Object.entries(a)){const et=L[V];if(et){const ht={detail:{[V]:Q},target:$};et(ht),delete a[V]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:$}=this.data;if(!$)return;const[a,L,V,Q]=this.data.rect;if($.length===1){const[,{x:Yt,y:qt},{x:te,y:re}]=$[0];if(V===Yt&&Q===qt&&a===te&&L===re)return}const{style:et}=this.container;let ht;if(r(this,f)){const{borderColor:Yt,borderWidth:qt}=et;et.borderWidth=0,ht=["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="${Yt}" stroke-width="${qt}">`],this.container.classList.add("hasBorder")}const Ct=V-a,Ot=Q-L,{svgFactory:Mt}=this,Qt=Mt.createElement("svg");Qt.classList.add("quadrilateralsContainer"),Qt.setAttribute("width",0),Qt.setAttribute("height",0);const Ut=Mt.createElement("defs");Qt.append(Ut);const Bt=Mt.createElement("clipPath"),_t=`clippath_${this.data.id}`;Bt.setAttribute("id",_t),Bt.setAttribute("clipPathUnits","objectBoundingBox"),Ut.append(Bt);for(const[,{x:Yt,y:qt},{x:te,y:re}]of $){const ne=Mt.createElement("rect"),se=(te-a)/Ct,oe=(Q-qt)/Ot,le=(Yt-te)/Ct,yn=(qt-re)/Ot;ne.setAttribute("x",se),ne.setAttribute("y",oe),ne.setAttribute("width",le),ne.setAttribute("height",yn),Bt.append(ne),ht==null||ht.push(`<rect vector-effect="non-scaling-stroke" x="${se}" y="${oe}" width="${le}" height="${yn}"/>`)}r(this,f)&&(ht.push("</g></svg>')"),et.backgroundImage=ht.join("")),this.container.append(Qt),this.container.style.clipPath=`url(#${_t})`}_createPopup(){const{container:$,data:a}=this;$.setAttribute("aria-haspopup","dialog");const L=new M({data:{color:a.color,titleObj:a.titleObj,modificationDate:a.modificationDate,contentsObj:a.contentsObj,richText:a.richText,parentRect:a.rect,borderStyle:0,id:`popup_${a.id}`,rotation:a.rotation},parent:this.parent,elements:[this]});this.parent.div.append(L.render())}render(){(0,e.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName($){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const L=[];if(this._fieldObjects){const V=this._fieldObjects[$];if(V)for(const{page:Q,id:et,exportValues:ht}of V){if(Q===-1||et===a)continue;const Ct=typeof ht=="string"?ht:null,Ot=document.querySelector(`[data-element-id="${et}"]`);if(Ot&&!m.has(Ot)){(0,e.warn)(`_getElementsByName - element not allowed: ${et}`);continue}L.push({id:et,exportValue:Ct,domElement:Ot})}return L}for(const V of document.getElementsByName($)){const{exportValue:Q}=V,et=V.getAttribute("data-element-id");et!==a&&(!m.has(V)||L.push({id:et,exportValue:Q,domElement:V}))}return L}show(){var $;this.container&&(this.container.hidden=!1),($=this.popup)==null||$.maybeShow()}hide(){var $;this.container&&(this.container.hidden=!0),($=this.popup)==null||$.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const $=this.getElementsToTriggerPopup();if(Array.isArray($))for(const a of $)a.classList.add("highlightArea");else $.classList.add("highlightArea")}_editOnDoubleClick(){const{annotationEditorType:$,data:{id:a}}=this;this.container.addEventListener("dblclick",()=>{var L;(L=this.linkService.eventBus)==null||L.dispatch("switchannotationeditormode",{source:this,mode:$,editId:a})})}};let v=i;f=new WeakMap;class b extends v{constructor(a){let L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;super(a,{isRenderable:!0,ignoreBorder:!!(L!=null&&L.ignoreBorder),createQuadrilaterals:!0});X(this,u);X(this,T);this.isTooltipOnly=a.data.isTooltipOnly}render(){const{data:a,linkService:L}=this,V=document.createElement("a");V.setAttribute("data-element-id",a.id);let Q=!1;return a.url?(L.addLinkAttributes(V,a.url,a.newWindow),Q=!0):a.action?(this._bindNamedAction(V,a.action),Q=!0):a.attachment?(this._bindAttachment(V,a.attachment),Q=!0):a.setOCGState?(j(this,T,Ln).call(this,V,a.setOCGState),Q=!0):a.dest?(this._bindLink(V,a.dest),Q=!0):(a.actions&&(a.actions.Action||a.actions["Mouse Up"]||a.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(V,a),Q=!0),a.resetForm?(this._bindResetFormAction(V,a.resetForm),Q=!0):this.isTooltipOnly&&!Q&&(this._bindLink(V,""),Q=!0)),this.container.classList.add("linkAnnotation"),Q&&this.container.append(V),this.container}_bindLink(a,L){a.href=this.linkService.getDestinationHash(L),a.onclick=()=>(L&&this.linkService.goToDestination(L),!1),(L||L==="")&&j(this,u,ce).call(this)}_bindNamedAction(a,L){a.href=this.linkService.getAnchorUrl(""),a.onclick=()=>(this.linkService.executeNamedAction(L),!1),j(this,u,ce).call(this)}_bindAttachment(a,L){a.href=this.linkService.getAnchorUrl(""),a.onclick=()=>{var V;return(V=this.downloadManager)==null||V.openOrDownloadData(this.container,L.content,L.filename),!1},j(this,u,ce).call(this)}_bindJSAction(a,L){a.href=this.linkService.getAnchorUrl("");const V=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const Q of Object.keys(L.actions)){const et=V.get(Q);!et||(a[et]=()=>{var ht;return(ht=this.linkService.eventBus)==null||ht.dispatch("dispatcheventinsandbox",{source:this,detail:{id:L.id,name:Q}}),!1})}a.onclick||(a.onclick=()=>!1),j(this,u,ce).call(this)}_bindResetFormAction(a,L){const V=a.onclick;if(V||(a.href=this.linkService.getAnchorUrl("")),j(this,u,ce).call(this),!this._fieldObjects){(0,e.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),V||(a.onclick=()=>!1);return}a.onclick=()=>{var Qt;V==null||V();const{fields:Q,refs:et,include:ht}=L,Ct=[];if(Q.length!==0||et.length!==0){const Ut=new Set(et);for(const Bt of Q){const _t=this._fieldObjects[Bt]||[];for(const{id:Yt}of _t)Ut.add(Yt)}for(const Bt of Object.values(this._fieldObjects))for(const _t of Bt)Ut.has(_t.id)===ht&&Ct.push(_t)}else for(const Ut of Object.values(this._fieldObjects))Ct.push(...Ut);const Ot=this.annotationStorage,Mt=[];for(const Ut of Ct){const{id:Bt}=Ut;switch(Mt.push(Bt),Ut.type){case"text":{const Yt=Ut.defaultValue||"";Ot.setValue(Bt,{value:Yt});break}case"checkbox":case"radiobutton":{const Yt=Ut.defaultValue===Ut.exportValues;Ot.setValue(Bt,{value:Yt});break}case"combobox":case"listbox":{const Yt=Ut.defaultValue||"";Ot.setValue(Bt,{value:Yt});break}default:continue}const _t=document.querySelector(`[data-element-id="${Bt}"]`);if(_t){if(!m.has(_t)){(0,e.warn)(`_bindResetFormAction - element not allowed: ${Bt}`);continue}}else continue;_t.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((Qt=this.linkService.eventBus)==null||Qt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:Mt,name:"ResetForm"}})),!1}}}u=new WeakSet,ce=function(){this.container.setAttribute("data-internal-link","")},T=new WeakSet,Ln=function(a,L){a.href=this.linkService.getAnchorUrl(""),a.onclick=()=>(this.linkService.executeSetOCGState(L),!1),j(this,u,ce).call(this)};class y extends v{constructor($){super($,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const $=document.createElement("img");return $.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",$.alt="[{{type}} Annotation]",$.dataset.l10nId="text_annotation_type",$.dataset.l10nArgs=JSON.stringify({type:this.data.name}),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append($),this.container}}class C extends v{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas($){var a;this.data.hasOwnCanvas&&(((a=$.previousSibling)==null?void 0:a.nodeName)==="CANVAS"&&($.previousSibling.hidden=!0),$.hidden=!1)}_getKeyModifier($){const{isWin:a,isMac:L}=e.FeatureTest.platform;return a&&$.ctrlKey||L&&$.metaKey}_setEventListener($,a,L,V,Q){L.includes("mouse")?$.addEventListener(L,et=>{var ht;(ht=this.linkService.eventBus)==null||ht.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:V,value:Q(et),shift:et.shiftKey,modifier:this._getKeyModifier(et)}})}):$.addEventListener(L,et=>{var ht;if(L==="blur"){if(!a.focused||!et.relatedTarget)return;a.focused=!1}else if(L==="focus"){if(a.focused)return;a.focused=!0}!Q||(ht=this.linkService.eventBus)==null||ht.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:V,value:Q(et)}})})}_setEventListeners($,a,L,V){var Q,et,ht;for(const[Ct,Ot]of L)(Ot==="Action"||((Q=this.data.actions)==null?void 0:Q[Ot]))&&((Ot==="Focus"||Ot==="Blur")&&(a||(a={focused:!1})),this._setEventListener($,a,Ct,Ot,V),Ot==="Focus"&&!((et=this.data.actions)!=null&&et.Blur)?this._setEventListener($,a,"blur","Blur",null):Ot==="Blur"&&!((ht=this.data.actions)!=null&&ht.Focus)&&this._setEventListener($,a,"focus","Focus",null))}_setBackgroundColor($){const a=this.data.backgroundColor||null;$.style.backgroundColor=a===null?"transparent":e.Util.makeHexColor(a[0],a[1],a[2])}_setTextStyle($){const a=["left","center","right"],{fontColor:L}=this.data.defaultAppearanceData,V=this.data.defaultAppearanceData.fontSize||s,Q=$.style;let et;const ht=2,Ct=Ot=>Math.round(10*Ot)/10;if(this.data.multiLine){const Ot=Math.abs(this.data.rect[3]-this.data.rect[1]-ht),Mt=Math.round(Ot/(e.LINE_FACTOR*V))||1,Qt=Ot/Mt;et=Math.min(V,Ct(Qt/e.LINE_FACTOR))}else{const Ot=Math.abs(this.data.rect[3]-this.data.rect[1]-ht);et=Math.min(V,Ct(Ot/e.LINE_FACTOR))}Q.fontSize=`calc(${et}px * var(--scale-factor))`,Q.color=e.Util.makeHexColor(L[0],L[1],L[2]),this.data.textAlignment!==null&&(Q.textAlign=a[this.data.textAlignment])}_setRequired($,a){a?$.setAttribute("required",!0):$.removeAttribute("required"),$.setAttribute("aria-required",a)}}class P extends C{constructor($){const a=$.renderForms||!$.data.hasAppearance&&!!$.data.fieldValue;super($,{isRenderable:a})}setPropertyOnSiblings($,a,L,V){const Q=this.annotationStorage;for(const et of this._getElementsByName($.name,$.id))et.domElement&&(et.domElement[a]=L),Q.setValue(et.id,{[V]:L})}render(){var V,Q;const $=this.annotationStorage,a=this.data.id;this.container.classList.add("textWidgetAnnotation");let L=null;if(this.renderForms){const et=$.getValue(a,{value:this.data.fieldValue});let ht=et.value||"";const Ct=$.getValue(a,{charLimit:this.data.maxLen}).charLimit;Ct&&ht.length>Ct&&(ht=ht.slice(0,Ct));let Ot=et.formattedValue||((V=this.data.textContent)==null?void 0:V.join(`
  9. `))||null;Ot&&this.data.comb&&(Ot=Ot.replaceAll(/\s+/g,""));const Mt={userValue:ht,formattedValue:Ot,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(L=document.createElement("textarea"),L.textContent=Ot!=null?Ot:ht,this.data.doNotScroll&&(L.style.overflowY="hidden")):(L=document.createElement("input"),L.type="text",L.setAttribute("value",Ot!=null?Ot:ht),this.data.doNotScroll&&(L.style.overflowX="hidden")),this.data.hasOwnCanvas&&(L.hidden=!0),m.add(L),L.setAttribute("data-element-id",a),L.disabled=this.data.readOnly,L.name=this.data.fieldName,L.tabIndex=S,this._setRequired(L,this.data.required),Ct&&(L.maxLength=Ct),L.addEventListener("input",Ut=>{$.setValue(a,{value:Ut.target.value}),this.setPropertyOnSiblings(L,"value",Ut.target.value,"value"),Mt.formattedValue=null}),L.addEventListener("resetform",Ut=>{var _t;const Bt=(_t=this.data.defaultFieldValue)!=null?_t:"";L.value=Mt.userValue=Bt,Mt.formattedValue=null});let Qt=Ut=>{const{formattedValue:Bt}=Mt;Bt!=null&&(Ut.target.value=Bt),Ut.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){L.addEventListener("focus",Bt=>{if(Mt.focused)return;const{target:_t}=Bt;Mt.userValue&&(_t.value=Mt.userValue),Mt.lastCommittedValue=_t.value,Mt.commitKey=1,Mt.focused=!0}),L.addEventListener("updatefromsandbox",Bt=>{this.showElementAndHideCanvas(Bt.target);const _t={value(Yt){var qt;Mt.userValue=(qt=Yt.detail.value)!=null?qt:"",$.setValue(a,{value:Mt.userValue.toString()}),Yt.target.value=Mt.userValue},formattedValue(Yt){const{formattedValue:qt}=Yt.detail;Mt.formattedValue=qt,qt!=null&&Yt.target!==document.activeElement&&(Yt.target.value=qt),$.setValue(a,{formattedValue:qt})},selRange(Yt){Yt.target.setSelectionRange(...Yt.detail.selRange)},charLimit:Yt=>{var ne;const{charLimit:qt}=Yt.detail,{target:te}=Yt;if(qt===0){te.removeAttribute("maxLength");return}te.setAttribute("maxLength",qt);let re=Mt.userValue;!re||re.length<=qt||(re=re.slice(0,qt),te.value=Mt.userValue=re,$.setValue(a,{value:re}),(ne=this.linkService.eventBus)==null||ne.dispatch("dispatcheventinsandbox",{source:this,detail:{id:a,name:"Keystroke",value:re,willCommit:!0,commitKey:1,selStart:te.selectionStart,selEnd:te.selectionEnd}}))}};this._dispatchEventFromSandbox(_t,Bt)}),L.addEventListener("keydown",Bt=>{var qt;Mt.commitKey=1;let _t=-1;if(Bt.key==="Escape"?_t=0:Bt.key==="Enter"&&!this.data.multiLine?_t=2:Bt.key==="Tab"&&(Mt.commitKey=3),_t===-1)return;const{value:Yt}=Bt.target;Mt.lastCommittedValue!==Yt&&(Mt.lastCommittedValue=Yt,Mt.userValue=Yt,(qt=this.linkService.eventBus)==null||qt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:a,name:"Keystroke",value:Yt,willCommit:!0,commitKey:_t,selStart:Bt.target.selectionStart,selEnd:Bt.target.selectionEnd}}))});const Ut=Qt;Qt=null,L.addEventListener("blur",Bt=>{var Yt;if(!Mt.focused||!Bt.relatedTarget)return;Mt.focused=!1;const{value:_t}=Bt.target;Mt.userValue=_t,Mt.lastCommittedValue!==_t&&((Yt=this.linkService.eventBus)==null||Yt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:a,name:"Keystroke",value:_t,willCommit:!0,commitKey:Mt.commitKey,selStart:Bt.target.selectionStart,selEnd:Bt.target.selectionEnd}})),Ut(Bt)}),(Q=this.data.actions)!=null&&Q.Keystroke&&L.addEventListener("beforeinput",Bt=>{var oe;Mt.lastCommittedValue=null;const{data:_t,target:Yt}=Bt,{value:qt,selectionStart:te,selectionEnd:re}=Yt;let ne=te,se=re;switch(Bt.inputType){case"deleteWordBackward":{const le=qt.substring(0,te).match(/\w*[^\w]*$/);le&&(ne-=le[0].length);break}case"deleteWordForward":{const le=qt.substring(te).match(/^[^\w]*\w*/);le&&(se+=le[0].length);break}case"deleteContentBackward":te===re&&(ne-=1);break;case"deleteContentForward":te===re&&(se+=1);break}Bt.preventDefault(),(oe=this.linkService.eventBus)==null||oe.dispatch("dispatcheventinsandbox",{source:this,detail:{id:a,name:"Keystroke",value:qt,change:_t||"",willCommit:!1,selStart:ne,selEnd:se}})}),this._setEventListeners(L,Mt,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Bt=>Bt.target.value)}if(Qt&&L.addEventListener("blur",Qt),this.data.comb){const Bt=(this.data.rect[2]-this.data.rect[0])/Ct;L.classList.add("comb"),L.style.letterSpacing=`calc(${Bt}px * var(--scale-factor) - 1ch)`}}else L=document.createElement("div"),L.textContent=this.data.fieldValue,L.style.verticalAlign="middle",L.style.display="table-cell";return this._setTextStyle(L),this._setBackgroundColor(L),this._setDefaultPropertiesFromJS(L),this.container.append(L),this.container}}class D extends C{constructor($){super($,{isRenderable:!!$.data.hasOwnCanvas})}}class I extends C{constructor($){super($,{isRenderable:$.renderForms})}render(){const $=this.annotationStorage,a=this.data,L=a.id;let V=$.getValue(L,{value:a.exportValue===a.fieldValue}).value;typeof V=="string"&&(V=V!=="Off",$.setValue(L,{value:V})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const Q=document.createElement("input");return m.add(Q),Q.setAttribute("data-element-id",L),Q.disabled=a.readOnly,this._setRequired(Q,this.data.required),Q.type="checkbox",Q.name=a.fieldName,V&&Q.setAttribute("checked",!0),Q.setAttribute("exportValue",a.exportValue),Q.tabIndex=S,Q.addEventListener("change",et=>{const{name:ht,checked:Ct}=et.target;for(const Ot of this._getElementsByName(ht,L)){const Mt=Ct&&Ot.exportValue===a.exportValue;Ot.domElement&&(Ot.domElement.checked=Mt),$.setValue(Ot.id,{value:Mt})}$.setValue(L,{value:Ct})}),Q.addEventListener("resetform",et=>{const ht=a.defaultFieldValue||"Off";et.target.checked=ht===a.exportValue}),this.enableScripting&&this.hasJSActions&&(Q.addEventListener("updatefromsandbox",et=>{const ht={value(Ct){Ct.target.checked=Ct.detail.value!=="Off",$.setValue(L,{value:Ct.target.checked})}};this._dispatchEventFromSandbox(ht,et)}),this._setEventListeners(Q,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)),this._setBackgroundColor(Q),this._setDefaultPropertiesFromJS(Q),this.container.append(Q),this.container}}class h extends C{constructor($){super($,{isRenderable:$.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const $=this.annotationStorage,a=this.data,L=a.id;let V=$.getValue(L,{value:a.fieldValue===a.buttonValue}).value;typeof V=="string"&&(V=V!==a.buttonValue,$.setValue(L,{value:V}));const Q=document.createElement("input");if(m.add(Q),Q.setAttribute("data-element-id",L),Q.disabled=a.readOnly,this._setRequired(Q,this.data.required),Q.type="radio",Q.name=a.fieldName,V&&Q.setAttribute("checked",!0),Q.tabIndex=S,Q.addEventListener("change",et=>{const{name:ht,checked:Ct}=et.target;for(const Ot of this._getElementsByName(ht,L))$.setValue(Ot.id,{value:!1});$.setValue(L,{value:Ct})}),Q.addEventListener("resetform",et=>{const ht=a.defaultFieldValue;et.target.checked=ht!=null&&ht===a.buttonValue}),this.enableScripting&&this.hasJSActions){const et=a.buttonValue;Q.addEventListener("updatefromsandbox",ht=>{const Ct={value:Ot=>{const Mt=et===Ot.detail.value;for(const Qt of this._getElementsByName(Ot.target.name)){const Ut=Mt&&Qt.id===L;Qt.domElement&&(Qt.domElement.checked=Ut),$.setValue(Qt.id,{value:Ut})}}};this._dispatchEventFromSandbox(Ct,ht)}),this._setEventListeners(Q,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],ht=>ht.target.checked)}return this._setBackgroundColor(Q),this._setDefaultPropertiesFromJS(Q),this.container.append(Q),this.container}}class E extends b{constructor($){super($,{ignoreBorder:$.data.hasAppearance})}render(){const $=super.render();$.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&($.title=this.data.alternativeText);const a=$.lastChild;return this.enableScripting&&this.hasJSActions&&a&&(this._setDefaultPropertiesFromJS(a),a.addEventListener("updatefromsandbox",L=>{this._dispatchEventFromSandbox({},L)})),$}}class N extends C{constructor($){super($,{isRenderable:$.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const $=this.annotationStorage,a=this.data.id,L=$.getValue(a,{value:this.data.fieldValue}),V=document.createElement("select");m.add(V),V.setAttribute("data-element-id",a),V.disabled=this.data.readOnly,this._setRequired(V,this.data.required),V.name=this.data.fieldName,V.tabIndex=S;let Q=this.data.combo&&this.data.options.length>0;this.data.combo||(V.size=this.data.options.length,this.data.multiSelect&&(V.multiple=!0)),V.addEventListener("resetform",Mt=>{const Qt=this.data.defaultFieldValue;for(const Ut of V.options)Ut.selected=Ut.value===Qt});for(const Mt of this.data.options){const Qt=document.createElement("option");Qt.textContent=Mt.displayValue,Qt.value=Mt.exportValue,L.value.includes(Mt.exportValue)&&(Qt.setAttribute("selected",!0),Q=!1),V.append(Qt)}let et=null;if(Q){const Mt=document.createElement("option");Mt.value=" ",Mt.setAttribute("hidden",!0),Mt.setAttribute("selected",!0),V.prepend(Mt),et=()=>{Mt.remove(),V.removeEventListener("input",et),et=null},V.addEventListener("input",et)}const ht=Mt=>{const Qt=Mt?"value":"textContent",{options:Ut,multiple:Bt}=V;return Bt?Array.prototype.filter.call(Ut,_t=>_t.selected).map(_t=>_t[Qt]):Ut.selectedIndex===-1?null:Ut[Ut.selectedIndex][Qt]};let Ct=ht(!1);const Ot=Mt=>{const Qt=Mt.target.options;return Array.prototype.map.call(Qt,Ut=>({displayValue:Ut.textContent,exportValue:Ut.value}))};return this.enableScripting&&this.hasJSActions?(V.addEventListener("updatefromsandbox",Mt=>{const Qt={value(Ut){et==null||et();const Bt=Ut.detail.value,_t=new Set(Array.isArray(Bt)?Bt:[Bt]);for(const Yt of V.options)Yt.selected=_t.has(Yt.value);$.setValue(a,{value:ht(!0)}),Ct=ht(!1)},multipleSelection(Ut){V.multiple=!0},remove(Ut){const Bt=V.options,_t=Ut.detail.remove;Bt[_t].selected=!1,V.remove(_t),Bt.length>0&&Array.prototype.findIndex.call(Bt,qt=>qt.selected)===-1&&(Bt[0].selected=!0),$.setValue(a,{value:ht(!0),items:Ot(Ut)}),Ct=ht(!1)},clear(Ut){for(;V.length!==0;)V.remove(0);$.setValue(a,{value:null,items:[]}),Ct=ht(!1)},insert(Ut){const{index:Bt,displayValue:_t,exportValue:Yt}=Ut.detail.insert,qt=V.children[Bt],te=document.createElement("option");te.textContent=_t,te.value=Yt,qt?qt.before(te):V.append(te),$.setValue(a,{value:ht(!0),items:Ot(Ut)}),Ct=ht(!1)},items(Ut){const{items:Bt}=Ut.detail;for(;V.length!==0;)V.remove(0);for(const _t of Bt){const{displayValue:Yt,exportValue:qt}=_t,te=document.createElement("option");te.textContent=Yt,te.value=qt,V.append(te)}V.options.length>0&&(V.options[0].selected=!0),$.setValue(a,{value:ht(!0),items:Ot(Ut)}),Ct=ht(!1)},indices(Ut){const Bt=new Set(Ut.detail.indices);for(const _t of Ut.target.options)_t.selected=Bt.has(_t.index);$.setValue(a,{value:ht(!0)}),Ct=ht(!1)},editable(Ut){Ut.target.disabled=!Ut.detail.editable}};this._dispatchEventFromSandbox(Qt,Mt)}),V.addEventListener("input",Mt=>{var Ut;const Qt=ht(!0);$.setValue(a,{value:Qt}),Mt.preventDefault(),(Ut=this.linkService.eventBus)==null||Ut.dispatch("dispatcheventinsandbox",{source:this,detail:{id:a,name:"Keystroke",value:Ct,changeEx:Qt,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(V,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],Mt=>Mt.target.value)):V.addEventListener("input",function(Mt){$.setValue(a,{value:ht(!0)})}),this.data.combo&&this._setTextStyle(V),this._setBackgroundColor(V),this._setDefaultPropertiesFromJS(V),this.container.append(V),this.container}}class M extends v{constructor($){const{data:a,elements:L}=$;super($,{isRenderable:v._hasPopupData(a)}),this.elements=L}render(){this.container.classList.add("popupAnnotation");const $=new A({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}),a=[];for(const L of this.elements)L.popup=$,a.push(L.data.id),L.addHighlightArea();return this.container.setAttribute("aria-controls",a.map(L=>`${e.AnnotationPrefix}${L}`).join(",")),this.container}}class A{constructor($){X(this,Gt);X(this,zt);X(this,Kt);X(this,Zt);X(this,H,null);X(this,tt,j(this,Gt,Nn).bind(this));X(this,q,j(this,Zt,ln).bind(this));X(this,ut,j(this,Kt,on).bind(this));X(this,ft,j(this,zt,Me).bind(this));X(this,Et,null);X(this,vt,null);X(this,Dt,null);X(this,Wt,null);X(this,Rt,null);X(this,Nt,null);X(this,At,!1);X(this,dt,null);X(this,at,null);X(this,pt,null);X(this,wt,null);X(this,It,!1);var _t;let{container:a,color:L,elements:V,titleObj:Q,modificationDate:et,contentsObj:ht,richText:Ct,parent:Ot,rect:Mt,parentRect:Qt,open:Ut}=$;ot(this,vt,a),ot(this,wt,Q),ot(this,Dt,ht),ot(this,pt,Ct),ot(this,Rt,Ot),ot(this,Et,L),ot(this,at,Mt),ot(this,Nt,Qt),ot(this,Wt,V);const Bt=n.PDFDateString.toDateObject(et);Bt&&ot(this,H,Ot.l10n.get("annotation_date_string",{date:Bt.toLocaleDateString(),time:Bt.toLocaleTimeString()})),this.trigger=V.flatMap(Yt=>Yt.getElementsToTriggerPopup());for(const Yt of this.trigger)Yt.addEventListener("click",r(this,ft)),Yt.addEventListener("mouseenter",r(this,ut)),Yt.addEventListener("mouseleave",r(this,q)),Yt.classList.add("popupTriggerArea");for(const Yt of V)(_t=Yt.container)==null||_t.addEventListener("keydown",r(this,tt));r(this,vt).hidden=!0,Ut&&j(this,zt,Me).call(this)}render(){if(r(this,dt))return;const{page:{view:$},viewport:{rawDims:{pageWidth:a,pageHeight:L,pageX:V,pageY:Q}}}=r(this,Rt),et=ot(this,dt,document.createElement("div"));if(et.className="popup",r(this,Et)){const ne=et.style.outlineColor=e.Util.makeHexColor(...r(this,Et));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?et.style.backgroundColor=`color-mix(in srgb, ${ne} 30%, white)`:et.style.backgroundColor=e.Util.makeHexColor(...r(this,Et).map(oe=>Math.floor(.7*(255-oe)+oe)))}const ht=document.createElement("span");ht.className="header";const Ct=document.createElement("h1");if(ht.append(Ct),{dir:Ct.dir,str:Ct.textContent}=r(this,wt),et.append(ht),r(this,H)){const ne=document.createElement("span");ne.classList.add("popupDate"),r(this,H).then(se=>{ne.textContent=se}),ht.append(ne)}const Ot=r(this,Dt),Mt=r(this,pt);if((Mt==null?void 0:Mt.str)&&(!(Ot!=null&&Ot.str)||Ot.str===Mt.str))k.XfaLayer.render({xfaHtml:Mt.html,intent:"richText",div:et}),et.lastChild.classList.add("richText","popupContent");else{const ne=this._formatContents(Ot);et.append(ne)}let Qt=!!r(this,Nt),Ut=Qt?r(this,Nt):r(this,at);for(const ne of r(this,Wt))if(!Ut||e.Util.intersect(ne.data.rect,Ut)!==null){Ut=ne.data.rect,Qt=!0;break}const Bt=e.Util.normalizeRect([Ut[0],$[3]-Ut[1]+$[1],Ut[2],$[3]-Ut[3]+$[1]]),_t=5,Yt=Qt?Ut[2]-Ut[0]+_t:0,qt=Bt[0]+Yt,te=Bt[1],{style:re}=r(this,vt);re.left=`${100*(qt-V)/a}%`,re.top=`${100*(te-Q)/L}%`,r(this,vt).append(et)}_formatContents($){let{str:a,dir:L}=$;const V=document.createElement("p");V.classList.add("popupContent"),V.dir=L;const Q=a.split(/(?:\r\n?|\n)/);for(let et=0,ht=Q.length;et<ht;++et){const Ct=Q[et];V.append(document.createTextNode(Ct)),et<ht-1&&V.append(document.createElement("br"))}return V}forceHide(){ot(this,It,this.isVisible),r(this,It)&&(r(this,vt).hidden=!0)}maybeShow(){!r(this,It)||(ot(this,It,!1),r(this,vt).hidden=!1)}get isVisible(){return r(this,vt).hidden===!1}}H=new WeakMap,tt=new WeakMap,q=new WeakMap,ut=new WeakMap,ft=new WeakMap,Et=new WeakMap,vt=new WeakMap,Dt=new WeakMap,Wt=new WeakMap,Rt=new WeakMap,Nt=new WeakMap,At=new WeakMap,dt=new WeakMap,at=new WeakMap,pt=new WeakMap,wt=new WeakMap,It=new WeakMap,Gt=new WeakSet,Nn=function($){$.altKey||$.shiftKey||$.ctrlKey||$.metaKey||($.key==="Enter"||$.key==="Escape"&&r(this,At))&&j(this,zt,Me).call(this)},zt=new WeakSet,Me=function(){ot(this,At,!r(this,At)),r(this,At)?(j(this,Kt,on).call(this),r(this,vt).addEventListener("click",r(this,ft)),r(this,vt).addEventListener("keydown",r(this,tt))):(j(this,Zt,ln).call(this),r(this,vt).removeEventListener("click",r(this,ft)),r(this,vt).removeEventListener("keydown",r(this,tt)))},Kt=new WeakSet,on=function(){r(this,dt)||this.render(),this.isVisible?r(this,At)&&r(this,vt).classList.add("focused"):(r(this,vt).hidden=!1,r(this,vt).style.zIndex=parseInt(r(this,vt).style.zIndex)+1e3)},Zt=new WeakSet,ln=function(){r(this,vt).classList.remove("focused"),!(r(this,At)||!this.isVisible)&&(r(this,vt).hidden=!0,r(this,vt).style.zIndex=parseInt(r(this,vt).style.zIndex)-1e3)};class F extends v{constructor($){super($,{isRenderable:!0,ignoreBorder:!0}),this.textContent=$.data.textContent,this.textPosition=$.data.textPosition,this.annotationEditorType=e.AnnotationEditorType.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const $=document.createElement("div");$.classList.add("annotationTextContent"),$.setAttribute("role","comment");for(const a of this.textContent){const L=document.createElement("span");L.textContent=a,$.append(L)}this.container.append($)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}o.FreeTextAnnotationElement=F;class O extends v{constructor(a){super(a,{isRenderable:!0,ignoreBorder:!0});X(this,yt,null)}render(){this.container.classList.add("lineAnnotation");const a=this.data,{width:L,height:V}=d(a.rect),Q=this.svgFactory.create(L,V,!0),et=ot(this,yt,this.svgFactory.createElement("svg:line"));return et.setAttribute("x1",a.rect[2]-a.lineCoordinates[0]),et.setAttribute("y1",a.rect[3]-a.lineCoordinates[1]),et.setAttribute("x2",a.rect[2]-a.lineCoordinates[2]),et.setAttribute("y2",a.rect[3]-a.lineCoordinates[3]),et.setAttribute("stroke-width",a.borderStyle.width||1),et.setAttribute("stroke","transparent"),et.setAttribute("fill","transparent"),Q.append(et),this.container.append(Q),!a.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return r(this,yt)}addHighlightArea(){this.container.classList.add("highlightArea")}}yt=new WeakMap;class G extends v{constructor(a){super(a,{isRenderable:!0,ignoreBorder:!0});X(this,Z,null)}render(){this.container.classList.add("squareAnnotation");const a=this.data,{width:L,height:V}=d(a.rect),Q=this.svgFactory.create(L,V,!0),et=a.borderStyle.width,ht=ot(this,Z,this.svgFactory.createElement("svg:rect"));return ht.setAttribute("x",et/2),ht.setAttribute("y",et/2),ht.setAttribute("width",L-et),ht.setAttribute("height",V-et),ht.setAttribute("stroke-width",et||1),ht.setAttribute("stroke","transparent"),ht.setAttribute("fill","transparent"),Q.append(ht),this.container.append(Q),!a.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return r(this,Z)}addHighlightArea(){this.container.classList.add("highlightArea")}}Z=new WeakMap;class _ extends v{constructor(a){super(a,{isRenderable:!0,ignoreBorder:!0});X(this,J,null)}render(){this.container.classList.add("circleAnnotation");const a=this.data,{width:L,height:V}=d(a.rect),Q=this.svgFactory.create(L,V,!0),et=a.borderStyle.width,ht=ot(this,J,this.svgFactory.createElement("svg:ellipse"));return ht.setAttribute("cx",L/2),ht.setAttribute("cy",V/2),ht.setAttribute("rx",L/2-et/2),ht.setAttribute("ry",V/2-et/2),ht.setAttribute("stroke-width",et||1),ht.setAttribute("stroke","transparent"),ht.setAttribute("fill","transparent"),Q.append(ht),this.container.append(Q),!a.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return r(this,J)}addHighlightArea(){this.container.classList.add("highlightArea")}}J=new WeakMap;class B extends v{constructor(a){super(a,{isRenderable:!0,ignoreBorder:!0});X(this,mt,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const a=this.data,{width:L,height:V}=d(a.rect),Q=this.svgFactory.create(L,V,!0);let et=[];for(const Ct of a.vertices){const Ot=Ct.x-a.rect[0],Mt=a.rect[3]-Ct.y;et.push(Ot+","+Mt)}et=et.join(" ");const ht=ot(this,mt,this.svgFactory.createElement(this.svgElementName));return ht.setAttribute("points",et),ht.setAttribute("stroke-width",a.borderStyle.width||1),ht.setAttribute("stroke","transparent"),ht.setAttribute("fill","transparent"),Q.append(ht),this.container.append(Q),!a.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return r(this,mt)}addHighlightArea(){this.container.classList.add("highlightArea")}}mt=new WeakMap;class K extends B{constructor($){super($),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class rt extends v{constructor($){super($,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class st extends v{constructor(a){super(a,{isRenderable:!0,ignoreBorder:!0});X(this,jt,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=e.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);const a=this.data,{width:L,height:V}=d(a.rect),Q=this.svgFactory.create(L,V,!0);for(const et of a.inkLists){let ht=[];for(const Ot of et){const Mt=Ot.x-a.rect[0],Qt=a.rect[3]-Ot.y;ht.push(`${Mt},${Qt}`)}ht=ht.join(" ");const Ct=this.svgFactory.createElement(this.svgElementName);r(this,jt).push(Ct),Ct.setAttribute("points",ht),Ct.setAttribute("stroke-width",a.borderStyle.width||1),Ct.setAttribute("stroke","transparent"),Ct.setAttribute("fill","transparent"),!a.popupRef&&this.hasPopupData&&this._createPopup(),Q.append(Ct)}return this.container.append(Q),this.container}getElementsToTriggerPopup(){return r(this,jt)}addHighlightArea(){this.container.classList.add("highlightArea")}}jt=new WeakMap,o.InkAnnotationElement=st;class Y extends v{constructor($){super($,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class ct extends v{constructor($){super($,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class nt extends v{constructor($){super($,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class it extends v{constructor($){super($,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class kt extends v{constructor($){super($,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}o.StampAnnotationElement=kt;class U extends v{constructor(a){var Q;super(a,{isRenderable:!0});X(this,z);X(this,lt,null);const{filename:L,content:V}=this.data.file;this.filename=(0,n.getFilenameFromUrl)(L,!0),this.content=V,(Q=this.linkService.eventBus)==null||Q.dispatch("fileattachmentannotation",{source:this,filename:L,content:V})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:a,data:L}=this;let V;L.hasAppearance||L.fillAlpha===0?V=document.createElement("div"):(V=document.createElement("img"),V.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(L.name)?"paperclip":"pushpin"}.svg`,L.fillAlpha&&L.fillAlpha<1&&(V.style=`filter: opacity(${Math.round(L.fillAlpha*100)}%);`)),V.addEventListener("dblclick",j(this,z,cn).bind(this)),ot(this,lt,V);const{isMac:Q}=e.FeatureTest.platform;return a.addEventListener("keydown",et=>{et.key==="Enter"&&(Q?et.metaKey:et.ctrlKey)&&j(this,z,cn).call(this)}),!L.popupRef&&this.hasPopupData?this._createPopup():V.classList.add("popupTriggerArea"),a.append(V),a}getElementsToTriggerPopup(){return r(this,lt)}addHighlightArea(){this.container.classList.add("highlightArea")}}lt=new WeakMap,z=new WeakSet,cn=function(){var a;(a=this.downloadManager)==null||a.openOrDownloadData(this.container,this.content,this.filename)};class c{constructor($){X(this,bt);X(this,Tt);X(this,xt,null);X(this,St,null);X(this,Pt,new Map);let{div:a,accessibilityManager:L,annotationCanvasMap:V,l10n:Q,page:et,viewport:ht}=$;this.div=a,ot(this,xt,L),ot(this,St,V),this.l10n=Q,this.page=et,this.viewport=ht,this.zIndex=0,this.l10n||(this.l10n=w.NullL10n)}async render($){const{annotations:a}=$,L=this.div;(0,n.setLayerDimensions)(L,this.viewport);const V=new Map,Q={data:null,layer:L,linkService:$.linkService,downloadManager:$.downloadManager,imageResourcesPath:$.imageResourcesPath||"",renderForms:$.renderForms!==!1,svgFactory:new n.DOMSVGFactory,annotationStorage:$.annotationStorage||new l.AnnotationStorage,enableScripting:$.enableScripting===!0,hasJSActions:$.hasJSActions,fieldObjects:$.fieldObjects,parent:this,elements:null};for(const et of a){if(et.noHTML)continue;const ht=et.annotationType===e.AnnotationType.POPUP;if(ht){const Mt=V.get(et.id);if(!Mt)continue;Q.elements=Mt}else{const{width:Mt,height:Qt}=d(et.rect);if(Mt<=0||Qt<=0)continue}Q.data=et;const Ct=x.create(Q);if(!Ct.isRenderable)continue;if(!ht&&et.popupRef){const Mt=V.get(et.popupRef);Mt?Mt.push(Ct):V.set(et.popupRef,[Ct])}Ct.annotationEditorType>0&&r(this,Pt).set(Ct.data.id,Ct);const Ot=Ct.render();et.hidden&&(Ot.style.visibility="hidden"),j(this,bt,Bn).call(this,Ot,et.id)}j(this,Tt,hn).call(this),await this.l10n.translate(L)}update($){let{viewport:a}=$;const L=this.div;this.viewport=a,(0,n.setLayerDimensions)(L,{rotation:a.rotation}),j(this,Tt,hn).call(this),L.hidden=!1}getEditableAnnotations(){return Array.from(r(this,Pt).values())}getEditableAnnotation($){return r(this,Pt).get($)}}xt=new WeakMap,St=new WeakMap,Pt=new WeakMap,bt=new WeakSet,Bn=function($,a){var V;const L=$.firstChild||$;L.id=`${e.AnnotationPrefix}${a}`,this.div.append($),(V=r(this,xt))==null||V.moveElementInDOM(this.div,$,L,!1)},Tt=new WeakSet,hn=function(){if(!r(this,St))return;const $=this.div;for(const[a,L]of r(this,St)){const V=$.querySelector(`[data-annotation-id="${a}"]`);if(!V)continue;const{firstChild:Q}=V;Q?Q.nodeName==="CANVAS"?Q.replaceWith(L):Q.before(L):V.append(L)}r(this,St).clear()},o.AnnotationLayer=c},(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorConverters=void 0;function t(l){return Math.floor(Math.max(0,Math.min(1,l))*255).toString(16).padStart(2,"0")}function e(l){return Math.max(0,Math.min(255,255*l))}class n{static CMYK_G(g){let[w,k,S,s]=g;return["G",1-Math.min(1,.3*w+.59*S+.11*k+s)]}static G_CMYK(g){let[w]=g;return["CMYK",0,0,0,1-w]}static G_RGB(g){let[w]=g;return["RGB",w,w,w]}static G_rgb(g){let[w]=g;return w=e(w),[w,w,w]}static G_HTML(g){let[w]=g;const k=t(w);return`#${k}${k}${k}`}static RGB_G(g){let[w,k,S]=g;return["G",.3*w+.59*k+.11*S]}static RGB_rgb(g){return g.map(e)}static RGB_HTML(g){return`#${g.map(t).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(g){let[w,k,S,s]=g;return["RGB",1-Math.min(1,w+s),1-Math.min(1,S+s),1-Math.min(1,k+s)]}static CMYK_rgb(g){let[w,k,S,s]=g;return[e(1-Math.min(1,w+s)),e(1-Math.min(1,S+s)),e(1-Math.min(1,k+s))]}static CMYK_HTML(g){const w=this.CMYK_RGB(g).slice(1);return this.RGB_HTML(w)}static RGB_CMYK(g){let[w,k,S]=g;const s=1-w,m=1-k,d=1-S,x=Math.min(s,m,d);return["CMYK",s,m,d,x]}}o.ColorConverters=n},(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.NullL10n=void 0,o.getL10nFallback=e;const t={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}} \xD7 {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} \xD7 {{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\u2026",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"};t.print_progress_percent="{{progress}}%";function e(g,w){switch(g){case"find_match_count":g=`find_match_count[${w.total===1?"one":"other"}]`;break;case"find_match_count_limit":g=`find_match_count_limit[${w.limit===1?"one":"other"}]`;break}return t[g]||""}function n(g,w){return w?g.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(k,S)=>S in w?w[S]:"{{"+S+"}}"):g}const l={async getLanguage(){return"en-us"},async getDirection(){return"ltr"},async get(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e(g,w);return n(k,w)},async translate(g){}};o.NullL10n=l},(R,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.XfaLayer=void 0,t(89);var e=t(194);class n{static setupStorage(g,w,k,S,s){const m=S.getValue(w,{value:null});switch(k.name){case"textarea":if(m.value!==null&&(g.textContent=m.value),s==="print")break;g.addEventListener("input",d=>{S.setValue(w,{value:d.target.value})});break;case"input":if(k.attributes.type==="radio"||k.attributes.type==="checkbox"){if(m.value===k.attributes.xfaOn?g.setAttribute("checked",!0):m.value===k.attributes.xfaOff&&g.removeAttribute("checked"),s==="print")break;g.addEventListener("change",d=>{S.setValue(w,{value:d.target.checked?d.target.getAttribute("xfaOn"):d.target.getAttribute("xfaOff")})})}else{if(m.value!==null&&g.setAttribute("value",m.value),s==="print")break;g.addEventListener("input",d=>{S.setValue(w,{value:d.target.value})})}break;case"select":if(m.value!==null){g.setAttribute("value",m.value);for(const d of k.children)d.attributes.value===m.value?d.attributes.selected=!0:d.attributes.hasOwnProperty("selected")&&delete d.attributes.selected}g.addEventListener("input",d=>{const x=d.target.options,v=x.selectedIndex===-1?"":x[x.selectedIndex].value;S.setValue(w,{value:v})});break}}static setAttributes(g){let{html:w,element:k,storage:S=null,intent:s,linkService:m}=g;const{attributes:d}=k,x=w instanceof HTMLAnchorElement;d.type==="radio"&&(d.name=`${d.name}-${s}`);for(const[v,b]of Object.entries(d))if(b!=null)switch(v){case"class":b.length&&w.setAttribute(v,b.join(" "));break;case"dataId":break;case"id":w.setAttribute("data-element-id",b);break;case"style":Object.assign(w.style,b);break;case"textContent":w.textContent=b;break;default:(!x||v!=="href"&&v!=="newWindow")&&w.setAttribute(v,b)}x&&m.addLinkAttributes(w,d.href,d.newWindow),S&&d.dataId&&this.setupStorage(w,d.dataId,k,S)}static render(g){var b;const w=g.annotationStorage,k=g.linkService,S=g.xfaHtml,s=g.intent||"display",m=document.createElement(S.name);S.attributes&&this.setAttributes({html:m,element:S,intent:s,linkService:k});const d=[[S,-1,m]],x=g.div;if(x.append(m),g.viewport){const y=`matrix(${g.viewport.transform.join(",")})`;x.style.transform=y}s!=="richText"&&x.setAttribute("class","xfaLayer xfaFont");const v=[];for(;d.length>0;){const[y,C,P]=d.at(-1);if(C+1===y.children.length){d.pop();continue}const D=y.children[++d.at(-1)[1]];if(D===null)continue;const{name:I}=D;if(I==="#text"){const E=document.createTextNode(D.value);v.push(E),P.append(E);continue}const h=(b=D==null?void 0:D.attributes)!=null&&b.xmlns?document.createElementNS(D.attributes.xmlns,I):document.createElement(I);if(P.append(h),D.attributes&&this.setAttributes({html:h,element:D,storage:w,intent:s,linkService:k}),D.children&&D.children.length>0)d.push([D,-1,h]);else if(D.value){const E=document.createTextNode(D.value);e.XfaText.shouldBuildText(I)&&v.push(E),h.append(E)}}for(const y of x.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))y.setAttribute("readOnly",!0);return{textDivs:v}}static update(g){const w=`matrix(${g.viewport.transform.join(",")})`;g.div.style.transform=w,g.div.hidden=!1}}o.XfaLayer=n},(R,o,t)=>{var S,s,m,d,x,v,b,y,C,P,D,I,h,E,N,Un,A,Wn,O,Hn,_,zn,K,un,st,$n,ct,dn,it,Gn,U,Vn,f,Xn,u,Yn,T,_n,H,ae,q,fn,ft,Ie,vt,Oe,Wt,fe,Nt,pn,dt,De,pt,Kn,It,gn,Xt,Jn,Vt,Qn,Jt,mn,$t,Fe,Z,pe;Object.defineProperty(o,"__esModule",{value:!0}),o.InkEditor=void 0,t(89),t(2);var e=t(1),n=t(164),l=t(198),g=t(168),w=t(165);const mt=class extends n.AnnotationEditor{constructor(z){super({...z,name:"inkEditor"});X(this,N);X(this,A);X(this,O);X(this,_);X(this,K);X(this,st);X(this,ct);X(this,it);X(this,U);X(this,f);X(this,u);X(this,T);X(this,H);X(this,q);X(this,ft);X(this,vt);X(this,Wt);X(this,Nt);X(this,dt);X(this,Vt);X(this,Jt);X(this,$t);X(this,Z);X(this,S,0);X(this,s,0);X(this,m,this.canvasPointermove.bind(this));X(this,d,this.canvasPointerleave.bind(this));X(this,x,this.canvasPointerup.bind(this));X(this,v,this.canvasPointerdown.bind(this));X(this,b,new Path2D);X(this,y,!1);X(this,C,!1);X(this,P,!1);X(this,D,null);X(this,I,0);X(this,h,0);X(this,E,null);this.color=z.color||null,this.thickness=z.thickness||null,this.opacity=z.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(z){n.AnnotationEditor.initialize(z,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(z,gt){switch(z){case e.AnnotationEditorParamsType.INK_THICKNESS:mt._defaultThickness=gt;break;case e.AnnotationEditorParamsType.INK_COLOR:mt._defaultColor=gt;break;case e.AnnotationEditorParamsType.INK_OPACITY:mt._defaultOpacity=gt/100;break}}updateParams(z,gt){switch(z){case e.AnnotationEditorParamsType.INK_THICKNESS:j(this,N,Un).call(this,gt);break;case e.AnnotationEditorParamsType.INK_COLOR:j(this,A,Wn).call(this,gt);break;case e.AnnotationEditorParamsType.INK_OPACITY:j(this,O,Hn).call(this,gt);break}}static get defaultPropertiesToUpdate(){return[[e.AnnotationEditorParamsType.INK_THICKNESS,mt._defaultThickness],[e.AnnotationEditorParamsType.INK_COLOR,mt._defaultColor||n.AnnotationEditor._defaultLineColor],[e.AnnotationEditorParamsType.INK_OPACITY,Math.round(mt._defaultOpacity*100)]]}get propertiesToUpdate(){var z;return[[e.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||mt._defaultThickness],[e.AnnotationEditorParamsType.INK_COLOR,this.color||mt._defaultColor||n.AnnotationEditor._defaultLineColor],[e.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*((z=this.opacity)!=null?z:mt._defaultOpacity))]]}rebuild(){!this.parent||(super.rebuild(),this.div!==null&&(this.canvas||(j(this,ft,Ie).call(this),j(this,vt,Oe).call(this)),this.isAttachedToDOM||(this.parent.add(this),j(this,Wt,fe).call(this)),j(this,Z,pe).call(this)))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,r(this,D).disconnect(),ot(this,D,null),super.remove())}setParent(z){!this.parent&&z?this._uiManager.removeShouldRescale(this):this.parent&&z===null&&this._uiManager.addShouldRescale(this),super.setParent(z)}onScaleChanging(){const[z,gt]=this.parentDimensions,xt=this.width*z,St=this.height*gt;this.setDimensions(xt,St)}enableEditMode(){r(this,y)||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",r(this,v)))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",r(this,v)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){r(this,y)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),ot(this,y,!0),this.div.classList.add("disabled"),j(this,Z,pe).call(this,!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(z){!this._focusEventsAllowed||(super.focusin(z),this.enableEditMode())}canvasPointerdown(z){z.button!==0||!this.isInEditMode()||r(this,y)||(this.setInForeground(),z.preventDefault(),z.type!=="mouse"&&this.div.focus(),j(this,st,$n).call(this,z.offsetX,z.offsetY))}canvasPointermove(z){z.preventDefault(),j(this,ct,dn).call(this,z.offsetX,z.offsetY)}canvasPointerup(z){z.preventDefault(),j(this,q,fn).call(this,z)}canvasPointerleave(z){j(this,q,fn).call(this,z)}get isResizable(){return!this.isEmpty()&&r(this,y)}render(){if(this.div)return this.div;let z,gt;this.width&&(z=this.x,gt=this.y),super.render(),n.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then(Ht=>{var Tt;return(Tt=this.div)==null?void 0:Tt.setAttribute("aria-label",Ht)});const[xt,St,Pt,bt]=j(this,_,zn).call(this);if(this.setAt(xt,St,0,0),this.setDims(Pt,bt),j(this,ft,Ie).call(this),this.width){const[Ht,Tt]=this.parentDimensions;this.setAspectRatio(this.width*Ht,this.height*Tt),this.setAt(z*Ht,gt*Tt,this.width*Ht,this.height*Tt),ot(this,P,!0),j(this,Wt,fe).call(this),this.setDims(this.width*Ht,this.height*Tt),j(this,H,ae).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return j(this,vt,Oe).call(this),this.div}setDimensions(z,gt){const xt=Math.round(z),St=Math.round(gt);if(r(this,I)===xt&&r(this,h)===St)return;ot(this,I,xt),ot(this,h,St),this.canvas.style.visibility="hidden";const[Pt,bt]=this.parentDimensions;this.width=z/Pt,this.height=gt/bt,this.fixAndSetPosition(),r(this,y)&&j(this,Nt,pn).call(this,z,gt),j(this,Wt,fe).call(this),j(this,H,ae).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(z,gt,xt){var Q,et,ht;if(z instanceof l.InkAnnotationElement)return null;const St=super.deserialize(z,gt,xt);St.thickness=z.thickness,St.color=e.Util.makeHexColor(...z.color),St.opacity=z.opacity;const[Pt,bt]=St.pageDimensions,Ht=St.width*Pt,Tt=St.height*bt,Lt=St.parentScale,Ft=z.thickness/2;ot(St,y,!0),ot(St,I,Math.round(Ht)),ot(St,h,Math.round(Tt));const{paths:$,rect:a,rotation:L}=z;for(let{bezier:Ct}of $){Ct=j(Q=mt,Xt,Jn).call(Q,Ct,a,L);const Ot=[];St.paths.push(Ot);let Mt=Lt*(Ct[0]-Ft),Qt=Lt*(Ct[1]-Ft);for(let Bt=2,_t=Ct.length;Bt<_t;Bt+=6){const Yt=Lt*(Ct[Bt]-Ft),qt=Lt*(Ct[Bt+1]-Ft),te=Lt*(Ct[Bt+2]-Ft),re=Lt*(Ct[Bt+3]-Ft),ne=Lt*(Ct[Bt+4]-Ft),se=Lt*(Ct[Bt+5]-Ft);Ot.push([[Mt,Qt],[Yt,qt],[te,re],[ne,se]]),Mt=ne,Qt=se}const Ut=j(this,pt,Kn).call(this,Ot);St.bezierPath2D.push(Ut)}const V=j(et=St,Jt,mn).call(et);return ot(St,s,Math.max(n.AnnotationEditor.MIN_SIZE,V[2]-V[0])),ot(St,S,Math.max(n.AnnotationEditor.MIN_SIZE,V[3]-V[1])),j(ht=St,Nt,pn).call(ht,Ht,Tt),St}serialize(){if(this.isEmpty())return null;const z=this.getRect(0,0),gt=n.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:e.AnnotationEditorType.INK,color:gt,thickness:this.thickness,opacity:this.opacity,paths:j(this,Vt,Qn).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,z),pageIndex:this.pageIndex,rect:z,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};let k=mt;S=new WeakMap,s=new WeakMap,m=new WeakMap,d=new WeakMap,x=new WeakMap,v=new WeakMap,b=new WeakMap,y=new WeakMap,C=new WeakMap,P=new WeakMap,D=new WeakMap,I=new WeakMap,h=new WeakMap,E=new WeakMap,N=new WeakSet,Un=function(z){const gt=this.thickness;this.addCommands({cmd:()=>{this.thickness=z,j(this,Z,pe).call(this)},undo:()=>{this.thickness=gt,j(this,Z,pe).call(this)},mustExec:!0,type:e.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},A=new WeakSet,Wn=function(z){const gt=this.color;this.addCommands({cmd:()=>{this.color=z,j(this,H,ae).call(this)},undo:()=>{this.color=gt,j(this,H,ae).call(this)},mustExec:!0,type:e.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},O=new WeakSet,Hn=function(z){z/=100;const gt=this.opacity;this.addCommands({cmd:()=>{this.opacity=z,j(this,H,ae).call(this)},undo:()=>{this.opacity=gt,j(this,H,ae).call(this)},mustExec:!0,type:e.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},_=new WeakSet,zn=function(){const{parentRotation:z,parentDimensions:[gt,xt]}=this;switch(z){case 90:return[0,xt,xt,gt];case 180:return[gt,xt,gt,xt];case 270:return[gt,0,xt,gt];default:return[0,0,gt,xt]}},K=new WeakSet,un=function(){const{ctx:z,color:gt,opacity:xt,thickness:St,parentScale:Pt,scaleFactor:bt}=this;z.lineWidth=St*Pt/bt,z.lineCap="round",z.lineJoin="round",z.miterLimit=10,z.strokeStyle=`${gt}${(0,w.opacityToHex)(xt)}`},st=new WeakSet,$n=function(z,gt){var xt;this.canvas.addEventListener("contextmenu",g.noContextMenu),this.canvas.addEventListener("pointerleave",r(this,d)),this.canvas.addEventListener("pointermove",r(this,m)),this.canvas.addEventListener("pointerup",r(this,x)),this.canvas.removeEventListener("pointerdown",r(this,v)),this.isEditing=!0,r(this,P)||(ot(this,P,!0),j(this,Wt,fe).call(this),this.thickness||(this.thickness=mt._defaultThickness),this.color||(this.color=mt._defaultColor||n.AnnotationEditor._defaultLineColor),(xt=this.opacity)!=null||(this.opacity=mt._defaultOpacity)),this.currentPath.push([z,gt]),ot(this,C,!1),j(this,K,un).call(this),ot(this,E,()=>{j(this,f,Xn).call(this),r(this,E)&&window.requestAnimationFrame(r(this,E))}),window.requestAnimationFrame(r(this,E))},ct=new WeakSet,dn=function(z,gt){const[xt,St]=this.currentPath.at(-1);if(this.currentPath.length>1&&z===xt&&gt===St)return;const Pt=this.currentPath;let bt=r(this,b);if(Pt.push([z,gt]),ot(this,C,!0),Pt.length<=2){bt.moveTo(...Pt[0]),bt.lineTo(z,gt);return}Pt.length===3&&(ot(this,b,bt=new Path2D),bt.moveTo(...Pt[0])),j(this,u,Yn).call(this,bt,...Pt.at(-3),...Pt.at(-2),z,gt)},it=new WeakSet,Gn=function(){if(this.currentPath.length===0)return;const z=this.currentPath.at(-1);r(this,b).lineTo(...z)},U=new WeakSet,Vn=function(z,gt){ot(this,E,null),z=Math.min(Math.max(z,0),this.canvas.width),gt=Math.min(Math.max(gt,0),this.canvas.height),j(this,ct,dn).call(this,z,gt),j(this,it,Gn).call(this);let xt;if(this.currentPath.length!==1)xt=j(this,T,_n).call(this);else{const Tt=[z,gt];xt=[[Tt,Tt.slice(),Tt.slice(),Tt]]}const St=r(this,b),Pt=this.currentPath;this.currentPath=[],ot(this,b,new Path2D);const bt=()=>{this.allRawPaths.push(Pt),this.paths.push(xt),this.bezierPath2D.push(St),this.rebuild()},Ht=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(j(this,ft,Ie).call(this),j(this,vt,Oe).call(this)),j(this,Z,pe).call(this))};this.addCommands({cmd:bt,undo:Ht,mustExec:!0})},f=new WeakSet,Xn=function(){if(!r(this,C))return;ot(this,C,!1);const z=Math.ceil(this.thickness*this.parentScale),gt=this.currentPath.slice(-3),xt=gt.map(bt=>bt[0]),St=gt.map(bt=>bt[1]);Math.min(...xt)-z,Math.max(...xt)+z,Math.min(...St)-z,Math.max(...St)+z;const{ctx:Pt}=this;Pt.save(),Pt.clearRect(0,0,this.canvas.width,this.canvas.height);for(const bt of this.bezierPath2D)Pt.stroke(bt);Pt.stroke(r(this,b)),Pt.restore()},u=new WeakSet,Yn=function(z,gt,xt,St,Pt,bt,Ht){const Tt=(gt+St)/2,Lt=(xt+Pt)/2,Ft=(St+bt)/2,$=(Pt+Ht)/2;z.bezierCurveTo(Tt+2*(St-Tt)/3,Lt+2*(Pt-Lt)/3,Ft+2*(St-Ft)/3,$+2*(Pt-$)/3,Ft,$)},T=new WeakSet,_n=function(){const z=this.currentPath;if(z.length<=2)return[[z[0],z[0],z.at(-1),z.at(-1)]];const gt=[];let xt,[St,Pt]=z[0];for(xt=1;xt<z.length-2;xt++){const[a,L]=z[xt],[V,Q]=z[xt+1],et=(a+V)/2,ht=(L+Q)/2,Ct=[St+2*(a-St)/3,Pt+2*(L-Pt)/3],Ot=[et+2*(a-et)/3,ht+2*(L-ht)/3];gt.push([[St,Pt],Ct,Ot,[et,ht]]),[St,Pt]=[et,ht]}const[bt,Ht]=z[xt],[Tt,Lt]=z[xt+1],Ft=[St+2*(bt-St)/3,Pt+2*(Ht-Pt)/3],$=[Tt+2*(bt-Tt)/3,Lt+2*(Ht-Lt)/3];return gt.push([[St,Pt],Ft,$,[Tt,Lt]]),gt},H=new WeakSet,ae=function(){if(this.isEmpty()){j(this,dt,De).call(this);return}j(this,K,un).call(this);const{canvas:z,ctx:gt}=this;gt.setTransform(1,0,0,1,0,0),gt.clearRect(0,0,z.width,z.height),j(this,dt,De).call(this);for(const xt of this.bezierPath2D)gt.stroke(xt)},q=new WeakSet,fn=function(z){this.canvas.removeEventListener("pointerleave",r(this,d)),this.canvas.removeEventListener("pointermove",r(this,m)),this.canvas.removeEventListener("pointerup",r(this,x)),this.canvas.addEventListener("pointerdown",r(this,v)),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",g.noContextMenu)},10),j(this,U,Vn).call(this,z.offsetX,z.offsetY),this.addToAnnotationStorage(),this.setInBackground()},ft=new WeakSet,Ie=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",n.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(z=>{var gt;return(gt=this.canvas)==null?void 0:gt.setAttribute("aria-label",z)}),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},vt=new WeakSet,Oe=function(){ot(this,D,new ResizeObserver(z=>{const gt=z[0].contentRect;gt.width&&gt.height&&this.setDimensions(gt.width,gt.height)})),r(this,D).observe(this.div)},Wt=new WeakSet,fe=function(){if(!r(this,P))return;const[z,gt]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*z),this.canvas.height=Math.ceil(this.height*gt),j(this,dt,De).call(this)},Nt=new WeakSet,pn=function(z,gt){const xt=j(this,$t,Fe).call(this),St=(z-xt)/r(this,s),Pt=(gt-xt)/r(this,S);this.scaleFactor=Math.min(St,Pt)},dt=new WeakSet,De=function(){const z=j(this,$t,Fe).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+z,this.translationY*this.scaleFactor+z)},pt=new WeakSet,Kn=function(z){const gt=new Path2D;for(let xt=0,St=z.length;xt<St;xt++){const[Pt,bt,Ht,Tt]=z[xt];xt===0&&gt.moveTo(...Pt),gt.bezierCurveTo(bt[0],bt[1],Ht[0],Ht[1],Tt[0],Tt[1])}return gt},It=new WeakSet,gn=function(z,gt,xt){const[St,Pt,bt,Ht]=gt;switch(xt){case 0:for(let Tt=0,Lt=z.length;Tt<Lt;Tt+=2)z[Tt]+=St,z[Tt+1]=Ht-z[Tt+1];break;case 90:for(let Tt=0,Lt=z.length;Tt<Lt;Tt+=2){const Ft=z[Tt];z[Tt]=z[Tt+1]+St,z[Tt+1]=Ft+Pt}break;case 180:for(let Tt=0,Lt=z.length;Tt<Lt;Tt+=2)z[Tt]=bt-z[Tt],z[Tt+1]+=Pt;break;case 270:for(let Tt=0,Lt=z.length;Tt<Lt;Tt+=2){const Ft=z[Tt];z[Tt]=bt-z[Tt+1],z[Tt+1]=Ht-Ft}break;default:throw new Error("Invalid rotation")}return z},Xt=new WeakSet,Jn=function(z,gt,xt){const[St,Pt,bt,Ht]=gt;switch(xt){case 0:for(let Tt=0,Lt=z.length;Tt<Lt;Tt+=2)z[Tt]-=St,z[Tt+1]=Ht-z[Tt+1];break;case 90:for(let Tt=0,Lt=z.length;Tt<Lt;Tt+=2){const Ft=z[Tt];z[Tt]=z[Tt+1]-Pt,z[Tt+1]=Ft-St}break;case 180:for(let Tt=0,Lt=z.length;Tt<Lt;Tt+=2)z[Tt]=bt-z[Tt],z[Tt+1]-=Pt;break;case 270:for(let Tt=0,Lt=z.length;Tt<Lt;Tt+=2){const Ft=z[Tt];z[Tt]=Ht-z[Tt+1],z[Tt+1]=bt-Ft}break;default:throw new Error("Invalid rotation")}return z},Vt=new WeakSet,Qn=function(z,gt,xt,St){var Lt,Ft;const Pt=[],bt=this.thickness/2,Ht=z*gt+bt,Tt=z*xt+bt;for(const $ of this.paths){const a=[],L=[];for(let V=0,Q=$.length;V<Q;V++){const[et,ht,Ct,Ot]=$[V],Mt=z*et[0]+Ht,Qt=z*et[1]+Tt,Ut=z*ht[0]+Ht,Bt=z*ht[1]+Tt,_t=z*Ct[0]+Ht,Yt=z*Ct[1]+Tt,qt=z*Ot[0]+Ht,te=z*Ot[1]+Tt;V===0&&(a.push(Mt,Qt),L.push(Mt,Qt)),a.push(Ut,Bt,_t,Yt,qt,te),L.push(Ut,Bt),V===Q-1&&L.push(qt,te)}Pt.push({bezier:j(Lt=mt,It,gn).call(Lt,a,St,this.rotation),points:j(Ft=mt,It,gn).call(Ft,L,St,this.rotation)})}return Pt},Jt=new WeakSet,mn=function(){let z=1/0,gt=-1/0,xt=1/0,St=-1/0;for(const Pt of this.paths)for(const[bt,Ht,Tt,Lt]of Pt){const Ft=e.Util.bezierBoundingBox(...bt,...Ht,...Tt,...Lt);z=Math.min(z,Ft[0]),xt=Math.min(xt,Ft[1]),gt=Math.max(gt,Ft[2]),St=Math.max(St,Ft[3])}return[z,xt,gt,St]},$t=new WeakSet,Fe=function(){return r(this,y)?Math.ceil(this.thickness*this.parentScale):0},Z=new WeakSet,pe=function(){let z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.isEmpty())return;if(!r(this,y)){j(this,H,ae).call(this);return}const gt=j(this,Jt,mn).call(this),xt=j(this,$t,Fe).call(this);ot(this,s,Math.max(n.AnnotationEditor.MIN_SIZE,gt[2]-gt[0])),ot(this,S,Math.max(n.AnnotationEditor.MIN_SIZE,gt[3]-gt[1]));const St=Math.ceil(xt+r(this,s)*this.scaleFactor),Pt=Math.ceil(xt+r(this,S)*this.scaleFactor),[bt,Ht]=this.parentDimensions;this.width=St/bt,this.height=Pt/Ht,this.setAspectRatio(St,Pt);const Tt=this.translationX,Lt=this.translationY;this.translationX=-gt[0],this.translationY=-gt[1],j(this,Wt,fe).call(this),j(this,H,ae).call(this),ot(this,I,St),ot(this,h,Pt),this.setDims(St,Pt);const Ft=z?xt/this.scaleFactor/2:0;this.translate(Tt-this.translationX-Ft,Lt-this.translationY-Ft)},X(k,pt),X(k,It),X(k,Xt),ee(k,"_defaultColor",null),ee(k,"_defaultOpacity",1),ee(k,"_defaultThickness",1),ee(k,"_type","ink"),o.InkEditor=k},(R,o,t)=>{var k,S,s,m,d,x,v,b,y,C,P,Se,I,Ee,E,Le,M,vn,F,Zn,G,jn,B,bn,rt,Ne,Y,qn;Object.defineProperty(o,"__esModule",{value:!0}),o.StampEditor=void 0,t(149),t(152);var e=t(1),n=t(164),l=t(168),g=t(198);const nt=class extends n.AnnotationEditor{constructor(U){super({...U,name:"stampEditor"});X(this,P);X(this,I);X(this,E);X(this,M);X(this,F);X(this,G);X(this,B);X(this,rt);X(this,Y);X(this,k,null);X(this,S,null);X(this,s,null);X(this,m,null);X(this,d,null);X(this,x,null);X(this,v,null);X(this,b,null);X(this,y,!1);X(this,C,!1);ot(this,m,U.bitmapUrl),ot(this,d,U.bitmapFile)}static initialize(U){n.AnnotationEditor.initialize(U)}static get supportedTypes(){const U=["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"];return(0,e.shadow)(this,"supportedTypes",U.map(c=>`image/${c}`))}static get supportedTypesStr(){return(0,e.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(U){return this.supportedTypes.includes(U)}static paste(U,c){c.pasteEditor(e.AnnotationEditorType.STAMP,{bitmapFile:U.getAsFile()})}remove(){var U,c;r(this,S)&&(ot(this,k,null),this._uiManager.imageManager.deleteId(r(this,S)),(U=r(this,x))==null||U.remove(),ot(this,x,null),(c=r(this,v))==null||c.disconnect(),ot(this,v,null)),super.remove()}rebuild(){if(!this.parent){r(this,S)&&j(this,E,Le).call(this);return}super.rebuild(),this.div!==null&&(r(this,S)&&j(this,E,Le).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(r(this,s)||r(this,k)||r(this,m)||r(this,d))}get isResizable(){return!0}render(){if(this.div)return this.div;let U,c;if(this.width&&(U=this.x,c=this.y),super.render(),this.div.hidden=!0,r(this,k)?j(this,M,vn).call(this):j(this,E,Le).call(this),this.width){const[f,i]=this.parentDimensions;this.setAt(U*f,c*i,this.width*f,this.height*i)}return this.div}static deserialize(U,c,f){if(U instanceof g.StampAnnotationElement)return null;const i=super.deserialize(U,c,f),{rect:u,bitmapUrl:p,bitmapId:T,isSvg:W,accessibilityData:H}=U;T&&f.imageManager.isValidId(T)?ot(i,S,T):ot(i,m,p),ot(i,y,W);const[tt,q]=i.pageDimensions;return i.width=(u[2]-u[0])/tt,i.height=(u[3]-u[1])/q,H&&(i.altTextData=H),i}serialize(){let U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.isEmpty())return null;const f={annotationType:e.AnnotationEditorType.STAMP,bitmapId:r(this,S),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:r(this,y),structTreeParentId:this._structTreeParentId};if(U)return f.bitmapUrl=j(this,rt,Ne).call(this,!0),f.accessibilityData=this.altTextData,f;const{decorative:i,altText:u}=this.altTextData;if(!i&&u&&(f.accessibilityData={type:"Figure",alt:u}),c===null)return f;c.stamps||(c.stamps=new Map);const p=r(this,y)?(f.rect[2]-f.rect[0])*(f.rect[3]-f.rect[1]):null;if(!c.stamps.has(r(this,S)))c.stamps.set(r(this,S),{area:p,serialized:f}),f.bitmap=j(this,rt,Ne).call(this,!1);else if(r(this,y)){const T=c.stamps.get(r(this,S));p>T.area&&(T.area=p,T.serialized.bitmap.close(),T.serialized.bitmap=j(this,rt,Ne).call(this,!1))}return f}};let w=nt;k=new WeakMap,S=new WeakMap,s=new WeakMap,m=new WeakMap,d=new WeakMap,x=new WeakMap,v=new WeakMap,b=new WeakMap,y=new WeakMap,C=new WeakMap,P=new WeakSet,Se=function(U){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!U){this.remove();return}ot(this,k,U.bitmap),c||(ot(this,S,U.id),ot(this,y,U.isSvg)),j(this,M,vn).call(this)},I=new WeakSet,Ee=function(){ot(this,s,null),this._uiManager.enableWaiting(!1),r(this,x)&&this.div.focus()},E=new WeakSet,Le=function(){if(r(this,S)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(r(this,S)).then(c=>j(this,P,Se).call(this,c,!0)).finally(()=>j(this,I,Ee).call(this));return}if(r(this,m)){const c=r(this,m);ot(this,m,null),this._uiManager.enableWaiting(!0),ot(this,s,this._uiManager.imageManager.getFromUrl(c).then(f=>j(this,P,Se).call(this,f)).finally(()=>j(this,I,Ee).call(this)));return}if(r(this,d)){const c=r(this,d);ot(this,d,null),this._uiManager.enableWaiting(!0),ot(this,s,this._uiManager.imageManager.getFromFile(c).then(f=>j(this,P,Se).call(this,f)).finally(()=>j(this,I,Ee).call(this)));return}const U=document.createElement("input");U.type="file",U.accept=nt.supportedTypesStr,ot(this,s,new Promise(c=>{U.addEventListener("change",async()=>{if(!U.files||U.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const f=await this._uiManager.imageManager.getFromFile(U.files[0]);j(this,P,Se).call(this,f)}c()}),U.addEventListener("cancel",()=>{this.remove(),c()})}).finally(()=>j(this,I,Ee).call(this))),U.click()},M=new WeakSet,vn=function(){const{div:U}=this;let{width:c,height:f}=r(this,k);const[i,u]=this.pageDimensions,p=.75;if(this.width)c=this.width*i,f=this.height*u;else if(c>p*i||f>p*u){const tt=Math.min(p*i/c,p*u/f);c*=tt,f*=tt}const[T,W]=this.parentDimensions;this.setDims(c*T/i,f*W/u),this._uiManager.enableWaiting(!1);const H=ot(this,x,document.createElement("canvas"));U.append(H),U.hidden=!1,j(this,B,bn).call(this,c,f),j(this,Y,qn).call(this),r(this,C)||(this.parent.addUndoableEditor(this),ot(this,C,!0)),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()},F=new WeakSet,Zn=function(U,c){var p;const[f,i]=this.parentDimensions;this.width=U/f,this.height=c/i,this.setDims(U,c),(p=this._initialOptions)!=null&&p.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,r(this,b)!==null&&clearTimeout(r(this,b)),ot(this,b,setTimeout(()=>{ot(this,b,null),j(this,B,bn).call(this,U,c)},200))},G=new WeakSet,jn=function(U,c){const{width:f,height:i}=r(this,k);let u=f,p=i,T=r(this,k);for(;u>2*U||p>2*c;){const W=u,H=p;u>2*U&&(u=u>=16384?Math.floor(u/2)-1:Math.ceil(u/2)),p>2*c&&(p=p>=16384?Math.floor(p/2)-1:Math.ceil(p/2));const tt=new OffscreenCanvas(u,p);tt.getContext("2d").drawImage(T,0,0,W,H,0,0,u,p),T=tt.transferToImageBitmap()}return T},B=new WeakSet,bn=function(U,c){U=Math.ceil(U),c=Math.ceil(c);const f=r(this,x);if(!f||f.width===U&&f.height===c)return;f.width=U,f.height=c;const i=r(this,y)?r(this,k):j(this,G,jn).call(this,U,c),u=f.getContext("2d");u.filter=this._uiManager.hcmFilter,u.drawImage(i,0,0,i.width,i.height,0,0,U,c)},rt=new WeakSet,Ne=function(U){if(U){if(r(this,y)){const i=this._uiManager.imageManager.getSvgUrl(r(this,S));if(i)return i}const c=document.createElement("canvas");return{width:c.width,height:c.height}=r(this,k),c.getContext("2d").drawImage(r(this,k),0,0),c.toDataURL()}if(r(this,y)){const[c,f]=this.pageDimensions,i=Math.round(this.width*c*l.PixelsPerInch.PDF_TO_CSS_UNITS),u=Math.round(this.height*f*l.PixelsPerInch.PDF_TO_CSS_UNITS),p=new OffscreenCanvas(i,u);return p.getContext("2d").drawImage(r(this,k),0,0,r(this,k).width,r(this,k).height,0,0,i,u),p.transferToImageBitmap()}return structuredClone(r(this,k))},Y=new WeakSet,qn=function(){ot(this,v,new ResizeObserver(U=>{const c=U[0].contentRect;c.width&&c.height&&j(this,F,Zn).call(this,c.width,c.height)})),r(this,v).observe(this.div)},ee(w,"_type","stamp"),o.StampEditor=w}],__webpack_module_cache__={};function __w_pdfjs_require__(R){var o=__webpack_module_cache__[R];if(o!==void 0)return o.exports;var t=__webpack_module_cache__[R]={exports:{}};return __webpack_modules__[R].call(t.exports,t,t.exports,__w_pdfjs_require__),t.exports}var __webpack_exports__={};return(()=>{var R=__webpack_exports__;Object.defineProperty(R,"__esModule",{value:!0}),Object.defineProperty(R,"AbortException",{enumerable:!0,get:function(){return o.AbortException}}),Object.defineProperty(R,"AnnotationEditorLayer",{enumerable:!0,get:function(){return l.AnnotationEditorLayer}}),Object.defineProperty(R,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return o.AnnotationEditorParamsType}}),Object.defineProperty(R,"AnnotationEditorType",{enumerable:!0,get:function(){return o.AnnotationEditorType}}),Object.defineProperty(R,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return g.AnnotationEditorUIManager}}),Object.defineProperty(R,"AnnotationLayer",{enumerable:!0,get:function(){return w.AnnotationLayer}}),Object.defineProperty(R,"AnnotationMode",{enumerable:!0,get:function(){return o.AnnotationMode}}),Object.defineProperty(R,"CMapCompressionType",{enumerable:!0,get:function(){return o.CMapCompressionType}}),Object.defineProperty(R,"DOMSVGFactory",{enumerable:!0,get:function(){return e.DOMSVGFactory}}),Object.defineProperty(R,"FeatureTest",{enumerable:!0,get:function(){return o.FeatureTest}}),Object.defineProperty(R,"GlobalWorkerOptions",{enumerable:!0,get:function(){return k.GlobalWorkerOptions}}),Object.defineProperty(R,"ImageKind",{enumerable:!0,get:function(){return o.ImageKind}}),Object.defineProperty(R,"InvalidPDFException",{enumerable:!0,get:function(){return o.InvalidPDFException}}),Object.defineProperty(R,"MissingPDFException",{enumerable:!0,get:function(){return o.MissingPDFException}}),Object.defineProperty(R,"OPS",{enumerable:!0,get:function(){return o.OPS}}),Object.defineProperty(R,"PDFDataRangeTransport",{enumerable:!0,get:function(){return t.PDFDataRangeTransport}}),Object.defineProperty(R,"PDFDateString",{enumerable:!0,get:function(){return e.PDFDateString}}),Object.defineProperty(R,"PDFWorker",{enumerable:!0,get:function(){return t.PDFWorker}}),Object.defineProperty(R,"PasswordResponses",{enumerable:!0,get:function(){return o.PasswordResponses}}),Object.defineProperty(R,"PermissionFlag",{enumerable:!0,get:function(){return o.PermissionFlag}}),Object.defineProperty(R,"PixelsPerInch",{enumerable:!0,get:function(){return e.PixelsPerInch}}),Object.defineProperty(R,"PromiseCapability",{enumerable:!0,get:function(){return o.PromiseCapability}}),Object.defineProperty(R,"RenderingCancelledException",{enumerable:!0,get:function(){return e.RenderingCancelledException}}),Object.defineProperty(R,"SVGGraphics",{enumerable:!0,get:function(){return t.SVGGraphics}}),Object.defineProperty(R,"UnexpectedResponseException",{enumerable:!0,get:function(){return o.UnexpectedResponseException}}),Object.defineProperty(R,"Util",{enumerable:!0,get:function(){return o.Util}}),Object.defineProperty(R,"VerbosityLevel",{enumerable:!0,get:function(){return o.VerbosityLevel}}),Object.defineProperty(R,"XfaLayer",{enumerable:!0,get:function(){return S.XfaLayer}}),Object.defineProperty(R,"build",{enumerable:!0,get:function(){return t.build}}),Object.defineProperty(R,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return o.createValidAbsoluteUrl}}),Object.defineProperty(R,"getDocument",{enumerable:!0,get:function(){return t.getDocument}}),Object.defineProperty(R,"getFilenameFromUrl",{enumerable:!0,get:function(){return e.getFilenameFromUrl}}),Object.defineProperty(R,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return e.getPdfFilenameFromUrl}}),Object.defineProperty(R,"getXfaPageViewport",{enumerable:!0,get:function(){return e.getXfaPageViewport}}),Object.defineProperty(R,"isDataScheme",{enumerable:!0,get:function(){return e.isDataScheme}}),Object.defineProperty(R,"isPdfFile",{enumerable:!0,get:function(){return e.isPdfFile}}),Object.defineProperty(R,"loadScript",{enumerable:!0,get:function(){return e.loadScript}}),Object.defineProperty(R,"noContextMenu",{enumerable:!0,get:function(){return e.noContextMenu}}),Object.defineProperty(R,"normalizeUnicode",{enumerable:!0,get:function(){return o.normalizeUnicode}}),Object.defineProperty(R,"renderTextLayer",{enumerable:!0,get:function(){return n.renderTextLayer}}),Object.defineProperty(R,"setLayerDimensions",{enumerable:!0,get:function(){return e.setLayerDimensions}}),Object.defineProperty(R,"shadow",{enumerable:!0,get:function(){return o.shadow}}),Object.defineProperty(R,"updateTextLayer",{enumerable:!0,get:function(){return n.updateTextLayer}}),Object.defineProperty(R,"version",{enumerable:!0,get:function(){return t.version}});var o=__w_pdfjs_require__(1),t=__w_pdfjs_require__(124),e=__w_pdfjs_require__(168),n=__w_pdfjs_require__(195),l=__w_pdfjs_require__(196),g=__w_pdfjs_require__(165),w=__w_pdfjs_require__(198),k=__w_pdfjs_require__(176),S=__w_pdfjs_require__(201)})(),__webpack_exports__})())})(pdf);const SEAL="/assets/seal.2b0b8e60.png";export{SEAL as S,pdf as p};