Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

10 rindas
385KB

  1. var or=Object.defineProperty,lr=Object.defineProperties;var cr=Object.getOwnPropertyDescriptors;var kn=Object.getOwnPropertySymbols;var hr=Object.prototype.hasOwnProperty,ur=Object.prototype.propertyIsEnumerable;var ze=Math.pow,He=(C,i,t)=>i in C?or(C,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):C[i]=t,me=(C,i)=>{for(var t in i||(i={}))hr.call(i,t)&&He(C,t,i[t]);if(kn)for(var t of kn(i))ur.call(i,t)&&He(C,t,i[t]);return C},Ce=(C,i)=>lr(C,cr(i));var ne=(C,i,t)=>(He(C,typeof i!="symbol"?i+"":i,t),t),$e=(C,i,t)=>{if(!i.has(C))throw TypeError("Cannot "+t)};var r=(C,i,t)=>($e(C,i,"read from private field"),t?t.call(C):i.get(C)),X=(C,i,t)=>{if(i.has(C))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(C):i.set(C,t)},at=(C,i,t,e)=>($e(C,i,"write to private field"),e?e.call(C,t):i.set(C,t),t),ve=(C,i,t,e)=>({set _(n){at(C,i,n,t)},get _(){return r(C,i,e)}}),j=(C,i,t)=>($e(C,i,"access private method"),t);var ee=(C,i,t)=>new Promise((e,n)=>{var o=x=>{try{F(t.next(x))}catch(A){n(A)}},y=x=>{try{F(t.throw(x))}catch(A){n(A)}},F=x=>x.done?e(x.value):Promise.resolve(x.value).then(o,y);F((t=t.apply(C,i)).next())});import{ah as getAugmentedNamespace,ai as commonjsGlobal}from"./index.3fb2f955.js";function commonjsRequire(C){throw new Error('Could not dynamically require "'+C+'". 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(){var C={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=/([astvzqmhlc])([^astvzqmhlc]*)/gi,t=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function e(u){const l=u.match(t);return l?l.map(Number):[]}function n(u){const l=[],f=String(u).trim();return f[0]!=="M"&&f[0]!=="m"||f.replace(i,(v,R,M)=>{const c=e(M);let g=R.toLowerCase(),L=R;if(g==="m"&&c.length>2&&(l.push([L,...c.splice(0,2)]),g="l",L=L==="m"?"l":"L"),c.length<C[g])return"";for(l.push([L,...c.splice(0,C[g])]);c.length>=C[g]&&c.length&&C[g];)l.push([L,...c.splice(0,C[g])]);return""}),l}function o(u,l){const f=u.x*Math.cos(l)-u.y*Math.sin(l),v=u.y*Math.cos(l)+u.x*Math.sin(l);u.x=f,u.y=v}function y(u,l,f){u.x+=l,u.y+=f}function F(u,l){u.x*=l,u.y*=l}var x=class Ge{constructor(l){this.commands=[],l&&l instanceof Ge?this.commands.push(...l.commands):l&&(this.commands=n(l))}addPath(l){l&&l instanceof Ge&&this.commands.push(...l.commands)}moveTo(l,f){this.commands.push(["M",l,f])}lineTo(l,f){this.commands.push(["L",l,f])}arc(l,f,v,R,M,c){this.commands.push(["AC",l,f,v,R,M,!!c])}arcTo(l,f,v,R,M){this.commands.push(["AT",l,f,v,R,M])}ellipse(l,f,v,R,M,c,g,L){this.commands.push(["E",l,f,v,R,M,c,g,!!L])}closePath(){this.commands.push(["Z"])}bezierCurveTo(l,f,v,R,M,c){this.commands.push(["C",l,f,v,R,M,c])}quadraticCurveTo(l,f,v,R){this.commands.push(["Q",l,f,v,R])}rect(l,f,v,R){this.commands.push(["R",l,f,v,R])}roundRect(l,f,v,R,M){typeof M>"u"?this.commands.push(["RR",l,f,v,R,0]):this.commands.push(["RR",l,f,v,R,M])}};function A(u,l){let f=0,v=0,R,M,c,g,L,P,b,N,O,G,K,W,_,nt,rt,Y,it,ft,bt,Rt,H,h=null,m=null,s=null,d=null,S=null,D=null;u.beginPath();for(let U=0;U<l.length;++U){ft=l[U][0],ft!=="S"&&ft!=="s"&&ft!=="C"&&ft!=="c"&&(h=null,m=null),ft!=="T"&&ft!=="t"&&ft!=="Q"&&ft!=="q"&&(s=null,d=null);let w;switch(ft){case"m":case"M":w=l[U],ft==="m"?(f+=w[1],v+=w[2]):(f=w[1],v=w[2]),(ft==="M"||!S)&&(S={x:f,y:v}),u.moveTo(f,v);break;case"l":w=l[U],f+=w[1],v+=w[2],u.lineTo(f,v);break;case"L":w=l[U],f=w[1],v=w[2],u.lineTo(f,v);break;case"H":w=l[U],f=w[1],u.lineTo(f,v);break;case"h":w=l[U],f+=w[1],u.lineTo(f,v);break;case"V":w=l[U],v=w[1],u.lineTo(f,v);break;case"v":w=l[U],v+=w[1],u.lineTo(f,v);break;case"a":case"A":if(w=l[U],D===null)throw new Error("This should never happen");ft==="a"?(f+=w[6],v+=w[7]):(f=w[6],v=w[7]),nt=w[1],rt=w[2],b=w[3]*Math.PI/180,c=!!w[4],g=!!w[5],L={x:f,y:v},P={x:(D.x-L.x)/2,y:(D.y-L.y)/2},o(P,-b),N=P.x*P.x/(nt*nt)+P.y*P.y/(rt*rt),N>1&&(N=Math.sqrt(N),nt*=N,rt*=N),bt={x:nt*P.y/rt,y:-(rt*P.x)/nt},O=nt*nt*rt*rt,G=nt*nt*P.y*P.y+rt*rt*P.x*P.x,g!==c?F(bt,Math.sqrt((O-G)/G)||0):F(bt,-Math.sqrt((O-G)/G)||0),M=Math.atan2((P.y-bt.y)/rt,(P.x-bt.x)/nt),R=Math.atan2(-(P.y+bt.y)/rt,-(P.x+bt.x)/nt),o(bt,b),y(bt,(L.x+D.x)/2,(L.y+D.y)/2),u.save(),u.translate(bt.x,bt.y),u.rotate(b),u.scale(nt,rt),u.arc(0,0,1,M,R,!g),u.restore();break;case"C":w=l[U],h=w[3],m=w[4],f=w[5],v=w[6],u.bezierCurveTo(w[1],w[2],h,m,f,v);break;case"c":w=l[U],u.bezierCurveTo(w[1]+f,w[2]+v,w[3]+f,w[4]+v,w[5]+f,w[6]+v),h=w[3]+f,m=w[4]+v,f+=w[5],v+=w[6];break;case"S":w=l[U],(h===null||m===null)&&(h=f,m=v),u.bezierCurveTo(2*f-h,2*v-m,w[1],w[2],w[3],w[4]),h=w[1],m=w[2],f=w[3],v=w[4];break;case"s":w=l[U],(h===null||m===null)&&(h=f,m=v),u.bezierCurveTo(2*f-h,2*v-m,w[1]+f,w[2]+v,w[3]+f,w[4]+v),h=w[1]+f,m=w[2]+v,f+=w[3],v+=w[4];break;case"Q":w=l[U],s=w[1],d=w[2],f=w[3],v=w[4],u.quadraticCurveTo(s,d,f,v);break;case"q":w=l[U],s=w[1]+f,d=w[2]+v,f+=w[3],v+=w[4],u.quadraticCurveTo(s,d,f,v);break;case"T":w=l[U],(s===null||d===null)&&(s=f,d=v),s=2*f-s,d=2*v-d,f=w[1],v=w[2],u.quadraticCurveTo(s,d,f,v);break;case"t":w=l[U],(s===null||d===null)&&(s=f,d=v),s=2*f-s,d=2*v-d,f+=w[1],v+=w[2],u.quadraticCurveTo(s,d,f,v);break;case"z":case"Z":S&&(f=S.x,v=S.y),S=null,u.closePath();break;case"AC":w=l[U],f=w[1],v=w[2],_=w[3],M=w[4],R=w[5],Rt=w[6],u.arc(f,v,_,M,R,Rt);break;case"AT":w=l[U],K=w[1],W=w[2],f=w[3],v=w[4],_=w[5],u.arcTo(K,W,f,v,_);break;case"E":w=l[U],f=w[1],v=w[2],nt=w[3],rt=w[4],b=w[5],M=w[6],R=w[7],Rt=w[8],u.save(),u.translate(f,v),u.rotate(b),u.scale(nt,rt),u.arc(0,0,1,M,R,Rt),u.restore();break;case"R":w=l[U],f=w[1],v=w[2],Y=w[3],it=w[4],S={x:f,y:v},u.rect(f,v,Y,it);break;case"RR":w=l[U],f=w[1],v=w[2],Y=w[3],it=w[4],H=w[5],S={x:f,y:v},u.roundRect(f,v,Y,it,H);break;default:throw new Error("Invalid path command: ".concat(ft))}D?(D.x=f,D.y=v):D={x:f,y:v}}}function p(u,l,f,v){let R=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(typeof R=="number"&&(R=[R]),Array.isArray(R)){if(R.length===0||R.length>4)throw new RangeError("Failed to execute 'roundRect' on '".concat(this.constructor.name,"': ").concat(R.length," radii provided. Between one and four radii are necessary."));R.forEach(b=>{if(b<0)throw new RangeError("Failed to execute 'roundRect' on '".concat(this.constructor.name,"': Radius value ").concat(b," is negative."))})}else return;if(R.length===1&&R[0]===0){this.rect(u,l,f,v);return}const M=Math.min(f,v)/2,c=Math.min(M,R[0]);let g=c,L=c,P=c;R.length===2&&(g=Math.min(M,R[1]),P=g),R.length===3&&(g=Math.min(M,R[1]),P=g,L=Math.min(M,R[2])),R.length===4&&(g=Math.min(M,R[1]),L=Math.min(M,R[2]),P=Math.min(M,R[3])),this.moveTo(u,l+v-P),this.arcTo(u,l,u+c,l,c),this.arcTo(u+f,l,u+f,l+g,g),this.arcTo(u+f,l+v,u+f-L,l+v,L),this.arcTo(u,l+v,u,l+v-P,P),this.moveTo(u,l)}function I(u){if(!u)return;const l=u.prototype.fill,f=u.prototype.stroke,v=u.prototype.isPointInPath;u.prototype.fill=function(){if((arguments.length<=0?void 0:arguments[0])instanceof x){const M=arguments.length<=0?void 0:arguments[0],c=(arguments.length<=1?void 0:arguments[1])||"nonzero";return A(this,M.commands),l.apply(this,[c])}const R=(arguments.length<=0?void 0:arguments[0])||"nonzero";return l.apply(this,[R])},u.prototype.stroke=function(R){R&&A(this,R.commands),f.apply(this)},u.prototype.isPointInPath=function(){for(var R=arguments.length,M=new Array(R),c=0;c<R;c++)M[c]=arguments[c];if(M[0]instanceof x){const g=M[0],L=M[1],P=M[2],b=M[3]||"nonzero";return A(this,g.commands),v.apply(this,[L,P,b])}return v.apply(this,M)}}function E(u){u&&!u.prototype.roundRect&&(u.prototype.roundRect=p)}function k(u){u&&!u.prototype.roundRect&&(u.prototype.roundRect=p)}function T(){window&&(window.CanvasRenderingContext2D&&!window.Path2D&&(window.Path2D=x,I(window.CanvasRenderingContext2D)),k(window.Path2D),E(window.CanvasRenderingContext2D))}T()}()),path2dPolyfill_min}(function(module,exports){(function(i,t){module.exports=i.pdfjsLib=t()})(globalThis,()=>(()=>{var __webpack_modules__=[,(C,i,t)=>{var Gt;Object.defineProperty(i,"__esModule",{value:!0}),i.VerbosityLevel=i.Util=i.UnknownErrorException=i.UnexpectedResponseException=i.TextRenderingMode=i.RenderingIntentFlag=i.PromiseCapability=i.PermissionFlag=i.PasswordResponses=i.PasswordException=i.PageActionEventType=i.OPS=i.MissingPDFException=i.MAX_IMAGE_SIZE_TO_CACHE=i.LINE_FACTOR=i.LINE_DESCENT_FACTOR=i.InvalidPDFException=i.ImageKind=i.IDENTITY_MATRIX=i.FormatError=i.FeatureTest=i.FONT_IDENTITY_MATRIX=i.DocumentActionEventType=i.CMapCompressionType=i.BaseException=i.BASELINE_FACTOR=i.AnnotationType=i.AnnotationReplyType=i.AnnotationPrefix=i.AnnotationMode=i.AnnotationFlag=i.AnnotationFieldFlag=i.AnnotationEditorType=i.AnnotationEditorPrefix=i.AnnotationEditorParamsType=i.AnnotationBorderStyleType=i.AnnotationActionEventType=i.AbortException=void 0,i.assert=ft,i.bytesToString=tt,i.createValidAbsoluteUrl=Rt,i.getModificationDate=Ht,i.getUuid=Jt,i.getVerbosityLevel=nt,i.info=rt,i.isArrayBuffer=It,i.isArrayEqual=wt,i.isNodeJS=void 0,i.normalizeUnicode=Kt,i.objectFromMap=Et,i.objectSize=ut,i.setVerbosityLevel=_,i.shadow=H,i.string32=ct,i.stringToBytes=q,i.stringToPDFString=ht,i.stringToUTF8String=st,i.unreachable=it,i.utf8StringToString=dt,i.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");i.isNodeJS=e;const n=[1,0,0,1,0,0];i.IDENTITY_MATRIX=n;const o=[.001,0,0,.001,0,0];i.FONT_IDENTITY_MATRIX=o;const y=1e7;i.MAX_IMAGE_SIZE_TO_CACHE=y;const F=1.35;i.LINE_FACTOR=F;const x=.35;i.LINE_DESCENT_FACTOR=x;const A=x/F;i.BASELINE_FACTOR=A;const p={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};i.RenderingIntentFlag=p;const I={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};i.AnnotationMode=I;const E="pdfjs_internal_editor_";i.AnnotationEditorPrefix=E;const k={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};i.AnnotationEditorType=k;const T={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};i.AnnotationEditorParamsType=T;const u={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};i.PermissionFlag=u;const l={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};i.TextRenderingMode=l;const f={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};i.ImageKind=f;const v={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};i.AnnotationType=v;const R={GROUP:"Group",REPLY:"R"};i.AnnotationReplyType=R;const M={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};i.AnnotationFlag=M;const c={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};i.AnnotationFieldFlag=c;const g={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};i.AnnotationBorderStyleType=g;const L={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"};i.AnnotationActionEventType=L;const P={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};i.DocumentActionEventType=P;const b={O:"PageOpen",C:"PageClose"};i.PageActionEventType=b;const N={ERRORS:0,WARNINGS:1,INFOS:5};i.VerbosityLevel=N;const O={NONE:0,BINARY:1};i.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};i.OPS=G;const K={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};i.PasswordResponses=K;let W=N.WARNINGS;function _(yt){Number.isInteger(yt)&&(W=yt)}function nt(){return W}function rt(yt){W>=N.INFOS&&console.log(`Info: ${yt}`)}function Y(yt){W>=N.WARNINGS&&console.log(`Warning: ${yt}`)}function it(yt){throw new Error(yt)}function ft(yt,Z){yt||it(Z)}function bt(yt){switch(yt==null?void 0:yt.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function Rt(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=st(yt)}catch(jt){}}const pt=Z?new URL(yt,Z):new URL(yt);if(bt(pt))return pt}catch(pt){}return null}function H(yt,Z,J){let pt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return Object.defineProperty(yt,Z,{value:J,enumerable:!pt,configurable:!0,writable:!1}),J}const h=function(){function Z(J,pt){this.constructor===Z&&it("Cannot initialize BaseException."),this.message=J,this.name=pt}return Z.prototype=new Error,Z.constructor=Z,Z}();i.BaseException=h;class m extends h{constructor(Z,J){super(Z,"PasswordException"),this.code=J}}i.PasswordException=m;class s extends h{constructor(Z,J){super(Z,"UnknownErrorException"),this.details=J}}i.UnknownErrorException=s;class d extends h{constructor(Z){super(Z,"InvalidPDFException")}}i.InvalidPDFException=d;class S extends h{constructor(Z){super(Z,"MissingPDFException")}}i.MissingPDFException=S;class D extends h{constructor(Z,J){super(Z,"UnexpectedResponseException"),this.status=J}}i.UnexpectedResponseException=D;class U extends h{constructor(Z){super(Z,"FormatError")}}i.FormatError=U;class w extends h{constructor(Z){super(Z,"AbortException")}}i.AbortException=w;function tt(yt){(typeof yt!="object"||(yt==null?void 0:yt.length)===void 0)&&it("Invalid argument for bytesToString");const Z=yt.length,J=8192;if(Z<J)return String.fromCharCode.apply(null,yt);const pt=[];for(let jt=0;jt<Z;jt+=J){const ot=Math.min(jt+J,Z),z=yt.subarray(jt,ot);pt.push(String.fromCharCode.apply(null,z))}return pt.join("")}function q(yt){typeof yt!="string"&&it("Invalid argument for stringToBytes");const Z=yt.length,J=new Uint8Array(Z);for(let pt=0;pt<Z;++pt)J[pt]=yt.charCodeAt(pt)&255;return J}function ct(yt){return String.fromCharCode(yt>>24&255,yt>>16&255,yt>>8&255,yt&255)}function ut(yt){return Object.keys(yt).length}function Et(yt){const Z=Object.create(null);for(const[J,pt]of yt)Z[J]=pt;return Z}function mt(){const yt=new Uint8Array(4);return yt[0]=1,new Uint32Array(yt.buffer,0,1)[0]===1}function Ot(){try{return new Function(""),!0}catch(yt){return!1}}class Wt{static get isLittleEndian(){return H(this,"isLittleEndian",mt())}static get isEvalSupported(){return H(this,"isEvalSupported",Ot())}static get isOffscreenCanvasSupported(){return H(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas!="undefined")}static get platform(){return typeof navigator=="undefined"?H(this,"platform",{isWin:!1,isMac:!1}):H(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var Z,J;return H(this,"isCSSRoundSupported",(J=(Z=globalThis.CSS)==null?void 0:Z.supports)==null?void 0:J.call(Z,"width: round(1.5px, 1px)"))}}i.FeatureTest=Wt;const Pt=[...Array(256).keys()].map(yt=>yt.toString(16).padStart(2,"0"));class Nt{static makeHexColor(Z,J,pt){return`#${Pt[Z]}${Pt[J]}${Pt[pt]}`}static scaleMinMax(Z,J){let pt;Z[0]?(Z[0]<0&&(pt=J[0],J[0]=J[1],J[1]=pt),J[0]*=Z[0],J[1]*=Z[0],Z[3]<0&&(pt=J[2],J[2]=J[3],J[3]=pt),J[2]*=Z[3],J[3]*=Z[3]):(pt=J[0],J[0]=J[2],J[2]=pt,pt=J[1],J[1]=J[3],J[3]=pt,Z[1]<0&&(pt=J[2],J[2]=J[3],J[3]=pt),J[2]*=Z[1],J[3]*=Z[1],Z[2]<0&&(pt=J[0],J[0]=J[1],J[1]=pt),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 pt=Z[0]*J[0]+Z[1]*J[2]+J[4],jt=Z[0]*J[1]+Z[1]*J[3]+J[5];return[pt,jt]}static applyInverseTransform(Z,J){const pt=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])/pt,ot=(-Z[0]*J[1]+Z[1]*J[0]+J[4]*J[1]-J[5]*J[0])/pt;return[jt,ot]}static getAxialAlignedBoundingBox(Z,J){const pt=this.applyTransform(Z,J),jt=this.applyTransform(Z.slice(2,4),J),ot=this.applyTransform([Z[0],Z[3]],J),z=this.applyTransform([Z[2],Z[1]],J);return[Math.min(pt[0],jt[0],ot[0],z[0]),Math.min(pt[1],jt[1],ot[1],z[1]),Math.max(pt[0],jt[0],ot[0],z[0]),Math.max(pt[1],jt[1],ot[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]],pt=Z[0]*J[0]+Z[1]*J[2],jt=Z[0]*J[1]+Z[1]*J[3],ot=Z[2]*J[0]+Z[3]*J[2],z=Z[2]*J[1]+Z[3]*J[3],gt=(pt+z)/2,xt=Math.sqrt(ze(pt+z,2)-4*(pt*z-ot*jt))/2,St=gt+xt||1,kt=gt-xt||1;return[Math.sqrt(St),Math.sqrt(kt)]}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 pt=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(pt>jt)return null;const ot=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 ot>z?null:[pt,ot,jt,z]}static bezierBoundingBox(Z,J,pt,jt,ot,z,gt,xt){const St=[],kt=[[],[]];let vt,zt,Tt,Lt,Dt,$,a,B;for(let lt=0;lt<2;++lt){if(lt===0?(zt=6*Z-12*pt+6*ot,vt=-3*Z+9*pt-9*ot+3*gt,Tt=3*pt-3*Z):(zt=6*J-12*jt+6*z,vt=-3*J+9*jt-9*z+3*xt,Tt=3*jt-3*J),Math.abs(vt)<1e-12){if(Math.abs(zt)<1e-12)continue;Lt=-Tt/zt,0<Lt&&Lt<1&&St.push(Lt);continue}a=zt*zt-4*Tt*vt,B=Math.sqrt(a),!(a<0)&&(Dt=(-zt+B)/(2*vt),0<Dt&&Dt<1&&St.push(Dt),$=(-zt-B)/(2*vt),0<$&&$<1&&St.push($))}let V=St.length,Q;const et=V;for(;V--;)Lt=St[V],Q=1-Lt,kt[0][V]=Q*Q*Q*Z+3*Q*Q*Lt*pt+3*Q*Lt*Lt*ot+Lt*Lt*Lt*gt,kt[1][V]=Q*Q*Q*J+3*Q*Q*Lt*jt+3*Q*Lt*Lt*z+Lt*Lt*Lt*xt;return kt[0][et]=Z,kt[1][et]=J,kt[0][et+1]=gt,kt[1][et+1]=xt,kt[0].length=kt[1].length=et+2,[Math.min(...kt[0]),Math.min(...kt[1]),Math.max(...kt[0]),Math.max(...kt[1])]}}i.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 ht(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 pt=new TextDecoder(J,{fatal:!0}),jt=q(yt);return pt.decode(jt)}catch(pt){Y(`stringToPDFString: "${pt}".`)}}const Z=[];for(let J=0,pt=yt.length;J<pt;J++){const jt=At[yt.charCodeAt(J)];Z.push(jt?String.fromCharCode(jt):yt.charAt(J))}return Z.join("")}function st(yt){return decodeURIComponent(escape(yt))}function dt(yt){return unescape(encodeURIComponent(yt))}function It(yt){return typeof yt=="object"&&(yt==null?void 0:yt.byteLength)!==void 0}function wt(yt,Z){if(yt.length!==Z.length)return!1;for(let J=0,pt=yt.length;J<pt;J++)if(yt[J]!==Z[J])return!1;return!0}function Ht(){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,Gt,!1);this.promise=new Promise((Z,J)=>{this.resolve=pt=>{at(this,Gt,!0),Z(pt)},this.reject=pt=>{at(this,Gt,!0),J(pt)}})}get settled(){return r(this,Gt)}}Gt=new WeakMap,i.PromiseCapability=Xt;let $t=null,Vt=null;function Kt(yt){return $t||($t=/([\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($t,(Z,J,pt)=>J?J.normalize("NFKC"):Vt.get(pt))}function Jt(){if(typeof crypto!="undefined"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const yt=new Uint8Array(32);if(typeof crypto!="undefined"&&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_";i.AnnotationPrefix=Zt},(C,i,t)=>{var e=t(3),n=t(4),o=t(69),y=t(70),F="WebAssembly",x=n[F],A=Error("e",{cause:7}).cause!==7,p=function(E,k){var T={};T[E]=y(E,k,A),e({global:!0,constructor:!0,arity:1,forced:A},T)},I=function(E,k){if(x&&x[E]){var T={};T[E]=y(F+"."+E,k,A),e({target:F,stat:!0,constructor:!0,arity:1,forced:A},T)}};p("Error",function(E){return function(T){return o(E,this,arguments)}}),p("EvalError",function(E){return function(T){return o(E,this,arguments)}}),p("RangeError",function(E){return function(T){return o(E,this,arguments)}}),p("ReferenceError",function(E){return function(T){return o(E,this,arguments)}}),p("SyntaxError",function(E){return function(T){return o(E,this,arguments)}}),p("TypeError",function(E){return function(T){return o(E,this,arguments)}}),p("URIError",function(E){return function(T){return o(E,this,arguments)}}),I("CompileError",function(E){return function(T){return o(E,this,arguments)}}),I("LinkError",function(E){return function(T){return o(E,this,arguments)}}),I("RuntimeError",function(E){return function(T){return o(E,this,arguments)}})},(C,i,t)=>{var e=t(4),n=t(5).f,o=t(44),y=t(48),F=t(38),x=t(56),A=t(68);C.exports=function(p,I){var E=p.target,k=p.global,T=p.stat,u,l,f,v,R,M;if(k?l=e:T?l=e[E]||F(E,{}):l=(e[E]||{}).prototype,l)for(f in I){if(R=I[f],p.dontCallGetSet?(M=n(l,f),v=M&&M.value):v=l[f],u=A(k?f:E+(T?".":"#")+f,p.forced),!u&&v!==void 0){if(typeof R==typeof v)continue;x(R,v)}(p.sham||v&&v.sham)&&o(R,"sham",!0),y(l,f,R,p)}}},function(C){var i=function(t){return t&&t.Math===Math&&t};C.exports=i(typeof globalThis=="object"&&globalThis)||i(typeof window=="object"&&window)||i(typeof self=="object"&&self)||i(typeof commonjsGlobal=="object"&&commonjsGlobal)||function(){return this}()||this||Function("return this")()},(C,i,t)=>{var e=t(6),n=t(8),o=t(10),y=t(11),F=t(12),x=t(18),A=t(39),p=t(42),I=Object.getOwnPropertyDescriptor;i.f=e?I:function(k,T){if(k=F(k),T=x(T),p)try{return I(k,T)}catch(u){}if(A(k,T))return y(!n(o.f,k,T),k[T])}},(C,i,t)=>{var e=t(7);C.exports=!e(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})},C=>{C.exports=function(i){try{return!!i()}catch(t){return!0}}},(C,i,t)=>{var e=t(9),n=Function.prototype.call;C.exports=e?n.bind(n):function(){return n.apply(n,arguments)}},(C,i,t)=>{var e=t(7);C.exports=!e(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})},(C,i)=>{var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,n=e&&!t.call({1:2},1);i.f=n?function(y){var F=e(this,y);return!!F&&F.enumerable}:t},C=>{C.exports=function(i,t){return{enumerable:!(i&1),configurable:!(i&2),writable:!(i&4),value:t}}},(C,i,t)=>{var e=t(13),n=t(16);C.exports=function(o){return e(n(o))}},(C,i,t)=>{var e=t(14),n=t(7),o=t(15),y=Object,F=e("".split);C.exports=n(function(){return!y("z").propertyIsEnumerable(0)})?function(x){return o(x)==="String"?F(x,""):y(x)}:y},(C,i,t)=>{var e=t(9),n=Function.prototype,o=n.call,y=e&&n.bind.bind(o,o);C.exports=e?y:function(F){return function(){return o.apply(F,arguments)}}},(C,i,t)=>{var e=t(14),n=e({}.toString),o=e("".slice);C.exports=function(y){return o(n(y),8,-1)}},(C,i,t)=>{var e=t(17),n=TypeError;C.exports=function(o){if(e(o))throw n("Can't call method on "+o);return o}},C=>{C.exports=function(i){return i==null}},(C,i,t)=>{var e=t(19),n=t(23);C.exports=function(o){var y=e(o,"string");return n(y)?y:y+""}},(C,i,t)=>{var e=t(8),n=t(20),o=t(23),y=t(30),F=t(33),x=t(34),A=TypeError,p=x("toPrimitive");C.exports=function(I,E){if(!n(I)||o(I))return I;var k=y(I,p),T;if(k){if(E===void 0&&(E="default"),T=e(k,I,E),!n(T)||o(T))return T;throw A("Can't convert object to primitive value")}return E===void 0&&(E="number"),F(I,E)}},(C,i,t)=>{var e=t(21),n=t(22),o=n.all;C.exports=n.IS_HTMLDDA?function(y){return typeof y=="object"?y!==null:e(y)||y===o}:function(y){return typeof y=="object"?y!==null:e(y)}},(C,i,t)=>{var e=t(22),n=e.all;C.exports=e.IS_HTMLDDA?function(o){return typeof o=="function"||o===n}:function(o){return typeof o=="function"}},C=>{var i=typeof document=="object"&&document.all,t=typeof i=="undefined"&&i!==void 0;C.exports={all:i,IS_HTMLDDA:t}},(C,i,t)=>{var e=t(24),n=t(21),o=t(25),y=t(26),F=Object;C.exports=y?function(x){return typeof x=="symbol"}:function(x){var A=e("Symbol");return n(A)&&o(A.prototype,F(x))}},(C,i,t)=>{var e=t(4),n=t(21),o=function(y){return n(y)?y:void 0};C.exports=function(y,F){return arguments.length<2?o(e[y]):e[y]&&e[y][F]}},(C,i,t)=>{var e=t(14);C.exports=e({}.isPrototypeOf)},(C,i,t)=>{var e=t(27);C.exports=e&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},(C,i,t)=>{var e=t(28),n=t(7),o=t(4),y=o.String;C.exports=!!Object.getOwnPropertySymbols&&!n(function(){var F=Symbol("symbol detection");return!y(F)||!(Object(F)instanceof Symbol)||!Symbol.sham&&e&&e<41})},(C,i,t)=>{var e=t(4),n=t(29),o=e.process,y=e.Deno,F=o&&o.versions||y&&y.version,x=F&&F.v8,A,p;x&&(A=x.split("."),p=A[0]>0&&A[0]<4?1:+(A[0]+A[1])),!p&&n&&(A=n.match(/Edge\/(\d+)/),(!A||A[1]>=74)&&(A=n.match(/Chrome\/(\d+)/),A&&(p=+A[1]))),C.exports=p},C=>{C.exports=typeof navigator!="undefined"&&String(navigator.userAgent)||""},(C,i,t)=>{var e=t(31),n=t(17);C.exports=function(o,y){var F=o[y];return n(F)?void 0:e(F)}},(C,i,t)=>{var e=t(21),n=t(32),o=TypeError;C.exports=function(y){if(e(y))return y;throw o(n(y)+" is not a function")}},C=>{var i=String;C.exports=function(t){try{return i(t)}catch(e){return"Object"}}},(C,i,t)=>{var e=t(8),n=t(21),o=t(20),y=TypeError;C.exports=function(F,x){var A,p;if(x==="string"&&n(A=F.toString)&&!o(p=e(A,F))||n(A=F.valueOf)&&!o(p=e(A,F))||x!=="string"&&n(A=F.toString)&&!o(p=e(A,F)))return p;throw y("Can't convert object to primitive value")}},(C,i,t)=>{var e=t(4),n=t(35),o=t(39),y=t(41),F=t(27),x=t(26),A=e.Symbol,p=n("wks"),I=x?A.for||A:A&&A.withoutSetter||y;C.exports=function(E){return o(p,E)||(p[E]=F&&o(A,E)?A[E]:I("Symbol."+E)),p[E]}},(C,i,t)=>{var e=t(36),n=t(37);(C.exports=function(o,y){return n[o]||(n[o]=y!==void 0?y:{})})("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"})},C=>{C.exports=!1},(C,i,t)=>{var e=t(4),n=t(38),o="__core-js_shared__",y=e[o]||n(o,{});C.exports=y},(C,i,t)=>{var e=t(4),n=Object.defineProperty;C.exports=function(o,y){try{n(e,o,{value:y,configurable:!0,writable:!0})}catch(F){e[o]=y}return y}},(C,i,t)=>{var e=t(14),n=t(40),o=e({}.hasOwnProperty);C.exports=Object.hasOwn||function(F,x){return o(n(F),x)}},(C,i,t)=>{var e=t(16),n=Object;C.exports=function(o){return n(e(o))}},(C,i,t)=>{var e=t(14),n=0,o=Math.random(),y=e(1 .toString);C.exports=function(F){return"Symbol("+(F===void 0?"":F)+")_"+y(++n+o,36)}},(C,i,t)=>{var e=t(6),n=t(7),o=t(43);C.exports=!e&&!n(function(){return Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a!==7})},(C,i,t)=>{var e=t(4),n=t(20),o=e.document,y=n(o)&&n(o.createElement);C.exports=function(F){return y?o.createElement(F):{}}},(C,i,t)=>{var e=t(6),n=t(45),o=t(11);C.exports=e?function(y,F,x){return n.f(y,F,o(1,x))}:function(y,F,x){return y[F]=x,y}},(C,i,t)=>{var e=t(6),n=t(42),o=t(46),y=t(47),F=t(18),x=TypeError,A=Object.defineProperty,p=Object.getOwnPropertyDescriptor,I="enumerable",E="configurable",k="writable";i.f=e?o?function(u,l,f){if(y(u),l=F(l),y(f),typeof u=="function"&&l==="prototype"&&"value"in f&&k in f&&!f[k]){var v=p(u,l);v&&v[k]&&(u[l]=f.value,f={configurable:E in f?f[E]:v[E],enumerable:I in f?f[I]:v[I],writable:!1})}return A(u,l,f)}:A:function(u,l,f){if(y(u),l=F(l),y(f),n)try{return A(u,l,f)}catch(v){}if("get"in f||"set"in f)throw x("Accessors not supported");return"value"in f&&(u[l]=f.value),u}},(C,i,t)=>{var e=t(6),n=t(7);C.exports=e&&n(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})},(C,i,t)=>{var e=t(20),n=String,o=TypeError;C.exports=function(y){if(e(y))return y;throw o(n(y)+" is not an object")}},(C,i,t)=>{var e=t(21),n=t(45),o=t(49),y=t(38);C.exports=function(F,x,A,p){p||(p={});var I=p.enumerable,E=p.name!==void 0?p.name:x;if(e(A)&&o(A,E,p),p.global)I?F[x]=A:y(x,A);else{try{p.unsafe?F[x]&&(I=!0):delete F[x]}catch(k){}I?F[x]=A:n.f(F,x,{value:A,enumerable:!1,configurable:!p.nonConfigurable,writable:!p.nonWritable})}return F}},(C,i,t)=>{var e=t(14),n=t(7),o=t(21),y=t(39),F=t(6),x=t(50).CONFIGURABLE,A=t(51),p=t(52),I=p.enforce,E=p.get,k=String,T=Object.defineProperty,u=e("".slice),l=e("".replace),f=e([].join),v=F&&!n(function(){return T(function(){},"length",{value:8}).length!==8}),R=String(String).split("String"),M=C.exports=function(c,g,L){u(k(g),0,7)==="Symbol("&&(g="["+l(k(g),/^Symbol\(([^)]*)\)/,"$1")+"]"),L&&L.getter&&(g="get "+g),L&&L.setter&&(g="set "+g),(!y(c,"name")||x&&c.name!==g)&&(F?T(c,"name",{value:g,configurable:!0}):c.name=g),v&&L&&y(L,"arity")&&c.length!==L.arity&&T(c,"length",{value:L.arity});try{L&&y(L,"constructor")&&L.constructor?F&&T(c,"prototype",{writable:!1}):c.prototype&&(c.prototype=void 0)}catch(b){}var P=I(c);return y(P,"source")||(P.source=f(R,typeof g=="string"?g:"")),c};Function.prototype.toString=M(function(){return o(this)&&E(this).source||A(this)},"toString")},(C,i,t)=>{var e=t(6),n=t(39),o=Function.prototype,y=e&&Object.getOwnPropertyDescriptor,F=n(o,"name"),x=F&&function(){}.name==="something",A=F&&(!e||e&&y(o,"name").configurable);C.exports={EXISTS:F,PROPER:x,CONFIGURABLE:A}},(C,i,t)=>{var e=t(14),n=t(21),o=t(37),y=e(Function.toString);n(o.inspectSource)||(o.inspectSource=function(F){return y(F)}),C.exports=o.inspectSource},(C,i,t)=>{var e=t(53),n=t(4),o=t(20),y=t(44),F=t(39),x=t(37),A=t(54),p=t(55),I="Object already initialized",E=n.TypeError,k=n.WeakMap,T,u,l,f=function(c){return l(c)?u(c):T(c,{})},v=function(c){return function(g){var L;if(!o(g)||(L=u(g)).type!==c)throw E("Incompatible receiver, "+c+" required");return L}};if(e||x.state){var R=x.state||(x.state=new k);R.get=R.get,R.has=R.has,R.set=R.set,T=function(c,g){if(R.has(c))throw E(I);return g.facade=c,R.set(c,g),g},u=function(c){return R.get(c)||{}},l=function(c){return R.has(c)}}else{var M=A("state");p[M]=!0,T=function(c,g){if(F(c,M))throw E(I);return g.facade=c,y(c,M,g),g},u=function(c){return F(c,M)?c[M]:{}},l=function(c){return F(c,M)}}C.exports={set:T,get:u,has:l,enforce:f,getterFor:v}},(C,i,t)=>{var e=t(4),n=t(21),o=e.WeakMap;C.exports=n(o)&&/native code/.test(String(o))},(C,i,t)=>{var e=t(35),n=t(41),o=e("keys");C.exports=function(y){return o[y]||(o[y]=n(y))}},C=>{C.exports={}},(C,i,t)=>{var e=t(39),n=t(57),o=t(5),y=t(45);C.exports=function(F,x,A){for(var p=n(x),I=y.f,E=o.f,k=0;k<p.length;k++){var T=p[k];!e(F,T)&&!(A&&e(A,T))&&I(F,T,E(x,T))}}},(C,i,t)=>{var e=t(24),n=t(14),o=t(58),y=t(67),F=t(47),x=n([].concat);C.exports=e("Reflect","ownKeys")||function(p){var I=o.f(F(p)),E=y.f;return E?x(I,E(p)):I}},(C,i,t)=>{var e=t(59),n=t(66),o=n.concat("length","prototype");i.f=Object.getOwnPropertyNames||function(F){return e(F,o)}},(C,i,t)=>{var e=t(14),n=t(39),o=t(12),y=t(60).indexOf,F=t(55),x=e([].push);C.exports=function(A,p){var I=o(A),E=0,k=[],T;for(T in I)!n(F,T)&&n(I,T)&&x(k,T);for(;p.length>E;)n(I,T=p[E++])&&(~y(k,T)||x(k,T));return k}},(C,i,t)=>{var e=t(12),n=t(61),o=t(64),y=function(F){return function(x,A,p){var I=e(x),E=o(I),k=n(p,E),T;if(F&&A!==A){for(;E>k;)if(T=I[k++],T!==T)return!0}else for(;E>k;k++)if((F||k in I)&&I[k]===A)return F||k||0;return!F&&-1}};C.exports={includes:y(!0),indexOf:y(!1)}},(C,i,t)=>{var e=t(62),n=Math.max,o=Math.min;C.exports=function(y,F){var x=e(y);return x<0?n(x+F,0):o(x,F)}},(C,i,t)=>{var e=t(63);C.exports=function(n){var o=+n;return o!==o||o===0?0:e(o)}},C=>{var i=Math.ceil,t=Math.floor;C.exports=Math.trunc||function(n){var o=+n;return(o>0?t:i)(o)}},(C,i,t)=>{var e=t(65);C.exports=function(n){return e(n.length)}},(C,i,t)=>{var e=t(62),n=Math.min;C.exports=function(o){return o>0?n(e(o),9007199254740991):0}},C=>{C.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(C,i)=>{i.f=Object.getOwnPropertySymbols},(C,i,t)=>{var e=t(7),n=t(21),o=/#|\.prototype\./,y=function(I,E){var k=x[F(I)];return k===p?!0:k===A?!1:n(E)?e(E):!!E},F=y.normalize=function(I){return String(I).replace(o,".").toLowerCase()},x=y.data={},A=y.NATIVE="N",p=y.POLYFILL="P";C.exports=y},(C,i,t)=>{var e=t(9),n=Function.prototype,o=n.apply,y=n.call;C.exports=typeof Reflect=="object"&&Reflect.apply||(e?y.bind(o):function(){return y.apply(o,arguments)})},(C,i,t)=>{var e=t(24),n=t(39),o=t(44),y=t(25),F=t(71),x=t(56),A=t(74),p=t(75),I=t(76),E=t(80),k=t(81),T=t(6),u=t(36);C.exports=function(l,f,v,R){var M="stackTraceLimit",c=R?2:1,g=l.split("."),L=g[g.length-1],P=e.apply(null,g);if(!!P){var b=P.prototype;if(!u&&n(b,"cause")&&delete b.cause,!v)return P;var N=e("Error"),O=f(function(G,K){var W=I(R?K:G,void 0),_=R?new P(G):new P;return W!==void 0&&o(_,"message",W),k(_,O,_.stack,2),this&&y(b,this)&&p(_,this,O),arguments.length>c&&E(_,arguments[c]),_});if(O.prototype=b,L!=="Error"?F?F(O,N):x(O,N,{name:!0}):T&&M in P&&(A(O,P,M),A(O,P,"prepareStackTrace")),x(O,P),!u)try{b.name!==L&&o(b,"name",L),b.constructor=O}catch(G){}return O}}},(C,i,t)=>{var e=t(72),n=t(47),o=t(73);C.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var y=!1,F={},x;try{x=e(Object.prototype,"__proto__","set"),x(F,[]),y=F instanceof Array}catch(A){}return function(p,I){return n(p),o(I),y?x(p,I):p.__proto__=I,p}}():void 0)},(C,i,t)=>{var e=t(14),n=t(31);C.exports=function(o,y,F){try{return e(n(Object.getOwnPropertyDescriptor(o,y)[F]))}catch(x){}}},(C,i,t)=>{var e=t(21),n=String,o=TypeError;C.exports=function(y){if(typeof y=="object"||e(y))return y;throw o("Can't set "+n(y)+" as a prototype")}},(C,i,t)=>{var e=t(45).f;C.exports=function(n,o,y){y in n||e(n,y,{configurable:!0,get:function(){return o[y]},set:function(F){o[y]=F}})}},(C,i,t)=>{var e=t(21),n=t(20),o=t(71);C.exports=function(y,F,x){var A,p;return o&&e(A=F.constructor)&&A!==x&&n(p=A.prototype)&&p!==x.prototype&&o(y,p),y}},(C,i,t)=>{var e=t(77);C.exports=function(n,o){return n===void 0?arguments.length<2?"":o:e(n)}},(C,i,t)=>{var e=t(78),n=String;C.exports=function(o){if(e(o)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return n(o)}},(C,i,t)=>{var e=t(79),n=t(21),o=t(15),y=t(34),F=y("toStringTag"),x=Object,A=o(function(){return arguments}())==="Arguments",p=function(I,E){try{return I[E]}catch(k){}};C.exports=e?o:function(I){var E,k,T;return I===void 0?"Undefined":I===null?"Null":typeof(k=p(E=x(I),F))=="string"?k:A?o(E):(T=o(E))==="Object"&&n(E.callee)?"Arguments":T}},(C,i,t)=>{var e=t(34),n=e("toStringTag"),o={};o[n]="z",C.exports=String(o)==="[object z]"},(C,i,t)=>{var e=t(20),n=t(44);C.exports=function(o,y){e(y)&&"cause"in y&&n(o,"cause",y.cause)}},(C,i,t)=>{var e=t(44),n=t(82),o=t(83),y=Error.captureStackTrace;C.exports=function(F,x,A,p){o&&(y?y(F,x):e(F,"stack",n(A,p)))}},(C,i,t)=>{var e=t(14),n=Error,o=e("".replace),y=function(A){return String(n(A).stack)}("zxcasd"),F=/\n\s*at [^:]*:[^\n]*/,x=F.test(y);C.exports=function(A,p){if(x&&typeof A=="string"&&!n.prepareStackTrace)for(;p--;)A=o(A,F,"");return A}},(C,i,t)=>{var e=t(7),n=t(11);C.exports=!e(function(){var o=Error("a");return"stack"in o?(Object.defineProperty(o,"stack",n(1,7)),o.stack!==7):!0})},(C,i,t)=>{var e=t(48),n=t(14),o=t(77),y=t(85),F=URLSearchParams,x=F.prototype,A=n(x.append),p=n(x.delete),I=n(x.forEach),E=n([].push),k=new F("a=1&a=2&b=3");k.delete("a",1),k.delete("b",void 0),k+""!="a=2"&&e(x,"delete",function(T){var u=arguments.length,l=u<2?void 0:arguments[1];if(u&&l===void 0)return p(this,T);var f=[];I(this,function(b,N){E(f,{key:N,value:b})}),y(u,1);for(var v=o(T),R=o(l),M=0,c=0,g=!1,L=f.length,P;M<L;)P=f[M++],g||P.key===v?(g=!0,p(this,P.key)):c++;for(;c<L;)P=f[c++],P.key===v&&P.value===R||A(this,P.key,P.value)},{enumerable:!0,unsafe:!0})},C=>{var i=TypeError;C.exports=function(t,e){if(t<e)throw i("Not enough arguments");return t}},(C,i,t)=>{var e=t(48),n=t(14),o=t(77),y=t(85),F=URLSearchParams,x=F.prototype,A=n(x.getAll),p=n(x.has),I=new F("a=1");(I.has("a",2)||!I.has("a",void 0))&&e(x,"has",function(k){var T=arguments.length,u=T<2?void 0:arguments[1];if(T&&u===void 0)return p(this,k);var l=A(this,k);y(T,1);for(var f=o(u),v=0;v<l.length;)if(l[v++]===f)return!0;return!1},{enumerable:!0,unsafe:!0})},(C,i,t)=>{var e=t(6),n=t(14),o=t(88),y=URLSearchParams.prototype,F=n(y.forEach);e&&!("size"in y)&&o(y,"size",{get:function(){var A=0;return F(this,function(){A++}),A},configurable:!0,enumerable:!0})},(C,i,t)=>{var e=t(49),n=t(45);C.exports=function(o,y,F){return F.get&&e(F.get,y,{getter:!0}),F.set&&e(F.set,y,{setter:!0}),n.f(o,y,F)}},(C,i,t)=>{var e=t(3),n=t(40),o=t(64),y=t(90),F=t(92),x=t(7),A=x(function(){return[].push.call({length:4294967296},1)!==4294967297}),p=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(E){return E instanceof TypeError}},I=A||!p();e({target:"Array",proto:!0,arity:1,forced:I},{push:function(k){var T=n(this),u=o(T),l=arguments.length;F(u+l);for(var f=0;f<l;f++)T[u]=arguments[f],u++;return y(T,u),u}})},(C,i,t)=>{var e=t(6),n=t(91),o=TypeError,y=Object.getOwnPropertyDescriptor,F=e&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(x){return x instanceof TypeError}}();C.exports=F?function(x,A){if(n(x)&&!y(x,"length").writable)throw o("Cannot set read only .length");return x.length=A}:function(x,A){return x.length=A}},(C,i,t)=>{var e=t(15);C.exports=Array.isArray||function(o){return e(o)==="Array"}},C=>{var i=TypeError,t=9007199254740991;C.exports=function(e){if(e>t)throw i("Maximum allowed index exceeded");return e}},(C,i,t)=>{var e=t(94),n=t(98).findLast,o=e.aTypedArray,y=e.exportTypedArrayMethod;y("findLast",function(x){return n(o(this),x,arguments.length>1?arguments[1]:void 0)})},(C,i,t)=>{var e=t(95),n=t(6),o=t(4),y=t(21),F=t(20),x=t(39),A=t(78),p=t(32),I=t(44),E=t(48),k=t(88),T=t(25),u=t(96),l=t(71),f=t(34),v=t(41),R=t(52),M=R.enforce,c=R.get,g=o.Int8Array,L=g&&g.prototype,P=o.Uint8ClampedArray,b=P&&P.prototype,N=g&&u(g),O=L&&u(L),G=Object.prototype,K=o.TypeError,W=f("toStringTag"),_=v("TYPED_ARRAY_TAG"),nt="TypedArrayConstructor",rt=e&&!!l&&A(o.opera)!=="Opera",Y=!1,it,ft,bt,Rt={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},H={BigInt64Array:8,BigUint64Array:8},h=function(tt){if(!F(tt))return!1;var q=A(tt);return q==="DataView"||x(Rt,q)||x(H,q)},m=function(w){var tt=u(w);if(!!F(tt)){var q=c(tt);return q&&x(q,nt)?q[nt]:m(tt)}},s=function(w){if(!F(w))return!1;var tt=A(w);return x(Rt,tt)||x(H,tt)},d=function(w){if(s(w))return w;throw K("Target is not a typed array")},S=function(w){if(y(w)&&(!l||T(N,w)))return w;throw K(p(w)+" is not a typed array constructor")},D=function(w,tt,q,ct){if(!!n){if(q)for(var ut in Rt){var Et=o[ut];if(Et&&x(Et.prototype,w))try{delete Et.prototype[w]}catch(mt){try{Et.prototype[w]=tt}catch(Ot){}}}(!O[w]||q)&&E(O,w,q?tt:rt&&L[w]||tt,ct)}},U=function(w,tt,q){var ct,ut;if(!!n){if(l){if(q){for(ct in Rt)if(ut=o[ct],ut&&x(ut,w))try{delete ut[w]}catch(Et){}}if(!N[w]||q)try{return E(N,w,q?tt:rt&&N[w]||tt)}catch(Et){}else return}for(ct in Rt)ut=o[ct],ut&&(!ut[w]||q)&&E(ut,w,tt)}};for(it in Rt)ft=o[it],bt=ft&&ft.prototype,bt?M(bt)[nt]=ft:rt=!1;for(it in H)ft=o[it],bt=ft&&ft.prototype,bt&&(M(bt)[nt]=ft);if((!rt||!y(N)||N===Function.prototype)&&(N=function(){throw K("Incorrect invocation")},rt))for(it in Rt)o[it]&&l(o[it],N);if((!rt||!O||O===G)&&(O=N.prototype,rt))for(it in Rt)o[it]&&l(o[it].prototype,O);if(rt&&u(b)!==O&&l(b,O),n&&!x(O,W)){Y=!0,k(O,W,{configurable:!0,get:function(){return F(this)?this[_]:void 0}});for(it in Rt)o[it]&&I(o[it],_,it)}C.exports={NATIVE_ARRAY_BUFFER_VIEWS:rt,TYPED_ARRAY_TAG:Y&&_,aTypedArray:d,aTypedArrayConstructor:S,exportTypedArrayMethod:D,exportTypedArrayStaticMethod:U,getTypedArrayConstructor:m,isView:h,isTypedArray:s,TypedArray:N,TypedArrayPrototype:O}},C=>{C.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"},(C,i,t)=>{var e=t(39),n=t(21),o=t(40),y=t(54),F=t(97),x=y("IE_PROTO"),A=Object,p=A.prototype;C.exports=F?A.getPrototypeOf:function(I){var E=o(I);if(e(E,x))return E[x];var k=E.constructor;return n(k)&&E instanceof k?k.prototype:E instanceof A?p:null}},(C,i,t)=>{var e=t(7);C.exports=!e(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})},(C,i,t)=>{var e=t(99),n=t(13),o=t(40),y=t(64),F=function(x){var A=x===1;return function(p,I,E){for(var k=o(p),T=n(k),u=e(I,E),l=y(T),f,v;l-- >0;)if(f=T[l],v=u(f,l,k),v)switch(x){case 0:return f;case 1:return l}return A?-1:void 0}};C.exports={findLast:F(0),findLastIndex:F(1)}},(C,i,t)=>{var e=t(100),n=t(31),o=t(9),y=e(e.bind);C.exports=function(F,x){return n(F),x===void 0?F:o?y(F,x):function(){return F.apply(x,arguments)}}},(C,i,t)=>{var e=t(15),n=t(14);C.exports=function(o){if(e(o)==="Function")return n(o)}},(C,i,t)=>{var e=t(94),n=t(98).findLastIndex,o=e.aTypedArray,y=e.exportTypedArrayMethod;y("findLastIndex",function(x){return n(o(this),x,arguments.length>1?arguments[1]:void 0)})},(C,i,t)=>{var e=t(4),n=t(8),o=t(94),y=t(64),F=t(103),x=t(40),A=t(7),p=e.RangeError,I=e.Int8Array,E=I&&I.prototype,k=E&&E.set,T=o.aTypedArray,u=o.exportTypedArrayMethod,l=!A(function(){var v=new Uint8ClampedArray(2);return n(k,v,{length:1,0:3},1),v[1]!==3}),f=l&&o.NATIVE_ARRAY_BUFFER_VIEWS&&A(function(){var v=new I(2);return v.set(1),v.set("2",1),v[0]!==0||v[1]!==2});u("set",function(R){T(this);var M=F(arguments.length>1?arguments[1]:void 0,1),c=x(R);if(l)return n(k,this,c,M);var g=this.length,L=y(c),P=0;if(L+M>g)throw p("Wrong length");for(;P<L;)this[M+P]=c[P++]},!l||f)},(C,i,t)=>{var e=t(104),n=RangeError;C.exports=function(o,y){var F=e(o);if(F%y)throw n("Wrong offset");return F}},(C,i,t)=>{var e=t(62),n=RangeError;C.exports=function(o){var y=e(o);if(y<0)throw n("The argument can't be less than 0");return y}},(C,i,t)=>{var e=t(106),n=t(94),o=n.aTypedArray,y=n.exportTypedArrayMethod,F=n.getTypedArrayConstructor;y("toReversed",function(){return e(o(this),F(this))})},(C,i,t)=>{var e=t(64);C.exports=function(n,o){for(var y=e(n),F=new o(y),x=0;x<y;x++)F[x]=n[y-x-1];return F}},(C,i,t)=>{var e=t(94),n=t(14),o=t(31),y=t(108),F=e.aTypedArray,x=e.getTypedArrayConstructor,A=e.exportTypedArrayMethod,p=n(e.TypedArrayPrototype.sort);A("toSorted",function(E){E!==void 0&&o(E);var k=F(this),T=y(x(k),k);return p(T,E)})},(C,i,t)=>{var e=t(64);C.exports=function(n,o){for(var y=0,F=e(o),x=new n(F);F>y;)x[y]=o[y++];return x}},(C,i,t)=>{var e=t(110),n=t(94),o=t(111),y=t(62),F=t(112),x=n.aTypedArray,A=n.getTypedArrayConstructor,p=n.exportTypedArrayMethod,I=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(E){return E===8}}();p("with",function(E,k){var T=x(this),u=y(E),l=o(T)?F(k):+k;return e(T,A(T),u,l)},!I)},(C,i,t)=>{var e=t(64),n=t(62),o=RangeError;C.exports=function(y,F,x,A){var p=e(y),I=n(x),E=I<0?p+I:I;if(E>=p||E<0)throw o("Incorrect index");for(var k=new F(p),T=0;T<p;T++)k[T]=T===E?A:y[T];return k}},(C,i,t)=>{var e=t(78);C.exports=function(n){var o=e(n);return o==="BigInt64Array"||o==="BigUint64Array"}},(C,i,t)=>{var e=t(19),n=TypeError;C.exports=function(o){var y=e(o,"number");if(typeof y=="number")throw n("Can't convert number to bigint");return BigInt(y)}},(C,i,t)=>{var e=t(6),n=t(88),o=t(114),y=ArrayBuffer.prototype;e&&!("detached"in y)&&n(y,"detached",{configurable:!0,get:function(){return o(this)}})},(C,i,t)=>{var e=t(14),n=t(115),o=e(ArrayBuffer.prototype.slice);C.exports=function(y){if(n(y)!==0)return!1;try{return o(y,0,0),!1}catch(F){return!0}}},(C,i,t)=>{var e=t(72),n=t(15),o=TypeError;C.exports=e(ArrayBuffer.prototype,"byteLength","get")||function(y){if(n(y)!=="ArrayBuffer")throw o("ArrayBuffer expected");return y.byteLength}},(C,i,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)}})},(C,i,t)=>{var e=t(4),n=t(14),o=t(72),y=t(118),F=t(114),x=t(115),A=t(119),p=e.TypeError,I=e.structuredClone,E=e.ArrayBuffer,k=e.DataView,T=Math.min,u=E.prototype,l=k.prototype,f=n(u.slice),v=o(u,"resizable","get"),R=o(u,"maxByteLength","get"),M=n(l.getInt8),c=n(l.setInt8);C.exports=A&&function(g,L,P){var b=x(g),N=L===void 0?b:y(L),O=!v||!v(g);if(F(g))throw p("ArrayBuffer is detached");var G=I(g,{transfer:[g]});if(b===N&&(P||O))return G;if(b>=N&&(!P||O))return f(G,0,N);for(var K=P&&!O&&R?{maxByteLength:R(G)}:void 0,W=new E(N,K),_=new k(G),nt=new k(W),rt=T(N,b),Y=0;Y<rt;Y++)c(nt,Y,M(_,Y));return W}},(C,i,t)=>{var e=t(62),n=t(65),o=RangeError;C.exports=function(y){if(y===void 0)return 0;var F=e(y),x=n(F);if(F!==x)throw o("Wrong length or index");return x}},(C,i,t)=>{var e=t(4),n=t(7),o=t(28),y=t(120),F=t(121),x=t(122),A=e.structuredClone;C.exports=!!A&&!n(function(){if(F&&o>92||x&&o>94||y&&o>97)return!1;var p=new ArrayBuffer(8),I=A(p,{transfer:[p]});return p.byteLength!==0||I.byteLength!==8})},(C,i,t)=>{var e=t(121),n=t(122);C.exports=!e&&!n&&typeof window=="object"&&typeof document=="object"},C=>{C.exports=typeof Deno=="object"&&Deno&&typeof Deno.version=="object"},(C,i,t)=>{var e=t(4),n=t(15);C.exports=n(e.process)==="process"},(C,i,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 C,t,e,n,ue,y,ke,x,A,p,I,E,k,T,u,l,Pe,v,R,Ve,c,g;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(P){var Ht,Xt;if(typeof P=="string"||P instanceof URL?P={url:P}:(0,_util.isArrayBuffer)(P)&&(P={data:P}),typeof P!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!P.url&&!P.data&&!P.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const b=new PDFDocumentLoadingTask,{docId:N}=b,O=P.url?getUrlProp(P.url):null,G=P.data?getDataProp(P.data):null,K=P.httpHeaders||null,W=P.withCredentials===!0,_=(Ht=P.password)!=null?Ht:null,nt=P.range instanceof PDFDataRangeTransport?P.range:null,rt=Number.isInteger(P.rangeChunkSize)&&P.rangeChunkSize>0?P.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let Y=P.worker instanceof PDFWorker?P.worker:null;const it=P.verbosity,ft=typeof P.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(P.docBaseUrl)?P.docBaseUrl:null,bt=typeof P.cMapUrl=="string"?P.cMapUrl:null,Rt=P.cMapPacked!==!1,H=P.CMapReaderFactory||DefaultCMapReaderFactory,h=typeof P.standardFontDataUrl=="string"?P.standardFontDataUrl:null,m=P.StandardFontDataFactory||DefaultStandardFontDataFactory,s=P.stopAtErrors!==!0,d=Number.isInteger(P.maxImageSize)&&P.maxImageSize>-1?P.maxImageSize:-1,S=P.isEvalSupported!==!1,D=typeof P.isOffscreenCanvasSupported=="boolean"?P.isOffscreenCanvasSupported:!_util.isNodeJS,U=Number.isInteger(P.canvasMaxAreaInBytes)?P.canvasMaxAreaInBytes:-1,w=typeof P.disableFontFace=="boolean"?P.disableFontFace:_util.isNodeJS,tt=P.fontExtraProperties===!0,q=P.enableXfa===!0,ct=P.ownerDocument||globalThis.document,ut=P.disableRange===!0,Et=P.disableStream===!0,mt=P.disableAutoFetch===!0,Ot=P.pdfBug===!0,Wt=nt?nt.length:(Xt=P.length)!=null?Xt:NaN,Pt=typeof P.useSystemFonts=="boolean"?P.useSystemFonts:!_util.isNodeJS&&!w,Nt=typeof P.useWorkerFetch=="boolean"?P.useWorkerFetch:H===_display_utils.DOMCMapReaderFactory&&m===_display_utils.DOMStandardFontDataFactory&&bt&&h&&(0,_display_utils.isValidFetchUrl)(bt,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(h,document.baseURI),At=P.canvasFactory||new DefaultCanvasFactory({ownerDocument:ct}),ht=P.filterFactory||new DefaultFilterFactory({docId:N,ownerDocument:ct}),st=null;(0,_util.setVerbosityLevel)(it);const dt={canvasFactory:At,filterFactory:ht};if(Nt||(dt.cMapReaderFactory=new H({baseUrl:bt,isCompressed:Rt}),dt.standardFontDataFactory=new m({baseUrl:h})),!Y){const $t={verbosity:it,port:_worker_options.GlobalWorkerOptions.workerPort};Y=$t.port?PDFWorker.fromPort($t):new PDFWorker($t),b._worker=Y}const It={docId:N,apiVersion:"3.11.174",data:G,password:_,disableAutoFetch:mt,rangeChunkSize:rt,length:Wt,docBaseUrl:ft,enableXfa:q,evaluatorOptions:{maxImageSize:d,disableFontFace:w,ignoreErrors:s,isEvalSupported:S,isOffscreenCanvasSupported:D,canvasMaxAreaInBytes:U,fontExtraProperties:tt,useSystemFonts:Pt,cMapUrl:Nt?bt:null,standardFontDataUrl:Nt?h:null}},wt={ignoreErrors:s,isEvalSupported:S,disableFontFace:w,fontExtraProperties:tt,enableXfa:q,ownerDocument:ct,disableAutoFetch:mt,pdfBug:Ot,styleElement:st};return Y.promise.then(function(){if(b.destroyed)throw new Error("Loading aborted");const $t=_fetchDocument(Y,It),Vt=new Promise(function(Kt){let Jt;nt?Jt=new _transport_stream.PDFDataTransportStream({length:Wt,initialData:nt.initialData,progressiveDone:nt.progressiveDone,contentDispositionFilename:nt.contentDispositionFilename,disableRange:ut,disableStream:Et},nt):G||(Jt=(Gt=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(Gt):(0,_display_utils.isValidFetchUrl)(Gt.url)?new _displayFetch_stream.PDFFetchStream(Gt):new _displayNetwork.PDFNetworkStream(Gt))({url:O,length:Wt,httpHeaders:K,withCredentials:W,rangeChunkSize:rt,disableRange:ut,disableStream:Et})),Kt(Jt)});return Promise.all([$t,Vt]).then(function(Kt){let[Jt,Zt]=Kt;if(b.destroyed)throw new Error("Loading aborted");const Gt=new _message_handler.MessageHandler(N,Jt,Y.port),yt=new WorkerTransport(Gt,b,Zt,wt,dt);b._transport=yt,Gt.send("Ready",null)})}).catch(b._capability.reject),b}function _fetchDocument(P,b){return ee(this,null,function*(){if(P.destroyed)throw new Error("Worker was destroyed");const N=yield P.messageHandler.sendWithPromise("GetDocRequest",b,b.data?[b.data.buffer]:null);if(P.destroyed)throw new Error("Worker was destroyed");return N})}function getUrlProp(P){if(P instanceof URL)return P.href;try{return new URL(P,window.location).href}catch(b){if(_util.isNodeJS&&typeof P=="string")return P}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(P){if(_util.isNodeJS&&typeof Buffer!="undefined"&&P instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(P instanceof Uint8Array&&P.byteLength===P.buffer.byteLength)return P;if(typeof P=="string")return(0,_util.stringToBytes)(P);if(typeof P=="object"&&!isNaN(P==null?void 0:P.length)||(0,_util.isArrayBuffer)(P))return new Uint8Array(P);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const i=class{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${ve(i,C)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}destroy(){return ee(this,null,function*(){var b,N,O;this.destroyed=!0;try{(b=this._worker)!=null&&b.port&&(this._worker._pendingDestroy=!0),yield(N=this._transport)==null?void 0:N.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=i;C=new WeakMap,X(PDFDocumentLoadingTask,C,0),exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(b,N){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=b,this.initialData=N,this.progressiveDone=O,this.contentDispositionFilename=G,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(b){this._rangeListeners.push(b)}addProgressListener(b){this._progressListeners.push(b)}addProgressiveReadListener(b){this._progressiveReadListeners.push(b)}addProgressiveDoneListener(b){this._progressiveDoneListeners.push(b)}onDataRange(b,N){for(const O of this._rangeListeners)O(b,N)}onDataProgress(b,N){this._readyCapability.promise.then(()=>{for(const O of this._progressListeners)O(b,N)})}onDataProgressiveRead(b){this._readyCapability.promise.then(()=>{for(const N of this._progressiveReadListeners)N(b)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const b of this._progressiveDoneListeners)b()})}transportReady(){this._readyCapability.resolve()}requestDataRange(b,N){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(b,N){this._pdfInfo=b,this._transport=N,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 K in O)G.push(...O[K]);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(b){return this._transport.getPage(b)}getPageIndex(b){return this._transport.getPageIndex(b)}getDestinations(){return this._transport.getDestinations()}getDestination(b){return this._transport.getDestination(b)}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 b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this._transport.startCleanup(b||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(b,N,O){X(this,n);X(this,y);X(this,t,null);X(this,e,!1);let G=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;this._pageIndex=b,this._pageInfo=N,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:b,rotation:N=this.rotate,offsetX:O=0,offsetY:G=0,dontFlip:K=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:b,rotation:N,offsetX:O,offsetY:G,dontFlip:K})}getAnnotations(){let{intent:b="display"}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const N=this._transport.getRenderingIntent(b);return this._transport.getAnnotations(this._pageIndex,N.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)}getXfa(){return ee(this,null,function*(){var b;return((b=this._transport._htmlForXfa)==null?void 0:b.children[this._pageIndex])||null})}render(b){var s,d;let{canvasContext:N,viewport:O,intent:G="display",annotationMode:K=_util.AnnotationMode.ENABLE,transform:W=null,background:_=null,optionalContentConfigPromise:nt=null,annotationCanvasMap:rt=null,pageColors:Y=null,printAnnotationStorage:it=null}=b;(s=this._stats)==null||s.time("Overall");const ft=this._transport.getRenderingIntent(G,K,it);at(this,e,!1),j(this,y,ke).call(this),nt||(nt=this._transport.getOptionalContentConfig());let bt=this._intentStates.get(ft.cacheKey);bt||(bt=Object.create(null),this._intentStates.set(ft.cacheKey,bt)),bt.streamReaderCancelTimeout&&(clearTimeout(bt.streamReaderCancelTimeout),bt.streamReaderCancelTimeout=null);const Rt=!!(ft.renderingIntent&_util.RenderingIntentFlag.PRINT);bt.displayReadyCapability||(bt.displayReadyCapability=new _util.PromiseCapability,bt.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(d=this._stats)==null||d.time("Page Request"),this._pumpOperatorList(ft));const H=S=>{var D,U;bt.renderTasks.delete(h),(this._maybeCleanupAfterRender||Rt)&&at(this,e,!0),j(this,n,ue).call(this,!Rt),S?(h.capability.reject(S),this._abortOperatorList({intentState:bt,reason:S instanceof Error?S:new Error(S)})):h.capability.resolve(),(D=this._stats)==null||D.timeEnd("Rendering"),(U=this._stats)==null||U.timeEnd("Overall")},h=new InternalRenderTask({callback:H,params:{canvasContext:N,viewport:O,transform:W,background:_},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:rt,operatorList:bt.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!Rt,pdfBug:this._pdfBug,pageColors:Y});(bt.renderTasks||(bt.renderTasks=new Set)).add(h);const m=h.task;return Promise.all([bt.displayReadyCapability.promise,nt]).then(S=>{var w;let[D,U]=S;if(this.destroyed){H();return}(w=this._stats)==null||w.time("Rendering"),h.initializeGraphics({transparency:D,optionalContentConfig:U}),h.operatorListChanged()}).catch(H),m}getOperatorList(){var nt;let{intent:b="display",annotationMode:N=_util.AnnotationMode.ENABLE,printAnnotationStorage:O=null}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};function G(){W.operatorList.lastChunk&&(W.opListReadCapability.resolve(W.operatorList),W.renderTasks.delete(_))}const K=this._transport.getRenderingIntent(b,N,O,!0);let W=this._intentStates.get(K.cacheKey);W||(W=Object.create(null),this._intentStates.set(K.cacheKey,W));let _;return W.opListReadCapability||(_=Object.create(null),_.operatorListChanged=G,W.opListReadCapability=new _util.PromiseCapability,(W.renderTasks||(W.renderTasks=new Set)).add(_),W.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(nt=this._stats)==null||nt.time("Page Request"),this._pumpOperatorList(K)),W.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:b=!1,disableNormalization:N=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const O=100;return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:b===!0,disableNormalization:N===!0},{highWaterMark:O,size(G){return G.items.length}})}getTextContent(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then(O=>_xfa_text.XfaText.textContent(O));const N=this.streamTextContent(b);return new Promise(function(O,G){function K(){W.read().then(function(nt){let{value:rt,done:Y}=nt;if(Y){O(_);return}Object.assign(_.styles,rt.styles),_.items.push(...rt.items),K()},G)}const W=N.getReader(),_={items:[],styles:Object.create(null)};K()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const b=[];for(const N of this._intentStates.values())if(this._abortOperatorList({intentState:N,reason:new Error("Page was destroyed."),force:!0}),!N.opListReadCapability)for(const O of N.renderTasks)b.push(O.completed),O.cancel();return this.objs.clear(),at(this,e,!1),j(this,y,ke).call(this),Promise.all(b)}cleanup(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;at(this,e,!0);const N=j(this,n,ue).call(this,!1);return b&&N&&this._stats&&(this._stats=new _display_utils.StatTimer),N}_startRenderPage(b,N){var G,K;const O=this._intentStates.get(N);!O||((G=this._stats)==null||G.timeEnd("Page Request"),(K=O.displayReadyCapability)==null||K.resolve(b))}_renderPageChunk(b,N){for(let O=0,G=b.length;O<G;O++)N.operatorList.fnArray.push(b.fnArray[O]),N.operatorList.argsArray.push(b.argsArray[O]);N.operatorList.lastChunk=b.lastChunk,N.operatorList.separateAnnots=b.separateAnnots;for(const O of N.renderTasks)O.operatorListChanged();b.lastChunk&&j(this,n,ue).call(this,!0)}_pumpOperatorList(b){let{renderingIntent:N,cacheKey:O,annotationStorageSerializable:G}=b;const{map:K,transfers:W}=G,nt=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:N,cacheKey:O,annotationStorage:K},W).getReader(),rt=this._intentStates.get(O);rt.streamReader=nt;const Y=()=>{nt.read().then(it=>{let{value:ft,done:bt}=it;if(bt){rt.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(ft,rt),Y())},it=>{if(rt.streamReader=null,!this._transport.destroyed){if(rt.operatorList){rt.operatorList.lastChunk=!0;for(const ft of rt.renderTasks)ft.operatorListChanged();j(this,n,ue).call(this,!0)}if(rt.displayReadyCapability)rt.displayReadyCapability.reject(it);else if(rt.opListReadCapability)rt.opListReadCapability.reject(it);else throw it}})};Y()}_abortOperatorList(b){let{intentState:N,reason:O,force:G=!1}=b;if(!!N.streamReader){if(N.streamReaderCancelTimeout&&(clearTimeout(N.streamReaderCancelTimeout),N.streamReaderCancelTimeout=null),!G){if(N.renderTasks.size>0)return;if(O instanceof _display_utils.RenderingCancelledException){let K=RENDERING_CANCELLED_TIMEOUT;O.extraDelay>0&&O.extraDelay<1e3&&(K+=O.extraDelay),N.streamReaderCancelTimeout=setTimeout(()=>{N.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:N,reason:O,force:!0})},K);return}}if(N.streamReader.cancel(new _util.AbortException(O.message)).catch(()=>{}),N.streamReader=null,!this._transport.destroyed){for(const[K,W]of this._intentStates)if(W===N){this._intentStates.delete(K);break}this.cleanup()}}}get stats(){return this._stats}}t=new WeakMap,e=new WeakMap,n=new WeakSet,ue=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(j(this,y,ke).call(this),!r(this,e)||this.destroyed)return!1;if(b)return at(this,t,setTimeout(()=>{at(this,t,null),j(this,n,ue).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:N,operatorList:O}of this._intentStates.values())if(N.size>0||!O.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),at(this,e,!1),!0},y=new WeakSet,ke=function(){r(this,t)&&(clearTimeout(r(this,t)),at(this,t,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){X(this,x,new Set);X(this,A,Promise.resolve())}postMessage(b,N){const O={data:structuredClone(b,null)};r(this,A).then(()=>{for(const G of r(this,x))G.call(this,O)})}addEventListener(b,N){r(this,x).add(N)}removeEventListener(b,N){r(this,x).delete(N)}terminate(){r(this,x).clear()}}x=new WeakMap,A=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 P=(p=document==null?void 0:document.currentScript)==null?void 0:p.src;P&&(PDFWorkerUtil.fallbackWorkerSrc=P.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(P,b){let N;try{if(N=new URL(P),!N.origin||N.origin==="null")return!1}catch(G){return!1}const O=new URL(b,N);return N.origin===O.origin},PDFWorkerUtil.createCDNWrapper=function(P){const b=`importScripts("${P}");`;return URL.createObjectURL(new Blob([b]))}}const _PDFWorker=class{constructor(){var O;let{name:P=null,port:b=null,verbosity:N=(0,_util.getVerbosityLevel)()}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.name=P,this.destroyed=!1,this.verbosity=N,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,b){if((O=r(_PDFWorker,I))!=null&&O.has(b))throw new Error("Cannot use more than one PDFWorker per port.");(r(_PDFWorker,I)||at(_PDFWorker,I,new WeakMap)).set(b,this),this._initializeFromPort(b);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(P){this._port=P,this._messageHandler=new _message_handler.MessageHandler("main","worker",P),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:P}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,P)||(P=PDFWorkerUtil.createCDNWrapper(new URL(P,window.location).href));const b=new Worker(P),N=new _message_handler.MessageHandler("main","worker",b),O=()=>{b.removeEventListener("error",G),N.destroy(),b.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},G=()=>{this._webWorker||O()};b.addEventListener("error",G),N.on("test",W=>{if(b.removeEventListener("error",G),this.destroyed){O();return}W?(this._messageHandler=N,this._port=b,this._webWorker=b,this._readyCapability.resolve(),N.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),N.destroy(),b.terminate())}),N.on("ready",W=>{if(b.removeEventListener("error",G),this.destroyed){O();return}try{K()}catch(_){this._setupFakeWorker()}});const K=()=>{const W=new Uint8Array;N.send("test",W,[W.buffer])};K();return}catch(b){(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(P=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const b=new LoopbackPort;this._port=b;const N=`fake${PDFWorkerUtil.fakeWorkerId++}`,O=new _message_handler.MessageHandler(N+"_worker",N,b);P.setup(O,b);const G=new _message_handler.MessageHandler(N,N+"_worker",b);this._messageHandler=G,this._readyCapability.resolve(),G.send("configure",{verbosity:this.verbosity})}).catch(P=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${P.message}".`))})}destroy(){var P;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),(P=r(_PDFWorker,I))==null||P.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(P){var N;if(!(P!=null&&P.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const b=(N=r(this,I))==null?void 0:N.get(P.port);if(b){if(b._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return b}return new _PDFWorker(P)}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 P;try{return((P=globalThis.pdfjsWorker)==null?void 0:P.WorkerMessageHandler)||null}catch(b){return null}}static get _setupFakeWorkerGlobal(){const loader=()=>ee(this,null,function*(){const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return yield(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler});return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};let PDFWorker=_PDFWorker;I=new WeakMap,X(PDFWorker,I,void 0),exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(b,N,O,G,K){X(this,l);X(this,E,new Map);X(this,k,new Map);X(this,T,new Map);X(this,u,null);this.messageHandler=b,this.loadingTask=N,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:G.ownerDocument,styleElement:G.styleElement}),this._params=G,this.canvasFactory=K.canvasFactory,this.filterFactory=K.filterFactory,this.cMapReaderFactory=K.cMapReaderFactory,this.standardFontDataFactory=K.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(b){let N=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,K=_util.RenderingIntentFlag.DISPLAY,W=_annotation_storage.SerializableEmpty;switch(b){case"any":K=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":K=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${b}`)}switch(N){case _util.AnnotationMode.DISABLE:K+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:K+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:K+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,W=(K&_util.RenderingIntentFlag.PRINT&&O instanceof _annotation_storage.PrintAnnotationStorage?O:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${N}`)}return G&&(K+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:K,cacheKey:`${K}_${W.hash}`,annotationStorageSerializable:W}}destroy(){var O;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,(O=r(this,u))==null||O.reject(new Error("Worker was destroyed during onPassword callback"));const b=[];for(const G of r(this,k).values())b.push(G._destroy());r(this,k).clear(),r(this,T).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const N=this.messageHandler.sendWithPromise("Terminate",null);return b.push(N),Promise.all(b).then(()=>{var G;this.commonObjs.clear(),this.fontLoader.clear(),r(this,E).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:b,loadingTask:N}=this;b.on("GetReader",(O,G)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=K=>{this._lastProgress={loaded:K.loaded,total:K.total}},G.onPull=()=>{this._fullReader.read().then(function(K){let{value:W,done:_}=K;if(_){G.close();return}(0,_util.assert)(W instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),G.enqueue(new Uint8Array(W),1,[W])}).catch(K=>{G.error(K)})},G.onCancel=K=>{this._fullReader.cancel(K),G.ready.catch(W=>{if(!this.destroyed)throw W})}}),b.on("ReaderHeadersReady",O=>{const G=new _util.PromiseCapability,K=this._fullReader;return K.headersReady.then(()=>{var W;(!K.isStreamingSupported||!K.isRangeSupported)&&(this._lastProgress&&((W=N.onProgress)==null||W.call(N,this._lastProgress)),K.onProgress=_=>{var nt;(nt=N.onProgress)==null||nt.call(N,{loaded:_.loaded,total:_.total})}),G.resolve({isStreamingSupported:K.isStreamingSupported,isRangeSupported:K.isRangeSupported,contentLength:K.contentLength})},G.reject),G.promise}),b.on("GetRangeReader",(O,G)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const K=this._networkStream.getRangeReader(O.begin,O.end);if(!K){G.close();return}G.onPull=()=>{K.read().then(function(W){let{value:_,done:nt}=W;if(nt){G.close();return}(0,_util.assert)(_ instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),G.enqueue(new Uint8Array(_),1,[_])}).catch(W=>{G.error(W)})},G.onCancel=W=>{K.cancel(W),G.ready.catch(_=>{if(!this.destroyed)throw _})}}),b.on("GetDoc",O=>{let{pdfInfo:G}=O;this._numPages=G.numPages,this._htmlForXfa=G.htmlForXfa,delete G.htmlForXfa,N._capability.resolve(new PDFDocumentProxy(G,this))}),b.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.")}N._capability.reject(G)}),b.on("PasswordRequest",O=>{if(at(this,u,new _util.PromiseCapability),N.onPassword){const G=K=>{K instanceof Error?r(this,u).reject(K):r(this,u).resolve({password:K})};try{N.onPassword(G,O.code)}catch(K){r(this,u).reject(K)}}else r(this,u).reject(new _util.PasswordException(O.message,O.code));return r(this,u).promise}),b.on("DataLoaded",O=>{var G;(G=N.onProgress)==null||G.call(N,{loaded:O.length,total:O.length}),this.downloadInfoCapability.resolve(O)}),b.on("StartRenderPage",O=>{if(this.destroyed)return;r(this,k).get(O.pageIndex)._startRenderPage(O.transparency,O.cacheKey)}),b.on("commonobj",O=>{var _;let[G,K,W]=O;if(!this.destroyed&&!this.commonObjs.has(G))switch(K){case"Font":const nt=this._params;if("error"in W){const it=W.error;(0,_util.warn)(`Error during font loading: ${it}`),this.commonObjs.resolve(G,it);break}const rt=nt.pdfBug&&((_=globalThis.FontInspector)==null?void 0:_.enabled)?(it,ft)=>globalThis.FontInspector.fontAdded(it,ft):null,Y=new _font_loader.FontFaceObject(W,{isEvalSupported:nt.isEvalSupported,disableFontFace:nt.disableFontFace,ignoreErrors:nt.ignoreErrors,inspectFont:rt});this.fontLoader.bind(Y).catch(it=>b.sendWithPromise("FontFallback",{id:G})).finally(()=>{!nt.fontExtraProperties&&Y.data&&(Y.data=null),this.commonObjs.resolve(G,Y)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(G,W);break;default:throw new Error(`Got unknown common object type ${K}`)}}),b.on("obj",O=>{var rt;let[G,K,W,_]=O;if(this.destroyed)return;const nt=r(this,k).get(K);if(!nt.objs.has(G))switch(W){case"Image":if(nt.objs.resolve(G,_),_){let Y;if(_.bitmap){const{width:it,height:ft}=_;Y=it*ft*4}else Y=((rt=_.data)==null?void 0:rt.length)||0;Y>_util.MAX_IMAGE_SIZE_TO_CACHE&&(nt._maybeCleanupAfterRender=!0)}break;case"Pattern":nt.objs.resolve(G,_);break;default:throw new Error(`Got unknown object type ${W}`)}}),b.on("DocProgress",O=>{var G;this.destroyed||(G=N.onProgress)==null||G.call(N,{loaded:O.loaded,total:O.total})}),b.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."))),b.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:b,transfers:N}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:b,filename:(G=(O=this._fullReader)==null?void 0:O.filename)!=null?G:null},N).finally(()=>{this.annotationStorage.resetModified()})}getPage(b){if(!Number.isInteger(b)||b<=0||b>this._numPages)return Promise.reject(new Error("Invalid page request."));const N=b-1,O=r(this,T).get(N);if(O)return O;const G=this.messageHandler.sendWithPromise("GetPage",{pageIndex:N}).then(K=>{if(this.destroyed)throw new Error("Transport destroyed");const W=new PDFPageProxy(N,K,this,this._params.pdfBug);return r(this,k).set(N,W),W});return r(this,T).set(N,G),G}getPageIndex(b){return typeof b!="object"||b===null||!Number.isInteger(b.num)||b.num<0||!Number.isInteger(b.gen)||b.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:b.num,gen:b.gen})}getAnnotations(b,N){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:b,intent:N})}getFieldObjects(){return j(this,l,Pe).call(this,"GetFieldObjects")}hasJSActions(){return j(this,l,Pe).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(b){return typeof b!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:b})}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,l,Pe).call(this,"GetDocJSActions")}getPageJSActions(b){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:b})}getStructTree(b){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:b})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(b=>new _optional_content_config.OptionalContentConfig(b))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const b="GetMetadata",N=r(this,E).get(b);if(N)return N;const O=this.messageHandler.sendWithPromise(b,null).then(G=>{var K,W,_,nt;return{info:G[0],metadata:G[1]?new _metadata.Metadata(G[1]):null,contentDispositionFilename:(W=(K=this._fullReader)==null?void 0:K.filename)!=null?W:null,contentLength:(nt=(_=this._fullReader)==null?void 0:_.contentLength)!=null?nt:null}});return r(this,E).set(b,O),O}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}startCleanup(){return ee(this,arguments,function*(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.destroyed){yield this.messageHandler.sendWithPromise("Cleanup",null);for(const N of r(this,k).values())if(!N.cleanup())throw new Error(`startCleanup: Page ${N.pageNumber} is currently rendering.`);this.commonObjs.clear(),b||this.fontLoader.clear(),r(this,E).clear(),this.filterFactory.destroy(!0)}})}get loadingParams(){const{disableAutoFetch:b,enableXfa:N}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:b,enableXfa:N})}}E=new WeakMap,k=new WeakMap,T=new WeakMap,u=new WeakMap,l=new WeakSet,Pe=function(b){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const O=r(this,E).get(b);if(O)return O;const G=this.messageHandler.sendWithPromise(b,N);return r(this,E).set(b,G),G};class PDFObjects{constructor(){X(this,R);X(this,v,Object.create(null))}get(b){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(N){const G=j(this,R,Ve).call(this,b);return G.capability.promise.then(()=>N(G.data)),null}const O=r(this,v)[b];if(!(O!=null&&O.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${b}.`);return O.data}has(b){const N=r(this,v)[b];return(N==null?void 0:N.capability.settled)||!1}resolve(b){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const O=j(this,R,Ve).call(this,b);O.data=N,O.capability.resolve()}clear(){var b;for(const N in r(this,v)){const{data:O}=r(this,v)[N];(b=O==null?void 0:O.bitmap)==null||b.close()}at(this,v,Object.create(null))}}v=new WeakMap,R=new WeakSet,Ve=function(b){var N;return(N=r(this,v))[b]||(N[b]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(b){X(this,c,null);at(this,c,b),this.onContinue=null}get promise(){return r(this,c).capability.promise}cancel(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;r(this,c).cancel(null,b)}get separateAnnots(){const{separateAnnots:b}=r(this,c).operatorList;if(!b)return!1;const{annotationCanvasMap:N}=r(this,c);return b.form||b.canvas&&(N==null?void 0:N.size)>0}}c=new WeakMap,exports.RenderTask=RenderTask;const L=class{constructor(b){let{callback:N,params:O,objs:G,commonObjs:K,annotationCanvasMap:W,operatorList:_,pageIndex:nt,canvasFactory:rt,filterFactory:Y,useRequestAnimationFrame:it=!1,pdfBug:ft=!1,pageColors:bt=null}=b;this.callback=N,this.params=O,this.objs=G,this.commonObjs=K,this.annotationCanvasMap=W,this.operatorListIdx=null,this.operatorList=_,this._pageIndex=nt,this.canvasFactory=rt,this.filterFactory=Y,this._pdfBug=ft,this.pageColors=bt,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=it===!0&&typeof window!="undefined",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(b){var nt,rt;let{transparency:N=!1,optionalContentConfig:O}=b;if(this.cancelled)return;if(this._canvas){if(r(L,g).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(L,g).add(this._canvas)}this._pdfBug&&((nt=globalThis.StepperManager)==null?void 0:nt.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:G,viewport:K,transform:W,background:_}=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:W,viewport:K,transparency:N,background:_}),this.operatorListIdx=0,this.graphicsReady=!0,(rt=this.graphicsReadyCallback)==null||rt.call(this)}cancel(){var O;let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.running=!1,this.cancelled=!0,(O=this.gfx)==null||O.endDrawing(),r(L,g).delete(this._canvas),this.callback(b||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,N))}operatorListChanged(){var b;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(b=this.stepper)==null||b.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)}_next(){return ee(this,null,function*(){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(L,g).delete(this._canvas),this.callback())))})}};let InternalRenderTask=L;g=new WeakMap,X(InternalRenderTask,g,new WeakSet);const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(C,i,t)=>{var e=t(3),n=t(126),o=t(135);e({target:"Set",proto:!0,real:!0,forced:!o("difference")},{difference:n})},(C,i,t)=>{var e=t(127),n=t(128),o=t(129),y=t(132),F=t(133),x=t(130),A=t(131),p=n.has,I=n.remove;C.exports=function(k){var T=e(this),u=F(k),l=o(T);return y(T)<=u.size?x(T,function(f){u.includes(f)&&I(l,f)}):A(u.getIterator(),function(f){p(T,f)&&I(l,f)}),l}},(C,i,t)=>{var e=t(128).has;C.exports=function(n){return e(n),n}},(C,i,t)=>{var e=t(14),n=Set.prototype;C.exports={Set,add:e(n.add),has:e(n.has),remove:e(n.delete),proto:n}},(C,i,t)=>{var e=t(128),n=t(130),o=e.Set,y=e.add;C.exports=function(F){var x=new o;return n(F,function(A){y(x,A)}),x}},(C,i,t)=>{var e=t(14),n=t(131),o=t(128),y=o.Set,F=o.proto,x=e(F.forEach),A=e(F.keys),p=A(new y).next;C.exports=function(I,E,k){return k?n({iterator:A(I),next:p},E):x(I,E)}},(C,i,t)=>{var e=t(8);C.exports=function(n,o,y){for(var F=y?n:n.iterator,x=n.next,A,p;!(A=e(x,F)).done;)if(p=o(A.value),p!==void 0)return p}},(C,i,t)=>{var e=t(72),n=t(128);C.exports=e(n.proto,"size","get")||function(o){return o.size}},(C,i,t)=>{var e=t(31),n=t(47),o=t(8),y=t(62),F=t(134),x="Invalid size",A=RangeError,p=TypeError,I=Math.max,E=function(k,T,u,l){this.set=k,this.size=T,this.has=u,this.keys=l};E.prototype={getIterator:function(){return F(n(o(this.keys,this.set)))},includes:function(k){return o(this.has,this.set,k)}},C.exports=function(k){n(k);var T=+k.size;if(T!==T)throw p(x);var u=y(T);if(u<0)throw A(x);return new E(k,I(u,0),e(k.has),e(k.keys))}},C=>{C.exports=function(i){return{iterator:i,next:i.next,done:!1}}},(C,i,t)=>{var e=t(24),n=function(o){return{size:o,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};C.exports=function(o){var y=e("Set");try{new y()[o](n(0));try{return new y()[o](n(-1)),!1}catch(F){return!0}}catch(F){return!1}}},(C,i,t)=>{var e=t(3),n=t(7),o=t(137),y=t(135),F=!y("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:F},{intersection:o})},(C,i,t)=>{var e=t(127),n=t(128),o=t(132),y=t(133),F=t(130),x=t(131),A=n.Set,p=n.add,I=n.has;C.exports=function(k){var T=e(this),u=y(k),l=new A;return o(T)>u.size?x(u.getIterator(),function(f){I(T,f)&&p(l,f)}):F(T,function(f){u.includes(f)&&p(l,f)}),l}},(C,i,t)=>{var e=t(3),n=t(139),o=t(135);e({target:"Set",proto:!0,real:!0,forced:!o("isDisjointFrom")},{isDisjointFrom:n})},(C,i,t)=>{var e=t(127),n=t(128).has,o=t(132),y=t(133),F=t(130),x=t(131),A=t(140);C.exports=function(I){var E=e(this),k=y(I);if(o(E)<=k.size)return F(E,function(u){if(k.includes(u))return!1},!0)!==!1;var T=k.getIterator();return x(T,function(u){if(n(E,u))return A(T,"normal",!1)})!==!1}},(C,i,t)=>{var e=t(8),n=t(47),o=t(30);C.exports=function(y,F,x){var A,p;n(y);try{if(A=o(y,"return"),!A){if(F==="throw")throw x;return x}A=e(A,y)}catch(I){p=!0,A=I}if(F==="throw")throw x;if(p)throw A;return n(A),x}},(C,i,t)=>{var e=t(3),n=t(142),o=t(135);e({target:"Set",proto:!0,real:!0,forced:!o("isSubsetOf")},{isSubsetOf:n})},(C,i,t)=>{var e=t(127),n=t(132),o=t(130),y=t(133);C.exports=function(x){var A=e(this),p=y(x);return n(A)>p.size?!1:o(A,function(I){if(!p.includes(I))return!1},!0)!==!1}},(C,i,t)=>{var e=t(3),n=t(144),o=t(135);e({target:"Set",proto:!0,real:!0,forced:!o("isSupersetOf")},{isSupersetOf:n})},(C,i,t)=>{var e=t(127),n=t(128).has,o=t(132),y=t(133),F=t(131),x=t(140);C.exports=function(p){var I=e(this),E=y(p);if(o(I)<E.size)return!1;var k=E.getIterator();return F(k,function(T){if(!n(I,T))return x(k,"normal",!1)})!==!1}},(C,i,t)=>{var e=t(3),n=t(146),o=t(135);e({target:"Set",proto:!0,real:!0,forced:!o("symmetricDifference")},{symmetricDifference:n})},(C,i,t)=>{var e=t(127),n=t(128),o=t(129),y=t(133),F=t(131),x=n.add,A=n.has,p=n.remove;C.exports=function(E){var k=e(this),T=y(E).getIterator(),u=o(k);return F(T,function(l){A(k,l)?p(u,l):x(u,l)}),u}},(C,i,t)=>{var e=t(3),n=t(148),o=t(135);e({target:"Set",proto:!0,real:!0,forced:!o("union")},{union:n})},(C,i,t)=>{var e=t(127),n=t(128).add,o=t(129),y=t(133),F=t(131);C.exports=function(A){var p=e(this),I=y(A).getIterator(),E=o(p);return F(I,function(k){n(E,k)}),E}},(C,i,t)=>{var e=t(3),n=t(4),o=t(24),y=t(11),F=t(45).f,x=t(39),A=t(150),p=t(75),I=t(76),E=t(151),k=t(82),T=t(6),u=t(36),l="DOMException",f=o("Error"),v=o(l),R=function(){A(this,M);var nt=arguments.length,rt=I(nt<1?void 0:arguments[0]),Y=I(nt<2?void 0:arguments[1],"Error"),it=new v(rt,Y),ft=f(rt);return ft.name=l,F(it,"stack",y(1,k(ft.stack,1))),p(it,this,R),it},M=R.prototype=v.prototype,c="stack"in f(l),g="stack"in new v(1,2),L=v&&T&&Object.getOwnPropertyDescriptor(n,l),P=!!L&&!(L.writable&&L.configurable),b=c&&!P&&!g;e({global:!0,constructor:!0,forced:u||b},{DOMException:b?R:v});var N=o(l),O=N.prototype;if(O.constructor!==N){u||F(O,"constructor",y(1,N));for(var G in E)if(x(E,G)){var K=E[G],W=K.s;x(N,W)||F(N,W,y(6,K.c))}}},(C,i,t)=>{var e=t(25),n=TypeError;C.exports=function(o,y){if(e(y,o))return o;throw n("Incorrect invocation")}},C=>{C.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}}},(C,i,t)=>{var e=t(36),n=t(3),o=t(4),y=t(24),F=t(14),x=t(7),A=t(41),p=t(21),I=t(153),E=t(17),k=t(20),T=t(23),u=t(154),l=t(47),f=t(78),v=t(39),R=t(159),M=t(44),c=t(64),g=t(85),L=t(160),P=t(162),b=t(128),N=t(83),O=t(119),G=o.Object,K=o.Array,W=o.Date,_=o.Error,nt=o.EvalError,rt=o.RangeError,Y=o.ReferenceError,it=o.SyntaxError,ft=o.TypeError,bt=o.URIError,Rt=o.PerformanceMark,H=o.WebAssembly,h=H&&H.CompileError||_,m=H&&H.LinkError||_,s=H&&H.RuntimeError||_,d=y("DOMException"),S=P.Map,D=P.has,U=P.get,w=P.set,tt=b.Set,q=b.add,ct=y("Object","keys"),ut=F([].push),Et=F((!0).valueOf),mt=F(1 .valueOf),Ot=F("".valueOf),Wt=F(W.prototype.getTime),Pt=A("structuredClone"),Nt="DataCloneError",At="Transferring",ht=function(ot){return!x(function(){var z=new o.Set([7]),gt=ot(z),xt=ot(G(7));return gt===z||!gt.has(7)||typeof xt!="object"||+xt!=7})&&ot},st=function(ot,z){return!x(function(){var gt=new z,xt=ot({a:gt,b:gt});return!(xt&&xt.a===xt.b&&xt.a instanceof z&&xt.a.stack===gt.stack)})},dt=function(ot){return!x(function(){var z=ot(new o.AggregateError([1],Pt,{cause:3}));return z.name!=="AggregateError"||z.errors[0]!==1||z.message!==Pt||z.cause!==3})},It=o.structuredClone,wt=e||!st(It,_)||!st(It,d)||!dt(It),Ht=!It&&ht(function(ot){return new Rt(Pt,{detail:ot}).detail}),Xt=ht(It)||Ht,$t=function(ot){throw new d("Uncloneable type: "+ot,Nt)},Vt=function(ot,z){throw new d((z||"Cloning")+" of "+ot+" cannot be properly polyfilled in this engine",Nt)},Kt=function(ot,z){return Xt||Vt(z),Xt(ot)},Jt=function(){var ot;try{ot=new o.DataTransfer}catch(z){try{ot=new o.ClipboardEvent("").clipboardData}catch(gt){}}return ot&&ot.items&&ot.files?ot:null},Zt=function(ot,z,gt){if(D(z,ot))return U(z,ot);var xt=gt||f(ot),St,kt,vt,zt,Tt,Lt;if(xt==="SharedArrayBuffer")Xt?St=Xt(ot):St=ot;else{var Dt=o.DataView;!Dt&&typeof ot.slice!="function"&&Vt("ArrayBuffer");try{if(typeof ot.slice=="function"&&!ot.resizable)St=ot.slice(0);else for(kt=ot.byteLength,vt=("maxByteLength"in ot)?{maxByteLength:ot.maxByteLength}:void 0,St=new ArrayBuffer(kt,vt),zt=new Dt(ot),Tt=new Dt(St),Lt=0;Lt<kt;Lt++)Tt.setUint8(Lt,zt.getUint8(Lt))}catch($){throw new d("ArrayBuffer is detached",Nt)}}return w(z,ot,St),St},Gt=function(ot,z,gt,xt,St){var kt=o[z];return k(kt)||Vt(z),new kt(Zt(ot.buffer,St),gt,xt)},yt=function(ot,z,gt){this.object=ot,this.type=z,this.metadata=gt},Z=function(ot,z,gt){if(T(ot)&&$t("Symbol"),!k(ot))return ot;if(z){if(D(z,ot))return U(z,ot)}else z=new S;var xt=f(ot),St,kt,vt,zt,Tt,Lt,Dt,$;switch(xt){case"Array":vt=K(c(ot));break;case"Object":vt={};break;case"Map":vt=new S;break;case"Set":vt=new tt;break;case"RegExp":vt=new RegExp(ot.source,L(ot));break;case"Error":switch(kt=ot.name,kt){case"AggregateError":vt=y("AggregateError")([]);break;case"EvalError":vt=nt();break;case"RangeError":vt=rt();break;case"ReferenceError":vt=Y();break;case"SyntaxError":vt=it();break;case"TypeError":vt=ft();break;case"URIError":vt=bt();break;case"CompileError":vt=h();break;case"LinkError":vt=m();break;case"RuntimeError":vt=s();break;default:vt=_()}break;case"DOMException":vt=new d(ot.message,ot.name);break;case"ArrayBuffer":case"SharedArrayBuffer":vt=gt?new yt(ot,xt):Zt(ot,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"?ot.byteLength:ot.length,vt=gt?new yt(ot,xt,{offset:ot.byteOffset,length:Lt}):Gt(ot,xt,ot.byteOffset,Lt,z);break;case"DOMQuad":try{vt=new DOMQuad(Z(ot.p1,z,gt),Z(ot.p2,z,gt),Z(ot.p3,z,gt),Z(ot.p4,z,gt))}catch(a){vt=Kt(ot,xt)}break;case"File":if(Xt)try{vt=Xt(ot),f(vt)!==xt&&(vt=void 0)}catch(a){}if(!vt)try{vt=new File([ot],ot.name,ot)}catch(a){}vt||Vt(xt);break;case"FileList":if(zt=Jt(),zt){for(Tt=0,Lt=c(ot);Tt<Lt;Tt++)zt.items.add(Z(ot[Tt],z,gt));vt=zt.files}else vt=Kt(ot,xt);break;case"ImageData":try{vt=new ImageData(Z(ot.data,z,gt),ot.width,ot.height,{colorSpace:ot.colorSpace})}catch(a){vt=Kt(ot,xt)}break;default:if(Xt)vt=Xt(ot);else switch(xt){case"BigInt":vt=G(ot.valueOf());break;case"Boolean":vt=G(Et(ot));break;case"Number":vt=G(mt(ot));break;case"String":vt=G(Ot(ot));break;case"Date":vt=new W(Wt(ot));break;case"Blob":try{vt=ot.slice(0,ot.size,ot.type)}catch(a){Vt(xt)}break;case"DOMPoint":case"DOMPointReadOnly":St=o[xt];try{vt=St.fromPoint?St.fromPoint(ot):new St(ot.x,ot.y,ot.z,ot.w)}catch(a){Vt(xt)}break;case"DOMRect":case"DOMRectReadOnly":St=o[xt];try{vt=St.fromRect?St.fromRect(ot):new St(ot.x,ot.y,ot.width,ot.height)}catch(a){Vt(xt)}break;case"DOMMatrix":case"DOMMatrixReadOnly":St=o[xt];try{vt=St.fromMatrix?St.fromMatrix(ot):new St(ot)}catch(a){Vt(xt)}break;case"AudioData":case"VideoFrame":p(ot.clone)||Vt(xt);try{vt=ot.clone()}catch(a){$t(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:$t(xt)}}switch(w(z,ot,vt),xt){case"Array":case"Object":for(Dt=ct(ot),Tt=0,Lt=c(Dt);Tt<Lt;Tt++)$=Dt[Tt],R(vt,$,Z(ot[$],z,gt));break;case"Map":ot.forEach(function(a,B){w(vt,Z(B,z,gt),Z(a,z,gt))});break;case"Set":ot.forEach(function(a){q(vt,Z(a,z,gt))});break;case"Error":M(vt,"message",Z(ot.message,z,gt)),v(ot,"cause")&&M(vt,"cause",Z(ot.cause,z,gt)),kt==="AggregateError"&&(vt.errors=Z(ot.errors,z,gt));case"DOMException":N&&M(vt,"stack",Z(ot.stack,z,gt))}return vt},J=function(ot,z){if(!k(ot))return ot;if(D(z,ot))return U(z,ot);var gt,xt,St,kt,vt,zt,Tt,Lt;if(ot instanceof yt)switch(gt=ot.type,xt=ot.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=ot.metadata,Lt=Gt(xt,gt,St.offset,St.length,z)}else switch(f(ot)){case"Array":case"Object":for(zt=ct(ot),kt=0,vt=c(zt);kt<vt;kt++)Tt=zt[kt],ot[Tt]=J(ot[Tt],z);break;case"Map":Lt=new S,ot.forEach(function(Dt,$){w(Lt,J($,z),J(Dt,z))});break;case"Set":Lt=new tt,ot.forEach(function(Dt){q(Lt,J(Dt,z))});break;case"Error":ot.message=J(ot.message,z),v(ot,"cause")&&(ot.cause=J(ot.cause,z)),ot.name==="AggregateError"&&(ot.errors=J(ot.errors,z));case"DOMException":N&&(ot.stack=J(ot.stack,z))}return w(z,ot,Lt||ot),Lt||ot},pt=function(ot,z){if(!k(ot))throw ft("Transfer option cannot be converted to a sequence");var gt=[];u(ot,function(a){ut(gt,l(a))});for(var xt=0,St=c(gt),kt=[],vt,zt,Tt,Lt,Dt,$;xt<St;){if(vt=gt[xt++],zt=f(vt),zt==="ArrayBuffer"){ut(kt,vt);continue}if(D(z,vt))throw new d("Duplicate transferable",Nt);if(O)Lt=It(vt,{transfer:[vt]});else switch(zt){case"ImageBitmap":Tt=o.OffscreenCanvas,I(Tt)||Vt(zt,At);try{Dt=new Tt(vt.width,vt.height),$=Dt.getContext("bitmaprenderer"),$.transferFromImageBitmap(vt),Lt=Dt.transferToImageBitmap()}catch(a){}break;case"AudioData":case"VideoFrame":(!p(vt.clone)||!p(vt.close))&&Vt(zt,At);try{Lt=vt.clone(),vt.close()}catch(a){}break;case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":Vt(zt,At)}if(Lt===void 0)throw new d("This object cannot be transferred: "+zt,Nt);w(z,vt,Lt)}return kt},jt=function(ot,z){for(var gt=0,xt=c(ot),St,kt;gt<xt;){if(St=ot[gt++],D(z,St))throw new d("Duplicate transferable",Nt);O?kt=It(St,{transfer:[St]}):(p(St.transfer)||Vt("ArrayBuffer",At),kt=St.transfer()),w(z,St,kt)}};n({global:!0,enumerable:!0,sham:!O,forced:wt},{structuredClone:function(z){var gt=g(arguments.length,1)>1&&!E(arguments[1])?l(arguments[1]):void 0,xt=gt?gt.transfer:void 0,St=!1,kt,vt;xt!==void 0&&(kt=new S,vt=pt(xt,kt),St=!!c(vt));var zt=Z(z,kt,St);return St&&(kt=new S,jt(xt,kt),zt=J(zt,kt)),zt}})},(C,i,t)=>{var e=t(14),n=t(7),o=t(21),y=t(78),F=t(24),x=t(51),A=function(){},p=[],I=F("Reflect","construct"),E=/^\s*(?:class|function)\b/,k=e(E.exec),T=!E.exec(A),u=function(v){if(!o(v))return!1;try{return I(A,p,v),!0}catch(R){return!1}},l=function(v){if(!o(v))return!1;switch(y(v)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return T||!!k(E,x(v))}catch(R){return!0}};l.sham=!0,C.exports=!I||n(function(){var f;return u(u.call)||!u(Object)||!u(function(){f=!0})||f})?l:u},(C,i,t)=>{var e=t(99),n=t(8),o=t(47),y=t(32),F=t(155),x=t(64),A=t(25),p=t(157),I=t(158),E=t(140),k=TypeError,T=function(l,f){this.stopped=l,this.result=f},u=T.prototype;C.exports=function(l,f,v){var R=v&&v.that,M=!!(v&&v.AS_ENTRIES),c=!!(v&&v.IS_RECORD),g=!!(v&&v.IS_ITERATOR),L=!!(v&&v.INTERRUPTED),P=e(f,R),b,N,O,G,K,W,_,nt=function(Y){return b&&E(b,"normal",Y),new T(!0,Y)},rt=function(Y){return M?(o(Y),L?P(Y[0],Y[1],nt):P(Y[0],Y[1])):L?P(Y,nt):P(Y)};if(c)b=l.iterator;else if(g)b=l;else{if(N=I(l),!N)throw k(y(l)+" is not iterable");if(F(N)){for(O=0,G=x(l);G>O;O++)if(K=rt(l[O]),K&&A(u,K))return K;return new T(!1)}b=p(l,N)}for(W=c?l.next:b.next;!(_=n(W,b)).done;){try{K=rt(_.value)}catch(Y){E(b,"throw",Y)}if(typeof K=="object"&&K&&A(u,K))return K}return new T(!1)}},(C,i,t)=>{var e=t(34),n=t(156),o=e("iterator"),y=Array.prototype;C.exports=function(F){return F!==void 0&&(n.Array===F||y[o]===F)}},C=>{C.exports={}},(C,i,t)=>{var e=t(8),n=t(31),o=t(47),y=t(32),F=t(158),x=TypeError;C.exports=function(A,p){var I=arguments.length<2?F(A):p;if(n(I))return o(e(I,A));throw x(y(A)+" is not iterable")}},(C,i,t)=>{var e=t(78),n=t(30),o=t(17),y=t(156),F=t(34),x=F("iterator");C.exports=function(A){if(!o(A))return n(A,x)||n(A,"@@iterator")||y[e(A)]}},(C,i,t)=>{var e=t(18),n=t(45),o=t(11);C.exports=function(y,F,x){var A=e(F);A in y?n.f(y,A,o(0,x)):y[A]=x}},(C,i,t)=>{var e=t(8),n=t(39),o=t(25),y=t(161),F=RegExp.prototype;C.exports=function(x){var A=x.flags;return A===void 0&&!("flags"in F)&&!n(x,"flags")&&o(F,x)?e(y,x):A}},(C,i,t)=>{var e=t(47);C.exports=function(){var n=e(this),o="";return n.hasIndices&&(o+="d"),n.global&&(o+="g"),n.ignoreCase&&(o+="i"),n.multiline&&(o+="m"),n.dotAll&&(o+="s"),n.unicode&&(o+="u"),n.unicodeSets&&(o+="v"),n.sticky&&(o+="y"),o}},(C,i,t)=>{var e=t(14),n=Map.prototype;C.exports={Map,set:e(n.set),get:e(n.get),has:e(n.has),remove:e(n.delete),proto:n}},(C,i,t)=>{var A,p,I,Pn,k;Object.defineProperty(i,"__esModule",{value:!0}),i.SerializableEmpty=i.PrintAnnotationStorage=i.AnnotationStorage=void 0,t(89),t(149),t(152);var e=t(1),n=t(164),o=t(170);const y=Object.freeze({map:null,hash:"",transfers:void 0});i.SerializableEmpty=y;class F{constructor(){X(this,I);X(this,A,!1);X(this,p,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(u,l){const f=r(this,p).get(u);return f===void 0?l:Object.assign(l,f)}getRawValue(u){return r(this,p).get(u)}remove(u){if(r(this,p).delete(u),r(this,p).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const l of r(this,p).values())if(l instanceof n.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(u,l){const f=r(this,p).get(u);let v=!1;if(f!==void 0)for(const[R,M]of Object.entries(l))f[R]!==M&&(v=!0,f[R]=M);else v=!0,r(this,p).set(u,l);v&&j(this,I,Pn).call(this),l instanceof n.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(l.constructor._type)}has(u){return r(this,p).has(u)}getAll(){return r(this,p).size>0?(0,e.objectFromMap)(r(this,p)):null}setAll(u){for(const[l,f]of Object.entries(u))this.setValue(l,f)}get size(){return r(this,p).size}resetModified(){r(this,A)&&(at(this,A,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new x(this)}get serializable(){if(r(this,p).size===0)return y;const u=new Map,l=new o.MurmurHash3_64,f=[],v=Object.create(null);let R=!1;for(const[M,c]of r(this,p)){const g=c instanceof n.AnnotationEditor?c.serialize(!1,v):c;g&&(u.set(M,g),l.update(`${M}:${JSON.stringify(g)}`),R||(R=!!g.bitmap))}if(R)for(const M of u.values())M.bitmap&&f.push(M.bitmap);return u.size>0?{map:u,hash:l.hexdigest(),transfers:f}:y}}A=new WeakMap,p=new WeakMap,I=new WeakSet,Pn=function(){r(this,A)||(at(this,A,!0),typeof this.onSetModified=="function"&&this.onSetModified())},i.AnnotationStorage=F;class x extends F{constructor(l){super();X(this,k,void 0);const{map:f,hash:v,transfers:R}=l.serializable,M=structuredClone(f,null);at(this,k,{map:M,hash:v,transfers:R})}get print(){(0,e.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return r(this,k)}}k=new WeakMap,i.PrintAnnotationStorage=x},(C,i,t)=>{var x,A,p,I,E,k,T,u,l,f,v,R,M,c,g,Xe,P,Ye,N,_e,G,Ke,W,Rn,nt,wn,Y,Mn,ft,Je,Rt,Fn;Object.defineProperty(i,"__esModule",{value:!0}),i.AnnotationEditor=void 0,t(89),t(2);var e=t(165),n=t(1),o=t(168);const h=class{constructor(s){X(this,g);X(this,P);X(this,G);X(this,W);X(this,nt);X(this,Y);X(this,ft);X(this,Rt);X(this,x,"");X(this,A,!1);X(this,p,null);X(this,I,null);X(this,E,null);X(this,k,!1);X(this,T,null);X(this,u,this.focusin.bind(this));X(this,l,this.focusout.bind(this));X(this,f,!1);X(this,v,!1);X(this,R,!1);ne(this,"_initialOptions",Object.create(null));ne(this,"_uiManager",null);ne(this,"_focusEventsAllowed",!0);ne(this,"_l10nPromise",null);X(this,M,!1);X(this,c,h._zIndex++);this.constructor===h&&(0,n.unreachable)("Cannot initialize AnnotationEditor."),this.parent=s.parent,this.id=s.id,this.width=this.height=null,this.pageIndex=s.parent.pageIndex,this.name=s.name,this.div=null,this._uiManager=s.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=s.isCentered,this._structTreeParentId=null;const{rotation:d,rawDims:{pageWidth:S,pageHeight:D,pageX:U,pageY:w}}=this.parent.viewport;this.rotation=d,this.pageRotation=(360+d-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[S,D],this.pageTranslation=[U,w];const[tt,q]=this.parentDimensions;this.x=s.x/tt,this.y=s.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(s){const d=new F({id:s.parent.getNextId(),parent:s.parent,uiManager:s._uiManager});d.annotationElementId=s.annotationElementId,d.deleted=!0,d._uiManager.addToAnnotationStorage(d)}static initialize(s){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(h._l10nPromise||(h._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(D=>[D,s.get(D)]))),d!=null&&d.strings)for(const D of d.strings)h._l10nPromise.set(D,s.get(D));if(h._borderLineWidth!==-1)return;const S=getComputedStyle(document.documentElement);h._borderLineWidth=parseFloat(S.getPropertyValue("--outline-width"))||0}static updateDefaultParams(s,d){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(s){return!1}static paste(s,d){(0,n.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return r(this,M)}set _isDraggable(s){var d;at(this,M,s),(d=this.div)==null||d.classList.toggle("draggable",s)}center(){const[s,d]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*d/(s*2),this.y+=this.width*s/(d*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*d/(s*2),this.y-=this.width*s/(d*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(s){this._uiManager.addCommands(s)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=r(this,c)}setParent(s){s!==null&&(this.pageIndex=s.pageIndex,this.pageDimensions=s.pageDimensions),this.parent=s}focusin(s){!this._focusEventsAllowed||(r(this,f)?at(this,f,!1):this.parent.setSelected(this))}focusout(s){var S;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const d=s.relatedTarget;d!=null&&d.closest(`#${this.id}`)||(s.preventDefault(),(S=this.parent)!=null&&S.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(s,d,S,D){const[U,w]=this.parentDimensions;[S,D]=this.screenToPageTranslation(S,D),this.x=(s+S)/U,this.y=(d+D)/w,this.fixAndSetPosition()}translate(s,d){j(this,g,Xe).call(this,this.parentDimensions,s,d)}translateInPage(s,d){j(this,g,Xe).call(this,this.pageDimensions,s,d),this.div.scrollIntoView({block:"nearest"})}drag(s,d){const[S,D]=this.parentDimensions;if(this.x+=s/S,this.y+=d/D,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:ct,y:ut}=this.div.getBoundingClientRect();this.parent.findNewParent(this,ct,ut)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:U,y:w}=this;const[tt,q]=j(this,P,Ye).call(this);U+=tt,w+=q,this.div.style.left=`${(100*U).toFixed(2)}%`,this.div.style.top=`${(100*w).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[s,d]=this.pageDimensions;let{x:S,y:D,width:U,height:w}=this;switch(U*=s,w*=d,S*=s,D*=d,this.rotation){case 0:S=Math.max(0,Math.min(s-U,S)),D=Math.max(0,Math.min(d-w,D));break;case 90:S=Math.max(0,Math.min(s-w,S)),D=Math.min(d,Math.max(U,D));break;case 180:S=Math.min(s,Math.max(U,S)),D=Math.min(d,Math.max(w,D));break;case 270:S=Math.min(s,Math.max(w,S)),D=Math.max(0,Math.min(d-U,D));break}this.x=S/=s,this.y=D/=d;const[tt,q]=j(this,P,Ye).call(this);S+=tt,D+=q;const{style:ct}=this.div;ct.left=`${(100*S).toFixed(2)}%`,ct.top=`${(100*D).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(s,d){var S;return j(S=h,N,_e).call(S,s,d,this.parentRotation)}pageTranslationToScreen(s,d){var S;return j(S=h,N,_e).call(S,s,d,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:s,pageDimensions:[d,S]}=this,D=d*s,U=S*s;return n.FeatureTest.isCSSRoundSupported?[Math.round(D),Math.round(U)]:[D,U]}setDims(s,d){var U;const[S,D]=this.parentDimensions;this.div.style.width=`${(100*s/S).toFixed(2)}%`,r(this,k)||(this.div.style.height=`${(100*d/D).toFixed(2)}%`),(U=r(this,p))==null||U.classList.toggle("small",s<h.SMALL_EDITOR_SIZE||d<h.SMALL_EDITOR_SIZE)}fixDims(){const{style:s}=this.div,{height:d,width:S}=s,D=S.endsWith("%"),U=!r(this,k)&&d.endsWith("%");if(D&&U)return;const[w,tt]=this.parentDimensions;D||(s.width=`${(100*parseFloat(S)/w).toFixed(2)}%`),!r(this,k)&&!U&&(s.height=`${(100*parseFloat(d)/tt).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}addAltTextButton(){return ee(this,null,function*(){if(r(this,p))return;const s=at(this,p,document.createElement("button"));s.className="altText";const d=yield h._l10nPromise.get("editor_alt_text_button_label");s.textContent=d,s.setAttribute("aria-label",d),s.tabIndex="0",s.addEventListener("contextmenu",o.noContextMenu),s.addEventListener("pointerdown",S=>S.stopPropagation()),s.addEventListener("click",S=>{S.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),s.addEventListener("keydown",S=>{S.target===s&&S.key==="Enter"&&(S.preventDefault(),this._uiManager.editAltText(this))}),j(this,ft,Je).call(this),this.div.append(s),h.SMALL_EDITOR_SIZE||(h.SMALL_EDITOR_SIZE=Math.min(128,Math.round(s.getBoundingClientRect().width*1.4)))})}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:r(this,x),decorative:r(this,A)}}set altTextData(s){let{altText:d,decorative:S}=s;r(this,x)===d&&r(this,A)===S||(at(this,x,d),at(this,A,S),j(this,ft,Je).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,u)),this.div.addEventListener("focusout",r(this,l));const[s,d]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*d/s).toFixed(2)}%`,this.div.style.maxHeight=`${(100*s/d).toFixed(2)}%`);const[S,D]=this.getInitialTranslation();return this.translate(S,D),(0,e.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(s){const{isMac:d}=n.FeatureTest.platform;if(s.button!==0||s.ctrlKey&&d){s.preventDefault();return}at(this,f,!0),j(this,Rt,Fn).call(this,s)}moveInDOM(){var s;(s=this.parent)==null||s.moveEditorInDOM(this)}_setParentAndPosition(s,d,S){s.changeParent(this),this.x=d,this.y=S,this.fixAndSetPosition()}getRect(s,d){const S=this.parentScale,[D,U]=this.pageDimensions,[w,tt]=this.pageTranslation,q=s/S,ct=d/S,ut=this.x*D,Et=this.y*U,mt=this.width*D,Ot=this.height*U;switch(this.rotation){case 0:return[ut+q+w,U-Et-ct-Ot+tt,ut+q+mt+w,U-Et-ct+tt];case 90:return[ut+ct+w,U-Et+q+tt,ut+ct+Ot+w,U-Et+q+mt+tt];case 180:return[ut-q-mt+w,U-Et+ct+tt,ut-q+w,U-Et+ct+Ot+tt];case 270:return[ut-ct-Ot+w,U-Et-q-mt+tt,ut-ct+w,U-Et-q+tt];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(s,d){const[S,D,U,w]=s,tt=U-S,q=w-D;switch(this.rotation){case 0:return[S,d-w,tt,q];case 90:return[S,d-D,q,tt];case 180:return[U,d-D,tt,q];case 270:return[U,d-w,q,tt];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){at(this,R,!0)}disableEditMode(){at(this,R,!1)}isInEditMode(){return r(this,R)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var s,d;(s=this.div)==null||s.addEventListener("focusin",r(this,u)),(d=this.div)==null||d.addEventListener("focusout",r(this,l))}serialize(){(0,n.unreachable)("An editor must be serializable")}static deserialize(s,d,S){const D=new this.prototype.constructor({parent:d,id:d.getNextId(),uiManager:S});D.rotation=s.rotation;const[U,w]=D.pageDimensions,[tt,q,ct,ut]=D.getRectInCurrentCoords(s.rect,w);return D.x=tt/U,D.y=q/w,D.width=ct/U,D.height=ut/w,D}remove(){var s;this.div.removeEventListener("focusin",r(this,u)),this.div.removeEventListener("focusout",r(this,l)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(s=r(this,p))==null||s.remove(),at(this,p,null),at(this,I,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(j(this,W,Rn).call(this),r(this,T).classList.remove("hidden"))}select(){var s;this.makeResizable(),(s=this.div)==null||s.classList.add("selectedEditor")}unselect(){var s,d,S;(s=r(this,T))==null||s.classList.add("hidden"),(d=this.div)==null||d.classList.remove("selectedEditor"),(S=this.div)!=null&&S.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(s,d){}disableEditing(){r(this,p)&&(r(this,p).hidden=!0)}enableEditing(){r(this,p)&&(r(this,p).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return r(this,v)}set isEditing(s){at(this,v,s),this.parent&&(s?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(s,d){at(this,k,!0);const S=s/d,{style:D}=this.div;D.aspectRatio=S,D.height="auto"}static get MIN_SIZE(){return 16}};let y=h;x=new WeakMap,A=new WeakMap,p=new WeakMap,I=new WeakMap,E=new WeakMap,k=new WeakMap,T=new WeakMap,u=new WeakMap,l=new WeakMap,f=new WeakMap,v=new WeakMap,R=new WeakMap,M=new WeakMap,c=new WeakMap,g=new WeakSet,Xe=function(s,d,S){let[D,U]=s;[d,S]=this.screenToPageTranslation(d,S),this.x+=d/D,this.y+=S/U,this.fixAndSetPosition()},P=new WeakSet,Ye=function(){const[s,d]=this.parentDimensions,{_borderLineWidth:S}=h,D=S/s,U=S/d;switch(this.rotation){case 90:return[-D,U];case 180:return[D,U];case 270:return[D,-U];default:return[-D,-U]}},N=new WeakSet,_e=function(s,d,S){switch(S){case 90:return[d,-s];case 180:return[-s,-d];case 270:return[-d,s];default:return[s,d]}},G=new WeakSet,Ke=function(s){switch(s){case 90:{const[d,S]=this.pageDimensions;return[0,-d/S,S/d,0]}case 180:return[-1,0,0,-1];case 270:{const[d,S]=this.pageDimensions;return[0,d/S,-S/d,0]}default:return[1,0,0,1]}},W=new WeakSet,Rn=function(){if(r(this,T))return;at(this,T,document.createElement("div")),r(this,T).classList.add("resizers");const s=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||s.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const d of s){const S=document.createElement("div");r(this,T).append(S),S.classList.add("resizer",d),S.addEventListener("pointerdown",j(this,nt,wn).bind(this,d)),S.addEventListener("contextmenu",o.noContextMenu)}this.div.prepend(r(this,T))},nt=new WeakSet,wn=function(s,d){d.preventDefault();const{isMac:S}=n.FeatureTest.platform;if(d.button!==0||d.ctrlKey&&S)return;const D=j(this,Y,Mn).bind(this,s),U=this._isDraggable;this._isDraggable=!1;const w={passive:!0,capture:!0};window.addEventListener("pointermove",D,w);const tt=this.x,q=this.y,ct=this.width,ut=this.height,Et=this.parent.div.style.cursor,mt=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(d.target).cursor;const Ot=()=>{this._isDraggable=U,window.removeEventListener("pointerup",Ot),window.removeEventListener("blur",Ot),window.removeEventListener("pointermove",D,w),this.parent.div.style.cursor=Et,this.div.style.cursor=mt;const Wt=this.x,Pt=this.y,Nt=this.width,At=this.height;Wt===tt&&Pt===q&&Nt===ct&&At===ut||this.addCommands({cmd:()=>{this.width=Nt,this.height=At,this.x=Wt,this.y=Pt;const[ht,st]=this.parentDimensions;this.setDims(ht*Nt,st*At),this.fixAndSetPosition()},undo:()=>{this.width=ct,this.height=ut,this.x=tt,this.y=q;const[ht,st]=this.parentDimensions;this.setDims(ht*ct,st*ut),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",Ot),window.addEventListener("blur",Ot)},Y=new WeakSet,Mn=function(s,d){const[S,D]=this.parentDimensions,U=this.x,w=this.y,tt=this.width,q=this.height,ct=h.MIN_SIZE/S,ut=h.MIN_SIZE/D,Et=J=>Math.round(J*1e4)/1e4,mt=j(this,G,Ke).call(this,this.rotation),Ot=(J,pt)=>[mt[0]*J+mt[2]*pt,mt[1]*J+mt[3]*pt],Wt=j(this,G,Ke).call(this,360-this.rotation),Pt=(J,pt)=>[Wt[0]*J+Wt[2]*pt,Wt[1]*J+Wt[3]*pt];let Nt,At,ht=!1,st=!1;switch(s){case"topLeft":ht=!0,Nt=(J,pt)=>[0,0],At=(J,pt)=>[J,pt];break;case"topMiddle":Nt=(J,pt)=>[J/2,0],At=(J,pt)=>[J/2,pt];break;case"topRight":ht=!0,Nt=(J,pt)=>[J,0],At=(J,pt)=>[0,pt];break;case"middleRight":st=!0,Nt=(J,pt)=>[J,pt/2],At=(J,pt)=>[0,pt/2];break;case"bottomRight":ht=!0,Nt=(J,pt)=>[J,pt],At=(J,pt)=>[0,0];break;case"bottomMiddle":Nt=(J,pt)=>[J/2,pt],At=(J,pt)=>[J/2,0];break;case"bottomLeft":ht=!0,Nt=(J,pt)=>[0,pt],At=(J,pt)=>[J,0];break;case"middleLeft":st=!0,Nt=(J,pt)=>[0,pt/2],At=(J,pt)=>[J,pt/2];break}const dt=Nt(tt,q),It=At(tt,q);let wt=Ot(...It);const Ht=Et(U+wt[0]),Xt=Et(w+wt[1]);let $t=1,Vt=1,[Kt,Jt]=this.screenToPageTranslation(d.movementX,d.movementY);if([Kt,Jt]=Pt(Kt/S,Jt/D),ht){const J=Math.hypot(tt,q);$t=Vt=Math.max(Math.min(Math.hypot(It[0]-dt[0]-Kt,It[1]-dt[1]-Jt)/J,1/tt,1/q),ct/tt,ut/q)}else st?$t=Math.max(ct,Math.min(1,Math.abs(It[0]-dt[0]-Kt)))/tt:Vt=Math.max(ut,Math.min(1,Math.abs(It[1]-dt[1]-Jt)))/q;const Zt=Et(tt*$t),Gt=Et(q*Vt);wt=Ot(...At(Zt,Gt));const yt=Ht-wt[0],Z=Xt-wt[1];this.width=Zt,this.height=Gt,this.x=yt,this.y=Z,this.setDims(S*Zt,D*Gt),this.fixAndSetPosition()},ft=new WeakSet,Je=function(){return ee(this,null,function*(){var S;const s=r(this,p);if(!s)return;if(!r(this,x)&&!r(this,A)){s.classList.remove("done"),(S=r(this,I))==null||S.remove();return}h._l10nPromise.get("editor_alt_text_edit_button_label").then(D=>{s.setAttribute("aria-label",D)});let d=r(this,I);if(!d){at(this,I,d=document.createElement("span")),d.className="tooltip",d.setAttribute("role","tooltip");const D=d.id=`alt-text-tooltip-${this.id}`;s.setAttribute("aria-describedby",D);const U=100;s.addEventListener("mouseenter",()=>{at(this,E,setTimeout(()=>{at(this,E,null),r(this,I).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},U))}),s.addEventListener("mouseleave",()=>{var w;clearTimeout(r(this,E)),at(this,E,null),(w=r(this,I))==null||w.classList.remove("show")})}s.classList.add("done"),d.innerText=r(this,A)?yield h._l10nPromise.get("editor_alt_text_decorative_tooltip"):r(this,x),d.parentNode||s.append(d)})},Rt=new WeakSet,Fn=function(s){if(!this._isDraggable)return;const d=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let S,D;d&&(S={passive:!0,capture:!0},D=w=>{const[tt,q]=this.screenToPageTranslation(w.movementX,w.movementY);this._uiManager.dragSelectedEditors(tt,q)},window.addEventListener("pointermove",D,S));const U=()=>{if(window.removeEventListener("pointerup",U),window.removeEventListener("blur",U),d&&window.removeEventListener("pointermove",D,S),at(this,f,!1),!this._uiManager.endDragSession()){const{isMac:w}=n.FeatureTest.platform;s.ctrlKey&&!w||s.shiftKey||s.metaKey&&w?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",U),window.addEventListener("blur",U)},X(y,N),ne(y,"_borderLineWidth",-1),ne(y,"_colorManager",new e.ColorManager),ne(y,"_zIndex",1),ne(y,"SMALL_EDITOR_SIZE",0),i.AnnotationEditor=y;class F extends y{constructor(s){super(s),this.annotationElementId=s.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(C,i,t)=>{var k,T,u,l,f,Qe,M,c,g,L,P,In,O,G,K,W,_,nt,rt,Y,it,ft,bt,Rt,H,h,m,s,d,S,D,U,w,tt,q,ct,ut,Et,mt,Ot,Wt,Pt,Nt,At,ht,st,dt,On,wt,Ze,Xt,je,Vt,Re,Jt,qe,Gt,tn,Z,ae,pt,be,ot,Dn,gt,Ln,St,en,vt,ye,Tt,nn;Object.defineProperty(i,"__esModule",{value:!0}),i.KeyboardManager=i.CommandManager=i.ColorManager=i.AnnotationEditorUIManager=void 0,i.bindEvents=o,i.opacityToHex=y,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 o($,a,B){for(const V of B)a.addEventListener(V,$[V].bind($))}function y($){return Math.round(Math.min(255,Math.max(1,255*$))).toString(16).padStart(2,"0")}class F{constructor(){X(this,k,0)}getId(){return`${e.AnnotationEditorPrefix}${ve(this,k)._++}`}}k=new WeakMap;const R=class{constructor(){X(this,f);X(this,T,(0,e.getUuid)());X(this,u,0);X(this,l,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)}getFromFile(a){return ee(this,null,function*(){const{lastModified:B,name:V,size:Q,type:et}=a;return j(this,f,Qe).call(this,`${B}_${V}_${Q}_${et}`,a)})}getFromUrl(a){return ee(this,null,function*(){return j(this,f,Qe).call(this,a,a)})}getFromId(a){return ee(this,null,function*(){r(this,l)||at(this,l,new Map);const B=r(this,l).get(a);return B?B.bitmap?(B.refCounter+=1,B):B.file?this.getFromFile(B.file):this.getFromUrl(B.url):null})}getSvgUrl(a){const B=r(this,l).get(a);return B!=null&&B.isSvg?B.svgUrl:null}deleteId(a){r(this,l)||at(this,l,new Map);const B=r(this,l).get(a);!B||(B.refCounter-=1,B.refCounter===0&&(B.bitmap=null))}isValidId(a){return a.startsWith(`image_${r(this,T)}_`)}};let x=R;T=new WeakMap,u=new WeakMap,l=new WeakMap,f=new WeakSet,Qe=function(a,B){return ee(this,null,function*(){r(this,l)||at(this,l,new Map);let V=r(this,l).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,T)}_${ve(this,u)._++}`,refCounter:0,isSvg:!1});let Q;if(typeof B=="string"){V.url=B;const et=yield fetch(B);if(!et.ok)throw new Error(et.statusText);Q=yield et.blob()}else Q=V.file=B;if(Q.type==="image/svg+xml"){const et=R._isSVGFittingCanvas,lt=new FileReader,Ct=new Image,Ft=new Promise((Mt,Qt)=>{Ct.onload=()=>{V.bitmap=Ct,V.isSvg=!0,Mt()},lt.onload=()=>ee(this,null,function*(){const Ut=V.svgUrl=lt.result;Ct.src=(yield et)?`${Ut}#svgView(preserveAspectRatio(none))`:Ut}),Ct.onerror=lt.onerror=Qt});lt.readAsDataURL(Q),yield Ft}else V.bitmap=yield createImageBitmap(Q);V.refCounter=1}catch(Q){console.error(Q),V=null}return r(this,l).set(a,V),V&&r(this,l).set(V.id,V),V})};class A{constructor(){X(this,M,[]);X(this,c,!1);X(this,g,void 0);X(this,L,-1);let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:128;at(this,g,a)}add(a){let{cmd:B,undo:V,mustExec:Q,type:et=NaN,overwriteIfSameType:lt=!1,keepUndo:Ct=!1}=a;if(Q&&B(),r(this,c))return;const Ft={cmd:B,undo:V,type:et};if(r(this,L)===-1){r(this,M).length>0&&(r(this,M).length=0),at(this,L,0),r(this,M).push(Ft);return}if(lt&&r(this,M)[r(this,L)].type===et){Ct&&(Ft.undo=r(this,M)[r(this,L)].undo),r(this,M)[r(this,L)]=Ft;return}const Mt=r(this,L)+1;Mt===r(this,g)?r(this,M).splice(0,1):(at(this,L,Mt),Mt<r(this,M).length&&r(this,M).splice(Mt)),r(this,M).push(Ft)}undo(){r(this,L)!==-1&&(at(this,c,!0),r(this,M)[r(this,L)].undo(),at(this,c,!1),at(this,L,r(this,L)-1))}redo(){r(this,L)<r(this,M).length-1&&(at(this,L,r(this,L)+1),at(this,c,!0),r(this,M)[r(this,L)].cmd(),at(this,c,!1))}hasSomethingToUndo(){return r(this,L)!==-1}hasSomethingToRedo(){return r(this,L)<r(this,M).length-1}destroy(){at(this,M,null)}}M=new WeakMap,c=new WeakMap,g=new WeakMap,L=new WeakMap,i.CommandManager=A;class p{constructor(a){X(this,P);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:B}=e.FeatureTest.platform;for(const[V,Q,et={}]of a)for(const lt of V){const Ct=lt.startsWith("mac+");B&&Ct?(this.callbacks.set(lt.slice(4),{callback:Q,options:et}),this.allKeys.add(lt.split("+").at(-1))):!B&&!Ct&&(this.callbacks.set(lt,{callback:Q,options:et}),this.allKeys.add(lt.split("+").at(-1)))}}exec(a,B){if(!this.allKeys.has(B.key))return;const V=this.callbacks.get(j(this,P,In).call(this,B));if(!V)return;const{callback:Q,options:{bubbles:et=!1,args:lt=[],checker:Ct=null}}=V;Ct&&!Ct(a,B)||(Q.bind(a,...lt)(),et||(B.stopPropagation(),B.preventDefault()))}}P=new WeakSet,In=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 B=this.buffer.join("+");return this.buffer.length=0,B},i.KeyboardManager=p;const N=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 B=(0,n.getRGB)(a);if(!window.matchMedia("(forced-colors: active)").matches)return B;for(const[V,Q]of this._colors)if(Q.every((et,lt)=>et===B[lt]))return N._colorsMapping.get(V);return B}getHexCode(a){const B=this._colors.get(a);return B?e.Util.makeHexColor(...B):a}};let I=N;ne(I,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]])),i.ColorManager=I;const Dt=class{constructor(a,B,V,Q,et,lt){X(this,dt);X(this,wt);X(this,Xt);X(this,Vt);X(this,Jt);X(this,Gt);X(this,Z);X(this,pt);X(this,ot);X(this,gt);X(this,St);X(this,vt);X(this,Tt);X(this,O,null);X(this,G,new Map);X(this,K,new Map);X(this,W,null);X(this,_,null);X(this,nt,new A);X(this,rt,0);X(this,Y,new Set);X(this,it,null);X(this,ft,null);X(this,bt,new Set);X(this,Rt,null);X(this,H,new F);X(this,h,!1);X(this,m,!1);X(this,s,null);X(this,d,e.AnnotationEditorType.NONE);X(this,S,new Set);X(this,D,null);X(this,U,this.blur.bind(this));X(this,w,this.focus.bind(this));X(this,tt,this.copy.bind(this));X(this,q,this.cut.bind(this));X(this,ct,this.paste.bind(this));X(this,ut,this.keydown.bind(this));X(this,Et,this.onEditingAction.bind(this));X(this,mt,this.onPageChanging.bind(this));X(this,Ot,this.onScaleChanging.bind(this));X(this,Wt,this.onRotationChanging.bind(this));X(this,Pt,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});X(this,Nt,[0,0]);X(this,At,null);X(this,ht,null);X(this,st,null);at(this,ht,a),at(this,st,B),at(this,W,V),this._eventBus=Q,this._eventBus._on("editingaction",r(this,Et)),this._eventBus._on("pagechanging",r(this,mt)),this._eventBus._on("scalechanging",r(this,Ot)),this._eventBus._on("rotationchanging",r(this,Wt)),at(this,_,et.annotationStorage),at(this,Rt,et.filterFactory),at(this,D,lt),this.viewParameters={realScale:n.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){const a=Dt.prototype,B=et=>{const{activeElement:lt}=document;return lt&&r(et,ht).contains(lt)&&et.hasSomethingToControl()},V=this.TRANSLATE_SMALL,Q=this.TRANSLATE_BIG;return(0,e.shadow)(this,"_keyboardManager",new p([[["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:B}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],a.translateSelectedEditors,{args:[-Q,0],checker:B}],[["ArrowRight","mac+ArrowRight"],a.translateSelectedEditors,{args:[V,0],checker:B}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],a.translateSelectedEditors,{args:[Q,0],checker:B}],[["ArrowUp","mac+ArrowUp"],a.translateSelectedEditors,{args:[0,-V],checker:B}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],a.translateSelectedEditors,{args:[0,-Q],checker:B}],[["ArrowDown","mac+ArrowDown"],a.translateSelectedEditors,{args:[0,V],checker:B}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],a.translateSelectedEditors,{args:[0,Q],checker:B}]]))}destroy(){j(this,Vt,Re).call(this),j(this,wt,Ze).call(this),this._eventBus._off("editingaction",r(this,Et)),this._eventBus._off("pagechanging",r(this,mt)),this._eventBus._off("scalechanging",r(this,Ot)),this._eventBus._off("rotationchanging",r(this,Wt));for(const a of r(this,K).values())a.destroy();r(this,K).clear(),r(this,G).clear(),r(this,bt).clear(),at(this,O,null),r(this,S).clear(),r(this,nt).destroy(),r(this,W).destroy()}get hcmFilter(){return(0,e.shadow)(this,"hcmFilter",r(this,D)?r(this,Rt).addHCMFilter(r(this,D).foreground,r(this,D).background):"none")}get direction(){return(0,e.shadow)(this,"direction",getComputedStyle(r(this,ht)).direction)}editAltText(a){var B;(B=r(this,W))==null||B.editAltText(this,a)}onPageChanging(a){let{pageNumber:B}=a;at(this,rt,B-1)}focusMainContainer(){r(this,ht).focus()}findParent(a,B){for(const V of r(this,K).values()){const{x:Q,y:et,width:lt,height:Ct}=V.div.getBoundingClientRect();if(a>=Q&&a<=Q+lt&&B>=et&&B<=et+Ct)return V}return null}disableUserSelect(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;r(this,st).classList.toggle("noUserSelect",a)}addShouldRescale(a){r(this,bt).add(a)}removeShouldRescale(a){r(this,bt).delete(a)}onScaleChanging(a){let{scale:B}=a;this.commitOrRemove(),this.viewParameters.realScale=B*n.PixelsPerInch.PDF_TO_CSS_UNITS;for(const V of r(this,bt))V.onScaleChanging()}onRotationChanging(a){let{pagesRotation:B}=a;this.commitOrRemove(),this.viewParameters.rotation=B}addToAnnotationStorage(a){!a.isEmpty()&&r(this,_)&&!r(this,_).has(a.id)&&r(this,_).setValue(a.id,a)}blur(){if(!this.hasSelection)return;const{activeElement:a}=document;for(const B of r(this,S))if(B.div.contains(a)){at(this,s,[B,a]),B._focusEventsAllowed=!1;break}}focus(){if(!r(this,s))return;const[a,B]=r(this,s);at(this,s,null),B.addEventListener("focusin",()=>{a._focusEventsAllowed=!0},{once:!0}),B.focus()}addEditListeners(){j(this,Xt,je).call(this),j(this,Jt,qe).call(this)}removeEditListeners(){j(this,Vt,Re).call(this),j(this,Gt,tn).call(this)}copy(a){var V;if(a.preventDefault(),(V=r(this,O))==null||V.commitOrRemove(),!this.hasSelection)return;const B=[];for(const Q of r(this,S)){const et=Q.serialize(!0);et&&B.push(et)}B.length!==0&&a.clipboardData.setData("application/pdfjs",JSON.stringify(B))}cut(a){this.copy(a),this.delete()}paste(a){a.preventDefault();const{clipboardData:B}=a;for(const et of B.items)for(const lt of r(this,ft))if(lt.isHandlingMimeForPasting(et.type)){lt.paste(et,this.currentLayer);return}let V=B.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 Ft of V){const Mt=Q.deserialize(Ft);if(!Mt)return;et.push(Mt)}const lt=()=>{for(const Ft of et)j(this,St,en).call(this,Ft);j(this,Tt,nn).call(this,et)},Ct=()=>{for(const Ft of et)Ft.remove()};this.addCommands({cmd:lt,undo:Ct,mustExec:!0})}catch(et){(0,e.warn)(`paste: "${et.message}".`)}}keydown(a){var B;(B=this.getActive())!=null&&B.shouldGetKeyboardEvents()||Dt._keyboardManager.exec(this,a)}onEditingAction(a){["undo","redo","delete","selectAll"].includes(a.name)&&this[a.name]()}setEditingState(a){a?(j(this,dt,On).call(this),j(this,Xt,je).call(this),j(this,Jt,qe).call(this),j(this,Z,ae).call(this,{isEditing:r(this,d)!==e.AnnotationEditorType.NONE,isEmpty:j(this,vt,ye).call(this),hasSomethingToUndo:r(this,nt).hasSomethingToUndo(),hasSomethingToRedo:r(this,nt).hasSomethingToRedo(),hasSelectedEditor:!1})):(j(this,wt,Ze).call(this),j(this,Vt,Re).call(this),j(this,Gt,tn).call(this),j(this,Z,ae).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(a){if(!r(this,ft)){at(this,ft,a);for(const B of r(this,ft))j(this,pt,be).call(this,B.defaultPropertiesToUpdate)}}getId(){return r(this,H).getId()}get currentLayer(){return r(this,K).get(r(this,rt))}getLayer(a){return r(this,K).get(a)}get currentPageIndex(){return r(this,rt)}addLayer(a){r(this,K).set(a.pageIndex,a),r(this,h)?a.enable():a.disable()}removeLayer(a){r(this,K).delete(a.pageIndex)}updateMode(a){let B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(r(this,d)!==a){if(at(this,d,a),a===e.AnnotationEditorType.NONE){this.setEditingState(!1),j(this,gt,Ln).call(this);return}this.setEditingState(!0),j(this,ot,Dn).call(this),this.unselectAll();for(const V of r(this,K).values())V.updateMode(a);if(!!B){for(const V of r(this,G).values())if(V.annotationElementId===B){this.setSelected(V),V.enterInEditMode();break}}}}updateToolbar(a){a!==r(this,d)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:a})}updateParams(a,B){if(!!r(this,ft)){if(a===e.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(a);return}for(const V of r(this,S))V.updateParams(a,B);for(const V of r(this,ft))V.updateDefaultParams(a,B)}}enableWaiting(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(r(this,m)!==a){at(this,m,a);for(const B of r(this,K).values())a?B.disableClick():B.enableClick(),B.div.classList.toggle("waiting",a)}}getEditors(a){const B=[];for(const V of r(this,G).values())V.pageIndex===a&&B.push(V);return B}getEditor(a){return r(this,G).get(a)}addEditor(a){r(this,G).set(a.id,a)}removeEditor(a){var B;r(this,G).delete(a.id),this.unselect(a),(!a.annotationElementId||!r(this,Y).has(a.annotationElementId))&&((B=r(this,_))==null||B.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&&(at(this,O,a),a&&j(this,pt,be).call(this,a.propertiesToUpdate))}toggleSelected(a){if(r(this,S).has(a)){r(this,S).delete(a),a.unselect(),j(this,Z,ae).call(this,{hasSelectedEditor:this.hasSelection});return}r(this,S).add(a),a.select(),j(this,pt,be).call(this,a.propertiesToUpdate),j(this,Z,ae).call(this,{hasSelectedEditor:!0})}setSelected(a){for(const B of r(this,S))B!==a&&B.unselect();r(this,S).clear(),r(this,S).add(a),a.select(),j(this,pt,be).call(this,a.propertiesToUpdate),j(this,Z,ae).call(this,{hasSelectedEditor:!0})}isSelected(a){return r(this,S).has(a)}unselect(a){a.unselect(),r(this,S).delete(a),j(this,Z,ae).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return r(this,S).size!==0}undo(){r(this,nt).undo(),j(this,Z,ae).call(this,{hasSomethingToUndo:r(this,nt).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:j(this,vt,ye).call(this)})}redo(){r(this,nt).redo(),j(this,Z,ae).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:r(this,nt).hasSomethingToRedo(),isEmpty:j(this,vt,ye).call(this)})}addCommands(a){r(this,nt).add(a),j(this,Z,ae).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:j(this,vt,ye).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const a=[...r(this,S)],B=()=>{for(const Q of a)Q.remove()},V=()=>{for(const Q of a)j(this,St,en).call(this,Q)};this.addCommands({cmd:B,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,S))a.commit();j(this,Tt,nn).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,S))a.unselect();r(this,S).clear(),j(this,Z,ae).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(a,B){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]+=B;const[Q,et]=r(this,Nt),lt=[...r(this,S)],Ct=1e3;r(this,At)&&clearTimeout(r(this,At)),at(this,At,setTimeout(()=>{at(this,At,null),r(this,Nt)[0]=r(this,Nt)[1]=0,this.addCommands({cmd:()=>{for(const Ft of lt)r(this,G).has(Ft.id)&&Ft.translateInPage(Q,et)},undo:()=>{for(const Ft of lt)r(this,G).has(Ft.id)&&Ft.translateInPage(-Q,-et)},mustExec:!1})},Ct));for(const Ft of lt)Ft.translateInPage(a,B)}setUpDragSession(){if(!!this.hasSelection){this.disableUserSelect(!0),at(this,it,new Map);for(const a of r(this,S))r(this,it).set(a,{savedX:a.x,savedY:a.y,savedPageIndex:a.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!r(this,it))return!1;this.disableUserSelect(!1);const a=r(this,it);at(this,it,null);let B=!1;for(const[{x:Q,y:et,pageIndex:lt},Ct]of a)Ct.newX=Q,Ct.newY=et,Ct.newPageIndex=lt,B||(B=Q!==Ct.savedX||et!==Ct.savedY||lt!==Ct.savedPageIndex);if(!B)return!1;const V=(Q,et,lt,Ct)=>{if(r(this,G).has(Q.id)){const Ft=r(this,K).get(Ct);Ft?Q._setParentAndPosition(Ft,et,lt):(Q.pageIndex=Ct,Q.x=et,Q.y=lt)}};return this.addCommands({cmd:()=>{for(const[Q,{newX:et,newY:lt,newPageIndex:Ct}]of a)V(Q,et,lt,Ct)},undo:()=>{for(const[Q,{savedX:et,savedY:lt,savedPageIndex:Ct}]of a)V(Q,et,lt,Ct)},mustExec:!0}),!0}dragSelectedEditors(a,B){if(!!r(this,it))for(const V of r(this,it).keys())V.drag(a,B)}rebuild(a){if(a.parent===null){const B=this.getLayer(a.pageIndex);B?(B.changeParent(a),B.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,d)}get imageManager(){return(0,e.shadow)(this,"imageManager",new x)}};let E=Dt;O=new WeakMap,G=new WeakMap,K=new WeakMap,W=new WeakMap,_=new WeakMap,nt=new WeakMap,rt=new WeakMap,Y=new WeakMap,it=new WeakMap,ft=new WeakMap,bt=new WeakMap,Rt=new WeakMap,H=new WeakMap,h=new WeakMap,m=new WeakMap,s=new WeakMap,d=new WeakMap,S=new WeakMap,D=new WeakMap,U=new WeakMap,w=new WeakMap,tt=new WeakMap,q=new WeakMap,ct=new WeakMap,ut=new WeakMap,Et=new WeakMap,mt=new WeakMap,Ot=new WeakMap,Wt=new WeakMap,Pt=new WeakMap,Nt=new WeakMap,At=new WeakMap,ht=new WeakMap,st=new WeakMap,dt=new WeakSet,On=function(){window.addEventListener("focus",r(this,w)),window.addEventListener("blur",r(this,U))},wt=new WeakSet,Ze=function(){window.removeEventListener("focus",r(this,w)),window.removeEventListener("blur",r(this,U))},Xt=new WeakSet,je=function(){window.addEventListener("keydown",r(this,ut),{capture:!0})},Vt=new WeakSet,Re=function(){window.removeEventListener("keydown",r(this,ut),{capture:!0})},Jt=new WeakSet,qe=function(){document.addEventListener("copy",r(this,tt)),document.addEventListener("cut",r(this,q)),document.addEventListener("paste",r(this,ct))},Gt=new WeakSet,tn=function(){document.removeEventListener("copy",r(this,tt)),document.removeEventListener("cut",r(this,q)),document.removeEventListener("paste",r(this,ct))},Z=new WeakSet,ae=function(a){Object.entries(a).some(V=>{let[Q,et]=V;return r(this,Pt)[Q]!==et})&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(r(this,Pt),a)})},pt=new WeakSet,be=function(a){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:a})},ot=new WeakSet,Dn=function(){if(!r(this,h)){at(this,h,!0);for(const a of r(this,K).values())a.enable()}},gt=new WeakSet,Ln=function(){if(this.unselectAll(),r(this,h)){at(this,h,!1);for(const a of r(this,K).values())a.disable()}},St=new WeakSet,en=function(a){const B=r(this,K).get(a.pageIndex);B?B.addOrRebuild(a):this.addEditor(a)},vt=new WeakSet,ye=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,nn=function(a){r(this,S).clear();for(const B of a)B.isEmpty()||(r(this,S).add(B),B.select());j(this,Z,ae).call(this,{hasSelectedEditor:!0})},ne(E,"TRANSLATE_SMALL",1),ne(E,"TRANSLATE_BIG",10),i.AnnotationEditorUIManager=E},(C,i,t)=>{var e=t(3),n=t(6),o=t(4),y=t(24),F=t(14),x=t(8),A=t(21),p=t(20),I=t(91),E=t(39),k=t(77),T=t(64),u=t(159),l=t(7),f=t(167),v=t(27),R=o.JSON,M=o.Number,c=o.SyntaxError,g=R&&R.parse,L=y("Object","keys"),P=Object.getOwnPropertyDescriptor,b=F("".charAt),N=F("".slice),O=F(/./.exec),G=F([].push),K=/^\d$/,W=/^[1-9]$/,_=/^(?:-|\d)$/,nt=/^[\t\n\r ]$/,rt=0,Y=1,it=function(s,d){s=k(s);var S=new H(s,0),D=S.parse(),U=D.value,w=S.skip(nt,D.end);if(w<s.length)throw c('Unexpected extra character: "'+b(s,w)+'" after the parsed data at: '+w);return A(d)?ft({"":U},"",d,D):U},ft=function(s,d,S,D){var U=s[d],w=D&&U===D.value,tt=w&&typeof D.source=="string"?{source:D.source}:{},q,ct,ut,Et,mt;if(p(U)){var Ot=I(U),Wt=w?D.nodes:Ot?[]:{};if(Ot)for(q=Wt.length,ut=T(U),Et=0;Et<ut;Et++)bt(U,Et,ft(U,""+Et,S,Et<q?Wt[Et]:void 0));else for(ct=L(U),ut=T(ct),Et=0;Et<ut;Et++)mt=ct[Et],bt(U,mt,ft(U,mt,S,E(Wt,mt)?Wt[mt]:void 0))}return x(S,s,d,U,tt)},bt=function(s,d,S){if(n){var D=P(s,d);if(D&&!D.configurable)return}S===void 0?delete s[d]:u(s,d,S)},Rt=function(s,d,S,D){this.value=s,this.end=d,this.source=S,this.nodes=D},H=function(s,d){this.source=s,this.index=d};H.prototype={fork:function(s){return new H(this.source,s)},parse:function(){var s=this.source,d=this.skip(nt,this.index),S=this.fork(d),D=b(s,d);if(O(_,D))return S.number();switch(D){case"{":return S.object();case"[":return S.array();case'"':return S.string();case"t":return S.keyword(!0);case"f":return S.keyword(!1);case"n":return S.keyword(null)}throw c('Unexpected character: "'+D+'" at: '+d)},node:function(s,d,S,D,U){return new Rt(d,D,s?null:N(this.source,S,D),U)},object:function(){for(var s=this.source,d=this.index+1,S=!1,D={},U={};d<s.length;){if(d=this.until(['"',"}"],d),b(s,d)==="}"&&!S){d++;break}var w=this.fork(d).string(),tt=w.value;d=w.end,d=this.until([":"],d)+1,d=this.skip(nt,d),w=this.fork(d).parse(),u(U,tt,w),u(D,tt,w.value),d=this.until([",","}"],w.end);var q=b(s,d);if(q===",")S=!0,d++;else if(q==="}"){d++;break}}return this.node(Y,D,this.index,d,U)},array:function(){for(var s=this.source,d=this.index+1,S=!1,D=[],U=[];d<s.length;){if(d=this.skip(nt,d),b(s,d)==="]"&&!S){d++;break}var w=this.fork(d).parse();if(G(U,w),G(D,w.value),d=this.until([",","]"],w.end),b(s,d)===",")S=!0,d++;else if(b(s,d)==="]"){d++;break}}return this.node(Y,D,this.index,d,U)},string:function(){var s=this.index,d=f(this.source,this.index+1);return this.node(rt,d.value,s,d.end)},number:function(){var s=this.source,d=this.index,S=d;if(b(s,S)==="-"&&S++,b(s,S)==="0")S++;else if(O(W,b(s,S)))S=this.skip(K,++S);else throw c("Failed to parse number at: "+S);if(b(s,S)==="."&&(S=this.skip(K,++S)),b(s,S)==="e"||b(s,S)==="E"){S++,(b(s,S)==="+"||b(s,S)==="-")&&S++;var D=S;if(S=this.skip(K,S),D===S)throw c("Failed to parse number's exponent value at: "+S)}return this.node(rt,M(N(s,d,S)),d,S)},keyword:function(s){var d=""+s,S=this.index,D=S+d.length;if(N(this.source,S,D)!==d)throw c("Failed to parse value at: "+S);return this.node(rt,s,S,D)},skip:function(s,d){for(var S=this.source;d<S.length&&O(s,b(S,d));d++);return d},until:function(s,d){d=this.skip(nt,d);for(var S=b(this.source,d),D=0;D<s.length;D++)if(s[D]===S)return d;throw c('Unexpected character: "'+S+'" at: '+d)}};var h=l(function(){var s="9007199254740993",d;return g(s,function(S,D,U){d=U.source}),d!==s}),m=v&&!l(function(){return 1/g("-0 ")!==-1/0});e({target:"JSON",stat:!0,forced:h},{parse:function(d,S){return m&&!A(S)?g(d):it(d,S)}})},(C,i,t)=>{var e=t(14),n=t(39),o=SyntaxError,y=parseInt,F=String.fromCharCode,x=e("".charAt),A=e("".slice),p=e(/./.exec),I={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":`
  2. `,"\\r":"\r","\\t":" "},E=/^[\da-f]{4}$/i,k=/^[\u0000-\u001F]$/;C.exports=function(T,u){for(var l=!0,f="";u<T.length;){var v=x(T,u);if(v==="\\"){var R=A(T,u,u+2);if(n(I,R))f+=I[R],u+=2;else if(R==="\\u"){u+=2;var M=A(T,u,u+4);if(!p(E,M))throw o("Bad Unicode escape at: "+u);f+=F(y(M,16)),u+=4}else throw o('Unknown escape sequence: "'+R+'"')}else if(v==='"'){l=!1,u++;break}else{if(p(k,v))throw o("Bad control character in string literal at: "+u);f+=v,u++}}if(l)throw o("Unterminated string at: "+u);return{value:f,end:u}}},(C,i,t)=>{var rt,Y,it,ft,bt,Rt,H,h,m,s,d,S,de,U,fe,tt,rn,ct,we,Et,Me,Ot,Ae,Pt,Se;Object.defineProperty(i,"__esModule",{value:!0}),i.StatTimer=i.RenderingCancelledException=i.PixelsPerInch=i.PageViewport=i.PDFDateString=i.DOMStandardFontDataFactory=i.DOMSVGFactory=i.DOMFilterFactory=i.DOMCanvasFactory=i.DOMCMapReaderFactory=void 0,i.deprecated=L,i.getColorValues=G,i.getCurrentTransform=K,i.getCurrentTransformInverse=W,i.getFilenameFromUrl=f,i.getPdfFilenameFromUrl=v,i.getRGB=O,i.getXfaPageViewport=N,i.isDataScheme=u,i.isPdfFile=l,i.isValidFetchUrl=M,i.loadScript=g,i.noContextMenu=c,i.setLayerDimensions=_,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 o="http://www.w3.org/2000/svg",nt=class{};let y=nt;ne(y,"CSS",96),ne(y,"PDF",72),ne(y,"PDF_TO_CSS_UNITS",nt.CSS/nt.PDF),i.PixelsPerInch=y;class F extends e.BaseFilterFactory{constructor(){let{docId:st,ownerDocument:dt=globalThis.document}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super();X(this,S);X(this,U);X(this,tt);X(this,ct);X(this,Et);X(this,Ot);X(this,Pt);X(this,rt,void 0);X(this,Y,void 0);X(this,it,void 0);X(this,ft,void 0);X(this,bt,void 0);X(this,Rt,void 0);X(this,H,void 0);X(this,h,void 0);X(this,m,void 0);X(this,s,void 0);X(this,d,0);at(this,it,st),at(this,ft,dt)}addFilter(st){if(!st)return"none";let dt=r(this,S,de).get(st);if(dt)return dt;let It,wt,Ht,Xt;if(st.length===1){const Jt=st[0],Zt=new Array(256);for(let Gt=0;Gt<256;Gt++)Zt[Gt]=Jt[Gt]/255;Xt=It=wt=Ht=Zt.join(",")}else{const[Jt,Zt,Gt]=st,yt=new Array(256),Z=new Array(256),J=new Array(256);for(let pt=0;pt<256;pt++)yt[pt]=Jt[pt]/255,Z[pt]=Zt[pt]/255,J[pt]=Gt[pt]/255;It=yt.join(","),wt=Z.join(","),Ht=J.join(","),Xt=`${It}${wt}${Ht}`}if(dt=r(this,S,de).get(Xt),dt)return r(this,S,de).set(st,dt),dt;const $t=`g_${r(this,it)}_transfer_map_${ve(this,d)._++}`,Vt=`url(#${$t})`;r(this,S,de).set(st,Vt),r(this,S,de).set(Xt,Vt);const Kt=j(this,ct,we).call(this,$t);return j(this,Ot,Ae).call(this,It,wt,Ht,Kt),Vt}addHCMFilter(st,dt){var Zt;const It=`${st}-${dt}`;if(r(this,Rt)===It)return r(this,H);if(at(this,Rt,It),at(this,H,"none"),(Zt=r(this,bt))==null||Zt.remove(),!st||!dt)return r(this,H);const wt=j(this,Pt,Se).call(this,st);st=n.Util.makeHexColor(...wt);const Ht=j(this,Pt,Se).call(this,dt);if(dt=n.Util.makeHexColor(...Ht),r(this,U,fe).style.color="",st==="#000000"&&dt==="#ffffff"||st===dt)return r(this,H);const Xt=new Array(256);for(let Gt=0;Gt<=255;Gt++){const yt=Gt/255;Xt[Gt]=yt<=.03928?yt/12.92:ze((yt+.055)/1.055,2.4)}const $t=Xt.join(","),Vt=`g_${r(this,it)}_hcm_filter`,Kt=at(this,h,j(this,ct,we).call(this,Vt));j(this,Ot,Ae).call(this,$t,$t,$t,Kt),j(this,tt,rn).call(this,Kt);const Jt=(Gt,yt)=>{const Z=wt[Gt]/255,J=Ht[Gt]/255,pt=new Array(yt+1);for(let jt=0;jt<=yt;jt++)pt[jt]=Z+jt/yt*(J-Z);return pt.join(",")};return j(this,Ot,Ae).call(this,Jt(0,5),Jt(1,5),Jt(2,5),Kt),at(this,H,`url(#${Vt})`),r(this,H)}addHighlightHCMFilter(st,dt,It,wt){var J;const Ht=`${st}-${dt}-${It}-${wt}`;if(r(this,m)===Ht)return r(this,s);if(at(this,m,Ht),at(this,s,"none"),(J=r(this,h))==null||J.remove(),!st||!dt)return r(this,s);const[Xt,$t]=[st,dt].map(j(this,Pt,Se).bind(this));let Vt=Math.round(.2126*Xt[0]+.7152*Xt[1]+.0722*Xt[2]),Kt=Math.round(.2126*$t[0]+.7152*$t[1]+.0722*$t[2]),[Jt,Zt]=[It,wt].map(j(this,Pt,Se).bind(this));Kt<Vt&&([Vt,Kt,Jt,Zt]=[Kt,Vt,Zt,Jt]),r(this,U,fe).style.color="";const Gt=(pt,jt,ot)=>{const z=new Array(256),gt=(Kt-Vt)/ot,xt=pt/255,St=(jt-pt)/(255*ot);let kt=0;for(let vt=0;vt<=ot;vt++){const zt=Math.round(Vt+vt*gt),Tt=xt+vt*St;for(let Lt=kt;Lt<=zt;Lt++)z[Lt]=Tt;kt=zt+1}for(let vt=kt;vt<256;vt++)z[vt]=z[kt-1];return z.join(",")},yt=`g_${r(this,it)}_hcm_highlight_filter`,Z=at(this,h,j(this,ct,we).call(this,yt));return j(this,tt,rn).call(this,Z),j(this,Ot,Ae).call(this,Gt(Jt[0],Zt[0],5),Gt(Jt[1],Zt[1],5),Gt(Jt[2],Zt[2],5),Z),at(this,s,`url(#${yt})`),r(this,s)}destroy(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&(r(this,H)||r(this,s))||(r(this,Y)&&(r(this,Y).parentNode.parentNode.remove(),at(this,Y,null)),r(this,rt)&&(r(this,rt).clear(),at(this,rt,null)),at(this,d,0))}}rt=new WeakMap,Y=new WeakMap,it=new WeakMap,ft=new WeakMap,bt=new WeakMap,Rt=new WeakMap,H=new WeakMap,h=new WeakMap,m=new WeakMap,s=new WeakMap,d=new WeakMap,S=new WeakSet,de=function(){return r(this,rt)||at(this,rt,new Map)},U=new WeakSet,fe=function(){if(!r(this,Y)){const st=r(this,ft).createElement("div"),{style:dt}=st;dt.visibility="hidden",dt.contain="strict",dt.width=dt.height=0,dt.position="absolute",dt.top=dt.left=0,dt.zIndex=-1;const It=r(this,ft).createElementNS(o,"svg");It.setAttribute("width",0),It.setAttribute("height",0),at(this,Y,r(this,ft).createElementNS(o,"defs")),st.append(It),It.append(r(this,Y)),r(this,ft).body.append(st)}return r(this,Y)},tt=new WeakSet,rn=function(st){const dt=r(this,ft).createElementNS(o,"feColorMatrix");dt.setAttribute("type","matrix"),dt.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"),st.append(dt)},ct=new WeakSet,we=function(st){const dt=r(this,ft).createElementNS(o,"filter");return dt.setAttribute("color-interpolation-filters","sRGB"),dt.setAttribute("id",st),r(this,U,fe).append(dt),dt},Et=new WeakSet,Me=function(st,dt,It){const wt=r(this,ft).createElementNS(o,dt);wt.setAttribute("type","discrete"),wt.setAttribute("tableValues",It),st.append(wt)},Ot=new WeakSet,Ae=function(st,dt,It,wt){const Ht=r(this,ft).createElementNS(o,"feComponentTransfer");wt.append(Ht),j(this,Et,Me).call(this,Ht,"feFuncR",st),j(this,Et,Me).call(this,Ht,"feFuncG",dt),j(this,Et,Me).call(this,Ht,"feFuncB",It)},Pt=new WeakSet,Se=function(st){return r(this,U,fe).style.color=st,O(getComputedStyle(r(this,U,fe)).getPropertyValue("color"))},i.DOMFilterFactory=F;class x extends e.BaseCanvasFactory{constructor(){let{ownerDocument:ht=globalThis.document}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this._document=ht}_createCanvas(ht,st){const dt=this._document.createElement("canvas");return dt.width=ht,dt.height=st,dt}}i.DOMCanvasFactory=x;function A(ht){return ee(this,arguments,function*(At){let st=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(M(At,document.baseURI)){const dt=yield fetch(At);if(!dt.ok)throw new Error(dt.statusText);return st?new Uint8Array(yield dt.arrayBuffer()):(0,n.stringToBytes)(yield dt.text())}return new Promise((dt,It)=>{const wt=new XMLHttpRequest;wt.open("GET",At,!0),st&&(wt.responseType="arraybuffer"),wt.onreadystatechange=()=>{if(wt.readyState===XMLHttpRequest.DONE){if(wt.status===200||wt.status===0){let Ht;if(st&&wt.response?Ht=new Uint8Array(wt.response):!st&&wt.responseText&&(Ht=(0,n.stringToBytes)(wt.responseText)),Ht){dt(Ht);return}}It(new Error(wt.statusText))}},wt.send(null)})})}class p extends e.BaseCMapReaderFactory{_fetchData(ht,st){return A(ht,this.isCompressed).then(dt=>({cMapData:dt,compressionType:st}))}}i.DOMCMapReaderFactory=p;class I extends e.BaseStandardFontDataFactory{_fetchData(ht){return A(ht,!0)}}i.DOMStandardFontDataFactory=I;class E extends e.BaseSVGFactory{_createSVG(ht){return document.createElementNS(o,ht)}}i.DOMSVGFactory=E;class k{constructor(ht){let{viewBox:st,scale:dt,rotation:It,offsetX:wt=0,offsetY:Ht=0,dontFlip:Xt=!1}=ht;this.viewBox=st,this.scale=dt,this.rotation=It,this.offsetX=wt,this.offsetY=Ht;const $t=(st[2]+st[0])/2,Vt=(st[3]+st[1])/2;let Kt,Jt,Zt,Gt;switch(It%=360,It<0&&(It+=360),It){case 180:Kt=-1,Jt=0,Zt=0,Gt=1;break;case 90:Kt=0,Jt=1,Zt=1,Gt=0;break;case 270:Kt=0,Jt=-1,Zt=-1,Gt=0;break;case 0:Kt=1,Jt=0,Zt=0,Gt=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}Xt&&(Zt=-Zt,Gt=-Gt);let yt,Z,J,pt;Kt===0?(yt=Math.abs(Vt-st[1])*dt+wt,Z=Math.abs($t-st[0])*dt+Ht,J=(st[3]-st[1])*dt,pt=(st[2]-st[0])*dt):(yt=Math.abs($t-st[0])*dt+wt,Z=Math.abs(Vt-st[1])*dt+Ht,J=(st[2]-st[0])*dt,pt=(st[3]-st[1])*dt),this.transform=[Kt*dt,Jt*dt,Zt*dt,Gt*dt,yt-Kt*dt*$t-Zt*dt*Vt,Z-Jt*dt*$t-Gt*dt*Vt],this.width=J,this.height=pt}get rawDims(){const{viewBox:ht}=this;return(0,n.shadow)(this,"rawDims",{pageWidth:ht[2]-ht[0],pageHeight:ht[3]-ht[1],pageX:ht[0],pageY:ht[1]})}clone(){let{scale:ht=this.scale,rotation:st=this.rotation,offsetX:dt=this.offsetX,offsetY:It=this.offsetY,dontFlip:wt=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new k({viewBox:this.viewBox.slice(),scale:ht,rotation:st,offsetX:dt,offsetY:It,dontFlip:wt})}convertToViewportPoint(ht,st){return n.Util.applyTransform([ht,st],this.transform)}convertToViewportRectangle(ht){const st=n.Util.applyTransform([ht[0],ht[1]],this.transform),dt=n.Util.applyTransform([ht[2],ht[3]],this.transform);return[st[0],st[1],dt[0],dt[1]]}convertToPdfPoint(ht,st){return n.Util.applyInverseTransform([ht,st],this.transform)}}i.PageViewport=k;class T extends n.BaseException{constructor(ht){let st=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;super(ht,"RenderingCancelledException"),this.extraDelay=st}}i.RenderingCancelledException=T;function u(At){const ht=At.length;let st=0;for(;st<ht&&At[st].trim()==="";)st++;return At.substring(st,st+5).toLowerCase()==="data:"}function l(At){return typeof At=="string"&&/\.pdf$/i.test(At)}function f(At){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)||([At]=At.split(/[#?]/,1)),At.substring(At.lastIndexOf("/")+1)}function v(At){let ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"document.pdf";if(typeof At!="string")return ht;if(u(At))return(0,n.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),ht;const st=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,dt=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,It=st.exec(At);let wt=dt.exec(It[1])||dt.exec(It[2])||dt.exec(It[3]);if(wt&&(wt=wt[0],wt.includes("%")))try{wt=dt.exec(decodeURIComponent(wt))[0]}catch(Ht){}return wt||ht}class R{constructor(){ne(this,"started",Object.create(null));ne(this,"times",[])}time(ht){ht in this.started&&(0,n.warn)(`Timer is already running for ${ht}`),this.started[ht]=Date.now()}timeEnd(ht){ht in this.started||(0,n.warn)(`Timer has not been started for ${ht}`),this.times.push({name:ht,start:this.started[ht],end:Date.now()}),delete this.started[ht]}toString(){const ht=[];let st=0;for(const{name:dt}of this.times)st=Math.max(dt.length,st);for(const{name:dt,start:It,end:wt}of this.times)ht.push(`${dt.padEnd(st)} ${wt-It}ms
  3. `);return ht.join("")}}i.StatTimer=R;function M(At,ht){try{const{protocol:st}=ht?new URL(At,ht):new URL(At);return st==="http:"||st==="https:"}catch(st){return!1}}function c(At){At.preventDefault()}function g(At){let ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return new Promise((st,dt)=>{const It=document.createElement("script");It.src=At,It.onload=function(wt){ht&&It.remove(),st(wt)},It.onerror=function(){dt(new Error(`Cannot load script at: ${It.src}`))},(document.head||document.documentElement).append(It)})}function L(At){console.log("Deprecated API usage: "+At)}let P;class b{static toDateObject(ht){if(!ht||typeof ht!="string")return null;P||(P=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const st=P.exec(ht);if(!st)return null;const dt=parseInt(st[1],10);let It=parseInt(st[2],10);It=It>=1&&It<=12?It-1:0;let wt=parseInt(st[3],10);wt=wt>=1&&wt<=31?wt:1;let Ht=parseInt(st[4],10);Ht=Ht>=0&&Ht<=23?Ht:0;let Xt=parseInt(st[5],10);Xt=Xt>=0&&Xt<=59?Xt:0;let $t=parseInt(st[6],10);$t=$t>=0&&$t<=59?$t:0;const Vt=st[7]||"Z";let Kt=parseInt(st[8],10);Kt=Kt>=0&&Kt<=23?Kt:0;let Jt=parseInt(st[9],10)||0;return Jt=Jt>=0&&Jt<=59?Jt:0,Vt==="-"?(Ht+=Kt,Xt+=Jt):Vt==="+"&&(Ht-=Kt,Xt-=Jt),new Date(Date.UTC(dt,It,wt,Ht,Xt,$t))}}i.PDFDateString=b;function N(At,ht){let{scale:st=1,rotation:dt=0}=ht;const{width:It,height:wt}=At.attributes.style,Ht=[0,0,parseInt(It),parseInt(wt)];return new k({viewBox:Ht,scale:st,rotation:dt})}function O(At){if(At.startsWith("#")){const ht=parseInt(At.slice(1),16);return[(ht&16711680)>>16,(ht&65280)>>8,ht&255]}return At.startsWith("rgb(")?At.slice(4,-1).split(",").map(ht=>parseInt(ht)):At.startsWith("rgba(")?At.slice(5,-1).split(",").map(ht=>parseInt(ht)).slice(0,3):((0,n.warn)(`Not a valid color format: "${At}"`),[0,0,0])}function G(At){const ht=document.createElement("span");ht.style.visibility="hidden",document.body.append(ht);for(const st of At.keys()){ht.style.color=st;const dt=window.getComputedStyle(ht).color;At.set(st,O(dt))}ht.remove()}function K(At){const{a:ht,b:st,c:dt,d:It,e:wt,f:Ht}=At.getTransform();return[ht,st,dt,It,wt,Ht]}function W(At){const{a:ht,b:st,c:dt,d:It,e:wt,f:Ht}=At.getTransform().invertSelf();return[ht,st,dt,It,wt,Ht]}function _(At,ht){let st=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,dt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;if(ht instanceof k){const{pageWidth:It,pageHeight:wt}=ht.rawDims,{style:Ht}=At,Xt=n.FeatureTest.isCSSRoundSupported,$t=`var(--scale-factor) * ${It}px`,Vt=`var(--scale-factor) * ${wt}px`,Kt=Xt?`round(${$t}, 1px)`:`calc(${$t})`,Jt=Xt?`round(${Vt}, 1px)`:`calc(${Vt})`;!st||ht.rotation%180===0?(Ht.width=Kt,Ht.height=Jt):(Ht.width=Jt,Ht.height=Kt)}dt&&At.setAttribute("data-main-rotation",ht.rotation)}},(C,i,t)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BaseStandardFontDataFactory=i.BaseSVGFactory=i.BaseFilterFactory=i.BaseCanvasFactory=i.BaseCMapReaderFactory=void 0,t(2);var e=t(1);class n{constructor(){this.constructor===n&&(0,e.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(p){return"none"}addHCMFilter(p,I){return"none"}addHighlightHCMFilter(p,I,E,k){return"none"}destroy(){}}i.BaseFilterFactory=n;class o{constructor(){this.constructor===o&&(0,e.unreachable)("Cannot initialize BaseCanvasFactory.")}create(p,I){if(p<=0||I<=0)throw new Error("Invalid canvas size");const E=this._createCanvas(p,I);return{canvas:E,context:E.getContext("2d")}}reset(p,I,E){if(!p.canvas)throw new Error("Canvas is not specified");if(I<=0||E<=0)throw new Error("Invalid canvas size");p.canvas.width=I,p.canvas.height=E}destroy(p){if(!p.canvas)throw new Error("Canvas is not specified");p.canvas.width=0,p.canvas.height=0,p.canvas=null,p.context=null}_createCanvas(p,I){(0,e.unreachable)("Abstract method `_createCanvas` called.")}}i.BaseCanvasFactory=o;class y{constructor(p){let{baseUrl:I=null,isCompressed:E=!0}=p;this.constructor===y&&(0,e.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=I,this.isCompressed=E}fetch(p){return ee(this,null,function*(){let{name:I}=p;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!I)throw new Error("CMap name must be specified.");const E=this.baseUrl+I+(this.isCompressed?".bcmap":""),k=this.isCompressed?e.CMapCompressionType.BINARY:e.CMapCompressionType.NONE;return this._fetchData(E,k).catch(T=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${E}`)})})}_fetchData(p,I){(0,e.unreachable)("Abstract method `_fetchData` called.")}}i.BaseCMapReaderFactory=y;class F{constructor(p){let{baseUrl:I=null}=p;this.constructor===F&&(0,e.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=I}fetch(p){return ee(this,null,function*(){let{filename:I}=p;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!I)throw new Error("Font filename must be specified.");const E=`${this.baseUrl}${I}`;return this._fetchData(E).catch(k=>{throw new Error(`Unable to load font data at: ${E}`)})})}_fetchData(p){(0,e.unreachable)("Abstract method `_fetchData` called.")}}i.BaseStandardFontDataFactory=F;class x{constructor(){this.constructor===x&&(0,e.unreachable)("Cannot initialize BaseSVGFactory.")}create(p,I){let E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(p<=0||I<=0)throw new Error("Invalid SVG dimensions");const k=this._createSVG("svg:svg");return k.setAttribute("version","1.1"),E||(k.setAttribute("width",`${p}px`),k.setAttribute("height",`${I}px`)),k.setAttribute("preserveAspectRatio","none"),k.setAttribute("viewBox",`0 0 ${p} ${I}`),k}createElement(p){if(typeof p!="string")throw new Error("Invalid SVG element type");return this._createSVG(p)}_createSVG(p){(0,e.unreachable)("Abstract method `_createSVG` called.")}}i.BaseSVGFactory=x},(C,i,t)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.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,o=4294901760,y=65535;class F{constructor(A){this.h1=A?A&4294967295:n,this.h2=A?A&4294967295:n}update(A){let p,I;if(typeof A=="string"){p=new Uint8Array(A.length*2),I=0;for(let L=0,P=A.length;L<P;L++){const b=A.charCodeAt(L);b<=255?p[I++]=b:(p[I++]=b>>>8,p[I++]=b&255)}}else if((0,e.isArrayBuffer)(A))p=A.slice(),I=p.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const E=I>>2,k=I-E*4,T=new Uint32Array(p.buffer,0,E);let u=0,l=0,f=this.h1,v=this.h2;const R=3432918353,M=461845907,c=R&y,g=M&y;for(let L=0;L<E;L++)L&1?(u=T[L],u=u*R&o|u*c&y,u=u<<15|u>>>17,u=u*M&o|u*g&y,f^=u,f=f<<13|f>>>19,f=f*5+3864292196):(l=T[L],l=l*R&o|l*c&y,l=l<<15|l>>>17,l=l*M&o|l*g&y,v^=l,v=v<<13|v>>>19,v=v*5+3864292196);switch(u=0,k){case 3:u^=p[E*4+2]<<16;case 2:u^=p[E*4+1]<<8;case 1:u^=p[E*4],u=u*R&o|u*c&y,u=u<<15|u>>>17,u=u*M&o|u*g&y,E&1?f^=u:v^=u}this.h1=f,this.h2=v}hexdigest(){let A=this.h1,p=this.h2;return A^=p>>>1,A=A*3981806797&o|A*36045&y,p=p*4283543511&o|((p<<16|A>>>16)*2950163797&o)>>>16,A^=p>>>1,A=A*444984403&o|A*60499&y,p=p*3301882366&o|((p<<16|A>>>16)*3120437893&o)>>>16,A^=p>>>1,(A>>>0).toString(16).padStart(8,"0")+(p>>>0).toString(16).padStart(8,"0")}}i.MurmurHash3_64=F},(C,i,t)=>{var y;Object.defineProperty(i,"__esModule",{value:!0}),i.FontLoader=i.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(x){X(this,y,new Set);let{ownerDocument:A=globalThis.document,styleElement:p=null}=x;this._document=A,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(x){this.nativeFontFaces.add(x),this._document.fonts.add(x)}removeNativeFontFace(x){this.nativeFontFaces.delete(x),this._document.fonts.delete(x)}insertRule(x){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const A=this.styleElement.sheet;A.insertRule(x,A.cssRules.length)}clear(){for(const x of this.nativeFontFaces)this._document.fonts.delete(x);this.nativeFontFaces.clear(),r(this,y).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}loadSystemFont(x){return ee(this,null,function*(){if(!(!x||r(this,y).has(x.loadedName))){if((0,e.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:A,src:p,style:I}=x,E=new FontFace(A,p,I);this.addNativeFontFace(E);try{yield E.load(),r(this,y).add(A)}catch(k){(0,e.warn)(`Cannot load system font: ${x.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(E)}return}(0,e.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}})}bind(x){return ee(this,null,function*(){if(x.attached||x.missingFile&&!x.systemFontInfo)return;if(x.attached=!0,x.systemFontInfo){yield this.loadSystemFont(x.systemFontInfo);return}if(this.isFontLoadingAPISupported){const p=x.createNativeFontFace();if(p){this.addNativeFontFace(p);try{yield p.loaded}catch(I){throw(0,e.warn)(`Failed to load font '${p.family}': '${I}'.`),x.disableFontFace=!0,I}}return}const A=x.createFontFaceRule();if(A){if(this.insertRule(A),this.isSyncFontLoadingSupported)return;yield new Promise(p=>{const I=this._queueLoadingCallback(p);this._prepareFontLoadEvent(x,I)})}})}get isFontLoadingAPISupported(){var A;const x=!!((A=this._document)!=null&&A.fonts);return(0,e.shadow)(this,"isFontLoadingAPISupported",x)}get isSyncFontLoadingSupported(){let x=!1;return(e.isNodeJS||typeof navigator!="undefined"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(x=!0),(0,e.shadow)(this,"isSyncFontLoadingSupported",x)}_queueLoadingCallback(x){function A(){for((0,e.assert)(!I.done,"completeRequest() cannot be called twice."),I.done=!0;p.length>0&&p[0].done;){const E=p.shift();setTimeout(E.callback,0)}}const{loadingRequests:p}=this,I={done:!1,complete:A,callback:x};return p.push(I),I}get _loadTestFont(){const x=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,e.shadow)(this,"_loadTestFont",x)}_prepareFontLoadEvent(x,A){function p(O,G){return O.charCodeAt(G)<<24|O.charCodeAt(G+1)<<16|O.charCodeAt(G+2)<<8|O.charCodeAt(G+3)&255}function I(O,G,K,W){const _=O.substring(0,G),nt=O.substring(G+K);return _+W+nt}let E,k;const T=this._document.createElement("canvas");T.width=1,T.height=1;const u=T.getContext("2d");let l=0;function f(O,G){if(++l>30){(0,e.warn)("Load test font never loaded."),G();return}if(u.font="30px "+O,u.fillText(".",0,20),u.getImageData(0,0,1,1).data[3]>0){G();return}setTimeout(f.bind(null,O,G))}const v=`lt${Date.now()}${this.loadTestFontId++}`;let R=this._loadTestFont;R=I(R,976,v.length,v);const c=16,g=1482184792;let L=p(R,c);for(E=0,k=v.length-3;E<k;E+=4)L=L-g+p(v,E)|0;E<v.length&&(L=L-g+p(v+"XXX",E)|0),R=I(R,c,4,(0,e.string32)(L));const P=`url(data:font/opentype;base64,${btoa(R)});`,b=`@font-face {font-family:"${v}";src:${P}}`;this.insertRule(b);const N=this._document.createElement("div");N.style.visibility="hidden",N.style.width=N.style.height="10px",N.style.position="absolute",N.style.top=N.style.left="0px";for(const O of[x.loadedName,v]){const G=this._document.createElement("span");G.textContent="Hi",G.style.fontFamily=O,N.append(G)}this._document.body.append(N),f(v,()=>{N.remove(),A.complete()})}}y=new WeakMap,i.FontLoader=n;class o{constructor(x,A){let{isEvalSupported:p=!0,disableFontFace:I=!1,ignoreErrors:E=!1,inspectFont:k=null}=A;this.compiledGlyphs=Object.create(null);for(const T in x)this[T]=x[T];this.isEvalSupported=p!==!1,this.disableFontFace=I===!0,this.ignoreErrors=E===!0,this._inspectFont=k}createNativeFontFace(){var A;if(!this.data||this.disableFontFace)return null;let x;if(!this.cssFontInfo)x=new FontFace(this.loadedName,this.data,{});else{const p={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(p.style=`oblique ${this.cssFontInfo.italicAngle}deg`),x=new FontFace(this.cssFontInfo.fontFamily,this.data,p)}return(A=this._inspectFont)==null||A.call(this,this),x}createFontFaceRule(){var I;if(!this.data||this.disableFontFace)return null;const x=(0,e.bytesToString)(this.data),A=`url(data:${this.mimetype};base64,${btoa(x)});`;let p;if(!this.cssFontInfo)p=`@font-face {font-family:"${this.loadedName}";src:${A}}`;else{let E=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(E+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),p=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${E}src:${A}}`}return(I=this._inspectFont)==null||I.call(this,this,A),p}getPathGenerator(x,A){if(this.compiledGlyphs[A]!==void 0)return this.compiledGlyphs[A];let p;try{p=x.get(this.loadedName+"_path_"+A)}catch(I){if(!this.ignoreErrors)throw I;return(0,e.warn)(`getPathGenerator - ignoring character: "${I}".`),this.compiledGlyphs[A]=function(E,k){}}if(this.isEvalSupported&&e.FeatureTest.isEvalSupported){const I=[];for(const E of p){const k=E.args!==void 0?E.args.join(","):"";I.push("c.",E.cmd,"(",k,`);
  4. `)}return this.compiledGlyphs[A]=new Function("c","size",I.join(""))}return this.compiledGlyphs[A]=function(I,E){for(const k of p)k.cmd==="scale"&&(k.args=[E,-E]),I[k.cmd].apply(I,k.args)}}}i.FontFaceObject=o},(C,i,t)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.NodeStandardFontDataFactory=i.NodeFilterFactory=i.NodeCanvasFactory=i.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(I){(0,n.warn)(`Cannot polyfill \`DOMMatrix\`, rendering may be broken: "${I}".`)}})(),function(){if(!(globalThis.Path2D||!n.isNodeJS))try{const{CanvasRenderingContext2D:I}=require$$6,{polyfillPath2D:E}=requirePath2dPolyfill_min();globalThis.CanvasRenderingContext2D=I,E(globalThis)}catch(I){(0,n.warn)(`Cannot polyfill \`Path2D\`, rendering may be broken: "${I}".`)}}();const o=function(p){return new Promise((I,E)=>{require$$6.readFile(p,(T,u)=>{if(T||!u){E(new Error(T));return}I(new Uint8Array(u))})})};class y extends e.BaseFilterFactory{}i.NodeFilterFactory=y;class F extends e.BaseCanvasFactory{_createCanvas(I,E){return require$$6.createCanvas(I,E)}}i.NodeCanvasFactory=F;class x extends e.BaseCMapReaderFactory{_fetchData(I,E){return o(I).then(k=>({cMapData:k,compressionType:E}))}}i.NodeCMapReaderFactory=x;class A extends e.BaseStandardFontDataFactory{_fetchData(I){return o(I)}}i.NodeStandardFontDataFactory=A},(C,i,t)=>{var Y,sn,ft,an;Object.defineProperty(i,"__esModule",{value:!0}),i.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),o=t(174),y=t(175);const F=16,x=100,A=4096,p=15,I=10,E=1e3,k=16;function T(H,h){if(H._removeMirroring)throw new Error("Context is already forwarding operations.");H.__originalSave=H.save,H.__originalRestore=H.restore,H.__originalRotate=H.rotate,H.__originalScale=H.scale,H.__originalTranslate=H.translate,H.__originalTransform=H.transform,H.__originalSetTransform=H.setTransform,H.__originalResetTransform=H.resetTransform,H.__originalClip=H.clip,H.__originalMoveTo=H.moveTo,H.__originalLineTo=H.lineTo,H.__originalBezierCurveTo=H.bezierCurveTo,H.__originalRect=H.rect,H.__originalClosePath=H.closePath,H.__originalBeginPath=H.beginPath,H._removeMirroring=()=>{H.save=H.__originalSave,H.restore=H.__originalRestore,H.rotate=H.__originalRotate,H.scale=H.__originalScale,H.translate=H.__originalTranslate,H.transform=H.__originalTransform,H.setTransform=H.__originalSetTransform,H.resetTransform=H.__originalResetTransform,H.clip=H.__originalClip,H.moveTo=H.__originalMoveTo,H.lineTo=H.__originalLineTo,H.bezierCurveTo=H.__originalBezierCurveTo,H.rect=H.__originalRect,H.closePath=H.__originalClosePath,H.beginPath=H.__originalBeginPath,delete H._removeMirroring},H.save=function(){h.save(),this.__originalSave()},H.restore=function(){h.restore(),this.__originalRestore()},H.translate=function(s,d){h.translate(s,d),this.__originalTranslate(s,d)},H.scale=function(s,d){h.scale(s,d),this.__originalScale(s,d)},H.transform=function(s,d,S,D,U,w){h.transform(s,d,S,D,U,w),this.__originalTransform(s,d,S,D,U,w)},H.setTransform=function(s,d,S,D,U,w){h.setTransform(s,d,S,D,U,w),this.__originalSetTransform(s,d,S,D,U,w)},H.resetTransform=function(){h.resetTransform(),this.__originalResetTransform()},H.rotate=function(s){h.rotate(s),this.__originalRotate(s)},H.clip=function(s){h.clip(s),this.__originalClip(s)},H.moveTo=function(m,s){h.moveTo(m,s),this.__originalMoveTo(m,s)},H.lineTo=function(m,s){h.lineTo(m,s),this.__originalLineTo(m,s)},H.bezierCurveTo=function(m,s,d,S,D,U){h.bezierCurveTo(m,s,d,S,D,U),this.__originalBezierCurveTo(m,s,d,S,D,U)},H.rect=function(m,s,d,S){h.rect(m,s,d,S),this.__originalRect(m,s,d,S)},H.closePath=function(){h.closePath(),this.__originalClosePath()},H.beginPath=function(){h.beginPath(),this.__originalBeginPath()}}class u{constructor(h){this.canvasFactory=h,this.cache=Object.create(null)}getCanvas(h,m,s){let d;return this.cache[h]!==void 0?(d=this.cache[h],this.canvasFactory.reset(d,m,s)):(d=this.canvasFactory.create(m,s),this.cache[h]=d),d}delete(h){delete this.cache[h]}clear(){for(const h in this.cache){const m=this.cache[h];this.canvasFactory.destroy(m),delete this.cache[h]}}}function l(H,h,m,s,d,S,D,U,w,tt){const[q,ct,ut,Et,mt,Ot]=(0,n.getCurrentTransform)(H);if(ct===0&&ut===0){const Nt=D*q+mt,At=Math.round(Nt),ht=U*Et+Ot,st=Math.round(ht),dt=(D+w)*q+mt,It=Math.abs(Math.round(dt)-At)||1,wt=(U+tt)*Et+Ot,Ht=Math.abs(Math.round(wt)-st)||1;return H.setTransform(Math.sign(q),0,0,Math.sign(Et),At,st),H.drawImage(h,m,s,d,S,0,0,It,Ht),H.setTransform(q,ct,ut,Et,mt,Ot),[It,Ht]}if(q===0&&Et===0){const Nt=U*ut+mt,At=Math.round(Nt),ht=D*ct+Ot,st=Math.round(ht),dt=(U+tt)*ut+mt,It=Math.abs(Math.round(dt)-At)||1,wt=(D+w)*ct+Ot,Ht=Math.abs(Math.round(wt)-st)||1;return H.setTransform(0,Math.sign(ct),Math.sign(ut),0,At,st),H.drawImage(h,m,s,d,S,0,0,Ht,It),H.setTransform(q,ct,ut,Et,mt,Ot),[Ht,It]}H.drawImage(h,m,s,d,S,D,U,w,tt);const Wt=Math.hypot(q,ct),Pt=Math.hypot(ut,Et);return[Wt*w,Pt*tt]}function f(H){const{width:h,height:m}=H;if(h>E||m>E)return null;const s=1e3,d=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),S=h+1;let D=new Uint8Array(S*(m+1)),U,w,tt;const q=h+7&-8;let ct=new Uint8Array(q*m),ut=0;for(const Pt of H.data){let Nt=128;for(;Nt>0;)ct[ut++]=Pt&Nt?0:255,Nt>>=1}let Et=0;for(ut=0,ct[ut]!==0&&(D[0]=1,++Et),w=1;w<h;w++)ct[ut]!==ct[ut+1]&&(D[w]=ct[ut]?2:1,++Et),ut++;for(ct[ut]!==0&&(D[w]=2,++Et),U=1;U<m;U++){ut=U*q,tt=U*S,ct[ut-q]!==ct[ut]&&(D[tt]=ct[ut]?1:8,++Et);let Pt=(ct[ut]?4:0)+(ct[ut-q]?8:0);for(w=1;w<h;w++)Pt=(Pt>>2)+(ct[ut+1]?4:0)+(ct[ut-q+1]?8:0),d[Pt]&&(D[tt+w]=d[Pt],++Et),ut++;if(ct[ut-q]!==ct[ut]&&(D[tt+w]=ct[ut]?2:4,++Et),Et>s)return null}for(ut=q*(m-1),tt=U*S,ct[ut]!==0&&(D[tt]=8,++Et),w=1;w<h;w++)ct[ut]!==ct[ut+1]&&(D[tt+w]=ct[ut]?4:8,++Et),ut++;if(ct[ut]!==0&&(D[tt+w]=4,++Et),Et>s)return null;const mt=new Int32Array([0,S,-1,0,-S,0,0,0,1]),Ot=new Path2D;for(U=0;Et&&U<=m;U++){let Pt=U*S;const Nt=Pt+h;for(;Pt<Nt&&!D[Pt];)Pt++;if(Pt===Nt)continue;Ot.moveTo(Pt%S,U);const At=Pt;let ht=D[Pt];do{const st=mt[ht];do Pt+=st;while(!D[Pt]);const dt=D[Pt];dt!==5&&dt!==10?(ht=dt,D[Pt]=0):(ht=dt&51*ht>>4,D[Pt]&=ht>>2|ht<<2),Ot.lineTo(Pt%S,Pt/S|0),D[Pt]||--Et}while(At!==Pt);--U}return ct=null,D=null,function(Pt){Pt.save(),Pt.scale(1/h,-1/m),Pt.translate(0,-m),Pt.fill(Ot),Pt.beginPath(),Pt.restore()}}class v{constructor(h,m){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,h,m])}clone(){const h=Object.create(this);return h.clipBox=this.clipBox.slice(),h}setCurrentPoint(h,m){this.x=h,this.y=m}updatePathMinMax(h,m,s){[m,s]=e.Util.applyTransform([m,s],h),this.minX=Math.min(this.minX,m),this.minY=Math.min(this.minY,s),this.maxX=Math.max(this.maxX,m),this.maxY=Math.max(this.maxY,s)}updateRectMinMax(h,m){const s=e.Util.applyTransform(m,h),d=e.Util.applyTransform(m.slice(2),h);this.minX=Math.min(this.minX,s[0],d[0]),this.minY=Math.min(this.minY,s[1],d[1]),this.maxX=Math.max(this.maxX,s[0],d[0]),this.maxY=Math.max(this.maxY,s[1],d[1])}updateScalingPathMinMax(h,m){e.Util.scaleMinMax(h,m),this.minX=Math.min(this.minX,m[0]),this.maxX=Math.max(this.maxX,m[1]),this.minY=Math.min(this.minY,m[2]),this.maxY=Math.max(this.maxY,m[3])}updateCurvePathMinMax(h,m,s,d,S,D,U,w,tt,q){const ct=e.Util.bezierBoundingBox(m,s,d,S,D,U,w,tt);if(q){q[0]=Math.min(q[0],ct[0],ct[2]),q[1]=Math.max(q[1],ct[0],ct[2]),q[2]=Math.min(q[2],ct[1],ct[3]),q[3]=Math.max(q[3],ct[1],ct[3]);return}this.updateRectMinMax(h,ct)}getPathBoundingBox(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:o.PathType.FILL,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const s=[this.minX,this.minY,this.maxX,this.maxY];if(h===o.PathType.STROKE){m||(0,e.unreachable)("Stroke bounding box must include transform.");const d=e.Util.singularValueDecompose2dScale(m),S=d[0]*this.lineWidth/2,D=d[1]*this.lineWidth/2;s[0]-=S,s[1]-=D,s[2]+=S,s[3]+=D}return s}updateClipFromPath(){const h=e.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(h||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(h){this.clipBox=h,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:o.PathType.FILL,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return e.Util.intersect(this.clipBox,this.getPathBoundingBox(h,m))}}function R(H,h){if(typeof ImageData!="undefined"&&h instanceof ImageData){H.putImageData(h,0,0);return}const m=h.height,s=h.width,d=m%k,S=(m-d)/k,D=d===0?S:S+1,U=H.createImageData(s,k);let w=0,tt;const q=h.data,ct=U.data;let ut,Et,mt,Ot;if(h.kind===e.ImageKind.GRAYSCALE_1BPP){const Wt=q.byteLength,Pt=new Uint32Array(ct.buffer,0,ct.byteLength>>2),Nt=Pt.length,At=s+7>>3,ht=4294967295,st=e.FeatureTest.isLittleEndian?4278190080:255;for(ut=0;ut<D;ut++){for(mt=ut<S?k:d,tt=0,Et=0;Et<mt;Et++){const dt=Wt-w;let It=0;const wt=dt>At?s:dt*8-7,Ht=wt&-8;let Xt=0,$t=0;for(;It<Ht;It+=8)$t=q[w++],Pt[tt++]=$t&128?ht:st,Pt[tt++]=$t&64?ht:st,Pt[tt++]=$t&32?ht:st,Pt[tt++]=$t&16?ht:st,Pt[tt++]=$t&8?ht:st,Pt[tt++]=$t&4?ht:st,Pt[tt++]=$t&2?ht:st,Pt[tt++]=$t&1?ht:st;for(;It<wt;It++)Xt===0&&($t=q[w++],Xt=128),Pt[tt++]=$t&Xt?ht:st,Xt>>=1}for(;tt<Nt;)Pt[tt++]=0;H.putImageData(U,0,ut*k)}}else if(h.kind===e.ImageKind.RGBA_32BPP){for(Et=0,Ot=s*k*4,ut=0;ut<S;ut++)ct.set(q.subarray(w,w+Ot)),w+=Ot,H.putImageData(U,0,Et),Et+=k;ut<D&&(Ot=s*d*4,ct.set(q.subarray(w,w+Ot)),H.putImageData(U,0,Et))}else if(h.kind===e.ImageKind.RGB_24BPP)for(mt=k,Ot=s*mt,ut=0;ut<D;ut++){for(ut>=S&&(mt=d,Ot=s*mt),tt=0,Et=Ot;Et--;)ct[tt++]=q[w++],ct[tt++]=q[w++],ct[tt++]=q[w++],ct[tt++]=255;H.putImageData(U,0,ut*k)}else throw new Error(`bad image kind: ${h.kind}`)}function M(H,h){if(h.bitmap){H.drawImage(h.bitmap,0,0);return}const m=h.height,s=h.width,d=m%k,S=(m-d)/k,D=d===0?S:S+1,U=H.createImageData(s,k);let w=0;const tt=h.data,q=U.data;for(let ct=0;ct<D;ct++){const ut=ct<S?k:d;({srcPos:w}=(0,y.convertBlackAndWhiteToRGBA)({src:tt,srcPos:w,dest:q,width:s,height:ut,nonBlackColor:0})),H.putImageData(U,0,ct*k)}}function c(H,h){const m=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const s of m)H[s]!==void 0&&(h[s]=H[s]);H.setLineDash!==void 0&&(h.setLineDash(H.getLineDash()),h.lineDashOffset=H.lineDashOffset)}function g(H){if(H.strokeStyle=H.fillStyle="#000000",H.fillRule="nonzero",H.globalAlpha=1,H.lineWidth=1,H.lineCap="butt",H.lineJoin="miter",H.miterLimit=10,H.globalCompositeOperation="source-over",H.font="10px sans-serif",H.setLineDash!==void 0&&(H.setLineDash([]),H.lineDashOffset=0),!e.isNodeJS){const{filter:h}=H;h!=="none"&&h!==""&&(H.filter="none")}}function L(H,h,m,s){const d=H.length;for(let S=3;S<d;S+=4){const D=H[S];if(D===0)H[S-3]=h,H[S-2]=m,H[S-1]=s;else if(D<255){const U=255-D;H[S-3]=H[S-3]*D+h*U>>8,H[S-2]=H[S-2]*D+m*U>>8,H[S-1]=H[S-1]*D+s*U>>8}}}function P(H,h,m){const s=H.length,d=1/255;for(let S=3;S<s;S+=4){const D=m?m[H[S]]:H[S];h[S]=h[S]*D*d|0}}function b(H,h,m){const s=H.length;for(let d=3;d<s;d+=4){const S=H[d-3]*77+H[d-2]*152+H[d-1]*28;h[d]=m?h[d]*m[S>>8]>>8:h[d]*S>>16}}function N(H,h,m,s,d,S,D,U,w,tt,q){const ct=!!S,ut=ct?S[0]:0,Et=ct?S[1]:0,mt=ct?S[2]:0,Ot=d==="Luminosity"?b:P,Pt=Math.min(s,Math.ceil(1048576/m));for(let Nt=0;Nt<s;Nt+=Pt){const At=Math.min(Pt,s-Nt),ht=H.getImageData(U-tt,Nt+(w-q),m,At),st=h.getImageData(U,Nt+w,m,At);ct&&L(ht.data,ut,Et,mt),Ot(ht.data,st.data,D),h.putImageData(st,U,Nt+w)}}function O(H,h,m,s){const d=s[0],S=s[1],D=s[2]-d,U=s[3]-S;D===0||U===0||(N(h.context,m,D,U,h.subtype,h.backdrop,h.transferMap,d,S,h.offsetX,h.offsetY),H.save(),H.globalAlpha=1,H.globalCompositeOperation="source-over",H.setTransform(1,0,0,1,0,0),H.drawImage(m.canvas,0,0),H.restore())}function G(H,h){const m=e.Util.singularValueDecompose2dScale(H);m[0]=Math.fround(m[0]),m[1]=Math.fround(m[1]);const s=Math.fround((globalThis.devicePixelRatio||1)*n.PixelsPerInch.PDF_TO_CSS_UNITS);return h!==void 0?h:m[0]<=s||m[1]<=s}const K=["butt","round","square"],W=["miter","round","bevel"],_={},nt={},Rt=class{constructor(h,m,s,d,S,D,U,w){X(this,Y);X(this,ft);let{optionalContentConfig:tt,markedContentStack:q=null}=D;this.ctx=h,this.current=new v(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=m,this.objs=s,this.canvasFactory=d,this.filterFactory=S,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 u(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=U,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=w,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(h){let m=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):m}beginDrawing(h){let{transform:m,viewport:s,transparency:d=!1,background:S=null}=h;const D=this.ctx.canvas.width,U=this.ctx.canvas.height,w=this.ctx.fillStyle;if(this.ctx.fillStyle=S||"#ffffff",this.ctx.fillRect(0,0,D,U),this.ctx.fillStyle=w,d){const tt=this.cachedCanvases.getCanvas("transparent",D,U);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(),g(this.ctx),m&&(this.ctx.transform(...m),this.outputScaleX=m[0],this.outputScaleY=m[0]),this.ctx.transform(...s.transform),this.viewportScale=s.scale,this.baseTransform=(0,n.getCurrentTransform)(this.ctx)}executeOperatorList(h,m,s,d){const S=h.argsArray,D=h.fnArray;let U=m||0;const w=S.length;if(w===U)return U;const tt=w-U>I&&typeof s=="function",q=tt?Date.now()+p:0;let ct=0;const ut=this.commonObjs,Et=this.objs;let mt;for(;;){if(d!==void 0&&U===d.nextBreakPoint)return d.breakIt(U,s),U;if(mt=D[U],mt!==e.OPS.dependency)this[mt].apply(this,S[U]);else for(const Ot of S[U]){const Wt=Ot.startsWith("g_")?ut:Et;if(!Wt.has(Ot))return Wt.get(Ot,s),U}if(U++,U===w)return U;if(tt&&++ct>I){if(Date.now()>q)return s(),U;ct=0}}}endDrawing(){j(this,Y,sn).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const h of this._cachedBitmapsMap.values()){for(const m of h.values())typeof HTMLCanvasElement!="undefined"&&m instanceof HTMLCanvasElement&&(m.width=m.height=0);h.clear()}this._cachedBitmapsMap.clear(),j(this,ft,an).call(this)}_scaleImage(h,m){const s=h.width,d=h.height;let S=Math.max(Math.hypot(m[0],m[1]),1),D=Math.max(Math.hypot(m[2],m[3]),1),U=s,w=d,tt="prescale1",q,ct;for(;S>2&&U>1||D>2&&w>1;){let ut=U,Et=w;S>2&&U>1&&(ut=U>=16384?Math.floor(U/2)-1||1:Math.ceil(U/2),S/=U/ut),D>2&&w>1&&(Et=w>=16384?Math.floor(w/2)-1||1:Math.ceil(w)/2,D/=w/Et),q=this.cachedCanvases.getCanvas(tt,ut,Et),ct=q.context,ct.clearRect(0,0,ut,Et),ct.drawImage(h,0,0,U,w,0,0,ut,Et),h=q.canvas,U=ut,w=Et,tt=tt==="prescale1"?"prescale2":"prescale1"}return{img:h,paintWidth:U,paintHeight:w}}_createMaskCanvas(h){const m=this.ctx,{width:s,height:d}=h,S=this.current.fillColor,D=this.current.patternFill,U=(0,n.getCurrentTransform)(m);let w,tt,q,ct;if((h.bitmap||h.data)&&h.count>1){const It=h.bitmap||h.data.buffer;tt=JSON.stringify(D?U:[U.slice(0,4),S]),w=this._cachedBitmapsMap.get(It),w||(w=new Map,this._cachedBitmapsMap.set(It,w));const wt=w.get(tt);if(wt&&!D){const Ht=Math.round(Math.min(U[0],U[2])+U[4]),Xt=Math.round(Math.min(U[1],U[3])+U[5]);return{canvas:wt,offsetX:Ht,offsetY:Xt}}q=wt}q||(ct=this.cachedCanvases.getCanvas("maskCanvas",s,d),M(ct.context,h));let ut=e.Util.transform(U,[1/s,0,0,-1/d,0,0]);ut=e.Util.transform(ut,[1,0,0,1,0,-d]);const Et=e.Util.applyTransform([0,0],ut),mt=e.Util.applyTransform([s,d],ut),Ot=e.Util.normalizeRect([Et[0],Et[1],mt[0],mt[1]]),Wt=Math.round(Ot[2]-Ot[0])||1,Pt=Math.round(Ot[3]-Ot[1])||1,Nt=this.cachedCanvases.getCanvas("fillCanvas",Wt,Pt),At=Nt.context,ht=Math.min(Et[0],mt[0]),st=Math.min(Et[1],mt[1]);At.translate(-ht,-st),At.transform(...ut),q||(q=this._scaleImage(ct.canvas,(0,n.getCurrentTransformInverse)(At)),q=q.img,w&&D&&w.set(tt,q)),At.imageSmoothingEnabled=G((0,n.getCurrentTransform)(At),h.interpolate),l(At,q,0,0,q.width,q.height,0,0,s,d),At.globalCompositeOperation="source-in";const dt=e.Util.transform((0,n.getCurrentTransformInverse)(At),[1,0,0,1,-ht,-st]);return At.fillStyle=D?S.getPattern(m,this,dt,o.PathType.FILL):S,At.fillRect(0,0,s,d),w&&!D&&(this.cachedCanvases.delete("fillCanvas"),w.set(tt,Nt.canvas)),{canvas:Nt.canvas,offsetX:Math.round(ht),offsetY:Math.round(st)}}setLineWidth(h){h!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=h,this.ctx.lineWidth=h}setLineCap(h){this.ctx.lineCap=K[h]}setLineJoin(h){this.ctx.lineJoin=W[h]}setMiterLimit(h){this.ctx.miterLimit=h}setDash(h,m){const s=this.ctx;s.setLineDash!==void 0&&(s.setLineDash(h),s.lineDashOffset=m)}setRenderingIntent(h){}setFlatness(h){}setGState(h){for(const[m,s]of h)switch(m){case"LW":this.setLineWidth(s);break;case"LC":this.setLineCap(s);break;case"LJ":this.setLineJoin(s);break;case"ML":this.setMiterLimit(s);break;case"D":this.setDash(s[0],s[1]);break;case"RI":this.setRenderingIntent(s);break;case"FL":this.setFlatness(s);break;case"Font":this.setFont(s[0],s[1]);break;case"CA":this.current.strokeAlpha=s;break;case"ca":this.current.fillAlpha=s,this.ctx.globalAlpha=s;break;case"BM":this.ctx.globalCompositeOperation=s;break;case"SMask":this.current.activeSMask=s?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(s);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const h=this.inSMaskMode;this.current.activeSMask&&!h?this.beginSMaskMode():!this.current.activeSMask&&h&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const h=this.ctx.canvas.width,m=this.ctx.canvas.height,s="smaskGroupAt"+this.groupLevel,d=this.cachedCanvases.getCanvas(s,h,m);this.suspendedCtx=this.ctx,this.ctx=d.context;const S=this.ctx;S.setTransform(...(0,n.getCurrentTransform)(this.suspendedCtx)),c(this.suspendedCtx,S),T(S,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(),c(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(h){if(!this.current.activeSMask)return;h?(h[0]=Math.floor(h[0]),h[1]=Math.floor(h[1]),h[2]=Math.ceil(h[2]),h[3]=Math.ceil(h[3])):h=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const m=this.current.activeSMask,s=this.suspendedCtx;O(s,m,this.ctx,h),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?(c(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const h=this.current;this.stateStack.push(h),this.current=h.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),c(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(h,m,s,d,S,D){this.ctx.transform(h,m,s,d,S,D),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(h,m,s){const d=this.ctx,S=this.current;let D=S.x,U=S.y,w,tt;const q=(0,n.getCurrentTransform)(d),ct=q[0]===0&&q[3]===0||q[1]===0&&q[2]===0,ut=ct?s.slice(0):null;for(let Et=0,mt=0,Ot=h.length;Et<Ot;Et++)switch(h[Et]|0){case e.OPS.rectangle:D=m[mt++],U=m[mt++];const Wt=m[mt++],Pt=m[mt++],Nt=D+Wt,At=U+Pt;d.moveTo(D,U),Wt===0||Pt===0?d.lineTo(Nt,At):(d.lineTo(Nt,U),d.lineTo(Nt,At),d.lineTo(D,At)),ct||S.updateRectMinMax(q,[D,U,Nt,At]),d.closePath();break;case e.OPS.moveTo:D=m[mt++],U=m[mt++],d.moveTo(D,U),ct||S.updatePathMinMax(q,D,U);break;case e.OPS.lineTo:D=m[mt++],U=m[mt++],d.lineTo(D,U),ct||S.updatePathMinMax(q,D,U);break;case e.OPS.curveTo:w=D,tt=U,D=m[mt+4],U=m[mt+5],d.bezierCurveTo(m[mt],m[mt+1],m[mt+2],m[mt+3],D,U),S.updateCurvePathMinMax(q,w,tt,m[mt],m[mt+1],m[mt+2],m[mt+3],D,U,ut),mt+=6;break;case e.OPS.curveTo2:w=D,tt=U,d.bezierCurveTo(D,U,m[mt],m[mt+1],m[mt+2],m[mt+3]),S.updateCurvePathMinMax(q,w,tt,D,U,m[mt],m[mt+1],m[mt+2],m[mt+3],ut),D=m[mt+2],U=m[mt+3],mt+=4;break;case e.OPS.curveTo3:w=D,tt=U,D=m[mt+2],U=m[mt+3],d.bezierCurveTo(m[mt],m[mt+1],D,U,D,U),S.updateCurvePathMinMax(q,w,tt,m[mt],m[mt+1],D,U,D,U,ut),mt+=4;break;case e.OPS.closePath:d.closePath();break}ct&&S.updateScalingPathMinMax(q,ut),S.setCurrentPoint(D,U)}closePath(){this.ctx.closePath()}stroke(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const m=this.ctx,s=this.current.strokeColor;m.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof s=="object"&&(s==null?void 0:s.getPattern)?(m.save(),m.strokeStyle=s.getPattern(m,this,(0,n.getCurrentTransformInverse)(m),o.PathType.STROKE),this.rescaleAndStroke(!1),m.restore()):this.rescaleAndStroke(!0)),h&&this.consumePath(this.current.getClippedPathBoundingBox()),m.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const m=this.ctx,s=this.current.fillColor,d=this.current.patternFill;let S=!1;d&&(m.save(),m.fillStyle=s.getPattern(m,this,(0,n.getCurrentTransformInverse)(m),o.PathType.FILL),S=!0);const D=this.current.getClippedPathBoundingBox();this.contentVisible&&D!==null&&(this.pendingEOFill?(m.fill("evenodd"),this.pendingEOFill=!1):m.fill()),S&&m.restore(),h&&this.consumePath(D)}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=_}eoClip(){this.pendingClip=nt}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 h=this.pendingTextPaths,m=this.ctx;if(h===void 0){m.beginPath();return}m.save(),m.beginPath();for(const s of h)m.setTransform(...s.transform),m.translate(s.x,s.y),s.addToPath(m,s.fontSize);m.restore(),m.clip(),m.beginPath(),delete this.pendingTextPaths}setCharSpacing(h){this.current.charSpacing=h}setWordSpacing(h){this.current.wordSpacing=h}setHScale(h){this.current.textHScale=h/100}setLeading(h){this.current.leading=-h}setFont(h,m){var q;const s=this.commonObjs.get(h),d=this.current;if(!s)throw new Error(`Can't find font for ${h}`);if(d.fontMatrix=s.fontMatrix||e.FONT_IDENTITY_MATRIX,(d.fontMatrix[0]===0||d.fontMatrix[3]===0)&&(0,e.warn)("Invalid font matrix for font "+h),m<0?(m=-m,d.fontDirection=-1):d.fontDirection=1,this.current.font=s,this.current.fontSize=m,s.isType3Font)return;const S=s.loadedName||"sans-serif",D=((q=s.systemFontInfo)==null?void 0:q.css)||`"${S}", ${s.fallbackName}`;let U="normal";s.black?U="900":s.bold&&(U="bold");const w=s.italic?"italic":"normal";let tt=m;m<F?tt=F:m>x&&(tt=x),this.current.fontSizeScale=m/tt,this.ctx.font=`${w} ${U} ${tt}px ${D}`}setTextRenderingMode(h){this.current.textRenderingMode=h}setTextRise(h){this.current.textRise=h}moveText(h,m){this.current.x=this.current.lineX+=h,this.current.y=this.current.lineY+=m}setLeadingMoveText(h,m){this.setLeading(-m),this.moveText(h,m)}setTextMatrix(h,m,s,d,S,D){this.current.textMatrix=[h,m,s,d,S,D],this.current.textMatrixScale=Math.hypot(h,m),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(h,m,s,d){const S=this.ctx,D=this.current,U=D.font,w=D.textRenderingMode,tt=D.fontSize/D.fontSizeScale,q=w&e.TextRenderingMode.FILL_STROKE_MASK,ct=!!(w&e.TextRenderingMode.ADD_TO_PATH_FLAG),ut=D.patternFill&&!U.missingFile;let Et;(U.disableFontFace||ct||ut)&&(Et=U.getPathGenerator(this.commonObjs,h)),U.disableFontFace||ut?(S.save(),S.translate(m,s),S.beginPath(),Et(S,tt),d&&S.setTransform(...d),(q===e.TextRenderingMode.FILL||q===e.TextRenderingMode.FILL_STROKE)&&S.fill(),(q===e.TextRenderingMode.STROKE||q===e.TextRenderingMode.FILL_STROKE)&&S.stroke(),S.restore()):((q===e.TextRenderingMode.FILL||q===e.TextRenderingMode.FILL_STROKE)&&S.fillText(h,m,s),(q===e.TextRenderingMode.STROKE||q===e.TextRenderingMode.FILL_STROKE)&&S.strokeText(h,m,s)),ct&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,n.getCurrentTransform)(S),x:m,y:s,fontSize:tt,addToPath:Et})}get isFontSubpixelAAEnabled(){const{context:h}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);h.scale(1.5,1),h.fillText("I",0,10);const m=h.getImageData(0,0,10,10).data;let s=!1;for(let d=3;d<m.length;d+=4)if(m[d]>0&&m[d]<255){s=!0;break}return(0,e.shadow)(this,"isFontSubpixelAAEnabled",s)}showText(h){const m=this.current,s=m.font;if(s.isType3Font)return this.showType3Text(h);const d=m.fontSize;if(d===0)return;const S=this.ctx,D=m.fontSizeScale,U=m.charSpacing,w=m.wordSpacing,tt=m.fontDirection,q=m.textHScale*tt,ct=h.length,ut=s.vertical,Et=ut?1:-1,mt=s.defaultVMetrics,Ot=d*m.fontMatrix[0],Wt=m.textRenderingMode===e.TextRenderingMode.FILL&&!s.disableFontFace&&!m.patternFill;S.save(),S.transform(...m.textMatrix),S.translate(m.x,m.y+m.textRise),tt>0?S.scale(q,-1):S.scale(q,1);let Pt;if(m.patternFill){S.save();const dt=m.fillColor.getPattern(S,this,(0,n.getCurrentTransformInverse)(S),o.PathType.FILL);Pt=(0,n.getCurrentTransform)(S),S.restore(),S.fillStyle=dt}let Nt=m.lineWidth;const At=m.textMatrixScale;if(At===0||Nt===0){const dt=m.textRenderingMode&e.TextRenderingMode.FILL_STROKE_MASK;(dt===e.TextRenderingMode.STROKE||dt===e.TextRenderingMode.FILL_STROKE)&&(Nt=this.getSinglePixelWidth())}else Nt/=At;if(D!==1&&(S.scale(D,D),Nt/=D),S.lineWidth=Nt,s.isInvalidPDFjsFont){const dt=[];let It=0;for(const wt of h)dt.push(wt.unicode),It+=wt.width;S.fillText(dt.join(""),0,0),m.x+=It*Ot*q,S.restore(),this.compose();return}let ht=0,st;for(st=0;st<ct;++st){const dt=h[st];if(typeof dt=="number"){ht+=Et*dt*d/1e3;continue}let It=!1;const wt=(dt.isSpace?w:0)+U,Ht=dt.fontChar,Xt=dt.accent;let $t,Vt,Kt=dt.width;if(ut){const Zt=dt.vmetric||mt,Gt=-(dt.vmetric?Zt[1]:Kt*.5)*Ot,yt=Zt[2]*Ot;Kt=Zt?-Zt[0]:Kt,$t=Gt/D,Vt=(ht+yt)/D}else $t=ht/D,Vt=0;if(s.remeasure&&Kt>0){const Zt=S.measureText(Ht).width*1e3/d*D;if(Kt<Zt&&this.isFontSubpixelAAEnabled){const Gt=Kt/Zt;It=!0,S.save(),S.scale(Gt,1),$t/=Gt}else Kt!==Zt&&($t+=(Kt-Zt)/2e3*d/D)}if(this.contentVisible&&(dt.isInFont||s.missingFile)){if(Wt&&!Xt)S.fillText(Ht,$t,Vt);else if(this.paintChar(Ht,$t,Vt,Pt),Xt){const Zt=$t+d*Xt.offset.x/D,Gt=Vt-d*Xt.offset.y/D;this.paintChar(Xt.fontChar,Zt,Gt,Pt)}}const Jt=ut?Kt*Ot-wt*tt:Kt*Ot+wt*tt;ht+=Jt,It&&S.restore()}ut?m.y-=ht:m.x+=ht*q,S.restore(),this.compose()}showType3Text(h){const m=this.ctx,s=this.current,d=s.font,S=s.fontSize,D=s.fontDirection,U=d.vertical?1:-1,w=s.charSpacing,tt=s.wordSpacing,q=s.textHScale*D,ct=s.fontMatrix||e.FONT_IDENTITY_MATRIX,ut=h.length,Et=s.textRenderingMode===e.TextRenderingMode.INVISIBLE;let mt,Ot,Wt,Pt;if(!(Et||S===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,m.save(),m.transform(...s.textMatrix),m.translate(s.x,s.y),m.scale(q,D),mt=0;mt<ut;++mt){if(Ot=h[mt],typeof Ot=="number"){Pt=U*Ot*S/1e3,this.ctx.translate(Pt,0),s.x+=Pt*q;continue}const Nt=(Ot.isSpace?tt:0)+w,At=d.charProcOperatorList[Ot.operatorListId];if(!At){(0,e.warn)(`Type3 character "${Ot.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=Ot,this.save(),m.scale(S,S),m.transform(...ct),this.executeOperatorList(At),this.restore()),Wt=e.Util.applyTransform([Ot.width,0],ct)[0]*S+Nt,m.translate(Wt,0),s.x+=Wt*q}m.restore(),this.processingType3=null}}setCharWidth(h,m){}setCharWidthAndBounds(h,m,s,d,S,D){this.ctx.rect(s,d,S-s,D-d),this.ctx.clip(),this.endPath()}getColorN_Pattern(h){let m;if(h[0]==="TilingPattern"){const s=h[1],d=this.baseTransform||(0,n.getCurrentTransform)(this.ctx),S={createCanvasGraphics:D=>new Rt(D,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};m=new o.TilingPattern(h,s,this.ctx,S,d)}else m=this._getPattern(h[1],h[2]);return m}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(h,m,s){const d=e.Util.makeHexColor(h,m,s);this.ctx.strokeStyle=d,this.current.strokeColor=d}setFillRGBColor(h,m,s){const d=e.Util.makeHexColor(h,m,s);this.ctx.fillStyle=d,this.current.fillColor=d,this.current.patternFill=!1}_getPattern(h){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,s;return this.cachedPatterns.has(h)?s=this.cachedPatterns.get(h):(s=(0,o.getShadingPattern)(this.getObject(h)),this.cachedPatterns.set(h,s)),m&&(s.matrix=m),s}shadingFill(h){if(!this.contentVisible)return;const m=this.ctx;this.save();const s=this._getPattern(h);m.fillStyle=s.getPattern(m,this,(0,n.getCurrentTransformInverse)(m),o.PathType.SHADING);const d=(0,n.getCurrentTransformInverse)(m);if(d){const{width:S,height:D}=m.canvas,[U,w,tt,q]=e.Util.getAxialAlignedBoundingBox([0,0,S,D],d);this.ctx.fillRect(U,w,tt-U,q-w)}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(h,m){if(!!this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(h)&&h.length===6&&this.transform(...h),this.baseTransform=(0,n.getCurrentTransform)(this.ctx),m)){const s=m[2]-m[0],d=m[3]-m[1];this.ctx.rect(m[0],m[1],s,d),this.current.updateRectMinMax((0,n.getCurrentTransform)(this.ctx),m),this.clip(),this.endPath()}}paintFormXObjectEnd(){!this.contentVisible||(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(h){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const m=this.ctx;h.isolated||(0,e.info)("TODO: Support non-isolated groups."),h.knockout&&(0,e.warn)("Knockout groups not supported.");const s=(0,n.getCurrentTransform)(m);if(h.matrix&&m.transform(...h.matrix),!h.bbox)throw new Error("Bounding box is required.");let d=e.Util.getAxialAlignedBoundingBox(h.bbox,(0,n.getCurrentTransform)(m));const S=[0,0,m.canvas.width,m.canvas.height];d=e.Util.intersect(d,S)||[0,0,0,0];const D=Math.floor(d[0]),U=Math.floor(d[1]);let w=Math.max(Math.ceil(d[2])-D,1),tt=Math.max(Math.ceil(d[3])-U,1),q=1,ct=1;w>A&&(q=w/A,w=A),tt>A&&(ct=tt/A,tt=A),this.current.startNewPathAndClipBox([0,0,w,tt]);let ut="groupAt"+this.groupLevel;h.smask&&(ut+="_smask_"+this.smaskCounter++%2);const Et=this.cachedCanvases.getCanvas(ut,w,tt),mt=Et.context;mt.scale(1/q,1/ct),mt.translate(-D,-U),mt.transform(...s),h.smask?this.smaskStack.push({canvas:Et.canvas,context:mt,offsetX:D,offsetY:U,scaleX:q,scaleY:ct,subtype:h.smask.subtype,backdrop:h.smask.backdrop,transferMap:h.smask.transferMap||null,startTransformInverse:null}):(m.setTransform(1,0,0,1,0,0),m.translate(D,U),m.scale(q,ct),m.save()),c(m,mt),this.ctx=mt,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(m),this.groupLevel++}endGroup(h){if(!this.contentVisible)return;this.groupLevel--;const m=this.ctx,s=this.groupStack.pop();if(this.ctx=s,this.ctx.imageSmoothingEnabled=!1,h.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const d=(0,n.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...d);const S=e.Util.getAxialAlignedBoundingBox([0,0,m.canvas.width,m.canvas.height],d);this.ctx.drawImage(m.canvas,0,0),this.ctx.restore(),this.compose(S)}}beginAnnotation(h,m,s,d,S){if(j(this,Y,sn).call(this),g(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(m)&&m.length===4){const D=m[2]-m[0],U=m[3]-m[1];if(S&&this.annotationCanvasMap){s=s.slice(),s[4]-=m[0],s[5]-=m[1],m=m.slice(),m[0]=m[1]=0,m[2]=D,m[3]=U;const[w,tt]=e.Util.singularValueDecompose2dScale((0,n.getCurrentTransform)(this.ctx)),{viewportScale:q}=this,ct=Math.ceil(D*this.outputScaleX*q),ut=Math.ceil(U*this.outputScaleY*q);this.annotationCanvas=this.canvasFactory.create(ct,ut);const{canvas:Et,context:mt}=this.annotationCanvas;this.annotationCanvasMap.set(h,Et),this.annotationCanvas.savedCtx=this.ctx,this.ctx=mt,this.ctx.save(),this.ctx.setTransform(w,0,0,-tt,0,U*tt),g(this.ctx)}else g(this.ctx),this.ctx.rect(m[0],m[1],D,U),this.ctx.clip(),this.endPath()}this.current=new v(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...s),this.transform(...d)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),j(this,ft,an).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(h){if(!this.contentVisible)return;const m=h.count;h=this.getObject(h.data,h),h.count=m;const s=this.ctx,d=this.processingType3;if(d&&(d.compiled===void 0&&(d.compiled=f(h)),d.compiled)){d.compiled(s);return}const S=this._createMaskCanvas(h),D=S.canvas;s.save(),s.setTransform(1,0,0,1,0,0),s.drawImage(D,S.offsetX,S.offsetY),s.restore(),this.compose()}paintImageMaskXObjectRepeat(h,m){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,S=arguments.length>4?arguments[4]:void 0,D=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;h=this.getObject(h.data,h);const U=this.ctx;U.save();const w=(0,n.getCurrentTransform)(U);U.transform(m,s,d,S,0,0);const tt=this._createMaskCanvas(h);U.setTransform(1,0,0,1,tt.offsetX-w[4],tt.offsetY-w[5]);for(let q=0,ct=D.length;q<ct;q+=2){const ut=e.Util.transform(w,[m,s,d,S,D[q],D[q+1]]),[Et,mt]=e.Util.applyTransform([0,0],ut);U.drawImage(tt.canvas,Et,mt)}U.restore(),this.compose()}paintImageMaskXObjectGroup(h){if(!this.contentVisible)return;const m=this.ctx,s=this.current.fillColor,d=this.current.patternFill;for(const S of h){const{data:D,width:U,height:w,transform:tt}=S,q=this.cachedCanvases.getCanvas("maskCanvas",U,w),ct=q.context;ct.save();const ut=this.getObject(D,S);M(ct,ut),ct.globalCompositeOperation="source-in",ct.fillStyle=d?s.getPattern(ct,this,(0,n.getCurrentTransformInverse)(m),o.PathType.FILL):s,ct.fillRect(0,0,U,w),ct.restore(),m.save(),m.transform(...tt),m.scale(1,-1),l(m,q.canvas,0,0,U,w,0,-1,1,1),m.restore()}this.compose()}paintImageXObject(h){if(!this.contentVisible)return;const m=this.getObject(h);if(!m){(0,e.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(m)}paintImageXObjectRepeat(h,m,s,d){if(!this.contentVisible)return;const S=this.getObject(h);if(!S){(0,e.warn)("Dependent image isn't ready yet");return}const D=S.width,U=S.height,w=[];for(let tt=0,q=d.length;tt<q;tt+=2)w.push({transform:[m,0,0,s,d[tt],d[tt+1]],x:0,y:0,w:D,h:U});this.paintInlineImageXObjectGroup(S,w)}applyTransferMapsToCanvas(h){return this.current.transferMaps!=="none"&&(h.filter=this.current.transferMaps,h.drawImage(h.canvas,0,0),h.filter="none"),h.canvas}applyTransferMapsToBitmap(h){if(this.current.transferMaps==="none")return h.bitmap;const{bitmap:m,width:s,height:d}=h,S=this.cachedCanvases.getCanvas("inlineImage",s,d),D=S.context;return D.filter=this.current.transferMaps,D.drawImage(m,0,0),D.filter="none",S.canvas}paintInlineImageXObject(h){if(!this.contentVisible)return;const m=h.width,s=h.height,d=this.ctx;if(this.save(),!e.isNodeJS){const{filter:U}=d;U!=="none"&&U!==""&&(d.filter="none")}d.scale(1/m,-1/s);let S;if(h.bitmap)S=this.applyTransferMapsToBitmap(h);else if(typeof HTMLElement=="function"&&h instanceof HTMLElement||!h.data)S=h;else{const w=this.cachedCanvases.getCanvas("inlineImage",m,s).context;R(w,h),S=this.applyTransferMapsToCanvas(w)}const D=this._scaleImage(S,(0,n.getCurrentTransformInverse)(d));d.imageSmoothingEnabled=G((0,n.getCurrentTransform)(d),h.interpolate),l(d,D.img,0,0,D.paintWidth,D.paintHeight,0,-s,m,s),this.compose(),this.restore()}paintInlineImageXObjectGroup(h,m){if(!this.contentVisible)return;const s=this.ctx;let d;if(h.bitmap)d=h.bitmap;else{const S=h.width,D=h.height,w=this.cachedCanvases.getCanvas("inlineImage",S,D).context;R(w,h),d=this.applyTransferMapsToCanvas(w)}for(const S of m)s.save(),s.transform(...S.transform),s.scale(1,-1),l(s,d,S.x,S.y,S.w,S.h,0,-1,1,1),s.restore();this.compose()}paintSolidColorImageMask(){!this.contentVisible||(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(h){}markPointProps(h,m){}beginMarkedContent(h){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(h,m){h==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(m)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(h){const m=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(h);const s=this.ctx;this.pendingClip&&(m||(this.pendingClip===nt?s.clip("evenodd"):s.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),s.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const h=(0,n.getCurrentTransform)(this.ctx);if(h[1]===0&&h[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(h[0]),Math.abs(h[3]));else{const m=Math.abs(h[0]*h[3]-h[2]*h[1]),s=Math.hypot(h[0],h[2]),d=Math.hypot(h[1],h[3]);this._cachedGetSinglePixelWidth=Math.max(s,d)/m}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:h}=this.current,{a:m,b:s,c:d,d:S}=this.ctx.getTransform();let D,U;if(s===0&&d===0){const w=Math.abs(m),tt=Math.abs(S);if(w===tt)if(h===0)D=U=1/w;else{const q=w*h;D=U=q<1?1/q:1}else if(h===0)D=1/w,U=1/tt;else{const q=w*h,ct=tt*h;D=q<1?1/q:1,U=ct<1?1/ct:1}}else{const w=Math.abs(m*S-s*d),tt=Math.hypot(m,s),q=Math.hypot(d,S);if(h===0)D=q/w,U=tt/w;else{const ct=h*w;D=q>ct?q/ct:1,U=tt>ct?tt/ct:1}}this._cachedScaleForStroking[0]=D,this._cachedScaleForStroking[1]=U}return this._cachedScaleForStroking}rescaleAndStroke(h){const{ctx:m}=this,{lineWidth:s}=this.current,[d,S]=this.getScaleForStroking();if(m.lineWidth=s||1,d===1&&S===1){m.stroke();return}const D=m.getLineDash();if(h&&m.save(),m.scale(d,S),D.length>0){const U=Math.max(d,S);m.setLineDash(D.map(w=>w/U)),m.lineDashOffset/=U}m.stroke(),h&&m.restore()}isContentVisible(){for(let h=this.markedContentStack.length-1;h>=0;h--)if(!this.markedContentStack[h].visible)return!1;return!0}};let rt=Rt;Y=new WeakSet,sn=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)},ft=new WeakSet,an=function(){if(this.pageColors){const h=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(h!=="none"){const m=this.ctx.filter;this.ctx.filter=h,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=m}}},i.CanvasGraphics=rt;for(const H in e.OPS)rt.prototype[H]!==void 0&&(rt.prototype[e.OPS[H]]=rt.prototype[H])},(C,i,t)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TilingPattern=i.PathType=void 0,i.getShadingPattern=k,t(2);var e=t(1),n=t(168);const o={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};i.PathType=o;function y(f,v){if(!v)return;const R=v[2]-v[0],M=v[3]-v[1],c=new Path2D;c.rect(v[0],v[1],R,M),f.clip(c)}class F{constructor(){this.constructor===F&&(0,e.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,e.unreachable)("Abstract method `getPattern` called.")}}class x extends F{constructor(v){super(),this._type=v[1],this._bbox=v[2],this._colorStops=v[3],this._p0=v[4],this._p1=v[5],this._r0=v[6],this._r1=v[7],this.matrix=null}_createGradient(v){let R;this._type==="axial"?R=v.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(R=v.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const M of this._colorStops)R.addColorStop(M[0],M[1]);return R}getPattern(v,R,M,c){let g;if(c===o.STROKE||c===o.FILL){const L=R.current.getClippedPathBoundingBox(c,(0,n.getCurrentTransform)(v))||[0,0,0,0],P=Math.ceil(L[2]-L[0])||1,b=Math.ceil(L[3]-L[1])||1,N=R.cachedCanvases.getCanvas("pattern",P,b,!0),O=N.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(-L[0],-L[1]),M=e.Util.transform(M,[1,0,0,1,L[0],L[1]]),O.transform(...R.baseTransform),this.matrix&&O.transform(...this.matrix),y(O,this._bbox),O.fillStyle=this._createGradient(O),O.fill(),g=v.createPattern(N.canvas,"no-repeat");const G=new DOMMatrix(M);g.setTransform(G)}else y(v,this._bbox),g=this._createGradient(v);return g}}function A(f,v,R,M,c,g,L,P){const b=v.coords,N=v.colors,O=f.data,G=f.width*4;let K;b[R+1]>b[M+1]&&(K=R,R=M,M=K,K=g,g=L,L=K),b[M+1]>b[c+1]&&(K=M,M=c,c=K,K=L,L=P,P=K),b[R+1]>b[M+1]&&(K=R,R=M,M=K,K=g,g=L,L=K);const W=(b[R]+v.offsetX)*v.scaleX,_=(b[R+1]+v.offsetY)*v.scaleY,nt=(b[M]+v.offsetX)*v.scaleX,rt=(b[M+1]+v.offsetY)*v.scaleY,Y=(b[c]+v.offsetX)*v.scaleX,it=(b[c+1]+v.offsetY)*v.scaleY;if(_>=it)return;const ft=N[g],bt=N[g+1],Rt=N[g+2],H=N[L],h=N[L+1],m=N[L+2],s=N[P],d=N[P+1],S=N[P+2],D=Math.round(_),U=Math.round(it);let w,tt,q,ct,ut,Et,mt,Ot;for(let Wt=D;Wt<=U;Wt++){if(Wt<rt){const st=Wt<_?0:(_-Wt)/(_-rt);w=W-(W-nt)*st,tt=ft-(ft-H)*st,q=bt-(bt-h)*st,ct=Rt-(Rt-m)*st}else{let st;Wt>it?st=1:rt===it?st=0:st=(rt-Wt)/(rt-it),w=nt-(nt-Y)*st,tt=H-(H-s)*st,q=h-(h-d)*st,ct=m-(m-S)*st}let Pt;Wt<_?Pt=0:Wt>it?Pt=1:Pt=(_-Wt)/(_-it),ut=W-(W-Y)*Pt,Et=ft-(ft-s)*Pt,mt=bt-(bt-d)*Pt,Ot=Rt-(Rt-S)*Pt;const Nt=Math.round(Math.min(w,ut)),At=Math.round(Math.max(w,ut));let ht=G*Wt+Nt*4;for(let st=Nt;st<=At;st++)Pt=(w-st)/(w-ut),Pt<0?Pt=0:Pt>1&&(Pt=1),O[ht++]=tt-(tt-Et)*Pt|0,O[ht++]=q-(q-mt)*Pt|0,O[ht++]=ct-(ct-Ot)*Pt|0,O[ht++]=255}}function p(f,v,R){const M=v.coords,c=v.colors;let g,L;switch(v.type){case"lattice":const P=v.verticesPerRow,b=Math.floor(M.length/P)-1,N=P-1;for(g=0;g<b;g++){let O=g*P;for(let G=0;G<N;G++,O++)A(f,R,M[O],M[O+1],M[O+P],c[O],c[O+1],c[O+P]),A(f,R,M[O+P+1],M[O+1],M[O+P],c[O+P+1],c[O+1],c[O+P])}break;case"triangles":for(g=0,L=M.length;g<L;g+=3)A(f,R,M[g],M[g+1],M[g+2],c[g],c[g+1],c[g+2]);break;default:throw new Error("illegal figure")}}class I extends F{constructor(v){super(),this._coords=v[2],this._colors=v[3],this._figures=v[4],this._bounds=v[5],this._bbox=v[7],this._background=v[8],this.matrix=null}_createMeshCanvas(v,R,M){const P=Math.floor(this._bounds[0]),b=Math.floor(this._bounds[1]),N=Math.ceil(this._bounds[2])-P,O=Math.ceil(this._bounds[3])-b,G=Math.min(Math.ceil(Math.abs(N*v[0]*1.1)),3e3),K=Math.min(Math.ceil(Math.abs(O*v[1]*1.1)),3e3),W=N/G,_=O/K,nt={coords:this._coords,colors:this._colors,offsetX:-P,offsetY:-b,scaleX:1/W,scaleY:1/_},rt=G+2*2,Y=K+2*2,it=M.getCanvas("mesh",rt,Y,!1),ft=it.context,bt=ft.createImageData(G,K);if(R){const H=bt.data;for(let h=0,m=H.length;h<m;h+=4)H[h]=R[0],H[h+1]=R[1],H[h+2]=R[2],H[h+3]=255}for(const H of this._figures)p(bt,H,nt);return ft.putImageData(bt,2,2),{canvas:it.canvas,offsetX:P-2*W,offsetY:b-2*_,scaleX:W,scaleY:_}}getPattern(v,R,M,c){y(v,this._bbox);let g;if(c===o.SHADING)g=e.Util.singularValueDecompose2dScale((0,n.getCurrentTransform)(v));else if(g=e.Util.singularValueDecompose2dScale(R.baseTransform),this.matrix){const P=e.Util.singularValueDecompose2dScale(this.matrix);g=[g[0]*P[0],g[1]*P[1]]}const L=this._createMeshCanvas(g,c===o.SHADING?null:this._background,R.cachedCanvases);return c!==o.SHADING&&(v.setTransform(...R.baseTransform),this.matrix&&v.transform(...this.matrix)),v.translate(L.offsetX,L.offsetY),v.scale(L.scaleX,L.scaleY),v.createPattern(L.canvas,"no-repeat")}}class E extends F{getPattern(){return"hotpink"}}function k(f){switch(f[0]){case"RadialAxial":return new x(f);case"Mesh":return new I(f);case"Dummy":return new E}throw new Error(`Unknown IR type: ${f[0]}`)}const T={COLORED:1,UNCOLORED:2},l=class{constructor(v,R,M,c,g){this.operatorList=v[2],this.matrix=v[3]||[1,0,0,1,0,0],this.bbox=v[4],this.xstep=v[5],this.ystep=v[6],this.paintType=v[7],this.tilingType=v[8],this.color=R,this.ctx=M,this.canvasGraphicsFactory=c,this.baseTransform=g}createPatternCanvas(v){const R=this.operatorList,M=this.bbox,c=this.xstep,g=this.ystep,L=this.paintType,P=this.tilingType,b=this.color,N=this.canvasGraphicsFactory;(0,e.info)("TilingType: "+P);const O=M[0],G=M[1],K=M[2],W=M[3],_=e.Util.singularValueDecompose2dScale(this.matrix),nt=e.Util.singularValueDecompose2dScale(this.baseTransform),rt=[_[0]*nt[0],_[1]*nt[1]],Y=this.getSizeAndScale(c,this.ctx.canvas.width,rt[0]),it=this.getSizeAndScale(g,this.ctx.canvas.height,rt[1]),ft=v.cachedCanvases.getCanvas("pattern",Y.size,it.size,!0),bt=ft.context,Rt=N.createCanvasGraphics(bt);Rt.groupLevel=v.groupLevel,this.setFillAndStrokeStyleToContext(Rt,L,b);let H=O,h=G,m=K,s=W;return O<0&&(H=0,m+=Math.abs(O)),G<0&&(h=0,s+=Math.abs(G)),bt.translate(-(Y.scale*H),-(it.scale*h)),Rt.transform(Y.scale,0,0,it.scale,0,0),bt.save(),this.clipBbox(Rt,H,h,m,s),Rt.baseTransform=(0,n.getCurrentTransform)(Rt.ctx),Rt.executeOperatorList(R),Rt.endDrawing(),{canvas:ft.canvas,scaleX:Y.scale,scaleY:it.scale,offsetX:H,offsetY:h}}getSizeAndScale(v,R,M){v=Math.abs(v);const c=Math.max(l.MAX_PATTERN_SIZE,R);let g=Math.ceil(v*M);return g>=c?g=c:M=g/v,{scale:M,size:g}}clipBbox(v,R,M,c,g){const L=c-R,P=g-M;v.ctx.rect(R,M,L,P),v.current.updateRectMinMax((0,n.getCurrentTransform)(v.ctx),[R,M,c,g]),v.clip(),v.endPath()}setFillAndStrokeStyleToContext(v,R,M){const c=v.ctx,g=v.current;switch(R){case T.COLORED:const L=this.ctx;c.fillStyle=L.fillStyle,c.strokeStyle=L.strokeStyle,g.fillColor=L.fillStyle,g.strokeColor=L.strokeStyle;break;case T.UNCOLORED:const P=e.Util.makeHexColor(M[0],M[1],M[2]);c.fillStyle=P,c.strokeStyle=P,g.fillColor=P,g.strokeColor=P;break;default:throw new e.FormatError(`Unsupported paint type: ${R}`)}}getPattern(v,R,M,c){let g=M;c!==o.SHADING&&(g=e.Util.transform(g,R.baseTransform),this.matrix&&(g=e.Util.transform(g,this.matrix)));const L=this.createPatternCanvas(R);let P=new DOMMatrix(g);P=P.translate(L.offsetX,L.offsetY),P=P.scale(1/L.scaleX,1/L.scaleY);const b=v.createPattern(L.canvas,"repeat");return b.setTransform(P),b}};let u=l;ne(u,"MAX_PATTERN_SIZE",3e3),i.TilingPattern=u},(C,i,t)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.convertBlackAndWhiteToRGBA=o,i.convertToRGBA=n,i.grayToRGBA=F,t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123);var e=t(1);function n(x){switch(x.kind){case e.ImageKind.GRAYSCALE_1BPP:return o(x);case e.ImageKind.RGB_24BPP:return y(x)}return null}function o(x){let{src:A,srcPos:p=0,dest:I,width:E,height:k,nonBlackColor:T=4294967295,inverseDecode:u=!1}=x;const l=e.FeatureTest.isLittleEndian?4278190080:255,[f,v]=u?[T,l]:[l,T],R=E>>3,M=E&7,c=A.length;I=new Uint32Array(I.buffer);let g=0;for(let L=0;L<k;L++){for(const b=p+R;p<b;p++){const N=p<c?A[p]:255;I[g++]=N&128?v:f,I[g++]=N&64?v:f,I[g++]=N&32?v:f,I[g++]=N&16?v:f,I[g++]=N&8?v:f,I[g++]=N&4?v:f,I[g++]=N&2?v:f,I[g++]=N&1?v:f}if(M===0)continue;const P=p<c?A[p++]:255;for(let b=0;b<M;b++)I[g++]=P&1<<7-b?v:f}return{srcPos:p,destPos:g}}function y(x){let{src:A,srcPos:p=0,dest:I,destPos:E=0,width:k,height:T}=x,u=0;const l=A.length>>2,f=new Uint32Array(A.buffer,p,l);if(e.FeatureTest.isLittleEndian){for(;u<l-2;u+=3,E+=4){const v=f[u],R=f[u+1],M=f[u+2];I[E]=v|4278190080,I[E+1]=v>>>24|R<<8|4278190080,I[E+2]=R>>>16|M<<16|4278190080,I[E+3]=M>>>8|4278190080}for(let v=u*4,R=A.length;v<R;v+=3)I[E++]=A[v]|A[v+1]<<8|A[v+2]<<16|4278190080}else{for(;u<l-2;u+=3,E+=4){const v=f[u],R=f[u+1],M=f[u+2];I[E]=v|255,I[E+1]=v<<24|R>>>8|255,I[E+2]=R<<16|M>>>16|255,I[E+3]=M<<8|255}for(let v=u*4,R=A.length;v<R;v+=3)I[E++]=A[v]<<24|A[v+1]<<16|A[v+2]<<8|255}return{srcPos:p,destPos:E}}function F(x,A){if(e.FeatureTest.isLittleEndian)for(let p=0,I=x.length;p<I;p++)A[p]=x[p]*65793|4278190080;else for(let p=0,I=x.length;p<I;p++)A[p]=x[p]*16843008|255}},(C,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GlobalWorkerOptions=void 0;const t=Object.create(null);i.GlobalWorkerOptions=t,t.workerPort=null,t.workerSrc=""},(C,i,t)=>{var x,Nn,p,Bn,E,Fe;Object.defineProperty(i,"__esModule",{value:!0}),i.MessageHandler=void 0,t(2);var e=t(1);const n={UNKNOWN:0,DATA:1,ERROR:2},o={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function y(T){switch(T instanceof Error||typeof T=="object"&&T!==null||(0,e.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),T.name){case"AbortException":return new e.AbortException(T.message);case"MissingPDFException":return new e.MissingPDFException(T.message);case"PasswordException":return new e.PasswordException(T.message,T.code);case"UnexpectedResponseException":return new e.UnexpectedResponseException(T.message,T.status);case"UnknownErrorException":return new e.UnknownErrorException(T.message,T.details);default:return new e.UnknownErrorException(T.message,T.toString())}}class F{constructor(u,l,f){X(this,x);X(this,p);X(this,E);this.sourceName=u,this.targetName=l,this.comObj=f,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=v=>{const R=v.data;if(R.targetName!==this.sourceName)return;if(R.stream){j(this,p,Bn).call(this,R);return}if(R.callback){const c=R.callbackId,g=this.callbackCapabilities[c];if(!g)throw new Error(`Cannot resolve callback ${c}`);if(delete this.callbackCapabilities[c],R.callback===n.DATA)g.resolve(R.data);else if(R.callback===n.ERROR)g.reject(y(R.reason));else throw new Error("Unexpected callback case");return}const M=this.actionHandler[R.action];if(!M)throw new Error(`Unknown action from worker: ${R.action}`);if(R.callbackId){const c=this.sourceName,g=R.sourceName;new Promise(function(L){L(M(R.data))}).then(function(L){f.postMessage({sourceName:c,targetName:g,callback:n.DATA,callbackId:R.callbackId,data:L})},function(L){f.postMessage({sourceName:c,targetName:g,callback:n.ERROR,callbackId:R.callbackId,reason:y(L)})});return}if(R.streamId){j(this,x,Nn).call(this,R);return}M(R.data)},f.addEventListener("message",this._onComObjOnMessage)}on(u,l){const f=this.actionHandler;if(f[u])throw new Error(`There is already an actionName called "${u}"`);f[u]=l}send(u,l,f){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:u,data:l},f)}sendWithPromise(u,l,f){const v=this.callbackId++,R=new e.PromiseCapability;this.callbackCapabilities[v]=R;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:u,callbackId:v,data:l},f)}catch(M){R.reject(M)}return R.promise}sendWithStream(u,l,f,v){const R=this.streamId++,M=this.sourceName,c=this.targetName,g=this.comObj;return new ReadableStream({start:L=>{const P=new e.PromiseCapability;return this.streamControllers[R]={controller:L,startCall:P,pullCall:null,cancelCall:null,isClosed:!1},g.postMessage({sourceName:M,targetName:c,action:u,streamId:R,data:l,desiredSize:L.desiredSize},v),P.promise},pull:L=>{const P=new e.PromiseCapability;return this.streamControllers[R].pullCall=P,g.postMessage({sourceName:M,targetName:c,stream:o.PULL,streamId:R,desiredSize:L.desiredSize}),P.promise},cancel:L=>{(0,e.assert)(L instanceof Error,"cancel must have a valid reason");const P=new e.PromiseCapability;return this.streamControllers[R].cancelCall=P,this.streamControllers[R].isClosed=!0,g.postMessage({sourceName:M,targetName:c,stream:o.CANCEL,streamId:R,reason:y(L)}),P.promise}},f)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}x=new WeakSet,Nn=function(u){const l=u.streamId,f=this.sourceName,v=u.sourceName,R=this.comObj,M=this,c=this.actionHandler[u.action],g={enqueue(L){let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,b=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const N=this.desiredSize;this.desiredSize-=P,N>0&&this.desiredSize<=0&&(this.sinkCapability=new e.PromiseCapability,this.ready=this.sinkCapability.promise),R.postMessage({sourceName:f,targetName:v,stream:o.ENQUEUE,streamId:l,chunk:L},b)},close(){this.isCancelled||(this.isCancelled=!0,R.postMessage({sourceName:f,targetName:v,stream:o.CLOSE,streamId:l}),delete M.streamSinks[l])},error(L){(0,e.assert)(L instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,R.postMessage({sourceName:f,targetName:v,stream:o.ERROR,streamId:l,reason:y(L)}))},sinkCapability:new e.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:u.desiredSize,ready:null};g.sinkCapability.resolve(),g.ready=g.sinkCapability.promise,this.streamSinks[l]=g,new Promise(function(L){L(c(u.data,g))}).then(function(){R.postMessage({sourceName:f,targetName:v,stream:o.START_COMPLETE,streamId:l,success:!0})},function(L){R.postMessage({sourceName:f,targetName:v,stream:o.START_COMPLETE,streamId:l,reason:y(L)})})},p=new WeakSet,Bn=function(u){const l=u.streamId,f=this.sourceName,v=u.sourceName,R=this.comObj,M=this.streamControllers[l],c=this.streamSinks[l];switch(u.stream){case o.START_COMPLETE:u.success?M.startCall.resolve():M.startCall.reject(y(u.reason));break;case o.PULL_COMPLETE:u.success?M.pullCall.resolve():M.pullCall.reject(y(u.reason));break;case o.PULL:if(!c){R.postMessage({sourceName:f,targetName:v,stream:o.PULL_COMPLETE,streamId:l,success:!0});break}c.desiredSize<=0&&u.desiredSize>0&&c.sinkCapability.resolve(),c.desiredSize=u.desiredSize,new Promise(function(g){var L;g((L=c.onPull)==null?void 0:L.call(c))}).then(function(){R.postMessage({sourceName:f,targetName:v,stream:o.PULL_COMPLETE,streamId:l,success:!0})},function(g){R.postMessage({sourceName:f,targetName:v,stream:o.PULL_COMPLETE,streamId:l,reason:y(g)})});break;case o.ENQUEUE:if((0,e.assert)(M,"enqueue should have stream controller"),M.isClosed)break;M.controller.enqueue(u.chunk);break;case o.CLOSE:if((0,e.assert)(M,"close should have stream controller"),M.isClosed)break;M.isClosed=!0,M.controller.close(),j(this,E,Fe).call(this,M,l);break;case o.ERROR:(0,e.assert)(M,"error should have stream controller"),M.controller.error(y(u.reason)),j(this,E,Fe).call(this,M,l);break;case o.CANCEL_COMPLETE:u.success?M.cancelCall.resolve():M.cancelCall.reject(y(u.reason)),j(this,E,Fe).call(this,M,l);break;case o.CANCEL:if(!c)break;new Promise(function(g){var L;g((L=c.onCancel)==null?void 0:L.call(c,y(u.reason)))}).then(function(){R.postMessage({sourceName:f,targetName:v,stream:o.CANCEL_COMPLETE,streamId:l,success:!0})},function(g){R.postMessage({sourceName:f,targetName:v,stream:o.CANCEL_COMPLETE,streamId:l,reason:y(g)})}),c.sinkCapability.reject(y(u.reason)),c.isCancelled=!0,delete this.streamSinks[l];break;default:throw new Error("Unexpected stream case")}},E=new WeakSet,Fe=function(u,l){return ee(this,null,function*(){var f,v,R;yield Promise.allSettled([(f=u.startCall)==null?void 0:f.promise,(v=u.pullCall)==null?void 0:v.promise,(R=u.cancelCall)==null?void 0:R.promise]),delete this.streamControllers[l]})},i.MessageHandler=F},(C,i,t)=>{var o,y;Object.defineProperty(i,"__esModule",{value:!0}),i.Metadata=void 0;var e=t(1);class n{constructor(x){X(this,o,void 0);X(this,y,void 0);let{parsedData:A,rawData:p}=x;at(this,o,A),at(this,y,p)}getRaw(){return r(this,y)}get(x){var A;return(A=r(this,o).get(x))!=null?A:null}getAll(){return(0,e.objectFromMap)(r(this,o))}has(x){return r(this,o).has(x)}}o=new WeakMap,y=new WeakMap,i.Metadata=n},(C,i,t)=>{var x,A,p,I,E,k,on;Object.defineProperty(i,"__esModule",{value:!0}),i.OptionalContentConfig=void 0;var e=t(1),n=t(170);const o=Symbol("INTERNAL");class y{constructor(l,f){X(this,x,!0);this.name=l,this.intent=f}get visible(){return r(this,x)}_setVisible(l,f){l!==o&&(0,e.unreachable)("Internal method `_setVisible` called."),at(this,x,f)}}x=new WeakMap;class F{constructor(l){X(this,k);X(this,A,null);X(this,p,new Map);X(this,I,null);X(this,E,null);if(this.name=null,this.creator=null,l!==null){this.name=l.name,this.creator=l.creator,at(this,E,l.order);for(const f of l.groups)r(this,p).set(f.id,new y(f.name,f.intent));if(l.baseState==="OFF")for(const f of r(this,p).values())f._setVisible(o,!1);for(const f of l.on)r(this,p).get(f)._setVisible(o,!0);for(const f of l.off)r(this,p).get(f)._setVisible(o,!1);at(this,I,this.getHash())}}isVisible(l){if(r(this,p).size===0)return!0;if(!l)return(0,e.warn)("Optional content group not defined."),!0;if(l.type==="OCG")return r(this,p).has(l.id)?r(this,p).get(l.id).visible:((0,e.warn)(`Optional content group not found: ${l.id}`),!0);if(l.type==="OCMD"){if(l.expression)return j(this,k,on).call(this,l.expression);if(!l.policy||l.policy==="AnyOn"){for(const f of l.ids){if(!r(this,p).has(f))return(0,e.warn)(`Optional content group not found: ${f}`),!0;if(r(this,p).get(f).visible)return!0}return!1}else if(l.policy==="AllOn"){for(const f of l.ids){if(!r(this,p).has(f))return(0,e.warn)(`Optional content group not found: ${f}`),!0;if(!r(this,p).get(f).visible)return!1}return!0}else if(l.policy==="AnyOff"){for(const f of l.ids){if(!r(this,p).has(f))return(0,e.warn)(`Optional content group not found: ${f}`),!0;if(!r(this,p).get(f).visible)return!0}return!1}else if(l.policy==="AllOff"){for(const f of l.ids){if(!r(this,p).has(f))return(0,e.warn)(`Optional content group not found: ${f}`),!0;if(r(this,p).get(f).visible)return!1}return!0}return(0,e.warn)(`Unknown optional content policy ${l.policy}.`),!0}return(0,e.warn)(`Unknown group type ${l.type}.`),!0}setVisibility(l){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!r(this,p).has(l)){(0,e.warn)(`Optional content group not found: ${l}`);return}r(this,p).get(l)._setVisible(o,!!f),at(this,A,null)}get hasInitialVisibility(){return r(this,I)===null||this.getHash()===r(this,I)}getOrder(){return r(this,p).size?r(this,E)?r(this,E).slice():[...r(this,p).keys()]:null}getGroups(){return r(this,p).size>0?(0,e.objectFromMap)(r(this,p)):null}getGroup(l){return r(this,p).get(l)||null}getHash(){if(r(this,A)!==null)return r(this,A);const l=new n.MurmurHash3_64;for(const[f,v]of r(this,p))l.update(`${f}:${v.visible}`);return at(this,A,l.hexdigest())}}A=new WeakMap,p=new WeakMap,I=new WeakMap,E=new WeakMap,k=new WeakSet,on=function(l){const f=l.length;if(f<2)return!0;const v=l[0];for(let R=1;R<f;R++){const M=l[R];let c;if(Array.isArray(M))c=j(this,k,on).call(this,M);else if(r(this,p).has(M))c=r(this,p).get(M).visible;else return(0,e.warn)(`Optional content group not found: ${M}`),!0;switch(v){case"And":if(!c)return!1;break;case"Or":if(c)return!0;break;case"Not":return!c;default:return!0}}return v==="And"},i.OptionalContentConfig=F},(C,i,t)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.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 o{constructor(A,p){let{length:I,initialData:E,progressiveDone:k=!1,contentDispositionFilename:T=null,disableRange:u=!1,disableStream:l=!1}=A;if((0,e.assert)(p,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=k,this._contentDispositionFilename=T,(E==null?void 0:E.length)>0){const f=E instanceof Uint8Array&&E.byteLength===E.buffer.byteLength?E.buffer:new Uint8Array(E).buffer;this._queuedChunks.push(f)}this._pdfDataRangeTransport=p,this._isStreamingSupported=!l,this._isRangeSupported=!u,this._contentLength=I,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((f,v)=>{this._onReceiveData({begin:f,chunk:v})}),this._pdfDataRangeTransport.addProgressListener((f,v)=>{this._onProgress({loaded:f,total:v})}),this._pdfDataRangeTransport.addProgressiveReadListener(f=>{this._onReceiveData({chunk:f})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData(A){let{begin:p,chunk:I}=A;const E=I instanceof Uint8Array&&I.byteLength===I.buffer.byteLength?I.buffer:new Uint8Array(I).buffer;if(p===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(E):this._queuedChunks.push(E);else{const k=this._rangeReaders.some(function(T){return T._begin!==p?!1:(T._enqueue(E),!0)});(0,e.assert)(k,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var A,p;return(p=(A=this._fullRequestReader)==null?void 0:A._loaded)!=null?p:0}_onProgress(A){var p,I,E,k;A.total===void 0?(I=(p=this._rangeReaders[0])==null?void 0:p.onProgress)==null||I.call(p,{loaded:A.loaded}):(k=(E=this._fullRequestReader)==null?void 0:E.onProgress)==null||k.call(E,{loaded:A.loaded,total:A.total})}_onProgressiveDone(){var A;(A=this._fullRequestReader)==null||A.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(A){const p=this._rangeReaders.indexOf(A);p>=0&&this._rangeReaders.splice(p,1)}getFullReader(){(0,e.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const A=this._queuedChunks;return this._queuedChunks=null,new y(this,A,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(A,p){if(p<=this._progressiveDataLength)return null;const I=new F(this,A,p);return this._pdfDataRangeTransport.requestDataRange(A,p),this._rangeReaders.push(I),I}cancelAllRequests(A){var p;(p=this._fullRequestReader)==null||p.cancel(A);for(const I of this._rangeReaders.slice(0))I.cancel(A);this._pdfDataRangeTransport.abort()}}i.PDFDataTransportStream=o;class y{constructor(A,p){let I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;this._stream=A,this._done=I||!1,this._filename=(0,n.isPdfFile)(E)?E:null,this._queuedChunks=p||[],this._loaded=0;for(const k of this._queuedChunks)this._loaded+=k.byteLength;this._requests=[],this._headersReady=Promise.resolve(),A._fullRequestReader=this,this.onProgress=null}_enqueue(A){this._done||(this._requests.length>0?this._requests.shift().resolve({value:A,done:!1}):this._queuedChunks.push(A),this._loaded+=A.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}read(){return ee(this,null,function*(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const A=new e.PromiseCapability;return this._requests.push(A),A.promise})}cancel(A){this._done=!0;for(const p of this._requests)p.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class F{constructor(A,p,I){this._stream=A,this._begin=p,this._end=I,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(A){if(!this._done){if(this._requests.length===0)this._queuedChunk=A;else{this._requests.shift().resolve({value:A,done:!1});for(const I of this._requests)I.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}read(){return ee(this,null,function*(){if(this._queuedChunk){const p=this._queuedChunk;return this._queuedChunk=null,{value:p,done:!1}}if(this._done)return{value:void 0,done:!0};const A=new e.PromiseCapability;return this._requests.push(A),A.promise})}cancel(A){this._done=!0;for(const p of this._requests)p.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(C,i,t)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.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 o(I,E,k){return{method:"GET",headers:I,signal:k.signal,mode:"cors",credentials:E?"include":"same-origin",redirect:"follow"}}function y(I){const E=new Headers;for(const k in I){const T=I[k];T!==void 0&&E.append(k,T)}return E}function F(I){return I instanceof Uint8Array?I.buffer:I instanceof ArrayBuffer?I:((0,e.warn)(`getArrayBuffer - unexpected data format: ${I}`),new Uint8Array(I).buffer)}class x{constructor(E){this.source=E,this.isHttp=/^https?:/i.test(E.url),this.httpHeaders=this.isHttp&&E.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var E,k;return(k=(E=this._fullRequestReader)==null?void 0:E._loaded)!=null?k:0}getFullReader(){return(0,e.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new A(this),this._fullRequestReader}getRangeReader(E,k){if(k<=this._progressiveDataLength)return null;const T=new p(this,E,k);return this._rangeRequestReaders.push(T),T}cancelAllRequests(E){var k;(k=this._fullRequestReader)==null||k.cancel(E);for(const T of this._rangeRequestReaders.slice(0))T.cancel(E)}}i.PDFFetchStream=x;class A{constructor(E){this._stream=E,this._reader=null,this._loaded=0,this._filename=null;const k=E.source;this._withCredentials=k.withCredentials||!1,this._contentLength=k.length,this._headersCapability=new e.PromiseCapability,this._disableRange=k.disableRange||!1,this._rangeChunkSize=k.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!k.disableStream,this._isRangeSupported=!k.disableRange,this._headers=y(this._stream.httpHeaders);const T=k.url;fetch(T,o(this._headers,this._withCredentials,this._abortController)).then(u=>{if(!(0,n.validateResponseStatus)(u.status))throw(0,n.createResponseStatusError)(u.status,T);this._reader=u.body.getReader(),this._headersCapability.resolve();const l=R=>u.headers.get(R),{allowRangeRequests:f,suggestedLength:v}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:l,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=f,this._contentLength=v||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(l),!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}read(){return ee(this,null,function*(){var T;yield this._headersCapability.promise;const{value:E,done:k}=yield this._reader.read();return k?{value:E,done:k}:(this._loaded+=E.byteLength,(T=this.onProgress)==null||T.call(this,{loaded:this._loaded,total:this._contentLength}),{value:F(E),done:!1})})}cancel(E){var k;(k=this._reader)==null||k.cancel(E),this._abortController.abort()}}class p{constructor(E,k,T){this._stream=E,this._reader=null,this._loaded=0;const u=E.source;this._withCredentials=u.withCredentials||!1,this._readCapability=new e.PromiseCapability,this._isStreamingSupported=!u.disableStream,this._abortController=new AbortController,this._headers=y(this._stream.httpHeaders),this._headers.append("Range",`bytes=${k}-${T-1}`);const l=u.url;fetch(l,o(this._headers,this._withCredentials,this._abortController)).then(f=>{if(!(0,n.validateResponseStatus)(f.status))throw(0,n.createResponseStatusError)(f.status,l);this._readCapability.resolve(),this._reader=f.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}read(){return ee(this,null,function*(){var T;yield this._readCapability.promise;const{value:E,done:k}=yield this._reader.read();return k?{value:E,done:k}:(this._loaded+=E.byteLength,(T=this.onProgress)==null||T.call(this,{loaded:this._loaded}),{value:F(E),done:!1})})}cancel(E){var k;(k=this._reader)==null||k.cancel(E),this._abortController.abort()}}},(C,i,t)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createResponseStatusError=x,i.extractFilenameFromHeader=F,i.validateRangeRequestCapabilities=y,i.validateResponseStatus=A;var e=t(1),n=t(183),o=t(168);function y(p){let{getResponseHeader:I,isHttp:E,rangeChunkSize:k,disableRange:T}=p;const u={allowRangeRequests:!1,suggestedLength:void 0},l=parseInt(I("Content-Length"),10);return!Number.isInteger(l)||(u.suggestedLength=l,l<=2*k)||T||!E||I("Accept-Ranges")!=="bytes"||(I("Content-Encoding")||"identity")!=="identity"||(u.allowRangeRequests=!0),u}function F(p){const I=p("Content-Disposition");if(I){let E=(0,n.getFilenameFromContentDispositionHeader)(I);if(E.includes("%"))try{E=decodeURIComponent(E)}catch(k){}if((0,o.isPdfFile)(E))return E}return null}function x(p,I){return p===404||p===0&&I.startsWith("file:")?new e.MissingPDFException('Missing PDF "'+I+'".'):new e.UnexpectedResponseException(`Unexpected server response (${p}) while retrieving PDF "${I}".`,p)}function A(p){return p===200||p===206}},(C,i,t)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getFilenameFromContentDispositionHeader=n,t(89),t(149);var e=t(1);function n(o){let y=!0,F=x("filename\\*","i").exec(o);if(F){F=F[1];let u=E(F);return u=unescape(u),u=k(u),u=T(u),p(u)}if(F=I(o),F){const u=T(F);return p(u)}if(F=x("filename","i").exec(o),F){F=F[1];let u=E(F);return u=T(u),p(u)}function x(u,l){return new RegExp("(?:^|;)\\s*"+u+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',l)}function A(u,l){if(u){if(!/^[\x00-\xFF]+$/.test(l))return l;try{const f=new TextDecoder(u,{fatal:!0}),v=(0,e.stringToBytes)(l);l=f.decode(v),y=!1}catch(f){}}return l}function p(u){return y&&/[\x80-\xff]/.test(u)&&(u=A("utf-8",u),y&&(u=A("iso-8859-1",u))),u}function I(u){const l=[];let f;const v=x("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(f=v.exec(u))!==null;){let[,M,c,g]=f;if(M=parseInt(M,10),M in l){if(M===0)break;continue}l[M]=[c,g]}const R=[];for(let M=0;M<l.length&&M in l;++M){let[c,g]=l[M];g=E(g),c&&(g=unescape(g),M===0&&(g=k(g))),R.push(g)}return R.join("")}function E(u){if(u.startsWith('"')){const l=u.slice(1).split('\\"');for(let f=0;f<l.length;++f){const v=l[f].indexOf('"');v!==-1&&(l[f]=l[f].slice(0,v),l.length=f+1),l[f]=l[f].replaceAll(/\\(.)/g,"$1")}u=l.join('"')}return u}function k(u){const l=u.indexOf("'");if(l===-1)return u;const f=u.slice(0,l),R=u.slice(l+1).replace(/^[^']*'/,"");return A(f,R)}function T(u){return!u.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(u)?u:u.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(l,f,v,R){if(v==="q"||v==="Q")return R=R.replaceAll("_"," "),R=R.replaceAll(/=([0-9a-fA-F]{2})/g,function(M,c){return String.fromCharCode(parseInt(c,16))}),A(f,R);try{R=atob(R)}catch(M){}return A(f,R)})}return""}},(C,i,t)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PDFNetworkStream=void 0,t(89);var e=t(1),n=t(182);const o=200,y=206;function F(E){const k=E.response;return typeof k!="string"?k:(0,e.stringToBytes)(k).buffer}class x{constructor(k){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.url=k,this.isHttp=/^https?:/i.test(k),this.httpHeaders=this.isHttp&&T.httpHeaders||Object.create(null),this.withCredentials=T.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(k,T,u){const l={begin:k,end:T};for(const f in u)l[f]=u[f];return this.request(l)}requestFull(k){return this.request(k)}request(k){const T=new XMLHttpRequest,u=this.currXhrId++,l=this.pendingRequests[u]={xhr:T};T.open("GET",this.url),T.withCredentials=this.withCredentials;for(const f in this.httpHeaders){const v=this.httpHeaders[f];v!==void 0&&T.setRequestHeader(f,v)}return this.isHttp&&"begin"in k&&"end"in k?(T.setRequestHeader("Range",`bytes=${k.begin}-${k.end-1}`),l.expectedStatus=y):l.expectedStatus=o,T.responseType="arraybuffer",k.onError&&(T.onerror=function(f){k.onError(T.status)}),T.onreadystatechange=this.onStateChange.bind(this,u),T.onprogress=this.onProgress.bind(this,u),l.onHeadersReceived=k.onHeadersReceived,l.onDone=k.onDone,l.onError=k.onError,l.onProgress=k.onProgress,T.send(null),u}onProgress(k,T){var l;const u=this.pendingRequests[k];!u||(l=u.onProgress)==null||l.call(u,T)}onStateChange(k,T){var M,c,g;const u=this.pendingRequests[k];if(!u)return;const l=u.xhr;if(l.readyState>=2&&u.onHeadersReceived&&(u.onHeadersReceived(),delete u.onHeadersReceived),l.readyState!==4||!(k in this.pendingRequests))return;if(delete this.pendingRequests[k],l.status===0&&this.isHttp){(M=u.onError)==null||M.call(u,l.status);return}const f=l.status||o;if(!(f===o&&u.expectedStatus===y)&&f!==u.expectedStatus){(c=u.onError)==null||c.call(u,l.status);return}const R=F(l);if(f===y){const L=l.getResponseHeader("Content-Range"),P=/bytes (\d+)-(\d+)\/(\d+)/.exec(L);u.onDone({begin:parseInt(P[1],10),chunk:R})}else R?u.onDone({begin:0,chunk:R}):(g=u.onError)==null||g.call(u,l.status)}getRequestXhr(k){return this.pendingRequests[k].xhr}isPendingRequest(k){return k in this.pendingRequests}abortRequest(k){const T=this.pendingRequests[k].xhr;delete this.pendingRequests[k],T.abort()}}class A{constructor(k){this._source=k,this._manager=new x(k.url,{httpHeaders:k.httpHeaders,withCredentials:k.withCredentials}),this._rangeChunkSize=k.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(k){const T=this._rangeRequestReaders.indexOf(k);T>=0&&this._rangeRequestReaders.splice(T,1)}getFullReader(){return(0,e.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new p(this._manager,this._source),this._fullRequestReader}getRangeReader(k,T){const u=new I(this._manager,k,T);return u.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(u),u}cancelAllRequests(k){var T;(T=this._fullRequestReader)==null||T.cancel(k);for(const u of this._rangeRequestReaders.slice(0))u.cancel(k)}}i.PDFNetworkStream=A;class p{constructor(k,T){this._manager=k;const u={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=T.url,this._fullRequestId=k.requestFull(u),this._headersReceivedCapability=new e.PromiseCapability,this._disableRange=T.disableRange||!1,this._contentLength=T.length,this._rangeChunkSize=T.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 k=this._fullRequestId,T=this._manager.getRequestXhr(k),u=v=>T.getResponseHeader(v),{allowRangeRequests:l,suggestedLength:f}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:u,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});l&&(this._isRangeSupported=!0),this._contentLength=f||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(u),this._isRangeSupported&&this._manager.abortRequest(k),this._headersReceivedCapability.resolve()}_onDone(k){if(k&&(this._requests.length>0?this._requests.shift().resolve({value:k.chunk,done:!1}):this._cachedChunks.push(k.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const T of this._requests)T.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(k){this._storedError=(0,n.createResponseStatusError)(k,this._url),this._headersReceivedCapability.reject(this._storedError);for(const T of this._requests)T.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(k){var T;(T=this.onProgress)==null||T.call(this,{loaded:k.loaded,total:k.lengthComputable?k.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}read(){return ee(this,null,function*(){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 k=new e.PromiseCapability;return this._requests.push(k),k.promise})}cancel(k){this._done=!0,this._headersReceivedCapability.reject(k);for(const T of this._requests)T.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class I{constructor(k,T,u){this._manager=k;const l={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=k.url,this._requestId=k.requestRange(T,u,l),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var k;(k=this.onClosed)==null||k.call(this,this)}_onDone(k){const T=k.chunk;this._requests.length>0?this._requests.shift().resolve({value:T,done:!1}):this._queuedChunk=T,this._done=!0;for(const u of this._requests)u.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(k){this._storedError=(0,n.createResponseStatusError)(k,this._url);for(const T of this._requests)T.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(k){var T;this.isStreamingSupported||(T=this.onProgress)==null||T.call(this,{loaded:k.loaded})}get isStreamingSupported(){return!1}read(){return ee(this,null,function*(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const T=this._queuedChunk;return this._queuedChunk=null,{value:T,done:!1}}if(this._done)return{value:void 0,done:!0};const k=new e.PromiseCapability;return this._requests.push(k),k.promise})}cancel(k){this._done=!0;for(const T of this._requests)T.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(C,i,t)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.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 o=/^file:\/\/\/[a-zA-Z]:\//;function y(u){const l=require$$6,f=l.parse(u);return f.protocol==="file:"||f.host?f:/^[a-z]:[/\\]/i.test(u)?l.parse(`file:///${u}`):(f.host||(f.protocol="file:"),f)}class F{constructor(l){this.source=l,this.url=y(l.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&l.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var l,f;return(f=(l=this._fullRequestReader)==null?void 0:l._loaded)!=null?f:0}getFullReader(){return(0,e.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new k(this):new I(this),this._fullRequestReader}getRangeReader(l,f){if(f<=this._progressiveDataLength)return null;const v=this.isFsUrl?new T(this,l,f):new E(this,l,f);return this._rangeRequestReaders.push(v),v}cancelAllRequests(l){var f;(f=this._fullRequestReader)==null||f.cancel(l);for(const v of this._rangeRequestReaders.slice(0))v.cancel(l)}}i.PDFNodeStream=F;class x{constructor(l){this._url=l.url,this._done=!1,this._storedError=null,this.onProgress=null;const f=l.source;this._contentLength=f.length,this._loaded=0,this._filename=null,this._disableRange=f.disableRange||!1,this._rangeChunkSize=f.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!f.disableStream,this._isRangeSupported=!f.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}read(){return ee(this,null,function*(){var v;if(yield this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const l=this._readableStream.read();return l===null?(this._readCapability=new e.PromiseCapability,this.read()):(this._loaded+=l.length,(v=this.onProgress)==null||v.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(l).buffer,done:!1})})}cancel(l){if(!this._readableStream){this._error(l);return}this._readableStream.destroy(l)}_error(l){this._storedError=l,this._readCapability.resolve()}_setReadableStream(l){this._readableStream=l,l.on("readable",()=>{this._readCapability.resolve()}),l.on("end",()=>{l.destroy(),this._done=!0,this._readCapability.resolve()}),l.on("error",f=>{this._error(f)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new e.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class A{constructor(l){this._url=l.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new e.PromiseCapability;const f=l.source;this._isStreamingSupported=!f.disableStream}get isStreamingSupported(){return this._isStreamingSupported}read(){return ee(this,null,function*(){var v;if(yield this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const l=this._readableStream.read();return l===null?(this._readCapability=new e.PromiseCapability,this.read()):(this._loaded+=l.length,(v=this.onProgress)==null||v.call(this,{loaded:this._loaded}),{value:new Uint8Array(l).buffer,done:!1})})}cancel(l){if(!this._readableStream){this._error(l);return}this._readableStream.destroy(l)}_error(l){this._storedError=l,this._readCapability.resolve()}_setReadableStream(l){this._readableStream=l,l.on("readable",()=>{this._readCapability.resolve()}),l.on("end",()=>{l.destroy(),this._done=!0,this._readCapability.resolve()}),l.on("error",f=>{this._error(f)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function p(u,l){return{protocol:u.protocol,auth:u.auth,host:u.hostname,port:u.port,path:u.path,method:"GET",headers:l}}class I extends x{constructor(l){super(l);const f=v=>{if(v.statusCode===404){const g=new e.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=g,this._headersCapability.reject(g);return}this._headersCapability.resolve(),this._setReadableStream(v);const R=g=>this._readableStream.headers[g.toLowerCase()],{allowRangeRequests:M,suggestedLength:c}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:R,isHttp:l.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=M,this._contentLength=c||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(R)};if(this._request=null,this._url.protocol==="http:"){const v=require$$6;this._request=v.request(p(this._url,l.httpHeaders),f)}else{const v=require$$6;this._request=v.request(p(this._url,l.httpHeaders),f)}this._request.on("error",v=>{this._storedError=v,this._headersCapability.reject(v)}),this._request.end()}}class E extends A{constructor(l,f,v){super(l),this._httpHeaders={};for(const M in l.httpHeaders){const c=l.httpHeaders[M];c!==void 0&&(this._httpHeaders[M]=c)}this._httpHeaders.Range=`bytes=${f}-${v-1}`;const R=M=>{if(M.statusCode===404){const c=new e.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=c;return}this._setReadableStream(M)};if(this._request=null,this._url.protocol==="http:"){const M=require$$6;this._request=M.request(p(this._url,this._httpHeaders),R)}else{const M=require$$6;this._request=M.request(p(this._url,this._httpHeaders),R)}this._request.on("error",M=>{this._storedError=M}),this._request.end()}}class k extends x{constructor(l){super(l);let f=decodeURIComponent(this._url.path);o.test(this._url.href)&&(f=f.replace(/^\//,""));const v=require$$6;v.lstat(f,(R,M)=>{if(R){R.code==="ENOENT"&&(R=new e.MissingPDFException(`Missing PDF "${f}".`)),this._storedError=R,this._headersCapability.reject(R);return}this._contentLength=M.size,this._setReadableStream(v.createReadStream(f)),this._headersCapability.resolve()})}}class T extends A{constructor(l,f,v){super(l);let R=decodeURIComponent(this._url.path);o.test(this._url.href)&&(R=R.replace(/^\//,""));const M=require$$6;this._setReadableStream(M.createReadStream(R,{start:f,end:v-1}))}}},(C,i,t)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.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 o={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},y="http://www.w3.org/XML/1998/namespace",F="http://www.w3.org/1999/xlink",x=["butt","round","square"],A=["miter","round","bevel"],p=function(M){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(URL.createObjectURL&&typeof Blob!="undefined"&&!g)return URL.createObjectURL(new Blob([M],{type:c}));const L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let P=`data:${c};base64,`;for(let b=0,N=M.length;b<N;b+=3){const O=M[b]&255,G=M[b+1]&255,K=M[b+2]&255,W=O>>2,_=(O&3)<<4|G>>4,nt=b+1<N?(G&15)<<2|K>>6:64,rt=b+2<N?K&63:64;P+=L[W]+L[_]+L[nt]+L[rt]}return P},I=function(){const M=new Uint8Array([137,80,78,71,13,10,26,10]),c=12,g=new Int32Array(256);for(let K=0;K<256;K++){let W=K;for(let _=0;_<8;_++)W=W&1?3988292384^W>>1&2147483647:W>>1&2147483647;g[K]=W}function L(K,W,_){let nt=-1;for(let rt=W;rt<_;rt++){const Y=(nt^K[rt])&255,it=g[Y];nt=nt>>>8^it}return nt^-1}function P(K,W,_,nt){let rt=nt;const Y=W.length;_[rt]=Y>>24&255,_[rt+1]=Y>>16&255,_[rt+2]=Y>>8&255,_[rt+3]=Y&255,rt+=4,_[rt]=K.charCodeAt(0)&255,_[rt+1]=K.charCodeAt(1)&255,_[rt+2]=K.charCodeAt(2)&255,_[rt+3]=K.charCodeAt(3)&255,rt+=4,_.set(W,rt),rt+=W.length;const it=L(_,nt+4,rt);_[rt]=it>>24&255,_[rt+1]=it>>16&255,_[rt+2]=it>>8&255,_[rt+3]=it&255}function b(K,W,_){let nt=1,rt=0;for(let Y=W;Y<_;++Y)nt=(nt+(K[Y]&255))%65521,rt=(rt+nt)%65521;return rt<<16|nt}function N(K){if(!n.isNodeJS)return O(K);try{const W=parseInt(process.versions.node)>=8?K:Buffer.from(K),_=require$$6.deflateSync(W,{level:9});return _ instanceof Uint8Array?_:new Uint8Array(_)}catch(W){(0,n.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+W)}return O(K)}function O(K){let W=K.length;const _=65535,nt=Math.ceil(W/_),rt=new Uint8Array(2+W+nt*5+4);let Y=0;rt[Y++]=120,rt[Y++]=156;let it=0;for(;W>_;)rt[Y++]=0,rt[Y++]=255,rt[Y++]=255,rt[Y++]=0,rt[Y++]=0,rt.set(K.subarray(it,it+_),Y),Y+=_,it+=_,W-=_;rt[Y++]=1,rt[Y++]=W&255,rt[Y++]=W>>8&255,rt[Y++]=~W&65535&255,rt[Y++]=(~W&65535)>>8&255,rt.set(K.subarray(it),Y),Y+=K.length-it;const ft=b(K,0,K.length);return rt[Y++]=ft>>24&255,rt[Y++]=ft>>16&255,rt[Y++]=ft>>8&255,rt[Y++]=ft&255,rt}function G(K,W,_,nt){const rt=K.width,Y=K.height;let it,ft,bt;const Rt=K.data;switch(W){case n.ImageKind.GRAYSCALE_1BPP:ft=0,it=1,bt=rt+7>>3;break;case n.ImageKind.RGB_24BPP:ft=2,it=8,bt=rt*3;break;case n.ImageKind.RGBA_32BPP:ft=6,it=8,bt=rt*4;break;default:throw new Error("invalid format")}const H=new Uint8Array((1+bt)*Y);let h=0,m=0;for(let w=0;w<Y;++w)H[h++]=0,H.set(Rt.subarray(m,m+bt),h),m+=bt,h+=bt;if(W===n.ImageKind.GRAYSCALE_1BPP&&nt){h=0;for(let w=0;w<Y;w++){h++;for(let tt=0;tt<bt;tt++)H[h++]^=255}}const s=new Uint8Array([rt>>24&255,rt>>16&255,rt>>8&255,rt&255,Y>>24&255,Y>>16&255,Y>>8&255,Y&255,it,ft,0,0,0]),d=N(H),S=M.length+c*3+s.length+d.length,D=new Uint8Array(S);let U=0;return D.set(M,U),U+=M.length,P("IHDR",s,D,U),U+=c+s.length,P("IDATA",d,D,U),U+=c+d.length,P("IEND",new Uint8Array(0),D,U),p(D,"image/png",_)}return function(W,_,nt){const rt=W.kind===void 0?n.ImageKind.GRAYSCALE_1BPP:W.kind;return G(W,rt,_,nt)}}();class E{constructor(){this.fontSizeScale=1,this.fontWeight=o.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=o.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(c,g){this.x=c,this.y=g}}function k(M){let c=[];const g=[];for(const L of M){if(L.fn==="save"){c.push({fnId:92,fn:"group",items:[]}),g.push(c),c=c.at(-1).items;continue}L.fn==="restore"?c=g.pop():c.push(L)}return c}function T(M){if(Number.isInteger(M))return M.toString();const c=M.toFixed(10);let g=c.length-1;if(c[g]!=="0")return c;do g--;while(c[g]==="0");return c.substring(0,c[g]==="."?g:g+1)}function u(M){if(M[4]===0&&M[5]===0){if(M[1]===0&&M[2]===0)return M[0]===1&&M[3]===1?"":`scale(${T(M[0])} ${T(M[3])})`;if(M[0]===M[3]&&M[1]===-M[2]){const c=Math.acos(M[0])*180/Math.PI;return`rotate(${T(c)})`}}else if(M[0]===1&&M[1]===0&&M[2]===0&&M[3]===1)return`translate(${T(M[4])} ${T(M[5])})`;return`matrix(${T(M[0])} ${T(M[1])} ${T(M[2])} ${T(M[3])} ${T(M[4])} ${T(M[5])})`}let l=0,f=0,v=0;class R{constructor(c,g){let L=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 E,this.transformMatrix=n.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=c,this.objs=g,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!L,this._operatorIdMapping=[];for(const P in n.OPS)this._operatorIdMapping[n.OPS[P]]=P}getObject(c){let g=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):g}save(){this.transformStack.push(this.transformMatrix);const c=this.current;this.extraStack.push(c),this.current=c.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(c){this.save(),this.executeOpTree(c),this.restore()}loadDependencies(c){const g=c.fnArray,L=c.argsArray;for(let P=0,b=g.length;P<b;P++)if(g[P]===n.OPS.dependency)for(const N of L[P]){const O=N.startsWith("g_")?this.commonObjs:this.objs,G=new Promise(K=>{O.get(N,K)});this.current.dependencies.push(G)}return Promise.all(this.current.dependencies)}transform(c,g,L,P,b,N){const O=[c,g,L,P,b,N];this.transformMatrix=n.Util.transform(this.transformMatrix,O),this.tgrp=null}getSVG(c,g){this.viewport=g;const L=this._initialize(g);return this.loadDependencies(c).then(()=>(this.transformMatrix=n.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(c)),L))}convertOpList(c){const g=this._operatorIdMapping,L=c.argsArray,P=c.fnArray,b=[];for(let N=0,O=P.length;N<O;N++){const G=P[N];b.push({fnId:G,fn:g[G],args:L[N]})}return k(b)}executeOpTree(c){for(const g of c){const L=g.fn,P=g.fnId,b=g.args;switch(P|0){case n.OPS.beginText:this.beginText();break;case n.OPS.dependency:break;case n.OPS.setLeading:this.setLeading(b);break;case n.OPS.setLeadingMoveText:this.setLeadingMoveText(b[0],b[1]);break;case n.OPS.setFont:this.setFont(b);break;case n.OPS.showText:this.showText(b[0]);break;case n.OPS.showSpacedText:this.showText(b[0]);break;case n.OPS.endText:this.endText();break;case n.OPS.moveText:this.moveText(b[0],b[1]);break;case n.OPS.setCharSpacing:this.setCharSpacing(b[0]);break;case n.OPS.setWordSpacing:this.setWordSpacing(b[0]);break;case n.OPS.setHScale:this.setHScale(b[0]);break;case n.OPS.setTextMatrix:this.setTextMatrix(b[0],b[1],b[2],b[3],b[4],b[5]);break;case n.OPS.setTextRise:this.setTextRise(b[0]);break;case n.OPS.setTextRenderingMode:this.setTextRenderingMode(b[0]);break;case n.OPS.setLineWidth:this.setLineWidth(b[0]);break;case n.OPS.setLineJoin:this.setLineJoin(b[0]);break;case n.OPS.setLineCap:this.setLineCap(b[0]);break;case n.OPS.setMiterLimit:this.setMiterLimit(b[0]);break;case n.OPS.setFillRGBColor:this.setFillRGBColor(b[0],b[1],b[2]);break;case n.OPS.setStrokeRGBColor:this.setStrokeRGBColor(b[0],b[1],b[2]);break;case n.OPS.setStrokeColorN:this.setStrokeColorN(b);break;case n.OPS.setFillColorN:this.setFillColorN(b);break;case n.OPS.shadingFill:this.shadingFill(b[0]);break;case n.OPS.setDash:this.setDash(b[0],b[1]);break;case n.OPS.setRenderingIntent:this.setRenderingIntent(b[0]);break;case n.OPS.setFlatness:this.setFlatness(b[0]);break;case n.OPS.setGState:this.setGState(b[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(b[0]);break;case n.OPS.paintInlineImageXObject:this.paintInlineImageXObject(b[0]);break;case n.OPS.paintImageMaskXObject:this.paintImageMaskXObject(b[0]);break;case n.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(b[0],b[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(b[0],b[1],b[2],b[3],b[4],b[5]);break;case n.OPS.constructPath:this.constructPath(b[0],b[1]);break;case n.OPS.endPath:this.endPath();break;case 92:this.group(g.items);break;default:(0,n.warn)(`Unimplemented operator ${L}`);break}}}setWordSpacing(c){this.current.wordSpacing=c}setCharSpacing(c){this.current.charSpacing=c}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(c,g,L,P,b,N){const O=this.current;O.textMatrix=O.lineMatrix=[c,g,L,P,b,N],O.textMatrixScale=Math.hypot(c,g),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",`${T(O.fontSize)}px`),O.tspan.setAttributeNS(null,"y",T(-O.y)),O.txtElement=this.svgFactory.createElement("svg:text"),O.txtElement.append(O.tspan)}beginText(){const c=this.current;c.x=c.lineX=0,c.y=c.lineY=0,c.textMatrix=n.IDENTITY_MATRIX,c.lineMatrix=n.IDENTITY_MATRIX,c.textMatrixScale=1,c.tspan=this.svgFactory.createElement("svg:tspan"),c.txtElement=this.svgFactory.createElement("svg:text"),c.txtgrp=this.svgFactory.createElement("svg:g"),c.xcoords=[],c.ycoords=[]}moveText(c,g){const L=this.current;L.x=L.lineX+=c,L.y=L.lineY+=g,L.xcoords=[],L.ycoords=[],L.tspan=this.svgFactory.createElement("svg:tspan"),L.tspan.setAttributeNS(null,"font-family",L.fontFamily),L.tspan.setAttributeNS(null,"font-size",`${T(L.fontSize)}px`),L.tspan.setAttributeNS(null,"y",T(-L.y))}showText(c){const g=this.current,L=g.font,P=g.fontSize;if(P===0)return;const b=g.fontSizeScale,N=g.charSpacing,O=g.wordSpacing,G=g.fontDirection,K=g.textHScale*G,W=L.vertical,_=W?1:-1,nt=L.defaultVMetrics,rt=P*g.fontMatrix[0];let Y=0;for(const bt of c){if(bt===null){Y+=G*O;continue}else if(typeof bt=="number"){Y+=_*bt*P/1e3;continue}const Rt=(bt.isSpace?O:0)+N,H=bt.fontChar;let h,m,s=bt.width;if(W){let S;const D=bt.vmetric||nt;S=bt.vmetric?D[1]:s*.5,S=-S*rt;const U=D[2]*rt;s=D?-D[0]:s,h=S/b,m=(Y+U)/b}else h=Y/b,m=0;(bt.isInFont||L.missingFile)&&(g.xcoords.push(g.x+h),W&&g.ycoords.push(-g.y+m),g.tspan.textContent+=H);const d=W?s*rt-Rt*G:s*rt+Rt*G;Y+=d}g.tspan.setAttributeNS(null,"x",g.xcoords.map(T).join(" ")),W?g.tspan.setAttributeNS(null,"y",g.ycoords.map(T).join(" ")):g.tspan.setAttributeNS(null,"y",T(-g.y)),W?g.y-=Y:g.x+=Y*K,g.tspan.setAttributeNS(null,"font-family",g.fontFamily),g.tspan.setAttributeNS(null,"font-size",`${T(g.fontSize)}px`),g.fontStyle!==o.fontStyle&&g.tspan.setAttributeNS(null,"font-style",g.fontStyle),g.fontWeight!==o.fontWeight&&g.tspan.setAttributeNS(null,"font-weight",g.fontWeight);const it=g.textRenderingMode&n.TextRenderingMode.FILL_STROKE_MASK;if(it===n.TextRenderingMode.FILL||it===n.TextRenderingMode.FILL_STROKE?(g.fillColor!==o.fillColor&&g.tspan.setAttributeNS(null,"fill",g.fillColor),g.fillAlpha<1&&g.tspan.setAttributeNS(null,"fill-opacity",g.fillAlpha)):g.textRenderingMode===n.TextRenderingMode.ADD_TO_PATH?g.tspan.setAttributeNS(null,"fill","transparent"):g.tspan.setAttributeNS(null,"fill","none"),it===n.TextRenderingMode.STROKE||it===n.TextRenderingMode.FILL_STROKE){const bt=1/(g.textMatrixScale||1);this._setStrokeAttributes(g.tspan,bt)}let ft=g.textMatrix;g.textRise!==0&&(ft=ft.slice(),ft[5]+=g.textRise),g.txtElement.setAttributeNS(null,"transform",`${u(ft)} scale(${T(K)}, -1)`),g.txtElement.setAttributeNS(y,"xml:space","preserve"),g.txtElement.append(g.tspan),g.txtgrp.append(g.txtElement),this._ensureTransformGroup().append(g.txtElement)}setLeadingMoveText(c,g){this.setLeading(-g),this.moveText(c,g)}addFontStyle(c){if(!c.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 g=p(c.data,c.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${c.loadedName}"; src: url(${g}); }
  5. `}setFont(c){const g=this.current,L=this.commonObjs.get(c[0]);let P=c[1];g.font=L,this.embedFonts&&!L.missingFile&&!this.embeddedFonts[L.loadedName]&&(this.addFontStyle(L),this.embeddedFonts[L.loadedName]=L),g.fontMatrix=L.fontMatrix||n.FONT_IDENTITY_MATRIX;let b="normal";L.black?b="900":L.bold&&(b="bold");const N=L.italic?"italic":"normal";P<0?(P=-P,g.fontDirection=-1):g.fontDirection=1,g.fontSize=P,g.fontFamily=L.loadedName,g.fontWeight=b,g.fontStyle=N,g.tspan=this.svgFactory.createElement("svg:tspan"),g.tspan.setAttributeNS(null,"y",T(-g.y)),g.xcoords=[],g.ycoords=[]}endText(){var g;const c=this.current;c.textRenderingMode&n.TextRenderingMode.ADD_TO_PATH_FLAG&&((g=c.txtElement)==null?void 0:g.hasChildNodes())&&(c.element=c.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(c){c>0&&(this.current.lineWidth=c)}setLineCap(c){this.current.lineCap=x[c]}setLineJoin(c){this.current.lineJoin=A[c]}setMiterLimit(c){this.current.miterLimit=c}setStrokeAlpha(c){this.current.strokeAlpha=c}setStrokeRGBColor(c,g,L){this.current.strokeColor=n.Util.makeHexColor(c,g,L)}setFillAlpha(c){this.current.fillAlpha=c}setFillRGBColor(c,g,L){this.current.fillColor=n.Util.makeHexColor(c,g,L),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(c){this.current.strokeColor=this._makeColorN_Pattern(c)}setFillColorN(c){this.current.fillColor=this._makeColorN_Pattern(c)}shadingFill(c){const{width:g,height:L}=this.viewport,P=n.Util.inverseTransform(this.transformMatrix),[b,N,O,G]=n.Util.getAxialAlignedBoundingBox([0,0,g,L],P),K=this.svgFactory.createElement("svg:rect");K.setAttributeNS(null,"x",b),K.setAttributeNS(null,"y",N),K.setAttributeNS(null,"width",O-b),K.setAttributeNS(null,"height",G-N),K.setAttributeNS(null,"fill",this._makeShadingPattern(c)),this.current.fillAlpha<1&&K.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(K)}_makeColorN_Pattern(c){return c[0]==="TilingPattern"?this._makeTilingPattern(c):this._makeShadingPattern(c)}_makeTilingPattern(c){const g=c[1],L=c[2],P=c[3]||n.IDENTITY_MATRIX,[b,N,O,G]=c[4],K=c[5],W=c[6],_=c[7],nt=`shading${v++}`,[rt,Y,it,ft]=n.Util.normalizeRect([...n.Util.applyTransform([b,N],P),...n.Util.applyTransform([O,G],P)]),[bt,Rt]=n.Util.singularValueDecompose2dScale(P),H=K*bt,h=W*Rt,m=this.svgFactory.createElement("svg:pattern");m.setAttributeNS(null,"id",nt),m.setAttributeNS(null,"patternUnits","userSpaceOnUse"),m.setAttributeNS(null,"width",H),m.setAttributeNS(null,"height",h),m.setAttributeNS(null,"x",`${rt}`),m.setAttributeNS(null,"y",`${Y}`);const s=this.svg,d=this.transformMatrix,S=this.current.fillColor,D=this.current.strokeColor,U=this.svgFactory.create(it-rt,ft-Y);if(this.svg=U,this.transformMatrix=P,_===2){const w=n.Util.makeHexColor(...g);this.current.fillColor=w,this.current.strokeColor=w}return this.executeOpTree(this.convertOpList(L)),this.svg=s,this.transformMatrix=d,this.current.fillColor=S,this.current.strokeColor=D,m.append(U.childNodes[0]),this.defs.append(m),`url(#${nt})`}_makeShadingPattern(c){switch(typeof c=="string"&&(c=this.objs.get(c)),c[0]){case"RadialAxial":const g=`shading${v++}`,L=c[3];let P;switch(c[1]){case"axial":const b=c[4],N=c[5];P=this.svgFactory.createElement("svg:linearGradient"),P.setAttributeNS(null,"id",g),P.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),P.setAttributeNS(null,"x1",b[0]),P.setAttributeNS(null,"y1",b[1]),P.setAttributeNS(null,"x2",N[0]),P.setAttributeNS(null,"y2",N[1]);break;case"radial":const O=c[4],G=c[5],K=c[6],W=c[7];P=this.svgFactory.createElement("svg:radialGradient"),P.setAttributeNS(null,"id",g),P.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),P.setAttributeNS(null,"cx",G[0]),P.setAttributeNS(null,"cy",G[1]),P.setAttributeNS(null,"r",W),P.setAttributeNS(null,"fx",O[0]),P.setAttributeNS(null,"fy",O[1]),P.setAttributeNS(null,"fr",K);break;default:throw new Error(`Unknown RadialAxial type: ${c[1]}`)}for(const b of L){const N=this.svgFactory.createElement("svg:stop");N.setAttributeNS(null,"offset",b[0]),N.setAttributeNS(null,"stop-color",b[1]),P.append(N)}return this.defs.append(P),`url(#${g})`;case"Mesh":return(0,n.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${c[0]}`)}}setDash(c,g){this.current.dashArray=c,this.current.dashPhase=g}constructPath(c,g){const L=this.current;let P=L.x,b=L.y,N=[],O=0;for(const G of c)switch(G|0){case n.OPS.rectangle:P=g[O++],b=g[O++];const K=g[O++],W=g[O++],_=P+K,nt=b+W;N.push("M",T(P),T(b),"L",T(_),T(b),"L",T(_),T(nt),"L",T(P),T(nt),"Z");break;case n.OPS.moveTo:P=g[O++],b=g[O++],N.push("M",T(P),T(b));break;case n.OPS.lineTo:P=g[O++],b=g[O++],N.push("L",T(P),T(b));break;case n.OPS.curveTo:P=g[O+4],b=g[O+5],N.push("C",T(g[O]),T(g[O+1]),T(g[O+2]),T(g[O+3]),T(P),T(b)),O+=6;break;case n.OPS.curveTo2:N.push("C",T(P),T(b),T(g[O]),T(g[O+1]),T(g[O+2]),T(g[O+3])),P=g[O+2],b=g[O+3],O+=4;break;case n.OPS.curveTo3:P=g[O+2],b=g[O+3],N.push("C",T(g[O]),T(g[O+1]),T(P),T(b),T(P),T(b)),O+=4;break;case n.OPS.closePath:N.push("Z");break}N=N.join(" "),L.path&&c.length>0&&c[0]!==n.OPS.rectangle&&c[0]!==n.OPS.moveTo?N=L.path.getAttributeNS(null,"d")+N:(L.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(L.path)),L.path.setAttributeNS(null,"d",N),L.path.setAttributeNS(null,"fill","none"),L.element=L.path,L.setCurrentPoint(P,b)}endPath(){const c=this.current;if(c.path=null,!this.pendingClip)return;if(!c.element){this.pendingClip=null;return}const g=`clippath${l++}`,L=this.svgFactory.createElement("svg:clipPath");L.setAttributeNS(null,"id",g),L.setAttributeNS(null,"transform",u(this.transformMatrix));const P=c.element.cloneNode(!0);if(this.pendingClip==="evenodd"?P.setAttributeNS(null,"clip-rule","evenodd"):P.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,L.append(P),this.defs.append(L),c.activeClipUrl){c.clipGroup=null;for(const b of this.extraStack)b.clipGroup=null;L.setAttributeNS(null,"clip-path",c.activeClipUrl)}c.activeClipUrl=`url(#${g})`,this.tgrp=null}clip(c){this.pendingClip=c}closePath(){const c=this.current;if(c.path){const g=`${c.path.getAttributeNS(null,"d")}Z`;c.path.setAttributeNS(null,"d",g)}}setLeading(c){this.current.leading=-c}setTextRise(c){this.current.textRise=c}setTextRenderingMode(c){this.current.textRenderingMode=c}setHScale(c){this.current.textHScale=c/100}setRenderingIntent(c){}setFlatness(c){}setGState(c){for(const[g,L]of c)switch(g){case"LW":this.setLineWidth(L);break;case"LC":this.setLineCap(L);break;case"LJ":this.setLineJoin(L);break;case"ML":this.setMiterLimit(L);break;case"D":this.setDash(L[0],L[1]);break;case"RI":this.setRenderingIntent(L);break;case"FL":this.setFlatness(L);break;case"Font":this.setFont(L);break;case"CA":this.setStrokeAlpha(L);break;case"ca":this.setFillAlpha(L);break;default:(0,n.warn)(`Unimplemented graphic state operator ${g}`);break}}fill(){const c=this.current;c.element&&(c.element.setAttributeNS(null,"fill",c.fillColor),c.element.setAttributeNS(null,"fill-opacity",c.fillAlpha),this.endPath())}stroke(){const c=this.current;c.element&&(this._setStrokeAttributes(c.element),c.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(c){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;const L=this.current;let P=L.dashArray;g!==1&&P.length>0&&(P=P.map(function(b){return g*b})),c.setAttributeNS(null,"stroke",L.strokeColor),c.setAttributeNS(null,"stroke-opacity",L.strokeAlpha),c.setAttributeNS(null,"stroke-miterlimit",T(L.miterLimit)),c.setAttributeNS(null,"stroke-linecap",L.lineCap),c.setAttributeNS(null,"stroke-linejoin",L.lineJoin),c.setAttributeNS(null,"stroke-width",T(g*L.lineWidth)+"px"),c.setAttributeNS(null,"stroke-dasharray",P.map(T).join(" ")),c.setAttributeNS(null,"stroke-dashoffset",T(g*L.dashPhase)+"px")}eoFill(){var c;(c=this.current.element)==null||c.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var c;(c=this.current.element)==null||c.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const c=this.svgFactory.createElement("svg:rect");c.setAttributeNS(null,"x","0"),c.setAttributeNS(null,"y","0"),c.setAttributeNS(null,"width","1px"),c.setAttributeNS(null,"height","1px"),c.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(c)}paintImageXObject(c){const g=this.getObject(c);if(!g){(0,n.warn)(`Dependent image with object ID ${c} is not ready yet`);return}this.paintInlineImageXObject(g)}paintInlineImageXObject(c,g){const L=c.width,P=c.height,b=I(c,this.forceDataSchema,!!g),N=this.svgFactory.createElement("svg:rect");N.setAttributeNS(null,"x","0"),N.setAttributeNS(null,"y","0"),N.setAttributeNS(null,"width",T(L)),N.setAttributeNS(null,"height",T(P)),this.current.element=N,this.clip("nonzero");const O=this.svgFactory.createElement("svg:image");O.setAttributeNS(F,"xlink:href",b),O.setAttributeNS(null,"x","0"),O.setAttributeNS(null,"y",T(-P)),O.setAttributeNS(null,"width",T(L)+"px"),O.setAttributeNS(null,"height",T(P)+"px"),O.setAttributeNS(null,"transform",`scale(${T(1/L)} ${T(-1/P)})`),g?g.append(O):this._ensureTransformGroup().append(O)}paintImageMaskXObject(c){const g=this.getObject(c.data,c);if(g.bitmap){(0,n.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const L=this.current,P=g.width,b=g.height,N=L.fillColor;L.maskId=`mask${f++}`;const O=this.svgFactory.createElement("svg:mask");O.setAttributeNS(null,"id",L.maskId);const G=this.svgFactory.createElement("svg:rect");G.setAttributeNS(null,"x","0"),G.setAttributeNS(null,"y","0"),G.setAttributeNS(null,"width",T(P)),G.setAttributeNS(null,"height",T(b)),G.setAttributeNS(null,"fill",N),G.setAttributeNS(null,"mask",`url(#${L.maskId})`),this.defs.append(O),this._ensureTransformGroup().append(G),this.paintInlineImageXObject(g,O)}paintFormXObjectBegin(c,g){if(Array.isArray(c)&&c.length===6&&this.transform(c[0],c[1],c[2],c[3],c[4],c[5]),g){const L=g[2]-g[0],P=g[3]-g[1],b=this.svgFactory.createElement("svg:rect");b.setAttributeNS(null,"x",g[0]),b.setAttributeNS(null,"y",g[1]),b.setAttributeNS(null,"width",T(L)),b.setAttributeNS(null,"height",T(P)),this.current.element=b,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(c){const g=this.svgFactory.create(c.width,c.height),L=this.svgFactory.createElement("svg:defs");g.append(L),this.defs=L;const P=this.svgFactory.createElement("svg:g");return P.setAttributeNS(null,"transform",u(c.transform)),g.append(P),this.svg=P,g}_ensureClipGroup(){if(!this.current.clipGroup){const c=this.svgFactory.createElement("svg:g");c.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(c),this.current.clipGroup=c}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",u(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}i.SVGGraphics=R},(C,i,t)=>{var e=t(3),n=t(188),o=t(193);e({target:"Array",proto:!0},{group:function(F){var x=arguments.length>1?arguments[1]:void 0;return n(this,F,x)}}),o("group")},(C,i,t)=>{var e=t(99),n=t(14),o=t(13),y=t(40),F=t(18),x=t(64),A=t(189),p=t(108),I=Array,E=n([].push);C.exports=function(k,T,u,l){for(var f=y(k),v=o(f),R=e(T,u),M=A(null),c=x(v),g=0,L,P,b;c>g;g++)b=v[g],P=F(R(b,g,f)),P in M?E(M[P],b):M[P]=[b];if(l&&(L=l(f),L!==I))for(P in M)M[P]=p(L,M[P]);return M}},(C,i,t)=>{var e=t(47),n=t(190),o=t(66),y=t(55),F=t(192),x=t(43),A=t(54),p=">",I="<",E="prototype",k="script",T=A("IE_PROTO"),u=function(){},l=function(c){return I+k+p+c+I+"/"+k+p},f=function(c){c.write(l("")),c.close();var g=c.parentWindow.Object;return c=null,g},v=function(){var c=x("iframe"),g="java"+k+":",L;return c.style.display="none",F.appendChild(c),c.src=String(g),L=c.contentWindow.document,L.open(),L.write(l("document.F=Object")),L.close(),L.F},R,M=function(){try{R=new ActiveXObject("htmlfile")}catch(g){}M=typeof document!="undefined"?document.domain&&R?f(R):v():f(R);for(var c=o.length;c--;)delete M[E][o[c]];return M()};y[T]=!0,C.exports=Object.create||function(g,L){var P;return g!==null?(u[E]=e(g),P=new u,u[E]=null,P[T]=g):P=M(),L===void 0?P:n.f(P,L)}},(C,i,t)=>{var e=t(6),n=t(46),o=t(45),y=t(47),F=t(12),x=t(191);i.f=e&&!n?Object.defineProperties:function(p,I){y(p);for(var E=F(I),k=x(I),T=k.length,u=0,l;T>u;)o.f(p,l=k[u++],E[l]);return p}},(C,i,t)=>{var e=t(59),n=t(66);C.exports=Object.keys||function(y){return e(y,n)}},(C,i,t)=>{var e=t(24);C.exports=e("document","documentElement")},(C,i,t)=>{var e=t(34),n=t(189),o=t(45).f,y=e("unscopables"),F=Array.prototype;F[y]===void 0&&o(F,y,{configurable:!0,value:n(null)}),C.exports=function(x){F[y][x]=!0}},(C,i,t)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.XfaText=void 0,t(89);class e{static textContent(o){const y=[],F={items:y,styles:Object.create(null)};function x(A){var E;if(!A)return;let p=null;const I=A.name;if(I==="#text")p=A.value;else if(e.shouldBuildText(I))(E=A==null?void 0:A.attributes)!=null&&E.textContent?p=A.attributes.textContent:A.value&&(p=A.value);else return;if(p!==null&&y.push({str:p}),!!A.children)for(const k of A.children)x(k)}return x(o),F}static shouldBuildText(o){return!(o==="textarea"||o==="input"||o==="option"||o==="select")}}i.XfaText=e},(C,i,t)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TextLayerRenderTask=void 0,i.renderTextLayer=u,i.updateTextLayer=l,t(89),t(2);var e=t(1),n=t(168);const o=1e5,y=30,F=.8,x=new Map;function A(f,v){let R;if(v&&e.FeatureTest.isOffscreenCanvasSupported)R=new OffscreenCanvas(f,f).getContext("2d",{alpha:!1});else{const M=document.createElement("canvas");M.width=M.height=f,R=M.getContext("2d",{alpha:!1})}return R}function p(f,v){const R=x.get(f);if(R)return R;const M=A(y,v);M.font=`${y}px ${f}`;const c=M.measureText("");let g=c.fontBoundingBoxAscent,L=Math.abs(c.fontBoundingBoxDescent);if(g){const b=g/(g+L);return x.set(f,b),M.canvas.width=M.canvas.height=0,b}M.strokeStyle="red",M.clearRect(0,0,y,y),M.strokeText("g",0,0);let P=M.getImageData(0,0,y,y).data;L=0;for(let b=P.length-1-3;b>=0;b-=4)if(P[b]>0){L=Math.ceil(b/4/y);break}M.clearRect(0,0,y,y),M.strokeText("A",0,y),P=M.getImageData(0,0,y,y).data,g=0;for(let b=0,N=P.length;b<N;b+=4)if(P[b]>0){g=y-Math.floor(b/4/y);break}if(M.canvas.width=M.canvas.height=0,g){const b=g/(g+L);return x.set(f,b),b}return x.set(f,F),F}function I(f,v,R){const M=document.createElement("span"),c={angle:0,canvasWidth:0,hasText:v.str!=="",hasEOL:v.hasEOL,fontSize:0};f._textDivs.push(M);const g=e.Util.transform(f._transform,v.transform);let L=Math.atan2(g[1],g[0]);const P=R[v.fontName];P.vertical&&(L+=Math.PI/2);const b=Math.hypot(g[2],g[3]),N=b*p(P.fontFamily,f._isOffscreenCanvasSupported);let O,G;L===0?(O=g[4],G=g[5]-N):(O=g[4]+N*Math.sin(L),G=g[5]-N*Math.cos(L));const K="calc(var(--scale-factor)*",W=M.style;f._container===f._rootContainer?(W.left=`${(100*O/f._pageWidth).toFixed(2)}%`,W.top=`${(100*G/f._pageHeight).toFixed(2)}%`):(W.left=`${K}${O.toFixed(2)}px)`,W.top=`${K}${G.toFixed(2)}px)`),W.fontSize=`${K}${b.toFixed(2)}px)`,W.fontFamily=P.fontFamily,c.fontSize=b,M.setAttribute("role","presentation"),M.textContent=v.str,M.dir=v.dir,f._fontInspectorEnabled&&(M.dataset.fontName=v.fontName),L!==0&&(c.angle=L*(180/Math.PI));let _=!1;if(v.str.length>1)_=!0;else if(v.str!==" "&&v.transform[0]!==v.transform[3]){const nt=Math.abs(v.transform[0]),rt=Math.abs(v.transform[3]);nt!==rt&&Math.max(nt,rt)/Math.min(nt,rt)>1.5&&(_=!0)}_&&(c.canvasWidth=P.vertical?v.height:v.width),f._textDivProperties.set(M,c),f._isReadableStream&&f._layoutText(M)}function E(f){const{div:v,scale:R,properties:M,ctx:c,prevFontSize:g,prevFontFamily:L}=f,{style:P}=v;let b="";if(M.canvasWidth!==0&&M.hasText){const{fontFamily:N}=P,{canvasWidth:O,fontSize:G}=M;(g!==G||L!==N)&&(c.font=`${G*R}px ${N}`,f.prevFontSize=G,f.prevFontFamily=N);const{width:K}=c.measureText(v.textContent);K>0&&(b=`scaleX(${O*R/K})`)}M.angle!==0&&(b=`rotate(${M.angle}deg) ${b}`),b.length>0&&(P.transform=b)}function k(f){if(f._canceled)return;const v=f._textDivs,R=f._capability;if(v.length>o){R.resolve();return}if(!f._isReadableStream)for(const c of v)f._layoutText(c);R.resolve()}class T{constructor(v){var W;let{textContentSource:R,container:M,viewport:c,textDivs:g,textDivProperties:L,textContentItemsStr:P,isOffscreenCanvasSupported:b}=v;this._textContentSource=R,this._isReadableStream=R instanceof ReadableStream,this._container=this._rootContainer=M,this._textDivs=g||[],this._textContentItemsStr=P||[],this._isOffscreenCanvasSupported=b,this._fontInspectorEnabled=!!((W=globalThis.FontInspector)!=null&&W.enabled),this._reader=null,this._textDivProperties=L||new WeakMap,this._canceled=!1,this._capability=new e.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:c.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:A(0,b)};const{pageWidth:N,pageHeight:O,pageX:G,pageY:K}=c.rawDims;this._transform=[1,0,0,-1,-G,K+O],this._pageWidth=N,this._pageHeight=O,(0,n.setLayerDimensions)(M,c),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(v,R){for(const M of v){if(M.str===void 0){if(M.type==="beginMarkedContentProps"||M.type==="beginMarkedContent"){const c=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),M.id!==null&&this._container.setAttribute("id",`${M.id}`),c.append(this._container)}else M.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(M.str),I(this,M,R)}}_layoutText(v){const R=this._layoutTextParams.properties=this._textDivProperties.get(v);if(this._layoutTextParams.div=v,E(this._layoutTextParams),R.hasText&&this._container.append(v),R.hasEOL){const M=document.createElement("br");M.setAttribute("role","presentation"),this._container.append(M)}}_render(){const v=new e.PromiseCapability;let R=Object.create(null);if(this._isReadableStream){const M=()=>{this._reader.read().then(c=>{let{value:g,done:L}=c;if(L){v.resolve();return}Object.assign(R,g.styles),this._processItems(g.items,R),M()},v.reject)};this._reader=this._textContentSource.getReader(),M()}else if(this._textContentSource){const{items:M,styles:c}=this._textContentSource;this._processItems(M,c),v.resolve()}else throw new Error('No "textContentSource" parameter specified.');v.promise.then(()=>{R=null,k(this)},this._capability.reject)}}i.TextLayerRenderTask=T;function u(f){!f.textContentSource&&(f.textContent||f.textContentStream)&&((0,n.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),f.textContentSource=f.textContent||f.textContentStream);const{container:v,viewport:R}=f,M=getComputedStyle(v),c=M.getPropertyValue("visibility"),g=parseFloat(M.getPropertyValue("--scale-factor"));c==="visible"&&(!g||Math.abs(g-R.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 L=new T(f);return L._render(),L}function l(f){let{container:v,viewport:R,textDivs:M,textDivProperties:c,isOffscreenCanvasSupported:g,mustRotate:L=!0,mustRescale:P=!0}=f;if(L&&(0,n.setLayerDimensions)(v,{rotation:R.rotation}),P){const b=A(0,g),O={prevFontSize:null,prevFontFamily:null,div:null,scale:R.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:b};for(const G of M)O.properties=c.get(G),O.div=G,E(O)}}},(C,i,t)=>{var p,I,E,k,T,u,l,f,v,R,M,ln,g,Ie,P,cn,N,hn;Object.defineProperty(i,"__esModule",{value:!0}),i.AnnotationEditorLayer=void 0,t(125),t(136),t(138),t(141),t(143),t(145),t(147);var e=t(1),n=t(164),o=t(197),y=t(202),F=t(168),x=t(203);const G=class{constructor(W){X(this,M);X(this,g);X(this,P);X(this,N);X(this,p,void 0);X(this,I,!1);X(this,E,null);X(this,k,this.pointerup.bind(this));X(this,T,this.pointerdown.bind(this));X(this,u,new Map);X(this,l,!1);X(this,f,!1);X(this,v,!1);X(this,R,void 0);let{uiManager:_,pageIndex:nt,div:rt,accessibilityManager:Y,annotationLayer:it,viewport:ft,l10n:bt}=W;const Rt=[o.FreeTextEditor,y.InkEditor,x.StampEditor];if(!G._initialized){G._initialized=!0;for(const H of Rt)H.initialize(bt)}_.registerEditorTypes(Rt),at(this,R,_),this.pageIndex=nt,this.div=rt,at(this,p,Y),at(this,E,it),this.viewport=ft,r(this,R).addLayer(this)}get isEmpty(){return r(this,u).size===0}updateToolbar(W){r(this,R).updateToolbar(W)}updateMode(){let W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r(this,R).getMode();j(this,N,hn).call(this),W===e.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),W!==e.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",W===e.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",W===e.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",W===e.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(W){if(!W&&r(this,R).getMode()!==e.AnnotationEditorType.INK)return;if(!W){for(const nt of r(this,u).values())if(nt.isEmpty()){nt.setInBackground();return}}j(this,g,Ie).call(this,{offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(W){r(this,R).setEditingState(W)}addCommands(W){r(this,R).addCommands(W)}enable(){this.div.style.pointerEvents="auto";const W=new Set;for(const nt of r(this,u).values())nt.enableEditing(),nt.annotationElementId&&W.add(nt.annotationElementId);if(!r(this,E))return;const _=r(this,E).getEditableAnnotations();for(const nt of _){if(nt.hide(),r(this,R).isDeletedAnnotationElement(nt.data.id)||W.has(nt.data.id))continue;const rt=this.deserialize(nt);!rt||(this.addOrRebuild(rt),rt.enableEditing())}}disable(){var _;at(this,v,!0),this.div.style.pointerEvents="none";const W=new Set;for(const nt of r(this,u).values()){if(nt.disableEditing(),!nt.annotationElementId||nt.serialize()!==null){W.add(nt.annotationElementId);continue}(_=this.getEditableAnnotation(nt.annotationElementId))==null||_.show(),nt.remove()}if(r(this,E)){const nt=r(this,E).getEditableAnnotations();for(const rt of nt){const{id:Y}=rt.data;W.has(Y)||r(this,R).isDeletedAnnotationElement(Y)||rt.show()}}j(this,N,hn).call(this),this.isEmpty&&(this.div.hidden=!0),at(this,v,!1)}getEditableAnnotation(W){var _;return((_=r(this,E))==null?void 0:_.getEditableAnnotation(W))||null}setActiveEditor(W){r(this,R).getActive()!==W&&r(this,R).setActiveEditor(W)}enableClick(){this.div.addEventListener("pointerdown",r(this,T)),this.div.addEventListener("pointerup",r(this,k))}disableClick(){this.div.removeEventListener("pointerdown",r(this,T)),this.div.removeEventListener("pointerup",r(this,k))}attach(W){r(this,u).set(W.id,W);const{annotationElementId:_}=W;_&&r(this,R).isDeletedAnnotationElement(_)&&r(this,R).removeDeletedAnnotationElement(W)}detach(W){var _;r(this,u).delete(W.id),(_=r(this,p))==null||_.removePointerInTextLayer(W.contentDiv),!r(this,v)&&W.annotationElementId&&r(this,R).addDeletedAnnotationElement(W)}remove(W){this.detach(W),r(this,R).removeEditor(W),W.div.contains(document.activeElement)&&setTimeout(()=>{r(this,R).focusMainContainer()},0),W.div.remove(),W.isAttachedToDOM=!1,r(this,f)||this.addInkEditorIfNeeded(!1)}changeParent(W){var _;W.parent!==this&&(W.annotationElementId&&(r(this,R).addDeletedAnnotationElement(W.annotationElementId),n.AnnotationEditor.deleteAnnotationElement(W),W.annotationElementId=null),this.attach(W),(_=W.parent)==null||_.detach(W),W.setParent(this),W.div&&W.isAttachedToDOM&&(W.div.remove(),this.div.append(W.div)))}add(W){if(this.changeParent(W),r(this,R).addEditor(W),this.attach(W),!W.isAttachedToDOM){const _=W.render();this.div.append(_),W.isAttachedToDOM=!0}W.fixAndSetPosition(),W.onceAdded(),r(this,R).addToAnnotationStorage(W)}moveEditorInDOM(W){var nt;if(!W.isAttachedToDOM)return;const{activeElement:_}=document;W.div.contains(_)&&(W._focusEventsAllowed=!1,setTimeout(()=>{W.div.contains(document.activeElement)?W._focusEventsAllowed=!0:(W.div.addEventListener("focusin",()=>{W._focusEventsAllowed=!0},{once:!0}),_.focus())},0)),W._structTreeParentId=(nt=r(this,p))==null?void 0:nt.moveElementInDOM(this.div,W.div,W.contentDiv,!0)}addOrRebuild(W){W.needsToBeRebuilt()?W.rebuild():this.add(W)}addUndoableEditor(W){const _=()=>W._uiManager.rebuild(W),nt=()=>{W.remove()};this.addCommands({cmd:_,undo:nt,mustExec:!1})}getNextId(){return r(this,R).getId()}pasteEditor(W,_){r(this,R).updateToolbar(W),r(this,R).updateMode(W);const{offsetX:nt,offsetY:rt}=j(this,P,cn).call(this),Y=this.getNextId(),it=j(this,M,ln).call(this,me({parent:this,id:Y,x:nt,y:rt,uiManager:r(this,R),isCentered:!0},_));it&&this.add(it)}deserialize(W){var _;switch((_=W.annotationType)!=null?_:W.annotationEditorType){case e.AnnotationEditorType.FREETEXT:return o.FreeTextEditor.deserialize(W,this,r(this,R));case e.AnnotationEditorType.INK:return y.InkEditor.deserialize(W,this,r(this,R));case e.AnnotationEditorType.STAMP:return x.StampEditor.deserialize(W,this,r(this,R))}return null}addNewEditor(){j(this,g,Ie).call(this,j(this,P,cn).call(this),!0)}setSelected(W){r(this,R).setSelected(W)}toggleSelected(W){r(this,R).toggleSelected(W)}isSelected(W){return r(this,R).isSelected(W)}unselect(W){r(this,R).unselect(W)}pointerup(W){const{isMac:_}=e.FeatureTest.platform;if(!(W.button!==0||W.ctrlKey&&_)&&W.target===this.div&&!!r(this,l)){if(at(this,l,!1),!r(this,I)){at(this,I,!0);return}if(r(this,R).getMode()===e.AnnotationEditorType.STAMP){r(this,R).unselectAll();return}j(this,g,Ie).call(this,W,!1)}}pointerdown(W){if(r(this,l)){at(this,l,!1);return}const{isMac:_}=e.FeatureTest.platform;if(W.button!==0||W.ctrlKey&&_||W.target!==this.div)return;at(this,l,!0);const nt=r(this,R).getActive();at(this,I,!nt||nt.isEmpty())}findNewParent(W,_,nt){const rt=r(this,R).findParent(_,nt);return rt===null||rt===this?!1:(rt.changeParent(W),!0)}destroy(){var W,_;((W=r(this,R).getActive())==null?void 0:W.parent)===this&&(r(this,R).commitOrRemove(),r(this,R).setActiveEditor(null));for(const nt of r(this,u).values())(_=r(this,p))==null||_.removePointerInTextLayer(nt.contentDiv),nt.setParent(null),nt.isAttachedToDOM=!1,nt.div.remove();this.div=null,r(this,u).clear(),r(this,R).removeLayer(this)}render(W){let{viewport:_}=W;this.viewport=_,(0,F.setLayerDimensions)(this.div,_);for(const nt of r(this,R).getEditors(this.pageIndex))this.add(nt);this.updateMode()}update(W){let{viewport:_}=W;r(this,R).commitOrRemove(),this.viewport=_,(0,F.setLayerDimensions)(this.div,{rotation:_.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:W,pageHeight:_}=this.viewport.rawDims;return[W,_]}};let A=G;p=new WeakMap,I=new WeakMap,E=new WeakMap,k=new WeakMap,T=new WeakMap,u=new WeakMap,l=new WeakMap,f=new WeakMap,v=new WeakMap,R=new WeakMap,M=new WeakSet,ln=function(W){switch(r(this,R).getMode()){case e.AnnotationEditorType.FREETEXT:return new o.FreeTextEditor(W);case e.AnnotationEditorType.INK:return new y.InkEditor(W);case e.AnnotationEditorType.STAMP:return new x.StampEditor(W)}return null},g=new WeakSet,Ie=function(W,_){const nt=this.getNextId(),rt=j(this,M,ln).call(this,{parent:this,id:nt,x:W.offsetX,y:W.offsetY,uiManager:r(this,R),isCentered:_});return rt&&this.add(rt),rt},P=new WeakSet,cn=function(){const{x:W,y:_,width:nt,height:rt}=this.div.getBoundingClientRect(),Y=Math.max(0,W),it=Math.max(0,_),ft=Math.min(window.innerWidth,W+nt),bt=Math.min(window.innerHeight,_+rt),Rt=(Y+ft)/2-W,H=(it+bt)/2-_,[h,m]=this.viewport.rotation%180===0?[Rt,H]:[H,Rt];return{offsetX:h,offsetY:m}},N=new WeakSet,hn=function(){at(this,f,!0);for(const W of r(this,u).values())W.isEmpty()&&W.remove();at(this,f,!1)},ne(A,"_initialized",!1),i.AnnotationEditorLayer=A},(C,i,t)=>{var x,A,p,I,E,k,T,u,l,f,Un,R,Wn,c,Hn,L,Ee,b,un,O,zn,K,dn;Object.defineProperty(i,"__esModule",{value:!0}),i.FreeTextEditor=void 0,t(89);var e=t(1),n=t(165),o=t(164),y=t(198);const _=class extends o.AnnotationEditor{constructor(Y){super(Ce(me({},Y),{name:"freeTextEditor"}));X(this,f);X(this,R);X(this,c);X(this,L);X(this,b);X(this,O);X(this,K);X(this,x,this.editorDivBlur.bind(this));X(this,A,this.editorDivFocus.bind(this));X(this,p,this.editorDivInput.bind(this));X(this,I,this.editorDivKeydown.bind(this));X(this,E,void 0);X(this,k,"");X(this,T,`${this.id}-editor`);X(this,u,void 0);X(this,l,null);at(this,E,Y.color||_._defaultColor||o.AnnotationEditor._defaultLineColor),at(this,u,Y.fontSize||_._defaultFontSize)}static get _keyboardManager(){const Y=_.prototype,it=Rt=>Rt.isEmpty(),ft=n.AnnotationEditorUIManager.TRANSLATE_SMALL,bt=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:[-ft,0],checker:it}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],Y._translateEmpty,{args:[-bt,0],checker:it}],[["ArrowRight","mac+ArrowRight"],Y._translateEmpty,{args:[ft,0],checker:it}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],Y._translateEmpty,{args:[bt,0],checker:it}],[["ArrowUp","mac+ArrowUp"],Y._translateEmpty,{args:[0,-ft],checker:it}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],Y._translateEmpty,{args:[0,-bt],checker:it}],[["ArrowDown","mac+ArrowDown"],Y._translateEmpty,{args:[0,ft],checker:it}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],Y._translateEmpty,{args:[0,bt],checker:it}]]))}static initialize(Y){o.AnnotationEditor.initialize(Y,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});const it=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(it.getPropertyValue("--freetext-padding"))}static updateDefaultParams(Y,it){switch(Y){case e.AnnotationEditorParamsType.FREETEXT_SIZE:_._defaultFontSize=it;break;case e.AnnotationEditorParamsType.FREETEXT_COLOR:_._defaultColor=it;break}}updateParams(Y,it){switch(Y){case e.AnnotationEditorParamsType.FREETEXT_SIZE:j(this,f,Un).call(this,it);break;case e.AnnotationEditorParamsType.FREETEXT_COLOR:j(this,R,Wn).call(this,it);break}}static get defaultPropertiesToUpdate(){return[[e.AnnotationEditorParamsType.FREETEXT_SIZE,_._defaultFontSize],[e.AnnotationEditorParamsType.FREETEXT_COLOR,_._defaultColor||o.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[e.AnnotationEditorParamsType.FREETEXT_SIZE,r(this,u)],[e.AnnotationEditorParamsType.FREETEXT_COLOR,r(this,E)]]}_translateEmpty(Y,it){this._uiManager.translateSelectedEditors(Y,it,!0)}getInitialTranslation(){const Y=this.parentScale;return[-_._internalPadding*Y,-(_._internalPadding+r(this,u))*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,I)),this.editorDiv.addEventListener("focus",r(this,A)),this.editorDiv.addEventListener("blur",r(this,x)),this.editorDiv.addEventListener("input",r(this,p)))}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,T)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",r(this,I)),this.editorDiv.removeEventListener("focus",r(this,A)),this.editorDiv.removeEventListener("blur",r(this,x)),this.editorDiv.removeEventListener("input",r(this,p)),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,K,dn).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,k),it=at(this,k,j(this,c,Hn).call(this).trimEnd());if(Y===it)return;const ft=bt=>{if(at(this,k,bt),!bt){this.remove();return}j(this,b,un).call(this),this._uiManager.rebuild(this),j(this,L,Ee).call(this)};this.addCommands({cmd:()=>{ft(it)},undo:()=>{ft(Y)},mustExec:!1}),j(this,L,Ee).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){_._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,it;this.width&&(Y=this.x,it=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",r(this,T)),this.enableEditing(),o.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(bt=>{var Rt;return(Rt=this.editorDiv)==null?void 0:Rt.setAttribute("aria-label",bt)}),o.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(bt=>{var Rt;return(Rt=this.editorDiv)==null?void 0:Rt.setAttribute("default-content",bt)}),this.editorDiv.contentEditable=!0;const{style:ft}=this.editorDiv;if(ft.fontSize=`calc(${r(this,u)}px * var(--scale-factor))`,ft.color=r(this,E),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[bt,Rt]=this.parentDimensions;if(this.annotationElementId){const{position:H}=r(this,l);let[h,m]=this.getInitialTranslation();[h,m]=this.pageTranslationToScreen(h,m);const[s,d]=this.pageDimensions,[S,D]=this.pageTranslation;let U,w;switch(this.rotation){case 0:U=Y+(H[0]-S)/s,w=it+this.height-(H[1]-D)/d;break;case 90:U=Y+(H[0]-S)/s,w=it-(H[1]-D)/d,[h,m]=[m,-h];break;case 180:U=Y-this.width+(H[0]-S)/s,w=it-(H[1]-D)/d,[h,m]=[-h,-m];break;case 270:U=Y+(H[0]-S-this.height*d)/s,w=it+(H[1]-D-this.width*s)/d,[h,m]=[-m,h];break}this.setAt(U*bt,w*Rt,h,m)}else this.setAt(Y*bt,it*Rt,this.width*bt,this.height*Rt);j(this,b,un).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,it,ft){let bt=null;if(Y instanceof y.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:H,fontColor:h},rect:m,rotation:s,id:d},textContent:S,textPosition:D,parent:{page:{pageNumber:U}}}=Y;if(!S||S.length===0)return null;bt=Y={annotationType:e.AnnotationEditorType.FREETEXT,color:Array.from(h),fontSize:H,value:S.join(`
  6. `),position:D,pageIndex:U-1,rect:m,rotation:s,id:d,deleted:!1}}const Rt=super.deserialize(Y,it,ft);return at(Rt,u,Y.fontSize),at(Rt,E,e.Util.makeHexColor(...Y.color)),at(Rt,k,Y.value),Rt.annotationElementId=Y.id||null,at(Rt,l,bt),Rt}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 it=_._internalPadding*this.parentScale,ft=this.getRect(it,it),bt=o.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:r(this,E)),Rt={annotationType:e.AnnotationEditorType.FREETEXT,color:bt,fontSize:r(this,u),value:r(this,k),pageIndex:this.pageIndex,rect:ft,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return Y?Rt:this.annotationElementId&&!j(this,O,zn).call(this,Rt)?null:(Rt.id=this.annotationElementId,Rt)}};let F=_;x=new WeakMap,A=new WeakMap,p=new WeakMap,I=new WeakMap,E=new WeakMap,k=new WeakMap,T=new WeakMap,u=new WeakMap,l=new WeakMap,f=new WeakSet,Un=function(Y){const it=bt=>{this.editorDiv.style.fontSize=`calc(${bt}px * var(--scale-factor))`,this.translate(0,-(bt-r(this,u))*this.parentScale),at(this,u,bt),j(this,L,Ee).call(this)},ft=r(this,u);this.addCommands({cmd:()=>{it(Y)},undo:()=>{it(ft)},mustExec:!0,type:e.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},R=new WeakSet,Wn=function(Y){const it=r(this,E);this.addCommands({cmd:()=>{at(this,E,this.editorDiv.style.color=Y)},undo:()=>{at(this,E,this.editorDiv.style.color=it)},mustExec:!0,type:e.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},c=new WeakSet,Hn=function(){const Y=this.editorDiv.getElementsByTagName("div");if(Y.length===0)return this.editorDiv.innerText;const it=[];for(const ft of Y)it.push(ft.innerText.replace(/\r\n?|\n/,""));return it.join(`
  7. `)},L=new WeakSet,Ee=function(){const[Y,it]=this.parentDimensions;let ft;if(this.isAttachedToDOM)ft=this.div.getBoundingClientRect();else{const{currentLayer:bt,div:Rt}=this,H=Rt.style.display;Rt.style.display="hidden",bt.div.append(this.div),ft=Rt.getBoundingClientRect(),Rt.remove(),Rt.style.display=H}this.rotation%180===this.parentRotation%180?(this.width=ft.width/Y,this.height=ft.height/it):(this.width=ft.height/Y,this.height=ft.width/it),this.fixAndSetPosition()},b=new WeakSet,un=function(){if(this.editorDiv.replaceChildren(),!!r(this,k))for(const Y of r(this,k).split(`
  8. `)){const it=document.createElement("div");it.append(Y?document.createTextNode(Y):document.createElement("br")),this.editorDiv.append(it)}},O=new WeakSet,zn=function(Y){const{value:it,fontSize:ft,color:bt,rect:Rt,pageIndex:H}=r(this,l);return Y.value!==it||Y.fontSize!==ft||Y.rect.some((h,m)=>Math.abs(h-Rt[m])>=1)||Y.color.some((h,m)=>h!==bt[m])||Y.pageIndex!==H},K=new WeakSet,dn=function(){let Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.annotationElementId)return;if(j(this,L,Ee).call(this),!Y&&(this.width===0||this.height===0)){setTimeout(()=>j(this,K,dn).call(this,!0),0);return}const it=_._internalPadding*this.parentScale;r(this,l).rect=this.getRect(it,it)},ne(F,"_freeTextDefaultContent",""),ne(F,"_internalPadding",0),ne(F,"_defaultColor",null),ne(F,"_defaultFontSize",10),ne(F,"_type","freetext"),i.FreeTextEditor=F},(C,i,t)=>{var m,d,he,D,$n,w,tt,q,ct,ut,Et,mt,Ot,Wt,Pt,Nt,At,ht,st,dt,It,wt,Ht,Gn,$t,Oe,Kt,fn,Zt,pn,yt,Z,J,pt,jt,ot,z,gn,xt,St,kt,vt,Vn,Tt,mn;Object.defineProperty(i,"__esModule",{value:!0}),i.StampAnnotationElement=i.InkAnnotationElement=i.FreeTextAnnotationElement=i.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),o=t(163),y=t(199),F=t(200),x=t(201);const A=1e3,p=9,I=new WeakSet;function E(Dt){return{width:Dt[2]-Dt[0],height:Dt[3]-Dt[1]}}class k{static create($){switch($.data.annotationType){case e.AnnotationType.LINK:return new u($);case e.AnnotationType.TEXT:return new l($);case e.AnnotationType.WIDGET:switch($.data.fieldType){case"Tx":return new v($);case"Btn":return $.data.radioButton?new c($):$.data.checkBox?new M($):new g($);case"Ch":return new L($);case"Sig":return new R($)}return new f($);case e.AnnotationType.POPUP:return new P($);case e.AnnotationType.FREETEXT:return new N($);case e.AnnotationType.LINE:return new O($);case e.AnnotationType.SQUARE:return new G($);case e.AnnotationType.CIRCLE:return new K($);case e.AnnotationType.POLYLINE:return new W($);case e.AnnotationType.CARET:return new nt($);case e.AnnotationType.INK:return new rt($);case e.AnnotationType.POLYGON:return new _($);case e.AnnotationType.HIGHLIGHT:return new Y($);case e.AnnotationType.UNDERLINE:return new it($);case e.AnnotationType.SQUIGGLY:return new ft($);case e.AnnotationType.STRIKEOUT:return new bt($);case e.AnnotationType.STAMP:return new Rt($);case e.AnnotationType.FILEATTACHMENT:return new H($);default:return new T($)}}}const s=class{constructor($){X(this,m,!1);let{isRenderable:a=!1,ignoreBorder:B=!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(B)),V&&this._createQuadrilaterals()}static _hasPopupData($){let{titleObj:a,contentsObj:B,richText:V}=$;return!!((a==null?void 0:a.str)||(B==null?void 0:B.str)||(V==null?void 0:V.str))}get hasPopupData(){return s._hasPopupData(this.data)}_createContainer($){const{data:a,parent:{page:B,viewport:V}}=this,Q=document.createElement("section");Q.setAttribute("data-annotation-id",a.id),this instanceof f||(Q.tabIndex=A),Q.style.zIndex=this.parent.zIndex++,this.data.popupRef&&Q.setAttribute("aria-haspopup","dialog"),a.noRotate&&Q.classList.add("norotate");const{pageWidth:et,pageHeight:lt,pageX:Ct,pageY:Ft}=V.rawDims;if(!a.rect||this instanceof P){const{rotation:_t}=a;return!a.hasOwnCanvas&&_t!==0&&this.setRotation(_t,Q),Q}const{width:Mt,height:Qt}=E(a.rect),Ut=e.Util.normalizeRect([a.rect[0],B.view[3]-a.rect[1]+B.view[1],a.rect[2],B.view[3]-a.rect[3]+B.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 c){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?(at(this,m,!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]-Ft)/lt}%`;const{rotation:Bt}=a;return a.hasOwnCanvas||Bt===0?(Q.style.width=`${100*Mt/et}%`,Q.style.height=`${100*Qt/lt}%`):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:B,pageHeight:V}=this.parent.viewport.rawDims,{width:Q,height:et}=E(this.data.rect);let lt,Ct;$%180===0?(lt=100*Q/B,Ct=100*et/V):(lt=100*et/B,Ct=100*Q/V),a.style.width=`${lt}%`,a.style.height=`${Ct}%`,a.setAttribute("data-main-rotation",(360-$)%360)}get _commonActions(){const $=(a,B,V)=>{const Q=V.detail[a],et=Q[0],lt=Q.slice(1);V.target.style[B]=y.ColorConverters[`${et}_HTML`](lt),this.annotationStorage.setValue(this.data.id,{[B]:y.ColorConverters[`${et}_rgb`](lt)})};return(0,e.shadow)(this,"_commonActions",{display:a=>{const{display:B}=a.detail,V=B%2===1;this.container.style.visibility=V?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:V,noPrint:B===1||B===2})},print:a=>{this.annotationStorage.setValue(this.data.id,{noPrint:!a.detail.print})},hidden:a=>{const{hidden:B}=a.detail;this.container.style.visibility=B?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:B,noView:B})},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 B=a.detail.rotation;this.setRotation(B),this.annotationStorage.setValue(this.data.id,{rotation:B})}})}_dispatchEventFromSandbox($,a){const B=this._commonActions;for(const V of Object.keys(a.detail)){const Q=$[V]||B[V];Q==null||Q(a)}}_setDefaultPropertiesFromJS($){if(!this.enableScripting)return;const a=this.annotationStorage.getRawValue(this.data.id);if(!a)return;const B=this._commonActions;for(const[V,Q]of Object.entries(a)){const et=B[V];if(et){const lt={detail:{[V]:Q},target:$};et(lt),delete a[V]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:$}=this.data;if(!$)return;const[a,B,V,Q]=this.data.rect;if($.length===1){const[,{x:Yt,y:qt},{x:te,y:se}]=$[0];if(V===Yt&&Q===qt&&a===te&&B===se)return}const{style:et}=this.container;let lt;if(r(this,m)){const{borderColor:Yt,borderWidth:qt}=et;et.borderWidth=0,lt=["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,Ft=Q-B,{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:se}]of $){const re=Mt.createElement("rect"),ie=(te-a)/Ct,le=(Q-qt)/Ft,ce=(Yt-te)/Ct,Cn=(qt-se)/Ft;re.setAttribute("x",ie),re.setAttribute("y",le),re.setAttribute("width",ce),re.setAttribute("height",Cn),Bt.append(re),lt==null||lt.push(`<rect vector-effect="non-scaling-stroke" x="${ie}" y="${le}" width="${ce}" height="${Cn}"/>`)}r(this,m)&&(lt.push("</g></svg>')"),et.backgroundImage=lt.join("")),this.container.append(Qt),this.container.style.clipPath=`url(#${_t})`}_createPopup(){const{container:$,data:a}=this;$.setAttribute("aria-haspopup","dialog");const B=new P({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(B.render())}render(){(0,e.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName($){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const B=[];if(this._fieldObjects){const V=this._fieldObjects[$];if(V)for(const{page:Q,id:et,exportValues:lt}of V){if(Q===-1||et===a)continue;const Ct=typeof lt=="string"?lt:null,Ft=document.querySelector(`[data-element-id="${et}"]`);if(Ft&&!I.has(Ft)){(0,e.warn)(`_getElementsByName - element not allowed: ${et}`);continue}B.push({id:et,exportValue:Ct,domElement:Ft})}return B}for(const V of document.getElementsByName($)){const{exportValue:Q}=V,et=V.getAttribute("data-element-id");et!==a&&(!I.has(V)||B.push({id:et,exportValue:Q,domElement:V}))}return B}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 B;(B=this.linkService.eventBus)==null||B.dispatch("switchannotationeditormode",{source:this,mode:$,editId:a})})}};let T=s;m=new WeakMap;class u extends T{constructor(a){let B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;super(a,{isRenderable:!0,ignoreBorder:!!(B!=null&&B.ignoreBorder),createQuadrilaterals:!0});X(this,d);X(this,D);this.isTooltipOnly=a.data.isTooltipOnly}render(){const{data:a,linkService:B}=this,V=document.createElement("a");V.setAttribute("data-element-id",a.id);let Q=!1;return a.url?(B.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,D,$n).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,B){a.href=this.linkService.getDestinationHash(B),a.onclick=()=>(B&&this.linkService.goToDestination(B),!1),(B||B==="")&&j(this,d,he).call(this)}_bindNamedAction(a,B){a.href=this.linkService.getAnchorUrl(""),a.onclick=()=>(this.linkService.executeNamedAction(B),!1),j(this,d,he).call(this)}_bindAttachment(a,B){a.href=this.linkService.getAnchorUrl(""),a.onclick=()=>{var V;return(V=this.downloadManager)==null||V.openOrDownloadData(this.container,B.content,B.filename),!1},j(this,d,he).call(this)}_bindJSAction(a,B){a.href=this.linkService.getAnchorUrl("");const V=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const Q of Object.keys(B.actions)){const et=V.get(Q);!et||(a[et]=()=>{var lt;return(lt=this.linkService.eventBus)==null||lt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:B.id,name:Q}}),!1})}a.onclick||(a.onclick=()=>!1),j(this,d,he).call(this)}_bindResetFormAction(a,B){const V=a.onclick;if(V||(a.href=this.linkService.getAnchorUrl("")),j(this,d,he).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:lt}=B,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)===lt&&Ct.push(_t)}else for(const Ut of Object.values(this._fieldObjects))Ct.push(...Ut);const Ft=this.annotationStorage,Mt=[];for(const Ut of Ct){const{id:Bt}=Ut;switch(Mt.push(Bt),Ut.type){case"text":{const Yt=Ut.defaultValue||"";Ft.setValue(Bt,{value:Yt});break}case"checkbox":case"radiobutton":{const Yt=Ut.defaultValue===Ut.exportValues;Ft.setValue(Bt,{value:Yt});break}case"combobox":case"listbox":{const Yt=Ut.defaultValue||"";Ft.setValue(Bt,{value:Yt});break}default:continue}const _t=document.querySelector(`[data-element-id="${Bt}"]`);if(_t){if(!I.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}}}d=new WeakSet,he=function(){this.container.setAttribute("data-internal-link","")},D=new WeakSet,$n=function(a,B){a.href=this.linkService.getAnchorUrl(""),a.onclick=()=>(this.linkService.executeSetOCGState(B),!1),j(this,d,he).call(this)};class l extends T{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 f extends T{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:B}=e.FeatureTest.platform;return a&&$.ctrlKey||B&&$.metaKey}_setEventListener($,a,B,V,Q){B.includes("mouse")?$.addEventListener(B,et=>{var lt;(lt=this.linkService.eventBus)==null||lt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:V,value:Q(et),shift:et.shiftKey,modifier:this._getKeyModifier(et)}})}):$.addEventListener(B,et=>{var lt;if(B==="blur"){if(!a.focused||!et.relatedTarget)return;a.focused=!1}else if(B==="focus"){if(a.focused)return;a.focused=!0}!Q||(lt=this.linkService.eventBus)==null||lt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:V,value:Q(et)}})})}_setEventListeners($,a,B,V){var Q,et,lt;for(const[Ct,Ft]of B)(Ft==="Action"||((Q=this.data.actions)==null?void 0:Q[Ft]))&&((Ft==="Focus"||Ft==="Blur")&&(a||(a={focused:!1})),this._setEventListener($,a,Ct,Ft,V),Ft==="Focus"&&!((et=this.data.actions)!=null&&et.Blur)?this._setEventListener($,a,"blur","Blur",null):Ft==="Blur"&&!((lt=this.data.actions)!=null&&lt.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:B}=this.data.defaultAppearanceData,V=this.data.defaultAppearanceData.fontSize||p,Q=$.style;let et;const lt=2,Ct=Ft=>Math.round(10*Ft)/10;if(this.data.multiLine){const Ft=Math.abs(this.data.rect[3]-this.data.rect[1]-lt),Mt=Math.round(Ft/(e.LINE_FACTOR*V))||1,Qt=Ft/Mt;et=Math.min(V,Ct(Qt/e.LINE_FACTOR))}else{const Ft=Math.abs(this.data.rect[3]-this.data.rect[1]-lt);et=Math.min(V,Ct(Ft/e.LINE_FACTOR))}Q.fontSize=`calc(${et}px * var(--scale-factor))`,Q.color=e.Util.makeHexColor(B[0],B[1],B[2]),this.data.textAlignment!==null&&(Q.textAlign=a[this.data.textAlignment])}_setRequired($,a){a?$.setAttribute("required",!0):$.removeAttribute("required"),$.setAttribute("aria-required",a)}}class v extends f{constructor($){const a=$.renderForms||!$.data.hasAppearance&&!!$.data.fieldValue;super($,{isRenderable:a})}setPropertyOnSiblings($,a,B,V){const Q=this.annotationStorage;for(const et of this._getElementsByName($.name,$.id))et.domElement&&(et.domElement[a]=B),Q.setValue(et.id,{[V]:B})}render(){var V,Q;const $=this.annotationStorage,a=this.data.id;this.container.classList.add("textWidgetAnnotation");let B=null;if(this.renderForms){const et=$.getValue(a,{value:this.data.fieldValue});let lt=et.value||"";const Ct=$.getValue(a,{charLimit:this.data.maxLen}).charLimit;Ct&&lt.length>Ct&&(lt=lt.slice(0,Ct));let Ft=et.formattedValue||((V=this.data.textContent)==null?void 0:V.join(`
  9. `))||null;Ft&&this.data.comb&&(Ft=Ft.replaceAll(/\s+/g,""));const Mt={userValue:lt,formattedValue:Ft,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(B=document.createElement("textarea"),B.textContent=Ft!=null?Ft:lt,this.data.doNotScroll&&(B.style.overflowY="hidden")):(B=document.createElement("input"),B.type="text",B.setAttribute("value",Ft!=null?Ft:lt),this.data.doNotScroll&&(B.style.overflowX="hidden")),this.data.hasOwnCanvas&&(B.hidden=!0),I.add(B),B.setAttribute("data-element-id",a),B.disabled=this.data.readOnly,B.name=this.data.fieldName,B.tabIndex=A,this._setRequired(B,this.data.required),Ct&&(B.maxLength=Ct),B.addEventListener("input",Ut=>{$.setValue(a,{value:Ut.target.value}),this.setPropertyOnSiblings(B,"value",Ut.target.value,"value"),Mt.formattedValue=null}),B.addEventListener("resetform",Ut=>{var _t;const Bt=(_t=this.data.defaultFieldValue)!=null?_t:"";B.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){B.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}),B.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 re;const{charLimit:qt}=Yt.detail,{target:te}=Yt;if(qt===0){te.removeAttribute("maxLength");return}te.setAttribute("maxLength",qt);let se=Mt.userValue;!se||se.length<=qt||(se=se.slice(0,qt),te.value=Mt.userValue=se,$.setValue(a,{value:se}),(re=this.linkService.eventBus)==null||re.dispatch("dispatcheventinsandbox",{source:this,detail:{id:a,name:"Keystroke",value:se,willCommit:!0,commitKey:1,selStart:te.selectionStart,selEnd:te.selectionEnd}}))}};this._dispatchEventFromSandbox(_t,Bt)}),B.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,B.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&&B.addEventListener("beforeinput",Bt=>{var le;Mt.lastCommittedValue=null;const{data:_t,target:Yt}=Bt,{value:qt,selectionStart:te,selectionEnd:se}=Yt;let re=te,ie=se;switch(Bt.inputType){case"deleteWordBackward":{const ce=qt.substring(0,te).match(/\w*[^\w]*$/);ce&&(re-=ce[0].length);break}case"deleteWordForward":{const ce=qt.substring(te).match(/^[^\w]*\w*/);ce&&(ie+=ce[0].length);break}case"deleteContentBackward":te===se&&(re-=1);break;case"deleteContentForward":te===se&&(ie+=1);break}Bt.preventDefault(),(le=this.linkService.eventBus)==null||le.dispatch("dispatcheventinsandbox",{source:this,detail:{id:a,name:"Keystroke",value:qt,change:_t||"",willCommit:!1,selStart:re,selEnd:ie}})}),this._setEventListeners(B,Mt,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Bt=>Bt.target.value)}if(Qt&&B.addEventListener("blur",Qt),this.data.comb){const Bt=(this.data.rect[2]-this.data.rect[0])/Ct;B.classList.add("comb"),B.style.letterSpacing=`calc(${Bt}px * var(--scale-factor) - 1ch)`}}else B=document.createElement("div"),B.textContent=this.data.fieldValue,B.style.verticalAlign="middle",B.style.display="table-cell";return this._setTextStyle(B),this._setBackgroundColor(B),this._setDefaultPropertiesFromJS(B),this.container.append(B),this.container}}class R extends f{constructor($){super($,{isRenderable:!!$.data.hasOwnCanvas})}}class M extends f{constructor($){super($,{isRenderable:$.renderForms})}render(){const $=this.annotationStorage,a=this.data,B=a.id;let V=$.getValue(B,{value:a.exportValue===a.fieldValue}).value;typeof V=="string"&&(V=V!=="Off",$.setValue(B,{value:V})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const Q=document.createElement("input");return I.add(Q),Q.setAttribute("data-element-id",B),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=A,Q.addEventListener("change",et=>{const{name:lt,checked:Ct}=et.target;for(const Ft of this._getElementsByName(lt,B)){const Mt=Ct&&Ft.exportValue===a.exportValue;Ft.domElement&&(Ft.domElement.checked=Mt),$.setValue(Ft.id,{value:Mt})}$.setValue(B,{value:Ct})}),Q.addEventListener("resetform",et=>{const lt=a.defaultFieldValue||"Off";et.target.checked=lt===a.exportValue}),this.enableScripting&&this.hasJSActions&&(Q.addEventListener("updatefromsandbox",et=>{const lt={value(Ct){Ct.target.checked=Ct.detail.value!=="Off",$.setValue(B,{value:Ct.target.checked})}};this._dispatchEventFromSandbox(lt,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 c extends f{constructor($){super($,{isRenderable:$.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const $=this.annotationStorage,a=this.data,B=a.id;let V=$.getValue(B,{value:a.fieldValue===a.buttonValue}).value;typeof V=="string"&&(V=V!==a.buttonValue,$.setValue(B,{value:V}));const Q=document.createElement("input");if(I.add(Q),Q.setAttribute("data-element-id",B),Q.disabled=a.readOnly,this._setRequired(Q,this.data.required),Q.type="radio",Q.name=a.fieldName,V&&Q.setAttribute("checked",!0),Q.tabIndex=A,Q.addEventListener("change",et=>{const{name:lt,checked:Ct}=et.target;for(const Ft of this._getElementsByName(lt,B))$.setValue(Ft.id,{value:!1});$.setValue(B,{value:Ct})}),Q.addEventListener("resetform",et=>{const lt=a.defaultFieldValue;et.target.checked=lt!=null&&lt===a.buttonValue}),this.enableScripting&&this.hasJSActions){const et=a.buttonValue;Q.addEventListener("updatefromsandbox",lt=>{const Ct={value:Ft=>{const Mt=et===Ft.detail.value;for(const Qt of this._getElementsByName(Ft.target.name)){const Ut=Mt&&Qt.id===B;Qt.domElement&&(Qt.domElement.checked=Ut),$.setValue(Qt.id,{value:Ut})}}};this._dispatchEventFromSandbox(Ct,lt)}),this._setEventListeners(Q,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],lt=>lt.target.checked)}return this._setBackgroundColor(Q),this._setDefaultPropertiesFromJS(Q),this.container.append(Q),this.container}}class g extends u{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",B=>{this._dispatchEventFromSandbox({},B)})),$}}class L extends f{constructor($){super($,{isRenderable:$.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const $=this.annotationStorage,a=this.data.id,B=$.getValue(a,{value:this.data.fieldValue}),V=document.createElement("select");I.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=A;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,B.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 lt=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=lt(!1);const Ft=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:lt(!0)}),Ct=lt(!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:lt(!0),items:Ft(Ut)}),Ct=lt(!1)},clear(Ut){for(;V.length!==0;)V.remove(0);$.setValue(a,{value:null,items:[]}),Ct=lt(!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:lt(!0),items:Ft(Ut)}),Ct=lt(!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:lt(!0),items:Ft(Ut)}),Ct=lt(!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:lt(!0)}),Ct=lt(!1)},editable(Ut){Ut.target.disabled=!Ut.detail.editable}};this._dispatchEventFromSandbox(Qt,Mt)}),V.addEventListener("input",Mt=>{var Ut;const Qt=lt(!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:lt(!0)})}),this.data.combo&&this._setTextStyle(V),this._setBackgroundColor(V),this._setDefaultPropertiesFromJS(V),this.container.append(V),this.container}}class P extends T{constructor($){const{data:a,elements:B}=$;super($,{isRenderable:T._hasPopupData(a)}),this.elements=B}render(){this.container.classList.add("popupAnnotation");const $=new b({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 B of this.elements)B.popup=$,a.push(B.data.id),B.addHighlightArea();return this.container.setAttribute("aria-controls",a.map(B=>`${e.AnnotationPrefix}${B}`).join(",")),this.container}}class b{constructor($){X(this,Ht);X(this,$t);X(this,Kt);X(this,Zt);X(this,w,null);X(this,tt,j(this,Ht,Gn).bind(this));X(this,q,j(this,Zt,pn).bind(this));X(this,ct,j(this,Kt,fn).bind(this));X(this,ut,j(this,$t,Oe).bind(this));X(this,Et,null);X(this,mt,null);X(this,Ot,null);X(this,Wt,null);X(this,Pt,null);X(this,Nt,null);X(this,At,!1);X(this,ht,null);X(this,st,null);X(this,dt,null);X(this,It,null);X(this,wt,!1);var _t;let{container:a,color:B,elements:V,titleObj:Q,modificationDate:et,contentsObj:lt,richText:Ct,parent:Ft,rect:Mt,parentRect:Qt,open:Ut}=$;at(this,mt,a),at(this,It,Q),at(this,Ot,lt),at(this,dt,Ct),at(this,Pt,Ft),at(this,Et,B),at(this,st,Mt),at(this,Nt,Qt),at(this,Wt,V);const Bt=n.PDFDateString.toDateObject(et);Bt&&at(this,w,Ft.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,ut)),Yt.addEventListener("mouseenter",r(this,ct)),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,mt).hidden=!0,Ut&&j(this,$t,Oe).call(this)}render(){if(r(this,ht))return;const{page:{view:$},viewport:{rawDims:{pageWidth:a,pageHeight:B,pageX:V,pageY:Q}}}=r(this,Pt),et=at(this,ht,document.createElement("div"));if(et.className="popup",r(this,Et)){const re=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, ${re} 30%, white)`:et.style.backgroundColor=e.Util.makeHexColor(...r(this,Et).map(le=>Math.floor(.7*(255-le)+le)))}const lt=document.createElement("span");lt.className="header";const Ct=document.createElement("h1");if(lt.append(Ct),{dir:Ct.dir,str:Ct.textContent}=r(this,It),et.append(lt),r(this,w)){const re=document.createElement("span");re.classList.add("popupDate"),r(this,w).then(ie=>{re.textContent=ie}),lt.append(re)}const Ft=r(this,Ot),Mt=r(this,dt);if((Mt==null?void 0:Mt.str)&&(!(Ft!=null&&Ft.str)||Ft.str===Mt.str))x.XfaLayer.render({xfaHtml:Mt.html,intent:"richText",div:et}),et.lastChild.classList.add("richText","popupContent");else{const re=this._formatContents(Ft);et.append(re)}let Qt=!!r(this,Nt),Ut=Qt?r(this,Nt):r(this,st);for(const re of r(this,Wt))if(!Ut||e.Util.intersect(re.data.rect,Ut)!==null){Ut=re.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:se}=r(this,mt);se.left=`${100*(qt-V)/a}%`,se.top=`${100*(te-Q)/B}%`,r(this,mt).append(et)}_formatContents($){let{str:a,dir:B}=$;const V=document.createElement("p");V.classList.add("popupContent"),V.dir=B;const Q=a.split(/(?:\r\n?|\n)/);for(let et=0,lt=Q.length;et<lt;++et){const Ct=Q[et];V.append(document.createTextNode(Ct)),et<lt-1&&V.append(document.createElement("br"))}return V}forceHide(){at(this,wt,this.isVisible),r(this,wt)&&(r(this,mt).hidden=!0)}maybeShow(){!r(this,wt)||(at(this,wt,!1),r(this,mt).hidden=!1)}get isVisible(){return r(this,mt).hidden===!1}}w=new WeakMap,tt=new WeakMap,q=new WeakMap,ct=new WeakMap,ut=new WeakMap,Et=new WeakMap,mt=new WeakMap,Ot=new WeakMap,Wt=new WeakMap,Pt=new WeakMap,Nt=new WeakMap,At=new WeakMap,ht=new WeakMap,st=new WeakMap,dt=new WeakMap,It=new WeakMap,wt=new WeakMap,Ht=new WeakSet,Gn=function($){$.altKey||$.shiftKey||$.ctrlKey||$.metaKey||($.key==="Enter"||$.key==="Escape"&&r(this,At))&&j(this,$t,Oe).call(this)},$t=new WeakSet,Oe=function(){at(this,At,!r(this,At)),r(this,At)?(j(this,Kt,fn).call(this),r(this,mt).addEventListener("click",r(this,ut)),r(this,mt).addEventListener("keydown",r(this,tt))):(j(this,Zt,pn).call(this),r(this,mt).removeEventListener("click",r(this,ut)),r(this,mt).removeEventListener("keydown",r(this,tt)))},Kt=new WeakSet,fn=function(){r(this,ht)||this.render(),this.isVisible?r(this,At)&&r(this,mt).classList.add("focused"):(r(this,mt).hidden=!1,r(this,mt).style.zIndex=parseInt(r(this,mt).style.zIndex)+1e3)},Zt=new WeakSet,pn=function(){r(this,mt).classList.remove("focused"),!(r(this,At)||!this.isVisible)&&(r(this,mt).hidden=!0,r(this,mt).style.zIndex=parseInt(r(this,mt).style.zIndex)-1e3)};class N extends T{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 B=document.createElement("span");B.textContent=a,$.append(B)}this.container.append($)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}i.FreeTextAnnotationElement=N;class O extends T{constructor(a){super(a,{isRenderable:!0,ignoreBorder:!0});X(this,yt,null)}render(){this.container.classList.add("lineAnnotation");const a=this.data,{width:B,height:V}=E(a.rect),Q=this.svgFactory.create(B,V,!0),et=at(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 T{constructor(a){super(a,{isRenderable:!0,ignoreBorder:!0});X(this,Z,null)}render(){this.container.classList.add("squareAnnotation");const a=this.data,{width:B,height:V}=E(a.rect),Q=this.svgFactory.create(B,V,!0),et=a.borderStyle.width,lt=at(this,Z,this.svgFactory.createElement("svg:rect"));return lt.setAttribute("x",et/2),lt.setAttribute("y",et/2),lt.setAttribute("width",B-et),lt.setAttribute("height",V-et),lt.setAttribute("stroke-width",et||1),lt.setAttribute("stroke","transparent"),lt.setAttribute("fill","transparent"),Q.append(lt),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 K extends T{constructor(a){super(a,{isRenderable:!0,ignoreBorder:!0});X(this,J,null)}render(){this.container.classList.add("circleAnnotation");const a=this.data,{width:B,height:V}=E(a.rect),Q=this.svgFactory.create(B,V,!0),et=a.borderStyle.width,lt=at(this,J,this.svgFactory.createElement("svg:ellipse"));return lt.setAttribute("cx",B/2),lt.setAttribute("cy",V/2),lt.setAttribute("rx",B/2-et/2),lt.setAttribute("ry",V/2-et/2),lt.setAttribute("stroke-width",et||1),lt.setAttribute("stroke","transparent"),lt.setAttribute("fill","transparent"),Q.append(lt),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 W extends T{constructor(a){super(a,{isRenderable:!0,ignoreBorder:!0});X(this,pt,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const a=this.data,{width:B,height:V}=E(a.rect),Q=this.svgFactory.create(B,V,!0);let et=[];for(const Ct of a.vertices){const Ft=Ct.x-a.rect[0],Mt=a.rect[3]-Ct.y;et.push(Ft+","+Mt)}et=et.join(" ");const lt=at(this,pt,this.svgFactory.createElement(this.svgElementName));return lt.setAttribute("points",et),lt.setAttribute("stroke-width",a.borderStyle.width||1),lt.setAttribute("stroke","transparent"),lt.setAttribute("fill","transparent"),Q.append(lt),this.container.append(Q),!a.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return r(this,pt)}addHighlightArea(){this.container.classList.add("highlightArea")}}pt=new WeakMap;class _ extends W{constructor($){super($),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class nt extends T{constructor($){super($,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class rt extends T{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:B,height:V}=E(a.rect),Q=this.svgFactory.create(B,V,!0);for(const et of a.inkLists){let lt=[];for(const Ft of et){const Mt=Ft.x-a.rect[0],Qt=a.rect[3]-Ft.y;lt.push(`${Mt},${Qt}`)}lt=lt.join(" ");const Ct=this.svgFactory.createElement(this.svgElementName);r(this,jt).push(Ct),Ct.setAttribute("points",lt),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,i.InkAnnotationElement=rt;class Y extends T{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 it extends T{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 ft extends T{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 bt extends T{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 Rt extends T{constructor($){super($,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}i.StampAnnotationElement=Rt;class H extends T{constructor(a){var Q;super(a,{isRenderable:!0});X(this,z);X(this,ot,null);const{filename:B,content:V}=this.data.file;this.filename=(0,n.getFilenameFromUrl)(B,!0),this.content=V,(Q=this.linkService.eventBus)==null||Q.dispatch("fileattachmentannotation",{source:this,filename:B,content:V})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:a,data:B}=this;let V;B.hasAppearance||B.fillAlpha===0?V=document.createElement("div"):(V=document.createElement("img"),V.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(B.name)?"paperclip":"pushpin"}.svg`,B.fillAlpha&&B.fillAlpha<1&&(V.style=`filter: opacity(${Math.round(B.fillAlpha*100)}%);`)),V.addEventListener("dblclick",j(this,z,gn).bind(this)),at(this,ot,V);const{isMac:Q}=e.FeatureTest.platform;return a.addEventListener("keydown",et=>{et.key==="Enter"&&(Q?et.metaKey:et.ctrlKey)&&j(this,z,gn).call(this)}),!B.popupRef&&this.hasPopupData?this._createPopup():V.classList.add("popupTriggerArea"),a.append(V),a}getElementsToTriggerPopup(){return r(this,ot)}addHighlightArea(){this.container.classList.add("highlightArea")}}ot=new WeakMap,z=new WeakSet,gn=function(){var a;(a=this.downloadManager)==null||a.openOrDownloadData(this.container,this.content,this.filename)};class h{constructor($){X(this,vt);X(this,Tt);X(this,xt,null);X(this,St,null);X(this,kt,new Map);let{div:a,accessibilityManager:B,annotationCanvasMap:V,l10n:Q,page:et,viewport:lt}=$;this.div=a,at(this,xt,B),at(this,St,V),this.l10n=Q,this.page=et,this.viewport=lt,this.zIndex=0,this.l10n||(this.l10n=F.NullL10n)}render($){return ee(this,null,function*(){const{annotations:a}=$,B=this.div;(0,n.setLayerDimensions)(B,this.viewport);const V=new Map,Q={data:null,layer:B,linkService:$.linkService,downloadManager:$.downloadManager,imageResourcesPath:$.imageResourcesPath||"",renderForms:$.renderForms!==!1,svgFactory:new n.DOMSVGFactory,annotationStorage:$.annotationStorage||new o.AnnotationStorage,enableScripting:$.enableScripting===!0,hasJSActions:$.hasJSActions,fieldObjects:$.fieldObjects,parent:this,elements:null};for(const et of a){if(et.noHTML)continue;const lt=et.annotationType===e.AnnotationType.POPUP;if(lt){const Mt=V.get(et.id);if(!Mt)continue;Q.elements=Mt}else{const{width:Mt,height:Qt}=E(et.rect);if(Mt<=0||Qt<=0)continue}Q.data=et;const Ct=k.create(Q);if(!Ct.isRenderable)continue;if(!lt&&et.popupRef){const Mt=V.get(et.popupRef);Mt?Mt.push(Ct):V.set(et.popupRef,[Ct])}Ct.annotationEditorType>0&&r(this,kt).set(Ct.data.id,Ct);const Ft=Ct.render();et.hidden&&(Ft.style.visibility="hidden"),j(this,vt,Vn).call(this,Ft,et.id)}j(this,Tt,mn).call(this),yield this.l10n.translate(B)})}update($){let{viewport:a}=$;const B=this.div;this.viewport=a,(0,n.setLayerDimensions)(B,{rotation:a.rotation}),j(this,Tt,mn).call(this),B.hidden=!1}getEditableAnnotations(){return Array.from(r(this,kt).values())}getEditableAnnotation($){return r(this,kt).get($)}}xt=new WeakMap,St=new WeakMap,kt=new WeakMap,vt=new WeakSet,Vn=function($,a){var V;const B=$.firstChild||$;B.id=`${e.AnnotationPrefix}${a}`,this.div.append($),(V=r(this,xt))==null||V.moveElementInDOM(this.div,$,B,!1)},Tt=new WeakSet,mn=function(){if(!r(this,St))return;const $=this.div;for(const[a,B]of r(this,St)){const V=$.querySelector(`[data-annotation-id="${a}"]`);if(!V)continue;const{firstChild:Q}=V;Q?Q.nodeName==="CANVAS"?Q.replaceWith(B):Q.before(B):V.append(B)}r(this,St).clear()},i.AnnotationLayer=h},(C,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorConverters=void 0;function t(o){return Math.floor(Math.max(0,Math.min(1,o))*255).toString(16).padStart(2,"0")}function e(o){return Math.max(0,Math.min(255,255*o))}class n{static CMYK_G(y){let[F,x,A,p]=y;return["G",1-Math.min(1,.3*F+.59*A+.11*x+p)]}static G_CMYK(y){let[F]=y;return["CMYK",0,0,0,1-F]}static G_RGB(y){let[F]=y;return["RGB",F,F,F]}static G_rgb(y){let[F]=y;return F=e(F),[F,F,F]}static G_HTML(y){let[F]=y;const x=t(F);return`#${x}${x}${x}`}static RGB_G(y){let[F,x,A]=y;return["G",.3*F+.59*x+.11*A]}static RGB_rgb(y){return y.map(e)}static RGB_HTML(y){return`#${y.map(t).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(y){let[F,x,A,p]=y;return["RGB",1-Math.min(1,F+p),1-Math.min(1,A+p),1-Math.min(1,x+p)]}static CMYK_rgb(y){let[F,x,A,p]=y;return[e(1-Math.min(1,F+p)),e(1-Math.min(1,A+p)),e(1-Math.min(1,x+p))]}static CMYK_HTML(y){const F=this.CMYK_RGB(y).slice(1);return this.RGB_HTML(F)}static RGB_CMYK(y){let[F,x,A]=y;const p=1-F,I=1-x,E=1-A,k=Math.min(p,I,E);return["CMYK",p,I,E,k]}}i.ColorConverters=n},(C,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.NullL10n=void 0,i.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(F,x){switch(F){case"find_match_count":F=`find_match_count[${x.total===1?"one":"other"}]`;break;case"find_match_count_limit":F=`find_match_count_limit[${x.limit===1?"one":"other"}]`;break}return t[F]||""}function n(F,x){return x?F.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(A,p)=>p in x?x[p]:"{{"+p+"}}"):F}const o={getLanguage(){return ee(this,null,function*(){return"en-us"})},getDirection(){return ee(this,null,function*(){return"ltr"})},get(x){return ee(this,arguments,function*(F){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e(F,A);return n(p,A)})},translate(F){return ee(this,null,function*(){})}};i.NullL10n=o},(C,i,t)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.XfaLayer=void 0,t(89);var e=t(194);class n{static setupStorage(y,F,x,A,p){const I=A.getValue(F,{value:null});switch(x.name){case"textarea":if(I.value!==null&&(y.textContent=I.value),p==="print")break;y.addEventListener("input",E=>{A.setValue(F,{value:E.target.value})});break;case"input":if(x.attributes.type==="radio"||x.attributes.type==="checkbox"){if(I.value===x.attributes.xfaOn?y.setAttribute("checked",!0):I.value===x.attributes.xfaOff&&y.removeAttribute("checked"),p==="print")break;y.addEventListener("change",E=>{A.setValue(F,{value:E.target.checked?E.target.getAttribute("xfaOn"):E.target.getAttribute("xfaOff")})})}else{if(I.value!==null&&y.setAttribute("value",I.value),p==="print")break;y.addEventListener("input",E=>{A.setValue(F,{value:E.target.value})})}break;case"select":if(I.value!==null){y.setAttribute("value",I.value);for(const E of x.children)E.attributes.value===I.value?E.attributes.selected=!0:E.attributes.hasOwnProperty("selected")&&delete E.attributes.selected}y.addEventListener("input",E=>{const k=E.target.options,T=k.selectedIndex===-1?"":k[k.selectedIndex].value;A.setValue(F,{value:T})});break}}static setAttributes(y){let{html:F,element:x,storage:A=null,intent:p,linkService:I}=y;const{attributes:E}=x,k=F instanceof HTMLAnchorElement;E.type==="radio"&&(E.name=`${E.name}-${p}`);for(const[T,u]of Object.entries(E))if(u!=null)switch(T){case"class":u.length&&F.setAttribute(T,u.join(" "));break;case"dataId":break;case"id":F.setAttribute("data-element-id",u);break;case"style":Object.assign(F.style,u);break;case"textContent":F.textContent=u;break;default:(!k||T!=="href"&&T!=="newWindow")&&F.setAttribute(T,u)}k&&I.addLinkAttributes(F,E.href,E.newWindow),A&&E.dataId&&this.setupStorage(F,E.dataId,x,A)}static render(y){var u;const F=y.annotationStorage,x=y.linkService,A=y.xfaHtml,p=y.intent||"display",I=document.createElement(A.name);A.attributes&&this.setAttributes({html:I,element:A,intent:p,linkService:x});const E=[[A,-1,I]],k=y.div;if(k.append(I),y.viewport){const l=`matrix(${y.viewport.transform.join(",")})`;k.style.transform=l}p!=="richText"&&k.setAttribute("class","xfaLayer xfaFont");const T=[];for(;E.length>0;){const[l,f,v]=E.at(-1);if(f+1===l.children.length){E.pop();continue}const R=l.children[++E.at(-1)[1]];if(R===null)continue;const{name:M}=R;if(M==="#text"){const g=document.createTextNode(R.value);T.push(g),v.append(g);continue}const c=(u=R==null?void 0:R.attributes)!=null&&u.xmlns?document.createElementNS(R.attributes.xmlns,M):document.createElement(M);if(v.append(c),R.attributes&&this.setAttributes({html:c,element:R,storage:F,intent:p,linkService:x}),R.children&&R.children.length>0)E.push([R,-1,c]);else if(R.value){const g=document.createTextNode(R.value);e.XfaText.shouldBuildText(M)&&T.push(g),c.append(g)}}for(const l of k.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))l.setAttribute("readOnly",!0);return{textDivs:T}}static update(y){const F=`matrix(${y.viewport.transform.join(",")})`;y.div.style.transform=F,y.div.hidden=!1}}i.XfaLayer=n},(C,i,t)=>{var A,p,I,E,k,T,u,l,f,v,R,M,c,g,L,Xn,b,Yn,O,_n,K,Kn,_,vn,rt,Jn,it,bn,bt,Qn,H,Zn,m,jn,d,qn,D,tr,w,oe,q,yn,ut,De,mt,Le,Wt,pe,Nt,An,ht,Ne,dt,er,wt,Sn,Xt,nr,Vt,rr,Jt,En,Gt,Be,Z,ge;Object.defineProperty(i,"__esModule",{value:!0}),i.InkEditor=void 0,t(89),t(2);var e=t(1),n=t(164),o=t(198),y=t(168),F=t(165);const pt=class extends n.AnnotationEditor{constructor(z){super(Ce(me({},z),{name:"inkEditor"}));X(this,L);X(this,b);X(this,O);X(this,K);X(this,_);X(this,rt);X(this,it);X(this,bt);X(this,H);X(this,m);X(this,d);X(this,D);X(this,w);X(this,q);X(this,ut);X(this,mt);X(this,Wt);X(this,Nt);X(this,ht);X(this,Vt);X(this,Jt);X(this,Gt);X(this,Z);X(this,A,0);X(this,p,0);X(this,I,this.canvasPointermove.bind(this));X(this,E,this.canvasPointerleave.bind(this));X(this,k,this.canvasPointerup.bind(this));X(this,T,this.canvasPointerdown.bind(this));X(this,u,new Path2D);X(this,l,!1);X(this,f,!1);X(this,v,!1);X(this,R,null);X(this,M,0);X(this,c,0);X(this,g,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:pt._defaultThickness=gt;break;case e.AnnotationEditorParamsType.INK_COLOR:pt._defaultColor=gt;break;case e.AnnotationEditorParamsType.INK_OPACITY:pt._defaultOpacity=gt/100;break}}updateParams(z,gt){switch(z){case e.AnnotationEditorParamsType.INK_THICKNESS:j(this,L,Xn).call(this,gt);break;case e.AnnotationEditorParamsType.INK_COLOR:j(this,b,Yn).call(this,gt);break;case e.AnnotationEditorParamsType.INK_OPACITY:j(this,O,_n).call(this,gt);break}}static get defaultPropertiesToUpdate(){return[[e.AnnotationEditorParamsType.INK_THICKNESS,pt._defaultThickness],[e.AnnotationEditorParamsType.INK_COLOR,pt._defaultColor||n.AnnotationEditor._defaultLineColor],[e.AnnotationEditorParamsType.INK_OPACITY,Math.round(pt._defaultOpacity*100)]]}get propertiesToUpdate(){var z;return[[e.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||pt._defaultThickness],[e.AnnotationEditorParamsType.INK_COLOR,this.color||pt._defaultColor||n.AnnotationEditor._defaultLineColor],[e.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*((z=this.opacity)!=null?z:pt._defaultOpacity))]]}rebuild(){!this.parent||(super.rebuild(),this.div!==null&&(this.canvas||(j(this,ut,De).call(this),j(this,mt,Le).call(this)),this.isAttachedToDOM||(this.parent.add(this),j(this,Wt,pe).call(this)),j(this,Z,ge).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,R).disconnect(),at(this,R,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,l)||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",r(this,T)))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",r(this,T)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){r(this,l)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),at(this,l,!0),this.div.classList.add("disabled"),j(this,Z,ge).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,l)||(this.setInForeground(),z.preventDefault(),z.type!=="mouse"&&this.div.focus(),j(this,rt,Jn).call(this,z.offsetX,z.offsetY))}canvasPointermove(z){z.preventDefault(),j(this,it,bn).call(this,z.offsetX,z.offsetY)}canvasPointerup(z){z.preventDefault(),j(this,q,yn).call(this,z)}canvasPointerleave(z){j(this,q,yn).call(this,z)}get isResizable(){return!this.isEmpty()&&r(this,l)}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(zt=>{var Tt;return(Tt=this.div)==null?void 0:Tt.setAttribute("aria-label",zt)});const[xt,St,kt,vt]=j(this,K,Kn).call(this);if(this.setAt(xt,St,0,0),this.setDims(kt,vt),j(this,ut,De).call(this),this.width){const[zt,Tt]=this.parentDimensions;this.setAspectRatio(this.width*zt,this.height*Tt),this.setAt(z*zt,gt*Tt,this.width*zt,this.height*Tt),at(this,v,!0),j(this,Wt,pe).call(this),this.setDims(this.width*zt,this.height*Tt),j(this,w,oe).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return j(this,mt,Le).call(this),this.div}setDimensions(z,gt){const xt=Math.round(z),St=Math.round(gt);if(r(this,M)===xt&&r(this,c)===St)return;at(this,M,xt),at(this,c,St),this.canvas.style.visibility="hidden";const[kt,vt]=this.parentDimensions;this.width=z/kt,this.height=gt/vt,this.fixAndSetPosition(),r(this,l)&&j(this,Nt,An).call(this,z,gt),j(this,Wt,pe).call(this),j(this,w,oe).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(z,gt,xt){var Q,et,lt;if(z instanceof o.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[kt,vt]=St.pageDimensions,zt=St.width*kt,Tt=St.height*vt,Lt=St.parentScale,Dt=z.thickness/2;at(St,l,!0),at(St,M,Math.round(zt)),at(St,c,Math.round(Tt));const{paths:$,rect:a,rotation:B}=z;for(let{bezier:Ct}of $){Ct=j(Q=pt,Xt,nr).call(Q,Ct,a,B);const Ft=[];St.paths.push(Ft);let Mt=Lt*(Ct[0]-Dt),Qt=Lt*(Ct[1]-Dt);for(let Bt=2,_t=Ct.length;Bt<_t;Bt+=6){const Yt=Lt*(Ct[Bt]-Dt),qt=Lt*(Ct[Bt+1]-Dt),te=Lt*(Ct[Bt+2]-Dt),se=Lt*(Ct[Bt+3]-Dt),re=Lt*(Ct[Bt+4]-Dt),ie=Lt*(Ct[Bt+5]-Dt);Ft.push([[Mt,Qt],[Yt,qt],[te,se],[re,ie]]),Mt=re,Qt=ie}const Ut=j(this,dt,er).call(this,Ft);St.bezierPath2D.push(Ut)}const V=j(et=St,Jt,En).call(et);return at(St,p,Math.max(n.AnnotationEditor.MIN_SIZE,V[2]-V[0])),at(St,A,Math.max(n.AnnotationEditor.MIN_SIZE,V[3]-V[1])),j(lt=St,Nt,An).call(lt,zt,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,rr).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,z),pageIndex:this.pageIndex,rect:z,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};let x=pt;A=new WeakMap,p=new WeakMap,I=new WeakMap,E=new WeakMap,k=new WeakMap,T=new WeakMap,u=new WeakMap,l=new WeakMap,f=new WeakMap,v=new WeakMap,R=new WeakMap,M=new WeakMap,c=new WeakMap,g=new WeakMap,L=new WeakSet,Xn=function(z){const gt=this.thickness;this.addCommands({cmd:()=>{this.thickness=z,j(this,Z,ge).call(this)},undo:()=>{this.thickness=gt,j(this,Z,ge).call(this)},mustExec:!0,type:e.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},b=new WeakSet,Yn=function(z){const gt=this.color;this.addCommands({cmd:()=>{this.color=z,j(this,w,oe).call(this)},undo:()=>{this.color=gt,j(this,w,oe).call(this)},mustExec:!0,type:e.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},O=new WeakSet,_n=function(z){z/=100;const gt=this.opacity;this.addCommands({cmd:()=>{this.opacity=z,j(this,w,oe).call(this)},undo:()=>{this.opacity=gt,j(this,w,oe).call(this)},mustExec:!0,type:e.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},K=new WeakSet,Kn=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]}},_=new WeakSet,vn=function(){const{ctx:z,color:gt,opacity:xt,thickness:St,parentScale:kt,scaleFactor:vt}=this;z.lineWidth=St*kt/vt,z.lineCap="round",z.lineJoin="round",z.miterLimit=10,z.strokeStyle=`${gt}${(0,F.opacityToHex)(xt)}`},rt=new WeakSet,Jn=function(z,gt){var xt;this.canvas.addEventListener("contextmenu",y.noContextMenu),this.canvas.addEventListener("pointerleave",r(this,E)),this.canvas.addEventListener("pointermove",r(this,I)),this.canvas.addEventListener("pointerup",r(this,k)),this.canvas.removeEventListener("pointerdown",r(this,T)),this.isEditing=!0,r(this,v)||(at(this,v,!0),j(this,Wt,pe).call(this),this.thickness||(this.thickness=pt._defaultThickness),this.color||(this.color=pt._defaultColor||n.AnnotationEditor._defaultLineColor),(xt=this.opacity)!=null||(this.opacity=pt._defaultOpacity)),this.currentPath.push([z,gt]),at(this,f,!1),j(this,_,vn).call(this),at(this,g,()=>{j(this,m,jn).call(this),r(this,g)&&window.requestAnimationFrame(r(this,g))}),window.requestAnimationFrame(r(this,g))},it=new WeakSet,bn=function(z,gt){const[xt,St]=this.currentPath.at(-1);if(this.currentPath.length>1&&z===xt&&gt===St)return;const kt=this.currentPath;let vt=r(this,u);if(kt.push([z,gt]),at(this,f,!0),kt.length<=2){vt.moveTo(...kt[0]),vt.lineTo(z,gt);return}kt.length===3&&(at(this,u,vt=new Path2D),vt.moveTo(...kt[0])),j(this,d,qn).call(this,vt,...kt.at(-3),...kt.at(-2),z,gt)},bt=new WeakSet,Qn=function(){if(this.currentPath.length===0)return;const z=this.currentPath.at(-1);r(this,u).lineTo(...z)},H=new WeakSet,Zn=function(z,gt){at(this,g,null),z=Math.min(Math.max(z,0),this.canvas.width),gt=Math.min(Math.max(gt,0),this.canvas.height),j(this,it,bn).call(this,z,gt),j(this,bt,Qn).call(this);let xt;if(this.currentPath.length!==1)xt=j(this,D,tr).call(this);else{const Tt=[z,gt];xt=[[Tt,Tt.slice(),Tt.slice(),Tt]]}const St=r(this,u),kt=this.currentPath;this.currentPath=[],at(this,u,new Path2D);const vt=()=>{this.allRawPaths.push(kt),this.paths.push(xt),this.bezierPath2D.push(St),this.rebuild()},zt=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(j(this,ut,De).call(this),j(this,mt,Le).call(this)),j(this,Z,ge).call(this))};this.addCommands({cmd:vt,undo:zt,mustExec:!0})},m=new WeakSet,jn=function(){if(!r(this,f))return;at(this,f,!1);const z=Math.ceil(this.thickness*this.parentScale),gt=this.currentPath.slice(-3),xt=gt.map(vt=>vt[0]),St=gt.map(vt=>vt[1]);Math.min(...xt)-z,Math.max(...xt)+z,Math.min(...St)-z,Math.max(...St)+z;const{ctx:kt}=this;kt.save(),kt.clearRect(0,0,this.canvas.width,this.canvas.height);for(const vt of this.bezierPath2D)kt.stroke(vt);kt.stroke(r(this,u)),kt.restore()},d=new WeakSet,qn=function(z,gt,xt,St,kt,vt,zt){const Tt=(gt+St)/2,Lt=(xt+kt)/2,Dt=(St+vt)/2,$=(kt+zt)/2;z.bezierCurveTo(Tt+2*(St-Tt)/3,Lt+2*(kt-Lt)/3,Dt+2*(St-Dt)/3,$+2*(kt-$)/3,Dt,$)},D=new WeakSet,tr=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,kt]=z[0];for(xt=1;xt<z.length-2;xt++){const[a,B]=z[xt],[V,Q]=z[xt+1],et=(a+V)/2,lt=(B+Q)/2,Ct=[St+2*(a-St)/3,kt+2*(B-kt)/3],Ft=[et+2*(a-et)/3,lt+2*(B-lt)/3];gt.push([[St,kt],Ct,Ft,[et,lt]]),[St,kt]=[et,lt]}const[vt,zt]=z[xt],[Tt,Lt]=z[xt+1],Dt=[St+2*(vt-St)/3,kt+2*(zt-kt)/3],$=[Tt+2*(vt-Tt)/3,Lt+2*(zt-Lt)/3];return gt.push([[St,kt],Dt,$,[Tt,Lt]]),gt},w=new WeakSet,oe=function(){if(this.isEmpty()){j(this,ht,Ne).call(this);return}j(this,_,vn).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,ht,Ne).call(this);for(const xt of this.bezierPath2D)gt.stroke(xt)},q=new WeakSet,yn=function(z){this.canvas.removeEventListener("pointerleave",r(this,E)),this.canvas.removeEventListener("pointermove",r(this,I)),this.canvas.removeEventListener("pointerup",r(this,k)),this.canvas.addEventListener("pointerdown",r(this,T)),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",y.noContextMenu)},10),j(this,H,Zn).call(this,z.offsetX,z.offsetY),this.addToAnnotationStorage(),this.setInBackground()},ut=new WeakSet,De=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")},mt=new WeakSet,Le=function(){at(this,R,new ResizeObserver(z=>{const gt=z[0].contentRect;gt.width&&gt.height&&this.setDimensions(gt.width,gt.height)})),r(this,R).observe(this.div)},Wt=new WeakSet,pe=function(){if(!r(this,v))return;const[z,gt]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*z),this.canvas.height=Math.ceil(this.height*gt),j(this,ht,Ne).call(this)},Nt=new WeakSet,An=function(z,gt){const xt=j(this,Gt,Be).call(this),St=(z-xt)/r(this,p),kt=(gt-xt)/r(this,A);this.scaleFactor=Math.min(St,kt)},ht=new WeakSet,Ne=function(){const z=j(this,Gt,Be).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+z,this.translationY*this.scaleFactor+z)},dt=new WeakSet,er=function(z){const gt=new Path2D;for(let xt=0,St=z.length;xt<St;xt++){const[kt,vt,zt,Tt]=z[xt];xt===0&&gt.moveTo(...kt),gt.bezierCurveTo(vt[0],vt[1],zt[0],zt[1],Tt[0],Tt[1])}return gt},wt=new WeakSet,Sn=function(z,gt,xt){const[St,kt,vt,zt]=gt;switch(xt){case 0:for(let Tt=0,Lt=z.length;Tt<Lt;Tt+=2)z[Tt]+=St,z[Tt+1]=zt-z[Tt+1];break;case 90:for(let Tt=0,Lt=z.length;Tt<Lt;Tt+=2){const Dt=z[Tt];z[Tt]=z[Tt+1]+St,z[Tt+1]=Dt+kt}break;case 180:for(let Tt=0,Lt=z.length;Tt<Lt;Tt+=2)z[Tt]=vt-z[Tt],z[Tt+1]+=kt;break;case 270:for(let Tt=0,Lt=z.length;Tt<Lt;Tt+=2){const Dt=z[Tt];z[Tt]=vt-z[Tt+1],z[Tt+1]=zt-Dt}break;default:throw new Error("Invalid rotation")}return z},Xt=new WeakSet,nr=function(z,gt,xt){const[St,kt,vt,zt]=gt;switch(xt){case 0:for(let Tt=0,Lt=z.length;Tt<Lt;Tt+=2)z[Tt]-=St,z[Tt+1]=zt-z[Tt+1];break;case 90:for(let Tt=0,Lt=z.length;Tt<Lt;Tt+=2){const Dt=z[Tt];z[Tt]=z[Tt+1]-kt,z[Tt+1]=Dt-St}break;case 180:for(let Tt=0,Lt=z.length;Tt<Lt;Tt+=2)z[Tt]=vt-z[Tt],z[Tt+1]-=kt;break;case 270:for(let Tt=0,Lt=z.length;Tt<Lt;Tt+=2){const Dt=z[Tt];z[Tt]=zt-z[Tt+1],z[Tt+1]=vt-Dt}break;default:throw new Error("Invalid rotation")}return z},Vt=new WeakSet,rr=function(z,gt,xt,St){var Lt,Dt;const kt=[],vt=this.thickness/2,zt=z*gt+vt,Tt=z*xt+vt;for(const $ of this.paths){const a=[],B=[];for(let V=0,Q=$.length;V<Q;V++){const[et,lt,Ct,Ft]=$[V],Mt=z*et[0]+zt,Qt=z*et[1]+Tt,Ut=z*lt[0]+zt,Bt=z*lt[1]+Tt,_t=z*Ct[0]+zt,Yt=z*Ct[1]+Tt,qt=z*Ft[0]+zt,te=z*Ft[1]+Tt;V===0&&(a.push(Mt,Qt),B.push(Mt,Qt)),a.push(Ut,Bt,_t,Yt,qt,te),B.push(Ut,Bt),V===Q-1&&B.push(qt,te)}kt.push({bezier:j(Lt=pt,wt,Sn).call(Lt,a,St,this.rotation),points:j(Dt=pt,wt,Sn).call(Dt,B,St,this.rotation)})}return kt},Jt=new WeakSet,En=function(){let z=1/0,gt=-1/0,xt=1/0,St=-1/0;for(const kt of this.paths)for(const[vt,zt,Tt,Lt]of kt){const Dt=e.Util.bezierBoundingBox(...vt,...zt,...Tt,...Lt);z=Math.min(z,Dt[0]),xt=Math.min(xt,Dt[1]),gt=Math.max(gt,Dt[2]),St=Math.max(St,Dt[3])}return[z,xt,gt,St]},Gt=new WeakSet,Be=function(){return r(this,l)?Math.ceil(this.thickness*this.parentScale):0},Z=new WeakSet,ge=function(){let z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.isEmpty())return;if(!r(this,l)){j(this,w,oe).call(this);return}const gt=j(this,Jt,En).call(this),xt=j(this,Gt,Be).call(this);at(this,p,Math.max(n.AnnotationEditor.MIN_SIZE,gt[2]-gt[0])),at(this,A,Math.max(n.AnnotationEditor.MIN_SIZE,gt[3]-gt[1]));const St=Math.ceil(xt+r(this,p)*this.scaleFactor),kt=Math.ceil(xt+r(this,A)*this.scaleFactor),[vt,zt]=this.parentDimensions;this.width=St/vt,this.height=kt/zt,this.setAspectRatio(St,kt);const Tt=this.translationX,Lt=this.translationY;this.translationX=-gt[0],this.translationY=-gt[1],j(this,Wt,pe).call(this),j(this,w,oe).call(this),at(this,M,St),at(this,c,kt),this.setDims(St,kt);const Dt=z?xt/this.scaleFactor/2:0;this.translate(Tt-this.translationX-Dt,Lt-this.translationY-Dt)},X(x,dt),X(x,wt),X(x,Xt),ne(x,"_defaultColor",null),ne(x,"_defaultOpacity",1),ne(x,"_defaultThickness",1),ne(x,"_type","ink"),i.InkEditor=x},(C,i,t)=>{var x,A,p,I,E,k,T,u,l,f,v,xe,M,Te,g,Ue,P,xn,N,sr,G,ir,W,Tn,nt,We,Y,ar;Object.defineProperty(i,"__esModule",{value:!0}),i.StampEditor=void 0,t(149),t(152);var e=t(1),n=t(164),o=t(168),y=t(198);const ft=class extends n.AnnotationEditor{constructor(H){super(Ce(me({},H),{name:"stampEditor"}));X(this,v);X(this,M);X(this,g);X(this,P);X(this,N);X(this,G);X(this,W);X(this,nt);X(this,Y);X(this,x,null);X(this,A,null);X(this,p,null);X(this,I,null);X(this,E,null);X(this,k,null);X(this,T,null);X(this,u,null);X(this,l,!1);X(this,f,!1);at(this,I,H.bitmapUrl),at(this,E,H.bitmapFile)}static initialize(H){n.AnnotationEditor.initialize(H)}static get supportedTypes(){const H=["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"];return(0,e.shadow)(this,"supportedTypes",H.map(h=>`image/${h}`))}static get supportedTypesStr(){return(0,e.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(H){return this.supportedTypes.includes(H)}static paste(H,h){h.pasteEditor(e.AnnotationEditorType.STAMP,{bitmapFile:H.getAsFile()})}remove(){var H,h;r(this,A)&&(at(this,x,null),this._uiManager.imageManager.deleteId(r(this,A)),(H=r(this,k))==null||H.remove(),at(this,k,null),(h=r(this,T))==null||h.disconnect(),at(this,T,null)),super.remove()}rebuild(){if(!this.parent){r(this,A)&&j(this,g,Ue).call(this);return}super.rebuild(),this.div!==null&&(r(this,A)&&j(this,g,Ue).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(r(this,p)||r(this,x)||r(this,I)||r(this,E))}get isResizable(){return!0}render(){if(this.div)return this.div;let H,h;if(this.width&&(H=this.x,h=this.y),super.render(),this.div.hidden=!0,r(this,x)?j(this,P,xn).call(this):j(this,g,Ue).call(this),this.width){const[m,s]=this.parentDimensions;this.setAt(H*m,h*s,this.width*m,this.height*s)}return this.div}static deserialize(H,h,m){if(H instanceof y.StampAnnotationElement)return null;const s=super.deserialize(H,h,m),{rect:d,bitmapUrl:S,bitmapId:D,isSvg:U,accessibilityData:w}=H;D&&m.imageManager.isValidId(D)?at(s,A,D):at(s,I,S),at(s,l,U);const[tt,q]=s.pageDimensions;return s.width=(d[2]-d[0])/tt,s.height=(d[3]-d[1])/q,w&&(s.altTextData=w),s}serialize(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.isEmpty())return null;const m={annotationType:e.AnnotationEditorType.STAMP,bitmapId:r(this,A),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:r(this,l),structTreeParentId:this._structTreeParentId};if(H)return m.bitmapUrl=j(this,nt,We).call(this,!0),m.accessibilityData=this.altTextData,m;const{decorative:s,altText:d}=this.altTextData;if(!s&&d&&(m.accessibilityData={type:"Figure",alt:d}),h===null)return m;h.stamps||(h.stamps=new Map);const S=r(this,l)?(m.rect[2]-m.rect[0])*(m.rect[3]-m.rect[1]):null;if(!h.stamps.has(r(this,A)))h.stamps.set(r(this,A),{area:S,serialized:m}),m.bitmap=j(this,nt,We).call(this,!1);else if(r(this,l)){const D=h.stamps.get(r(this,A));S>D.area&&(D.area=S,D.serialized.bitmap.close(),D.serialized.bitmap=j(this,nt,We).call(this,!1))}return m}};let F=ft;x=new WeakMap,A=new WeakMap,p=new WeakMap,I=new WeakMap,E=new WeakMap,k=new WeakMap,T=new WeakMap,u=new WeakMap,l=new WeakMap,f=new WeakMap,v=new WeakSet,xe=function(H){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!H){this.remove();return}at(this,x,H.bitmap),h||(at(this,A,H.id),at(this,l,H.isSvg)),j(this,P,xn).call(this)},M=new WeakSet,Te=function(){at(this,p,null),this._uiManager.enableWaiting(!1),r(this,k)&&this.div.focus()},g=new WeakSet,Ue=function(){if(r(this,A)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(r(this,A)).then(h=>j(this,v,xe).call(this,h,!0)).finally(()=>j(this,M,Te).call(this));return}if(r(this,I)){const h=r(this,I);at(this,I,null),this._uiManager.enableWaiting(!0),at(this,p,this._uiManager.imageManager.getFromUrl(h).then(m=>j(this,v,xe).call(this,m)).finally(()=>j(this,M,Te).call(this)));return}if(r(this,E)){const h=r(this,E);at(this,E,null),this._uiManager.enableWaiting(!0),at(this,p,this._uiManager.imageManager.getFromFile(h).then(m=>j(this,v,xe).call(this,m)).finally(()=>j(this,M,Te).call(this)));return}const H=document.createElement("input");H.type="file",H.accept=ft.supportedTypesStr,at(this,p,new Promise(h=>{H.addEventListener("change",()=>ee(this,null,function*(){if(!H.files||H.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const m=yield this._uiManager.imageManager.getFromFile(H.files[0]);j(this,v,xe).call(this,m)}h()})),H.addEventListener("cancel",()=>{this.remove(),h()})}).finally(()=>j(this,M,Te).call(this))),H.click()},P=new WeakSet,xn=function(){const{div:H}=this;let{width:h,height:m}=r(this,x);const[s,d]=this.pageDimensions,S=.75;if(this.width)h=this.width*s,m=this.height*d;else if(h>S*s||m>S*d){const tt=Math.min(S*s/h,S*d/m);h*=tt,m*=tt}const[D,U]=this.parentDimensions;this.setDims(h*D/s,m*U/d),this._uiManager.enableWaiting(!1);const w=at(this,k,document.createElement("canvas"));H.append(w),H.hidden=!1,j(this,W,Tn).call(this,h,m),j(this,Y,ar).call(this),r(this,f)||(this.parent.addUndoableEditor(this),at(this,f,!0)),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()},N=new WeakSet,sr=function(H,h){var S;const[m,s]=this.parentDimensions;this.width=H/m,this.height=h/s,this.setDims(H,h),(S=this._initialOptions)!=null&&S.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,r(this,u)!==null&&clearTimeout(r(this,u)),at(this,u,setTimeout(()=>{at(this,u,null),j(this,W,Tn).call(this,H,h)},200))},G=new WeakSet,ir=function(H,h){const{width:m,height:s}=r(this,x);let d=m,S=s,D=r(this,x);for(;d>2*H||S>2*h;){const U=d,w=S;d>2*H&&(d=d>=16384?Math.floor(d/2)-1:Math.ceil(d/2)),S>2*h&&(S=S>=16384?Math.floor(S/2)-1:Math.ceil(S/2));const tt=new OffscreenCanvas(d,S);tt.getContext("2d").drawImage(D,0,0,U,w,0,0,d,S),D=tt.transferToImageBitmap()}return D},W=new WeakSet,Tn=function(H,h){H=Math.ceil(H),h=Math.ceil(h);const m=r(this,k);if(!m||m.width===H&&m.height===h)return;m.width=H,m.height=h;const s=r(this,l)?r(this,x):j(this,G,ir).call(this,H,h),d=m.getContext("2d");d.filter=this._uiManager.hcmFilter,d.drawImage(s,0,0,s.width,s.height,0,0,H,h)},nt=new WeakSet,We=function(H){if(H){if(r(this,l)){const s=this._uiManager.imageManager.getSvgUrl(r(this,A));if(s)return s}const h=document.createElement("canvas");return{width:h.width,height:h.height}=r(this,x),h.getContext("2d").drawImage(r(this,x),0,0),h.toDataURL()}if(r(this,l)){const[h,m]=this.pageDimensions,s=Math.round(this.width*h*o.PixelsPerInch.PDF_TO_CSS_UNITS),d=Math.round(this.height*m*o.PixelsPerInch.PDF_TO_CSS_UNITS),S=new OffscreenCanvas(s,d);return S.getContext("2d").drawImage(r(this,x),0,0,r(this,x).width,r(this,x).height,0,0,s,d),S.transferToImageBitmap()}return structuredClone(r(this,x))},Y=new WeakSet,ar=function(){at(this,T,new ResizeObserver(H=>{const h=H[0].contentRect;h.width&&h.height&&j(this,N,sr).call(this,h.width,h.height)})),r(this,T).observe(this.div)},ne(F,"_type","stamp"),i.StampEditor=F}],__webpack_module_cache__={};function __w_pdfjs_require__(C){var i=__webpack_module_cache__[C];if(i!==void 0)return i.exports;var t=__webpack_module_cache__[C]={exports:{}};return __webpack_modules__[C].call(t.exports,t,t.exports,__w_pdfjs_require__),t.exports}var __webpack_exports__={};return(()=>{var C=__webpack_exports__;Object.defineProperty(C,"__esModule",{value:!0}),Object.defineProperty(C,"AbortException",{enumerable:!0,get:function(){return i.AbortException}}),Object.defineProperty(C,"AnnotationEditorLayer",{enumerable:!0,get:function(){return o.AnnotationEditorLayer}}),Object.defineProperty(C,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return i.AnnotationEditorParamsType}}),Object.defineProperty(C,"AnnotationEditorType",{enumerable:!0,get:function(){return i.AnnotationEditorType}}),Object.defineProperty(C,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return y.AnnotationEditorUIManager}}),Object.defineProperty(C,"AnnotationLayer",{enumerable:!0,get:function(){return F.AnnotationLayer}}),Object.defineProperty(C,"AnnotationMode",{enumerable:!0,get:function(){return i.AnnotationMode}}),Object.defineProperty(C,"CMapCompressionType",{enumerable:!0,get:function(){return i.CMapCompressionType}}),Object.defineProperty(C,"DOMSVGFactory",{enumerable:!0,get:function(){return e.DOMSVGFactory}}),Object.defineProperty(C,"FeatureTest",{enumerable:!0,get:function(){return i.FeatureTest}}),Object.defineProperty(C,"GlobalWorkerOptions",{enumerable:!0,get:function(){return x.GlobalWorkerOptions}}),Object.defineProperty(C,"ImageKind",{enumerable:!0,get:function(){return i.ImageKind}}),Object.defineProperty(C,"InvalidPDFException",{enumerable:!0,get:function(){return i.InvalidPDFException}}),Object.defineProperty(C,"MissingPDFException",{enumerable:!0,get:function(){return i.MissingPDFException}}),Object.defineProperty(C,"OPS",{enumerable:!0,get:function(){return i.OPS}}),Object.defineProperty(C,"PDFDataRangeTransport",{enumerable:!0,get:function(){return t.PDFDataRangeTransport}}),Object.defineProperty(C,"PDFDateString",{enumerable:!0,get:function(){return e.PDFDateString}}),Object.defineProperty(C,"PDFWorker",{enumerable:!0,get:function(){return t.PDFWorker}}),Object.defineProperty(C,"PasswordResponses",{enumerable:!0,get:function(){return i.PasswordResponses}}),Object.defineProperty(C,"PermissionFlag",{enumerable:!0,get:function(){return i.PermissionFlag}}),Object.defineProperty(C,"PixelsPerInch",{enumerable:!0,get:function(){return e.PixelsPerInch}}),Object.defineProperty(C,"PromiseCapability",{enumerable:!0,get:function(){return i.PromiseCapability}}),Object.defineProperty(C,"RenderingCancelledException",{enumerable:!0,get:function(){return e.RenderingCancelledException}}),Object.defineProperty(C,"SVGGraphics",{enumerable:!0,get:function(){return t.SVGGraphics}}),Object.defineProperty(C,"UnexpectedResponseException",{enumerable:!0,get:function(){return i.UnexpectedResponseException}}),Object.defineProperty(C,"Util",{enumerable:!0,get:function(){return i.Util}}),Object.defineProperty(C,"VerbosityLevel",{enumerable:!0,get:function(){return i.VerbosityLevel}}),Object.defineProperty(C,"XfaLayer",{enumerable:!0,get:function(){return A.XfaLayer}}),Object.defineProperty(C,"build",{enumerable:!0,get:function(){return t.build}}),Object.defineProperty(C,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return i.createValidAbsoluteUrl}}),Object.defineProperty(C,"getDocument",{enumerable:!0,get:function(){return t.getDocument}}),Object.defineProperty(C,"getFilenameFromUrl",{enumerable:!0,get:function(){return e.getFilenameFromUrl}}),Object.defineProperty(C,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return e.getPdfFilenameFromUrl}}),Object.defineProperty(C,"getXfaPageViewport",{enumerable:!0,get:function(){return e.getXfaPageViewport}}),Object.defineProperty(C,"isDataScheme",{enumerable:!0,get:function(){return e.isDataScheme}}),Object.defineProperty(C,"isPdfFile",{enumerable:!0,get:function(){return e.isPdfFile}}),Object.defineProperty(C,"loadScript",{enumerable:!0,get:function(){return e.loadScript}}),Object.defineProperty(C,"noContextMenu",{enumerable:!0,get:function(){return e.noContextMenu}}),Object.defineProperty(C,"normalizeUnicode",{enumerable:!0,get:function(){return i.normalizeUnicode}}),Object.defineProperty(C,"renderTextLayer",{enumerable:!0,get:function(){return n.renderTextLayer}}),Object.defineProperty(C,"setLayerDimensions",{enumerable:!0,get:function(){return e.setLayerDimensions}}),Object.defineProperty(C,"shadow",{enumerable:!0,get:function(){return i.shadow}}),Object.defineProperty(C,"updateTextLayer",{enumerable:!0,get:function(){return n.updateTextLayer}}),Object.defineProperty(C,"version",{enumerable:!0,get:function(){return t.version}});var i=__w_pdfjs_require__(1),t=__w_pdfjs_require__(124),e=__w_pdfjs_require__(168),n=__w_pdfjs_require__(195),o=__w_pdfjs_require__(196),y=__w_pdfjs_require__(165),F=__w_pdfjs_require__(198),x=__w_pdfjs_require__(176),A=__w_pdfjs_require__(201)})(),__webpack_exports__})())})(pdf);const SEAL="/assets/seal.2b0b8e60.png";export{SEAL as S,pdf as p};