file-viewer-demo/public/dist/assets/PdfView-3f48c404.js

16 lines
541 KiB
JavaScript
Raw Normal View History

2024-01-30 00:54:29 +00:00
var ii=Object.defineProperty;var si=(N,w,t)=>w in N?ii(N,w,{enumerable:!0,configurable:!0,writable:!0,value:t}):N[w]=t;var tt=(N,w,t)=>(si(N,typeof w!="symbol"?w+"":w,t),t),Jt=(N,w,t)=>{if(!w.has(N))throw TypeError("Cannot "+t)};var l=(N,w,t)=>(Jt(N,w,"read from private field"),t?t.call(N):w.get(N)),$=(N,w,t)=>{if(w.has(N))throw TypeError("Cannot add the same private member more than once");w instanceof WeakSet?w.add(N):w.set(N,t)},le=(N,w,t,p)=>(Jt(N,w,"write to private field"),p?p.call(N,t):w.set(N,t),t);var ut=(N,w,t,p)=>({set _(y){le(N,w,y,t)},get _(){return l(N,w,p)}}),J=(N,w,t)=>(Jt(N,w,"access private method"),t);import{x as require$$6,c as commonjsGlobal,d as defineComponent,r as ref,o as onMounted,a as openBlock,b as createElementBlock,k as createBaseVNode,q as pushScopeId,s as popScopeId,_ as _export_sfc}from"./index-be50c070.js";import{c as commonjsRequire}from"./_commonjs-dynamic-modules-302442b1.js";import{r as refWorker}from"./worker-ref-b3abaee8.js";var pdf$1={exports:{}},path2dPolyfill_esm={},hasRequiredPath2dPolyfill_esm;function requirePath2dPolyfill_esm(){if(hasRequiredPath2dPolyfill_esm)return path2dPolyfill_esm;hasRequiredPath2dPolyfill_esm=1;function N(a,r,o){if(o||arguments.length===2)for(var m=0,v=r.length,A;m<v;m++)(A||!(m in r))&&(A||(A=Array.prototype.slice.call(r,0,m)),A[m]=r[m]);return a.concat(A||Array.prototype.slice.call(r))}var w={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},t=/([astvzqmhlc])([^astvzqmhlc]*)/gi,p=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function y(a){var r=a.match(p);return r?r.map(Number):[]}function k(a){var r=[],o=String(a).trim();return o[0]!=="M"&&o[0]!=="m"||o.replace(t,function(m,v,A){var b=y(A),c=v.toLowerCase(),s=v;if(c==="m"&&b.length>2&&(r.push(N([s],b.splice(0,2),!0)),c="l",s=s==="m"?"l":"L"),b.length<w[c])return"";for(r.push(N([s],b.splice(0,w[c]),!0));b.length>=w[c]&&b.length&&w[c];)r.push(N([s],b.splice(0,w[c]),!0));return""}),r}function u(a,r){var o=a.x*Math.cos(r)-a.y*Math.sin(r),m=a.y*Math.cos(r)+a.x*Math.sin(r);a.x=o,a.y=m}function g(a,r,o){a.x+=r,a.y+=o}function e(a,r){a.x*=r,a.y*=r}var i=function(){function a(r){var o;this.commands=[],r&&r instanceof a?(o=this.commands).push.apply(o,r.commands):r&&(this.commands=k(r))}return a.prototype.addPath=function(r){var o;r&&r instanceof a&&(o=this.commands).push.apply(o,r.commands)},a.prototype.moveTo=function(r,o){this.commands.push(["M",r,o])},a.prototype.lineTo=function(r,o){this.commands.push(["L",r,o])},a.prototype.arc=function(r,o,m,v,A,b){this.commands.push(["AC",r,o,m,v,A,!!b])},a.prototype.arcTo=function(r,o,m,v,A){this.commands.push(["AT",r,o,m,v,A])},a.prototype.ellipse=function(r,o,m,v,A,b,c,s){this.commands.push(["E",r,o,m,v,A,b,c,!!s])},a.prototype.closePath=function(){this.commands.push(["Z"])},a.prototype.bezierCurveTo=function(r,o,m,v,A,b){this.commands.push(["C",r,o,m,v,A,b])},a.prototype.quadraticCurveTo=function(r,o,m,v){this.commands.push(["Q",r,o,m,v])},a.prototype.rect=function(r,o,m,v){this.commands.push(["R",r,o,m,v])},a.prototype.roundRect=function(r,o,m,v,A){typeof A>"u"?this.commands.push(["RR",r,o,m,v,0]):this.commands.push(["RR",r,o,m,v,A])},a}();function n(a,r){var o=0,m=0,v,A,b,c,s,x,T,S,D,I,_,Q,W,j,he,Y,z,ee,oe,ye,Pe,L=null,P=null,M=null,E=null,R=null,O=null;a.beginPath();for(var B=0;B<r.length;++B){ee=r[B][0],ee!=="S"&&ee!=="s"&&ee!=="C"&&ee!=="c"&&(L=null,P=null),ee!=="T"&&ee!=="t"&&ee!=="Q"&&ee!=="q"&&(M=null,E=null);var F=void 0;switch(ee){case"m":case"M":F=r[B],ee==="m"?(o+=F[1],m+=F[2]):(o=F[1],m=F[2]),(ee==="M"||!R)&&(R={x:o,y:m}),a.moveTo(o,m);break;case"l":F=r[B],o+=F[1],m+=F[2],a.lineTo(o,m);break;case"L":F=r[B],o=F[1],m=F[2],a.lineTo(o,m);break;case"H":F=r[B],o=F[1],a.lineTo(o,m);break;case"h":F=r[B],o+=F[1],a.lineTo(o,m);break;case"V":F=r[B],m=F[1],a.lineTo(o,m);break;case"v":F=r[B],m+=F[1],a.lineTo(o,m);break;case"a":case"A":if(F=r[B],O===null)throw new Error("This should never happen");ee==="a"?(o+=F[6],m+=F[7]):(o=F[6],m=F[7]),j=F[1],he=F[2],T=F[3]*Math.PI/180,b=!!F[4],c=!!F[5],s={x:o,y:m},x={x:(O.x-s.x)/2,y:(O.y-s.y)/2},u(x,-T),S=x.x*x.x/(j*j)+x.y*x.y/(he*he),S>1&&(S=Ma
`,"\\r":"\r","\\t":" "},h=/^[\da-f]{4}$/i,f=/^[\u0000-\u001F]$/;N.exports=function(a,r){for(var o=!0,m="";r<a.length;){var v=e(a,r);if(v==="\\"){var A=i(a,r,r+2);if(y(d,A))m+=d[A],r+=2;else if(A==="\\u"){r+=2;var b=i(a,r,r+4);if(!n(h,b))throw k("Bad Unicode escape at: "+r);m+=g(u(b,16)),r+=4}else throw k('Unknown escape sequence: "'+A+'"')}else if(v==='"'){o=!1,r++;break}else{if(n(f,v))throw k("Bad control character in string literal at: "+r);m+=v,r++}}if(o)throw k("Unterminated string at: "+r);return{value:m,end:r}}},(N,w,t)=>{var Y,z,ee,oe,ye,Pe,L,P,M,E,R,O,ft,F,pt,se,hn,pe,Lt,me,Ot,Re,At,Ie,St;Object.defineProperty(w,"__esModule",{value:!0}),w.StatTimer=w.RenderingCancelledException=w.PixelsPerInch=w.PageViewport=w.PDFDateString=w.DOMStandardFontDataFactory=w.DOMSVGFactory=w.DOMFilterFactory=w.DOMCanvasFactory=w.DOMCMapReaderFactory=void 0,w.deprecated=x,w.getColorValues=_,w.getCurrentTransform=Q,w.getCurrentTransformInverse=W,w.getFilenameFromUrl=m,w.getPdfFilenameFromUrl=v,w.getRGB=I,w.getXfaPageViewport=D,w.isDataScheme=r,w.isPdfFile=o,w.isValidFetchUrl=b,w.loadScript=s,w.noContextMenu=c,w.setLayerDimensions=j,t(2),t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123),t(89),t(84),t(86),t(87);var p=t(169),y=t(1);const k="http://www.w3.org/2000/svg",he=class he{};tt(he,"CSS",96),tt(he,"PDF",72),tt(he,"PDF_TO_CSS_UNITS",he.CSS/he.PDF);let u=he;w.PixelsPerInch=u;class g extends p.BaseFilterFactory{constructor(){let{docId:ce,ownerDocument:ge=globalThis.document}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super();$(this,O);$(this,F);$(this,se);$(this,pe);$(this,me);$(this,Re);$(this,Ie);$(this,Y,void 0);$(this,z,void 0);$(this,ee,void 0);$(this,oe,void 0);$(this,ye,void 0);$(this,Pe,void 0);$(this,L,void 0);$(this,P,void 0);$(this,M,void 0);$(this,E,void 0);$(this,R,0);le(this,ee,ce),le(this,oe,ge)}addFilter(ce){if(!ce)return"none";let ge=l(this,O,ft).get(ce);if(ge)return ge;let Ce,Me,Ve,ze;if(ce.length===1){const Xe=ce[0],je=new Array(256);for(let Je=0;Je<256;Je++)je[Je]=Xe[Je]/255;ze=Ce=Me=Ve=je.join(",")}else{const[Xe,je,Je]=ce,V=new Array(256),H=new Array(256),X=new Array(256);for(let de=0;de<256;de++)V[de]=Xe[de]/255,H[de]=je[de]/255,X[de]=Je[de]/255;Ce=V.join(","),Me=H.join(","),Ve=X.join(","),ze=`${Ce}${Me}${Ve}`}if(ge=l(this,O,ft).get(ze),ge)return l(this,O,ft).set(ce,ge),ge;const _e=`g_${l(this,ee)}_transfer_map_${ut(this,R)._++}`,He=`url(#${_e})`;l(this,O,ft).set(ce,He),l(this,O,ft).set(ze,He);const Ke=J(this,pe,Lt).call(this,_e);return J(this,Re,At).call(this,Ce,Me,Ve,Ke),He}addHCMFilter(ce,ge){var je;const Ce=`${ce}-${ge}`;if(l(this,Pe)===Ce)return l(this,L);if(le(this,Pe,Ce),le(this,L,"none"),(je=l(this,ye))==null||je.remove(),!ce||!ge)return l(this,L);const Me=J(this,Ie,St).call(this,ce);ce=y.Util.makeHexColor(...Me);const Ve=J(this,Ie,St).call(this,ge);if(ge=y.Util.makeHexColor(...Ve),l(this,F,pt).style.color="",ce==="#000000"&&ge==="#ffffff"||ce===ge)return l(this,L);const ze=new Array(256);for(let Je=0;Je<=255;Je++){const V=Je/255;ze[Je]=V<=.03928?V/12.92:((V+.055)/1.055)**2.4}const _e=ze.join(","),He=`g_${l(this,ee)}_hcm_filter`,Ke=le(this,P,J(this,pe,Lt).call(this,He));J(this,Re,At).call(this,_e,_e,_e,Ke),J(this,se,hn).call(this,Ke);const Xe=(Je,V)=>{const H=Me[Je]/255,X=Ve[Je]/255,de=new Array(V+1);for(let Ee=0;Ee<=V;Ee++)de[Ee]=H+Ee/V*(X-H);return de.join(",")};return J(this,Re,At).call(this,Xe(0,5),Xe(1,5),Xe(2,5),Ke),le(this,L,`url(#${He})`),l(this,L)}addHighlightHCMFilter(ce,ge,Ce,Me){var X;const Ve=`${ce}-${ge}-${Ce}-${Me}`;if(l(this,M)===Ve)return l(this,E);if(le(this,M,Ve),le(this,E,"none"),(X=l(this,P))==null||X.remove(),!ce||!ge)return l(this,E);const[ze,_e]=[ce,ge].map(J(this,Ie,St).bind(this));let He=Math.round(.2126*ze[0]+.7152*ze[1]+.0722*ze[2]),Ke=Math.round(.2126*_e[0]+.7152*_e[1]+.0722*_e[2]),[Xe,je]=[Ce,Me].map(J(this,Ie,St).bind(this));Ke<He&&([He,Ke,Xe,je]=[Ke,He,je,Xe]),l(this,F,pt).style.color="";const Je=(de,Ee,K)=>{const U=new Array(256),ie=(Ke-He)/K,Ae=de/255,Se=(Ee-de)/(255*K);let we=0;for(let Te=0;Te<=K;Te++){const Ne=Math.round(He+Te*ie),ke=Ae+Te*Se;f
`);return ne.join("")}}w.StatTimer=A;function b(ue,ne){try{const{protocol:ce}=ne?new URL(ue,ne):new URL(ue);return ce==="http:"||ce==="https:"}catch{return!1}}function c(ue){ue.preventDefault()}function s(ue){let ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return new Promise((ce,ge)=>{const Ce=document.createElement("script");Ce.src=ue,Ce.onload=function(Me){ne&&Ce.remove(),ce(Me)},Ce.onerror=function(){ge(new Error(`Cannot load script at: ${Ce.src}`))},(document.head||document.documentElement).append(Ce)})}function x(ue){console.log("Deprecated API usage: "+ue)}let T;class S{static toDateObject(ne){if(!ne||typeof ne!="string")return null;T||(T=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const ce=T.exec(ne);if(!ce)return null;const ge=parseInt(ce[1],10);let Ce=parseInt(ce[2],10);Ce=Ce>=1&&Ce<=12?Ce-1:0;let Me=parseInt(ce[3],10);Me=Me>=1&&Me<=31?Me:1;let Ve=parseInt(ce[4],10);Ve=Ve>=0&&Ve<=23?Ve:0;let ze=parseInt(ce[5],10);ze=ze>=0&&ze<=59?ze:0;let _e=parseInt(ce[6],10);_e=_e>=0&&_e<=59?_e:0;const He=ce[7]||"Z";let Ke=parseInt(ce[8],10);Ke=Ke>=0&&Ke<=23?Ke:0;let Xe=parseInt(ce[9],10)||0;return Xe=Xe>=0&&Xe<=59?Xe:0,He==="-"?(Ve+=Ke,ze+=Xe):He==="+"&&(Ve-=Ke,ze-=Xe),new Date(Date.UTC(ge,Ce,Me,Ve,ze,_e))}}w.PDFDateString=S;function D(ue,ne){let{scale:ce=1,rotation:ge=0}=ne;const{width:Ce,height:Me}=ue.attributes.style,Ve=[0,0,parseInt(Ce),parseInt(Me)];return new f({viewBox:Ve,scale:ce,rotation:ge})}function I(ue){if(ue.startsWith("#")){const ne=parseInt(ue.slice(1),16);return[(ne&16711680)>>16,(ne&65280)>>8,ne&255]}return ue.startsWith("rgb(")?ue.slice(4,-1).split(",").map(ne=>parseInt(ne)):ue.startsWith("rgba(")?ue.slice(5,-1).split(",").map(ne=>parseInt(ne)).slice(0,3):((0,y.warn)(`Not a valid color format: "${ue}"`),[0,0,0])}function _(ue){const ne=document.createElement("span");ne.style.visibility="hidden",document.body.append(ne);for(const ce of ue.keys()){ne.style.color=ce;const ge=window.getComputedStyle(ne).color;ue.set(ce,I(ge))}ne.remove()}function Q(ue){const{a:ne,b:ce,c:ge,d:Ce,e:Me,f:Ve}=ue.getTransform();return[ne,ce,ge,Ce,Me,Ve]}function W(ue){const{a:ne,b:ce,c:ge,d:Ce,e:Me,f:Ve}=ue.getTransform().invertSelf();return[ne,ce,ge,Ce,Me,Ve]}function j(ue,ne){let ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,ge=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;if(ne instanceof f){const{pageWidth:Ce,pageHeight:Me}=ne.rawDims,{style:Ve}=ue,ze=y.FeatureTest.isCSSRoundSupported,_e=`var(--scale-factor) * ${Ce}px`,He=`var(--scale-factor) * ${Me}px`,Ke=ze?`round(${_e}, 1px)`:`calc(${_e})`,Xe=ze?`round(${He}, 1px)`:`calc(${He})`;!ce||ne.rotation%180===0?(Ve.width=Ke,Ve.height=Xe):(Ve.width=Xe,Ve.height=Ke)}ge&&ue.setAttribute("data-main-rotation",ne.rotation)}},(N,w,t)=>{Object.defineProperty(w,"__esModule",{value:!0}),w.BaseStandardFontDataFactory=w.BaseSVGFactory=w.BaseFilterFactory=w.BaseCanvasFactory=w.BaseCMapReaderFactory=void 0,t(2);var p=t(1);class y{constructor(){this.constructor===y&&(0,p.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(n){return"none"}addHCMFilter(n,d){return"none"}addHighlightHCMFilter(n,d,h,f){return"none"}destroy(){}}w.BaseFilterFactory=y;class k{constructor(){this.constructor===k&&(0,p.unreachable)("Cannot initialize BaseCanvasFactory.")}create(n,d){if(n<=0||d<=0)throw new Error("Invalid canvas size");const h=this._createCanvas(n,d);return{canvas:h,context:h.getContext("2d")}}reset(n,d,h){if(!n.canvas)throw new Error("Canvas is not specified");if(d<=0||h<=0)throw new Error("Invalid canvas size");n.canvas.width=d,n.canvas.height=h}destroy(n){if(!n.canvas)throw new Error("Canvas is not specified");n.canvas.width=0,n.canvas.height=0,n.canvas=null,n.context=null}_createCanvas(n,d){(0,p.unreachable)("Abstract method `_createCanvas` called.")}}w.BaseCanvasFactory=k;class u{constructor(n){let{baseUrl:d=null,isCompressed:h=!0}=n;this.constructor===u&&(0,p.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=d,this.isCompressed=h}async fetch(n){let{name:d}=n;if(!this.ba
`)}return this.compiledGlyphs[i]=new Function("c","size",d.join(""))}return this.compiledGlyphs[i]=function(d,h){for(const f of n)f.cmd==="scale"&&(f.args=[h,-h]),d[f.cmd].apply(d,f.args)}}}w.FontFaceObject=k},(N,w,t)=>{Object.defineProperty(w,"__esModule",{value:!0}),w.NodeStandardFontDataFactory=w.NodeFilterFactory=w.NodeCanvasFactory=w.NodeCMapReaderFactory=void 0,t(2),t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123);var p=t(169),y=t(1);(function(){if(!(globalThis.DOMMatrix||!y.isNodeJS))try{globalThis.DOMMatrix=require$$6.DOMMatrix}catch(d){(0,y.warn)(`Cannot polyfill \`DOMMatrix\`, rendering may be broken: "${d}".`)}})(),function(){if(!(globalThis.Path2D||!y.isNodeJS))try{const{CanvasRenderingContext2D:d}=require$$6,{polyfillPath2D:h}=requirePath2dPolyfill_esm();globalThis.CanvasRenderingContext2D=d,h(globalThis)}catch(d){(0,y.warn)(`Cannot polyfill \`Path2D\`, rendering may be broken: "${d}".`)}}();const k=function(n){return new Promise((d,h)=>{require$$6.readFile(n,(a,r)=>{if(a||!r){h(new Error(a));return}d(new Uint8Array(r))})})};class u extends p.BaseFilterFactory{}w.NodeFilterFactory=u;class g extends p.BaseCanvasFactory{_createCanvas(d,h){return require$$6.createCanvas(d,h)}}w.NodeCanvasFactory=g;class e extends p.BaseCMapReaderFactory{_fetchData(d,h){return k(d).then(f=>({cMapData:f,compressionType:h}))}}w.NodeCMapReaderFactory=e;class i extends p.BaseStandardFontDataFactory{_fetchData(d){return k(d)}}w.NodeStandardFontDataFactory=i},(N,w,t)=>{var z,un,oe,dn;Object.defineProperty(w,"__esModule",{value:!0}),w.CanvasGraphics=void 0,t(2),t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123),t(89);var p=t(1),y=t(168),k=t(174),u=t(175);const g=16,e=100,i=4096,n=15,d=10,h=1e3,f=16;function a(L,P){if(L._removeMirroring)throw new Error("Context is already forwarding operations.");L.__originalSave=L.save,L.__originalRestore=L.restore,L.__originalRotate=L.rotate,L.__originalScale=L.scale,L.__originalTranslate=L.translate,L.__originalTransform=L.transform,L.__originalSetTransform=L.setTransform,L.__originalResetTransform=L.resetTransform,L.__originalClip=L.clip,L.__originalMoveTo=L.moveTo,L.__originalLineTo=L.lineTo,L.__originalBezierCurveTo=L.bezierCurveTo,L.__originalRect=L.rect,L.__originalClosePath=L.closePath,L.__originalBeginPath=L.beginPath,L._removeMirroring=()=>{L.save=L.__originalSave,L.restore=L.__originalRestore,L.rotate=L.__originalRotate,L.scale=L.__originalScale,L.translate=L.__originalTranslate,L.transform=L.__originalTransform,L.setTransform=L.__originalSetTransform,L.resetTransform=L.__originalResetTransform,L.clip=L.__originalClip,L.moveTo=L.__originalMoveTo,L.lineTo=L.__originalLineTo,L.bezierCurveTo=L.__originalBezierCurveTo,L.rect=L.__originalRect,L.closePath=L.__originalClosePath,L.beginPath=L.__originalBeginPath,delete L._removeMirroring},L.save=function(){P.save(),this.__originalSave()},L.restore=function(){P.restore(),this.__originalRestore()},L.translate=function(E,R){P.translate(E,R),this.__originalTranslate(E,R)},L.scale=function(E,R){P.scale(E,R),this.__originalScale(E,R)},L.transform=function(E,R,O,B,F,Z){P.transform(E,R,O,B,F,Z),this.__originalTransform(E,R,O,B,F,Z)},L.setTransform=function(E,R,O,B,F,Z){P.setTransform(E,R,O,B,F,Z),this.__originalSetTransform(E,R,O,B,F,Z)},L.resetTransform=function(){P.resetTransform(),this.__originalResetTransform()},L.rotate=function(E){P.rotate(E),this.__originalRotate(E)},L.clip=function(E){P.clip(E),this.__originalClip(E)},L.moveTo=function(M,E){P.moveTo(M,E),this.__originalMoveTo(M,E)},L.lineTo=function(M,E){P.lineTo(M,E),this.__originalLineTo(M,E)},L.bezierCurveTo=function(M,E,R,O,B,F){P.bezierCurveTo(M,E,R,O,B,F),this.__originalBezierCurveTo(M,E,R,O,B,F)},L.rect=function(M,E,R,O){P.rect(M,E,R,O),this.__originalRect(M,E,R,O)},L.closePath=function(){P.closePath(),this.__originalClosePath()},L.beginPath=function(){P.beginPath(),this.__originalBeginPath()}}class r{constructor(P){this.canvasFactory=P,this.cache=Object.create(null)}getCanvas(P,M,E){let R;return this.cache[P]!==void 0?(R=this.cache[P],this.canvasFactory.reset(R,M,E))
`}setFont(c){const s=this.current,x=this.commonObjs.get(c[0]);let T=c[1];s.font=x,this.embedFonts&&!x.missingFile&&!this.embeddedFonts[x.loadedName]&&(this.addFontStyle(x),this.embeddedFonts[x.loadedName]=x),s.fontMatrix=x.fontMatrix||y.FONT_IDENTITY_MATRIX;let S="normal";x.black?S="900":x.bold&&(S="bold");const D=x.italic?"italic":"normal";T<0?(T=-T,s.fontDirection=-1):s.fontDirection=1,s.fontSize=T,s.fontFamily=x.loadedName,s.fontWeight=S,s.fontStyle=D,s.tspan=this.svgFactory.createElement("svg:tspan"),s.tspan.setAttributeNS(null,"y",a(-s.y)),s.xcoords=[],s.ycoords=[]}endText(){var s;const c=this.current;c.textRenderingMode&y.TextRenderingMode.ADD_TO_PATH_FLAG&&((s=c.txtElement)!=null&&s.hasChildNodes())&&(c.element=c.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(c){c>0&&(this.current.lineWidth=c)}setLineCap(c){this.current.lineCap=e[c]}setLineJoin(c){this.current.lineJoin=i[c]}setMiterLimit(c){this.current.miterLimit=c}setStrokeAlpha(c){this.current.strokeAlpha=c}setStrokeRGBColor(c,s,x){this.current.strokeColor=y.Util.makeHexColor(c,s,x)}setFillAlpha(c){this.current.fillAlpha=c}setFillRGBColor(c,s,x){this.current.fillColor=y.Util.makeHexColor(c,s,x),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(c){this.current.strokeColor=this._makeColorN_Pattern(c)}setFillColorN(c){this.current.fillColor=this._makeColorN_Pattern(c)}shadingFill(c){const{width:s,height:x}=this.viewport,T=y.Util.inverseTransform(this.transformMatrix),[S,D,I,_]=y.Util.getAxialAlignedBoundingBox([0,0,s,x],T),Q=this.svgFactory.createElement("svg:rect");Q.setAttributeNS(null,"x",S),Q.setAttributeNS(null,"y",D),Q.setAttributeNS(null,"width",I-S),Q.setAttributeNS(null,"height",_-D),Q.setAttributeNS(null,"fill",this._makeShadingPattern(c)),this.current.fillAlpha<1&&Q.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(Q)}_makeColorN_Pattern(c){return c[0]==="TilingPattern"?this._makeTilingPattern(c):this._makeShadingPattern(c)}_makeTilingPattern(c){const s=c[1],x=c[2],T=c[3]||y.IDENTITY_MATRIX,[S,D,I,_]=c[4],Q=c[5],W=c[6],j=c[7],he=`shading${v++}`,[Y,z,ee,oe]=y.Util.normalizeRect([...y.Util.applyTransform([S,D],T),...y.Util.applyTransform([I,_],T)]),[ye,Pe]=y.Util.singularValueDecompose2dScale(T),L=Q*ye,P=W*Pe,M=this.svgFactory.createElement("svg:pattern");M.setAttributeNS(null,"id",he),M.setAttributeNS(null,"patternUnits","userSpaceOnUse"),M.setAttributeNS(null,"width",L),M.setAttributeNS(null,"height",P),M.setAttributeNS(null,"x",`${Y}`),M.setAttributeNS(null,"y",`${z}`);const E=this.svg,R=this.transformMatrix,O=this.current.fillColor,B=this.current.strokeColor,F=this.svgFactory.create(ee-Y,oe-z);if(this.svg=F,this.transformMatrix=T,j===2){const Z=y.Util.makeHexColor(...s);this.current.fillColor=Z,this.current.strokeColor=Z}return this.executeOpTree(this.convertOpList(x)),this.svg=E,this.transformMatrix=R,this.current.fillColor=O,this.current.strokeColor=B,M.append(F.childNodes[0]),this.defs.append(M),`url(#${he})`}_makeShadingPattern(c){switch(typeof c=="string"&&(c=this.objs.get(c)),c[0]){case"RadialAxial":const s=`shading${v++}`,x=c[3];let T;switch(c[1]){case"axial":const S=c[4],D=c[5];T=this.svgFactory.createElement("svg:linearGradient"),T.setAttributeNS(null,"id",s),T.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),T.setAttributeNS(null,"x1",S[0]),T.setAttributeNS(null,"y1",S[1]),T.setAttributeNS(null,"x2",D[0]),T.setAttributeNS(null,"y2",D[1]);break;case"radial":const I=c[4],_=c[5],Q=c[6],W=c[7];T=this.svgFactory.createElement("svg:radialGradient"),T.setAttributeNS(null,"id",s),T.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),T.setAttributeNS(null,"cx",_[0]),T.setAttributeNS(null,"cy",_[1]),T.setAttributeNS(null,"r",W),T.setAttributeNS(null,"fx",I[0]),T.setAttributeNS(null,"fy",I[1]),T.setAttributeNS(null,"fr",Q);break;default:throw new Error(`Unknown RadialAxial type: ${c[1]}`)}for(const S of x){const D=this.svgFactory.createElement("svg:stop");D.setAttributeNS(null,"offset",S[0]),D.setAttributeNS(nul
`),position:B,pageIndex:F-1,rect:M,rotation:E,id:R,deleted:!1}}const Pe=super.deserialize(z,ee,oe);return le(Pe,r,z.fontSize),le(Pe,h,p.Util.makeHexColor(...z.color)),le(Pe,f,z.value),Pe.annotationElementId=z.id||null,le(Pe,o,ye),Pe}serialize(){let z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const ee=j._internalPadding*this.parentScale,oe=this.getRect(ee,ee),ye=k.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:l(this,h)),Pe={annotationType:p.AnnotationEditorType.FREETEXT,color:ye,fontSize:l(this,r),value:l(this,f),pageIndex:this.pageIndex,rect:oe,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return z?Pe:this.annotationElementId&&!J(this,I,pr).call(this,Pe)?null:(Pe.id=this.annotationElementId,Pe)}};e=new WeakMap,i=new WeakMap,n=new WeakMap,d=new WeakMap,h=new WeakMap,f=new WeakMap,a=new WeakMap,r=new WeakMap,o=new WeakMap,m=new WeakSet,ur=function(z){const ee=ye=>{this.editorDiv.style.fontSize=`calc(${ye}px * var(--scale-factor))`,this.translate(0,-(ye-l(this,r))*this.parentScale),le(this,r,ye),J(this,x,Et).call(this)},oe=l(this,r);this.addCommands({cmd:()=>{ee(z)},undo:()=>{ee(oe)},mustExec:!0,type:p.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},A=new WeakSet,dr=function(z){const ee=l(this,h);this.addCommands({cmd:()=>{le(this,h,this.editorDiv.style.color=z)},undo:()=>{le(this,h,this.editorDiv.style.color=ee)},mustExec:!0,type:p.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},c=new WeakSet,fr=function(){const z=this.editorDiv.getElementsByTagName("div");if(z.length===0)return this.editorDiv.innerText;const ee=[];for(const oe of z)ee.push(oe.innerText.replace(/\r\n?|\n/,""));return ee.join(`
`)},x=new WeakSet,Et=function(){const[z,ee]=this.parentDimensions;let oe;if(this.isAttachedToDOM)oe=this.div.getBoundingClientRect();else{const{currentLayer:ye,div:Pe}=this,L=Pe.style.display;Pe.style.display="hidden",ye.div.append(this.div),oe=Pe.getBoundingClientRect(),Pe.remove(),Pe.style.display=L}this.rotation%180===this.parentRotation%180?(this.width=oe.width/z,this.height=oe.height/ee):(this.width=oe.height/z,this.height=oe.width/ee),this.fixAndSetPosition()},S=new WeakSet,vn=function(){if(this.editorDiv.replaceChildren(),!!l(this,f))for(const z of l(this,f).split(`
`)){const ee=document.createElement("div");ee.append(z?document.createTextNode(z):document.createElement("br")),this.editorDiv.append(ee)}},I=new WeakSet,pr=function(z){const{value:ee,fontSize:oe,color:ye,rect:Pe,pageIndex:L}=l(this,o);return z.value!==ee||z.fontSize!==oe||z.rect.some((P,M)=>Math.abs(P-Pe[M])>=1)||z.color.some((P,M)=>P!==ye[M])||z.pageIndex!==L},Q=new WeakSet,bn=function(){let z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.annotationElementId)return;if(J(this,x,Et).call(this),!z&&(this.width===0||this.height===0)){setTimeout(()=>J(this,Q,bn).call(this,!0),0);return}const ee=j._internalPadding*this.parentScale;l(this,o).rect=this.getRect(ee,ee)},tt(j,"_freeTextDefaultContent",""),tt(j,"_internalPadding",0),tt(j,"_defaultColor",null),tt(j,"_defaultFontSize",10),tt(j,"_type","freetext");let g=j;w.FreeTextEditor=g},(N,w,t)=>{var M,R,ht,B,gr,Z,se,q,pe,te,me,ve,Re,Oe,Ie,Le,ue,ne,ce,ge,Ce,Me,Ve,mr,_e,Nt,Ke,yn,je,An,V,H,X,de,Ee,K,U,Sn,Ae,Se,we,Te,vr,ke,En;Object.defineProperty(w,"__esModule",{value:!0}),w.StampAnnotationElement=w.InkAnnotationElement=w.FreeTextAnnotationElement=w.AnnotationLayer=void 0,t(89),t(125),t(136),t(138),t(141),t(143),t(145),t(147);var p=t(1),y=t(168),k=t(163),u=t(199),g=t(200),e=t(201);const i=1e3,n=9,d=new WeakSet;function h(Be){return{width:Be[2]-Be[0],height:Be[3]-Be[1]}}class f{static create(re){switch(re.data.annotationType){case p.AnnotationType.LINK:return new r(re);case p.AnnotationType.TEXT:return new o(re);case p.AnnotationType.WIDGET:switch(re.data.fieldType){case"Tx":return new v(re);case"Btn":return re.data.radioButton?new c(re):re.data.checkBox?new b(re):new s(re);case"Ch":return new x(re);case"Sig":return new A(re)}return new m(re);case p.AnnotationType.POPUP:return new T(re);case p.AnnotationType.FREETEXT:return new D(re);case p.AnnotationType.LINE:return new I(re);case p.AnnotationType.SQUARE:return new _(re);case p.AnnotationType.CIRCLE:return new Q(re);case p.AnnotationType.POLYLINE:return new W(re);case p.AnnotationType.CARET:return new he(re);case p.AnnotationType.INK:return new Y(re);case p.AnnotationType.POLYGON:return new j(re);case p.AnnotationType.HIGHLIGHT:return new z(re);case p.AnnotationType.UNDERLINE:return new ee(re);case p.AnnotationType.SQUIGGLY:return new oe(re);case p.AnnotationType.STRIKEOUT:return new ye(re);case p.AnnotationType.STAMP:return new Pe(re);case p.AnnotationType.FILEATTACHMENT:return new L(re);default:return new a(re)}}}const E=class E{constructor(re){$(this,M,!1);let{isRenderable:C=!1,ignoreBorder:G=!1,createQuadrilaterals:ae=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.isRenderable=C,this.data=re.data,this.layer=re.layer,this.linkService=re.linkService,this.downloadManager=re.downloadManager,this.imageResourcesPath=re.imageResourcesPath,this.renderForms=re.renderForms,this.svgFactory=re.svgFactory,this.annotationStorage=re.annotationStorage,this.enableScripting=re.enableScripting,this.hasJSActions=re.hasJSActions,this._fieldObjects=re.fieldObjects,this.parent=re.parent,C&&(this.container=this._createContainer(G)),ae&&this._createQuadrilaterals()}static _hasPopupData(re){let{titleObj:C,contentsObj:G,richText:ae}=re;return!!(C!=null&&C.str||G!=null&&G.str||ae!=null&&ae.str)}get hasPopupData(){return E._hasPopupData(this.data)}_createContainer(re){const{data:C,parent:{page:G,viewport:ae}}=this,fe=document.createElement("section");fe.setAttribute("data-annotation-id",C.id),this instanceof m||(fe.tabIndex=i),fe.style.zIndex=this.parent.zIndex++,this.data.popupRef&&fe.setAttribute("aria-haspopup","dialog"),C.noRotate&&fe.classList.add("norotate");const{pageWidth:be,pageHeight:xe,pageX:De,pageY:We}=ae.rawDims;if(!C.rect||this instanceof T){const{rotation:Ye}=C;return!C.hasOwnCanvas&&Ye!==0&&this.setRotation(Ye,fe),fe}const{width:Fe,height:Ze}=h(C.rect),Ge=p.Util.normalizeRect([C.rect[0],G.view[3]-C.rect[1]+G.view[1],C.rect[2],G.view[3]-C.rect[3]+G.view[1]]);if(!re&&C.borderStyle.width>0){fe.style.borderWidth=`${C.borderStyle.width}px`;const Ye=C.borderStyle.horizontalCornerRadius,Qe=C.borderStyle.
`))||null;We&&this.data.comb&&(We=We.replaceAll(/\s+/g,""));const Fe={userValue:xe,formattedValue:We,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(G=document.createElement("textarea"),G.textContent=We??xe,this.data.doNotScroll&&(G.style.overflowY="hidden")):(G=document.createElement("input"),G.type="text",G.setAttribute("value",We??xe),this.data.doNotScroll&&(G.style.overflowX="hidden")),this.data.hasOwnCanvas&&(G.hidden=!0),d.add(G),G.setAttribute("data-element-id",C),G.disabled=this.data.readOnly,G.name=this.data.fieldName,G.tabIndex=i,this._setRequired(G,this.data.required),De&&(G.maxLength=De),G.addEventListener("input",Ge=>{re.setValue(C,{value:Ge.target.value}),this.setPropertyOnSiblings(G,"value",Ge.target.value,"value"),Fe.formattedValue=null}),G.addEventListener("resetform",Ge=>{const $e=this.data.defaultFieldValue??"";G.value=Fe.userValue=$e,Fe.formattedValue=null});let Ze=Ge=>{const{formattedValue:$e}=Fe;$e!=null&&(Ge.target.value=$e),Ge.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){G.addEventListener("focus",$e=>{if(Fe.focused)return;const{target:Ye}=$e;Fe.userValue&&(Ye.value=Fe.userValue),Fe.lastCommittedValue=Ye.value,Fe.commitKey=1,Fe.focused=!0}),G.addEventListener("updatefromsandbox",$e=>{this.showElementAndHideCanvas($e.target);const Ye={value(Qe){Fe.userValue=Qe.detail.value??"",re.setValue(C,{value:Fe.userValue.toString()}),Qe.target.value=Fe.userValue},formattedValue(Qe){const{formattedValue:qe}=Qe.detail;Fe.formattedValue=qe,qe!=null&&Qe.target!==document.activeElement&&(Qe.target.value=qe),re.setValue(C,{formattedValue:qe})},selRange(Qe){Qe.target.setSelectionRange(...Qe.detail.selRange)},charLimit:Qe=>{var nt;const{charLimit:qe}=Qe.detail,{target:et}=Qe;if(qe===0){et.removeAttribute("maxLength");return}et.setAttribute("maxLength",qe);let rt=Fe.userValue;!rt||rt.length<=qe||(rt=rt.slice(0,qe),et.value=Fe.userValue=rt,re.setValue(C,{value:rt}),(nt=this.linkService.eventBus)==null||nt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:C,name:"Keystroke",value:rt,willCommit:!0,commitKey:1,selStart:et.selectionStart,selEnd:et.selectionEnd}}))}};this._dispatchEventFromSandbox(Ye,$e)}),G.addEventListener("keydown",$e=>{var qe;Fe.commitKey=1;let Ye=-1;if($e.key==="Escape"?Ye=0:$e.key==="Enter"&&!this.data.multiLine?Ye=2:$e.key==="Tab"&&(Fe.commitKey=3),Ye===-1)return;const{value:Qe}=$e.target;Fe.lastCommittedValue!==Qe&&(Fe.lastCommittedValue=Qe,Fe.userValue=Qe,(qe=this.linkService.eventBus)==null||qe.dispatch("dispatcheventinsandbox",{source:this,detail:{id:C,name:"Keystroke",value:Qe,willCommit:!0,commitKey:Ye,selStart:$e.target.selectionStart,selEnd:$e.target.selectionEnd}}))});const Ge=Ze;Ze=null,G.addEventListener("blur",$e=>{var Qe;if(!Fe.focused||!$e.relatedTarget)return;Fe.focused=!1;const{value:Ye}=$e.target;Fe.userValue=Ye,Fe.lastCommittedValue!==Ye&&((Qe=this.linkService.eventBus)==null||Qe.dispatch("dispatcheventinsandbox",{source:this,detail:{id:C,name:"Keystroke",value:Ye,willCommit:!0,commitKey:Fe.commitKey,selStart:$e.target.selectionStart,selEnd:$e.target.selectionEnd}})),Ge($e)}),(fe=this.data.actions)!=null&&fe.Keystroke&&G.addEventListener("beforeinput",$e=>{var lt;Fe.lastCommittedValue=null;const{data:Ye,target:Qe}=$e,{value:qe,selectionStart:et,selectionEnd:rt}=Qe;let nt=et,it=rt;switch($e.inputType){case"deleteWordBackward":{const ct=qe.substring(0,et).match(/\w*[^\w]*$/);ct&&(nt-=ct[0].length);break}case"deleteWordForward":{const ct=qe.substring(et).match(/^[^\w]*\w*/);ct&&(it+=ct[0].length);break}case"deleteContentBackward":et===rt&&(nt-=1);break;case"deleteContentForward":et===rt&&(it+=1);break}$e.preventDefault(),(lt=this.linkService.eventBus)==null||lt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:C,name:"Keystroke",value:qe,change:Ye||"",willCommit:!1,selStart:nt,selEnd:it}})}),this._setEventListeners(G,Fe,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],$e=>$e.target.value)}if(Ze&&G.addEventListener("blur",Ze),this.data.c
`),Qe=Ye?fe.length-2:fe.length;Be=!0;let qe=Qe;Fe+Ue===((Ge=ie[we])==null?void 0:Ge[1])&&(qe-=ie[we][0],++we);for(let et=1;et<=qe;et++)Se.push([Fe-1-Ne+et,Ne-et]);return Ne-=qe,ke+=qe,Ye?(Fe+=Qe-1,Se.push([Fe-Ne+1,1+Ne]),Ne+=1,ke+=1,Ue+=1,fe.slice(0,Qe)):fe}if(be){const Ye=be.length-2;return Se.push([Fe-Ne+Ye,1+Ne]),Ne+=1,ke+=1,Ue+=1,be.slice(0,-2)}if(xe){const Ye=xe.length-1;return Se.push([Fe-Ne+Ye,Ne]),ke+=1,Ue+=1,xe.slice(0,-1)}if(De)return Se.push([Fe-Ne+1,Ne-1]),Ne-=1,ke+=1,Ue+=1," ";if(Fe+Ue===(($e=Ee[Te])==null?void 0:$e[1])){const Ye=Ee[Te][0]-1;++Te;for(let Qe=1;Qe<=Ye;Qe++)Se.push([Fe-(Ne-Qe),Ne-Qe]);Ne-=Ye,ke+=Ye}return We}),Se.push([Ae.length,Ne]),[Ae,Se,Be]}function W(de,Ee,K){if(!de)return[Ee,K];const U=Ee,ie=Ee+K-1;let Ae=(0,i.binarySearchFirstItem)(de,ke=>ke[0]>=U);de[Ae][0]>U&&--Ae;let Se=(0,i.binarySearchFirstItem)(de,ke=>ke[0]>=ie,Ae);de[Se][0]>ie&&--Se;const we=U+de[Ae][1],Ne=ie+de[Se][1]+1-we;return[we,Ne]}class j{constructor(Ee){$(this,ee);$(this,ye);$(this,L);$(this,M);$(this,R);$(this,B);$(this,Z);$(this,q);$(this,te);$(this,ve);$(this,Oe);$(this,Le);$(this,ne);$(this,ge);$(this,Me);$(this,ze);$(this,He);$(this,Xe);$(this,Je);$(this,H);$(this,he,null);$(this,Y,!0);$(this,z,0);let{linkService:K,eventBus:U,updateMatchesCountOnProgress:ie=!0}=Ee;this._linkService=K,this._eventBus=U,le(this,Y,ie),this.onIsPageVisible=null,J(this,ye,In).call(this),U._on("find",J(this,ee,Dr).bind(this)),U._on("findbarclose",J(this,He,Wr).bind(this))}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return l(this,he)}setDocument(Ee){this._pdfDocument&&J(this,ye,In).call(this),Ee&&(this._pdfDocument=Ee,this._firstPageCapability.resolve())}scrollMatchIntoView(Ee){let{element:K=null,selectedLeft:U=0,pageIndex:ie=-1,matchIndex:Ae=-1}=Ee;if(!this._scrollMatches||!K)return;if(Ae===-1||Ae!==this._selected.matchIdx)return;if(ie===-1||ie!==this._selected.pageIdx)return;this._scrollMatches=!1;const Se={top:a,left:U+r};(0,i.scrollIntoView)(K,Se,!0)}}he=new WeakMap,Y=new WeakMap,z=new WeakMap,ee=new WeakSet,Dr=function(Ee){if(!Ee)return;Ee.phraseSearch===!1&&(console.error("The `phraseSearch`-parameter was removed, please provide an Array of strings in the `query`-parameter instead."),typeof Ee.query=="string"&&(Ee.query=Ee.query.match(/\S+/g)));const K=this._pdfDocument,{type:U}=Ee;(l(this,he)===null||J(this,M,Fr).call(this,Ee))&&(this._dirtyMatch=!0),le(this,he,Ee),U!=="highlightallchange"&&J(this,H,Ct).call(this,h.PENDING),this._firstPageCapability.promise.then(()=>{if(!this._pdfDocument||K&&this._pdfDocument!==K)return;J(this,te,Vr).call(this);const ie=!this._highlightMatches,Ae=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),U?this._dirtyMatch?J(this,Le,vt).call(this):U==="again"?(J(this,Le,vt).call(this),ie&&l(this,he).highlightAll&&J(this,Oe,Tt).call(this)):U==="highlightallchange"?(Ae?J(this,Le,vt).call(this):this._highlightMatches=!0,J(this,Oe,Tt).call(this)):J(this,Le,vt).call(this):this._findTimeout=setTimeout(()=>{J(this,Le,vt).call(this),this._findTimeout=null},f)})},ye=new WeakSet,In=function(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],le(this,z,0),le(this,he,null),this._selected={pageIdx:-1,matchIdx:-1},this._offset={pageIdx:null,matchIdx:null,wrapped:!1},this._extractTextPromises=[],this._pageContents=[],this._pageDiffs=[],this._hasDiacritics=[],this._matchesCountTotal=0,this._pagesToSearch=null,this._pendingFindMatches=new Set,this._resumePageIdx=null,this._dirtyMatch=!1,clearTimeout(this._findTimeout),this._findTimeout=null,this._firstPageCapability=new d.PromiseCapability},L=new WeakSet,Ln=function(){const{query:Ee}=l(this,he);return typeof Ee=="string"?(Ee!==this._rawQuery&&(this._rawQuery=Ee,[this._normalizedQuery]=Q(Ee)),this._normalizedQuery):(Ee||[]).filter(K=>!!K).map(K=>Q(K)[0])},M=new WeakSet,Fr=function(Ee){var Se;const K=Ee.query,U
`);[this._pageContents[U],this._pageDiffs[U],this._hasDiacritics[U]]=Q(we.join("")),Ae.resolve()},Se=>{console.error(`Unable to get text content for page ${U+1}`,Se),this._pageContents[U]="",this._pageDiffs[U]=null,this._hasDiacritics[U]=!1,Ae.resolve()}))}},ve=new WeakSet,$t=function(Ee){this._scrollMatches&&this._selected.pageIdx===Ee&&(this._linkService.page=Ee+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:Ee})},Oe=new WeakSet,Tt=function(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})},Le=new WeakSet,vt=function(){const Ee=l(this,he).findPrevious,K=this._linkService.page-1,U=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=K,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,le(this,z,0),this._matchesCountTotal=0,J(this,Oe,Tt).call(this);for(let Se=0;Se<U;Se++)this._pendingFindMatches.has(Se)||(this._pendingFindMatches.add(Se),this._extractTextPromises[Se].then(()=>{this._pendingFindMatches.delete(Se),J(this,q,Ur).call(this,Se)}))}if(l(this,L,Ln).length===0){J(this,H,Ct).call(this,h.FOUND);return}if(this._resumePageIdx)return;const Ae=this._offset;if(this._pagesToSearch=U,Ae.matchIdx!==null){const Se=this._pageMatches[Ae.pageIdx].length;if(!Ee&&Ae.matchIdx+1<Se||Ee&&Ae.matchIdx>0){Ae.matchIdx=Ee?Ae.matchIdx-1:Ae.matchIdx+1,J(this,ze,_t).call(this,!0);return}J(this,Me,Fn).call(this,Ee)}J(this,ge,Dn).call(this)},ne=new WeakSet,Hr=function(Ee){const K=this._offset,U=Ee.length,ie=l(this,he).findPrevious;return U?(K.matchIdx=ie?U-1:0,J(this,ze,_t).call(this,!0),!0):(J(this,Me,Fn).call(this,ie),K.wrapped&&(K.matchIdx=null,this._pagesToSearch<0)?(J(this,ze,_t).call(this,!1),!0):!1)},ge=new WeakSet,Dn=function(){this._resumePageIdx!==null&&console.error("There can only be one pending page.");let Ee=null;do{const K=this._offset.pageIdx;if(Ee=this._pageMatches[K],!Ee){this._resumePageIdx=K;break}}while(!J(this,ne,Hr).call(this,Ee))},Me=new WeakSet,Fn=function(Ee){const K=this._offset,U=this._linkService.pagesCount;K.pageIdx=Ee?K.pageIdx-1:K.pageIdx+1,K.matchIdx=null,this._pagesToSearch--,(K.pageIdx>=U||K.pageIdx<0)&&(K.pageIdx=Ee?U-1:0,K.wrapped=!0)},ze=new WeakSet,_t=function(){let Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,K=h.NOT_FOUND;const U=this._offset.wrapped;if(this._offset.wrapped=!1,Ee){const ie=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,K=U?h.WRAPPED:h.FOUND,ie!==-1&&ie!==this._selected.pageIdx&&J(this,ve,$t).call(this,ie)}J(this,H,Ct).call(this,K,l(this,he).findPrevious),this._selected.pageIdx!==-1&&(this._scrollMatches=!0,J(this,ve,$t).call(this,this._selected.pageIdx))},He=new WeakSet,Wr=function(Ee){const K=this._pdfDocument;this._firstPageCapability.promise.then(()=>{!this._pdfDocument||K&&this._pdfDocument!==K||(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),J(this,H,Ct).call(this,h.FOUND),this._highlightMatches=!1,J(this,Oe,Tt).call(this))})},Xe=new WeakSet,Nn=function(){var Ae;const{pageIdx:Ee,matchIdx:K}=this._selected;let U=0,ie=this._matchesCountTotal;if(K!==-1){for(let Se=0;Se<Ee;Se++)U+=((Ae=this._pageMatches[Se])==null?void 0:Ae.length)||0;U+=K+1}return(U<1||U>ie)&&(U=ie=0),{current:U,total:ie}},Je=new WeakSet,Bn=function(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:J(this,Xe,Nn).call(this)})},H=new WeakSet,Ct=function(Ee){var U;let K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;!l(this,Y)&&(l(this,z)!==this._linkService.pagesCount||Ee===h.PENDING)||this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:Ee,previous:K,matchesCount:J(this,Xe,Nn).call(this),rawQuery:((U=l(this,he))==null?void 0:U.query)??null})},g.PDFFindController=j},(u,g,e)=>{var i=e(3),n=e(69),d=e(79);i({target:"Set",proto:!0,real:!0,for
`,"\\r":"\r","\\t":" "},v=/^[\da-f]{4}$/i,A=/^[\u0000-\u001F]$/;u.exports=function(b,c){for(var s=!0,x="";c<b.length;){var T=a(b,c);if(T==="\\"){var S=r(b,c,c+2);if(n(m,S))x+=m[S],c+=2;else if(S==="\\u"){c+=2;var D=r(b,c,c+4);if(!o(v,D))throw d("Bad Unicode escape at: "+c);x+=f(h(D,16)),c+=4}else throw d('Unknown escape sequence: "'+S+'"')}else if(T==='"'){s=!1,c++;break}else{if(o(A,T))throw d("Bad control character in string literal at: "+c);x+=T,c++}}if(s)throw d("Unterminated string at: "+c);return{value:x,end:c}}},(u,g,e)=>{var f,a,Vn;Object.defineProperty(g,"__esModule",{value:!0}),g.AnnotationLayerBuilder=void 0;var i=e(107),n=e(125),d=e(97);class h{constructor(m){$(this,a);$(this,f,null);let{pageDiv:v,pdfPage:A,linkService:b,downloadManager:c,annotationStorage:s=null,imageResourcesPath:x="",renderForms:T=!0,l10n:S=n.NullL10n,enableScripting:D=!1,hasJSActionsPromise:I=null,fieldObjectsPromise:_=null,annotationCanvasMap:Q=null,accessibilityManager:W=null}=m;this.pageDiv=v,this.pdfPage=A,this.linkService=b,this.downloadManager=c,this.imageResourcesPath=x,this.renderForms=T,this.l10n=S,this.annotationStorage=s,this.enableScripting=D,this._hasJSActionsPromise=I||Promise.resolve(!1),this._fieldObjectsPromise=_||Promise.resolve(null),this._annotationCanvasMap=Q,this._accessibilityManager=W,this.annotationLayer=null,this.div=null,this._cancelled=!1,this._eventBus=b.eventBus}async render(m){var x;let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"display";if(this.div){if(this._cancelled||!this.annotationLayer)return;this.annotationLayer.update({viewport:m.clone({dontFlip:!0})});return}const[A,b,c]=await Promise.all([this.pdfPage.getAnnotations({intent:v}),this._hasJSActionsPromise,this._fieldObjectsPromise]);if(this._cancelled)return;const s=this.div=document.createElement("div");if(s.className="annotationLayer",this.pageDiv.append(s),A.length===0){this.hide();return}this.annotationLayer=new i.AnnotationLayer({div:s,accessibilityManager:this._accessibilityManager,annotationCanvasMap:this._annotationCanvasMap,l10n:this.l10n,page:this.pdfPage,viewport:m.clone({dontFlip:!0})}),await this.annotationLayer.render({annotations:A,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,linkService:this.linkService,downloadManager:this.downloadManager,annotationStorage:this.annotationStorage,enableScripting:this.enableScripting,hasJSActions:b,fieldObjects:c}),this.linkService.isInPresentationMode&&J(this,a,Vn).call(this,d.PresentationModeState.FULLSCREEN),l(this,f)||(le(this,f,T=>{J(this,a,Vn).call(this,T.state)}),(x=this._eventBus)==null||x._on("presentationmodechanged",l(this,f)))}cancel(){var m;this._cancelled=!0,l(this,f)&&((m=this._eventBus)==null||m._off("presentationmodechanged",l(this,f)),le(this,f,null))}hide(){this.div&&(this.div.hidden=!0)}}f=new WeakMap,a=new WeakSet,Vn=function(m){if(!this.div)return;let v=!1;switch(m){case d.PresentationModeState.FULLSCREEN:v=!0;break;case d.PresentationModeState.NORMAL:break;default:return}for(const A of this.div.childNodes)A.hasAttribute("data-internal-link")||(A.inert=v)},g.AnnotationLayerBuilder=h},(u,g)=>{Object.defineProperty(g,"__esModule",{value:!0}),g.NullL10n=void 0,g.getL10nFallback=i;const e={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientati
`).replace(/\\r/g,"\r").replace(/\\t/g," ").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}function L(P,M){var E={},R=/^\s*|\s*$/,O=/^\s*#|^\s*$/,B=/^\s*\[(.*)\]\s*$/,F=/^\s*@import\s+url\((.*)\)\s*$/i,Z=/^([^=\s]*)\s*=\s*(.+)$/;function se(pe,te,me){var ve=pe.replace(R,"").split(/[\r\n]+/),Re="*",Oe=z.split("-",1)[0],Ie=!1,Le="";function ue(){for(;;){if(!ve.length){me();return}var ne=ve.shift();if(!O.test(ne)){if(te){if(Le=B.exec(ne),Le){Re=Le[1].toLowerCase(),Ie=Re!=="*"&&Re!==z&&Re!==Oe;continue}else if(Ie)continue;if(Le=F.exec(ne),Le){q(ye+Le[1],ue);return}}var ce=ne.match(Z);ce&&ce.length==3&&(E[ce[1]]=Pe(ce[2]))}}}ue()}function q(pe,te){s(pe,function(me){se(me,!1,te)},function(){console.warn(pe+" not found."),te()})}se(P,!0,function(){M(E)})}s(Y,function(P){h+=P,L(P,function(M){for(var E in M){var R,O,B=E.lastIndexOf(".");B>0?(R=E.substring(0,B),O=E.substring(B+1)):(R=E,O=f),d[R]||(d[R]={}),d[R][O]=M[E]}ee&&ee()})},oe)}function T(Y,z){Y&&(Y=Y.toLowerCase()),z=z||function(){},S(),a=Y;var ee=v(),oe=ee.length;if(oe===0){var ye=A();if(ye&&ye.locales&&ye.default_locale){if(console.log("using the embedded JSON directory, early way out"),d=ye.locales[Y],!d){var Pe=ye.default_locale.toLowerCase();for(var L in ye.locales)if(L=L.toLowerCase(),L===Y){d=ye.locales[Y];break}else L===Pe&&(d=ye.locales[Pe])}z()}else console.log("no resource to load, early way out");o="complete";return}var P=null,M=0;P=function(){M++,M>=oe&&(z(),o="complete")};function E(B){var F=B.href;this.load=function(Z,se){x(F,Z,se,function(){console.warn(F+" not found."),console.warn('"'+Z+'" resource not found'),a="",se()})}}for(var R=0;R<oe;R++){var O=new E(ee[R]);O.load(Y,P)}}function S(){d={},h="",a=""}function D(Y){var z={af:3,ak:4,am:4,ar:1,asa:3,az:0,be:11,bem:3,bez:3,bg:3,bh:4,bm:0,bn:3,bo:0,br:20,brx:3,bs:11,ca:3,cgg:3,chr:3,cs:12,cy:17,da:3,de:3,dv:3,dz:0,ee:3,el:3,en:3,eo:3,es:3,et:3,eu:3,fa:0,ff:5,fi:3,fil:4,fo:3,fr:5,fur:3,fy:3,ga:8,gd:24,gl:3,gsw:3,gu:3,guw:4,gv:23,ha:3,haw:3,he:2,hi:4,hr:11,hu:0,id:0,ig:0,ii:0,is:3,it:3,iu:7,ja:0,jmc:3,jv:0,ka:0,kab:5,kaj:3,kcg:3,kde:0,kea:0,kk:3,kl:3,km:0,kn:0,ko:0,ksb:3,ksh:21,ku:3,kw:7,lag:18,lb:3,lg:3,ln:4,lo:0,lt:10,lv:6,mas:3,mg:4,mk:16,ml:3,mn:3,mo:9,mr:3,ms:0,mt:15,my:0,nah:3,naq:7,nb:3,nd:3,ne:3,nl:3,nn:3,no:3,nr:3,nso:4,ny:3,nyn:3,om:3,or:3,pa:3,pap:3,pl:13,ps:3,pt:3,rm:3,ro:9,rof:3,ru:11,rwk:3,sah:0,saq:3,se:7,seh:3,ses:0,sg:0,sh:11,shi:19,sk:12,sl:14,sma:7,smi:7,smj:7,smn:7,sms:7,sn:3,so:3,sq:3,sr:11,ss:3,ssy:3,st:3,sv:3,sw:3,syr:3,ta:3,te:3,teo:3,th:0,ti:4,tig:3,tk:3,tl:4,tn:3,to:0,tr:0,ts:3,tzm:22,uk:11,ur:3,ve:3,vi:0,vun:3,wa:4,wae:3,wo:0,xh:3,xog:3,yo:0,zh:0,zu:3};function ee(L,P){return P.indexOf(L)!==-1}function oe(L,P,M){return P<=L&&L<=M}var ye={0:function(L){return"other"},1:function(L){return oe(L%100,3,10)?"few":L===0?"zero":oe(L%100,11,99)?"many":L==2?"two":L==1?"one":"other"},2:function(L){return L!==0&&L%10===0?"many":L==2?"two":L==1?"one":"other"},3:function(L){return L==1?"one":"other"},4:function(L){return oe(L,0,1)?"one":"other"},5:function(L){return oe(L,0,2)&&L!=2?"one":"other"},6:function(L){return L===0?"zero":L%10==1&&L%100!=11?"one":"other"},7:function(L){return L==2?"two":L==1?"one":"other"},8:function(L){return oe(L,3,6)?"few":oe(L,7,10)?"many":L==2?"two":L==1?"one":"other"},9:function(L){return L===0||L!=1&&oe(L%100,1,19)?"few":L==1?"one":"other"},10:function(L){return oe(L%10,2,9)&&!oe(L%100,11,19)?"few":L%10==1&&!oe(L%100,11,19)?"one":"other"},11:function(L){return oe(L%10,2,4)&&!oe(L%100,12,14)?"few":L%10===0||oe(L%10,5,9)||oe(L%100,11,14)?"many":L%10==1&&L%100!=11?"one":"other"},12:function(L){return oe(L,2,4)?"few":L==1?"one":"other"},13:function(L){return oe(L%10,2,4)&&!oe(L%100,12,14)?"few":L!=1&&oe(L%10,0,1)||oe(L%10,5,9)||oe(L%100,12,14)?"many":L==1?"one":"other"},14:function(L){return oe(L%100,3,4)?"few":L%100==2?"two":L%100==1?"one":"other"},15:function(L){return L===0||oe(L%100,2,10)?"few":oe(L%100,11,19)?"many":L==1?"one":"other"},16:function(L){return L%10==1&&L!=11?"one":"other"},17
`);V.push((0,n.removeNullCharacters)(H.join("")))}return V.join(`
`)}setDocument(V){var K,U;if(this.pdfDocument&&(this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),(K=this.findController)==null||K.setDocument(null),(U=this._scriptingManager)==null||U.setDocument(null),l(this,I)&&(l(this,I).destroy(),le(this,I,null))),this.pdfDocument=V,!V)return;const H=V.numPages,X=V.getPage(1),de=V.getOptionalContentConfig(),Ee=l(this,j)?V.getPermissions():Promise.resolve();if(H>o.FORCE_SCROLL_MODE_PAGE){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");const ie=this._scrollMode=n.ScrollMode.PAGE;this.eventBus.dispatch("scrollmodechanged",{source:this,mode:ie})}this._pagesCapability.promise.then(()=>{this.eventBus.dispatch("pagesloaded",{source:this,pagesCount:H})},()=>{}),this._onBeforeDraw=ie=>{const Ae=this._pages[ie.pageNumber-1];Ae&&l(this,T).push(Ae)},this.eventBus._on("pagerender",this._onBeforeDraw),this._onAfterDraw=ie=>{ie.cssTransform||this._onePageRenderedCapability.settled||(this._onePageRenderedCapability.resolve({timestamp:ie.timestamp}),this.eventBus._off("pagerendered",this._onAfterDraw),this._onAfterDraw=null,l(this,Pe)&&(document.removeEventListener("visibilitychange",l(this,Pe)),le(this,Pe,null)))},this.eventBus._on("pagerendered",this._onAfterDraw),Promise.all([X,Ee]).then(ie=>{var G,ae;let[Ae,Se]=ie;if(V!==this.pdfDocument)return;this._firstPageCapability.resolve(Ae),this._optionalContentConfigPromise=de;const{annotationEditorMode:we,annotationMode:Te,textLayerMode:Ne}=J(this,R,Qr).call(this,Se);if(Ne!==n.TextLayerMode.DISABLE){const fe=le(this,Y,document.createElement("div"));fe.id="hiddenCopyElement",this.viewer.before(fe)}if(we!==i.AnnotationEditorType.DISABLE){const fe=we;V.isPureXfa?console.warn("Warning: XFA-editing is not implemented."):m(fe)?(le(this,I,new i.AnnotationEditorUIManager(this.container,this.viewer,l(this,S),this.eventBus,V,this.pageColors)),fe!==i.AnnotationEditorType.NONE&&l(this,I).updateMode(fe)):console.error(`Invalid AnnotationEditor mode: ${fe}`)}const ke=J(this,M,Jr).bind(this),Ue=this._scrollMode===n.ScrollMode.PAGE?null:this.viewer,Be=this.currentScale,re=Ae.getViewport({scale:Be*i.PixelsPerInch.PDF_TO_CSS_UNITS});this.viewer.style.setProperty("--scale-factor",re.scale),(((G=this.pageColors)==null?void 0:G.foreground)==="CanvasText"||((ae=this.pageColors)==null?void 0:ae.background)==="Canvas")&&this.viewer.style.setProperty("--hcm-highligh-filter",V.filterFactory.addHighlightHCMFilter("CanvasText","Canvas","HighlightText","Highlight"));for(let fe=1;fe<=H;++fe){const be=new h.PDFPageView({container:Ue,eventBus:this.eventBus,id:fe,scale:Be,defaultViewport:re.clone(),optionalContentConfigPromise:de,renderingQueue:this.renderingQueue,textLayerMode:Ne,annotationMode:Te,imageResourcesPath:this.imageResourcesPath,isOffscreenCanvasSupported:this.isOffscreenCanvasSupported,maxCanvasPixels:this.maxCanvasPixels,pageColors:this.pageColors,l10n:this.l10n,layerProperties:ke});this._pages.push(be)}const C=this._pages[0];C&&(C.setPdfPage(Ae),this.linkService.cachePageRef(1,Ae.ref)),this._scrollMode===n.ScrollMode.PAGE?J(this,q,kt).call(this):this._spreadMode!==n.SpreadMode.NONE&&this._updateSpreadMode(),J(this,B,Zr).call(this).then(async()=>{var be,xe;if((be=this.findController)==null||be.setDocument(V),(xe=this._scriptingManager)==null||xe.setDocument(V),l(this,Y)&&(le(this,W,J(this,Z,jr).bind(this,Ne)),document.addEventListener("copy",l(this,W))),l(this,I)&&this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:l(this,D)}),V.loadingParams.disableAutoFetch||H>o.FORCE_LAZY_PAGE_INIT){this._pagesCapability.resolve();return}let fe=H-1;if(fe<=0){this._pagesCapability.resolve();return}for(let De=2;De<=H;++De){const We=V.getPage(De).then(Fe=>{const Ze=this._pages[De-1];Ze.pdfPage||Ze.setPdfPage(Fe),this.linkService.cachePageRef(De,Fe.ref),--fe===0&&this._pagesCapability.resolve()},Fe=>{console.error(`Unable to get page ${De} to initialize viewer`,Fe),--fe===0&&this._pagesCapability.resolve()});De%o.PAUSE_EAGER_PAGE_INIT===0&&await We}}),this.eventBus.dispatch("