@tempo-ai/mcp 0.0.143-staging.1 → 0.0.144

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{createRequire as t}from"node:module";t(import.meta.url);import"./chunk-NCFWHGWN.js";void 0===globalThis.DOMMatrix&&(globalThis.DOMMatrix=class{}),void 0===globalThis.FinalizationRegistry&&(globalThis.FinalizationRegistry=class{register(){}unregister(){}}),globalThis.navigator??={},globalThis.navigator.platform??="",globalThis.navigator.userAgent??="",void 0===Promise.withResolvers&&(Promise.withResolvers=function(){let t,e;return{promise:new Promise((s,i)=>{t=s,e=i}),resolve:t,reject:e}});var e=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),s=[.001,0,0,.001,0,0],i=1.35,n=.35,a=.25925925925925924,r=1,o=2,l=4,c=8,h=16,u=64,d=128,f=256,g="pdfjs_internal_editor_",p=3,m=9,b=13,w=15,y=101,x={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},v=0,A=4,k=1,S=2,C=3,_={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},I="Group",T="R",M=1,E=2,F=4,D=16,R=32,B=128,P=512,N=1,O=2,L=4096,U=8192,$=32768,H=65536,j=131072,q=1048576,z=2097152,G=8388608,W=16777216,V=1,X=2,K=3,Y=4,J=5,Z={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"},Q={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},tt={O:"PageOpen",C:"PageClose"},et=1,st=5,it=1,nt=2,at=3,rt=4,ot=5,lt=6,ct=7,ht=8,ut=9,dt=10,ft=11,gt=12,pt=13,mt=14,bt=15,wt=16,yt=17,xt=18,vt=19,At=20,kt=21,St=22,Ct=23,_t=24,It=25,Tt=26,Mt=27,Et=28,Ft=29,Dt=30,Rt=31,Bt=32,Pt=33,Nt=34,Ot=35,Lt=36,Ut=37,$t=38,Ht=39,jt=40,qt=41,zt=42,Gt=43,Wt=44,Vt=45,Xt=46,Kt=47,Yt=48,Jt=49,Zt=50,Qt=51,te=52,ee=53,se=54,ie=55,ne=56,ae=57,re=58,oe=59,le=60,ce=61,he=62,ue=63,de=64,fe=65,ge=66,pe=67,me=68,be=69,we=70,ye=71,xe=72,ve=73,Ae=74,ke=75,Se=76,Ce=77,_e=80,Ie=81,Te=83,Me=84,Ee=85,Fe=86,De=87,Re=88,Be=89,Pe=90,Ne=91,Oe=92,Le=93,Ue=94,$e=0,He=1,je=2,qe=3,ze=1,Ge=2,We=et;function info$1(t){We>=st&&console.info(`Info: ${t}`)}function warn$1(t){We>=et&&console.warn(`Warning: ${t}`)}function unreachable$1(t){throw new Error(t)}function assert$1(t,e){t||unreachable$1(e)}function createValidAbsoluteUrl$1(t,e=null,s=null){if(!t)return null;if(s&&"string"==typeof t){if(s.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);e?.length>=2&&(t=`http://${t}`)}if(s.tryConvertEncoding)try{t=stringToUTF8String$1(t)}catch{}}const i=e?URL.parse(t,e):URL.parse(t);return function(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(i)?i:null}function shadow$1(t,e,s,i=!1){return Object.defineProperty(t,e,{value:s,enumerable:!i,configurable:!0,writable:!1}),s}var Ve=function(){function BaseException(t,e){this.message=t,this.name=e}return BaseException.prototype=new Error,BaseException.constructor=BaseException,BaseException}(),Xe=class extends Ve{constructor(t,e){super(t,"PasswordException"),this.code=e}},Ke=class extends Ve{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}},Ye=class extends Ve{constructor(t){super(t,"InvalidPDFException")}},Je=class extends Ve{constructor(t,e,s){super(t,"ResponseException"),this.status=e,this.missing=s}},Ze=class extends Ve{constructor(t){super(t,"FormatError")}},Qe=class extends Ve{constructor(t){super(t,"AbortException")}};function bytesToString$1(t){"object"==typeof t&&void 0!==t?.length||unreachable$1("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 stringToBytes$1(t){"string"!=typeof t&&unreachable$1("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}function string32$1(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)}function objectSize(t){return Object.keys(t).length}var ts=class{static get isLittleEndian(){return shadow$1(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return shadow$1(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return shadow$1(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get isImageDecoderSupported(){return shadow$1(this,"isImageDecoderSupported","undefined"!=typeof ImageDecoder)}static get platform(){const{platform:t,userAgent:e}=navigator;return shadow$1(this,"platform",{isAndroid:e.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:e.includes("Firefox")})}static get isCSSRoundSupported(){return shadow$1(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}},es=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0")),ss=class{static makeHexColor(t,e,s){return`#${es[t]}${es[e]}${es[s]}`}static domMatrixToTransform(t){return[t.a,t.b,t.c,t.d,t.e,t.f]}static scaleMinMax(t,e){let s;t[0]?(t[0]<0&&(s=e[0],e[0]=e[2],e[2]=s),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(s=e[1],e[1]=e[3],e[3]=s),e[1]*=t[3],e[3]*=t[3]):(s=e[0],e[0]=e[1],e[1]=s,s=e[2],e[2]=e[3],e[3]=s,t[1]<0&&(s=e[1],e[1]=e[3],e[3]=s),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(s=e[0],e[0]=e[2],e[2]=s),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],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 multiplyByDOMMatrix(t,e){return[t[0]*e.a+t[2]*e.b,t[1]*e.a+t[3]*e.b,t[0]*e.c+t[2]*e.d,t[1]*e.c+t[3]*e.d,t[0]*e.e+t[2]*e.f+t[4],t[1]*e.e+t[3]*e.f+t[5]]}static applyTransform(t,e,s=0){const i=t[s],n=t[s+1];t[s]=i*e[0]+n*e[2]+e[4],t[s+1]=i*e[1]+n*e[3]+e[5]}static applyTransformToBezier(t,e,s=0){const i=e[0],n=e[1],a=e[2],r=e[3],o=e[4],l=e[5];for(let e=0;e<6;e+=2){const c=t[s+e],h=t[s+e+1];t[s+e]=c*i+h*a+o,t[s+e+1]=c*n+h*r+l}}static applyInverseTransform(t,e){const s=t[0],i=t[1],n=e[0]*e[3]-e[1]*e[2];t[0]=(s*e[3]-i*e[2]+e[2]*e[5]-e[4]*e[3])/n,t[1]=(-s*e[1]+i*e[0]+e[4]*e[1]-e[5]*e[0])/n}static axialAlignedBoundingBox(t,e,s){const i=e[0],n=e[1],a=e[2],r=e[3],o=e[4],l=e[5],c=t[0],h=t[1],u=t[2],d=t[3];let f=i*c+o,g=f,p=i*u+o,m=p,b=r*h+l,w=b,y=r*d+l,x=y;if(0!==n||0!==a){const t=n*c,e=n*u,s=a*h,i=a*d;f+=s,m+=s,p+=i,g+=i,b+=t,x+=t,y+=e,w+=e}s[0]=Math.min(s[0],f,p,g,m),s[1]=Math.min(s[1],b,y,w,x),s[2]=Math.max(s[2],f,p,g,m),s[3]=Math.max(s[3],b,y,w,x)}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,e){const s=t[0],i=t[1],n=t[2],a=t[3],r=s**2+i**2,o=s*n+i*a,l=n**2+a**2,c=(r+l)/2,h=Math.sqrt(c**2-(r*l-o**2));e[0]=Math.sqrt(c+h||1),e[1]=Math.sqrt(c-h||1)}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 pointBoundingBox(t,e,s){s[0]=Math.min(s[0],t),s[1]=Math.min(s[1],e),s[2]=Math.max(s[2],t),s[3]=Math.max(s[3],e)}static rectBoundingBox(t,e,s,i,n){n[0]=Math.min(n[0],t,s),n[1]=Math.min(n[1],e,i),n[2]=Math.max(n[2],t,s),n[3]=Math.max(n[3],e,i)}static#t(t,e,s,i,n,a,r,o,l,c){if(l<=0||l>=1)return;const h=1-l,u=l*l,d=u*l,f=h*(h*(h*t+3*l*e)+3*u*s)+d*i,g=h*(h*(h*n+3*l*a)+3*u*r)+d*o;c[0]=Math.min(c[0],f),c[1]=Math.min(c[1],g),c[2]=Math.max(c[2],f),c[3]=Math.max(c[3],g)}static#e(t,e,s,i,n,a,r,o,l,c,h,u){if(Math.abs(l)<1e-12)return void(Math.abs(c)>=1e-12&&this.#t(t,e,s,i,n,a,r,o,-h/c,u));const d=c**2-4*h*l;if(d<0)return;const f=Math.sqrt(d),g=2*l;this.#t(t,e,s,i,n,a,r,o,(-c+f)/g,u),this.#t(t,e,s,i,n,a,r,o,(-c-f)/g,u)}static bezierBoundingBox(t,e,s,i,n,a,r,o,l){l[0]=Math.min(l[0],t,r),l[1]=Math.min(l[1],e,o),l[2]=Math.max(l[2],t,r),l[3]=Math.max(l[3],e,o),this.#e(t,s,n,r,e,i,a,o,3*(3*(s-n)-t+r),6*(t-2*s+n),3*(s-t),l),this.#e(t,s,n,r,e,i,a,o,3*(3*(i-a)-e+o),6*(e-2*i+a),3*(i-e),l)}},is=[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 stringToPDFString(t,e=!1){if(t[0]>="ï"){let s;if("þ"===t[0]&&"ÿ"===t[1]?(s="utf-16be",t.length%2==1&&(t=t.slice(0,-1))):"ÿ"===t[0]&&"þ"===t[1]?(s="utf-16le",t.length%2==1&&(t=t.slice(0,-1))):"ï"===t[0]&&"»"===t[1]&&"¿"===t[2]&&(s="utf-8"),s)try{const i=new TextDecoder(s,{fatal:!0}),n=stringToBytes$1(t),a=i.decode(n);return e||!a.includes("")?a:a.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g,"")}catch(t){warn$1(`stringToPDFString: "${t}".`)}}const s=[];for(let i=0,n=t.length;i<n;i++){const a=t.charCodeAt(i);if(!e&&27===a){for(;++i<n&&27!==t.charCodeAt(i););continue}const r=is[a];s.push(r?String.fromCharCode(r):t.charAt(i))}return s.join("")}function stringToUTF8String$1(t){return decodeURIComponent(escape(t))}function utf8StringToString(t){return unescape(encodeURIComponent(t))}function isArrayEqual(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}function getModificationDate(t=new Date){return t instanceof Date||(t=new Date(t)),[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("")}var ns=null,as=null;function MathClamp$1(t,e,s){return Math.min(Math.max(t,e),s)}function toHexUtil(t){return Uint8Array.prototype.toHex?t.toHex():Array.from(t,t=>es[t]).join("")}"function"!=typeof Promise.try&&(Promise.try=function(t,...e){return new Promise(s=>{s(t(...e))})}),"function"!=typeof Math.sumPrecise&&(Math.sumPrecise=function(t){return t.reduce((t,e)=>t+e,0)});var rs=Symbol("CIRCULAR_REF"),os=Symbol("EOF"),ls=Object.create(null),cs=Object.create(null),hs=Object.create(null),us=class _Name{constructor(t){this.name=t}static get(t){return cs[t]||=new _Name(t)}},ds=class _Cmd{constructor(t){this.cmd=t}static get(t){return ls[t]||=new _Cmd(t)}},nonSerializable=function(){return nonSerializable},fs=class _Dict{constructor(t=null){this._map=new Map,this.xref=t,this.objId=null,this.suppressEncryption=!1,this.__nonSerializable__=nonSerializable}assignXref(t){this.xref=t}get size(){return this._map.size}get(t,e,s){let i=this._map.get(t);return void 0===i&&void 0!==e&&(i=this._map.get(e),void 0===i&&void 0!==s&&(i=this._map.get(s))),i instanceof gs&&this.xref?this.xref.fetch(i,this.suppressEncryption):i}async getAsync(t,e,s){let i=this._map.get(t);return void 0===i&&void 0!==e&&(i=this._map.get(e),void 0===i&&void 0!==s&&(i=this._map.get(s))),i instanceof gs&&this.xref?this.xref.fetchAsync(i,this.suppressEncryption):i}getArray(t,e,s){let i=this._map.get(t);if(void 0===i&&void 0!==e&&(i=this._map.get(e),void 0===i&&void 0!==s&&(i=this._map.get(s))),i instanceof gs&&this.xref&&(i=this.xref.fetch(i,this.suppressEncryption)),Array.isArray(i)){i=i.slice();for(let t=0,e=i.length;t<e;t++)i[t]instanceof gs&&this.xref&&(i[t]=this.xref.fetch(i[t],this.suppressEncryption))}return i}getRaw(t){return this._map.get(t)}getKeys(){return[...this._map.keys()]}getRawValues(){return[...this._map.values()]}set(t,e){this._map.set(t,e)}setIfNotExists(t,e){this.has(t)||this.set(t,e)}setIfNumber(t,e){"number"==typeof e&&this.set(t,e)}setIfArray(t,e){(Array.isArray(e)||ArrayBuffer.isView(e))&&this.set(t,e)}setIfDefined(t,e){null!=e&&this.set(t,e)}setIfName(t,e){"string"==typeof e?this.set(t,us.get(e)):e instanceof us&&this.set(t,e)}has(t){return this._map.has(t)}*[Symbol.iterator](){for(const[t,e]of this._map)yield[t,e instanceof gs&&this.xref?this.xref.fetch(e,this.suppressEncryption):e]}static get empty(){const t=new _Dict(null);return t.set=(t,e)=>{unreachable$1("Should not call `set` on the empty dictionary.")},shadow$1(this,"empty",t)}static merge({xref:t,dictArray:e,mergeSubDicts:s=!1}){const i=new _Dict(t),n=new Map;for(const t of e)if(t instanceof _Dict)for(const[e,i]of t._map){let t=n.get(e);if(void 0===t)t=[],n.set(e,t);else if(!(s&&i instanceof _Dict))continue;t.push(i)}for(const[e,s]of n){if(1===s.length||!(s[0]instanceof _Dict)){i._map.set(e,s[0]);continue}const n=new _Dict(t);for(const t of s)for(const[e,s]of t._map)n._map.has(e)||n._map.set(e,s);n.size>0&&i._map.set(e,n)}return n.clear(),i.size>0?i:_Dict.empty}clone(){const t=new _Dict(this.xref);for(const e of this.getKeys())t.set(e,this.getRaw(e));return t}delete(t){this._map.delete(t)}},gs=class _Ref{constructor(t,e){this.num=t,this.gen=e}toString(){return 0===this.gen?`${this.num}R`:`${this.num}R${this.gen}`}static fromString(t){const e=hs[t];if(e)return e;const s=/^(\d+)R(\d*)$/.exec(t);return s&&"0"!==s[1]?hs[t]=new _Ref(parseInt(s[1]),s[2]?parseInt(s[2]):0):null}static get(t,e){const s=0===e?`${t}R`:`${t}R${e}`;return hs[s]||=new _Ref(t,e)}},ps=class{constructor(t=null){this._set=new Set(t?._set)}has(t){return this._set.has(t.toString())}put(t){this._set.add(t.toString())}remove(t){this._set.delete(t.toString())}[Symbol.iterator](){return this._set.values()}clear(){this._set.clear()}},ms=class{constructor(){this._map=new Map}get size(){return this._map.size}get(t){return this._map.get(t.toString())}has(t){return this._map.has(t.toString())}put(t,e){this._map.set(t.toString(),e)}putAlias(t,e){this._map.set(t.toString(),this.get(e))}[Symbol.iterator](){return this._map.values()}clear(){this._map.clear()}*values(){yield*this._map.values()}*items(){for(const[t,e]of this._map)yield[gs.fromString(t),e]}};function isName(t,e){return t instanceof us&&(void 0===e||t.name===e)}function isCmd(t,e){return t instanceof ds&&(void 0===e||t.cmd===e)}function isDict(t,e){return t instanceof fs&&(void 0===e||isName(t.get("Type"),e))}function isRefsEqual(t,e){return t.num===e.num&&t.gen===e.gen}var bs=class{get length(){unreachable$1("Abstract getter `length` accessed")}get isEmpty(){unreachable$1("Abstract getter `isEmpty` accessed")}get isDataLoaded(){return shadow$1(this,"isDataLoaded",!0)}getByte(){unreachable$1("Abstract method `getByte` called")}getBytes(t){unreachable$1("Abstract method `getBytes` called")}async getImageData(t,e){return this.getBytes(t,e)}async asyncGetBytes(){unreachable$1("Abstract method `asyncGetBytes` called")}get isAsync(){return!1}get isAsyncDecoder(){return!1}get canAsyncDecodeImageFromBuffer(){return!1}async getTransferableImage(){return null}peekByte(){const t=this.getByte();return-1!==t&&this.pos--,t}peekBytes(t){const e=this.getBytes(t);return this.pos-=e.length,e}getUint16(){const t=this.getByte(),e=this.getByte();return-1===t||-1===e?-1:(t<<8)+e}getInt32(){return(this.getByte()<<24)+(this.getByte()<<16)+(this.getByte()<<8)+this.getByte()}getByteRange(t,e){unreachable$1("Abstract method `getByteRange` called")}getString(t){return bytesToString$1(this.getBytes(t))}skip(t){this.pos+=t||1}reset(){unreachable$1("Abstract method `reset` called")}moveStart(){unreachable$1("Abstract method `moveStart` called")}makeSubStream(t,e,s=null){unreachable$1("Abstract method `makeSubStream` called")}getBaseStreams(){return null}},ws=/^[1-9]\.\d$/,ys=2**31-1,xs=[1,0,0,1,0,0],vs=["ColorSpace","ExtGState","Font","Pattern","Properties","Shading","XObject"],As=["ExtGState","Font","Properties","XObject"];function getLookupTableFactory(t){let e;return function(){return t&&(e=Object.create(null),t(e),t=null),e}}var ks=class extends Ve{constructor(t,e){super(`Missing data [${t}, ${e})`,"MissingDataException"),this.begin=t,this.end=e}},Ss=class extends Ve{constructor(t){super(t,"ParserEOFException")}},Cs=class extends Ve{constructor(t){super(t,"XRefEntryException")}},_s=class extends Ve{constructor(t){super(t,"XRefParseException")}};function arrayBuffersToBytes(t){const e=t.length;if(0===e)return new Uint8Array(0);if(1===e)return new Uint8Array(t[0]);let s=0;for(let i=0;i<e;i++)s+=t[i].byteLength;const i=new Uint8Array(s);let n=0;for(let s=0;s<e;s++){const e=new Uint8Array(t[s]);i.set(e,n),n+=e.byteLength}return i}async function fetchBinaryData(t){const e=await fetch(t);if(!e.ok)throw new Error(`Failed to fetch file "${t}" with "${e.statusText}".`);return new Uint8Array(await e.arrayBuffer())}function getInheritableProperty({dict:t,key:e,getArray:s=!1,stopWhenFound:i=!0}){let n;const a=new ps;for(;t instanceof fs&&(!t.objId||!a.has(t.objId));){t.objId&&a.put(t.objId);const r=s?t.getArray(e):t.get(e);if(void 0!==r){if(i)return r;(n||=[]).push(r)}t=t.get("Parent")}return n}var Is=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];function toRomanNumerals(t,e=!1){assert$1(Number.isInteger(t)&&t>0,"The number should be a positive integer.");const s="M".repeat(t/1e3|0)+Is[t%1e3/100|0]+Is[10+(t%100/10|0)]+Is[20+t%10];return e?s.toLowerCase():s}function log2(t){return t>0?Math.ceil(Math.log2(t)):0}function readInt8(t,e){return t[e]<<24>>24}function readInt16(t,e){return(t[e]<<24|t[e+1]<<16)>>16}function readUint16(t,e){return t[e]<<8|t[e+1]}function readUint32(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}function isWhiteSpace(t){return 32===t||9===t||13===t||10===t}function isNumberArray(t,e){return Array.isArray(t)?(null===e||t.length===e)&&t.every(t=>"number"==typeof t):ArrayBuffer.isView(t)&&!(t instanceof BigInt64Array||t instanceof BigUint64Array)&&(null===e||t.length===e)}function lookupMatrix(t,e){return isNumberArray(t,6)?t:e}function lookupRect(t,e){return isNumberArray(t,4)?t:e}function lookupNormalRect(t,e){return isNumberArray(t,4)?ss.normalizeRect(t):e}function parseXFAPath(t){const e=/(.+)\[(\d+)\]$/;return t.split(".").map(t=>{const s=t.match(e);return s?{name:s[1],pos:parseInt(s[2],10)}:{name:t,pos:0}})}function escapePDFName(t){const e=[];let s=0;for(let i=0,n=t.length;i<n;i++){const n=t.charCodeAt(i);(n<33||n>126||35===n||40===n||41===n||60===n||62===n||91===n||93===n||123===n||125===n||47===n||37===n)&&(s<i&&e.push(t.substring(s,i)),e.push(`#${n.toString(16)}`),s=i+1)}return 0===e.length?t:(s<t.length&&e.push(t.substring(s,t.length)),e.join(""))}function escapeString(t){return t.replaceAll(/([()\\\n\r])/g,t=>"\n"===t?"\\n":"\r"===t?"\\r":`\\${t}`)}function _collectJS(t,e,s,i){if(!t)return;let n=null;if(t instanceof gs){if(i.has(t))return;n=t,i.put(n),t=e.fetch(t)}if(Array.isArray(t))for(const n of t)_collectJS(n,e,s,i);else if(t instanceof fs){if(isName(t.get("S"),"JavaScript")){const e=t.get("JS");let i;e instanceof bs?i=e.getString():"string"==typeof e&&(i=e),i&&=stringToPDFString(i,!0).replaceAll("\0",""),i&&s.push(i.trim())}_collectJS(t.getRaw("Next"),e,s,i)}n&&i.remove(n)}function collectActions(t,e,s){const i=Object.create(null),n=getInheritableProperty({dict:e,key:"AA",stopWhenFound:!1});if(n)for(let e=n.length-1;e>=0;e--){const a=n[e];if(a instanceof fs)for(const e of a.getKeys()){const n=s[e];if(!n)continue;const r=[];_collectJS(a.getRaw(e),t,r,new ps),r.length>0&&(i[n]=r)}}if(e.has("A")){const s=[];_collectJS(e.get("A"),t,s,new ps),s.length>0&&(i.Action=s)}return objectSize(i)>0?i:null}var Ts={60:"&lt;",62:"&gt;",38:"&amp;",34:"&quot;",39:"&apos;"};function*codePointIter(t){for(let e=0,s=t.length;e<s;e++){const s=t.codePointAt(e);s>55295&&(s<57344||s>65533)&&e++,yield s}}function encodeToXmlString(t){const e=[];let s=0;for(let i=0,n=t.length;i<n;i++){const n=t.codePointAt(i);if(32<=n&&n<=126){const a=Ts[n];a&&(s<i&&e.push(t.substring(s,i)),e.push(a),s=i+1)}else s<i&&e.push(t.substring(s,i)),e.push(`&#x${n.toString(16).toUpperCase()};`),n>55295&&(n<57344||n>65533)&&i++,s=i+1}return 0===e.length?t:(s<t.length&&e.push(t.substring(s,t.length)),e.join(""))}function validateFontName(t,e=!1){const s=/^("|').*("|')$/.exec(t);if(s&&s[1]===s[2]){if(new RegExp(`[^\\\\]${s[1]}`).test(t.slice(1,-1)))return e&&warn$1(`FontFamily contains unescaped ${s[1]}: ${t}.`),!1}else for(const s of t.split(/[ \t]+/))if(/^(\d|(-(\d|-)))/.test(s)||!/^[\w-\\]+$/.test(s))return e&&warn$1(`FontFamily contains invalid <custom-ident>: ${t}.`),!1;return!0}function validateCSSFont(t){const e=new Set(["100","200","300","400","500","600","700","800","900","1000","normal","bold","bolder","lighter"]),{fontFamily:s,fontWeight:i,italicAngle:n}=t;if(!validateFontName(s,!0))return!1;const a=i?i.toString():"";t.fontWeight=e.has(a)?a:"400";const r=parseFloat(n);return t.italicAngle=isNaN(r)||r<-90||r>90?"14":n.toString(),!0}function recoverJsURL(t){const e=new RegExp("^\\s*("+["app.launchURL","window.open","xfa.host.gotoURL"].join("|").replaceAll(".","\\.")+")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))","i").exec(t);return e?.[2]?{url:e[2],newWindow:"app.launchURL"===e[1]&&"true"===e[3]}:null}function numberToString(t){if(Number.isInteger(t))return t.toString();const e=Math.round(100*t);return e%100==0?(e/100).toString():e%10==0?t.toFixed(1):t.toFixed(2)}function getNewAnnotationsMap(t){if(!t)return null;const e=new Map;for(const[s,i]of t){if(!s.startsWith(g))continue;let t=e.get(i.pageIndex);t||(t=[],e.set(i.pageIndex,t)),t.push(i)}return e.size>0?e:null}function stringToAsciiOrUTF16BE(t){return null==t||function(t){return"string"==typeof t&&(!t||/^[\x00-\x7F]*$/.test(t))}(t)?t:stringToUTF16String(t,!0)}function stringToUTF16HexString(t){const e=[];for(let s=0,i=t.length;s<i;s++){const i=t.charCodeAt(s);e.push(es[i>>8&255],es[255&i])}return e.join("")}function stringToUTF16String(t,e=!1){const s=[];e&&s.push("þÿ");for(let e=0,i=t.length;e<i;e++){const i=t.charCodeAt(e);s.push(String.fromCharCode(i>>8&255),String.fromCharCode(255&i))}return s.join("")}function getRotationMatrix(t,e,s){switch(t){case 90:return[0,1,-1,0,e,0];case 180:return[-1,0,0,-1,e,s];case 270:return[0,-1,1,0,0,s];default:throw new Error("Invalid rotation")}}function getSizeInBytes(t){return Math.ceil(Math.ceil(Math.log2(1+t))/8)}var Ms,Es=class{static#s=null;static _memory=null;static _mustAddAlpha=!1;static _destBuffer=null;static _destOffset=0;static _destLength=0;static _cssColor="";static _makeHexColor=null;static get _memoryArray(){const t=this.#s;return t?.byteLength?t:this.#s=new Uint8Array(this._memory.buffer)}},Fs="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&Fs.decode();var Ds=null;function getUint8ArrayMemory0(){return null!==Ds&&0!==Ds.byteLength||(Ds=new Uint8Array(Ms.memory.buffer)),Ds}var Rs=0;function passArray8ToWasm0(t,e){const s=e(1*t.length,1)>>>0;return getUint8ArrayMemory0().set(t,s/1),Rs=t.length,s}var Bs=Object.freeze({RGB8:0,0:"RGB8",RGBA8:1,1:"RGBA8",BGRA8:2,2:"BGRA8",Gray8:3,3:"Gray8",GrayA8:4,4:"GrayA8",CMYK:5,5:"CMYK"}),Ps=Object.freeze({Perceptual:0,0:"Perceptual",RelativeColorimetric:1,1:"RelativeColorimetric",Saturation:2,2:"Saturation",AbsoluteColorimetric:3,3:"AbsoluteColorimetric"});function __wbg_get_imports(){const t={wbg:{}};return t.wbg.__wbg_copyresult_b08ee7d273f295dd=function(t,e){!function(t,e){const{_mustAddAlpha:s,_destBuffer:i,_destOffset:n,_destLength:a,_memoryArray:r}=Es;if(e!==a)if(s)for(let s=t,a=t+e,o=n;s<a;s+=3,o+=4)i[o]=r[s],i[o+1]=r[s+1],i[o+2]=r[s+2],i[o+3]=255;else for(let s=t,a=t+e,o=n;s<a;s+=3,o+=4)i[o]=r[s],i[o+1]=r[s+1],i[o+2]=r[s+2];else i.set(r.subarray(t,t+e),n)}(t>>>0,e>>>0)},t.wbg.__wbg_copyrgb_d60ce17bb05d9b67=function(t){!function(t){const{_destBuffer:e,_destOffset:s,_memoryArray:i}=Es;e[s]=i[t],e[s+1]=i[t+1],e[s+2]=i[t+2]}(t>>>0)},t.wbg.__wbg_makecssRGB_893bf0cd9fdb302d=function(t){!function(t){const{_memoryArray:e}=Es;Es._cssColor=Es._makeHexColor(e[t],e[t+1],e[t+2])}(t>>>0)},t.wbg.__wbindgen_init_externref_table=function(){const t=Ms.__wbindgen_export_0,e=t.grow(4);t.set(0,void 0),t.set(e+0,void 0),t.set(e+1,null),t.set(e+2,!0),t.set(e+3,!1)},t.wbg.__wbindgen_throw=function(t,e){throw new Error((s=t,i=e,s>>>=0,Fs.decode(getUint8ArrayMemory0().subarray(s,s+i))));var s,i},t}function initSync(t){if(void 0!==Ms)return Ms;void 0!==t&&(Object.getPrototypeOf(t)===Object.prototype?({module:t}=t):console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const e=__wbg_get_imports();return t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t)),function(t){return Ms=t.exports,Ds=null,Ms.__wbindgen_start(),Ms}(new WebAssembly.Instance(t,e))}var Ns=class _ColorSpace{static#i=new Uint8ClampedArray(3);constructor(t,e){this.name=t,this.numComps=e}getRgb(t,e,s=new Uint8ClampedArray(3)){return this.getRgbItem(t,e,s,0),s}getRgbHex(t,e){const s=this.getRgb(t,e,_ColorSpace.#i);return ss.makeHexColor(s[0],s[1],s[2])}getRgbItem(t,e,s,i){unreachable$1("Should not call ColorSpace.getRgbItem")}getRgbBuffer(t,e,s,i,n,a,r){unreachable$1("Should not call ColorSpace.getRgbBuffer")}getOutputLength(t,e){unreachable$1("Should not call ColorSpace.getOutputLength")}isPassthrough(t){return!1}isDefaultDecode(t,e){return _ColorSpace.isDefaultDecode(t,this.numComps)}fillRgb(t,e,s,i,n,a,r,o,l){const c=e*s;let h=null;const u=1<<r,d=s!==n||e!==i;if(this.isPassthrough(r))h=o;else if(1===this.numComps&&c>u&&"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){const e=r<=8?new Uint8Array(u):new Uint16Array(u);for(let t=0;t<u;t++)e[t]=t;const s=new Uint8ClampedArray(3*u);if(this.getRgbBuffer(e,0,u,s,0,r,0),d){h=new Uint8Array(3*c);let t=0;for(let e=0;e<c;++e){const i=3*o[e];h[t++]=s[i],h[t++]=s[i+1],h[t++]=s[i+2]}}else{let e=0;for(let i=0;i<c;++i){const n=3*o[i];t[e++]=s[n],t[e++]=s[n+1],t[e++]=s[n+2],e+=l}}}else d?(h=new Uint8ClampedArray(3*c),this.getRgbBuffer(o,0,c,h,0,r,0)):this.getRgbBuffer(o,0,i*a,t,0,r,l);if(h)if(d)!function(t,e,s,i,n,a,r){r=1!==r?0:r;const o=s/n,l=i/a;let c,h=0;const u=new Uint16Array(n),d=3*s;for(let t=0;t<n;t++)u[t]=3*Math.floor(t*o);for(let s=0;s<a;s++){const i=Math.floor(s*l)*d;for(let s=0;s<n;s++)c=i+u[s],e[h++]=t[c++],e[h++]=t[c++],e[h++]=t[c++],h+=r}}(h,t,e,s,i,n,l);else{let e=0,s=0;for(let n=0,r=i*a;n<r;n++)t[e++]=h[s++],t[e++]=h[s++],t[e++]=h[s++],e+=l}}get usesZeroToOneRange(){return shadow$1(this,"usesZeroToOneRange",!0)}static isDefaultDecode(t,e){if(!Array.isArray(t))return!0;if(2*e!==t.length)return warn$1("The decode map is not the correct length"),!0;for(let e=0,s=t.length;e<s;e+=2)if(0!==t[e]||1!==t[e+1])return!1;return!0}},Os=class extends Ns{constructor(t,e,s){super("Alternate",t),this.base=e,this.tintFn=s,this.tmpBuf=new Float32Array(e.numComps)}getRgbItem(t,e,s,i){const n=this.tmpBuf;this.tintFn(t,e,n,0),this.base.getRgbItem(n,0,s,i)}getRgbBuffer(t,e,s,i,n,a,r){const o=this.tintFn,l=this.base,c=1/((1<<a)-1),h=l.numComps,u=l.usesZeroToOneRange,d=(l.isPassthrough(8)||!u)&&0===r;let f=d?n:0;const g=d?i:new Uint8ClampedArray(h*s),p=this.numComps,m=new Float32Array(p),b=new Float32Array(h);let w,y;for(w=0;w<s;w++){for(y=0;y<p;y++)m[y]=t[e++]*c;if(o(m,0,b,0),u)for(y=0;y<h;y++)g[f++]=255*b[y];else l.getRgbItem(b,0,g,f),f+=h}d||l.getRgbBuffer(g,0,s,i,n,8,r)}getOutputLength(t,e){return this.base.getOutputLength(t*this.base.numComps/this.numComps,e)}},Ls=class extends Ns{constructor(t){super("Pattern",null),this.base=t}isDefaultDecode(t,e){unreachable$1("Should not call PatternCS.isDefaultDecode")}},Us=class extends Ns{constructor(t,e,s){super("Indexed",1),this.base=t,this.highVal=e;const i=t.numComps*(e+1);if(this.lookup=new Uint8Array(i),s instanceof bs){const t=s.getBytes(i);this.lookup.set(t)}else{if("string"!=typeof s)throw new Ze(`IndexedCS - unrecognized lookup table: ${s}`);for(let t=0;t<i;++t)this.lookup[t]=255&s.charCodeAt(t)}}getRgbItem(t,e,s,i){const{base:n,highVal:a,lookup:r}=this,o=MathClamp$1(Math.round(t[e]),0,a)*n.numComps;n.getRgbBuffer(r,o,1,s,i,8,0)}getRgbBuffer(t,e,s,i,n,a,r){const{base:o,highVal:l,lookup:c}=this,{numComps:h}=o,u=o.getOutputLength(h,r);for(let a=0;a<s;++a){const s=MathClamp$1(Math.round(t[e++]),0,l)*h;o.getRgbBuffer(c,s,1,i,n,8,r),n+=u}}getOutputLength(t,e){return this.base.getOutputLength(t*this.base.numComps,e)}isDefaultDecode(t,e){return!Array.isArray(t)||(2!==t.length?(warn$1("Decode map length is not correct"),!0):!Number.isInteger(e)||e<1?(warn$1("Bits per component is not correct"),!0):0===t[0]&&t[1]===(1<<e)-1)}},$s=class extends Ns{constructor(){super("DeviceGray",1)}getRgbItem(t,e,s,i){const n=255*t[e];s[i]=s[i+1]=s[i+2]=n}getRgbBuffer(t,e,s,i,n,a,r){const o=255/((1<<a)-1);let l=e,c=n;for(let e=0;e<s;++e){const e=o*t[l++];i[c++]=e,i[c++]=e,i[c++]=e,c+=r}}getOutputLength(t,e){return t*(3+e)}},Hs=class extends Ns{constructor(){super("DeviceRGB",3)}getRgbItem(t,e,s,i){s[i]=255*t[e],s[i+1]=255*t[e+1],s[i+2]=255*t[e+2]}getRgbBuffer(t,e,s,i,n,a,r){if(8===a&&0===r)return void i.set(t.subarray(e,e+3*s),n);const o=255/((1<<a)-1);let l=e,c=n;for(let e=0;e<s;++e)i[c++]=o*t[l++],i[c++]=o*t[l++],i[c++]=o*t[l++],c+=r}getOutputLength(t,e){return t*(3+e)/3|0}isPassthrough(t){return 8===t}},js=class extends Ns{constructor(){super("DeviceRGBA",4)}getOutputLength(t,e){return 4*t}isPassthrough(t){return 8===t}fillRgb(t,e,s,i,n,a,r,o,l){s!==n||e!==i?function(t,e,s,i,n,a,r){const o=s/n,l=i/a;let c=0;const h=new Uint16Array(n);if(1===r){for(let t=0;t<n;t++)h[t]=Math.floor(t*o);const i=new Uint32Array(t.buffer),r=new Uint32Array(e.buffer),u=ts.isLittleEndian?16777215:4294967040;for(let t=0;t<a;t++){const e=i.subarray(Math.floor(t*l)*s);for(let t=0;t<n;t++)r[c++]|=e[h[t]]&u}}else{const i=4,r=s*i;for(let t=0;t<n;t++)h[t]=Math.floor(t*o)*i;for(let s=0;s<a;s++){const i=t.subarray(Math.floor(s*l)*r);for(let t=0;t<n;t++){const s=h[t];e[c++]=i[s],e[c++]=i[s+1],e[c++]=i[s+2]}}}}(o,t,e,s,i,n,l):function(t,e,s){if(1===s){const s=new Uint32Array(t.buffer),i=new Uint32Array(e.buffer),n=ts.isLittleEndian?16777215:4294967040;for(let t=0,e=s.length;t<e;t++)i[t]|=s[t]&n}else{let s=0;for(let i=0,n=t.length;i<n;i+=4)e[s++]=t[i],e[s++]=t[i+1],e[s++]=t[i+2]}}(o,t,l)}},qs=class extends Ns{constructor(){super("DeviceCMYK",4)}#n(t,e,s,i,n){const a=t[e]*s,r=t[e+1]*s,o=t[e+2]*s,l=t[e+3]*s;i[n]=255+a*(-4.387332384609988*a+54.48615194189176*r+18.82290502165302*o+212.25662451639585*l-285.2331026137004)+r*(1.7149763477362134*r-5.6096736904047315*o+-17.873870861415444*l-5.497006427196366)+o*(-2.5217340131683033*o-21.248923337353073*l+17.5119270841813)+l*(-21.86122147463605*l-189.48180835922747),i[n+1]=255+a*(8.841041422036149*a+60.118027045597366*r+6.871425592049007*o+31.159100130055922*l-79.2970844816548)+r*(-15.310361306967817*r+17.575251261109482*o+131.35250912493976*l-190.9453302588951)+o*(4.444339102852739*o+9.8632861493405*l-24.86741582555878)+l*(-20.737325471181034*l-187.80453709719578),i[n+2]=255+a*(.8842522430003296*a+8.078677503112928*r+30.89978309703729*o-.23883238689178934*l-14.183576799673286)+r*(10.49593273432072*r+63.02378494754052*o+50.606957656360734*l-112.23884253719248)+o*(.03296041114873217*o+115.60384449646641*l-193.58209356861505)+l*(-22.33816807309886*l-180.12613974708367)}getRgbItem(t,e,s,i){this.#n(t,e,1,s,i)}getRgbBuffer(t,e,s,i,n,a,r){const o=1/((1<<a)-1);for(let a=0;a<s;a++)this.#n(t,e,o,i,n),e+=4,n+=3+r}getOutputLength(t,e){return t/4*(3+e)|0}},zs=class extends Ns{constructor(t,e,s){if(super("CalGray",1),!t)throw new Ze("WhitePoint missing - required for color space CalGray");if([this.XW,this.YW,this.ZW]=t,[this.XB,this.YB,this.ZB]=e||[0,0,0],this.G=s||1,this.XW<0||this.ZW<0||1!==this.YW)throw new Ze(`Invalid WhitePoint components for ${this.name}, no fallback available`);(this.XB<0||this.YB<0||this.ZB<0)&&(info$1(`Invalid BlackPoint for ${this.name}, falling back to default.`),this.XB=this.YB=this.ZB=0),0===this.XB&&0===this.YB&&0===this.ZB||warn$1(`${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ZB: ${this.ZB}, only default values are supported.`),this.G<1&&(info$1(`Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`),this.G=1)}#n(t,e,s,i,n){const a=(t[e]*n)**this.G,r=this.YW*a,o=Math.max(295.8*r**.3333333333333333-40.8,0);s[i]=o,s[i+1]=o,s[i+2]=o}getRgbItem(t,e,s,i){this.#n(t,e,s,i,1)}getRgbBuffer(t,e,s,i,n,a,r){const o=1/((1<<a)-1);for(let a=0;a<s;++a)this.#n(t,e,i,n,o),e+=1,n+=3+r}getOutputLength(t,e){return t*(3+e)}},Gs=class _CalRGBCS extends Ns{static#a=new Float32Array([.8951,.2664,-.1614,-.7502,1.7135,.0367,.0389,-.0685,1.0296]);static#r=new Float32Array([.9869929,-.1470543,.1599627,.4323053,.5183603,.0492912,-.0085287,.0400428,.9684867]);static#o=new Float32Array([3.2404542,-1.5371385,-.4985314,-.969266,1.8760108,.041556,.0556434,-.2040259,1.0572252]);static#l=new Float32Array([1,1,1]);static#c=new Float32Array(3);static#h=new Float32Array(3);static#u=new Float32Array(3);static#d=(24/116)**3/8;constructor(t,e,s,i){if(super("CalRGB",3),!t)throw new Ze("WhitePoint missing - required for color space CalRGB");const[n,a,r]=this.whitePoint=t,[o,l,c]=this.blackPoint=e||new Float32Array(3);if([this.GR,this.GG,this.GB]=s||new Float32Array([1,1,1]),[this.MXA,this.MYA,this.MZA,this.MXB,this.MYB,this.MZB,this.MXC,this.MYC,this.MZC]=i||new Float32Array([1,0,0,0,1,0,0,0,1]),n<0||r<0||1!==a)throw new Ze(`Invalid WhitePoint components for ${this.name}, no fallback available`);(o<0||l<0||c<0)&&(info$1(`Invalid BlackPoint for ${this.name} [${o}, ${l}, ${c}], falling back to default.`),this.blackPoint=new Float32Array(3)),(this.GR<0||this.GG<0||this.GB<0)&&(info$1(`Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ${this.name}, falling back to default.`),this.GR=this.GG=this.GB=1)}#f(t,e,s){s[0]=t[0]*e[0]+t[1]*e[1]+t[2]*e[2],s[1]=t[3]*e[0]+t[4]*e[1]+t[5]*e[2],s[2]=t[6]*e[0]+t[7]*e[1]+t[8]*e[2]}#g(t,e,s){s[0]=1*e[0]/t[0],s[1]=1*e[1]/t[1],s[2]=1*e[2]/t[2]}#p(t,e,s){s[0]=.95047*e[0]/t[0],s[1]=1*e[1]/t[1],s[2]=1.08883*e[2]/t[2]}#m(t){return t<=.0031308?MathClamp$1(12.92*t,0,1):t>=.99554525?1:MathClamp$1(1.055*t**(1/2.4)-.055,0,1)}#b(t){return t<0?-this.#b(-t):t>8?((t+16)/116)**3:t*_CalRGBCS.#d}#w(t,e,s){if(0===t[0]&&0===t[1]&&0===t[2])return s[0]=e[0],s[1]=e[1],void(s[2]=e[2]);const i=this.#b(0),n=(1-i)/(1-this.#b(t[0])),a=1-n,r=(1-i)/(1-this.#b(t[1])),o=1-r,l=(1-i)/(1-this.#b(t[2])),c=1-l;s[0]=e[0]*n+a,s[1]=e[1]*r+o,s[2]=e[2]*l+c}#y(t,e,s){if(1===t[0]&&1===t[2])return s[0]=e[0],s[1]=e[1],void(s[2]=e[2]);const i=s;this.#f(_CalRGBCS.#a,e,i);const n=_CalRGBCS.#c;this.#g(t,i,n),this.#f(_CalRGBCS.#r,n,s)}#x(t,e,s){const i=s;this.#f(_CalRGBCS.#a,e,i);const n=_CalRGBCS.#c;this.#p(t,i,n),this.#f(_CalRGBCS.#r,n,s)}#n(t,e,s,i,n){const a=MathClamp$1(t[e]*n,0,1),r=MathClamp$1(t[e+1]*n,0,1),o=MathClamp$1(t[e+2]*n,0,1),l=1===a?1:a**this.GR,c=1===r?1:r**this.GG,h=1===o?1:o**this.GB,u=this.MXA*l+this.MXB*c+this.MXC*h,d=this.MYA*l+this.MYB*c+this.MYC*h,f=this.MZA*l+this.MZB*c+this.MZC*h,g=_CalRGBCS.#h;g[0]=u,g[1]=d,g[2]=f;const p=_CalRGBCS.#u;this.#y(this.whitePoint,g,p);const m=_CalRGBCS.#h;this.#w(this.blackPoint,p,m);const b=_CalRGBCS.#u;this.#x(_CalRGBCS.#l,m,b);const w=_CalRGBCS.#h;this.#f(_CalRGBCS.#o,b,w),s[i]=255*this.#m(w[0]),s[i+1]=255*this.#m(w[1]),s[i+2]=255*this.#m(w[2])}getRgbItem(t,e,s,i){this.#n(t,e,s,i,1)}getRgbBuffer(t,e,s,i,n,a,r){const o=1/((1<<a)-1);for(let a=0;a<s;++a)this.#n(t,e,i,n,o),e+=3,n+=3+r}getOutputLength(t,e){return t*(3+e)/3|0}},Ws=class extends Ns{constructor(t,e,s){if(super("Lab",3),!t)throw new Ze("WhitePoint missing - required for color space Lab");if([this.XW,this.YW,this.ZW]=t,[this.amin,this.amax,this.bmin,this.bmax]=s||[-100,100,-100,100],[this.XB,this.YB,this.ZB]=e||[0,0,0],this.XW<0||this.ZW<0||1!==this.YW)throw new Ze("Invalid WhitePoint components, no fallback available");(this.XB<0||this.YB<0||this.ZB<0)&&(info$1("Invalid BlackPoint, falling back to default"),this.XB=this.YB=this.ZB=0),(this.amin>this.amax||this.bmin>this.bmax)&&(info$1("Invalid Range, falling back to defaults"),this.amin=-100,this.amax=100,this.bmin=-100,this.bmax=100)}#v(t){return t>=6/29?t**3:108/841*(t-4/29)}#A(t,e,s,i){return s+t*(i-s)/e}#n(t,e,s,i,n){let a=t[e],r=t[e+1],o=t[e+2];!1!==s&&(a=this.#A(a,s,0,100),r=this.#A(r,s,this.amin,this.amax),o=this.#A(o,s,this.bmin,this.bmax)),r>this.amax?r=this.amax:r<this.amin&&(r=this.amin),o>this.bmax?o=this.bmax:o<this.bmin&&(o=this.bmin);const l=(a+16)/116,c=l+r/500,h=l-o/200,u=this.XW*this.#v(c),d=this.YW*this.#v(l),f=this.ZW*this.#v(h);let g,p,m;this.ZW<1?(g=3.1339*u+-1.617*d+-.4906*f,p=-.9785*u+1.916*d+.0333*f,m=.072*u+-.229*d+1.4057*f):(g=3.2406*u+-1.5372*d+-.4986*f,p=-.9689*u+1.8758*d+.0415*f,m=.0557*u+-.204*d+1.057*f),i[n]=255*Math.sqrt(g),i[n+1]=255*Math.sqrt(p),i[n+2]=255*Math.sqrt(m)}getRgbItem(t,e,s,i){this.#n(t,e,!1,s,i)}getRgbBuffer(t,e,s,i,n,a,r){const o=(1<<a)-1;for(let a=0;a<s;a++)this.#n(t,e,o,i,n),e+=3,n+=3+r}getOutputLength(t,e){return t*(3+e)/3|0}isDefaultDecode(t,e){return!0}get usesZeroToOneRange(){return shadow$1(this,"usesZeroToOneRange",!1)}};function fetchSync(t){const e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),e.response}var Vs=class _IccColorSpace extends Ns{#k;#S;static#C=!0;static#_=null;static#I=null;constructor(t,e,s){if(!_IccColorSpace.isUsable)throw new Error("No ICC color space support");let i;switch(super(e,s),s){case 1:i=Bs.Gray8,this.#S=(t,e,s)=>function(t,e,s){Ms.qcms_convert_one(t,e,s)}(this.#k,255*t[e],s);break;case 3:i=Bs.RGB8,this.#S=(t,e,s)=>function(t,e,s,i,n){Ms.qcms_convert_three(t,e,s,i,n)}(this.#k,255*t[e],255*t[e+1],255*t[e+2],s);break;case 4:i=Bs.CMYK,this.#S=(t,e,s)=>function(t,e,s,i,n,a){Ms.qcms_convert_four(t,e,s,i,n,a)}(this.#k,255*t[e],255*t[e+1],255*t[e+2],255*t[e+3],s);break;default:throw new Error(`Unsupported number of components: ${s}`)}if(this.#k=function(t,e,s){const i=passArray8ToWasm0(t,Ms.__wbindgen_malloc),n=Rs;return Ms.qcms_transformer_from_memory(i,n,e,s)>>>0}(t,i,Ps.Perceptual),!this.#k)throw new Error("Failed to create ICC color space");_IccColorSpace.#I||=new FinalizationRegistry(t=>{!function(t){Ms.qcms_drop_transformer(t)}(t)}),_IccColorSpace.#I.register(this,this.#k)}getRgbHex(t,e){return this.#S(t,e,!0),Es._cssColor}getRgbItem(t,e,s,i){Es._destBuffer=s,Es._destOffset=i,Es._destLength=3,this.#S(t,e,!1),Es._destBuffer=null}getRgbBuffer(t,e,s,i,n,a,r){if(t=t.subarray(e,e+s*this.numComps),8!==a){const e=255/((1<<a)-1);for(let s=0,i=t.length;s<i;s++)t[s]*=e}Es._mustAddAlpha=r&&i.buffer===t.buffer,Es._destBuffer=i,Es._destOffset=n,Es._destLength=s*(3+r),function(t,e){const s=passArray8ToWasm0(e,Ms.__wbindgen_malloc),i=Rs;Ms.qcms_convert_array(t,s,i)}(this.#k,t),Es._mustAddAlpha=!1,Es._destBuffer=null}getOutputLength(t,e){return t/this.numComps*(3+e)|0}static setOptions({useWasm:t,useWorkerFetch:e,wasmUrl:s}){e?(this.#C=t,this.#_=s):this.#C=!1}static get isUsable(){let t=!1;if(this.#C)if(this.#_)try{this._module=initSync({module:fetchSync(`${this.#_}qcms_bg.wasm`)}),t=!!this._module,Es._memory=this._module.memory,Es._makeHexColor=ss.makeHexColor}catch(t){warn$1(`ICCBased color space: "${t}".`)}else warn$1("No ICC color space support due to missing `wasmUrl` API option");return shadow$1(this,"isUsable",t)}},Xs=class _CmykICCBasedCS extends Vs{static#T;constructor(){super(new Uint8Array(fetchSync(`${_CmykICCBasedCS.#T}CGATS001Compat-v2-micro.icc`)),"DeviceCMYK",4)}static setOptions({iccUrl:t}){this.#T=t}static get isUsable(){let t=!1;return Vs.isUsable&&(this.#T?t=!0:warn$1("No CMYK ICC profile support due to missing `iccUrl` API option")),shadow$1(this,"isUsable",t)}},Ks=class _Stream extends bs{constructor(t,e,s,i){super(),this.bytes=t instanceof Uint8Array?t:new Uint8Array(t),this.start=e||0,this.pos=this.start,this.end=e+s||this.bytes.length,this.dict=i}get length(){return this.end-this.start}get isEmpty(){return 0===this.length}getByte(){return this.pos>=this.end?-1:this.bytes[this.pos++]}getBytes(t){const e=this.bytes,s=this.pos,i=this.end;if(!t)return e.subarray(s,i);let n=s+t;return n>i&&(n=i),this.pos=n,e.subarray(s,n)}getByteRange(t,e){return t<0&&(t=0),e>this.end&&(e=this.end),this.bytes.subarray(t,e)}reset(){this.pos=this.start}moveStart(){this.start=this.pos}makeSubStream(t,e,s=null){return new _Stream(this.bytes.buffer,t,e,s)}},Ys=class extends Ks{constructor(t){super(stringToBytes$1(t))}},Js=class extends Ks{constructor(){super(new Uint8Array(0))}},Zs=class extends Ks{constructor(t,e,s){super(new Uint8Array(t),0,t,null),this.chunkSize=e,this._loadedChunks=new Set,this.numChunks=Math.ceil(t/e),this.manager=s,this.progressiveDataLength=0,this.lastSuccessfulEnsureByteChunk=-1}getMissingChunks(){const t=[];for(let e=0,s=this.numChunks;e<s;++e)this._loadedChunks.has(e)||t.push(e);return t}get numChunksLoaded(){return this._loadedChunks.size}get isDataLoaded(){return this.numChunksLoaded===this.numChunks}onReceiveData(t,e){const s=this.chunkSize;if(t%s!==0)throw new Error(`Bad begin offset: ${t}`);const i=t+e.byteLength;if(i%s!==0&&i!==this.bytes.length)throw new Error(`Bad end offset: ${i}`);this.bytes.set(new Uint8Array(e),t);const n=Math.floor(t/s),a=Math.floor((i-1)/s)+1;for(let t=n;t<a;++t)this._loadedChunks.add(t)}onReceiveProgressiveData(t){let e=this.progressiveDataLength;const s=Math.floor(e/this.chunkSize);this.bytes.set(new Uint8Array(t),e),e+=t.byteLength,this.progressiveDataLength=e;const i=e>=this.end?this.numChunks:Math.floor(e/this.chunkSize);for(let t=s;t<i;++t)this._loadedChunks.add(t)}ensureByte(t){if(t<this.progressiveDataLength)return;const e=Math.floor(t/this.chunkSize);if(!(e>this.numChunks)&&e!==this.lastSuccessfulEnsureByteChunk){if(!this._loadedChunks.has(e))throw new ks(t,t+1);this.lastSuccessfulEnsureByteChunk=e}}ensureRange(t,e){if(t>=e)return;if(e<=this.progressiveDataLength)return;const s=Math.floor(t/this.chunkSize);if(s>this.numChunks)return;const i=Math.min(Math.floor((e-1)/this.chunkSize)+1,this.numChunks);for(let n=s;n<i;++n)if(!this._loadedChunks.has(n))throw new ks(t,e)}nextEmptyChunk(t){const e=this.numChunks;for(let s=0;s<e;++s){const i=(t+s)%e;if(!this._loadedChunks.has(i))return i}return null}hasChunk(t){return this._loadedChunks.has(t)}getByte(){const t=this.pos;return t>=this.end?-1:(t>=this.progressiveDataLength&&this.ensureByte(t),this.bytes[this.pos++])}getBytes(t){const e=this.bytes,s=this.pos,i=this.end;if(!t)return i>this.progressiveDataLength&&this.ensureRange(s,i),e.subarray(s,i);let n=s+t;return n>i&&(n=i),n>this.progressiveDataLength&&this.ensureRange(s,n),this.pos=n,e.subarray(s,n)}getByteRange(t,e){return t<0&&(t=0),e>this.end&&(e=this.end),e>this.progressiveDataLength&&this.ensureRange(t,e),this.bytes.subarray(t,e)}makeSubStream(t,e,s=null){function ChunkedStreamSubstream(){}e?t+e>this.progressiveDataLength&&this.ensureRange(t,t+e):t>=this.progressiveDataLength&&this.ensureByte(t),ChunkedStreamSubstream.prototype=Object.create(this),ChunkedStreamSubstream.prototype.getMissingChunks=function(){const t=this.chunkSize,e=Math.floor(this.start/t),s=Math.floor((this.end-1)/t)+1,i=[];for(let t=e;t<s;++t)this._loadedChunks.has(t)||i.push(t);return i},Object.defineProperty(ChunkedStreamSubstream.prototype,"isDataLoaded",{get(){return this.numChunksLoaded===this.numChunks||0===this.getMissingChunks().length},configurable:!0});const i=new ChunkedStreamSubstream;return i.pos=i.start=t,i.end=t+e||this.end,i.dict=s,i}getBaseStreams(){return[this]}},Qs=class{constructor(t,e){this.length=e.length,this.chunkSize=e.rangeChunkSize,this.stream=new Zs(this.length,this.chunkSize,this),this.pdfNetworkStream=t,this.disableAutoFetch=e.disableAutoFetch,this.msgHandler=e.msgHandler,this.currRequestId=0,this._chunksNeededByRequest=new Map,this._requestsByChunk=new Map,this._promisesByRequest=new Map,this.progressiveDataLength=0,this.aborted=!1,this._loadedStreamCapability=Promise.withResolvers()}sendRequest(t,e){const s=this.pdfNetworkStream.getRangeReader(t,e);s.isStreamingSupported||(s.onProgress=this.onProgress.bind(this));let i=[],n=0;return new Promise((t,e)=>{const readChunk=({value:a,done:r})=>{try{if(r){const e=arrayBuffersToBytes(i);return i=null,void t(e)}n+=a.byteLength,s.isStreamingSupported&&this.onProgress({loaded:n}),i.push(a),s.read().then(readChunk,e)}catch(t){e(t)}};s.read().then(readChunk,e)}).then(e=>{this.aborted||this.onReceiveData({chunk:e,begin:t})})}requestAllChunks(t=!1){if(!t){const t=this.stream.getMissingChunks();this._requestChunks(t)}return this._loadedStreamCapability.promise}_requestChunks(t){const e=this.currRequestId++,s=new Set;this._chunksNeededByRequest.set(e,s);for(const e of t)this.stream.hasChunk(e)||s.add(e);if(0===s.size)return Promise.resolve();const i=Promise.withResolvers();this._promisesByRequest.set(e,i);const n=[];for(const t of s){let s=this._requestsByChunk.get(t);s||(s=[],this._requestsByChunk.set(t,s),n.push(t)),s.push(e)}if(n.length>0){const t=this.groupChunks(n);for(const e of t){const t=e.beginChunk*this.chunkSize,s=Math.min(e.endChunk*this.chunkSize,this.length);this.sendRequest(t,s).catch(i.reject)}}return i.promise.catch(t=>{if(!this.aborted)throw t})}getStream(){return this.stream}requestRange(t,e){e=Math.min(e,this.length);const s=this.getBeginChunk(t),i=this.getEndChunk(e),n=[];for(let t=s;t<i;++t)n.push(t);return this._requestChunks(n)}requestRanges(t=[]){const e=[];for(const s of t){const t=this.getBeginChunk(s.begin),i=this.getEndChunk(s.end);for(let s=t;s<i;++s)e.includes(s)||e.push(s)}return e.sort((t,e)=>t-e),this._requestChunks(e)}groupChunks(t){const e=[];let s=-1,i=-1;for(let n=0,a=t.length;n<a;++n){const a=t[n];s<0&&(s=a),i>=0&&i+1!==a&&(e.push({beginChunk:s,endChunk:i+1}),s=a),n+1===t.length&&e.push({beginChunk:s,endChunk:a+1}),i=a}return e}onProgress(t){this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize+t.loaded,total:this.length})}onReceiveData(t){const e=t.chunk,s=void 0===t.begin,i=s?this.progressiveDataLength:t.begin,n=i+e.byteLength,a=Math.floor(i/this.chunkSize),r=n<this.length?Math.floor(n/this.chunkSize):Math.ceil(n/this.chunkSize);s?(this.stream.onReceiveProgressiveData(e),this.progressiveDataLength=n):this.stream.onReceiveData(i,e),this.stream.isDataLoaded&&this._loadedStreamCapability.resolve(this.stream);const o=[];for(let t=a;t<r;++t){const e=this._requestsByChunk.get(t);if(e){this._requestsByChunk.delete(t);for(const s of e){const e=this._chunksNeededByRequest.get(s);e.has(t)&&e.delete(t),e.size>0||o.push(s)}}}if(!this.disableAutoFetch&&0===this._requestsByChunk.size){let t;if(1===this.stream.numChunksLoaded){const e=this.stream.numChunks-1;this.stream.hasChunk(e)||(t=e)}else t=this.stream.nextEmptyChunk(r);Number.isInteger(t)&&this._requestChunks([t])}for(const t of o){const e=this._promisesByRequest.get(t);this._promisesByRequest.delete(t),e.resolve()}this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize,total:this.length})}onError(t){this._loadedStreamCapability.reject(t)}getBeginChunk(t){return Math.floor(t/this.chunkSize)}getEndChunk(t){return Math.floor((t-1)/this.chunkSize)+1}abort(t){this.aborted=!0,this.pdfNetworkStream?.cancelAllRequests(t);for(const e of this._promisesByRequest.values())e.reject(t)}};function convertToRGBA(t){switch(t.kind){case k:return convertBlackAndWhiteToRGBA$1(t);case S:return function({src:t,srcPos:e=0,dest:s,destPos:i=0,width:n,height:a}){let r=0;const o=n*a*3,l=o>>2,c=new Uint32Array(t.buffer,e,l);if(ts.isLittleEndian){for(;r<l-2;r+=3,i+=4){const t=c[r],e=c[r+1],n=c[r+2];s[i]=4278190080|t,s[i+1]=t>>>24|e<<8|4278190080,s[i+2]=e>>>16|n<<16|4278190080,s[i+3]=n>>>8|4278190080}for(let n=4*r,a=e+o;n<a;n+=3)s[i++]=t[n]|t[n+1]<<8|t[n+2]<<16|4278190080}else{for(;r<l-2;r+=3,i+=4){const t=c[r],e=c[r+1],n=c[r+2];s[i]=255|t,s[i+1]=t<<24|e>>>8|255,s[i+2]=e<<16|n>>>16|255,s[i+3]=n<<8|255}for(let n=4*r,a=e+o;n<a;n+=3)s[i++]=t[n]<<24|t[n+1]<<16|t[n+2]<<8|255}return{srcPos:e+o,destPos:i}}(t)}return null}function convertBlackAndWhiteToRGBA$1({src:t,srcPos:e=0,dest:s,width:i,height:n,nonBlackColor:a=4294967295,inverseDecode:r=!1}){const o=ts.isLittleEndian?4278190080:255,[l,c]=r?[a,o]:[o,a],h=i>>3,u=7&i,d=t.length;s=new Uint32Array(s.buffer);let f=0;for(let i=0;i<n;i++){for(const i=e+h;e<i;e++){const i=e<d?t[e]:255;s[f++]=128&i?c:l,s[f++]=64&i?c:l,s[f++]=32&i?c:l,s[f++]=16&i?c:l,s[f++]=8&i?c:l,s[f++]=4&i?c:l,s[f++]=2&i?c:l,s[f++]=1&i?c:l}if(0===u)continue;const i=e<d?t[e++]:255;for(let t=0;t<u;t++)s[f++]=i&1<<7-t?c:l}return{srcPos:e,destPos:f}}var ti=class _ImageResizer{static#M=2048;static#E=ts.isImageDecoderSupported;constructor(t,e){this._imgData=t,this._isMask=e}static get canUseImageDecoder(){return shadow$1(this,"canUseImageDecoder",this.#E?ImageDecoder.isTypeSupported("image/bmp"):Promise.resolve(!1))}static needsToBeResized(t,e){if(t<=this.#M&&e<=this.#M)return!1;const{MAX_DIM:s}=this;if(t>s||e>s)return!0;const i=t*e;return this._hasMaxArea?i>this.MAX_AREA:!(i<this.#M**2)&&(this._areGoodDims(t,e)?(this.#M=Math.max(this.#M,Math.floor(Math.sqrt(t*e))),!1):(this.#M=this._guessMax(this.#M,s,128,0),i>(this.MAX_AREA=this.#M**2)))}static getReducePowerForJPX(t,e,s){const i=t*e,n=2**30/(4*s);if(!this.needsToBeResized(t,e))return i>n?Math.ceil(Math.log2(i/n)):0;const{MAX_DIM:a,MAX_AREA:r}=this,o=Math.max(t/a,e/a,Math.sqrt(i/Math.min(n,r)));return Math.ceil(Math.log2(o))}static get MAX_DIM(){return shadow$1(this,"MAX_DIM",this._guessMax(2048,65537,0,1))}static get MAX_AREA(){return this._hasMaxArea=!0,shadow$1(this,"MAX_AREA",this._guessMax(this.#M,this.MAX_DIM,128,0)**2)}static set MAX_AREA(t){t>=0&&(this._hasMaxArea=!0,shadow$1(this,"MAX_AREA",t))}static setOptions({canvasMaxAreaInBytes:t=-1,isImageDecoderSupported:e=!1}){this._hasMaxArea||(this.MAX_AREA=t>>2),this.#E=e}static _areGoodDims(t,e){try{const s=new OffscreenCanvas(t,e),i=s.getContext("2d");i.fillRect(0,0,1,1);const n=i.getImageData(0,0,1,1).data[3];return s.width=s.height=1,0!==n}catch{return!1}}static _guessMax(t,e,s,i){for(;t+s+1<e;){const s=Math.floor((t+e)/2),n=i||s;this._areGoodDims(s,n)?t=s:e=s}return t}static async createImage(t,e=!1){return new _ImageResizer(t,e)._createImage()}async _createImage(){const{_imgData:t}=this,{width:e,height:s}=t;if(e*s*4>ys){const t=this.#F();if(t)return t}const i=this._encodeBMP();let n,a;await _ImageResizer.canUseImageDecoder?(n=new ImageDecoder({data:i,type:"image/bmp",preferAnimation:!1,transfer:[i.buffer]}),a=n.decode().catch(t=>(warn$1(`BMP image decoding failed: ${t}`),createImageBitmap(new Blob([this._encodeBMP().buffer],{type:"image/bmp"})))).finally(()=>{n.close()})):a=createImageBitmap(new Blob([i.buffer],{type:"image/bmp"}));const{MAX_AREA:r,MAX_DIM:o}=_ImageResizer,l=Math.max(e/o,s/o,Math.sqrt(e*s/r)),c=Math.max(l,2),h=Math.round(10*(l+1.25))/10/c,u=Math.floor(Math.log2(h)),d=new Array(u+2).fill(2);d[0]=c,d.splice(-1,1,h/(1<<u));let f=e,g=s;const p=await a;let m=p.image||p;for(const t of d){const e=f,s=g;f=Math.floor(f/t)-1,g=Math.floor(g/t)-1;const i=new OffscreenCanvas(f,g);i.getContext("2d").drawImage(m,0,0,e,s,0,0,f,g),m.close(),m=i.transferToImageBitmap()}return t.data=null,t.bitmap=m,t.width=f,t.height=g,t}#F(){const{_imgData:t}=this,{data:e,width:s,height:i,kind:n}=t,a=s*i*4,r=Math.ceil(Math.log2(a/ys)),o=s>>r,l=i>>r;let c,h=i;try{c=new Uint8Array(a)}catch{let t=Math.floor(Math.log2(a+1));for(;;)try{c=new Uint8Array(2**t-1);break}catch{t-=1}h=Math.floor((2**t-1)/(4*s));const e=s*h*4;e<c.length&&(c=new Uint8Array(e))}const u=new Uint32Array(c.buffer),d=new Uint32Array(o*l);let f=0,g=0;const p=Math.ceil(i/h),m=i%h===0?i:i%h;for(let t=0;t<p;t++){const i=t<p-1?h:m;({srcPos:f}=convertToRGBA({kind:n,src:e,dest:u,width:s,height:i,inverseDecode:this._isMask,srcPos:f}));for(let t=0,e=i>>r;t<e;t++){const e=u.subarray((t<<r)*s);for(let t=0;t<o;t++)d[g++]=e[t<<r]}}if(_ImageResizer.needsToBeResized(o,l))return t.data=d,t.width=o,t.height=l,t.kind=C,null;const b=new OffscreenCanvas(o,l);return b.getContext("2d",{willReadFrequently:!0}).putImageData(new ImageData(new Uint8ClampedArray(d.buffer),o,l),0,0),t.data=null,t.bitmap=b.transferToImageBitmap(),t.width=o,t.height=l,t}_encodeBMP(){const{width:t,height:e,kind:s}=this._imgData;let i,n=this._imgData.data,a=new Uint8Array(0),r=a,o=0;switch(s){case k:{i=1,a=new Uint8Array(this._isMask?[255,255,255,255,0,0,0,0]:[0,0,0,0,255,255,255,255]);const s=t+7>>3,r=s+3&-4;if(s!==r){const t=new Uint8Array(r*e);let i=0;for(let a=0,o=e*s;a<o;a+=s,i+=r)t.set(n.subarray(a,a+s),i);n=t}break}case S:if(i=24,3&t){const s=3*t,i=s+3&-4,a=i-s,r=new Uint8Array(i*e);let o=0;for(let t=0,i=e*s;t<i;t+=s){const e=n.subarray(t,t+s);for(let t=0;t<s;t+=3)r[o++]=e[t+2],r[o++]=e[t+1],r[o++]=e[t];o+=a}n=r}else for(let t=0,e=n.length;t<e;t+=3){const e=n[t];n[t]=n[t+2],n[t+2]=e}break;case C:i=32,o=3,r=new Uint8Array(68);const s=new DataView(r.buffer);ts.isLittleEndian?(s.setUint32(0,255,!0),s.setUint32(4,65280,!0),s.setUint32(8,16711680,!0),s.setUint32(12,4278190080,!0)):(s.setUint32(0,4278190080,!0),s.setUint32(4,16711680,!0),s.setUint32(8,65280,!0),s.setUint32(12,255,!0));break;default:throw new Error("invalid format")}let l=0;const c=40+r.length,h=14+c+a.length+n.length,u=new Uint8Array(h),d=new DataView(u.buffer);return d.setUint16(l,19778,!0),l+=2,d.setUint32(l,h,!0),l+=4,d.setUint32(l,0,!0),l+=4,d.setUint32(l,14+c+a.length,!0),l+=4,d.setUint32(l,c,!0),l+=4,d.setInt32(l,t,!0),l+=4,d.setInt32(l,-e,!0),l+=4,d.setUint16(l,1,!0),l+=2,d.setUint16(l,i,!0),l+=2,d.setUint32(l,o,!0),l+=4,d.setUint32(l,0,!0),l+=4,d.setInt32(l,0,!0),l+=4,d.setInt32(l,0,!0),l+=4,d.setUint32(l,a.length/4,!0),l+=4,d.setUint32(l,0,!0),l+=4,u.set(r,l),l+=r.length,u.set(a,l),l+=a.length,u.set(n,l),u}},ei=new Uint8Array(0),si=class extends bs{constructor(t){if(super(),this._rawMinBufferLength=t||0,this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=ei,this.minBufferLength=512,t)for(;this.minBufferLength<t;)this.minBufferLength*=2}get isEmpty(){for(;!this.eof&&0===this.bufferLength;)this.readBlock();return 0===this.bufferLength}ensureBuffer(t){const e=this.buffer;if(t<=e.byteLength)return e;let s=this.minBufferLength;for(;s<t;)s*=2;const i=new Uint8Array(s);return i.set(e),this.buffer=i}getByte(){const t=this.pos;for(;this.bufferLength<=t;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]}getBytes(t,e=null){const s=this.pos;let i;if(t){for(this.ensureBuffer(s+t),i=s+t;!this.eof&&this.bufferLength<i;)this.readBlock(e);const n=this.bufferLength;i>n&&(i=n)}else{for(;!this.eof;)this.readBlock(e);i=this.bufferLength}return this.pos=i,this.buffer.subarray(s,i)}async getImageData(t,e){if(!this.canAsyncDecodeImageFromBuffer)return this.isAsyncDecoder?this.decodeImage(null,e):this.getBytes(t,e);const s=await this.stream.asyncGetBytes();return this.decodeImage(s,e)}reset(){this.pos=0}makeSubStream(t,e,s=null){if(void 0===e)for(;!this.eof;)this.readBlock();else{const s=t+e;for(;this.bufferLength<=s&&!this.eof;)this.readBlock()}return new Ks(this.buffer,t,e,s)}getBaseStreams(){return this.str?this.str.getBaseStreams():null}},ii=class extends si{constructor(t,e=null){t=t.filter(t=>t instanceof bs);let s=0;for(const e of t)s+=e instanceof si?e._rawMinBufferLength:e.length;super(s),this.streams=t,this._onError=e}readBlock(){const t=this.streams;if(0===t.length)return void(this.eof=!0);const e=t.shift();let s;try{s=e.getBytes()}catch(t){if(this._onError)return void this._onError(t,e.dict?.objId);throw t}const i=this.bufferLength,n=i+s.length;this.ensureBuffer(n).set(s,i),this.bufferLength=n}getBaseStreams(){const t=[];for(const e of this.streams){const s=e.getBaseStreams();s&&t.push(...s)}return t.length>0?t:null}},ni=class{static parse({cs:t,xref:e,resources:s=null,pdfFunctionFactory:i,globalColorSpaceCache:n,localColorSpaceCache:a,asyncIfNotCached:r=!1}){const o={xref:e,resources:s,pdfFunctionFactory:i,globalColorSpaceCache:n,localColorSpaceCache:a};let l,c,h;if(t instanceof gs){c=t;const s=n.getByRef(c)||a.getByRef(c);if(s)return s;t=e.fetch(t)}if(t instanceof us){l=t.name;const e=a.getByName(l);if(e)return e}try{h=this.#D(t,o)}catch(t){if(r&&!(t instanceof ks))return Promise.reject(t);throw t}return(l||c)&&(a.set(l,c,h),c&&n.set(null,c,h)),r?Promise.resolve(h):h}static#R(t,e){const{globalColorSpaceCache:s}=e;let i;if(t instanceof gs){i=t;const e=s.getByRef(i);if(e)return e}const n=this.#D(t,e);return i&&s.set(null,i,n),n}static#D(t,e){const{xref:s,resources:i,pdfFunctionFactory:n,globalColorSpaceCache:a}=e;if((t=s.fetchIfRef(t))instanceof us)switch(t.name){case"G":case"DeviceGray":return this.gray;case"RGB":case"DeviceRGB":return this.rgb;case"DeviceRGBA":return this.rgba;case"CMYK":case"DeviceCMYK":return this.cmyk;case"Pattern":return new Ls(null);default:if(i instanceof fs){const s=i.get("ColorSpace");if(s instanceof fs){const i=s.get(t.name);if(i){if(i instanceof us)return this.#D(i,e);t=i;break}}}return warn$1(`Unrecognized ColorSpace: ${t.name}`),this.gray}if(Array.isArray(t)){const i=s.fetchIfRef(t[0]).name;let r,o,l,c,h,u;switch(i){case"G":case"DeviceGray":return this.gray;case"RGB":case"DeviceRGB":return this.rgb;case"CMYK":case"DeviceCMYK":return this.cmyk;case"CalGray":return r=s.fetchIfRef(t[1]),c=r.getArray("WhitePoint"),h=r.getArray("BlackPoint"),u=r.get("Gamma"),new zs(c,h,u);case"CalRGB":r=s.fetchIfRef(t[1]),c=r.getArray("WhitePoint"),h=r.getArray("BlackPoint"),u=r.getArray("Gamma");const d=r.getArray("Matrix");return new Gs(c,h,u,d);case"ICCBased":const f=t[1]instanceof gs;if(f){const e=a.getByRef(t[1]);if(e)return e}const g=s.fetchIfRef(t[1]),p=g.dict;if(o=p.get("N"),Vs.isUsable)try{const e=new Vs(g.getBytes(),"ICCBased",o);return f&&a.set(null,t[1],e),e}catch(e){if(e instanceof ks)throw e;warn$1(`ICCBased color space (${t[1]}): "${e}".`)}const m=p.getRaw("Alternate");if(m){const t=this.#R(m,e);if(t.numComps===o)return t;warn$1("ICCBased color space: Ignoring incorrect /Alternate entry.")}if(1===o)return this.gray;if(3===o)return this.rgb;if(4===o)return this.cmyk;break;case"Pattern":return l=t[1]||null,l&&(l=this.#R(l,e)),new Ls(l);case"I":case"Indexed":l=this.#R(t[1],e);const b=MathClamp$1(s.fetchIfRef(t[2]),0,255),w=s.fetchIfRef(t[3]);return new Us(l,b,w);case"Separation":case"DeviceN":const y=s.fetchIfRef(t[1]);o=Array.isArray(y)?y.length:1,l=this.#R(t[2],e);const x=n.create(t[3]);return new Os(o,l,x);case"Lab":r=s.fetchIfRef(t[1]),c=r.getArray("WhitePoint"),h=r.getArray("BlackPoint");const v=r.getArray("Range");return new Ws(c,h,v);default:return warn$1(`Unimplemented ColorSpace object: ${i}`),this.gray}}return warn$1(`Unrecognized ColorSpace object: ${t}`),this.gray}static get gray(){return shadow$1(this,"gray",new $s)}static get rgb(){return shadow$1(this,"rgb",new Hs)}static get rgba(){return shadow$1(this,"rgba",new js)}static get cmyk(){if(Xs.isUsable)try{return shadow$1(this,"cmyk",new Xs)}catch{warn$1("CMYK fallback: DeviceCMYK")}return shadow$1(this,"cmyk",new qs)}},ai=class extends Ve{constructor(t){super(t,"JpegError")}},ri=class extends Ve{constructor(t,e){super(t,"DNLMarkerError"),this.scanLines=e}},oi=class extends Ve{constructor(t){super(t,"EOIMarkerError")}},li=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),ci=4017,hi=799,ui=3406,di=2276,fi=1567,gi=3784,pi=5793,mi=2896;function buildHuffmanTable(t,e){let s,i,n=0,a=16;for(;a>0&&!t[a-1];)a--;const r=[{children:[],index:0}];let o,l=r[0];for(s=0;s<a;s++){for(i=0;i<t[s];i++){for(l=r.pop(),l.children[l.index]=e[n];l.index>0;)l=r.pop();for(l.index++,r.push(l);r.length<=s;)r.push(o={children:[],index:0}),l.children[l.index]=o.children,l=o;n++}s+1<a&&(r.push(o={children:[],index:0}),l.children[l.index]=o.children,l=o)}return r[0].children}function getBlockBufferOffset(t,e,s){return 64*((t.blocksPerLine+1)*e+s)}function decodeScan(t,e,s,i,n,a,r,o,l,c=!1){const h=s.mcusPerLine,u=s.progressive,d=e;let f=0,g=0;function readBit(){if(g>0)return g--,f>>g&1;if(f=t[e++],255===f){const i=t[e++];if(i){if(220===i&&c){const i=readUint16(t,e+=2);if(e+=2,i>0&&i!==s.scanLines)throw new ri("Found DNL marker (0xFFDC) while parsing scan data",i)}else if(217===i){if(c){const t=w*(8===s.precision?8:0);if(t>0&&Math.round(s.scanLines/t)>=5)throw new ri("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",t)}throw new oi("Found EOI marker (0xFFD9) while parsing scan data")}throw new ai(`unexpected marker ${(f<<8|i).toString(16)}`)}}return g=7,f>>>7}function decodeHuffman(t){let e=t;for(;;){switch(e=e[readBit()],typeof e){case"number":return e;case"object":continue}throw new ai("invalid huffman sequence")}}function receive(t){let e=0;for(;t>0;)e=e<<1|readBit(),t--;return e}function receiveAndExtend(t){if(1===t)return 1===readBit()?1:-1;const e=receive(t);return e>=1<<t-1?e:e+(-1<<t)+1}let p,m=0,b=0,w=0;function decodeMcu(t,e,s,i,n){const a=s%h;w=(s/h|0)*t.v+i;const r=a*t.h+n;e(t,getBlockBufferOffset(t,w,r))}function decodeBlock(t,e,s){w=s/t.blocksPerLine|0;const i=s%t.blocksPerLine;e(t,getBlockBufferOffset(t,w,i))}const y=i.length;let x,v,A,k,S,C;C=u?0===a?0===o?function(t,e){const s=decodeHuffman(t.huffmanTableDC),i=0===s?0:receiveAndExtend(s)<<l;t.blockData[e]=t.pred+=i}:function(t,e){t.blockData[e]|=readBit()<<l}:0===o?function(t,e){if(m>0)return void m--;let s=a;const i=r;for(;s<=i;){const i=decodeHuffman(t.huffmanTableAC),n=15&i,a=i>>4;if(0===n){if(a<15){m=receive(a)+(1<<a)-1;break}s+=16;continue}s+=a;const r=li[s];t.blockData[e+r]=receiveAndExtend(n)*(1<<l),s++}}:function(t,e){let s=a;const i=r;let n,o,c=0;for(;s<=i;){const i=e+li[s],a=t.blockData[i]<0?-1:1;switch(b){case 0:if(o=decodeHuffman(t.huffmanTableAC),n=15&o,c=o>>4,0===n)c<15?(m=receive(c)+(1<<c),b=4):(c=16,b=1);else{if(1!==n)throw new ai("invalid ACn encoding");p=receiveAndExtend(n),b=c?2:3}continue;case 1:case 2:t.blockData[i]?t.blockData[i]+=a*(readBit()<<l):(c--,0===c&&(b=2===b?3:0));break;case 3:t.blockData[i]?t.blockData[i]+=a*(readBit()<<l):(t.blockData[i]=p<<l,b=0);break;case 4:t.blockData[i]&&(t.blockData[i]+=a*(readBit()<<l))}s++}4===b&&(m--,0===m&&(b=0))}:function(t,e){const s=decodeHuffman(t.huffmanTableDC),i=0===s?0:receiveAndExtend(s);t.blockData[e]=t.pred+=i;let n=1;for(;n<64;){const s=decodeHuffman(t.huffmanTableAC),i=15&s,a=s>>4;if(0===i){if(a<15)break;n+=16;continue}n+=a;const r=li[n];t.blockData[e+r]=receiveAndExtend(i),n++}};let _,I=0;const T=1===y?i[0].blocksPerLine*i[0].blocksPerColumn:h*s.mcusPerColumn;let M,E;for(;I<=T;){const s=n?Math.min(T-I,n):T;if(s>0){for(v=0;v<y;v++)i[v].pred=0;if(m=0,1===y)for(x=i[0],S=0;S<s;S++)decodeBlock(x,C,I),I++;else for(S=0;S<s;S++){for(v=0;v<y;v++)for(x=i[v],M=x.h,E=x.v,A=0;A<E;A++)for(k=0;k<M;k++)decodeMcu(x,C,I,A,k);I++}}if(g=0,_=findNextFileMarker(t,e),!_)break;if(_.invalid&&(warn$1(`decodeScan - ${s>0?"unexpected":"excessive"} MCU data, current marker is: ${_.invalid}`),e=_.offset),!(_.marker>=65488&&_.marker<=65495))break;e+=2}return e-d}function quantizeAndInverse(t,e,s){const i=t.quantizationTable,n=t.blockData;let a,r,o,l,c,h,u,d,f,g,p,m,b,w,y,x,v;if(!i)throw new ai("missing required Quantization Table.");for(let t=0;t<64;t+=8)f=n[e+t],g=n[e+t+1],p=n[e+t+2],m=n[e+t+3],b=n[e+t+4],w=n[e+t+5],y=n[e+t+6],x=n[e+t+7],f*=i[t],0!==(g|p|m|b|w|y|x)?(g*=i[t+1],p*=i[t+2],m*=i[t+3],b*=i[t+4],w*=i[t+5],y*=i[t+6],x*=i[t+7],a=pi*f+128>>8,r=pi*b+128>>8,o=p,l=y,c=mi*(g-x)+128>>8,d=mi*(g+x)+128>>8,h=m<<4,u=w<<4,a=a+r+1>>1,r=a-r,v=o*gi+l*fi+128>>8,o=o*fi-l*gi+128>>8,l=v,c=c+u+1>>1,u=c-u,d=d+h+1>>1,h=d-h,a=a+l+1>>1,l=a-l,r=r+o+1>>1,o=r-o,v=c*di+d*ui+2048>>12,c=c*ui-d*di+2048>>12,d=v,v=h*hi+u*ci+2048>>12,h=h*ci-u*hi+2048>>12,u=v,s[t]=a+d,s[t+7]=a-d,s[t+1]=r+u,s[t+6]=r-u,s[t+2]=o+h,s[t+5]=o-h,s[t+3]=l+c,s[t+4]=l-c):(v=pi*f+512>>10,s[t]=v,s[t+1]=v,s[t+2]=v,s[t+3]=v,s[t+4]=v,s[t+5]=v,s[t+6]=v,s[t+7]=v);for(let t=0;t<8;++t)f=s[t],g=s[t+8],p=s[t+16],m=s[t+24],b=s[t+32],w=s[t+40],y=s[t+48],x=s[t+56],0!==(g|p|m|b|w|y|x)?(a=pi*f+2048>>12,r=pi*b+2048>>12,o=p,l=y,c=mi*(g-x)+2048>>12,d=mi*(g+x)+2048>>12,h=m,u=w,a=4112+(a+r+1>>1),r=a-r,v=o*gi+l*fi+2048>>12,o=o*fi-l*gi+2048>>12,l=v,c=c+u+1>>1,u=c-u,d=d+h+1>>1,h=d-h,a=a+l+1>>1,l=a-l,r=r+o+1>>1,o=r-o,v=c*di+d*ui+2048>>12,c=c*ui-d*di+2048>>12,d=v,v=h*hi+u*ci+2048>>12,h=h*ci-u*hi+2048>>12,u=v,f=a+d,x=a-d,g=r+u,y=r-u,p=o+h,w=o-h,m=l+c,b=l-c,f<16?f=0:f>=4080?f=255:f>>=4,g<16?g=0:g>=4080?g=255:g>>=4,p<16?p=0:p>=4080?p=255:p>>=4,m<16?m=0:m>=4080?m=255:m>>=4,b<16?b=0:b>=4080?b=255:b>>=4,w<16?w=0:w>=4080?w=255:w>>=4,y<16?y=0:y>=4080?y=255:y>>=4,x<16?x=0:x>=4080?x=255:x>>=4,n[e+t]=f,n[e+t+8]=g,n[e+t+16]=p,n[e+t+24]=m,n[e+t+32]=b,n[e+t+40]=w,n[e+t+48]=y,n[e+t+56]=x):(v=pi*f+8192>>14,v=v<-2040?0:v>=2024?255:v+2056>>4,n[e+t]=v,n[e+t+8]=v,n[e+t+16]=v,n[e+t+24]=v,n[e+t+32]=v,n[e+t+40]=v,n[e+t+48]=v,n[e+t+56]=v)}function buildComponentData(t,e){const s=e.blocksPerLine,i=e.blocksPerColumn,n=new Int16Array(64);for(let t=0;t<i;t++)for(let i=0;i<s;i++)quantizeAndInverse(e,getBlockBufferOffset(e,t,i),n);return e.blockData}function findNextFileMarker(t,e,s=e){const i=t.length-1;let n=s<e?s:e;if(e>=i)return null;const a=readUint16(t,e);if(a>=65472&&a<=65534)return{invalid:null,marker:a,offset:e};let r=readUint16(t,n);for(;!(r>=65472&&r<=65534);){if(++n>=i)return null;r=readUint16(t,n)}return{invalid:a.toString(16),marker:r,offset:n}}function prepareComponents(t){const e=Math.ceil(t.samplesPerLine/8/t.maxH),s=Math.ceil(t.scanLines/8/t.maxV);for(const i of t.components){const n=Math.ceil(Math.ceil(t.samplesPerLine/8)*i.h/t.maxH),a=Math.ceil(Math.ceil(t.scanLines/8)*i.v/t.maxV),r=e*i.h,o=s*i.v*64*(r+1);i.blockData=new Int16Array(o),i.blocksPerLine=n,i.blocksPerColumn=a}t.mcusPerLine=e,t.mcusPerColumn=s}function readDataBlock(t,e){const s=readUint16(t,e);let i=(e+=2)+s-2;const n=findNextFileMarker(t,i,e);n?.invalid&&(warn$1("readDataBlock - incorrect length, current marker is: "+n.invalid),i=n.offset);const a=t.subarray(e,i);return{appData:a,oldOffset:e,newOffset:e+a.length}}function skipData(t,e){const s=readUint16(t,e),i=(e+=2)+s-2,n=findNextFileMarker(t,i,e);return n?.invalid?n.offset:i}var bi=class{constructor({decodeTransform:t=null,colorTransform:e=-1}={}){this._decodeTransform=t,this._colorTransform=e}static canUseImageDecoder(t,e=-1){let s=null,i=0,n=null,a=readUint16(t,i);if(i+=2,65496!==a)throw new ai("SOI not found");a=readUint16(t,i),i+=2;t:for(;65497!==a;){switch(a){case 65505:const{appData:e,oldOffset:r,newOffset:o}=readDataBlock(t,i);if(i=o,69===e[0]&&120===e[1]&&105===e[2]&&102===e[3]&&0===e[4]&&0===e[5]){if(s)throw new ai("Duplicate EXIF-blocks found.");s={exifStart:r+6,exifEnd:o}}a=readUint16(t,i),i+=2;continue;case 65472:case 65473:case 65474:n=t[i+7];break t;case 65535:255!==t[i]&&i--}i=skipData(t,i),a=readUint16(t,i),i+=2}return 4===n||3===n&&0===e?null:s||{}}parse(t,{dnlScanLines:e=null}={}){let s,i,n=0,a=null,r=null,o=0;const l=[],c=[],h=[];let u=readUint16(t,n);if(n+=2,65496!==u)throw new ai("SOI not found");u=readUint16(t,n),n+=2;t:for(;65497!==u;){let d,f,g;switch(u){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:const{appData:p,newOffset:m}=readDataBlock(t,n);n=m,65504===u&&74===p[0]&&70===p[1]&&73===p[2]&&70===p[3]&&0===p[4]&&(a={version:{major:p[5],minor:p[6]},densityUnits:p[7],xDensity:p[8]<<8|p[9],yDensity:p[10]<<8|p[11],thumbWidth:p[12],thumbHeight:p[13],thumbData:p.subarray(14,14+3*p[12]*p[13])}),65518===u&&65===p[0]&&100===p[1]&&111===p[2]&&98===p[3]&&101===p[4]&&(r={version:p[5]<<8|p[6],flags0:p[7]<<8|p[8],flags1:p[9]<<8|p[10],transformCode:p[11]});break;case 65499:const b=readUint16(t,n);n+=2;const w=b+n-2;let y;for(;n<w;){const e=t[n++],s=new Uint16Array(64);if(e>>4){if(e>>4!=1)throw new ai("DQT - invalid table spec");for(f=0;f<64;f++)y=li[f],s[y]=readUint16(t,n),n+=2}else for(f=0;f<64;f++)y=li[f],s[y]=t[n++];l[15&e]=s}break;case 65472:case 65473:case 65474:if(s)throw new ai("Only single frame JPEGs supported");n+=2,s={},s.extended=65473===u,s.progressive=65474===u,s.precision=t[n++];const x=readUint16(t,n);n+=2,s.scanLines=e||x,s.samplesPerLine=readUint16(t,n),n+=2,s.components=[],s.componentIds={};const v=t[n++];let A=0,k=0;for(d=0;d<v;d++){const e=t[n],i=t[n+1]>>4,a=15&t[n+1];A<i&&(A=i),k<a&&(k=a);const r=t[n+2];g=s.components.push({h:i,v:a,quantizationId:r,quantizationTable:null}),s.componentIds[e]=g-1,n+=3}s.maxH=A,s.maxV=k,prepareComponents(s);break;case 65476:const S=readUint16(t,n);for(n+=2,d=2;d<S;){const e=t[n++],s=new Uint8Array(16);let i=0;for(f=0;f<16;f++,n++)i+=s[f]=t[n];const a=new Uint8Array(i);for(f=0;f<i;f++,n++)a[f]=t[n];d+=17+i,(e>>4?c:h)[15&e]=buildHuffmanTable(s,a)}break;case 65501:n+=2,i=readUint16(t,n),n+=2;break;case 65498:const C=1===++o&&!e;n+=2;const _=t[n++],I=[];for(d=0;d<_;d++){const e=t[n++],i=s.componentIds[e],a=s.components[i];a.index=e;const r=t[n++];a.huffmanTableDC=h[r>>4],a.huffmanTableAC=c[15&r],I.push(a)}const T=t[n++],M=t[n++],E=t[n++];try{n+=decodeScan(t,n,s,I,i,T,M,E>>4,15&E,C)}catch(e){if(e instanceof ri)return warn$1(`${e.message} -- attempting to re-parse the JPEG image.`),this.parse(t,{dnlScanLines:e.scanLines});if(e instanceof oi){warn$1(`${e.message} -- ignoring the rest of the image data.`);break t}throw e}break;case 65500:n+=4;break;case 65535:255!==t[n]&&n--;break;default:const F=findNextFileMarker(t,n-2,n-3);if(F?.invalid){warn$1("JpegImage.parse - unexpected data, current marker is: "+F.invalid),n=F.offset;break}if(!F||n>=t.length-1){warn$1("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");break t}throw new ai("JpegImage.parse - unknown marker: "+u.toString(16))}u=readUint16(t,n),n+=2}if(!s)throw new ai("JpegImage.parse - no frame data found.");this.width=s.samplesPerLine,this.height=s.scanLines,this.jfif=a,this.adobe=r,this.components=[];for(const t of s.components){const e=l[t.quantizationId];e&&(t.quantizationTable=e),this.components.push({index:t.index,output:buildComponentData(0,t),scaleX:t.h/s.maxH,scaleY:t.v/s.maxV,blocksPerLine:t.blocksPerLine,blocksPerColumn:t.blocksPerColumn})}this.numComponents=this.components.length}_getLinearizedBlockData(t,e,s=!1){const i=this.width/t,n=this.height/e;let a,r,o,l,c,h,u,d,f,g,p,m=0;const b=this.components.length,w=t*e*b,y=new Uint8ClampedArray(w),x=new Uint32Array(t),v=4294967288;let A;for(u=0;u<b;u++){if(a=this.components[u],r=a.scaleX*i,o=a.scaleY*n,m=u,p=a.output,l=a.blocksPerLine+1<<3,r!==A){for(c=0;c<t;c++)d=0|c*r,x[c]=(d&v)<<3|7&d;A=r}for(h=0;h<e;h++)for(d=0|h*o,g=l*(d&v)|(7&d)<<3,c=0;c<t;c++)y[m]=p[g+x[c]],m+=b}let k=this._decodeTransform;if(s||4!==b||k||(k=new Int32Array([-256,255,-256,255,-256,255,-256,255])),k)for(u=0;u<w;)for(d=0,f=0;d<b;d++,u++,f+=2)y[u]=(y[u]*k[f]>>8)+k[f+1];return y}get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0!==this._colorTransform&&(82!==this.components[0].index||71!==this.components[1].index||66!==this.components[2].index):1===this._colorTransform}_convertYccToRgb(t){let e,s,i;for(let n=0,a=t.length;n<a;n+=3)e=t[n],s=t[n+1],i=t[n+2],t[n]=e-179.456+1.402*i,t[n+1]=e+135.459-.344*s-.714*i,t[n+2]=e-226.816+1.772*s;return t}_convertYccToRgba(t,e){for(let s=0,i=0,n=t.length;s<n;s+=3,i+=4){const n=t[s],a=t[s+1],r=t[s+2];e[i]=n-179.456+1.402*r,e[i+1]=n+135.459-.344*a-.714*r,e[i+2]=n-226.816+1.772*a,e[i+3]=255}return e}_convertYcckToRgb(t){return this._convertYcckToCmyk(t),this._convertCmykToRgb(t)}_convertYcckToRgba(t){return this._convertYcckToCmyk(t),this._convertCmykToRgba(t)}_convertYcckToCmyk(t){let e,s,i;for(let n=0,a=t.length;n<a;n+=4)e=t[n],s=t[n+1],i=t[n+2],t[n]=434.456-e-1.402*i,t[n+1]=119.541-e+.344*s+.714*i,t[n+2]=481.816-e-1.772*s;return t}_convertCmykToRgb(t){const e=t.length/4;return ni.cmyk.getRgbBuffer(t,0,e,t,0,8,0),t.subarray(0,3*e)}_convertCmykToRgba(t){if(ni.cmyk.getRgbBuffer(t,0,t.length/4,t,0,8,1),ni.cmyk instanceof qs)for(let e=3,s=t.length;e<s;e+=4)t[e]=255;return t}getData({width:t,height:e,forceRGBA:s=!1,forceRGB:i=!1,isSourcePDF:n=!1}){if(this.numComponents>4)throw new ai("Unsupported color mode");const a=this._getLinearizedBlockData(t,e,n);if(1===this.numComponents&&(s||i)){const t=a.length*(s?4:3),e=new Uint8ClampedArray(t);let i=0;if(s)!function(t,e){if(ts.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}(a,new Uint32Array(e.buffer));else for(const t of a)e[i++]=t,e[i++]=t,e[i++]=t;return e}if(3===this.numComponents&&this._isColorConversionNeeded){if(s){const t=new Uint8ClampedArray(a.length/3*4);return this._convertYccToRgba(a,t)}return this._convertYccToRgb(a)}if(4===this.numComponents){if(this._isColorConversionNeeded)return s?this._convertYcckToRgba(a):i?this._convertYcckToRgb(a):this._convertYcckToCmyk(a);if(s)return this._convertCmykToRgba(a);if(i)return this._convertCmykToRgb(a)}return a}},wi=class _JpegStream extends si{static#E=ts.isImageDecoderSupported;constructor(t,e,s){super(e),this.stream=t,this.dict=t.dict,this.maybeLength=e,this.params=s}static get canUseImageDecoder(){return shadow$1(this,"canUseImageDecoder",this.#E?ImageDecoder.isTypeSupported("image/jpeg"):Promise.resolve(!1))}static setOptions({isImageDecoderSupported:t=!1}){this.#E=t}get bytes(){return shadow$1(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(t){}readBlock(){this.decodeImage()}get jpegOptions(){const t={decodeTransform:void 0,colorTransform:void 0},e=this.dict.getArray("D","Decode");if((this.forceRGBA||this.forceRGB)&&Array.isArray(e)){const s=this.dict.get("BPC","BitsPerComponent")||8,i=e.length,n=new Int32Array(i);let a=!1;const r=(1<<s)-1;for(let t=0;t<i;t+=2)n[t]=256*(e[t+1]-e[t])|0,n[t+1]=e[t]*r|0,256===n[t]&&0===n[t+1]||(a=!0);a&&(t.decodeTransform=n)}if(this.params instanceof fs){const e=this.params.get("ColorTransform");Number.isInteger(e)&&(t.colorTransform=e)}return shadow$1(this,"jpegOptions",t)}#B(t){for(let e=0,s=t.length-1;e<s;e++)if(255===t[e]&&216===t[e+1]){e>0&&(t=t.subarray(e));break}return t}decodeImage(t){if(this.eof)return this.buffer;t=this.#B(t||this.bytes);const e=new bi(this.jpegOptions);e.parse(t);const s=e.getData({width:this.drawWidth,height:this.drawHeight,forceRGBA:this.forceRGBA,forceRGB:this.forceRGB,isSourcePDF:!0});return this.buffer=s,this.bufferLength=s.length,this.eof=!0,this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}async getTransferableImage(){if(!await _JpegStream.canUseImageDecoder)return null;const t=this.jpegOptions;if(t.decodeTransform)return null;let e;try{const s=this.canAsyncDecodeImageFromBuffer&&await this.stream.asyncGetBytes()||this.bytes;if(!s)return null;let i=this.#B(s);const n=bi.canUseImageDecoder(i,t.colorTransform);return n?(n.exifStart&&(i=i.slice(),i.fill(0,n.exifStart,n.exifEnd)),e=new ImageDecoder({data:i,type:"image/jpeg",preferAnimation:!1}),(await e.decode()).image):null}catch(t){return warn$1(`getTransferableImage - failed: "${t}".`),null}finally{e?.close()}}},yi=class extends Ve{constructor(t){super(t,"JpxError")}},xi=class{static#P=null;static#N=null;static#O=null;static#C=!0;static#L=!0;static#_=null;static setOptions({handler:t,useWasm:e,useWorkerFetch:s,wasmUrl:i}){this.#C=e,this.#L=s,this.#_=i,s||(this.#N=t)}static async#U(t){}static async#$(t,e,s){}static async decode(t,{numComponents:e=4,isIndexedColormap:s=!1,smaskInData:i=!1,reducePower:n=0}={}){const a=await this.#O;if(!a)throw new yi("OpenJPEG failed to initialize");let r;try{const o=t.length;if(r=a._malloc(o),a.writeArrayToMemory(t,r),a._jp2_decode(r,o,e>0?e:0,!!s,!!i,n)){const{errorMessages:t}=a;if(t)throw delete a.errorMessages,new yi(t);throw new yi("Unknown error")}const{imageData:l}=a;return a.imageData=null,l}finally{r&&a._free(r)}}static cleanup(){this.#O=null}static parseImageProperties(t){let e=t.getByte();for(;e>=0;){const s=e;if(e=t.getByte(),65361==(s<<8|e)){t.skip(4);const e=t.getInt32()>>>0,s=t.getInt32()>>>0,i=t.getInt32()>>>0,n=t.getInt32()>>>0;return t.skip(16),{width:e-i,height:s-n,bitsPerComponent:8,componentsCount:t.getUint16()}}}throw new yi("No size marker found in JPX stream")}};function addState(t,e,s,i,n){let a=t;for(let t=0,s=e.length-1;t<s;t++){const s=e[t];a=a[s]||=[]}a[e.at(-1)]={checkFn:s,iterateFn:i,processFn:n}}var vi=[];addState(vi,[dt,gt,Fe,ft],null,function(t,e){const s=t.fnArray,i=(e-(t.iCurr-3))%4;switch(i){case 0:return s[e]===dt;case 1:return s[e]===gt;case 2:return s[e]===Fe;case 3:return s[e]===ft}throw new Error(`iterateInlineImageGroup - invalid pos: ${i}`)},function(t,e){const s=t.fnArray,i=t.argsArray,n=t.iCurr,a=n-3,r=n-2,o=n-1,l=Math.min(Math.floor((e-a)/4),200);if(l<10)return e-(e-a)%4;let c=0;const h=[];let u=0,d=1,f=1;for(let t=0;t<l;t++){const e=i[r+(t<<2)],s=i[o+(t<<2)][0];d+s.width>1e3&&(c=Math.max(c,d),f+=u+2,d=0,u=0),h.push({transform:e,x:d,y:f,w:s.width,h:s.height}),d+=s.width+2,u=Math.max(u,s.height)}const g=Math.max(c,d)+1,p=f+u+1,m=new Uint8Array(g*p*4),b=g<<2;for(let t=0;t<l;t++){const e=i[o+(t<<2)][0].data,s=h[t].w<<2;let n=0,a=h[t].x+h[t].y*g<<2;m.set(e.subarray(0,s),a-b);for(let i=0,r=h[t].h;i<r;i++)m.set(e.subarray(n,n+s),a),n+=s,a+=b;for(m.set(e.subarray(n-s,n),a);a>=0;)e[a-4]=e[a],e[a-3]=e[a+1],e[a-2]=e[a+2],e[a-1]=e[a+3],e[a+s]=e[a+s-4],e[a+s+1]=e[a+s-3],e[a+s+2]=e[a+s-2],e[a+s+3]=e[a+s-1],a-=b}const w={width:g,height:p};if(t.isOffscreenCanvasSupported){const t=new OffscreenCanvas(g,p);t.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(m.buffer),g,p),0,0),w.bitmap=t.transferToImageBitmap(),w.data=null}else w.kind=C,w.data=m;return s.splice(a,4*l,De),i.splice(a,4*l,[w,h]),a+1}),addState(vi,[dt,gt,Te,ft],null,function(t,e){const s=t.fnArray,i=(e-(t.iCurr-3))%4;switch(i){case 0:return s[e]===dt;case 1:return s[e]===gt;case 2:return s[e]===Te;case 3:return s[e]===ft}throw new Error(`iterateImageMaskGroup - invalid pos: ${i}`)},function(t,e){const s=t.fnArray,i=t.argsArray,n=t.iCurr,a=n-3,r=n-2,o=n-1;let l=Math.floor((e-a)/4);if(l<10)return e-(e-a)%4;let c,h,u=!1;const d=i[o][0],f=i[r][0],g=i[r][1],p=i[r][2],m=i[r][3];if(g===p){u=!0,c=r+4;let t=o+4;for(let e=1;e<l;e++,c+=4,t+=4)if(h=i[c],i[t][0]!==d||h[0]!==f||h[1]!==g||h[2]!==p||h[3]!==m){e<10?u=!1:l=e;break}}if(u){l=Math.min(l,1e3);const t=new Float32Array(2*l);c=r;for(let e=0;e<l;e++,c+=4)h=i[c],t[e<<1]=h[4],t[1+(e<<1)]=h[5];s.splice(a,4*l,Be),i.splice(a,4*l,[d,f,g,p,m,t])}else{l=Math.min(l,100);const t=[];for(let e=0;e<l;e++){h=i[r+(e<<2)];const s=i[o+(e<<2)][0];t.push({data:s.data,width:s.width,height:s.height,interpolate:s.interpolate,count:s.count,transform:h})}s.splice(a,4*l,Me),i.splice(a,4*l,[t])}return a+1}),addState(vi,[dt,gt,Ee,ft],function(t){const e=t.argsArray,s=t.iCurr-2;return 0===e[s][1]&&0===e[s][2]},function(t,e){const s=t.fnArray,i=t.argsArray,n=(e-(t.iCurr-3))%4;switch(n){case 0:return s[e]===dt;case 1:if(s[e]!==gt)return!1;const n=t.iCurr-2,a=i[n][0],r=i[n][3];return i[e][0]===a&&0===i[e][1]&&0===i[e][2]&&i[e][3]===r;case 2:if(s[e]!==Ee)return!1;const o=i[t.iCurr-1][0];return i[e][0]===o;case 3:return s[e]===ft}throw new Error(`iterateImageGroup - invalid pos: ${n}`)},function(t,e){const s=t.fnArray,i=t.argsArray,n=t.iCurr,a=n-3,r=n-2,o=i[n-1][0],l=i[r][0],c=i[r][3],h=Math.min(Math.floor((e-a)/4),1e3);if(h<3)return e-(e-a)%4;const u=new Float32Array(2*h);let d=r;for(let t=0;t<h;t++,d+=4){const e=i[d];u[t<<1]=e[4],u[1+(t<<1)]=e[5]}const f=[o,l,c,u];return s.splice(a,4*h,Re),i.splice(a,4*h,f),a+1}),addState(vi,[Rt,Ut,zt,Wt,Bt],null,function(t,e){const s=t.fnArray,i=t.argsArray,n=(e-(t.iCurr-4))%5;switch(n){case 0:return s[e]===Rt;case 1:return s[e]===Ut;case 2:return s[e]===zt;case 3:if(s[e]!==Wt)return!1;const n=t.iCurr-3,a=i[n][0],r=i[n][1];return i[e][0]===a&&i[e][1]===r;case 4:return s[e]===Bt}throw new Error(`iterateShowTextGroup - invalid pos: ${n}`)},function(t,e){const s=t.fnArray,i=t.argsArray,n=t.iCurr,a=n-4,r=n-3,o=n-2,l=n-1,c=n,h=i[r][0],u=i[r][1];let d=Math.min(Math.floor((e-a)/5),1e3);if(d<3)return e-(e-a)%5;let f=a;a>=4&&s[a-4]===s[r]&&s[a-3]===s[o]&&s[a-2]===s[l]&&s[a-1]===s[c]&&i[a-4][0]===h&&i[a-4][1]===u&&(d++,f-=5);let g=f+4;for(let t=1;t<d;t++)s.splice(g,3),i.splice(g,3),g+=2;return g+1}),addState(vi,[dt,gt,Ne,ft],t=>{const e=t.argsArray,s=e[t.iCurr-1][0];if(s!==At&&s!==kt&&s!==_t&&s!==It&&s!==Tt&&s!==Mt)return!0;const i=e[t.iCurr-2];return 1===i[0]&&0===i[1]&&0===i[2]&&1===i[3]},()=>!1,(t,e)=>{const{fnArray:s,argsArray:i}=t,n=t.iCurr,a=n-3,r=n-2,o=i[n-1],l=i[r],[,[c],h]=o;if(h){ss.scaleMinMax(l,h);for(let t=0,e=c.length;t<e;)switch(c[t++]){case $e:case He:ss.applyTransform(c,l,t),t+=2;break;case je:ss.applyTransformToBezier(c,l,t),t+=6}}return s.splice(a,4,Ne),i.splice(a,4,o),a+1});var Ai=class{constructor(t){this.queue=t}_optimize(){}push(t,e){this.queue.fnArray.push(t),this.queue.argsArray.push(e),this._optimize()}flush(){}reset(){}},ki=class extends Ai{constructor(t){super(t),this.state=null,this.context={iCurr:0,fnArray:t.fnArray,argsArray:t.argsArray,isOffscreenCanvasSupported:Si.isOffscreenCanvasSupported},this.match=null,this.lastProcessed=0}_optimize(){const t=this.queue.fnArray;let e=this.lastProcessed,s=t.length,i=this.state,n=this.match;if(!i&&!n&&e+1===s&&!vi[t[e]])return void(this.lastProcessed=s);const a=this.context;for(;e<s;){if(n){if((0,n.iterateFn)(a,e)){e++;continue}if(e=(0,n.processFn)(a,e+1),s=t.length,n=null,i=null,e>=s)break}i=(i||vi)[t[e]],i&&!Array.isArray(i)?(a.iCurr=e,e++,!i.checkFn||(0,i.checkFn)(a)?(n=i,i=null):i=null):e++}this.state=i,this.match=n,this.lastProcessed=e}flush(){for(;this.match;){const t=this.queue.fnArray.length;this.lastProcessed=(0,this.match.processFn)(this.context,t),this.match=null,this.state=null,this._optimize()}}reset(){this.state=null,this.match=null,this.lastProcessed=0}},Si=class _OperatorList{static CHUNK_SIZE=1e3;static CHUNK_SIZE_ABOUT=this.CHUNK_SIZE-5;static isOffscreenCanvasSupported=!1;constructor(t=0,e){this._streamSink=e,this.fnArray=[],this.argsArray=[],this.optimizer=!e||t&f?new Ai(this):new ki(this),this.dependencies=new Set,this._totalLength=0,this.weight=0,this._resolved=e?null:Promise.resolve()}static setOptions({isOffscreenCanvasSupported:t}){this.isOffscreenCanvasSupported=t}get length(){return this.argsArray.length}get ready(){return this._resolved||this._streamSink.ready}get totalLength(){return this._totalLength+this.length}addOp(t,e){this.optimizer.push(t,e),this.weight++,this._streamSink&&(this.weight>=_OperatorList.CHUNK_SIZE||this.weight>=_OperatorList.CHUNK_SIZE_ABOUT&&(t===ft||t===Bt))&&this.flush()}addImageOps(t,e,s,i=!1){i&&(this.addOp(dt),this.addOp(ut,[[["SMask",!1]]])),void 0!==s&&this.addOp(we,["OC",s]),this.addOp(t,e),void 0!==s&&this.addOp(ye,[]),i&&this.addOp(ft)}addDependency(t){this.dependencies.has(t)||(this.dependencies.add(t),this.addOp(it,[t]))}addDependencies(t){for(const e of t)this.addDependency(e)}addOpList(t){if(t instanceof _OperatorList){for(const e of t.dependencies)this.dependencies.add(e);for(let e=0,s=t.length;e<s;e++)this.addOp(t.fnArray[e],t.argsArray[e])}else warn$1('addOpList - ignoring invalid "opList" parameter.')}getIR(){return{fnArray:this.fnArray,argsArray:this.argsArray,length:this.length}}get _transfers(){const t=[],{fnArray:e,argsArray:s,length:i}=this;for(let n=0;n<i;n++)switch(e[n]){case Fe:case De:case Te:{const{bitmap:e,data:i}=s[n][0];(e||i?.buffer)&&t.push(e||i.buffer);break}case Ne:{const[,[e],i]=s[n];e&&t.push(e.buffer,i.buffer);break}case Ae:const[e,i]=s[n];e&&t.push(e.buffer),i&&t.push(i.buffer);break;case zt:t.push(s[n][0].buffer)}return t}flush(t=!1,e=null){this.optimizer.flush();const s=this.length;this._totalLength+=s,this._streamSink.enqueue({fnArray:this.fnArray,argsArray:this.argsArray,lastChunk:t,separateAnnots:e,length:s},1,this._transfers),this.dependencies.clear(),this.fnArray.length=0,this.argsArray.length=0,this.weight=0,this.optimizer.reset()}};function hexToInt(t,e){let s=0;for(let i=0;i<=e;i++)s=s<<8|t[i];return s>>>0}function hexToStr(t,e){return 1===e?String.fromCharCode(t[0],t[1]):3===e?String.fromCharCode(t[0],t[1],t[2],t[3]):String.fromCharCode(...t.subarray(0,e+1))}function addHex(t,e,s){let i=0;for(let n=s;n>=0;n--)i+=t[n]+e[n],t[n]=255&i,i>>=8}function incHex(t,e){let s=1;for(let i=e;i>=0&&s>0;i--)s+=t[i],t[i]=255&s,s>>=8}var Ci=16,_i=class{constructor(t){this.buffer=t,this.pos=0,this.end=t.length,this.tmpBuf=new Uint8Array(19)}readByte(){return this.pos>=this.end?-1:this.buffer[this.pos++]}readNumber(){let t,e=0;do{const s=this.readByte();if(s<0)throw new Ze("unexpected EOF in bcmap");t=!(128&s),e=e<<7|127&s}while(!t);return e}readSigned(){const t=this.readNumber();return 1&t?~(t>>>1):t>>>1}readHex(t,e){t.set(this.buffer.subarray(this.pos,this.pos+e+1)),this.pos+=e+1}readHexNumber(t,e){let s;const i=this.tmpBuf;let n=0;do{const t=this.readByte();if(t<0)throw new Ze("unexpected EOF in bcmap");s=!(128&t),i[n++]=127&t}while(!s);let a=e,r=0,o=0;for(;a>=0;){for(;o<8&&i.length>0;)r|=i[--n]<<o,o+=7;t[a]=255&r,a--,r>>=8,o-=8}}readHexSigned(t,e){this.readHexNumber(t,e);const s=1&t[e]?255:0;let i=0;for(let n=0;n<=e;n++)i=(1&i)<<8|t[n],t[n]=i>>1^s}readString(){const t=this.readNumber(),e=new Array(t);for(let s=0;s<t;s++)e[s]=this.readNumber();return String.fromCharCode(...e)}},Ii=class{async process(t,e,s){const i=new _i(t),n=i.readByte();e.vertical=!!(1&n);let a=null;const r=new Uint8Array(Ci),o=new Uint8Array(Ci),l=new Uint8Array(Ci),c=new Uint8Array(Ci),h=new Uint8Array(Ci);let u,d;for(;(d=i.readByte())>=0;){const t=d>>5;if(7===t){switch(31&d){case 0:i.readString();break;case 1:a=i.readString()}continue}const s=!!(16&d),n=15&d;if(n+1>Ci)throw new Error("BinaryCMapReader.process: Invalid dataSize.");const f=1,g=i.readNumber();switch(t){case 0:i.readHex(r,n),i.readHexNumber(o,n),addHex(o,r,n),e.addCodespaceRange(n+1,hexToInt(r,n),hexToInt(o,n));for(let t=1;t<g;t++)incHex(o,n),i.readHexNumber(r,n),addHex(r,o,n),i.readHexNumber(o,n),addHex(o,r,n),e.addCodespaceRange(n+1,hexToInt(r,n),hexToInt(o,n));break;case 1:i.readHex(r,n),i.readHexNumber(o,n),addHex(o,r,n),i.readNumber();for(let t=1;t<g;t++)incHex(o,n),i.readHexNumber(r,n),addHex(r,o,n),i.readHexNumber(o,n),addHex(o,r,n),i.readNumber();break;case 2:i.readHex(l,n),u=i.readNumber(),e.mapOne(hexToInt(l,n),u);for(let t=1;t<g;t++)incHex(l,n),s||(i.readHexNumber(h,n),addHex(l,h,n)),u=i.readSigned()+(u+1),e.mapOne(hexToInt(l,n),u);break;case 3:i.readHex(r,n),i.readHexNumber(o,n),addHex(o,r,n),u=i.readNumber(),e.mapCidRange(hexToInt(r,n),hexToInt(o,n),u);for(let t=1;t<g;t++)incHex(o,n),s?r.set(o):(i.readHexNumber(r,n),addHex(r,o,n)),i.readHexNumber(o,n),addHex(o,r,n),u=i.readNumber(),e.mapCidRange(hexToInt(r,n),hexToInt(o,n),u);break;case 4:i.readHex(l,f),i.readHex(c,n),e.mapOne(hexToInt(l,f),hexToStr(c,n));for(let t=1;t<g;t++)incHex(l,f),s||(i.readHexNumber(h,f),addHex(l,h,f)),incHex(c,n),i.readHexSigned(h,n),addHex(c,h,n),e.mapOne(hexToInt(l,f),hexToStr(c,n));break;case 5:i.readHex(r,f),i.readHexNumber(o,f),addHex(o,r,f),i.readHex(c,n),e.mapBfRange(hexToInt(r,f),hexToInt(o,f),hexToStr(c,n));for(let t=1;t<g;t++)incHex(o,f),s?r.set(o):(i.readHexNumber(r,f),addHex(r,o,f)),i.readHexNumber(o,f),addHex(o,r,f),i.readHex(c,n),e.mapBfRange(hexToInt(r,f),hexToInt(o,f),hexToStr(c,n));break;default:throw new Error(`BinaryCMapReader.process - unknown type: ${t}`)}}return a?s(a):e}},Ti=class extends si{constructor(t,e){e&&(e*=.8),super(e),this.str=t,this.dict=t.dict,this.input=new Uint8Array(5)}readBlock(){const t=this.str;let e=t.getByte();for(;isWhiteSpace(e);)e=t.getByte();if(-1===e||126===e)return void(this.eof=!0);const s=this.bufferLength;let i,n;if(122===e){for(i=this.ensureBuffer(s+4),n=0;n<4;++n)i[s+n]=0;this.bufferLength+=4}else{const a=this.input;for(a[0]=e,n=1;n<5;++n){for(e=t.getByte();isWhiteSpace(e);)e=t.getByte();if(a[n]=e,-1===e||126===e)break}if(i=this.ensureBuffer(s+n-1),this.bufferLength+=n-1,n<5){for(;n<5;++n)a[n]=117;this.eof=!0}let r=0;for(n=0;n<5;++n)r=85*r+(a[n]-33);for(n=3;n>=0;--n)i[s+n]=255&r,r>>=8}}},Mi=class extends si{constructor(t,e){e&&(e*=.5),super(e),this.str=t,this.dict=t.dict,this.firstDigit=-1}readBlock(){const t=this.str.getBytes(8e3);if(!t.length)return void(this.eof=!0);const e=t.length+1>>1,s=this.ensureBuffer(this.bufferLength+e);let i=this.bufferLength,n=this.firstDigit;for(const e of t){let t;if(e>=48&&e<=57)t=15&e;else{if(!(e>=65&&e<=70||e>=97&&e<=102)){if(62===e){this.eof=!0;break}continue}t=9+(15&e)}n<0?n=t:(s[i++]=n<<4|t,n=-1)}n>=0&&this.eof&&(s[i++]=n<<4,n=-1),this.firstDigit=n,this.bufferLength=i}},Ei=-1,Fi=[[-1,-1],[-1,-1],[7,8],[7,7],[6,6],[6,6],[6,5],[6,5],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2]],Di=[[-1,-1],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[12,1984],[12,2048],[12,2112],[12,2176],[12,2240],[12,2304],[11,1856],[11,1856],[11,1920],[11,1920],[12,2368],[12,2432],[12,2496],[12,2560]],Ri=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[8,29],[8,29],[8,30],[8,30],[8,45],[8,45],[8,46],[8,46],[7,22],[7,22],[7,22],[7,22],[7,23],[7,23],[7,23],[7,23],[8,47],[8,47],[8,48],[8,48],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[7,20],[7,20],[7,20],[7,20],[8,33],[8,33],[8,34],[8,34],[8,35],[8,35],[8,36],[8,36],[8,37],[8,37],[8,38],[8,38],[7,19],[7,19],[7,19],[7,19],[8,31],[8,31],[8,32],[8,32],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[8,53],[8,53],[8,54],[8,54],[7,26],[7,26],[7,26],[7,26],[8,39],[8,39],[8,40],[8,40],[8,41],[8,41],[8,42],[8,42],[8,43],[8,43],[8,44],[8,44],[7,21],[7,21],[7,21],[7,21],[7,28],[7,28],[7,28],[7,28],[8,61],[8,61],[8,62],[8,62],[8,63],[8,63],[8,0],[8,0],[8,320],[8,320],[8,384],[8,384],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[7,27],[7,27],[7,27],[7,27],[8,59],[8,59],[8,60],[8,60],[9,1472],[9,1536],[9,1600],[9,1728],[7,18],[7,18],[7,18],[7,18],[7,24],[7,24],[7,24],[7,24],[8,49],[8,49],[8,50],[8,50],[8,51],[8,51],[8,52],[8,52],[7,25],[7,25],[7,25],[7,25],[8,55],[8,55],[8,56],[8,56],[8,57],[8,57],[8,58],[8,58],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[8,448],[8,448],[8,512],[8,512],[9,704],[9,768],[8,640],[8,640],[8,576],[8,576],[9,832],[9,896],[9,960],[9,1024],[9,1088],[9,1152],[9,1216],[9,1280],[9,1344],[9,1408],[7,256],[7,256],[7,256],[7,256],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7]],Bi=[[-1,-1],[-1,-1],[12,-2],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[11,1792],[11,1792],[12,1984],[12,1984],[12,2048],[12,2048],[12,2112],[12,2112],[12,2176],[12,2176],[12,2240],[12,2240],[12,2304],[12,2304],[11,1856],[11,1856],[11,1856],[11,1856],[11,1920],[11,1920],[11,1920],[11,1920],[12,2368],[12,2368],[12,2432],[12,2432],[12,2496],[12,2496],[12,2560],[12,2560],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[12,52],[12,52],[13,640],[13,704],[13,768],[13,832],[12,55],[12,55],[12,56],[12,56],[13,1280],[13,1344],[13,1408],[13,1472],[12,59],[12,59],[12,60],[12,60],[13,1536],[13,1600],[11,24],[11,24],[11,24],[11,24],[11,25],[11,25],[11,25],[11,25],[13,1664],[13,1728],[12,320],[12,320],[12,384],[12,384],[12,448],[12,448],[13,512],[13,576],[12,53],[12,53],[12,54],[12,54],[13,896],[13,960],[13,1024],[13,1088],[13,1152],[13,1216],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64]],Pi=[[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[11,23],[11,23],[12,50],[12,51],[12,44],[12,45],[12,46],[12,47],[12,57],[12,58],[12,61],[12,256],[10,16],[10,16],[10,16],[10,16],[10,17],[10,17],[10,17],[10,17],[12,48],[12,49],[12,62],[12,63],[12,30],[12,31],[12,32],[12,33],[12,40],[12,41],[11,22],[11,22],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[12,128],[12,192],[12,26],[12,27],[12,28],[12,29],[11,19],[11,19],[11,20],[11,20],[12,34],[12,35],[12,36],[12,37],[12,38],[12,39],[11,21],[11,21],[12,42],[12,43],[10,0],[10,0],[10,0],[10,0],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12]],Ni=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[6,9],[6,8],[5,7],[5,7],[4,6],[4,6],[4,6],[4,6],[4,5],[4,5],[4,5],[4,5],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2]],Oi=class{constructor(t,e={}){if("function"!=typeof t?.next)throw new Error('CCITTFaxDecoder - invalid "source" parameter.');let s;for(this.source=t,this.eof=!1,this.encoding=e.K||0,this.eoline=e.EndOfLine||!1,this.byteAlign=e.EncodedByteAlign||!1,this.columns=e.Columns||1728,this.rows=e.Rows||0,this.eoblock=e.EndOfBlock??!0,this.black=e.BlackIs1||!1,this.codingLine=new Uint32Array(this.columns+1),this.refLine=new Uint32Array(this.columns+2),this.codingLine[0]=this.columns,this.codingPos=0,this.row=0,this.nextLine2D=this.encoding<0,this.inputBits=0,this.inputBuf=0,this.outputBits=0,this.rowsDone=!1;0===(s=this._lookBits(12));)this._eatBits(1);1===s&&this._eatBits(12),this.encoding>0&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1))}readNextChar(){if(this.eof)return-1;const t=this.refLine,e=this.codingLine,s=this.columns;let i,n,a,r,o;if(0===this.outputBits){if(this.rowsDone&&(this.eof=!0),this.eof)return-1;let a,o,l;if(this.err=!1,this.nextLine2D){for(r=0;e[r]<s;++r)t[r]=e[r];for(t[r++]=s,t[r]=s,e[0]=0,this.codingPos=0,i=0,n=0;e[this.codingPos]<s;)switch(a=this._getTwoDimCode(),a){case 0:this._addPixels(t[i+1],n),t[i+1]<s&&(i+=2);break;case 1:if(a=o=0,n){do{a+=l=this._getBlackCode()}while(l>=64);do{o+=l=this._getWhiteCode()}while(l>=64)}else{do{a+=l=this._getWhiteCode()}while(l>=64);do{o+=l=this._getBlackCode()}while(l>=64)}for(this._addPixels(e[this.codingPos]+a,n),e[this.codingPos]<s&&this._addPixels(e[this.codingPos]+o,1^n);t[i]<=e[this.codingPos]&&t[i]<s;)i+=2;break;case 7:if(this._addPixels(t[i]+3,n),n^=1,e[this.codingPos]<s)for(++i;t[i]<=e[this.codingPos]&&t[i]<s;)i+=2;break;case 5:if(this._addPixels(t[i]+2,n),n^=1,e[this.codingPos]<s)for(++i;t[i]<=e[this.codingPos]&&t[i]<s;)i+=2;break;case 3:if(this._addPixels(t[i]+1,n),n^=1,e[this.codingPos]<s)for(++i;t[i]<=e[this.codingPos]&&t[i]<s;)i+=2;break;case 2:if(this._addPixels(t[i],n),n^=1,e[this.codingPos]<s)for(++i;t[i]<=e[this.codingPos]&&t[i]<s;)i+=2;break;case 8:if(this._addPixelsNeg(t[i]-3,n),n^=1,e[this.codingPos]<s)for(i>0?--i:++i;t[i]<=e[this.codingPos]&&t[i]<s;)i+=2;break;case 6:if(this._addPixelsNeg(t[i]-2,n),n^=1,e[this.codingPos]<s)for(i>0?--i:++i;t[i]<=e[this.codingPos]&&t[i]<s;)i+=2;break;case 4:if(this._addPixelsNeg(t[i]-1,n),n^=1,e[this.codingPos]<s)for(i>0?--i:++i;t[i]<=e[this.codingPos]&&t[i]<s;)i+=2;break;case Ei:this._addPixels(s,0),this.eof=!0;break;default:info$1("bad 2d code"),this._addPixels(s,0),this.err=!0}}else for(e[0]=0,this.codingPos=0,n=0;e[this.codingPos]<s;){if(a=0,n)do{a+=l=this._getBlackCode()}while(l>=64);else do{a+=l=this._getWhiteCode()}while(l>=64);this._addPixels(e[this.codingPos]+a,n),n^=1}let c=!1;if(this.byteAlign&&(this.inputBits&=-8),this.eoblock||this.row!==this.rows-1){if(a=this._lookBits(12),this.eoline)for(;a!==Ei&&1!==a;)this._eatBits(1),a=this._lookBits(12);else for(;0===a;)this._eatBits(1),a=this._lookBits(12);1===a?(this._eatBits(12),c=!0):a===Ei&&(this.eof=!0)}else this.rowsDone=!0;if(!this.eof&&this.encoding>0&&!this.rowsDone&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1)),this.eoblock&&c&&this.byteAlign){if(a=this._lookBits(12),1===a){if(this._eatBits(12),this.encoding>0&&(this._lookBits(1),this._eatBits(1)),this.encoding>=0)for(r=0;r<4;++r)a=this._lookBits(12),1!==a&&info$1("bad rtc code: "+a),this._eatBits(12),this.encoding>0&&(this._lookBits(1),this._eatBits(1));this.eof=!0}}else if(this.err&&this.eoline){for(;;){if(a=this._lookBits(13),a===Ei)return this.eof=!0,-1;if(a>>1==1)break;this._eatBits(1)}this._eatBits(12),this.encoding>0&&(this._eatBits(1),this.nextLine2D=!(1&a))}this.outputBits=e[0]>0?e[this.codingPos=0]:e[this.codingPos=1],this.row++}if(this.outputBits>=8)o=1&this.codingPos?0:255,this.outputBits-=8,0===this.outputBits&&e[this.codingPos]<s&&(this.codingPos++,this.outputBits=e[this.codingPos]-e[this.codingPos-1]);else{a=8,o=0;do{if("number"!=typeof this.outputBits)throw new Ze('Invalid /CCITTFaxDecode data, "outputBits" must be a number.');this.outputBits>a?(o<<=a,1&this.codingPos||(o|=255>>8-a),this.outputBits-=a,a=0):(o<<=this.outputBits,1&this.codingPos||(o|=255>>8-this.outputBits),a-=this.outputBits,this.outputBits=0,e[this.codingPos]<s?(this.codingPos++,this.outputBits=e[this.codingPos]-e[this.codingPos-1]):a>0&&(o<<=a,a=0))}while(a)}return this.black&&(o^=255),o}_addPixels(t,e){const s=this.codingLine;let i=this.codingPos;t>s[i]&&(t>this.columns&&(info$1("row is wrong length"),this.err=!0,t=this.columns),1&i^e&&++i,s[i]=t),this.codingPos=i}_addPixelsNeg(t,e){const s=this.codingLine;let i=this.codingPos;if(t>s[i])t>this.columns&&(info$1("row is wrong length"),this.err=!0,t=this.columns),1&i^e&&++i,s[i]=t;else if(t<s[i]){for(t<0&&(info$1("invalid code"),this.err=!0,t=0);i>0&&t<s[i-1];)--i;s[i]=t}this.codingPos=i}_findTableCode(t,e,s,i){const n=i||0;for(let i=t;i<=e;++i){let t=this._lookBits(i);if(t===Ei)return[!0,1,!1];if(i<e&&(t<<=e-i),!n||t>=n){const e=s[t-n];if(e[0]===i)return this._eatBits(i),[!0,e[1],!0]}}return[!1,0,!1]}_getTwoDimCode(){let t,e=0;if(this.eoblock){if(e=this._lookBits(7),t=Fi[e],t?.[0]>0)return this._eatBits(t[0]),t[1]}else{const t=this._findTableCode(1,7,Fi);if(t[0]&&t[2])return t[1]}return info$1("Bad two dim code"),Ei}_getWhiteCode(){let t,e=0;if(this.eoblock){if(e=this._lookBits(12),e===Ei)return 1;if(t=e>>5?Ri[e>>3]:Di[e],t[0]>0)return this._eatBits(t[0]),t[1]}else{let t=this._findTableCode(1,9,Ri);if(t[0])return t[1];if(t=this._findTableCode(11,12,Di),t[0])return t[1]}return info$1("bad white code"),this._eatBits(1),1}_getBlackCode(){let t,e;if(this.eoblock){if(t=this._lookBits(13),t===Ei)return 1;if(e=t>>7?!(t>>9)&&t>>7?Pi[(t>>1)-64]:Ni[t>>7]:Bi[t],e[0]>0)return this._eatBits(e[0]),e[1]}else{let t=this._findTableCode(2,6,Ni);if(t[0])return t[1];if(t=this._findTableCode(7,12,Pi,64),t[0])return t[1];if(t=this._findTableCode(10,13,Bi),t[0])return t[1]}return info$1("bad black code"),this._eatBits(1),1}_lookBits(t){let e;for(;this.inputBits<t;){if(-1===(e=this.source.next()))return 0===this.inputBits?Ei:this.inputBuf<<t-this.inputBits&65535>>16-t;this.inputBuf=this.inputBuf<<8|e,this.inputBits+=8}return this.inputBuf>>this.inputBits-t&65535>>16-t}_eatBits(t){(this.inputBits-=t)<0&&(this.inputBits=0)}},Li=class extends si{constructor(t,e,s){super(e),this.str=t,this.dict=t.dict,s instanceof fs||(s=fs.empty);const i={next:()=>t.getByte()};this.ccittFaxDecoder=new Oi(i,{K:s.get("K"),EndOfLine:s.get("EndOfLine"),EncodedByteAlign:s.get("EncodedByteAlign"),Columns:s.get("Columns"),Rows:s.get("Rows"),EndOfBlock:s.get("EndOfBlock"),BlackIs1:s.get("BlackIs1")})}readBlock(){for(;!this.eof;){const t=this.ccittFaxDecoder.readNextChar();if(-1===t)return void(this.eof=!0);this.ensureBuffer(this.bufferLength+1),this.buffer[this.bufferLength++]=t}}},Ui=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$i=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),Hi=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),ji=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],qi=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5],zi=class extends si{constructor(t,e){super(e),this.str=t,this.dict=t.dict;const s=t.getByte(),i=t.getByte();if(-1===s||-1===i)throw new Ze(`Invalid header in flate stream: ${s}, ${i}`);if(8!=(15&s))throw new Ze(`Unknown compression method in flate stream: ${s}, ${i}`);if(((s<<8)+i)%31!=0)throw new Ze(`Bad FCHECK in flate stream: ${s}, ${i}`);if(32&i)throw new Ze(`FDICT bit set in flate stream: ${s}, ${i}`);this.codeSize=0,this.codeBuf=0}async getImageData(t,e){const s=await this.asyncGetBytes();return s?s.length<=t?s:s.subarray(0,t):this.getBytes(t)}async asyncGetBytes(){this.str.reset();const t=this.str.getBytes();try{const{readable:e,writable:s}=new DecompressionStream("deflate"),i=s.getWriter();await i.ready,i.write(t).then(async()=>{await i.ready,await i.close()}).catch(()=>{});const n=[];let a=0;for await(const t of e)n.push(t),a+=t.byteLength;const r=new Uint8Array(a);let o=0;for(const t of n)r.set(t,o),o+=t.byteLength;return r}catch{return this.str=new Ks(t,2,t.length,this.str.dict),this.reset(),null}}get isAsync(){return!0}getBits(t){const e=this.str;let s,i=this.codeSize,n=this.codeBuf;for(;i<t;){if(-1===(s=e.getByte()))throw new Ze("Bad encoding in flate stream");n|=s<<i,i+=8}return s=n&(1<<t)-1,this.codeBuf=n>>t,this.codeSize=i-=t,s}getCode(t){const e=this.str,s=t[0],i=t[1];let n,a=this.codeSize,r=this.codeBuf;for(;a<i&&-1!==(n=e.getByte());)r|=n<<a,a+=8;const o=s[r&(1<<i)-1],l=o>>16,c=65535&o;if(l<1||a<l)throw new Ze("Bad encoding in flate stream");return this.codeBuf=r>>l,this.codeSize=a-l,c}generateHuffmanTable(t){const e=t.length;let s,i=0;for(s=0;s<e;++s)t[s]>i&&(i=t[s]);const n=1<<i,a=new Int32Array(n);for(let r=1,o=0,l=2;r<=i;++r,o<<=1,l<<=1)for(let i=0;i<e;++i)if(t[i]===r){let t=0,e=o;for(s=0;s<r;++s)t=t<<1|1&e,e>>=1;for(s=t;s<n;s+=l)a[s]=r<<16|i;++o}return[a,i]}#H(t){info$1(t),this.eof=!0}readBlock(){let t,e,s;const i=this.str;try{e=this.getBits(3)}catch(t){return void this.#H(t.message)}if(1&e&&(this.eof=!0),e>>=1,0===e){let e;if(-1===(e=i.getByte()))return void this.#H("Bad block header in flate stream");let s=e;if(-1===(e=i.getByte()))return void this.#H("Bad block header in flate stream");if(s|=e<<8,-1===(e=i.getByte()))return void this.#H("Bad block header in flate stream");let n=e;if(-1===(e=i.getByte()))return void this.#H("Bad block header in flate stream");if(n|=e<<8,n!==(65535&~s)&&(0!==s||0!==n))throw new Ze("Bad uncompressed block length in flate stream");this.codeBuf=0,this.codeSize=0;const a=this.bufferLength,r=a+s;if(t=this.ensureBuffer(r),this.bufferLength=r,0===s)-1===i.peekByte()&&(this.eof=!0);else{const e=i.getBytes(s);t.set(e,a),e.length<s&&(this.eof=!0)}return}let n,a;if(1===e)n=ji,a=qi;else{if(2!==e)throw new Ze("Unknown block type in flate stream");{const t=this.getBits(5)+257,e=this.getBits(5)+1,i=this.getBits(4)+4,r=new Uint8Array(Ui.length);let o;for(o=0;o<i;++o)r[Ui[o]]=this.getBits(3);const l=this.generateHuffmanTable(r);s=0,o=0;const c=t+e,h=new Uint8Array(c);let u,d,f;for(;o<c;){const t=this.getCode(l);if(16===t)u=2,d=3,f=s;else if(17===t)u=3,d=3,f=s=0;else{if(18!==t){h[o++]=s=t;continue}u=7,d=11,f=s=0}let e=this.getBits(u)+d;for(;e-- >0;)h[o++]=f}n=this.generateHuffmanTable(h.subarray(0,t)),a=this.generateHuffmanTable(h.subarray(t,c))}}t=this.buffer;let r=t?t.length:0,o=this.bufferLength;for(;;){let e=this.getCode(n);if(e<256){o+1>=r&&(t=this.ensureBuffer(o+1),r=t.length),t[o++]=e;continue}if(256===e)return void(this.bufferLength=o);e-=257,e=$i[e];let i=e>>16;i>0&&(i=this.getBits(i)),s=(65535&e)+i,e=this.getCode(a),e=Hi[e],i=e>>16,i>0&&(i=this.getBits(i));const l=(65535&e)+i;o+s>=r&&(t=this.ensureBuffer(o+s),r=t.length);for(let e=0;e<s;++e,++o)t[o]=t[o-l]}}},Gi=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}],Wi=class{constructor(t,e,s){this.data=t,this.bp=e,this.dataEnd=s,this.chigh=t[e],this.clow=0,this.byteIn(),this.chigh=this.chigh<<7&65535|this.clow>>9&127,this.clow=this.clow<<7&65535,this.ct-=7,this.a=32768}byteIn(){const t=this.data;let e=this.bp;255===t[e]?t[e+1]>143?(this.clow+=65280,this.ct=8):(e++,this.clow+=t[e]<<9,this.ct=7,this.bp=e):(e++,this.clow+=e<this.dataEnd?t[e]<<8:65280,this.ct=8,this.bp=e),this.clow>65535&&(this.chigh+=this.clow>>16,this.clow&=65535)}readBit(t,e){let s=t[e]>>1,i=1&t[e];const n=Gi[s],a=n.qe;let r,o=this.a-a;if(this.chigh<a)o<a?(o=a,r=i,s=n.nmps):(o=a,r=1^i,1===n.switchFlag&&(i=r),s=n.nlps);else{if(this.chigh-=a,32768&o)return this.a=o,i;o<a?(r=1^i,1===n.switchFlag&&(i=r),s=n.nlps):(r=i,s=n.nmps)}do{0===this.ct&&this.byteIn(),o<<=1,this.chigh=this.chigh<<1&65535|this.clow>>15&1,this.clow=this.clow<<1&65535,this.ct--}while(!(32768&o));return this.a=o,t[e]=s<<1|i,r}},Vi=class extends Ve{constructor(t){super(t,"Jbig2Error")}},Xi=class{getContexts(t){return t in this?this[t]:this[t]=new Int8Array(65536)}},Ki=class{constructor(t,e,s){this.data=t,this.start=e,this.end=s}get decoder(){return shadow$1(this,"decoder",new Wi(this.data,this.start,this.end))}get contextCache(){return shadow$1(this,"contextCache",new Xi)}};function decodeInteger(t,e,s){const i=t.getContexts(e);let n=1;function readBits(t){let e=0;for(let a=0;a<t;a++){const t=s.readBit(i,n);n=n<256?n<<1|t:511&(n<<1|t)|256,e=e<<1|t}return e>>>0}const a=readBits(1),r=readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(32)+4436:readBits(12)+340:readBits(8)+84:readBits(6)+20:readBits(4)+4:readBits(2);let o;return 0===a?o=r:r>0&&(o=-r),o>=-2147483648&&o<=ys?o:null}function decodeIAID(t,e,s){const i=t.getContexts("IAID");let n=1;for(let t=0;t<s;t++)n=n<<1|e.readBit(i,n);return s<31?n&(1<<s)-1:2147483647&n}var Yi=["SymbolDictionary",null,null,null,"IntermediateTextRegion",null,"ImmediateTextRegion","ImmediateLosslessTextRegion",null,null,null,null,null,null,null,null,"PatternDictionary",null,null,null,"IntermediateHalftoneRegion",null,"ImmediateHalftoneRegion","ImmediateLosslessHalftoneRegion",null,null,null,null,null,null,null,null,null,null,null,null,"IntermediateGenericRegion",null,"ImmediateGenericRegion","ImmediateLosslessGenericRegion","IntermediateGenericRefinementRegion",null,"ImmediateGenericRefinementRegion","ImmediateLosslessGenericRefinementRegion",null,null,null,null,"PageInformation","EndOfPage","EndOfStripe","EndOfFile","Profiles","Tables",null,null,null,null,null,null,null,null,"Extension"],Ji=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-2,y:0},{x:-1,y:0}],[{x:-3,y:-1},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}]],Zi=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],Qi=[39717,1941,229,405];function decodeBitmap(t,e,s,i,n,a,r,o){if(t)return decodeMMRBitmap(new on(o.data,o.start,o.end),e,s,!1);if(0===i&&!n&&4===r.length&&3===r[0].x&&-1===r[0].y&&-3===r[1].x&&-1===r[1].y&&2===r[2].x&&-2===r[2].y&&-2===r[3].x&&-2===r[3].y)return function(t,e,s){const i=s.decoder,n=s.contextCache.getContexts("GB"),a=[];let r,o,l,c,h,u,d;for(o=0;o<e;o++)for(h=a[o]=new Uint8Array(t),u=o<1?h:a[o-1],d=o<2?h:a[o-2],r=d[0]<<13|d[1]<<12|d[2]<<11|u[0]<<7|u[1]<<6|u[2]<<5|u[3]<<4,l=0;l<t;l++)h[l]=c=i.readBit(n,r),r=(31735&r)<<1|(l+3<t?d[l+3]<<11:0)|(l+4<t?u[l+4]<<4:0)|c;return a}(e,s,o);const l=Ji[i].concat(r);l.sort((t,e)=>t.y-e.y||t.x-e.x);const c=l.length,h=new Int8Array(c),u=new Int8Array(c),d=[];let f,g,p=0,m=0,b=0,w=0;for(g=0;g<c;g++)h[g]=l[g].x,u[g]=l[g].y,m=Math.min(m,l[g].x),b=Math.max(b,l[g].x),w=Math.min(w,l[g].y),g<c-1&&l[g].y===l[g+1].y&&l[g].x===l[g+1].x-1?p|=1<<c-1-g:d.push(g);const y=d.length,x=new Int8Array(y),v=new Int8Array(y),A=new Uint16Array(y);for(f=0;f<y;f++)g=d[f],x[f]=l[g].x,v[f]=l[g].y,A[f]=1<<c-1-g;const k=-m,S=-w,C=e-b,_=Qi[i];let I=new Uint8Array(e);const T=[],M=o.decoder,E=o.contextCache.getContexts("GB");let F,D,R,B,P,N=0,O=0;for(let t=0;t<s;t++)if(n&&(N^=M.readBit(E,_),N))T.push(I);else for(I=new Uint8Array(I),T.push(I),F=0;F<e;F++){if(F>=k&&F<C&&t>=S)for(O=O<<1&p,g=0;g<y;g++)D=t+v[g],R=F+x[g],B=T[D][R],B&&(B=A[g],O|=B);else for(O=0,P=c-1,g=0;g<c;g++,P--)R=F+h[g],R>=0&&R<e&&(D=t+u[g],D>=0&&(B=T[D][R],B&&(O|=B<<P)));const s=M.readBit(E,O);I[F]=s}return T}function decodeRefinement(t,e,s,i,n,a,r,o,l){let c=Zi[s].coding;0===s&&(c=c.concat([o[0]]));const h=c.length,u=new Int32Array(h),d=new Int32Array(h);let f;for(f=0;f<h;f++)u[f]=c[f].x,d[f]=c[f].y;let g=Zi[s].reference;0===s&&(g=g.concat([o[1]]));const p=g.length,m=new Int32Array(p),b=new Int32Array(p);for(f=0;f<p;f++)m[f]=g[f].x,b[f]=g[f].y;const w=i[0].length,y=i.length,x=[],v=l.decoder,A=l.contextCache.getContexts("GR");for(let s=0;s<e;s++){const e=new Uint8Array(t);x.push(e);for(let r=0;r<t;r++){let o,l,c=0;for(f=0;f<h;f++)o=s+d[f],l=r+u[f],o<0||l<0||l>=t?c<<=1:c=c<<1|x[o][l];for(f=0;f<p;f++)o=s+b[f]-a,l=r+m[f]-n,o<0||o>=y||l<0||l>=w?c<<=1:c=c<<1|i[o][l];const g=v.readBit(A,c);e[r]=g}}return x}function decodeTextRegion(t,e,s,i,n,a,r,o,l,c,h,u,d,f,g,p,m,b,w){if(t&&e)throw new Vi("refinement with Huffman is not supported");const y=[];let x,v;for(x=0;x<i;x++)v=new Uint8Array(s),n&&v.fill(n),y.push(v);const A=m.decoder,k=m.contextCache;let S=t?-f.tableDeltaT.decode(w):-decodeInteger(k,"IADT",A),C=0;for(x=0;x<a;){S+=t?f.tableDeltaT.decode(w):decodeInteger(k,"IADT",A),C+=t?f.tableFirstS.decode(w):decodeInteger(k,"IAFS",A);let i=C;for(;;){let n=0;r>1&&(n=t?w.readBits(b):decodeInteger(k,"IAIT",A));const a=r*S+n,C=t?f.symbolIDTable.decode(w):decodeIAID(k,A,l),_=e&&(t?w.readBit():decodeInteger(k,"IARI",A));let I=o[C],T=I[0].length,M=I.length;if(_){const t=decodeInteger(k,"IARDW",A),e=decodeInteger(k,"IARDH",A);T+=t,M+=e,I=decodeRefinement(T,M,g,I,(t>>1)+decodeInteger(k,"IARDX",A),(e>>1)+decodeInteger(k,"IARDY",A),0,p,m)}let E=0;c?1&u?E=M-1:i+=M-1:u>1?i+=T-1:E=T-1;const F=a-(1&u?0:M-1),D=i-(2&u?T-1:0);let R,B,P;if(c)for(R=0;R<M;R++){if(v=y[D+R],!v)continue;P=I[R];const t=Math.min(s-F,T);switch(d){case 0:for(B=0;B<t;B++)v[F+B]|=P[B];break;case 2:for(B=0;B<t;B++)v[F+B]^=P[B];break;default:throw new Vi(`operator ${d} is not supported`)}}else for(B=0;B<M;B++)if(v=y[F+B],v)switch(P=I[B],d){case 0:for(R=0;R<T;R++)v[D+R]|=P[R];break;case 2:for(R=0;R<T;R++)v[D+R]^=P[R];break;default:throw new Vi(`operator ${d} is not supported`)}x++;const N=t?f.tableDeltaS.decode(w):decodeInteger(k,"IADS",A);if(null===N)break;i+=E+N+h}}return y}function readSegmentHeader(t,e){const s={};s.number=readUint32(t,e);const i=t[e+4],n=63&i;if(!Yi[n])throw new Vi("invalid segment type: "+n);s.type=n,s.typeName=Yi[n],s.deferredNonRetain=!!(128&i);const a=!!(64&i),r=t[e+5];let o=r>>5&7;const l=[31&r];let c=e+6;if(7===r){o=536870911&readUint32(t,c-1),c+=3;let e=o+7>>3;for(l[0]=t[c++];--e>0;)l.push(t[c++])}else if(5===r||6===r)throw new Vi("invalid referred-to flags");s.retainBits=l;let h=4;s.number<=256?h=1:s.number<=65536&&(h=2);const u=[];let d,f;for(d=0;d<o;d++){let e;e=1===h?t[c]:2===h?readUint16(t,c):readUint32(t,c),u.push(e),c+=h}if(s.referredTo=u,a?(s.pageAssociation=readUint32(t,c),c+=4):s.pageAssociation=t[c++],s.length=readUint32(t,c),c+=4,4294967295===s.length){if(38!==n)throw new Vi("invalid unknown segment length");{const e=readRegionSegmentInformation(t,c),i=!!(1&t[c+tn]),n=6,a=new Uint8Array(n);for(i||(a[0]=255,a[1]=172),a[2]=e.height>>>24&255,a[3]=e.height>>16&255,a[4]=e.height>>8&255,a[5]=255&e.height,d=c,f=t.length;d<f;d++){let e=0;for(;e<n&&a[e]===t[d+e];)e++;if(e===n){s.length=d+n;break}}if(4294967295===s.length)throw new Vi("segment end was not found")}}return s.headerEnd=c,s}function readSegments(t,e,s,i){const n=[];let a=s;for(;a<i;){const s=readSegmentHeader(e,a);a=s.headerEnd;const i={header:s,data:e};if(t.randomAccess||(i.start=a,a+=s.length,i.end=a),n.push(i),51===s.type)break}if(t.randomAccess)for(let t=0,e=n.length;t<e;t++)n[t].start=a,a+=n[t].header.length,n[t].end=a;return n}function readRegionSegmentInformation(t,e){return{width:readUint32(t,e),height:readUint32(t,e+4),x:readUint32(t,e+8),y:readUint32(t,e+12),combinationOperator:7&t[e+16]}}var tn=17;function processSegment(t,e){const s=t.header,i=t.data,n=t.end;let a,r,o,l,c=t.start;switch(s.type){case 0:const t={},e=readUint16(i,c);if(t.huffman=!!(1&e),t.refinement=!!(2&e),t.huffmanDHSelector=e>>2&3,t.huffmanDWSelector=e>>4&3,t.bitmapSizeSelector=e>>6&1,t.aggregationInstancesSelector=e>>7&1,t.bitmapCodingContextUsed=!!(256&e),t.bitmapCodingContextRetained=!!(512&e),t.template=e>>10&3,t.refinementTemplate=e>>12&1,c+=2,!t.huffman){for(l=0===t.template?4:1,r=[],o=0;o<l;o++)r.push({x:readInt8(i,c),y:readInt8(i,c+1)}),c+=2;t.at=r}if(t.refinement&&!t.refinementTemplate){for(r=[],o=0;o<2;o++)r.push({x:readInt8(i,c),y:readInt8(i,c+1)}),c+=2;t.refinementAt=r}t.numberOfExportedSymbols=readUint32(i,c),c+=4,t.numberOfNewSymbols=readUint32(i,c),c+=4,a=[t,s.number,s.referredTo,i,c,n];break;case 6:case 7:const h={};h.info=readRegionSegmentInformation(i,c),c+=tn;const u=readUint16(i,c);if(c+=2,h.huffman=!!(1&u),h.refinement=!!(2&u),h.logStripSize=u>>2&3,h.stripSize=1<<h.logStripSize,h.referenceCorner=u>>4&3,h.transposed=!!(64&u),h.combinationOperator=u>>7&3,h.defaultPixelValue=u>>9&1,h.dsOffset=u<<17>>27,h.refinementTemplate=u>>15&1,h.huffman){const t=readUint16(i,c);c+=2,h.huffmanFS=3&t,h.huffmanDS=t>>2&3,h.huffmanDT=t>>4&3,h.huffmanRefinementDW=t>>6&3,h.huffmanRefinementDH=t>>8&3,h.huffmanRefinementDX=t>>10&3,h.huffmanRefinementDY=t>>12&3,h.huffmanRefinementSizeSelector=!!(16384&t)}if(h.refinement&&!h.refinementTemplate){for(r=[],o=0;o<2;o++)r.push({x:readInt8(i,c),y:readInt8(i,c+1)}),c+=2;h.refinementAt=r}h.numberOfSymbolInstances=readUint32(i,c),c+=4,a=[h,s.referredTo,i,c,n];break;case 16:const d={},f=i[c++];d.mmr=!!(1&f),d.template=f>>1&3,d.patternWidth=i[c++],d.patternHeight=i[c++],d.maxPatternIndex=readUint32(i,c),c+=4,a=[d,s.number,i,c,n];break;case 22:case 23:const g={};g.info=readRegionSegmentInformation(i,c),c+=tn;const p=i[c++];g.mmr=!!(1&p),g.template=p>>1&3,g.enableSkip=!!(8&p),g.combinationOperator=p>>4&7,g.defaultPixelValue=p>>7&1,g.gridWidth=readUint32(i,c),c+=4,g.gridHeight=readUint32(i,c),c+=4,g.gridOffsetX=4294967295&readUint32(i,c),c+=4,g.gridOffsetY=4294967295&readUint32(i,c),c+=4,g.gridVectorX=readUint16(i,c),c+=2,g.gridVectorY=readUint16(i,c),c+=2,a=[g,s.referredTo,i,c,n];break;case 38:case 39:const m={};m.info=readRegionSegmentInformation(i,c),c+=tn;const b=i[c++];if(m.mmr=!!(1&b),m.template=b>>1&3,m.prediction=!!(8&b),!m.mmr){for(l=0===m.template?4:1,r=[],o=0;o<l;o++)r.push({x:readInt8(i,c),y:readInt8(i,c+1)}),c+=2;m.at=r}a=[m,i,c,n];break;case 48:const w={width:readUint32(i,c),height:readUint32(i,c+4),resolutionX:readUint32(i,c+8),resolutionY:readUint32(i,c+12)};4294967295===w.height&&delete w.height;const y=i[c+16];readUint16(i,c+17),w.lossless=!!(1&y),w.refinement=!!(2&y),w.defaultPixelValue=y>>2&1,w.combinationOperator=y>>3&3,w.requiresBuffer=!!(32&y),w.combinationOperatorOverride=!!(64&y),a=[w];break;case 49:case 50:case 51:case 62:break;case 53:a=[s.number,i,c,n];break;default:throw new Vi(`segment type ${s.typeName}(${s.type}) is not implemented`)}const h="on"+s.typeName;h in e&&e[h].apply(e,a)}function processSegments(t,e){for(let s=0,i=t.length;s<i;s++)processSegment(t[s],e)}var en=class{onPageInformation(t){this.currentPageInfo=t;const e=t.width+7>>3,s=new Uint8ClampedArray(e*t.height);t.defaultPixelValue&&s.fill(255),this.buffer=s}drawBitmap(t,e){const s=this.currentPageInfo,i=t.width,n=t.height,a=s.width+7>>3,r=s.combinationOperatorOverride?t.combinationOperator:s.combinationOperator,o=this.buffer,l=128>>(7&t.x);let c,h,u,d,f=t.y*a+(t.x>>3);switch(r){case 0:for(c=0;c<n;c++){for(u=l,d=f,h=0;h<i;h++)e[c][h]&&(o[d]|=u),u>>=1,u||(u=128,d++);f+=a}break;case 2:for(c=0;c<n;c++){for(u=l,d=f,h=0;h<i;h++)e[c][h]&&(o[d]^=u),u>>=1,u||(u=128,d++);f+=a}break;default:throw new Vi(`operator ${r} is not supported`)}}onImmediateGenericRegion(t,e,s,i){const n=t.info,a=new Ki(e,s,i),r=decodeBitmap(t.mmr,n.width,n.height,t.template,t.prediction,0,t.at,a);this.drawBitmap(n,r)}onImmediateLosslessGenericRegion(){this.onImmediateGenericRegion(...arguments)}onSymbolDictionary(t,e,s,i,n,a){let r,o;t.huffman&&(r=function(t,e,s){let i,n,a,r,o=0;switch(t.huffmanDHSelector){case 0:case 1:i=getStandardTable(t.huffmanDHSelector+4);break;case 3:i=getCustomHuffmanTable(o,e,s),o++;break;default:throw new Vi("invalid Huffman DH selector")}switch(t.huffmanDWSelector){case 0:case 1:n=getStandardTable(t.huffmanDWSelector+2);break;case 3:n=getCustomHuffmanTable(o,e,s),o++;break;default:throw new Vi("invalid Huffman DW selector")}return t.bitmapSizeSelector?(a=getCustomHuffmanTable(o,e,s),o++):a=getStandardTable(1),r=t.aggregationInstancesSelector?getCustomHuffmanTable(o,e,s):getStandardTable(1),{tableDeltaHeight:i,tableDeltaWidth:n,tableBitmapSize:a,tableAggregateInstances:r}}(t,s,this.customTables),o=new on(i,n,a));let l=this.symbols;l||(this.symbols=l={});const c=[];for(const t of s){const e=l[t];e&&c.push(...e)}const h=new Ki(i,n,a);l[e]=function(t,e,s,i,n,a,r,o,l,c,h,u){if(t&&e)throw new Vi("symbol refinement with Huffman is not supported");const d=[];let f=0,g=log2(s.length+i);const p=h.decoder,m=h.contextCache;let b,w;for(t&&(b=getStandardTable(1),w=[],g=Math.max(g,1));d.length<i;){f+=t?a.tableDeltaHeight.decode(u):decodeInteger(m,"IADH",p);let i=0,n=0;const b=t?w.length:0;for(;;){const b=t?a.tableDeltaWidth.decode(u):decodeInteger(m,"IADW",p);if(null===b)break;let y;if(i+=b,n+=i,e){const n=decodeInteger(m,"IAAI",p);if(n>1)y=decodeTextRegion(t,e,i,f,0,n,1,s.concat(d),g,0,0,1,0,a,l,c,h,0,u);else{const t=decodeIAID(m,p,g),e=decodeInteger(m,"IARDX",p),n=decodeInteger(m,"IARDY",p);y=decodeRefinement(i,f,l,t<s.length?s[t]:d[t-s.length],e,n,0,c,h)}d.push(y)}else t?w.push(i):(y=decodeBitmap(!1,i,f,r,!1,0,o,h),d.push(y))}if(t&&!e){const t=a.tableBitmapSize.decode(u);let e;if(u.byteAlign(),0===t)e=readUncompressedBitmap(u,n,f);else{const s=u.end,i=u.position+t;u.end=i,e=decodeMMRBitmap(u,n,f,!1),u.end=s,u.position=i}const s=w.length;if(b===s-1)d.push(e);else{let t,i,n,a,r,o=0;for(t=b;t<s;t++){for(a=w[t],n=o+a,r=[],i=0;i<f;i++)r.push(e[i].subarray(o,n));d.push(r),o=n}}}}const y=[],x=[];let v,A,k=!1;const S=s.length+i;for(;x.length<S;){let e=t?b.decode(u):decodeInteger(m,"IAEX",p);for(;e--;)x.push(k);k=!k}for(v=0,A=s.length;v<A;v++)x[v]&&y.push(s[v]);for(let t=0;t<i;v++,t++)x[v]&&y.push(d[t]);return y}(t.huffman,t.refinement,c,t.numberOfNewSymbols,t.numberOfExportedSymbols,r,t.template,t.at,t.refinementTemplate,t.refinementAt,h,o)}onImmediateTextRegion(t,e,s,i,n){const a=t.info;let r,o;const l=this.symbols,c=[];for(const t of e){const e=l[t];e&&c.push(...e)}const h=log2(c.length);t.huffman&&(o=new on(s,i,n),r=function(t,e,s,i,n){const a=[];for(let t=0;t<=34;t++){const e=n.readBits(4);a.push(new sn([t,e,0,0]))}const r=new an(a,!1);a.length=0;for(let t=0;t<i;){const e=r.decode(n);if(e>=32){let s,i,r;switch(e){case 32:if(0===t)throw new Vi("no previous value in symbol ID table");i=n.readBits(2)+3,s=a[t-1].prefixLength;break;case 33:i=n.readBits(3)+3,s=0;break;case 34:i=n.readBits(7)+11,s=0;break;default:throw new Vi("invalid code length in symbol ID table")}for(r=0;r<i;r++)a.push(new sn([t,s,0,0])),t++}else a.push(new sn([t,e,0,0])),t++}n.byteAlign();const o=new an(a,!1);let l,c,h,u=0;switch(t.huffmanFS){case 0:case 1:l=getStandardTable(t.huffmanFS+6);break;case 3:l=getCustomHuffmanTable(u,e,s),u++;break;default:throw new Vi("invalid Huffman FS selector")}switch(t.huffmanDS){case 0:case 1:case 2:c=getStandardTable(t.huffmanDS+8);break;case 3:c=getCustomHuffmanTable(u,e,s),u++;break;default:throw new Vi("invalid Huffman DS selector")}switch(t.huffmanDT){case 0:case 1:case 2:h=getStandardTable(t.huffmanDT+11);break;case 3:h=getCustomHuffmanTable(u,e,s),u++;break;default:throw new Vi("invalid Huffman DT selector")}if(t.refinement)throw new Vi("refinement with Huffman is not supported");return{symbolIDTable:o,tableFirstS:l,tableDeltaS:c,tableDeltaT:h}}(t,e,this.customTables,c.length,o));const u=new Ki(s,i,n),d=decodeTextRegion(t.huffman,t.refinement,a.width,a.height,t.defaultPixelValue,t.numberOfSymbolInstances,t.stripSize,c,h,t.transposed,t.dsOffset,t.referenceCorner,t.combinationOperator,r,t.refinementTemplate,t.refinementAt,u,t.logStripSize,o);this.drawBitmap(a,d)}onImmediateLosslessTextRegion(){this.onImmediateTextRegion(...arguments)}onPatternDictionary(t,e,s,i,n){let a=this.patterns;a||(this.patterns=a={});const r=new Ki(s,i,n);a[e]=function(t,e,s,i,n,a){const r=[];t||(r.push({x:-e,y:0}),0===n&&r.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2}));const o=decodeBitmap(t,(i+1)*e,s,n,!1,0,r,a),l=[];for(let t=0;t<=i;t++){const i=[],n=e*t,a=n+e;for(let t=0;t<s;t++)i.push(o[t].subarray(n,a));l.push(i)}return l}(t.mmr,t.patternWidth,t.patternHeight,t.maxPatternIndex,t.template,r)}onImmediateHalftoneRegion(t,e,s,i,n){const a=this.patterns[e[0]],r=t.info,o=new Ki(s,i,n),l=function(t,e,s,i,n,a,r,o,l,c,h,u,d,f,g){if(r)throw new Vi("skip is not supported");if(0!==o)throw new Vi(`operator "${o}" is not supported in halftone region`);const p=[];let m,b,w;for(m=0;m<n;m++)w=new Uint8Array(i),a&&w.fill(a),p.push(w);const y=e.length,x=e[0],v=x[0].length,A=x.length,k=log2(y),S=[];t||(S.push({x:s<=1?3:2,y:-1}),0===s&&S.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2}));const C=[];let _,I,T,M,E,F,D,R,B,P,N;for(t&&(_=new on(g.data,g.start,g.end)),m=k-1;m>=0;m--)I=t?decodeMMRBitmap(_,l,c,!0):decodeBitmap(!1,l,c,s,!1,0,S,g),C[m]=I;for(T=0;T<c;T++)for(M=0;M<l;M++){for(E=0,F=0,b=k-1;b>=0;b--)E^=C[b][T][M],F|=E<<b;if(D=e[F],R=h+T*f+M*d>>8,B=u+T*d-M*f>>8,R>=0&&R+v<=i&&B>=0&&B+A<=n)for(m=0;m<A;m++)for(N=p[B+m],P=D[m],b=0;b<v;b++)N[R+b]|=P[b];else{let t,e;for(m=0;m<A;m++)if(e=B+m,!(e<0||e>=n))for(N=p[e],P=D[m],b=0;b<v;b++)t=R+b,t>=0&&t<i&&(N[t]|=P[b])}}return p}(t.mmr,a,t.template,r.width,r.height,t.defaultPixelValue,t.enableSkip,t.combinationOperator,t.gridWidth,t.gridHeight,t.gridOffsetX,t.gridOffsetY,t.gridVectorX,t.gridVectorY,o);this.drawBitmap(r,l)}onImmediateLosslessHalftoneRegion(){this.onImmediateHalftoneRegion(...arguments)}onTables(t,e,s,i){let n=this.customTables;n||(this.customTables=n={}),n[t]=function(t,e,s){const i=t[e],n=4294967295&readUint32(t,e+1),a=4294967295&readUint32(t,e+5),r=new on(t,e+9,s),o=1+(i>>1&7),l=1+(i>>4&7),c=[];let h,u,d=n;do{h=r.readBits(o),u=r.readBits(l),c.push(new sn([d,h,u,0])),d+=1<<u}while(d<a);return h=r.readBits(o),c.push(new sn([n-1,h,32,0,"lower"])),h=r.readBits(o),c.push(new sn([a,h,32,0])),1&i&&(h=r.readBits(o),c.push(new sn([h,0]))),new an(c,!1)}(e,s,i)}},sn=class{constructor(t){2===t.length?(this.isOOB=!0,this.rangeLow=0,this.prefixLength=t[0],this.rangeLength=0,this.prefixCode=t[1],this.isLowerRange=!1):(this.isOOB=!1,this.rangeLow=t[0],this.prefixLength=t[1],this.rangeLength=t[2],this.prefixCode=t[3],this.isLowerRange="lower"===t[4])}},nn=class _HuffmanTreeNode{constructor(t){this.children=[],t?(this.isLeaf=!0,this.rangeLength=t.rangeLength,this.rangeLow=t.rangeLow,this.isLowerRange=t.isLowerRange,this.isOOB=t.isOOB):this.isLeaf=!1}buildTree(t,e){const s=t.prefixCode>>e&1;if(e<=0)this.children[s]=new _HuffmanTreeNode(t);else{let i=this.children[s];i||(this.children[s]=i=new _HuffmanTreeNode(null)),i.buildTree(t,e-1)}}decodeNode(t){if(this.isLeaf){if(this.isOOB)return null;const e=t.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-e:e)}const e=this.children[t.readBit()];if(!e)throw new Vi("invalid Huffman data");return e.decodeNode(t)}},an=class{constructor(t,e){e||this.assignPrefixCodes(t),this.rootNode=new nn(null);for(let e=0,s=t.length;e<s;e++){const s=t[e];s.prefixLength>0&&this.rootNode.buildTree(s,s.prefixLength-1)}}decode(t){return this.rootNode.decodeNode(t)}assignPrefixCodes(t){const e=t.length;let s=0;for(let i=0;i<e;i++)s=Math.max(s,t[i].prefixLength);const i=new Uint32Array(s+1);for(let s=0;s<e;s++)i[t[s].prefixLength]++;let n,a,r,o=1,l=0;for(i[0]=0;o<=s;){for(l=l+i[o-1]<<1,n=l,a=0;a<e;)r=t[a],r.prefixLength===o&&(r.prefixCode=n,n++),a++;o++}}},rn={};function getStandardTable(t){let e,s=rn[t];if(s)return s;switch(t){case 1:e=[[0,1,4,0],[16,2,8,2],[272,3,16,6],[65808,3,32,7]];break;case 2:e=[[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[75,6,32,62],[6,63]];break;case 3:e=[[-256,8,8,254],[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[-257,8,32,255,"lower"],[75,7,32,126],[6,62]];break;case 4:e=[[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[76,5,32,31]];break;case 5:e=[[-255,7,8,126],[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[-256,7,32,127,"lower"],[76,6,32,62]];break;case 6:e=[[-2048,5,10,28],[-1024,4,9,8],[-512,4,8,9],[-256,4,7,10],[-128,5,6,29],[-64,5,5,30],[-32,4,5,11],[0,2,7,0],[128,3,7,2],[256,3,8,3],[512,4,9,12],[1024,4,10,13],[-2049,6,32,62,"lower"],[2048,6,32,63]];break;case 7:e=[[-1024,4,9,8],[-512,3,8,0],[-256,4,7,9],[-128,5,6,26],[-64,5,5,27],[-32,4,5,10],[0,4,5,11],[32,5,5,28],[64,5,6,29],[128,4,7,12],[256,3,8,1],[512,3,9,2],[1024,3,10,3],[-1025,5,32,30,"lower"],[2048,5,32,31]];break;case 8:e=[[-15,8,3,252],[-7,9,1,508],[-5,8,1,253],[-3,9,0,509],[-2,7,0,124],[-1,4,0,10],[0,2,1,0],[2,5,0,26],[3,6,0,58],[4,3,4,4],[20,6,1,59],[22,4,4,11],[38,4,5,12],[70,5,6,27],[134,5,7,28],[262,6,7,60],[390,7,8,125],[646,6,10,61],[-16,9,32,510,"lower"],[1670,9,32,511],[2,1]];break;case 9:e=[[-31,8,4,252],[-15,9,2,508],[-11,8,2,253],[-7,9,1,509],[-5,7,1,124],[-3,4,1,10],[-1,3,1,2],[1,3,1,3],[3,5,1,26],[5,6,1,58],[7,3,5,4],[39,6,2,59],[43,4,5,11],[75,4,6,12],[139,5,7,27],[267,5,8,28],[523,6,8,60],[779,7,9,125],[1291,6,11,61],[-32,9,32,510,"lower"],[3339,9,32,511],[2,0]];break;case 10:e=[[-21,7,4,122],[-5,8,0,252],[-4,7,0,123],[-3,5,0,24],[-2,2,2,0],[2,5,0,25],[3,6,0,54],[4,7,0,124],[5,8,0,253],[6,2,6,1],[70,5,5,26],[102,6,5,55],[134,6,6,56],[198,6,7,57],[326,6,8,58],[582,6,9,59],[1094,6,10,60],[2118,7,11,125],[-22,8,32,254,"lower"],[4166,8,32,255],[2,2]];break;case 11:e=[[1,1,0,0],[2,2,1,2],[4,4,0,12],[5,4,1,13],[7,5,1,28],[9,5,2,29],[13,6,2,60],[17,7,2,122],[21,7,3,123],[29,7,4,124],[45,7,5,125],[77,7,6,126],[141,7,32,127]];break;case 12:e=[[1,1,0,0],[2,2,0,2],[3,3,1,6],[5,5,0,28],[6,5,1,29],[8,6,1,60],[10,7,0,122],[11,7,1,123],[13,7,2,124],[17,7,3,125],[25,7,4,126],[41,8,5,254],[73,8,32,255]];break;case 13:e=[[1,1,0,0],[2,3,0,4],[3,4,0,12],[4,5,0,28],[5,4,1,13],[7,3,3,5],[15,6,1,58],[17,6,2,59],[21,6,3,60],[29,6,4,61],[45,6,5,62],[77,7,6,126],[141,7,32,127]];break;case 14:e=[[-2,3,0,4],[-1,3,0,5],[0,1,0,0],[1,3,0,6],[2,3,0,7]];break;case 15:e=[[-24,7,4,124],[-8,6,2,60],[-4,5,1,28],[-2,4,0,12],[-1,3,0,4],[0,1,0,0],[1,3,0,5],[2,4,0,13],[3,5,1,29],[5,6,2,61],[9,7,4,125],[-25,7,32,126,"lower"],[25,7,32,127]];break;default:throw new Vi(`standard table B.${t} does not exist`)}for(let t=0,s=e.length;t<s;t++)e[t]=new sn(e[t]);return s=new an(e,!0),rn[t]=s,s}var on=class{constructor(t,e,s){this.data=t,this.start=e,this.end=s,this.position=e,this.shift=-1,this.currentByte=0}readBit(){if(this.shift<0){if(this.position>=this.end)throw new Vi("end of data while reading bit");this.currentByte=this.data[this.position++],this.shift=7}const t=this.currentByte>>this.shift&1;return this.shift--,t}readBits(t){let e,s=0;for(e=t-1;e>=0;e--)s|=this.readBit()<<e;return s}byteAlign(){this.shift=-1}next(){return this.position>=this.end?-1:this.data[this.position++]}};function getCustomHuffmanTable(t,e,s){let i=0;for(let n=0,a=e.length;n<a;n++){const a=s[e[n]];if(a){if(t===i)return a;i++}}throw new Vi("can't find custom Huffman table")}function readUncompressedBitmap(t,e,s){const i=[];for(let n=0;n<s;n++){const s=new Uint8Array(e);i.push(s);for(let i=0;i<e;i++)s[i]=t.readBit();t.byteAlign()}return i}function decodeMMRBitmap(t,e,s,i){const n=new Oi(t,{K:-1,Columns:e,Rows:s,BlackIs1:!0,EndOfBlock:i}),a=[];let r,o=!1;for(let t=0;t<s;t++){const t=new Uint8Array(e);a.push(t);let s=-1;for(let i=0;i<e;i++)s<0&&(r=n.readNextChar(),-1===r&&(r=0,o=!0),s=7),t[i]=r>>s&1,s--}if(i&&!o){const t=5;for(let e=0;e<t&&-1!==n.readNextChar();e++);}return a}var ln=class{parseChunks(t){return function(t){const e=new en;for(let s=0,i=t.length;s<i;s++){const i=t[s];processSegments(readSegments({},i.data,i.start,i.end),e)}return e.buffer}(t)}parse(t){throw new Error("Not implemented: Jbig2Image.parse")}},cn=class extends si{constructor(t,e,s){super(e),this.stream=t,this.dict=t.dict,this.maybeLength=e,this.params=s}get bytes(){return shadow$1(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(t){}readBlock(){this.decodeImage()}decodeImage(t){if(this.eof)return this.buffer;t||=this.bytes;const e=new ln,s=[];if(this.params instanceof fs){const t=this.params.get("JBIG2Globals");if(t instanceof bs){const e=t.getBytes();s.push({data:e,start:0,end:e.length})}}s.push({data:t,start:0,end:t.length});const i=e.parseChunks(s),n=i.length;for(let t=0;t<n;t++)i[t]^=255;return this.buffer=i,this.bufferLength=n,this.eof=!0,this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}},hn=class extends si{constructor(t,e,s){super(e),this.stream=t,this.dict=t.dict,this.maybeLength=e,this.params=s}get bytes(){return shadow$1(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(t){}readBlock(t){unreachable$1("JpxStream.readBlock")}get isAsyncDecoder(){return!0}async decodeImage(t,e){return this.eof||(t||=this.bytes,this.buffer=await xi.decode(t,e),this.bufferLength=this.buffer.length,this.eof=!0),this.buffer}get canAsyncDecodeImageFromBuffer(){return this.stream.isAsync}},un=class extends si{constructor(t,e,s){super(e),this.str=t,this.dict=t.dict,this.cachedData=0,this.bitsCached=0;const i=4096,n={earlyChange:s,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(i),dictionaryLengths:new Uint16Array(i),dictionaryPrevCodes:new Uint16Array(i),currentSequence:new Uint8Array(i),currentSequenceLength:0};for(let t=0;t<256;++t)n.dictionaryValues[t]=t,n.dictionaryLengths[t]=1;this.lzwState=n}readBits(t){let e=this.bitsCached,s=this.cachedData;for(;e<t;){const t=this.str.getByte();if(-1===t)return this.eof=!0,null;s=s<<8|t,e+=8}return this.bitsCached=e-=t,this.cachedData=s,this.lastCode=null,s>>>e&(1<<t)-1}readBlock(){let t,e,s,i=1024;const n=this.lzwState;if(!n)return;const a=n.earlyChange;let r=n.nextCode;const o=n.dictionaryValues,l=n.dictionaryLengths,c=n.dictionaryPrevCodes;let h=n.codeLength,u=n.prevCode;const d=n.currentSequence;let f=n.currentSequenceLength,g=0,p=this.bufferLength,m=this.ensureBuffer(this.bufferLength+i);for(t=0;t<512;t++){const t=this.readBits(h),n=f>0;if(t<256)d[0]=t,f=1;else{if(!(t>=258)){if(256===t){h=9,r=258,f=0;continue}this.eof=!0,delete this.lzwState;break}if(t<r)for(f=l[t],e=f-1,s=t;e>=0;e--)d[e]=o[s],s=c[s];else d[f++]=d[0]}if(n&&(c[r]=u,l[r]=l[u]+1,o[r]=d[0],r++,h=r+a&r+a-1?h:0|Math.min(Math.log(r+a)/.6931471805599453+1,12)),u=t,g+=f,i<g){do{i+=512}while(i<g);m=this.ensureBuffer(this.bufferLength+i)}for(e=0;e<f;e++)m[p++]=d[e]}n.nextCode=r,n.codeLength=h,n.prevCode=u,n.currentSequenceLength=f,this.bufferLength=p}},dn=class extends si{constructor(t,e,s){if(super(e),!(s instanceof fs))return t;const i=this.predictor=s.get("Predictor")||1;if(i<=1)return t;if(2!==i&&(i<10||i>15))throw new Ze(`Unsupported predictor: ${i}`);this.readBlock=2===i?this.readBlockTiff:this.readBlockPng,this.str=t,this.dict=t.dict;const n=this.colors=s.get("Colors")||1,a=this.bits=s.get("BPC","BitsPerComponent")||8,r=this.columns=s.get("Columns")||1;return this.pixBytes=n*a+7>>3,this.rowBytes=r*n*a+7>>3,this}readBlockTiff(){const t=this.rowBytes,e=this.bufferLength,s=this.ensureBuffer(e+t),i=this.bits,n=this.colors,a=this.str.getBytes(t);if(this.eof=!a.length,this.eof)return;let r,o=0,l=0,c=0,h=0,u=e;if(1===i&&1===n)for(r=0;r<t;++r){let t=a[r]^o;t^=t>>1,t^=t>>2,t^=t>>4,o=(1&t)<<7,s[u++]=t}else if(8===i){for(r=0;r<n;++r)s[u++]=a[r];for(;r<t;++r)s[u]=s[u-n]+a[r],u++}else if(16===i){const e=2*n;for(r=0;r<e;++r)s[u++]=a[r];for(;r<t;r+=2){const t=((255&a[r])<<8)+(255&a[r+1])+((255&s[u-e])<<8)+(255&s[u-e+1]);s[u++]=t>>8&255,s[u++]=255&t}}else{const t=new Uint8Array(n+1),u=(1<<i)-1;let d=0,f=e;const g=this.columns;for(r=0;r<g;++r)for(let e=0;e<n;++e)c<i&&(o=o<<8|255&a[d++],c+=8),t[e]=t[e]+(o>>c-i)&u,c-=i,l=l<<i|t[e],h+=i,h>=8&&(s[f++]=l>>h-8&255,h-=8);h>0&&(s[f++]=(l<<8-h)+(o&(1<<8-h)-1))}this.bufferLength+=t}readBlockPng(){const t=this.rowBytes,e=this.pixBytes,s=this.str.getByte(),i=this.str.getBytes(t);if(this.eof=!i.length,this.eof)return;const n=this.bufferLength,a=this.ensureBuffer(n+t);let r=a.subarray(n-t,n);0===r.length&&(r=new Uint8Array(t));let o,l,c,h=n;switch(s){case 0:for(o=0;o<t;++o)a[h++]=i[o];break;case 1:for(o=0;o<e;++o)a[h++]=i[o];for(;o<t;++o)a[h]=a[h-e]+i[o]&255,h++;break;case 2:for(o=0;o<t;++o)a[h++]=r[o]+i[o]&255;break;case 3:for(o=0;o<e;++o)a[h++]=(r[o]>>1)+i[o];for(;o<t;++o)a[h]=(r[o]+a[h-e]>>1)+i[o]&255,h++;break;case 4:for(o=0;o<e;++o)l=r[o],c=i[o],a[h++]=l+c;for(;o<t;++o){l=r[o];const t=r[o-e],s=a[h-e],n=s+l-t;let u=n-s;u<0&&(u=-u);let d=n-l;d<0&&(d=-d);let f=n-t;f<0&&(f=-f),c=i[o],a[h++]=u<=d&&u<=f?s+c:d<=f?l+c:t+c}break;default:throw new Ze(`Unsupported predictor: ${s}`)}this.bufferLength+=t}},fn=class extends si{constructor(t,e){super(e),this.str=t,this.dict=t.dict}readBlock(){const t=this.str.getBytes(2);if(!t||t.length<2||128===t[0])return void(this.eof=!0);let e,s=this.bufferLength,i=t[0];if(i<128){if(e=this.ensureBuffer(s+i+1),e[s++]=t[1],i>0){const t=this.str.getBytes(i);e.set(t,s),s+=i}}else i=257-i,e=this.ensureBuffer(s+i+1),e.fill(t[1],s,s+i),s+=i;this.bufferLength=s}},gn=class{constructor({lexer:t,xref:e,allowStreams:s=!1,recoveryMode:i=!1}){this.lexer=t,this.xref=e,this.allowStreams=s,this.recoveryMode=i,this.imageCache=Object.create(null),this._imageId=0,this.refill()}refill(){this.buf1=this.lexer.getObj(),this.buf2=this.lexer.getObj()}shift(){this.buf2 instanceof ds&&"ID"===this.buf2.cmd?(this.buf1=this.buf2,this.buf2=null):(this.buf1=this.buf2,this.buf2=this.lexer.getObj())}tryShift(){try{return this.shift(),!0}catch(t){if(t instanceof ks)throw t;return!1}}getObj(t=null){const e=this.buf1;if(this.shift(),e instanceof ds)switch(e.cmd){case"BI":return this.makeInlineImage(t);case"[":const s=[];for(;!isCmd(this.buf1,"]")&&this.buf1!==os;)s.push(this.getObj(t));if(this.buf1===os){if(this.recoveryMode)return s;throw new Ss("End of file inside array.")}return this.shift(),s;case"<<":const i=new fs(this.xref);for(;!isCmd(this.buf1,">>")&&this.buf1!==os;){if(!(this.buf1 instanceof us)){info$1("Malformed dictionary: key must be a name object"),this.shift();continue}const e=this.buf1.name;if(this.shift(),this.buf1===os)break;i.set(e,this.getObj(t))}if(this.buf1===os){if(this.recoveryMode)return i;throw new Ss("End of file inside dictionary.")}return isCmd(this.buf2,"stream")?this.allowStreams?this.makeStream(i,t):i:(this.shift(),i);default:return e}if(Number.isInteger(e)){if(Number.isInteger(this.buf1)&&isCmd(this.buf2,"R")){const t=gs.get(e,this.buf1);return this.shift(),this.shift(),t}return e}return"string"==typeof e&&t?t.decryptString(e):e}findDefaultInlineStreamEnd(t){const{knownCommands:e}=this.lexer,s=t.pos;let i,n,a=0;for(;-1!==(i=t.getByte());)if(0===a)a=69===i?1:0;else if(1===a)a=73===i?2:0;else if(32===i||10===i||13===i){n=t.pos;const s=t.peekBytes(15),r=s.length;if(0===r)break;for(let t=0;t<r;t++)if(i=s[t],(0!==i||0===s[t+1])&&10!==i&&13!==i&&(i<32||i>127)){a=0;break}if(2!==a)continue;if(!e){warn$1("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.");continue}const o=new mn(new Ks(t.peekBytes(75)),e);o._hexStringWarn=()=>{};let l=0;for(;;){const t=o.getObj();if(t===os){a=0;break}if(t instanceof ds){const s=e[t.cmd];if(!s){a=0;break}if(s.variableArgs?l<=s.numArgs:l===s.numArgs)break;l=0;continue}l++}if(2===a)break}else a=0;-1===i&&(warn$1("findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker"),n&&(warn$1('... trying to recover by using the last "EI" occurrence.'),t.skip(-(t.pos-n))));let r=4;return t.skip(-r),i=t.peekByte(),t.skip(r),isWhiteSpace(i)||r--,t.pos-r-s}findDCTDecodeInlineStreamEnd(t){const e=t.pos;let s,i,n=!1;for(;-1!==(s=t.getByte());)if(255===s){switch(t.getByte()){case 0:break;case 255:t.skip(-1);break;case 217:n=!0;break;case 192:case 193:case 194:case 195:case 197:case 198:case 199:case 201:case 202:case 203:case 205:case 206:case 207:case 196:case 204:case 218:case 219:case 220:case 221:case 222:case 223:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:i=t.getUint16(),i>2?t.skip(i-2):t.skip(-2)}if(n)break}const a=t.pos-e;return-1===s?(warn$1("Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead."),t.skip(-a),this.findDefaultInlineStreamEnd(t)):(this.inlineStreamSkipEI(t),a)}findASCII85DecodeInlineStreamEnd(t){const e=t.pos;let s;for(;-1!==(s=t.getByte());)if(126===s){const e=t.pos;for(s=t.peekByte();isWhiteSpace(s);)t.skip(),s=t.peekByte();if(62===s){t.skip();break}if(t.pos>e){const e=t.peekBytes(2);if(69===e[0]&&73===e[1])break}}const i=t.pos-e;return-1===s?(warn$1("Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead."),t.skip(-i),this.findDefaultInlineStreamEnd(t)):(this.inlineStreamSkipEI(t),i)}findASCIIHexDecodeInlineStreamEnd(t){const e=t.pos;let s;for(;-1!==(s=t.getByte())&&62!==s;);const i=t.pos-e;return-1===s?(warn$1("Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead."),t.skip(-i),this.findDefaultInlineStreamEnd(t)):(this.inlineStreamSkipEI(t),i)}inlineStreamSkipEI(t){let e,s=0;for(;-1!==(e=t.getByte());)if(0===s)s=69===e?1:0;else if(1===s)s=73===e?2:0;else if(2===s)break}makeInlineImage(t){const e=this.lexer,s=e.stream,i=Object.create(null);let n;for(;!isCmd(this.buf1,"ID")&&this.buf1!==os;){if(!(this.buf1 instanceof us))throw new Ze("Dictionary key must be a name object");const e=this.buf1.name;if(this.shift(),this.buf1===os)break;i[e]=this.getObj(t)}-1!==e.beginInlineImagePos&&(n=s.pos-e.beginInlineImagePos);const a=this.xref.fetchIfRef(i.F||i.Filter);let r;if(a instanceof us)r=a.name;else if(Array.isArray(a)){const t=this.xref.fetchIfRef(a[0]);t instanceof us&&(r=t.name)}const o=s.pos;let l,c;switch(r){case"DCT":case"DCTDecode":l=this.findDCTDecodeInlineStreamEnd(s);break;case"A85":case"ASCII85Decode":l=this.findASCII85DecodeInlineStreamEnd(s);break;case"AHx":case"ASCIIHexDecode":l=this.findASCIIHexDecodeInlineStreamEnd(s);break;default:l=this.findDefaultInlineStreamEnd(s)}if(l<1e3&&n>0){const t=s.pos;s.pos=e.beginInlineImagePos,c=function(t){const e=[],s=t.length;let i=0;for(;i<s-1;)e.push(t[i++]<<8|t[i++]);return i<s&&e.push(t[i]),s+"_"+String.fromCharCode.apply(null,e)}(s.getBytes(n+l)),s.pos=t;const i=this.imageCache[c];if(void 0!==i)return this.buf2=ds.get("EI"),this.shift(),i.reset(),i}const h=new fs(this.xref);for(const t in i)h.set(t,i[t]);let u=s.makeSubStream(o,l,h);return t&&(u=t.createStream(u,l)),u=this.filter(u,h,l),u.dict=h,void 0!==c&&(u.cacheKey="inline_img_"+ ++this._imageId,this.imageCache[c]=u),this.buf2=ds.get("EI"),this.shift(),u}#j(t){const{stream:e}=this.lexer;e.pos=t;const s=new Uint8Array([101,110,100]),i=s.length,n=[new Uint8Array([115,116,114,101,97,109]),new Uint8Array([115,116,101,97,109]),new Uint8Array([115,116,114,101,97])],a=9-i;for(;e.pos<e.end;){const r=e.peekBytes(2048),o=r.length-9;if(o<=0)break;let l=0;for(;l<o;){let o=0;for(;o<i&&r[l+o]===s[o];)o++;if(o>=i){let i=!1;for(const t of n){const e=t.length;let n=0;for(;n<e&&r[l+o+n]===t[n];)n++;if(n>=a){i=!0;break}if(n>=e){isWhiteSpace(r[l+o+n])&&(info$1(`Found "${bytesToString$1([...s,...t])}" when searching for endstream command.`),i=!0);break}}if(i)return e.pos+=l,e.pos-t}l++}e.pos+=o}return-1}makeStream(t,e){const s=this.lexer;let i=s.stream;s.skipToNextLine();const n=i.pos-1;let a=t.get("Length");if(Number.isInteger(a)||(info$1(`Bad length "${a&&a.toString()}" in stream.`),a=0),i.pos=n+a,s.nextChar(),this.tryShift()&&isCmd(this.buf2,"endstream"))this.shift();else{if(a=this.#j(n),a<0)throw new Ze("Missing endstream command.");s.nextChar(),this.shift(),this.shift()}return this.shift(),i=i.makeSubStream(n,a,t),e&&(i=e.createStream(i,a)),i=this.filter(i,t,a),i.dict=t,i}filter(t,e,s){let i=e.get("F","Filter"),n=e.get("DP","DecodeParms");if(i instanceof us)return Array.isArray(n)&&warn$1("/DecodeParms should not be an Array, when /Filter is a Name."),this.makeFilter(t,i.name,s,n);let a=s;if(Array.isArray(i)){const e=i,s=n;for(let r=0,o=e.length;r<o;++r){if(i=this.xref.fetchIfRef(e[r]),!(i instanceof us))throw new Ze(`Bad filter name "${i}"`);n=null,Array.isArray(s)&&r in s&&(n=this.xref.fetchIfRef(s[r])),t=this.makeFilter(t,i.name,a,n),a=null}}return t}makeFilter(t,e,s,i){if(0===s)return warn$1(`Empty "${e}" stream.`),new Js;try{switch(e){case"Fl":case"FlateDecode":return i?new dn(new zi(t,s),s,i):new zi(t,s);case"LZW":case"LZWDecode":let e=1;return i?(i.has("EarlyChange")&&(e=i.get("EarlyChange")),new dn(new un(t,s,e),s,i)):new un(t,s,e);case"DCT":case"DCTDecode":return new wi(t,s,i);case"JPX":case"JPXDecode":return new hn(t,s,i);case"A85":case"ASCII85Decode":return new Ti(t,s);case"AHx":case"ASCIIHexDecode":return new Mi(t,s);case"CCF":case"CCITTFaxDecode":return new Li(t,s,i);case"RL":case"RunLengthDecode":return new fn(t,s);case"JBIG2Decode":return new cn(t,s,i)}return warn$1(`Filter "${e}" is not supported.`),t}catch(t){if(t instanceof ks)throw t;return warn$1(`Invalid stream: "${t}"`),new Js}}},pn=[1,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function toHexDigit(t){return t>=48&&t<=57?15&t:t>=65&&t<=70||t>=97&&t<=102?9+(15&t):-1}var mn=class{constructor(t,e=null){this.stream=t,this.nextChar(),this.strBuf=[],this.knownCommands=e,this._hexStringNumWarn=0,this.beginInlineImagePos=-1}nextChar(){return this.currentChar=this.stream.getByte()}peekChar(){return this.stream.peekByte()}getNumber(){let t=this.currentChar,e=!1,s=0,i=1;if(45===t?(i=-1,t=this.nextChar(),45===t&&(t=this.nextChar())):43===t&&(t=this.nextChar()),10===t||13===t)do{t=this.nextChar()}while(10===t||13===t);if(46===t&&(s=10,t=this.nextChar()),t<48||t>57){const e=`Invalid number: ${String.fromCharCode(t)} (charCode ${t})`;if(isWhiteSpace(t)||40===t||60===t||-1===t)return info$1(`Lexer.getNumber - "${e}".`),0;throw new Ze(e)}let n=t-48,a=0,r=1;for(;(t=this.nextChar())>=0;)if(t>=48&&t<=57){const i=t-48;e?a=10*a+i:(0!==s&&(s*=10),n=10*n+i)}else if(46===t){if(0!==s)break;s=1}else if(45===t)warn$1("Badly formatted number: minus sign in the middle");else{if(69!==t&&101!==t)break;if(t=this.peekChar(),43===t||45===t)r=45===t?-1:1,this.nextChar();else if(t<48||t>57)break;e=!0}return 0!==s&&(n/=s),e&&(n*=10**(r*a)),i*n}getString(){let t=1,e=!1;const s=this.strBuf;s.length=0;let i=this.nextChar();for(;;){let n=!1;switch(0|i){case-1:warn$1("Unterminated string"),e=!0;break;case 40:++t,s.push("(");break;case 41:0===--t?(this.nextChar(),e=!0):s.push(")");break;case 92:switch(i=this.nextChar(),i){case-1:warn$1("Unterminated string"),e=!0;break;case 110:s.push("\n");break;case 114:s.push("\r");break;case 116:s.push("\t");break;case 98:s.push("\b");break;case 102:s.push("\f");break;case 92:case 40:case 41:s.push(String.fromCharCode(i));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:let t=15&i;i=this.nextChar(),n=!0,i>=48&&i<=55&&(t=(t<<3)+(15&i),i=this.nextChar(),i>=48&&i<=55&&(n=!1,t=(t<<3)+(15&i))),s.push(String.fromCharCode(t));break;case 13:10===this.peekChar()&&this.nextChar();break;case 10:break;default:s.push(String.fromCharCode(i))}break;default:s.push(String.fromCharCode(i))}if(e)break;n||(i=this.nextChar())}return s.join("")}getName(){let t,e;const s=this.strBuf;for(s.length=0;(t=this.nextChar())>=0&&!pn[t];)if(35===t){if(t=this.nextChar(),pn[t]){warn$1("Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number."),s.push("#");break}const i=toHexDigit(t);if(-1!==i){e=t,t=this.nextChar();const n=toHexDigit(t);if(-1===n){if(warn$1(`Lexer_getName: Illegal digit (${String.fromCharCode(t)}) in hexadecimal number.`),s.push("#",String.fromCharCode(e)),pn[t])break;s.push(String.fromCharCode(t));continue}s.push(String.fromCharCode(i<<4|n))}else s.push("#",String.fromCharCode(t))}else s.push(String.fromCharCode(t));return s.length>127&&warn$1(`Name token is longer than allowed by the spec: ${s.length}`),us.get(s.join(""))}_hexStringWarn(t){5!==this._hexStringNumWarn++?this._hexStringNumWarn>5||warn$1(`getHexString - ignoring invalid character: ${t}`):warn$1("getHexString - ignoring additional invalid characters.")}getHexString(){const t=this.strBuf;t.length=0;let e=this.currentChar,s=-1,i=-1;for(this._hexStringNumWarn=0;;){if(e<0){warn$1("Unterminated hex string");break}if(62===e){this.nextChar();break}1!==pn[e]?(i=toHexDigit(e),-1===i?this._hexStringWarn(e):-1===s?s=i:(t.push(String.fromCharCode(s<<4|i)),s=-1),e=this.nextChar()):e=this.nextChar()}return-1!==s&&t.push(String.fromCharCode(s<<4)),t.join("")}getObj(){let t=!1,e=this.currentChar;for(;;){if(e<0)return os;if(t)10!==e&&13!==e||(t=!1);else if(37===e)t=!0;else if(1!==pn[e])break;e=this.nextChar()}switch(0|e){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return this.getNumber();case 40:return this.getString();case 47:return this.getName();case 91:return this.nextChar(),ds.get("[");case 93:return this.nextChar(),ds.get("]");case 60:return e=this.nextChar(),60===e?(this.nextChar(),ds.get("<<")):this.getHexString();case 62:return e=this.nextChar(),62===e?(this.nextChar(),ds.get(">>")):ds.get(">");case 123:return this.nextChar(),ds.get("{");case 125:return this.nextChar(),ds.get("}");case 41:throw this.nextChar(),new Ze(`Illegal character: ${e}`)}let s=String.fromCharCode(e);if(e<32||e>127){const t=this.peekChar();if(t>=32&&t<=127)return this.nextChar(),ds.get(s)}const i=this.knownCommands;let n=void 0!==i?.[s];for(;(e=this.nextChar())>=0&&!pn[e];){const t=s+String.fromCharCode(e);if(n&&void 0===i[t])break;if(128===s.length)throw new Ze(`Command token too long: ${s.length}`);s=t,n=void 0!==i?.[s]}return"true"===s||"false"!==s&&("null"===s?null:("BI"===s&&(this.beginInlineImagePos=this.stream.pos),ds.get(s)))}skipToNextLine(){let t=this.currentChar;for(;t>=0;){if(13===t){t=this.nextChar(),10===t&&this.nextChar();break}if(10===t){this.nextChar();break}t=this.nextChar()}}},bn=class{static create(t){function getInt(t,e,s=!1){const i=t.get(e);if(Number.isInteger(i)&&(s?i>=0:i>0))return i;throw new Error(`The "${e}" parameter in the linearization dictionary is invalid.`)}const e=new gn({lexer:new mn(t),xref:null}),s=e.getObj(),i=e.getObj(),n=e.getObj(),a=e.getObj();let r,o;if(!(Number.isInteger(s)&&Number.isInteger(i)&&isCmd(n,"obj")&&a instanceof fs&&"number"==typeof(r=a.get("Linearized"))&&r>0))return null;if((o=getInt(a,"L"))!==t.length)throw new Error('The "L" parameter in the linearization dictionary does not equal the stream length.');return{length:o,hints:function(t){const e=t.get("H");let s;if(Array.isArray(e)&&(2===(s=e.length)||4===s)){for(let t=0;t<s;t++){const s=e[t];if(!(Number.isInteger(s)&&s>0))throw new Error(`Hint (${t}) in the linearization dictionary is invalid.`)}return e}throw new Error("Hint array in the linearization dictionary is invalid.")}(a),objectNumberFirst:getInt(a,"O"),endFirst:getInt(a,"E"),numPages:getInt(a,"N"),mainXRefEntriesOffset:getInt(a,"T"),pageFirst:a.has("P")?getInt(a,"P",!0):0}}},wn=["Adobe-GB1-UCS2","Adobe-CNS1-UCS2","Adobe-Japan1-UCS2","Adobe-Korea1-UCS2","78-EUC-H","78-EUC-V","78-H","78-RKSJ-H","78-RKSJ-V","78-V","78ms-RKSJ-H","78ms-RKSJ-V","83pv-RKSJ-H","90ms-RKSJ-H","90ms-RKSJ-V","90msp-RKSJ-H","90msp-RKSJ-V","90pv-RKSJ-H","90pv-RKSJ-V","Add-H","Add-RKSJ-H","Add-RKSJ-V","Add-V","Adobe-CNS1-0","Adobe-CNS1-1","Adobe-CNS1-2","Adobe-CNS1-3","Adobe-CNS1-4","Adobe-CNS1-5","Adobe-CNS1-6","Adobe-GB1-0","Adobe-GB1-1","Adobe-GB1-2","Adobe-GB1-3","Adobe-GB1-4","Adobe-GB1-5","Adobe-Japan1-0","Adobe-Japan1-1","Adobe-Japan1-2","Adobe-Japan1-3","Adobe-Japan1-4","Adobe-Japan1-5","Adobe-Japan1-6","Adobe-Korea1-0","Adobe-Korea1-1","Adobe-Korea1-2","B5-H","B5-V","B5pc-H","B5pc-V","CNS-EUC-H","CNS-EUC-V","CNS1-H","CNS1-V","CNS2-H","CNS2-V","ETHK-B5-H","ETHK-B5-V","ETen-B5-H","ETen-B5-V","ETenms-B5-H","ETenms-B5-V","EUC-H","EUC-V","Ext-H","Ext-RKSJ-H","Ext-RKSJ-V","Ext-V","GB-EUC-H","GB-EUC-V","GB-H","GB-V","GBK-EUC-H","GBK-EUC-V","GBK2K-H","GBK2K-V","GBKp-EUC-H","GBKp-EUC-V","GBT-EUC-H","GBT-EUC-V","GBT-H","GBT-V","GBTpc-EUC-H","GBTpc-EUC-V","GBpc-EUC-H","GBpc-EUC-V","H","HKdla-B5-H","HKdla-B5-V","HKdlb-B5-H","HKdlb-B5-V","HKgccs-B5-H","HKgccs-B5-V","HKm314-B5-H","HKm314-B5-V","HKm471-B5-H","HKm471-B5-V","HKscs-B5-H","HKscs-B5-V","Hankaku","Hiragana","KSC-EUC-H","KSC-EUC-V","KSC-H","KSC-Johab-H","KSC-Johab-V","KSC-V","KSCms-UHC-H","KSCms-UHC-HW-H","KSCms-UHC-HW-V","KSCms-UHC-V","KSCpc-EUC-H","KSCpc-EUC-V","Katakana","NWP-H","NWP-V","RKSJ-H","RKSJ-V","Roman","UniCNS-UCS2-H","UniCNS-UCS2-V","UniCNS-UTF16-H","UniCNS-UTF16-V","UniCNS-UTF32-H","UniCNS-UTF32-V","UniCNS-UTF8-H","UniCNS-UTF8-V","UniGB-UCS2-H","UniGB-UCS2-V","UniGB-UTF16-H","UniGB-UTF16-V","UniGB-UTF32-H","UniGB-UTF32-V","UniGB-UTF8-H","UniGB-UTF8-V","UniJIS-UCS2-H","UniJIS-UCS2-HW-H","UniJIS-UCS2-HW-V","UniJIS-UCS2-V","UniJIS-UTF16-H","UniJIS-UTF16-V","UniJIS-UTF32-H","UniJIS-UTF32-V","UniJIS-UTF8-H","UniJIS-UTF8-V","UniJIS2004-UTF16-H","UniJIS2004-UTF16-V","UniJIS2004-UTF32-H","UniJIS2004-UTF32-V","UniJIS2004-UTF8-H","UniJIS2004-UTF8-V","UniJISPro-UCS2-HW-V","UniJISPro-UCS2-V","UniJISPro-UTF8-V","UniJISX0213-UTF32-H","UniJISX0213-UTF32-V","UniJISX02132004-UTF32-H","UniJISX02132004-UTF32-V","UniKS-UCS2-H","UniKS-UCS2-V","UniKS-UTF16-H","UniKS-UTF16-V","UniKS-UTF32-H","UniKS-UTF32-V","UniKS-UTF8-H","UniKS-UTF8-V","V","WP-Symbol"],yn=2**24-1,xn=class{constructor(t=!1){this.codespaceRanges=[[],[],[],[]],this.numCodespaceRanges=0,this._map=[],this.name="",this.vertical=!1,this.useCMap=null,this.builtInCMap=t}addCodespaceRange(t,e,s){this.codespaceRanges[t-1].push(e,s),this.numCodespaceRanges++}mapCidRange(t,e,s){if(e-t>yn)throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE.");for(;t<=e;)this._map[t++]=s++}mapBfRange(t,e,s){if(e-t>yn)throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE.");const i=s.length-1;for(;t<=e;){this._map[t++]=s;const e=s.charCodeAt(i)+1;s=e>255?s.substring(0,i-1)+String.fromCharCode(s.charCodeAt(i-1)+1)+"\0":s.substring(0,i)+String.fromCharCode(e)}}mapBfRangeToArray(t,e,s){if(e-t>yn)throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.");const i=s.length;let n=0;for(;t<=e&&n<i;)this._map[t]=s[n++],++t}mapOne(t,e){this._map[t]=e}lookup(t){return this._map[t]}contains(t){return void 0!==this._map[t]}forEach(t){const e=this._map,s=e.length;if(s<=65536)for(let i=0;i<s;i++)void 0!==e[i]&&t(i,e[i]);else for(const s in e)t(s,e[s])}charCodeOf(t){const e=this._map;if(e.length<=65536)return e.indexOf(t);for(const s in e)if(e[s]===t)return 0|s;return-1}getMap(){return this._map}readCharCode(t,e,s){let i=0;const n=this.codespaceRanges;for(let a=0,r=n.length;a<r;a++){i=(i<<8|t.charCodeAt(e+a))>>>0;const r=n[a];for(let t=0,e=r.length;t<e;){const e=r[t++],n=r[t++];if(i>=e&&i<=n)return s.charcode=i,void(s.length=a+1)}}s.charcode=0,s.length=1}getCharCodeLength(t){const e=this.codespaceRanges;for(let s=0,i=e.length;s<i;s++){const i=e[s];for(let e=0,n=i.length;e<n;){const n=i[e++],a=i[e++];if(t>=n&&t<=a)return s+1}}return 1}get length(){return this._map.length}get isIdentityCMap(){if("Identity-H"!==this.name&&"Identity-V"!==this.name)return!1;if(65536!==this._map.length)return!1;for(let t=0;t<65536;t++)if(this._map[t]!==t)return!1;return!0}},vn=class extends xn{constructor(t,e){super(),this.vertical=t,this.addCodespaceRange(e,0,65535)}mapCidRange(t,e,s){unreachable$1("should not call mapCidRange")}mapBfRange(t,e,s){unreachable$1("should not call mapBfRange")}mapBfRangeToArray(t,e,s){unreachable$1("should not call mapBfRangeToArray")}mapOne(t,e){unreachable$1("should not call mapCidOne")}lookup(t){return Number.isInteger(t)&&t<=65535?t:void 0}contains(t){return Number.isInteger(t)&&t<=65535}forEach(t){for(let e=0;e<=65535;e++)t(e,e)}charCodeOf(t){return Number.isInteger(t)&&t<=65535?t:-1}getMap(){const t=new Array(65536);for(let e=0;e<=65535;e++)t[e]=e;return t}get length(){return 65536}get isIdentityCMap(){unreachable$1("should not access .isIdentityCMap")}};function strToInt(t){let e=0;for(let s=0;s<t.length;s++)e=e<<8|t.charCodeAt(s);return e>>>0}function expectString(t){if("string"!=typeof t)throw new Ze("Malformed CMap: expected string.")}function expectInt(t){if(!Number.isInteger(t))throw new Ze("Malformed CMap: expected int.")}function parseBfChar(t,e){for(;;){let s=e.getObj();if(s===os)break;if(isCmd(s,"endbfchar"))return;expectString(s);const i=strToInt(s);s=e.getObj(),expectString(s);const n=s;t.mapOne(i,n)}}function parseBfRange(t,e){for(;;){let s=e.getObj();if(s===os)break;if(isCmd(s,"endbfrange"))return;expectString(s);const i=strToInt(s);s=e.getObj(),expectString(s);const n=strToInt(s);if(s=e.getObj(),Number.isInteger(s)||"string"==typeof s){const e=Number.isInteger(s)?String.fromCharCode(s):s;t.mapBfRange(i,n,e)}else{if(!isCmd(s,"["))break;{s=e.getObj();const a=[];for(;!isCmd(s,"]")&&s!==os;)a.push(s),s=e.getObj();t.mapBfRangeToArray(i,n,a)}}}throw new Ze("Invalid bf range.")}function parseCidChar(t,e){for(;;){let s=e.getObj();if(s===os)break;if(isCmd(s,"endcidchar"))return;expectString(s);const i=strToInt(s);s=e.getObj(),expectInt(s);const n=s;t.mapOne(i,n)}}function parseCidRange(t,e){for(;;){let s=e.getObj();if(s===os)break;if(isCmd(s,"endcidrange"))return;expectString(s);const i=strToInt(s);s=e.getObj(),expectString(s);const n=strToInt(s);s=e.getObj(),expectInt(s);const a=s;t.mapCidRange(i,n,a)}}function parseCodespaceRange(t,e){for(;;){let s=e.getObj();if(s===os)break;if(isCmd(s,"endcodespacerange"))return;if("string"!=typeof s)break;const i=strToInt(s);if(s=e.getObj(),"string"!=typeof s)break;const n=strToInt(s);t.addCodespaceRange(s.length,i,n)}throw new Ze("Invalid codespace range.")}function parseWMode(t,e){const s=e.getObj();Number.isInteger(s)&&(t.vertical=!!s)}function parseCMapName(t,e){const s=e.getObj();s instanceof us&&(t.name=s.name)}async function parseCMap(t,e,s,i){let n,a;t:for(;;)try{const s=e.getObj();if(s===os)break;if(s instanceof us)"WMode"===s.name?parseWMode(t,e):"CMapName"===s.name&&parseCMapName(t,e),n=s;else if(s instanceof ds)switch(s.cmd){case"endcmap":break t;case"usecmap":n instanceof us&&(a=n.name);break;case"begincodespacerange":parseCodespaceRange(t,e);break;case"beginbfchar":parseBfChar(t,e);break;case"begincidchar":parseCidChar(t,e);break;case"beginbfrange":parseBfRange(t,e);break;case"begincidrange":parseCidRange(t,e)}}catch(t){if(t instanceof ks)throw t;warn$1("Invalid cMap data: "+t);continue}return!i&&a&&(i=a),i?extendCMap(t,s,i):t}async function extendCMap(t,e,s){if(t.useCMap=await createBuiltInCMap(s,e),0===t.numCodespaceRanges){const e=t.useCMap.codespaceRanges;for(let s=0;s<e.length;s++)t.codespaceRanges[s]=e[s].slice();t.numCodespaceRanges=t.useCMap.numCodespaceRanges}return t.useCMap.forEach(function(e,s){t.contains(e)||t.mapOne(e,s)}),t}async function createBuiltInCMap(t,e){if("Identity-H"===t)return new vn(!1,2);if("Identity-V"===t)return new vn(!0,2);if(!wn.includes(t))throw new Error("Unknown CMap name: "+t);if(!e)throw new Error("Built-in CMap parameters are not provided.");const{cMapData:s,isCompressed:i}=await e(t),n=new xn(!0);if(i)return(new Ii).process(s,n,t=>extendCMap(n,e,t));const a=new mn(new Ks(s));return parseCMap(n,a,e,null)}var An=class{static async create({encoding:t,fetchBuiltInCMap:e,useCMap:s}){if(t instanceof us)return createBuiltInCMap(t.name,e);if(t instanceof bs){const i=await parseCMap(new xn,new mn(t),e,s);return i.isIdentityCMap?createBuiltInCMap(i.name,e):i}throw new Error("Encoding required.")}},kn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],Sn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","centoldstyle","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","","threequartersemdash","","questionsmall","","","","","Ethsmall","","","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","","","","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hypheninferior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","asuperior","centsuperior","","","","","Aacutesmall","Agravesmall","Acircumflexsmall","Adieresissmall","Atildesmall","Aringsmall","Ccedillasmall","Eacutesmall","Egravesmall","Ecircumflexsmall","Edieresissmall","Iacutesmall","Igravesmall","Icircumflexsmall","Idieresissmall","Ntildesmall","Oacutesmall","Ogravesmall","Ocircumflexsmall","Odieresissmall","Otildesmall","Uacutesmall","Ugravesmall","Ucircumflexsmall","Udieresissmall","","eightsuperior","fourinferior","threeinferior","sixinferior","eightinferior","seveninferior","Scaronsmall","","centinferior","twoinferior","","Dieresissmall","","Caronsmall","osuperior","fiveinferior","","commainferior","periodinferior","Yacutesmall","","dollarinferior","","","Thornsmall","","nineinferior","zeroinferior","Zcaronsmall","AEsmall","Oslashsmall","questiondownsmall","oneinferior","Lslashsmall","","","","","","","Cedillasmall","","","","","","OEsmall","figuredash","hyphensuperior","","","","","exclamdownsmall","","Ydieresissmall","","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","ninesuperior","zerosuperior","","esuperior","rsuperior","tsuperior","","","isuperior","ssuperior","dsuperior","","","","","","lsuperior","Ogoneksmall","Brevesmall","Macronsmall","bsuperior","nsuperior","msuperior","commasuperior","periodsuperior","Dotaccentsmall","Ringsmall","","","",""],Cn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","space","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron"],_n=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls","","","",""],In=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","bullet","Euro","bullet","quotesinglbase","florin","quotedblbase","ellipsis","dagger","daggerdbl","circumflex","perthousand","Scaron","guilsinglleft","OE","bullet","Zcaron","bullet","bullet","quoteleft","quoteright","quotedblleft","quotedblright","bullet","endash","emdash","tilde","trademark","scaron","guilsinglright","oe","bullet","zcaron","Ydieresis","space","exclamdown","cent","sterling","currency","yen","brokenbar","section","dieresis","copyright","ordfeminine","guillemotleft","logicalnot","hyphen","registered","macron","degree","plusminus","twosuperior","threesuperior","acute","mu","paragraph","periodcentered","cedilla","onesuperior","ordmasculine","guillemotright","onequarter","onehalf","threequarters","questiondown","Agrave","Aacute","Acircumflex","Atilde","Adieresis","Aring","AE","Ccedilla","Egrave","Eacute","Ecircumflex","Edieresis","Igrave","Iacute","Icircumflex","Idieresis","Eth","Ntilde","Ograve","Oacute","Ocircumflex","Otilde","Odieresis","multiply","Oslash","Ugrave","Uacute","Ucircumflex","Udieresis","Yacute","Thorn","germandbls","agrave","aacute","acircumflex","atilde","adieresis","aring","ae","ccedilla","egrave","eacute","ecircumflex","edieresis","igrave","iacute","icircumflex","idieresis","eth","ntilde","ograve","oacute","ocircumflex","otilde","odieresis","divide","oslash","ugrave","uacute","ucircumflex","udieresis","yacute","thorn","ydieresis"],Tn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","universal","numbersign","existential","percent","ampersand","suchthat","parenleft","parenright","asteriskmath","plus","comma","minus","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","congruent","Alpha","Beta","Chi","Delta","Epsilon","Phi","Gamma","Eta","Iota","theta1","Kappa","Lambda","Mu","Nu","Omicron","Pi","Theta","Rho","Sigma","Tau","Upsilon","sigma1","Omega","Xi","Psi","Zeta","bracketleft","therefore","bracketright","perpendicular","underscore","radicalex","alpha","beta","chi","delta","epsilon","phi","gamma","eta","iota","phi1","kappa","lambda","mu","nu","omicron","pi","theta","rho","sigma","tau","upsilon","omega1","omega","xi","psi","zeta","braceleft","bar","braceright","similar","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Euro","Upsilon1","minute","lessequal","fraction","infinity","florin","club","diamond","heart","spade","arrowboth","arrowleft","arrowup","arrowright","arrowdown","degree","plusminus","second","greaterequal","multiply","proportional","partialdiff","bullet","divide","notequal","equivalence","approxequal","ellipsis","arrowvertex","arrowhorizex","carriagereturn","aleph","Ifraktur","Rfraktur","weierstrass","circlemultiply","circleplus","emptyset","intersection","union","propersuperset","reflexsuperset","notsubset","propersubset","reflexsubset","element","notelement","angle","gradient","registerserif","copyrightserif","trademarkserif","product","radical","dotmath","logicalnot","logicaland","logicalor","arrowdblboth","arrowdblleft","arrowdblup","arrowdblright","arrowdbldown","lozenge","angleleft","registersans","copyrightsans","trademarksans","summation","parenlefttp","parenleftex","parenleftbt","bracketlefttp","bracketleftex","bracketleftbt","bracelefttp","braceleftmid","braceleftbt","braceex","","angleright","integral","integraltp","integralex","integralbt","parenrighttp","parenrightex","parenrightbt","bracketrighttp","bracketrightex","bracketrightbt","bracerighttp","bracerightmid","bracerightbt",""],Mn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","a1","a2","a202","a3","a4","a5","a119","a118","a117","a11","a12","a13","a14","a15","a16","a105","a17","a18","a19","a20","a21","a22","a23","a24","a25","a26","a27","a28","a6","a7","a8","a9","a10","a29","a30","a31","a32","a33","a34","a35","a36","a37","a38","a39","a40","a41","a42","a43","a44","a45","a46","a47","a48","a49","a50","a51","a52","a53","a54","a55","a56","a57","a58","a59","a60","a61","a62","a63","a64","a65","a66","a67","a68","a69","a70","a71","a72","a73","a74","a203","a75","a204","a76","a77","a78","a79","a81","a82","a83","a84","a97","a98","a99","a100","","a89","a90","a93","a94","a91","a92","a205","a85","a206","a86","a87","a88","a95","a96","","","","","","","","","","","","","","","","","","","","a101","a102","a103","a104","a106","a107","a108","a112","a111","a110","a109","a120","a121","a122","a123","a124","a125","a126","a127","a128","a129","a130","a131","a132","a133","a134","a135","a136","a137","a138","a139","a140","a141","a142","a143","a144","a145","a146","a147","a148","a149","a150","a151","a152","a153","a154","a155","a156","a157","a158","a159","a160","a161","a163","a164","a196","a165","a192","a166","a167","a168","a169","a170","a171","a172","a173","a162","a174","a175","a176","a177","a178","a179","a193","a180","a199","a181","a200","a182","","a201","a183","a184","a197","a185","a194","a198","a186","a195","a187","a188","a189","a190","a191",""];function getEncoding(t){switch(t){case"WinAnsiEncoding":return In;case"StandardEncoding":return _n;case"MacRomanEncoding":return Cn;case"SymbolSetEncoding":return Tn;case"ZapfDingbatsEncoding":return Mn;case"ExpertEncoding":return kn;case"MacExpertEncoding":return Sn;default:return null}}var En=getLookupTableFactory(function(t){t.A=65,t.AE=198,t.AEacute=508,t.AEmacron=482,t.AEsmall=63462,t.Aacute=193,t.Aacutesmall=63457,t.Abreve=258,t.Abreveacute=7854,t.Abrevecyrillic=1232,t.Abrevedotbelow=7862,t.Abrevegrave=7856,t.Abrevehookabove=7858,t.Abrevetilde=7860,t.Acaron=461,t.Acircle=9398,t.Acircumflex=194,t.Acircumflexacute=7844,t.Acircumflexdotbelow=7852,t.Acircumflexgrave=7846,t.Acircumflexhookabove=7848,t.Acircumflexsmall=63458,t.Acircumflextilde=7850,t.Acute=63177,t.Acutesmall=63412,t.Acyrillic=1040,t.Adblgrave=512,t.Adieresis=196,t.Adieresiscyrillic=1234,t.Adieresismacron=478,t.Adieresissmall=63460,t.Adotbelow=7840,t.Adotmacron=480,t.Agrave=192,t.Agravesmall=63456,t.Ahookabove=7842,t.Aiecyrillic=1236,t.Ainvertedbreve=514,t.Alpha=913,t.Alphatonos=902,t.Amacron=256,t.Amonospace=65313,t.Aogonek=260,t.Aring=197,t.Aringacute=506,t.Aringbelow=7680,t.Aringsmall=63461,t.Asmall=63329,t.Atilde=195,t.Atildesmall=63459,t.Aybarmenian=1329,t.B=66,t.Bcircle=9399,t.Bdotaccent=7682,t.Bdotbelow=7684,t.Becyrillic=1041,t.Benarmenian=1330,t.Beta=914,t.Bhook=385,t.Blinebelow=7686,t.Bmonospace=65314,t.Brevesmall=63220,t.Bsmall=63330,t.Btopbar=386,t.C=67,t.Caarmenian=1342,t.Cacute=262,t.Caron=63178,t.Caronsmall=63221,t.Ccaron=268,t.Ccedilla=199,t.Ccedillaacute=7688,t.Ccedillasmall=63463,t.Ccircle=9400,t.Ccircumflex=264,t.Cdot=266,t.Cdotaccent=266,t.Cedillasmall=63416,t.Chaarmenian=1353,t.Cheabkhasiancyrillic=1212,t.Checyrillic=1063,t.Chedescenderabkhasiancyrillic=1214,t.Chedescendercyrillic=1206,t.Chedieresiscyrillic=1268,t.Cheharmenian=1347,t.Chekhakassiancyrillic=1227,t.Cheverticalstrokecyrillic=1208,t.Chi=935,t.Chook=391,t.Circumflexsmall=63222,t.Cmonospace=65315,t.Coarmenian=1361,t.Csmall=63331,t.D=68,t.DZ=497,t.DZcaron=452,t.Daarmenian=1332,t.Dafrican=393,t.Dcaron=270,t.Dcedilla=7696,t.Dcircle=9401,t.Dcircumflexbelow=7698,t.Dcroat=272,t.Ddotaccent=7690,t.Ddotbelow=7692,t.Decyrillic=1044,t.Deicoptic=1006,t.Delta=8710,t.Deltagreek=916,t.Dhook=394,t.Dieresis=63179,t.DieresisAcute=63180,t.DieresisGrave=63181,t.Dieresissmall=63400,t.Digammagreek=988,t.Djecyrillic=1026,t.Dlinebelow=7694,t.Dmonospace=65316,t.Dotaccentsmall=63223,t.Dslash=272,t.Dsmall=63332,t.Dtopbar=395,t.Dz=498,t.Dzcaron=453,t.Dzeabkhasiancyrillic=1248,t.Dzecyrillic=1029,t.Dzhecyrillic=1039,t.E=69,t.Eacute=201,t.Eacutesmall=63465,t.Ebreve=276,t.Ecaron=282,t.Ecedillabreve=7708,t.Echarmenian=1333,t.Ecircle=9402,t.Ecircumflex=202,t.Ecircumflexacute=7870,t.Ecircumflexbelow=7704,t.Ecircumflexdotbelow=7878,t.Ecircumflexgrave=7872,t.Ecircumflexhookabove=7874,t.Ecircumflexsmall=63466,t.Ecircumflextilde=7876,t.Ecyrillic=1028,t.Edblgrave=516,t.Edieresis=203,t.Edieresissmall=63467,t.Edot=278,t.Edotaccent=278,t.Edotbelow=7864,t.Efcyrillic=1060,t.Egrave=200,t.Egravesmall=63464,t.Eharmenian=1335,t.Ehookabove=7866,t.Eightroman=8551,t.Einvertedbreve=518,t.Eiotifiedcyrillic=1124,t.Elcyrillic=1051,t.Elevenroman=8554,t.Emacron=274,t.Emacronacute=7702,t.Emacrongrave=7700,t.Emcyrillic=1052,t.Emonospace=65317,t.Encyrillic=1053,t.Endescendercyrillic=1186,t.Eng=330,t.Enghecyrillic=1188,t.Enhookcyrillic=1223,t.Eogonek=280,t.Eopen=400,t.Epsilon=917,t.Epsilontonos=904,t.Ercyrillic=1056,t.Ereversed=398,t.Ereversedcyrillic=1069,t.Escyrillic=1057,t.Esdescendercyrillic=1194,t.Esh=425,t.Esmall=63333,t.Eta=919,t.Etarmenian=1336,t.Etatonos=905,t.Eth=208,t.Ethsmall=63472,t.Etilde=7868,t.Etildebelow=7706,t.Euro=8364,t.Ezh=439,t.Ezhcaron=494,t.Ezhreversed=440,t.F=70,t.Fcircle=9403,t.Fdotaccent=7710,t.Feharmenian=1366,t.Feicoptic=996,t.Fhook=401,t.Fitacyrillic=1138,t.Fiveroman=8548,t.Fmonospace=65318,t.Fourroman=8547,t.Fsmall=63334,t.G=71,t.GBsquare=13191,t.Gacute=500,t.Gamma=915,t.Gammaafrican=404,t.Gangiacoptic=1002,t.Gbreve=286,t.Gcaron=486,t.Gcedilla=290,t.Gcircle=9404,t.Gcircumflex=284,t.Gcommaaccent=290,t.Gdot=288,t.Gdotaccent=288,t.Gecyrillic=1043,t.Ghadarmenian=1346,t.Ghemiddlehookcyrillic=1172,t.Ghestrokecyrillic=1170,t.Gheupturncyrillic=1168,t.Ghook=403,t.Gimarmenian=1331,t.Gjecyrillic=1027,t.Gmacron=7712,t.Gmonospace=65319,t.Grave=63182,t.Gravesmall=63328,t.Gsmall=63335,t.Gsmallhook=667,t.Gstroke=484,t.H=72,t.H18533=9679,t.H18543=9642,t.H18551=9643,t.H22073=9633,t.HPsquare=13259,t.Haabkhasiancyrillic=1192,t.Hadescendercyrillic=1202,t.Hardsigncyrillic=1066,t.Hbar=294,t.Hbrevebelow=7722,t.Hcedilla=7720,t.Hcircle=9405,t.Hcircumflex=292,t.Hdieresis=7718,t.Hdotaccent=7714,t.Hdotbelow=7716,t.Hmonospace=65320,t.Hoarmenian=1344,t.Horicoptic=1e3,t.Hsmall=63336,t.Hungarumlaut=63183,t.Hungarumlautsmall=63224,t.Hzsquare=13200,t.I=73,t.IAcyrillic=1071,t.IJ=306,t.IUcyrillic=1070,t.Iacute=205,t.Iacutesmall=63469,t.Ibreve=300,t.Icaron=463,t.Icircle=9406,t.Icircumflex=206,t.Icircumflexsmall=63470,t.Icyrillic=1030,t.Idblgrave=520,t.Idieresis=207,t.Idieresisacute=7726,t.Idieresiscyrillic=1252,t.Idieresissmall=63471,t.Idot=304,t.Idotaccent=304,t.Idotbelow=7882,t.Iebrevecyrillic=1238,t.Iecyrillic=1045,t.Ifraktur=8465,t.Igrave=204,t.Igravesmall=63468,t.Ihookabove=7880,t.Iicyrillic=1048,t.Iinvertedbreve=522,t.Iishortcyrillic=1049,t.Imacron=298,t.Imacroncyrillic=1250,t.Imonospace=65321,t.Iniarmenian=1339,t.Iocyrillic=1025,t.Iogonek=302,t.Iota=921,t.Iotaafrican=406,t.Iotadieresis=938,t.Iotatonos=906,t.Ismall=63337,t.Istroke=407,t.Itilde=296,t.Itildebelow=7724,t.Izhitsacyrillic=1140,t.Izhitsadblgravecyrillic=1142,t.J=74,t.Jaarmenian=1345,t.Jcircle=9407,t.Jcircumflex=308,t.Jecyrillic=1032,t.Jheharmenian=1355,t.Jmonospace=65322,t.Jsmall=63338,t.K=75,t.KBsquare=13189,t.KKsquare=13261,t.Kabashkircyrillic=1184,t.Kacute=7728,t.Kacyrillic=1050,t.Kadescendercyrillic=1178,t.Kahookcyrillic=1219,t.Kappa=922,t.Kastrokecyrillic=1182,t.Kaverticalstrokecyrillic=1180,t.Kcaron=488,t.Kcedilla=310,t.Kcircle=9408,t.Kcommaaccent=310,t.Kdotbelow=7730,t.Keharmenian=1364,t.Kenarmenian=1343,t.Khacyrillic=1061,t.Kheicoptic=998,t.Khook=408,t.Kjecyrillic=1036,t.Klinebelow=7732,t.Kmonospace=65323,t.Koppacyrillic=1152,t.Koppagreek=990,t.Ksicyrillic=1134,t.Ksmall=63339,t.L=76,t.LJ=455,t.LL=63167,t.Lacute=313,t.Lambda=923,t.Lcaron=317,t.Lcedilla=315,t.Lcircle=9409,t.Lcircumflexbelow=7740,t.Lcommaaccent=315,t.Ldot=319,t.Ldotaccent=319,t.Ldotbelow=7734,t.Ldotbelowmacron=7736,t.Liwnarmenian=1340,t.Lj=456,t.Ljecyrillic=1033,t.Llinebelow=7738,t.Lmonospace=65324,t.Lslash=321,t.Lslashsmall=63225,t.Lsmall=63340,t.M=77,t.MBsquare=13190,t.Macron=63184,t.Macronsmall=63407,t.Macute=7742,t.Mcircle=9410,t.Mdotaccent=7744,t.Mdotbelow=7746,t.Menarmenian=1348,t.Mmonospace=65325,t.Msmall=63341,t.Mturned=412,t.Mu=924,t.N=78,t.NJ=458,t.Nacute=323,t.Ncaron=327,t.Ncedilla=325,t.Ncircle=9411,t.Ncircumflexbelow=7754,t.Ncommaaccent=325,t.Ndotaccent=7748,t.Ndotbelow=7750,t.Nhookleft=413,t.Nineroman=8552,t.Nj=459,t.Njecyrillic=1034,t.Nlinebelow=7752,t.Nmonospace=65326,t.Nowarmenian=1350,t.Nsmall=63342,t.Ntilde=209,t.Ntildesmall=63473,t.Nu=925,t.O=79,t.OE=338,t.OEsmall=63226,t.Oacute=211,t.Oacutesmall=63475,t.Obarredcyrillic=1256,t.Obarreddieresiscyrillic=1258,t.Obreve=334,t.Ocaron=465,t.Ocenteredtilde=415,t.Ocircle=9412,t.Ocircumflex=212,t.Ocircumflexacute=7888,t.Ocircumflexdotbelow=7896,t.Ocircumflexgrave=7890,t.Ocircumflexhookabove=7892,t.Ocircumflexsmall=63476,t.Ocircumflextilde=7894,t.Ocyrillic=1054,t.Odblacute=336,t.Odblgrave=524,t.Odieresis=214,t.Odieresiscyrillic=1254,t.Odieresissmall=63478,t.Odotbelow=7884,t.Ogoneksmall=63227,t.Ograve=210,t.Ogravesmall=63474,t.Oharmenian=1365,t.Ohm=8486,t.Ohookabove=7886,t.Ohorn=416,t.Ohornacute=7898,t.Ohorndotbelow=7906,t.Ohorngrave=7900,t.Ohornhookabove=7902,t.Ohorntilde=7904,t.Ohungarumlaut=336,t.Oi=418,t.Oinvertedbreve=526,t.Omacron=332,t.Omacronacute=7762,t.Omacrongrave=7760,t.Omega=8486,t.Omegacyrillic=1120,t.Omegagreek=937,t.Omegaroundcyrillic=1146,t.Omegatitlocyrillic=1148,t.Omegatonos=911,t.Omicron=927,t.Omicrontonos=908,t.Omonospace=65327,t.Oneroman=8544,t.Oogonek=490,t.Oogonekmacron=492,t.Oopen=390,t.Oslash=216,t.Oslashacute=510,t.Oslashsmall=63480,t.Osmall=63343,t.Ostrokeacute=510,t.Otcyrillic=1150,t.Otilde=213,t.Otildeacute=7756,t.Otildedieresis=7758,t.Otildesmall=63477,t.P=80,t.Pacute=7764,t.Pcircle=9413,t.Pdotaccent=7766,t.Pecyrillic=1055,t.Peharmenian=1354,t.Pemiddlehookcyrillic=1190,t.Phi=934,t.Phook=420,t.Pi=928,t.Piwrarmenian=1363,t.Pmonospace=65328,t.Psi=936,t.Psicyrillic=1136,t.Psmall=63344,t.Q=81,t.Qcircle=9414,t.Qmonospace=65329,t.Qsmall=63345,t.R=82,t.Raarmenian=1356,t.Racute=340,t.Rcaron=344,t.Rcedilla=342,t.Rcircle=9415,t.Rcommaaccent=342,t.Rdblgrave=528,t.Rdotaccent=7768,t.Rdotbelow=7770,t.Rdotbelowmacron=7772,t.Reharmenian=1360,t.Rfraktur=8476,t.Rho=929,t.Ringsmall=63228,t.Rinvertedbreve=530,t.Rlinebelow=7774,t.Rmonospace=65330,t.Rsmall=63346,t.Rsmallinverted=641,t.Rsmallinvertedsuperior=694,t.S=83,t.SF010000=9484,t.SF020000=9492,t.SF030000=9488,t.SF040000=9496,t.SF050000=9532,t.SF060000=9516,t.SF070000=9524,t.SF080000=9500,t.SF090000=9508,t.SF100000=9472,t.SF110000=9474,t.SF190000=9569,t.SF200000=9570,t.SF210000=9558,t.SF220000=9557,t.SF230000=9571,t.SF240000=9553,t.SF250000=9559,t.SF260000=9565,t.SF270000=9564,t.SF280000=9563,t.SF360000=9566,t.SF370000=9567,t.SF380000=9562,t.SF390000=9556,t.SF400000=9577,t.SF410000=9574,t.SF420000=9568,t.SF430000=9552,t.SF440000=9580,t.SF450000=9575,t.SF460000=9576,t.SF470000=9572,t.SF480000=9573,t.SF490000=9561,t.SF500000=9560,t.SF510000=9554,t.SF520000=9555,t.SF530000=9579,t.SF540000=9578,t.Sacute=346,t.Sacutedotaccent=7780,t.Sampigreek=992,t.Scaron=352,t.Scarondotaccent=7782,t.Scaronsmall=63229,t.Scedilla=350,t.Schwa=399,t.Schwacyrillic=1240,t.Schwadieresiscyrillic=1242,t.Scircle=9416,t.Scircumflex=348,t.Scommaaccent=536,t.Sdotaccent=7776,t.Sdotbelow=7778,t.Sdotbelowdotaccent=7784,t.Seharmenian=1357,t.Sevenroman=8550,t.Shaarmenian=1351,t.Shacyrillic=1064,t.Shchacyrillic=1065,t.Sheicoptic=994,t.Shhacyrillic=1210,t.Shimacoptic=1004,t.Sigma=931,t.Sixroman=8549,t.Smonospace=65331,t.Softsigncyrillic=1068,t.Ssmall=63347,t.Stigmagreek=986,t.T=84,t.Tau=932,t.Tbar=358,t.Tcaron=356,t.Tcedilla=354,t.Tcircle=9417,t.Tcircumflexbelow=7792,t.Tcommaaccent=354,t.Tdotaccent=7786,t.Tdotbelow=7788,t.Tecyrillic=1058,t.Tedescendercyrillic=1196,t.Tenroman=8553,t.Tetsecyrillic=1204,t.Theta=920,t.Thook=428,t.Thorn=222,t.Thornsmall=63486,t.Threeroman=8546,t.Tildesmall=63230,t.Tiwnarmenian=1359,t.Tlinebelow=7790,t.Tmonospace=65332,t.Toarmenian=1337,t.Tonefive=444,t.Tonesix=388,t.Tonetwo=423,t.Tretroflexhook=430,t.Tsecyrillic=1062,t.Tshecyrillic=1035,t.Tsmall=63348,t.Twelveroman=8555,t.Tworoman=8545,t.U=85,t.Uacute=218,t.Uacutesmall=63482,t.Ubreve=364,t.Ucaron=467,t.Ucircle=9418,t.Ucircumflex=219,t.Ucircumflexbelow=7798,t.Ucircumflexsmall=63483,t.Ucyrillic=1059,t.Udblacute=368,t.Udblgrave=532,t.Udieresis=220,t.Udieresisacute=471,t.Udieresisbelow=7794,t.Udieresiscaron=473,t.Udieresiscyrillic=1264,t.Udieresisgrave=475,t.Udieresismacron=469,t.Udieresissmall=63484,t.Udotbelow=7908,t.Ugrave=217,t.Ugravesmall=63481,t.Uhookabove=7910,t.Uhorn=431,t.Uhornacute=7912,t.Uhorndotbelow=7920,t.Uhorngrave=7914,t.Uhornhookabove=7916,t.Uhorntilde=7918,t.Uhungarumlaut=368,t.Uhungarumlautcyrillic=1266,t.Uinvertedbreve=534,t.Ukcyrillic=1144,t.Umacron=362,t.Umacroncyrillic=1262,t.Umacrondieresis=7802,t.Umonospace=65333,t.Uogonek=370,t.Upsilon=933,t.Upsilon1=978,t.Upsilonacutehooksymbolgreek=979,t.Upsilonafrican=433,t.Upsilondieresis=939,t.Upsilondieresishooksymbolgreek=980,t.Upsilonhooksymbol=978,t.Upsilontonos=910,t.Uring=366,t.Ushortcyrillic=1038,t.Usmall=63349,t.Ustraightcyrillic=1198,t.Ustraightstrokecyrillic=1200,t.Utilde=360,t.Utildeacute=7800,t.Utildebelow=7796,t.V=86,t.Vcircle=9419,t.Vdotbelow=7806,t.Vecyrillic=1042,t.Vewarmenian=1358,t.Vhook=434,t.Vmonospace=65334,t.Voarmenian=1352,t.Vsmall=63350,t.Vtilde=7804,t.W=87,t.Wacute=7810,t.Wcircle=9420,t.Wcircumflex=372,t.Wdieresis=7812,t.Wdotaccent=7814,t.Wdotbelow=7816,t.Wgrave=7808,t.Wmonospace=65335,t.Wsmall=63351,t.X=88,t.Xcircle=9421,t.Xdieresis=7820,t.Xdotaccent=7818,t.Xeharmenian=1341,t.Xi=926,t.Xmonospace=65336,t.Xsmall=63352,t.Y=89,t.Yacute=221,t.Yacutesmall=63485,t.Yatcyrillic=1122,t.Ycircle=9422,t.Ycircumflex=374,t.Ydieresis=376,t.Ydieresissmall=63487,t.Ydotaccent=7822,t.Ydotbelow=7924,t.Yericyrillic=1067,t.Yerudieresiscyrillic=1272,t.Ygrave=7922,t.Yhook=435,t.Yhookabove=7926,t.Yiarmenian=1349,t.Yicyrillic=1031,t.Yiwnarmenian=1362,t.Ymonospace=65337,t.Ysmall=63353,t.Ytilde=7928,t.Yusbigcyrillic=1130,t.Yusbigiotifiedcyrillic=1132,t.Yuslittlecyrillic=1126,t.Yuslittleiotifiedcyrillic=1128,t.Z=90,t.Zaarmenian=1334,t.Zacute=377,t.Zcaron=381,t.Zcaronsmall=63231,t.Zcircle=9423,t.Zcircumflex=7824,t.Zdot=379,t.Zdotaccent=379,t.Zdotbelow=7826,t.Zecyrillic=1047,t.Zedescendercyrillic=1176,t.Zedieresiscyrillic=1246,t.Zeta=918,t.Zhearmenian=1338,t.Zhebrevecyrillic=1217,t.Zhecyrillic=1046,t.Zhedescendercyrillic=1174,t.Zhedieresiscyrillic=1244,t.Zlinebelow=7828,t.Zmonospace=65338,t.Zsmall=63354,t.Zstroke=437,t.a=97,t.aabengali=2438,t.aacute=225,t.aadeva=2310,t.aagujarati=2694,t.aagurmukhi=2566,t.aamatragurmukhi=2622,t.aarusquare=13059,t.aavowelsignbengali=2494,t.aavowelsigndeva=2366,t.aavowelsigngujarati=2750,t.abbreviationmarkarmenian=1375,t.abbreviationsigndeva=2416,t.abengali=2437,t.abopomofo=12570,t.abreve=259,t.abreveacute=7855,t.abrevecyrillic=1233,t.abrevedotbelow=7863,t.abrevegrave=7857,t.abrevehookabove=7859,t.abrevetilde=7861,t.acaron=462,t.acircle=9424,t.acircumflex=226,t.acircumflexacute=7845,t.acircumflexdotbelow=7853,t.acircumflexgrave=7847,t.acircumflexhookabove=7849,t.acircumflextilde=7851,t.acute=180,t.acutebelowcmb=791,t.acutecmb=769,t.acutecomb=769,t.acutedeva=2388,t.acutelowmod=719,t.acutetonecmb=833,t.acyrillic=1072,t.adblgrave=513,t.addakgurmukhi=2673,t.adeva=2309,t.adieresis=228,t.adieresiscyrillic=1235,t.adieresismacron=479,t.adotbelow=7841,t.adotmacron=481,t.ae=230,t.aeacute=509,t.aekorean=12624,t.aemacron=483,t.afii00208=8213,t.afii08941=8356,t.afii10017=1040,t.afii10018=1041,t.afii10019=1042,t.afii10020=1043,t.afii10021=1044,t.afii10022=1045,t.afii10023=1025,t.afii10024=1046,t.afii10025=1047,t.afii10026=1048,t.afii10027=1049,t.afii10028=1050,t.afii10029=1051,t.afii10030=1052;t.afii10031=1053,t.afii10032=1054,t.afii10033=1055,t.afii10034=1056,t.afii10035=1057,t.afii10036=1058,t.afii10037=1059,t.afii10038=1060,t.afii10039=1061,t.afii10040=1062,t.afii10041=1063,t.afii10042=1064,t.afii10043=1065,t.afii10044=1066,t.afii10045=1067,t.afii10046=1068,t.afii10047=1069,t.afii10048=1070,t.afii10049=1071,t.afii10050=1168,t.afii10051=1026,t.afii10052=1027,t.afii10053=1028,t.afii10054=1029,t.afii10055=1030,t.afii10056=1031,t.afii10057=1032,t.afii10058=1033,t.afii10059=1034,t.afii10060=1035,t.afii10061=1036,t.afii10062=1038,t.afii10063=63172,t.afii10064=63173,t.afii10065=1072,t.afii10066=1073,t.afii10067=1074,t.afii10068=1075,t.afii10069=1076,t.afii10070=1077,t.afii10071=1105,t.afii10072=1078,t.afii10073=1079,t.afii10074=1080,t.afii10075=1081,t.afii10076=1082,t.afii10077=1083,t.afii10078=1084,t.afii10079=1085,t.afii10080=1086,t.afii10081=1087,t.afii10082=1088,t.afii10083=1089,t.afii10084=1090,t.afii10085=1091,t.afii10086=1092,t.afii10087=1093,t.afii10088=1094,t.afii10089=1095,t.afii10090=1096,t.afii10091=1097,t.afii10092=1098,t.afii10093=1099,t.afii10094=1100,t.afii10095=1101,t.afii10096=1102,t.afii10097=1103,t.afii10098=1169,t.afii10099=1106,t.afii10100=1107,t.afii10101=1108,t.afii10102=1109,t.afii10103=1110,t.afii10104=1111,t.afii10105=1112,t.afii10106=1113,t.afii10107=1114,t.afii10108=1115,t.afii10109=1116,t.afii10110=1118,t.afii10145=1039,t.afii10146=1122,t.afii10147=1138,t.afii10148=1140,t.afii10192=63174,t.afii10193=1119,t.afii10194=1123,t.afii10195=1139,t.afii10196=1141,t.afii10831=63175,t.afii10832=63176,t.afii10846=1241,t.afii299=8206,t.afii300=8207,t.afii301=8205,t.afii57381=1642,t.afii57388=1548,t.afii57392=1632,t.afii57393=1633,t.afii57394=1634,t.afii57395=1635,t.afii57396=1636,t.afii57397=1637,t.afii57398=1638,t.afii57399=1639,t.afii57400=1640,t.afii57401=1641,t.afii57403=1563,t.afii57407=1567,t.afii57409=1569,t.afii57410=1570,t.afii57411=1571,t.afii57412=1572,t.afii57413=1573,t.afii57414=1574,t.afii57415=1575,t.afii57416=1576,t.afii57417=1577,t.afii57418=1578,t.afii57419=1579,t.afii57420=1580,t.afii57421=1581,t.afii57422=1582,t.afii57423=1583,t.afii57424=1584,t.afii57425=1585,t.afii57426=1586,t.afii57427=1587,t.afii57428=1588,t.afii57429=1589,t.afii57430=1590,t.afii57431=1591,t.afii57432=1592,t.afii57433=1593,t.afii57434=1594,t.afii57440=1600,t.afii57441=1601,t.afii57442=1602,t.afii57443=1603,t.afii57444=1604,t.afii57445=1605,t.afii57446=1606,t.afii57448=1608,t.afii57449=1609,t.afii57450=1610,t.afii57451=1611,t.afii57452=1612,t.afii57453=1613,t.afii57454=1614,t.afii57455=1615,t.afii57456=1616,t.afii57457=1617,t.afii57458=1618,t.afii57470=1607,t.afii57505=1700,t.afii57506=1662,t.afii57507=1670,t.afii57508=1688,t.afii57509=1711,t.afii57511=1657,t.afii57512=1672,t.afii57513=1681,t.afii57514=1722,t.afii57519=1746,t.afii57534=1749,t.afii57636=8362,t.afii57645=1470,t.afii57658=1475,t.afii57664=1488,t.afii57665=1489,t.afii57666=1490,t.afii57667=1491,t.afii57668=1492,t.afii57669=1493,t.afii57670=1494,t.afii57671=1495,t.afii57672=1496,t.afii57673=1497,t.afii57674=1498,t.afii57675=1499,t.afii57676=1500,t.afii57677=1501,t.afii57678=1502,t.afii57679=1503,t.afii57680=1504,t.afii57681=1505,t.afii57682=1506,t.afii57683=1507,t.afii57684=1508,t.afii57685=1509,t.afii57686=1510,t.afii57687=1511,t.afii57688=1512,t.afii57689=1513,t.afii57690=1514,t.afii57694=64298,t.afii57695=64299,t.afii57700=64331,t.afii57705=64287,t.afii57716=1520,t.afii57717=1521,t.afii57718=1522,t.afii57723=64309,t.afii57793=1460,t.afii57794=1461,t.afii57795=1462,t.afii57796=1467,t.afii57797=1464,t.afii57798=1463,t.afii57799=1456,t.afii57800=1458,t.afii57801=1457,t.afii57802=1459,t.afii57803=1474,t.afii57804=1473,t.afii57806=1465,t.afii57807=1468,t.afii57839=1469,t.afii57841=1471,t.afii57842=1472,t.afii57929=700,t.afii61248=8453,t.afii61289=8467,t.afii61352=8470,t.afii61573=8236,t.afii61574=8237,t.afii61575=8238,t.afii61664=8204,t.afii63167=1645,t.afii64937=701,t.agrave=224,t.agujarati=2693,t.agurmukhi=2565,t.ahiragana=12354,t.ahookabove=7843,t.aibengali=2448,t.aibopomofo=12574,t.aideva=2320,t.aiecyrillic=1237,t.aigujarati=2704,t.aigurmukhi=2576,t.aimatragurmukhi=2632,t.ainarabic=1593,t.ainfinalarabic=65226,t.aininitialarabic=65227,t.ainmedialarabic=65228,t.ainvertedbreve=515,t.aivowelsignbengali=2504,t.aivowelsigndeva=2376,t.aivowelsigngujarati=2760,t.akatakana=12450,t.akatakanahalfwidth=65393,t.akorean=12623,t.alef=1488,t.alefarabic=1575,t.alefdageshhebrew=64304,t.aleffinalarabic=65166,t.alefhamzaabovearabic=1571,t.alefhamzaabovefinalarabic=65156,t.alefhamzabelowarabic=1573,t.alefhamzabelowfinalarabic=65160,t.alefhebrew=1488,t.aleflamedhebrew=64335,t.alefmaddaabovearabic=1570,t.alefmaddaabovefinalarabic=65154,t.alefmaksuraarabic=1609,t.alefmaksurafinalarabic=65264,t.alefmaksurainitialarabic=65267,t.alefmaksuramedialarabic=65268,t.alefpatahhebrew=64302,t.alefqamatshebrew=64303,t.aleph=8501,t.allequal=8780,t.alpha=945,t.alphatonos=940,t.amacron=257,t.amonospace=65345,t.ampersand=38,t.ampersandmonospace=65286,t.ampersandsmall=63270,t.amsquare=13250,t.anbopomofo=12578,t.angbopomofo=12580,t.angbracketleft=12296,t.angbracketright=12297,t.angkhankhuthai=3674,t.angle=8736,t.anglebracketleft=12296,t.anglebracketleftvertical=65087,t.anglebracketright=12297,t.anglebracketrightvertical=65088,t.angleleft=9001,t.angleright=9002,t.angstrom=8491,t.anoteleia=903,t.anudattadeva=2386,t.anusvarabengali=2434,t.anusvaradeva=2306,t.anusvaragujarati=2690,t.aogonek=261,t.apaatosquare=13056,t.aparen=9372,t.apostrophearmenian=1370,t.apostrophemod=700,t.apple=63743,t.approaches=8784,t.approxequal=8776,t.approxequalorimage=8786,t.approximatelyequal=8773,t.araeaekorean=12686,t.araeakorean=12685,t.arc=8978,t.arighthalfring=7834,t.aring=229,t.aringacute=507,t.aringbelow=7681,t.arrowboth=8596,t.arrowdashdown=8675,t.arrowdashleft=8672,t.arrowdashright=8674,t.arrowdashup=8673,t.arrowdblboth=8660,t.arrowdbldown=8659,t.arrowdblleft=8656,t.arrowdblright=8658,t.arrowdblup=8657,t.arrowdown=8595,t.arrowdownleft=8601,t.arrowdownright=8600,t.arrowdownwhite=8681,t.arrowheaddownmod=709,t.arrowheadleftmod=706,t.arrowheadrightmod=707,t.arrowheadupmod=708,t.arrowhorizex=63719,t.arrowleft=8592,t.arrowleftdbl=8656,t.arrowleftdblstroke=8653,t.arrowleftoverright=8646,t.arrowleftwhite=8678,t.arrowright=8594,t.arrowrightdblstroke=8655,t.arrowrightheavy=10142,t.arrowrightoverleft=8644,t.arrowrightwhite=8680,t.arrowtableft=8676,t.arrowtabright=8677,t.arrowup=8593,t.arrowupdn=8597,t.arrowupdnbse=8616,t.arrowupdownbase=8616,t.arrowupleft=8598,t.arrowupleftofdown=8645,t.arrowupright=8599,t.arrowupwhite=8679,t.arrowvertex=63718,t.asciicircum=94,t.asciicircummonospace=65342,t.asciitilde=126,t.asciitildemonospace=65374,t.ascript=593,t.ascriptturned=594,t.asmallhiragana=12353,t.asmallkatakana=12449,t.asmallkatakanahalfwidth=65383,t.asterisk=42,t.asteriskaltonearabic=1645,t.asteriskarabic=1645,t.asteriskmath=8727,t.asteriskmonospace=65290,t.asterisksmall=65121,t.asterism=8258,t.asuperior=63209,t.asymptoticallyequal=8771,t.at=64,t.atilde=227,t.atmonospace=65312,t.atsmall=65131,t.aturned=592,t.aubengali=2452,t.aubopomofo=12576,t.audeva=2324,t.augujarati=2708,t.augurmukhi=2580,t.aulengthmarkbengali=2519,t.aumatragurmukhi=2636,t.auvowelsignbengali=2508,t.auvowelsigndeva=2380,t.auvowelsigngujarati=2764,t.avagrahadeva=2365,t.aybarmenian=1377,t.ayin=1506,t.ayinaltonehebrew=64288,t.ayinhebrew=1506,t.b=98,t.babengali=2476,t.backslash=92,t.backslashmonospace=65340,t.badeva=2348,t.bagujarati=2732,t.bagurmukhi=2604,t.bahiragana=12400,t.bahtthai=3647,t.bakatakana=12496,t.bar=124,t.barmonospace=65372,t.bbopomofo=12549,t.bcircle=9425,t.bdotaccent=7683,t.bdotbelow=7685,t.beamedsixteenthnotes=9836,t.because=8757,t.becyrillic=1073,t.beharabic=1576,t.behfinalarabic=65168,t.behinitialarabic=65169,t.behiragana=12409,t.behmedialarabic=65170,t.behmeeminitialarabic=64671,t.behmeemisolatedarabic=64520,t.behnoonfinalarabic=64621,t.bekatakana=12505,t.benarmenian=1378,t.bet=1489,t.beta=946,t.betasymbolgreek=976,t.betdagesh=64305,t.betdageshhebrew=64305,t.bethebrew=1489,t.betrafehebrew=64332,t.bhabengali=2477,t.bhadeva=2349,t.bhagujarati=2733,t.bhagurmukhi=2605,t.bhook=595,t.bihiragana=12403,t.bikatakana=12499,t.bilabialclick=664,t.bindigurmukhi=2562,t.birusquare=13105,t.blackcircle=9679,t.blackdiamond=9670,t.blackdownpointingtriangle=9660,t.blackleftpointingpointer=9668,t.blackleftpointingtriangle=9664,t.blacklenticularbracketleft=12304,t.blacklenticularbracketleftvertical=65083,t.blacklenticularbracketright=12305,t.blacklenticularbracketrightvertical=65084,t.blacklowerlefttriangle=9699,t.blacklowerrighttriangle=9698,t.blackrectangle=9644,t.blackrightpointingpointer=9658,t.blackrightpointingtriangle=9654,t.blacksmallsquare=9642,t.blacksmilingface=9787,t.blacksquare=9632,t.blackstar=9733,t.blackupperlefttriangle=9700,t.blackupperrighttriangle=9701,t.blackuppointingsmalltriangle=9652,t.blackuppointingtriangle=9650,t.blank=9251,t.blinebelow=7687,t.block=9608,t.bmonospace=65346,t.bobaimaithai=3610,t.bohiragana=12412,t.bokatakana=12508,t.bparen=9373,t.bqsquare=13251,t.braceex=63732,t.braceleft=123,t.braceleftbt=63731,t.braceleftmid=63730,t.braceleftmonospace=65371,t.braceleftsmall=65115,t.bracelefttp=63729,t.braceleftvertical=65079,t.braceright=125,t.bracerightbt=63742,t.bracerightmid=63741,t.bracerightmonospace=65373,t.bracerightsmall=65116,t.bracerighttp=63740,t.bracerightvertical=65080,t.bracketleft=91,t.bracketleftbt=63728,t.bracketleftex=63727,t.bracketleftmonospace=65339,t.bracketlefttp=63726,t.bracketright=93,t.bracketrightbt=63739,t.bracketrightex=63738,t.bracketrightmonospace=65341,t.bracketrighttp=63737,t.breve=728,t.brevebelowcmb=814,t.brevecmb=774,t.breveinvertedbelowcmb=815,t.breveinvertedcmb=785,t.breveinverteddoublecmb=865,t.bridgebelowcmb=810,t.bridgeinvertedbelowcmb=826,t.brokenbar=166,t.bstroke=384,t.bsuperior=63210,t.btopbar=387,t.buhiragana=12406,t.bukatakana=12502,t.bullet=8226,t.bulletinverse=9688,t.bulletoperator=8729,t.bullseye=9678,t.c=99,t.caarmenian=1390,t.cabengali=2458,t.cacute=263,t.cadeva=2330,t.cagujarati=2714,t.cagurmukhi=2586,t.calsquare=13192,t.candrabindubengali=2433,t.candrabinducmb=784,t.candrabindudeva=2305,t.candrabindugujarati=2689,t.capslock=8682,t.careof=8453,t.caron=711,t.caronbelowcmb=812,t.caroncmb=780,t.carriagereturn=8629,t.cbopomofo=12568,t.ccaron=269,t.ccedilla=231,t.ccedillaacute=7689,t.ccircle=9426,t.ccircumflex=265,t.ccurl=597,t.cdot=267,t.cdotaccent=267,t.cdsquare=13253,t.cedilla=184,t.cedillacmb=807,t.cent=162,t.centigrade=8451,t.centinferior=63199,t.centmonospace=65504,t.centoldstyle=63394,t.centsuperior=63200,t.chaarmenian=1401,t.chabengali=2459,t.chadeva=2331,t.chagujarati=2715,t.chagurmukhi=2587,t.chbopomofo=12564,t.cheabkhasiancyrillic=1213,t.checkmark=10003,t.checyrillic=1095,t.chedescenderabkhasiancyrillic=1215,t.chedescendercyrillic=1207,t.chedieresiscyrillic=1269,t.cheharmenian=1395,t.chekhakassiancyrillic=1228,t.cheverticalstrokecyrillic=1209,t.chi=967,t.chieuchacirclekorean=12919,t.chieuchaparenkorean=12823,t.chieuchcirclekorean=12905,t.chieuchkorean=12618,t.chieuchparenkorean=12809,t.chochangthai=3594,t.chochanthai=3592,t.chochingthai=3593,t.chochoethai=3596,t.chook=392,t.cieucacirclekorean=12918,t.cieucaparenkorean=12822,t.cieuccirclekorean=12904,t.cieuckorean=12616,t.cieucparenkorean=12808,t.cieucuparenkorean=12828,t.circle=9675,t.circlecopyrt=169,t.circlemultiply=8855,t.circleot=8857,t.circleplus=8853,t.circlepostalmark=12342,t.circlewithlefthalfblack=9680,t.circlewithrighthalfblack=9681,t.circumflex=710,t.circumflexbelowcmb=813,t.circumflexcmb=770,t.clear=8999,t.clickalveolar=450,t.clickdental=448,t.clicklateral=449,t.clickretroflex=451,t.club=9827,t.clubsuitblack=9827,t.clubsuitwhite=9831,t.cmcubedsquare=13220,t.cmonospace=65347,t.cmsquaredsquare=13216,t.coarmenian=1409,t.colon=58,t.colonmonetary=8353,t.colonmonospace=65306,t.colonsign=8353,t.colonsmall=65109,t.colontriangularhalfmod=721,t.colontriangularmod=720,t.comma=44,t.commaabovecmb=787,t.commaaboverightcmb=789,t.commaaccent=63171,t.commaarabic=1548,t.commaarmenian=1373,t.commainferior=63201,t.commamonospace=65292,t.commareversedabovecmb=788,t.commareversedmod=701,t.commasmall=65104,t.commasuperior=63202,t.commaturnedabovecmb=786,t.commaturnedmod=699,t.compass=9788,t.congruent=8773,t.contourintegral=8750,t.control=8963,t.controlACK=6,t.controlBEL=7,t.controlBS=8,t.controlCAN=24,t.controlCR=13,t.controlDC1=17,t.controlDC2=18,t.controlDC3=19,t.controlDC4=20,t.controlDEL=127,t.controlDLE=16,t.controlEM=25,t.controlENQ=5,t.controlEOT=4,t.controlESC=27,t.controlETB=23,t.controlETX=3,t.controlFF=12,t.controlFS=28,t.controlGS=29,t.controlHT=9,t.controlLF=10,t.controlNAK=21,t.controlNULL=0,t.controlRS=30,t.controlSI=15,t.controlSO=14,t.controlSOT=2,t.controlSTX=1,t.controlSUB=26,t.controlSYN=22,t.controlUS=31,t.controlVT=11,t.copyright=169,t.copyrightsans=63721,t.copyrightserif=63193,t.cornerbracketleft=12300,t.cornerbracketlefthalfwidth=65378,t.cornerbracketleftvertical=65089,t.cornerbracketright=12301,t.cornerbracketrighthalfwidth=65379,t.cornerbracketrightvertical=65090,t.corporationsquare=13183,t.cosquare=13255,t.coverkgsquare=13254,t.cparen=9374,t.cruzeiro=8354,t.cstretched=663,t.curlyand=8911,t.curlyor=8910,t.currency=164,t.cyrBreve=63185,t.cyrFlex=63186,t.cyrbreve=63188,t.cyrflex=63189,t.d=100,t.daarmenian=1380,t.dabengali=2470,t.dadarabic=1590,t.dadeva=2342,t.dadfinalarabic=65214,t.dadinitialarabic=65215,t.dadmedialarabic=65216,t.dagesh=1468,t.dageshhebrew=1468,t.dagger=8224,t.daggerdbl=8225,t.dagujarati=2726,t.dagurmukhi=2598,t.dahiragana=12384,t.dakatakana=12480,t.dalarabic=1583,t.dalet=1491,t.daletdagesh=64307,t.daletdageshhebrew=64307,t.dalethebrew=1491,t.dalfinalarabic=65194,t.dammaarabic=1615,t.dammalowarabic=1615,t.dammatanaltonearabic=1612,t.dammatanarabic=1612,t.danda=2404,t.dargahebrew=1447,t.dargalefthebrew=1447,t.dasiapneumatacyrilliccmb=1157,t.dblGrave=63187,t.dblanglebracketleft=12298,t.dblanglebracketleftvertical=65085,t.dblanglebracketright=12299,t.dblanglebracketrightvertical=65086,t.dblarchinvertedbelowcmb=811,t.dblarrowleft=8660,t.dblarrowright=8658,t.dbldanda=2405,t.dblgrave=63190,t.dblgravecmb=783,t.dblintegral=8748,t.dbllowline=8215,t.dbllowlinecmb=819,t.dbloverlinecmb=831,t.dblprimemod=698,t.dblverticalbar=8214,t.dblverticallineabovecmb=782,t.dbopomofo=12553,t.dbsquare=13256,t.dcaron=271,t.dcedilla=7697,t.dcircle=9427,t.dcircumflexbelow=7699,t.dcroat=273,t.ddabengali=2465,t.ddadeva=2337,t.ddagujarati=2721,t.ddagurmukhi=2593,t.ddalarabic=1672,t.ddalfinalarabic=64393,t.dddhadeva=2396,t.ddhabengali=2466,t.ddhadeva=2338,t.ddhagujarati=2722,t.ddhagurmukhi=2594,t.ddotaccent=7691,t.ddotbelow=7693,t.decimalseparatorarabic=1643,t.decimalseparatorpersian=1643,t.decyrillic=1076,t.degree=176,t.dehihebrew=1453,t.dehiragana=12391,t.deicoptic=1007,t.dekatakana=12487,t.deleteleft=9003,t.deleteright=8998,t.delta=948,t.deltaturned=397,t.denominatorminusonenumeratorbengali=2552,t.dezh=676,t.dhabengali=2471,t.dhadeva=2343,t.dhagujarati=2727,t.dhagurmukhi=2599,t.dhook=599,t.dialytikatonos=901,t.dialytikatonoscmb=836,t.diamond=9830,t.diamondsuitwhite=9826,t.dieresis=168,t.dieresisacute=63191,t.dieresisbelowcmb=804,t.dieresiscmb=776,t.dieresisgrave=63192,t.dieresistonos=901,t.dihiragana=12386,t.dikatakana=12482,t.dittomark=12291,t.divide=247,t.divides=8739,t.divisionslash=8725,t.djecyrillic=1106,t.dkshade=9619,t.dlinebelow=7695,t.dlsquare=13207,t.dmacron=273,t.dmonospace=65348,t.dnblock=9604,t.dochadathai=3598,t.dodekthai=3604,t.dohiragana=12393,t.dokatakana=12489,t.dollar=36;t.dollarinferior=63203,t.dollarmonospace=65284,t.dollaroldstyle=63268,t.dollarsmall=65129,t.dollarsuperior=63204,t.dong=8363,t.dorusquare=13094,t.dotaccent=729,t.dotaccentcmb=775,t.dotbelowcmb=803,t.dotbelowcomb=803,t.dotkatakana=12539,t.dotlessi=305,t.dotlessj=63166,t.dotlessjstrokehook=644,t.dotmath=8901,t.dottedcircle=9676,t.doubleyodpatah=64287,t.doubleyodpatahhebrew=64287,t.downtackbelowcmb=798,t.downtackmod=725,t.dparen=9375,t.dsuperior=63211,t.dtail=598,t.dtopbar=396,t.duhiragana=12389,t.dukatakana=12485,t.dz=499,t.dzaltone=675,t.dzcaron=454,t.dzcurl=677,t.dzeabkhasiancyrillic=1249,t.dzecyrillic=1109,t.dzhecyrillic=1119,t.e=101,t.eacute=233,t.earth=9793,t.ebengali=2447,t.ebopomofo=12572,t.ebreve=277,t.ecandradeva=2317,t.ecandragujarati=2701,t.ecandravowelsigndeva=2373,t.ecandravowelsigngujarati=2757,t.ecaron=283,t.ecedillabreve=7709,t.echarmenian=1381,t.echyiwnarmenian=1415,t.ecircle=9428,t.ecircumflex=234,t.ecircumflexacute=7871,t.ecircumflexbelow=7705,t.ecircumflexdotbelow=7879,t.ecircumflexgrave=7873,t.ecircumflexhookabove=7875,t.ecircumflextilde=7877,t.ecyrillic=1108,t.edblgrave=517,t.edeva=2319,t.edieresis=235,t.edot=279,t.edotaccent=279,t.edotbelow=7865,t.eegurmukhi=2575,t.eematragurmukhi=2631,t.efcyrillic=1092,t.egrave=232,t.egujarati=2703,t.eharmenian=1383,t.ehbopomofo=12573,t.ehiragana=12360,t.ehookabove=7867,t.eibopomofo=12575,t.eight=56,t.eightarabic=1640,t.eightbengali=2542,t.eightcircle=9319,t.eightcircleinversesansserif=10129,t.eightdeva=2414,t.eighteencircle=9329,t.eighteenparen=9349,t.eighteenperiod=9369,t.eightgujarati=2798,t.eightgurmukhi=2670,t.eighthackarabic=1640,t.eighthangzhou=12328,t.eighthnotebeamed=9835,t.eightideographicparen=12839,t.eightinferior=8328,t.eightmonospace=65304,t.eightoldstyle=63288,t.eightparen=9339,t.eightperiod=9359,t.eightpersian=1784,t.eightroman=8567,t.eightsuperior=8312,t.eightthai=3672,t.einvertedbreve=519,t.eiotifiedcyrillic=1125,t.ekatakana=12456,t.ekatakanahalfwidth=65396,t.ekonkargurmukhi=2676,t.ekorean=12628,t.elcyrillic=1083,t.element=8712,t.elevencircle=9322,t.elevenparen=9342,t.elevenperiod=9362,t.elevenroman=8570,t.ellipsis=8230,t.ellipsisvertical=8942,t.emacron=275,t.emacronacute=7703,t.emacrongrave=7701,t.emcyrillic=1084,t.emdash=8212,t.emdashvertical=65073,t.emonospace=65349,t.emphasismarkarmenian=1371,t.emptyset=8709,t.enbopomofo=12579,t.encyrillic=1085,t.endash=8211,t.endashvertical=65074,t.endescendercyrillic=1187,t.eng=331,t.engbopomofo=12581,t.enghecyrillic=1189,t.enhookcyrillic=1224,t.enspace=8194,t.eogonek=281,t.eokorean=12627,t.eopen=603,t.eopenclosed=666,t.eopenreversed=604,t.eopenreversedclosed=606,t.eopenreversedhook=605,t.eparen=9376,t.epsilon=949,t.epsilontonos=941,t.equal=61,t.equalmonospace=65309,t.equalsmall=65126,t.equalsuperior=8316,t.equivalence=8801,t.erbopomofo=12582,t.ercyrillic=1088,t.ereversed=600,t.ereversedcyrillic=1101,t.escyrillic=1089,t.esdescendercyrillic=1195,t.esh=643,t.eshcurl=646,t.eshortdeva=2318,t.eshortvowelsigndeva=2374,t.eshreversedloop=426,t.eshsquatreversed=645,t.esmallhiragana=12359,t.esmallkatakana=12455,t.esmallkatakanahalfwidth=65386,t.estimated=8494,t.esuperior=63212,t.eta=951,t.etarmenian=1384,t.etatonos=942,t.eth=240,t.etilde=7869,t.etildebelow=7707,t.etnahtafoukhhebrew=1425,t.etnahtafoukhlefthebrew=1425,t.etnahtahebrew=1425,t.etnahtalefthebrew=1425,t.eturned=477,t.eukorean=12641,t.euro=8364,t.evowelsignbengali=2503,t.evowelsigndeva=2375,t.evowelsigngujarati=2759,t.exclam=33,t.exclamarmenian=1372,t.exclamdbl=8252,t.exclamdown=161,t.exclamdownsmall=63393,t.exclammonospace=65281,t.exclamsmall=63265,t.existential=8707,t.ezh=658,t.ezhcaron=495,t.ezhcurl=659,t.ezhreversed=441,t.ezhtail=442,t.f=102,t.fadeva=2398,t.fagurmukhi=2654,t.fahrenheit=8457,t.fathaarabic=1614,t.fathalowarabic=1614,t.fathatanarabic=1611,t.fbopomofo=12552,t.fcircle=9429,t.fdotaccent=7711,t.feharabic=1601,t.feharmenian=1414,t.fehfinalarabic=65234,t.fehinitialarabic=65235,t.fehmedialarabic=65236,t.feicoptic=997,t.female=9792,t.ff=64256,t.f_f=64256,t.ffi=64259,t.f_f_i=64259,t.ffl=64260,t.f_f_l=64260,t.fi=64257,t.f_i=64257,t.fifteencircle=9326,t.fifteenparen=9346,t.fifteenperiod=9366,t.figuredash=8210,t.filledbox=9632,t.filledrect=9644,t.finalkaf=1498,t.finalkafdagesh=64314,t.finalkafdageshhebrew=64314,t.finalkafhebrew=1498,t.finalmem=1501,t.finalmemhebrew=1501,t.finalnun=1503,t.finalnunhebrew=1503,t.finalpe=1507,t.finalpehebrew=1507,t.finaltsadi=1509,t.finaltsadihebrew=1509,t.firsttonechinese=713,t.fisheye=9673,t.fitacyrillic=1139,t.five=53,t.fivearabic=1637,t.fivebengali=2539,t.fivecircle=9316,t.fivecircleinversesansserif=10126,t.fivedeva=2411,t.fiveeighths=8541,t.fivegujarati=2795,t.fivegurmukhi=2667,t.fivehackarabic=1637,t.fivehangzhou=12325,t.fiveideographicparen=12836,t.fiveinferior=8325,t.fivemonospace=65301,t.fiveoldstyle=63285,t.fiveparen=9336,t.fiveperiod=9356,t.fivepersian=1781,t.fiveroman=8564,t.fivesuperior=8309,t.fivethai=3669,t.fl=64258,t.f_l=64258,t.florin=402,t.fmonospace=65350,t.fmsquare=13209,t.fofanthai=3615,t.fofathai=3613,t.fongmanthai=3663,t.forall=8704,t.four=52,t.fourarabic=1636,t.fourbengali=2538,t.fourcircle=9315,t.fourcircleinversesansserif=10125,t.fourdeva=2410,t.fourgujarati=2794,t.fourgurmukhi=2666,t.fourhackarabic=1636,t.fourhangzhou=12324,t.fourideographicparen=12835,t.fourinferior=8324,t.fourmonospace=65300,t.fournumeratorbengali=2551,t.fouroldstyle=63284,t.fourparen=9335,t.fourperiod=9355,t.fourpersian=1780,t.fourroman=8563,t.foursuperior=8308,t.fourteencircle=9325,t.fourteenparen=9345,t.fourteenperiod=9365,t.fourthai=3668,t.fourthtonechinese=715,t.fparen=9377,t.fraction=8260,t.franc=8355,t.g=103,t.gabengali=2455,t.gacute=501,t.gadeva=2327,t.gafarabic=1711,t.gaffinalarabic=64403,t.gafinitialarabic=64404,t.gafmedialarabic=64405,t.gagujarati=2711,t.gagurmukhi=2583,t.gahiragana=12364,t.gakatakana=12460,t.gamma=947,t.gammalatinsmall=611,t.gammasuperior=736,t.gangiacoptic=1003,t.gbopomofo=12557,t.gbreve=287,t.gcaron=487,t.gcedilla=291,t.gcircle=9430,t.gcircumflex=285,t.gcommaaccent=291,t.gdot=289,t.gdotaccent=289,t.gecyrillic=1075,t.gehiragana=12370,t.gekatakana=12466,t.geometricallyequal=8785,t.gereshaccenthebrew=1436,t.gereshhebrew=1523,t.gereshmuqdamhebrew=1437,t.germandbls=223,t.gershayimaccenthebrew=1438,t.gershayimhebrew=1524,t.getamark=12307,t.ghabengali=2456,t.ghadarmenian=1394,t.ghadeva=2328,t.ghagujarati=2712,t.ghagurmukhi=2584,t.ghainarabic=1594,t.ghainfinalarabic=65230,t.ghaininitialarabic=65231,t.ghainmedialarabic=65232,t.ghemiddlehookcyrillic=1173,t.ghestrokecyrillic=1171,t.gheupturncyrillic=1169,t.ghhadeva=2394,t.ghhagurmukhi=2650,t.ghook=608,t.ghzsquare=13203,t.gihiragana=12366,t.gikatakana=12462,t.gimarmenian=1379,t.gimel=1490,t.gimeldagesh=64306,t.gimeldageshhebrew=64306,t.gimelhebrew=1490,t.gjecyrillic=1107,t.glottalinvertedstroke=446,t.glottalstop=660,t.glottalstopinverted=662,t.glottalstopmod=704,t.glottalstopreversed=661,t.glottalstopreversedmod=705,t.glottalstopreversedsuperior=740,t.glottalstopstroke=673,t.glottalstopstrokereversed=674,t.gmacron=7713,t.gmonospace=65351,t.gohiragana=12372,t.gokatakana=12468,t.gparen=9378,t.gpasquare=13228,t.gradient=8711,t.grave=96,t.gravebelowcmb=790,t.gravecmb=768,t.gravecomb=768,t.gravedeva=2387,t.gravelowmod=718,t.gravemonospace=65344,t.gravetonecmb=832,t.greater=62,t.greaterequal=8805,t.greaterequalorless=8923,t.greatermonospace=65310,t.greaterorequivalent=8819,t.greaterorless=8823,t.greateroverequal=8807,t.greatersmall=65125,t.gscript=609,t.gstroke=485,t.guhiragana=12368,t.guillemotleft=171,t.guillemotright=187,t.guilsinglleft=8249,t.guilsinglright=8250,t.gukatakana=12464,t.guramusquare=13080,t.gysquare=13257,t.h=104,t.haabkhasiancyrillic=1193,t.haaltonearabic=1729,t.habengali=2489,t.hadescendercyrillic=1203,t.hadeva=2361,t.hagujarati=2745,t.hagurmukhi=2617,t.haharabic=1581,t.hahfinalarabic=65186,t.hahinitialarabic=65187,t.hahiragana=12399,t.hahmedialarabic=65188,t.haitusquare=13098,t.hakatakana=12495,t.hakatakanahalfwidth=65418,t.halantgurmukhi=2637,t.hamzaarabic=1569,t.hamzalowarabic=1569,t.hangulfiller=12644,t.hardsigncyrillic=1098,t.harpoonleftbarbup=8636,t.harpoonrightbarbup=8640,t.hasquare=13258,t.hatafpatah=1458,t.hatafpatah16=1458,t.hatafpatah23=1458,t.hatafpatah2f=1458,t.hatafpatahhebrew=1458,t.hatafpatahnarrowhebrew=1458,t.hatafpatahquarterhebrew=1458,t.hatafpatahwidehebrew=1458,t.hatafqamats=1459,t.hatafqamats1b=1459,t.hatafqamats28=1459,t.hatafqamats34=1459,t.hatafqamatshebrew=1459,t.hatafqamatsnarrowhebrew=1459,t.hatafqamatsquarterhebrew=1459,t.hatafqamatswidehebrew=1459,t.hatafsegol=1457,t.hatafsegol17=1457,t.hatafsegol24=1457,t.hatafsegol30=1457,t.hatafsegolhebrew=1457,t.hatafsegolnarrowhebrew=1457,t.hatafsegolquarterhebrew=1457,t.hatafsegolwidehebrew=1457,t.hbar=295,t.hbopomofo=12559,t.hbrevebelow=7723,t.hcedilla=7721,t.hcircle=9431,t.hcircumflex=293,t.hdieresis=7719,t.hdotaccent=7715,t.hdotbelow=7717,t.he=1492,t.heart=9829,t.heartsuitblack=9829,t.heartsuitwhite=9825,t.hedagesh=64308,t.hedageshhebrew=64308,t.hehaltonearabic=1729,t.heharabic=1607,t.hehebrew=1492,t.hehfinalaltonearabic=64423,t.hehfinalalttwoarabic=65258,t.hehfinalarabic=65258,t.hehhamzaabovefinalarabic=64421,t.hehhamzaaboveisolatedarabic=64420,t.hehinitialaltonearabic=64424,t.hehinitialarabic=65259,t.hehiragana=12408,t.hehmedialaltonearabic=64425,t.hehmedialarabic=65260,t.heiseierasquare=13179,t.hekatakana=12504,t.hekatakanahalfwidth=65421,t.hekutaarusquare=13110,t.henghook=615,t.herutusquare=13113,t.het=1495,t.hethebrew=1495,t.hhook=614,t.hhooksuperior=689,t.hieuhacirclekorean=12923,t.hieuhaparenkorean=12827,t.hieuhcirclekorean=12909,t.hieuhkorean=12622,t.hieuhparenkorean=12813,t.hihiragana=12402,t.hikatakana=12498,t.hikatakanahalfwidth=65419,t.hiriq=1460,t.hiriq14=1460,t.hiriq21=1460,t.hiriq2d=1460,t.hiriqhebrew=1460,t.hiriqnarrowhebrew=1460,t.hiriqquarterhebrew=1460,t.hiriqwidehebrew=1460,t.hlinebelow=7830,t.hmonospace=65352,t.hoarmenian=1392,t.hohipthai=3627,t.hohiragana=12411,t.hokatakana=12507,t.hokatakanahalfwidth=65422,t.holam=1465,t.holam19=1465,t.holam26=1465,t.holam32=1465,t.holamhebrew=1465,t.holamnarrowhebrew=1465,t.holamquarterhebrew=1465,t.holamwidehebrew=1465,t.honokhukthai=3630,t.hookabovecomb=777,t.hookcmb=777,t.hookpalatalizedbelowcmb=801,t.hookretroflexbelowcmb=802,t.hoonsquare=13122,t.horicoptic=1001,t.horizontalbar=8213,t.horncmb=795,t.hotsprings=9832,t.house=8962,t.hparen=9379,t.hsuperior=688,t.hturned=613,t.huhiragana=12405,t.huiitosquare=13107,t.hukatakana=12501,t.hukatakanahalfwidth=65420,t.hungarumlaut=733,t.hungarumlautcmb=779,t.hv=405,t.hyphen=45,t.hypheninferior=63205,t.hyphenmonospace=65293,t.hyphensmall=65123,t.hyphensuperior=63206,t.hyphentwo=8208,t.i=105,t.iacute=237,t.iacyrillic=1103,t.ibengali=2439,t.ibopomofo=12583,t.ibreve=301,t.icaron=464,t.icircle=9432,t.icircumflex=238,t.icyrillic=1110,t.idblgrave=521,t.ideographearthcircle=12943,t.ideographfirecircle=12939,t.ideographicallianceparen=12863,t.ideographiccallparen=12858,t.ideographiccentrecircle=12965,t.ideographicclose=12294,t.ideographiccomma=12289,t.ideographiccommaleft=65380,t.ideographiccongratulationparen=12855,t.ideographiccorrectcircle=12963,t.ideographicearthparen=12847,t.ideographicenterpriseparen=12861,t.ideographicexcellentcircle=12957,t.ideographicfestivalparen=12864,t.ideographicfinancialcircle=12950,t.ideographicfinancialparen=12854,t.ideographicfireparen=12843,t.ideographichaveparen=12850,t.ideographichighcircle=12964,t.ideographiciterationmark=12293,t.ideographiclaborcircle=12952,t.ideographiclaborparen=12856,t.ideographicleftcircle=12967,t.ideographiclowcircle=12966,t.ideographicmedicinecircle=12969,t.ideographicmetalparen=12846,t.ideographicmoonparen=12842,t.ideographicnameparen=12852,t.ideographicperiod=12290,t.ideographicprintcircle=12958,t.ideographicreachparen=12867,t.ideographicrepresentparen=12857,t.ideographicresourceparen=12862,t.ideographicrightcircle=12968,t.ideographicsecretcircle=12953,t.ideographicselfparen=12866,t.ideographicsocietyparen=12851,t.ideographicspace=12288,t.ideographicspecialparen=12853,t.ideographicstockparen=12849,t.ideographicstudyparen=12859,t.ideographicsunparen=12848,t.ideographicsuperviseparen=12860,t.ideographicwaterparen=12844,t.ideographicwoodparen=12845,t.ideographiczero=12295,t.ideographmetalcircle=12942,t.ideographmooncircle=12938,t.ideographnamecircle=12948,t.ideographsuncircle=12944,t.ideographwatercircle=12940,t.ideographwoodcircle=12941,t.ideva=2311,t.idieresis=239,t.idieresisacute=7727,t.idieresiscyrillic=1253,t.idotbelow=7883,t.iebrevecyrillic=1239,t.iecyrillic=1077,t.ieungacirclekorean=12917,t.ieungaparenkorean=12821,t.ieungcirclekorean=12903,t.ieungkorean=12615,t.ieungparenkorean=12807,t.igrave=236,t.igujarati=2695,t.igurmukhi=2567,t.ihiragana=12356,t.ihookabove=7881,t.iibengali=2440,t.iicyrillic=1080,t.iideva=2312,t.iigujarati=2696,t.iigurmukhi=2568,t.iimatragurmukhi=2624,t.iinvertedbreve=523,t.iishortcyrillic=1081,t.iivowelsignbengali=2496,t.iivowelsigndeva=2368,t.iivowelsigngujarati=2752,t.ij=307,t.ikatakana=12452,t.ikatakanahalfwidth=65394,t.ikorean=12643,t.ilde=732,t.iluyhebrew=1452,t.imacron=299,t.imacroncyrillic=1251,t.imageorapproximatelyequal=8787,t.imatragurmukhi=2623,t.imonospace=65353,t.increment=8710,t.infinity=8734,t.iniarmenian=1387,t.integral=8747,t.integralbottom=8993,t.integralbt=8993,t.integralex=63733,t.integraltop=8992,t.integraltp=8992,t.intersection=8745,t.intisquare=13061,t.invbullet=9688,t.invcircle=9689,t.invsmileface=9787,t.iocyrillic=1105,t.iogonek=303,t.iota=953,t.iotadieresis=970,t.iotadieresistonos=912,t.iotalatin=617,t.iotatonos=943,t.iparen=9380,t.irigurmukhi=2674,t.ismallhiragana=12355,t.ismallkatakana=12451,t.ismallkatakanahalfwidth=65384,t.issharbengali=2554,t.istroke=616,t.isuperior=63213,t.iterationhiragana=12445,t.iterationkatakana=12541,t.itilde=297,t.itildebelow=7725,t.iubopomofo=12585,t.iucyrillic=1102,t.ivowelsignbengali=2495,t.ivowelsigndeva=2367,t.ivowelsigngujarati=2751,t.izhitsacyrillic=1141,t.izhitsadblgravecyrillic=1143,t.j=106,t.jaarmenian=1393,t.jabengali=2460,t.jadeva=2332,t.jagujarati=2716,t.jagurmukhi=2588,t.jbopomofo=12560,t.jcaron=496,t.jcircle=9433,t.jcircumflex=309,t.jcrossedtail=669,t.jdotlessstroke=607,t.jecyrillic=1112,t.jeemarabic=1580,t.jeemfinalarabic=65182,t.jeeminitialarabic=65183,t.jeemmedialarabic=65184,t.jeharabic=1688,t.jehfinalarabic=64395,t.jhabengali=2461,t.jhadeva=2333,t.jhagujarati=2717,t.jhagurmukhi=2589,t.jheharmenian=1403,t.jis=12292,t.jmonospace=65354,t.jparen=9381,t.jsuperior=690,t.k=107,t.kabashkircyrillic=1185,t.kabengali=2453,t.kacute=7729,t.kacyrillic=1082,t.kadescendercyrillic=1179,t.kadeva=2325,t.kaf=1499,t.kafarabic=1603,t.kafdagesh=64315,t.kafdageshhebrew=64315,t.kaffinalarabic=65242,t.kafhebrew=1499,t.kafinitialarabic=65243,t.kafmedialarabic=65244,t.kafrafehebrew=64333,t.kagujarati=2709,t.kagurmukhi=2581,t.kahiragana=12363,t.kahookcyrillic=1220,t.kakatakana=12459,t.kakatakanahalfwidth=65398,t.kappa=954,t.kappasymbolgreek=1008,t.kapyeounmieumkorean=12657,t.kapyeounphieuphkorean=12676,t.kapyeounpieupkorean=12664,t.kapyeounssangpieupkorean=12665,t.karoriisquare=13069,t.kashidaautoarabic=1600,t.kashidaautonosidebearingarabic=1600,t.kasmallkatakana=12533,t.kasquare=13188,t.kasraarabic=1616,t.kasratanarabic=1613,t.kastrokecyrillic=1183,t.katahiraprolongmarkhalfwidth=65392,t.kaverticalstrokecyrillic=1181,t.kbopomofo=12558,t.kcalsquare=13193,t.kcaron=489,t.kcedilla=311,t.kcircle=9434,t.kcommaaccent=311,t.kdotbelow=7731,t.keharmenian=1412,t.kehiragana=12369,t.kekatakana=12465,t.kekatakanahalfwidth=65401,t.kenarmenian=1391,t.kesmallkatakana=12534,t.kgreenlandic=312,t.khabengali=2454,t.khacyrillic=1093,t.khadeva=2326,t.khagujarati=2710,t.khagurmukhi=2582,t.khaharabic=1582,t.khahfinalarabic=65190,t.khahinitialarabic=65191,t.khahmedialarabic=65192,t.kheicoptic=999,t.khhadeva=2393,t.khhagurmukhi=2649,t.khieukhacirclekorean=12920,t.khieukhaparenkorean=12824,t.khieukhcirclekorean=12906,t.khieukhkorean=12619,t.khieukhparenkorean=12810,t.khokhaithai=3586,t.khokhonthai=3589,t.khokhuatthai=3587,t.khokhwaithai=3588,t.khomutthai=3675,t.khook=409,t.khorakhangthai=3590,t.khzsquare=13201,t.kihiragana=12365,t.kikatakana=12461,t.kikatakanahalfwidth=65399,t.kiroguramusquare=13077,t.kiromeetorusquare=13078,t.kirosquare=13076,t.kiyeokacirclekorean=12910,t.kiyeokaparenkorean=12814,t.kiyeokcirclekorean=12896,t.kiyeokkorean=12593,t.kiyeokparenkorean=12800,t.kiyeoksioskorean=12595;t.kjecyrillic=1116,t.klinebelow=7733,t.klsquare=13208,t.kmcubedsquare=13222,t.kmonospace=65355,t.kmsquaredsquare=13218,t.kohiragana=12371,t.kohmsquare=13248,t.kokaithai=3585,t.kokatakana=12467,t.kokatakanahalfwidth=65402,t.kooposquare=13086,t.koppacyrillic=1153,t.koreanstandardsymbol=12927,t.koroniscmb=835,t.kparen=9382,t.kpasquare=13226,t.ksicyrillic=1135,t.ktsquare=13263,t.kturned=670,t.kuhiragana=12367,t.kukatakana=12463,t.kukatakanahalfwidth=65400,t.kvsquare=13240,t.kwsquare=13246,t.l=108,t.labengali=2482,t.lacute=314,t.ladeva=2354,t.lagujarati=2738,t.lagurmukhi=2610,t.lakkhangyaothai=3653,t.lamaleffinalarabic=65276,t.lamalefhamzaabovefinalarabic=65272,t.lamalefhamzaaboveisolatedarabic=65271,t.lamalefhamzabelowfinalarabic=65274,t.lamalefhamzabelowisolatedarabic=65273,t.lamalefisolatedarabic=65275,t.lamalefmaddaabovefinalarabic=65270,t.lamalefmaddaaboveisolatedarabic=65269,t.lamarabic=1604,t.lambda=955,t.lambdastroke=411,t.lamed=1500,t.lameddagesh=64316,t.lameddageshhebrew=64316,t.lamedhebrew=1500,t.lamfinalarabic=65246,t.lamhahinitialarabic=64714,t.laminitialarabic=65247,t.lamjeeminitialarabic=64713,t.lamkhahinitialarabic=64715,t.lamlamhehisolatedarabic=65010,t.lammedialarabic=65248,t.lammeemhahinitialarabic=64904,t.lammeeminitialarabic=64716,t.largecircle=9711,t.lbar=410,t.lbelt=620,t.lbopomofo=12556,t.lcaron=318,t.lcedilla=316,t.lcircle=9435,t.lcircumflexbelow=7741,t.lcommaaccent=316,t.ldot=320,t.ldotaccent=320,t.ldotbelow=7735,t.ldotbelowmacron=7737,t.leftangleabovecmb=794,t.lefttackbelowcmb=792,t.less=60,t.lessequal=8804,t.lessequalorgreater=8922,t.lessmonospace=65308,t.lessorequivalent=8818,t.lessorgreater=8822,t.lessoverequal=8806,t.lesssmall=65124,t.lezh=622,t.lfblock=9612,t.lhookretroflex=621,t.lira=8356,t.liwnarmenian=1388,t.lj=457,t.ljecyrillic=1113,t.ll=63168,t.lladeva=2355,t.llagujarati=2739,t.llinebelow=7739,t.llladeva=2356,t.llvocalicbengali=2529,t.llvocalicdeva=2401,t.llvocalicvowelsignbengali=2531,t.llvocalicvowelsigndeva=2403,t.lmiddletilde=619,t.lmonospace=65356,t.lmsquare=13264,t.lochulathai=3628,t.logicaland=8743,t.logicalnot=172,t.logicalnotreversed=8976,t.logicalor=8744,t.lolingthai=3621,t.longs=383,t.lowlinecenterline=65102,t.lowlinecmb=818,t.lowlinedashed=65101,t.lozenge=9674,t.lparen=9383,t.lslash=322,t.lsquare=8467,t.lsuperior=63214,t.ltshade=9617,t.luthai=3622,t.lvocalicbengali=2444,t.lvocalicdeva=2316,t.lvocalicvowelsignbengali=2530,t.lvocalicvowelsigndeva=2402,t.lxsquare=13267,t.m=109,t.mabengali=2478,t.macron=175,t.macronbelowcmb=817,t.macroncmb=772,t.macronlowmod=717,t.macronmonospace=65507,t.macute=7743,t.madeva=2350,t.magujarati=2734,t.magurmukhi=2606,t.mahapakhhebrew=1444,t.mahapakhlefthebrew=1444,t.mahiragana=12414,t.maichattawalowleftthai=63637,t.maichattawalowrightthai=63636,t.maichattawathai=3659,t.maichattawaupperleftthai=63635,t.maieklowleftthai=63628,t.maieklowrightthai=63627,t.maiekthai=3656,t.maiekupperleftthai=63626,t.maihanakatleftthai=63620,t.maihanakatthai=3633,t.maitaikhuleftthai=63625,t.maitaikhuthai=3655,t.maitholowleftthai=63631,t.maitholowrightthai=63630,t.maithothai=3657,t.maithoupperleftthai=63629,t.maitrilowleftthai=63634,t.maitrilowrightthai=63633,t.maitrithai=3658,t.maitriupperleftthai=63632,t.maiyamokthai=3654,t.makatakana=12510,t.makatakanahalfwidth=65423,t.male=9794,t.mansyonsquare=13127,t.maqafhebrew=1470,t.mars=9794,t.masoracirclehebrew=1455,t.masquare=13187,t.mbopomofo=12551,t.mbsquare=13268,t.mcircle=9436,t.mcubedsquare=13221,t.mdotaccent=7745,t.mdotbelow=7747,t.meemarabic=1605,t.meemfinalarabic=65250,t.meeminitialarabic=65251,t.meemmedialarabic=65252,t.meemmeeminitialarabic=64721,t.meemmeemisolatedarabic=64584,t.meetorusquare=13133,t.mehiragana=12417,t.meizierasquare=13182,t.mekatakana=12513,t.mekatakanahalfwidth=65426,t.mem=1502,t.memdagesh=64318,t.memdageshhebrew=64318,t.memhebrew=1502,t.menarmenian=1396,t.merkhahebrew=1445,t.merkhakefulahebrew=1446,t.merkhakefulalefthebrew=1446,t.merkhalefthebrew=1445,t.mhook=625,t.mhzsquare=13202,t.middledotkatakanahalfwidth=65381,t.middot=183,t.mieumacirclekorean=12914,t.mieumaparenkorean=12818,t.mieumcirclekorean=12900,t.mieumkorean=12609,t.mieumpansioskorean=12656,t.mieumparenkorean=12804,t.mieumpieupkorean=12654,t.mieumsioskorean=12655,t.mihiragana=12415,t.mikatakana=12511,t.mikatakanahalfwidth=65424,t.minus=8722,t.minusbelowcmb=800,t.minuscircle=8854,t.minusmod=727,t.minusplus=8723,t.minute=8242,t.miribaarusquare=13130,t.mirisquare=13129,t.mlonglegturned=624,t.mlsquare=13206,t.mmcubedsquare=13219,t.mmonospace=65357,t.mmsquaredsquare=13215,t.mohiragana=12418,t.mohmsquare=13249,t.mokatakana=12514,t.mokatakanahalfwidth=65427,t.molsquare=13270,t.momathai=3617,t.moverssquare=13223,t.moverssquaredsquare=13224,t.mparen=9384,t.mpasquare=13227,t.mssquare=13235,t.msuperior=63215,t.mturned=623,t.mu=181,t.mu1=181,t.muasquare=13186,t.muchgreater=8811,t.muchless=8810,t.mufsquare=13196,t.mugreek=956,t.mugsquare=13197,t.muhiragana=12416,t.mukatakana=12512,t.mukatakanahalfwidth=65425,t.mulsquare=13205,t.multiply=215,t.mumsquare=13211,t.munahhebrew=1443,t.munahlefthebrew=1443,t.musicalnote=9834,t.musicalnotedbl=9835,t.musicflatsign=9837,t.musicsharpsign=9839,t.mussquare=13234,t.muvsquare=13238,t.muwsquare=13244,t.mvmegasquare=13241,t.mvsquare=13239,t.mwmegasquare=13247,t.mwsquare=13245,t.n=110,t.nabengali=2472,t.nabla=8711,t.nacute=324,t.nadeva=2344,t.nagujarati=2728,t.nagurmukhi=2600,t.nahiragana=12394,t.nakatakana=12490,t.nakatakanahalfwidth=65413,t.napostrophe=329,t.nasquare=13185,t.nbopomofo=12555,t.nbspace=160,t.ncaron=328,t.ncedilla=326,t.ncircle=9437,t.ncircumflexbelow=7755,t.ncommaaccent=326,t.ndotaccent=7749,t.ndotbelow=7751,t.nehiragana=12397,t.nekatakana=12493,t.nekatakanahalfwidth=65416,t.newsheqelsign=8362,t.nfsquare=13195,t.ngabengali=2457,t.ngadeva=2329,t.ngagujarati=2713,t.ngagurmukhi=2585,t.ngonguthai=3591,t.nhiragana=12435,t.nhookleft=626,t.nhookretroflex=627,t.nieunacirclekorean=12911,t.nieunaparenkorean=12815,t.nieuncieuckorean=12597,t.nieuncirclekorean=12897,t.nieunhieuhkorean=12598,t.nieunkorean=12596,t.nieunpansioskorean=12648,t.nieunparenkorean=12801,t.nieunsioskorean=12647,t.nieuntikeutkorean=12646,t.nihiragana=12395,t.nikatakana=12491,t.nikatakanahalfwidth=65414,t.nikhahitleftthai=63641,t.nikhahitthai=3661,t.nine=57,t.ninearabic=1641,t.ninebengali=2543,t.ninecircle=9320,t.ninecircleinversesansserif=10130,t.ninedeva=2415,t.ninegujarati=2799,t.ninegurmukhi=2671,t.ninehackarabic=1641,t.ninehangzhou=12329,t.nineideographicparen=12840,t.nineinferior=8329,t.ninemonospace=65305,t.nineoldstyle=63289,t.nineparen=9340,t.nineperiod=9360,t.ninepersian=1785,t.nineroman=8568,t.ninesuperior=8313,t.nineteencircle=9330,t.nineteenparen=9350,t.nineteenperiod=9370,t.ninethai=3673,t.nj=460,t.njecyrillic=1114,t.nkatakana=12531,t.nkatakanahalfwidth=65437,t.nlegrightlong=414,t.nlinebelow=7753,t.nmonospace=65358,t.nmsquare=13210,t.nnabengali=2467,t.nnadeva=2339,t.nnagujarati=2723,t.nnagurmukhi=2595,t.nnnadeva=2345,t.nohiragana=12398,t.nokatakana=12494,t.nokatakanahalfwidth=65417,t.nonbreakingspace=160,t.nonenthai=3603,t.nonuthai=3609,t.noonarabic=1606,t.noonfinalarabic=65254,t.noonghunnaarabic=1722,t.noonghunnafinalarabic=64415,t.nooninitialarabic=65255,t.noonjeeminitialarabic=64722,t.noonjeemisolatedarabic=64587,t.noonmedialarabic=65256,t.noonmeeminitialarabic=64725,t.noonmeemisolatedarabic=64590,t.noonnoonfinalarabic=64653,t.notcontains=8716,t.notelement=8713,t.notelementof=8713,t.notequal=8800,t.notgreater=8815,t.notgreaternorequal=8817,t.notgreaternorless=8825,t.notidentical=8802,t.notless=8814,t.notlessnorequal=8816,t.notparallel=8742,t.notprecedes=8832,t.notsubset=8836,t.notsucceeds=8833,t.notsuperset=8837,t.nowarmenian=1398,t.nparen=9385,t.nssquare=13233,t.nsuperior=8319,t.ntilde=241,t.nu=957,t.nuhiragana=12396,t.nukatakana=12492,t.nukatakanahalfwidth=65415,t.nuktabengali=2492,t.nuktadeva=2364,t.nuktagujarati=2748,t.nuktagurmukhi=2620,t.numbersign=35,t.numbersignmonospace=65283,t.numbersignsmall=65119,t.numeralsigngreek=884,t.numeralsignlowergreek=885,t.numero=8470,t.nun=1504,t.nundagesh=64320,t.nundageshhebrew=64320,t.nunhebrew=1504,t.nvsquare=13237,t.nwsquare=13243,t.nyabengali=2462,t.nyadeva=2334,t.nyagujarati=2718,t.nyagurmukhi=2590,t.o=111,t.oacute=243,t.oangthai=3629,t.obarred=629,t.obarredcyrillic=1257,t.obarreddieresiscyrillic=1259,t.obengali=2451,t.obopomofo=12571,t.obreve=335,t.ocandradeva=2321,t.ocandragujarati=2705,t.ocandravowelsigndeva=2377,t.ocandravowelsigngujarati=2761,t.ocaron=466,t.ocircle=9438,t.ocircumflex=244,t.ocircumflexacute=7889,t.ocircumflexdotbelow=7897,t.ocircumflexgrave=7891,t.ocircumflexhookabove=7893,t.ocircumflextilde=7895,t.ocyrillic=1086,t.odblacute=337,t.odblgrave=525,t.odeva=2323,t.odieresis=246,t.odieresiscyrillic=1255,t.odotbelow=7885,t.oe=339,t.oekorean=12634,t.ogonek=731,t.ogonekcmb=808,t.ograve=242,t.ogujarati=2707,t.oharmenian=1413,t.ohiragana=12362,t.ohookabove=7887,t.ohorn=417,t.ohornacute=7899,t.ohorndotbelow=7907,t.ohorngrave=7901,t.ohornhookabove=7903,t.ohorntilde=7905,t.ohungarumlaut=337,t.oi=419,t.oinvertedbreve=527,t.okatakana=12458,t.okatakanahalfwidth=65397,t.okorean=12631,t.olehebrew=1451,t.omacron=333,t.omacronacute=7763,t.omacrongrave=7761,t.omdeva=2384,t.omega=969,t.omega1=982,t.omegacyrillic=1121,t.omegalatinclosed=631,t.omegaroundcyrillic=1147,t.omegatitlocyrillic=1149,t.omegatonos=974,t.omgujarati=2768,t.omicron=959,t.omicrontonos=972,t.omonospace=65359,t.one=49,t.onearabic=1633,t.onebengali=2535,t.onecircle=9312,t.onecircleinversesansserif=10122,t.onedeva=2407,t.onedotenleader=8228,t.oneeighth=8539,t.onefitted=63196,t.onegujarati=2791,t.onegurmukhi=2663,t.onehackarabic=1633,t.onehalf=189,t.onehangzhou=12321,t.oneideographicparen=12832,t.oneinferior=8321,t.onemonospace=65297,t.onenumeratorbengali=2548,t.oneoldstyle=63281,t.oneparen=9332,t.oneperiod=9352,t.onepersian=1777,t.onequarter=188,t.oneroman=8560,t.onesuperior=185,t.onethai=3665,t.onethird=8531,t.oogonek=491,t.oogonekmacron=493,t.oogurmukhi=2579,t.oomatragurmukhi=2635,t.oopen=596,t.oparen=9386,t.openbullet=9702,t.option=8997,t.ordfeminine=170,t.ordmasculine=186,t.orthogonal=8735,t.oshortdeva=2322,t.oshortvowelsigndeva=2378,t.oslash=248,t.oslashacute=511,t.osmallhiragana=12361,t.osmallkatakana=12457,t.osmallkatakanahalfwidth=65387,t.ostrokeacute=511,t.osuperior=63216,t.otcyrillic=1151,t.otilde=245,t.otildeacute=7757,t.otildedieresis=7759,t.oubopomofo=12577,t.overline=8254,t.overlinecenterline=65098,t.overlinecmb=773,t.overlinedashed=65097,t.overlinedblwavy=65100,t.overlinewavy=65099,t.overscore=175,t.ovowelsignbengali=2507,t.ovowelsigndeva=2379,t.ovowelsigngujarati=2763,t.p=112,t.paampssquare=13184,t.paasentosquare=13099,t.pabengali=2474,t.pacute=7765,t.padeva=2346,t.pagedown=8671,t.pageup=8670,t.pagujarati=2730,t.pagurmukhi=2602,t.pahiragana=12401,t.paiyannoithai=3631,t.pakatakana=12497,t.palatalizationcyrilliccmb=1156,t.palochkacyrillic=1216,t.pansioskorean=12671,t.paragraph=182,t.parallel=8741,t.parenleft=40,t.parenleftaltonearabic=64830,t.parenleftbt=63725,t.parenleftex=63724,t.parenleftinferior=8333,t.parenleftmonospace=65288,t.parenleftsmall=65113,t.parenleftsuperior=8317,t.parenlefttp=63723,t.parenleftvertical=65077,t.parenright=41,t.parenrightaltonearabic=64831,t.parenrightbt=63736,t.parenrightex=63735,t.parenrightinferior=8334,t.parenrightmonospace=65289,t.parenrightsmall=65114,t.parenrightsuperior=8318,t.parenrighttp=63734,t.parenrightvertical=65078,t.partialdiff=8706,t.paseqhebrew=1472,t.pashtahebrew=1433,t.pasquare=13225,t.patah=1463,t.patah11=1463,t.patah1d=1463,t.patah2a=1463,t.patahhebrew=1463,t.patahnarrowhebrew=1463,t.patahquarterhebrew=1463,t.patahwidehebrew=1463,t.pazerhebrew=1441,t.pbopomofo=12550,t.pcircle=9439,t.pdotaccent=7767,t.pe=1508,t.pecyrillic=1087,t.pedagesh=64324,t.pedageshhebrew=64324,t.peezisquare=13115,t.pefinaldageshhebrew=64323,t.peharabic=1662,t.peharmenian=1402,t.pehebrew=1508,t.pehfinalarabic=64343,t.pehinitialarabic=64344,t.pehiragana=12410,t.pehmedialarabic=64345,t.pekatakana=12506,t.pemiddlehookcyrillic=1191,t.perafehebrew=64334,t.percent=37,t.percentarabic=1642,t.percentmonospace=65285,t.percentsmall=65130,t.period=46,t.periodarmenian=1417,t.periodcentered=183,t.periodhalfwidth=65377,t.periodinferior=63207,t.periodmonospace=65294,t.periodsmall=65106,t.periodsuperior=63208,t.perispomenigreekcmb=834,t.perpendicular=8869,t.perthousand=8240,t.peseta=8359,t.pfsquare=13194,t.phabengali=2475,t.phadeva=2347,t.phagujarati=2731,t.phagurmukhi=2603,t.phi=966,t.phi1=981,t.phieuphacirclekorean=12922,t.phieuphaparenkorean=12826,t.phieuphcirclekorean=12908,t.phieuphkorean=12621,t.phieuphparenkorean=12812,t.philatin=632,t.phinthuthai=3642,t.phisymbolgreek=981,t.phook=421,t.phophanthai=3614,t.phophungthai=3612,t.phosamphaothai=3616,t.pi=960,t.pieupacirclekorean=12915,t.pieupaparenkorean=12819,t.pieupcieuckorean=12662,t.pieupcirclekorean=12901,t.pieupkiyeokkorean=12658,t.pieupkorean=12610,t.pieupparenkorean=12805,t.pieupsioskiyeokkorean=12660,t.pieupsioskorean=12612,t.pieupsiostikeutkorean=12661,t.pieupthieuthkorean=12663,t.pieuptikeutkorean=12659,t.pihiragana=12404,t.pikatakana=12500,t.pisymbolgreek=982,t.piwrarmenian=1411,t.planckover2pi=8463,t.planckover2pi1=8463,t.plus=43,t.plusbelowcmb=799,t.pluscircle=8853,t.plusminus=177,t.plusmod=726,t.plusmonospace=65291,t.plussmall=65122,t.plussuperior=8314,t.pmonospace=65360,t.pmsquare=13272,t.pohiragana=12413,t.pointingindexdownwhite=9759,t.pointingindexleftwhite=9756,t.pointingindexrightwhite=9758,t.pointingindexupwhite=9757,t.pokatakana=12509,t.poplathai=3611,t.postalmark=12306,t.postalmarkface=12320,t.pparen=9387,t.precedes=8826,t.prescription=8478,t.primemod=697,t.primereversed=8245,t.product=8719,t.projective=8965,t.prolongedkana=12540,t.propellor=8984,t.propersubset=8834,t.propersuperset=8835,t.proportion=8759,t.proportional=8733,t.psi=968,t.psicyrillic=1137,t.psilipneumatacyrilliccmb=1158,t.pssquare=13232,t.puhiragana=12407,t.pukatakana=12503,t.pvsquare=13236,t.pwsquare=13242,t.q=113,t.qadeva=2392,t.qadmahebrew=1448,t.qafarabic=1602,t.qaffinalarabic=65238,t.qafinitialarabic=65239,t.qafmedialarabic=65240,t.qamats=1464,t.qamats10=1464,t.qamats1a=1464,t.qamats1c=1464,t.qamats27=1464,t.qamats29=1464,t.qamats33=1464,t.qamatsde=1464,t.qamatshebrew=1464,t.qamatsnarrowhebrew=1464,t.qamatsqatanhebrew=1464,t.qamatsqatannarrowhebrew=1464,t.qamatsqatanquarterhebrew=1464,t.qamatsqatanwidehebrew=1464,t.qamatsquarterhebrew=1464,t.qamatswidehebrew=1464,t.qarneyparahebrew=1439,t.qbopomofo=12561,t.qcircle=9440,t.qhook=672,t.qmonospace=65361,t.qof=1511,t.qofdagesh=64327,t.qofdageshhebrew=64327,t.qofhebrew=1511,t.qparen=9388,t.quarternote=9833,t.qubuts=1467,t.qubuts18=1467,t.qubuts25=1467,t.qubuts31=1467,t.qubutshebrew=1467,t.qubutsnarrowhebrew=1467,t.qubutsquarterhebrew=1467,t.qubutswidehebrew=1467,t.question=63,t.questionarabic=1567,t.questionarmenian=1374,t.questiondown=191,t.questiondownsmall=63423,t.questiongreek=894,t.questionmonospace=65311,t.questionsmall=63295,t.quotedbl=34,t.quotedblbase=8222,t.quotedblleft=8220,t.quotedblmonospace=65282,t.quotedblprime=12318,t.quotedblprimereversed=12317,t.quotedblright=8221,t.quoteleft=8216,t.quoteleftreversed=8219,t.quotereversed=8219,t.quoteright=8217,t.quoterightn=329,t.quotesinglbase=8218,t.quotesingle=39,t.quotesinglemonospace=65287,t.r=114,t.raarmenian=1404,t.rabengali=2480,t.racute=341,t.radeva=2352,t.radical=8730,t.radicalex=63717,t.radoverssquare=13230,t.radoverssquaredsquare=13231,t.radsquare=13229,t.rafe=1471,t.rafehebrew=1471,t.ragujarati=2736,t.ragurmukhi=2608,t.rahiragana=12425,t.rakatakana=12521,t.rakatakanahalfwidth=65431,t.ralowerdiagonalbengali=2545,t.ramiddlediagonalbengali=2544,t.ramshorn=612,t.ratio=8758,t.rbopomofo=12566,t.rcaron=345,t.rcedilla=343,t.rcircle=9441,t.rcommaaccent=343,t.rdblgrave=529,t.rdotaccent=7769,t.rdotbelow=7771,t.rdotbelowmacron=7773,t.referencemark=8251,t.reflexsubset=8838,t.reflexsuperset=8839,t.registered=174,t.registersans=63720,t.registerserif=63194,t.reharabic=1585,t.reharmenian=1408,t.rehfinalarabic=65198,t.rehiragana=12428,t.rekatakana=12524;t.rekatakanahalfwidth=65434,t.resh=1512,t.reshdageshhebrew=64328,t.reshhebrew=1512,t.reversedtilde=8765,t.reviahebrew=1431,t.reviamugrashhebrew=1431,t.revlogicalnot=8976,t.rfishhook=638,t.rfishhookreversed=639,t.rhabengali=2525,t.rhadeva=2397,t.rho=961,t.rhook=637,t.rhookturned=635,t.rhookturnedsuperior=693,t.rhosymbolgreek=1009,t.rhotichookmod=734,t.rieulacirclekorean=12913,t.rieulaparenkorean=12817,t.rieulcirclekorean=12899,t.rieulhieuhkorean=12608,t.rieulkiyeokkorean=12602,t.rieulkiyeoksioskorean=12649,t.rieulkorean=12601,t.rieulmieumkorean=12603,t.rieulpansioskorean=12652,t.rieulparenkorean=12803,t.rieulphieuphkorean=12607,t.rieulpieupkorean=12604,t.rieulpieupsioskorean=12651,t.rieulsioskorean=12605,t.rieulthieuthkorean=12606,t.rieultikeutkorean=12650,t.rieulyeorinhieuhkorean=12653,t.rightangle=8735,t.righttackbelowcmb=793,t.righttriangle=8895,t.rihiragana=12426,t.rikatakana=12522,t.rikatakanahalfwidth=65432,t.ring=730,t.ringbelowcmb=805,t.ringcmb=778,t.ringhalfleft=703,t.ringhalfleftarmenian=1369,t.ringhalfleftbelowcmb=796,t.ringhalfleftcentered=723,t.ringhalfright=702,t.ringhalfrightbelowcmb=825,t.ringhalfrightcentered=722,t.rinvertedbreve=531,t.rittorusquare=13137,t.rlinebelow=7775,t.rlongleg=636,t.rlonglegturned=634,t.rmonospace=65362,t.rohiragana=12429,t.rokatakana=12525,t.rokatakanahalfwidth=65435,t.roruathai=3619,t.rparen=9389,t.rrabengali=2524,t.rradeva=2353,t.rragurmukhi=2652,t.rreharabic=1681,t.rrehfinalarabic=64397,t.rrvocalicbengali=2528,t.rrvocalicdeva=2400,t.rrvocalicgujarati=2784,t.rrvocalicvowelsignbengali=2500,t.rrvocalicvowelsigndeva=2372,t.rrvocalicvowelsigngujarati=2756,t.rsuperior=63217,t.rtblock=9616,t.rturned=633,t.rturnedsuperior=692,t.ruhiragana=12427,t.rukatakana=12523,t.rukatakanahalfwidth=65433,t.rupeemarkbengali=2546,t.rupeesignbengali=2547,t.rupiah=63197,t.ruthai=3620,t.rvocalicbengali=2443,t.rvocalicdeva=2315,t.rvocalicgujarati=2699,t.rvocalicvowelsignbengali=2499,t.rvocalicvowelsigndeva=2371,t.rvocalicvowelsigngujarati=2755,t.s=115,t.sabengali=2488,t.sacute=347,t.sacutedotaccent=7781,t.sadarabic=1589,t.sadeva=2360,t.sadfinalarabic=65210,t.sadinitialarabic=65211,t.sadmedialarabic=65212,t.sagujarati=2744,t.sagurmukhi=2616,t.sahiragana=12373,t.sakatakana=12469,t.sakatakanahalfwidth=65403,t.sallallahoualayhewasallamarabic=65018,t.samekh=1505,t.samekhdagesh=64321,t.samekhdageshhebrew=64321,t.samekhhebrew=1505,t.saraaathai=3634,t.saraaethai=3649,t.saraaimaimalaithai=3652,t.saraaimaimuanthai=3651,t.saraamthai=3635,t.saraathai=3632,t.saraethai=3648,t.saraiileftthai=63622,t.saraiithai=3637,t.saraileftthai=63621,t.saraithai=3636,t.saraothai=3650,t.saraueeleftthai=63624,t.saraueethai=3639,t.saraueleftthai=63623,t.sarauethai=3638,t.sarauthai=3640,t.sarauuthai=3641,t.sbopomofo=12569,t.scaron=353,t.scarondotaccent=7783,t.scedilla=351,t.schwa=601,t.schwacyrillic=1241,t.schwadieresiscyrillic=1243,t.schwahook=602,t.scircle=9442,t.scircumflex=349,t.scommaaccent=537,t.sdotaccent=7777,t.sdotbelow=7779,t.sdotbelowdotaccent=7785,t.seagullbelowcmb=828,t.second=8243,t.secondtonechinese=714,t.section=167,t.seenarabic=1587,t.seenfinalarabic=65202,t.seeninitialarabic=65203,t.seenmedialarabic=65204,t.segol=1462,t.segol13=1462,t.segol1f=1462,t.segol2c=1462,t.segolhebrew=1462,t.segolnarrowhebrew=1462,t.segolquarterhebrew=1462,t.segoltahebrew=1426,t.segolwidehebrew=1462,t.seharmenian=1405,t.sehiragana=12379,t.sekatakana=12475,t.sekatakanahalfwidth=65406,t.semicolon=59,t.semicolonarabic=1563,t.semicolonmonospace=65307,t.semicolonsmall=65108,t.semivoicedmarkkana=12444,t.semivoicedmarkkanahalfwidth=65439,t.sentisquare=13090,t.sentosquare=13091,t.seven=55,t.sevenarabic=1639,t.sevenbengali=2541,t.sevencircle=9318,t.sevencircleinversesansserif=10128,t.sevendeva=2413,t.seveneighths=8542,t.sevengujarati=2797,t.sevengurmukhi=2669,t.sevenhackarabic=1639,t.sevenhangzhou=12327,t.sevenideographicparen=12838,t.seveninferior=8327,t.sevenmonospace=65303,t.sevenoldstyle=63287,t.sevenparen=9338,t.sevenperiod=9358,t.sevenpersian=1783,t.sevenroman=8566,t.sevensuperior=8311,t.seventeencircle=9328,t.seventeenparen=9348,t.seventeenperiod=9368,t.seventhai=3671,t.sfthyphen=173,t.shaarmenian=1399,t.shabengali=2486,t.shacyrillic=1096,t.shaddaarabic=1617,t.shaddadammaarabic=64609,t.shaddadammatanarabic=64606,t.shaddafathaarabic=64608,t.shaddakasraarabic=64610,t.shaddakasratanarabic=64607,t.shade=9618,t.shadedark=9619,t.shadelight=9617,t.shademedium=9618,t.shadeva=2358,t.shagujarati=2742,t.shagurmukhi=2614,t.shalshelethebrew=1427,t.shbopomofo=12565,t.shchacyrillic=1097,t.sheenarabic=1588,t.sheenfinalarabic=65206,t.sheeninitialarabic=65207,t.sheenmedialarabic=65208,t.sheicoptic=995,t.sheqel=8362,t.sheqelhebrew=8362,t.sheva=1456,t.sheva115=1456,t.sheva15=1456,t.sheva22=1456,t.sheva2e=1456,t.shevahebrew=1456,t.shevanarrowhebrew=1456,t.shevaquarterhebrew=1456,t.shevawidehebrew=1456,t.shhacyrillic=1211,t.shimacoptic=1005,t.shin=1513,t.shindagesh=64329,t.shindageshhebrew=64329,t.shindageshshindot=64300,t.shindageshshindothebrew=64300,t.shindageshsindot=64301,t.shindageshsindothebrew=64301,t.shindothebrew=1473,t.shinhebrew=1513,t.shinshindot=64298,t.shinshindothebrew=64298,t.shinsindot=64299,t.shinsindothebrew=64299,t.shook=642,t.sigma=963,t.sigma1=962,t.sigmafinal=962,t.sigmalunatesymbolgreek=1010,t.sihiragana=12375,t.sikatakana=12471,t.sikatakanahalfwidth=65404,t.siluqhebrew=1469,t.siluqlefthebrew=1469,t.similar=8764,t.sindothebrew=1474,t.siosacirclekorean=12916,t.siosaparenkorean=12820,t.sioscieuckorean=12670,t.sioscirclekorean=12902,t.sioskiyeokkorean=12666,t.sioskorean=12613,t.siosnieunkorean=12667,t.siosparenkorean=12806,t.siospieupkorean=12669,t.siostikeutkorean=12668,t.six=54,t.sixarabic=1638,t.sixbengali=2540,t.sixcircle=9317,t.sixcircleinversesansserif=10127,t.sixdeva=2412,t.sixgujarati=2796,t.sixgurmukhi=2668,t.sixhackarabic=1638,t.sixhangzhou=12326,t.sixideographicparen=12837,t.sixinferior=8326,t.sixmonospace=65302,t.sixoldstyle=63286,t.sixparen=9337,t.sixperiod=9357,t.sixpersian=1782,t.sixroman=8565,t.sixsuperior=8310,t.sixteencircle=9327,t.sixteencurrencydenominatorbengali=2553,t.sixteenparen=9347,t.sixteenperiod=9367,t.sixthai=3670,t.slash=47,t.slashmonospace=65295,t.slong=383,t.slongdotaccent=7835,t.smileface=9786,t.smonospace=65363,t.sofpasuqhebrew=1475,t.softhyphen=173,t.softsigncyrillic=1100,t.sohiragana=12381,t.sokatakana=12477,t.sokatakanahalfwidth=65407,t.soliduslongoverlaycmb=824,t.solidusshortoverlaycmb=823,t.sorusithai=3625,t.sosalathai=3624,t.sosothai=3595,t.sosuathai=3626,t.space=32,t.spacehackarabic=32,t.spade=9824,t.spadesuitblack=9824,t.spadesuitwhite=9828,t.sparen=9390,t.squarebelowcmb=827,t.squarecc=13252,t.squarecm=13213,t.squarediagonalcrosshatchfill=9641,t.squarehorizontalfill=9636,t.squarekg=13199,t.squarekm=13214,t.squarekmcapital=13262,t.squareln=13265,t.squarelog=13266,t.squaremg=13198,t.squaremil=13269,t.squaremm=13212,t.squaremsquared=13217,t.squareorthogonalcrosshatchfill=9638,t.squareupperlefttolowerrightfill=9639,t.squareupperrighttolowerleftfill=9640,t.squareverticalfill=9637,t.squarewhitewithsmallblack=9635,t.srsquare=13275,t.ssabengali=2487,t.ssadeva=2359,t.ssagujarati=2743,t.ssangcieuckorean=12617,t.ssanghieuhkorean=12677,t.ssangieungkorean=12672,t.ssangkiyeokkorean=12594,t.ssangnieunkorean=12645,t.ssangpieupkorean=12611,t.ssangsioskorean=12614,t.ssangtikeutkorean=12600,t.ssuperior=63218,t.sterling=163,t.sterlingmonospace=65505,t.strokelongoverlaycmb=822,t.strokeshortoverlaycmb=821,t.subset=8834,t.subsetnotequal=8842,t.subsetorequal=8838,t.succeeds=8827,t.suchthat=8715,t.suhiragana=12377,t.sukatakana=12473,t.sukatakanahalfwidth=65405,t.sukunarabic=1618,t.summation=8721,t.sun=9788,t.superset=8835,t.supersetnotequal=8843,t.supersetorequal=8839,t.svsquare=13276,t.syouwaerasquare=13180,t.t=116,t.tabengali=2468,t.tackdown=8868,t.tackleft=8867,t.tadeva=2340,t.tagujarati=2724,t.tagurmukhi=2596,t.taharabic=1591,t.tahfinalarabic=65218,t.tahinitialarabic=65219,t.tahiragana=12383,t.tahmedialarabic=65220,t.taisyouerasquare=13181,t.takatakana=12479,t.takatakanahalfwidth=65408,t.tatweelarabic=1600,t.tau=964,t.tav=1514,t.tavdages=64330,t.tavdagesh=64330,t.tavdageshhebrew=64330,t.tavhebrew=1514,t.tbar=359,t.tbopomofo=12554,t.tcaron=357,t.tccurl=680,t.tcedilla=355,t.tcheharabic=1670,t.tchehfinalarabic=64379,t.tchehinitialarabic=64380,t.tchehmedialarabic=64381,t.tcircle=9443,t.tcircumflexbelow=7793,t.tcommaaccent=355,t.tdieresis=7831,t.tdotaccent=7787,t.tdotbelow=7789,t.tecyrillic=1090,t.tedescendercyrillic=1197,t.teharabic=1578,t.tehfinalarabic=65174,t.tehhahinitialarabic=64674,t.tehhahisolatedarabic=64524,t.tehinitialarabic=65175,t.tehiragana=12390,t.tehjeeminitialarabic=64673,t.tehjeemisolatedarabic=64523,t.tehmarbutaarabic=1577,t.tehmarbutafinalarabic=65172,t.tehmedialarabic=65176,t.tehmeeminitialarabic=64676,t.tehmeemisolatedarabic=64526,t.tehnoonfinalarabic=64627,t.tekatakana=12486,t.tekatakanahalfwidth=65411,t.telephone=8481,t.telephoneblack=9742,t.telishagedolahebrew=1440,t.telishaqetanahebrew=1449,t.tencircle=9321,t.tenideographicparen=12841,t.tenparen=9341,t.tenperiod=9361,t.tenroman=8569,t.tesh=679,t.tet=1496,t.tetdagesh=64312,t.tetdageshhebrew=64312,t.tethebrew=1496,t.tetsecyrillic=1205,t.tevirhebrew=1435,t.tevirlefthebrew=1435,t.thabengali=2469,t.thadeva=2341,t.thagujarati=2725,t.thagurmukhi=2597,t.thalarabic=1584,t.thalfinalarabic=65196,t.thanthakhatlowleftthai=63640,t.thanthakhatlowrightthai=63639,t.thanthakhatthai=3660,t.thanthakhatupperleftthai=63638,t.theharabic=1579,t.thehfinalarabic=65178,t.thehinitialarabic=65179,t.thehmedialarabic=65180,t.thereexists=8707,t.therefore=8756,t.theta=952,t.theta1=977,t.thetasymbolgreek=977,t.thieuthacirclekorean=12921,t.thieuthaparenkorean=12825,t.thieuthcirclekorean=12907,t.thieuthkorean=12620,t.thieuthparenkorean=12811,t.thirteencircle=9324,t.thirteenparen=9344,t.thirteenperiod=9364,t.thonangmonthothai=3601,t.thook=429,t.thophuthaothai=3602,t.thorn=254,t.thothahanthai=3607,t.thothanthai=3600,t.thothongthai=3608,t.thothungthai=3606,t.thousandcyrillic=1154,t.thousandsseparatorarabic=1644,t.thousandsseparatorpersian=1644,t.three=51,t.threearabic=1635,t.threebengali=2537,t.threecircle=9314,t.threecircleinversesansserif=10124,t.threedeva=2409,t.threeeighths=8540,t.threegujarati=2793,t.threegurmukhi=2665,t.threehackarabic=1635,t.threehangzhou=12323,t.threeideographicparen=12834,t.threeinferior=8323,t.threemonospace=65299,t.threenumeratorbengali=2550,t.threeoldstyle=63283,t.threeparen=9334,t.threeperiod=9354,t.threepersian=1779,t.threequarters=190,t.threequartersemdash=63198,t.threeroman=8562,t.threesuperior=179,t.threethai=3667,t.thzsquare=13204,t.tihiragana=12385,t.tikatakana=12481,t.tikatakanahalfwidth=65409,t.tikeutacirclekorean=12912,t.tikeutaparenkorean=12816,t.tikeutcirclekorean=12898,t.tikeutkorean=12599,t.tikeutparenkorean=12802,t.tilde=732,t.tildebelowcmb=816,t.tildecmb=771,t.tildecomb=771,t.tildedoublecmb=864,t.tildeoperator=8764,t.tildeoverlaycmb=820,t.tildeverticalcmb=830,t.timescircle=8855,t.tipehahebrew=1430,t.tipehalefthebrew=1430,t.tippigurmukhi=2672,t.titlocyrilliccmb=1155,t.tiwnarmenian=1407,t.tlinebelow=7791,t.tmonospace=65364,t.toarmenian=1385,t.tohiragana=12392,t.tokatakana=12488,t.tokatakanahalfwidth=65412,t.tonebarextrahighmod=741,t.tonebarextralowmod=745,t.tonebarhighmod=742,t.tonebarlowmod=744,t.tonebarmidmod=743,t.tonefive=445,t.tonesix=389,t.tonetwo=424,t.tonos=900,t.tonsquare=13095,t.topatakthai=3599,t.tortoiseshellbracketleft=12308,t.tortoiseshellbracketleftsmall=65117,t.tortoiseshellbracketleftvertical=65081,t.tortoiseshellbracketright=12309,t.tortoiseshellbracketrightsmall=65118,t.tortoiseshellbracketrightvertical=65082,t.totaothai=3605,t.tpalatalhook=427,t.tparen=9391,t.trademark=8482,t.trademarksans=63722,t.trademarkserif=63195,t.tretroflexhook=648,t.triagdn=9660,t.triaglf=9668,t.triagrt=9658,t.triagup=9650,t.ts=678,t.tsadi=1510,t.tsadidagesh=64326,t.tsadidageshhebrew=64326,t.tsadihebrew=1510,t.tsecyrillic=1094,t.tsere=1461,t.tsere12=1461,t.tsere1e=1461,t.tsere2b=1461,t.tserehebrew=1461,t.tserenarrowhebrew=1461,t.tserequarterhebrew=1461,t.tserewidehebrew=1461,t.tshecyrillic=1115,t.tsuperior=63219,t.ttabengali=2463,t.ttadeva=2335,t.ttagujarati=2719,t.ttagurmukhi=2591,t.tteharabic=1657,t.ttehfinalarabic=64359,t.ttehinitialarabic=64360,t.ttehmedialarabic=64361,t.tthabengali=2464,t.tthadeva=2336,t.tthagujarati=2720,t.tthagurmukhi=2592,t.tturned=647,t.tuhiragana=12388,t.tukatakana=12484,t.tukatakanahalfwidth=65410,t.tusmallhiragana=12387,t.tusmallkatakana=12483,t.tusmallkatakanahalfwidth=65391,t.twelvecircle=9323,t.twelveparen=9343,t.twelveperiod=9363,t.twelveroman=8571,t.twentycircle=9331,t.twentyhangzhou=21316,t.twentyparen=9351,t.twentyperiod=9371,t.two=50,t.twoarabic=1634,t.twobengali=2536,t.twocircle=9313,t.twocircleinversesansserif=10123,t.twodeva=2408,t.twodotenleader=8229,t.twodotleader=8229,t.twodotleadervertical=65072,t.twogujarati=2792,t.twogurmukhi=2664,t.twohackarabic=1634,t.twohangzhou=12322,t.twoideographicparen=12833,t.twoinferior=8322,t.twomonospace=65298,t.twonumeratorbengali=2549,t.twooldstyle=63282,t.twoparen=9333,t.twoperiod=9353,t.twopersian=1778,t.tworoman=8561,t.twostroke=443,t.twosuperior=178,t.twothai=3666,t.twothirds=8532,t.u=117,t.uacute=250,t.ubar=649,t.ubengali=2441,t.ubopomofo=12584,t.ubreve=365,t.ucaron=468,t.ucircle=9444,t.ucircumflex=251,t.ucircumflexbelow=7799,t.ucyrillic=1091,t.udattadeva=2385,t.udblacute=369,t.udblgrave=533,t.udeva=2313,t.udieresis=252,t.udieresisacute=472,t.udieresisbelow=7795,t.udieresiscaron=474,t.udieresiscyrillic=1265,t.udieresisgrave=476,t.udieresismacron=470,t.udotbelow=7909,t.ugrave=249,t.ugujarati=2697,t.ugurmukhi=2569,t.uhiragana=12358,t.uhookabove=7911,t.uhorn=432,t.uhornacute=7913,t.uhorndotbelow=7921,t.uhorngrave=7915,t.uhornhookabove=7917,t.uhorntilde=7919,t.uhungarumlaut=369,t.uhungarumlautcyrillic=1267,t.uinvertedbreve=535,t.ukatakana=12454,t.ukatakanahalfwidth=65395,t.ukcyrillic=1145,t.ukorean=12636,t.umacron=363,t.umacroncyrillic=1263,t.umacrondieresis=7803,t.umatragurmukhi=2625,t.umonospace=65365,t.underscore=95,t.underscoredbl=8215,t.underscoremonospace=65343,t.underscorevertical=65075,t.underscorewavy=65103,t.union=8746,t.universal=8704,t.uogonek=371,t.uparen=9392,t.upblock=9600,t.upperdothebrew=1476,t.upsilon=965,t.upsilondieresis=971,t.upsilondieresistonos=944,t.upsilonlatin=650,t.upsilontonos=973,t.uptackbelowcmb=797,t.uptackmod=724,t.uragurmukhi=2675,t.uring=367,t.ushortcyrillic=1118,t.usmallhiragana=12357,t.usmallkatakana=12453,t.usmallkatakanahalfwidth=65385,t.ustraightcyrillic=1199,t.ustraightstrokecyrillic=1201,t.utilde=361,t.utildeacute=7801,t.utildebelow=7797,t.uubengali=2442,t.uudeva=2314,t.uugujarati=2698,t.uugurmukhi=2570,t.uumatragurmukhi=2626,t.uuvowelsignbengali=2498,t.uuvowelsigndeva=2370,t.uuvowelsigngujarati=2754,t.uvowelsignbengali=2497,t.uvowelsigndeva=2369,t.uvowelsigngujarati=2753,t.v=118,t.vadeva=2357,t.vagujarati=2741,t.vagurmukhi=2613,t.vakatakana=12535,t.vav=1493,t.vavdagesh=64309,t.vavdagesh65=64309,t.vavdageshhebrew=64309,t.vavhebrew=1493,t.vavholam=64331,t.vavholamhebrew=64331,t.vavvavhebrew=1520,t.vavyodhebrew=1521,t.vcircle=9445,t.vdotbelow=7807,t.vecyrillic=1074,t.veharabic=1700,t.vehfinalarabic=64363,t.vehinitialarabic=64364,t.vehmedialarabic=64365,t.vekatakana=12537,t.venus=9792,t.verticalbar=124,t.verticallineabovecmb=781,t.verticallinebelowcmb=809,t.verticallinelowmod=716,t.verticallinemod=712,t.vewarmenian=1406,t.vhook=651,t.vikatakana=12536,t.viramabengali=2509,t.viramadeva=2381,t.viramagujarati=2765,t.visargabengali=2435,t.visargadeva=2307,t.visargagujarati=2691,t.vmonospace=65366,t.voarmenian=1400,t.voicediterationhiragana=12446,t.voicediterationkatakana=12542,t.voicedmarkkana=12443,t.voicedmarkkanahalfwidth=65438,t.vokatakana=12538,t.vparen=9393,t.vtilde=7805,t.vturned=652,t.vuhiragana=12436,t.vukatakana=12532,t.w=119,t.wacute=7811,t.waekorean=12633,t.wahiragana=12431,t.wakatakana=12527,t.wakatakanahalfwidth=65436,t.wakorean=12632,t.wasmallhiragana=12430,t.wasmallkatakana=12526,t.wattosquare=13143,t.wavedash=12316,t.wavyunderscorevertical=65076,t.wawarabic=1608,t.wawfinalarabic=65262,t.wawhamzaabovearabic=1572,t.wawhamzaabovefinalarabic=65158,t.wbsquare=13277,t.wcircle=9446,t.wcircumflex=373,t.wdieresis=7813,t.wdotaccent=7815,t.wdotbelow=7817,t.wehiragana=12433,t.weierstrass=8472,t.wekatakana=12529,t.wekorean=12638,t.weokorean=12637,t.wgrave=7809,t.whitebullet=9702,t.whitecircle=9675,t.whitecircleinverse=9689,t.whitecornerbracketleft=12302,t.whitecornerbracketleftvertical=65091,t.whitecornerbracketright=12303,t.whitecornerbracketrightvertical=65092,t.whitediamond=9671,t.whitediamondcontainingblacksmalldiamond=9672,t.whitedownpointingsmalltriangle=9663;t.whitedownpointingtriangle=9661,t.whiteleftpointingsmalltriangle=9667,t.whiteleftpointingtriangle=9665,t.whitelenticularbracketleft=12310,t.whitelenticularbracketright=12311,t.whiterightpointingsmalltriangle=9657,t.whiterightpointingtriangle=9655,t.whitesmallsquare=9643,t.whitesmilingface=9786,t.whitesquare=9633,t.whitestar=9734,t.whitetelephone=9743,t.whitetortoiseshellbracketleft=12312,t.whitetortoiseshellbracketright=12313,t.whiteuppointingsmalltriangle=9653,t.whiteuppointingtriangle=9651,t.wihiragana=12432,t.wikatakana=12528,t.wikorean=12639,t.wmonospace=65367,t.wohiragana=12434,t.wokatakana=12530,t.wokatakanahalfwidth=65382,t.won=8361,t.wonmonospace=65510,t.wowaenthai=3623,t.wparen=9394,t.wring=7832,t.wsuperior=695,t.wturned=653,t.wynn=447,t.x=120,t.xabovecmb=829,t.xbopomofo=12562,t.xcircle=9447,t.xdieresis=7821,t.xdotaccent=7819,t.xeharmenian=1389,t.xi=958,t.xmonospace=65368,t.xparen=9395,t.xsuperior=739,t.y=121,t.yaadosquare=13134,t.yabengali=2479,t.yacute=253,t.yadeva=2351,t.yaekorean=12626,t.yagujarati=2735,t.yagurmukhi=2607,t.yahiragana=12420,t.yakatakana=12516,t.yakatakanahalfwidth=65428,t.yakorean=12625,t.yamakkanthai=3662,t.yasmallhiragana=12419,t.yasmallkatakana=12515,t.yasmallkatakanahalfwidth=65388,t.yatcyrillic=1123,t.ycircle=9448,t.ycircumflex=375,t.ydieresis=255,t.ydotaccent=7823,t.ydotbelow=7925,t.yeharabic=1610,t.yehbarreearabic=1746,t.yehbarreefinalarabic=64431,t.yehfinalarabic=65266,t.yehhamzaabovearabic=1574,t.yehhamzaabovefinalarabic=65162,t.yehhamzaaboveinitialarabic=65163,t.yehhamzaabovemedialarabic=65164,t.yehinitialarabic=65267,t.yehmedialarabic=65268,t.yehmeeminitialarabic=64733,t.yehmeemisolatedarabic=64600,t.yehnoonfinalarabic=64660,t.yehthreedotsbelowarabic=1745,t.yekorean=12630,t.yen=165,t.yenmonospace=65509,t.yeokorean=12629,t.yeorinhieuhkorean=12678,t.yerahbenyomohebrew=1450,t.yerahbenyomolefthebrew=1450,t.yericyrillic=1099,t.yerudieresiscyrillic=1273,t.yesieungkorean=12673,t.yesieungpansioskorean=12675,t.yesieungsioskorean=12674,t.yetivhebrew=1434,t.ygrave=7923,t.yhook=436,t.yhookabove=7927,t.yiarmenian=1397,t.yicyrillic=1111,t.yikorean=12642,t.yinyang=9775,t.yiwnarmenian=1410,t.ymonospace=65369,t.yod=1497,t.yoddagesh=64313,t.yoddageshhebrew=64313,t.yodhebrew=1497,t.yodyodhebrew=1522,t.yodyodpatahhebrew=64287,t.yohiragana=12424,t.yoikorean=12681,t.yokatakana=12520,t.yokatakanahalfwidth=65430,t.yokorean=12635,t.yosmallhiragana=12423,t.yosmallkatakana=12519,t.yosmallkatakanahalfwidth=65390,t.yotgreek=1011,t.yoyaekorean=12680,t.yoyakorean=12679,t.yoyakthai=3618,t.yoyingthai=3597,t.yparen=9396,t.ypogegrammeni=890,t.ypogegrammenigreekcmb=837,t.yr=422,t.yring=7833,t.ysuperior=696,t.ytilde=7929,t.yturned=654,t.yuhiragana=12422,t.yuikorean=12684,t.yukatakana=12518,t.yukatakanahalfwidth=65429,t.yukorean=12640,t.yusbigcyrillic=1131,t.yusbigiotifiedcyrillic=1133,t.yuslittlecyrillic=1127,t.yuslittleiotifiedcyrillic=1129,t.yusmallhiragana=12421,t.yusmallkatakana=12517,t.yusmallkatakanahalfwidth=65389,t.yuyekorean=12683,t.yuyeokorean=12682,t.yyabengali=2527,t.yyadeva=2399,t.z=122,t.zaarmenian=1382,t.zacute=378,t.zadeva=2395,t.zagurmukhi=2651,t.zaharabic=1592,t.zahfinalarabic=65222,t.zahinitialarabic=65223,t.zahiragana=12374,t.zahmedialarabic=65224,t.zainarabic=1586,t.zainfinalarabic=65200,t.zakatakana=12470,t.zaqefgadolhebrew=1429,t.zaqefqatanhebrew=1428,t.zarqahebrew=1432,t.zayin=1494,t.zayindagesh=64310,t.zayindageshhebrew=64310,t.zayinhebrew=1494,t.zbopomofo=12567,t.zcaron=382,t.zcircle=9449,t.zcircumflex=7825,t.zcurl=657,t.zdot=380,t.zdotaccent=380,t.zdotbelow=7827,t.zecyrillic=1079,t.zedescendercyrillic=1177,t.zedieresiscyrillic=1247,t.zehiragana=12380,t.zekatakana=12476,t.zero=48,t.zeroarabic=1632,t.zerobengali=2534,t.zerodeva=2406,t.zerogujarati=2790,t.zerogurmukhi=2662,t.zerohackarabic=1632,t.zeroinferior=8320,t.zeromonospace=65296,t.zerooldstyle=63280,t.zeropersian=1776,t.zerosuperior=8304,t.zerothai=3664,t.zerowidthjoiner=65279,t.zerowidthnonjoiner=8204,t.zerowidthspace=8203,t.zeta=950,t.zhbopomofo=12563,t.zhearmenian=1386,t.zhebrevecyrillic=1218,t.zhecyrillic=1078,t.zhedescendercyrillic=1175,t.zhedieresiscyrillic=1245,t.zihiragana=12376,t.zikatakana=12472,t.zinorhebrew=1454,t.zlinebelow=7829,t.zmonospace=65370,t.zohiragana=12382,t.zokatakana=12478,t.zparen=9397,t.zretroflexhook=656,t.zstroke=438,t.zuhiragana=12378,t.zukatakana=12474,t[".notdef"]=0,t.angbracketleftbig=9001,t.angbracketleftBig=9001,t.angbracketleftbigg=9001,t.angbracketleftBigg=9001,t.angbracketrightBig=9002,t.angbracketrightbig=9002,t.angbracketrightBigg=9002,t.angbracketrightbigg=9002,t.arrowhookleft=8618,t.arrowhookright=8617,t.arrowlefttophalf=8636,t.arrowleftbothalf=8637,t.arrownortheast=8599,t.arrownorthwest=8598,t.arrowrighttophalf=8640,t.arrowrightbothalf=8641,t.arrowsoutheast=8600,t.arrowsouthwest=8601,t.backslashbig=8726,t.backslashBig=8726,t.backslashBigg=8726,t.backslashbigg=8726,t.bardbl=8214,t.bracehtipdownleft=65079,t.bracehtipdownright=65079,t.bracehtipupleft=65080,t.bracehtipupright=65080,t.braceleftBig=123,t.braceleftbig=123,t.braceleftbigg=123,t.braceleftBigg=123,t.bracerightBig=125,t.bracerightbig=125,t.bracerightbigg=125,t.bracerightBigg=125,t.bracketleftbig=91,t.bracketleftBig=91,t.bracketleftbigg=91,t.bracketleftBigg=91,t.bracketrightBig=93,t.bracketrightbig=93,t.bracketrightbigg=93,t.bracketrightBigg=93,t.ceilingleftbig=8968,t.ceilingleftBig=8968,t.ceilingleftBigg=8968,t.ceilingleftbigg=8968,t.ceilingrightbig=8969,t.ceilingrightBig=8969,t.ceilingrightbigg=8969,t.ceilingrightBigg=8969,t.circledotdisplay=8857,t.circledottext=8857,t.circlemultiplydisplay=8855,t.circlemultiplytext=8855,t.circleplusdisplay=8853,t.circleplustext=8853,t.contintegraldisplay=8750,t.contintegraltext=8750,t.coproductdisplay=8720,t.coproducttext=8720,t.floorleftBig=8970,t.floorleftbig=8970,t.floorleftbigg=8970,t.floorleftBigg=8970,t.floorrightbig=8971,t.floorrightBig=8971,t.floorrightBigg=8971,t.floorrightbigg=8971,t.hatwide=770,t.hatwider=770,t.hatwidest=770,t.intercal=7488,t.integraldisplay=8747,t.integraltext=8747,t.intersectiondisplay=8898,t.intersectiontext=8898,t.logicalanddisplay=8743,t.logicalandtext=8743,t.logicalordisplay=8744,t.logicalortext=8744,t.parenleftBig=40,t.parenleftbig=40,t.parenleftBigg=40,t.parenleftbigg=40,t.parenrightBig=41,t.parenrightbig=41,t.parenrightBigg=41,t.parenrightbigg=41,t.prime=8242,t.productdisplay=8719,t.producttext=8719,t.radicalbig=8730,t.radicalBig=8730,t.radicalBigg=8730,t.radicalbigg=8730,t.radicalbt=8730,t.radicaltp=8730,t.radicalvertex=8730,t.slashbig=47,t.slashBig=47,t.slashBigg=47,t.slashbigg=47,t.summationdisplay=8721,t.summationtext=8721,t.tildewide=732,t.tildewider=732,t.tildewidest=732,t.uniondisplay=8899,t.unionmultidisplay=8846,t.unionmultitext=8846,t.unionsqdisplay=8852,t.unionsqtext=8852,t.uniontext=8899,t.vextenddouble=8741,t.vextendsingle=8739}),Fn=getLookupTableFactory(function(t){t.space=32,t.a1=9985,t.a2=9986,t.a202=9987,t.a3=9988,t.a4=9742,t.a5=9990,t.a119=9991,t.a118=9992,t.a117=9993,t.a11=9755,t.a12=9758,t.a13=9996,t.a14=9997,t.a15=9998,t.a16=9999,t.a105=1e4,t.a17=10001,t.a18=10002,t.a19=10003,t.a20=10004,t.a21=10005,t.a22=10006,t.a23=10007,t.a24=10008,t.a25=10009,t.a26=10010,t.a27=10011,t.a28=10012,t.a6=10013,t.a7=10014,t.a8=10015,t.a9=10016,t.a10=10017,t.a29=10018,t.a30=10019,t.a31=10020,t.a32=10021,t.a33=10022,t.a34=10023,t.a35=9733,t.a36=10025,t.a37=10026,t.a38=10027,t.a39=10028,t.a40=10029,t.a41=10030,t.a42=10031,t.a43=10032,t.a44=10033,t.a45=10034,t.a46=10035,t.a47=10036,t.a48=10037,t.a49=10038,t.a50=10039,t.a51=10040,t.a52=10041,t.a53=10042,t.a54=10043,t.a55=10044,t.a56=10045,t.a57=10046,t.a58=10047,t.a59=10048,t.a60=10049,t.a61=10050,t.a62=10051,t.a63=10052,t.a64=10053,t.a65=10054,t.a66=10055,t.a67=10056,t.a68=10057,t.a69=10058,t.a70=10059,t.a71=9679,t.a72=10061,t.a73=9632,t.a74=10063,t.a203=10064,t.a75=10065,t.a204=10066,t.a76=9650,t.a77=9660,t.a78=9670,t.a79=10070,t.a81=9687,t.a82=10072,t.a83=10073,t.a84=10074,t.a97=10075,t.a98=10076,t.a99=10077,t.a100=10078,t.a101=10081,t.a102=10082,t.a103=10083,t.a104=10084,t.a106=10085,t.a107=10086,t.a108=10087,t.a112=9827,t.a111=9830,t.a110=9829,t.a109=9824,t.a120=9312,t.a121=9313,t.a122=9314,t.a123=9315,t.a124=9316,t.a125=9317,t.a126=9318,t.a127=9319,t.a128=9320,t.a129=9321,t.a130=10102,t.a131=10103,t.a132=10104,t.a133=10105,t.a134=10106,t.a135=10107,t.a136=10108,t.a137=10109,t.a138=10110,t.a139=10111,t.a140=10112,t.a141=10113,t.a142=10114,t.a143=10115,t.a144=10116,t.a145=10117,t.a146=10118,t.a147=10119,t.a148=10120,t.a149=10121,t.a150=10122,t.a151=10123,t.a152=10124,t.a153=10125,t.a154=10126,t.a155=10127,t.a156=10128,t.a157=10129,t.a158=10130,t.a159=10131,t.a160=10132,t.a161=8594,t.a163=8596,t.a164=8597,t.a196=10136,t.a165=10137,t.a192=10138,t.a166=10139,t.a167=10140,t.a168=10141,t.a169=10142,t.a170=10143,t.a171=10144,t.a172=10145,t.a173=10146,t.a162=10147,t.a174=10148,t.a175=10149,t.a176=10150,t.a177=10151,t.a178=10152,t.a179=10153,t.a193=10154,t.a180=10155,t.a199=10156,t.a181=10157,t.a200=10158,t.a182=10159,t.a201=10161,t.a183=10162,t.a184=10163,t.a197=10164,t.a185=10165,t.a194=10166,t.a198=10167,t.a186=10168,t.a195=10169,t.a187=10170,t.a188=10171,t.a189=10172,t.a190=10173,t.a191=10174,t.a89=10088,t.a90=10089,t.a93=10090,t.a94=10091,t.a91=10092,t.a92=10093,t.a205=10094,t.a85=10095,t.a206=10096,t.a86=10097,t.a87=10098,t.a88=10099,t.a95=10100,t.a96=10101,t[".notdef"]=0}),Dn=getLookupTableFactory(function(t){t[63721]=169,t[63193]=169,t[63720]=174,t[63194]=174,t[63722]=8482,t[63195]=8482,t[63729]=9127,t[63730]=9128,t[63731]=9129,t[63740]=9131,t[63741]=9132,t[63742]=9133,t[63726]=9121,t[63727]=9122,t[63728]=9123,t[63737]=9124,t[63738]=9125,t[63739]=9126,t[63723]=9115,t[63724]=9116,t[63725]=9117,t[63734]=9118,t[63735]=9119,t[63736]=9120});function getUnicodeForGlyph(t,e){let s=e[t];if(void 0!==s)return s;if(!t)return-1;if("u"===t[0]){const e=t.length;let i;if(7===e&&"n"===t[1]&&"i"===t[2])i=t.substring(3);else{if(!(e>=5&&e<=7))return-1;i=t.substring(1)}if(i===i.toUpperCase()&&(s=parseInt(i,16),s>=0))return s}return-1}var Rn=[[0,127],[128,255],[256,383],[384,591],[592,687,7424,7551,7552,7615],[688,767,42752,42783],[768,879,7616,7679],[880,1023],[11392,11519],[1024,1279,1280,1327,11744,11775,42560,42655],[1328,1423],[1424,1535],[42240,42559],[1536,1791,1872,1919],[1984,2047],[2304,2431],[2432,2559],[2560,2687],[2688,2815],[2816,2943],[2944,3071],[3072,3199],[3200,3327],[3328,3455],[3584,3711],[3712,3839],[4256,4351,11520,11567],[6912,7039],[4352,4607],[7680,7935,11360,11391,42784,43007],[7936,8191],[8192,8303,11776,11903],[8304,8351],[8352,8399],[8400,8447],[8448,8527],[8528,8591],[8592,8703,10224,10239,10496,10623,11008,11263],[8704,8959,10752,11007,10176,10223,10624,10751],[8960,9215],[9216,9279],[9280,9311],[9312,9471],[9472,9599],[9600,9631],[9632,9727],[9728,9983],[9984,10175],[12288,12351],[12352,12447],[12448,12543,12784,12799],[12544,12591,12704,12735],[12592,12687],[43072,43135],[12800,13055],[13056,13311],[44032,55215],[55296,57343],[67840,67871],[19968,40959,11904,12031,12032,12255,12272,12287,13312,19903,131072,173791,12688,12703],[57344,63743],[12736,12783,63744,64255,194560,195103],[64256,64335],[64336,65023],[65056,65071],[65040,65055],[65104,65135],[65136,65279],[65280,65519],[65520,65535],[3840,4095],[1792,1871],[1920,1983],[3456,3583],[4096,4255],[4608,4991,4992,5023,11648,11743],[5024,5119],[5120,5759],[5760,5791],[5792,5887],[6016,6143],[6144,6319],[10240,10495],[40960,42127],[5888,5919,5920,5951,5952,5983,5984,6015],[66304,66351],[66352,66383],[66560,66639],[118784,119039,119040,119295,119296,119375],[119808,120831],[1044480,1048573],[65024,65039,917760,917999],[917504,917631],[6400,6479],[6480,6527],[6528,6623],[6656,6687],[11264,11359],[11568,11647],[19904,19967],[43008,43055],[65536,65663,65664,65791,65792,65855],[65856,65935],[66432,66463],[66464,66527],[66640,66687],[66688,66735],[67584,67647],[68096,68191],[119552,119647],[73728,74751,74752,74879],[119648,119679],[7040,7103],[7168,7247],[7248,7295],[43136,43231],[43264,43311],[43312,43359],[43520,43615],[65936,65999],[66e3,66047],[66208,66271,66176,66207,67872,67903],[127024,127135,126976,127023]];function getUnicodeRangeFor(t,e=-1){if(-1!==e){const s=Rn[e];for(let i=0,n=s.length;i<n;i+=2)if(t>=s[i]&&t<=s[i+1])return e}for(let e=0,s=Rn.length;e<s;e++){const s=Rn[e];for(let i=0,n=s.length;i<n;i+=2)if(t>=s[i]&&t<=s[i+1])return e}return-1}var Bn=new RegExp("^(\\s)|(\\p{Mn})|(\\p{Cf})$","u"),Pn=new Map,Nn=!0,On=1,Ln=2,Un=4,$n=32,Hn=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function recoverGlyphName(t,e){if(void 0!==e[t])return t;const s=getUnicodeForGlyph(t,e);if(-1!==s)for(const t in e)if(e[t]===s)return t;return info$1("Unable to recover a standard glyph name for: "+t),t}function type1FontGlyphMapping(t,e,s){const i=Object.create(null);let n,a,r;const o=!!(t.flags&Un);if(t.isInternalFont)for(r=e,a=0;a<r.length;a++)n=s.indexOf(r[a]),i[a]=n>=0?n:0;else if(t.baseEncodingName)for(r=getEncoding(t.baseEncodingName),a=0;a<r.length;a++)n=s.indexOf(r[a]),i[a]=n>=0?n:0;else if(o)for(a in e)i[a]=e[a];else for(r=_n,a=0;a<r.length;a++)n=s.indexOf(r[a]),i[a]=n>=0?n:0;const l=t.differences;let c;if(l)for(a in l){const t=l[a];if(n=s.indexOf(t),-1===n){c||(c=En());const e=recoverGlyphName(t,c);e!==t&&(n=s.indexOf(e))}i[a]=n>=0?n:0}return i}function normalizeFontName(t){return t.replaceAll(/[,_]/g,"-").replaceAll(/\s/g,"")}var jn=getLookupTableFactory(t=>{t[8211]=65074,t[8212]=65073,t[8229]=65072,t[8230]=65049,t[12289]=65041,t[12290]=65042,t[12296]=65087,t[12297]=65088,t[12298]=65085,t[12299]=65086,t[12300]=65089,t[12301]=65090,t[12302]=65091,t[12303]=65092,t[12304]=65083,t[12305]=65084,t[12308]=65081,t[12309]=65082,t[12310]=65047,t[12311]=65048,t[65103]=65076,t[65281]=65045,t[65288]=65077,t[65289]=65078,t[65292]=65040,t[65306]=65043,t[65307]=65044,t[65311]=65046,t[65339]=65095,t[65341]=65096,t[65343]=65075,t[65371]=65079,t[65373]=65080}),qn=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"],zn=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],Gn=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"],Wn=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],Vn=391,Xn=[null,{id:"hstem",min:2,stackClearing:!0,stem:!0},null,{id:"vstem",min:2,stackClearing:!0,stem:!0},{id:"vmoveto",min:1,stackClearing:!0},{id:"rlineto",min:2,resetStack:!0},{id:"hlineto",min:1,resetStack:!0},{id:"vlineto",min:1,resetStack:!0},{id:"rrcurveto",min:6,resetStack:!0},null,{id:"callsubr",min:1,undefStack:!0},{id:"return",min:0,undefStack:!0},null,null,{id:"endchar",min:0,stackClearing:!0},null,null,null,{id:"hstemhm",min:2,stackClearing:!0,stem:!0},{id:"hintmask",min:0,stackClearing:!0},{id:"cntrmask",min:0,stackClearing:!0},{id:"rmoveto",min:2,stackClearing:!0},{id:"hmoveto",min:1,stackClearing:!0},{id:"vstemhm",min:2,stackClearing:!0,stem:!0},{id:"rcurveline",min:8,resetStack:!0},{id:"rlinecurve",min:8,resetStack:!0},{id:"vvcurveto",min:4,resetStack:!0},{id:"hhcurveto",min:4,resetStack:!0},null,{id:"callgsubr",min:1,undefStack:!0},{id:"vhcurveto",min:4,resetStack:!0},{id:"hvcurveto",min:4,resetStack:!0}],Kn=[null,null,null,{id:"and",min:2,stackDelta:-1},{id:"or",min:2,stackDelta:-1},{id:"not",min:1,stackDelta:0},null,null,null,{id:"abs",min:1,stackDelta:0},{id:"add",min:2,stackDelta:-1,stackFn(t,e){t[e-2]=t[e-2]+t[e-1]}},{id:"sub",min:2,stackDelta:-1,stackFn(t,e){t[e-2]=t[e-2]-t[e-1]}},{id:"div",min:2,stackDelta:-1,stackFn(t,e){t[e-2]=t[e-2]/t[e-1]}},null,{id:"neg",min:1,stackDelta:0,stackFn(t,e){t[e-1]=-t[e-1]}},{id:"eq",min:2,stackDelta:-1},null,null,{id:"drop",min:1,stackDelta:-1},null,{id:"put",min:2,stackDelta:-2},{id:"get",min:1,stackDelta:0},{id:"ifelse",min:4,stackDelta:-3},{id:"random",min:0,stackDelta:1},{id:"mul",min:2,stackDelta:-1,stackFn(t,e){t[e-2]=t[e-2]*t[e-1]}},null,{id:"sqrt",min:1,stackDelta:0},{id:"dup",min:1,stackDelta:1},{id:"exch",min:2,stackDelta:0},{id:"index",min:2,stackDelta:0},{id:"roll",min:3,stackDelta:-2},null,null,null,{id:"hflex",min:7,resetStack:!0},{id:"flex",min:13,resetStack:!0},{id:"hflex1",min:9,resetStack:!0},{id:"flex1",min:11,resetStack:!0}],Yn=class{constructor(t,e,s){this.bytes=t.getBytes(),this.properties=e,this.seacAnalysisEnabled=!!s}parse(){const t=this.properties,e=new Jn;this.cff=e;const s=this.parseHeader(),i=this.parseIndex(s.endPos),n=this.parseIndex(i.endPos),a=this.parseIndex(n.endPos),r=this.parseIndex(a.endPos),o=this.parseDict(n.obj.get(0)),l=this.createDict(ia,o,e.strings);e.header=s.obj,e.names=this.parseNameIndex(i.obj),e.strings=this.parseStringIndex(a.obj),e.topDict=l,e.globalSubrIndex=r.obj,this.parsePrivateDict(e.topDict),e.isCIDFont=l.hasName("ROS");const c=l.getByName("CharStrings"),h=this.parseIndex(c).obj,u=l.getByName("FontMatrix");u&&(t.fontMatrix=u);const d=l.getByName("FontBBox");let f,g;if(d&&(t.ascent=Math.max(d[3],d[1]),t.descent=Math.min(d[1],d[3]),t.ascentScaled=!0),e.isCIDFont){const t=this.parseIndex(l.getByName("FDArray")).obj;for(let s=0,i=t.count;s<i;++s){const i=t.get(s),n=this.createDict(ia,this.parseDict(i),e.strings);this.parsePrivateDict(n),e.fdArray.push(n)}g=null,f=this.parseCharsets(l.getByName("charset"),h.count,e.strings,!0),e.fdSelect=this.parseFDSelect(l.getByName("FDSelect"),h.count)}else f=this.parseCharsets(l.getByName("charset"),h.count,e.strings,!1),g=this.parseEncoding(l.getByName("Encoding"),t,e.strings,f.charset);e.charset=f,e.encoding=g;const p=this.parseCharStrings({charStrings:h,localSubrIndex:l.privateDict.subrsIndex,globalSubrIndex:r.obj,fdSelect:e.fdSelect,fdArray:e.fdArray,privateDict:l.privateDict});return e.charStrings=p.charStrings,e.seacs=p.seacs,e.widths=p.widths,e}parseHeader(){let t=this.bytes;const e=t.length;let s=0;for(;s<e&&1!==t[s];)++s;if(s>=e)throw new Ze("Invalid CFF header");0!==s&&(info$1("cff data is shifted"),t=t.subarray(s),this.bytes=t);const i=t[0],n=t[1],a=t[2],r=t[3];return{obj:new Zn(i,n,a,r),endPos:a}}parseDict(t){let e=0;function parseOperand(){let s=t[e++];return 30===s?function(){let s="";const i=15,n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"],a=t.length;for(;e<a;){const a=t[e++],r=a>>4,o=15&a;if(r===i)break;if(s+=n[r],o===i)break;s+=n[o]}return parseFloat(s)}():28===s?(s=readInt16(t,e),e+=2,s):29===s?(s=t[e++],s=s<<8|t[e++],s=s<<8|t[e++],s=s<<8|t[e++],s):s>=32&&s<=246?s-139:s>=247&&s<=250?256*(s-247)+t[e++]+108:s>=251&&s<=254?-256*(s-251)-t[e++]-108:(warn$1('CFFParser_parseDict: "'+s+'" is a reserved command.'),NaN)}let s=[];const i=[];e=0;const n=t.length;for(;e<n;){let n=t[e];n<=21?(12===n&&(n=n<<8|t[++e]),i.push([n,s]),s=[],++e):s.push(parseOperand())}return i}parseIndex(t){const e=new ta,s=this.bytes,i=s[t++]<<8|s[t++],n=[];let a,r,o=t;if(0!==i){const e=s[t++],l=t+(i+1)*e-1;for(a=0,r=i+1;a<r;++a){let i=0;for(let n=0;n<e;++n)i<<=8,i+=s[t++];n.push(l+i)}o=n[i]}for(a=0,r=n.length-1;a<r;++a){const t=n[a],i=n[a+1];e.add(s.subarray(t,i))}return{obj:e,endPos:o}}parseNameIndex(t){const e=[];for(let s=0,i=t.count;s<i;++s){const i=t.get(s);e.push(bytesToString$1(i))}return e}parseStringIndex(t){const e=new Qn;for(let s=0,i=t.count;s<i;++s){const i=t.get(s);e.add(bytesToString$1(i))}return e}createDict(t,e,s){const i=new t(s);for(const[t,s]of e)i.setByKey(t,s);return i}parseCharString(t,e,s,i){if(!e||t.callDepth>10)return!1;let n=t.stackSize;const a=t.stack;let r=e.length;for(let o=0;o<r;){const l=e[o++];let c=null;if(12===l){const t=e[o++];0===t?(e[o-2]=139,e[o-1]=22,n=0):c=Kn[t]}else if(28===l)a[n]=readInt16(e,o),o+=2,n++;else if(14===l){if(n>=4&&(n-=4,this.seacAnalysisEnabled))return t.seac=a.slice(n,n+4),!1;c=Xn[l]}else if(l>=32&&l<=246)a[n]=l-139,n++;else if(l>=247&&l<=254)a[n]=l<251?(l-247<<8)+e[o]+108:-(l-251<<8)-e[o]-108,o++,n++;else if(255===l)a[n]=(e[o]<<24|e[o+1]<<16|e[o+2]<<8|e[o+3])/65536,o+=4,n++;else if(19===l||20===l){if(t.hints+=n>>1,0===t.hints){e.copyWithin(o-1,o,-1),o-=1,r-=1;continue}o+=t.hints+7>>3,n%=2,c=Xn[l]}else{if(10===l||29===l){const e=10===l?s:i;if(!e)return c=Xn[l],warn$1("Missing subrsIndex for "+c.id),!1;let r=32768;e.count<1240?r=107:e.count<33900&&(r=1131);const o=a[--n]+r;if(o<0||o>=e.count||isNaN(o))return c=Xn[l],warn$1("Out of bounds subrIndex for "+c.id),!1;if(t.stackSize=n,t.callDepth++,!this.parseCharString(t,e.get(o),s,i))return!1;t.callDepth--,n=t.stackSize;continue}if(11===l)return t.stackSize=n,!0;if(0===l&&o===e.length)e[o-1]=14,c=Xn[14];else{if(9===l){e.copyWithin(o-1,o,-1),o-=1,r-=1;continue}c=Xn[l]}}if(c){if(c.stem&&(t.hints+=n>>1,3===l||23===l?t.hasVStems=!0:!t.hasVStems||1!==l&&18!==l||(warn$1("CFF stem hints are in wrong order"),e[o-1]=1===l?3:23)),"min"in c&&!t.undefStack&&n<c.min)return warn$1("Not enough parameters for "+c.id+"; actual: "+n+", expected: "+c.min),0===n&&(e[o-1]=14,!0);t.firstStackClearing&&c.stackClearing&&(t.firstStackClearing=!1,n-=c.min,n>=2&&c.stem?n%=2:n>1&&warn$1("Found too many parameters for stack-clearing command"),n>0&&(t.width=a[n-1])),"stackDelta"in c?("stackFn"in c&&c.stackFn(a,n),n+=c.stackDelta):c.stackClearing?n=0:c.resetStack?(n=0,t.undefStack=!1):c.undefStack&&(n=0,t.undefStack=!0,t.firstStackClearing=!1)}}return r<e.length&&e.fill(14,r),t.stackSize=n,!0}parseCharStrings({charStrings:t,localSubrIndex:e,globalSubrIndex:s,fdSelect:i,fdArray:n,privateDict:a}){const r=[],o=[],l=t.count;for(let c=0;c<l;c++){const l=t.get(c),h={callDepth:0,stackSize:0,stack:[],undefStack:!0,hints:0,firstStackClearing:!0,seac:null,width:null,hasVStems:!1};let u=!0,d=null,f=a;if(i&&n.length){const t=i.getFDIndex(c);-1===t&&(warn$1("Glyph index is not in fd select."),u=!1),t>=n.length&&(warn$1("Invalid fd index for glyph index."),u=!1),u&&(f=n[t].privateDict,d=f.subrsIndex)}else e&&(d=e);if(u&&(u=this.parseCharString(h,l,d,s)),null!==h.width){const t=f.getByName("nominalWidthX");o[c]=t+h.width}else{const t=f.getByName("defaultWidthX");o[c]=t}null!==h.seac&&(r[c]=h.seac),u||t.set(c,new Uint8Array([14]))}return{charStrings:t,seacs:r,widths:o}}emptyPrivateDictionary(t){const e=this.createDict(aa,[],t.strings);t.setByKey(18,[0,0]),t.privateDict=e}parsePrivateDict(t){if(!t.hasName("Private"))return void this.emptyPrivateDictionary(t);const e=t.getByName("Private");if(!Array.isArray(e)||2!==e.length)return void t.removeByName("Private");const s=e[0],i=e[1];if(0===s||i>=this.bytes.length)return void this.emptyPrivateDictionary(t);const n=i+s,a=this.bytes.subarray(i,n),r=this.parseDict(a),o=this.createDict(aa,r,t.strings);if(t.privateDict=o,0===o.getByName("ExpansionFactor")&&o.setByName("ExpansionFactor",.06),!o.getByName("Subrs"))return;const l=o.getByName("Subrs"),c=i+l;if(0===l||c>=this.bytes.length)return void this.emptyPrivateDictionary(t);const h=this.parseIndex(c);o.subrsIndex=h.obj}parseCharsets(t,e,s,i){if(0===t)return new oa(!0,ra.ISO_ADOBE,qn);if(1===t)return new oa(!0,ra.EXPERT,zn);if(2===t)return new oa(!0,ra.EXPERT_SUBSET,Gn);const n=this.bytes,a=t,r=n[t++],o=[i?0:".notdef"];let l,c,h;switch(e-=1,r){case 0:for(h=0;h<e;h++)l=n[t++]<<8|n[t++],o.push(i?l:s.get(l));break;case 1:for(;o.length<=e;)for(l=n[t++]<<8|n[t++],c=n[t++],h=0;h<=c;h++)o.push(i?l++:s.get(l++));break;case 2:for(;o.length<=e;)for(l=n[t++]<<8|n[t++],c=n[t++]<<8|n[t++],h=0;h<=c;h++)o.push(i?l++:s.get(l++));break;default:throw new Ze("Unknown charset format")}const u=t,d=n.subarray(a,u);return new oa(!1,r,o,d)}parseEncoding(t,e,s,i){const n=Object.create(null),a=this.bytes;let r,o,l,c=!1,h=null;if(0===t||1===t){c=!0,r=t;const e=t?kn:_n;for(o=0,l=i.length;o<l;o++){const t=e.indexOf(i[o]);-1!==t&&(n[t]=o)}}else{const e=t;switch(r=a[t++],127&r){case 0:const e=a[t++];for(o=1;o<=e;o++)n[a[t++]]=o;break;case 1:const s=a[t++];let i=1;for(o=0;o<s;o++){const e=a[t++],s=a[t++];for(let t=e;t<=e+s;t++)n[t]=i++}break;default:throw new Ze(`Unknown encoding format: ${r} in CFF`)}const l=t;128&r&&(a[e]&=127,function(){const e=a[t++];for(o=0;o<e;o++){const e=a[t++],r=(a[t++]<<8)+(255&a[t++]);n[e]=i.indexOf(s.get(r))}}()),h=a.subarray(e,l)}return r&=127,new la(c,r,n,h)}parseFDSelect(t,e){const s=this.bytes,i=s[t++],n=[];let a;switch(i){case 0:for(a=0;a<e;++a){const e=s[t++];n.push(e)}break;case 3:const r=s[t++]<<8|s[t++];for(a=0;a<r;++a){let e=s[t++]<<8|s[t++];0===a&&0!==e&&(warn$1("parseFDSelect: The first range must have a first GID of 0 -- trying to recover."),e=0);const i=s[t++],r=s[t]<<8|s[t+1];for(let t=e;t<r;++t)n.push(i)}t+=2;break;default:throw new Ze(`parseFDSelect: Unknown format "${i}".`)}if(n.length!==e)throw new Ze("parseFDSelect: Invalid font data.");return new ca(i,n)}},Jn=class{constructor(){this.header=null,this.names=[],this.topDict=null,this.strings=new Qn,this.globalSubrIndex=null,this.encoding=null,this.charset=null,this.charStrings=null,this.fdArray=[],this.fdSelect=null,this.isCIDFont=!1}duplicateFirstGlyph(){if(this.charStrings.count>=65535)return void warn$1("Not enough space in charstrings to duplicate first glyph.");const t=this.charStrings.get(0);this.charStrings.add(t),this.isCIDFont&&this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0])}hasGlyphId(t){return!(t<0||t>=this.charStrings.count)&&this.charStrings.get(t).length>0}},Zn=class{constructor(t,e,s,i){this.major=t,this.minor=e,this.hdrSize=s,this.offSize=i}},Qn=class{constructor(){this.strings=[]}get(t){return t>=0&&t<=390?Wn[t]:t-Vn<=this.strings.length?this.strings[t-Vn]:Wn[0]}getSID(t){let e=Wn.indexOf(t);return-1!==e?e:(e=this.strings.indexOf(t),-1!==e?e+Vn:-1)}add(t){this.strings.push(t)}get count(){return this.strings.length}},ta=class{constructor(){this.objects=[],this.length=0}add(t){this.length+=t.length,this.objects.push(t)}set(t,e){this.length+=e.length-this.objects[t].length,this.objects[t]=e}get(t){return this.objects[t]}get count(){return this.objects.length}},ea=class{constructor(t,e){this.keyToNameMap=t.keyToNameMap,this.nameToKeyMap=t.nameToKeyMap,this.defaults=t.defaults,this.types=t.types,this.opcodes=t.opcodes,this.order=t.order,this.strings=e,this.values=Object.create(null)}setByKey(t,e){if(!(t in this.keyToNameMap))return!1;if(0===e.length)return!0;for(const s of e)if(isNaN(s))return warn$1(`Invalid CFFDict value: "${e}" for key "${t}".`),!0;const s=this.types[t];return"num"!==s&&"sid"!==s&&"offset"!==s||(e=e[0]),this.values[t]=e,!0}setByName(t,e){if(!(t in this.nameToKeyMap))throw new Ze(`Invalid dictionary name "${t}"`);this.values[this.nameToKeyMap[t]]=e}hasName(t){return this.nameToKeyMap[t]in this.values}getByName(t){if(!(t in this.nameToKeyMap))throw new Ze(`Invalid dictionary name ${t}"`);const e=this.nameToKeyMap[t];return e in this.values?this.values[e]:this.defaults[e]}removeByName(t){delete this.values[this.nameToKeyMap[t]]}static createTables(t){const e={keyToNameMap:{},nameToKeyMap:{},defaults:{},types:{},opcodes:{},order:[]};for(const s of t){const t=Array.isArray(s[0])?(s[0][0]<<8)+s[0][1]:s[0];e.keyToNameMap[t]=s[1],e.nameToKeyMap[s[1]]=t,e.types[t]=s[2],e.defaults[t]=s[3],e.opcodes[t]=Array.isArray(s[0])?s[0]:[s[0]],e.order.push(t)}return e}},sa=[[[12,30],"ROS",["sid","sid","num"],null],[[12,20],"SyntheticBase","num",null],[0,"version","sid",null],[1,"Notice","sid",null],[[12,0],"Copyright","sid",null],[2,"FullName","sid",null],[3,"FamilyName","sid",null],[4,"Weight","sid",null],[[12,1],"isFixedPitch","num",0],[[12,2],"ItalicAngle","num",0],[[12,3],"UnderlinePosition","num",-100],[[12,4],"UnderlineThickness","num",50],[[12,5],"PaintType","num",0],[[12,6],"CharstringType","num",2],[[12,7],"FontMatrix",["num","num","num","num","num","num"],[.001,0,0,.001,0,0]],[13,"UniqueID","num",null],[5,"FontBBox",["num","num","num","num"],[0,0,0,0]],[[12,8],"StrokeWidth","num",0],[14,"XUID","array",null],[15,"charset","offset",0],[16,"Encoding","offset",0],[17,"CharStrings","offset",0],[18,"Private",["offset","offset"],null],[[12,21],"PostScript","sid",null],[[12,22],"BaseFontName","sid",null],[[12,23],"BaseFontBlend","delta",null],[[12,31],"CIDFontVersion","num",0],[[12,32],"CIDFontRevision","num",0],[[12,33],"CIDFontType","num",0],[[12,34],"CIDCount","num",8720],[[12,35],"UIDBase","num",null],[[12,37],"FDSelect","offset",null],[[12,36],"FDArray","offset",null],[[12,38],"FontName","sid",null]],ia=class _CFFTopDict extends ea{static get tables(){return shadow$1(this,"tables",this.createTables(sa))}constructor(t){super(_CFFTopDict.tables,t),this.privateDict=null}},na=[[6,"BlueValues","delta",null],[7,"OtherBlues","delta",null],[8,"FamilyBlues","delta",null],[9,"FamilyOtherBlues","delta",null],[[12,9],"BlueScale","num",.039625],[[12,10],"BlueShift","num",7],[[12,11],"BlueFuzz","num",1],[10,"StdHW","num",null],[11,"StdVW","num",null],[[12,12],"StemSnapH","delta",null],[[12,13],"StemSnapV","delta",null],[[12,14],"ForceBold","num",0],[[12,17],"LanguageGroup","num",0],[[12,18],"ExpansionFactor","num",.06],[[12,19],"initialRandomSeed","num",0],[20,"defaultWidthX","num",0],[21,"nominalWidthX","num",0],[19,"Subrs","offset",null]],aa=class _CFFPrivateDict extends ea{static get tables(){return shadow$1(this,"tables",this.createTables(na))}constructor(t){super(_CFFPrivateDict.tables,t),this.subrsIndex=null}},ra={ISO_ADOBE:0,EXPERT:1,EXPERT_SUBSET:2},oa=class{constructor(t,e,s,i){this.predefined=t,this.format=e,this.charset=s,this.raw=i}},la=class{constructor(t,e,s,i){this.predefined=t,this.format=e,this.encoding=s,this.raw=i}},ca=class{constructor(t,e){this.format=t,this.fdSelect=e}getFDIndex(t){return t<0||t>=this.fdSelect.length?-1:this.fdSelect[t]}},ha=class{constructor(){this.offsets=Object.create(null)}isTracking(t){return t in this.offsets}track(t,e){if(t in this.offsets)throw new Ze(`Already tracking location of ${t}`);this.offsets[t]=e}offset(t){for(const e in this.offsets)this.offsets[e]+=t}setEntryLocation(t,e,s){if(!(t in this.offsets))throw new Ze(`Not tracking location of ${t}`);const i=s.data,n=this.offsets[t];for(let t=0,s=e.length;t<s;++t){const s=5*t+n,a=s+1,r=s+2,o=s+3,l=s+4;if(29!==i[s]||0!==i[a]||0!==i[r]||0!==i[o]||0!==i[l])throw new Ze("writing to an offset that is not empty");const c=e[t];i[s]=29,i[a]=c>>24&255,i[r]=c>>16&255,i[o]=c>>8&255,i[l]=255&c}}},ua=class _CFFCompiler{constructor(t){this.cff=t}compile(){const t=this.cff,e={data:[],length:0,add(t){try{this.data.push(...t)}catch{this.data=this.data.concat(t)}this.length=this.data.length}},s=this.compileHeader(t.header);e.add(s);const i=this.compileNameIndex(t.names);if(e.add(i),t.isCIDFont&&t.topDict.hasName("FontMatrix")){const e=t.topDict.getByName("FontMatrix");t.topDict.removeByName("FontMatrix");for(const s of t.fdArray){let t=e.slice(0);s.hasName("FontMatrix")&&(t=ss.transform(t,s.getByName("FontMatrix"))),s.setByName("FontMatrix",t)}}const n=t.topDict.getByName("XUID");n?.length>16&&t.topDict.removeByName("XUID"),t.topDict.setByName("charset",0);let a=this.compileTopDicts([t.topDict],e.length,t.isCIDFont);e.add(a.output);const r=a.trackers[0],o=this.compileStringIndex(t.strings.strings);e.add(o);const l=this.compileIndex(t.globalSubrIndex);if(e.add(l),t.encoding&&t.topDict.hasName("Encoding"))if(t.encoding.predefined)r.setEntryLocation("Encoding",[t.encoding.format],e);else{const s=this.compileEncoding(t.encoding);r.setEntryLocation("Encoding",[e.length],e),e.add(s)}const c=this.compileCharset(t.charset,t.charStrings.count,t.strings,t.isCIDFont);r.setEntryLocation("charset",[e.length],e),e.add(c);const h=this.compileCharStrings(t.charStrings);if(r.setEntryLocation("CharStrings",[e.length],e),e.add(h),t.isCIDFont){r.setEntryLocation("FDSelect",[e.length],e);const s=this.compileFDSelect(t.fdSelect);e.add(s),a=this.compileTopDicts(t.fdArray,e.length,!0),r.setEntryLocation("FDArray",[e.length],e),e.add(a.output);const i=a.trackers;this.compilePrivateDicts(t.fdArray,i,e)}return this.compilePrivateDicts([t.topDict],[r],e),e.add([0]),e.data}encodeNumber(t){return Number.isInteger(t)?this.encodeInteger(t):this.encodeFloat(t)}static get EncodeFloatRegExp(){return shadow$1(this,"EncodeFloatRegExp",/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/)}encodeFloat(t){let e=t.toString();const s=_CFFCompiler.EncodeFloatRegExp.exec(e);if(s){const i=parseFloat("1e"+((s[2]?+s[2]:0)+s[1].length));e=(Math.round(t*i)/i).toString()}let i,n,a="";for(i=0,n=e.length;i<n;++i){const t=e[i];a+="e"===t?"-"===e[++i]?"c":"b":"."===t?"a":"-"===t?"e":t}a+=1&a.length?"f":"ff";const r=[30];for(i=0,n=a.length;i<n;i+=2)r.push(parseInt(a.substring(i,i+2),16));return r}encodeInteger(t){let e;return e=t>=-107&&t<=107?[t+139]:t>=108&&t<=1131?[247+((t-=108)>>8),255&t]:t>=-1131&&t<=-108?[251+((t=-t-108)>>8),255&t]:t>=-32768&&t<=32767?[28,t>>8&255,255&t]:[29,t>>24&255,t>>16&255,t>>8&255,255&t],e}compileHeader(t){return[t.major,t.minor,4,t.offSize]}compileNameIndex(t){const e=new ta;for(const s of t){const t=Math.min(s.length,127);let i=new Array(t);for(let e=0;e<t;e++){let t=s[e];(t<"!"||t>"~"||"["===t||"]"===t||"("===t||")"===t||"{"===t||"}"===t||"<"===t||">"===t||"/"===t||"%"===t)&&(t="_"),i[e]=t}i=i.join(""),""===i&&(i="Bad_Font_Name"),e.add(stringToBytes$1(i))}return this.compileIndex(e)}compileTopDicts(t,e,s){const i=[];let n=new ta;for(const a of t){s&&(a.removeByName("CIDFontVersion"),a.removeByName("CIDFontRevision"),a.removeByName("CIDFontType"),a.removeByName("CIDCount"),a.removeByName("UIDBase"));const t=new ha,r=this.compileDict(a,t);i.push(t),n.add(r),t.offset(e)}return n=this.compileIndex(n,i),{trackers:i,output:n}}compilePrivateDicts(t,e,s){for(let i=0,n=t.length;i<n;++i){const n=t[i],a=n.privateDict;if(!a||!n.hasName("Private"))throw new Ze("There must be a private dictionary.");const r=new ha,o=this.compileDict(a,r);let l=s.length;if(r.offset(l),o.length||(l=0),e[i].setEntryLocation("Private",[o.length,l],s),s.add(o),a.subrsIndex&&a.hasName("Subrs")){const t=this.compileIndex(a.subrsIndex);r.setEntryLocation("Subrs",[o.length],s),s.add(t)}}}compileDict(t,e){const s=[];for(const i of t.order){if(!(i in t.values))continue;let n=t.values[i],a=t.types[i];if(Array.isArray(a)||(a=[a]),Array.isArray(n)||(n=[n]),0!==n.length){for(let r=0,o=a.length;r<o;++r){const o=a[r],l=n[r];switch(o){case"num":case"sid":s.push(...this.encodeNumber(l));break;case"offset":const a=t.keyToNameMap[i];e.isTracking(a)||e.track(a,s.length),s.push(29,0,0,0,0);break;case"array":case"delta":s.push(...this.encodeNumber(l));for(let t=1,e=n.length;t<e;++t)s.push(...this.encodeNumber(n[t]));break;default:throw new Ze(`Unknown data type of ${o}`)}}s.push(...t.opcodes[i])}}return s}compileStringIndex(t){const e=new ta;for(const s of t)e.add(stringToBytes$1(s));return this.compileIndex(e)}compileCharStrings(t){const e=new ta;for(let s=0;s<t.count;s++){const i=t.get(s);0!==i.length?e.add(i):e.add(new Uint8Array([139,14]))}return this.compileIndex(e)}compileCharset(t,e,s,i){let n;const a=e-1;if(i){const t=a-1;n=new Uint8Array([2,0,1,t>>8&255,255&t])}else{n=new Uint8Array(1+2*a),n[0]=0;let e=0;const i=t.charset.length;let r=!1;for(let a=1;a<n.length;a+=2){let o=0;if(e<i){const i=t.charset[e++];o=s.getSID(i),-1===o&&(o=0,r||(r=!0,warn$1(`Couldn't find ${i} in CFF strings`)))}n[a]=o>>8&255,n[a+1]=255&o}}return this.compileTypedArray(n)}compileEncoding(t){return this.compileTypedArray(t.raw)}compileFDSelect(t){const e=t.format;let s,i;switch(e){case 0:for(s=new Uint8Array(1+t.fdSelect.length),s[0]=e,i=0;i<t.fdSelect.length;i++)s[i+1]=t.fdSelect[i];break;case 3:const n=0;let a=t.fdSelect[0];const r=[e,0,0,n>>8&255,255&n,a];for(i=1;i<t.fdSelect.length;i++){const e=t.fdSelect[i];e!==a&&(r.push(i>>8&255,255&i,e),a=e)}const o=(r.length-3)/3;r[1]=o>>8&255,r[2]=255&o,r.push(i>>8&255,255&i),s=new Uint8Array(r)}return this.compileTypedArray(s)}compileTypedArray(t){return Array.from(t)}compileIndex(t,e=[]){const s=t.objects,i=s.length;if(0===i)return[0,0];const n=[i>>8&255,255&i];let a,r,o=1;for(a=0;a<i;++a)o+=s[a].length;r=o<256?1:o<65536?2:o<16777216?3:4,n.push(r);let l=1;for(a=0;a<i+1;a++)1===r?n.push(255&l):2===r?n.push(l>>8&255,255&l):3===r?n.push(l>>16&255,l>>8&255,255&l):n.push(l>>>24&255,l>>16&255,l>>8&255,255&l),s[a]&&(l+=s[a].length);for(a=0;a<i;a++)e[a]&&e[a].offset(n.length),n.push(...s[a]);return n}},da=getLookupTableFactory(function(t){t["Times-Roman"]="Times-Roman",t.Helvetica="Helvetica",t.Courier="Courier",t.Symbol="Symbol",t["Times-Bold"]="Times-Bold",t["Helvetica-Bold"]="Helvetica-Bold",t["Courier-Bold"]="Courier-Bold",t.ZapfDingbats="ZapfDingbats",t["Times-Italic"]="Times-Italic",t["Helvetica-Oblique"]="Helvetica-Oblique",t["Courier-Oblique"]="Courier-Oblique",t["Times-BoldItalic"]="Times-BoldItalic",t["Helvetica-BoldOblique"]="Helvetica-BoldOblique",t["Courier-BoldOblique"]="Courier-BoldOblique",t.ArialNarrow="Helvetica",t["ArialNarrow-Bold"]="Helvetica-Bold",t["ArialNarrow-BoldItalic"]="Helvetica-BoldOblique",t["ArialNarrow-Italic"]="Helvetica-Oblique",t.ArialBlack="Helvetica",t["ArialBlack-Bold"]="Helvetica-Bold",t["ArialBlack-BoldItalic"]="Helvetica-BoldOblique",t["ArialBlack-Italic"]="Helvetica-Oblique",t["Arial-Black"]="Helvetica",t["Arial-Black-Bold"]="Helvetica-Bold",t["Arial-Black-BoldItalic"]="Helvetica-BoldOblique",t["Arial-Black-Italic"]="Helvetica-Oblique",t.Arial="Helvetica",t["Arial-Bold"]="Helvetica-Bold",t["Arial-BoldItalic"]="Helvetica-BoldOblique",t["Arial-Italic"]="Helvetica-Oblique",t.ArialMT="Helvetica",t["Arial-BoldItalicMT"]="Helvetica-BoldOblique",t["Arial-BoldMT"]="Helvetica-Bold",t["Arial-ItalicMT"]="Helvetica-Oblique",t["Arial-BoldItalicMT-BoldItalic"]="Helvetica-BoldOblique",t["Arial-BoldMT-Bold"]="Helvetica-Bold",t["Arial-ItalicMT-Italic"]="Helvetica-Oblique",t.ArialUnicodeMS="Helvetica",t["ArialUnicodeMS-Bold"]="Helvetica-Bold",t["ArialUnicodeMS-BoldItalic"]="Helvetica-BoldOblique",t["ArialUnicodeMS-Italic"]="Helvetica-Oblique",t["Courier-BoldItalic"]="Courier-BoldOblique",t["Courier-Italic"]="Courier-Oblique",t.CourierNew="Courier",t["CourierNew-Bold"]="Courier-Bold",t["CourierNew-BoldItalic"]="Courier-BoldOblique",t["CourierNew-Italic"]="Courier-Oblique",t["CourierNewPS-BoldItalicMT"]="Courier-BoldOblique",t["CourierNewPS-BoldMT"]="Courier-Bold",t["CourierNewPS-ItalicMT"]="Courier-Oblique",t.CourierNewPSMT="Courier",t["Helvetica-BoldItalic"]="Helvetica-BoldOblique",t["Helvetica-Italic"]="Helvetica-Oblique",t["HelveticaLTStd-Bold"]="Helvetica-Bold",t["Symbol-Bold"]="Symbol",t["Symbol-BoldItalic"]="Symbol",t["Symbol-Italic"]="Symbol",t.TimesNewRoman="Times-Roman",t["TimesNewRoman-Bold"]="Times-Bold",t["TimesNewRoman-BoldItalic"]="Times-BoldItalic",t["TimesNewRoman-Italic"]="Times-Italic",t.TimesNewRomanPS="Times-Roman",t["TimesNewRomanPS-Bold"]="Times-Bold",t["TimesNewRomanPS-BoldItalic"]="Times-BoldItalic",t["TimesNewRomanPS-BoldItalicMT"]="Times-BoldItalic",t["TimesNewRomanPS-BoldMT"]="Times-Bold",t["TimesNewRomanPS-Italic"]="Times-Italic",t["TimesNewRomanPS-ItalicMT"]="Times-Italic",t.TimesNewRomanPSMT="Times-Roman",t["TimesNewRomanPSMT-Bold"]="Times-Bold",t["TimesNewRomanPSMT-BoldItalic"]="Times-BoldItalic",t["TimesNewRomanPSMT-Italic"]="Times-Italic"}),fa=getLookupTableFactory(function(t){t.Courier="FoxitFixed.pfb",t["Courier-Bold"]="FoxitFixedBold.pfb",t["Courier-BoldOblique"]="FoxitFixedBoldItalic.pfb",t["Courier-Oblique"]="FoxitFixedItalic.pfb",t.Helvetica="LiberationSans-Regular.ttf",t["Helvetica-Bold"]="LiberationSans-Bold.ttf",t["Helvetica-BoldOblique"]="LiberationSans-BoldItalic.ttf",t["Helvetica-Oblique"]="LiberationSans-Italic.ttf",t["Times-Roman"]="FoxitSerif.pfb",t["Times-Bold"]="FoxitSerifBold.pfb",t["Times-BoldItalic"]="FoxitSerifBoldItalic.pfb",t["Times-Italic"]="FoxitSerifItalic.pfb",t.Symbol="FoxitSymbol.pfb",t.ZapfDingbats="FoxitDingbats.pfb",t["LiberationSans-Regular"]="LiberationSans-Regular.ttf",t["LiberationSans-Bold"]="LiberationSans-Bold.ttf",t["LiberationSans-Italic"]="LiberationSans-Italic.ttf",t["LiberationSans-BoldItalic"]="LiberationSans-BoldItalic.ttf"}),ga=getLookupTableFactory(function(t){t.Calibri="Helvetica",t["Calibri-Bold"]="Helvetica-Bold",t["Calibri-BoldItalic"]="Helvetica-BoldOblique",t["Calibri-Italic"]="Helvetica-Oblique",t.CenturyGothic="Helvetica",t["CenturyGothic-Bold"]="Helvetica-Bold",t["CenturyGothic-BoldItalic"]="Helvetica-BoldOblique",t["CenturyGothic-Italic"]="Helvetica-Oblique",t.ComicSansMS="Comic Sans MS",t["ComicSansMS-Bold"]="Comic Sans MS-Bold",t["ComicSansMS-BoldItalic"]="Comic Sans MS-BoldItalic",t["ComicSansMS-Italic"]="Comic Sans MS-Italic",t.GillSansMT="Helvetica",t["GillSansMT-Bold"]="Helvetica-Bold",t["GillSansMT-BoldItalic"]="Helvetica-BoldOblique",t["GillSansMT-Italic"]="Helvetica-Oblique",t.Impact="Helvetica",t["ItcSymbol-Bold"]="Helvetica-Bold",t["ItcSymbol-BoldItalic"]="Helvetica-BoldOblique",t["ItcSymbol-Book"]="Helvetica",t["ItcSymbol-BookItalic"]="Helvetica-Oblique",t["ItcSymbol-Medium"]="Helvetica",t["ItcSymbol-MediumItalic"]="Helvetica-Oblique",t.LucidaConsole="Courier",t["LucidaConsole-Bold"]="Courier-Bold",t["LucidaConsole-BoldItalic"]="Courier-BoldOblique",t["LucidaConsole-Italic"]="Courier-Oblique",t["LucidaSans-Demi"]="Helvetica-Bold",t["MS-Gothic"]="MS Gothic",t["MS-Gothic-Bold"]="MS Gothic-Bold",t["MS-Gothic-BoldItalic"]="MS Gothic-BoldItalic",t["MS-Gothic-Italic"]="MS Gothic-Italic",t["MS-Mincho"]="MS Mincho",t["MS-Mincho-Bold"]="MS Mincho-Bold",t["MS-Mincho-BoldItalic"]="MS Mincho-BoldItalic",t["MS-Mincho-Italic"]="MS Mincho-Italic",t["MS-PGothic"]="MS PGothic",t["MS-PGothic-Bold"]="MS PGothic-Bold",t["MS-PGothic-BoldItalic"]="MS PGothic-BoldItalic",t["MS-PGothic-Italic"]="MS PGothic-Italic",t["MS-PMincho"]="MS PMincho",t["MS-PMincho-Bold"]="MS PMincho-Bold",t["MS-PMincho-BoldItalic"]="MS PMincho-BoldItalic",t["MS-PMincho-Italic"]="MS PMincho-Italic",t.NuptialScript="Times-Italic",t.SegoeUISymbol="Helvetica"}),pa=getLookupTableFactory(function(t){t["Adobe Jenson"]=!0,t["Adobe Text"]=!0,t.Albertus=!0,t.Aldus=!0,t.Alexandria=!0,t.Algerian=!0,t["American Typewriter"]=!0,t.Antiqua=!0,t.Apex=!0,t.Arno=!0,t.Aster=!0,t.Aurora=!0,t.Baskerville=!0,t.Bell=!0,t.Bembo=!0,t["Bembo Schoolbook"]=!0,t.Benguiat=!0,t["Berkeley Old Style"]=!0,t["Bernhard Modern"]=!0,t["Berthold City"]=!0,t.Bodoni=!0,t["Bauer Bodoni"]=!0,t["Book Antiqua"]=!0,t.Bookman=!0,t["Bordeaux Roman"]=!0,t["Californian FB"]=!0,t.Calisto=!0,t.Calvert=!0,t.Capitals=!0,t.Cambria=!0,t.Cartier=!0,t.Caslon=!0,t.Catull=!0,t.Centaur=!0,t["Century Old Style"]=!0,t["Century Schoolbook"]=!0,t.Chaparral=!0,t["Charis SIL"]=!0,t.Cheltenham=!0,t["Cholla Slab"]=!0,t.Clarendon=!0,t.Clearface=!0,t.Cochin=!0,t.Colonna=!0,t["Computer Modern"]=!0,t["Concrete Roman"]=!0,t.Constantia=!0,t["Cooper Black"]=!0,t.Corona=!0,t.Ecotype=!0,t.Egyptienne=!0,t.Elephant=!0,t.Excelsior=!0,t.Fairfield=!0,t["FF Scala"]=!0,t.Folkard=!0,t.Footlight=!0,t.FreeSerif=!0,t["Friz Quadrata"]=!0,t.Garamond=!0,t.Gentium=!0,t.Georgia=!0,t.Gloucester=!0,t["Goudy Old Style"]=!0,t["Goudy Schoolbook"]=!0,t["Goudy Pro Font"]=!0,t.Granjon=!0,t["Guardian Egyptian"]=!0,t.Heather=!0,t.Hercules=!0,t["High Tower Text"]=!0,t.Hiroshige=!0,t["Hoefler Text"]=!0,t["Humana Serif"]=!0,t.Imprint=!0,t["Ionic No. 5"]=!0,t.Janson=!0,t.Joanna=!0,t.Korinna=!0,t.Lexicon=!0,t.LiberationSerif=!0,t["Liberation Serif"]=!0,t["Linux Libertine"]=!0,t.Literaturnaya=!0,t.Lucida=!0,t["Lucida Bright"]=!0,t.Melior=!0,t.Memphis=!0,t.Miller=!0,t.Minion=!0,t.Modern=!0,t["Mona Lisa"]=!0,t["Mrs Eaves"]=!0,t["MS Serif"]=!0,t["Museo Slab"]=!0,t["New York"]=!0,t["Nimbus Roman"]=!0,t["NPS Rawlinson Roadway"]=!0,t.NuptialScript=!0,t.Palatino=!0,t.Perpetua=!0,t.Plantin=!0,t["Plantin Schoolbook"]=!0,t.Playbill=!0,t["Poor Richard"]=!0,t["Rawlinson Roadway"]=!0,t.Renault=!0,t.Requiem=!0,t.Rockwell=!0,t.Roman=!0,t["Rotis Serif"]=!0,t.Sabon=!0,t.Scala=!0,t.Seagull=!0,t.Sistina=!0,t.Souvenir=!0,t.STIX=!0,t["Stone Informal"]=!0,t["Stone Serif"]=!0,t.Sylfaen=!0,t.Times=!0,t.Trajan=!0,t["Trinité"]=!0,t["Trump Mediaeval"]=!0,t.Utopia=!0,t["Vale Type"]=!0,t["Bitstream Vera"]=!0,t["Vera Serif"]=!0,t.Versailles=!0,t.Wanted=!0,t.Weiss=!0,t["Wide Latin"]=!0,t.Windsor=!0,t.XITS=!0}),ma=getLookupTableFactory(function(t){t.Dingbats=!0,t.Symbol=!0,t.ZapfDingbats=!0,t.Wingdings=!0,t["Wingdings-Bold"]=!0,t["Wingdings-Regular"]=!0}),ba=getLookupTableFactory(function(t){t[2]=10,t[3]=32,t[4]=33,t[5]=34,t[6]=35,t[7]=36,t[8]=37,t[9]=38,t[10]=39,t[11]=40,t[12]=41,t[13]=42,t[14]=43,t[15]=44,t[16]=45,t[17]=46,t[18]=47,t[19]=48,t[20]=49,t[21]=50,t[22]=51,t[23]=52,t[24]=53,t[25]=54,t[26]=55,t[27]=56,t[28]=57,t[29]=58,t[30]=894,t[31]=60,t[32]=61,t[33]=62,t[34]=63,t[35]=64,t[36]=65,t[37]=66,t[38]=67,t[39]=68,t[40]=69,t[41]=70,t[42]=71,t[43]=72,t[44]=73,t[45]=74,t[46]=75,t[47]=76,t[48]=77,t[49]=78,t[50]=79,t[51]=80,t[52]=81,t[53]=82,t[54]=83,t[55]=84,t[56]=85,t[57]=86,t[58]=87,t[59]=88,t[60]=89,t[61]=90,t[62]=91,t[63]=92,t[64]=93,t[65]=94,t[66]=95,t[67]=96,t[68]=97,t[69]=98,t[70]=99,t[71]=100,t[72]=101,t[73]=102,t[74]=103,t[75]=104,t[76]=105,t[77]=106,t[78]=107,t[79]=108,t[80]=109,t[81]=110,t[82]=111,t[83]=112,t[84]=113,t[85]=114,t[86]=115,t[87]=116,t[88]=117,t[89]=118,t[90]=119,t[91]=120,t[92]=121,t[93]=122,t[94]=123,t[95]=124,t[96]=125,t[97]=126,t[98]=196,t[99]=197,t[100]=199,t[101]=201,t[102]=209,t[103]=214,t[104]=220,t[105]=225,t[106]=224,t[107]=226,t[108]=228,t[109]=227,t[110]=229,t[111]=231,t[112]=233,t[113]=232,t[114]=234,t[115]=235,t[116]=237,t[117]=236,t[118]=238,t[119]=239,t[120]=241,t[121]=243,t[122]=242,t[123]=244,t[124]=246,t[125]=245,t[126]=250,t[127]=249,t[128]=251,t[129]=252,t[130]=8224,t[131]=176,t[132]=162,t[133]=163,t[134]=167,t[135]=8226,t[136]=182,t[137]=223,t[138]=174,t[139]=169,t[140]=8482,t[141]=180,t[142]=168,t[143]=8800,t[144]=198,t[145]=216,t[146]=8734,t[147]=177,t[148]=8804,t[149]=8805,t[150]=165,t[151]=181,t[152]=8706,t[153]=8721,t[154]=8719,t[156]=8747,t[157]=170,t[158]=186,t[159]=8486,t[160]=230,t[161]=248,t[162]=191,t[163]=161,t[164]=172,t[165]=8730,t[166]=402,t[167]=8776,t[168]=8710,t[169]=171,t[170]=187,t[171]=8230,t[179]=8220,t[180]=8221,t[181]=8216,t[182]=8217,t[200]=193,t[203]=205,t[207]=211,t[210]=218,t[223]=711,t[224]=321,t[225]=322,t[226]=352,t[227]=353,t[228]=381,t[229]=382,t[233]=221,t[234]=253,t[252]=263,t[253]=268,t[254]=269,t[258]=258,t[260]=260,t[261]=261,t[265]=280,t[266]=281,t[267]=282,t[268]=283,t[269]=313,t[275]=323,t[276]=324,t[278]=328,t[283]=344,t[284]=345,t[285]=346,t[286]=347,t[292]=367,t[295]=377,t[296]=378,t[298]=380,t[305]=963,t[306]=964,t[307]=966,t[308]=8215,t[309]=8252,t[310]=8319,t[311]=8359,t[312]=8592,t[313]=8593,t[337]=9552,t[493]=1039,t[494]=1040,t[570]=1040,t[571]=1041,t[572]=1042,t[573]=1043,t[574]=1044,t[575]=1045,t[576]=1046,t[577]=1047,t[578]=1048,t[579]=1049,t[580]=1050,t[581]=1051,t[582]=1052,t[583]=1053,t[584]=1054,t[585]=1055,t[586]=1056,t[587]=1057,t[588]=1058,t[589]=1059,t[590]=1060,t[591]=1061,t[592]=1062,t[593]=1063,t[594]=1064,t[595]=1065,t[596]=1066,t[597]=1067,t[598]=1068,t[599]=1069,t[600]=1070,t[672]=1488,t[673]=1489,t[674]=1490,t[675]=1491,t[676]=1492,t[677]=1493,t[678]=1494,t[679]=1495,t[680]=1496,t[681]=1497,t[682]=1498,t[683]=1499,t[684]=1500,t[685]=1501,t[686]=1502,t[687]=1503,t[688]=1504,t[689]=1505,t[690]=1506,t[691]=1507,t[692]=1508,t[693]=1509,t[694]=1510,t[695]=1511,t[696]=1512,t[697]=1513,t[698]=1514,t[705]=1524,t[706]=8362,t[710]=64288,t[711]=64298,t[759]=1617,t[761]=1776,t[763]=1778,t[775]=1652,t[777]=1764,t[778]=1780,t[779]=1781,t[780]=1782,t[782]=771,t[783]=64726,t[786]=8363,t[788]=8532,t[790]=768,t[791]=769,t[792]=768,t[795]=803,t[797]=64336,t[798]=64337,t[799]=64342,t[800]=64343,t[801]=64344,t[802]=64345,t[803]=64362,t[804]=64363,t[805]=64364,t[2424]=7821,t[2425]=7822,t[2426]=7823,t[2427]=7824,t[2428]=7825,t[2429]=7826,t[2430]=7827,t[2433]=7682,t[2678]=8045,t[2679]=8046,t[2830]=1552,t[2838]=686,t[2840]=751,t[2842]=753,t[2843]=754,t[2844]=755,t[2846]=757,t[2856]=767,t[2857]=848,t[2858]=849,t[2862]=853,t[2863]=854,t[2864]=855,t[2865]=861,t[2866]=862,t[2906]=7460,t[2908]=7462,t[2909]=7463,t[2910]=7464,t[2912]=7466,t[2913]=7467,t[2914]=7468,t[2916]=7470,t[2917]=7471,t[2918]=7472,t[2920]=7474,t[2921]=7475,t[2922]=7476,t[2924]=7478,t[2925]=7479,t[2926]=7480,t[2928]=7482,t[2929]=7483,t[2930]=7484,t[2932]=7486,t[2933]=7487,t[2934]=7488,t[2936]=7490,t[2937]=7491,t[2938]=7492,t[2940]=7494,t[2941]=7495,t[2942]=7496,t[2944]=7498,t[2946]=7500,t[2948]=7502,t[2950]=7504,t[2951]=7505,t[2952]=7506,t[2954]=7508,t[2955]=7509,t[2956]=7510,t[2958]=7512,t[2959]=7513,t[2960]=7514,t[2962]=7516,t[2963]=7517,t[2964]=7518,t[2966]=7520,t[2967]=7521,t[2968]=7522,t[2970]=7524,t[2971]=7525,t[2972]=7526,t[2974]=7528,t[2975]=7529,t[2976]=7530,t[2978]=1537,t[2979]=1538,t[2980]=1539,t[2982]=1549,t[2983]=1551,t[2984]=1552,t[2986]=1554,t[2987]=1555,t[2988]=1556,t[2990]=1623,t[2991]=1624,t[2995]=1775,t[2999]=1791,t[3002]=64290,t[3003]=64291,t[3004]=64292,t[3006]=64294,t[3007]=64295,t[3008]=64296,t[3011]=1900,t[3014]=8223,t[3015]=8244,t[3017]=7532,t[3018]=7533,t[3019]=7534,t[3075]=7590,t[3076]=7591,t[3079]=7594,t[3080]=7595,t[3083]=7598,t[3084]=7599,t[3087]=7602,t[3088]=7603,t[3091]=7606,t[3092]=7607,t[3095]=7610,t[3096]=7611,t[3099]=7614,t[3100]=7615,t[3103]=7618,t[3104]=7619,t[3107]=8337,t[3108]=8338,t[3116]=1884,t[3119]=1885,t[3120]=1885,t[3123]=1886,t[3124]=1886,t[3127]=1887,t[3128]=1887,t[3131]=1888,t[3132]=1888,t[3135]=1889,t[3136]=1889,t[3139]=1890,t[3140]=1890,t[3143]=1891,t[3144]=1891,t[3147]=1892,t[3148]=1892,t[3153]=580,t[3154]=581,t[3157]=584,t[3158]=585,t[3161]=588,t[3162]=589,t[3165]=891,t[3166]=892,t[3169]=1274,t[3170]=1275,t[3173]=1278,t[3174]=1279,t[3181]=7622,t[3182]=7623,t[3282]=11799,t[3316]=578,t[3379]=42785,t[3393]=1159,t[3416]=8377}),wa=getLookupTableFactory(function(t){t[227]=322,t[264]=261,t[291]=346}),ya=getLookupTableFactory(function(t){t[1]=32,t[4]=65,t[5]=192,t[6]=193,t[9]=196,t[17]=66,t[18]=67,t[21]=268,t[24]=68,t[28]=69,t[29]=200,t[30]=201,t[32]=282,t[38]=70,t[39]=71,t[44]=72,t[47]=73,t[48]=204,t[49]=205,t[58]=74,t[60]=75,t[62]=76,t[68]=77,t[69]=78,t[75]=79,t[76]=210,t[80]=214,t[87]=80,t[89]=81,t[90]=82,t[92]=344,t[94]=83,t[97]=352,t[100]=84,t[104]=85,t[109]=220,t[115]=86,t[116]=87,t[121]=88,t[122]=89,t[124]=221,t[127]=90,t[129]=381,t[258]=97,t[259]=224,t[260]=225,t[263]=228,t[268]=261,t[271]=98,t[272]=99,t[273]=263,t[275]=269,t[282]=100,t[286]=101,t[287]=232,t[288]=233,t[290]=283,t[295]=281,t[296]=102,t[336]=103,t[346]=104,t[349]=105,t[350]=236,t[351]=237,t[361]=106,t[364]=107,t[367]=108,t[371]=322,t[373]=109,t[374]=110,t[381]=111,t[382]=242,t[383]=243,t[386]=246,t[393]=112,t[395]=113,t[396]=114,t[398]=345,t[400]=115,t[401]=347,t[403]=353,t[410]=116,t[437]=117,t[442]=252,t[448]=118,t[449]=119,t[454]=120,t[455]=121,t[457]=253,t[460]=122,t[462]=382,t[463]=380,t[853]=44,t[855]=58,t[856]=46,t[876]=47,t[878]=45,t[882]=45,t[894]=40,t[895]=41,t[896]=91,t[897]=93,t[923]=64,t[940]=163,t[1004]=48,t[1005]=49,t[1006]=50,t[1007]=51,t[1008]=52,t[1009]=53,t[1010]=54,t[1011]=55,t[1012]=56,t[1013]=57,t[1081]=37,t[1085]=43,t[1086]=45});function getStandardFontName(t){const e=normalizeFontName(t);return da()[e]}function isKnownFontName(t){const e=normalizeFontName(t);return!!(da()[e]||ga()[e]||pa()[e]||ma()[e])}var xa=class{constructor(t=[]){this._map=t}get length(){return this._map.length}forEach(t){for(const e in this._map)t(e,this._map[e].codePointAt(0))}has(t){return void 0!==this._map[t]}get(t){return this._map[t]}charCodeOf(t){const e=this._map;if(e.length<=65536)return e.indexOf(t);for(const s in e)if(e[s]===t)return 0|s;return-1}amend(t){for(const e in t)this._map[e]=t[e]}},va=class{constructor(t,e){this.firstChar=t,this.lastChar=e}get length(){return this.lastChar+1-this.firstChar}forEach(t){for(let e=this.firstChar,s=this.lastChar;e<=s;e++)t(e,e)}has(t){return this.firstChar<=t&&t<=this.lastChar}get(t){if(this.firstChar<=t&&t<=this.lastChar)return String.fromCharCode(t)}charCodeOf(t){return Number.isInteger(t)&&t>=this.firstChar&&t<=this.lastChar?t:-1}amend(t){unreachable$1("Should not call amend()")}},Aa=class{constructor(t,e){this.properties=e;const s=new Yn(t,e,Nn);this.cff=s.parse(),this.cff.duplicateFirstGlyph();const i=new ua(this.cff);this.seacs=this.cff.seacs;try{this.data=i.compile()}catch{warn$1("Failed to compile font "+e.loadedName),this.data=t}this._createBuiltInEncoding()}get numGlyphs(){return this.cff.charStrings.count}getCharset(){return this.cff.charset.charset}getGlyphMapping(){const t=this.cff,e=this.properties,{cidToGidMap:s,cMap:i}=e,n=t.charset.charset;let a,r;if(e.composite){let e,o;if(s?.length>0){e=Object.create(null);for(let t=0,i=s.length;t<i;t++){const i=s[t];void 0!==i&&(e[i]=t)}}if(a=Object.create(null),t.isCIDFont)for(r=0;r<n.length;r++){const t=n[r];o=i.charCodeOf(t),void 0!==e?.[o]&&(o=e[o]),a[o]=r}else for(r=0;r<t.charStrings.count;r++)o=i.charCodeOf(r),a[o]=r;return a}let o=t.encoding?t.encoding.encoding:null;return e.isInternalFont&&(o=e.defaultEncoding),a=type1FontGlyphMapping(e,o,n),a}hasGlyphId(t){return this.cff.hasGlyphId(t)}_createBuiltInEncoding(){const{charset:t,encoding:e}=this.cff;if(!t||!e)return;const s=t.charset,i=e.encoding,n=[];for(const t in i){const e=i[t];if(e>=0){const i=s[e];i&&(n[t]=i)}}n.length>0&&(this.properties.builtInEncoding=n)}};function getFloat214(t,e){return readInt16(t,e)/16384}function getSubroutineBias(t){const e=t.length;let s=32768;return e<1240?s=107:e<33900&&(s=1131),s}function parseCmap(t,e,s){const i=1===readUint16(t,e+2)?readUint32(t,e+8):readUint32(t,e+16),n=readUint16(t,e+i);let a,r,o;if(4===n){readUint16(t,e+i+2);const s=readUint16(t,e+i+6)>>1;for(r=e+i+14,a=[],o=0;o<s;o++,r+=2)a[o]={end:readUint16(t,r)};for(r+=2,o=0;o<s;o++,r+=2)a[o].start=readUint16(t,r);for(o=0;o<s;o++,r+=2)a[o].idDelta=readUint16(t,r);for(o=0;o<s;o++,r+=2){let e=readUint16(t,r);if(0!==e){a[o].ids=[];for(let s=0,i=a[o].end-a[o].start+1;s<i;s++)a[o].ids[s]=readUint16(t,r+e),e+=2}}return a}if(12===n){const s=readUint32(t,e+i+12);for(r=e+i+16,a=[],o=0;o<s;o++)e=readUint32(t,r),a.push({start:e,end:readUint32(t,r+4),idDelta:readUint32(t,r+8)-e}),r+=12;return a}throw new Ze(`unsupported cmap: ${n}`)}function parseCff(t,e,s,i){const n=new Yn(new Ks(t,e,s-e),{},i).parse();return{glyphs:n.charStrings.objects,subrs:n.topDict.privateDict?.subrsIndex?.objects,gsubrs:n.globalSubrIndex?.objects,isCFFCIDFont:n.isCIDFont,fdSelect:n.fdSelect,fdArray:n.fdArray}}function lookupCmap(t,e){const s=e.codePointAt(0);let i=0,n=0,a=t.length-1;for(;n<a;){const e=n+a+1>>1;s<t[e].start?a=e-1:n=e}return t[n].start<=s&&s<=t[n].end&&(i=t[n].idDelta+(t[n].ids?t[n].ids[s-t[n].start]:s)&65535),{charCode:s,glyphId:i}}function compileGlyf(t,e,s){function moveTo(t,s){r&&e.add("L",r),r=[t,s],e.add("M",[t,s])}function lineTo(t,s){e.add("L",[t,s])}function quadraticCurveTo(t,s,i,n){e.add("Q",[t,s,i,n])}let i=0;const n=readInt16(t,i);let a,r=null,o=0,l=0;if(i+=10,n<0)do{a=readUint16(t,i);const n=readUint16(t,i+2);let r,c;i+=4,1&a?(2&a?(r=readInt16(t,i),c=readInt16(t,i+2)):(r=readUint16(t,i),c=readUint16(t,i+2)),i+=4):2&a?(r=readInt8(t,i++),c=readInt8(t,i++)):(r=t[i++],c=t[i++]),2&a?(o=r,l=c):(o=0,l=0);let h=1,u=1,d=0,f=0;8&a?(h=u=getFloat214(t,i),i+=2):64&a?(h=getFloat214(t,i),u=getFloat214(t,i+2),i+=4):128&a&&(h=getFloat214(t,i),d=getFloat214(t,i+2),f=getFloat214(t,i+4),u=getFloat214(t,i+6),i+=8);const g=s.glyphs[n];g&&(e.save(),e.transform([h,d,f,u,o,l]),compileGlyf(g,e,s),e.restore())}while(32&a);else{const e=[];let s,r;for(s=0;s<n;s++)e.push(readUint16(t,i)),i+=2;i+=2+readUint16(t,i);const c=e.at(-1)+1,h=[];for(;h.length<c;){a=t[i++];let e=1;for(8&a&&(e+=t[i++]);e-- >0;)h.push({flags:a})}for(s=0;s<c;s++){switch(18&h[s].flags){case 0:o+=readInt16(t,i),i+=2;break;case 2:o-=t[i++];break;case 18:o+=t[i++]}h[s].x=o}for(s=0;s<c;s++){switch(36&h[s].flags){case 0:l+=readInt16(t,i),i+=2;break;case 4:l-=t[i++];break;case 36:l+=t[i++]}h[s].y=l}let u=0;for(i=0;i<n;i++){const t=e[i],n=h.slice(u,t+1);if(1&n[0].flags)n.push(n[0]);else if(1&n.at(-1).flags)n.unshift(n.at(-1));else{const t={flags:1,x:(n[0].x+n.at(-1).x)/2,y:(n[0].y+n.at(-1).y)/2};n.unshift(t),n.push(t)}for(moveTo(n[0].x,n[0].y),s=1,r=n.length;s<r;s++)1&n[s].flags?lineTo(n[s].x,n[s].y):1&n[s+1].flags?(quadraticCurveTo(n[s].x,n[s].y,n[s+1].x,n[s+1].y),s++):quadraticCurveTo(n[s].x,n[s].y,(n[s].x+n[s+1].x)/2,(n[s].y+n[s+1].y)/2);u=t+1}}}function compileCharString(t,e,s,i){function moveTo(t,s){l&&e.add("L",l),l=[t,s],e.add("M",[t,s])}function lineTo(t,s){e.add("L",[t,s])}function bezierCurveTo(t,s,i,n,a,r){e.add("C",[t,s,i,n,a,r])}const n=[];let a=0,r=0,o=0,l=null;!function parse(t){let l=0;for(;l<t.length;){let c,h,u,d,f,g,p,m,b,w=!1,y=t[l++];switch(y){case 1:case 3:case 18:case 23:o+=n.length>>1,w=!0;break;case 4:r+=n.pop(),moveTo(a,r),w=!0;break;case 5:for(;n.length>0;)a+=n.shift(),r+=n.shift(),lineTo(a,r);break;case 6:for(;n.length>0&&(a+=n.shift(),lineTo(a,r),0!==n.length);)r+=n.shift(),lineTo(a,r);break;case 7:for(;n.length>0&&(r+=n.shift(),lineTo(a,r),0!==n.length);)a+=n.shift(),lineTo(a,r);break;case 8:for(;n.length>0;)c=a+n.shift(),u=r+n.shift(),h=c+n.shift(),d=u+n.shift(),a=h+n.shift(),r=d+n.shift(),bezierCurveTo(c,u,h,d,a,r);break;case 10:if(m=n.pop(),b=null,s.isCFFCIDFont){const t=s.fdSelect.getFDIndex(i);if(t>=0&&t<s.fdArray.length){const e=s.fdArray[t];let i;e.privateDict?.subrsIndex&&(i=e.privateDict.subrsIndex.objects),i&&(m+=getSubroutineBias(i),b=i[m])}else warn$1("Invalid fd index for glyph index.")}else b=s.subrs[m+s.subrsBias];b&&parse(b);break;case 11:return;case 12:switch(y=t[l++],y){case 34:c=a+n.shift(),h=c+n.shift(),f=r+n.shift(),a=h+n.shift(),bezierCurveTo(c,r,h,f,a,f),c=a+n.shift(),h=c+n.shift(),a=h+n.shift(),bezierCurveTo(c,f,h,r,a,r);break;case 35:c=a+n.shift(),u=r+n.shift(),h=c+n.shift(),d=u+n.shift(),a=h+n.shift(),r=d+n.shift(),bezierCurveTo(c,u,h,d,a,r),c=a+n.shift(),u=r+n.shift(),h=c+n.shift(),d=u+n.shift(),a=h+n.shift(),r=d+n.shift(),bezierCurveTo(c,u,h,d,a,r),n.pop();break;case 36:c=a+n.shift(),f=r+n.shift(),h=c+n.shift(),g=f+n.shift(),a=h+n.shift(),bezierCurveTo(c,f,h,g,a,g),c=a+n.shift(),h=c+n.shift(),p=g+n.shift(),a=h+n.shift(),bezierCurveTo(c,g,h,p,a,r);break;case 37:const t=a,e=r;c=a+n.shift(),u=r+n.shift(),h=c+n.shift(),d=u+n.shift(),a=h+n.shift(),r=d+n.shift(),bezierCurveTo(c,u,h,d,a,r),c=a+n.shift(),u=r+n.shift(),h=c+n.shift(),d=u+n.shift(),a=h,r=d,Math.abs(a-t)>Math.abs(r-e)?a+=n.shift():r+=n.shift(),bezierCurveTo(c,u,h,d,a,r);break;default:throw new Ze(`unknown operator: 12 ${y}`)}break;case 14:if(n.length>=4){const t=n.pop(),i=n.pop();r=n.pop(),a=n.pop(),e.save(),e.translate(a,r);let o=lookupCmap(s.cmap,String.fromCharCode(s.glyphNameMap[_n[t]]));compileCharString(s.glyphs[o.glyphId],e,s,o.glyphId),e.restore(),o=lookupCmap(s.cmap,String.fromCharCode(s.glyphNameMap[_n[i]])),compileCharString(s.glyphs[o.glyphId],e,s,o.glyphId)}return;case 19:case 20:o+=n.length>>1,l+=o+7>>3,w=!0;break;case 21:r+=n.pop(),a+=n.pop(),moveTo(a,r),w=!0;break;case 22:a+=n.pop(),moveTo(a,r),w=!0;break;case 24:for(;n.length>2;)c=a+n.shift(),u=r+n.shift(),h=c+n.shift(),d=u+n.shift(),a=h+n.shift(),r=d+n.shift(),bezierCurveTo(c,u,h,d,a,r);a+=n.shift(),r+=n.shift(),lineTo(a,r);break;case 25:for(;n.length>6;)a+=n.shift(),r+=n.shift(),lineTo(a,r);c=a+n.shift(),u=r+n.shift(),h=c+n.shift(),d=u+n.shift(),a=h+n.shift(),r=d+n.shift(),bezierCurveTo(c,u,h,d,a,r);break;case 26:for(n.length%2&&(a+=n.shift());n.length>0;)c=a,u=r+n.shift(),h=c+n.shift(),d=u+n.shift(),a=h,r=d+n.shift(),bezierCurveTo(c,u,h,d,a,r);break;case 27:for(n.length%2&&(r+=n.shift());n.length>0;)c=a+n.shift(),u=r,h=c+n.shift(),d=u+n.shift(),a=h+n.shift(),r=d,bezierCurveTo(c,u,h,d,a,r);break;case 28:n.push(readInt16(t,l)),l+=2;break;case 29:m=n.pop()+s.gsubrsBias,b=s.gsubrs[m],b&&parse(b);break;case 30:for(;n.length>0&&(c=a,u=r+n.shift(),h=c+n.shift(),d=u+n.shift(),a=h+n.shift(),r=d+(1===n.length?n.shift():0),bezierCurveTo(c,u,h,d,a,r),0!==n.length);)c=a+n.shift(),u=r,h=c+n.shift(),d=u+n.shift(),r=d+n.shift(),a=h+(1===n.length?n.shift():0),bezierCurveTo(c,u,h,d,a,r);break;case 31:for(;n.length>0&&(c=a+n.shift(),u=r,h=c+n.shift(),d=u+n.shift(),r=d+n.shift(),a=h+(1===n.length?n.shift():0),bezierCurveTo(c,u,h,d,a,r),0!==n.length);)c=a,u=r+n.shift(),h=c+n.shift(),d=u+n.shift(),a=h+n.shift(),r=d+(1===n.length?n.shift():0),bezierCurveTo(c,u,h,d,a,r);break;default:if(y<32)throw new Ze(`unknown operator: ${y}`);y<247?n.push(y-139):y<251?n.push(256*(y-247)+t[l++]+108):y<255?n.push(256*-(y-251)-t[l++]-108):(n.push((t[l]<<24|t[l+1]<<16|t[l+2]<<8|t[l+3])/65536),l+=4)}w&&(n.length=0)}}(t)}var ka=class{cmds=[];transformStack=[];currentTransform=[1,0,0,1,0,0];add(t,e){if(e){const{currentTransform:s}=this;for(let t=0,i=e.length;t<i;t+=2)ss.applyTransform(e,s,t);this.cmds.push(`${t}${e.join(" ")}`)}else this.cmds.push(t)}transform(t){this.currentTransform=ss.transform(this.currentTransform,t)}translate(t,e){this.transform([1,0,0,1,t,e])}save(){this.transformStack.push(this.currentTransform.slice())}restore(){this.currentTransform=this.transformStack.pop()||[1,0,0,1,0,0]}getSVG(){return this.cmds.join("")}},Sa=class{constructor(t){this.fontMatrix=t,this.compiledGlyphs=Object.create(null),this.compiledCharCodeToGlyphId=Object.create(null)}getPathJs(t){const{charCode:e,glyphId:s}=lookupCmap(this.cmap,t);let i,n=this.compiledGlyphs[s];if(void 0===n){try{n=this.compileGlyph(this.glyphs[s],s)}catch(t){n="",i=t}this.compiledGlyphs[s]=n}if(this.compiledCharCodeToGlyphId[e]??=s,i)throw i;return n}compileGlyph(t,e){if(!t?.length||14===t[0])return"";let i=this.fontMatrix;if(this.isCFFCIDFont){const t=this.fdSelect.getFDIndex(e);t>=0&&t<this.fdArray.length?i=this.fdArray[t].getByName("FontMatrix")||s:warn$1("Invalid fd index for glyph index.")}assert$1(isNumberArray(i,6),"Expected a valid fontMatrix.");const n=new ka;return n.transform(i.slice()),this.compileGlyphImpl(t,n,e),n.add("Z"),n.getSVG()}compileGlyphImpl(){unreachable$1("Children classes should implement this.")}hasBuiltPath(t){const{charCode:e,glyphId:s}=lookupCmap(this.cmap,t);return void 0!==this.compiledGlyphs[s]&&void 0!==this.compiledCharCodeToGlyphId[e]}},Ca=class extends Sa{constructor(t,e,s){super(s||[488e-6,0,0,488e-6,0,0]),this.glyphs=t,this.cmap=e}compileGlyphImpl(t,e){compileGlyf(t,e,this)}},_a=class extends Sa{constructor(t,e,s){super(s||[.001,0,0,.001,0,0]),this.glyphs=t.glyphs,this.gsubrs=t.gsubrs||[],this.subrs=t.subrs||[],this.cmap=e,this.glyphNameMap=En(),this.gsubrsBias=getSubroutineBias(this.gsubrs),this.subrsBias=getSubroutineBias(this.subrs),this.isCFFCIDFont=t.isCFFCIDFont,this.fdSelect=t.fdSelect,this.fdArray=t.fdArray}compileGlyphImpl(t,e,s){compileCharString(t,e,this,s)}},Ia=class{static create(t,e){const s=new Uint8Array(t.data);let i,n,a,r,o,l;const c=readUint16(s,4);for(let t=0,h=12;t<c;t++,h+=16){const t=bytesToString$1(s.subarray(h,h+4)),c=readUint32(s,h+8),u=readUint32(s,h+12);switch(t){case"cmap":i=parseCmap(s,c);break;case"glyf":n=s.subarray(c,c+u);break;case"loca":a=s.subarray(c,c+u);break;case"head":l=readUint16(s,c+18),o=readUint16(s,c+50);break;case"CFF ":r=parseCff(s,c,c+u,e)}}if(n){const e=l?[1/l,0,0,1/l,0,0]:t.fontMatrix;return new Ca(function(t,e,s){let i,n;s?(i=4,n=readUint32):(i=2,n=(t,e)=>2*readUint16(t,e));const a=[];let r=n(e,0);for(let s=i;s<e.length;s+=i){const i=n(e,s);a.push(t.subarray(r,i)),r=i}return a}(n,a,o),i,e)}return new _a(r,i,t.fontMatrix)}},Ta=getLookupTableFactory(function(t){t.Courier=600,t["Courier-Bold"]=600,t["Courier-BoldOblique"]=600,t["Courier-Oblique"]=600,t.Helvetica=getLookupTableFactory(function(t){t.space=278,t.exclam=278,t.quotedbl=355,t.numbersign=556,t.dollar=556,t.percent=889,t.ampersand=667,t.quoteright=222,t.parenleft=333,t.parenright=333,t.asterisk=389,t.plus=584,t.comma=278,t.hyphen=333,t.period=278,t.slash=278,t.zero=556,t.one=556,t.two=556,t.three=556,t.four=556,t.five=556,t.six=556,t.seven=556,t.eight=556,t.nine=556,t.colon=278,t.semicolon=278,t.less=584,t.equal=584,t.greater=584,t.question=556,t.at=1015,t.A=667,t.B=667,t.C=722,t.D=722,t.E=667,t.F=611,t.G=778,t.H=722,t.I=278,t.J=500,t.K=667,t.L=556,t.M=833,t.N=722,t.O=778,t.P=667,t.Q=778,t.R=722,t.S=667,t.T=611,t.U=722,t.V=667,t.W=944,t.X=667,t.Y=667,t.Z=611,t.bracketleft=278,t.backslash=278,t.bracketright=278,t.asciicircum=469,t.underscore=556,t.quoteleft=222,t.a=556,t.b=556,t.c=500,t.d=556,t.e=556,t.f=278,t.g=556,t.h=556,t.i=222,t.j=222,t.k=500,t.l=222,t.m=833,t.n=556,t.o=556,t.p=556,t.q=556,t.r=333,t.s=500,t.t=278,t.u=556,t.v=500,t.w=722,t.x=500,t.y=500,t.z=500,t.braceleft=334,t.bar=260,t.braceright=334,t.asciitilde=584,t.exclamdown=333,t.cent=556,t.sterling=556,t.fraction=167,t.yen=556,t.florin=556,t.section=556,t.currency=556,t.quotesingle=191,t.quotedblleft=333,t.guillemotleft=556,t.guilsinglleft=333,t.guilsinglright=333,t.fi=500,t.fl=500,t.endash=556,t.dagger=556,t.daggerdbl=556,t.periodcentered=278,t.paragraph=537,t.bullet=350,t.quotesinglbase=222,t.quotedblbase=333,t.quotedblright=333,t.guillemotright=556,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=611,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=1e3,t.ordfeminine=370,t.Lslash=556,t.Oslash=778,t.OE=1e3,t.ordmasculine=365,t.ae=889,t.dotlessi=278,t.lslash=222,t.oslash=611,t.oe=944,t.germandbls=611,t.Idieresis=278,t.eacute=556,t.abreve=556,t.uhungarumlaut=556,t.ecaron=556,t.Ydieresis=667,t.divide=584,t.Yacute=667,t.Acircumflex=667,t.aacute=556,t.Ucircumflex=722,t.yacute=500,t.scommaaccent=500,t.ecircumflex=556,t.Uring=722,t.Udieresis=722,t.aogonek=556,t.Uacute=722,t.uogonek=556,t.Edieresis=667,t.Dcroat=722,t.commaaccent=250,t.copyright=737,t.Emacron=667,t.ccaron=500,t.aring=556,t.Ncommaaccent=722,t.lacute=222,t.agrave=556,t.Tcommaaccent=611,t.Cacute=722,t.atilde=556,t.Edotaccent=667,t.scaron=500,t.scedilla=500,t.iacute=278,t.lozenge=471,t.Rcaron=722,t.Gcommaaccent=778,t.ucircumflex=556,t.acircumflex=556,t.Amacron=667,t.rcaron=333,t.ccedilla=500,t.Zdotaccent=611,t.Thorn=667,t.Omacron=778,t.Racute=722,t.Sacute=667,t.dcaron=643,t.Umacron=722,t.uring=556,t.threesuperior=333,t.Ograve=778,t.Agrave=667,t.Abreve=667,t.multiply=584,t.uacute=556,t.Tcaron=611,t.partialdiff=476,t.ydieresis=500,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=667,t.adieresis=556,t.edieresis=556,t.cacute=500,t.nacute=556,t.umacron=556,t.Ncaron=722,t.Iacute=278,t.plusminus=584,t.brokenbar=260,t.registered=737,t.Gbreve=778,t.Idotaccent=278,t.summation=600,t.Egrave=667,t.racute=333,t.omacron=556,t.Zacute=611,t.Zcaron=611,t.greaterequal=549,t.Eth=722,t.Ccedilla=722,t.lcommaaccent=222,t.tcaron=317,t.eogonek=556,t.Uogonek=722,t.Aacute=667,t.Adieresis=667,t.egrave=556,t.zacute=500,t.iogonek=222,t.Oacute=778,t.oacute=556,t.amacron=556,t.sacute=500,t.idieresis=278,t.Ocircumflex=778,t.Ugrave=722,t.Delta=612,t.thorn=556,t.twosuperior=333,t.Odieresis=778,t.mu=556,t.igrave=278,t.ohungarumlaut=556,t.Eogonek=667,t.dcroat=556,t.threequarters=834,t.Scedilla=667,t.lcaron=299,t.Kcommaaccent=667,t.Lacute=556,t.trademark=1e3,t.edotaccent=556,t.Igrave=278,t.Imacron=278,t.Lcaron=556,t.onehalf=834,t.lessequal=549,t.ocircumflex=556,t.ntilde=556,t.Uhungarumlaut=722,t.Eacute=667,t.emacron=556,t.gbreve=556,t.onequarter=834,t.Scaron=667,t.Scommaaccent=667,t.Ohungarumlaut=778,t.degree=400,t.ograve=556,t.Ccaron=722,t.ugrave=556,t.radical=453,t.Dcaron=722,t.rcommaaccent=333,t.Ntilde=722,t.otilde=556,t.Rcommaaccent=722,t.Lcommaaccent=556,t.Atilde=667,t.Aogonek=667,t.Aring=667,t.Otilde=778,t.zdotaccent=500,t.Ecaron=667,t.Iogonek=278,t.kcommaaccent=500,t.minus=584,t.Icircumflex=278,t.ncaron=556,t.tcommaaccent=278,t.logicalnot=584,t.odieresis=556,t.udieresis=556,t.notequal=549,t.gcommaaccent=556,t.eth=556,t.zcaron=500,t.ncommaaccent=556,t.onesuperior=333,t.imacron=278,t.Euro=556}),t["Helvetica-Bold"]=getLookupTableFactory(function(t){t.space=278,t.exclam=333,t.quotedbl=474,t.numbersign=556,t.dollar=556,t.percent=889,t.ampersand=722,t.quoteright=278,t.parenleft=333,t.parenright=333,t.asterisk=389,t.plus=584,t.comma=278,t.hyphen=333,t.period=278,t.slash=278,t.zero=556,t.one=556,t.two=556,t.three=556,t.four=556,t.five=556,t.six=556,t.seven=556,t.eight=556,t.nine=556,t.colon=333,t.semicolon=333,t.less=584,t.equal=584,t.greater=584,t.question=611,t.at=975,t.A=722,t.B=722,t.C=722,t.D=722,t.E=667,t.F=611,t.G=778,t.H=722,t.I=278,t.J=556,t.K=722,t.L=611,t.M=833,t.N=722,t.O=778,t.P=667,t.Q=778,t.R=722,t.S=667,t.T=611,t.U=722,t.V=667,t.W=944,t.X=667,t.Y=667,t.Z=611,t.bracketleft=333,t.backslash=278,t.bracketright=333,t.asciicircum=584,t.underscore=556,t.quoteleft=278,t.a=556,t.b=611,t.c=556,t.d=611,t.e=556,t.f=333,t.g=611,t.h=611,t.i=278,t.j=278,t.k=556,t.l=278,t.m=889,t.n=611,t.o=611,t.p=611,t.q=611,t.r=389,t.s=556,t.t=333,t.u=611,t.v=556,t.w=778,t.x=556,t.y=556,t.z=500,t.braceleft=389,t.bar=280,t.braceright=389,t.asciitilde=584,t.exclamdown=333,t.cent=556,t.sterling=556,t.fraction=167,t.yen=556,t.florin=556,t.section=556,t.currency=556,t.quotesingle=238,t.quotedblleft=500,t.guillemotleft=556,t.guilsinglleft=333,t.guilsinglright=333,t.fi=611,t.fl=611,t.endash=556,t.dagger=556,t.daggerdbl=556,t.periodcentered=278,t.paragraph=556,t.bullet=350,t.quotesinglbase=278,t.quotedblbase=500,t.quotedblright=500,t.guillemotright=556,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=611,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=1e3,t.ordfeminine=370,t.Lslash=611,t.Oslash=778,t.OE=1e3,t.ordmasculine=365,t.ae=889,t.dotlessi=278,t.lslash=278,t.oslash=611,t.oe=944,t.germandbls=611,t.Idieresis=278,t.eacute=556,t.abreve=556,t.uhungarumlaut=611,t.ecaron=556,t.Ydieresis=667,t.divide=584,t.Yacute=667,t.Acircumflex=722,t.aacute=556,t.Ucircumflex=722,t.yacute=556,t.scommaaccent=556,t.ecircumflex=556,t.Uring=722,t.Udieresis=722,t.aogonek=556,t.Uacute=722,t.uogonek=611,t.Edieresis=667,t.Dcroat=722,t.commaaccent=250,t.copyright=737,t.Emacron=667,t.ccaron=556,t.aring=556,t.Ncommaaccent=722,t.lacute=278,t.agrave=556,t.Tcommaaccent=611,t.Cacute=722,t.atilde=556,t.Edotaccent=667,t.scaron=556,t.scedilla=556,t.iacute=278,t.lozenge=494,t.Rcaron=722,t.Gcommaaccent=778,t.ucircumflex=611,t.acircumflex=556,t.Amacron=722,t.rcaron=389,t.ccedilla=556,t.Zdotaccent=611,t.Thorn=667,t.Omacron=778,t.Racute=722,t.Sacute=667,t.dcaron=743,t.Umacron=722,t.uring=611,t.threesuperior=333,t.Ograve=778,t.Agrave=722,t.Abreve=722,t.multiply=584,t.uacute=611,t.Tcaron=611,t.partialdiff=494,t.ydieresis=556,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=667,t.adieresis=556,t.edieresis=556,t.cacute=556,t.nacute=611,t.umacron=611,t.Ncaron=722,t.Iacute=278,t.plusminus=584,t.brokenbar=280,t.registered=737,t.Gbreve=778,t.Idotaccent=278,t.summation=600,t.Egrave=667,t.racute=389,t.omacron=611,t.Zacute=611,t.Zcaron=611,t.greaterequal=549,t.Eth=722,t.Ccedilla=722,t.lcommaaccent=278,t.tcaron=389,t.eogonek=556,t.Uogonek=722,t.Aacute=722,t.Adieresis=722,t.egrave=556,t.zacute=500,t.iogonek=278,t.Oacute=778,t.oacute=611,t.amacron=556,t.sacute=556,t.idieresis=278,t.Ocircumflex=778,t.Ugrave=722,t.Delta=612,t.thorn=611,t.twosuperior=333,t.Odieresis=778,t.mu=611,t.igrave=278,t.ohungarumlaut=611,t.Eogonek=667,t.dcroat=611,t.threequarters=834,t.Scedilla=667,t.lcaron=400,t.Kcommaaccent=722,t.Lacute=611,t.trademark=1e3,t.edotaccent=556,t.Igrave=278,t.Imacron=278,t.Lcaron=611,t.onehalf=834,t.lessequal=549,t.ocircumflex=611,t.ntilde=611,t.Uhungarumlaut=722,t.Eacute=667,t.emacron=556,t.gbreve=611,t.onequarter=834,t.Scaron=667,t.Scommaaccent=667,t.Ohungarumlaut=778,t.degree=400,t.ograve=611,t.Ccaron=722,t.ugrave=611,t.radical=549,t.Dcaron=722,t.rcommaaccent=389,t.Ntilde=722,t.otilde=611,t.Rcommaaccent=722,t.Lcommaaccent=611,t.Atilde=722,t.Aogonek=722,t.Aring=722,t.Otilde=778,t.zdotaccent=500,t.Ecaron=667,t.Iogonek=278,t.kcommaaccent=556,t.minus=584,t.Icircumflex=278,t.ncaron=611,t.tcommaaccent=333,t.logicalnot=584,t.odieresis=611,t.udieresis=611,t.notequal=549,t.gcommaaccent=611,t.eth=611,t.zcaron=500,t.ncommaaccent=611,t.onesuperior=333,t.imacron=278,t.Euro=556}),t["Helvetica-BoldOblique"]=getLookupTableFactory(function(t){t.space=278,t.exclam=333,t.quotedbl=474,t.numbersign=556,t.dollar=556,t.percent=889,t.ampersand=722,t.quoteright=278,t.parenleft=333,t.parenright=333,t.asterisk=389,t.plus=584,t.comma=278,t.hyphen=333,t.period=278,t.slash=278,t.zero=556,t.one=556,t.two=556,t.three=556,t.four=556,t.five=556,t.six=556,t.seven=556,t.eight=556,t.nine=556,t.colon=333,t.semicolon=333,t.less=584,t.equal=584,t.greater=584,t.question=611,t.at=975,t.A=722,t.B=722,t.C=722,t.D=722,t.E=667,t.F=611,t.G=778,t.H=722,t.I=278,t.J=556,t.K=722,t.L=611,t.M=833,t.N=722,t.O=778,t.P=667,t.Q=778,t.R=722,t.S=667,t.T=611,t.U=722,t.V=667,t.W=944,t.X=667,t.Y=667,t.Z=611,t.bracketleft=333,t.backslash=278,t.bracketright=333,t.asciicircum=584,t.underscore=556,t.quoteleft=278,t.a=556,t.b=611,t.c=556,t.d=611,t.e=556,t.f=333,t.g=611,t.h=611,t.i=278,t.j=278,t.k=556,t.l=278,t.m=889,t.n=611,t.o=611,t.p=611,t.q=611,t.r=389,t.s=556,t.t=333,t.u=611,t.v=556,t.w=778,t.x=556,t.y=556,t.z=500,t.braceleft=389,t.bar=280,t.braceright=389,t.asciitilde=584,t.exclamdown=333,t.cent=556,t.sterling=556,t.fraction=167,t.yen=556,t.florin=556,t.section=556,t.currency=556,t.quotesingle=238,t.quotedblleft=500,t.guillemotleft=556,t.guilsinglleft=333,t.guilsinglright=333,t.fi=611,t.fl=611,t.endash=556,t.dagger=556,t.daggerdbl=556,t.periodcentered=278,t.paragraph=556,t.bullet=350,t.quotesinglbase=278,t.quotedblbase=500,t.quotedblright=500,t.guillemotright=556,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=611,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=1e3,t.ordfeminine=370,t.Lslash=611,t.Oslash=778,t.OE=1e3,t.ordmasculine=365,t.ae=889,t.dotlessi=278,t.lslash=278,t.oslash=611,t.oe=944,t.germandbls=611,t.Idieresis=278,t.eacute=556,t.abreve=556,t.uhungarumlaut=611,t.ecaron=556,t.Ydieresis=667,t.divide=584,t.Yacute=667,t.Acircumflex=722,t.aacute=556,t.Ucircumflex=722,t.yacute=556,t.scommaaccent=556,t.ecircumflex=556,t.Uring=722,t.Udieresis=722,t.aogonek=556,t.Uacute=722,t.uogonek=611,t.Edieresis=667,t.Dcroat=722,t.commaaccent=250,t.copyright=737,t.Emacron=667,t.ccaron=556,t.aring=556,t.Ncommaaccent=722,t.lacute=278,t.agrave=556,t.Tcommaaccent=611,t.Cacute=722,t.atilde=556,t.Edotaccent=667,t.scaron=556,t.scedilla=556,t.iacute=278,t.lozenge=494,t.Rcaron=722,t.Gcommaaccent=778,t.ucircumflex=611,t.acircumflex=556,t.Amacron=722,t.rcaron=389,t.ccedilla=556,t.Zdotaccent=611,t.Thorn=667,t.Omacron=778,t.Racute=722,t.Sacute=667,t.dcaron=743,t.Umacron=722,t.uring=611,t.threesuperior=333,t.Ograve=778,t.Agrave=722,t.Abreve=722,t.multiply=584,t.uacute=611,t.Tcaron=611,t.partialdiff=494,t.ydieresis=556,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=667,t.adieresis=556,t.edieresis=556,t.cacute=556,t.nacute=611,t.umacron=611,t.Ncaron=722,t.Iacute=278,t.plusminus=584,t.brokenbar=280,t.registered=737,t.Gbreve=778,t.Idotaccent=278,t.summation=600,t.Egrave=667,t.racute=389,t.omacron=611,t.Zacute=611,t.Zcaron=611,t.greaterequal=549,t.Eth=722,t.Ccedilla=722,t.lcommaaccent=278,t.tcaron=389,t.eogonek=556,t.Uogonek=722,t.Aacute=722,t.Adieresis=722,t.egrave=556,t.zacute=500,t.iogonek=278,t.Oacute=778,t.oacute=611,t.amacron=556,t.sacute=556,t.idieresis=278,t.Ocircumflex=778,t.Ugrave=722,t.Delta=612,t.thorn=611,t.twosuperior=333,t.Odieresis=778,t.mu=611,t.igrave=278,t.ohungarumlaut=611,t.Eogonek=667,t.dcroat=611,t.threequarters=834,t.Scedilla=667,t.lcaron=400,t.Kcommaaccent=722,t.Lacute=611,t.trademark=1e3,t.edotaccent=556,t.Igrave=278,t.Imacron=278,t.Lcaron=611,t.onehalf=834,t.lessequal=549,t.ocircumflex=611,t.ntilde=611,t.Uhungarumlaut=722,t.Eacute=667,t.emacron=556,t.gbreve=611,t.onequarter=834,t.Scaron=667,t.Scommaaccent=667,t.Ohungarumlaut=778,t.degree=400,t.ograve=611,t.Ccaron=722,t.ugrave=611,t.radical=549,t.Dcaron=722,t.rcommaaccent=389,t.Ntilde=722,t.otilde=611,t.Rcommaaccent=722,t.Lcommaaccent=611,t.Atilde=722,t.Aogonek=722,t.Aring=722,t.Otilde=778,t.zdotaccent=500,t.Ecaron=667,t.Iogonek=278,t.kcommaaccent=556,t.minus=584,t.Icircumflex=278,t.ncaron=611,t.tcommaaccent=333,t.logicalnot=584,t.odieresis=611,t.udieresis=611,t.notequal=549,t.gcommaaccent=611,t.eth=611,t.zcaron=500,t.ncommaaccent=611,t.onesuperior=333,t.imacron=278,t.Euro=556}),t["Helvetica-Oblique"]=getLookupTableFactory(function(t){t.space=278,t.exclam=278,t.quotedbl=355,t.numbersign=556,t.dollar=556,t.percent=889,t.ampersand=667,t.quoteright=222,t.parenleft=333,t.parenright=333,t.asterisk=389,t.plus=584,t.comma=278,t.hyphen=333,t.period=278,t.slash=278,t.zero=556,t.one=556,t.two=556,t.three=556,t.four=556,t.five=556,t.six=556,t.seven=556,t.eight=556,t.nine=556,t.colon=278,t.semicolon=278,t.less=584,t.equal=584,t.greater=584,t.question=556,t.at=1015,t.A=667,t.B=667,t.C=722,t.D=722,t.E=667,t.F=611,t.G=778,t.H=722,t.I=278,t.J=500,t.K=667,t.L=556,t.M=833,t.N=722,t.O=778,t.P=667,t.Q=778,t.R=722,t.S=667,t.T=611,t.U=722,t.V=667,t.W=944,t.X=667,t.Y=667,t.Z=611,t.bracketleft=278,t.backslash=278,t.bracketright=278,t.asciicircum=469,t.underscore=556,t.quoteleft=222,t.a=556,t.b=556,t.c=500,t.d=556,t.e=556,t.f=278,t.g=556,t.h=556,t.i=222,t.j=222,t.k=500,t.l=222,t.m=833,t.n=556,t.o=556,t.p=556,t.q=556,t.r=333,t.s=500,t.t=278,t.u=556,t.v=500,t.w=722,t.x=500,t.y=500,t.z=500,t.braceleft=334,t.bar=260,t.braceright=334,t.asciitilde=584,t.exclamdown=333,t.cent=556,t.sterling=556,t.fraction=167,t.yen=556,t.florin=556,t.section=556,t.currency=556,t.quotesingle=191,t.quotedblleft=333,t.guillemotleft=556,t.guilsinglleft=333,t.guilsinglright=333,t.fi=500,t.fl=500,t.endash=556,t.dagger=556,t.daggerdbl=556,t.periodcentered=278,t.paragraph=537,t.bullet=350,t.quotesinglbase=222,t.quotedblbase=333,t.quotedblright=333,t.guillemotright=556,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=611,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=1e3,t.ordfeminine=370,t.Lslash=556,t.Oslash=778,t.OE=1e3,t.ordmasculine=365,t.ae=889,t.dotlessi=278,t.lslash=222,t.oslash=611,t.oe=944,t.germandbls=611,t.Idieresis=278,t.eacute=556,t.abreve=556,t.uhungarumlaut=556,t.ecaron=556,t.Ydieresis=667,t.divide=584,t.Yacute=667,t.Acircumflex=667,t.aacute=556,t.Ucircumflex=722,t.yacute=500,t.scommaaccent=500,t.ecircumflex=556,t.Uring=722,t.Udieresis=722,t.aogonek=556,t.Uacute=722,t.uogonek=556,t.Edieresis=667,t.Dcroat=722,t.commaaccent=250,t.copyright=737,t.Emacron=667,t.ccaron=500,t.aring=556,t.Ncommaaccent=722,t.lacute=222,t.agrave=556,t.Tcommaaccent=611,t.Cacute=722,t.atilde=556,t.Edotaccent=667,t.scaron=500,t.scedilla=500,t.iacute=278,t.lozenge=471,t.Rcaron=722,t.Gcommaaccent=778,t.ucircumflex=556,t.acircumflex=556,t.Amacron=667,t.rcaron=333,t.ccedilla=500,t.Zdotaccent=611,t.Thorn=667,t.Omacron=778,t.Racute=722,t.Sacute=667,t.dcaron=643,t.Umacron=722,t.uring=556,t.threesuperior=333,t.Ograve=778,t.Agrave=667,t.Abreve=667,t.multiply=584,t.uacute=556,t.Tcaron=611,t.partialdiff=476,t.ydieresis=500,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=667,t.adieresis=556,t.edieresis=556,t.cacute=500,t.nacute=556,t.umacron=556,t.Ncaron=722,t.Iacute=278,t.plusminus=584,t.brokenbar=260,t.registered=737,t.Gbreve=778,t.Idotaccent=278,t.summation=600,t.Egrave=667,t.racute=333,t.omacron=556,t.Zacute=611,t.Zcaron=611,t.greaterequal=549,t.Eth=722,t.Ccedilla=722,t.lcommaaccent=222,t.tcaron=317,t.eogonek=556,t.Uogonek=722,t.Aacute=667,t.Adieresis=667,t.egrave=556,t.zacute=500,t.iogonek=222,t.Oacute=778,t.oacute=556,t.amacron=556,t.sacute=500,t.idieresis=278,t.Ocircumflex=778,t.Ugrave=722,t.Delta=612,t.thorn=556,t.twosuperior=333,t.Odieresis=778,t.mu=556,t.igrave=278,t.ohungarumlaut=556,t.Eogonek=667,t.dcroat=556,t.threequarters=834,t.Scedilla=667,t.lcaron=299,t.Kcommaaccent=667,t.Lacute=556,t.trademark=1e3,t.edotaccent=556,t.Igrave=278,t.Imacron=278,t.Lcaron=556,t.onehalf=834,t.lessequal=549,t.ocircumflex=556,t.ntilde=556,t.Uhungarumlaut=722,t.Eacute=667,t.emacron=556,t.gbreve=556,t.onequarter=834,t.Scaron=667,t.Scommaaccent=667,t.Ohungarumlaut=778,t.degree=400,t.ograve=556,t.Ccaron=722,t.ugrave=556,t.radical=453,t.Dcaron=722,t.rcommaaccent=333,t.Ntilde=722,t.otilde=556,t.Rcommaaccent=722,t.Lcommaaccent=556,t.Atilde=667,t.Aogonek=667,t.Aring=667,t.Otilde=778,t.zdotaccent=500,t.Ecaron=667,t.Iogonek=278,t.kcommaaccent=500,t.minus=584,t.Icircumflex=278,t.ncaron=556,t.tcommaaccent=278,t.logicalnot=584,t.odieresis=556,t.udieresis=556,t.notequal=549,t.gcommaaccent=556,t.eth=556,t.zcaron=500,t.ncommaaccent=556,t.onesuperior=333,t.imacron=278,t.Euro=556}),t.Symbol=getLookupTableFactory(function(t){t.space=250,t.exclam=333,t.universal=713,t.numbersign=500,t.existential=549,t.percent=833,t.ampersand=778,t.suchthat=439,t.parenleft=333,t.parenright=333,t.asteriskmath=500,t.plus=549,t.comma=250,t.minus=549,t.period=250,t.slash=278,t.zero=500,t.one=500,t.two=500,t.three=500,t.four=500,t.five=500,t.six=500,t.seven=500,t.eight=500,t.nine=500,t.colon=278,t.semicolon=278,t.less=549,t.equal=549,t.greater=549,t.question=444,t.congruent=549,t.Alpha=722,t.Beta=667,t.Chi=722,t.Delta=612,t.Epsilon=611,t.Phi=763,t.Gamma=603,t.Eta=722,t.Iota=333,t.theta1=631,t.Kappa=722,t.Lambda=686,t.Mu=889,t.Nu=722,t.Omicron=722,t.Pi=768,t.Theta=741,t.Rho=556,t.Sigma=592,t.Tau=611,t.Upsilon=690,t.sigma1=439,t.Omega=768,t.Xi=645,t.Psi=795,t.Zeta=611,t.bracketleft=333,t.therefore=863,t.bracketright=333,t.perpendicular=658,t.underscore=500,t.radicalex=500,t.alpha=631,t.beta=549,t.chi=549,t.delta=494,t.epsilon=439,t.phi=521,t.gamma=411,t.eta=603,t.iota=329,t.phi1=603,t.kappa=549,t.lambda=549,t.mu=576,t.nu=521,t.omicron=549,t.pi=549,t.theta=521,t.rho=549,t.sigma=603,t.tau=439,t.upsilon=576,t.omega1=713,t.omega=686,t.xi=493,t.psi=686,t.zeta=494,t.braceleft=480,t.bar=200,t.braceright=480,t.similar=549,t.Euro=750,t.Upsilon1=620,t.minute=247,t.lessequal=549,t.fraction=167,t.infinity=713,t.florin=500,t.club=753,t.diamond=753,t.heart=753,t.spade=753,t.arrowboth=1042,t.arrowleft=987,t.arrowup=603,t.arrowright=987,t.arrowdown=603,t.degree=400,t.plusminus=549,t.second=411,t.greaterequal=549,t.multiply=549,t.proportional=713,t.partialdiff=494,t.bullet=460,t.divide=549,t.notequal=549,t.equivalence=549,t.approxequal=549,t.ellipsis=1e3,t.arrowvertex=603,t.arrowhorizex=1e3,t.carriagereturn=658,t.aleph=823,t.Ifraktur=686,t.Rfraktur=795,t.weierstrass=987,t.circlemultiply=768,t.circleplus=768,t.emptyset=823,t.intersection=768,t.union=768,t.propersuperset=713,t.reflexsuperset=713,t.notsubset=713,t.propersubset=713,t.reflexsubset=713,t.element=713,t.notelement=713,t.angle=768,t.gradient=713,t.registerserif=790,t.copyrightserif=790,t.trademarkserif=890,t.product=823,t.radical=549,t.dotmath=250,t.logicalnot=713,t.logicaland=603,t.logicalor=603,t.arrowdblboth=1042,t.arrowdblleft=987,t.arrowdblup=603,t.arrowdblright=987,t.arrowdbldown=603,t.lozenge=494,t.angleleft=329,t.registersans=790,t.copyrightsans=790,t.trademarksans=786,t.summation=713,t.parenlefttp=384,t.parenleftex=384,t.parenleftbt=384,t.bracketlefttp=384,t.bracketleftex=384,t.bracketleftbt=384,t.bracelefttp=494,t.braceleftmid=494,t.braceleftbt=494,t.braceex=494,t.angleright=329,t.integral=274,t.integraltp=686,t.integralex=686,t.integralbt=686,t.parenrighttp=384,t.parenrightex=384,t.parenrightbt=384,t.bracketrighttp=384,t.bracketrightex=384,t.bracketrightbt=384,t.bracerighttp=494,t.bracerightmid=494,t.bracerightbt=494,t.apple=790}),t["Times-Roman"]=getLookupTableFactory(function(t){t.space=250,t.exclam=333,t.quotedbl=408,t.numbersign=500,t.dollar=500,t.percent=833,t.ampersand=778,t.quoteright=333,t.parenleft=333,t.parenright=333,t.asterisk=500,t.plus=564,t.comma=250,t.hyphen=333,t.period=250,t.slash=278,t.zero=500,t.one=500,t.two=500,t.three=500,t.four=500,t.five=500,t.six=500,t.seven=500,t.eight=500,t.nine=500,t.colon=278,t.semicolon=278,t.less=564,t.equal=564,t.greater=564,t.question=444,t.at=921,t.A=722,t.B=667,t.C=667,t.D=722,t.E=611,t.F=556,t.G=722,t.H=722,t.I=333,t.J=389,t.K=722,t.L=611,t.M=889,t.N=722,t.O=722,t.P=556,t.Q=722,t.R=667,t.S=556,t.T=611,t.U=722,t.V=722,t.W=944,t.X=722,t.Y=722,t.Z=611,t.bracketleft=333,t.backslash=278,t.bracketright=333,t.asciicircum=469,t.underscore=500,t.quoteleft=333,t.a=444,t.b=500,t.c=444,t.d=500,t.e=444,t.f=333,t.g=500,t.h=500,t.i=278,t.j=278,t.k=500,t.l=278,t.m=778,t.n=500,t.o=500,t.p=500,t.q=500,t.r=333,t.s=389,t.t=278,t.u=500,t.v=500,t.w=722,t.x=500,t.y=500,t.z=444,t.braceleft=480,t.bar=200,t.braceright=480,t.asciitilde=541,t.exclamdown=333,t.cent=500,t.sterling=500,t.fraction=167,t.yen=500,t.florin=500,t.section=500,t.currency=500,t.quotesingle=180,t.quotedblleft=444,t.guillemotleft=500,t.guilsinglleft=333,t.guilsinglright=333,t.fi=556,t.fl=556,t.endash=500,t.dagger=500,t.daggerdbl=500,t.periodcentered=250,t.paragraph=453,t.bullet=350,t.quotesinglbase=333,t.quotedblbase=444,t.quotedblright=444,t.guillemotright=500,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=444,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=889,t.ordfeminine=276,t.Lslash=611,t.Oslash=722,t.OE=889,t.ordmasculine=310,t.ae=667,t.dotlessi=278,t.lslash=278,t.oslash=500,t.oe=722,t.germandbls=500,t.Idieresis=333,t.eacute=444,t.abreve=444,t.uhungarumlaut=500,t.ecaron=444,t.Ydieresis=722,t.divide=564,t.Yacute=722,t.Acircumflex=722,t.aacute=444,t.Ucircumflex=722,t.yacute=500,t.scommaaccent=389,t.ecircumflex=444,t.Uring=722,t.Udieresis=722,t.aogonek=444,t.Uacute=722,t.uogonek=500,t.Edieresis=611,t.Dcroat=722,t.commaaccent=250,t.copyright=760,t.Emacron=611,t.ccaron=444,t.aring=444,t.Ncommaaccent=722,t.lacute=278,t.agrave=444,t.Tcommaaccent=611,t.Cacute=667,t.atilde=444,t.Edotaccent=611,t.scaron=389,t.scedilla=389,t.iacute=278,t.lozenge=471,t.Rcaron=667,t.Gcommaaccent=722,t.ucircumflex=500,t.acircumflex=444,t.Amacron=722,t.rcaron=333,t.ccedilla=444,t.Zdotaccent=611,t.Thorn=556,t.Omacron=722,t.Racute=667,t.Sacute=556,t.dcaron=588,t.Umacron=722,t.uring=500,t.threesuperior=300,t.Ograve=722,t.Agrave=722,t.Abreve=722,t.multiply=564,t.uacute=500,t.Tcaron=611,t.partialdiff=476,t.ydieresis=500,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=611,t.adieresis=444,t.edieresis=444,t.cacute=444,t.nacute=500,t.umacron=500,t.Ncaron=722,t.Iacute=333,t.plusminus=564,t.brokenbar=200,t.registered=760,t.Gbreve=722,t.Idotaccent=333,t.summation=600,t.Egrave=611,t.racute=333,t.omacron=500,t.Zacute=611,t.Zcaron=611,t.greaterequal=549,t.Eth=722,t.Ccedilla=667,t.lcommaaccent=278,t.tcaron=326,t.eogonek=444,t.Uogonek=722,t.Aacute=722,t.Adieresis=722,t.egrave=444,t.zacute=444,t.iogonek=278,t.Oacute=722,t.oacute=500,t.amacron=444,t.sacute=389,t.idieresis=278,t.Ocircumflex=722,t.Ugrave=722,t.Delta=612,t.thorn=500,t.twosuperior=300,t.Odieresis=722,t.mu=500,t.igrave=278,t.ohungarumlaut=500,t.Eogonek=611,t.dcroat=500,t.threequarters=750,t.Scedilla=556,t.lcaron=344,t.Kcommaaccent=722,t.Lacute=611,t.trademark=980,t.edotaccent=444,t.Igrave=333,t.Imacron=333,t.Lcaron=611,t.onehalf=750,t.lessequal=549,t.ocircumflex=500,t.ntilde=500,t.Uhungarumlaut=722,t.Eacute=611,t.emacron=444,t.gbreve=500,t.onequarter=750,t.Scaron=556,t.Scommaaccent=556,t.Ohungarumlaut=722,t.degree=400,t.ograve=500,t.Ccaron=667,t.ugrave=500,t.radical=453,t.Dcaron=722,t.rcommaaccent=333,t.Ntilde=722,t.otilde=500,t.Rcommaaccent=667,t.Lcommaaccent=611,t.Atilde=722,t.Aogonek=722,t.Aring=722,t.Otilde=722,t.zdotaccent=444,t.Ecaron=611,t.Iogonek=333,t.kcommaaccent=500,t.minus=564,t.Icircumflex=333,t.ncaron=500,t.tcommaaccent=278,t.logicalnot=564,t.odieresis=500,t.udieresis=500,t.notequal=549,t.gcommaaccent=500,t.eth=500,t.zcaron=444,t.ncommaaccent=500,t.onesuperior=300,t.imacron=278,t.Euro=500}),t["Times-Bold"]=getLookupTableFactory(function(t){t.space=250,t.exclam=333,t.quotedbl=555,t.numbersign=500,t.dollar=500,t.percent=1e3,t.ampersand=833,t.quoteright=333,t.parenleft=333,t.parenright=333,t.asterisk=500,t.plus=570,t.comma=250,t.hyphen=333,t.period=250,t.slash=278,t.zero=500,t.one=500,t.two=500,t.three=500,t.four=500,t.five=500,t.six=500,t.seven=500,t.eight=500,t.nine=500,t.colon=333,t.semicolon=333,t.less=570,t.equal=570,t.greater=570,t.question=500,t.at=930,t.A=722,t.B=667,t.C=722,t.D=722,t.E=667,t.F=611,t.G=778,t.H=778,t.I=389,t.J=500,t.K=778,t.L=667,t.M=944,t.N=722,t.O=778,t.P=611,t.Q=778,t.R=722,t.S=556,t.T=667,t.U=722,t.V=722,t.W=1e3,t.X=722,t.Y=722,t.Z=667,t.bracketleft=333,t.backslash=278,t.bracketright=333,t.asciicircum=581,t.underscore=500,t.quoteleft=333,t.a=500,t.b=556,t.c=444,t.d=556,t.e=444,t.f=333,t.g=500,t.h=556,t.i=278,t.j=333,t.k=556,t.l=278,t.m=833,t.n=556,t.o=500,t.p=556,t.q=556,t.r=444,t.s=389,t.t=333,t.u=556,t.v=500,t.w=722,t.x=500,t.y=500,t.z=444,t.braceleft=394,t.bar=220,t.braceright=394,t.asciitilde=520,t.exclamdown=333,t.cent=500,t.sterling=500,t.fraction=167,t.yen=500,t.florin=500,t.section=500,t.currency=500,t.quotesingle=278,t.quotedblleft=500,t.guillemotleft=500,t.guilsinglleft=333,t.guilsinglright=333,t.fi=556,t.fl=556,t.endash=500,t.dagger=500,t.daggerdbl=500,t.periodcentered=250,t.paragraph=540,t.bullet=350,t.quotesinglbase=333,t.quotedblbase=500,t.quotedblright=500,t.guillemotright=500,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=500,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=1e3,t.ordfeminine=300,t.Lslash=667,t.Oslash=778,t.OE=1e3,t.ordmasculine=330,t.ae=722,t.dotlessi=278,t.lslash=278,t.oslash=500,t.oe=722,t.germandbls=556,t.Idieresis=389,t.eacute=444,t.abreve=500,t.uhungarumlaut=556,t.ecaron=444,t.Ydieresis=722,t.divide=570,t.Yacute=722,t.Acircumflex=722,t.aacute=500,t.Ucircumflex=722,t.yacute=500,t.scommaaccent=389,t.ecircumflex=444,t.Uring=722,t.Udieresis=722,t.aogonek=500,t.Uacute=722,t.uogonek=556,t.Edieresis=667,t.Dcroat=722,t.commaaccent=250,t.copyright=747,t.Emacron=667,t.ccaron=444,t.aring=500,t.Ncommaaccent=722,t.lacute=278,t.agrave=500,t.Tcommaaccent=667,t.Cacute=722,t.atilde=500,t.Edotaccent=667,t.scaron=389,t.scedilla=389,t.iacute=278,t.lozenge=494,t.Rcaron=722,t.Gcommaaccent=778,t.ucircumflex=556,t.acircumflex=500,t.Amacron=722,t.rcaron=444,t.ccedilla=444,t.Zdotaccent=667,t.Thorn=611,t.Omacron=778,t.Racute=722,t.Sacute=556,t.dcaron=672,t.Umacron=722,t.uring=556,t.threesuperior=300,t.Ograve=778,t.Agrave=722,t.Abreve=722,t.multiply=570,t.uacute=556,t.Tcaron=667,t.partialdiff=494,t.ydieresis=500,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=667,t.adieresis=500,t.edieresis=444,t.cacute=444,t.nacute=556,t.umacron=556,t.Ncaron=722,t.Iacute=389,t.plusminus=570,t.brokenbar=220,t.registered=747,t.Gbreve=778,t.Idotaccent=389,t.summation=600,t.Egrave=667,t.racute=444,t.omacron=500,t.Zacute=667,t.Zcaron=667,t.greaterequal=549,t.Eth=722,t.Ccedilla=722,t.lcommaaccent=278,t.tcaron=416,t.eogonek=444,t.Uogonek=722,t.Aacute=722,t.Adieresis=722,t.egrave=444,t.zacute=444,t.iogonek=278,t.Oacute=778,t.oacute=500,t.amacron=500,t.sacute=389,t.idieresis=278,t.Ocircumflex=778,t.Ugrave=722,t.Delta=612,t.thorn=556,t.twosuperior=300,t.Odieresis=778,t.mu=556,t.igrave=278,t.ohungarumlaut=500,t.Eogonek=667,t.dcroat=556,t.threequarters=750,t.Scedilla=556,t.lcaron=394,t.Kcommaaccent=778,t.Lacute=667,t.trademark=1e3,t.edotaccent=444,t.Igrave=389,t.Imacron=389,t.Lcaron=667,t.onehalf=750,t.lessequal=549,t.ocircumflex=500,t.ntilde=556,t.Uhungarumlaut=722,t.Eacute=667,t.emacron=444,t.gbreve=500,t.onequarter=750,t.Scaron=556,t.Scommaaccent=556,t.Ohungarumlaut=778,t.degree=400,t.ograve=500,t.Ccaron=722,t.ugrave=556,t.radical=549,t.Dcaron=722,t.rcommaaccent=444,t.Ntilde=722,t.otilde=500,t.Rcommaaccent=722,t.Lcommaaccent=667,t.Atilde=722,t.Aogonek=722,t.Aring=722,t.Otilde=778,t.zdotaccent=444,t.Ecaron=667,t.Iogonek=389,t.kcommaaccent=556,t.minus=570,t.Icircumflex=389,t.ncaron=556,t.tcommaaccent=333,t.logicalnot=570,t.odieresis=500,t.udieresis=556,t.notequal=549,t.gcommaaccent=500,t.eth=500,t.zcaron=444,t.ncommaaccent=556,t.onesuperior=300,t.imacron=278,t.Euro=500}),t["Times-BoldItalic"]=getLookupTableFactory(function(t){t.space=250,t.exclam=389,t.quotedbl=555,t.numbersign=500,t.dollar=500,t.percent=833,t.ampersand=778,t.quoteright=333,t.parenleft=333,t.parenright=333,t.asterisk=500,t.plus=570,t.comma=250,t.hyphen=333,t.period=250,t.slash=278,t.zero=500,t.one=500,t.two=500,t.three=500,t.four=500,t.five=500,t.six=500,t.seven=500,t.eight=500,t.nine=500,t.colon=333,t.semicolon=333,t.less=570,t.equal=570,t.greater=570,t.question=500,t.at=832,t.A=667,t.B=667,t.C=667,t.D=722,t.E=667,t.F=667,t.G=722,t.H=778,t.I=389,t.J=500,t.K=667,t.L=611,t.M=889,t.N=722,t.O=722,t.P=611,t.Q=722,t.R=667,t.S=556,t.T=611,t.U=722,t.V=667,t.W=889,t.X=667,t.Y=611,t.Z=611,t.bracketleft=333,t.backslash=278,t.bracketright=333,t.asciicircum=570,t.underscore=500,t.quoteleft=333,t.a=500,t.b=500,t.c=444,t.d=500,t.e=444,t.f=333,t.g=500,t.h=556,t.i=278,t.j=278,t.k=500,t.l=278,t.m=778,t.n=556,t.o=500,t.p=500,t.q=500,t.r=389,t.s=389,t.t=278,t.u=556,t.v=444,t.w=667,t.x=500,t.y=444,t.z=389,t.braceleft=348,t.bar=220,t.braceright=348,t.asciitilde=570,t.exclamdown=389,t.cent=500,t.sterling=500,t.fraction=167,t.yen=500,t.florin=500,t.section=500,t.currency=500,t.quotesingle=278,t.quotedblleft=500,t.guillemotleft=500,t.guilsinglleft=333,t.guilsinglright=333,t.fi=556,t.fl=556,t.endash=500,t.dagger=500,t.daggerdbl=500,t.periodcentered=250,t.paragraph=500,t.bullet=350,t.quotesinglbase=333,t.quotedblbase=500,t.quotedblright=500,t.guillemotright=500,t.ellipsis=1e3,t.perthousand=1e3,t.questiondown=500,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=1e3,t.AE=944,t.ordfeminine=266,t.Lslash=611,t.Oslash=722,t.OE=944,t.ordmasculine=300,t.ae=722,t.dotlessi=278,t.lslash=278,t.oslash=500,t.oe=722,t.germandbls=500,t.Idieresis=389,t.eacute=444,t.abreve=500,t.uhungarumlaut=556,t.ecaron=444,t.Ydieresis=611,t.divide=570,t.Yacute=611,t.Acircumflex=667,t.aacute=500,t.Ucircumflex=722,t.yacute=444,t.scommaaccent=389,t.ecircumflex=444,t.Uring=722,t.Udieresis=722,t.aogonek=500,t.Uacute=722,t.uogonek=556,t.Edieresis=667,t.Dcroat=722,t.commaaccent=250,t.copyright=747,t.Emacron=667,t.ccaron=444,t.aring=500,t.Ncommaaccent=722,t.lacute=278,t.agrave=500,t.Tcommaaccent=611,t.Cacute=667,t.atilde=500,t.Edotaccent=667,t.scaron=389,t.scedilla=389,t.iacute=278,t.lozenge=494,t.Rcaron=667,t.Gcommaaccent=722,t.ucircumflex=556,t.acircumflex=500,t.Amacron=667,t.rcaron=389,t.ccedilla=444,t.Zdotaccent=611,t.Thorn=611,t.Omacron=722,t.Racute=667,t.Sacute=556,t.dcaron=608,t.Umacron=722,t.uring=556,t.threesuperior=300,t.Ograve=722,t.Agrave=667,t.Abreve=667,t.multiply=570,t.uacute=556,t.Tcaron=611,t.partialdiff=494,t.ydieresis=444,t.Nacute=722,t.icircumflex=278,t.Ecircumflex=667,t.adieresis=500,t.edieresis=444,t.cacute=444,t.nacute=556,t.umacron=556,t.Ncaron=722,t.Iacute=389,t.plusminus=570,t.brokenbar=220,t.registered=747,t.Gbreve=722,t.Idotaccent=389,t.summation=600,t.Egrave=667,t.racute=389,t.omacron=500,t.Zacute=611,t.Zcaron=611,t.greaterequal=549,t.Eth=722,t.Ccedilla=667,t.lcommaaccent=278,t.tcaron=366,t.eogonek=444,t.Uogonek=722,t.Aacute=667,t.Adieresis=667,t.egrave=444,t.zacute=389,t.iogonek=278,t.Oacute=722,t.oacute=500,t.amacron=500,t.sacute=389,t.idieresis=278,t.Ocircumflex=722,t.Ugrave=722,t.Delta=612,t.thorn=500,t.twosuperior=300,t.Odieresis=722,t.mu=576,t.igrave=278,t.ohungarumlaut=500,t.Eogonek=667,t.dcroat=500,t.threequarters=750,t.Scedilla=556,t.lcaron=382,t.Kcommaaccent=667,t.Lacute=611,t.trademark=1e3,t.edotaccent=444,t.Igrave=389,t.Imacron=389,t.Lcaron=611,t.onehalf=750,t.lessequal=549,t.ocircumflex=500,t.ntilde=556,t.Uhungarumlaut=722,t.Eacute=667,t.emacron=444,t.gbreve=500,t.onequarter=750,t.Scaron=556,t.Scommaaccent=556,t.Ohungarumlaut=722,t.degree=400,t.ograve=500,t.Ccaron=667,t.ugrave=556,t.radical=549,t.Dcaron=722,t.rcommaaccent=389,t.Ntilde=722,t.otilde=500,t.Rcommaaccent=667,t.Lcommaaccent=611,t.Atilde=667,t.Aogonek=667,t.Aring=667,t.Otilde=722,t.zdotaccent=389,t.Ecaron=667,t.Iogonek=389,t.kcommaaccent=500,t.minus=606,t.Icircumflex=389,t.ncaron=556,t.tcommaaccent=278,t.logicalnot=606,t.odieresis=500,t.udieresis=556,t.notequal=549,t.gcommaaccent=500,t.eth=500,t.zcaron=389,t.ncommaaccent=556,t.onesuperior=300,t.imacron=278,t.Euro=500}),t["Times-Italic"]=getLookupTableFactory(function(t){t.space=250,t.exclam=333,t.quotedbl=420,t.numbersign=500,t.dollar=500,t.percent=833,t.ampersand=778,t.quoteright=333,t.parenleft=333,t.parenright=333,t.asterisk=500,t.plus=675,t.comma=250,t.hyphen=333,t.period=250,t.slash=278,t.zero=500,t.one=500,t.two=500,t.three=500,t.four=500,t.five=500,t.six=500,t.seven=500,t.eight=500,t.nine=500,t.colon=333,t.semicolon=333,t.less=675,t.equal=675,t.greater=675,t.question=500,t.at=920,t.A=611,t.B=611,t.C=667,t.D=722,t.E=611,t.F=611,t.G=722,t.H=722,t.I=333,t.J=444,t.K=667,t.L=556,t.M=833,t.N=667,t.O=722,t.P=611,t.Q=722,t.R=611,t.S=500,t.T=556,t.U=722,t.V=611,t.W=833,t.X=611,t.Y=556,t.Z=556,t.bracketleft=389,t.backslash=278,t.bracketright=389,t.asciicircum=422,t.underscore=500,t.quoteleft=333,t.a=500,t.b=500,t.c=444,t.d=500,t.e=444,t.f=278,t.g=500,t.h=500,t.i=278,t.j=278,t.k=444,t.l=278,t.m=722,t.n=500,t.o=500,t.p=500,t.q=500,t.r=389,t.s=389,t.t=278,t.u=500,t.v=444,t.w=667,t.x=444,t.y=444,t.z=389,t.braceleft=400,t.bar=275,t.braceright=400,t.asciitilde=541,t.exclamdown=389,t.cent=500,t.sterling=500,t.fraction=167,t.yen=500,t.florin=500,t.section=500,t.currency=500,t.quotesingle=214,t.quotedblleft=556,t.guillemotleft=500,t.guilsinglleft=333,t.guilsinglright=333,t.fi=500,t.fl=500,t.endash=500,t.dagger=500,t.daggerdbl=500,t.periodcentered=250,t.paragraph=523,t.bullet=350,t.quotesinglbase=333,t.quotedblbase=556,t.quotedblright=556,t.guillemotright=500,t.ellipsis=889,t.perthousand=1e3,t.questiondown=500,t.grave=333,t.acute=333,t.circumflex=333,t.tilde=333,t.macron=333,t.breve=333,t.dotaccent=333,t.dieresis=333,t.ring=333,t.cedilla=333,t.hungarumlaut=333,t.ogonek=333,t.caron=333,t.emdash=889,t.AE=889,t.ordfeminine=276,t.Lslash=556,t.Oslash=722,t.OE=944,t.ordmasculine=310,t.ae=667,t.dotlessi=278,t.lslash=278,t.oslash=500,t.oe=667,t.germandbls=500,t.Idieresis=333,t.eacute=444,t.abreve=500,t.uhungarumlaut=500,t.ecaron=444,t.Ydieresis=556,t.divide=675,t.Yacute=556,t.Acircumflex=611,t.aacute=500,t.Ucircumflex=722,t.yacute=444,t.scommaaccent=389,t.ecircumflex=444,t.Uring=722,t.Udieresis=722,t.aogonek=500,t.Uacute=722,t.uogonek=500,t.Edieresis=611,t.Dcroat=722,t.commaaccent=250,t.copyright=760,t.Emacron=611,t.ccaron=444,t.aring=500,t.Ncommaaccent=667,t.lacute=278,t.agrave=500,t.Tcommaaccent=556,t.Cacute=667,t.atilde=500,t.Edotaccent=611,t.scaron=389,t.scedilla=389,t.iacute=278,t.lozenge=471,t.Rcaron=611,t.Gcommaaccent=722,t.ucircumflex=500,t.acircumflex=500,t.Amacron=611,t.rcaron=389,t.ccedilla=444,t.Zdotaccent=556,t.Thorn=611,t.Omacron=722,t.Racute=611,t.Sacute=500,t.dcaron=544,t.Umacron=722,t.uring=500,t.threesuperior=300,t.Ograve=722,t.Agrave=611,t.Abreve=611,t.multiply=675,t.uacute=500,t.Tcaron=556,t.partialdiff=476,t.ydieresis=444,t.Nacute=667,t.icircumflex=278,t.Ecircumflex=611,t.adieresis=500,t.edieresis=444,t.cacute=444,t.nacute=500,t.umacron=500,t.Ncaron=667,t.Iacute=333,t.plusminus=675,t.brokenbar=275,t.registered=760,t.Gbreve=722,t.Idotaccent=333,t.summation=600,t.Egrave=611,t.racute=389,t.omacron=500,t.Zacute=556,t.Zcaron=556,t.greaterequal=549,t.Eth=722,t.Ccedilla=667,t.lcommaaccent=278,t.tcaron=300,t.eogonek=444,t.Uogonek=722,t.Aacute=611,t.Adieresis=611,t.egrave=444,t.zacute=389,t.iogonek=278,t.Oacute=722,t.oacute=500,t.amacron=500,t.sacute=389,t.idieresis=278,t.Ocircumflex=722,t.Ugrave=722,t.Delta=612,t.thorn=500,t.twosuperior=300,t.Odieresis=722,t.mu=500,t.igrave=278,t.ohungarumlaut=500,t.Eogonek=611,t.dcroat=500,t.threequarters=750,t.Scedilla=500,t.lcaron=300,t.Kcommaaccent=667,t.Lacute=556,t.trademark=980,t.edotaccent=444,t.Igrave=333,t.Imacron=333,t.Lcaron=611,t.onehalf=750,t.lessequal=549,t.ocircumflex=500,t.ntilde=500,t.Uhungarumlaut=722,t.Eacute=611,t.emacron=444,t.gbreve=500,t.onequarter=750,t.Scaron=500,t.Scommaaccent=500,t.Ohungarumlaut=722,t.degree=400,t.ograve=500,t.Ccaron=667,t.ugrave=500,t.radical=453,t.Dcaron=722,t.rcommaaccent=389,t.Ntilde=667,t.otilde=500,t.Rcommaaccent=611,t.Lcommaaccent=556,t.Atilde=611,t.Aogonek=611,t.Aring=611,t.Otilde=722,t.zdotaccent=389,t.Ecaron=611,t.Iogonek=333,t.kcommaaccent=444,t.minus=675,t.Icircumflex=333,t.ncaron=500,t.tcommaaccent=278,t.logicalnot=675,t.odieresis=500,t.udieresis=500,t.notequal=549,t.gcommaaccent=500,t.eth=500,t.zcaron=389,t.ncommaaccent=500,t.onesuperior=300,t.imacron=278,t.Euro=500}),t.ZapfDingbats=getLookupTableFactory(function(t){t.space=278,t.a1=974,t.a2=961,t.a202=974,t.a3=980,t.a4=719,t.a5=789,t.a119=790,t.a118=791,t.a117=690,t.a11=960,t.a12=939,t.a13=549,t.a14=855,t.a15=911,t.a16=933,t.a105=911,t.a17=945,t.a18=974,t.a19=755,t.a20=846,t.a21=762,t.a22=761,t.a23=571,t.a24=677,t.a25=763,t.a26=760,t.a27=759,t.a28=754,t.a6=494,t.a7=552,t.a8=537,t.a9=577,t.a10=692,t.a29=786,t.a30=788,t.a31=788,t.a32=790,t.a33=793,t.a34=794,t.a35=816,t.a36=823,t.a37=789,t.a38=841,t.a39=823,t.a40=833,t.a41=816,t.a42=831,t.a43=923,t.a44=744,t.a45=723,t.a46=749,t.a47=790,t.a48=792,t.a49=695,t.a50=776,t.a51=768,t.a52=792,t.a53=759,t.a54=707,t.a55=708,t.a56=682,t.a57=701,t.a58=826,t.a59=815,t.a60=789,t.a61=789,t.a62=707,t.a63=687,t.a64=696,t.a65=689,t.a66=786,t.a67=787,t.a68=713,t.a69=791,t.a70=785,t.a71=791,t.a72=873,t.a73=761,t.a74=762,t.a203=762,t.a75=759,t.a204=759,t.a76=892,t.a77=892,t.a78=788,t.a79=784,t.a81=438,t.a82=138,t.a83=277,t.a84=415,t.a97=392,t.a98=392,t.a99=668,t.a100=668,t.a89=390,t.a90=390,t.a93=317,t.a94=317,t.a91=276,t.a92=276,t.a205=509,t.a85=509,t.a206=410,t.a86=410,t.a87=234,t.a88=234,t.a95=334,t.a96=334,t.a101=732,t.a102=544,t.a103=544,t.a104=910,t.a106=667,t.a107=760,t.a108=760,t.a112=776,t.a111=595,t.a110=694,t.a109=626,t.a120=788,t.a121=788,t.a122=788,t.a123=788,t.a124=788,t.a125=788,t.a126=788,t.a127=788,t.a128=788,t.a129=788,t.a130=788,t.a131=788,t.a132=788,t.a133=788,t.a134=788,t.a135=788,t.a136=788,t.a137=788,t.a138=788,t.a139=788,t.a140=788,t.a141=788,t.a142=788,t.a143=788,t.a144=788,t.a145=788,t.a146=788,t.a147=788,t.a148=788,t.a149=788,t.a150=788,t.a151=788,t.a152=788,t.a153=788,t.a154=788,t.a155=788,t.a156=788,t.a157=788,t.a158=788,t.a159=788,t.a160=894,t.a161=838,t.a163=1016,t.a164=458,t.a196=748,t.a165=924,t.a192=748,t.a166=918,t.a167=927,t.a168=928,t.a169=928,t.a170=834,t.a171=873,t.a172=828,t.a173=924,t.a162=924,t.a174=917,t.a175=930,t.a176=931,t.a177=463,t.a178=883,t.a179=836,t.a193=836,t.a180=867,t.a199=867,t.a181=696,t.a200=696,t.a182=874,t.a201=874,t.a183=760,t.a184=946,t.a197=771,t.a185=865,t.a194=771,t.a198=888,t.a186=967,t.a195=888,t.a187=831,t.a188=873,t.a189=927,t.a190=970,t.a191=918})}),Ma=getLookupTableFactory(function(t){t.Courier={ascent:629,descent:-157,capHeight:562,xHeight:-426},t["Courier-Bold"]={ascent:629,descent:-157,capHeight:562,xHeight:439},t["Courier-Oblique"]={ascent:629,descent:-157,capHeight:562,xHeight:426},t["Courier-BoldOblique"]={ascent:629,descent:-157,capHeight:562,xHeight:426},t.Helvetica={ascent:718,descent:-207,capHeight:718,xHeight:523},t["Helvetica-Bold"]={ascent:718,descent:-207,capHeight:718,xHeight:532},t["Helvetica-Oblique"]={ascent:718,descent:-207,capHeight:718,xHeight:523},t["Helvetica-BoldOblique"]={ascent:718,descent:-207,capHeight:718,xHeight:532},t["Times-Roman"]={ascent:683,descent:-217,capHeight:662,xHeight:450},t["Times-Bold"]={ascent:683,descent:-217,capHeight:676,xHeight:461},t["Times-Italic"]={ascent:683,descent:-217,capHeight:653,xHeight:441},t["Times-BoldItalic"]={ascent:683,descent:-217,capHeight:669,xHeight:462},t.Symbol={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN},t.ZapfDingbats={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN}}),Ea=class{constructor({glyfTable:t,isGlyphLocationsLong:e,locaTable:s,numGlyphs:i}){this.glyphs=[];const n=new DataView(s.buffer,s.byteOffset,s.byteLength),a=new DataView(t.buffer,t.byteOffset,t.byteLength),r=e?4:2;let o=e?n.getUint32(0):2*n.getUint16(0),l=0;for(let t=0;t<i;t++){l+=r;const t=e?n.getUint32(l):2*n.getUint16(l);if(t===o){this.glyphs.push(new Fa({}));continue}const s=Fa.parse(o,a);this.glyphs.push(s),o=t}}getSize(){return Math.sumPrecise(this.glyphs.map(t=>t.getSize()+3&-4))}write(){const t=this.getSize(),e=new DataView(new ArrayBuffer(t)),s=t>131070,i=s?4:2,n=new DataView(new ArrayBuffer((this.glyphs.length+1)*i));s?n.setUint32(0,0):n.setUint16(0,0);let a=0,r=0;for(const t of this.glyphs)a+=t.write(a,e),a=a+3&-4,r+=i,s?n.setUint32(r,a):n.setUint16(r,a>>1);return{isLocationLong:s,loca:new Uint8Array(n.buffer),glyf:new Uint8Array(e.buffer)}}scale(t){for(let e=0,s=this.glyphs.length;e<s;e++)this.glyphs[e].scale(t[e])}},Fa=class _Glyph{constructor({header:t=null,simple:e=null,composites:s=null}){this.header=t,this.simple=e,this.composites=s}static parse(t,e){const[s,i]=Da.parse(t,e);if(t+=s,i.numberOfContours<0){const s=[];for(;;){const[i,n]=Pa.parse(t,e);if(t+=i,s.push(n),!(32&n.flags))break}return new _Glyph({header:i,composites:s})}const n=Ba.parse(t,e,i.numberOfContours);return new _Glyph({header:i,simple:n})}getSize(){if(!this.header)return 0;const t=this.simple?this.simple.getSize():Math.sumPrecise(this.composites.map(t=>t.getSize()));return this.header.getSize()+t}write(t,e){if(!this.header)return 0;const s=t;if(t+=this.header.write(t,e),this.simple)t+=this.simple.write(t,e);else for(const s of this.composites)t+=s.write(t,e);return t-s}scale(t){if(!this.header)return;const e=(this.header.xMin+this.header.xMax)/2;if(this.header.scale(e,t),this.simple)this.simple.scale(e,t);else for(const s of this.composites)s.scale(e,t)}},Da=class _GlyphHeader{constructor({numberOfContours:t,xMin:e,yMin:s,xMax:i,yMax:n}){this.numberOfContours=t,this.xMin=e,this.yMin=s,this.xMax=i,this.yMax=n}static parse(t,e){return[10,new _GlyphHeader({numberOfContours:e.getInt16(t),xMin:e.getInt16(t+2),yMin:e.getInt16(t+4),xMax:e.getInt16(t+6),yMax:e.getInt16(t+8)})]}getSize(){return 10}write(t,e){return e.setInt16(t,this.numberOfContours),e.setInt16(t+2,this.xMin),e.setInt16(t+4,this.yMin),e.setInt16(t+6,this.xMax),e.setInt16(t+8,this.yMax),10}scale(t,e){this.xMin=Math.round(t+(this.xMin-t)*e),this.xMax=Math.round(t+(this.xMax-t)*e)}},Ra=class{constructor({flags:t,xCoordinates:e,yCoordinates:s}){this.xCoordinates=e,this.yCoordinates=s,this.flags=t}},Ba=class _SimpleGlyph{constructor({contours:t,instructions:e}){this.contours=t,this.instructions=e}static parse(t,e,s){const i=[];for(let n=0;n<s;n++){const s=e.getUint16(t);t+=2,i.push(s)}const n=i[s-1]+1,a=e.getUint16(t);t+=2;const r=new Uint8Array(e).slice(t,t+a);t+=a;const o=[];for(let s=0;s<n;t++,s++){let i=e.getUint8(t);if(o.push(i),8&i){const n=e.getUint8(++t);i^=8;for(let t=0;t<n;t++)o.push(i);s+=n}}const l=[];let c=[],h=[],u=[];const d=[];let f=0,g=0;for(let s=0;s<n;s++){const n=o[s];if(2&n){const s=e.getUint8(t++);g+=16&n?s:-s,c.push(g)}else 16&n||(g+=e.getInt16(t),t+=2),c.push(g);i[f]===s&&(f++,l.push(c),c=[])}g=0,f=0;for(let s=0;s<n;s++){const n=o[s];if(4&n){const s=e.getUint8(t++);g+=32&n?s:-s,h.push(g)}else 32&n||(g+=e.getInt16(t),t+=2),h.push(g);u.push(1&n|64&n),i[f]===s&&(c=l[f],f++,d.push(new Ra({flags:u,xCoordinates:c,yCoordinates:h})),h=[],u=[])}return new _SimpleGlyph({contours:d,instructions:r})}getSize(){let t=2*this.contours.length+2+this.instructions.length,e=0,s=0;for(const i of this.contours){t+=i.flags.length;for(let n=0,a=i.xCoordinates.length;n<a;n++){const a=i.xCoordinates[n],r=i.yCoordinates[n];let o=Math.abs(a-e);o>255?t+=2:o>0&&(t+=1),e=a,o=Math.abs(r-s),o>255?t+=2:o>0&&(t+=1),s=r}}return t}write(t,e){const s=t,i=[],n=[],a=[];let r=0,o=0;for(const s of this.contours){for(let t=0,e=s.xCoordinates.length;t<e;t++){let e=s.flags[t];const l=s.xCoordinates[t];let c=l-r;if(0===c)e|=16,i.push(0);else{const t=Math.abs(c);t<=255?(e|=c>=0?18:2,i.push(t)):i.push(c)}r=l;const h=s.yCoordinates[t];if(c=h-o,0===c)e|=32,n.push(0);else{const t=Math.abs(c);t<=255?(e|=c>=0?36:4,n.push(t)):n.push(c)}o=h,a.push(e)}e.setUint16(t,i.length-1),t+=2}e.setUint16(t,this.instructions.length),t+=2,this.instructions.length&&(new Uint8Array(e.buffer,0,e.buffer.byteLength).set(this.instructions,t),t+=this.instructions.length);for(const s of a)e.setUint8(t++,s);for(let s=0,n=i.length;s<n;s++){const n=i[s],r=a[s];2&r?e.setUint8(t++,n):16&r||(e.setInt16(t,n),t+=2)}for(let s=0,i=n.length;s<i;s++){const i=n[s],r=a[s];4&r?e.setUint8(t++,i):32&r||(e.setInt16(t,i),t+=2)}return t-s}scale(t,e){for(const s of this.contours)if(0!==s.xCoordinates.length)for(let i=0,n=s.xCoordinates.length;i<n;i++)s.xCoordinates[i]=Math.round(t+(s.xCoordinates[i]-t)*e)}},Pa=class _CompositeGlyph{constructor({flags:t,glyphIndex:e,argument1:s,argument2:i,transf:n,instructions:a}){this.flags=t,this.glyphIndex=e,this.argument1=s,this.argument2=i,this.transf=n,this.instructions=a}static parse(t,e){const s=t,i=[];let n=e.getUint16(t);const a=e.getUint16(t+2);let r,o;t+=4,1&n?(2&n?(r=e.getInt16(t),o=e.getInt16(t+2)):(r=e.getUint16(t),o=e.getUint16(t+2)),t+=4,n^=1):(2&n?(r=e.getInt8(t),o=e.getInt8(t+1)):(r=e.getUint8(t),o=e.getUint8(t+1)),t+=2),8&n?(i.push(e.getUint16(t)),t+=2):64&n?(i.push(e.getUint16(t),e.getUint16(t+2)),t+=4):128&n&&(i.push(e.getUint16(t),e.getUint16(t+2),e.getUint16(t+4),e.getUint16(t+6)),t+=8);let l=null;if(256&n){const s=e.getUint16(t);t+=2,l=new Uint8Array(e).slice(t,t+s),t+=s}return[t-s,new _CompositeGlyph({flags:n,glyphIndex:a,argument1:r,argument2:o,transf:i,instructions:l})]}getSize(){let t=4+2*this.transf.length;return 256&this.flags&&(t+=2+this.instructions.length),t+=2,2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(t+=2):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(t+=2),t}write(t,e){const s=t;return 2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(this.flags|=1):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(this.flags|=1),e.setUint16(t,this.flags),e.setUint16(t+2,this.glyphIndex),t+=4,1&this.flags?(2&this.flags?(e.setInt16(t,this.argument1),e.setInt16(t+2,this.argument2)):(e.setUint16(t,this.argument1),e.setUint16(t+2,this.argument2)),t+=4):(e.setUint8(t,this.argument1),e.setUint8(t+1,this.argument2),t+=2),256&this.flags&&(e.setUint16(t,this.instructions.length),t+=2,this.instructions.length&&(new Uint8Array(e.buffer,0,e.buffer.byteLength).set(this.instructions,t),t+=this.instructions.length)),t-s}scale(t,e){}};function writeInt16(t,e,s){t[e]=s>>8&255,t[e+1]=255&s}function writeInt32(t,e,s){t[e]=s>>24&255,t[e+1]=s>>16&255,t[e+2]=s>>8&255,t[e+3]=255&s}function writeData(t,e,s){if(s instanceof Uint8Array)t.set(s,e);else if("string"==typeof s)for(let i=0,n=s.length;i<n;i++)t[e++]=255&s.charCodeAt(i);else for(const i of s)t[e++]=255&i}var Na=class _OpenTypeFileBuilder{constructor(t){this.sfnt=t,this.tables=Object.create(null)}static getSearchParams(t,e){let s=1,i=0;for(;(s^t)>s;)s<<=1,i++;const n=s*e;return{range:n,entry:i,rangeShift:e*t-n}}toArray(){let t=this.sfnt;const e=this.tables,s=Object.keys(e);s.sort();const i=s.length;let n,a,r,o,l,c=12+16*i;const h=[c];for(n=0;n<i;n++)o=e[s[n]],c+=(o.length+3&-4)>>>0,h.push(c);const u=new Uint8Array(c);for(n=0;n<i;n++)o=e[s[n]],writeData(u,h[n],o);"true"===t&&(t=string32$1(65536)),u[0]=255&t.charCodeAt(0),u[1]=255&t.charCodeAt(1),u[2]=255&t.charCodeAt(2),u[3]=255&t.charCodeAt(3),writeInt16(u,4,i);const d=_OpenTypeFileBuilder.getSearchParams(i,16);for(writeInt16(u,6,d.range),writeInt16(u,8,d.entry),writeInt16(u,10,d.rangeShift),c=12,n=0;n<i;n++){l=s[n],u[c]=255&l.charCodeAt(0),u[c+1]=255&l.charCodeAt(1),u[c+2]=255&l.charCodeAt(2),u[c+3]=255&l.charCodeAt(3);let t=0;for(a=h[n],r=h[n+1];a<r;a+=4)t=t+readUint32(u,a)>>>0;writeInt32(u,c+4,t),writeInt32(u,c+8,h[n]),writeInt32(u,c+12,e[l].length),c+=16}return u}addTable(t,e){if(t in this.tables)throw new Error("Table "+t+" already exists");this.tables[t]=e}},Oa=[4],La=[5],Ua=[6],$a=[7],Ha=[8],ja=[12,35],qa=[14],za=[21],Ga=[22],Wa=[30],Va=[31],Xa=class{constructor(){this.width=0,this.lsb=0,this.flexing=!1,this.output=[],this.stack=[]}convert(t,e,s){const i=t.length;let n,a,r,o=!1;for(let l=0;l<i;l++){let i=t[l];if(i<32){switch(12===i&&(i=(i<<8)+t[++l]),i){case 1:case 3:case 9:case 3072:case 3073:case 3074:case 3105:this.stack=[];break;case 4:if(this.flexing){if(this.stack.length<1){o=!0;break}const t=this.stack.pop();this.stack.push(0,t);break}o=this.executeCommand(1,Oa);break;case 5:o=this.executeCommand(2,La);break;case 6:o=this.executeCommand(1,Ua);break;case 7:o=this.executeCommand(1,$a);break;case 8:o=this.executeCommand(6,Ha);break;case 10:if(this.stack.length<1){o=!0;break}if(r=this.stack.pop(),!e[r]){o=!0;break}o=this.convert(e[r],e,s);break;case 11:return o;case 13:if(this.stack.length<2){o=!0;break}n=this.stack.pop(),a=this.stack.pop(),this.lsb=a,this.width=n,this.stack.push(n,a),o=this.executeCommand(2,Ga);break;case 14:this.output.push(qa[0]);break;case 21:if(this.flexing)break;o=this.executeCommand(2,za);break;case 22:if(this.flexing){this.stack.push(0);break}o=this.executeCommand(1,Ga);break;case 30:o=this.executeCommand(4,Wa);break;case 31:o=this.executeCommand(4,Va);break;case 3078:if(s){const t=this.stack.at(-5);this.seac=this.stack.splice(-4,4),this.seac[0]+=this.lsb-t,o=this.executeCommand(0,qa)}else o=this.executeCommand(4,qa);break;case 3079:if(this.stack.length<4){o=!0;break}this.stack.pop(),n=this.stack.pop();const t=this.stack.pop();a=this.stack.pop(),this.lsb=a,this.width=n,this.stack.push(n,a,t),o=this.executeCommand(3,za);break;case 3084:if(this.stack.length<2){o=!0;break}const l=this.stack.pop(),c=this.stack.pop();this.stack.push(c/l);break;case 3088:if(this.stack.length<2){o=!0;break}r=this.stack.pop();const h=this.stack.pop();if(0===r&&3===h){const t=this.stack.splice(-17,17);this.stack.push(t[2]+t[0],t[3]+t[1],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14]),o=this.executeCommand(13,ja,!0),this.flexing=!1,this.stack.push(t[15],t[16])}else 1===r&&0===h&&(this.flexing=!0);break;case 3089:break;default:warn$1('Unknown type 1 charstring command of "'+i+'"')}if(o)break}else i<=246?i-=139:i=i<=250?256*(i-247)+t[++l]+108:i<=254?-256*(i-251)-t[++l]-108:(255&t[++l])<<24|(255&t[++l])<<16|(255&t[++l])<<8|255&t[++l],this.stack.push(i)}return o}executeCommand(t,e,s){const i=this.stack.length;if(t>i)return!0;const n=i-t;for(let t=n;t<i;t++){let e=this.stack[t];Number.isInteger(e)?this.output.push(28,e>>8&255,255&e):(e=65536*e|0,this.output.push(255,e>>24&255,e>>16&255,e>>8&255,255&e))}return this.output.push(...e),s?this.stack.splice(n,t):this.stack.length=0,!1}};function isHexDigit(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function decrypt(t,e,s){if(s>=t.length)return new Uint8Array(0);let i,n,a=0|e;for(i=0;i<s;i++)a=52845*(t[i]+a)+22719&65535;const r=t.length-s,o=new Uint8Array(r);for(i=s,n=0;n<r;i++,n++){const e=t[i];o[n]=e^a>>8,a=52845*(e+a)+22719&65535}return o}function isSpecial(t){return 47===t||91===t||93===t||123===t||125===t||40===t||41===t}var Ka=class{constructor(t,e,s){if(e){const e=t.getBytes(),s=!((isHexDigit(e[0])||isWhiteSpace(e[0]))&&isHexDigit(e[1])&&isHexDigit(e[2])&&isHexDigit(e[3])&&isHexDigit(e[4])&&isHexDigit(e[5])&&isHexDigit(e[6])&&isHexDigit(e[7]));t=new Ks(s?decrypt(e,55665,4):function(t,e,s){let i=0|e;const n=t.length,a=new Uint8Array(n>>>1);let r,o;for(r=0,o=0;r<n;r++){const e=t[r];if(!isHexDigit(e))continue;let s;for(r++;r<n&&!isHexDigit(s=t[r]);)r++;if(r<n){const t=parseInt(String.fromCharCode(e,s),16);a[o++]=t^i>>8,i=52845*(t+i)+22719&65535}}return a.slice(s,o)}(e,55665,4))}this.seacAnalysisEnabled=!!s,this.stream=t,this.nextChar()}readNumberArray(){this.getToken();const t=[];for(;;){const e=this.getToken();if(null===e||"]"===e||"}"===e)break;t.push(parseFloat(e||0))}return t}readNumber(){const t=this.getToken();return parseFloat(t||0)}readInt(){const t=this.getToken();return 0|parseInt(t||0,10)}readBoolean(){return"true"===this.getToken()?1:0}nextChar(){return this.currentChar=this.stream.getByte()}prevChar(){return this.stream.skip(-2),this.currentChar=this.stream.getByte()}getToken(){let t=!1,e=this.currentChar;for(;;){if(-1===e)return null;if(t)10!==e&&13!==e||(t=!1);else if(37===e)t=!0;else if(!isWhiteSpace(e))break;e=this.nextChar()}if(isSpecial(e))return this.nextChar(),String.fromCharCode(e);let s="";do{s+=String.fromCharCode(e),e=this.nextChar()}while(e>=0&&!isWhiteSpace(e)&&!isSpecial(e));return s}readCharStrings(t,e){return-1===e?t:decrypt(t,4330,e)}extractFontProgram(t){const e=this.stream,s=[],i=[],n=Object.create(null);n.lenIV=4;const a={subrs:[],charstrings:[],properties:{privateData:n}};let r,o,l,c;for(;null!==(r=this.getToken());)if("/"===r)switch(r=this.getToken(),r){case"CharStrings":for(this.getToken(),this.getToken(),this.getToken(),this.getToken();r=this.getToken(),null!==r&&"end"!==r;){if("/"!==r)continue;const t=this.getToken();o=this.readInt(),this.getToken(),l=o>0?e.getBytes(o):new Uint8Array(0),c=a.properties.privateData.lenIV;const s=this.readCharStrings(l,c);this.nextChar(),r=this.getToken(),"noaccess"===r?this.getToken():"/"===r&&this.prevChar(),i.push({glyph:t,encoded:s})}break;case"Subrs":for(this.readInt(),this.getToken();"dup"===this.getToken();){const t=this.readInt();o=this.readInt(),this.getToken(),l=o>0?e.getBytes(o):new Uint8Array(0),c=a.properties.privateData.lenIV;const i=this.readCharStrings(l,c);this.nextChar(),r=this.getToken(),"noaccess"===r&&this.getToken(),s[t]=i}break;case"BlueValues":case"OtherBlues":case"FamilyBlues":case"FamilyOtherBlues":const t=this.readNumberArray();t.length>0&&t.length;break;case"StemSnapH":case"StemSnapV":a.properties.privateData[r]=this.readNumberArray();break;case"StdHW":case"StdVW":a.properties.privateData[r]=this.readNumberArray()[0];break;case"BlueShift":case"lenIV":case"BlueFuzz":case"BlueScale":case"LanguageGroup":a.properties.privateData[r]=this.readNumber();break;case"ExpansionFactor":a.properties.privateData[r]=this.readNumber()||.06;break;case"ForceBold":a.properties.privateData[r]=this.readBoolean()}for(const{encoded:e,glyph:n}of i){const i=new Xa,r=i.convert(e,s,this.seacAnalysisEnabled);let o=i.output;r&&(o=[14]);const l={glyphName:n,charstring:o,width:i.width,lsb:i.lsb,seac:i.seac};if(".notdef"===n?a.charstrings.unshift(l):a.charstrings.push(l),t.builtInEncoding){const e=t.builtInEncoding.indexOf(n);e>-1&&void 0===t.widths[e]&&e>=t.firstChar&&e<=t.lastChar&&(t.widths[e]=i.width)}}return a}extractFontHeader(t){let e;for(;null!==(e=this.getToken());)if("/"===e)switch(e=this.getToken(),e){case"FontMatrix":const s=this.readNumberArray();t.fontMatrix=s;break;case"Encoding":const i=this.getToken();let n;if(/^\d+$/.test(i)){n=[];const t=0|parseInt(i,10);this.getToken();for(let s=0;s<t;s++){for(e=this.getToken();"dup"!==e&&"def"!==e;)if(e=this.getToken(),null===e)return;if("def"===e)break;const t=this.readInt();this.getToken();const s=this.getToken();n[t]=s,this.getToken()}}else n=getEncoding(i);t.builtInEncoding=n;break;case"FontBBox":const a=this.readNumberArray();t.ascent=Math.max(a[3],a[1]),t.descent=Math.min(a[1],a[3]),t.ascentScaled=!0}}};function findBlock(t,e,s){const i=t.length,n=e.length,a=i-n;let r=s,o=!1;for(;r<a;){let s=0;for(;s<n&&t[r+s]===e[s];)s++;if(s>=n){for(r+=s;r<i&&isWhiteSpace(t[r]);)r++;o=!0;break}r++}return{found:o,length:r}}var Ya=class{constructor(t,e,s){let i=s.length1;s.length2;let n=e.peekBytes(6);const a=128===n[0]&&1===n[1];a&&(e.skip(6),i=n[5]<<24|n[4]<<16|n[3]<<8|n[2]);const r=function(t,e){const s=[101,101,120,101,99],i=t.pos;let n,a,r,o;try{n=t.getBytes(e),a=n.length}catch{}if(a===e&&(r=findBlock(n,s,e-2*s.length),r.found&&r.length===e))return{stream:new Ks(n),length:e};for(warn$1('Invalid "Length1" property in Type1 font -- trying to recover.'),t.pos=i;r=findBlock(t.peekBytes(2048),s,0),0!==r.length;)if(t.pos+=r.length,r.found){o=t.pos-i;break}return t.pos=i,o?{stream:new Ks(t.getBytes(o)),length:o}:(warn$1('Unable to recover "Length1" property in Type1 font -- using as is.'),{stream:new Ks(t.getBytes(e)),length:e})}(e,i);new Ka(r.stream,!1,Nn).extractFontHeader(s),a&&(n=e.getBytes(6),n[5],n[4],n[3],n[2]);const o=function(t){const e=t.getBytes();if(0===e.length)throw new Ze("getEexecBlock - no font program found.");return{stream:new Ks(e),length:e.length}}(e),l=new Ka(o.stream,!0,Nn).extractFontProgram(s);for(const t in l.properties)s[t]=l.properties[t];const c=l.charstrings,h=this.getType2Charstrings(c),u=this.getType2Subrs(l.subrs);this.charstrings=c,this.data=this.wrap(t,h,this.charstrings,u,s),this.seacs=this.getSeacs(l.charstrings)}get numGlyphs(){return this.charstrings.length+1}getCharset(){const t=[".notdef"];for(const{glyphName:e}of this.charstrings)t.push(e);return t}getGlyphMapping(t){const e=this.charstrings;if(t.composite){const s=Object.create(null);for(let i=0,n=e.length;i<n;i++)s[t.cMap.charCodeOf(i)]=i+1;return s}const s=[".notdef"];let i,n;for(n=0;n<e.length;n++)s.push(e[n].glyphName);const a=t.builtInEncoding;if(a){i=Object.create(null);for(const t in a)n=s.indexOf(a[t]),n>=0&&(i[t]=n)}return type1FontGlyphMapping(t,i,s)}hasGlyphId(t){return!(t<0||t>=this.numGlyphs)&&(0===t||this.charstrings[t-1].charstring.length>0)}getSeacs(t){const e=[];for(let s=0,i=t.length;s<i;s++){const i=t[s];i.seac&&(e[s+1]=i.seac)}return e}getType2Charstrings(t){const e=[];for(const s of t)e.push(s.charstring);return e}getType2Subrs(t){let e=0;const s=t.length;e=s<1133?107:s<33769?1131:32768;const i=[];let n;for(n=0;n<e;n++)i.push([11]);for(n=0;n<s;n++)i.push(t[n]);return i}wrap(t,e,s,i,n){const a=new Jn;a.header=new Zn(1,0,4,4),a.names=[t];const r=new ia;r.setByName("version",391),r.setByName("Notice",392),r.setByName("FullName",393),r.setByName("FamilyName",394),r.setByName("Weight",395),r.setByName("Encoding",null),r.setByName("FontMatrix",n.fontMatrix),r.setByName("FontBBox",n.bbox),r.setByName("charset",null),r.setByName("CharStrings",null),r.setByName("Private",null),a.topDict=r;const o=new Qn;o.add("Version 0.11"),o.add("See original notice"),o.add(t),o.add(t),o.add("Medium"),a.strings=o,a.globalSubrIndex=new ta;const l=e.length,c=[".notdef"];let h,u;for(h=0;h<l;h++){const t=s[h].glyphName;-1===Wn.indexOf(t)&&o.add(t),c.push(t)}a.charset=new oa(!1,0,c);const d=new ta;for(d.add([139,14]),h=0;h<l;h++)d.add(e[h]);a.charStrings=d;const f=new aa;f.setByName("Subrs",null);const g=["BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StemSnapH","StemSnapV","BlueShift","BlueFuzz","BlueScale","LanguageGroup","ExpansionFactor","ForceBold","StdHW","StdVW"];for(h=0,u=g.length;h<u;h++){const t=g[h];if(!(t in n.privateData))continue;const e=n.privateData[t];if(Array.isArray(e))for(let t=e.length-1;t>0;t--)e[t]-=e[t-1];f.setByName(t,e)}a.topDict.privateDict=f;const p=new ta;for(h=0,u=i.length;h<u;h++)p.add(i[h]);return f.subrsIndex=p,new ua(a).compile()}},Ja=[[57344,63743],[1048576,1114109]],Za=1e3,Qa=["ascent","bbox","black","bold","charProcOperatorList","cssFontInfo","data","defaultVMetrics","defaultWidth","descent","disableFontFace","fallbackName","fontExtraProperties","fontMatrix","isInvalidPDFjsFont","isType3Font","italic","loadedName","mimetype","missingFile","name","remeasure","systemFontInfo","vertical"],tr=["cMap","composite","defaultEncoding","differences","isMonospace","isSerifFont","isSymbolicFont","seacMap","subtype","toFontChar","toUnicode","type","vmetrics","widths"];function adjustWidths(t){if(!t.fontMatrix)return;if(t.fontMatrix[0]===s[0])return;const e=.001/t.fontMatrix[0],i=t.widths;for(const t in i)i[t]*=e;t.defaultWidth*=e}function amendFallbackToUnicode(t){if(!t.fallbackToUnicode)return;if(t.toUnicode instanceof va)return;const e=[];for(const s in t.fallbackToUnicode)t.toUnicode.has(s)||(e[s]=t.fallbackToUnicode[s]);e.length>0&&t.toUnicode.amend(e)}var er=class{constructor(t,e,s,i,n,a,r,o,l){this.originalCharCode=t,this.fontChar=e,this.unicode=s,this.accent=i,this.width=n,this.vmetric=a,this.operatorListId=r,this.isSpace=o,this.isInFont=l}get category(){return shadow$1(this,"category",function(t){const e=Pn.get(t);if(e)return e;const s=t.match(Bn),i={isWhitespace:!!s?.[1],isZeroWidthDiacritic:!!s?.[2],isInvisibleFormatMark:!!s?.[3]};return Pn.set(t,i),i}(this.unicode),!0)}};function int16(t,e){return(t<<8)+e}function writeSignedInt16(t,e,s){t[e+1]=s,t[e]=s>>>8}function signedInt16(t,e){const s=(t<<8)+e;return 32768&s?s-65536:s}function string16(t){return String.fromCharCode(t>>8&255,255&t)}function safeString16(t){return t>32767?t=32767:t<-32768&&(t=-32768),String.fromCharCode(t>>8&255,255&t)}function isTrueTypeCollectionFile(t){return"ttcf"===bytesToString$1(t.peekBytes(4))}function getFontFileType(t,{type:e,subtype:s,composite:i}){let n,a;return function(t){const e=t.peekBytes(4);return 65536===readUint32(e,0)||"true"===bytesToString$1(e)}(t)||isTrueTypeCollectionFile(t)?n=i?"CIDFontType2":"TrueType":function(t){return"OTTO"===bytesToString$1(t.peekBytes(4))}(t)?n=i?"CIDFontType2":"OpenType":function(t){const e=t.peekBytes(2);return 37===e[0]&&33===e[1]||128===e[0]&&1===e[1]}(t)?n=i?"CIDFontType0":"MMType1"===e?"MMType1":"Type1":function(t){const e=t.peekBytes(4);return e[0]>=1&&e[3]>=1&&e[3]<=4}(t)?i?(n="CIDFontType0",a="CIDFontType0C"):(n="MMType1"===e?"MMType1":"Type1",a="Type1C"):(warn$1("getFontFileType: Unable to detect correct font file Type/Subtype."),n=e,a=s),[n,a]}function applyStandardFontGlyphMap(t,e){for(const s in e)t[+s]=e[s]}function buildToFontChar(t,e,s){const i=[];let n;for(let s=0,a=t.length;s<a;s++)n=getUnicodeForGlyph(t[s],e),-1!==n&&(i[s]=n);for(const t in s)n=getUnicodeForGlyph(s[t],e),-1!==n&&(i[+t]=n);return i}function isMacNameRecord(t){return 1===t.platform&&0===t.encoding&&0===t.language}function isWinNameRecord(t){return 3===t.platform&&1===t.encoding&&1033===t.language}function convertCidString(t,e,s=!1){switch(e.length){case 1:return e.charCodeAt(0);case 2:return e.charCodeAt(0)<<8|e.charCodeAt(1)}const i=`Unsupported CID string (charCode ${t}): "${e}".`;if(s)throw new Ze(i);return warn$1(i),e}function adjustMapping(t,e,s,i){const n=Object.create(null),a=new Map,r=[],o=new Set;let l=0,c=Ja[l][0],h=Ja[l][1];const isInPrivateArea=t=>Ja[0][0]<=t&&t<=Ja[0][1]||Ja[1][0]<=t&&t<=Ja[1][1];let u=null;for(const d in t){let f=t[d];if(!e(f))continue;if(c>h){if(l++,l>=Ja.length){warn$1("Ran out of space in font private use area.");break}c=Ja[l][0],h=Ja[l][1]}const g=c++;0===f&&(f=s);let p=i.get(d);if("string"==typeof p)if(1===p.length)p=p.codePointAt(0);else{if(!u){u=new Map;for(let t=64256;t<=64335;t++){const e=String.fromCharCode(t).normalize("NFKD");e.length>1&&u.set(e,t)}}p=u.get(p)||p.codePointAt(0)}!p||isInPrivateArea(p)||o.has(f)||(a.set(p,f),o.add(f)),n[g]=f,r[d]=g}return{toFontChar:r,charCodeToGlyphId:n,toUnicodeExtraMap:a,nextAvailableFontCharCode:c}}function createCmapTable(t,e,s){const i=function(t,e,s){const i=[];for(const e in t)t[e]>=s||i.push({fontCharCode:0|e,glyphId:t[e]});if(e)for(const[t,n]of e)n>=s||i.push({fontCharCode:t,glyphId:n});0===i.length&&i.push({fontCharCode:0,glyphId:0}),i.sort((t,e)=>t.fontCharCode-e.fontCharCode);const n=[],a=i.length;for(let t=0;t<a;){const e=i[t].fontCharCode,s=[i[t].glyphId];++t;let r=e;for(;t<a&&r+1===i[t].fontCharCode&&(s.push(i[t].glyphId),++r,++t,65535!==r););n.push([e,r,s])}return n}(t,e,s),n=i.at(-1)[1]>65535?2:1;let a,r,o,l,c="\0\0"+string16(n)+"\0\0"+string32$1(4+8*n);for(a=i.length-1;a>=0&&!(i[a][0]<=65535);--a);const h=a+1;i[a][0]<65535&&65535===i[a][1]&&(i[a][1]=65534);const u=i[a][1]<65535?1:0,d=h+u,f=Na.getSearchParams(d,2);let g,p,m,b,w="",y="",x="",v="",A="",k=0;for(a=0,r=h;a<r;a++){g=i[a],p=g[0],m=g[1],w+=string16(p),y+=string16(m),b=g[2];let t=!0;for(o=1,l=b.length;o<l;++o)if(b[o]!==b[o-1]+1){t=!1;break}if(t)x+=string16(b[0]-p&65535),v+=string16(0);else{const t=2*(d-a)+2*k;for(k+=m-p+1,x+=string16(0),v+=string16(t),o=0,l=b.length;o<l;++o)A+=string16(b[o])}}u>0&&(y+="ÿÿ",w+="ÿÿ",x+="\0",v+="\0\0");const S="\0\0"+string16(2*d)+string16(f.range)+string16(f.entry)+string16(f.rangeShift)+y+"\0\0"+w+x+v+A;let C="",_="";if(n>1){for(c+="\0\0\n"+string32$1(4+8*n+4+S.length),C="",a=0,r=i.length;a<r;a++){g=i[a],p=g[0],b=g[2];let t=b[0];for(o=1,l=b.length;o<l;++o)b[o]!==b[o-1]+1&&(m=g[0]+o-1,C+=string32$1(p)+string32$1(m)+string32$1(t),p=m+1,t=b[o]);C+=string32$1(p)+string32$1(g[1])+string32$1(t)}_="\0\f\0\0"+string32$1(C.length+16)+"\0\0\0\0"+string32$1(C.length/12)}return c+"\0"+string16(S.length+4)+S+_+C}function createOS2Table(t,e,s){s||={unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0};let i=0,n=0,a=0,r=0,o=null,l=0,c=-1;if(e){for(let t in e)if(t|=0,(o>t||!o)&&(o=t),l<t&&(l=t),c=getUnicodeRangeFor(t,c),c<32)i|=1<<c;else if(c<64)n|=1<<c-32;else if(c<96)a|=1<<c-64;else{if(!(c<123))throw new Ze("Unicode ranges Bits > 123 are reserved for internal usage");r|=1<<c-96}l>65535&&(l=65535)}else o=0,l=255;const h=t.bbox||[0,0,0,0],u=s.unitsPerEm||(t.fontMatrix?1/Math.max(...t.fontMatrix.slice(0,4).map(Math.abs)):1e3),d=t.ascentScaled?1:u/Za,f=s.ascent||Math.round(d*(t.ascent||h[3]));let g=s.descent||Math.round(d*(t.descent||h[1]));g>0&&t.descent>0&&h[1]<0&&(g=-g);const p=s.yMax||f,m=-s.yMin||-g;return"\0$ô\0\0\0Š»\0\0\0ŒŠ»\0\0ß\x001\0\0\0\0"+String.fromCharCode(t.fixedPitch?9:0)+"\0\0\0\0\0\0"+string32$1(i)+string32$1(n)+string32$1(a)+string32$1(r)+"*21*"+string16(t.italicAngle?1:0)+string16(o||t.firstChar)+string16(l||t.lastChar)+string16(f)+string16(g)+"\0d"+string16(p)+string16(m)+"\0\0\0\0\0\0\0\0"+string16(t.xHeight)+string16(t.capHeight)+string16(0)+string16(o||t.firstChar)+"\0"}function createPostTable(t){return"\0\0\0"+string32$1(Math.floor(65536*t.italicAngle))+"\0\0\0\0"+string32$1(t.fixedPitch?1:0)+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}function createPostscriptName(t){return t.replaceAll(/[^\x21-\x7E]|[[\](){}<>/%]/g,"").slice(0,63)}function createNameTable(t,e){e||(e=[[],[]]);const s=[e[0][0]||"Original licence",e[0][1]||t,e[0][2]||"Unknown",e[0][3]||"uniqueID",e[0][4]||t,e[0][5]||"Version 0.11",e[0][6]||createPostscriptName(t),e[0][7]||"Unknown",e[0][8]||"Unknown",e[0][9]||"Unknown"],i=[];let n,a,r,o,l;for(n=0,a=s.length;n<a;n++){l=e[1][n]||s[n];const t=[];for(r=0,o=l.length;r<o;r++)t.push(string16(l.charCodeAt(r)));i.push(t.join(""))}const c=[s,i],h=["\0","\0"],u=["\0\0","\0"],d=["\0\0","\t"],f=s.length*h.length;let g="\0\0"+string16(f)+string16(12*f+6),p=0;for(n=0,a=h.length;n<a;n++){const t=c[n];for(r=0,o=t.length;r<o;r++)l=t[r],g+=h[n]+u[n]+d[n]+string16(r)+string16(l.length)+string16(p),p+=l.length}return g+=s.join("")+i.join(""),g}var sr=class{constructor(t,e,s,i){this.name=t,this.psName=null,this.mimetype=null,this.disableFontFace=i.disableFontFace,this.fontExtraProperties=i.fontExtraProperties,this.loadedName=s.loadedName,this.isType3Font=s.isType3Font,this.missingFile=!1,this.cssFontInfo=s.cssFontInfo,this._charsCache=Object.create(null),this._glyphCache=Object.create(null);let n=!!(s.flags&Ln);if(!n&&!s.isSimulatedFlags){const e=da(),s=ga(),i=pa();for(const a of t.split("+")){let t=a.replaceAll(/[,_]/g,"-");if(t=e[t]||s[t]||t,t=t.split("-",1)[0],i[t]){n=!0;break}}}this.isSerifFont=n,this.isSymbolicFont=!!(s.flags&Un),this.isMonospace=!!(s.flags&On);let{type:a,subtype:r}=s;this.type=a,this.subtype=r,this.systemFontInfo=s.systemFontInfo;const o=t.match(/^InvalidPDFjsFont_(.*)_\d+$/);if(this.isInvalidPDFjsFont=!!o,this.isInvalidPDFjsFont?this.fallbackName=o[1]:this.isMonospace?this.fallbackName="monospace":this.isSerifFont?this.fallbackName="serif":this.fallbackName="sans-serif",this.systemFontInfo?.guessFallback&&(this.systemFontInfo.guessFallback=!1,this.systemFontInfo.css+=`,${this.fallbackName}`),this.differences=s.differences,this.widths=s.widths,this.defaultWidth=s.defaultWidth,this.composite=s.composite,this.cMap=s.cMap,this.capHeight=s.capHeight/Za,this.ascent=s.ascent/Za,this.descent=s.descent/Za,this.lineHeight=this.ascent-this.descent,this.fontMatrix=s.fontMatrix,this.bbox=s.bbox,this.defaultEncoding=s.defaultEncoding,this.toUnicode=s.toUnicode,this.toFontChar=[],"Type3"===s.type){for(let t=0;t<256;t++)this.toFontChar[t]=this.differences[t]||s.defaultEncoding[t];return}if(this.cidEncoding=s.cidEncoding||"",this.vertical=!!s.vertical,this.vertical&&(this.vmetrics=s.vmetrics,this.defaultVMetrics=s.defaultVMetrics),!e||e.isEmpty)return e&&warn$1('Font file is empty in "'+t+'" ('+this.loadedName+")"),void this.fallbackToSystemFont(s);let l;[a,r]=getFontFileType(e,s),a===this.type&&r===this.subtype||info$1(`Inconsistent font file Type/SubType, expected: ${this.type}/${this.subtype} but found: ${a}/${r}.`);try{switch(a){case"MMType1":info$1("MMType1 font ("+t+"), falling back to Type1.");case"Type1":case"CIDFontType0":this.mimetype="font/opentype";const i="Type1C"===r||"CIDFontType0C"===r?new Aa(e,s):new Ya(t,e,s);adjustWidths(s),l=this.convert(t,i,s);break;case"OpenType":case"TrueType":case"CIDFontType2":this.mimetype="font/opentype",l=this.checkAndRepair(t,e,s),adjustWidths(s),this.isOpenType&&(a="OpenType");break;default:throw new Ze(`Font ${a} is not supported`)}}catch(t){return warn$1(t),void this.fallbackToSystemFont(s)}amendFallbackToUnicode(s),this.data=l,this.type=a,this.subtype=r,this.fontMatrix=s.fontMatrix,this.widths=s.widths,this.defaultWidth=s.defaultWidth,this.toUnicode=s.toUnicode,this.seacMap=s.seacMap}get renderer(){return shadow$1(this,"renderer",Ia.create(this,Nn))}exportData(){const t=Object.create(null);for(const e of Qa){const s=this[e];void 0!==s&&(t[e]=s)}if(!this.fontExtraProperties)return{data:t};const e=Object.create(null);for(const t of tr){const s=this[t];void 0!==s&&(e[t]=s)}return{data:t,extra:e}}fallbackToSystemFont(t){this.missingFile=!0;const{name:e,type:s}=this;let i=normalizeFontName(e);const n=da(),a=ga(),r=!!n[i],o=!(!a[i]||!n[a[i]]);i=n[i]||a[i]||i;const l=Ma()[i];l&&(isNaN(this.ascent)&&(this.ascent=l.ascent/Za),isNaN(this.descent)&&(this.descent=l.descent/Za),isNaN(this.capHeight)&&(this.capHeight=l.capHeight/Za)),this.bold=/bold/gi.test(i),this.italic=/oblique|italic/gi.test(i),this.black=/Black/g.test(e);const c=/Narrow/g.test(e);if(this.remeasure=(!r||c)&&Object.keys(this.widths).length>0,(r||o)&&"CIDFontType2"===s&&this.cidEncoding.startsWith("Identity-")){const s=t.cidToGidMap,i=[];if(applyStandardFontGlyphMap(i,ba()),/Arial-?Black/i.test(e)?applyStandardFontGlyphMap(i,wa()):/Calibri/i.test(e)&&applyStandardFontGlyphMap(i,ya()),s){for(const t in i){const e=i[t];void 0!==s[e]&&(i[+t]=s[e])}s.length!==this.toUnicode.length&&t.hasIncludedToUnicodeMap&&this.toUnicode instanceof va&&this.toUnicode.forEach(function(t,e){const n=i[t];void 0===s[n]&&(i[+t]=e)})}this.toUnicode instanceof va||this.toUnicode.forEach(function(t,e){i[+t]=e}),this.toFontChar=i,this.toUnicode=new xa(i)}else if(/Symbol/i.test(i))this.toFontChar=buildToFontChar(Tn,En(),this.differences);else if(/Dingbats/i.test(i))this.toFontChar=buildToFontChar(Mn,Fn(),this.differences);else if(r||o){const t=buildToFontChar(this.defaultEncoding,En(),this.differences);"CIDFontType2"!==s||this.cidEncoding.startsWith("Identity-")||this.toUnicode instanceof va||this.toUnicode.forEach(function(e,s){t[+e]=s}),this.toFontChar=t}else{const t=En(),s=[];this.toUnicode.forEach((e,i)=>{if(!this.composite){const s=getUnicodeForGlyph(this.differences[e]||this.defaultEncoding[e],t);-1!==s&&(i=s)}s[+e]=i}),this.composite&&this.toUnicode instanceof va&&/Tahoma|Verdana/i.test(e)&&applyStandardFontGlyphMap(s,ba()),this.toFontChar=s}amendFallbackToUnicode(t),this.loadedName=i.split("-",1)[0]}checkAndRepair(t,e,s){const i=["OS/2","cmap","head","hhea","hmtx","maxp","name","post","loca","glyf","fpgm","prep","cvt ","CFF "];function readTables(t,e){const s=Object.create(null);s["OS/2"]=null,s.cmap=null,s.head=null,s.hhea=null,s.hmtx=null,s.maxp=null,s.name=null,s.post=null;for(let n=0;n<e;n++){const e=readTableEntry(t);i.includes(e.tag)&&0!==e.length&&(s[e.tag]=e)}return s}function readTableEntry(t){const e=t.getString(4),s=t.getInt32()>>>0,i=t.getInt32()>>>0,n=t.getInt32()>>>0,a=t.pos;t.pos=t.start||0,t.skip(i);const r=t.getBytes(n);return t.pos=a,"head"===e&&(r[8]=r[9]=r[10]=r[11]=0,r[17]|=32),{tag:e,checksum:s,length:n,offset:i,data:r}}function readOpenTypeHeader(t){return{version:t.getString(4),numTables:t.getUint16(),searchRange:t.getUint16(),entrySelector:t.getUint16(),rangeShift:t.getUint16()}}function sanitizeGlyph(t,e,s,i,n,a){const r={length:0,sizeOfInstructions:0};if(e<0||e>=t.length||s>t.length||s-e<=12)return r;const o=t.subarray(e,s),l=signedInt16(o[2],o[3]),c=signedInt16(o[4],o[5]),h=signedInt16(o[6],o[7]),u=signedInt16(o[8],o[9]);l>h&&(writeSignedInt16(o,2,h),writeSignedInt16(o,6,l)),c>u&&(writeSignedInt16(o,4,u),writeSignedInt16(o,8,c));const d=signedInt16(o[0],o[1]);if(d<0)return d<-1||(i.set(o,n),r.length=o.length),r;let f,g=10,p=0;for(f=0;f<d;f++)p=1+(o[g]<<8|o[g+1]),g+=2;const m=g,b=o[g]<<8|o[g+1];r.sizeOfInstructions=b,g+=2+b;const w=g;let y=0;for(f=0;f<p;f++){const t=o[g++];192&t&&(o[g-1]=63&t);let e=2;2&t?e=1:16&t&&(e=0);let s=2;4&t?s=1:32&t&&(s=0);const i=e+s;if(y+=i,8&t){const t=o[g++];0===t&&(o[g-1]^=8),f+=t,y+=t*i}}if(0===y)return r;let x=g+y;return x>o.length?r:!a&&b>0?(i.set(o.subarray(0,m),n),i.set([0,0],n+m),i.set(o.subarray(w,x),n+m+2),x-=b,o.length-x>3&&(x=x+3&-4),r.length=x,r):o.length-x>3?(x=x+3&-4,i.set(o.subarray(0,x),n),r.length=x,r):(i.set(o,n),r.length=o.length,r)}function readNameTable(t){const s=(e.start||0)+t.offset;e.pos=s;const i=[[],[]],n=[],a=t.length,r=s+a;if(0!==e.getUint16()||a<6)return[i,n];const o=e.getUint16(),l=e.getUint16();let c,h;for(c=0;c<o&&e.pos+12<=r;c++){const t={platform:e.getUint16(),encoding:e.getUint16(),language:e.getUint16(),name:e.getUint16(),length:e.getUint16(),offset:e.getUint16()};(isMacNameRecord(t)||isWinNameRecord(t))&&n.push(t)}for(c=0,h=n.length;c<h;c++){const t=n[c];if(t.length<=0)continue;const a=s+l+t.offset;if(a+t.length>r)continue;e.pos=a;const o=t.name;if(t.encoding){let s="";for(let i=0,n=t.length;i<n;i+=2)s+=String.fromCharCode(e.getUint16());i[1][o]=s}else i[0][o]=e.getString(t.length)}return[i,n]}const n=[0,0,0,0,0,0,0,0,-2,-2,-2,-2,0,0,-2,-5,-1,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,-1,-1,1,-1,-999,0,1,0,-1,-2,0,-1,-2,-1,-1,0,-1,-1,0,0,-999,-999,-1,-1,-1,-1,-2,-999,-2,-2,-999,0,-2,-2,0,0,-2,0,-2,0,0,0,-2,-1,-1,1,1,0,0,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,0,-999,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,-2,-999,-999,-999,-999,-999,-1,-1,-2,-2,0,0,0,0,-1,-1,-999,-2,-2,0,0,-1,-2,-2,0,0,0,-1,-1,-1,-2];function sanitizeTTProgram(t,e){let s,i,a,r,o,l=t.data,c=0,h=0,u=0;const d=[],f=[],g=[];let p=e.tooComplexToFollowFunctions,m=!1,b=0,w=0;for(let t=l.length;c<t;){const t=l[c++];if(64===t)if(i=l[c++],m||w)c+=i;else for(s=0;s<i;s++)d.push(l[c++]);else if(65===t)if(i=l[c++],m||w)c+=2*i;else for(s=0;s<i;s++)a=l[c++],d.push(a<<8|l[c++]);else if(176==(248&t))if(i=t-176+1,m||w)c+=i;else for(s=0;s<i;s++)d.push(l[c++]);else if(184==(248&t))if(i=t-184+1,m||w)c+=2*i;else for(s=0;s<i;s++)a=l[c++],d.push(signedInt16(a,l[c++]));else if(43!==t||p)if(44!==t||p){if(45===t)if(m)m=!1,h=c;else{if(o=f.pop(),!o)return warn$1("TT: ENDF bad stack"),void(e.hintsValid=!1);r=g.pop(),l=o.data,c=o.i,e.functionsStackDeltas[r]=d.length-o.stackTop}else if(137===t)(m||w)&&(warn$1("TT: nested IDEFs not allowed"),p=!0),m=!0,u=c;else if(88===t)++b;else if(27===t)w=b;else if(89===t)w===b&&(w=0),--b;else if(28===t&&!m&&!w){const t=d.at(-1);t>0&&(c+=t-1)}}else(m||w)&&(warn$1("TT: nested FDEFs not allowed"),p=!0),m=!0,u=c,r=d.pop(),e.functionsDefined[r]={data:l,i:c};else if(!m&&!w)if(r=d.at(-1),isNaN(r))info$1("TT: CALL empty stack (or invalid entry).");else if(e.functionsUsed[r]=!0,r in e.functionsStackDeltas){const t=d.length+e.functionsStackDeltas[r];if(t<0)return warn$1("TT: CALL invalid functions stack delta."),void(e.hintsValid=!1);d.length=t}else if(r in e.functionsDefined&&!g.includes(r)){if(f.push({data:l,i:c,stackTop:d.length-1}),g.push(r),o=e.functionsDefined[r],!o)return warn$1("TT: CALL non-existent function"),void(e.hintsValid=!1);l=o.data,c=o.i}if(!m&&!w){let e=0;for(t<=142?e=n[t]:t>=192&&t<=223?e=-1:t>=224&&(e=-2),t>=113&&t<=117&&(i=d.pop(),isNaN(i)||(e=2*-i));e<0&&d.length>0;)d.pop(),e++;for(;e>0;)d.push(NaN),e--}}e.tooComplexToFollowFunctions=p;const y=[l];c>l.length&&y.push(new Uint8Array(c-l.length)),u>h&&(warn$1("TT: complementing a missing function tail"),y.push(new Uint8Array([34,45]))),function(t,e){if(e.length>1){let s,i,n=0;for(s=0,i=e.length;s<i;s++)n+=e[s].length;n=n+3&-4;const a=new Uint8Array(n);let r=0;for(s=0,i=e.length;s<i;s++)a.set(e[s],r),r+=e[s].length;t.data=a,t.length=n}}(t,y)}let a,r,o,l;if(isTrueTypeCollectionFile(e=new Ks(new Uint8Array(e.getBytes())))){const t=function(t,e){const{numFonts:s,offsetTable:i}=function(t){const e=t.getString(4);assert$1("ttcf"===e,"Must be a TrueType Collection font.");const s=t.getUint16(),i=t.getUint16(),n=t.getInt32()>>>0,a=[];for(let e=0;e<n;e++)a.push(t.getInt32()>>>0);const r={ttcTag:e,majorVersion:s,minorVersion:i,numFonts:n,offsetTable:a};switch(s){case 1:return r;case 2:return r.dsigTag=t.getInt32()>>>0,r.dsigLength=t.getInt32()>>>0,r.dsigOffset=t.getInt32()>>>0,r}throw new Ze(`Invalid TrueType Collection majorVersion: ${s}.`)}(t),n=e.split("+");let a;for(let r=0;r<s;r++){t.pos=(t.start||0)+i[r];const s=readOpenTypeHeader(t),o=readTables(t,s.numTables);if(!o.name)throw new Ze('TrueType Collection font must contain a "name" table.');const[l]=readNameTable(o.name);for(let t=0,i=l.length;t<i;t++)for(let i=0,r=l[t].length;i<r;i++){const r=l[t][i]?.replaceAll(/\s/g,"");if(r){if(r===e)return{header:s,tables:o};if(!(n.length<2))for(const t of n)r===t&&(a={name:t,header:s,tables:o})}}}if(a)return warn$1(`TrueType Collection does not contain "${e}" font, falling back to "${a.name}" font instead.`),{header:a.header,tables:a.tables};throw new Ze(`TrueType Collection does not contain "${e}" font.`)}(e,this.name);a=t.header,r=t.tables}else a=readOpenTypeHeader(e),r=readTables(e,a.numTables);const c=!r["CFF "];if(c){if(!r.loca)throw new Ze('Required "loca" table is not found');r.glyf||(warn$1('Required "glyf" table is not found -- trying to recover.'),r.glyf={tag:"glyf",data:new Uint8Array(0)}),this.isOpenType=!1}else{const e=s.composite&&(s.cidToGidMap?.length>0||!(s.cMap instanceof vn));if("OTTO"===a.version&&!e||!r.head||!r.hhea||!r.maxp||!r.post)return l=new Ks(r["CFF "].data),o=new Aa(l,s),this.convert(t,o,s);delete r.glyf,delete r.loca,delete r.fpgm,delete r.prep,delete r["cvt "],this.isOpenType=!0}if(!r.maxp)throw new Ze('Required "maxp" table is not found');e.pos=(e.start||0)+r.maxp.offset;let h=e.getInt32();const u=e.getUint16();if(65536!==h&&20480!==h){if(6===r.maxp.length)h=20480;else{if(!(r.maxp.length>=32))throw new Ze('"maxp" table has a wrong version number');h=65536}d=r.maxp.data,g=h,d[3+(f=0)]=255&g,d[f+2]=g>>>8,d[f+1]=g>>>16,d[f]=g>>>24}var d,f,g;if(s.scaleFactors?.length===u&&c){const{scaleFactors:t}=s,e=int16(r.head.data[50],r.head.data[51]),i=new Ea({glyfTable:r.glyf.data,isGlyphLocationsLong:e,locaTable:r.loca.data,numGlyphs:u});i.scale(t);const{glyf:n,loca:a,isLocationLong:o}=i.write();r.glyf.data=n,r.loca.data=a,o!==!!e&&(r.head.data[50]=0,r.head.data[51]=o?1:0);const l=r.hmtx.data;for(let e=0;e<u;e++){const s=4*e,i=Math.round(t[e]*int16(l[s],l[s+1]));l[s]=i>>8&255,l[s+1]=255&i,writeSignedInt16(l,s+2,Math.round(t[e]*signedInt16(l[s+2],l[s+3])))}}let p=u+1,m=!0;p>65535&&(m=!1,p=u,warn$1("Not enough space in glyfs to duplicate first glyph."));let b=0,w=0;h>=65536&&r.maxp.length>=32&&(e.pos+=8,e.getUint16()>2&&(r.maxp.data[14]=0,r.maxp.data[15]=2),e.pos+=4,b=e.getUint16(),e.pos+=4,w=e.getUint16()),r.maxp.data[4]=p>>8,r.maxp.data[5]=255&p;const y=function(t,e,s,i){const n={functionsDefined:[],functionsUsed:[],functionsStackDeltas:[],tooComplexToFollowFunctions:!1,hintsValid:!0};if(t&&sanitizeTTProgram(t,n),e&&sanitizeTTProgram(e,n),t&&function(t,e){if(!t.tooComplexToFollowFunctions){if(t.functionsDefined.length>e)return warn$1("TT: more functions defined than expected"),void(t.hintsValid=!1);for(let s=0,i=t.functionsUsed.length;s<i;s++){if(s>e)return warn$1("TT: invalid function id: "+s),void(t.hintsValid=!1);if(t.functionsUsed[s]&&!t.functionsDefined[s])return warn$1("TT: undefined function: "+s),void(t.hintsValid=!1)}}}(n,i),s&&1&s.length){const t=new Uint8Array(s.length+1);t.set(s.data),s.data=t}return n.hintsValid}(r.fpgm,r.prep,r["cvt "],b);if(y||(delete r.fpgm,delete r.prep,delete r["cvt "]),function(t,e,s,i,n,a){if(!e)return void(s&&(s.data=null));t.pos=(t.start||0)+e.offset,t.pos+=4,t.pos+=2,t.pos+=2,t.pos+=2,t.pos+=2,t.pos+=2,t.pos+=2,t.pos+=2,t.pos+=2,t.pos+=2;const r=t.getUint16();t.pos+=8,t.pos+=2;let o=t.getUint16();0!==r&&(2&int16(i.data[44],i.data[45])||(e.data[22]=0,e.data[23]=0)),o>n&&(info$1(`The numOfMetrics (${o}) should not be greater than the numGlyphs (${n}).`),o=n,e.data[34]=(65280&o)>>8,e.data[35]=255&o);const l=n-o-(s.length-4*o>>1);if(l>0){const t=new Uint8Array(s.length+2*l);t.set(s.data),a&&(t[s.length]=s.data[2],t[s.length+1]=s.data[3]),s.data=t}}(e,r.hhea,r.hmtx,r.head,p,m),!r.head)throw new Ze('Required "head" table is not found');!function(t,e,s){const i=t.data,n=(a=i[0],r=i[1],o=i[2],l=i[3],(a<<24)+(r<<16)+(o<<8)+l);var a,r,o,l;n>>16!=1&&(info$1("Attempting to fix invalid version in head table: "+n),i[0]=0,i[1]=1,i[2]=0,i[3]=0);const c=int16(i[50],i[51]);if(c<0||c>1){info$1("Attempting to fix invalid indexToLocFormat in head table: "+c);const t=e+1;if(s===t<<1)i[50]=0,i[51]=0;else{if(s!==t<<2)throw new Ze("Could not fix indexToLocFormat: "+c);i[50]=0,i[51]=1}}}(r.head,u,c?r.loca.length:0);let x=Object.create(null);if(c){const t=int16(r.head.data[50],r.head.data[51]),e=function(t,e,s,i,n,a,r){let o,l,c;i?(o=4,l=function(t,e){return t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]},c=function(t,e,s){t[e]=s>>>24&255,t[e+1]=s>>16&255,t[e+2]=s>>8&255,t[e+3]=255&s}):(o=2,l=function(t,e){return t[e]<<9|t[e+1]<<1},c=function(t,e,s){t[e]=s>>9&255,t[e+1]=s>>1&255});const h=a?s+1:s,u=o*(1+h),d=new Uint8Array(u);d.set(t.data.subarray(0,u)),t.data=d;const f=e.data,g=f.length,p=new Uint8Array(g);let m,b;const w=[];for(m=0,b=0;m<s+1;m++,b+=o){let t=l(d,b);t>g&&(t=g),w.push({index:m,offset:t,endOffset:0})}for(w.sort((t,e)=>t.offset-e.offset),m=0;m<s;m++)w[m].endOffset=w[m+1].offset;for(w.sort((t,e)=>t.index-e.index),m=0;m<s;m++){const{offset:t,endOffset:e}=w[m];if(0!==t||0!==e)break;const s=w[m+1].offset;if(0!==s){w[m].endOffset=s;break}}const y=w.at(-2);0!==y.offset&&0===y.endOffset&&(y.endOffset=g);const x=Object.create(null);let v=0;for(c(d,0,v),m=0,b=o;m<s;m++,b+=o){const t=sanitizeGlyph(f,w[m].offset,w[m].endOffset,p,v,n),e=t.length;0===e&&(x[m]=!0),t.sizeOfInstructions>r&&(r=t.sizeOfInstructions),v+=e,c(d,b,v)}if(0===v){const t=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]);for(m=0,b=o;m<h;m++,b+=o)c(d,b,t.length);e.data=t}else if(a){const s=l(d,o);p.length>s+v?e.data=p.subarray(0,s+v):(e.data=new Uint8Array(s+v),e.data.set(p.subarray(0,v))),e.data.set(p.subarray(0,s),v),c(t.data,d.length-o,v+s)}else e.data=p.subarray(0,v);return{missingGlyphs:x,maxSizeOfInstructions:r}}(r.loca,r.glyf,u,t,y,m,w);x=e.missingGlyphs,h>=65536&&r.maxp.length>=32&&(r.maxp.data[26]=e.maxSizeOfInstructions>>8,r.maxp.data[27]=255&e.maxSizeOfInstructions)}if(!r.hhea)throw new Ze('Required "hhea" table is not found');0===r.hhea.data[10]&&0===r.hhea.data[11]&&(r.hhea.data[10]=255,r.hhea.data[11]=255);const v={unitsPerEm:int16(r.head.data[18],r.head.data[19]),yMax:signedInt16(r.head.data[42],r.head.data[43]),yMin:signedInt16(r.head.data[38],r.head.data[39]),ascent:signedInt16(r.hhea.data[4],r.hhea.data[5]),descent:signedInt16(r.hhea.data[6],r.hhea.data[7]),lineGap:signedInt16(r.hhea.data[8],r.hhea.data[9])};this.ascent=v.ascent/v.unitsPerEm,this.descent=v.descent/v.unitsPerEm,this.lineGap=v.lineGap/v.unitsPerEm,this.cssFontInfo?.lineHeight?(this.lineHeight=this.cssFontInfo.metrics.lineHeight,this.lineGap=this.cssFontInfo.metrics.lineGap):this.lineHeight=this.ascent-this.descent+this.lineGap,r.post&&function(t,s,i){const n=(e.start||0)+t.offset;e.pos=n;const a=n+t.length,r=e.getInt32();let o;e.skip(28);let l,c=!0;switch(r){case 65536:o=Hn;break;case 131072:const t=e.getUint16();if(t!==i){c=!1;break}const n=[];for(l=0;l<t;++l){const t=e.getUint16();if(t>=32768){c=!1;break}n.push(t)}if(!c)break;const h=[],u=[];for(;e.pos<a;){const t=e.getByte();for(u.length=t,l=0;l<t;++l)u[l]=String.fromCharCode(e.getByte());h.push(u.join(""))}for(o=[],l=0;l<t;++l){const t=n[l];t<258?o.push(Hn[t]):o.push(h[t-258])}break;case 196608:break;default:warn$1("Unknown/unsupported post table version "+r),c=!1,s.defaultEncoding&&(o=s.defaultEncoding)}s.glyphNames=o}(r.post,s,u),r.post={tag:"post",data:createPostTable(s)};const A=Object.create(null);function hasGlyph(t){return!x[t]}if(s.composite){const t=s.cidToGidMap||[],e=0===t.length;s.cMap.forEach(function(s,i){if("string"==typeof i&&(i=convertCidString(s,i,!0)),i>65535)throw new Ze("Max size of CID is 65,535");let n=-1;e?n=i:void 0!==t[i]&&(n=t[i]),n>=0&&n<u&&hasGlyph(n)&&(A[s]=n)})}else{const t=function(t,e,s,i){if(!t)return warn$1("No cmap table available."),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};let n,a=(e.start||0)+t.offset;e.pos=a,e.skip(2);const r=e.getUint16();let o,l=!1;for(let t=0;t<r;t++){const n=e.getUint16(),a=e.getUint16(),c=e.getInt32()>>>0;let h=!1;if(o?.platformId!==n||o?.encodingId!==a){if(0!==n||0!==a&&1!==a&&3!==a)if(1===n&&0===a)h=!0;else if(3!==n||1!==a||!i&&o){if(s&&3===n&&0===a){h=!0;let s=!0;if(t<r-1){const t=e.peekBytes(2);int16(t[0],t[1])<n&&(s=!1)}s&&(l=!0)}}else h=!0,s||(l=!0);else h=!0;if(h&&(o={platformId:n,encodingId:a,offset:c}),l)break}}if(o&&(e.pos=a+o.offset),!o||-1===e.peekByte())return warn$1("Could not find a preferred cmap table."),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};const c=e.getUint16();let h=!1;const u=[];let d,f;if(0===c){for(e.skip(4),d=0;d<256;d++){const t=e.getByte();t&&u.push({charCode:d,glyphId:t})}h=!0}else if(2===c){e.skip(4);const t=[];let s=0;for(let i=0;i<256;i++){const i=e.getUint16()>>3;t.push(i),s=Math.max(i,s)}const i=[];for(let t=0;t<=s;t++)i.push({firstCode:e.getUint16(),entryCount:e.getUint16(),idDelta:signedInt16(e.getByte(),e.getByte()),idRangePos:e.pos+e.getUint16()});for(let s=0;s<256;s++)if(0===t[s])e.pos=i[0].idRangePos+2*s,f=e.getUint16(),u.push({charCode:s,glyphId:f});else{const n=i[t[s]];for(d=0;d<n.entryCount;d++){const t=(s<<8)+d+n.firstCode;e.pos=n.idRangePos+2*d,f=e.getUint16(),0!==f&&(f=(f+n.idDelta)%65536),u.push({charCode:t,glyphId:f})}}}else if(4===c){e.skip(4);const t=e.getUint16()>>1;e.skip(6);const s=[];let i;for(i=0;i<t;i++)s.push({end:e.getUint16()});for(e.skip(2),i=0;i<t;i++)s[i].start=e.getUint16();for(i=0;i<t;i++)s[i].delta=e.getUint16();let r,o=0;for(i=0;i<t;i++){n=s[i];const a=e.getUint16();a?(r=(a>>1)-(t-i),n.offsetIndex=r,o=Math.max(o,r+n.end-n.start+1)):n.offsetIndex=-1}const l=[];for(d=0;d<o;d++)l.push(e.getUint16());for(i=0;i<t;i++){n=s[i],a=n.start;const t=n.end,e=n.delta;for(r=n.offsetIndex,d=a;d<=t;d++)65535!==d&&(f=r<0?d:l[r+d-a],f=f+e&65535,u.push({charCode:d,glyphId:f}))}}else if(6===c){e.skip(4);const t=e.getUint16(),s=e.getUint16();for(d=0;d<s;d++){f=e.getUint16();const s=t+d;u.push({charCode:s,glyphId:f})}}else{if(12!==c)return warn$1("cmap table has unsupported format: "+c),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};{e.skip(10);const t=e.getInt32()>>>0;for(d=0;d<t;d++){const t=e.getInt32()>>>0,s=e.getInt32()>>>0;let i=e.getInt32()>>>0;for(let e=t;e<=s;e++)u.push({charCode:e,glyphId:i++})}}}u.sort((t,e)=>t.charCode-e.charCode);const g=[],p=new Set;for(const t of u){const{charCode:e}=t;p.has(e)||(p.add(e),g.push(t))}return{platformId:o.platformId,encodingId:o.encodingId,mappings:g,hasShortCmap:h}}(r.cmap,e,this.isSymbolicFont,s.hasEncoding),i=t.platformId,n=t.encodingId,a=t.mappings;let o=[],l=!1;if(!s.hasEncoding||"MacRomanEncoding"!==s.baseEncodingName&&"WinAnsiEncoding"!==s.baseEncodingName||(o=getEncoding(s.baseEncodingName)),s.hasEncoding&&!this.isSymbolicFont&&(3===i&&1===n||1===i&&0===n)){const t=En();for(let e=0;e<256;e++){let r;if(r=void 0!==this.differences[e]?this.differences[e]:o.length&&""!==o[e]?o[e]:_n[e],!r)continue;const l=recoverGlyphName(r,t);let c;if(3===i&&1===n?c=t[l]:1===i&&0===n&&(c=Cn.indexOf(l)),void 0===c){if(!s.glyphNames&&s.hasIncludedToUnicodeMap&&!(this.toUnicode instanceof va)){const t=this.toUnicode.get(e);t&&(c=t.codePointAt(0))}if(void 0===c)continue}for(const t of a)if(t.charCode===c){A[e]=t.glyphId;break}}}else if(0===i){for(const t of a)A[t.charCode]=t.glyphId;l=!0}else if(3===i&&0===n)for(const t of a){let e=t.charCode;e>=61440&&e<=61695&&(e&=255),A[e]=t.glyphId}else for(const t of a)A[t.charCode]=t.glyphId;if(s.glyphNames&&(o.length||this.differences.length))for(let t=0;t<256;++t){if(!l&&void 0!==A[t])continue;const e=this.differences[t]||o[t];if(!e)continue;const i=s.glyphNames.indexOf(e);i>0&&hasGlyph(i)&&(A[t]=i)}}0===A.length&&(A[0]=0);let k=p-1;if(m||(k=0),!s.cssFontInfo){const t=adjustMapping(A,hasGlyph,k,this.toUnicode);this.toFontChar=t.toFontChar,r.cmap={tag:"cmap",data:createCmapTable(t.charCodeToGlyphId,t.toUnicodeExtraMap,p)},r["OS/2"]&&function(t,e){e.pos=(e.start||0)+t.offset;const s=e.getUint16();e.skip(60);const i=e.getUint16();return!(s<4&&768&i||e.getUint16()>e.getUint16()||(e.skip(6),0===e.getUint16()||(t.data[8]=t.data[9]=0,0)))}(r["OS/2"],e)||(r["OS/2"]={tag:"OS/2",data:createOS2Table(s,t.charCodeToGlyphId,v)})}if(!c)try{l=new Ks(r["CFF "].data),o=new Yn(l,s,Nn).parse(),o.duplicateFirstGlyph();const t=new ua(o);r["CFF "].data=t.compile()}catch{warn$1("Failed to compile font "+s.loadedName)}if(r.name){const[e,i]=readNameTable(r.name);r.name.data=createNameTable(t,e),this.psName=e[0][6]||null,s.composite||function(t,e,s){if(t.isInternalFont)return;if(t.hasIncludedToUnicodeMap)return;if(t.hasEncoding)return;if(t.toUnicode instanceof va)return;if(!e)return;if(0===s.length)return;if(t.defaultEncoding===In)return;for(const t of s)if(!isWinNameRecord(t))return;const i=In,n=[],a=En();for(const t in i){const e=i[t];if(""===e)continue;const s=a[e];void 0!==s&&(n[t]=String.fromCharCode(s))}n.length>0&&t.toUnicode.amend(n)}(s,this.isSymbolicFont,i)}else r.name={tag:"name",data:createNameTable(this.name)};const S=new Na(a.version);for(const t in r)S.addTable(t,r[t].data);return S.toArray()}convert(t,e,i){i.fixedPitch=!1,i.builtInEncoding&&function(t,e){if(t.isInternalFont)return;if(t.hasIncludedToUnicodeMap)return;if(e===t.defaultEncoding)return;if(t.toUnicode instanceof va)return;const s=[],i=En();for(const n in e){if(t.hasEncoding&&(t.baseEncodingName||void 0!==t.differences[n]))continue;const a=getUnicodeForGlyph(e[n],i);-1!==a&&(s[n]=String.fromCharCode(a))}s.length>0&&t.toUnicode.amend(s)}(i,i.builtInEncoding);let n=1;e instanceof Aa&&(n=e.numGlyphs-1);const a=e.getGlyphMapping(i);let r=null,o=a,l=null;i.cssFontInfo||(r=adjustMapping(a,e.hasGlyphId.bind(e),n,this.toUnicode),this.toFontChar=r.toFontChar,o=r.charCodeToGlyphId,l=r.toUnicodeExtraMap);const c=e.numGlyphs;function getCharCodes(t,e){let s=null;for(const i in t)e===t[i]&&(s||=[]).push(0|i);return s}function createCharCode(t,e){for(const s in t)if(e===t[s])return 0|s;return r.charCodeToGlyphId[r.nextAvailableFontCharCode]=e,r.nextAvailableFontCharCode++}const h=e.seacs;if(r&&h?.length){const t=i.fontMatrix||s,n=e.getCharset(),o=Object.create(null);for(let e in h){e|=0;const s=h[e],i=_n[s[2]],l=_n[s[3]],c=n.indexOf(i),u=n.indexOf(l);if(c<0||u<0)continue;const d={x:s[0]*t[0]+s[1]*t[2]+t[4],y:s[0]*t[1]+s[1]*t[3]+t[5]},f=getCharCodes(a,e);if(f)for(const t of f){const e=r.charCodeToGlyphId,s=createCharCode(e,c),i=createCharCode(e,u);o[t]={baseFontCharCode:s,accentFontCharCode:i,accentOffset:d}}}i.seacMap=o}const u=i.fontMatrix?1/Math.max(...i.fontMatrix.slice(0,4).map(Math.abs)):1e3,d=new Na("OTTO");return d.addTable("CFF ",e.data),d.addTable("OS/2",createOS2Table(i,o)),d.addTable("cmap",createCmapTable(o,l,c)),d.addTable("head","\0\0\0\0\0\0\0\0\0\0_<õ\0\0"+safeString16(u)+"\0\0\0\0ž\v~'\0\0\0\0ž\v~'\0\0"+safeString16(i.descent)+"ÿ"+safeString16(i.ascent)+string16(i.italicAngle?2:0)+"\0\0\0\0\0\0\0"),d.addTable("hhea","\0\0\0"+safeString16(i.ascent)+safeString16(i.descent)+"\0\0ÿÿ\0\0\0\0\0\0"+safeString16(i.capHeight)+safeString16(Math.tan(i.italicAngle)*i.xHeight)+"\0\0\0\0\0\0\0\0\0\0\0\0"+string16(c)),d.addTable("hmtx",function(){const t=e.charstrings,s=e.cff?e.cff.widths:null;let i="\0\0\0\0";for(let e=1,n=c;e<n;e++){let n=0;if(t){const s=t[e-1];n="width"in s?s.width:0}else s&&(n=Math.ceil(s[e]||0));i+=string16(n)+string16(0)}return i}()),d.addTable("maxp","\0\0P\0"+string16(c)),d.addTable("name",createNameTable(t)),d.addTable("post",createPostTable(i)),d.toArray()}get _spaceWidth(){const t=["space","minus","one","i","I"];let e;for(const s of t){if(s in this.widths){e=this.widths[s];break}const t=En()[s];let i=0;if(this.composite&&this.cMap.contains(t)&&(i=this.cMap.lookup(t),"string"==typeof i&&(i=convertCidString(t,i))),!i&&this.toUnicode&&(i=this.toUnicode.charCodeOf(t)),i<=0&&(i=t),e=this.widths[i],e)break}return shadow$1(this,"_spaceWidth",e||this.defaultWidth)}_charToGlyph(t,e=!1){let s,i,n,a=this._glyphCache[t];if(a?.isSpace===e)return a;let r=t;this.cMap?.contains(t)&&(r=this.cMap.lookup(t),"string"==typeof r&&(r=convertCidString(t,r))),i=this.widths[r],"number"!=typeof i&&(i=this.defaultWidth);const o=this.vmetrics?.[r];let l=this.toUnicode.get(t)||t;"number"==typeof l&&(l=String.fromCharCode(l));let c=void 0!==this.toFontChar[t];if(s=this.toFontChar[t]||t,this.missingFile){const e=this.differences[t]||this.defaultEncoding[t];".notdef"!==e&&""!==e||"Type1"!==this.type||(s=32,""===e&&(i||=this._spaceWidth,l=String.fromCharCode(s))),s=(h=s)>=65520&&h<=65535?0:h>=62976&&h<=63743?Dn()[h]||h:173===h?45:h}var h;this.isType3Font&&(n=s);let u=null;if(this.seacMap?.[t]){c=!0;const e=this.seacMap[t];s=e.baseFontCharCode,u={fontChar:String.fromCodePoint(e.accentFontCharCode),offset:e.accentOffset}}let d="";if("number"==typeof s&&(s<=1114111?d=String.fromCodePoint(s):warn$1(`charToGlyph - invalid fontCharCode: ${s}`)),this.missingFile&&this.vertical&&1===d.length){const t=jn()[d.charCodeAt(0)];t&&(d=l=String.fromCharCode(t))}return a=new er(t,d,l,u,i,o,n,e,c),this._glyphCache[t]=a}charsToGlyphs(t){let e=this._charsCache[t];if(e)return e;if(e=[],this.cMap){const s=Object.create(null),i=t.length;let n=0;for(;n<i;){this.cMap.readCharCode(t,n,s);const{charcode:i,length:a}=s;n+=a;const r=this._charToGlyph(i,1===a&&32===t.charCodeAt(n-1));e.push(r)}}else for(let s=0,i=t.length;s<i;++s){const i=t.charCodeAt(s),n=this._charToGlyph(i,32===i);e.push(n)}return this._charsCache[t]=e}getCharPositions(t){const e=[];if(this.cMap){const s=Object.create(null);let i=0;for(;i<t.length;){this.cMap.readCharCode(t,i,s);const n=s.length;e.push([i,i+n]),i+=n}}else for(let s=0,i=t.length;s<i;++s)e.push([s,s+1]);return e}get glyphCacheValues(){return Object.values(this._glyphCache)}encodeString(t){const e=[],s=[],hasCurrentBufErrors=()=>e.length%2==1,i=this.toUnicode instanceof va?t=>this.toUnicode.charCodeOf(t):t=>this.toUnicode.charCodeOf(String.fromCodePoint(t));for(let n=0,a=t.length;n<a;n++){const a=t.codePointAt(n);if(a>55295&&(a<57344||a>65533)&&n++,this.toUnicode){const t=i(a);if(-1!==t){hasCurrentBufErrors()&&(e.push(s.join("")),s.length=0);for(let e=(this.cMap?this.cMap.getCharCodeLength(t):1)-1;e>=0;e--)s.push(String.fromCharCode(t>>8*e&255));continue}}hasCurrentBufErrors()||(e.push(s.join("")),s.length=0),s.push(String.fromCodePoint(a))}return e.push(s.join("")),e}},ir=class{constructor(t){this.error=t,this.loadedName="g_font_error",this.missingFile=!0}charsToGlyphs(){return[]}encodeString(t){return[t]}exportData(){return{error:this.error}}},nr=2,ar=3,rr=4,or=5,lr=6,cr=7,hr=class{constructor(){unreachable$1("Cannot initialize Pattern.")}static parseShading(t,e,s,i,n,a){const r=t instanceof bs?t.dict:t,o=r.get("ShadingType");try{switch(o){case nr:case ar:return new dr(r,e,s,i,n,a);case rr:case or:case lr:case cr:return new pr(t,e,s,i,n,a);default:throw new Ze("Unsupported ShadingType: "+o)}}catch(t){if(t instanceof ks)throw t;return warn$1(t),new mr}}},ur=class{static SMALL_NUMBER=1e-6;getIR(){unreachable$1("Abstract method `getIR` called.")}},dr=class extends ur{constructor(t,e,s,i,n,a){super(),this.shadingType=t.get("ShadingType");let r=0;if(this.shadingType===nr?r=4:this.shadingType===ar&&(r=6),this.coordsArr=t.getArray("Coords"),!isNumberArray(this.coordsArr,r))throw new Ze("RadialAxialShading: Invalid /Coords array.");const o=ni.parse({cs:t.getRaw("CS")||t.getRaw("ColorSpace"),xref:e,resources:s,pdfFunctionFactory:i,globalColorSpaceCache:n,localColorSpaceCache:a});this.bbox=lookupNormalRect(t.getArray("BBox"),null);let l=0,c=1;const h=t.getArray("Domain");isNumberArray(h,2)&&([l,c]=h);let u=!1,d=!1;const f=t.getArray("Extend");var g,p;if(g=f,p=2,Array.isArray(g)&&g.length===p&&g.every(t=>"boolean"==typeof t)&&([u,d]=f),!(this.shadingType!==ar||u&&d)){const[t,e,s,i,n,a]=this.coordsArr,r=Math.hypot(t-i,e-n);s<=a+r&&a<=s+r&&warn$1("Unsupported radial gradient.")}this.extendStart=u,this.extendEnd=d;const m=t.getRaw("Function"),b=i.create(m,!0),w=(c-l)/840,y=this.colorStops=[];if(l>=c||w<=0)return void info$1("Bad shading domain.");const x=new Float32Array(o.numComps),v=new Float32Array(1);let A=0;v[0]=l,b(v,0,x,0);const k=new Uint8ClampedArray(3);o.getRgb(x,0,k);let[S,C,_]=k;y.push([0,ss.makeHexColor(S,C,_)]);let I=1;v[0]=l+w,b(v,0,x,0),o.getRgb(x,0,k);let[T,M,E]=k,F=T-S+1,D=M-C+1,R=E-_+1,B=T-S-1,P=M-C-1,N=E-_-1;for(let t=2;t<840;t++){v[0]=l+t*w,b(v,0,x,0),o.getRgb(x,0,k);const[e,s,i]=k,n=t-A;if(F=Math.min(F,(e-S+1)/n),D=Math.min(D,(s-C+1)/n),R=Math.min(R,(i-_+1)/n),B=Math.max(B,(e-S-1)/n),P=Math.max(P,(s-C-1)/n),N=Math.max(N,(i-_-1)/n),!(B<=F&&P<=D&&N<=R)){const t=ss.makeHexColor(T,M,E);y.push([I/840,t]),F=e-T+1,D=s-M+1,R=i-E+1,B=e-T-1,P=s-M-1,N=i-E-1,A=I,S=T,C=M,_=E}I=t,T=e,M=s,E=i}y.push([1,ss.makeHexColor(T,M,E)]);let O="transparent";t.has("Background")&&(O=o.getRgbHex(t.get("Background"),0)),u||(y.unshift([0,O]),y[1][0]+=ur.SMALL_NUMBER),d||(y.at(-1)[0]-=ur.SMALL_NUMBER,y.push([1,O])),this.colorStops=y}getIR(){const{coordsArr:t,shadingType:e}=this;let s,i,n,a,r;return e===nr?(i=[t[0],t[1]],n=[t[2],t[3]],a=null,r=null,s="axial"):e===ar?(i=[t[0],t[1]],n=[t[3],t[4]],a=t[2],r=t[5],s="radial"):unreachable$1(`getPattern type unknown: ${e}`),["RadialAxial",s,this.bbox,this.colorStops,i,n,a,r]}},fr=class{constructor(t,e){this.stream=t,this.context=e,this.buffer=0,this.bufferLength=0;const s=e.numComps;this.tmpCompsBuf=new Float32Array(s);const i=e.colorSpace.numComps;this.tmpCsCompsBuf=e.colorFn?new Float32Array(i):this.tmpCompsBuf}get hasData(){if(this.stream.end)return this.stream.pos<this.stream.end;if(this.bufferLength>0)return!0;const t=this.stream.getByte();return!(t<0||(this.buffer=t,this.bufferLength=8,0))}readBits(t){const{stream:e}=this;let{buffer:s,bufferLength:i}=this;if(32===t){if(0===i)return e.getInt32()>>>0;s=s<<24|e.getByte()<<16|e.getByte()<<8|e.getByte();const t=e.getByte();return this.buffer=t&(1<<i)-1,(s<<8-i|(255&t)>>i)>>>0}if(8===t&&0===i)return e.getByte();for(;i<t;)s=s<<8|e.getByte(),i+=8;return i-=t,this.bufferLength=i,this.buffer=s&(1<<i)-1,s>>i}align(){this.buffer=0,this.bufferLength=0}readFlag(){return this.readBits(this.context.bitsPerFlag)}readCoordinate(){const{bitsPerCoordinate:t,decode:e}=this.context,s=this.readBits(t),i=this.readBits(t),n=t<32?1/((1<<t)-1):2.3283064365386963e-10;return[s*n*(e[1]-e[0])+e[0],i*n*(e[3]-e[2])+e[2]]}readComponents(){const{bitsPerComponent:t,colorFn:e,colorSpace:s,decode:i,numComps:n}=this.context,a=t<32?1/((1<<t)-1):2.3283064365386963e-10,r=this.tmpCompsBuf;for(let e=0,s=4;e<n;e++,s+=2){const n=this.readBits(t);r[e]=n*a*(i[s+1]-i[s])+i[s]}const o=this.tmpCsCompsBuf;return e?.(r,0,o,0),s.getRgb(o,0)}},gr=Object.create(null);function getB(t){return gr[t]||=function(t){const e=[];for(let s=0;s<=t;s++){const i=s/t,n=1-i;e.push(new Float32Array([n**3,3*i*n**2,3*i**2*n,i**3]))}return e}(t)}var pr=class _MeshShading extends ur{static MIN_SPLIT_PATCH_CHUNKS_AMOUNT=3;static MAX_SPLIT_PATCH_CHUNKS_AMOUNT=20;static TRIANGLE_DENSITY=20;constructor(t,e,s,i,n,a){if(super(),!(t instanceof bs))throw new Ze("Mesh data is not a stream");const r=t.dict;this.shadingType=r.get("ShadingType"),this.bbox=lookupNormalRect(r.getArray("BBox"),null);const o=ni.parse({cs:r.getRaw("CS")||r.getRaw("ColorSpace"),xref:e,resources:s,pdfFunctionFactory:i,globalColorSpaceCache:n,localColorSpaceCache:a});this.background=r.has("Background")?o.getRgb(r.get("Background"),0):null;const l=r.getRaw("Function"),c=l?i.create(l,!0):null;this.coords=[],this.colors=[],this.figures=[];const h={bitsPerCoordinate:r.get("BitsPerCoordinate"),bitsPerComponent:r.get("BitsPerComponent"),bitsPerFlag:r.get("BitsPerFlag"),decode:r.getArray("Decode"),colorFn:c,colorSpace:o,numComps:c?1:o.numComps},u=new fr(t,h);let d=!1;switch(this.shadingType){case rr:this._decodeType4Shading(u);break;case or:const t=0|r.get("VerticesPerRow");if(t<2)throw new Ze("Invalid VerticesPerRow");this._decodeType5Shading(u,t);break;case lr:this._decodeType6Shading(u),d=!0;break;case cr:this._decodeType7Shading(u),d=!0;break;default:unreachable$1("Unsupported mesh type.")}if(d){this._updateBounds();for(let t=0,e=this.figures.length;t<e;t++)this._buildFigureFromPatch(t)}this._updateBounds(),this._packData()}_decodeType4Shading(t){const e=this.coords,s=this.colors,i=[];let n=0;for(;t.hasData;){const a=t.readFlag(),r=t.readCoordinate(),o=t.readComponents();if(0===n){if(!(0<=a&&a<=2))throw new Ze("Unknown type4 flag");switch(a){case 0:n=3;break;case 1:i.push(i.at(-2),i.at(-1)),n=1;break;case 2:i.push(i.at(-3),i.at(-1)),n=1}}i.push(e.length),e.push(r),s.push(o),n--,t.align()}this.figures.push({type:"triangles",coords:new Int32Array(i),colors:new Int32Array(i)})}_decodeType5Shading(t,e){const s=this.coords,i=this.colors,n=[];for(;t.hasData;){const e=t.readCoordinate(),a=t.readComponents();n.push(s.length),s.push(e),i.push(a)}this.figures.push({type:"lattice",coords:new Int32Array(n),colors:new Int32Array(n),verticesPerRow:e})}_decodeType6Shading(t){const e=this.coords,s=this.colors,i=new Int32Array(16),n=new Int32Array(4);for(;t.hasData;){const a=t.readFlag();if(!(0<=a&&a<=3))throw new Ze("Unknown type6 flag");const r=e.length;for(let s=0,i=0!==a?8:12;s<i;s++)e.push(t.readCoordinate());const o=s.length;for(let e=0,i=0!==a?2:4;e<i;e++)s.push(t.readComponents());let l,c,h,u;switch(a){case 0:i[12]=r+3,i[13]=r+4,i[14]=r+5,i[15]=r+6,i[8]=r+2,i[11]=r+7,i[4]=r+1,i[7]=r+8,i[0]=r,i[1]=r+11,i[2]=r+10,i[3]=r+9,n[2]=o+1,n[3]=o+2,n[0]=o,n[1]=o+3;break;case 1:l=i[12],c=i[13],h=i[14],u=i[15],i[12]=u,i[13]=r+0,i[14]=r+1,i[15]=r+2,i[8]=h,i[11]=r+3,i[4]=c,i[7]=r+4,i[0]=l,i[1]=r+7,i[2]=r+6,i[3]=r+5,l=n[2],c=n[3],n[2]=c,n[3]=o,n[0]=l,n[1]=o+1;break;case 2:l=i[15],c=i[11],i[12]=i[3],i[13]=r+0,i[14]=r+1,i[15]=r+2,i[8]=i[7],i[11]=r+3,i[4]=c,i[7]=r+4,i[0]=l,i[1]=r+7,i[2]=r+6,i[3]=r+5,l=n[3],n[2]=n[1],n[3]=o,n[0]=l,n[1]=o+1;break;case 3:i[12]=i[0],i[13]=r+0,i[14]=r+1,i[15]=r+2,i[8]=i[1],i[11]=r+3,i[4]=i[2],i[7]=r+4,i[0]=i[3],i[1]=r+7,i[2]=r+6,i[3]=r+5,n[2]=n[0],n[3]=o,n[0]=n[1],n[1]=o+1}i[5]=e.length,e.push([(-4*e[i[0]][0]-e[i[15]][0]+6*(e[i[4]][0]+e[i[1]][0])-2*(e[i[12]][0]+e[i[3]][0])+3*(e[i[13]][0]+e[i[7]][0]))/9,(-4*e[i[0]][1]-e[i[15]][1]+6*(e[i[4]][1]+e[i[1]][1])-2*(e[i[12]][1]+e[i[3]][1])+3*(e[i[13]][1]+e[i[7]][1]))/9]),i[6]=e.length,e.push([(-4*e[i[3]][0]-e[i[12]][0]+6*(e[i[2]][0]+e[i[7]][0])-2*(e[i[0]][0]+e[i[15]][0])+3*(e[i[4]][0]+e[i[14]][0]))/9,(-4*e[i[3]][1]-e[i[12]][1]+6*(e[i[2]][1]+e[i[7]][1])-2*(e[i[0]][1]+e[i[15]][1])+3*(e[i[4]][1]+e[i[14]][1]))/9]),i[9]=e.length,e.push([(-4*e[i[12]][0]-e[i[3]][0]+6*(e[i[8]][0]+e[i[13]][0])-2*(e[i[0]][0]+e[i[15]][0])+3*(e[i[11]][0]+e[i[1]][0]))/9,(-4*e[i[12]][1]-e[i[3]][1]+6*(e[i[8]][1]+e[i[13]][1])-2*(e[i[0]][1]+e[i[15]][1])+3*(e[i[11]][1]+e[i[1]][1]))/9]),i[10]=e.length,e.push([(-4*e[i[15]][0]-e[i[0]][0]+6*(e[i[11]][0]+e[i[14]][0])-2*(e[i[12]][0]+e[i[3]][0])+3*(e[i[2]][0]+e[i[8]][0]))/9,(-4*e[i[15]][1]-e[i[0]][1]+6*(e[i[11]][1]+e[i[14]][1])-2*(e[i[12]][1]+e[i[3]][1])+3*(e[i[2]][1]+e[i[8]][1]))/9]),this.figures.push({type:"patch",coords:new Int32Array(i),colors:new Int32Array(n)})}}_decodeType7Shading(t){const e=this.coords,s=this.colors,i=new Int32Array(16),n=new Int32Array(4);for(;t.hasData;){const a=t.readFlag();if(!(0<=a&&a<=3))throw new Ze("Unknown type7 flag");const r=e.length;for(let s=0,i=0!==a?12:16;s<i;s++)e.push(t.readCoordinate());const o=s.length;for(let e=0,i=0!==a?2:4;e<i;e++)s.push(t.readComponents());let l,c,h,u;switch(a){case 0:i[12]=r+3,i[13]=r+4,i[14]=r+5,i[15]=r+6,i[8]=r+2,i[9]=r+13,i[10]=r+14,i[11]=r+7,i[4]=r+1,i[5]=r+12,i[6]=r+15,i[7]=r+8,i[0]=r,i[1]=r+11,i[2]=r+10,i[3]=r+9,n[2]=o+1,n[3]=o+2,n[0]=o,n[1]=o+3;break;case 1:l=i[12],c=i[13],h=i[14],u=i[15],i[12]=u,i[13]=r+0,i[14]=r+1,i[15]=r+2,i[8]=h,i[9]=r+9,i[10]=r+10,i[11]=r+3,i[4]=c,i[5]=r+8,i[6]=r+11,i[7]=r+4,i[0]=l,i[1]=r+7,i[2]=r+6,i[3]=r+5,l=n[2],c=n[3],n[2]=c,n[3]=o,n[0]=l,n[1]=o+1;break;case 2:l=i[15],c=i[11],i[12]=i[3],i[13]=r+0,i[14]=r+1,i[15]=r+2,i[8]=i[7],i[9]=r+9,i[10]=r+10,i[11]=r+3,i[4]=c,i[5]=r+8,i[6]=r+11,i[7]=r+4,i[0]=l,i[1]=r+7,i[2]=r+6,i[3]=r+5,l=n[3],n[2]=n[1],n[3]=o,n[0]=l,n[1]=o+1;break;case 3:i[12]=i[0],i[13]=r+0,i[14]=r+1,i[15]=r+2,i[8]=i[1],i[9]=r+9,i[10]=r+10,i[11]=r+3,i[4]=i[2],i[5]=r+8,i[6]=r+11,i[7]=r+4,i[0]=i[3],i[1]=r+7,i[2]=r+6,i[3]=r+5,n[2]=n[0],n[3]=o,n[0]=n[1],n[1]=o+1}this.figures.push({type:"patch",coords:new Int32Array(i),colors:new Int32Array(n)})}}_buildFigureFromPatch(t){const e=this.figures[t];assert$1("patch"===e.type,"Unexpected patch mesh figure");const s=this.coords,i=this.colors,n=e.coords,a=e.colors,r=Math.min(s[n[0]][0],s[n[3]][0],s[n[12]][0],s[n[15]][0]),o=Math.min(s[n[0]][1],s[n[3]][1],s[n[12]][1],s[n[15]][1]),l=Math.max(s[n[0]][0],s[n[3]][0],s[n[12]][0],s[n[15]][0]),c=Math.max(s[n[0]][1],s[n[3]][1],s[n[12]][1],s[n[15]][1]);let h=Math.ceil((l-r)*_MeshShading.TRIANGLE_DENSITY/(this.bounds[2]-this.bounds[0]));h=MathClamp$1(h,_MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,_MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT);let u=Math.ceil((c-o)*_MeshShading.TRIANGLE_DENSITY/(this.bounds[3]-this.bounds[1]));u=MathClamp$1(u,_MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,_MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT);const d=h+1,f=new Int32Array((u+1)*d),g=new Int32Array((u+1)*d);let p=0;const m=new Uint8Array(3),b=new Uint8Array(3),w=i[a[0]],y=i[a[1]],x=i[a[2]],v=i[a[3]],A=getB(u),k=getB(h);for(let t=0;t<=u;t++){m[0]=(w[0]*(u-t)+x[0]*t)/u|0,m[1]=(w[1]*(u-t)+x[1]*t)/u|0,m[2]=(w[2]*(u-t)+x[2]*t)/u|0,b[0]=(y[0]*(u-t)+v[0]*t)/u|0,b[1]=(y[1]*(u-t)+v[1]*t)/u|0,b[2]=(y[2]*(u-t)+v[2]*t)/u|0;for(let e=0;e<=h;e++,p++){if(!(0!==t&&t!==u||0!==e&&e!==h))continue;let a=0,r=0,o=0;for(let i=0;i<=3;i++)for(let l=0;l<=3;l++,o++){const c=A[t][i]*k[e][l];a+=s[n[o]][0]*c,r+=s[n[o]][1]*c}f[p]=s.length,s.push([a,r]),g[p]=i.length;const l=new Uint8Array(3);l[0]=(m[0]*(h-e)+b[0]*e)/h|0,l[1]=(m[1]*(h-e)+b[1]*e)/h|0,l[2]=(m[2]*(h-e)+b[2]*e)/h|0,i.push(l)}}f[0]=n[0],g[0]=a[0],f[h]=n[3],g[h]=a[1],f[d*u]=n[12],g[d*u]=a[2],f[d*u+h]=n[15],g[d*u+h]=a[3],this.figures[t]={type:"lattice",coords:f,colors:g,verticesPerRow:d}}_updateBounds(){let t=this.coords[0][0],e=this.coords[0][1],s=t,i=e;for(let n=1,a=this.coords.length;n<a;n++){const a=this.coords[n][0],r=this.coords[n][1];t=t>a?a:t,e=e>r?r:e,s=s<a?a:s,i=i<r?r:i}this.bounds=[t,e,s,i]}_packData(){let t,e,s,i;const n=this.coords,a=new Float32Array(2*n.length);for(t=0,s=0,e=n.length;t<e;t++){const e=n[t];a[s++]=e[0],a[s++]=e[1]}this.coords=a;const r=this.colors,o=new Uint8Array(3*r.length);for(t=0,s=0,e=r.length;t<e;t++){const e=r[t];o[s++]=e[0],o[s++]=e[1],o[s++]=e[2]}this.colors=o;const l=this.figures;for(t=0,e=l.length;t<e;t++){const e=l[t],n=e.coords,a=e.colors;for(s=0,i=n.length;s<i;s++)n[s]*=2,a[s]*=3}}getIR(){const{bounds:t}=this;if(t[2]-t[0]===0||t[3]-t[1]===0)throw new Ze(`Invalid MeshShading bounds: [${t}].`);return["Mesh",this.shadingType,this.coords,this.colors,this.figures,t,this.bbox,this.background]}},mr=class extends ur{getIR(){return["Dummy"]}};function getTilingPatternIR(t,e,s){const i=lookupMatrix(e.getArray("Matrix"),xs),n=lookupNormalRect(e.getArray("BBox"),null);if(!n||n[2]-n[0]===0||n[3]-n[1]===0)throw new Ze("Invalid getTilingPatternIR /BBox array.");const a=e.get("XStep");if("number"!=typeof a)throw new Ze("Invalid getTilingPatternIR /XStep value.");const r=e.get("YStep");if("number"!=typeof r)throw new Ze("Invalid getTilingPatternIR /YStep value.");const o=e.get("PaintType");if(!Number.isInteger(o))throw new Ze("Invalid getTilingPatternIR /PaintType value.");const l=e.get("TilingType");if(!Number.isInteger(l))throw new Ze("Invalid getTilingPatternIR /TilingType value.");return["TilingPattern",s,t,i,n,a,r,o,l]}var br=[1.3877,1,1,1,.97801,.92482,.89552,.91133,.81988,.97566,.98152,.93548,.93548,1.2798,.85284,.92794,1,.96134,1.54657,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.82845,.82845,.85284,.85284,.85284,.75859,.92138,.83908,.7762,.73293,.87289,.73133,.7514,.81921,.87356,.95958,.59526,.75727,.69225,1.04924,.9121,.86943,.79795,.88198,.77958,.70864,.81055,.90399,.88653,.96017,.82577,.77892,.78257,.97507,1.54657,.97507,.85284,.89552,.90176,.88762,.8785,.75241,.8785,.90518,.95015,.77618,.8785,.88401,.91916,.86304,.88401,.91488,.8785,.8801,.8785,.8785,.91343,.7173,1.04106,.8785,.85075,.95794,.82616,.85162,.79492,.88331,1.69808,.88331,.85284,.97801,.89552,.91133,.89552,.91133,1.7801,.89552,1.24487,1.13254,1.12401,.96839,.85284,.68787,.70645,.85592,.90747,1.01466,1.0088,.90323,1,1.07463,1,.91056,.75806,1.19118,.96839,.78864,.82845,.84133,.75859,.83908,.83908,.83908,.83908,.83908,.83908,.77539,.73293,.73133,.73133,.73133,.73133,.95958,.95958,.95958,.95958,.88506,.9121,.86943,.86943,.86943,.86943,.86943,.85284,.87508,.90399,.90399,.90399,.90399,.77892,.79795,.90807,.88762,.88762,.88762,.88762,.88762,.88762,.8715,.75241,.90518,.90518,.90518,.90518,.88401,.88401,.88401,.88401,.8785,.8785,.8801,.8801,.8801,.8801,.8801,.90747,.89049,.8785,.8785,.8785,.8785,.85162,.8785,.85162,.83908,.88762,.83908,.88762,.83908,.88762,.73293,.75241,.73293,.75241,.73293,.75241,.73293,.75241,.87289,.83016,.88506,.93125,.73133,.90518,.73133,.90518,.73133,.90518,.73133,.90518,.73133,.90518,.81921,.77618,.81921,.77618,.81921,.77618,1,1,.87356,.8785,.91075,.89608,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.76229,.90167,.59526,.91916,1,1,.86304,.69225,.88401,1,1,.70424,.79468,.91926,.88175,.70823,.94903,.9121,.8785,1,1,.9121,.8785,.87802,.88656,.8785,.86943,.8801,.86943,.8801,.86943,.8801,.87402,.89291,.77958,.91343,1,1,.77958,.91343,.70864,.7173,.70864,.7173,.70864,.7173,.70864,.7173,1,1,.81055,.75841,.81055,1.06452,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.96017,.95794,.77892,.85162,.77892,.78257,.79492,.78257,.79492,.78257,.79492,.9297,.56892,.83908,.88762,.77539,.8715,.87508,.89049,1,1,.81055,1.04106,1.20528,1.20528,1,1.15543,.70674,.98387,.94721,1.33431,1.45894,.95161,1.06303,.83908,.80352,.57184,.6965,.56289,.82001,.56029,.81235,1.02988,.83908,.7762,.68156,.80367,.73133,.78257,.87356,.86943,.95958,.75727,.89019,1.04924,.9121,.7648,.86943,.87356,.79795,.78275,.81055,.77892,.9762,.82577,.99819,.84896,.95958,.77892,.96108,1.01407,.89049,1.02988,.94211,.96108,.8936,.84021,.87842,.96399,.79109,.89049,1.00813,1.02988,.86077,.87445,.92099,.84723,.86513,.8801,.75638,.85714,.78216,.79586,.87965,.94211,.97747,.78287,.97926,.84971,1.02988,.94211,.8801,.94211,.84971,.73133,1,1,1,1,1,1,1,1,1,1,1,1,.90264,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.90518,1,1,1,1,1,1,1,1,1,1,1,1,.90548,1,1,1,1,1,1,.96017,.95794,.96017,.95794,.96017,.95794,.77892,.85162,1,1,.89552,.90527,1,.90363,.92794,.92794,.92794,.92794,.87012,.87012,.87012,.89552,.89552,1.42259,.71143,1.06152,1,1,1.03372,1.03372,.97171,1.4956,2.2807,.93835,.83406,.91133,.84107,.91133,1,1,1,.72021,1,1.23108,.83489,.88525,.88525,.81499,.90527,1.81055,.90527,1.81055,1.31006,1.53711,.94434,1.08696,1,.95018,.77192,.85284,.90747,1.17534,.69825,.9716,1.37077,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.08004,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,.90727,.90727,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],wr={lineHeight:1.2207,lineGap:.2207},yr=[1.3877,1,1,1,.97801,.92482,.89552,.91133,.81988,.97566,.98152,.93548,.93548,1.2798,.85284,.92794,1,.96134,1.56239,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.82845,.82845,.85284,.85284,.85284,.75859,.92138,.83908,.7762,.71805,.87289,.73133,.7514,.81921,.87356,.95958,.59526,.75727,.69225,1.04924,.90872,.85938,.79795,.87068,.77958,.69766,.81055,.90399,.88653,.96068,.82577,.77892,.78257,.97507,1.529,.97507,.85284,.89552,.90176,.94908,.86411,.74012,.86411,.88323,.95015,.86411,.86331,.88401,.91916,.86304,.88401,.9039,.86331,.86331,.86411,.86411,.90464,.70852,1.04106,.86331,.84372,.95794,.82616,.84548,.79492,.88331,1.69808,.88331,.85284,.97801,.89552,.91133,.89552,.91133,1.7801,.89552,1.24487,1.13254,1.19129,.96839,.85284,.68787,.70645,.85592,.90747,1.01466,1.0088,.90323,1,1.07463,1,.91056,.75806,1.19118,.96839,.78864,.82845,.84133,.75859,.83908,.83908,.83908,.83908,.83908,.83908,.77539,.71805,.73133,.73133,.73133,.73133,.95958,.95958,.95958,.95958,.88506,.90872,.85938,.85938,.85938,.85938,.85938,.85284,.87068,.90399,.90399,.90399,.90399,.77892,.79795,.90807,.94908,.94908,.94908,.94908,.94908,.94908,.85887,.74012,.88323,.88323,.88323,.88323,.88401,.88401,.88401,.88401,.8785,.86331,.86331,.86331,.86331,.86331,.86331,.90747,.89049,.86331,.86331,.86331,.86331,.84548,.86411,.84548,.83908,.94908,.83908,.94908,.83908,.94908,.71805,.74012,.71805,.74012,.71805,.74012,.71805,.74012,.87289,.79538,.88506,.92726,.73133,.88323,.73133,.88323,.73133,.88323,.73133,.88323,.73133,.88323,.81921,.86411,.81921,.86411,.81921,.86411,1,1,.87356,.86331,.91075,.8777,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.76467,.90167,.59526,.91916,1,1,.86304,.69225,.88401,1,1,.70424,.77312,.91926,.88175,.70823,.94903,.90872,.86331,1,1,.90872,.86331,.86906,.88116,.86331,.85938,.86331,.85938,.86331,.85938,.86331,.87402,.86549,.77958,.90464,1,1,.77958,.90464,.69766,.70852,.69766,.70852,.69766,.70852,.69766,.70852,1,1,.81055,.75841,.81055,1.06452,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.96068,.95794,.77892,.84548,.77892,.78257,.79492,.78257,.79492,.78257,.79492,.9297,.56892,.83908,.94908,.77539,.85887,.87068,.89049,1,1,.81055,1.04106,1.20528,1.20528,1,1.15543,.70088,.98387,.94721,1.33431,1.45894,.95161,1.48387,.83908,.80352,.57118,.6965,.56347,.79179,.55853,.80346,1.02988,.83908,.7762,.67174,.86036,.73133,.78257,.87356,.86441,.95958,.75727,.89019,1.04924,.90872,.74889,.85938,.87891,.79795,.7957,.81055,.77892,.97447,.82577,.97466,.87179,.95958,.77892,.94252,.95612,.8753,1.02988,.92733,.94252,.87411,.84021,.8728,.95612,.74081,.8753,1.02189,1.02988,.84814,.87445,.91822,.84723,.85668,.86331,.81344,.87581,.76422,.82046,.96057,.92733,.99375,.78022,.95452,.86015,1.02988,.92733,.86331,.92733,.86015,.73133,1,1,1,1,1,1,1,1,1,1,1,1,.90631,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.88323,1,1,1,1,1,1,1,1,1,1,1,1,.85174,1,1,1,1,1,1,.96068,.95794,.96068,.95794,.96068,.95794,.77892,.84548,1,1,.89552,.90527,1,.90363,.92794,.92794,.92794,.89807,.87012,.87012,.87012,.89552,.89552,1.42259,.71094,1.06152,1,1,1.03372,1.03372,.97171,1.4956,2.2807,.92972,.83406,.91133,.83326,.91133,1,1,1,.72021,1,1.23108,.83489,.88525,.88525,.81499,.90616,1.81055,.90527,1.81055,1.3107,1.53711,.94434,1.08696,1,.95018,.77192,.85284,.90747,1.17534,.69825,.9716,1.37077,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.08004,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,.90727,.90727,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],xr={lineHeight:1.2207,lineGap:.2207},vr=[1.3877,1,1,1,1.17223,1.1293,.89552,.91133,.80395,1.02269,1.15601,.91056,.91056,1.2798,.85284,.89807,1,.90861,1.39543,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.96309,.96309,.85284,.85284,.85284,.83319,.88071,.8675,.81552,.72346,.85193,.73206,.7522,.81105,.86275,.90685,.6377,.77892,.75593,1.02638,.89249,.84118,.77452,.85374,.75186,.67789,.79776,.88844,.85066,.94309,.77818,.7306,.76659,1.10369,1.38313,1.10369,1.06139,.89552,.8739,.9245,.9245,.83203,.9245,.85865,1.09842,.9245,.9245,1.03297,1.07692,.90918,1.03297,.94959,.9245,.92274,.9245,.9245,1.02933,.77832,1.20562,.9245,.8916,.98986,.86621,.89453,.79004,.94152,1.77256,.94152,.85284,.97801,.89552,.91133,.89552,.91133,1.91729,.89552,1.17889,1.13254,1.16359,.92098,.85284,.68787,.71353,.84737,.90747,1.0088,1.0044,.87683,1,1.09091,1,.92229,.739,1.15642,.92098,.76288,.80504,.80972,.75859,.8675,.8675,.8675,.8675,.8675,.8675,.76318,.72346,.73206,.73206,.73206,.73206,.90685,.90685,.90685,.90685,.86477,.89249,.84118,.84118,.84118,.84118,.84118,.85284,.84557,.88844,.88844,.88844,.88844,.7306,.77452,.86331,.9245,.9245,.9245,.9245,.9245,.9245,.84843,.83203,.85865,.85865,.85865,.85865,.82601,.82601,.82601,.82601,.94469,.9245,.92274,.92274,.92274,.92274,.92274,.90747,.86651,.9245,.9245,.9245,.9245,.89453,.9245,.89453,.8675,.9245,.8675,.9245,.8675,.9245,.72346,.83203,.72346,.83203,.72346,.83203,.72346,.83203,.85193,.8875,.86477,.99034,.73206,.85865,.73206,.85865,.73206,.85865,.73206,.85865,.73206,.85865,.81105,.9245,.81105,.9245,.81105,.9245,1,1,.86275,.9245,.90872,.93591,.90685,.82601,.90685,.82601,.90685,.82601,.90685,1.03297,.90685,.82601,.77896,1.05611,.6377,1.07692,1,1,.90918,.75593,1.03297,1,1,.76032,.9375,.98156,.93407,.77261,1.11429,.89249,.9245,1,1,.89249,.9245,.92534,.86698,.9245,.84118,.92274,.84118,.92274,.84118,.92274,.8667,.86291,.75186,1.02933,1,1,.75186,1.02933,.67789,.77832,.67789,.77832,.67789,.77832,.67789,.77832,1,1,.79776,.97655,.79776,1.23023,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.94309,.98986,.7306,.89453,.7306,.76659,.79004,.76659,.79004,.76659,.79004,1.09231,.54873,.8675,.9245,.76318,.84843,.84557,.86651,1,1,.79776,1.20562,1.18622,1.18622,1,1.1437,.67009,.96334,.93695,1.35191,1.40909,.95161,1.48387,.8675,.90861,.6192,.7363,.64824,.82411,.56321,.85696,1.23516,.8675,.81552,.7286,.84134,.73206,.76659,.86275,.84369,.90685,.77892,.85871,1.02638,.89249,.75828,.84118,.85984,.77452,.76466,.79776,.7306,.90782,.77818,.903,.87291,.90685,.7306,.99058,1.03667,.94635,1.23516,.9849,.99058,.92393,.8916,.942,1.03667,.75026,.94635,1.0297,1.23516,.90918,.94048,.98217,.89746,.84153,.92274,.82507,.88832,.84438,.88178,1.03525,.9849,1.00225,.78086,.97248,.89404,1.23516,.9849,.92274,.9849,.89404,.73206,1,1,1,1,1,1,1,1,1,1,1,1,.89693,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.85865,1,1,1,1,1,1,1,1,1,1,1,1,.90933,1,1,1,1,1,1,.94309,.98986,.94309,.98986,.94309,.98986,.7306,.89453,1,1,.89552,.90527,1,.90186,1.12308,1.12308,1.12308,1.12308,1.2566,1.2566,1.2566,.89552,.89552,1.42259,.68994,1.03809,1,1,1.0176,1.0176,1.11523,1.4956,2.01462,.97858,.82616,.91133,.83437,.91133,1,1,1,.70508,1,1.23108,.79801,.84426,.84426,.774,.90572,1.81055,.90749,1.81055,1.28809,1.55469,.94434,1.07806,1,.97094,.7589,.85284,.90747,1.19658,.69825,.97622,1.33512,.90747,.90747,.85284,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.0336,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,1.05859,1.05859,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Ar={lineHeight:1.2207,lineGap:.2207},kr=[1.3877,1,1,1,1.17223,1.1293,.89552,.91133,.80395,1.02269,1.15601,.91056,.91056,1.2798,.85284,.89807,1,.90861,1.39016,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.96309,.96309,.85284,.85284,.85284,.83319,.88071,.8675,.81552,.73834,.85193,.73206,.7522,.81105,.86275,.90685,.6377,.77892,.75593,1.02638,.89385,.85122,.77452,.86503,.75186,.68887,.79776,.88844,.85066,.94258,.77818,.7306,.76659,1.10369,1.39016,1.10369,1.06139,.89552,.8739,.86128,.94469,.8457,.94469,.89464,1.09842,.84636,.94469,1.03297,1.07692,.90918,1.03297,.95897,.94469,.9482,.94469,.94469,1.04692,.78223,1.20562,.94469,.90332,.98986,.86621,.90527,.79004,.94152,1.77256,.94152,.85284,.97801,.89552,.91133,.89552,.91133,1.91729,.89552,1.17889,1.13254,1.08707,.92098,.85284,.68787,.71353,.84737,.90747,1.0088,1.0044,.87683,1,1.09091,1,.92229,.739,1.15642,.92098,.76288,.80504,.80972,.75859,.8675,.8675,.8675,.8675,.8675,.8675,.76318,.73834,.73206,.73206,.73206,.73206,.90685,.90685,.90685,.90685,.86477,.89385,.85122,.85122,.85122,.85122,.85122,.85284,.85311,.88844,.88844,.88844,.88844,.7306,.77452,.86331,.86128,.86128,.86128,.86128,.86128,.86128,.8693,.8457,.89464,.89464,.89464,.89464,.82601,.82601,.82601,.82601,.94469,.94469,.9482,.9482,.9482,.9482,.9482,.90747,.86651,.94469,.94469,.94469,.94469,.90527,.94469,.90527,.8675,.86128,.8675,.86128,.8675,.86128,.73834,.8457,.73834,.8457,.73834,.8457,.73834,.8457,.85193,.92454,.86477,.9921,.73206,.89464,.73206,.89464,.73206,.89464,.73206,.89464,.73206,.89464,.81105,.84636,.81105,.84636,.81105,.84636,1,1,.86275,.94469,.90872,.95786,.90685,.82601,.90685,.82601,.90685,.82601,.90685,1.03297,.90685,.82601,.77741,1.05611,.6377,1.07692,1,1,.90918,.75593,1.03297,1,1,.76032,.90452,.98156,1.11842,.77261,1.11429,.89385,.94469,1,1,.89385,.94469,.95877,.86901,.94469,.85122,.9482,.85122,.9482,.85122,.9482,.8667,.90016,.75186,1.04692,1,1,.75186,1.04692,.68887,.78223,.68887,.78223,.68887,.78223,.68887,.78223,1,1,.79776,.92188,.79776,1.23023,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.94258,.98986,.7306,.90527,.7306,.76659,.79004,.76659,.79004,.76659,.79004,1.09231,.54873,.8675,.86128,.76318,.8693,.85311,.86651,1,1,.79776,1.20562,1.18622,1.18622,1,1.1437,.67742,.96334,.93695,1.35191,1.40909,.95161,1.48387,.86686,.90861,.62267,.74359,.65649,.85498,.56963,.88254,1.23516,.8675,.81552,.75443,.84503,.73206,.76659,.86275,.85122,.90685,.77892,.85746,1.02638,.89385,.75657,.85122,.86275,.77452,.74171,.79776,.7306,.95165,.77818,.89772,.88831,.90685,.7306,.98142,1.02191,.96576,1.23516,.99018,.98142,.9236,.89258,.94035,1.02191,.78848,.96576,.9561,1.23516,.90918,.92578,.95424,.89746,.83969,.9482,.80113,.89442,.85208,.86155,.98022,.99018,1.00452,.81209,.99247,.89181,1.23516,.99018,.9482,.99018,.89181,.73206,1,1,1,1,1,1,1,1,1,1,1,1,.88844,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.89464,1,1,1,1,1,1,1,1,1,1,1,1,.96766,1,1,1,1,1,1,.94258,.98986,.94258,.98986,.94258,.98986,.7306,.90527,1,1,.89552,.90527,1,.90186,1.12308,1.12308,1.12308,1.12308,1.2566,1.2566,1.2566,.89552,.89552,1.42259,.69043,1.03809,1,1,1.0176,1.0176,1.11523,1.4956,2.01462,.99331,.82616,.91133,.84286,.91133,1,1,1,.70508,1,1.23108,.79801,.84426,.84426,.774,.90527,1.81055,.90527,1.81055,1.28809,1.55469,.94434,1.07806,1,.97094,.7589,.85284,.90747,1.19658,.69825,.97622,1.33512,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.0336,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,1.05859,1.05859,1,1,1,1.07185,.99413,.96334,1.08065,1,1,1,1,1,1,1,1,1,1,1],Sr={lineHeight:1.2207,lineGap:.2207},Cr=[.76116,1,1,1.0006,.99998,.99974,.99973,.99973,.99982,.99977,1.00087,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99998,1,1.00003,1.00003,1.00003,1.00026,.9999,.99977,.99977,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,.99973,.99977,1.00026,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,.99998,1.0006,.99998,1.00003,.99973,.99998,.99973,1.00026,.99973,1.00026,.99973,.99998,1.00026,1.00026,1.0006,1.0006,.99973,1.0006,.99982,1.00026,1.00026,1.00026,1.00026,.99959,.99973,.99998,1.00026,.99973,1.00022,.99973,.99973,1,.99959,1.00077,.99959,1.00003,.99998,.99973,.99973,.99973,.99973,1.00077,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.99973,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,.99977,.99977,.99977,.99977,.99977,.99977,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,.99973,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.06409,1.00026,1.00026,1.00026,1.00026,1.00026,.99973,1.00026,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,1.03374,.99977,1.00026,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,.99977,1.00026,.99977,1.00026,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.00042,.99973,.99973,1.0006,.99977,.99973,.99973,1.00026,1.0006,1.00026,1.0006,1.00026,1.03828,1.00026,.99999,1.00026,1.0006,.99977,1.00026,.99977,1.00026,.99977,1.00026,.9993,.9998,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1,1.00016,.99977,.99959,.99977,.99959,.99977,.99959,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00026,.99998,1.00026,.8121,1.00026,.99998,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,1.00016,1.00022,1.00001,.99973,1.00001,1.00026,1,1.00026,1,1.00026,1,1.0006,.99973,.99977,.99973,1,.99982,1.00022,1.00026,1.00001,.99973,1.00026,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,1.00034,.99977,1,.99997,1.00026,1.00078,1.00036,.99973,1.00013,1.0006,.99977,.99977,.99988,.85148,1.00001,1.00026,.99977,1.00022,1.0006,.99977,1.00001,.99999,.99977,1.00069,1.00022,.99977,1.00001,.99984,1.00026,1.00001,1.00024,1.00001,.9999,1,1.0006,1.00001,1.00041,.99962,1.00026,1.0006,.99995,1.00041,.99942,.99973,.99927,1.00082,.99902,1.00026,1.00087,1.0006,1.00069,.99973,.99867,.99973,.9993,1.00026,1.00049,1.00056,1,.99988,.99935,.99995,.99954,1.00055,.99945,1.00032,1.0006,.99995,1.00026,.99995,1.00032,1.00001,1.00008,.99971,1.00019,.9994,1.00001,1.0006,1.00044,.99973,1.00023,1.00047,1,.99942,.99561,.99989,1.00035,.99977,1.00035,.99977,1.00019,.99944,1.00001,1.00021,.99926,1.00035,1.00035,.99942,1.00048,.99999,.99977,1.00022,1.00035,1.00001,.99977,1.00026,.99989,1.00057,1.00001,.99936,1.00052,1.00012,.99996,1.00043,1,1.00035,.9994,.99976,1.00035,.99973,1.00052,1.00041,1.00119,1.00037,.99973,1.00002,.99986,1.00041,1.00041,.99902,.9996,1.00034,.99999,1.00026,.99999,1.00026,.99973,1.00052,.99973,1,.99973,1.00041,1.00075,.9994,1.0003,.99999,1,1.00041,.99955,1,.99915,.99973,.99973,1.00026,1.00119,.99955,.99973,1.0006,.99911,1.0006,1.00026,.99972,1.00026,.99902,1.00041,.99973,.99999,1,1,1.00038,1.0005,1.00016,1.00022,1.00016,1.00022,1.00016,1.00022,1.00001,.99973,1,1,.99973,1,1,.99955,1.0006,1.0006,1.0006,1.0006,1,1,1,.99973,.99973,.99972,1,1,1.00106,.99999,.99998,.99998,.99999,.99998,1.66475,1,.99973,.99973,1.00023,.99973,.99971,1.00047,1.00023,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1,1,1,1,1,1,1,.99972,1,1.20985,1.39713,1.00003,1.00031,1.00015,1,.99561,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.99972,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1],_r={lineHeight:1.2,lineGap:.2},Ir=[.76116,1,1,1.0006,.99998,.99974,.99973,.99973,.99982,.99977,1.00087,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99998,1,1.00003,1.00003,1.00003,1.00026,.9999,.99977,.99977,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,.99973,.99977,1.00026,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,.99998,1.0006,.99998,1.00003,.99973,.99998,.99973,1.00026,.99973,1.00026,.99973,.99998,1.00026,1.00026,1.0006,1.0006,.99973,1.0006,.99982,1.00026,1.00026,1.00026,1.00026,.99959,.99973,.99998,1.00026,.99973,1.00022,.99973,.99973,1,.99959,1.00077,.99959,1.00003,.99998,.99973,.99973,.99973,.99973,1.00077,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.99973,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,.99977,.99977,.99977,.99977,.99977,.99977,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,.99973,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.06409,1.00026,1.00026,1.00026,1.00026,1.00026,.99973,1.00026,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,1.0044,.99977,1.00026,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,.99977,1.00026,.99977,1.00026,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99971,.99973,.99973,1.0006,.99977,.99973,.99973,1.00026,1.0006,1.00026,1.0006,1.00026,1.01011,1.00026,.99999,1.00026,1.0006,.99977,1.00026,.99977,1.00026,.99977,1.00026,.9993,.9998,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1,1.00016,.99977,.99959,.99977,.99959,.99977,.99959,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00026,.99998,1.00026,.8121,1.00026,.99998,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,1.00016,1.00022,1.00001,.99973,1.00001,1.00026,1,1.00026,1,1.00026,1,1.0006,.99973,.99977,.99973,1,.99982,1.00022,1.00026,1.00001,.99973,1.00026,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99977,1,1,1.00026,.99969,.99972,.99981,.9998,1.0006,.99977,.99977,1.00022,.91155,1.00001,1.00026,.99977,1.00022,1.0006,.99977,1.00001,.99999,.99977,.99966,1.00022,1.00032,1.00001,.99944,1.00026,1.00001,.99968,1.00001,1.00047,1,1.0006,1.00001,.99981,1.00101,1.00026,1.0006,.99948,.99981,1.00064,.99973,.99942,1.00101,1.00061,1.00026,1.00069,1.0006,1.00014,.99973,1.01322,.99973,1.00065,1.00026,1.00012,.99923,1,1.00064,1.00076,.99948,1.00055,1.00063,1.00007,.99943,1.0006,.99948,1.00026,.99948,.99943,1.00001,1.00001,1.00029,1.00038,1.00035,1.00001,1.0006,1.0006,.99973,.99978,1.00001,1.00057,.99989,.99967,.99964,.99967,.99977,.99999,.99977,1.00038,.99977,1.00001,.99973,1.00066,.99967,.99967,1.00041,.99998,.99999,.99977,1.00022,.99967,1.00001,.99977,1.00026,.99964,1.00031,1.00001,.99999,.99999,1,1.00023,1,1,.99999,1.00035,1.00001,.99999,.99973,.99977,.99999,1.00058,.99973,.99973,.99955,.9995,1.00026,1.00026,1.00032,.99989,1.00034,.99999,1.00026,1.00026,1.00026,.99973,.45998,.99973,1.00026,.99973,1.00001,.99999,.99982,.99994,.99996,1,1.00042,1.00044,1.00029,1.00023,.99973,.99973,1.00026,.99949,1.00002,.99973,1.0006,1.0006,1.0006,.99975,1.00026,1.00026,1.00032,.98685,.99973,1.00026,1,1,.99966,1.00044,1.00016,1.00022,1.00016,1.00022,1.00016,1.00022,1.00001,.99973,1,1,.99973,1,1,.99955,1.0006,1.0006,1.0006,1.0006,1,1,1,.99973,.99973,.99972,1,1,1.00106,.99999,.99998,.99998,.99999,.99998,1.66475,1,.99973,.99973,1,.99973,.99971,.99978,1,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1.00098,1,1,1,1.00049,1,1,.99972,1,1.20985,1.39713,1.00003,1.00031,1.00015,1,.99561,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.99972,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1],Tr={lineHeight:1.35,lineGap:.2},Mr=[.76116,1,1,1.0006,1.0006,1.00006,.99973,.99973,.99982,1.00001,1.00043,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.0006,1,1.00003,1.00003,1.00003,.99973,.99987,1.00001,1.00001,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,1,1.00001,.99973,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,1.0006,1.0006,1.0006,.99949,.99973,.99998,.99973,.99973,1,.99973,.99973,1.0006,.99973,.99973,.99924,.99924,1,.99924,.99999,.99973,.99973,.99973,.99973,.99998,1,1.0006,.99973,1,.99977,1,1,1,1.00005,1.0009,1.00005,1.00003,.99998,.99973,.99973,.99973,.99973,1.0009,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.9998,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,1.00001,1.00001,1.00001,1.00001,1.00001,1.00001,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,1,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.06409,1.00026,.99973,.99973,.99973,.99973,1,.99973,1,1.00001,.99973,1.00001,.99973,1.00001,.99973,.99977,1,.99977,1,.99977,1,.99977,1,.99977,1.0288,.99977,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,.99977,.99973,.99977,.99973,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99924,1.0006,1.0006,.99946,1.00034,1,.99924,1.00001,1,1,.99973,.99924,.99973,.99924,.99973,1.06311,.99973,1.00024,.99973,.99924,.99977,.99973,.99977,.99973,.99977,.99973,1.00041,.9998,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1,1.00016,.99977,.99998,.99977,.99998,.99977,.99998,1.00001,1,1.00001,1,1.00001,1,1.00001,1,1.00026,1.0006,1.00026,.89547,1.00026,1.0006,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,1.00016,.99977,1.00001,1,1.00001,1.00026,1,1.00026,1,1.00026,1,.99924,.99973,1.00001,.99973,1,.99982,1.00022,1.00026,1.00001,1,1.00026,1.0006,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,1.00001,1,1.00054,.99977,1.00084,1.00007,.99973,1.00013,.99924,1.00001,1.00001,.99945,.91221,1.00001,1.00026,.99977,1.00022,1.0006,1.00001,1.00001,.99999,.99977,.99933,1.00022,1.00054,1.00001,1.00065,1.00026,1.00001,1.0001,1.00001,1.00052,1,1.0006,1.00001,.99945,.99897,.99968,.99924,1.00036,.99945,.99949,1,1.0006,.99897,.99918,.99968,.99911,.99924,1,.99962,1.01487,1,1.0005,.99973,1.00012,1.00043,1,.99995,.99994,1.00036,.99947,1.00019,1.00063,1.00025,.99924,1.00036,.99973,1.00036,1.00025,1.00001,1.00001,1.00027,1.0001,1.00068,1.00001,1.0006,1.0006,1,1.00008,.99957,.99972,.9994,.99954,.99975,1.00051,1.00001,1.00019,1.00001,1.0001,.99986,1.00001,1.00001,1.00038,.99954,.99954,.9994,1.00066,.99999,.99977,1.00022,1.00054,1.00001,.99977,1.00026,.99975,1.0001,1.00001,.99993,.9995,.99955,1.00016,.99978,.99974,1.00019,1.00022,.99955,1.00053,.99973,1.00089,1.00005,.99967,1.00048,.99973,1.00002,1.00034,.99973,.99973,.99964,1.00006,1.00066,.99947,.99973,.98894,.99973,1,.44898,1,.99946,1,1.00039,1.00082,.99991,.99991,.99985,1.00022,1.00023,1.00061,1.00006,.99966,.99973,.99973,.99973,1.00019,1.0008,1,.99924,.99924,.99924,.99983,1.00044,.99973,.99964,.98332,1,.99973,1,1,.99962,.99895,1.00016,.99977,1.00016,.99977,1.00016,.99977,1.00001,1,1,1,.99973,1,1,.99955,.99924,.99924,.99924,.99924,.99998,.99998,.99998,.99973,.99973,.99972,1,1,1.00267,.99999,.99998,.99998,1,.99998,1.66475,1,.99973,.99973,1.00023,.99973,1.00423,.99925,.99999,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1.00049,1,1.00245,1,1,1,1,.96329,1,1.20985,1.39713,1.00003,.8254,1.00015,1,1.00035,1.00027,1.00031,1.00031,1.00003,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.95317,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1],Er={lineHeight:1.35,lineGap:.2},Fr=[.76116,1,1,1.0006,1.0006,1.00006,.99973,.99973,.99982,1.00001,1.00043,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.0006,1,1.00003,1.00003,1.00003,.99973,.99987,1.00001,1.00001,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,1,1.00001,.99973,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,1.0006,1.0006,1.0006,.99949,.99973,.99998,.99973,.99973,1,.99973,.99973,1.0006,.99973,.99973,.99924,.99924,1,.99924,.99999,.99973,.99973,.99973,.99973,.99998,1,1.0006,.99973,1,.99977,1,1,1,1.00005,1.0009,1.00005,1.00003,.99998,.99973,.99973,.99973,.99973,1.0009,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.9998,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,1.00001,1.00001,1.00001,1.00001,1.00001,1.00001,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,1,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.06409,1.00026,.99973,.99973,.99973,.99973,1,.99973,1,1.00001,.99973,1.00001,.99973,1.00001,.99973,.99977,1,.99977,1,.99977,1,.99977,1,.99977,1.04596,.99977,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,.99977,.99973,.99977,.99973,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99924,1.0006,1.0006,1.00019,1.00034,1,.99924,1.00001,1,1,.99973,.99924,.99973,.99924,.99973,1.02572,.99973,1.00005,.99973,.99924,.99977,.99973,.99977,.99973,.99977,.99973,.99999,.9998,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1,1.00016,.99977,.99998,.99977,.99998,.99977,.99998,1.00001,1,1.00001,1,1.00001,1,1.00001,1,1.00026,1.0006,1.00026,.84533,1.00026,1.0006,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,1.00016,.99977,1.00001,1,1.00001,1.00026,1,1.00026,1,1.00026,1,.99924,.99973,1.00001,.99973,1,.99982,1.00022,1.00026,1.00001,1,1.00026,1.0006,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99928,1,.99977,1.00013,1.00055,.99947,.99945,.99941,.99924,1.00001,1.00001,1.0004,.91621,1.00001,1.00026,.99977,1.00022,1.0006,1.00001,1.00005,.99999,.99977,1.00015,1.00022,.99977,1.00001,.99973,1.00026,1.00001,1.00019,1.00001,.99946,1,1.0006,1.00001,.99978,1.00045,.99973,.99924,1.00023,.99978,.99966,1,1.00065,1.00045,1.00019,.99973,.99973,.99924,1,1,.96499,1,1.00055,.99973,1.00008,1.00027,1,.9997,.99995,1.00023,.99933,1.00019,1.00015,1.00031,.99924,1.00023,.99973,1.00023,1.00031,1.00001,.99928,1.00029,1.00092,1.00035,1.00001,1.0006,1.0006,1,.99988,.99975,1,1.00082,.99561,.9996,1.00035,1.00001,.99962,1.00001,1.00092,.99964,1.00001,.99963,.99999,1.00035,1.00035,1.00082,.99962,.99999,.99977,1.00022,1.00035,1.00001,.99977,1.00026,.9996,.99967,1.00001,1.00034,1.00074,1.00054,1.00053,1.00063,.99971,.99962,1.00035,.99975,.99977,.99973,1.00043,.99953,1.0007,.99915,.99973,1.00008,.99892,1.00073,1.00073,1.00114,.99915,1.00073,.99955,.99973,1.00092,.99973,1,.99998,1,1.0003,1,1.00043,1.00001,.99969,1.0003,1,1.00035,1.00001,.9995,1,1.00092,.99973,.99973,.99973,1.0007,.9995,1,.99924,1.0006,.99924,.99972,1.00062,.99973,1.00114,1.00073,1,.99955,1,1,1.00047,.99968,1.00016,.99977,1.00016,.99977,1.00016,.99977,1.00001,1,1,1,.99973,1,1,.99955,.99924,.99924,.99924,.99924,.99998,.99998,.99998,.99973,.99973,.99972,1,1,1.00267,.99999,.99998,.99998,1,.99998,1.66475,1,.99973,.99973,1.00023,.99973,.99971,.99925,1.00023,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1,1,1,1,1,1,1,.96329,1,1.20985,1.39713,1.00003,.8254,1.00015,1,1.00035,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.95317,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Dr={lineHeight:1.2,lineGap:.2},Rr=[365,0,333,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,556,556,280,556,333,737,370,556,584,737,552,400,549,333,333,333,576,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556,722,556,722,556,722,556,722,556,722,556,722,556,722,556,722,719,722,611,667,556,667,556,667,556,667,556,667,556,778,611,778,611,778,611,778,611,722,611,722,611,278,278,278,278,278,278,278,278,278,278,785,556,556,278,722,556,556,611,278,611,278,611,385,611,479,611,278,722,611,722,611,722,611,708,723,611,778,611,778,611,778,611,1e3,944,722,389,722,389,722,389,667,556,667,556,667,556,667,556,611,333,611,479,611,333,722,611,722,611,722,611,722,611,722,611,722,611,944,778,667,556,667,611,500,611,500,611,500,278,556,722,556,1e3,889,778,611,667,556,611,333,333,333,333,333,333,333,333,333,333,333,465,722,333,853,906,474,825,927,838,278,722,722,601,719,667,611,722,778,278,722,667,833,722,644,778,722,667,600,611,667,821,667,809,802,278,667,615,451,611,278,582,615,610,556,606,475,460,611,541,278,558,556,612,556,445,611,766,619,520,684,446,582,715,576,753,845,278,582,611,582,845,667,669,885,567,711,667,278,276,556,1094,1062,875,610,722,622,719,722,719,722,567,712,667,904,626,719,719,610,702,833,722,778,719,667,722,611,622,854,667,730,703,1005,1019,870,979,719,711,1031,719,556,618,615,417,635,556,709,497,615,615,500,635,740,604,611,604,611,556,490,556,875,556,615,581,833,844,729,854,615,552,854,583,556,556,611,417,552,556,278,281,278,969,906,611,500,615,556,604,778,611,487,447,944,778,944,778,944,778,667,556,333,333,556,1e3,1e3,552,278,278,278,278,500,500,500,556,556,350,1e3,1e3,240,479,333,333,604,333,167,396,556,556,1094,556,885,489,1115,1e3,768,600,834,834,834,834,1e3,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,722,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,611,611,333,333,333,333,333,333,333,333,222,222,333,333,333,333,333,333,333,333],Br=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],Pr=[365,0,333,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,556,556,280,556,333,737,370,556,584,737,552,400,549,333,333,333,576,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556,722,556,722,556,722,556,722,556,722,556,722,556,722,556,722,740,722,611,667,556,667,556,667,556,667,556,667,556,778,611,778,611,778,611,778,611,722,611,722,611,278,278,278,278,278,278,278,278,278,278,782,556,556,278,722,556,556,611,278,611,278,611,396,611,479,611,278,722,611,722,611,722,611,708,723,611,778,611,778,611,778,611,1e3,944,722,389,722,389,722,389,667,556,667,556,667,556,667,556,611,333,611,479,611,333,722,611,722,611,722,611,722,611,722,611,722,611,944,778,667,556,667,611,500,611,500,611,500,278,556,722,556,1e3,889,778,611,667,556,611,333,333,333,333,333,333,333,333,333,333,333,333,722,333,854,906,473,844,930,847,278,722,722,610,671,667,611,722,778,278,722,667,833,722,657,778,718,667,590,611,667,822,667,829,781,278,667,620,479,611,278,591,620,621,556,610,479,492,611,558,278,566,556,603,556,450,611,712,605,532,664,409,591,704,578,773,834,278,591,611,591,834,667,667,886,614,719,667,278,278,556,1094,1042,854,622,719,677,719,722,708,722,614,722,667,927,643,719,719,615,687,833,722,778,719,667,722,611,677,781,667,729,708,979,989,854,1e3,708,719,1042,729,556,619,604,534,618,556,736,510,611,611,507,622,740,604,611,611,611,556,889,556,885,556,646,583,889,935,707,854,594,552,865,589,556,556,611,469,563,556,278,278,278,969,906,611,507,619,556,611,778,611,575,467,944,778,944,778,944,778,667,556,333,333,556,1e3,1e3,552,278,278,278,278,500,500,500,556,556,350,1e3,1e3,240,479,333,333,604,333,167,396,556,556,1104,556,885,516,1146,1e3,768,600,834,834,834,834,999,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,722,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,611,611,333,333,333,333,333,333,333,333,222,222,333,333,333,333,333,333,333,333],Nr=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],Or=[365,0,333,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,556,556,260,556,333,737,370,556,584,737,552,400,549,333,333,333,576,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500,667,556,667,556,667,556,722,500,722,500,722,500,722,500,722,625,722,556,667,556,667,556,667,556,667,556,667,556,778,556,778,556,778,556,778,556,722,556,722,556,278,278,278,278,278,278,278,222,278,278,733,444,500,222,667,500,500,556,222,556,222,556,281,556,400,556,222,722,556,722,556,722,556,615,723,556,778,556,778,556,778,556,1e3,944,722,333,722,333,722,333,667,500,667,500,667,500,667,500,611,278,611,354,611,278,722,556,722,556,722,556,722,556,722,556,722,556,944,722,667,500,667,611,500,611,500,611,500,222,556,667,556,1e3,889,778,611,667,500,611,278,333,333,333,333,333,333,333,333,333,333,333,667,278,789,846,389,794,865,775,222,667,667,570,671,667,611,722,778,278,667,667,833,722,648,778,725,667,600,611,667,837,667,831,761,278,667,570,439,555,222,550,570,571,500,556,439,463,555,542,222,500,492,548,500,447,556,670,573,486,603,374,550,652,546,728,779,222,550,556,550,779,667,667,843,544,708,667,278,278,500,1066,982,844,589,715,639,724,667,651,667,544,704,667,917,614,715,715,589,686,833,722,778,725,667,722,611,639,795,667,727,673,920,923,805,886,651,694,1022,682,556,562,522,493,553,556,688,465,556,556,472,564,686,550,556,556,556,500,833,500,835,500,572,518,830,851,621,736,526,492,752,534,556,556,556,378,496,500,222,222,222,910,828,556,472,565,500,556,778,556,492,339,944,722,944,722,944,722,667,500,333,333,556,1e3,1e3,552,222,222,222,222,333,333,333,556,556,350,1e3,1e3,188,354,333,333,500,333,167,365,556,556,1094,556,885,323,1083,1e3,768,600,834,834,834,834,1e3,500,998,500,1e3,500,500,494,612,823,713,584,549,713,979,719,274,549,549,584,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,500,500,333,333,333,333,333,333,333,333,222,222,294,294,324,324,316,328,398,285],Lr=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],Ur=[365,0,333,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,556,556,260,556,333,737,370,556,584,737,552,400,549,333,333,333,576,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500,667,556,667,556,667,556,722,500,722,500,722,500,722,500,722,615,722,556,667,556,667,556,667,556,667,556,667,556,778,556,778,556,778,556,778,556,722,556,722,556,278,278,278,278,278,278,278,222,278,278,735,444,500,222,667,500,500,556,222,556,222,556,292,556,334,556,222,722,556,722,556,722,556,604,723,556,778,556,778,556,778,556,1e3,944,722,333,722,333,722,333,667,500,667,500,667,500,667,500,611,278,611,375,611,278,722,556,722,556,722,556,722,556,722,556,722,556,944,722,667,500,667,611,500,611,500,611,500,222,556,667,556,1e3,889,778,611,667,500,611,278,333,333,333,333,333,333,333,333,333,333,333,667,278,784,838,384,774,855,752,222,667,667,551,668,667,611,722,778,278,667,668,833,722,650,778,722,667,618,611,667,798,667,835,748,278,667,578,446,556,222,547,578,575,500,557,446,441,556,556,222,500,500,576,500,448,556,690,569,482,617,395,547,648,525,713,781,222,547,556,547,781,667,667,865,542,719,667,278,278,500,1057,1010,854,583,722,635,719,667,656,667,542,677,667,923,604,719,719,583,656,833,722,778,719,667,722,611,635,760,667,740,667,917,938,792,885,656,719,1010,722,556,573,531,365,583,556,669,458,559,559,438,583,688,552,556,542,556,500,458,500,823,500,573,521,802,823,625,719,521,510,750,542,556,556,556,365,510,500,222,278,222,906,812,556,438,559,500,552,778,556,489,411,944,722,944,722,944,722,667,500,333,333,556,1e3,1e3,552,222,222,222,222,333,333,333,556,556,350,1e3,1e3,188,354,333,333,500,333,167,365,556,556,1094,556,885,323,1073,1e3,768,600,834,834,834,834,1e3,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,719,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,500,500,333,333,333,333,333,333,333,333,222,222,294,294,324,324,316,328,398,285],$r=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],Hr=[1.36898,1,1,.72706,.80479,.83734,.98894,.99793,.9897,.93884,.86209,.94292,.94292,1.16661,1.02058,.93582,.96694,.93582,1.19137,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.78076,.78076,1.02058,1.02058,1.02058,.72851,.78966,.90838,.83637,.82391,.96376,.80061,.86275,.8768,.95407,1.0258,.73901,.85022,.83655,1.0156,.95546,.92179,.87107,.92179,.82114,.8096,.89713,.94438,.95353,.94083,.91905,.90406,.9446,.94292,1.18777,.94292,1.02058,.89903,.90088,.94938,.97898,.81093,.97571,.94938,1.024,.9577,.95933,.98621,1.0474,.97455,.98981,.9672,.95933,.9446,.97898,.97407,.97646,.78036,1.10208,.95442,.95298,.97579,.9332,.94039,.938,.80687,1.01149,.80687,1.02058,.80479,.99793,.99793,.99793,.99793,1.01149,1.00872,.90088,.91882,1.0213,.8361,1.02058,.62295,.54324,.89022,1.08595,1,1,.90088,1,.97455,.93582,.90088,1,1.05686,.8361,.99642,.99642,.99642,.72851,.90838,.90838,.90838,.90838,.90838,.90838,.868,.82391,.80061,.80061,.80061,.80061,1.0258,1.0258,1.0258,1.0258,.97484,.95546,.92179,.92179,.92179,.92179,.92179,1.02058,.92179,.94438,.94438,.94438,.94438,.90406,.86958,.98225,.94938,.94938,.94938,.94938,.94938,.94938,.9031,.81093,.94938,.94938,.94938,.94938,.98621,.98621,.98621,.98621,.93969,.95933,.9446,.9446,.9446,.9446,.9446,1.08595,.9446,.95442,.95442,.95442,.95442,.94039,.97898,.94039,.90838,.94938,.90838,.94938,.90838,.94938,.82391,.81093,.82391,.81093,.82391,.81093,.82391,.81093,.96376,.84313,.97484,.97571,.80061,.94938,.80061,.94938,.80061,.94938,.80061,.94938,.80061,.94938,.8768,.9577,.8768,.9577,.8768,.9577,1,1,.95407,.95933,.97069,.95933,1.0258,.98621,1.0258,.98621,1.0258,.98621,1.0258,.98621,1.0258,.98621,.887,1.01591,.73901,1.0474,1,1,.97455,.83655,.98981,1,1,.83655,.73977,.83655,.73903,.84638,1.033,.95546,.95933,1,1,.95546,.95933,.8271,.95417,.95933,.92179,.9446,.92179,.9446,.92179,.9446,.936,.91964,.82114,.97646,1,1,.82114,.97646,.8096,.78036,.8096,.78036,1,1,.8096,.78036,1,1,.89713,.77452,.89713,1.10208,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94083,.97579,.90406,.94039,.90406,.9446,.938,.9446,.938,.9446,.938,1,.99793,.90838,.94938,.868,.9031,.92179,.9446,1,1,.89713,1.10208,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90989,.9358,.91945,.83181,.75261,.87992,.82976,.96034,.83689,.97268,1.0078,.90838,.83637,.8019,.90157,.80061,.9446,.95407,.92436,1.0258,.85022,.97153,1.0156,.95546,.89192,.92179,.92361,.87107,.96318,.89713,.93704,.95638,.91905,.91709,.92796,1.0258,.93704,.94836,1.0373,.95933,1.0078,.95871,.94836,.96174,.92601,.9498,.98607,.95776,.95933,1.05453,1.0078,.98275,.9314,.95617,.91701,1.05993,.9446,.78367,.9553,1,.86832,1.0128,.95871,.99394,.87548,.96361,.86774,1.0078,.95871,.9446,.95871,.86774,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.94083,.97579,.94083,.97579,.94083,.97579,.90406,.94039,.96694,1,.89903,1,1,1,.93582,.93582,.93582,1,.908,.908,.918,.94219,.94219,.96544,1,1.285,1,1,.81079,.81079,1,1,.74854,1,1,1,1,.99793,1,1,1,.65,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.17173,1,.80535,.76169,1.02058,1.0732,1.05486,1,1,1.30692,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.16161,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],jr={lineHeight:1.2,lineGap:.2},qr=[1.36898,1,1,.66227,.80779,.81625,.97276,.97276,.97733,.92222,.83266,.94292,.94292,1.16148,1.02058,.93582,.96694,.93582,1.17337,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.78076,.78076,1.02058,1.02058,1.02058,.71541,.76813,.85576,.80591,.80729,.94299,.77512,.83655,.86523,.92222,.98621,.71743,.81698,.79726,.98558,.92222,.90637,.83809,.90637,.80729,.76463,.86275,.90699,.91605,.9154,.85308,.85458,.90531,.94292,1.21296,.94292,1.02058,.89903,1.18616,.99613,.91677,.78216,.91677,.90083,.98796,.9135,.92168,.95381,.98981,.95298,.95381,.93459,.92168,.91513,.92004,.91677,.95077,.748,1.04502,.91677,.92061,.94236,.89544,.89364,.9,.80687,.8578,.80687,1.02058,.80779,.97276,.97276,.97276,.97276,.8578,.99973,1.18616,.91339,1.08074,.82891,1.02058,.55509,.71526,.89022,1.08595,1,1,1.18616,1,.96736,.93582,1.18616,1,1.04864,.82711,.99043,.99043,.99043,.71541,.85576,.85576,.85576,.85576,.85576,.85576,.845,.80729,.77512,.77512,.77512,.77512,.98621,.98621,.98621,.98621,.95961,.92222,.90637,.90637,.90637,.90637,.90637,1.02058,.90251,.90699,.90699,.90699,.90699,.85458,.83659,.94951,.99613,.99613,.99613,.99613,.99613,.99613,.85811,.78216,.90083,.90083,.90083,.90083,.95381,.95381,.95381,.95381,.9135,.92168,.91513,.91513,.91513,.91513,.91513,1.08595,.91677,.91677,.91677,.91677,.91677,.89364,.92332,.89364,.85576,.99613,.85576,.99613,.85576,.99613,.80729,.78216,.80729,.78216,.80729,.78216,.80729,.78216,.94299,.76783,.95961,.91677,.77512,.90083,.77512,.90083,.77512,.90083,.77512,.90083,.77512,.90083,.86523,.9135,.86523,.9135,.86523,.9135,1,1,.92222,.92168,.92222,.92168,.98621,.95381,.98621,.95381,.98621,.95381,.98621,.95381,.98621,.95381,.86036,.97096,.71743,.98981,1,1,.95298,.79726,.95381,1,1,.79726,.6894,.79726,.74321,.81691,1.0006,.92222,.92168,1,1,.92222,.92168,.79464,.92098,.92168,.90637,.91513,.90637,.91513,.90637,.91513,.909,.87514,.80729,.95077,1,1,.80729,.95077,.76463,.748,.76463,.748,1,1,.76463,.748,1,1,.86275,.72651,.86275,1.04502,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.9154,.94236,.85458,.89364,.85458,.90531,.9,.90531,.9,.90531,.9,1,.97276,.85576,.99613,.845,.85811,.90251,.91677,1,1,.86275,1.04502,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.00899,1.30628,.85576,.80178,.66862,.7927,.69323,.88127,.72459,.89711,.95381,.85576,.80591,.7805,.94729,.77512,.90531,.92222,.90637,.98621,.81698,.92655,.98558,.92222,.85359,.90637,.90976,.83809,.94523,.86275,.83509,.93157,.85308,.83392,.92346,.98621,.83509,.92886,.91324,.92168,.95381,.90646,.92886,.90557,.86847,.90276,.91324,.86842,.92168,.99531,.95381,.9224,.85408,.92699,.86847,1.0051,.91513,.80487,.93481,1,.88159,1.05214,.90646,.97355,.81539,.89398,.85923,.95381,.90646,.91513,.90646,.85923,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.9154,.94236,.9154,.94236,.9154,.94236,.85458,.89364,.96694,1,.89903,1,1,1,.91782,.91782,.91782,1,.896,.896,.896,.9332,.9332,.95973,1,1.26,1,1,.80479,.80178,1,1,.85633,1,1,1,1,.97276,1,1,1,.698,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.14542,1,.79199,.78694,1.02058,1.03493,1.05486,1,1,1.23026,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.20006,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],zr={lineHeight:1.2,lineGap:.2},Gr=[1.36898,1,1,.65507,.84943,.85639,.88465,.88465,.86936,.88307,.86948,.85283,.85283,1.06383,1.02058,.75945,.9219,.75945,1.17337,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.75945,.75945,1.02058,1.02058,1.02058,.69046,.70926,.85158,.77812,.76852,.89591,.70466,.76125,.80094,.86822,.83864,.728,.77212,.79475,.93637,.87514,.8588,.76013,.8588,.72421,.69866,.77598,.85991,.80811,.87832,.78112,.77512,.8562,1.0222,1.18417,1.0222,1.27014,.89903,1.15012,.93859,.94399,.846,.94399,.81453,1.0186,.94219,.96017,1.03075,1.02175,.912,1.03075,.96998,.96017,.93859,.94399,.94399,.95493,.746,1.12658,.94578,.91,.979,.882,.882,.83,.85034,.83537,.85034,1.02058,.70869,.88465,.88465,.88465,.88465,.83537,.90083,1.15012,.9161,.94565,.73541,1.02058,.53609,.69353,.79519,1.08595,1,1,1.15012,1,.91974,.75945,1.15012,1,.9446,.73361,.9005,.9005,.9005,.62864,.85158,.85158,.85158,.85158,.85158,.85158,.773,.76852,.70466,.70466,.70466,.70466,.83864,.83864,.83864,.83864,.90561,.87514,.8588,.8588,.8588,.8588,.8588,1.02058,.85751,.85991,.85991,.85991,.85991,.77512,.76013,.88075,.93859,.93859,.93859,.93859,.93859,.93859,.8075,.846,.81453,.81453,.81453,.81453,.82424,.82424,.82424,.82424,.9278,.96017,.93859,.93859,.93859,.93859,.93859,1.08595,.8562,.94578,.94578,.94578,.94578,.882,.94578,.882,.85158,.93859,.85158,.93859,.85158,.93859,.76852,.846,.76852,.846,.76852,.846,.76852,.846,.89591,.8544,.90561,.94399,.70466,.81453,.70466,.81453,.70466,.81453,.70466,.81453,.70466,.81453,.80094,.94219,.80094,.94219,.80094,.94219,1,1,.86822,.96017,.86822,.96017,.83864,.82424,.83864,.82424,.83864,.82424,.83864,1.03075,.83864,.82424,.81402,1.02738,.728,1.02175,1,1,.912,.79475,1.03075,1,1,.79475,.83911,.79475,.66266,.80553,1.06676,.87514,.96017,1,1,.87514,.96017,.86865,.87396,.96017,.8588,.93859,.8588,.93859,.8588,.93859,.867,.84759,.72421,.95493,1,1,.72421,.95493,.69866,.746,.69866,.746,1,1,.69866,.746,1,1,.77598,.88417,.77598,1.12658,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.87832,.979,.77512,.882,.77512,.8562,.83,.8562,.83,.8562,.83,1,.88465,.85158,.93859,.773,.8075,.85751,.8562,1,1,.77598,1.12658,1.15012,1.15012,1.15012,1.15012,1.15012,1.15313,1.15012,1.15012,1.15012,1.08106,1.03901,.85158,.77025,.62264,.7646,.65351,.86026,.69461,.89947,1.03075,.85158,.77812,.76449,.88836,.70466,.8562,.86822,.8588,.83864,.77212,.85308,.93637,.87514,.82352,.8588,.85701,.76013,.89058,.77598,.8156,.82565,.78112,.77899,.89386,.83864,.8156,.9486,.92388,.96186,1.03075,.91123,.9486,.93298,.878,.93942,.92388,.84596,.96186,.95119,1.03075,.922,.88787,.95829,.88,.93559,.93859,.78815,.93758,1,.89217,1.03737,.91123,.93969,.77487,.85769,.86799,1.03075,.91123,.93859,.91123,.86799,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.87832,.979,.87832,.979,.87832,.979,.77512,.882,.9219,1,.89903,1,1,1,.87321,.87321,.87321,1,1.027,1.027,1.027,.86847,.86847,.79121,1,1.124,1,1,.73572,.73572,1,1,.85034,1,1,1,1,.88465,1,1,1,.669,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.04828,1,.74948,.75187,1.02058,.98391,1.02119,1,1,1.06233,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.05233,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Wr={lineHeight:1.2,lineGap:.2},Vr=[1.36898,1,1,.76305,.82784,.94935,.89364,.92241,.89073,.90706,.98472,.85283,.85283,1.0664,1.02058,.74505,.9219,.74505,1.23456,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.74505,.74505,1.02058,1.02058,1.02058,.73002,.72601,.91755,.8126,.80314,.92222,.73764,.79726,.83051,.90284,.86023,.74,.8126,.84869,.96518,.91115,.8858,.79761,.8858,.74498,.73914,.81363,.89591,.83659,.89633,.85608,.8111,.90531,1.0222,1.22736,1.0222,1.27014,.89903,.90088,.86667,1.0231,.896,1.01411,.90083,1.05099,1.00512,.99793,1.05326,1.09377,.938,1.06226,1.00119,.99793,.98714,1.0231,1.01231,.98196,.792,1.19137,.99074,.962,1.01915,.926,.942,.856,.85034,.92006,.85034,1.02058,.69067,.92241,.92241,.92241,.92241,.92006,.9332,.90088,.91882,.93484,.75339,1.02058,.56866,.54324,.79519,1.08595,1,1,.90088,1,.95325,.74505,.90088,1,.97198,.75339,.91009,.91009,.91009,.66466,.91755,.91755,.91755,.91755,.91755,.91755,.788,.80314,.73764,.73764,.73764,.73764,.86023,.86023,.86023,.86023,.92915,.91115,.8858,.8858,.8858,.8858,.8858,1.02058,.8858,.89591,.89591,.89591,.89591,.8111,.79611,.89713,.86667,.86667,.86667,.86667,.86667,.86667,.86936,.896,.90083,.90083,.90083,.90083,.84224,.84224,.84224,.84224,.97276,.99793,.98714,.98714,.98714,.98714,.98714,1.08595,.89876,.99074,.99074,.99074,.99074,.942,1.0231,.942,.91755,.86667,.91755,.86667,.91755,.86667,.80314,.896,.80314,.896,.80314,.896,.80314,.896,.92222,.93372,.92915,1.01411,.73764,.90083,.73764,.90083,.73764,.90083,.73764,.90083,.73764,.90083,.83051,1.00512,.83051,1.00512,.83051,1.00512,1,1,.90284,.99793,.90976,.99793,.86023,.84224,.86023,.84224,.86023,.84224,.86023,1.05326,.86023,.84224,.82873,1.07469,.74,1.09377,1,1,.938,.84869,1.06226,1,1,.84869,.83704,.84869,.81441,.85588,1.08927,.91115,.99793,1,1,.91115,.99793,.91887,.90991,.99793,.8858,.98714,.8858,.98714,.8858,.98714,.894,.91434,.74498,.98196,1,1,.74498,.98196,.73914,.792,.73914,.792,1,1,.73914,.792,1,1,.81363,.904,.81363,1.19137,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89633,1.01915,.8111,.942,.8111,.90531,.856,.90531,.856,.90531,.856,1,.92241,.91755,.86667,.788,.86936,.8858,.89876,1,1,.81363,1.19137,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90388,1.03901,.92138,.78105,.7154,.86169,.80513,.94007,.82528,.98612,1.06226,.91755,.8126,.81884,.92819,.73764,.90531,.90284,.8858,.86023,.8126,.91172,.96518,.91115,.83089,.8858,.87791,.79761,.89297,.81363,.88157,.89992,.85608,.81992,.94307,.86023,.88157,.95308,.98699,.99793,1.06226,.95817,.95308,.97358,.928,.98088,.98699,.92761,.99793,.96017,1.06226,.986,.944,.95978,.938,.96705,.98714,.80442,.98972,1,.89762,1.04552,.95817,.99007,.87064,.91879,.88888,1.06226,.95817,.98714,.95817,.88888,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.89633,1.01915,.89633,1.01915,.89633,1.01915,.8111,.942,.9219,1,.89903,1,1,1,.93173,.93173,.93173,1,1.06304,1.06304,1.06904,.89903,.89903,.80549,1,1.156,1,1,.76575,.76575,1,1,.72458,1,1,1,1,.92241,1,1,1,.619,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.07257,1,.74705,.71119,1.02058,1.024,1.02119,1,1,1.1536,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.05638,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Xr={lineHeight:1.2,lineGap:.2},Kr=[1.76738,1,1,.99297,.9824,1.04016,1.06497,1.03424,.97529,1.17647,1.23203,1.1085,1.1085,1.16939,1.2107,.9754,1.21408,.9754,1.59578,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,.81378,.81378,1.2107,1.2107,1.2107,.71703,.97847,.97363,.88776,.8641,1.02096,.79795,.85132,.914,1.06085,1.1406,.8007,.89858,.83693,1.14889,1.09398,.97489,.92094,.97489,.90399,.84041,.95923,1.00135,1,1.06467,.98243,.90996,.99361,1.1085,1.56942,1.1085,1.2107,.74627,.94282,.96752,1.01519,.86304,1.01359,.97278,1.15103,1.01359,.98561,1.02285,1.02285,1.00527,1.02285,1.0302,.99041,1.0008,1.01519,1.01359,1.02258,.79104,1.16862,.99041,.97454,1.02511,.99298,.96752,.95801,.94856,1.16579,.94856,1.2107,.9824,1.03424,1.03424,1,1.03424,1.16579,.8727,1.3871,1.18622,1.10818,1.04478,1.2107,1.18622,.75155,.94994,1.28826,1.21408,1.21408,.91056,1,.91572,.9754,.64663,1.18328,1.24866,1.04478,1.14169,1.15749,1.17389,.71703,.97363,.97363,.97363,.97363,.97363,.97363,.93506,.8641,.79795,.79795,.79795,.79795,1.1406,1.1406,1.1406,1.1406,1.02096,1.09398,.97426,.97426,.97426,.97426,.97426,1.2107,.97489,1.00135,1.00135,1.00135,1.00135,.90996,.92094,1.02798,.96752,.96752,.96752,.96752,.96752,.96752,.93136,.86304,.97278,.97278,.97278,.97278,1.02285,1.02285,1.02285,1.02285,.97122,.99041,1,1,1,1,1,1.28826,1.0008,.99041,.99041,.99041,.99041,.96752,1.01519,.96752,.97363,.96752,.97363,.96752,.97363,.96752,.8641,.86304,.8641,.86304,.8641,.86304,.8641,.86304,1.02096,1.03057,1.02096,1.03517,.79795,.97278,.79795,.97278,.79795,.97278,.79795,.97278,.79795,.97278,.914,1.01359,.914,1.01359,.914,1.01359,1,1,1.06085,.98561,1.06085,1.00879,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,.97138,1.08692,.8007,1.02285,1,1,1.00527,.83693,1.02285,1,1,.83693,.9455,.83693,.90418,.83693,1.13005,1.09398,.99041,1,1,1.09398,.99041,.96692,1.09251,.99041,.97489,1.0008,.97489,1.0008,.97489,1.0008,.93994,.97931,.90399,1.02258,1,1,.90399,1.02258,.84041,.79104,.84041,.79104,.84041,.79104,.84041,.79104,1,1,.95923,1.07034,.95923,1.16862,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.06467,1.02511,.90996,.96752,.90996,.99361,.95801,.99361,.95801,.99361,.95801,1.07733,1.03424,.97363,.96752,.93506,.93136,.97489,1.0008,1,1,.95923,1.16862,1.15103,1.15103,1.01173,1.03959,.75953,.81378,.79912,1.15103,1.21994,.95161,.87815,1.01149,.81525,.7676,.98167,1.01134,1.02546,.84097,1.03089,1.18102,.97363,.88776,.85134,.97826,.79795,.99361,1.06085,.97489,1.1406,.89858,1.0388,1.14889,1.09398,.86039,.97489,1.0595,.92094,.94793,.95923,.90996,.99346,.98243,1.02112,.95493,1.1406,.90996,1.03574,1.02597,1.0008,1.18102,1.06628,1.03574,1.0192,1.01932,1.00886,.97531,1.0106,1.0008,1.13189,1.18102,1.02277,.98683,1.0016,.99561,1.07237,1.0008,.90434,.99921,.93803,.8965,1.23085,1.06628,1.04983,.96268,1.0499,.98439,1.18102,1.06628,1.0008,1.06628,.98439,.79795,1,1,1,1,1,1,1,1,1,1,1,1,1.09466,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.97278,1,1,1,1,1,1,1,1,1,1,1,1,1.02065,1,1,1,1,1,1,1.06467,1.02511,1.06467,1.02511,1.06467,1.02511,.90996,.96752,1,1.21408,.89903,1,1,.75155,1.04394,1.04394,1.04394,1.04394,.98633,.98633,.98633,.73047,.73047,1.20642,.91211,1.25635,1.222,1.02956,1.03372,1.03372,.96039,1.24633,1,1.12454,.93503,1.03424,1.19687,1.03424,1,1,1,.771,1,1,1.15749,1.15749,1.15749,1.10948,.86279,.94434,.86279,.94434,.86182,1,1,1.16897,1,.96085,.90137,1.2107,1.18416,1.13973,.69825,.9716,2.10339,1.29004,1.29004,1.21172,1.29004,1.29004,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18874,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.09193,1.09193,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Yr={lineHeight:1.33008,lineGap:0},Jr=[1.76738,1,1,.98946,1.03959,1.04016,1.02809,1.036,.97639,1.10953,1.23203,1.11144,1.11144,1.16939,1.21237,.9754,1.21261,.9754,1.59754,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,.81378,.81378,1.21237,1.21237,1.21237,.73541,.97847,.97363,.89723,.87897,1.0426,.79429,.85292,.91149,1.05815,1.1406,.79631,.90128,.83853,1.04396,1.10615,.97552,.94436,.97552,.88641,.80527,.96083,1.00135,1,1.06777,.9817,.91142,.99361,1.11144,1.57293,1.11144,1.21237,.74627,1.31818,1.06585,.97042,.83055,.97042,.93503,1.1261,.97042,.97922,1.14236,.94552,1.01054,1.14236,1.02471,.97922,.94165,.97042,.97042,1.0276,.78929,1.1261,.97922,.95874,1.02197,.98507,.96752,.97168,.95107,1.16579,.95107,1.21237,1.03959,1.036,1.036,1,1.036,1.16579,.87357,1.31818,1.18754,1.26781,1.05356,1.21237,1.18622,.79487,.94994,1.29004,1.24047,1.24047,1.31818,1,.91484,.9754,1.31818,1.1349,1.24866,1.05356,1.13934,1.15574,1.17389,.73541,.97363,.97363,.97363,.97363,.97363,.97363,.94385,.87897,.79429,.79429,.79429,.79429,1.1406,1.1406,1.1406,1.1406,1.0426,1.10615,.97552,.97552,.97552,.97552,.97552,1.21237,.97552,1.00135,1.00135,1.00135,1.00135,.91142,.94436,.98721,1.06585,1.06585,1.06585,1.06585,1.06585,1.06585,.96705,.83055,.93503,.93503,.93503,.93503,1.14236,1.14236,1.14236,1.14236,.93125,.97922,.94165,.94165,.94165,.94165,.94165,1.29004,.94165,.97922,.97922,.97922,.97922,.96752,.97042,.96752,.97363,1.06585,.97363,1.06585,.97363,1.06585,.87897,.83055,.87897,.83055,.87897,.83055,.87897,.83055,1.0426,1.0033,1.0426,.97042,.79429,.93503,.79429,.93503,.79429,.93503,.79429,.93503,.79429,.93503,.91149,.97042,.91149,.97042,.91149,.97042,1,1,1.05815,.97922,1.05815,.97922,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,.97441,1.04302,.79631,1.01582,1,1,1.01054,.83853,1.14236,1,1,.83853,1.09125,.83853,.90418,.83853,1.19508,1.10615,.97922,1,1,1.10615,.97922,1.01034,1.10466,.97922,.97552,.94165,.97552,.94165,.97552,.94165,.91602,.91981,.88641,1.0276,1,1,.88641,1.0276,.80527,.78929,.80527,.78929,.80527,.78929,.80527,.78929,1,1,.96083,1.05403,.95923,1.16862,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.06777,1.02197,.91142,.96752,.91142,.99361,.97168,.99361,.97168,.99361,.97168,1.23199,1.036,.97363,1.06585,.94385,.96705,.97552,.94165,1,1,.96083,1.1261,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,.95161,1.27126,1.00811,.83284,.77702,.99137,.95253,1.0347,.86142,1.07205,1.14236,.97363,.89723,.86869,1.09818,.79429,.99361,1.05815,.97552,1.1406,.90128,1.06662,1.04396,1.10615,.84918,.97552,1.04694,.94436,.98015,.96083,.91142,1.00356,.9817,1.01945,.98999,1.1406,.91142,1.04961,.9898,1.00639,1.14236,1.07514,1.04961,.99607,1.02897,1.008,.9898,.95134,1.00639,1.11121,1.14236,1.00518,.97981,1.02186,1,1.08578,.94165,.99314,.98387,.93028,.93377,1.35125,1.07514,1.10687,.93491,1.04232,1.00351,1.14236,1.07514,.94165,1.07514,1.00351,.79429,1,1,1,1,1,1,1,1,1,1,1,1,1.09097,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.93503,1,1,1,1,1,1,1,1,1,1,1,1,.96609,1,1,1,1,1,1,1.06777,1.02197,1.06777,1.02197,1.06777,1.02197,.91142,.96752,1,1.21261,.89903,1,1,.75155,1.04745,1.04745,1.04745,1.04394,.98633,.98633,.98633,.72959,.72959,1.20502,.91406,1.26514,1.222,1.02956,1.03372,1.03372,.96039,1.24633,1,1.09125,.93327,1.03336,1.16541,1.036,1,1,1,.771,1,1,1.15574,1.15574,1.15574,1.15574,.86364,.94434,.86279,.94434,.86224,1,1,1.16798,1,.96085,.90068,1.21237,1.18416,1.13904,.69825,.9716,2.10339,1.29004,1.29004,1.21339,1.29004,1.29004,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18775,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.13269,1.13269,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],Zr={lineHeight:1.33008,lineGap:0},Qr=[1.76738,1,1,.98946,1.14763,1.05365,1.06234,.96927,.92586,1.15373,1.18414,.91349,.91349,1.07403,1.17308,.78383,1.20088,.78383,1.42531,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.78383,.78383,1.17308,1.17308,1.17308,.77349,.94565,.94729,.85944,.88506,.9858,.74817,.80016,.88449,.98039,.95782,.69238,.89898,.83231,.98183,1.03989,.96924,.86237,.96924,.80595,.74524,.86091,.95402,.94143,.98448,.8858,.83089,.93285,1.0949,1.39016,1.0949,1.45994,.74627,1.04839,.97454,.97454,.87207,.97454,.87533,1.06151,.97454,1.00176,1.16484,1.08132,.98047,1.16484,1.02989,1.01054,.96225,.97454,.97454,1.06598,.79004,1.16344,1.00351,.94629,.9973,.91016,.96777,.9043,.91082,.92481,.91082,1.17308,.95748,.96927,.96927,1,.96927,.92481,.80597,1.04839,1.23393,1.1781,.9245,1.17308,1.20808,.63218,.94261,1.24822,1.09971,1.09971,1.04839,1,.85273,.78032,1.04839,1.09971,1.22326,.9245,1.09836,1.13525,1.15222,.70424,.94729,.94729,.94729,.94729,.94729,.94729,.85498,.88506,.74817,.74817,.74817,.74817,.95782,.95782,.95782,.95782,.9858,1.03989,.96924,.96924,.96924,.96924,.96924,1.17308,.96924,.95402,.95402,.95402,.95402,.83089,.86237,.88409,.97454,.97454,.97454,.97454,.97454,.97454,.92916,.87207,.87533,.87533,.87533,.87533,.93146,.93146,.93146,.93146,.93854,1.01054,.96225,.96225,.96225,.96225,.96225,1.24822,.8761,1.00351,1.00351,1.00351,1.00351,.96777,.97454,.96777,.94729,.97454,.94729,.97454,.94729,.97454,.88506,.87207,.88506,.87207,.88506,.87207,.88506,.87207,.9858,.95391,.9858,.97454,.74817,.87533,.74817,.87533,.74817,.87533,.74817,.87533,.74817,.87533,.88449,.97454,.88449,.97454,.88449,.97454,1,1,.98039,1.00176,.98039,1.00176,.95782,.93146,.95782,.93146,.95782,.93146,.95782,1.16484,.95782,.93146,.84421,1.12761,.69238,1.08132,1,1,.98047,.83231,1.16484,1,1,.84723,1.04861,.84723,.78755,.83231,1.23736,1.03989,1.01054,1,1,1.03989,1.01054,.9857,1.03849,1.01054,.96924,.96225,.96924,.96225,.96924,.96225,.92383,.90171,.80595,1.06598,1,1,.80595,1.06598,.74524,.79004,.74524,.79004,.74524,.79004,.74524,.79004,1,1,.86091,1.02759,.85771,1.16344,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.98448,.9973,.83089,.96777,.83089,.93285,.9043,.93285,.9043,.93285,.9043,1.31868,.96927,.94729,.97454,.85498,.92916,.96924,.8761,1,1,.86091,1.16344,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,.81965,.81965,.94729,.78032,.71022,.90883,.84171,.99877,.77596,1.05734,1.2,.94729,.85944,.82791,.9607,.74817,.93285,.98039,.96924,.95782,.89898,.98316,.98183,1.03989,.78614,.96924,.97642,.86237,.86075,.86091,.83089,.90082,.8858,.97296,1.01284,.95782,.83089,1.0976,1.04,1.03342,1.2,1.0675,1.0976,.98205,1.03809,1.05097,1.04,.95364,1.03342,1.05401,1.2,1.02148,1.0119,1.04724,1.0127,1.02732,.96225,.8965,.97783,.93574,.94818,1.30679,1.0675,1.11826,.99821,1.0557,1.0326,1.2,1.0675,.96225,1.0675,1.0326,.74817,1,1,1,1,1,1,1,1,1,1,1,1,1.03754,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.87533,1,1,1,1,1,1,1,1,1,1,1,1,.98705,1,1,1,1,1,1,.98448,.9973,.98448,.9973,.98448,.9973,.83089,.96777,1,1.20088,.89903,1,1,.75155,.94945,.94945,.94945,.94945,1.12317,1.12317,1.12317,.67603,.67603,1.15621,.73584,1.21191,1.22135,1.06483,.94868,.94868,.95996,1.24633,1,1.07497,.87709,.96927,1.01473,.96927,1,1,1,.77295,1,1,1.09836,1.09836,1.09836,1.01522,.86321,.94434,.8649,.94434,.86182,1,1,1.083,1,.91578,.86438,1.17308,1.18416,1.14589,.69825,.97622,1.96791,1.24822,1.24822,1.17308,1.24822,1.24822,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.17984,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.10742,1.10742,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],to={lineHeight:1.33008,lineGap:0},eo=[1.76738,1,1,.98594,1.02285,1.10454,1.06234,.96927,.92037,1.19985,1.2046,.90616,.90616,1.07152,1.1714,.78032,1.20088,.78032,1.40246,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.78032,.78032,1.1714,1.1714,1.1714,.80597,.94084,.96706,.85944,.85734,.97093,.75842,.79936,.88198,.9831,.95782,.71387,.86969,.84636,1.07796,1.03584,.96924,.83968,.96924,.82826,.79649,.85771,.95132,.93119,.98965,.88433,.8287,.93365,1.08612,1.3638,1.08612,1.45786,.74627,.80499,.91484,1.05707,.92383,1.05882,.9403,1.12654,1.05882,1.01756,1.09011,1.09011,.99414,1.09011,1.034,1.01756,1.05356,1.05707,1.05882,1.04399,.84863,1.21968,1.01756,.95801,1.00068,.91797,.96777,.9043,.90351,.92105,.90351,1.1714,.85337,.96927,.96927,.99912,.96927,.92105,.80597,1.2434,1.20808,1.05937,.90957,1.1714,1.20808,.75155,.94261,1.24644,1.09971,1.09971,.84751,1,.85273,.78032,.61584,1.05425,1.17914,.90957,1.08665,1.11593,1.14169,.73381,.96706,.96706,.96706,.96706,.96706,.96706,.86035,.85734,.75842,.75842,.75842,.75842,.95782,.95782,.95782,.95782,.97093,1.03584,.96924,.96924,.96924,.96924,.96924,1.1714,.96924,.95132,.95132,.95132,.95132,.8287,.83968,.89049,.91484,.91484,.91484,.91484,.91484,.91484,.93575,.92383,.9403,.9403,.9403,.9403,.8717,.8717,.8717,.8717,1.00527,1.01756,1.05356,1.05356,1.05356,1.05356,1.05356,1.24644,.95923,1.01756,1.01756,1.01756,1.01756,.96777,1.05707,.96777,.96706,.91484,.96706,.91484,.96706,.91484,.85734,.92383,.85734,.92383,.85734,.92383,.85734,.92383,.97093,1.0969,.97093,1.05882,.75842,.9403,.75842,.9403,.75842,.9403,.75842,.9403,.75842,.9403,.88198,1.05882,.88198,1.05882,.88198,1.05882,1,1,.9831,1.01756,.9831,1.01756,.95782,.8717,.95782,.8717,.95782,.8717,.95782,1.09011,.95782,.8717,.84784,1.11551,.71387,1.09011,1,1,.99414,.84636,1.09011,1,1,.84636,1.0536,.84636,.94298,.84636,1.23297,1.03584,1.01756,1,1,1.03584,1.01756,1.00323,1.03444,1.01756,.96924,1.05356,.96924,1.05356,.96924,1.05356,.93066,.98293,.82826,1.04399,1,1,.82826,1.04399,.79649,.84863,.79649,.84863,.79649,.84863,.79649,.84863,1,1,.85771,1.17318,.85771,1.21968,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.98965,1.00068,.8287,.96777,.8287,.93365,.9043,.93365,.9043,.93365,.9043,1.08571,.96927,.96706,.91484,.86035,.93575,.96924,.95923,1,1,.85771,1.21968,1.11437,1.11437,.93109,.91202,.60411,.84164,.55572,1.01173,.97361,.81818,.81818,.96635,.78032,.72727,.92366,.98601,1.03405,.77968,1.09799,1.2,.96706,.85944,.85638,.96491,.75842,.93365,.9831,.96924,.95782,.86969,.94152,1.07796,1.03584,.78437,.96924,.98715,.83968,.83491,.85771,.8287,.94492,.88433,.9287,1.0098,.95782,.8287,1.0625,.98248,1.03424,1.2,1.01071,1.0625,.95246,1.03809,1.04912,.98248,1.00221,1.03424,1.05443,1.2,1.04785,.99609,1.00169,1.05176,.99346,1.05356,.9087,1.03004,.95542,.93117,1.23362,1.01071,1.07831,1.02512,1.05205,1.03502,1.2,1.01071,1.05356,1.01071,1.03502,.75842,1,1,1,1,1,1,1,1,1,1,1,1,1.03719,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.9403,1,1,1,1,1,1,1,1,1,1,1,1,1.04021,1,1,1,1,1,1,.98965,1.00068,.98965,1.00068,.98965,1.00068,.8287,.96777,1,1.20088,.89903,1,1,.75155,1.03077,1.03077,1.03077,1.03077,1.13196,1.13196,1.13196,.67428,.67428,1.16039,.73291,1.20996,1.22135,1.06483,.94868,.94868,.95996,1.24633,1,1.07497,.87796,.96927,1.01518,.96927,1,1,1,.77295,1,1,1.10539,1.10539,1.11358,1.06967,.86279,.94434,.86279,.94434,.86182,1,1,1.083,1,.91578,.86507,1.1714,1.18416,1.14589,.69825,.97622,1.9697,1.24822,1.24822,1.17238,1.24822,1.24822,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18083,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.10938,1.10938,1,1,1,1.05425,1.09971,1.09971,1.09971,1,1,1,1,1,1,1,1,1,1,1],so={lineHeight:1.33008,lineGap:0},io=getLookupTableFactory(function(t){t["MyriadPro-Regular"]=t["PdfJS-Fallback-Regular"]={name:"LiberationSans-Regular",factors:Vr,baseWidths:Ur,baseMapping:$r,metrics:Xr},t["MyriadPro-Bold"]=t["PdfJS-Fallback-Bold"]={name:"LiberationSans-Bold",factors:Hr,baseWidths:Rr,baseMapping:Br,metrics:jr},t["MyriadPro-It"]=t["MyriadPro-Italic"]=t["PdfJS-Fallback-Italic"]={name:"LiberationSans-Italic",factors:Gr,baseWidths:Or,baseMapping:Lr,metrics:Wr},t["MyriadPro-BoldIt"]=t["MyriadPro-BoldItalic"]=t["PdfJS-Fallback-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:qr,baseWidths:Pr,baseMapping:Nr,metrics:zr},t.ArialMT=t.Arial=t["Arial-Regular"]={name:"LiberationSans-Regular",baseWidths:Ur,baseMapping:$r},t["Arial-BoldMT"]=t["Arial-Bold"]={name:"LiberationSans-Bold",baseWidths:Rr,baseMapping:Br},t["Arial-ItalicMT"]=t["Arial-Italic"]={name:"LiberationSans-Italic",baseWidths:Or,baseMapping:Lr},t["Arial-BoldItalicMT"]=t["Arial-BoldItalic"]={name:"LiberationSans-BoldItalic",baseWidths:Pr,baseMapping:Nr},t["Calibri-Regular"]={name:"LiberationSans-Regular",factors:kr,baseWidths:Ur,baseMapping:$r,metrics:Sr},t["Calibri-Bold"]={name:"LiberationSans-Bold",factors:br,baseWidths:Rr,baseMapping:Br,metrics:wr},t["Calibri-Italic"]={name:"LiberationSans-Italic",factors:vr,baseWidths:Or,baseMapping:Lr,metrics:Ar},t["Calibri-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:yr,baseWidths:Pr,baseMapping:Nr,metrics:xr},t["Segoeui-Regular"]={name:"LiberationSans-Regular",factors:eo,baseWidths:Ur,baseMapping:$r,metrics:so},t["Segoeui-Bold"]={name:"LiberationSans-Bold",factors:Kr,baseWidths:Rr,baseMapping:Br,metrics:Yr},t["Segoeui-Italic"]={name:"LiberationSans-Italic",factors:Qr,baseWidths:Or,baseMapping:Lr,metrics:to},t["Segoeui-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:Jr,baseWidths:Pr,baseMapping:Nr,metrics:Zr},t["Helvetica-Regular"]=t.Helvetica={name:"LiberationSans-Regular",factors:Fr,baseWidths:Ur,baseMapping:$r,metrics:Dr},t["Helvetica-Bold"]={name:"LiberationSans-Bold",factors:Cr,baseWidths:Rr,baseMapping:Br,metrics:_r},t["Helvetica-Italic"]={name:"LiberationSans-Italic",factors:Mr,baseWidths:Or,baseMapping:Lr,metrics:Er},t["Helvetica-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:Ir,baseWidths:Pr,baseMapping:Nr,metrics:Tr}});function getXfaFontName(t){const e=normalizeFontName(t);return io()[e]}function getXfaFontDict(t){const e=function(t){const e=getXfaFontName(t);if(!e)return null;const{baseWidths:s,baseMapping:i,factors:n}=e,a=n?s.map((t,e)=>t*n[e]):s;let r,o=-2;const l=[];for(const[t,e]of i.map((t,e)=>[t,e]).sort(([t],[e])=>t-e))-1!==t&&(t===o+1?(r.push(a[e]),o+=1):(o=t,r=[a[e]],l.push(t,r)));return l}(t),s=new fs(null);s.set("BaseFont",us.get(t)),s.set("Type",us.get("Font")),s.set("Subtype",us.get("CIDFontType2")),s.set("Encoding",us.get("Identity-H")),s.set("CIDToGIDMap",us.get("Identity")),s.set("W",e),s.set("FirstChar",e[0]),s.set("LastChar",e.at(-2)+e.at(-1).length-1);const i=new fs(null);s.set("FontDescriptor",i);const n=new fs(null);return n.set("Ordering","Identity"),n.set("Registry","Adobe"),n.set("Supplement",0),s.set("CIDSystemInfo",n),s}var no=class{constructor(t){this.lexer=t,this.operators=[],this.token=null,this.prev=null}nextToken(){this.prev=this.token,this.token=this.lexer.getToken()}accept(t){return this.token.type===t&&(this.nextToken(),!0)}expect(t){if(this.accept(t))return!0;throw new Ze(`Unexpected symbol: found ${this.token.type} expected ${t}.`)}parse(){return this.nextToken(),this.expect(ao.LBRACE),this.parseBlock(),this.expect(ao.RBRACE),this.operators}parseBlock(){for(;;)if(this.accept(ao.NUMBER))this.operators.push(this.prev.value);else if(this.accept(ao.OPERATOR))this.operators.push(this.prev.value);else{if(!this.accept(ao.LBRACE))return;this.parseCondition()}}parseCondition(){const t=this.operators.length;if(this.operators.push(null,null),this.parseBlock(),this.expect(ao.RBRACE),this.accept(ao.IF))this.operators[t]=this.operators.length,this.operators[t+1]="jz";else{if(!this.accept(ao.LBRACE))throw new Ze("PS Function: error parsing conditional.");{const e=this.operators.length;this.operators.push(null,null);const s=this.operators.length;this.parseBlock(),this.expect(ao.RBRACE),this.expect(ao.IFELSE),this.operators[e]=this.operators.length,this.operators[e+1]="j",this.operators[t]=s,this.operators[t+1]="jz"}}}},ao={LBRACE:0,RBRACE:1,NUMBER:2,OPERATOR:3,IF:4,IFELSE:5},ro=class _PostScriptToken{static get opCache(){return shadow$1(this,"opCache",Object.create(null))}constructor(t,e){this.type=t,this.value=e}static getOperator(t){return _PostScriptToken.opCache[t]||=new _PostScriptToken(ao.OPERATOR,t)}static get LBRACE(){return shadow$1(this,"LBRACE",new _PostScriptToken(ao.LBRACE,"{"))}static get RBRACE(){return shadow$1(this,"RBRACE",new _PostScriptToken(ao.RBRACE,"}"))}static get IF(){return shadow$1(this,"IF",new _PostScriptToken(ao.IF,"IF"))}static get IFELSE(){return shadow$1(this,"IFELSE",new _PostScriptToken(ao.IFELSE,"IFELSE"))}},oo=class{constructor(t){this.stream=t,this.nextChar(),this.strBuf=[]}nextChar(){return this.currentChar=this.stream.getByte()}getToken(){let t=!1,e=this.currentChar;for(;;){if(e<0)return os;if(t)10!==e&&13!==e||(t=!1);else if(37===e)t=!0;else if(!isWhiteSpace(e))break;e=this.nextChar()}switch(0|e){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return new ro(ao.NUMBER,this.getNumber());case 123:return this.nextChar(),ro.LBRACE;case 125:return this.nextChar(),ro.RBRACE}const s=this.strBuf;for(s.length=0,s[0]=String.fromCharCode(e);(e=this.nextChar())>=0&&(e>=65&&e<=90||e>=97&&e<=122);)s.push(String.fromCharCode(e));const i=s.join("");switch(i.toLowerCase()){case"if":return ro.IF;case"ifelse":return ro.IFELSE;default:return ro.getOperator(i)}}getNumber(){let t=this.currentChar;const e=this.strBuf;for(e.length=0,e[0]=String.fromCharCode(t);(t=this.nextChar())>=0&&(t>=48&&t<=57||45===t||46===t);)e.push(String.fromCharCode(t));const s=parseFloat(e.join(""));if(isNaN(s))throw new Ze(`Invalid floating point number: ${s}`);return s}},lo=class{constructor(t){this._onlyRefs=!0===t?.onlyRefs,this._onlyRefs||(this._nameRefMap=new Map,this._imageMap=new Map),this._imageCache=new ms}getByName(t){this._onlyRefs&&unreachable$1("Should not call `getByName` method.");const e=this._nameRefMap.get(t);return e?this.getByRef(e):this._imageMap.get(t)||null}getByRef(t){return this._imageCache.get(t)||null}set(t,e,s){unreachable$1("Abstract method `set` called.")}},co=class extends lo{set(t,e=null,s){if("string"!=typeof t)throw new Error('LocalImageCache.set - expected "name" argument.');if(e){if(this._imageCache.has(e))return;return this._nameRefMap.set(t,e),void this._imageCache.put(e,s)}this._imageMap.has(t)||this._imageMap.set(t,s)}},ho=class extends lo{set(t=null,e=null,s){if("string"!=typeof t&&!e)throw new Error('LocalColorSpaceCache.set - expected "name" and/or "ref" argument.');if(e){if(this._imageCache.has(e))return;return null!==t&&this._nameRefMap.set(t,e),void this._imageCache.put(e,s)}this._imageMap.has(t)||this._imageMap.set(t,s)}},uo=class extends lo{constructor(t){super({onlyRefs:!0})}set(t=null,e,s){if(!e)throw new Error('LocalFunctionCache.set - expected "ref" argument.');this._imageCache.has(e)||this._imageCache.put(e,s)}},fo=class extends lo{set(t,e=null,s){if("string"!=typeof t)throw new Error('LocalGStateCache.set - expected "name" argument.');if(e){if(this._imageCache.has(e))return;return this._nameRefMap.set(t,e),void this._imageCache.put(e,s)}this._imageMap.has(t)||this._imageMap.set(t,s)}},go=class extends lo{constructor(t){super({onlyRefs:!0})}set(t=null,e,s){if(!e)throw new Error('LocalTilingPatternCache.set - expected "ref" argument.');this._imageCache.has(e)||this._imageCache.put(e,s)}},po=class extends lo{constructor(t){super({onlyRefs:!0})}set(t=null,e,s){if(!e)throw new Error('RegionalImageCache.set - expected "ref" argument.');this._imageCache.has(e)||this._imageCache.put(e,s)}},mo=class extends lo{constructor(t){super({onlyRefs:!0})}set(t=null,e,s){if(!e)throw new Error('GlobalColorSpaceCache.set - expected "ref" argument.');this._imageCache.has(e)||this._imageCache.put(e,s)}clear(){this._imageCache.clear()}},bo=class _GlobalImageCache{static NUM_PAGES_THRESHOLD=2;static MIN_IMAGES_TO_CACHE=10;static MAX_BYTE_SIZE=5e7;#q=new ps;constructor(){this._refCache=new ms,this._imageCache=new ms}get#z(){let t=0;for(const e of this._imageCache)t+=e.byteSize;return t}get#G(){return!(this._imageCache.size<_GlobalImageCache.MIN_IMAGES_TO_CACHE||this.#z<_GlobalImageCache.MAX_BYTE_SIZE)}shouldCache(t,e){let s=this._refCache.get(t);return s||(s=new Set,this._refCache.put(t,s)),s.add(e),!(s.size<_GlobalImageCache.NUM_PAGES_THRESHOLD||!this._imageCache.has(t)&&this.#G)}addDecodeFailed(t){this.#q.put(t)}hasDecodeFailed(t){return this.#q.has(t)}addByteSize(t,e){const s=this._imageCache.get(t);s&&(s.byteSize||(s.byteSize=e))}getData(t,e){const s=this._refCache.get(t);if(!s)return null;if(s.size<_GlobalImageCache.NUM_PAGES_THRESHOLD)return null;const i=this._imageCache.get(t);return i?(s.add(e),i):null}setData(t,e){if(!this._refCache.has(t))throw new Error('GlobalImageCache.setData - expected "shouldCache" to have been called.');this._imageCache.has(t)||(this.#G?warn$1("GlobalImageCache.setData - cache limit reached."):this._imageCache.put(t,e))}clear(t=!1){t||(this.#q.clear(),this._refCache.clear()),this._imageCache.clear()}},wo=class{constructor({xref:t,isEvalSupported:e=!0}){this.xref=t,this.isEvalSupported=!1!==e}create(t,e=!1){let s,i;if(t instanceof gs?s=t:t instanceof fs?s=t.objId:t instanceof bs&&(s=t.dict?.objId),s){const t=this._localFunctionCache.getByRef(s);if(t)return t}const n=this.xref.fetchIfRef(t);if(Array.isArray(n)){if(!e)throw new Error('PDFFunctionFactory.create - expected "parseArray" argument.');i=yo.parseArray(this,n)}else i=yo.parse(this,n);return s&&this._localFunctionCache.set(null,s,i),i}get _localFunctionCache(){return shadow$1(this,"_localFunctionCache",new uo)}};function toNumberArray(t){return Array.isArray(t)?isNumberArray(t,null)?t:t.map(t=>+t):null}var yo=class{static getSampleArray(t,e,s,i){let n,a,r=1;for(n=0,a=t.length;n<a;n++)r*=t[n];r*=e;const o=new Array(r);let l=0,c=0;const h=1/(2**s-1),u=i.getBytes((r*s+7)/8);let d=0;for(n=0;n<r;n++){for(;l<s;)c<<=8,c|=u[d++],l+=8;l-=s,o[n]=(c>>l)*h,c&=(1<<l)-1}return o}static parse(t,e){const s=e.dict||e;switch(s.get("FunctionType")){case 0:return this.constructSampled(t,e,s);case 1:break;case 2:return this.constructInterpolated(t,s);case 3:return this.constructStiched(t,s);case 4:return this.constructPostScript(t,e,s)}throw new Ze("Unknown type of function")}static parseArray(t,e){const{xref:s}=t,i=[];for(const n of e)i.push(this.parse(t,s.fetchIfRef(n)));return function(t,e,s,n){for(let a=0,r=i.length;a<r;a++)i[a](t,e,s,n+a)}}static constructSampled(t,e,s){function toMultiArray(t){const e=t.length,s=[];let i=0;for(let n=0;n<e;n+=2)s[i++]=[t[n],t[n+1]];return s}function interpolate(t,e,s,i,n){return i+(n-i)/(s-e)*(t-e)}let i=toNumberArray(s.getArray("Domain")),n=toNumberArray(s.getArray("Range"));if(!i||!n)throw new Ze("No domain or range");const a=i.length/2,r=n.length/2;i=toMultiArray(i),n=toMultiArray(n);const o=toNumberArray(s.getArray("Size")),l=s.get("BitsPerSample"),c=s.get("Order")||1;1!==c&&info$1("No support for cubic spline interpolation: "+c);let h=toNumberArray(s.getArray("Encode"));if(h)h=toMultiArray(h);else{h=[];for(let t=0;t<a;++t)h.push([0,o[t]-1])}let u=toNumberArray(s.getArray("Decode"));u=u?toMultiArray(u):n;const d=this.getSampleArray(o,r,l,e);return function(t,e,s,l){const c=1<<a,f=new Float64Array(c).fill(1),g=new Uint32Array(c);let p,m,b=r,w=1;for(p=0;p<a;++p){const s=i[p][0],n=i[p][1];let a=interpolate(MathClamp$1(t[e+p],s,n),s,n,h[p][0],h[p][1]);const r=o[p];a=MathClamp$1(a,0,r-1);const l=a<r-1?Math.floor(a):a-1,u=l+1-a,d=a-l,y=l*b,x=y+b;for(m=0;m<c;m++)m&w?(f[m]*=d,g[m]+=x):(f[m]*=u,g[m]+=y);b*=r,w<<=1}for(m=0;m<r;++m){let t=0;for(p=0;p<c;p++)t+=d[g[p]+m]*f[p];t=interpolate(t,0,1,u[m][0],u[m][1]),s[l+m]=MathClamp$1(t,n[m][0],n[m][1])}}}static constructInterpolated(t,e){const s=toNumberArray(e.getArray("C0"))||[0],i=toNumberArray(e.getArray("C1"))||[1],n=e.get("N"),a=[];for(let t=0,e=s.length;t<e;++t)a.push(i[t]-s[t]);const r=a.length;return function(t,e,i,o){const l=1===n?t[e]:t[e]**n;for(let t=0;t<r;++t)i[o+t]=s[t]+l*a[t]}}static constructStiched(t,e){const s=toNumberArray(e.getArray("Domain"));if(!s)throw new Ze("No domain");if(1!=s.length/2)throw new Ze("Bad domain for stiched function");const{xref:i}=t,n=[];for(const s of e.get("Functions"))n.push(this.parse(t,i.fetchIfRef(s)));const a=toNumberArray(e.getArray("Bounds")),r=toNumberArray(e.getArray("Encode")),o=new Float32Array(1);return function(t,e,i,l){const c=MathClamp$1(t[e],s[0],s[1]),h=a.length;let u;for(u=0;u<h&&!(c<a[u]);++u);let d=s[0];u>0&&(d=a[u-1]);let f=s[1];u<a.length&&(f=a[u]);const g=r[2*u],p=r[2*u+1];o[0]=d===f?g:g+(c-d)*(p-g)/(f-d),n[u](o,0,i,l)}}static constructPostScript(t,e,s){const i=toNumberArray(s.getArray("Domain")),n=toNumberArray(s.getArray("Range"));if(!i)throw new Ze("No domain.");if(!n)throw new Ze("No range.");const a=new oo(e),r=new no(a).parse();if(t.isEvalSupported&&ts.isEvalSupported){const t=(new Eo).compile(r,i,n);if(t)return new Function("src","srcOffset","dest","destOffset",t)}info$1("Unable to compile PS function");const o=n.length>>1,l=i.length>>1,c=new vo(r),h=Object.create(null);let u=8192;const d=new Float32Array(l);return function(t,e,s,i){let a,r,f="";const g=d;for(a=0;a<l;a++)r=t[e+a],g[a]=r,f+=r+"_";const p=h[f];if(void 0!==p)return void s.set(p,i);const m=new Float32Array(o),b=c.execute(g),w=b.length-o;for(a=0;a<o;a++){r=b[w+a];let t=n[2*a];r<t?r=t:(t=n[2*a+1],r>t&&(r=t)),m[a]=r}u>0&&(u--,h[f]=m),s.set(m,i)}}};function isPDFFunction(t){let e;if(t instanceof fs)e=t;else{if(!(t instanceof bs))return!1;e=t.dict}return e.has("FunctionType")}var xo=class _PostScriptStack{static MAX_STACK_SIZE=100;constructor(t){this.stack=t?Array.from(t):[]}push(t){if(this.stack.length>=_PostScriptStack.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");this.stack.push(t)}pop(){if(this.stack.length<=0)throw new Error("PostScript function stack underflow.");return this.stack.pop()}copy(t){if(this.stack.length+t>=_PostScriptStack.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");const e=this.stack;for(let s=e.length-t,i=t-1;i>=0;i--,s++)e.push(e[s])}index(t){this.push(this.stack[this.stack.length-t-1])}roll(t,e){const s=this.stack,i=s.length-t,n=s.length-1,a=i+(e-Math.floor(e/t)*t);for(let t=i,e=n;t<e;t++,e--){const i=s[t];s[t]=s[e],s[e]=i}for(let t=i,e=a-1;t<e;t++,e--){const i=s[t];s[t]=s[e],s[e]=i}for(let t=a,e=n;t<e;t++,e--){const i=s[t];s[t]=s[e],s[e]=i}}},vo=class{constructor(t){this.operators=t}execute(t){const e=new xo(t);let s=0;const i=this.operators,n=i.length;let a,r,o;for(;s<n;)if(a=i[s++],"number"!=typeof a)switch(a){case"jz":o=e.pop(),r=e.pop(),r||(s=o);break;case"j":r=e.pop(),s=r;break;case"abs":r=e.pop(),e.push(Math.abs(r));break;case"add":o=e.pop(),r=e.pop(),e.push(r+o);break;case"and":o=e.pop(),r=e.pop(),"boolean"==typeof r&&"boolean"==typeof o?e.push(r&&o):e.push(r&o);break;case"atan":o=e.pop(),r=e.pop(),r=Math.atan2(r,o)/Math.PI*180,r<0&&(r+=360),e.push(r);break;case"bitshift":o=e.pop(),r=e.pop(),r>0?e.push(r<<o):e.push(r>>o);break;case"ceiling":r=e.pop(),e.push(Math.ceil(r));break;case"copy":r=e.pop(),e.copy(r);break;case"cos":r=e.pop(),e.push(Math.cos(r%360/180*Math.PI));break;case"cvi":r=0|e.pop(),e.push(r);break;case"cvr":break;case"div":o=e.pop(),r=e.pop(),e.push(r/o);break;case"dup":e.copy(1);break;case"eq":o=e.pop(),r=e.pop(),e.push(r===o);break;case"exch":e.roll(2,1);break;case"exp":o=e.pop(),r=e.pop(),e.push(r**o);break;case"false":e.push(!1);break;case"floor":r=e.pop(),e.push(Math.floor(r));break;case"ge":o=e.pop(),r=e.pop(),e.push(r>=o);break;case"gt":o=e.pop(),r=e.pop(),e.push(r>o);break;case"idiv":o=e.pop(),r=e.pop(),e.push(r/o|0);break;case"index":r=e.pop(),e.index(r);break;case"le":o=e.pop(),r=e.pop(),e.push(r<=o);break;case"ln":r=e.pop(),e.push(Math.log(r));break;case"log":r=e.pop(),e.push(Math.log10(r));break;case"lt":o=e.pop(),r=e.pop(),e.push(r<o);break;case"mod":o=e.pop(),r=e.pop(),e.push(r%o);break;case"mul":o=e.pop(),r=e.pop(),e.push(r*o);break;case"ne":o=e.pop(),r=e.pop(),e.push(r!==o);break;case"neg":r=e.pop(),e.push(-r);break;case"not":r=e.pop(),"boolean"==typeof r?e.push(!r):e.push(~r);break;case"or":o=e.pop(),r=e.pop(),"boolean"==typeof r&&"boolean"==typeof o?e.push(r||o):e.push(r|o);break;case"pop":e.pop();break;case"roll":o=e.pop(),r=e.pop(),e.roll(r,o);break;case"round":r=e.pop(),e.push(Math.round(r));break;case"sin":r=e.pop(),e.push(Math.sin(r%360/180*Math.PI));break;case"sqrt":r=e.pop(),e.push(Math.sqrt(r));break;case"sub":o=e.pop(),r=e.pop(),e.push(r-o);break;case"true":e.push(!0);break;case"truncate":r=e.pop(),r=r<0?Math.ceil(r):Math.floor(r),e.push(r);break;case"xor":o=e.pop(),r=e.pop(),"boolean"==typeof r&&"boolean"==typeof o?e.push(r!==o):e.push(r^o);break;default:throw new Ze(`Unknown operator ${a}`)}else e.push(a);return e.stack}},Ao=class{constructor(t){this.type=t}visit(t){unreachable$1("abstract method")}},ko=class extends Ao{constructor(t,e,s){super("args"),this.index=t,this.min=e,this.max=s}visit(t){t.visitArgument(this)}},So=class extends Ao{constructor(t){super("literal"),this.number=t,this.min=t,this.max=t}visit(t){t.visitLiteral(this)}},Co=class extends Ao{constructor(t,e,s,i,n){super("binary"),this.op=t,this.arg1=e,this.arg2=s,this.min=i,this.max=n}visit(t){t.visitBinaryOperation(this)}},_o=class extends Ao{constructor(t,e){super("max"),this.arg=t,this.min=t.min,this.max=e}visit(t){t.visitMin(this)}},Io=class extends Ao{constructor(t,e,s){super("var"),this.index=t,this.min=e,this.max=s}visit(t){t.visitVariable(this)}},To=class extends Ao{constructor(t,e){super("definition"),this.variable=t,this.arg=e}visit(t){t.visitVariableDefinition(this)}},Mo=class{constructor(){this.parts=[]}visitArgument(t){this.parts.push("Math.max(",t.min,", Math.min(",t.max,", src[srcOffset + ",t.index,"]))")}visitVariable(t){this.parts.push("v",t.index)}visitLiteral(t){this.parts.push(t.number)}visitBinaryOperation(t){this.parts.push("("),t.arg1.visit(this),this.parts.push(" ",t.op," "),t.arg2.visit(this),this.parts.push(")")}visitVariableDefinition(t){this.parts.push("var "),t.variable.visit(this),this.parts.push(" = "),t.arg.visit(this),this.parts.push(";")}visitMin(t){this.parts.push("Math.min("),t.arg.visit(this),this.parts.push(", ",t.max,")")}toString(){return this.parts.join("")}};function buildAddOperation(t,e){return"literal"===e.type&&0===e.number?t:"literal"===t.type&&0===t.number?e:"literal"===e.type&&"literal"===t.type?new So(t.number+e.number):new Co("+",t,e,t.min+e.min,t.max+e.max)}function buildMulOperation(t,e){if("literal"===e.type){if(0===e.number)return new So(0);if(1===e.number)return t;if("literal"===t.type)return new So(t.number*e.number)}if("literal"===t.type){if(0===t.number)return new So(0);if(1===t.number)return e}const s=Math.min(t.min*e.min,t.min*e.max,t.max*e.min,t.max*e.max),i=Math.max(t.min*e.min,t.min*e.max,t.max*e.min,t.max*e.max);return new Co("*",t,e,s,i)}function buildSubOperation(t,e){if("literal"===e.type){if(0===e.number)return t;if("literal"===t.type)return new So(t.number-e.number)}return"binary"===e.type&&"-"===e.op&&"literal"===t.type&&1===t.number&&"literal"===e.arg1.type&&1===e.arg1.number?e.arg2:new Co("-",t,e,t.min-e.max,t.max-e.min)}function buildMinOperation(t,e){return t.min>=e?new So(e):t.max<=e?t:new _o(t,e)}var Eo=class{compile(t,e,s){const i=[],n=[],a=e.length>>1,r=s.length>>1;let o,l,c,h,u,d,f,g,p=0;for(let t=0;t<a;t++)i.push(new ko(t,e[2*t],e[2*t+1]));for(let e=0,s=t.length;e<s;e++)if(g=t[e],"number"!=typeof g)switch(g){case"add":if(i.length<2)return null;h=i.pop(),c=i.pop(),i.push(buildAddOperation(c,h));break;case"cvr":if(i.length<1)return null;break;case"mul":if(i.length<2)return null;h=i.pop(),c=i.pop(),i.push(buildMulOperation(c,h));break;case"sub":if(i.length<2)return null;h=i.pop(),c=i.pop(),i.push(buildSubOperation(c,h));break;case"exch":if(i.length<2)return null;u=i.pop(),d=i.pop(),i.push(u,d);break;case"pop":if(i.length<1)return null;i.pop();break;case"index":if(i.length<1)return null;if(c=i.pop(),"literal"!==c.type)return null;if(o=c.number,o<0||!Number.isInteger(o)||i.length<o)return null;if(u=i[i.length-o-1],"literal"===u.type||"var"===u.type){i.push(u);break}f=new Io(p++,u.min,u.max),i[i.length-o-1]=f,i.push(f),n.push(new To(f,u));break;case"dup":if(i.length<1)return null;if("number"==typeof t[e+1]&&"gt"===t[e+2]&&t[e+3]===e+7&&"jz"===t[e+4]&&"pop"===t[e+5]&&t[e+6]===t[e+1]){c=i.pop(),i.push(buildMinOperation(c,t[e+1])),e+=6;break}if(u=i.at(-1),"literal"===u.type||"var"===u.type){i.push(u);break}f=new Io(p++,u.min,u.max),i[i.length-1]=f,i.push(f),n.push(new To(f,u));break;case"roll":if(i.length<2)return null;if(h=i.pop(),c=i.pop(),"literal"!==h.type||"literal"!==c.type)return null;if(l=h.number,o=c.number,o<=0||!Number.isInteger(o)||!Number.isInteger(l)||i.length<o)return null;if(l=(l%o+o)%o,0===l)break;i.push(...i.splice(i.length-o,o-l));break;default:return null}else i.push(new So(g));if(i.length!==r)return null;const m=[];for(const t of n){const e=new Mo;t.visit(e),m.push(e.toString())}for(let t=0,e=i.length;t<e;t++){const e=i[t],n=new Mo;e.visit(n);const a=s[2*t],r=s[2*t+1],o=[n.toString()];a>e.min&&(o.unshift("Math.max(",a,", "),o.push(")")),r<e.max&&(o.unshift("Math.min(",r,", "),o.push(")")),o.unshift("dest[destOffset + ",t,"] = "),o.push(";"),m.push(o.join(""))}return m.join("\n")}},Fo=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],Do=["AN","AN","AN","AN","AN","AN","ON","ON","AL","ET","ET","AL","CS","AL","ON","ON","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","ON","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","ON","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL"];function isOdd(t){return!!(1&t)}function isEven(t){return!(1&t)}function findUnequal(t,e,s){let i,n;for(i=e,n=t.length;i<n;++i)if(t[i]!==s)return i;return i}function reverseValues(t,e,s){for(let i=e,n=s-1;i<n;++i,--n){const e=t[i];t[i]=t[n],t[n]=e}}function createBidiText(t,e,s=!1){let i="ltr";return s?i="ttb":e||(i="rtl"),{str:t,dir:i}}var Ro=[],Bo=[];function bidi(t,e=-1,s=!1){let i=!0;const n=t.length;if(0===n||s)return createBidiText(t,i,s);Ro.length=n,Bo.length=n;let a,r,o=0;for(a=0;a<n;++a){Ro[a]=t.charAt(a);const e=t.charCodeAt(a);let s="L";e<=255?s=Fo[e]:1424<=e&&e<=1524?s="R":1536<=e&&e<=1791?(s=Do[255&e],s||warn$1("Bidi: invalid Unicode character "+e.toString(16))):(1792<=e&&e<=2220||64336<=e&&e<=65023||65136<=e&&e<=65279)&&(s="AL"),"R"!==s&&"AL"!==s&&"AN"!==s||o++,Bo[a]=s}if(0===o)return i=!0,createBidiText(t,i);-1===e&&(o/n<.3&&n>4?(i=!0,e=0):(i=!1,e=1));const l=[];for(a=0;a<n;++a)l[a]=e;const c=isOdd(e)?"R":"L",h=c,u=h;let d,f=h;for(a=0;a<n;++a)"NSM"===Bo[a]?Bo[a]=f:f=Bo[a];for(f=h,a=0;a<n;++a)d=Bo[a],"EN"===d?Bo[a]="AL"===f?"AN":"EN":"R"!==d&&"L"!==d&&"AL"!==d||(f=d);for(a=0;a<n;++a)d=Bo[a],"AL"===d&&(Bo[a]="R");for(a=1;a<n-1;++a)"ES"===Bo[a]&&"EN"===Bo[a-1]&&"EN"===Bo[a+1]&&(Bo[a]="EN"),"CS"!==Bo[a]||"EN"!==Bo[a-1]&&"AN"!==Bo[a-1]||Bo[a+1]!==Bo[a-1]||(Bo[a]=Bo[a-1]);for(a=0;a<n;++a)if("EN"===Bo[a]){for(let t=a-1;t>=0&&"ET"===Bo[t];--t)Bo[t]="EN";for(let t=a+1;t<n&&"ET"===Bo[t];++t)Bo[t]="EN"}for(a=0;a<n;++a)d=Bo[a],"WS"!==d&&"ES"!==d&&"ET"!==d&&"CS"!==d||(Bo[a]="ON");for(f=h,a=0;a<n;++a)d=Bo[a],"EN"===d?Bo[a]="L"===f?"L":"EN":"R"!==d&&"L"!==d||(f=d);for(a=0;a<n;++a)if("ON"===Bo[a]){const t=findUnequal(Bo,a+1,"ON");let e=h;a>0&&(e=Bo[a-1]);let s=u;t+1<n&&(s=Bo[t+1]),"L"!==e&&(e="R"),"L"!==s&&(s="R"),e===s&&Bo.fill(e,a,t),a=t-1}for(a=0;a<n;++a)"ON"===Bo[a]&&(Bo[a]=c);for(a=0;a<n;++a)d=Bo[a],isEven(l[a])?"R"===d?l[a]+=1:"AN"!==d&&"EN"!==d||(l[a]+=2):"L"!==d&&"AN"!==d&&"EN"!==d||(l[a]+=1);let g,p=-1,m=99;for(a=0,r=l.length;a<r;++a)g=l[a],p<g&&(p=g),m>g&&isOdd(g)&&(m=g);for(g=p;g>=m;--g){let t=-1;for(a=0,r=l.length;a<r;++a)l[a]<g?t>=0&&(reverseValues(Ro,t,a),t=-1):t<0&&(t=a);t>=0&&reverseValues(Ro,t,l.length)}for(a=0,r=Ro.length;a<r;++a){const t=Ro[a];"<"!==t&&">"!==t||(Ro[a]="")}return createBidiText(Ro.join(""),i)}var Po=class CssFontInfo{#P;#W;#V;static strings=["fontFamily","fontWeight","italicAngle"];static write(t){const e=new TextEncoder,s={};let i=0;for(const n of CssFontInfo.strings){const a=e.encode(t[n]);s[n]=a,i+=4+a.length}const n=new ArrayBuffer(i),a=new Uint8Array(n),r=new DataView(n);let o=0;for(const t of CssFontInfo.strings){const e=s[t],i=e.length;r.setUint32(o,i),a.set(e,o+4),o+=4+i}return assert$1(o===n.byteLength,"CssFontInfo.write: Buffer overflow"),n}constructor(t){this.#P=t,this.#W=new DataView(this.#P),this.#V=new TextDecoder}#X(t){assert$1(t<CssFontInfo.strings.length,"Invalid string index");let e=0;for(let s=0;s<t;s++)e+=this.#W.getUint32(e)+4;const s=this.#W.getUint32(e);return this.#V.decode(new Uint8Array(this.#P,e+4,s))}get fontFamily(){return this.#X(0)}get fontWeight(){return this.#X(1)}get italicAngle(){return this.#X(2)}},No=class SystemFontInfo{#P;#W;#V;static strings=["css","loadedName","baseFontName","src"];static write(t){const e=new TextEncoder,s={};let i=0;for(const n of SystemFontInfo.strings){const a=e.encode(t[n]);s[n]=a,i+=4+a.length}i+=4;let n,a,r=1+i;t.style&&(n=e.encode(t.style.style),a=e.encode(t.style.weight),r+=4+n.length+4+a.length);const o=new ArrayBuffer(r),l=new Uint8Array(o),c=new DataView(o);let h=0;c.setUint8(h++,t.guessFallback?1:0),c.setUint32(h,0),h+=4,i=0;for(const t of SystemFontInfo.strings){const e=s[t],n=e.length;i+=4+n,c.setUint32(h,n),l.set(e,h+4),h+=4+n}return c.setUint32(h-i-4,i),t.style&&(c.setUint32(h,n.length),l.set(n,h+4),h+=4+n.length,c.setUint32(h,a.length),l.set(a,h+4),h+=4+a.length),assert$1(h<=o.byteLength,"SubstitionInfo.write: Buffer overflow"),o.transferToFixedLength(h)}constructor(t){this.#P=t,this.#W=new DataView(this.#P),this.#V=new TextDecoder}get guessFallback(){return 0!==this.#W.getUint8(0)}#X(t){assert$1(t<SystemFontInfo.strings.length,"Invalid string index");let e=5;for(let s=0;s<t;s++)e+=this.#W.getUint32(e)+4;const s=this.#W.getUint32(e);return this.#V.decode(new Uint8Array(this.#P,e+4,s))}get css(){return this.#X(0)}get loadedName(){return this.#X(1)}get baseFontName(){return this.#X(2)}get src(){return this.#X(3)}get style(){let t=1;t+=4+this.#W.getUint32(t);const e=this.#W.getUint32(t),s=this.#V.decode(new Uint8Array(this.#P,t+4,e));t+=4+e;const i=this.#W.getUint32(t);return{style:s,weight:this.#V.decode(new Uint8Array(this.#P,t+4,i))}}},Oo=class FontInfo{static bools=["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"];static numbers=["ascent","defaultWidth","descent"];static strings=["fallbackName","loadedName","mimetype","name"];static#K=Math.ceil(2*this.bools.length/8);static#Y=this.#K+8*this.numbers.length;static#J=this.#Y+1+8;static#Z=this.#J+1+48;static#Q=this.#Z+1+6;#P;#V;#W;constructor({data:t,extra:e}){this.#P=t,this.#V=new TextDecoder,this.#W=new DataView(this.#P),e&&Object.assign(this,e)}#tt(t){assert$1(t<FontInfo.bools.length,"Invalid boolean index");const e=Math.floor(t/4),s=2*t%8,i=this.#W.getUint8(e)>>s&3;return 0===i?void 0:2===i}get black(){return this.#tt(0)}get bold(){return this.#tt(1)}get disableFontFace(){return this.#tt(2)}get fontExtraProperties(){return this.#tt(3)}get isInvalidPDFjsFont(){return this.#tt(4)}get isType3Font(){return this.#tt(5)}get italic(){return this.#tt(6)}get missingFile(){return this.#tt(7)}get remeasure(){return this.#tt(8)}get vertical(){return this.#tt(9)}#et(t){return assert$1(t<FontInfo.numbers.length,"Invalid number index"),this.#W.getFloat64(FontInfo.#K+8*t)}get ascent(){return this.#et(0)}get defaultWidth(){return this.#et(1)}get descent(){return this.#et(2)}get bbox(){let t=FontInfo.#Y;if(0===this.#W.getUint8(t))return;t+=1;const e=[];for(let s=0;s<4;s++)e.push(this.#W.getInt16(t,!0)),t+=2;return e}get fontMatrix(){let t=FontInfo.#J;if(0===this.#W.getUint8(t))return;t+=1;const e=[];for(let s=0;s<6;s++)e.push(this.#W.getFloat64(t,!0)),t+=8;return e}get defaultVMetrics(){let t=FontInfo.#Z;if(0===this.#W.getUint8(t))return;t+=1;const e=[];for(let s=0;s<3;s++)e.push(this.#W.getInt16(t,!0)),t+=2;return e}#X(t){assert$1(t<FontInfo.strings.length,"Invalid string index");let e=FontInfo.#Q+4;for(let s=0;s<t;s++)e+=this.#W.getUint32(e)+4;const s=this.#W.getUint32(e),i=new Uint8Array(s);return i.set(new Uint8Array(this.#P,e+4,s)),this.#V.decode(i)}get fallbackName(){return this.#X(0)}get loadedName(){return this.#X(1)}get mimetype(){return this.#X(2)}get name(){return this.#X(3)}get data(){let t=FontInfo.#Q;t+=4+this.#W.getUint32(t),t+=4+this.#W.getUint32(t),t+=4+this.#W.getUint32(t);const e=this.#W.getUint32(t);if(0!==e)return new Uint8Array(this.#P,t+4,e)}clearData(){let t=FontInfo.#Q;t+=4+this.#W.getUint32(t),t+=4+this.#W.getUint32(t),t+=4+this.#W.getUint32(t);const e=this.#W.getUint32(t);new Uint8Array(this.#P,t+4,e).fill(0),this.#W.setUint32(t,0)}get cssFontInfo(){let t=FontInfo.#Q;t+=4+this.#W.getUint32(t),t+=4+this.#W.getUint32(t);const e=this.#W.getUint32(t);if(0===e)return null;const s=new Uint8Array(e);return s.set(new Uint8Array(this.#P,t+4,e)),new Po(s.buffer)}get systemFontInfo(){let t=FontInfo.#Q;t+=4+this.#W.getUint32(t);const e=this.#W.getUint32(t);if(0===e)return null;const s=new Uint8Array(e);return s.set(new Uint8Array(this.#P,t+4,e)),new No(s.buffer)}static write(t){const e=t.systemFontInfo?No.write(t.systemFontInfo):null,s=t.cssFontInfo?Po.write(t.cssFontInfo):null,i=new TextEncoder,n={};let a=0;for(const e of FontInfo.strings)n[e]=i.encode(t[e]),a+=4+n[e].length;const r=FontInfo.#Q+4+a+4+(e?e.byteLength:0)+4+(s?s.byteLength:0)+4+(t.data?t.data.length:0),o=new ArrayBuffer(r),l=new Uint8Array(o),c=new DataView(o);let h=0;const u=FontInfo.bools.length;let d=0,f=0;for(let e=0;e<u;e++){const s=t[FontInfo.bools[e]];d|=(void 0===s?0:s?2:1)<<f,f+=2,8!==f&&e!==u-1||(c.setUint8(h++,d),d=0,f=0)}assert$1(h===FontInfo.#K,"FontInfo.write: Boolean properties offset mismatch");for(const e of FontInfo.numbers)c.setFloat64(h,t[e]),h+=8;if(assert$1(h===FontInfo.#Y,"FontInfo.write: Number properties offset mismatch"),t.bbox){c.setUint8(h++,4);for(const e of t.bbox)c.setInt16(h,e,!0),h+=2}else c.setUint8(h++,0),h+=8;if(assert$1(h===FontInfo.#J,"FontInfo.write: BBox properties offset mismatch"),t.fontMatrix){c.setUint8(h++,6);for(const e of t.fontMatrix)c.setFloat64(h,e,!0),h+=8}else c.setUint8(h++,0),h+=48;if(assert$1(h===FontInfo.#Z,"FontInfo.write: FontMatrix properties offset mismatch"),t.defaultVMetrics){c.setUint8(h++,1);for(const e of t.defaultVMetrics)c.setInt16(h,e,!0),h+=2}else c.setUint8(h++,0),h+=6;assert$1(h===FontInfo.#Q,"FontInfo.write: DefaultVMetrics properties offset mismatch"),c.setUint32(FontInfo.#Q,0),h+=4;for(const t of FontInfo.strings){const e=n[t],s=e.length;c.setUint32(h,s),l.set(e,h+4),h+=4+s}if(c.setUint32(FontInfo.#Q,h-FontInfo.#Q-4),e){const t=e.byteLength;c.setUint32(h,t),assert$1(h+4+t<=o.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),l.set(new Uint8Array(e),h+4),h+=4+t}else c.setUint32(h,0),h+=4;if(s){const t=s.byteLength;c.setUint32(h,t),assert$1(h+4+t<=o.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),l.set(new Uint8Array(s),h+4),h+=4+t}else c.setUint32(h,0),h+=4;return void 0===t.data?(c.setUint32(h,0),h+=4):(c.setUint32(h,t.data.length),l.set(t.data,h+4),h+=4+t.data.length),assert$1(h<=o.byteLength,"FontInfo.write: Buffer overflow"),o.transferToFixedLength(h)}},Lo={style:"normal",weight:"normal"},Uo={style:"normal",weight:"bold"},$o={style:"italic",weight:"normal"},Ho={style:"italic",weight:"bold"},jo=new Map([["Times-Roman",{local:["Times New Roman","Times-Roman","Times","Liberation Serif","Nimbus Roman","Nimbus Roman L","Tinos","Thorndale","TeX Gyre Termes","FreeSerif","Linux Libertine O","Libertinus Serif","DejaVu Serif","Bitstream Vera Serif","Ubuntu"],style:Lo,ultimate:"serif"}],["Times-Bold",{alias:"Times-Roman",style:Uo,ultimate:"serif"}],["Times-Italic",{alias:"Times-Roman",style:$o,ultimate:"serif"}],["Times-BoldItalic",{alias:"Times-Roman",style:Ho,ultimate:"serif"}],["Helvetica",{local:["Helvetica","Helvetica Neue","Arial","Arial Nova","Liberation Sans","Arimo","Nimbus Sans","Nimbus Sans L","A030","TeX Gyre Heros","FreeSans","DejaVu Sans","Albany","Bitstream Vera Sans","Arial Unicode MS","Microsoft Sans Serif","Apple Symbols","Cantarell"],path:"LiberationSans-Regular.ttf",style:Lo,ultimate:"sans-serif"}],["Helvetica-Bold",{alias:"Helvetica",path:"LiberationSans-Bold.ttf",style:Uo,ultimate:"sans-serif"}],["Helvetica-Oblique",{alias:"Helvetica",path:"LiberationSans-Italic.ttf",style:$o,ultimate:"sans-serif"}],["Helvetica-BoldOblique",{alias:"Helvetica",path:"LiberationSans-BoldItalic.ttf",style:Ho,ultimate:"sans-serif"}],["Courier",{local:["Courier","Courier New","Liberation Mono","Nimbus Mono","Nimbus Mono L","Cousine","Cumberland","TeX Gyre Cursor","FreeMono","Linux Libertine Mono O","Libertinus Mono"],style:Lo,ultimate:"monospace"}],["Courier-Bold",{alias:"Courier",style:Uo,ultimate:"monospace"}],["Courier-Oblique",{alias:"Courier",style:$o,ultimate:"monospace"}],["Courier-BoldOblique",{alias:"Courier",style:Ho,ultimate:"monospace"}],["ArialBlack",{local:["Arial Black"],style:{style:"normal",weight:"900"},fallback:"Helvetica-Bold"}],["ArialBlack-Bold",{alias:"ArialBlack"}],["ArialBlack-Italic",{alias:"ArialBlack",style:{style:"italic",weight:"900"},fallback:"Helvetica-BoldOblique"}],["ArialBlack-BoldItalic",{alias:"ArialBlack-Italic"}],["ArialNarrow",{local:["Arial Narrow","Liberation Sans Narrow","Helvetica Condensed","Nimbus Sans Narrow","TeX Gyre Heros Cn"],style:Lo,fallback:"Helvetica"}],["ArialNarrow-Bold",{alias:"ArialNarrow",style:Uo,fallback:"Helvetica-Bold"}],["ArialNarrow-Italic",{alias:"ArialNarrow",style:$o,fallback:"Helvetica-Oblique"}],["ArialNarrow-BoldItalic",{alias:"ArialNarrow",style:Ho,fallback:"Helvetica-BoldOblique"}],["Calibri",{local:["Calibri","Carlito"],style:Lo,fallback:"Helvetica"}],["Calibri-Bold",{alias:"Calibri",style:Uo,fallback:"Helvetica-Bold"}],["Calibri-Italic",{alias:"Calibri",style:$o,fallback:"Helvetica-Oblique"}],["Calibri-BoldItalic",{alias:"Calibri",style:Ho,fallback:"Helvetica-BoldOblique"}],["Wingdings",{local:["Wingdings","URW Dingbats"],style:Lo}],["Wingdings-Regular",{alias:"Wingdings"}],["Wingdings-Bold",{alias:"Wingdings"}]]),qo=new Map([["Arial-Black","ArialBlack"]]);function getFamilyName(t){const e=new Set(["thin","extralight","ultralight","demilight","semilight","light","book","regular","normal","medium","demibold","semibold","bold","extrabold","ultrabold","black","heavy","extrablack","ultrablack","roman","italic","oblique","ultracondensed","extracondensed","condensed","semicondensed","normal","semiexpanded","expanded","extraexpanded","ultraexpanded","bolditalic"]);return t.split(/[- ,+]+/g).filter(t=>!e.has(t.toLowerCase())).join(" ")}function generateFont({alias:t,local:e,path:s,fallback:i,style:n,ultimate:a},r,o,l=!0,c=!0,h=""){const u={style:null,ultimate:null};if(e){const t=h?` ${h}`:"";for(const s of e)r.push(`local(${s}${t})`)}if(t){const e=jo.get(t),a=h||function(t){switch(t){case Uo:return"Bold";case $o:return"Italic";case Ho:return"Bold Italic";default:if("bold"===t?.weight)return"Bold";if("italic"===t?.style)return"Italic"}return""}(n);Object.assign(u,generateFont(e,r,o,l&&!i,c&&!s,a))}if(n&&(u.style=n),a&&(u.ultimate=a),l&&i){const t=jo.get(i),{ultimate:e}=generateFont(t,r,o,l,c&&!s,h);u.ultimate||=e}return c&&s&&o&&r.push(`url(${o}${s})`),u}function getFontSubstitution(t,e,s,i,n,a){if(i.startsWith("InvalidPDFjsFont_"))return null;"TrueType"!==a&&"Type1"!==a||!/^[A-Z]{6}\+/.test(i)||(i=i.slice(7));const r=i=normalizeFontName(i);let o=t.get(r);if(o)return o;let l=jo.get(i);if(!l)for(const[t,e]of qo)if(i.startsWith(t)){i=`${e}${i.substring(t.length)}`,l=jo.get(i);break}let c=!1;l||(l=jo.get(n),c=!0);const h=`${e.getDocId()}_s${e.createFontId()}`;if(!l){if(!validateFontName(i))return warn$1(`Cannot substitute the font because of its name: ${i}`),t.set(r,null),null;const e=/bold/gi.test(i),s=/oblique|italic/gi.test(i),n=e&&s&&Ho||e&&Uo||s&&$o||Lo;return o={css:`"${getFamilyName(i)}",${h}`,guessFallback:!0,loadedName:h,baseFontName:i,src:`local(${i})`,style:n},t.set(r,o),o}const u=[];c&&validateFontName(i)&&u.push(`local(${i})`);const{style:d,ultimate:f}=generateFont(l,u,s),g=null===f,p=g?"":`,${f}`;return o={css:`"${getFamilyName(i)}",${h}${p}`,guessFallback:g,loadedName:h,baseFontName:i,src:u.join(","),style:d},t.set(r,o),o}var zo=3285377520,Go=4294901760,Wo=65535,Vo=class{constructor(t){this.h1=t?4294967295&t:zo,this.h2=t?4294967295&t:zo}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(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");e=t.slice(),s=e.byteLength}const i=s>>2,n=s-4*i,a=new Uint32Array(e.buffer,0,i);let r=0,o=0,l=this.h1,c=this.h2;const h=3432918353,u=461845907,d=11601,f=13715;for(let t=0;t<i;t++)1&t?(r=a[t],r=r*h&Go|r*d&Wo,r=r<<15|r>>>17,r=r*u&Go|r*f&Wo,l^=r,l=l<<13|l>>>19,l=5*l+3864292196):(o=a[t],o=o*h&Go|o*d&Wo,o=o<<15|o>>>17,o=o*u&Go|o*f&Wo,c^=o,c=c<<13|c>>>19,c=5*c+3864292196);switch(r=0,n){case 3:r^=e[4*i+2]<<16;case 2:r^=e[4*i+1]<<8;case 1:r^=e[4*i],r=r*h&Go|r*d&Wo,r=r<<15|r>>>17,r=r*u&Go|r*f&Wo,1&i?l^=r:c^=r}this.h1=l,this.h2=c}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&Go|36045*t&Wo,e=4283543511*e&Go|(2950163797*(e<<16|t>>>16)&Go)>>>16,t^=e>>>1,t=444984403*t&Go|60499*t&Wo,e=3301882366*e&Go|(3120437893*(e<<16|t>>>16)&Go)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}};function resizeImageMask(t,e,s,i,n,a){const r=n*a;let o;o=e<=8?new Uint8Array(r):e<=16?new Uint16Array(r):new Uint32Array(r);const l=s/n,c=i/a;let h,u,d,f,g=0;const p=new Uint16Array(n),m=s;for(h=0;h<n;h++)p[h]=Math.floor(h*l);for(h=0;h<a;h++)for(d=Math.floor(h*c)*m,u=0;u<n;u++)f=d+p[u],o[g++]=t[f];return o}var Xo=class _PDFImage{constructor({xref:t,res:e,image:s,isInline:i=!1,smask:n=null,mask:a=null,isMask:r=!1,pdfFunctionFactory:o,globalColorSpaceCache:l,localColorSpaceCache:c}){this.image=s;const h=s.dict,u=h.get("F","Filter");let d;if(u instanceof us)d=u.name;else if(Array.isArray(u)){const e=t.fetchIfRef(u[0]);e instanceof us&&(d=e.name)}switch(d){case"JPXDecode":({width:s.width,height:s.height,componentsCount:s.numComps,bitsPerComponent:s.bitsPerComponent}=xi.parseImageProperties(s.stream)),s.stream.reset();const t=ti.getReducePowerForJPX(s.width,s.height,s.numComps);if(this.jpxDecoderOptions={numComponents:0,isIndexedColormap:!1,smaskInData:h.has("SMaskInData"),reducePower:t},t){const e=2**t;s.width=Math.ceil(s.width/e),s.height=Math.ceil(s.height/e)}break;case"JBIG2Decode":s.bitsPerComponent=1,s.numComps=1}let f=h.get("W","Width"),g=h.get("H","Height");if(Number.isInteger(s.width)&&s.width>0&&Number.isInteger(s.height)&&s.height>0&&(s.width!==f||s.height!==g))warn$1("PDFImage - using the Width/Height of the image data, rather than the image dictionary."),f=s.width,g=s.height;else{const t="number"==typeof f&&f>0,e="number"==typeof g&&g>0;if(!t||!e){if(!s.fallbackDims)throw new Ze(`Invalid image width: ${f} or height: ${g}`);warn$1("PDFImage - using the Width/Height of the parent image, for SMask/Mask data."),t||(f=s.fallbackDims.width),e||(g=s.fallbackDims.height)}}this.width=f,this.height=g,this.interpolate=h.get("I","Interpolate"),this.imageMask=h.get("IM","ImageMask")||!1,this.matte=h.get("Matte")||!1;let p=s.bitsPerComponent;if(!p&&(p=h.get("BPC","BitsPerComponent"),!p)){if(!this.imageMask)throw new Ze(`Bits per component missing in image: ${this.imageMask}`);p=1}if(this.bpc=p,!this.imageMask){let n=h.getRaw("CS")||h.getRaw("ColorSpace");const a=!!n;if(a)this.jpxDecoderOptions?.smaskInData&&(n=us.get("DeviceRGBA"));else if(this.jpxDecoderOptions)n=us.get("DeviceRGBA");else switch(s.numComps){case 1:n=us.get("DeviceGray");break;case 3:n=us.get("DeviceRGB");break;case 4:n=us.get("DeviceCMYK");break;default:throw new Error(`Images with ${s.numComps} color components not supported.`)}this.colorSpace=ni.parse({cs:n,xref:t,resources:i?e:null,pdfFunctionFactory:o,globalColorSpaceCache:l,localColorSpaceCache:c}),this.numComps=this.colorSpace.numComps,this.jpxDecoderOptions&&(this.jpxDecoderOptions.numComponents=a?this.numComps:0,this.jpxDecoderOptions.isIndexedColormap="Indexed"===this.colorSpace.name)}if(this.decode=h.getArray("D","Decode"),this.needsDecode=!1,this.decode&&(this.colorSpace&&!this.colorSpace.isDefaultDecode(this.decode,p)||r&&!Ns.isDefaultDecode(this.decode,1))){this.needsDecode=!0;const t=(1<<p)-1;this.decodeCoefficients=[],this.decodeAddends=[];const e="Indexed"===this.colorSpace?.name;for(let s=0,i=0;s<this.decode.length;s+=2,++i){const n=this.decode[s],a=this.decode[s+1];this.decodeCoefficients[i]=e?(a-n)/t:a-n,this.decodeAddends[i]=e?n:t*n}}n?(n.fallbackDims??={width:f,height:g},this.smask=new _PDFImage({xref:t,res:e,image:n,isInline:i,pdfFunctionFactory:o,globalColorSpaceCache:l,localColorSpaceCache:c})):a&&(a instanceof bs?a.dict.get("IM","ImageMask")?(a.fallbackDims??={width:f,height:g},this.mask=new _PDFImage({xref:t,res:e,image:a,isInline:i,isMask:!0,pdfFunctionFactory:o,globalColorSpaceCache:l,localColorSpaceCache:c})):warn$1("Ignoring /Mask in image without /ImageMask."):this.mask=a)}static async buildImage({xref:t,res:e,image:s,isInline:i=!1,pdfFunctionFactory:n,globalColorSpaceCache:a,localColorSpaceCache:r}){const o=s;let l=null,c=null;const h=s.dict.get("SMask"),u=s.dict.get("Mask");return h?h instanceof bs?l=h:warn$1("Unsupported /SMask format."):u&&(u instanceof bs||Array.isArray(u)?c=u:warn$1("Unsupported /Mask format.")),new _PDFImage({xref:t,res:e,image:o,isInline:i,smask:l,mask:c,pdfFunctionFactory:n,globalColorSpaceCache:a,localColorSpaceCache:r})}static async createMask({image:t,isOffscreenCanvasSupported:e=!1}){const{dict:s}=t,i=s.get("W","Width"),n=s.get("H","Height"),a=s.get("I","Interpolate"),r=s.getArray("D","Decode"),o=r?.[0]>0,l=(i+7>>3)*n,c=t.getBytes(l),h=1===i&&1===n&&o===(0===c.length||!!(128&c[0]));if(h)return{isSingleOpaquePixel:h};if(e){if(ti.needsToBeResized(i,n)){const t=new Uint8ClampedArray(i*n*4);return convertBlackAndWhiteToRGBA$1({src:c,dest:t,width:i,height:n,nonBlackColor:0,inverseDecode:o}),ti.createImage({kind:C,data:t,width:i,height:n,interpolate:a})}const t=new OffscreenCanvas(i,n),e=t.getContext("2d"),s=e.createImageData(i,n);return convertBlackAndWhiteToRGBA$1({src:c,dest:s.data,width:i,height:n,nonBlackColor:0,inverseDecode:o}),e.putImageData(s,0,0),{data:null,width:i,height:n,interpolate:a,bitmap:t.transferToImageBitmap()}}const u=c.byteLength;let d;if(t instanceof si&&(!o||l===u)?d=c:o?(d=new Uint8Array(l),d.set(c),d.fill(255,u)):d=new Uint8Array(c),o)for(let t=0;t<u;t++)d[t]^=255;return{data:d,width:i,height:n,interpolate:a}}get drawWidth(){return Math.max(this.width,this.smask?.width||0,this.mask?.width||0)}get drawHeight(){return Math.max(this.height,this.smask?.height||0,this.mask?.height||0)}decodeBuffer(t){const e=this.bpc,s=this.numComps,i=this.decodeAddends,n=this.decodeCoefficients,a=(1<<e)-1;let r,o;if(1===e){for(r=0,o=t.length;r<o;r++)t[r]=+!t[r];return}let l=0;for(r=0,o=this.width*this.height;r<o;r++)for(let e=0;e<s;e++)t[l]=MathClamp$1(i[e]+t[l]*n[e],0,a),l++}getComponents(t){const e=this.bpc;if(8===e)return t;const s=this.width,i=this.height,n=this.numComps,a=s*i*n;let r,o=0;r=e<=8?new Uint8Array(a):e<=16?new Uint16Array(a):new Uint32Array(a);const l=s*n,c=(1<<e)-1;let h,u,d=0;if(1===e){let e,s,n;for(let a=0;a<i;a++){for(s=d+(-8&l),n=d+l;d<s;)u=t[o++],r[d]=u>>7&1,r[d+1]=u>>6&1,r[d+2]=u>>5&1,r[d+3]=u>>4&1,r[d+4]=u>>3&1,r[d+5]=u>>2&1,r[d+6]=u>>1&1,r[d+7]=1&u,d+=8;if(d<n)for(u=t[o++],e=128;d<n;)r[d++]=+!!(u&e),e>>=1}}else{let s=0;for(u=0,d=0,h=a;d<h;++d){for(d%l===0&&(u=0,s=0);s<e;)u=u<<8|t[o++],s+=8;const i=s-e;let n=u>>i;n<0?n=0:n>c&&(n=c),r[d]=n,u&=(1<<i)-1,s=i}}return r}async fillOpacity(t,e,s,i,n){const a=this.smask,r=this.mask;let o,l,c,h,u,d;if(a)l=a.width,c=a.height,o=new Uint8ClampedArray(l*c),await a.fillGrayBuffer(o),l===e&&c===s||(o=resizeImageMask(o,a.bpc,l,c,e,s));else if(r)if(r instanceof _PDFImage){for(l=r.width,c=r.height,o=new Uint8ClampedArray(l*c),r.numComps=1,await r.fillGrayBuffer(o),h=0,u=l*c;h<u;++h)o[h]=255-o[h];l===e&&c===s||(o=resizeImageMask(o,r.bpc,l,c,e,s))}else{if(!Array.isArray(r))throw new Ze("Unknown mask format.");{o=new Uint8ClampedArray(e*s);const t=this.numComps;for(h=0,u=e*s;h<u;++h){let e=0;const s=h*t;for(d=0;d<t;++d){const t=n[s+d],i=2*d;if(t<r[i]||t>r[i+1]){e=255;break}}o[h]=e}}}if(o)for(h=0,d=3,u=e*i;h<u;++h,d+=4)t[d]=o[h];else for(h=0,d=3,u=e*i;h<u;++h,d+=4)t[d]=255}undoPreblend(t,e,s){const i=this.smask?.matte;if(!i)return;const n=this.colorSpace.getRgb(i,0),a=n[0],r=n[1],o=n[2],l=e*s*4;for(let e=0;e<l;e+=4){const s=t[e+3];if(0===s){t[e]=255,t[e+1]=255,t[e+2]=255;continue}const i=255/s;t[e]=(t[e]-a)*i+a,t[e+1]=(t[e+1]-r)*i+r,t[e+2]=(t[e+2]-o)*i+o}}async createImageData(t=!1,e=!1){const s=this.drawWidth,i=this.drawHeight,n={width:s,height:i,interpolate:this.interpolate,kind:0,data:null},a=this.numComps,r=this.width,o=this.height,l=this.bpc,c=r*a*l+7>>3,h=e&&ti.needsToBeResized(s,i);if(!this.smask&&!this.mask&&"DeviceRGBA"===this.colorSpace.name){n.kind=C;const t=n.data=await this.getImageBytes(o*r*4,{});return e?h?ti.createImage(n,!1):this.createBitmap(C,s,i,t):n}if(!t){let t;if("DeviceGray"===this.colorSpace.name&&1===l?t=k:"DeviceRGB"!==this.colorSpace.name||8!==l||this.needsDecode||(t=S),t&&!this.smask&&!this.mask&&s===r&&i===o){const a=await this.#st(r,o);if(a)return a;const l=await this.getImageBytes(o*c,{});if(e)return h?ti.createImage({data:l,kind:t,width:s,height:i,interpolate:this.interpolate},this.needsDecode):this.createBitmap(t,r,o,l);if(n.kind=t,n.data=l,this.needsDecode){assert$1(t===k,"PDFImage.createImageData: The image must be grayscale.");const e=n.data;for(let t=0,s=e.length;t<s;t++)e[t]^=255}return n}if(this.image instanceof wi&&!this.smask&&!this.mask&&!this.needsDecode){let t=o*c;if(e&&!h){let e=!1;switch(this.colorSpace.name){case"DeviceGray":t*=4,e=!0;break;case"DeviceRGB":t=t/3*4,e=!0;break;case"DeviceCMYK":e=!0}if(e){const e=await this.#st(s,i);if(e)return e;const n=await this.getImageBytes(t,{drawWidth:s,drawHeight:i,forceRGBA:!0});return this.createBitmap(C,s,i,n)}}else switch(this.colorSpace.name){case"DeviceGray":t*=3;case"DeviceRGB":case"DeviceCMYK":return n.kind=S,n.data=await this.getImageBytes(t,{drawWidth:s,drawHeight:i,forceRGB:!0}),h?ti.createImage(n):n}}}const u=await this.getImageBytes(o*c,{internal:!0}),d=0|u.length/c*i/o,f=this.getComponents(u);let g,p,m,b,w,y;return e&&!h&&(m=new OffscreenCanvas(s,i),b=m.getContext("2d"),w=b.createImageData(s,i),y=w.data),n.kind=C,t||this.smask||this.mask?(e&&!h||(y=new Uint8ClampedArray(s*i*4)),g=1,p=!0,await this.fillOpacity(y,s,i,d,f)):(!e||h?(n.kind=S,y=new Uint8ClampedArray(s*i*3),g=0):(new Uint32Array(y.buffer).fill(ts.isLittleEndian?4278190080:255),g=1),p=!1),this.needsDecode&&this.decodeBuffer(f),this.colorSpace.fillRgb(y,r,o,s,i,d,l,f,g),p&&this.undoPreblend(y,s,d),e&&!h?(b.putImageData(w,0,0),{data:null,width:s,height:i,bitmap:m.transferToImageBitmap(),interpolate:this.interpolate}):(n.data=y,h?ti.createImage(n):n)}async fillGrayBuffer(t){const e=this.numComps;if(1!==e)throw new Ze(`Reading gray scale from a color image: ${e}`);const s=this.width,i=this.height,n=this.bpc,a=s*e*n+7>>3,r=await this.getImageBytes(i*a,{internal:!0}),o=this.getComponents(r);let l,c;if(1===n){if(c=s*i,this.needsDecode)for(l=0;l<c;++l)t[l]=o[l]-1&255;else for(l=0;l<c;++l)t[l]=255&-o[l];return}this.needsDecode&&this.decodeBuffer(o),c=s*i;const h=255/((1<<n)-1);for(l=0;l<c;++l)t[l]=h*o[l]}createBitmap(t,e,s,i){const n=new OffscreenCanvas(e,s),a=n.getContext("2d");let r;return t===C?r=new ImageData(i,e,s):(r=a.createImageData(e,s),convertToRGBA({kind:t,src:i,dest:new Uint32Array(r.data.buffer),width:e,height:s,inverseDecode:this.needsDecode})),a.putImageData(r,0,0),{data:null,width:e,height:s,bitmap:n.transferToImageBitmap(),interpolate:this.interpolate}}async#st(t,e){const s=await this.image.getTransferableImage();return s?{data:null,width:t,height:e,bitmap:s,interpolate:this.interpolate}:null}async getImageBytes(t,{drawWidth:e,drawHeight:s,forceRGBA:i=!1,forceRGB:n=!1,internal:a=!1}){this.image.reset(),this.image.drawWidth=e||this.width,this.image.drawHeight=s||this.height,this.image.forceRGBA=!!i,this.image.forceRGB=!!n;const r=await this.image.getImageData(t,this.jpxDecoderOptions);return a||this.image instanceof si?r:(assert$1(r instanceof Uint8Array,'PDFImage.getImageBytes: Unsupported "imageBytes" type.'),new Uint8Array(r))}},Ko=Object.freeze({maxImageSize:-1,disableFontFace:!1,ignoreErrors:!1,isEvalSupported:!0,isOffscreenCanvasSupported:!1,isImageDecoderSupported:!1,canvasMaxAreaInBytes:-1,fontExtraProperties:!1,useSystemFonts:!0,useWasm:!0,useWorkerFetch:!0,cMapUrl:null,iccUrl:null,standardFontDataUrl:null,wasmUrl:null}),Yo=1,Jo=2,Zo=Promise.resolve();function normalizeBlendMode(t,e=!1){if(Array.isArray(t)){for(const e of t){const t=normalizeBlendMode(e,!0);if(t)return t}return warn$1(`Unsupported blend mode Array: ${t}`),"source-over"}if(!(t instanceof us))return e?null:"source-over";switch(t.name){case"Normal":case"Compatible":return"source-over";case"Multiply":return"multiply";case"Screen":return"screen";case"Overlay":return"overlay";case"Darken":return"darken";case"Lighten":return"lighten";case"ColorDodge":return"color-dodge";case"ColorBurn":return"color-burn";case"HardLight":return"hard-light";case"SoftLight":return"soft-light";case"Difference":return"difference";case"Exclusion":return"exclusion";case"Hue":return"hue";case"Saturation":return"saturation";case"Color":return"color";case"Luminosity":return"luminosity"}return e?null:(warn$1(`Unsupported blend mode: ${t.name}`),"source-over")}function addCachedImageOps(t,{objId:e,fn:s,args:i,optionalContent:n,hasMask:a}){e&&t.addDependency(e),t.addImageOps(s,i,n,a),s===Te&&i[0]?.count>0&&i[0].count++}var Qo=class _TimeSlotManager{static TIME_SLOT_DURATION_MS=20;static CHECK_TIME_EVERY=100;constructor(){this.reset()}check(){return!(++this.checked<_TimeSlotManager.CHECK_TIME_EVERY)&&(this.checked=0,this.endTime<=Date.now())}reset(){this.endTime=Date.now()+_TimeSlotManager.TIME_SLOT_DURATION_MS,this.checked=0}},tl=class _PartialEvaluator{constructor({xref:t,handler:e,pageIndex:s,idFactory:i,fontCache:n,builtInCMapCache:a,standardFontDataCache:r,globalColorSpaceCache:o,globalImageCache:l,systemFontCache:c,options:h=null}){this.xref=t,this.handler=e,this.pageIndex=s,this.idFactory=i,this.fontCache=n,this.builtInCMapCache=a,this.standardFontDataCache=r,this.globalColorSpaceCache=o,this.globalImageCache=l,this.systemFontCache=c,this.options=h||Ko,this.type3FontRefs=null,this._regionalImageCache=new po,this._fetchBuiltInCMapBound=this.fetchBuiltInCMap.bind(this)}get _pdfFunctionFactory(){return shadow$1(this,"_pdfFunctionFactory",new wo({xref:this.xref,isEvalSupported:this.options.isEvalSupported}))}get parsingType3Font(){return!!this.type3FontRefs}clone(t=null){const e=Object.create(this);return e.options=Object.assign(Object.create(null),this.options,t),e}hasBlendModes(t,e){if(!(t instanceof fs))return!1;if(t.objId&&e.has(t.objId))return!1;const s=new ps(e);t.objId&&s.put(t.objId);const i=[t],n=this.xref;for(;i.length;){const t=i.shift(),e=t.get("ExtGState");if(e instanceof fs)for(let t of e.getRawValues()){if(t instanceof gs){if(s.has(t))continue;try{t=n.fetch(t)}catch(e){s.put(t),info$1(`hasBlendModes - ignoring ExtGState: "${e}".`);continue}}if(!(t instanceof fs))continue;t.objId&&s.put(t.objId);const e=t.get("BM");if(e instanceof us){if("Normal"!==e.name)return!0}else if(void 0!==e&&Array.isArray(e))for(const t of e)if(t instanceof us&&"Normal"!==t.name)return!0}const a=t.get("XObject");if(a instanceof fs)for(let t of a.getRawValues()){if(t instanceof gs){if(s.has(t))continue;try{t=n.fetch(t)}catch(e){s.put(t),info$1(`hasBlendModes - ignoring XObject: "${e}".`);continue}}if(!(t instanceof bs))continue;t.dict.objId&&s.put(t.dict.objId);const e=t.dict.get("Resources");e instanceof fs&&(e.objId&&s.has(e.objId)||(i.push(e),e.objId&&s.put(e.objId)))}}for(const t of s)e.put(t);return!1}async fetchBuiltInCMap(t){const e=this.builtInCMapCache.get(t);if(e)return e;let s;return s=this.options.useWorkerFetch?{cMapData:await fetchBinaryData(`${this.options.cMapUrl}${t}.bcmap`),isCompressed:!0}:await this.handler.sendWithPromise("FetchBinaryData",{type:"cMapReaderFactory",name:t}),this.builtInCMapCache.set(t,s),s}async fetchStandardFontData(t){const e=this.standardFontDataCache.get(t);if(e)return new Ks(e);if(this.options.useSystemFonts&&"Symbol"!==t&&"ZapfDingbats"!==t)return null;const s=fa()[t];let i;try{i=this.options.useWorkerFetch?await fetchBinaryData(`${this.options.standardFontDataUrl}${s}`):await this.handler.sendWithPromise("FetchBinaryData",{type:"standardFontDataFactory",filename:s})}catch(t){return warn$1(t),null}return this.standardFontDataCache.set(t,i),new Ks(i)}async buildFormXObject(t,e,s,i,n,a,r,o){const{dict:l}=e,c=lookupMatrix(l.getArray("Matrix"),null),h=lookupNormalRect(l.getArray("BBox"),null);let u,d;l.has("OC")&&(u=await this.parseMarkedContentProps(l.get("OC"),t)),void 0!==u&&i.addOp(we,["OC",u]);const f=l.get("Group");if(f){d={matrix:c,bbox:h,smask:s,isolated:!1,knockout:!1};let e=null;if(isName(f.get("S"),"Transparency")&&(d.isolated=f.get("I")||!1,d.knockout=f.get("K")||!1,f.has("CS"))){const s=this._getColorSpace(f.getRaw("CS"),t,r);e=s instanceof Ns?s:await this._handleColorSpace(s)}s?.backdrop&&(e||=ni.rgb,s.backdrop=e.getRgbHex(s.backdrop,0)),i.addOp(Se,[d])}const g=[c&&new Float32Array(c),!f&&h&&new Float32Array(h)||null];i.addOp(Ae,g);const p=l.get("Resources");await this.getOperatorList({stream:e,task:n,resources:p instanceof fs?p:t,operatorList:i,initialState:a,prevRefs:o}),i.addOp(ke,[]),f&&i.addOp(Ce,[d]),void 0!==u&&i.addOp(ye,[])}_sendImgData(t,e,s=!1){const i=e?[e.bitmap||e.data.buffer]:null;return this.parsingType3Font||s?this.handler.send("commonobj",[t,"Image",e],i):this.handler.send("obj",[t,this.pageIndex,"Image",e],i)}async buildPaintImageXObject({resources:t,image:e,isInline:s=!1,operatorList:i,cacheKey:n,localImageCache:a,localColorSpaceCache:r}){const{maxImageSize:o,ignoreErrors:l,isOffscreenCanvasSupported:c}=this.options,{dict:h}=e,u=h.objId,d=h.get("W","Width"),f=h.get("H","Height");if(!d||"number"!=typeof d||!f||"number"!=typeof f)return void warn$1("Image dimensions are missing, or not numbers.");if(-1!==o&&d*f>o){const t="Image exceeded maximum allowed size and was removed.";if(!l)throw new Error(t);return void warn$1(t)}let g,p,m,b;if(h.has("OC")&&(g=await this.parseMarkedContentProps(h.get("OC"),t)),h.get("IM","ImageMask")){if(p=await Xo.createMask({image:e,isOffscreenCanvasSupported:c&&!this.parsingType3Font}),p.isSingleOpaquePixel){if(m=Pe,b=[],i.addImageOps(m,b,g),n){const t={fn:m,args:b,optionalContent:g};a.set(n,u,t),u&&this._regionalImageCache.set(null,u,t)}return}if(this.parsingType3Font)return b=function({data:t,width:e,height:s}){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,a=new Uint8Array(n*(s+1));let r,o,l;const c=e+7&-8,h=new Uint8Array(c*s);let u=0;for(const e of t){let t=128;for(;t>0;)h[u++]=e&t?0:255,t>>=1}let d=0;for(u=0,0!==h[u]&&(a[0]=1,++d),o=1;o<e;o++)h[u]!==h[u+1]&&(a[o]=h[u]?2:1,++d),u++;for(0!==h[u]&&(a[o]=2,++d),r=1;r<s;r++){u=r*c,l=r*n,h[u-c]!==h[u]&&(a[l]=h[u]?1:8,++d);let t=(h[u]?4:0)+(h[u-c]?8:0);for(o=1;o<e;o++)t=(t>>2)+(h[u+1]?4:0)+(h[u-c+1]?8:0),i[t]&&(a[l+o]=i[t],++d),u++;if(h[u-c]!==h[u]&&(a[l+o]=h[u]?2:4,++d),d>1e3)return null}for(u=c*(s-1),l=r*n,0!==h[u]&&(a[l]=8,++d),o=1;o<e;o++)h[u]!==h[u+1]&&(a[l+o]=h[u]?4:8,++d),u++;if(0!==h[u]&&(a[l+o]=4,++d),d>1e3)return null;const f=new Int32Array([0,n,-1,0,-n,0,0,0,1]),g=[],{a:p,b:m,c:b,d:w,e:y,f:x}=(new DOMMatrix).scaleSelf(1/e,-1/s).translateSelf(0,-s);for(r=0;d&&r<=s;r++){let t=r*n;const s=t+e;for(;t<s&&!a[t];)t++;if(t===s)continue;let i=t%n,o=r;g.push($e,p*i+b*o+y,m*i+w*o+x);const l=t;let c=a[t];do{const e=f[c];do{t+=e}while(!a[t]);const s=a[t];5!==s&&10!==s?(c=s,a[t]=0):(c=s&51*c>>4,a[t]&=c>>2|c<<2),i=t%n,o=t/n|0,g.push(He,p*i+b*o+y,m*i+w*o+x),a[t]||--d}while(l!==t);--r}return[Ue,[new Float32Array(g)],new Float32Array([0,0,e,s])]}(p),b?void i.addImageOps(Ne,b,g):(warn$1("Cannot compile Type3 glyph."),void i.addImageOps(Te,[p],g));const t=`mask_${this.idFactory.createObjId()}`;if(i.addDependency(t),p.dataLen=p.bitmap?p.width*p.height*4:p.data.length,this._sendImgData(t,p),m=Te,b=[{data:t,width:p.width,height:p.height,interpolate:p.interpolate,count:1}],i.addImageOps(m,b,g),n){const e={objId:t,fn:m,args:b,optionalContent:g};a.set(n,u,e),u&&this._regionalImageCache.set(null,u,e)}return}const w=h.has("SMask")||h.has("Mask");if(s&&d+f<200&&!w){try{const n=new Xo({xref:this.xref,res:t,image:e,isInline:s,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:r});p=await n.createImageData(!0,!1),i.addImageOps(Fe,[p],g)}catch(t){const e=`Unable to decode inline image: "${t}".`;if(!l)throw new Error(e);warn$1(e)}return}let y=`img_${this.idFactory.createObjId()}`,x=!1,v=null;if(this.parsingType3Font?y=`${this.idFactory.getDocId()}_type3_${y}`:n&&u&&(x=this.globalImageCache.shouldCache(u,this.pageIndex),x&&(assert$1(!s,"Cannot cache an inline image globally."),y=`${this.idFactory.getDocId()}_${y}`)),i.addDependency(y),m=Ee,b=[y,d,f],i.addImageOps(m,b,g,w),x){if(v={objId:y,fn:m,args:b,optionalContent:g,hasMask:w,byteSize:0},this.globalImageCache.hasDecodeFailed(u))return this.globalImageCache.setData(u,v),void this._sendImgData(y,null,x);if(d*f>25e4||w){const t=await this.handler.sendWithPromise("commonobj",[y,"CopyLocalImage",{imageRef:u}]);if(t)return this.globalImageCache.setData(u,v),void this.globalImageCache.addByteSize(u,t)}}if(Xo.buildImage({xref:this.xref,res:t,image:e,isInline:s,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:r}).then(async t=>(p=await t.createImageData(!1,c),p.dataLen=p.bitmap?p.width*p.height*4:p.data.length,p.ref=u,x&&this.globalImageCache.addByteSize(u,p.dataLen),this._sendImgData(y,p,x))).catch(t=>(warn$1(`Unable to decode image "${y}": "${t}".`),u&&this.globalImageCache.addDecodeFailed(u),this._sendImgData(y,null,x))),n){const t={objId:y,fn:m,args:b,optionalContent:g,hasMask:w};a.set(n,u,t),u&&(this._regionalImageCache.set(null,u,t),x&&(assert$1(v,"The global cache-data must be available."),this.globalImageCache.setData(u,v)))}}handleSMask(t,e,s,i,n,a,r){const o=t.get("G"),l={subtype:t.get("S").name,backdrop:t.get("BC")},c=t.get("TR");if(isPDFFunction(c)){const t=this._pdfFunctionFactory.create(c),e=new Uint8Array(256),s=new Float32Array(1);for(let i=0;i<256;i++)s[0]=i/255,t(s,0,s,0),e[i]=255*s[0]|0;l.transferMap=e}return this.buildFormXObject(e,o,l,s,i,n.state.clone({newPath:!0}),a,r)}handleTransferFunction(t){let e;if(Array.isArray(t))e=t;else{if(!isPDFFunction(t))return null;e=[t]}const s=[];let i=0,n=0;for(const t of e){const e=this.xref.fetchIfRef(t);if(i++,isName(e,"Identity")){s.push(null);continue}if(!isPDFFunction(e))return null;const a=this._pdfFunctionFactory.create(e),r=new Uint8Array(256),o=new Float32Array(1);for(let t=0;t<256;t++)o[0]=t/255,a(o,0,o,0),r[t]=255*o[0]|0;s.push(r),n++}return 1!==i&&4!==i||0===n?null:s}handleTilingType(t,e,s,i,n,a,r,o){const l=new Si,c=fs.merge({xref:this.xref,dictArray:[n.get("Resources"),s]});return this.getOperatorList({stream:i,task:r,resources:c,operatorList:l}).then(function(){const s=l.getIR(),i=getTilingPatternIR(s,n,e);a.addDependencies(l.dependencies),a.addOp(t,i),n.objId&&o.set(null,n.objId,{operatorListIR:s,dict:n})}).catch(t=>{if(!(t instanceof Qe)){if(!this.options.ignoreErrors)throw t;warn$1(`handleTilingType - ignoring pattern: "${t}".`)}})}async handleSetFont(t,e,s,i,n,a,r=null,o=null){const l=e?.[0]instanceof us?e[0].name:null,c=await this.loadFont(l,s,t,n,r,o);return c.font.isType3Font&&i.addDependencies(c.type3Dependencies),a.font=c.font,c.send(this.handler),c.loadedName}handleText(t,e){const s=e.font,i=s.charsToGlyphs(t);return s.data&&(e.textRenderingMode&A||"Pattern"===e.fillColorSpace.name||s.disableFontFace)&&_PartialEvaluator.buildFontPaths(s,i,this.handler,this.options),i}ensureStateFont(t){if(t.font)return;const e=new Ze("Missing setFont (Tf) operator before text rendering operator.");if(!this.options.ignoreErrors)throw e;warn$1(`ensureStateFont: "${e}".`)}async setGState({resources:t,gState:e,operatorList:s,cacheKey:i,task:n,stateManager:a,localGStateCache:r,localColorSpaceCache:o,seenRefs:l}){const c=e.objId;let h=!0;const u=[];let d=Promise.resolve();for(const[i,r]of e)switch(i){case"Type":break;case"LW":if("number"!=typeof r){warn$1(`Invalid LW (line width): ${r}`);break}u.push([i,Math.abs(r)]);break;case"LC":case"LJ":case"ML":case"D":case"RI":case"FL":case"CA":case"ca":u.push([i,r]);break;case"Font":h=!1,d=d.then(()=>this.handleSetFont(t,null,r[0],s,n,a.state).then(function(t){s.addDependency(t),u.push([i,[t,r[1]]])}));break;case"BM":u.push([i,normalizeBlendMode(r)]);break;case"SMask":if(isName(r,"None")){u.push([i,!1]);break}r instanceof fs?(h=!1,d=d.then(()=>this.handleSMask(r,t,s,n,a,o,l)),u.push([i,!0])):warn$1("Unsupported SMask type");break;case"TR":const e=this.handleTransferFunction(r);u.push([i,e]);break;case"OP":case"op":case"OPM":case"BG":case"BG2":case"UCR":case"UCR2":case"TR2":case"HT":case"SM":case"SA":case"AIS":case"TK":info$1("graphic state operator "+i);break;default:info$1("Unknown graphic state operator "+i)}await d,u.length>0&&s.addOp(ut,[u]),h&&r.set(i,c,u)}loadFont(t,e,s,i,n=null,a=null){const errorFont=async()=>new el({loadedName:"g_font_error",font:new ir(`Font "${t}" is not available.`),dict:e});let r;if(e)e instanceof gs&&(r=e);else{const e=s.get("Font");e&&(r=e.getRaw(t))}if(r){if(this.type3FontRefs?.has(r))return errorFont();if(this.fontCache.has(r))return this.fontCache.get(r);try{e=this.xref.fetchIfRef(r)}catch(t){warn$1(`loadFont - lookup failed: "${t}".`)}}if(!(e instanceof fs)){if(!this.options.ignoreErrors&&!this.parsingType3Font)return warn$1(`Font "${t}" is not available.`),errorFont();warn$1(`Font "${t}" is not available -- attempting to fallback to a default font.`),e=n||_PartialEvaluator.fallbackFontDict}if(e.cacheKey&&this.fontCache.has(e.cacheKey))return this.fontCache.get(e.cacheKey);const{promise:o,resolve:l}=Promise.withResolvers();let c;try{c=this.preEvaluateFont(e),c.cssFontInfo=a}catch(t){return warn$1(`loadFont - preEvaluateFont failed: "${t}".`),errorFont()}const{descriptor:h,hash:u}=c,d=r instanceof gs;let f;if(u&&h instanceof fs){const t=h.fontAliases||=Object.create(null);if(t[u]){const e=t[u].aliasRef;if(d&&e&&this.fontCache.has(e))return this.fontCache.putAlias(r,e),this.fontCache.get(r)}else t[u]={fontID:this.idFactory.createFontId()};d&&(t[u].aliasRef=r),f=t[u].fontID}else f=this.idFactory.createFontId();return assert$1(f?.startsWith("f"),'The "fontID" must be (correctly) defined.'),d?this.fontCache.put(r,o):(e.cacheKey=`cacheKey_${f}`,this.fontCache.put(e.cacheKey,o)),e.loadedName=`${this.idFactory.getDocId()}_${f}`,this.translateFont(c).then(async t=>{const n=new el({loadedName:e.loadedName,font:t,dict:e});if(t.isType3Font)try{await n.loadType3Data(this,s,i)}catch(t){throw new Error(`Type3 font load error: ${t}`)}l(n)}).catch(t=>{warn$1(`loadFont - translateFont failed: "${t}".`),l(new el({loadedName:e.loadedName,font:new ir(t?.message),dict:e}))}),o}buildPath(t,e,s){const{pathMinMax:i,pathBuffer:n}=s;switch(0|t){case vt:{const t=s.currentPointX=e[0],a=s.currentPointY=e[1],r=e[2],o=e[3],l=t+r,c=a+o;0===r||0===o?n.push($e,t,a,He,l,c,qe):n.push($e,t,a,He,l,a,He,l,c,He,t,c,qe),ss.rectBoundingBox(t,a,l,c,i);break}case pt:{const t=s.currentPointX=e[0],a=s.currentPointY=e[1];n.push($e,t,a),ss.pointBoundingBox(t,a,i);break}case mt:{const t=s.currentPointX=e[0],a=s.currentPointY=e[1];n.push(He,t,a),ss.pointBoundingBox(t,a,i);break}case bt:{const t=s.currentPointX,a=s.currentPointY,[r,o,l,c,h,u]=e;s.currentPointX=h,s.currentPointY=u,n.push(je,r,o,l,c,h,u),ss.bezierBoundingBox(t,a,r,o,l,c,h,u,i);break}case wt:{const t=s.currentPointX,a=s.currentPointY,[r,o,l,c]=e;s.currentPointX=l,s.currentPointY=c,n.push(je,t,a,r,o,l,c),ss.bezierBoundingBox(t,a,t,a,r,o,l,c,i);break}case yt:{const t=s.currentPointX,a=s.currentPointY,[r,o,l,c]=e;s.currentPointX=l,s.currentPointY=c,n.push(je,r,o,l,c,l,c),ss.bezierBoundingBox(t,a,r,o,l,c,l,c,i);break}case xt:n.push(qe)}}_getColorSpace(t,e,s){return ni.parse({cs:t,xref:this.xref,resources:e,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:s,asyncIfNotCached:!0})}async _handleColorSpace(t){try{return await t}catch(t){if(t instanceof Qe)return null;if(this.options.ignoreErrors)return warn$1(`_handleColorSpace - ignoring ColorSpace: "${t}".`),null;throw t}}parseShading({shading:t,resources:e,localColorSpaceCache:s,localShadingPatternCache:i}){let n,a=i.get(t);if(a)return a;try{n=hr.parseShading(t,this.xref,e,this._pdfFunctionFactory,this.globalColorSpaceCache,s).getIR()}catch(e){if(e instanceof Qe)return null;if(this.options.ignoreErrors)return warn$1(`parseShading - ignoring shading: "${e}".`),i.set(t,null),null;throw e}return a=`pattern_${this.idFactory.createObjId()}`,this.parsingType3Font&&(a=`${this.idFactory.getDocId()}_type3_${a}`),i.set(t,a),this.parsingType3Font?this.handler.send("commonobj",[a,"Pattern",n]):this.handler.send("obj",[a,this.pageIndex,"Pattern",n]),a}handleColorN(t,e,s,i,n,a,r,o,l,c){const h=s.pop();if(h instanceof us){const u=n.getRaw(h.name),d=u instanceof gs&&l.getByRef(u);if(d)try{const n=i.base?i.base.getRgbHex(s,0):null,a=getTilingPatternIR(d.operatorListIR,d.dict,n);return void t.addOp(e,a)}catch{}const f=this.xref.fetchIfRef(u);if(f){const n=f instanceof bs?f.dict:f,h=n.get("PatternType");if(h===Yo){const o=i.base?i.base.getRgbHex(s,0):null;return this.handleTilingType(e,o,a,f,n,t,r,l)}if(h===Jo){const s=n.get("Shading"),i=this.parseShading({shading:s,resources:a,localColorSpaceCache:o,localShadingPatternCache:c});if(i){const s=lookupMatrix(n.getArray("Matrix"),null);t.addOp(e,["Shading",i,s])}return}throw new Ze(`Unknown PatternType: ${h}`)}}throw new Ze(`Unknown PatternName: ${h}`)}_parseVisibilityExpression(t,e,s){if(++e>10)return void warn$1("Visibility expression is too deeply nested");const i=t.length,n=this.xref.fetchIfRef(t[0]);if(!(i<2)&&n instanceof us){switch(n.name){case"And":case"Or":case"Not":s.push(n.name);break;default:return void warn$1(`Invalid operator ${n.name} in visibility expression`)}for(let n=1;n<i;n++){const i=t[n],a=this.xref.fetchIfRef(i);if(Array.isArray(a)){const t=[];s.push(t),this._parseVisibilityExpression(a,e,t)}else i instanceof gs&&s.push(i.toString())}}else warn$1("Invalid visibility expression")}async parseMarkedContentProps(t,e){let s;if(t instanceof us)s=e.get("Properties").get(t.name);else{if(!(t instanceof fs))throw new Ze("Optional content properties malformed.");s=t}const i=s.get("Type")?.name;if("OCG"===i)return{type:i,id:s.objId};if("OCMD"===i){const t=s.get("VE");if(Array.isArray(t)){const e=[];if(this._parseVisibilityExpression(t,0,e),e.length>0)return{type:"OCMD",expression:e}}const e=s.get("OCGs");if(Array.isArray(e)||e instanceof fs){const t=[];if(Array.isArray(e))for(const s of e)t.push(s.toString());else t.push(e.objId);return{type:i,ids:t,policy:s.get("P")instanceof us?s.get("P").name:null,expression:null}}if(e instanceof gs)return{type:i,id:e.toString()}}return null}getOperatorList({stream:t,task:e,resources:s,operatorList:i,initialState:n=null,fallbackFontDict:a=null,prevRefs:r=null}){const o=t.dict?.objId,l=new ps(r);if(o){if(r?.has(o))throw new Error(`getOperatorList - ignoring circular reference: ${o}`);l.put(o)}if(s||=fs.empty,n||=new nl,!i)throw new Error('getOperatorList: missing "operatorList" parameter');const c=this,h=this.xref,u=new co,d=new ho,f=new fo,g=new go,p=new Map,m=s.get("XObject")||fs.empty,b=s.get("Pattern")||fs.empty,w=new sl(n),y=new al(t,h,w),x=new Qo;function closePendingRestoreOPS(t){for(let t=0,e=y.savedStatesDepth;t<e;t++)i.addOp(ft,[])}return new Promise(function promiseBody(t,n){const next=function(e){Promise.all([e,i.ready]).then(function(){try{promiseBody(t,n)}catch(t){n(t)}},n)};e.ensureNotTerminated(),x.reset();const r={};let o,v,A,k,S,C;for(;!(o=x.check())&&(r.args=null,y.read(r));){let t=r.args,n=r.fn;switch(0|n){case ge:if(C=t[0]instanceof us,S=t[0].name,C){const e=u.getByName(S);if(e){addCachedImageOps(i,e),t=null;continue}}return void next(new Promise(function(t,n){if(!C)throw new Ze("XObject must be referred to by name.");let a=m.getRaw(S);if(a instanceof gs){const e=u.getByRef(a)||c._regionalImageCache.getByRef(a)||c.globalImageCache.getData(a,c.pageIndex);if(e)return addCachedImageOps(i,e),void t();a=h.fetch(a)}if(!(a instanceof bs))throw new Ze("XObject should be a stream");const r=a.dict.get("Subtype");if(!(r instanceof us))throw new Ze("XObject should have a Name subtype");if("Form"===r.name)return w.save(),void c.buildFormXObject(s,a,null,i,e,w.state.clone({newPath:!0}),d,l).then(function(){w.restore(),t()},n);if("Image"!==r.name){if("PS"!==r.name)throw new Ze(`Unhandled XObject subtype ${r.name}`);info$1("Ignored XObject subtype PS"),t()}else c.buildPaintImageXObject({resources:s,image:a,operatorList:i,cacheKey:S,localImageCache:u,localColorSpaceCache:d}).then(t,n)}).catch(function(t){if(!(t instanceof Qe)){if(!c.options.ignoreErrors)throw t;warn$1(`getOperatorList - ignoring XObject: "${t}".`)}}));case Ut:const r=t[1];return void next(c.handleSetFont(s,t,null,i,e,w.state,a).then(function(t){i.addDependency(t),i.addOp(Ut,[t,r])}));case fe:const o=t[0].cacheKey;if(o){const e=u.getByName(o);if(e){addCachedImageOps(i,e),t=null;continue}}return void next(c.buildPaintImageXObject({resources:s,image:t[0],isInline:!0,operatorList:i,cacheKey:o,localImageCache:u,localColorSpaceCache:d}));case Wt:if(!w.state.font){c.ensureStateFont(w.state);continue}t[0]=c.handleText(t[0],w.state);break;case Vt:if(!w.state.font){c.ensureStateFont(w.state);continue}const y=[],x=w.state;for(const e of t[0])"string"==typeof e?y.push(...c.handleText(e,x)):"number"==typeof e&&y.push(e);t[0]=y,n=Wt;break;case Xt:if(!w.state.font){c.ensureStateFont(w.state);continue}i.addOp(Gt),t[0]=c.handleText(t[0],w.state),n=Wt;break;case Kt:if(!w.state.font){c.ensureStateFont(w.state);continue}i.addOp(Gt),i.addOp(Nt,[t.shift()]),i.addOp(Pt,[t.shift()]),t[0]=c.handleText(t[0],w.state),n=Wt;break;case $t:w.state.textRenderingMode=t[0];break;case Qt:{const e=c._getColorSpace(t[0],s,d);if(e instanceof Ns){w.state.fillColorSpace=e;continue}return void next(c._handleColorSpace(e).then(t=>{w.state.fillColorSpace=t||ni.gray}))}case Zt:{const e=c._getColorSpace(t[0],s,d);if(e instanceof Ns){w.state.strokeColorSpace=e;continue}return void next(c._handleColorSpace(e).then(t=>{w.state.strokeColorSpace=t||ni.gray}))}case se:k=w.state.fillColorSpace,t=[k.getRgbHex(t,0)],n=oe;break;case te:k=w.state.strokeColorSpace,t=[k.getRgbHex(t,0)],n=re;break;case ae:w.state.fillColorSpace=ni.gray,t=[ni.gray.getRgbHex(t,0)],n=oe;break;case ne:w.state.strokeColorSpace=ni.gray,t=[ni.gray.getRgbHex(t,0)],n=re;break;case ce:w.state.fillColorSpace=ni.cmyk,t=[ni.cmyk.getRgbHex(t,0)],n=oe;break;case le:w.state.strokeColorSpace=ni.cmyk,t=[ni.cmyk.getRgbHex(t,0)],n=re;break;case oe:w.state.fillColorSpace=ni.rgb,t=[ni.rgb.getRgbHex(t,0)];break;case re:w.state.strokeColorSpace=ni.rgb,t=[ni.rgb.getRgbHex(t,0)];break;case ie:if(k=w.state.patternFillColorSpace,!k){if(isNumberArray(t,null)){t=[ni.gray.getRgbHex(t,0)],n=oe;break}t=[],n=Le;break}if("Pattern"===k.name)return void next(c.handleColorN(i,ie,t,k,b,s,e,d,g,p));t=[k.getRgbHex(t,0)],n=oe;break;case ee:if(k=w.state.patternStrokeColorSpace,!k){if(isNumberArray(t,null)){t=[ni.gray.getRgbHex(t,0)],n=re;break}t=[],n=Oe;break}if("Pattern"===k.name)return void next(c.handleColorN(i,ee,t,k,b,s,e,d,g,p));t=[k.getRgbHex(t,0)],n=re;break;case he:let _;try{const e=s.get("Shading");if(!e)throw new Ze("No shading resource found");if(_=e.get(t[0].name),!_)throw new Ze("No shading object found")}catch(t){if(t instanceof Qe)continue;if(c.options.ignoreErrors){warn$1(`getOperatorList - ignoring Shading: "${t}".`);continue}throw t}const I=c.parseShading({shading:_,resources:s,localColorSpaceCache:d,localShadingPatternCache:p});if(!I)continue;t=[I],n=he;break;case ut:if(C=t[0]instanceof us,S=t[0].name,C){const e=f.getByName(S);if(e){e.length>0&&i.addOp(ut,[e]),t=null;continue}}return void next(new Promise(function(t,n){if(!C)throw new Ze("GState must be referred to by name.");const a=s.get("ExtGState");if(!(a instanceof fs))throw new Ze("ExtGState should be a dictionary.");const r=a.get(S);if(!(r instanceof fs))throw new Ze("GState should be a dictionary.");c.setGState({resources:s,gState:r,operatorList:i,cacheKey:S,task:e,stateManager:w,localGStateCache:f,localColorSpaceCache:d,seenRefs:l}).then(t,n)}).catch(function(t){if(!(t instanceof Qe)){if(!c.options.ignoreErrors)throw t;warn$1(`getOperatorList - ignoring ExtGState: "${t}".`)}}));case nt:{const[e]=t;if("number"!=typeof e){warn$1(`Invalid setLineWidth: ${e}`);continue}t[0]=Math.abs(e);break}case lt:{const e=t[1];if("number"!=typeof e){warn$1(`Invalid setDash: ${e}`);continue}const s=t[0];if(!Array.isArray(s)){warn$1(`Invalid setDash: ${s}`);continue}s.some(t=>"number"!=typeof t)&&(t[0]=s.filter(t=>"number"==typeof t));break}case pt:case mt:case bt:case wt:case yt:case xt:case vt:c.buildPath(n,t,w.state);continue;case At:case kt:case St:case Ct:case _t:case It:case Tt:case Mt:case Et:{const{state:{pathBuffer:t,pathMinMax:e}}=w;n!==kt&&n!==Tt&&n!==Mt||t.push(qe),0===t.length?i.addOp(Ne,[n,[null],null]):(i.addOp(Ne,[n,[new Float32Array(t)],e.slice()]),t.length=0,e.set([1/0,1/0,-1/0,-1/0],0));continue}case zt:i.addOp(n,[new Float32Array(t)]);continue;case pe:case me:case xe:case ve:continue;case we:if(!(t[0]instanceof us)){warn$1(`Expected name for beginMarkedContentProps arg0=${t[0]}`),i.addOp(we,["OC",null]);continue}if("OC"===t[0].name)return void next(c.parseMarkedContentProps(t[1],s).then(t=>{i.addOp(we,["OC",t])}).catch(t=>{if(!(t instanceof Qe)){if(c.options.ignoreErrors)return warn$1(`getOperatorList - ignoring beginMarkedContentProps: "${t}".`),void i.addOp(we,["OC",null]);throw t}}));t=[t[0].name,t[1]instanceof fs?t[1].get("MCID"):null];break;default:if(null!==t){for(v=0,A=t.length;v<A&&!(t[v]instanceof fs);v++);if(v<A){warn$1("getOperatorList - ignoring operator: "+n);continue}}}i.addOp(n,t)}o?next(Zo):(closePendingRestoreOPS(),t())}).catch(t=>{if(!(t instanceof Qe)){if(this.options.ignoreErrors)return warn$1(`getOperatorList - ignoring errors during "${e.name}" task: "${t}".`),void closePendingRestoreOPS();throw t}})}getTextContent({stream:t,task:e,resources:i,stateManager:n=null,includeMarkedContent:a=!1,sink:r,seenStyles:o=new Set,viewBox:l,lang:c=null,markedContentData:h=null,disableNormalization:u=!1,keepWhiteSpace:d=!1,prevRefs:f=null,intersector:g=null}){const p=t.dict?.objId,m=new ps(f);if(p){if(f?.has(p))throw new Error(`getTextContent - ignoring circular reference: ${p}`);m.put(p)}i||=fs.empty,n||=new sl(new il),a&&(h||={level:0});const b={items:[],styles:Object.create(null),lang:c},w={initialized:!1,str:[],totalWidth:0,totalHeight:0,width:0,height:0,vertical:!1,prevTransform:null,textAdvanceScale:0,spaceInFlowMin:0,spaceInFlowMax:0,trackingSpaceMin:1/0,negativeSpaceMax:-1/0,notASpace:-1/0,transform:null,fontName:null,hasEOL:!1},y=[" "," "];let x=0;function saveLastChar(t){const e=(x+1)%2,s=" "!==y[x]&&" "===y[e];return y[x]=t,x=e,!d&&s}function shouldAddWhitepsace(){return!d&&" "!==y[x]&&" "===y[(x+1)%2]}function resetLastChars(){y[0]=y[1]=" ",x=0}const v=this,A=this.xref,k=[];let S=null;const C=new co,_=new fo,I=new al(t,A,n);let T;function pushWhitespace({width:t=0,height:e=0,transform:s=w.prevTransform,fontName:i=w.fontName}){g?.addExtraChar(" "),b.items.push({str:" ",dir:"ltr",width:t,height:e,transform:s,fontName:i,hasEOL:!1})}function getCurrentTextTransform(){const t=T.font,e=[T.fontSize*T.textHScale,0,0,T.fontSize,0,T.textRise];if(t.isType3Font&&(T.fontSize<=1||t.isCharBBox)&&!isArrayEqual(T.fontMatrix,s)){const s=t.bbox[3]-t.bbox[1];s>0&&(e[3]*=s*T.fontMatrix[3])}return ss.transform(T.ctm,ss.transform(T.textMatrix,e))}function ensureTextContentItem(){if(w.initialized)return w;const{font:t,loadedName:e}=T;if(!o.has(e)&&(o.add(e),b.styles[e]={fontFamily:t.fallbackName,ascent:t.ascent,descent:t.descent,vertical:t.vertical},v.options.fontExtraProperties&&t.systemFontInfo)){const s=b.styles[e];s.fontSubstitution=t.systemFontInfo.css,s.fontSubstitutionLoadedName=t.systemFontInfo.loadedName}w.fontName=e;const s=w.transform=getCurrentTextTransform();t.vertical?(w.width=w.totalWidth=Math.hypot(s[0],s[1]),w.height=w.totalHeight=0,w.vertical=!0):(w.width=w.totalWidth=0,w.height=w.totalHeight=Math.hypot(s[2],s[3]),w.vertical=!1);const i=Math.hypot(T.textLineMatrix[0],T.textLineMatrix[1]),n=Math.hypot(T.ctm[0],T.ctm[1]);w.textAdvanceScale=n*i;const{fontSize:a}=T;return w.trackingSpaceMin=.102*a,w.notASpace=.03*a,w.negativeSpaceMax=-.2*a,w.spaceInFlowMin=.102*a,w.spaceInFlowMax=.6*a,w.hasEOL=!1,w.initialized=!0,w}function updateAdvanceScale(){if(!w.initialized)return;const t=Math.hypot(T.textLineMatrix[0],T.textLineMatrix[1]),e=Math.hypot(T.ctm[0],T.ctm[1])*t;e!==w.textAdvanceScale&&(w.vertical?(w.totalHeight+=w.height*w.textAdvanceScale,w.height=0):(w.totalWidth+=w.width*w.textAdvanceScale,w.width=0),w.textAdvanceScale=e)}function runBidiTransform(t){let e=t.str.join("");var s;u||(s=e,ns||(ns=/([\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,as=new Map([["ſt","ſt"]])),e=s.replaceAll(ns,(t,e,s)=>e?e.normalize("NFKC"):as.get(s)));const i=bidi(e,-1,t.vertical);return{str:i.str,dir:i.dir,width:Math.abs(t.totalWidth),height:Math.abs(t.totalHeight),transform:t.transform,fontName:t.fontName,hasEOL:t.hasEOL}}async function handleSetFont(t,n){const a=await v.loadFont(t,n,i,e);T.loadedName=a.loadedName,T.font=a.font,T.fontMatrix=a.font.fontMatrix||s}function applyInverseRotation(t,e,s){const i=Math.hypot(s[0],s[1]);return[(s[0]*t+s[1]*e)/i,(s[2]*t+s[3]*e)/i]}function compareWithLastPosition(t){const e=getCurrentTextTransform();let s=e[4],i=e[5];if(T.font?.vertical){if(s<l[0]||s>l[2]||i+t<l[1]||i>l[3])return!1}else if(s+t<l[0]||s>l[2]||i<l[1]||i>l[3])return!1;if(!T.font||!w.prevTransform)return!0;let n=w.prevTransform[4],a=w.prevTransform[5];if(n===s&&a===i)return!0;let r=-1;switch(e[0]&&0===e[1]&&0===e[2]?r=e[0]>0?0:180:e[1]&&0===e[0]&&0===e[3]&&(r=e[1]>0?90:270),r){case 0:break;case 90:[s,i]=[i,s],[n,a]=[a,n];break;case 180:[s,i,n,a]=[-s,-i,-n,-a];break;case 270:[s,i]=[-i,-s],[n,a]=[-a,-n];break;default:[s,i]=applyInverseRotation(s,i,e),[n,a]=applyInverseRotation(n,a,w.prevTransform)}if(T.font.vertical){const t=(a-i)/w.textAdvanceScale,e=s-n,r=Math.sign(w.height);return t<r*w.negativeSpaceMax?Math.abs(e)>.5*w.width?(appendEOL(),!0):(resetLastChars(),flushTextContentItem(),!0):Math.abs(e)>w.width?(appendEOL(),!0):(t<=r*w.notASpace&&resetLastChars(),t<=r*w.trackingSpaceMin?shouldAddWhitepsace()?(resetLastChars(),flushTextContentItem(),pushWhitespace({height:Math.abs(t)})):w.height+=t:addFakeSpaces(t,w.prevTransform,r)||(0===w.str.length?(resetLastChars(),pushWhitespace({height:Math.abs(t)})):w.height+=t),Math.abs(e)>.25*w.width&&flushTextContentItem(),!0)}const o=(s-n)/w.textAdvanceScale,c=i-a,h=Math.sign(w.width);return o<h*w.negativeSpaceMax?Math.abs(c)>.5*w.height?(appendEOL(),!0):(resetLastChars(),flushTextContentItem(),!0):Math.abs(c)>w.height?(appendEOL(),!0):(o<=h*w.notASpace&&resetLastChars(),o<=h*w.trackingSpaceMin?shouldAddWhitepsace()?(resetLastChars(),flushTextContentItem(),pushWhitespace({width:Math.abs(o)})):w.width+=o:addFakeSpaces(o,w.prevTransform,h)||(0===w.str.length?(resetLastChars(),pushWhitespace({width:Math.abs(o)})):w.width+=o),Math.abs(c)>.25*w.height&&flushTextContentItem(),!0)}function buildTextContentItem({chars:t,extraSpacing:e}){const s=T.font;if(!t){const t=T.charSpacing+e;return t&&(s.vertical?T.translateTextMatrix(0,-t):T.translateTextMatrix(t*T.textHScale,0)),void(d&&compareWithLastPosition(0))}const i=s.charsToGlyphs(t),n=T.fontMatrix[0]*T.fontSize;for(let t=0,a=i.length;t<a;t++){const r=i[t],{category:o,originalCharCode:l}=r;if(o.isInvisibleFormatMark)continue;let c=T.charSpacing+(t+1===a?e:0),h=r.width;s.vertical&&(h=r.vmetric?r.vmetric[0]:-h);let u=h*n;if(32===l&&(c+=T.wordSpacing),!d&&o.isWhitespace){s.vertical?(c+=-u,T.translateTextMatrix(0,-c)):(c+=u,T.translateTextMatrix(c*T.textHScale,0)),saveLastChar(" ");continue}if(!o.isZeroWidthDiacritic&&!compareWithLastPosition(u)){s.vertical?T.translateTextMatrix(0,u):T.translateTextMatrix(u*T.textHScale,0);continue}const f=ensureTextContentItem();o.isZeroWidthDiacritic&&(u=0),s.vertical?(g?.addGlyph(getCurrentTextTransform(),0,u,r.unicode),T.translateTextMatrix(0,u),u=Math.abs(u),f.height+=u):(u*=T.textHScale,g?.addGlyph(getCurrentTextTransform(),u,0,r.unicode),T.translateTextMatrix(u,0),f.width+=u),u&&(f.prevTransform=getCurrentTextTransform());const p=r.unicode;saveLastChar(p)&&(f.str.push(" "),g?.addExtraChar(" ")),g||f.str.push(p),c&&(s.vertical?T.translateTextMatrix(0,-c):T.translateTextMatrix(c*T.textHScale,0))}}function appendEOL(){g?.addExtraChar("\n"),resetLastChars(),w.initialized?(w.hasEOL=!0,flushTextContentItem()):b.items.push({str:"",dir:"ltr",width:0,height:0,transform:getCurrentTextTransform(),fontName:T.loadedName,hasEOL:!0})}function addFakeSpaces(t,e,s){if(s*w.spaceInFlowMin<=t&&t<=s*w.spaceInFlowMax)return w.initialized&&(resetLastChars(),w.str.push(" "),g?.addExtraChar(" ")),!1;const i=w.fontName;let n=0;return w.vertical&&(n=t,t=0),flushTextContentItem(),resetLastChars(),pushWhitespace({width:Math.abs(t),height:Math.abs(n),transform:e||getCurrentTextTransform(),fontName:i}),!0}function flushTextContentItem(){w.initialized&&w.str&&(w.vertical?w.totalHeight+=w.height*w.textAdvanceScale:w.totalWidth+=w.width*w.textAdvanceScale,b.items.push(runBidiTransform(w)),w.initialized=!1,w.str.length=0)}function enqueueChunk(t=!1){const e=b.items.length;0!==e&&(t&&e<10||(r?.enqueue(b,e),b.items=[],b.styles=Object.create(null)))}const M=new Qo;return new Promise(function promiseBody(t,s){const next=function(e){enqueueChunk(!0),Promise.all([e,r?.ready]).then(function(){try{promiseBody(t,s)}catch(t){s(t)}},s)};e.ensureNotTerminated(),M.reset();const f={};let g,p,w,y=[];for(;!(g=M.check())&&(y.length=0,f.args=y,I.read(f));){const t=T;T=n.state;const s=f.fn;switch(y=f.args,0|s){case Ut:const s=y[0].name,f=y[1];if(T.font&&s===T.fontName&&f===T.fontSize)break;return flushTextContentItem(),T.fontName=s,T.fontSize=f,void next(handleSetFont(s,null));case Ht:T.textRise=y[0];break;case Ot:T.textHScale=y[0]/100;break;case Lt:T.leading=y[0];break;case jt:T.translateTextLineMatrix(y[0],y[1]),T.textMatrix=T.textLineMatrix.slice();break;case qt:T.leading=-y[1],T.translateTextLineMatrix(y[0],y[1]),T.textMatrix=T.textLineMatrix.slice();break;case Gt:T.carriageReturn();break;case zt:T.setTextMatrix(y[0],y[1],y[2],y[3],y[4],y[5]),T.setTextLineMatrix(y[0],y[1],y[2],y[3],y[4],y[5]),updateAdvanceScale();break;case Pt:T.charSpacing=y[0];break;case Nt:T.wordSpacing=y[0];break;case Rt:T.textMatrix=xs.slice(),T.textLineMatrix=xs.slice();break;case Vt:if(!n.state.font){v.ensureStateFont(n.state);continue}const g=(T.font.vertical?1:-1)*T.fontSize/1e3,x=y[0];for(let t=0,e=x.length;t<e;t++){const e=x[t];if("string"==typeof e)k.push(e);else if("number"==typeof e&&0!==e){const t=k.join("");k.length=0,buildTextContentItem({chars:t,extraSpacing:e*g})}}if(k.length>0){const t=k.join("");k.length=0,buildTextContentItem({chars:t,extraSpacing:0})}break;case Wt:if(!n.state.font){v.ensureStateFont(n.state);continue}buildTextContentItem({chars:y[0],extraSpacing:0});break;case Xt:if(!n.state.font){v.ensureStateFont(n.state);continue}T.carriageReturn(),buildTextContentItem({chars:y[0],extraSpacing:0});break;case Kt:if(!n.state.font){v.ensureStateFont(n.state);continue}T.wordSpacing=y[0],T.charSpacing=y[1],T.carriageReturn(),buildTextContentItem({chars:y[2],extraSpacing:0});break;case ge:if(flushTextContentItem(),S??=i.get("XObject")||fs.empty,w=y[0]instanceof us,p=y[0].name,w&&C.getByName(p))break;return void next(new Promise(function(t,s){if(!w)throw new Ze("XObject must be referred to by name.");let f=S.getRaw(p);if(f instanceof gs){if(C.getByRef(f))return void t();if(v.globalImageCache.getData(f,v.pageIndex))return void t();f=A.fetch(f)}if(!(f instanceof bs))throw new Ze("XObject should be a stream");const{dict:g}=f,b=g.get("Subtype");if(!(b instanceof us))throw new Ze("XObject should have a Name subtype");if("Form"!==b.name)return C.set(p,g.objId,!0),void t();const y=n.state.clone(),x=new sl(y),k=lookupMatrix(g.getArray("Matrix"),null);k&&x.transform(k);const _=g.get("Resources");enqueueChunk();const I={enqueueInvoked:!1,enqueue(t,e){this.enqueueInvoked=!0,r.enqueue(t,e)},get desiredSize(){return r.desiredSize??0},get ready(){return r.ready}};v.getTextContent({stream:f,task:e,resources:_ instanceof fs?_:i,stateManager:x,includeMarkedContent:a,sink:r&&I,seenStyles:o,viewBox:l,lang:c,markedContentData:h,disableNormalization:u,keepWhiteSpace:d,prevRefs:m}).then(function(){I.enqueueInvoked||C.set(p,g.objId,!0),t()},s)}).catch(function(t){if(!(t instanceof Qe)){if(!v.options.ignoreErrors)throw t;warn$1(`getTextContent - ignoring XObject: "${t}".`)}}));case ut:if(w=y[0]instanceof us,p=y[0].name,w&&_.getByName(p))break;return void next(new Promise(function(t,e){if(!w)throw new Ze("GState must be referred to by name.");const s=i.get("ExtGState");if(!(s instanceof fs))throw new Ze("ExtGState should be a dictionary.");const n=s.get(p);if(!(n instanceof fs))throw new Ze("GState should be a dictionary.");const a=n.get("Font");if(!a)return _.set(p,n.objId,!0),void t();flushTextContentItem(),T.fontName=null,T.fontSize=a[1],handleSetFont(null,a[0]).then(t,e)}).catch(function(t){if(!(t instanceof Qe)){if(!v.options.ignoreErrors)throw t;warn$1(`getTextContent - ignoring ExtGState: "${t}".`)}}));case be:flushTextContentItem(),a&&(h.level++,b.items.push({type:"beginMarkedContent",tag:y[0]instanceof us?y[0].name:null}));break;case we:if(flushTextContentItem(),a){h.level++;let t=null;y[1]instanceof fs&&(t=y[1].get("MCID")),b.items.push({type:"beginMarkedContentProps",id:Number.isInteger(t)?`${v.idFactory.getPageObjId()}_mc${t}`:null,tag:y[0]instanceof us?y[0].name:null})}break;case ye:if(flushTextContentItem(),a){if(0===h.level)break;h.level--,b.items.push({type:"endMarkedContent"})}break;case ft:!t||t.font===T.font&&t.fontSize===T.fontSize&&t.fontName===T.fontName||flushTextContentItem()}if(b.items.length>=(r?.desiredSize??1)){g=!0;break}}g?next(Zo):(flushTextContentItem(),enqueueChunk(),t())}).catch(t=>{if(!(t instanceof Qe)){if(this.options.ignoreErrors)return warn$1(`getTextContent - ignoring errors during "${e.name}" task: "${t}".`),flushTextContentItem(),void enqueueChunk();throw t}})}async extractDataStructures(t,e){const s=this.xref;let i;const n=this.readToUnicode(e.toUnicode);if(e.composite){const s=t.get("CIDSystemInfo");s instanceof fs&&(e.cidSystemInfo={registry:stringToPDFString(s.get("Registry")),ordering:stringToPDFString(s.get("Ordering")),supplement:s.get("Supplement")});try{const e=t.get("CIDToGIDMap");e instanceof bs&&(i=e.getBytes())}catch(t){if(!this.options.ignoreErrors)throw t;warn$1(`extractDataStructures - ignoring CIDToGIDMap data: "${t}".`)}}const a=[];let r,o=null;if(t.has("Encoding")){if(r=t.get("Encoding"),r instanceof fs){if(o=r.get("BaseEncoding"),o=o instanceof us?o.name:null,r.has("Differences")){const t=r.get("Differences");let e=0;for(const i of t){const t=s.fetchIfRef(i);if("number"==typeof t)e=t;else{if(!(t instanceof us))throw new Ze(`Invalid entry in 'Differences' array: ${t}`);a[e++]=t.name}}}}else if(r instanceof us)o=r.name;else{const t="Encoding is not a Name nor a Dict";if(!this.options.ignoreErrors)throw new Ze(t);warn$1(t)}"MacRomanEncoding"!==o&&"MacExpertEncoding"!==o&&"WinAnsiEncoding"!==o&&(o=null)}const l=!e.file||e.isInternalFont,c=ma()[e.name];if(o&&l&&c&&(o=null),o)e.defaultEncoding=getEncoding(o);else{let t=!!(e.flags&Un);const s=!!(e.flags&$n);"TrueType"===e.type&&t&&s&&0!==a.length&&(e.flags&=-5,t=!1),r=_n,"TrueType"!==e.type||s||(r=In),(t||c)&&(r=Cn,l&&(/Symbol/i.test(e.name)?r=Tn:/Dingbats/i.test(e.name)?r=Mn:/Wingdings/i.test(e.name)&&(r=In))),e.defaultEncoding=r}e.differences=a,e.baseEncodingName=o,e.hasEncoding=!!o||a.length>0,e.dict=t,e.toUnicode=await n;const h=await this.buildToUnicode(e);return e.toUnicode=h,i&&(e.cidToGidMap=this.readCidToGidMap(i,h)),e}_simpleFontToUnicode(t,e=!1){assert$1(!t.composite,"Must be a simple font.");const s=[],i=t.defaultEncoding.slice(),n=t.baseEncodingName,a=t.differences;for(const t in a){const e=a[t];".notdef"!==e&&(i[t]=e)}const r=En();for(const a in i){let o=i[a];if(""===o)continue;let l=r[o];if(void 0!==l){s[a]=String.fromCharCode(l);continue}let c=0;switch(o[0]){case"G":3===o.length&&(c=parseInt(o.substring(1),16));break;case"g":5===o.length&&(c=parseInt(o.substring(1),16));break;case"C":case"c":if(o.length>=3&&o.length<=4){const s=o.substring(1);if(e){c=parseInt(s,16);break}if(c=+s,Number.isNaN(c)&&Number.isInteger(parseInt(s,16)))return this._simpleFontToUnicode(t,!0)}break;case"u":l=getUnicodeForGlyph(o,r),-1!==l&&(c=l);break;default:switch(o){case"f_h":case"f_t":case"T_h":s[a]=o.replaceAll("_","");continue}}if(c>0&&c<=1114111&&Number.isInteger(c)){if(n&&c===+a){const t=getEncoding(n);if(t&&(o=t[a])){s[a]=String.fromCharCode(r[o]);continue}}s[a]=String.fromCodePoint(c)}}return s}async buildToUnicode(t){if(t.hasIncludedToUnicodeMap=t.toUnicode?.length>0,t.hasIncludedToUnicodeMap)return!t.composite&&t.hasEncoding&&(t.fallbackToUnicode=this._simpleFontToUnicode(t)),t.toUnicode;if(!t.composite)return new xa(this._simpleFontToUnicode(t));if(t.composite&&(t.cMap.builtInCMap&&!(t.cMap instanceof vn)||"Adobe"===t.cidSystemInfo?.registry&&("GB1"===t.cidSystemInfo.ordering||"CNS1"===t.cidSystemInfo.ordering||"Japan1"===t.cidSystemInfo.ordering||"Korea1"===t.cidSystemInfo.ordering))){const{registry:e,ordering:s}=t.cidSystemInfo,i=us.get(`${e}-${s}-UCS2`),n=await An.create({encoding:i,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}),a=[],r=[];return t.cMap.forEach(function(t,e){if(e>65535)throw new Ze("Max size of CID is 65,535");const s=n.lookup(e);if(s){r.length=0;for(let t=0,e=s.length;t<e;t+=2)r.push((s.charCodeAt(t)<<8)+s.charCodeAt(t+1));a[t]=String.fromCharCode(...r)}}),new xa(a)}return new va(t.firstChar,t.lastChar)}async readToUnicode(t){if(!t)return null;if(t instanceof us){const e=await An.create({encoding:t,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});return e instanceof vn?new va(0,65535):new xa(e.getMap())}if(t instanceof bs)try{const e=await An.create({encoding:t,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});if(e instanceof vn)return new va(0,65535);const s=new Array(e.length);return e.forEach(function(t,e){if("number"==typeof e)return void(s[t]=String.fromCodePoint(e));e.length%2!=0&&(e="\0"+e);const i=[];for(let t=0;t<e.length;t+=2){const s=e.charCodeAt(t)<<8|e.charCodeAt(t+1);if(55296!=(63488&s)){i.push(s);continue}t+=2;const n=e.charCodeAt(t)<<8|e.charCodeAt(t+1);i.push(((1023&s)<<10)+(1023&n)+65536)}s[t]=String.fromCodePoint(...i)}),new xa(s)}catch(t){if(t instanceof Qe)return null;if(this.options.ignoreErrors)return warn$1(`readToUnicode - ignoring ToUnicode data: "${t}".`),null;throw t}return null}readCidToGidMap(t,e){const s=[];for(let i=0,n=t.length;i<n;i++){const n=t[i++]<<8|t[i],a=i>>1;(0!==n||e.has(a))&&(s[a]=n)}return s}extractWidths(t,e,s){const i=this.xref;let n=[],a=0;const r=[];let o;if(s.composite){const e=t.get("DW");a="number"==typeof e?Math.ceil(e):1e3;const l=t.get("W");if(Array.isArray(l))for(let t=0,e=l.length;t<e;t++){let e=i.fetchIfRef(l[t++]);if(!Number.isInteger(e))break;const s=i.fetchIfRef(l[t]);if(Array.isArray(s))for(const t of s){const s=i.fetchIfRef(t);"number"==typeof s&&(n[e]=s),e++}else{if(!Number.isInteger(s))break;{const a=i.fetchIfRef(l[++t]);if("number"!=typeof a)continue;for(let t=e;t<=s;t++)n[t]=a}}}if(s.vertical){const e=t.getArray("DW2");let s=isNumberArray(e,2)?e:[880,-1e3];if(o=[s[1],.5*a,s[0]],s=t.get("W2"),Array.isArray(s))for(let t=0,e=s.length;t<e;t++){let e=i.fetchIfRef(s[t++]);if(!Number.isInteger(e))break;const n=i.fetchIfRef(s[t]);if(Array.isArray(n))for(let t=0,s=n.length;t<s;t++){const s=[i.fetchIfRef(n[t++]),i.fetchIfRef(n[t++]),i.fetchIfRef(n[t])];isNumberArray(s,null)&&(r[e]=s),e++}else{if(!Number.isInteger(n))break;{const a=[i.fetchIfRef(s[++t]),i.fetchIfRef(s[++t]),i.fetchIfRef(s[++t])];if(!isNumberArray(a,null))continue;for(let t=e;t<=n;t++)r[t]=a}}}}}else{const r=t.get("Widths");if(Array.isArray(r)){let t=s.firstChar;for(const e of r){const s=i.fetchIfRef(e);"number"==typeof s&&(n[t]=s),t++}const o=e.get("MissingWidth");a="number"==typeof o?o:0}else{const e=t.get("BaseFont");if(e instanceof us){const t=this.getBaseFontMetrics(e.name);n=this.buildCharCodeToWidth(t.widths,s),a=t.defaultWidth}}}let l=!0,c=a;for(const t in n){const e=n[t];if(e)if(c){if(c!==e){l=!1;break}}else c=e}l?s.flags|=On:s.flags&=-2,s.defaultWidth=a,s.widths=n,s.defaultVMetrics=o,s.vmetrics=r}isSerifFont(t){const e=t.split("-",1)[0];return e in pa()||/serif/gi.test(e)}getBaseFontMetrics(t){let e=0,s=Object.create(null),i=!1,n=da()[t]||t;const a=Ta();n in a||(n=this.isSerifFont(t)?"Times-Roman":"Helvetica");const r=a[n];return"number"==typeof r?(e=r,i=!0):s=r(),{defaultWidth:e,monospace:i,widths:s}}buildCharCodeToWidth(t,e){const s=Object.create(null),i=e.differences,n=e.defaultEncoding;for(let e=0;e<256;e++)e in i&&t[i[e]]?s[e]=t[i[e]]:e in n&&t[n[e]]&&(s[e]=t[n[e]]);return s}preEvaluateFont(t){const e=t;let s=t.get("Subtype");if(!(s instanceof us))throw new Ze("invalid font Subtype");let i,n=!1;if("Type0"===s.name){const e=t.get("DescendantFonts");if(!e)throw new Ze("Descendant fonts are not specified");if(!((t=Array.isArray(e)?this.xref.fetchIfRef(e[0]):e)instanceof fs))throw new Ze("Descendant font is not a dictionary.");if(s=t.get("Subtype"),!(s instanceof us))throw new Ze("invalid font Subtype");n=!0}let a=t.get("FirstChar");Number.isInteger(a)||(a=0);let r=t.get("LastChar");Number.isInteger(r)||(r=n?65535:255);const o=t.get("FontDescriptor"),l=t.get("ToUnicode")||e.get("ToUnicode");if(o){i=new Vo;const s=e.getRaw("Encoding");if(s instanceof us)i.update(s.name);else if(s instanceof gs)i.update(s.toString());else if(s instanceof fs)for(const t of s.getRawValues())if(t instanceof us)i.update(t.name);else if(t instanceof gs)i.update(t.toString());else if(Array.isArray(t)){const e=t.length,s=new Array(e);for(let i=0;i<e;i++){const e=t[i];e instanceof us?s[i]=e.name:("number"==typeof e||e instanceof gs)&&(s[i]=e.toString())}i.update(s.join())}if(i.update(`${a}-${r}`),l instanceof bs){const t=l.str||l,e=t.buffer?new Uint8Array(t.buffer.buffer,0,t.bufferLength):new Uint8Array(t.bytes.buffer,t.start,t.end-t.start);i.update(e)}else l instanceof us&&i.update(l.name);const o=t.get("Widths")||e.get("Widths");if(Array.isArray(o)){const t=[];for(const e of o)("number"==typeof e||e instanceof gs)&&t.push(e.toString());i.update(t.join())}if(n){i.update("compositeFont");const s=t.get("W")||e.get("W");if(Array.isArray(s)){const t=[];for(const e of s)if("number"==typeof e||e instanceof gs)t.push(e.toString());else if(Array.isArray(e)){const s=[];for(const t of e)("number"==typeof t||t instanceof gs)&&s.push(t.toString());t.push(`[${s.join()}]`)}i.update(t.join())}const n=t.getRaw("CIDToGIDMap")||e.getRaw("CIDToGIDMap");n instanceof us?i.update(n.name):n instanceof gs?i.update(n.toString()):n instanceof bs&&i.update(n.peekBytes())}}return{descriptor:o,dict:t,baseDict:e,composite:n,type:s.name,firstChar:a,lastChar:r,toUnicode:l,hash:i?i.hexdigest():""}}async translateFont({descriptor:t,dict:e,baseDict:i,composite:n,type:a,firstChar:r,lastChar:o,toUnicode:l,cssFontInfo:c}){const h="Type3"===a;if(!t){if(!h){let t=e.get("BaseFont");if(!(t instanceof us))throw new Ze("Base font is not specified");t=t.name.replaceAll(/[,_]/g,"-");const s=this.getBaseFontMetrics(t),n=t.split("-",1)[0],c=(this.isSerifFont(n)?Ln:0)|(s.monospace?On:0)|(ma()[n]?Un:$n),u={type:a,name:t,loadedName:i.loadedName,systemFontInfo:null,widths:s.widths,defaultWidth:s.defaultWidth,isSimulatedFlags:!0,flags:c,firstChar:r,lastChar:o,toUnicode:l,xHeight:0,capHeight:0,italicAngle:0,isType3Font:h},d=e.get("Widths"),f=getStandardFontName(t);let g=null;f&&(g=await this.fetchStandardFontData(f),u.isInternalFont=!!g),!u.isInternalFont&&this.options.useSystemFonts&&(u.systemFontInfo=getFontSubstitution(this.systemFontCache,this.idFactory,this.options.standardFontDataUrl,t,f,a));const p=await this.extractDataStructures(e,u);if(Array.isArray(d)){const t=[];let e=r;for(const s of d){const i=this.xref.fetchIfRef(s);"number"==typeof i&&(t[e]=i),e++}p.widths=t}else p.widths=this.buildCharCodeToWidth(s.widths,p);return new sr(t,g,p,this.options)}t=fs.empty}let u=t.get("FontName"),d=e.get("BaseFont");"string"==typeof u&&(u=us.get(u)),"string"==typeof d&&(d=us.get(d));const f=u?.name,g=d?.name;if(h?f||(u=us.get(a)):f!==g&&(info$1(`The FontDescriptor's FontName is "${f}" but should be the same as the Font's BaseFont "${g}".`),f&&g&&(g.startsWith(f)||!isKnownFontName(f)&&isKnownFontName(g))&&(u=null),u||=d),!(u instanceof us))throw new Ze("invalid font name");let p,m,b,w,y;try{if(p=t.get("FontFile","FontFile2","FontFile3"),p){if(!(p instanceof bs))throw new Ze("FontFile should be a stream");if(p.isEmpty)throw new Ze("FontFile is empty")}}catch(t){if(!this.options.ignoreErrors)throw t;warn$1(`translateFont - fetching "${u.name}" font file: "${t}".`),p=null}let x=!1,v=null,A=null;if(p){if(p.dict){const t=p.dict.get("Subtype");t instanceof us&&(m=t.name),b=p.dict.get("Length1"),w=p.dict.get("Length2"),y=p.dict.get("Length3")}}else if(c){const t=getXfaFontName(u.name);t&&(c.fontFamily=`${c.fontFamily}-PdfJS-XFA`,c.metrics=t.metrics||null,v=t.factors||null,p=await this.fetchStandardFontData(t.name),x=!!p,i=e=getXfaFontDict(u.name),n=!0)}else if(!h){const t=getStandardFontName(u.name);t&&(p=await this.fetchStandardFontData(t),x=!!p),!x&&this.options.useSystemFonts&&(A=getFontSubstitution(this.systemFontCache,this.idFactory,this.options.standardFontDataUrl,u.name,t,a))}const k=lookupMatrix(e.getArray("FontMatrix"),s),S=lookupNormalRect(t.getArray("FontBBox")||e.getArray("FontBBox"),h?[0,0,0,0]:void 0);let C=t.get("Ascent");"number"!=typeof C&&(C=void 0);let _=t.get("Descent");"number"!=typeof _&&(_=void 0);let I=t.get("XHeight");"number"!=typeof I&&(I=0);let T=t.get("CapHeight");"number"!=typeof T&&(T=0);let M=t.get("Flags");Number.isInteger(M)||(M=0);let E=t.get("ItalicAngle");"number"!=typeof E&&(E=0);const F={type:a,name:u.name,subtype:m,file:p,length1:b,length2:w,length3:y,isInternalFont:x,loadedName:i.loadedName,composite:n,fixedPitch:!1,fontMatrix:k,firstChar:r,lastChar:o,toUnicode:l,bbox:S,ascent:C,descent:_,xHeight:I,capHeight:T,flags:M,italicAngle:E,isType3Font:h,cssFontInfo:c,scaleFactors:v,systemFontInfo:A};if(n){const t=i.get("Encoding");t instanceof us&&(F.cidEncoding=t.name);const e=await An.create({encoding:t,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});F.cMap=e,F.vertical=F.cMap.vertical}const D=await this.extractDataStructures(e,F);return this.extractWidths(e,t,D),new sr(u.name,p,D,this.options)}static buildFontPaths(t,e,s,i){function buildPath(e){const n=`${t.loadedName}_path_${e}`;try{if(t.renderer.hasBuiltPath(e))return;s.send("commonobj",[n,"FontPath",t.renderer.getPathJs(e)])}catch(t){if(i.ignoreErrors)return void warn$1(`buildFontPaths - ignoring ${n} glyph: "${t}".`);throw t}}for(const t of e){buildPath(t.fontChar);const e=t.accent;e?.fontChar&&buildPath(e.fontChar)}}static get fallbackFontDict(){const t=new fs;return t.set("BaseFont",us.get("Helvetica")),t.set("Type",us.get("FallbackType")),t.set("Subtype",us.get("FallbackType")),t.set("Encoding",us.get("WinAnsiEncoding")),shadow$1(this,"fallbackFontDict",t)}},el=class{#it=!1;#nt=null;constructor({loadedName:t,font:e,dict:s}){this.loadedName=t,this.font=e,this.dict=s,this.type3Dependencies=e.isType3Font?new Set:null}send(t){if(this.#it)return;this.#it=!0;const e=this.font.exportData(),s=[];e.data&&(e.data.charProcOperatorList&&(e.charProcOperatorList=e.data.charProcOperatorList),e.data=Oo.write(e.data),s.push(e.data)),t.send("commonobj",[this.loadedName,"Font",e],s)}fallback(t,e){this.font.data&&(this.font.disableFontFace=!0,tl.buildFontPaths(this.font,this.font.glyphCacheValues,t,e))}loadType3Data(t,e,s){if(this.#nt)return this.#nt;const{font:i,type3Dependencies:n}=this;assert$1(i.isType3Font,"Must be a Type3 font.");const a=t.clone({ignoreErrors:!1}),r=new ps(t.type3FontRefs);this.dict.objId&&!r.has(this.dict.objId)&&r.put(this.dict.objId),a.type3FontRefs=r;let o=Promise.resolve();const l=this.dict.get("CharProcs"),c=this.dict.get("Resources")||e,h=Object.create(null),[u,d,f,g]=i.bbox,p=f-u,m=g-d,b=Math.hypot(p,m);for(const t of l.getKeys())o=o.then(()=>{const e=l.get(t),i=new Si;return a.getOperatorList({stream:e,task:s,resources:c,operatorList:i}).then(()=>{switch(i.fnArray[0]){case Jt:this.#at(i,b);break;case Yt:b||this.#rt(i)}h[t]=i.getIR();for(const t of i.dependencies)n.add(t)}).catch(function(e){warn$1(`Type3 font resource "${t}" is not available.`);const s=new Si;h[t]=s.getIR()})});return this.#nt=o.then(()=>{i.charProcOperatorList=h,this._bbox&&(i.isCharBBox=!0,i.bbox=this._bbox)}),this.#nt}#at(t,e=NaN){const s=ss.normalizeRect(t.argsArray[0].slice(2)),i=s[2]-s[0],n=s[3]-s[1],a=Math.hypot(i,n);0===i||0===n?(t.fnArray.splice(0,1),t.argsArray.splice(0,1)):(0===e||Math.round(a/e)>=10)&&(this._bbox??=[1/0,1/0,-1/0,-1/0],ss.rectBoundingBox(...s,this._bbox));let r=0,o=t.length;for(;r<o;){switch(t.fnArray[r]){case Jt:break;case Zt:case Qt:case te:case ee:case se:case ie:case ne:case ae:case re:case oe:case le:case ce:case he:case ct:t.fnArray.splice(r,1),t.argsArray.splice(r,1),o--;continue;case ut:const[e]=t.argsArray[r];let s=0,i=e.length;for(;s<i;){const[t]=e[s];switch(t){case"TR":case"TR2":case"HT":case"BG":case"BG2":case"UCR":case"UCR2":e.splice(s,1),i--;continue}s++}}r++}}#rt(t){let e=1;const s=t.length;for(;e<s;){if(t.fnArray[e]===Ne){const s=t.argsArray[e][2];this._bbox??=[1/0,1/0,-1/0,-1/0],ss.rectBoundingBox(...s,this._bbox)}e++}}},sl=class{constructor(t=new nl){this.state=t,this.stateStack=[]}save(){const t=this.state;this.stateStack.push(this.state),this.state=t.clone()}restore(){const t=this.stateStack.pop();t&&(this.state=t)}transform(t){this.state.ctm=ss.transform(this.state.ctm,t)}},il=class{constructor(){this.ctm=new Float32Array(xs),this.fontName=null,this.fontSize=0,this.loadedName=null,this.font=null,this.fontMatrix=s,this.textMatrix=xs.slice(),this.textLineMatrix=xs.slice(),this.charSpacing=0,this.wordSpacing=0,this.leading=0,this.textHScale=1,this.textRise=0}setTextMatrix(t,e,s,i,n,a){const r=this.textMatrix;r[0]=t,r[1]=e,r[2]=s,r[3]=i,r[4]=n,r[5]=a}setTextLineMatrix(t,e,s,i,n,a){const r=this.textLineMatrix;r[0]=t,r[1]=e,r[2]=s,r[3]=i,r[4]=n,r[5]=a}translateTextMatrix(t,e){const s=this.textMatrix;s[4]=s[0]*t+s[2]*e+s[4],s[5]=s[1]*t+s[3]*e+s[5]}translateTextLineMatrix(t,e){const s=this.textLineMatrix;s[4]=s[0]*t+s[2]*e+s[4],s[5]=s[1]*t+s[3]*e+s[5]}carriageReturn(){this.translateTextLineMatrix(0,-this.leading),this.textMatrix=this.textLineMatrix.slice()}clone(){const t=Object.create(this);return t.textMatrix=this.textMatrix.slice(),t.textLineMatrix=this.textLineMatrix.slice(),t.fontMatrix=this.fontMatrix.slice(),t}},nl=class{constructor(){this.ctm=new Float32Array(xs),this.font=null,this.textRenderingMode=v,this._fillColorSpace=this._strokeColorSpace=ni.gray,this.patternFillColorSpace=null,this.patternStrokeColorSpace=null,this.currentPointX=this.currentPointY=0,this.pathMinMax=new Float32Array([1/0,1/0,-1/0,-1/0]),this.pathBuffer=[]}get fillColorSpace(){return this._fillColorSpace}set fillColorSpace(t){this._fillColorSpace=this.patternFillColorSpace=t}get strokeColorSpace(){return this._strokeColorSpace}set strokeColorSpace(t){this._strokeColorSpace=this.patternStrokeColorSpace=t}clone({newPath:t=!1}={}){const e=Object.create(this);return t&&(e.pathBuffer=[],e.pathMinMax=new Float32Array([1/0,1/0,-1/0,-1/0])),e}},al=class _EvaluatorPreprocessor{static get opMap(){return shadow$1(this,"opMap",Object.assign(Object.create(null),{w:{id:nt,numArgs:1,variableArgs:!1},J:{id:at,numArgs:1,variableArgs:!1},j:{id:rt,numArgs:1,variableArgs:!1},M:{id:ot,numArgs:1,variableArgs:!1},d:{id:lt,numArgs:2,variableArgs:!1},ri:{id:ct,numArgs:1,variableArgs:!1},i:{id:ht,numArgs:1,variableArgs:!1},gs:{id:ut,numArgs:1,variableArgs:!1},q:{id:dt,numArgs:0,variableArgs:!1},Q:{id:ft,numArgs:0,variableArgs:!1},cm:{id:gt,numArgs:6,variableArgs:!1},m:{id:pt,numArgs:2,variableArgs:!1},l:{id:mt,numArgs:2,variableArgs:!1},c:{id:bt,numArgs:6,variableArgs:!1},v:{id:wt,numArgs:4,variableArgs:!1},y:{id:yt,numArgs:4,variableArgs:!1},h:{id:xt,numArgs:0,variableArgs:!1},re:{id:vt,numArgs:4,variableArgs:!1},S:{id:At,numArgs:0,variableArgs:!1},s:{id:kt,numArgs:0,variableArgs:!1},f:{id:St,numArgs:0,variableArgs:!1},F:{id:St,numArgs:0,variableArgs:!1},"f*":{id:Ct,numArgs:0,variableArgs:!1},B:{id:_t,numArgs:0,variableArgs:!1},"B*":{id:It,numArgs:0,variableArgs:!1},b:{id:Tt,numArgs:0,variableArgs:!1},"b*":{id:Mt,numArgs:0,variableArgs:!1},n:{id:Et,numArgs:0,variableArgs:!1},W:{id:Ft,numArgs:0,variableArgs:!1},"W*":{id:Dt,numArgs:0,variableArgs:!1},BT:{id:Rt,numArgs:0,variableArgs:!1},ET:{id:Bt,numArgs:0,variableArgs:!1},Tc:{id:Pt,numArgs:1,variableArgs:!1},Tw:{id:Nt,numArgs:1,variableArgs:!1},Tz:{id:Ot,numArgs:1,variableArgs:!1},TL:{id:Lt,numArgs:1,variableArgs:!1},Tf:{id:Ut,numArgs:2,variableArgs:!1},Tr:{id:$t,numArgs:1,variableArgs:!1},Ts:{id:Ht,numArgs:1,variableArgs:!1},Td:{id:jt,numArgs:2,variableArgs:!1},TD:{id:qt,numArgs:2,variableArgs:!1},Tm:{id:zt,numArgs:6,variableArgs:!1},"T*":{id:Gt,numArgs:0,variableArgs:!1},Tj:{id:Wt,numArgs:1,variableArgs:!1},TJ:{id:Vt,numArgs:1,variableArgs:!1},"'":{id:Xt,numArgs:1,variableArgs:!1},'"':{id:Kt,numArgs:3,variableArgs:!1},d0:{id:Yt,numArgs:2,variableArgs:!1},d1:{id:Jt,numArgs:6,variableArgs:!1},CS:{id:Zt,numArgs:1,variableArgs:!1},cs:{id:Qt,numArgs:1,variableArgs:!1},SC:{id:te,numArgs:4,variableArgs:!0},SCN:{id:ee,numArgs:33,variableArgs:!0},sc:{id:se,numArgs:4,variableArgs:!0},scn:{id:ie,numArgs:33,variableArgs:!0},G:{id:ne,numArgs:1,variableArgs:!1},g:{id:ae,numArgs:1,variableArgs:!1},RG:{id:re,numArgs:3,variableArgs:!1},rg:{id:oe,numArgs:3,variableArgs:!1},K:{id:le,numArgs:4,variableArgs:!1},k:{id:ce,numArgs:4,variableArgs:!1},sh:{id:he,numArgs:1,variableArgs:!1},BI:{id:ue,numArgs:0,variableArgs:!1},ID:{id:de,numArgs:0,variableArgs:!1},EI:{id:fe,numArgs:1,variableArgs:!1},Do:{id:ge,numArgs:1,variableArgs:!1},MP:{id:pe,numArgs:1,variableArgs:!1},DP:{id:me,numArgs:2,variableArgs:!1},BMC:{id:be,numArgs:1,variableArgs:!1},BDC:{id:we,numArgs:2,variableArgs:!1},EMC:{id:ye,numArgs:0,variableArgs:!1},BX:{id:xe,numArgs:0,variableArgs:!1},EX:{id:ve,numArgs:0,variableArgs:!1},BM:null,BD:null,true:null,fa:null,fal:null,fals:null,false:null,nu:null,nul:null,null:null}))}static MAX_INVALID_PATH_OPS=10;constructor(t,e,s=new sl){this.parser=new gn({lexer:new mn(t,_EvaluatorPreprocessor.opMap),xref:e}),this.stateManager=s,this.nonProcessedArgs=[],this._isPathOp=!1,this._numInvalidPathOPS=0}get savedStatesDepth(){return this.stateManager.stateStack.length}read(t){let e=t.args;for(;;){const s=this.parser.getObj();if(s instanceof ds){const i=s.cmd,n=_EvaluatorPreprocessor.opMap[i];if(!n){warn$1(`Unknown command "${i}".`);continue}const a=n.id,r=n.numArgs;let o=null!==e?e.length:0;if(this._isPathOp||(this._numInvalidPathOPS=0),this._isPathOp=a>=pt&&a<=Et,n.variableArgs)o>r&&info$1(`Command ${i}: expected [0, ${r}] args, but received ${o} args.`);else{if(o!==r){const t=this.nonProcessedArgs;for(;o>r;)t.push(e.shift()),o--;for(;o<r&&0!==t.length;)null===e&&(e=[]),e.unshift(t.pop()),o++}if(o<r){const t=`command ${i}: expected ${r} args, but received ${o} args.`;if(this._isPathOp&&++this._numInvalidPathOPS>_EvaluatorPreprocessor.MAX_INVALID_PATH_OPS)throw new Ze(`Invalid ${t}`);warn$1(`Skipping ${t}`),null!==e&&(e.length=0);continue}}return this.preprocessCommand(a,e),t.fn=a,t.args=e,!0}if(s===os)return!1;if(null!==s&&(null===e&&(e=[]),e.push(s),e.length>33))throw new Ze("Too many arguments")}}preprocessCommand(t,e){switch(0|t){case dt:this.stateManager.save();break;case ft:this.stateManager.restore();break;case gt:this.stateManager.transform(e)}}},rl=class extends al{constructor(t){super(new Ys(t))}parse(){const t={fn:0,args:[]},e={fontSize:0,fontName:"",fontColor:new Uint8ClampedArray(3)};try{for(;t.args.length=0,this.read(t);){if(0!==this.savedStatesDepth)continue;const{fn:s,args:i}=t;switch(0|s){case Ut:const[t,s]=i;t instanceof us&&(e.fontName=t.name),"number"==typeof s&&s>0&&(e.fontSize=s);break;case oe:ni.rgb.getRgbItem(i,0,e.fontColor,0);break;case ae:ni.gray.getRgbItem(i,0,e.fontColor,0);break;case ce:ni.cmyk.getRgbItem(i,0,e.fontColor,0)}}}catch(t){warn$1(`parseDefaultAppearance - ignoring errors: "${t}".`)}return e}};function parseDefaultAppearance(t){return new rl(t).parse()}var ol=class extends al{constructor(t,e,s,i){super(t),this.stream=t,this.evaluatorOptions=e,this.xref=s,this.globalColorSpaceCache=i,this.resources=t.dict?.get("Resources")}parse(){const t={fn:0,args:[]};let e={scaleFactor:1,fontSize:0,fontName:"",fontColor:new Uint8ClampedArray(3),fillColorSpace:ni.gray},s=!1;const i=[];try{for(;t.args.length=0,!s&&this.read(t);){const{fn:n,args:a}=t;switch(0|n){case dt:i.push({scaleFactor:e.scaleFactor,fontSize:e.fontSize,fontName:e.fontName,fontColor:e.fontColor.slice(),fillColorSpace:e.fillColorSpace});break;case ft:e=i.pop()||e;break;case zt:e.scaleFactor*=Math.hypot(a[0],a[1]);break;case Ut:const[t,n]=a;t instanceof us&&(e.fontName=t.name),"number"==typeof n&&n>0&&(e.fontSize=n*e.scaleFactor);break;case Qt:e.fillColorSpace=ni.parse({cs:a[0],xref:this.xref,resources:this.resources,pdfFunctionFactory:this._pdfFunctionFactory,globalColorSpaceCache:this.globalColorSpaceCache,localColorSpaceCache:this._localColorSpaceCache});break;case se:e.fillColorSpace.getRgbItem(a,0,e.fontColor,0);break;case oe:ni.rgb.getRgbItem(a,0,e.fontColor,0);break;case ae:ni.gray.getRgbItem(a,0,e.fontColor,0);break;case ce:ni.cmyk.getRgbItem(a,0,e.fontColor,0);break;case Wt:case Vt:case Xt:case Kt:s=!0}}}catch(t){warn$1(`parseAppearanceStream - ignoring errors: "${t}".`)}return this.stream.reset(),delete e.scaleFactor,delete e.fillColorSpace,e}get _localColorSpaceCache(){return shadow$1(this,"_localColorSpaceCache",new ho)}get _pdfFunctionFactory(){return shadow$1(this,"_pdfFunctionFactory",new wo({xref:this.xref,isEvalSupported:this.evaluatorOptions.isEvalSupported}))}};function getPdfColor(t,e){return t[0]===t[1]&&t[1]===t[2]?`${numberToString(t[0]/255)} ${e?"g":"G"}`:Array.from(t,t=>numberToString(t/255)).join(" ")+" "+(e?"rg":"RG")}var ll=class _FakeUnicodeFont{constructor(t,e){this.xref=t,this.widths=null,this.firstChar=1/0,this.lastChar=-1/0,this.fontFamily=e;const s=new OffscreenCanvas(1,1);this.ctxMeasure=s.getContext("2d",{willReadFrequently:!0}),_FakeUnicodeFont._fontNameId||(_FakeUnicodeFont._fontNameId=1),this.fontName=us.get(`InvalidPDFjsFont_${e}_${_FakeUnicodeFont._fontNameId++}`)}get fontDescriptorRef(){if(!_FakeUnicodeFont._fontDescriptorRef){const t=new fs(this.xref);t.setIfName("Type","FontDescriptor"),t.set("FontName",this.fontName),t.set("FontFamily","MyriadPro Regular"),t.set("FontBBox",[0,0,0,0]),t.setIfName("FontStretch","Normal"),t.set("FontWeight",400),t.set("ItalicAngle",0),_FakeUnicodeFont._fontDescriptorRef=this.xref.getNewPersistentRef(t)}return _FakeUnicodeFont._fontDescriptorRef}get descendantFontRef(){const t=new fs(this.xref);t.set("BaseFont",this.fontName),t.setIfName("Type","Font"),t.setIfName("Subtype","CIDFontType0"),t.setIfName("CIDToGIDMap","Identity"),t.set("FirstChar",this.firstChar),t.set("LastChar",this.lastChar),t.set("FontDescriptor",this.fontDescriptorRef),t.set("DW",1e3);const e=[],s=[...this.widths.entries()].sort();let i=null,n=null;for(const[t,a]of s)i?t===i+n.length?n.push(a):(e.push(i,n),i=t,n=[a]):(i=t,n=[a]);i&&e.push(i,n),t.set("W",e);const a=new fs(this.xref);return a.set("Ordering","Identity"),a.set("Registry","Adobe"),a.set("Supplement",0),t.set("CIDSystemInfo",a),this.xref.getNewPersistentRef(t)}get baseFontRef(){const t=new fs(this.xref);return t.set("BaseFont",this.fontName),t.setIfName("Type","Font"),t.setIfName("Subtype","Type0"),t.setIfName("Encoding","Identity-H"),t.set("DescendantFonts",[this.descendantFontRef]),t.setIfName("ToUnicode","Identity-H"),this.xref.getNewPersistentRef(t)}get resources(){const t=new fs(this.xref),e=new fs(this.xref);return e.set(this.fontName.name,this.baseFontRef),t.set("Font",e),t}_createContext(){return this.widths=new Map,this.ctxMeasure.font=`1000px ${this.fontFamily}`,this.ctxMeasure}createFontResources(t){const e=this._createContext();for(const s of t.split(/\r\n?|\n/))for(const t of s.split("")){const s=t.charCodeAt(0);if(this.widths.has(s))continue;const i=e.measureText(t),n=Math.ceil(i.width);this.widths.set(s,n),this.firstChar=Math.min(s,this.firstChar),this.lastChar=Math.max(s,this.lastChar)}return this.resources}static getFirstPositionInfo(t,e,s){const[a,r,o,l]=t;let c=o-a,h=l-r;e%180!=0&&([c,h]=[h,c]);const u=i*s;return{coords:[0,h+n*s-u],bbox:[0,0,c,h],matrix:0!==e?getRotationMatrix(e,h,u):void 0}}createAppearance(t,e,s,a,r,o){const l=this._createContext(),c=[];let h=-1/0;for(const e of t.split(/\r\n?|\n/)){c.push(e);const t=l.measureText(e).width;h=Math.max(h,t);for(const t of codePointIter(e)){const e=String.fromCodePoint(t);let s=this.widths.get(t);if(void 0===s){const i=l.measureText(e);s=Math.ceil(i.width),this.widths.set(t,s),this.firstChar=Math.min(t,this.firstChar),this.lastChar=Math.max(t,this.lastChar)}}}h*=a/1e3;const[u,d,f,g]=e;let p=f-u,m=g-d;s%180!=0&&([p,m]=[m,p]);let b=1;h>p&&(b=p/h);let w=1;const y=i*a,x=n*a,v=y*c.length;v>m&&(w=m/v);const A=a*Math.min(b,w),k=["q",`0 0 ${numberToString(p)} ${numberToString(m)} re W n`,"BT",`1 0 0 1 0 ${numberToString(m+x)} Tm 0 Tc ${getPdfColor(r,!0)}`,`/${this.fontName.name} ${numberToString(A)} Tf`],{resources:S}=this;if(1!==(o="number"==typeof o&&o>=0&&o<=1?o:1)){k.push("/R0 gs");const t=new fs(this.xref),e=new fs(this.xref);e.set("ca",o),e.set("CA",o),e.setIfName("Type","ExtGState"),t.set("R0",e),S.set("ExtGState",t)}const C=numberToString(y);for(const t of c)k.push(`0 -${C} Td <${stringToUTF16HexString(t)}> Tj`);k.push("ET","Q");const _=k.join("\n"),I=new fs(this.xref);if(I.setIfName("Subtype","Form"),I.setIfName("Type","XObject"),I.set("BBox",[0,0,p,m]),I.set("Length",_.length),I.set("Resources",S),s){const t=getRotationMatrix(s,p,m);I.set("Matrix",t)}const T=new Ys(_);return T.dict=I,T}},cl=["m/d","m/d/yy","mm/dd/yy","mm/yy","d-mmm","d-mmm-yy","dd-mmm-yy","yy-mm-dd","mmm-yy","mmmm-yy","mmm d, yyyy","mmmm d, yyyy","m/d/yy h:MM tt","m/d/yy HH:MM"],hl=["HH:MM","h:MM tt","HH:MM:ss","h:MM:ss tt"],ul=class{constructor(t,e,s){this.root=t,this.xref=e,this._type=s}getAll(){const t=new Map;if(!this.root)return t;const e=this.xref,s=new ps;s.put(this.root);const i=[this.root];for(;i.length>0;){const n=e.fetchIfRef(i.shift());if(!(n instanceof fs))continue;if(n.has("Kids")){const t=n.get("Kids");if(!Array.isArray(t))continue;for(const e of t){if(s.has(e))throw new Ze(`Duplicate entry in "${this._type}" tree.`);i.push(e),s.put(e)}continue}const a=n.get(this._type);if(Array.isArray(a))for(let s=0,i=a.length;s<i;s+=2)t.set(e.fetchIfRef(a[s]),e.fetchIfRef(a[s+1]))}return t}getRaw(t){if(!this.root)return null;const e=this.xref;let s=e.fetchIfRef(this.root),i=0;for(;s.has("Kids");){if(++i>10)return warn$1(`Search depth limit reached for "${this._type}" tree.`),null;const n=s.get("Kids");if(!Array.isArray(n))return null;let a=0,r=n.length-1;for(;a<=r;){const i=a+r>>1,o=e.fetchIfRef(n[i]),l=o.get("Limits");if(t<e.fetchIfRef(l[0]))r=i-1;else{if(!(t>e.fetchIfRef(l[1]))){s=o;break}a=i+1}}if(a>r)return null}const n=s.get(this._type);if(Array.isArray(n)){let s=0,i=n.length-2;for(;s<=i;){const a=s+i>>1,r=a+(1&a),o=e.fetchIfRef(n[r]);if(t<o)i=r-2;else{if(!(t>o))return n[r+1];s=r+2}}}return null}get(t){return this.xref.fetchIfRef(this.getRaw(t))}},dl=class extends ul{constructor(t,e){super(t,e,"Names")}},fl=class extends ul{constructor(t,e){super(t,e,"Nums")}};function clearGlobalCaches(){gr=Object.create(null),ls=Object.create(null),cs=Object.create(null),hs=Object.create(null),Pn.clear(),xi.cleanup()}function pickPlatformItem(t){return t instanceof fs?t.has("UF")?t.get("UF"):t.has("F")?t.get("F"):t.has("Unix")?t.get("Unix"):t.has("Mac")?t.get("Mac"):t.has("DOS")?t.get("DOS"):null:null}var gl=class{#ot=!1;constructor(t,e,s=!1){t instanceof fs&&(this.xref=e,this.root=t,t.has("FS")&&(this.fs=t.get("FS")),t.has("RF")&&warn$1("Related file specifications are not supported"),s||(t.has("EF")?this.#ot=!0:warn$1("Non-embedded file specifications are not supported")))}get filename(){let t="";const e=pickPlatformItem(this.root);return e&&"string"==typeof e&&(t=stringToPDFString(e,!0).replaceAll("\\\\","\\").replaceAll("\\/","/").replaceAll("\\","/")),shadow$1(this,"filename",t||"unnamed")}get content(){if(!this.#ot)return null;this._contentRef||=pickPlatformItem(this.root?.get("EF"));let t=null;if(this._contentRef){const e=this.xref.fetchIfRef(this._contentRef);e instanceof bs?t=e.getBytes():warn$1("Embedded file specification points to non-existing/invalid content")}else warn$1("Embedded file specification does not have any content");return t}get description(){let t="";const e=this.root?.get("Desc");return e&&"string"==typeof e&&(t=stringToPDFString(e)),shadow$1(this,"description",t)}get serializable(){return{rawFilename:this.filename,filename:(t=this.filename,t.substring(t.lastIndexOf("/")+1)),content:this.content,description:this.description};var t}},pl=0,ml=-2,bl=-3,wl=-4,yl=-5,xl=-6,vl=-9;function isWhitespace(t,e){const s=t[e];return" "===s||"\n"===s||"\r"===s||"\t"===s}var Al=class{_resolveEntities(t){return t.replaceAll(/&([^;]+);/g,(t,e)=>{if("#x"===e.substring(0,2))return String.fromCodePoint(parseInt(e.substring(2),16));if("#"===e.substring(0,1))return String.fromCodePoint(parseInt(e.substring(1),10));switch(e){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return'"';case"apos":return"'"}return this.onResolveEntity(e)})}_parseContent(t,e){const s=[];let i=e;function skipWs(){for(;i<t.length&&isWhitespace(t,i);)++i}for(;i<t.length&&!isWhitespace(t,i)&&">"!==t[i]&&"/"!==t[i];)++i;const n=t.substring(e,i);for(skipWs();i<t.length&&">"!==t[i]&&"/"!==t[i]&&"?"!==t[i];){skipWs();let e="",n="";for(;i<t.length&&!isWhitespace(t,i)&&"="!==t[i];)e+=t[i],++i;if(skipWs(),"="!==t[i])return null;++i,skipWs();const a=t[i];if('"'!==a&&"'"!==a)return null;const r=t.indexOf(a,++i);if(r<0)return null;n=t.substring(i,r),s.push({name:e,value:this._resolveEntities(n)}),i=r+1,skipWs()}return{name:n,attributes:s,parsed:i-e}}_parseProcessingInstruction(t,e){let s=e;for(;s<t.length&&!isWhitespace(t,s)&&">"!==t[s]&&"?"!==t[s]&&"/"!==t[s];)++s;const i=t.substring(e,s);!function(){for(;s<t.length&&isWhitespace(t,s);)++s}();const n=s;for(;s<t.length&&("?"!==t[s]||">"!==t[s+1]);)++s;return{name:i,value:t.substring(n,s),parsed:s-e}}parseXml(t){let e=0;for(;e<t.length;){let s=e;if("<"===t[e]){let e;switch(++s,t[s]){case"/":if(++s,e=t.indexOf(">",s),e<0)return void this.onError(vl);this.onEndElement(t.substring(s,e)),s=e+1;break;case"?":++s;const i=this._parseProcessingInstruction(t,s);if("?>"!==t.substring(s+i.parsed,s+i.parsed+2))return void this.onError(bl);this.onPi(i.name,i.value),s+=i.parsed+2;break;case"!":if("--"===t.substring(s+1,s+3)){if(e=t.indexOf("--\x3e",s+3),e<0)return void this.onError(yl);this.onComment(t.substring(s+3,e)),s=e+3}else if("[CDATA["===t.substring(s+1,s+8)){if(e=t.indexOf("]]>",s+8),e<0)return void this.onError(ml);this.onCdata(t.substring(s+8,e)),s=e+3}else{if("DOCTYPE"!==t.substring(s+1,s+8))return void this.onError(xl);{const i=t.indexOf("[",s+8);let n=!1;if(e=t.indexOf(">",s+8),e<0)return void this.onError(wl);if(i>0&&e>i){if(e=t.indexOf("]>",s+8),e<0)return void this.onError(wl);n=!0}const a=t.substring(s+8,e+(n?1:0));this.onDoctype(a),s=e+(n?2:1)}}break;default:const n=this._parseContent(t,s);if(null===n)return void this.onError(xl);let a=!1;if("/>"===t.substring(s+n.parsed,s+n.parsed+2))a=!0;else if(">"!==t.substring(s+n.parsed,s+n.parsed+1))return void this.onError(vl);this.onBeginElement(n.name,n.attributes,a),s+=n.parsed+(a?2:1)}}else{for(;s<t.length&&"<"!==t[s];)s++;const i=t.substring(e,s);this.onText(this._resolveEntities(i))}e=s}}onResolveEntity(t){return`&${t};`}onPi(t,e){}onComment(t){}onCdata(t){}onDoctype(t){}onText(t){}onBeginElement(t,e,s){}onEndElement(t){}onError(t){}},kl=class{constructor(t,e){this.nodeName=t,this.nodeValue=e,Object.defineProperty(this,"parentNode",{value:null,writable:!0})}get firstChild(){return this.childNodes?.[0]}get nextSibling(){const t=this.parentNode.childNodes;if(!t)return;const e=t.indexOf(this);return-1!==e?t[e+1]:void 0}get textContent(){return this.childNodes?this.childNodes.map(t=>t.textContent).join(""):this.nodeValue||""}get children(){return this.childNodes||[]}hasChildNodes(){return this.childNodes?.length>0}searchNode(t,e){if(e>=t.length)return this;const s=t[e];if(s.name.startsWith("#")&&e<t.length-1)return this.searchNode(t,e+1);const i=[];let n=this;for(;;){if(s.name===n.nodeName){if(0!==s.pos){if(0===i.length)return null;{const[a]=i.pop();let r=0;for(const i of a.childNodes)if(s.name===i.nodeName){if(r===s.pos)return i.searchNode(t,e+1);r++}return n.searchNode(t,e+1)}}{const s=n.searchNode(t,e+1);if(null!==s)return s}}if(n.childNodes?.length>0)i.push([n,0]),n=n.childNodes[0];else{if(0===i.length)return null;for(;0!==i.length;){const[t,e]=i.pop(),s=e+1;if(s<t.childNodes.length){i.push([t,s]),n=t.childNodes[s];break}}if(0===i.length)return null}}}dump(t){if("#text"!==this.nodeName){if(t.push(`<${this.nodeName}`),this.attributes)for(const e of this.attributes)t.push(` ${e.name}="${encodeToXmlString(e.value)}"`);if(this.hasChildNodes()){t.push(">");for(const e of this.childNodes)e.dump(t);t.push(`</${this.nodeName}>`)}else this.nodeValue?t.push(`>${encodeToXmlString(this.nodeValue)}</${this.nodeName}>`):t.push("/>")}else t.push(encodeToXmlString(this.nodeValue))}},Sl=class extends Al{constructor({hasAttributes:t=!1,lowerCaseName:e=!1}){super(),this._currentFragment=null,this._stack=null,this._errorCode=pl,this._hasAttributes=t,this._lowerCaseName=e}parseFromString(t){if(this._currentFragment=[],this._stack=[],this._errorCode=pl,this.parseXml(t),this._errorCode!==pl)return;const[e]=this._currentFragment;return e?{documentElement:e}:void 0}onText(t){if(function(t){for(let e=0,s=t.length;e<s;e++)if(!isWhitespace(t,e))return!1;return!0}(t))return;const e=new kl("#text",t);this._currentFragment.push(e)}onCdata(t){const e=new kl("#text",t);this._currentFragment.push(e)}onBeginElement(t,e,s){this._lowerCaseName&&(t=t.toLowerCase());const i=new kl(t);i.childNodes=[],this._hasAttributes&&(i.attributes=e),this._currentFragment.push(i),s||(this._stack.push(this._currentFragment),this._currentFragment=i.childNodes)}onEndElement(t){this._currentFragment=this._stack.pop()||[];const e=this._currentFragment.at(-1);if(!e)return null;for(const t of e.childNodes)t.parentNode=e;return e}onError(t){this._errorCode=t}},Cl=class{constructor(t){t=this._repair(t);const e=new Sl({lowerCaseName:!0}).parseFromString(t);this._metadataMap=new Map,this._data=t,e&&this._parse(e)}_repair(t){return t.replace(/^[^<]+/,"").replaceAll(/>\\376\\377([^<]+)/g,function(t,e){const s=e.replaceAll(/\\([0-3])([0-7])([0-7])/g,function(t,e,s,i){return String.fromCharCode(64*e+8*s+1*i)}).replaceAll(/&(amp|apos|gt|lt|quot);/g,function(t,e){switch(e){case"amp":return"&";case"apos":return"'";case"gt":return">";case"lt":return"<";case"quot":return'"'}throw new Error(`_repair: ${e} isn't defined.`)}),i=[">"];for(let t=0,e=s.length;t<e;t+=2){const e=256*s.charCodeAt(t)+s.charCodeAt(t+1);e>=32&&e<127&&60!==e&&62!==e&&38!==e?i.push(String.fromCharCode(e)):i.push("&#x"+(65536+e).toString(16).substring(1)+";")}return i.join("")})}_getSequence(t){const e=t.nodeName;return"rdf:bag"!==e&&"rdf:seq"!==e&&"rdf:alt"!==e?null:t.childNodes.filter(t=>"rdf:li"===t.nodeName)}_parseArray(t){if(!t.hasChildNodes())return;const[e]=t.childNodes,s=this._getSequence(e)||[];this._metadataMap.set(t.nodeName,s.map(t=>t.textContent.trim()))}_parse(t){let e=t.documentElement;if("rdf:rdf"!==e.nodeName)for(e=e.firstChild;e&&"rdf:rdf"!==e.nodeName;)e=e.nextSibling;if(e&&"rdf:rdf"===e.nodeName&&e.hasChildNodes())for(const t of e.childNodes)if("rdf:description"===t.nodeName)for(const e of t.childNodes){const t=e.nodeName;switch(t){case"#text":continue;case"dc:creator":case"dc:subject":this._parseArray(e);continue}this._metadataMap.set(t,e.textContent.trim())}}get serializable(){return{parsedData:this._metadataMap,rawData:this._data}}},_l=1,Il=2,Tl=3,Ml=4,El=5,Fl=class _StructTreeRoot{constructor(t,e,s){this.xref=t,this.dict=e,this.ref=s instanceof gs?s:null,this.roleMap=new Map,this.structParentIds=null}init(){this.readRoleMap()}#lt(t,e,s){if(!(t instanceof gs)||e<0)return;this.structParentIds||=new ms;let i=this.structParentIds.get(t);i||(i=[],this.structParentIds.put(t,i)),i.push([e,s])}addAnnotationIdToPage(t,e){this.#lt(t,e,Ml)}readRoleMap(){const t=this.dict.get("RoleMap");if(t instanceof fs)for(const[e,s]of t)s instanceof us&&this.roleMap.set(e,s.name)}static async canCreateStructureTree({catalogRef:t,pdfManager:e,newAnnotationsByPage:s}){if(!(t instanceof gs))return warn$1("Cannot save the struct tree: no catalog reference."),!1;let i=0,n=!0;for(const[t,a]of s){const{ref:s}=await e.getPage(t);if(!(s instanceof gs)){warn$1(`Cannot save the struct tree: page ${t} has no ref.`),n=!0;break}for(const t of a)t.accessibilityData?.type&&(t.parentTreeId=i++,n=!1)}if(n){for(const t of s.values())for(const e of t)delete e.parentTreeId;return!1}return!0}static async createStructureTree({newAnnotationsByPage:t,xref:e,catalogRef:s,pdfManager:i,changes:n}){const a=await i.ensureCatalog("cloneDict"),r=new ms;r.put(s,a);const o=e.getNewTemporaryRef();a.set("StructTreeRoot",o);const l=new fs(e);l.set("Type",us.get("StructTreeRoot"));const c=e.getNewTemporaryRef();l.set("ParentTree",c);const h=[];l.set("K",h),r.put(o,l);const u=new fs(e),d=[];u.set("Nums",d);const f=await this.#ct({newAnnotationsByPage:t,structTreeRootRef:o,structTreeRoot:null,kids:h,nums:d,xref:e,pdfManager:i,changes:n,cache:r});l.set("ParentTreeNextKey",f),r.put(c,u);for(const[t,e]of r.items())n.put(t,{data:e})}async canUpdateStructTree({pdfManager:t,newAnnotationsByPage:e}){if(!this.ref)return warn$1("Cannot update the struct tree: no root reference."),!1;let s=this.dict.get("ParentTreeNextKey");if(!Number.isInteger(s)||s<0)return warn$1("Cannot update the struct tree: invalid next key."),!1;const i=this.dict.get("ParentTree");if(!(i instanceof fs))return warn$1("Cannot update the struct tree: ParentTree isn't a dict."),!1;const n=i.get("Nums");if(!Array.isArray(n))return warn$1("Cannot update the struct tree: nums isn't an array."),!1;const a=new fl(i,this.xref);for(const s of e.keys()){const{pageDict:e}=await t.getPage(s);if(!e.has("StructParents"))continue;const i=e.get("StructParents");if(!Number.isInteger(i)||!Array.isArray(a.get(i)))return warn$1(`Cannot save the struct tree: page ${s} has a wrong id.`),!1}let r=!0;for(const[i,n]of e){const{pageDict:e}=await t.getPage(i);_StructTreeRoot.#ht({elements:n,xref:this.xref,pageDict:e,numberTree:a});for(const t of n)t.accessibilityData?.type&&(t.accessibilityData.structParent>=0||(t.parentTreeId=s++),r=!1)}if(r){for(const t of e.values())for(const e of t)delete e.parentTreeId,delete e.structTreeParent;return!1}return!0}async updateStructureTree({newAnnotationsByPage:t,pdfManager:e,changes:s}){const{ref:i,xref:n}=this,a=this.dict.clone(),r=new ms;r.put(i,a);let o,l=a.getRaw("ParentTree");l instanceof gs?o=n.fetch(l):(o=l,l=n.getNewTemporaryRef(),a.set("ParentTree",l)),o=o.clone(),r.put(l,o);let c=o.getRaw("Nums"),h=null;c instanceof gs&&(h=c,c=n.fetch(h)),c=c.slice(),h||o.set("Nums",c);const u=await _StructTreeRoot.#ct({newAnnotationsByPage:t,structTreeRootRef:i,structTreeRoot:this,kids:null,nums:c,xref:n,pdfManager:e,changes:s,cache:r});if(-1!==u){a.set("ParentTreeNextKey",u),h&&r.put(h,c);for(const[t,e]of r.items())s.put(t,{data:e})}}static async#ct({newAnnotationsByPage:t,structTreeRootRef:e,structTreeRoot:s,kids:i,nums:n,xref:a,pdfManager:r,changes:o,cache:l}){const c=us.get("OBJR");let h,u=-1;for(const[d,f]of t){const t=await r.getPage(d),{ref:g}=t,p=g instanceof gs;for(const{accessibilityData:r,ref:m,parentTreeId:b,structTreeParent:w}of f){if(!r?.type)continue;const{structParent:f}=r;if(s&&Number.isInteger(f)&&f>=0){let e=(h||=new Map).get(d);void 0===e&&(e=new Bl(s,t.pageDict).collectObjects(g),h.set(d,e));const i=e?.get(f);if(i){const t=a.fetch(i).clone();_StructTreeRoot.#ut(t,r),o.put(i,{data:t});continue}}u=Math.max(u,b);const y=a.getNewTemporaryRef(),x=new fs(a);_StructTreeRoot.#ut(x,r),await this.#dt({structTreeParent:w,tagDict:x,newTagRef:y,structTreeRootRef:e,fallbackKids:i,xref:a,cache:l});const v=new fs(a);x.set("K",v),v.set("Type",c),p&&v.set("Pg",g),v.set("Obj",m),l.put(y,x),n.push(b,y)}}return u+1}static#ut(t,{type:e,title:s,lang:i,alt:n,expanded:a,actualText:r}){t.set("S",us.get(e)),s&&t.set("T",stringToAsciiOrUTF16BE(s)),i&&t.set("Lang",stringToAsciiOrUTF16BE(i)),n&&t.set("Alt",stringToAsciiOrUTF16BE(n)),a&&t.set("E",stringToAsciiOrUTF16BE(a)),r&&t.set("ActualText",stringToAsciiOrUTF16BE(r))}static#ht({elements:t,xref:e,pageDict:s,numberTree:i}){const n=new Map;for(const e of t)if(e.structTreeParentId){const t=parseInt(e.structTreeParentId.split("_mc")[1],10);let s=n.get(t);s||(s=[],n.set(t,s)),s.push(e)}const a=s.get("StructParents");if(!Number.isInteger(a))return;const r=i.get(a),updateElement=(t,s,i)=>{const a=n.get(t);if(a){const t=s.getRaw("P"),n=e.fetchIfRef(t);if(t instanceof gs&&n instanceof fs){const t={ref:i,dict:s};for(const e of a)e.structTreeParent=t}return!0}return!1};for(const t of r){if(!(t instanceof gs))continue;const s=e.fetch(t),i=s.get("K");if(Number.isInteger(i))updateElement(i,s,t);else if(Array.isArray(i))for(let n of i){if(n=e.fetchIfRef(n),Number.isInteger(n)&&updateElement(n,s,t))break;if(!(n instanceof fs))continue;if(!isName(n.get("Type"),"MCR"))break;const i=n.get("MCID");if(Number.isInteger(i)&&updateElement(i,s,t))break}}}static async#dt({structTreeParent:t,tagDict:e,newTagRef:s,structTreeRootRef:i,fallbackKids:n,xref:a,cache:r}){let o,l=null;t?(({ref:l}=t),o=t.dict.getRaw("P")||i):o=i,e.set("P",o);const c=a.fetchIfRef(o);if(!c)return void n.push(s);let h=r.get(o);h||(h=c.clone(),r.put(o,h));const u=h.getRaw("K");let d=u instanceof gs?r.get(u):null;if(!d){d=a.fetchIfRef(u),d=Array.isArray(d)?d.slice():[u];const t=a.getNewTemporaryRef();h.set("K",t),r.put(t,d)}const f=d.indexOf(l);d.splice(f>=0?f+1:d.length,0,s)}},Dl=class{constructor(t,e){this.tree=t,this.xref=t.xref,this.dict=e,this.kids=[],this.parseKids()}get role(){const t=this.dict.get("S"),e=t instanceof us?t.name:"",{root:s}=this.tree;return s.roleMap.get(e)??e}parseKids(){let t=null;const e=this.dict.getRaw("Pg");e instanceof gs&&(t=e.toString());const s=this.dict.get("K");if(Array.isArray(s))for(const e of s){const s=this.parseKid(t,this.xref.fetchIfRef(e));s&&this.kids.push(s)}else{const e=this.parseKid(t,s);e&&this.kids.push(e)}}parseKid(t,e){if(Number.isInteger(e))return this.tree.pageDict.objId!==t?null:new Rl({type:_l,mcid:e,pageObjId:t});if(!(e instanceof fs))return null;const s=e.getRaw("Pg");s instanceof gs&&(t=s.toString());const i=e.get("Type")instanceof us?e.get("Type").name:null;if("MCR"===i){if(this.tree.pageDict.objId!==t)return null;const s=e.getRaw("Stm");return new Rl({type:Il,refObjId:s instanceof gs?s.toString():null,pageObjId:t,mcid:e.get("MCID")})}if("OBJR"===i){if(this.tree.pageDict.objId!==t)return null;const s=e.getRaw("Obj");return new Rl({type:Tl,refObjId:s instanceof gs?s.toString():null,pageObjId:t})}return new Rl({type:El,dict:e})}},Rl=class{constructor({type:t,dict:e=null,mcid:s=null,pageObjId:i=null,refObjId:n=null}){this.type=t,this.dict=e,this.mcid=s,this.pageObjId=i,this.refObjId=n,this.parentNode=null}},Bl=class{constructor(t,e){this.root=t,this.xref=t?.xref??null,this.rootDict=t?.dict??null,this.pageDict=e,this.nodes=[]}collectObjects(t){if(!(this.root&&this.rootDict&&t instanceof gs))return null;const e=this.rootDict.get("ParentTree");if(!e)return null;const s=this.root.structParentIds?.get(t);if(!s)return null;const i=new Map,n=new fl(e,this.xref);for(const[t]of s){const e=n.getRaw(t);e instanceof gs&&i.set(t,e)}return i}parse(t){if(!(this.root&&this.rootDict&&t instanceof gs))return;const e=this.rootDict.get("ParentTree");if(!e)return;const s=this.pageDict.get("StructParents"),i=this.root.structParentIds?.get(t);if(!Number.isInteger(s)&&!i)return;const n=new Map,a=new fl(e,this.xref);if(Number.isInteger(s)){const t=a.get(s);if(Array.isArray(t))for(const e of t)e instanceof gs&&this.addNode(this.xref.fetch(e),n)}if(i)for(const[t,e]of i){const s=a.get(t);if(s){const t=this.addNode(this.xref.fetchIfRef(s),n);1===t?.kids?.length&&t.kids[0].type===Tl&&(t.kids[0].type=e)}}}addNode(t,e,s=0){if(s>40)return warn$1("StructTree MAX_DEPTH reached."),null;if(!(t instanceof fs))return null;if(e.has(t))return e.get(t);const i=new Dl(this,t);e.set(t,i);const n=t.get("P");if(!(n instanceof fs)||isName(n.get("Type"),"StructTreeRoot"))return this.addTopLevelNode(t,i)||e.delete(t),i;const a=this.addNode(n,e,s+1);if(!a)return i;let r=!1;for(const e of a.kids)e.type===El&&e.dict===t&&(e.parentNode=i,r=!0);return r||e.delete(t),i}addTopLevelNode(t,e){const s=this.rootDict.get("K");if(!s)return!1;if(s instanceof fs)return s.objId===t.objId&&(this.nodes[0]=e,!0);if(!Array.isArray(s))return!0;let i=!1;for(let n=0;n<s.length;n++){const a=s[n];a?.toString()===t.objId&&(this.nodes[n]=e,i=!0)}return i}get serializable(){function nodeToSerializable(t,e,s=0){if(s>40)return void warn$1("StructTree too deep to be fully serialized.");const i=Object.create(null);i.role=t.role,i.children=[],e.children.push(i);let n=t.dict.get("Alt");"string"!=typeof n&&(n=t.dict.get("ActualText")),"string"==typeof n&&(i.alt=stringToPDFString(n));const a=t.dict.get("A");if(a instanceof fs){const t=lookupNormalRect(a.getArray("BBox"),null);if(t)i.bbox=t;else{const t=a.get("Width"),e=a.get("Height");"number"==typeof t&&t>0&&"number"==typeof e&&e>0&&(i.bbox=[0,0,t,e])}}const r=t.dict.get("Lang");"string"==typeof r&&(i.lang=stringToPDFString(r));for(const e of t.kids){const t=e.type===El?e.parentNode:null;t?nodeToSerializable(t,i,s+1):e.type===_l||e.type===Il?i.children.push({type:"content",id:`p${e.pageObjId}_mc${e.mcid}`}):e.type===Tl?i.children.push({type:"object",id:e.refObjId}):e.type===Ml&&i.children.push({type:"annotation",id:`pdfjs_internal_id_${e.refObjId}`})}}const t=Object.create(null);t.children=[],t.role="Root";for(const e of this.nodes)e&&nodeToSerializable(e,t);return t}},Pl=function(t,e,s){if(!Array.isArray(s)||s.length<2)return!1;const[i,n,...a]=s;if(!t(i)&&!Number.isInteger(i))return!1;if(!e(n))return!1;const r=a.length;let o=!0;switch(n.name){case"XYZ":if(r<2||r>3)return!1;break;case"Fit":case"FitB":return 0===r;case"FitH":case"FitBH":case"FitV":case"FitBV":if(r>1)return!1;break;case"FitR":if(4!==r)return!1;o=!1;break;default:return!1}for(const t of a)if(!("number"==typeof t||o&&null===t))return!1;return!0}.bind(null,t=>t instanceof gs,isName);function fetchDest(t){return t instanceof fs&&(t=t.get("D")),Pl(t)?t:null}function fetchRemoteDest(t){let e=t.get("D");if(e){if(e instanceof us&&(e=e.name),"string"==typeof e)return stringToPDFString(e,!0);if(Pl(e))return JSON.stringify(e)}return null}var Nl=class _Catalog{#ft=null;#gt=null;builtInCMapCache=new Map;fontCache=new ms;globalColorSpaceCache=new mo;globalImageCache=new bo;nonBlendModesSet=new ps;pageDictCache=new ms;pageIndexCache=new ms;pageKidsCountCache=new ms;standardFontDataCache=new Map;systemFontCache=new Map;constructor(t,e){if(this.pdfManager=t,this.xref=e,this.#gt=e.getCatalogObj(),!(this.#gt instanceof fs))throw new Ze("Catalog object is not a dictionary.");this.toplevelPagesDict}cloneDict(){return this.#gt.clone()}get version(){const t=this.#gt.get("Version");if(t instanceof us){if(ws.test(t.name))return shadow$1(this,"version",t.name);warn$1(`Invalid PDF catalog version: ${t.name}`)}return shadow$1(this,"version",null)}get lang(){const t=this.#gt.get("Lang");return shadow$1(this,"lang",t&&"string"==typeof t?stringToPDFString(t):null)}get needsRendering(){const t=this.#gt.get("NeedsRendering");return shadow$1(this,"needsRendering","boolean"==typeof t&&t)}get collection(){let t=null;try{const e=this.#gt.get("Collection");e instanceof fs&&e.size>0&&(t=e)}catch(t){if(t instanceof ks)throw t;info$1("Cannot fetch Collection entry; assuming no collection is present.")}return shadow$1(this,"collection",t)}get acroForm(){let t=null;try{const e=this.#gt.get("AcroForm");e instanceof fs&&e.size>0&&(t=e)}catch(t){if(t instanceof ks)throw t;info$1("Cannot fetch AcroForm entry; assuming no forms are present.")}return shadow$1(this,"acroForm",t)}get acroFormRef(){const t=this.#gt.getRaw("AcroForm");return shadow$1(this,"acroFormRef",t instanceof gs?t:null)}get metadata(){const t=this.#gt.getRaw("Metadata");if(!(t instanceof gs))return shadow$1(this,"metadata",null);let e=null;try{const s=this.xref.fetch(t,!this.xref.encrypt?.encryptMetadata);if(s instanceof bs&&s.dict instanceof fs){const t=s.dict.get("Type"),i=s.dict.get("Subtype");if(isName(t,"Metadata")&&isName(i,"XML")){const t=stringToUTF8String$1(s.getString());t&&(e=new Cl(t).serializable)}}}catch(t){if(t instanceof ks)throw t;info$1(`Skipping invalid Metadata: "${t}".`)}return shadow$1(this,"metadata",e)}get markInfo(){let t=null;try{t=this.#pt()}catch(t){if(t instanceof ks)throw t;warn$1("Unable to read mark info.")}return shadow$1(this,"markInfo",t)}#pt(){const t=this.#gt.get("MarkInfo");if(!(t instanceof fs))return null;const e={Marked:!1,UserProperties:!1,Suspects:!1};for(const s in e){const i=t.get(s);"boolean"==typeof i&&(e[s]=i)}return e}get structTreeRoot(){let t=null;try{t=this.#mt()}catch(t){if(t instanceof ks)throw t;warn$1("Unable read to structTreeRoot info.")}return shadow$1(this,"structTreeRoot",t)}#mt(){const t=this.#gt.getRaw("StructTreeRoot"),e=this.xref.fetchIfRef(t);if(!(e instanceof fs))return null;const s=new Fl(this.xref,e,t);return s.init(),s}get toplevelPagesDict(){const t=this.#gt.get("Pages");if(!(t instanceof fs))throw new Ze("Invalid top-level pages dictionary.");return shadow$1(this,"toplevelPagesDict",t)}get documentOutline(){let t=null;try{t=this.#bt()}catch(t){if(t instanceof ks)throw t;warn$1("Unable to read document outline.")}return shadow$1(this,"documentOutline",t)}#bt(){let t=this.#gt.get("Outlines");if(!(t instanceof fs))return null;if(t=t.getRaw("First"),!(t instanceof gs))return null;const e={items:[]},s=[{obj:t,parent:e}],i=new ps;i.put(t);const n=this.xref,a=new Uint8ClampedArray(3);for(;s.length>0;){const e=s.shift(),r=n.fetchIfRef(e.obj);if(null===r)continue;r.has("Title")||warn$1("Invalid outline item encountered.");const o={url:null,dest:null,action:null};_Catalog.parseDestDictionary({destDict:r,resultObj:o,docBaseUrl:this.baseUrl,docAttachments:this.attachments});const l=r.get("Title"),c=r.get("F")||0,h=r.getArray("C"),u=r.get("Count");let d=a;!isNumberArray(h,3)||0===h[0]&&0===h[1]&&0===h[2]||(d=ni.rgb.getRgb(h,0));const f={action:o.action,attachment:o.attachment,dest:o.dest,url:o.url,unsafeUrl:o.unsafeUrl,newWindow:o.newWindow,setOCGState:o.setOCGState,title:"string"==typeof l?stringToPDFString(l):"",color:d,count:Number.isInteger(u)?u:void 0,bold:!!(2&c),italic:!!(1&c),items:[]};e.parent.items.push(f),t=r.getRaw("First"),t instanceof gs&&!i.has(t)&&(s.push({obj:t,parent:f}),i.put(t)),t=r.getRaw("Next"),t instanceof gs&&!i.has(t)&&(s.push({obj:t,parent:e.parent}),i.put(t))}return e.items.length>0?e.items:null}get permissions(){let t=null;try{t=this.#wt()}catch(t){if(t instanceof ks)throw t;warn$1("Unable to read permissions.")}return shadow$1(this,"permissions",t)}#wt(){const t=this.xref.trailer.get("Encrypt");if(!(t instanceof fs))return null;let e=t.get("P");if("number"!=typeof e)return null;e+=2**32;const s=[];for(const t in x){const i=x[t];e&i&&s.push(i)}return s}get optionalContentConfig(){let t=null;try{const e=this.#gt.get("OCProperties");if(!e)return shadow$1(this,"optionalContentConfig",null);const s=e.get("D");if(!s)return shadow$1(this,"optionalContentConfig",null);const i=e.get("OCGs");if(!Array.isArray(i))return shadow$1(this,"optionalContentConfig",null);const n=new ms;for(const t of i)t instanceof gs&&!n.has(t)&&n.put(t,this.#yt(t));t=this.#xt(s,n)}catch(t){if(t instanceof ks)throw t;warn$1(`Unable to read optional content config: ${t}`)}return shadow$1(this,"optionalContentConfig",t)}#yt(t){const e=this.xref.fetch(t),s={id:t.toString(),name:null,intent:null,usage:{print:null,view:null},rbGroups:[]},i=e.get("Name");"string"==typeof i&&(s.name=stringToPDFString(i));let n=e.getArray("Intent");Array.isArray(n)||(n=[n]),n.every(t=>t instanceof us)&&(s.intent=n.map(t=>t.name));const a=e.get("Usage");if(!(a instanceof fs))return s;const r=s.usage,o=a.get("Print");if(o instanceof fs){const t=o.get("PrintState");if(t instanceof us)switch(t.name){case"ON":case"OFF":r.print={printState:t.name}}}const l=a.get("View");if(l instanceof fs){const t=l.get("ViewState");if(t instanceof us)switch(t.name){case"ON":case"OFF":r.view={viewState:t.name}}}return s}#xt(t,e){function parseOnOff(t){const s=[];if(Array.isArray(t))for(const i of t)i instanceof gs&&e.has(i)&&s.push(i.toString());return s}function parseOrder(t,s=0){if(!Array.isArray(t))return null;const n=[];for(const a of t){if(a instanceof gs&&e.has(a)){i.put(a),n.push(a.toString());continue}const t=parseNestedOrder(a,s);t&&n.push(t)}if(s>0)return n;const a=[];for(const[t]of e.items())i.has(t)||a.push(t.toString());return a.length&&n.push({name:null,order:a}),n}function parseNestedOrder(t,e){if(++e>n)return warn$1("parseNestedOrder - reached MAX_NESTED_LEVELS."),null;const i=s.fetchIfRef(t);if(!Array.isArray(i))return null;const a=s.fetchIfRef(i[0]);if("string"!=typeof a)return null;const r=parseOrder(i.slice(1),e);return r?.length?{name:stringToPDFString(a),order:r}:null}const s=this.xref,i=new ps,n=10;return function(t){if(Array.isArray(t))for(const i of t){const t=s.fetchIfRef(i);if(!Array.isArray(t)||!t.length)continue;const n=new Set;for(const s of t)s instanceof gs&&e.has(s)&&!n.has(s.toString())&&(n.add(s.toString()),e.get(s).rbGroups.push(n))}}(t.get("RBGroups")),{name:"string"==typeof t.get("Name")?stringToPDFString(t.get("Name")):null,creator:"string"==typeof t.get("Creator")?stringToPDFString(t.get("Creator")):null,baseState:t.get("BaseState")instanceof us?t.get("BaseState").name:null,on:parseOnOff(t.get("ON")),off:parseOnOff(t.get("OFF")),order:parseOrder(t.get("Order")),groups:[...e]}}setActualNumPages(t=null){this.#ft=t}get hasActualNumPages(){return null!==this.#ft}get _pagesCount(){const t=this.toplevelPagesDict.get("Count");if(!Number.isInteger(t))throw new Ze("Page count in top-level pages dictionary is not an integer.");return shadow$1(this,"_pagesCount",t)}get numPages(){return this.#ft??this._pagesCount}get destinations(){const t=this.#vt(),e=Object.create(null);for(const s of t)if(s instanceof dl)for(const[t,i]of s.getAll()){const s=fetchDest(i);s&&(e[stringToPDFString(t,!0)]=s)}else if(s instanceof fs)for(const[t,i]of s){const s=fetchDest(i);s&&(e[stringToPDFString(t,!0)]||=s)}return shadow$1(this,"destinations",e)}getDestination(t){if(this.hasOwnProperty("destinations"))return this.destinations[t]??null;const e=this.#vt();for(const s of e)if(s instanceof dl||s instanceof fs){const e=fetchDest(s.get(t));if(e)return e}if(e.length){const e=this.destinations[t];if(e)return e}return null}#vt(){const t=this.#gt.get("Names"),e=[];return t?.has("Dests")&&e.push(new dl(t.getRaw("Dests"),this.xref)),this.#gt.has("Dests")&&e.push(this.#gt.get("Dests")),e}get pageLabels(){let t=null;try{t=this.#At()}catch(t){if(t instanceof ks)throw t;warn$1("Unable to read page labels.")}return shadow$1(this,"pageLabels",t)}#At(){const t=this.#gt.getRaw("PageLabels");if(!t)return null;const e=new Array(this.numPages);let s=null,i="";const n=new fl(t,this.xref).getAll();let a="",r=1;for(let t=0,o=this.numPages;t<o;t++){const o=n.get(t);if(void 0!==o){if(!(o instanceof fs))throw new Ze("PageLabel is not a dictionary.");if(o.has("Type")&&!isName(o.get("Type"),"PageLabel"))throw new Ze("Invalid type in PageLabel dictionary.");if(o.has("S")){const t=o.get("S");if(!(t instanceof us))throw new Ze("Invalid style in PageLabel dictionary.");s=t.name}else s=null;if(o.has("P")){const t=o.get("P");if("string"!=typeof t)throw new Ze("Invalid prefix in PageLabel dictionary.");i=stringToPDFString(t)}else i="";if(o.has("St")){const t=o.get("St");if(!(Number.isInteger(t)&&t>=1))throw new Ze("Invalid start in PageLabel dictionary.");r=t}else r=1}switch(s){case"D":a=r;break;case"R":case"r":a=toRomanNumerals(r,"r"===s);break;case"A":case"a":const t=26,e="a"===s?97:65,i=r-1;a=String.fromCharCode(e+i%t).repeat(Math.floor(i/t)+1);break;default:if(s)throw new Ze(`Invalid style "${s}" in PageLabel dictionary.`);a=""}e[t]=i+a,r++}return e}get pageLayout(){const t=this.#gt.get("PageLayout");let e="";if(t instanceof us)switch(t.name){case"SinglePage":case"OneColumn":case"TwoColumnLeft":case"TwoColumnRight":case"TwoPageLeft":case"TwoPageRight":e=t.name}return shadow$1(this,"pageLayout",e)}get pageMode(){const t=this.#gt.get("PageMode");let e="UseNone";if(t instanceof us)switch(t.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"FullScreen":case"UseOC":case"UseAttachments":e=t.name}return shadow$1(this,"pageMode",e)}get viewerPreferences(){const t=this.#gt.get("ViewerPreferences");if(!(t instanceof fs))return shadow$1(this,"viewerPreferences",null);let e=null;for(const[s,i]of t){let t;switch(s){case"HideToolbar":case"HideMenubar":case"HideWindowUI":case"FitWindow":case"CenterWindow":case"DisplayDocTitle":case"PickTrayByPDFSize":"boolean"==typeof i&&(t=i);break;case"NonFullScreenPageMode":if(i instanceof us)switch(i.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"UseOC":t=i.name;break;default:t="UseNone"}break;case"Direction":if(i instanceof us)switch(i.name){case"L2R":case"R2L":t=i.name;break;default:t="L2R"}break;case"ViewArea":case"ViewClip":case"PrintArea":case"PrintClip":if(i instanceof us)switch(i.name){case"MediaBox":case"CropBox":case"BleedBox":case"TrimBox":case"ArtBox":t=i.name;break;default:t="CropBox"}break;case"PrintScaling":if(i instanceof us)switch(i.name){case"None":case"AppDefault":t=i.name;break;default:t="AppDefault"}break;case"Duplex":if(i instanceof us)switch(i.name){case"Simplex":case"DuplexFlipShortEdge":case"DuplexFlipLongEdge":t=i.name;break;default:t="None"}break;case"PrintPageRange":Array.isArray(i)&&i.length%2==0&&i.every((t,e,s)=>Number.isInteger(t)&&t>0&&(0===e||t>=s[e-1])&&t<=this.numPages)&&(t=i);break;case"NumCopies":Number.isInteger(i)&&i>0&&(t=i);break;default:warn$1(`Ignoring non-standard key in ViewerPreferences: ${s}.`);continue}void 0!==t?(e??=Object.create(null),e[s]=t):warn$1(`Bad value, for key "${s}", in ViewerPreferences: ${i}.`)}return shadow$1(this,"viewerPreferences",e)}get openAction(){const t=this.#gt.get("OpenAction"),e=Object.create(null);if(t instanceof fs){const s=new fs(this.xref);s.set("A",t);const i={url:null,dest:null,action:null};_Catalog.parseDestDictionary({destDict:s,resultObj:i}),Array.isArray(i.dest)?e.dest=i.dest:i.action&&(e.action=i.action)}else Pl(t)&&(e.dest=t);return shadow$1(this,"openAction",objectSize(e)>0?e:null)}get attachments(){const t=this.#gt.get("Names");let e=null;if(t instanceof fs&&t.has("EmbeddedFiles")){const s=new dl(t.getRaw("EmbeddedFiles"),this.xref);for(const[t,i]of s.getAll()){const s=new gl(i,this.xref);e??=Object.create(null),e[stringToPDFString(t,!0)]=s.serializable}}return shadow$1(this,"attachments",e)}get xfaImages(){const t=this.#gt.get("Names");let e=null;if(t instanceof fs&&t.has("XFAImages")){const s=new dl(t.getRaw("XFAImages"),this.xref);for(const[t,i]of s.getAll())i instanceof bs&&(e??=new Map,e.set(stringToPDFString(t,!0),i.getBytes()))}return shadow$1(this,"xfaImages",e)}#kt(){const t=this.#gt.get("Names");let e=null;function appendIfJavaScriptDict(t,s){if(!(s instanceof fs))return;if(!isName(s.get("S"),"JavaScript"))return;let i=s.get("JS");if(i instanceof bs)i=i.getString();else if("string"!=typeof i)return;i=stringToPDFString(i,!0).replaceAll("\0",""),i&&(e||=new Map).set(t,i)}if(t instanceof fs&&t.has("JavaScript")){const e=new dl(t.getRaw("JavaScript"),this.xref);for(const[t,s]of e.getAll())appendIfJavaScriptDict(stringToPDFString(t,!0),s)}const s=this.#gt.get("OpenAction");return s&&appendIfJavaScriptDict("OpenAction",s),e}get jsActions(){const t=this.#kt();let e=collectActions(this.xref,this.#gt,Q);if(t){e||=Object.create(null);for(const[s,i]of t)s in e?e[s].push(i):e[s]=[i]}return shadow$1(this,"jsActions",e)}async cleanup(t=!1){clearGlobalCaches(),this.globalColorSpaceCache.clear(),this.globalImageCache.clear(t),this.pageKidsCountCache.clear(),this.pageIndexCache.clear(),this.pageDictCache.clear(),this.nonBlendModesSet.clear();for(const{dict:t}of await Promise.all(this.fontCache))delete t.cacheKey;this.fontCache.clear(),this.builtInCMapCache.clear(),this.standardFontDataCache.clear(),this.systemFontCache.clear()}async getPageDict(t){const e=[this.toplevelPagesDict],s=new ps,i=this.#gt.getRaw("Pages");i instanceof gs&&s.put(i);const n=this.xref,a=this.pageKidsCountCache,r=this.pageIndexCache,o=this.pageDictCache;let l=0;for(;e.length;){const i=e.pop();if(i instanceof gs){const c=a.get(i);if(c>=0&&l+c<=t){l+=c;continue}if(s.has(i))throw new Ze("Pages tree contains circular reference.");s.put(i);const h=await(o.get(i)||n.fetchAsync(i));if(h instanceof fs){let e=h.getRaw("Type");if(e instanceof gs&&(e=await n.fetchAsync(e)),isName(e,"Page")||!h.has("Kids")){if(a.has(i)||a.put(i,1),r.has(i)||r.put(i,l),l===t)return[h,i];l++;continue}}e.push(h);continue}if(!(i instanceof fs))throw new Ze("Page dictionary kid reference points to wrong type of object.");const{objId:c}=i;let h=i.getRaw("Count");if(h instanceof gs&&(h=await n.fetchAsync(h)),Number.isInteger(h)&&h>=0&&(c&&!a.has(c)&&a.put(c,h),l+h<=t)){l+=h;continue}let u=i.getRaw("Kids");if(u instanceof gs&&(u=await n.fetchAsync(u)),!Array.isArray(u)){let e=i.getRaw("Type");if(e instanceof gs&&(e=await n.fetchAsync(e)),isName(e,"Page")||!i.has("Kids")){if(l===t)return[i,null];l++;continue}throw new Ze("Page dictionary kids object is not an array.")}for(let t=u.length-1;t>=0;t--){const s=u[t];e.push(s),i===this.toplevelPagesDict&&s instanceof gs&&!o.has(s)&&o.put(s,n.fetchAsync(s))}}throw new Error(`Page index ${t} not found.`)}async getAllPageDicts(t=!1){const{ignoreErrors:e}=this.pdfManager.evaluatorOptions,s=[{currentNode:this.toplevelPagesDict,posInKids:0}],i=new ps,n=this.#gt.getRaw("Pages");n instanceof gs&&i.put(n);const a=new Map,r=this.xref,o=this.pageIndexCache;let l=0;function addPageDict(t,e){e&&!o.has(e)&&o.put(e,l),a.set(l++,[t,e])}function addPageError(s){if(s instanceof Cs&&!t)throw s;t&&e&&0===l&&(warn$1(`getAllPageDicts - Skipping invalid first page: "${s}".`),s=fs.empty),a.set(l++,[s,null])}for(;s.length>0;){const t=s.at(-1),{currentNode:e,posInKids:n}=t;let a=e.getRaw("Kids");if(a instanceof gs)try{a=await r.fetchAsync(a)}catch(t){addPageError(t);break}if(!Array.isArray(a)){addPageError(new Ze("Page dictionary kids object is not an array."));break}if(n>=a.length){s.pop();continue}const o=a[n];let l;if(o instanceof gs){if(i.has(o)){addPageError(new Ze("Pages tree contains circular reference."));break}i.put(o);try{l=await r.fetchAsync(o)}catch(t){addPageError(t);break}}else l=o;if(!(l instanceof fs)){addPageError(new Ze("Page dictionary kid reference points to wrong type of object."));break}let c=l.getRaw("Type");if(c instanceof gs)try{c=await r.fetchAsync(c)}catch(t){addPageError(t);break}isName(c,"Page")||!l.has("Kids")?addPageDict(l,o instanceof gs?o:null):s.push({currentNode:l,posInKids:0}),t.posInKids++}return a}getPageIndex(t){const e=this.pageIndexCache.get(t);if(void 0!==e)return Promise.resolve(e);const s=this.xref;let i=0;const next=e=>function(e){let i,n=0;return s.fetchAsync(e).then(function(s){if(isRefsEqual(e,t)&&!isDict(s,"Page")&&!(s instanceof fs&&!s.has("Type")&&s.has("Contents")))throw new Ze("The reference does not point to a /Page dictionary.");if(!s)return null;if(!(s instanceof fs))throw new Ze("Node must be a dictionary.");return i=s.getRaw("Parent"),s.getAsync("Parent")}).then(function(t){if(!t)return null;if(!(t instanceof fs))throw new Ze("Parent must be a dictionary.");return t.getAsync("Kids")}).then(function(t){if(!t)return null;const a=[];let r=!1;for(const i of t){if(!(i instanceof gs))throw new Ze("Kid must be a reference.");if(isRefsEqual(i,e)){r=!0;break}a.push(s.fetchAsync(i).then(function(t){if(!(t instanceof fs))throw new Ze("Kid node must be a dictionary.");t.has("Count")?n+=t.get("Count"):n++}))}if(!r)throw new Ze("Kid reference not found in parent's kids.");return Promise.all(a).then(()=>[n,i])})}(e).then(e=>{if(!e)return this.pageIndexCache.put(t,i),i;const[s,n]=e;return i+=s,next(n)});return next(t)}get baseUrl(){const t=this.#gt.get("URI");if(t instanceof fs){const e=t.get("Base");if("string"==typeof e){const t=createValidAbsoluteUrl$1(e,null,{tryConvertEncoding:!0});if(t)return shadow$1(this,"baseUrl",t.href)}}return shadow$1(this,"baseUrl",this.pdfManager.docBaseUrl)}static parseDestDictionary({destDict:t,resultObj:e,docBaseUrl:s=null,docAttachments:i=null}){if(!(t instanceof fs))return void warn$1("parseDestDictionary: `destDict` must be a dictionary.");let n,a,r=t.get("A");if(r instanceof fs||(t.has("Dest")?r=t.get("Dest"):(r=t.get("AA"),r instanceof fs&&(r.has("D")?r=r.get("D"):r.has("U")&&(r=r.get("U"))))),r instanceof fs){const t=r.get("S");if(!(t instanceof us))return void warn$1("parseDestDictionary: Invalid type in Action dictionary.");const s=t.name;switch(s){case"ResetForm":const t=r.get("Flags"),o=!(1&("number"==typeof t?t:0)),l=[],c=[];for(const t of r.get("Fields")||[])t instanceof gs?c.push(t.toString()):"string"==typeof t&&l.push(stringToPDFString(t));e.resetForm={fields:l,refs:c,include:o};break;case"URI":n=r.get("URI"),n instanceof us&&(n="/"+n.name);break;case"GoTo":a=r.get("D");break;case"Launch":case"GoToR":const h=r.get("F");if(h instanceof fs){const t=new gl(h,null,!0),{rawFilename:e}=t.serializable;n=e}else"string"==typeof h&&(n=h);const u=fetchRemoteDest(r);u&&"string"==typeof n&&(n=n.split("#",1)[0]+"#"+u);const d=r.get("NewWindow");"boolean"==typeof d&&(e.newWindow=d);break;case"GoToE":const f=r.get("T");let g;if(i&&f instanceof fs){const t=f.get("R"),e=f.get("N");isName(t,"C")&&"string"==typeof e&&(g=i[stringToPDFString(e,!0)])}if(g){e.attachment=g;const t=fetchRemoteDest(r);t&&(e.attachmentDest=t)}else warn$1('parseDestDictionary - unimplemented "GoToE" action.');break;case"Named":const p=r.get("N");p instanceof us&&(e.action=p.name);break;case"SetOCGState":const m=r.get("State"),b=r.get("PreserveRB");if(!Array.isArray(m)||0===m.length)break;const w=[];for(const t of m)if(t instanceof us)switch(t.name){case"ON":case"OFF":case"Toggle":w.push(t.name)}else t instanceof gs&&w.push(t.toString());if(w.length!==m.length)break;e.setOCGState={state:w,preserveRB:"boolean"!=typeof b||b};break;case"JavaScript":const y=r.get("JS");let x;y instanceof bs?x=y.getString():"string"==typeof y&&(x=y);const v=x&&recoverJsURL(stringToPDFString(x,!0));if(v){n=v.url,e.newWindow=v.newWindow;break}default:if("JavaScript"===s||"SubmitForm"===s)break;warn$1(`parseDestDictionary - unsupported action: "${s}".`)}}else t.has("Dest")&&(a=t.get("Dest"));if("string"==typeof n){const t=createValidAbsoluteUrl$1(n,s,{addDefaultProtocol:!0,tryConvertEncoding:!0});t&&(e.url=t.href),e.unsafeUrl=n}a&&(a instanceof us&&(a=a.name),"string"==typeof a?e.dest=stringToPDFString(a,!0):Pl(a)&&(e.dest=a))}};function mayHaveChildren(t){return t instanceof gs||t instanceof fs||t instanceof bs||Array.isArray(t)}function addChildren(t,e){if(t instanceof fs)t=t.getRawValues();else if(t instanceof bs)t=t.dict.getRawValues();else if(!Array.isArray(t))return;for(const s of t)mayHaveChildren(s)&&e.push(s)}var Ol=class _ObjectLoader{refSet=new ps;constructor(t,e,s){this.dict=t,this.keys=e,this.xref=s}async load(){const{keys:t,dict:e}=this,s=[];for(const i of t){const t=e.getRaw(i);void 0!==t&&s.push(t)}await this.#St(s),this.refSet=null}async#St(t){const e=[],s=[];for(;t.length;){let i=t.pop();if(i instanceof gs){if(this.refSet.has(i))continue;try{this.refSet.put(i),i=this.xref.fetch(i)}catch(t){if(!(t instanceof ks))return warn$1(`ObjectLoader.#walk - requesting all data: "${t}".`),void await this.xref.stream.manager.requestAllChunks();e.push(i),s.push({begin:t.begin,end:t.end})}}if(i instanceof bs){const t=i.getBaseStreams();if(t){let n=!1;for(const e of t)e.isDataLoaded||(n=!0,s.push({begin:e.start,end:e.end}));n&&e.push(i)}}addChildren(i,t)}if(s.length){await this.xref.stream.manager.requestRanges(s);for(const t of e)t instanceof gs&&this.refSet.remove(t);await this.#St(e)}}static async load(t,e,s){if(s.stream.isDataLoaded)return;const i=new _ObjectLoader(t,e,s);await i.load()}},Ll=Symbol(),Ul=Symbol(),$l=Symbol(),Hl=Symbol(),jl=Symbol(),ql=Symbol(),zl=Symbol(),Gl=Symbol(),Wl=Symbol(),Vl=Symbol("content"),Xl=Symbol("data"),Kl=Symbol(),Yl=Symbol("extra"),Jl=Symbol(),Zl=Symbol(),Ql=Symbol(),tc=Symbol(),ec=Symbol(),sc=Symbol(),ic=Symbol(),nc=Symbol(),ac=Symbol(),rc=Symbol(),oc=Symbol(),lc=Symbol(),cc=Symbol(),hc=Symbol(),uc=Symbol(),dc=Symbol(),fc=Symbol(),gc=Symbol(),pc=Symbol(),mc=Symbol(),bc=Symbol(),wc=Symbol(),yc=Symbol(),xc=Symbol(),vc=Symbol(),Ac=Symbol(),kc=Symbol(),Sc=Symbol(),Cc=Symbol(),_c=Symbol(),Ic=Symbol(),Tc=Symbol(),Mc=Symbol("namespaceId"),Ec=Symbol("nodeName"),Fc=Symbol(),Dc=Symbol(),Rc=Symbol(),Bc=Symbol(),Pc=Symbol(),Nc=Symbol(),Oc=Symbol(),Lc=Symbol(),Uc=Symbol("root"),$c=Symbol(),Hc=Symbol(),jc=Symbol(),qc=Symbol(),zc=Symbol(),Gc=Symbol(),Wc=Symbol(),Vc=Symbol(),Xc=Symbol(),Kc=Symbol(),Yc=Symbol(),Jc=Symbol("uid"),Zc=Symbol(),Qc={config:{id:0,check:t=>t.startsWith("http://www.xfa.org/schema/xci/")},connectionSet:{id:1,check:t=>t.startsWith("http://www.xfa.org/schema/xfa-connection-set/")},datasets:{id:2,check:t=>t.startsWith("http://www.xfa.org/schema/xfa-data/")},form:{id:3,check:t=>t.startsWith("http://www.xfa.org/schema/xfa-form/")},localeSet:{id:4,check:t=>t.startsWith("http://www.xfa.org/schema/xfa-locale-set/")},pdf:{id:5,check:t=>"http://ns.adobe.com/xdp/pdf/"===t},signature:{id:6,check:t=>"http://www.w3.org/2000/09/xmldsig#"===t},sourceSet:{id:7,check:t=>t.startsWith("http://www.xfa.org/schema/xfa-source-set/")},stylesheet:{id:8,check:t=>"http://www.w3.org/1999/XSL/Transform"===t},template:{id:9,check:t=>t.startsWith("http://www.xfa.org/schema/xfa-template/")},xdc:{id:10,check:t=>t.startsWith("http://www.xfa.org/schema/xdc/")},xdp:{id:11,check:t=>"http://ns.adobe.com/xdp/"===t},xfdf:{id:12,check:t=>"http://ns.adobe.com/xfdf/"===t},xhtml:{id:13,check:t=>"http://www.w3.org/1999/xhtml"===t},xmpmeta:{id:14,check:t=>"http://ns.adobe.com/xmpmeta/"===t}},th={pt:t=>t,cm:t=>t/2.54*72,mm:t=>t/25.4*72,in:t=>72*t,px:t=>t},eh=/([+-]?\d+\.?\d*)(.*)/;function stripQuotes(t){return t.startsWith("'")||t.startsWith('"')?t.slice(1,-1):t}function getInteger({data:t,defaultValue:e,validate:s}){if(!t)return e;t=t.trim();const i=parseInt(t,10);return!isNaN(i)&&s(i)?i:e}function getFloat({data:t,defaultValue:e,validate:s}){if(!t)return e;t=t.trim();const i=parseFloat(t);return!isNaN(i)&&s(i)?i:e}function getKeyword({data:t,defaultValue:e,validate:s}){return t&&s(t=t.trim())?t:e}function getStringOption(t,e){return getKeyword({data:t,defaultValue:e[0],validate:t=>e.includes(t)})}function getMeasurement(t,e="0"){if(e||="0",!t)return getMeasurement(e);const s=t.trim().match(eh);if(!s)return getMeasurement(e);const[,i,n]=s,a=parseFloat(i);if(isNaN(a))return getMeasurement(e);if(0===a)return 0;const r=th[n];return r?r(a):a}function getRatio(t){if(!t)return{num:1,den:1};const e=t.split(":",2).map(t=>parseFloat(t.trim())).filter(t=>!isNaN(t));if(1===e.length&&e.push(1),0===e.length)return{num:1,den:1};const[s,i]=e;return{num:s,den:i}}function getRelevant(t){return t?t.trim().split(/\s+/).map(t=>({excluded:"-"===t[0],viewname:t.substring(1)})):[]}var sh=class _HTMLResult{static get FAILURE(){return shadow$1(this,"FAILURE",new _HTMLResult(!1,null,null,null))}static get EMPTY(){return shadow$1(this,"EMPTY",new _HTMLResult(!0,null,null,null))}constructor(t,e,s,i){this.success=t,this.html=e,this.bbox=s,this.breakNode=i}isBreak(){return!!this.breakNode}static breakNode(t){return new _HTMLResult(!1,null,null,t)}static success(t,e=null){return new _HTMLResult(!0,t,e,null)}},ih=class{constructor(t){this.fonts=new Map,this.cache=new Map,this.warned=new Set,this.defaultFont=null,this.add(t)}add(t,e=null){for(const e of t)this.addPdfFont(e);for(const t of this.fonts.values())t.regular||(t.regular=t.italic||t.bold||t.bolditalic);if(!e||0===e.size)return;const s=this.fonts.get("PdfJS-Fallback-PdfJS-XFA");for(const t of e)this.fonts.set(t,s)}addPdfFont(t){const e=t.cssFontInfo,s=e.fontFamily;let i=this.fonts.get(s);i||(i=Object.create(null),this.fonts.set(s,i),this.defaultFont||(this.defaultFont=i));let n="";const a=parseFloat(e.fontWeight);0!==parseFloat(e.italicAngle)?n=a>=700?"bolditalic":"italic":a>=700&&(n="bold"),n||((t.name.includes("Bold")||t.psName?.includes("Bold"))&&(n="bold"),(t.name.includes("Italic")||t.name.endsWith("It")||t.psName?.includes("Italic")||t.psName?.endsWith("It"))&&(n+="italic")),n||(n="regular"),i[n]=t}getDefault(){return this.defaultFont}find(t,e=!0){let s=this.fonts.get(t)||this.cache.get(t);if(s)return s;const i=/,|-|_| |bolditalic|bold|italic|regular|it/gi;let n=t.replaceAll(i,"");if(s=this.fonts.get(n),s)return this.cache.set(t,s),s;n=n.toLowerCase();const a=[];for(const[t,e]of this.fonts.entries())t.replaceAll(i,"").toLowerCase().startsWith(n)&&a.push(e);if(0===a.length)for(const[,t]of this.fonts.entries())t.regular.name?.replaceAll(i,"").toLowerCase().startsWith(n)&&a.push(t);if(0===a.length){n=n.replaceAll(/psmt|mt/gi,"");for(const[t,e]of this.fonts.entries())t.replaceAll(i,"").toLowerCase().startsWith(n)&&a.push(e)}if(0===a.length)for(const t of this.fonts.values())t.regular.name?.replaceAll(i,"").toLowerCase().startsWith(n)&&a.push(t);return a.length>=1?(1!==a.length&&e&&warn$1(`XFA - Too many choices to guess the correct font: ${t}`),this.cache.set(t,a[0]),a[0]):(e&&!this.warned.has(t)&&(this.warned.add(t),warn$1(`XFA - Cannot find the font: ${t}`)),null)}};function selectFont(t,e){return"italic"===t.posture?"bold"===t.weight?e.bolditalic:e.italic:"bold"===t.weight?e.bold:e.regular}var nh=class{constructor(t,e,s,i){if(this.lineHeight=s,this.paraMargin=e||{top:0,bottom:0,left:0,right:0},!t)return void([this.pdfFont,this.xfaFont]=this.defaultFont(i));this.xfaFont={typeface:t.typeface,posture:t.posture,weight:t.weight,size:t.size,letterSpacing:t.letterSpacing};const n=i.find(t.typeface);n?(this.pdfFont=selectFont(t,n),this.pdfFont||([this.pdfFont,this.xfaFont]=this.defaultFont(i))):[this.pdfFont,this.xfaFont]=this.defaultFont(i)}defaultFont(t){const e=t.find("Helvetica",!1)||t.find("Myriad Pro",!1)||t.find("Arial",!1)||t.getDefault();if(e?.regular){const t=e.regular;return[t,{typeface:t.cssFontInfo.fontFamily,posture:"normal",weight:"normal",size:10,letterSpacing:0}]}return[null,{typeface:"Courier",posture:"normal",weight:"normal",size:10,letterSpacing:0}]}},ah=class{constructor(t,e,s,i){this.fontFinder=i,this.stack=[new nh(t,e,s,i)]}pushData(t,e,s){const i=this.stack.at(-1);for(const e of["typeface","posture","weight","size","letterSpacing"])t[e]||(t[e]=i.xfaFont[e]);for(const t of["top","bottom","left","right"])isNaN(e[t])&&(e[t]=i.paraMargin[t]);const n=new nh(t,e,s||i.lineHeight,this.fontFinder);n.pdfFont||(n.pdfFont=i.pdfFont),this.stack.push(n)}popFont(){this.stack.pop()}topFont(){return this.stack.at(-1)}},rh=class{constructor(t,e,s,i){this.glyphs=[],this.fontSelector=new ah(t,e,s,i),this.extraHeight=0}pushData(t,e,s){this.fontSelector.pushData(t,e,s)}popFont(t){return this.fontSelector.popFont()}addPara(){const t=this.fontSelector.topFont();this.extraHeight+=t.paraMargin.top+t.paraMargin.bottom}addString(t){if(!t)return;const e=this.fontSelector.topFont(),s=e.xfaFont.size;if(e.pdfFont){const i=e.xfaFont.letterSpacing,n=e.pdfFont,a=n.lineHeight||1.2,r=e.lineHeight||Math.max(1.2,a)*s,o=a-(void 0===n.lineGap?.2:n.lineGap),l=Math.max(1,o)*s,c=s/1e3,h=n.defaultWidth||n.charsToGlyphs(" ")[0].width;for(const e of t.split(/[\u2029\n]/)){const t=n.encodeString(e).join(""),s=n.charsToGlyphs(t);for(const t of s){const e=t.width||h;this.glyphs.push([e*c+i,r,l,t.unicode,!1])}this.glyphs.push([0,0,0,"\n",!0])}return void this.glyphs.pop()}for(const e of t.split(/[\u2029\n]/)){for(const t of e.split(""))this.glyphs.push([s,1.2*s,s,t,!1]);this.glyphs.push([0,0,0,"\n",!0])}this.glyphs.pop()}compute(t){let e=-1,s=0,i=0,n=0,a=0,r=0,o=!1,l=!0;for(let c=0,h=this.glyphs.length;c<h;c++){const[h,u,d,f,g]=this.glyphs[c],p=" "===f,m=l?d:u;g?(i=Math.max(i,a),a=0,n+=r,r=m,e=-1,s=0,l=!1):p?a+h>t?(i=Math.max(i,a),a=0,n+=r,r=m,e=-1,s=0,o=!0,l=!1):(r=Math.max(m,r),s=a,a+=h,e=c):a+h>t?(n+=r,r=m,-1!==e?(c=e,i=Math.max(i,s),a=0,e=-1,s=0):(i=Math.max(i,a),a=h),o=!0,l=!1):(a+=h,r=Math.max(m,r))}return i=Math.max(i,a),n+=r+this.extraHeight,{width:1.02*i,height:n,isBroken:o}}},oh=/^[^.[]+/,lh=/^[^\]]+/,hh=0,uh=1,dh=2,fh=3,gh=4,ph=new Map([["$data",(t,e)=>t.datasets?t.datasets.data:t],["$record",(t,e)=>(t.datasets?t.datasets.data:t)[lc]()[0]],["$template",(t,e)=>t.template],["$connectionSet",(t,e)=>t.connectionSet],["$form",(t,e)=>t.form],["$layout",(t,e)=>t.layout],["$host",(t,e)=>t.host],["$dataWindow",(t,e)=>t.dataWindow],["$event",(t,e)=>t.event],["!",(t,e)=>t.datasets],["$xfa",(t,e)=>t],["xfa",(t,e)=>t],["$",(t,e)=>e]]),mh=new WeakMap;function parseIndex(t){return"*"===(t=t.trim())?1/0:parseInt(t,10)||0}function parseExpression(t,e,s=!0){let i=t.match(oh);if(!i)return null;let[n]=i;const a=[{name:n,cacheName:"."+n,index:0,js:null,formCalc:null,operator:hh}];let r=n.length;for(;r<t.length;){const o=r;if("["===t.charAt(r++)){if(i=t.slice(r).match(lh),!i)return warn$1("XFA - Invalid index in SOM expression"),null;a.at(-1).index=parseIndex(i[0]),r+=i[0].length+1;continue}let l;switch(t.charAt(r)){case".":if(!e)return null;r++,l=uh;break;case"#":r++,l=dh;break;case"[":if(s)return warn$1("XFA - SOM expression contains a FormCalc subexpression which is not supported for now."),null;l=fh;break;case"(":if(s)return warn$1("XFA - SOM expression contains a JavaScript subexpression which is not supported for now."),null;l=gh;break;default:l=hh}if(i=t.slice(r).match(oh),!i)break;[n]=i,r+=n.length,a.push({name:n,cacheName:t.slice(o,r),operator:l,index:0,js:null,formCalc:null})}return a}function searchNode(t,e,s,i=!0,n=!0){const a=parseExpression(s,i);if(!a)return null;const r=ph.get(a[0].name);let o,l=0;r?(o=!0,t=[r(t,e)],l=1):(o=null===e,t=[e||t]);for(let s=a.length;l<s;l++){const{name:s,cacheName:i,operator:r,index:c}=a[l],h=[];for(const e of t){if(!e.isXFAObject)continue;let t,a;if(n&&(a=mh.get(e),a||(a=new Map,mh.set(e,a)),t=a.get(i)),!t){switch(r){case hh:t=e[ic](s,!1);break;case uh:t=e[ic](s,!0);break;case dh:t=e[sc](s),t=t.isXFAObjectArray?t.children:[t]}n&&a.set(i,t)}t.length>0&&h.push(t)}if(0===h.length&&!o&&0===l){const s=e[dc]();if(!(e=s))return null;l=-1,t=[e];continue}t=isFinite(c)?h.filter(t=>c<t.length).map(t=>t[c]):h.flat()}return 0===t.length?null:t}function createDataNode(t,e,s){const i=parseExpression(s);if(!i)return null;if(i.some(t=>t.operator===uh))return null;const n=ph.get(i[0].name);let a=0;n?(t=n(t,e),a=1):t=e||t;for(let e=i.length;a<e;a++){const{name:e,operator:s,index:n}=i[a];if(!isFinite(n))return i[a].index=0,t.createNodes(i.slice(a));let r;switch(s){case hh:r=t[ic](e,!1);break;case uh:r=t[ic](e,!0);break;case dh:r=t[sc](e),r=r.isXFAObjectArray?r.children:[r]}if(0===r.length)return t.createNodes(i.slice(a));if(!(n<r.length))return i[a].index=n-r.length,t.createNodes(i.slice(a));{const e=r[n];if(!e.isXFAObject)return warn$1("XFA - Cannot create a node."),null;t=e}}return null}var bh=Symbol(),wh=Symbol(),yh=Symbol(),xh=Symbol("_children"),vh=Symbol(),Ah=Symbol(),kh=Symbol(),Sh=Symbol(),Ch=Symbol(),_h=Symbol(),Ih=Symbol(),Th=Symbol(),Mh=Symbol(),Eh=Symbol("parent"),Fh=Symbol(),Dh=Symbol(),Rh=Symbol(),Bh=0,Ph=Qc.datasets.id,Nh=class _XFAObject{constructor(t,e,s=!1){this[Mc]=t,this[Ec]=e,this[Ih]=s,this[Eh]=null,this[xh]=[],this[Jc]=`${e}${Bh++}`,this[gc]=null}get isXFAObject(){return!0}get isXFAObjectArray(){return!1}createNodes(t){let e=this,s=null;for(const{name:i,index:n}of t){for(let t=0,a=isFinite(n)?n:0;t<=a;t++){const t=e[Mc]===Ph?-1:e[Mc];s=new Uh(t,i),e[$l](s)}e=s}return s}[Dc](t){if(!this[Ih]||!this[Rc](t))return!1;const e=t[Ec],s=this[e];if(!(s instanceof Oh))return null!==s&&this[Lc](s),this[e]=t,this[$l](t),!0;if(s.push(t))return this[$l](t),!0;let i="";return this.id?i=` (id: ${this.id})`:this.name&&(i=` (name: ${this.name} ${this.h.value})`),warn$1(`XFA - node "${this[Ec]}"${i} has already enough "${e}"!`),!1}[Rc](t){return this.hasOwnProperty(t[Ec])&&t[Mc]===this[Mc]}[kc](){return!1}[Ll](){return!1}[yc](){return!1}[xc](){return!1}[Nc](){this.para&&this[fc]()[Yl].paraStack.pop()}[Oc](){this[fc]()[Yl].paraStack.push(this.para)}[jc](t){this.id&&this[Mc]===Qc.template.id&&t.set(this.id,this)}[fc](){return this[gc].template}[Sc](){return!1}[Cc](){return!1}[$l](t){t[Eh]=this,this[xh].push(t),!t[gc]&&this[gc]&&(t[gc]=this[gc])}[Lc](t){const e=this[xh].indexOf(t);this[xh].splice(e,1)}[pc](){return this.hasOwnProperty("value")}[zc](t){}[Bc](t){}[Jl](){}[jl](t){delete this[Ih],this[zl]&&(t.clean(this[zl]),delete this[zl])}[bc](t){return this[xh].indexOf(t)}[wc](t,e){e[Eh]=this,this[xh].splice(t,0,e),!e[gc]&&this[gc]&&(e[gc]=this[gc])}[_c](){return!this.name}[Tc](){return""}[Wc](){return 0===this[xh].length?this[Vl]:this[xh].map(t=>t[Wc]()).join("")}get[yh](){const t=Object.getPrototypeOf(this);if(!t._attributes){const e=t._attributes=new Set;for(const t of Object.getOwnPropertyNames(this)){if(null===this[t]||this[t]instanceof _XFAObject||this[t]instanceof Oh)break;e.add(t)}}return shadow$1(this,yh,t._attributes)}[Ac](t){let e=this;for(;e;){if(e===t)return!0;e=e[dc]()}return!1}[dc](){return this[Eh]}[uc](){return this[dc]()}[lc](t=null){return t?this[t]:this[xh]}[Kl](){const t=Object.create(null);this[Vl]&&(t.$content=this[Vl]);for(const e of Object.getOwnPropertyNames(this)){const s=this[e];null!==s&&(s instanceof _XFAObject?t[e]=s[Kl]():s instanceof Oh?s.isEmpty()||(t[e]=s.dump()):t[e]=s)}return t}[Yc](){return null}[Xc](){return sh.EMPTY}*[cc](){for(const t of this[lc]())yield t}*[Sh](t,e){for(const s of this[cc]())if(!t||e===t.has(s[Ec])){const t=this[ec](),e=s[Xc](t);e.success||(this[Yl].failingNode=s),yield e}}[Zl](){return null}[Ul](t,e){this[Yl].children.push(t)}[ec](){}[Hl]({filter:t=null,include:e=!0}){if(this[Yl].generator){const t=this[ec](),e=this[Yl].failingNode[Xc](t);if(!e.success)return e;e.html&&this[Ul](e.html,e.bbox),delete this[Yl].failingNode}else this[Yl].generator=this[Sh](t,e);for(;;){const t=this[Yl].generator.next();if(t.done)break;const e=t.value;if(!e.success)return e;e.html&&this[Ul](e.html,e.bbox)}return this[Yl].generator=null,sh.EMPTY}[qc](t){this[Dh]=new Set(Object.keys(t))}[_h](t){const e=this[yh],s=this[Dh];return[...t].filter(t=>e.has(t)&&!s.has(t))}[$c](t,e=new Set){for(const s of this[xh])s[Fh](t,e)}[Fh](t,e){const s=this[Ch](t,e);s?this[bh](s,t,e):this[$c](t,e)}[Ch](t,e){const{use:s,usehref:i}=this;if(!s&&!i)return null;let n=null,a=null,r=null,o=s;if(i?(o=i,i.startsWith("#som(")&&i.endsWith(")")?a=i.slice(5,-1):i.startsWith(".#som(")&&i.endsWith(")")?a=i.slice(6,-1):i.startsWith("#")?r=i.slice(1):i.startsWith(".#")&&(r=i.slice(2))):s.startsWith("#")?r=s.slice(1):a=s,this.use=this.usehref="",r?n=t.get(r):(n=searchNode(t.get(Uc),this,a,!0,!1),n&&(n=n[0])),!n)return warn$1(`XFA - Invalid prototype reference: ${o}.`),null;if(n[Ec]!==this[Ec])return warn$1(`XFA - Incompatible prototype: ${n[Ec]} !== ${this[Ec]}.`),null;if(e.has(n))return warn$1("XFA - Cycle detected in prototypes use."),null;e.add(n);const l=n[Ch](t,e);return l&&n[bh](l,t,e),n[$c](t,e),e.delete(n),n}[bh](t,e,s){if(s.has(t))warn$1("XFA - Cycle detected in prototypes use.");else{!this[Vl]&&t[Vl]&&(this[Vl]=t[Vl]),new Set(s).add(t);for(const e of this[_h](t[Dh]))this[e]=t[e],this[Dh]&&this[Dh].add(e);for(const i of Object.getOwnPropertyNames(this)){if(this[yh].has(i))continue;const n=this[i],a=t[i];if(n instanceof Oh){for(const t of n[xh])t[Fh](e,s);for(let i=n[xh].length,r=a[xh].length;i<r;i++){const a=t[xh][i][Gl]();if(!n.push(a))break;a[Eh]=this,this[xh].push(a),a[Fh](e,s)}}else if(null===n){if(null!==a){const t=a[Gl]();t[Eh]=this,this[i]=t,this[xh].push(t),t[Fh](e,s)}}else n[$c](e,s),a&&n[bh](a,e,s)}}}static[vh](t){return Array.isArray(t)?t.map(t=>_XFAObject[vh](t)):"object"==typeof t&&null!==t?Object.assign({},t):t}[Gl](){const t=Object.create(Object.getPrototypeOf(this));for(const e of Object.getOwnPropertySymbols(this))try{t[e]=this[e]}catch{shadow$1(t,e,this[e])}t[Jc]=`${t[Ec]}${Bh++}`,t[xh]=[];for(const e of Object.getOwnPropertyNames(this)){if(this[yh].has(e)){t[e]=_XFAObject[vh](this[e]);continue}const s=this[e];t[e]=s instanceof Oh?new Oh(s[Th]):null}for(const e of this[xh]){const s=e[Ec],i=e[Gl]();t[xh].push(i),i[Eh]=t,null===t[s]?t[s]=i:t[s][xh].push(i)}return t}[lc](t=null){return t?this[xh].filter(e=>e[Ec]===t):this[xh]}[sc](t){return this[t]}[ic](t,e,s=!0){return Array.from(this[nc](t,e,s))}*[nc](t,e,s=!0){if("parent"!==t){for(const s of this[xh])s[Ec]===t&&(yield s),s.name===t&&(yield s),(e||s[_c]())&&(yield*s[nc](t,e,!1));s&&this[yh].has(t)&&(yield new Lh(this,t,this[t]))}else yield this[Eh]}},Oh=class _XFAObjectArray{constructor(t=1/0){this[Th]=t,this[xh]=[]}get isXFAObject(){return!1}get isXFAObjectArray(){return!0}push(t){return this[xh].length<=this[Th]?(this[xh].push(t),!0):(warn$1(`XFA - node "${t[Ec]}" accepts no more than ${this[Th]} children`),!1)}isEmpty(){return 0===this[xh].length}dump(){return 1===this[xh].length?this[xh][0][Kl]():this[xh].map(t=>t[Kl]())}[Gl](){const t=new _XFAObjectArray(this[Th]);return t[xh]=this[xh].map(t=>t[Gl]()),t}get children(){return this[xh]}clear(){this[xh].length=0}},Lh=class{constructor(t,e,s){this[Eh]=t,this[Ec]=e,this[Vl]=s,this[Wl]=!1,this[Jc]="attribute"+Bh++}[dc](){return this[Eh]}[vc](){return!0}[ac](){return this[Vl].trim()}[zc](t){t=t.value||"",this[Vl]=t.toString()}[Wc](){return this[Vl]}[Ac](t){return this[Eh]===t||this[Eh][Ac](t)}},Uh=class _XmlObject extends Nh{constructor(t,e,s={}){if(super(t,e),this[Vl]="",this[Ah]=null,"#text"!==e){const t=new Map;this[wh]=t;for(const[e,i]of Object.entries(s))t.set(e,new Lh(this,e,i));if(s.hasOwnProperty(Fc)){const t=s[Fc].xfa.dataNode;void 0!==t&&("dataGroup"===t?this[Ah]=!1:"dataValue"===t&&(this[Ah]=!0))}}this[Wl]=!1}[Kc](t){const e=this[Ec];if("#text"===e)return void t.push(encodeToXmlString(this[Vl]));const s=utf8StringToString(e),i=this[Mc]===Ph?"xfa:":"";t.push(`<${i}${s}`);for(const[e,s]of this[wh].entries()){const i=utf8StringToString(e);t.push(` ${i}="${encodeToXmlString(s[Vl])}"`)}if(null!==this[Ah]&&(this[Ah]?t.push(' xfa:dataNode="dataValue"'):t.push(' xfa:dataNode="dataGroup"')),this[Vl]||0!==this[xh].length){if(t.push(">"),this[Vl])"string"==typeof this[Vl]?t.push(encodeToXmlString(this[Vl])):this[Vl][Kc](t);else for(const e of this[xh])e[Kc](t);t.push(`</${i}${s}>`)}else t.push("/>")}[Dc](t){if(this[Vl]){const t=new _XmlObject(this[Mc],"#text");this[$l](t),t[Vl]=this[Vl],this[Vl]=""}return this[$l](t),!0}[Bc](t){this[Vl]+=t}[Jl](){if(this[Vl]&&this[xh].length>0){const t=new _XmlObject(this[Mc],"#text");this[$l](t),t[Vl]=this[Vl],delete this[Vl]}}[Xc](){return"#text"===this[Ec]?sh.success({name:"#text",value:this[Vl]}):sh.EMPTY}[lc](t=null){return t?this[xh].filter(e=>e[Ec]===t):this[xh]}[tc](){return this[wh]}[sc](t){const e=this[wh].get(t);return void 0!==e?e:this[lc](t)}*[nc](t,e){const s=this[wh].get(t);s&&(yield s);for(const s of this[xh])s[Ec]===t&&(yield s),e&&(yield*s[nc](t,e))}*[Ql](t,e){const s=this[wh].get(t);!s||e&&s[Wl]||(yield s);for(const s of this[xh])yield*s[Ql](t,e)}*[oc](t,e,s){for(const i of this[xh])i[Ec]!==t||s&&i[Wl]||(yield i),e&&(yield*i[oc](t,e,s))}[vc](){return null===this[Ah]?0===this[xh].length||this[xh][0][Mc]===Qc.xhtml.id:this[Ah]}[ac](){return null===this[Ah]?0===this[xh].length?this[Vl].trim():this[xh][0][Mc]===Qc.xhtml.id?this[xh][0][Wc]().trim():null:this[Vl].trim()}[zc](t){t=t.value||"",this[Vl]=t.toString()}[Kl](t=!1){const e=Object.create(null);t&&(e.$ns=this[Mc]),this[Vl]&&(e.$content=this[Vl]),e.$name=this[Ec],e.children=[];for(const s of this[xh])e.children.push(s[Kl](t));e.attributes=Object.create(null);for(const[t,s]of this[wh])e.attributes[t]=s[Vl];return e}},$h=class extends Nh{constructor(t,e){super(t,e),this[Vl]=""}[Bc](t){this[Vl]+=t}[Jl](){}},Hh=class extends $h{constructor(t,e,s){super(t,e),this[Mh]=s}[Jl](){this[Vl]=getKeyword({data:this[Vl],defaultValue:this[Mh][0],validate:t=>this[Mh].includes(t)})}[jl](t){super[jl](t),delete this[Mh]}},jh=class extends $h{[Jl](){this[Vl]=this[Vl].trim()}},qh=class extends $h{constructor(t,e,s,i){super(t,e),this[kh]=s,this[Rh]=i}[Jl](){this[Vl]=getInteger({data:this[Vl],defaultValue:this[kh],validate:this[Rh]})}[jl](t){super[jl](t),delete this[kh],delete this[Rh]}},zh=class extends qh{constructor(t,e){super(t,e,0,t=>1===t)}},Gh=class extends qh{constructor(t,e){super(t,e,1,t=>0===t)}};function measureToString(t){return"string"==typeof t?"0px":Number.isInteger(t)?`${t}px`:`${t.toFixed(2)}px`}var Wh={anchorType(t,e){const s=t[uc]();if(s&&(!s.layout||"position"===s.layout))switch("transform"in e||(e.transform=""),t.anchorType){case"bottomCenter":e.transform+="translate(-50%, -100%)";break;case"bottomLeft":e.transform+="translate(0,-100%)";break;case"bottomRight":e.transform+="translate(-100%,-100%)";break;case"middleCenter":e.transform+="translate(-50%,-50%)";break;case"middleLeft":e.transform+="translate(0,-50%)";break;case"middleRight":e.transform+="translate(-100%,-50%)";break;case"topCenter":e.transform+="translate(-50%,0)";break;case"topRight":e.transform+="translate(-100%,0)"}},dimensions(t,e){const s=t[uc]();let i=t.w;const n=t.h;if(s.layout?.includes("row")){const e=s[Yl],n=t.colSpan;let a;-1===n?(a=Math.sumPrecise(e.columnWidths.slice(e.currentColumn)),e.currentColumn=0):(a=Math.sumPrecise(e.columnWidths.slice(e.currentColumn,e.currentColumn+n)),e.currentColumn=(e.currentColumn+t.colSpan)%e.columnWidths.length),isNaN(a)||(i=t.w=a)}e.width=""!==i?measureToString(i):"auto",e.height=""!==n?measureToString(n):"auto"},position(t,e){const s=t[uc]();s?.layout&&"position"!==s.layout||(e.position="absolute",e.left=measureToString(t.x),e.top=measureToString(t.y))},rotate(t,e){t.rotate&&("transform"in e||(e.transform=""),e.transform+=`rotate(-${t.rotate}deg)`,e.transformOrigin="top left")},presence(t,e){switch(t.presence){case"invisible":e.visibility="hidden";break;case"hidden":case"inactive":e.display="none"}},hAlign(t,e){if("para"===t[Ec])switch(t.hAlign){case"justifyAll":e.textAlign="justify-all";break;case"radix":e.textAlign="left";break;default:e.textAlign=t.hAlign}else switch(t.hAlign){case"left":e.alignSelf="start";break;case"center":e.alignSelf="center";break;case"right":e.alignSelf="end"}},margin(t,e){t.margin&&(e.margin=t.margin[Yc]().margin)}};function setMinMaxDimensions(t,e){"position"===t[uc]().layout&&(t.minW>0&&(e.minWidth=measureToString(t.minW)),t.maxW>0&&(e.maxWidth=measureToString(t.maxW)),t.minH>0&&(e.minHeight=measureToString(t.minH)),t.maxH>0&&(e.maxHeight=measureToString(t.maxH)))}function layoutText(t,e,s,i,n,a){const r=new rh(e,s,i,n);return"string"==typeof t?r.addString(t):t[Pc](r),r.compute(a)}function layoutNode(t,e){let s=null,i=null,n=!1;if((!t.w||!t.h)&&t.value){let a=0,r=0;t.margin&&(a=t.margin.leftInset+t.margin.rightInset,r=t.margin.topInset+t.margin.bottomInset);let o=null,l=null;t.para&&(l=Object.create(null),o=""===t.para.lineHeight?null:t.para.lineHeight,l.top=""===t.para.spaceAbove?0:t.para.spaceAbove,l.bottom=""===t.para.spaceBelow?0:t.para.spaceBelow,l.left=""===t.para.marginLeft?0:t.para.marginLeft,l.right=""===t.para.marginRight?0:t.para.marginRight);let c=t.font;if(!c){const e=t[fc]();let s=t[dc]();for(;s&&s!==e;){if(s.font){c=s.font;break}s=s[dc]()}}const h=(t.w||e.width)-a,u=t[gc].fontFinder;if(t.value.exData&&t.value.exData[Vl]&&"text/html"===t.value.exData.contentType){const e=layoutText(t.value.exData[Vl],c,l,o,u,h);i=e.width,s=e.height,n=e.isBroken}else{const e=t.value[Wc]();if(e){const t=layoutText(e,c,l,o,u,h);i=t.width,s=t.height,n=t.isBroken}}null===i||t.w||(i+=a),null===s||t.h||(s+=r)}return{w:i,h:s,isBroken:n}}function computeBbox(t,e,s){let i;if(""!==t.w&&""!==t.h)i=[t.x,t.y,t.w,t.h];else{if(!s)return null;let n=t.w;if(""===n){if(0===t.maxW){const e=t[uc]();n="position"===e.layout&&""!==e.w?0:t.minW}else n=Math.min(t.maxW,s.width);e.attributes.style.width=measureToString(n)}let a=t.h;if(""===a){if(0===t.maxH){const e=t[uc]();a="position"===e.layout&&""!==e.h?0:t.minH}else a=Math.min(t.maxH,s.height);e.attributes.style.height=measureToString(a)}i=[t.x,t.y,n,a]}return i}function fixDimensions(t){const e=t[uc]();if(e.layout?.includes("row")){const s=e[Yl],i=t.colSpan;let n;n=-1===i?Math.sumPrecise(s.columnWidths.slice(s.currentColumn)):Math.sumPrecise(s.columnWidths.slice(s.currentColumn,s.currentColumn+i)),isNaN(n)||(t.w=n)}e.layout&&"position"!==e.layout&&(t.x=t.y=0),"table"===t.layout&&""===t.w&&Array.isArray(t.columnWidths)&&(t.w=Math.sumPrecise(t.columnWidths))}function layoutClass(t){switch(t.layout){case"position":default:return"xfaPosition";case"lr-tb":return"xfaLrTb";case"rl-row":return"xfaRlRow";case"rl-tb":return"xfaRlTb";case"row":return"xfaRow";case"table":return"xfaTable";case"tb":return"xfaTb"}}function toStyle(t,...e){const s=Object.create(null);for(const i of e){const e=t[i];if(null!==e)if(Wh.hasOwnProperty(i))Wh[i](t,s);else if(e instanceof Nh){const t=e[Yc]();t?Object.assign(s,t):warn$1(`(DEBUG) - XFA - style for ${i} not implemented yet`)}}return s}function createWrapper(t,e){const{attributes:s}=e,{style:i}=s,n={name:"div",attributes:{class:["xfaWrapper"],style:Object.create(null)},children:[]};if(s.class.push("xfaWrapped"),t.border){const{widths:s,insets:a}=t.border[Yl];let r,o,l=a[0],c=a[3];const h=a[0]+a[2],u=a[1]+a[3];switch(t.border.hand){case"even":l-=s[0]/2,c-=s[3]/2,r=`calc(100% + ${(s[1]+s[3])/2-u}px)`,o=`calc(100% + ${(s[0]+s[2])/2-h}px)`;break;case"left":l-=s[0],c-=s[3],r=`calc(100% + ${s[1]+s[3]-u}px)`,o=`calc(100% + ${s[0]+s[2]-h}px)`;break;case"right":r=u?`calc(100% - ${u}px)`:"100%",o=h?`calc(100% - ${h}px)`:"100%"}const d=["xfaBorder"];isPrintOnly(t.border)&&d.push("xfaPrintOnly");const f={name:"div",attributes:{class:d,style:{top:`${l}px`,left:`${c}px`,width:r,height:o}},children:[]};for(const t of["border","borderWidth","borderColor","borderRadius","borderStyle"])void 0!==i[t]&&(f.attributes.style[t]=i[t],delete i[t]);n.children.push(f,e)}else n.children.push(e);for(const t of["background","backgroundClip","top","left","width","height","minWidth","minHeight","maxWidth","maxHeight","transform","transformOrigin","visibility"])void 0!==i[t]&&(n.attributes.style[t]=i[t],delete i[t]);return n.attributes.style.position="absolute"===i.position?"absolute":"relative",delete i.position,i.alignSelf&&(n.attributes.style.alignSelf=i.alignSelf,delete i.alignSelf),n}function fixTextIndent(t){const e=getMeasurement(t.textIndent,"0px");if(e>=0)return;const s="padding"+("left"==("right"===t.textAlign?"right":"left")?"Left":"Right"),i=getMeasurement(t[s],"0px");t[s]=i-e+"px"}function setAccess(t,e){switch(t.access){case"nonInteractive":e.push("xfaNonInteractive");break;case"readOnly":e.push("xfaReadOnly");break;case"protected":e.push("xfaDisabled")}}function isPrintOnly(t){return t.relevant.length>0&&!t.relevant[0].excluded&&"print"===t.relevant[0].viewname}function getCurrentPara(t){const e=t[fc]()[Yl].paraStack;return e.length?e.at(-1):null}function setPara(t,e,s){if(s.attributes.class?.includes("xfaRich")){e&&(""===t.h&&(e.height="auto"),""===t.w&&(e.width="auto"));const i=getCurrentPara(t);if(i){const t=s.attributes.style;switch(t.display="flex",t.flexDirection="column",i.vAlign){case"top":t.justifyContent="start";break;case"bottom":t.justifyContent="end";break;case"middle":t.justifyContent="center"}const e=i[Yc]();for(const[s,i]of Object.entries(e))s in t||(t[s]=i)}}}function setFontFamily(t,e,s,i){if(!s)return void delete i.fontFamily;const n=stripQuotes(t.typeface);i.fontFamily=`"${n}"`;const a=s.find(n);if(a){const{fontFamily:s}=a.regular.cssFontInfo;s!==n&&(i.fontFamily=`"${s}"`);const r=getCurrentPara(e);if(r&&""!==r.lineHeight)return;if(i.lineHeight)return;const o=selectFont(t,a);o&&(i.lineHeight=Math.max(1.2,o.lineHeight))}}function fixURL(t){const e=createValidAbsoluteUrl$1(t,null,{addDefaultProtocol:!0,tryConvertEncoding:!0});return e?e.href:null}function createLine(t,e){return{name:"div",attributes:{class:["lr-tb"===t.layout?"xfaLr":"xfaRl"]},children:e}}function flushHTML(t){if(!t[Yl])return null;const e={name:"div",attributes:t[Yl].attributes,children:t[Yl].children};if(t[Yl].failingNode){const s=t[Yl].failingNode[Zl]();s&&(t.layout.endsWith("-tb")?e.children.push(createLine(t,[s])):e.children.push(s))}return 0===e.children.length?null:e}function addHTML(t,e,s){const i=t[Yl],n=i.availableSpace,[a,r,o,l]=s;switch(t.layout){case"position":i.width=Math.max(i.width,a+o),i.height=Math.max(i.height,r+l),i.children.push(e);break;case"lr-tb":case"rl-tb":i.line&&1!==i.attempt||(i.line=createLine(t,[]),i.children.push(i.line),i.numberInLine=0),i.numberInLine+=1,i.line.children.push(e),0===i.attempt?(i.currentWidth+=o,i.height=Math.max(i.height,i.prevHeight+l)):(i.currentWidth=o,i.prevHeight=i.height,i.height+=l,i.attempt=0),i.width=Math.max(i.width,i.currentWidth);break;case"rl-row":case"row":{i.children.push(e),i.width+=o,i.height=Math.max(i.height,l);const t=measureToString(i.height);for(const e of i.children)e.attributes.style.height=t;break}case"table":case"tb":i.width=MathClamp$1(o,i.width,n.width),i.height+=l,i.children.push(e)}}function getAvailableSpace(t){const e=t[Yl].availableSpace,s=t.margin?t.margin.topInset+t.margin.bottomInset:0,i=t.margin?t.margin.leftInset+t.margin.rightInset:0;switch(t.layout){case"lr-tb":case"rl-tb":return 0===t[Yl].attempt?{width:e.width-i-t[Yl].currentWidth,height:e.height-s-t[Yl].prevHeight}:{width:e.width-i,height:e.height-s-t[Yl].height};case"rl-row":case"row":return{width:Math.sumPrecise(t[Yl].columnWidths.slice(t[Yl].currentColumn)),height:e.height-i};case"table":case"tb":return{width:e.width-i,height:e.height-s-t[Yl].height};default:return e}}function checkDimensions(t,e){if(null===t[fc]()[Yl].firstUnsplittable)return!0;if(0===t.w||0===t.h)return!0;const s=t[uc](),i=s[Yl]?.attempt||0,[,n,a,r]=function(t){let e,s,i=""===t.w?NaN:t.w,n=""===t.h?NaN:t.h,[a,r]=[0,0];switch(t.anchorType||""){case"bottomCenter":[a,r]=[i/2,n];break;case"bottomLeft":[a,r]=[0,n];break;case"bottomRight":[a,r]=[i,n];break;case"middleCenter":[a,r]=[i/2,n/2];break;case"middleLeft":[a,r]=[0,n/2];break;case"middleRight":[a,r]=[i,n/2];break;case"topCenter":[a,r]=[i/2,0];break;case"topRight":[a,r]=[i,0]}switch(t.rotate||0){case 0:[e,s]=[-a,-r];break;case 90:[e,s]=[-r,a],[i,n]=[n,-i];break;case 180:[e,s]=[a,r],[i,n]=[-i,-n];break;case 270:[e,s]=[r,-a],[i,n]=[-n,i]}return[t.x+e+Math.min(0,i),t.y+s+Math.min(0,n),Math.abs(i),Math.abs(n)]}(t);switch(s.layout){case"lr-tb":case"rl-tb":return 0===i?t[fc]()[Yl].noLayoutFailure?""!==t.w?Math.round(a-e.width)<=2:e.width>2:!(""!==t.h&&Math.round(r-e.height)>2)&&(""!==t.w?Math.round(a-e.width)<=2||0===s[Yl].numberInLine&&e.height>2:e.width>2):!!t[fc]()[Yl].noLayoutFailure||!(""!==t.h&&Math.round(r-e.height)>2)&&(""===t.w||Math.round(a-e.width)<=2||!s[Cc]())&&e.height>2;case"table":case"tb":return!!t[fc]()[Yl].noLayoutFailure||(""===t.h||t[Sc]()?(""===t.w||Math.round(a-e.width)<=2||!s[Cc]())&&e.height>2:Math.round(r-e.height)<=2);case"position":return!!t[fc]()[Yl].noLayoutFailure||(""===t.h||Math.round(r+n-e.height)<=2||r+n>t[fc]()[Yl].currentContentArea.h);case"rl-row":case"row":return!!t[fc]()[Yl].noLayoutFailure||""===t.h||Math.round(r-e.height)<=2;default:return!0}}var Vh=Qc.template.id,Xh="http://www.w3.org/2000/svg",Kh=/^H(\d+)$/,Yh=new Set(["image/gif","image/jpeg","image/jpg","image/pjpeg","image/png","image/apng","image/x-png","image/bmp","image/x-ms-bmp","image/tiff","image/tif","application/octet-stream"]),Jh=[[[66,77],"image/bmp"],[[255,216,255],"image/jpeg"],[[73,73,42,0],"image/tiff"],[[77,77,0,42],"image/tiff"],[[71,73,70,56,57,97],"image/gif"],[[137,80,78,71,13,10,26,10],"image/png"]];function getBorderDims(t){if(!t||!t.border)return{w:0,h:0};const e=t.border[rc]();return e?{w:e.widths[0]+e.widths[2]+e.insets[0]+e.insets[2],h:e.widths[1]+e.widths[3]+e.insets[1]+e.insets[3]}:{w:0,h:0}}function hasMargin(t){return t.margin&&(t.margin.topInset||t.margin.rightInset||t.margin.bottomInset||t.margin.leftInset)}function _setValue(t,e){if(!t.value){const e=new ef({});t[$l](e),t.value=e}t.value[zc](e)}function*getContainedChildren(t){for(const e of t[lc]())e instanceof Hd?yield*e[cc]():yield e}function isRequired(t){return"error"===t.validate?.nullTest}function setTabIndex(t){for(;t;){if(!t.traversal)return void(t[Gc]=t[dc]()[Gc]);if(t[Gc])return;let e=null;for(const s of t.traversal[lc]())if("next"===s.operation){e=s;break}if(!e||!e.ref)return void(t[Gc]=t[dc]()[Gc]);const s=t[fc]();t[Gc]=++s[Gc];const i=s[Hc](e.ref,t);if(!i)return;t=i[0]}}function applyAssist(t,e){const s=t.assist;if(s){const t=s[Xc]();t&&(e.title=t);const i=s.role.match(Kh);if(i){const t="heading",s=i[1];e.role=t,e["aria-level"]=s}}if("table"===t.layout)e.role="table";else if("row"===t.layout)e.role="row";else{const s=t[dc]();"row"===s.layout&&(e.role="TH"===s.assist?.role?"columnheader":"cell")}}function ariaLabel(t){if(!t.assist)return null;const e=t.assist;return e.speak&&""!==e.speak[Vl]?e.speak[Vl]:e.toolTip?e.toolTip[Vl]:null}function valueToHtml(t){return sh.success({name:"div",attributes:{class:["xfaRich"],style:Object.create(null)},children:[{name:"span",attributes:{style:Object.create(null)},value:t}]})}function setFirstUnsplittable(t){const e=t[fc]();null===e[Yl].firstUnsplittable&&(e[Yl].firstUnsplittable=t,e[Yl].noLayoutFailure=!0)}function unsetFirstUnsplittable(t){const e=t[fc]();e[Yl].firstUnsplittable===t&&(e[Yl].noLayoutFailure=!1)}function handleBreak(t){if(t[Yl])return!1;if(t[Yl]=Object.create(null),"auto"===t.targetType)return!1;const e=t[fc]();let s=null;if(t.target){if(s=e[Hc](t.target,t[dc]()),!s)return!1;s=s[0]}const{currentPageArea:i,currentContentArea:n}=e[Yl];if("pageArea"===t.targetType)return s instanceof xd||(s=null),t.startNew?(t[Yl].target=s||i,!0):!(!s||s===i||(t[Yl].target=s,0));s instanceof vu||(s=null);const a=s&&s[dc]();let r,o=a;if(t.startNew)if(s){const t=a.contentArea.children,e=t.indexOf(n),i=t.indexOf(s);-1!==e&&e<i&&(o=null),r=i-1}else r=i.contentArea.children.indexOf(n);else{if(!s||s===n)return!1;r=a.contentArea.children.indexOf(s)-1,o=a===i?null:a}return t[Yl].target=o,t[Yl].index=r,!0}function handleOverflow(t,e,s){const i=t[fc](),n=i[Yl].noLayoutFailure,a=e[uc];e[uc]=()=>t,i[Yl].noLayoutFailure=!0;const r=e[Xc](s);t[Ul](r.html,r.bbox),i[Yl].noLayoutFailure=n,e[uc]=a}var Zh=class extends jh{constructor(t){super(Vh,"appearanceFilter"),this.id=t.id||"",this.type=getStringOption(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||""}},Qh=class extends Nh{constructor(t){super(Vh,"arc",!0),this.circular=getInteger({data:t.circular,defaultValue:0,validate:t=>1===t}),this.hand=getStringOption(t.hand,["even","left","right"]),this.id=t.id||"",this.startAngle=getFloat({data:t.startAngle,defaultValue:0,validate:t=>!0}),this.sweepAngle=getFloat({data:t.sweepAngle,defaultValue:360,validate:t=>!0}),this.use=t.use||"",this.usehref=t.usehref||"",this.edge=null,this.fill=null}[Xc](){const t=this.edge||new Du({}),e=t[Yc](),s=Object.create(null);let i;"visible"===this.fill?.presence?Object.assign(s,this.fill[Yc]()):s.fill="transparent",s.strokeWidth=measureToString("visible"===t.presence?t.thickness:0),s.stroke=e.color;const n={xmlns:Xh,style:{width:"100%",height:"100%",overflow:"visible"}};if(360===this.sweepAngle)i={name:"ellipse",attributes:{xmlns:Xh,cx:"50%",cy:"50%",rx:"50%",ry:"50%",style:s}};else{const t=this.startAngle*Math.PI/180,e=this.sweepAngle*Math.PI/180,a=this.sweepAngle>180?1:0,[r,o,l,c]=[50*(1+Math.cos(t)),50*(1-Math.sin(t)),50*(1+Math.cos(t+e)),50*(1-Math.sin(t+e))];i={name:"path",attributes:{xmlns:Xh,d:`M ${r} ${o} A 50 50 0 ${a} 0 ${l} ${c}`,vectorEffect:"non-scaling-stroke",style:s}},Object.assign(n,{viewBox:"0 0 100 100",preserveAspectRatio:"none"})}const a={name:"svg",children:[i],attributes:n};return hasMargin(this[dc]()[dc]())?sh.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[a]}):(a.attributes.style.position="absolute",sh.success(a))}},tu=class extends Nh{constructor(t){super(Vh,"area",!0),this.colSpan=getInteger({data:t.colSpan,defaultValue:1,validate:t=>t>=1||-1===t}),this.id=t.id||"",this.name=t.name||"",this.relevant=getRelevant(t.relevant),this.use=t.use||"",this.usehref=t.usehref||"",this.x=getMeasurement(t.x,"0pt"),this.y=getMeasurement(t.y,"0pt"),this.desc=null,this.extras=null,this.area=new Oh,this.draw=new Oh,this.exObject=new Oh,this.exclGroup=new Oh,this.field=new Oh,this.subform=new Oh,this.subformSet=new Oh}*[cc](){yield*getContainedChildren(this)}[_c](){return!0}[xc](){return!0}[Ul](t,e){const[s,i,n,a]=e;this[Yl].width=Math.max(this[Yl].width,s+n),this[Yl].height=Math.max(this[Yl].height,i+a),this[Yl].children.push(t)}[ec](){return this[Yl].availableSpace}[Xc](t){const e=toStyle(this,"position"),s={style:e,id:this[Jc],class:["xfaArea"]};isPrintOnly(this)&&s.class.push("xfaPrintOnly"),this.name&&(s.xfaName=this.name);const i=[];this[Yl]={children:i,width:0,height:0,availableSpace:t};const n=this[Hl]({filter:new Set(["area","draw","field","exclGroup","subform","subformSet"]),include:!0});if(!n.success)return n.isBreak()?n:(delete this[Yl],sh.FAILURE);e.width=measureToString(this[Yl].width),e.height=measureToString(this[Yl].height);const a={name:"div",attributes:s,children:i},r=[this.x,this.y,this[Yl].width,this[Yl].height];return delete this[Yl],sh.success(a,r)}},eu=class extends Nh{constructor(t){super(Vh,"assist",!0),this.id=t.id||"",this.role=t.role||"",this.use=t.use||"",this.usehref=t.usehref||"",this.speak=null,this.toolTip=null}[Xc](){return this.toolTip?.[Vl]||null}},su=class extends Nh{constructor(t){super(Vh,"barcode",!0),this.charEncoding=getKeyword({data:t.charEncoding?t.charEncoding.toLowerCase():"",defaultValue:"",validate:t=>["utf-8","big-five","fontspecific","gbk","gb-18030","gb-2312","ksc-5601","none","shift-jis","ucs-2","utf-16"].includes(t)||t.match(/iso-8859-\d{2}/)}),this.checksum=getStringOption(t.checksum,["none","1mod10","1mod10_1mod11","2mod10","auto"]),this.dataColumnCount=getInteger({data:t.dataColumnCount,defaultValue:-1,validate:t=>t>=0}),this.dataLength=getInteger({data:t.dataLength,defaultValue:-1,validate:t=>t>=0}),this.dataPrep=getStringOption(t.dataPrep,["none","flateCompress"]),this.dataRowCount=getInteger({data:t.dataRowCount,defaultValue:-1,validate:t=>t>=0}),this.endChar=t.endChar||"",this.errorCorrectionLevel=getInteger({data:t.errorCorrectionLevel,defaultValue:-1,validate:t=>t>=0&&t<=8}),this.id=t.id||"",this.moduleHeight=getMeasurement(t.moduleHeight,"5mm"),this.moduleWidth=getMeasurement(t.moduleWidth,"0.25mm"),this.printCheckDigit=getInteger({data:t.printCheckDigit,defaultValue:0,validate:t=>1===t}),this.rowColumnRatio=getRatio(t.rowColumnRatio),this.startChar=t.startChar||"",this.textLocation=getStringOption(t.textLocation,["below","above","aboveEmbedded","belowEmbedded","none"]),this.truncate=getInteger({data:t.truncate,defaultValue:0,validate:t=>1===t}),this.type=getStringOption(t.type?t.type.toLowerCase():"",["aztec","codabar","code2of5industrial","code2of5interleaved","code2of5matrix","code2of5standard","code3of9","code3of9extended","code11","code49","code93","code128","code128a","code128b","code128c","code128sscc","datamatrix","ean8","ean8add2","ean8add5","ean13","ean13add2","ean13add5","ean13pwcd","fim","logmars","maxicode","msi","pdf417","pdf417macro","plessey","postauscust2","postauscust3","postausreplypaid","postausstandard","postukrm4scc","postusdpbc","postusimb","postusstandard","postus5zip","qrcode","rfid","rss14","rss14expanded","rss14limited","rss14stacked","rss14stackedomni","rss14truncated","telepen","ucc128","ucc128random","ucc128sscc","upca","upcaadd2","upcaadd5","upcapwcd","upce","upceadd2","upceadd5","upcean2","upcean5","upsmaxicode"]),this.upsMode=getStringOption(t.upsMode,["usCarrier","internationalCarrier","secureSymbol","standardSymbol"]),this.use=t.use||"",this.usehref=t.usehref||"",this.wideNarrowRatio=getRatio(t.wideNarrowRatio),this.encrypt=null,this.extras=null}},iu=class extends Nh{constructor(t){super(Vh,"bind",!0),this.match=getStringOption(t.match,["once","dataRef","global","none"]),this.ref=t.ref||"",this.picture=null}},nu=class extends Nh{constructor(t){super(Vh,"bindItems"),this.connection=t.connection||"",this.labelRef=t.labelRef||"",this.ref=t.ref||"",this.valueRef=t.valueRef||""}},au=class extends Nh{constructor(t){super(Vh,"bookend"),this.id=t.id||"",this.leader=t.leader||"",this.trailer=t.trailer||"",this.use=t.use||"",this.usehref=t.usehref||""}},ru=class extends zh{constructor(t){super(Vh,"boolean"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}[Xc](t){return valueToHtml(1===this[Vl]?"1":"0")}},ou=class extends Nh{constructor(t){super(Vh,"border",!0),this.break=getStringOption(t.break,["close","open"]),this.hand=getStringOption(t.hand,["even","left","right"]),this.id=t.id||"",this.presence=getStringOption(t.presence,["visible","hidden","inactive","invisible"]),this.relevant=getRelevant(t.relevant),this.use=t.use||"",this.usehref=t.usehref||"",this.corner=new Oh(4),this.edge=new Oh(4),this.extras=null,this.fill=null,this.margin=null}[rc](){if(!this[Yl]){const t=this.edge.children.slice();if(t.length<4){const e=t.at(-1)||new Du({});for(let s=t.length;s<4;s++)t.push(e)}const e=t.map(t=>t.thickness),s=[0,0,0,0];this.margin&&(s[0]=this.margin.topInset,s[1]=this.margin.rightInset,s[2]=this.margin.bottomInset,s[3]=this.margin.leftInset),this[Yl]={widths:e,insets:s,edges:t}}return this[Yl]}[Yc](){const{edges:t}=this[rc](),e=t.map(t=>{const e=t[Yc]();return e.color||="#000000",e}),s=Object.create(null);if(this.margin&&Object.assign(s,this.margin[Yc]()),"visible"===this.fill?.presence&&Object.assign(s,this.fill[Yc]()),this.corner.children.some(t=>0!==t.radius)){const t=this.corner.children.map(t=>t[Yc]());if(2===t.length||3===t.length){const e=t.at(-1);for(let s=t.length;s<4;s++)t.push(e)}s.borderRadius=t.map(t=>t.radius).join(" ")}switch(this.presence){case"invisible":case"hidden":s.borderStyle="";break;case"inactive":s.borderStyle="none";break;default:s.borderStyle=e.map(t=>t.style).join(" ")}return s.borderWidth=e.map(t=>t.width).join(" "),s.borderColor=e.map(t=>t.color).join(" "),s}},lu=class extends Nh{constructor(t){super(Vh,"break",!0),this.after=getStringOption(t.after,["auto","contentArea","pageArea","pageEven","pageOdd"]),this.afterTarget=t.afterTarget||"",this.before=getStringOption(t.before,["auto","contentArea","pageArea","pageEven","pageOdd"]),this.beforeTarget=t.beforeTarget||"",this.bookendLeader=t.bookendLeader||"",this.bookendTrailer=t.bookendTrailer||"",this.id=t.id||"",this.overflowLeader=t.overflowLeader||"",this.overflowTarget=t.overflowTarget||"",this.overflowTrailer=t.overflowTrailer||"",this.startNew=getInteger({data:t.startNew,defaultValue:0,validate:t=>1===t}),this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null}},cu=class extends Nh{constructor(t){super(Vh,"breakAfter",!0),this.id=t.id||"",this.leader=t.leader||"",this.startNew=getInteger({data:t.startNew,defaultValue:0,validate:t=>1===t}),this.target=t.target||"",this.targetType=getStringOption(t.targetType,["auto","contentArea","pageArea"]),this.trailer=t.trailer||"",this.use=t.use||"",this.usehref=t.usehref||"",this.script=null}},hu=class extends Nh{constructor(t){super(Vh,"breakBefore",!0),this.id=t.id||"",this.leader=t.leader||"",this.startNew=getInteger({data:t.startNew,defaultValue:0,validate:t=>1===t}),this.target=t.target||"",this.targetType=getStringOption(t.targetType,["auto","contentArea","pageArea"]),this.trailer=t.trailer||"",this.use=t.use||"",this.usehref=t.usehref||"",this.script=null}[Xc](t){return this[Yl]={},sh.FAILURE}},uu=class extends Nh{constructor(t){super(Vh,"button",!0),this.highlight=getStringOption(t.highlight,["inverted","none","outline","push"]),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null}[Xc](t){const e=this[dc]()[dc](),s={name:"button",attributes:{id:this[Jc],class:["xfaButton"],style:{}},children:[]};for(const t of e.event.children){if("click"!==t.activity||!t.script)continue;const e=recoverJsURL(t.script[Vl]);if(!e)continue;const i=fixURL(e.url);i&&s.children.push({name:"a",attributes:{id:"link"+this[Jc],href:i,newWindow:e.newWindow,class:["xfaLink"],style:{}},children:[]})}return sh.success(s)}},du=class extends Nh{constructor(t){super(Vh,"calculate",!0),this.id=t.id||"",this.override=getStringOption(t.override,["disabled","error","ignore","warning"]),this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.message=null,this.script=null}},fu=class extends Nh{constructor(t){super(Vh,"caption",!0),this.id=t.id||"",this.placement=getStringOption(t.placement,["left","bottom","inline","right","top"]),this.presence=getStringOption(t.presence,["visible","hidden","inactive","invisible"]),this.reserve=Math.ceil(getMeasurement(t.reserve)),this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.font=null,this.margin=null,this.para=null,this.value=null}[zc](t){_setValue(this,t)}[rc](t){if(!this[Yl]){let{width:e,height:s}=t;switch(this.placement){case"left":case"right":case"inline":e=this.reserve<=0?e:this.reserve;break;case"top":case"bottom":s=this.reserve<=0?s:this.reserve}this[Yl]=layoutNode(this,{width:e})}return this[Yl]}[Xc](t){if(!this.value)return sh.EMPTY;this[Oc]();const e=this.value[Xc](t).html;if(!e)return this[Nc](),sh.EMPTY;const s=this.reserve;if(this.reserve<=0){const{w:e,h:s}=this[rc](t);switch(this.placement){case"left":case"right":case"inline":this.reserve=e;break;case"top":case"bottom":this.reserve=s}}const i=[];"string"==typeof e?i.push({name:"#text",value:e}):i.push(e);const n=toStyle(this,"font","margin","visibility");switch(this.placement){case"left":case"right":this.reserve>0&&(n.width=measureToString(this.reserve));break;case"top":case"bottom":this.reserve>0&&(n.height=measureToString(this.reserve))}return setPara(this,null,e),this[Nc](),this.reserve=s,sh.success({name:"div",attributes:{style:n,class:["xfaCaption"]},children:i})}},gu=class extends jh{constructor(t){super(Vh,"certificate"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}},pu=class extends Nh{constructor(t){super(Vh,"certificates",!0),this.credentialServerPolicy=getStringOption(t.credentialServerPolicy,["optional","required"]),this.id=t.id||"",this.url=t.url||"",this.urlPolicy=t.urlPolicy||"",this.use=t.use||"",this.usehref=t.usehref||"",this.encryption=null,this.issuers=null,this.keyUsage=null,this.oids=null,this.signing=null,this.subjectDNs=null}},mu=class extends Nh{constructor(t){super(Vh,"checkButton",!0),this.id=t.id||"",this.mark=getStringOption(t.mark,["default","check","circle","cross","diamond","square","star"]),this.shape=getStringOption(t.shape,["square","round"]),this.size=getMeasurement(t.size,"10pt"),this.use=t.use||"",this.usehref=t.usehref||"",this.border=null,this.extras=null,this.margin=null}[Xc](t){const e=toStyle(this,"margin"),s=measureToString(this.size);let i,n,a;e.width=e.height=s;const r=this[dc]()[dc](),o=r.items.children.length&&r.items.children[0][Xc]().html||[],l={on:(void 0!==o[0]?o[0]:"on").toString(),off:(void 0!==o[1]?o[1]:"off").toString()},c=(r.value?.[Wc]()||"off")===l.on||void 0,h=r[uc](),u=r[Jc];let d;h instanceof qu?(a=h[Jc],i="radio",n="xfaRadio",d=h[Xl]?.[Jc]||h[Jc]):(i="checkbox",n="xfaCheckbox",d=r[Xl]?.[Jc]||r[Jc]);const f={name:"input",attributes:{class:[n],style:e,fieldId:u,dataId:d,type:i,checked:c,xfaOn:l.on,xfaOff:l.off,"aria-label":ariaLabel(r),"aria-required":!1}};return a&&(f.attributes.name=a),isRequired(r)&&(f.attributes["aria-required"]=!0,f.attributes.required=!0),sh.success({name:"label",attributes:{class:["xfaLabel"]},children:[f]})}},bu=class extends Nh{constructor(t){super(Vh,"choiceList",!0),this.commitOn=getStringOption(t.commitOn,["select","exit"]),this.id=t.id||"",this.open=getStringOption(t.open,["userControl","always","multiSelect","onEntry"]),this.textEntry=getInteger({data:t.textEntry,defaultValue:0,validate:t=>1===t}),this.use=t.use||"",this.usehref=t.usehref||"",this.border=null,this.extras=null,this.margin=null}[Xc](t){const e=toStyle(this,"border","margin"),s=this[dc]()[dc](),i={fontSize:`calc(${s.font?.size||10}px * var(--total-scale-factor))`},n=[];if(s.items.children.length>0){const t=s.items;let e=0,a=0;2===t.children.length&&(e=t.children[0].save,a=1-e);const r=t.children[e][Xc]().html,o=t.children[a][Xc]().html;let l=!1;const c=s.value?.[Wc]()||"";for(let t=0,e=r.length;t<e;t++){const e={name:"option",attributes:{value:o[t]||r[t],style:i},value:r[t]};o[t]===c&&(e.attributes.selected=l=!0),n.push(e)}l||n.splice(0,0,{name:"option",attributes:{hidden:!0,selected:!0},value:" "})}const a={class:["xfaSelect"],fieldId:s[Jc],dataId:s[Xl]?.[Jc]||s[Jc],style:e,"aria-label":ariaLabel(s),"aria-required":!1};return isRequired(s)&&(a["aria-required"]=!0,a.required=!0),"multiSelect"===this.open&&(a.multiple=!0),sh.success({name:"label",attributes:{class:["xfaLabel"]},children:[{name:"select",children:n,attributes:a}]})}},wu=class extends Nh{constructor(t){super(Vh,"color",!0),this.cSpace=getStringOption(t.cSpace,["SRGB"]),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.value=t.value?function(t,e=[0,0,0]){let[s,i,n]=e;if(!t)return{r:s,g:i,b:n};const a=t.split(",",3).map(t=>MathClamp$1(parseInt(t.trim(),10),0,255)).map(t=>isNaN(t)?0:t);return a.length<3||([s,i,n]=a),{r:s,g:i,b:n}}(t.value):"",this.extras=null}[pc](){return!1}[Yc](){return this.value?ss.makeHexColor(this.value.r,this.value.g,this.value.b):null}},yu=class extends Nh{constructor(t){super(Vh,"comb"),this.id=t.id||"",this.numberOfCells=getInteger({data:t.numberOfCells,defaultValue:0,validate:t=>t>=0}),this.use=t.use||"",this.usehref=t.usehref||""}},xu=class extends Nh{constructor(t){super(Vh,"connect",!0),this.connection=t.connection||"",this.id=t.id||"",this.ref=t.ref||"",this.usage=getStringOption(t.usage,["exportAndImport","exportOnly","importOnly"]),this.use=t.use||"",this.usehref=t.usehref||"",this.picture=null}},vu=class extends Nh{constructor(t){super(Vh,"contentArea",!0),this.h=getMeasurement(t.h),this.id=t.id||"",this.name=t.name||"",this.relevant=getRelevant(t.relevant),this.use=t.use||"",this.usehref=t.usehref||"",this.w=getMeasurement(t.w),this.x=getMeasurement(t.x,"0pt"),this.y=getMeasurement(t.y,"0pt"),this.desc=null,this.extras=null}[Xc](t){const e={left:measureToString(this.x),top:measureToString(this.y),width:measureToString(this.w),height:measureToString(this.h)},s=["xfaContentarea"];return isPrintOnly(this)&&s.push("xfaPrintOnly"),sh.success({name:"div",children:[],attributes:{style:e,class:s,id:this[Jc]}})}},Au=class extends Nh{constructor(t){super(Vh,"corner",!0),this.id=t.id||"",this.inverted=getInteger({data:t.inverted,defaultValue:0,validate:t=>1===t}),this.join=getStringOption(t.join,["square","round"]),this.presence=getStringOption(t.presence,["visible","hidden","inactive","invisible"]),this.radius=getMeasurement(t.radius),this.stroke=getStringOption(t.stroke,["solid","dashDot","dashDotDot","dashed","dotted","embossed","etched","lowered","raised"]),this.thickness=getMeasurement(t.thickness,"0.5pt"),this.use=t.use||"",this.usehref=t.usehref||"",this.color=null,this.extras=null}[Yc](){const t=toStyle(this,"visibility");return t.radius=measureToString("square"===this.join?0:this.radius),t}},ku=class extends $h{constructor(t){super(Vh,"date"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}[Jl](){const t=this[Vl].trim();this[Vl]=t?new Date(t):null}[Xc](t){return valueToHtml(this[Vl]?this[Vl].toString():"")}},Su=class extends $h{constructor(t){super(Vh,"dateTime"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}[Jl](){const t=this[Vl].trim();this[Vl]=t?new Date(t):null}[Xc](t){return valueToHtml(this[Vl]?this[Vl].toString():"")}},Cu=class extends Nh{constructor(t){super(Vh,"dateTimeEdit",!0),this.hScrollPolicy=getStringOption(t.hScrollPolicy,["auto","off","on"]),this.id=t.id||"",this.picker=getStringOption(t.picker,["host","none"]),this.use=t.use||"",this.usehref=t.usehref||"",this.border=null,this.comb=null,this.extras=null,this.margin=null}[Xc](t){const e=toStyle(this,"border","font","margin"),s=this[dc]()[dc](),i={name:"input",attributes:{type:"text",fieldId:s[Jc],dataId:s[Xl]?.[Jc]||s[Jc],class:["xfaTextfield"],style:e,"aria-label":ariaLabel(s),"aria-required":!1}};return isRequired(s)&&(i.attributes["aria-required"]=!0,i.attributes.required=!0),sh.success({name:"label",attributes:{class:["xfaLabel"]},children:[i]})}},_u=class extends $h{constructor(t){super(Vh,"decimal"),this.fracDigits=getInteger({data:t.fracDigits,defaultValue:2,validate:t=>!0}),this.id=t.id||"",this.leadDigits=getInteger({data:t.leadDigits,defaultValue:-1,validate:t=>!0}),this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}[Jl](){const t=parseFloat(this[Vl].trim());this[Vl]=isNaN(t)?null:t}[Xc](t){return valueToHtml(null!==this[Vl]?this[Vl].toString():"")}},Iu=class extends Nh{constructor(t){super(Vh,"defaultUi",!0),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null}},Tu=class extends Nh{constructor(t){super(Vh,"desc",!0),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.boolean=new Oh,this.date=new Oh,this.dateTime=new Oh,this.decimal=new Oh,this.exData=new Oh,this.float=new Oh,this.image=new Oh,this.integer=new Oh,this.text=new Oh,this.time=new Oh}},Mu=class extends Hh{constructor(t){super(Vh,"digestMethod",["","SHA1","SHA256","SHA512","RIPEMD160"]),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||""}},Eu=class extends Nh{constructor(t){super(Vh,"digestMethods",!0),this.id=t.id||"",this.type=getStringOption(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||"",this.digestMethod=new Oh}},Fu=class extends Nh{constructor(t){super(Vh,"draw",!0),this.anchorType=getStringOption(t.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]),this.colSpan=getInteger({data:t.colSpan,defaultValue:1,validate:t=>t>=1||-1===t}),this.h=t.h?getMeasurement(t.h):"",this.hAlign=getStringOption(t.hAlign,["left","center","justify","justifyAll","radix","right"]),this.id=t.id||"",this.locale=t.locale||"",this.maxH=getMeasurement(t.maxH,"0pt"),this.maxW=getMeasurement(t.maxW,"0pt"),this.minH=getMeasurement(t.minH,"0pt"),this.minW=getMeasurement(t.minW,"0pt"),this.name=t.name||"",this.presence=getStringOption(t.presence,["visible","hidden","inactive","invisible"]),this.relevant=getRelevant(t.relevant),this.rotate=getInteger({data:t.rotate,defaultValue:0,validate:t=>t%90==0}),this.use=t.use||"",this.usehref=t.usehref||"",this.w=t.w?getMeasurement(t.w):"",this.x=getMeasurement(t.x,"0pt"),this.y=getMeasurement(t.y,"0pt"),this.assist=null,this.border=null,this.caption=null,this.desc=null,this.extras=null,this.font=null,this.keep=null,this.margin=null,this.para=null,this.traversal=null,this.ui=null,this.value=null,this.setProperty=new Oh}[zc](t){_setValue(this,t)}[Xc](t){if(setTabIndex(this),"hidden"===this.presence||"inactive"===this.presence)return sh.EMPTY;fixDimensions(this),this[Oc]();const e=this.w,s=this.h,{w:i,h:n,isBroken:a}=layoutNode(this,t);if(i&&""===this.w){if(a&&this[uc]()[Cc]())return this[Nc](),sh.FAILURE;this.w=i}if(n&&""===this.h&&(this.h=n),setFirstUnsplittable(this),!checkDimensions(this,t))return this.w=e,this.h=s,this[Nc](),sh.FAILURE;unsetFirstUnsplittable(this);const r=toStyle(this,"font","hAlign","dimensions","position","presence","rotate","anchorType","border","margin");setMinMaxDimensions(this,r),r.margin&&(r.padding=r.margin,delete r.margin);const o=["xfaDraw"];this.font&&o.push("xfaFont"),isPrintOnly(this)&&o.push("xfaPrintOnly");const l={style:r,id:this[Jc],class:o};this.name&&(l.xfaName=this.name);const c={name:"div",attributes:l,children:[]};applyAssist(this,l);const h=computeBbox(this,c,t),u=this.value?this.value[Xc](t).html:null;return null===u?(this.w=e,this.h=s,this[Nc](),sh.success(createWrapper(this,c),h)):(c.children.push(u),setPara(this,r,u),this.w=e,this.h=s,this[Nc](),sh.success(createWrapper(this,c),h))}},Du=class extends Nh{constructor(t){super(Vh,"edge",!0),this.cap=getStringOption(t.cap,["square","butt","round"]),this.id=t.id||"",this.presence=getStringOption(t.presence,["visible","hidden","inactive","invisible"]),this.stroke=getStringOption(t.stroke,["solid","dashDot","dashDotDot","dashed","dotted","embossed","etched","lowered","raised"]),this.thickness=getMeasurement(t.thickness,"0.5pt"),this.use=t.use||"",this.usehref=t.usehref||"",this.color=null,this.extras=null}[Yc](){const t=toStyle(this,"visibility");if(Object.assign(t,{linecap:this.cap,width:measureToString(this.thickness),color:this.color?this.color[Yc]():"#000000",style:""}),"visible"!==this.presence)t.style="none";else switch(this.stroke){case"solid":t.style="solid";break;case"dashDot":case"dashDotDot":case"dashed":t.style="dashed";break;case"dotted":t.style="dotted";break;case"embossed":t.style="ridge";break;case"etched":t.style="groove";break;case"lowered":t.style="inset";break;case"raised":t.style="outset"}return t}},Ru=class extends Hh{constructor(t){super(Vh,"encoding",["adbe.x509.rsa_sha1","adbe.pkcs7.detached","adbe.pkcs7.sha1"]),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||""}},Bu=class extends Nh{constructor(t){super(Vh,"encodings",!0),this.id=t.id||"",this.type=getStringOption(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||"",this.encoding=new Oh}},Pu=class extends Nh{constructor(t){super(Vh,"encrypt",!0),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.certificate=null}},Nu=class extends Nh{constructor(t){super(Vh,"encryptData",!0),this.id=t.id||"",this.operation=getStringOption(t.operation,["encrypt","decrypt"]),this.target=t.target||"",this.use=t.use||"",this.usehref=t.usehref||"",this.filter=null,this.manifest=null}},Ou=class extends Nh{constructor(t){super(Vh,"encryption",!0),this.id=t.id||"",this.type=getStringOption(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||"",this.certificate=new Oh}},Lu=class extends Hh{constructor(t){super(Vh,"encryptionMethod",["","AES256-CBC","TRIPLEDES-CBC","AES128-CBC","AES192-CBC"]),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||""}},Uu=class extends Nh{constructor(t){super(Vh,"encryptionMethods",!0),this.id=t.id||"",this.type=getStringOption(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||"",this.encryptionMethod=new Oh}},$u=class extends Nh{constructor(t){super(Vh,"event",!0),this.activity=getStringOption(t.activity,["click","change","docClose","docReady","enter","exit","full","indexChange","initialize","mouseDown","mouseEnter","mouseExit","mouseUp","postExecute","postOpen","postPrint","postSave","postSign","postSubmit","preExecute","preOpen","prePrint","preSave","preSign","preSubmit","ready","validationState"]),this.id=t.id||"",this.listen=getStringOption(t.listen,["refOnly","refAndDescendents"]),this.name=t.name||"",this.ref=t.ref||"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.encryptData=null,this.execute=null,this.script=null,this.signData=null,this.submit=null}},Hu=class extends $h{constructor(t){super(Vh,"exData"),this.contentType=t.contentType||"",this.href=t.href||"",this.id=t.id||"",this.maxLength=getInteger({data:t.maxLength,defaultValue:-1,validate:t=>t>=-1}),this.name=t.name||"",this.rid=t.rid||"",this.transferEncoding=getStringOption(t.transferEncoding,["none","base64","package"]),this.use=t.use||"",this.usehref=t.usehref||""}[yc](){return"text/html"===this.contentType}[Dc](t){return("text/html"===this.contentType&&t[Mc]===Qc.xhtml.id||"text/xml"===this.contentType)&&(this[Vl]=t,!0)}[Xc](t){return"text/html"===this.contentType&&this[Vl]?this[Vl][Xc](t):sh.EMPTY}},ju=class extends Nh{constructor(t){super(Vh,"exObject",!0),this.archive=t.archive||"",this.classId=t.classId||"",this.codeBase=t.codeBase||"",this.codeType=t.codeType||"",this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.boolean=new Oh,this.date=new Oh,this.dateTime=new Oh,this.decimal=new Oh,this.exData=new Oh,this.exObject=new Oh,this.float=new Oh,this.image=new Oh,this.integer=new Oh,this.text=new Oh,this.time=new Oh}},qu=class extends Nh{constructor(t){super(Vh,"exclGroup",!0),this.access=getStringOption(t.access,["open","nonInteractive","protected","readOnly"]),this.accessKey=t.accessKey||"",this.anchorType=getStringOption(t.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]),this.colSpan=getInteger({data:t.colSpan,defaultValue:1,validate:t=>t>=1||-1===t}),this.h=t.h?getMeasurement(t.h):"",this.hAlign=getStringOption(t.hAlign,["left","center","justify","justifyAll","radix","right"]),this.id=t.id||"",this.layout=getStringOption(t.layout,["position","lr-tb","rl-row","rl-tb","row","table","tb"]),this.maxH=getMeasurement(t.maxH,"0pt"),this.maxW=getMeasurement(t.maxW,"0pt"),this.minH=getMeasurement(t.minH,"0pt"),this.minW=getMeasurement(t.minW,"0pt"),this.name=t.name||"",this.presence=getStringOption(t.presence,["visible","hidden","inactive","invisible"]),this.relevant=getRelevant(t.relevant),this.use=t.use||"",this.usehref=t.usehref||"",this.w=t.w?getMeasurement(t.w):"",this.x=getMeasurement(t.x,"0pt"),this.y=getMeasurement(t.y,"0pt"),this.assist=null,this.bind=null,this.border=null,this.calculate=null,this.caption=null,this.desc=null,this.extras=null,this.margin=null,this.para=null,this.traversal=null,this.validate=null,this.connect=new Oh,this.event=new Oh,this.field=new Oh,this.setProperty=new Oh}[xc](){return!0}[pc](){return!0}[zc](t){for(const e of this.field.children){if(!e.value){const t=new ef({});e[$l](t),e.value=t}e.value[zc](t)}}[Cc](){return this.layout.endsWith("-tb")&&0===this[Yl].attempt&&this[Yl].numberInLine>0||this[dc]()[Cc]()}[Sc](){const t=this[uc]();return!!t[Sc]()&&(void 0!==this[Yl]._isSplittable?this[Yl]._isSplittable:"position"===this.layout||this.layout.includes("row")?(this[Yl]._isSplittable=!1,!1):!(t.layout?.endsWith("-tb")&&0!==t[Yl].numberInLine||(this[Yl]._isSplittable=!0,0)))}[Zl](){return flushHTML(this)}[Ul](t,e){addHTML(this,t,e)}[ec](){return getAvailableSpace(this)}[Xc](t){if(setTabIndex(this),"hidden"===this.presence||"inactive"===this.presence||0===this.h||0===this.w)return sh.EMPTY;fixDimensions(this);const e=[],s={id:this[Jc],class:[]};setAccess(this,s.class),this[Yl]||=Object.create(null),Object.assign(this[Yl],{children:e,attributes:s,attempt:0,line:null,numberInLine:0,availableSpace:{width:Math.min(this.w||1/0,t.width),height:Math.min(this.h||1/0,t.height)},width:0,height:0,prevHeight:0,currentWidth:0});const i=this[Sc]();if(i||setFirstUnsplittable(this),!checkDimensions(this,t))return sh.FAILURE;const n=new Set(["field"]);if(this.layout.includes("row")){const t=this[uc]().columnWidths;Array.isArray(t)&&t.length>0&&(this[Yl].columnWidths=t,this[Yl].currentColumn=0)}const a=toStyle(this,"anchorType","dimensions","position","presence","border","margin","hAlign"),r=["xfaExclgroup"],o=layoutClass(this);o&&r.push(o),isPrintOnly(this)&&r.push("xfaPrintOnly"),s.style=a,s.class=r,this.name&&(s.xfaName=this.name),this[Oc]();const l="lr-tb"===this.layout||"rl-tb"===this.layout,c=l?2:1;for(;this[Yl].attempt<c;this[Yl].attempt++){l&&1===this[Yl].attempt&&(this[Yl].numberInLine=0);const t=this[Hl]({filter:n,include:!0});if(t.success)break;if(t.isBreak())return this[Nc](),t;if(l&&0===this[Yl].attempt&&0===this[Yl].numberInLine&&!this[fc]()[Yl].noLayoutFailure){this[Yl].attempt=c;break}}if(this[Nc](),i||unsetFirstUnsplittable(this),this[Yl].attempt===c)return i||delete this[Yl],sh.FAILURE;let h=0,u=0;this.margin&&(h=this.margin.leftInset+this.margin.rightInset,u=this.margin.topInset+this.margin.bottomInset);const d=Math.max(this[Yl].width+h,this.w||0),f=Math.max(this[Yl].height+u,this.h||0),g=[this.x,this.y,d,f];""===this.w&&(a.width=measureToString(d)),""===this.h&&(a.height=measureToString(f));const p={name:"div",attributes:s,children:e};return applyAssist(this,s),delete this[Yl],sh.success(createWrapper(this,p),g)}},zu=class extends Nh{constructor(t){super(Vh,"execute"),this.connection=t.connection||"",this.executeType=getStringOption(t.executeType,["import","remerge"]),this.id=t.id||"",this.runAt=getStringOption(t.runAt,["client","both","server"]),this.use=t.use||"",this.usehref=t.usehref||""}},Gu=class extends Nh{constructor(t){super(Vh,"extras",!0),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||"",this.boolean=new Oh,this.date=new Oh,this.dateTime=new Oh,this.decimal=new Oh,this.exData=new Oh,this.extras=new Oh,this.float=new Oh,this.image=new Oh,this.integer=new Oh,this.text=new Oh,this.time=new Oh}},Wu=class extends Nh{constructor(t){super(Vh,"field",!0),this.access=getStringOption(t.access,["open","nonInteractive","protected","readOnly"]),this.accessKey=t.accessKey||"",this.anchorType=getStringOption(t.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]),this.colSpan=getInteger({data:t.colSpan,defaultValue:1,validate:t=>t>=1||-1===t}),this.h=t.h?getMeasurement(t.h):"",this.hAlign=getStringOption(t.hAlign,["left","center","justify","justifyAll","radix","right"]),this.id=t.id||"",this.locale=t.locale||"",this.maxH=getMeasurement(t.maxH,"0pt"),this.maxW=getMeasurement(t.maxW,"0pt"),this.minH=getMeasurement(t.minH,"0pt"),this.minW=getMeasurement(t.minW,"0pt"),this.name=t.name||"",this.presence=getStringOption(t.presence,["visible","hidden","inactive","invisible"]),this.relevant=getRelevant(t.relevant),this.rotate=getInteger({data:t.rotate,defaultValue:0,validate:t=>t%90==0}),this.use=t.use||"",this.usehref=t.usehref||"",this.w=t.w?getMeasurement(t.w):"",this.x=getMeasurement(t.x,"0pt"),this.y=getMeasurement(t.y,"0pt"),this.assist=null,this.bind=null,this.border=null,this.calculate=null,this.caption=null,this.desc=null,this.extras=null,this.font=null,this.format=null,this.items=new Oh(2),this.keep=null,this.margin=null,this.para=null,this.traversal=null,this.ui=null,this.validate=null,this.value=null,this.bindItems=new Oh,this.connect=new Oh,this.event=new Oh,this.setProperty=new Oh}[xc](){return!0}[zc](t){_setValue(this,t)}[Xc](t){if(setTabIndex(this),!this.ui){let t;switch(this.ui=new Qd({}),this.ui[gc]=this[gc],this[$l](this.ui),this.items.children.length){case 0:t=new Vd({}),this.ui.textEdit=t;break;case 1:t=new mu({}),this.ui.checkButton=t;break;case 2:t=new bu({}),this.ui.choiceList=t}this.ui[$l](t)}if(!this.ui||"hidden"===this.presence||"inactive"===this.presence||0===this.h||0===this.w)return sh.EMPTY;this.caption&&delete this.caption[Yl],this[Oc]();const e=this.caption?this.caption[Xc](t).html:null,s=this.w,i=this.h;let n=0,a=0;this.margin&&(n=this.margin.leftInset+this.margin.rightInset,a=this.margin.topInset+this.margin.bottomInset);let r=null;if(""===this.w||""===this.h){let e=null,s=null,i=0,o=0;if(this.ui.checkButton)i=o=this.ui.checkButton.size;else{const{w:e,h:s}=layoutNode(this,t);null!==e?(i=e,o=s):o=function(t,e=!1){let s=null;if(t){const e=stripQuotes(t.typeface),i=t[gc].fontFinder.find(e);s=selectFont(t,i)}if(!s)return{lineHeight:12,lineGap:2,lineNoGap:10};const i=t.size||10,n=s.lineHeight?Math.max(e?0:1.2,s.lineHeight):1.2,a=void 0===s.lineGap?.2:s.lineGap;return{lineHeight:n*i,lineGap:a*i,lineNoGap:Math.max(1,n-a)*i}}(this.font,!0).lineNoGap}if(r=getBorderDims(this.ui[rc]()),i+=r.w,o+=r.h,this.caption){const{w:n,h:a,isBroken:r}=this.caption[rc](t);if(r&&this[uc]()[Cc]())return this[Nc](),sh.FAILURE;switch(e=n,s=a,this.caption.placement){case"left":case"right":case"inline":e+=i;break;case"top":case"bottom":s+=o}}else e=i,s=o;e&&""===this.w&&(e+=n,this.w=Math.min(this.maxW<=0?1/0:this.maxW,this.minW+1<e?e:this.minW)),s&&""===this.h&&(s+=a,this.h=Math.min(this.maxH<=0?1/0:this.maxH,this.minH+1<s?s:this.minH))}if(this[Nc](),fixDimensions(this),setFirstUnsplittable(this),!checkDimensions(this,t))return this.w=s,this.h=i,this[Nc](),sh.FAILURE;unsetFirstUnsplittable(this);const o=toStyle(this,"font","dimensions","position","rotate","anchorType","presence","margin","hAlign");setMinMaxDimensions(this,o);const l=["xfaField"];this.font&&l.push("xfaFont"),isPrintOnly(this)&&l.push("xfaPrintOnly");const c={style:o,id:this[Jc],class:l};o.margin&&(o.padding=o.margin,delete o.margin),setAccess(this,l),this.name&&(c.xfaName=this.name);const h=[],u={name:"div",attributes:c,children:h};applyAssist(this,c);const d=this.border?this.border[Yc]():null,f=computeBbox(this,u,t),g=this.ui[Xc]().html;if(!g)return Object.assign(o,d),sh.success(createWrapper(this,u),f);this[Gc]&&(g.children?.[0]?g.children[0].attributes.tabindex=this[Gc]:g.attributes.tabindex=this[Gc]),g.attributes.style||=Object.create(null);let p=null;if(this.ui.button?(1===g.children.length&&([p]=g.children.splice(0,1)),Object.assign(g.attributes.style,d)):Object.assign(o,d),h.push(g),this.value)if(this.ui.imageEdit)g.children.push(this.value[Xc]().html);else if(!this.ui.button){let t="";if(this.value.exData)t=this.value.exData[Wc]();else if(this.value.text)t=this.value.text[rc]();else{const e=this.value[Xc]().html;null!==e&&(t=e.children[0].value)}this.ui.textEdit&&this.value.text?.maxChars&&(g.children[0].attributes.maxLength=this.value.text.maxChars),t&&(this.ui.numericEdit&&(t=parseFloat(t),t=isNaN(t)?"":t.toString()),"textarea"===g.children[0].name?g.children[0].attributes.textContent=t:g.children[0].attributes.value=t)}if(!this.ui.imageEdit&&g.children?.[0]&&this.h){r=r||getBorderDims(this.ui[rc]());let e=0;if(this.caption&&["top","bottom"].includes(this.caption.placement)){e=this.caption.reserve,e<=0&&(e=this.caption[rc](t).h);const s=this.h-e-a-r.h;g.children[0].attributes.style.height=measureToString(s)}else g.children[0].attributes.style.height="100%"}if(p&&g.children.push(p),!e)return g.attributes.class&&g.attributes.class.push("xfaLeft"),this.w=s,this.h=i,sh.success(createWrapper(this,u),f);if(this.ui.button)return o.padding&&delete o.padding,"div"===e.name&&(e.name="span"),g.children.push(e),sh.success(u,f);switch(this.ui.checkButton&&(e.attributes.class[0]="xfaCaptionForCheckButton"),g.attributes.class||=[],g.children.splice(0,0,e),this.caption.placement){case"left":case"inline":g.attributes.class.push("xfaLeft");break;case"right":g.attributes.class.push("xfaRight");break;case"top":g.attributes.class.push("xfaTop");break;case"bottom":g.attributes.class.push("xfaBottom")}return this.w=s,this.h=i,sh.success(createWrapper(this,u),f)}},Vu=class extends Nh{constructor(t){super(Vh,"fill",!0),this.id=t.id||"",this.presence=getStringOption(t.presence,["visible","hidden","inactive","invisible"]),this.use=t.use||"",this.usehref=t.usehref||"",this.color=null,this.extras=null,this.linear=null,this.pattern=null,this.radial=null,this.solid=null,this.stipple=null}[Yc](){const t=this[dc](),e=t[dc]()[dc](),s=Object.create(null);let i="color",n=i;t instanceof ou&&(i="background-color",n="background",e instanceof Qd&&(s.backgroundColor="white")),(t instanceof Ed||t instanceof Qh)&&(i=n="fill",s.fill="white");for(const t of Object.getOwnPropertyNames(this)){if("extras"===t||"color"===t)continue;const e=this[t];if(!(e instanceof Nh))continue;const a=e[Yc](this.color);return a&&(s[a.startsWith("#")?i:n]=a),s}if(this.color?.value){const t=this.color[Yc]();s[t.startsWith("#")?i:n]=t}return s}},Xu=class extends Nh{constructor(t){super(Vh,"filter",!0),this.addRevocationInfo=getStringOption(t.addRevocationInfo,["","required","optional","none"]),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||"",this.version=getInteger({data:this.version,defaultValue:5,validate:t=>t>=1&&t<=5}),this.appearanceFilter=null,this.certificates=null,this.digestMethods=null,this.encodings=null,this.encryptionMethods=null,this.handler=null,this.lockDocument=null,this.mdp=null,this.reasons=null,this.timeStamp=null}},Ku=class extends $h{constructor(t){super(Vh,"float"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}[Jl](){const t=parseFloat(this[Vl].trim());this[Vl]=isNaN(t)?null:t}[Xc](t){return valueToHtml(null!==this[Vl]?this[Vl].toString():"")}},Yu=class extends Nh{constructor(t){super(Vh,"font",!0),this.baselineShift=getMeasurement(t.baselineShift),this.fontHorizontalScale=getFloat({data:t.fontHorizontalScale,defaultValue:100,validate:t=>t>=0}),this.fontVerticalScale=getFloat({data:t.fontVerticalScale,defaultValue:100,validate:t=>t>=0}),this.id=t.id||"",this.kerningMode=getStringOption(t.kerningMode,["none","pair"]),this.letterSpacing=getMeasurement(t.letterSpacing,"0"),this.lineThrough=getInteger({data:t.lineThrough,defaultValue:0,validate:t=>1===t||2===t}),this.lineThroughPeriod=getStringOption(t.lineThroughPeriod,["all","word"]),this.overline=getInteger({data:t.overline,defaultValue:0,validate:t=>1===t||2===t}),this.overlinePeriod=getStringOption(t.overlinePeriod,["all","word"]),this.posture=getStringOption(t.posture,["normal","italic"]),this.size=getMeasurement(t.size,"10pt"),this.typeface=t.typeface||"Courier",this.underline=getInteger({data:t.underline,defaultValue:0,validate:t=>1===t||2===t}),this.underlinePeriod=getStringOption(t.underlinePeriod,["all","word"]),this.use=t.use||"",this.usehref=t.usehref||"",this.weight=getStringOption(t.weight,["normal","bold"]),this.extras=null,this.fill=null}[jl](t){super[jl](t),this[gc].usedTypefaces.add(this.typeface)}[Yc](){const t=toStyle(this,"fill"),e=t.color;return e&&("#000000"===e?delete t.color:e.startsWith("#")||(t.background=e,t.backgroundClip="text",t.color="transparent")),this.baselineShift&&(t.verticalAlign=measureToString(this.baselineShift)),t.fontKerning="none"===this.kerningMode?"none":"normal",t.letterSpacing=measureToString(this.letterSpacing),0!==this.lineThrough&&(t.textDecoration="line-through",2===this.lineThrough&&(t.textDecorationStyle="double")),0!==this.overline&&(t.textDecoration="overline",2===this.overline&&(t.textDecorationStyle="double")),t.fontStyle=this.posture,t.fontSize=measureToString(.99*this.size),setFontFamily(this,this,this[gc].fontFinder,t),0!==this.underline&&(t.textDecoration="underline",2===this.underline&&(t.textDecorationStyle="double")),t.fontWeight=this.weight,t}},Ju=class extends Nh{constructor(t){super(Vh,"format",!0),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.picture=null}},Zu=class extends jh{constructor(t){super(Vh,"handler"),this.id=t.id||"",this.type=getStringOption(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||""}},Qu=class extends Nh{constructor(t){super(Vh,"hyphenation"),this.excludeAllCaps=getInteger({data:t.excludeAllCaps,defaultValue:0,validate:t=>1===t}),this.excludeInitialCap=getInteger({data:t.excludeInitialCap,defaultValue:0,validate:t=>1===t}),this.hyphenate=getInteger({data:t.hyphenate,defaultValue:0,validate:t=>1===t}),this.id=t.id||"",this.pushCharacterCount=getInteger({data:t.pushCharacterCount,defaultValue:3,validate:t=>t>=0}),this.remainCharacterCount=getInteger({data:t.remainCharacterCount,defaultValue:3,validate:t=>t>=0}),this.use=t.use||"",this.usehref=t.usehref||"",this.wordCharacterCount=getInteger({data:t.wordCharacterCount,defaultValue:7,validate:t=>t>=0})}},td=class extends jh{constructor(t){super(Vh,"image"),this.aspect=getStringOption(t.aspect,["fit","actual","height","none","width"]),this.contentType=t.contentType||"",this.href=t.href||"",this.id=t.id||"",this.name=t.name||"",this.transferEncoding=getStringOption(t.transferEncoding,["base64","none","package"]),this.use=t.use||"",this.usehref=t.usehref||""}[Xc](){if(this.contentType&&!Yh.has(this.contentType.toLowerCase()))return sh.EMPTY;let t=this[gc].images?.get(this.href);if(!t&&(this.href||!this[Vl]))return sh.EMPTY;var e;if(t||"base64"!==this.transferEncoding||(e=this[Vl],t=Uint8Array.fromBase64?Uint8Array.fromBase64(e):stringToBytes$1(atob(e))),!t)return sh.EMPTY;if(!this.contentType){for(const[e,s]of Jh)if(t.length>e.length&&e.every((e,s)=>e===t[s])){this.contentType=s;break}if(!this.contentType)return sh.EMPTY}const s=new Blob([t],{type:this.contentType});let i;switch(this.aspect){case"fit":case"actual":break;case"height":i={height:"100%",objectFit:"fill"};break;case"none":i={width:"100%",height:"100%",objectFit:"fill"};break;case"width":i={width:"100%",objectFit:"fill"}}const n=this[dc]();return sh.success({name:"img",attributes:{class:["xfaImage"],style:i,src:URL.createObjectURL(s),alt:n?ariaLabel(n[dc]()):null}})}},ed=class extends Nh{constructor(t){super(Vh,"imageEdit",!0),this.data=getStringOption(t.data,["link","embed"]),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.border=null,this.extras=null,this.margin=null}[Xc](t){return"embed"===this.data?sh.success({name:"div",children:[],attributes:{}}):sh.EMPTY}},sd=class extends $h{constructor(t){super(Vh,"integer"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}[Jl](){const t=parseInt(this[Vl].trim(),10);this[Vl]=isNaN(t)?null:t}[Xc](t){return valueToHtml(null!==this[Vl]?this[Vl].toString():"")}},id=class extends Nh{constructor(t){super(Vh,"issuers",!0),this.id=t.id||"",this.type=getStringOption(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||"",this.certificate=new Oh}},nd=class extends Nh{constructor(t){super(Vh,"items",!0),this.id=t.id||"",this.name=t.name||"",this.presence=getStringOption(t.presence,["visible","hidden","inactive","invisible"]),this.ref=t.ref||"",this.save=getInteger({data:t.save,defaultValue:0,validate:t=>1===t}),this.use=t.use||"",this.usehref=t.usehref||"",this.boolean=new Oh,this.date=new Oh,this.dateTime=new Oh,this.decimal=new Oh,this.exData=new Oh,this.float=new Oh,this.image=new Oh,this.integer=new Oh,this.text=new Oh,this.time=new Oh}[Xc](){const t=[];for(const e of this[lc]())t.push(e[Wc]());return sh.success(t)}},ad=class extends Nh{constructor(t){super(Vh,"keep",!0),this.id=t.id||"";const e=["none","contentArea","pageArea"];this.intact=getStringOption(t.intact,e),this.next=getStringOption(t.next,e),this.previous=getStringOption(t.previous,e),this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null}},rd=class extends Nh{constructor(t){super(Vh,"keyUsage");const e=["","yes","no"];this.crlSign=getStringOption(t.crlSign,e),this.dataEncipherment=getStringOption(t.dataEncipherment,e),this.decipherOnly=getStringOption(t.decipherOnly,e),this.digitalSignature=getStringOption(t.digitalSignature,e),this.encipherOnly=getStringOption(t.encipherOnly,e),this.id=t.id||"",this.keyAgreement=getStringOption(t.keyAgreement,e),this.keyCertSign=getStringOption(t.keyCertSign,e),this.keyEncipherment=getStringOption(t.keyEncipherment,e),this.nonRepudiation=getStringOption(t.nonRepudiation,e),this.type=getStringOption(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||""}},od=class extends Nh{constructor(t){super(Vh,"line",!0),this.hand=getStringOption(t.hand,["even","left","right"]),this.id=t.id||"",this.slope=getStringOption(t.slope,["\\","/"]),this.use=t.use||"",this.usehref=t.usehref||"",this.edge=null}[Xc](){const t=this[dc]()[dc](),e=this.edge||new Du({}),s=e[Yc](),i=Object.create(null),n="visible"===e.presence?e.thickness:0;let a,r,o,l;i.strokeWidth=measureToString(n),i.stroke=s.color;let c="100%",h="100%";t.w<=n?([a,r,o,l]=["50%",0,"50%","100%"],c=i.strokeWidth):t.h<=n?([a,r,o,l]=[0,"50%","100%","50%"],h=i.strokeWidth):"\\"===this.slope?[a,r,o,l]=[0,0,"100%","100%"]:[a,r,o,l]=[0,"100%","100%",0];const u={name:"svg",children:[{name:"line",attributes:{xmlns:Xh,x1:a,y1:r,x2:o,y2:l,style:i}}],attributes:{xmlns:Xh,width:c,height:h,style:{overflow:"visible"}}};return hasMargin(t)?sh.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[u]}):(u.attributes.style.position="absolute",sh.success(u))}},ld=class extends Nh{constructor(t){super(Vh,"linear",!0),this.id=t.id||"",this.type=getStringOption(t.type,["toRight","toBottom","toLeft","toTop"]),this.use=t.use||"",this.usehref=t.usehref||"",this.color=null,this.extras=null}[Yc](t){return t=t?t[Yc]():"#FFFFFF",`linear-gradient(${this.type.replace(/([RBLT])/," $1").toLowerCase()}, ${t}, ${this.color?this.color[Yc]():"#000000"})`}},cd=class extends $h{constructor(t){super(Vh,"lockDocument"),this.id=t.id||"",this.type=getStringOption(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||""}[Jl](){this[Vl]=getStringOption(this[Vl],["auto","0","1"])}},hd=class extends Nh{constructor(t){super(Vh,"manifest",!0),this.action=getStringOption(t.action,["include","all","exclude"]),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.ref=new Oh}},ud=class extends Nh{constructor(t){super(Vh,"margin",!0),this.bottomInset=getMeasurement(t.bottomInset,"0"),this.id=t.id||"",this.leftInset=getMeasurement(t.leftInset,"0"),this.rightInset=getMeasurement(t.rightInset,"0"),this.topInset=getMeasurement(t.topInset,"0"),this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null}[Yc](){return{margin:measureToString(this.topInset)+" "+measureToString(this.rightInset)+" "+measureToString(this.bottomInset)+" "+measureToString(this.leftInset)}}},dd=class extends Nh{constructor(t){super(Vh,"mdp"),this.id=t.id||"",this.permissions=getInteger({data:t.permissions,defaultValue:2,validate:t=>1===t||3===t}),this.signatureType=getStringOption(t.signatureType,["filler","author"]),this.use=t.use||"",this.usehref=t.usehref||""}},fd=class extends Nh{constructor(t){super(Vh,"medium"),this.id=t.id||"",this.imagingBBox=function(t){const e=-1;if(!t)return{x:e,y:e,width:e,height:e};const s=t.split(",",4).map(t=>getMeasurement(t.trim(),"-1"));if(s.length<4||s[2]<0||s[3]<0)return{x:e,y:e,width:e,height:e};const[i,n,a,r]=s;return{x:i,y:n,width:a,height:r}}(t.imagingBBox),this.long=getMeasurement(t.long),this.orientation=getStringOption(t.orientation,["portrait","landscape"]),this.short=getMeasurement(t.short),this.stock=t.stock||"",this.trayIn=getStringOption(t.trayIn,["auto","delegate","pageFront"]),this.trayOut=getStringOption(t.trayOut,["auto","delegate"]),this.use=t.use||"",this.usehref=t.usehref||""}},gd=class extends Nh{constructor(t){super(Vh,"message",!0),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.text=new Oh}},pd=class extends Nh{constructor(t){super(Vh,"numericEdit",!0),this.hScrollPolicy=getStringOption(t.hScrollPolicy,["auto","off","on"]),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.border=null,this.comb=null,this.extras=null,this.margin=null}[Xc](t){const e=toStyle(this,"border","font","margin"),s=this[dc]()[dc](),i={name:"input",attributes:{type:"text",fieldId:s[Jc],dataId:s[Xl]?.[Jc]||s[Jc],class:["xfaTextfield"],style:e,"aria-label":ariaLabel(s),"aria-required":!1}};return isRequired(s)&&(i.attributes["aria-required"]=!0,i.attributes.required=!0),sh.success({name:"label",attributes:{class:["xfaLabel"]},children:[i]})}},md=class extends Nh{constructor(t){super(Vh,"occur",!0),this.id=t.id||"",this.initial=""!==t.initial?getInteger({data:t.initial,defaultValue:"",validate:t=>!0}):"",this.max=""!==t.max?getInteger({data:t.max,defaultValue:1,validate:t=>!0}):"",this.min=""!==t.min?getInteger({data:t.min,defaultValue:1,validate:t=>!0}):"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null}[jl](){const t=this[dc](),e=this.min;""===this.min&&(this.min=t instanceof xd||t instanceof vd?0:1),""===this.max&&(this.max=""===e?t instanceof xd||t instanceof vd?-1:1:this.min),-1!==this.max&&this.max<this.min&&(this.max=this.min),""===this.initial&&(this.initial=t instanceof Gd?1:this.min)}},bd=class extends jh{constructor(t){super(Vh,"oid"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}},wd=class extends Nh{constructor(t){super(Vh,"oids",!0),this.id=t.id||"",this.type=getStringOption(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||"",this.oid=new Oh}},yd=class extends Nh{constructor(t){super(Vh,"overflow"),this.id=t.id||"",this.leader=t.leader||"",this.target=t.target||"",this.trailer=t.trailer||"",this.use=t.use||"",this.usehref=t.usehref||""}[rc](){if(!this[Yl]){const t=this[dc](),e=this[fc](),s=e[Hc](this.target,t),i=e[Hc](this.leader,t),n=e[Hc](this.trailer,t);this[Yl]={target:s?.[0]||null,leader:i?.[0]||null,trailer:n?.[0]||null,addLeader:!1,addTrailer:!1}}return this[Yl]}},xd=class extends Nh{constructor(t){super(Vh,"pageArea",!0),this.blankOrNotBlank=getStringOption(t.blankOrNotBlank,["any","blank","notBlank"]),this.id=t.id||"",this.initialNumber=getInteger({data:t.initialNumber,defaultValue:1,validate:t=>!0}),this.name=t.name||"",this.numbered=getInteger({data:t.numbered,defaultValue:1,validate:t=>!0}),this.oddOrEven=getStringOption(t.oddOrEven,["any","even","odd"]),this.pagePosition=getStringOption(t.pagePosition,["any","first","last","only","rest"]),this.relevant=getRelevant(t.relevant),this.use=t.use||"",this.usehref=t.usehref||"",this.desc=null,this.extras=null,this.medium=null,this.occur=null,this.area=new Oh,this.contentArea=new Oh,this.draw=new Oh,this.exclGroup=new Oh,this.field=new Oh,this.subform=new Oh}[Ic](){return this[Yl]?!this.occur||-1===this.occur.max||this[Yl].numberOfUse<this.occur.max:(this[Yl]={numberOfUse:0},!0)}[ql](){delete this[Yl]}[hc](){this[Yl]||={numberOfUse:0};const t=this[dc]();return"orderedOccurrence"===t.relation&&this[Ic]()?(this[Yl].numberOfUse+=1,this):t[hc]()}[ec](){return this[Yl].space||{width:0,height:0}}[Xc](){this[Yl]||={numberOfUse:1};const t=[];this[Yl].children=t;const e=Object.create(null);if(this.medium&&this.medium.short&&this.medium.long){if(e.width=measureToString(this.medium.short),e.height=measureToString(this.medium.long),this[Yl].space={width:this.medium.short,height:this.medium.long},"landscape"===this.medium.orientation){const t=e.width;e.width=e.height,e.height=t,this[Yl].space={width:this.medium.long,height:this.medium.short}}}else warn$1("XFA - No medium specified in pageArea: please file a bug.");return this[Hl]({filter:new Set(["area","draw","field","subform"]),include:!0}),this[Hl]({filter:new Set(["contentArea"]),include:!0}),sh.success({name:"div",children:t,attributes:{class:["xfaPage"],id:this[Jc],style:e,xfaName:this.name}})}},vd=class _PageSet extends Nh{constructor(t){super(Vh,"pageSet",!0),this.duplexImposition=getStringOption(t.duplexImposition,["longEdge","shortEdge"]),this.id=t.id||"",this.name=t.name||"",this.relation=getStringOption(t.relation,["orderedOccurrence","duplexPaginated","simplexPaginated"]),this.relevant=getRelevant(t.relevant),this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.occur=null,this.pageArea=new Oh,this.pageSet=new Oh}[ql](){for(const t of this.pageArea.children)t[ql]();for(const t of this.pageSet.children)t[ql]()}[Ic](){return!this.occur||-1===this.occur.max||this[Yl].numberOfUse<this.occur.max}[hc](){if(this[Yl]||={numberOfUse:1,pageIndex:-1,pageSetIndex:-1},"orderedOccurrence"===this.relation){if(this[Yl].pageIndex+1<this.pageArea.children.length)return this[Yl].pageIndex+=1,this.pageArea.children[this[Yl].pageIndex][hc]();if(this[Yl].pageSetIndex+1<this.pageSet.children.length)return this[Yl].pageSetIndex+=1,this.pageSet.children[this[Yl].pageSetIndex][hc]();if(this[Ic]())return this[Yl].numberOfUse+=1,this[Yl].pageIndex=-1,this[Yl].pageSetIndex=-1,this[hc]();const t=this[dc]();return t instanceof _PageSet?t[hc]():(this[ql](),this[hc]())}const t=this[fc]()[Yl].pageNumber,e=t%2==0?"even":"odd",s=0===t?"first":"rest";let i=this.pageArea.children.find(t=>t.oddOrEven===e&&t.pagePosition===s);return i||(i=this.pageArea.children.find(t=>"any"===t.oddOrEven&&t.pagePosition===s),i||(i=this.pageArea.children.find(t=>"any"===t.oddOrEven&&"any"===t.pagePosition),i||this.pageArea.children[0]))}},Ad=class extends Nh{constructor(t){super(Vh,"para",!0),this.hAlign=getStringOption(t.hAlign,["left","center","justify","justifyAll","radix","right"]),this.id=t.id||"",this.lineHeight=t.lineHeight?getMeasurement(t.lineHeight,"0pt"):"",this.marginLeft=t.marginLeft?getMeasurement(t.marginLeft,"0pt"):"",this.marginRight=t.marginRight?getMeasurement(t.marginRight,"0pt"):"",this.orphans=getInteger({data:t.orphans,defaultValue:0,validate:t=>t>=0}),this.preserve=t.preserve||"",this.radixOffset=t.radixOffset?getMeasurement(t.radixOffset,"0pt"):"",this.spaceAbove=t.spaceAbove?getMeasurement(t.spaceAbove,"0pt"):"",this.spaceBelow=t.spaceBelow?getMeasurement(t.spaceBelow,"0pt"):"",this.tabDefault=t.tabDefault?getMeasurement(this.tabDefault):"",this.tabStops=(t.tabStops||"").trim().split(/\s+/).map((t,e)=>e%2==1?getMeasurement(t):t),this.textIndent=t.textIndent?getMeasurement(t.textIndent,"0pt"):"",this.use=t.use||"",this.usehref=t.usehref||"",this.vAlign=getStringOption(t.vAlign,["top","bottom","middle"]),this.widows=getInteger({data:t.widows,defaultValue:0,validate:t=>t>=0}),this.hyphenation=null}[Yc](){const t=toStyle(this,"hAlign");return""!==this.marginLeft&&(t.paddingLeft=measureToString(this.marginLeft)),""!==this.marginRight&&(t.paddingRight=measureToString(this.marginRight)),""!==this.spaceAbove&&(t.paddingTop=measureToString(this.spaceAbove)),""!==this.spaceBelow&&(t.paddingBottom=measureToString(this.spaceBelow)),""!==this.textIndent&&(t.textIndent=measureToString(this.textIndent),fixTextIndent(t)),this.lineHeight>0&&(t.lineHeight=measureToString(this.lineHeight)),""!==this.tabDefault&&(t.tabSize=measureToString(this.tabDefault)),this.tabStops.length,this.hyphenatation&&Object.assign(t,this.hyphenatation[Yc]()),t}},kd=class extends Nh{constructor(t){super(Vh,"passwordEdit",!0),this.hScrollPolicy=getStringOption(t.hScrollPolicy,["auto","off","on"]),this.id=t.id||"",this.passwordChar=t.passwordChar||"*",this.use=t.use||"",this.usehref=t.usehref||"",this.border=null,this.extras=null,this.margin=null}},Sd=class extends Nh{constructor(t){super(Vh,"pattern",!0),this.id=t.id||"",this.type=getStringOption(t.type,["crossHatch","crossDiagonal","diagonalLeft","diagonalRight","horizontal","vertical"]),this.use=t.use||"",this.usehref=t.usehref||"",this.color=null,this.extras=null}[Yc](t){t=t?t[Yc]():"#FFFFFF";const e=this.color?this.color[Yc]():"#000000",s="repeating-linear-gradient",i=`${t},${t} 5px,${e} 5px,${e} 10px`;switch(this.type){case"crossHatch":return`${s}(to top,${i}) ${s}(to right,${i})`;case"crossDiagonal":return`${s}(45deg,${i}) ${s}(-45deg,${i})`;case"diagonalLeft":return`${s}(45deg,${i})`;case"diagonalRight":return`${s}(-45deg,${i})`;case"horizontal":return`${s}(to top,${i})`;case"vertical":return`${s}(to right,${i})`}return""}},Cd=class extends jh{constructor(t){super(Vh,"picture"),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||""}},_d=class extends Nh{constructor(t){super(Vh,"proto",!0),this.appearanceFilter=new Oh,this.arc=new Oh,this.area=new Oh,this.assist=new Oh,this.barcode=new Oh,this.bindItems=new Oh,this.bookend=new Oh,this.boolean=new Oh,this.border=new Oh,this.break=new Oh,this.breakAfter=new Oh,this.breakBefore=new Oh,this.button=new Oh,this.calculate=new Oh,this.caption=new Oh,this.certificate=new Oh,this.certificates=new Oh,this.checkButton=new Oh,this.choiceList=new Oh,this.color=new Oh,this.comb=new Oh,this.connect=new Oh,this.contentArea=new Oh,this.corner=new Oh,this.date=new Oh,this.dateTime=new Oh,this.dateTimeEdit=new Oh,this.decimal=new Oh,this.defaultUi=new Oh,this.desc=new Oh,this.digestMethod=new Oh,this.digestMethods=new Oh,this.draw=new Oh,this.edge=new Oh,this.encoding=new Oh,this.encodings=new Oh,this.encrypt=new Oh,this.encryptData=new Oh,this.encryption=new Oh,this.encryptionMethod=new Oh,this.encryptionMethods=new Oh,this.event=new Oh,this.exData=new Oh,this.exObject=new Oh,this.exclGroup=new Oh,this.execute=new Oh,this.extras=new Oh,this.field=new Oh,this.fill=new Oh,this.filter=new Oh,this.float=new Oh,this.font=new Oh,this.format=new Oh,this.handler=new Oh,this.hyphenation=new Oh,this.image=new Oh,this.imageEdit=new Oh,this.integer=new Oh,this.issuers=new Oh,this.items=new Oh,this.keep=new Oh,this.keyUsage=new Oh,this.line=new Oh,this.linear=new Oh,this.lockDocument=new Oh,this.manifest=new Oh,this.margin=new Oh,this.mdp=new Oh,this.medium=new Oh,this.message=new Oh,this.numericEdit=new Oh,this.occur=new Oh,this.oid=new Oh,this.oids=new Oh,this.overflow=new Oh,this.pageArea=new Oh,this.pageSet=new Oh,this.para=new Oh,this.passwordEdit=new Oh,this.pattern=new Oh,this.picture=new Oh,this.radial=new Oh,this.reason=new Oh,this.reasons=new Oh,this.rectangle=new Oh,this.ref=new Oh,this.script=new Oh,this.setProperty=new Oh,this.signData=new Oh,this.signature=new Oh,this.signing=new Oh,this.solid=new Oh,this.speak=new Oh,this.stipple=new Oh,this.subform=new Oh,this.subformSet=new Oh,this.subjectDN=new Oh,this.subjectDNs=new Oh,this.submit=new Oh,this.text=new Oh,this.textEdit=new Oh,this.time=new Oh,this.timeStamp=new Oh,this.toolTip=new Oh,this.traversal=new Oh,this.traverse=new Oh,this.ui=new Oh,this.validate=new Oh,this.value=new Oh,this.variables=new Oh}},Id=class extends Nh{constructor(t){super(Vh,"radial",!0),this.id=t.id||"",this.type=getStringOption(t.type,["toEdge","toCenter"]),this.use=t.use||"",this.usehref=t.usehref||"",this.color=null,this.extras=null}[Yc](t){t=t?t[Yc]():"#FFFFFF";const e=this.color?this.color[Yc]():"#000000";return`radial-gradient(circle at center, ${"toEdge"===this.type?`${t},${e}`:`${e},${t}`})`}},Td=class extends jh{constructor(t){super(Vh,"reason"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}},Md=class extends Nh{constructor(t){super(Vh,"reasons",!0),this.id=t.id||"",this.type=getStringOption(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||"",this.reason=new Oh}},Ed=class extends Nh{constructor(t){super(Vh,"rectangle",!0),this.hand=getStringOption(t.hand,["even","left","right"]),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.corner=new Oh(4),this.edge=new Oh(4),this.fill=null}[Xc](){const t=this.edge.children.length?this.edge.children[0]:new Du({}),e=t[Yc](),s=Object.create(null);"visible"===this.fill?.presence?Object.assign(s,this.fill[Yc]()):s.fill="transparent",s.strokeWidth=measureToString("visible"===t.presence?t.thickness:0),s.stroke=e.color;const i=(this.corner.children.length?this.corner.children[0]:new Au({}))[Yc](),n={name:"svg",children:[{name:"rect",attributes:{xmlns:Xh,width:"100%",height:"100%",x:0,y:0,rx:i.radius,ry:i.radius,style:s}}],attributes:{xmlns:Xh,style:{overflow:"visible"},width:"100%",height:"100%"}};return hasMargin(this[dc]()[dc]())?sh.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[n]}):(n.attributes.style.position="absolute",sh.success(n))}},Fd=class extends jh{constructor(t){super(Vh,"ref"),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||""}},Dd=class extends jh{constructor(t){super(Vh,"script"),this.binding=t.binding||"",this.contentType=t.contentType||"",this.id=t.id||"",this.name=t.name||"",this.runAt=getStringOption(t.runAt,["client","both","server"]),this.use=t.use||"",this.usehref=t.usehref||""}},Rd=class extends Nh{constructor(t){super(Vh,"setProperty"),this.connection=t.connection||"",this.ref=t.ref||"",this.target=t.target||""}},Bd=class extends Nh{constructor(t){super(Vh,"signData",!0),this.id=t.id||"",this.operation=getStringOption(t.operation,["sign","clear","verify"]),this.ref=t.ref||"",this.target=t.target||"",this.use=t.use||"",this.usehref=t.usehref||"",this.filter=null,this.manifest=null}},Pd=class extends Nh{constructor(t){super(Vh,"signature",!0),this.id=t.id||"",this.type=getStringOption(t.type,["PDF1.3","PDF1.6"]),this.use=t.use||"",this.usehref=t.usehref||"",this.border=null,this.extras=null,this.filter=null,this.manifest=null,this.margin=null}},Nd=class extends Nh{constructor(t){super(Vh,"signing",!0),this.id=t.id||"",this.type=getStringOption(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||"",this.certificate=new Oh}},Od=class extends Nh{constructor(t){super(Vh,"solid",!0),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null}[Yc](t){return t?t[Yc]():"#FFFFFF"}},Ld=class extends jh{constructor(t){super(Vh,"speak"),this.disable=getInteger({data:t.disable,defaultValue:0,validate:t=>1===t}),this.id=t.id||"",this.priority=getStringOption(t.priority,["custom","caption","name","toolTip"]),this.rid=t.rid||"",this.use=t.use||"",this.usehref=t.usehref||""}},Ud=class extends Nh{constructor(t){super(Vh,"stipple",!0),this.id=t.id||"",this.rate=getInteger({data:t.rate,defaultValue:50,validate:t=>t>=0&&t<=100}),this.use=t.use||"",this.usehref=t.usehref||"",this.color=null,this.extras=null}[Yc](t){const e=this.rate/100;return ss.makeHexColor(Math.round(t.value.r*(1-e)+this.value.r*e),Math.round(t.value.g*(1-e)+this.value.g*e),Math.round(t.value.b*(1-e)+this.value.b*e))}},$d=class extends Nh{constructor(t){super(Vh,"subform",!0),this.access=getStringOption(t.access,["open","nonInteractive","protected","readOnly"]),this.allowMacro=getInteger({data:t.allowMacro,defaultValue:0,validate:t=>1===t}),this.anchorType=getStringOption(t.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]),this.colSpan=getInteger({data:t.colSpan,defaultValue:1,validate:t=>t>=1||-1===t}),this.columnWidths=(t.columnWidths||"").trim().split(/\s+/).map(t=>"-1"===t?-1:getMeasurement(t)),this.h=t.h?getMeasurement(t.h):"",this.hAlign=getStringOption(t.hAlign,["left","center","justify","justifyAll","radix","right"]),this.id=t.id||"",this.layout=getStringOption(t.layout,["position","lr-tb","rl-row","rl-tb","row","table","tb"]),this.locale=t.locale||"",this.maxH=getMeasurement(t.maxH,"0pt"),this.maxW=getMeasurement(t.maxW,"0pt"),this.mergeMode=getStringOption(t.mergeMode,["consumeData","matchTemplate"]),this.minH=getMeasurement(t.minH,"0pt"),this.minW=getMeasurement(t.minW,"0pt"),this.name=t.name||"",this.presence=getStringOption(t.presence,["visible","hidden","inactive","invisible"]),this.relevant=getRelevant(t.relevant),this.restoreState=getStringOption(t.restoreState,["manual","auto"]),this.scope=getStringOption(t.scope,["name","none"]),this.use=t.use||"",this.usehref=t.usehref||"",this.w=t.w?getMeasurement(t.w):"",this.x=getMeasurement(t.x,"0pt"),this.y=getMeasurement(t.y,"0pt"),this.assist=null,this.bind=null,this.bookend=null,this.border=null,this.break=null,this.calculate=null,this.desc=null,this.extras=null,this.keep=null,this.margin=null,this.occur=null,this.overflow=null,this.pageSet=null,this.para=null,this.traversal=null,this.validate=null,this.variables=null,this.area=new Oh,this.breakAfter=new Oh,this.breakBefore=new Oh,this.connect=new Oh,this.draw=new Oh,this.event=new Oh,this.exObject=new Oh,this.exclGroup=new Oh,this.field=new Oh,this.proto=new Oh,this.setProperty=new Oh,this.subform=new Oh,this.subformSet=new Oh}[uc](){const t=this[dc]();return t instanceof Hd?t[uc]():t}[xc](){return!0}[Cc](){return this.layout.endsWith("-tb")&&0===this[Yl].attempt&&this[Yl].numberInLine>0||this[dc]()[Cc]()}*[cc](){yield*getContainedChildren(this)}[Zl](){return flushHTML(this)}[Ul](t,e){addHTML(this,t,e)}[ec](){return getAvailableSpace(this)}[Sc](){const t=this[uc]();return!!t[Sc]()&&(void 0!==this[Yl]._isSplittable?this[Yl]._isSplittable:"position"===this.layout||this.layout.includes("row")||this.keep&&"none"!==this.keep.intact?(this[Yl]._isSplittable=!1,!1):!(t.layout?.endsWith("-tb")&&0!==t[Yl].numberInLine||(this[Yl]._isSplittable=!0,0)))}[Xc](t){if(setTabIndex(this),this.break){if("auto"!==this.break.after||""!==this.break.afterTarget){const t=new cu({targetType:this.break.after,target:this.break.afterTarget,startNew:this.break.startNew.toString()});t[gc]=this[gc],this[$l](t),this.breakAfter.push(t)}if("auto"!==this.break.before||""!==this.break.beforeTarget){const t=new hu({targetType:this.break.before,target:this.break.beforeTarget,startNew:this.break.startNew.toString()});t[gc]=this[gc],this[$l](t),this.breakBefore.push(t)}if(""!==this.break.overflowTarget){const t=new yd({target:this.break.overflowTarget,leader:this.break.overflowLeader,trailer:this.break.overflowTrailer});t[gc]=this[gc],this[$l](t),this.overflow.push(t)}this[Lc](this.break),this.break=null}if("hidden"===this.presence||"inactive"===this.presence)return sh.EMPTY;if((this.breakBefore.children.length>1||this.breakAfter.children.length>1)&&warn$1("XFA - Several breakBefore or breakAfter in subforms: please file a bug."),this.breakBefore.children.length>=1){const t=this.breakBefore.children[0];if(handleBreak(t))return sh.breakNode(t)}if(this[Yl]?.afterBreakAfter)return sh.EMPTY;fixDimensions(this);const e=[],s={id:this[Jc],class:[]};setAccess(this,s.class),this[Yl]||=Object.create(null),Object.assign(this[Yl],{children:e,line:null,attributes:s,attempt:0,numberInLine:0,availableSpace:{width:Math.min(this.w||1/0,t.width),height:Math.min(this.h||1/0,t.height)},width:0,height:0,prevHeight:0,currentWidth:0});const i=this[fc](),n=i[Yl].noLayoutFailure,a=this[Sc]();if(a||setFirstUnsplittable(this),!checkDimensions(this,t))return sh.FAILURE;const r=new Set(["area","draw","exclGroup","field","subform","subformSet"]);if(this.layout.includes("row")){const t=this[uc]().columnWidths;Array.isArray(t)&&t.length>0&&(this[Yl].columnWidths=t,this[Yl].currentColumn=0)}const o=toStyle(this,"anchorType","dimensions","position","presence","border","margin","hAlign"),l=["xfaSubform"],c=layoutClass(this);if(c&&l.push(c),s.style=o,s.class=l,this.name&&(s.xfaName=this.name),this.overflow){const e=this.overflow[rc]();e.addLeader&&(e.addLeader=!1,handleOverflow(this,e.leader,t))}this[Oc]();const h="lr-tb"===this.layout||"rl-tb"===this.layout,u=h?2:1;for(;this[Yl].attempt<u;this[Yl].attempt++){h&&1===this[Yl].attempt&&(this[Yl].numberInLine=0);const t=this[Hl]({filter:r,include:!0});if(t.success)break;if(t.isBreak())return this[Nc](),t;if(h&&0===this[Yl].attempt&&0===this[Yl].numberInLine&&!i[Yl].noLayoutFailure){this[Yl].attempt=u;break}}if(this[Nc](),a||unsetFirstUnsplittable(this),i[Yl].noLayoutFailure=n,this[Yl].attempt===u)return this.overflow&&(this[fc]()[Yl].overflowNode=this.overflow),a||delete this[Yl],sh.FAILURE;if(this.overflow){const e=this.overflow[rc]();e.addTrailer&&(e.addTrailer=!1,handleOverflow(this,e.trailer,t))}let d=0,f=0;this.margin&&(d=this.margin.leftInset+this.margin.rightInset,f=this.margin.topInset+this.margin.bottomInset);const g=Math.max(this[Yl].width+d,this.w||0),p=Math.max(this[Yl].height+f,this.h||0),m=[this.x,this.y,g,p];if(""===this.w&&(o.width=measureToString(g)),""===this.h&&(o.height=measureToString(p)),("0px"===o.width||"0px"===o.height)&&0===e.length)return sh.EMPTY;const b={name:"div",attributes:s,children:e};applyAssist(this,s);const w=sh.success(createWrapper(this,b),m);if(this.breakAfter.children.length>=1){const t=this.breakAfter.children[0];if(handleBreak(t))return this[Yl].afterBreakAfter=w,sh.breakNode(t)}return delete this[Yl],w}},Hd=class extends Nh{constructor(t){super(Vh,"subformSet",!0),this.id=t.id||"",this.name=t.name||"",this.relation=getStringOption(t.relation,["ordered","choice","unordered"]),this.relevant=getRelevant(t.relevant),this.use=t.use||"",this.usehref=t.usehref||"",this.bookend=null,this.break=null,this.desc=null,this.extras=null,this.occur=null,this.overflow=null,this.breakAfter=new Oh,this.breakBefore=new Oh,this.subform=new Oh,this.subformSet=new Oh}*[cc](){yield*getContainedChildren(this)}[uc](){let t=this[dc]();for(;!(t instanceof $d);)t=t[dc]();return t}[xc](){return!0}},jd=class extends $h{constructor(t){super(Vh,"subjectDN"),this.delimiter=t.delimiter||",",this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}[Jl](){this[Vl]=new Map(this[Vl].split(this.delimiter).map(t=>((t=t.split("=",2))[0]=t[0].trim(),t)))}},qd=class extends Nh{constructor(t){super(Vh,"subjectDNs",!0),this.id=t.id||"",this.type=getStringOption(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||"",this.subjectDN=new Oh}},zd=class extends Nh{constructor(t){super(Vh,"submit",!0),this.embedPDF=getInteger({data:t.embedPDF,defaultValue:0,validate:t=>1===t}),this.format=getStringOption(t.format,["xdp","formdata","pdf","urlencoded","xfd","xml"]),this.id=t.id||"",this.target=t.target||"",this.textEncoding=getKeyword({data:t.textEncoding?t.textEncoding.toLowerCase():"",defaultValue:"",validate:t=>["utf-8","big-five","fontspecific","gbk","gb-18030","gb-2312","ksc-5601","none","shift-jis","ucs-2","utf-16"].includes(t)||t.match(/iso-8859-\d{2}/)}),this.use=t.use||"",this.usehref=t.usehref||"",this.xdpContent=t.xdpContent||"",this.encrypt=null,this.encryptData=new Oh,this.signData=new Oh}},Gd=class extends Nh{constructor(t){super(Vh,"template",!0),this.baseProfile=getStringOption(t.baseProfile,["full","interactiveForms"]),this.extras=null,this.subform=new Oh}[Jl](){0===this.subform.children.length&&warn$1("XFA - No subforms in template node."),this.subform.children.length>=2&&warn$1("XFA - Several subforms in template node: please file a bug."),this[Gc]=5e3}[Sc](){return!0}[Hc](t,e){return t.startsWith("#")?[this[mc].get(t.slice(1))]:searchNode(this,e,t,!0,!0)}*[Vc](){if(!this.subform.children.length)return sh.success({name:"div",children:[]});this[Yl]={overflowNode:null,firstUnsplittable:null,currentContentArea:null,currentPageArea:null,noLayoutFailure:!1,pageNumber:1,pagePosition:"first",oddOrEven:"odd",blankOrNotBlank:"nonBlank",paraStack:[]};const t=this.subform.children[0];t.pageSet[ql]();const e=t.pageSet.pageArea.children,s={name:"div",children:[]};let i=null,n=null,a=null;if(t.breakBefore.children.length>=1?(n=t.breakBefore.children[0],a=n.target):t.subform.children.length>=1&&t.subform.children[0].breakBefore.children.length>=1?(n=t.subform.children[0].breakBefore.children[0],a=n.target):t.break?.beforeTarget?(n=t.break,a=n.beforeTarget):t.subform.children.length>=1&&t.subform.children[0].break?.beforeTarget&&(n=t.subform.children[0].break,a=n.beforeTarget),n){const t=this[Hc](a,n[dc]());t instanceof xd&&(i=t,n[Yl]={})}i||=e[0],i[Yl]={numberOfUse:1};const r=i[dc]();let o;r[Yl]={numberOfUse:1,pageIndex:r.pageArea.children.indexOf(i),pageSetIndex:0};let l=null,c=null,h=!0,u=0,d=0;for(;;){if(h)u=0;else if(s.children.pop(),3===++u)return warn$1("XFA - Something goes wrong: please file a bug."),s;o=null,this[Yl].currentPageArea=i;const e=i[Xc]().html;s.children.push(e),l&&(this[Yl].noLayoutFailure=!0,e.children.push(l[Xc](i[Yl].space).html),l=null),c&&(this[Yl].noLayoutFailure=!0,e.children.push(c[Xc](i[Yl].space).html),c=null);const n=i.contentArea.children,a=e.children.filter(t=>t.attributes.class.includes("xfaContentarea"));h=!1,this[Yl].firstUnsplittable=null,this[Yl].noLayoutFailure=!1;const flush=e=>{const s=t[Zl]();s&&(h||=s.children?.length>0,a[e].children.push(s))};for(let e=d,i=n.length;e<i;e++){const i=this[Yl].currentContentArea=n[e],r={width:i.w,height:i.h};d=0,l&&(a[e].children.push(l[Xc](r).html),l=null),c&&(a[e].children.push(c[Xc](r).html),c=null);const u=t[Xc](r);if(u.success)return u.html?(h||=u.html.children?.length>0,a[e].children.push(u.html)):!h&&s.children.length>1&&s.children.pop(),s;if(u.isBreak()){const t=u.breakNode;if(flush(e),"auto"===t.targetType)continue;t.leader&&(l=this[Hc](t.leader,t[dc]()),l=l?l[0]:null),t.trailer&&(c=this[Hc](t.trailer,t[dc]()),c=c?c[0]:null),"pageArea"===t.targetType?(o=t[Yl].target,e=1/0):t[Yl].target?(o=t[Yl].target,d=t[Yl].index+1,e=1/0):e=t[Yl].index;continue}if(this[Yl].overflowNode){const t=this[Yl].overflowNode;this[Yl].overflowNode=null;const s=t[rc](),i=s.target;s.addLeader=null!==s.leader,s.addTrailer=null!==s.trailer,flush(e);const a=e;if(e=1/0,i instanceof xd)o=i;else if(i instanceof vu){const t=n.indexOf(i);-1!==t?t>a?e=t-1:d=t:(o=i[dc](),d=o.contentArea.children.indexOf(i))}continue}flush(e)}this[Yl].pageNumber+=1,o&&(o[Ic]()?o[Yl].numberOfUse+=1:o=null),i=o||i[hc](),yield null}}},Wd=class extends $h{constructor(t){super(Vh,"text"),this.id=t.id||"",this.maxChars=getInteger({data:t.maxChars,defaultValue:0,validate:t=>t>=0}),this.name=t.name||"",this.rid=t.rid||"",this.use=t.use||"",this.usehref=t.usehref||""}[Ll](){return!0}[Dc](t){return t[Mc]===Qc.xhtml.id?(this[Vl]=t,!0):(warn$1(`XFA - Invalid content in Text: ${t[Ec]}.`),!1)}[Bc](t){this[Vl]instanceof Nh||super[Bc](t)}[Jl](){"string"==typeof this[Vl]&&(this[Vl]=this[Vl].replaceAll("\r\n","\n"))}[rc](){return"string"==typeof this[Vl]?this[Vl].split(/[\u2029\u2028\n]/).filter(t=>!!t).join("\n"):this[Vl][Wc]()}[Xc](t){if("string"==typeof this[Vl]){const t=valueToHtml(this[Vl]).html;return this[Vl].includes("\u2029")?(t.name="div",t.children=[],this[Vl].split("\u2029").map(t=>t.split(/[\u2028\n]/).flatMap(t=>[{name:"span",value:t},{name:"br"}])).forEach(e=>{t.children.push({name:"p",children:e})})):/[\u2028\n]/.test(this[Vl])&&(t.name="div",t.children=[],this[Vl].split(/[\u2028\n]/).forEach(e=>{t.children.push({name:"span",value:e},{name:"br"})})),sh.success(t)}return this[Vl][Xc](t)}},Vd=class extends Nh{constructor(t){super(Vh,"textEdit",!0),this.allowRichText=getInteger({data:t.allowRichText,defaultValue:0,validate:t=>1===t}),this.hScrollPolicy=getStringOption(t.hScrollPolicy,["auto","off","on"]),this.id=t.id||"",this.multiLine=getInteger({data:t.multiLine,defaultValue:"",validate:t=>0===t||1===t}),this.use=t.use||"",this.usehref=t.usehref||"",this.vScrollPolicy=getStringOption(t.vScrollPolicy,["auto","off","on"]),this.border=null,this.comb=null,this.extras=null,this.margin=null}[Xc](t){const e=toStyle(this,"border","font","margin");let s;const i=this[dc]()[dc]();return""===this.multiLine&&(this.multiLine=i instanceof Fu?1:0),s=1===this.multiLine?{name:"textarea",attributes:{dataId:i[Xl]?.[Jc]||i[Jc],fieldId:i[Jc],class:["xfaTextfield"],style:e,"aria-label":ariaLabel(i),"aria-required":!1}}:{name:"input",attributes:{type:"text",dataId:i[Xl]?.[Jc]||i[Jc],fieldId:i[Jc],class:["xfaTextfield"],style:e,"aria-label":ariaLabel(i),"aria-required":!1}},isRequired(i)&&(s.attributes["aria-required"]=!0,s.attributes.required=!0),sh.success({name:"label",attributes:{class:["xfaLabel"]},children:[s]})}},Xd=class extends jh{constructor(t){super(Vh,"time"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}[Jl](){const t=this[Vl].trim();this[Vl]=t?new Date(t):null}[Xc](t){return valueToHtml(this[Vl]?this[Vl].toString():"")}},Kd=class extends Nh{constructor(t){super(Vh,"timeStamp"),this.id=t.id||"",this.server=t.server||"",this.type=getStringOption(t.type,["optional","required"]),this.use=t.use||"",this.usehref=t.usehref||""}},Yd=class extends jh{constructor(t){super(Vh,"toolTip"),this.id=t.id||"",this.rid=t.rid||"",this.use=t.use||"",this.usehref=t.usehref||""}},Jd=class extends Nh{constructor(t){super(Vh,"traversal",!0),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.traverse=new Oh}},Zd=class extends Nh{constructor(t){super(Vh,"traverse",!0),this.id=t.id||"",this.operation=getStringOption(t.operation,["next","back","down","first","left","right","up"]),this.ref=t.ref||"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.script=null}get name(){return this.operation}[_c](){return!1}},Qd=class extends Nh{constructor(t){super(Vh,"ui",!0),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.picture=null,this.barcode=null,this.button=null,this.checkButton=null,this.choiceList=null,this.dateTimeEdit=null,this.defaultUi=null,this.imageEdit=null,this.numericEdit=null,this.passwordEdit=null,this.signature=null,this.textEdit=null}[rc](){if(void 0===this[Yl]){for(const t of Object.getOwnPropertyNames(this)){if("extras"===t||"picture"===t)continue;const e=this[t];if(e instanceof Nh)return this[Yl]=e,e}this[Yl]=null}return this[Yl]}[Xc](t){const e=this[rc]();return e?e[Xc](t):sh.EMPTY}},tf=class extends Nh{constructor(t){super(Vh,"validate",!0),this.formatTest=getStringOption(t.formatTest,["warning","disabled","error"]),this.id=t.id||"",this.nullTest=getStringOption(t.nullTest,["disabled","error","warning"]),this.scriptTest=getStringOption(t.scriptTest,["error","disabled","warning"]),this.use=t.use||"",this.usehref=t.usehref||"",this.extras=null,this.message=null,this.picture=null,this.script=null}},ef=class extends Nh{constructor(t){super(Vh,"value",!0),this.id=t.id||"",this.override=getInteger({data:t.override,defaultValue:0,validate:t=>1===t}),this.relevant=getRelevant(t.relevant),this.use=t.use||"",this.usehref=t.usehref||"",this.arc=null,this.boolean=null,this.date=null,this.dateTime=null,this.decimal=null,this.exData=null,this.float=null,this.image=null,this.integer=null,this.line=null,this.rectangle=null,this.text=null,this.time=null}[zc](t){const e=this[dc]();if(e instanceof Wu&&e.ui?.imageEdit)return this.image||(this.image=new td({}),this[$l](this.image)),void(this.image[Vl]=t[Vl]);const s=t[Ec];if(null===this[s]){for(const t of Object.getOwnPropertyNames(this)){const e=this[t];e instanceof Nh&&(this[t]=null,this[Lc](e))}this[t[Ec]]=t,this[$l](t)}else this[s][Vl]=t[Vl]}[Wc](){if(this.exData)return"string"==typeof this.exData[Vl]?this.exData[Vl].trim():this.exData[Vl][Wc]().trim();for(const t of Object.getOwnPropertyNames(this)){if("image"===t)continue;const e=this[t];if(e instanceof Nh)return(e[Vl]||"").toString().trim()}return null}[Xc](t){for(const e of Object.getOwnPropertyNames(this)){const s=this[e];if(s instanceof Nh)return s[Xc](t)}return sh.EMPTY}},sf=class extends Nh{constructor(t){super(Vh,"variables",!0),this.id=t.id||"",this.use=t.use||"",this.usehref=t.usehref||"",this.boolean=new Oh,this.date=new Oh,this.dateTime=new Oh,this.decimal=new Oh,this.exData=new Oh,this.float=new Oh,this.image=new Oh,this.integer=new Oh,this.manifest=new Oh,this.script=new Oh,this.text=new Oh,this.time=new Oh}[_c](){return!0}},nf=class _TemplateNamespace{static[Zc](t,e){if(_TemplateNamespace.hasOwnProperty(t)){const s=_TemplateNamespace[t](e);return s[qc](e),s}}static appearanceFilter(t){return new Zh(t)}static arc(t){return new Qh(t)}static area(t){return new tu(t)}static assist(t){return new eu(t)}static barcode(t){return new su(t)}static bind(t){return new iu(t)}static bindItems(t){return new nu(t)}static bookend(t){return new au(t)}static boolean(t){return new ru(t)}static border(t){return new ou(t)}static break(t){return new lu(t)}static breakAfter(t){return new cu(t)}static breakBefore(t){return new hu(t)}static button(t){return new uu(t)}static calculate(t){return new du(t)}static caption(t){return new fu(t)}static certificate(t){return new gu(t)}static certificates(t){return new pu(t)}static checkButton(t){return new mu(t)}static choiceList(t){return new bu(t)}static color(t){return new wu(t)}static comb(t){return new yu(t)}static connect(t){return new xu(t)}static contentArea(t){return new vu(t)}static corner(t){return new Au(t)}static date(t){return new ku(t)}static dateTime(t){return new Su(t)}static dateTimeEdit(t){return new Cu(t)}static decimal(t){return new _u(t)}static defaultUi(t){return new Iu(t)}static desc(t){return new Tu(t)}static digestMethod(t){return new Mu(t)}static digestMethods(t){return new Eu(t)}static draw(t){return new Fu(t)}static edge(t){return new Du(t)}static encoding(t){return new Ru(t)}static encodings(t){return new Bu(t)}static encrypt(t){return new Pu(t)}static encryptData(t){return new Nu(t)}static encryption(t){return new Ou(t)}static encryptionMethod(t){return new Lu(t)}static encryptionMethods(t){return new Uu(t)}static event(t){return new $u(t)}static exData(t){return new Hu(t)}static exObject(t){return new ju(t)}static exclGroup(t){return new qu(t)}static execute(t){return new zu(t)}static extras(t){return new Gu(t)}static field(t){return new Wu(t)}static fill(t){return new Vu(t)}static filter(t){return new Xu(t)}static float(t){return new Ku(t)}static font(t){return new Yu(t)}static format(t){return new Ju(t)}static handler(t){return new Zu(t)}static hyphenation(t){return new Qu(t)}static image(t){return new td(t)}static imageEdit(t){return new ed(t)}static integer(t){return new sd(t)}static issuers(t){return new id(t)}static items(t){return new nd(t)}static keep(t){return new ad(t)}static keyUsage(t){return new rd(t)}static line(t){return new od(t)}static linear(t){return new ld(t)}static lockDocument(t){return new cd(t)}static manifest(t){return new hd(t)}static margin(t){return new ud(t)}static mdp(t){return new dd(t)}static medium(t){return new fd(t)}static message(t){return new gd(t)}static numericEdit(t){return new pd(t)}static occur(t){return new md(t)}static oid(t){return new bd(t)}static oids(t){return new wd(t)}static overflow(t){return new yd(t)}static pageArea(t){return new xd(t)}static pageSet(t){return new vd(t)}static para(t){return new Ad(t)}static passwordEdit(t){return new kd(t)}static pattern(t){return new Sd(t)}static picture(t){return new Cd(t)}static proto(t){return new _d(t)}static radial(t){return new Id(t)}static reason(t){return new Td(t)}static reasons(t){return new Md(t)}static rectangle(t){return new Ed(t)}static ref(t){return new Fd(t)}static script(t){return new Dd(t)}static setProperty(t){return new Rd(t)}static signData(t){return new Bd(t)}static signature(t){return new Pd(t)}static signing(t){return new Nd(t)}static solid(t){return new Od(t)}static speak(t){return new Ld(t)}static stipple(t){return new Ud(t)}static subform(t){return new $d(t)}static subformSet(t){return new Hd(t)}static subjectDN(t){return new jd(t)}static subjectDNs(t){return new qd(t)}static submit(t){return new zd(t)}static template(t){return new Gd(t)}static text(t){return new Wd(t)}static textEdit(t){return new Vd(t)}static time(t){return new Xd(t)}static timeStamp(t){return new Kd(t)}static toolTip(t){return new Yd(t)}static traversal(t){return new Jd(t)}static traverse(t){return new Zd(t)}static ui(t){return new Qd(t)}static validate(t){return new tf(t)}static value(t){return new ef(t)}static variables(t){return new sf(t)}},af=Qc.datasets.id;function createText(t){const e=new Wd({});return e[Vl]=t,e}var rf=class{constructor(t){this.root=t,this.datasets=t.datasets,this.data=t.datasets?.data||new Uh(Qc.datasets.id,"data"),this.emptyMerge=0===this.data[lc]().length,this.root.form=this.form=t.template[Gl]()}_isConsumeData(){return!this.emptyMerge&&this._mergeMode}_isMatchTemplate(){return!this._isConsumeData()}bind(){return this._bindElement(this.form,this.data),this.form}getData(){return this.data}_bindValue(t,e,s){if(t[Xl]=e,t[pc]())if(e[vc]()){const s=e[ac]();t[zc](createText(s))}else if(t instanceof Wu&&"multiSelect"===t.ui?.choiceList?.open){const s=e[lc]().map(t=>t[Vl].trim()).join("\n");t[zc](createText(s))}else this._isConsumeData()&&warn$1("XFA - Nodes haven't the same type.");else!e[vc]()||this._isMatchTemplate()?this._bindElement(t,e):warn$1("XFA - Nodes haven't the same type.")}_findDataByNameToConsume(t,e,s,i){if(!t)return null;let n,a;for(let i=0;i<3;i++){for(n=s[oc](t,!1,!0);a=n.next().value,a;)if(e===a[vc]())return a;if(s[Mc]===Qc.datasets.id&&"data"===s[Ec])break;s=s[dc]()}return i?(n=this.data[oc](t,!0,!1),a=n.next().value,a||(n=this.data[Ql](t,!0),a=n.next().value,a?.[vc]()?a:null)):null}_setProperties(t,e){if(t.hasOwnProperty("setProperty"))for(const{ref:s,target:i,connection:n}of t.setProperty.children){if(n)continue;if(!s)continue;const a=searchNode(this.root,e,s,!1,!1);if(!a){warn$1(`XFA - Invalid reference: ${s}.`);continue}const[r]=a;if(!r[Ac](this.data)){warn$1("XFA - Invalid node: must be a data node.");continue}const o=searchNode(this.root,t,i,!1,!1);if(!o){warn$1(`XFA - Invalid target: ${i}.`);continue}const[l]=o;if(!l[Ac](t)){warn$1("XFA - Invalid target: must be a property or subproperty.");continue}const c=l[dc]();if(l instanceof Rd||c instanceof Rd){warn$1("XFA - Invalid target: cannot be a setProperty or one of its properties.");continue}if(l instanceof nu||c instanceof nu){warn$1("XFA - Invalid target: cannot be a bindItems or one of its properties.");continue}const h=r[Wc](),u=l[Ec];if(l instanceof Lh){const t=Object.create(null);t[u]=h;const e=Reflect.construct(Object.getPrototypeOf(c).constructor,[t]);c[u]=e[u];continue}l.hasOwnProperty(Vl)?(l[Xl]=r,l[Vl]=h,l[Jl]()):warn$1("XFA - Invalid node to use in setProperty")}}_bindItems(t,e){if(!t.hasOwnProperty("items")||!t.hasOwnProperty("bindItems")||t.bindItems.isEmpty())return;for(const e of t.items.children)t[Lc](e);t.items.clear();const s=new nd({}),i=new nd({});t[$l](s),t.items.push(s),t[$l](i),t.items.push(i);for(const{ref:n,labelRef:a,valueRef:r,connection:o}of t.bindItems.children){if(o)continue;if(!n)continue;const t=searchNode(this.root,e,n,!1,!1);if(t)for(const e of t){if(!e[Ac](this.datasets)){warn$1(`XFA - Invalid ref (${n}): must be a datasets child.`);continue}const t=searchNode(this.root,e,a,!0,!1);if(!t){warn$1(`XFA - Invalid label: ${a}.`);continue}const[o]=t;if(!o[Ac](this.datasets)){warn$1("XFA - Invalid label: must be a datasets child.");continue}const l=searchNode(this.root,e,r,!0,!1);if(!l){warn$1(`XFA - Invalid value: ${r}.`);continue}const[c]=l;if(!c[Ac](this.datasets)){warn$1("XFA - Invalid value: must be a datasets child.");continue}const h=createText(o[Wc]()),u=createText(c[Wc]());s[$l](h),s.text.push(h),i[$l](u),i.text.push(u)}else warn$1(`XFA - Invalid reference: ${n}.`)}}_bindOccurrences(t,e,s){let i;if(e.length>1&&(i=t[Gl](),i[Lc](i.occur),i.occur=null),this._bindValue(t,e[0],s),this._setProperties(t,e[0]),this._bindItems(t,e[0]),1===e.length)return;const n=t[dc](),a=t[Ec],r=n[bc](t);for(let t=1,o=e.length;t<o;t++){const o=e[t],l=i[Gl]();n[a].push(l),n[wc](r+t,l),this._bindValue(l,o,s),this._setProperties(l,o),this._bindItems(l,o)}}_createOccurrences(t){if(!this.emptyMerge)return;const{occur:e}=t;if(!e||e.initial<=1)return;const s=t[dc](),i=t[Ec];if(!(s[i]instanceof Oh))return;let n;n=t.name?s[i].children.filter(e=>e.name===t.name).length:s[i].children.length;const a=s[bc](t)+1,r=e.initial-n;if(r){const e=t[Gl]();e[Lc](e.occur),e.occur=null,s[i].push(e),s[wc](a,e);for(let t=1;t<r;t++){const n=e[Gl]();s[i].push(n),s[wc](a+t,n)}}}_getOccurInfo(t){const{name:e,occur:s}=t;if(!s||!e)return[1,1];const i=-1===s.max?1/0:s.max;return[s.min,i]}_setAndBind(t,e){this._setProperties(t,e),this._bindItems(t,e),this._bindElement(t,e)}_bindElement(t,e){const s=[];this._createOccurrences(t);for(const i of t[lc]()){if(i[Xl])continue;if(void 0===this._mergeMode&&"subform"===i[Ec]){this._mergeMode="consumeData"===i.mergeMode;const t=e[lc]();if(t.length>0)this._bindOccurrences(i,[t[0]],null);else if(this.emptyMerge){const t=e[Mc]===af?-1:e[Mc],s=i[Xl]=new Uh(t,i.name||"root");e[$l](s),this._bindElement(i,s)}continue}if(!i[xc]())continue;let t=!1,n=null,a=null,r=null;if(i.bind){switch(i.bind.match){case"none":this._setAndBind(i,e);continue;case"global":t=!0;break;case"dataRef":if(!i.bind.ref){warn$1(`XFA - ref is empty in node ${i[Ec]}.`),this._setAndBind(i,e);continue}a=i.bind.ref}i.bind.picture&&(n=i.bind.picture[Vl])}const[o,l]=this._getOccurInfo(i);if(a){if(r=searchNode(this.root,e,a,!0,!1),null===r){if(r=createDataNode(this.data,e,a),!r)continue;this._isConsumeData()&&(r[Wl]=!0),this._setAndBind(i,r);continue}this._isConsumeData()&&(r=r.filter(t=>!t[Wl])),r.length>l?r=r.slice(0,l):0===r.length&&(r=null),r&&this._isConsumeData()&&r.forEach(t=>{t[Wl]=!0})}else{if(!i.name){this._setAndBind(i,e);continue}if(this._isConsumeData()){const s=[];for(;s.length<l;){const n=this._findDataByNameToConsume(i.name,i[pc](),e,t);if(!n)break;n[Wl]=!0,s.push(n)}r=s.length>0?s:null}else{if(r=e[oc](i.name,!1,this.emptyMerge).next().value,!r){if(0===o){s.push(i);continue}const t=e[Mc]===af?-1:e[Mc];r=i[Xl]=new Uh(t,i.name),this.emptyMerge&&(r[Wl]=!0),e[$l](r),this._setAndBind(i,r);continue}this.emptyMerge&&(r[Wl]=!0),r=[r]}}r?this._bindOccurrences(i,r,n):o>0?this._setAndBind(i,e):s.push(i)}s.forEach(t=>t[dc]()[Lc](t))}},of=class{constructor(t,e){this.data=e,this.dataset=t.datasets||null}serialize(t){const e=[[-1,this.data[lc]()]];for(;e.length>0;){const s=e.at(-1),[i,n]=s;if(i+1===n.length){e.pop();continue}const a=n[++s[0]],r=t.get(a[Jc]);if(r)a[zc](r);else{const e=a[tc]();for(const s of e.values()){const e=t.get(s[Jc]);if(e){s[zc](e);break}}}const o=a[lc]();o.length>0&&e.push([-1,o])}const s=['<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">'];if(this.dataset)for(const t of this.dataset[lc]())"data"!==t[Ec]&&t[Kc](s);return this.data[Kc](s),s.push("</xfa:datasets>"),s.join("")}},lf=Qc.config.id,cf=class extends Nh{constructor(t){super(lf,"acrobat",!0),this.acrobat7=null,this.autoSave=null,this.common=null,this.validate=null,this.validateApprovalSignatures=null,this.submitUrl=new Oh}},hf=class extends Nh{constructor(t){super(lf,"acrobat7",!0),this.dynamicRender=null}},uf=class extends Hh{constructor(t){super(lf,"ADBE_JSConsole",["delegate","Enable","Disable"])}},df=class extends Hh{constructor(t){super(lf,"ADBE_JSDebugger",["delegate","Enable","Disable"])}},ff=class extends zh{constructor(t){super(lf,"addSilentPrint")}},gf=class extends zh{constructor(t){super(lf,"addViewerPreferences")}},pf=class extends Gh{constructor(t){super(lf,"adjustData")}},mf=class extends qh{constructor(t){super(lf,"adobeExtensionLevel",0,t=>t>=1&&t<=8)}},bf=class extends Nh{constructor(t){super(lf,"agent",!0),this.name=t.name?t.name.trim():"",this.common=new Oh}},wf=class extends $h{constructor(t){super(lf,"alwaysEmbed")}},yf=class extends jh{constructor(t){super(lf,"amd")}},xf=class extends Nh{constructor(t){super(lf,"area"),this.level=getInteger({data:t.level,defaultValue:0,validate:t=>t>=1&&t<=3}),this.name=getStringOption(t.name,["","barcode","coreinit","deviceDriver","font","general","layout","merge","script","signature","sourceSet","templateCache"])}},vf=class extends Hh{constructor(t){super(lf,"attributes",["preserve","delegate","ignore"])}},Af=class extends Hh{constructor(t){super(lf,"autoSave",["disabled","enabled"])}},kf=class extends jh{constructor(t){super(lf,"base")}},Sf=class extends Nh{constructor(t){super(lf,"batchOutput"),this.format=getStringOption(t.format,["none","concat","zip","zipCompress"])}},Cf=class extends $h{constructor(t){super(lf,"behaviorOverride")}[Jl](){this[Vl]=new Map(this[Vl].trim().split(/\s+/).filter(t=>t.includes(":")).map(t=>t.split(":",2)))}},_f=class extends Nh{constructor(t){super(lf,"cache",!0),this.templateCache=null}},If=class extends zh{constructor(t){super(lf,"change")}},Tf=class extends Nh{constructor(t){super(lf,"common",!0),this.data=null,this.locale=null,this.localeSet=null,this.messaging=null,this.suppressBanner=null,this.template=null,this.validationMessaging=null,this.versionControl=null,this.log=new Oh}},Mf=class extends Nh{constructor(t){super(lf,"compress"),this.scope=getStringOption(t.scope,["imageOnly","document"])}},Ef=class extends zh{constructor(t){super(lf,"compressLogicalStructure")}},Ff=class extends Gh{constructor(t){super(lf,"compressObjectStream")}},Df=class extends Nh{constructor(t){super(lf,"compression",!0),this.compressLogicalStructure=null,this.compressObjectStream=null,this.level=null,this.type=null}},Rf=class extends Nh{constructor(t){super(lf,"config",!0),this.acrobat=null,this.present=null,this.trace=null,this.agent=new Oh}},Bf=class extends Hh{constructor(t){super(lf,"conformance",["A","B"])}},Pf=class extends zh{constructor(t){super(lf,"contentCopy")}},Nf=class extends qh{constructor(t){super(lf,"copies",1,t=>t>=1)}},Of=class extends jh{constructor(t){super(lf,"creator")}},Lf=class extends qh{constructor(t){super(lf,"currentPage",0,t=>t>=0)}},Uf=class extends Nh{constructor(t){super(lf,"data",!0),this.adjustData=null,this.attributes=null,this.incrementalLoad=null,this.outputXSL=null,this.range=null,this.record=null,this.startNode=null,this.uri=null,this.window=null,this.xsl=null,this.excludeNS=new Oh,this.transform=new Oh}},$f=class extends Nh{constructor(t){super(lf,"debug",!0),this.uri=null}},Hf=class extends $h{constructor(t){super(lf,"defaultTypeface"),this.writingScript=getStringOption(t.writingScript,["*","Arabic","Cyrillic","EastEuropeanRoman","Greek","Hebrew","Japanese","Korean","Roman","SimplifiedChinese","Thai","TraditionalChinese","Vietnamese"])}},jf=class extends Hh{constructor(t){super(lf,"destination",["pdf","pcl","ps","webClient","zpl"])}},qf=class extends zh{constructor(t){super(lf,"documentAssembly")}},zf=class extends Nh{constructor(t){super(lf,"driver",!0),this.name=t.name?t.name.trim():"",this.fontInfo=null,this.xdc=null}},Gf=class extends Hh{constructor(t){super(lf,"duplexOption",["simplex","duplexFlipLongEdge","duplexFlipShortEdge"])}},Wf=class extends Hh{constructor(t){super(lf,"dynamicRender",["forbidden","required"])}},Vf=class extends zh{constructor(t){super(lf,"embed")}},Xf=class extends zh{constructor(t){super(lf,"encrypt")}},Kf=class extends Nh{constructor(t){super(lf,"encryption",!0),this.encrypt=null,this.encryptionLevel=null,this.permissions=null}},Yf=class extends Hh{constructor(t){super(lf,"encryptionLevel",["40bit","128bit"])}},Jf=class extends jh{constructor(t){super(lf,"enforce")}},Zf=class extends Nh{constructor(t){super(lf,"equate"),this.force=getInteger({data:t.force,defaultValue:1,validate:t=>0===t}),this.from=t.from||"",this.to=t.to||""}},Qf=class extends Nh{constructor(t){super(lf,"equateRange"),this.from=t.from||"",this.to=t.to||"",this._unicodeRange=t.unicodeRange||""}get unicodeRange(){const t=[],e=/U\+([0-9a-fA-F]+)/,s=this._unicodeRange;for(let i of s.split(",").map(t=>t.trim()).filter(t=>!!t))i=i.split("-",2).map(t=>{const s=t.match(e);return s?parseInt(s[1],16):0}),1===i.length&&i.push(i[0]),t.push(i);return shadow$1(this,"unicodeRange",t)}},tg=class extends $h{constructor(t){super(lf,"exclude")}[Jl](){this[Vl]=this[Vl].trim().split(/\s+/).filter(t=>t&&["calculate","close","enter","exit","initialize","ready","validate"].includes(t))}},eg=class extends jh{constructor(t){super(lf,"excludeNS")}},sg=class extends Hh{constructor(t){super(lf,"flipLabel",["usePrinterSetting","on","off"])}},ig=class extends Nh{constructor(t){super(lf,"fontInfo",!0),this.embed=null,this.map=null,this.subsetBelow=null,this.alwaysEmbed=new Oh,this.defaultTypeface=new Oh,this.neverEmbed=new Oh}},ng=class extends zh{constructor(t){super(lf,"formFieldFilling")}},ag=class extends jh{constructor(t){super(lf,"groupParent")}},rg=class extends Hh{constructor(t){super(lf,"ifEmpty",["dataValue","dataGroup","ignore","remove"])}},og=class extends jh{constructor(t){super(lf,"includeXDPContent")}},lg=class extends Hh{constructor(t){super(lf,"incrementalLoad",["none","forwardOnly"])}},cg=class extends zh{constructor(t){super(lf,"incrementalMerge")}},hg=class extends zh{constructor(t){super(lf,"interactive")}},ug=class extends Hh{constructor(t){super(lf,"jog",["usePrinterSetting","none","pageSet"])}},dg=class extends Nh{constructor(t){super(lf,"labelPrinter",!0),this.name=getStringOption(t.name,["zpl","dpl","ipl","tcpl"]),this.batchOutput=null,this.flipLabel=null,this.fontInfo=null,this.xdc=null}},fg=class extends Hh{constructor(t){super(lf,"layout",["paginate","panel"])}},gg=class extends qh{constructor(t){super(lf,"level",0,t=>t>0)}},pg=class extends zh{constructor(t){super(lf,"linearized")}},mg=class extends jh{constructor(t){super(lf,"locale")}},bg=class extends jh{constructor(t){super(lf,"localeSet")}},wg=class extends Nh{constructor(t){super(lf,"log",!0),this.mode=null,this.threshold=null,this.to=null,this.uri=null}},yg=class extends Nh{constructor(t){super(lf,"map",!0),this.equate=new Oh,this.equateRange=new Oh}},xg=class extends Nh{constructor(t){super(lf,"mediumInfo",!0),this.map=null}},vg=class extends Nh{constructor(t){super(lf,"message",!0),this.msgId=null,this.severity=null}},Ag=class extends Nh{constructor(t){super(lf,"messaging",!0),this.message=new Oh}},kg=class extends Hh{constructor(t){super(lf,"mode",["append","overwrite"])}},Sg=class extends zh{constructor(t){super(lf,"modifyAnnots")}},Cg=class extends qh{constructor(t){super(lf,"msgId",1,t=>t>=1)}},_g=class extends jh{constructor(t){super(lf,"nameAttr")}},Ig=class extends $h{constructor(t){super(lf,"neverEmbed")}},Tg=class extends qh{constructor(t){super(lf,"numberOfCopies",null,t=>t>=2&&t<=5)}},Mg=class extends Nh{constructor(t){super(lf,"openAction",!0),this.destination=null}},Eg=class extends Nh{constructor(t){super(lf,"output",!0),this.to=null,this.type=null,this.uri=null}},Fg=class extends jh{constructor(t){super(lf,"outputBin")}},Dg=class extends Nh{constructor(t){super(lf,"outputXSL",!0),this.uri=null}},Rg=class extends Hh{constructor(t){super(lf,"overprint",["none","both","draw","field"])}},Bg=class extends jh{constructor(t){super(lf,"packets")}[Jl](){"*"!==this[Vl]&&(this[Vl]=this[Vl].trim().split(/\s+/).filter(t=>["config","datasets","template","xfdf","xslt"].includes(t)))}},Pg=class extends Nh{constructor(t){super(lf,"pageOffset"),this.x=getInteger({data:t.x,defaultValue:"useXDCSetting",validate:t=>!0}),this.y=getInteger({data:t.y,defaultValue:"useXDCSetting",validate:t=>!0})}},Ng=class extends jh{constructor(t){super(lf,"pageRange")}[Jl](){const t=this[Vl].trim().split(/\s+/).map(t=>parseInt(t,10)),e=[];for(let s=0,i=t.length;s<i;s+=2)e.push(t.slice(s,s+2));this[Vl]=e}},Og=class extends Hh{constructor(t){super(lf,"pagination",["simplex","duplexShortEdge","duplexLongEdge"])}},Lg=class extends Hh{constructor(t){super(lf,"paginationOverride",["none","forceDuplex","forceDuplexLongEdge","forceDuplexShortEdge","forceSimplex"])}},Ug=class extends qh{constructor(t){super(lf,"part",1,t=>!1)}},$g=class extends Nh{constructor(t){super(lf,"pcl",!0),this.name=t.name||"",this.batchOutput=null,this.fontInfo=null,this.jog=null,this.mediumInfo=null,this.outputBin=null,this.pageOffset=null,this.staple=null,this.xdc=null}},Hg=class extends Nh{constructor(t){super(lf,"pdf",!0),this.name=t.name||"",this.adobeExtensionLevel=null,this.batchOutput=null,this.compression=null,this.creator=null,this.encryption=null,this.fontInfo=null,this.interactive=null,this.linearized=null,this.openAction=null,this.pdfa=null,this.producer=null,this.renderPolicy=null,this.scriptModel=null,this.silentPrint=null,this.submitFormat=null,this.tagged=null,this.version=null,this.viewerPreferences=null,this.xdc=null}},jg=class extends Nh{constructor(t){super(lf,"pdfa",!0),this.amd=null,this.conformance=null,this.includeXDPContent=null,this.part=null}},qg=class extends Nh{constructor(t){super(lf,"permissions",!0),this.accessibleContent=null,this.change=null,this.contentCopy=null,this.documentAssembly=null,this.formFieldFilling=null,this.modifyAnnots=null,this.plaintextMetadata=null,this.print=null,this.printHighQuality=null}},zg=class extends zh{constructor(t){super(lf,"pickTrayByPDFSize")}},Gg=class extends jh{constructor(t){super(lf,"picture")}},Wg=class extends zh{constructor(t){super(lf,"plaintextMetadata")}},Vg=class extends Hh{constructor(t){super(lf,"presence",["preserve","dissolve","dissolveStructure","ignore","remove"])}},Xg=class extends Nh{constructor(t){super(lf,"present",!0),this.behaviorOverride=null,this.cache=null,this.common=null,this.copies=null,this.destination=null,this.incrementalMerge=null,this.layout=null,this.output=null,this.overprint=null,this.pagination=null,this.paginationOverride=null,this.script=null,this.validate=null,this.xdp=null,this.driver=new Oh,this.labelPrinter=new Oh,this.pcl=new Oh,this.pdf=new Oh,this.ps=new Oh,this.submitUrl=new Oh,this.webClient=new Oh,this.zpl=new Oh}},Kg=class extends zh{constructor(t){super(lf,"print")}},Yg=class extends zh{constructor(t){super(lf,"printHighQuality")}},Jg=class extends Hh{constructor(t){super(lf,"printScaling",["appdefault","noScaling"])}},Zg=class extends jh{constructor(t){super(lf,"printerName")}},Qg=class extends jh{constructor(t){super(lf,"producer")}},tp=class extends Nh{constructor(t){super(lf,"ps",!0),this.name=t.name||"",this.batchOutput=null,this.fontInfo=null,this.jog=null,this.mediumInfo=null,this.outputBin=null,this.staple=null,this.xdc=null}},ep=class extends $h{constructor(t){super(lf,"range")}[Jl](){this[Vl]=this[Vl].split(",",2).map(t=>t.split("-").map(t=>parseInt(t.trim(),10))).filter(t=>t.every(t=>!isNaN(t))).map(t=>(1===t.length&&t.push(t[0]),t))}},sp=class extends $h{constructor(t){super(lf,"record")}[Jl](){this[Vl]=this[Vl].trim();const t=parseInt(this[Vl],10);!isNaN(t)&&t>=0&&(this[Vl]=t)}},ip=class extends $h{constructor(t){super(lf,"relevant")}[Jl](){this[Vl]=this[Vl].trim().split(/\s+/)}},np=class extends $h{constructor(t){super(lf,"rename")}[Jl](){this[Vl]=this[Vl].trim(),(this[Vl].toLowerCase().startsWith("xml")||new RegExp("[\\p{L}_][\\p{L}\\d._\\p{M}-]*","u").test(this[Vl]))&&warn$1("XFA - Rename: invalid XFA name")}},ap=class extends Hh{constructor(t){super(lf,"renderPolicy",["server","client"])}},rp=class extends Hh{constructor(t){super(lf,"runScripts",["both","client","none","server"])}},op=class extends Nh{constructor(t){super(lf,"script",!0),this.currentPage=null,this.exclude=null,this.runScripts=null}},lp=class extends Hh{constructor(t){super(lf,"scriptModel",["XFA","none"])}},cp=class extends Hh{constructor(t){super(lf,"severity",["ignore","error","information","trace","warning"])}},hp=class extends Nh{constructor(t){super(lf,"silentPrint",!0),this.addSilentPrint=null,this.printerName=null}},up=class extends Nh{constructor(t){super(lf,"staple"),this.mode=getStringOption(t.mode,["usePrinterSetting","on","off"])}},dp=class extends jh{constructor(t){super(lf,"startNode")}},fp=class extends qh{constructor(t){super(lf,"startPage",0,t=>!0)}},gp=class extends Hh{constructor(t){super(lf,"submitFormat",["html","delegate","fdf","xml","pdf"])}},pp=class extends jh{constructor(t){super(lf,"submitUrl")}},mp=class extends qh{constructor(t){super(lf,"subsetBelow",100,t=>t>=0&&t<=100)}},bp=class extends zh{constructor(t){super(lf,"suppressBanner")}},wp=class extends zh{constructor(t){super(lf,"tagged")}},yp=class extends Nh{constructor(t){super(lf,"template",!0),this.base=null,this.relevant=null,this.startPage=null,this.uri=null,this.xsl=null}},xp=class extends Hh{constructor(t){super(lf,"threshold",["trace","error","information","warning"])}},vp=class extends Hh{constructor(t){super(lf,"to",["null","memory","stderr","stdout","system","uri"])}},Ap=class extends Nh{constructor(t){super(lf,"templateCache"),this.maxEntries=getInteger({data:t.maxEntries,defaultValue:5,validate:t=>t>=0})}},kp=class extends Nh{constructor(t){super(lf,"trace",!0),this.area=new Oh}},Sp=class extends Nh{constructor(t){super(lf,"transform",!0),this.groupParent=null,this.ifEmpty=null,this.nameAttr=null,this.picture=null,this.presence=null,this.rename=null,this.whitespace=null}},Cp=class extends Hh{constructor(t){super(lf,"type",["none","ascii85","asciiHex","ccittfax","flate","lzw","runLength","native","xdp","mergedXDP"])}},_p=class extends jh{constructor(t){super(lf,"uri")}},Ip=class extends Hh{constructor(t){super(lf,"validate",["preSubmit","prePrint","preExecute","preSave"])}},Tp=class extends $h{constructor(t){super(lf,"validateApprovalSignatures")}[Jl](){this[Vl]=this[Vl].trim().split(/\s+/).filter(t=>["docReady","postSign"].includes(t))}},Mp=class extends Hh{constructor(t){super(lf,"validationMessaging",["allMessagesIndividually","allMessagesTogether","firstMessageOnly","noMessages"])}},Ep=class extends Hh{constructor(t){super(lf,"version",["1.7","1.6","1.5","1.4","1.3","1.2"])}},Fp=class extends Nh{constructor(t){super(lf,"VersionControl"),this.outputBelow=getStringOption(t.outputBelow,["warn","error","update"]),this.sourceAbove=getStringOption(t.sourceAbove,["warn","error"]),this.sourceBelow=getStringOption(t.sourceBelow,["update","maintain"])}},Dp=class extends Nh{constructor(t){super(lf,"viewerPreferences",!0),this.ADBE_JSConsole=null,this.ADBE_JSDebugger=null,this.addViewerPreferences=null,this.duplexOption=null,this.enforce=null,this.numberOfCopies=null,this.pageRange=null,this.pickTrayByPDFSize=null,this.printScaling=null}},Rp=class extends Nh{constructor(t){super(lf,"webClient",!0),this.name=t.name?t.name.trim():"",this.fontInfo=null,this.xdc=null}},Bp=class extends Hh{constructor(t){super(lf,"whitespace",["preserve","ltrim","normalize","rtrim","trim"])}},Pp=class extends $h{constructor(t){super(lf,"window")}[Jl](){const t=this[Vl].split(",",2).map(t=>parseInt(t.trim(),10));t.some(t=>isNaN(t))?this[Vl]=[0,0]:(1===t.length&&t.push(t[0]),this[Vl]=t)}},Np=class extends Nh{constructor(t){super(lf,"xdc",!0),this.uri=new Oh,this.xsl=new Oh}},Op=class extends Nh{constructor(t){super(lf,"xdp",!0),this.packets=null}},Lp=class extends Nh{constructor(t){super(lf,"xsl",!0),this.debug=null,this.uri=null}},Up=class extends Nh{constructor(t){super(lf,"zpl",!0),this.name=t.name?t.name.trim():"",this.batchOutput=null,this.flipLabel=null,this.fontInfo=null,this.xdc=null}},$p=class _ConfigNamespace{static[Zc](t,e){if(_ConfigNamespace.hasOwnProperty(t))return _ConfigNamespace[t](e)}static acrobat(t){return new cf(t)}static acrobat7(t){return new hf(t)}static ADBE_JSConsole(t){return new uf(t)}static ADBE_JSDebugger(t){return new df(t)}static addSilentPrint(t){return new ff(t)}static addViewerPreferences(t){return new gf(t)}static adjustData(t){return new pf(t)}static adobeExtensionLevel(t){return new mf(t)}static agent(t){return new bf(t)}static alwaysEmbed(t){return new wf(t)}static amd(t){return new yf(t)}static area(t){return new xf(t)}static attributes(t){return new vf(t)}static autoSave(t){return new Af(t)}static base(t){return new kf(t)}static batchOutput(t){return new Sf(t)}static behaviorOverride(t){return new Cf(t)}static cache(t){return new _f(t)}static change(t){return new If(t)}static common(t){return new Tf(t)}static compress(t){return new Mf(t)}static compressLogicalStructure(t){return new Ef(t)}static compressObjectStream(t){return new Ff(t)}static compression(t){return new Df(t)}static config(t){return new Rf(t)}static conformance(t){return new Bf(t)}static contentCopy(t){return new Pf(t)}static copies(t){return new Nf(t)}static creator(t){return new Of(t)}static currentPage(t){return new Lf(t)}static data(t){return new Uf(t)}static debug(t){return new $f(t)}static defaultTypeface(t){return new Hf(t)}static destination(t){return new jf(t)}static documentAssembly(t){return new qf(t)}static driver(t){return new zf(t)}static duplexOption(t){return new Gf(t)}static dynamicRender(t){return new Wf(t)}static embed(t){return new Vf(t)}static encrypt(t){return new Xf(t)}static encryption(t){return new Kf(t)}static encryptionLevel(t){return new Yf(t)}static enforce(t){return new Jf(t)}static equate(t){return new Zf(t)}static equateRange(t){return new Qf(t)}static exclude(t){return new tg(t)}static excludeNS(t){return new eg(t)}static flipLabel(t){return new sg(t)}static fontInfo(t){return new ig(t)}static formFieldFilling(t){return new ng(t)}static groupParent(t){return new ag(t)}static ifEmpty(t){return new rg(t)}static includeXDPContent(t){return new og(t)}static incrementalLoad(t){return new lg(t)}static incrementalMerge(t){return new cg(t)}static interactive(t){return new hg(t)}static jog(t){return new ug(t)}static labelPrinter(t){return new dg(t)}static layout(t){return new fg(t)}static level(t){return new gg(t)}static linearized(t){return new pg(t)}static locale(t){return new mg(t)}static localeSet(t){return new bg(t)}static log(t){return new wg(t)}static map(t){return new yg(t)}static mediumInfo(t){return new xg(t)}static message(t){return new vg(t)}static messaging(t){return new Ag(t)}static mode(t){return new kg(t)}static modifyAnnots(t){return new Sg(t)}static msgId(t){return new Cg(t)}static nameAttr(t){return new _g(t)}static neverEmbed(t){return new Ig(t)}static numberOfCopies(t){return new Tg(t)}static openAction(t){return new Mg(t)}static output(t){return new Eg(t)}static outputBin(t){return new Fg(t)}static outputXSL(t){return new Dg(t)}static overprint(t){return new Rg(t)}static packets(t){return new Bg(t)}static pageOffset(t){return new Pg(t)}static pageRange(t){return new Ng(t)}static pagination(t){return new Og(t)}static paginationOverride(t){return new Lg(t)}static part(t){return new Ug(t)}static pcl(t){return new $g(t)}static pdf(t){return new Hg(t)}static pdfa(t){return new jg(t)}static permissions(t){return new qg(t)}static pickTrayByPDFSize(t){return new zg(t)}static picture(t){return new Gg(t)}static plaintextMetadata(t){return new Wg(t)}static presence(t){return new Vg(t)}static present(t){return new Xg(t)}static print(t){return new Kg(t)}static printHighQuality(t){return new Yg(t)}static printScaling(t){return new Jg(t)}static printerName(t){return new Zg(t)}static producer(t){return new Qg(t)}static ps(t){return new tp(t)}static range(t){return new ep(t)}static record(t){return new sp(t)}static relevant(t){return new ip(t)}static rename(t){return new np(t)}static renderPolicy(t){return new ap(t)}static runScripts(t){return new rp(t)}static script(t){return new op(t)}static scriptModel(t){return new lp(t)}static severity(t){return new cp(t)}static silentPrint(t){return new hp(t)}static staple(t){return new up(t)}static startNode(t){return new dp(t)}static startPage(t){return new fp(t)}static submitFormat(t){return new gp(t)}static submitUrl(t){return new pp(t)}static subsetBelow(t){return new mp(t)}static suppressBanner(t){return new bp(t)}static tagged(t){return new wp(t)}static template(t){return new yp(t)}static templateCache(t){return new Ap(t)}static threshold(t){return new xp(t)}static to(t){return new vp(t)}static trace(t){return new kp(t)}static transform(t){return new Sp(t)}static type(t){return new Cp(t)}static uri(t){return new _p(t)}static validate(t){return new Ip(t)}static validateApprovalSignatures(t){return new Tp(t)}static validationMessaging(t){return new Mp(t)}static version(t){return new Ep(t)}static versionControl(t){return new Fp(t)}static viewerPreferences(t){return new Dp(t)}static webClient(t){return new Rp(t)}static whitespace(t){return new Bp(t)}static window(t){return new Pp(t)}static xdc(t){return new Np(t)}static xdp(t){return new Op(t)}static xsl(t){return new Lp(t)}static zpl(t){return new Up(t)}},Hp=Qc.connectionSet.id,jp=class extends Nh{constructor(t){super(Hp,"connectionSet",!0),this.wsdlConnection=new Oh,this.xmlConnection=new Oh,this.xsdConnection=new Oh}},qp=class extends Nh{constructor(t){super(Hp,"effectiveInputPolicy"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}},zp=class extends Nh{constructor(t){super(Hp,"effectiveOutputPolicy"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}},Gp=class extends jh{constructor(t){super(Hp,"operation"),this.id=t.id||"",this.input=t.input||"",this.name=t.name||"",this.output=t.output||"",this.use=t.use||"",this.usehref=t.usehref||""}},Wp=class extends jh{constructor(t){super(Hp,"rootElement"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}},Vp=class extends jh{constructor(t){super(Hp,"soapAction"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}},Xp=class extends jh{constructor(t){super(Hp,"soapAddress"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}},Kp=class extends jh{constructor(t){super(Hp,"uri"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}},Yp=class extends jh{constructor(t){super(Hp,"wsdlAddress"),this.id=t.id||"",this.name=t.name||"",this.use=t.use||"",this.usehref=t.usehref||""}},Jp=class extends Nh{constructor(t){super(Hp,"wsdlConnection",!0),this.dataDescription=t.dataDescription||"",this.name=t.name||"",this.effectiveInputPolicy=null,this.effectiveOutputPolicy=null,this.operation=null,this.soapAction=null,this.soapAddress=null,this.wsdlAddress=null}},Zp=class extends Nh{constructor(t){super(Hp,"xmlConnection",!0),this.dataDescription=t.dataDescription||"",this.name=t.name||"",this.uri=null}},Qp=class extends Nh{constructor(t){super(Hp,"xsdConnection",!0),this.dataDescription=t.dataDescription||"",this.name=t.name||"",this.rootElement=null,this.uri=null}},tm=class _ConnectionSetNamespace{static[Zc](t,e){if(_ConnectionSetNamespace.hasOwnProperty(t))return _ConnectionSetNamespace[t](e)}static connectionSet(t){return new jp(t)}static effectiveInputPolicy(t){return new qp(t)}static effectiveOutputPolicy(t){return new zp(t)}static operation(t){return new Gp(t)}static rootElement(t){return new Wp(t)}static soapAction(t){return new Vp(t)}static soapAddress(t){return new Xp(t)}static uri(t){return new Kp(t)}static wsdlAddress(t){return new Yp(t)}static wsdlConnection(t){return new Jp(t)}static xmlConnection(t){return new Zp(t)}static xsdConnection(t){return new Qp(t)}},em=Qc.datasets.id,sm=class extends Uh{constructor(t){super(em,"data",t)}[kc](){return!0}},im=class extends Nh{constructor(t){super(em,"datasets",!0),this.data=null,this.Signature=null}[Dc](t){const e=t[Ec];("data"===e&&t[Mc]===em||"Signature"===e&&t[Mc]===Qc.signature.id)&&(this[e]=t),this[$l](t)}},nm=class _DatasetsNamespace{static[Zc](t,e){if(_DatasetsNamespace.hasOwnProperty(t))return _DatasetsNamespace[t](e)}static datasets(t){return new im(t)}static data(t){return new sm(t)}},am=Qc.localeSet.id,rm=class extends Nh{constructor(t){super(am,"calendarSymbols",!0),this.name="gregorian",this.dayNames=new Oh(2),this.eraNames=null,this.meridiemNames=null,this.monthNames=new Oh(2)}},om=class extends jh{constructor(t){super(am,"currencySymbol"),this.name=getStringOption(t.name,["symbol","isoname","decimal"])}},lm=class extends Nh{constructor(t){super(am,"currencySymbols",!0),this.currencySymbol=new Oh(3)}},cm=class extends jh{constructor(t){super(am,"datePattern"),this.name=getStringOption(t.name,["full","long","med","short"])}},hm=class extends Nh{constructor(t){super(am,"datePatterns",!0),this.datePattern=new Oh(4)}},um=class extends $h{constructor(t){super(am,"dateTimeSymbols")}},dm=class extends jh{constructor(t){super(am,"day")}},fm=class extends Nh{constructor(t){super(am,"dayNames",!0),this.abbr=getInteger({data:t.abbr,defaultValue:0,validate:t=>1===t}),this.day=new Oh(7)}},gm=class extends jh{constructor(t){super(am,"era")}},pm=class extends Nh{constructor(t){super(am,"eraNames",!0),this.era=new Oh(2)}},mm=class extends Nh{constructor(t){super(am,"locale",!0),this.desc=t.desc||"",this.name="isoname",this.calendarSymbols=null,this.currencySymbols=null,this.datePatterns=null,this.dateTimeSymbols=null,this.numberPatterns=null,this.numberSymbols=null,this.timePatterns=null,this.typeFaces=null}},bm=class extends Nh{constructor(t){super(am,"localeSet",!0),this.locale=new Oh}},wm=class extends jh{constructor(t){super(am,"meridiem")}},ym=class extends Nh{constructor(t){super(am,"meridiemNames",!0),this.meridiem=new Oh(2)}},xm=class extends jh{constructor(t){super(am,"month")}},vm=class extends Nh{constructor(t){super(am,"monthNames",!0),this.abbr=getInteger({data:t.abbr,defaultValue:0,validate:t=>1===t}),this.month=new Oh(12)}},Am=class extends jh{constructor(t){super(am,"numberPattern"),this.name=getStringOption(t.name,["full","long","med","short"])}},km=class extends Nh{constructor(t){super(am,"numberPatterns",!0),this.numberPattern=new Oh(4)}},Sm=class extends jh{constructor(t){super(am,"numberSymbol"),this.name=getStringOption(t.name,["decimal","grouping","percent","minus","zero"])}},Cm=class extends Nh{constructor(t){super(am,"numberSymbols",!0),this.numberSymbol=new Oh(5)}},_m=class extends jh{constructor(t){super(am,"timePattern"),this.name=getStringOption(t.name,["full","long","med","short"])}},Im=class extends Nh{constructor(t){super(am,"timePatterns",!0),this.timePattern=new Oh(4)}},Tm=class extends Nh{constructor(t){super(am,"typeFace",!0),this.name=""|t.name}},Mm=class extends Nh{constructor(t){super(am,"typeFaces",!0),this.typeFace=new Oh}},Em=class _LocaleSetNamespace{static[Zc](t,e){if(_LocaleSetNamespace.hasOwnProperty(t))return _LocaleSetNamespace[t](e)}static calendarSymbols(t){return new rm(t)}static currencySymbol(t){return new om(t)}static currencySymbols(t){return new lm(t)}static datePattern(t){return new cm(t)}static datePatterns(t){return new hm(t)}static dateTimeSymbols(t){return new um(t)}static day(t){return new dm(t)}static dayNames(t){return new fm(t)}static era(t){return new gm(t)}static eraNames(t){return new pm(t)}static locale(t){return new mm(t)}static localeSet(t){return new bm(t)}static meridiem(t){return new wm(t)}static meridiemNames(t){return new ym(t)}static month(t){return new xm(t)}static monthNames(t){return new vm(t)}static numberPattern(t){return new Am(t)}static numberPatterns(t){return new km(t)}static numberSymbol(t){return new Sm(t)}static numberSymbols(t){return new Cm(t)}static timePattern(t){return new _m(t)}static timePatterns(t){return new Im(t)}static typeFace(t){return new Tm(t)}static typeFaces(t){return new Mm(t)}},Fm=Qc.signature.id,Dm=class extends Nh{constructor(t){super(Fm,"signature",!0)}},Rm=class _SignatureNamespace{static[Zc](t,e){if(_SignatureNamespace.hasOwnProperty(t))return _SignatureNamespace[t](e)}static signature(t){return new Dm(t)}},Bm=Qc.stylesheet.id,Pm=class extends Nh{constructor(t){super(Bm,"stylesheet",!0)}},Nm=class _StylesheetNamespace{static[Zc](t,e){if(_StylesheetNamespace.hasOwnProperty(t))return _StylesheetNamespace[t](e)}static stylesheet(t){return new Pm(t)}},Om=Qc.xdp.id,Lm=class extends Nh{constructor(t){super(Om,"xdp",!0),this.uuid=t.uuid||"",this.timeStamp=t.timeStamp||"",this.config=null,this.connectionSet=null,this.datasets=null,this.localeSet=null,this.stylesheet=new Oh,this.template=null}[Rc](t){const e=Qc[t[Ec]];return e&&t[Mc]===e.id}},Um=class _XdpNamespace{static[Zc](t,e){if(_XdpNamespace.hasOwnProperty(t))return _XdpNamespace[t](e)}static xdp(t){return new Lm(t)}},$m=Qc.xhtml.id,Hm=Symbol(),jm=new Set(["color","font","font-family","font-size","font-stretch","font-style","font-weight","margin","margin-bottom","margin-left","margin-right","margin-top","letter-spacing","line-height","orphans","page-break-after","page-break-before","page-break-inside","tab-interval","tab-stop","text-align","text-decoration","text-indent","vertical-align","widows","kerning-mode","xfa-font-horizontal-scale","xfa-font-vertical-scale","xfa-spacerun","xfa-tab-stops"]),qm=new Map([["page-break-after","breakAfter"],["page-break-before","breakBefore"],["page-break-inside","breakInside"],["kerning-mode",t=>"none"===t?"none":"normal"],["xfa-font-horizontal-scale",t=>`scaleX(${Math.max(0,parseInt(t)/100).toFixed(2)})`],["xfa-font-vertical-scale",t=>`scaleY(${Math.max(0,parseInt(t)/100).toFixed(2)})`],["xfa-spacerun",""],["xfa-tab-stops",""],["font-size",(t,e)=>measureToString(.99*(t=e.fontSize=Math.abs(getMeasurement(t))))],["letter-spacing",t=>measureToString(getMeasurement(t))],["line-height",t=>measureToString(getMeasurement(t))],["margin",t=>measureToString(getMeasurement(t))],["margin-bottom",t=>measureToString(getMeasurement(t))],["margin-left",t=>measureToString(getMeasurement(t))],["margin-right",t=>measureToString(getMeasurement(t))],["margin-top",t=>measureToString(getMeasurement(t))],["text-indent",t=>measureToString(getMeasurement(t))],["font-family",t=>t],["vertical-align",t=>measureToString(getMeasurement(t))]]),zm=/\s+/g,Gm=/[\r\n]+/g,Wm=/\r\n?/g;function mapStyle(t,e,s){const i=Object.create(null);if(!t)return i;const n=Object.create(null);for(const[e,s]of t.split(";").map(t=>t.split(":",2))){const t=qm.get(e);if(""===t)continue;let a=s;t&&(a="string"==typeof t?t:t(s,n)),e.endsWith("scale")?i.transform=i.transform?`${i[e]} ${a}`:a:i[e.replaceAll(/-([a-zA-Z])/g,(t,e)=>e.toUpperCase())]=a}if(i.fontFamily&&setFontFamily({typeface:i.fontFamily,weight:i.fontWeight||"normal",posture:i.fontStyle||"normal",size:n.fontSize||0},e,e[gc].fontFinder,i),s&&i.verticalAlign&&"0px"!==i.verticalAlign&&i.fontSize){const t=.583,e=.333,s=getMeasurement(i.fontSize);i.fontSize=measureToString(s*t),i.verticalAlign=measureToString(Math.sign(getMeasurement(i.verticalAlign))*s*e)}return s&&i.fontSize&&(i.fontSize=`calc(${i.fontSize} * var(--total-scale-factor))`),fixTextIndent(i),i}var Vm=new Set(["body","html"]),Xm=class extends Uh{constructor(t,e){super($m,e),this[Hm]=!1,this.style=t.style||""}[jl](t){var e;super[jl](t),this.style=(e=this).style?e.style.split(";").filter(t=>!!t.trim()).map(t=>t.split(":",2).map(t=>t.trim())).filter(([t,s])=>("font-family"===t&&e[gc].usedTypefaces.add(s),jm.has(t))).map(t=>t.join(":")).join(";"):""}[Ll](){return!Vm.has(this[Ec])}[Bc](t,e=!1){e?this[Hm]=!0:(t=t.replaceAll(Gm,""),this.style.includes("xfa-spacerun:yes")||(t=t.replaceAll(zm," "))),t&&(this[Vl]+=t)}[Pc](t,e=!0){const s=Object.create(null),i={top:NaN,bottom:NaN,left:NaN,right:NaN};let n=null;for(const[t,e]of this.style.split(";").map(t=>t.split(":",2)))switch(t){case"font-family":s.typeface=stripQuotes(e);break;case"font-size":s.size=getMeasurement(e);break;case"font-weight":s.weight=e;break;case"font-style":s.posture=e;break;case"letter-spacing":s.letterSpacing=getMeasurement(e);break;case"margin":const t=e.split(/ \t/).map(t=>getMeasurement(t));switch(t.length){case 1:i.top=i.bottom=i.left=i.right=t[0];break;case 2:i.top=i.bottom=t[0],i.left=i.right=t[1];break;case 3:i.top=t[0],i.bottom=t[2],i.left=i.right=t[1];break;case 4:i.top=t[0],i.left=t[1],i.bottom=t[2],i.right=t[3]}break;case"margin-top":i.top=getMeasurement(e);break;case"margin-bottom":i.bottom=getMeasurement(e);break;case"margin-left":i.left=getMeasurement(e);break;case"margin-right":i.right=getMeasurement(e);break;case"line-height":n=getMeasurement(e)}if(t.pushData(s,i,n),this[Vl])t.addString(this[Vl]);else for(const e of this[lc]())"#text"!==e[Ec]?e[Pc](t):t.addString(e[Vl]);e&&t.popFont()}[Xc](t){const e=[];if(this[Yl]={children:e},this[Hl]({}),0===e.length&&!this[Vl])return sh.EMPTY;let s;return s=this[Hm]?this[Vl]?this[Vl].replaceAll(Wm,"\n"):void 0:this[Vl]||void 0,sh.success({name:this[Ec],attributes:{href:this.href,style:mapStyle(this.style,this,this[Hm])},children:e,value:s})}},Km=class extends Xm{constructor(t){super(t,"a"),this.href=fixURL(t.href)||""}},Ym=class extends Xm{constructor(t){super(t,"b")}[Pc](t){t.pushFont({weight:"bold"}),super[Pc](t),t.popFont()}},Jm=class extends Xm{constructor(t){super(t,"body")}[Xc](t){const e=super[Xc](t),{html:s}=e;return s?(s.name="div",s.attributes.class=["xfaRich"],e):sh.EMPTY}},Zm=class extends Xm{constructor(t){super(t,"br")}[Wc](){return"\n"}[Pc](t){t.addString("\n")}[Xc](t){return sh.success({name:"br"})}},Qm=class extends Xm{constructor(t){super(t,"html")}[Xc](t){const e=[];if(this[Yl]={children:e},this[Hl]({}),0===e.length)return sh.success({name:"div",attributes:{class:["xfaRich"],style:{}},value:this[Vl]||""});if(1===e.length){const t=e[0];if(t.attributes?.class.includes("xfaRich"))return sh.success(t)}return sh.success({name:"div",attributes:{class:["xfaRich"],style:{}},children:e})}},tb=class extends Xm{constructor(t){super(t,"i")}[Pc](t){t.pushFont({posture:"italic"}),super[Pc](t),t.popFont()}},eb=class extends Xm{constructor(t){super(t,"li")}},sb=class extends Xm{constructor(t){super(t,"ol")}},ib=class extends Xm{constructor(t){super(t,"p")}[Pc](t){super[Pc](t,!1),t.addString("\n"),t.addPara(),t.popFont()}[Wc](){return this[dc]()[lc]().at(-1)===this?super[Wc]():super[Wc]()+"\n"}},nb=class extends Xm{constructor(t){super(t,"span")}},ab=class extends Xm{constructor(t){super(t,"sub")}},rb=class extends Xm{constructor(t){super(t,"sup")}},ob=class extends Xm{constructor(t){super(t,"ul")}},lb=class _XhtmlNamespace{static[Zc](t,e){if(_XhtmlNamespace.hasOwnProperty(t))return _XhtmlNamespace[t](e)}static a(t){return new Km(t)}static b(t){return new Ym(t)}static body(t){return new Jm(t)}static br(t){return new Zm(t)}static html(t){return new Qm(t)}static i(t){return new tb(t)}static li(t){return new eb(t)}static ol(t){return new sb(t)}static p(t){return new ib(t)}static span(t){return new nb(t)}static sub(t){return new ab(t)}static sup(t){return new rb(t)}static ul(t){return new ob(t)}},cb={config:$p,connection:tm,datasets:nm,localeSet:Em,signature:Rm,stylesheet:Nm,template:nf,xdp:Um,xhtml:lb},hb=class{constructor(t){this.namespaceId=t}[Zc](t,e){return new Uh(this.namespaceId,t,e)}},ub=class extends Nh{constructor(t){super(-1,"root",Object.create(null)),this.element=null,this[mc]=t}[Dc](t){return this.element=t,!0}[Jl](){super[Jl](),this.element.template instanceof Gd&&(this[mc].set(Uc,this.element),this.element.template[$c](this[mc]),this.element.template[mc]=this[mc])}},db=class extends Nh{constructor(){super(-1,"",Object.create(null))}[Dc](t){return!1}},fb=class{constructor(t=null){this._namespaceStack=[],this._nsAgnosticLevel=0,this._namespacePrefixes=new Map,this._namespaces=new Map,this._nextNsId=Math.max(...Object.values(Qc).map(({id:t})=>t)),this._currentNamespace=t||new hb(++this._nextNsId)}buildRoot(t){return new ub(t)}build({nsPrefix:t,name:e,attributes:s,namespace:i,prefixes:n}){const a=null!==i;if(a&&(this._namespaceStack.push(this._currentNamespace),this._currentNamespace=this._searchNamespace(i)),n&&this._addNamespacePrefix(n),s.hasOwnProperty(Fc)){const t=cb.datasets,e=s[Fc];let i=null;for(const[s,n]of Object.entries(e))if(this._getNamespaceToUse(s)===t){i={xfa:n};break}i?s[Fc]=i:delete s[Fc]}const r=this._getNamespaceToUse(t),o=r?.[Zc](e,s)||new db;return o[kc]()&&this._nsAgnosticLevel++,(a||n||o[kc]())&&(o[zl]={hasNamespace:a,prefixes:n,nsAgnostic:o[kc]()}),o}isNsAgnostic(){return this._nsAgnosticLevel>0}_searchNamespace(t){let e=this._namespaces.get(t);if(e)return e;for(const[s,{check:i}]of Object.entries(Qc))if(i(t)){if(e=cb[s],e)return this._namespaces.set(t,e),e;break}return e=new hb(++this._nextNsId),this._namespaces.set(t,e),e}_addNamespacePrefix(t){for(const{prefix:e,value:s}of t){const t=this._searchNamespace(s);let i=this._namespacePrefixes.get(e);i||(i=[],this._namespacePrefixes.set(e,i)),i.push(t)}}_getNamespaceToUse(t){if(!t)return this._currentNamespace;const e=this._namespacePrefixes.get(t);return e?.length>0?e.at(-1):(warn$1(`Unknown namespace prefix: ${t}.`),null)}clean(t){const{hasNamespace:e,prefixes:s,nsAgnostic:i}=t;e&&(this._currentNamespace=this._namespaceStack.pop()),s&&s.forEach(({prefix:t})=>{this._namespacePrefixes.get(t).pop()}),i&&this._nsAgnosticLevel--}},gb=class _XFAParser extends Al{constructor(t=null,e=!1){super(),this._builder=new fb(t),this._stack=[],this._globalData={usedTypefaces:new Set},this._ids=new Map,this._current=this._builder.buildRoot(this._ids),this._errorCode=pl,this._whiteRegex=/^\s+$/,this._nbsps=/\xa0+/g,this._richText=e}parse(t){if(this.parseXml(t),this._errorCode===pl)return this._current[Jl](),this._current.element}onText(t){t=t.replace(this._nbsps,t=>t.slice(1)+" "),this._richText||this._current[Ll]()?this._current[Bc](t,this._richText):this._whiteRegex.test(t)||this._current[Bc](t.trim())}onCdata(t){this._current[Bc](t)}_mkAttributes(t,e){let s=null,i=null;const n=Object.create({});for(const{name:a,value:r}of t)if("xmlns"===a)s?warn$1(`XFA - multiple namespace definition in <${e}>`):s=r;else if(a.startsWith("xmlns:")){const t=a.substring(6);i??=[],i.push({prefix:t,value:r})}else{const t=a.indexOf(":");if(-1===t)n[a]=r;else{const e=n[Fc]??=Object.create(null),[s,i]=[a.slice(0,t),a.slice(t+1)];(e[s]||=Object.create(null))[i]=r}}return[s,i,n]}_getNameAndPrefix(t,e){const s=t.indexOf(":");return-1===s?[t,null]:[t.substring(s+1),e?"":t.substring(0,s)]}onBeginElement(t,e,s){const[i,n,a]=this._mkAttributes(e,t),[r,o]=this._getNameAndPrefix(t,this._builder.isNsAgnostic()),l=this._builder.build({nsPrefix:o,name:r,attributes:a,namespace:i,prefixes:n});if(l[gc]=this._globalData,s)return l[Jl](),this._current[Dc](l)&&l[jc](this._ids),void l[jl](this._builder);this._stack.push(this._current),this._current=l}onEndElement(t){const e=this._current;if(e[yc]()&&"string"==typeof e[Vl]){const t=new _XFAParser;t._globalData=this._globalData;const s=t.parse(e[Vl]);e[Vl]=null,e[Dc](s)}e[Jl](),this._current=this._stack.pop(),this._current[Dc](e)&&e[jc](this._ids),e[jl](this._builder)}onError(t){this._errorCode=t}},pb=class _XFAFactory{constructor(t){try{this.root=(new gb).parse(_XFAFactory._createDocument(t));const e=new rf(this.root);this.form=e.bind(),this.dataHandler=new of(this.root,e.getData()),this.form[gc].template=this.form}catch(t){warn$1(`XFA - an error occurred during parsing and binding: ${t}`)}}isValid(){return!(!this.root||!this.form)}_createPagesHelper(){const t=this.form[Vc]();return new Promise((e,s)=>{const nextIteration=()=>{try{const s=t.next();s.done?e(s.value):setTimeout(nextIteration,0)}catch(t){s(t)}};setTimeout(nextIteration,0)})}async _createPages(){try{this.pages=await this._createPagesHelper(),this.dims=this.pages.children.map(t=>{const{width:e,height:s}=t.attributes.style;return[0,0,parseInt(e),parseInt(s)]})}catch(t){warn$1(`XFA - an error occurred during layout: ${t}`)}}getBoundingBox(t){return this.dims[t]}async getNumPages(){return this.pages||await this._createPages(),this.dims.length}setImages(t){this.form[gc].images=t}setFonts(t){this.form[gc].fontFinder=new ih(t);const e=[];for(let t of this.form[gc].usedTypefaces)t=stripQuotes(t),this.form[gc].fontFinder.find(t)||e.push(t);return e.length>0?e:null}appendFonts(t,e){this.form[gc].fontFinder.add(t,e)}async getPages(){this.pages||await this._createPages();const t=this.pages;return this.pages=null,t}serializeData(t){return this.dataHandler.serialize(t)}static _createDocument(t){return t["/xdp:xdp"]?Object.values(t).join(""):t["xdp:xdp"]}static getRichTextAsHtml(t){if(!t||"string"!=typeof t)return null;try{let e=new gb(lb,!0).parse(t);if(!["body","xhtml"].includes(e[Ec])){const t=lb.body({});t[$l](e),e=t}const s=e[Xc]();if(!s.success)return null;const{html:i}=s,{attributes:n}=i;return n&&(n.class&&(n.class=n.class.filter(t=>!t.startsWith("xfa"))),n.dir="auto"),{html:i,str:e[Wc]()}}catch(t){warn$1(`XFA - an error occurred during parsing of rich text: ${t}`)}return null}},mb=class{static createGlobals(t){return Promise.all([t.ensureCatalog("acroForm"),t.ensureDoc("xfaDatasets"),t.ensureCatalog("structTreeRoot"),t.ensureCatalog("baseUrl"),t.ensureCatalog("attachments"),t.ensureCatalog("globalColorSpaceCache")]).then(([e,s,i,n,a,r])=>({pdfManager:t,acroForm:e instanceof fs?e:fs.empty,xfaDatasets:s,structTreeRoot:i,baseUrl:n,attachments:a,globalColorSpaceCache:r}),t=>(warn$1(`createGlobals: "${t}".`),null))}static async create(t,e,s,i,n,a,r,o){const l=n?await this._getPageIndex(t,e,s.pdfManager):null;return s.pdfManager.ensure(this,"_create",[t,e,s,i,n,a,r,l,o])}static _create(t,e,s,i,n=!1,a=null,r=null,o=null,l=null){const c=t.fetchIfRef(e);if(!(c instanceof fs))return;let h=c.get("Subtype");if(h=h instanceof us?h.name:null,r&&!r.has(_[h.toUpperCase()]))return null;const{acroForm:u,pdfManager:d}=s,f=e instanceof gs?e.toString():`annot_${i.createObjId()}`,g={xref:t,ref:e,dict:c,subtype:h,id:f,annotationGlobals:s,collectFields:n,orphanFields:a,needAppearances:!n&&!0===u.get("NeedAppearances"),pageIndex:o,evaluatorOptions:d.evaluatorOptions,pageRef:l};switch(h){case"Link":return new _b(g);case"Text":return new Cb(g);case"Widget":let t=getInheritableProperty({dict:c,key:"FT"});switch(t=t instanceof us?t.name:null,t){case"Tx":return new vb(g);case"Btn":return new Ab(g);case"Ch":return new kb(g);case"Sig":return new Sb(g)}return warn$1(`Unimplemented widget field type "${t}", falling back to base field type.`),new xb(g);case"Popup":return new Ib(g);case"FreeText":return new Tb(g);case"Line":return new Mb(g);case"Square":return new Eb(g);case"Circle":return new Fb(g);case"PolyLine":return new Db(g);case"Polygon":return new Rb(g);case"Caret":return new Bb(g);case"Ink":return new Pb(g);case"Highlight":return new Nb(g);case"Underline":return new Ob(g);case"Squiggly":return new Lb(g);case"StrikeOut":return new Ub(g);case"Stamp":return new $b(g);case"FileAttachment":return new Hb(g);default:return n||warn$1(h?`Unimplemented annotation type "${h}", falling back to base annotation.`:"Annotation is missing the required /Subtype."),new bb(g)}}static async _getPageIndex(t,e,s){try{const i=await t.fetchIfRefAsync(e);if(!(i instanceof fs))return-1;const n=i.getRaw("P");if(n instanceof gs)try{return await s.ensureCatalog("getPageIndex",[n])}catch(t){info$1(`_getPageIndex -- not a valid page reference: "${t}".`)}if(i.has("Kids"))return-1;const a=await s.ensureDoc("numPages");for(let t=0;t<a;t++){const i=await s.getPage(t),n=await s.ensure(i,"annotations");for(const s of n)if(s instanceof gs&&isRefsEqual(s,e))return t}}catch(t){warn$1(`_getPageIndex: "${t}".`)}return-1}static generateImages(t,e,s){if(!s)return warn$1("generateImages: OffscreenCanvas is not supported, cannot save or print some annotations with images."),null;let i;for(const{bitmapId:s,bitmap:n}of t)n&&(i||=new Map,i.set(s,$b.createImage(n,e)));return i}static async saveNewAnnotations(t,e,s,i,n){const a=t.xref;let r;const o=[],{isOffscreenCanvasSupported:l}=t.options;for(const c of s)if(!c.deleted)switch(c.annotationType){case p:if(!r){const t=new fs(a);t.setIfName("BaseFont","Helvetica"),t.setIfName("Type","Font"),t.setIfName("Subtype","Type1"),t.setIfName("Encoding","WinAnsiEncoding"),r=a.getNewTemporaryRef(),n.put(r,{data:t})}o.push(Tb.createNewAnnotation(a,c,n,{evaluator:t,task:e,baseFontRef:r}));break;case m:c.quadPoints?o.push(Nb.createNewAnnotation(a,c,n)):o.push(Pb.createNewAnnotation(a,c,n));break;case w:o.push(Pb.createNewAnnotation(a,c,n));break;case b:const s=l?await(i?.get(c.bitmapId)):null;if(s?.imageStream){const{imageStream:t,smaskStream:e}=s;if(e){const s=a.getNewTemporaryRef();n.put(s,{data:e}),t.dict.set("SMask",s)}const i=s.imageRef=a.getNewTemporaryRef();n.put(i,{data:t}),s.imageStream=s.smaskStream=null}o.push($b.createNewAnnotation(a,c,n,{image:s}));break;case y:o.push($b.createNewAnnotation(a,c,n,{}))}return{annotations:(await Promise.all(o)).flat()}}static async printNewAnnotations(t,e,s,i,n){if(!i)return null;const{options:a,xref:r}=e,o=[];for(const l of i)if(!l.deleted)switch(l.annotationType){case p:o.push(Tb.createNewPrintAnnotation(t,r,l,{evaluator:e,task:s,evaluatorOptions:a}));break;case m:l.quadPoints?o.push(Nb.createNewPrintAnnotation(t,r,l,{evaluatorOptions:a})):o.push(Pb.createNewPrintAnnotation(t,r,l,{evaluatorOptions:a}));break;case w:o.push(Pb.createNewPrintAnnotation(t,r,l,{evaluatorOptions:a}));break;case b:const i=a.isOffscreenCanvasSupported?await(n?.get(l.bitmapId)):null;if(i?.imageStream){const{imageStream:t,smaskStream:e}=i;e&&t.dict.set("SMask",e),i.imageRef=new wi(t,t.length),i.imageStream=i.smaskStream=null}o.push($b.createNewPrintAnnotation(t,r,l,{image:i,evaluatorOptions:a}));break;case y:o.push($b.createNewPrintAnnotation(t,r,l,{evaluatorOptions:a}))}return Promise.all(o)}};function getRgbColor(t,e=new Uint8ClampedArray(3)){if(!Array.isArray(t))return e;const s=e||new Uint8ClampedArray(3);switch(t.length){case 0:return null;case 1:return ni.gray.getRgbItem(t,0,s,0),s;case 3:return ni.rgb.getRgbItem(t,0,s,0),s;case 4:return ni.cmyk.getRgbItem(t,0,s,0),s;default:return e}}function getPdfColorArray(t,e=null){return t&&Array.from(t,t=>t/255)||e}function getQuadPoints(t,e){const s=t.getArray("QuadPoints");if(!isNumberArray(s,null)||0===s.length||s.length%8>0)return null;const i=new Float32Array(s.length);for(let t=0,n=s.length;t<n;t+=8){const[n,a,r,o,l,c,h,u]=s.slice(t,t+8),d=Math.min(n,r,l,h),f=Math.max(n,r,l,h),g=Math.min(a,o,c,u),p=Math.max(a,o,c,u);if(null!==e&&(d<e[0]||f>e[2]||g<e[1]||p>e[3]))return null;i.set([d,p,f,p,d,g,f,g],t)}return i}function getTransformMatrix(t,e,s){const i=new Float32Array([1/0,1/0,-1/0,-1/0]);ss.axialAlignedBoundingBox(e,s,i);const[n,a,r,o]=i;if(n===r||a===o)return[1,0,0,1,t[0],t[1]];const l=(t[2]-t[0])/(r-n),c=(t[3]-t[1])/(o-a);return[l,0,0,c,t[0]-n*l,t[1]-a*c]}var bb=class{constructor(t){const{dict:e,xref:s,annotationGlobals:i,ref:n,orphanFields:a}=t,r=a?.get(n);r&&e.set("Parent",r),this.setTitle(e.get("T")),this.setContents(e.get("Contents")),this.setModificationDate(e.get("M")),this.setFlags(e.get("F")),this.setRectangle(e.getArray("Rect")),this.setColor(e.getArray("C")),this.setBorderStyle(e),this.setAppearance(e),this.setOptionalContent(e);const o=e.get("MK");this.setBorderAndBackgroundColors(o),this.setRotation(o,e),this.ref=t.ref instanceof gs?t.ref:null,this._streams=[],this.appearance&&this._streams.push(this.appearance);const l=!!(this.flags&B),c=!!(this.flags&P);if(this.data={annotationFlags:this.flags,borderStyle:this.borderStyle,color:this.color,backgroundColor:this.backgroundColor,borderColor:this.borderColor,rotation:this.rotation,contentsObj:this._contents,hasAppearance:!!this.appearance,id:t.id,modificationDate:this.modificationDate,rect:this.rectangle,subtype:t.subtype,hasOwnCanvas:!1,noRotate:!!(this.flags&D),noHTML:l&&c,isEditable:!1,structParent:-1},i.structTreeRoot){let s=e.get("StructParent");this.data.structParent=s=Number.isInteger(s)&&s>=0?s:-1,i.structTreeRoot.addAnnotationIdToPage(t.pageRef,s)}if(t.collectFields){const i=e.get("Kids");if(Array.isArray(i)){const t=[];for(const e of i)e instanceof gs&&t.push(e.toString());0!==t.length&&(this.data.kidIds=t)}this.data.actions=collectActions(s,e,Z),this.data.fieldName=this._constructFieldName(e),this.data.pageIndex=t.pageIndex}const h=e.get("IT");h instanceof us&&(this.data.it=h.name),this._isOffscreenCanvasSupported=t.evaluatorOptions.isOffscreenCanvasSupported,this._fallbackFontDict=null,this._needAppearances=!1}_hasFlag(t,e){return!!(t&e)}_buildFlags(t,e){let{flags:s}=this;if(void 0===t){if(void 0===e)return;return e?-5&s:-3&s|F}return t?(s|=F,e?-33&s|E:-3&s|R):(s&=-35,e?-5&s:s|F)}_isViewable(t){return!this._hasFlag(t,M)&&!this._hasFlag(t,R)}_isPrintable(t){return this._hasFlag(t,F)&&!this._hasFlag(t,E)&&!this._hasFlag(t,M)}mustBeViewed(t,e){const s=t?.get(this.data.id)?.noView;return void 0!==s?!s:this.viewable&&!this._hasFlag(this.flags,E)}mustBePrinted(t){const e=t?.get(this.data.id)?.noPrint;return void 0!==e?!e:this.printable}mustBeViewedWhenEditing(t,e=null){return t?!this.data.isEditable:!e?.has(this.data.id)}get viewable(){return null!==this.data.quadPoints&&(0===this.flags||this._isViewable(this.flags))}get printable(){return null!==this.data.quadPoints&&0!==this.flags&&this._isPrintable(this.flags)}_parseStringHelper(t){const e="string"==typeof t?stringToPDFString(t):"";return{str:e,dir:e&&"rtl"===bidi(e).dir?"rtl":"ltr"}}setDefaultAppearance(t){const{dict:e,annotationGlobals:s}=t,i=getInheritableProperty({dict:e,key:"DA"})||s.acroForm.get("DA");this._defaultAppearance="string"==typeof i?i:"",this.data.defaultAppearanceData=parseDefaultAppearance(this._defaultAppearance)}setTitle(t){this._title=this._parseStringHelper(t)}setContents(t){this._contents=this._parseStringHelper(t)}setModificationDate(t){this.modificationDate="string"==typeof t?t:null}setFlags(t){this.flags=Number.isInteger(t)&&t>0?t:0,this.flags&M&&"Annotation"!==this.constructor.name&&(this.flags^=M)}hasFlag(t){return this._hasFlag(this.flags,t)}setRectangle(t){this.rectangle=lookupNormalRect(t,[0,0,0,0])}setColor(t){this.color=getRgbColor(t)}setLineEndings(t){if(this.lineEndings=["None","None"],Array.isArray(t)&&2===t.length)for(let e=0;e<2;e++){const s=t[e];if(s instanceof us)switch(s.name){case"None":continue;case"Square":case"Circle":case"Diamond":case"OpenArrow":case"ClosedArrow":case"Butt":case"ROpenArrow":case"RClosedArrow":case"Slash":this.lineEndings[e]=s.name;continue}warn$1(`Ignoring invalid lineEnding: ${s}`)}}setRotation(t,e){this.rotation=0;let s=t instanceof fs?t.get("R")||0:e.get("Rotate")||0;Number.isInteger(s)&&0!==s&&(s%=360,s<0&&(s+=360),s%90==0&&(this.rotation=s))}setBorderAndBackgroundColors(t){t instanceof fs?(this.borderColor=getRgbColor(t.getArray("BC"),null),this.backgroundColor=getRgbColor(t.getArray("BG"),null)):this.borderColor=this.backgroundColor=null}setBorderStyle(t){if(this.borderStyle=new wb,t instanceof fs)if(t.has("BS")){const e=t.get("BS");if(e instanceof fs){const t=e.get("Type");t&&!isName(t,"Border")||(this.borderStyle.setWidth(e.get("W"),this.rectangle),this.borderStyle.setStyle(e.get("S")),this.borderStyle.setDashArray(e.getArray("D")))}}else if(t.has("Border")){const e=t.getArray("Border");Array.isArray(e)&&e.length>=3&&(this.borderStyle.setHorizontalCornerRadius(e[0]),this.borderStyle.setVerticalCornerRadius(e[1]),this.borderStyle.setWidth(e[2],this.rectangle),4===e.length&&this.borderStyle.setDashArray(e[3],!0))}else this.borderStyle.setWidth(0)}setAppearance(t){this.appearance=null;const e=t.get("AP");if(!(e instanceof fs))return;const s=e.get("N");if(s instanceof bs)return void(this.appearance=s);if(!(s instanceof fs))return;const i=t.get("AS");if(!(i instanceof us&&s.has(i.name)))return;const n=s.get(i.name);n instanceof bs&&(this.appearance=n)}setOptionalContent(t){this.oc=null;const e=t.get("OC");e instanceof us?warn$1("setOptionalContent: Support for /Name-entry is not implemented."):e instanceof fs&&(this.oc=e)}async loadResources(t,e){const s=await e.dict.getAsync("Resources");return s&&await Ol.load(s,t,s.xref),s}async getOperatorList(t,e,s,i){const{hasOwnCanvas:n,id:a,rect:r}=this.data;let l=this.appearance;const c=!!(n&&s&o);if(c&&(0===this.width||0===this.height))return this.data.hasOwnCanvas=!1,{opList:new Si,separateForm:!1,separateCanvas:!1};if(!l){if(!c)return{opList:new Si,separateForm:!1,separateCanvas:!1};l=new Ys(""),l.dict=new fs}const h=l.dict,u=await this.loadResources(vs,l),d=lookupRect(h.getArray("BBox"),[0,0,1,1]),f=lookupMatrix(h.getArray("Matrix"),xs),g=getTransformMatrix(r,d,f),p=new Si;let m;return this.oc&&(m=await t.parseMarkedContentProps(this.oc,null)),void 0!==m&&p.addOp(we,["OC",m]),p.addOp(_e,[a,r,g,f,c]),await t.getOperatorList({stream:l,task:e,resources:u,operatorList:p,fallbackFontDict:this._fallbackFontDict}),p.addOp(Ie,[]),void 0!==m&&p.addOp(ye,[]),this.reset(),{opList:p,separateForm:!1,separateCanvas:c}}async save(t,e,s,i){return null}get overlaysTextContent(){return!1}get hasTextContent(){return!1}async extractTextContent(t,e,s){if(!this.appearance)return;const i=await this.loadResources(As,this.appearance),n=[],a=[];let r=null;const o={desiredSize:Math.Infinity,ready:!0,enqueue(t,e){for(const e of t.items)void 0!==e.str&&(r||=e.transform.slice(-2),a.push(e.str),e.hasEOL&&(n.push(a.join("").trimEnd()),a.length=0))}};if(await t.getTextContent({stream:this.appearance,task:e,resources:i,includeMarkedContent:!0,keepWhiteSpace:!0,sink:o,viewBox:s}),this.reset(),a.length&&n.push(a.join("").trimEnd()),n.length>1||n[0]){const t=this.appearance.dict,e=lookupRect(t.getArray("BBox"),null),s=lookupMatrix(t.getArray("Matrix"),null);this.data.textPosition=this._transformPoint(r,e,s),this.data.textContent=n}}_transformPoint(t,e,s){const{rect:i}=this.data;e||=[0,0,1,1],s||=[1,0,0,1,0,0];const n=getTransformMatrix(i,e,s);n[4]-=i[0],n[5]-=i[1];const a=t.slice();return ss.applyTransform(a,n),ss.applyTransform(a,s),a}getFieldObject(){return this.data.kidIds?{id:this.data.id,actions:this.data.actions,name:this.data.fieldName,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,type:"",kidIds:this.data.kidIds,page:this.data.pageIndex,rotation:this.rotation}:null}reset(){for(const t of this._streams)t.reset()}_constructFieldName(t){if(!t.has("T")&&!t.has("Parent"))return warn$1("Unknown field name, falling back to empty field name."),"";if(!t.has("Parent"))return stringToPDFString(t.get("T"));const e=[];t.has("T")&&e.unshift(stringToPDFString(t.get("T")));let s=t;const i=new ps;for(t.objId&&i.put(t.objId);s.has("Parent")&&(s=s.get("Parent"),s instanceof fs&&(!s.objId||!i.has(s.objId)));)s.objId&&i.put(s.objId),s.has("T")&&e.unshift(stringToPDFString(s.get("T")));return e.join(".")}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}},wb=class{constructor(){this.width=1,this.rawWidth=1,this.style=V,this.dashArray=[3],this.horizontalCornerRadius=0,this.verticalCornerRadius=0}setWidth(t,e=[0,0,0,0]){if(t instanceof us)this.width=0;else if("number"==typeof t){if(t>0){this.rawWidth=t;const s=(e[2]-e[0])/2,i=(e[3]-e[1])/2;s>0&&i>0&&(t>s||t>i)&&(warn$1(`AnnotationBorderStyle.setWidth - ignoring width: ${t}`),t=1)}this.width=t}}setStyle(t){if(t instanceof us)switch(t.name){case"S":this.style=V;break;case"D":this.style=X;break;case"B":this.style=K;break;case"I":this.style=Y;break;case"U":this.style=J}}setDashArray(t,e=!1){if(Array.isArray(t)){let s=!0,i=!0;for(const e of t){if(!(+e>=0)){s=!1;break}e>0&&(i=!1)}0===t.length||s&&!i?(this.dashArray=t,e&&this.setStyle(us.get("D"))):this.width=0}else t&&(this.width=0)}setHorizontalCornerRadius(t){Number.isInteger(t)&&(this.horizontalCornerRadius=t)}setVerticalCornerRadius(t){Number.isInteger(t)&&(this.verticalCornerRadius=t)}},yb=class extends bb{constructor(t){super(t);const{dict:e}=t;if(e.has("IRT")){const t=e.getRaw("IRT");this.data.inReplyTo=t instanceof gs?t.toString():null;const s=e.get("RT");this.data.replyType=s instanceof us?s.name:T}let s=null;if(this.data.replyType===I){const t=e.get("IRT");this.setTitle(t.get("T")),this.data.titleObj=this._title,this.setContents(t.get("Contents")),this.data.contentsObj=this._contents,t.has("CreationDate")?(this.setCreationDate(t.get("CreationDate")),this.data.creationDate=this.creationDate):this.data.creationDate=null,t.has("M")?(this.setModificationDate(t.get("M")),this.data.modificationDate=this.modificationDate):this.data.modificationDate=null,s=t.getRaw("Popup"),t.has("C")?(this.setColor(t.getArray("C")),this.data.color=this.color):this.data.color=null}else this.data.titleObj=this._title,this.setCreationDate(e.get("CreationDate")),this.data.creationDate=this.creationDate,s=e.getRaw("Popup"),e.has("C")||(this.data.color=null);this.data.popupRef=s instanceof gs?s.toString():null,e.has("RC")&&(this.data.richText=pb.getRichTextAsHtml(e.get("RC")))}setCreationDate(t){this.creationDate="string"==typeof t?t:null}_setDefaultAppearance({xref:t,extra:e,strokeColor:s,fillColor:i,blendMode:n,strokeAlpha:a,fillAlpha:r,pointsCallback:o}){const l=this.data.rect=[1/0,1/0,-1/0,-1/0],c=["q"];e&&c.push(e),s&&c.push(`${s[0]} ${s[1]} ${s[2]} RG`),i&&c.push(`${i[0]} ${i[1]} ${i[2]} rg`);const h=this.data.quadPoints||Float32Array.from([this.rectangle[0],this.rectangle[3],this.rectangle[2],this.rectangle[3],this.rectangle[0],this.rectangle[1],this.rectangle[2],this.rectangle[1]]);for(let t=0,e=h.length;t<e;t+=8){const e=o(c,h.subarray(t,t+8));ss.rectBoundingBox(...e,l)}c.push("Q");const u=new fs(t),d=new fs(t);d.setIfName("Subtype","Form");const f=new Ys(c.join(" "));f.dict=d,u.set("Fm0",f);const g=new fs(t);n&&g.setIfName("BM",n),g.setIfNumber("CA",a),g.setIfNumber("ca",r);const p=new fs(t);p.set("GS0",g);const m=new fs(t);m.set("ExtGState",p),m.set("XObject",u);const b=new fs(t);b.set("Resources",m),b.set("BBox",l),this.appearance=new Ys("/GS0 gs /Fm0 Do"),this.appearance.dict=b,this._streams.push(this.appearance,f)}static async createNewAnnotation(t,e,s,i){const n=e.ref||=t.getNewTemporaryRef(),a=await this.createNewAppearanceStream(e,t,i);let r;if(a){const i=t.getNewTemporaryRef();r=this.createNewDict(e,t,{apRef:i}),s.put(i,{data:a})}else r=this.createNewDict(e,t,{});Number.isInteger(e.parentTreeId)&&r.set("StructParent",e.parentTreeId),s.put(n,{data:r});const o={ref:n},{popup:l}=e;if(l){if(l.deleted)return r.delete("Popup"),r.delete("Contents"),r.delete("RC"),o;const e=l.ref||=t.getNewTemporaryRef();l.parent=n;const i=Ib.createNewDict(l,t);return s.put(e,{data:i}),r.setIfDefined("Contents",stringToAsciiOrUTF16BE(l.contents)),r.set("Popup",e),[o,{ref:e}]}return o}static async createNewPrintAnnotation(t,e,s,i){const n=await this.createNewAppearanceStream(s,e,i),a=this.createNewDict(s,e,n?{ap:n}:{}),r=new this.prototype.constructor({dict:a,xref:e,annotationGlobals:t,evaluatorOptions:i.evaluatorOptions});return s.ref&&(r.ref=r.refToReplace=s.ref),r}},xb=class _WidgetAnnotation extends bb{constructor(t){super(t);const{dict:e,xref:s,annotationGlobals:i}=t,n=this.data;this._needAppearances=t.needAppearances,n.annotationType=_.WIDGET,void 0===n.fieldName&&(n.fieldName=this._constructFieldName(e)),void 0===n.actions&&(n.actions=collectActions(s,e,Z));let a=getInheritableProperty({dict:e,key:"V",getArray:!0});n.fieldValue=this._decodeFormValue(a);const r=getInheritableProperty({dict:e,key:"DV",getArray:!0});if(n.defaultFieldValue=this._decodeFormValue(r),void 0===a&&i.xfaDatasets){const t=this._title.str;t&&(this._hasValueFromXFA=!0,n.fieldValue=a=i.xfaDatasets.getValue(t))}void 0===a&&null!==n.defaultFieldValue&&(n.fieldValue=n.defaultFieldValue),n.alternativeText=stringToPDFString(e.get("TU")||""),this.setDefaultAppearance(t),n.hasAppearance||=this._needAppearances&&void 0!==n.fieldValue&&null!==n.fieldValue;const o=getInheritableProperty({dict:e,key:"FT"});n.fieldType=o instanceof us?o.name:null;const l=getInheritableProperty({dict:e,key:"DR"}),c=i.acroForm.get("DR"),h=this.appearance?.dict.get("Resources");this._fieldResources={localResources:l,acroFormResources:c,appearanceResources:h,mergedResources:fs.merge({xref:s,dictArray:[l,h,c],mergeSubDicts:!0})},n.fieldFlags=getInheritableProperty({dict:e,key:"Ff"}),(!Number.isInteger(n.fieldFlags)||n.fieldFlags<0)&&(n.fieldFlags=0),n.password=this.hasFieldFlag(U),n.readOnly=this.hasFieldFlag(N),n.required=this.hasFieldFlag(O),n.hidden=this._hasFlag(n.annotationFlags,E)||this._hasFlag(n.annotationFlags,R)}_decodeFormValue(t){return Array.isArray(t)?t.filter(t=>"string"==typeof t).map(t=>stringToPDFString(t)):t instanceof us?stringToPDFString(t.name):"string"==typeof t?stringToPDFString(t):null}hasFieldFlag(t){return!!(this.data.fieldFlags&t)}_isViewable(t){return!0}mustBeViewed(t,e){return e?this.viewable:super.mustBeViewed(t,e)&&!this._hasFlag(this.flags,R)}getRotationMatrix(t){let e=t?.get(this.data.id)?.rotation;return void 0===e&&(e=this.rotation),0===e?xs:getRotationMatrix(e,this.width,this.height)}getBorderAndBackgroundAppearances(t){let e=t?.get(this.data.id)?.rotation;if(void 0===e&&(e=this.rotation),!this.backgroundColor&&!this.borderColor)return"";const s=0===e||180===e?`0 0 ${this.width} ${this.height} re`:`0 0 ${this.height} ${this.width} re`;let i="";return this.backgroundColor&&(i=`${getPdfColor(this.backgroundColor,!0)} ${s} f `),this.borderColor&&(i+=`${this.borderStyle.width||1} w ${getPdfColor(this.borderColor,!1)} ${s} S `),i}async getOperatorList(t,e,s,i){if(s&h&&!(this instanceof Sb)&&!this.data.noHTML&&!this.data.hasOwnCanvas)return{opList:new Si,separateForm:!0,separateCanvas:!1};if(!this._hasText)return super.getOperatorList(t,e,s,i);const n=await this._getAppearance(t,e,s,i);if(this.appearance&&null===n)return super.getOperatorList(t,e,s,i);const a=new Si;if(!this._defaultAppearance||null===n)return{opList:a,separateForm:!1,separateCanvas:!1};const r=!!(this.data.hasOwnCanvas&&s&o),l=[0,0,this.width,this.height],c=getTransformMatrix(this.data.rect,l,[1,0,0,1,0,0]);let u;this.oc&&(u=await t.parseMarkedContentProps(this.oc,null)),void 0!==u&&a.addOp(we,["OC",u]),a.addOp(_e,[this.data.id,this.data.rect,c,this.getRotationMatrix(i),r]);const d=new Ys(n);return await t.getOperatorList({stream:d,task:e,resources:this._fieldResources.mergedResources,operatorList:a}),a.addOp(Ie,[]),void 0!==u&&a.addOp(ye,[]),{opList:a,separateForm:!1,separateCanvas:r}}_getMKDict(t){const e=new fs(null);return t&&e.set("R",t),e.setIfArray("BC",getPdfColorArray(this.borderColor)),e.setIfArray("BG",getPdfColorArray(this.backgroundColor)),e.size>0?e:null}amendSavedDict(t,e){}setValue(t,e,s,i){const{dict:n,ref:a}=function(t,e,s){const i=new ps,n=t,a={dict:null,ref:null};for(;t instanceof fs&&!i.has(e)&&(i.put(e),!t.has("T"));){if(!((e=t.getRaw("Parent"))instanceof gs))return a;t=s.fetch(e)}return t instanceof fs&&t!==n&&(a.dict=t,a.ref=e),a}(t,this.ref,s);if(n){if(!i.has(a)){const t=n.clone();return t.set("V",e),i.put(a,{data:t}),t}}else t.set("V",e);return null}async save(t,e,s,i){const n=s?.get(this.data.id),a=this._buildFlags(n?.noView,n?.noPrint);let r=n?.value,o=n?.rotation;if(r===this.data.fieldValue||void 0===r){if(!this._hasValueFromXFA&&void 0===o&&void 0===a)return;r||=this.data.fieldValue}if(void 0===o&&!this._hasValueFromXFA&&Array.isArray(r)&&Array.isArray(this.data.fieldValue)&&isArrayEqual(r,this.data.fieldValue)&&void 0===a)return;void 0===o&&(o=this.rotation);let l=null;if(!this._needAppearances&&(l=await this._getAppearance(t,e,c,s),null===l&&void 0===a))return;let h=!1;l?.needAppearances&&(h=!0,l=null);const{xref:u}=t,d=u.fetchIfRef(this.ref);if(!(d instanceof fs))return;const f=new fs(u);for(const t of d.getKeys())"AP"!==t&&f.set(t,d.getRaw(t));if(void 0!==a&&(f.set("F",a),null===l&&!h)){const t=d.getRaw("AP");t&&f.set("AP",t)}const g={path:this.data.fieldName,value:r},p=this.setValue(f,Array.isArray(r)?r.map(stringToAsciiOrUTF16BE):stringToAsciiOrUTF16BE(r),u,i);this.amendSavedDict(s,p||f);const m=this._getMKDict(o);if(m&&f.set("MK",m),i.put(this.ref,{data:f,xfa:g,needAppearances:h}),null!==l){const t=u.getNewTemporaryRef(),e=new fs(u);f.set("AP",e),e.set("N",t);const n=this._getSaveFieldResources(u),a=new Ys(l),r=a.dict=new fs(u);r.setIfName("Subtype","Form"),r.set("Resources",n);const c=o%180==0?[0,0,this.width,this.height]:[0,0,this.height,this.width];r.set("BBox",c);const h=this.getRotationMatrix(s);h!==xs&&r.set("Matrix",h),i.put(t,{data:a,xfa:null,needAppearances:!1})}f.set("M",`D:${getModificationDate()}`)}async _getAppearance(t,e,s,i){if(this.data.password)return null;const n=i?.get(this.data.id);let r,o;if(n&&(r=n.formattedValue||n.value,o=n.rotation),void 0===o&&void 0===r&&!this._needAppearances&&(!this._hasValueFromXFA||this.appearance))return null;const l=this.getBorderAndBackgroundAppearances(i);if(void 0===r&&(r=this.data.fieldValue,!r))return`/Tx BMC q ${l}Q EMC`;if(Array.isArray(r)&&1===r.length&&(r=r[0]),assert$1("string"==typeof r,"Expected `value` to be a string."),r=r.trimEnd(),this.data.combo){const t=this.data.options.find(({exportValue:t})=>r===t);r=t?.displayValue||r}if(""===r)return`/Tx BMC q ${l}Q EMC`;void 0===o&&(o=this.rotation);let h,u=-1;this.data.multiLine?(h=r.split(/\r\n?|\n/).map(t=>t.normalize("NFC")),u=h.length):h=[r.replace(/\r\n?|\n/,"").normalize("NFC")];let{width:d,height:f}=this;90!==o&&270!==o||([d,f]=[f,d]),this._defaultAppearance||(this.data.defaultAppearanceData=parseDefaultAppearance(this._defaultAppearance="/Helvetica 0 Tf 0 g"));let g,p,m,b=await _WidgetAnnotation._getFontData(t,e,this.data.defaultAppearanceData,this._fieldResources.mergedResources);const w=[];let y=!1;for(const t of h){const e=b.encodeString(t);e.length>1&&(y=!0),w.push(e.join(""))}if(y&&s&c)return{needAppearances:!0};if(y&&this._isOffscreenCanvasSupported){const s=this.data.comb?"monospace":"sans-serif",i=new ll(t.xref,s),n=i.createFontResources(h.join("")),a=n.getRaw("Font");if(this._fieldResources.mergedResources.has("Font")){const t=this._fieldResources.mergedResources.get("Font");for(const e of a.getKeys())t.set(e,a.getRaw(e))}else this._fieldResources.mergedResources.set("Font",a);const o=i.fontName.name;b=await _WidgetAnnotation._getFontData(t,e,{fontName:o,fontSize:0},n);for(let t=0,e=w.length;t<e;t++)w[t]=stringToUTF16String(h[t]);const l=Object.assign(Object.create(null),this.data.defaultAppearanceData);this.data.defaultAppearanceData.fontSize=0,this.data.defaultAppearanceData.fontName=o,[g,p,m]=this._computeFontSize(f-2,d-4,r,b,u),this.data.defaultAppearanceData=l}else this._isOffscreenCanvasSupported||warn$1("_getAppearance: OffscreenCanvas is not supported, annotation may not render correctly."),[g,p,m]=this._computeFontSize(f-2,d-4,r,b,u);let x=b.descent;x=isNaN(x)?a*m:Math.max(a*m,Math.abs(x)*p);const v=Math.min(Math.floor((f-p)/2),1),A=this.data.textAlignment;if(this.data.multiLine)return this._getMultilineAppearance(g,w,b,p,d,f,A,2,v,x,m,i);if(this.data.comb)return this._getCombAppearance(g,b,w[0],p,d,f,2,v,x,m,i);const k=v+x;return 0===A||A>2?`/Tx BMC q ${l}BT `+g+` 1 0 0 1 ${numberToString(2)} ${numberToString(k)} Tm (${escapeString(w[0])}) Tj ET Q EMC`:`/Tx BMC q ${l}BT `+g+` 1 0 0 1 0 0 Tm ${this._renderText(w[0],b,p,d,A,{shift:0},2,k)} ET Q EMC`}static async _getFontData(t,e,s,i){const n=new Si,a={font:null,clone(){return this}},{fontName:r,fontSize:o}=s;return await t.handleSetFont(i,[r&&us.get(r),o],null,n,e,a,null),a.font}_getTextWidth(t,e){return Math.sumPrecise(e.charsToGlyphs(t).map(t=>t.width))/1e3}_computeFontSize(t,e,s,n,a){let{fontSize:r}=this.data.defaultAppearanceData,o=(r||12)*i,l=Math.round(t/o);if(!r){const roundWithTwoDigits=t=>Math.floor(100*t)/100;if(-1===a){const a=this._getTextWidth(s,n);r=roundWithTwoDigits(Math.min(t/i,e/a)),l=1}else{const c=s.split(/\r\n?|\n/),h=[];for(const t of c){const e=n.encodeString(t).join(""),s=n.charsToGlyphs(e),i=n.getCharPositions(e);h.push({line:e,glyphs:s,positions:i})}const isTooBig=s=>{let i=0;for(const a of h)if(i+=this._splitLine(null,n,s,e,a).length*s,i>t)return!0;return!1};for(l=Math.max(l,a);o=t/l,r=roundWithTwoDigits(o/i),isTooBig(r);)l++}const{fontName:c,fontColor:h}=this.data.defaultAppearanceData;this._defaultAppearance=function({fontSize:t,fontName:e,fontColor:s}){return`/${escapePDFName(e)} ${t} Tf ${getPdfColor(s,!0)}`}({fontSize:r,fontName:c,fontColor:h})}return[this._defaultAppearance,r,t/l]}_renderText(t,e,s,i,n,a,r,o){let l;l=1===n?(i-this._getTextWidth(t,e)*s)/2:2===n?i-this._getTextWidth(t,e)*s-r:r;const c=numberToString(l-a.shift);return a.shift=l,`${c} ${o=numberToString(o)} Td (${escapeString(t)}) Tj`}_getSaveFieldResources(t){const{localResources:e,appearanceResources:s,acroFormResources:i}=this._fieldResources,n=this.data.defaultAppearanceData?.fontName;if(!n)return e||fs.empty;for(const t of[e,s])if(t instanceof fs){const e=t.get("Font");if(e instanceof fs&&e.has(n))return t}if(i instanceof fs){const s=i.get("Font");if(s instanceof fs&&s.has(n)){const i=new fs(t);i.set(n,s.getRaw(n));const a=new fs(t);return a.set("Font",i),fs.merge({xref:t,dictArray:[a,e],mergeSubDicts:!0})}}return e||fs.empty}getFieldObject(){return null}},vb=class extends xb{constructor(t){super(t);const{dict:e}=t;e.has("PMD")&&(this.flags|=E,this.data.hidden=!0,warn$1("Barcodes are not supported")),this.data.hasOwnCanvas=this.data.readOnly&&!this.data.noHTML,this._hasText=!0,"string"!=typeof this.data.fieldValue&&(this.data.fieldValue="");let s=getInheritableProperty({dict:e,key:"Q"});(!Number.isInteger(s)||s<0||s>2)&&(s=null),this.data.textAlignment=s;let i=getInheritableProperty({dict:e,key:"MaxLen"});(!Number.isInteger(i)||i<0)&&(i=0),this.data.maxLen=i,this.data.multiLine=this.hasFieldFlag(L),this.data.comb=this.hasFieldFlag(W)&&!this.data.multiLine&&!this.data.password&&!this.hasFieldFlag(q)&&0!==this.data.maxLen,this.data.doNotScroll=this.hasFieldFlag(G);const{data:{actions:n}}=this;if(!n)return;const a=/^AF(Date|Time)_(?:Keystroke|Format)(?:Ex)?\(['"]?([^'"]+)['"]?\);$/;let r=!1;(1===n.Format?.length&&1===n.Keystroke?.length&&a.test(n.Format[0])&&a.test(n.Keystroke[0])||0===n.Format?.length&&1===n.Keystroke?.length&&a.test(n.Keystroke[0])||0===n.Keystroke?.length&&1===n.Format?.length&&a.test(n.Format[0]))&&(r=!0);const o=[];n.Format&&o.push(...n.Format),n.Keystroke&&o.push(...n.Keystroke),r&&(delete n.Keystroke,n.Format=o);for(const t of o){const e=t.match(a);if(!e)continue;const s="Date"===e[1];let i=e[2];const n=parseInt(i,10);if(isNaN(n)||Math.floor(Math.log10(n))+1!==e[2].length||(i=(s?cl:hl)[n]??i),this.data.datetimeFormat=i,!r)break;if(s){/HH|MM|ss|h/.test(i)?(this.data.datetimeType="datetime-local",this.data.timeStep=/ss/.test(i)?1:60):this.data.datetimeType="date";break}this.data.datetimeType="time",this.data.timeStep=/ss/.test(i)?1:60;break}}get hasTextContent(){return!!this.appearance&&!this._needAppearances}_getCombAppearance(t,e,s,i,n,a,r,o,l,c,h){const u=n/this.data.maxLen,d=this.getBorderAndBackgroundAppearances(h),f=[],g=e.getCharPositions(s);for(const[t,e]of g)f.push(`(${escapeString(s.substring(t,e))}) Tj`);const p=f.join(` ${numberToString(u)} 0 Td `);return`/Tx BMC q ${d}BT `+t+` 1 0 0 1 ${numberToString(r)} ${numberToString(o+l)} Tm ${p} ET Q EMC`}_getMultilineAppearance(t,e,s,i,n,a,r,o,l,c,h,u){const d=[],f=n-2*o,g={shift:0};for(let t=0,a=e.length;t<a;t++){const a=e[t],u=this._splitLine(a,s,i,f);for(let e=0,a=u.length;e<a;e++){const a=u[e],f=0===t&&0===e?-l-(h-c):-h;d.push(this._renderText(a,s,i,n,r,g,o,f))}}const p=this.getBorderAndBackgroundAppearances(u),m=d.join("\n");return`/Tx BMC q ${p}BT `+t+` 1 0 0 1 0 ${numberToString(a)} Tm ${m} ET Q EMC`}_splitLine(t,e,s,i,n={}){t=n.line||t;const a=n.glyphs||e.charsToGlyphs(t);if(a.length<=1)return[t];const r=n.positions||e.getCharPositions(t),o=s/1e3,l=[];let c=-1,h=-1,u=-1,d=0,f=0;for(let e=0,s=a.length;e<s;e++){const[s,n]=r[e],g=a[e],p=g.width*o;" "===g.unicode?f+p>i?(l.push(t.substring(d,s)),d=s,f=p,c=-1,u=-1):(f+=p,c=s,h=n,u=e):f+p>i?-1!==c?(l.push(t.substring(d,h)),d=h,e=u+1,c=-1,f=0):(l.push(t.substring(d,s)),d=s,f=p):f+=p}return d<t.length&&l.push(t.substring(d,t.length)),l}async extractTextContent(t,e,s){await super.extractTextContent(t,e,s);const i=this.data.textContent;if(!i)return;const n=i.join("\n");if(n===this.data.fieldValue)return;const a=n.replaceAll(/([.*+?^${}()|[\]\\])|(\s+)/g,(t,e)=>e?`\\${e}`:"\\s+");new RegExp(`^\\s*${a}\\s*$`).test(this.data.fieldValue)&&(this.data.textContent=this.data.fieldValue.split("\n"))}getFieldObject(){return{id:this.data.id,value:this.data.fieldValue,defaultValue:this.data.defaultFieldValue||"",multiline:this.data.multiLine,password:this.data.password,charLimit:this.data.maxLen,comb:this.data.comb,editable:!this.data.readOnly,hidden:this.data.hidden,name:this.data.fieldName,rect:this.data.rect,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,datetimeFormat:this.data.datetimeFormat,hasDatetimeHTML:!!this.data.datetimeType,type:"text"}}},Ab=class extends xb{constructor(t){super(t),this.checkedAppearance=null,this.uncheckedAppearance=null;const e=this.hasFieldFlag($),s=this.hasFieldFlag(H);this.data.checkBox=!e&&!s,this.data.radioButton=e&&!s,this.data.pushButton=s,this.data.isTooltipOnly=!1,this.data.checkBox?this._processCheckBox(t):this.data.radioButton?this._processRadioButton(t):this.data.pushButton?(this.data.hasOwnCanvas=!0,this.data.noHTML=!1,this._processPushButton(t)):warn$1("Invalid field flags for button widget annotation")}async getOperatorList(t,e,s,i){if(this.data.pushButton)return super.getOperatorList(t,e,s,!1,i);let n=null,a=null;if(i){const t=i.get(this.data.id);n=t?t.value:null,a=t?t.rotation:null}if(null===n&&this.appearance)return super.getOperatorList(t,e,s,i);null==n&&(n=this.data.checkBox?this.data.fieldValue===this.data.exportValue:this.data.fieldValue===this.data.buttonValue);const r=n?this.checkedAppearance:this.uncheckedAppearance;if(r){const n=this.appearance,o=lookupMatrix(r.dict.getArray("Matrix"),xs);a&&r.dict.set("Matrix",this.getRotationMatrix(i)),this.appearance=r;const l=super.getOperatorList(t,e,s,i);return this.appearance=n,r.dict.set("Matrix",o),l}return{opList:new Si,separateForm:!1,separateCanvas:!1}}async save(t,e,s,i){this.data.checkBox?this._saveCheckbox(t,e,s,i):this.data.radioButton&&this._saveRadioButton(t,e,s,i)}async _saveCheckbox(t,e,s,i){if(!s)return;const n=s.get(this.data.id),a=this._buildFlags(n?.noView,n?.noPrint);let r=n?.rotation,o=n?.value;if(void 0===r&&void 0===a){if(void 0===o)return;if(this.data.fieldValue===this.data.exportValue===o)return}let l=t.xref.fetchIfRef(this.ref);if(!(l instanceof fs))return;l=l.clone(),void 0===r&&(r=this.rotation),void 0===o&&(o=this.data.fieldValue===this.data.exportValue);const c={path:this.data.fieldName,value:o?this.data.exportValue:""},h=us.get(o?this.data.exportValue:"Off");this.setValue(l,h,t.xref,i),l.set("AS",h),l.set("M",`D:${getModificationDate()}`),void 0!==a&&l.set("F",a);const u=this._getMKDict(r);u&&l.set("MK",u),i.put(this.ref,{data:l,xfa:c,needAppearances:!1})}async _saveRadioButton(t,e,s,i){if(!s)return;const n=s.get(this.data.id),a=this._buildFlags(n?.noView,n?.noPrint);let r=n?.rotation,o=n?.value;if(void 0===r&&void 0===a){if(void 0===o)return;if(this.data.fieldValue===this.data.buttonValue===o)return}let l=t.xref.fetchIfRef(this.ref);if(!(l instanceof fs))return;l=l.clone(),void 0===o&&(o=this.data.fieldValue===this.data.buttonValue),void 0===r&&(r=this.rotation);const c={path:this.data.fieldName,value:o?this.data.buttonValue:""},h=us.get(o?this.data.buttonValue:"Off");o&&this.setValue(l,h,t.xref,i),l.set("AS",h),l.set("M",`D:${getModificationDate()}`),void 0!==a&&l.set("F",a);const u=this._getMKDict(r);u&&l.set("MK",u),i.put(this.ref,{data:l,xfa:c,needAppearances:!1})}_getDefaultCheckedAppearance(t,e){const{width:s,height:i}=this,n=[0,0,s,i],a=.8*Math.min(s,i);let r,o;"check"===e?(r={width:.755*a,height:.705*a},o="3"):"disc"===e?(r={width:.791*a,height:.705*a},o="l"):unreachable$1(`_getDefaultCheckedAppearance - unsupported type: ${e}`);const l=`q BT /PdfJsZaDb ${a} Tf 0 g ${numberToString((s-r.width)/2)} ${numberToString((i-r.height)/2)} Td (${o}) Tj ET Q`,c=new fs(t.xref);c.set("FormType",1),c.setIfName("Subtype","Form"),c.setIfName("Type","XObject"),c.set("BBox",n),c.set("Matrix",[1,0,0,1,0,0]),c.set("Length",l.length);const h=new fs(t.xref),u=new fs(t.xref);u.set("PdfJsZaDb",this.fallbackFontDict),h.set("Font",u),c.set("Resources",h),this.checkedAppearance=new Ys(l),this.checkedAppearance.dict=c,this._streams.push(this.checkedAppearance)}_processCheckBox(t){const e=t.dict.get("AP");if(!(e instanceof fs))return;const s=e.get("N");if(!(s instanceof fs))return;const i=this._decodeFormValue(t.dict.get("AS"));"string"==typeof i&&(this.data.fieldValue=i);const n=null!==this.data.fieldValue&&"Off"!==this.data.fieldValue?this.data.fieldValue:"Yes",a=this._decodeFormValue(s.getKeys());if(0===a.length)a.push("Off",n);else if(1===a.length)"Off"===a[0]?a.push(n):a.unshift("Off");else if(a.includes(n))a.length=0,a.push("Off",n);else{const t=a.find(t=>"Off"!==t);a.length=0,a.push("Off",t)}a.includes(this.data.fieldValue)||(this.data.fieldValue="Off"),this.data.exportValue=a[1];const r=s.get(this.data.exportValue);this.checkedAppearance=r instanceof bs?r:null;const o=s.get("Off");this.uncheckedAppearance=o instanceof bs?o:null,this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(t,"check"),this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance),this._fallbackFontDict=this.fallbackFontDict,null===this.data.defaultFieldValue&&(this.data.defaultFieldValue="Off")}_processRadioButton(t){this.data.buttonValue=null;const e=t.dict.get("Parent");if(e instanceof fs){this.parent=t.dict.getRaw("Parent");const s=e.get("V");s instanceof us&&(this.data.fieldValue=this._decodeFormValue(s))}const s=t.dict.get("AP");if(!(s instanceof fs))return;const i=s.get("N");if(!(i instanceof fs))return;for(const t of i.getKeys())if("Off"!==t){this.data.buttonValue=this._decodeFormValue(t);break}const n=i.get(this.data.buttonValue);this.checkedAppearance=n instanceof bs?n:null;const a=i.get("Off");this.uncheckedAppearance=a instanceof bs?a:null,this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(t,"disc"),this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance),this._fallbackFontDict=this.fallbackFontDict,null===this.data.defaultFieldValue&&(this.data.defaultFieldValue="Off")}_processPushButton(t){const{dict:e,annotationGlobals:s}=t;e.has("A")||e.has("AA")||this.data.alternativeText?(this.data.isTooltipOnly=!e.has("A")&&!e.has("AA"),Nl.parseDestDictionary({destDict:e,resultObj:this.data,docBaseUrl:s.baseUrl,docAttachments:s.attachments})):warn$1("Push buttons without action dictionaries are not supported")}getFieldObject(){let t,e="button";return this.data.checkBox?(e="checkbox",t=this.data.exportValue):this.data.radioButton&&(e="radiobutton",t=this.data.buttonValue),{id:this.data.id,value:this.data.fieldValue||"Off",defaultValue:this.data.defaultFieldValue,exportValues:t,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,hidden:this.data.hidden,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:e}}get fallbackFontDict(){const t=new fs;return t.setIfName("BaseFont","ZapfDingbats"),t.setIfName("Type","FallbackType"),t.setIfName("Subtype","FallbackType"),t.setIfName("Encoding","ZapfDingbatsEncoding"),shadow$1(this,"fallbackFontDict",t)}},kb=class extends xb{constructor(t){super(t);const{dict:e,xref:s}=t;this.indices=e.getArray("I"),this.hasIndices=Array.isArray(this.indices)&&this.indices.length>0,this.data.options=[];const i=getInheritableProperty({dict:e,key:"Opt"});if(Array.isArray(i))for(let t=0,e=i.length;t<e;t++){const e=s.fetchIfRef(i[t]),n=Array.isArray(e);this.data.options[t]={exportValue:this._decodeFormValue(n?s.fetchIfRef(e[0]):e),displayValue:this._decodeFormValue(n?s.fetchIfRef(e[1]):e)}}if(this.hasIndices){this.data.fieldValue=[];const t=this.data.options.length;for(const e of this.indices)Number.isInteger(e)&&e>=0&&e<t&&this.data.fieldValue.push(this.data.options[e].exportValue)}else"string"==typeof this.data.fieldValue?this.data.fieldValue=[this.data.fieldValue]:this.data.fieldValue||=[];0===this.data.options.length&&this.data.fieldValue.length>0&&(this.data.options=this.data.fieldValue.map(t=>({exportValue:t,displayValue:t}))),this.data.combo=this.hasFieldFlag(j),this.data.multiSelect=this.hasFieldFlag(z),this._hasText=!0}getFieldObject(){const t=this.data.combo?"combobox":"listbox",e=this.data.fieldValue.length>0?this.data.fieldValue[0]:null;return{id:this.data.id,value:e,defaultValue:this.data.defaultFieldValue,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,numItems:this.data.fieldValue.length,multipleSelection:this.data.multiSelect,hidden:this.data.hidden,actions:this.data.actions,items:this.data.options,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:t}}amendSavedDict(t,e){if(!this.hasIndices)return;let s=t?.get(this.data.id)?.value;Array.isArray(s)||(s=[s]);const i=[],{options:n}=this.data;for(let t=0,e=0,a=n.length;t<a;t++)n[t].exportValue===s[e]&&(i.push(t),e+=1);e.set("I",i)}async _getAppearance(t,e,s,n){if(this.data.combo)return super._getAppearance(t,e,s,n);let a,r;const o=n?.get(this.data.id);if(o&&(r=o.rotation,a=o.value),void 0===r&&void 0===a&&!this._needAppearances)return null;void 0===a?a=this.data.fieldValue:Array.isArray(a)||(a=[a]);let{width:l,height:c}=this;90!==r&&270!==r||([l,c]=[c,l]);const h=this.data.options.length,u=[];for(let t=0;t<h;t++){const{exportValue:e}=this.data.options[t];a.includes(e)&&u.push(t)}this._defaultAppearance||(this.data.defaultAppearanceData=parseDefaultAppearance(this._defaultAppearance="/Helvetica 0 Tf 0 g"));const d=await xb._getFontData(t,e,this.data.defaultAppearanceData,this._fieldResources.mergedResources);let f,{fontSize:g}=this.data.defaultAppearanceData;if(g)f=this._defaultAppearance;else{const t=(c-1)/h;let e,s=-1;for(const{displayValue:t}of this.data.options){const i=this._getTextWidth(t,d);i>s&&(s=i,e=t)}[f,g]=this._computeFontSize(t,l-4,e,d,-1)}const p=g*i,m=(p-g)/2,b=Math.floor(c/p);let w=0;if(u.length>0){const t=Math.min(...u),e=Math.max(...u);w=Math.max(0,e-b+1),w>t&&(w=t)}const y=Math.min(w+b+1,h),x=["/Tx BMC q",`1 1 ${l} ${c} re W n`];if(u.length){x.push("0.600006 0.756866 0.854904 rg");for(const t of u)w<=t&&t<y&&x.push(`1 ${c-(t-w+1)*p} ${l} ${p} re f`)}x.push("BT",f,`1 0 0 1 0 ${c} Tm`);const v={shift:0};for(let t=w;t<y;t++){const{displayValue:e}=this.data.options[t],s=t===w?m:0;x.push(this._renderText(e,d,g,l,0,v,2,-p+s))}return x.push("ET Q EMC"),x.join("\n")}},Sb=class extends xb{constructor(t){super(t),this.data.fieldValue=null,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!this.data.hasOwnCanvas}getFieldObject(){return{id:this.data.id,value:null,page:this.data.pageIndex,type:"signature"}}},Cb=class extends yb{constructor(t){super(t),this.data.noRotate=!0,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1;const{dict:e}=t;this.data.annotationType=_.TEXT,this.data.hasAppearance?this.data.name="NoIcon":(this.data.rect[1]=this.data.rect[3]-22,this.data.rect[2]=this.data.rect[0]+22,this.data.name=e.has("Name")?e.get("Name").name:"Note"),e.has("State")?(this.data.state=e.get("State")||null,this.data.stateModel=e.get("StateModel")||null):(this.data.state=null,this.data.stateModel=null)}},_b=class extends bb{constructor(t){super(t);const{dict:e,annotationGlobals:s}=t;this.data.annotationType=_.LINK,this.data.noHTML=!1;const i=getQuadPoints(e,this.rectangle);i&&(this.data.quadPoints=i),this.data.borderColor||=this.data.color,Nl.parseDestDictionary({destDict:e,resultObj:this.data,docBaseUrl:s.baseUrl,docAttachments:s.attachments})}get overlaysTextContent(){return!0}},Ib=class extends bb{constructor(t){super(t);const{dict:e}=t;this.data.annotationType=_.POPUP,this.data.noHTML=!1,0!==this.width&&0!==this.height||(this.data.rect=null);let s=e.get("Parent");if(s){if(this.data.parentRect=lookupNormalRect(s.getArray("Rect"),null),this.data.creationDate=s.get("CreationDate")||"",isName(s.get("RT"),I)&&(s=s.get("IRT")),s.has("M")?(this.setModificationDate(s.get("M")),this.data.modificationDate=this.modificationDate):this.data.modificationDate=null,s.has("C")?(this.setColor(s.getArray("C")),this.data.color=this.color):this.data.color=null,!this.viewable){const t=s.get("F");this._isViewable(t)&&this.setFlags(t)}this.setTitle(s.get("T")),this.data.titleObj=this._title,this.setContents(s.get("Contents")),this.data.contentsObj=this._contents,s.has("RC")&&(this.data.richText=pb.getRichTextAsHtml(s.get("RC"))),this.data.open=!!e.get("Open")}else warn$1("Popup annotation has a missing or invalid parent annotation.")}static createNewDict(t,e,s){const{oldAnnotation:i,rect:n,parent:a}=t,r=i||new fs(e);return r.setIfNotExists("Type",us.get("Annot")),r.setIfNotExists("Subtype",us.get("Popup")),r.setIfNotExists("Open",!1),r.setIfArray("Rect",n),r.set("Parent",a),r}static async createNewAppearanceStream(t,e,s){return null}},Tb=class extends yb{constructor(t){super(t),this.data.hasOwnCanvas=this.data.noRotate,this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1;const{annotationGlobals:e,evaluatorOptions:s,xref:i}=t;if(this.data.annotationType=_.FREETEXT,this.setDefaultAppearance(t),this._hasAppearance=!!this.appearance,this._hasAppearance){const{fontColor:t,fontSize:n}=function(t,e,s,i){return new ol(t,e,s,i).parse()}(this.appearance,s,i,e.globalColorSpaceCache);this.data.defaultAppearanceData.fontColor=t,this.data.defaultAppearanceData.fontSize=n||10}else{this.data.defaultAppearanceData.fontSize||=10;const{fontColor:e,fontSize:s}=this.data.defaultAppearanceData;if(this._contents.str){this.data.textContent=this._contents.str.split(/\r\n?|\n/).map(t=>t.trimEnd());const{coords:t,bbox:e,matrix:i}=ll.getFirstPositionInfo(this.rectangle,this.rotation,s);this.data.textPosition=this._transformPoint(t,e,i)}if(this._isOffscreenCanvasSupported){const n=t.dict.get("CA"),a=new ll(i,"sans-serif");this.appearance=a.createAppearance(this._contents.str,this.rectangle,this.rotation,s,e,n),this._streams.push(this.appearance)}else warn$1("FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly.")}}get hasTextContent(){return this._hasAppearance}static createNewDict(t,e,{apRef:s,ap:i}){const{color:n,date:a,fontSize:r,oldAnnotation:o,rect:l,rotation:c,user:h,value:u}=t,d=o||new fs(e);d.setIfNotExists("Type",us.get("Annot")),d.setIfNotExists("Subtype",us.get("FreeText")),d.set(o?"M":"CreationDate",`D:${getModificationDate(a)}`),o&&d.delete("RC"),d.setIfArray("Rect",l);const f=`/Helv ${r} Tf ${getPdfColor(n,!0)}`;if(d.set("DA",f),d.setIfDefined("Contents",stringToAsciiOrUTF16BE(u)),d.setIfNotExists("F",4),d.setIfNotExists("Border",[0,0,0]),d.setIfNumber("Rotate",c),d.setIfDefined("T",stringToAsciiOrUTF16BE(h)),s||i){const t=new fs(e);d.set("AP",t),t.set("N",s||i)}return d}static async createNewAppearanceStream(t,e,s){const{baseFontRef:n,evaluator:a,task:r}=s,{color:o,fontSize:l,rect:c,rotation:h,value:u}=t;if(!o)return null;const d=new fs(e),f=new fs(e);if(n)f.set("Helv",n);else{const t=new fs(e);t.setIfName("BaseFont","Helvetica"),t.setIfName("Type","Font"),t.setIfName("Subtype","Type1"),t.setIfName("Encoding","WinAnsiEncoding"),f.set("Helv",t)}d.set("Font",f);const g=await xb._getFontData(a,r,{fontName:"Helv",fontSize:l},d),[p,m,b,w]=c;let y=b-p,x=w-m;h%180!=0&&([y,x]=[x,y]);const v=u.split("\n"),A=l/1e3;let k=-1/0;const S=[];for(let t of v){const e=g.encodeString(t);if(e.length>1)return null;t=e.join(""),S.push(t);let s=0;const i=g.charsToGlyphs(t);for(const t of i)s+=t.width*A;k=Math.max(k,s)}let C=1;k>y&&(C=y/k);let _=1;const I=i*l,T=1*l,M=I*v.length;M>x&&(_=x/M);const E=l*Math.min(C,_);let F,D,R;switch(h){case 0:R=[1,0,0,1],D=[c[0],c[1],y,x],F=[c[0],c[3]-T];break;case 90:R=[0,1,-1,0],D=[c[1],-c[2],y,x],F=[c[1],-c[0]-T];break;case 180:R=[-1,0,0,-1],D=[-c[2],-c[3],y,x],F=[-c[2],-c[1]-T];break;case 270:R=[0,-1,1,0],D=[-c[3],c[0],y,x],F=[-c[3],c[2]-T]}const B=["q",`${R.join(" ")} 0 0 cm`,`${D.join(" ")} re W n`,"BT",`${getPdfColor(o,!0)}`,`0 Tc /Helv ${numberToString(E)} Tf`];B.push(`${F.join(" ")} Td (${escapeString(S[0])}) Tj`);const P=numberToString(I);for(let t=1,e=S.length;t<e;t++){const e=S[t];B.push(`0 -${P} Td (${escapeString(e)}) Tj`)}B.push("ET","Q");const N=B.join("\n"),O=new fs(e);O.set("FormType",1),O.setIfName("Subtype","Form"),O.setIfName("Type","XObject"),O.set("BBox",c),O.set("Resources",d),O.set("Matrix",[1,0,0,1,-c[0],-c[1]]);const L=new Ys(N);return L.dict=O,L}},Mb=class extends yb{constructor(t){super(t);const{dict:e,xref:s}=t;this.data.annotationType=_.LINE,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1;const i=lookupRect(e.getArray("L"),[0,0,0,0]);if(this.data.lineCoordinates=ss.normalizeRect(i),this.setLineEndings(e.getArray("LE")),this.data.lineEndings=this.lineEndings,!this.appearance){const t=getPdfColorArray(this.color,[0,0,0]),n=e.get("CA"),a=getPdfColorArray(getRgbColor(e.getArray("IC"),null)),r=a?n:null,o=this.borderStyle.width||1,l=2*o,c=[this.data.lineCoordinates[0]-l,this.data.lineCoordinates[1]-l,this.data.lineCoordinates[2]+l,this.data.lineCoordinates[3]+l];ss.intersect(this.rectangle,c)||(this.rectangle=c),this._setDefaultAppearance({xref:s,extra:`${o} w`,strokeColor:t,fillColor:a,strokeAlpha:n,fillAlpha:r,pointsCallback:(t,e)=>(t.push(`${i[0]} ${i[1]} m`,`${i[2]} ${i[3]} l`,"S"),[e[0]-o,e[7]-o,e[2]+o,e[3]+o])})}}},Eb=class extends yb{constructor(t){super(t);const{dict:e,xref:s}=t;if(this.data.annotationType=_.SQUARE,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1,!this.appearance){const t=getPdfColorArray(this.color,[0,0,0]),i=e.get("CA"),n=getPdfColorArray(getRgbColor(e.getArray("IC"),null)),a=n?i:null;if(0===this.borderStyle.width&&!n)return;this._setDefaultAppearance({xref:s,extra:`${this.borderStyle.width} w`,strokeColor:t,fillColor:n,strokeAlpha:i,fillAlpha:a,pointsCallback:(t,e)=>{const s=e[4]+this.borderStyle.width/2,i=e[5]+this.borderStyle.width/2,a=e[6]-e[4]-this.borderStyle.width,r=e[3]-e[7]-this.borderStyle.width;return t.push(`${s} ${i} ${a} ${r} re`),n?t.push("B"):t.push("S"),[e[0],e[7],e[2],e[3]]}})}}},Fb=class extends yb{constructor(t){super(t);const{dict:e,xref:s}=t;if(this.data.annotationType=_.CIRCLE,!this.appearance){const t=getPdfColorArray(this.color,[0,0,0]),i=e.get("CA"),n=getPdfColorArray(getRgbColor(e.getArray("IC"),null)),a=n?i:null;if(0===this.borderStyle.width&&!n)return;const r=4/3*Math.tan(Math.PI/8);this._setDefaultAppearance({xref:s,extra:`${this.borderStyle.width} w`,strokeColor:t,fillColor:n,strokeAlpha:i,fillAlpha:a,pointsCallback:(t,e)=>{const s=e[0]+this.borderStyle.width/2,i=e[1]-this.borderStyle.width/2,a=e[6]-this.borderStyle.width/2,o=e[7]+this.borderStyle.width/2,l=s+(a-s)/2,c=i+(o-i)/2,h=(a-s)/2*r,u=(o-i)/2*r;return t.push(`${l} ${o} m`,`${l+h} ${o} ${a} ${c+u} ${a} ${c} c`,`${a} ${c-u} ${l+h} ${i} ${l} ${i} c`,`${l-h} ${i} ${s} ${c-u} ${s} ${c} c`,`${s} ${c+u} ${l-h} ${o} ${l} ${o} c`,"h"),n?t.push("B"):t.push("S"),[e[0],e[7],e[2],e[3]]}})}}},Db=class extends yb{constructor(t){super(t);const{dict:e,xref:s}=t;this.data.annotationType=_.POLYLINE,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1,this.data.vertices=null,this instanceof Rb||(this.setLineEndings(e.getArray("LE")),this.data.lineEndings=this.lineEndings);const i=e.getArray("Vertices");if(!isNumberArray(i,null))return;const n=this.data.vertices=Float32Array.from(i);if(!this.appearance){const t=getPdfColorArray(this.color,[0,0,0]),i=e.get("CA");let a,r=getRgbColor(e.getArray("IC"),null);r&&(r=getPdfColorArray(r)),a=r?this.color?r.every((e,s)=>e===t[s])?"f":"B":"f":"S";const o=this.borderStyle.width||1,l=2*o,c=[1/0,1/0,-1/0,-1/0];for(let t=0,e=n.length;t<e;t+=2)ss.rectBoundingBox(n[t]-l,n[t+1]-l,n[t]+l,n[t+1]+l,c);ss.intersect(this.rectangle,c)||(this.rectangle=c),this._setDefaultAppearance({xref:s,extra:`${o} w`,strokeColor:t,strokeAlpha:i,fillColor:r,fillAlpha:r?i:null,pointsCallback:(t,e)=>{for(let e=0,s=n.length;e<s;e+=2)t.push(`${n[e]} ${n[e+1]} ${0===e?"m":"l"}`);return t.push(a),[e[0],e[7],e[2],e[3]]}})}}},Rb=class extends Db{constructor(t){super(t),this.data.annotationType=_.POLYGON}},Bb=class extends yb{constructor(t){super(t),this.data.annotationType=_.CARET}},Pb=class extends yb{constructor(t){super(t),this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1;const{dict:e,xref:s}=t;this.data.annotationType=_.INK,this.data.inkLists=[],this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1,this.data.opacity=e.get("CA")||1;const i=e.getArray("InkList");if(Array.isArray(i)){for(let t=0,e=i.length;t<e;++t){if(!Array.isArray(i[t]))continue;const e=new Float32Array(i[t].length);this.data.inkLists.push(e);for(let n=0,a=i[t].length;n<a;n+=2){const a=s.fetchIfRef(i[t][n]),r=s.fetchIfRef(i[t][n+1]);"number"==typeof a&&"number"==typeof r&&(e[n]=a,e[n+1]=r)}}if(!this.appearance){const t=getPdfColorArray(this.color,[0,0,0]),i=e.get("CA"),n=this.borderStyle.width||1,a=2*n,r=[1/0,1/0,-1/0,-1/0];for(const t of this.data.inkLists)for(let e=0,s=t.length;e<s;e+=2)ss.rectBoundingBox(t[e]-a,t[e+1]-a,t[e]+a,t[e+1]+a,r);ss.intersect(this.rectangle,r)||(this.rectangle=r),this._setDefaultAppearance({xref:s,extra:`${n} w`,strokeColor:t,strokeAlpha:i,pointsCallback:(t,e)=>{for(const e of this.data.inkLists){for(let s=0,i=e.length;s<i;s+=2)t.push(`${e[s]} ${e[s+1]} ${0===s?"m":"l"}`);t.push("S")}return[e[0],e[7],e[2],e[3]]}})}}}static createNewDict(t,e,{apRef:s,ap:i}){const{oldAnnotation:n,color:a,date:r,opacity:o,paths:l,outlines:c,rect:h,rotation:u,thickness:d,user:f}=t,g=n||new fs(e);if(g.setIfNotExists("Type",us.get("Annot")),g.setIfNotExists("Subtype",us.get("Ink")),g.set(n?"M":"CreationDate",`D:${getModificationDate(r)}`),g.setIfArray("Rect",h),g.setIfArray("InkList",c?.points||l?.points),g.setIfNotExists("F",4),g.setIfNumber("Rotate",u),g.setIfDefined("T",stringToAsciiOrUTF16BE(f)),c&&g.setIfName("IT","InkHighlight"),d>0){const t=new fs(e);g.set("BS",t),t.set("W",d)}if(g.setIfArray("C",getPdfColorArray(a)),g.setIfNumber("CA",o),i||s){const t=new fs(e);g.set("AP",t),t.set("N",s||i)}return g}static async createNewAppearanceStream(t,e,s){if(t.outlines)return this.createNewAppearanceStreamForHighlight(t,e,s);const{color:i,rect:n,paths:a,thickness:r,opacity:o}=t;if(!i)return null;const l=[`${r} w 1 J 1 j`,`${getPdfColor(i,!1)}`];1!==o&&l.push("/R0 gs");for(const t of a.lines){l.push(`${numberToString(t[4])} ${numberToString(t[5])} m`);for(let e=6,s=t.length;e<s;e+=6)if(isNaN(t[e]))l.push(`${numberToString(t[e+4])} ${numberToString(t[e+5])} l`);else{const[s,i,n,a,r,o]=t.slice(e,e+6);l.push([s,i,n,a,r,o].map(numberToString).join(" ")+" c")}6===t.length&&l.push(`${numberToString(t[4])} ${numberToString(t[5])} l`)}l.push("S");const c=l.join("\n"),h=new fs(e);if(h.set("FormType",1),h.setIfName("Subtype","Form"),h.setIfName("Type","XObject"),h.set("BBox",n),h.set("Length",c.length),1!==o){const t=new fs(e),s=new fs(e),i=new fs(e);i.set("CA",o),i.setIfName("Type","ExtGState"),s.set("R0",i),t.set("ExtGState",s),h.set("Resources",t)}const u=new Ys(c);return u.dict=h,u}static async createNewAppearanceStreamForHighlight(t,e,s){const{color:i,rect:n,outlines:{outline:a},opacity:r}=t;if(!i)return null;const o=[`${getPdfColor(i,!0)}`,"/R0 gs"];o.push(`${numberToString(a[4])} ${numberToString(a[5])} m`);for(let t=6,e=a.length;t<e;t+=6)if(isNaN(a[t]))o.push(`${numberToString(a[t+4])} ${numberToString(a[t+5])} l`);else{const[e,s,i,n,r,l]=a.slice(t,t+6);o.push([e,s,i,n,r,l].map(numberToString).join(" ")+" c")}o.push("h f");const l=o.join("\n"),c=new fs(e);c.set("FormType",1),c.setIfName("Subtype","Form"),c.setIfName("Type","XObject"),c.set("BBox",n),c.set("Length",l.length);const h=new fs(e),u=new fs(e);h.set("ExtGState",u),c.set("Resources",h);const d=new fs(e);u.set("R0",d),d.setIfName("BM","Multiply"),1!==r&&(d.set("ca",r),d.setIfName("Type","ExtGState"));const f=new Ys(l);return f.dict=c,f}},Nb=class extends yb{constructor(t){super(t);const{dict:e,xref:s}=t;if(this.data.annotationType=_.HIGHLIGHT,this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1,this.data.opacity=e.get("CA")||1,this.data.quadPoints=getQuadPoints(e,null)){const t=this.appearance?.dict.get("Resources");if(!this.appearance||!t?.has("ExtGState")){this.appearance&&warn$1("HighlightAnnotation - ignoring built-in appearance stream.");const t=getPdfColorArray(this.color,[1,1,0]),i=e.get("CA");this._setDefaultAppearance({xref:s,fillColor:t,blendMode:"Multiply",fillAlpha:i,pointsCallback:(t,e)=>(t.push(`${e[0]} ${e[1]} m`,`${e[2]} ${e[3]} l`,`${e[6]} ${e[7]} l`,`${e[4]} ${e[5]} l`,"f"),[e[0],e[7],e[2],e[3]])})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}static createNewDict(t,e,{apRef:s,ap:i}){const{color:n,date:a,oldAnnotation:r,opacity:o,rect:l,rotation:c,user:h,quadPoints:u}=t,d=r||new fs(e);if(d.setIfNotExists("Type",us.get("Annot")),d.setIfNotExists("Subtype",us.get("Highlight")),d.set(r?"M":"CreationDate",`D:${getModificationDate(a)}`),d.setIfArray("Rect",l),d.setIfNotExists("F",4),d.setIfNotExists("Border",[0,0,0]),d.setIfNumber("Rotate",c),d.setIfArray("QuadPoints",u),d.setIfArray("C",getPdfColorArray(n)),d.setIfNumber("CA",o),d.setIfDefined("T",stringToAsciiOrUTF16BE(h)),s||i){const t=new fs(e);d.set("AP",t),t.set("N",s||i)}return d}static async createNewAppearanceStream(t,e,s){const{color:i,rect:n,outlines:a,opacity:r}=t;if(!i)return null;const o=[`${getPdfColor(i,!0)}`,"/R0 gs"],l=[];for(const t of a){l.length=0,l.push(`${numberToString(t[0])} ${numberToString(t[1])} m`);for(let e=2,s=t.length;e<s;e+=2)l.push(`${numberToString(t[e])} ${numberToString(t[e+1])} l`);l.push("h"),o.push(l.join("\n"))}o.push("f*");const c=o.join("\n"),h=new fs(e);h.set("FormType",1),h.setIfName("Subtype","Form"),h.setIfName("Type","XObject"),h.set("BBox",n),h.set("Length",c.length);const u=new fs(e),d=new fs(e);u.set("ExtGState",d),h.set("Resources",u);const f=new fs(e);d.set("R0",f),f.setIfName("BM","Multiply"),1!==r&&(f.set("ca",r),f.setIfName("Type","ExtGState"));const g=new Ys(c);return g.dict=h,g}},Ob=class extends yb{constructor(t){super(t);const{dict:e,xref:s}=t;if(this.data.annotationType=_.UNDERLINE,this.data.quadPoints=getQuadPoints(e,null)){if(!this.appearance){const t=getPdfColorArray(this.color,[0,0,0]),i=e.get("CA");this._setDefaultAppearance({xref:s,extra:"[] 0 d 0.571 w",strokeColor:t,strokeAlpha:i,pointsCallback:(t,e)=>(t.push(`${e[4]} ${e[5]+1.3} m`,`${e[6]} ${e[7]+1.3} l`,"S"),[e[0],e[7],e[2],e[3]])})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}},Lb=class extends yb{constructor(t){super(t);const{dict:e,xref:s}=t;if(this.data.annotationType=_.SQUIGGLY,this.data.quadPoints=getQuadPoints(e,null)){if(!this.appearance){const t=getPdfColorArray(this.color,[0,0,0]),i=e.get("CA");this._setDefaultAppearance({xref:s,extra:"[] 0 d 1 w",strokeColor:t,strokeAlpha:i,pointsCallback:(t,e)=>{const s=(e[1]-e[5])/6;let i=s,n=e[4];const a=e[5],r=e[6];t.push(`${n} ${a+i} m`);do{n+=2,i=0===i?s:0,t.push(`${n} ${a+i} l`)}while(n<r);return t.push("S"),[e[4],a-2*s,r,a+2*s]}})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}},Ub=class extends yb{constructor(t){super(t);const{dict:e,xref:s}=t;if(this.data.annotationType=_.STRIKEOUT,this.data.quadPoints=getQuadPoints(e,null)){if(!this.appearance){const t=getPdfColorArray(this.color,[0,0,0]),i=e.get("CA");this._setDefaultAppearance({xref:s,extra:"[] 0 d 1 w",strokeColor:t,strokeAlpha:i,pointsCallback:(t,e)=>(t.push((e[0]+e[4])/2+" "+(e[1]+e[5])/2+" m",(e[2]+e[6])/2+" "+(e[3]+e[7])/2+" l","S"),[e[0],e[7],e[2],e[3]])})}}else this.data.popupRef=null}get overlaysTextContent(){return!0}},$b=class extends yb{#Ct=null;constructor(t){super(t),this.data.annotationType=_.STAMP,this.data.hasOwnCanvas=this.data.noRotate,this.data.isEditable=!this.data.noHTML,this.data.noHTML=!1}mustBeViewedWhenEditing(t,e=null){return t?!this.data.isEditable||(this.#Ct??=this.data.hasOwnCanvas,this.data.hasOwnCanvas=!0,!0):(null!==this.#Ct&&(this.data.hasOwnCanvas=this.#Ct,this.#Ct=null),!e?.has(this.data.id))}static async createImage(t,e){const{width:s,height:i}=t,n=new OffscreenCanvas(s,i),a=n.getContext("2d",{alpha:!0});a.drawImage(t,0,0);const r=a.getImageData(0,0,s,i).data,o=new Uint32Array(r.buffer),l=o.some(ts.isLittleEndian?t=>t>>>24!=255:t=>!!(255&~t));l&&(a.fillStyle="white",a.fillRect(0,0,s,i),a.drawImage(t,0,0));const c=n.convertToBlob({type:"image/jpeg",quality:1}).then(t=>t.arrayBuffer()),h=us.get("XObject"),u=us.get("Image"),d=new fs(e);d.set("Type",h),d.set("Subtype",u),d.set("BitsPerComponent",8),d.setIfName("ColorSpace","DeviceRGB"),d.setIfName("Filter","DCTDecode"),d.set("BBox",[0,0,s,i]),d.set("Width",s),d.set("Height",i);let f=null;if(l){const t=new Uint8Array(o.length);if(ts.isLittleEndian)for(let e=0,s=o.length;e<s;e++)t[e]=o[e]>>>24;else for(let e=0,s=o.length;e<s;e++)t[e]=255&o[e];const n=new fs(e);n.set("Type",h),n.set("Subtype",u),n.set("BitsPerComponent",8),n.setIfName("ColorSpace","DeviceGray"),n.set("Width",s),n.set("Height",i),f=new Ks(t,0,0,n)}return{imageStream:new Ks(await c,0,0,d),smaskStream:f,width:s,height:i}}static createNewDict(t,e,{apRef:s,ap:i}){const{date:n,oldAnnotation:a,rect:r,rotation:o,user:l}=t,c=a||new fs(e);if(c.setIfNotExists("Type",us.get("Annot")),c.setIfNotExists("Subtype",us.get("Stamp")),c.set(a?"M":"CreationDate",`D:${getModificationDate(n)}`),c.setIfArray("Rect",r),c.setIfNotExists("F",4),c.setIfNotExists("Border",[0,0,0]),c.setIfNumber("Rotate",o),c.setIfDefined("T",stringToAsciiOrUTF16BE(l)),s||i){const t=new fs(e);c.set("AP",t),t.set("N",s||i)}return c}static async#_t(t,e){const{areContours:s,color:i,rect:n,lines:a,thickness:r}=t;if(!i)return null;const o=[`${r} w 1 J 1 j`,`${getPdfColor(i,s)}`];for(const t of a){o.push(`${numberToString(t[4])} ${numberToString(t[5])} m`);for(let e=6,s=t.length;e<s;e+=6)if(isNaN(t[e]))o.push(`${numberToString(t[e+4])} ${numberToString(t[e+5])} l`);else{const[s,i,n,a,r,l]=t.slice(e,e+6);o.push([s,i,n,a,r,l].map(numberToString).join(" ")+" c")}6===t.length&&o.push(`${numberToString(t[4])} ${numberToString(t[5])} l`)}o.push(s?"F":"S");const l=o.join("\n"),c=new fs(e);c.set("FormType",1),c.setIfName("Subtype","Form"),c.setIfName("Type","XObject"),c.set("BBox",n),c.set("Length",l.length);const h=new Ys(l);return h.dict=c,h}static async createNewAppearanceStream(t,e,s){if(t.oldAnnotation)return null;if(t.isSignature)return this.#_t(t,e);const{rotation:i}=t,{imageRef:n,width:a,height:r}=s.image,o=new fs(e),l=new fs(e);o.set("XObject",l),l.set("Im0",n);const c=`q ${a} 0 0 ${r} 0 0 cm /Im0 Do Q`,h=new fs(e);if(h.set("FormType",1),h.setIfName("Subtype","Form"),h.setIfName("Type","XObject"),h.set("BBox",[0,0,a,r]),h.set("Resources",o),i){const t=getRotationMatrix(i,a,r);h.set("Matrix",t)}const u=new Ys(c);return u.dict=h,u}},Hb=class extends yb{constructor(t){super(t);const{dict:e,xref:s}=t,i=new gl(e.get("FS"),s);this.data.annotationType=_.FILEATTACHMENT,this.data.hasOwnCanvas=this.data.noRotate,this.data.noHTML=!1,this.data.file=i.serializable;const n=e.get("Name");this.data.name=n instanceof us?stringToPDFString(n.name):"PushPin";const a=e.get("ca");this.data.fillAlpha="number"==typeof a&&a>=0&&a<=1?a:null}},jb={get r(){return shadow$1(this,"r",new Uint8Array([7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21]))},get k(){return shadow$1(this,"k",new Int32Array([-680876936,-389564586,606105819,-1044525330,-176418897,1200080426,-1473231341,-45705983,1770035416,-1958414417,-42063,-1990404162,1804603682,-40341101,-1502002290,1236535329,-165796510,-1069501632,643717713,-373897302,-701558691,38016083,-660478335,-405537848,568446438,-1019803690,-187363961,1163531501,-1444681467,-51403784,1735328473,-1926607734,-378558,-2022574463,1839030562,-35309556,-1530992060,1272893353,-155497632,-1094730640,681279174,-358537222,-722521979,76029189,-640364487,-421815835,530742520,-995338651,-198630844,1126891415,-1416354905,-57434055,1700485571,-1894986606,-1051523,-2054922799,1873313359,-30611744,-1560198380,1309151649,-145523070,-1120210379,718787259,-343485551]))}};function calculateMD5(t,e,s){let i=1732584193,n=-271733879,a=-1732584194,r=271733878;const o=s+72&-64,l=new Uint8Array(o);let c,h;for(c=0;c<s;++c)l[c]=t[e++];l[c++]=128;const u=o-8;c<u&&(c=u),l[c++]=s<<3&255,l[c++]=s>>5&255,l[c++]=s>>13&255,l[c++]=s>>21&255,l[c++]=s>>>29&255,c+=3;const d=new Int32Array(16),{k:f,r:g}=jb;for(c=0;c<o;){for(h=0;h<16;++h,c+=4)d[h]=l[c]|l[c+1]<<8|l[c+2]<<16|l[c+3]<<24;let t,e,s=i,o=n,u=a,p=r;for(h=0;h<64;++h){h<16?(t=o&u|~o&p,e=h):h<32?(t=p&o|~p&u,e=5*h+1&15):h<48?(t=o^u^p,e=3*h+5&15):(t=u^(o|~p),e=7*h&15);const i=p,n=s+t+f[h]+d[e]|0,a=g[h];p=u,u=o,o=o+(n<<a|n>>>32-a)|0,s=i}i=i+s|0,n=n+o|0,a=a+u|0,r=r+p|0}return new Uint8Array([255&i,i>>8&255,i>>16&255,i>>>24&255,255&n,n>>8&255,n>>16&255,n>>>24&255,255&a,a>>8&255,a>>16&255,a>>>24&255,255&r,r>>8&255,r>>16&255,r>>>24&255])}function decodeString(t){try{return stringToUTF8String$1(t)}catch(e){return warn$1(`UTF-8 decoding failed: "${e}".`),t}}var qb=class extends Sl{constructor(t){super(t),this.node=null}onEndElement(t){const e=super.onEndElement(t);if(e&&"xfa:datasets"===t)throw this.node=e,new Error("Aborting DatasetXMLParser.")}},zb=class{constructor(t){if(t.datasets)this.node=new Sl({hasAttributes:!0}).parseFromString(t.datasets).documentElement;else{const e=new qb({hasAttributes:!0});try{e.parseFromString(t["xdp:xdp"])}catch{}this.node=e.node}}getValue(t){if(!this.node||!t)return"";const e=this.node.searchNode(parseXFAPath(t),0);if(!e)return"";const s=e.firstChild;return"value"===s?.nodeName?e.children.map(t=>decodeString(t.textContent)):decodeString(e.textContent)}},Gb=class{#It;#Tt=1/0;#Mt=1/0;#Et=-1/0;#Ft=-1/0;#Dt=null;#Rt=[];#Bt=[];#Pt=-1;#Nt=!1;constructor(t){this.#It=t;const e=t.data.quadPoints;if(e){for(let t=0,s=e.length;t<s;t+=8)this.#Tt=Math.min(this.#Tt,e[t]),this.#Et=Math.max(this.#Et,e[t+2]),this.#Mt=Math.min(this.#Mt,e[t+5]),this.#Ft=Math.max(this.#Ft,e[t+1]);e.length>8&&(this.#Dt=e)}else[this.#Tt,this.#Mt,this.#Et,this.#Ft]=t.data.rect}overlaps(t){return!(this.#Tt>=t.#Et||this.#Et<=t.#Tt||this.#Mt>=t.#Ft||this.#Ft<=t.#Mt)}#Ot(t,e){if(this.#Tt>=t||this.#Et<=t||this.#Mt>=e||this.#Ft<=e)return!1;const s=this.#Dt;if(!s)return!0;if(this.#Pt>=0){const i=this.#Pt;if(!(s[i]>=t||s[i+2]<=t||s[i+5]>=e||s[i+1]<=e))return!0;this.#Pt=-1}for(let i=0,n=s.length;i<n;i+=8)if(!(s[i]>=t||s[i+2]<=t||s[i+5]>=e||s[i+1]<=e))return this.#Pt=i,!0;return!1}addGlyph(t,e,s){return this.#Ot(t,e)?(this.#Bt.length>0&&(this.#Rt.push(this.#Bt.join("")),this.#Bt.length=0),this.#Rt.push(s),this.#Nt=!0,!0):(this.disableExtraChars(),!1)}addExtraChar(t){this.#Nt&&this.#Bt.push(t)}disableExtraChars(){this.#Nt&&(this.#Nt=!1,this.#Bt.length=0)}setText(){this.#It.data.overlaidText=this.#Rt.join("")}},Wb=class{#Lt=new Map;constructor(t){for(const e of t){if(!e.data.quadPoints&&!e.data.rect)continue;const t=new Gb(e);for(const[e,s]of this.#Lt)e.overlaps(t)&&(s?s.add(t):this.#Lt.set(e,new Set([t])));this.#Lt.set(t,null)}}addGlyph(t,e,s,i){const n=t[4]+e/2,a=t[5]+s/2;let r;for(const[t,e]of this.#Lt)r?r.has(t)?t.addGlyph(n,a,i):t.disableExtraChars():t.addGlyph(n,a,i)&&(r=e)}addExtraChar(t){for(const e of this.#Lt.keys())e.addExtraChar(t)}setText(){for(const t of this.#Lt.keys())t.setText()}},Vb=class{constructor(t,e){this.high=0|t,this.low=0|e}and(t){this.high&=t.high,this.low&=t.low}xor(t){this.high^=t.high,this.low^=t.low}shiftRight(t){t>=32?(this.low=this.high>>>t-32|0,this.high=0):(this.low=this.low>>>t|this.high<<32-t,this.high=this.high>>>t|0)}rotateRight(t){let e,s;32&t?(s=this.low,e=this.high):(e=this.low,s=this.high),t&=31,this.low=e>>>t|s<<32-t,this.high=s>>>t|e<<32-t}not(){this.high=~this.high,this.low=~this.low}add(t){const e=(this.low>>>0)+(t.low>>>0);let s=(this.high>>>0)+(t.high>>>0);e>4294967295&&(s+=1),this.low=0|e,this.high=0|s}copyTo(t,e){t[e]=this.high>>>24&255,t[e+1]=this.high>>16&255,t[e+2]=this.high>>8&255,t[e+3]=255&this.high,t[e+4]=this.low>>>24&255,t[e+5]=this.low>>16&255,t[e+6]=this.low>>8&255,t[e+7]=255&this.low}assign(t){this.high=t.high,this.low=t.low}},Xb={get k(){return shadow$1(this,"k",[new Vb(1116352408,3609767458),new Vb(1899447441,602891725),new Vb(3049323471,3964484399),new Vb(3921009573,2173295548),new Vb(961987163,4081628472),new Vb(1508970993,3053834265),new Vb(2453635748,2937671579),new Vb(2870763221,3664609560),new Vb(3624381080,2734883394),new Vb(310598401,1164996542),new Vb(607225278,1323610764),new Vb(1426881987,3590304994),new Vb(1925078388,4068182383),new Vb(2162078206,991336113),new Vb(2614888103,633803317),new Vb(3248222580,3479774868),new Vb(3835390401,2666613458),new Vb(4022224774,944711139),new Vb(264347078,2341262773),new Vb(604807628,2007800933),new Vb(770255983,1495990901),new Vb(1249150122,1856431235),new Vb(1555081692,3175218132),new Vb(1996064986,2198950837),new Vb(2554220882,3999719339),new Vb(2821834349,766784016),new Vb(2952996808,2566594879),new Vb(3210313671,3203337956),new Vb(3336571891,1034457026),new Vb(3584528711,2466948901),new Vb(113926993,3758326383),new Vb(338241895,168717936),new Vb(666307205,1188179964),new Vb(773529912,1546045734),new Vb(1294757372,1522805485),new Vb(1396182291,2643833823),new Vb(1695183700,2343527390),new Vb(1986661051,1014477480),new Vb(2177026350,1206759142),new Vb(2456956037,344077627),new Vb(2730485921,1290863460),new Vb(2820302411,3158454273),new Vb(3259730800,3505952657),new Vb(3345764771,106217008),new Vb(3516065817,3606008344),new Vb(3600352804,1432725776),new Vb(4094571909,1467031594),new Vb(275423344,851169720),new Vb(430227734,3100823752),new Vb(506948616,1363258195),new Vb(659060556,3750685593),new Vb(883997877,3785050280),new Vb(958139571,3318307427),new Vb(1322822218,3812723403),new Vb(1537002063,2003034995),new Vb(1747873779,3602036899),new Vb(1955562222,1575990012),new Vb(2024104815,1125592928),new Vb(2227730452,2716904306),new Vb(2361852424,442776044),new Vb(2428436474,593698344),new Vb(2756734187,3733110249),new Vb(3204031479,2999351573),new Vb(3329325298,3815920427),new Vb(3391569614,3928383900),new Vb(3515267271,566280711),new Vb(3940187606,3454069534),new Vb(4118630271,4000239992),new Vb(116418474,1914138554),new Vb(174292421,2731055270),new Vb(289380356,3203993006),new Vb(460393269,320620315),new Vb(685471733,587496836),new Vb(852142971,1086792851),new Vb(1017036298,365543100),new Vb(1126000580,2618297676),new Vb(1288033470,3409855158),new Vb(1501505948,4234509866),new Vb(1607167915,987167468),new Vb(1816402316,1246189591)])}};function ch(t,e,s,i,n){t.assign(e),t.and(s),n.assign(e),n.not(),n.and(i),t.xor(n)}function maj(t,e,s,i,n){t.assign(e),t.and(s),n.assign(e),n.and(i),t.xor(n),n.assign(s),n.and(i),t.xor(n)}function sigma(t,e,s){t.assign(e),t.rotateRight(28),s.assign(e),s.rotateRight(34),t.xor(s),s.assign(e),s.rotateRight(39),t.xor(s)}function sigmaPrime(t,e,s){t.assign(e),t.rotateRight(14),s.assign(e),s.rotateRight(18),t.xor(s),s.assign(e),s.rotateRight(41),t.xor(s)}function littleSigma(t,e,s){t.assign(e),t.rotateRight(1),s.assign(e),s.rotateRight(8),t.xor(s),s.assign(e),s.shiftRight(7),t.xor(s)}function littleSigmaPrime(t,e,s){t.assign(e),t.rotateRight(19),s.assign(e),s.rotateRight(61),t.xor(s),s.assign(e),s.shiftRight(6),t.xor(s)}function calculateSHA512(t,e,s,i=!1){let n,a,r,o,l,c,h,u;i?(n=new Vb(3418070365,3238371032),a=new Vb(1654270250,914150663),r=new Vb(2438529370,812702999),o=new Vb(355462360,4144912697),l=new Vb(1731405415,4290775857),c=new Vb(2394180231,1750603025),h=new Vb(3675008525,1694076839),u=new Vb(1203062813,3204075428)):(n=new Vb(1779033703,4089235720),a=new Vb(3144134277,2227873595),r=new Vb(1013904242,4271175723),o=new Vb(2773480762,1595750129),l=new Vb(1359893119,2917565137),c=new Vb(2600822924,725511199),h=new Vb(528734635,4215389547),u=new Vb(1541459225,327033209));const d=128*Math.ceil((s+17)/128),f=new Uint8Array(d);let g,p;for(g=0;g<s;++g)f[g]=t[e++];f[g++]=128;const m=d-16;g<m&&(g=m),g+=11,f[g++]=s>>>29&255,f[g++]=s>>21&255,f[g++]=s>>13&255,f[g++]=s>>5&255,f[g++]=s<<3&255;const b=new Array(80);for(g=0;g<80;g++)b[g]=new Vb(0,0);const{k:w}=Xb;let y=new Vb(0,0),x=new Vb(0,0),v=new Vb(0,0),A=new Vb(0,0),k=new Vb(0,0),S=new Vb(0,0),C=new Vb(0,0),_=new Vb(0,0);const I=new Vb(0,0),T=new Vb(0,0),M=new Vb(0,0),E=new Vb(0,0);let F,D;for(g=0;g<d;){for(p=0;p<16;++p)b[p].high=f[g]<<24|f[g+1]<<16|f[g+2]<<8|f[g+3],b[p].low=f[g+4]<<24|f[g+5]<<16|f[g+6]<<8|f[g+7],g+=8;for(p=16;p<80;++p)F=b[p],littleSigmaPrime(F,b[p-2],E),F.add(b[p-7]),littleSigma(M,b[p-15],E),F.add(M),F.add(b[p-16]);for(y.assign(n),x.assign(a),v.assign(r),A.assign(o),k.assign(l),S.assign(c),C.assign(h),_.assign(u),p=0;p<80;++p)I.assign(_),sigmaPrime(M,k,E),I.add(M),ch(M,k,S,C,E),I.add(M),I.add(w[p]),I.add(b[p]),sigma(T,y,E),maj(M,y,x,v,E),T.add(M),F=_,_=C,C=S,S=k,A.add(I),k=A,A=v,v=x,x=y,F.assign(I),F.add(T),y=F;n.add(y),a.add(x),r.add(v),o.add(A),l.add(k),c.add(S),h.add(C),u.add(_)}return i?(D=new Uint8Array(48),n.copyTo(D,0),a.copyTo(D,8),r.copyTo(D,16),o.copyTo(D,24),l.copyTo(D,32),c.copyTo(D,40)):(D=new Uint8Array(64),n.copyTo(D,0),a.copyTo(D,8),r.copyTo(D,16),o.copyTo(D,24),l.copyTo(D,32),c.copyTo(D,40),h.copyTo(D,48),u.copyTo(D,56)),D}function calculateSHA384(t,e,s){return calculateSHA512(t,e,s,!0)}var Kb={get k(){return shadow$1(this,"k",[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298])}};function rotr(t,e){return t>>>e|t<<32-e}function calculate_sha256_ch(t,e,s){return t&e^~t&s}function calculate_sha256_maj(t,e,s){return t&e^t&s^e&s}function calculate_sha256_sigma(t){return rotr(t,2)^rotr(t,13)^rotr(t,22)}function calculate_sha256_sigmaPrime(t){return rotr(t,6)^rotr(t,11)^rotr(t,25)}function calculate_sha256_littleSigma(t){return rotr(t,7)^rotr(t,18)^t>>>3}function calculate_sha256_littleSigmaPrime(t){return rotr(t,17)^rotr(t,19)^t>>>10}function calculateSHA256(t,e,s){let i=1779033703,n=3144134277,a=1013904242,r=2773480762,o=1359893119,l=2600822924,c=528734635,h=1541459225;const u=64*Math.ceil((s+9)/64),d=new Uint8Array(u);let f,g;for(f=0;f<s;++f)d[f]=t[e++];d[f++]=128;const p=u-8;f<p&&(f=p),f+=3,d[f++]=s>>>29&255,d[f++]=s>>21&255,d[f++]=s>>13&255,d[f++]=s>>5&255,d[f++]=s<<3&255;const m=new Uint32Array(64),{k:b}=Kb;for(f=0;f<u;){for(g=0;g<16;++g)m[g]=d[f]<<24|d[f+1]<<16|d[f+2]<<8|d[f+3],f+=4;for(g=16;g<64;++g)m[g]=calculate_sha256_littleSigmaPrime(m[g-2])+m[g-7]+calculate_sha256_littleSigma(m[g-15])+m[g-16]|0;let t,e,s=i,u=n,p=a,w=r,y=o,x=l,v=c,A=h;for(g=0;g<64;++g)t=A+calculate_sha256_sigmaPrime(y)+calculate_sha256_ch(y,x,v)+b[g]+m[g],e=calculate_sha256_sigma(s)+calculate_sha256_maj(s,u,p),A=v,v=x,x=y,y=w+t|0,w=p,p=u,u=s,s=t+e|0;i=i+s|0,n=n+u|0,a=a+p|0,r=r+w|0,o=o+y|0,l=l+x|0,c=c+v|0,h=h+A|0}return new Uint8Array([i>>24&255,i>>16&255,i>>8&255,255&i,n>>24&255,n>>16&255,n>>8&255,255&n,a>>24&255,a>>16&255,a>>8&255,255&a,r>>24&255,r>>16&255,r>>8&255,255&r,o>>24&255,o>>16&255,o>>8&255,255&o,l>>24&255,l>>16&255,l>>8&255,255&l,c>>24&255,c>>16&255,c>>8&255,255&c,h>>24&255,h>>16&255,h>>8&255,255&h])}var Yb=class extends si{constructor(t,e,s){super(e),this.str=t,this.dict=t.dict,this.decrypt=s,this.nextChunk=null,this.initialized=!1}readBlock(){let t;if(this.initialized?t=this.nextChunk:(t=this.str.getBytes(512),this.initialized=!0),!t?.length)return void(this.eof=!0);this.nextChunk=this.str.getBytes(512);const e=this.nextChunk?.length>0;t=(0,this.decrypt)(t,!e);const s=this.bufferLength,i=s+t.length;this.ensureBuffer(i).set(t,s),this.bufferLength=i}},Jb=class{constructor(t){this.a=0,this.b=0;const e=new Uint8Array(256),s=t.length;for(let t=0;t<256;++t)e[t]=t;for(let i=0,n=0;i<256;++i){const a=e[i];n=n+a+t[i%s]&255,e[i]=e[n],e[n]=a}this.s=e}encryptBlock(t){let e=this.a,s=this.b;const i=this.s,n=t.length,a=new Uint8Array(n);for(let r=0;r<n;++r){e=e+1&255;const n=i[e];s=s+n&255;const o=i[s];i[e]=o,i[s]=n,a[r]=t[r]^i[n+o&255]}return this.a=e,this.b=s,a}decryptBlock(t){return this.encryptBlock(t)}encrypt(t){return this.encryptBlock(t)}},Zb=class{decryptBlock(t){return t}encrypt(t){return t}},Qb=class{_s=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]);_inv_s=new Uint8Array([82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125]);_mix=new Uint32Array([0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795]);_mixCol=new Uint8Array(256).map((t,e)=>e<128?e<<1:e<<1^27);constructor(){this.buffer=new Uint8Array(16),this.bufferPosition=0}_expandKey(t){unreachable$1("Cannot call `_expandKey` on the base class")}_decrypt(t,e){let s,i,n;const a=new Uint8Array(16);a.set(t);for(let t=0,s=this._keySize;t<16;++t,++s)a[t]^=e[s];for(let t=this._cyclesOfRepetition-1;t>=1;--t){s=a[13],a[13]=a[9],a[9]=a[5],a[5]=a[1],a[1]=s,s=a[14],i=a[10],a[14]=a[6],a[10]=a[2],a[6]=s,a[2]=i,s=a[15],i=a[11],n=a[7],a[15]=a[3],a[11]=s,a[7]=i,a[3]=n;for(let t=0;t<16;++t)a[t]=this._inv_s[a[t]];for(let s=0,i=16*t;s<16;++s,++i)a[s]^=e[i];for(let t=0;t<16;t+=4){const e=this._mix[a[t]],i=this._mix[a[t+1]],n=this._mix[a[t+2]],r=this._mix[a[t+3]];s=e^i>>>8^i<<24^n>>>16^n<<16^r>>>24^r<<8,a[t]=s>>>24&255,a[t+1]=s>>16&255,a[t+2]=s>>8&255,a[t+3]=255&s}}s=a[13],a[13]=a[9],a[9]=a[5],a[5]=a[1],a[1]=s,s=a[14],i=a[10],a[14]=a[6],a[10]=a[2],a[6]=s,a[2]=i,s=a[15],i=a[11],n=a[7],a[15]=a[3],a[11]=s,a[7]=i,a[3]=n;for(let t=0;t<16;++t)a[t]=this._inv_s[a[t]],a[t]^=e[t];return a}_encrypt(t,e){const s=this._s;let i,n,a;const r=new Uint8Array(16);r.set(t);for(let t=0;t<16;++t)r[t]^=e[t];for(let t=1;t<this._cyclesOfRepetition;t++){for(let t=0;t<16;++t)r[t]=s[r[t]];a=r[1],r[1]=r[5],r[5]=r[9],r[9]=r[13],r[13]=a,a=r[2],n=r[6],r[2]=r[10],r[6]=r[14],r[10]=a,r[14]=n,a=r[3],n=r[7],i=r[11],r[3]=r[15],r[7]=a,r[11]=n,r[15]=i;for(let t=0;t<16;t+=4){const e=r[t],s=r[t+1],n=r[t+2],a=r[t+3];i=e^s^n^a,r[t]^=i^this._mixCol[e^s],r[t+1]^=i^this._mixCol[s^n],r[t+2]^=i^this._mixCol[n^a],r[t+3]^=i^this._mixCol[a^e]}for(let s=0,i=16*t;s<16;++s,++i)r[s]^=e[i]}for(let t=0;t<16;++t)r[t]=s[r[t]];a=r[1],r[1]=r[5],r[5]=r[9],r[9]=r[13],r[13]=a,a=r[2],n=r[6],r[2]=r[10],r[6]=r[14],r[10]=a,r[14]=n,a=r[3],n=r[7],i=r[11],r[3]=r[15],r[7]=a,r[11]=n,r[15]=i;for(let t=0,s=this._keySize;t<16;++t,++s)r[t]^=e[s];return r}_decryptBlock2(t,e){const s=t.length;let i=this.buffer,n=this.bufferPosition;const a=[];let r=this.iv;for(let e=0;e<s;++e){if(i[n]=t[e],++n,n<16)continue;const s=this._decrypt(i,this._key);for(let t=0;t<16;++t)s[t]^=r[t];r=i,a.push(s),i=new Uint8Array(16),n=0}if(this.buffer=i,this.bufferLength=n,this.iv=r,0===a.length)return new Uint8Array(0);let o=16*a.length;if(e){const t=a.at(-1);let e=t[15];if(e<=16){for(let s=15,i=16-e;s>=i;--s)if(t[s]!==e){e=0;break}o-=e,a[a.length-1]=t.subarray(0,16-e)}}const l=new Uint8Array(o);for(let t=0,e=0,s=a.length;t<s;++t,e+=16)l.set(a[t],e);return l}decryptBlock(t,e,s=null){const i=t.length,n=this.buffer;let a=this.bufferPosition;if(s)this.iv=s;else{for(let e=0;a<16&&e<i;++e,++a)n[a]=t[e];if(a<16)return this.bufferLength=a,new Uint8Array(0);this.iv=n,t=t.subarray(16)}return this.buffer=new Uint8Array(16),this.bufferLength=0,this.decryptBlock=this._decryptBlock2,this.decryptBlock(t,e)}encrypt(t,e){const s=t.length;let i=this.buffer,n=this.bufferPosition;const a=[];e||=new Uint8Array(16);for(let r=0;r<s;++r){if(i[n]=t[r],++n,n<16)continue;for(let t=0;t<16;++t)i[t]^=e[t];const s=this._encrypt(i,this._key);e=s,a.push(s),i=new Uint8Array(16),n=0}if(this.buffer=i,this.bufferLength=n,this.iv=e,0===a.length)return new Uint8Array(0);const r=16*a.length,o=new Uint8Array(r);for(let t=0,e=0,s=a.length;t<s;++t,e+=16)o.set(a[t],e);return o}},tw=class extends Qb{_rcon=new Uint8Array([141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141]);constructor(t){super(),this._cyclesOfRepetition=10,this._keySize=160,this._key=this._expandKey(t)}_expandKey(t){const e=this._s,s=this._rcon,i=new Uint8Array(176);i.set(t);for(let t=16,n=1;t<176;++n){let a=i[t-3],r=i[t-2],o=i[t-1],l=i[t-4];a=e[a],r=e[r],o=e[o],l=e[l],a^=s[n];for(let e=0;e<4;++e)i[t]=a^=i[t-16],t++,i[t]=r^=i[t-16],t++,i[t]=o^=i[t-16],t++,i[t]=l^=i[t-16],t++}return i}},ew=class extends Qb{constructor(t){super(),this._cyclesOfRepetition=14,this._keySize=224,this._key=this._expandKey(t)}_expandKey(t){const e=this._s,s=new Uint8Array(240);s.set(t);let i,n,a,r,o=1;for(let t=32,l=1;t<240;++l){t%32==16?(i=e[i],n=e[n],a=e[a],r=e[r]):t%32==0&&(i=s[t-3],n=s[t-2],a=s[t-1],r=s[t-4],i=e[i],n=e[n],a=e[a],r=e[r],i^=o,(o<<=1)>=256&&(o=255&(27^o)));for(let e=0;e<4;++e)s[t]=i^=s[t-32],t++,s[t]=n^=s[t-32],t++,s[t]=a^=s[t-32],t++,s[t]=r^=s[t-32],t++}return s}},sw=class{_hash(t,e,s){unreachable$1("Abstract method `_hash` called")}checkOwnerPassword(t,e,s,i){const n=new Uint8Array(t.length+56);return n.set(t,0),n.set(e,t.length),n.set(s,t.length+e.length),isArrayEqual(this._hash(t,n,s),i)}checkUserPassword(t,e,s){const i=new Uint8Array(t.length+8);return i.set(t,0),i.set(e,t.length),isArrayEqual(this._hash(t,i,[]),s)}getOwnerKey(t,e,s,i){const n=new Uint8Array(t.length+56);n.set(t,0),n.set(e,t.length),n.set(s,t.length+e.length);const a=this._hash(t,n,s);return new ew(a).decryptBlock(i,!1,new Uint8Array(16))}getUserKey(t,e,s){const i=new Uint8Array(t.length+8);i.set(t,0),i.set(e,t.length);const n=this._hash(t,i,[]);return new ew(n).decryptBlock(s,!1,new Uint8Array(16))}},iw=class extends sw{_hash(t,e,s){return calculateSHA256(e,0,e.length)}},nw=class extends sw{_hash(t,e,s){let i=calculateSHA256(e,0,e.length).subarray(0,32),n=[0],a=0;for(;a<64||n.at(-1)>a-32;){const e=t.length+i.length+s.length,r=new Uint8Array(e);let o=0;r.set(t,o),o+=t.length,r.set(i,o),o+=i.length,r.set(s,o);const l=new Uint8Array(64*e);for(let t=0,s=0;t<64;t++,s+=e)l.set(r,s);n=new tw(i.subarray(0,16)).encrypt(l,i.subarray(16,32));const c=Math.sumPrecise(n.slice(0,16))%3;0===c?i=calculateSHA256(n,0,n.length):1===c?i=calculateSHA384(n,0,n.length):2===c&&(i=calculateSHA512(n,0,n.length)),a++}return i.subarray(0,32)}},aw=class{constructor(t,e){this.StringCipherConstructor=t,this.StreamCipherConstructor=e}createStream(t,e){const s=new this.StreamCipherConstructor;return new Yb(t,e,function(t,e){return s.decryptBlock(t,e)})}decryptString(t){const e=new this.StringCipherConstructor;let s=stringToBytes$1(t);return s=e.decryptBlock(s,!0),bytesToString$1(s)}encryptString(t){const e=new this.StringCipherConstructor;if(e instanceof Qb){const s=16-t.length%16;t+=String.fromCharCode(s).repeat(s);const i=new Uint8Array(16);crypto.getRandomValues(i);let n=stringToBytes$1(t);n=e.encrypt(n,i);const a=new Uint8Array(16+n.length);return a.set(i),a.set(n,16),bytesToString$1(a)}let s=stringToBytes$1(t);return s=e.encrypt(s),bytesToString$1(s)}},rw=class _CipherTransformFactory{static get _defaultPasswordBytes(){return shadow$1(this,"_defaultPasswordBytes",new Uint8Array([40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122]))}#Ut(t,e,s,i,n,a,r,o,l,c,h,u){if(e){const t=Math.min(127,e.length);e=e.subarray(0,t)}else e=[];const d=6===t?new nw:new iw;return d.checkUserPassword(e,o,r)?d.getUserKey(e,l,h):e.length&&d.checkOwnerPassword(e,i,a,s)?d.getOwnerKey(e,n,a,c):null}#$t(t,e,s,i,n,a,r,o){const l=40+s.length+t.length,c=new Uint8Array(l);let h,u,d=0;if(e)for(u=Math.min(32,e.length);d<u;++d)c[d]=e[d];for(h=0;d<32;)c[d++]=_CipherTransformFactory._defaultPasswordBytes[h++];c.set(s,d),d+=s.length,c[d++]=255&n,c[d++]=n>>8&255,c[d++]=n>>16&255,c[d++]=n>>>24&255,c.set(t,d),d+=t.length,a>=4&&!o&&(c.fill(255,d,d+4),d+=4);let f=calculateMD5(c,0,d);const g=r>>3;if(a>=3)for(h=0;h<50;++h)f=calculateMD5(f,0,g);const p=f.subarray(0,g);let m,b;if(a>=3){d=0,c.set(_CipherTransformFactory._defaultPasswordBytes,d),d+=32,c.set(t,d),d+=t.length,m=new Jb(p),b=m.encryptBlock(calculateMD5(c,0,d)),u=p.length;const e=new Uint8Array(u);for(h=1;h<=19;++h){for(let t=0;t<u;++t)e[t]=p[t]^h;m=new Jb(e),b=m.encryptBlock(b)}}else m=new Jb(p),b=m.encryptBlock(_CipherTransformFactory._defaultPasswordBytes);return b.every((t,e)=>i[e]===t)?p:null}#Ht(t,e,s,i){const n=new Uint8Array(32);let a=0;const r=Math.min(32,t.length);for(;a<r;++a)n[a]=t[a];let o=0;for(;a<32;)n[a++]=_CipherTransformFactory._defaultPasswordBytes[o++];let l=calculateMD5(n,0,a);const c=i>>3;if(s>=3)for(o=0;o<50;++o)l=calculateMD5(l,0,l.length);let h,u;if(s>=3){u=e;const t=new Uint8Array(c);for(o=19;o>=0;o--){for(let e=0;e<c;++e)t[e]=l[e]^o;h=new Jb(t),u=h.encryptBlock(u)}}else h=new Jb(l.subarray(0,c)),u=h.encryptBlock(e);return u}#jt(t,e,s,i=!1){const n=s.length,a=new Uint8Array(n+9);a.set(s);let r=n;return a[r++]=255&t,a[r++]=t>>8&255,a[r++]=t>>16&255,a[r++]=255&e,a[r++]=e>>8&255,i&&(a[r++]=115,a[r++]=65,a[r++]=108,a[r++]=84),calculateMD5(a,0,r).subarray(0,Math.min(n+5,16))}#qt(t,e,s,i,n){if(!(e instanceof us))throw new Ze("Invalid crypt filter name.");const a=this,r=t.get(e.name),o=r?.get("CFM");if(!o||"None"===o.name)return function(){return new Zb};if("V2"===o.name)return function(){return new Jb(a.#jt(s,i,n,!1))};if("AESV2"===o.name)return function(){return new tw(a.#jt(s,i,n,!0))};if("AESV3"===o.name)return function(){return new ew(n)};throw new Ze("Unknown crypto method")}constructor(t,e,s){const i=t.get("Filter");if(!isName(i,"Standard"))throw new Ze("unknown encryption method");this.filterName=i.name,this.dict=t;const n=t.get("V");if(!Number.isInteger(n)||1!==n&&2!==n&&4!==n&&5!==n)throw new Ze("unsupported encryption algorithm");this.algorithm=n;let a=t.get("Length");if(!a)if(n<=3)a=40;else{const e=t.get("CF"),s=t.get("StmF");if(e instanceof fs&&s instanceof us){e.suppressEncryption=!0;const t=e.get(s.name);a=t?.get("Length")||128,a<40&&(a<<=3)}}if(!Number.isInteger(a)||a<40||a%8!=0)throw new Ze("invalid key length");const r=stringToBytes$1(t.get("O")),o=stringToBytes$1(t.get("U")),l=r.subarray(0,32),c=o.subarray(0,32),h=t.get("P"),u=t.get("R"),d=(4===n||5===n)&&!1!==t.get("EncryptMetadata");this.encryptMetadata=d;const f=stringToBytes$1(e);let g,p;if(s){if(6===u)try{s=utf8StringToString(s)}catch{warn$1("CipherTransformFactory: Unable to convert UTF8 encoded password.")}g=stringToBytes$1(s)}if(5!==n)p=this.#$t(f,g,l,c,h,u,a,d);else{const e=r.subarray(32,40),s=r.subarray(40,48),i=o.subarray(0,48),n=o.subarray(32,40),a=o.subarray(40,48),h=stringToBytes$1(t.get("OE")),d=stringToBytes$1(t.get("UE")),f=stringToBytes$1(t.get("Perms"));p=this.#Ut(u,g,l,e,s,i,c,n,a,h,d,f)}if(!p){if(!s)throw new Xe("No password given",ze);const t=this.#Ht(g,l,u,a);p=this.#$t(f,t,l,c,h,u,a,d)}if(!p)throw new Xe("Incorrect Password",Ge);if(4===n&&p.length<16?(this.encryptionKey=new Uint8Array(16),this.encryptionKey.set(p)):this.encryptionKey=p,n>=4){const e=t.get("CF");e instanceof fs&&(e.suppressEncryption=!0),this.cf=e,this.stmf=t.get("StmF")||us.get("Identity"),this.strf=t.get("StrF")||us.get("Identity"),this.eff=t.get("EFF")||this.stmf}}createCipherTransform(t,e){if(4===this.algorithm||5===this.algorithm)return new aw(this.#qt(this.cf,this.strf,t,e,this.encryptionKey),this.#qt(this.cf,this.stmf,t,e,this.encryptionKey));const s=this.#jt(t,e,this.encryptionKey,!1),cipherConstructor=function(){return new Jb(s)};return new aw(cipherConstructor,cipherConstructor)}},ow=class{constructor(t,e){this.stream=t,this.pdfManager=e,this.entries=[],this._xrefStms=new Set,this._cacheMap=new Map,this._pendingRefs=new ps,this._newPersistentRefNum=null,this._newTemporaryRefNum=null,this._persistentRefsCache=null}getNewPersistentRef(t){null===this._newPersistentRefNum&&(this._newPersistentRefNum=this.entries.length||1);const e=this._newPersistentRefNum++;return this._cacheMap.set(e,t),gs.get(e,0)}getNewTemporaryRef(){if(null===this._newTemporaryRefNum&&(this._newTemporaryRefNum=this.entries.length||1,this._newPersistentRefNum)){this._persistentRefsCache=new Map;for(let t=this._newTemporaryRefNum;t<this._newPersistentRefNum;t++)this._persistentRefsCache.set(t,this._cacheMap.get(t)),this._cacheMap.delete(t)}return gs.get(this._newTemporaryRefNum++,0)}resetNewTemporaryRef(){if(this._newTemporaryRefNum=null,this._persistentRefsCache)for(const[t,e]of this._persistentRefsCache)this._cacheMap.set(t,e);this._persistentRefsCache=null}setStartXRef(t){this.startXRefQueue=[t]}parse(t=!1){let e,s,i;t?(warn$1("Indexing all PDF objects"),e=this.indexObjects()):e=this.readXRef(),e.assignXref(this),this.trailer=e;try{s=e.get("Encrypt")}catch(t){if(t instanceof ks)throw t;warn$1(`XRef.parse - Invalid "Encrypt" reference: "${t}".`)}if(s instanceof fs){const t=e.get("ID"),i=t?.length?t[0]:"";s.suppressEncryption=!0,this.encrypt=new rw(s,i,this.pdfManager.password)}try{i=e.get("Root")}catch(t){if(t instanceof ks)throw t;warn$1(`XRef.parse - Invalid "Root" reference: "${t}".`)}if(i instanceof fs)try{if(i.get("Pages")instanceof fs)return void(this.root=i)}catch(t){if(t instanceof ks)throw t;warn$1(`XRef.parse - Invalid "Pages" reference: "${t}".`)}if(!t)throw new _s;throw new Ye("Invalid Root reference.")}processXRefTable(t){if("tableState"in this||(this.tableState={entryNum:0,streamPos:t.lexer.stream.pos,parserBuf1:t.buf1,parserBuf2:t.buf2}),!isCmd(this.readXRefTable(t),"trailer"))throw new Ze("Invalid XRef table: could not find trailer dictionary");let e=t.getObj();if(e instanceof fs||!e.dict||(e=e.dict),!(e instanceof fs))throw new Ze("Invalid XRef table: could not parse trailer dictionary");return delete this.tableState,e}readXRefTable(t){const e=t.lexer.stream,s=this.tableState;let i;for(e.pos=s.streamPos,t.buf1=s.parserBuf1,t.buf2=s.parserBuf2;;){if(!("firstEntryNum"in s)||!("entryCount"in s)){if(isCmd(i=t.getObj(),"trailer"))break;s.firstEntryNum=i,s.entryCount=t.getObj()}let n=s.firstEntryNum;const a=s.entryCount;if(!Number.isInteger(n)||!Number.isInteger(a))throw new Ze("Invalid XRef table: wrong types in subsection header");for(let i=s.entryNum;i<a;i++){s.streamPos=e.pos,s.entryNum=i,s.parserBuf1=t.buf1,s.parserBuf2=t.buf2;const r={};r.offset=t.getObj(),r.gen=t.getObj();const o=t.getObj();if(o instanceof ds)switch(o.cmd){case"f":r.free=!0;break;case"n":r.uncompressed=!0}if(!Number.isInteger(r.offset)||!Number.isInteger(r.gen)||!r.free&&!r.uncompressed)throw new Ze(`Invalid entry in XRef subsection: ${n}, ${a}`);0===i&&r.free&&1===n&&(n=0),this.entries[i+n]||(this.entries[i+n]=r)}s.entryNum=0,s.streamPos=e.pos,s.parserBuf1=t.buf1,s.parserBuf2=t.buf2,delete s.firstEntryNum,delete s.entryCount}if(this.entries[0]&&!this.entries[0].free)throw new Ze("Invalid XRef table: unexpected first object");return i}processXRefStream(t){if(!("streamState"in this)){const{dict:e,pos:s}=t,i=e.get("W"),n=e.get("Index")||[0,e.get("Size")];this.streamState={entryRanges:n,byteWidths:i,entryNum:0,streamPos:s}}return this.readXRefStream(t),delete this.streamState,t.dict}readXRefStream(t){const e=this.streamState;t.pos=e.streamPos;const[s,i,n]=e.byteWidths,a=e.entryRanges;for(;a.length>0;){const[r,o]=a;if(!Number.isInteger(r)||!Number.isInteger(o))throw new Ze(`Invalid XRef range fields: ${r}, ${o}`);if(!Number.isInteger(s)||!Number.isInteger(i)||!Number.isInteger(n))throw new Ze(`Invalid XRef entry fields length: ${r}, ${o}`);for(let a=e.entryNum;a<o;++a){e.entryNum=a,e.streamPos=t.pos;let o=0,l=0,c=0;for(let e=0;e<s;++e){const e=t.getByte();if(-1===e)throw new Ze("Invalid XRef byteWidths 'type'.");o=o<<8|e}0===s&&(o=1);for(let e=0;e<i;++e){const e=t.getByte();if(-1===e)throw new Ze("Invalid XRef byteWidths 'offset'.");l=l<<8|e}for(let e=0;e<n;++e){const e=t.getByte();if(-1===e)throw new Ze("Invalid XRef byteWidths 'generation'.");c=c<<8|e}const h={};switch(h.offset=l,h.gen=c,o){case 0:h.free=!0;break;case 1:h.uncompressed=!0;break;case 2:break;default:throw new Ze(`Invalid XRef entry type: ${o}`)}this.entries[r+a]||(this.entries[r+a]=h)}e.entryNum=0,e.streamPos=t.pos,a.splice(0,2)}}indexObjects(){function readToken(t,e){let s="",i=t[e];for(;10!==i&&13!==i&&60!==i&&!(++e>=t.length);)s+=String.fromCharCode(i),i=t[e];return s}function skipUntil(t,e,s){const i=s.length,n=t.length;let a=0;for(;e<n;){let n=0;for(;n<i&&t[e+n]===s[n];)++n;if(n>=i)break;e++,a++}return a}const t=/\b(endobj|\d+\s+\d+\s+obj|xref|trailer\s*<<)\b/g,e=/\b(startxref|\d+\s+\d+\s+obj)\b/g,s=/^(\d+)\s+(\d+)\s+obj\b/,i=new Uint8Array([116,114,97,105,108,101,114]),n=new Uint8Array([115,116,97,114,116,120,114,101,102]),a=new Uint8Array([47,88,82,101,102]);this.entries.length=0,this._cacheMap.clear();const r=this.stream;r.pos=0;const o=r.getBytes(),l=bytesToString$1(o),c=o.length;let h=r.start;const u=[],d=[];for(;h<c;){let f=o[h];if(9===f||10===f||13===f||32===f){++h;continue}if(37===f){do{if(++h,h>=c)break;f=o[h]}while(10!==f&&13!==f);continue}const g=readToken(o,h);let p;if(g.startsWith("xref")&&(4===g.length||/\s/.test(g[4])))h+=skipUntil(o,h,i),u.push(h),h+=skipUntil(o,h,n);else if(p=s.exec(g)){const e=0|p[1],s=0|p[2],i=h+g.length;let n,u=!1;if(this.entries[e]){if(this.entries[e].gen===s)try{new gn({lexer:new mn(r.makeSubStream(i))}).getObj(),u=!0}catch(t){t instanceof Ss?warn$1(`indexObjects -- checking object (${g}): "${t}".`):u=!0}}else u=!0;u&&(this.entries[e]={offset:h-r.start,gen:s,uncompressed:!0}),t.lastIndex=i;const f=t.exec(l);f?(n=t.lastIndex+1-h,"endobj"!==f[1]&&(warn$1(`indexObjects: Found "${f[1]}" inside of another "obj", caused by missing "endobj" -- trying to recover.`),n-=f[1].length+1)):n=c-h;const m=o.subarray(h,h+n),b=skipUntil(m,0,a);b<n&&m[b+5]<64&&(d.push(h-r.start),this._xrefStms.add(h-r.start)),h+=n}else if(g.startsWith("trailer")&&(7===g.length||/\s/.test(g[7]))){u.push(h);const t=h+g.length;let s;e.lastIndex=t;const i=e.exec(l);i?(s=e.lastIndex+1-h,"startxref"!==i[1]&&(warn$1(`indexObjects: Found "${i[1]}" after "trailer", caused by missing "startxref" -- trying to recover.`),s-=i[1].length+1)):s=c-h,h+=s}else h+=g.length+1}for(const t of d)this.startXRefQueue.push(t),this.readXRef(!0);const f=[];let g,p,m=!1;for(const t of u){r.pos=t;const e=new gn({lexer:new mn(r),xref:this,allowStreams:!0,recoveryMode:!0});if(!isCmd(e.getObj(),"trailer"))continue;const s=e.getObj();s instanceof fs&&(f.push(s),s.has("Encrypt")&&(m=!0))}for(const t of[...f,"genFallback",...f]){if("genFallback"===t){if(!p)break;this._generationFallback=!0;continue}let e=!1;try{const s=t.get("Root");if(!(s instanceof fs))continue;const i=s.get("Pages");if(!(i instanceof fs))continue;const n=i.get("Count");Number.isInteger(n)&&(e=!0)}catch(t){p=t;continue}if(e&&(!m||t.has("Encrypt"))&&t.has("ID"))return t;g=t}if(g)return g;if(this.topDict)return this.topDict;if(!f.length)for(const t in this.entries){if(!Object.hasOwn(this.entries,t))continue;const e=this.entries[t],s=gs.get(parseInt(t),e.gen);let i;try{i=this.fetch(s)}catch{continue}if(i instanceof bs&&(i=i.dict),i instanceof fs&&i.has("Root"))return i}throw new Ye("Invalid PDF structure.")}readXRef(t=!1){const e=this.stream,s=new Set;for(;this.startXRefQueue.length;){try{const t=this.startXRefQueue[0];if(s.has(t)){warn$1("readXRef - skipping XRef table since it was already parsed."),this.startXRefQueue.shift();continue}s.add(t),e.pos=t+e.start;const i=new gn({lexer:new mn(e),xref:this,allowStreams:!0});let n,a=i.getObj();if(isCmd(a,"xref"))n=this.processXRefTable(i),this.topDict||(this.topDict=n),a=n.get("XRefStm"),Number.isInteger(a)&&!this._xrefStms.has(a)&&(this._xrefStms.add(a),this.startXRefQueue.push(a));else{if(!Number.isInteger(a))throw new Ze("Invalid XRef stream header");if(!(Number.isInteger(i.getObj())&&isCmd(i.getObj(),"obj")&&(a=i.getObj())instanceof bs))throw new Ze("Invalid XRef stream");if(n=this.processXRefStream(a),this.topDict||(this.topDict=n),!n)throw new Ze("Failed to read XRef stream")}a=n.get("Prev"),Number.isInteger(a)?this.startXRefQueue.push(a):a instanceof gs&&this.startXRefQueue.push(a.num)}catch(t){if(t instanceof ks)throw t;info$1("(while reading XRef): "+t)}this.startXRefQueue.shift()}if(this.topDict)return this.topDict;if(!t)throw new _s}getEntry(t){const e=this.entries[t];return e&&!e.free&&e.offset?e:null}fetchIfRef(t,e=!1){return t instanceof gs?this.fetch(t,e):t}fetch(t,e=!1){if(!(t instanceof gs))throw new Error("ref object is not a reference");const s=t.num,i=this._cacheMap.get(s);if(void 0!==i)return i instanceof fs&&!i.objId&&(i.objId=t.toString()),i;let n=this.getEntry(s);if(null===n)return n;if(this._pendingRefs.has(t))return this._pendingRefs.remove(t),warn$1(`Ignoring circular reference: ${t}.`),rs;this._pendingRefs.put(t);try{n=n.uncompressed?this.fetchUncompressed(t,n,e):this.fetchCompressed(t,n,e),this._pendingRefs.remove(t)}catch(e){throw this._pendingRefs.remove(t),e}return n instanceof fs?n.objId=t.toString():n instanceof bs&&(n.dict.objId=t.toString()),n}fetchUncompressed(t,e,s=!1){const i=t.gen;let n=t.num;if(e.gen!==i){const a=`Inconsistent generation in XRef: ${t}`;if(this._generationFallback&&e.gen<i)return warn$1(a),this.fetchUncompressed(gs.get(n,e.gen),e,s);throw new Cs(a)}const a=this.stream.makeSubStream(e.offset+this.stream.start),r=new gn({lexer:new mn(a),xref:this,allowStreams:!0}),o=r.getObj(),l=r.getObj(),c=r.getObj();if(o!==n||l!==i||!(c instanceof ds))throw new Cs(`Bad (uncompressed) XRef entry: ${t}`);if("obj"!==c.cmd){if(c.cmd.startsWith("obj")&&(n=parseInt(c.cmd.substring(3),10),!Number.isNaN(n)))return n;throw new Cs(`Bad (uncompressed) XRef entry: ${t}`)}return(e=this.encrypt&&!s?r.getObj(this.encrypt.createCipherTransform(n,i)):r.getObj())instanceof bs||this._cacheMap.set(n,e),e}fetchCompressed(t,e,s=!1){const i=e.offset,n=this.fetch(gs.get(i,0));if(!(n instanceof bs))throw new Ze("bad ObjStm stream");const a=n.dict.get("First"),r=n.dict.get("N");if(!Number.isInteger(a)||!Number.isInteger(r))throw new Ze("invalid first and n parameters for ObjStm stream");let o=new gn({lexer:new mn(n),xref:this,allowStreams:!0});const l=new Array(r),c=new Array(r);for(let t=0;t<r;++t){const e=o.getObj();if(!Number.isInteger(e))throw new Ze(`invalid object number in the ObjStm stream: ${e}`);const s=o.getObj();if(!Number.isInteger(s))throw new Ze(`invalid object offset in the ObjStm stream: ${s}`);l[t]=e;const n=this.getEntry(e);n?.offset===i&&n.gen!==t&&(n.gen=t),c[t]=s}const h=(n.start||0)+a,u=new Array(r);for(let t=0;t<r;++t){const e=t<r-1?c[t+1]-c[t]:void 0;if(e<0)throw new Ze("Invalid offset in the ObjStm stream.");o=new gn({lexer:new mn(n.makeSubStream(h+c[t],e,n.dict)),xref:this,allowStreams:!0});const s=o.getObj();if(u[t]=s,s instanceof bs)continue;const a=l[t],d=this.entries[a];d&&d.offset===i&&d.gen===t&&this._cacheMap.set(a,s)}if(void 0===(e=u[e.gen]))throw new Cs(`Bad (compressed) XRef entry: ${t}`);return e}async fetchIfRefAsync(t,e){return t instanceof gs?this.fetchAsync(t,e):t}async fetchAsync(t,e){try{return this.fetch(t,e)}catch(s){if(!(s instanceof ks))throw s;return await this.pdfManager.requestRange(s.begin,s.end),this.fetchAsync(t,e)}}getCatalogObj(){return this.root}},lw=[0,0,612,792],cw=class{#zt=!1;#Gt=null;constructor({pdfManager:t,xref:e,pageIndex:s,pageDict:i,ref:n,globalIdFactory:a,fontCache:r,builtInCMapCache:o,standardFontDataCache:l,globalColorSpaceCache:c,globalImageCache:h,systemFontCache:u,nonBlendModesSet:d,xfaFactory:f}){this.pdfManager=t,this.pageIndex=s,this.pageDict=i,this.xref=e,this.ref=n,this.fontCache=r,this.builtInCMapCache=o,this.standardFontDataCache=l,this.globalColorSpaceCache=c,this.globalImageCache=h,this.systemFontCache=u,this.nonBlendModesSet=d,this.evaluatorOptions=t.evaluatorOptions,this.xfaFactory=f;const g={obj:0};this._localIdFactory=class extends a{static createObjId(){return`p${s}_${++g.obj}`}static getPageObjId(){return`p${n.toString()}`}}}#Wt(t){return new tl({xref:this.xref,handler:t,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalColorSpaceCache:this.globalColorSpaceCache,globalImageCache:this.globalImageCache,systemFontCache:this.systemFontCache,options:this.evaluatorOptions})}#Vt(t,e=!1){const s=getInheritableProperty({dict:this.pageDict,key:t,getArray:e,stopWhenFound:!1});return Array.isArray(s)?1!==s.length&&s[0]instanceof fs?fs.merge({xref:this.xref,dictArray:s}):s[0]:s}get content(){return this.pageDict.getArray("Contents")}get resources(){const t=this.#Vt("Resources");return shadow$1(this,"resources",t instanceof fs?t:fs.empty)}#Xt(t){if(this.xfaData)return this.xfaData.bbox;const e=lookupNormalRect(this.#Vt(t,!0),null);if(e){if(e[2]-e[0]>0&&e[3]-e[1]>0)return e;warn$1(`Empty, or invalid, /${t} entry.`)}return null}get mediaBox(){return shadow$1(this,"mediaBox",this.#Xt("MediaBox")||lw)}get cropBox(){return shadow$1(this,"cropBox",this.#Xt("CropBox")||this.mediaBox)}get userUnit(){const t=this.pageDict.get("UserUnit");return shadow$1(this,"userUnit","number"==typeof t&&t>0?t:1)}get view(){const{cropBox:t,mediaBox:e}=this;if(t!==e&&!isArrayEqual(t,e)){const s=ss.intersect(t,e);if(s&&s[2]-s[0]>0&&s[3]-s[1]>0)return shadow$1(this,"view",s);warn$1("Empty /CropBox and /MediaBox intersection.")}return shadow$1(this,"view",e)}get rotate(){let t=this.#Vt("Rotate")||0;return t%90!=0?t=0:t>=360?t%=360:t<0&&(t=(t%360+360)%360),shadow$1(this,"rotate",t)}#Kt(t,e){if(!this.evaluatorOptions.ignoreErrors)throw t;warn$1(`getContentStream - ignoring sub-stream (${e}): "${t}".`)}async getContentStream(){const t=await this.pdfManager.ensure(this,"content");return t instanceof bs?t:Array.isArray(t)?new ii(t,this.#Kt.bind(this)):new Js}get xfaData(){return shadow$1(this,"xfaData",this.xfaFactory?{bbox:this.xfaFactory.getBoundingBox(this.pageIndex)}:null)}async#Yt(t,e,s){const i=[];for(const n of t)if(n.id){const t=gs.fromString(n.id);if(!t){warn$1(`A non-linked annotation cannot be modified: ${n.id}`);continue}if(n.deleted){if(e.put(t,t),n.popupRef){const t=gs.fromString(n.popupRef);t&&e.put(t,t)}continue}if(n.popup?.deleted){const t=gs.fromString(n.popupRef);t&&e.put(t,t)}s?.put(t),n.ref=t,i.push(this.xref.fetchAsync(t).then(t=>{t instanceof fs&&(n.oldAnnotation=t.clone())},()=>{warn$1(`Cannot fetch \`oldAnnotation\` for: ${t}.`)})),delete n.id}await Promise.all(i)}async saveNewAnnotations(t,e,s,i,n){if(this.xfaFactory)throw new Error("XFA: Cannot save new annotations.");const a=this.#Wt(t),r=new ms,o=new ps;await this.#Yt(s,r,o);const l=this.pageDict,c=this.annotations.filter(t=>!(t instanceof gs&&r.has(t))),h=await mb.saveNewAnnotations(a,e,s,i,n);for(const{ref:t}of h.annotations)t instanceof gs&&!o.has(t)&&c.push(t);const u=l.clone();u.set("Annots",c),n.put(this.ref,{data:u});for(const t of r)n.put(t,{data:null})}async save(t,e,s,i){const n=this.#Wt(t),a=await this._parsedAnnotations,r=[];for(const t of a)r.push(t.save(n,e,s,i).catch(function(t){return warn$1(`save - ignoring annotation data during "${e.name}" task: "${t}".`),null}));return Promise.all(r)}async loadResources(t){await(this.#Gt??=this.pdfManager.ensure(this,"resources")),await Ol.load(this.resources,t,this.xref)}async#Jt(t,e){const s=t?.get("Resources");return s instanceof fs&&s.size?(await Ol.load(s,e,this.xref),fs.merge({xref:this.xref,dictArray:[s,this.resources],mergeSubDicts:!0})):this.resources}async getOperatorList({handler:t,sink:e,task:s,intent:i,cacheKey:n,annotationStorage:a=null,modifiedIds:c=null}){const f=this.getContentStream(),p=this.loadResources(vs),m=this.#Wt(t),b=this.xfaFactory?null:getNewAnnotationsMap(a),w=b?.get(this.pageIndex);let y=Promise.resolve(null),x=null;if(w){const t=this.pdfManager.ensureDoc("annotationGlobals");let e;const i=new Set;for(const{bitmapId:t,bitmap:e}of w)!t||e||i.has(t)||i.add(t);const{isOffscreenCanvasSupported:n}=this.evaluatorOptions;if(i.size>0){const t=w.slice();for(const[e,s]of a)e.startsWith(g)&&s.bitmap&&i.has(s.bitmapId)&&t.push(s);e=mb.generateImages(t,this.xref,n)}else e=mb.generateImages(w,this.xref,n);x=new ps,y=Promise.all([t,this.#Yt(w,x,null)]).then(([t])=>t?mb.printNewAnnotations(t,m,s,w,e):null)}const v=Promise.all([f,p]).then(async([a])=>{const r=await this.#Jt(a.dict,vs),o=new Si(i,e);return t.send("StartRenderPage",{transparency:m.hasBlendModes(r,this.nonBlendModesSet),pageIndex:this.pageIndex,cacheKey:n}),await m.getOperatorList({stream:a,task:s,resources:r,operatorList:o}),o});let[A,k,S]=await Promise.all([v,this._parsedAnnotations,y]);if(S){k=k.filter(t=>!(t.ref&&x.has(t.ref)));for(let t=0,e=S.length;t<e;t++){const s=S[t];if(s.refToReplace){const i=k.findIndex(t=>t.ref&&isRefsEqual(t.ref,s.refToReplace));i>=0&&(k.splice(i,1,s),S.splice(t--,1),e--)}}k=k.concat(S)}if(0===k.length||i&u)return A.flush(!0),{length:A.totalLength};const C=!!(i&h),_=!!(i&d),I=!!(i&r),T=!!(i&o),M=!!(i&l),E=[];for(const t of k)(I||T&&t.mustBeViewed(a,C)&&t.mustBeViewedWhenEditing(_,c)||M&&t.mustBePrinted(a))&&E.push(t.getOperatorList(m,s,i,a).catch(function(t){return warn$1(`getOperatorList - ignoring annotation data during "${s.name}" task: "${t}".`),{opList:null,separateForm:!1,separateCanvas:!1}}));const F=await Promise.all(E);let D=!1,R=!1;for(const{opList:t,separateForm:e,separateCanvas:s}of F)A.addOpList(t),D||=e,R||=s;return A.flush(!0,{form:D,canvas:R}),{length:A.totalLength}}async extractTextContent({handler:t,task:e,includeMarkedContent:s,disableNormalization:i,sink:n,intersector:a=null}){const r=this.getContentStream(),o=this.loadResources(As),l=this.pdfManager.ensureCatalog("lang"),[c,,h]=await Promise.all([r,o,l]),u=await this.#Jt(c.dict,As);return this.#Wt(t).getTextContent({stream:c,task:e,resources:u,includeMarkedContent:s,disableNormalization:i,sink:n,viewBox:this.view,lang:h,intersector:a})}async getStructTree(){const t=await this.pdfManager.ensureCatalog("structTreeRoot");if(!t)return null;await this._parsedAnnotations;try{const e=await this.pdfManager.ensure(this,"_parseStructTree",[t]);return await this.pdfManager.ensure(e,"serializable")}catch(t){return warn$1(`getStructTree: "${t}".`),null}}_parseStructTree(t){const e=new Bl(t,this.pageDict);return e.parse(this.ref),e}async getAnnotationsData(t,e,s){const i=await this._parsedAnnotations;if(0===i.length)return i;const n=[],a=[];let c;const h=!!(s&r),u=!!(s&o),d=!!(s&l),f=[];for(const s of i){const i=h||u&&s.viewable;(i||d&&s.printable)&&n.push(s.data),s.hasTextContent&&i?(c??=this.#Wt(t),a.push(s.extractTextContent(c,e,[-1/0,-1/0,1/0,1/0]).catch(function(t){warn$1(`getAnnotationsData - ignoring textContent during "${e.name}" task: "${t}".`)}))):s.overlaysTextContent&&i&&f.push(s)}if(f.length>0){const s=new Wb(f);a.push(this.extractTextContent({handler:t,task:e,includeMarkedContent:!1,disableNormalization:!1,sink:null,viewBox:this.view,lang:null,intersector:s}).then(()=>{s.setText()}))}return await Promise.all(a),n}get annotations(){const t=this.#Vt("Annots");return shadow$1(this,"annotations",Array.isArray(t)?t:[])}get _parsedAnnotations(){const t=this.pdfManager.ensure(this,"annotations").then(async t=>{if(0===t.length)return t;const[e,s]=await Promise.all([this.pdfManager.ensureDoc("annotationGlobals"),this.pdfManager.ensureDoc("fieldObjects")]);if(!e)return[];const i=s?.orphanFields,n=[];for(const s of t)n.push(mb.create(this.xref,s,e,this._localIdFactory,!1,i,null,this.ref).catch(function(t){return warn$1(`_parsedAnnotations: "${t}".`),null}));const a=[];let r,o;for(const t of await Promise.all(n))t&&(t instanceof xb?(o||=[]).push(t):t instanceof Ib?(r||=[]).push(t):a.push(t));return o&&a.push(...o),r&&a.push(...r),a});return this.#zt=!0,shadow$1(this,"_parsedAnnotations",t)}get jsActions(){return shadow$1(this,"jsActions",collectActions(this.xref,this.pageDict,tt))}async collectAnnotationsByType(t,e,s,i,n){const{pageIndex:a}=this;if(this.#zt){const t=await this._parsedAnnotations;for(const{data:e}of t)s&&!s.has(e.annotationType)||(e.pageIndex=a,i.push(Promise.resolve(e)));return}const r=await this.pdfManager.ensure(this,"annotations");for(const o of r)i.push(mb.create(this.xref,o,n,this._localIdFactory,!1,null,s,this.ref).then(async s=>{if(!s)return null;if(s.data.pageIndex=a,s.hasTextContent&&s.viewable){const i=this.#Wt(t);await s.extractTextContent(i,e,[-1/0,-1/0,1/0,1/0])}return s.data}).catch(function(t){return warn$1(`collectAnnotationsByType: "${t}".`),null}))}},hw=new Uint8Array([37,80,68,70,45]),uw=new Uint8Array([115,116,97,114,116,120,114,101,102]),dw=new Uint8Array([101,110,100,111,98,106]);function find(t,e,s=1024,i=!1){const n=e.length,a=t.peekBytes(s),r=a.length-n;if(r<=0)return!1;if(i){const s=n-1;let i=a.length-1;for(;i>=s;){let r=0;for(;r<n&&a[i-r]===e[s-r];)r++;if(r>=n)return t.pos+=i-s,!0;i--}}else{let s=0;for(;s<=r;){let i=0;for(;i<n&&a[s+i]===e[i];)i++;if(i>=n)return t.pos+=s,!0;s++}}return!1}var fw=class{#Zt=new Map;#Qt=null;constructor(t,e){if(e.length<=0)throw new Ye("The PDF file is empty, i.e. its size is zero bytes.");this.pdfManager=t,this.stream=e,this.xref=new ow(e,t);const s={font:0};this._globalIdFactory=class{static getDocId(){return`g_${t.docId}`}static createFontId(){return"f"+ ++s.font}static createObjId(){unreachable$1("Abstract method `createObjId` called.")}static getPageObjId(){unreachable$1("Abstract method `getPageObjId` called.")}}}parse(t){this.xref.parse(t),this.catalog=new Nl(this.pdfManager,this.xref)}get linearization(){let t=null;try{t=bn.create(this.stream)}catch(t){if(t instanceof ks)throw t;info$1(t)}return shadow$1(this,"linearization",t)}get startXRef(){const t=this.stream;let e=0;if(this.linearization){if(t.reset(),find(t,dw)){t.skip(6);let s=t.peekByte();for(;isWhiteSpace(s);)t.pos++,s=t.peekByte();e=t.pos-t.start}}else{const s=1024,i=uw.length;let n=!1,a=t.end;for(;!n&&a>0;)a-=s-i,a<0&&(a=0),t.pos=a,n=find(t,uw,s,!0);if(n){let s;t.skip(9);do{s=t.getByte()}while(isWhiteSpace(s));let i="";for(;s>=32&&s<=57;)i+=String.fromCharCode(s),s=t.getByte();e=parseInt(i,10),isNaN(e)&&(e=0)}}return shadow$1(this,"startXRef",e)}checkHeader(){const t=this.stream;if(t.reset(),!find(t,hw))return;t.moveStart(),t.skip(hw.length);let e,s="";for(;(e=t.getByte())>32&&s.length<7;)s+=String.fromCharCode(e);ws.test(s)?this.#Qt=s:warn$1(`Invalid PDF header version: ${s}`)}parseStartXRef(){this.xref.setStartXRef(this.startXRef)}get numPages(){let t=0;return t=this.catalog.hasActualNumPages?this.catalog.numPages:this.xfaFactory?this.xfaFactory.getNumPages():this.linearization?this.linearization.numPages:this.catalog.numPages,shadow$1(this,"numPages",t)}#te(t,e=0){return!!Array.isArray(t)&&t.every(t=>{if(!((t=this.xref.fetchIfRef(t))instanceof fs))return!1;if(t.has("Kids"))return++e>10?(warn$1("#hasOnlyDocumentSignatures: maximum recursion depth reached"),!1):this.#te(t.get("Kids"),e);const s=isName(t.get("FT"),"Sig"),i=t.get("Rect"),n=Array.isArray(i)&&i.every(t=>0===t);return s&&n})}#ee(t,e,s=new ps){if(Array.isArray(t))for(let i of t){if(i instanceof gs){if(s.has(i))continue;s.put(i)}if(i=this.xref.fetchIfRef(i),!(i instanceof fs))continue;if(i.has("Kids")){this.#ee(i.get("Kids"),e,s);continue}if(!isName(i.get("FT"),"Sig"))continue;const t=i.get("V");if(!(t instanceof fs))continue;const n=t.get("SubFilter");n instanceof us&&e.add(n.name)}}get _xfaStreams(){const{acroForm:t}=this.catalog;if(!t)return null;const e=t.get("XFA"),s=new Map(["xdp:xdp","template","datasets","config","connectionSet","localeSet","stylesheet","/xdp:xdp"].map(t=>[t,null]));if(e instanceof bs&&!e.isEmpty)return s.set("xdp:xdp",e),s;if(!Array.isArray(e)||0===e.length)return null;for(let t=0,i=e.length;t<i;t+=2){let n;if(n=0===t?"xdp:xdp":t===i-2?"/xdp:xdp":e[t],!s.has(n))continue;const a=this.xref.fetchIfRef(e[t+1]);a instanceof bs&&!a.isEmpty&&s.set(n,a)}return s}get xfaDatasets(){const t=this._xfaStreams;if(!t)return shadow$1(this,"xfaDatasets",null);for(const e of["datasets","xdp:xdp"]){const s=t.get(e);if(s)try{const t=stringToUTF8String$1(s.getString());return shadow$1(this,"xfaDatasets",new zb({[e]:t}))}catch{warn$1("XFA - Invalid utf-8 string.");break}}return shadow$1(this,"xfaDatasets",null)}get xfaData(){const t=this._xfaStreams;if(!t)return null;const e=Object.create(null);for(const[s,i]of t)if(i)try{e[s]=stringToUTF8String$1(i.getString())}catch{return warn$1("XFA - Invalid utf-8 string."),null}return e}get xfaFactory(){let t;return this.pdfManager.enableXfa&&this.catalog.needsRendering&&this.formInfo.hasXfa&&!this.formInfo.hasAcroForm&&(t=this.xfaData),shadow$1(this,"xfaFactory",t?new pb(t):null)}get isPureXfa(){return!!this.xfaFactory&&this.xfaFactory.isValid()}get htmlForXfa(){return this.xfaFactory?this.xfaFactory.getPages():null}async#se(){const t=await this.pdfManager.ensureCatalog("xfaImages");t&&this.xfaFactory.setImages(t)}async#ie(t,e){const s=await this.pdfManager.ensureCatalog("acroForm");if(!s)return;const i=await s.getAsync("DR");if(!(i instanceof fs))return;await Ol.load(i,["Font"],this.xref);const n=i.get("Font");if(!(n instanceof fs))return;const a=Object.assign(Object.create(null),this.pdfManager.evaluatorOptions,{useSystemFonts:!1}),{builtInCMapCache:r,fontCache:o,standardFontDataCache:l}=this.catalog,c=new tl({xref:this.xref,handler:t,pageIndex:-1,idFactory:this._globalIdFactory,fontCache:o,builtInCMapCache:r,standardFontDataCache:l,options:a}),h=new Si,u=[],d={get font(){return u.at(-1)},set font(t){u.push(t)},clone(){return this}},parseFont=(t,s,n)=>c.handleSetFont(i,[us.get(t),1],null,h,e,d,s,n).catch(t=>(warn$1(`loadXfaFonts: "${t}".`),null)),f=[];for(const[t,e]of n){const s=e.get("FontDescriptor");if(!(s instanceof fs))continue;let i=s.get("FontFamily");i=i.replaceAll(/[ ]+(\d)/g,"$1");const n={fontFamily:i,fontWeight:s.get("FontWeight"),italicAngle:-s.get("ItalicAngle")};validateCSSFont(n)&&f.push(parseFont(t,null,n))}await Promise.all(f);const g=this.xfaFactory.setFonts(u);if(!g)return;a.ignoreErrors=!0,f.length=0,u.length=0;const p=new Set;for(const t of g)getXfaFontName(`${t}-Regular`)||p.add(t);p.size&&g.push("PdfJS-Fallback");for(const t of g)if(!p.has(t))for(const e of[{name:"Regular",fontWeight:400,italicAngle:0},{name:"Bold",fontWeight:700,italicAngle:0},{name:"Italic",fontWeight:400,italicAngle:12},{name:"BoldItalic",fontWeight:700,italicAngle:12}]){const s=`${t}-${e.name}`;f.push(parseFont(s,getXfaFontDict(s),{fontFamily:t,fontWeight:e.fontWeight,italicAngle:e.italicAngle}))}await Promise.all(f),this.xfaFactory.appendFonts(u,p)}loadXfaResources(t,e){return Promise.all([this.#ie(t,e).catch(()=>{}),this.#se()])}serializeXfaData(t){return this.xfaFactory?this.xfaFactory.serializeData(t):null}get version(){return this.catalog.version||this.#Qt}get formInfo(){const t={hasFields:!1,hasAcroForm:!1,hasXfa:!1,hasSignatures:!1},{acroForm:e}=this.catalog;if(!e)return shadow$1(this,"formInfo",t);try{const s=e.get("Fields"),i=Array.isArray(s)&&s.length>0;t.hasFields=i;const n=e.get("XFA");t.hasXfa=Array.isArray(n)&&n.length>0||n instanceof bs&&!n.isEmpty;const a=!!(1&e.get("SigFlags")),r=a&&this.#te(s);t.hasAcroForm=i&&!r,t.hasSignatures=a}catch(t){if(t instanceof ks)throw t;warn$1(`Cannot fetch form information: "${t}".`)}return shadow$1(this,"formInfo",t)}get documentInfo(){const{catalog:t,formInfo:e,xref:s}=this,i={PDFFormatVersion:this.version,Language:t.lang,EncryptFilterName:s.encrypt?.filterName??null,IsLinearized:!!this.linearization,IsAcroFormPresent:e.hasAcroForm,IsXFAPresent:e.hasXfa,IsCollectionPresent:!!t.collection,IsSignaturesPresent:e.hasSignatures};let n;try{n=s.trailer.get("Info")}catch(t){if(t instanceof ks)throw t;info$1("The document information dictionary is invalid.")}if(!(n instanceof fs))return shadow$1(this,"documentInfo",i);for(const[t,e]of n){switch(t){case"Title":case"Author":case"Subject":case"Keywords":case"Creator":case"Producer":case"CreationDate":case"ModDate":if("string"==typeof e){i[t]=stringToPDFString(e);continue}break;case"Trapped":if(e instanceof us){i[t]=e;continue}break;default:let s;switch(typeof e){case"string":s=stringToPDFString(e);break;case"number":case"boolean":s=e;break;default:e instanceof us&&(s=e)}if(void 0===s){warn$1(`Bad value, for custom key "${t}", in Info: ${e}.`);continue}i.Custom??=Object.create(null),i.Custom[t]=s;continue}warn$1(`Bad value, for key "${t}", in Info: ${e}.`)}return shadow$1(this,"documentInfo",i)}get fingerprints(){const t="\0".repeat(16);function validate(e){return"string"==typeof e&&16===e.length&&e!==t}const e=this.xref.trailer.get("ID");let s,i;return Array.isArray(e)&&validate(e[0])?(s=stringToBytes$1(e[0]),e[1]!==e[0]&&validate(e[1])&&(i=stringToBytes$1(e[1]))):s=calculateMD5(this.stream.getByteRange(0,1024),0,1024),shadow$1(this,"fingerprints",[toHexUtil(s),i?toHexUtil(i):null])}async#ne(t){const{catalog:e,linearization:s,xref:i}=this,n=gs.get(s.objectNumberFirst,0);try{const t=await i.fetchAsync(n);if(t instanceof fs){let s=t.getRaw("Type");if(s instanceof gs&&(s=await i.fetchAsync(s)),isName(s,"Page")||!t.has("Type")&&!t.has("Kids")&&t.has("Contents"))return e.pageKidsCountCache.has(n)||e.pageKidsCountCache.put(n,1),e.pageIndexCache.has(n)||e.pageIndexCache.put(n,0),[t,n]}throw new Ze("The Linearization dictionary doesn't point to a valid Page dictionary.")}catch(s){return warn$1(`_getLinearizationPage: "${s.message}".`),e.getPageDict(t)}}getPage(t){const e=this.#Zt.get(t);if(e)return e;const{catalog:s,linearization:i,xfaFactory:n}=this;let a;return a=n?Promise.resolve([fs.empty,null]):i?.pageFirst===t?this.#ne(t):s.getPageDict(t),a=a.then(([e,i])=>new cw({pdfManager:this.pdfManager,xref:this.xref,pageIndex:t,pageDict:e,ref:i,globalIdFactory:this._globalIdFactory,fontCache:s.fontCache,builtInCMapCache:s.builtInCMapCache,standardFontDataCache:s.standardFontDataCache,globalColorSpaceCache:s.globalColorSpaceCache,globalImageCache:s.globalImageCache,systemFontCache:s.systemFontCache,nonBlendModesSet:s.nonBlendModesSet,xfaFactory:n})),this.#Zt.set(t,a),a}async checkFirstPage(t=!1){if(!t)try{await this.getPage(0)}catch(t){if(t instanceof Cs)throw this.#Zt.delete(0),await this.cleanup(),new _s}}async checkLastPage(t=!1){const{catalog:e,pdfManager:s}=this;let i;e.setActualNumPages();try{if(await Promise.all([s.ensureDoc("xfaFactory"),s.ensureDoc("linearization"),s.ensureCatalog("numPages")]),this.xfaFactory)return;if(i=this.linearization?this.linearization.numPages:e.numPages,!Number.isInteger(i))throw new Ze("Page count is not an integer.");if(i<=1)return;await this.getPage(i-1)}catch(n){if(this.#Zt.delete(i-1),await this.cleanup(),n instanceof Cs&&!t)throw new _s;let a;warn$1(`checkLastPage - invalid /Pages tree /Count: ${i}.`);try{a=await e.getAllPageDicts(t)}catch(s){if(s instanceof Cs&&!t)throw new _s;return void e.setActualNumPages(1)}for(const[t,[i,n]]of a){let a;i instanceof Error?(a=Promise.reject(i),a.catch(()=>{})):a=Promise.resolve(new cw({pdfManager:s,xref:this.xref,pageIndex:t,pageDict:i,ref:n,globalIdFactory:this._globalIdFactory,fontCache:e.fontCache,builtInCMapCache:e.builtInCMapCache,standardFontDataCache:e.standardFontDataCache,globalColorSpaceCache:this.globalColorSpaceCache,globalImageCache:e.globalImageCache,systemFontCache:e.systemFontCache,nonBlendModesSet:e.nonBlendModesSet,xfaFactory:null})),this.#Zt.set(t,a)}e.setActualNumPages(a.size)}}async fontFallback(t,e){const{catalog:s,pdfManager:i}=this;for(const n of await Promise.all(s.fontCache))if(n.loadedName===t)return void n.fallback(e,i.evaluatorOptions)}async cleanup(t=!1){return this.catalog?this.catalog.cleanup(t):clearGlobalCaches()}async#ae(t,e,s,i,n,a,r){const{xref:o}=this;if(!(s instanceof gs)||a.has(s))return;a.put(s);const l=await o.fetchAsync(s);if(!(l instanceof fs))return;let c=await l.getAsync("Subtype");if(c=c instanceof us?c.name:null,"Link"===c)return;if(l.has("T")){const e=stringToPDFString(await l.getAsync("T"));t=""===t?e:`${t}.${e}`}else{let s=l;for(;;){if(s=s.getRaw("Parent")||e,s instanceof gs){if(a.has(s))break;s=await o.fetchAsync(s)}if(!(s instanceof fs))break;if(s.has("T")){const e=stringToPDFString(await s.getAsync("T"));t=""===t?e:`${t}.${e}`;break}}}if(e&&!l.has("Parent")&&isName(l.get("Subtype"),"Widget")&&r.put(s,e),i.has(t)||i.set(t,[]),i.get(t).push(mb.create(o,s,n,null,!0,r,null,null).then(t=>t?.getFieldObject()).catch(function(t){return warn$1(`#collectFieldObjects: "${t}".`),null})),!l.has("Kids"))return;const h=await l.getAsync("Kids");if(Array.isArray(h))for(const e of h)await this.#ae(t,s,e,i,n,a,r)}get fieldObjects(){return shadow$1(this,"fieldObjects",this.pdfManager.ensureDoc("formInfo").then(async t=>{if(!t.hasFields)return null;const e=await this.annotationGlobals;if(!e)return null;const{acroForm:s}=e,i=new ps,n=Object.create(null),a=new Map,r=new ms;for(const t of s.get("Fields"))await this.#ae("",null,t,a,e,i,r);const o=[];for(const[t,e]of a)o.push(Promise.all(e).then(e=>{(e=e.filter(t=>!!t)).length>0&&(n[t]=e)}));return await Promise.all(o),{allFields:objectSize(n)>0?n:null,orphanFields:r}}))}get hasJSActions(){return shadow$1(this,"hasJSActions",this.pdfManager.ensureDoc("_parseHasJSActions"))}async _parseHasJSActions(){const[t,e]=await Promise.all([this.pdfManager.ensureCatalog("jsActions"),this.pdfManager.ensureDoc("fieldObjects")]);return!!t||!!e?.allFields&&Object.values(e.allFields).some(t=>t.some(t=>null!==t.actions))}get calculationOrderIds(){const t=this.catalog.acroForm?.get("CO");if(!Array.isArray(t)||0===t.length)return shadow$1(this,"calculationOrderIds",null);const e=[];for(const s of t)s instanceof gs&&e.push(s.toString());return shadow$1(this,"calculationOrderIds",e.length?e:null)}get annotationGlobals(){return shadow$1(this,"annotationGlobals",mb.createGlobals(this.pdfManager))}},gw=class{constructor({docBaseUrl:t,docId:e,enableXfa:s,evaluatorOptions:i,handler:n,password:a}){this._docBaseUrl=function(t){if(t){const e=createValidAbsoluteUrl$1(t);if(e)return e.href;warn$1(`Invalid absolute docBaseUrl: "${t}".`)}return null}(t),this._docId=e,this._password=a,this.enableXfa=s,i.isOffscreenCanvasSupported&&=ts.isOffscreenCanvasSupported,i.isImageDecoderSupported&&=ts.isImageDecoderSupported,this.evaluatorOptions=Object.freeze(i),ti.setOptions(i),wi.setOptions(i),Si.setOptions(i);const r={...i,handler:n};xi.setOptions(r),Vs.setOptions(r),Xs.setOptions(r)}get docId(){return this._docId}get password(){return this._password}get docBaseUrl(){return this._docBaseUrl}ensureDoc(t,e){return this.ensure(this.pdfDocument,t,e)}ensureXRef(t,e){return this.ensure(this.pdfDocument.xref,t,e)}ensureCatalog(t,e){return this.ensure(this.pdfDocument.catalog,t,e)}getPage(t){return this.pdfDocument.getPage(t)}fontFallback(t,e){return this.pdfDocument.fontFallback(t,e)}cleanup(t=!1){return this.pdfDocument.cleanup(t)}async ensure(t,e,s){unreachable$1("Abstract method `ensure` called")}requestRange(t,e){unreachable$1("Abstract method `requestRange` called")}requestLoadedStream(t=!1){unreachable$1("Abstract method `requestLoadedStream` called")}sendProgressiveData(t){unreachable$1("Abstract method `sendProgressiveData` called")}updatePassword(t){this._password=t}terminate(t){unreachable$1("Abstract method `terminate` called")}},pw=class extends gw{constructor(t){super(t);const e=new Ks(t.source);this.pdfDocument=new fw(this,e),this._loadedStreamPromise=Promise.resolve(e)}async ensure(t,e,s){const i=t[e];return"function"==typeof i?i.apply(t,s):i}requestRange(t,e){return Promise.resolve()}requestLoadedStream(t=!1){return this._loadedStreamPromise}terminate(t){}},mw=class extends gw{constructor(t){super(t),this.streamManager=new Qs(t.source,{msgHandler:t.handler,length:t.length,disableAutoFetch:t.disableAutoFetch,rangeChunkSize:t.rangeChunkSize}),this.pdfDocument=new fw(this,this.streamManager.getStream())}async ensure(t,e,s){try{const i=t[e];return"function"==typeof i?i.apply(t,s):i}catch(i){if(!(i instanceof ks))throw i;return await this.requestRange(i.begin,i.end),this.ensure(t,e,s)}}requestRange(t,e){return this.streamManager.requestRange(t,e)}requestLoadedStream(t=!1){return this.streamManager.requestAllChunks(t)}sendProgressiveData(t){this.streamManager.onReceiveData({chunk:t})}terminate(t){this.streamManager.abort(t)}},bw=1,ww=2,yw=1,xw=2,vw=3,Aw=4,kw=5,Sw=6,Cw=7,_w=8;function onFn$1(){}function wrapReason$1(t){if(t instanceof Qe||t instanceof Ye||t instanceof Xe||t instanceof Je||t instanceof Ke)return t;switch(t instanceof Error||"object"==typeof t&&null!==t||unreachable$1('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new Qe(t.message);case"InvalidPDFException":return new Ye(t.message);case"PasswordException":return new Xe(t.message,t.code);case"ResponseException":return new Je(t.message,t.status,t.missing);case"UnknownErrorException":return new Ke(t.message,t.details)}return new Ke(t.message,t.toString())}var Iw=class{#re=new AbortController;constructor(t,e,s){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),s.addEventListener("message",this.#oe.bind(this),{signal:this.#re.signal})}#oe({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream)return void this.#le(t);if(t.callback){const e=t.callbackId,s=this.callbackCapabilities[e];if(!s)throw new Error(`Cannot resolve callback ${e}`);if(delete this.callbackCapabilities[e],t.callback===bw)s.resolve(t.data);else{if(t.callback!==ww)throw new Error("Unexpected callback case");s.reject(wrapReason$1(t.reason))}return}const e=this.actionHandler[t.action];if(!e)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const s=this.sourceName,i=t.sourceName,n=this.comObj;return void Promise.try(e,t.data).then(function(e){n.postMessage({sourceName:s,targetName:i,callback:bw,callbackId:t.callbackId,data:e})},function(e){n.postMessage({sourceName:s,targetName:i,callback:ww,callbackId:t.callbackId,reason:wrapReason$1(e)})})}t.streamId?this.#ce(t):e(t.data)}on(t,e){const s=this.actionHandler;if(s[t])throw new Error(`There is already an actionName called "${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 i=this.callbackId++,n=Promise.withResolvers();this.callbackCapabilities[i]=n;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:i,data:e},s)}catch(t){n.reject(t)}return n.promise}sendWithStream(t,e,s,i){const n=this.streamId++,a=this.sourceName,r=this.targetName,o=this.comObj;return new ReadableStream({start:s=>{const l=Promise.withResolvers();return this.streamControllers[n]={controller:s,startCall:l,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:a,targetName:r,action:t,streamId:n,data:e,desiredSize:s.desiredSize},i),l.promise},pull:t=>{const e=Promise.withResolvers();return this.streamControllers[n].pullCall=e,o.postMessage({sourceName:a,targetName:r,stream:Sw,streamId:n,desiredSize:t.desiredSize}),e.promise},cancel:t=>{assert$1(t instanceof Error,"cancel must have a valid reason");const e=Promise.withResolvers();return this.streamControllers[n].cancelCall=e,this.streamControllers[n].isClosed=!0,o.postMessage({sourceName:a,targetName:r,stream:yw,streamId:n,reason:wrapReason$1(t)}),e.promise}},s)}#ce(t){const e=t.streamId,s=this.sourceName,i=t.sourceName,n=this.comObj,a=this,r=this.actionHandler[t.action],o={enqueue(t,a=1,r){if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=a,o>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),n.postMessage({sourceName:s,targetName:i,stream:Aw,streamId:e,chunk:t},r)},close(){this.isCancelled||(this.isCancelled=!0,n.postMessage({sourceName:s,targetName:i,stream:vw,streamId:e}),delete a.streamSinks[e])},error(t){assert$1(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,n.postMessage({sourceName:s,targetName:i,stream:kw,streamId:e,reason:wrapReason$1(t)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[e]=o,Promise.try(r,t.data,o).then(function(){n.postMessage({sourceName:s,targetName:i,stream:_w,streamId:e,success:!0})},function(t){n.postMessage({sourceName:s,targetName:i,stream:_w,streamId:e,reason:wrapReason$1(t)})})}#le(t){const e=t.streamId,s=this.sourceName,i=t.sourceName,n=this.comObj,a=this.streamControllers[e],r=this.streamSinks[e];switch(t.stream){case _w:t.success?a.startCall.resolve():a.startCall.reject(wrapReason$1(t.reason));break;case Cw:t.success?a.pullCall.resolve():a.pullCall.reject(wrapReason$1(t.reason));break;case Sw:if(!r){n.postMessage({sourceName:s,targetName:i,stream:Cw,streamId:e,success:!0});break}r.desiredSize<=0&&t.desiredSize>0&&r.sinkCapability.resolve(),r.desiredSize=t.desiredSize,Promise.try(r.onPull||onFn$1).then(function(){n.postMessage({sourceName:s,targetName:i,stream:Cw,streamId:e,success:!0})},function(t){n.postMessage({sourceName:s,targetName:i,stream:Cw,streamId:e,reason:wrapReason$1(t)})});break;case Aw:if(assert$1(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(t.chunk);break;case vw:if(assert$1(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),this.#he(a,e);break;case kw:assert$1(a,"error should have stream controller"),a.controller.error(wrapReason$1(t.reason)),this.#he(a,e);break;case xw:t.success?a.cancelCall.resolve():a.cancelCall.reject(wrapReason$1(t.reason)),this.#he(a,e);break;case yw:if(!r)break;const o=wrapReason$1(t.reason);Promise.try(r.onCancel||onFn$1,o).then(function(){n.postMessage({sourceName:s,targetName:i,stream:xw,streamId:e,success:!0})},function(t){n.postMessage({sourceName:s,targetName:i,stream:xw,streamId:e,reason:wrapReason$1(t)})}),r.sinkCapability.reject(o),r.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async#he(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[e]}destroy(){this.#re?.abort(),this.#re=null}};async function writeObject(t,e,s,{encrypt:i=null}){const n=i?.createCipherTransform(t.num,t.gen);s.push(`${t.num} ${t.gen} obj\n`),e instanceof fs?await writeDict(e,s,n):e instanceof bs?await writeStream(e,s,n):(Array.isArray(e)||ArrayBuffer.isView(e))&&await writeArray(e,s,n),s.push("\nendobj\n")}async function writeDict(t,e,s){e.push("<<");for(const i of t.getKeys())e.push(` /${escapePDFName(i)} `),await writeValue(t.getRaw(i),e,s);e.push(">>")}async function writeStream(t,e,s){let i=t.getBytes();const{dict:n}=t,[a,r]=await Promise.all([n.getAsync("Filter"),n.getAsync("DecodeParms")]),o=isName(Array.isArray(a)?await n.xref.fetchIfRefAsync(a[0]):a,"FlateDecode");if(i.length>=256||o)try{const t=new CompressionStream("deflate"),e=t.writable.getWriter();await e.ready,e.write(i).then(async()=>{await e.ready,await e.close()}).catch(()=>{});const s=await new Response(t.readable).arrayBuffer();let l,c;i=new Uint8Array(s),a?o||(l=Array.isArray(a)?[us.get("FlateDecode"),...a]:[us.get("FlateDecode"),a],r&&(c=Array.isArray(r)?[null,...r]:[null,r])):l=us.get("FlateDecode"),l&&n.set("Filter",l),c&&n.set("DecodeParms",c)}catch(t){info$1(`writeStream - cannot compress data: "${t}".`)}let l=bytesToString$1(i);s&&(l=s.encryptString(l)),n.set("Length",l.length),await writeDict(n,e,s),e.push(" stream\n",l,"\nendstream")}async function writeArray(t,e,s){e.push("[");let i=!0;for(const n of t)i?i=!1:e.push(" "),await writeValue(n,e,s);e.push("]")}async function writeValue(t,e,s){t instanceof us?e.push(`/${escapePDFName(t.name)}`):t instanceof gs?e.push(`${t.num} ${t.gen} R`):Array.isArray(t)||ArrayBuffer.isView(t)?await writeArray(t,e,s):"string"==typeof t?(s&&(t=s.encryptString(t)),e.push(`(${escapeString(t)})`)):"number"==typeof t?e.push(numberToString(t)):"boolean"==typeof t?e.push(t.toString()):t instanceof fs?await writeDict(t,e,s):t instanceof bs?await writeStream(t,e,s):null===t?e.push("null"):warn$1(`Unhandled value in writer: ${typeof t}, please file a bug.`)}function writeInt(t,e,s,i){for(let n=e+s-1;n>s-1;n--)i[n]=255&t,t>>=8;return s+e}function writeString(t,e,s){const i=t.length;for(let n=0;n<i;n++)s[e+n]=255&t.charCodeAt(n);return e+i}function updateXFA({xfaData:t,xfaDatasetsRef:e,changes:s,xref:i}){null===t&&(t=function(t,e){const s=new Sl({hasAttributes:!0}).parseFromString(t);for(const{xfa:t}of e){if(!t)continue;const{path:e,value:i}=t;if(!e)continue;const n=parseXFAPath(e);let a=s.documentElement.searchNode(n,0);!a&&n.length>1&&(a=s.documentElement.searchNode([n.at(-1)],0)),a?a.childNodes=Array.isArray(i)?i.map(t=>new kl("value",t)):[new kl("#text",i)]:warn$1(`Node not found for path: ${e}`)}const i=[];return s.documentElement.dump(i),i.join("")}(i.fetchIfRef(e).getString(),s));const n=new Ys(t);n.dict=new fs(i),n.dict.setIfName("Type","EmbeddedFile"),s.put(e,{data:n})}function getIndexes(t){const e=[];for(const{ref:s}of t)s.num===e.at(-2)+e.at(-1)?e[e.length-1]+=1:e.push(s.num,1);return e}function computeIDs(t,e,s){if(Array.isArray(e.fileIds)&&e.fileIds.length>0){const i=function(t,e){const s=Math.floor(Date.now()/1e3),i=e.filename||"",n=[s.toString(),i,t.toString(),...e.infoMap.values()],a=Math.sumPrecise(n.map(t=>t.length)),r=new Uint8Array(a);let o=0;for(const t of n)o=writeString(t,o,r);return bytesToString$1(calculateMD5(r,0,r.length))}(t,e);s.set("ID",[e.fileIds[0],i])}}async function incrementalUpdate({originalData:t,xrefInfo:e,changes:s,xref:i=null,hasXfa:n=!1,xfaDatasetsRef:a=null,hasXfaDatasetsEntry:r=!1,needAppearances:o,acroFormRef:l=null,acroForm:c=null,xfaData:h=null,useXrefStream:u=!1}){await async function({xref:t,acroForm:e,acroFormRef:s,hasXfa:i,hasXfaDatasetsEntry:n,xfaDatasetsRef:a,needAppearances:r,changes:o}){if(!i||n||a||warn$1("XFA - Cannot save it"),!r&&(!i||!a||n))return;const l=e.clone();if(i&&!n){const t=e.get("XFA").slice();t.splice(2,0,"datasets"),t.splice(3,0,a),l.set("XFA",t)}r&&l.set("NeedAppearances",!0),o.put(s,{data:l})}({xref:i,acroForm:c,acroFormRef:l,hasXfa:n,hasXfaDatasetsEntry:r,xfaDatasetsRef:a,needAppearances:o,changes:s}),n&&updateXFA({xfaData:h,xfaDatasetsRef:a,changes:s,xref:i});const d=function(t,e,s){const i=new fs(null);i.set("Prev",t.startXRef);const n=t.newRef;return s?(e.put(n,{data:""}),i.set("Size",n.num+1),i.setIfName("Type","XRef")):i.set("Size",n.num),null!==t.rootRef&&i.set("Root",t.rootRef),null!==t.infoRef&&i.set("Info",t.infoRef),null!==t.encryptRef&&i.set("Encrypt",t.encryptRef),i}(e,s,u),f=[],g=await async function(t,e,s=[]){const i=[];for(const[n,{data:a}]of t.items())null!==a&&"string"!=typeof a?(await writeObject(n,a,s,e),i.push({ref:n,data:s.join("")}),s.length=0):i.push({ref:n,data:a});return i.sort((t,e)=>t.ref.num-e.ref.num)}(s,i,f);let p=t.length;const m=t.at(-1);10!==m&&13!==m&&(f.push("\n"),p+=1);for(const{data:t}of g)null!==t&&f.push(t);await(u?async function(t,e,s,i,n){const a=[];let r=0,o=0;for(const{ref:t,data:i}of s){let s;r=Math.max(r,e),null!==i?(s=Math.min(t.gen,65535),a.push([1,e,s]),e+=i.length):(s=Math.min(t.gen+1,65535),a.push([0,0,s])),o=Math.max(o,s)}i.set("Index",getIndexes(s));const l=[1,getSizeInBytes(r),getSizeInBytes(o)];i.set("W",l),computeIDs(e,t,i);const c=Math.sumPrecise(l),h=new Uint8Array(c*a.length),u=new Ks(h);u.dict=i;let d=0;for(const[t,e,s]of a)d=writeInt(t,l[0],d,h),d=writeInt(e,l[1],d,h),d=writeInt(s,l[2],d,h);await writeObject(t.newRef,u,n,{}),n.push("startxref\n",e.toString(),"\n%%EOF\n")}(e,p,g,d,f):async function(t,e,s,i,n){n.push("xref\n");const a=getIndexes(s);let r=0;for(const{ref:t,data:i}of s)t.num===a[r]&&(n.push(`${a[r]} ${a[r+1]}\n`),r+=2),null!==i?(n.push(`${e.toString().padStart(10,"0")} ${Math.min(t.gen,65535).toString().padStart(5,"0")} n\r\n`),e+=i.length):n.push(`0000000000 ${Math.min(t.gen+1,65535).toString().padStart(5,"0")} f\r\n`);computeIDs(e,t,i),n.push("trailer\n"),await writeDict(i,n),n.push("\nstartxref\n",e.toString(),"\n%%EOF\n")}(e,p,g,d,f));const b=t.length+Math.sumPrecise(f.map(t=>t.length)),w=new Uint8Array(b);w.set(t);let y=t.length;for(const t of f)y=writeString(t,y,w);return w}var Tw=class{constructor(t){this._msgHandler=t,this._contentLength=null,this._fullRequestReader=null,this._rangeRequestReaders=[]}getFullReader(){return assert$1(!this._fullRequestReader,"PDFWorkerStream.getFullReader can only be called once."),this._fullRequestReader=new Mw(this._msgHandler),this._fullRequestReader}getRangeReader(t,e){const s=new Ew(t,e,this._msgHandler);return this._rangeRequestReaders.push(s),s}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}},Mw=class{constructor(t){this._msgHandler=t,this.onProgress=null,this._contentLength=null,this._isRangeSupported=!1,this._isStreamingSupported=!1;const e=this._msgHandler.sendWithStream("GetReader");this._reader=e.getReader(),this._headersReady=this._msgHandler.sendWithPromise("ReaderHeadersReady").then(t=>{this._isStreamingSupported=t.isStreamingSupported,this._isRangeSupported=t.isRangeSupported,this._contentLength=t.contentLength})}get headersReady(){return this._headersReady}get contentLength(){return this._contentLength}get isStreamingSupported(){return this._isStreamingSupported}get isRangeSupported(){return this._isRangeSupported}async read(){const{value:t,done:e}=await this._reader.read();return e?{value:void 0,done:!0}:{value:t.buffer,done:!1}}cancel(t){this._reader.cancel(t)}},Ew=class{constructor(t,e,s){this._msgHandler=s,this.onProgress=null;const i=this._msgHandler.sendWithStream("GetRangeReader",{begin:t,end:e});this._reader=i.getReader()}get isStreamingSupported(){return!1}async read(){const{value:t,done:e}=await this._reader.read();return e?{value:void 0,done:!0}:{value:t.buffer,done:!1}}cancel(t){this._reader.cancel(t)}},Fw=class{constructor(t){this.name=t,this.terminated=!1,this._capability=Promise.withResolvers()}get finished(){return this._capability.promise}finish(){this._capability.resolve()}terminate(){this.terminated=!0}ensureNotTerminated(){if(this.terminated)throw new Error("Worker task was terminated")}},Dw=class{static{"undefined"==typeof window&&!e&&"undefined"!=typeof self&&"function"==typeof self.postMessage&&"onmessage"in self&&this.initializeFromPort(self)}static setup(t,e){let s=!1;t.on("test",e=>{s||(s=!0,t.send("test",e instanceof Uint8Array))}),t.on("configure",t=>{var e;e=t.verbosity,Number.isInteger(e)&&(We=e)}),t.on("GetDocRequest",t=>this.createDocumentHandler(t,e))}static createDocumentHandler(t,e){let s,i=!1,n=null;const a=new Set,r=We,{docId:o,apiVersion:l}=t,c="5.4.296";if(l!==c)throw new Error(`The API version "${l}" does not match the Worker version "${c}".`);const buildMsg=(t,e)=>`The \`${t}.prototype\` contains unexpected enumerable property "${e}", thus breaking e.g. \`for...in\` iteration of ${t}s.`;for(const t in{})throw new Error(buildMsg("Object",t));for(const t in[])throw new Error(buildMsg("Array",t));const h=o+"_worker";let u=new Iw(h,o,e);function ensureNotTerminated(){if(i)throw new Error("Worker was terminated")}function startWorkerTask(t){a.add(t)}function finishWorkerTask(t){t.finish(),a.delete(t)}async function loadDocument(t){await s.ensureDoc("checkHeader"),await s.ensureDoc("parseStartXRef"),await s.ensureDoc("parse",[t]),await s.ensureDoc("checkFirstPage",[t]),await s.ensureDoc("checkLastPage",[t]);const e=await s.ensureDoc("isPureXfa");if(e){const t=new Fw("loadXfaResources");startWorkerTask(t),await s.ensureDoc("loadXfaResources",[u,t]),finishWorkerTask(t)}const[i,n]=await Promise.all([s.ensureDoc("numPages"),s.ensureDoc("fingerprints")]);return{numPages:i,fingerprints:n,htmlForXfa:e?await s.ensureDoc("htmlForXfa"):null}}function setupDoc(t){function onSuccess(t){ensureNotTerminated(),u.send("GetDoc",{pdfInfo:t})}function onFailure(t){if(ensureNotTerminated(),t instanceof Xe){const e=new Fw(`PasswordException: response ${t.code}`);startWorkerTask(e),u.sendWithPromise("PasswordRequest",t).then(function({password:t}){finishWorkerTask(e),s.updatePassword(t),pdfManagerReady()}).catch(function(){finishWorkerTask(e),u.send("DocException",t)})}else u.send("DocException",wrapReason$1(t))}function pdfManagerReady(){ensureNotTerminated(),loadDocument(!1).then(onSuccess,function(t){ensureNotTerminated(),t instanceof _s?s.requestLoadedStream().then(function(){ensureNotTerminated(),loadDocument(!0).then(onSuccess,onFailure)}):onFailure(t)})}ensureNotTerminated(),async function({data:t,password:e,disableAutoFetch:s,rangeChunkSize:i,length:a,docBaseUrl:r,enableXfa:l,evaluatorOptions:c}){const h={source:null,disableAutoFetch:s,docBaseUrl:r,docId:o,enableXfa:l,evaluatorOptions:c,handler:u,length:a,password:e,rangeChunkSize:i};if(t)return h.source=t,new pw(h);const d=new Tw(u),f=d.getFullReader(),g=Promise.withResolvers();let p,m=[],b=0;return f.headersReady.then(function(){if(f.isRangeSupported){h.source=d,h.length=f.contentLength,h.disableAutoFetch||=f.isStreamingSupported,p=new mw(h);for(const t of m)p.sendProgressiveData(t);m=[],g.resolve(p),n=null}}).catch(function(t){g.reject(t),n=null}),new Promise(function(t,e){const readChunk=function({value:t,done:s}){try{if(ensureNotTerminated(),s){if(!p){const t=arrayBuffersToBytes(m);m=[],a&&t.length!==a&&warn$1("reported HTTP length is different from actual"),h.source=t,p=new pw(h),g.resolve(p)}return void(n=null)}b+=t.byteLength,f.isStreamingSupported||u.send("DocProgress",{loaded:b,total:Math.max(b,f.contentLength||0)}),p?p.sendProgressiveData(t):m.push(t),f.read().then(readChunk,e)}catch(t){e(t)}};f.read().then(readChunk,e)}).catch(function(t){g.reject(t),n=null}),n=t=>{d.cancelAllRequests(t)},g.promise}(t).then(function(t){if(i)throw t.terminate(new Qe("Worker was terminated.")),new Error("Worker was terminated");s=t,s.requestLoadedStream(!0).then(t=>{u.send("DataLoaded",{length:t.bytes.byteLength})})}).then(pdfManagerReady,onFailure)}return u.on("GetPage",function(t){return s.getPage(t.pageIndex).then(function(t){return Promise.all([s.ensure(t,"rotate"),s.ensure(t,"ref"),s.ensure(t,"userUnit"),s.ensure(t,"view")]).then(function([t,e,s,i]){return{rotate:t,ref:e,refStr:e?.toString()??null,userUnit:s,view:i}})})}),u.on("GetPageIndex",function(t){const e=gs.get(t.num,t.gen);return s.ensureCatalog("getPageIndex",[e])}),u.on("GetDestinations",function(t){return s.ensureCatalog("destinations")}),u.on("GetDestination",function(t){return s.ensureCatalog("getDestination",[t.id])}),u.on("GetPageLabels",function(t){return s.ensureCatalog("pageLabels")}),u.on("GetPageLayout",function(t){return s.ensureCatalog("pageLayout")}),u.on("GetPageMode",function(t){return s.ensureCatalog("pageMode")}),u.on("GetViewerPreferences",function(t){return s.ensureCatalog("viewerPreferences")}),u.on("GetOpenAction",function(t){return s.ensureCatalog("openAction")}),u.on("GetAttachments",function(t){return s.ensureCatalog("attachments")}),u.on("GetDocJSActions",function(t){return s.ensureCatalog("jsActions")}),u.on("GetPageJSActions",function({pageIndex:t}){return s.getPage(t).then(t=>s.ensure(t,"jsActions"))}),u.on("GetAnnotationsByType",async function({types:t,pageIndexesToSkip:e}){const[i,n]=await Promise.all([s.ensureDoc("numPages"),s.ensureDoc("annotationGlobals")]);if(!n)return null;const a=[],r=[];let o=null;try{for(let l=0,c=i;l<c;l++)e?.has(l)||(o||(o=new Fw("GetAnnotationsByType"),startWorkerTask(o)),a.push(s.getPage(l).then(async e=>e&&e.collectAnnotationsByType(u,o,t,r,n)||[])));return await Promise.all(a),(await Promise.all(r)).filter(t=>!!t)}finally{o&&finishWorkerTask(o)}}),u.on("GetOutline",function(t){return s.ensureCatalog("documentOutline")}),u.on("GetOptionalContentConfig",function(t){return s.ensureCatalog("optionalContentConfig")}),u.on("GetPermissions",function(t){return s.ensureCatalog("permissions")}),u.on("GetMetadata",function(t){return Promise.all([s.ensureDoc("documentInfo"),s.ensureCatalog("metadata")])}),u.on("GetMarkInfo",function(t){return s.ensureCatalog("markInfo")}),u.on("GetData",function(t){return s.requestLoadedStream().then(t=>t.bytes)}),u.on("GetAnnotations",function({pageIndex:t,intent:e}){return s.getPage(t).then(function(s){const i=new Fw(`GetAnnotations: page ${t}`);return startWorkerTask(i),s.getAnnotationsData(u,i,e).then(t=>(finishWorkerTask(i),t),t=>{throw finishWorkerTask(i),t})})}),u.on("GetFieldObjects",function(t){return s.ensureDoc("fieldObjects").then(t=>t?.allFields||null)}),u.on("HasJSActions",function(t){return s.ensureDoc("hasJSActions")}),u.on("GetCalculationOrderIds",function(t){return s.ensureDoc("calculationOrderIds")}),u.on("SaveDocument",async function({isPureXfa:t,numPages:e,annotationStorage:i,filename:n}){const a=[s.requestLoadedStream(),s.ensureCatalog("acroForm"),s.ensureCatalog("acroFormRef"),s.ensureDoc("startXRef"),s.ensureDoc("xref"),s.ensureCatalog("structTreeRoot")],r=new ms,o=[],l=t?null:getNewAnnotationsMap(i),[c,h,d,f,g,p]=await Promise.all(a),m=g.trailer.getRaw("Root")||null;let b;if(l){p?await p.canUpdateStructTree({pdfManager:s,newAnnotationsByPage:l})&&(b=p):await Fl.canCreateStructureTree({catalogRef:m,pdfManager:s,newAnnotationsByPage:l})&&(b=null);const t=mb.generateImages(i.values(),g,s.evaluatorOptions.isOffscreenCanvasSupported),e=void 0===b?o:[];for(const[i,n]of l)e.push(s.getPage(i).then(e=>{const s=new Fw(`Save (editor): page ${i}`);return startWorkerTask(s),e.saveNewAnnotations(u,s,n,t,r).finally(function(){finishWorkerTask(s)})}));null===b?o.push(Promise.all(e).then(async()=>{await Fl.createStructureTree({newAnnotationsByPage:l,xref:g,catalogRef:m,pdfManager:s,changes:r})})):b&&o.push(Promise.all(e).then(async()=>{await b.updateStructureTree({newAnnotationsByPage:l,pdfManager:s,changes:r})}))}if(t)o.push(s.ensureDoc("serializeXfaData",[i]));else for(let t=0;t<e;t++)o.push(s.getPage(t).then(function(e){const s=new Fw(`Save: page ${t}`);return startWorkerTask(s),e.save(u,s,i,r).finally(function(){finishWorkerTask(s)})}));const w=await Promise.all(o);let y=null;if(t){if(y=w[0],!y)return c.bytes}else if(0===r.size)return c.bytes;const x=d&&h instanceof fs&&r.values().some(t=>t.needAppearances),v=h instanceof fs&&h.get("XFA")||null;let A=null,k=!1;if(Array.isArray(v)){for(let t=0,e=v.length;t<e;t+=2)"datasets"===v[t]&&(A=v[t+1],k=!0);null===A&&(A=g.getNewTemporaryRef())}else v&&warn$1("Unsupported XFA type.");let S=Object.create(null);if(g.trailer){const t=new Map,e=g.trailer.get("Info")||null;if(e instanceof fs)for(const[s,i]of e)"string"==typeof i&&t.set(s,stringToPDFString(i));S={rootRef:m,encryptRef:g.trailer.getRaw("Encrypt")||null,newRef:g.getNewTemporaryRef(),infoRef:g.trailer.getRaw("Info")||null,infoMap:t,fileIds:g.trailer.get("ID")||null,startXRef:f,filename:n}}return incrementalUpdate({originalData:c.bytes,xrefInfo:S,changes:r,xref:g,hasXfa:!!v,xfaDatasetsRef:A,hasXfaDatasetsEntry:k,needAppearances:x,acroFormRef:d,acroForm:h,xfaData:y,useXrefStream:isDict(g.topDict,"XRef")}).finally(()=>{g.resetNewTemporaryRef()})}),u.on("GetOperatorList",function(t,e){const i=t.pageIndex;s.getPage(i).then(function(s){const n=new Fw(`GetOperatorList: page ${i}`);startWorkerTask(n);const a=r>=st?Date.now():0;s.getOperatorList({handler:u,sink:e,task:n,intent:t.intent,cacheKey:t.cacheKey,annotationStorage:t.annotationStorage,modifiedIds:t.modifiedIds}).then(function(t){finishWorkerTask(n),a&&info$1(`page=${i+1} - getOperatorList: time=${Date.now()-a}ms, len=${t.length}`),e.close()},function(t){finishWorkerTask(n),n.terminated||e.error(t)})})}),u.on("GetTextContent",function(t,e){const{pageIndex:i,includeMarkedContent:n,disableNormalization:a}=t;s.getPage(i).then(function(t){const s=new Fw("GetTextContent: page "+i);startWorkerTask(s);const o=r>=st?Date.now():0;t.extractTextContent({handler:u,task:s,sink:e,includeMarkedContent:n,disableNormalization:a}).then(function(){finishWorkerTask(s),o&&info$1(`page=${i+1} - getTextContent: time=`+(Date.now()-o)+"ms"),e.close()},function(t){finishWorkerTask(s),s.terminated||e.error(t)})})}),u.on("GetStructTree",function(t){return s.getPage(t.pageIndex).then(t=>s.ensure(t,"getStructTree"))}),u.on("FontFallback",function(t){return s.fontFallback(t.id,u)}),u.on("Cleanup",function(t){return s.cleanup(!0)}),u.on("Terminate",function(t){i=!0;const e=[];if(s){s.terminate(new Qe("Worker was terminated."));const t=s.cleanup();e.push(t),s=null}else clearGlobalCaches();n?.(new Qe("Worker was terminated."));for(const t of a)e.push(t.finished),t.terminate();return Promise.all(e).then(function(){u.destroy(),u=null})}),u.on("Ready",function(e){setupDoc(t),t=null}),h}static initializeFromPort(t){const e=new Iw("worker","main",t);this.setup(e,t),e.send("ready",null)}};globalThis.pdfjsWorker={WorkerMessageHandler:Dw};var Rw=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),Bw=[.001,0,0,.001,0,0],Pw=1.35,Nw=1,Ow=2,Lw=4,Uw=16,$w=32,Hw=64,jw=128,qw=256,zw={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Gw="pdfjs_internal_editor_",Ww={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},Vw={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},Xw={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Kw=0,Yw=1,Jw=2,Zw=3,Qw=3,ty=4,ey={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},sy={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},iy=1,ny=2,ay=3,ry=4,oy=5,ly={ERRORS:0,WARNINGS:1,INFOS:5},cy={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,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},hy=0,uy=1,dy=2,fy=3,gy={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},py=ly.WARNINGS;function setVerbosityLevel(t){Number.isInteger(t)&&(py=t)}function getVerbosityLevel(){return py}function info(t){py>=ly.INFOS&&console.info(`Info: ${t}`)}function warn(t){py>=ly.WARNINGS&&console.warn(`Warning: ${t}`)}function unreachable(t){throw new Error(t)}function assert(t,e){t||unreachable(e)}function createValidAbsoluteUrl(t,e=null,s=null){if(!t)return null;if(s&&"string"==typeof t){if(s.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);e?.length>=2&&(t=`http://${t}`)}if(s.tryConvertEncoding)try{t=decodeURIComponent(escape(t))}catch{}}const i=e?URL.parse(t,e):URL.parse(t);return function(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(i)?i:null}function updateUrlHash(t,e,s=!1){const i=URL.parse(t);return i?(i.hash=e,i.href):s&&createValidAbsoluteUrl(t,"http://example.com")?t.split("#",1)[0]+(e?`#${e}`:""):""}function shadow(t,e,s,i=!1){return Object.defineProperty(t,e,{value:s,enumerable:!i,configurable:!0,writable:!1}),s}var my=function(){function BaseException(t,e){this.message=t,this.name=e}return BaseException.prototype=new Error,BaseException.constructor=BaseException,BaseException}(),by=class extends my{constructor(t,e){super(t,"PasswordException"),this.code=e}},wy=class extends my{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}},yy=class extends my{constructor(t){super(t,"InvalidPDFException")}},xy=class extends my{constructor(t,e,s){super(t,"ResponseException"),this.status=e,this.missing=s}},vy=class extends my{constructor(t){super(t,"FormatError")}},Ay=class extends my{constructor(t){super(t,"AbortException")}};function bytesToString(t){"object"==typeof t&&void 0!==t?.length||unreachable("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 stringToBytes(t){"string"!=typeof t&&unreachable("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}var ky=class{static get isLittleEndian(){return shadow(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return shadow(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return shadow(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get isImageDecoderSupported(){return shadow(this,"isImageDecoderSupported","undefined"!=typeof ImageDecoder)}static get platform(){const{platform:t,userAgent:e}=navigator;return shadow(this,"platform",{isAndroid:e.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:e.includes("Firefox")})}static get isCSSRoundSupported(){return shadow(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}},Sy=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0")),Cy=class{static makeHexColor(t,e,s){return`#${Sy[t]}${Sy[e]}${Sy[s]}`}static domMatrixToTransform(t){return[t.a,t.b,t.c,t.d,t.e,t.f]}static scaleMinMax(t,e){let s;t[0]?(t[0]<0&&(s=e[0],e[0]=e[2],e[2]=s),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(s=e[1],e[1]=e[3],e[3]=s),e[1]*=t[3],e[3]*=t[3]):(s=e[0],e[0]=e[1],e[1]=s,s=e[2],e[2]=e[3],e[3]=s,t[1]<0&&(s=e[1],e[1]=e[3],e[3]=s),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(s=e[0],e[0]=e[2],e[2]=s),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],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 multiplyByDOMMatrix(t,e){return[t[0]*e.a+t[2]*e.b,t[1]*e.a+t[3]*e.b,t[0]*e.c+t[2]*e.d,t[1]*e.c+t[3]*e.d,t[0]*e.e+t[2]*e.f+t[4],t[1]*e.e+t[3]*e.f+t[5]]}static applyTransform(t,e,s=0){const i=t[s],n=t[s+1];t[s]=i*e[0]+n*e[2]+e[4],t[s+1]=i*e[1]+n*e[3]+e[5]}static applyTransformToBezier(t,e,s=0){const i=e[0],n=e[1],a=e[2],r=e[3],o=e[4],l=e[5];for(let e=0;e<6;e+=2){const c=t[s+e],h=t[s+e+1];t[s+e]=c*i+h*a+o,t[s+e+1]=c*n+h*r+l}}static applyInverseTransform(t,e){const s=t[0],i=t[1],n=e[0]*e[3]-e[1]*e[2];t[0]=(s*e[3]-i*e[2]+e[2]*e[5]-e[4]*e[3])/n,t[1]=(-s*e[1]+i*e[0]+e[4]*e[1]-e[5]*e[0])/n}static axialAlignedBoundingBox(t,e,s){const i=e[0],n=e[1],a=e[2],r=e[3],o=e[4],l=e[5],c=t[0],h=t[1],u=t[2],d=t[3];let f=i*c+o,g=f,p=i*u+o,m=p,b=r*h+l,w=b,y=r*d+l,x=y;if(0!==n||0!==a){const t=n*c,e=n*u,s=a*h,i=a*d;f+=s,m+=s,p+=i,g+=i,b+=t,x+=t,y+=e,w+=e}s[0]=Math.min(s[0],f,p,g,m),s[1]=Math.min(s[1],b,y,w,x),s[2]=Math.max(s[2],f,p,g,m),s[3]=Math.max(s[3],b,y,w,x)}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,e){const s=t[0],i=t[1],n=t[2],a=t[3],r=s**2+i**2,o=s*n+i*a,l=n**2+a**2,c=(r+l)/2,h=Math.sqrt(c**2-(r*l-o**2));e[0]=Math.sqrt(c+h||1),e[1]=Math.sqrt(c-h||1)}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 pointBoundingBox(t,e,s){s[0]=Math.min(s[0],t),s[1]=Math.min(s[1],e),s[2]=Math.max(s[2],t),s[3]=Math.max(s[3],e)}static rectBoundingBox(t,e,s,i,n){n[0]=Math.min(n[0],t,s),n[1]=Math.min(n[1],e,i),n[2]=Math.max(n[2],t,s),n[3]=Math.max(n[3],e,i)}static#t(t,e,s,i,n,a,r,o,l,c){if(l<=0||l>=1)return;const h=1-l,u=l*l,d=u*l,f=h*(h*(h*t+3*l*e)+3*u*s)+d*i,g=h*(h*(h*n+3*l*a)+3*u*r)+d*o;c[0]=Math.min(c[0],f),c[1]=Math.min(c[1],g),c[2]=Math.max(c[2],f),c[3]=Math.max(c[3],g)}static#e(t,e,s,i,n,a,r,o,l,c,h,u){if(Math.abs(l)<1e-12)return void(Math.abs(c)>=1e-12&&this.#t(t,e,s,i,n,a,r,o,-h/c,u));const d=c**2-4*h*l;if(d<0)return;const f=Math.sqrt(d),g=2*l;this.#t(t,e,s,i,n,a,r,o,(-c+f)/g,u),this.#t(t,e,s,i,n,a,r,o,(-c-f)/g,u)}static bezierBoundingBox(t,e,s,i,n,a,r,o,l){l[0]=Math.min(l[0],t,r),l[1]=Math.min(l[1],e,o),l[2]=Math.max(l[2],t,r),l[3]=Math.max(l[3],e,o),this.#e(t,s,n,r,e,i,a,o,3*(3*(s-n)-t+r),6*(t-2*s+n),3*(s-t),l),this.#e(t,s,n,r,e,i,a,o,3*(3*(i-a)-e+o),6*(e-2*i+a),3*(i-e),l)}},_y=null,Iy=null;function normalizeUnicode(t){return _y||(_y=/([\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,Iy=new Map([["ſt","ſt"]])),t.replaceAll(_y,(t,e,s)=>e?e.normalize("NFKC"):Iy.get(s))}function getUuid(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID();const t=new Uint8Array(32);return crypto.getRandomValues(t),bytesToString(t)}var Ty="pdfjs_internal_id_";function MathClamp(t,e,s){return Math.min(Math.max(t,e),s)}function toBase64Util(t){return Uint8Array.prototype.toBase64?t.toBase64():btoa(bytesToString(t))}"function"!=typeof Promise.try&&(Promise.try=function(t,...e){return new Promise(s=>{s(t(...e))})}),"function"!=typeof Math.sumPrecise&&(Math.sumPrecise=function(t){return t.reduce((t,e)=>t+e,0)});var My=class _XfaText{static textContent(t){const e=[],s={items:e,styles:Object.create(null)};return function walk(t){if(!t)return;let s=null;const i=t.name;if("#text"===i)s=t.value;else{if(!_XfaText.shouldBuildText(i))return;t?.attributes?.textContent?s=t.attributes.textContent:t.value&&(s=t.value)}if(null!==s&&e.push({str:s}),t.children)for(const e of t.children)walk(e)}(t),s}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}},Ey=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({html:t,element:e,storage:s=null,intent:i,linkService:n}){const{attributes:a}=e,r=t instanceof HTMLAnchorElement;"radio"===a.type&&(a.name=`${a.name}-${i}`);for(const[e,s]of Object.entries(a))if(null!=s)switch(e){case"class":s.length&&t.setAttribute(e,s.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",s);break;case"style":Object.assign(t.style,s);break;case"textContent":t.textContent=s;break;default:(!r||"href"!==e&&"newWindow"!==e)&&t.setAttribute(e,s)}r&&n.addLinkAttributes(t,a.href,a.newWindow),s&&a.dataId&&this.setupStorage(t,a.dataId,e,s)}static render(t){const e=t.annotationStorage,s=t.linkService,i=t.xfaHtml,n=t.intent||"display",a=document.createElement(i.name);i.attributes&&this.setAttributes({html:a,element:i,intent:n,linkService:s});const r="richText"!==n,o=t.div;if(o.append(a),t.viewport){const e=`matrix(${t.viewport.transform.join(",")})`;o.style.transform=e}r&&o.setAttribute("class","xfaLayer xfaFont");const l=[];if(0===i.children.length){if(i.value){const t=document.createTextNode(i.value);a.append(t),r&&My.shouldBuildText(i.name)&&l.push(t)}return{textDivs:l}}const c=[[i,-1,a]];for(;c.length>0;){const[t,i,a]=c.at(-1);if(i+1===t.children.length){c.pop();continue}const o=t.children[++c.at(-1)[1]];if(null===o)continue;const{name:h}=o;if("#text"===h){const t=document.createTextNode(o.value);l.push(t),a.append(t);continue}const u=o?.attributes?.xmlns?document.createElementNS(o.attributes.xmlns,h):document.createElement(h);if(a.append(u),o.attributes&&this.setAttributes({html:u,element:o,storage:e,intent:n,linkService:s}),o.children?.length>0)c.push([o,-1,u]);else if(o.value){const t=document.createTextNode(o.value);r&&My.shouldBuildText(h)&&l.push(t),u.append(t)}}for(const t of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}},Fy="http://www.w3.org/2000/svg",Dy=class{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF};async function fetchData(t,e="text"){if(isValidFetchUrl(t,document.baseURI)){const s=await fetch(t);if(!s.ok)throw new Error(s.statusText);switch(e){case"arraybuffer":return s.arrayBuffer();case"blob":return s.blob();case"json":return s.json()}return s.text()}return new Promise((s,i)=>{const n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType=e,n.onreadystatechange=()=>{if(n.readyState===XMLHttpRequest.DONE)if(200!==n.status&&0!==n.status)i(new Error(n.statusText));else{switch(e){case"arraybuffer":case"blob":case"json":return void s(n.response)}s(n.responseText)}},n.send(null)})}var Ry=class _PageViewport{constructor({viewBox:t,userUnit:e,scale:s,rotation:i,offsetX:n=0,offsetY:a=0,dontFlip:r=!1}){this.viewBox=t,this.userUnit=e,this.scale=s,this.rotation=i,this.offsetX=n,this.offsetY=a,s*=e;const o=(t[2]+t[0])/2,l=(t[3]+t[1])/2;let c,h,u,d,f,g,p,m;switch((i%=360)<0&&(i+=360),i){case 180:c=-1,h=0,u=0,d=1;break;case 90:c=0,h=1,u=1,d=0;break;case 270:c=0,h=-1,u=-1,d=0;break;case 0:c=1,h=0,u=0,d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}r&&(u=-u,d=-d),0===c?(f=Math.abs(l-t[1])*s+n,g=Math.abs(o-t[0])*s+a,p=(t[3]-t[1])*s,m=(t[2]-t[0])*s):(f=Math.abs(o-t[0])*s+n,g=Math.abs(l-t[1])*s+a,p=(t[2]-t[0])*s,m=(t[3]-t[1])*s),this.transform=[c*s,h*s,u*s,d*s,f-c*s*o-u*s*l,g-h*s*o-d*s*l],this.width=p,this.height=m}get rawDims(){const t=this.viewBox;return shadow(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:s=this.offsetX,offsetY:i=this.offsetY,dontFlip:n=!1}={}){return new _PageViewport({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:e,offsetX:s,offsetY:i,dontFlip:n})}convertToViewportPoint(t,e){const s=[t,e];return Cy.applyTransform(s,this.transform),s}convertToViewportRectangle(t){const e=[t[0],t[1]];Cy.applyTransform(e,this.transform);const s=[t[2],t[3]];return Cy.applyTransform(s,this.transform),[e[0],e[1],s[0],s[1]]}convertToPdfPoint(t,e){const s=[t,e];return Cy.applyInverseTransform(s,this.transform),s}},By=class extends my{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}};function isDataScheme(t){const e=t.length;let s=0;for(;s<e&&""===t[s].trim();)s++;return"data:"===t.substring(s,s+5).toLowerCase()}function isPdfFile(t){return"string"==typeof t&&/\.pdf$/i.test(t)}function getFilenameFromUrl(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function getPdfFilenameFromUrl(t,e="document.pdf"){if("string"!=typeof t)return e;if(isDataScheme(t))return warn('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const s=(t=>{try{return new URL(t)}catch{try{return new URL(decodeURIComponent(t))}catch{try{return new URL(t,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(t),"https://foo.bar")}catch{return null}}}}})(t);if(!s)return e;const decode=t=>{try{let e=decodeURIComponent(t);return e.includes("/")?(e=e.split("/").at(-1),e.test(/^\.pdf$/i)?e:t):e}catch{return t}},i=/\.pdf$/i,n=s.pathname.split("/").at(-1);if(i.test(n))return decode(n);if(s.searchParams.size>0){const t=Array.from(s.searchParams.values()).reverse();for(const e of t)if(i.test(e))return decode(e);const e=Array.from(s.searchParams.keys()).reverse();for(const t of e)if(i.test(t))return decode(t)}if(s.hash){const t=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(s.hash);if(t)return decode(t[0])}return e}var Py=class{started=Object.create(null);times=[];time(t){t in this.started&&warn(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||warn(`Timer has not been started for ${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:t}of this.times)e=Math.max(t.length,e);for(const{name:s,start:i,end:n}of this.times)t.push(`${s.padEnd(e)} ${n-i}ms\n`);return t.join("")}};function isValidFetchUrl(t,e){const s=e?URL.parse(t,e):URL.parse(t);return"http:"===s?.protocol||"https:"===s?.protocol}function noContextMenu(t){t.preventDefault()}function stopEvent(t){t.preventDefault(),t.stopPropagation()}var Ny=class{static#ue;static toDateObject(t){if(t instanceof Date)return t;if(!t||"string"!=typeof t)return null;this.#ue||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const e=this.#ue.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 h=parseInt(e[9],10)||0;return h=h>=0&&h<=59?h:0,"-"===l?(a+=c,r+=h):"+"===l&&(a-=c,r-=h),new Date(Date.UTC(s,i,n,a,r,o))}};function getXfaPageViewport(t,{scale:e=1,rotation:s=0}){const{width:i,height:n}=t.attributes.style,a=[0,0,parseInt(i),parseInt(n)];return new Ry({viewBox:a,userUnit:1,scale:e,rotation:s})}function getRGB(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):(warn(`Not a valid color format: "${t}"`),[0,0,0])}function getCurrentTransform(t){const{a:e,b:s,c:i,d:n,e:a,f:r}=t.getTransform();return[e,s,i,n,a,r]}function getCurrentTransformInverse(t){const{a:e,b:s,c:i,d:n,e:a,f:r}=t.getTransform().invertSelf();return[e,s,i,n,a,r]}function setLayerDimensions(t,e,s=!1,i=!0){if(e instanceof Ry){const{pageWidth:i,pageHeight:n}=e.rawDims,{style:a}=t,r=ky.isCSSRoundSupported,o=`var(--total-scale-factor) * ${i}px`,l=`var(--total-scale-factor) * ${n}px`,c=r?`round(down, ${o}, var(--scale-round-x))`:`calc(${o})`,h=r?`round(down, ${l}, var(--scale-round-y))`:`calc(${l})`;s&&e.rotation%180!=0?(a.width=h,a.height=c):(a.width=c,a.height=h)}i&&t.setAttribute("data-main-rotation",e.rotation)}var Oy=class _OutputScale{constructor(){const{pixelRatio:t}=_OutputScale;this.sx=t,this.sy=t}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}limitCanvas(t,e,s,i,n=-1){let a=1/0,r=1/0,o=1/0;(s=_OutputScale.capPixels(s,n))>0&&(a=Math.sqrt(s/(t*e))),-1!==i&&(r=i/t,o=i/e);const l=Math.min(a,r,o);return(this.sx>l||this.sy>l)&&(this.sx=l,this.sy=l,!0)}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){const s=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,s):s}return t}},Ly=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"],Uy=class{static get isDarkMode(){return shadow(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}},$y=class{static get commentForegroundColor(){const t=document.createElement("span");t.classList.add("comment","sidebar");const{style:e}=t;e.width=e.height="0",e.display="none",e.color="var(--comment-fg-color)",document.body.append(t);const{color:s}=window.getComputedStyle(t);return t.remove(),shadow(this,"commentForegroundColor",getRGB(s))}};function applyOpacity(t,e,s,i){const n=255*(1-(i=Math.min(Math.max(i??1,0),1)));return[t=Math.round(t*i+n),e=Math.round(e*i+n),s=Math.round(s*i+n)]}function RGBToHSL(t,e){const s=t[0]/255,i=t[1]/255,n=t[2]/255,a=Math.max(s,i,n),r=Math.min(s,i,n),o=(a+r)/2;if(a===r)e[0]=e[1]=0;else{const t=a-r;switch(e[1]=o<.5?t/(a+r):t/(2-a-r),a){case s:e[0]=60*((i-n)/t+(i<n?6:0));break;case i:e[0]=60*((n-s)/t+2);break;case n:e[0]=60*((s-i)/t+4)}}e[2]=o}function HSLToRGB(t,e){const s=t[0],i=t[1],n=t[2],a=(1-Math.abs(2*n-1))*i,r=a*(1-Math.abs(s/60%2-1)),o=n-a/2;switch(Math.floor(s/60)){case 0:e[0]=a+o,e[1]=r+o,e[2]=o;break;case 1:e[0]=r+o,e[1]=a+o,e[2]=o;break;case 2:e[0]=o,e[1]=a+o,e[2]=r+o;break;case 3:e[0]=o,e[1]=r+o,e[2]=a+o;break;case 4:e[0]=r+o,e[1]=o,e[2]=a+o;break;case 5:case 6:e[0]=a+o,e[1]=o,e[2]=r+o}}function computeLuminance(t){return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function contrastRatio(t,e,s){HSLToRGB(t,s),s.map(computeLuminance);const i=.2126*s[0]+.7152*s[1]+.0722*s[2];HSLToRGB(e,s),s.map(computeLuminance);const n=.2126*s[0]+.7152*s[1]+.0722*s[2];return i>n?(i+.05)/(n+.05):(n+.05)/(i+.05)}var Hy=new Map;function findContrastColor(t,e){const s=t[0]+256*t[1]+65536*t[2]+16777216*e[0]+4294967296*e[1]+1099511627776*e[2];let i=Hy.get(s);if(i)return i;const n=new Float32Array(9),a=n.subarray(0,3),r=n.subarray(3,6);RGBToHSL(t,r);const o=n.subarray(6,9);RGBToHSL(e,o);const l=o[2]<.5,c=l?12:4.5;if(r[2]=l?Math.sqrt(r[2]):1-Math.sqrt(1-r[2]),contrastRatio(r,o,a)<c){let t,e;l?(t=r[2],e=1):(t=0,e=r[2]);const s=.005;for(;e-t>s;){const s=r[2]=(t+e)/2;l===contrastRatio(r,o,a)<c?t=s:e=s}r[2]=l?e:t}return HSLToRGB(r,a),i=Cy.makeHexColor(Math.round(255*a[0]),Math.round(255*a[1]),Math.round(255*a[2])),Hy.set(s,i),i}function renderRichText({html:t,dir:e,className:s},i){const n=document.createDocumentFragment();if("string"==typeof t){const s=document.createElement("p");s.dir=e||"auto";const i=t.split(/(?:\r\n?|\n)/);for(let t=0,e=i.length;t<e;++t){const n=i[t];s.append(document.createTextNode(n)),t<e-1&&s.append(document.createElement("br"))}n.append(s)}else Ey.render({xfaHtml:t,div:n,intent:"richText"});n.firstChild.classList.add("richText",s),i.append(n)}var jy=class _EditorToolbar{#de=null;#fe=null;#ge;#pe=null;#me=null;#be=null;#we=null;#ye=null;static#xe=null;constructor(t){this.#ge=t,_EditorToolbar.#xe||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){const t=this.#de=document.createElement("div");t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const e=this.#ge._uiManager._signal;e instanceof AbortSignal&&!e.aborted&&(t.addEventListener("contextmenu",noContextMenu,{signal:e}),t.addEventListener("pointerdown",_EditorToolbar.#ve,{signal:e}));const s=this.#pe=document.createElement("div");s.className="buttons",t.append(s);const i=this.#ge.toolbarPosition;if(i){const{style:e}=t,s="ltr"===this.#ge._uiManager.direction?1-i[0]:i[0];e.insetInlineEnd=100*s+"%",e.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return t}get div(){return this.#de}static#ve(t){t.stopPropagation()}#Ae(t){this.#ge._focusEventsAllowed=!1,stopEvent(t)}#ke(t){this.#ge._focusEventsAllowed=!0,stopEvent(t)}#Se(t){const e=this.#ge._uiManager._signal;return e instanceof AbortSignal&&!e.aborted&&(t.addEventListener("focusin",this.#Ae.bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",this.#ke.bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",noContextMenu,{signal:e}),!0)}hide(){this.#de.classList.add("hidden"),this.#fe?.hideDropdown()}show(){this.#de.classList.remove("hidden"),this.#me?.shown(),this.#be?.shown()}addDeleteButton(){const{editorType:t,_uiManager:e}=this.#ge,s=document.createElement("button");s.classList.add("basic","deleteButton"),s.tabIndex=0,s.setAttribute("data-l10n-id",_EditorToolbar.#xe[t]),this.#Se(s)&&s.addEventListener("click",t=>{e.delete()},{signal:e._signal}),this.#pe.append(s)}get#Ce(){const t=document.createElement("div");return t.className="divider",t}async addAltText(t){const e=await t.render();this.#Se(e),this.#pe.append(e,this.#Ce),this.#me=t}addComment(t,e=null){if(this.#be)return;const s=t.renderForToolbar();if(!s)return;this.#Se(s);const i=this.#we=this.#Ce;e?(this.#pe.insertBefore(s,e),this.#pe.insertBefore(i,e)):this.#pe.append(s,i),this.#be=t,t.toolbar=this}addColorPicker(t){if(this.#fe)return;this.#fe=t;const e=t.renderButton();this.#Se(e),this.#pe.append(e,this.#Ce)}async addEditSignatureButton(t){const e=this.#ye=await t.renderEditButton(this.#ge);this.#Se(e),this.#pe.append(e,this.#Ce)}removeButton(t){"comment"===t&&(this.#be?.removeToolbarCommentButton(),this.#be=null,this.#we?.remove(),this.#we=null)}async addButton(t,e){switch(t){case"colorPicker":this.addColorPicker(e);break;case"altText":await this.addAltText(e);break;case"editSignature":await this.addEditSignatureButton(e);break;case"delete":this.addDeleteButton();break;case"comment":this.addComment(e)}}async addButtonBefore(t,e,s){const i=this.#pe.querySelector(s);i&&"comment"===t&&this.addComment(e,i)}updateEditSignatureButton(t){this.#ye&&(this.#ye.title=t)}remove(){this.#de.remove(),this.#fe?.destroy(),this.#fe=null}},qy=class{#pe=null;#de=null;#_e;constructor(t){this.#_e=t}#Ie(){const t=this.#de=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar");const e=this.#_e._signal;e instanceof AbortSignal&&!e.aborted&&t.addEventListener("contextmenu",noContextMenu,{signal:e});const s=this.#pe=document.createElement("div");return s.className="buttons",t.append(s),this.#_e.hasCommentManager()&&this.#Te("commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{this.#_e.commentSelection("floating_button")}),this.#Te("highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{this.#_e.highlightSelection("floating_button")}),t}#Me(t,e){let s=0,i=0;for(const n of t){const t=n.y+n.height;if(t<s)continue;const a=n.x+(e?n.width:0);t>s?(i=a,s=t):e?a>i&&(i=a):a<i&&(i=a)}return[e?1-i:i,s]}show(t,e,s){const[i,n]=this.#Me(e,s),{style:a}=this.#de||=this.#Ie();t.append(this.#de),a.insetInlineEnd=100*i+"%",a.top=`calc(${100*n}% + var(--editor-toolbar-vert-offset))`}hide(){this.#de.remove()}#Te(t,e,s,i){const n=document.createElement("button");n.classList.add("basic",t),n.tabIndex=0,n.setAttribute("data-l10n-id",e);const a=document.createElement("span");n.append(a),a.className="visuallyHidden",a.setAttribute("data-l10n-id",s);const r=this.#_e._signal;r instanceof AbortSignal&&!r.aborted&&(n.addEventListener("contextmenu",noContextMenu,{signal:r}),n.addEventListener("click",i,{signal:r})),this.#pe.append(n)}};function bindEvents(t,e,s){for(const i of s)e.addEventListener(i,t[i].bind(t))}var zy=class{#Ee=0;get id(){return`${Gw}${this.#Ee++}`}},Gy=class _ImageManager{#Fe=getUuid();#Ee=0;#De=null;static get _isSVGFittingCanvas(){const t=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),e=new Image;return 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>',shadow(this,"_isSVGFittingCanvas",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])))}async#Re(t,e){this.#De||=new Map;let s=this.#De.get(t);if(null===s)return null;if(s?.bitmap)return s.refCounter+=1,s;try{let t;if(s||={bitmap:null,id:`image_${this.#Fe}_${this.#Ee++}`,refCounter:0,isSvg:!1},"string"==typeof e?(s.url=e,t=await fetchData(e,"blob")):e instanceof File?t=s.file=e:e instanceof Blob&&(t=e),"image/svg+xml"===t.type){const e=_ImageManager._isSVGFittingCanvas,i=new FileReader,n=new Image,a=new Promise((t,a)=>{n.onload=()=>{s.bitmap=n,s.isSvg=!0,t()},i.onload=async()=>{const t=s.svgUrl=i.result;n.src=await e?`${t}#svgView(preserveAspectRatio(none))`:t},n.onerror=i.onerror=a});i.readAsDataURL(t),await a}else s.bitmap=await createImageBitmap(t);s.refCounter=1}catch(t){warn(t),s=null}return this.#De.set(t,s),s&&this.#De.set(s.id,s),s}async getFromFile(t){const{lastModified:e,name:s,size:i,type:n}=t;return this.#Re(`${e}_${s}_${i}_${n}`,t)}async getFromUrl(t){return this.#Re(t,t)}async getFromBlob(t,e){const s=await e;return this.#Re(t,s)}async getFromId(t){this.#De||=new Map;const e=this.#De.get(t);if(!e)return null;if(e.bitmap)return e.refCounter+=1,e;if(e.file)return this.getFromFile(e.file);if(e.blobPromise){const{blobPromise:t}=e;return delete e.blobPromise,this.getFromBlob(e.id,t)}return this.getFromUrl(e.url)}getFromCanvas(t,e){this.#De||=new Map;let s=this.#De.get(t);if(s?.bitmap)return s.refCounter+=1,s;const i=new OffscreenCanvas(e.width,e.height);return i.getContext("2d").drawImage(e,0,0),s={bitmap:i.transferToImageBitmap(),id:`image_${this.#Fe}_${this.#Ee++}`,refCounter:1,isSvg:!1},this.#De.set(t,s),this.#De.set(s.id,s),s}getSvgUrl(t){const e=this.#De.get(t);return e?.isSvg?e.svgUrl:null}deleteId(t){this.#De||=new Map;const e=this.#De.get(t);if(!e)return;if(e.refCounter-=1,0!==e.refCounter)return;const{bitmap:s}=e;if(!e.url&&!e.file){const t=new OffscreenCanvas(s.width,s.height);t.getContext("bitmaprenderer").transferFromImageBitmap(s),e.blobPromise=t.convertToBlob()}s.close?.(),e.bitmap=null}isValidId(t){return t.startsWith(`image_${this.#Fe}_`)}},Wy=class{#Be=[];#Pe=!1;#Ne;#Oe=-1;constructor(t=128){this.#Ne=t}add({cmd:t,undo:e,post:s,mustExec:i,type:n=NaN,overwriteIfSameType:a=!1,keepUndo:r=!1}){if(i&&t(),this.#Pe)return;const o={cmd:t,undo:e,post:s,type:n};if(-1===this.#Oe)return this.#Be.length>0&&(this.#Be.length=0),this.#Oe=0,void this.#Be.push(o);if(a&&this.#Be[this.#Oe].type===n)return r&&(o.undo=this.#Be[this.#Oe].undo),void(this.#Be[this.#Oe]=o);const l=this.#Oe+1;l===this.#Ne?this.#Be.splice(0,1):(this.#Oe=l,l<this.#Be.length&&this.#Be.splice(l)),this.#Be.push(o)}undo(){if(-1===this.#Oe)return;this.#Pe=!0;const{undo:t,post:e}=this.#Be[this.#Oe];t(),e?.(),this.#Pe=!1,this.#Oe-=1}redo(){if(this.#Oe<this.#Be.length-1){this.#Oe+=1,this.#Pe=!0;const{cmd:t,post:e}=this.#Be[this.#Oe];t(),e?.(),this.#Pe=!1}}hasSomethingToUndo(){return-1!==this.#Oe}hasSomethingToRedo(){return this.#Oe<this.#Be.length-1}cleanType(t){if(-1!==this.#Oe){for(let e=this.#Oe;e>=0;e--)if(this.#Be[e].type!==t)return this.#Be.splice(e+1,this.#Oe-e),void(this.#Oe=e);this.#Be.length=0,this.#Oe=-1}}destroy(){this.#Be=null}},Vy=class{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=ky.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)))}}#Le(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}exec(t,e){if(!this.allKeys.has(e.key))return;const s=this.callbacks.get(this.#Le(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,e)(),n||stopEvent(e))}},Xy=class _ColorManager{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return function(t){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const s of t.keys()){e.style.color=s;const i=window.getComputedStyle(e).color;t.set(s,getRGB(i))}e.remove()}(t),shadow(this,"_colors",t)}convert(t){const e=getRGB(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[t,s]of this._colors)if(s.every((t,s)=>t===e[s]))return _ColorManager._colorsMapping.get(t);return e}getHexCode(t){const e=this._colors.get(t);return e?Cy.makeHexColor(...e):t}},Ky=class _AnnotationEditorUIManager{#Ue=new AbortController;#$e=null;#He=null;#je=new Map;#qe=new Map;#ze=null;#Ge=null;#We=null;#Ve=new Wy;#Xe=null;#Ke=null;#Ye=null;#Je=0;#Ze=new Set;#Qe=null;#ts=null;#es=new Set;_editorUndoBar=null;#ss=!1;#is=!1;#ns=!1;#as=null;#rs=null;#os=null;#ls=null;#cs=!1;#hs=null;#us=new zy;#ds=!1;#fs=!1;#gs=!1;#ps=null;#ms=null;#bs=null;#ws=null;#ys=null;#xs=Ww.NONE;#vs=new Set;#As=null;#ks=null;#Ss=null;#Cs=null;#_s=null;#Is={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#Ts=[0,0];#Ms=null;#Es=null;#Fs=null;#Ds=null;#Rs=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const t=_AnnotationEditorUIManager.prototype,arrowChecker=t=>t.#Es.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),textInputChecker=(t,{target:e})=>{if(e instanceof HTMLInputElement){const{type:t}=e;return"text"!==t&&"number"!==t}return!0},e=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return shadow(this,"_keyboardManager",new Vy([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:textInputChecker}],[["ctrl+z","mac+meta+z"],t.undo,{checker:textInputChecker}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:textInputChecker}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:textInputChecker}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(t,{target:e})=>!(e instanceof HTMLButtonElement)&&t.#Es.contains(e)&&!t.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,{target:e})=>!(e instanceof HTMLButtonElement)&&t.#Es.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-e,0],checker:arrowChecker}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:arrowChecker}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[e,0],checker:arrowChecker}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:arrowChecker}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-e],checker:arrowChecker}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:arrowChecker}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,e],checker:arrowChecker}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:arrowChecker}]]))}constructor(t,e,s,i,n,a,r,o,l,c,h,u,d,f,g,p){const m=this._signal=this.#Ue.signal;this.#Es=t,this.#Fs=e,this.#Ds=s,this.#ze=i,this.#Xe=n,this.#ks=a,this.#_s=o,this._eventBus=r,r._on("editingaction",this.onEditingAction.bind(this),{signal:m}),r._on("pagechanging",this.onPageChanging.bind(this),{signal:m}),r._on("scalechanging",this.onScaleChanging.bind(this),{signal:m}),r._on("rotationchanging",this.onRotationChanging.bind(this),{signal:m}),r._on("setpreference",this.onSetPreference.bind(this),{signal:m}),r._on("switchannotationeditorparams",t=>this.updateParams(t.type,t.value),{signal:m}),window.addEventListener("pointerdown",()=>{this.#fs=!0},{capture:!0,signal:m}),window.addEventListener("pointerup",()=>{this.#fs=!1},{capture:!0,signal:m}),this.#Bs(),this.#Ps(),this.#Ns(),this.#Ge=o.annotationStorage,this.#as=o.filterFactory,this.#Ss=l,this.#ls=c||null,this.#ss=h,this.#is=u,this.#ns=d,this.#ys=f||null,this.viewParameters={realScale:Dy.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=g||null,this._supportsPinchToZoom=!1!==p,n?.setSidebarUiManager(this)}destroy(){this.#Rs?.resolve(),this.#Rs=null,this.#Ue?.abort(),this.#Ue=null,this._signal=null;for(const t of this.#qe.values())t.destroy();this.#qe.clear(),this.#je.clear(),this.#es.clear(),this.#ws?.clear(),this.#$e=null,this.#vs.clear(),this.#Ve.destroy(),this.#ze?.destroy(),this.#Xe?.destroy(),this.#ks?.destroy(),this.#hs?.hide(),this.#hs=null,this.#bs?.destroy(),this.#bs=null,this.#He=null,this.#rs&&(clearTimeout(this.#rs),this.#rs=null),this.#Ms&&(clearTimeout(this.#Ms),this.#Ms=null),this._editorUndoBar?.destroy(),this.#_s=null}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return this.#ys}get useNewAltTextFlow(){return this.#is}get useNewAltTextWhenAddingImage(){return this.#ns}get hcmFilter(){return shadow(this,"hcmFilter",this.#Ss?this.#as.addHCMFilter(this.#Ss.foreground,this.#Ss.background):"none")}get direction(){return shadow(this,"direction",getComputedStyle(this.#Es).direction)}get _highlightColors(){return shadow(this,"_highlightColors",this.#ls?new Map(this.#ls.split(",").map(t=>((t=t.split("=").map(t=>t.trim()))[1]=t[1].toUpperCase(),t))):null)}get highlightColors(){const{_highlightColors:t}=this;if(!t)return shadow(this,"highlightColors",null);const e=new Map,s=!!this.#Ss;for(const[i,n]of t){const t=i.endsWith("_HCM");s&&t?e.set(i.replace("_HCM",""),n):s||t||e.set(i,n)}return shadow(this,"highlightColors",e)}get highlightColorNames(){return shadow(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;const e=this.highlightColorNames.get(t);return this._highlightColors.get(e)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#Ye=t}setMainHighlightColorPicker(t){this.#bs=t}editAltText(t,e=!1){this.#ze?.editAltText(this,t,e)}hasCommentManager(){return!!this.#Xe}editComment(t,e,s,i){this.#Xe?.showDialog(this,t,e,s,i)}selectComment(t,e){const s=this.#qe.get(t),i=s?.getEditorByUID(e);i?.toggleComment(!0,!0)}updateComment(t){this.#Xe?.updateComment(t.getData())}updatePopupColor(t){this.#Xe?.updatePopupColor(t)}removeComment(t){this.#Xe?.removeComments([t.uid])}toggleComment(t,e,s=void 0){this.#Xe?.toggleCommentPopup(t,e,s)}makeCommentColor(t,e){return t&&this.#Xe?.makeCommentColor(t,e)||null}getCommentDialogElement(){return this.#Xe?.dialogElement||null}async waitForEditorsRendered(t){if(this.#qe.has(t-1))return;const{resolve:e,promise:s}=Promise.withResolvers(),onEditorsRendered=s=>{s.pageNumber===t&&(this._eventBus._off("editorsrendered",onEditorsRendered),e())};this._eventBus.on("editorsrendered",onEditorsRendered),await s}getSignature(t){this.#ks?.getSignature({uiManager:this,editor:t})}get signatureManager(){return this.#ks}switchToMode(t,e){this._eventBus.on("annotationeditormodechanged",e,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,e){this._eventBus.dispatch("setpreference",{source:this,name:t,value:e})}onSetPreference({name:t,value:e}){"enableNewAltTextWhenAddingImage"===t&&(this.#ns=e)}onPageChanging({pageNumber:t}){this.#Je=t-1}focusMainContainer(){this.#Es.focus()}findParent(t,e){for(const s of this.#qe.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(t=!1){this.#Fs.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#es.add(t)}removeShouldRescale(t){this.#es.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*Dy.PDF_TO_CSS_UNITS;for(const t of this.#es)t.onScaleChanging();this.#Ye?.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#Os({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}#Ls(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const e of this.#qe.values())if(e.hasTextLayer(t))return e;return null}highlightSelection(t="",e=!1){const s=document.getSelection();if(!s||s.isCollapsed)return;const{anchorNode:i,anchorOffset:n,focusNode:a,focusOffset:r}=s,o=s.toString(),l=this.#Os(s).closest(".textLayer"),c=this.getSelectionBoxes(l);if(!c)return;s.empty();const h=this.#Ls(l),u=this.#xs===Ww.NONE,callback=()=>{const s=h?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:c,anchorNode:i,anchorOffset:n,focusNode:a,focusOffset:r,text:o});u&&this.showAllEditors("highlight",!0,!0),e&&s?.editComment()};u?this.switchToMode(Ww.HIGHLIGHT,callback):callback()}commentSelection(t=""){this.highlightSelection(t,!0)}#Us(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=this.#Os(t).closest(".textLayer"),s=this.getSelectionBoxes(e);s&&(this.#hs||=new qy(this),this.#hs.show(e,s,"ltr"===this.direction))}getAndRemoveDataFromAnnotationStorage(t){if(!this.#Ge)return null;const e=`${Gw}${t}`,s=this.#Ge.getRawValue(e);return s&&this.#Ge.remove(e),s}addToAnnotationStorage(t){t.isEmpty()||!this.#Ge||this.#Ge.has(t.id)||this.#Ge.setValue(t.id,t)}a11yAlert(t,e=null){const s=this.#Ds;s&&(s.setAttribute("data-l10n-id",t),e?s.setAttribute("data-l10n-args",JSON.stringify(e)):s.removeAttribute("data-l10n-args"))}#$s(){const t=document.getSelection();if(!t||t.isCollapsed)return void(this.#As&&(this.#hs?.hide(),this.#As=null,this.#Hs({hasSelectedText:!1})));const{anchorNode:e}=t;if(e===this.#As)return;const s=this.#Os(t).closest(".textLayer");if(s){if(this.#hs?.hide(),this.#As=e,this.#Hs({hasSelectedText:!0}),(this.#xs===Ww.HIGHLIGHT||this.#xs===Ww.NONE)&&(this.#xs===Ww.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#cs=this.isShiftKeyDown,!this.isShiftKeyDown)){const t=this.#xs===Ww.HIGHLIGHT?this.#Ls(s):null;if(t?.toggleDrawing(),this.#fs){const e=new AbortController,s=this.combinedSignal(e),pointerup=s=>{"pointerup"===s.type&&0!==s.button||(e.abort(),t?.toggleDrawing(!0),"pointerup"===s.type&&this.#js("main_toolbar"))};window.addEventListener("pointerup",pointerup,{signal:s}),window.addEventListener("blur",pointerup,{signal:s})}else t?.toggleDrawing(!0),this.#js("main_toolbar")}}else this.#As&&(this.#hs?.hide(),this.#As=null,this.#Hs({hasSelectedText:!1}))}#js(t=""){this.#xs===Ww.HIGHLIGHT?this.highlightSelection(t):this.#ss&&this.#Us()}#Bs(){document.addEventListener("selectionchange",this.#$s.bind(this),{signal:this._signal})}#qs(){if(this.#os)return;this.#os=new AbortController;const t=this.combinedSignal(this.#os);window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})}#zs(){this.#os?.abort(),this.#os=null}blur(){if(this.isShiftKeyDown=!1,this.#cs&&(this.#cs=!1,this.#js("main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of this.#vs)if(e.div.contains(t)){this.#ms=[e,t],e._focusEventsAllowed=!1;break}}focus(){if(!this.#ms)return;const[t,e]=this.#ms;this.#ms=null,e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}#Ns(){if(this.#ps)return;this.#ps=new AbortController;const t=this.combinedSignal(this.#ps);window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})}#Gs(){this.#ps?.abort(),this.#ps=null}#Ws(){if(this.#Ke)return;this.#Ke=new AbortController;const t=this.combinedSignal(this.#Ke);document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})}#Vs(){this.#Ke?.abort(),this.#Ke=null}#Ps(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#Ns(),this.#Ws()}removeEditListeners(){this.#Gs(),this.#Vs()}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const s of this.#ts)if(s.isHandlingMimeForPasting(e))return t.dataTransfer.dropEffect="copy",void t.preventDefault()}drop(t){for(const e of t.dataTransfer.items)for(const s of this.#ts)if(s.isHandlingMimeForPasting(e.type))return s.paste(e,this.currentLayer),void t.preventDefault()}copy(t){if(t.preventDefault(),this.#$e?.commitOrRemove(),!this.hasSelection)return;const e=[];for(const t of this.#vs){const s=t.serialize(!0);s&&e.push(s)}0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();const{clipboardData:e}=t;for(const t of e.items)for(const e of this.#ts)if(e.isHandlingMimeForPasting(t.type))return void e.paste(t,this.currentLayer);let s=e.getData("application/pdfjs");if(!s)return;try{s=JSON.parse(s)}catch(t){return void warn(`paste: "${t.message}".`)}if(!Array.isArray(s))return;this.unselectAll();const i=this.currentLayer;try{const t=[];for(const e of s){const s=await i.deserialize(e);if(!s)return;t.push(s)}const cmd=()=>{for(const e of t)this.#Xs(e);this.#Ks(t)},undo=()=>{for(const e of t)e.remove()};this.addCommands({cmd,undo,mustExec:!0})}catch(t){warn(`paste: "${t.message}".`)}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0),this.#xs===Ww.NONE||this.isEditorHandlingKeyboard||_AnnotationEditorUIManager._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,this.#cs&&(this.#cs=!1,this.#js("main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu")}}#Hs(t){Object.entries(t).some(([t,e])=>this.#Is[t]!==e)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#Is,t)}),this.#xs===Ww.HIGHLIGHT&&!1===t.hasSelectedEditor&&this.#Ys([[Vw.HIGHLIGHT_FREE,!0]]))}#Ys(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#qs(),this.#Ws(),this.#Hs({isEditing:this.#xs!==Ww.NONE,isEmpty:this.#Js(),hasSomethingToUndo:this.#Ve.hasSomethingToUndo(),hasSomethingToRedo:this.#Ve.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#zs(),this.#Vs(),this.#Hs({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#ts){this.#ts=t;for(const t of this.#ts)this.#Ys(t.defaultPropertiesToUpdate)}}getId(){return this.#us.id}get currentLayer(){return this.#qe.get(this.#Je)}getLayer(t){return this.#qe.get(t)}get currentPageIndex(){return this.#Je}addLayer(t){this.#qe.set(t.pageIndex,t),this.#ds?t.enable():t.disable()}removeLayer(t){this.#qe.delete(t.pageIndex)}async updateMode(t,e=null,s=!1,i=!1,n=!1){if(this.#xs!==t&&(!this.#Rs||(await this.#Rs.promise,this.#Rs))){if(this.#Rs=Promise.withResolvers(),this.#Ye?.commitOrRemove(),this.#xs===Ww.POPUP&&this.#Xe?.hideSidebar(),this.#Xe?.destroyPopup(),this.#xs=t,t===Ww.NONE){this.setEditingState(!1),this.#Zs();for(const t of this.#je.values())t.hideStandaloneCommentButton();return this._editorUndoBar?.hide(),this.toggleComment(null),void this.#Rs.resolve()}for(const t of this.#je.values())t.addStandaloneCommentButton();t===Ww.SIGNATURE&&await(this.#ks?.loadSignatures()),this.setEditingState(!0),await this.#Qs(),this.unselectAll();for(const e of this.#qe.values())e.updateMode(t);if(t===Ww.POPUP){this.#He||=await this.#_s.getAnnotationsByType(new Set(this.#ts.map(t=>t._editorType)));const t=new Set,e=[];for(const s of this.#je.values()){const{annotationElementId:i,hasComment:n,deleted:a}=s;i&&t.add(i),n&&!a&&e.push(s.getData())}for(const s of this.#He){const{id:i,popupRef:n,contentsObj:a}=s;n&&a?.str&&!t.has(i)&&!this.#Ze.has(i)&&e.push(s)}this.#Xe?.showSidebar(e)}if(!e)return s&&this.addNewEditorFromKeyboard(),void this.#Rs.resolve();for(const t of this.#je.values())t.uid===e?(this.setSelected(t),n?t.editComment():i?t.enterInEditMode():t.focus()):t.unselect();this.#Rs.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==this.#xs&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,e){if(this.#ts){switch(t){case Vw.CREATE:return void this.currentLayer.addNewEditor(e);case Vw.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#Cs||=new Map).set(t,e),this.showAllEditors("highlight",e)}if(this.hasSelection)for(const s of this.#vs)s.updateParams(t,e);else for(const s of this.#ts)s.updateDefaultParams(t,e)}}showAllEditors(t,e,s=!1){for(const s of this.#je.values())s.editorType===t&&s.show(e);(this.#Cs?.get(Vw.HIGHLIGHT_SHOW_ALL)??!0)!==e&&this.#Ys([[Vw.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(this.#gs!==t){this.#gs=t;for(const e of this.#qe.values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}async#Qs(){if(!this.#ds){this.#ds=!0;const t=[];for(const e of this.#qe.values())t.push(e.enable());await Promise.all(t);for(const t of this.#je.values())t.enable()}}#Zs(){if(this.unselectAll(),this.#ds){this.#ds=!1;for(const t of this.#qe.values())t.disable();for(const t of this.#je.values())t.disable()}}*getEditors(t){for(const e of this.#je.values())e.pageIndex===t&&(yield e)}getEditor(t){return this.#je.get(t)}addEditor(t){this.#je.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#rs&&clearTimeout(this.#rs),this.#rs=setTimeout(()=>{this.focusMainContainer(),this.#rs=null},0)),this.#je.delete(t.id),t.annotationElementId&&this.#ws?.delete(t.annotationElementId),this.unselect(t),t.annotationElementId&&this.#Ze.has(t.annotationElementId)||this.#Ge?.remove(t.id)}addDeletedAnnotationElement(t){this.#Ze.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#Ze.has(t)}removeDeletedAnnotationElement(t){this.#Ze.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#Xs(t){const e=this.#qe.get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#$e!==t&&(this.#$e=t,t&&this.#Ys(t.propertiesToUpdate))}get#ti(){let t=null;for(t of this.#vs);return t}updateUI(t){this.#ti===t&&this.#Ys(t.propertiesToUpdate)}updateUIForDefaultProperties(t){this.#Ys(t.defaultPropertiesToUpdate)}toggleSelected(t){if(this.#vs.has(t))return this.#vs.delete(t),t.unselect(),void this.#Hs({hasSelectedEditor:this.hasSelection});this.#vs.add(t),t.select(),this.#Ys(t.propertiesToUpdate),this.#Hs({hasSelectedEditor:!0})}setSelected(t){this.updateToolbar({mode:t.mode,editId:t.id}),this.#Ye?.commitOrRemove();for(const e of this.#vs)e!==t&&e.unselect();this.#vs.clear(),this.#vs.add(t),t.select(),this.#Ys(t.propertiesToUpdate),this.#Hs({hasSelectedEditor:!0})}isSelected(t){return this.#vs.has(t)}get firstSelectedEditor(){return this.#vs.values().next().value}unselect(t){t.unselect(),this.#vs.delete(t),this.#Hs({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#vs.size}get isEnterHandled(){return 1===this.#vs.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#Ve.undo(),this.#Hs({hasSomethingToUndo:this.#Ve.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#Js()}),this._editorUndoBar?.hide()}redo(){this.#Ve.redo(),this.#Hs({hasSomethingToUndo:!0,hasSomethingToRedo:this.#Ve.hasSomethingToRedo(),isEmpty:this.#Js()})}addCommands(t){this.#Ve.add(t),this.#Hs({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#Js()})}cleanUndoStack(t){this.#Ve.cleanType(t)}#Js(){if(0===this.#je.size)return!0;if(1===this.#je.size)for(const t of this.#je.values())return t.isEmpty();return!1}delete(){this.commitOrRemove();const t=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!t)return;const e=t?[t]:[...this.#vs],undo=()=>{for(const t of e)this.#Xs(t)};this.addCommands({cmd:()=>{this._editorUndoBar?.show(undo,1===e.length?e[0].editorType:e.length);for(const t of e)t.remove()},undo,mustExec:!0})}commitOrRemove(){this.#$e?.commitOrRemove()}hasSomethingToControl(){return this.#$e||this.hasSelection}#Ks(t){for(const t of this.#vs)t.unselect();this.#vs.clear();for(const e of t)e.isEmpty()||(this.#vs.add(e),e.select());this.#Hs({hasSelectedEditor:this.hasSelection})}selectAll(){for(const t of this.#vs)t.commit();this.#Ks(this.#je.values())}unselectAll(){if((!this.#$e||(this.#$e.commitOrRemove(),this.#xs===Ww.NONE))&&!this.#Ye?.commitOrRemove()&&this.hasSelection){for(const t of this.#vs)t.unselect();this.#vs.clear(),this.#Hs({hasSelectedEditor:!1})}}translateSelectedEditors(t,e,s=!1){if(s||this.commitOrRemove(),!this.hasSelection)return;this.#Ts[0]+=t,this.#Ts[1]+=e;const[i,n]=this.#Ts,a=[...this.#vs];this.#Ms&&clearTimeout(this.#Ms),this.#Ms=setTimeout(()=>{this.#Ms=null,this.#Ts[0]=this.#Ts[1]=0,this.addCommands({cmd:()=>{for(const t of a)this.#je.has(t.id)&&(t.translateInPage(i,n),t.translationDone())},undo:()=>{for(const t of a)this.#je.has(t.id)&&(t.translateInPage(-i,-n),t.translationDone())},mustExec:!1})},1e3);for(const s of a)s.translateInPage(t,e),s.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#Qe=new Map;for(const t of this.#vs)this.#Qe.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#Qe)return!1;this.disableUserSelect(!1);const t=this.#Qe;this.#Qe=null;let e=!1;for(const[{x:s,y:i,pageIndex:n},a]of t)a.newX=s,a.newY=i,a.newPageIndex=n,e||=s!==a.savedX||i!==a.savedY||n!==a.savedPageIndex;if(!e)return!1;const move=(t,e,s,i)=>{if(this.#je.has(t.id)){const n=this.#qe.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:s,newY:i,newPageIndex:n}]of t)move(e,s,i,n)},undo:()=>{for(const[e,{savedX:s,savedY:i,savedPageIndex:n}]of t)move(e,s,i,n)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(this.#Qe)for(const s of this.#Qe.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)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||1===this.#vs.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#$e===t}getActive(){return this.#$e}getMode(){return this.#xs}isEditingMode(){return this.#xs!==Ww.NONE}get imageManager(){return shadow(this,"imageManager",new Gy)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let s=0,i=e.rangeCount;s<i;s++)if(!t.contains(e.getRangeAt(s).commonAncestorContainer))return null;const{x:s,y:i,width:n,height:a}=t.getBoundingClientRect();let r;switch(t.getAttribute("data-main-rotation")){case"90":r=(t,e,r,o)=>({x:(e-i)/a,y:1-(t+r-s)/n,width:o/a,height:r/n});break;case"180":r=(t,e,r,o)=>({x:1-(t+r-s)/n,y:1-(e+o-i)/a,width:r/n,height:o/a});break;case"270":r=(t,e,r,o)=>({x:1-(e+o-i)/a,y:(t-s)/n,width:o/a,height:r/n});break;default:r=(t,e,r,o)=>({x:(t-s)/n,y:(e-i)/a,width:r/n,height:o/a})}const o=[];for(let t=0,s=e.rangeCount;t<s;t++){const s=e.getRangeAt(t);if(!s.collapsed)for(const{x:t,y:e,width:i,height:n}of s.getClientRects())0!==i&&0!==n&&o.push(r(t,e,i,n))}return 0===o.length?null:o}addChangedExistingAnnotation({annotationElementId:t,id:e}){(this.#We||=new Map).set(t,e)}removeChangedExistingAnnotation({annotationElementId:t}){this.#We?.delete(t)}renderAnnotationElement(t){const e=this.#We?.get(t.data.id);if(!e)return;const s=this.#Ge.getRawValue(e);s&&(this.#xs!==Ww.NONE||s.hasBeenModified)&&s.renderAnnotationElement(t)}setMissingCanvas(t,e,s){const i=this.#ws?.get(t);i&&(i.setCanvas(e,s),this.#ws.delete(t))}addMissingCanvas(t,e){(this.#ws||=new Map).set(t,e)}},Yy=class _AltText{#me=null;#ei=!1;#si=null;#ii=null;#ni=null;#ai=null;#ri=!1;#oi=null;#ge=null;#li=null;#ci=null;#hi=!1;static#ui=null;static _l10n=null;constructor(t){this.#ge=t,this.#hi=t._uiManager.useNewAltTextFlow,_AltText.#ui||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(t){_AltText._l10n??=t}async render(){const t=this.#si=document.createElement("button");t.className="altText",t.tabIndex="0";const e=this.#ii=document.createElement("span");t.append(e),this.#hi?(t.classList.add("new"),t.setAttribute("data-l10n-id",_AltText.#ui.missing),e.setAttribute("data-l10n-id",_AltText.#ui["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const s=this.#ge._uiManager._signal;t.addEventListener("contextmenu",noContextMenu,{signal:s}),t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:s});const onClick=t=>{t.preventDefault(),this.#ge._uiManager.editAltText(this.#ge),this.#hi&&this.#ge._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#di}})};return t.addEventListener("click",onClick,{capture:!0,signal:s}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&(this.#ri=!0,onClick(e))},{signal:s}),await this.#fi(),t}get#di(){return(this.#me?"added":null===this.#me&&this.guessedText&&"review")||"missing"}finish(){this.#si&&(this.#si.focus({focusVisible:this.#ri}),this.#ri=!1)}isEmpty(){return this.#hi?null===this.#me:!this.#me&&!this.#ei}hasData(){return this.#hi?null!==this.#me||!!this.#li:this.isEmpty()}get guessedText(){return this.#li}async setGuessedText(t){null===this.#me&&(this.#li=t,this.#ci=await _AltText._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t}),this.#fi())}toggleAltTextBadge(t=!1){if(!this.#hi||this.#me)return this.#oi?.remove(),void(this.#oi=null);if(!this.#oi){const t=this.#oi=document.createElement("div");t.className="noAltTextBadge",this.#ge.div.append(t)}this.#oi.classList.toggle("hidden",!t)}serialize(t){let e=this.#me;return t||this.#li!==e||(e=this.#ci),{altText:e,decorative:this.#ei,guessedText:this.#li,textWithDisclaimer:this.#ci}}get data(){return{altText:this.#me,decorative:this.#ei}}set data({altText:t,decorative:e,guessedText:s,textWithDisclaimer:i,cancel:n=!1}){s&&(this.#li=s,this.#ci=i),this.#me===t&&this.#ei===e||(n||(this.#me=t,this.#ei=e),this.#fi())}toggle(t=!1){this.#si&&(!t&&this.#ai&&(clearTimeout(this.#ai),this.#ai=null),this.#si.disabled=!t)}shown(){this.#ge._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#di}})}destroy(){this.#si?.remove(),this.#si=null,this.#ii=null,this.#ni=null,this.#oi?.remove(),this.#oi=null}async#fi(){const t=this.#si;if(!t)return;if(this.#hi){if(t.classList.toggle("done",!!this.#me),t.setAttribute("data-l10n-id",_AltText.#ui[this.#di]),this.#ii?.setAttribute("data-l10n-id",_AltText.#ui[`${this.#di}-label`]),!this.#me)return void this.#ni?.remove()}else{if(!this.#me&&!this.#ei)return t.classList.remove("done"),void this.#ni?.remove();t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let e=this.#ni;if(!e){this.#ni=e=document.createElement("span"),e.className="tooltip",e.setAttribute("role","tooltip"),e.id=`alt-text-tooltip-${this.#ge.id}`;const s=100,i=this.#ge._uiManager._signal;i.addEventListener("abort",()=>{clearTimeout(this.#ai),this.#ai=null},{once:!0}),t.addEventListener("mouseenter",()=>{this.#ai=setTimeout(()=>{this.#ai=null,this.#ni.classList.add("show"),this.#ge._reportTelemetry({action:"alt_text_tooltip"})},s)},{signal:i}),t.addEventListener("mouseleave",()=>{this.#ai&&(clearTimeout(this.#ai),this.#ai=null),this.#ni?.classList.remove("show")},{signal:i})}this.#ei?e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(e.removeAttribute("data-l10n-id"),e.textContent=this.#me),e.parentNode||t.append(e);const s=this.#ge.getElementForAltText();s?.setAttribute("aria-describedby",e.id)}},Jy=class{#gi=null;#pi=null;#mi=!1;#ge=null;#bi=null;#wi=null;#Rt=null;#yi=null;#xi=!1;#vi=null;constructor(t){this.#ge=t}renderForToolbar(){const t=this.#pi=document.createElement("button");return t.className="comment",this.#Ie(t,!1)}renderForStandalone(){const t=this.#gi=document.createElement("button");t.className="annotationCommentButton";const e=this.#ge.commentButtonPosition;if(e){const{style:s}=t;s.insetInlineEnd=`calc(${100*("ltr"===this.#ge._uiManager.direction?1-e[0]:e[0])}% - var(--comment-button-dim))`,s.top=`calc(${100*e[1]}% - var(--comment-button-dim))`;const i=this.#ge.commentButtonColor;i&&(s.backgroundColor=i)}return this.#Ie(t,!0)}focusButton(){setTimeout(()=>{(this.#gi??this.#pi)?.focus()},0)}onUpdatedColor(){if(!this.#gi)return;const t=this.#ge.commentButtonColor;t&&(this.#gi.style.backgroundColor=t),this.#ge._uiManager.updatePopupColor(this.#ge)}get commentButtonWidth(){return(this.#gi?.getBoundingClientRect().width??0)/this.#ge.parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(this.#vi)return this.#vi;if(!this.#gi)return null;const{x:t,y:e,height:s}=this.#gi.getBoundingClientRect(),{x:i,y:n,width:a,height:r}=this.#ge.parent.boundingClientRect;return[(t-i)/a,(e+s-n)/r]}set commentPopupPositionInLayer(t){this.#vi=t}hasDefaultPopupPosition(){return null===this.#vi}removeStandaloneCommentButton(){this.#gi?.remove(),this.#gi=null}removeToolbarCommentButton(){this.#pi?.remove(),this.#pi=null}setCommentButtonStates({selected:t,hasPopup:e}){this.#gi&&(this.#gi.classList.toggle("selected",t),this.#gi.ariaExpanded=e)}#Ie(t,e){if(!this.#ge._uiManager.hasCommentManager())return null;t.tabIndex="0",t.ariaHasPopup="dialog",e?(t.ariaControls="commentPopup",t.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(t.ariaControlsElements=[this.#ge._uiManager.getCommentDialogElement()],t.setAttribute("data-l10n-id","pdfjs-editor-edit-comment-button"));const s=this.#ge._uiManager._signal;if(!(s instanceof AbortSignal)||s.aborted)return t;t.addEventListener("contextmenu",noContextMenu,{signal:s}),e&&(t.addEventListener("focusin",t=>{this.#ge._focusEventsAllowed=!1,stopEvent(t)},{capture:!0,signal:s}),t.addEventListener("focusout",t=>{this.#ge._focusEventsAllowed=!0,stopEvent(t)},{capture:!0,signal:s})),t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:s});const onClick=e=>{e.preventDefault(),t===this.#pi?this.edit():this.#ge.toggleComment(!0)};return t.addEventListener("click",onClick,{capture:!0,signal:s}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&(this.#mi=!0,onClick(e))},{signal:s}),t.addEventListener("pointerenter",()=>{this.#ge.toggleComment(!1,!0)},{signal:s}),t.addEventListener("pointerleave",()=>{this.#ge.toggleComment(!1,!1)},{signal:s}),t}edit(t){const e=this.commentPopupPositionInLayer;let s,i;if(e)[s,i]=e;else{[s,i]=this.#ge.commentButtonPosition;const{width:t,height:e,x:n,y:a}=this.#ge;s=n+s*t,i=a+i*e}const n=this.#ge.parent.boundingClientRect,{x:a,y:r,width:o,height:l}=n;this.#ge._uiManager.editComment(this.#ge,a+s*o,r+i*l,{...t,parentDimensions:n})}finish(){this.#pi&&(this.#pi.focus({focusVisible:this.#mi}),this.#mi=!1)}isDeleted(){return this.#xi||""===this.#Rt}isEmpty(){return null===this.#Rt}hasBeenEdited(){return this.isDeleted()||this.#Rt!==this.#bi}serialize(){return this.data}get data(){return{text:this.#Rt,richText:this.#wi,date:this.#yi,deleted:this.isDeleted()}}set data(t){if(t!==this.#Rt&&(this.#wi=null),null===t)return this.#Rt="",void(this.#xi=!0);this.#Rt=t,this.#yi=new Date,this.#xi=!1}setInitialText(t,e=null){this.#bi=t,this.data=t,this.#yi=null,this.#wi=e}shown(){}destroy(){this.#pi?.remove(),this.#pi=null,this.#gi?.remove(),this.#gi=null,this.#Rt="",this.#wi=null,this.#yi=null,this.#ge=null,this.#mi=!1,this.#xi=!1}},Zy=class _TouchManager{#Es;#Ai=!1;#ki=null;#Si;#Ci;#_i;#Ii;#Ti=null;#Mi;#Ei=null;#Fi;#Di=null;constructor({container:t,isPinchingDisabled:e=null,isPinchingStopped:s=null,onPinchStart:i=null,onPinching:n=null,onPinchEnd:a=null,signal:r}){this.#Es=t,this.#ki=s,this.#Si=e,this.#Ci=i,this.#_i=n,this.#Ii=a,this.#Fi=new AbortController,this.#Mi=AbortSignal.any([r,this.#Fi.signal]),t.addEventListener("touchstart",this.#Ri.bind(this),{passive:!1,signal:this.#Mi})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Oy.pixelRatio}#Ri(t){if(this.#Si?.())return;if(1===t.touches.length){if(this.#Ti)return;const t=this.#Ti=new AbortController,e=AbortSignal.any([this.#Mi,t.signal]),s=this.#Es,i={capture:!0,signal:e,passive:!1},cancelPointerDown=t=>{"touch"===t.pointerType&&(this.#Ti?.abort(),this.#Ti=null)};return s.addEventListener("pointerdown",t=>{"touch"===t.pointerType&&(stopEvent(t),cancelPointerDown(t))},i),s.addEventListener("pointerup",cancelPointerDown,i),void s.addEventListener("pointercancel",cancelPointerDown,i)}if(!this.#Di){this.#Di=new AbortController;const t=AbortSignal.any([this.#Mi,this.#Di.signal]),e=this.#Es,s={signal:t,capture:!1,passive:!1};e.addEventListener("touchmove",this.#Bi.bind(this),s);const i=this.#Pi.bind(this);e.addEventListener("touchend",i,s),e.addEventListener("touchcancel",i,s),s.capture=!0,e.addEventListener("pointerdown",stopEvent,s),e.addEventListener("pointermove",stopEvent,s),e.addEventListener("pointercancel",stopEvent,s),e.addEventListener("pointerup",stopEvent,s),this.#Ci?.()}if(stopEvent(t),2!==t.touches.length||this.#ki?.())return void(this.#Ei=null);let[e,s]=t.touches;e.identifier>s.identifier&&([e,s]=[s,e]),this.#Ei={touch0X:e.screenX,touch0Y:e.screenY,touch1X:s.screenX,touch1Y:s.screenY}}#Bi(t){if(!this.#Ei||2!==t.touches.length)return;stopEvent(t);let[e,s]=t.touches;e.identifier>s.identifier&&([e,s]=[s,e]);const{screenX:i,screenY:n}=e,{screenX:a,screenY:r}=s,o=this.#Ei,{touch0X:l,touch0Y:c,touch1X:h,touch1Y:u}=o,d=h-l,f=u-c,g=a-i,p=r-n,m=Math.hypot(g,p)||1,b=Math.hypot(d,f)||1;if(!this.#Ai&&Math.abs(b-m)<=_TouchManager.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(o.touch0X=i,o.touch0Y=n,o.touch1X=a,o.touch1Y=r,!this.#Ai)return void(this.#Ai=!0);const w=[(i+a)/2,(n+r)/2];this.#_i?.(w,b,m)}#Pi(t){t.touches.length>=2||(this.#Di&&(this.#Di.abort(),this.#Di=null,this.#Ii?.()),this.#Ei&&(stopEvent(t),this.#Ei=null,this.#Ai=!1))}destroy(){this.#Fi?.abort(),this.#Fi=null,this.#Ti?.abort(),this.#Ti=null}},Qy=class _AnnotationEditor{#Ni=null;#Oi=null;#me=null;#be=null;#gi=null;#Li=!1;#Ui=null;#$i="";#Hi=null;#ji=null;#qi=null;#zi=null;#Gi=null;#Wi="";#Vi=!1;#Xi=null;#Ki=!1;#Yi=!1;#Ji=!1;#Zi=null;#Qi=0;#tn=0;#en=null;#sn=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#in=!1;#nn=_AnnotationEditor._zIndex++;static _borderLineWidth=-1;static _colorManager=new Xy;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=_AnnotationEditor.prototype._resizeWithKeyboard,e=Ky.TRANSLATE_SMALL,s=Ky.TRANSLATE_BIG;return shadow(this,"_resizerKeyboardManager",new Vy([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-s,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[s,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-s]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,s]}],[["Escape","mac+Escape"],_AnnotationEditor.prototype._stopResizingWithKeyboard]]))}constructor(t){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,this.annotationElementId=t.annotationElementId||null,this.creationDate=t.creationDate||new Date,this.modificationDate=t.modificationDate||null;const{rotation:e,rawDims:{pageWidth:s,pageHeight:i,pageX:n,pageY:a}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[s,i],this.pageTranslation=[n,a];const[r,o]=this.parentDimensions;this.x=t.x/r,this.y=t.y/o,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return shadow(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new tx({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e){if(_AnnotationEditor._l10n??=t,_AnnotationEditor._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),-1!==_AnnotationEditor._borderLineWidth)return;const s=getComputedStyle(document.documentElement);_AnnotationEditor._borderLineWidth=parseFloat(s.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){unreachable("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#in}set _isDraggable(t){this.#in=t,this.div?.classList.toggle("draggable",t)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}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=this.#nn}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):(this.#an(),this.#zi?.remove(),this.#zi=null),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#Vi?this.#Vi=!1:this.parent.setSelected(this))}focusout(t){if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const e=t.relatedTarget;e?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&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()}_moveAfterPaste(t,e){const[s,i]=this.parentDimensions;this.setAt(t*s,e*i,this.width*s,this.height*i),this._onTranslated()}#rn([t,e],s,i){[s,i]=this.screenToPageTranslation(s,i),this.x+=s/t,this.y+=i/e,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(t,e){this.#rn(this.parentDimensions,t,e)}translateInPage(t,e){this.#Xi||=[this.x,this.y,this.width,this.height],this.#rn(this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,e){this.#Xi||=[this.x,this.y,this.width,this.height];const{div:s,parentDimensions:[i,n]}=this;if(this.x+=t/i,this.y+=e/n,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:a,y:r}=this;const[o,l]=this.getBaseTranslation();a+=o,r+=l;const{style:c}=s;c.left=`${(100*a).toFixed(2)}%`,c.top=`${(100*r).toFixed(2)}%`,this._onTranslating(a,r),s.scrollIntoView({block:"nearest"})}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!this.#Xi&&(this.#Xi[0]!==this.x||this.#Xi[1]!==this.y)}get _hasBeenResized(){return!!this.#Xi&&(this.#Xi[2]!==this.width||this.#Xi[3]!==this.height)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:s}=_AnnotationEditor,i=s/t,n=s/e;switch(this.rotation){case 90:return[-i,n];case 180:return[i,n];case 270:return[i,-n];default:return[-i,-n]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const{div:{style:e},pageDimensions:[s,i]}=this;let{x:n,y:a,width:r,height:o}=this;if(r*=s,o*=i,n*=s,a*=i,this._mustFixPosition)switch(t){case 0:n=MathClamp(n,0,s-r),a=MathClamp(a,0,i-o);break;case 90:n=MathClamp(n,0,s-o),a=MathClamp(a,r,i);break;case 180:n=MathClamp(n,r,s),a=MathClamp(a,o,i);break;case 270:n=MathClamp(n,o,s),a=MathClamp(a,0,i-r)}this.x=n/=s,this.y=a/=i;const[l,c]=this.getBaseTranslation();n+=l,a+=c,e.left=`${(100*n).toFixed(2)}%`,e.top=`${(100*a).toFixed(2)}%`,this.moveInDOM()}static#on(t,e,s){switch(s){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}screenToPageTranslation(t,e){return _AnnotationEditor.#on(t,e,this.parentRotation)}pageTranslationToScreen(t,e){return _AnnotationEditor.#on(t,e,360-this.parentRotation)}#ln(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]}}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;return[e*t,s*t]}setDims(){const{div:{style:t},width:e,height:s}=this;t.width=`${(100*e).toFixed(2)}%`,t.height=`${(100*s).toFixed(2)}%`}getInitialTranslation(){return[0,0]}#cn(){if(this.#Hi)return;this.#Hi=document.createElement("div"),this.#Hi.classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const s of t){const t=document.createElement("div");this.#Hi.append(t),t.classList.add("resizer",s),t.setAttribute("data-resizer-name",s),t.addEventListener("pointerdown",this.#hn.bind(this,s),{signal:e}),t.addEventListener("contextmenu",noContextMenu,{signal:e}),t.tabIndex=-1}this.div.prepend(this.#Hi)}#hn(t,e){e.preventDefault();const{isMac:s}=ky.platform;if(0!==e.button||e.ctrlKey&&s)return;this.#me?.toggle(!1);const i=this._isDraggable;this._isDraggable=!1,this.#ji=[e.screenX,e.screenY];const n=new AbortController,a=this._uiManager.combinedSignal(n);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#un.bind(this,t),{passive:!0,capture:!0,signal:a}),window.addEventListener("touchmove",stopEvent,{passive:!1,signal:a}),window.addEventListener("contextmenu",noContextMenu,{signal:a}),this.#qi={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const r=this.parent.div.style.cursor,o=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const pointerUpCallback=()=>{n.abort(),this.parent.togglePointerEvents(!0),this.#me?.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=r,this.div.style.cursor=o,this.#dn()};window.addEventListener("pointerup",pointerUpCallback,{signal:a}),window.addEventListener("blur",pointerUpCallback,{signal:a})}#fn(t,e,s,i){this.width=s,this.height=i,this.x=t,this.y=e,this.setDims(),this.fixAndSetPosition(),this._onResized()}_onResized(){}#dn(){if(!this.#qi)return;const{savedX:t,savedY:e,savedWidth:s,savedHeight:i}=this.#qi;this.#qi=null;const n=this.x,a=this.y,r=this.width,o=this.height;n===t&&a===e&&r===s&&o===i||this.addCommands({cmd:this.#fn.bind(this,n,a,r,o),undo:this.#fn.bind(this,t,e,s,i),mustExec:!0})}static _round(t){return Math.round(1e4*t)/1e4}#un(t,e){const[s,i]=this.parentDimensions,n=this.x,a=this.y,r=this.width,o=this.height,l=_AnnotationEditor.MIN_SIZE/s,c=_AnnotationEditor.MIN_SIZE/i,h=this.#ln(this.rotation),transf=(t,e)=>[h[0]*t+h[2]*e,h[1]*t+h[3]*e],u=this.#ln(360-this.rotation);let d,f,g=!1,p=!1;switch(t){case"topLeft":g=!0,d=(t,e)=>[0,0],f=(t,e)=>[t,e];break;case"topMiddle":d=(t,e)=>[t/2,0],f=(t,e)=>[t/2,e];break;case"topRight":g=!0,d=(t,e)=>[t,0],f=(t,e)=>[0,e];break;case"middleRight":p=!0,d=(t,e)=>[t,e/2],f=(t,e)=>[0,e/2];break;case"bottomRight":g=!0,d=(t,e)=>[t,e],f=(t,e)=>[0,0];break;case"bottomMiddle":d=(t,e)=>[t/2,e],f=(t,e)=>[t/2,0];break;case"bottomLeft":g=!0,d=(t,e)=>[0,e],f=(t,e)=>[t,0];break;case"middleLeft":p=!0,d=(t,e)=>[0,e/2],f=(t,e)=>[t,e/2]}const m=d(r,o),b=f(r,o);let w=transf(...b);const y=_AnnotationEditor._round(n+w[0]),x=_AnnotationEditor._round(a+w[1]);let v,A,k=1,S=1;if(e.fromKeyboard)({deltaX:v,deltaY:A}=e);else{const{screenX:t,screenY:s}=e,[i,n]=this.#ji;[v,A]=this.screenToPageTranslation(t-i,s-n),this.#ji[0]=t,this.#ji[1]=s}var C,_;if([v,A]=(C=v/s,_=A/i,[u[0]*C+u[2]*_,u[1]*C+u[3]*_]),g){const t=Math.hypot(r,o);k=S=Math.max(Math.min(Math.hypot(b[0]-m[0]-v,b[1]-m[1]-A)/t,1/r,1/o),l/r,c/o)}else p?k=MathClamp(Math.abs(b[0]-m[0]-v),l,1)/r:S=MathClamp(Math.abs(b[1]-m[1]-A),c,1)/o;const I=_AnnotationEditor._round(r*k),T=_AnnotationEditor._round(o*S);w=transf(...f(I,T));const M=y-w[0],E=x-w[1];this.#Xi||=[this.x,this.y,this.width,this.height],this.width=I,this.height=T,this.x=M,this.y=E,this.setDims(),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#me?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#Yi)return this._editToolbar;this._editToolbar=new jy(this),this.div.append(this._editToolbar.render());const{toolbarButtons:t}=this;if(t)for(const[e,s]of t)await this._editToolbar.addButton(e,s);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton("comment")}removeEditToolbar(){this._editToolbar?.remove(),this._editToolbar=null,this.#me?.destroy()}addContainer(t){const e=this._editToolbar?.div;e?e.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return this.#me||(Yy.initialize(_AnnotationEditor._l10n),this.#me=new Yy(this),this.#Ni&&(this.#me.data=this.#Ni,this.#Ni=null)),this.#me}get altTextData(){return this.#me?.data}set altTextData(t){this.#me&&(this.#me.data=t)}get guessedAltText(){return this.#me?.guessedText}async setGuessedAltText(t){await(this.#me?.setGuessedText(t))}serializeAltText(t){return this.#me?.serialize(t)}hasAltText(){return!!this.#me&&!this.#me.isEmpty()}hasAltTextData(){return this.#me?.hasData()??!1}focusCommentButton(){this.#be?.focusButton()}addCommentButton(){return this.#be||=new Jy(this)}addStandaloneCommentButton(){this.#gi?this._uiManager.isEditingMode()&&this.#gi.classList.remove("hidden"):this.hasComment&&(this.#gi=this.#be.renderForStandalone(),this.div.append(this.#gi))}removeStandaloneCommentButton(){this.#be.removeStandaloneCommentButton(),this.#gi=null}hideStandaloneCommentButton(){this.#gi?.classList.add("hidden")}get comment(){const{data:{richText:t,text:e,date:s,deleted:i}}=this.#be;return{text:e,richText:t,date:s,deleted:i,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(t){this.#be||=new Jy(this),this.#be.data=t,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:t,popupRef:e,richText:s}){if(!e)return;if(this.#be||=new Jy(this),this.#be.setInitialText(t,s),!this.annotationElementId)return;const i=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);i&&this.updateFromAnnotationLayer(i)}get hasEditedComment(){return this.#be?.hasBeenEdited()}get hasDeletedComment(){return this.#be?.isDeleted()}get hasComment(){return!!this.#be&&!this.#be.isEmpty()&&!this.#be.isDeleted()}async editComment(t){this.#be||=new Jy(this),this.#be.edit(t)}toggleComment(t,e=void 0){this.hasComment&&this._uiManager.toggleComment(this,t,e)}setSelectedCommentButton(t){this.#be.setSelectedButton(t)}addComment(t){if(this.hasEditedComment){const e=180,s=100,[,,,i]=t.rect,[n]=this.pageDimensions,[a]=this.pageTranslation,r=a+n+1,o=i-s,l=r+e;t.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[r,o,l,i]}}}updateFromAnnotationLayer({popup:{contents:t,deleted:e}}){this.#be.data=e?null:t}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){const t=this.div=document.createElement("div");t.setAttribute("data-editor-rotation",(360-this.rotation)%360),t.className=this.name,t.setAttribute("id",this.id),t.tabIndex=this.#Li?-1:0,t.setAttribute("role","application"),this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||t.classList.add("hidden"),this.setInForeground(),this.#gn();const[e,s]=this.parentDimensions;this.parentRotation%180!=0&&(t.style.maxWidth=`${(100*s/e).toFixed(2)}%`,t.style.maxHeight=`${(100*e/s).toFixed(2)}%`);const[i,n]=this.getInitialTranslation();return this.translate(i,n),bindEvents(this,t,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#sn||=new Zy({container:t,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#pn.bind(this),onPinching:this.#mn.bind(this),onPinchEnd:this.#bn.bind(this),signal:this._uiManager._signal})),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),t}#pn(){this.#qi={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#me?.toggle(!1),this.parent.togglePointerEvents(!1)}#mn(t,e,s){let i=s/e*.7+1-.7;if(1===i)return;const n=this.#ln(this.rotation),transf=(t,e)=>[n[0]*t+n[2]*e,n[1]*t+n[3]*e],[a,r]=this.parentDimensions,o=this.x,l=this.y,c=this.width,h=this.height,u=_AnnotationEditor.MIN_SIZE/a,d=_AnnotationEditor.MIN_SIZE/r;i=Math.max(Math.min(i,1/c,1/h),u/c,d/h);const f=_AnnotationEditor._round(c*i),g=_AnnotationEditor._round(h*i);if(f===c&&g===h)return;this.#Xi||=[o,l,c,h];const p=transf(c/2,h/2),m=_AnnotationEditor._round(o+p[0]),b=_AnnotationEditor._round(l+p[1]),w=transf(f/2,g/2);this.x=m-w[0],this.y=b-w[1],this.width=f,this.height=g,this.setDims(),this.fixAndSetPosition(),this._onResizing()}#bn(){this.#me?.toggle(!0),this.parent.togglePointerEvents(!0),this.#dn()}pointerdown(t){const{isMac:e}=ky.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(this.#Vi=!0,this._isDraggable?this.#wn(t):this.#yn(t))}#yn(t){const{isMac:e}=ky.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}#wn(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();let s=!1;const i=new AbortController,n=this._uiManager.combinedSignal(i),a={capture:!0,passive:!1,signal:n},cancelDrag=t=>{i.abort(),this.#Ui=null,this.#Vi=!1,this._uiManager.endDragSession()||this.#yn(t),s&&this._onStopDragging()};e&&(this.#Qi=t.clientX,this.#tn=t.clientY,this.#Ui=t.pointerId,this.#$i=t.pointerType,window.addEventListener("pointermove",t=>{s||(s=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());const{clientX:e,clientY:i,pointerId:n}=t;if(n!==this.#Ui)return void stopEvent(t);const[a,r]=this.screenToPageTranslation(e-this.#Qi,i-this.#tn);this.#Qi=e,this.#tn=i,this._uiManager.dragSelectedEditors(a,r)},a),window.addEventListener("touchmove",stopEvent,a),window.addEventListener("pointerdown",t=>{t.pointerType===this.#$i&&(this.#sn||t.isPrimary)&&cancelDrag(t),stopEvent(t)},a));const pointerUpCallback=t=>{this.#Ui&&this.#Ui!==t.pointerId?stopEvent(t):cancelDrag(t)};window.addEventListener("pointerup",pointerUpCallback,{signal:n}),window.addEventListener("blur",pointerUpCallback,{signal:n})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#Zi&&clearTimeout(this.#Zi),this.#Zi=setTimeout(()=>{this.#Zi=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,e,s){t.changeParent(this),this.x=e,this.y=s,this.fixAndSetPosition(),this._onTranslated()}getRect(t,e,s=this.rotation){const i=this.parentScale,[n,a]=this.pageDimensions,[r,o]=this.pageTranslation,l=t/i,c=e/i,h=this.x*n,u=this.y*a,d=this.width*n,f=this.height*a;switch(s){case 0:return[h+l+r,a-u-c-f+o,h+l+d+r,a-u-c+o];case 90:return[h+c+r,a-u+l+o,h+c+f+r,a-u+l+d+o];case 180:return[h-l-d+r,a-u+c+o,h-l+r,a-u+c+f+o];case 270:return[h-c-f+r,a-u-l-d+o,h-c+r,a-u-l+o];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")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&_AnnotationEditor._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#be?.onUpdatedColor()}getData(){const{comment:{text:t,color:e,date:s,opacity:i,deleted:n,richText:a},uid:r,pageIndex:o,creationDate:l,modificationDate:c}=this;return{id:r,pageIndex:o,rect:this.getPDFRect(),richText:a,contentsObj:{str:t},creationDate:l,modificationDate:s||c,popupRef:!n,color:e,opacity:i}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return!this.isInEditMode()&&(this.parent.setEditingState(!1),this.#Yi=!0,!0)}disableEditMode(){return!!this.isInEditMode()&&(this.parent.setEditingState(!0),this.#Yi=!1,!0)}isInEditMode(){return this.#Yi}shouldGetKeyboardEvents(){return this.#Ji}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:e,bottom:s,right:i}=this.getClientDimensions(),{innerHeight:n,innerWidth:a}=window;return e<a&&i>0&&t<n&&s>0}#gn(){if(this.#Gi||!this.div)return;this.#Gi=new AbortController;const t=this._uiManager.combinedSignal(this.#Gi);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})}rebuild(){this.#gn()}rotate(t){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(t=!1,e=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||""}}static async deserialize(t,e,s){const i=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:s,annotationElementId:t.annotationElementId,creationDate:t.creationDate,modificationDate:t.modificationDate});i.rotation=t.rotation,i.#Ni=t.accessibilityData,i._isCopy=t.isCopy||!1;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}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.#Gi?.abort(),this.#Gi=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#Zi&&(clearTimeout(this.#Zi),this.#Zi=null),this.#an(),this.removeEditToolbar(),this.#en){for(const t of this.#en.values())clearTimeout(t);this.#en=null}this.parent=null,this.#sn?.destroy(),this.#sn=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#cn(),this.#Hi.classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return"ltr"===this._uiManager.direction?[1,0]:[0,0]}get commentButtonPositionInPage(){const{commentButtonPosition:[t,e]}=this,[s,i,n,a]=this.getPDFRect();return[_AnnotationEditor._round(s+(n-s)*t),_AnnotationEditor._round(i+(a-i)*(1-e))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return this.#be.commentPopupPositionInLayer}set commentPopupPosition(t){this.#be.commentPopupPositionInLayer=t}hasDefaultPopupPosition(){return this.#be.hasDefaultPopupPosition()}get commentButtonWidth(){return this.#be.commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(t){this.#be.setCommentButtonStates(t)}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),this.#qi={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const e=this.#Hi.children;if(!this.#Oi){this.#Oi=Array.from(e);const t=this.#xn.bind(this),s=this.#vn.bind(this),i=this._uiManager._signal;for(const e of this.#Oi){const n=e.getAttribute("data-resizer-name");e.setAttribute("role","spinbutton"),e.addEventListener("keydown",t,{signal:i}),e.addEventListener("blur",s,{signal:i}),e.addEventListener("focus",this.#An.bind(this,n),{signal:i}),e.setAttribute("data-l10n-id",_AnnotationEditor._l10nResizer[n])}}const s=this.#Oi[0];let i=0;for(const t of e){if(t===s)break;i++}const n=(360-this.rotation+this.parentRotation)%360/90*(this.#Oi.length/4);if(n!==i){if(n<i)for(let t=0;t<i-n;t++)this.#Hi.append(this.#Hi.firstChild);else if(n>i)for(let t=0;t<n-i;t++)this.#Hi.firstChild.before(this.#Hi.lastChild);let t=0;for(const s of e){const e=this.#Oi[t++].getAttribute("data-resizer-name");s.setAttribute("data-l10n-id",_AnnotationEditor._l10nResizer[e])}}this.#kn(0),this.#Ji=!0,this.#Hi.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#xn(t){_AnnotationEditor._resizerKeyboardManager.exec(this,t)}#vn(t){this.#Ji&&t.relatedTarget?.parentNode!==this.#Hi&&this.#an()}#An(t){this.#Wi=this.#Ji?t:""}#kn(t){if(this.#Oi)for(const e of this.#Oi)e.tabIndex=t}_resizeWithKeyboard(t,e){this.#Ji&&this.#un(this.#Wi,{deltaX:t,deltaY:e,fromKeyboard:!0})}#an(){this.#Ji=!1,this.#kn(-1),this.#dn()}_stopResizingWithKeyboard(){this.#an(),this.div.focus()}select(){this.isSelected&&this._editToolbar?this._editToolbar.show():(this.isSelected=!0,this.makeResizable(),this.div?.classList.add("selectedEditor"),this._editToolbar?(this._editToolbar?.show(),this.#me?.toggleAltTextBadge(!1)):this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()}))}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,this.#Hi?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#me?.toggleAltTextBadge(!0),this.hasComment&&this._uiManager.toggleComment(this,!1,!1))}updateParams(t,e){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){"BUTTON"!==t.target.nodeName&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.id}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#Ki}set isEditing(t){this.#Ki=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,e=!1){if(e){this.#en||=new Map;const{action:e}=t;let s=this.#en.get(e);return s&&clearTimeout(s),s=setTimeout(()=>{this._reportTelemetry(t),this.#en.delete(e),0===this.#en.size&&(this.#en=null)},_AnnotationEditor._telemetryTimeout),void this.#en.set(e,s)}t.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),this.#Li=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#Li=!0}updateFakeAnnotationElement(t){if(this.#zi||this.deleted)return this.deleted?(this.#zi.remove(),void(this.#zi=null)):void((this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#zi.updateEdited({rect:this.getPDFRect(),popup:this.comment}));this.#zi=t.addFakeAnnotation(this)}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;let e=t.container.querySelector(".annotationContent");if(e){if("CANVAS"===e.nodeName){const t=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.before(e)}}else e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);return e}resetAnnotationElement(t){const{firstChild:e}=t.container;"DIV"===e?.nodeName&&e.classList.contains("annotationContent")&&e.remove()}},tx=class extends Qy{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}},ex=3285377520,sx=4294901760,ix=65535,nx=class{constructor(t){this.h1=t?4294967295&t:ex,this.h2=t?4294967295&t:ex}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(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");e=t.slice(),s=e.byteLength}const i=s>>2,n=s-4*i,a=new Uint32Array(e.buffer,0,i);let r=0,o=0,l=this.h1,c=this.h2;const h=3432918353,u=461845907,d=11601,f=13715;for(let t=0;t<i;t++)1&t?(r=a[t],r=r*h&sx|r*d&ix,r=r<<15|r>>>17,r=r*u&sx|r*f&ix,l^=r,l=l<<13|l>>>19,l=5*l+3864292196):(o=a[t],o=o*h&sx|o*d&ix,o=o<<15|o>>>17,o=o*u&sx|o*f&ix,c^=o,c=c<<13|c>>>19,c=5*c+3864292196);switch(r=0,n){case 3:r^=e[4*i+2]<<16;case 2:r^=e[4*i+1]<<8;case 1:r^=e[4*i],r=r*h&sx|r*d&ix,r=r<<15|r>>>17,r=r*u&sx|r*f&ix,1&i?l^=r:c^=r}this.h1=l,this.h2=c}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&sx|36045*t&ix,e=4283543511*e&sx|(2950163797*(e<<16|t>>>16)&sx)>>>16,t^=e>>>1,t=444984403*t&sx|60499*t&ix,e=3301882366*e&sx|(3120437893*(e<<16|t>>>16)&sx)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}},ax=Object.freeze({map:null,hash:"",transfer:void 0}),rx=class{#Sn=!1;#Cn=null;#_n=null;#In=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const s=this.#In.get(t);return void 0===s?e:Object.assign(e,s)}getRawValue(t){return this.#In.get(t)}remove(t){const e=this.#In.get(t);if(void 0!==e&&(e instanceof Qy&&this.#_n.delete(e.annotationElementId),this.#In.delete(t),0===this.#In.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor)){for(const t of this.#In.values())if(t instanceof Qy)return;this.onAnnotationEditor(null)}}setValue(t,e){const s=this.#In.get(t);let i=!1;if(void 0!==s)for(const[t,n]of Object.entries(e))s[t]!==n&&(i=!0,s[t]=n);else i=!0,this.#In.set(t,e);i&&this.#Tn(),e instanceof Qy&&((this.#_n||=new Map).set(e.annotationElementId,e),"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type))}has(t){return this.#In.has(t)}get size(){return this.#In.size}#Tn(){this.#Sn||(this.#Sn=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#Sn&&(this.#Sn=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new ox(this)}get serializable(){if(0===this.#In.size)return ax;const t=new Map,e=new nx,s=[],i=Object.create(null);let n=!1;for(const[s,a]of this.#In){const r=a instanceof Qy?a.serialize(!1,i):a;r&&(t.set(s,r),e.update(`${s}:${JSON.stringify(r)}`),n||=!!r.bitmap)}if(n)for(const e of t.values())e.bitmap&&s.push(e.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:s}:ax}get editorStats(){let t=null;const e=new Map;let s=0,i=0;for(const n of this.#In.values()){if(!(n instanceof Qy)){n.popup&&(n.popup.deleted?i+=1:s+=1);continue}n.isCommentDeleted?i+=1:n.hasEditedComment&&(s+=1);const a=n.telemetryFinalData;if(!a)continue;const{type:r}=a;e.has(r)||e.set(r,Object.getPrototypeOf(n).constructor),t||=Object.create(null);const o=t[r]||=new Map;for(const[t,e]of Object.entries(a)){if("type"===t)continue;let s=o.get(t);s||(s=new Map,o.set(t,s));const i=s.get(e)??0;s.set(e,i+1)}}if((i>0||s>0)&&(t||=Object.create(null),t.comments={deleted:i,edited:s}),!t)return null;for(const[s,i]of e)t[s]=i.computeTelemetryFinalData(t[s]);return t}resetModifiedIds(){this.#Cn=null}updateEditor(t,e){const s=this.#_n?.get(t);return!!s&&(s.updateFromAnnotationLayer(e),!0)}getEditor(t){return this.#_n?.get(t)||null}get modifiedIds(){if(this.#Cn)return this.#Cn;const t=[];if(this.#_n)for(const e of this.#_n.values())e.serialize()&&t.push(e.annotationElementId);return this.#Cn={ids:new Set(t),hash:t.join(",")}}[Symbol.iterator](){return this.#In.entries()}},ox=class extends rx{#Mn;constructor(t){super();const{map:e,hash:s,transfer:i}=t.serializable,n=structuredClone(e,i?{transfer:i}:null);this.#Mn={map:n,hash:s,transfer:i}}get print(){unreachable("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#Mn}get modifiedIds(){return shadow(this,"modifiedIds",{ids:new Set,hash:""})}},lx=class{#En=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){this._document=t,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(),this.#En.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,disableFontFace:e,_inspectFont:s}){if(t&&!this.#En.has(t.loadedName)){if(assert(!e,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:e,src:i,style:n}=t,a=new FontFace(e,i,n);this.addNativeFontFace(a);try{await a.load(),this.#En.add(e),s?.(t)}catch{warn(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}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);if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(s){throw warn(`Failed to load font '${e.family}': '${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(){return shadow(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){return shadow(this,"isSyncFontLoadingSupported",Rw||ky.platform.isFirefox)}_queueLoadingCallback(t){const{loadingRequests:e}=this,s={done:!1,complete:function(){for(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(){return shadow(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(t,e){function int32(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function spliceString(t,e,s,i){return t.substring(0,e)+i+t.substring(e+s)}let s,i;const n=this._document.createElement("canvas");n.width=1,n.height=1;const a=n.getContext("2d");let r=0;const o=`lt${Date.now()}${this.loadTestFontId++}`;let l=this._loadTestFont;l=spliceString(l,976,o.length,o);const c=1482184792;let h=int32(l,16);for(s=0,i=o.length-3;s<i;s+=4)h=h-c+int32(o,s)|0;var u;s<o.length&&(h=h-c+int32(o+"XXX",s)|0),l=spliceString(l,16,4,(u=h,String.fromCharCode(u>>24&255,u>>16&255,u>>8&255,255&u)));const d=`@font-face {font-family:"${o}";src:url(data:font/opentype;base64,${btoa(l)});}`;this.insertRule(d);const f=this._document.createElement("div");f.style.visibility="hidden",f.style.width=f.style.height="10px",f.style.position="absolute",f.style.top=f.style.left="0px";for(const e of[t.loadedName,o]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=e,f.append(t)}this._document.body.append(f),function isFontReady(t,e){if(++r>30)return warn("Load test font never loaded."),void e();a.font="30px "+t,a.fillText(".",0,20),a.getImageData(0,0,1,1).data[3]>0?e():setTimeout(isFontReady.bind(null,t,e))}(o,()=>{f.remove(),e.complete()})}},cx=class{#Fn;constructor(t,e=null,s,i){this.compiledGlyphs=Object.create(null),this.#Fn=t,this._inspectFont=e,s&&Object.assign(this,s),i&&(this.charProcOperatorList=i)}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=`url(data:${this.mimetype};base64,${toBase64Util(this.data)});`;let e;if(this.cssFontInfo){let s=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(s+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),e=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${s}src:${t}}`}else e=`@font-face {font-family:"${this.loadedName}";src:${t}}`;return this._inspectFont?.(this,t),e}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];const s=this.loadedName+"_path_"+e;let i;try{i=t.get(s)}catch(t){warn(`getPathGenerator - ignoring character: "${t}".`)}const n=new Path2D(i||"");return this.fontExtraProperties||t.delete(s),this.compiledGlyphs[e]=n}get black(){return this.#Fn.black}get bold(){return this.#Fn.bold}get disableFontFace(){return this.#Fn.disableFontFace??!1}get fontExtraProperties(){return this.#Fn.fontExtraProperties??!1}get isInvalidPDFjsFont(){return this.#Fn.isInvalidPDFjsFont}get isType3Font(){return this.#Fn.isType3Font}get italic(){return this.#Fn.italic}get missingFile(){return this.#Fn.missingFile}get remeasure(){return this.#Fn.remeasure}get vertical(){return this.#Fn.vertical}get ascent(){return this.#Fn.ascent}get defaultWidth(){return this.#Fn.defaultWidth}get descent(){return this.#Fn.descent}get bbox(){return this.#Fn.bbox}get fontMatrix(){return this.#Fn.fontMatrix}get fallbackName(){return this.#Fn.fallbackName}get loadedName(){return this.#Fn.loadedName}get mimetype(){return this.#Fn.mimetype}get name(){return this.#Fn.name}get data(){return this.#Fn.data}clearData(){this.#Fn.clearData()}get cssFontInfo(){return this.#Fn.cssFontInfo}get systemFontInfo(){return this.#Fn.systemFontInfo}get defaultVMetrics(){return this.#Fn.defaultVMetrics}};function getFactoryUrlProp(t){if("string"!=typeof t)return null;if(t.endsWith("/"))return t;throw new Error(`Invalid factory url: "${t}" must include trailing slash.`)}var isRefProxy=t=>"object"==typeof t&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0,hx=function(t,e,s){if(!Array.isArray(s)||s.length<2)return!1;const[i,n,...a]=s;if(!t(i)&&!Number.isInteger(i))return!1;if(!e(n))return!1;const r=a.length;let o=!0;switch(n.name){case"XYZ":if(r<2||r>3)return!1;break;case"Fit":case"FitB":return 0===r;case"FitH":case"FitBH":case"FitV":case"FitBV":if(r>1)return!1;break;case"FitR":if(4!==r)return!1;o=!1;break;default:return!1}for(const t of a)if(!("number"==typeof t||o&&null===t))return!1;return!0}.bind(null,isRefProxy,t=>"object"==typeof t&&"string"==typeof t?.name),ux=class{#Dn=new Map;#Rn=Promise.resolve();postMessage(t,e){const s={data:structuredClone(t,e?{transfer:e}:null)};this.#Rn.then(()=>{for(const[t]of this.#Dn)t.call(this,s)})}addEventListener(t,e,s=null){let i=null;if(s?.signal instanceof AbortSignal){const{signal:n}=s;if(n.aborted)return void warn("LoopbackPort - cannot use an `aborted` signal.");const onAbort=()=>this.removeEventListener(t,e);i=()=>n.removeEventListener("abort",onAbort),n.addEventListener("abort",onAbort)}this.#Dn.set(e,i)}removeEventListener(t,e){const s=this.#Dn.get(e);s?.(),this.#Dn.delete(e)}terminate(){for(const[,t]of this.#Dn)t?.();this.#Dn.clear()}},dx=1,fx=2,gx=1,px=2,mx=3,bx=4,wx=5,yx=6,xx=7,vx=8;function onFn(){}function wrapReason(t){if(t instanceof Ay||t instanceof yy||t instanceof by||t instanceof xy||t instanceof wy)return t;switch(t instanceof Error||"object"==typeof t&&null!==t||unreachable('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new Ay(t.message);case"InvalidPDFException":return new yy(t.message);case"PasswordException":return new by(t.message,t.code);case"ResponseException":return new xy(t.message,t.status,t.missing);case"UnknownErrorException":return new wy(t.message,t.details)}return new wy(t.message,t.toString())}var Ax=class{#re=new AbortController;constructor(t,e,s){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),s.addEventListener("message",this.#oe.bind(this),{signal:this.#re.signal})}#oe({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream)return void this.#le(t);if(t.callback){const e=t.callbackId,s=this.callbackCapabilities[e];if(!s)throw new Error(`Cannot resolve callback ${e}`);if(delete this.callbackCapabilities[e],t.callback===dx)s.resolve(t.data);else{if(t.callback!==fx)throw new Error("Unexpected callback case");s.reject(wrapReason(t.reason))}return}const e=this.actionHandler[t.action];if(!e)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const s=this.sourceName,i=t.sourceName,n=this.comObj;return void Promise.try(e,t.data).then(function(e){n.postMessage({sourceName:s,targetName:i,callback:dx,callbackId:t.callbackId,data:e})},function(e){n.postMessage({sourceName:s,targetName:i,callback:fx,callbackId:t.callbackId,reason:wrapReason(e)})})}t.streamId?this.#ce(t):e(t.data)}on(t,e){const s=this.actionHandler;if(s[t])throw new Error(`There is already an actionName called "${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 i=this.callbackId++,n=Promise.withResolvers();this.callbackCapabilities[i]=n;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:i,data:e},s)}catch(t){n.reject(t)}return n.promise}sendWithStream(t,e,s,i){const n=this.streamId++,a=this.sourceName,r=this.targetName,o=this.comObj;return new ReadableStream({start:s=>{const l=Promise.withResolvers();return this.streamControllers[n]={controller:s,startCall:l,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:a,targetName:r,action:t,streamId:n,data:e,desiredSize:s.desiredSize},i),l.promise},pull:t=>{const e=Promise.withResolvers();return this.streamControllers[n].pullCall=e,o.postMessage({sourceName:a,targetName:r,stream:yx,streamId:n,desiredSize:t.desiredSize}),e.promise},cancel:t=>{assert(t instanceof Error,"cancel must have a valid reason");const e=Promise.withResolvers();return this.streamControllers[n].cancelCall=e,this.streamControllers[n].isClosed=!0,o.postMessage({sourceName:a,targetName:r,stream:gx,streamId:n,reason:wrapReason(t)}),e.promise}},s)}#ce(t){const e=t.streamId,s=this.sourceName,i=t.sourceName,n=this.comObj,a=this,r=this.actionHandler[t.action],o={enqueue(t,a=1,r){if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=a,o>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),n.postMessage({sourceName:s,targetName:i,stream:bx,streamId:e,chunk:t},r)},close(){this.isCancelled||(this.isCancelled=!0,n.postMessage({sourceName:s,targetName:i,stream:mx,streamId:e}),delete a.streamSinks[e])},error(t){assert(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,n.postMessage({sourceName:s,targetName:i,stream:wx,streamId:e,reason:wrapReason(t)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[e]=o,Promise.try(r,t.data,o).then(function(){n.postMessage({sourceName:s,targetName:i,stream:vx,streamId:e,success:!0})},function(t){n.postMessage({sourceName:s,targetName:i,stream:vx,streamId:e,reason:wrapReason(t)})})}#le(t){const e=t.streamId,s=this.sourceName,i=t.sourceName,n=this.comObj,a=this.streamControllers[e],r=this.streamSinks[e];switch(t.stream){case vx:t.success?a.startCall.resolve():a.startCall.reject(wrapReason(t.reason));break;case xx:t.success?a.pullCall.resolve():a.pullCall.reject(wrapReason(t.reason));break;case yx:if(!r){n.postMessage({sourceName:s,targetName:i,stream:xx,streamId:e,success:!0});break}r.desiredSize<=0&&t.desiredSize>0&&r.sinkCapability.resolve(),r.desiredSize=t.desiredSize,Promise.try(r.onPull||onFn).then(function(){n.postMessage({sourceName:s,targetName:i,stream:xx,streamId:e,success:!0})},function(t){n.postMessage({sourceName:s,targetName:i,stream:xx,streamId:e,reason:wrapReason(t)})});break;case bx:if(assert(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(t.chunk);break;case mx:if(assert(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),this.#he(a,e);break;case wx:assert(a,"error should have stream controller"),a.controller.error(wrapReason(t.reason)),this.#he(a,e);break;case px:t.success?a.cancelCall.resolve():a.cancelCall.reject(wrapReason(t.reason)),this.#he(a,e);break;case gx:if(!r)break;const o=wrapReason(t.reason);Promise.try(r.onCancel||onFn,o).then(function(){n.postMessage({sourceName:s,targetName:i,stream:px,streamId:e,success:!0})},function(t){n.postMessage({sourceName:s,targetName:i,stream:px,streamId:e,reason:wrapReason(t)})}),r.sinkCapability.reject(o),r.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async#he(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[e]}destroy(){this.#re?.abort(),this.#re=null}},kx=class{#Bn=!1;constructor({enableHWA:t=!1}){this.#Bn=t}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",{willReadFrequently:!this.#Bn})}}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){unreachable("Abstract method `_createCanvas` called.")}},Sx=class extends kx{constructor({ownerDocument:t=globalThis.document,enableHWA:e=!1}){super({enableHWA:e}),this._document=t}_createCanvas(t,e){const s=this._document.createElement("canvas");return s.width=t,s.height=e,s}},Cx=class{constructor({baseUrl:t=null,isCompressed:e=!0}){this.baseUrl=t,this.isCompressed=e}async fetch({name:t}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!t)throw new Error("CMap name must be specified.");const e=this.baseUrl+t+(this.isCompressed?".bcmap":"");return this._fetch(e).then(t=>({cMapData:t,isCompressed:this.isCompressed})).catch(t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${e}`)})}async _fetch(t){unreachable("Abstract method `_fetch` called.")}},_x=class extends Cx{async _fetch(t){const e=await fetchData(t,this.isCompressed?"arraybuffer":"text");return e instanceof ArrayBuffer?new Uint8Array(e):stringToBytes(e)}},Ix=class{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,s,i,n){return"none"}destroy(t=!1){}},Tx=class extends Ix{#Pn;#Nn;#On;#Ln;#Un;#$n;#Ee=0;constructor({docId:t,ownerDocument:e=globalThis.document}){super(),this.#Ln=t,this.#Un=e}get#De(){return this.#Nn||=new Map}get#Hn(){return this.#$n||=new Map}get#jn(){if(!this.#On){const t=this.#Un.createElement("div"),{style:e}=t;e.visibility="hidden",e.contain="strict",e.width=e.height=0,e.position="absolute",e.top=e.left=0,e.zIndex=-1;const s=this.#Un.createElementNS(Fy,"svg");s.setAttribute("width",0),s.setAttribute("height",0),this.#On=this.#Un.createElementNS(Fy,"defs"),t.append(s),s.append(this.#On),this.#Un.body.append(t)}return this.#On}#qn(t){if(1===t.length){const e=t[0],s=new Array(256);for(let t=0;t<256;t++)s[t]=e[t]/255;const i=s.join(",");return[i,i,i]}const[e,s,i]=t,n=new Array(256),a=new Array(256),r=new Array(256);for(let t=0;t<256;t++)n[t]=e[t]/255,a[t]=s[t]/255,r[t]=i[t]/255;return[n.join(","),a.join(","),r.join(",")]}#zn(t){if(void 0===this.#Pn){this.#Pn="";const t=this.#Un.URL;t!==this.#Un.baseURI&&(isDataScheme(t)?warn('#createUrl: ignore "data:"-URL for performance reasons.'):this.#Pn=updateUrlHash(t,""))}return`url(${this.#Pn}#${t})`}addFilter(t){if(!t)return"none";let e=this.#De.get(t);if(e)return e;const[s,i,n]=this.#qn(t),a=1===t.length?s:`${s}${i}${n}`;if(e=this.#De.get(a),e)return this.#De.set(t,e),e;const r=`g_${this.#Ln}_transfer_map_${this.#Ee++}`,o=this.#zn(r);this.#De.set(t,o),this.#De.set(a,o);const l=this.#Gn(r);return this.#Wn(s,i,n,l),o}addHCMFilter(t,e){const s=`${t}-${e}`,i="base";let n=this.#Hn.get(i);if(n?.key===s)return n.url;if(n?(n.filter?.remove(),n.key=s,n.url="none",n.filter=null):(n={key:s,url:"none",filter:null},this.#Hn.set(i,n)),!t||!e)return n.url;const a=this.#Vn(t);t=Cy.makeHexColor(...a);const r=this.#Vn(e);if(e=Cy.makeHexColor(...r),this.#jn.style.color="","#000000"===t&&"#ffffff"===e||t===e)return n.url;const o=new Array(256);for(let t=0;t<=255;t++){const e=t/255;o[t]=e<=.03928?e/12.92:((e+.055)/1.055)**2.4}const l=o.join(","),c=`g_${this.#Ln}_hcm_filter`,h=n.filter=this.#Gn(c);this.#Wn(l,l,l,h),this.#Xn(h);const getSteps=(t,e)=>{const s=a[t]/255,i=r[t]/255,n=new Array(e+1);for(let t=0;t<=e;t++)n[t]=s+t/e*(i-s);return n.join(",")};return this.#Wn(getSteps(0,5),getSteps(1,5),getSteps(2,5),h),n.url=this.#zn(c),n.url}addAlphaFilter(t){let e=this.#De.get(t);if(e)return e;const[s]=this.#qn([t]),i=`alpha_${s}`;if(e=this.#De.get(i),e)return this.#De.set(t,e),e;const n=`g_${this.#Ln}_alpha_map_${this.#Ee++}`,a=this.#zn(n);this.#De.set(t,a),this.#De.set(i,a);const r=this.#Gn(n);return this.#Kn(s,r),a}addLuminosityFilter(t){let e,s,i=this.#De.get(t||"luminosity");if(i)return i;if(t?([e]=this.#qn([t]),s=`luminosity_${e}`):s="luminosity",i=this.#De.get(s),i)return this.#De.set(t,i),i;const n=`g_${this.#Ln}_luminosity_map_${this.#Ee++}`,a=this.#zn(n);this.#De.set(t,a),this.#De.set(s,a);const r=this.#Gn(n);return this.#Yn(r),t&&this.#Kn(e,r),a}addHighlightHCMFilter(t,e,s,i,n){const a=`${e}-${s}-${i}-${n}`;let r=this.#Hn.get(t);if(r?.key===a)return r.url;if(r?(r.filter?.remove(),r.key=a,r.url="none",r.filter=null):(r={key:a,url:"none",filter:null},this.#Hn.set(t,r)),!e||!s)return r.url;const[o,l]=[e,s].map(this.#Vn.bind(this));let c=Math.round(.2126*o[0]+.7152*o[1]+.0722*o[2]),h=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),[u,d]=[i,n].map(this.#Vn.bind(this));h<c&&([c,h,u,d]=[h,c,d,u]),this.#jn.style.color="";const getSteps=(t,e,s)=>{const i=new Array(256),n=(h-c)/s,a=t/255,r=(e-t)/(255*s);let o=0;for(let t=0;t<=s;t++){const e=Math.round(c+t*n),s=a+t*r;for(let t=o;t<=e;t++)i[t]=s;o=e+1}for(let t=o;t<256;t++)i[t]=i[o-1];return i.join(",")},f=`g_${this.#Ln}_hcm_${t}_filter`,g=r.filter=this.#Gn(f);return this.#Xn(g),this.#Wn(getSteps(u[0],d[0],5),getSteps(u[1],d[1],5),getSteps(u[2],d[2],5),g),r.url=this.#zn(f),r.url}destroy(t=!1){t&&this.#$n?.size||(this.#On?.parentNode.parentNode.remove(),this.#On=null,this.#Nn?.clear(),this.#Nn=null,this.#$n?.clear(),this.#$n=null,this.#Ee=0)}#Yn(t){const e=this.#Un.createElementNS(Fy,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(e)}#Xn(t){const e=this.#Un.createElementNS(Fy,"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)}#Gn(t){const e=this.#Un.createElementNS(Fy,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),this.#jn.append(e),e}#Jn(t,e,s){const i=this.#Un.createElementNS(Fy,e);i.setAttribute("type","discrete"),i.setAttribute("tableValues",s),t.append(i)}#Wn(t,e,s,i){const n=this.#Un.createElementNS(Fy,"feComponentTransfer");i.append(n),this.#Jn(n,"feFuncR",t),this.#Jn(n,"feFuncG",e),this.#Jn(n,"feFuncB",s)}#Kn(t,e){const s=this.#Un.createElementNS(Fy,"feComponentTransfer");e.append(s),this.#Jn(s,"feFuncA",t)}#Vn(t){return this.#jn.style.color=t,getRGB(getComputedStyle(this.#jn).getPropertyValue("color"))}},Mx=class{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!t)throw new Error("Font filename must be specified.");const e=`${this.baseUrl}${t}`;return this._fetch(e).catch(t=>{throw new Error(`Unable to load font data at: ${e}`)})}async _fetch(t){unreachable("Abstract method `_fetch` called.")}},Ex=class extends Mx{async _fetch(t){const e=await fetchData(t,"arraybuffer");return new Uint8Array(e)}},Fx=class{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!t)throw new Error("Wasm filename must be specified.");const e=`${this.baseUrl}${t}`;return this._fetch(e).catch(t=>{throw new Error(`Unable to load wasm data at: ${e}`)})}async _fetch(t){unreachable("Abstract method `_fetch` called.")}},Dx=class extends Fx{async _fetch(t){const e=await fetchData(t,"arraybuffer");return new Uint8Array(e)}};async function node_utils_fetchData(t){const e=process.getBuiltinModule("fs"),s=await e.promises.readFile(t);return new Uint8Array(s)}var Rx=class extends Ix{},Bx=class extends kx{_createCanvas(t,e){return process.getBuiltinModule("module").createRequire(import.meta.url),new Proxy({},{get:(t,e)=>()=>{throw new Error("@napi-rs/canvas is not available in this environment")}}).createCanvas(t,e)}},Px=class extends Cx{async _fetch(t){return node_utils_fetchData(t)}},Nx=class extends Mx{async _fetch(t){return node_utils_fetchData(t)}},Ox=class extends Fx{async _fetch(t){return node_utils_fetchData(t)}},Lx="__forcedDependency",{floor:Ux,ceil:$x}=Math;function expandBBox(t,e,s,i,n,a){t[4*e+0]=Math.min(t[4*e+0],s),t[4*e+1]=Math.min(t[4*e+1],i),t[4*e+2]=Math.max(t[4*e+2],n),t[4*e+3]=Math.max(t[4*e+3],a)}var Hx=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0],jx=class{#Zn;#Qn;constructor(t,e){this.#Zn=t,this.#Qn=e}get length(){return this.#Zn.length}isEmpty(t){return this.#Zn[t]===Hx}minX(t){return this.#Qn[4*t+0]/256}minY(t){return this.#Qn[4*t+1]/256}maxX(t){return(this.#Qn[4*t+2]+1)/256}maxY(t){return(this.#Qn[4*t+3]+1)/256}},ensureDebugMetadata=(t,e)=>{if(!t)return;let s=t.get(e);return s||(s={dependencies:new Set,isRenderingOperation:!1},t.set(e,s)),s},qx=class{#ta={__proto__:null};#ea={__proto__:null,transform:[],moveText:[],sameLineText:[],[Lx]:[]};#sa=new Map;#ia=[];#na=[];#aa=[[1,0,0,1,0,0]];#ra=[-1/0,-1/0,1/0,1/0];#oa=new Float64Array([1/0,1/0,-1/0,-1/0]);#la=-1;#ca=new Set;#ha=new Map;#ua=new Map;#da;#fa;#ga;#Zn;#pa;constructor(t,e,s=!1){this.#da=t.width,this.#fa=t.height,this.#ma(e),s&&(this.#pa=new Map)}growOperationsCount(t){t>=this.#Zn.length&&this.#ma(t,this.#Zn)}#ma(t,e){const s=new ArrayBuffer(4*t);this.#ga=new Uint8ClampedArray(s),this.#Zn=new Uint32Array(s),e&&e.length>0?(this.#Zn.set(e),this.#Zn.fill(Hx,e.length)):this.#Zn.fill(Hx)}save(t){return this.#ta={__proto__:this.#ta},this.#ea={__proto__:this.#ea,transform:{__proto__:this.#ea.transform},moveText:{__proto__:this.#ea.moveText},sameLineText:{__proto__:this.#ea.sameLineText},[Lx]:{__proto__:this.#ea[Lx]}},this.#ra={__proto__:this.#ra},this.#ia.push(t),this}restore(t){const e=Object.getPrototypeOf(this.#ta);if(null===e)return this;this.#ta=e,this.#ea=Object.getPrototypeOf(this.#ea),this.#ra=Object.getPrototypeOf(this.#ra);const s=this.#ia.pop();return void 0!==s&&(ensureDebugMetadata(this.#pa,t)?.dependencies.add(s),this.#Zn[t]=this.#Zn[s]),this}recordOpenMarker(t){return this.#ia.push(t),this}getOpenMarker(){return 0===this.#ia.length?null:this.#ia.at(-1)}recordCloseMarker(t){const e=this.#ia.pop();return void 0!==e&&(ensureDebugMetadata(this.#pa,t)?.dependencies.add(e),this.#Zn[t]=this.#Zn[e]),this}beginMarkedContent(t){return this.#na.push(t),this}endMarkedContent(t){const e=this.#na.pop();return void 0!==e&&(ensureDebugMetadata(this.#pa,t)?.dependencies.add(e),this.#Zn[t]=this.#Zn[e]),this}pushBaseTransform(t){return this.#aa.push(Cy.multiplyByDOMMatrix(this.#aa.at(-1),t.getTransform())),this}popBaseTransform(){return this.#aa.length>1&&this.#aa.pop(),this}recordSimpleData(t,e){return this.#ta[t]=e,this}recordIncrementalData(t,e){return this.#ea[t].push(e),this}resetIncrementalData(t,e){return this.#ea[t].length=0,this}recordNamedData(t,e){return this.#sa.set(t,e),this}recordSimpleDataFromNamed(t,e,s){this.#ta[t]=this.#sa.get(e)??s}recordFutureForcedDependency(t,e){return this.recordIncrementalData(Lx,e),this}inheritSimpleDataAsFutureForcedDependencies(t){for(const e of t)e in this.#ta&&this.recordFutureForcedDependency(e,this.#ta[e]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const t of this.#ca)this.recordFutureForcedDependency(Lx,t);return this}resetBBox(t){return this.#la!==t&&(this.#la=t,this.#oa[0]=1/0,this.#oa[1]=1/0,this.#oa[2]=-1/0,this.#oa[3]=-1/0),this}recordClipBox(t,e,s,i,n,a){const r=Cy.multiplyByDOMMatrix(this.#aa.at(-1),e.getTransform()),o=[1/0,1/0,-1/0,-1/0];Cy.axialAlignedBoundingBox([s,n,i,a],r,o);const l=Cy.intersect(this.#ra,o);return l?(this.#ra[0]=l[0],this.#ra[1]=l[1],this.#ra[2]=l[2],this.#ra[3]=l[3]):(this.#ra[0]=this.#ra[1]=1/0,this.#ra[2]=this.#ra[3]=-1/0),this}recordBBox(t,e,s,i,n,a){const r=this.#ra;if(r[0]===1/0)return this;const o=Cy.multiplyByDOMMatrix(this.#aa.at(-1),e.getTransform());if(r[0]===-1/0)return Cy.axialAlignedBoundingBox([s,n,i,a],o,this.#oa),this;const l=[1/0,1/0,-1/0,-1/0];return Cy.axialAlignedBoundingBox([s,n,i,a],o,l),this.#oa[0]=Math.min(this.#oa[0],Math.max(l[0],r[0])),this.#oa[1]=Math.min(this.#oa[1],Math.max(l[1],r[1])),this.#oa[2]=Math.max(this.#oa[2],Math.min(l[2],r[2])),this.#oa[3]=Math.max(this.#oa[3],Math.min(l[3],r[3])),this}recordCharacterBBox(t,e,s,i=1,n=0,a=0,r){const o=s.bbox;let l,c;if(o&&(l=o[2]!==o[0]&&o[3]!==o[1]&&this.#ua.get(s),!1!==l&&(c=[0,0,0,0],Cy.axialAlignedBoundingBox(o,s.fontMatrix,c),1===i&&0===n&&0===a||Cy.scaleMinMax([i,0,0,-i,n,a],c),l)))return this.recordBBox(t,e,c[0],c[2],c[1],c[3]);if(!r)return this.recordFullPageBBox(t);const h=r();return o&&c&&void 0===l&&(l=c[0]<=n-h.actualBoundingBoxLeft&&c[2]>=n+h.actualBoundingBoxRight&&c[1]<=a-h.actualBoundingBoxAscent&&c[3]>=a+h.actualBoundingBoxDescent,this.#ua.set(s,l),l)?this.recordBBox(t,e,c[0],c[2],c[1],c[3]):this.recordBBox(t,e,n-h.actualBoundingBoxLeft,n+h.actualBoundingBoxRight,a-h.actualBoundingBoxAscent,a+h.actualBoundingBoxDescent)}recordFullPageBBox(t){return this.#oa[0]=Math.max(0,this.#ra[0]),this.#oa[1]=Math.max(0,this.#ra[1]),this.#oa[2]=Math.min(this.#da,this.#ra[2]),this.#oa[3]=Math.min(this.#fa,this.#ra[3]),this}getSimpleIndex(t){return this.#ta[t]}recordDependencies(t,e){const s=this.#ca,i=this.#ta,n=this.#ea;for(const t of e)t in this.#ta?s.add(i[t]):t in n&&n[t].forEach(s.add,s);return this}recordNamedDependency(t,e){return this.#sa.has(e)&&this.#ca.add(this.#sa.get(e)),this}recordOperation(t,e=!1){if(this.recordDependencies(t,[Lx]),this.#pa){const e=ensureDebugMetadata(this.#pa,t),{dependencies:s}=e;this.#ca.forEach(s.add,s),this.#ia.forEach(s.add,s),this.#na.forEach(s.add,s),s.delete(t),e.isRenderingOperation=!0}if(this.#la===t){const s=Ux(256*this.#oa[0]/this.#da),i=Ux(256*this.#oa[1]/this.#fa),n=$x(256*this.#oa[2]/this.#da),a=$x(256*this.#oa[3]/this.#fa);expandBBox(this.#ga,t,s,i,n,a);for(const e of this.#ca)e!==t&&expandBBox(this.#ga,e,s,i,n,a);for(const e of this.#ia)e!==t&&expandBBox(this.#ga,e,s,i,n,a);for(const e of this.#na)e!==t&&expandBBox(this.#ga,e,s,i,n,a);e||(this.#ca.clear(),this.#la=-1)}return this}recordShowTextOperation(t,e=!1){const s=Array.from(this.#ca);this.recordOperation(t,e),this.recordIncrementalData("sameLineText",t);for(const t of s)this.recordIncrementalData("sameLineText",t);return this}bboxToClipBoxDropOperation(t,e=!1){return this.#la===t&&(this.#la=-1,this.#ra[0]=Math.max(this.#ra[0],this.#oa[0]),this.#ra[1]=Math.max(this.#ra[1],this.#oa[1]),this.#ra[2]=Math.min(this.#ra[2],this.#oa[2]),this.#ra[3]=Math.min(this.#ra[3],this.#oa[3]),e||this.#ca.clear()),this}_takePendingDependencies(){const t=this.#ca;return this.#ca=new Set,t}_extractOperation(t){const e=this.#ha.get(t);return this.#ha.delete(t),e}_pushPendingDependencies(t){for(const e of t)this.#ca.add(e)}take(){return this.#ua.clear(),new jx(this.#Zn,this.#ga)}takeDebugMetadata(){return this.#pa}},zx=class _CanvasNestedDependencyTracker{#ba;#wa;#ya;#xa=0;#va=0;constructor(t,e,s){if(t instanceof _CanvasNestedDependencyTracker&&t.#ya===!!s)return t;this.#ba=t,this.#wa=e,this.#ya=!!s}growOperationsCount(){throw new Error("Unreachable")}save(t){return this.#va++,this.#ba.save(this.#wa),this}restore(t){return this.#va>0&&(this.#ba.restore(this.#wa),this.#va--),this}recordOpenMarker(t){return this.#xa++,this}getOpenMarker(){return this.#xa>0?this.#wa:this.#ba.getOpenMarker()}recordCloseMarker(t){return this.#xa--,this}beginMarkedContent(t){return this}endMarkedContent(t){return this}pushBaseTransform(t){return this.#ba.pushBaseTransform(t),this}popBaseTransform(){return this.#ba.popBaseTransform(),this}recordSimpleData(t,e){return this.#ba.recordSimpleData(t,this.#wa),this}recordIncrementalData(t,e){return this.#ba.recordIncrementalData(t,this.#wa),this}resetIncrementalData(t,e){return this.#ba.resetIncrementalData(t,this.#wa),this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,s){return this.#ba.recordSimpleDataFromNamed(t,e,this.#wa),this}recordFutureForcedDependency(t,e){return this.#ba.recordFutureForcedDependency(t,this.#wa),this}inheritSimpleDataAsFutureForcedDependencies(t){return this.#ba.inheritSimpleDataAsFutureForcedDependencies(t),this}inheritPendingDependenciesAsFutureForcedDependencies(){return this.#ba.inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(t){return this.#ya||this.#ba.resetBBox(this.#wa),this}recordClipBox(t,e,s,i,n,a){return this.#ya||this.#ba.recordClipBox(this.#wa,e,s,i,n,a),this}recordBBox(t,e,s,i,n,a){return this.#ya||this.#ba.recordBBox(this.#wa,e,s,i,n,a),this}recordCharacterBBox(t,e,s,i,n,a,r){return this.#ya||this.#ba.recordCharacterBBox(this.#wa,e,s,i,n,a,r),this}recordFullPageBBox(t){return this.#ya||this.#ba.recordFullPageBBox(this.#wa),this}getSimpleIndex(t){return this.#ba.getSimpleIndex(t)}recordDependencies(t,e){return this.#ba.recordDependencies(this.#wa,e),this}recordNamedDependency(t,e){return this.#ba.recordNamedDependency(this.#wa,e),this}recordOperation(t){return this.#ba.recordOperation(this.#wa,!0),this}recordShowTextOperation(t){return this.#ba.recordShowTextOperation(this.#wa,!0),this}bboxToClipBoxDropOperation(t){return this.#ya||this.#ba.bboxToClipBoxDropOperation(this.#wa,!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}},Gx=["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],Wx=["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],Vx=["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],Xx=["filter","fillColor","fillAlpha"],Kx=["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],Yx=["transform"],Jx=["transform","fillColor"],Zx="Fill",Qx="Stroke",tv="Shading";function applyBoundingBox(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)}var ev=class{isModifyingCurrentTransform(){return!1}getPattern(){unreachable("Abstract method `getPattern` called.")}},sv=class extends ev{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 t of this._colorStops)e.addColorStop(t[0],t[1]);return e}getPattern(t,e,s,i){let n;if(i===Qx||i===Zx){const a=e.current.getClippedPathBoundingBox(i,getCurrentTransform(t))||[0,0,0,0],r=Math.ceil(a[2]-a[0])||1,o=Math.ceil(a[3]-a[1])||1,l=e.cachedCanvases.getCanvas("pattern",r,o),c=l.context;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.beginPath(),c.rect(0,0,c.canvas.width,c.canvas.height),c.translate(-a[0],-a[1]),s=Cy.transform(s,[1,0,0,1,a[0],a[1]]),c.transform(...e.baseTransform),this.matrix&&c.transform(...this.matrix),applyBoundingBox(c,this._bbox),c.fillStyle=this._createGradient(c),c.fill(),n=t.createPattern(l.canvas,"no-repeat");const h=new DOMMatrix(s);n.setTransform(h)}else applyBoundingBox(t,this._bbox),n=this._createGradient(t);return n}};function drawTriangle(t,e,s,i,n,a,r,o){const l=e.coords,c=e.colors,h=t.data,u=4*t.width;let d;l[s+1]>l[i+1]&&(d=s,s=i,i=d,d=a,a=r,r=d),l[i+1]>l[n+1]&&(d=i,i=n,n=d,d=r,r=o,o=d),l[s+1]>l[i+1]&&(d=s,s=i,i=d,d=a,a=r,r=d);const f=(l[s]+e.offsetX)*e.scaleX,g=(l[s+1]+e.offsetY)*e.scaleY,p=(l[i]+e.offsetX)*e.scaleX,m=(l[i+1]+e.offsetY)*e.scaleY,b=(l[n]+e.offsetX)*e.scaleX,w=(l[n+1]+e.offsetY)*e.scaleY;if(g>=w)return;const y=c[a],x=c[a+1],v=c[a+2],A=c[r],k=c[r+1],S=c[r+2],C=c[o],_=c[o+1],I=c[o+2],T=Math.round(g),M=Math.round(w);let E,F,D,R,B,P,N,O;for(let t=T;t<=M;t++){if(t<m){const e=t<g?0:(g-t)/(g-m);E=f-(f-p)*e,F=y-(y-A)*e,D=x-(x-k)*e,R=v-(v-S)*e}else{let e;e=t>w?1:m===w?0:(m-t)/(m-w),E=p-(p-b)*e,F=A-(A-C)*e,D=k-(k-_)*e,R=S-(S-I)*e}let e;e=t<g?0:t>w?1:(g-t)/(g-w),B=f-(f-b)*e,P=y-(y-C)*e,N=x-(x-_)*e,O=v-(v-I)*e;const s=Math.round(Math.min(E,B)),i=Math.round(Math.max(E,B));let n=u*t+4*s;for(let t=s;t<=i;t++)e=(E-t)/(E-B),e<0?e=0:e>1&&(e=1),h[n++]=F-(F-P)*e|0,h[n++]=D-(D-N)*e|0,h[n++]=R-(R-O)*e|0,h[n++]=255}}function drawFigure(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,c=o-1;for(a=0;a<l;a++){let e=a*o;for(let a=0;a<c;a++,e++)drawTriangle(t,s,i[e],i[e+1],i[e+o],n[e],n[e+1],n[e+o]),drawTriangle(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)drawTriangle(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")}}var iv=class extends ev{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[6],this._background=t[7],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},d=o+4,f=l+4,g=s.getCanvas("mesh",d,f),p=g.context,m=p.createImageData(o,l);if(e){const t=m.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 t of this._figures)drawFigure(m,t,u);return p.putImageData(m,2,2),{canvas:g.canvas,offsetX:i-2*c,offsetY:n-2*h,scaleX:c,scaleY:h}}isModifyingCurrentTransform(){return!0}getPattern(t,e,s,i){applyBoundingBox(t,this._bbox);const n=new Float32Array(2);if(i===tv)Cy.singularValueDecompose2dScale(getCurrentTransform(t),n);else if(this.matrix){Cy.singularValueDecompose2dScale(this.matrix,n);const[t,s]=n;Cy.singularValueDecompose2dScale(e.baseTransform,n),n[0]*=t,n[1]*=s}else Cy.singularValueDecompose2dScale(e.baseTransform,n);const a=this._createMeshCanvas(n,i===tv?null:this._background,e.cachedCanvases);return i!==tv&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(a.offsetX,a.offsetY),t.scale(a.scaleX,a.scaleY),t.createPattern(a.canvas,"no-repeat")}},nv=class extends ev{getPattern(){return"hotpink"}},av=1,rv=2,ov=class _TilingPattern{static MAX_PATTERN_SIZE=3e3;constructor(t,e,s,i){this.color=t[1],this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.ctx=e,this.canvasGraphicsFactory=s,this.baseTransform=i}createPatternCanvas(t,e){const{bbox:s,operatorList:i,paintType:n,tilingType:a,color:r,canvasGraphicsFactory:o}=this;let{xstep:l,ystep:c}=this;l=Math.abs(l),c=Math.abs(c),info("TilingType: "+a);const h=s[0],u=s[1],d=s[2],f=s[3],g=d-h,p=f-u,m=new Float32Array(2);Cy.singularValueDecompose2dScale(this.matrix,m);const[b,w]=m;Cy.singularValueDecompose2dScale(this.baseTransform,m);const y=b*m[0],x=w*m[1];let v=g,A=p,k=!1,S=!1;const C=Math.ceil(l*y),_=Math.ceil(c*x);C>=Math.ceil(g*y)?v=l:k=!0,_>=Math.ceil(p*x)?A=c:S=!0;const I=this.getSizeAndScale(v,this.ctx.canvas.width,y),T=this.getSizeAndScale(A,this.ctx.canvas.height,x),M=t.cachedCanvases.getCanvas("pattern",I.size,T.size),E=M.context,F=o.createCanvasGraphics(E,e);if(F.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(F,n,r),E.translate(-I.scale*h,-T.scale*u),F.transform(0,I.scale,0,0,T.scale,0,0),E.save(),F.dependencyTracker?.save(),this.clipBbox(F,h,u,d,f),F.baseTransform=getCurrentTransform(F.ctx),F.executeOperatorList(i),F.endDrawing(),F.dependencyTracker?.restore(),E.restore(),k||S){const e=M.canvas;k&&(v=l),S&&(A=c);const s=this.getSizeAndScale(v,this.ctx.canvas.width,y),i=this.getSizeAndScale(A,this.ctx.canvas.height,x),n=s.size,a=i.size,r=t.cachedCanvases.getCanvas("pattern-workaround",n,a),o=r.context,d=k?Math.floor(g/l):0,f=S?Math.floor(p/c):0;for(let t=0;t<=d;t++)for(let s=0;s<=f;s++)o.drawImage(e,n*t,a*s,n,a,0,0,n,a);return{canvas:r.canvas,scaleX:s.scale,scaleY:i.scale,offsetX:h,offsetY:u}}return{canvas:M.canvas,scaleX:I.scale,scaleY:T.scale,offsetX:h,offsetY:u}}getSizeAndScale(t,e,s){const i=Math.max(_TilingPattern.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,n){const a=i-e,r=n-s;t.ctx.rect(e,s,a,r),Cy.axialAlignedBoundingBox([e,s,i,n],getCurrentTransform(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,s){const i=t.ctx,n=t.current;switch(e){case av:const{fillStyle:t,strokeStyle:a}=this.ctx;i.fillStyle=n.fillColor=t,i.strokeStyle=n.strokeColor=a;break;case rv:i.fillStyle=i.strokeStyle=s,n.fillColor=n.strokeColor=s;break;default:throw new vy(`Unsupported paint type: ${e}`)}}isModifyingCurrentTransform(){return!1}getPattern(t,e,s,i,n){let a=s;i!==tv&&(a=Cy.transform(a,e.baseTransform),this.matrix&&(a=Cy.transform(a,this.matrix)));const r=this.createPatternCanvas(e,n);let o=new DOMMatrix(a);o=o.translate(r.offsetX,r.offsetY),o=o.scale(1/r.scaleX,1/r.scaleY);const l=t.createPattern(r.canvas,"repeat");return l.setTransform(o),l}};function convertBlackAndWhiteToRGBA({src:t,srcPos:e=0,dest:s,width:i,height:n,nonBlackColor:a=4294967295,inverseDecode:r=!1}){const o=ky.isLittleEndian?4278190080:255,[l,c]=r?[a,o]:[o,a],h=i>>3,u=7&i,d=t.length;s=new Uint32Array(s.buffer);let f=0;for(let i=0;i<n;i++){for(const i=e+h;e<i;e++){const i=e<d?t[e]:255;s[f++]=128&i?c:l,s[f++]=64&i?c:l,s[f++]=32&i?c:l,s[f++]=16&i?c:l,s[f++]=8&i?c:l,s[f++]=4&i?c:l,s[f++]=2&i?c:l,s[f++]=1&i?c:l}if(0===u)continue;const i=e<d?t[e++]:255;for(let t=0;t<u;t++)s[f++]=i&1<<7-t?c:l}return{srcPos:e,destPos:f}}var lv=16,cv=new DOMMatrix,hv=new Float32Array(2),uv=new Float32Array([1/0,1/0,-1/0,-1/0]),dv=class{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 drawImageAtIntegerCoords(t,e,s,i,n,a,r,o,l,c){const[h,u,d,f,g,p]=getCurrentTransform(t);if(0===u&&0===d){const m=r*h+g,b=Math.round(m),w=o*f+p,y=Math.round(w),x=(r+l)*h+g,v=Math.abs(Math.round(x)-b)||1,A=(o+c)*f+p,k=Math.abs(Math.round(A)-y)||1;return t.setTransform(Math.sign(h),0,0,Math.sign(f),b,y),t.drawImage(e,s,i,n,a,0,0,v,k),t.setTransform(h,u,d,f,g,p),[v,k]}if(0===h&&0===f){const m=o*d+g,b=Math.round(m),w=r*u+p,y=Math.round(w),x=(o+c)*d+g,v=Math.abs(Math.round(x)-b)||1,A=(r+l)*u+p,k=Math.abs(Math.round(A)-y)||1;return t.setTransform(0,Math.sign(u),Math.sign(d),0,b,y),t.drawImage(e,s,i,n,a,0,0,k,v),t.setTransform(h,u,d,f,g,p),[k,v]}return t.drawImage(e,s,i,n,a,r,o,l,c),[Math.hypot(h,u)*l,Math.hypot(d,f)*c]}var fv=class{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=Bw;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=Kw;textRise=0;fillColor="#000000";strokeColor="#000000";patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps="none";constructor(t,e,s){s?.(this),this.clipBox=new Float32Array([0,0,t,e]),this.minMax=uv.slice()}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t}getPathBoundingBox(t=Zx,e=null){const s=this.minMax.slice();if(t===Qx){e||unreachable("Stroke bounding box must include transform."),Cy.singularValueDecompose2dScale(e,hv);const t=hv[0]*this.lineWidth/2,i=hv[1]*this.lineWidth/2;s[0]-=t,s[1]-=i,s[2]+=t,s[3]+=i}return s}updateClipFromPath(){const t=Cy.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(t){this.clipBox.set(t,0),this.minMax.set(uv,0)}getClippedPathBoundingBox(t=Zx,e=null){return Cy.intersect(this.clipBox,this.getPathBoundingBox(t,e))}};function putBinaryImageData(t,e){if(e instanceof ImageData)return void t.putImageData(e,0,0);const s=e.height,i=e.width,n=s%lv,a=(s-n)/lv,r=0===n?a:a+1,o=t.createImageData(i,lv);let l,c=0;const h=e.data,u=o.data;let d,f,g,p;if(e.kind===ey.GRAYSCALE_1BPP){const e=h.byteLength,s=new Uint32Array(u.buffer,0,u.byteLength>>2),p=s.length,m=i+7>>3,b=4294967295,w=ky.isLittleEndian?4278190080:255;for(d=0;d<r;d++){for(g=d<a?lv:n,l=0,f=0;f<g;f++){const t=e-c;let n=0;const a=t>m?i:8*t-7,r=-8&a;let o=0,u=0;for(;n<r;n+=8)u=h[c++],s[l++]=128&u?b:w,s[l++]=64&u?b:w,s[l++]=32&u?b:w,s[l++]=16&u?b:w,s[l++]=8&u?b:w,s[l++]=4&u?b:w,s[l++]=2&u?b:w,s[l++]=1&u?b:w;for(;n<a;n++)0===o&&(u=h[c++],o=128),s[l++]=u&o?b:w,o>>=1}for(;l<p;)s[l++]=0;t.putImageData(o,0,d*lv)}}else if(e.kind===ey.RGBA_32BPP){for(f=0,p=i*lv*4,d=0;d<a;d++)u.set(h.subarray(c,c+p)),c+=p,t.putImageData(o,0,f),f+=lv;d<r&&(p=i*n*4,u.set(h.subarray(c,c+p)),t.putImageData(o,0,f))}else{if(e.kind!==ey.RGB_24BPP)throw new Error(`bad image kind: ${e.kind}`);for(g=lv,p=i*g,d=0;d<r;d++){for(d>=a&&(g=n,p=i*g),l=0,f=p;f--;)u[l++]=h[c++],u[l++]=h[c++],u[l++]=h[c++],u[l++]=255;t.putImageData(o,0,d*lv)}}}function putBinaryImageMask(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const s=e.height,i=e.width,n=s%lv,a=(s-n)/lv,r=0===n?a:a+1,o=t.createImageData(i,lv);let l=0;const c=e.data,h=o.data;for(let e=0;e<r;e++){const s=e<a?lv:n;({srcPos:l}=convertBlackAndWhiteToRGBA({src:c,srcPos:l,dest:h,width:i,height:s,nonBlackColor:0})),t.putImageData(o,0,e*lv)}}function copyCtxState(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 resetCtxToDefault(t){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);const{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}function getImageSmoothingEnabled(t,e){if(e)return!0;Cy.singularValueDecompose2dScale(t,hv);const s=Math.fround(Oy.pixelRatio*Dy.PDF_TO_CSS_UNITS);return hv[0]<=s&&hv[1]<=s}var gv=["butt","round","square"],pv=["miter","round","bevel"],mv={},bv={},wv=class _CanvasGraphics{constructor(t,e,s,i,n,{optionalContentConfig:a,markedContentStack:r=null},o,l,c){this.ctx=t,this.current=new fv(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.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=r||[],this.optionalContentConfig=a,this.cachedCanvases=new dv(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=o,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=l,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=c??null}getObject(t,e,s=null){return"string"==typeof e?(this.dependencyTracker?.recordNamedDependency(t,e),e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e)):s}beginDrawing({transform:t,viewport:e,transparency:s=!1,background:i=null}){const n=this.ctx.canvas.width,a=this.ctx.canvas.height,r=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,n,a),this.ctx.fillStyle=r,s){const t=this.cachedCanvases.getCanvas("transparent",n,a);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...getCurrentTransform(this.compositeCtx))}this.ctx.save(),resetCtxToDefault(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=getCurrentTransform(this.ctx)}executeOperatorList(t,e,s,i,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,h=c?Date.now()+15:0;let u=0;const d=this.commonObjs,f=this.objs;let g,p;for(;;){if(void 0!==i&&o===i.nextBreakPoint)return i.breakIt(o,s),o;if(!n||n(o))if(g=r[o],p=a[o]??null,g!==cy.dependency)null===p?this[g](o):this[g](o,...p);else for(const t of p){this.dependencyTracker?.recordNamedData(t,o);const e=t.startsWith("g_")?d:f;if(!e.has(t))return e.get(t,s),o}if(o++,o===l)return o;if(c&&++u>10){if(Date.now()>h)return s(),o;u=0}}}#Aa(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,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)}endDrawing(){this.#Aa(),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(),this.#ka()}#ka(){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}}}_scaleImage(t,e){const s=t.width??t.displayWidth,i=t.height??t.displayHeight;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,h="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(h,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,h="prescale1"===h?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:c}}_createMaskCanvas(t,e){const s=this.ctx,{width:i,height:n}=e,a=this.current.fillColor,r=this.current.patternFill,o=getCurrentTransform(s);let l,c,h,u;if((e.bitmap||e.data)&&e.count>1){const s=e.bitmap||e.data.buffer;c=JSON.stringify(r?o:[o.slice(0,4),a]),l=this._cachedBitmapsMap.get(s),l||(l=new Map,this._cachedBitmapsMap.set(s,l));const i=l.get(c);if(i&&!r){const e=Math.round(Math.min(o[0],o[2])+o[4]),s=Math.round(Math.min(o[1],o[3])+o[5]);return this.dependencyTracker?.recordDependencies(t,Jx),{canvas:i,offsetX:e,offsetY:s}}h=i}h||(u=this.cachedCanvases.getCanvas("maskCanvas",i,n),putBinaryImageMask(u.context,e));let d=Cy.transform(o,[1/i,0,0,-1/n,0,0]);d=Cy.transform(d,[1,0,0,1,0,-n]);const f=uv.slice();Cy.axialAlignedBoundingBox([0,0,i,n],d,f);const[g,p,m,b]=f,w=Math.round(m-g)||1,y=Math.round(b-p)||1,x=this.cachedCanvases.getCanvas("fillCanvas",w,y),v=x.context,A=g,k=p;v.translate(-A,-k),v.transform(...d),h||(h=this._scaleImage(u.canvas,getCurrentTransformInverse(v)),h=h.img,l&&r&&l.set(c,h)),v.imageSmoothingEnabled=getImageSmoothingEnabled(getCurrentTransform(v),e.interpolate),drawImageAtIntegerCoords(v,h,0,0,h.width,h.height,0,0,i,n),v.globalCompositeOperation="source-in";const S=Cy.transform(getCurrentTransformInverse(v),[1,0,0,1,-A,-k]);return v.fillStyle=r?a.getPattern(s,this,S,Zx,t):a,v.fillRect(0,0,i,n),l&&!r&&(this.cachedCanvases.delete("fillCanvas"),l.set(c,x.canvas)),this.dependencyTracker?.recordDependencies(t,Jx),{canvas:x.canvas,offsetX:Math.round(A),offsetY:Math.round(k)}}setLineWidth(t,e){this.dependencyTracker?.recordSimpleData("lineWidth",t),e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(t,e){this.dependencyTracker?.recordSimpleData("lineCap",t),this.ctx.lineCap=gv[e]}setLineJoin(t,e){this.dependencyTracker?.recordSimpleData("lineJoin",t),this.ctx.lineJoin=pv[e]}setMiterLimit(t,e){this.dependencyTracker?.recordSimpleData("miterLimit",t),this.ctx.miterLimit=e}setDash(t,e,s){this.dependencyTracker?.recordSimpleData("dash",t);const i=this.ctx;void 0!==i.setLineDash&&(i.setLineDash(e),i.lineDashOffset=s)}setRenderingIntent(t,e){}setFlatness(t,e){}setGState(t,e){for(const[s,i]of e)switch(s){case"LW":this.setLineWidth(t,i);break;case"LC":this.setLineCap(t,i);break;case"LJ":this.setLineJoin(t,i);break;case"ML":this.setMiterLimit(t,i);break;case"D":this.setDash(t,i[0],i[1]);break;case"RI":this.setRenderingIntent(t,i);break;case"FL":this.setFlatness(t,i);break;case"Font":this.setFont(t,i[0],i[1]);break;case"CA":this.dependencyTracker?.recordSimpleData("strokeAlpha",t),this.current.strokeAlpha=i;break;case"ca":this.dependencyTracker?.recordSimpleData("fillAlpha",t),this.ctx.globalAlpha=this.current.fillAlpha=i;break;case"BM":this.dependencyTracker?.recordSimpleData("globalCompositeOperation",t),this.ctx.globalCompositeOperation=i;break;case"SMask":this.dependencyTracker?.recordSimpleData("SMask",t),this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.dependencyTracker?.recordSimpleData("filter",t),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(t){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,s=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(i,e,s);this.suspendedCtx=this.ctx;const a=this.ctx=n.context;a.setTransform(this.suspendedCtx.getTransform()),copyCtxState(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(t,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),copyCtxState(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,s=this.suspendedCtx;this.composeSMask(s,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()}composeSMask(t,e,s,i){const n=i[0],a=i[1],r=i[2]-n,o=i[3]-a;0!==r&&0!==o&&(this.genericComposeSMask(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())}genericComposeSMask(t,e,s,i,n,a,r,o,l,c,h){let u=t.canvas,d=o-c,f=l-h;if(a)if(d<0||f<0||d+s>u.width||f+i>u.height){const t=this.cachedCanvases.getCanvas("maskExtension",s,i),e=t.context;e.drawImage(u,-d,-f),e.globalCompositeOperation="destination-atop",e.fillStyle=a,e.fillRect(0,0,s,i),e.globalCompositeOperation="source-over",u=t.canvas,d=f=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const e=new Path2D;e.rect(d,f,s,i),t.clip(e),t.globalCompositeOperation="destination-atop",t.fillStyle=a,t.fillRect(d,f,s,i),t.restore()}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),"Alpha"===n&&r?e.filter=this.filterFactory.addAlphaFilter(r):"Luminosity"===n&&(e.filter=this.filterFactory.addLuminosityFilter(r));const g=new Path2D;g.rect(o,l,s,i),e.clip(g),e.globalCompositeOperation="destination-in",e.drawImage(u,d,f,s,i,o,l,s,i),e.restore()}save(t){this.inSMaskMode&&copyCtxState(this.ctx,this.suspendedCtx),this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone(),this.dependencyTracker?.save(t)}restore(t){this.dependencyTracker?.restore(t),0!==this.stateStack.length?(this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&copyCtxState(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null):this.inSMaskMode&&this.endSMaskMode()}transform(t,e,s,i,n,a,r){this.dependencyTracker?.recordIncrementalData("transform",t),this.ctx.transform(e,s,i,n,a,r),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,s,i){let[n]=s;if(!i)return n||=s[0]=new Path2D,void this[e](t,n);if(null!==this.dependencyTracker){const s=e===cy.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(t).recordBBox(t,this.ctx,i[0]-s,i[2]+s,i[1]-s,i[3]+s).recordDependencies(t,["transform"])}if(!(n instanceof Path2D)){const t=s[0]=new Path2D;for(let e=0,s=n.length;e<s;)switch(n[e++]){case hy:t.moveTo(n[e++],n[e++]);break;case uy:t.lineTo(n[e++],n[e++]);break;case dy:t.bezierCurveTo(n[e++],n[e++],n[e++],n[e++],n[e++],n[e++]);break;case fy:t.closePath();break;default:warn(`Unrecognized drawing path operator: ${n[e-1]}`)}n=t}Cy.axialAlignedBoundingBox(i,getCurrentTransform(this.ctx),this.current.minMax),this[e](t,n),this._pathStartIdx=t}closePath(t){this.ctx.closePath()}stroke(t,e,s=!0){const i=this.ctx,n=this.current.strokeColor;if(i.globalAlpha=this.current.strokeAlpha,this.contentVisible)if("object"==typeof n&&n?.getPattern){const s=n.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.strokeStyle=n.getPattern(i,this,getCurrentTransformInverse(i),Qx,t),s){const t=new Path2D;t.addPath(e,i.getTransform().invertSelf().multiplySelf(s)),e=t}this.rescaleAndStroke(e,!1),i.restore()}else this.rescaleAndStroke(e,!0);this.dependencyTracker?.recordDependencies(t,Gx),s&&this.consumePath(t,e,this.current.getClippedPathBoundingBox(Qx,getCurrentTransform(this.ctx))),i.globalAlpha=this.current.fillAlpha}closeStroke(t,e){this.stroke(t,e)}fill(t,e,s=!0){const i=this.ctx,n=this.current.fillColor;let a=!1;if(this.current.patternFill){const s=n.isModifyingCurrentTransform()?i.getTransform():null;if(this.dependencyTracker?.save(t),i.save(),i.fillStyle=n.getPattern(i,this,getCurrentTransformInverse(i),Zx,t),s){const t=new Path2D;t.addPath(e,i.getTransform().invertSelf().multiplySelf(s)),e=t}a=!0}const r=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==r&&(this.pendingEOFill?(i.fill(e,"evenodd"),this.pendingEOFill=!1):i.fill(e)),this.dependencyTracker?.recordDependencies(t,Wx),a&&(i.restore(),this.dependencyTracker?.restore(t)),s&&this.consumePath(t,e,r)}eoFill(t,e){this.pendingEOFill=!0,this.fill(t,e)}fillStroke(t,e){this.fill(t,e,!1),this.stroke(t,e,!1),this.consumePath(t,e)}eoFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}closeFillStroke(t,e){this.fillStroke(t,e)}closeEOFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}endPath(t,e){this.consumePath(t,e)}rawFillPath(t,e){this.ctx.fill(e),this.dependencyTracker?.recordDependencies(t,Xx).recordOperation(t)}clip(t){this.dependencyTracker?.recordFutureForcedDependency("clipMode",t),this.pendingClip=mv}eoClip(t){this.dependencyTracker?.recordFutureForcedDependency("clipMode",t),this.pendingClip=bv}beginText(t){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,this.dependencyTracker?.recordOpenMarker(t).resetIncrementalData("sameLineText").resetIncrementalData("moveText",t)}endText(t){const e=this.pendingTextPaths,s=this.ctx;if(this.dependencyTracker){const{dependencyTracker:s}=this;void 0!==e&&s.recordFutureForcedDependency("textClip",s.getOpenMarker()).recordFutureForcedDependency("textClip",t),s.recordCloseMarker(t)}if(void 0!==e){const t=new Path2D,i=s.getTransform().invertSelf();for(const{transform:s,x:n,y:a,fontSize:r,path:o}of e)o&&t.addPath(o,new DOMMatrix(s).preMultiplySelf(i).translate(n,a).scale(r,-r));s.clip(t)}delete this.pendingTextPaths}setCharSpacing(t,e){this.dependencyTracker?.recordSimpleData("charSpacing",t),this.current.charSpacing=e}setWordSpacing(t,e){this.dependencyTracker?.recordSimpleData("wordSpacing",t),this.current.wordSpacing=e}setHScale(t,e){this.dependencyTracker?.recordSimpleData("hScale",t),this.current.textHScale=e/100}setLeading(t,e){this.dependencyTracker?.recordSimpleData("leading",t),this.current.leading=-e}setFont(t,e,s){this.dependencyTracker?.recordSimpleData("font",t).recordSimpleDataFromNamed("fontObj",e,t);const i=this.commonObjs.get(e),n=this.current;if(!i)throw new Error(`Can't find font for ${e}`);if(n.fontMatrix=i.fontMatrix||Bw,0!==n.fontMatrix[0]&&0!==n.fontMatrix[3]||warn("Invalid font matrix for font "+e),s<0?(s=-s,n.fontDirection=-1):n.fontDirection=1,this.current.font=i,this.current.fontSize=s,i.isType3Font)return;const a=i.loadedName||"sans-serif",r=i.systemFontInfo?.css||`"${a}", ${i.fallbackName}`;let o="normal";i.black?o="900":i.bold&&(o="bold");const l=i.italic?"italic":"normal";let c=s;s<16?c=16:s>100&&(c=100),this.current.fontSizeScale=s/c,this.ctx.font=`${l} ${o} ${c}px ${r}`}setTextRenderingMode(t,e){this.dependencyTracker?.recordSimpleData("textRenderingMode",t),this.current.textRenderingMode=e}setTextRise(t,e){this.dependencyTracker?.recordSimpleData("textRise",t),this.current.textRise=e}moveText(t,e,s){this.dependencyTracker?.resetIncrementalData("sameLineText").recordIncrementalData("moveText",t),this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=s}setLeadingMoveText(t,e,s){this.setLeading(t,-s),this.moveText(t,e,s)}setTextMatrix(t,e){this.dependencyTracker?.recordSimpleData("textMatrix",t);const{current:s}=this;s.textMatrix=e,s.textMatrixScale=Math.hypot(e[0],e[1]),s.x=s.lineX=0,s.y=s.lineY=0}nextLine(t){this.moveText(t,0,this.current.leading),this.dependencyTracker?.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??t)}#Sa(t,e,s){const i=new Path2D;return i.addPath(t,new DOMMatrix(s).invertSelf().multiplySelf(e)),i}paintChar(t,e,s,i,n,a){const r=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,h=o.fontSize/o.fontSizeScale,u=c&Qw,d=!!(c&ty),f=o.patternFill&&!l.missingFile,g=o.patternStroke&&!l.missingFile;let p;if((l.disableFontFace||d||f||g)&&!l.missingFile&&(p=l.getPathGenerator(this.commonObjs,e)),p&&(l.disableFontFace||f||g)){let e;if(r.save(),r.translate(s,i),r.scale(h,-h),this.dependencyTracker?.recordCharacterBBox(t,r,l),u===Kw||u===Jw)if(n){e=r.getTransform(),r.setTransform(...n);const t=this.#Sa(p,e,n);r.fill(t)}else r.fill(p);if(u===Yw||u===Jw)if(a){e||=r.getTransform(),r.setTransform(...a);const{a:t,b:s,c:i,d:n}=e,o=Cy.inverseTransform(a),l=Cy.transform([t,s,i,n,0,0],o);Cy.singularValueDecompose2dScale(l,hv),r.lineWidth*=Math.max(hv[0],hv[1])/h,r.stroke(this.#Sa(p,e,a))}else r.lineWidth/=h,r.stroke(p);r.restore()}else u!==Kw&&u!==Jw||(r.fillText(e,s,i),this.dependencyTracker?.recordCharacterBBox(t,r,l,h,s,i,()=>r.measureText(e))),u!==Yw&&u!==Jw||(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(t,r,l,h,s,i,()=>r.measureText(e)).recordDependencies(t,Gx),r.strokeText(e,s,i));d&&((this.pendingTextPaths||=[]).push({transform:getCurrentTransform(r),x:s,y:i,fontSize:h,path:p}),this.dependencyTracker?.recordCharacterBBox(t,r,l,h,s,i))}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 t=3;t<e.length;t+=4)if(e[t]>0&&e[t]<255){s=!0;break}return shadow(this,"isFontSubpixelAAEnabled",s)}showText(t,e){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(t,Kx).resetBBox(t),this.current.textRenderingMode&ty&&this.dependencyTracker.recordFutureForcedDependency("textClip",t).inheritPendingDependenciesAsFutureForcedDependencies());const s=this.current,i=s.font;if(i.isType3Font)return this.showType3Text(t,e),void this.dependencyTracker?.recordShowTextOperation(t);const n=s.fontSize;if(0===n)return void this.dependencyTracker?.recordOperation(t);const a=this.ctx,r=s.fontSizeScale,o=s.charSpacing,l=s.wordSpacing,c=s.fontDirection,h=s.textHScale*c,u=e.length,d=i.vertical,f=d?1:-1,g=i.defaultVMetrics,p=n*s.fontMatrix[0],m=s.textRenderingMode===Kw&&!i.disableFontFace&&!s.patternFill;let b,w;if(a.save(),s.textMatrix&&a.transform(...s.textMatrix),a.translate(s.x,s.y+s.textRise),c>0?a.scale(h,-1):a.scale(h,1),s.patternFill){a.save();const e=s.fillColor.getPattern(a,this,getCurrentTransformInverse(a),Zx,t);b=getCurrentTransform(a),a.restore(),a.fillStyle=e}if(s.patternStroke){a.save();const e=s.strokeColor.getPattern(a,this,getCurrentTransformInverse(a),Qx,t);w=getCurrentTransform(a),a.restore(),a.strokeStyle=e}let y=s.lineWidth;const x=s.textMatrixScale;if(0===x||0===y){const t=s.textRenderingMode&Qw;t!==Yw&&t!==Jw||(y=this.getSinglePixelWidth())}else y/=x;if(1!==r&&(a.scale(r,r),y/=r),a.lineWidth=y,i.isInvalidPDFjsFont){const i=[];let n=0;for(const t of e)i.push(t.unicode),n+=t.width;const r=i.join("");if(a.fillText(r,0,0),null!==this.dependencyTracker){const e=a.measureText(r);this.dependencyTracker.recordBBox(t,this.ctx,-e.actualBoundingBoxLeft,e.actualBoundingBoxRight,-e.actualBoundingBoxAscent,e.actualBoundingBoxDescent).recordShowTextOperation(t)}return s.x+=n*p*h,a.restore(),void this.compose()}let v,A=0;for(v=0;v<u;++v){const s=e[v];if("number"==typeof s){A+=f*s*n/1e3;continue}let h=!1;const u=(s.isSpace?l:0)+o,y=s.fontChar,x=s.accent;let k,S,C,_=s.width;if(d){const t=s.vmetric||g,e=-(s.vmetric?t[1]:.5*_)*p,i=t[2]*p;_=t?-t[0]:_,k=e/r,S=(A+i)/r}else k=A/r,S=0;if(i.remeasure&&_>0){C=a.measureText(y);const t=1e3*C.width/n*r;if(_<t&&this.isFontSubpixelAAEnabled){const e=_/t;h=!0,a.save(),a.scale(e,1),k/=e}else _!==t&&(k+=(_-t)/2e3*n/r)}if(this.contentVisible&&(s.isInFont||i.missingFile))if(m&&!x)a.fillText(y,k,S),this.dependencyTracker?.recordCharacterBBox(t,a,C?{bbox:null}:i,n/r,k,S,()=>C??a.measureText(y));else if(this.paintChar(t,y,k,S,b,w),x){const e=k+n*x.offset.x/r,s=S-n*x.offset.y/r;this.paintChar(t,x.fontChar,e,s,b,w)}A+=d?_*p-u*c:_*p+u*c,h&&a.restore()}d?s.y-=A:s.x+=A*h,a.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(t)}showType3Text(t,e){const s=this.ctx,i=this.current,n=i.font,a=i.fontSize,r=i.fontDirection,o=n.vertical?1:-1,l=i.charSpacing,c=i.wordSpacing,h=i.textHScale*r,u=i.fontMatrix||Bw,d=e.length;let f,g,p,m;if(i.textRenderingMode===Zw||0===a)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,s.save(),i.textMatrix&&s.transform(...i.textMatrix),s.translate(i.x,i.y+i.textRise),s.scale(h,r);const b=this.dependencyTracker;for(this.dependencyTracker=b?new zx(b,t):null,f=0;f<d;++f){if(g=e[f],"number"==typeof g){m=o*g*a/1e3,this.ctx.translate(m,0),i.x+=m*h;continue}const t=(g.isSpace?c:0)+l,r=n.charProcOperatorList[g.operatorListId];r?this.contentVisible&&(this.save(),s.scale(a,a),s.transform(...u),this.executeOperatorList(r),this.restore()):warn(`Type3 character "${g.operatorListId}" is not available.`);const d=[g.width,0];Cy.applyTransform(d,u),p=d[0]*a+t,s.translate(p,0),i.x+=p*h}s.restore(),b&&(this.dependencyTracker=b)}setCharWidth(t,e,s){}setCharWidthAndBounds(t,e,s,i,n,a,r){const o=new Path2D;o.rect(i,n,a-i,r-n),this.ctx.clip(o),this.dependencyTracker?.recordBBox(t,this.ctx,i,a,n,r).recordClipBox(t,this.ctx,i,a,n,r),this.endPath(t)}getColorN_Pattern(t,e){let s;if("TilingPattern"===e[0]){const t=this.baseTransform||getCurrentTransform(this.ctx),i={createCanvasGraphics:(t,e)=>new _CanvasGraphics(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new zx(this.dependencyTracker,e,!0):null)};s=new ov(e,this.ctx,i,t)}else s=this._getPattern(t,e[1],e[2]);return s}setStrokeColorN(t,...e){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.current.strokeColor=this.getColorN_Pattern(t,e),this.current.patternStroke=!0}setFillColorN(t,...e){this.dependencyTracker?.recordSimpleData("fillColor",t),this.current.fillColor=this.getColorN_Pattern(t,e),this.current.patternFill=!0}setStrokeRGBColor(t,e){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor=e,this.current.patternStroke=!1}setStrokeTransparent(t){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t,e){this.dependencyTracker?.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor=e,this.current.patternFill=!1}setFillTransparent(t){this.dependencyTracker?.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,e,s=null){let i;return this.cachedPatterns.has(e)?i=this.cachedPatterns.get(e):(i=function(t){switch(t[0]){case"RadialAxial":return new sv(t);case"Mesh":return new iv(t);case"Dummy":return new nv}throw new Error(`Unknown IR type: ${t[0]}`)}(this.getObject(t,e)),this.cachedPatterns.set(e,i)),s&&(i.matrix=s),i}shadingFill(t,e){if(!this.contentVisible)return;const s=this.ctx;this.save(t);const i=this._getPattern(t,e);s.fillStyle=i.getPattern(s,this,getCurrentTransformInverse(s),tv,t);const n=getCurrentTransformInverse(s);if(n){const{width:t,height:e}=s.canvas,i=uv.slice();Cy.axialAlignedBoundingBox([0,0,t,e],n,i);const[a,r,o,l]=i;this.ctx.fillRect(a,r,o-a,l-r)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(t).recordFullPageBBox(t).recordDependencies(t,Yx).recordDependencies(t,Wx).recordOperation(t),this.compose(this.current.getClippedPathBoundingBox()),this.restore(t)}beginInlineImage(){unreachable("Should not call beginInlineImage")}beginImageData(){unreachable("Should not call beginImageData")}paintFormXObjectBegin(t,e,s){if(this.contentVisible&&(this.save(t),this.baseTransformStack.push(this.baseTransform),e&&this.transform(t,...e),this.baseTransform=getCurrentTransform(this.ctx),s)){Cy.axialAlignedBoundingBox(s,this.baseTransform,this.current.minMax);const[e,i,n,a]=s,r=new Path2D;r.rect(e,i,n-e,a-i),this.ctx.clip(r),this.dependencyTracker?.recordClipBox(t,this.ctx,e,n,i,a),this.endPath(t)}}paintFormXObjectEnd(t){this.contentVisible&&(this.restore(t),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t,e){if(!this.contentVisible)return;this.save(t),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const s=this.ctx;e.isolated||info("TODO: Support non-isolated groups."),e.knockout&&warn("Knockout groups not supported.");const i=getCurrentTransform(s);if(e.matrix&&s.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let n=uv.slice();Cy.axialAlignedBoundingBox(e.bbox,getCurrentTransform(s),n);const a=[0,0,s.canvas.width,s.canvas.height];n=Cy.intersect(n,a)||[0,0,0,0];const r=Math.floor(n[0]),o=Math.floor(n[1]),l=Math.max(Math.ceil(n[2])-r,1),c=Math.max(Math.ceil(n[3])-o,1);this.current.startNewPathAndClipBox([0,0,l,c]);let h="groupAt"+this.groupLevel;e.smask&&(h+="_smask_"+this.smaskCounter++%2);const u=this.cachedCanvases.getCanvas(h,l,c),d=u.context;d.translate(-r,-o),d.transform(...i);let f=new Path2D;const[g,p,m,b]=e.bbox;if(f.rect(g,p,m-g,b-p),e.matrix){const t=new Path2D;t.addPath(f,new DOMMatrix(e.matrix)),f=t}d.clip(f),e.smask&&this.smaskStack.push({canvas:u.canvas,context:d,offsetX:r,offsetY:o,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}),e.smask&&!this.dependencyTracker||(s.setTransform(1,0,0,1,0,0),s.translate(r,o),s.save()),copyCtxState(s,d),this.ctx=d,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(s),this.setGState(t,[["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(s),this.groupLevel++}endGroup(t,e){if(!this.contentVisible)return;this.groupLevel--;const s=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,this.dependencyTracker?.popBaseTransform(),e.smask)this.tempSMask=this.smaskStack.pop(),this.restore(t),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();const e=getCurrentTransform(this.ctx);this.restore(t),this.ctx.save(),this.ctx.setTransform(...e);const i=uv.slice();Cy.axialAlignedBoundingBox([0,0,s.canvas.width,s.canvas.height],e,i),this.ctx.drawImage(s.canvas,0,0),this.ctx.restore(),this.compose(i)}}beginAnnotation(t,e,s,i,n,a){if(this.#Aa(),resetCtxToDefault(this.ctx),this.ctx.save(),this.save(t),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),s){const n=s[2]-s[0],r=s[3]-s[1];if(a&&this.annotationCanvasMap){(i=i.slice())[4]-=s[0],i[5]-=s[1],(s=s.slice())[0]=s[1]=0,s[2]=n,s[3]=r,Cy.singularValueDecompose2dScale(getCurrentTransform(this.ctx),hv);const{viewportScale:t}=this,a=Math.ceil(n*this.outputScaleX*t),o=Math.ceil(r*this.outputScaleY*t);this.annotationCanvas=this.canvasFactory.create(a,o);const{canvas:l,context:c}=this.annotationCanvas;this.annotationCanvasMap.set(e,l),this.annotationCanvas.savedCtx=this.ctx,this.ctx=c,this.ctx.save(),this.ctx.setTransform(hv[0],0,0,-hv[1],0,r*hv[1]),resetCtxToDefault(this.ctx)}else{resetCtxToDefault(this.ctx),this.endPath(t);const e=new Path2D;e.rect(s[0],s[1],n,r),this.ctx.clip(e)}}this.current=new fv(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(t,...i),this.transform(t,...n)}endAnnotation(t){this.annotationCanvas&&(this.ctx.restore(),this.#ka(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t,e){if(!this.contentVisible)return;const s=e.count;(e=this.getObject(t,e.data,e)).count=s;const i=this.ctx,n=this._createMaskCanvas(t,e),a=n.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(a,n.offsetX,n.offsetY),this.dependencyTracker?.resetBBox(t).recordBBox(t,this.ctx,n.offsetX,n.offsetX+a.width,n.offsetY,n.offsetY+a.height).recordOperation(t),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,s,i=0,n=0,a,r){if(!this.contentVisible)return;e=this.getObject(t,e.data,e);const o=this.ctx;o.save();const l=getCurrentTransform(o);o.transform(s,i,n,a,0,0);const c=this._createMaskCanvas(t,e);o.setTransform(1,0,0,1,c.offsetX-l[4],c.offsetY-l[5]),this.dependencyTracker?.resetBBox(t);for(let e=0,h=r.length;e<h;e+=2){const h=Cy.transform(l,[s,i,n,a,r[e],r[e+1]]);o.drawImage(c.canvas,h[4],h[5]),this.dependencyTracker?.recordBBox(t,this.ctx,h[4],h[4]+c.canvas.width,h[5],h[5]+c.canvas.height)}o.restore(),this.compose(),this.dependencyTracker?.recordOperation(t)}paintImageMaskXObjectGroup(t,e){if(!this.contentVisible)return;const s=this.ctx,i=this.current.fillColor,n=this.current.patternFill;this.dependencyTracker?.resetBBox(t).recordDependencies(t,Jx);for(const a of e){const{data:e,width:r,height:o,transform:l}=a,c=this.cachedCanvases.getCanvas("maskCanvas",r,o),h=c.context;h.save(),putBinaryImageMask(h,this.getObject(t,e,a)),h.globalCompositeOperation="source-in",h.fillStyle=n?i.getPattern(h,this,getCurrentTransformInverse(s),Zx,t):i,h.fillRect(0,0,r,o),h.restore(),s.save(),s.transform(...l),s.scale(1,-1),drawImageAtIntegerCoords(s,c.canvas,0,0,r,o,0,-1,1,1),this.dependencyTracker?.recordBBox(t,s,0,r,0,o),s.restore()}this.compose(),this.dependencyTracker?.recordOperation(t)}paintImageXObject(t,e){if(!this.contentVisible)return;const s=this.getObject(t,e);s?this.paintInlineImageXObject(t,s):warn("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,s,i,n){if(!this.contentVisible)return;const a=this.getObject(t,e);if(!a)return void warn("Dependent image isn't ready yet");const r=a.width,o=a.height,l=[];for(let t=0,e=n.length;t<e;t+=2)l.push({transform:[s,0,0,i,n[t],n[t+1]],x:0,y:0,w:r,h:o});this.paintInlineImageXObjectGroup(t,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,e){if(!this.contentVisible)return;const s=e.width,i=e.height,n=this.ctx;this.save(t);const{filter:a}=n;let r;if("none"!==a&&""!==a&&(n.filter="none"),n.scale(1/s,-1/i),e.bitmap)r=this.applyTransferMapsToBitmap(e);else if("function"==typeof HTMLElement&&e instanceof HTMLElement||!e.data)r=e;else{const t=this.cachedCanvases.getCanvas("inlineImage",s,i).context;putBinaryImageData(t,e),r=this.applyTransferMapsToCanvas(t)}const o=this._scaleImage(r,getCurrentTransformInverse(n));n.imageSmoothingEnabled=getImageSmoothingEnabled(getCurrentTransform(n),e.interpolate),this.dependencyTracker?.resetBBox(t).recordBBox(t,n,0,s,-i,0).recordDependencies(t,Vx).recordOperation(t),drawImageAtIntegerCoords(n,o.img,0,0,o.paintWidth,o.paintHeight,0,-i,s,i),this.compose(),this.restore(t)}paintInlineImageXObjectGroup(t,e,s){if(!this.contentVisible)return;const i=this.ctx;let n;if(e.bitmap)n=e.bitmap;else{const t=e.width,s=e.height,i=this.cachedCanvases.getCanvas("inlineImage",t,s).context;putBinaryImageData(i,e),n=this.applyTransferMapsToCanvas(i)}this.dependencyTracker?.resetBBox(t);for(const e of s)i.save(),i.transform(...e.transform),i.scale(1,-1),drawImageAtIntegerCoords(i,n,e.x,e.y,e.w,e.h,0,-1,1,1),this.dependencyTracker?.recordBBox(t,i,0,1,-1,0),i.restore();this.dependencyTracker?.recordOperation(t),this.compose()}paintSolidColorImageMask(t){this.contentVisible&&(this.dependencyTracker?.resetBBox(t).recordBBox(t,this.ctx,0,1,0,1).recordDependencies(t,Wx).recordOperation(t),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t,e){}markPointProps(t,e,s){}beginMarkedContent(t,e){this.dependencyTracker?.beginMarkedContent(t),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e,s){this.dependencyTracker?.beginMarkedContent(t),"OC"===e?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(s)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(t){this.dependencyTracker?.endMarkedContent(t),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(t){}endCompat(t){}consumePath(t,e,s){const i=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(s);const n=this.ctx;this.pendingClip?(i||(this.pendingClip===bv?n.clip(e,"evenodd"):n.clip(e)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(t).recordFutureForcedDependency("clipPath",t)):this.dependencyTracker?.recordOperation(t),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=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,e){const{ctx:s,current:{lineWidth:i}}=this,[n,a]=this.getScaleForStroking();if(n===a)return s.lineWidth=(i||1)*n,void s.stroke(t);const r=s.getLineDash();e&&s.save(),s.scale(n,a),cv.a=1/n,cv.d=1/a;const o=new Path2D;if(o.addPath(t,cv),r.length>0){const t=Math.max(n,a);s.setLineDash(r.map(e=>e/t)),s.lineDashOffset/=t}s.lineWidth=i||1,s.stroke(o),e&&s.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}};for(const t in cy)void 0!==wv.prototype[t]&&(wv.prototype[cy[t]]=wv.prototype[t]);var yv=class _CssFontInfo{#P;#W;#V;static strings=["fontFamily","fontWeight","italicAngle"];static write(t){const e=new TextEncoder,s={};let i=0;for(const n of _CssFontInfo.strings){const a=e.encode(t[n]);s[n]=a,i+=4+a.length}const n=new ArrayBuffer(i),a=new Uint8Array(n),r=new DataView(n);let o=0;for(const t of _CssFontInfo.strings){const e=s[t],i=e.length;r.setUint32(o,i),a.set(e,o+4),o+=4+i}return assert(o===n.byteLength,"CssFontInfo.write: Buffer overflow"),n}constructor(t){this.#P=t,this.#W=new DataView(this.#P),this.#V=new TextDecoder}#X(t){assert(t<_CssFontInfo.strings.length,"Invalid string index");let e=0;for(let s=0;s<t;s++)e+=this.#W.getUint32(e)+4;const s=this.#W.getUint32(e);return this.#V.decode(new Uint8Array(this.#P,e+4,s))}get fontFamily(){return this.#X(0)}get fontWeight(){return this.#X(1)}get italicAngle(){return this.#X(2)}},xv=class _SystemFontInfo{#P;#W;#V;static strings=["css","loadedName","baseFontName","src"];static write(t){const e=new TextEncoder,s={};let i=0;for(const n of _SystemFontInfo.strings){const a=e.encode(t[n]);s[n]=a,i+=4+a.length}i+=4;let n,a,r=1+i;t.style&&(n=e.encode(t.style.style),a=e.encode(t.style.weight),r+=4+n.length+4+a.length);const o=new ArrayBuffer(r),l=new Uint8Array(o),c=new DataView(o);let h=0;c.setUint8(h++,t.guessFallback?1:0),c.setUint32(h,0),h+=4,i=0;for(const t of _SystemFontInfo.strings){const e=s[t],n=e.length;i+=4+n,c.setUint32(h,n),l.set(e,h+4),h+=4+n}return c.setUint32(h-i-4,i),t.style&&(c.setUint32(h,n.length),l.set(n,h+4),h+=4+n.length,c.setUint32(h,a.length),l.set(a,h+4),h+=4+a.length),assert(h<=o.byteLength,"SubstitionInfo.write: Buffer overflow"),o.transferToFixedLength(h)}constructor(t){this.#P=t,this.#W=new DataView(this.#P),this.#V=new TextDecoder}get guessFallback(){return 0!==this.#W.getUint8(0)}#X(t){assert(t<_SystemFontInfo.strings.length,"Invalid string index");let e=5;for(let s=0;s<t;s++)e+=this.#W.getUint32(e)+4;const s=this.#W.getUint32(e);return this.#V.decode(new Uint8Array(this.#P,e+4,s))}get css(){return this.#X(0)}get loadedName(){return this.#X(1)}get baseFontName(){return this.#X(2)}get src(){return this.#X(3)}get style(){let t=1;t+=4+this.#W.getUint32(t);const e=this.#W.getUint32(t),s=this.#V.decode(new Uint8Array(this.#P,t+4,e));t+=4+e;const i=this.#W.getUint32(t);return{style:s,weight:this.#V.decode(new Uint8Array(this.#P,t+4,i))}}},vv=class _FontInfo{static bools=["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"];static numbers=["ascent","defaultWidth","descent"];static strings=["fallbackName","loadedName","mimetype","name"];static#K=Math.ceil(2*this.bools.length/8);static#Y=this.#K+8*this.numbers.length;static#J=this.#Y+1+8;static#Z=this.#J+1+48;static#Q=this.#Z+1+6;#P;#V;#W;constructor({data:t,extra:e}){this.#P=t,this.#V=new TextDecoder,this.#W=new DataView(this.#P),e&&Object.assign(this,e)}#tt(t){assert(t<_FontInfo.bools.length,"Invalid boolean index");const e=Math.floor(t/4),s=2*t%8,i=this.#W.getUint8(e)>>s&3;return 0===i?void 0:2===i}get black(){return this.#tt(0)}get bold(){return this.#tt(1)}get disableFontFace(){return this.#tt(2)}get fontExtraProperties(){return this.#tt(3)}get isInvalidPDFjsFont(){return this.#tt(4)}get isType3Font(){return this.#tt(5)}get italic(){return this.#tt(6)}get missingFile(){return this.#tt(7)}get remeasure(){return this.#tt(8)}get vertical(){return this.#tt(9)}#et(t){return assert(t<_FontInfo.numbers.length,"Invalid number index"),this.#W.getFloat64(_FontInfo.#K+8*t)}get ascent(){return this.#et(0)}get defaultWidth(){return this.#et(1)}get descent(){return this.#et(2)}get bbox(){let t=_FontInfo.#Y;if(0===this.#W.getUint8(t))return;t+=1;const e=[];for(let s=0;s<4;s++)e.push(this.#W.getInt16(t,!0)),t+=2;return e}get fontMatrix(){let t=_FontInfo.#J;if(0===this.#W.getUint8(t))return;t+=1;const e=[];for(let s=0;s<6;s++)e.push(this.#W.getFloat64(t,!0)),t+=8;return e}get defaultVMetrics(){let t=_FontInfo.#Z;if(0===this.#W.getUint8(t))return;t+=1;const e=[];for(let s=0;s<3;s++)e.push(this.#W.getInt16(t,!0)),t+=2;return e}#X(t){assert(t<_FontInfo.strings.length,"Invalid string index");let e=_FontInfo.#Q+4;for(let s=0;s<t;s++)e+=this.#W.getUint32(e)+4;const s=this.#W.getUint32(e),i=new Uint8Array(s);return i.set(new Uint8Array(this.#P,e+4,s)),this.#V.decode(i)}get fallbackName(){return this.#X(0)}get loadedName(){return this.#X(1)}get mimetype(){return this.#X(2)}get name(){return this.#X(3)}get data(){let t=_FontInfo.#Q;t+=4+this.#W.getUint32(t),t+=4+this.#W.getUint32(t),t+=4+this.#W.getUint32(t);const e=this.#W.getUint32(t);if(0!==e)return new Uint8Array(this.#P,t+4,e)}clearData(){let t=_FontInfo.#Q;t+=4+this.#W.getUint32(t),t+=4+this.#W.getUint32(t),t+=4+this.#W.getUint32(t);const e=this.#W.getUint32(t);new Uint8Array(this.#P,t+4,e).fill(0),this.#W.setUint32(t,0)}get cssFontInfo(){let t=_FontInfo.#Q;t+=4+this.#W.getUint32(t),t+=4+this.#W.getUint32(t);const e=this.#W.getUint32(t);if(0===e)return null;const s=new Uint8Array(e);return s.set(new Uint8Array(this.#P,t+4,e)),new yv(s.buffer)}get systemFontInfo(){let t=_FontInfo.#Q;t+=4+this.#W.getUint32(t);const e=this.#W.getUint32(t);if(0===e)return null;const s=new Uint8Array(e);return s.set(new Uint8Array(this.#P,t+4,e)),new xv(s.buffer)}static write(t){const e=t.systemFontInfo?xv.write(t.systemFontInfo):null,s=t.cssFontInfo?yv.write(t.cssFontInfo):null,i=new TextEncoder,n={};let a=0;for(const e of _FontInfo.strings)n[e]=i.encode(t[e]),a+=4+n[e].length;const r=_FontInfo.#Q+4+a+4+(e?e.byteLength:0)+4+(s?s.byteLength:0)+4+(t.data?t.data.length:0),o=new ArrayBuffer(r),l=new Uint8Array(o),c=new DataView(o);let h=0;const u=_FontInfo.bools.length;let d=0,f=0;for(let e=0;e<u;e++){const s=t[_FontInfo.bools[e]];d|=(void 0===s?0:s?2:1)<<f,f+=2,8!==f&&e!==u-1||(c.setUint8(h++,d),d=0,f=0)}assert(h===_FontInfo.#K,"FontInfo.write: Boolean properties offset mismatch");for(const e of _FontInfo.numbers)c.setFloat64(h,t[e]),h+=8;if(assert(h===_FontInfo.#Y,"FontInfo.write: Number properties offset mismatch"),t.bbox){c.setUint8(h++,4);for(const e of t.bbox)c.setInt16(h,e,!0),h+=2}else c.setUint8(h++,0),h+=8;if(assert(h===_FontInfo.#J,"FontInfo.write: BBox properties offset mismatch"),t.fontMatrix){c.setUint8(h++,6);for(const e of t.fontMatrix)c.setFloat64(h,e,!0),h+=8}else c.setUint8(h++,0),h+=48;if(assert(h===_FontInfo.#Z,"FontInfo.write: FontMatrix properties offset mismatch"),t.defaultVMetrics){c.setUint8(h++,1);for(const e of t.defaultVMetrics)c.setInt16(h,e,!0),h+=2}else c.setUint8(h++,0),h+=6;assert(h===_FontInfo.#Q,"FontInfo.write: DefaultVMetrics properties offset mismatch"),c.setUint32(_FontInfo.#Q,0),h+=4;for(const t of _FontInfo.strings){const e=n[t],s=e.length;c.setUint32(h,s),l.set(e,h+4),h+=4+s}if(c.setUint32(_FontInfo.#Q,h-_FontInfo.#Q-4),e){const t=e.byteLength;c.setUint32(h,t),assert(h+4+t<=o.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),l.set(new Uint8Array(e),h+4),h+=4+t}else c.setUint32(h,0),h+=4;if(s){const t=s.byteLength;c.setUint32(h,t),assert(h+4+t<=o.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),l.set(new Uint8Array(s),h+4),h+=4+t}else c.setUint32(h,0),h+=4;return void 0===t.data?(c.setUint32(h,0),h+=4):(c.setUint32(h,t.data.length),l.set(t.data,h+4),h+=4+t.data.length),assert(h<=o.byteLength,"FontInfo.write: Buffer overflow"),o.transferToFixedLength(h)}},Av=class{static#Ca=null;static#_a="";static get workerPort(){return this.#Ca}static set workerPort(t){if(!("undefined"!=typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");this.#Ca=t}static get workerSrc(){return this.#_a}static set workerSrc(t){if("string"!=typeof t)throw new Error("Invalid `workerSrc` type.");this.#_a=t}},kv=class{#Ia;#Ta;constructor({parsedData:t,rawData:e}){this.#Ia=t,this.#Ta=e}getRaw(){return this.#Ta}get(t){return this.#Ia.get(t)??null}[Symbol.iterator](){return this.#Ia.entries()}},Sv=Symbol("INTERNAL"),Cv=class{#Ma=!1;#Ea=!1;#Fa=!1;#Da=!0;constructor(t,{name:e,intent:s,usage:i,rbGroups:n}){this.#Ma=!!(t&Ow),this.#Ea=!!(t&Lw),this.name=e,this.intent=s,this.usage=i,this.rbGroups=n}get visible(){if(this.#Fa)return this.#Da;if(!this.#Da)return!1;const{print:t,view:e}=this.usage;return this.#Ma?"OFF"!==e?.viewState:!this.#Ea||"OFF"!==t?.printState}_setVisible(t,e,s=!1){t!==Sv&&unreachable("Internal method `_setVisible` called."),this.#Fa=s,this.#Da=e}},_v=class{#Ra=null;#Ba=new Map;#Pa=null;#Na=null;constructor(t,e=Ow){if(this.renderingIntent=e,this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,this.#Na=t.order;for(const s of t.groups)this.#Ba.set(s.id,new Cv(e,s));if("OFF"===t.baseState)for(const t of this.#Ba.values())t._setVisible(Sv,!1);for(const e of t.on)this.#Ba.get(e)._setVisible(Sv,!0);for(const e of t.off)this.#Ba.get(e)._setVisible(Sv,!1);this.#Pa=this.getHash()}}#Oa(t){const e=t.length;if(e<2)return!0;const s=t[0];for(let i=1;i<e;i++){const e=t[i];let n;if(Array.isArray(e))n=this.#Oa(e);else{if(!this.#Ba.has(e))return warn(`Optional content group not found: ${e}`),!0;n=this.#Ba.get(e).visible}switch(s){case"And":if(!n)return!1;break;case"Or":if(n)return!0;break;case"Not":return!n;default:return!0}}return"And"===s}isVisible(t){if(0===this.#Ba.size)return!0;if(!t)return info("Optional content group not defined."),!0;if("OCG"===t.type)return this.#Ba.has(t.id)?this.#Ba.get(t.id).visible:(warn(`Optional content group not found: ${t.id}`),!0);if("OCMD"===t.type){if(t.expression)return this.#Oa(t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!this.#Ba.has(e))return warn(`Optional content group not found: ${e}`),!0;if(this.#Ba.get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!this.#Ba.has(e))return warn(`Optional content group not found: ${e}`),!0;if(!this.#Ba.get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!this.#Ba.has(e))return warn(`Optional content group not found: ${e}`),!0;if(!this.#Ba.get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!this.#Ba.has(e))return warn(`Optional content group not found: ${e}`),!0;if(this.#Ba.get(e).visible)return!1}return!0}return warn(`Unknown optional content policy ${t.policy}.`),!0}return warn(`Unknown group type ${t.type}.`),!0}setVisibility(t,e=!0,s=!0){const i=this.#Ba.get(t);if(i){if(s&&e&&i.rbGroups.length)for(const e of i.rbGroups)for(const s of e)s!==t&&this.#Ba.get(s)?._setVisible(Sv,!1,!0);i._setVisible(Sv,!!e,!0),this.#Ra=null}else warn(`Optional content group not found: ${t}`)}setOCGState({state:t,preserveRB:e}){let s;for(const i of t){switch(i){case"ON":case"OFF":case"Toggle":s=i;continue}const t=this.#Ba.get(i);if(t)switch(s){case"ON":this.setVisibility(i,!0,e);break;case"OFF":this.setVisibility(i,!1,e);break;case"Toggle":this.setVisibility(i,!t.visible,e)}}this.#Ra=null}get hasInitialVisibility(){return null===this.#Pa||this.getHash()===this.#Pa}getOrder(){return this.#Ba.size?this.#Na?this.#Na.slice():[...this.#Ba.keys()]:null}getGroup(t){return this.#Ba.get(t)||null}getHash(){if(null!==this.#Ra)return this.#Ra;const t=new nx;for(const[e,s]of this.#Ba)t.update(`${e}:${s.visible}`);return this.#Ra=t.hexdigest()}[Symbol.iterator](){return this.#Ba.entries()}},Iv=class{constructor(t,{disableRange:e=!1,disableStream:s=!1}){assert(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:i,initialData:n,progressiveDone:a,contentDispositionFilename:r}=t;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=r,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=t,this._isStreamingSupported=!s,this._isRangeSupported=!e,this._contentLength=i,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((t,e)=>{this._onReceiveData({begin:t,chunk:e})}),t.addProgressListener((t,e)=>{this._onProgress({loaded:t,total:e})}),t.addProgressiveReadListener(t=>{this._onReceiveData({chunk:t})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:e}){const s=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;void 0===t?this._fullRequestReader?this._fullRequestReader._enqueue(s):this._queuedChunks.push(s):assert(this._rangeReaders.some(function(e){return e._begin===t&&(e._enqueue(s),!0)}),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){void 0===t.total?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){assert(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new Tv(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const s=new Mv(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(s),s}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}},Tv=class{constructor(t,e,s=!1,i=null){this._stream=t,this._done=s||!1,this._filename=isPdfFile(i)?i:null,this._queuedChunks=e||[],this._loaded=0;for(const t of this._queuedChunks)this._loaded+=t.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=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}},Mv=class{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=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}};function createHeaders(t,e){const s=new Headers;if(!t||!e||"object"!=typeof e)return s;for(const t in e){const i=e[t];void 0!==i&&s.append(t,i)}return s}function getResponseOrigin(t){return URL.parse(t)?.origin??null}function validateRangeRequestCapabilities({responseHeaders:t,isHttp:e,rangeChunkSize:s,disableRange:i}){const n={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(t.get("Content-Length"),10);return Number.isInteger(a)?(n.suggestedLength=a,a<=2*s||i||!e||"bytes"!==t.get("Accept-Ranges")||"identity"!==(t.get("Content-Encoding")||"identity")||(n.allowRangeRequests=!0),n):n}function extractFilenameFromHeader(t){const e=t.get("Content-Disposition");if(e){let t=function(t){let e=!0,s=toParamRegExp("filename\\*","i").exec(t);if(s){s=s[1];let t=rfc2616unquote(s);return t=unescape(t),t=rfc5987decode(t),t=rfc2047decode(t),fixupEncoding(t)}if(s=function(t){const e=[];let s;const i=toParamRegExp("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 n=[];for(let t=0;t<e.length&&t in e;++t){let[s,i]=e[t];i=rfc2616unquote(i),s&&(i=unescape(i),0===t&&(i=rfc5987decode(i))),n.push(i)}return n.join("")}(t),s)return fixupEncoding(rfc2047decode(s));if(s=toParamRegExp("filename","i").exec(t),s){s=s[1];let t=rfc2616unquote(s);return t=rfc2047decode(t),fixupEncoding(t)}function toParamRegExp(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function textdecode(t,s){if(t){if(!/^[\x00-\xFF]+$/.test(s))return s;try{const i=new TextDecoder(t,{fatal:!0}),n=stringToBytes(s);s=i.decode(n),e=!1}catch{}}return s}function fixupEncoding(t){return e&&/[\x80-\xff]/.test(t)&&(t=textdecode("utf-8",t),e&&(t=textdecode("iso-8859-1",t))),t}function rfc2616unquote(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 rfc5987decode(t){const e=t.indexOf("'");return-1===e?t:textdecode(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function rfc2047decode(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 textdecode(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 textdecode(e,i)})}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(isPdfFile(t))return t}return null}function createResponseError(t,e){return new xy(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t,404===t||0===t&&e.startsWith("file:"))}function validateResponseStatus(t){return 200===t||206===t}function createFetchOptions(t,e,s){return{method:"GET",headers:t,signal:s.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function getArrayBuffer(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(warn(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}var Ev=class{_responseOrigin=null;constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=createHeaders(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return assert(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new Fv(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const s=new Dv(this,t,e);return this._rangeRequestReaders.push(s),s}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}},Fv=class{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=Promise.withResolvers(),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;const s=new Headers(t.headers),i=e.url;fetch(i,createFetchOptions(s,this._withCredentials,this._abortController)).then(e=>{if(t._responseOrigin=getResponseOrigin(e.url),!validateResponseStatus(e.status))throw createResponseError(e.status,i);this._reader=e.body.getReader(),this._headersCapability.resolve();const s=e.headers,{allowRangeRequests:n,suggestedLength:a}=validateRangeRequestCapabilities({responseHeaders:s,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=a||this._contentLength,this._filename=extractFilenameFromHeader(s),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Ay("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:getArrayBuffer(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}},Dv=class{constructor(t,e,s){this._stream=t,this._reader=null,this._loaded=0;const i=t.source;this._withCredentials=i.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!i.disableStream,this._abortController=new AbortController;const n=new Headers(t.headers);n.append("Range",`bytes=${e}-${s-1}`);const a=i.url;fetch(a,createFetchOptions(n,this._withCredentials,this._abortController)).then(e=>{const s=getResponseOrigin(e.url);if(s!==t._responseOrigin)throw new Error(`Expected range response-origin "${s}" to match "${t._responseOrigin}".`);if(!validateResponseStatus(e.status))throw createResponseError(e.status,a);this._readCapability.resolve(),this._reader=e.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:getArrayBuffer(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}},Rv=class{_responseOrigin=null;constructor({url:t,httpHeaders:e,withCredentials:s}){this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=createHeaders(this.isHttp,e),this.withCredentials=s||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}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[t,s]of this.headers)e.setRequestHeader(t,s);return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),i.expectedStatus=206):i.expectedStatus=200,e.responseType="arraybuffer",assert(t.onError,"Expected `onError` callback to be provided."),e.onerror=()=>{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){const s=this.pendingRequests[t];s&&s.onProgress?.(e)}onStateChange(t,e){const s=this.pendingRequests[t];if(!s)return;const i=s.xhr;if(i.readyState>=2&&s.onHeadersReceived&&(s.onHeadersReceived(),delete s.onHeadersReceived),4!==i.readyState)return;if(!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===i.status&&this.isHttp)return void s.onError(i.status);const n=i.status||200;if((200!==n||206!==s.expectedStatus)&&n!==s.expectedStatus)return void s.onError(i.status);const a=function(t){const e=t.response;return"string"!=typeof e?e:stringToBytes(e).buffer}(i);if(206===n){const t=i.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);e?s.onDone({begin:parseInt(e[1],10),chunk:a}):(warn('Missing or invalid "Content-Range" header.'),s.onError(0))}else a?s.onDone({begin:0,chunk:a}):s.onError(i.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()}},Bv=class{constructor(t){this._source=t,this._manager=new Rv(t),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 assert(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new Pv(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const s=new Nv(this._manager,t,e);return s.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(s),s}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}},Pv=class{constructor(t,e){this._manager=t,this._url=e.url,this._fullRequestId=t.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),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);this._manager._responseOrigin=getResponseOrigin(e.responseURL);const s=e.getAllResponseHeaders(),i=new Headers(s?s.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(t=>{const[e,...s]=t.split(": ");return[e,s.join(": ")]}):[]),{allowRangeRequests:n,suggestedLength:a}=validateRangeRequestCapabilities({responseHeaders:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=extractFilenameFromHeader(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.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=createResponseError(t,this._url),this._headersCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({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._headersCapability.promise}async read(){if(await this._headersCapability.promise,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=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersCapability.reject(t);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}},Nv=class{constructor(t,e,s){this._manager=t,this._url=t.url,this._requestId=t.request({begin:e,end:s,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){const t=getResponseOrigin(this._manager.getRequestXhr(this._requestId)?.responseURL);t!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${t}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(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 t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError??=createResponseError(t,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({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=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}},Ov=/^[a-z][a-z0-9\-+.]+:/i,Lv=class{constructor(t){this.source=t,this.url=function(t){if(Ov.test(t))return new URL(t);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(t))}(t.url),assert("file:"===this.url.protocol,"PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return assert(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new Uv(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const s=new $v(this,t,e);return this._rangeRequestReaders.push(s),s}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}},Uv=class{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=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const s=process.getBuiltinModule("fs");s.promises.lstat(this._url).then(t=>{this._contentLength=t.size,this._setReadableStream(s.createReadStream(this._url)),this._headersCapability.resolve()},t=>{"ENOENT"===t.code&&(t=createResponseError(0,this._url.href)),this._storedError=t,this._headersCapability.reject(t)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return null===t?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).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 Ay("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}},$v=class{constructor(t,e,s){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const i=t.source;this._isStreamingSupported=!i.disableStream;const n=process.getBuiltinModule("fs");this._setReadableStream(n.createReadStream(this._url,{start:e,end:s-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return null===t?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(t).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)}},Hv=Symbol("INITIAL_DATA"),jv=class{#La=Object.create(null);#Ua(t){return this.#La[t]||={...Promise.withResolvers(),data:Hv}}get(t,e=null){if(e){const s=this.#Ua(t);return s.promise.then(()=>e(s.data)),null}const s=this.#La[t];if(!s||s.data===Hv)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return s.data}has(t){const e=this.#La[t];return!!e&&e.data!==Hv}delete(t){const e=this.#La[t];return!(!e||e.data===Hv||(delete this.#La[t],0))}resolve(t,e=null){const s=this.#Ua(t);s.data=e,s.resolve()}clear(){for(const t in this.#La){const{data:e}=this.#La[t];e?.bitmap?.close()}this.#La=Object.create(null)}*[Symbol.iterator](){for(const t in this.#La){const{data:e}=this.#La[t];e!==Hv&&(yield[t,e])}}},qv=class _TextLayer{#$a=Promise.withResolvers();#Es=null;#Ha=!1;#ja=!!globalThis.FontInspector?.enabled;#qa=null;#za=null;#Ga=0;#Wa=0;#Va=null;#Xa=null;#Ka=0;#Ya=0;#Ja=Object.create(null);#Za=[];#Qa=null;#tr=[];#er=new WeakMap;#sr=null;static#ir=new Map;static#nr=new Map;static#ar=new WeakMap;static#rr=null;static#or=new Set;constructor({textContentSource:t,container:e,viewport:s}){if(t instanceof ReadableStream)this.#Qa=t;else{if("object"!=typeof t)throw new Error('No "textContentSource" parameter specified.');this.#Qa=new ReadableStream({start(e){e.enqueue(t),e.close()}})}this.#Es=this.#Xa=e,this.#Ya=s.scale*Oy.pixelRatio,this.#Ka=s.rotation,this.#za={div:null,properties:null,ctx:null};const{pageWidth:i,pageHeight:n,pageX:a,pageY:r}=s.rawDims;this.#sr=[1,0,0,-1,-a,r+n],this.#Wa=i,this.#Ga=n,_TextLayer.#lr(),setLayerDimensions(e,s),this.#$a.promise.finally(()=>{_TextLayer.#or.delete(this),this.#za=null,this.#Ja=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:e}=ky.platform;return shadow(this,"fontFamilyMap",new Map([["sans-serif",(t&&e?"Calibri, ":"")+"sans-serif"],["monospace",(t&&e?"Lucida Console, ":"")+"monospace"]]))}render(){const pump=()=>{this.#Va.read().then(({value:t,done:e})=>{e?this.#$a.resolve():(this.#qa??=t.lang,Object.assign(this.#Ja,t.styles),this.#cr(t.items),pump())},this.#$a.reject)};return this.#Va=this.#Qa.getReader(),_TextLayer.#or.add(this),pump(),this.#$a.promise}update({viewport:t,onBefore:e=null}){const s=t.scale*Oy.pixelRatio,i=t.rotation;if(i!==this.#Ka&&(e?.(),this.#Ka=i,setLayerDimensions(this.#Xa,{rotation:i})),s!==this.#Ya){e?.(),this.#Ya=s;const t={div:null,properties:null,ctx:_TextLayer.#hr(this.#qa)};for(const e of this.#tr)t.properties=this.#er.get(e),t.div=e,this.#ur(t)}}cancel(){const t=new Ay("TextLayer task cancelled.");this.#Va?.cancel(t).catch(()=>{}),this.#Va=null,this.#$a.reject(t)}get textDivs(){return this.#tr}get textContentItemsStr(){return this.#Za}#cr(t){if(this.#Ha)return;this.#za.ctx??=_TextLayer.#hr(this.#qa);const e=this.#tr,s=this.#Za;for(const i of t){if(e.length>1e5)return warn("Ignoring additional textDivs for performance reasons."),void(this.#Ha=!0);if(void 0!==i.str)s.push(i.str),this.#dr(i);else if("beginMarkedContentProps"===i.type||"beginMarkedContent"===i.type){const t=this.#Es;this.#Es=document.createElement("span"),this.#Es.classList.add("markedContent"),i.id&&this.#Es.setAttribute("id",`${i.id}`),t.append(this.#Es)}else"endMarkedContent"===i.type&&(this.#Es=this.#Es.parentNode)}}#dr(t){const e=document.createElement("span"),s={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};this.#tr.push(e);const i=Cy.transform(this.#sr,t.transform);let n=Math.atan2(i[1],i[0]);const a=this.#Ja[t.fontName];a.vertical&&(n+=Math.PI/2);let r=this.#ja&&a.fontSubstitution||a.fontFamily;r=_TextLayer.fontFamilyMap.get(r)||r;const o=Math.hypot(i[2],i[3]),l=o*_TextLayer.#fr(r,a,this.#qa);let c,h;0===n?(c=i[4],h=i[5]-l):(c=i[4]+l*Math.sin(n),h=i[5]-l*Math.cos(n));const u="calc(var(--total-scale-factor) *",d=e.style;this.#Es===this.#Xa?(d.left=`${(100*c/this.#Wa).toFixed(2)}%`,d.top=`${(100*h/this.#Ga).toFixed(2)}%`):(d.left=`${u}${c.toFixed(2)}px)`,d.top=`${u}${h.toFixed(2)}px)`),d.fontSize=`${u}${(_TextLayer.#rr*o).toFixed(2)}px)`,d.fontFamily=r,s.fontSize=o,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,this.#ja&&(e.dataset.fontName=a.fontSubstitutionLoadedName||t.fontName),0!==n&&(s.angle=n*(180/Math.PI));let f=!1;if(t.str.length>1)f=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),s=Math.abs(t.transform[3]);e!==s&&Math.max(e,s)/Math.min(e,s)>1.5&&(f=!0)}if(f&&(s.canvasWidth=a.vertical?t.height:t.width),this.#er.set(e,s),this.#za.div=e,this.#za.properties=s,this.#ur(this.#za),s.hasText&&this.#Es.append(e),s.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),this.#Es.append(t)}}#ur(t){const{div:e,properties:s,ctx:i}=t,{style:n}=e;let a="";if(_TextLayer.#rr>1&&(a=`scale(${1/_TextLayer.#rr})`),0!==s.canvasWidth&&s.hasText){const{fontFamily:t}=n,{canvasWidth:r,fontSize:o}=s;_TextLayer.#gr(i,o*this.#Ya,t);const{width:l}=i.measureText(e.textContent);l>0&&(a=`scaleX(${r*this.#Ya/l}) ${a}`)}0!==s.angle&&(a=`rotate(${s.angle}deg) ${a}`),a.length>0&&(n.transform=a)}static cleanup(){if(!(this.#or.size>0)){this.#ir.clear();for(const{canvas:t}of this.#nr.values())t.remove();this.#nr.clear()}}static#hr(t=null){let e=this.#nr.get(t||="");if(!e){const s=document.createElement("canvas");s.className="hiddenCanvasElement",s.lang=t,document.body.append(s),e=s.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#nr.set(t,e),this.#ar.set(e,{size:0,family:""})}return e}static#gr(t,e,s){const i=this.#ar.get(t);e===i.size&&s===i.family||(t.font=`${e}px ${s}`,i.size=e,i.family=s)}static#lr(){if(null!==this.#rr)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),this.#rr=t.getBoundingClientRect().height,t.remove()}static#fr(t,e,s){const i=this.#ir.get(t);if(i)return i;const n=this.#hr(s);n.canvas.width=n.canvas.height=30,this.#gr(n,30,t);const a=n.measureText(""),r=a.fontBoundingBoxAscent,o=Math.abs(a.fontBoundingBoxDescent);n.canvas.width=n.canvas.height=0;let l=.8;return r?l=r/(r+o):(ky.platform.isFirefox&&warn("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),e.ascent?l=e.ascent:e.descent&&(l=1+e.descent)),this.#ir.set(t,l),l}};function getDocument(t={}){"string"==typeof t||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new zv,{docId:s}=e,i=t.url?function(t){if(t instanceof URL)return t.href;if("string"==typeof t){if(Rw)return t;const e=URL.parse(t,window.location);if(e)return e.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(t.url):null,n=t.data?function(t){if(Rw&&"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 stringToBytes(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"==typeof t&&!isNaN(t?.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(t.data):null,a=t.httpHeaders||null,r=!0===t.withCredentials,o=t.password??null,l=t.range instanceof Gv?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:65536;let h=t.worker instanceof Xv?t.worker:null;const u=t.verbosity,d="string"!=typeof t.docBaseUrl||isDataScheme(t.docBaseUrl)?null:t.docBaseUrl,f=getFactoryUrlProp(t.cMapUrl),g=!1!==t.cMapPacked,p=t.CMapReaderFactory||(Rw?Px:_x),m=getFactoryUrlProp(t.iccUrl),b=getFactoryUrlProp(t.standardFontDataUrl),w=t.StandardFontDataFactory||(Rw?Nx:Ex),y=getFactoryUrlProp(t.wasmUrl),x=t.WasmFactory||(Rw?Ox:Dx),v=!0!==t.stopAtErrors,A=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,k=!1!==t.isEvalSupported,S="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!Rw,C="boolean"==typeof t.isImageDecoderSupported?t.isImageDecoderSupported:!Rw&&(ky.platform.isFirefox||!globalThis.chrome),_=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,I="boolean"==typeof t.disableFontFace?t.disableFontFace:Rw,T=!0===t.fontExtraProperties,M=!0===t.enableXfa,E=t.ownerDocument||globalThis.document,F=!0===t.disableRange,D=!0===t.disableStream,R=!0===t.disableAutoFetch,B=!0===t.pdfBug,P=t.CanvasFactory||(Rw?Bx:Sx),N=t.FilterFactory||(Rw?Rx:Tx),O=!0===t.enableHWA,L=!1!==t.useWasm,U=l?l.length:t.length??NaN,$="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!Rw&&!I,H="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:!!(p===_x&&w===Ex&&x===Dx&&f&&b&&y&&isValidFetchUrl(f,document.baseURI)&&isValidFetchUrl(b,document.baseURI)&&isValidFetchUrl(y,document.baseURI));setVerbosityLevel(u);const j={canvasFactory:new P({ownerDocument:E,enableHWA:O}),filterFactory:new N({docId:s,ownerDocument:E}),cMapReaderFactory:H?null:new p({baseUrl:f,isCompressed:g}),standardFontDataFactory:H?null:new w({baseUrl:b}),wasmFactory:H?null:new x({baseUrl:y})};h||(h=Xv.create({verbosity:u,port:Av.workerPort}),e._worker=h);const q={docId:s,apiVersion:"5.4.296",data:n,password:o,disableAutoFetch:R,rangeChunkSize:c,length:U,docBaseUrl:d,enableXfa:M,evaluatorOptions:{maxImageSize:A,disableFontFace:I,ignoreErrors:v,isEvalSupported:k,isOffscreenCanvasSupported:S,isImageDecoderSupported:C,canvasMaxAreaInBytes:_,fontExtraProperties:T,useSystemFonts:$,useWasm:L,useWorkerFetch:H,cMapUrl:f,iccUrl:m,standardFontDataUrl:b,wasmUrl:y}},z={ownerDocument:E,pdfBug:B,styleElement:null,loadingParams:{disableAutoFetch:R,enableXfa:M}};return h.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const t=h.messageHandler.sendWithPromise("GetDocRequest",q,n?[n.buffer]:null);let o;if(l)o=new Iv(l,{disableRange:F,disableStream:D});else if(!n){if(!i)throw new Error("getDocument - no `url` parameter provided.");const t=isValidFetchUrl(i)?Ev:Rw?Lv:Bv;o=new t({url:i,length:U,httpHeaders:a,withCredentials:r,rangeChunkSize:c,disableRange:F,disableStream:D})}return t.then(t=>{if(e.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const i=new Ax(s,t,h.port),n=new Kv(i,e,o,z,j,O);e._transport=n,i.send("Ready",null)})}).catch(e._capability.reject),e}var zv=class _PDFDocumentLoadingTask{static#Ln=0;_capability=Promise.withResolvers();_transport=null;_worker=null;docId="d"+_PDFDocumentLoadingTask.#Ln++;destroyed=!1;onPassword=null;onProgress=null;get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await(this._transport?.destroy())}catch(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}},Gv=class{#$a=Promise.withResolvers();#pr=[];#mr=[];#br=[];#wr=[];constructor(t,e,s=!1,i=null){this.length=t,this.initialData=e,this.progressiveDone=s,this.contentDispositionFilename=i}addRangeListener(t){this.#wr.push(t)}addProgressListener(t){this.#br.push(t)}addProgressiveReadListener(t){this.#mr.push(t)}addProgressiveDoneListener(t){this.#pr.push(t)}onDataRange(t,e){for(const s of this.#wr)s(t,e)}onDataProgress(t,e){this.#$a.promise.then(()=>{for(const s of this.#br)s(t,e)})}onDataProgressiveRead(t){this.#$a.promise.then(()=>{for(const e of this.#mr)e(t)})}onDataProgressiveDone(){this.#$a.promise.then(()=>{for(const t of this.#pr)t()})}transportReady(){this.#$a.resolve()}requestDataRange(t,e){unreachable("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}},Wv=class{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return 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()}getAnnotationsByType(t,e){return this._transport.getAnnotationsByType(t,e)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}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(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}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()}},Vv=class{#yr=!1;constructor(t,e,s,i=!1){this._pageIndex=t,this._pageInfo=e,this._transport=s,this._stats=i?new Py:null,this._pdfBug=i,this.commonObjs=s.commonObjs,this.objs=new jv,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:e=this.rotate,offsetX:s=0,offsetY:i=0,dontFlip:n=!1}={}){return new Ry({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:e,offsetX:s,offsetY:i,dontFlip:n})}getAnnotations({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return shadow(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,canvas:e=t.canvas,viewport:s,intent:i="display",annotationMode:n=zw.ENABLE,transform:a=null,background:r=null,optionalContentConfigPromise:o=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:h=null,isEditing:u=!1,recordOperations:d=!1,operationsFilter:f=null}){this._stats?.time("Overall");const g=this._transport.getRenderingIntent(i,n,h,u),{renderingIntent:p,cacheKey:m}=g;this.#yr=!1,o||=this._transport.getOptionalContentConfig(p);let b=this._intentStates.get(m);b||(b=Object.create(null),this._intentStates.set(m,b)),b.streamReaderCancelTimeout&&(clearTimeout(b.streamReaderCancelTimeout),b.streamReaderCancelTimeout=null);const w=!!(p&Lw);b.displayReadyCapability||(b.displayReadyCapability=Promise.withResolvers(),b.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(g));const y=Boolean(this._pdfBug&&globalThis.StepperManager?.enabled),x=!this.recordedBBoxes&&(d||y),complete=t=>{if(b.renderTasks.delete(v),x){const t=v.gfx?.dependencyTracker.take();t&&(v.stepper&&v.stepper.setOperatorBBoxes(t,v.gfx.dependencyTracker.takeDebugMetadata()),d&&(this.recordedBBoxes=t))}w&&(this.#yr=!0),this.#xr(),t?(v.capability.reject(t),this._abortOperatorList({intentState:b,reason:t instanceof Error?t:new Error(t)})):v.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},v=new Jv({callback:complete,params:{canvas:e,canvasContext:t,dependencyTracker:x?new qx(e,b.operatorList.length,y):null,viewport:s,transform:a,background:r},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:b.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!w,pdfBug:this._pdfBug,pageColors:c,enableHWA:this._transport.enableHWA,operationsFilter:f});(b.renderTasks||=new Set).add(v);const A=v.task;return Promise.all([b.displayReadyCapability.promise,o]).then(([t,e])=>{if(this.destroyed)complete();else{if(this._stats?.time("Rendering"),!(e.renderingIntent&p))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");v.initializeGraphics({transparency:t,optionalContentConfig:e}),v.operatorListChanged()}}).catch(complete),A}getOperatorList({intent:t="display",annotationMode:e=zw.ENABLE,printAnnotationStorage:s=null,isEditing:i=!1}={}){const n=this._transport.getRenderingIntent(t,e,s,i,!0);let a,r=this._intentStates.get(n.cacheKey);return r||(r=Object.create(null),this._intentStates.set(n.cacheKey,r)),r.opListReadCapability||(a=Object.create(null),a.operatorListChanged=function(){r.operatorList.lastChunk&&(r.opListReadCapability.resolve(r.operatorList),r.renderTasks.delete(a))},r.opListReadCapability=Promise.withResolvers(),(r.renderTasks||=new Set).add(a),r.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(n)),r.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(t=>My.textContent(t));const e=this.streamTextContent(t);return new Promise(function(t,s){const i=e.getReader(),n={items:[],styles:Object.create(null),lang:null};!function pump(){i.read().then(function({value:e,done:s}){s?t(n):(n.lang??=e.lang,Object.assign(n.styles,e.styles),n.items.push(...e.items),pump())},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(),this.#yr=!1,Promise.all(t)}cleanup(t=!1){this.#yr=!0;const e=this.#xr();return t&&e&&(this._stats&&=new Py),e}#xr(){if(!this.#yr||this.destroyed)return!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#yr=!1,!0}_startRenderPage(t,e){const s=this._intentStates.get(e);s&&(this._stats?.timeEnd("Page Request"),s.displayReadyCapability?.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 t of e.renderTasks)t.operatorListChanged();t.lastChunk&&this.#xr()}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageSerializable:s,modifiedIds:i}){const{map:n,transfer:a}=s,r=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:n,modifiedIds:i},a).getReader(),o=this._intentStates.get(e);o.streamReader=r;const pump=()=>{r.read().then(({value:t,done:e})=>{e?o.streamReader=null:this._transport.destroyed||(this._renderPageChunk(t,o),pump())},t=>{if(o.streamReader=null,!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(const t of o.renderTasks)t.operatorListChanged();this.#xr()}if(o.displayReadyCapability)o.displayReadyCapability.reject(t);else{if(!o.opListReadCapability)throw t;o.opListReadCapability.reject(t)}}})};pump()}_abortOperatorList({intentState:t,reason:e,force:s=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!s){if(t.renderTasks.size>0)return;if(e instanceof By){let s=100;return e.extraDelay>0&&e.extraDelay<1e3&&(s+=e.extraDelay),void(t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:e,force:!0})},s))}}if(t.streamReader.cancel(new Ay(e.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[e,s]of this._intentStates)if(s===t){this._intentStates.delete(e);break}this.cleanup()}}}get stats(){return this._stats}},Xv=class _PDFWorker{#$a=Promise.withResolvers();#vr=null;#Ca=null;#Ar=null;static#kr=0;static#Sr=!0;static#Cr=new WeakMap;static{Rw&&(this.#Sr=!0,Av.workerSrc||="./pdf.worker.mjs"),this._isSameOrigin=(t,e)=>{const s=URL.parse(t);if(!s?.origin||"null"===s.origin)return!1;const i=new URL(e,s);return s.origin===i.origin},this._createCDNWrapper=t=>{const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},this.fromPort=t=>{var e;if(e="`PDFWorker.fromPort` - please use `PDFWorker.create` instead.",console.log("Deprecated API usage: "+e),!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return this.create(t)}}constructor({name:t=null,port:e=null,verbosity:s=getVerbosityLevel()}={}){if(this.name=t,this.destroyed=!1,this.verbosity=s,e){if(_PDFWorker.#Cr.has(e))throw new Error("Cannot use more than one PDFWorker per port.");_PDFWorker.#Cr.set(e,this),this.#_r(e)}else this.#Ir()}get promise(){return this.#$a.promise}#Tr(){this.#$a.resolve(),this.#vr.send("configure",{verbosity:this.verbosity})}get port(){return this.#Ca}get messageHandler(){return this.#vr}#_r(t){this.#Ca=t,this.#vr=new Ax("main","worker",t),this.#vr.on("ready",()=>{}),this.#Tr()}#Ir(){if(_PDFWorker.#Sr||_PDFWorker.#Mr)return void this.#Er();let{workerSrc:t}=_PDFWorker;try{_PDFWorker._isSameOrigin(window.location,t)||(t=_PDFWorker._createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),s=new Ax("main","worker",e),terminateEarly=()=>{i.abort(),s.destroy(),e.terminate(),this.destroyed?this.#$a.reject(new Error("Worker was destroyed")):this.#Er()},i=new AbortController;e.addEventListener("error",()=>{this.#Ar||terminateEarly()},{signal:i.signal}),s.on("test",t=>{i.abort(),!this.destroyed&&t?(this.#vr=s,this.#Ca=e,this.#Ar=e,this.#Tr()):terminateEarly()}),s.on("ready",t=>{if(i.abort(),this.destroyed)terminateEarly();else try{sendTest()}catch{this.#Er()}});const sendTest=()=>{const t=new Uint8Array;s.send("test",t,[t.buffer])};return void sendTest()}catch{info("The worker has been disabled.")}this.#Er()}#Er(){_PDFWorker.#Sr||(warn("Setting up fake worker."),_PDFWorker.#Sr=!0),_PDFWorker._setupFakeWorkerGlobal.then(t=>{if(this.destroyed)return void this.#$a.reject(new Error("Worker was destroyed"));const e=new ux;this.#Ca=e;const s="fake"+_PDFWorker.#kr++,i=new Ax(s+"_worker",s,e);t.setup(i,e),this.#vr=new Ax(s,s+"_worker",e),this.#Tr()}).catch(t=>{this.#$a.reject(new Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0,this.#Ar?.terminate(),this.#Ar=null,_PDFWorker.#Cr.delete(this.#Ca),this.#Ca=null,this.#vr?.destroy(),this.#vr=null}static create(t){const e=this.#Cr.get(t?.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new _PDFWorker(t)}static get workerSrc(){if(Av.workerSrc)return Av.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#Mr(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return shadow(this,"_setupFakeWorkerGlobal",(async()=>this.#Mr?this.#Mr:(await(import(this.workerSrc))).WorkerMessageHandler)())}},Kv=class{#Fr=new Map;#Dr=new Map;#Zt=new Map;#Rr=new Map;#Br=null;constructor(t,e,s,i,n,a){this.messageHandler=t,this.loadingTask=e,this.commonObjs=new jv,this.fontLoader=new lx({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this.loadingParams=i.loadingParams,this._params=i,this.canvasFactory=n.canvasFactory,this.filterFactory=n.filterFactory,this.cMapReaderFactory=n.cMapReaderFactory,this.standardFontDataFactory=n.standardFontDataFactory,this.wasmFactory=n.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=s,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=a,this.setupMessageHandler()}#Pr(t,e=null){const s=this.#Fr.get(t);if(s)return s;const i=this.messageHandler.sendWithPromise(t,e);return this.#Fr.set(t,i),i}get annotationStorage(){return shadow(this,"annotationStorage",new rx)}getRenderingIntent(t,e=zw.ENABLE,s=null,i=!1,n=!1){let a=Ow,r=ax;switch(t){case"any":a=Nw;break;case"display":break;case"print":a=Lw;break;default:warn(`getRenderingIntent - invalid intent: ${t}`)}const o=a&Lw&&s instanceof ox?s:this.annotationStorage;switch(e){case zw.DISABLE:a+=Hw;break;case zw.ENABLE:break;case zw.ENABLE_FORMS:a+=Uw;break;case zw.ENABLE_STORAGE:a+=$w,r=o.serializable;break;default:warn(`getRenderingIntent - invalid annotationMode: ${e}`)}i&&(a+=jw),n&&(a+=qw);const{ids:l,hash:c}=o.modifiedIds;return{renderingIntent:a,cacheKey:[a,r.hash,c].join("_"),annotationStorageSerializable:r,modifiedIds:l}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#Br?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const e of this.#Dr.values())t.push(e._destroy());this.#Dr.clear(),this.#Zt.clear(),this.#Rr.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);return t.push(e),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#Fr.clear(),this.filterFactory.destroy(),qv.cleanup(),this._networkStream?.cancelAllRequests(new Ay("Worker was terminated.")),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)=>{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({value:t,done:s}){s?e.close():(assert(t instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(t),1,[t]))}).catch(t=>{e.error(t)})},e.onCancel=t=>{this._fullReader.cancel(t),e.ready.catch(t=>{if(!this.destroyed)throw t})}}),t.on("ReaderHeadersReady",async t=>{await this._fullReader.headersReady;const{isStreamingSupported:s,isRangeSupported:i,contentLength:n}=this._fullReader;return s&&i||(this._lastProgress&&e.onProgress?.(this._lastProgress),this._fullReader.onProgress=t=>{e.onProgress?.({loaded:t.loaded,total:t.total})}),{isStreamingSupported:s,isRangeSupported:i,contentLength:n}}),t.on("GetRangeReader",(t,e)=>{assert(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const s=this._networkStream.getRangeReader(t.begin,t.end);s?(e.onPull=()=>{s.read().then(function({value:t,done:s}){s?e.close():(assert(t instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(t),1,[t]))}).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",({pdfInfo:t})=>{this._numPages=t.numPages,this._htmlForXfa=t.htmlForXfa,delete t.htmlForXfa,e._capability.resolve(new Wv(t,this))}),t.on("DocException",t=>{e._capability.reject(wrapReason(t))}),t.on("PasswordRequest",t=>{this.#Br=Promise.withResolvers();try{if(!e.onPassword)throw wrapReason(t);const updatePassword=t=>{t instanceof Error?this.#Br.reject(t):this.#Br.resolve({password:t})};e.onPassword(updatePassword,t.code)}catch(t){this.#Br.reject(t)}return this.#Br.promise}),t.on("DataLoaded",t=>{e.onProgress?.({loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),t.on("StartRenderPage",t=>{this.destroyed||this.#Dr.get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}),t.on("commonobj",([e,s,i])=>{if(this.destroyed)return null;if(this.commonObjs.has(e))return null;switch(s){case"Font":if("error"in i){const t=i.error;warn(`Error during font loading: ${t}`),this.commonObjs.resolve(e,t);break}const n=new vv(i),a=this._params.pdfBug&&globalThis.FontInspector?.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,r=new cx(n,a,i.extra,i.charProcOperatorList);this.fontLoader.bind(r).catch(()=>t.sendWithPromise("FontFallback",{id:e})).finally(()=>{!r.fontExtraProperties&&r.data&&r.clearData(),this.commonObjs.resolve(e,r)});break;case"CopyLocalImage":const{imageRef:o}=i;assert(o,"The imageRef must be defined.");for(const t of this.#Dr.values())for(const[,s]of t.objs)if(s?.ref===o)return s.dataLen?(this.commonObjs.resolve(e,structuredClone(s)),s.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(e,i);break;default:throw new Error(`Got unknown common object type ${s}`)}return null}),t.on("obj",([t,e,s,i])=>{if(this.destroyed)return;const n=this.#Dr.get(e);if(!n.objs.has(t))if(0!==n._intentStates.size)switch(s){case"Image":case"Pattern":n.objs.resolve(t,i);break;default:throw new Error(`Got unknown object type ${s}`)}else i?.bitmap?.close()}),t.on("DocProgress",t=>{this.destroyed||e.onProgress?.({loaded:t.loaded,total:t.total})}),t.on("FetchBinaryData",async t=>{if(this.destroyed)throw new Error("Worker was destroyed.");const e=this[t.type];if(!e)throw new Error(`${t.type} not initialized, see the \`useWorkerFetch\` parameter.`);return e.fetch(t)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&warn("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},e).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=this.#Zt.get(e);if(s)return s;const i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(s=>{if(this.destroyed)throw new Error("Transport destroyed");s.refStr&&this.#Rr.set(s.refStr,t);const i=new Vv(e,s,this,this._params.pdfBug);return this.#Dr.set(e,i),i});return this.#Zt.set(e,i),i}getPageIndex(t){return isRefProxy(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return this.#Pr("GetFieldObjects")}hasJSActions(){return this.#Pr("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)}getAnnotationsByType(t,e){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:t,pageIndexesToSkip:e})}getDocJSActions(){return this.#Pr("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(t){return this.#Pr("GetOptionalContentConfig").then(e=>new _v(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=this.#Fr.get(t);if(e)return e;const s=this.messageHandler.sendWithPromise(t,null).then(t=>({info:t[0],metadata:t[1]?new kv(t[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#Fr.set(t,s),s}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of this.#Dr.values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#Fr.clear(),this.filterFactory.destroy(!0),qv.cleanup()}}cachedPageNumber(t){if(!isRefProxy(t))return null;const e=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`;return this.#Rr.get(e)??null}},Yv=class{#Nr=null;onContinue=null;onError=null;constructor(t){this.#Nr=t}get promise(){return this.#Nr.capability.promise}cancel(t=0){this.#Nr.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#Nr.operatorList;if(!t)return!1;const{annotationCanvasMap:e}=this.#Nr;return t.form||t.canvas&&e?.size>0}},Jv=class _InternalRenderTask{#Or=null;static#Lr=new WeakSet;constructor({callback:t,params:e,objs:s,commonObjs:i,annotationCanvasMap:n,operatorList:a,pageIndex:r,canvasFactory:o,filterFactory:l,useRequestAnimationFrame:c=!1,pdfBug:h=!1,pageColors:u=null,enableHWA:d=!1,operationsFilter:f=null}){this.callback=t,this.params=e,this.objs=s,this.commonObjs=i,this.annotationCanvasMap=n,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=r,this.canvasFactory=o,this.filterFactory=l,this._pdfBug=h,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===c&&"undefined"!=typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Yv(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=e.canvas,this._canvasContext=e.canvas?null:e.canvasContext,this._enableHWA=d,this._dependencyTracker=e.dependencyTracker,this._operationsFilter=f}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){if(this.cancelled)return;if(this._canvas){if(_InternalRenderTask.#Lr.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.");_InternalRenderTask.#Lr.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:s,transform:i,background:n,dependencyTracker:a}=this.params,r=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new wv(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors,a),this.gfx.beginDrawing({transform:i,viewport:s,transparency:t,background:n}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,e=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#Or&&(window.cancelAnimationFrame(this.#Or),this.#Or=null),_InternalRenderTask.#Lr.delete(this._canvas),t||=new By(`Rendering cancelled, page ${this._pageIndex+1}`,e),this.callback(t),this.task.onError?.(t)}operatorListChanged(){this.graphicsReady?(this.gfx.dependencyTracker?.growOperationsCount(this.operatorList.fnArray.length),this.stepper?.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#Or=window.requestAnimationFrame(()=>{this.#Or=null,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._operationsFilter),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),_InternalRenderTask.#Lr.delete(this._canvas),this.callback())))}},Zv="5.4.296",Qv="f56dc8601",tA=class _ColorPicker{#Ur=null;#$r=null;#Hr;#jr=null;#qr=!1;#zr=!1;#ge=null;#Gr;#Wr=null;#_e=null;static#Vr=null;static get _keyboardManager(){return shadow(this,"_keyboardManager",new Vy([[["Escape","mac+Escape"],_ColorPicker.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],_ColorPicker.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],_ColorPicker.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],_ColorPicker.prototype._moveToPrevious],[["Home","mac+Home"],_ColorPicker.prototype._moveToBeginning],[["End","mac+End"],_ColorPicker.prototype._moveToEnd]]))}constructor({editor:t=null,uiManager:e=null}){t?(this.#zr=!1,this.#ge=t):this.#zr=!0,this.#_e=t?._uiManager||e,this.#Gr=this.#_e._eventBus,this.#Hr=t?.color?.toUpperCase()||this.#_e?.highlightColors.values().next().value||"#FFFF98",_ColorPicker.#Vr||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const t=this.#Ur=document.createElement("button");t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.ariaHasPopup="true",this.#ge&&(t.ariaControls=`${this.#ge.id}_colorpicker_dropdown`);const e=this.#_e._signal;t.addEventListener("click",this.#Xr.bind(this),{signal:e}),t.addEventListener("keydown",this.#Kr.bind(this),{signal:e});const s=this.#$r=document.createElement("span");return s.className="swatch",s.ariaHidden="true",s.style.backgroundColor=this.#Hr,t.append(s),t}renderMainDropdown(){const t=this.#jr=this.#Yr();return t.ariaOrientation="horizontal",t.ariaLabelledBy="highlightColorPickerLabel",t}#Yr(){const t=document.createElement("div"),e=this.#_e._signal;t.addEventListener("contextmenu",noContextMenu,{signal:e}),t.className="dropdown",t.role="listbox",t.ariaMultiSelectable="false",t.ariaOrientation="vertical",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),this.#ge&&(t.id=`${this.#ge.id}_colorpicker_dropdown`);for(const[s,i]of this.#_e.highlightColors){const n=document.createElement("button");n.tabIndex="0",n.role="option",n.setAttribute("data-color",i),n.title=s,n.setAttribute("data-l10n-id",_ColorPicker.#Vr[s]);const a=document.createElement("span");n.append(a),a.className="swatch",a.style.backgroundColor=i,n.ariaSelected=i===this.#Hr,n.addEventListener("click",this.#Jr.bind(this,i),{signal:e}),t.append(n)}return t.addEventListener("keydown",this.#Kr.bind(this),{signal:e}),t}#Jr(t,e){e.stopPropagation(),this.#Gr.dispatch("switchannotationeditorparams",{source:this,type:Vw.HIGHLIGHT_COLOR,value:t}),this.updateColor(t)}_colorSelectFromKeyboard(t){if(t.target===this.#Ur)return void this.#Xr(t);const e=t.target.getAttribute("data-color");e&&this.#Jr(e,t)}_moveToNext(t){this.#Zr?t.target!==this.#Ur?t.target.nextSibling?.focus():this.#jr.firstChild?.focus():this.#Xr(t)}_moveToPrevious(t){t.target!==this.#jr?.firstChild&&t.target!==this.#Ur?(this.#Zr||this.#Xr(t),t.target.previousSibling?.focus()):this.#Zr&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){this.#Zr?this.#jr.firstChild?.focus():this.#Xr(t)}_moveToEnd(t){this.#Zr?this.#jr.lastChild?.focus():this.#Xr(t)}#Kr(t){_ColorPicker._keyboardManager.exec(this,t)}#Xr(t){if(this.#Zr)return void this.hideDropdown();if(this.#qr=0===t.detail,this.#Wr||(this.#Wr=new AbortController,window.addEventListener("pointerdown",this.#ve.bind(this),{signal:this.#_e.combinedSignal(this.#Wr)})),this.#Ur.ariaExpanded="true",this.#jr)return void this.#jr.classList.remove("hidden");const e=this.#jr=this.#Yr();this.#Ur.append(e)}#ve(t){this.#jr?.contains(t.target)||this.hideDropdown()}hideDropdown(){this.#jr?.classList.add("hidden"),this.#Ur.ariaExpanded="false",this.#Wr?.abort(),this.#Wr=null}get#Zr(){return this.#jr&&!this.#jr.classList.contains("hidden")}_hideDropdownFromKeyboard(){this.#zr||(this.#Zr?(this.hideDropdown(),this.#Ur.focus({preventScroll:!0,focusVisible:this.#qr})):this.#ge?.unselect())}updateColor(t){if(this.#$r&&(this.#$r.style.backgroundColor=t),!this.#jr)return;const e=this.#_e.highlightColors.values();for(const s of this.#jr.children)s.ariaSelected=e.next().value===t.toUpperCase()}destroy(){this.#Ur?.remove(),this.#Ur=null,this.#$r=null,this.#jr?.remove(),this.#jr=null}},eA=class _BasicColorPicker{#Qr=null;#ge=null;#_e=null;static#Vr=null;constructor(t){this.#ge=t,this.#_e=t._uiManager,_BasicColorPicker.#Vr||=Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"})}renderButton(){if(this.#Qr)return this.#Qr;const{editorType:t,colorType:e,colorValue:s}=this.#ge,i=this.#Qr=document.createElement("input");return i.type="color",i.value=s||"#000000",i.className="basicColorPicker",i.tabIndex=0,i.setAttribute("data-l10n-id",_BasicColorPicker.#Vr[t]),i.addEventListener("input",()=>{this.#_e.updateParams(e,i.value)},{signal:this.#_e._signal}),i}update(t){this.#Qr&&(this.#Qr.value=t)}destroy(){this.#Qr?.remove(),this.#Qr=null}hideDropdown(){}};function makeColorComp(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function scaleAndClamp(t){return Math.max(0,Math.min(255,255*t))}var sA=class{static CMYK_G([t,e,s,i]){return["G",1-Math.min(1,.3*t+.59*s+.11*e+i)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return[t=scaleAndClamp(t),t,t]}static G_HTML([t]){const e=makeColorComp(t);return`#${e}${e}${e}`}static RGB_G([t,e,s]){return["G",.3*t+.59*e+.11*s]}static RGB_rgb(t){return t.map(scaleAndClamp)}static RGB_HTML(t){return`#${t.map(makeColorComp).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,e,s,i]){return["RGB",1-Math.min(1,t+i),1-Math.min(1,s+i),1-Math.min(1,e+i)]}static CMYK_rgb([t,e,s,i]){return[scaleAndClamp(1-Math.min(1,t+i)),scaleAndClamp(1-Math.min(1,s+i)),scaleAndClamp(1-Math.min(1,e+i))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,s]){const i=1-t,n=1-e,a=1-s;return["CMYK",i,n,a,Math.min(i,n,a)]}},iA=class{create(t,e,s=!1){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",`${t}px`),i.setAttribute("height",`${e}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${t} ${e}`),i}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){unreachable("Abstract method `_createSVG` called.")}},nA=class extends iA{_createSVG(t){return document.createElementNS(Fy,t)}},aA=new WeakSet,rA=60*(new Date).getTimezoneOffset()*1e3,oA=class{static create(t){switch(t.data.annotationType){case sy.LINK:return new hA(t);case sy.TEXT:return new uA(t);case sy.WIDGET:switch(t.data.fieldType){case"Tx":return new fA(t);case"Btn":return t.data.radioButton?new mA(t):t.data.checkBox?new pA(t):new bA(t);case"Ch":return new wA(t);case"Sig":return new gA(t)}return new dA(t);case sy.POPUP:return new yA(t);case sy.FREETEXT:return new vA(t);case sy.LINE:return new AA(t);case sy.SQUARE:return new kA(t);case sy.CIRCLE:return new SA(t);case sy.POLYLINE:return new CA(t);case sy.CARET:return new IA(t);case sy.INK:return new TA(t);case sy.POLYGON:return new _A(t);case sy.HIGHLIGHT:return new MA(t);case sy.UNDERLINE:return new EA(t);case sy.SQUIGGLY:return new FA(t);case sy.STRIKEOUT:return new DA(t);case sy.STAMP:return new RA(t);case sy.FILEATTACHMENT:return new BA(t);default:return new lA(t)}}},lA=class _AnnotationElement{#to=null;#eo=!1;#so=null;constructor(t,{isRenderable:e=!1,ignoreBorder:s=!1,createQuadrilaterals:i=!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.enableComment=t.enableComment,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({contentsObj:t,richText:e}){return!(!t?.str&&!e?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return _AnnotationElement._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){const{data:t}=this,e=this.annotationStorage?.getEditor(t.id);return e?e.getData():t}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){const t=this.annotationStorage?.getEditor(this.data.id);if(t)return t.commentButtonPositionInPage;const{quadPoints:e,inkLists:s,rect:i}=this.data;let n=-1/0,a=-1/0;if(e?.length>=8){for(let t=0;t<e.length;t+=8)e[t+1]>a?(a=e[t+1],n=e[t+2]):e[t+1]===a&&(n=Math.max(n,e[t+2]));return[n,a]}if(s?.length>=1){for(const t of s)for(let e=0,s=t.length;e<s;e+=2)t[e+1]>a?(a=t[e+1],n=t[e]):t[e+1]===a&&(n=Math.max(n,t[e]));if(n!==1/0)return[n,a]}return i?[i[2],i[3]]:null}_normalizePoint(t){const{page:{view:e},viewport:{rawDims:{pageWidth:s,pageHeight:i,pageX:n,pageY:a}}}=this.parent;return t[1]=e[3]-t[1]+e[1],t[0]=100*(t[0]-n)/s,t[1]=100*(t[1]-a)/i,t}get commentText(){const{data:t}=this;return this.annotationStorage.getRawValue(`${Gw}${t.id}`)?.popup?.contents||t.contentsObj?.str||""}set commentText(t){const{data:e}=this,s={deleted:!t,contents:t||""};this.annotationStorage.updateEditor(e.id,{popup:s})||this.annotationStorage.setValue(`${Gw}${e.id}`,{id:e.id,annotationType:e.annotationType,pageIndex:this.parent.page._pageIndex,popup:s,popupRef:e.popupRef,modificationDate:new Date}),t||this.removePopup()}removePopup(){(this.#so?.popup||this.popup)?.remove(),this.#so=this.popup=null}updateEdited(t){if(!this.container)return;t.rect&&(this.#to||={rect:this.data.rect.slice(0)});const{rect:e,popup:s}=t;e&&this.#io(e);let i=this.#so?.popup||this.popup;!i&&s?.text&&(this._createPopup(s),i=this.#so.popup),i&&(i.updateEdited(t),s?.deleted&&(i.remove(),this.#so=null,this.popup=null))}resetEdited(){this.#to&&(this.#io(this.#to.rect),this.#so?.popup.resetEdited(),this.#to=null)}#io(t){const{container:{style:e},data:{rect:s,rotation:i},parent:{viewport:{rawDims:{pageWidth:n,pageHeight:a,pageX:r,pageY:o}}}}=this;s?.splice(0,4,...t),e.left=100*(t[0]-r)/n+"%",e.top=100*(a-t[3]+o)/a+"%",0===i?(e.width=100*(t[2]-t[0])/n+"%",e.height=100*(t[3]-t[1])/a+"%"):this.setRotation(i)}_createContainer(t){const{data:e,parent:{page:s,viewport:i}}=this,n=document.createElement("section");n.setAttribute("data-annotation-id",e.id),this instanceof dA||this instanceof hA||(n.tabIndex=0);const{style:a}=n;if(a.zIndex=this.parent.zIndex,this.parent.zIndex+=2,e.alternativeText&&(n.title=e.alternativeText),e.noRotate&&n.classList.add("norotate"),!e.rect||this instanceof yA){const{rotation:t}=e;return e.hasOwnCanvas||0===t||this.setRotation(t,n),n}const{width:r,height:o}=this;if(!t&&e.borderStyle.width>0){a.borderWidth=`${e.borderStyle.width}px`;const t=e.borderStyle.horizontalCornerRadius,s=e.borderStyle.verticalCornerRadius;if(t>0||s>0){const e=`calc(${t}px * var(--total-scale-factor)) / calc(${s}px * var(--total-scale-factor))`;a.borderRadius=e}else if(this instanceof mA){const t=`calc(${r}px * var(--total-scale-factor)) / calc(${o}px * var(--total-scale-factor))`;a.borderRadius=t}switch(e.borderStyle.style){case iy:a.borderStyle="solid";break;case ny:a.borderStyle="dashed";break;case ay:warn("Unimplemented border style: beveled");break;case ry:warn("Unimplemented border style: inset");break;case oy:a.borderBottomStyle="solid"}const i=e.borderColor||null;i?(this.#eo=!0,a.borderColor=Cy.makeHexColor(0|i[0],0|i[1],0|i[2])):a.borderWidth=0}const l=Cy.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]]),{pageWidth:c,pageHeight:h,pageX:u,pageY:d}=i.rawDims;a.left=100*(l[0]-u)/c+"%",a.top=100*(l[1]-d)/h+"%";const{rotation:f}=e;return e.hasOwnCanvas||0===f?(a.width=100*r/c+"%",a.height=100*o/h+"%"):this.setRotation(f,n),n}setRotation(t,e=this.container){if(!this.data.rect)return;const{pageWidth:s,pageHeight:i}=this.parent.viewport.rawDims;let{width:n,height:a}=this;t%180!=0&&([n,a]=[a,n]),e.style.width=100*n/s+"%",e.style.height=100*a/i+"%",e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const setColor=(t,e,s)=>{const i=s.detail[t],n=i[0],a=i.slice(1);s.target.style[e]=sA[`${n}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[e]:sA[`${n}_rgb`](a)})};return 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:t=>{setColor("bgColor","backgroundColor",t)},fillColor:t=>{setColor("fillColor","backgroundColor",t)},fgColor:t=>{setColor("fgColor","color",t)},textColor:t=>{setColor("textColor","color",t)},borderColor:t=>{setColor("borderColor","borderColor",t)},strokeColor:t=>{setColor("strokeColor","borderColor",t)},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];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.map(t=>Math.fround(t));if(8===t.length){const[a,r,o,l]=t.subarray(2,6);if(i===a&&n===r&&e===o&&s===l)return}const{style:a}=this.container;let r;if(this.#eo){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="${t}" stroke-width="${e}">`],this.container.classList.add("hasBorder")}const o=i-e,l=n-s,{svgFactory:c}=this,h=c.createElement("svg");h.classList.add("quadrilateralsContainer"),h.setAttribute("width",0),h.setAttribute("height",0),h.role="none";const u=c.createElement("defs");h.append(u);const d=c.createElement("clipPath"),f=`clippath_${this.data.id}`;d.setAttribute("id",f),d.setAttribute("clipPathUnits","objectBoundingBox"),u.append(d);for(let s=2,i=t.length;s<i;s+=8){const i=t[s],a=t[s+1],h=t[s+2],u=t[s+3],f=c.createElement("rect"),g=(h-e)/o,p=(n-a)/l,m=(i-h)/o,b=(a-u)/l;f.setAttribute("x",g),f.setAttribute("y",p),f.setAttribute("width",m),f.setAttribute("height",b),d.append(f),r?.push(`<rect vector-effect="non-scaling-stroke" x="${g}" y="${p}" width="${m}" height="${b}"/>`)}this.#eo&&(r.push("</g></svg>')"),a.backgroundImage=r.join("")),this.container.append(h),this.container.style.clipPath=`url(#${f})`}_createPopup(t=null){const{data:e}=this;let s,i;t?(s={str:t.text},i=t.date):(s=e.contentsObj,i=e.modificationDate);const n=this.#so=new yA({data:{color:e.color,titleObj:e.titleObj,modificationDate:i,contentsObj:s,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]});this.parent._commentManager||this.parent.div.append(n.render())}get hasPopupElement(){return!!(this.#so||this.popup||this.data.popupRef)}get extraPopupElement(){return this.#so}render(){unreachable("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){const s=[];if(this._fieldObjects){const i=this._fieldObjects[t];if(i)for(const{page:t,id:n,exportValues:a}of i){if(-1===t)continue;if(n===e)continue;const i="string"==typeof a?a:null,r=document.querySelector(`[data-element-id="${n}"]`);!r||aA.has(r)?s.push({id:n,exportValue:i,domElement:r}):warn(`_getElementsByName - element not allowed: ${n}`)}return s}for(const i of document.getElementsByName(t)){const{exportValue:t}=i,n=i.getAttribute("data-element-id");n!==e&&aA.has(i)&&s.push({id:n,exportValue:t,domElement:i})}return s}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}},cA=class extends lA{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.editor=t.editor}render(){return this.container.className="editorAnnotation",this.container}createOrUpdatePopup(){const{editor:t}=this;t.hasComment&&(this._createPopup(t.comment),this.extraPopupElement.popup.renderCommentButton())}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(t){this.editor.comment=t,t||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.container.remove(),this.container=null,this.removePopup()}},hA=class extends lA{constructor(t,e=null){super(t,{isRenderable:!0,ignoreBorder:!!e?.ignoreBorder,createQuadrilaterals:!0}),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,t.overlaidText),i=!0):t.attachment?(this.#no(s,t.attachment,t.overlaidText,t.attachmentDest),i=!0):t.setOCGState?(this.#ao(s,t.setOCGState,t.overlaidText),i=!0):t.dest?(this._bindLink(s,t.dest,t.overlaidText),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}#ro(){this.container.setAttribute("data-internal-link","")}_bindLink(t,e,s=""){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&this.#ro(),s&&(t.title=s)}_bindNamedAction(t,e,s=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),s&&(t.title=s),this.#ro()}#no(t,e,s="",i=null){t.href=this.linkService.getAnchorUrl(""),e.description?t.title=e.description:s&&(t.title=s),t.onclick=()=>(this.downloadManager?.openOrDownloadData(e.content,e.filename,i),!1),this.#ro()}#ao(t,e,s=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),s&&(t.title=s),this.#ro()}_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]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:i}}),!1))}e.overlaidText&&(t.title=e.overlaidText),t.onclick||(t.onclick=()=>!1),this.#ro()}_bindResetFormAction(t,e){const s=t.onclick;if(s||(t.href=this.linkService.getAnchorUrl("")),this.#ro(),!this._fieldObjects)return warn('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(s||(t.onclick=()=>!1));t.onclick=()=>{s?.();const{fields:t,refs:i,include:n}=e,a=[];if(0!==t.length||0!==i.length){const e=new Set(i);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)===n&&a.push(s)}else for(const t of Object.values(this._fieldObjects))a.push(...t);const r=this.annotationStorage,o=[];for(const t of a){const{id:e}=t;switch(o.push(e),t.type){case"text":{const s=t.defaultValue||"";r.setValue(e,{value:s});break}case"checkbox":case"radiobutton":{const s=t.defaultValue===t.exportValues;r.setValue(e,{value:s});break}case"combobox":case"listbox":{const s=t.defaultValue||"";r.setValue(e,{value:s});break}default:continue}const s=document.querySelector(`[data-element-id="${e}"]`);s&&(aA.has(s)?s.dispatchEvent(new Event("resetform")):warn(`_bindResetFormAction - element not allowed: ${e}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}}),!1}}},uA=class extends lA{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.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}},dA=class extends lA{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&("CANVAS"===t.previousSibling?.nodeName&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return ky.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,s,i,n){s.includes("mouse")?t.addEventListener(s,t=>{this.linkService.eventBus?.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=>{if("blur"===s){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===s){if(e.focused)return;e.focused=!0}n&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:n(t)}})})}_setEventListeners(t,e,s,i){for(const[n,a]of s)("Action"===a||this.data.actions?.[a])&&("Focus"!==a&&"Blur"!==a||(e||={focused:!1}),this._setEventListener(t,e,n,a,i),"Focus"!==a||this.data.actions?.Blur?"Blur"!==a||this.data.actions?.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":Cy.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:s}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||9,n=t.style;let a;const roundToOneDecimal=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/(Pw*i))||1);a=Math.min(i,roundToOneDecimal(e/Pw))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(i,roundToOneDecimal(t/Pw))}n.fontSize=`calc(${a}px * var(--total-scale-factor))`,n.color=Cy.makeHexColor(s[0],s[1],s[2]),null!==this.data.textAlignment&&(n.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}},fA=class extends dA{constructor(t){super(t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!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){const i=t.getValue(e,{value:this.data.fieldValue});let n=i.value||"";const a=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;a&&n.length>a&&(n=n.slice(0,a));let r=i.formattedValue||this.data.textContent?.join("\n")||null;r&&this.data.comb&&(r=r.replaceAll(/\s+/g,""));const o={userValue:n,formattedValue:r,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(s=document.createElement("textarea"),s.textContent=r??n,this.data.doNotScroll&&(s.style.overflowY="hidden")):(s=document.createElement("input"),s.type=this.data.password?"password":"text",s.setAttribute("value",r??n),this.data.doNotScroll&&(s.style.overflowX="hidden")),this.data.hasOwnCanvas&&(s.hidden=!0),aA.add(s),s.setAttribute("data-element-id",e),s.disabled=this.data.readOnly,s.name=this.data.fieldName,s.tabIndex=0;const{datetimeFormat:l,datetimeType:c,timeStep:h}=this.data,u=!!c&&this.enableScripting;l&&(s.title=l),this._setRequired(s,this.data.required),a&&(s.maxLength=a),s.addEventListener("input",i=>{t.setValue(e,{value:i.target.value}),this.setPropertyOnSiblings(s,"value",i.target.value,"value"),o.formattedValue=null}),s.addEventListener("resetform",t=>{const e=this.data.defaultFieldValue??"";s.value=o.userValue=e,o.formattedValue=null});let blurListener=t=>{const{formattedValue:e}=o;null!=e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){s.addEventListener("focus",t=>{if(o.focused)return;const{target:e}=t;if(u&&(e.type=c,h&&(e.step=h)),o.userValue){const t=o.userValue;if(u)if("time"===c){const s=new Date(t),i=[s.getHours(),s.getMinutes(),s.getSeconds()];e.value=i.map(t=>t.toString().padStart(2,"0")).join(":")}else e.value=new Date(t-rA).toISOString().split("date"===c?"T":".",1)[0];else e.value=t}o.lastCommittedValue=e.value,o.commitKey=1,this.data.actions?.Focus||(o.focused=!0)}),s.addEventListener("updatefromsandbox",s=>{this.showElementAndHideCanvas(s.target);const i={value(s){o.userValue=s.detail.value??"",u||t.setValue(e,{value:o.userValue.toString()}),s.target.value=o.userValue},formattedValue(s){const{formattedValue:i}=s.detail;o.formattedValue=i,null!=i&&s.target!==document.activeElement&&(s.target.value=i);const n={formattedValue:i};u&&(n.value=i),t.setValue(e,n)},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:s=>{const{charLimit:i}=s.detail,{target:n}=s;if(0===i)return void n.removeAttribute("maxLength");n.setAttribute("maxLength",i);let a=o.userValue;!a||a.length<=i||(a=a.slice(0,i),n.value=o.userValue=a,t.setValue(e,{value:a}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,willCommit:!0,commitKey:1,selStart:n.selectionStart,selEnd:n.selectionEnd}}))}};this._dispatchEventFromSandbox(i,s)}),s.addEventListener("keydown",t=>{o.commitKey=1;let s=-1;if("Escape"===t.key?s=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(o.commitKey=3):s=2,-1===s)return;const{value:i}=t.target;o.lastCommittedValue!==i&&(o.lastCommittedValue=i,o.userValue=i,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:i,willCommit:!0,commitKey:s,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))});const i=blurListener;blurListener=null,s.addEventListener("blur",t=>{if(!o.focused||!t.relatedTarget)return;this.data.actions?.Blur||(o.focused=!1);const{target:s}=t;let{value:n}=s;if(u){if(n&&"time"===c){const t=n.split(":").map(t=>parseInt(t,10));n=new Date(2e3,0,1,t[0],t[1],t[2]||0).valueOf(),s.step=""}else n.includes("T")||(n=`${n}T00:00`),n=new Date(n).valueOf();s.type="text"}o.userValue=n,o.lastCommittedValue!==n&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:o.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}),i(t)}),this.data.actions?.Keystroke&&s.addEventListener("beforeinput",t=>{o.lastCommittedValue=null;const{data:s,target:i}=t,{value:n,selectionStart:a,selectionEnd:r}=i;let l=a,c=r;switch(t.inputType){case"deleteWordBackward":{const t=n.substring(0,a).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=n.substring(a).match(/^[^\w]*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":a===r&&(l-=1);break;case"deleteContentForward":a===r&&(c+=1)}t.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,change:s||"",willCommit:!1,selStart:l,selEnd:c}})}),this._setEventListeners(s,o,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}if(blurListener&&s.addEventListener("blur",blurListener),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/a;s.classList.add("comb"),s.style.letterSpacing=`calc(${t}px * var(--total-scale-factor) - 1ch)`}}else s=document.createElement("div"),s.textContent=this.data.fieldValue,s.style.verticalAlign="middle",s.style.display="table-cell",this.data.hasOwnCanvas&&(s.hidden=!0);return this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}},gA=class extends dA{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}},pA=class extends dA{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 aA.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=0,n.addEventListener("change",i=>{const{name:n,checked:a}=i.target;for(const i of this._getElementsByName(n,s)){const s=a&&i.exportValue===e.exportValue;i.domElement&&(i.domElement.checked=s),t.setValue(i.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}},mA=class extends dA{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;if("string"==typeof i&&(i=i!==e.buttonValue,t.setValue(s,{value:i})),i)for(const i of this._getElementsByName(e.fieldName,s))t.setValue(i.id,{value:!1});const n=document.createElement("input");if(aA.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=0,n.addEventListener("change",e=>{const{name:i,checked:n}=e.target;for(const e of this._getElementsByName(i,s))t.setValue(e.id,{value:!1});t.setValue(s,{value:n})}),n.addEventListener("resetform",t=>{const s=e.defaultFieldValue;t.target.checked=null!=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}},bA=class extends hA{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({},t)})),t}},wA=class extends dA{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");aA.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=0;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 t of i.options)t.selected=t.value===e});for(const t of this.data.options){const e=document.createElement("option");e.textContent=t.displayValue,e.value=t.exportValue,s.value.includes(t.exportValue)&&(e.setAttribute("selected",!0),n=!1),i.append(e)}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 getValue=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 r=getValue(!1);const getItems=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){a?.();const n=s.detail.value,o=new Set(Array.isArray(n)?n:[n]);for(const t of i.options)t.selected=o.has(t.value);t.setValue(e,{value:getValue(!0)}),r=getValue(!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:getValue(!0),items:getItems(s)}),r=getValue(!1)},clear(s){for(;0!==i.length;)i.remove(0);t.setValue(e,{value:null,items:[]}),r=getValue(!1)},insert(s){const{index:n,displayValue:a,exportValue:o}=s.detail.insert,l=i.children[n],c=document.createElement("option");c.textContent=a,c.value=o,l?l.before(c):i.append(c),t.setValue(e,{value:getValue(!0),items:getItems(s)}),r=getValue(!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:getValue(!0),items:getItems(s)}),r=getValue(!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:getValue(!0)}),r=getValue(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(n,s)}),i.addEventListener("input",s=>{const i=getValue(!0),n=getValue(!1);t.setValue(e,{value:i}),s.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,change:n,changeEx:i,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:getValue(!0)})}),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}},yA=class extends lA{constructor(t){const{data:e,elements:s,parent:i}=t,n=!!i._commentManager;if(super(t,{isRenderable:!n&&lA._hasPopupData(e)}),this.elements=s,n&&lA._hasPopupData(e)){const t=this.popup=this.#oo();for(const e of s)e.popup=t}else this.popup=null}#oo(){return new xA({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,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,commentManager:this.parent._commentManager})}render(){const{container:t}=this;t.classList.add("popupAnnotation"),t.role="comment";const e=this.popup=this.#oo(),s=[];for(const t of this.elements)t.popup=e,t.container.ariaHasPopup="dialog",s.push(t.data.id),t.addHighlightArea();return this.container.setAttribute("aria-controls",s.map(t=>`${Ty}${t}`).join(",")),this.container}},xA=class{#Xe=null;#lo=this.#Kr.bind(this);#co=this.#ho.bind(this);#uo=this.#do.bind(this);#fo=this.#go.bind(this);#po=null;#Es=null;#mo=null;#bo=null;#wo=null;#yo=null;#xo=null;#vo=!1;#Ao=null;#ko=null;#Oe=null;#So=null;#Co=null;#vi=null;#_o=null;#wi=null;#Io=null;#to=null;#To=!1;#Mo=null;#Eo=null;constructor({container:t,color:e,elements:s,titleObj:i,modificationDate:n,contentsObj:a,richText:r,parent:o,rect:l,parentRect:c,open:h,commentManager:u=null}){this.#Es=t,this.#Io=i,this.#mo=a,this.#wi=r,this.#yo=o,this.#po=e,this.#_o=l,this.#xo=c,this.#wo=s,this.#Xe=u,this.#Mo=s[0],this.#bo=Ny.toDateObject(n),this.trigger=s.flatMap(t=>t.getElementsToTriggerPopup()),u?this.renderCommentButton():(this.#Fo(),this.#Es.hidden=!0,h&&this.#go())}#Fo(){if(this.#ko)return;this.#ko=new AbortController;const{signal:t}=this.#ko;for(const e of this.trigger)e.addEventListener("click",this.#fo,{signal:t}),e.addEventListener("pointerenter",this.#uo,{signal:t}),e.addEventListener("pointerleave",this.#co,{signal:t}),e.classList.add("popupTriggerArea");for(const e of this.#wo)e.container?.addEventListener("keydown",this.#lo,{signal:t})}#Do(){const t=this.#wo.find(t=>t.hasCommentButton);t&&(this.#Co=t._normalizePoint(t.commentButtonPosition))}renderCommentButton(){if(this.#So)return;if(this.#Co||this.#Do(),!this.#Co)return;const{signal:t}=this.#ko=new AbortController,e=!!this.#Mo.extraPopupElement,togglePopup=()=>{this.#Xe.toggleCommentPopup(this,!0,void 0,!e)},showPopup=()=>{this.#Xe.toggleCommentPopup(this,!1,!0,!e)},hidePopup=()=>{this.#Xe.toggleCommentPopup(this,!1,!1)};if(e){this.#So=this.#Mo.container;for(const e of this.trigger)e.ariaHasPopup="dialog",e.ariaControls="commentPopup",e.addEventListener("keydown",this.#lo,{signal:t}),e.addEventListener("click",togglePopup,{signal:t}),e.addEventListener("pointerenter",showPopup,{signal:t}),e.addEventListener("pointerleave",hidePopup,{signal:t}),e.classList.add("popupTriggerArea")}else{const e=this.#So=document.createElement("button");e.className="annotationCommentButton";const s=this.#Mo.container;e.style.zIndex=s.style.zIndex+1,e.tabIndex=0,e.ariaHasPopup="dialog",e.ariaControls="commentPopup",e.setAttribute("data-l10n-id","pdfjs-show-comment-button"),this.#Ro(),this.#Bo(),e.addEventListener("keydown",this.#lo,{signal:t}),e.addEventListener("click",togglePopup,{signal:t}),e.addEventListener("pointerenter",showPopup,{signal:t}),e.addEventListener("pointerleave",hidePopup,{signal:t}),s.after(e)}}#Bo(){if(this.#Mo.extraPopupElement&&!this.#Mo.editor)return;this.renderCommentButton();const[t,e]=this.#Co,{style:s}=this.#So;s.left=`calc(${t}%)`,s.top=`calc(${e}% - var(--comment-button-dim))`}#Ro(){this.#Mo.extraPopupElement||(this.renderCommentButton(),this.#So.style.backgroundColor=this.commentButtonColor||"")}get commentButtonColor(){const{color:t,opacity:e}=this.#Mo.commentData;return t?this.#yo._commentManager.makeCommentColor(t,e):null}focusCommentButton(){setTimeout(()=>{this.#So?.focus()},0)}getData(){const{richText:t,color:e,opacity:s,creationDate:i,modificationDate:n}=this.#Mo.commentData;return{contentsObj:{str:this.comment},richText:t,color:e,opacity:s,creationDate:i,modificationDate:n}}get elementBeforePopup(){return this.#So}get comment(){return this.#Eo||=this.#Mo.commentText,this.#Eo}set comment(t){t!==this.comment&&(this.#Mo.commentText=this.#Eo=t)}get parentBoundingClientRect(){return this.#Mo.layer.getBoundingClientRect()}setCommentButtonStates({selected:t,hasPopup:e}){this.#So&&(this.#So.classList.toggle("selected",t),this.#So.ariaExpanded=e)}setSelectedCommentButton(t){this.#So.classList.toggle("selected",t)}get commentPopupPosition(){if(this.#vi)return this.#vi;const{x:t,y:e,height:s}=this.#So.getBoundingClientRect(),{x:i,y:n,width:a,height:r}=this.#Mo.layer.getBoundingClientRect();return[(t-i)/a,(e+s-n)/r]}set commentPopupPosition(t){this.#vi=t}hasDefaultPopupPosition(){return null===this.#vi}get commentButtonPosition(){return this.#Co}get commentButtonWidth(){return this.#So.getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(t){const[e,s]=this.#vi||this.commentButtonPosition.map(t=>t/100),i=this.parentBoundingClientRect,{x:n,y:a,width:r,height:o}=i;this.#Xe.showDialog(null,this,n+e*r,a+s*o,{...t,parentDimensions:i})}render(){if(this.#Ao)return;const t=this.#Ao=document.createElement("div");if(t.className="popup",this.#po){const e=t.style.outlineColor=Cy.makeHexColor(...this.#po);t.style.backgroundColor=`color-mix(in srgb, ${e} 30%, white)`}const e=document.createElement("span");if(e.className="header",this.#Io?.str){const t=document.createElement("span");t.className="title",e.append(t),({dir:t.dir,str:t.textContent}=this.#Io)}if(t.append(e),this.#bo){const t=document.createElement("time");t.className="popupDate",t.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),t.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#bo.valueOf()})),t.dateTime=this.#bo.toISOString(),e.append(t)}renderRichText({html:this.#Po||this.#mo.str,dir:this.#mo?.dir,className:"popupContent"},t),this.#Es.append(t)}get#Po(){const t=this.#wi,e=this.#mo;return!t?.str||e?.str&&e.str!==t.str?null:this.#wi.html||null}get#No(){return this.#Po?.attributes?.style?.fontSize||0}get#Oo(){return this.#Po?.attributes?.style?.color||null}#Lo(t){const e=[],s={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},i={style:{color:this.#Oo,fontSize:this.#No?`calc(${this.#No}px * var(--total-scale-factor))`:""}};for(const s of t.split("\n"))e.push({name:"span",value:s,attributes:i});return s}#Kr(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&this.#vo)&&this.#go()}updateEdited({rect:t,popup:e,deleted:s}){if(this.#Xe)return s?(this.remove(),this.#Eo=null):e&&(e.deleted?this.remove():(this.#Ro(),this.#Eo=e.text)),void(t&&(this.#Co=null,this.#Do(),this.#Bo()));s||e?.deleted?this.remove():(this.#Fo(),this.#to||={contentsObj:this.#mo,richText:this.#wi},t&&(this.#Oe=null),e&&e.text&&(this.#wi=this.#Lo(e.text),this.#bo=Ny.toDateObject(e.date),this.#mo=null),this.#Ao?.remove(),this.#Ao=null)}resetEdited(){this.#to&&(({contentsObj:this.#mo,richText:this.#wi}=this.#to),this.#to=null,this.#Ao?.remove(),this.#Ao=null,this.#Oe=null)}remove(){if(this.#ko?.abort(),this.#ko=null,this.#Ao?.remove(),this.#Ao=null,this.#To=!1,this.#vo=!1,this.#So?.remove(),this.#So=null,this.trigger)for(const t of this.trigger)t.classList.remove("popupTriggerArea")}#Uo(){if(null!==this.#Oe)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:s,pageX:i,pageY:n}}}=this.#yo;let a=!!this.#xo,r=a?this.#xo:this.#_o;for(const t of this.#wo)if(!r||null!==Cy.intersect(t.data.rect,r)){r=t.data.rect,a=!0;break}const o=Cy.normalizeRect([r[0],t[3]-r[1]+t[1],r[2],t[3]-r[3]+t[1]]),l=a?r[2]-r[0]+5:0,c=o[0]+l,h=o[1];this.#Oe=[100*(c-i)/e,100*(h-n)/s];const{style:u}=this.#Es;u.left=`${this.#Oe[0]}%`,u.top=`${this.#Oe[1]}%`}#go(){this.#Xe?this.#Xe.toggleCommentPopup(this,!1):(this.#vo=!this.#vo,this.#vo?(this.#do(),this.#Es.addEventListener("click",this.#fo),this.#Es.addEventListener("keydown",this.#lo)):(this.#ho(),this.#Es.removeEventListener("click",this.#fo),this.#Es.removeEventListener("keydown",this.#lo)))}#do(){this.#Ao||this.render(),this.isVisible?this.#vo&&this.#Es.classList.add("focused"):(this.#Uo(),this.#Es.hidden=!1,this.#Es.style.zIndex=parseInt(this.#Es.style.zIndex)+1e3)}#ho(){this.#Es.classList.remove("focused"),!this.#vo&&this.isVisible&&(this.#Es.hidden=!0,this.#Es.style.zIndex=parseInt(this.#Es.style.zIndex)-1e3)}forceHide(){this.#To=this.isVisible,this.#To&&(this.#Es.hidden=!0)}maybeShow(){this.#Xe||(this.#Fo(),this.#To&&(this.#Ao||this.#do(),this.#To=!1,this.#Es.hidden=!1))}get isVisible(){return!this.#Xe&&!1===this.#Es.hidden}},vA=class extends lA{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=Ww.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}},AA=class extends lA{#$o=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const{data:t,width:e,height:s}=this,i=this.svgFactory.create(e,s,!0),n=this.#$o=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 this.#$o}addHighlightArea(){this.container.classList.add("highlightArea")}},kA=class extends lA{#Ho=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const{data:t,width:e,height:s}=this,i=this.svgFactory.create(e,s,!0),n=t.borderStyle.width,a=this.#Ho=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 this.#Ho}addHighlightArea(){this.container.classList.add("highlightArea")}},SA=class extends lA{#jo=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const{data:t,width:e,height:s}=this,i=this.svgFactory.create(e,s,!0),n=t.borderStyle.width,a=this.#jo=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 this.#jo}addHighlightArea(){this.container.classList.add("highlightArea")}},CA=class extends lA{#qo=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:e,borderStyle:s,popupRef:i},width:n,height:a}=this;if(!e)return this.container;const r=this.svgFactory.create(n,a,!0);let o=[];for(let s=0,i=e.length;s<i;s+=2){const i=e[s]-t[0],n=t[3]-e[s+1];o.push(`${i},${n}`)}o=o.join(" ");const l=this.#qo=this.svgFactory.createElement(this.svgElementName);return l.setAttribute("points",o),l.setAttribute("stroke-width",s.width||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),r.append(l),this.container.append(r),!i&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#qo}addHighlightArea(){this.container.classList.add("highlightArea")}},_A=class extends CA{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}},IA=class extends lA{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}},TA=class extends lA{#zo=null;#Go=[];constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType="InkHighlight"===this.data.it?Ww.HIGHLIGHT:Ww.INK}#Wo(t,e){switch(t){case 90:return{transform:`rotate(90) translate(${-e[0]},${e[1]}) scale(1,-1)`,width:e[3]-e[1],height:e[2]-e[0]};case 180:return{transform:`rotate(180) translate(${-e[2]},${e[1]}) scale(1,-1)`,width:e[2]-e[0],height:e[3]-e[1]};case 270:return{transform:`rotate(270) translate(${-e[2]},${e[3]}) scale(1,-1)`,width:e[3]-e[1],height:e[2]-e[0]};default:return{transform:`translate(${-e[0]},${e[3]}) scale(1,-1)`,width:e[2]-e[0],height:e[3]-e[1]}}}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,rotation:e,inkLists:s,borderStyle:i,popupRef:n}}=this,{transform:a,width:r,height:o}=this.#Wo(e,t),l=this.svgFactory.create(r,o,!0),c=this.#zo=this.svgFactory.createElement("svg:g");l.append(c),c.setAttribute("stroke-width",i.width||1),c.setAttribute("stroke-linecap","round"),c.setAttribute("stroke-linejoin","round"),c.setAttribute("stroke-miterlimit",10),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),c.setAttribute("transform",a);for(let t=0,e=s.length;t<e;t++){const e=this.svgFactory.createElement(this.svgElementName);this.#Go.push(e),e.setAttribute("points",s[t].join(",")),c.append(e)}return!n&&this.hasPopupData&&this._createPopup(),this.container.append(l),this._editOnDoubleClick(),this.container}updateEdited(t){super.updateEdited(t);const{thickness:e,points:s,rect:i}=t,n=this.#zo;if(e>=0&&n.setAttribute("stroke-width",e||1),s)for(let t=0,e=this.#Go.length;t<e;t++)this.#Go[t].setAttribute("points",s[t].join(","));if(i){const{transform:t,width:e,height:s}=this.#Wo(this.data.rotation,i);n.parentElement.setAttribute("viewBox",`0 0 ${e} ${s}`),n.setAttribute("transform",t)}}getElementsToTriggerPopup(){return this.#Go}addHighlightArea(){this.container.classList.add("highlightArea")}},MA=class extends lA{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=Ww.HIGHLIGHT}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),t){const e=document.createElement("mark");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}},EA=class extends lA{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),t){const e=document.createElement("u");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}},FA=class extends lA{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),t){const e=document.createElement("u");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}},DA=class extends lA{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),t){const e=document.createElement("s");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}},RA=class extends lA{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=Ww.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}},BA=class extends lA{#Vo=null;constructor(t){super(t,{isRenderable:!0});const{file:e}=this.data;this.filename=e.filename,this.content=e.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...e})}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=`${this.imageResourcesPath}annotation-${/paperclip/i.test(e.name)?"paperclip":"pushpin"}.svg`,e.fillAlpha&&e.fillAlpha<1&&(s.style=`filter: opacity(${Math.round(100*e.fillAlpha)}%);`)),s.addEventListener("dblclick",this.#Xo.bind(this)),this.#Vo=s;const{isMac:i}=ky.platform;return t.addEventListener("keydown",t=>{"Enter"===t.key&&(i?t.metaKey:t.ctrlKey)&&this.#Xo()}),!e.popupRef&&this.hasPopupData?this._createPopup():s.classList.add("popupTriggerArea"),t.append(s),t}getElementsToTriggerPopup(){return this.#Vo}addHighlightArea(){this.container.classList.add("highlightArea")}#Xo(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}},PA=class _AnnotationLayer{#Ko=null;#Yo=null;#Ge=null;#Jo=new Map;#Zo=null;#Qo=null;constructor({div:t,accessibilityManager:e,annotationCanvasMap:s,annotationEditorUIManager:i,page:n,viewport:a,structTreeLayer:r,commentManager:o,linkService:l,annotationStorage:c}){this.div=t,this.#Ko=e,this.#Yo=s,this.#Zo=r||null,this.#Qo=l||null,this.#Ge=c||new rx,this.page=n,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=i,this._commentManager=o||null}hasEditableAnnotations(){return this.#Jo.size>0}async#tl(t,e,s){const i=t.firstChild||t,n=i.id=`${Ty}${e}`,a=await(this.#Zo?.getAriaAttributes(n));if(a)for(const[t,e]of a)i.setAttribute(t,e);s?s.at(-1).container.after(t):(this.div.append(t),this.#Ko?.moveElementInDOM(this.div,t,i,!1))}async render(t){const{annotations:e}=t,s=this.div;setLayerDimensions(s,this.viewport);const i=new Map,n={data:null,layer:s,linkService:this.#Qo,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new nA,annotationStorage:this.#Ge,enableComment:!0===t.enableComment,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const t of e){if(t.noHTML)continue;const e=t.annotationType===sy.POPUP;if(e){const e=i.get(t.id);if(!e)continue;n.elements=e}else if(t.rect[2]===t.rect[0]||t.rect[3]===t.rect[1])continue;n.data=t;const s=oA.create(n);if(!s.isRenderable)continue;if(!e&&t.popupRef){const e=i.get(t.popupRef);e?e.push(s):i.set(t.popupRef,[s])}const a=s.render();t.hidden&&(a.style.visibility="hidden"),await this.#tl(a,t.id,n.elements),s.extraPopupElement?.popup?.renderCommentButton(),s._isEditable&&(this.#Jo.set(s.data.id,s),this._annotationEditorUIManager?.renderAnnotationElement(s))}this.#el()}async addLinkAnnotations(t){const e={data:null,layer:this.div,linkService:this.#Qo,svgFactory:new nA,parent:this};for(const s of t){s.borderStyle||=_AnnotationLayer._defaultBorderStyle,e.data=s;const t=oA.create(e);if(!t.isRenderable)continue;const i=t.render();await this.#tl(i,s.id,null)}}update({viewport:t}){const e=this.div;this.viewport=t,setLayerDimensions(e,{rotation:t.rotation}),this.#el(),e.hidden=!1}#el(){if(!this.#Yo)return;const t=this.div;for(const[e,s]of this.#Yo){const i=t.querySelector(`[data-annotation-id="${e}"]`);if(!i)continue;s.className="annotationContent";const{firstChild:n}=i;n?"CANVAS"===n.nodeName?n.replaceWith(s):n.classList.contains("annotationContent")?n.after(s):n.before(s):i.append(s);const a=this.#Jo.get(e);a&&(a._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(e,i.id,s),a._hasNoCanvas=!1):a.canvas=s)}this.#Yo.clear()}getEditableAnnotations(){return Array.from(this.#Jo.values())}getEditableAnnotation(t){return this.#Jo.get(t)}addFakeAnnotation(t){const{div:e}=this,{id:s,rotation:i}=t,n=new cA({data:{id:s,rect:t.getPDFRect(),rotation:i},editor:t,layer:e,parent:this,enableComment:!!this._commentManager,linkService:this.#Qo,annotationStorage:this.#Ge}),a=n.render();return e.append(a),this.#Ko?.moveElementInDOM(e,a,a,!1),n.createOrUpdatePopup(),n}static get _defaultBorderStyle(){return shadow(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:iy,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}},NA=/\r\n?|\n/g,OA=class _FreeTextEditor extends Qy{#sl="";#il=`${this.id}-editor`;#nl=null;#No;_colorPicker=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const t=_FreeTextEditor.prototype,arrowChecker=t=>t.isEmpty(),e=Ky.TRANSLATE_SMALL,s=Ky.TRANSLATE_BIG;return shadow(this,"_keyboardManager",new Vy([[["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:[-e,0],checker:arrowChecker}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-s,0],checker:arrowChecker}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[e,0],checker:arrowChecker}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[s,0],checker:arrowChecker}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-e],checker:arrowChecker}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-s],checker:arrowChecker}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,e],checker:arrowChecker}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,s],checker:arrowChecker}]]))}static _type="freetext";static _editorType=Ww.FREETEXT;constructor(t){super({...t,name:"freeTextEditor"}),this.color=t.color||_FreeTextEditor._defaultColor||Qy._defaultLineColor,this.#No=t.fontSize||_FreeTextEditor._defaultFontSize,this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert")}static initialize(t,e){Qy.initialize(t,e);const s=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(s.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case Vw.FREETEXT_SIZE:_FreeTextEditor._defaultFontSize=e;break;case Vw.FREETEXT_COLOR:_FreeTextEditor._defaultColor=e}}updateParams(t,e){switch(t){case Vw.FREETEXT_SIZE:this.#al(e);break;case Vw.FREETEXT_COLOR:this.#Ro(e)}}static get defaultPropertiesToUpdate(){return[[Vw.FREETEXT_SIZE,_FreeTextEditor._defaultFontSize],[Vw.FREETEXT_COLOR,_FreeTextEditor._defaultColor||Qy._defaultLineColor]]}get propertiesToUpdate(){return[[Vw.FREETEXT_SIZE,this.#No],[Vw.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||=new eA(this),[["colorPicker",this._colorPicker]]}get colorType(){return Vw.FREETEXT_COLOR}#al(t){const setFontsize=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--total-scale-factor))`,this.translate(0,-(t-this.#No)*this.parentScale),this.#No=t,this.#rl()},e=this.#No;this.addCommands({cmd:setFontsize.bind(this,t),undo:setFontsize.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Vw.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}onUpdatedColor(){this.editorDiv.style.color=this.color,this._colorPicker?.update(this.color),super.onUpdatedColor()}#Ro(t){const setColor=t=>{this.color=t,this.onUpdatedColor()},e=this.color;this.addCommands({cmd:setColor.bind(this,t),undo:setColor.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Vw.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-_FreeTextEditor._internalPadding*t,-(_FreeTextEditor._internalPadding+this.#No)*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.#nl=new AbortController;const t=this._uiManager.combinedSignal(this.#nl);return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:t}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:t}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:t}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:t}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:t}),!0}disableEditMode(){return!!super.disableEditMode()&&(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#il),this._isDraggable=!0,this.#nl?.abort(),this.#nl=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0)}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(t){this.width||(this.enableEditMode(),t&&this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#ol(){const t=[];this.editorDiv.normalize();let e=null;for(const s of this.editorDiv.childNodes)e?.nodeType===Node.TEXT_NODE&&"BR"===s.nodeName||(t.push(_FreeTextEditor.#ll(s)),e=s);return t.join("\n")}#rl(){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,n=e.classList.contains("hidden");e.classList.remove("hidden"),e.style.display="hidden",t.div.append(this.div),s=e.getBoundingClientRect(),e.remove(),e.style.display=i,e.classList.toggle("hidden",n)}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()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=this.#sl,e=this.#sl=this.#ol().trimEnd();if(t===e)return;const setText=t=>{this.#sl=t,t?(this.#cl(),this._uiManager.rebuild(this),this.#rl()):this.remove()};this.addCommands({cmd:()=>{setText(e)},undo:()=>{setText(t)},mustExec:!1}),this.#rl()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){_FreeTextEditor._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)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let t,e;(this._isCopy||this.annotationElementId)&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#il),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:s}=this.editorDiv;if(s.fontSize=`calc(${this.#No}px * var(--total-scale-factor))`,s.color=this.color,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[s,i]=this.parentDimensions;if(this.annotationElementId){const{position:n}=this._initialData;let[a,r]=this.getInitialTranslation();[a,r]=this.pageTranslationToScreen(a,r);const[o,l]=this.pageDimensions,[c,h]=this.pageTranslation;let u,d;switch(this.rotation){case 0:u=t+(n[0]-c)/o,d=e+this.height-(n[1]-h)/l;break;case 90:u=t+(n[0]-c)/o,d=e-(n[1]-h)/l,[a,r]=[r,-a];break;case 180:u=t-this.width+(n[0]-c)/o,d=e-(n[1]-h)/l,[a,r]=[-a,-r];break;case 270:u=t+(n[0]-c-this.height*l)/o,d=e+(n[1]-h-this.width*o)/l,[a,r]=[-r,a]}this.setAt(u*s,d*i,a,r)}else this._moveAfterPaste(t,e);this.#cl(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#ll(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(NA,"")}editorDivPaste(t){const e=t.clipboardData||window.clipboardData,{types:s}=e;if(1===s.length&&"text/plain"===s[0])return;t.preventDefault();const i=_FreeTextEditor.#hl(e.getData("text")||"").replaceAll(NA,"\n");if(!i)return;const n=window.getSelection();if(!n.rangeCount)return;this.editorDiv.normalize(),n.deleteFromDocument();const a=n.getRangeAt(0);if(!i.includes("\n"))return a.insertNode(document.createTextNode(i)),this.editorDiv.normalize(),void n.collapseToStart();const{startContainer:r,startOffset:o}=a,l=[],c=[];if(r.nodeType===Node.TEXT_NODE){const t=r.parentElement;if(c.push(r.nodeValue.slice(o).replaceAll(NA,"")),t!==this.editorDiv){let e=l;for(const s of this.editorDiv.childNodes)s!==t?e.push(_FreeTextEditor.#ll(s)):e=c}l.push(r.nodeValue.slice(0,o).replaceAll(NA,""))}else if(r===this.editorDiv){let t=l,e=0;for(const s of this.editorDiv.childNodes)e++===o&&(t=c),t.push(_FreeTextEditor.#ll(s))}this.#sl=`${l.join("\n")}${i}${c.join("\n")}`,this.#cl();const h=new Range;let u=Math.sumPrecise(l.map(t=>t.length));for(const{firstChild:t}of this.editorDiv.childNodes)if(t.nodeType===Node.TEXT_NODE){const e=t.nodeValue.length;if(u<=e){h.setStart(t,u),h.setEnd(t,u);break}u-=e}n.removeAllRanges(),n.addRange(h)}#cl(){if(this.editorDiv.replaceChildren(),this.#sl)for(const t of this.#sl.split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}#ul(){return this.#sl.replaceAll(" "," ")}static#hl(t){return t.replaceAll(" "," ")}get contentDiv(){return this.editorDiv}getPDFRect(){const t=_FreeTextEditor._internalPadding*this.parentScale;return this.getRect(t,t)}static async deserialize(t,e,s){let i=null;if(t instanceof vA){const{data:{defaultAppearanceData:{fontSize:e,fontColor:s},rect:n,rotation:a,id:r,popupRef:o,richText:l,contentsObj:c,creationDate:h,modificationDate:u},textContent:d,textPosition:f,parent:{page:{pageNumber:g}}}=t;if(!d||0===d.length)return null;i=t={annotationType:Ww.FREETEXT,color:Array.from(s),fontSize:e,value:d.join("\n"),position:f,pageIndex:g-1,rect:n.slice(0),rotation:a,annotationElementId:r,id:r,deleted:!1,popupRef:o,comment:c?.str||null,richText:l,creationDate:h,modificationDate:u}}const n=await super.deserialize(t,e,s);return n.#No=t.fontSize,n.color=Cy.makeHexColor(...t.color),n.#sl=_FreeTextEditor.#hl(t.value),n._initialData=i,t.comment&&n.setCommentData(t),n}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const e=Qy._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),s=Object.assign(super.serialize(t),{color:e,fontSize:this.#No,value:this.#ul()});return this.addComment(s),t?(s.isCopy=!0,s):this.annotationElementId&&!this.#dl(s)?null:(s.id=this.annotationElementId,s)}#dl(t){const{value:e,fontSize:s,color:i,pageIndex:n}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||t.value!==e||t.fontSize!==s||t.color.some((t,e)=>t!==i[e])||t.pageIndex!==n}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(!e)return null;const{style:s}=e;s.fontSize=`calc(${this.#No}px * var(--total-scale-factor))`,s.color=this.color,e.replaceChildren();for(const t of this.#sl.split("\n")){const s=document.createElement("div");s.append(t?document.createTextNode(t):document.createElement("br")),e.append(s)}return t.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:this.#sl}}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}},LA=class{static PRECISION=1e-4;toSVGPath(){unreachable("Abstract method `toSVGPath` must be implemented.")}get box(){unreachable("Abstract getter `box` must be implemented.")}serialize(t,e){unreachable("Abstract method `serialize` must be implemented.")}static _rescale(t,e,s,i,n,a){a||=new Float32Array(t.length);for(let r=0,o=t.length;r<o;r+=2)a[r]=e+t[r]*i,a[r+1]=s+t[r+1]*n;return a}static _rescaleAndSwap(t,e,s,i,n,a){a||=new Float32Array(t.length);for(let r=0,o=t.length;r<o;r+=2)a[r]=e+t[r+1]*i,a[r+1]=s+t[r]*n;return a}static _translate(t,e,s,i){i||=new Float32Array(t.length);for(let n=0,a=t.length;n<a;n+=2)i[n]=e+t[n],i[n+1]=s+t[n+1];return i}static svgRound(t){return Math.round(1e4*t)}static _normalizePoint(t,e,s,i,n){switch(n){case 90:return[1-e/s,t/i];case 180:return[1-t/s,1-e/i];case 270:return[e/s,1-t/i];default:return[t/s,e/i]}}static _normalizePagePoint(t,e,s){switch(s){case 90:return[1-e,t];case 180:return[1-t,1-e];case 270:return[e,1-t];default:return[t,e]}}static createBezierPoints(t,e,s,i,n,a){return[(t+5*s)/6,(e+5*i)/6,(5*s+n)/6,(5*i+a)/6,(s+n)/2,(i+a)/2]}},UA=class _FreeDrawOutliner{#fl;#gl=[];#pl;#ml;#bl=[];#wl=new Float32Array(18);#yl;#xl;#vl;#Al;#kl;#Sl;#Cl=[];static#_l=8;static#Il=2;static#Tl=_FreeDrawOutliner.#_l+_FreeDrawOutliner.#Il;constructor({x:t,y:e},s,i,n,a,r=0){this.#fl=s,this.#Sl=n*i,this.#ml=a,this.#wl.set([NaN,NaN,NaN,NaN,t,e],6),this.#pl=r,this.#Al=_FreeDrawOutliner.#_l*i,this.#vl=_FreeDrawOutliner.#Tl*i,this.#kl=i,this.#Cl.push(t,e)}isEmpty(){return isNaN(this.#wl[8])}#Ml(){const t=this.#wl.subarray(4,6),e=this.#wl.subarray(16,18),[s,i,n,a]=this.#fl;return[(this.#yl+(t[0]-e[0])/2-s)/n,(this.#xl+(t[1]-e[1])/2-i)/a,(this.#yl+(e[0]-t[0])/2-s)/n,(this.#xl+(e[1]-t[1])/2-i)/a]}add({x:t,y:e}){this.#yl=t,this.#xl=e;const[s,i,n,a]=this.#fl;let[r,o,l,c]=this.#wl.subarray(8,12);const h=t-l,u=e-c,d=Math.hypot(h,u);if(d<this.#vl)return!1;const f=d-this.#Al,g=f/d,p=g*h,m=g*u;let b=r,w=o;r=l,o=c,l+=p,c+=m,this.#Cl?.push(t,e);const y=p/f,x=-m/f*this.#Sl,v=y*this.#Sl;return this.#wl.set(this.#wl.subarray(2,8),0),this.#wl.set([l+x,c+v],4),this.#wl.set(this.#wl.subarray(14,18),12),this.#wl.set([l-x,c-v],16),isNaN(this.#wl[6])?(0===this.#bl.length&&(this.#wl.set([r+x,o+v],2),this.#bl.push(NaN,NaN,NaN,NaN,(r+x-s)/n,(o+v-i)/a),this.#wl.set([r-x,o-v],14),this.#gl.push(NaN,NaN,NaN,NaN,(r-x-s)/n,(o-v-i)/a)),this.#wl.set([b,w,r,o,l,c],6),!this.isEmpty()):(this.#wl.set([b,w,r,o,l,c],6),Math.abs(Math.atan2(w-o,b-r)-Math.atan2(m,p))<Math.PI/2?([r,o,l,c]=this.#wl.subarray(2,6),this.#bl.push(NaN,NaN,NaN,NaN,((r+l)/2-s)/n,((o+c)/2-i)/a),[r,o,b,w]=this.#wl.subarray(14,18),this.#gl.push(NaN,NaN,NaN,NaN,((b+r)/2-s)/n,((w+o)/2-i)/a),!0):([b,w,r,o,l,c]=this.#wl.subarray(0,6),this.#bl.push(((b+5*r)/6-s)/n,((w+5*o)/6-i)/a,((5*r+l)/6-s)/n,((5*o+c)/6-i)/a,((r+l)/2-s)/n,((o+c)/2-i)/a),[l,c,r,o,b,w]=this.#wl.subarray(12,18),this.#gl.push(((b+5*r)/6-s)/n,((w+5*o)/6-i)/a,((5*r+l)/6-s)/n,((5*o+c)/6-i)/a,((r+l)/2-s)/n,((o+c)/2-i)/a),!0))}toSVGPath(){if(this.isEmpty())return"";const t=this.#bl,e=this.#gl;if(isNaN(this.#wl[6])&&!this.isEmpty())return this.#El();const s=[];s.push(`M${t[4]} ${t[5]}`);for(let e=6;e<t.length;e+=6)isNaN(t[e])?s.push(`L${t[e+4]} ${t[e+5]}`):s.push(`C${t[e]} ${t[e+1]} ${t[e+2]} ${t[e+3]} ${t[e+4]} ${t[e+5]}`);this.#Fl(s);for(let t=e.length-6;t>=6;t-=6)isNaN(e[t])?s.push(`L${e[t+4]} ${e[t+5]}`):s.push(`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`);return this.#Dl(s),s.join(" ")}#El(){const[t,e,s,i]=this.#fl,[n,a,r,o]=this.#Ml();return`M${(this.#wl[2]-t)/s} ${(this.#wl[3]-e)/i} L${(this.#wl[4]-t)/s} ${(this.#wl[5]-e)/i} L${n} ${a} L${r} ${o} L${(this.#wl[16]-t)/s} ${(this.#wl[17]-e)/i} L${(this.#wl[14]-t)/s} ${(this.#wl[15]-e)/i} Z`}#Dl(t){const e=this.#gl;t.push(`L${e[4]} ${e[5]} Z`)}#Fl(t){const[e,s,i,n]=this.#fl,a=this.#wl.subarray(4,6),r=this.#wl.subarray(16,18),[o,l,c,h]=this.#Ml();t.push(`L${(a[0]-e)/i} ${(a[1]-s)/n} L${o} ${l} L${c} ${h} L${(r[0]-e)/i} ${(r[1]-s)/n}`)}newFreeDrawOutline(t,e,s,i,n,a){return new $A(t,e,s,i,n,a)}getOutlines(){const t=this.#bl,e=this.#gl,s=this.#wl,[i,n,a,r]=this.#fl,o=new Float32Array((this.#Cl?.length??0)+2);for(let t=0,e=o.length-2;t<e;t+=2)o[t]=(this.#Cl[t]-i)/a,o[t+1]=(this.#Cl[t+1]-n)/r;if(o[o.length-2]=(this.#yl-i)/a,o[o.length-1]=(this.#xl-n)/r,isNaN(s[6])&&!this.isEmpty())return this.#Rl(o);const l=new Float32Array(this.#bl.length+24+this.#gl.length);let c=t.length;for(let e=0;e<c;e+=2)isNaN(t[e])?l[e]=l[e+1]=NaN:(l[e]=t[e],l[e+1]=t[e+1]);c=this.#Bl(l,c);for(let t=e.length-6;t>=6;t-=6)for(let s=0;s<6;s+=2)isNaN(e[t+s])?(l[c]=l[c+1]=NaN,c+=2):(l[c]=e[t+s],l[c+1]=e[t+s+1],c+=2);return this.#Pl(l,c),this.newFreeDrawOutline(l,o,this.#fl,this.#kl,this.#pl,this.#ml)}#Rl(t){const e=this.#wl,[s,i,n,a]=this.#fl,[r,o,l,c]=this.#Ml(),h=new Float32Array(36);return h.set([NaN,NaN,NaN,NaN,(e[2]-s)/n,(e[3]-i)/a,NaN,NaN,NaN,NaN,(e[4]-s)/n,(e[5]-i)/a,NaN,NaN,NaN,NaN,r,o,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,(e[16]-s)/n,(e[17]-i)/a,NaN,NaN,NaN,NaN,(e[14]-s)/n,(e[15]-i)/a],0),this.newFreeDrawOutline(h,t,this.#fl,this.#kl,this.#pl,this.#ml)}#Pl(t,e){const s=this.#gl;return t.set([NaN,NaN,NaN,NaN,s[4],s[5]],e),e+6}#Bl(t,e){const s=this.#wl.subarray(4,6),i=this.#wl.subarray(16,18),[n,a,r,o]=this.#fl,[l,c,h,u]=this.#Ml();return t.set([NaN,NaN,NaN,NaN,(s[0]-n)/r,(s[1]-a)/o,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,h,u,NaN,NaN,NaN,NaN,(i[0]-n)/r,(i[1]-a)/o],e),e+24}},$A=class extends LA{#fl;#Nl=new Float32Array(4);#pl;#ml;#Cl;#kl;#Ol;constructor(t,e,s,i,n,a){super(),this.#Ol=t,this.#Cl=e,this.#fl=s,this.#kl=i,this.#pl=n,this.#ml=a,this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],this.#Ll(a);const[r,o,l,c]=this.#Nl;for(let e=0,s=t.length;e<s;e+=2)t[e]=(t[e]-r)/l,t[e+1]=(t[e+1]-o)/c;for(let t=0,s=e.length;t<s;t+=2)e[t]=(e[t]-r)/l,e[t+1]=(e[t+1]-o)/c}toSVGPath(){const t=[`M${this.#Ol[4]} ${this.#Ol[5]}`];for(let e=6,s=this.#Ol.length;e<s;e+=6)isNaN(this.#Ol[e])?t.push(`L${this.#Ol[e+4]} ${this.#Ol[e+5]}`):t.push(`C${this.#Ol[e]} ${this.#Ol[e+1]} ${this.#Ol[e+2]} ${this.#Ol[e+3]} ${this.#Ol[e+4]} ${this.#Ol[e+5]}`);return t.push("Z"),t.join(" ")}serialize([t,e,s,i],n){const a=s-t,r=i-e;let o,l;switch(n){case 0:o=LA._rescale(this.#Ol,t,i,a,-r),l=LA._rescale(this.#Cl,t,i,a,-r);break;case 90:o=LA._rescaleAndSwap(this.#Ol,t,e,a,r),l=LA._rescaleAndSwap(this.#Cl,t,e,a,r);break;case 180:o=LA._rescale(this.#Ol,s,e,-a,r),l=LA._rescale(this.#Cl,s,e,-a,r);break;case 270:o=LA._rescaleAndSwap(this.#Ol,s,i,-a,-r),l=LA._rescaleAndSwap(this.#Cl,s,i,-a,-r)}return{outline:Array.from(o),points:[Array.from(l)]}}#Ll(t){const e=this.#Ol;let s=e[4],i=e[5];const n=[s,i,s,i];let a=s,r=i,o=s,l=i;const c=t?Math.max:Math.min,h=new Float32Array(4);for(let t=6,u=e.length;t<u;t+=6){const u=e[t+4],d=e[t+5];isNaN(e[t])?(Cy.pointBoundingBox(u,d,n),r>d?(a=u,r=d):r===d&&(a=c(a,u)),l<d?(o=u,l=d):l===d&&(o=c(o,u))):(h[0]=h[1]=1/0,h[2]=h[3]=-1/0,Cy.bezierBoundingBox(s,i,...e.slice(t,t+6),h),Cy.rectBoundingBox(h[0],h[1],h[2],h[3],n),r>h[1]?(a=h[0],r=h[1]):r===h[1]&&(a=c(a,h[0])),l<h[3]?(o=h[2],l=h[3]):l===h[3]&&(o=c(o,h[2]))),s=u,i=d}const u=this.#Nl;u[0]=n[0]-this.#pl,u[1]=n[1]-this.#pl,u[2]=n[2]-n[0]+2*this.#pl,u[3]=n[3]-n[1]+2*this.#pl,this.firstPoint=[a,r],this.lastPoint=[o,l]}get box(){return this.#Nl}newOutliner(t,e,s,i,n,a=0){return new UA(t,e,s,i,n,a)}getNewOutline(t,e){const[s,i,n,a]=this.#Nl,[r,o,l,c]=this.#fl,h=n*l,u=a*c,d=s*l+r,f=i*c+o,g=this.newOutliner({x:this.#Cl[0]*h+d,y:this.#Cl[1]*u+f},this.#fl,this.#kl,t,this.#ml,e??this.#pl);for(let t=2;t<this.#Cl.length;t+=2)g.add({x:this.#Cl[t]*h+d,y:this.#Cl[t+1]*u+f});return g.getOutlines()}},HA=class{#fl;#Ul;#$l;#Hl=[];#jl=[];constructor(t,e=0,s=0,i=!0){const n=[1/0,1/0,-1/0,-1/0],a=1e-4;for(const{x:s,y:i,width:r,height:o}of t){const t=Math.floor((s-e)/a)*a,l=Math.ceil((s+r+e)/a)*a,c=Math.floor((i-e)/a)*a,h=Math.ceil((i+o+e)/a)*a,u=[t,c,h,!0],d=[l,c,h,!1];this.#Hl.push(u,d),Cy.rectBoundingBox(t,c,l,h,n)}const r=n[2]-n[0]+2*s,o=n[3]-n[1]+2*s,l=n[0]-s,c=n[1]-s;let h=i?-1/0:1/0,u=1/0;const d=this.#Hl.at(i?-1:-2),f=[d[0],d[2]];for(const t of this.#Hl){const[e,s,n,a]=t;!a&&i?s<u?(u=s,h=e):s===u&&(h=Math.max(h,e)):a&&!i&&(s<u?(u=s,h=e):s===u&&(h=Math.min(h,e))),t[0]=(e-l)/r,t[1]=(s-c)/o,t[2]=(n-c)/o}this.#fl=new Float32Array([l,c,r,o]),this.#Ul=[h,u],this.#$l=f}getOutlines(){this.#Hl.sort((t,e)=>t[0]-e[0]||t[1]-e[1]||t[2]-e[2]);const t=[];for(const e of this.#Hl)e[3]?(t.push(...this.#ql(e)),this.#zl(e)):(this.#Gl(e),t.push(...this.#ql(e)));return this.#Wl(t)}#Wl(t){const e=[],s=new Set;for(const s of t){const[t,i,n]=s;e.push([t,i,s],[t,n,s])}e.sort((t,e)=>t[1]-e[1]||t[0]-e[0]);for(let t=0,i=e.length;t<i;t+=2){const i=e[t][2],n=e[t+1][2];i.push(n),n.push(i),s.add(i),s.add(n)}const i=[];let n;for(;s.size>0;){const t=s.values().next().value;let[e,a,r,o,l]=t;s.delete(t);let c=e,h=a;for(n=[e,r],i.push(n);;){let t;if(s.has(o))t=o;else{if(!s.has(l))break;t=l}s.delete(t),[e,a,r,o,l]=t,c!==e&&(n.push(c,h,e,h===a?a:r),c=e),h=h===a?r:a}n.push(c,h)}return new jA(i,this.#fl,this.#Ul,this.#$l)}#Vl(t){const e=this.#jl;let s=0,i=e.length-1;for(;s<=i;){const n=s+i>>1,a=e[n][0];if(a===t)return n;a<t?s=n+1:i=n-1}return i+1}#zl([,t,e]){const s=this.#Vl(t);this.#jl.splice(s,0,[t,e])}#Gl([,t,e]){const s=this.#Vl(t);for(let i=s;i<this.#jl.length;i++){const[s,n]=this.#jl[i];if(s!==t)break;if(s===t&&n===e)return void this.#jl.splice(i,1)}for(let i=s-1;i>=0;i--){const[s,n]=this.#jl[i];if(s!==t)break;if(s===t&&n===e)return void this.#jl.splice(i,1)}}#ql(t){const[e,s,i]=t,n=[[e,s,i]],a=this.#Vl(i);for(let t=0;t<a;t++){const[s,i]=this.#jl[t];for(let t=0,a=n.length;t<a;t++){const[,r,o]=n[t];if(!(i<=r||o<=s))if(r>=s)if(o>i)n[t][1]=i;else{if(1===a)return[];n.splice(t,1),t--,a--}else n[t][2]=s,o>i&&n.push([e,i,o])}}return n}},jA=class extends LA{#fl;#Xl;constructor(t,e,s,i){super(),this.#Xl=t,this.#fl=e,this.firstPoint=s,this.lastPoint=i}toSVGPath(){const t=[];for(const e of this.#Xl){let[s,i]=e;t.push(`M${s} ${i}`);for(let n=2;n<e.length;n+=2){const a=e[n],r=e[n+1];a===s?(t.push(`V${r}`),i=r):r===i&&(t.push(`H${a}`),s=a)}t.push("Z")}return t.join(" ")}serialize([t,e,s,i],n){const a=[],r=s-t,o=i-e;for(const e of this.#Xl){const s=new Array(e.length);for(let n=0;n<e.length;n+=2)s[n]=t+e[n]*r,s[n+1]=i-e[n+1]*o;a.push(s)}return a}get box(){return this.#fl}get classNamesForOutlining(){return["highlightOutline"]}},qA=class extends UA{newFreeDrawOutline(t,e,s,i,n,a){return new zA(t,e,s,i,n,a)}},zA=class extends $A{newOutliner(t,e,s,i,n,a=0){return new qA(t,e,s,i,n,a)}},GA=class _HighlightEditor extends Qy{#Kl=null;#Yl=0;#Jl;#Zl=null;#fe=null;#Ql=null;#tc=null;#ec=0;#sc=null;#ic=null;#Ee=null;#nc=!1;#Ul=null;#$l=null;#ac=null;#Rt="";#Sl;#rc="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=Ww.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const t=_HighlightEditor.prototype;return shadow(this,"_keyboardManager",new Vy([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}constructor(t){super({...t,name:"highlightEditor"}),this.color=t.color||_HighlightEditor._defaultColor,this.#Sl=t.thickness||_HighlightEditor._defaultThickness,this.opacity=t.opacity||_HighlightEditor._defaultOpacity,this.#Jl=t.boxes||null,this.#rc=t.methodOfCreation||"",this.#Rt=t.text||"",this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",t.highlightId>-1?(this.#nc=!0,this.#oc(t),this.#lc()):this.#Jl&&(this.#Kl=t.anchorNode,this.#Yl=t.anchorOffset,this.#tc=t.focusNode,this.#ec=t.focusOffset,this.#cc(),this.#lc(),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}get telemetryInitialData(){return{action:"added",type:this.#nc?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:this.#Sl,methodOfCreation:this.#rc}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}#cc(){const t=new HA(this.#Jl,.001);this.#ic=t.getOutlines(),[this.x,this.y,this.width,this.height]=this.#ic.box;const e=new HA(this.#Jl,.0025,.001,"ltr"===this._uiManager.direction);this.#Ql=e.getOutlines();const{firstPoint:s}=this.#ic;this.#Ul=[(s[0]-this.x)/this.width,(s[1]-this.y)/this.height];const{lastPoint:i}=this.#Ql;this.#$l=[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]}#oc({highlightOutlines:t,highlightId:e,clipPathId:s}){if(this.#ic=t,this.#Ql=t.getNewOutline(this.#Sl/2+1.5,.0025),e>=0)this.#Ee=e,this.#Zl=s,this.parent.drawLayer.finalizeDraw(e,{bbox:t.box,path:{d:t.toSVGPath()}}),this.#ac=this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:this.#Ql.box,path:{d:this.#Ql.toSVGPath()}},!0);else if(this.parent){const e=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(this.#Ee,{bbox:_HighlightEditor.#hc(this.#ic.box,(e-this.rotation+360)%360),path:{d:t.toSVGPath()}}),this.parent.drawLayer.updateProperties(this.#ac,{bbox:_HighlightEditor.#hc(this.#Ql.box,e),path:{d:this.#Ql.toSVGPath()}})}const[i,n,a,r]=t.box;switch(this.rotation){case 0:this.x=i,this.y=n,this.width=a,this.height=r;break;case 90:{const[t,e]=this.parentDimensions;this.x=n,this.y=1-i,this.width=a*e/t,this.height=r*t/e;break}case 180:this.x=1-i,this.y=1-n,this.width=a,this.height=r;break;case 270:{const[t,e]=this.parentDimensions;this.x=1-n,this.y=i,this.width=a*e/t,this.height=r*t/e;break}}const{firstPoint:o}=t;this.#Ul=[(o[0]-i)/a,(o[1]-n)/r];const{lastPoint:l}=this.#Ql;this.#$l=[(l[0]-i)/a,(l[1]-n)/r]}static initialize(t,e){Qy.initialize(t,e),_HighlightEditor._defaultColor||=e.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(t,e){switch(t){case Vw.HIGHLIGHT_COLOR:_HighlightEditor._defaultColor=e;break;case Vw.HIGHLIGHT_THICKNESS:_HighlightEditor._defaultThickness=e}}translateInPage(t,e){}get toolbarPosition(){return this.#$l}get commentButtonPosition(){return this.#Ul}updateParams(t,e){switch(t){case Vw.HIGHLIGHT_COLOR:this.#Ro(e);break;case Vw.HIGHLIGHT_THICKNESS:this.#uc(e)}}static get defaultPropertiesToUpdate(){return[[Vw.HIGHLIGHT_COLOR,_HighlightEditor._defaultColor],[Vw.HIGHLIGHT_THICKNESS,_HighlightEditor._defaultThickness]]}get propertiesToUpdate(){return[[Vw.HIGHLIGHT_COLOR,this.color||_HighlightEditor._defaultColor],[Vw.HIGHLIGHT_THICKNESS,this.#Sl||_HighlightEditor._defaultThickness],[Vw.HIGHLIGHT_FREE,this.#nc]]}onUpdatedColor(){this.parent?.drawLayer.updateProperties(this.#Ee,{root:{fill:this.color,"fill-opacity":this.opacity}}),this.#fe?.updateColor(this.color),super.onUpdatedColor()}#Ro(t){const setColorAndOpacity=(t,e)=>{this.color=t,this.opacity=e,this.onUpdatedColor()},e=this.color,s=this.opacity;this.addCommands({cmd:setColorAndOpacity.bind(this,t,_HighlightEditor._defaultOpacity),undo:setColorAndOpacity.bind(this,e,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Vw.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(t)},!0)}#uc(t){const e=this.#Sl,setThickness=t=>{this.#Sl=t,this.#dc(t)};this.addCommands({cmd:setThickness.bind(this,t),undo:setThickness.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Vw.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",this.#fe=new tA({editor:this})]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#fc())}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,this.#fc())}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),t&&this.div.focus()}remove(){this.#gc(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#lc(),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;this.parent&&!t?this.#gc():t&&(this.#lc(t),e=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),this.show(this._isVisible),e&&this.select()}#dc(t){this.#nc&&(this.#oc({highlightOutlines:this.#ic.getNewOutline(t/2)}),this.fixAndSetPosition(),this.setDims(this.width,this.height))}#gc(){null!==this.#Ee&&this.parent&&(this.parent.drawLayer.remove(this.#Ee),this.#Ee=null,this.parent.drawLayer.remove(this.#ac),this.#ac=null)}#lc(t=this.parent){null===this.#Ee&&(({id:this.#Ee,clipPathId:this.#Zl}=t.drawLayer.draw({bbox:this.#ic.box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:this.#nc},path:{d:this.#ic.toSVGPath()}},!1,!0)),this.#ac=t.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:this.#nc},bbox:this.#Ql.box,path:{d:this.#Ql.toSVGPath()}},this.#nc),this.#sc&&(this.#sc.style.clipPath=this.#Zl))}static#hc([t,e,s,i],n){switch(n){case 90:return[1-e-i,t,i,s];case 180:return[1-t-s,1-e-i,s,i];case 270:return[e,1-t-s,i,s]}return[t,e,s,i]}rotate(t){const{drawLayer:e}=this.parent;let s;this.#nc?(t=(t-this.rotation+360)%360,s=_HighlightEditor.#hc(this.#ic.box,t)):s=_HighlightEditor.#hc([this.x,this.y,this.width,this.height],t),e.updateProperties(this.#Ee,{bbox:s,root:{"data-main-rotation":t}}),e.updateProperties(this.#ac,{bbox:_HighlightEditor.#hc(this.#Ql.box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;const t=super.render();this.#Rt&&(t.setAttribute("aria-label",this.#Rt),t.setAttribute("role","mark")),this.#nc?t.classList.add("free"):this.div.addEventListener("keydown",this.#pc.bind(this),{signal:this._uiManager._signal});const e=this.#sc=document.createElement("div");return t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=this.#Zl,this.setDims(this.width,this.height),bindEvents(this,this.#sc,["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#ac,{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#ac,{rootClass:{hovered:!1}})}#pc(t){_HighlightEditor._keyboardManager.exec(this,t)}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:this.#mc(!0);break;case 1:case 3:this.#mc(!1)}}#mc(t){if(!this.#Kl)return;const e=window.getSelection();t?e.setPosition(this.#Kl,this.#Yl):e.setPosition(this.#tc,this.#ec)}select(){super.select(),this.#ac&&this.parent?.drawLayer.updateProperties(this.#ac,{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),this.#ac&&(this.parent?.drawLayer.updateProperties(this.#ac,{rootClass:{selected:!1}}),this.#nc||this.#mc(!1))}get _mustFixPosition(){return!this.#nc}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.updateProperties(this.#Ee,{rootClass:{hidden:!t}}),this.parent.drawLayer.updateProperties(this.#ac,{rootClass:{hidden:!t}}))}#fc(){return this.#nc?this.rotation:0}#bc(){if(this.#nc)return null;const[t,e]=this.pageDimensions,[s,i]=this.pageTranslation,n=this.#Jl,a=new Float32Array(8*n.length);let r=0;for(const{x:o,y:l,width:c,height:h}of n){const n=o*t+s,u=(1-l)*e+i;a[r]=a[r+4]=n,a[r+1]=a[r+3]=u,a[r+2]=a[r+6]=n+c*t,a[r+5]=a[r+7]=u-h*e,r+=8}return a}#wc(t){return this.#ic.serialize(t,this.#fc())}static startHighlighting(t,e,{target:s,x:i,y:n}){const{x:a,y:r,width:o,height:l}=s.getBoundingClientRect(),c=new AbortController,h=t.combinedSignal(c),pointerUpCallback=e=>{c.abort(),this.#yc(t,e)};window.addEventListener("blur",pointerUpCallback,{signal:h}),window.addEventListener("pointerup",pointerUpCallback,{signal:h}),window.addEventListener("pointerdown",stopEvent,{capture:!0,passive:!1,signal:h}),window.addEventListener("contextmenu",noContextMenu,{signal:h}),s.addEventListener("pointermove",this.#xc.bind(this,t),{signal:h}),this._freeHighlight=new qA({x:i,y:n},[a,r,o,l],t.scale,this._defaultThickness/2,e,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0))}static#xc(t,e){this._freeHighlight.add(e)&&t.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}static#yc(t,e){this._freeHighlight.isEmpty()?t.drawLayer.remove(this._freeHighlightId):t.createAndAddNewEditor(e,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static async deserialize(t,e,s){let i=null;if(t instanceof MA){const{data:{quadPoints:e,rect:s,rotation:n,id:a,color:r,opacity:o,popupRef:l,richText:c,contentsObj:h,creationDate:u,modificationDate:d},parent:{page:{pageNumber:f}}}=t;i=t={annotationType:Ww.HIGHLIGHT,color:Array.from(r),opacity:o,quadPoints:e,boxes:null,pageIndex:f-1,rect:s.slice(0),rotation:n,annotationElementId:a,id:a,deleted:!1,popupRef:l,richText:c,comment:h?.str||null,creationDate:u,modificationDate:d}}else if(t instanceof TA){const{data:{inkLists:e,rect:s,rotation:n,id:a,color:r,borderStyle:{rawWidth:o},popupRef:l,richText:c,contentsObj:h,creationDate:u,modificationDate:d},parent:{page:{pageNumber:f}}}=t;i=t={annotationType:Ww.HIGHLIGHT,color:Array.from(r),thickness:o,inkLists:e,boxes:null,pageIndex:f-1,rect:s.slice(0),rotation:n,annotationElementId:a,id:a,deleted:!1,popupRef:l,richText:c,comment:h?.str||null,creationDate:u,modificationDate:d}}const{color:n,quadPoints:a,inkLists:r,opacity:o}=t,l=await super.deserialize(t,e,s);l.color=Cy.makeHexColor(...n),l.opacity=o||1,r&&(l.#Sl=t.thickness),l._initialData=i,t.comment&&l.setCommentData(t);const[c,h]=l.pageDimensions,[u,d]=l.pageTranslation;if(a){const t=l.#Jl=[];for(let e=0;e<a.length;e+=8)t.push({x:(a[e]-u)/c,y:1-(a[e+1]-d)/h,width:(a[e+2]-a[e])/c,height:(a[e+1]-a[e+5])/h});l.#cc(),l.#lc(),l.rotate(l.rotation)}else if(r){l.#nc=!0;const t=r[0],s={x:t[0]-u,y:h-(t[1]-d)},i=new qA(s,[0,0,c,h],1,l.#Sl/2,!0,.001);for(let e=0,n=t.length;e<n;e+=2)s.x=t[e]-u,s.y=h-(t[e+1]-d),i.add(s);const{id:n,clipPathId:a}=e.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:l.color,"fill-opacity":l._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:i.toSVGPath()}},!0,!0);l.#oc({highlightOutlines:i.getOutlines(),highlightId:n,clipPathId:a}),l.#lc(),l.rotate(l.parentRotation)}return l}serialize(t=!1){if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();const e=Qy._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),s=super.serialize(t);return Object.assign(s,{color:e,opacity:this.opacity,thickness:this.#Sl,quadPoints:this.#bc(),outlines:this.#wc(s.rect)}),this.addComment(s),this.annotationElementId&&!this.#dl(s)?null:(s.id=this.annotationElementId,s)}#dl(t){const{color:e}=this._initialData;return this.hasEditedComment||t.color.some((t,s)=>t!==e[s])}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}},WA=class{#vc=Object.create(null);updateProperty(t,e){this[t]=e,this.updateSVGProperty(t,e)}updateProperties(t){if(t)for(const[e,s]of Object.entries(t))e.startsWith("_")||this.updateProperty(e,s)}updateSVGProperty(t,e){this.#vc[t]=e}toSVGProperties(){const t=this.#vc;return this.#vc=Object.create(null),{root:t}}reset(){this.#vc=Object.create(null)}updateAll(t=this){this.updateProperties(t)}clone(){unreachable("Not implemented")}},VA=class _DrawingEditor extends Qy{#Ac=null;#kc;_colorPicker=null;_drawId=null;static _currentDrawId=-1;static _currentParent=null;static#Sc=null;static#Cc=null;static#_c=null;static#Ic=NaN;static#Tc=null;static#Mc=null;static#Ec=NaN;static _INNER_MARGIN=3;constructor(t){super(t),this.#kc=t.mustBeCommitted||!1,this._addOutlines(t)}onUpdatedColor(){this._colorPicker?.update(this.color),super.onUpdatedColor()}_addOutlines(t){t.drawOutlines&&(this.#Fc(t),this.#lc())}#Fc({drawOutlines:t,drawId:e,drawingOptions:s}){this.#Ac=t,this._drawingOptions||=s,this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),e>=0?(this._drawId=e,this.parent.drawLayer.finalizeDraw(e,t.defaultProperties)):this._drawId=this.#Dc(t,this.parent),this.#Rc(t.box)}#Dc(t,e){const{id:s}=e.drawLayer.draw(_DrawingEditor._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return s}static _mergeSVGProperties(t,e){const s=new Set(Object.keys(t));for(const[i,n]of Object.entries(e))s.has(i)?Object.assign(t[i],n):t[i]=n;return t}static getDefaultDrawingOptions(t){unreachable("Not implemented")}static get typesMap(){unreachable("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,e){const s=this.typesMap.get(t);s&&this._defaultDrawingOptions.updateProperty(s,e),this._currentParent&&(_DrawingEditor.#Sc.updateProperty(s,e),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,e){const s=this.constructor.typesMap.get(t);s&&this._updateProperty(t,s,e)}static get defaultPropertiesToUpdate(){const t=[],e=this._defaultDrawingOptions;for(const[s,i]of this.typesMap)t.push([s,e[i]]);return t}get propertiesToUpdate(){const t=[],{_drawingOptions:e}=this;for(const[s,i]of this.constructor.typesMap)t.push([s,e[i]]);return t}_updateProperty(t,e,s){const i=this._drawingOptions,n=i[e],setter=s=>{i.updateProperty(e,s);const n=this.#Ac.updateProperty(e,s);n&&this.#Rc(n),this.parent?.drawLayer.updateProperties(this._drawId,i.toSVGProperties()),t===this.colorType&&this.onUpdatedColor()};this.addCommands({cmd:setter.bind(this,s),undo:setter.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,_DrawingEditor._mergeSVGProperties(this.#Ac.getPathResizingSVGProperties(this.#Bc()),{bbox:this.#Pc()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,_DrawingEditor._mergeSVGProperties(this.#Ac.getPathResizedSVGProperties(this.#Bc()),{bbox:this.#Pc()}))}_onTranslating(t,e){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#Pc()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,_DrawingEditor._mergeSVGProperties(this.#Ac.getPathTranslatedSVGProperties(this.#Bc(),this.parentDimensions),{bbox:this.#Pc()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,this.#kc&&(this.#kc=!1,this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){this.#gc(),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#lc(),this.#Rc(this.#Ac.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;this.parent&&!t?(this._uiManager.removeShouldRescale(this),this.#gc()):t&&(this._uiManager.addShouldRescale(this),this.#lc(t),e=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),e&&this.select()}#gc(){null!==this._drawId&&this.parent&&(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}#lc(t=this.parent){null!==this._drawId&&this.parent===t||(null===this._drawId?(this._drawingOptions.updateAll(),this._drawId=this.#Dc(this.#Ac,t)):this.parent.drawLayer.updateParent(this._drawId,t.drawLayer))}#Nc([t,e,s,i]){const{parentDimensions:[n,a],rotation:r}=this;switch(r){case 90:return[e,1-t,s*(a/n),i*(n/a)];case 180:return[1-t,1-e,s,i];case 270:return[1-e,t,s*(a/n),i*(n/a)];default:return[t,e,s,i]}}#Bc(){const{x:t,y:e,width:s,height:i,parentDimensions:[n,a],rotation:r}=this;switch(r){case 90:return[1-e,t,s*(n/a),i*(a/n)];case 180:return[1-t,1-e,s,i];case 270:return[e,1-t,s*(n/a),i*(a/n)];default:return[t,e,s,i]}}#Rc(t){[this.x,this.y,this.width,this.height]=this.#Nc(t),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()}#Pc(){const{x:t,y:e,width:s,height:i,rotation:n,parentRotation:a,parentDimensions:[r,o]}=this;switch((4*n+a)/90){case 1:return[1-e-i,t,i,s];case 2:return[1-t-s,1-e-i,s,i];case 3:return[e,1-t-s,i,s];case 4:return[t,e-s*(r/o),i*(o/r),s*(r/o)];case 5:return[1-e,t,s*(r/o),i*(o/r)];case 6:return[1-t-i*(o/r),1-e,i*(o/r),s*(r/o)];case 7:return[e-s*(r/o),1-t-i*(o/r),s*(r/o),i*(o/r)];case 8:return[t-s,e-i,s,i];case 9:return[1-e,t-s,i,s];case 10:return[1-t,1-e,s,i];case 11:return[e-i,1-t,i,s];case 12:return[t-i*(o/r),e,i*(o/r),s*(r/o)];case 13:return[1-e-s*(r/o),t-i*(o/r),s*(r/o),i*(o/r)];case 14:return[1-t,1-e-s*(r/o),i*(o/r),s*(r/o)];case 15:return[e,1-t,s*(r/o),i*(o/r)];default:return[t,e,s,i]}}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,_DrawingEditor._mergeSVGProperties({bbox:this.#Pc()},this.#Ac.updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&this.#Rc(this.#Ac.updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let t,e;this._isCopy&&(t=this.x,e=this.y);const s=super.render();s.classList.add("draw");const i=document.createElement("div");return s.append(i),i.setAttribute("aria-hidden","true"),i.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,e),s}static createDrawerInstance(t,e,s,i,n){unreachable("Not implemented")}static startDrawing(t,e,s,i){const{target:n,offsetX:a,offsetY:r,pointerId:o,pointerType:l}=i;if(_DrawingEditor.#Tc&&_DrawingEditor.#Tc!==l)return;const{viewport:{rotation:c}}=t,{width:h,height:u}=n.getBoundingClientRect(),d=_DrawingEditor.#Cc=new AbortController,f=t.combinedSignal(d);_DrawingEditor.#Ic||=o,_DrawingEditor.#Tc??=l,window.addEventListener("pointerup",t=>{_DrawingEditor.#Ic===t.pointerId?this._endDraw(t):_DrawingEditor.#Mc?.delete(t.pointerId)},{signal:f}),window.addEventListener("pointercancel",t=>{_DrawingEditor.#Ic===t.pointerId?this._currentParent.endDrawingSession():_DrawingEditor.#Mc?.delete(t.pointerId)},{signal:f}),window.addEventListener("pointerdown",t=>{_DrawingEditor.#Tc===t.pointerType&&((_DrawingEditor.#Mc||=new Set).add(t.pointerId),_DrawingEditor.#Sc.isCancellable()&&(_DrawingEditor.#Sc.removeLastElement(),_DrawingEditor.#Sc.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:f}),window.addEventListener("contextmenu",noContextMenu,{signal:f}),n.addEventListener("pointermove",this._drawMove.bind(this),{signal:f}),n.addEventListener("touchmove",t=>{t.timeStamp===_DrawingEditor.#Ec&&stopEvent(t)},{signal:f}),t.toggleDrawing(),e._editorUndoBar?.hide(),_DrawingEditor.#Sc?t.drawLayer.updateProperties(this._currentDrawId,_DrawingEditor.#Sc.startNew(a,r,h,u,c)):(e.updateUIForDefaultProperties(this),_DrawingEditor.#Sc=this.createDrawerInstance(a,r,h,u,c),_DrawingEditor.#_c=this.getDefaultDrawingOptions(),this._currentParent=t,({id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(_DrawingEditor.#_c.toSVGProperties(),_DrawingEditor.#Sc.defaultSVGProperties),!0,!1)))}static _drawMove(t){if(_DrawingEditor.#Ec=-1,!_DrawingEditor.#Sc)return;const{offsetX:e,offsetY:s,pointerId:i}=t;_DrawingEditor.#Ic===i&&(_DrawingEditor.#Mc?.size>=1?this._endDraw(t):(this._currentParent.drawLayer.updateProperties(this._currentDrawId,_DrawingEditor.#Sc.add(e,s)),_DrawingEditor.#Ec=t.timeStamp,stopEvent(t)))}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,_DrawingEditor.#Sc=null,_DrawingEditor.#_c=null,_DrawingEditor.#Tc=null,_DrawingEditor.#Ec=NaN),_DrawingEditor.#Cc&&(_DrawingEditor.#Cc.abort(),_DrawingEditor.#Cc=null,_DrawingEditor.#Ic=NaN,_DrawingEditor.#Mc=null)}static _endDraw(t){const e=this._currentParent;if(e){if(e.toggleDrawing(!0),this._cleanup(!1),t?.target===e.div&&e.drawLayer.updateProperties(this._currentDrawId,_DrawingEditor.#Sc.end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){const t=_DrawingEditor.#Sc,s=this._currentDrawId,i=t.getLastElement();return void e.addCommands({cmd:()=>{e.drawLayer.updateProperties(s,t.setLastElement(i))},undo:()=>{e.drawLayer.updateProperties(s,t.removeLastElement())},mustExec:!1,type:Vw.DRAW_STEP})}this.endDrawing(!1)}}static endDrawing(t){const e=this._currentParent;if(!e)return null;if(e.toggleDrawing(!0),e.cleanUndoStack(Vw.DRAW_STEP),!_DrawingEditor.#Sc.isEmpty()){const{pageDimensions:[s,i],scale:n}=e,a=e.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:_DrawingEditor.#Sc.getOutlines(s*n,i*n,n,this._INNER_MARGIN),drawingOptions:_DrawingEditor.#_c,mustBeCommitted:!t});return this._cleanup(!0),a}return e.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(t){}static deserializeDraw(t,e,s,i,n,a){unreachable("Not implemented")}static async deserialize(t,e,s){const{rawDims:{pageWidth:i,pageHeight:n,pageX:a,pageY:r}}=e.viewport,o=this.deserializeDraw(a,r,i,n,this._INNER_MARGIN,t),l=await super.deserialize(t,e,s);return l.createDrawingOptions(t),l.#Fc({drawOutlines:o}),l.#lc(),l.onScaleChanging(),l.rotate(),l}serializeDraw(t){const[e,s]=this.pageTranslation,[i,n]=this.pageDimensions;return this.#Ac.serialize([e,s,i,n],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}},XA=class{#wl=new Float64Array(6);#$o;#Oc;#Ka;#Sl;#Cl;#Lc="";#Uc=0;#Xl=new KA;#$c;#Hc;constructor(t,e,s,i,n,a){this.#$c=s,this.#Hc=i,this.#Ka=n,this.#Sl=a,[t,e]=this.#jc(t,e);const r=this.#$o=[NaN,NaN,NaN,NaN,t,e];this.#Cl=[t,e],this.#Oc=[{line:r,points:this.#Cl}],this.#wl.set(r,0)}updateProperty(t,e){"stroke-width"===t&&(this.#Sl=e)}#jc(t,e){return LA._normalizePoint(t,e,this.#$c,this.#Hc,this.#Ka)}isEmpty(){return!this.#Oc||0===this.#Oc.length}isCancellable(){return this.#Cl.length<=10}add(t,e){[t,e]=this.#jc(t,e);const[s,i,n,a]=this.#wl.subarray(2,6),r=t-n,o=e-a;return Math.hypot(this.#$c*r,this.#Hc*o)<=2?null:(this.#Cl.push(t,e),isNaN(s)?(this.#wl.set([n,a,t,e],2),this.#$o.push(NaN,NaN,NaN,NaN,t,e),{path:{d:this.toSVGPath()}}):(isNaN(this.#wl[0])&&this.#$o.splice(6,6),this.#wl.set([s,i,n,a,t,e],0),this.#$o.push(...LA.createBezierPoints(s,i,n,a,t,e)),{path:{d:this.toSVGPath()}}))}end(t,e){const s=this.add(t,e);return s||(2===this.#Cl.length?{path:{d:this.toSVGPath()}}:null)}startNew(t,e,s,i,n){this.#$c=s,this.#Hc=i,this.#Ka=n,[t,e]=this.#jc(t,e);const a=this.#$o=[NaN,NaN,NaN,NaN,t,e];this.#Cl=[t,e];const r=this.#Oc.at(-1);return r&&(r.line=new Float32Array(r.line),r.points=new Float32Array(r.points)),this.#Oc.push({line:a,points:this.#Cl}),this.#wl.set(a,0),this.#Uc=0,this.toSVGPath(),null}getLastElement(){return this.#Oc.at(-1)}setLastElement(t){return this.#Oc?(this.#Oc.push(t),this.#$o=t.line,this.#Cl=t.points,this.#Uc=0,{path:{d:this.toSVGPath()}}):this.#Xl.setLastElement(t)}removeLastElement(){if(!this.#Oc)return this.#Xl.removeLastElement();this.#Oc.pop(),this.#Lc="";for(let t=0,e=this.#Oc.length;t<e;t++){const{line:e,points:s}=this.#Oc[t];this.#$o=e,this.#Cl=s,this.#Uc=0,this.toSVGPath()}return{path:{d:this.#Lc}}}toSVGPath(){const t=LA.svgRound(this.#$o[4]),e=LA.svgRound(this.#$o[5]);if(2===this.#Cl.length)return this.#Lc=`${this.#Lc} M ${t} ${e} Z`,this.#Lc;if(this.#Cl.length<=6){const s=this.#Lc.lastIndexOf("M");this.#Lc=`${this.#Lc.slice(0,s)} M ${t} ${e}`,this.#Uc=6}if(4===this.#Cl.length){const t=LA.svgRound(this.#$o[10]),e=LA.svgRound(this.#$o[11]);return this.#Lc=`${this.#Lc} L ${t} ${e}`,this.#Uc=12,this.#Lc}const s=[];0===this.#Uc&&(s.push(`M ${t} ${e}`),this.#Uc=6);for(let t=this.#Uc,e=this.#$o.length;t<e;t+=6){const[e,i,n,a,r,o]=this.#$o.slice(t,t+6).map(LA.svgRound);s.push(`C${e} ${i} ${n} ${a} ${r} ${o}`)}return this.#Lc+=s.join(" "),this.#Uc=this.#$o.length,this.#Lc}getOutlines(t,e,s,i){const n=this.#Oc.at(-1);return n.line=new Float32Array(n.line),n.points=new Float32Array(n.points),this.#Xl.build(this.#Oc,t,e,s,this.#Ka,this.#Sl,i),this.#wl=null,this.#$o=null,this.#Oc=null,this.#Lc=null,this.#Xl}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}},KA=class extends LA{#Nl;#qc=0;#pl;#Oc;#$c;#Hc;#zc;#Ka;#Sl;build(t,e,s,i,n,a,r){this.#$c=e,this.#Hc=s,this.#zc=i,this.#Ka=n,this.#Sl=a,this.#pl=r??0,this.#Oc=t,this.#Gc()}get thickness(){return this.#Sl}setLastElement(t){return this.#Oc.push(t),{path:{d:this.toSVGPath()}}}removeLastElement(){return this.#Oc.pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const t=[];for(const{line:e}of this.#Oc)if(t.push(`M${LA.svgRound(e[4])} ${LA.svgRound(e[5])}`),6!==e.length)if(12===e.length&&isNaN(e[6]))t.push(`L${LA.svgRound(e[10])} ${LA.svgRound(e[11])}`);else for(let s=6,i=e.length;s<i;s+=6){const[i,n,a,r,o,l]=e.subarray(s,s+6).map(LA.svgRound);t.push(`C${i} ${n} ${a} ${r} ${o} ${l}`)}else t.push("Z");return t.join("")}serialize([t,e,s,i],n){const a=[],r=[],[o,l,c,h]=this.#Wc();let u,d,f,g,p,m,b,w,y;switch(this.#Ka){case 0:y=LA._rescale,u=t,d=e+i,f=s,g=-i,p=t+o*s,m=e+(1-l-h)*i,b=t+(o+c)*s,w=e+(1-l)*i;break;case 90:y=LA._rescaleAndSwap,u=t,d=e,f=s,g=i,p=t+l*s,m=e+o*i,b=t+(l+h)*s,w=e+(o+c)*i;break;case 180:y=LA._rescale,u=t+s,d=e,f=-s,g=i,p=t+(1-o-c)*s,m=e+l*i,b=t+(1-o)*s,w=e+(l+h)*i;break;case 270:y=LA._rescaleAndSwap,u=t+s,d=e+i,f=-s,g=-i,p=t+(1-l-h)*s,m=e+(1-o-c)*i,b=t+(1-l)*s,w=e+(1-o)*i}for(const{line:t,points:e}of this.#Oc)a.push(y(t,u,d,f,g,n?new Array(t.length):null)),r.push(y(e,u,d,f,g,n?new Array(e.length):null));return{lines:a,points:r,rect:[p,m,b,w]}}static deserialize(t,e,s,i,n,{paths:{lines:a,points:r},rotation:o,thickness:l}){const c=[];let h,u,d,f,g;switch(o){case 0:g=LA._rescale,h=-t/s,u=e/i+1,d=1/s,f=-1/i;break;case 90:g=LA._rescaleAndSwap,h=-e/i,u=-t/s,d=1/i,f=1/s;break;case 180:g=LA._rescale,h=t/s+1,u=-e/i,d=-1/s,f=1/i;break;case 270:g=LA._rescaleAndSwap,h=e/i+1,u=t/s+1,d=-1/i,f=-1/s}if(!a){a=[];for(const t of r){const e=t.length;if(2===e){a.push(new Float32Array([NaN,NaN,NaN,NaN,t[0],t[1]]));continue}if(4===e){a.push(new Float32Array([NaN,NaN,NaN,NaN,t[0],t[1],NaN,NaN,NaN,NaN,t[2],t[3]]));continue}const s=new Float32Array(3*(e-2));a.push(s);let[i,n,r,o]=t.subarray(0,4);s.set([NaN,NaN,NaN,NaN,i,n],0);for(let a=4;a<e;a+=2){const e=t[a],l=t[a+1];s.set(LA.createBezierPoints(i,n,r,o,e,l),3*(a-2)),[i,n,r,o]=[r,o,e,l]}}}for(let t=0,e=a.length;t<e;t++)c.push({line:g(a[t].map(t=>t??NaN),h,u,d,f),points:g(r[t].map(t=>t??NaN),h,u,d,f)});const p=new this.prototype.constructor;return p.build(c,s,i,1,o,l,n),p}#Vc(t=this.#Sl){const e=this.#pl+t/2*this.#zc;return this.#Ka%180==0?[e/this.#$c,e/this.#Hc]:[e/this.#Hc,e/this.#$c]}#Wc(){const[t,e,s,i]=this.#Nl,[n,a]=this.#Vc(0);return[t+n,e+a,s-2*n,i-2*a]}#Gc(){const t=this.#Nl=new Float32Array([1/0,1/0,-1/0,-1/0]);for(const{line:e}of this.#Oc){if(e.length<=12){for(let s=4,i=e.length;s<i;s+=6)Cy.pointBoundingBox(e[s],e[s+1],t);continue}let s=e[4],i=e[5];for(let n=6,a=e.length;n<a;n+=6){const[a,r,o,l,c,h]=e.subarray(n,n+6);Cy.bezierBoundingBox(s,i,a,r,o,l,c,h,t),s=c,i=h}}const[e,s]=this.#Vc();t[0]=MathClamp(t[0]-e,0,1),t[1]=MathClamp(t[1]-s,0,1),t[2]=MathClamp(t[2]+e,0,1),t[3]=MathClamp(t[3]+s,0,1),t[2]-=t[0],t[3]-=t[1]}get box(){return this.#Nl}updateProperty(t,e){return"stroke-width"===t?this.#uc(e):null}#uc(t){const[e,s]=this.#Vc();this.#Sl=t;const[i,n]=this.#Vc(),[a,r]=[i-e,n-s],o=this.#Nl;return o[0]-=a,o[1]-=r,o[2]+=2*a,o[3]+=2*r,o}updateParentDimensions([t,e],s){const[i,n]=this.#Vc();this.#$c=t,this.#Hc=e,this.#zc=s;const[a,r]=this.#Vc(),o=a-i,l=r-n,c=this.#Nl;return c[0]-=o,c[1]-=l,c[2]+=2*o,c[3]+=2*l,c}updateRotation(t){return this.#qc=t,{path:{transform:this.rotationTransform}}}get viewBox(){return this.#Nl.map(LA.svgRound).join(" ")}get defaultProperties(){const[t,e]=this.#Nl;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${LA.svgRound(t)} ${LA.svgRound(e)}`}}}get rotationTransform(){const[,,t,e]=this.#Nl;let s=0,i=0,n=0,a=0,r=0,o=0;switch(this.#qc){case 90:i=e/t,n=-t/e,r=t;break;case 180:s=-1,a=-1,r=t,o=e;break;case 270:i=-e/t,n=t/e,o=e;break;default:return""}return`matrix(${s} ${i} ${n} ${a} ${LA.svgRound(r)} ${LA.svgRound(o)})`}getPathResizingSVGProperties([t,e,s,i]){const[n,a]=this.#Vc(),[r,o,l,c]=this.#Nl;if(Math.abs(l-n)<=LA.PRECISION||Math.abs(c-a)<=LA.PRECISION){const n=t+s/2-(r+l/2),a=e+i/2-(o+c/2);return{path:{"transform-origin":`${LA.svgRound(t)} ${LA.svgRound(e)}`,transform:`${this.rotationTransform} translate(${n} ${a})`}}}const h=(s-2*n)/(l-2*n),u=(i-2*a)/(c-2*a),d=l/s,f=c/i;return{path:{"transform-origin":`${LA.svgRound(r)} ${LA.svgRound(o)}`,transform:`${this.rotationTransform} scale(${d} ${f}) translate(${LA.svgRound(n)} ${LA.svgRound(a)}) scale(${h} ${u}) translate(${LA.svgRound(-n)} ${LA.svgRound(-a)})`}}}getPathResizedSVGProperties([t,e,s,i]){const[n,a]=this.#Vc(),r=this.#Nl,[o,l,c,h]=r;if(r[0]=t,r[1]=e,r[2]=s,r[3]=i,Math.abs(c-n)<=LA.PRECISION||Math.abs(h-a)<=LA.PRECISION){const n=t+s/2-(o+c/2),a=e+i/2-(l+h/2);for(const{line:t,points:e}of this.#Oc)LA._translate(t,n,a,t),LA._translate(e,n,a,e);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${LA.svgRound(t)} ${LA.svgRound(e)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const u=(s-2*n)/(c-2*n),d=(i-2*a)/(h-2*a),f=-u*(o+n)+t+n,g=-d*(l+a)+e+a;if(1!==u||1!==d||0!==f||0!==g)for(const{line:t,points:e}of this.#Oc)LA._rescale(t,f,g,u,d,t),LA._rescale(e,f,g,u,d,e);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${LA.svgRound(t)} ${LA.svgRound(e)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([t,e],s){const[i,n]=s,a=this.#Nl,r=t-a[0],o=e-a[1];if(this.#$c===i&&this.#Hc===n)for(const{line:t,points:e}of this.#Oc)LA._translate(t,r,o,t),LA._translate(e,r,o,e);else{const t=this.#$c/i,e=this.#Hc/n;this.#$c=i,this.#Hc=n;for(const{line:s,points:i}of this.#Oc)LA._rescale(s,r,o,t,e,s),LA._rescale(i,r,o,t,e,i);a[2]*=t,a[3]*=e}return a[0]=t,a[1]=e,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${LA.svgRound(t)} ${LA.svgRound(e)}`}}}get defaultSVGProperties(){const t=this.#Nl;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${LA.svgRound(t[0])} ${LA.svgRound(t[1])}`,transform:this.rotationTransform||null},bbox:t}}},YA=class _InkDrawingOptions extends WA{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:Qy._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(t,e){"stroke-width"===t&&(e??=this["stroke-width"],e*=this._viewParameters.realScale),super.updateSVGProperty(t,e)}clone(){const t=new _InkDrawingOptions(this._viewParameters);return t.updateAll(this),t}},JA=class _InkEditor extends VA{static _type="ink";static _editorType=Ww.INK;static _defaultDrawingOptions=null;constructor(t){super({...t,name:"inkEditor"}),this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(t,e){Qy.initialize(t,e),this._defaultDrawingOptions=new YA(e.viewParameters)}static getDefaultDrawingOptions(t){const e=this._defaultDrawingOptions.clone();return e.updateProperties(t),e}static get supportMultipleDrawings(){return!0}static get typesMap(){return shadow(this,"typesMap",new Map([[Vw.INK_THICKNESS,"stroke-width"],[Vw.INK_COLOR,"stroke"],[Vw.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(t,e,s,i,n){return new XA(t,e,s,i,n,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(t,e,s,i,n,a){return KA.deserialize(t,e,s,i,n,a)}static async deserialize(t,e,s){let i=null;if(t instanceof TA){const{data:{inkLists:e,rect:s,rotation:n,id:a,color:r,opacity:o,borderStyle:{rawWidth:l},popupRef:c,richText:h,contentsObj:u,creationDate:d,modificationDate:f},parent:{page:{pageNumber:g}}}=t;i=t={annotationType:Ww.INK,color:Array.from(r),thickness:l,opacity:o,paths:{points:e},boxes:null,pageIndex:g-1,rect:s.slice(0),rotation:n,annotationElementId:a,id:a,deleted:!1,popupRef:c,richText:h,comment:u?.str||null,creationDate:d,modificationDate:f}}const n=await super.deserialize(t,e,s);return n._initialData=i,t.comment&&n.setCommentData(t),n}get toolbarButtons(){return this._colorPicker||=new eA(this),[["colorPicker",this._colorPicker]]}get colorType(){return Vw.INK_COLOR}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions["stroke-opacity"]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:t,_drawingOptions:e,parent:s}=this;e.updateSVGProperty("stroke-width"),s.drawLayer.updateProperties(t,e.toSVGProperties())}static onScaleChangingWhenDrawing(){const t=this._currentParent;t&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),t.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:t,thickness:e,opacity:s}){this._drawingOptions=_InkEditor.getDefaultDrawingOptions({stroke:Cy.makeHexColor(...t),"stroke-width":e,"stroke-opacity":s})}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:e,points:s}=this.serializeDraw(t),{_drawingOptions:{stroke:i,"stroke-opacity":n,"stroke-width":a}}=this,r=Object.assign(super.serialize(t),{color:Qy._colorManager.convert(i),opacity:n,thickness:a,paths:{lines:e,points:s}});return this.addComment(r),t?(r.isCopy=!0,r):this.annotationElementId&&!this.#dl(r)?null:(r.id=this.annotationElementId,r)}#dl(t){const{color:e,thickness:s,opacity:i,pageIndex:n}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||t.color.some((t,s)=>t!==e[s])||t.thickness!==s||t.opacity!==i||t.pageIndex!==n}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;const{points:e,rect:s}=this.serializeDraw(!1);return t.updateEdited({rect:s,thickness:this._drawingOptions["stroke-width"],points:e,popup:this.comment}),null}},ZA=class extends KA{toSVGPath(){let t=super.toSVGPath();return t.endsWith("Z")||(t+="Z"),t}},QA=class{static#Xc={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#Kc(t,e,s,i){return i-=e,0===(s-=t)?i>0?0:4:1===s?i+6:2-i}static#Yc=new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]);static#Jc(t,e,s,i,n,a,r){const o=this.#Kc(s,i,n,a);for(let n=0;n<8;n++){const a=(-n+o-r+16)%8;if(0!==t[(s+this.#Yc[2*a])*e+(i+this.#Yc[2*a+1])])return a}return-1}static#Zc(t,e,s,i,n,a,r){const o=this.#Kc(s,i,n,a);for(let n=0;n<8;n++){const a=(n+o+r+16)%8;if(0!==t[(s+this.#Yc[2*a])*e+(i+this.#Yc[2*a+1])])return a}return-1}static#Qc(t,e,s,i){const n=t.length,a=new Int32Array(n);for(let e=0;e<n;e++)a[e]=t[e]<=i?1:0;for(let t=1;t<s-1;t++)a[t*e]=a[t*e+e-1]=0;for(let t=0;t<e;t++)a[t]=a[e*s-1-t]=0;let r,o=1;const l=[];for(let t=1;t<s-1;t++){r=1;for(let s=1;s<e-1;s++){const i=t*e+s,n=a[i];if(0===n)continue;let c=t,h=s;if(1===n&&0===a[i-1])o+=1,h-=1;else{if(!(n>=1&&0===a[i+1])){1!==n&&(r=Math.abs(n));continue}o+=1,h+=1,n>1&&(r=n)}const u=[s,t],d=h===s+1,f={isHole:d,points:u,id:o,parent:0};let g;l.push(f);for(const t of l)if(t.id===r){g=t;break}g?g.isHole?f.parent=d?g.parent:r:f.parent=d?r:g.parent:f.parent=d?r:0;const p=this.#Jc(a,e,t,s,c,h,0);if(-1===p){a[i]=-o,1!==a[i]&&(r=Math.abs(a[i]));continue}let m=this.#Yc[2*p],b=this.#Yc[2*p+1];const w=t+m,y=s+b;c=w,h=y;let x=t,v=s;for(;;){const n=this.#Zc(a,e,x,v,c,h,1);m=this.#Yc[2*n],b=this.#Yc[2*n+1];const l=x+m,d=v+b;u.push(d,l);const f=x*e+v;if(0===a[f+1]?a[f]=-o:1===a[f]&&(a[f]=o),l===t&&d===s&&x===w&&v===y){1!==a[i]&&(r=Math.abs(a[i]));break}c=x,h=v,x=l,v=d}}}return l}static#th(t,e,s,i){if(s-e<=4){for(let n=e;n<s-2;n+=2)i.push(t[n],t[n+1]);return}const n=t[e],a=t[e+1],r=t[s-4]-n,o=t[s-3]-a,l=Math.hypot(r,o),c=r/l,h=o/l,u=c*a-h*n,d=o/r,f=1/l,g=Math.atan(d),p=Math.cos(g),m=Math.sin(g),b=f*(Math.abs(p)+Math.abs(m)),w=f*(1-b+b**2),y=Math.max(Math.atan(Math.abs(m+p)*w),Math.atan(Math.abs(m-p)*w));let x=0,v=e;for(let i=e+2;i<s-2;i+=2){const e=Math.abs(u-c*t[i+1]+h*t[i]);e>x&&(v=i,x=e)}x>(l*y)**2?(this.#th(t,e,v+2,i),this.#th(t,v,s,i)):i.push(n,a)}static#eh(t){const e=[],s=t.length;return this.#th(t,0,s,e),e.push(t[s-2],t[s-1]),e.length<=4?null:e}static#sh(t,e,s,i,n,a){const r=new Float32Array(a**2),o=-2*i**2,l=a>>1;for(let t=0;t<a;t++){const e=(t-l)**2;for(let s=0;s<a;s++)r[t*a+s]=Math.exp((e+(s-l)**2)/o)}const c=new Float32Array(256),h=-2*n**2;for(let t=0;t<256;t++)c[t]=Math.exp(t**2/h);const u=t.length,d=new Uint8Array(u),f=new Uint32Array(256);for(let i=0;i<s;i++)for(let n=0;n<e;n++){const o=i*e+n,h=t[o];let u=0,g=0;for(let o=0;o<a;o++){const d=i+o-l;if(!(d<0||d>=s))for(let s=0;s<a;s++){const i=n+s-l;if(i<0||i>=e)continue;const f=t[d*e+i],p=r[o*a+s]*c[Math.abs(f-h)];u+=f*p,g+=p}}f[d[o]=Math.round(u/g)]++}return[d,f]}static#ih(t){const e=new Uint32Array(256);for(const s of t)e[s]++;return e}static#nh(t){const e=t.length,s=new Uint8ClampedArray(e>>2);let i=-1/0,n=1/0;for(let e=0,a=s.length;e<a;e++){const a=s[e]=t[e<<2];i=Math.max(i,a),n=Math.min(n,a)}const a=255/(i-n);for(let t=0,e=s.length;t<e;t++)s[t]=(s[t]-n)*a;return s}static#ah(t){let e,s=-1/0,i=-1/0;const n=t.findIndex(t=>0!==t);let a=n,r=n;for(e=n;e<256;e++){const n=t[e];n>s&&(e-a>i&&(i=e-a,r=e-1),s=n,a=e)}for(e=r-1;e>=0&&!(t[e]>t[e+1]);e--);return e}static#rh(t){const e=t,{width:s,height:i}=t,{maxDim:n}=this.#Xc;let a=s,r=i;if(s>n||i>n){let o=s,l=i,c=Math.log2(Math.max(s,i)/n);const h=Math.floor(c);c=c===h?h-1:h;for(let s=0;s<c;s++){a=Math.ceil(o/2),r=Math.ceil(l/2);const s=new OffscreenCanvas(a,r);s.getContext("2d").drawImage(t,0,0,o,l,0,0,a,r),o=a,l=r,t!==e&&t.close(),t=s.transferToImageBitmap()}const u=Math.min(n/a,n/r);a=Math.round(a*u),r=Math.round(r*u)}const o=new OffscreenCanvas(a,r).getContext("2d",{willReadFrequently:!0});o.fillStyle="white",o.fillRect(0,0,a,r),o.filter="grayscale(1)",o.drawImage(t,0,0,t.width,t.height,0,0,a,r);const l=o.getImageData(0,0,a,r).data;return[this.#nh(l),a,r]}static extractContoursFromText(t,{fontFamily:e,fontStyle:s,fontWeight:i},n,a,r,o){let l=new OffscreenCanvas(1,1),c=l.getContext("2d",{alpha:!1});const h=c.font=`${s} ${i} 200px ${e}`,{actualBoundingBoxLeft:u,actualBoundingBoxRight:d,actualBoundingBoxAscent:f,actualBoundingBoxDescent:g,fontBoundingBoxAscent:p,fontBoundingBoxDescent:m,width:b}=c.measureText(t),w=1.5,y=Math.ceil(Math.max(Math.abs(u)+Math.abs(d)||0,b)*w),x=Math.ceil(Math.max(Math.abs(f)+Math.abs(g)||200,Math.abs(p)+Math.abs(m)||200)*w);l=new OffscreenCanvas(y,x),c=l.getContext("2d",{alpha:!0,willReadFrequently:!0}),c.font=h,c.filter="grayscale(1)",c.fillStyle="white",c.fillRect(0,0,y,x),c.fillStyle="black",c.fillText(t,.5*y/2,1.5*x/2);const v=this.#nh(c.getImageData(0,0,y,x).data),A=this.#ih(v),k=this.#ah(A),S=this.#Qc(v,y,x,k);return this.processDrawnLines({lines:{curves:S,width:y,height:x},pageWidth:n,pageHeight:a,rotation:r,innerMargin:o,mustSmooth:!0,areContours:!0})}static process(t,e,s,i,n){const[a,r,o]=this.#rh(t),[l,c]=this.#sh(a,r,o,Math.hypot(r,o)*this.#Xc.sigmaSFactor,this.#Xc.sigmaR,this.#Xc.kernelSize),h=this.#ah(c),u=this.#Qc(l,r,o,h);return this.processDrawnLines({lines:{curves:u,width:r,height:o},pageWidth:e,pageHeight:s,rotation:i,innerMargin:n,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:t,pageWidth:e,pageHeight:s,rotation:i,innerMargin:n,mustSmooth:a,areContours:r}){i%180!=0&&([e,s]=[s,e]);const{curves:o,width:l,height:c}=t,h=t.thickness??0,u=[],d=Math.min(e/l,s/c),f=d/e,g=d/s,p=[];for(const{points:t}of o){const e=a?this.#eh(t):t;if(!e)continue;p.push(e);const s=e.length,i=new Float32Array(s),n=new Float32Array(3*(2===s?2:s-2));if(u.push({line:n,points:i}),2===s){i[0]=e[0]*f,i[1]=e[1]*g,n.set([NaN,NaN,NaN,NaN,i[0],i[1]],0);continue}let[r,o,l,c]=e;r*=f,o*=g,l*=f,c*=g,i.set([r,o,l,c],0),n.set([NaN,NaN,NaN,NaN,r,o],0);for(let t=4;t<s;t+=2){const s=i[t]=e[t]*f,a=i[t+1]=e[t+1]*g;n.set(LA.createBezierPoints(r,o,l,c,s,a),3*(t-2)),[r,o,l,c]=[l,c,s,a]}}if(0===u.length)return null;const m=r?new ZA:new KA;return m.build(u,e,s,1,i,r?0:h,n),{outline:m,newCurves:p,areContours:r,thickness:h,width:l,height:c}}static async compressSignature({outlines:t,areContours:e,thickness:s,width:i,height:n}){let a,r=1/0,o=-1/0,l=0;for(const e of t){l+=e.length;for(let t=2,s=e.length;t<s;t++){const s=e[t]-e[t-2];r=Math.min(r,s),o=Math.max(o,s)}}a=r>=-128&&o<=127?Int8Array:r>=-32768&&o<=32767?Int16Array:Int32Array;const c=t.length,h=8+3*c,u=new Uint32Array(h);let d=0;u[d++]=h*Uint32Array.BYTES_PER_ELEMENT+(l-2*c)*a.BYTES_PER_ELEMENT,u[d++]=0,u[d++]=i,u[d++]=n,u[d++]=e?0:1,u[d++]=Math.max(0,Math.floor(s??0)),u[d++]=c,u[d++]=a.BYTES_PER_ELEMENT;for(const e of t)u[d++]=e.length-2,u[d++]=e[0],u[d++]=e[1];const f=new CompressionStream("deflate-raw"),g=f.writable.getWriter();await g.ready,g.write(u);const p=a.prototype.constructor;for(const e of t){const t=new p(e.length-2);for(let s=2,i=e.length;s<i;s++)t[s-2]=e[s]-e[s-2];g.write(t)}g.close();const m=await new Response(f.readable).arrayBuffer();return toBase64Util(new Uint8Array(m))}static async decompressSignature(t){try{const s=(e=t,Uint8Array.fromBase64?Uint8Array.fromBase64(e):stringToBytes(atob(e))),{readable:i,writable:n}=new DecompressionStream("deflate-raw"),a=n.getWriter();await a.ready,a.write(s).then(async()=>{await a.ready,await a.close()}).catch(()=>{});let r=null,o=0;for await(const t of i)r||=new Uint8Array(new Uint32Array(t.buffer,0,4)[0]),r.set(t,o),o+=t.length;const l=new Uint32Array(r.buffer,0,r.length>>2),c=l[1];if(0!==c)throw new Error(`Invalid version: ${c}`);const h=l[2],u=l[3],d=0===l[4],f=l[5],g=l[6],p=l[7],m=[],b=(8+3*g)*Uint32Array.BYTES_PER_ELEMENT;let w;switch(p){case Int8Array.BYTES_PER_ELEMENT:w=new Int8Array(r.buffer,b);break;case Int16Array.BYTES_PER_ELEMENT:w=new Int16Array(r.buffer,b);break;case Int32Array.BYTES_PER_ELEMENT:w=new Int32Array(r.buffer,b)}o=0;for(let t=0;t<g;t++){const e=l[3*t+8],s=new Float32Array(e+2);m.push(s);for(let e=0;e<2;e++)s[e]=l[3*t+8+e+1];for(let t=0;t<e;t++)s[t+2]=s[t]+w[o++]}return{areContours:d,thickness:f,outlines:m,width:h,height:u}}catch(t){return warn(`decompressSignature: ${t}`),null}var e}},tk=class _SignatureOptions extends WA{constructor(){super(),super.updateProperties({fill:Qy._defaultLineColor,"stroke-width":0})}clone(){const t=new _SignatureOptions;return t.updateAll(this),t}},ek=class _DrawnSignatureOptions extends YA{constructor(t){super(t),super.updateProperties({stroke:Qy._defaultLineColor,"stroke-width":1})}clone(){const t=new _DrawnSignatureOptions(this._viewParameters);return t.updateAll(this),t}},sk=class _SignatureEditor extends VA{#oh=!1;#lh=null;#ch=null;#hh=null;static _type="signature";static _editorType=Ww.SIGNATURE;static _defaultDrawingOptions=null;constructor(t){super({...t,mustBeCommitted:!0,name:"signatureEditor"}),this._willKeepAspectRatio=!0,this.#ch=t.signatureData||null,this.#lh=null,this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(t,e){Qy.initialize(t,e),this._defaultDrawingOptions=new tk,this._defaultDrawnSignatureOptions=new ek(e.viewParameters)}static getDefaultDrawingOptions(t){const e=this._defaultDrawingOptions.clone();return e.updateProperties(t),e}static get supportMultipleDrawings(){return!1}static get typesMap(){return shadow(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!this.#lh}}static computeTelemetryFinalData(t){const e=t.get("hasDescription");return{hasAltText:e.get(!0)??0,hasNoAltText:e.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){null!==this._drawId&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,e;const{_isCopy:s}=this;if(s&&(this._isCopy=!1,t=this.x,e=this.y),super.render(),null===this._drawId)if(this.#ch){const{lines:t,mustSmooth:e,areContours:s,description:i,uuid:n,heightInPage:a}=this.#ch,{rawDims:{pageWidth:r,pageHeight:o},rotation:l}=this.parent.viewport,c=QA.processDrawnLines({lines:t,pageWidth:r,pageHeight:o,rotation:l,innerMargin:_SignatureEditor._INNER_MARGIN,mustSmooth:e,areContours:s});this.addSignature(c,a,i,n)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute("data-l10n-args",JSON.stringify({description:this.#lh||""}));return s&&(this._isCopy=!0,this._moveAfterPaste(t,e)),this.div}setUuid(t){this.#hh=t,this.addEditToolbar()}getUuid(){return this.#hh}get description(){return this.#lh}set description(t){this.#lh=t,this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:t})),super.addEditToolbar().then(e=>{e?.updateEditSignatureButton(t)}))}getSignaturePreview(){const{newCurves:t,areContours:e,thickness:s,width:i,height:n}=this.#ch,a=Math.max(i,n);return{areContours:e,outline:QA.processDrawnLines({lines:{curves:t.map(t=>({points:t})),thickness:s,width:i,height:n},pageWidth:a,pageHeight:a,rotation:0,innerMargin:0,mustSmooth:!1,areContours:e}).outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,e,s,i){const{x:n,y:a}=this,{outline:r}=this.#ch=t;let o;this.#oh=r instanceof ZA,this.description=s,this.#oh?o=_SignatureEditor.getDefaultDrawingOptions():(o=_SignatureEditor._defaultDrawnSignatureOptions.clone(),o.updateProperties({"stroke-width":r.thickness})),this._addOutlines({drawOutlines:r,drawingOptions:o});const[,l]=this.pageDimensions;let c=e/l;c=c>=1?.5:c,this.width*=c/this.height,this.width>=1&&(c*=.9/this.width,this.width=.9),this.height=c,this.setDims(),this.x=n,this.y=a,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(i),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!i,hasDescription:!!s}}),this.div.hidden=!1}getFromImage(t){const{rawDims:{pageWidth:e,pageHeight:s},rotation:i}=this.parent.viewport;return QA.process(t,e,s,i,_SignatureEditor._INNER_MARGIN)}getFromText(t,e){const{rawDims:{pageWidth:s,pageHeight:i},rotation:n}=this.parent.viewport;return QA.extractContoursFromText(t,e,s,i,n,_SignatureEditor._INNER_MARGIN)}getDrawnSignature(t){const{rawDims:{pageWidth:e,pageHeight:s},rotation:i}=this.parent.viewport;return QA.processDrawnLines({lines:t,pageWidth:e,pageHeight:s,rotation:i,innerMargin:_SignatureEditor._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:e}){t?this._drawingOptions=_SignatureEditor.getDefaultDrawingOptions():(this._drawingOptions=_SignatureEditor._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":e}))}serialize(t=!1){if(this.isEmpty())return null;const{lines:e,points:s}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":i}}=this,n=Object.assign(super.serialize(t),{isSignature:!0,areContours:this.#oh,color:[0,0,0],thickness:this.#oh?0:i});return this.addComment(n),t?(n.paths={lines:e,points:s},n.uuid=this.#hh,n.isCopy=!0):n.lines=e,this.#lh&&(n.accessibilityData={type:"Figure",alt:this.#lh}),n}static deserializeDraw(t,e,s,i,n,a){return a.areContours?ZA.deserialize(t,e,s,i,n,a):KA.deserialize(t,e,s,i,n,a)}static async deserialize(t,e,s){const i=await super.deserialize(t,e,s);return i.#oh=t.areContours,i.description=t.accessibilityData?.alt||"",i.#hh=t.uuid,i}},ik=class extends Qy{#uh=null;#dh=null;#fh=null;#gh=null;#ph=null;#mh="";#bh=null;#wh=!1;#yh=null;#xh=!1;#vh=!1;static _type="stamp";static _editorType=Ww.STAMP;constructor(t){super({...t,name:"stampEditor"}),this.#gh=t.bitmapUrl,this.#ph=t.bitmapFile,this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,e){Qy.initialize(t,e)}static isHandlingMimeForPasting(t){return Ly.includes(t)}static paste(t,e){e.pasteEditor({mode:Ww.STAMP},{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(t){const e=t.get("hasAltText");return{hasAltText:e.get(!0)??0,hasNoAltText:e.get(!1)??0}}#Ah(t,e=!1){t?(this.#uh=t.bitmap,e||(this.#dh=t.id,this.#xh=t.isSvg),t.file&&(this.#mh=t.file.name),this.#kh()):this.remove()}#Sh(){if(this.#fh=null,this._uiManager.enableWaiting(!1),this.#bh)if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#uh)this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});else{if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#uh){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}async mlGuessAltText(t=null,e=!0){if(this.hasAltTextData())return null;const{mlManager:s}=this._uiManager;if(!s)throw new Error("No ML.");if(!await s.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:i,width:n,height:a}=t||this.copyCanvas(null,null,!0).imageData,r=await s.guess({name:"altText",request:{data:i,width:n,height:a,channels:i.length/(n*a)}});if(!r)throw new Error("No response from the AI service.");if(r.error)throw new Error("Error from the AI service.");if(r.cancel)return null;if(!r.output)throw new Error("No valid response from the AI service.");const o=r.output;return await this.setGuessedAltText(o),e&&!this.hasAltTextData()&&(this.altTextData={alt:o,decorative:!1}),o}#Ch(){if(this.#dh)return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(this.#dh).then(t=>this.#Ah(t,!0)).finally(()=>this.#Sh());if(this.#gh){const t=this.#gh;return this.#gh=null,this._uiManager.enableWaiting(!0),void(this.#fh=this._uiManager.imageManager.getFromUrl(t).then(t=>this.#Ah(t)).finally(()=>this.#Sh()))}if(this.#ph){const t=this.#ph;return this.#ph=null,this._uiManager.enableWaiting(!0),void(this.#fh=this._uiManager.imageManager.getFromFile(t).then(t=>this.#Ah(t)).finally(()=>this.#Sh()))}const t=document.createElement("input");t.type="file",t.accept=Ly.join(",");const e=this._uiManager._signal;this.#fh=new Promise(s=>{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]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#Ah(e)}else this.remove();s()},{signal:e}),t.addEventListener("cancel",()=>{this.remove(),s()},{signal:e})}).finally(()=>this.#Sh()),t.click()}remove(){this.#dh&&(this.#uh=null,this._uiManager.imageManager.deleteId(this.#dh),this.#bh?.remove(),this.#bh=null,this.#yh&&(clearTimeout(this.#yh),this.#yh=null)),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(this.#dh&&null===this.#bh&&this.#Ch(),this.isAttachedToDOM||this.parent.add(this))):this.#dh&&this.#Ch()}onceAdded(t){this._isDraggable=!0,t&&this.div.focus()}isEmpty(){return!(this.#fh||this.#uh||this.#gh||this.#ph||this.#dh||this.#wh)}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;return this._isCopy&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.createAltText(),this.#wh||(this.#uh?this.#kh():this.#Ch()),this._isCopy&&this._moveAfterPaste(t,e),this._uiManager.addShouldRescale(this),this.div}setCanvas(t,e){const{id:s,bitmap:i}=this._uiManager.imageManager.getFromCanvas(t,e);e.remove(),s&&this._uiManager.imageManager.isValidId(s)&&(this.#dh=s,i&&(this.#uh=i),this.#wh=!1,this.#kh())}_onResized(){this.onScaleChanging()}onScaleChanging(){this.parent&&(null!==this.#yh&&clearTimeout(this.#yh),this.#yh=setTimeout(()=>{this.#yh=null,this.#_h()},200))}#kh(){const{div:t}=this;let{width:e,height:s}=this.#uh;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}this._uiManager.enableWaiting(!1);const r=this.#bh=document.createElement("canvas");r.setAttribute("role","img"),this.addContainer(r),this.width=e/i,this.height=s/n,this.setDims(),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&!this.annotationElementId||(t.hidden=!1),this.#_h(),this.#vh||(this.parent.addUndoableEditor(this),this.#vh=!0),this._reportTelemetry({action:"inserted_image"}),this.#mh&&this.div.setAttribute("aria-description",this.#mh),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")}copyCanvas(t,e,s=!1){t||(t=224);const{width:i,height:n}=this.#uh,a=new Oy;let r=this.#uh,o=i,l=n,c=null;if(e){if(i>e||n>e){const t=Math.min(e/i,e/n);o=Math.floor(i*t),l=Math.floor(n*t)}c=document.createElement("canvas");const t=c.width=Math.ceil(o*a.sx),s=c.height=Math.ceil(l*a.sy);this.#xh||(r=this.#Ih(t,s));const h=c.getContext("2d");h.filter=this._uiManager.hcmFilter;let u="white",d="#cfcfd8";"none"!==this._uiManager.hcmFilter?d="black":Uy.isDarkMode&&(u="#8f8f9d",d="#42414d");const f=15,g=f*a.sx,p=f*a.sy,m=new OffscreenCanvas(2*g,2*p),b=m.getContext("2d");b.fillStyle=u,b.fillRect(0,0,2*g,2*p),b.fillStyle=d,b.fillRect(0,0,g,p),b.fillRect(g,p,g,p),h.fillStyle=h.createPattern(m,"repeat"),h.fillRect(0,0,t,s),h.drawImage(r,0,0,r.width,r.height,0,0,t,s)}let h=null;if(s){let e,s;if(a.symmetric&&r.width<t&&r.height<t)e=r.width,s=r.height;else if(r=this.#uh,i>t||n>t){const a=Math.min(t/i,t/n);e=Math.floor(i*a),s=Math.floor(n*a),this.#xh||(r=this.#Ih(e,s))}const o=new OffscreenCanvas(e,s).getContext("2d",{willReadFrequently:!0});o.drawImage(r,0,0,r.width,r.height,0,0,e,s),h={width:e,height:s,data:o.getImageData(0,0,e,s).data}}return{canvas:c,width:o,height:l,imageData:h}}#Ih(t,e){const{width:s,height:i}=this.#uh;let n=s,a=i,r=this.#uh;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}#_h(){const[t,e]=this.parentDimensions,{width:s,height:i}=this,n=new Oy,a=Math.ceil(s*t*n.sx),r=Math.ceil(i*e*n.sy),o=this.#bh;if(!o||o.width===a&&o.height===r)return;o.width=a,o.height=r;const l=this.#xh?this.#uh:this.#Ih(a,r),c=o.getContext("2d");c.filter=this._uiManager.hcmFilter,c.drawImage(l,0,0,l.width,l.height,0,0,a,r)}#Th(t){if(t){if(this.#xh){const t=this._uiManager.imageManager.getSvgUrl(this.#dh);if(t)return t}const t=document.createElement("canvas");return({width:t.width,height:t.height}=this.#uh),t.getContext("2d").drawImage(this.#uh,0,0),t.toDataURL()}if(this.#xh){const[t,e]=this.pageDimensions,s=Math.round(this.width*t*Dy.PDF_TO_CSS_UNITS),i=Math.round(this.height*e*Dy.PDF_TO_CSS_UNITS),n=new OffscreenCanvas(s,i);return n.getContext("2d").drawImage(this.#uh,0,0,this.#uh.width,this.#uh.height,0,0,s,i),n.transferToImageBitmap()}return structuredClone(this.#uh)}static async deserialize(t,e,s){let i=null,n=!1;if(t instanceof RA){const{data:{rect:a,rotation:r,id:o,structParent:l,popupRef:c,richText:h,contentsObj:u,creationDate:d,modificationDate:f},container:g,parent:{page:{pageNumber:p}},canvas:m}=t;let b,w;m?(delete t.canvas,({id:b,bitmap:w}=s.imageManager.getFromCanvas(g.id,m)),m.remove()):(n=!0,t._hasNoCanvas=!0);const y=(await e._structTree.getAriaAttributes(`${Ty}${o}`))?.get("aria-label")||"";i=t={annotationType:Ww.STAMP,bitmapId:b,bitmap:w,pageIndex:p-1,rect:a.slice(0),rotation:r,annotationElementId:o,id:o,deleted:!1,accessibilityData:{decorative:!1,altText:y},isSvg:!1,structParent:l,popupRef:c,richText:h,comment:u?.str||null,creationDate:d,modificationDate:f}}const a=await super.deserialize(t,e,s),{rect:r,bitmap:o,bitmapUrl:l,bitmapId:c,isSvg:h,accessibilityData:u}=t;n?(s.addMissingCanvas(t.id,a),a.#wh=!0):c&&s.imageManager.isValidId(c)?(a.#dh=c,o&&(a.#uh=o)):a.#gh=l,a.#xh=h;const[d,f]=a.pageDimensions;return a.width=(r[2]-r[0])/d,a.height=(r[3]-r[1])/f,u&&(a.altTextData=u),a._initialData=i,t.comment&&a.setCommentData(t),a.#vh=!!i,a}serialize(t=!1,e=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const s=Object.assign(super.serialize(t),{bitmapId:this.#dh,isSvg:this.#xh});if(this.addComment(s),t)return s.bitmapUrl=this.#Th(!0),s.accessibilityData=this.serializeAltText(!0),s.isCopy=!0,s;const{decorative:i,altText:n}=this.serializeAltText(!1);if(!i&&n&&(s.accessibilityData={type:"Figure",alt:n}),this.annotationElementId){const t=this.#dl(s);return t.isSame?null:(t.isSameAltText?delete s.accessibilityData:s.accessibilityData.structParent=this._initialData.structParent??-1,s.id=this.annotationElementId,delete s.bitmapId,s)}if(null===e)return s;e.stamps||=new Map;const a=this.#xh?(s.rect[2]-s.rect[0])*(s.rect[3]-s.rect[1]):null;if(e.stamps.has(this.#dh)){if(this.#xh){const t=e.stamps.get(this.#dh);a>t.area&&(t.area=a,t.serialized.bitmap.close(),t.serialized.bitmap=this.#Th(!1))}}else e.stamps.set(this.#dh,{area:a,serialized:s}),s.bitmap=this.#Th(!1);return s}#dl(t){const{pageIndex:e,accessibilityData:{altText:s}}=this._initialData,i=t.pageIndex===e,n=(t.accessibilityData?.alt||"")===s;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&i&&n,isSameAltText:n}}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}},nk=class _AnnotationEditorLayer{#Ko;#Mh=!1;#Eh=null;#Fh=null;#Dh=null;#Rh=new Map;#Bh=!1;#Ph=!1;#Nh=!1;#Oh=null;#Lh=null;#Uh=null;#$h=null;#Hh=null;#jh=-1;#_e;static _initialized=!1;static#ts=new Map([OA,JA,ik,GA,sk].map(t=>[t._editorType,t]));constructor({uiManager:t,pageIndex:e,div:s,structTreeLayer:i,accessibilityManager:n,annotationLayer:a,drawLayer:r,textLayer:o,viewport:l,l10n:c}){const h=[..._AnnotationEditorLayer.#ts.values()];if(!_AnnotationEditorLayer._initialized){_AnnotationEditorLayer._initialized=!0;for(const e of h)e.initialize(c,t)}t.registerEditorTypes(h),this.#_e=t,this.pageIndex=e,this.div=s,this.#Ko=n,this.#Eh=a,this.viewport=l,this.#Uh=o,this.drawLayer=r,this._structTree=i,this.#_e.addLayer(this)}get isEmpty(){return 0===this.#Rh.size}get isInvisible(){return this.isEmpty&&this.#_e.getMode()===Ww.NONE}updateToolbar(t){this.#_e.updateToolbar(t)}updateMode(t=this.#_e.getMode()){switch(this.#qh(),t){case Ww.NONE:return this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case Ww.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case Ww.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:e}=this.div;if(e.toggle("nonEditing",!1),t===Ww.POPUP)e.toggle("commentEditing",!0);else{e.toggle("commentEditing",!1);for(const s of _AnnotationEditorLayer.#ts.values())e.toggle(`${s._type}Editing`,t===s._editorType)}this.div.hidden=!1}hasTextLayer(t){return t===this.#Uh?.div}setEditingState(t){this.#_e.setEditingState(t)}addCommands(t){this.#_e.addCommands(t)}cleanUndoStack(t){this.#_e.cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){this.#Eh?.div.classList.toggle("disabled",!t)}get#zh(){return 0!==this.#Rh.size?this.#Rh.values():this.#_e.getEditors(this.pageIndex)}async enable(){this.#Nh=!0,this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle("nonEditing",!1),this.#Hh?.abort(),this.#Hh=null;const t=new Set;for(const e of this.#zh)e.enableEditing(),e.show(!0),e.annotationElementId&&(this.#_e.removeChangedExistingAnnotation(e),t.add(e.annotationElementId));const e=this.#Eh;if(e)for(const s of e.getEditableAnnotations()){if(s.hide(),this.#_e.isDeletedAnnotationElement(s.data.id))continue;if(t.has(s.data.id))continue;const e=await this.deserialize(s);e&&(this.addOrRebuild(e),e.enableEditing())}this.#Nh=!1,this.#_e._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){if(this.#Ph=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),this.#Uh&&!this.#Hh){this.#Hh=new AbortController;const t=this.#_e.combinedSignal(this.#Hh);this.#Uh.div.addEventListener("pointerdown",t=>{const{clientX:e,clientY:s,timeStamp:i}=t;if(i-this.#jh>500)return void(this.#jh=i);this.#jh=-1;const{classList:n}=this.div;n.toggle("getElements",!0);const a=document.elementsFromPoint(e,s);if(n.toggle("getElements",!1),!this.div.contains(a[0]))return;let r;const o=new RegExp(`^${Gw}[0-9]+$`);for(const t of a)if(o.test(t.id)){r=t.id;break}if(!r)return;const l=this.#Rh.get(r);null===l?.annotationElementId&&(t.stopPropagation(),t.preventDefault(),l.dblclick(t))},{signal:t,capture:!0})}const t=this.#Eh;if(t){const e=new Map,s=new Map;for(const i of this.#zh)i.disableEditing(),i.annotationElementId?null===i.serialize()?(s.set(i.annotationElementId,i),this.getEditableAnnotation(i.annotationElementId)?.show(),i.remove()):e.set(i.annotationElementId,i):i.updateFakeAnnotationElement(t);const i=t.getEditableAnnotations();for(const t of i){const{id:i}=t.data;if(this.#_e.isDeletedAnnotationElement(i)){t.updateEdited({deleted:!0});continue}let n=s.get(i);n?(n.resetAnnotationElement(t),n.show(!1),t.show()):(n=e.get(i),n&&(this.#_e.addChangedExistingAnnotation(n),n.renderAnnotationElement(t)&&n.show(!1)),t.show())}}this.#qh(),this.isEmpty&&(this.div.hidden=!0);const{classList:e}=this.div;for(const t of _AnnotationEditorLayer.#ts.values())e.remove(`${t._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#Ph=!1}getEditableAnnotation(t){return this.#Eh?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#_e.getActive()!==t&&this.#_e.setActiveEditor(t)}enableTextSelection(){if(this.div.tabIndex=-1,this.#Uh?.div&&!this.#$h){this.#$h=new AbortController;const t=this.#_e.combinedSignal(this.#$h);this.#Uh.div.addEventListener("pointerdown",this.#Gh.bind(this),{signal:t}),this.#Uh.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#Uh?.div&&this.#$h&&(this.#$h.abort(),this.#$h=null,this.#Uh.div.classList.remove("highlighting"))}#Gh(t){this.#_e.unselectAll();const{target:e}=t;if(e===this.#Uh.div||("img"===e.getAttribute("role")||e.classList.contains("endOfContent"))&&this.#Uh.div.contains(e)){const{isMac:e}=ky.platform;if(0!==t.button||t.ctrlKey&&e)return;this.#_e.showAllEditors("highlight",!0,!0),this.#Uh.div.classList.add("free"),this.toggleDrawing(),GA.startHighlighting(this,"ltr"===this.#_e.direction,{target:this.#Uh.div,x:t.x,y:t.y}),this.#Uh.div.addEventListener("pointerup",()=>{this.#Uh.div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:this.#_e._signal}),t.preventDefault()}}enableClick(){if(this.#Fh)return;this.#Fh=new AbortController;const t=this.#_e.combinedSignal(this.#Fh);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const e=this.pointerup.bind(this);this.div.addEventListener("pointerup",e,{signal:t}),this.div.addEventListener("pointercancel",e,{signal:t})}disableClick(){this.#Fh?.abort(),this.#Fh=null}attach(t){this.#Rh.set(t.id,t);const{annotationElementId:e}=t;e&&this.#_e.isDeletedAnnotationElement(e)&&this.#_e.removeDeletedAnnotationElement(t)}detach(t){this.#Rh.delete(t.id),this.#Ko?.removePointerInTextLayer(t.contentDiv),!this.#Ph&&t.annotationElementId&&this.#_e.addDeletedAnnotationElement(t)}remove(t){this.detach(t),this.#_e.removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){t.parent!==this&&(t.parent&&t.annotationElementId&&(this.#_e.addDeletedAnnotationElement(t.annotationElementId),Qy.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(t.parent!==this||!t.isAttachedToDOM){if(this.changeParent(t),this.#_e.addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!this.#Nh),this.#_e.addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;const{activeElement:e}=document;t.div.contains(e)&&!this.#Dh&&(t._focusEventsAllowed=!1,this.#Dh=setTimeout(()=>{this.#Dh=null,t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this.#_e._signal}),e.focus())},0)),t._structTreeParentId=this.#Ko?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||=this,t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getEditorByUID(t){for(const e of this.#Rh.values())if(e.uid===t)return e;return null}getNextId(){return this.#_e.getId()}get#Wh(){return _AnnotationEditorLayer.#ts.get(this.#_e.getMode())}combinedSignal(t){return this.#_e.combinedSignal(t)}#Vh(t){const e=this.#Wh;return e?new e.prototype.constructor(t):null}canCreateNewEmptyEditor(){return this.#Wh?.canCreateNewEmptyEditor()}async pasteEditor(t,e){this.updateToolbar(t),await this.#_e.updateMode(t.mode);const{offsetX:s,offsetY:i}=this.#Xh(),n=this.getNextId(),a=this.#Vh({parent:this,id:n,x:s,y:i,uiManager:this.#_e,isCentered:!0,...e});a&&this.add(a)}async deserialize(t){return await(_AnnotationEditorLayer.#ts.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,this.#_e))||null}createAndAddNewEditor(t,e,s={}){const i=this.getNextId(),n=this.#Vh({parent:this,id:i,x:t.offsetX,y:t.offsetY,uiManager:this.#_e,isCentered:e,...s});return n&&this.add(n),n}get boundingClientRect(){return this.div.getBoundingClientRect()}#Xh(){const{x:t,y:e,width:s,height:i}=this.boundingClientRect,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}}addNewEditor(t={}){this.createAndAddNewEditor(this.#Xh(),!0,t)}setSelected(t){this.#_e.setSelected(t)}toggleSelected(t){this.#_e.toggleSelected(t)}unselect(t){this.#_e.unselect(t)}pointerup(t){const{isMac:e}=ky.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;if(!this.#Bh)return;if(this.#Bh=!1,this.#Wh?.isDrawer&&this.#Wh.supportMultipleDrawings)return;if(!this.#Mh)return void(this.#Mh=!0);const s=this.#_e.getMode();s!==Ww.STAMP&&s!==Ww.SIGNATURE?this.createAndAddNewEditor(t,!1):this.#_e.unselectAll()}pointerdown(t){if(this.#_e.getMode()===Ww.HIGHLIGHT&&this.enableTextSelection(),this.#Bh)return void(this.#Bh=!1);const{isMac:e}=ky.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;if(this.#Bh=!0,this.#Wh?.isDrawer)return void this.startDrawingSession(t);const s=this.#_e.getActive();this.#Mh=!s||s.isEmpty()}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),this.#Oh)return void this.#Wh.startDrawing(this,this.#_e,!1,t);this.#_e.setCurrentDrawingSession(this),this.#Oh=new AbortController;const e=this.#_e.combinedSignal(this.#Oh);this.div.addEventListener("blur",({relatedTarget:t})=>{t&&!this.div.contains(t)&&(this.#Lh=null,this.commitOrRemove())},{signal:e}),this.#Wh.startDrawing(this,this.#_e,!1,t)}pause(t){if(t){const{activeElement:t}=document;return void(this.div.contains(t)&&(this.#Lh=t))}this.#Lh&&setTimeout(()=>{this.#Lh?.focus(),this.#Lh=null},0)}endDrawingSession(t=!1){return this.#Oh?(this.#_e.setCurrentDrawingSession(null),this.#Oh.abort(),this.#Oh=null,this.#Lh=null,this.#Wh.endDrawing(t)):null}findNewParent(t,e,s){const i=this.#_e.findParent(e,s);return null!==i&&i!==this&&(i.changeParent(t),!0)}commitOrRemove(){return!!this.#Oh&&(this.endDrawingSession(),!0)}onScaleChanging(){this.#Oh&&this.#Wh.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),this.#_e.getActive()?.parent===this&&(this.#_e.commitOrRemove(),this.#_e.setActiveEditor(null)),this.#Dh&&(clearTimeout(this.#Dh),this.#Dh=null);for(const t of this.#Rh.values())this.#Ko?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#Rh.clear(),this.#_e.removeLayer(this)}#qh(){for(const t of this.#Rh.values())t.isEmpty()&&t.remove()}render({viewport:t}){this.viewport=t,setLayerDimensions(this.div,t);for(const t of this.#_e.getEditors(this.pageIndex))this.add(t),t.rebuild();this.updateMode()}update({viewport:t}){this.#_e.commitOrRemove(),this.#qh();const e=this.viewport.rotation,s=t.rotation;if(this.viewport=t,setLayerDimensions(this.div,{rotation:s}),e!==s)for(const t of this.#Rh.values())t.rotate(s)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return this.#_e.viewParameters.realScale}},ak=class _DrawLayer{#yo=null;#Kh=new Map;#Yh=new Map;static#Ee=0;constructor({pageIndex:t}){this.pageIndex=t}setParent(t){if(this.#yo){if(this.#yo!==t){if(this.#Kh.size>0)for(const e of this.#Kh.values())e.remove(),t.append(e);this.#yo=t}}else this.#yo=t}static get _svgFactory(){return shadow(this,"_svgFactory",new nA)}static#Jh(t,[e,s,i,n]){const{style:a}=t;a.top=100*s+"%",a.left=100*e+"%",a.width=100*i+"%",a.height=100*n+"%"}#Zh(){const t=_DrawLayer._svgFactory.create(1,1,!0);return this.#yo.append(t),t.setAttribute("aria-hidden",!0),t}#Qh(t,e){const s=_DrawLayer._svgFactory.createElement("clipPath");t.append(s);const i=`clip_${e}`;s.setAttribute("id",i),s.setAttribute("clipPathUnits","objectBoundingBox");const n=_DrawLayer._svgFactory.createElement("use");return s.append(n),n.setAttribute("href",`#${e}`),n.classList.add("clip"),i}#tu(t,e){for(const[s,i]of Object.entries(e))null===i?t.removeAttribute(s):t.setAttribute(s,i)}draw(t,e=!1,s=!1){const i=_DrawLayer.#Ee++,n=this.#Zh(),a=_DrawLayer._svgFactory.createElement("defs");n.append(a);const r=_DrawLayer._svgFactory.createElement("path");a.append(r);const o=`path_p${this.pageIndex}_${i}`;r.setAttribute("id",o),r.setAttribute("vector-effect","non-scaling-stroke"),e&&this.#Yh.set(i,r);const l=s?this.#Qh(a,o):null,c=_DrawLayer._svgFactory.createElement("use");return n.append(c),c.setAttribute("href",`#${o}`),this.updateProperties(n,t),this.#Kh.set(i,n),{id:i,clipPathId:`url(#${l})`}}drawOutline(t,e){const s=_DrawLayer.#Ee++,i=this.#Zh(),n=_DrawLayer._svgFactory.createElement("defs");i.append(n);const a=_DrawLayer._svgFactory.createElement("path");n.append(a);const r=`path_p${this.pageIndex}_${s}`;let o;if(a.setAttribute("id",r),a.setAttribute("vector-effect","non-scaling-stroke"),e){const t=_DrawLayer._svgFactory.createElement("mask");n.append(t),o=`mask_p${this.pageIndex}_${s}`,t.setAttribute("id",o),t.setAttribute("maskUnits","objectBoundingBox");const e=_DrawLayer._svgFactory.createElement("rect");t.append(e),e.setAttribute("width","1"),e.setAttribute("height","1"),e.setAttribute("fill","white");const i=_DrawLayer._svgFactory.createElement("use");t.append(i),i.setAttribute("href",`#${r}`),i.setAttribute("stroke","none"),i.setAttribute("fill","black"),i.setAttribute("fill-rule","nonzero"),i.classList.add("mask")}const l=_DrawLayer._svgFactory.createElement("use");i.append(l),l.setAttribute("href",`#${r}`),o&&l.setAttribute("mask",`url(#${o})`);const c=l.cloneNode();return i.append(c),l.classList.add("mainOutline"),c.classList.add("secondaryOutline"),this.updateProperties(i,t),this.#Kh.set(s,i),s}finalizeDraw(t,e){this.#Yh.delete(t),this.updateProperties(t,e)}updateProperties(t,e){if(!e)return;const{root:s,bbox:i,rootClass:n,path:a}=e,r="number"==typeof t?this.#Kh.get(t):t;if(r){if(s&&this.#tu(r,s),i&&_DrawLayer.#Jh(r,i),n){const{classList:t}=r;for(const[e,s]of Object.entries(n))t.toggle(e,s)}if(a){const t=r.firstChild.firstChild;this.#tu(t,a)}}}updateParent(t,e){if(e===this)return;const s=this.#Kh.get(t);s&&(e.#yo.append(s),this.#Kh.delete(t),e.#Kh.set(t,s))}remove(t){this.#Yh.delete(t),null!==this.#yo&&(this.#Kh.get(t).remove(),this.#Kh.delete(t))}destroy(){this.#yo=null;for(const t of this.#Kh.values())t.remove();this.#Kh.clear(),this.#Yh.clear()}};globalThis._pdfjsTestingUtils={HighlightOutliner:HA},globalThis.pdfjsLib={AbortException:Ay,AnnotationEditorLayer:nk,AnnotationEditorParamsType:Vw,AnnotationEditorType:Ww,AnnotationEditorUIManager:Ky,AnnotationLayer:PA,AnnotationMode:zw,AnnotationType:sy,applyOpacity,build:Qv,ColorPicker:tA,createValidAbsoluteUrl,CSSConstants:$y,DOMSVGFactory:nA,DrawLayer:ak,FeatureTest:ky,fetchData,findContrastColor,getDocument,getFilenameFromUrl,getPdfFilenameFromUrl,getRGB,getUuid,getXfaPageViewport,GlobalWorkerOptions:Av,ImageKind:ey,InvalidPDFException:yy,isDataScheme,isPdfFile,isValidExplicitDest:hx,MathClamp,noContextMenu,normalizeUnicode,OPS:cy,OutputScale:Oy,PasswordResponses:gy,PDFDataRangeTransport:Gv,PDFDateString:Ny,PDFWorker:Xv,PermissionFlag:Xw,PixelsPerInch:Dy,RenderingCancelledException:By,renderRichText,ResponseException:xy,setLayerDimensions,shadow,SignatureExtractor:QA,stopEvent,SupportedImageMimeTypes:Ly,TextLayer:qv,TouchManager:Zy,updateUrlHash,Util:Cy,VerbosityLevel:ly,version:Zv,XfaLayer:Ey};export{Ay as AbortException,nk as AnnotationEditorLayer,Vw as AnnotationEditorParamsType,Ww as AnnotationEditorType,Ky as AnnotationEditorUIManager,PA as AnnotationLayer,zw as AnnotationMode,sy as AnnotationType,$y as CSSConstants,tA as ColorPicker,nA as DOMSVGFactory,ak as DrawLayer,ky as FeatureTest,Av as GlobalWorkerOptions,ey as ImageKind,yy as InvalidPDFException,MathClamp,cy as OPS,Oy as OutputScale,Gv as PDFDataRangeTransport,Ny as PDFDateString,Xv as PDFWorker,gy as PasswordResponses,Xw as PermissionFlag,Dy as PixelsPerInch,By as RenderingCancelledException,xy as ResponseException,QA as SignatureExtractor,Ly as SupportedImageMimeTypes,qv as TextLayer,Zy as TouchManager,Cy as Util,ly as VerbosityLevel,Ey as XfaLayer,applyOpacity,Qv as build,createValidAbsoluteUrl,fetchData,findContrastColor,getDocument,getFilenameFromUrl,getPdfFilenameFromUrl,getRGB,getUuid,getXfaPageViewport,isDataScheme,isPdfFile,hx as isValidExplicitDest,noContextMenu,normalizeUnicode,renderRichText,setLayerDimensions,shadow,stopEvent,updateUrlHash,Zv as version};