github.com/minio/console@v1.3.0/web-app/build/static/js/8144.0cc85475.chunk.js (about) 1 /*! For license information please see 8144.0cc85475.chunk.js.LICENSE.txt */ 2 (self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[8144],{18628:(t,e)=>{"use strict";e.A=function(t,e){if(t&&e){var s=Array.isArray(e)?e:e.split(","),i=t.name||"",n=(t.type||"").toLowerCase(),a=n.replace(/\/.*$/,"");return s.some((function(t){var e=t.trim().toLowerCase();return"."===e.charAt(0)?i.toLowerCase().endsWith(e):e.endsWith("/*")?a===e.replace(/\/.*$/,""):n===e}))}return!0}},75270:(t,e,s)=>{"use strict";var i=s(40139),n={"text/plain":"Text","text/html":"Url",default:"Text"};t.exports=function(t,e){var s,a,r,o,l,c,d=!1;e||(e={}),s=e.debug||!1;try{if(r=i(),o=document.createRange(),l=document.getSelection(),(c=document.createElement("span")).textContent=t,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",(function(i){if(i.stopPropagation(),e.format)if(i.preventDefault(),"undefined"===typeof i.clipboardData){s&&console.warn("unable to use e.clipboardData"),s&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var a=n[e.format]||n.default;window.clipboardData.setData(a,t)}else i.clipboardData.clearData(),i.clipboardData.setData(e.format,t);e.onCopy&&(i.preventDefault(),e.onCopy(i.clipboardData))})),document.body.appendChild(c),o.selectNodeContents(c),l.addRange(o),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");d=!0}catch(h){s&&console.error("unable to copy using execCommand: ",h),s&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),d=!0}catch(h){s&&console.error("unable to copy using clipboardData: ",h),s&&console.error("falling back to prompt"),a=function(t){var e=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return t.replace(/#{\s*key\s*}/g,e)}("message"in e?e.message:"Copy to clipboard: #{key}, Enter"),window.prompt(a,t)}}finally{l&&("function"==typeof l.removeRange?l.removeRange(o):l.removeAllRanges()),c&&document.body.removeChild(c),r()}return d}},46749:(module,__unused_webpack_exports,__webpack_require__)=>{var _classPrivateGetter=__webpack_require__(183).default,_defineProperty=__webpack_require__(43693).default,_classPrivateMethodInitSpec=__webpack_require__(93312).default,_assertClassBrand=__webpack_require__(81756).default,_classPrivateFieldInitSpec=__webpack_require__(42459).default,_classPrivateFieldGet=__webpack_require__(16668).default,_classPrivateFieldSet=__webpack_require__(37088).default,root,factory;root=globalThis,factory=()=>(()=>{"use strict";var __webpack_modules__=[,(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VerbosityLevel=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.TextRenderingMode=e.RenderingIntentFlag=e.PromiseCapability=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.PageActionEventType=e.OPS=e.MissingPDFException=e.MAX_IMAGE_SIZE_TO_CACHE=e.LINE_FACTOR=e.LINE_DESCENT_FACTOR=e.InvalidPDFException=e.ImageKind=e.IDENTITY_MATRIX=e.FormatError=e.FeatureTest=e.FONT_IDENTITY_MATRIX=e.DocumentActionEventType=e.CMapCompressionType=e.BaseException=e.BASELINE_FACTOR=e.AnnotationType=e.AnnotationReplyType=e.AnnotationPrefix=e.AnnotationMode=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationEditorType=e.AnnotationEditorPrefix=e.AnnotationEditorParamsType=e.AnnotationBorderStyleType=e.AnnotationActionEventType=e.AbortException=void 0,e.assert=function(t,e){t||o(e)},e.bytesToString=d,e.createValidAbsoluteUrl=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(s&&"string"===typeof t){if(s.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);(null===e||void 0===e?void 0:e.length)>=2&&(t="http://".concat(t))}if(s.tryConvertEncoding)try{t=f(t)}catch{}}const i=e?new URL(t,e):new URL(t);if(function(t){switch(null===t||void 0===t?void 0:t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(i))return i}catch{}return null},e.getModificationDate=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")].join("")},e.getUuid=function(){var t,e;if("undefined"!==typeof crypto&&"function"===typeof(null===(t=crypto)||void 0===t?void 0:t.randomUUID))return crypto.randomUUID();const s=new Uint8Array(32);if("undefined"!==typeof crypto&&"function"===typeof(null===(e=crypto)||void 0===e?void 0:e.getRandomValues))crypto.getRandomValues(s);else for(let i=0;i<32;i++)s[i]=Math.floor(255*Math.random());return d(s)},e.getVerbosityLevel=function(){return a},e.info=function(t){a>=n.INFOS&&console.log("Info: ".concat(t))},e.isArrayBuffer=function(t){return"object"===typeof t&&void 0!==(null===t||void 0===t?void 0:t.byteLength)},e.isArrayEqual=function(t,e){if(t.length!==e.length)return!1;for(let s=0,i=t.length;s<i;s++)if(t[s]!==e[s])return!1;return!0},e.isNodeJS=void 0,e.normalizeUnicode=function(t){return v||(v=/([\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,_=new Map([["\ufb05","\u017ft"]])),t.replaceAll(v,((t,e,s)=>e?e.normalize("NFKC"):_.get(s)))},e.objectFromMap=function(t){const e=Object.create(null);for(const[s,i]of t)e[s]=i;return e},e.objectSize=function(t){return Object.keys(t).length},e.setVerbosityLevel=function(t){Number.isInteger(t)&&(a=t)},e.shadow=l,e.string32=function(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)},e.stringToBytes=h,e.stringToPDFString=function(t){if(t[0]>="\xef"){let e;if("\xfe"===t[0]&&"\xff"===t[1]?e="utf-16be":"\xff"===t[0]&&"\xfe"===t[1]?e="utf-16le":"\xef"===t[0]&&"\xbb"===t[1]&&"\xbf"===t[2]&&(e="utf-8"),e)try{const s=new TextDecoder(e,{fatal:!0}),i=h(t);return s.decode(i)}catch(s){r('stringToPDFString: "'.concat(s,'".'))}}const e=[];for(let i=0,n=t.length;i<n;i++){const s=p[t.charCodeAt(i)];e.push(s?String.fromCharCode(s):t.charAt(i))}return e.join("")},e.stringToUTF8String=f,e.unreachable=o,e.utf8StringToString=function(t){return unescape(encodeURIComponent(t))},e.warn=r;const s="object"===typeof process&&process+""==="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type);e.isNodeJS=s,e.IDENTITY_MATRIX=[1,0,0,1,0,0],e.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],e.MAX_IMAGE_SIZE_TO_CACHE=1e7,e.LINE_FACTOR=1.35,e.LINE_DESCENT_FACTOR=.35;const i=.35/1.35;e.BASELINE_FACTOR=i,e.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},e.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},e.AnnotationEditorPrefix="pdfjs_internal_editor_",e.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15},e.AnnotationEditorParamsType={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23},e.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},e.TextRenderingMode={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},e.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},e.AnnotationType={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},e.AnnotationReplyType={GROUP:"Group",REPLY:"R"},e.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512},e.AnnotationFieldFlag={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},e.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},e.AnnotationActionEventType={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"},e.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},e.PageActionEventType={O:"PageOpen",C:"PageClose"};const n={ERRORS:0,WARNINGS:1,INFOS:5};e.VerbosityLevel=n,e.CMapCompressionType={NONE:0,BINARY:1},e.OPS={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},e.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let a=n.WARNINGS;function r(t){a>=n.WARNINGS&&console.log("Warning: ".concat(t))}function o(t){throw new Error(t)}function l(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Object.defineProperty(t,e,{value:s,enumerable:!i,configurable:!0,writable:!1}),s}const c=function(){function t(e,s){this.constructor===t&&o("Cannot initialize BaseException."),this.message=e,this.name=s}return t.prototype=new Error,t.constructor=t,t}();function d(t){"object"===typeof t&&void 0!==(null===t||void 0===t?void 0:t.length)||o("Invalid argument for bytesToString");const e=t.length,s=8192;if(e<s)return String.fromCharCode.apply(null,t);const i=[];for(let n=0;n<e;n+=s){const a=Math.min(n+s,e),r=t.subarray(n,a);i.push(String.fromCharCode.apply(null,r))}return i.join("")}function h(t){"string"!==typeof t&&o("Invalid argument for stringToBytes");const e=t.length,s=new Uint8Array(e);for(let i=0;i<e;++i)s[i]=255&t.charCodeAt(i);return s}e.BaseException=c,e.PasswordException=class extends c{constructor(t,e){super(t,"PasswordException"),this.code=e}},e.UnknownErrorException=class extends c{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}},e.InvalidPDFException=class extends c{constructor(t){super(t,"InvalidPDFException")}},e.MissingPDFException=class extends c{constructor(t){super(t,"MissingPDFException")}},e.UnexpectedResponseException=class extends c{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}},e.FormatError=class extends c{constructor(t){super(t,"FormatError")}},e.AbortException=class extends c{constructor(t){super(t,"AbortException")}},e.FeatureTest=class{static get isLittleEndian(){return l(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return l(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return l(this,"isOffscreenCanvasSupported","undefined"!==typeof OffscreenCanvas)}static get platform(){return"undefined"===typeof navigator?l(this,"platform",{isWin:!1,isMac:!1}):l(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var t,e;return l(this,"isCSSRoundSupported",null===(t=globalThis.CSS)||void 0===t||null===(e=t.supports)||void 0===e?void 0:e.call(t,"width: round(1.5px, 1px)"))}};const u=[...Array(256).keys()].map((t=>t.toString(16).padStart(2,"0")));e.Util=class{static makeHexColor(t,e,s){return"#".concat(u[t]).concat(u[e]).concat(u[s])}static scaleMinMax(t,e){let s;t[0]?(t[0]<0&&(s=e[0],e[0]=e[1],e[1]=s),e[0]*=t[0],e[1]*=t[0],t[3]<0&&(s=e[2],e[2]=e[3],e[3]=s),e[2]*=t[3],e[3]*=t[3]):(s=e[0],e[0]=e[2],e[2]=s,s=e[1],e[1]=e[3],e[3]=s,t[1]<0&&(s=e[2],e[2]=e[3],e[3]=s),e[2]*=t[1],e[3]*=t[1],t[2]<0&&(s=e[0],e[0]=e[1],e[1]=s),e[0]*=t[2],e[1]*=t[2]),e[0]+=t[4],e[1]+=t[4],e[2]+=t[5],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}static applyInverseTransform(t,e){const s=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/s,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/s]}static getAxialAlignedBoundingBox(t,e){const s=this.applyTransform(t,e),i=this.applyTransform(t.slice(2,4),e),n=this.applyTransform([t[0],t[3]],e),a=this.applyTransform([t[2],t[1]],e);return[Math.min(s[0],i[0],n[0],a[0]),Math.min(s[1],i[1],n[1],a[1]),Math.max(s[0],i[0],n[0],a[0]),Math.max(s[1],i[1],n[1],a[1])]}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t){const e=[t[0],t[2],t[1],t[3]],s=t[0]*e[0]+t[1]*e[2],i=t[0]*e[1]+t[1]*e[3],n=t[2]*e[0]+t[3]*e[2],a=t[2]*e[1]+t[3]*e[3],r=(s+a)/2,o=Math.sqrt((s+a)**2-4*(s*a-n*i))/2,l=r+o||1,c=r-o||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const s=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),i=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(s>i)return null;const n=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),a=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return n>a?null:[s,n,i,a]}static bezierBoundingBox(t,e,s,i,n,a,r,o){const l=[],c=[[],[]];let d,h,u,p,f,g,v,_;for(let P=0;P<2;++P)if(0===P?(h=6*t-12*s+6*n,d=-3*t+9*s-9*n+3*r,u=3*s-3*t):(h=6*e-12*i+6*a,d=-3*e+9*i-9*a+3*o,u=3*i-3*e),Math.abs(d)<1e-12){if(Math.abs(h)<1e-12)continue;p=-u/h,0<p&&p<1&&l.push(p)}else v=h*h-4*u*d,_=Math.sqrt(v),v<0||(f=(-h+_)/(2*d),0<f&&f<1&&l.push(f),g=(-h-_)/(2*d),0<g&&g<1&&l.push(g));let m,b=l.length;const y=b;for(;b--;)p=l[b],m=1-p,c[0][b]=m*m*m*t+3*m*m*p*s+3*m*p*p*n+p*p*p*r,c[1][b]=m*m*m*e+3*m*m*p*i+3*m*p*p*a+p*p*p*o;return c[0][y]=t,c[1][y]=e,c[0][y+1]=r,c[1][y+1]=o,c[0].length=c[1].length=y+2,[Math.min(...c[0]),Math.min(...c[1]),Math.max(...c[0]),Math.max(...c[1])]}};const p=[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 f(t){return decodeURIComponent(escape(t))}var g=new WeakMap;e.PromiseCapability=class{constructor(){_classPrivateFieldInitSpec(this,g,!1),this.promise=new Promise(((t,e)=>{this.resolve=e=>{_classPrivateFieldSet(g,this,!0),t(e)},this.reject=t=>{_classPrivateFieldSet(g,this,!0),e(t)}}))}get settled(){return _classPrivateFieldGet(g,this)}};let v=null,_=null;e.AnnotationPrefix="pdfjs_internal_id_"},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;function getDocument(t){var e,s;if("string"===typeof t||t instanceof URL?t={url:t}:(0,_util.isArrayBuffer)(t)&&(t={data:t}),"object"!==typeof t)throw new Error("Invalid parameter in getDocument, need parameter object.");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const i=new PDFDocumentLoadingTask,{docId:n}=i,a=t.url?getUrlProp(t.url):null,r=t.data?getDataProp(t.data):null,o=t.httpHeaders||null,l=!0===t.withCredentials,c=null!==(e=t.password)&&void 0!==e?e:null,d=t.range instanceof PDFDataRangeTransport?t.range:null,h=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let u=t.worker instanceof PDFWorker?t.worker:null;const p=t.verbosity,f="string"!==typeof t.docBaseUrl||(0,_display_utils.isDataScheme)(t.docBaseUrl)?null:t.docBaseUrl,g="string"===typeof t.cMapUrl?t.cMapUrl:null,v=!1!==t.cMapPacked,_=t.CMapReaderFactory||DefaultCMapReaderFactory,m="string"===typeof t.standardFontDataUrl?t.standardFontDataUrl:null,b=t.StandardFontDataFactory||DefaultStandardFontDataFactory,y=!0!==t.stopAtErrors,P=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,A=!1!==t.isEvalSupported,S="boolean"===typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!_util.isNodeJS,F=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,w="boolean"===typeof t.disableFontFace?t.disableFontFace:_util.isNodeJS,x=!0===t.fontExtraProperties,C=!0===t.enableXfa,E=t.ownerDocument||globalThis.document,k=!0===t.disableRange,T=!0===t.disableStream,M=!0===t.disableAutoFetch,R=!0===t.pdfBug,I=d?d.length:null!==(s=t.length)&&void 0!==s?s:NaN,D="boolean"===typeof t.useSystemFonts?t.useSystemFonts:!_util.isNodeJS&&!w,O="boolean"===typeof t.useWorkerFetch?t.useWorkerFetch:_===_display_utils.DOMCMapReaderFactory&&b===_display_utils.DOMStandardFontDataFactory&&g&&m&&(0,_display_utils.isValidFetchUrl)(g,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(m,document.baseURI),L=t.canvasFactory||new DefaultCanvasFactory({ownerDocument:E}),G=t.filterFactory||new DefaultFilterFactory({docId:n,ownerDocument:E});(0,_util.setVerbosityLevel)(p);const N={canvasFactory:L,filterFactory:G};if(O||(N.cMapReaderFactory=new _({baseUrl:g,isCompressed:v}),N.standardFontDataFactory=new b({baseUrl:m})),!u){const t={verbosity:p,port:_worker_options.GlobalWorkerOptions.workerPort};u=t.port?PDFWorker.fromPort(t):new PDFWorker(t),i._worker=u}const B={docId:n,apiVersion:"3.11.174",data:r,password:c,disableAutoFetch:M,rangeChunkSize:h,length:I,docBaseUrl:f,enableXfa:C,evaluatorOptions:{maxImageSize:P,disableFontFace:w,ignoreErrors:y,isEvalSupported:A,isOffscreenCanvasSupported:S,canvasMaxAreaInBytes:F,fontExtraProperties:x,useSystemFonts:D,cMapUrl:O?g:null,standardFontDataUrl:O?m:null}},j={ignoreErrors:y,isEvalSupported:A,disableFontFace:w,fontExtraProperties:x,enableXfa:C,ownerDocument:E,disableAutoFetch:M,pdfBug:R,styleElement:null};return u.promise.then((function(){if(i.destroyed)throw new Error("Loading aborted");const t=_fetchDocument(u,B),e=new Promise((function(t){let e;var s;d?e=new _transport_stream.PDFDataTransportStream({length:I,initialData:d.initialData,progressiveDone:d.progressiveDone,contentDispositionFilename:d.contentDispositionFilename,disableRange:k,disableStream:T},d):r||(s={url:a,length:I,httpHeaders:o,withCredentials:l,rangeChunkSize:h,disableRange:k,disableStream:T},e=_util.isNodeJS?new _displayNode_stream.PDFNodeStream(s):(0,_display_utils.isValidFetchUrl)(s.url)?new _displayFetch_stream.PDFFetchStream(s):new _displayNetwork.PDFNetworkStream(s)),t(e)}));return Promise.all([t,e]).then((function(t){let[e,s]=t;if(i.destroyed)throw new Error("Loading aborted");const a=new _message_handler.MessageHandler(n,e,u.port),r=new WorkerTransport(a,i,s,j,N);i._transport=r,a.send("Ready",null)}))})).catch(i._capability.reject),i}async function _fetchDocument(t,e){if(t.destroyed)throw new Error("Worker was destroyed");const s=await t.messageHandler.sendWithPromise("GetDocRequest",e,e.data?[e.data.buffer]:null);if(t.destroyed)throw new Error("Worker was destroyed");return s}function getUrlProp(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(_util.isNodeJS&&"string"===typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(t){if(_util.isNodeJS&&"undefined"!==typeof Buffer&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"===typeof t)return(0,_util.stringToBytes)(t);if("object"===typeof t&&!isNaN(null===t||void 0===t?void 0:t.length)||(0,_util.isArrayBuffer)(t))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;class PDFDocumentLoadingTask{constructor(){var t,e;this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId="d".concat((_docId._=(t=_docId._,e=t++,t),e)),this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{var t,e;null!==(t=this._worker)&&void 0!==t&&t.port&&(this._worker._pendingDestroy=!0),await(null===(e=this._transport)||void 0===e?void 0:e.destroy())}catch(i){var s;throw null!==(s=this._worker)&&void 0!==s&&s.port&&delete this._worker._pendingDestroy,i}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}var _docId={_:0};exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(t,e){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.length=t,this.initialData=e,this.progressiveDone=s,this.contentDispositionFilename=i,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(const s of this._rangeListeners)s(t,e)}onDataProgress(t,e){this._readyCapability.promise.then((()=>{for(const s of this._progressListeners)s(t,e)}))}onDataProgressiveRead(t){this._readyCapability.promise.then((()=>{for(const e of this._progressiveReadListeners)e(t)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const t of this._progressiveDoneListeners)t()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(t,e){this._pdfInfo=t,this._transport=e,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then((t=>{if(!t)return t;const e=[];for(const s in t)e.push(...t[s]);return e})))})}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(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}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 t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(t||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;var _delayedCleanupTimeout=new WeakMap,_pendingCleanup=new WeakMap,_PDFPageProxy_brand=new WeakSet;class PDFPageProxy{constructor(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];_classPrivateMethodInitSpec(this,_PDFPageProxy_brand),_classPrivateFieldInitSpec(this,_delayedCleanupTimeout,null),_classPrivateFieldInitSpec(this,_pendingCleanup,!1),this._pageIndex=t,this._pageInfo=e,this._transport=s,this._stats=i?new _display_utils.StatTimer:null,this._pdfBug=i,this.commonObjs=s.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:t,rotation:e=this.rotate,offsetX:s=0,offsetY:i=0,dontFlip:n=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:t,rotation:e,offsetX:s,offsetY:i,dontFlip:n})}getAnnotations(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var t;return(null===(t=this._transport._htmlForXfa)||void 0===t?void 0:t.children[this._pageIndex])||null}render(t){var e,s;let{canvasContext:i,viewport:n,intent:a="display",annotationMode:r=_util.AnnotationMode.ENABLE,transform:o=null,background:l=null,optionalContentConfigPromise:c=null,annotationCanvasMap:d=null,pageColors:h=null,printAnnotationStorage:u=null}=t;null===(e=this._stats)||void 0===e||e.time("Overall");const p=this._transport.getRenderingIntent(a,r,u);_classPrivateFieldSet(_pendingCleanup,this,!1),_assertClassBrand(_PDFPageProxy_brand,this,_abortDelayedCleanup).call(this),c||(c=this._transport.getOptionalContentConfig());let f=this._intentStates.get(p.cacheKey);f||(f=Object.create(null),this._intentStates.set(p.cacheKey,f)),f.streamReaderCancelTimeout&&(clearTimeout(f.streamReaderCancelTimeout),f.streamReaderCancelTimeout=null);const g=!!(p.renderingIntent&_util.RenderingIntentFlag.PRINT);var v;f.displayReadyCapability||(f.displayReadyCapability=new _util.PromiseCapability,f.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(v=this._stats)||void 0===v||v.time("Page Request"),this._pumpOperatorList(p));const _=t=>{var e,s;f.renderTasks.delete(m),(this._maybeCleanupAfterRender||g)&&_classPrivateFieldSet(_pendingCleanup,this,!0),_assertClassBrand(_PDFPageProxy_brand,this,_tryCleanup).call(this,!g),t?(m.capability.reject(t),this._abortOperatorList({intentState:f,reason:t instanceof Error?t:new Error(t)})):m.capability.resolve(),null===(e=this._stats)||void 0===e||e.timeEnd("Rendering"),null===(s=this._stats)||void 0===s||s.timeEnd("Overall")},m=new InternalRenderTask({callback:_,params:{canvasContext:i,viewport:n,transform:o,background:l},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:d,operatorList:f.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!g,pdfBug:this._pdfBug,pageColors:h});((s=f).renderTasks||(s.renderTasks=new Set)).add(m);const b=m.task;return Promise.all([f.displayReadyCapability.promise,c]).then((t=>{var e;let[s,i]=t;this.destroyed?_():(null===(e=this._stats)||void 0===e||e.time("Rendering"),m.initializeGraphics({transparency:s,optionalContentConfig:i}),m.operatorListChanged())})).catch(_),b}getOperatorList(){let{intent:t="display",annotationMode:e=_util.AnnotationMode.ENABLE,printAnnotationStorage:s=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=this._transport.getRenderingIntent(t,e,s,!0);let n,a=this._intentStates.get(i.cacheKey);var r,o;return a||(a=Object.create(null),this._intentStates.set(i.cacheKey,a)),a.opListReadCapability||(n=Object.create(null),n.operatorListChanged=function(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(n))},a.opListReadCapability=new _util.PromiseCapability,((r=a).renderTasks||(r.renderTasks=new Set)).add(n),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(o=this._stats)||void 0===o||o.time("Page Request"),this._pumpOperatorList(i)),a.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:t=!1,disableNormalization:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then((t=>_xfa_text.XfaText.textContent(t)));const e=this.streamTextContent(t);return new Promise((function(t,s){const i=e.getReader(),n={items:[],styles:Object.create(null)};!function e(){i.read().then((function(s){let{value:i,done:a}=s;a?t(n):(Object.assign(n.styles,i.styles),n.items.push(...i.items),e())}),s)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const s of e.renderTasks)t.push(s.completed),s.cancel();return this.objs.clear(),_classPrivateFieldSet(_pendingCleanup,this,!1),_assertClassBrand(_PDFPageProxy_brand,this,_abortDelayedCleanup).call(this),Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];_classPrivateFieldSet(_pendingCleanup,this,!0);const e=_assertClassBrand(_PDFPageProxy_brand,this,_tryCleanup).call(this,!1);return t&&e&&this._stats&&(this._stats=new _display_utils.StatTimer),e}_startRenderPage(t,e){var s,i;const n=this._intentStates.get(e);n&&(null===(s=this._stats)||void 0===s||s.timeEnd("Page Request"),null===(i=n.displayReadyCapability)||void 0===i||i.resolve(t))}_renderPageChunk(t,e){for(let s=0,i=t.length;s<i;s++)e.operatorList.fnArray.push(t.fnArray[s]),e.operatorList.argsArray.push(t.argsArray[s]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const s of e.renderTasks)s.operatorListChanged();t.lastChunk&&_assertClassBrand(_PDFPageProxy_brand,this,_tryCleanup).call(this,!0)}_pumpOperatorList(t){let{renderingIntent:e,cacheKey:s,annotationStorageSerializable:i}=t;const{map:n,transfers:a}=i,r=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:s,annotationStorage:n},a).getReader(),o=this._intentStates.get(s);o.streamReader=r;const l=()=>{r.read().then((t=>{let{value:e,done:s}=t;s?o.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,o),l())}),(t=>{if(o.streamReader=null,!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(const t of o.renderTasks)t.operatorListChanged();_assertClassBrand(_PDFPageProxy_brand,this,_tryCleanup).call(this,!0)}if(o.displayReadyCapability)o.displayReadyCapability.reject(t);else{if(!o.opListReadCapability)throw t;o.opListReadCapability.reject(t)}}}))};l()}_abortOperatorList(t){let{intentState:e,reason:s,force:i=!1}=t;if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!i){if(e.renderTasks.size>0)return;if(s instanceof _display_utils.RenderingCancelledException){let t=RENDERING_CANCELLED_TIMEOUT;return s.extraDelay>0&&s.extraDelay<1e3&&(t+=s.extraDelay),void(e.streamReaderCancelTimeout=setTimeout((()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:s,force:!0})}),t))}}if(e.streamReader.cancel(new _util.AbortException(s.message)).catch((()=>{})),e.streamReader=null,!this._transport.destroyed){for(const[t,s]of this._intentStates)if(s===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}function _tryCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(_assertClassBrand(_PDFPageProxy_brand,this,_abortDelayedCleanup).call(this),!_classPrivateFieldGet(_pendingCleanup,this)||this.destroyed)return!1;if(t)return _classPrivateFieldSet(_delayedCleanupTimeout,this,setTimeout((()=>{_classPrivateFieldSet(_delayedCleanupTimeout,this,null),_assertClassBrand(_PDFPageProxy_brand,this,_tryCleanup).call(this,!1)}),DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:e,operatorList:s}of this._intentStates.values())if(e.size>0||!s.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),_classPrivateFieldSet(_pendingCleanup,this,!1),!0}function _abortDelayedCleanup(){_classPrivateFieldGet(_delayedCleanupTimeout,this)&&(clearTimeout(_classPrivateFieldGet(_delayedCleanupTimeout,this)),_classPrivateFieldSet(_delayedCleanupTimeout,this,null))}exports.PDFPageProxy=PDFPageProxy;var _listeners=new WeakMap,_deferred=new WeakMap;class LoopbackPort{constructor(){_classPrivateFieldInitSpec(this,_listeners,new Set),_classPrivateFieldInitSpec(this,_deferred,Promise.resolve())}postMessage(t,e){const s={data:structuredClone(t,e?{transfer:e}:null)};_classPrivateFieldGet(_deferred,this).then((()=>{for(const t of _classPrivateFieldGet(_listeners,this))t.call(this,s)}))}addEventListener(t,e){_classPrivateFieldGet(_listeners,this).add(e)}removeEventListener(t,e){_classPrivateFieldGet(_listeners,this).delete(e)}terminate(){_classPrivateFieldGet(_listeners,this).clear()}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_util.isNodeJS)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"===typeof document){var _document;const t=null===(_document=document)||void 0===_document||null===(_document=_document.currentScript)||void 0===_document?void 0:_document.src;t&&(PDFWorkerUtil.fallbackWorkerSrc=t.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(t,e){let s;try{if(s=new URL(t),!s.origin||"null"===s.origin)return!1}catch{return!1}const i=new URL(e,s);return s.origin===i.origin},PDFWorkerUtil.createCDNWrapper=function(t){const e='importScripts("'.concat(t,'");');return URL.createObjectURL(new Blob([e]))};class PDFWorker{constructor(){let{name:t=null,port:e=null,verbosity:s=(0,_util.getVerbosityLevel)()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.name=t,this.destroyed=!1,this.verbosity=s,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,e){var i;if(null!==(i=_workerPorts._)&&void 0!==i&&i.has(e))throw new Error("Cannot use more than one PDFWorker per port.");return(_workerPorts._||(_workerPorts._=new WeakMap)).set(e,this),void this._initializeFromPort(e)}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new _message_handler.MessageHandler("main","worker",t),this._messageHandler.on("ready",(function(){})),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:t}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,t)||(t=PDFWorkerUtil.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t),s=new _message_handler.MessageHandler("main","worker",e),i=()=>{e.removeEventListener("error",n),s.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},n=()=>{this._webWorker||i()};e.addEventListener("error",n),s.on("test",(t=>{e.removeEventListener("error",n),this.destroyed?i():t?(this._messageHandler=s,this._port=e,this._webWorker=e,this._readyCapability.resolve(),s.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),s.destroy(),e.terminate())})),s.on("ready",(t=>{if(e.removeEventListener("error",n),this.destroyed)i();else try{a()}catch{this._setupFakeWorker()}}));const a=()=>{const t=new Uint8Array;s.send("test",t,[t.buffer])};return void a()}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),PDFWorker._setupFakeWorkerGlobal.then((t=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const e=new LoopbackPort;this._port=e;const s="fake".concat(PDFWorkerUtil.fakeWorkerId++),i=new _message_handler.MessageHandler(s+"_worker",s,e);t.setup(i,e);const n=new _message_handler.MessageHandler(s,s+"_worker",e);this._messageHandler=n,this._readyCapability.resolve(),n.send("configure",{verbosity:this.verbosity})})).catch((t=>{this._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(t.message,'".')))}))}destroy(){var t;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),null===(t=_workerPorts._)||void 0===t||t.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){var e;if(null===t||void 0===t||!t.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const s=null===(e=_assertClassBrand(PDFWorker,this,_workerPorts)._)||void 0===e?void 0:e.get(t.port);if(s){if(s._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return s}return new PDFWorker(t)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{var t;return(null===(t=globalThis.pdfjsWorker)||void 0===t?void 0:t.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}var _workerPorts={_:void 0};exports.PDFWorker=PDFWorker;var _methodPromises=new WeakMap,_pageCache=new WeakMap,_pagePromises=new WeakMap,_passwordCapability=new WeakMap,_WorkerTransport_brand=new WeakSet;class WorkerTransport{constructor(t,e,s,i,n){_classPrivateMethodInitSpec(this,_WorkerTransport_brand),_classPrivateFieldInitSpec(this,_methodPromises,new Map),_classPrivateFieldInitSpec(this,_pageCache,new Map),_classPrivateFieldInitSpec(this,_pagePromises,new Map),_classPrivateFieldInitSpec(this,_passwordCapability,null),this.messageHandler=t,this.loadingTask=e,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this._params=i,this.canvasFactory=n.canvasFactory,this.filterFactory=n.filterFactory,this.cMapReaderFactory=n.cMapReaderFactory,this.standardFontDataFactory=n.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=s,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(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=_util.RenderingIntentFlag.DISPLAY,a=_annotation_storage.SerializableEmpty;switch(t){case"any":n=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":n=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)("getRenderingIntent - invalid intent: ".concat(t))}switch(e){case _util.AnnotationMode.DISABLE:n+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:n+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:n+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,a=(n&_util.RenderingIntentFlag.PRINT&&s instanceof _annotation_storage.PrintAnnotationStorage?s:this.annotationStorage).serializable;break;default:(0,_util.warn)("getRenderingIntent - invalid annotationMode: ".concat(e))}return i&&(n+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:n,cacheKey:"".concat(n,"_").concat(a.hash),annotationStorageSerializable:a}}destroy(){var t;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,null===(t=_classPrivateFieldGet(_passwordCapability,this))||void 0===t||t.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const i of _classPrivateFieldGet(_pageCache,this).values())e.push(i._destroy());_classPrivateFieldGet(_pageCache,this).clear(),_classPrivateFieldGet(_pagePromises,this).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const s=this.messageHandler.sendWithPromise("Terminate",null);return e.push(s),Promise.all(e).then((()=>{var t;this.commonObjs.clear(),this.fontLoader.clear(),_classPrivateFieldGet(_methodPromises,this).clear(),this.filterFactory.destroy(),null===(t=this._networkStream)||void 0===t||t.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:t,loadingTask:e}=this;t.on("GetReader",((t,e)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},e.onPull=()=>{this._fullReader.read().then((function(t){let{value:s,done:i}=t;i?e.close():((0,_util.assert)(s instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(s),1,[s]))})).catch((t=>{e.error(t)}))},e.onCancel=t=>{this._fullReader.cancel(t),e.ready.catch((t=>{if(!this.destroyed)throw t}))}})),t.on("ReaderHeadersReady",(t=>{const s=new _util.PromiseCapability,i=this._fullReader;return i.headersReady.then((()=>{var t;i.isStreamingSupported&&i.isRangeSupported||(this._lastProgress&&(null===(t=e.onProgress)||void 0===t||t.call(e,this._lastProgress)),i.onProgress=t=>{var s;null===(s=e.onProgress)||void 0===s||s.call(e,{loaded:t.loaded,total:t.total})});s.resolve({isStreamingSupported:i.isStreamingSupported,isRangeSupported:i.isRangeSupported,contentLength:i.contentLength})}),s.reject),s.promise})),t.on("GetRangeReader",((t,e)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const s=this._networkStream.getRangeReader(t.begin,t.end);s?(e.onPull=()=>{s.read().then((function(t){let{value:s,done:i}=t;i?e.close():((0,_util.assert)(s instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(s),1,[s]))})).catch((t=>{e.error(t)}))},e.onCancel=t=>{s.cancel(t),e.ready.catch((t=>{if(!this.destroyed)throw t}))}):e.close()})),t.on("GetDoc",(t=>{let{pdfInfo:s}=t;this._numPages=s.numPages,this._htmlForXfa=s.htmlForXfa,delete s.htmlForXfa,e._capability.resolve(new PDFDocumentProxy(s,this))})),t.on("DocException",(function(t){let s;switch(t.name){case"PasswordException":s=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":s=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":s=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":s=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":s=new _util.UnknownErrorException(t.message,t.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}e._capability.reject(s)})),t.on("PasswordRequest",(t=>{if(_classPrivateFieldSet(_passwordCapability,this,new _util.PromiseCapability),e.onPassword){const i=t=>{t instanceof Error?_classPrivateFieldGet(_passwordCapability,this).reject(t):_classPrivateFieldGet(_passwordCapability,this).resolve({password:t})};try{e.onPassword(i,t.code)}catch(s){_classPrivateFieldGet(_passwordCapability,this).reject(s)}}else _classPrivateFieldGet(_passwordCapability,this).reject(new _util.PasswordException(t.message,t.code));return _classPrivateFieldGet(_passwordCapability,this).promise})),t.on("DataLoaded",(t=>{var s;null===(s=e.onProgress)||void 0===s||s.call(e,{loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)})),t.on("StartRenderPage",(t=>{this.destroyed||_classPrivateFieldGet(_pageCache,this).get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)})),t.on("commonobj",(e=>{var s;let[i,n,a]=e;if(!this.destroyed&&!this.commonObjs.has(i))switch(n){case"Font":const e=this._params;if("error"in a){const t=a.error;(0,_util.warn)("Error during font loading: ".concat(t)),this.commonObjs.resolve(i,t);break}const r=e.pdfBug&&null!==(s=globalThis.FontInspector)&&void 0!==s&&s.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,o=new _font_loader.FontFaceObject(a,{isEvalSupported:e.isEvalSupported,disableFontFace:e.disableFontFace,ignoreErrors:e.ignoreErrors,inspectFont:r});this.fontLoader.bind(o).catch((e=>t.sendWithPromise("FontFallback",{id:i}))).finally((()=>{!e.fontExtraProperties&&o.data&&(o.data=null),this.commonObjs.resolve(i,o)}));break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,a);break;default:throw new Error("Got unknown common object type ".concat(n))}})),t.on("obj",(t=>{let[e,s,i,n]=t;if(this.destroyed)return;const a=_classPrivateFieldGet(_pageCache,this).get(s);if(!a.objs.has(e))switch(i){case"Image":if(a.objs.resolve(e,n),n){let t;if(n.bitmap){const{width:e,height:s}=n;t=e*s*4}else{var r;t=(null===(r=n.data)||void 0===r?void 0:r.length)||0}t>_util.MAX_IMAGE_SIZE_TO_CACHE&&(a._maybeCleanupAfterRender=!0)}break;case"Pattern":a.objs.resolve(e,n);break;default:throw new Error("Got unknown object type ".concat(i))}})),t.on("DocProgress",(t=>{var s;this.destroyed||null===(s=e.onProgress)||void 0===s||s.call(e,{loaded:t.loaded,total:t.total})})),t.on("FetchBuiltInCMap",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(t):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.")))),t.on("FetchStandardFontData",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(t):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var t,e;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:s,transfers:i}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:s,filename:null!==(t=null===(e=this._fullReader)||void 0===e?void 0:e.filename)&&void 0!==t?t:null},i).finally((()=>{this.annotationStorage.resetModified()}))}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,s=_classPrivateFieldGet(_pagePromises,this).get(e);if(s)return s;const i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then((t=>{if(this.destroyed)throw new Error("Transport destroyed");const s=new PDFPageProxy(e,t,this,this._params.pdfBug);return _classPrivateFieldGet(_pageCache,this).set(e,s),s}));return _classPrivateFieldGet(_pagePromises,this).set(e,i),i}getPageIndex(t){return"object"!==typeof t||null===t||!Number.isInteger(t.num)||t.num<0||!Number.isInteger(t.gen)||t.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen})}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return _assertClassBrand(_WorkerTransport_brand,this,_cacheSimpleMethod).call(this,"GetFieldObjects")}hasJSActions(){return _assertClassBrand(_WorkerTransport_brand,this,_cacheSimpleMethod).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!==typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}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 _assertClassBrand(_WorkerTransport_brand,this,_cacheSimpleMethod).call(this,"GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((t=>new _optional_content_config.OptionalContentConfig(t)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=_classPrivateFieldGet(_methodPromises,this).get(t);if(e)return e;const s=this.messageHandler.sendWithPromise(t,null).then((t=>{var e,s,i,n;return{info:t[0],metadata:t[1]?new _metadata.Metadata(t[1]):null,contentDispositionFilename:null!==(e=null===(s=this._fullReader)||void 0===s?void 0:s.filename)&&void 0!==e?e:null,contentLength:null!==(i=null===(n=this._fullReader)||void 0===n?void 0:n.contentLength)&&void 0!==i?i:null}}));return _classPrivateFieldGet(_methodPromises,this).set(t,s),s}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of _classPrivateFieldGet(_pageCache,this).values())if(!t.cleanup())throw new Error("startCleanup: Page ".concat(t.pageNumber," is currently rendering."));this.commonObjs.clear(),t||this.fontLoader.clear(),_classPrivateFieldGet(_methodPromises,this).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:t,enableXfa:e}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:t,enableXfa:e})}}function _cacheSimpleMethod(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const s=_classPrivateFieldGet(_methodPromises,this).get(t);if(s)return s;const i=this.messageHandler.sendWithPromise(t,e);return _classPrivateFieldGet(_methodPromises,this).set(t,i),i}var _objs=new WeakMap,_PDFObjects_brand=new WeakSet;class PDFObjects{constructor(){_classPrivateMethodInitSpec(this,_PDFObjects_brand),_classPrivateFieldInitSpec(this,_objs,Object.create(null))}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){const s=_assertClassBrand(_PDFObjects_brand,this,_ensureObj).call(this,t);return s.capability.promise.then((()=>e(s.data))),null}const s=_classPrivateFieldGet(_objs,this)[t];if(null===s||void 0===s||!s.capability.settled)throw new Error("Requesting object that isn't resolved yet ".concat(t,"."));return s.data}has(t){const e=_classPrivateFieldGet(_objs,this)[t];return(null===e||void 0===e?void 0:e.capability.settled)||!1}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const s=_assertClassBrand(_PDFObjects_brand,this,_ensureObj).call(this,t);s.data=e,s.capability.resolve()}clear(){for(const e in _classPrivateFieldGet(_objs,this)){var t;const{data:s}=_classPrivateFieldGet(_objs,this)[e];null===s||void 0===s||null===(t=s.bitmap)||void 0===t||t.close()}_classPrivateFieldSet(_objs,this,Object.create(null))}}function _ensureObj(t){var e;return(e=_classPrivateFieldGet(_objs,this))[t]||(e[t]={capability:new _util.PromiseCapability,data:null})}var _internalRenderTask=new WeakMap;class RenderTask{constructor(t){_classPrivateFieldInitSpec(this,_internalRenderTask,null),_classPrivateFieldSet(_internalRenderTask,this,t),this.onContinue=null}get promise(){return _classPrivateFieldGet(_internalRenderTask,this).capability.promise}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;_classPrivateFieldGet(_internalRenderTask,this).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=_classPrivateFieldGet(_internalRenderTask,this).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=_classPrivateFieldGet(_internalRenderTask,this);return t.form||t.canvas&&(null===e||void 0===e?void 0:e.size)>0}}exports.RenderTask=RenderTask;class InternalRenderTask{constructor(t){let{callback:e,params:s,objs:i,commonObjs:n,annotationCanvasMap:a,operatorList:r,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:d=!1,pdfBug:h=!1,pageColors:u=null}=t;this.callback=e,this.params=s,this.objs=i,this.commonObjs=n,this.annotationCanvasMap=a,this.operatorListIdx=null,this.operatorList=r,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=h,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===d&&"undefined"!==typeof window,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=s.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics(t){var e,s;let{transparency:i=!1,optionalContentConfig:n}=t;if(this.cancelled)return;if(this._canvas){if(_canvasInUse._.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.");_canvasInUse._.add(this._canvas)}this._pdfBug&&null!==(e=globalThis.StepperManager)&&void 0!==e&&e.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:a,viewport:r,transform:o,background:l}=this.params;this.gfx=new _canvas.CanvasGraphics(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:n},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:o,viewport:r,transparency:i,background:l}),this.operatorListIdx=0,this.graphicsReady=!0,null===(s=this.graphicsReadyCallback)||void 0===s||s.call(this)}cancel(){var t;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1,this.cancelled=!0,null===(t=this.gfx)||void 0===t||t.endDrawing(),_canvasInUse._.delete(this._canvas),this.callback(e||new _display_utils.RenderingCancelledException("Rendering cancelled, page ".concat(this._pageIndex+1),s))}operatorListChanged(){var t;this.graphicsReady?(null===(t=this.stepper)||void 0===t||t.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame((()=>{this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),_canvasInUse._.delete(this._canvas),this.callback())))}}var _canvasInUse={_:new WeakSet};const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SerializableEmpty=e.PrintAnnotationStorage=e.AnnotationStorage=void 0;var i=s(1),n=s(4),a=s(8);const r=Object.freeze({map:null,hash:"",transfers:void 0});e.SerializableEmpty=r;var o=new WeakMap,l=new WeakMap,c=new WeakSet;class d{constructor(){_classPrivateMethodInitSpec(this,c),_classPrivateFieldInitSpec(this,o,!1),_classPrivateFieldInitSpec(this,l,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const s=_classPrivateFieldGet(l,this).get(t);return void 0===s?e:Object.assign(e,s)}getRawValue(t){return _classPrivateFieldGet(l,this).get(t)}remove(t){if(_classPrivateFieldGet(l,this).delete(t),0===_classPrivateFieldGet(l,this).size&&this.resetModified(),"function"===typeof this.onAnnotationEditor){for(const t of _classPrivateFieldGet(l,this).values())if(t instanceof n.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(t,e){const s=_classPrivateFieldGet(l,this).get(t);let i=!1;if(void 0!==s)for(const[n,a]of Object.entries(e))s[n]!==a&&(i=!0,s[n]=a);else i=!0,_classPrivateFieldGet(l,this).set(t,e);i&&_assertClassBrand(c,this,h).call(this),e instanceof n.AnnotationEditor&&"function"===typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return _classPrivateFieldGet(l,this).has(t)}getAll(){return _classPrivateFieldGet(l,this).size>0?(0,i.objectFromMap)(_classPrivateFieldGet(l,this)):null}setAll(t){for(const[e,s]of Object.entries(t))this.setValue(e,s)}get size(){return _classPrivateFieldGet(l,this).size}resetModified(){_classPrivateFieldGet(o,this)&&(_classPrivateFieldSet(o,this,!1),"function"===typeof this.onResetModified&&this.onResetModified())}get print(){return new p(this)}get serializable(){if(0===_classPrivateFieldGet(l,this).size)return r;const t=new Map,e=new a.MurmurHash3_64,s=[],i=Object.create(null);let o=!1;for(const[a,r]of _classPrivateFieldGet(l,this)){const s=r instanceof n.AnnotationEditor?r.serialize(!1,i):r;s&&(t.set(a,s),e.update("".concat(a,":").concat(JSON.stringify(s))),o||(o=!!s.bitmap))}if(o)for(const n of t.values())n.bitmap&&s.push(n.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfers:s}:r}}function h(){_classPrivateFieldGet(o,this)||(_classPrivateFieldSet(o,this,!0),"function"===typeof this.onSetModified&&this.onSetModified())}e.AnnotationStorage=d;var u=new WeakMap;class p extends d{constructor(t){super(),_classPrivateFieldInitSpec(this,u,void 0);const{map:e,hash:s,transfers:i}=t.serializable,n=structuredClone(e,i?{transfer:i}:null);_classPrivateFieldSet(u,this,{map:n,hash:s,transfers:i})}get print(){(0,i.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return _classPrivateFieldGet(u,this)}}e.PrintAnnotationStorage=p},(t,e,s)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditor=void 0;var n=s(5),a=s(1),r=s(6),o=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,v=new WeakMap,_=new WeakMap,m=new WeakMap,b=new WeakMap,y=new WeakMap,P=new WeakSet;class A{constructor(t){_classPrivateMethodInitSpec(this,P),_classPrivateFieldInitSpec(this,o,""),_classPrivateFieldInitSpec(this,l,!1),_classPrivateFieldInitSpec(this,c,null),_classPrivateFieldInitSpec(this,d,null),_classPrivateFieldInitSpec(this,h,null),_classPrivateFieldInitSpec(this,u,!1),_classPrivateFieldInitSpec(this,p,null),_classPrivateFieldInitSpec(this,f,this.focusin.bind(this)),_classPrivateFieldInitSpec(this,g,this.focusout.bind(this)),_classPrivateFieldInitSpec(this,v,!1),_classPrivateFieldInitSpec(this,_,!1),_classPrivateFieldInitSpec(this,m,!1),_defineProperty(this,"_initialOptions",Object.create(null)),_defineProperty(this,"_uiManager",null),_defineProperty(this,"_focusEventsAllowed",!0),_defineProperty(this,"_l10nPromise",null),_classPrivateFieldInitSpec(this,b,!1),_classPrivateFieldInitSpec(this,y,A._zIndex++),this.constructor===A&&(0,a.unreachable)("Cannot initialize AnnotationEditor."),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;const{rotation:e,rawDims:{pageWidth:s,pageHeight:i,pageX:n,pageY:r}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[s,i],this.pageTranslation=[n,r];const[S,F]=this.parentDimensions;this.x=t.x/S,this.y=t.y/F,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,a.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new R({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(A._l10nPromise||(A._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map((e=>[e,t.get(e)])))),null!==e&&void 0!==e&&e.strings)for(const i of e.strings)A._l10nPromise.set(i,t.get(i));if(-1!==A._borderLineWidth)return;const s=getComputedStyle(document.documentElement);A._borderLineWidth=parseFloat(s.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){(0,a.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return _classPrivateFieldGet(b,this)}set _isDraggable(t){var e;_classPrivateFieldSet(b,this,t),null===(e=this.div)||void 0===e||e.classList.toggle("draggable",t)}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t),this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t),this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=_classPrivateFieldGet(y,this)}setParent(t){null!==t&&(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions),this.parent=t}focusin(t){this._focusEventsAllowed&&(_classPrivateFieldGet(v,this)?_classPrivateFieldSet(v,this,!1):this.parent.setSelected(this))}focusout(t){var e;if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const s=t.relatedTarget;null!==s&&void 0!==s&&s.closest("#".concat(this.id))||(t.preventDefault(),null!==(e=this.parent)&&void 0!==e&&e.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,s,i){const[n,a]=this.parentDimensions;[s,i]=this.screenToPageTranslation(s,i),this.x=(t+s)/n,this.y=(e+i)/a,this.fixAndSetPosition()}translate(t,e){_assertClassBrand(P,this,S).call(this,this.parentDimensions,t,e)}translateInPage(t,e){_assertClassBrand(P,this,S).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}drag(t,e){const[s,i]=this.parentDimensions;if(this.x+=t/s,this.y+=e/i,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:t,y:e}=this.div.getBoundingClientRect();this.parent.findNewParent(this,t,e)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:n,y:a}=this;const[r,o]=_assertClassBrand(P,this,F).call(this);n+=r,a+=o,this.div.style.left="".concat((100*n).toFixed(2),"%"),this.div.style.top="".concat((100*a).toFixed(2),"%"),this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[t,e]=this.pageDimensions;let{x:s,y:i,width:n,height:a}=this;switch(n*=t,a*=e,s*=t,i*=e,this.rotation){case 0:s=Math.max(0,Math.min(t-n,s)),i=Math.max(0,Math.min(e-a,i));break;case 90:s=Math.max(0,Math.min(t-a,s)),i=Math.min(e,Math.max(n,i));break;case 180:s=Math.min(t,Math.max(n,s)),i=Math.min(e,Math.max(a,i));break;case 270:s=Math.min(t,Math.max(a,s)),i=Math.max(0,Math.min(e-n,i))}this.x=s/=t,this.y=i/=e;const[r,o]=_assertClassBrand(P,this,F).call(this);s+=r,i+=o;const{style:l}=this.div;l.left="".concat((100*s).toFixed(2),"%"),l.top="".concat((100*i).toFixed(2),"%"),this.moveInDOM()}screenToPageTranslation(t,e){return w.call(A,t,e,this.parentRotation)}pageTranslationToScreen(t,e){return w.call(A,t,e,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,s]}=this,i=e*t,n=s*t;return a.FeatureTest.isCSSRoundSupported?[Math.round(i),Math.round(n)]:[i,n]}setDims(t,e){var s;const[i,n]=this.parentDimensions;this.div.style.width="".concat((100*t/i).toFixed(2),"%"),_classPrivateFieldGet(u,this)||(this.div.style.height="".concat((100*e/n).toFixed(2),"%")),null===(s=_classPrivateFieldGet(c,this))||void 0===s||s.classList.toggle("small",t<A.SMALL_EDITOR_SIZE||e<A.SMALL_EDITOR_SIZE)}fixDims(){const{style:t}=this.div,{height:e,width:s}=t,i=s.endsWith("%"),n=!_classPrivateFieldGet(u,this)&&e.endsWith("%");if(i&&n)return;const[a,r]=this.parentDimensions;i||(t.width="".concat((100*parseFloat(s)/a).toFixed(2),"%")),_classPrivateFieldGet(u,this)||n||(t.height="".concat((100*parseFloat(e)/r).toFixed(2),"%"))}getInitialTranslation(){return[0,0]}async addAltTextButton(){if(_classPrivateFieldGet(c,this))return;const t=_classPrivateFieldSet(c,this,document.createElement("button"));t.className="altText";const e=await A._l10nPromise.get("editor_alt_text_button_label");if(t.textContent=e,t.setAttribute("aria-label",e),t.tabIndex="0",t.addEventListener("contextmenu",r.noContextMenu),t.addEventListener("pointerdown",(t=>t.stopPropagation())),t.addEventListener("click",(t=>{t.preventDefault(),this._uiManager.editAltText(this)}),{capture:!0}),t.addEventListener("keydown",(e=>{e.target===t&&"Enter"===e.key&&(e.preventDefault(),this._uiManager.editAltText(this))})),_assertClassBrand(P,this,T).call(this),this.div.append(t),!A.SMALL_EDITOR_SIZE){const e=40;A.SMALL_EDITOR_SIZE=Math.min(128,Math.round(t.getBoundingClientRect().width*(1+e/100)))}}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:_classPrivateFieldGet(o,this),decorative:_classPrivateFieldGet(l,this)}}set altTextData(t){let{altText:e,decorative:s}=t;_classPrivateFieldGet(o,this)===e&&_classPrivateFieldGet(l,this)===s||(_classPrivateFieldSet(o,this,e),_classPrivateFieldSet(l,this,s),_assertClassBrand(P,this,T).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",_classPrivateFieldGet(f,this)),this.div.addEventListener("focusout",_classPrivateFieldGet(g,this));const[t,e]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth="".concat((100*e/t).toFixed(2),"%"),this.div.style.maxHeight="".concat((100*t/e).toFixed(2),"%"));const[s,i]=this.getInitialTranslation();return this.translate(s,i),(0,n.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:e}=a.FeatureTest.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(_classPrivateFieldSet(v,this,!0),_assertClassBrand(P,this,M).call(this,t))}moveInDOM(){var t;null===(t=this.parent)||void 0===t||t.moveEditorInDOM(this)}_setParentAndPosition(t,e,s){t.changeParent(this),this.x=e,this.y=s,this.fixAndSetPosition()}getRect(t,e){const s=this.parentScale,[i,n]=this.pageDimensions,[a,r]=this.pageTranslation,o=t/s,l=e/s,c=this.x*i,d=this.y*n,h=this.width*i,u=this.height*n;switch(this.rotation){case 0:return[c+o+a,n-d-l-u+r,c+o+h+a,n-d-l+r];case 90:return[c+l+a,n-d+o+r,c+l+u+a,n-d+o+h+r];case 180:return[c-o-h+a,n-d+l+r,c-o+a,n-d+l+u+r];case 270:return[c-l-u+a,n-d-o-h+r,c-l+a,n-d-o+r];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[s,i,n,a]=t,r=n-s,o=a-i;switch(this.rotation){case 0:return[s,e-a,r,o];case 90:return[s,e-i,o,r];case 180:return[n,e-i,r,o];case 270:return[n,e-a,o,r];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){_classPrivateFieldSet(m,this,!0)}disableEditMode(){_classPrivateFieldSet(m,this,!1)}isInEditMode(){return _classPrivateFieldGet(m,this)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var t,e;null===(t=this.div)||void 0===t||t.addEventListener("focusin",_classPrivateFieldGet(f,this)),null===(e=this.div)||void 0===e||e.addEventListener("focusout",_classPrivateFieldGet(g,this))}serialize(){(0,a.unreachable)("An editor must be serializable")}static deserialize(t,e,s){const i=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:s});i.rotation=t.rotation;const[n,a]=i.pageDimensions,[r,o,l,c]=i.getRectInCurrentCoords(t.rect,a);return i.x=r/n,i.y=o/a,i.width=l/n,i.height=c/a,i}remove(){var t;this.div.removeEventListener("focusin",_classPrivateFieldGet(f,this)),this.div.removeEventListener("focusout",_classPrivateFieldGet(g,this)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),null===(t=_classPrivateFieldGet(c,this))||void 0===t||t.remove(),_classPrivateFieldSet(c,this,null),_classPrivateFieldSet(d,this,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(_assertClassBrand(P,this,C).call(this),_classPrivateFieldGet(p,this).classList.remove("hidden"))}select(){var t;this.makeResizable(),null===(t=this.div)||void 0===t||t.classList.add("selectedEditor")}unselect(){var t,e,s;null===(t=_classPrivateFieldGet(p,this))||void 0===t||t.classList.add("hidden"),null===(e=this.div)||void 0===e||e.classList.remove("selectedEditor"),null!==(s=this.div)&&void 0!==s&&s.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(t,e){}disableEditing(){_classPrivateFieldGet(c,this)&&(_classPrivateFieldGet(c,this).hidden=!0)}enableEditing(){_classPrivateFieldGet(c,this)&&(_classPrivateFieldGet(c,this).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return _classPrivateFieldGet(_,this)}set isEditing(t){_classPrivateFieldSet(_,this,t),this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){_classPrivateFieldSet(u,this,!0);const s=t/e,{style:i}=this.div;i.aspectRatio=s,i.height="auto"}static get MIN_SIZE(){return 16}}function S(t,e,s){let[i,n]=t;[e,s]=this.screenToPageTranslation(e,s),this.x+=e/i,this.y+=s/n,this.fixAndSetPosition()}function F(){const[t,e]=this.parentDimensions,{_borderLineWidth:s}=i,n=s/t,a=s/e;switch(this.rotation){case 90:return[-n,a];case 180:return[n,a];case 270:return[n,-a];default:return[-n,-a]}}function w(t,e,s){switch(s){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}function x(t){switch(t){case 90:{const[t,e]=this.pageDimensions;return[0,-t/e,e/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,e]=this.pageDimensions;return[0,t/e,-e/t,0]}default:return[1,0,0,1]}}function C(){if(_classPrivateFieldGet(p,this))return;_classPrivateFieldSet(p,this,document.createElement("div")),_classPrivateFieldGet(p,this).classList.add("resizers");const t=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||t.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const e of t){const t=document.createElement("div");_classPrivateFieldGet(p,this).append(t),t.classList.add("resizer",e),t.addEventListener("pointerdown",_assertClassBrand(P,this,E).bind(this,e)),t.addEventListener("contextmenu",r.noContextMenu)}this.div.prepend(_classPrivateFieldGet(p,this))}function E(t,e){e.preventDefault();const{isMac:s}=a.FeatureTest.platform;if(0!==e.button||e.ctrlKey&&s)return;const i=_assertClassBrand(P,this,k).bind(this,t),n=this._isDraggable;this._isDraggable=!1;const r={passive:!0,capture:!0};window.addEventListener("pointermove",i,r);const o=this.x,l=this.y,c=this.width,d=this.height,h=this.parent.div.style.cursor,u=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const p=()=>{this._isDraggable=n,window.removeEventListener("pointerup",p),window.removeEventListener("blur",p),window.removeEventListener("pointermove",i,r),this.parent.div.style.cursor=h,this.div.style.cursor=u;const t=this.x,e=this.y,s=this.width,a=this.height;t===o&&e===l&&s===c&&a===d||this.addCommands({cmd:()=>{this.width=s,this.height=a,this.x=t,this.y=e;const[i,n]=this.parentDimensions;this.setDims(i*s,n*a),this.fixAndSetPosition()},undo:()=>{this.width=c,this.height=d,this.x=o,this.y=l;const[t,e]=this.parentDimensions;this.setDims(t*c,e*d),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",p),window.addEventListener("blur",p)}function k(t,e){const[s,n]=this.parentDimensions,a=this.x,r=this.y,o=this.width,l=this.height,c=i.MIN_SIZE/s,d=i.MIN_SIZE/n,h=t=>Math.round(1e4*t)/1e4,u=_assertClassBrand(P,this,x).call(this,this.rotation),p=(t,e)=>[u[0]*t+u[2]*e,u[1]*t+u[3]*e],f=_assertClassBrand(P,this,x).call(this,360-this.rotation);let g,v,_=!1,m=!1;switch(t){case"topLeft":_=!0,g=(t,e)=>[0,0],v=(t,e)=>[t,e];break;case"topMiddle":g=(t,e)=>[t/2,0],v=(t,e)=>[t/2,e];break;case"topRight":_=!0,g=(t,e)=>[t,0],v=(t,e)=>[0,e];break;case"middleRight":m=!0,g=(t,e)=>[t,e/2],v=(t,e)=>[0,e/2];break;case"bottomRight":_=!0,g=(t,e)=>[t,e],v=(t,e)=>[0,0];break;case"bottomMiddle":g=(t,e)=>[t/2,e],v=(t,e)=>[t/2,0];break;case"bottomLeft":_=!0,g=(t,e)=>[0,e],v=(t,e)=>[t,0];break;case"middleLeft":m=!0,g=(t,e)=>[0,e/2],v=(t,e)=>[t,e/2]}const b=g(o,l),y=v(o,l);let A=p(...y);const S=h(a+A[0]),F=h(r+A[1]);let w=1,C=1,[E,k]=this.screenToPageTranslation(e.movementX,e.movementY);var T,M;if([E,k]=(T=E/s,M=k/n,[f[0]*T+f[2]*M,f[1]*T+f[3]*M]),_){const t=Math.hypot(o,l);w=C=Math.max(Math.min(Math.hypot(y[0]-b[0]-E,y[1]-b[1]-k)/t,1/o,1/l),c/o,d/l)}else m?w=Math.max(c,Math.min(1,Math.abs(y[0]-b[0]-E)))/o:C=Math.max(d,Math.min(1,Math.abs(y[1]-b[1]-k)))/l;const R=h(o*w),I=h(l*C);A=p(...v(R,I));const D=S-A[0],O=F-A[1];this.width=R,this.height=I,this.x=D,this.y=O,this.setDims(s*R,n*I),this.fixAndSetPosition()}async function T(){const t=_classPrivateFieldGet(c,this);if(!t)return;var e;if(!_classPrivateFieldGet(o,this)&&!_classPrivateFieldGet(l,this))return t.classList.remove("done"),void(null===(e=_classPrivateFieldGet(d,this))||void 0===e||e.remove());i._l10nPromise.get("editor_alt_text_edit_button_label").then((e=>{t.setAttribute("aria-label",e)}));let s=_classPrivateFieldGet(d,this);if(!s){_classPrivateFieldSet(d,this,s=document.createElement("span")),s.className="tooltip",s.setAttribute("role","tooltip");const e=s.id="alt-text-tooltip-".concat(this.id);t.setAttribute("aria-describedby",e);const i=100;t.addEventListener("mouseenter",(()=>{_classPrivateFieldSet(h,this,setTimeout((()=>{_classPrivateFieldSet(h,this,null),_classPrivateFieldGet(d,this).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})}),i))})),t.addEventListener("mouseleave",(()=>{var t;clearTimeout(_classPrivateFieldGet(h,this)),_classPrivateFieldSet(h,this,null),null===(t=_classPrivateFieldGet(d,this))||void 0===t||t.classList.remove("show")}))}t.classList.add("done"),s.innerText=_classPrivateFieldGet(l,this)?await i._l10nPromise.get("editor_alt_text_decorative_tooltip"):_classPrivateFieldGet(o,this),s.parentNode||t.append(s)}function M(t){if(!this._isDraggable)return;const e=this._uiManager.isSelected(this);let s,i;this._uiManager.setUpDragSession(),e&&(s={passive:!0,capture:!0},i=t=>{const[e,s]=this.screenToPageTranslation(t.movementX,t.movementY);this._uiManager.dragSelectedEditors(e,s)},window.addEventListener("pointermove",i,s));const n=()=>{if(window.removeEventListener("pointerup",n),window.removeEventListener("blur",n),e&&window.removeEventListener("pointermove",i,s),_classPrivateFieldSet(v,this,!1),!this._uiManager.endDragSession()){const{isMac:e}=a.FeatureTest.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",n),window.addEventListener("blur",n)}i=A,_defineProperty(A,"_borderLineWidth",-1),_defineProperty(A,"_colorManager",new n.ColorManager),_defineProperty(A,"_zIndex",1),_defineProperty(A,"SMALL_EDITOR_SIZE",0),e.AnnotationEditor=A;class R extends A{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(t,e,s)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.KeyboardManager=e.CommandManager=e.ColorManager=e.AnnotationEditorUIManager=void 0,e.bindEvents=function(t,e,s){for(const i of s)e.addEventListener(i,t[i].bind(t))},e.opacityToHex=function(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")};var n=s(1),a=s(6),r=new WeakMap;class o{constructor(){_classPrivateFieldInitSpec(this,r,0)}getId(){var t,e;return"".concat(n.AnnotationEditorPrefix).concat((_classPrivateFieldSet(r,this,(t=_classPrivateFieldGet(r,this),e=t++,t)),e))}}var l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakSet;class u{constructor(){_classPrivateMethodInitSpec(this,h),_classPrivateFieldInitSpec(this,l,(0,n.getUuid)()),_classPrivateFieldInitSpec(this,c,0),_classPrivateFieldInitSpec(this,d,null)}static get _isSVGFittingCanvas(){const t=new OffscreenCanvas(1,3).getContext("2d"),e=new Image;e.src='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>';const s=e.decode().then((()=>(t.drawImage(e,0,0,1,1,0,0,1,3),0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0])));return(0,n.shadow)(this,"_isSVGFittingCanvas",s)}async getFromFile(t){const{lastModified:e,name:s,size:i,type:n}=t;return _assertClassBrand(h,this,p).call(this,"".concat(e,"_").concat(s,"_").concat(i,"_").concat(n),t)}async getFromUrl(t){return _assertClassBrand(h,this,p).call(this,t,t)}async getFromId(t){_classPrivateFieldGet(d,this)||_classPrivateFieldSet(d,this,new Map);const e=_classPrivateFieldGet(d,this).get(t);return e?e.bitmap?(e.refCounter+=1,e):e.file?this.getFromFile(e.file):this.getFromUrl(e.url):null}getSvgUrl(t){const e=_classPrivateFieldGet(d,this).get(t);return null!==e&&void 0!==e&&e.isSvg?e.svgUrl:null}deleteId(t){_classPrivateFieldGet(d,this)||_classPrivateFieldSet(d,this,new Map);const e=_classPrivateFieldGet(d,this).get(t);e&&(e.refCounter-=1,0===e.refCounter&&(e.bitmap=null))}isValidId(t){return t.startsWith("image_".concat(_classPrivateFieldGet(l,this),"_"))}}async function p(t,e){var s;_classPrivateFieldGet(d,this)||_classPrivateFieldSet(d,this,new Map);let n=_classPrivateFieldGet(d,this).get(t);if(null===n)return null;if(null!==(s=n)&&void 0!==s&&s.bitmap)return n.refCounter+=1,n;try{var a,r;let t;if(n||(n={bitmap:null,id:"image_".concat(_classPrivateFieldGet(l,this),"_").concat((_classPrivateFieldSet(c,this,(a=_classPrivateFieldGet(c,this),r=a++,a)),r)),refCounter:0,isSvg:!1}),"string"===typeof e){n.url=e;const s=await fetch(e);if(!s.ok)throw new Error(s.statusText);t=await s.blob()}else t=n.file=e;if("image/svg+xml"===t.type){const e=i._isSVGFittingCanvas,s=new FileReader,a=new Image,r=new Promise(((t,i)=>{a.onload=()=>{n.bitmap=a,n.isSvg=!0,t()},s.onload=async()=>{const t=n.svgUrl=s.result;a.src=await e?"".concat(t,"#svgView(preserveAspectRatio(none))"):t},a.onerror=s.onerror=i}));s.readAsDataURL(t),await r}else n.bitmap=await createImageBitmap(t);n.refCounter=1}catch(o){console.error(o),n=null}return _classPrivateFieldGet(d,this).set(t,n),n&&_classPrivateFieldGet(d,this).set(n.id,n),n}i=u;var f=new WeakMap,g=new WeakMap,v=new WeakMap,_=new WeakMap;class m{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;_classPrivateFieldInitSpec(this,f,[]),_classPrivateFieldInitSpec(this,g,!1),_classPrivateFieldInitSpec(this,v,void 0),_classPrivateFieldInitSpec(this,_,-1),_classPrivateFieldSet(v,this,t)}add(t){let{cmd:e,undo:s,mustExec:i,type:n=NaN,overwriteIfSameType:a=!1,keepUndo:r=!1}=t;if(i&&e(),_classPrivateFieldGet(g,this))return;const o={cmd:e,undo:s,type:n};if(-1===_classPrivateFieldGet(_,this))return _classPrivateFieldGet(f,this).length>0&&(_classPrivateFieldGet(f,this).length=0),_classPrivateFieldSet(_,this,0),void _classPrivateFieldGet(f,this).push(o);if(a&&_classPrivateFieldGet(f,this)[_classPrivateFieldGet(_,this)].type===n)return r&&(o.undo=_classPrivateFieldGet(f,this)[_classPrivateFieldGet(_,this)].undo),void(_classPrivateFieldGet(f,this)[_classPrivateFieldGet(_,this)]=o);const l=_classPrivateFieldGet(_,this)+1;l===_classPrivateFieldGet(v,this)?_classPrivateFieldGet(f,this).splice(0,1):(_classPrivateFieldSet(_,this,l),l<_classPrivateFieldGet(f,this).length&&_classPrivateFieldGet(f,this).splice(l)),_classPrivateFieldGet(f,this).push(o)}undo(){-1!==_classPrivateFieldGet(_,this)&&(_classPrivateFieldSet(g,this,!0),_classPrivateFieldGet(f,this)[_classPrivateFieldGet(_,this)].undo(),_classPrivateFieldSet(g,this,!1),_classPrivateFieldSet(_,this,_classPrivateFieldGet(_,this)-1))}redo(){_classPrivateFieldGet(_,this)<_classPrivateFieldGet(f,this).length-1&&(_classPrivateFieldSet(_,this,_classPrivateFieldGet(_,this)+1),_classPrivateFieldSet(g,this,!0),_classPrivateFieldGet(f,this)[_classPrivateFieldGet(_,this)].cmd(),_classPrivateFieldSet(g,this,!1))}hasSomethingToUndo(){return-1!==_classPrivateFieldGet(_,this)}hasSomethingToRedo(){return _classPrivateFieldGet(_,this)<_classPrivateFieldGet(f,this).length-1}destroy(){_classPrivateFieldSet(f,this,null)}}e.CommandManager=m;var b=new WeakSet;class y{constructor(t){_classPrivateMethodInitSpec(this,b),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=n.FeatureTest.platform;for(const[s,i,n={}]of t)for(const t of s){const s=t.startsWith("mac+");e&&s?(this.callbacks.set(t.slice(4),{callback:i,options:n}),this.allKeys.add(t.split("+").at(-1))):e||s||(this.callbacks.set(t,{callback:i,options:n}),this.allKeys.add(t.split("+").at(-1)))}}exec(t,e){if(!this.allKeys.has(e.key))return;const s=this.callbacks.get(_assertClassBrand(b,this,P).call(this,e));if(!s)return;const{callback:i,options:{bubbles:n=!1,args:a=[],checker:r=null}}=s;r&&!r(t,e)||(i.bind(t,...a)(),n||(e.stopPropagation(),e.preventDefault()))}}function P(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const e=this.buffer.join("+");return this.buffer.length=0,e}e.KeyboardManager=y;class A{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return(0,a.getColorValues)(t),(0,n.shadow)(this,"_colors",t)}convert(t){const e=(0,a.getRGB)(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[s,i]of this._colors)if(i.every(((t,s)=>t===e[s])))return A._colorsMapping.get(s);return e}getHexCode(t){const e=this._colors.get(t);return e?n.Util.makeHexColor(...e):t}}_defineProperty(A,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]])),e.ColorManager=A;var S=new WeakMap,F=new WeakMap,w=new WeakMap,x=new WeakMap,C=new WeakMap,E=new WeakMap,k=new WeakMap,T=new WeakMap,M=new WeakMap,R=new WeakMap,I=new WeakMap,D=new WeakMap,O=new WeakMap,L=new WeakMap,G=new WeakMap,N=new WeakMap,B=new WeakMap,j=new WeakMap,W=new WeakMap,U=new WeakMap,z=new WeakMap,q=new WeakMap,H=new WeakMap,V=new WeakMap,X=new WeakMap,K=new WeakMap,Y=new WeakMap,J=new WeakMap,Q=new WeakMap,Z=new WeakMap,$=new WeakMap,tt=new WeakMap,et=new WeakMap,st=new WeakMap,it=new WeakSet;class nt{static get _keyboardManager(){const t=nt.prototype,e=t=>{const{activeElement:e}=document;return e&&_classPrivateFieldGet(et,t).contains(e)&&t.hasSomethingToControl()},s=this.TRANSLATE_SMALL,i=this.TRANSLATE_BIG;return(0,n.shadow)(this,"_keyboardManager",new y([[["ctrl+a","mac+meta+a"],t.selectAll],[["ctrl+z","mac+meta+z"],t.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-i,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[i,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-i],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,i],checker:e}]]))}constructor(t,e,s,i,r,l){_classPrivateMethodInitSpec(this,it),_classPrivateFieldInitSpec(this,S,null),_classPrivateFieldInitSpec(this,F,new Map),_classPrivateFieldInitSpec(this,w,new Map),_classPrivateFieldInitSpec(this,x,null),_classPrivateFieldInitSpec(this,C,null),_classPrivateFieldInitSpec(this,E,new m),_classPrivateFieldInitSpec(this,k,0),_classPrivateFieldInitSpec(this,T,new Set),_classPrivateFieldInitSpec(this,M,null),_classPrivateFieldInitSpec(this,R,null),_classPrivateFieldInitSpec(this,I,new Set),_classPrivateFieldInitSpec(this,D,null),_classPrivateFieldInitSpec(this,O,new o),_classPrivateFieldInitSpec(this,L,!1),_classPrivateFieldInitSpec(this,G,!1),_classPrivateFieldInitSpec(this,N,null),_classPrivateFieldInitSpec(this,B,n.AnnotationEditorType.NONE),_classPrivateFieldInitSpec(this,j,new Set),_classPrivateFieldInitSpec(this,W,null),_classPrivateFieldInitSpec(this,U,this.blur.bind(this)),_classPrivateFieldInitSpec(this,z,this.focus.bind(this)),_classPrivateFieldInitSpec(this,q,this.copy.bind(this)),_classPrivateFieldInitSpec(this,H,this.cut.bind(this)),_classPrivateFieldInitSpec(this,V,this.paste.bind(this)),_classPrivateFieldInitSpec(this,X,this.keydown.bind(this)),_classPrivateFieldInitSpec(this,K,this.onEditingAction.bind(this)),_classPrivateFieldInitSpec(this,Y,this.onPageChanging.bind(this)),_classPrivateFieldInitSpec(this,J,this.onScaleChanging.bind(this)),_classPrivateFieldInitSpec(this,Q,this.onRotationChanging.bind(this)),_classPrivateFieldInitSpec(this,Z,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1}),_classPrivateFieldInitSpec(this,$,[0,0]),_classPrivateFieldInitSpec(this,tt,null),_classPrivateFieldInitSpec(this,et,null),_classPrivateFieldInitSpec(this,st,null),_classPrivateFieldSet(et,this,t),_classPrivateFieldSet(st,this,e),_classPrivateFieldSet(x,this,s),this._eventBus=i,this._eventBus._on("editingaction",_classPrivateFieldGet(K,this)),this._eventBus._on("pagechanging",_classPrivateFieldGet(Y,this)),this._eventBus._on("scalechanging",_classPrivateFieldGet(J,this)),this._eventBus._on("rotationchanging",_classPrivateFieldGet(Q,this)),_classPrivateFieldSet(C,this,r.annotationStorage),_classPrivateFieldSet(D,this,r.filterFactory),_classPrivateFieldSet(W,this,l),this.viewParameters={realScale:a.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){_assertClassBrand(it,this,lt).call(this),_assertClassBrand(it,this,rt).call(this),this._eventBus._off("editingaction",_classPrivateFieldGet(K,this)),this._eventBus._off("pagechanging",_classPrivateFieldGet(Y,this)),this._eventBus._off("scalechanging",_classPrivateFieldGet(J,this)),this._eventBus._off("rotationchanging",_classPrivateFieldGet(Q,this));for(const t of _classPrivateFieldGet(w,this).values())t.destroy();_classPrivateFieldGet(w,this).clear(),_classPrivateFieldGet(F,this).clear(),_classPrivateFieldGet(I,this).clear(),_classPrivateFieldSet(S,this,null),_classPrivateFieldGet(j,this).clear(),_classPrivateFieldGet(E,this).destroy(),_classPrivateFieldGet(x,this).destroy()}get hcmFilter(){return(0,n.shadow)(this,"hcmFilter",_classPrivateFieldGet(W,this)?_classPrivateFieldGet(D,this).addHCMFilter(_classPrivateFieldGet(W,this).foreground,_classPrivateFieldGet(W,this).background):"none")}get direction(){return(0,n.shadow)(this,"direction",getComputedStyle(_classPrivateFieldGet(et,this)).direction)}editAltText(t){var e;null===(e=_classPrivateFieldGet(x,this))||void 0===e||e.editAltText(this,t)}onPageChanging(t){let{pageNumber:e}=t;_classPrivateFieldSet(k,this,e-1)}focusMainContainer(){_classPrivateFieldGet(et,this).focus()}findParent(t,e){for(const s of _classPrivateFieldGet(w,this).values()){const{x:i,y:n,width:a,height:r}=s.div.getBoundingClientRect();if(t>=i&&t<=i+a&&e>=n&&e<=n+r)return s}return null}disableUserSelect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];_classPrivateFieldGet(st,this).classList.toggle("noUserSelect",t)}addShouldRescale(t){_classPrivateFieldGet(I,this).add(t)}removeShouldRescale(t){_classPrivateFieldGet(I,this).delete(t)}onScaleChanging(t){let{scale:e}=t;this.commitOrRemove(),this.viewParameters.realScale=e*a.PixelsPerInch.PDF_TO_CSS_UNITS;for(const s of _classPrivateFieldGet(I,this))s.onScaleChanging()}onRotationChanging(t){let{pagesRotation:e}=t;this.commitOrRemove(),this.viewParameters.rotation=e}addToAnnotationStorage(t){t.isEmpty()||!_classPrivateFieldGet(C,this)||_classPrivateFieldGet(C,this).has(t.id)||_classPrivateFieldGet(C,this).setValue(t.id,t)}blur(){if(!this.hasSelection)return;const{activeElement:t}=document;for(const e of _classPrivateFieldGet(j,this))if(e.div.contains(t)){_classPrivateFieldSet(N,this,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!_classPrivateFieldGet(N,this))return;const[t,e]=_classPrivateFieldGet(N,this);_classPrivateFieldSet(N,this,null),e.addEventListener("focusin",(()=>{t._focusEventsAllowed=!0}),{once:!0}),e.focus()}addEditListeners(){_assertClassBrand(it,this,ot).call(this),_assertClassBrand(it,this,ct).call(this)}removeEditListeners(){_assertClassBrand(it,this,lt).call(this),_assertClassBrand(it,this,dt).call(this)}copy(t){var e;if(t.preventDefault(),null===(e=_classPrivateFieldGet(S,this))||void 0===e||e.commitOrRemove(),!this.hasSelection)return;const s=[];for(const i of _classPrivateFieldGet(j,this)){const t=i.serialize(!0);t&&s.push(t)}0!==s.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(s))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();const{clipboardData:e}=t;for(const n of e.items)for(const t of _classPrivateFieldGet(R,this))if(t.isHandlingMimeForPasting(n.type))return void t.paste(n,this.currentLayer);let s=e.getData("application/pdfjs");if(!s)return;try{s=JSON.parse(s)}catch(a){return void(0,n.warn)('paste: "'.concat(a.message,'".'))}if(!Array.isArray(s))return;this.unselectAll();const i=this.currentLayer;try{const t=[];for(const a of s){const e=i.deserialize(a);if(!e)return;t.push(e)}const e=()=>{for(const e of t)_assertClassBrand(it,this,gt).call(this,e);_assertClassBrand(it,this,_t).call(this,t)},n=()=>{for(const e of t)e.remove()};this.addCommands({cmd:e,undo:n,mustExec:!0})}catch(a){(0,n.warn)('paste: "'.concat(a.message,'".'))}}keydown(t){var e;null!==(e=this.getActive())&&void 0!==e&&e.shouldGetKeyboardEvents()||nt._keyboardManager.exec(this,t)}onEditingAction(t){["undo","redo","delete","selectAll"].includes(t.name)&&this[t.name]()}setEditingState(t){t?(_assertClassBrand(it,this,at).call(this),_assertClassBrand(it,this,ot).call(this),_assertClassBrand(it,this,ct).call(this),_assertClassBrand(it,this,ht).call(this,{isEditing:_classPrivateFieldGet(B,this)!==n.AnnotationEditorType.NONE,isEmpty:_assertClassBrand(it,this,vt).call(this),hasSomethingToUndo:_classPrivateFieldGet(E,this).hasSomethingToUndo(),hasSomethingToRedo:_classPrivateFieldGet(E,this).hasSomethingToRedo(),hasSelectedEditor:!1})):(_assertClassBrand(it,this,rt).call(this),_assertClassBrand(it,this,lt).call(this),_assertClassBrand(it,this,dt).call(this),_assertClassBrand(it,this,ht).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!_classPrivateFieldGet(R,this)){_classPrivateFieldSet(R,this,t);for(const t of _classPrivateFieldGet(R,this))_assertClassBrand(it,this,ut).call(this,t.defaultPropertiesToUpdate)}}getId(){return _classPrivateFieldGet(O,this).getId()}get currentLayer(){return _classPrivateFieldGet(w,this).get(_classPrivateFieldGet(k,this))}getLayer(t){return _classPrivateFieldGet(w,this).get(t)}get currentPageIndex(){return _classPrivateFieldGet(k,this)}addLayer(t){_classPrivateFieldGet(w,this).set(t.pageIndex,t),_classPrivateFieldGet(L,this)?t.enable():t.disable()}removeLayer(t){_classPrivateFieldGet(w,this).delete(t.pageIndex)}updateMode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(_classPrivateFieldGet(B,this)!==t){if(_classPrivateFieldSet(B,this,t),t===n.AnnotationEditorType.NONE)return this.setEditingState(!1),void _assertClassBrand(it,this,ft).call(this);this.setEditingState(!0),_assertClassBrand(it,this,pt).call(this),this.unselectAll();for(const e of _classPrivateFieldGet(w,this).values())e.updateMode(t);if(e)for(const t of _classPrivateFieldGet(F,this).values())if(t.annotationElementId===e){this.setSelected(t),t.enterInEditMode();break}}}updateToolbar(t){t!==_classPrivateFieldGet(B,this)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){if(_classPrivateFieldGet(R,this))if(t!==n.AnnotationEditorParamsType.CREATE){for(const s of _classPrivateFieldGet(j,this))s.updateParams(t,e);for(const s of _classPrivateFieldGet(R,this))s.updateDefaultParams(t,e)}else this.currentLayer.addNewEditor(t)}enableWaiting(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(_classPrivateFieldGet(G,this)!==t){_classPrivateFieldSet(G,this,t);for(const e of _classPrivateFieldGet(w,this).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}getEditors(t){const e=[];for(const s of _classPrivateFieldGet(F,this).values())s.pageIndex===t&&e.push(s);return e}getEditor(t){return _classPrivateFieldGet(F,this).get(t)}addEditor(t){_classPrivateFieldGet(F,this).set(t.id,t)}removeEditor(t){var e;_classPrivateFieldGet(F,this).delete(t.id),this.unselect(t),t.annotationElementId&&_classPrivateFieldGet(T,this).has(t.annotationElementId)||null===(e=_classPrivateFieldGet(C,this))||void 0===e||e.remove(t.id)}addDeletedAnnotationElement(t){_classPrivateFieldGet(T,this).add(t.annotationElementId),t.deleted=!0}isDeletedAnnotationElement(t){return _classPrivateFieldGet(T,this).has(t)}removeDeletedAnnotationElement(t){_classPrivateFieldGet(T,this).delete(t.annotationElementId),t.deleted=!1}setActiveEditor(t){_classPrivateFieldGet(S,this)!==t&&(_classPrivateFieldSet(S,this,t),t&&_assertClassBrand(it,this,ut).call(this,t.propertiesToUpdate))}toggleSelected(t){if(_classPrivateFieldGet(j,this).has(t))return _classPrivateFieldGet(j,this).delete(t),t.unselect(),void _assertClassBrand(it,this,ht).call(this,{hasSelectedEditor:this.hasSelection});_classPrivateFieldGet(j,this).add(t),t.select(),_assertClassBrand(it,this,ut).call(this,t.propertiesToUpdate),_assertClassBrand(it,this,ht).call(this,{hasSelectedEditor:!0})}setSelected(t){for(const e of _classPrivateFieldGet(j,this))e!==t&&e.unselect();_classPrivateFieldGet(j,this).clear(),_classPrivateFieldGet(j,this).add(t),t.select(),_assertClassBrand(it,this,ut).call(this,t.propertiesToUpdate),_assertClassBrand(it,this,ht).call(this,{hasSelectedEditor:!0})}isSelected(t){return _classPrivateFieldGet(j,this).has(t)}unselect(t){t.unselect(),_classPrivateFieldGet(j,this).delete(t),_assertClassBrand(it,this,ht).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==_classPrivateFieldGet(j,this).size}undo(){_classPrivateFieldGet(E,this).undo(),_assertClassBrand(it,this,ht).call(this,{hasSomethingToUndo:_classPrivateFieldGet(E,this).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:_assertClassBrand(it,this,vt).call(this)})}redo(){_classPrivateFieldGet(E,this).redo(),_assertClassBrand(it,this,ht).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:_classPrivateFieldGet(E,this).hasSomethingToRedo(),isEmpty:_assertClassBrand(it,this,vt).call(this)})}addCommands(t){_classPrivateFieldGet(E,this).add(t),_assertClassBrand(it,this,ht).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:_assertClassBrand(it,this,vt).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const t=[..._classPrivateFieldGet(j,this)];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)_assertClassBrand(it,this,gt).call(this,e)},mustExec:!0})}commitOrRemove(){var t;null===(t=_classPrivateFieldGet(S,this))||void 0===t||t.commitOrRemove()}hasSomethingToControl(){return _classPrivateFieldGet(S,this)||this.hasSelection}selectAll(){for(const t of _classPrivateFieldGet(j,this))t.commit();_assertClassBrand(it,this,_t).call(this,_classPrivateFieldGet(F,this).values())}unselectAll(){if(_classPrivateFieldGet(S,this))_classPrivateFieldGet(S,this).commitOrRemove();else if(this.hasSelection){for(const t of _classPrivateFieldGet(j,this))t.unselect();_classPrivateFieldGet(j,this).clear(),_assertClassBrand(it,this,ht).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove(),!this.hasSelection)return;_classPrivateFieldGet($,this)[0]+=t,_classPrivateFieldGet($,this)[1]+=e;const[s,i]=_classPrivateFieldGet($,this),n=[..._classPrivateFieldGet(j,this)];_classPrivateFieldGet(tt,this)&&clearTimeout(_classPrivateFieldGet(tt,this)),_classPrivateFieldSet(tt,this,setTimeout((()=>{_classPrivateFieldSet(tt,this,null),_classPrivateFieldGet($,this)[0]=_classPrivateFieldGet($,this)[1]=0,this.addCommands({cmd:()=>{for(const t of n)_classPrivateFieldGet(F,this).has(t.id)&&t.translateInPage(s,i)},undo:()=>{for(const t of n)_classPrivateFieldGet(F,this).has(t.id)&&t.translateInPage(-s,-i)},mustExec:!1})}),1e3));for(const a of n)a.translateInPage(t,e)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),_classPrivateFieldSet(M,this,new Map);for(const t of _classPrivateFieldGet(j,this))_classPrivateFieldGet(M,this).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!_classPrivateFieldGet(M,this))return!1;this.disableUserSelect(!1);const t=_classPrivateFieldGet(M,this);_classPrivateFieldSet(M,this,null);let e=!1;for(const[{x:i,y:n,pageIndex:a},r]of t)r.newX=i,r.newY=n,r.newPageIndex=a,e||(e=i!==r.savedX||n!==r.savedY||a!==r.savedPageIndex);if(!e)return!1;const s=(t,e,s,i)=>{if(_classPrivateFieldGet(F,this).has(t.id)){const n=_classPrivateFieldGet(w,this).get(i);n?t._setParentAndPosition(n,e,s):(t.pageIndex=i,t.x=e,t.y=s)}};return this.addCommands({cmd:()=>{for(const[e,{newX:i,newY:n,newPageIndex:a}]of t)s(e,i,n,a)},undo:()=>{for(const[e,{savedX:i,savedY:n,savedPageIndex:a}]of t)s(e,i,n,a)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(_classPrivateFieldGet(M,this))for(const s of _classPrivateFieldGet(M,this).keys())s.drag(t,e)}rebuild(t){if(null===t.parent){const e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}isActive(t){return _classPrivateFieldGet(S,this)===t}getActive(){return _classPrivateFieldGet(S,this)}getMode(){return _classPrivateFieldGet(B,this)}get imageManager(){return(0,n.shadow)(this,"imageManager",new u)}}function at(){window.addEventListener("focus",_classPrivateFieldGet(z,this)),window.addEventListener("blur",_classPrivateFieldGet(U,this))}function rt(){window.removeEventListener("focus",_classPrivateFieldGet(z,this)),window.removeEventListener("blur",_classPrivateFieldGet(U,this))}function ot(){window.addEventListener("keydown",_classPrivateFieldGet(X,this),{capture:!0})}function lt(){window.removeEventListener("keydown",_classPrivateFieldGet(X,this),{capture:!0})}function ct(){document.addEventListener("copy",_classPrivateFieldGet(q,this)),document.addEventListener("cut",_classPrivateFieldGet(H,this)),document.addEventListener("paste",_classPrivateFieldGet(V,this))}function dt(){document.removeEventListener("copy",_classPrivateFieldGet(q,this)),document.removeEventListener("cut",_classPrivateFieldGet(H,this)),document.removeEventListener("paste",_classPrivateFieldGet(V,this))}function ht(t){Object.entries(t).some((t=>{let[e,s]=t;return _classPrivateFieldGet(Z,this)[e]!==s}))&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(_classPrivateFieldGet(Z,this),t)})}function ut(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}function pt(){if(!_classPrivateFieldGet(L,this)){_classPrivateFieldSet(L,this,!0);for(const t of _classPrivateFieldGet(w,this).values())t.enable()}}function ft(){if(this.unselectAll(),_classPrivateFieldGet(L,this)){_classPrivateFieldSet(L,this,!1);for(const t of _classPrivateFieldGet(w,this).values())t.disable()}}function gt(t){const e=_classPrivateFieldGet(w,this).get(t.pageIndex);e?e.addOrRebuild(t):this.addEditor(t)}function vt(){if(0===_classPrivateFieldGet(F,this).size)return!0;if(1===_classPrivateFieldGet(F,this).size)for(const t of _classPrivateFieldGet(F,this).values())return t.isEmpty();return!1}function _t(t){_classPrivateFieldGet(j,this).clear();for(const e of t)e.isEmpty()||(_classPrivateFieldGet(j,this).add(e),e.select());_assertClassBrand(it,this,ht).call(this,{hasSelectedEditor:!0})}_defineProperty(nt,"TRANSLATE_SMALL",1),_defineProperty(nt,"TRANSLATE_BIG",10),e.AnnotationEditorUIManager=nt},(t,e,s)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.StatTimer=e.RenderingCancelledException=e.PixelsPerInch=e.PageViewport=e.PDFDateString=e.DOMStandardFontDataFactory=e.DOMSVGFactory=e.DOMFilterFactory=e.DOMCanvasFactory=e.DOMCMapReaderFactory=void 0,e.deprecated=function(t){console.log("Deprecated API usage: "+t)},e.getColorValues=function(t){const e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const s of t.keys()){e.style.color=s;const i=window.getComputedStyle(e).color;t.set(s,N(i))}e.remove()},e.getCurrentTransform=function(t){const{a:e,b:s,c:i,d:n,e:a,f:r}=t.getTransform();return[e,s,i,n,a,r]},e.getCurrentTransformInverse=function(t){const{a:e,b:s,c:i,d:n,e:a,f:r}=t.getTransform().invertSelf();return[e,s,i,n,a,r]},e.getFilenameFromUrl=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]||([t]=t.split(/[#?]/,1)),t.substring(t.lastIndexOf("/")+1)},e.getPdfFilenameFromUrl=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!==typeof t)return e;if(O(t))return(0,a.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const s=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,i=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let n=s.exec(i[1])||s.exec(i[2])||s.exec(i[3]);if(n&&(n=n[0],n.includes("%")))try{n=s.exec(decodeURIComponent(n))[0]}catch{}return n||e},e.getRGB=N,e.getXfaPageViewport=function(t,e){let{scale:s=1,rotation:i=0}=e;const{width:n,height:a}=t.attributes.style,r=[0,0,parseInt(n),parseInt(a)];return new I({viewBox:r,scale:s,rotation:i})},e.isDataScheme=O,e.isPdfFile=function(t){return"string"===typeof t&&/\.pdf$/i.test(t)},e.isValidFetchUrl=L,e.loadScript=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise(((s,i)=>{const n=document.createElement("script");n.src=t,n.onload=function(t){e&&n.remove(),s(t)},n.onerror=function(){i(new Error("Cannot load script at: ".concat(n.src)))},(document.head||document.documentElement).append(n)}))},e.noContextMenu=function(t){t.preventDefault()},e.setLayerDimensions=function(t,e){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e instanceof I){const{pageWidth:i,pageHeight:n}=e.rawDims,{style:r}=t,o=a.FeatureTest.isCSSRoundSupported,l="var(--scale-factor) * ".concat(i,"px"),c="var(--scale-factor) * ".concat(n,"px"),d=o?"round(".concat(l,", 1px)"):"calc(".concat(l,")"),h=o?"round(".concat(c,", 1px)"):"calc(".concat(c,")");s&&e.rotation%180!==0?(r.width=h,r.height=d):(r.width=d,r.height=h)}i&&t.setAttribute("data-main-rotation",e.rotation)};var n=s(7),a=s(1);const r="http://www.w3.org/2000/svg";class o{}i=o,_defineProperty(o,"CSS",96),_defineProperty(o,"PDF",72),_defineProperty(o,"PDF_TO_CSS_UNITS",i.CSS/i.PDF),e.PixelsPerInch=o;var l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,v=new WeakMap,_=new WeakMap,m=new WeakMap,b=new WeakSet;class y extends n.BaseFilterFactory{constructor(){let{docId:t,ownerDocument:e=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),_classPrivateMethodInitSpec(this,b),_classPrivateFieldInitSpec(this,l,void 0),_classPrivateFieldInitSpec(this,c,void 0),_classPrivateFieldInitSpec(this,d,void 0),_classPrivateFieldInitSpec(this,h,void 0),_classPrivateFieldInitSpec(this,u,void 0),_classPrivateFieldInitSpec(this,p,void 0),_classPrivateFieldInitSpec(this,f,void 0),_classPrivateFieldInitSpec(this,g,void 0),_classPrivateFieldInitSpec(this,v,void 0),_classPrivateFieldInitSpec(this,_,void 0),_classPrivateFieldInitSpec(this,m,0),_classPrivateFieldSet(d,this,t),_classPrivateFieldSet(h,this,e)}addFilter(t){var e,s;if(!t)return"none";let i,n,a,r,o=_classPrivateGetter(b,this,P).get(t);if(o)return o;if(1===t.length){const e=t[0],s=new Array(256);for(let t=0;t<256;t++)s[t]=e[t]/255;r=i=n=a=s.join(",")}else{const[e,s,o]=t,l=new Array(256),c=new Array(256),d=new Array(256);for(let t=0;t<256;t++)l[t]=e[t]/255,c[t]=s[t]/255,d[t]=o[t]/255;i=l.join(","),n=c.join(","),a=d.join(","),r="".concat(i).concat(n).concat(a)}if(o=_classPrivateGetter(b,this,P).get(r),o)return _classPrivateGetter(b,this,P).set(t,o),o;const l="g_".concat(_classPrivateFieldGet(d,this),"_transfer_map_").concat((_classPrivateFieldSet(m,this,(e=_classPrivateFieldGet(m,this),s=e++,e)),s)),c="url(#".concat(l,")");_classPrivateGetter(b,this,P).set(t,c),_classPrivateGetter(b,this,P).set(r,c);const h=_assertClassBrand(b,this,F).call(this,l);return _assertClassBrand(b,this,x).call(this,i,n,a,h),c}addHCMFilter(t,e){var s;const i="".concat(t,"-").concat(e);if(_classPrivateFieldGet(p,this)===i)return _classPrivateFieldGet(f,this);if(_classPrivateFieldSet(p,this,i),_classPrivateFieldSet(f,this,"none"),null===(s=_classPrivateFieldGet(u,this))||void 0===s||s.remove(),!t||!e)return _classPrivateFieldGet(f,this);const n=_assertClassBrand(b,this,C).call(this,t);t=a.Util.makeHexColor(...n);const r=_assertClassBrand(b,this,C).call(this,e);if(e=a.Util.makeHexColor(...r),_classPrivateGetter(b,this,A).style.color="","#000000"===t&&"#ffffff"===e||t===e)return _classPrivateFieldGet(f,this);const o=new Array(256);for(let a=0;a<=255;a++){const t=a/255;o[a]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const l=o.join(","),c="g_".concat(_classPrivateFieldGet(d,this),"_hcm_filter"),h=_classPrivateFieldSet(g,this,_assertClassBrand(b,this,F).call(this,c));_assertClassBrand(b,this,x).call(this,l,l,l,h),_assertClassBrand(b,this,S).call(this,h);const v=(t,e)=>{const s=n[t]/255,i=r[t]/255,a=new Array(e+1);for(let n=0;n<=e;n++)a[n]=s+n/e*(i-s);return a.join(",")};return _assertClassBrand(b,this,x).call(this,v(0,5),v(1,5),v(2,5),h),_classPrivateFieldSet(f,this,"url(#".concat(c,")")),_classPrivateFieldGet(f,this)}addHighlightHCMFilter(t,e,s,i){var n;const a="".concat(t,"-").concat(e,"-").concat(s,"-").concat(i);if(_classPrivateFieldGet(v,this)===a)return _classPrivateFieldGet(_,this);if(_classPrivateFieldSet(v,this,a),_classPrivateFieldSet(_,this,"none"),null===(n=_classPrivateFieldGet(g,this))||void 0===n||n.remove(),!t||!e)return _classPrivateFieldGet(_,this);const[r,o]=[t,e].map(_assertClassBrand(b,this,C).bind(this));let l=Math.round(.2126*r[0]+.7152*r[1]+.0722*r[2]),c=Math.round(.2126*o[0]+.7152*o[1]+.0722*o[2]),[h,u]=[s,i].map(_assertClassBrand(b,this,C).bind(this));c<l&&([l,c,h,u]=[c,l,u,h]),_classPrivateGetter(b,this,A).style.color="";const p=(t,e,s)=>{const i=new Array(256),n=(c-l)/s,a=t/255,r=(e-t)/(255*s);let o=0;for(let c=0;c<=s;c++){const t=Math.round(l+c*n),e=a+c*r;for(let s=o;s<=t;s++)i[s]=e;o=t+1}for(let l=o;l<256;l++)i[l]=i[o-1];return i.join(",")},f="g_".concat(_classPrivateFieldGet(d,this),"_hcm_highlight_filter"),m=_classPrivateFieldSet(g,this,_assertClassBrand(b,this,F).call(this,f));return _assertClassBrand(b,this,S).call(this,m),_assertClassBrand(b,this,x).call(this,p(h[0],u[0],5),p(h[1],u[1],5),p(h[2],u[2],5),m),_classPrivateFieldSet(_,this,"url(#".concat(f,")")),_classPrivateFieldGet(_,this)}destroy(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(_classPrivateFieldGet(f,this)||_classPrivateFieldGet(_,this))||(_classPrivateFieldGet(c,this)&&(_classPrivateFieldGet(c,this).parentNode.parentNode.remove(),_classPrivateFieldSet(c,this,null)),_classPrivateFieldGet(l,this)&&(_classPrivateFieldGet(l,this).clear(),_classPrivateFieldSet(l,this,null)),_classPrivateFieldSet(m,this,0))}}function P(t){return _classPrivateFieldGet(l,t)||_classPrivateFieldSet(l,t,new Map)}function A(t){if(!_classPrivateFieldGet(c,t)){const e=_classPrivateFieldGet(h,t).createElement("div"),{style:s}=e;s.visibility="hidden",s.contain="strict",s.width=s.height=0,s.position="absolute",s.top=s.left=0,s.zIndex=-1;const i=_classPrivateFieldGet(h,t).createElementNS(r,"svg");i.setAttribute("width",0),i.setAttribute("height",0),_classPrivateFieldSet(c,t,_classPrivateFieldGet(h,t).createElementNS(r,"defs")),e.append(i),i.append(_classPrivateFieldGet(c,t)),_classPrivateFieldGet(h,t).body.append(e)}return _classPrivateFieldGet(c,t)}function S(t){const e=_classPrivateFieldGet(h,this).createElementNS(r,"feColorMatrix");e.setAttribute("type","matrix"),e.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"),t.append(e)}function F(t){const e=_classPrivateFieldGet(h,this).createElementNS(r,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),_classPrivateGetter(b,this,A).append(e),e}function w(t,e,s){const i=_classPrivateFieldGet(h,this).createElementNS(r,e);i.setAttribute("type","discrete"),i.setAttribute("tableValues",s),t.append(i)}function x(t,e,s,i){const n=_classPrivateFieldGet(h,this).createElementNS(r,"feComponentTransfer");i.append(n),_assertClassBrand(b,this,w).call(this,n,"feFuncR",t),_assertClassBrand(b,this,w).call(this,n,"feFuncG",e),_assertClassBrand(b,this,w).call(this,n,"feFuncB",s)}function C(t){return _classPrivateGetter(b,this,A).style.color=t,N(getComputedStyle(_classPrivateGetter(b,this,A)).getPropertyValue("color"))}e.DOMFilterFactory=y;class E extends n.BaseCanvasFactory{constructor(){let{ownerDocument:t=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._document=t}_createCanvas(t,e){const s=this._document.createElement("canvas");return s.width=t,s.height=e,s}}async function k(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(L(t,document.baseURI)){const s=await fetch(t);if(!s.ok)throw new Error(s.statusText);return e?new Uint8Array(await s.arrayBuffer()):(0,a.stringToBytes)(await s.text())}return new Promise(((s,i)=>{const n=new XMLHttpRequest;n.open("GET",t,!0),e&&(n.responseType="arraybuffer"),n.onreadystatechange=()=>{if(n.readyState===XMLHttpRequest.DONE){if(200===n.status||0===n.status){let t;if(e&&n.response?t=new Uint8Array(n.response):!e&&n.responseText&&(t=(0,a.stringToBytes)(n.responseText)),t)return void s(t)}i(new Error(n.statusText))}},n.send(null)}))}e.DOMCanvasFactory=E;class T extends n.BaseCMapReaderFactory{_fetchData(t,e){return k(t,this.isCompressed).then((t=>({cMapData:t,compressionType:e})))}}e.DOMCMapReaderFactory=T;class M extends n.BaseStandardFontDataFactory{_fetchData(t){return k(t,!0)}}e.DOMStandardFontDataFactory=M;class R extends n.BaseSVGFactory{_createSVG(t){return document.createElementNS(r,t)}}e.DOMSVGFactory=R;class I{constructor(t){let{viewBox:e,scale:s,rotation:i,offsetX:n=0,offsetY:a=0,dontFlip:r=!1}=t;this.viewBox=e,this.scale=s,this.rotation=i,this.offsetX=n,this.offsetY=a;const o=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let c,d,h,u,p,f,g,v;switch(i%=360,i<0&&(i+=360),i){case 180:c=-1,d=0,h=0,u=1;break;case 90:c=0,d=1,h=1,u=0;break;case 270:c=0,d=-1,h=-1,u=0;break;case 0:c=1,d=0,h=0,u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}r&&(h=-h,u=-u),0===c?(p=Math.abs(l-e[1])*s+n,f=Math.abs(o-e[0])*s+a,g=(e[3]-e[1])*s,v=(e[2]-e[0])*s):(p=Math.abs(o-e[0])*s+n,f=Math.abs(l-e[1])*s+a,g=(e[2]-e[0])*s,v=(e[3]-e[1])*s),this.transform=[c*s,d*s,h*s,u*s,p-c*s*o-h*s*l,f-d*s*o-u*s*l],this.width=g,this.height=v}get rawDims(){const{viewBox:t}=this;return(0,a.shadow)(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone(){let{scale:t=this.scale,rotation:e=this.rotation,offsetX:s=this.offsetX,offsetY:i=this.offsetY,dontFlip:n=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new I({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:s,offsetY:i,dontFlip:n})}convertToViewportPoint(t,e){return a.Util.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=a.Util.applyTransform([t[0],t[1]],this.transform),s=a.Util.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],s[0],s[1]]}convertToPdfPoint(t,e){return a.Util.applyInverseTransform([t,e],this.transform)}}e.PageViewport=I;class D extends a.BaseException{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(t,"RenderingCancelledException"),this.extraDelay=e}}function O(t){const e=t.length;let s=0;for(;s<e&&""===t[s].trim();)s++;return"data:"===t.substring(s,s+5).toLowerCase()}function L(t,e){try{const{protocol:s}=e?new URL(t,e):new URL(t);return"http:"===s||"https:"===s}catch{return!1}}let G;function N(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map((t=>parseInt(t))):t.startsWith("rgba(")?t.slice(5,-1).split(",").map((t=>parseInt(t))).slice(0,3):((0,a.warn)('Not a valid color format: "'.concat(t,'"')),[0,0,0])}e.RenderingCancelledException=D,e.StatTimer=class{constructor(){_defineProperty(this,"started",Object.create(null)),_defineProperty(this,"times",[])}time(t){t in this.started&&(0,a.warn)("Timer is already running for ".concat(t)),this.started[t]=Date.now()}timeEnd(t){t in this.started||(0,a.warn)("Timer has not been started for ".concat(t)),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let e=0;for(const{name:s}of this.times)e=Math.max(s.length,e);for(const{name:s,start:i,end:n}of this.times)t.push("".concat(s.padEnd(e)," ").concat(n-i,"ms\n"));return t.join("")}},e.PDFDateString=class{static toDateObject(t){if(!t||"string"!==typeof t)return null;G||(G=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=G.exec(t);if(!e)return null;const s=parseInt(e[1],10);let i=parseInt(e[2],10);i=i>=1&&i<=12?i-1:0;let n=parseInt(e[3],10);n=n>=1&&n<=31?n:1;let a=parseInt(e[4],10);a=a>=0&&a<=23?a:0;let r=parseInt(e[5],10);r=r>=0&&r<=59?r:0;let o=parseInt(e[6],10);o=o>=0&&o<=59?o:0;const l=e[7]||"Z";let c=parseInt(e[8],10);c=c>=0&&c<=23?c:0;let d=parseInt(e[9],10)||0;return d=d>=0&&d<=59?d:0,"-"===l?(a+=c,r+=d):"+"===l&&(a-=c,r-=d),new Date(Date.UTC(s,i,n,a,r,o))}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseStandardFontDataFactory=e.BaseSVGFactory=e.BaseFilterFactory=e.BaseCanvasFactory=e.BaseCMapReaderFactory=void 0;var i=s(1);class n{constructor(){this.constructor===n&&(0,i.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addHighlightHCMFilter(t,e,s,i){return"none"}destroy(){}}e.BaseFilterFactory=n;class a{constructor(){this.constructor===a&&(0,i.unreachable)("Cannot initialize BaseCanvasFactory.")}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const s=this._createCanvas(t,e);return{canvas:s,context:s.getContext("2d")}}reset(t,e,s){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||s<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=s}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){(0,i.unreachable)("Abstract method `_createCanvas` called.")}}e.BaseCanvasFactory=a;class r{constructor(t){let{baseUrl:e=null,isCompressed:s=!0}=t;this.constructor===r&&(0,i.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=e,this.isCompressed=s}async fetch(t){let{name:e}=t;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const s=this.baseUrl+e+(this.isCompressed?".bcmap":""),n=this.isCompressed?i.CMapCompressionType.BINARY:i.CMapCompressionType.NONE;return this._fetchData(s,n).catch((t=>{throw new Error("Unable to load ".concat(this.isCompressed?"binary ":"","CMap at: ").concat(s))}))}_fetchData(t,e){(0,i.unreachable)("Abstract method `_fetchData` called.")}}e.BaseCMapReaderFactory=r;class o{constructor(t){let{baseUrl:e=null}=t;this.constructor===o&&(0,i.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=e}async fetch(t){let{filename:e}=t;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw new Error("Font filename must be specified.");const s="".concat(this.baseUrl).concat(e);return this._fetchData(s).catch((t=>{throw new Error("Unable to load font data at: ".concat(s))}))}_fetchData(t){(0,i.unreachable)("Abstract method `_fetchData` called.")}}e.BaseStandardFontDataFactory=o;class l{constructor(){this.constructor===l&&(0,i.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,e){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),s||(i.setAttribute("width","".concat(t,"px")),i.setAttribute("height","".concat(e,"px"))),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox","0 0 ".concat(t," ").concat(e)),i}createElement(t){if("string"!==typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){(0,i.unreachable)("Abstract method `_createSVG` called.")}}e.BaseSVGFactory=l},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MurmurHash3_64=void 0;var i=s(1);const n=3285377520,a=4294901760,r=65535;e.MurmurHash3_64=class{constructor(t){this.h1=t?4294967295&t:n,this.h2=t?4294967295&t:n}update(t){let e,s;if("string"===typeof t){e=new Uint8Array(2*t.length),s=0;for(let i=0,n=t.length;i<n;i++){const n=t.charCodeAt(i);n<=255?e[s++]=n:(e[s++]=n>>>8,e[s++]=255&n)}}else{if(!(0,i.isArrayBuffer)(t))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");e=t.slice(),s=e.byteLength}const n=s>>2,o=s-4*n,l=new Uint32Array(e.buffer,0,n);let c=0,d=0,h=this.h1,u=this.h2;const p=3432918353,f=461845907,g=11601,v=13715;for(let i=0;i<n;i++)1&i?(c=l[i],c=c*p&a|c*g&r,c=c<<15|c>>>17,c=c*f&a|c*v&r,h^=c,h=h<<13|h>>>19,h=5*h+3864292196):(d=l[i],d=d*p&a|d*g&r,d=d<<15|d>>>17,d=d*f&a|d*v&r,u^=d,u=u<<13|u>>>19,u=5*u+3864292196);switch(c=0,o){case 3:c^=e[4*n+2]<<16;case 2:c^=e[4*n+1]<<8;case 1:c^=e[4*n],c=c*p&a|c*g&r,c=c<<15|c>>>17,c=c*f&a|c*v&r,1&n?h^=c:u^=c}this.h1=h,this.h2=u}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&a|36045*t&r,e=4283543511*e&a|(2950163797*(e<<16|t>>>16)&a)>>>16,t^=e>>>1,t=444984403*t&a|60499*t&r,e=3301882366*e&a|(3120437893*(e<<16|t>>>16)&a)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FontLoader=e.FontFaceObject=void 0;var i=s(1),n=new WeakMap;e.FontLoader=class{constructor(t){let{ownerDocument:e=globalThis.document,styleElement:s=null}=t;_classPrivateFieldInitSpec(this,n,new Set),this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),_classPrivateFieldGet(n,this).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(t){if(t&&!_classPrivateFieldGet(n,this).has(t.loadedName))if((0,i.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:e,src:s,style:a}=t,r=new FontFace(e,s,a);this.addNativeFontFace(r);try{await r.load(),_classPrivateFieldGet(n,this).add(e)}catch{(0,i.warn)("Cannot load system font: ".concat(t.baseFontName,", installing it could help to improve PDF rendering.")),this.removeNativeFontFace(r)}}else(0,i.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo)return void await this.loadSystemFont(t.systemFontInfo);if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(s){throw(0,i.warn)("Failed to load font '".concat(e.family,"': '").concat(s,"'.")),t.disableFontFace=!0,s}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise((e=>{const s=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,s)}))}}get isFontLoadingAPISupported(){var t;const e=!(null===(t=this._document)||void 0===t||!t.fonts);return(0,i.shadow)(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){let t=!1;return(i.isNodeJS||"undefined"!==typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),(0,i.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const{loadingRequests:e}=this,s={done:!1,complete:function(){for((0,i.assert)(!s.done,"completeRequest() cannot be called twice."),s.done=!0;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.callback,0)}},callback:t};return e.push(s),s}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,i.shadow)(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){function s(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function n(t,e,s,i){return t.substring(0,e)+i+t.substring(e+s)}let a,r;const o=this._document.createElement("canvas");o.width=1,o.height=1;const l=o.getContext("2d");let c=0;const d="lt".concat(Date.now()).concat(this.loadTestFontId++);let h=this._loadTestFont;h=n(h,976,d.length,d);const u=1482184792;let p=s(h,16);for(a=0,r=d.length-3;a<r;a+=4)p=p-u+s(d,a)|0;a<d.length&&(p=p-u+s(d+"XXX",a)|0),h=n(h,16,4,(0,i.string32)(p));const f="url(data:font/opentype;base64,".concat(btoa(h),");"),g='@font-face {font-family:"'.concat(d,'";src:').concat(f,"}");this.insertRule(g);const v=this._document.createElement("div");v.style.visibility="hidden",v.style.width=v.style.height="10px",v.style.position="absolute",v.style.top=v.style.left="0px";for(const i of[t.loadedName,d]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=i,v.append(t)}this._document.body.append(v),function t(e,s){if(++c>30)return(0,i.warn)("Load test font never loaded."),void s();l.font="30px "+e,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0?s():setTimeout(t.bind(null,e,s))}(d,(()=>{v.remove(),e.complete()}))}},e.FontFaceObject=class{constructor(t,e){let{isEvalSupported:s=!0,disableFontFace:i=!1,ignoreErrors:n=!1,inspectFont:a=null}=e;this.compiledGlyphs=Object.create(null);for(const r in t)this[r]=t[r];this.isEvalSupported=!1!==s,this.disableFontFace=!0===i,this.ignoreErrors=!0===n,this._inspectFont=a}createNativeFontFace(){var t;if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style="oblique ".concat(this.cssFontInfo.italicAngle,"deg")),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return null===(t=this._inspectFont)||void 0===t||t.call(this,this),e}createFontFaceRule(){var t;if(!this.data||this.disableFontFace)return null;const e=(0,i.bytesToString)(this.data),s="url(data:".concat(this.mimetype,";base64,").concat(btoa(e),");");let n;if(this.cssFontInfo){let t="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(t+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;")),n='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(t,"src:").concat(s,"}")}else n='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(s,"}");return null===(t=this._inspectFont)||void 0===t||t.call(this,this,s),n}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let s;try{s=t.get(this.loadedName+"_path_"+e)}catch(n){if(!this.ignoreErrors)throw n;return(0,i.warn)('getPathGenerator - ignoring character: "'.concat(n,'".')),this.compiledGlyphs[e]=function(t,e){}}if(this.isEvalSupported&&i.FeatureTest.isEvalSupported){const t=[];for(const e of s){const s=void 0!==e.args?e.args.join(","):"";t.push("c.",e.cmd,"(",s,");\n")}return this.compiledGlyphs[e]=new Function("c","size",t.join(""))}return this.compiledGlyphs[e]=function(t,e){for(const i of s)"scale"===i.cmd&&(i.args=[e,-e]),t[i.cmd].apply(t,i.args)}}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NodeStandardFontDataFactory=e.NodeFilterFactory=e.NodeCanvasFactory=e.NodeCMapReaderFactory=void 0;var i=s(7);s(1);const n=function(t){return new Promise(((e,s)=>{__webpack_require__(23237).readFile(t,((t,i)=>{!t&&i?e(new Uint8Array(i)):s(new Error(t))}))}))};class a extends i.BaseFilterFactory{}e.NodeFilterFactory=a;class r extends i.BaseCanvasFactory{_createCanvas(t,e){return __webpack_require__(17640).createCanvas(t,e)}}e.NodeCanvasFactory=r;class o extends i.BaseCMapReaderFactory{_fetchData(t,e){return n(t).then((t=>({cMapData:t,compressionType:e})))}}e.NodeCMapReaderFactory=o;class l extends i.BaseStandardFontDataFactory{_fetchData(t){return n(t)}}e.NodeStandardFontDataFactory=l},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasGraphics=void 0;var i=s(1),n=s(6),a=s(12),r=s(13);const o=4096,l=16;class c{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,s){let i;return void 0!==this.cache[t]?(i=this.cache[t],this.canvasFactory.reset(i,e,s)):(i=this.canvasFactory.create(e,s),this.cache[t]=i),i}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function d(t,e,s,i,a,r,o,l,c,d){const[h,u,p,f,g,v]=(0,n.getCurrentTransform)(t);if(0===u&&0===p){const n=o*h+g,_=Math.round(n),m=l*f+v,b=Math.round(m),y=(o+c)*h+g,P=Math.abs(Math.round(y)-_)||1,A=(l+d)*f+v,S=Math.abs(Math.round(A)-b)||1;return t.setTransform(Math.sign(h),0,0,Math.sign(f),_,b),t.drawImage(e,s,i,a,r,0,0,P,S),t.setTransform(h,u,p,f,g,v),[P,S]}if(0===h&&0===f){const n=l*p+g,_=Math.round(n),m=o*u+v,b=Math.round(m),y=(l+d)*p+g,P=Math.abs(Math.round(y)-_)||1,A=(o+c)*u+v,S=Math.abs(Math.round(A)-b)||1;return t.setTransform(0,Math.sign(u),Math.sign(p),0,_,b),t.drawImage(e,s,i,a,r,0,0,S,P),t.setTransform(h,u,p,f,g,v),[S,P]}return t.drawImage(e,s,i,a,r,o,l,c,d),[Math.hypot(h,u)*c,Math.hypot(p,f)*d]}class h{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=i.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=i.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=i.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,t,e])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,e){this.x=t,this.y=e}updatePathMinMax(t,e,s){[e,s]=i.Util.applyTransform([e,s],t),this.minX=Math.min(this.minX,e),this.minY=Math.min(this.minY,s),this.maxX=Math.max(this.maxX,e),this.maxY=Math.max(this.maxY,s)}updateRectMinMax(t,e){const s=i.Util.applyTransform(e,t),n=i.Util.applyTransform(e.slice(2),t);this.minX=Math.min(this.minX,s[0],n[0]),this.minY=Math.min(this.minY,s[1],n[1]),this.maxX=Math.max(this.maxX,s[0],n[0]),this.maxY=Math.max(this.maxY,s[1],n[1])}updateScalingPathMinMax(t,e){i.Util.scaleMinMax(t,e),this.minX=Math.min(this.minX,e[0]),this.maxX=Math.max(this.maxX,e[1]),this.minY=Math.min(this.minY,e[2]),this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,s,n,a,r,o,l,c,d){const h=i.Util.bezierBoundingBox(e,s,n,a,r,o,l,c);if(d)return d[0]=Math.min(d[0],h[0],h[2]),d[1]=Math.max(d[1],h[0],h[2]),d[2]=Math.min(d[2],h[1],h[3]),void(d[3]=Math.max(d[3],h[1],h[3]));this.updateRectMinMax(t,h)}getPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.PathType.FILL,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const s=[this.minX,this.minY,this.maxX,this.maxY];if(t===a.PathType.STROKE){e||(0,i.unreachable)("Stroke bounding box must include transform.");const t=i.Util.singularValueDecompose2dScale(e),n=t[0]*this.lineWidth/2,a=t[1]*this.lineWidth/2;s[0]-=n,s[1]-=a,s[2]+=n,s[3]+=a}return s}updateClipFromPath(){const t=i.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.PathType.FILL,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return i.Util.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function u(t,e){if("undefined"!==typeof ImageData&&e instanceof ImageData)return void t.putImageData(e,0,0);const s=e.height,n=e.width,a=s%l,r=(s-a)/l,o=0===a?r:r+1,c=t.createImageData(n,l);let d,h=0;const u=e.data,p=c.data;let f,g,v,_;if(e.kind===i.ImageKind.GRAYSCALE_1BPP){const e=u.byteLength,s=new Uint32Array(p.buffer,0,p.byteLength>>2),_=s.length,m=n+7>>3,b=4294967295,y=i.FeatureTest.isLittleEndian?4278190080:255;for(f=0;f<o;f++){for(v=f<r?l:a,d=0,g=0;g<v;g++){const t=e-h;let i=0;const a=t>m?n:8*t-7,r=-8&a;let o=0,l=0;for(;i<r;i+=8)l=u[h++],s[d++]=128&l?b:y,s[d++]=64&l?b:y,s[d++]=32&l?b:y,s[d++]=16&l?b:y,s[d++]=8&l?b:y,s[d++]=4&l?b:y,s[d++]=2&l?b:y,s[d++]=1&l?b:y;for(;i<a;i++)0===o&&(l=u[h++],o=128),s[d++]=l&o?b:y,o>>=1}for(;d<_;)s[d++]=0;t.putImageData(c,0,f*l)}}else if(e.kind===i.ImageKind.RGBA_32BPP){for(g=0,_=n*l*4,f=0;f<r;f++)p.set(u.subarray(h,h+_)),h+=_,t.putImageData(c,0,g),g+=l;f<o&&(_=n*a*4,p.set(u.subarray(h,h+_)),t.putImageData(c,0,g))}else{if(e.kind!==i.ImageKind.RGB_24BPP)throw new Error("bad image kind: ".concat(e.kind));for(v=l,_=n*v,f=0;f<o;f++){for(f>=r&&(v=a,_=n*v),d=0,g=_;g--;)p[d++]=u[h++],p[d++]=u[h++],p[d++]=u[h++],p[d++]=255;t.putImageData(c,0,f*l)}}}function p(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const s=e.height,i=e.width,n=s%l,a=(s-n)/l,o=0===n?a:a+1,c=t.createImageData(i,l);let d=0;const h=e.data,u=c.data;for(let p=0;p<o;p++){const e=p<a?l:n;({srcPos:d}=(0,r.convertBlackAndWhiteToRGBA)({src:h,srcPos:d,dest:u,width:i,height:e,nonBlackColor:0})),t.putImageData(c,0,p*l)}}function f(t,e){const s=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const i of s)void 0!==t[i]&&(e[i]=t[i]);void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function g(t){if(t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0),!i.isNodeJS){const{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}}function v(t,e,s,i){const n=t.length;for(let a=3;a<n;a+=4){const n=t[a];if(0===n)t[a-3]=e,t[a-2]=s,t[a-1]=i;else if(n<255){const r=255-n;t[a-3]=t[a-3]*n+e*r>>8,t[a-2]=t[a-2]*n+s*r>>8,t[a-1]=t[a-1]*n+i*r>>8}}}function _(t,e,s){const i=t.length,n=1/255;for(let a=3;a<i;a+=4){const i=s?s[t[a]]:t[a];e[a]=e[a]*i*n|0}}function m(t,e,s){const i=t.length;for(let n=3;n<i;n+=4){const i=77*t[n-3]+152*t[n-2]+28*t[n-1];e[n]=s?e[n]*s[i>>8]>>8:e[n]*i>>16}}function b(t,e,s,i){const n=i[0],a=i[1],r=i[2]-n,o=i[3]-a;0!==r&&0!==o&&(function(t,e,s,i,n,a,r,o,l,c,d){const h=!!a,u=h?a[0]:0,p=h?a[1]:0,f=h?a[2]:0,g="Luminosity"===n?m:_,b=Math.min(i,Math.ceil(1048576/s));for(let _=0;_<i;_+=b){const n=Math.min(b,i-_),a=t.getImageData(o-c,_+(l-d),s,n),m=e.getImageData(o,_+l,s,n);h&&v(a.data,u,p,f),g(a.data,m.data,r),e.putImageData(m,o,_+l)}}(e.context,s,r,o,e.subtype,e.backdrop,e.transferMap,n,a,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(s.canvas,0,0),t.restore())}function y(t,e){const s=i.Util.singularValueDecompose2dScale(t);s[0]=Math.fround(s[0]),s[1]=Math.fround(s[1]);const a=Math.fround((globalThis.devicePixelRatio||1)*n.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==e?e:s[0]<=a||s[1]<=a}const P=["butt","round","square"],A=["miter","round","bevel"],S={},F={};var w=new WeakSet;class x{constructor(t,e,s,i,n,a,r,o){let{optionalContentConfig:l,markedContentStack:d=null}=a;_classPrivateMethodInitSpec(this,w),this.ctx=t,this.current=new h(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=s,this.canvasFactory=i,this.filterFactory=n,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=d||[],this.optionalContentConfig=l,this.cachedCanvases=new c(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=r,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=o,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"===typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing(t){let{transform:e,viewport:s,transparency:i=!1,background:a=null}=t;const r=this.ctx.canvas.width,o=this.ctx.canvas.height,l=this.ctx.fillStyle;if(this.ctx.fillStyle=a||"#ffffff",this.ctx.fillRect(0,0,r,o),this.ctx.fillStyle=l,i){const t=this.cachedCanvases.getCanvas("transparent",r,o);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...(0,n.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),g(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...s.transform),this.viewportScale=s.scale,this.baseTransform=(0,n.getCurrentTransform)(this.ctx)}executeOperatorList(t,e,s,n){const a=t.argsArray,r=t.fnArray;let o=e||0;const l=a.length;if(l===o)return o;const c=l-o>10&&"function"===typeof s,d=c?Date.now()+15:0;let h=0;const u=this.commonObjs,p=this.objs;let f;for(;;){if(void 0!==n&&o===n.nextBreakPoint)return n.breakIt(o,s),o;if(f=r[o],f!==i.OPS.dependency)this[f].apply(this,a[o]);else for(const t of a[o]){const e=t.startsWith("g_")?u:p;if(!e.has(t))return e.get(t,s),o}if(o++,o===l)return o;if(c&&++h>10){if(Date.now()>d)return s(),o;h=0}}}endDrawing(){_assertClassBrand(w,this,C).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),_assertClassBrand(w,this,E).call(this)}_scaleImage(t,e){const s=t.width,i=t.height;let n,a,r=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=s,c=i,d="prescale1";for(;r>2&&l>1||o>2&&c>1;){let e=l,s=c;r>2&&l>1&&(e=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),r/=l/e),o>2&&c>1&&(s=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,o/=c/s),n=this.cachedCanvases.getCanvas(d,e,s),a=n.context,a.clearRect(0,0,e,s),a.drawImage(t,0,0,l,c,0,0,e,s),t=n.canvas,l=e,c=s,d="prescale1"===d?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:c}}_createMaskCanvas(t){const e=this.ctx,{width:s,height:r}=t,o=this.current.fillColor,l=this.current.patternFill,c=(0,n.getCurrentTransform)(e);let h,u,f,g;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer;u=JSON.stringify(l?c:[c.slice(0,4),o]),h=this._cachedBitmapsMap.get(e),h||(h=new Map,this._cachedBitmapsMap.set(e,h));const s=h.get(u);if(s&&!l)return{canvas:s,offsetX:Math.round(Math.min(c[0],c[2])+c[4]),offsetY:Math.round(Math.min(c[1],c[3])+c[5])};f=s}f||(g=this.cachedCanvases.getCanvas("maskCanvas",s,r),p(g.context,t));let v=i.Util.transform(c,[1/s,0,0,-1/r,0,0]);v=i.Util.transform(v,[1,0,0,1,0,-r]);const _=i.Util.applyTransform([0,0],v),m=i.Util.applyTransform([s,r],v),b=i.Util.normalizeRect([_[0],_[1],m[0],m[1]]),P=Math.round(b[2]-b[0])||1,A=Math.round(b[3]-b[1])||1,S=this.cachedCanvases.getCanvas("fillCanvas",P,A),F=S.context,w=Math.min(_[0],m[0]),x=Math.min(_[1],m[1]);F.translate(-w,-x),F.transform(...v),f||(f=this._scaleImage(g.canvas,(0,n.getCurrentTransformInverse)(F)),f=f.img,h&&l&&h.set(u,f)),F.imageSmoothingEnabled=y((0,n.getCurrentTransform)(F),t.interpolate),d(F,f,0,0,f.width,f.height,0,0,s,r),F.globalCompositeOperation="source-in";const C=i.Util.transform((0,n.getCurrentTransformInverse)(F),[1,0,0,1,-w,-x]);return F.fillStyle=l?o.getPattern(e,this,C,a.PathType.FILL):o,F.fillRect(0,0,s,r),h&&!l&&(this.cachedCanvases.delete("fillCanvas"),h.set(u,S.canvas)),{canvas:S.canvas,offsetX:Math.round(w),offsetY:Math.round(x)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=P[t]}setLineJoin(t){this.ctx.lineJoin=A[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const s=this.ctx;void 0!==s.setLineDash&&(s.setLineDash(t),s.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,s]of t)switch(e){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)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,s="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(s,t,e);this.suspendedCtx=this.ctx,this.ctx=i.context;const a=this.ctx;a.setTransform(...(0,n.getCurrentTransform)(this.suspendedCtx)),f(this.suspendedCtx,a),function(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(t,s){e.translate(t,s),this.__originalTranslate(t,s)},t.scale=function(t,s){e.scale(t,s),this.__originalScale(t,s)},t.transform=function(t,s,i,n,a,r){e.transform(t,s,i,n,a,r),this.__originalTransform(t,s,i,n,a,r)},t.setTransform=function(t,s,i,n,a,r){e.setTransform(t,s,i,n,a,r),this.__originalSetTransform(t,s,i,n,a,r)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(t){e.rotate(t),this.__originalRotate(t)},t.clip=function(t){e.clip(t),this.__originalClip(t)},t.moveTo=function(t,s){e.moveTo(t,s),this.__originalMoveTo(t,s)},t.lineTo=function(t,s){e.lineTo(t,s),this.__originalLineTo(t,s)},t.bezierCurveTo=function(t,s,i,n,a,r){e.bezierCurveTo(t,s,i,n,a,r),this.__originalBezierCurveTo(t,s,i,n,a,r)},t.rect=function(t,s,i,n){e.rect(t,s,i,n),this.__originalRect(t,s,i,n)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}(a,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(),f(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask;b(this.suspendedCtx,e,this.ctx,t),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?(f(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),f(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,e,s,i,n,a){this.ctx.transform(t,e,s,i,n,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,s){const a=this.ctx,r=this.current;let o,l,c=r.x,d=r.y;const h=(0,n.getCurrentTransform)(a),u=0===h[0]&&0===h[3]||0===h[1]&&0===h[2],p=u?s.slice(0):null;for(let n=0,f=0,g=t.length;n<g;n++)switch(0|t[n]){case i.OPS.rectangle:c=e[f++],d=e[f++];const t=e[f++],s=e[f++],n=c+t,g=d+s;a.moveTo(c,d),0===t||0===s?a.lineTo(n,g):(a.lineTo(n,d),a.lineTo(n,g),a.lineTo(c,g)),u||r.updateRectMinMax(h,[c,d,n,g]),a.closePath();break;case i.OPS.moveTo:c=e[f++],d=e[f++],a.moveTo(c,d),u||r.updatePathMinMax(h,c,d);break;case i.OPS.lineTo:c=e[f++],d=e[f++],a.lineTo(c,d),u||r.updatePathMinMax(h,c,d);break;case i.OPS.curveTo:o=c,l=d,c=e[f+4],d=e[f+5],a.bezierCurveTo(e[f],e[f+1],e[f+2],e[f+3],c,d),r.updateCurvePathMinMax(h,o,l,e[f],e[f+1],e[f+2],e[f+3],c,d,p),f+=6;break;case i.OPS.curveTo2:o=c,l=d,a.bezierCurveTo(c,d,e[f],e[f+1],e[f+2],e[f+3]),r.updateCurvePathMinMax(h,o,l,c,d,e[f],e[f+1],e[f+2],e[f+3],p),c=e[f+2],d=e[f+3],f+=4;break;case i.OPS.curveTo3:o=c,l=d,c=e[f+2],d=e[f+3],a.bezierCurveTo(e[f],e[f+1],c,d,c,d),r.updateCurvePathMinMax(h,o,l,e[f],e[f+1],c,d,c,d,p),f+=4;break;case i.OPS.closePath:a.closePath()}u&&r.updateScalingPathMinMax(h,p),r.setCurrentPoint(c,d)}closePath(){this.ctx.closePath()}stroke(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,s=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"===typeof s&&null!==s&&void 0!==s&&s.getPattern?(e.save(),e.strokeStyle=s.getPattern(e,this,(0,n.getCurrentTransformInverse)(e),a.PathType.STROKE),this.rescaleAndStroke(!1),e.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,s=this.current.fillColor;let i=!1;this.current.patternFill&&(e.save(),e.fillStyle=s.getPattern(e,this,(0,n.getCurrentTransformInverse)(e),a.PathType.FILL),i=!0);const r=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==r&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),i&&e.restore(),t&&this.consumePath(r)}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=S}eoClip(){this.pendingClip=F}beginText(){this.current.textMatrix=i.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save(),e.beginPath();for(const s of t)e.setTransform(...s.transform),e.translate(s.x,s.y),s.addToPath(e,s.fontSize);e.restore(),e.clip(),e.beginPath(),delete this.pendingTextPaths}else e.beginPath()}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){var s;const n=this.commonObjs.get(t),a=this.current;if(!n)throw new Error("Can't find font for ".concat(t));if(a.fontMatrix=n.fontMatrix||i.FONT_IDENTITY_MATRIX,0!==a.fontMatrix[0]&&0!==a.fontMatrix[3]||(0,i.warn)("Invalid font matrix for font "+t),e<0?(e=-e,a.fontDirection=-1):a.fontDirection=1,this.current.font=n,this.current.fontSize=e,n.isType3Font)return;const r=n.loadedName||"sans-serif",o=(null===(s=n.systemFontInfo)||void 0===s?void 0:s.css)||'"'.concat(r,'", ').concat(n.fallbackName);let l="normal";n.black?l="900":n.bold&&(l="bold");const c=n.italic?"italic":"normal";let d=e;e<16?d=16:e>100&&(d=100),this.current.fontSizeScale=e/d,this.ctx.font="".concat(c," ").concat(l," ").concat(d,"px ").concat(o)}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t,e,s,i,n,a){this.current.textMatrix=[t,e,s,i,n,a],this.current.textMatrixScale=Math.hypot(t,e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,s,a){const r=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,d=o.fontSize/o.fontSizeScale,h=c&i.TextRenderingMode.FILL_STROKE_MASK,u=!!(c&i.TextRenderingMode.ADD_TO_PATH_FLAG),p=o.patternFill&&!l.missingFile;let f;(l.disableFontFace||u||p)&&(f=l.getPathGenerator(this.commonObjs,t)),l.disableFontFace||p?(r.save(),r.translate(e,s),r.beginPath(),f(r,d),a&&r.setTransform(...a),h!==i.TextRenderingMode.FILL&&h!==i.TextRenderingMode.FILL_STROKE||r.fill(),h!==i.TextRenderingMode.STROKE&&h!==i.TextRenderingMode.FILL_STROKE||r.stroke(),r.restore()):(h!==i.TextRenderingMode.FILL&&h!==i.TextRenderingMode.FILL_STROKE||r.fillText(t,e,s),h!==i.TextRenderingMode.STROKE&&h!==i.TextRenderingMode.FILL_STROKE||r.strokeText(t,e,s)),u&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,n.getCurrentTransform)(r),x:e,y:s,fontSize:d,addToPath:f})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let s=!1;for(let i=3;i<e.length;i+=4)if(e[i]>0&&e[i]<255){s=!0;break}return(0,i.shadow)(this,"isFontSubpixelAAEnabled",s)}showText(t){const e=this.current,s=e.font;if(s.isType3Font)return this.showType3Text(t);const r=e.fontSize;if(0===r)return;const o=this.ctx,l=e.fontSizeScale,c=e.charSpacing,d=e.wordSpacing,h=e.fontDirection,u=e.textHScale*h,p=t.length,f=s.vertical,g=f?1:-1,v=s.defaultVMetrics,_=r*e.fontMatrix[0],m=e.textRenderingMode===i.TextRenderingMode.FILL&&!s.disableFontFace&&!e.patternFill;let b;if(o.save(),o.transform(...e.textMatrix),o.translate(e.x,e.y+e.textRise),h>0?o.scale(u,-1):o.scale(u,1),e.patternFill){o.save();const t=e.fillColor.getPattern(o,this,(0,n.getCurrentTransformInverse)(o),a.PathType.FILL);b=(0,n.getCurrentTransform)(o),o.restore(),o.fillStyle=t}let y=e.lineWidth;const P=e.textMatrixScale;if(0===P||0===y){const t=e.textRenderingMode&i.TextRenderingMode.FILL_STROKE_MASK;t!==i.TextRenderingMode.STROKE&&t!==i.TextRenderingMode.FILL_STROKE||(y=this.getSinglePixelWidth())}else y/=P;if(1!==l&&(o.scale(l,l),y/=l),o.lineWidth=y,s.isInvalidPDFjsFont){const s=[];let i=0;for(const e of t)s.push(e.unicode),i+=e.width;return o.fillText(s.join(""),0,0),e.x+=i*_*u,o.restore(),void this.compose()}let A,S=0;for(A=0;A<p;++A){const e=t[A];if("number"===typeof e){S+=g*e*r/1e3;continue}let i=!1;const n=(e.isSpace?d:0)+c,a=e.fontChar,u=e.accent;let p,y,P=e.width;if(f){const t=e.vmetric||v,s=-(e.vmetric?t[1]:.5*P)*_,i=t[2]*_;P=t?-t[0]:P,p=s/l,y=(S+i)/l}else p=S/l,y=0;if(s.remeasure&&P>0){const t=1e3*o.measureText(a).width/r*l;if(P<t&&this.isFontSubpixelAAEnabled){const e=P/t;i=!0,o.save(),o.scale(e,1),p/=e}else P!==t&&(p+=(P-t)/2e3*r/l)}if(this.contentVisible&&(e.isInFont||s.missingFile))if(m&&!u)o.fillText(a,p,y);else if(this.paintChar(a,p,y,b),u){const t=p+r*u.offset.x/l,e=y-r*u.offset.y/l;this.paintChar(u.fontChar,t,e,b)}S+=f?P*_-n*h:P*_+n*h,i&&o.restore()}f?e.y-=S:e.x+=S*u,o.restore(),this.compose()}showType3Text(t){const e=this.ctx,s=this.current,n=s.font,a=s.fontSize,r=s.fontDirection,o=n.vertical?1:-1,l=s.charSpacing,c=s.wordSpacing,d=s.textHScale*r,h=s.fontMatrix||i.FONT_IDENTITY_MATRIX,u=t.length;let p,f,g,v;if(s.textRenderingMode!==i.TextRenderingMode.INVISIBLE&&0!==a){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,e.save(),e.transform(...s.textMatrix),e.translate(s.x,s.y),e.scale(d,r),p=0;p<u;++p){if(f=t[p],"number"===typeof f){v=o*f*a/1e3,this.ctx.translate(v,0),s.x+=v*d;continue}const r=(f.isSpace?c:0)+l,u=n.charProcOperatorList[f.operatorListId];u?(this.contentVisible&&(this.processingType3=f,this.save(),e.scale(a,a),e.transform(...h),this.executeOperatorList(u),this.restore()),g=i.Util.applyTransform([f.width,0],h)[0]*a+r,e.translate(g,0),s.x+=g*d):(0,i.warn)('Type3 character "'.concat(f.operatorListId,'" is not available.'))}e.restore(),this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,s,i,n,a){this.ctx.rect(s,i,n-s,a-i),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){const s=t[1],i=this.baseTransform||(0,n.getCurrentTransform)(this.ctx),r={createCanvasGraphics:t=>new x(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new a.TilingPattern(t,s,this.ctx,r,i)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,e,s){const n=i.Util.makeHexColor(t,e,s);this.ctx.strokeStyle=n,this.current.strokeColor=n}setFillRGBColor(t,e,s){const n=i.Util.makeHexColor(t,e,s);this.ctx.fillStyle=n,this.current.fillColor=n,this.current.patternFill=!1}_getPattern(t){let e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.cachedPatterns.has(t)?e=this.cachedPatterns.get(t):(e=(0,a.getShadingPattern)(this.getObject(t)),this.cachedPatterns.set(t,e)),s&&(e.matrix=s),e}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const s=this._getPattern(t);e.fillStyle=s.getPattern(e,this,(0,n.getCurrentTransformInverse)(e),a.PathType.SHADING);const r=(0,n.getCurrentTransformInverse)(e);if(r){const{width:t,height:s}=e.canvas,[n,a,o,l]=i.Util.getAxialAlignedBoundingBox([0,0,t,s],r);this.ctx.fillRect(n,a,o-n,l-a)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,i.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,i.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(t)&&6===t.length&&this.transform(...t),this.baseTransform=(0,n.getCurrentTransform)(this.ctx),e)){const t=e[2]-e[0],s=e[3]-e[1];this.ctx.rect(e[0],e[1],t,s),this.current.updateRectMinMax((0,n.getCurrentTransform)(this.ctx),e),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const e=this.ctx;t.isolated||(0,i.info)("TODO: Support non-isolated groups."),t.knockout&&(0,i.warn)("Knockout groups not supported.");const s=(0,n.getCurrentTransform)(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let a=i.Util.getAxialAlignedBoundingBox(t.bbox,(0,n.getCurrentTransform)(e));const r=[0,0,e.canvas.width,e.canvas.height];a=i.Util.intersect(a,r)||[0,0,0,0];const l=Math.floor(a[0]),c=Math.floor(a[1]);let d=Math.max(Math.ceil(a[2])-l,1),h=Math.max(Math.ceil(a[3])-c,1),u=1,p=1;d>o&&(u=d/o,d=o),h>o&&(p=h/o,h=o),this.current.startNewPathAndClipBox([0,0,d,h]);let g="groupAt"+this.groupLevel;t.smask&&(g+="_smask_"+this.smaskCounter++%2);const v=this.cachedCanvases.getCanvas(g,d,h),_=v.context;_.scale(1/u,1/p),_.translate(-l,-c),_.transform(...s),t.smask?this.smaskStack.push({canvas:v.canvas,context:_,offsetX:l,offsetY:c,scaleX:u,scaleY:p,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(l,c),e.scale(u,p),e.save()),f(e,_),this.ctx=_,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,s=this.groupStack.pop();if(this.ctx=s,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const t=(0,n.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);const s=i.Util.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(s)}}beginAnnotation(t,e,s,a,r){if(_assertClassBrand(w,this,C).call(this),g(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(e)&&4===e.length){const a=e[2]-e[0],o=e[3]-e[1];if(r&&this.annotationCanvasMap){(s=s.slice())[4]-=e[0],s[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=a,e[3]=o;const[r,l]=i.Util.singularValueDecompose2dScale((0,n.getCurrentTransform)(this.ctx)),{viewportScale:c}=this,d=Math.ceil(a*this.outputScaleX*c),h=Math.ceil(o*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(d,h);const{canvas:u,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(t,u),this.annotationCanvas.savedCtx=this.ctx,this.ctx=p,this.ctx.save(),this.ctx.setTransform(r,0,0,-l,0,o*l),g(this.ctx)}else g(this.ctx),this.ctx.rect(e[0],e[1],a,o),this.ctx.clip(),this.endPath()}this.current=new h(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...s),this.transform(...a)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),_assertClassBrand(w,this,E).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;(t=this.getObject(t.data,t)).count=e;const s=this.ctx,i=this.processingType3;if(i&&(void 0===i.compiled&&(i.compiled=function(t){const{width:e,height:s}=t;if(e>1e3||s>1e3)return null;const i=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),n=e+1;let a,r,o,l=new Uint8Array(n*(s+1));const c=e+7&-8;let d=new Uint8Array(c*s),h=0;for(const g of t.data){let t=128;for(;t>0;)d[h++]=g&t?0:255,t>>=1}let u=0;for(h=0,0!==d[h]&&(l[0]=1,++u),r=1;r<e;r++)d[h]!==d[h+1]&&(l[r]=d[h]?2:1,++u),h++;for(0!==d[h]&&(l[r]=2,++u),a=1;a<s;a++){h=a*c,o=a*n,d[h-c]!==d[h]&&(l[o]=d[h]?1:8,++u);let t=(d[h]?4:0)+(d[h-c]?8:0);for(r=1;r<e;r++)t=(t>>2)+(d[h+1]?4:0)+(d[h-c+1]?8:0),i[t]&&(l[o+r]=i[t],++u),h++;if(d[h-c]!==d[h]&&(l[o+r]=d[h]?2:4,++u),u>1e3)return null}for(h=c*(s-1),o=a*n,0!==d[h]&&(l[o]=8,++u),r=1;r<e;r++)d[h]!==d[h+1]&&(l[o+r]=d[h]?4:8,++u),h++;if(0!==d[h]&&(l[o+r]=4,++u),u>1e3)return null;const p=new Int32Array([0,n,-1,0,-n,0,0,0,1]),f=new Path2D;for(a=0;u&&a<=s;a++){let t=a*n;const s=t+e;for(;t<s&&!l[t];)t++;if(t===s)continue;f.moveTo(t%n,a);const i=t;let r=l[t];do{const e=p[r];do{t+=e}while(!l[t]);const s=l[t];5!==s&&10!==s?(r=s,l[t]=0):(r=s&51*r>>4,l[t]&=r>>2|r<<2),f.lineTo(t%n,t/n|0),l[t]||--u}while(i!==t);--a}return d=null,l=null,function(t){t.save(),t.scale(1/e,-1/s),t.translate(0,-s),t.fill(f),t.beginPath(),t.restore()}}(t)),i.compiled))return void i.compiled(s);const n=this._createMaskCanvas(t),a=n.canvas;s.save(),s.setTransform(1,0,0,1,0,0),s.drawImage(a,n.offsetX,n.offsetY),s.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;t=this.getObject(t.data,t);const l=this.ctx;l.save();const c=(0,n.getCurrentTransform)(l);l.transform(e,s,a,r,0,0);const d=this._createMaskCanvas(t);l.setTransform(1,0,0,1,d.offsetX-c[4],d.offsetY-c[5]);for(let n=0,h=o.length;n<h;n+=2){const t=i.Util.transform(c,[e,s,a,r,o[n],o[n+1]]),[h,u]=i.Util.applyTransform([0,0],t);l.drawImage(d.canvas,h,u)}l.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,s=this.current.fillColor,i=this.current.patternFill;for(const r of t){const{data:t,width:o,height:l,transform:c}=r,h=this.cachedCanvases.getCanvas("maskCanvas",o,l),u=h.context;u.save(),p(u,this.getObject(t,r)),u.globalCompositeOperation="source-in",u.fillStyle=i?s.getPattern(u,this,(0,n.getCurrentTransformInverse)(e),a.PathType.FILL):s,u.fillRect(0,0,o,l),u.restore(),e.save(),e.transform(...c),e.scale(1,-1),d(e,h.canvas,0,0,o,l,0,-1,1,1),e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);e?this.paintInlineImageXObject(e):(0,i.warn)("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,s,n){if(!this.contentVisible)return;const a=this.getObject(t);if(!a)return void(0,i.warn)("Dependent image isn't ready yet");const r=a.width,o=a.height,l=[];for(let i=0,c=n.length;i<c;i+=2)l.push({transform:[e,0,0,s,n[i],n[i+1]],x:0,y:0,w:r,h:o});this.paintInlineImageXObjectGroup(a,l)}applyTransferMapsToCanvas(t){return"none"!==this.current.transferMaps&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if("none"===this.current.transferMaps)return t.bitmap;const{bitmap:e,width:s,height:i}=t,n=this.cachedCanvases.getCanvas("inlineImage",s,i),a=n.context;return a.filter=this.current.transferMaps,a.drawImage(e,0,0),a.filter="none",n.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,s=t.height,a=this.ctx;if(this.save(),!i.isNodeJS){const{filter:t}=a;"none"!==t&&""!==t&&(a.filter="none")}let r;if(a.scale(1/e,-1/s),t.bitmap)r=this.applyTransferMapsToBitmap(t);else if("function"===typeof HTMLElement&&t instanceof HTMLElement||!t.data)r=t;else{const i=this.cachedCanvases.getCanvas("inlineImage",e,s).context;u(i,t),r=this.applyTransferMapsToCanvas(i)}const o=this._scaleImage(r,(0,n.getCurrentTransformInverse)(a));a.imageSmoothingEnabled=y((0,n.getCurrentTransform)(a),t.interpolate),d(a,o.img,0,0,o.paintWidth,o.paintHeight,0,-s,e,s),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const s=this.ctx;let i;if(t.bitmap)i=t.bitmap;else{const e=t.width,s=t.height,n=this.cachedCanvases.getCanvas("inlineImage",e,s).context;u(n,t),i=this.applyTransferMapsToCanvas(n)}for(const n of e)s.save(),s.transform(...n.transform),s.scale(1,-1),d(s,i,n.x,n.y,n.w,n.h,0,-1,1,1),s.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){const e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const s=this.ctx;this.pendingClip&&(e||(this.pendingClip===F?s.clip("evenodd"):s.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),s.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=(0,n.getCurrentTransform)(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),s=Math.hypot(t[0],t[2]),i=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(s,i)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:t}=this.current,{a:e,b:s,c:i,d:n}=this.ctx.getTransform();let a,r;if(0===s&&0===i){const s=Math.abs(e),i=Math.abs(n);if(s===i)if(0===t)a=r=1/s;else{const e=s*t;a=r=e<1?1/e:1}else if(0===t)a=1/s,r=1/i;else{const e=s*t,n=i*t;a=e<1?1/e:1,r=n<1?1/n:1}}else{const o=Math.abs(e*n-s*i),l=Math.hypot(e,s),c=Math.hypot(i,n);if(0===t)a=c/o,r=l/o;else{const e=t*o;a=c>e?c/e:1,r=l>e?l/e:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=r}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:s}=this.current,[i,n]=this.getScaleForStroking();if(e.lineWidth=s||1,1===i&&1===n)return void e.stroke();const a=e.getLineDash();if(t&&e.save(),e.scale(i,n),a.length>0){const t=Math.max(i,n);e.setLineDash(a.map((e=>e/t))),e.lineDashOffset/=t}e.stroke(),t&&e.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}function C(){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)}function E(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}}e.CanvasGraphics=x;for(const k in i.OPS)void 0!==x.prototype[k]&&(x.prototype[i.OPS[k]]=x.prototype[k])},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TilingPattern=e.PathType=void 0,e.getShadingPattern=function(t){switch(t[0]){case"RadialAxial":return new l(t);case"Mesh":return new h(t);case"Dummy":return new u}throw new Error("Unknown IR type: ".concat(t[0]))};var i=s(1),n=s(6);const a={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function r(t,e){if(!e)return;const s=e[2]-e[0],i=e[3]-e[1],n=new Path2D;n.rect(e[0],e[1],s,i),t.clip(n)}e.PathType=a;class o{constructor(){this.constructor===o&&(0,i.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,i.unreachable)("Abstract method `getPattern` called.")}}class l extends o{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;"axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const s of this._colorStops)e.addColorStop(s[0],s[1]);return e}getPattern(t,e,s,o){let l;if(o===a.STROKE||o===a.FILL){const a=e.current.getClippedPathBoundingBox(o,(0,n.getCurrentTransform)(t))||[0,0,0,0],c=Math.ceil(a[2]-a[0])||1,d=Math.ceil(a[3]-a[1])||1,h=e.cachedCanvases.getCanvas("pattern",c,d,!0),u=h.context;u.clearRect(0,0,u.canvas.width,u.canvas.height),u.beginPath(),u.rect(0,0,u.canvas.width,u.canvas.height),u.translate(-a[0],-a[1]),s=i.Util.transform(s,[1,0,0,1,a[0],a[1]]),u.transform(...e.baseTransform),this.matrix&&u.transform(...this.matrix),r(u,this._bbox),u.fillStyle=this._createGradient(u),u.fill(),l=t.createPattern(h.canvas,"no-repeat");const p=new DOMMatrix(s);l.setTransform(p)}else r(t,this._bbox),l=this._createGradient(t);return l}}function c(t,e,s,i,n,a,r,o){const l=e.coords,c=e.colors,d=t.data,h=4*t.width;let u;l[s+1]>l[i+1]&&(u=s,s=i,i=u,u=a,a=r,r=u),l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=r,r=o,o=u),l[s+1]>l[i+1]&&(u=s,s=i,i=u,u=a,a=r,r=u);const p=(l[s]+e.offsetX)*e.scaleX,f=(l[s+1]+e.offsetY)*e.scaleY,g=(l[i]+e.offsetX)*e.scaleX,v=(l[i+1]+e.offsetY)*e.scaleY,_=(l[n]+e.offsetX)*e.scaleX,m=(l[n+1]+e.offsetY)*e.scaleY;if(f>=m)return;const b=c[a],y=c[a+1],P=c[a+2],A=c[r],S=c[r+1],F=c[r+2],w=c[o],x=c[o+1],C=c[o+2],E=Math.round(f),k=Math.round(m);let T,M,R,I,D,O,L,G;for(let N=E;N<=k;N++){if(N<v){const t=N<f?0:(f-N)/(f-v);T=p-(p-g)*t,M=b-(b-A)*t,R=y-(y-S)*t,I=P-(P-F)*t}else{let t;t=N>m?1:v===m?0:(v-N)/(v-m),T=g-(g-_)*t,M=A-(A-w)*t,R=S-(S-x)*t,I=F-(F-C)*t}let t;t=N<f?0:N>m?1:(f-N)/(f-m),D=p-(p-_)*t,O=b-(b-w)*t,L=y-(y-x)*t,G=P-(P-C)*t;const e=Math.round(Math.min(T,D)),s=Math.round(Math.max(T,D));let i=h*N+4*e;for(let n=e;n<=s;n++)t=(T-n)/(T-D),t<0?t=0:t>1&&(t=1),d[i++]=M-(M-O)*t|0,d[i++]=R-(R-L)*t|0,d[i++]=I-(I-G)*t|0,d[i++]=255}}function d(t,e,s){const i=e.coords,n=e.colors;let a,r;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(i.length/o)-1,d=o-1;for(a=0;a<l;a++){let e=a*o;for(let a=0;a<d;a++,e++)c(t,s,i[e],i[e+1],i[e+o],n[e],n[e+1],n[e+o]),c(t,s,i[e+o+1],i[e+1],i[e+o],n[e+o+1],n[e+1],n[e+o])}break;case"triangles":for(a=0,r=i.length;a<r;a+=3)c(t,s,i[a],i[a+1],i[a+2],n[a],n[a+1],n[a+2]);break;default:throw new Error("illegal figure")}}class h extends o{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,e,s){const i=Math.floor(this._bounds[0]),n=Math.floor(this._bounds[1]),a=Math.ceil(this._bounds[2])-i,r=Math.ceil(this._bounds[3])-n,o=Math.min(Math.ceil(Math.abs(a*t[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(r*t[1]*1.1)),3e3),c=a/o,h=r/l,u={coords:this._coords,colors:this._colors,offsetX:-i,offsetY:-n,scaleX:1/c,scaleY:1/h},p=o+4,f=l+4,g=s.getCanvas("mesh",p,f,!1),v=g.context,_=v.createImageData(o,l);if(e){const t=_.data;for(let s=0,i=t.length;s<i;s+=4)t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=255}for(const m of this._figures)d(_,m,u);return v.putImageData(_,2,2),{canvas:g.canvas,offsetX:i-2*c,offsetY:n-2*h,scaleX:c,scaleY:h}}getPattern(t,e,s,o){let l;if(r(t,this._bbox),o===a.SHADING)l=i.Util.singularValueDecompose2dScale((0,n.getCurrentTransform)(t));else if(l=i.Util.singularValueDecompose2dScale(e.baseTransform),this.matrix){const t=i.Util.singularValueDecompose2dScale(this.matrix);l=[l[0]*t[0],l[1]*t[1]]}const c=this._createMeshCanvas(l,o===a.SHADING?null:this._background,e.cachedCanvases);return o!==a.SHADING&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(c.offsetX,c.offsetY),t.scale(c.scaleX,c.scaleY),t.createPattern(c.canvas,"no-repeat")}}class u extends o{getPattern(){return"hotpink"}}const p=1,f=2;class g{constructor(t,e,s,i,n){this.operatorList=t[2],this.matrix=t[3]||[1,0,0,1,0,0],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=e,this.ctx=s,this.canvasGraphicsFactory=i,this.baseTransform=n}createPatternCanvas(t){const e=this.operatorList,s=this.bbox,a=this.xstep,r=this.ystep,o=this.paintType,l=this.tilingType,c=this.color,d=this.canvasGraphicsFactory;(0,i.info)("TilingType: "+l);const h=s[0],u=s[1],p=s[2],f=s[3],g=i.Util.singularValueDecompose2dScale(this.matrix),v=i.Util.singularValueDecompose2dScale(this.baseTransform),_=[g[0]*v[0],g[1]*v[1]],m=this.getSizeAndScale(a,this.ctx.canvas.width,_[0]),b=this.getSizeAndScale(r,this.ctx.canvas.height,_[1]),y=t.cachedCanvases.getCanvas("pattern",m.size,b.size,!0),P=y.context,A=d.createCanvasGraphics(P);A.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(A,o,c);let S=h,F=u,w=p,x=f;return h<0&&(S=0,w+=Math.abs(h)),u<0&&(F=0,x+=Math.abs(u)),P.translate(-m.scale*S,-b.scale*F),A.transform(m.scale,0,0,b.scale,0,0),P.save(),this.clipBbox(A,S,F,w,x),A.baseTransform=(0,n.getCurrentTransform)(A.ctx),A.executeOperatorList(e),A.endDrawing(),{canvas:y.canvas,scaleX:m.scale,scaleY:b.scale,offsetX:S,offsetY:F}}getSizeAndScale(t,e,s){t=Math.abs(t);const i=Math.max(g.MAX_PATTERN_SIZE,e);let n=Math.ceil(t*s);return n>=i?n=i:s=n/t,{scale:s,size:n}}clipBbox(t,e,s,i,a){const r=i-e,o=a-s;t.ctx.rect(e,s,r,o),t.current.updateRectMinMax((0,n.getCurrentTransform)(t.ctx),[e,s,i,a]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,s){const n=t.ctx,a=t.current;switch(e){case p:const t=this.ctx;n.fillStyle=t.fillStyle,n.strokeStyle=t.strokeStyle,a.fillColor=t.fillStyle,a.strokeColor=t.strokeStyle;break;case f:const r=i.Util.makeHexColor(s[0],s[1],s[2]);n.fillStyle=r,n.strokeStyle=r,a.fillColor=r,a.strokeColor=r;break;default:throw new i.FormatError("Unsupported paint type: ".concat(e))}}getPattern(t,e,s,n){let r=s;n!==a.SHADING&&(r=i.Util.transform(r,e.baseTransform),this.matrix&&(r=i.Util.transform(r,this.matrix)));const o=this.createPatternCanvas(e);let l=new DOMMatrix(r);l=l.translate(o.offsetX,o.offsetY),l=l.scale(1/o.scaleX,1/o.scaleY);const c=t.createPattern(o.canvas,"repeat");return c.setTransform(l),c}}_defineProperty(g,"MAX_PATTERN_SIZE",3e3),e.TilingPattern=g},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertBlackAndWhiteToRGBA=n,e.convertToRGBA=function(t){switch(t.kind){case i.ImageKind.GRAYSCALE_1BPP:return n(t);case i.ImageKind.RGB_24BPP:return function(t){let{src:e,srcPos:s=0,dest:n,destPos:a=0,width:r,height:o}=t,l=0;const c=e.length>>2,d=new Uint32Array(e.buffer,s,c);if(i.FeatureTest.isLittleEndian){for(;l<c-2;l+=3,a+=4){const t=d[l],e=d[l+1],s=d[l+2];n[a]=4278190080|t,n[a+1]=t>>>24|e<<8|4278190080,n[a+2]=e>>>16|s<<16|4278190080,n[a+3]=s>>>8|4278190080}for(let t=4*l,s=e.length;t<s;t+=3)n[a++]=e[t]|e[t+1]<<8|e[t+2]<<16|4278190080}else{for(;l<c-2;l+=3,a+=4){const t=d[l],e=d[l+1],s=d[l+2];n[a]=255|t,n[a+1]=t<<24|e>>>8|255,n[a+2]=e<<16|s>>>16|255,n[a+3]=s<<8|255}for(let t=4*l,s=e.length;t<s;t+=3)n[a++]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|255}return{srcPos:s,destPos:a}}(t)}return null},e.grayToRGBA=function(t,e){if(i.FeatureTest.isLittleEndian)for(let s=0,i=t.length;s<i;s++)e[s]=65793*t[s]|4278190080;else for(let s=0,i=t.length;s<i;s++)e[s]=16843008*t[s]|255};var i=s(1);function n(t){let{src:e,srcPos:s=0,dest:n,width:a,height:r,nonBlackColor:o=4294967295,inverseDecode:l=!1}=t;const c=i.FeatureTest.isLittleEndian?4278190080:255,[d,h]=l?[o,c]:[c,o],u=a>>3,p=7&a,f=e.length;n=new Uint32Array(n.buffer);let g=0;for(let i=0;i<r;i++){for(const i=s+u;s<i;s++){const t=s<f?e[s]:255;n[g++]=128&t?h:d,n[g++]=64&t?h:d,n[g++]=32&t?h:d,n[g++]=16&t?h:d,n[g++]=8&t?h:d,n[g++]=4&t?h:d,n[g++]=2&t?h:d,n[g++]=1&t?h:d}if(0===p)continue;const t=s<f?e[s++]:255;for(let e=0;e<p;e++)n[g++]=t&1<<7-e?h:d}return{srcPos:s,destPos:g}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalWorkerOptions=void 0;const s=Object.create(null);e.GlobalWorkerOptions=s,s.workerPort=null,s.workerSrc=""},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MessageHandler=void 0;var i=s(1);const n=1,a=2,r=1,o=2,l=3,c=4,d=5,h=6,u=7,p=8;function f(t){switch(t instanceof Error||"object"===typeof t&&null!==t||(0,i.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new i.AbortException(t.message);case"MissingPDFException":return new i.MissingPDFException(t.message);case"PasswordException":return new i.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new i.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new i.UnknownErrorException(t.message,t.details);default:return new i.UnknownErrorException(t.message,t.toString())}}var g=new WeakSet;function v(t){const e=t.streamId,s=this.sourceName,n=t.sourceName,a=this.comObj,r=this,o=this.actionHandler[t.action],h={enqueue(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=r,l>0&&this.desiredSize<=0&&(this.sinkCapability=new i.PromiseCapability,this.ready=this.sinkCapability.promise),a.postMessage({sourceName:s,targetName:n,stream:c,streamId:e,chunk:t},o)},close(){this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:s,targetName:n,stream:l,streamId:e}),delete r.streamSinks[e])},error(t){(0,i.assert)(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:s,targetName:n,stream:d,streamId:e,reason:f(t)}))},sinkCapability:new i.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};h.sinkCapability.resolve(),h.ready=h.sinkCapability.promise,this.streamSinks[e]=h,new Promise((function(e){e(o(t.data,h))})).then((function(){a.postMessage({sourceName:s,targetName:n,stream:p,streamId:e,success:!0})}),(function(t){a.postMessage({sourceName:s,targetName:n,stream:p,streamId:e,reason:f(t)})}))}function _(t){const e=t.streamId,s=this.sourceName,n=t.sourceName,a=this.comObj,v=this.streamControllers[e],_=this.streamSinks[e];switch(t.stream){case p:t.success?v.startCall.resolve():v.startCall.reject(f(t.reason));break;case u:t.success?v.pullCall.resolve():v.pullCall.reject(f(t.reason));break;case h:if(!_){a.postMessage({sourceName:s,targetName:n,stream:u,streamId:e,success:!0});break}_.desiredSize<=0&&t.desiredSize>0&&_.sinkCapability.resolve(),_.desiredSize=t.desiredSize,new Promise((function(t){var e;t(null===(e=_.onPull)||void 0===e?void 0:e.call(_))})).then((function(){a.postMessage({sourceName:s,targetName:n,stream:u,streamId:e,success:!0})}),(function(t){a.postMessage({sourceName:s,targetName:n,stream:u,streamId:e,reason:f(t)})}));break;case c:if((0,i.assert)(v,"enqueue should have stream controller"),v.isClosed)break;v.controller.enqueue(t.chunk);break;case l:if((0,i.assert)(v,"close should have stream controller"),v.isClosed)break;v.isClosed=!0,v.controller.close(),_assertClassBrand(g,this,m).call(this,v,e);break;case d:(0,i.assert)(v,"error should have stream controller"),v.controller.error(f(t.reason)),_assertClassBrand(g,this,m).call(this,v,e);break;case o:t.success?v.cancelCall.resolve():v.cancelCall.reject(f(t.reason)),_assertClassBrand(g,this,m).call(this,v,e);break;case r:if(!_)break;new Promise((function(e){var s;e(null===(s=_.onCancel)||void 0===s?void 0:s.call(_,f(t.reason)))})).then((function(){a.postMessage({sourceName:s,targetName:n,stream:o,streamId:e,success:!0})}),(function(t){a.postMessage({sourceName:s,targetName:n,stream:o,streamId:e,reason:f(t)})})),_.sinkCapability.reject(f(t.reason)),_.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async function m(t,e){var s,i,n;await Promise.allSettled([null===(s=t.startCall)||void 0===s?void 0:s.promise,null===(i=t.pullCall)||void 0===i?void 0:i.promise,null===(n=t.cancelCall)||void 0===n?void 0:n.promise]),delete this.streamControllers[e]}e.MessageHandler=class{constructor(t,e,s){_classPrivateMethodInitSpec(this,g),this.sourceName=t,this.targetName=e,this.comObj=s,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=t=>{const e=t.data;if(e.targetName!==this.sourceName)return;if(e.stream)return void _assertClassBrand(g,this,_).call(this,e);if(e.callback){const t=e.callbackId,s=this.callbackCapabilities[t];if(!s)throw new Error("Cannot resolve callback ".concat(t));if(delete this.callbackCapabilities[t],e.callback===n)s.resolve(e.data);else{if(e.callback!==a)throw new Error("Unexpected callback case");s.reject(f(e.reason))}return}const i=this.actionHandler[e.action];if(!i)throw new Error("Unknown action from worker: ".concat(e.action));if(e.callbackId){const t=this.sourceName,r=e.sourceName;new Promise((function(t){t(i(e.data))})).then((function(i){s.postMessage({sourceName:t,targetName:r,callback:n,callbackId:e.callbackId,data:i})}),(function(i){s.postMessage({sourceName:t,targetName:r,callback:a,callbackId:e.callbackId,reason:f(i)})}))}else e.streamId?_assertClassBrand(g,this,v).call(this,e):i(e.data)},s.addEventListener("message",this._onComObjOnMessage)}on(t,e){const s=this.actionHandler;if(s[t])throw new Error('There is already an actionName called "'.concat(t,'"'));s[t]=e}send(t,e,s){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},s)}sendWithPromise(t,e,s){const n=this.callbackId++,a=new i.PromiseCapability;this.callbackCapabilities[n]=a;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:n,data:e},s)}catch(r){a.reject(r)}return a.promise}sendWithStream(t,e,s,n){const a=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:s=>{const r=new i.PromiseCapability;return this.streamControllers[a]={controller:s,startCall:r,pullCall:null,cancelCall:null,isClosed:!1},c.postMessage({sourceName:o,targetName:l,action:t,streamId:a,data:e,desiredSize:s.desiredSize},n),r.promise},pull:t=>{const e=new i.PromiseCapability;return this.streamControllers[a].pullCall=e,c.postMessage({sourceName:o,targetName:l,stream:h,streamId:a,desiredSize:t.desiredSize}),e.promise},cancel:t=>{(0,i.assert)(t instanceof Error,"cancel must have a valid reason");const e=new i.PromiseCapability;return this.streamControllers[a].cancelCall=e,this.streamControllers[a].isClosed=!0,c.postMessage({sourceName:o,targetName:l,stream:r,streamId:a,reason:f(t)}),e.promise}},s)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var i=s(1),n=new WeakMap,a=new WeakMap;e.Metadata=class{constructor(t){let{parsedData:e,rawData:s}=t;_classPrivateFieldInitSpec(this,n,void 0),_classPrivateFieldInitSpec(this,a,void 0),_classPrivateFieldSet(n,this,e),_classPrivateFieldSet(a,this,s)}getRaw(){return _classPrivateFieldGet(a,this)}get(t){var e;return null!==(e=_classPrivateFieldGet(n,this).get(t))&&void 0!==e?e:null}getAll(){return(0,i.objectFromMap)(_classPrivateFieldGet(n,this))}has(t){return _classPrivateFieldGet(n,this).has(t)}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OptionalContentConfig=void 0;var i=s(1),n=s(8);const a=Symbol("INTERNAL");var r=new WeakMap;class o{constructor(t,e){_classPrivateFieldInitSpec(this,r,!0),this.name=t,this.intent=e}get visible(){return _classPrivateFieldGet(r,this)}_setVisible(t,e){t!==a&&(0,i.unreachable)("Internal method `_setVisible` called."),_classPrivateFieldSet(r,this,e)}}var l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakSet;function p(t){const e=t.length;if(e<2)return!0;const s=t[0];for(let n=1;n<e;n++){const e=t[n];let a;if(Array.isArray(e))a=_assertClassBrand(u,this,p).call(this,e);else{if(!_classPrivateFieldGet(c,this).has(e))return(0,i.warn)("Optional content group not found: ".concat(e)),!0;a=_classPrivateFieldGet(c,this).get(e).visible}switch(s){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return"And"===s}e.OptionalContentConfig=class{constructor(t){if(_classPrivateMethodInitSpec(this,u),_classPrivateFieldInitSpec(this,l,null),_classPrivateFieldInitSpec(this,c,new Map),_classPrivateFieldInitSpec(this,d,null),_classPrivateFieldInitSpec(this,h,null),this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,_classPrivateFieldSet(h,this,t.order);for(const e of t.groups)_classPrivateFieldGet(c,this).set(e.id,new o(e.name,e.intent));if("OFF"===t.baseState)for(const t of _classPrivateFieldGet(c,this).values())t._setVisible(a,!1);for(const e of t.on)_classPrivateFieldGet(c,this).get(e)._setVisible(a,!0);for(const e of t.off)_classPrivateFieldGet(c,this).get(e)._setVisible(a,!1);_classPrivateFieldSet(d,this,this.getHash())}}isVisible(t){if(0===_classPrivateFieldGet(c,this).size)return!0;if(!t)return(0,i.warn)("Optional content group not defined."),!0;if("OCG"===t.type)return _classPrivateFieldGet(c,this).has(t.id)?_classPrivateFieldGet(c,this).get(t.id).visible:((0,i.warn)("Optional content group not found: ".concat(t.id)),!0);if("OCMD"===t.type){if(t.expression)return _assertClassBrand(u,this,p).call(this,t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!_classPrivateFieldGet(c,this).has(e))return(0,i.warn)("Optional content group not found: ".concat(e)),!0;if(_classPrivateFieldGet(c,this).get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!_classPrivateFieldGet(c,this).has(e))return(0,i.warn)("Optional content group not found: ".concat(e)),!0;if(!_classPrivateFieldGet(c,this).get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!_classPrivateFieldGet(c,this).has(e))return(0,i.warn)("Optional content group not found: ".concat(e)),!0;if(!_classPrivateFieldGet(c,this).get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!_classPrivateFieldGet(c,this).has(e))return(0,i.warn)("Optional content group not found: ".concat(e)),!0;if(_classPrivateFieldGet(c,this).get(e).visible)return!1}return!0}return(0,i.warn)("Unknown optional content policy ".concat(t.policy,".")),!0}return(0,i.warn)("Unknown group type ".concat(t.type,".")),!0}setVisibility(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];_classPrivateFieldGet(c,this).has(t)?(_classPrivateFieldGet(c,this).get(t)._setVisible(a,!!e),_classPrivateFieldSet(l,this,null)):(0,i.warn)("Optional content group not found: ".concat(t))}get hasInitialVisibility(){return null===_classPrivateFieldGet(d,this)||this.getHash()===_classPrivateFieldGet(d,this)}getOrder(){return _classPrivateFieldGet(c,this).size?_classPrivateFieldGet(h,this)?_classPrivateFieldGet(h,this).slice():[..._classPrivateFieldGet(c,this).keys()]:null}getGroups(){return _classPrivateFieldGet(c,this).size>0?(0,i.objectFromMap)(_classPrivateFieldGet(c,this)):null}getGroup(t){return _classPrivateFieldGet(c,this).get(t)||null}getHash(){if(null!==_classPrivateFieldGet(l,this))return _classPrivateFieldGet(l,this);const t=new n.MurmurHash3_64;for(const[e,s]of _classPrivateFieldGet(c,this))t.update("".concat(e,":").concat(s.visible));return _classPrivateFieldSet(l,this,t.hexdigest())}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFDataTransportStream=void 0;var i=s(1),n=s(6);e.PDFDataTransportStream=class{constructor(t,e){let{length:s,initialData:n,progressiveDone:a=!1,contentDispositionFilename:r=null,disableRange:o=!1,disableStream:l=!1}=t;if((0,i.assert)(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=r,(null===n||void 0===n?void 0:n.length)>0){const t=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!l,this._isRangeSupported=!o,this._contentLength=s,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener(((t,e)=>{this._onReceiveData({begin:t,chunk:e})})),this._pdfDataRangeTransport.addProgressListener(((t,e)=>{this._onProgress({loaded:t,total:e})})),this._pdfDataRangeTransport.addProgressiveReadListener((t=>{this._onReceiveData({chunk:t})})),this._pdfDataRangeTransport.addProgressiveDoneListener((()=>{this._onProgressiveDone()})),this._pdfDataRangeTransport.transportReady()}_onReceiveData(t){let{begin:e,chunk:s}=t;const n=s instanceof Uint8Array&&s.byteLength===s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{const t=this._rangeReaders.some((function(t){return t._begin===e&&(t._enqueue(n),!0)}));(0,i.assert)(t,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}_onProgress(t){var e,s,i,n;void 0===t.total?null===(e=this._rangeReaders[0])||void 0===e||null===(s=e.onProgress)||void 0===s||s.call(e,{loaded:t.loaded}):null===(i=this._fullRequestReader)||void 0===i||null===(n=i.onProgress)||void 0===n||n.call(i,{loaded:t.loaded,total:t.total})}_onProgressiveDone(){var t;null===(t=this._fullRequestReader)||void 0===t||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){(0,i.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new a(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const s=new r(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(s),s}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const s of this._rangeReaders.slice(0))s.cancel(t);this._pdfDataRangeTransport.abort()}};class a{constructor(t,e){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._stream=t,this._done=s||!1,this._filename=(0,n.isPdfFile)(i)?i:null,this._queuedChunks=e||[],this._loaded=0;for(const n of this._queuedChunks)this._loaded+=n.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=new i.PromiseCapability;return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class r{constructor(t,e,s){this._stream=t,this._begin=e,this._end=s,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=new i.PromiseCapability;return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFFetchStream=void 0;var i=s(1),n=s(20);function a(t,e,s){return{method:"GET",headers:t,signal:s.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function r(t){const e=new Headers;for(const s in t){const i=t[s];void 0!==i&&e.append(s,i)}return e}function o(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:((0,i.warn)("getArrayBuffer - unexpected data format: ".concat(t)),new Uint8Array(t).buffer)}e.PDFFetchStream=class{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new l(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const s=new c(this,t,e);return this._rangeRequestReaders.push(s),s}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const s of this._rangeRequestReaders.slice(0))s.cancel(t)}};class l{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=new i.PromiseCapability,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._headers=r(this._stream.httpHeaders);const s=e.url;fetch(s,a(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,n.validateResponseStatus)(t.status))throw(0,n.createResponseStatusError)(t.status,s);this._reader=t.body.getReader(),this._headersCapability.resolve();const e=e=>t.headers.get(e),{allowRangeRequests:a,suggestedLength:r}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:e,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=r||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(e),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new i.AbortException("Streaming is disabled."))})).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._headersCapability.promise;const{value:e,done:s}=await this._reader.read();return s?{value:e,done:s}:(this._loaded+=e.byteLength,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength}),{value:o(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}class c{constructor(t,e,s){this._stream=t,this._reader=null,this._loaded=0;const o=t.source;this._withCredentials=o.withCredentials||!1,this._readCapability=new i.PromiseCapability,this._isStreamingSupported=!o.disableStream,this._abortController=new AbortController,this._headers=r(this._stream.httpHeaders),this._headers.append("Range","bytes=".concat(e,"-").concat(s-1));const l=o.url;fetch(l,a(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,n.validateResponseStatus)(t.status))throw(0,n.createResponseStatusError)(t.status,l);this._readCapability.resolve(),this._reader=t.body.getReader()})).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._readCapability.promise;const{value:e,done:s}=await this._reader.read();return s?{value:e,done:s}:(this._loaded+=e.byteLength,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded}),{value:o(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createResponseStatusError=function(t,e){return 404===t||0===t&&e.startsWith("file:")?new i.MissingPDFException('Missing PDF "'+e+'".'):new i.UnexpectedResponseException("Unexpected server response (".concat(t,') while retrieving PDF "').concat(e,'".'),t)},e.extractFilenameFromHeader=function(t){const e=t("Content-Disposition");if(e){let t=(0,n.getFilenameFromContentDispositionHeader)(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if((0,a.isPdfFile)(t))return t}return null},e.validateRangeRequestCapabilities=function(t){let{getResponseHeader:e,isHttp:s,rangeChunkSize:i,disableRange:n}=t;const a={allowRangeRequests:!1,suggestedLength:void 0},r=parseInt(e("Content-Length"),10);return Number.isInteger(r)?(a.suggestedLength=r,r<=2*i||n||!s||"bytes"!==e("Accept-Ranges")||"identity"!==(e("Content-Encoding")||"identity")||(a.allowRangeRequests=!0),a):a},e.validateResponseStatus=function(t){return 200===t||206===t};var i=s(1),n=s(21),a=s(6)},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getFilenameFromContentDispositionHeader=function(t){let e=!0,s=n("filename\\*","i").exec(t);if(s){s=s[1];let t=o(s);return t=unescape(t),t=l(t),t=c(t),r(t)}if(s=function(t){const e=[];let s;const i=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(s=i.exec(t));){let[,t,i,n]=s;if(t=parseInt(t,10),t in e){if(0===t)break}else e[t]=[i,n]}const a=[];for(let n=0;n<e.length&&n in e;++n){let[t,s]=e[n];s=o(s),t&&(s=unescape(s),0===n&&(s=l(s))),a.push(s)}return a.join("")}(t),s)return r(c(s));if(s=n("filename","i").exec(t),s){s=s[1];let t=o(s);return t=c(t),r(t)}function n(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function a(t,s){if(t){if(!/^[\x00-\xFF]+$/.test(s))return s;try{const n=new TextDecoder(t,{fatal:!0}),a=(0,i.stringToBytes)(s);s=n.decode(a),e=!1}catch{}}return s}function r(t){return e&&/[\x80-\xff]/.test(t)&&(t=a("utf-8",t),e&&(t=a("iso-8859-1",t))),t}function o(t){if(t.startsWith('"')){const e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){const s=e[t].indexOf('"');-1!==s&&(e[t]=e[t].slice(0,s),e.length=t+1),e[t]=e[t].replaceAll(/\\(.)/g,"$1")}t=e.join('"')}return t}function l(t){const e=t.indexOf("'");return-1===e?t:a(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function c(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(t,e,s,i){if("q"===s||"Q"===s)return a(e,i=(i=i.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,(function(t,e){return String.fromCharCode(parseInt(e,16))})));try{i=atob(i)}catch{}return a(e,i)}))}return""};var i=s(1)},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNetworkStream=void 0;var i=s(1),n=s(20);class a{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&e.httpHeaders||Object.create(null),this.withCredentials=e.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,e,s){const i={begin:t,end:e};for(const n in s)i[n]=s[n];return this.request(i)}requestFull(t){return this.request(t)}request(t){const e=new XMLHttpRequest,s=this.currXhrId++,i=this.pendingRequests[s]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const n in this.httpHeaders){const t=this.httpHeaders[n];void 0!==t&&e.setRequestHeader(n,t)}return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range","bytes=".concat(t.begin,"-").concat(t.end-1)),i.expectedStatus=206):i.expectedStatus=200,e.responseType="arraybuffer",t.onError&&(e.onerror=function(s){t.onError(e.status)}),e.onreadystatechange=this.onStateChange.bind(this,s),e.onprogress=this.onProgress.bind(this,s),i.onHeadersReceived=t.onHeadersReceived,i.onDone=t.onDone,i.onError=t.onError,i.onProgress=t.onProgress,e.send(null),s}onProgress(t,e){var s;const i=this.pendingRequests[t];i&&(null===(s=i.onProgress)||void 0===s||s.call(i,e))}onStateChange(t,e){const s=this.pendingRequests[t];if(!s)return;const n=s.xhr;if(n.readyState>=2&&s.onHeadersReceived&&(s.onHeadersReceived(),delete s.onHeadersReceived),4!==n.readyState)return;if(!(t in this.pendingRequests))return;var a;if(delete this.pendingRequests[t],0===n.status&&this.isHttp)return void(null===(a=s.onError)||void 0===a||a.call(s,n.status));const r=n.status||200;var o;if((200!==r||206!==s.expectedStatus)&&r!==s.expectedStatus)return void(null===(o=s.onError)||void 0===o||o.call(s,n.status));const l=function(t){const e=t.response;return"string"!==typeof e?e:(0,i.stringToBytes)(e).buffer}(n);if(206===r){const t=n.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);s.onDone({begin:parseInt(e[1],10),chunk:l})}else if(l)s.onDone({begin:0,chunk:l});else{var c;null===(c=s.onError)||void 0===c||c.call(s,n.status)}}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}e.PDFNetworkStream=class{constructor(t){this._source=t,this._manager=new a(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new r(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const s=new o(this._manager,t,e);return s.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(s),s}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const s of this._rangeRequestReaders.slice(0))s.cancel(t)}};class r{constructor(t,e){this._manager=t;const s={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._fullRequestId=t.requestFull(s),this._headersReceivedCapability=new i.PromiseCapability,this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.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 t=this._fullRequestId,e=this._manager.getRequestXhr(t),s=t=>e.getResponseHeader(t),{allowRangeRequests:i,suggestedLength:a}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:s,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(s),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.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(t){this._storedError=(0,n.createResponseStatusError)(t,this._url),this._headersReceivedCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){var e;null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=new i.PromiseCapability;return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersReceivedCapability.reject(t);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class o{constructor(t,e,s){this._manager=t;const i={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(e,s,i),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var t;null===(t=this.onClosed)||void 0===t||t.call(this,this)}_onDone(t){const e=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0;for(const s of this._requests)s.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=(0,n.createResponseStatusError)(t,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){var e;this.isStreamingSupported||null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=new i.PromiseCapability;return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNodeStream=void 0;var i=s(1),n=s(20);const a=/^file:\/\/\/[a-zA-Z]:\//;e.PDFNodeStream=class{constructor(t){this.source=t,this.url=function(t){const e=__webpack_require__(66671),s=e.parse(t);return"file:"===s.protocol||s.host?s:/^[a-z]:[/\\]/i.test(t)?e.parse("file:///".concat(t)):(s.host||(s.protocol="file:"),s)}(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new h(this):new c(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const s=this.isFsUrl?new u(this,t,e):new d(this,t,e);return this._rangeRequestReaders.push(s),s}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const s of this._rangeRequestReaders.slice(0))s.cancel(t)}};class r{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=new i.PromiseCapability,this._headersCapability=new i.PromiseCapability}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return null===e?(this._readCapability=new i.PromiseCapability,this.read()):(this._loaded+=e.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new i.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class o{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new i.PromiseCapability;const e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return null===e?(this._readCapability=new i.PromiseCapability,this.read()):(this._loaded+=e.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),this._storedError&&this._readableStream.destroy(this._storedError)}}function l(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class c extends r{constructor(t){super(t);const e=e=>{if(404===e.statusCode){const t=new i.MissingPDFException('Missing PDF "'.concat(this._url,'".'));return this._storedError=t,void this._headersCapability.reject(t)}this._headersCapability.resolve(),this._setReadableStream(e);const s=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:a,suggestedLength:r}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:s,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=r||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(s)};if(this._request=null,"http:"===this._url.protocol){const s=__webpack_require__(97492);this._request=s.request(l(this._url,t.httpHeaders),e)}else{const s=__webpack_require__(31815);this._request=s.request(l(this._url,t.httpHeaders),e)}this._request.on("error",(t=>{this._storedError=t,this._headersCapability.reject(t)})),this._request.end()}}class d extends o{constructor(t,e,s){super(t),this._httpHeaders={};for(const i in t.httpHeaders){const e=t.httpHeaders[i];void 0!==e&&(this._httpHeaders[i]=e)}this._httpHeaders.Range="bytes=".concat(e,"-").concat(s-1);const n=t=>{if(404!==t.statusCode)this._setReadableStream(t);else{const t=new i.MissingPDFException('Missing PDF "'.concat(this._url,'".'));this._storedError=t}};if(this._request=null,"http:"===this._url.protocol){const t=__webpack_require__(97492);this._request=t.request(l(this._url,this._httpHeaders),n)}else{const t=__webpack_require__(31815);this._request=t.request(l(this._url,this._httpHeaders),n)}this._request.on("error",(t=>{this._storedError=t})),this._request.end()}}class h extends r{constructor(t){super(t);let e=decodeURIComponent(this._url.path);a.test(this._url.href)&&(e=e.replace(/^\//,""));const s=__webpack_require__(23237);s.lstat(e,((t,n)=>{if(t)return"ENOENT"===t.code&&(t=new i.MissingPDFException('Missing PDF "'.concat(e,'".'))),this._storedError=t,void this._headersCapability.reject(t);this._contentLength=n.size,this._setReadableStream(s.createReadStream(e)),this._headersCapability.resolve()}))}}class u extends o{constructor(t,e,s){super(t);let i=decodeURIComponent(this._url.path);a.test(this._url.href)&&(i=i.replace(/^\//,""));const n=__webpack_require__(23237);this._setReadableStream(n.createReadStream(i,{start:e,end:s-1}))}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SVGGraphics=void 0;var i=s(6),n=s(1);const a="normal",r="normal",o="#000000",l=["butt","round","square"],c=["miter","round","bevel"],d=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(URL.createObjectURL&&"undefined"!==typeof Blob&&!s)return URL.createObjectURL(new Blob([t],{type:e}));const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let n="data:".concat(e,";base64,");for(let a=0,r=t.length;a<r;a+=3){const e=255&t[a],s=255&t[a+1],o=255&t[a+2];n+=i[e>>2]+i[(3&e)<<4|s>>4]+i[a+1<r?(15&s)<<2|o>>6:64]+i[a+2<r?63&o:64]}return n},h=function(){const t=new Uint8Array([137,80,78,71,13,10,26,10]),e=new Int32Array(256);for(let n=0;n<256;n++){let t=n;for(let e=0;e<8;e++)t=1&t?3988292384^t>>1&2147483647:t>>1&2147483647;e[n]=t}function s(t,s,i,n){let a=n;const r=s.length;i[a]=r>>24&255,i[a+1]=r>>16&255,i[a+2]=r>>8&255,i[a+3]=255&r,a+=4,i[a]=255&t.charCodeAt(0),i[a+1]=255&t.charCodeAt(1),i[a+2]=255&t.charCodeAt(2),i[a+3]=255&t.charCodeAt(3),a+=4,i.set(s,a),a+=s.length;const o=function(t,s,i){let n=-1;for(let a=s;a<i;a++){const s=255&(n^t[a]);n=n>>>8^e[s]}return~n}(i,n+4,a);i[a]=o>>24&255,i[a+1]=o>>16&255,i[a+2]=o>>8&255,i[a+3]=255&o}function i(t){let e=t.length;const s=65535,i=Math.ceil(e/s),n=new Uint8Array(2+e+5*i+4);let a=0;n[a++]=120,n[a++]=156;let r=0;for(;e>s;)n[a++]=0,n[a++]=255,n[a++]=255,n[a++]=0,n[a++]=0,n.set(t.subarray(r,r+s),a),a+=s,r+=s,e-=s;n[a++]=1,n[a++]=255&e,n[a++]=e>>8&255,n[a++]=255&~e,n[a++]=(65535&~e)>>8&255,n.set(t.subarray(r),a),a+=t.length-r;const o=function(t,e,s){let i=1,n=0;for(let a=e;a<s;++a)i=(i+(255&t[a]))%65521,n=(n+i)%65521;return n<<16|i}(t,0,t.length);return n[a++]=o>>24&255,n[a++]=o>>16&255,n[a++]=o>>8&255,n[a++]=255&o,n}function a(e,a,r,o){const l=e.width,c=e.height;let h,u,p;const f=e.data;switch(a){case n.ImageKind.GRAYSCALE_1BPP:u=0,h=1,p=l+7>>3;break;case n.ImageKind.RGB_24BPP:u=2,h=8,p=3*l;break;case n.ImageKind.RGBA_32BPP:u=6,h=8,p=4*l;break;default:throw new Error("invalid format")}const g=new Uint8Array((1+p)*c);let v=0,_=0;for(let t=0;t<c;++t)g[v++]=0,g.set(f.subarray(_,_+p),v),_+=p,v+=p;if(a===n.ImageKind.GRAYSCALE_1BPP&&o){v=0;for(let t=0;t<c;t++){v++;for(let t=0;t<p;t++)g[v++]^=255}}const m=new Uint8Array([l>>24&255,l>>16&255,l>>8&255,255&l,c>>24&255,c>>16&255,c>>8&255,255&c,h,u,0,0,0]),b=function(t){if(!n.isNodeJS)return i(t);try{const e=parseInt(process.versions.node)>=8?t:Buffer.from(t),s=__webpack_require__(82787).deflateSync(e,{level:9});return s instanceof Uint8Array?s:new Uint8Array(s)}catch(e){(0,n.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+e)}return i(t)}(g),y=t.length+36+m.length+b.length,P=new Uint8Array(y);let A=0;return P.set(t,A),A+=t.length,s("IHDR",m,P,A),A+=12+m.length,s("IDATA",b,P,A),A+=12+b.length,s("IEND",new Uint8Array(0),P,A),d(P,"image/png",r)}return function(t,e,s){return a(t,void 0===t.kind?n.ImageKind.GRAYSCALE_1BPP:t.kind,e,s)}}();class u{constructor(){this.fontSizeScale=1,this.fontWeight=r,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,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(t,e){this.x=t,this.y=e}}function p(t){if(Number.isInteger(t))return t.toString();const e=t.toFixed(10);let s=e.length-1;if("0"!==e[s])return e;do{s--}while("0"===e[s]);return e.substring(0,"."===e[s]?s:s+1)}function f(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?"":"scale(".concat(p(t[0])," ").concat(p(t[3]),")");if(t[0]===t[3]&&t[1]===-t[2]){const e=180*Math.acos(t[0])/Math.PI;return"rotate(".concat(p(e),")")}}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return"translate(".concat(p(t[4])," ").concat(p(t[5]),")");return"matrix(".concat(p(t[0])," ").concat(p(t[1])," ").concat(p(t[2])," ").concat(p(t[3])," ").concat(p(t[4])," ")+"".concat(p(t[5]),")")}let g=0,v=0,_=0;e.SVGGraphics=class{constructor(t,e){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,i.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new i.DOMSVGFactory,this.current=new u,this.transformMatrix=n.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=t,this.objs=e,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!s,this._operatorIdMapping=[];for(const i in n.OPS)this._operatorIdMapping[n.OPS[i]]=i}getObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"===typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}save(){this.transformStack.push(this.transformMatrix);const t=this.current;this.extraStack.push(t),this.current=t.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(t){this.save(),this.executeOpTree(t),this.restore()}loadDependencies(t){const e=t.fnArray,s=t.argsArray;for(let i=0,a=e.length;i<a;i++)if(e[i]===n.OPS.dependency)for(const t of s[i]){const e=t.startsWith("g_")?this.commonObjs:this.objs,s=new Promise((s=>{e.get(t,s)}));this.current.dependencies.push(s)}return Promise.all(this.current.dependencies)}transform(t,e,s,i,a,r){const o=[t,e,s,i,a,r];this.transformMatrix=n.Util.transform(this.transformMatrix,o),this.tgrp=null}getSVG(t,e){this.viewport=e;const s=this._initialize(e);return this.loadDependencies(t).then((()=>(this.transformMatrix=n.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(t)),s)))}convertOpList(t){const e=this._operatorIdMapping,s=t.argsArray,i=t.fnArray,n=[];for(let a=0,r=i.length;a<r;a++){const t=i[a];n.push({fnId:t,fn:e[t],args:s[a]})}return function(t){let e=[];const s=[];for(const i of t)"save"!==i.fn?"restore"===i.fn?e=s.pop():e.push(i):(e.push({fnId:92,fn:"group",items:[]}),s.push(e),e=e.at(-1).items);return e}(n)}executeOpTree(t){for(const e of t){const t=e.fn,s=e.fnId,i=e.args;switch(0|s){case n.OPS.beginText:this.beginText();break;case n.OPS.dependency:break;case n.OPS.setLeading:this.setLeading(i);break;case n.OPS.setLeadingMoveText:this.setLeadingMoveText(i[0],i[1]);break;case n.OPS.setFont:this.setFont(i);break;case n.OPS.showText:case n.OPS.showSpacedText:this.showText(i[0]);break;case n.OPS.endText:this.endText();break;case n.OPS.moveText:this.moveText(i[0],i[1]);break;case n.OPS.setCharSpacing:this.setCharSpacing(i[0]);break;case n.OPS.setWordSpacing:this.setWordSpacing(i[0]);break;case n.OPS.setHScale:this.setHScale(i[0]);break;case n.OPS.setTextMatrix:this.setTextMatrix(i[0],i[1],i[2],i[3],i[4],i[5]);break;case n.OPS.setTextRise:this.setTextRise(i[0]);break;case n.OPS.setTextRenderingMode:this.setTextRenderingMode(i[0]);break;case n.OPS.setLineWidth:this.setLineWidth(i[0]);break;case n.OPS.setLineJoin:this.setLineJoin(i[0]);break;case n.OPS.setLineCap:this.setLineCap(i[0]);break;case n.OPS.setMiterLimit:this.setMiterLimit(i[0]);break;case n.OPS.setFillRGBColor:this.setFillRGBColor(i[0],i[1],i[2]);break;case n.OPS.setStrokeRGBColor:this.setStrokeRGBColor(i[0],i[1],i[2]);break;case n.OPS.setStrokeColorN:this.setStrokeColorN(i);break;case n.OPS.setFillColorN:this.setFillColorN(i);break;case n.OPS.shadingFill:this.shadingFill(i[0]);break;case n.OPS.setDash:this.setDash(i[0],i[1]);break;case n.OPS.setRenderingIntent:this.setRenderingIntent(i[0]);break;case n.OPS.setFlatness:this.setFlatness(i[0]);break;case n.OPS.setGState:this.setGState(i[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(i[0]);break;case n.OPS.paintInlineImageXObject:this.paintInlineImageXObject(i[0]);break;case n.OPS.paintImageMaskXObject:this.paintImageMaskXObject(i[0]);break;case n.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(i[0],i[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(i[0],i[1],i[2],i[3],i[4],i[5]);break;case n.OPS.constructPath:this.constructPath(i[0],i[1]);break;case n.OPS.endPath:this.endPath();break;case 92:this.group(e.items);break;default:(0,n.warn)("Unimplemented operator ".concat(t))}}}setWordSpacing(t){this.current.wordSpacing=t}setCharSpacing(t){this.current.charSpacing=t}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(t,e,s,i,n,a){const r=this.current;r.textMatrix=r.lineMatrix=[t,e,s,i,n,a],r.textMatrixScale=Math.hypot(t,e),r.x=r.lineX=0,r.y=r.lineY=0,r.xcoords=[],r.ycoords=[],r.tspan=this.svgFactory.createElement("svg:tspan"),r.tspan.setAttributeNS(null,"font-family",r.fontFamily),r.tspan.setAttributeNS(null,"font-size","".concat(p(r.fontSize),"px")),r.tspan.setAttributeNS(null,"y",p(-r.y)),r.txtElement=this.svgFactory.createElement("svg:text"),r.txtElement.append(r.tspan)}beginText(){const t=this.current;t.x=t.lineX=0,t.y=t.lineY=0,t.textMatrix=n.IDENTITY_MATRIX,t.lineMatrix=n.IDENTITY_MATRIX,t.textMatrixScale=1,t.tspan=this.svgFactory.createElement("svg:tspan"),t.txtElement=this.svgFactory.createElement("svg:text"),t.txtgrp=this.svgFactory.createElement("svg:g"),t.xcoords=[],t.ycoords=[]}moveText(t,e){const s=this.current;s.x=s.lineX+=t,s.y=s.lineY+=e,s.xcoords=[],s.ycoords=[],s.tspan=this.svgFactory.createElement("svg:tspan"),s.tspan.setAttributeNS(null,"font-family",s.fontFamily),s.tspan.setAttributeNS(null,"font-size","".concat(p(s.fontSize),"px")),s.tspan.setAttributeNS(null,"y",p(-s.y))}showText(t){const e=this.current,s=e.font,i=e.fontSize;if(0===i)return;const l=e.fontSizeScale,c=e.charSpacing,d=e.wordSpacing,h=e.fontDirection,u=e.textHScale*h,g=s.vertical,v=g?1:-1,_=s.defaultVMetrics,m=i*e.fontMatrix[0];let b=0;for(const n of t){if(null===n){b+=h*d;continue}if("number"===typeof n){b+=v*n*i/1e3;continue}const t=(n.isSpace?d:0)+c,a=n.fontChar;let r,o,u=n.width;if(g){let t;const e=n.vmetric||_;t=n.vmetric?e[1]:.5*u,t=-t*m;const s=e[2]*m;u=e?-e[0]:u,r=t/l,o=(b+s)/l}else r=b/l,o=0;(n.isInFont||s.missingFile)&&(e.xcoords.push(e.x+r),g&&e.ycoords.push(-e.y+o),e.tspan.textContent+=a),b+=g?u*m-t*h:u*m+t*h}e.tspan.setAttributeNS(null,"x",e.xcoords.map(p).join(" ")),g?e.tspan.setAttributeNS(null,"y",e.ycoords.map(p).join(" ")):e.tspan.setAttributeNS(null,"y",p(-e.y)),g?e.y-=b:e.x+=b*u,e.tspan.setAttributeNS(null,"font-family",e.fontFamily),e.tspan.setAttributeNS(null,"font-size","".concat(p(e.fontSize),"px")),e.fontStyle!==a&&e.tspan.setAttributeNS(null,"font-style",e.fontStyle),e.fontWeight!==r&&e.tspan.setAttributeNS(null,"font-weight",e.fontWeight);const y=e.textRenderingMode&n.TextRenderingMode.FILL_STROKE_MASK;if(y===n.TextRenderingMode.FILL||y===n.TextRenderingMode.FILL_STROKE?(e.fillColor!==o&&e.tspan.setAttributeNS(null,"fill",e.fillColor),e.fillAlpha<1&&e.tspan.setAttributeNS(null,"fill-opacity",e.fillAlpha)):e.textRenderingMode===n.TextRenderingMode.ADD_TO_PATH?e.tspan.setAttributeNS(null,"fill","transparent"):e.tspan.setAttributeNS(null,"fill","none"),y===n.TextRenderingMode.STROKE||y===n.TextRenderingMode.FILL_STROKE){const t=1/(e.textMatrixScale||1);this._setStrokeAttributes(e.tspan,t)}let P=e.textMatrix;0!==e.textRise&&(P=P.slice(),P[5]+=e.textRise),e.txtElement.setAttributeNS(null,"transform","".concat(f(P)," scale(").concat(p(u),", -1)")),e.txtElement.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.txtElement.append(e.tspan),e.txtgrp.append(e.txtElement),this._ensureTransformGroup().append(e.txtElement)}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}addFontStyle(t){if(!t.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));const e=d(t.data,t.mimetype,this.forceDataSchema);this.cssStyle.textContent+='@font-face { font-family: "'.concat(t.loadedName,'";')+" src: url(".concat(e,"); }\n")}setFont(t){const e=this.current,s=this.commonObjs.get(t[0]);let i=t[1];e.font=s,!this.embedFonts||s.missingFile||this.embeddedFonts[s.loadedName]||(this.addFontStyle(s),this.embeddedFonts[s.loadedName]=s),e.fontMatrix=s.fontMatrix||n.FONT_IDENTITY_MATRIX;let a="normal";s.black?a="900":s.bold&&(a="bold");const r=s.italic?"italic":"normal";i<0?(i=-i,e.fontDirection=-1):e.fontDirection=1,e.fontSize=i,e.fontFamily=s.loadedName,e.fontWeight=a,e.fontStyle=r,e.tspan=this.svgFactory.createElement("svg:tspan"),e.tspan.setAttributeNS(null,"y",p(-e.y)),e.xcoords=[],e.ycoords=[]}endText(){var t;const e=this.current;e.textRenderingMode&n.TextRenderingMode.ADD_TO_PATH_FLAG&&null!==(t=e.txtElement)&&void 0!==t&&t.hasChildNodes()&&(e.element=e.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(t){t>0&&(this.current.lineWidth=t)}setLineCap(t){this.current.lineCap=l[t]}setLineJoin(t){this.current.lineJoin=c[t]}setMiterLimit(t){this.current.miterLimit=t}setStrokeAlpha(t){this.current.strokeAlpha=t}setStrokeRGBColor(t,e,s){this.current.strokeColor=n.Util.makeHexColor(t,e,s)}setFillAlpha(t){this.current.fillAlpha=t}setFillRGBColor(t,e,s){this.current.fillColor=n.Util.makeHexColor(t,e,s),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(t){this.current.strokeColor=this._makeColorN_Pattern(t)}setFillColorN(t){this.current.fillColor=this._makeColorN_Pattern(t)}shadingFill(t){const{width:e,height:s}=this.viewport,i=n.Util.inverseTransform(this.transformMatrix),[a,r,o,l]=n.Util.getAxialAlignedBoundingBox([0,0,e,s],i),c=this.svgFactory.createElement("svg:rect");c.setAttributeNS(null,"x",a),c.setAttributeNS(null,"y",r),c.setAttributeNS(null,"width",o-a),c.setAttributeNS(null,"height",l-r),c.setAttributeNS(null,"fill",this._makeShadingPattern(t)),this.current.fillAlpha<1&&c.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(c)}_makeColorN_Pattern(t){return"TilingPattern"===t[0]?this._makeTilingPattern(t):this._makeShadingPattern(t)}_makeTilingPattern(t){const e=t[1],s=t[2],i=t[3]||n.IDENTITY_MATRIX,[a,r,o,l]=t[4],c=t[5],d=t[6],h=t[7],u="shading".concat(_++),[p,f,g,v]=n.Util.normalizeRect([...n.Util.applyTransform([a,r],i),...n.Util.applyTransform([o,l],i)]),[m,b]=n.Util.singularValueDecompose2dScale(i),y=c*m,P=d*b,A=this.svgFactory.createElement("svg:pattern");A.setAttributeNS(null,"id",u),A.setAttributeNS(null,"patternUnits","userSpaceOnUse"),A.setAttributeNS(null,"width",y),A.setAttributeNS(null,"height",P),A.setAttributeNS(null,"x","".concat(p)),A.setAttributeNS(null,"y","".concat(f));const S=this.svg,F=this.transformMatrix,w=this.current.fillColor,x=this.current.strokeColor,C=this.svgFactory.create(g-p,v-f);if(this.svg=C,this.transformMatrix=i,2===h){const t=n.Util.makeHexColor(...e);this.current.fillColor=t,this.current.strokeColor=t}return this.executeOpTree(this.convertOpList(s)),this.svg=S,this.transformMatrix=F,this.current.fillColor=w,this.current.strokeColor=x,A.append(C.childNodes[0]),this.defs.append(A),"url(#".concat(u,")")}_makeShadingPattern(t){switch("string"===typeof t&&(t=this.objs.get(t)),t[0]){case"RadialAxial":const e="shading".concat(_++),s=t[3];let i;switch(t[1]){case"axial":const s=t[4],n=t[5];i=this.svgFactory.createElement("svg:linearGradient"),i.setAttributeNS(null,"id",e),i.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),i.setAttributeNS(null,"x1",s[0]),i.setAttributeNS(null,"y1",s[1]),i.setAttributeNS(null,"x2",n[0]),i.setAttributeNS(null,"y2",n[1]);break;case"radial":const a=t[4],r=t[5],o=t[6],l=t[7];i=this.svgFactory.createElement("svg:radialGradient"),i.setAttributeNS(null,"id",e),i.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),i.setAttributeNS(null,"cx",r[0]),i.setAttributeNS(null,"cy",r[1]),i.setAttributeNS(null,"r",l),i.setAttributeNS(null,"fx",a[0]),i.setAttributeNS(null,"fy",a[1]),i.setAttributeNS(null,"fr",o);break;default:throw new Error("Unknown RadialAxial type: ".concat(t[1]))}for(const t of s){const e=this.svgFactory.createElement("svg:stop");e.setAttributeNS(null,"offset",t[0]),e.setAttributeNS(null,"stop-color",t[1]),i.append(e)}return this.defs.append(i),"url(#".concat(e,")");case"Mesh":return(0,n.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: ".concat(t[0]))}}setDash(t,e){this.current.dashArray=t,this.current.dashPhase=e}constructPath(t,e){const s=this.current;let i=s.x,a=s.y,r=[],o=0;for(const l of t)switch(0|l){case n.OPS.rectangle:i=e[o++],a=e[o++];const t=i+e[o++],s=a+e[o++];r.push("M",p(i),p(a),"L",p(t),p(a),"L",p(t),p(s),"L",p(i),p(s),"Z");break;case n.OPS.moveTo:i=e[o++],a=e[o++],r.push("M",p(i),p(a));break;case n.OPS.lineTo:i=e[o++],a=e[o++],r.push("L",p(i),p(a));break;case n.OPS.curveTo:i=e[o+4],a=e[o+5],r.push("C",p(e[o]),p(e[o+1]),p(e[o+2]),p(e[o+3]),p(i),p(a)),o+=6;break;case n.OPS.curveTo2:r.push("C",p(i),p(a),p(e[o]),p(e[o+1]),p(e[o+2]),p(e[o+3])),i=e[o+2],a=e[o+3],o+=4;break;case n.OPS.curveTo3:i=e[o+2],a=e[o+3],r.push("C",p(e[o]),p(e[o+1]),p(i),p(a),p(i),p(a)),o+=4;break;case n.OPS.closePath:r.push("Z")}r=r.join(" "),s.path&&t.length>0&&t[0]!==n.OPS.rectangle&&t[0]!==n.OPS.moveTo?r=s.path.getAttributeNS(null,"d")+r:(s.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(s.path)),s.path.setAttributeNS(null,"d",r),s.path.setAttributeNS(null,"fill","none"),s.element=s.path,s.setCurrentPoint(i,a)}endPath(){const t=this.current;if(t.path=null,!this.pendingClip)return;if(!t.element)return void(this.pendingClip=null);const e="clippath".concat(g++),s=this.svgFactory.createElement("svg:clipPath");s.setAttributeNS(null,"id",e),s.setAttributeNS(null,"transform",f(this.transformMatrix));const i=t.element.cloneNode(!0);if("evenodd"===this.pendingClip?i.setAttributeNS(null,"clip-rule","evenodd"):i.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,s.append(i),this.defs.append(s),t.activeClipUrl){t.clipGroup=null;for(const t of this.extraStack)t.clipGroup=null;s.setAttributeNS(null,"clip-path",t.activeClipUrl)}t.activeClipUrl="url(#".concat(e,")"),this.tgrp=null}clip(t){this.pendingClip=t}closePath(){const t=this.current;if(t.path){const e="".concat(t.path.getAttributeNS(null,"d"),"Z");t.path.setAttributeNS(null,"d",e)}}setLeading(t){this.current.leading=-t}setTextRise(t){this.current.textRise=t}setTextRenderingMode(t){this.current.textRenderingMode=t}setHScale(t){this.current.textHScale=t/100}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,s]of t)switch(e){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);break;case"CA":this.setStrokeAlpha(s);break;case"ca":this.setFillAlpha(s);break;default:(0,n.warn)("Unimplemented graphic state operator ".concat(e))}}fill(){const t=this.current;t.element&&(t.element.setAttributeNS(null,"fill",t.fillColor),t.element.setAttributeNS(null,"fill-opacity",t.fillAlpha),this.endPath())}stroke(){const t=this.current;t.element&&(this._setStrokeAttributes(t.element),t.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const s=this.current;let i=s.dashArray;1!==e&&i.length>0&&(i=i.map((function(t){return e*t}))),t.setAttributeNS(null,"stroke",s.strokeColor),t.setAttributeNS(null,"stroke-opacity",s.strokeAlpha),t.setAttributeNS(null,"stroke-miterlimit",p(s.miterLimit)),t.setAttributeNS(null,"stroke-linecap",s.lineCap),t.setAttributeNS(null,"stroke-linejoin",s.lineJoin),t.setAttributeNS(null,"stroke-width",p(e*s.lineWidth)+"px"),t.setAttributeNS(null,"stroke-dasharray",i.map(p).join(" ")),t.setAttributeNS(null,"stroke-dashoffset",p(e*s.dashPhase)+"px")}eoFill(){var t;null===(t=this.current.element)||void 0===t||t.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var t;null===(t=this.current.element)||void 0===t||t.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const t=this.svgFactory.createElement("svg:rect");t.setAttributeNS(null,"x","0"),t.setAttributeNS(null,"y","0"),t.setAttributeNS(null,"width","1px"),t.setAttributeNS(null,"height","1px"),t.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(t)}paintImageXObject(t){const e=this.getObject(t);e?this.paintInlineImageXObject(e):(0,n.warn)("Dependent image with object ID ".concat(t," is not ready yet"))}paintInlineImageXObject(t,e){const s=t.width,i=t.height,n=h(t,this.forceDataSchema,!!e),a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y","0"),a.setAttributeNS(null,"width",p(s)),a.setAttributeNS(null,"height",p(i)),this.current.element=a,this.clip("nonzero");const r=this.svgFactory.createElement("svg:image");r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n),r.setAttributeNS(null,"x","0"),r.setAttributeNS(null,"y",p(-i)),r.setAttributeNS(null,"width",p(s)+"px"),r.setAttributeNS(null,"height",p(i)+"px"),r.setAttributeNS(null,"transform","scale(".concat(p(1/s)," ").concat(p(-1/i),")")),e?e.append(r):this._ensureTransformGroup().append(r)}paintImageMaskXObject(t){const e=this.getObject(t.data,t);if(e.bitmap)return void(0,n.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");const s=this.current,i=e.width,a=e.height,r=s.fillColor;s.maskId="mask".concat(v++);const o=this.svgFactory.createElement("svg:mask");o.setAttributeNS(null,"id",s.maskId);const l=this.svgFactory.createElement("svg:rect");l.setAttributeNS(null,"x","0"),l.setAttributeNS(null,"y","0"),l.setAttributeNS(null,"width",p(i)),l.setAttributeNS(null,"height",p(a)),l.setAttributeNS(null,"fill",r),l.setAttributeNS(null,"mask","url(#".concat(s.maskId,")")),this.defs.append(o),this._ensureTransformGroup().append(l),this.paintInlineImageXObject(e,o)}paintFormXObjectBegin(t,e){if(Array.isArray(t)&&6===t.length&&this.transform(t[0],t[1],t[2],t[3],t[4],t[5]),e){const t=e[2]-e[0],s=e[3]-e[1],i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x",e[0]),i.setAttributeNS(null,"y",e[1]),i.setAttributeNS(null,"width",p(t)),i.setAttributeNS(null,"height",p(s)),this.current.element=i,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(t){const e=this.svgFactory.create(t.width,t.height),s=this.svgFactory.createElement("svg:defs");e.append(s),this.defs=s;const i=this.svgFactory.createElement("svg:g");return i.setAttributeNS(null,"transform",f(t.transform)),e.append(i),this.svg=i,e}_ensureClipGroup(){if(!this.current.clipGroup){const t=this.svgFactory.createElement("svg:g");t.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(t),this.current.clipGroup=t}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",f(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.XfaText=void 0;class s{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};return function t(i){var n;if(!i)return;let a=null;const r=i.name;if("#text"===r)a=i.value;else{if(!s.shouldBuildText(r))return;null!==i&&void 0!==i&&null!==(n=i.attributes)&&void 0!==n&&n.textContent?a=i.attributes.textContent:i.value&&(a=i.value)}if(null!==a&&e.push({str:a}),i.children)for(const e of i.children)t(e)}(t),i}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}e.XfaText=s},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextLayerRenderTask=void 0,e.renderTextLayer=function(t){t.textContentSource||!t.textContent&&!t.textContentStream||((0,n.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),t.textContentSource=t.textContent||t.textContentStream);const{container:e,viewport:s}=t,i=getComputedStyle(e),a=i.getPropertyValue("visibility"),r=parseFloat(i.getPropertyValue("--scale-factor"));"visible"===a&&(!r||Math.abs(r-s.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 o=new h(t);return o._render(),o},e.updateTextLayer=function(t){let{container:e,viewport:s,textDivs:i,textDivProperties:a,isOffscreenCanvasSupported:r,mustRotate:o=!0,mustRescale:c=!0}=t;if(o&&(0,n.setLayerDimensions)(e,{rotation:s.rotation}),c){const t=l(0,r),e={prevFontSize:null,prevFontFamily:null,div:null,scale:s.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:t};for(const s of i)e.properties=a.get(s),e.div=s,d(e)}};var i=s(1),n=s(6);const a=30,r=.8,o=new Map;function l(t,e){let s;if(e&&i.FeatureTest.isOffscreenCanvasSupported)s=new OffscreenCanvas(t,t).getContext("2d",{alpha:!1});else{const e=document.createElement("canvas");e.width=e.height=t,s=e.getContext("2d",{alpha:!1})}return s}function c(t,e,s){const n=document.createElement("span"),c={angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0};t._textDivs.push(n);const d=i.Util.transform(t._transform,e.transform);let h=Math.atan2(d[1],d[0]);const u=s[e.fontName];u.vertical&&(h+=Math.PI/2);const p=Math.hypot(d[2],d[3]),f=p*function(t,e){const s=o.get(t);if(s)return s;const i=l(a,e);i.font="".concat(a,"px ").concat(t);const n=i.measureText("");let c=n.fontBoundingBoxAscent,d=Math.abs(n.fontBoundingBoxDescent);if(c){const e=c/(c+d);return o.set(t,e),i.canvas.width=i.canvas.height=0,e}i.strokeStyle="red",i.clearRect(0,0,a,a),i.strokeText("g",0,0);let h=i.getImageData(0,0,a,a).data;d=0;for(let r=h.length-1-3;r>=0;r-=4)if(h[r]>0){d=Math.ceil(r/4/a);break}i.clearRect(0,0,a,a),i.strokeText("A",0,a),h=i.getImageData(0,0,a,a).data,c=0;for(let r=0,o=h.length;r<o;r+=4)if(h[r]>0){c=a-Math.floor(r/4/a);break}if(i.canvas.width=i.canvas.height=0,c){const e=c/(c+d);return o.set(t,e),e}return o.set(t,r),r}(u.fontFamily,t._isOffscreenCanvasSupported);let g,v;0===h?(g=d[4],v=d[5]-f):(g=d[4]+f*Math.sin(h),v=d[5]-f*Math.cos(h));const _="calc(var(--scale-factor)*",m=n.style;t._container===t._rootContainer?(m.left="".concat((100*g/t._pageWidth).toFixed(2),"%"),m.top="".concat((100*v/t._pageHeight).toFixed(2),"%")):(m.left="".concat(_).concat(g.toFixed(2),"px)"),m.top="".concat(_).concat(v.toFixed(2),"px)")),m.fontSize="".concat(_).concat(p.toFixed(2),"px)"),m.fontFamily=u.fontFamily,c.fontSize=p,n.setAttribute("role","presentation"),n.textContent=e.str,n.dir=e.dir,t._fontInspectorEnabled&&(n.dataset.fontName=e.fontName),0!==h&&(c.angle=h*(180/Math.PI));let b=!1;if(e.str.length>1)b=!0;else if(" "!==e.str&&e.transform[0]!==e.transform[3]){const t=Math.abs(e.transform[0]),s=Math.abs(e.transform[3]);t!==s&&Math.max(t,s)/Math.min(t,s)>1.5&&(b=!0)}b&&(c.canvasWidth=u.vertical?e.height:e.width),t._textDivProperties.set(n,c),t._isReadableStream&&t._layoutText(n)}function d(t){const{div:e,scale:s,properties:i,ctx:n,prevFontSize:a,prevFontFamily:r}=t,{style:o}=e;let l="";if(0!==i.canvasWidth&&i.hasText){const{fontFamily:c}=o,{canvasWidth:d,fontSize:h}=i;a===h&&r===c||(n.font="".concat(h*s,"px ").concat(c),t.prevFontSize=h,t.prevFontFamily=c);const{width:u}=n.measureText(e.textContent);u>0&&(l="scaleX(".concat(d*s/u,")"))}0!==i.angle&&(l="rotate(".concat(i.angle,"deg) ").concat(l)),l.length>0&&(o.transform=l)}class h{constructor(t){var e;let{textContentSource:s,container:a,viewport:r,textDivs:o,textDivProperties:c,textContentItemsStr:d,isOffscreenCanvasSupported:h}=t;this._textContentSource=s,this._isReadableStream=s instanceof ReadableStream,this._container=this._rootContainer=a,this._textDivs=o||[],this._textContentItemsStr=d||[],this._isOffscreenCanvasSupported=h,this._fontInspectorEnabled=!(null===(e=globalThis.FontInspector)||void 0===e||!e.enabled),this._reader=null,this._textDivProperties=c||new WeakMap,this._canceled=!1,this._capability=new i.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:r.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:l(0,h)};const{pageWidth:u,pageHeight:p,pageX:f,pageY:g}=r.rawDims;this._transform=[1,0,0,-1,-f,g+p],this._pageWidth=u,this._pageHeight=p,(0,n.setLayerDimensions)(a,r),this._capability.promise.finally((()=>{this._layoutTextParams=null})).catch((()=>{}))}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new i.AbortException("TextLayer task cancelled.")).catch((()=>{})),this._reader=null),this._capability.reject(new i.AbortException("TextLayer task cancelled."))}_processItems(t,e){for(const s of t)if(void 0!==s.str)this._textContentItemsStr.push(s.str),c(this,s,e);else if("beginMarkedContentProps"===s.type||"beginMarkedContent"===s.type){const t=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==s.id&&this._container.setAttribute("id","".concat(s.id)),t.append(this._container)}else"endMarkedContent"===s.type&&(this._container=this._container.parentNode)}_layoutText(t){const e=this._layoutTextParams.properties=this._textDivProperties.get(t);if(this._layoutTextParams.div=t,d(this._layoutTextParams),e.hasText&&this._container.append(t),e.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),this._container.append(t)}}_render(){const t=new i.PromiseCapability;let e=Object.create(null);if(this._isReadableStream){const s=()=>{this._reader.read().then((i=>{let{value:n,done:a}=i;a?t.resolve():(Object.assign(e,n.styles),this._processItems(n.items,e),s())}),t.reject)};this._reader=this._textContentSource.getReader(),s()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{const{items:e,styles:s}=this._textContentSource;this._processItems(e,s),t.resolve()}}t.promise.then((()=>{e=null,function(t){if(t._canceled)return;const e=t._textDivs,s=t._capability;if(e.length>1e5)s.resolve();else{if(!t._isReadableStream)for(const s of e)t._layoutText(s);s.resolve()}}(this)}),this._capability.reject)}}e.TextLayerRenderTask=h},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditorLayer=void 0;var i=s(1),n=s(4),a=s(28),r=s(33),o=s(6),l=s(34),c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,v=new WeakMap,_=new WeakMap,m=new WeakMap,b=new WeakSet;class y{constructor(t){let{uiManager:e,pageIndex:s,div:i,accessibilityManager:n,annotationLayer:o,viewport:P,l10n:A}=t;_classPrivateMethodInitSpec(this,b),_classPrivateFieldInitSpec(this,c,void 0),_classPrivateFieldInitSpec(this,d,!1),_classPrivateFieldInitSpec(this,h,null),_classPrivateFieldInitSpec(this,u,this.pointerup.bind(this)),_classPrivateFieldInitSpec(this,p,this.pointerdown.bind(this)),_classPrivateFieldInitSpec(this,f,new Map),_classPrivateFieldInitSpec(this,g,!1),_classPrivateFieldInitSpec(this,v,!1),_classPrivateFieldInitSpec(this,_,!1),_classPrivateFieldInitSpec(this,m,void 0);const S=[a.FreeTextEditor,r.InkEditor,l.StampEditor];if(!y._initialized){y._initialized=!0;for(const t of S)t.initialize(A)}e.registerEditorTypes(S),_classPrivateFieldSet(m,this,e),this.pageIndex=s,this.div=i,_classPrivateFieldSet(c,this,n),_classPrivateFieldSet(h,this,o),this.viewport=P,_classPrivateFieldGet(m,this).addLayer(this)}get isEmpty(){return 0===_classPrivateFieldGet(f,this).size}updateToolbar(t){_classPrivateFieldGet(m,this).updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_classPrivateFieldGet(m,this).getMode();_assertClassBrand(b,this,F).call(this),t===i.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),t!==i.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",t===i.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",t===i.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",t===i.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(t){if(t||_classPrivateFieldGet(m,this).getMode()===i.AnnotationEditorType.INK){if(!t)for(const t of _classPrivateFieldGet(f,this).values())if(t.isEmpty())return void t.setInBackground();_assertClassBrand(b,this,A).call(this,{offsetX:0,offsetY:0},!1).setInBackground()}}setEditingState(t){_classPrivateFieldGet(m,this).setEditingState(t)}addCommands(t){_classPrivateFieldGet(m,this).addCommands(t)}enable(){this.div.style.pointerEvents="auto";const t=new Set;for(const s of _classPrivateFieldGet(f,this).values())s.enableEditing(),s.annotationElementId&&t.add(s.annotationElementId);if(!_classPrivateFieldGet(h,this))return;const e=_classPrivateFieldGet(h,this).getEditableAnnotations();for(const s of e){if(s.hide(),_classPrivateFieldGet(m,this).isDeletedAnnotationElement(s.data.id))continue;if(t.has(s.data.id))continue;const e=this.deserialize(s);e&&(this.addOrRebuild(e),e.enableEditing())}}disable(){_classPrivateFieldSet(_,this,!0),this.div.style.pointerEvents="none";const t=new Set;for(const s of _classPrivateFieldGet(f,this).values()){var e;s.disableEditing(),s.annotationElementId&&null===s.serialize()?(null===(e=this.getEditableAnnotation(s.annotationElementId))||void 0===e||e.show(),s.remove()):t.add(s.annotationElementId)}if(_classPrivateFieldGet(h,this)){const e=_classPrivateFieldGet(h,this).getEditableAnnotations();for(const s of e){const{id:e}=s.data;t.has(e)||_classPrivateFieldGet(m,this).isDeletedAnnotationElement(e)||s.show()}}_assertClassBrand(b,this,F).call(this),this.isEmpty&&(this.div.hidden=!0),_classPrivateFieldSet(_,this,!1)}getEditableAnnotation(t){var e;return(null===(e=_classPrivateFieldGet(h,this))||void 0===e?void 0:e.getEditableAnnotation(t))||null}setActiveEditor(t){_classPrivateFieldGet(m,this).getActive()!==t&&_classPrivateFieldGet(m,this).setActiveEditor(t)}enableClick(){this.div.addEventListener("pointerdown",_classPrivateFieldGet(p,this)),this.div.addEventListener("pointerup",_classPrivateFieldGet(u,this))}disableClick(){this.div.removeEventListener("pointerdown",_classPrivateFieldGet(p,this)),this.div.removeEventListener("pointerup",_classPrivateFieldGet(u,this))}attach(t){_classPrivateFieldGet(f,this).set(t.id,t);const{annotationElementId:e}=t;e&&_classPrivateFieldGet(m,this).isDeletedAnnotationElement(e)&&_classPrivateFieldGet(m,this).removeDeletedAnnotationElement(t)}detach(t){var e;_classPrivateFieldGet(f,this).delete(t.id),null===(e=_classPrivateFieldGet(c,this))||void 0===e||e.removePointerInTextLayer(t.contentDiv),!_classPrivateFieldGet(_,this)&&t.annotationElementId&&_classPrivateFieldGet(m,this).addDeletedAnnotationElement(t)}remove(t){this.detach(t),_classPrivateFieldGet(m,this).removeEditor(t),t.div.contains(document.activeElement)&&setTimeout((()=>{_classPrivateFieldGet(m,this).focusMainContainer()}),0),t.div.remove(),t.isAttachedToDOM=!1,_classPrivateFieldGet(v,this)||this.addInkEditorIfNeeded(!1)}changeParent(t){var e;t.parent!==this&&(t.annotationElementId&&(_classPrivateFieldGet(m,this).addDeletedAnnotationElement(t.annotationElementId),n.AnnotationEditor.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),null===(e=t.parent)||void 0===e||e.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(this.changeParent(t),_classPrivateFieldGet(m,this).addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(),_classPrivateFieldGet(m,this).addToAnnotationStorage(t)}moveEditorInDOM(t){var e;if(!t.isAttachedToDOM)return;const{activeElement:s}=document;t.div.contains(s)&&(t._focusEventsAllowed=!1,setTimeout((()=>{t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",(()=>{t._focusEventsAllowed=!0}),{once:!0}),s.focus())}),0)),t._structTreeParentId=null===(e=_classPrivateFieldGet(c,this))||void 0===e?void 0:e.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?t.rebuild():this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getNextId(){return _classPrivateFieldGet(m,this).getId()}pasteEditor(t,e){_classPrivateFieldGet(m,this).updateToolbar(t),_classPrivateFieldGet(m,this).updateMode(t);const{offsetX:s,offsetY:i}=_assertClassBrand(b,this,S).call(this),n=this.getNextId(),a=_assertClassBrand(b,this,P).call(this,{parent:this,id:n,x:s,y:i,uiManager:_classPrivateFieldGet(m,this),isCentered:!0,...e});a&&this.add(a)}deserialize(t){var e;switch(null!==(e=t.annotationType)&&void 0!==e?e:t.annotationEditorType){case i.AnnotationEditorType.FREETEXT:return a.FreeTextEditor.deserialize(t,this,_classPrivateFieldGet(m,this));case i.AnnotationEditorType.INK:return r.InkEditor.deserialize(t,this,_classPrivateFieldGet(m,this));case i.AnnotationEditorType.STAMP:return l.StampEditor.deserialize(t,this,_classPrivateFieldGet(m,this))}return null}addNewEditor(){_assertClassBrand(b,this,A).call(this,_assertClassBrand(b,this,S).call(this),!0)}setSelected(t){_classPrivateFieldGet(m,this).setSelected(t)}toggleSelected(t){_classPrivateFieldGet(m,this).toggleSelected(t)}isSelected(t){return _classPrivateFieldGet(m,this).isSelected(t)}unselect(t){_classPrivateFieldGet(m,this).unselect(t)}pointerup(t){const{isMac:e}=i.FeatureTest.platform;0!==t.button||t.ctrlKey&&e||t.target===this.div&&_classPrivateFieldGet(g,this)&&(_classPrivateFieldSet(g,this,!1),_classPrivateFieldGet(d,this)?_classPrivateFieldGet(m,this).getMode()!==i.AnnotationEditorType.STAMP?_assertClassBrand(b,this,A).call(this,t,!1):_classPrivateFieldGet(m,this).unselectAll():_classPrivateFieldSet(d,this,!0))}pointerdown(t){if(_classPrivateFieldGet(g,this))return void _classPrivateFieldSet(g,this,!1);const{isMac:e}=i.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;_classPrivateFieldSet(g,this,!0);const s=_classPrivateFieldGet(m,this).getActive();_classPrivateFieldSet(d,this,!s||s.isEmpty())}findNewParent(t,e,s){const i=_classPrivateFieldGet(m,this).findParent(e,s);return null!==i&&i!==this&&(i.changeParent(t),!0)}destroy(){var t;(null===(t=_classPrivateFieldGet(m,this).getActive())||void 0===t?void 0:t.parent)===this&&(_classPrivateFieldGet(m,this).commitOrRemove(),_classPrivateFieldGet(m,this).setActiveEditor(null));for(const s of _classPrivateFieldGet(f,this).values()){var e;null===(e=_classPrivateFieldGet(c,this))||void 0===e||e.removePointerInTextLayer(s.contentDiv),s.setParent(null),s.isAttachedToDOM=!1,s.div.remove()}this.div=null,_classPrivateFieldGet(f,this).clear(),_classPrivateFieldGet(m,this).removeLayer(this)}render(t){let{viewport:e}=t;this.viewport=e,(0,o.setLayerDimensions)(this.div,e);for(const s of _classPrivateFieldGet(m,this).getEditors(this.pageIndex))this.add(s);this.updateMode()}update(t){let{viewport:e}=t;_classPrivateFieldGet(m,this).commitOrRemove(),this.viewport=e,(0,o.setLayerDimensions)(this.div,{rotation:e.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}}function P(t){switch(_classPrivateFieldGet(m,this).getMode()){case i.AnnotationEditorType.FREETEXT:return new a.FreeTextEditor(t);case i.AnnotationEditorType.INK:return new r.InkEditor(t);case i.AnnotationEditorType.STAMP:return new l.StampEditor(t)}return null}function A(t,e){const s=this.getNextId(),i=_assertClassBrand(b,this,P).call(this,{parent:this,id:s,x:t.offsetX,y:t.offsetY,uiManager:_classPrivateFieldGet(m,this),isCentered:e});return i&&this.add(i),i}function S(){const{x:t,y:e,width:s,height:i}=this.div.getBoundingClientRect(),n=Math.max(0,t),a=Math.max(0,e),r=(n+Math.min(window.innerWidth,t+s))/2-t,o=(a+Math.min(window.innerHeight,e+i))/2-e,[l,c]=this.viewport.rotation%180===0?[r,o]:[o,r];return{offsetX:l,offsetY:c}}function F(){_classPrivateFieldSet(v,this,!0);for(const t of _classPrivateFieldGet(f,this).values())t.isEmpty()&&t.remove();_classPrivateFieldSet(v,this,!1)}_defineProperty(y,"_initialized",!1),e.AnnotationEditorLayer=y},(t,e,s)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.FreeTextEditor=void 0;var n=s(1),a=s(5),r=s(4),o=s(29),l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,v=new WeakMap,_=new WeakSet;class m extends r.AnnotationEditor{static get _keyboardManager(){const t=m.prototype,e=t=>t.isEmpty(),s=a.AnnotationEditorUIManager.TRANSLATE_SMALL,i=a.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,n.shadow)(this,"_keyboardManager",new a.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-s,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[s,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[i,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-s],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:e}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,s],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,i],checker:e}]]))}constructor(t){super({...t,name:"freeTextEditor"}),_classPrivateMethodInitSpec(this,_),_classPrivateFieldInitSpec(this,l,this.editorDivBlur.bind(this)),_classPrivateFieldInitSpec(this,c,this.editorDivFocus.bind(this)),_classPrivateFieldInitSpec(this,d,this.editorDivInput.bind(this)),_classPrivateFieldInitSpec(this,h,this.editorDivKeydown.bind(this)),_classPrivateFieldInitSpec(this,u,void 0),_classPrivateFieldInitSpec(this,p,""),_classPrivateFieldInitSpec(this,f,"".concat(this.id,"-editor")),_classPrivateFieldInitSpec(this,g,void 0),_classPrivateFieldInitSpec(this,v,null),_classPrivateFieldSet(u,this,t.color||m._defaultColor||r.AnnotationEditor._defaultLineColor),_classPrivateFieldSet(g,this,t.fontSize||m._defaultFontSize)}static initialize(t){r.AnnotationEditor.initialize(t,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});const e=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(e.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case n.AnnotationEditorParamsType.FREETEXT_SIZE:m._defaultFontSize=e;break;case n.AnnotationEditorParamsType.FREETEXT_COLOR:m._defaultColor=e}}updateParams(t,e){switch(t){case n.AnnotationEditorParamsType.FREETEXT_SIZE:_assertClassBrand(_,this,b).call(this,e);break;case n.AnnotationEditorParamsType.FREETEXT_COLOR:_assertClassBrand(_,this,y).call(this,e)}}static get defaultPropertiesToUpdate(){return[[n.AnnotationEditorParamsType.FREETEXT_SIZE,m._defaultFontSize],[n.AnnotationEditorParamsType.FREETEXT_COLOR,m._defaultColor||r.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[n.AnnotationEditorParamsType.FREETEXT_SIZE,_classPrivateFieldGet(g,this)],[n.AnnotationEditorParamsType.FREETEXT_COLOR,_classPrivateFieldGet(u,this)]]}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-m._internalPadding*t,-(m._internalPadding+_classPrivateFieldGet(g,this))*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(n.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",_classPrivateFieldGet(h,this)),this.editorDiv.addEventListener("focus",_classPrivateFieldGet(c,this)),this.editorDiv.addEventListener("blur",_classPrivateFieldGet(l,this)),this.editorDiv.addEventListener("input",_classPrivateFieldGet(d,this)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",_classPrivateFieldGet(f,this)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",_classPrivateFieldGet(h,this)),this.editorDiv.removeEventListener("focus",_classPrivateFieldGet(c,this)),this.editorDiv.removeEventListener("blur",_classPrivateFieldGet(l,this)),this.editorDiv.removeEventListener("input",_classPrivateFieldGet(d,this)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var t;this.width?_assertClassBrand(_,this,w).call(this):(this.enableEditMode(),this.editorDiv.focus(),null!==(t=this._initialOptions)&&void 0!==t&&t.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 t=_classPrivateFieldGet(p,this),e=_classPrivateFieldSet(p,this,_assertClassBrand(_,this,P).call(this).trimEnd());if(t===e)return;const s=t=>{_classPrivateFieldSet(p,this,t),t?(_assertClassBrand(_,this,S).call(this),this._uiManager.rebuild(this),_assertClassBrand(_,this,A).call(this)):this.remove()};this.addCommands({cmd:()=>{s(e)},undo:()=>{s(t)},mustExec:!1}),_assertClassBrand(_,this,A).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){m._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){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 t,e;this.width&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",_classPrivateFieldGet(f,this)),this.enableEditing(),r.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then((t=>{var e;return null===(e=this.editorDiv)||void 0===e?void 0:e.setAttribute("aria-label",t)})),r.AnnotationEditor._l10nPromise.get("free_text2_default_content").then((t=>{var e;return null===(e=this.editorDiv)||void 0===e?void 0:e.setAttribute("default-content",t)})),this.editorDiv.contentEditable=!0;const{style:s}=this.editorDiv;if(s.fontSize="calc(".concat(_classPrivateFieldGet(g,this),"px * var(--scale-factor))"),s.color=_classPrivateFieldGet(u,this),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,a.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[s,i]=this.parentDimensions;if(this.annotationElementId){const{position:n}=_classPrivateFieldGet(v,this);let[a,r]=this.getInitialTranslation();[a,r]=this.pageTranslationToScreen(a,r);const[o,l]=this.pageDimensions,[c,d]=this.pageTranslation;let h,u;switch(this.rotation){case 0:h=t+(n[0]-c)/o,u=e+this.height-(n[1]-d)/l;break;case 90:h=t+(n[0]-c)/o,u=e-(n[1]-d)/l,[a,r]=[r,-a];break;case 180:h=t-this.width+(n[0]-c)/o,u=e-(n[1]-d)/l,[a,r]=[-a,-r];break;case 270:h=t+(n[0]-c-this.height*l)/o,u=e+(n[1]-d-this.width*o)/l,[a,r]=[-r,a]}this.setAt(h*s,u*i,a,r)}else this.setAt(t*s,e*i,this.width*s,this.height*i);_assertClassBrand(_,this,S).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(t,e,s){let i=null;if(t instanceof o.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:e,fontColor:s},rect:a,rotation:r,id:o},textContent:l,textPosition:c,parent:{page:{pageNumber:d}}}=t;if(!l||0===l.length)return null;i=t={annotationType:n.AnnotationEditorType.FREETEXT,color:Array.from(s),fontSize:e,value:l.join("\n"),position:c,pageIndex:d-1,rect:a,rotation:r,id:o,deleted:!1}}const a=super.deserialize(t,e,s);return _classPrivateFieldSet(g,a,t.fontSize),_classPrivateFieldSet(u,a,n.Util.makeHexColor(...t.color)),_classPrivateFieldSet(p,a,t.value),a.annotationElementId=t.id||null,_classPrivateFieldSet(v,a,i),a}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const e=m._internalPadding*this.parentScale,s=this.getRect(e,e),i=r.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:_classPrivateFieldGet(u,this)),a={annotationType:n.AnnotationEditorType.FREETEXT,color:i,fontSize:_classPrivateFieldGet(g,this),value:_classPrivateFieldGet(p,this),pageIndex:this.pageIndex,rect:s,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?a:this.annotationElementId&&!_assertClassBrand(_,this,F).call(this,a)?null:(a.id=this.annotationElementId,a)}}function b(t){const e=t=>{this.editorDiv.style.fontSize="calc(".concat(t,"px * var(--scale-factor))"),this.translate(0,-(t-_classPrivateFieldGet(g,this))*this.parentScale),_classPrivateFieldSet(g,this,t),_assertClassBrand(_,this,A).call(this)},s=_classPrivateFieldGet(g,this);this.addCommands({cmd:()=>{e(t)},undo:()=>{e(s)},mustExec:!0,type:n.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function y(t){const e=_classPrivateFieldGet(u,this);this.addCommands({cmd:()=>{_classPrivateFieldSet(u,this,this.editorDiv.style.color=t)},undo:()=>{_classPrivateFieldSet(u,this,this.editorDiv.style.color=e)},mustExec:!0,type:n.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function P(){const t=this.editorDiv.getElementsByTagName("div");if(0===t.length)return this.editorDiv.innerText;const e=[];for(const s of t)e.push(s.innerText.replace(/\r\n?|\n/,""));return e.join("\n")}function A(){const[t,e]=this.parentDimensions;let s;if(this.isAttachedToDOM)s=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,i=e.style.display;e.style.display="hidden",t.div.append(this.div),s=e.getBoundingClientRect(),e.remove(),e.style.display=i}this.rotation%180===this.parentRotation%180?(this.width=s.width/t,this.height=s.height/e):(this.width=s.height/t,this.height=s.width/e),this.fixAndSetPosition()}function S(){if(this.editorDiv.replaceChildren(),_classPrivateFieldGet(p,this))for(const t of _classPrivateFieldGet(p,this).split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}function F(t){const{value:e,fontSize:s,color:i,rect:n,pageIndex:a}=_classPrivateFieldGet(v,this);return t.value!==e||t.fontSize!==s||t.rect.some(((t,e)=>Math.abs(t-n[e])>=1))||t.color.some(((t,e)=>t!==i[e]))||t.pageIndex!==a}function w(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.annotationElementId)return;if(_assertClassBrand(_,this,A).call(this),!t&&(0===this.width||0===this.height))return void setTimeout((()=>_assertClassBrand(_,this,w).call(this,!0)),0);const e=i._internalPadding*this.parentScale;_classPrivateFieldGet(v,this).rect=this.getRect(e,e)}i=m,_defineProperty(m,"_freeTextDefaultContent",""),_defineProperty(m,"_internalPadding",0),_defineProperty(m,"_defaultColor",null),_defineProperty(m,"_defaultFontSize",10),_defineProperty(m,"_type","freetext"),e.FreeTextEditor=m},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StampAnnotationElement=e.InkAnnotationElement=e.FreeTextAnnotationElement=e.AnnotationLayer=void 0;var i=s(1),n=s(6),a=s(3),r=s(30),o=s(31),l=s(32);const c=1e3,d=new WeakSet;function h(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class u{static create(t){switch(t.data.annotationType){case i.AnnotationType.LINK:return new v(t);case i.AnnotationType.TEXT:return new b(t);case i.AnnotationType.WIDGET:switch(t.data.fieldType){case"Tx":return new P(t);case"Btn":return t.data.radioButton?new F(t):t.data.checkBox?new S(t):new w(t);case"Ch":return new x(t);case"Sig":return new A(t)}return new y(t);case i.AnnotationType.POPUP:return new C(t);case i.AnnotationType.FREETEXT:return new Q(t);case i.AnnotationType.LINE:return new $(t);case i.AnnotationType.SQUARE:return new et(t);case i.AnnotationType.CIRCLE:return new it(t);case i.AnnotationType.POLYLINE:return new at(t);case i.AnnotationType.CARET:return new ot(t);case i.AnnotationType.INK:return new ct(t);case i.AnnotationType.POLYGON:return new rt(t);case i.AnnotationType.HIGHLIGHT:return new dt(t);case i.AnnotationType.UNDERLINE:return new ht(t);case i.AnnotationType.SQUIGGLY:return new ut(t);case i.AnnotationType.STRIKEOUT:return new pt(t);case i.AnnotationType.STAMP:return new ft(t);case i.AnnotationType.FILEATTACHMENT:return new _t(t);default:return new f(t)}}}var p=new WeakMap;class f{constructor(t){let{isRenderable:e=!1,ignoreBorder:s=!1,createQuadrilaterals:i=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classPrivateFieldInitSpec(this,p,!1),this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(s)),i&&this._createQuadrilaterals()}static _hasPopupData(t){let{titleObj:e,contentsObj:s,richText:i}=t;return!!(null!==e&&void 0!==e&&e.str||null!==s&&void 0!==s&&s.str||null!==i&&void 0!==i&&i.str)}get hasPopupData(){return f._hasPopupData(this.data)}_createContainer(t){const{data:e,parent:{page:s,viewport:n}}=this,a=document.createElement("section");a.setAttribute("data-annotation-id",e.id),this instanceof y||(a.tabIndex=c),a.style.zIndex=this.parent.zIndex++,this.data.popupRef&&a.setAttribute("aria-haspopup","dialog"),e.noRotate&&a.classList.add("norotate");const{pageWidth:r,pageHeight:o,pageX:l,pageY:d}=n.rawDims;if(!e.rect||this instanceof C){const{rotation:t}=e;return e.hasOwnCanvas||0===t||this.setRotation(t,a),a}const{width:u,height:f}=h(e.rect),g=i.Util.normalizeRect([e.rect[0],s.view[3]-e.rect[1]+s.view[1],e.rect[2],s.view[3]-e.rect[3]+s.view[1]]);if(!t&&e.borderStyle.width>0){a.style.borderWidth="".concat(e.borderStyle.width,"px");const t=e.borderStyle.horizontalCornerRadius,s=e.borderStyle.verticalCornerRadius;if(t>0||s>0){const e="calc(".concat(t,"px * var(--scale-factor)) / calc(").concat(s,"px * var(--scale-factor))");a.style.borderRadius=e}else if(this instanceof F){const t="calc(".concat(u,"px * var(--scale-factor)) / calc(").concat(f,"px * var(--scale-factor))");a.style.borderRadius=t}switch(e.borderStyle.style){case i.AnnotationBorderStyleType.SOLID:a.style.borderStyle="solid";break;case i.AnnotationBorderStyleType.DASHED:a.style.borderStyle="dashed";break;case i.AnnotationBorderStyleType.BEVELED:(0,i.warn)("Unimplemented border style: beveled");break;case i.AnnotationBorderStyleType.INSET:(0,i.warn)("Unimplemented border style: inset");break;case i.AnnotationBorderStyleType.UNDERLINE:a.style.borderBottomStyle="solid"}const n=e.borderColor||null;n?(_classPrivateFieldSet(p,this,!0),a.style.borderColor=i.Util.makeHexColor(0|n[0],0|n[1],0|n[2])):a.style.borderWidth=0}a.style.left="".concat(100*(g[0]-l)/r,"%"),a.style.top="".concat(100*(g[1]-d)/o,"%");const{rotation:v}=e;return e.hasOwnCanvas||0===v?(a.style.width="".concat(100*u/r,"%"),a.style.height="".concat(100*f/o,"%")):this.setRotation(v,a),a}setRotation(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;if(!this.data.rect)return;const{pageWidth:s,pageHeight:i}=this.parent.viewport.rawDims,{width:n,height:a}=h(this.data.rect);let r,o;t%180===0?(r=100*n/s,o=100*a/i):(r=100*a/s,o=100*n/i),e.style.width="".concat(r,"%"),e.style.height="".concat(o,"%"),e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(t,e,s)=>{const i=s.detail[t],n=i[0],a=i.slice(1);s.target.style[e]=r.ColorConverters["".concat(n,"_HTML")](a),this.annotationStorage.setValue(this.data.id,{[e]:r.ColorConverters["".concat(n,"_rgb")](a)})};return(0,i.shadow)(this,"_commonActions",{display:t=>{const{display:e}=t.detail,s=e%2===1;this.container.style.visibility=s?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:s,noPrint:1===e||2===e})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:e}=t.detail;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},focus:t=>{setTimeout((()=>t.target.focus({preventScroll:!1})),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:t=>{const e=t.detail.rotation;this.setRotation(e),this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){const s=this._commonActions;for(const i of Object.keys(e.detail)){const n=t[i]||s[i];null===n||void 0===n||n(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const s=this._commonActions;for(const[i,n]of Object.entries(e)){const a=s[i];a&&(a({detail:{[i]:n},target:t}),delete e[i])}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,s,i,n]=this.data.rect;if(1===t.length){const[,{x:a,y:r},{x:o,y:l}]=t[0];if(i===a&&n===r&&e===o&&s===l)return}const{style:a}=this.container;let r;if(_classPrivateFieldGet(p,this)){const{borderColor:t,borderWidth:e}=a;a.borderWidth=0,r=["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="'.concat(t,'" stroke-width="').concat(e,'">')],this.container.classList.add("hasBorder")}const o=i-e,l=n-s,{svgFactory:c}=this,d=c.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0);const h=c.createElement("defs");d.append(h);const u=c.createElement("clipPath"),f="clippath_".concat(this.data.id);u.setAttribute("id",f),u.setAttribute("clipPathUnits","objectBoundingBox"),h.append(u);for(const[,{x:p,y:v},{x:_,y:m}]of t){var g;const t=c.createElement("rect"),s=(_-e)/o,i=(n-v)/l,a=(p-_)/o,d=(v-m)/l;t.setAttribute("x",s),t.setAttribute("y",i),t.setAttribute("width",a),t.setAttribute("height",d),u.append(t),null===(g=r)||void 0===g||g.push('<rect vector-effect="non-scaling-stroke" x="'.concat(s,'" y="').concat(i,'" width="').concat(a,'" height="').concat(d,'"/>'))}_classPrivateFieldGet(p,this)&&(r.push("</g></svg>')"),a.backgroundImage=r.join("")),this.container.append(d),this.container.style.clipPath="url(#".concat(f,")")}_createPopup(){const{container:t,data:e}=this;t.setAttribute("aria-haspopup","dialog");const s=new C({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:"popup_".concat(e.id),rotation:e.rotation},parent:this.parent,elements:[this]});this.parent.div.append(s.render())}render(){(0,i.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const s=[];if(this._fieldObjects){const n=this._fieldObjects[t];if(n)for(const{page:t,id:a,exportValues:r}of n){if(-1===t)continue;if(a===e)continue;const n="string"===typeof r?r:null,o=document.querySelector('[data-element-id="'.concat(a,'"]'));!o||d.has(o)?s.push({id:a,exportValue:n,domElement:o}):(0,i.warn)("_getElementsByName - element not allowed: ".concat(a))}return s}for(const i of document.getElementsByName(t)){const{exportValue:t}=i,n=i.getAttribute("data-element-id");n!==e&&d.has(i)&&s.push({id:n,exportValue:t,domElement:i})}return s}show(){var t;this.container&&(this.container.hidden=!1),null===(t=this.popup)||void 0===t||t.maybeShow()}hide(){var t;this.container&&(this.container.hidden=!0),null===(t=this.popup)||void 0===t||t.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",(()=>{var s;null===(s=this.linkService.eventBus)||void 0===s||s.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})}))}}var g=new WeakSet;class v extends f{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(t,{isRenderable:!0,ignoreBorder:!(null===e||void 0===e||!e.ignoreBorder),createQuadrilaterals:!0}),_classPrivateMethodInitSpec(this,g),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,s=document.createElement("a");s.setAttribute("data-element-id",t.id);let i=!1;return t.url?(e.addLinkAttributes(s,t.url,t.newWindow),i=!0):t.action?(this._bindNamedAction(s,t.action),i=!0):t.attachment?(this._bindAttachment(s,t.attachment),i=!0):t.setOCGState?(_assertClassBrand(g,this,m).call(this,s,t.setOCGState),i=!0):t.dest?(this._bindLink(s,t.dest),i=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(s,t),i=!0),t.resetForm?(this._bindResetFormAction(s,t.resetForm),i=!0):this.isTooltipOnly&&!i&&(this._bindLink(s,""),i=!0)),this.container.classList.add("linkAnnotation"),i&&this.container.append(s),this.container}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&_assertClassBrand(g,this,_).call(this)}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),_assertClassBrand(g,this,_).call(this)}_bindAttachment(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>{var t;return null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.container,e.content,e.filename),!1},_assertClassBrand(g,this,_).call(this)}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const s=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const i of Object.keys(e.actions)){const n=s.get(i);n&&(t[n]=()=>{var t;return null===(t=this.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:i}}),!1})}t.onclick||(t.onclick=()=>!1),_assertClassBrand(g,this,_).call(this)}_bindResetFormAction(t,e){const s=t.onclick;if(s||(t.href=this.linkService.getAnchorUrl("")),_assertClassBrand(g,this,_).call(this),!this._fieldObjects)return(0,i.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(s||(t.onclick=()=>!1));t.onclick=()=>{null===s||void 0===s||s();const{fields:t,refs:n,include:a}=e,r=[];if(0!==t.length||0!==n.length){const e=new Set(n);for(const s of t){const t=this._fieldObjects[s]||[];for(const{id:s}of t)e.add(s)}for(const t of Object.values(this._fieldObjects))for(const s of t)e.has(s.id)===a&&r.push(s)}else for(const e of Object.values(this._fieldObjects))r.push(...e);const o=this.annotationStorage,l=[];for(const e of r){const{id:t}=e;switch(l.push(t),e.type){case"text":{const s=e.defaultValue||"";o.setValue(t,{value:s});break}case"checkbox":case"radiobutton":{const s=e.defaultValue===e.exportValues;o.setValue(t,{value:s});break}case"combobox":case"listbox":{const s=e.defaultValue||"";o.setValue(t,{value:s});break}default:continue}const s=document.querySelector('[data-element-id="'.concat(t,'"]'));s&&(d.has(s)?s.dispatchEvent(new Event("resetform")):(0,i.warn)("_bindResetFormAction - element not allowed: ".concat(t)))}var c;return this.enableScripting&&(null===(c=this.linkService.eventBus)||void 0===c||c.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}})),!1}}}function _(){this.container.setAttribute("data-internal-link","")}function m(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),_assertClassBrand(g,this,_).call(this)}class b extends f{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.alt="[{{type}} Annotation]",t.dataset.l10nId="text_annotation_type",t.dataset.l10nArgs=JSON.stringify({type:this.data.name}),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class y extends f{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(t){var e;this.data.hasOwnCanvas&&("CANVAS"===(null===(e=t.previousSibling)||void 0===e?void 0:e.nodeName)&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){const{isWin:e,isMac:s}=i.FeatureTest.platform;return e&&t.ctrlKey||s&&t.metaKey}_setEventListener(t,e,s,i,n){s.includes("mouse")?t.addEventListener(s,(t=>{var e;null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:n(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})})):t.addEventListener(s,(t=>{var a;if("blur"===s){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===s){if(e.focused)return;e.focused=!0}n&&(null===(a=this.linkService.eventBus)||void 0===a||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:n(t)}}))}))}_setEventListeners(t,e,s,i){for(const[o,l]of s){var n,a,r;("Action"===l||null!==(n=this.data.actions)&&void 0!==n&&n[l])&&("Focus"!==l&&"Blur"!==l||e||(e={focused:!1}),this._setEventListener(t,e,o,l,i),"Focus"!==l||null!==(a=this.data.actions)&&void 0!==a&&a.Blur?"Blur"!==l||null!==(r=this.data.actions)&&void 0!==r&&r.Focus||this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null))}}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":i.Util.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:s}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,a=t.style;let r;const o=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(i.LINE_FACTOR*n))||1);r=Math.min(n,o(e/i.LINE_FACTOR))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);r=Math.min(n,o(t/i.LINE_FACTOR))}a.fontSize="calc(".concat(r,"px * var(--scale-factor))"),a.color=i.Util.makeHexColor(s[0],s[1],s[2]),null!==this.data.textAlignment&&(a.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class P extends y{constructor(t){super(t,{isRenderable:t.renderForms||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,s,i){const n=this.annotationStorage;for(const a of this._getElementsByName(t.name,t.id))a.domElement&&(a.domElement[e]=s),n.setValue(a.id,{[i]:s})}render(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let s=null;if(this.renderForms){var i;const o=t.getValue(e,{value:this.data.fieldValue});let l=o.value||"";const h=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;h&&l.length>h&&(l=l.slice(0,h));let u=o.formattedValue||(null===(i=this.data.textContent)||void 0===i?void 0:i.join("\n"))||null;u&&this.data.comb&&(u=u.replaceAll(/\s+/g,""));const p={userValue:l,formattedValue:u,lastCommittedValue:null,commitKey:1,focused:!1};var n,a;this.data.multiLine?(s=document.createElement("textarea"),s.textContent=null!==(n=u)&&void 0!==n?n:l,this.data.doNotScroll&&(s.style.overflowY="hidden")):(s=document.createElement("input"),s.type="text",s.setAttribute("value",null!==(a=u)&&void 0!==a?a:l),this.data.doNotScroll&&(s.style.overflowX="hidden")),this.data.hasOwnCanvas&&(s.hidden=!0),d.add(s),s.setAttribute("data-element-id",e),s.disabled=this.data.readOnly,s.name=this.data.fieldName,s.tabIndex=c,this._setRequired(s,this.data.required),h&&(s.maxLength=h),s.addEventListener("input",(i=>{t.setValue(e,{value:i.target.value}),this.setPropertyOnSiblings(s,"value",i.target.value,"value"),p.formattedValue=null})),s.addEventListener("resetform",(t=>{var e;const i=null!==(e=this.data.defaultFieldValue)&&void 0!==e?e:"";s.value=p.userValue=i,p.formattedValue=null}));let f=t=>{const{formattedValue:e}=p;null!==e&&void 0!==e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var r;s.addEventListener("focus",(t=>{if(p.focused)return;const{target:e}=t;p.userValue&&(e.value=p.userValue),p.lastCommittedValue=e.value,p.commitKey=1,p.focused=!0})),s.addEventListener("updatefromsandbox",(s=>{this.showElementAndHideCanvas(s.target);const i={value(s){var i;p.userValue=null!==(i=s.detail.value)&&void 0!==i?i:"",t.setValue(e,{value:p.userValue.toString()}),s.target.value=p.userValue},formattedValue(s){const{formattedValue:i}=s.detail;p.formattedValue=i,null!==i&&void 0!==i&&s.target!==document.activeElement&&(s.target.value=i),t.setValue(e,{formattedValue:i})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:s=>{var i;const{charLimit:n}=s.detail,{target:a}=s;if(0===n)return void a.removeAttribute("maxLength");a.setAttribute("maxLength",n);let r=p.userValue;!r||r.length<=n||(r=r.slice(0,n),a.value=p.userValue=r,t.setValue(e,{value:r}),null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,willCommit:!0,commitKey:1,selStart:a.selectionStart,selEnd:a.selectionEnd}}))}};this._dispatchEventFromSandbox(i,s)})),s.addEventListener("keydown",(t=>{var s;p.commitKey=1;let i=-1;if("Escape"===t.key?i=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(p.commitKey=3):i=2,-1===i)return;const{value:n}=t.target;p.lastCommittedValue!==n&&(p.lastCommittedValue=n,p.userValue=n,null===(s=this.linkService.eventBus)||void 0===s||s.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:i,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))}));const i=f;f=null,s.addEventListener("blur",(t=>{if(!p.focused||!t.relatedTarget)return;p.focused=!1;const{value:s}=t.target;var n;p.userValue=s,p.lastCommittedValue!==s&&(null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:p.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}})),i(t)})),null!==(r=this.data.actions)&&void 0!==r&&r.Keystroke&&s.addEventListener("beforeinput",(t=>{var s;p.lastCommittedValue=null;const{data:i,target:n}=t,{value:a,selectionStart:r,selectionEnd:o}=n;let l=r,c=o;switch(t.inputType){case"deleteWordBackward":{const t=a.substring(0,r).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=a.substring(r).match(/^[^\w]*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":r===o&&(l-=1);break;case"deleteContentForward":r===o&&(c+=1)}t.preventDefault(),null===(s=this.linkService.eventBus)||void 0===s||s.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,change:i||"",willCommit:!1,selStart:l,selEnd:c}})})),this._setEventListeners(s,p,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.value))}if(f&&s.addEventListener("blur",f),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/h;s.classList.add("comb"),s.style.letterSpacing="calc(".concat(t,"px * var(--scale-factor) - 1ch)")}}else s=document.createElement("div"),s.textContent=this.data.fieldValue,s.style.verticalAlign="middle",s.style.display="table-cell";return this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class A extends y{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class S extends y{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,s=e.id;let i=t.getValue(s,{value:e.exportValue===e.fieldValue}).value;"string"===typeof i&&(i="Off"!==i,t.setValue(s,{value:i})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const n=document.createElement("input");return d.add(n),n.setAttribute("data-element-id",s),n.disabled=e.readOnly,this._setRequired(n,this.data.required),n.type="checkbox",n.name=e.fieldName,i&&n.setAttribute("checked",!0),n.setAttribute("exportValue",e.exportValue),n.tabIndex=c,n.addEventListener("change",(i=>{const{name:n,checked:a}=i.target;for(const r of this._getElementsByName(n,s)){const s=a&&r.exportValue===e.exportValue;r.domElement&&(r.domElement.checked=s),t.setValue(r.id,{value:s})}t.setValue(s,{value:a})})),n.addEventListener("resetform",(t=>{const s=e.defaultFieldValue||"Off";t.target.checked=s===e.exportValue})),this.enableScripting&&this.hasJSActions&&(n.addEventListener("updatefromsandbox",(e=>{const i={value(e){e.target.checked="Off"!==e.detail.value,t.setValue(s,{value:e.target.checked})}};this._dispatchEventFromSandbox(i,e)})),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class F extends y{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,s=e.id;let i=t.getValue(s,{value:e.fieldValue===e.buttonValue}).value;"string"===typeof i&&(i=i!==e.buttonValue,t.setValue(s,{value:i}));const n=document.createElement("input");if(d.add(n),n.setAttribute("data-element-id",s),n.disabled=e.readOnly,this._setRequired(n,this.data.required),n.type="radio",n.name=e.fieldName,i&&n.setAttribute("checked",!0),n.tabIndex=c,n.addEventListener("change",(e=>{const{name:i,checked:n}=e.target;for(const a of this._getElementsByName(i,s))t.setValue(a.id,{value:!1});t.setValue(s,{value:n})})),n.addEventListener("resetform",(t=>{const s=e.defaultFieldValue;t.target.checked=null!==s&&void 0!==s&&s===e.buttonValue})),this.enableScripting&&this.hasJSActions){const i=e.buttonValue;n.addEventListener("updatefromsandbox",(e=>{const n={value:e=>{const n=i===e.detail.value;for(const i of this._getElementsByName(e.target.name)){const e=n&&i.id===s;i.domElement&&(i.domElement.checked=e),t.setValue(i.id,{value:e})}}};this._dispatchEventFromSandbox(n,e)})),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))}return this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class w extends v{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(t.title=this.data.alternativeText);const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",(t=>{this._dispatchEventFromSandbox({},t)}))),t}}class x extends y{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,s=t.getValue(e,{value:this.data.fieldValue}),i=document.createElement("select");d.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,this._setRequired(i,this.data.required),i.name=this.data.fieldName,i.tabIndex=c;let n=this.data.combo&&this.data.options.length>0;this.data.combo||(i.size=this.data.options.length,this.data.multiSelect&&(i.multiple=!0)),i.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue;for(const s of i.options)s.selected=s.value===e}));for(const c of this.data.options){const t=document.createElement("option");t.textContent=c.displayValue,t.value=c.exportValue,s.value.includes(c.exportValue)&&(t.setAttribute("selected",!0),n=!1),i.append(t)}let a=null;if(n){const t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),i.prepend(t),a=()=>{t.remove(),i.removeEventListener("input",a),a=null},i.addEventListener("input",a)}const r=t=>{const e=t?"value":"textContent",{options:s,multiple:n}=i;return n?Array.prototype.filter.call(s,(t=>t.selected)).map((t=>t[e])):-1===s.selectedIndex?null:s[s.selectedIndex][e]};let o=r(!1);const l=t=>{const e=t.target.options;return Array.prototype.map.call(e,(t=>({displayValue:t.textContent,exportValue:t.value})))};return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",(s=>{const n={value(s){var n;null===(n=a)||void 0===n||n();const l=s.detail.value,c=new Set(Array.isArray(l)?l:[l]);for(const t of i.options)t.selected=c.has(t.value);t.setValue(e,{value:r(!0)}),o=r(!1)},multipleSelection(t){i.multiple=!0},remove(s){const n=i.options,a=s.detail.remove;n[a].selected=!1,i.remove(a),n.length>0&&-1===Array.prototype.findIndex.call(n,(t=>t.selected))&&(n[0].selected=!0),t.setValue(e,{value:r(!0),items:l(s)}),o=r(!1)},clear(s){for(;0!==i.length;)i.remove(0);t.setValue(e,{value:null,items:[]}),o=r(!1)},insert(s){const{index:n,displayValue:a,exportValue:c}=s.detail.insert,d=i.children[n],h=document.createElement("option");h.textContent=a,h.value=c,d?d.before(h):i.append(h),t.setValue(e,{value:r(!0),items:l(s)}),o=r(!1)},items(s){const{items:n}=s.detail;for(;0!==i.length;)i.remove(0);for(const t of n){const{displayValue:e,exportValue:s}=t,n=document.createElement("option");n.textContent=e,n.value=s,i.append(n)}i.options.length>0&&(i.options[0].selected=!0),t.setValue(e,{value:r(!0),items:l(s)}),o=r(!1)},indices(s){const i=new Set(s.detail.indices);for(const t of s.target.options)t.selected=i.has(t.index);t.setValue(e,{value:r(!0)}),o=r(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(n,s)})),i.addEventListener("input",(s=>{var i;const n=r(!0);t.setValue(e,{value:n}),s.preventDefault(),null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:o,changeEx:n,willCommit:!1,commitKey:1,keyDown:!1}})})),this._setEventListeners(i,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(t=>t.target.value))):i.addEventListener("input",(function(s){t.setValue(e,{value:r(!0)})})),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class C extends f{constructor(t){const{data:e,elements:s}=t;super(t,{isRenderable:f._hasPopupData(e)}),this.elements=s}render(){this.container.classList.add("popupAnnotation");const t=new V({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}),e=[];for(const s of this.elements)s.popup=t,e.push(s.data.id),s.addHighlightArea();return this.container.setAttribute("aria-controls",e.map((t=>"".concat(i.AnnotationPrefix).concat(t))).join(",")),this.container}}var E=new WeakMap,k=new WeakMap,T=new WeakMap,M=new WeakMap,R=new WeakMap,I=new WeakMap,D=new WeakMap,O=new WeakMap,L=new WeakMap,G=new WeakMap,N=new WeakMap,B=new WeakMap,j=new WeakMap,W=new WeakMap,U=new WeakMap,z=new WeakMap,q=new WeakMap,H=new WeakSet;class V{constructor(t){let{container:e,color:s,elements:i,titleObj:a,modificationDate:r,contentsObj:o,richText:l,parent:c,rect:d,parentRect:h,open:u}=t;_classPrivateMethodInitSpec(this,H),_classPrivateFieldInitSpec(this,E,null),_classPrivateFieldInitSpec(this,k,_assertClassBrand(H,this,X).bind(this)),_classPrivateFieldInitSpec(this,T,_assertClassBrand(H,this,J).bind(this)),_classPrivateFieldInitSpec(this,M,_assertClassBrand(H,this,Y).bind(this)),_classPrivateFieldInitSpec(this,R,_assertClassBrand(H,this,K).bind(this)),_classPrivateFieldInitSpec(this,I,null),_classPrivateFieldInitSpec(this,D,null),_classPrivateFieldInitSpec(this,O,null),_classPrivateFieldInitSpec(this,L,null),_classPrivateFieldInitSpec(this,G,null),_classPrivateFieldInitSpec(this,N,null),_classPrivateFieldInitSpec(this,B,!1),_classPrivateFieldInitSpec(this,j,null),_classPrivateFieldInitSpec(this,W,null),_classPrivateFieldInitSpec(this,U,null),_classPrivateFieldInitSpec(this,z,null),_classPrivateFieldInitSpec(this,q,!1),_classPrivateFieldSet(D,this,e),_classPrivateFieldSet(z,this,a),_classPrivateFieldSet(O,this,o),_classPrivateFieldSet(U,this,l),_classPrivateFieldSet(G,this,c),_classPrivateFieldSet(I,this,s),_classPrivateFieldSet(W,this,d),_classPrivateFieldSet(N,this,h),_classPrivateFieldSet(L,this,i);const p=n.PDFDateString.toDateObject(r);p&&_classPrivateFieldSet(E,this,c.l10n.get("annotation_date_string",{date:p.toLocaleDateString(),time:p.toLocaleTimeString()})),this.trigger=i.flatMap((t=>t.getElementsToTriggerPopup()));for(const n of this.trigger)n.addEventListener("click",_classPrivateFieldGet(R,this)),n.addEventListener("mouseenter",_classPrivateFieldGet(M,this)),n.addEventListener("mouseleave",_classPrivateFieldGet(T,this)),n.classList.add("popupTriggerArea");for(const n of i){var f;null===(f=n.container)||void 0===f||f.addEventListener("keydown",_classPrivateFieldGet(k,this))}_classPrivateFieldGet(D,this).hidden=!0,u&&_assertClassBrand(H,this,K).call(this)}render(){if(_classPrivateFieldGet(j,this))return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:s,pageX:n,pageY:a}}}=_classPrivateFieldGet(G,this),r=_classPrivateFieldSet(j,this,document.createElement("div"));if(r.className="popup",_classPrivateFieldGet(I,this)){const t=r.style.outlineColor=i.Util.makeHexColor(..._classPrivateFieldGet(I,this));if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))r.style.backgroundColor="color-mix(in srgb, ".concat(t," 30%, white)");else{const t=.7;r.style.backgroundColor=i.Util.makeHexColor(..._classPrivateFieldGet(I,this).map((e=>Math.floor(t*(255-e)+e))))}}const o=document.createElement("span");o.className="header";const c=document.createElement("h1");if(o.append(c),({dir:c.dir,str:c.textContent}=_classPrivateFieldGet(z,this)),r.append(o),_classPrivateFieldGet(E,this)){const t=document.createElement("span");t.classList.add("popupDate"),_classPrivateFieldGet(E,this).then((e=>{t.textContent=e})),o.append(t)}const d=_classPrivateFieldGet(O,this),h=_classPrivateFieldGet(U,this);if(null===h||void 0===h||!h.str||null!==d&&void 0!==d&&d.str&&d.str!==h.str){const t=this._formatContents(d);r.append(t)}else l.XfaLayer.render({xfaHtml:h.html,intent:"richText",div:r}),r.lastChild.classList.add("richText","popupContent");let u=!!_classPrivateFieldGet(N,this),p=_classPrivateFieldGet(u?N:W,this);for(const l of _classPrivateFieldGet(L,this))if(!p||null!==i.Util.intersect(l.data.rect,p)){p=l.data.rect,u=!0;break}const f=i.Util.normalizeRect([p[0],t[3]-p[1]+t[1],p[2],t[3]-p[3]+t[1]]),g=u?p[2]-p[0]+5:0,v=f[0]+g,_=f[1],{style:m}=_classPrivateFieldGet(D,this);m.left="".concat(100*(v-n)/e,"%"),m.top="".concat(100*(_-a)/s,"%"),_classPrivateFieldGet(D,this).append(r)}_formatContents(t){let{str:e,dir:s}=t;const i=document.createElement("p");i.classList.add("popupContent"),i.dir=s;const n=e.split(/(?:\r\n?|\n)/);for(let a=0,r=n.length;a<r;++a){const t=n[a];i.append(document.createTextNode(t)),a<r-1&&i.append(document.createElement("br"))}return i}forceHide(){_classPrivateFieldSet(q,this,this.isVisible),_classPrivateFieldGet(q,this)&&(_classPrivateFieldGet(D,this).hidden=!0)}maybeShow(){_classPrivateFieldGet(q,this)&&(_classPrivateFieldSet(q,this,!1),_classPrivateFieldGet(D,this).hidden=!1)}get isVisible(){return!1===_classPrivateFieldGet(D,this).hidden}}function X(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&_classPrivateFieldGet(B,this))&&_assertClassBrand(H,this,K).call(this)}function K(){_classPrivateFieldSet(B,this,!_classPrivateFieldGet(B,this)),_classPrivateFieldGet(B,this)?(_assertClassBrand(H,this,Y).call(this),_classPrivateFieldGet(D,this).addEventListener("click",_classPrivateFieldGet(R,this)),_classPrivateFieldGet(D,this).addEventListener("keydown",_classPrivateFieldGet(k,this))):(_assertClassBrand(H,this,J).call(this),_classPrivateFieldGet(D,this).removeEventListener("click",_classPrivateFieldGet(R,this)),_classPrivateFieldGet(D,this).removeEventListener("keydown",_classPrivateFieldGet(k,this)))}function Y(){_classPrivateFieldGet(j,this)||this.render(),this.isVisible?_classPrivateFieldGet(B,this)&&_classPrivateFieldGet(D,this).classList.add("focused"):(_classPrivateFieldGet(D,this).hidden=!1,_classPrivateFieldGet(D,this).style.zIndex=parseInt(_classPrivateFieldGet(D,this).style.zIndex)+1e3)}function J(){_classPrivateFieldGet(D,this).classList.remove("focused"),!_classPrivateFieldGet(B,this)&&this.isVisible&&(_classPrivateFieldGet(D,this).hidden=!0,_classPrivateFieldGet(D,this).style.zIndex=parseInt(_classPrivateFieldGet(D,this).style.zIndex)-1e3)}class Q extends f{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=i.AnnotationEditorType.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const s=document.createElement("span");s.textContent=e,t.append(s)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}e.FreeTextAnnotationElement=Q;var Z=new WeakMap;class $ extends f{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),_classPrivateFieldInitSpec(this,Z,null)}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:e,height:s}=h(t.rect),i=this.svgFactory.create(e,s,!0),n=_classPrivateFieldSet(Z,this,this.svgFactory.createElement("svg:line"));return n.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),n.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),n.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),n.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),n.setAttribute("stroke-width",t.borderStyle.width||1),n.setAttribute("stroke","transparent"),n.setAttribute("fill","transparent"),i.append(n),this.container.append(i),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return _classPrivateFieldGet(Z,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var tt=new WeakMap;class et extends f{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),_classPrivateFieldInitSpec(this,tt,null)}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:e,height:s}=h(t.rect),i=this.svgFactory.create(e,s,!0),n=t.borderStyle.width,a=_classPrivateFieldSet(tt,this,this.svgFactory.createElement("svg:rect"));return a.setAttribute("x",n/2),a.setAttribute("y",n/2),a.setAttribute("width",e-n),a.setAttribute("height",s-n),a.setAttribute("stroke-width",n||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),i.append(a),this.container.append(i),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return _classPrivateFieldGet(tt,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var st=new WeakMap;class it extends f{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),_classPrivateFieldInitSpec(this,st,null)}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:e,height:s}=h(t.rect),i=this.svgFactory.create(e,s,!0),n=t.borderStyle.width,a=_classPrivateFieldSet(st,this,this.svgFactory.createElement("svg:ellipse"));return a.setAttribute("cx",e/2),a.setAttribute("cy",s/2),a.setAttribute("rx",e/2-n/2),a.setAttribute("ry",s/2-n/2),a.setAttribute("stroke-width",n||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),i.append(a),this.container.append(i),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return _classPrivateFieldGet(st,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var nt=new WeakMap;class at extends f{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),_classPrivateFieldInitSpec(this,nt,null),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const t=this.data,{width:e,height:s}=h(t.rect),i=this.svgFactory.create(e,s,!0);let n=[];for(const r of t.vertices){const e=r.x-t.rect[0],s=t.rect[3]-r.y;n.push(e+","+s)}n=n.join(" ");const a=_classPrivateFieldSet(nt,this,this.svgFactory.createElement(this.svgElementName));return a.setAttribute("points",n),a.setAttribute("stroke-width",t.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),i.append(a),this.container.append(i),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return _classPrivateFieldGet(nt,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}class rt extends at{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class ot extends f{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var lt=new WeakMap;class ct extends f{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),_classPrivateFieldInitSpec(this,lt,[]),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=i.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);const t=this.data,{width:e,height:s}=h(t.rect),i=this.svgFactory.create(e,s,!0);for(const n of t.inkLists){let e=[];for(const i of n){const s=i.x-t.rect[0],n=t.rect[3]-i.y;e.push("".concat(s,",").concat(n))}e=e.join(" ");const s=this.svgFactory.createElement(this.svgElementName);_classPrivateFieldGet(lt,this).push(s),s.setAttribute("points",e),s.setAttribute("stroke-width",t.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),!t.popupRef&&this.hasPopupData&&this._createPopup(),i.append(s)}return this.container.append(i),this.container}getElementsToTriggerPopup(){return _classPrivateFieldGet(lt,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}e.InkAnnotationElement=ct;class dt extends f{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class ht extends f{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class ut extends f{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class pt extends f{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class ft extends f{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}e.StampAnnotationElement=ft;var gt=new WeakMap,vt=new WeakSet;class _t extends f{constructor(t){var e;super(t,{isRenderable:!0}),_classPrivateMethodInitSpec(this,vt),_classPrivateFieldInitSpec(this,gt,null);const{filename:s,content:i}=this.data.file;this.filename=(0,n.getFilenameFromUrl)(s,!0),this.content=i,null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("fileattachmentannotation",{source:this,filename:s,content:i})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:e}=this;let s;e.hasAppearance||0===e.fillAlpha?s=document.createElement("div"):(s=document.createElement("img"),s.src="".concat(this.imageResourcesPath,"annotation-").concat(/paperclip/i.test(e.name)?"paperclip":"pushpin",".svg"),e.fillAlpha&&e.fillAlpha<1&&(s.style="filter: opacity(".concat(Math.round(100*e.fillAlpha),"%);"))),s.addEventListener("dblclick",_assertClassBrand(vt,this,mt).bind(this)),_classPrivateFieldSet(gt,this,s);const{isMac:n}=i.FeatureTest.platform;return t.addEventListener("keydown",(t=>{"Enter"===t.key&&(n?t.metaKey:t.ctrlKey)&&_assertClassBrand(vt,this,mt).call(this)})),!e.popupRef&&this.hasPopupData?this._createPopup():s.classList.add("popupTriggerArea"),t.append(s),t}getElementsToTriggerPopup(){return _classPrivateFieldGet(gt,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}function mt(){var t;null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.container,this.content,this.filename)}var bt=new WeakMap,yt=new WeakMap,Pt=new WeakMap,At=new WeakSet;function St(t,e){var s;const n=t.firstChild||t;n.id="".concat(i.AnnotationPrefix).concat(e),this.div.append(t),null===(s=_classPrivateFieldGet(bt,this))||void 0===s||s.moveElementInDOM(this.div,t,n,!1)}function Ft(){if(!_classPrivateFieldGet(yt,this))return;const t=this.div;for(const[e,s]of _classPrivateFieldGet(yt,this)){const i=t.querySelector('[data-annotation-id="'.concat(e,'"]'));if(!i)continue;const{firstChild:n}=i;n?"CANVAS"===n.nodeName?n.replaceWith(s):n.before(s):i.append(s)}_classPrivateFieldGet(yt,this).clear()}e.AnnotationLayer=class{constructor(t){let{div:e,accessibilityManager:s,annotationCanvasMap:i,l10n:n,page:a,viewport:r}=t;_classPrivateMethodInitSpec(this,At),_classPrivateFieldInitSpec(this,bt,null),_classPrivateFieldInitSpec(this,yt,null),_classPrivateFieldInitSpec(this,Pt,new Map),this.div=e,_classPrivateFieldSet(bt,this,s),_classPrivateFieldSet(yt,this,i),this.l10n=n,this.page=a,this.viewport=r,this.zIndex=0,this.l10n||(this.l10n=o.NullL10n)}async render(t){const{annotations:e}=t,s=this.div;(0,n.setLayerDimensions)(s,this.viewport);const r=new Map,o={data:null,layer:s,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new n.DOMSVGFactory,annotationStorage:t.annotationStorage||new a.AnnotationStorage,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const n of e){if(n.noHTML)continue;const t=n.annotationType===i.AnnotationType.POPUP;if(t){const t=r.get(n.id);if(!t)continue;o.elements=t}else{const{width:t,height:e}=h(n.rect);if(t<=0||e<=0)continue}o.data=n;const e=u.create(o);if(!e.isRenderable)continue;if(!t&&n.popupRef){const t=r.get(n.popupRef);t?t.push(e):r.set(n.popupRef,[e])}e.annotationEditorType>0&&_classPrivateFieldGet(Pt,this).set(e.data.id,e);const s=e.render();n.hidden&&(s.style.visibility="hidden"),_assertClassBrand(At,this,St).call(this,s,n.id)}_assertClassBrand(At,this,Ft).call(this),await this.l10n.translate(s)}update(t){let{viewport:e}=t;const s=this.div;this.viewport=e,(0,n.setLayerDimensions)(s,{rotation:e.rotation}),_assertClassBrand(At,this,Ft).call(this),s.hidden=!1}getEditableAnnotations(){return Array.from(_classPrivateFieldGet(Pt,this).values())}getEditableAnnotation(t){return _classPrivateFieldGet(Pt,this).get(t)}}},(t,e)=>{function s(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function i(t){return Math.max(0,Math.min(255,255*t))}Object.defineProperty(e,"__esModule",{value:!0}),e.ColorConverters=void 0,e.ColorConverters=class{static CMYK_G(t){let[e,s,i,n]=t;return["G",1-Math.min(1,.3*e+.59*i+.11*s+n)]}static G_CMYK(t){let[e]=t;return["CMYK",0,0,0,1-e]}static G_RGB(t){let[e]=t;return["RGB",e,e,e]}static G_rgb(t){let[e]=t;return e=i(e),[e,e,e]}static G_HTML(t){let[e]=t;const i=s(e);return"#".concat(i).concat(i).concat(i)}static RGB_G(t){let[e,s,i]=t;return["G",.3*e+.59*s+.11*i]}static RGB_rgb(t){return t.map(i)}static RGB_HTML(t){return"#".concat(t.map(s).join(""))}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(t){let[e,s,i,n]=t;return["RGB",1-Math.min(1,e+n),1-Math.min(1,i+n),1-Math.min(1,s+n)]}static CMYK_rgb(t){let[e,s,n,a]=t;return[i(1-Math.min(1,e+a)),i(1-Math.min(1,n+a)),i(1-Math.min(1,s+a))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK(t){let[e,s,i]=t;const n=1-e,a=1-s,r=1-i;return["CMYK",n,a,r,Math.min(n,a,r)]}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NullL10n=void 0,e.getL10nFallback=i;const s={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"};function i(t,e){switch(t){case"find_match_count":t="find_match_count[".concat(1===e.total?"one":"other","]");break;case"find_match_count_limit":t="find_match_count_limit[".concat(1===e.limit?"one":"other","]")}return s[t]||""}s.print_progress_percent="{{progress}}%";const n={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",async get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(t,e){return e?t.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,((t,s)=>s in e?e[s]:"{{"+s+"}}")):t}(arguments.length>2&&void 0!==arguments[2]?arguments[2]:i(t,e),e)},async translate(t){}};e.NullL10n=n},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.XfaLayer=void 0;var i=s(25);e.XfaLayer=class{static setupStorage(t,e,s,i,n){const a=i.getValue(e,{value:null});switch(s.name){case"textarea":if(null!==a.value&&(t.textContent=a.value),"print"===n)break;t.addEventListener("input",(t=>{i.setValue(e,{value:t.target.value})}));break;case"input":if("radio"===s.attributes.type||"checkbox"===s.attributes.type){if(a.value===s.attributes.xfaOn?t.setAttribute("checked",!0):a.value===s.attributes.xfaOff&&t.removeAttribute("checked"),"print"===n)break;t.addEventListener("change",(t=>{i.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})}))}else{if(null!==a.value&&t.setAttribute("value",a.value),"print"===n)break;t.addEventListener("input",(t=>{i.setValue(e,{value:t.target.value})}))}break;case"select":if(null!==a.value){t.setAttribute("value",a.value);for(const t of s.children)t.attributes.value===a.value?t.attributes.selected=!0:t.attributes.hasOwnProperty("selected")&&delete t.attributes.selected}t.addEventListener("input",(t=>{const s=t.target.options,n=-1===s.selectedIndex?"":s[s.selectedIndex].value;i.setValue(e,{value:n})}))}}static setAttributes(t){let{html:e,element:s,storage:i=null,intent:n,linkService:a}=t;const{attributes:r}=s,o=e instanceof HTMLAnchorElement;"radio"===r.type&&(r.name="".concat(r.name,"-").concat(n));for(const[l,c]of Object.entries(r))if(null!==c&&void 0!==c)switch(l){case"class":c.length&&e.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!o||"href"!==l&&"newWindow"!==l)&&e.setAttribute(l,c)}o&&a.addLinkAttributes(e,r.href,r.newWindow),i&&r.dataId&&this.setupStorage(e,r.dataId,s,i)}static render(t){const e=t.annotationStorage,s=t.linkService,n=t.xfaHtml,a=t.intent||"display",r=document.createElement(n.name);n.attributes&&this.setAttributes({html:r,element:n,intent:a,linkService:s});const o=[[n,-1,r]],l=t.div;if(l.append(r),t.viewport){const e="matrix(".concat(t.viewport.transform.join(","),")");l.style.transform=e}"richText"!==a&&l.setAttribute("class","xfaLayer xfaFont");const c=[];for(;o.length>0;){var d;const[t,n,r]=o.at(-1);if(n+1===t.children.length){o.pop();continue}const l=t.children[++o.at(-1)[1]];if(null===l)continue;const{name:h}=l;if("#text"===h){const t=document.createTextNode(l.value);c.push(t),r.append(t);continue}const u=null!==l&&void 0!==l&&null!==(d=l.attributes)&&void 0!==d&&d.xmlns?document.createElementNS(l.attributes.xmlns,h):document.createElement(h);if(r.append(u),l.attributes&&this.setAttributes({html:u,element:l,storage:e,intent:a,linkService:s}),l.children&&l.children.length>0)o.push([l,-1,u]);else if(l.value){const t=document.createTextNode(l.value);i.XfaText.shouldBuildText(h)&&c.push(t),u.append(t)}}for(const i of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))i.setAttribute("readOnly",!0);return{textDivs:c}}static update(t){const e="matrix(".concat(t.viewport.transform.join(","),")");t.div.style.transform=e,t.div.hidden=!1}}},(t,e,s)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.InkEditor=void 0;var n=s(1),a=s(4),r=s(29),o=s(6),l=s(5),c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,v=new WeakMap,_=new WeakMap,m=new WeakMap,b=new WeakMap,y=new WeakMap,P=new WeakMap,A=new WeakMap,S=new WeakSet;class F extends a.AnnotationEditor{constructor(t){super({...t,name:"inkEditor"}),_classPrivateMethodInitSpec(this,S),_classPrivateFieldInitSpec(this,c,0),_classPrivateFieldInitSpec(this,d,0),_classPrivateFieldInitSpec(this,h,this.canvasPointermove.bind(this)),_classPrivateFieldInitSpec(this,u,this.canvasPointerleave.bind(this)),_classPrivateFieldInitSpec(this,p,this.canvasPointerup.bind(this)),_classPrivateFieldInitSpec(this,f,this.canvasPointerdown.bind(this)),_classPrivateFieldInitSpec(this,g,new Path2D),_classPrivateFieldInitSpec(this,v,!1),_classPrivateFieldInitSpec(this,_,!1),_classPrivateFieldInitSpec(this,m,!1),_classPrivateFieldInitSpec(this,b,null),_classPrivateFieldInitSpec(this,y,0),_classPrivateFieldInitSpec(this,P,0),_classPrivateFieldInitSpec(this,A,null),this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.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(t){a.AnnotationEditor.initialize(t,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(t,e){switch(t){case n.AnnotationEditorParamsType.INK_THICKNESS:F._defaultThickness=e;break;case n.AnnotationEditorParamsType.INK_COLOR:F._defaultColor=e;break;case n.AnnotationEditorParamsType.INK_OPACITY:F._defaultOpacity=e/100}}updateParams(t,e){switch(t){case n.AnnotationEditorParamsType.INK_THICKNESS:_assertClassBrand(S,this,w).call(this,e);break;case n.AnnotationEditorParamsType.INK_COLOR:_assertClassBrand(S,this,x).call(this,e);break;case n.AnnotationEditorParamsType.INK_OPACITY:_assertClassBrand(S,this,C).call(this,e)}}static get defaultPropertiesToUpdate(){return[[n.AnnotationEditorParamsType.INK_THICKNESS,F._defaultThickness],[n.AnnotationEditorParamsType.INK_COLOR,F._defaultColor||a.AnnotationEditor._defaultLineColor],[n.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*F._defaultOpacity)]]}get propertiesToUpdate(){var t;return[[n.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||F._defaultThickness],[n.AnnotationEditorParamsType.INK_COLOR,this.color||F._defaultColor||a.AnnotationEditor._defaultLineColor],[n.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(null!==(t=this.opacity)&&void 0!==t?t:F._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||(_assertClassBrand(S,this,B).call(this),_assertClassBrand(S,this,j).call(this)),this.isAttachedToDOM||(this.parent.add(this),_assertClassBrand(S,this,W).call(this)),_assertClassBrand(S,this,J).call(this)))}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,_classPrivateFieldGet(b,this).disconnect(),_classPrivateFieldSet(b,this,null),super.remove())}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this),super.setParent(t)}onScaleChanging(){const[t,e]=this.parentDimensions,s=this.width*t,i=this.height*e;this.setDimensions(s,i)}enableEditMode(){_classPrivateFieldGet(v,this)||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",_classPrivateFieldGet(f,this)))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",_classPrivateFieldGet(f,this)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}commit(){_classPrivateFieldGet(v,this)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),_classPrivateFieldSet(v,this,!0),this.div.classList.add("disabled"),_assertClassBrand(S,this,J).call(this,!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),this.enableEditMode())}canvasPointerdown(t){0===t.button&&this.isInEditMode()&&!_classPrivateFieldGet(v,this)&&(this.setInForeground(),t.preventDefault(),"mouse"!==t.type&&this.div.focus(),_assertClassBrand(S,this,T).call(this,t.offsetX,t.offsetY))}canvasPointermove(t){t.preventDefault(),_assertClassBrand(S,this,M).call(this,t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),_assertClassBrand(S,this,N).call(this,t)}canvasPointerleave(t){_assertClassBrand(S,this,N).call(this,t)}get isResizable(){return!this.isEmpty()&&_classPrivateFieldGet(v,this)}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),a.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then((t=>{var e;return null===(e=this.div)||void 0===e?void 0:e.setAttribute("aria-label",t)}));const[s,i,n,r]=_assertClassBrand(S,this,E).call(this);if(this.setAt(s,i,0,0),this.setDims(n,r),_assertClassBrand(S,this,B).call(this),this.width){const[s,i]=this.parentDimensions;this.setAspectRatio(this.width*s,this.height*i),this.setAt(t*s,e*i,this.width*s,this.height*i),_classPrivateFieldSet(m,this,!0),_assertClassBrand(S,this,W).call(this),this.setDims(this.width*s,this.height*i),_assertClassBrand(S,this,G).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return _assertClassBrand(S,this,j).call(this),this.div}setDimensions(t,e){const s=Math.round(t),i=Math.round(e);if(_classPrivateFieldGet(y,this)===s&&_classPrivateFieldGet(P,this)===i)return;_classPrivateFieldSet(y,this,s),_classPrivateFieldSet(P,this,i),this.canvas.style.visibility="hidden";const[n,a]=this.parentDimensions;this.width=t/n,this.height=e/a,this.fixAndSetPosition(),_classPrivateFieldGet(v,this)&&_assertClassBrand(S,this,U).call(this,t,e),_assertClassBrand(S,this,W).call(this),_assertClassBrand(S,this,G).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(t,e,s){if(t instanceof r.InkAnnotationElement)return null;const i=super.deserialize(t,e,s);i.thickness=t.thickness,i.color=n.Util.makeHexColor(...t.color),i.opacity=t.opacity;const[o,l]=i.pageDimensions,h=i.width*o,u=i.height*l,p=i.parentScale,f=t.thickness/2;_classPrivateFieldSet(v,i,!0),_classPrivateFieldSet(y,i,Math.round(h)),_classPrivateFieldSet(P,i,Math.round(u));const{paths:g,rect:_,rotation:m}=t;for(let{bezier:n}of g){n=V.call(F,n,_,m);const t=[];i.paths.push(t);let e=p*(n[0]-f),s=p*(n[1]-f);for(let i=2,r=n.length;i<r;i+=6){const a=p*(n[i]-f),r=p*(n[i+1]-f),o=p*(n[i+2]-f),l=p*(n[i+3]-f),c=p*(n[i+4]-f),d=p*(n[i+5]-f);t.push([[e,s],[a,r],[o,l],[c,d]]),e=c,s=d}const a=_assertClassBrand(F,this,q).call(this,t);i.bezierPath2D.push(a)}const b=_assertClassBrand(S,i,K).call(i);return _classPrivateFieldSet(d,i,Math.max(a.AnnotationEditor.MIN_SIZE,b[2]-b[0])),_classPrivateFieldSet(c,i,Math.max(a.AnnotationEditor.MIN_SIZE,b[3]-b[1])),_assertClassBrand(S,i,U).call(i,h,u),i}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),e=a.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:n.AnnotationEditorType.INK,color:e,thickness:this.thickness,opacity:this.opacity,paths:_assertClassBrand(S,this,X).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}function w(t){const e=this.thickness;this.addCommands({cmd:()=>{this.thickness=t,_assertClassBrand(S,this,J).call(this)},undo:()=>{this.thickness=e,_assertClassBrand(S,this,J).call(this)},mustExec:!0,type:n.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function x(t){const e=this.color;this.addCommands({cmd:()=>{this.color=t,_assertClassBrand(S,this,G).call(this)},undo:()=>{this.color=e,_assertClassBrand(S,this,G).call(this)},mustExec:!0,type:n.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function C(t){t/=100;const e=this.opacity;this.addCommands({cmd:()=>{this.opacity=t,_assertClassBrand(S,this,G).call(this)},undo:()=>{this.opacity=e,_assertClassBrand(S,this,G).call(this)},mustExec:!0,type:n.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function E(){const{parentRotation:t,parentDimensions:[e,s]}=this;switch(t){case 90:return[0,s,s,e];case 180:return[e,s,e,s];case 270:return[e,0,s,e];default:return[0,0,e,s]}}function k(){const{ctx:t,color:e,opacity:s,thickness:i,parentScale:n,scaleFactor:a}=this;t.lineWidth=i*n/a,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle="".concat(e).concat((0,l.opacityToHex)(s))}function T(t,e){var s;this.canvas.addEventListener("contextmenu",o.noContextMenu),this.canvas.addEventListener("pointerleave",_classPrivateFieldGet(u,this)),this.canvas.addEventListener("pointermove",_classPrivateFieldGet(h,this)),this.canvas.addEventListener("pointerup",_classPrivateFieldGet(p,this)),this.canvas.removeEventListener("pointerdown",_classPrivateFieldGet(f,this)),this.isEditing=!0,_classPrivateFieldGet(m,this)||(_classPrivateFieldSet(m,this,!0),_assertClassBrand(S,this,W).call(this),this.thickness||(this.thickness=i._defaultThickness),this.color||(this.color=i._defaultColor||a.AnnotationEditor._defaultLineColor),null!==(s=this.opacity)&&void 0!==s||(this.opacity=i._defaultOpacity)),this.currentPath.push([t,e]),_classPrivateFieldSet(_,this,!1),_assertClassBrand(S,this,k).call(this),_classPrivateFieldSet(A,this,(()=>{_assertClassBrand(S,this,D).call(this),_classPrivateFieldGet(A,this)&&window.requestAnimationFrame(_classPrivateFieldGet(A,this))})),window.requestAnimationFrame(_classPrivateFieldGet(A,this))}function M(t,e){const[s,i]=this.currentPath.at(-1);if(this.currentPath.length>1&&t===s&&e===i)return;const n=this.currentPath;let a=_classPrivateFieldGet(g,this);if(n.push([t,e]),_classPrivateFieldSet(_,this,!0),n.length<=2)return a.moveTo(...n[0]),void a.lineTo(t,e);3===n.length&&(_classPrivateFieldSet(g,this,a=new Path2D),a.moveTo(...n[0])),_assertClassBrand(S,this,O).call(this,a,...n.at(-3),...n.at(-2),t,e)}function R(){if(0===this.currentPath.length)return;const t=this.currentPath.at(-1);_classPrivateFieldGet(g,this).lineTo(...t)}function I(t,e){let s;if(_classPrivateFieldSet(A,this,null),t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height),_assertClassBrand(S,this,M).call(this,t,e),_assertClassBrand(S,this,R).call(this),1!==this.currentPath.length)s=_assertClassBrand(S,this,L).call(this);else{const i=[t,e];s=[[i,i.slice(),i.slice(),i]]}const i=_classPrivateFieldGet(g,this),n=this.currentPath;this.currentPath=[],_classPrivateFieldSet(g,this,new Path2D),this.addCommands({cmd:()=>{this.allRawPaths.push(n),this.paths.push(s),this.bezierPath2D.push(i),this.rebuild()},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(_assertClassBrand(S,this,B).call(this),_assertClassBrand(S,this,j).call(this)),_assertClassBrand(S,this,J).call(this))},mustExec:!0})}function D(){if(!_classPrivateFieldGet(_,this))return;_classPrivateFieldSet(_,this,!1);Math.ceil(this.thickness*this.parentScale);const t=this.currentPath.slice(-3),e=t.map((t=>t[0])),s=t.map((t=>t[1])),{ctx:i}=(Math.min(...e),Math.max(...e),Math.min(...s),Math.max(...s),this);i.save(),i.clearRect(0,0,this.canvas.width,this.canvas.height);for(const n of this.bezierPath2D)i.stroke(n);i.stroke(_classPrivateFieldGet(g,this)),i.restore()}function O(t,e,s,i,n,a,r){const o=(e+i)/2,l=(s+n)/2,c=(i+a)/2,d=(n+r)/2;t.bezierCurveTo(o+2*(i-o)/3,l+2*(n-l)/3,c+2*(i-c)/3,d+2*(n-d)/3,c,d)}function L(){const t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];const e=[];let s,[i,n]=t[0];for(s=1;s<t.length-2;s++){const[a,r]=t[s],[o,l]=t[s+1],c=(a+o)/2,d=(r+l)/2,h=[i+2*(a-i)/3,n+2*(r-n)/3],u=[c+2*(a-c)/3,d+2*(r-d)/3];e.push([[i,n],h,u,[c,d]]),[i,n]=[c,d]}const[a,r]=t[s],[o,l]=t[s+1],c=[i+2*(a-i)/3,n+2*(r-n)/3],d=[o+2*(a-o)/3,l+2*(r-l)/3];return e.push([[i,n],c,d,[o,l]]),e}function G(){if(this.isEmpty())return void _assertClassBrand(S,this,z).call(this);_assertClassBrand(S,this,k).call(this);const{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),_assertClassBrand(S,this,z).call(this);for(const s of this.bezierPath2D)e.stroke(s)}function N(t){this.canvas.removeEventListener("pointerleave",_classPrivateFieldGet(u,this)),this.canvas.removeEventListener("pointermove",_classPrivateFieldGet(h,this)),this.canvas.removeEventListener("pointerup",_classPrivateFieldGet(p,this)),this.canvas.addEventListener("pointerdown",_classPrivateFieldGet(f,this)),setTimeout((()=>{this.canvas.removeEventListener("contextmenu",o.noContextMenu)}),10),_assertClassBrand(S,this,I).call(this,t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackground()}function B(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",a.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then((t=>{var e;return null===(e=this.canvas)||void 0===e?void 0:e.setAttribute("aria-label",t)})),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}function j(){_classPrivateFieldSet(b,this,new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)}))),_classPrivateFieldGet(b,this).observe(this.div)}function W(){if(!_classPrivateFieldGet(m,this))return;const[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),_assertClassBrand(S,this,z).call(this)}function U(t,e){const s=_assertClassBrand(S,this,Y).call(this),i=(t-s)/_classPrivateFieldGet(d,this),n=(e-s)/_classPrivateFieldGet(c,this);this.scaleFactor=Math.min(i,n)}function z(){const t=_assertClassBrand(S,this,Y).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}function q(t){const e=new Path2D;for(let s=0,i=t.length;s<i;s++){const[i,n,a,r]=t[s];0===s&&e.moveTo(...i),e.bezierCurveTo(n[0],n[1],a[0],a[1],r[0],r[1])}return e}function H(t,e,s){const[i,n,a,r]=e;switch(s){case 0:for(let e=0,s=t.length;e<s;e+=2)t[e]+=i,t[e+1]=r-t[e+1];break;case 90:for(let e=0,s=t.length;e<s;e+=2){const s=t[e];t[e]=t[e+1]+i,t[e+1]=s+n}break;case 180:for(let e=0,s=t.length;e<s;e+=2)t[e]=a-t[e],t[e+1]+=n;break;case 270:for(let e=0,s=t.length;e<s;e+=2){const s=t[e];t[e]=a-t[e+1],t[e+1]=r-s}break;default:throw new Error("Invalid rotation")}return t}function V(t,e,s){const[i,n,a,r]=e;switch(s){case 0:for(let e=0,s=t.length;e<s;e+=2)t[e]-=i,t[e+1]=r-t[e+1];break;case 90:for(let e=0,s=t.length;e<s;e+=2){const s=t[e];t[e]=t[e+1]-n,t[e+1]=s-i}break;case 180:for(let e=0,s=t.length;e<s;e+=2)t[e]=a-t[e],t[e+1]-=n;break;case 270:for(let e=0,s=t.length;e<s;e+=2){const s=t[e];t[e]=r-t[e+1],t[e+1]=a-s}break;default:throw new Error("Invalid rotation")}return t}function X(t,e,s,n){const a=[],r=this.thickness/2,o=t*e+r,l=t*s+r;for(const c of this.paths){const e=[],s=[];for(let i=0,n=c.length;i<n;i++){const[a,r,d,h]=c[i],u=t*a[0]+o,p=t*a[1]+l,f=t*r[0]+o,g=t*r[1]+l,v=t*d[0]+o,_=t*d[1]+l,m=t*h[0]+o,b=t*h[1]+l;0===i&&(e.push(u,p),s.push(u,p)),e.push(f,g,v,_,m,b),s.push(f,g),i===n-1&&s.push(m,b)}a.push({bezier:H.call(i,e,n,this.rotation),points:H.call(i,s,n,this.rotation)})}return a}function K(){let t=1/0,e=-1/0,s=1/0,i=-1/0;for(const a of this.paths)for(const[r,o,l,c]of a){const a=n.Util.bezierBoundingBox(...r,...o,...l,...c);t=Math.min(t,a[0]),s=Math.min(s,a[1]),e=Math.max(e,a[2]),i=Math.max(i,a[3])}return[t,s,e,i]}function Y(){return _classPrivateFieldGet(v,this)?Math.ceil(this.thickness*this.parentScale):0}function J(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!_classPrivateFieldGet(v,this))return void _assertClassBrand(S,this,G).call(this);const e=_assertClassBrand(S,this,K).call(this),s=_assertClassBrand(S,this,Y).call(this);_classPrivateFieldSet(d,this,Math.max(a.AnnotationEditor.MIN_SIZE,e[2]-e[0])),_classPrivateFieldSet(c,this,Math.max(a.AnnotationEditor.MIN_SIZE,e[3]-e[1]));const i=Math.ceil(s+_classPrivateFieldGet(d,this)*this.scaleFactor),n=Math.ceil(s+_classPrivateFieldGet(c,this)*this.scaleFactor),[r,o]=this.parentDimensions;this.width=i/r,this.height=n/o,this.setAspectRatio(i,n);const l=this.translationX,h=this.translationY;this.translationX=-e[0],this.translationY=-e[1],_assertClassBrand(S,this,W).call(this),_assertClassBrand(S,this,G).call(this),_classPrivateFieldSet(y,this,i),_classPrivateFieldSet(P,this,n),this.setDims(i,n);const u=t?s/this.scaleFactor/2:0;this.translate(l-this.translationX-u,h-this.translationY-u)}i=F,_defineProperty(F,"_defaultColor",null),_defineProperty(F,"_defaultOpacity",1),_defineProperty(F,"_defaultThickness",1),_defineProperty(F,"_type","ink"),e.InkEditor=F},(t,e,s)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.StampEditor=void 0;var n=s(1),a=s(4),r=s(6),o=s(29),l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,v=new WeakMap,_=new WeakMap,m=new WeakSet;class b extends a.AnnotationEditor{constructor(t){super({...t,name:"stampEditor"}),_classPrivateMethodInitSpec(this,m),_classPrivateFieldInitSpec(this,l,null),_classPrivateFieldInitSpec(this,c,null),_classPrivateFieldInitSpec(this,d,null),_classPrivateFieldInitSpec(this,h,null),_classPrivateFieldInitSpec(this,u,null),_classPrivateFieldInitSpec(this,p,null),_classPrivateFieldInitSpec(this,f,null),_classPrivateFieldInitSpec(this,g,null),_classPrivateFieldInitSpec(this,v,!1),_classPrivateFieldInitSpec(this,_,!1),_classPrivateFieldSet(h,this,t.bitmapUrl),_classPrivateFieldSet(u,this,t.bitmapFile)}static initialize(t){a.AnnotationEditor.initialize(t)}static get supportedTypes(){return(0,n.shadow)(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map((t=>"image/".concat(t))))}static get supportedTypesStr(){return(0,n.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(n.AnnotationEditorType.STAMP,{bitmapFile:t.getAsFile()})}remove(){var t,e;_classPrivateFieldGet(c,this)&&(_classPrivateFieldSet(l,this,null),this._uiManager.imageManager.deleteId(_classPrivateFieldGet(c,this)),null===(t=_classPrivateFieldGet(p,this))||void 0===t||t.remove(),_classPrivateFieldSet(p,this,null),null===(e=_classPrivateFieldGet(f,this))||void 0===e||e.disconnect(),_classPrivateFieldSet(f,this,null)),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(_classPrivateFieldGet(c,this)&&_assertClassBrand(m,this,A).call(this),this.isAttachedToDOM||this.parent.add(this))):_classPrivateFieldGet(c,this)&&_assertClassBrand(m,this,A).call(this)}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(_classPrivateFieldGet(d,this)||_classPrivateFieldGet(l,this)||_classPrivateFieldGet(h,this)||_classPrivateFieldGet(u,this))}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;if(this.width&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,_classPrivateFieldGet(l,this)?_assertClassBrand(m,this,S).call(this):_assertClassBrand(m,this,A).call(this),this.width){const[s,i]=this.parentDimensions;this.setAt(t*s,e*i,this.width*s,this.height*i)}return this.div}static deserialize(t,e,s){if(t instanceof o.StampAnnotationElement)return null;const i=super.deserialize(t,e,s),{rect:n,bitmapUrl:a,bitmapId:r,isSvg:l,accessibilityData:d}=t;r&&s.imageManager.isValidId(r)?_classPrivateFieldSet(c,i,r):_classPrivateFieldSet(h,i,a),_classPrivateFieldSet(v,i,l);const[u,p]=i.pageDimensions;return i.width=(n[2]-n[0])/u,i.height=(n[3]-n[1])/p,d&&(i.altTextData=d),i}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;const s={annotationType:n.AnnotationEditorType.STAMP,bitmapId:_classPrivateFieldGet(c,this),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:_classPrivateFieldGet(v,this),structTreeParentId:this._structTreeParentId};if(t)return s.bitmapUrl=_assertClassBrand(m,this,C).call(this,!0),s.accessibilityData=this.altTextData,s;const{decorative:i,altText:a}=this.altTextData;if(!i&&a&&(s.accessibilityData={type:"Figure",alt:a}),null===e)return s;e.stamps||(e.stamps=new Map);const r=_classPrivateFieldGet(v,this)?(s.rect[2]-s.rect[0])*(s.rect[3]-s.rect[1]):null;if(e.stamps.has(_classPrivateFieldGet(c,this))){if(_classPrivateFieldGet(v,this)){const t=e.stamps.get(_classPrivateFieldGet(c,this));r>t.area&&(t.area=r,t.serialized.bitmap.close(),t.serialized.bitmap=_assertClassBrand(m,this,C).call(this,!1))}}else e.stamps.set(_classPrivateFieldGet(c,this),{area:r,serialized:s}),s.bitmap=_assertClassBrand(m,this,C).call(this,!1);return s}}function y(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t?(_classPrivateFieldSet(l,this,t.bitmap),e||(_classPrivateFieldSet(c,this,t.id),_classPrivateFieldSet(v,this,t.isSvg)),_assertClassBrand(m,this,S).call(this)):this.remove()}function P(){_classPrivateFieldSet(d,this,null),this._uiManager.enableWaiting(!1),_classPrivateFieldGet(p,this)&&this.div.focus()}function A(){if(_classPrivateFieldGet(c,this))return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(_classPrivateFieldGet(c,this)).then((t=>_assertClassBrand(m,this,y).call(this,t,!0))).finally((()=>_assertClassBrand(m,this,P).call(this)));if(_classPrivateFieldGet(h,this)){const t=_classPrivateFieldGet(h,this);return _classPrivateFieldSet(h,this,null),this._uiManager.enableWaiting(!0),void _classPrivateFieldSet(d,this,this._uiManager.imageManager.getFromUrl(t).then((t=>_assertClassBrand(m,this,y).call(this,t))).finally((()=>_assertClassBrand(m,this,P).call(this))))}if(_classPrivateFieldGet(u,this)){const t=_classPrivateFieldGet(u,this);return _classPrivateFieldSet(u,this,null),this._uiManager.enableWaiting(!0),void _classPrivateFieldSet(d,this,this._uiManager.imageManager.getFromFile(t).then((t=>_assertClassBrand(m,this,y).call(this,t))).finally((()=>_assertClassBrand(m,this,P).call(this))))}const t=document.createElement("input");t.type="file",t.accept=i.supportedTypesStr,_classPrivateFieldSet(d,this,new Promise((e=>{t.addEventListener("change",(async()=>{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);const e=await this._uiManager.imageManager.getFromFile(t.files[0]);_assertClassBrand(m,this,y).call(this,e)}else this.remove();e()})),t.addEventListener("cancel",(()=>{this.remove(),e()}))})).finally((()=>_assertClassBrand(m,this,P).call(this)))),t.click()}function S(){const{div:t}=this;let{width:e,height:s}=_classPrivateFieldGet(l,this);const[i,n]=this.pageDimensions,a=.75;if(this.width)e=this.width*i,s=this.height*n;else if(e>a*i||s>a*n){const t=Math.min(a*i/e,a*n/s);e*=t,s*=t}const[r,o]=this.parentDimensions;this.setDims(e*r/i,s*o/n),this._uiManager.enableWaiting(!1);const c=_classPrivateFieldSet(p,this,document.createElement("canvas"));t.append(c),t.hidden=!1,_assertClassBrand(m,this,x).call(this,e,s),_assertClassBrand(m,this,E).call(this),_classPrivateFieldGet(_,this)||(this.parent.addUndoableEditor(this),_classPrivateFieldSet(_,this,!0)),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()}function F(t,e){var s;const[i,n]=this.parentDimensions;this.width=t/i,this.height=e/n,this.setDims(t,e),null!==(s=this._initialOptions)&&void 0!==s&&s.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==_classPrivateFieldGet(g,this)&&clearTimeout(_classPrivateFieldGet(g,this)),_classPrivateFieldSet(g,this,setTimeout((()=>{_classPrivateFieldSet(g,this,null),_assertClassBrand(m,this,x).call(this,t,e)}),200))}function w(t,e){const{width:s,height:i}=_classPrivateFieldGet(l,this);let n=s,a=i,r=_classPrivateFieldGet(l,this);for(;n>2*t||a>2*e;){const s=n,i=a;n>2*t&&(n=n>=16384?Math.floor(n/2)-1:Math.ceil(n/2)),a>2*e&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2));const o=new OffscreenCanvas(n,a);o.getContext("2d").drawImage(r,0,0,s,i,0,0,n,a),r=o.transferToImageBitmap()}return r}function x(t,e){t=Math.ceil(t),e=Math.ceil(e);const s=_classPrivateFieldGet(p,this);if(!s||s.width===t&&s.height===e)return;s.width=t,s.height=e;const i=_classPrivateFieldGet(v,this)?_classPrivateFieldGet(l,this):_assertClassBrand(m,this,w).call(this,t,e),n=s.getContext("2d");n.filter=this._uiManager.hcmFilter,n.drawImage(i,0,0,i.width,i.height,0,0,t,e)}function C(t){if(t){if(_classPrivateFieldGet(v,this)){const t=this._uiManager.imageManager.getSvgUrl(_classPrivateFieldGet(c,this));if(t)return t}const t=document.createElement("canvas");return({width:t.width,height:t.height}=_classPrivateFieldGet(l,this)),t.getContext("2d").drawImage(_classPrivateFieldGet(l,this),0,0),t.toDataURL()}if(_classPrivateFieldGet(v,this)){const[t,e]=this.pageDimensions,s=Math.round(this.width*t*r.PixelsPerInch.PDF_TO_CSS_UNITS),i=Math.round(this.height*e*r.PixelsPerInch.PDF_TO_CSS_UNITS),n=new OffscreenCanvas(s,i);return n.getContext("2d").drawImage(_classPrivateFieldGet(l,this),0,0,_classPrivateFieldGet(l,this).width,_classPrivateFieldGet(l,this).height,0,0,s,i),n.transferToImageBitmap()}return structuredClone(_classPrivateFieldGet(l,this))}function E(){_classPrivateFieldSet(f,this,new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&_assertClassBrand(m,this,F).call(this,e.width,e.height)}))),_classPrivateFieldGet(f,this).observe(this.div)}i=b,_defineProperty(b,"_type","stamp"),e.StampEditor=b}],__webpack_module_cache__={};function __w_pdfjs_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var s=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t](s,s.exports,__w_pdfjs_require__),s.exports}var __nested_webpack_exports__={};return(()=>{var t=__nested_webpack_exports__;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AbortException",{enumerable:!0,get:function(){return e.AbortException}}),Object.defineProperty(t,"AnnotationEditorLayer",{enumerable:!0,get:function(){return a.AnnotationEditorLayer}}),Object.defineProperty(t,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return e.AnnotationEditorParamsType}}),Object.defineProperty(t,"AnnotationEditorType",{enumerable:!0,get:function(){return e.AnnotationEditorType}}),Object.defineProperty(t,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return r.AnnotationEditorUIManager}}),Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function(){return o.AnnotationLayer}}),Object.defineProperty(t,"AnnotationMode",{enumerable:!0,get:function(){return e.AnnotationMode}}),Object.defineProperty(t,"CMapCompressionType",{enumerable:!0,get:function(){return e.CMapCompressionType}}),Object.defineProperty(t,"DOMSVGFactory",{enumerable:!0,get:function(){return i.DOMSVGFactory}}),Object.defineProperty(t,"FeatureTest",{enumerable:!0,get:function(){return e.FeatureTest}}),Object.defineProperty(t,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}}),Object.defineProperty(t,"ImageKind",{enumerable:!0,get:function(){return e.ImageKind}}),Object.defineProperty(t,"InvalidPDFException",{enumerable:!0,get:function(){return e.InvalidPDFException}}),Object.defineProperty(t,"MissingPDFException",{enumerable:!0,get:function(){return e.MissingPDFException}}),Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return e.OPS}}),Object.defineProperty(t,"PDFDataRangeTransport",{enumerable:!0,get:function(){return s.PDFDataRangeTransport}}),Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return i.PDFDateString}}),Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function(){return s.PDFWorker}}),Object.defineProperty(t,"PasswordResponses",{enumerable:!0,get:function(){return e.PasswordResponses}}),Object.defineProperty(t,"PermissionFlag",{enumerable:!0,get:function(){return e.PermissionFlag}}),Object.defineProperty(t,"PixelsPerInch",{enumerable:!0,get:function(){return i.PixelsPerInch}}),Object.defineProperty(t,"PromiseCapability",{enumerable:!0,get:function(){return e.PromiseCapability}}),Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return i.RenderingCancelledException}}),Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function(){return s.SVGGraphics}}),Object.defineProperty(t,"UnexpectedResponseException",{enumerable:!0,get:function(){return e.UnexpectedResponseException}}),Object.defineProperty(t,"Util",{enumerable:!0,get:function(){return e.Util}}),Object.defineProperty(t,"VerbosityLevel",{enumerable:!0,get:function(){return e.VerbosityLevel}}),Object.defineProperty(t,"XfaLayer",{enumerable:!0,get:function(){return c.XfaLayer}}),Object.defineProperty(t,"build",{enumerable:!0,get:function(){return s.build}}),Object.defineProperty(t,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return e.createValidAbsoluteUrl}}),Object.defineProperty(t,"getDocument",{enumerable:!0,get:function(){return s.getDocument}}),Object.defineProperty(t,"getFilenameFromUrl",{enumerable:!0,get:function(){return i.getFilenameFromUrl}}),Object.defineProperty(t,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return i.getPdfFilenameFromUrl}}),Object.defineProperty(t,"getXfaPageViewport",{enumerable:!0,get:function(){return i.getXfaPageViewport}}),Object.defineProperty(t,"isDataScheme",{enumerable:!0,get:function(){return i.isDataScheme}}),Object.defineProperty(t,"isPdfFile",{enumerable:!0,get:function(){return i.isPdfFile}}),Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return i.loadScript}}),Object.defineProperty(t,"noContextMenu",{enumerable:!0,get:function(){return i.noContextMenu}}),Object.defineProperty(t,"normalizeUnicode",{enumerable:!0,get:function(){return e.normalizeUnicode}}),Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return n.renderTextLayer}}),Object.defineProperty(t,"setLayerDimensions",{enumerable:!0,get:function(){return i.setLayerDimensions}}),Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return e.shadow}}),Object.defineProperty(t,"updateTextLayer",{enumerable:!0,get:function(){return n.updateTextLayer}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return s.version}});var e=__w_pdfjs_require__(1),s=__w_pdfjs_require__(2),i=__w_pdfjs_require__(6),n=__w_pdfjs_require__(26),a=__w_pdfjs_require__(27),r=__w_pdfjs_require__(5),o=__w_pdfjs_require__(29),l=__w_pdfjs_require__(14),c=__w_pdfjs_require__(32)})(),__nested_webpack_exports__})(),module.exports=root.pdfjsLib=factory()},24480:(t,e,s)=>{"use strict";function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.CopyToClipboard=void 0;var n=o(s(65043)),a=o(s(75270)),r=["text","onCopy","options","children"];function o(t){return t&&t.__esModule?t:{default:t}}function l(t,e){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),s.push.apply(s,i)}return s}function c(t){for(var e=1;e<arguments.length;e++){var s=null!=arguments[e]?arguments[e]:{};e%2?l(Object(s),!0).forEach((function(e){v(t,e,s[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):l(Object(s)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(s,e))}))}return t}function d(t,e){if(null==t)return{};var s,i,n=function(t,e){if(null==t)return{};var s,i,n={},a=Object.keys(t);for(i=0;i<a.length;i++)s=a[i],e.indexOf(s)>=0||(n[s]=t[s]);return n}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)s=a[i],e.indexOf(s)>=0||Object.prototype.propertyIsEnumerable.call(t,s)&&(n[s]=t[s])}return n}function h(t,e){for(var s=0;s<e.length;s++){var i=e[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},u(t,e)}function p(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var s,n=g(t);if(e){var a=g(this).constructor;s=Reflect.construct(n,arguments,a)}else s=n.apply(this,arguments);return function(t,e){if(e&&("object"===i(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return f(t)}(this,s)}}function f(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function g(t){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},g(t)}function v(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}var _=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}(l,t);var e,s,i,o=p(l);function l(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l);for(var e=arguments.length,s=new Array(e),i=0;i<e;i++)s[i]=arguments[i];return v(f(t=o.call.apply(o,[this].concat(s))),"onClick",(function(e){var s=t.props,i=s.text,r=s.onCopy,o=s.children,l=s.options,c=n.default.Children.only(o),d=(0,a.default)(i,l);r&&r(i,d),c&&c.props&&"function"===typeof c.props.onClick&&c.props.onClick(e)})),t}return e=l,(s=[{key:"render",value:function(){var t=this.props,e=(t.text,t.onCopy,t.options,t.children),s=d(t,r),i=n.default.Children.only(e);return n.default.cloneElement(i,c(c({},s),{},{onClick:this.onClick}))}}])&&h(e.prototype,s),i&&h(e,i),Object.defineProperty(e,"prototype",{writable:!1}),l}(n.default.PureComponent);e.CopyToClipboard=_,v(_,"defaultProps",{onCopy:void 0,options:void 0})},61476:(t,e,s)=>{"use strict";var i=s(24480).CopyToClipboard;i.CopyToClipboard=i,t.exports=i},94281:(t,e,s)=>{"use strict";s.d(e,{VB:()=>ht});var i=s(65043),n=s(65173),a=s.n(n);function r(t,e,s,i){return new(s||(s=Promise))((function(n,a){function r(t){try{l(i.next(t))}catch(e){a(e)}}function o(t){try{l(i.throw(t))}catch(e){a(e)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(r,o)}l((i=i.apply(t,e||[])).next())}))}function o(t,e){var s,i,n,a,r={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(o){return function(l){return function(o){if(s)throw new TypeError("Generator is already executing.");for(;a&&(a=0,o[0]&&(r=0)),r;)try{if(s=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return r.label++,{value:o[1],done:!1};case 5:r.label++,i=o[1],o=[0];continue;case 7:o=r.ops.pop(),r.trys.pop();continue;default:if(!(n=(n=r.trys).length>0&&n[n.length-1])&&(6===o[0]||2===o[0])){r=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){r.label=o[1];break}if(6===o[0]&&r.label<n[1]){r.label=n[1],n=o;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(o);break}n[2]&&r.ops.pop(),r.trys.pop();continue}o=e.call(t,r)}catch(l){o=[6,l],i=0}finally{s=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}Object.create;function l(t,e){var s="function"===typeof Symbol&&t[Symbol.iterator];if(!s)return t;var i,n,a=s.call(t),r=[];try{for(;(void 0===e||e-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(o){n={error:o}}finally{try{i&&!i.done&&(s=a.return)&&s.call(a)}finally{if(n)throw n.error}}return r}function c(t,e,s){if(s||2===arguments.length)for(var i,n=0,a=e.length;n<a;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}Object.create;"function"===typeof SuppressedError&&SuppressedError;var d=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function h(t,e){var s=function(t){var e=t.name;if(e&&-1!==e.lastIndexOf(".")&&!t.type){var s=e.split(".").pop().toLowerCase(),i=d.get(s);i&&Object.defineProperty(t,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return t}(t);if("string"!==typeof s.path){var i=t.webkitRelativePath;Object.defineProperty(s,"path",{value:"string"===typeof e?e:"string"===typeof i&&i.length>0?i:t.name,writable:!1,configurable:!1,enumerable:!0})}return s}var u=[".DS_Store","Thumbs.db"];function p(t){return"object"===typeof t&&null!==t}function f(t){return m(t.target.files).map((function(t){return h(t)}))}function g(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,Promise.all(t.map((function(t){return t.getFile()})))];case 1:return[2,e.sent().map((function(t){return h(t)}))]}}))}))}function v(t,e){return r(this,void 0,void 0,(function(){var s;return o(this,(function(i){switch(i.label){case 0:return t.items?(s=m(t.items).filter((function(t){return"file"===t.kind})),"drop"!==e?[2,s]:[4,Promise.all(s.map(b))]):[3,2];case 1:return[2,_(y(i.sent()))];case 2:return[2,_(m(t.files).map((function(t){return h(t)})))]}}))}))}function _(t){return t.filter((function(t){return-1===u.indexOf(t.name)}))}function m(t){if(null===t)return[];for(var e=[],s=0;s<t.length;s++){var i=t[s];e.push(i)}return e}function b(t){if("function"!==typeof t.webkitGetAsEntry)return P(t);var e=t.webkitGetAsEntry();return e&&e.isDirectory?S(e):P(t)}function y(t){return t.reduce((function(t,e){return c(c([],l(t),!1),l(Array.isArray(e)?y(e):[e]),!1)}),[])}function P(t){var e=t.getAsFile();if(!e)return Promise.reject("".concat(t," is not a File"));var s=h(e);return Promise.resolve(s)}function A(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,t.isDirectory?S(t):F(t)]}))}))}function S(t){var e=t.createReader();return new Promise((function(t,s){var i=[];!function n(){var a=this;e.readEntries((function(e){return r(a,void 0,void 0,(function(){var a,r,l;return o(this,(function(o){switch(o.label){case 0:if(e.length)return[3,5];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return a=o.sent(),t(a),[3,4];case 3:return r=o.sent(),s(r),[3,4];case 4:return[3,6];case 5:l=Promise.all(e.map(A)),i.push(l),n(),o.label=6;case 6:return[2]}}))}))}),(function(t){s(t)}))}()}))}function F(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,new Promise((function(e,s){t.file((function(s){var i=h(s,t.fullPath);e(i)}),(function(t){s(t)}))}))]}))}))}var w=s(18628);function x(t){return function(t){if(Array.isArray(t))return R(t)}(t)||function(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||M(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(t,e){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),s.push.apply(s,i)}return s}function E(t){for(var e=1;e<arguments.length;e++){var s=null!=arguments[e]?arguments[e]:{};e%2?C(Object(s),!0).forEach((function(e){k(t,e,s[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):C(Object(s)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(s,e))}))}return t}function k(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function T(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var s=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==s)return;var i,n,a=[],r=!0,o=!1;try{for(s=s.call(t);!(r=(i=s.next()).done)&&(a.push(i.value),!e||a.length!==e);r=!0);}catch(l){o=!0,n=l}finally{try{r||null==s.return||s.return()}finally{if(o)throw n}}return a}(t,e)||M(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(t,e){if(t){if("string"===typeof t)return R(t,e);var s=Object.prototype.toString.call(t).slice(8,-1);return"Object"===s&&t.constructor&&(s=t.constructor.name),"Map"===s||"Set"===s?Array.from(t):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?R(t,e):void 0}}function R(t,e){(null==e||e>t.length)&&(e=t.length);for(var s=0,i=new Array(e);s<e;s++)i[s]=t[s];return i}var I="file-invalid-type",D="file-too-large",O="file-too-small",L="too-many-files",G=function(t){t=Array.isArray(t)&&1===t.length?t[0]:t;var e=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:I,message:"File type must be ".concat(e)}},N=function(t){return{code:D,message:"File is larger than ".concat(t," ").concat(1===t?"byte":"bytes")}},B=function(t){return{code:O,message:"File is smaller than ".concat(t," ").concat(1===t?"byte":"bytes")}},j={code:L,message:"Too many files"};function W(t,e){var s="application/x-moz-file"===t.type||(0,w.A)(t,e);return[s,s?null:G(e)]}function U(t,e,s){if(z(t.size))if(z(e)&&z(s)){if(t.size>s)return[!1,N(s)];if(t.size<e)return[!1,B(e)]}else{if(z(e)&&t.size<e)return[!1,B(e)];if(z(s)&&t.size>s)return[!1,N(s)]}return[!0,null]}function z(t){return void 0!==t&&null!==t}function q(t){return"function"===typeof t.isPropagationStopped?t.isPropagationStopped():"undefined"!==typeof t.cancelBubble&&t.cancelBubble}function H(t){return t.dataTransfer?Array.prototype.some.call(t.dataTransfer.types,(function(t){return"Files"===t||"application/x-moz-file"===t})):!!t.target&&!!t.target.files}function V(t){t.preventDefault()}function X(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];return function(t){for(var s=arguments.length,i=new Array(s>1?s-1:0),n=1;n<s;n++)i[n-1]=arguments[n];return e.some((function(e){return!q(t)&&e&&e.apply(void 0,[t].concat(i)),q(t)}))}}function K(t){return"audio/*"===t||"video/*"===t||"image/*"===t||"text/*"===t||/\w+\/[-+.\w]+/g.test(t)}function Y(t){return/^.*\.[\w]+$/.test(t)}var J=["children"],Q=["open"],Z=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],$=["refKey","onChange","onClick"];function tt(t){return function(t){if(Array.isArray(t))return it(t)}(t)||function(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||st(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function et(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var s=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==s)return;var i,n,a=[],r=!0,o=!1;try{for(s=s.call(t);!(r=(i=s.next()).done)&&(a.push(i.value),!e||a.length!==e);r=!0);}catch(l){o=!0,n=l}finally{try{r||null==s.return||s.return()}finally{if(o)throw n}}return a}(t,e)||st(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function st(t,e){if(t){if("string"===typeof t)return it(t,e);var s=Object.prototype.toString.call(t).slice(8,-1);return"Object"===s&&t.constructor&&(s=t.constructor.name),"Map"===s||"Set"===s?Array.from(t):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?it(t,e):void 0}}function it(t,e){(null==e||e>t.length)&&(e=t.length);for(var s=0,i=new Array(e);s<e;s++)i[s]=t[s];return i}function nt(t,e){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),s.push.apply(s,i)}return s}function at(t){for(var e=1;e<arguments.length;e++){var s=null!=arguments[e]?arguments[e]:{};e%2?nt(Object(s),!0).forEach((function(e){rt(t,e,s[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):nt(Object(s)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(s,e))}))}return t}function rt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function ot(t,e){if(null==t)return{};var s,i,n=function(t,e){if(null==t)return{};var s,i,n={},a=Object.keys(t);for(i=0;i<a.length;i++)s=a[i],e.indexOf(s)>=0||(n[s]=t[s]);return n}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)s=a[i],e.indexOf(s)>=0||Object.prototype.propertyIsEnumerable.call(t,s)&&(n[s]=t[s])}return n}var lt=(0,i.forwardRef)((function(t,e){var s=t.children,n=ht(ot(t,J)),a=n.open,r=ot(n,Q);return(0,i.useImperativeHandle)(e,(function(){return{open:a}}),[a]),i.createElement(i.Fragment,null,s(at(at({},r),{},{open:a})))}));lt.displayName="Dropzone";var ct={disabled:!1,getFilesFromEvent:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return p(t)&&p(t.dataTransfer)?[2,v(t.dataTransfer,t.type)]:function(t){return p(t)&&p(t.target)}(t)?[2,f(t)]:Array.isArray(t)&&t.every((function(t){return"getFile"in t&&"function"===typeof t.getFile}))?[2,g(t)]:[2,[]]}))}))},maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};lt.defaultProps=ct,lt.propTypes={children:a().func,accept:a().objectOf(a().arrayOf(a().string)),multiple:a().bool,preventDropOnDocument:a().bool,noClick:a().bool,noKeyboard:a().bool,noDrag:a().bool,noDragEventsBubbling:a().bool,minSize:a().number,maxSize:a().number,maxFiles:a().number,disabled:a().bool,getFilesFromEvent:a().func,onFileDialogCancel:a().func,onFileDialogOpen:a().func,useFsAccessApi:a().bool,autoFocus:a().bool,onDragEnter:a().func,onDragLeave:a().func,onDragOver:a().func,onDrop:a().func,onDropAccepted:a().func,onDropRejected:a().func,onError:a().func,validator:a().func};var dt={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function ht(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=at(at({},ct),t),s=e.accept,n=e.disabled,a=e.getFilesFromEvent,r=e.maxSize,o=e.minSize,l=e.multiple,c=e.maxFiles,d=e.onDragEnter,h=e.onDragLeave,u=e.onDragOver,p=e.onDrop,f=e.onDropAccepted,g=e.onDropRejected,v=e.onFileDialogCancel,_=e.onFileDialogOpen,m=e.useFsAccessApi,b=e.autoFocus,y=e.preventDropOnDocument,P=e.noClick,A=e.noKeyboard,S=e.noDrag,F=e.noDragEventsBubbling,w=e.onError,C=e.validator,M=(0,i.useMemo)((function(){return function(t){if(z(t))return Object.entries(t).reduce((function(t,e){var s=T(e,2),i=s[0],n=s[1];return[].concat(x(t),[i],x(n))}),[]).filter((function(t){return K(t)||Y(t)})).join(",")}(s)}),[s]),R=(0,i.useMemo)((function(){return function(t){return z(t)?[{description:"Files",accept:Object.entries(t).filter((function(t){var e=T(t,2),s=e[0],i=e[1],n=!0;return K(s)||(console.warn('Skipped "'.concat(s,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),n=!1),Array.isArray(i)&&i.every(Y)||(console.warn('Skipped "'.concat(s,'" because an invalid file extension was provided.')),n=!1),n})).reduce((function(t,e){var s=T(e,2),i=s[0],n=s[1];return E(E({},t),{},k({},i,n))}),{})}]:t}(s)}),[s]),I=(0,i.useMemo)((function(){return"function"===typeof _?_:pt}),[_]),D=(0,i.useMemo)((function(){return"function"===typeof v?v:pt}),[v]),O=(0,i.useRef)(null),L=(0,i.useRef)(null),G=et((0,i.useReducer)(ut,dt),2),N=G[0],B=G[1],J=N.isFocused,Q=N.isFileDialogActive,st=(0,i.useRef)("undefined"!==typeof window&&window.isSecureContext&&m&&"showOpenFilePicker"in window),it=function(){!st.current&&Q&&setTimeout((function(){L.current&&(L.current.files.length||(B({type:"closeDialog"}),D()))}),300)};(0,i.useEffect)((function(){return window.addEventListener("focus",it,!1),function(){window.removeEventListener("focus",it,!1)}}),[L,Q,D,st]);var nt=(0,i.useRef)([]),lt=function(t){O.current&&O.current.contains(t.target)||(t.preventDefault(),nt.current=[])};(0,i.useEffect)((function(){return y&&(document.addEventListener("dragover",V,!1),document.addEventListener("drop",lt,!1)),function(){y&&(document.removeEventListener("dragover",V),document.removeEventListener("drop",lt))}}),[O,y]),(0,i.useEffect)((function(){return!n&&b&&O.current&&O.current.focus(),function(){}}),[O,b,n]);var ht=(0,i.useCallback)((function(t){w?w(t):console.error(t)}),[w]),ft=(0,i.useCallback)((function(t){t.preventDefault(),t.persist(),Ct(t),nt.current=[].concat(tt(nt.current),[t.target]),H(t)&&Promise.resolve(a(t)).then((function(e){if(!q(t)||F){var s=e.length,i=s>0&&function(t){var e=t.files,s=t.accept,i=t.minSize,n=t.maxSize,a=t.multiple,r=t.maxFiles,o=t.validator;return!(!a&&e.length>1||a&&r>=1&&e.length>r)&&e.every((function(t){var e=T(W(t,s),1)[0],a=T(U(t,i,n),1)[0],r=o?o(t):null;return e&&a&&!r}))}({files:e,accept:M,minSize:o,maxSize:r,multiple:l,maxFiles:c,validator:C});B({isDragAccept:i,isDragReject:s>0&&!i,isDragActive:!0,type:"setDraggedFiles"}),d&&d(t)}})).catch((function(t){return ht(t)}))}),[a,d,ht,F,M,o,r,l,c,C]),gt=(0,i.useCallback)((function(t){t.preventDefault(),t.persist(),Ct(t);var e=H(t);if(e&&t.dataTransfer)try{t.dataTransfer.dropEffect="copy"}catch(s){}return e&&u&&u(t),!1}),[u,F]),vt=(0,i.useCallback)((function(t){t.preventDefault(),t.persist(),Ct(t);var e=nt.current.filter((function(t){return O.current&&O.current.contains(t)})),s=e.indexOf(t.target);-1!==s&&e.splice(s,1),nt.current=e,e.length>0||(B({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),H(t)&&h&&h(t))}),[O,h,F]),_t=(0,i.useCallback)((function(t,e){var s=[],i=[];t.forEach((function(t){var e=et(W(t,M),2),n=e[0],a=e[1],l=et(U(t,o,r),2),c=l[0],d=l[1],h=C?C(t):null;if(n&&c&&!h)s.push(t);else{var u=[a,d];h&&(u=u.concat(h)),i.push({file:t,errors:u.filter((function(t){return t}))})}})),(!l&&s.length>1||l&&c>=1&&s.length>c)&&(s.forEach((function(t){i.push({file:t,errors:[j]})})),s.splice(0)),B({acceptedFiles:s,fileRejections:i,type:"setFiles"}),p&&p(s,i,e),i.length>0&&g&&g(i,e),s.length>0&&f&&f(s,e)}),[B,l,M,o,r,c,p,f,g,C]),mt=(0,i.useCallback)((function(t){t.preventDefault(),t.persist(),Ct(t),nt.current=[],H(t)&&Promise.resolve(a(t)).then((function(e){q(t)&&!F||_t(e,t)})).catch((function(t){return ht(t)})),B({type:"reset"})}),[a,_t,ht,F]),bt=(0,i.useCallback)((function(){if(st.current){B({type:"openDialog"}),I();var t={multiple:l,types:R};window.showOpenFilePicker(t).then((function(t){return a(t)})).then((function(t){_t(t,null),B({type:"closeDialog"})})).catch((function(t){var e;(e=t)instanceof DOMException&&("AbortError"===e.name||e.code===e.ABORT_ERR)?(D(t),B({type:"closeDialog"})):!function(t){return t instanceof DOMException&&("SecurityError"===t.name||t.code===t.SECURITY_ERR)}(t)?ht(t):(st.current=!1,L.current?(L.current.value=null,L.current.click()):ht(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided.")))}))}else L.current&&(B({type:"openDialog"}),I(),L.current.value=null,L.current.click())}),[B,I,D,m,_t,ht,R,l]),yt=(0,i.useCallback)((function(t){O.current&&O.current.isEqualNode(t.target)&&(" "!==t.key&&"Enter"!==t.key&&32!==t.keyCode&&13!==t.keyCode||(t.preventDefault(),bt()))}),[O,bt]),Pt=(0,i.useCallback)((function(){B({type:"focus"})}),[]),At=(0,i.useCallback)((function(){B({type:"blur"})}),[]),St=(0,i.useCallback)((function(){P||(!function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return function(t){return-1!==t.indexOf("MSIE")||-1!==t.indexOf("Trident/")}(t)||function(t){return-1!==t.indexOf("Edge/")}(t)}()?bt():setTimeout(bt,0))}),[P,bt]),Ft=function(t){return n?null:t},wt=function(t){return A?null:Ft(t)},xt=function(t){return S?null:Ft(t)},Ct=function(t){F&&t.stopPropagation()},Et=(0,i.useMemo)((function(){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.refKey,s=void 0===e?"ref":e,i=t.role,a=t.onKeyDown,r=t.onFocus,o=t.onBlur,l=t.onClick,c=t.onDragEnter,d=t.onDragOver,h=t.onDragLeave,u=t.onDrop,p=ot(t,Z);return at(at(rt({onKeyDown:wt(X(a,yt)),onFocus:wt(X(r,Pt)),onBlur:wt(X(o,At)),onClick:Ft(X(l,St)),onDragEnter:xt(X(c,ft)),onDragOver:xt(X(d,gt)),onDragLeave:xt(X(h,vt)),onDrop:xt(X(u,mt)),role:"string"===typeof i&&""!==i?i:"presentation"},s,O),n||A?{}:{tabIndex:0}),p)}}),[O,yt,Pt,At,St,ft,gt,vt,mt,A,S,n]),kt=(0,i.useCallback)((function(t){t.stopPropagation()}),[]),Tt=(0,i.useMemo)((function(){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.refKey,s=void 0===e?"ref":e,i=t.onChange,n=t.onClick,a=ot(t,$);return at(at({},rt({accept:M,multiple:l,type:"file",style:{display:"none"},onChange:Ft(X(i,mt)),onClick:Ft(X(n,kt)),tabIndex:-1},s,L)),a)}}),[L,s,l,mt,n]);return at(at({},N),{},{isFocused:J&&!n,getRootProps:Et,getInputProps:Tt,rootRef:O,inputRef:L,open:Ft(bt)})}function ut(t,e){switch(e.type){case"focus":return at(at({},t),{},{isFocused:!0});case"blur":return at(at({},t),{},{isFocused:!1});case"openDialog":return at(at({},dt),{},{isFileDialogActive:!0});case"closeDialog":return at(at({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":return at(at({},t),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return at(at({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections});case"reset":return at({},dt);default:return t}}function pt(){}},40139:t=>{t.exports=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,s=[],i=0;i<t.rangeCount;i++)s.push(t.getRangeAt(i));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null}return t.removeAllRanges(),function(){"Caret"===t.type&&t.removeAllRanges(),t.rangeCount||s.forEach((function(e){t.addRange(e)})),e&&e.focus()}}},96440:t=>{"use strict";var e=function(){};t.exports=e},81756:t=>{t.exports=function(t,e,s){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:s;throw new TypeError("Private element is not present on this object")},t.exports.__esModule=!0,t.exports.default=t.exports},97101:t=>{t.exports=function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")},t.exports.__esModule=!0,t.exports.default=t.exports},16668:(t,e,s)=>{var i=s(81756);t.exports=function(t,e){return t.get(i(t,e))},t.exports.__esModule=!0,t.exports.default=t.exports},42459:(t,e,s)=>{var i=s(97101);t.exports=function(t,e,s){i(t,e),e.set(t,s)},t.exports.__esModule=!0,t.exports.default=t.exports},37088:(t,e,s)=>{var i=s(81756);t.exports=function(t,e,s){return t.set(i(t,e),s),s},t.exports.__esModule=!0,t.exports.default=t.exports},183:(t,e,s)=>{var i=s(81756);t.exports=function(t,e,s){return s(i(t,e))},t.exports.__esModule=!0,t.exports.default=t.exports},93312:(t,e,s)=>{var i=s(97101);t.exports=function(t,e){i(t,e),e.add(t)},t.exports.__esModule=!0,t.exports.default=t.exports},43693:(t,e,s)=>{var i=s(77736);t.exports=function(t,e,s){return(e=i(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t},t.exports.__esModule=!0,t.exports.default=t.exports},89045:(t,e,s)=>{var i=s(73738).default;t.exports=function(t,e){if("object"!=i(t)||!t)return t;var s=t[Symbol.toPrimitive];if(void 0!==s){var n=s.call(t,e||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},77736:(t,e,s)=>{var i=s(73738).default,n=s(89045);t.exports=function(t){var e=n(t,"string");return"symbol"==i(e)?e:e+""},t.exports.__esModule=!0,t.exports.default=t.exports},73738:t=>{function e(s){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(s)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},40645:(t,e,s)=>{"use strict";function i(t){var e=!1;return{promise:new Promise((function(s,i){t.then((function(t){return!e&&s(t)})).catch((function(t){return!e&&i(t)}))})),cancel:function(){e=!0}}}s.d(e,{A:()=>i})},77906:(t,e,s)=>{"use strict";s.d(e,{Ay:()=>a,Xz:()=>n});var i=function(t,e,s){if(s||2===arguments.length)for(var i,n=0,a=e.length;n<a;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))},n=i(i(i(i(i(i(i(i(i(i(i(i(i(i(i(i(i(i([],["onCopy","onCut","onPaste"],!0),["onCompositionEnd","onCompositionStart","onCompositionUpdate"],!0),["onFocus","onBlur"],!0),["onInput","onInvalid","onReset","onSubmit"],!0),["onLoad","onError"],!0),["onKeyDown","onKeyPress","onKeyUp"],!0),["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],!0),["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],!0),["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],!0),["onSelect"],!0),["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],!0),["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],!0),["onScroll"],!0),["onWheel"],!0),["onAnimationStart","onAnimationEnd","onAnimationIteration"],!0),["onTransitionEnd"],!0),["onChange"],!0),["onToggle"],!0);function a(t,e){var s={};return n.forEach((function(i){var n=t[i];n&&(s[i]=e?function(t){return n(t,e(i))}:n)})),s}},66730:(t,e,s)=>{"use strict";s.d(e,{A:()=>E});var i=s(65043),n=s(65173),a=s(77906),r=s(40645),o=s(58387),l=s(3404),c=s(96440),d=Object.prototype.hasOwnProperty;function h(t,e,s){for(s of t.keys())if(u(s,e))return s}function u(t,e){var s,i,n;if(t===e)return!0;if(t&&e&&(s=t.constructor)===e.constructor){if(s===Date)return t.getTime()===e.getTime();if(s===RegExp)return t.toString()===e.toString();if(s===Array){if((i=t.length)===e.length)for(;i--&&u(t[i],e[i]););return-1===i}if(s===Set){if(t.size!==e.size)return!1;for(i of t){if((n=i)&&"object"===typeof n&&!(n=h(e,n)))return!1;if(!e.has(n))return!1}return!0}if(s===Map){if(t.size!==e.size)return!1;for(i of t){if((n=i[0])&&"object"===typeof n&&!(n=h(e,n)))return!1;if(!u(i[1],e.get(n)))return!1}return!0}if(s===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(s===DataView){if((i=t.byteLength)===e.byteLength)for(;i--&&t.getInt8(i)===e.getInt8(i););return-1===i}if(ArrayBuffer.isView(t)){if((i=t.byteLength)===e.byteLength)for(;i--&&t[i]===e[i];);return-1===i}if(!s||"object"===typeof t){for(s in i=0,t){if(d.call(t,s)&&++i&&!d.call(e,s))return!1;if(!(s in e)||!u(t[s],e[s]))return!1}return Object.keys(e).length===i}}return t!==t&&e!==e}var p=s(72809),f=s(16512),g=s(48599),v=s(34899);const _={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};var m=s(20665),b=s(28234),y=s(88242),P=function(t,e,s,i){return new(s||(s=Promise))((function(n,a){function r(t){try{l(i.next(t))}catch(e){a(e)}}function o(t){try{l(i.throw(t))}catch(e){a(e)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(r,o)}l((i=i.apply(t,e||[])).next())}))},A=function(t,e){var s={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(s[i[n]]=t[i[n]])}return s};const{PDFDataRangeTransport:S}=p.A,F=(t,e)=>{switch(e){case _.NEED_PASSWORD:t(prompt("Enter the password to open this PDF file."));break;case _.INCORRECT_PASSWORD:t(prompt("Invalid password. Please try again."));break}};function w(t){return"object"===typeof t&&null!==t&&("data"in t||"range"in t||"url"in t)}const x=(0,i.forwardRef)((function(t,e){var{children:s,className:n,error:d="Failed to load PDF file.",externalLinkRel:h,externalLinkTarget:_,file:y,inputRef:x,imageResourcesPath:C,loading:E="Loading PDF\u2026",noData:k="No PDF file specified.",onItemClick:T,onLoadError:M,onLoadProgress:R,onLoadSuccess:I,onPassword:D=F,onSourceError:O,onSourceSuccess:L,options:G,renderMode:N,rotate:B}=t,j=A(t,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[W,U]=(0,b.A)(),{value:z,error:q}=W,[H,V]=(0,b.A)(),{value:X,error:K}=H,Y=(0,i.useRef)(new v.A),J=(0,i.useRef)([]),Q=(0,i.useRef)(),Z=(0,i.useRef)();(0,i.useEffect)((()=>{y&&y!==Q.current&&w(y)&&(c(!u(y,Q.current),'File prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.'),Q.current=y)}),[y]),(0,i.useEffect)((()=>{G&&G!==Z.current&&(c(!u(G,Z.current),'Options prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.'),Z.current=G)}),[G]);const $=(0,i.useRef)({scrollPageIntoView:t=>{const{dest:e,pageNumber:s,pageIndex:i=s-1}=t;if(T)return void T({dest:e,pageIndex:i,pageNumber:s});const n=J.current[i];n?n.scrollIntoView():c(!1,"An internal link leading to page ".concat(s," was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>."))}});(0,i.useImperativeHandle)(e,(()=>({linkService:Y,pages:J,viewer:$})),[]),(0,i.useEffect)((function(){U({type:"RESET"})}),[y,U]);const tt=(0,i.useCallback)((()=>P(this,void 0,void 0,(function*(){if(!y)return null;if("string"===typeof y){if((0,m.zL)(y)){return{data:(0,m.jA)(y)}}return(0,m.qC)(),{url:y}}if(y instanceof S)return{range:y};if((0,m.mw)(y))return{data:y};if(m.Bd&&(0,m.qf)(y)){return{data:yield(0,m.h1)(y)}}if((0,l.A)("object"===typeof y,"Invalid parameter in file, need either Uint8Array, string or a parameter object"),(0,l.A)(w(y),"Invalid parameter object: need either .data, .range or .url"),"url"in y&&"string"===typeof y.url){if((0,m.zL)(y.url)){const{url:t}=y,e=A(y,["url"]),s=(0,m.jA)(t);return Object.assign({data:s},e)}(0,m.qC)()}return y}))),[y]);function et(t,e){J.current[t]=e}function st(t){delete J.current[t]}(0,i.useEffect)((()=>{const t=(0,r.A)(tt());return t.promise.then((t=>{U({type:"RESOLVE",value:t})})).catch((t=>{U({type:"REJECT",error:t})})),()=>{(0,m.xL)(t)}}),[tt,U]),(0,i.useEffect)((()=>{"undefined"!==typeof z&&(!1!==z?L&&L():q&&(c(!1,q.toString()),O&&O(q)))}),[z]),(0,i.useEffect)((function(){V({type:"RESET"})}),[V,z]),(0,i.useEffect)((function(){if(!z)return;const t=G?Object.assign(Object.assign({},z),G):z,e=p.A.getDocument(t);R&&(e.onProgress=R),D&&(e.onPassword=D);const s=e;return s.promise.then((t=>{V({type:"RESOLVE",value:t})})).catch((t=>{s.destroyed||V({type:"REJECT",error:t})})),()=>{s.destroy()}}),[G,V,z]),(0,i.useEffect)((()=>{"undefined"!==typeof X&&(!1!==X?X&&(I&&I(X),J.current=new Array(X.numPages),Y.current.setDocument(X)):K&&(c(!1,K.toString()),M&&M(K)))}),[X]),(0,i.useEffect)((function(){Y.current.setViewer($.current),Y.current.setExternalLinkRel(h),Y.current.setExternalLinkTarget(_)}),[h,_]);const it=(0,i.useMemo)((()=>({imageResourcesPath:C,linkService:Y.current,onItemClick:T,pdf:X,registerPage:et,renderMode:N,rotate:B,unregisterPage:st})),[C,T,X,N,B]),nt=(0,i.useMemo)((()=>(0,a.Ay)(j,(()=>X))),[j,X]);return i.createElement("div",Object.assign({className:(0,o.A)("react-pdf__Document",n),ref:x,style:{"--scale-factor":"1"}},nt),y?void 0===X||null===X?i.createElement(g.A,{type:"loading"},"function"===typeof E?E():E):!1===X?i.createElement(g.A,{type:"error"},"function"===typeof d?d():d):i.createElement(f.A.Provider,{value:it},s):i.createElement(g.A,{type:"no-data"},"function"===typeof k?k():k))})),C=n.oneOfType([n.func,n.node]);x.propTypes=Object.assign(Object.assign({},y.zq),{children:n.node,className:y.uG,error:C,externalLinkRel:n.string,externalLinkTarget:n.oneOf(["_self","_blank","_parent","_top"]),file:y.fo,imageResourcesPath:n.string,inputRef:y.i9,loading:C,noData:C,onItemClick:n.func,onLoadError:n.func,onLoadProgress:n.func,onLoadSuccess:n.func,onPassword:n.func,onSourceError:n.func,onSourceSuccess:n.func,options:n.shape({canvasFactory:n.any,canvasMaxAreaInBytes:n.number,cMapPacked:n.bool,CMapReaderFactory:n.any,cMapUrl:n.string,disableAutoFetch:n.bool,disableFontFace:n.bool,disableRange:n.bool,disableStream:n.bool,docBaseUrl:n.string,enableXfa:n.bool,filterFactory:n.any,fontExtraProperties:n.bool,httpHeaders:n.object,isEvalSupported:n.bool,isOffscreenCanvasSupported:n.bool,length:n.number,maxImageSize:n.number,ownerDocument:n.any,password:n.string,pdfBug:n.bool,rangeChunkSize:n.number,StandardFontDataFactory:n.any,standardFontDataUrl:n.string,stopAtErrors:n.bool,useSystemFonts:n.bool,useWorkerFetch:n.bool,verbosity:n.number,withCredentials:n.bool,worker:n.any}),rotate:n.number});const E=x},16512:(t,e,s)=>{"use strict";s.d(e,{A:()=>i});const i=(0,s(65043).createContext)(null)},34899:(t,e,s)=>{"use strict";s.d(e,{A:()=>n});var i=s(3404);class n{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(t){this.pdfDocument=t}setViewer(t){this.pdfViewer=t}setExternalLinkRel(t){this.externalLinkRel=t}setExternalLinkTarget(t){this.externalLinkTarget=t}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return(0,i.A)(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(t){(0,i.A)(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=t}get rotation(){return 0}set rotation(t){}goToDestination(t){return new Promise((e=>{(0,i.A)(this.pdfDocument,"PDF document not loaded."),(0,i.A)(t,"Destination is not specified."),"string"===typeof t?this.pdfDocument.getDestination(t).then(e):Array.isArray(t)?e(t):t.then(e)})).then((t=>{(0,i.A)(Array.isArray(t),'"'.concat(t,'" is not a valid destination array.'));const e=t[0];new Promise((t=>{(0,i.A)(this.pdfDocument,"PDF document not loaded."),e instanceof Object?this.pdfDocument.getPageIndex(e).then((e=>{t(e)})).catch((()=>{(0,i.A)(!1,'"'.concat(e,'" is not a valid page reference.'))})):"number"===typeof e?t(e):(0,i.A)(!1,'"'.concat(e,'" is not a valid destination reference.'))})).then((e=>{const s=e+1;(0,i.A)(this.pdfViewer,"PDF viewer is not initialized."),(0,i.A)(s>=1&&s<=this.pagesCount,'"'.concat(s,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({dest:t,pageIndex:e,pageNumber:s})}))}))}navigateTo(t){this.goToDestination(t)}goToPage(t){const e=t-1;(0,i.A)(this.pdfViewer,"PDF viewer is not initialized."),(0,i.A)(t>=1&&t<=this.pagesCount,'"'.concat(t,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({pageIndex:e,pageNumber:t})}addLinkAttributes(t,e,s){t.href=e,t.rel=this.externalLinkRel||"noopener noreferrer nofollow",t.target=s?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}},48599:(t,e,s)=>{"use strict";s.d(e,{A:()=>n});var i=s(65043);function n(t){let{children:e,type:s}=t;return i.createElement("div",{className:"react-pdf__message react-pdf__message--".concat(s)},e)}},10934:(t,e,s)=>{"use strict";s.d(e,{A:()=>N});var i=s(65043),n=s(65173),a=s(40645),r=s(77906),o=s(58387);function l(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var s=t.filter(Boolean);return s.length<=1?s[0]||null:function(t){s.forEach((function(e){"function"===typeof e?e(t):e&&(e.current=t)}))}}var c=s(3404),d=s(96440);const h=(0,i.createContext)(null);var u=s(48599),p=s(72809);const f={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},g=/^H(\d+)$/;function v(t){return"children"in t}function _(t){return!!v(t)&&(1===t.children.length&&0 in t.children&&"id"in t.children[0])}function m(t){const e={};if(v(t)){const{role:s}=t,i=s.match(g);if(i)e.role="heading",e["aria-level"]=Number(i[1]);else if(function(t){return t in f}(s)){const t=f[s];t&&(e.role=t)}}return e}function b(t){const e={};if(v(t)){if(void 0!==t.alt&&(e["aria-label"]=t.alt),void 0!==t.lang&&(e.lang=t.lang),_(t)){const[s]=t.children;if(s){const t=b(s);return Object.assign(Object.assign({},e),t)}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function y(t){return t?Object.assign(Object.assign({},m(t)),b(t)):null}function P(t){let{className:e,node:s}=t;const n=(0,i.useMemo)((()=>y(s)),[s]),a=(0,i.useMemo)((()=>v(s)?_(s)?null:s.children.map(((t,e)=>i.createElement(P,{key:e,node:t}))):null),[s]);return i.createElement("span",Object.assign({className:e},n),a)}function A(){return(0,i.useContext)(h)}var S=s(28234),F=s(20665);function w(){const t=A();(0,c.A)(t,"Unable to find Page context.");const{onGetStructTreeError:e,onGetStructTreeSuccess:s}=t,[n,r]=(0,S.A)(),{value:o,error:l}=n,{customTextRenderer:h,page:u}=t;return(0,i.useEffect)((function(){r({type:"RESET"})}),[r,u]),(0,i.useEffect)((function(){if(h)return;if(!u)return;const t=(0,a.A)(u.getStructTree()),e=t;return t.promise.then((t=>{r({type:"RESOLVE",value:t})})).catch((t=>{r({type:"REJECT",error:t})})),()=>(0,F.xL)(e)}),[h,u,r]),(0,i.useEffect)((()=>{void 0!==o&&(!1!==o?o&&s&&s(o):l&&(d(!1,l.toString()),e&&e(l)))}),[o]),o?i.createElement(P,{className:"react-pdf__Page__structTree structTree",node:o}):null}const x=p.A.AnnotationMode;function C(t){const e=A();(0,c.A)(e,"Unable to find Page context.");const s=Object.assign(Object.assign({},e),t),{_className:n,canvasBackground:a,devicePixelRatio:r=(0,F.mZ)(),onRenderError:o,onRenderSuccess:h,page:u,renderForms:p,renderTextLayer:f,rotate:g,scale:v}=s,{canvasRef:_}=t;(0,c.A)(u,"Attempted to render page canvas, but no page was specified.");const m=(0,i.useRef)(null);function b(t){(0,F.UT)(t)||(d(!1,t.toString()),o&&o(t))}const y=(0,i.useMemo)((()=>u.getViewport({scale:v*r,rotation:g})),[r,u,g,v]),P=(0,i.useMemo)((()=>u.getViewport({scale:v,rotation:g})),[u,g,v]);(0,i.useEffect)((function(){if(!u)return;u.cleanup();const{current:t}=m;if(!t)return;t.width=y.width,t.height=y.height,t.style.width="".concat(Math.floor(P.width),"px"),t.style.height="".concat(Math.floor(P.height),"px"),t.style.visibility="hidden";const e={annotationMode:p?x.ENABLE_FORMS:x.ENABLE,canvasContext:t.getContext("2d",{alpha:!1}),viewport:y};a&&(e.background=a);const s=u.render(e),i=s;return s.promise.then((()=>{t.style.visibility="",u&&h&&h((0,F.vS)(u,v))})).catch(b),()=>(0,F.xL)(i)}),[a,m,r,u,p,y,P]);const S=(0,i.useCallback)((()=>{const{current:t}=m;t&&(t.width=0,t.height=0)}),[m]);return(0,i.useEffect)((()=>S),[S]),i.createElement("canvas",{className:"".concat(n,"__canvas"),dir:"ltr",ref:l(_,m),style:{display:"block",userSelect:"none"}},f?i.createElement(w,null):null)}function E(){const t=A();(0,c.A)(t,"Unable to find Page context.");const{_className:e,onRenderSuccess:s,onRenderError:n,page:r,rotate:o,scale:l}=t;(0,c.A)(r,"Attempted to render page SVG, but no page was specified.");const[h,u]=(0,S.A)(),{value:f,error:g}=h;const v=(0,i.useMemo)((()=>r.getViewport({scale:l,rotation:o})),[r,o,l]);(0,i.useEffect)((function(){u({type:"RESET"})}),[r,u,v]),(0,i.useEffect)((function(){if(!r)return;const t=(0,a.A)(r.getOperatorList());return t.promise.then((t=>{new p.A.SVGGraphics(r.commonObjs,r.objs).getSVG(t,v).then((t=>{if(!(t instanceof SVGElement))throw new Error("getSVG returned unexpected result.");u({type:"RESOLVE",value:t})})).catch((t=>{u({type:"REJECT",error:t})}))})).catch((t=>{u({type:"REJECT",error:t})})),()=>(0,F.xL)(t)}),[r,u,v]),(0,i.useEffect)((()=>{void 0!==f&&(!1!==f?r&&s&&s((0,F.vS)(r,l)):g&&((0,F.UT)(g)||(d(!1,g.toString()),n&&n(g))))}),[f]);const{width:_,height:m}=v;return i.createElement("div",{className:"".concat(e,"__svg"),ref:t=>function(t){if(!t||!f)return;t.firstElementChild||t.appendChild(f);const{width:e,height:s}=v;f.setAttribute("width","".concat(e)),f.setAttribute("height","".concat(s))}(t),style:{display:"block",backgroundColor:"white",overflow:"hidden",width:_,height:m,userSelect:"none"}})}function k(){const t=A();(0,c.A)(t,"Unable to find Page context.");const{customTextRenderer:e,onGetTextError:s,onGetTextSuccess:n,onRenderTextLayerError:r,onRenderTextLayerSuccess:l,page:h,pageIndex:u,pageNumber:f,rotate:g,scale:v}=t;(0,c.A)(h,"Attempted to load page text content, but no page was specified.");const[_,m]=(0,S.A)(),{value:b,error:y}=_,P=(0,i.useRef)(null),w=(0,i.useRef)();d(1===parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10),"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer"),(0,i.useEffect)((function(){m({type:"RESET"})}),[h,m]),(0,i.useEffect)((function(){if(!h)return;const t=(0,a.A)(h.getTextContent()),e=t;return t.promise.then((t=>{m({type:"RESOLVE",value:t})})).catch((t=>{m({type:"REJECT",error:t})})),()=>(0,F.xL)(e)}),[h,m]),(0,i.useEffect)((()=>{void 0!==b&&(!1!==b?b&&n&&n(b):y&&(d(!1,y.toString()),s&&s(y)))}),[b]);const x=(0,i.useCallback)((()=>{l&&l()}),[l]),C=(0,i.useCallback)((t=>{d(!1,t.toString()),r&&r(t)}),[r]);const E=(0,i.useMemo)((()=>h.getViewport({scale:v,rotation:g})),[h,g,v]);return(0,i.useLayoutEffect)((function(){if(!h||!b)return;const{current:t}=P;if(!t)return;t.innerHTML="";const s=h.streamTextContent({includeMarkedContent:!0}),i={container:t,textContentSource:s,viewport:E},n=p.A.renderTextLayer(i),a=n;return n.promise.then((()=>{const s=document.createElement("div");s.className="endOfContent",t.append(s),w.current=s;const i=t.querySelectorAll('[role="presentation"]');if(e){let t=0;b.items.forEach(((s,n)=>{if(!function(t){return"str"in t}(s))return;const a=i[t];if(!a)return;const r=e(Object.assign({pageIndex:u,pageNumber:f,itemIndex:n},s));a.innerHTML=r,t+=s.str&&s.hasEOL?2:1}))}x()})).catch(C),()=>(0,F.xL)(a)}),[e,C,x,h,u,f,b,E]),i.createElement("div",{className:(0,o.A)("react-pdf__Page__textContent","textLayer"),onMouseUp:function(){const t=w.current;t&&t.classList.remove("active")},onMouseDown:function(){const t=w.current;t&&t.classList.add("active")},ref:P})}var T=s(16512);function M(){return(0,i.useContext)(T.A)}function R(){const t=M(),e=A();(0,c.A)(e,"Unable to find Page context.");const s=Object.assign(Object.assign({},t),e),{imageResourcesPath:n,linkService:r,onGetAnnotationsError:l,onGetAnnotationsSuccess:h,onRenderAnnotationLayerError:u,onRenderAnnotationLayerSuccess:f,page:g,pdf:v,renderForms:_,rotate:m,scale:b=1}=s;(0,c.A)(v,"Attempted to load page annotations, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop."),(0,c.A)(g,"Attempted to load page annotations, but no page was specified."),(0,c.A)(r,"Attempted to load page annotations, but no linkService was specified.");const[y,P]=(0,S.A)(),{value:w,error:x}=y,C=(0,i.useRef)(null);d(1===parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10),"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations"),(0,i.useEffect)((function(){P({type:"RESET"})}),[P,g]),(0,i.useEffect)((function(){if(!g)return;const t=(0,a.A)(g.getAnnotations()),e=t;return t.promise.then((t=>{P({type:"RESOLVE",value:t})})).catch((t=>{P({type:"REJECT",error:t})})),()=>{(0,F.xL)(e)}}),[P,g,_]),(0,i.useEffect)((()=>{void 0!==w&&(!1!==w?w&&h&&h(w):x&&(d(!1,x.toString()),l&&l(x)))}),[w]);const E=(0,i.useMemo)((()=>g.getViewport({scale:b,rotation:m})),[g,m,b]);return(0,i.useEffect)((function(){if(!v||!g||!r||!w)return;const{current:t}=C;if(!t)return;const e=E.clone({dontFlip:!0}),s={accessibilityManager:null,annotationCanvasMap:null,div:t,l10n:null,page:g,viewport:e},i={annotations:w,annotationStorage:v.annotationStorage,div:t,downloadManager:null,imageResourcesPath:n,linkService:r,page:g,renderForms:_,viewport:e};t.innerHTML="";try{new p.A.AnnotationLayer(s).render(i),f&&f()}catch(a){!function(t){d(!1,"".concat(t)),u&&u(t)}(a)}return()=>{}}),[w,n,r,g,_,E]),i.createElement("div",{className:(0,o.A)("react-pdf__Page__annotations","annotationLayer"),ref:C})}var I=s(88242),D=function(t,e){var s={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(s[i[n]]=t[i[n]])}return s};const O=1,L=function(t){const e=M(),s=Object.assign(Object.assign({},e),t),{_className:n="react-pdf__Page",_enableRegisterUnregisterPage:p=!0,canvasBackground:f,canvasRef:g,children:v,className:_,customRenderer:m,customTextRenderer:b,devicePixelRatio:y,error:P="Failed to load the page.",height:A,inputRef:w,loading:x="Loading page\u2026",noData:T="No page specified.",onGetAnnotationsError:I,onGetAnnotationsSuccess:L,onGetStructTreeError:G,onGetStructTreeSuccess:N,onGetTextError:B,onGetTextSuccess:j,onLoadError:W,onLoadSuccess:U,onRenderAnnotationLayerError:z,onRenderAnnotationLayerSuccess:q,onRenderError:H,onRenderSuccess:V,onRenderTextLayerError:X,onRenderTextLayerSuccess:K,pageIndex:Y,pageNumber:J,pdf:Q,registerPage:Z,renderAnnotationLayer:$=!0,renderForms:tt=!1,renderMode:et="canvas",renderTextLayer:st=!0,rotate:it,scale:nt=O,unregisterPage:at,width:rt}=s,ot=D(s,["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customRenderer","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"]),[lt,ct]=(0,S.A)(),{value:dt,error:ht}=lt,ut=(0,i.useRef)(null);(0,c.A)(Q,"Attempted to load a page, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop.");const pt=(0,F.ci)(J)?J-1:null!==Y&&void 0!==Y?Y:null,ft=null!==J&&void 0!==J?J:(0,F.ci)(Y)?Y+1:null,gt=null!==it&&void 0!==it?it:dt?dt.rotate:null,vt=(0,i.useMemo)((()=>{if(!dt)return null;let t=1;const e=null!==nt&&void 0!==nt?nt:O;if(rt||A){const e=dt.getViewport({scale:1,rotation:gt});rt?t=rt/e.width:A&&(t=A/e.height)}return e*t}),[A,dt,gt,nt,rt]);(0,i.useEffect)((function(){return()=>{(0,F.ci)(pt)&&p&&at&&at(pt)}}),[p,Q,pt,at]),(0,i.useEffect)((function(){ct({type:"RESET"})}),[ct,Q,pt]),(0,i.useEffect)((function(){if(!Q||!ft)return;const t=(0,a.A)(Q.getPage(ft)),e=t;return t.promise.then((t=>{ct({type:"RESOLVE",value:t})})).catch((t=>{ct({type:"REJECT",error:t})})),()=>(0,F.xL)(e)}),[ct,Q,pt,ft,Z]),(0,i.useEffect)((()=>{void 0!==dt&&(!1!==dt?function(){if(U){if(!dt||!vt)return;U((0,F.vS)(dt,vt))}if(p&&Z){if(!(0,F.ci)(pt)||!ut.current)return;Z(pt,ut.current)}}():ht&&(d(!1,ht.toString()),W&&W(ht)))}),[dt,vt]);const _t=(0,i.useMemo)((()=>dt&&(0,F.ci)(pt)&&ft&&(0,F.ci)(gt)&&(0,F.ci)(vt)?{_className:n,canvasBackground:f,customTextRenderer:b,devicePixelRatio:y,onGetAnnotationsError:I,onGetAnnotationsSuccess:L,onGetStructTreeError:G,onGetStructTreeSuccess:N,onGetTextError:B,onGetTextSuccess:j,onRenderAnnotationLayerError:z,onRenderAnnotationLayerSuccess:q,onRenderError:H,onRenderSuccess:V,onRenderTextLayerError:X,onRenderTextLayerSuccess:K,page:dt,pageIndex:pt,pageNumber:ft,renderForms:tt,renderTextLayer:st,rotate:gt,scale:vt}:null),[n,f,b,y,I,L,G,N,B,j,z,q,H,V,X,K,dt,pt,ft,tt,st,gt,vt]),mt=(0,i.useMemo)((()=>(0,r.Ay)(ot,(()=>dt?vt?(0,F.vS)(dt,vt):void 0:dt))),[ot,dt,vt]),bt="".concat(pt,"@").concat(vt,"/").concat(gt),yt="".concat(pt,"/").concat(gt);function Pt(){return i.createElement(h.Provider,{value:_t},function(){switch(et){case"custom":return(0,c.A)(m,'renderMode was set to "custom", but no customRenderer was passed.'),i.createElement(m,{key:"".concat(bt,"_custom")});case"none":return null;case"svg":return i.createElement(E,{key:"".concat(yt,"_svg")});default:return i.createElement(C,{key:"".concat(bt,"_canvas"),canvasRef:g})}}(),st?i.createElement(k,{key:"".concat(bt,"_text")}):null,$?i.createElement(R,{key:"".concat(bt,"_annotations")}):null,v)}return i.createElement("div",Object.assign({className:(0,o.A)(n,_),"data-page-number":ft,ref:l(w,ut),style:{"--scale-factor":"".concat(vt),backgroundColor:f||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},mt),ft?null===Q||void 0===dt||null===dt?i.createElement(u.A,{type:"loading"},"function"===typeof x?x():x):!1===Q||!1===dt?i.createElement(u.A,{type:"error"},"function"===typeof P?P():P):Pt():i.createElement(u.A,{type:"no-data"},"function"===typeof T?T():T))},G=n.oneOfType([n.func,n.node]);L.propTypes=Object.assign(Object.assign({},I.zq),{canvasBackground:n.string,canvasRef:I.i9,children:n.node,className:I.uG,customRenderer:n.func,customTextRenderer:n.func,devicePixelRatio:n.number,error:G,height:n.number,imageResourcesPath:n.string,inputRef:I.i9,loading:G,noData:G,onGetTextError:n.func,onGetTextSuccess:n.func,onLoadError:n.func,onLoadSuccess:n.func,onRenderError:n.func,onRenderSuccess:n.func,onRenderTextLayerError:n.func,onRenderTextLayerSuccess:n.func,pageIndex:I.kg,pageNumber:I.X8,pdf:I.tk,renderAnnotationLayer:n.bool,renderForms:n.bool,renderMode:I.Ao,renderTextLayer:n.bool,rotate:I.KN,scale:n.number,width:n.number});const N=L},72809:(t,e,s)=>{"use strict";s.d(e,{A:()=>n});var i=s(46749);const n=i},28234:(t,e,s)=>{"use strict";s.d(e,{A:()=>a});var i=s(65043);function n(t,e){switch(e.type){case"RESOLVE":return{value:e.value,error:void 0};case"REJECT":return{value:!1,error:e.error};case"RESET":return{value:void 0,error:void 0};default:return t}}function a(){return(0,i.useReducer)(n,{value:void 0,error:void 0})}},88242:(t,e,s)=>{"use strict";s.d(e,{Ao:()=>m,KN:()=>b,X8:()=>g,fo:()=>p,i9:()=>_,kg:()=>f,tk:()=>v,uG:()=>u,zq:()=>c});var i=s(65173),n=s(77906),a=s(72809),r=s(20665),o=s(34899);const{PDFDataRangeTransport:l}=a.A,c=(()=>{const t={};return n.Xz.forEach((e=>{t[e]=i.func})),t})(),d=i.oneOfType([i.instanceOf(Int8Array),i.instanceOf(Uint8Array),i.instanceOf(Uint8ClampedArray),i.instanceOf(Int16Array),i.instanceOf(Uint16Array),i.instanceOf(Int32Array),i.instanceOf(Uint32Array),i.instanceOf(Float32Array),i.instanceOf(Float64Array)]),h=[i.string,i.instanceOf(ArrayBuffer),i.shape({data:i.oneOfType([i.string,i.instanceOf(ArrayBuffer),i.arrayOf(i.number.isRequired),d]).isRequired}),i.shape({range:i.instanceOf(l).isRequired}),i.shape({url:i.string.isRequired})];"undefined"!==typeof Blob&&h.push(i.instanceOf(Blob));const u=i.oneOfType([i.string,i.arrayOf(i.string)]),p=i.oneOfType(h),f=(i.instanceOf(o.A),i.oneOf(["_self","_blank","_parent","_top"]),i.shape({commonObjs:i.shape({}).isRequired,getAnnotations:i.func.isRequired,getTextContent:i.func.isRequired,getViewport:i.func.isRequired,render:i.func.isRequired}),function(t,e,s){const{[e]:i,pageNumber:n,pdf:a}=t;if(!(0,r.O9)(a))return null;if((0,r.O9)(i)){if("number"!==typeof i)return new Error("`".concat(e,"` of type `").concat(typeof i,"` supplied to `").concat(s,"`, expected `number`."));if(i<0)return new Error("Expected `".concat(e,"` to be greater or equal to 0."));const{numPages:t}=a;if(i+1>t)return new Error("Expected `".concat(e,"` to be less or equal to ").concat(t-1,"."))}else if(!(0,r.O9)(n))return new Error("`".concat(e,"` not supplied. Either pageIndex or pageNumber must be supplied to `").concat(s,"`."));return null}),g=function(t,e,s){const{[e]:i,pageIndex:n,pdf:a}=t;if(!(0,r.O9)(a))return null;if((0,r.O9)(i)){if("number"!==typeof i)return new Error("`".concat(e,"` of type `").concat(typeof i,"` supplied to `").concat(s,"`, expected `number`."));if(i<1)return new Error("Expected `".concat(e,"` to be greater or equal to 1."));const{numPages:t}=a;if(i>t)return new Error("Expected `".concat(e,"` to be less or equal to ").concat(t,"."))}else if(!(0,r.O9)(n))return new Error("`".concat(e,"` not supplied. Either pageIndex or pageNumber must be supplied to `").concat(s,"`."));return null},v=i.oneOfType([i.any,i.oneOf([!1])]),_=i.oneOfType([i.func,i.exact({current:i.any})]),m=i.oneOf(["canvas","custom","none","svg"]),b=i.oneOf([0,90,180,270])},20665:(t,e,s)=>{"use strict";s.d(e,{Bd:()=>a,O9:()=>o,UT:()=>m,ci:()=>l,h1:()=>b,jA:()=>u,mZ:()=>p,mw:()=>c,qC:()=>g,qf:()=>d,vS:()=>_,xL:()=>v,zL:()=>h});var i=s(3404),n=s(96440);const a="undefined"!==typeof document,r=a&&"file:"===window.location.protocol;function o(t){return"undefined"!==typeof t}function l(t){return o(t)&&null!==t}function c(t){return t instanceof ArrayBuffer}function d(t){return(0,i.A)(a,"isBlob can only be used in a browser environment"),t instanceof Blob}function h(t){return function(t){return"string"===typeof t}(t)&&/^data:/.test(t)}function u(t){(0,i.A)(h(t),"Invalid data URI.");const[e="",s=""]=t.split(",");return-1!==e.split(";").indexOf("base64")?atob(s):unescape(s)}function p(){return a&&window.devicePixelRatio||1}const f="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function g(){n(!r,"Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ".concat(f))}function v(t){t&&t.cancel&&t.cancel()}function _(t,e){return Object.defineProperty(t,"width",{get(){return this.view[2]*e},configurable:!0}),Object.defineProperty(t,"height",{get(){return this.view[3]*e},configurable:!0}),Object.defineProperty(t,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(t,"originalHeight",{get(){return this.view[3]},configurable:!0}),t}function m(t){return"RenderingCancelledException"===t.name}function b(t){return new Promise(((e,s)=>{const i=new FileReader;i.onload=()=>{if(!i.result)return s(new Error("Error while reading a file."));e(i.result)},i.onerror=t=>{if(!t.target)return s(new Error("Error while reading a file."));const{error:e}=t.target;if(!e)return s(new Error("Error while reading a file."));switch(e.code){case e.NOT_FOUND_ERR:return s(new Error("Error while reading a file: File not found."));case e.SECURITY_ERR:return s(new Error("Error while reading a file: Security error."));case e.ABORT_ERR:return s(new Error("Error while reading a file: Aborted."));default:return s(new Error("Error while reading a file."))}},i.readAsArrayBuffer(t)}))}}}]); 3 //# sourceMappingURL=8144.0cc85475.chunk.js.map